| | |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.system.api.constant.AppErrorConstant; |
| | | import com.ruoyi.system.api.domain.dto.AppMiniRegisterDto; |
| | | import com.ruoyi.system.api.domain.poji.shop.Shop; |
| | | import com.ruoyi.system.api.domain.poji.sys.SysUser; |
| | | import com.ruoyi.system.api.domain.vo.AppMiniRegisterVo; |
| | | import com.ruoyi.system.api.domain.vo.ShopRelUserVo; |
| | |
| | | if(null == shopInfo){ |
| | | throw new ServiceException("未查询到商户信息"); |
| | | } |
| | | Long shopId = shopInfo.getShopId(); |
| | | Shop shop = remoteShopService.getShop(shopId).getData(); |
| | | if(-1 == shop.getShopStatus()){ |
| | | recordLogService.recordLogininfor(username, Constants.LOGIN_FAIL, "对应商户已删除,请联系管理员",Constants.FROM_SHOP); |
| | | throw new ServiceException("对应商户已删除,请联系管理员"); |
| | | } |
| | | if(0 == shop.getShopStatus()){ |
| | | recordLogService.recordLogininfor(username, Constants.LOGIN_FAIL, "对应商户已冻结,请联系管理员",Constants.FROM_SHOP); |
| | | throw new ServiceException("对应商户已冻结,请联系管理员"); |
| | | } |
| | | if(2 == shop.getShopStatus()){ |
| | | recordLogService.recordLogininfor(username, Constants.LOGIN_FAIL, "对应商户已终止合作,请联系管理员",Constants.FROM_SHOP); |
| | | throw new ServiceException("对应商户已终止合作,请联系管理员"); |
| | | } |
| | | |
| | | userInfo.setShopId(shopInfo.getShopId()); |
| | | recordLogService.recordLogininfor(username, Constants.LOGIN_SUCCESS, "登录成功",Constants.FROM_SHOP); |
| | | return userInfo; |
| | |
| | | public void deleteMgtCoupon(MgtBaseGetDto mgtBaseGetDto){ |
| | | Coupon coupon = this.getById(mgtBaseGetDto.getId()); |
| | | CouponTotal couponTotal = couponTotalService.getById(mgtBaseGetDto.getId()); |
| | | if(couponTotal.getSendCount()!=null&&couponTotal.getSendCount()>0){ |
| | | throw new ServiceException(AppErrorConstant.COUPON_SENT_DEL); |
| | | } |
| | | // if(couponTotal.getSendCount()!=null&&couponTotal.getSendCount()>0){ |
| | | // throw new ServiceException(AppErrorConstant.COUPON_SENT_DEL); |
| | | // } |
| | | coupon.setCouponStatus(-1); |
| | | coupon.setDelFlag(1); |
| | | coupon.setUpdateUserId(mgtBaseGetDto.getUserId()); |
| | |
| | | serviceCount = cycleService + serviceService + experienceService; |
| | | //更新商户和会员服务统计 |
| | | MemberTotalChangeDto memberTotalChangeDto = new MemberTotalChangeDto(); |
| | | memberTotalChangeDto.setUserId(merSureConsumerGoodsDto.getUserId()); |
| | | memberTotalChangeDto.setUserId(merSureConsumerGoodsDto.getMemberUserId()); |
| | | memberTotalChangeDto.setTypeService(1); |
| | | memberTotalChangeDto.setServiceCount(serviceCount); |
| | | log.info("更新商户和会员服务统计---》" + memberTotalChangeDto.toString()); |
| | |
| | | */ |
| | | @TableField("create_time") |
| | | private Date createTime; |
| | | /** |
| | | * 创建用户id |
| | | */ |
| | | @TableField("create_user_id") |
| | | private Long createUserId; |
| | | |
| | | /** |
| | | * 任务时间 |
| | |
| | | @ApiModelProperty(value="跟进时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date followTime; |
| | | |
| | | @ApiModelProperty(value = "添加用户id") |
| | | private Long createUserId; |
| | | } |
| | |
| | | Long userId; |
| | | SysStaff sysStaff; |
| | | HashSet<Long> userIdSet = new HashSet<>(); |
| | | HashSet<Long> createUserIdSet = new HashSet<>(); |
| | | for(StaffShopTaskPageVo staffShopTaskPageVo : shopTaskPageVoList){ |
| | | userIdSet.add(staffShopTaskPageVo.getUserId()); |
| | | if(null != staffShopTaskPageVo.getCreateUserId()){ |
| | | createUserIdSet.add(staffShopTaskPageVo.getCreateUserId()); |
| | | } |
| | | } |
| | | List<Long> useIdList = new ArrayList<>(userIdSet); |
| | | List<Long> createUserIdList = new ArrayList<>(createUserIdSet); |
| | | List<SysStaff> sysStaffList = remoteConfigService.listSysStaffByIds(useIdList).getData(); |
| | | Map<Long,SysStaff> sysStaffMap = sysStaffList.stream() |
| | | .collect(Collectors.toMap(SysStaff::getUserId, Function.identity())); |
| | | |
| | | createUserIdList.add(-1L); |
| | | List<SysStaff> sysStaffList1 = remoteConfigService.listSysStaffByIds(createUserIdList).getData(); |
| | | Map<Long,SysStaff> sysStaffMap1 = sysStaffList1.stream() |
| | | .collect(Collectors.toMap(SysStaff::getUserId, Function.identity())); |
| | | for(StaffShopTaskPageVo staffShopTaskPageVo : shopTaskPageVoList){ |
| | | //获取任务用户信息 |
| | | userId = staffShopTaskPageVo.getUserId(); |
| | | if(userId!=null){ |
| | | sysStaff = sysStaffMap.get(userId); |
| | | if(null != sysStaff){ |
| | | staffShopTaskPageVo.setUserName(sysStaff.getStaffName()); |
| | | staffShopTaskPageVo.setUserPicture(sysStaff.getStaffAvatar()); |
| | | staffShopTaskPageVo.setUserPosition(sysStaff.getStaffPost()); |
| | | } |
| | | }else{ |
| | | if(null != staffShopTaskPageVo.getCreateUserId()){ |
| | | sysStaff = sysStaffMap1.get(staffShopTaskPageVo.getCreateUserId()); |
| | | staffShopTaskPageVo.setUserName(sysStaff.getStaffName()); |
| | | staffShopTaskPageVo.setUserPicture(sysStaff.getStaffAvatar()); |
| | | staffShopTaskPageVo.setUserPosition(sysStaff.getStaffPost()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | }else{ |
| | | shopTask.setTaskStatus(3); |
| | | } |
| | | shopTask.setCreateUserId(staffAddTaskDto.getUserId()); |
| | | this.saveOrUpdate(shopTask); |
| | | } |
| | | |
| | |
| | | tst.task_title taskTitle, |
| | | tst.emergency_state emergencyState, |
| | | CASE WHEN tst.task_date = DATE(now()) THEN 1 ELSE 0 END todayFlag, |
| | | tst.create_user_id as createUserId, |
| | | tstr.user_id userId, |
| | | tstr.create_time followTime |
| | | FROM t_shop_task tst |
| | |
| | | |
| | | @RequestMapping(value = "/listMgtDeptStaff", method = RequestMethod.POST) |
| | | @ApiOperation(value = "获取部门员工列表") |
| | | public R<List<MgtDeptStaffListVo>> listMgtDeptStaff() { |
| | | public R<List<MgtDeptStaffListVo>> listMgtDeptStaff(@RequestBody String name) { |
| | | // 获取当前登陆人的可视权限 |
| | | SysUser sysUser = SecurityUtils.getSysUser(); |
| | | // 如果当前登陆人权限是查看部门数据 |
| | |
| | | } |
| | | } |
| | | } |
| | | List<MgtDeptStaffListVo> mgtDeptStaffListVoList= sysStaffService.listMgtDeptStaff(deptId,userId); |
| | | List<MgtDeptStaffListVo> mgtDeptStaffListVoList= sysStaffService.listMgtDeptStaff(deptId,userId, name); |
| | | return R.ok(mgtDeptStaffListVoList); |
| | | } |
| | | |
| | |
| | | @RequestMapping(value = "/listDeptStaff", method = RequestMethod.POST) |
| | | @ApiOperation(value = "获取所有部门员工列表") |
| | | public R<List<MgtDeptStaffListVo>> listDeptStaff() { |
| | | List<MgtDeptStaffListVo> mgtDeptStaffListVoList= sysStaffService.listMgtDeptStaff(null,null); |
| | | List<MgtDeptStaffListVo> mgtDeptStaffListVoList= sysStaffService.listMgtDeptStaff(null,null, null); |
| | | return R.ok(mgtDeptStaffListVoList); |
| | | } |
| | | |
| | |
| | | * @param |
| | | * @return List<MgtDeptStaffListVo> |
| | | */ |
| | | List<MgtDeptStaffListVo> listMgtDeptStaff(@Param("deptId") Long deptId,@Param("userId")Long userId); |
| | | List<MgtDeptStaffListVo> listMgtDeptStaff(@Param("deptId") Long deptId,@Param("userId")Long userId, @Param("name")String name); |
| | | |
| | | /** |
| | | * @description 获取部门员工列表 |
| | |
| | | recommendCooperation.setCreateTime(new Date()); |
| | | if(recommendCooperation.getShopId()!=null){ |
| | | recommendCooperation.setRecommendedFrom(2); |
| | | recommendCooperation.setMemberSource("合作商推荐"); |
| | | }else{ |
| | | recommendCooperation.setRecommendedFrom(1); |
| | | recommendCooperation.setMemberSource("小程序"); |
| | | } |
| | | this.save(recommendCooperation); |
| | | } |
| | |
| | | * @return List<MgtDeptStaffListVo> |
| | | */ |
| | | @Override |
| | | public List<MgtDeptStaffListVo> listMgtDeptStaff(Long deptId,Long userId){ |
| | | return sysStaffMapper.listMgtDeptStaff(deptId,userId); |
| | | public List<MgtDeptStaffListVo> listMgtDeptStaff(Long deptId,Long userId, String name){ |
| | | return sysStaffMapper.listMgtDeptStaff(deptId,userId, name); |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | } |
| | | } |
| | | deptStaffListVoList = sysStaffMapper.listMgtDeptStaff(deptId,userId1); |
| | | deptStaffListVoList = sysStaffMapper.listMgtDeptStaff(deptId,userId1, null); |
| | | return deptStaffListVoList; |
| | | } |
| | | |
| | |
| | | * @param |
| | | * @return List<MgtDeptStaffListVo> |
| | | */ |
| | | List<MgtDeptStaffListVo> listMgtDeptStaff(Long deptId,Long userId); |
| | | List<MgtDeptStaffListVo> listMgtDeptStaff(Long deptId,Long userId, String name); |
| | | |
| | | /** |
| | | * @description 通过权限获取部门员工列表 |
| | |
| | | <if test="userId != null "> |
| | | AND su.user_id = #{userId} |
| | | </if> |
| | | <if test="null != name and '' != name"> |
| | | and su.nick_name like CONCAT('%', #{name}, '%') |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="listMgtDeptStaffByDept" resultMap="deptStaffResultMap"> |