├── common-util ├── .gitignore ├── src │ └── main │ │ └── java │ │ └── com │ │ └── yizhuoyan │ │ └── common │ │ ├── BeanMap.java │ │ ├── ArrayListSet.java │ │ ├── StringUtil.java │ │ └── ArrayListMap.java ├── pom.xml └── common-util.iml ├── .gitignore ├── README.md ├── jiajiale-web ├── src │ ├── main │ │ ├── resources │ │ │ ├── static │ │ │ │ ├── error │ │ │ │ │ ├── 5xx.html │ │ │ │ │ ├── 403.html │ │ │ │ │ └── 404.html │ │ │ │ ├── css │ │ │ │ │ └── common │ │ │ │ │ │ ├── group.group-layout.around.css │ │ │ │ │ │ ├── 01.pre+code.css │ │ │ │ │ │ ├── 01.iframe.css │ │ │ │ │ │ ├── 01.list.css │ │ │ │ │ │ ├── 01.fieldset.css │ │ │ │ │ │ ├── 02.ellipsis.css │ │ │ │ │ │ ├── component.message-box.css │ │ │ │ │ │ ├── component.avator.css │ │ │ │ │ │ ├── 01.img.css │ │ │ │ │ │ ├── 01.subsup.css │ │ │ │ │ │ ├── 02.txt-align.css │ │ │ │ │ │ ├── group.row-group.css │ │ │ │ │ │ ├── group.col-group.css │ │ │ │ │ │ ├── layout02.full.css │ │ │ │ │ │ ├── 01.kbd.css │ │ │ │ │ │ ├── component.breadcrumb.css │ │ │ │ │ │ ├── layout00.css │ │ │ │ │ │ ├── 01.a.css │ │ │ │ │ │ ├── 01.hr.css │ │ │ │ │ │ ├── 02.pad.css │ │ │ │ │ │ ├── 01.radio+checkbox.css │ │ │ │ │ │ ├── component.menu-as-action-bar.css │ │ │ │ │ │ ├── 01.form-vertical.css │ │ │ │ │ │ ├── 01.heading.css │ │ │ │ │ │ ├── 00.reset.css │ │ │ │ │ │ ├── layout90.table.css │ │ │ │ │ │ ├── layout20.hcell.css │ │ │ │ │ │ ├── layout21.vcell.css │ │ │ │ │ │ ├── layout10.hbox.css │ │ │ │ │ │ ├── layout11.vbox.css │ │ │ │ │ │ ├── 02.gap.css │ │ │ │ │ │ ├── component.pagination.css │ │ │ │ │ │ ├── component.nav-as-nav-bar.css │ │ │ │ │ │ ├── layout01.center-middle.css │ │ │ │ │ │ ├── 03.table-data.css │ │ │ │ │ │ ├── component.input-group.css │ │ │ │ │ │ ├── 01.scrollbar.css │ │ │ │ │ │ ├── 01.button.css │ │ │ │ │ │ ├── layout80.tab.css │ │ │ │ │ │ ├── 01.form-default.css │ │ │ │ │ │ └── 01.input.css │ │ │ │ ├── favicon.ico │ │ │ │ ├── avatar │ │ │ │ │ ├── 1.jpg │ │ │ │ │ ├── 10.jpg │ │ │ │ │ ├── 11.jpg │ │ │ │ │ ├── 12.jpg │ │ │ │ │ ├── 13.jpg │ │ │ │ │ ├── 14.jpg │ │ │ │ │ ├── 15.jpg │ │ │ │ │ ├── 16.jpg │ │ │ │ │ ├── 2.jpg │ │ │ │ │ ├── 3.jpg │ │ │ │ │ ├── 4.jpg │ │ │ │ │ ├── 5.jpg │ │ │ │ │ ├── 6.jpg │ │ │ │ │ ├── 7.jpg │ │ │ │ │ ├── 8.jpg │ │ │ │ │ └── 9.jpg │ │ │ │ ├── img │ │ │ │ │ ├── logo.32x32.png │ │ │ │ │ ├── logo.200x200.png │ │ │ │ │ ├── logo.400x400.png │ │ │ │ │ ├── glyphicons-halflings.png │ │ │ │ │ └── glyphicons-halflings-white.png │ │ │ │ └── js │ │ │ │ │ └── yi.toast.js │ │ │ ├── ValidationMessages.properties │ │ │ ├── ValidationMessages_jp.properties │ │ │ ├── ValidationMessages_zh.properties │ │ │ ├── public │ │ │ │ ├── welcome │ │ │ │ │ └── view.html │ │ │ │ ├── manager │ │ │ │ │ ├── mine │ │ │ │ │ │ └── view.html │ │ │ │ │ ├── index │ │ │ │ │ │ └── view.html │ │ │ │ │ ├── vip-consume-query │ │ │ │ │ │ └── view.html │ │ │ │ │ └── vip-manage │ │ │ │ │ │ └── add │ │ │ │ │ │ └── view.html │ │ │ │ ├── index.html │ │ │ │ ├── forget-password │ │ │ │ │ └── view.html │ │ │ │ ├── modify-password │ │ │ │ │ └── view.html │ │ │ │ ├── vip │ │ │ │ │ └── index │ │ │ │ │ │ ├── welcome.html │ │ │ │ │ │ └── view.html │ │ │ │ ├── clerk │ │ │ │ │ ├── consume-manage │ │ │ │ │ │ └── add │ │ │ │ │ │ │ └── view.html │ │ │ │ │ ├── add-vip-consume │ │ │ │ │ │ └── view.html │ │ │ │ │ ├── mine │ │ │ │ │ │ ├── view.html │ │ │ │ │ │ ├── info.html │ │ │ │ │ │ └── account.html │ │ │ │ │ └── add-vip │ │ │ │ │ │ └── view.html │ │ │ │ ├── login │ │ │ │ │ └── view.html │ │ │ │ └── login-log │ │ │ │ │ └── view.html │ │ │ ├── logback.xml │ │ │ ├── application.properties │ │ │ └── mapper │ │ │ │ ├── VipConsumeDaoMapper.xml │ │ │ │ ├── VipRankDaoMapper.xml │ │ │ │ ├── EmpClerkDaoMapper.xml │ │ │ │ ├── VipDetailDaoMapper.xml │ │ │ │ └── SysAccountDaoMapper.xml │ │ └── java │ │ │ └── com │ │ │ └── vip │ │ │ ├── dao │ │ │ ├── VipRankDao.java │ │ │ ├── SysAccountDao.java │ │ │ ├── EmpClerkDao.java │ │ │ ├── VipDetailDao.java │ │ │ ├── VipConsumeDao.java │ │ │ └── CRUDDao.java │ │ │ ├── ao │ │ │ ├── ModifyPasswordAo.java │ │ │ ├── AvatarAo.java │ │ │ ├── VipConsumeAo.java │ │ │ ├── ClerkAo.java │ │ │ └── VipAo.java │ │ │ ├── service │ │ │ ├── VipRankManageService.java │ │ │ ├── ClerkManageService.java │ │ │ ├── CommonService.java │ │ │ ├── impl │ │ │ │ ├── VipRankManageServiceImpl.java │ │ │ │ ├── ClerkManageServiceImpl.java │ │ │ │ ├── VipConsumeManageServiceImpl.java │ │ │ │ └── VipManageServiceImpl.java │ │ │ ├── VipConsumeManageService.java │ │ │ ├── VipManageService.java │ │ │ └── UserAccountService.java │ │ │ ├── dto │ │ │ ├── AvatarDto.java │ │ │ ├── JSONResponse.java │ │ │ ├── AccountContext.java │ │ │ └── QueryResult.java │ │ │ ├── entity │ │ │ ├── VipRankEntity.java │ │ │ ├── SysAccountRole.java │ │ │ ├── EmpClerkEntity.java │ │ │ ├── VipConsumeEntity.java │ │ │ ├── VipDetailEntity.java │ │ │ └── SysAccountEntity.java │ │ │ ├── web │ │ │ ├── controller │ │ │ │ ├── spring │ │ │ │ │ ├── StringTrimConverter.java │ │ │ │ │ ├── CommonCssController.java │ │ │ │ │ └── AllExceptionHandler.java │ │ │ │ ├── RequestListener.java │ │ │ │ ├── RankController.java │ │ │ │ ├── userhome │ │ │ │ │ ├── ClerkInfoController.java │ │ │ │ │ ├── AccountController.java │ │ │ │ │ └── AvatarController.java │ │ │ │ ├── ConsumeController.java │ │ │ │ ├── SessionController.java │ │ │ │ └── VipController.java │ │ │ └── interceptor │ │ │ │ └── SessionInterceptor.java │ │ │ ├── exception │ │ │ └── VipException.java │ │ │ ├── vo │ │ │ ├── VipListVO.java │ │ │ ├── VipConsumeListVO.java │ │ │ ├── VipConsumeDetailVO.java │ │ │ ├── ClerkDetailVo.java │ │ │ ├── AccountDetailVo.java │ │ │ └── VipDetailVO.java │ │ │ └── JiaJiaLeApplication.java │ └── test │ │ └── java │ │ ├── test │ │ └── vip │ │ │ ├── AbstractSpringTest.java │ │ │ ├── controller │ │ │ └── TestAccountController.java │ │ │ ├── service │ │ │ ├── TestVipConsumeManageServiceImpl.java │ │ │ └── TestVipManageServiceImpl.java │ │ │ └── dao │ │ │ ├── TestSysUserDao.java │ │ │ └── TestSysVipDetailDao.java │ │ └── tool │ │ └── yizhuoyan │ │ ├── GenereteInsertMethodBody.java │ │ ├── SQLUtil.java │ │ ├── GenereteResultSet2EntityMethodBody.java │ │ └── GenereteSetterMethodBody.java ├── .gitignore └── pom.xml ├── pom.xml └── jiajiale.iml /common-util/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | jiajiale.iml 3 | target/ -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # javaweb-jiajiale 2 | 佳佳乐消费查询系统 3 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/static/error/5xx.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/static/css/common/group.group-layout.around.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/static/css/common/01.pre+code.css: -------------------------------------------------------------------------------- 1 | pre,code, 2 | samp{ 3 | font-family: monospace; 4 | font-size: 1em; 5 | } -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/ValidationMessages.properties: -------------------------------------------------------------------------------- 1 | mobile.not-blank=the mobile number must enter. 2 | account.not-blank=The account must enter -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/static/css/common/01.iframe.css: -------------------------------------------------------------------------------- 1 | iframe { 2 | width: 100%; 3 | height: 100%; 4 | border: 0; 5 | display: block; 6 | } -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/static/css/common/01.list.css: -------------------------------------------------------------------------------- 1 | 2 | ul,ol,dl,li,dt,dd{ 3 | margin: 0; 4 | padding: 0; 5 | box-sizing: border-box; 6 | } -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhuoyan/javaweb-jiajiale/HEAD/jiajiale-web/src/main/resources/static/favicon.ico -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/static/avatar/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhuoyan/javaweb-jiajiale/HEAD/jiajiale-web/src/main/resources/static/avatar/1.jpg -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/static/avatar/10.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhuoyan/javaweb-jiajiale/HEAD/jiajiale-web/src/main/resources/static/avatar/10.jpg -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/static/avatar/11.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhuoyan/javaweb-jiajiale/HEAD/jiajiale-web/src/main/resources/static/avatar/11.jpg -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/static/avatar/12.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhuoyan/javaweb-jiajiale/HEAD/jiajiale-web/src/main/resources/static/avatar/12.jpg -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/static/avatar/13.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhuoyan/javaweb-jiajiale/HEAD/jiajiale-web/src/main/resources/static/avatar/13.jpg -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/static/avatar/14.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhuoyan/javaweb-jiajiale/HEAD/jiajiale-web/src/main/resources/static/avatar/14.jpg -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/static/avatar/15.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhuoyan/javaweb-jiajiale/HEAD/jiajiale-web/src/main/resources/static/avatar/15.jpg -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/static/avatar/16.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhuoyan/javaweb-jiajiale/HEAD/jiajiale-web/src/main/resources/static/avatar/16.jpg -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/static/avatar/2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhuoyan/javaweb-jiajiale/HEAD/jiajiale-web/src/main/resources/static/avatar/2.jpg -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/static/avatar/3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhuoyan/javaweb-jiajiale/HEAD/jiajiale-web/src/main/resources/static/avatar/3.jpg -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/static/avatar/4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhuoyan/javaweb-jiajiale/HEAD/jiajiale-web/src/main/resources/static/avatar/4.jpg -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/static/avatar/5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhuoyan/javaweb-jiajiale/HEAD/jiajiale-web/src/main/resources/static/avatar/5.jpg -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/static/avatar/6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhuoyan/javaweb-jiajiale/HEAD/jiajiale-web/src/main/resources/static/avatar/6.jpg -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/static/avatar/7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhuoyan/javaweb-jiajiale/HEAD/jiajiale-web/src/main/resources/static/avatar/7.jpg -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/static/avatar/8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhuoyan/javaweb-jiajiale/HEAD/jiajiale-web/src/main/resources/static/avatar/8.jpg -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/static/avatar/9.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhuoyan/javaweb-jiajiale/HEAD/jiajiale-web/src/main/resources/static/avatar/9.jpg -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/static/css/common/01.fieldset.css: -------------------------------------------------------------------------------- 1 | fieldset{ 2 | padding: .35em .625em .75em; 3 | margin: 0 2px; 4 | border: 1px solid silver; 5 | } -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/static/img/logo.32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhuoyan/javaweb-jiajiale/HEAD/jiajiale-web/src/main/resources/static/img/logo.32x32.png -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/static/img/logo.200x200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhuoyan/javaweb-jiajiale/HEAD/jiajiale-web/src/main/resources/static/img/logo.200x200.png -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/static/img/logo.400x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhuoyan/javaweb-jiajiale/HEAD/jiajiale-web/src/main/resources/static/img/logo.400x400.png -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/ValidationMessages_jp.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhuoyan/javaweb-jiajiale/HEAD/jiajiale-web/src/main/resources/ValidationMessages_jp.properties -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/ValidationMessages_zh.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhuoyan/javaweb-jiajiale/HEAD/jiajiale-web/src/main/resources/ValidationMessages_zh.properties -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/static/img/glyphicons-halflings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhuoyan/javaweb-jiajiale/HEAD/jiajiale-web/src/main/resources/static/img/glyphicons-halflings.png -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/static/css/common/02.ellipsis.css: -------------------------------------------------------------------------------- 1 | .ellipsis{ 2 | overflow: hidden; 3 | display:inline-block; 4 | white-space: nowrap; 5 | text-overflow: ellipsis; 6 | } -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/static/css/common/component.message-box.css: -------------------------------------------------------------------------------- 1 | .message-box { 2 | padding:1em; 3 | background: #00C0EF; 4 | color: #FFFBFB; 5 | border-radius: 5px; 6 | } 7 | 8 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/static/img/glyphicons-halflings-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yizhuoyan/javaweb-jiajiale/HEAD/jiajiale-web/src/main/resources/static/img/glyphicons-halflings-white.png -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/static/css/common/component.avator.css: -------------------------------------------------------------------------------- 1 | .avatar{ 2 | border-radius: 99999px; 3 | border: 0px; 4 | vertical-align: middle; 5 | border: 1px solid hsl(0,0%,50%); 6 | } -------------------------------------------------------------------------------- /jiajiale-web/src/main/java/com/vip/dao/VipRankDao.java: -------------------------------------------------------------------------------- 1 | package com.vip.dao; 2 | 3 | import com.vip.entity.VipRankEntity; 4 | 5 | public interface VipRankDao extends CRUDDao { 6 | 7 | 8 | } 9 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/static/css/common/01.img.css: -------------------------------------------------------------------------------- 1 | img{ 2 | outline: 1px dotted black; 3 | cursor: pointer; 4 | } 5 | img[src]{ 6 | border-style: none; 7 | outline: none; 8 | cursor: pointer; 9 | } -------------------------------------------------------------------------------- /jiajiale-web/src/main/java/com/vip/ao/ModifyPasswordAo.java: -------------------------------------------------------------------------------- 1 | package com.vip.ao; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class ModifyPasswordAo { 7 | private String oldPassword; 8 | private String newPassword; 9 | private String newPasswordConfirm; 10 | } 11 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/static/css/common/01.subsup.css: -------------------------------------------------------------------------------- 1 | sub, 2 | sup { 3 | position: relative; 4 | font-size: 75%; 5 | line-height: 0; 6 | vertical-align: baseline; 7 | } 8 | sup { 9 | top: -.5em; 10 | } 11 | 12 | sub { 13 | bottom: -.25em; 14 | } -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/static/css/common/02.txt-align.css: -------------------------------------------------------------------------------- 1 | .txt-center, 2 | .text-center 3 | { 4 | text-align: center; 5 | } 6 | .txt-left, 7 | .text-left 8 | { 9 | text-align: left; 10 | } 11 | .txt-right, 12 | .text-right 13 | { 14 | text-align: right; 15 | } -------------------------------------------------------------------------------- /jiajiale-web/src/main/java/com/vip/dao/SysAccountDao.java: -------------------------------------------------------------------------------- 1 | package com.vip.dao; 2 | 3 | import com.vip.entity.SysAccountEntity; 4 | import org.apache.ibatis.annotations.Mapper; 5 | 6 | @Mapper 7 | public interface SysAccountDao extends CRUDDao { 8 | 9 | 10 | } 11 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/static/css/common/group.row-group.css: -------------------------------------------------------------------------------- 1 | .group-row { 2 | display: flex !important; 3 | flex-flow: row wrap; 4 | justify-content: flex-start; 5 | align-items: center; 6 | } 7 | 8 | .group-row > .grow { 9 | flex: auto; 10 | } 11 | 12 | 13 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/static/css/common/group.col-group.css: -------------------------------------------------------------------------------- 1 | .col-group { 2 | display: flex !important; 3 | flex-direction: column wrap; 4 | justify-content: flex-start; 5 | align-items: center; 6 | } 7 | 8 | .col-group > .grow { 9 | flex: auto; 10 | } 11 | 12 | 13 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/static/css/common/layout02.full.css: -------------------------------------------------------------------------------- 1 | .layout-full { 2 | display: flex; 3 | flex-flow: row nowrap; 4 | justify-content: center; 5 | align-items: stretch; 6 | } 7 | 8 | .layout-full > * { 9 | height: auto !important; 10 | flex-grow: 1; 11 | } 12 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/java/com/vip/ao/AvatarAo.java: -------------------------------------------------------------------------------- 1 | package com.vip.ao; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class AvatarAo { 7 | String saveLocation; 8 | String contentType; 9 | long totalBytes; 10 | int width; 11 | int height; 12 | boolean isLocalSave; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/java/com/vip/service/VipRankManageService.java: -------------------------------------------------------------------------------- 1 | package com.vip.service; 2 | 3 | import java.util.List; 4 | 5 | import com.vip.entity.VipRankEntity; 6 | 7 | public interface VipRankManageService extends CommonService { 8 | 9 | List listRanks()throws Exception; 10 | } 11 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/static/css/common/01.kbd.css: -------------------------------------------------------------------------------- 1 | kbd { 2 | padding: 2px 4px; 3 | font-size: 90%; 4 | color: #fff; 5 | background-color: #333; 6 | border-radius: 3px; 7 | -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .25); 8 | box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .25); 9 | } -------------------------------------------------------------------------------- /jiajiale-web/src/test/java/test/vip/AbstractSpringTest.java: -------------------------------------------------------------------------------- 1 | package test.vip; 2 | 3 | import org.springframework.boot.test.context.SpringBootTest; 4 | import org.springframework.test.context.junit.jupiter.SpringJUnitConfig; 5 | 6 | @SpringBootTest 7 | public abstract class AbstractSpringTest { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/static/css/common/component.breadcrumb.css: -------------------------------------------------------------------------------- 1 | .breadcrumb{ 2 | display: inline; 3 | } 4 | 5 | .breadcrumb:before{ 6 | content: "当前位置:" 7 | } 8 | 9 | .breadcrumb > li { 10 | display: inline; 11 | } 12 | 13 | .breadcrumb > li + li:before { 14 | color: #ccc; 15 | content: "> "; 16 | } 17 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/static/css/common/layout00.css: -------------------------------------------------------------------------------- 1 | article,header,footer,section,aside,main,menu 2 | figcaption,figure,p 3 | fieldset,div{ 4 | box-sizing: border-box; 5 | display: block; 6 | margin: 0; 7 | padding: 0; 8 | } 9 | 10 | body>:only-child{ 11 | min-height: 100%; 12 | width: 100%; 13 | } -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/static/css/common/01.a.css: -------------------------------------------------------------------------------- 1 | a { 2 | cursor: pointer; 3 | background-color: transparent; 4 | } 5 | 6 | a[href]:hover { 7 | text-decoration: none; 8 | } 9 | 10 | a:active{ 11 | color: inherit; 12 | } 13 | a:visited{ 14 | color: inherit; 15 | } 16 | a:link{ 17 | color: inherit; 18 | } 19 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/java/com/vip/dao/EmpClerkDao.java: -------------------------------------------------------------------------------- 1 | package com.vip.dao; 2 | 3 | import com.vip.entity.EmpClerkEntity; 4 | /** 5 | * 店员访问层 6 | * 7 | * @author yizhuoyan@yizhuoyan.com 8 | * @since 2020-03-08 14:48:55 9 | */ 10 | public interface EmpClerkDao extends CRUDDao{ 11 | 12 | //额外方法 13 | 14 | 15 | } -------------------------------------------------------------------------------- /jiajiale-web/src/test/java/test/vip/controller/TestAccountController.java: -------------------------------------------------------------------------------- 1 | package test.vip.controller; 2 | 3 | public class TestAccountController { 4 | 5 | public static void main(String[] args) { 6 | int x=10,y=10,i; 7 | for (i=0 ;x>8 ;y= ++i) 8 | System.out.printf("%d%d",x--,y); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/static/css/common/01.hr.css: -------------------------------------------------------------------------------- 1 | hr { 2 | margin-top: 1em; 3 | margin-bottom: 1em; 4 | border: 0; 5 | border-top: 1px solid #eee; 6 | box-sizing: content-box; 7 | height: 0; 8 | overflow: visible; 9 | } 10 | 11 | hr.long { 12 | margin: 1em 6em 13 | } 14 | 15 | hr.auto { 16 | margin: 0; 17 | } 18 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/static/css/common/02.pad.css: -------------------------------------------------------------------------------- 1 | .pad { 2 | padding: 1em; 3 | } 4 | .pad-h { 5 | padding-left: 1em; 6 | padding-right: 1em; 7 | } 8 | .pad-v { 9 | padding-top: 1em; 10 | padding-bottom: 1em; 11 | } 12 | .pad-left{ 13 | padding-left: 1em; 14 | } 15 | .pad-right{ 16 | padding-right: 1em; 17 | } 18 | 19 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/java/com/vip/dto/AvatarDto.java: -------------------------------------------------------------------------------- 1 | package com.vip.dto; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class AvatarDto { 7 | String accountId; 8 | String saveLocation; 9 | String contentType; 10 | long totalBytes; 11 | int width; 12 | int height; 13 | //是否存放在本地存放 14 | boolean isLocalSave; 15 | 16 | 17 | 18 | } 19 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/java/com/vip/service/ClerkManageService.java: -------------------------------------------------------------------------------- 1 | package com.vip.service; 2 | 3 | import com.vip.ao.ClerkAo; 4 | import com.vip.entity.EmpClerkEntity; 5 | 6 | public interface ClerkManageService extends CommonService{ 7 | 8 | public EmpClerkEntity loadClerk(String id)throws Exception; 9 | public void modifyClerkInfo(String id, ClerkAo ao)throws Exception; 10 | } 11 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/public/welcome/view.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 欢迎页 6 | 7 | 8 | 9 | 14 |
15 |

