| | |
| | | package com.matrix.system.app.action; |
| | | |
| | | import com.matrix.component.redis.RedisClient; |
| | | import com.matrix.core.constance.MatrixConstance; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.tools.DateUtil; |
| | | import com.matrix.core.tools.WebUtil; |
| | | import com.matrix.system.app.dto.BeauticianDto; |
| | | import com.matrix.system.app.dto.UsersQueryDto; |
| | | import com.matrix.system.app.mapper.SysBeauticianStateMapper; |
| | | import com.matrix.system.app.mapper.SysUsersMapper; |
| | | import com.matrix.system.app.mapper.SysWorkBeatuistaffMapper; |
| | |
| | | import com.matrix.system.app.vo.UserAchieveVo; |
| | | import com.matrix.system.common.bean.SysUsers; |
| | | import com.matrix.system.common.service.SysUsersService; |
| | | import com.matrix.system.common.tools.DataAuthUtil; |
| | | import com.matrix.system.hive.bean.SysBeauticianState; |
| | | import com.matrix.system.hive.bean.SysWorkBeatuistaff; |
| | | import com.matrix.system.hive.service.AchieveNewService; |
| | |
| | | @Autowired |
| | | private SysWorkBeatuistaffService sysWorkBeatuistaffService; |
| | | |
| | | @Autowired |
| | | private RedisClient redisClient; |
| | | |
| | | |
| | | @ApiOperation(value = "个人中心--获取用户业绩接口 type 1-今日 2-昨天 3-本月 4-上月") |
| | | @ApiResponses({ |
| | |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS, SysWorkBeatuistaffMapper.INSTANCE.workBeautysToBeautyVos(workBeauty), 0); |
| | | } |
| | | |
| | | @ApiOperation(value = "退出登陆", notes = "退出登陆") |
| | | @GetMapping(value = "/loginOut") |
| | | public AjaxResult loginOut() { |
| | | SysUsers sysUsers = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); |
| | | String token = redisClient.getCachedValue(sysUsers.getSuId().toString()); |
| | | |
| | | redisClient.removeObject(token); |
| | | redisClient.removeObject(sysUsers.getSuId().toString()); |
| | | return AjaxResult.buildSuccessInstance("退出成功"); |
| | | } |
| | | |
| | | @ApiOperation(value = "员工列表", notes = "员工列表") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "ok", response = BeauticianVo.class) |
| | | }) |
| | | @PostMapping(value = "/findAllUsers") |
| | | public AjaxResult findAllUsers(@RequestBody UsersQueryDto usersQueryDto) { |
| | | SysUsers sysUsers = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); |
| | | |
| | | SysUsers query = new SysUsers(); |
| | | if (DataAuthUtil.hasAllShopAuth()) { |
| | | query.setCompanyId(sysUsers.getCompanyId()); |
| | | } else { |
| | | query.setCompanyId(sysUsers.getCompanyId()); |
| | | query.setShopId(sysUsers.getShopId()); |
| | | } |
| | | query.setSuName(usersQueryDto.getQueryKey()); |
| | | List<SysUsers> list = sysUsersService.findByModel(query); |
| | | List<BeauticianVo> dataList = SysUsersMapper.INSTANCE.usersListToBeautyList(list); |
| | | return AjaxResult.buildSuccessInstance(dataList); |
| | | } |
| | | |
| | | } |