puzhibing
2024-03-18 65ca63cc3d36f23d285a7d944fcc0d6bac92430d
合并代码
13个文件已修改
80 ■■■■ 已修改文件
ruoyi-auth/src/main/java/com/ruoyi/auth/service/SysLoginService.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/service/impl/coupon/CouponServiceImpl.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/order/ConsumerGoodsServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/domain/pojo/task/ShopTask.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/domain/vo/StaffShopTaskPageVo.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/service/impl/task/ShopTaskServiceImpl.java 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-shop/src/main/resources/mapper/task/ShopTaskMapper.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/management/MgtStaffController.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/staff/SysStaffMapper.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/config/RecommendCooperationServiceImpl.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/staff/SysStaffServiceImpl.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/staff/SysStaffService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-system/src/main/resources/mapper/staff/SysStaffMapper.xml 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-auth/src/main/java/com/ruoyi/auth/service/SysLoginService.java
@@ -14,6 +14,7 @@
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;
@@ -240,6 +241,21 @@
        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;
ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/service/impl/coupon/CouponServiceImpl.java
@@ -733,9 +733,9 @@
    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());
ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/order/ConsumerGoodsServiceImpl.java
@@ -189,7 +189,7 @@
            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());
ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/domain/pojo/task/ShopTask.java
@@ -69,6 +69,11 @@
     */
    @TableField("create_time")
    private Date createTime;
    /**
     * 创建用户id
     */
    @TableField("create_user_id")
    private Long createUserId;
    /**
     * 任务时间
ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/domain/vo/StaffShopTaskPageVo.java
@@ -49,4 +49,7 @@
    @ApiModelProperty(value="跟进时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date followTime;
    @ApiModelProperty(value = "添加用户id")
    private Long createUserId;
}
ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/service/impl/task/ShopTaskServiceImpl.java
@@ -180,21 +180,40 @@
            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);
                    staffShopTaskPageVo.setUserName(sysStaff.getStaffName());
                    staffShopTaskPageVo.setUserPicture(sysStaff.getStaffAvatar());
                    staffShopTaskPageVo.setUserPosition(sysStaff.getStaffPost());
                    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());
                    }
                }
            }
        }
@@ -229,6 +248,7 @@
        }else{
            shopTask.setTaskStatus(3);
        }
        shopTask.setCreateUserId(staffAddTaskDto.getUserId());
        this.saveOrUpdate(shopTask);
    }
ruoyi-modules/ruoyi-shop/src/main/resources/mapper/task/ShopTaskMapper.xml
@@ -109,6 +109,7 @@
        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
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/management/MgtStaffController.java
@@ -53,7 +53,7 @@
    @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();
        // 如果当前登陆人权限是查看部门数据
@@ -77,7 +77,7 @@
                }
            }
        }
        List<MgtDeptStaffListVo> mgtDeptStaffListVoList= sysStaffService.listMgtDeptStaff(deptId,userId);
        List<MgtDeptStaffListVo> mgtDeptStaffListVoList= sysStaffService.listMgtDeptStaff(deptId,userId, name);
        return R.ok(mgtDeptStaffListVoList);
    }
@@ -85,7 +85,7 @@
    @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);
    }
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/staff/SysStaffMapper.java
@@ -28,7 +28,7 @@
     * @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  获取部门员工列表
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/config/RecommendCooperationServiceImpl.java
@@ -65,8 +65,10 @@
        recommendCooperation.setCreateTime(new Date());
        if(recommendCooperation.getShopId()!=null){
            recommendCooperation.setRecommendedFrom(2);
            recommendCooperation.setMemberSource("合作商推荐");
        }else{
            recommendCooperation.setRecommendedFrom(1);
            recommendCooperation.setMemberSource("小程序");
        }
        this.save(recommendCooperation);
    }
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/staff/SysStaffServiceImpl.java
@@ -89,8 +89,8 @@
     * @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);
    }
    /**
@@ -126,7 +126,7 @@
                }
            }
        }
        deptStaffListVoList = sysStaffMapper.listMgtDeptStaff(deptId,userId1);
        deptStaffListVoList = sysStaffMapper.listMgtDeptStaff(deptId,userId1, null);
        return deptStaffListVoList;
    }
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/staff/SysStaffService.java
@@ -30,7 +30,7 @@
     * @param
     * @return  List<MgtDeptStaffListVo>
     */
    List<MgtDeptStaffListVo> listMgtDeptStaff(Long deptId,Long userId);
    List<MgtDeptStaffListVo> listMgtDeptStaff(Long deptId,Long userId, String name);
    /**
     * @description 通过权限获取部门员工列表
ruoyi-modules/ruoyi-system/src/main/resources/mapper/staff/SysStaffMapper.xml
@@ -26,6 +26,9 @@
        <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">