请点击右边菜单开始!

16 |
17 | 18 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/public/manager/mine/view.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 欢迎页 6 | 7 | 8 | 9 | 14 |
15 |

请点击右边菜单开始!

16 |
17 | 18 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/java/com/vip/dao/VipDetailDao.java: -------------------------------------------------------------------------------- 1 | package com.vip.dao; 2 | 3 | import java.util.List; 4 | 5 | import org.apache.ibatis.annotations.Param; 6 | 7 | import com.vip.entity.VipDetailEntity; 8 | 9 | public interface VipDetailDao extends CRUDDao { 10 | 11 | List selectByRankIdAndKey(@Param("rankId") Integer rankId,@Param("key") String key); 12 | } 13 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/java/com/vip/ao/VipConsumeAo.java: -------------------------------------------------------------------------------- 1 | package com.vip.ao; 2 | 3 | import lombok.Data; 4 | 5 | import javax.validation.constraints.NotBlank; 6 | 7 | @Data 8 | public class VipConsumeAo { 9 | /**会员手机号*/ 10 | @NotBlank 11 | private String vipMobile; 12 | /**关联订单id*/ 13 | private String orderId; 14 | /**消费金额(元分)*/ 15 | private String consumeMoney; 16 | /**备注*/ 17 | private String remark; 18 | } 19 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/static/css/common/01.radio+checkbox.css: -------------------------------------------------------------------------------- 1 | label + label { 2 | margin-left: 1em; 3 | } 4 | 5 | 6 | input[type="radio"], 7 | input[type="checkbox"] { 8 | margin: 4px 0 0; 9 | margin-top: 1px \9; 10 | line-height: normal; 11 | } 12 | 13 | input[type="radio"]:focus, 14 | input[type="checkbox"]:focus { 15 | outline: 5px auto -webkit-focus-ring-color; 16 | outline-offset: -2px; 17 | } -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/static/css/common/component.menu-as-action-bar.css: -------------------------------------------------------------------------------- 1 | menu{ 2 | background: #f8f8f8; 3 | box-sizing: border-box; 4 | padding: 5px 15px; 5 | border-bottom: 1px solid #e7e7e7; 6 | display: flex; 7 | flex-flow: row wrap; 8 | justify-content: flex-start; 9 | align-items: center; 10 | margin: 0; 11 | } 12 | 13 | menu>.grow{ 14 | flex: auto; 15 | } 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/java/com/vip/dao/VipConsumeDao.java: -------------------------------------------------------------------------------- 1 | package com.vip.dao; 2 | 3 | import java.util.List; 4 | 5 | import org.apache.ibatis.annotations.Param; 6 | 7 | import com.vip.entity.VipConsumeEntity; 8 | 9 | public interface VipConsumeDao extends CRUDDao { 10 | 11 | List selectByKey(@Param("key") String key); 12 | List selectByVipId(String id)throws Exception; 13 | } 14 | -------------------------------------------------------------------------------- /jiajiale-web/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | /target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | 5 | ### STS ### 6 | .apt_generated 7 | .classpath 8 | .factorypath 9 | .project 10 | .settings 11 | .springBeans 12 | .sts4-cache 13 | 14 | ### IntelliJ IDEA ### 15 | .idea 16 | *.iws 17 | *.iml 18 | *.ipr 19 | 20 | ### NetBeans ### 21 | /nbproject/private/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ 26 | /build/ 27 | 28 | ### VS Code ### 29 | .vscode/ 30 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/static/css/common/01.form-vertical.css: -------------------------------------------------------------------------------- 1 | 2 | form.vertical p, p.vertical { 3 | display: flex; 4 | flex-flow: column nowrap; 5 | justify-content: center; 6 | align-items: flex-start; 7 | } 8 | 9 | form.vertical p>.grow, p.vertical>.grow { 10 | flex: none; 11 | align-self: stretch; 12 | } 13 | 14 | form.vertical p label, p.vertical label { 15 | margin-bottom: 1em; 16 | text-align: left; 17 | padding-right: 0; 18 | } 19 | 20 | 21 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/static/css/common/01.heading.css: -------------------------------------------------------------------------------- 1 | /****Heading****/ 2 | h1, h2, h3, h4, h5, h6 { 3 | font-family: '黑体'; 4 | font-weight: bold; 5 | margin: 0; 6 | } 7 | 8 | h1 { 9 | font-size: 4em; 10 | } 11 | 12 | h2 { 13 | font-size: 3.5em; 14 | } 15 | 16 | h3 { 17 | font-size: 3em; 18 | } 19 | 20 | h4 { 21 | font-size: 2em; 22 | } 23 | 24 | h5 { 25 | font-size: 1.5em; 26 | } 27 | 28 | h6 { 29 | font-size: 1.2em; 30 | } 31 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/static/error/403.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 需要登录 6 | 7 | 8 |

您需要登录后才能继续访问

9 |
10 | 11 | 16 | 17 |
18 | 19 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/java/com/vip/service/CommonService.java: -------------------------------------------------------------------------------- 1 | package com.vip.service; 2 | 3 | import com.vip.exception.VipException; 4 | import com.yizhuoyan.common.StringUtil; 5 | import com.yizhuoyan.common.validation.AssertThrowService; 6 | 7 | public interface CommonService extends AssertThrowService,StringUtil{ 8 | 9 | @Override 10 | default void throwException(String message, Object... args) { 11 | throw new VipException("validate",String.format(message, args)); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/static/css/common/00.reset.css: -------------------------------------------------------------------------------- 1 | html{ 2 | line-height: 1.15; 3 | } 4 | body { 5 | margin: 0; 6 | overflow: auto; 7 | font-size:14px; 8 | min-height:100vh; 9 | font-family: "Microsoft YaHei", 微软雅黑, "MicrosoftJhengHei", serif; 10 | background: #ffffff; 11 | box-sizing: border-box; 12 | } 13 | small { 14 | font-size: 80%; 15 | } 16 | ul,li{ 17 | list-style: none; 18 | margin: 0; 19 | padding: 0; 20 | } 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | TRACE 15 | 16 | 17 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/static/css/common/layout90.table.css: -------------------------------------------------------------------------------- 1 | .layout-table { 2 | display: flex; 3 | flex-flow: column wrap; 4 | justify-content:flex-start; 5 | align-content:stretch; 6 | padding: 0 15px; 7 | } 8 | 9 | .layout-table > header { 10 | flex:none; 11 | } 12 | 13 | .layout-table > main { 14 | flex:auto; 15 | overflow: auto; 16 | } 17 | 18 | .layout-table > footer { 19 | padding-top:10px; 20 | padding-bottom:10px; 21 | flex:none; 22 | } 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/static/error/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 404 8 | 9 | 10 | 11 | 12 | 20 | 21 | -------------------------------------------------------------------------------- /common-util/src/main/java/com/yizhuoyan/common/BeanMap.java: -------------------------------------------------------------------------------- 1 | package com.yizhuoyan.common; 2 | 3 | import java.util.HashMap; 4 | 5 | public class BeanMap extends HashMap { 6 | 7 | public BeanMap(int initialCapacity) { 8 | super(initialCapacity,1); 9 | } 10 | 11 | 12 | 13 | public static BeanMap of(String key, Object value) { 14 | return new BeanMap(8).and(key, value); 15 | } 16 | 17 | public BeanMap and(String key,Object value) { 18 | this.put(key, value); 19 | return this; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/java/com/vip/ao/ClerkAo.java: -------------------------------------------------------------------------------- 1 | package com.vip.ao; 2 | 3 | import lombok.Data; 4 | 5 | import java.time.LocalDate; 6 | 7 | @Data 8 | public class ClerkAo { 9 | /** 10 | * 真实姓名 11 | */ 12 | private String realName; 13 | /** 14 | * 性别 15 | */ 16 | private String sex; 17 | /** 18 | * 工作手机 19 | */ 20 | private String workMobile; 21 | /** 22 | * 工作邮箱 23 | */ 24 | private String workEmail; 25 | /** 26 | * 生日 27 | */ 28 | private String birthday; 29 | } 30 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/java/com/vip/entity/VipRankEntity.java: -------------------------------------------------------------------------------- 1 | package com.vip.entity; 2 | 3 | import java.time.*; 4 | 5 | import lombok.Data; 6 | /** 7 | * 8 | *@Auther yizhuoyan 9 | * 10 | */ 11 | @Data 12 | public class VipRankEntity{ 13 | 14 | /**等级代号*/ 15 | private int id; 16 | 17 | /**等级名称*/ 18 | private String name; 19 | 20 | /**升级需消费总金额(单位元)*/ 21 | private int needConsume; 22 | 23 | /**可享受折扣*/ 24 | private int enjoyDiscount; 25 | 26 | /**展示顺序*/ 27 | private int showOrder=0; 28 | 29 | /**备注*/ 30 | private String remark; 31 | } -------------------------------------------------------------------------------- /common-util/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | 5 | com.yizhuoyan 6 | common-util 7 | 1.0.0 8 | jar 9 | 10 | 11 | 12 | UTF-8 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/static/css/common/layout20.hcell.css: -------------------------------------------------------------------------------- 1 | .layout-hcell { 2 | display: flex; 3 | flex-direction: row; 4 | flex-wrap: wrap; 5 | justify-content: flex-start; 6 | align-items:center; 7 | } 8 | .layout-hcell-between{ 9 | display: flex; 10 | flex-flow: row nowrap; 11 | justify-content: space-between; 12 | align-items:center; 13 | } 14 | 15 | .layout-hcell-around{ 16 | display: flex; 17 | flex-flow: row nowrap; 18 | justify-content: space-around; 19 | align-items:center; 20 | } 21 | .layout-hcell> .grow 22 | { 23 | flex: auto; 24 | } 25 | 26 | 27 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/static/css/common/layout21.vcell.css: -------------------------------------------------------------------------------- 1 | .layout-vcell { 2 | display: flex; 3 | flex-direction: vcell; 4 | flex-wrap: nowrap; 5 | justify-content: flex-start; 6 | align-items: center; 7 | } 8 | .layout-vcell-around{ 9 | display: flex; 10 | flex-flow: vcell nowrap; 11 | justify-content: space-around; 12 | align-items: center; 13 | } 14 | 15 | .layout-vcell-between{ 16 | display: flex; 17 | flex-flow: vcell nowrap; 18 | justify-content: space-between; 19 | align-items: center; 20 | } 21 | 22 | .layout-vcell > .grow 23 | { 24 | flex: auto; 25 | } -------------------------------------------------------------------------------- /jiajiale-web/src/main/java/com/vip/web/controller/spring/StringTrimConverter.java: -------------------------------------------------------------------------------- 1 | package com.vip.web.controller.spring; 2 | 3 | import org.springframework.core.convert.converter.Converter; 4 | 5 | /** 6 | * Created by Administrator on 5/15. 7 | */ 8 | public class StringTrimConverter implements Converter { 9 | @Override 10 | public String convert(String source) { 11 | if(source==null){ 12 | return null; 13 | } 14 | source=source.trim(); 15 | if(source.length()==0){ 16 | return null; 17 | } 18 | return source; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/static/css/common/layout10.hbox.css: -------------------------------------------------------------------------------- 1 | .layout-hbox { 2 | display: flex; 3 | flex-direction: row; 4 | flex-wrap: nowrap; 5 | justify-content: flex-start; 6 | align-items: stretch; 7 | } 8 | .layout-hbox-between{ 9 | display: flex; 10 | flex-flow: row nowrap; 11 | justify-content: space-between; 12 | align-items: stretch; 13 | } 14 | 15 | .layout-hbox-around{ 16 | display: flex; 17 | flex-flow: row nowrap; 18 | justify-content: space-around; 19 | align-items: stretch; 20 | } 21 | .layout-hbox> .grow 22 | { 23 | flex: auto; 24 | } 25 | 26 | 27 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/static/css/common/layout11.vbox.css: -------------------------------------------------------------------------------- 1 | .layout-vbox { 2 | display: flex; 3 | flex-direction: column; 4 | flex-wrap: nowrap; 5 | justify-content: flex-start; 6 | align-items: stretch; 7 | } 8 | .layout-vbox-around{ 9 | display: flex; 10 | flex-flow: column nowrap; 11 | justify-content: space-around; 12 | align-items: stretch; 13 | } 14 | 15 | .layout-vbox-between{ 16 | display: flex; 17 | flex-flow: column nowrap; 18 | justify-content: space-between; 19 | align-items: stretch; 20 | } 21 | 22 | .layout-vbox > .grow 23 | { 24 | flex: auto; 25 | } -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/static/css/common/02.gap.css: -------------------------------------------------------------------------------- 1 | .gap{ 2 | margin: 1em; 3 | } 4 | .gap-h{ 5 | margin-left: 1em; 6 | margin-right: 1em; 7 | } 8 | .gap-v{ 9 | margin-top: 1em; 10 | margin-bottom: 1em; 11 | } 12 | 13 | .gap-left{ 14 | margin-left: 1em; 15 | } 16 | .gap-right{ 17 | margin-right: 1em; 18 | } 19 | 20 | .gap2{ 21 | margin: 2em; 22 | } 23 | .gap2-h{ 24 | margin-left: 2em; 25 | margin-right: 2em; 26 | } 27 | .gap2-v{ 28 | margin-top: 2em; 29 | margin-bottom: 2em; 30 | } 31 | .gap2-left{ 32 | margin-left: 2em; 33 | } 34 | .gap2-right{ 35 | margin-right: 2em; 36 | } -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | com.yizhuoyan.javawebproject 8 | jiajiale 9 | 1.0-SNAPSHOT 10 | 11 | common-util 12 | jiajiale-web 13 | 14 | pom 15 | 16 | -------------------------------------------------------------------------------- /jiajiale.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/java/com/vip/service/impl/VipRankManageServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.vip.service.impl; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Service; 7 | 8 | import com.vip.dao.VipRankDao; 9 | import com.vip.entity.VipRankEntity; 10 | import com.vip.service.VipRankManageService; 11 | 12 | @Service 13 | public class VipRankManageServiceImpl implements VipRankManageService { 14 | @Autowired 15 | VipRankDao vdao; 16 | 17 | @Override 18 | public List listRanks() throws Exception { 19 | return vdao.selectAll("id"); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/java/com/vip/exception/VipException.java: -------------------------------------------------------------------------------- 1 | package com.vip.exception; 2 | /** 3 | * 系统全局异常 4 | * @author Administrator 5 | * 6 | */ 7 | public class VipException extends RuntimeException { 8 | public final String code; 9 | 10 | public VipException(String code) { 11 | super(); 12 | this.code = code; 13 | } 14 | public VipException(String code,String message) { 15 | super(message); 16 | this.code = code; 17 | } 18 | public VipException(String code,String message,Throwable e) { 19 | super(message,e); 20 | this.code = code; 21 | } 22 | 23 | @Override 24 | public String toString() { 25 | return super.toString(); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/static/css/common/component.pagination.css: -------------------------------------------------------------------------------- 1 | /**分页组件**/ 2 | .pagination-group { 3 | display: inline-block; 4 | vertical-align: middle; 5 | overflow: hidden; 6 | border: 0; 7 | } 8 | 9 | .pagination-group > button { 10 | margin-left: 5px; 11 | margin-right: 5px; 12 | padding: 0; 13 | height: 100%; 14 | font-size: 14px; 15 | text-align: center; 16 | font-family: sans-serif "宋体"; 17 | line-height: normal; 18 | width: 30px; 19 | 20 | } 21 | 22 | .pagination-group > input { 23 | width: 2em; 24 | height: 100%; 25 | text-align: center; 26 | text-indent: 0; 27 | font-weight: bold; 28 | } -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/static/css/common/component.nav-as-nav-bar.css: -------------------------------------------------------------------------------- 1 | nav{ 2 | background-color: #336699; 3 | color: #efefef; 4 | border-bottom: 1px solid #eee; 5 | padding: 5px 15px; 6 | box-sizing:border-box; 7 | font-size: 100%; 8 | display: flex; 9 | flex-flow: row nowrap; 10 | justify-content: flex-start; 11 | align-items: center; 12 | } 13 | nav>.grow{ 14 | flex: auto; 15 | } 16 | nav > a.fa-back { 17 | text-decoration: none; 18 | } 19 | 20 | nav > a.fa-back:hover { 21 | color: #c42818; 22 | } 23 | 24 | nav > a.fa-back:after { 25 | content: "┆"; 26 | 27 | padding: 0 5px; 28 | color: #999999; 29 | } -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/static/css/common/layout01.center-middle.css: -------------------------------------------------------------------------------- 1 | .layout-hcenter-vcenter 2 | { 3 | display: flex; 4 | flex-flow: row nowrap; 5 | justify-content: center; 6 | align-items: center; 7 | } 8 | .layout-vcenter-hcenter 9 | { 10 | display: flex; 11 | flex-flow: column nowrap; 12 | justify-content: center; 13 | align-items: center; 14 | } 15 | 16 | .layout-hcenter{ 17 | display: flex; 18 | flex-flow: row nowrap; 19 | justify-content: center; 20 | align-items:stretch; 21 | } 22 | .layout-vcenter{ 23 | display: flex; 24 | flex-flow: column nowrap; 25 | justify-content: center; 26 | align-items:stretch; 27 | } 28 | -------------------------------------------------------------------------------- /common-util/common-util.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | # server 2 | server.port=9999 3 | 4 | # db 5 | spring.datasource.url=jdbc:mysql://127.0.0.1:3306/vip?UseSSL=false 6 | spring.datasource.username=root 7 | spring.datasource.password=root 8 | spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver 9 | spring.datasource.hikari.maximum-pool-size=1 10 | # mybatis 11 | 12 | mybatis.configuration.aggressive-lazy-loading=false 13 | mybatis.configuration.map-underscore-to-camel-case=true 14 | mybatis.type-aliases-package=com.vip.entity 15 | mybatis.mapper-locations=classpath:mapper/*.xml 16 | 17 | 18 | # mvc 19 | spring.devtools.livereload.enabled=true 20 | 21 | spring.resources.cache.cachecontrol.no-cache=true 22 | 23 | # user avatar file save location 24 | account.avatar.saveDir=f:/avatar/ -------------------------------------------------------------------------------- /jiajiale-web/src/main/java/com/vip/dao/CRUDDao.java: -------------------------------------------------------------------------------- 1 | package com.vip.dao; 2 | 3 | import java.sql.SQLException; 4 | import java.util.List; 5 | import java.util.Map; 6 | 7 | import org.apache.ibatis.annotations.Param; 8 | 9 | /** 10 | * 针对所有表的Dao操作 11 | * @author Administrator 12 | * 13 | */ 14 | public interface CRUDDao { 15 | 16 | void insert(E e)throws SQLException; 17 | void update(@Param("id")String id,@Param("e") Map map)throws SQLException; 18 | void delete(ID id)throws SQLException; 19 | E selectById(ID id)throws SQLException; 20 | E select(@Param("column") String column,@Param("value")Object value)throws SQLException; 21 | boolean exists(@Param("column") String column,@Param("value")Object value)throws SQLException; 22 | List selectAll(@Param("orderBy")String orderBy)throws SQLException; 23 | 24 | } 25 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/java/com/vip/dto/JSONResponse.java: -------------------------------------------------------------------------------- 1 | package com.vip.dto; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class JSONResponse { 7 | private String code; 8 | private String message; 9 | private Object data; 10 | 11 | public static JSONResponse ok() { 12 | return new JSONResponse("ok",null,null); 13 | } 14 | public static JSONResponse ok(Object data) { 15 | return new JSONResponse("ok",null,data); 16 | } 17 | public static JSONResponse fail(String code, String message) { 18 | return new JSONResponse(code,message,null); 19 | } 20 | public static JSONResponse fail(String message) { 21 | return new JSONResponse("fail",message,null); 22 | } 23 | 24 | 25 | public JSONResponse(String code, String message, Object data) { 26 | this.code = code; 27 | this.message = message; 28 | this.data = data; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/java/com/vip/entity/SysAccountRole.java: -------------------------------------------------------------------------------- 1 | package com.vip.entity; 2 | 3 | import lombok.ToString; 4 | 5 | import java.util.Arrays; 6 | 7 | public enum SysAccountRole { 8 | VIP(0,"VIP"), 9 | CLERK(1,"店员"), 10 | MANAGER(2,"经理"); 11 | 12 | public final int code; 13 | public final String showText; 14 | public final static SysAccountRole[] VALUES=SysAccountRole.values(); 15 | 16 | private SysAccountRole(int code,String showText){ 17 | this.code=code; 18 | this.showText=showText; 19 | } 20 | public static SysAccountRole valueOf(int code){ 21 | if(code<0)return null; 22 | if(code>=VALUES.length)return null; 23 | return Arrays.stream(VALUES).filter(r->r.code==code).findFirst().orElse(null); 24 | } 25 | 26 | public String toString(){ 27 | return this.name(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/static/css/common/03.table-data.css: -------------------------------------------------------------------------------- 1 | table.data { 2 | width: 100%; 3 | border-collapse: collapse; 4 | text-align: center; 5 | } 6 | 7 | table.data th { 8 | border: 1px solid #81b4be; 9 | padding: 5px 0; 10 | } 11 | 12 | table.data td{ 13 | border: 1px solid #ccc; 14 | padding: 5px 5px; 15 | } 16 | 17 | table.data > thead>tr { 18 | background-color: hsl(243,30%,50%); 19 | font-weight: bold; 20 | height: 2em; 21 | color:#ffffff; 22 | } 23 | 24 | table.data>tr,table.data>tbody>tr { 25 | background-color: #ffffff; 26 | color:hsl(0,0%,5%) 27 | } 28 | 29 | 30 | 31 | table.data>tr:nth-child(even),table.data>tbody>tr:nth-child(even) { 32 | background-color: hsl(60,50%,97%); 33 | } 34 | 35 | table.data>tr:HOVER,table.data>tbody>tr:HOVER { 36 | background-color: hsl(60,50%,90%); 37 | color:hsl(0,0%,0%) 38 | } 39 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/java/com/vip/service/VipConsumeManageService.java: -------------------------------------------------------------------------------- 1 | package com.vip.service; 2 | 3 | import com.vip.ao.VipConsumeAo; 4 | import com.vip.dto.QueryResult; 5 | import com.vip.entity.VipConsumeEntity; 6 | 7 | public interface VipConsumeManageService { 8 | 9 | /** 10 | * 添加vip消费记录 11 | * @param ao 12 | * @throws Exception 13 | */ 14 | void addVipConsume(VipConsumeAo ao)throws Exception; 15 | /** 16 | * 查询指定消费记录详情 17 | * @param id 18 | * @return 19 | * @throws Exception 20 | */ 21 | VipConsumeEntity checkVipConsume(String id)throws Exception; 22 | QueryResult queryVipConsumeByMobile(String mobile,int pageNo, int pageSize) throws Exception ; 23 | /** 24 | * 作废指定的消费记录 25 | * @param id 26 | * @throws Exception 27 | */ 28 | void deleteVipConsume(String id)throws Exception; 29 | 30 | QueryResult queryVipConsumeByKey(String key, int pageNo, int pageSize) throws Exception; 31 | } 32 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/java/com/vip/ao/VipAo.java: -------------------------------------------------------------------------------- 1 | package com.vip.ao; 2 | 3 | import lombok.Data; 4 | 5 | import javax.validation.constraints.NotBlank; 6 | import javax.validation.constraints.Size; 7 | 8 | /** 9 | * VIP输入对象 10 | */ 11 | @Data 12 | public class VipAo { 13 | String id; 14 | 15 | /**手机号,可作为会员凭证*/ 16 | @NotBlank(message="{mobile.not-blank}") 17 | @Size(min =11 ,max = 11,message = "手机号应该是11位") 18 | private String mobile; 19 | 20 | /**账号名称(客户姓名)*/ 21 | @NotBlank(message = "客户姓名不能为空") 22 | private String name; 23 | 24 | /**性别*/ 25 | private String sex; 26 | 27 | /**出生日期(1990-01-01)*/ 28 | private String birthday; 29 | 30 | /***/ 31 | private String qq; 32 | 33 | /***/ 34 | private String email; 35 | 36 | /***/ 37 | private String address; 38 | 39 | /**邮编*/ 40 | private String zipCode; 41 | 42 | /**等级*/ 43 | private String rankId; 44 | 45 | /***/ 46 | private String remark; 47 | 48 | 49 | 50 | } 51 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/java/com/vip/web/controller/RequestListener.java: -------------------------------------------------------------------------------- 1 | package com.vip.web.controller; 2 | 3 | import javax.servlet.ServletRequest; 4 | import javax.servlet.ServletRequestEvent; 5 | import javax.servlet.ServletRequestListener; 6 | import javax.servlet.annotation.WebListener; 7 | import javax.servlet.http.HttpServletRequest; 8 | import javax.servlet.http.HttpSession; 9 | 10 | import com.vip.dto.AccountContext; 11 | 12 | @WebListener 13 | public class RequestListener implements ServletRequestListener{ 14 | 15 | @Override 16 | public void requestInitialized(ServletRequestEvent evt) { 17 | HttpServletRequest req = (HttpServletRequest) evt.getServletRequest(); 18 | HttpSession session = req.getSession(); 19 | AccountContext ac=(AccountContext)session.getAttribute(AccountContext.class.getName()); 20 | String ip=req.getRemoteHost(); 21 | if(ac!=null) { 22 | //把当前用户对象绑定到线程中 23 | AccountContext.saveCurrentAccount(ac); 24 | } 25 | 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/java/com/vip/entity/EmpClerkEntity.java: -------------------------------------------------------------------------------- 1 | package com.vip.entity; 2 | 3 | import java.time.LocalDate; 4 | import java.io.Serializable; 5 | import lombok.Data; 6 | /** 7 | * 店员 8 | * @author yizhuoyan@yizhuoyan.com 9 | * @since 2020-03-08 14:48:55 10 | */ 11 | @Data 12 | public class EmpClerkEntity implements Serializable { 13 | private static final long serialVersionUID = -77675464809756772L; 14 | /** 15 | * 帐号信息 16 | */ 17 | private SysAccountEntity account; 18 | 19 | private String id; 20 | /** 21 | * 真实姓名 22 | */ 23 | private String realName; 24 | /** 25 | * 性别 26 | */ 27 | private Integer sex; 28 | /** 29 | * 员工编号 30 | */ 31 | private String empNo; 32 | /** 33 | * 工作手机 34 | */ 35 | private String workMobile; 36 | /** 37 | * 工作邮箱 38 | */ 39 | private String workEmail; 40 | /** 41 | * 生日 42 | */ 43 | private LocalDate birthday; 44 | 45 | 46 | 47 | } -------------------------------------------------------------------------------- /jiajiale-web/src/main/java/com/vip/vo/VipListVO.java: -------------------------------------------------------------------------------- 1 | package com.vip.vo; 2 | 3 | import com.vip.entity.VipDetailEntity; 4 | 5 | import lombok.Data; 6 | 7 | @Data 8 | public class VipListVO { 9 | private String id; 10 | /** vip账号(目前客户手机号) */ 11 | private String no; 12 | /** 手机号,可作为会员凭证 */ 13 | private String mobile; 14 | 15 | /** 账号名称(客户姓名) */ 16 | private String name; 17 | /** 性别 */ 18 | private Boolean sex; 19 | /** 等级 */ 20 | private String rankName; 21 | /** 创建人 */ 22 | private String createUserName; 23 | 24 | public static VipListVO of(VipDetailEntity e) { 25 | if(e==null)return null; 26 | VipListVO vo = new VipListVO(); 27 | vo.setName(e.getName()); 28 | vo.setId(e.getId()); 29 | vo.setNo(e.getNo()); 30 | vo.setMobile(e.getMobile()); 31 | vo.setSex(e.getSex()); 32 | if(e.getRank()!=null) { 33 | vo.setRankName(e.getRank().getName()); 34 | } 35 | 36 | vo.setCreateUserName(e.getCreateUser().getName()); 37 | return vo; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/java/com/vip/entity/VipConsumeEntity.java: -------------------------------------------------------------------------------- 1 | package com.vip.entity; 2 | 3 | import java.time.*; 4 | 5 | import lombok.Data; 6 | 7 | 8 | /** 9 | * 10 | *@Auther yizhuoyan 11 | * 12 | */ 13 | @Data 14 | public class VipConsumeEntity{ 15 | public static final int STATUS_NORMAL=0,STATUS_DELETED=1; 16 | 17 | /***/ 18 | private String id; 19 | 20 | /**会员ID*/ 21 | private VipDetailEntity vip; 22 | private String vipId; 23 | 24 | /**消费时间*/ 25 | private LocalDateTime consumeTime; 26 | 27 | /**关联订单id*/ 28 | private String orderId; 29 | 30 | /**优惠金额(元分)*/ 31 | private int discountMoney; 32 | 33 | /**实际付款(元分)*/ 34 | private int actualPayMoney; 35 | 36 | /**消费金额(元分)*/ 37 | private int consumeMoney; 38 | 39 | /**录入人*/ 40 | private SysAccountEntity createUser; 41 | private String createUserId; 42 | 43 | /**状态0=正常 1=作废*/ 44 | private int status; 45 | 46 | /***/ 47 | private String remark; 48 | 49 | /**享受折扣*/ 50 | private int enjoyDiscount; 51 | 52 | } 53 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/java/com/vip/web/controller/RankController.java: -------------------------------------------------------------------------------- 1 | package com.vip.web.controller; 2 | 3 | import java.util.List; 4 | 5 | import javax.servlet.http.HttpServletRequest; 6 | import javax.servlet.http.HttpServletResponse; 7 | 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.stereotype.Controller; 10 | import org.springframework.web.bind.annotation.GetMapping; 11 | 12 | import com.vip.dto.JSONResponse; 13 | import com.vip.entity.VipRankEntity; 14 | import com.vip.service.VipRankManageService; 15 | import org.springframework.web.bind.annotation.RequestMapping; 16 | import org.springframework.web.bind.annotation.RestController; 17 | 18 | @RestController 19 | @RequestMapping("/api") 20 | public class RankController { 21 | @Autowired 22 | VipRankManageService service; 23 | 24 | @GetMapping("/rank") 25 | public JSONResponse handleRequest(HttpServletRequest req, HttpServletResponse resp) throws Exception { 26 | List list = service.listRanks(); 27 | return JSONResponse.ok(list); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/java/com/vip/vo/VipConsumeListVO.java: -------------------------------------------------------------------------------- 1 | package com.vip.vo; 2 | 3 | import java.time.LocalDateTime; 4 | 5 | import com.vip.entity.SysAccountEntity; 6 | import com.vip.entity.VipConsumeEntity; 7 | import com.vip.entity.VipDetailEntity; 8 | 9 | import lombok.Data; 10 | @Data 11 | public class VipConsumeListVO { 12 | private String id; 13 | private String mobile; 14 | private String vipName; 15 | private LocalDateTime consumeTime; 16 | /**关联订单id*/ 17 | private String orderId; 18 | /**消费金额(元分)*/ 19 | private int consumeMoney; 20 | private String createUserName; 21 | 22 | public static VipConsumeListVO of(VipConsumeEntity e) { 23 | if(e==null)return null; 24 | VipConsumeListVO vo=new VipConsumeListVO(); 25 | SysAccountEntity createUser=e.getCreateUser(); 26 | vo.setCreateUserName(createUser.getName()); 27 | vo.setId(e.getId()); 28 | VipDetailEntity vip=e.getVip(); 29 | vo.setMobile(vip.getMobile()); 30 | vo.setVipName(vip.getName()); 31 | vo.setConsumeTime(e.getConsumeTime()); 32 | vo.setOrderId(e.getOrderId()); 33 | vo.setConsumeMoney(e.getConsumeMoney()); 34 | return vo; 35 | 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/java/com/vip/service/VipManageService.java: -------------------------------------------------------------------------------- 1 | package com.vip.service; 2 | 3 | import com.vip.ao.VipAo; 4 | import com.vip.dto.QueryResult; 5 | import com.vip.entity.VipDetailEntity; 6 | 7 | /** 8 | * vip管理服务 9 | * @author Administrator 10 | * 11 | */ 12 | public interface VipManageService extends CommonService{ 13 | /** 14 | * 录入VIP客户信息 15 | * @throws Exception 16 | */ 17 | void addVip(VipAo ao)throws Exception; 18 | /** 19 | * 通过手机号查看VIP客户信息 20 | * @param mobile 手机号 21 | * @return 22 | * @throws Exception 23 | */ 24 | VipDetailEntity queryVipByMobile(String mobile)throws Exception; 25 | /** 26 | * 通过id 27 | * @param id 28 | * @return 29 | * @throws Exception 30 | */ 31 | VipDetailEntity checkVipById(String id)throws Exception; 32 | 33 | /** 34 | * 模糊分页查询vip 35 | * @param key 36 | * @param pageNo 37 | * @param pageSize 38 | * @throws Exception 39 | */ 40 | QueryResult queryVipByKey(Integer rankId,String key,int pageNo,int pageSize)throws Exception; 41 | 42 | /** 43 | * 更新客户基础信息 44 | * @param id 客户id 45 | * @param ao 要更新的信息 46 | * @throws Exception 47 | */ 48 | void modifyVip(String id,VipAo ao)throws Exception; 49 | 50 | 51 | 52 | } 53 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/static/css/common/component.input-group.css: -------------------------------------------------------------------------------- 1 | .input-group { 2 | display: inline-flex; 3 | padding: 0; 4 | flex-flow: row nowrap; 5 | align-items: stretch; 6 | border: 1px solid #E5E5E5; 7 | border-radius: 4px; 8 | box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); 9 | transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; 10 | } 11 | 12 | .input-group:hover { 13 | box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px rgba(102, 175, 133, .6); 14 | } 15 | 16 | .input-group > * { 17 | flex: 0 1 auto; 18 | border-radius: 0; 19 | flex-flow: row nowrap; 20 | display: inline-flex; 21 | align-items: center; 22 | } 23 | 24 | .input-group > :first-child { 25 | border-top-left-radius: 4px; 26 | border-bottom-left-radius: 4px; 27 | } 28 | 29 | .input-group > :last-child { 30 | border-top-right-radius: 4px; 31 | border-bottom-right-radius: 4px; 32 | } 33 | 34 | .input-group > input { 35 | flex: 1 1 auto; 36 | background: #ffffff; 37 | border: none; 38 | min-height: 38px; 39 | } 40 | 41 | .input-group > input:hover { 42 | box-shadow: none; 43 | } 44 | 45 | .input-group > button { 46 | width: auto; 47 | min-width: 0; 48 | } -------------------------------------------------------------------------------- /jiajiale-web/src/main/java/com/vip/service/UserAccountService.java: -------------------------------------------------------------------------------- 1 | package com.vip.service; 2 | 3 | import com.vip.ao.AvatarAo; 4 | import com.vip.ao.ModifyPasswordAo; 5 | import com.vip.dto.AccountContext; 6 | import com.vip.dto.AvatarDto; 7 | 8 | public interface UserAccountService extends CommonService { 9 | /** 10 | * 工作人员登录 11 | * @param account 账号 12 | * @param password 密码 13 | * @return 账号上下文 14 | * @throws Exception 15 | */ 16 | AccountContext login(String account,String password)throws Exception; 17 | /** 18 | * 修改密码 19 | * @param id 账号id 20 | * @param ao 21 | * @throws Exception 22 | */ 23 | void updatePassword(String id,ModifyPasswordAo ao)throws Exception; 24 | 25 | /** 26 | * 改变头像 27 | * @param id 账号id 28 | * @param ao 29 | * @throws Exception 30 | */ 31 | void changeAvatar(String id,AvatarAo ao)throws Exception; 32 | /** 33 | * 改变头像 34 | * @param id 账号id 35 | * @param ao 36 | * @throws Exception 37 | */ 38 | void changeName(String id,String name)throws Exception; 39 | 40 | /** 41 | * 获取用户头像 42 | * @param id 43 | * @return 44 | * @throws Exception 45 | */ 46 | AvatarDto loadAvatar(String id)throws Exception; 47 | 48 | } 49 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/java/com/vip/web/interceptor/SessionInterceptor.java: -------------------------------------------------------------------------------- 1 | package com.vip.web.interceptor; 2 | 3 | import com.vip.dto.AccountContext; 4 | import lombok.extern.slf4j.Slf4j; 5 | import org.springframework.web.servlet.HandlerInterceptor; 6 | 7 | import javax.servlet.http.HttpServletRequest; 8 | import javax.servlet.http.HttpServletResponse; 9 | import javax.servlet.http.HttpSession; 10 | 11 | /** 12 | * Created by Administrator on 5/21. 13 | */ 14 | @Slf4j 15 | public class SessionInterceptor implements HandlerInterceptor { 16 | 17 | @Override 18 | public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { 19 | log.debug("{1}判断是否已登录",request.getRequestURI()); 20 | if(isLogin(request)){ 21 | log.debug("已登录"); 22 | return true; 23 | } 24 | log.debug("未登录,403返回"); 25 | response.sendError(403); 26 | return false; 27 | } 28 | 29 | private boolean isLogin(HttpServletRequest req){ 30 | HttpSession session=req.getSession(false); 31 | if(session==null){ 32 | return false; 33 | } 34 | return session.getAttribute(AccountContext.class.getName())!=null; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/static/css/common/01.scrollbar.css: -------------------------------------------------------------------------------- 1 | /***滚动条****/ 2 | .scrollBeauty { 3 | scrollbar-face-color: #F3F3F3; /*面子*/ 4 | scrollbar-arrow-color: #C0C0C0; /*箭头*/ 5 | scrollbar-3dlight-color: #C0C0C0; /*最外左*/ 6 | scrollbar-highlight-color: #FFFFFF; /*左二*/ 7 | scrollbar-shadow-color: #FFFFFF; /*右二*/ 8 | scrollbar-darkshadow-color: #C0C0C0; /*右一*/ 9 | scrollbar-track-color: #F3F3F3; /*滑道*/ 10 | } 11 | 12 | /*滚动条整体*/ 13 | ::-webkit-scrollbar { 14 | width: 14px; /*滚动条宽度*/ 15 | } 16 | 17 | ::-webkit-scrollbar-track { 18 | background-color: #F3F3F3; /*滑道全部*/ 19 | } 20 | 21 | ::-webkit-scrollbar-track-piece { 22 | background-color: #F3F3F3; /*滑道*/ 23 | -webkit-border-radius: 4px; /*滑道圆角宽度*/ 24 | } 25 | 26 | ::-webkit-scrollbar-thumb { 27 | background-color: #F3F3F3; /*滑动条表面*/ 28 | border: solid 1px #C0C0C0; /*滑动条边框*/ 29 | border-radius: 4px; /*滑动条圆角宽度*/ 30 | } 31 | 32 | /*横竖滚动条交角*/ 33 | ::-webkit-scrollbar-corner { 34 | background-color: #F3F3F3; 35 | } 36 | 37 | /*横竖滚动条交角图案*/ 38 | ::-webkit-resizer { 39 | background-repeat: no-repeat; 40 | background-position: bottom right; 41 | } 42 | 43 | /*鼠标滑过滑动条*/ 44 | ::-webkit-scrollbar-thumb:hover { 45 | background-color: #F3F3E0; 46 | } -------------------------------------------------------------------------------- /jiajiale-web/src/main/java/com/vip/web/controller/userhome/ClerkInfoController.java: -------------------------------------------------------------------------------- 1 | package com.vip.web.controller.userhome; 2 | 3 | import com.vip.ao.ClerkAo; 4 | import com.vip.ao.ModifyPasswordAo; 5 | import com.vip.dto.JSONResponse; 6 | import com.vip.entity.EmpClerkEntity; 7 | import com.vip.service.ClerkManageService; 8 | import com.vip.vo.ClerkDetailVo; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.validation.annotation.Validated; 11 | import org.springframework.web.bind.annotation.*; 12 | 13 | @RestController 14 | @RequestMapping("/api/clerk") 15 | @Validated 16 | public class ClerkInfoController { 17 | 18 | @Autowired 19 | ClerkManageService clerkManageService; 20 | 21 | @GetMapping(path = "/{id}") 22 | public JSONResponse loadClerk(@PathVariable String id) throws Exception { 23 | final EmpClerkEntity clerkEntity = clerkManageService.loadClerk(id); 24 | 25 | return JSONResponse.ok(ClerkDetailVo.ofOnlyClerk(clerkEntity)); 26 | } 27 | 28 | @PutMapping(path = "/{id}") 29 | public JSONResponse modifyMyInfo(@PathVariable String id, ClerkAo ao) throws Exception { 30 | 31 | clerkManageService.modifyClerkInfo(id,ao); 32 | 33 | return JSONResponse.ok(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/java/com/vip/dto/AccountContext.java: -------------------------------------------------------------------------------- 1 | package com.vip.dto; 2 | 3 | import java.time.LocalDateTime; 4 | 5 | import com.vip.entity.SysAccountRole; 6 | import lombok.Data; 7 | /** 8 | * 用户上下文 9 | * @author Administrator 10 | * 11 | */ 12 | @Data 13 | public class AccountContext { 14 | private static final ThreadLocal ACCOUNT_HOLDER=new ThreadLocal<>(); 15 | private String id; 16 | private String account; 17 | private String name; 18 | private String avatar; 19 | private LocalDateTime createTime; 20 | private LocalDateTime lastModifyPasswordTime; 21 | private LocalDateTime lastLoginTime; 22 | private boolean isFirstLogin; 23 | private String lastLoginIp; 24 | private String lastLoginAgent; 25 | //所属角色 26 | private String role; 27 | private String token; 28 | /** 29 | * 获取当前用户账号的id 30 | * @return 31 | */ 32 | public static String currentAccountId() { 33 | AccountContext current=ACCOUNT_HOLDER.get(); 34 | return current.getId(); 35 | } 36 | 37 | public void setRole(Integer role){ 38 | this.role= SysAccountRole.valueOf(role).toString().toLowerCase(); 39 | } 40 | 41 | /** 42 | * 保存当前用户对象 43 | * @param ac 44 | */ 45 | public static void saveCurrentAccount(AccountContext ac) { 46 | ACCOUNT_HOLDER.set(ac); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/java/com/vip/entity/VipDetailEntity.java: -------------------------------------------------------------------------------- 1 | package com.vip.entity; 2 | 3 | import java.time.*; 4 | 5 | import lombok.Data; 6 | 7 | 8 | /** 9 | * 客户实体 10 | *@Auther yizhuoyan 11 | * 12 | */ 13 | @Data 14 | public class VipDetailEntity{ 15 | /***/ 16 | private String id; 17 | /**vip-会员号码*/ 18 | private String no; 19 | 20 | /**手机号,可作为会员凭证*/ 21 | private String mobile; 22 | 23 | /**账号名称(客户姓名)*/ 24 | private String name; 25 | 26 | /**性别*/ 27 | private Boolean sex; 28 | 29 | /**生日*/ 30 | private LocalDate birthday; 31 | 32 | /***/ 33 | private String qq; 34 | 35 | /***/ 36 | private String email; 37 | 38 | /***/ 39 | private String address; 40 | 41 | /**邮编*/ 42 | private String zipCode; 43 | 44 | /**等级*/ 45 | private VipRankEntity rank; 46 | /*冗余*/ 47 | private Integer rankId; 48 | 49 | /**总优惠金额*/ 50 | private Integer totalDiscountMoney; 51 | 52 | /**目前消费总金额,单位分元*/ 53 | private Integer totalConsumeMoney; 54 | 55 | /***/ 56 | private String remark; 57 | 58 | /**创建人*/ 59 | private SysAccountEntity createUser; 60 | private String createUserId; 61 | 62 | /**创建时间*/ 63 | private LocalDateTime createTime; 64 | /** 65 | * 最后消费时间 66 | */ 67 | private LocalDateTime lastConsumeTime; 68 | } -------------------------------------------------------------------------------- /jiajiale-web/src/test/java/test/vip/service/TestVipConsumeManageServiceImpl.java: -------------------------------------------------------------------------------- 1 | package test.vip.service; 2 | 3 | import org.junit.Test; 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | 6 | import com.vip.ao.VipConsumeAo; 7 | import com.vip.service.VipConsumeManageService; 8 | 9 | import test.vip.AbstractSpringTest; 10 | 11 | class TestVipConsumeManageServiceImpl extends AbstractSpringTest { 12 | @Autowired 13 | VipConsumeManageService service; 14 | @Test 15 | final void testAddVipConsume()throws Exception { 16 | VipConsumeAo e = new VipConsumeAo(); 17 | e.setVipMobile("13888888888"); 18 | e.setOrderId("orderId9004"); 19 | e.setConsumeMoney("434"); 20 | e.setRemark("remark7257"); 21 | 22 | service.addVipConsume(e); 23 | } 24 | 25 | @Test 26 | final void testQueryVipConsumeByMobile() throws Exception{ 27 | service.queryVipConsumeByMobile("13888888888", 1, 5); 28 | } 29 | 30 | @Test 31 | final void testCheckVipConsume() throws Exception{ 32 | service.checkVipConsume("a85af898b781ae891374aa8beeba8f15"); 33 | } 34 | 35 | @Test 36 | final void testQueryVipConsumeByKey()throws Exception { 37 | service.queryVipConsumeByKey("138888", 1, 5); 38 | } 39 | 40 | @Test 41 | final void testDeleteVipConsume() throws Exception { 42 | service.deleteVipConsume("a85af898b781ae891374aa8beeba8f15"); 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/java/com/vip/web/controller/userhome/AccountController.java: -------------------------------------------------------------------------------- 1 | package com.vip.web.controller.userhome; 2 | 3 | import com.vip.ao.ModifyPasswordAo; 4 | import com.vip.dto.AccountContext; 5 | import com.vip.dto.JSONResponse; 6 | import com.vip.service.UserAccountService; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.http.HttpStatus; 9 | import org.springframework.http.ResponseEntity; 10 | import org.springframework.validation.annotation.Validated; 11 | import org.springframework.web.bind.annotation.*; 12 | 13 | import javax.servlet.http.HttpServletRequest; 14 | import javax.servlet.http.HttpSession; 15 | 16 | @RestController 17 | @RequestMapping("/api") 18 | @Validated 19 | public class AccountController { 20 | @Autowired 21 | UserAccountService accountService; 22 | 23 | 24 | 25 | @PatchMapping(path = "/account/password/{id}") 26 | public JSONResponse modifyUserPassword(@PathVariable String id, ModifyPasswordAo ao) throws Exception { 27 | accountService.updatePassword(id, ao); 28 | return JSONResponse.ok(); 29 | } 30 | @PatchMapping(path = "/account/name/{id}") 31 | public JSONResponse setRecommendAvatar(@PathVariable String id,String name 32 | , HttpSession session)throws Exception{ 33 | //获取当前登录用户 34 | AccountContext ac= (AccountContext) session.getAttribute(AccountContext.class.getName()); 35 | //更新帐号 36 | accountService.changeName(ac.getId(),name); 37 | return JSONResponse.ok(); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/java/com/vip/web/controller/spring/CommonCssController.java: -------------------------------------------------------------------------------- 1 | package com.vip.web.controller.spring; 2 | 3 | import org.springframework.beans.factory.annotation.Value; 4 | import org.springframework.core.io.Resource; 5 | import org.springframework.stereotype.Controller; 6 | import org.springframework.web.bind.annotation.GetMapping; 7 | 8 | import javax.servlet.ServletOutputStream; 9 | import javax.servlet.http.HttpServletResponse; 10 | import java.io.IOException; 11 | import java.io.InputStream; 12 | import java.util.Arrays; 13 | 14 | 15 | @Controller 16 | public class CommonCssController { 17 | 18 | @Value("classpath:/static/css/common/*.css") 19 | Resource[] cssFiles; 20 | 21 | @GetMapping("/css/common.css") 22 | public void commonCss(HttpServletResponse resp) throws IOException { 23 | resp.setContentType("text/css;charset=utf-8"); 24 | 25 | Arrays.sort(cssFiles, (a, b) -> a.getFilename().compareToIgnoreCase(b.getFilename())); 26 | 27 | try (ServletOutputStream out = resp.getOutputStream()) { 28 | byte[] buff = new byte[10240]; 29 | int readed = 0; 30 | for (Resource f : cssFiles) { 31 | try (InputStream in = f.getInputStream()) { 32 | while ((readed = in.read(buff)) != -1) { 33 | out.write(buff, 0, readed); 34 | } 35 | out.println(); 36 | out.flush(); 37 | } 38 | } 39 | } 40 | 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/static/css/common/01.button.css: -------------------------------------------------------------------------------- 1 | button, a.btn { 2 | border: 1px solid #204d74; 3 | border-radius: 4px; 4 | background: #286090 none; 5 | color: #eeeeff; 6 | cursor: pointer; 7 | font-size: 100%; 8 | font-family: sans-serif, "宋体"; 9 | font-weight: bold; 10 | line-height: 1.15; 11 | overflow: hidden; 12 | box-sizing: border-box; 13 | padding: 8px 15px; 14 | margin: 0; 15 | } 16 | 17 | 18 | button:HOVER, a.btn:HOVER { 19 | color: #ffffff; 20 | background-color: #df2e1b; 21 | border-color: #c42818; 22 | } 23 | 24 | button:ACTIVE, a.btn:ACTIVE { 25 | color: #ffffff; 26 | background-color: #2f2f2f; 27 | border-bottom-color: #eee; 28 | border-right-color: #eee; 29 | } 30 | 31 | button[disabled], a[disabled].btn { 32 | cursor: wait; 33 | color: #eeeeff; 34 | background-color: gray; 35 | border-color: #204d74; 36 | } 37 | 38 | button.big { 39 | 40 | } 41 | 42 | a.btn { 43 | text-decoration: none; 44 | display: inline-block; 45 | vertical-align: middle; 46 | text-align: center; 47 | } 48 | 49 | /**两个按钮有距离*/ 50 | button + button, 51 | button + a.btn, 52 | a.btn + button, 53 | a.btn + a.btn { 54 | margin-left: 1em; 55 | } 56 | 57 | button.D3, a.btn.D3 { 58 | background-color: #DB5705; 59 | border-radius: 8px; 60 | box-shadow: 0px 9px 0px rgba(219, 31, 5, 1), 0px 9px 25px rgba(0, 0, 0, .7); 61 | transition: all .1s ease; 62 | } 63 | 64 | .D3:HOVER { 65 | background-color: #D56f0B; 66 | } 67 | 68 | 69 | -------------------------------------------------------------------------------- /jiajiale-web/src/test/java/test/vip/dao/TestSysUserDao.java: -------------------------------------------------------------------------------- 1 | package test.vip.dao; 2 | 3 | import com.vip.dao.SysAccountDao; 4 | import com.vip.entity.SysAccountEntity; 5 | import org.junit.Assert; 6 | import org.junit.Test; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import test.vip.AbstractSpringTest; 9 | 10 | import java.time.LocalDateTime; 11 | import java.util.HashMap; 12 | import java.util.Map; 13 | 14 | 15 | public class TestSysUserDao extends AbstractSpringTest { 16 | @Autowired 17 | SysAccountDao dao; 18 | 19 | @Test 20 | public void test00Insert() throws Exception{ 21 | SysAccountEntity e = new SysAccountEntity(); 22 | e.setName("name"); 23 | e.setId("id"); 24 | e.setAccount("account"); 25 | e.setPassword("password"); 26 | e.setAvatar("avatar"); 27 | e.setCreateTime(LocalDateTime.now()); 28 | e.setLastLoginTime(LocalDateTime.now()); 29 | e.setRemark("remark"); 30 | e.setLastLoginIp("lastLoginIp"); 31 | e.setStatus(0); 32 | e.setLastModifyPasswordTime(LocalDateTime.now()); 33 | dao.insert(e); 34 | 35 | } 36 | 37 | @Test 38 | public void test55Select() throws Exception{ 39 | SysAccountEntity e=dao.select("id", "id"); 40 | 41 | Assert.assertNotNull("不能为空" ,e); 42 | } 43 | 44 | @Test 45 | public void test99Delete() throws Exception{ 46 | dao.delete("id"); 47 | } 48 | 49 | @Test 50 | public void test88updte() throws Exception{ 51 | Map map=new HashMap<>(); 52 | map.put("name", "张三"); 53 | map.put("password", "123456"); 54 | dao.update("0001", map); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/java/com/vip/entity/SysAccountEntity.java: -------------------------------------------------------------------------------- 1 | package com.vip.entity; 2 | 3 | import java.time.LocalDateTime; 4 | import java.io.Serializable; 5 | import lombok.Data; 6 | /** 7 | * (SysAccount)实体类 8 | * 9 | * @author yizhuoyan@yizhuoyan.com 10 | * @since 2020-01-04 08:37:06 11 | */ 12 | @Data 13 | public class SysAccountEntity implements Serializable { 14 | private static final long serialVersionUID = -59496196109846524L; 15 | 16 | private String id; 17 | /** 18 | * 账号 19 | */ 20 | private String account; 21 | /** 22 | * 账号名称 23 | */ 24 | private String name; 25 | /** 26 | * 密码 27 | */ 28 | private String password; 29 | /** 30 | * 头像 31 | */ 32 | private String avatar; 33 | /** 34 | * 最后密码修改时间 35 | */ 36 | private LocalDateTime lastModifyPasswordTime; 37 | /** 38 | * 最后登录时间 39 | */ 40 | private LocalDateTime lastLoginTime; 41 | /** 42 | * 备注 43 | */ 44 | private String remark; 45 | /** 46 | * 最后登录设备 47 | */ 48 | private String lastLoginAgent; 49 | /** 50 | * 最后登录IP 51 | */ 52 | private String lastLoginIp; 53 | /** 54 | * 所属角色(0=vip 1=店员 2=经理) 55 | */ 56 | private Integer role; 57 | /** 58 | * 用户状态 0正常,1=锁定 59 | */ 60 | private Integer status; 61 | /** 62 | * 创建人 63 | */ 64 | private String createAccountId; 65 | private SysAccountEntity createAccount; 66 | /** 67 | * 创建时间 68 | */ 69 | private LocalDateTime createTime; 70 | 71 | 72 | 73 | } -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/static/css/common/layout80.tab.css: -------------------------------------------------------------------------------- 1 | /*********Tab*************/ 2 | .layout-tab { 3 | display: flex; 4 | flex-flow: column nowrap; 5 | } 6 | 7 | .layout-tab > .tabs { 8 | flex: 0 1 auto; 9 | border-bottom: 1px solid #DDDDDD; 10 | line-height: 30px; 11 | display: flex; 12 | flex-flow: row nowrap; 13 | justify-content: flex-start; 14 | align-items: flex-end; 15 | } 16 | 17 | .layout-tab > .tabs-cards { 18 | flex: 1 1 auto; 19 | border: 1px solid #DDDDDD; 20 | border-top: 0; 21 | position: relative; 22 | 23 | } 24 | .layout-tab > .tabs-cards.no-border{ 25 | border: none; 26 | } 27 | 28 | .layout-tab > .tabs-cards > .tab-card { 29 | position: absolute; 30 | z-index: -99; 31 | top: 0; 32 | left: 0; 33 | width: 100%; 34 | height: 100%; 35 | background: #fff; 36 | box-sizing: border-box; 37 | } 38 | 39 | .layout-tab > .tabs-cards > .tab-card.active { 40 | z-index: 0; 41 | } 42 | 43 | .layout-tab > .tabs > a { 44 | background-color: #F0F2F5; 45 | margin: 0 0 -1px; 46 | cursor: pointer; 47 | text-decoration: none; 48 | height: 100%; 49 | line-height: inherit; 50 | padding: 0 15px; 51 | color: #222222; 52 | border-bottom: 1px solid #dddddd; 53 | } 54 | 55 | .layout-tab > .tabs > a:HOVER { 56 | background-color: #F0E2F5; 57 | } 58 | 59 | .layout-tab > .tabs > a.active { 60 | border: 1px solid #dddddd; 61 | border-bottom: none; 62 | background-color: #fff; 63 | cursor: default; 64 | color: #000000; 65 | } 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/java/com/vip/vo/VipConsumeDetailVO.java: -------------------------------------------------------------------------------- 1 | package com.vip.vo; 2 | 3 | import java.time.LocalDateTime; 4 | 5 | import com.vip.entity.SysAccountEntity; 6 | import com.vip.entity.VipConsumeEntity; 7 | import com.vip.entity.VipDetailEntity; 8 | 9 | import lombok.Data; 10 | @Data 11 | public class VipConsumeDetailVO { 12 | private String id; 13 | private String mobile; 14 | private String no; 15 | private String vipId; 16 | private String vipName; 17 | private LocalDateTime consumeTime; 18 | /**关联订单id*/ 19 | private String orderId; 20 | /**优惠金额(元分)*/ 21 | private int discountMoney; 22 | /**享受折扣*/ 23 | private int enjoyDiscount; 24 | /**实际付款(元分)*/ 25 | private int actualPayMoney; 26 | /**消费金额(元分)*/ 27 | private int consumeMoney; 28 | /**录入人*/ 29 | private String createUserId; 30 | private String createUserName; 31 | private String rankName; 32 | private String remark; 33 | 34 | public static VipConsumeDetailVO of(VipConsumeEntity e) { 35 | VipConsumeDetailVO vo=new VipConsumeDetailVO(); 36 | vo.setActualPayMoney(e.getActualPayMoney()); 37 | SysAccountEntity createUser=e.getCreateUser(); 38 | vo.setCreateUserName(createUser.getName()); 39 | vo.setId(e.getId()); 40 | VipDetailEntity vip=e.getVip(); 41 | vo.setMobile(vip.getMobile()); 42 | vo.setNo(vip.getNo()); 43 | vo.setVipId(e.getVipId()); 44 | vo.setVipName(vip.getName()); 45 | vo.setConsumeTime(e.getConsumeTime()); 46 | vo.setOrderId(e.getOrderId()); 47 | vo.setDiscountMoney(e.getDiscountMoney()); 48 | vo.setEnjoyDiscount(e.getEnjoyDiscount()); 49 | vo.setConsumeMoney(e.getConsumeMoney()); 50 | vo.setCreateUserId(e.getCreateUserId()); 51 | vo.setRemark(e.getRemark()); 52 | vo.setRankName(vip.getRank().getName()); 53 | return vo; 54 | 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /jiajiale-web/src/test/java/test/vip/dao/TestSysVipDetailDao.java: -------------------------------------------------------------------------------- 1 | package test.vip.dao; 2 | 3 | import com.vip.dao.VipDetailDao; 4 | import com.vip.entity.VipDetailEntity; 5 | import org.junit.Assert; 6 | import org.junit.Test; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import test.vip.AbstractSpringTest; 9 | 10 | import java.time.LocalDate; 11 | import java.time.LocalDateTime; 12 | import java.util.HashMap; 13 | import java.util.Map; 14 | public class TestSysVipDetailDao extends AbstractSpringTest { 15 | @Autowired 16 | VipDetailDao dao; 17 | 18 | @Test 19 | public void test00Insert() throws Exception{ 20 | VipDetailEntity e = new VipDetailEntity(); 21 | e.setName("name9024"); 22 | e.setTotalDiscountMoney(73); 23 | e.setTotalConsumeMoney(27); 24 | e.setLastConsumeTime(LocalDateTime.now()); 25 | e.setId("id3813"); 26 | e.setNo("account3148"); 27 | e.setMobile("mobile8685"); 28 | e.setSex(false); 29 | e.setBirthday(LocalDate.now()); 30 | e.setQq("qq9734"); 31 | e.setEmail("email7592"); 32 | e.setAddress("address4963"); 33 | e.setZipCode("zipCode7067"); 34 | e.setRemark("remark2960"); 35 | 36 | e.setRankId(1); 37 | e.setCreateUserId("00000000000000000000000000000000"); 38 | e.setCreateTime(LocalDateTime.now()); 39 | 40 | 41 | dao.insert(e); 42 | 43 | } 44 | 45 | @Test 46 | public void test55Select() throws Exception{ 47 | VipDetailEntity e=dao.select("id", "id"); 48 | Assert.assertNotNull("不能查到",e); 49 | } 50 | 51 | @Test 52 | public void test99Delete() throws Exception{ 53 | dao.delete("id"); 54 | } 55 | 56 | @Test 57 | public void test88updte() throws Exception{ 58 | Map map=new HashMap<>(); 59 | map.put("name", "张三"); 60 | map.put("password", "123456"); 61 | dao.update("0001", map); 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/public/forget-password/view.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 修改密码 6 | 7 | 8 | 9 |
10 | 15 | 16 | 17 | 18 |
19 |

20 | 21 |

22 |

23 | 24 |

25 |

26 | 27 |

28 |
29 |
30 | 31 | 32 | 33 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/public/modify-password/view.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 修改密码 6 | 7 | 8 | 9 |
10 | 15 | 16 | 17 | 18 |
19 |

20 | 21 |

22 |

23 | 24 |

25 |

26 | 27 |

28 |
29 |
30 | 31 | 32 | 33 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/java/com/vip/web/controller/ConsumeController.java: -------------------------------------------------------------------------------- 1 | package com.vip.web.controller; 2 | 3 | import com.yizhuoyan.common.StringUtil; 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | import org.springframework.web.bind.annotation.*; 6 | 7 | import com.vip.ao.VipConsumeAo; 8 | import com.vip.dto.JSONResponse; 9 | import com.vip.dto.QueryResult; 10 | import com.vip.entity.VipConsumeEntity; 11 | import com.vip.service.VipConsumeManageService; 12 | import com.vip.vo.VipConsumeDetailVO; 13 | import com.vip.vo.VipConsumeListVO; 14 | 15 | @RestController 16 | @RequestMapping("/api") 17 | public class ConsumeController implements StringUtil { 18 | @Autowired 19 | VipConsumeManageService service; 20 | 21 | @PostMapping("/vipconsume") 22 | public JSONResponse add(VipConsumeAo ao) throws Exception { 23 | service.addVipConsume(ao); 24 | return JSONResponse.ok(); 25 | } 26 | 27 | @GetMapping("/vipconsume/{idOrMobile}") 28 | public JSONResponse check(@PathVariable String idOrMobile) throws Exception { 29 | VipConsumeEntity e = service.checkVipConsume(idOrMobile); 30 | return JSONResponse.ok(VipConsumeDetailVO.of(e)); 31 | } 32 | @DeleteMapping("/vipconsume/{id}") 33 | public JSONResponse handleRequest(@PathVariable String id) throws Exception { 34 | 35 | service.deleteVipConsume(id); 36 | return JSONResponse.ok(); 37 | 38 | } 39 | 40 | @GetMapping("/vipconsume") 41 | public JSONResponse list(String key, String pageNo, String pageSize) throws Exception { 42 | Integer pageNoInt = parseInt(pageNo,1); 43 | Integer pageSizeInt =parseInt(pageSize,10); 44 | QueryResult queryResult = service.queryVipConsumeByKey(key, pageNoInt, pageSizeInt); 45 | QueryResult queryVoResult = queryResult.rowsMap(VipConsumeListVO::of); 46 | return JSONResponse.ok(queryVoResult); 47 | 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /jiajiale-web/src/test/java/test/vip/service/TestVipManageServiceImpl.java: -------------------------------------------------------------------------------- 1 | package test.vip.service; 2 | 3 | import com.vip.ao.VipAo; 4 | import com.vip.dto.QueryResult; 5 | import com.vip.entity.VipDetailEntity; 6 | import com.vip.service.VipManageService; 7 | import org.junit.Assert; 8 | import org.junit.Test; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import test.vip.AbstractSpringTest; 11 | 12 | import java.util.List; 13 | 14 | 15 | class TestVipManageServiceImpl extends AbstractSpringTest { 16 | @Autowired 17 | VipManageService service; 18 | 19 | @Test 20 | void testAddVip() throws Exception{ 21 | VipAo e = new VipAo(); 22 | e.setName("name6161"); 23 | e.setMobile("mobile9075"); 24 | e.setSex("1"); 25 | e.setBirthday("1964-01-01"); 26 | e.setQq("qq9240"); 27 | e.setEmail("email3689"); 28 | e.setAddress("address883"); 29 | e.setZipCode("zipCode521"); 30 | e.setRankId("1"); 31 | e.setRemark("remark2965"); 32 | 33 | service.addVip(e); 34 | } 35 | @Test 36 | void testQueryVipByMobile0() throws Exception{ 37 | VipDetailEntity vip=service.queryVipByMobile(null); 38 | 39 | } 40 | @Test 41 | void testQueryVipByMobile1() throws Exception{ 42 | VipDetailEntity vip=service.queryVipByMobile(""); 43 | Assert.assertNull(vip); 44 | } 45 | @Test 46 | void testQueryVipByMobile2() throws Exception{ 47 | VipDetailEntity vip=service.queryVipByMobile("13888888888"); 48 | Assert.assertNotNull(vip); 49 | } 50 | 51 | @Test 52 | void testCheckVipById() { 53 | 54 | 55 | } 56 | 57 | @Test 58 | void testQueryVipByKey() throws Exception{ 59 | String key=" % "; 60 | QueryResult result=service.queryVipByKey(null,key, 1, 5); 61 | List rows=result.getRows(); 62 | for (VipDetailEntity v : rows) { 63 | System.out.println(v); 64 | } 65 | } 66 | 67 | @Test 68 | void testModifyVip() { 69 | 70 | 71 | } 72 | 73 | } 74 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/java/com/vip/vo/ClerkDetailVo.java: -------------------------------------------------------------------------------- 1 | package com.vip.vo; 2 | 3 | import com.vip.entity.EmpClerkEntity; 4 | import com.vip.entity.SysAccountEntity; 5 | import lombok.Data; 6 | 7 | import java.time.LocalDate; 8 | 9 | @Data 10 | public class ClerkDetailVo { 11 | /** 12 | * 帐号信息 13 | */ 14 | private AccountDetailVo account; 15 | 16 | private String id; 17 | /** 18 | * 真实姓名 19 | */ 20 | private String realName; 21 | /** 22 | * 性别 23 | */ 24 | private Integer sex; 25 | /** 26 | * 员工编号 27 | */ 28 | private String empNo; 29 | /** 30 | * 工作手机 31 | */ 32 | private String workMobile; 33 | /** 34 | * 工作邮箱 35 | */ 36 | private String workEmail; 37 | /** 38 | * 生日 39 | */ 40 | private LocalDate birthday; 41 | 42 | public static ClerkDetailVo of(EmpClerkEntity e){ 43 | ClerkDetailVo clerkDetailVo = new ClerkDetailVo(); 44 | clerkDetailVo.setAccount(AccountDetailVo.of(e.getAccount())); 45 | clerkDetailVo.setId(e.getId()); 46 | clerkDetailVo.setRealName(e.getRealName()); 47 | clerkDetailVo.setSex(e.getSex()); 48 | clerkDetailVo.setEmpNo(e.getEmpNo()); 49 | clerkDetailVo.setWorkMobile(e.getWorkMobile()); 50 | clerkDetailVo.setWorkEmail(e.getWorkEmail()); 51 | clerkDetailVo.setBirthday(e.getBirthday()); 52 | return clerkDetailVo; 53 | } 54 | public static ClerkDetailVo ofOnlyClerk(EmpClerkEntity e){ 55 | ClerkDetailVo clerkDetailVo = new ClerkDetailVo(); 56 | clerkDetailVo.setId(e.getId()); 57 | clerkDetailVo.setRealName(e.getRealName()); 58 | clerkDetailVo.setSex(e.getSex()); 59 | clerkDetailVo.setEmpNo(e.getEmpNo()); 60 | clerkDetailVo.setWorkMobile(e.getWorkMobile()); 61 | clerkDetailVo.setWorkEmail(e.getWorkEmail()); 62 | clerkDetailVo.setBirthday(e.getBirthday()); 63 | return clerkDetailVo; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/java/com/vip/vo/AccountDetailVo.java: -------------------------------------------------------------------------------- 1 | package com.vip.vo; 2 | 3 | import com.vip.entity.SysAccountEntity; 4 | import lombok.Data; 5 | 6 | import java.time.LocalDateTime; 7 | 8 | @Data 9 | public class AccountDetailVo { 10 | 11 | private String id; 12 | /** 13 | * 账号 14 | */ 15 | private String account; 16 | /** 17 | * 账号名称 18 | */ 19 | private String name; 20 | /** 21 | * 最后密码修改时间 22 | */ 23 | private LocalDateTime lastModifyPasswordTime; 24 | /** 25 | * 最后登录时间 26 | */ 27 | private LocalDateTime lastLoginTime; 28 | /** 29 | * 备注 30 | */ 31 | private String remark; 32 | /** 33 | * 最后登录设备 34 | */ 35 | private String lastLoginAgent; 36 | /** 37 | * 最后登录IP 38 | */ 39 | private String lastLoginIp; 40 | /** 41 | * 所属角色(0=vip 1=店员 2=经理) 42 | */ 43 | private Integer role; 44 | /** 45 | * 创建人 46 | */ 47 | private String createAccountId; 48 | 49 | private String createAccountShowName; 50 | /** 51 | * 创建时间 52 | */ 53 | private LocalDateTime createTime; 54 | 55 | public static AccountDetailVo of(SysAccountEntity e){ 56 | AccountDetailVo accountDetailVo = new AccountDetailVo(); 57 | accountDetailVo.setId(e.getId()); 58 | accountDetailVo.setAccount(e.getAccount()); 59 | accountDetailVo.setName(e.getName()); 60 | accountDetailVo.setLastModifyPasswordTime(e.getLastModifyPasswordTime()); 61 | accountDetailVo.setLastLoginTime(e.getLastLoginTime()); 62 | accountDetailVo.setRemark(e.getRemark()); 63 | accountDetailVo.setLastLoginAgent(e.getLastLoginAgent()); 64 | accountDetailVo.setLastLoginIp(e.getLastLoginIp()); 65 | accountDetailVo.setRole(e.getRole()); 66 | accountDetailVo.setCreateAccountId(e.getCreateAccountId()); 67 | accountDetailVo.setCreateAccountShowName(e.getName()); 68 | accountDetailVo.setCreateTime(e.getCreateTime()); 69 | return accountDetailVo; 70 | 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/java/com/vip/web/controller/spring/AllExceptionHandler.java: -------------------------------------------------------------------------------- 1 | package com.vip.web.controller.spring; 2 | 3 | import org.springframework.validation.BindException; 4 | import org.springframework.validation.ObjectError; 5 | import org.springframework.web.bind.annotation.ControllerAdvice; 6 | import org.springframework.web.bind.annotation.ExceptionHandler; 7 | import org.springframework.web.bind.annotation.ResponseBody; 8 | 9 | import com.vip.dto.JSONResponse; 10 | import com.vip.exception.VipException; 11 | 12 | import javax.validation.ConstraintViolation; 13 | import javax.validation.ConstraintViolationException; 14 | import java.util.List; 15 | import java.util.Set; 16 | 17 | @ControllerAdvice 18 | public class AllExceptionHandler { 19 | 20 | @ExceptionHandler 21 | public @ResponseBody 22 | JSONResponse handle(BindException e) { 23 | List allErrors = e.getAllErrors(); 24 | StringBuilder message=new StringBuilder(); 25 | for(ObjectError error:allErrors){ 26 | message.append(error.getDefaultMessage()); 27 | message.append("\n"); 28 | } 29 | return JSONResponse.fail(message.toString()); 30 | } 31 | 32 | @ExceptionHandler 33 | public @ResponseBody 34 | JSONResponse handle(ConstraintViolationException e) { 35 | StringBuilder message=new StringBuilder(); 36 | Set> constraintViolations = e.getConstraintViolations(); 37 | for (ConstraintViolation constraintViolation : constraintViolations) { 38 | message.append(constraintViolation.getMessage()); 39 | message.append("\n"); 40 | } 41 | 42 | return JSONResponse.fail(message.toString()); 43 | } 44 | 45 | @ExceptionHandler 46 | public @ResponseBody 47 | JSONResponse handle(VipException e) { 48 | 49 | return JSONResponse.fail(e.getMessage()); 50 | } 51 | @ExceptionHandler 52 | public @ResponseBody 53 | JSONResponse handle(Exception e) { 54 | e.printStackTrace(); 55 | return JSONResponse.fail("系统好累好累"); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/java/com/vip/dto/QueryResult.java: -------------------------------------------------------------------------------- 1 | package com.vip.dto; 2 | /** 3 | * 公共查询结果DTO 4 | * @author Administrator 5 | * 6 | */ 7 | 8 | import java.util.List; 9 | import java.util.function.Function; 10 | import java.util.stream.Collectors; 11 | 12 | public class QueryResult { 13 | //总记录数 14 | private int totalRows; 15 | //当前页码 16 | private int pageNo; 17 | //每页大小 18 | private int pageSize; 19 | //总页数 20 | private int totalPages=-1; 21 | //当前页记录 22 | private List rows; 23 | 24 | public QueryResult() { 25 | 26 | } 27 | 28 | 29 | public int getTotalRows() { 30 | return totalRows; 31 | } 32 | public void setTotalRows(int totalRows) { 33 | this.totalRows = totalRows; 34 | } 35 | public void setTotalRows(long totalRows) { 36 | this.totalRows = (int)totalRows; 37 | } 38 | public int getPageNo() { 39 | return pageNo; 40 | } 41 | public void setPageNo(int pageNo) { 42 | this.pageNo = pageNo; 43 | } 44 | 45 | public int getTotalPages() { 46 | if(totalPages==-1) { 47 | totalPages=totalRows/pageSize; 48 | if(totalRows%pageSize!=0) { 49 | totalPages++; 50 | } 51 | } 52 | return totalPages; 53 | } 54 | 55 | public int getPageSize() { 56 | return pageSize; 57 | } 58 | public void setPageSize(int pageSize) { 59 | this.pageSize = pageSize; 60 | } 61 | public List getRows() { 62 | return rows; 63 | } 64 | public void setRows(List rows) { 65 | this.rows = rows; 66 | } 67 | 68 | public QueryResult rowsMap(Function mapper){ 69 | QueryResult qr=new QueryResult<>(); 70 | qr.setPageNo(this.getPageNo()); 71 | qr.setPageSize(this.getPageSize()); 72 | qr.setTotalRows(this.getTotalRows()); 73 | if(this.rows!=null) { 74 | qr.setRows(this.rows.stream().map(mapper).collect(Collectors.toList())); 75 | } 76 | return qr; 77 | } 78 | 79 | @Override 80 | public String toString() { 81 | return "QueryResult [totalRows=" + totalRows + ", pageNo=" + pageNo + ", pageSize=" + pageSize + ", totalPages=" 82 | + totalPages + ", rows=" + rows + "]"; 83 | } 84 | 85 | 86 | 87 | 88 | } 89 | -------------------------------------------------------------------------------- /common-util/src/main/java/com/yizhuoyan/common/ArrayListSet.java: -------------------------------------------------------------------------------- 1 | package com.yizhuoyan.common; 2 | 3 | import java.util.ArrayList; 4 | import java.util.Collection; 5 | import java.util.Iterator; 6 | import java.util.Set; 7 | 8 | /** 9 | * 内部使用ArrayList实现的Set 10 | * 特征: 11 | * - 没有去重功能,请使用者保证数据唯一性 12 | * @param 13 | */ 14 | public class ArrayListSet implements Set { 15 | 16 | private final ArrayList list; 17 | 18 | public ArrayListSet(int capacity) { 19 | this.list =new ArrayList<>(capacity); 20 | } 21 | 22 | public ArrayListSet(ArrayList list) { 23 | this.list =list; 24 | } 25 | 26 | @Override 27 | public int size() { 28 | return list.size(); 29 | } 30 | 31 | @Override 32 | public boolean isEmpty() { 33 | return list.isEmpty(); 34 | } 35 | 36 | @Override 37 | public boolean contains(Object o) { 38 | return list.contains(o); 39 | } 40 | 41 | @Override 42 | public Iterator iterator() { 43 | return this.list.iterator(); 44 | } 45 | 46 | @Override 47 | public Object[] toArray() { 48 | return this.list.toArray(); 49 | } 50 | 51 | @Override 52 | public T[] toArray(T[] a) { 53 | return this.list.toArray(a); 54 | } 55 | 56 | @Override 57 | public boolean add(T o) { 58 | return this.list.add(o); 59 | } 60 | 61 | @Override 62 | public boolean remove(Object o) { 63 | return this.list.remove(o); 64 | } 65 | 66 | @Override 67 | public boolean containsAll(Collection c) { 68 | return this.list.contains(c); 69 | } 70 | 71 | @Override 72 | public boolean addAll(Collection c) { 73 | return this.list.addAll(c); 74 | } 75 | 76 | @Override 77 | public boolean retainAll(Collection c) { 78 | return this.list.retainAll(c); 79 | } 80 | 81 | @Override 82 | public boolean removeAll(Collection c) { 83 | return this.list.removeAll(c); 84 | } 85 | 86 | @Override 87 | public void clear() { 88 | this.list.clear(); 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/static/css/common/01.form-default.css: -------------------------------------------------------------------------------- 1 | form { 2 | margin: 0; 3 | padding-left:15px; 4 | padding-right:15px; 5 | display: inline-flex; 6 | flex-flow: column nowrap; 7 | justify-content: flex-start; 8 | align-items: stretch; 9 | } 10 | 11 | form.inline{ 12 | 13 | justify-content: flex-start; 14 | flex-flow: row wrap; 15 | align-items: stretch; 16 | } 17 | 18 | form>div{ 19 | display: flex; 20 | flex-flow: row wrap; 21 | justify-content: flex-start; 22 | align-items: center; 23 | margin: 0em; 24 | } 25 | 26 | /*form下的p表示一个标注+控件区域*/ 27 | form p{ 28 | display: flex; 29 | flex-flow: row nowrap; 30 | justify-content: flex-start; 31 | align-items: center; 32 | margin-top: 1em; 33 | margin-right: 1em; 34 | flex: auto; 35 | } 36 | form p.align-center{ 37 | justify-content: center; 38 | } 39 | form p.align-left{ 40 | justify-content: flex-start; 41 | } 42 | form p.align-right{ 43 | justify-content: flex-end; 44 | } 45 | 46 | form input[type="text"], 47 | form input[type="password"], 48 | form input[type="number"], 49 | form input[type="datetime-local"], 50 | form input[type="date"], 51 | form input[type="email"], 52 | form input[type="url"], 53 | form input[type="tel"], 54 | form select, 55 | form textarea 56 | { 57 | flex:auto; 58 | } 59 | form p>label[for] { 60 | text-align: right; 61 | } 62 | form.label5em p>label[for] { 63 | width: 4em; 64 | } 65 | 66 | form.label5em p>label[for] { 67 | width: 5em; 68 | } 69 | 70 | form.label6em p>label[for] { 71 | min-width: 6em; 72 | } 73 | 74 | form.label7em p>label[for] { 75 | min-width: 7em; 76 | } 77 | 78 | form.label8em p>label[for] { 79 | width: 8em; 80 | } 81 | form.label9em p>label[for] { 82 | min-width: 9em; 83 | } 84 | form.label10em p>label[for] { 85 | min-width: 10em; 86 | } 87 | form.label12em p>label[for] { 88 | min-width: 12em; 89 | } 90 | 91 | form em { 92 | color: #7f7f7f; 93 | padding-left: 1em; 94 | font-style: normal; 95 | } 96 | 97 | form p>.align-top 98 | { 99 | align-self: flex-start; 100 | } 101 | form p>.align-bottom{ 102 | align-self: flex-end; 103 | } 104 | form p>.align-middle{ 105 | align-self: center; 106 | } 107 | 108 | 109 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/mapper/VipConsumeDaoMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | insert into vip_consume( 8 | id,vip_id,consume_time,order_id,discount_money, 9 | actual_pay_money,consume_money,create_user_id, 10 | status,remark,enjoy_discount 11 | )values( 12 | #{id},#{vipId},#{consumeTime},#{orderId},#{discountMoney}, 13 | #{actualPayMoney},#{consumeMoney},#{createUserId}, 14 | #{status},#{remark},#{enjoyDiscount}) 15 | 16 | 17 | 18 | 19 | update vip_consume 20 | 21 | order_Id=#{e.orderId}, 22 | actual_pay_money=#{e.actualPayMoney}, 23 | status=#{e.status}, 24 | 25 | where id=#{id} 26 | 27 | 31 | 32 | 33 | 50 | 56 | 57 | 58 | 59 | 63 | 64 | 65 | 69 | 70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/java/com/vip/web/controller/SessionController.java: -------------------------------------------------------------------------------- 1 | package com.vip.web.controller; 2 | 3 | import com.vip.ao.AvatarAo; 4 | import com.vip.ao.ModifyPasswordAo; 5 | import com.vip.dto.AccountContext; 6 | import com.vip.dto.JSONResponse; 7 | import com.vip.service.UserAccountService; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.http.HttpRequest; 10 | import org.springframework.http.HttpStatus; 11 | import org.springframework.http.ResponseEntity; 12 | import org.springframework.stereotype.Controller; 13 | import org.springframework.validation.annotation.Validated; 14 | import org.springframework.web.bind.annotation.*; 15 | 16 | import javax.servlet.http.HttpServletRequest; 17 | import javax.servlet.http.HttpServletResponse; 18 | import javax.servlet.http.HttpSession; 19 | 20 | @RestController 21 | @RequestMapping("/api") 22 | @Validated 23 | public class SessionController { 24 | @Autowired 25 | UserAccountService accountService; 26 | 27 | 28 | 29 | 30 | 31 | @PostMapping("/session") 32 | public JSONResponse login(String account, 33 | String password, HttpServletRequest req, HttpSession session) throws Exception { 34 | //获取登录IP 35 | String ip=req.getRemoteHost(); 36 | String ip2=req.getRemoteAddr(); 37 | //获取登录设备 38 | String userAgent=req.getHeader("user-agent"); 39 | if(userAgent.contains("android")){ 40 | 41 | }else if(userAgent.contains("")){ 42 | 43 | } 44 | AccountContext ac = accountService.login(account, password); 45 | session.setAttribute(AccountContext.class.getName(), ac); 46 | 47 | return JSONResponse.ok(session.getId()); 48 | 49 | } 50 | 51 | @DeleteMapping("/session/{token}") 52 | public JSONResponse logout(@PathVariable String token,HttpSession session) throws Exception { 53 | session.invalidate(); 54 | System.out.println(token); 55 | return JSONResponse.ok(); 56 | } 57 | 58 | 59 | @GetMapping("/session") 60 | public ResponseEntity getSession(HttpSession session){ 61 | AccountContext ac= (AccountContext) session.getAttribute(AccountContext.class.getName()); 62 | if(ac!=null) { 63 | return ResponseEntity.ok(ac); 64 | } 65 | return ResponseEntity.status(HttpStatus.GONE).build(); 66 | } 67 | 68 | 69 | } 70 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/java/com/vip/web/controller/VipController.java: -------------------------------------------------------------------------------- 1 | package com.vip.web.controller; 2 | 3 | import com.vip.ao.VipAo; 4 | import com.vip.dto.JSONResponse; 5 | import com.vip.dto.QueryResult; 6 | import com.vip.entity.VipDetailEntity; 7 | import com.vip.service.VipManageService; 8 | import com.vip.vo.VipDetailVO; 9 | import com.vip.vo.VipListVO; 10 | import com.yizhuoyan.common.StringUtil; 11 | import org.springframework.beans.factory.annotation.Autowired; 12 | import org.springframework.web.bind.annotation.*; 13 | 14 | import javax.validation.Valid; 15 | 16 | @RestController 17 | @RequestMapping("/api") 18 | public class VipController implements StringUtil { 19 | 20 | @Autowired 21 | VipManageService service; 22 | 23 | @PostMapping("/vip") 24 | public JSONResponse addVip(@Valid VipAo ao) throws Exception { 25 | 26 | System.out.println(service.getClass() + "----------------------"); 27 | service.addVip(ao); 28 | 29 | return JSONResponse.ok(); 30 | } 31 | 32 | @GetMapping("/vip/{id}") 33 | public JSONResponse checkVipById(@PathVariable String id) throws Exception { 34 | VipDetailEntity e = service.checkVipById(id); 35 | return JSONResponse.ok(VipDetailVO.of(e)); 36 | } 37 | //vip?mobile=11 38 | @GetMapping(path = "/vip", params = "mobile") 39 | public JSONResponse queryVipByMobile(String mobile) throws Exception { 40 | service.queryVipByMobile(mobile); 41 | VipDetailEntity e = service.queryVipByMobile(mobile); 42 | return JSONResponse.ok(VipDetailVO.of(e)); 43 | } 44 | 45 | //vip?key=11&pageNo=1 46 | @GetMapping(path = "/vip", params = {"rankId","key"}) 47 | public JSONResponse queryVipByKey(String rankId, String key, String pageNo, String pageSize) throws Exception { 48 | Integer pageNoInt = parseInt(pageNo,1); 49 | Integer pageSizeInt =parseInt(pageSize,10); 50 | Integer rankIdInt=parseInt(rankId,null); 51 | QueryResult queryEntityResult = service.queryVipByKey(rankIdInt, key, pageNoInt, pageSizeInt); 52 | QueryResult queryResult = queryEntityResult.rowsMap(VipListVO::of); 53 | return JSONResponse.ok(queryResult); 54 | } 55 | 56 | 57 | @PutMapping("/vip/{id}") 58 | public JSONResponse modifyVip(@PathVariable String id, VipAo ao) throws Exception { 59 | service.modifyVip(id, ao); 60 | return JSONResponse.ok(); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/java/com/vip/service/impl/ClerkManageServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.vip.service.impl; 2 | 3 | import com.vip.ao.ClerkAo; 4 | import com.vip.dao.EmpClerkDao; 5 | import com.vip.dao.SysAccountDao; 6 | import com.vip.entity.EmpClerkEntity; 7 | import com.vip.entity.SysAccountEntity; 8 | import com.vip.service.ClerkManageService; 9 | import com.yizhuoyan.common.BeanMap; 10 | import lombok.NonNull; 11 | import lombok.extern.slf4j.Slf4j; 12 | import org.springframework.beans.factory.annotation.Autowired; 13 | import org.springframework.stereotype.Service; 14 | import org.springframework.validation.annotation.Validated; 15 | 16 | import java.time.LocalDate; 17 | import java.util.Objects; 18 | 19 | @Service 20 | @Slf4j 21 | @Validated 22 | public class ClerkManageServiceImpl implements ClerkManageService { 23 | 24 | @Autowired 25 | SysAccountDao accountDao; 26 | @Autowired 27 | EmpClerkDao clerkDao; 28 | 29 | @Override 30 | public EmpClerkEntity loadClerk(@NonNull String id) throws Exception { 31 | EmpClerkEntity clerk=clerkDao.selectById(id); 32 | assertNotNull("{1}不存在",clerk,id); 33 | return clerk; 34 | } 35 | 36 | @Override 37 | public void modifyClerkInfo(@NonNull String id,@NonNull ClerkAo ao) throws Exception { 38 | final EmpClerkEntity e = clerkDao.selectById(id); 39 | assertNotNull("{1}不存在",e,id); 40 | 41 | BeanMap map=new BeanMap(8); 42 | String newRealName=ao.getRealName(); 43 | if(!Objects.equals(newRealName,e.getRealName())){ 44 | map.put("real_name",newRealName); 45 | } 46 | 47 | Integer newSex=parseInt(ao.getSex()); 48 | if(!Objects.equals(newSex,e.getSex())){ 49 | map.put("sex",newSex); 50 | } 51 | 52 | String newWorkEmail=ao.getWorkEmail(); 53 | if(!Objects.equals(newWorkEmail,e.getWorkEmail())){ 54 | map.put("work_email",newWorkEmail); 55 | } 56 | String newWorkMobile=ao.getWorkMobile(); 57 | if(!Objects.equals(newWorkMobile,e.getWorkMobile())){ 58 | map.put("work_mobile",newWorkMobile); 59 | } 60 | LocalDate newBirthday=parseLocalDate(ao.getBirthday(),"YYYY-MM-dd"); 61 | if(!Objects.equals(newBirthday,e.getBirthday())){ 62 | map.put("birthday",newSex); 63 | } 64 | 65 | if(map.isEmpty()){ 66 | return; 67 | } 68 | clerkDao.update(id,map); 69 | 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/java/com/vip/vo/VipDetailVO.java: -------------------------------------------------------------------------------- 1 | package com.vip.vo; 2 | 3 | import com.vip.entity.VipDetailEntity; 4 | import lombok.Data; 5 | 6 | import java.time.LocalDate; 7 | import java.time.LocalDateTime; 8 | 9 | @Data 10 | public class VipDetailVO { 11 | private String id; 12 | /**vip账号(目前客户手机号)*/ 13 | private String no; 14 | 15 | /**手机号,可作为会员凭证*/ 16 | private String mobile; 17 | 18 | /**账号名称(客户姓名)*/ 19 | private String name; 20 | 21 | /**性别*/ 22 | private Integer sex; 23 | 24 | /**生日*/ 25 | private LocalDate birthday; 26 | 27 | /***/ 28 | private String qq; 29 | 30 | /***/ 31 | private String email; 32 | 33 | /***/ 34 | private String address; 35 | 36 | /**邮编*/ 37 | private String zipCode; 38 | 39 | /**等级*/ 40 | private String rankName; 41 | 42 | private Integer rankId; 43 | 44 | /**总优惠金额*/ 45 | private Integer totalDiscountMoney; 46 | 47 | /**目前消费总金额,单位分元*/ 48 | private Integer totalConsumeMoney; 49 | 50 | /***/ 51 | private String remark; 52 | 53 | /**创建人*/ 54 | private String createUserName; 55 | private String createUserId; 56 | 57 | /**创建时间*/ 58 | private LocalDateTime createTime; 59 | /** 60 | * 最后消费时间 61 | */ 62 | private LocalDateTime lastConsumeTime; 63 | 64 | public static VipDetailVO of(VipDetailEntity e) { 65 | if(e==null)return null; 66 | VipDetailVO vo = new VipDetailVO(); 67 | vo.setName(e.getName()); 68 | vo.setAddress(e.getAddress()); 69 | vo.setTotalDiscountMoney(e.getTotalDiscountMoney()); 70 | vo.setTotalConsumeMoney(e.getTotalConsumeMoney()); 71 | if(e.getCreateUser()==null) { 72 | vo.setCreateUserName(e.getCreateUser().getName()); 73 | vo.setCreateUserId(e.getCreateUserId()); 74 | } 75 | vo.setLastConsumeTime(e.getLastConsumeTime()); 76 | vo.setId(e.getId()); 77 | vo.setNo(e.getNo()); 78 | vo.setMobile(e.getMobile()); 79 | vo.setSex(e.getSex()?1:0); 80 | vo.setBirthday(e.getBirthday()); 81 | vo.setQq(e.getQq()); 82 | vo.setEmail(e.getEmail()); 83 | vo.setZipCode(e.getZipCode()); 84 | if(e.getRank()!=null) { 85 | vo.setRankName(e.getRank().getName()); 86 | vo.setRankId(e.getRank().getId()); 87 | } 88 | vo.setRemark(e.getRemark()); 89 | vo.setCreateTime(e.getCreateTime()); 90 | return vo; 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/public/vip/index/welcome.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 家家乐VIP消费查询系统 5 | 7 | 9 | 47 | 48 | 49 | 81 | 82 | 83 | 84 | 94 | 95 | 96 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/public/vip/index/view.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 主页 6 | 7 | 8 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 |
37 |
38 |
39 |

40 | Logo 41 | 佳佳乐VIP消费查询系统 42 |

43 |
44 |
45 | {{currentAccount.name}}({{currentAccount.account}}) 46 | 47 | 退出登录 48 |
49 |
50 |
51 | 52 |
53 |
54 | XXXX公司版权所有 55 |
56 |
57 | 58 | 87 | 88 | 89 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/mapper/VipRankDaoMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | insert into vip_rank(name, need_consume, enjoy_discount, show_order, remark) 16 | values (#{name}, #{needConsume}, #{enjoyDiscount}, #{showOrder}, #{remark}) 17 | 18 | 19 | 20 | delete from vip_rank 21 | where id = #{id} 22 | 23 | 24 | 25 | update vip_rank 26 | 27 | 28 | name = #{e.name}, 29 | 30 | 31 | need_consume = #{e.needConsume}, 32 | 33 | 34 | enjoy_discount = #{e.enjoyDiscount}, 35 | 36 | 37 | show_order = #{e.showOrder}, 38 | 39 | 40 | remark = #{e.remark}, 41 | 42 | 43 | where id = #{id} 44 | 45 | 46 | 51 | 52 | 57 | 58 | 63 | 64 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/public/clerk/consume-manage/add/view.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 录入VIP客户消费记录 6 | 7 | 12 | 13 | 14 |
15 | 21 | 22 | 23 | 返回 24 | 25 |
26 |
27 |

28 | 29 | 30 |

31 | 32 |

33 | 34 | 35 |

36 | 37 |

38 | 39 | 40 |

41 | 42 |

43 | 44 | 45 |

46 |
47 |
48 |
49 | 50 | 51 | 52 | 79 | 80 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/public/clerk/add-vip-consume/view.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 录入VIP客户消费记录 6 | 7 | 12 | 13 | 14 |
15 | 21 | 22 | 23 | 返回 24 | 25 |
26 |
27 |

28 | 29 | 30 |

31 | 32 |

33 | 34 | 35 |

36 | 37 |

38 | 39 | 40 |

41 | 42 |

43 | 44 | 45 |

46 |
47 |
48 |
49 | 50 | 51 | 52 | 79 | 80 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/public/login/view.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 登录 6 | 7 | 8 | 16 | 17 | 18 |
19 |
20 | Logo 21 |

佳佳乐商城VIP消费{{nowYear}}查询系统

22 |
23 | 24 |
25 |
26 |

27 | 28 | 29 |

30 | 31 |

32 | 33 | 34 |

35 |

36 | 37 | 忘记密码? 38 |

39 |
40 |
41 | 42 | 48 |
49 | 50 | 51 | 52 | 53 | 87 | 88 | 89 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/static/css/common/01.input.css: -------------------------------------------------------------------------------- 1 | input[type="text"], 2 | input[type="password"], 3 | input[type="number"], 4 | input[type="datetime-local"], 5 | input[type="date"], 6 | input[type="email"], 7 | input[type="url"], 8 | input[type="tel"], 9 | select, 10 | textarea { 11 | box-sizing: border-box; 12 | display: inline-block; 13 | vertical-align: middle; 14 | font-size: 100%; 15 | color: #555; 16 | background-color: #fff; 17 | border: 1px solid #ccc; 18 | border-radius: 4px; 19 | -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); 20 | box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); 21 | -webkit-transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s; 22 | -o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; 23 | transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; 24 | font-family: "Microsoft YaHei", 微软雅黑, "MicrosoftJhengHei", serif; 25 | padding-left: .5em; 26 | line-height: 1.15; 27 | min-height: 3em; 28 | width:auto; 29 | } 30 | 31 | input:focus, textarea:focus,select:focus { 32 | border-color: #66afe9; 33 | outline: 0; 34 | -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px rgba(102, 175, 233, .6); 35 | box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px rgba(102, 175, 233, .6); 36 | } 37 | 38 | input:hover, textarea:hover,select:hover { 39 | -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px rgba(102, 175, 133, .6); 40 | box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px rgba(102, 175, 133, .6); 41 | } 42 | 43 | input[readonly], textarea[readonly],select[readonly]{ 44 | background: #F0FFFF !important; 45 | color: #808080 !important; 46 | } 47 | input[required], 48 | textarea[required], 49 | select[required]{ 50 | 51 | } 52 | 53 | input[disabled], textarea[disabled],select[disabled]{ 54 | 55 | background: #eeeeee !important; 56 | color: #000 !important; 57 | } 58 | 59 | textarea { 60 | padding-right: .5em; 61 | text-indent: 0; 62 | vertical-align: top; 63 | min-height: 10em; 64 | } 65 | 66 | [type="number"]::-webkit-inner-spin-button, 67 | [type="number"]::-webkit-outer-spin-button { 68 | height: auto; 69 | } 70 | 71 | 72 | input[type=text].error,input[type=password].error { 73 | background-image: 74 | url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAGBQTFRF6ikW9isX/oJ1+WM2804q/FQu+U4r3hQL7DMc5RoO0gYD2wsGzjge4op7910y5iERzgMC7j0h8EUl5yQT8Hlw5mxq6XBr+Yp5/YV39VYu8EAi9EQl9lox5CAR+mk5////cSPVLQAAACB0Uk5T/////////////////////////////////////////wBcXBvtAAAAmUlEQVR42mRP2RKEMAij2kular22nv3/vxSob8sDyWQIBMg5h5BLMQECxKIIAYKqEqUQIDAmIQmYjKmQBGWf2mJAWz9WIVtUX/cJE3VFFvae+6V/+tpPWcpuOLTWB/AmKPf8NE1ebpWJxccY/fJNBLwB5nsGuL9g2zAPDh31TYKtrmkc5WBYOVjbda0kFcKWcfx+YfL37SvAAIWoEZFQ+hmUAAAAAElFTkSuQmCC); 75 | background-repeat: no-repeat; 76 | background-position: 230px center; 77 | background-size: 15px 15px; 78 | } -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/public/clerk/mine/view.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 主页 6 | 8 | 10 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 74 | 75 | 104 | 105 | 106 | -------------------------------------------------------------------------------- /jiajiale-web/src/test/java/tool/yizhuoyan/GenereteInsertMethodBody.java: -------------------------------------------------------------------------------- 1 | package tool.yizhuoyan; 2 | 3 | import java.lang.reflect.Method; 4 | import java.util.ArrayList; 5 | import java.util.Collection; 6 | import java.util.Collections; 7 | import java.util.List; 8 | 9 | 10 | 11 | public class GenereteInsertMethodBody { 12 | 13 | public static void main(String[] args) { 14 | //run(SysDictionary.class); 15 | } 16 | 17 | 18 | 19 | public static void run(Class type) { 20 | StringBuilder result=new StringBuilder(); 21 | result.append("\tint i = 1;\n"); 22 | Method[] methods = type.getMethods(); 23 | List methodsList=new ArrayList<>(methods.length/2); 24 | String methodName=null; 25 | for (Method method : methods) { 26 | methodName=method.getName(); 27 | if((methodName.startsWith("get")|| 28 | methodName.startsWith("is"))&& 29 | method.getParameterCount()==0&& 30 | !methodName.equals("getClass")) { 31 | methodsList.add(method); 32 | 33 | } 34 | } 35 | Collections.sort(methodsList,(a,b)->{ 36 | return a.getName().compareTo(b.getName()); 37 | }); 38 | for (Method method : methodsList) { 39 | generateSetStatement(result, method); 40 | } 41 | System.out.println(result); 42 | } 43 | private static void generateSetStatement(StringBuilder result,Method m) { 44 | Class type=m.getReturnType(); 45 | 46 | String typeName="Object"; 47 | String value="e."+m.getName()+"()"; 48 | if(type==String.class) { 49 | typeName="String"; 50 | }else if(type==int.class||type==Integer.class) { 51 | typeName="Int"; 52 | }else if(type==boolean.class||type==Boolean.class) { 53 | typeName="Boolean"; 54 | }else if(type==long.class||type==Long.class) { 55 | typeName="Long"; 56 | }else if(type==float.class||type==Float.class) { 57 | typeName="Float"; 58 | }else if(type==double.class||type==Double.class) { 59 | typeName="Double"; 60 | }else if(type==java.util.Date.class) { 61 | typeName="Timestamp"; 62 | value="utilDate2timestamp("+value+")"; 63 | }else if(type==java.time.Instant.class) { 64 | typeName="Timestamp"; 65 | value="instant2timestamp("+value+")"; 66 | }else if(type==java.time.LocalDate.class) { 67 | typeName="Date"; 68 | value="localDate2sqlDate("+value+")"; 69 | }else if(type==java.time.LocalTime.class) { 70 | typeName="Time"; 71 | value="localTime2sqlTime("+value+")"; 72 | }else if(type==java.time.LocalDateTime.class) { 73 | typeName="Timestamp"; 74 | value="localDateTime2timestamp("+value+")"; 75 | }else if(Collection.class.isAssignableFrom(type)) { 76 | //miss 77 | }else{//may be entity 78 | result.append("\tps.setString(i++,"); 79 | result.append(value).append("==null?null:") 80 | .append(value).append(".getId());\n"); 81 | return; 82 | } 83 | result.append("\tps.set"); 84 | result.append(typeName); 85 | result.append("(i++,").append(value).append(");\n"); 86 | } 87 | static private String lowerFirstChar(String s) { 88 | char[] cs=s.toCharArray(); 89 | cs[0]=Character.toLowerCase(cs[0]); 90 | return new String(cs); 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/public/clerk/mine/info.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 主页 6 | 7 | 8 | 9 | 10 | 11 | 16 | 17 | 18 | 19 |
20 |
21 |
22 |

23 | 24 | 25 |

26 |

27 | 28 | 29 |

30 |
31 |
32 |

33 | 34 | 38 |

39 |

40 | 41 | 42 |

43 |
44 | 45 |

46 | 47 | 48 |

49 | 50 |

51 | 52 | 53 |

54 | 55 |
56 |
57 | 58 | 59 | 60 | 96 | 97 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/java/com/vip/JiaJiaLeApplication.java: -------------------------------------------------------------------------------- 1 | package com.vip; 2 | 3 | import com.vip.dto.AccountContext; 4 | import com.vip.service.VipManageService; 5 | import com.vip.service.impl.VipManageServiceImpl; 6 | import com.vip.web.controller.spring.StringTrimConverter; 7 | import com.vip.web.interceptor.SessionInterceptor; 8 | import org.hibernate.validator.HibernateValidator; 9 | import org.mybatis.spring.annotation.MapperScan; 10 | import org.mybatis.spring.boot.autoconfigure.MybatisAutoConfiguration; 11 | import org.springframework.beans.propertyeditors.StringTrimmerEditor; 12 | import org.springframework.boot.SpringApplication; 13 | import org.springframework.boot.autoconfigure.SpringBootApplication; 14 | import org.springframework.boot.builder.SpringApplicationBuilder; 15 | import org.springframework.boot.context.properties.EnableConfigurationProperties; 16 | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; 17 | import org.springframework.context.annotation.Bean; 18 | import org.springframework.context.annotation.Configuration; 19 | import org.springframework.context.annotation.Primary; 20 | import org.springframework.format.FormatterRegistry; 21 | import org.springframework.stereotype.Controller; 22 | import org.springframework.web.bind.annotation.RequestMapping; 23 | import org.springframework.web.servlet.config.annotation.CorsRegistry; 24 | import org.springframework.web.servlet.config.annotation.InterceptorRegistry; 25 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; 26 | 27 | import javax.servlet.http.HttpSession; 28 | import javax.validation.Validation; 29 | import javax.validation.Validator; 30 | 31 | /** 32 | * Created by Administrator on 5/14. 33 | */ 34 | @MapperScan("com.vip.dao") 35 | @SpringBootApplication 36 | public class JiaJiaLeApplication implements WebMvcConfigurer { 37 | 38 | /** 39 | * 验证器 40 | * 41 | * @return 42 | */ 43 | @Bean 44 | public Validator createValidator() { 45 | return Validation.byProvider(HibernateValidator.class) 46 | .configure() 47 | .failFast(true) 48 | .buildValidatorFactory() 49 | .getValidator(); 50 | } 51 | 52 | 53 | 54 | @Override 55 | public void addFormatters(FormatterRegistry registry) { 56 | //添加字符串清理coverter 57 | registry.addConverter(new StringTrimConverter()); 58 | } 59 | 60 | 61 | /** 62 | * 添加权限拦截器 63 | * 64 | * @param registry 65 | */ 66 | public void addInterceptors(InterceptorRegistry registry) { 67 | registry.addInterceptor(new SessionInterceptor()) 68 | .addPathPatterns("/api/**") 69 | .excludePathPatterns("/api/session"); 70 | } 71 | 72 | /** 73 | * 添加跨域配置 74 | * 75 | * @param registry 76 | */ 77 | @Override 78 | public void addCorsMappings(CorsRegistry registry) { 79 | registry.addMapping("/api/**") 80 | .allowCredentials(true) 81 | .allowedMethods("*"); 82 | } 83 | 84 | 85 | public static void main(String[] args) { 86 | SpringApplication.run(JiaJiaLeApplication.class); 87 | } 88 | 89 | 90 | } 91 | -------------------------------------------------------------------------------- /jiajiale-web/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | jar 6 | 7 | 8 | org.springframework.boot 9 | spring-boot-starter-parent 10 | 2.1.4.RELEASE 11 | 12 | 13 | 14 | 15 | com.yizhuyan.javawebproject 16 | jiajiale-web 17 | 1.0.0 18 | 19 | 20 | 21 | 1.8 22 | 23 | 24 | 25 | 26 | com.yizhuoyan 27 | common-util 28 | 1.0.0 29 | 30 | 31 | 32 | org.mybatis.spring.boot 33 | mybatis-spring-boot-starter 34 | 2.0.1 35 | 36 | 37 | 38 | com.github.pagehelper 39 | pagehelper-spring-boot-starter 40 | 1.2.3 41 | 42 | 43 | 44 | org.springframework.boot 45 | spring-boot-starter-cache 46 | 47 | 48 | 49 | org.springframework.boot 50 | spring-boot-starter-web 51 | 52 | 53 | 54 | 55 | 56 | org.springframework.boot 57 | spring-boot-devtools 58 | true 59 | runtime 60 | 61 | 62 | mysql 63 | mysql-connector-java 64 | runtime 65 | 66 | 67 | org.springframework.boot 68 | spring-boot-configuration-processor 69 | true 70 | 71 | 72 | 73 | org.projectlombok 74 | lombok 75 | true 76 | 77 | 78 | 79 | org.springframework.boot 80 | spring-boot-starter-test 81 | test 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | org.apache.maven.plugins 90 | maven-clean-plugin 91 | 3.0.0 92 | 93 | 94 | org.springframework.boot 95 | spring-boot-maven-plugin 96 | 97 | 98 | 99 | 100 | 101 | 102 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/mapper/EmpClerkDaoMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | insert into Emp_clerk(id, real_name, sex, emp_no, work_mobile, work_email, birthday) 18 | values (#{id}, #{realName}, #{sex}, #{empNo}, #{workMobile}, #{workEmail}, #{birthday}) 19 | 20 | 21 | 22 | delete from Emp_clerk 23 | where id = #{param1} 24 | 25 | 26 | 27 | update Emp_clerk 28 | 29 | 30 | real_name = #{param2.realName}, 31 | 32 | 33 | sex = #{param2.sex}, 34 | 35 | 36 | emp_no = #{param2.empNo}, 37 | 38 | 39 | work_mobile = #{param2.workMobile}, 40 | 41 | 42 | work_email = #{param2.workEmail}, 43 | 44 | 45 | birthday = #{param2.birthday}, 46 | 47 | 48 | where id = #{param1} 49 | 50 | 51 | 56 | 57 | 58 | 64 | 72 | 73 | 78 | 79 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/mapper/VipDetailDaoMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | insert into vip_detail( 8 | id,account,mobile,name,sex,birthday, 9 | qq,email,address,zip_code,rank_id, 10 | total_discount_money,total_consume_money, 11 | remark,create_user_id,last_consume_time,create_time 12 | )values( 13 | #{id},#{account},#{mobile},#{name},#{sex},#{birthday}, 14 | #{qq},#{email},#{address},#{zipCode},#{rankId}, 15 | #{totalDiscountMoney},#{totalConsumeMoney}, 16 | #{remark},#{createUserId},#{lastConsumeTime},#{createTime} 17 | ) 18 | 19 | 20 | 21 | 22 | 23 | update vip_detail 24 | 25 | mobile=#{e.mobile}, 26 | name=#{e.name}, 27 | sex=#{e.sex}, 28 | birth_day=#{e.birthDay}, 29 | qq=#{e.qq}, 30 | email=#{e.email}, 31 | address=#{e.address}, 32 | zip_code=#{e.zipCode}, 33 | rank_id=#{e.rank.id}, 34 | total_discount_money=#{e.totalDiscountMoney}, 35 | total_comsume_money=#{e.totalConsumeMoney}, 36 | remark=#{e.remark}, 37 | last_consume_time=#{e.lastConsumeTime}, 38 | 39 | where id=#{id} 40 | 41 | 42 | 43 | delete from vip_detail where id=#{id} 44 | 45 | 46 | 50 | 51 | 55 | 56 | 60 | 61 | 74 | 75 | 81 | 82 | 83 | 84 | 85 | 86 | 90 | 91 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /jiajiale-web/src/test/java/tool/yizhuoyan/SQLUtil.java: -------------------------------------------------------------------------------- 1 | package tool.yizhuoyan; 2 | 3 | import com.vip.entity.SysAccountEntity; 4 | 5 | import java.lang.reflect.Method; 6 | import java.time.Instant; 7 | import java.time.LocalDate; 8 | import java.util.Date; 9 | import java.util.HashMap; 10 | import java.util.Map; 11 | 12 | public class SQLUtil { 13 | 14 | 15 | public static void main(String[] args) throws Exception { 16 | Class type= SysAccountEntity.class; 17 | String sql = generateInsertSql(type); 18 | System.out.println(sql); 19 | } 20 | 21 | 22 | private static final Map, String> TYPE_MAPPING = new HashMap<>(); 23 | static { 24 | TYPE_MAPPING.put(String.class, "varchar(32)"); 25 | TYPE_MAPPING.put(int.class, "int(4)"); 26 | TYPE_MAPPING.put(Integer.class, "int(4)"); 27 | TYPE_MAPPING.put(long.class, "int(8)"); 28 | TYPE_MAPPING.put(Long.class, "int(8)"); 29 | TYPE_MAPPING.put(float.class, "decimal(4,2)"); 30 | TYPE_MAPPING.put(double.class, "decimal(4,2)"); 31 | TYPE_MAPPING.put(Date.class, "datetime"); 32 | TYPE_MAPPING.put(Instant.class, "datetime"); 33 | TYPE_MAPPING.put(LocalDate.class, "date"); 34 | TYPE_MAPPING.put(boolean.class, "bit(1)"); 35 | } 36 | 37 | private static Map getGetterMethod(Class type)throws Exception{ 38 | Method[] methods = type.getMethods(); 39 | Map getterMap = new HashMap<>(); 40 | for (Method method : methods) { 41 | String methodName = method.getName(); 42 | if ((methodName.startsWith("get") || methodName.startsWith("is")) && method.getParameterCount() == 0 43 | && method.getDeclaringClass() == type) { 44 | getterMap.put(clearSetterMethodName(methodName), method); 45 | } 46 | } 47 | return getterMap; 48 | } 49 | public static String generateCreateSQL(Class type) throws Exception { 50 | StringBuilder sql = new StringBuilder(); 51 | sql.append("create table ").append(type.getSimpleName()).append("(\n"); 52 | 53 | Map getterMap=getGetterMethod(type); 54 | 55 | for (Map.Entry entry : getterMap.entrySet()) { 56 | String name = entry.getKey(); 57 | Method method = entry.getValue(); 58 | 59 | Class fieldType = method.getReturnType(); 60 | String columnType = TYPE_MAPPING.get(fieldType); 61 | if (columnType == null) { 62 | columnType = "char(32)"; 63 | name = name + "_id"; 64 | } 65 | sql.append(name).append(" ").append(columnType).append(",\n"); 66 | } 67 | sql.delete(sql.length() - 2, sql.length() - 1); 68 | sql.append(")"); 69 | 70 | return sql.toString(); 71 | } 72 | 73 | private static String clearSetterMethodName(String getterName) { 74 | if (getterName.startsWith("is")) { 75 | char[] cs = getterName.toCharArray(); 76 | cs[2] += 32; 77 | return new String(cs, 2, cs.length - 2); 78 | } 79 | char[] cs = getterName.toCharArray(); 80 | cs[3] += 32; 81 | return new String(cs, 3, cs.length - 3); 82 | } 83 | 84 | public static String generateInsertSql(Class type) throws Exception{ 85 | StringBuilder sql = new StringBuilder(); 86 | sql.append("insert into ") 87 | .append(type.getSimpleName()).append("("); 88 | 89 | Map getterMap=getGetterMethod(type); 90 | 91 | for (Map.Entry entry : getterMap.entrySet()) { 92 | String name = entry.getKey(); 93 | Method method = entry.getValue(); 94 | sql.append(name).append(","); 95 | } 96 | sql.deleteCharAt(sql.length() - 1); 97 | sql.append(")\nvalues("); 98 | for(int i=getterMap.size();i-->1;) { 99 | sql.append("?,"); 100 | } 101 | sql.append("?)"); 102 | 103 | return sql.toString(); 104 | } 105 | 106 | 107 | } 108 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/public/manager/index/view.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 主页 6 | 7 | 8 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 87 | 88 | 117 | 118 | 119 | -------------------------------------------------------------------------------- /common-util/src/main/java/com/yizhuoyan/common/StringUtil.java: -------------------------------------------------------------------------------- 1 | package com.yizhuoyan.common; 2 | 3 | import java.time.LocalDate; 4 | import java.time.format.DateTimeFormatter; 5 | import java.util.UUID; 6 | 7 | public interface StringUtil { 8 | /** 9 | * 前缀填充 10 | * 11 | * @param value 需填充值 12 | * @param fillLength 最后长度 13 | * @param fillchar 填充字符 14 | * @return 15 | */ 16 | public default String prefixFill(Object value, int fillLength, char fillchar) { 17 | String orignString = String.valueOf(value); 18 | if (orignString.length() >= fillLength) { 19 | return orignString.substring(0, fillLength); 20 | } 21 | char[] resultChars = new char[fillLength]; 22 | for (int i = resultChars.length; i-- > 0; resultChars[i] = fillchar) 23 | ; 24 | for (int i = orignString.length(); i-- > 0; resultChars[i] = orignString.charAt(i)) 25 | ; 26 | return new String(resultChars); 27 | } 28 | 29 | public default boolean isBlank(String s) { 30 | return s == null || s.trim().length() == 0; 31 | } 32 | 33 | public default String uuid() { 34 | String uuid = UUID.randomUUID().toString(); 35 | char[] cs = new char[32]; 36 | char c; 37 | for (int i = uuid.length(), j = 0; i-- > 0;) { 38 | if ((c = uuid.charAt(i)) != '-') { 39 | cs[j++] = c; 40 | } 41 | } 42 | return new String(cs); 43 | } 44 | public static void main(String[] args) { 45 | String uuid = UUID.randomUUID().toString(); 46 | char[] cs = new char[32]; 47 | char c; 48 | for (int i = uuid.length(), j = 0; i-- > 0;) { 49 | if ((c = uuid.charAt(i)) != '-') { 50 | cs[j++] = c; 51 | } 52 | } 53 | System.out.println(new String(cs)); 54 | } 55 | 56 | /** 57 | * 清理字符串前后空格,如果字符串为空白字符串,则返回null 58 | * 59 | * @param s 60 | * @return 61 | */ 62 | public default String trim(String s) { 63 | if (s != null) { 64 | if ((s = s.trim()).length() == 0) 65 | return null; 66 | else 67 | return s; 68 | } 69 | return null; 70 | } 71 | 72 | /** 73 | * 解析字符串为整数 74 | * 75 | * @param s 76 | * @param defaultInt 77 | * @return 78 | */ 79 | public default Integer parseInt(String s, Integer defaultInt) { 80 | try { 81 | if (s == null) 82 | return defaultInt; 83 | return Integer.parseInt(s); 84 | } catch (Exception e) { 85 | return defaultInt; 86 | } 87 | } 88 | 89 | public default Integer parseInt(String s) { 90 | return parseInt(s,null); 91 | } 92 | 93 | public default String escapeForSqlLike(String s) { 94 | StringBuilder sb = new StringBuilder(); 95 | char c = 0; 96 | for (int i = 0; i < s.length(); i++) { 97 | switch ((c = s.charAt(i))) { 98 | case '%': 99 | sb.append("\\%"); 100 | break; 101 | case '_': 102 | sb.append("\\_"); 103 | break; 104 | case '\\': 105 | sb.append("\\\\"); 106 | break; 107 | default: 108 | sb.append(c); 109 | break; 110 | } 111 | } 112 | return sb.toString(); 113 | } 114 | 115 | /** 116 | * 解析字符串为日期对象,如果失败,则抛出异常 117 | * 118 | * @param s 要解析的字符创 119 | * @param pattern 要使用的模式(yyyy-mm-dd) 120 | * @return 121 | */ 122 | default LocalDate parseLocalDate(String s, String pattern) { 123 | if ((s = trim(s)) == null) { 124 | return null; 125 | } 126 | DateTimeFormatter dtf = DateTimeFormatter.ofPattern(pattern); 127 | return dtf.parse(s, LocalDate::from); 128 | } 129 | 130 | default LocalDate parseLocalDate(String s, String pattern, LocalDate defaultDate) { 131 | if ((s = trim(s)) == null) { 132 | return null; 133 | } 134 | try { 135 | DateTimeFormatter dtf = DateTimeFormatter.ofPattern(pattern); 136 | return dtf.parse(s, LocalDate::from); 137 | } catch (Exception e) { 138 | return defaultDate; 139 | } 140 | } 141 | } 142 | -------------------------------------------------------------------------------- /jiajiale-web/src/test/java/tool/yizhuoyan/GenereteResultSet2EntityMethodBody.java: -------------------------------------------------------------------------------- 1 | package tool.yizhuoyan; 2 | 3 | import com.vip.entity.SysAccountEntity; 4 | 5 | import java.lang.reflect.Method; 6 | import java.util.HashMap; 7 | import java.util.Map; 8 | 9 | public class GenereteResultSet2EntityMethodBody { 10 | 11 | 12 | public static void main(String[] args) { 13 | run(SysAccountEntity.class); 14 | } 15 | 16 | 17 | private static final Map typeMappingMAP=new HashMap(){{ 18 | put(java.util.Date.class, java.sql.Timestamp.class); 19 | put(java.time.Instant.class, java.sql.Timestamp.class); 20 | put(java.time.LocalTime.class, java.sql.Time.class); 21 | put(java.time.LocalDate.class, java.sql.Date.class); 22 | put(java.time.LocalDateTime.class, java.sql.Timestamp.class); 23 | }}; 24 | 25 | public static void run(Class type) { 26 | String className=type.getSimpleName(); 27 | StringBuilder result=new StringBuilder(); 28 | result.append(className).append(" e = new ").append(className).append("();\n"); 29 | Method[] methods = type.getMethods(); 30 | String methodName=null; 31 | for (Method method : methods) { 32 | methodName=method.getName(); 33 | if((methodName.startsWith("set")&& 34 | method.getParameterCount()==1)) { 35 | generateSetStatement(result, method); 36 | } 37 | } 38 | result.append("return e;"); 39 | System.out.println(result); 40 | } 41 | private static void generateSetStatement(StringBuilder result,Method m) { 42 | Class type=m.getParameterTypes()[0]; 43 | String methodName=m.getName(); 44 | String fieldName=lowerFirstChar(methodName.substring(3)); 45 | String columnName=toColumnName(fieldName); 46 | String conventer=null; 47 | String typeName="Object"; 48 | if(type==String.class) { 49 | typeName="String"; 50 | }else if(type==int.class||type==Integer.class) { 51 | typeName="Int"; 52 | }else if(type==boolean.class||type==Boolean.class) { 53 | typeName="Boolean"; 54 | }else if(type==long.class||type==Long.class) { 55 | typeName="Long"; 56 | }else if(type==float.class||type==Float.class) { 57 | typeName="Float"; 58 | }else if(type==double.class||type==Double.class) { 59 | typeName="Double"; 60 | }else if(type==java.util.Date.class) { 61 | typeName="Timestamp"; 62 | }else if(type==java.time.Instant.class) { 63 | typeName="Timestamp"; 64 | conventer="toInstant"; 65 | }else if(type==java.time.LocalDate.class) { 66 | typeName="Date"; 67 | conventer="toLocalDate"; 68 | }else if(type==java.time.LocalTime.class) { 69 | typeName="Time"; 70 | conventer="toLocalTime"; 71 | }else if(type==java.time.LocalDateTime.class) { 72 | typeName="Timestamp"; 73 | conventer="toLocalDateTime"; 74 | }else { 75 | //do noting 76 | return; 77 | } 78 | result.append("e.").append(methodName); 79 | result.append("("); 80 | if(conventer!=null) { 81 | result.append(conventer).append("("); 82 | } 83 | result.append("rs.get").append(typeName); 84 | result.append("(\""); 85 | result.append(columnName); 86 | result.append("\")"); 87 | if(conventer!=null) { 88 | result.append(")"); 89 | } 90 | result.append(");\n"); 91 | } 92 | 93 | static private String lowerFirstChar(String s) { 94 | char[] cs=s.toCharArray(); 95 | cs[0]=Character.toLowerCase(cs[0]); 96 | return new String(cs); 97 | } 98 | static private String toColumnName(String fieldName) { 99 | StringBuilder result=new StringBuilder(); 100 | for(int i=0;i 2 | 3 | 4 | 5 | VIP消费记录查询 6 | 7 | 8 | 9 | 10 | 16 |
17 |
18 |

19 | 28 | 29 |

30 |
31 |
32 |
33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 67 | 68 | 69 | 70 | 71 |
序号操作客户(手机号)关联订单消费金额消费时间创建人
请输入手机号进行查询
{{resp.message}}
很抱歉,未找到相关数据
72 | 73 |

74 | {{resp.data.totalRows}}条记录 每页{{resp.data.pageSize}}条 75 | 共{{resp.data.totalPages}}页 76 | 77 | 78 | {{resp.data.pageNo}} 79 | 80 | 81 |

82 | 83 |
84 |
85 | 86 | 87 | 88 | 89 | 141 | 142 | 143 | -------------------------------------------------------------------------------- /common-util/src/main/java/com/yizhuoyan/common/ArrayListMap.java: -------------------------------------------------------------------------------- 1 | package com.yizhuoyan.common; 2 | 3 | import java.util.*; 4 | import java.util.stream.Collectors; 5 | 6 | /** 7 | * 内部使用ArrayList实现的Map 8 | * 特征: 9 | * - 只读map,不支持删除 10 | * - 不支持修改,即不去重,重复调用put,会放入多个键值对 11 | * - 仅用于快速迭代 12 | * - 不支持null键,支持null值 13 | */ 14 | public class ArrayListMap implements Map { 15 | private final ArrayList entryList; 16 | 17 | private ArrayListMap(int capacity) { 18 | this.entryList=new ArrayList<>(capacity); 19 | } 20 | 21 | @Override 22 | public int size() { 23 | return this.entryList.size(); 24 | } 25 | 26 | @Override 27 | public boolean isEmpty() { 28 | return this.entryList.isEmpty(); 29 | } 30 | 31 | @Override 32 | public boolean containsKey(Object key) { 33 | if(key==null)return false; 34 | for(KeyValueEntry entry:entryList){ 35 | if(entry.key.equals(key)){ 36 | return true; 37 | } 38 | } 39 | return false; 40 | } 41 | 42 | @Override 43 | public boolean containsValue(Object value) { 44 | for(KeyValueEntry entry:entryList){ 45 | if(value==null?entry.value==null:value.equals(entry.value)){ 46 | return true; 47 | } 48 | } 49 | return false; 50 | } 51 | 52 | /** 53 | * 通过key获取值,如果有重复key,则返回找到的第一个 54 | * @param key 55 | * @return 56 | */ 57 | @Override 58 | public Object get(Object key) { 59 | if(key==null)throw new NullPointerException(); 60 | for(KeyValueEntry entry:entryList){ 61 | if(entry.key.equals(key)){ 62 | return entry.value; 63 | } 64 | } 65 | return null; 66 | } 67 | 68 | @Override 69 | public Object put(String key, Object value) { 70 | if(key==null)throw new NullPointerException(); 71 | entryList.add(new KeyValueEntry(key,value)); 72 | return null; 73 | } 74 | 75 | @Override 76 | public Object remove(Object key) { 77 | throw new UnsupportedOperationException(); 78 | } 79 | 80 | @Override 81 | public void putAll(Map m) { 82 | for(Map.Entry entry:m.entrySet()){ 83 | this.put(entry.getKey(),entry.getValue()); 84 | } 85 | } 86 | 87 | @Override 88 | public void clear() { 89 | this.entryList.clear(); 90 | } 91 | 92 | @Override 93 | public Set keySet() { 94 | ArrayListSet keyset=new ArrayListSet<>(this.size()); 95 | for(KeyValueEntry entry:entryList){ 96 | keyset.add(entry.key); 97 | } 98 | return keyset; 99 | } 100 | 101 | @Override 102 | public Collection values() { 103 | return entryList.stream().map(e->e.value) 104 | .collect(Collectors.toList()); 105 | } 106 | 107 | @Override 108 | public Set> entrySet() { 109 | return new ArrayListSet(this.entryList); 110 | } 111 | 112 | private static class KeyValueEntry implements Map.Entry{ 113 | private final String key; 114 | private Object value; 115 | 116 | public KeyValueEntry(String key, Object value) { 117 | this.key = key; 118 | this.value = value; 119 | } 120 | 121 | @Override 122 | public String getKey() { 123 | return this.key; 124 | } 125 | @Override 126 | public Object getValue() { 127 | return this.value; 128 | } 129 | 130 | @Override 131 | public Object setValue(Object value) { 132 | Object oldValue=this.value; 133 | this.value=value; 134 | return oldValue; 135 | } 136 | } 137 | } 138 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/java/com/vip/web/controller/userhome/AvatarController.java: -------------------------------------------------------------------------------- 1 | package com.vip.web.controller.userhome; 2 | 3 | import ch.qos.logback.core.net.SyslogOutputStream; 4 | import com.vip.ao.AvatarAo; 5 | import com.vip.dto.AccountContext; 6 | import com.vip.dto.AvatarDto; 7 | import com.vip.dto.JSONResponse; 8 | import com.vip.service.UserAccountService; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.beans.factory.annotation.Value; 11 | import org.springframework.stereotype.Controller; 12 | import org.springframework.web.bind.annotation.*; 13 | 14 | import javax.servlet.ServletOutputStream; 15 | import javax.servlet.http.HttpServletRequest; 16 | import javax.servlet.http.HttpServletResponse; 17 | import javax.servlet.http.HttpSession; 18 | import javax.servlet.http.Part; 19 | import java.io.File; 20 | import java.io.FileInputStream; 21 | import java.io.FileOutputStream; 22 | import java.io.InputStream; 23 | import java.nio.file.Files; 24 | import java.nio.file.Path; 25 | import java.nio.file.Paths; 26 | import java.util.Base64; 27 | 28 | @RestController 29 | public class AvatarController { 30 | @Value("${account.avatar.saveDir}") 31 | private String avatarSaveDir; 32 | @Autowired 33 | UserAccountService accountService; 34 | 35 | @GetMapping("/api/avatar") 36 | public void show(HttpSession session, HttpServletResponse resp)throws Exception{ 37 | AccountContext ac= (AccountContext) session.getAttribute(AccountContext.class.getName()); 38 | String id=ac.getId(); 39 | AvatarDto avatarDto=accountService.loadAvatar(id); 40 | //是否存放在本地服务器 41 | if(avatarDto.isLocalSave()){ 42 | //用户头像存放路径 43 | resp.setContentType(avatarDto.getContentType()); 44 | File avatar=new File(avatarDto.getSaveLocation()); 45 | 46 | try(FileInputStream in=new FileInputStream(avatar); 47 | ServletOutputStream out=resp.getOutputStream(); 48 | ){ 49 | byte[] bytes=new byte[1024]; 50 | int readLength=0; 51 | while((readLength=in.read(bytes))!=-1){ 52 | out.write(bytes,0,readLength); 53 | } 54 | } 55 | }else{ 56 | //存放在其他服务器,直接重定向 57 | resp.sendRedirect(avatarDto.getSaveLocation()); 58 | } 59 | } 60 | 61 | 62 | @PostMapping("/api/avatar") 63 | public JSONResponse upload(@RequestParam("avatar") Part avatarPart 64 | , HttpSession session)throws Exception{ 65 | //获取当前登录用户 66 | AccountContext ac= (AccountContext) session.getAttribute(AccountContext.class.getName()); 67 | //获取头像文件类型 68 | String avatarContentType=avatarPart.getContentType(); 69 | 70 | //把帐号id为文件名 71 | String saveLocation=avatarSaveDir; 72 | if(saveLocation.endsWith("/")||saveLocation.endsWith("\\")){ 73 | saveLocation+=ac.getId(); 74 | }else{ 75 | saveLocation+="/"+ac.getId(); 76 | } 77 | //保存文件(如果文件存在,则覆盖) 78 | avatarPart.write(saveLocation); 79 | //更新帐号 80 | AvatarAo ao=new AvatarAo(); 81 | ao.setContentType(avatarContentType); 82 | ao.setSaveLocation(saveLocation); 83 | ao.setTotalBytes(avatarPart.getSize()); 84 | ao.setLocalSave(true); 85 | accountService.changeAvatar(ac.getId(),ao); 86 | return JSONResponse.ok(); 87 | } 88 | 89 | 90 | @PutMapping(path = "/api/account/avatar") 91 | public JSONResponse setRecommendAvatar(String avatar 92 | , HttpSession session)throws Exception{ 93 | //获取当前登录用户 94 | AccountContext ac= (AccountContext) session.getAttribute(AccountContext.class.getName()); 95 | //更新帐号 96 | AvatarAo ao=new AvatarAo(); 97 | ao.setContentType("image/jpeg"); 98 | ao.setSaveLocation(avatar); 99 | ao.setTotalBytes(0); 100 | ao.setLocalSave(false); 101 | accountService.changeAvatar(ac.getId(),ao); 102 | return JSONResponse.ok(); 103 | } 104 | 105 | 106 | } 107 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/mapper/SysAccountDaoMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | insert into sys_account(account, name, password, avatar, time_create, time_last_alter_password, time_last_login, remark, last_login_agent, last_login_ip, role, status) 23 | values (#{account}, #{name}, #{password}, #{avatar}, #{timeCreate}, #{timeLastAlterPassword}, #{timeLastLogin}, #{remark}, #{lastLoginAgent}, #{lastLoginIp}, #{role}, #{status}) 24 | 25 | 26 | 27 | delete from sys_account 28 | where id = #{id} 29 | 30 | 31 | 32 | update sys_account 33 | 34 | 35 | account = #{e.account}, 36 | 37 | 38 | name = #{e.name}, 39 | 40 | 41 | password = #{e.password}, 42 | 43 | 44 | avatar = #{e.avatar}, 45 | 46 | 47 | time_create = #{e.timeCreate}, 48 | 49 | 50 | time_last_alter_password = #{e.timeLastAlterPassword}, 51 | 52 | 53 | time_last_login = #{e.timeLastLogin}, 54 | 55 | 56 | remark = #{e.remark}, 57 | 58 | 59 | last_login_agent = #{e.lastLoginAgent}, 60 | 61 | 62 | last_login_ip = #{e.lastLoginIp}, 63 | 64 | 65 | role = #{e.role}, 66 | 67 | 68 | status = #{e.status}, 69 | 70 | 71 | where id = #{id} 72 | 73 | 74 | 79 | 80 | 85 | 86 | 91 | 92 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/public/clerk/add-vip/view.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 新增VIP客户 6 | 7 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 |
20 |

21 | 22 | 23 |

24 |

25 | 26 | 27 |

28 |

29 | 30 | 32 |

33 |
34 |
35 | 36 |

37 | 38 | 39 | 42 | 45 | 46 |

47 |

48 | 49 | 50 |

51 |

52 | 53 | 54 |

55 |
56 |
57 |

58 | 59 | 60 |

61 |

62 | 63 | 64 |

65 |
66 |

67 | 68 | 69 |

70 |

71 | 72 | 73 |

74 |
75 |
76 | 77 | 78 | 128 | 129 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/public/login-log/view.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 登录日志 6 | 7 | 8 | 9 |
10 | 15 | 16 | 导出 17 | 18 |
19 |
20 |
21 |

22 | 23 | 24 | 25 | ~ 26 | 27 | 28 |

29 | 30 |
31 |
32 |
33 |
34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 66 | 67 | 68 | 69 | 70 |
序号登录时间登录IP登录设备下线时间在线时长
加载中...
{{resp.message}}
很抱歉,未找到相关数据
71 | 72 |

73 | 74 | 共{{resp.data.totalRows}}条记录 75 | 每页{{resp.data.pageSize}}条 76 | 共{{resp.data.totalPages}}页 77 | 78 | 79 | 80 | {{resp.data.pageNo}} 81 | 82 | 83 |

84 |
85 |
86 | 87 | 88 | 89 | 136 | 137 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/public/clerk/mine/account.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 欢迎页 6 | 8 | 17 | 18 | 19 |
20 | 25 |
26 |
27 |

28 | 29 | 34 | 系统登录帐号,不可修改 35 |

36 |

37 | 38 | 43 | 44 | 45 |

46 | 47 |
48 |

49 | 50 | 56 |

57 |

58 | 59 | 65 |

66 | 67 | 68 |
69 | 70 |
71 |

72 | 73 | 79 |

80 |

81 | 82 | 88 |

89 |
90 |

91 | 92 | 98 |

99 |
100 |
101 |
102 | 103 | 104 | 105 | 134 | 135 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/public/manager/vip-manage/add/view.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 录入VIP客户 6 | 7 | 12 | 13 | 14 | 21 | 22 | 23 | 返回 24 | 25 |
26 |
27 |
28 |

29 | 30 | 31 |

32 | 33 |

34 | 35 | 37 |

38 |
39 |
40 |

41 | 42 | 43 |

44 |

45 | 46 | 47 | 50 | 53 | 54 |

55 |
56 |
57 |

58 | 59 | 60 |

61 |

62 | 63 | 64 |

65 |
66 |
67 |

68 | 69 | 70 |

71 |

72 | 73 | 74 |

75 |
76 |

77 | 78 | 79 |

80 |

81 | 82 | 83 |

84 |
85 |
86 | 87 | 88 | 138 | 139 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/java/com/vip/service/impl/VipConsumeManageServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.vip.service.impl; 2 | 3 | import java.time.LocalDateTime; 4 | import java.util.List; 5 | 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | import org.springframework.transaction.annotation.Transactional; 9 | 10 | import com.github.pagehelper.PageHelper; 11 | import com.github.pagehelper.PageInfo; 12 | import com.vip.ao.VipConsumeAo; 13 | import com.vip.dao.VipConsumeDao; 14 | import com.vip.dao.VipDetailDao; 15 | import com.vip.dto.QueryResult; 16 | import com.vip.entity.VipConsumeEntity; 17 | import com.vip.entity.VipDetailEntity; 18 | import com.vip.entity.VipRankEntity; 19 | import com.vip.service.CommonService; 20 | import com.vip.service.VipConsumeManageService; 21 | import com.yizhuoyan.common.BeanMap; 22 | 23 | import lombok.NonNull; 24 | 25 | @Service 26 | public class VipConsumeManageServiceImpl implements VipConsumeManageService, CommonService { 27 | @Autowired 28 | VipConsumeDao vcdao; 29 | @Autowired 30 | VipDetailDao vdao; 31 | 32 | @Override 33 | @Transactional 34 | public void addVipConsume(@NonNull VipConsumeAo ao) throws Exception { 35 | // 1验证参数 36 | 37 | String vipMobile = $("会员手机号", ao.getVipMobile()); 38 | String consumeMoney = $("消费金额", ao.getConsumeMoney()); 39 | double consumeMoneyInt = assertDouble("消费金额", consumeMoney); 40 | assertGreatThan("消费金额", consumeMoneyInt, 0); 41 | String orderId = $("关联订单", ao.getOrderId()); 42 | String remark = trim(ao.getRemark()); 43 | 44 | // 2业务逻辑 45 | // 2.1 查找会员 46 | VipDetailEntity vip = vdao.select("mobile", vipMobile); 47 | assertNotNull("会员手机号不存在[%s]", vip, vipMobile); 48 | 49 | // 2.2 查找会员等级 50 | VipRankEntity rank = vip.getRank(); 51 | // 2.3 获取折扣 52 | int enjoyDiscount = rank.getEnjoyDiscount(); 53 | 54 | VipConsumeEntity e = new VipConsumeEntity(); 55 | e.setId(uuid()); 56 | e.setVipId(vip.getId()); 57 | // 单位为分 58 | e.setConsumeMoney((int) (consumeMoneyInt * 100)); 59 | e.setEnjoyDiscount(enjoyDiscount); 60 | e.setDiscountMoney((int) (e.getConsumeMoney() * (enjoyDiscount / 100.0))); 61 | e.setActualPayMoney(e.getConsumeMoney() - e.getDiscountMoney()); 62 | 63 | e.setConsumeTime(LocalDateTime.now()); 64 | e.setOrderId(orderId); 65 | // TODO 创建人id 66 | String createUserId = "00000000000000000000000000000000"; 67 | e.setCreateUserId(createUserId); 68 | e.setStatus(VipConsumeEntity.STATUS_NORMAL); 69 | e.setRemark(remark); 70 | 71 | vcdao.insert(e); 72 | } 73 | 74 | @Override 75 | public QueryResult queryVipConsumeByMobile(String mobile, int pageNo, int pageSize) 76 | throws Exception { 77 | // 1 验证参数 78 | mobile = $("客户手机号", mobile); 79 | if (pageNo <= 0) { 80 | pageNo = 1; 81 | } 82 | if (pageSize <= 0) { 83 | pageSize = 5; 84 | } 85 | // 2 业务逻辑 86 | // 2.2 执行业务逻辑 87 | 88 | VipDetailEntity vip = vdao.select("mobile", mobile); 89 | assertNotNull("客户不存在[%s]", vip, mobile); 90 | // 查询消费记录 91 | PageHelper.startPage(pageNo, pageSize); 92 | List list = vcdao.selectByVipId(vip.getId()); 93 | PageInfo page = new PageInfo<>(list); 94 | // 3 组装结果 95 | QueryResult result = new QueryResult(); 96 | result.setPageNo(pageNo); 97 | result.setRows(page.getList()); 98 | result.setTotalRows(page.getTotal()); 99 | result.setPageSize(pageSize); 100 | return result; 101 | // 3 102 | } 103 | 104 | @Override 105 | public VipConsumeEntity checkVipConsume(String id) throws Exception { 106 | // 1 验证参数 107 | id = $("id", id); 108 | // 2 业务逻辑 109 | // 2.2 执行业务逻辑 110 | VipConsumeEntity vip = vcdao.select("id", id); 111 | return vip; 112 | } 113 | 114 | @Override 115 | public QueryResult queryVipConsumeByKey(String key, int pageNo, int pageSize) throws Exception { 116 | // 1 验证参数(参数清理) 117 | key = trim(key); 118 | if (key != null) { 119 | key = escapeForSqlLike(key); 120 | key = "%" + key + "%"; 121 | } 122 | if (pageNo <= 0) { 123 | pageNo = 1; 124 | } 125 | if (pageSize <= 0) { 126 | pageSize = 5; 127 | } 128 | // 2 执行业务逻辑 129 | PageHelper.startPage(pageNo, pageSize); 130 | 131 | PageInfo page = new PageInfo<>(vcdao.selectByKey(key)); 132 | // 3 组装结果 133 | QueryResult result = new QueryResult(); 134 | result.setPageNo(pageNo); 135 | result.setRows(page.getList()); 136 | result.setTotalRows(page.getTotal()); 137 | result.setPageSize(pageSize); 138 | return result; 139 | 140 | } 141 | 142 | @Override 143 | @Transactional 144 | public void deleteVipConsume(String id) throws Exception { 145 | vcdao.update(id, BeanMap.of("status", VipConsumeEntity.STATUS_DELETED)); 146 | } 147 | 148 | } 149 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/java/com/vip/service/impl/VipManageServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.vip.service.impl; 2 | 3 | import java.time.LocalDate; 4 | import java.time.LocalDateTime; 5 | import java.util.Set; 6 | 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.context.MessageSource; 9 | import org.springframework.context.support.MessageSourceResourceBundle; 10 | import org.springframework.stereotype.Service; 11 | import org.springframework.transaction.annotation.Transactional; 12 | 13 | import com.github.pagehelper.PageHelper; 14 | import com.github.pagehelper.PageInfo; 15 | import com.vip.ao.VipAo; 16 | import com.vip.dao.VipDetailDao; 17 | import com.vip.dao.VipRankDao; 18 | import com.vip.dto.AccountContext; 19 | import com.vip.dto.QueryResult; 20 | import com.vip.entity.VipDetailEntity; 21 | import com.vip.exception.VipException; 22 | import com.vip.service.VipManageService; 23 | 24 | import lombok.NonNull; 25 | 26 | import javax.validation.ConstraintViolation; 27 | import javax.validation.Validator; 28 | 29 | @Service 30 | @Transactional 31 | public class VipManageServiceImpl implements VipManageService { 32 | @Autowired 33 | VipDetailDao vdao; 34 | @Autowired 35 | VipRankDao rdao; 36 | 37 | @Override 38 | public void addVip(@NonNull VipAo ao) throws Exception { 39 | 40 | //1验证参数 41 | /**手机号,可作为会员凭证*/ 42 | String mobile=$("手机号",ao.getMobile()); 43 | //TODO 手机号需要验证 44 | /**账号名称(客户姓名)*/ 45 | String name=$("客户姓名",ao.getName()); 46 | /**等级*/ 47 | String rankId=$("客户等级",ao.getRankId()); 48 | /**性别*/ 49 | boolean sex="1".equals(ao.getSex()); 50 | 51 | /**生日(1990-01-01) 可选*/ 52 | String birthdayStr=trim(ao.getBirthday()); 53 | LocalDate birthday=null; 54 | if(birthdayStr!=null) { 55 | //验证满足格式 56 | birthday=parseLocalDate(birthdayStr, "yyyy-MM-dd"); 57 | } 58 | 59 | /**QQ可选*/ 60 | String qq=trim(ao.getQq()); 61 | 62 | /**邮箱(可选)*/ 63 | String email=trim(ao.getEmail()); 64 | 65 | /**地址(可选)*/ 66 | String address=trim(ao.getAddress()); 67 | 68 | /**邮编(可选)*/ 69 | String zipCode=trim(ao.getZipCode()); 70 | /**备注(可选)*/ 71 | String remark=trim(ao.getRemark()); 72 | 73 | //2业务逻辑 74 | //2.1 手机号作为账号,不能已存在 75 | if(vdao.exists("mobile", mobile)) { 76 | throw new VipException("mobile-exists","手机号已存在"); 77 | } 78 | //2.2 客户等级ID要有效 79 | if(!rdao.exists("id", rankId)) { 80 | throw new VipException("rankid-illegal","等级id无效"); 81 | } 82 | VipDetailEntity e=new VipDetailEntity(); 83 | e.setId(uuid()); 84 | e.setName(name); 85 | e.setTotalDiscountMoney(0); 86 | e.setTotalConsumeMoney(0); 87 | e.setLastConsumeTime(null); 88 | //账号使用手机号 89 | e.setMobile(mobile); 90 | e.setNo(mobile); 91 | e.setSex(sex); 92 | e.setBirthday(birthday); 93 | e.setQq(qq); 94 | e.setEmail(email); 95 | e.setAddress(address); 96 | e.setZipCode(zipCode); 97 | e.setRemark(remark); 98 | 99 | e.setRankId(parseInt(rankId)); 100 | e.setCreateUserId(AccountContext.currentAccountId()); 101 | e.setCreateTime(LocalDateTime.now()); 102 | vdao.insert(e); 103 | } 104 | 105 | @Override 106 | public VipDetailEntity queryVipByMobile(String mobile) throws Exception { 107 | //1 验证参数 108 | mobile=$("客户手机号",mobile); 109 | //2 业务逻辑 110 | //2.1 TODO:降低数据库压力,如果mobile符合手机号特征,则不进行数据库查找。 111 | //2.2 执行业务逻辑 112 | VipDetailEntity vip=vdao.select("mobile", mobile); 113 | return vip; 114 | } 115 | 116 | @Override 117 | public VipDetailEntity checkVipById(String id) throws Exception { 118 | //1 验证参数 119 | id=$("id",id); 120 | //2 业务逻辑 121 | //2.1 TODO:降低数据库压力,如果mobile符合手机号特征,则不进行数据库查找。 122 | //2.2 执行业务逻辑 123 | VipDetailEntity vip=vdao.select("id",id); 124 | if(vip==null){ 125 | throw new VipException("数据不存在"); 126 | } 127 | return vip; 128 | } 129 | 130 | @Override 131 | public QueryResult queryVipByKey(Integer rankId,String key, int pageNo, int pageSize) throws Exception { 132 | // 1 验证参数(参数清理) 133 | key = trim(key); 134 | if (key != null) { 135 | key = escapeForSqlLike(key); 136 | key="%"+key+"%"; 137 | } 138 | if (pageNo <= 0) { 139 | pageNo = 1; 140 | } 141 | if (pageSize <= 0) { 142 | pageSize = 5; 143 | } 144 | // 2 执行业务逻辑 145 | PageHelper.startPage(pageNo, pageSize); 146 | 147 | PageInfo page=new PageInfo<>(vdao.selectByRankIdAndKey(rankId,key)); 148 | // 3 组装结果 149 | QueryResult result=new QueryResult(); 150 | result.setPageNo(pageNo); 151 | result.setRows(page.getList()); 152 | result.setTotalRows(page.getTotal()); 153 | result.setPageSize(pageSize); 154 | return result; 155 | } 156 | 157 | @Override 158 | @Transactional 159 | public void modifyVip(String id, VipAo ao) throws Exception { 160 | System.out.println(ao); 161 | } 162 | 163 | } 164 | -------------------------------------------------------------------------------- /jiajiale-web/src/main/resources/static/js/yi.toast.js: -------------------------------------------------------------------------------- 1 | (function (window, document) { 2 | "use strict"; 3 | /** 4 | * how to : 5 | * 6 | * toast("message");//默认2000 7 | * toast("message",300); 8 | * 9 | */ 10 | 11 | var defautSetting = { 12 | timeout: 2000, 13 | fadeIn: 500, 14 | fadeOut: 1000, 15 | }; 16 | /** 17 | * 创建toastview 18 | */ 19 | var toastEL = (function (setting) { 20 | 21 | var divCss = { 22 | position: "fixed", 23 | zIndex: 2147483647, 24 | bottom: "150px", 25 | background: "#000", 26 | color: "#fff", 27 | border: "1px solid #000", 28 | fontSize: "14px", 29 | padding: "5px 1em", 30 | borderRadius: "5px", 31 | whiteSpace:"pre", 32 | boxShadow: "inset 0 1px 1px rgba(0, 0, 0, .075)", 33 | display:"none" 34 | }; 35 | var toastEL = document.createElement("div"); 36 | var k; 37 | for (k in divCss) { 38 | toastEL.style[k] = divCss[k]; 39 | } 40 | window.addEventListener("load", function () { 41 | window.document.body.appendChild(toastEL); 42 | }); 43 | return toastEL; 44 | })(defautSetting); 45 | 46 | 47 | //save all messages 48 | var messages = []; 49 | 50 | 51 | //显示消息 52 | var toastMessages = function () { 53 | if (messages.length === 0) { 54 | toastEL.show=false; 55 | toastEL.style.display="none"; 56 | return; 57 | } 58 | if(!toastEL.show){ 59 | toastEL.style.display="block"; 60 | toastEL.show=true; 61 | } 62 | 63 | var m = messages.shift(); 64 | toastEL.textContent = m.message; 65 | //计算宽度 66 | var left=(document.body.offsetWidth-toastEL.offsetWidth)/2; 67 | if(left>0){ 68 | toastEL.style.left=left+"px"; 69 | } 70 | fadeIn(toastEL, defautSetting.fadeIn, function () { 71 | setTimeout(function () { 72 | fadeOut(toastEL, defautSetting.fadeOut, function () { 73 | if (m.done) { 74 | try{ 75 | m.done.apply(window,m.message); 76 | }catch(e){ 77 | console.log(e); 78 | } 79 | } 80 | toastMessages(); 81 | }); 82 | },m.timeout); 83 | }); 84 | }; 85 | /** 86 | * 淡入 87 | * @param {Object} e 目标 88 | * @param {Object} t 时间 89 | * @param {Object} f 完成回调 90 | */ 91 | var fadeIn = function (e, t, f) { 92 | e.style.opacity = 0; 93 | e.opacity = 0; 94 | var timeout = 30;//1000/30; 95 | //每次递增 96 | var increase = (100 * timeout / t) ^ 0; 97 | function run() { 98 | var next = e.opacity + increase; 99 | if (next >= 100) { 100 | e.style.opacity = 1; 101 | delete e.opacity; 102 | f(); 103 | return; 104 | } 105 | e.opacity = next; 106 | e.style.opacity = next / 100; 107 | setTimeout(run, timeout); 108 | } 109 | 110 | run(timeout); 111 | }; 112 | /** 113 | * 淡入 114 | * @param {Object} e 目标 115 | * @param {Object} t 时间 116 | * @param {Object} f 完成回调 117 | */ 118 | var fadeOut = function (e, t, f) { 119 | e.style.opacity = 1; 120 | e.opacity = 100; 121 | var timeout = 30;//1000/30; 122 | //每次递增 123 | var increase = (100 * timeout / t) ^ 0; 124 | function run() { 125 | var next = e.opacity - increase; 126 | if (next <= 0) { 127 | e.style.opacity = 0; 128 | delete e.opacity; 129 | f(); 130 | return; 131 | } 132 | e.opacity = next; 133 | e.style.opacity = next / 100; 134 | setTimeout(run, timeout); 135 | } 136 | 137 | run(timeout); 138 | }; 139 | 140 | //expode 141 | window.toast = function () { 142 | var message, timeout=defautSetting.timeout, whenDone; 143 | for (var i = arguments.length, arg; i-- > 0;) { 144 | arg = arguments[i]; 145 | if (typeof arg === "function") { 146 | whenDone = arg; 147 | } else if (typeof arg === "number") { 148 | timeout = arg; 149 | }else{ 150 | message = arg; 151 | } 152 | } 153 | if(Array.isArray(message)){ 154 | message=message.join("
"); 155 | } 156 | if(message){ 157 | messages.push({message: message, timeout: timeout, done: whenDone}); 158 | toastMessages(); 159 | } 160 | }; 161 | 162 | })(window, document); 163 | 164 | 165 | 166 | 167 | 168 | 169 | --------------------------------------------------------------------------------