k94314517
2025-03-27 c1335d3f7fd147268625b2d32944cfe1c45221f9
代码初始化
已修改9个文件
170 ■■■■ 文件已修改
server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/admin/PlatformJobCloudController.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/web/VisitorWebController.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/core/wx/wxPlat/WxPlatNotice.java 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/PlatformJobService.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/VisitsService.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformJobServiceImpl.java 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/VisitReasonServiceImpl.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/VisitsServiceImpl.java 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/thrid/BoardServiceImpl.java 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/admin/PlatformJobCloudController.java
@@ -19,6 +19,7 @@
import com.mchange.v2.beans.BeansUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.models.auth.In;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -152,4 +153,13 @@
        platformJobService.signIn(signInDTO);
        return ApiResponse.success("操作成功");
    }
    @ApiOperation("手动完成作业")
    @PostMapping("/dealJobFinish")
    public ApiResponse  dealJobFinish (@RequestBody List<Integer> list, @RequestHeader(Constants.HEADER_USER_TOKEN) String token){
        platformJobService.dealJobFinish(list);
        return ApiResponse.success("操作成功");
    }
}
server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/web/VisitorWebController.java
@@ -111,5 +111,21 @@
    }
    /**
     * 2025-3-25 14:14:34  加入取消预约 待审批、审批中、已审批
     * @param visitId
     * @return
     */
    @ApiOperation("取消预约")
    @GetMapping("/visitsSelfCancel")
    public ApiResponse visitsSelfCancel(@RequestParam Integer visitId,@RequestParam Integer memberId){
        if(Objects.isNull(memberId)){
            memberId = Constants.ZERO;
        }
        visitsService.visitsSelfCancel(visitId,memberId);
        return ApiResponse.success(null);
    }
}
server/visits/dmvisit_service/src/main/java/com/doumee/core/wx/wxPlat/WxPlatNotice.java
@@ -627,7 +627,7 @@
                }
            }
        }catch (Exception e){
            e.printStackTrace();
        }
    }
@@ -665,7 +665,7 @@
                thing2.put("value",platformJob.getDriverName());
                //签到时间
                Map<String, Object> time5 = new HashMap<String,Object>();
                time5.put("value", DateUtil.getFomartDate(platformJob.getSignDate(),"yyyy年MM月dd日 HH:mm:ss"));
                time5.put("value", DateUtil.getFomartDate(new Date(),"yyyy年MM月dd日 HH:mm:ss"));
                dataMap.put("car_number1",car_number1);
                dataMap.put("thing2",thing2);
@@ -690,6 +690,40 @@
        }
    }
    public static void main(String[] args) {
        String postUrL = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=90_8_a3QDclSc8HTcbgXhSVnijiQdRf4dG5wme29riDIyt3UIi7FpZ_HJyqyEIY-_e2A29jH2fLBKgtuBKtq-cy7DteFg5l9EawoxAwiRis8BMnEl-u01ITtCUVU90XCIjADASXD";
        //整体参数map
        Map<String, Object> paramMap = new HashMap<String, Object>();
        //消息主题显示相关map
        Map<String, Object> dataMap = new HashMap<String, Object>();
        //车牌号
        Map<String, Object> car_number1 = new HashMap<String,Object>();
        car_number1.put("value","皖A12345");
        //司机姓名
        Map<String, Object> thing2 = new HashMap<String,Object>();
        thing2.put("value","小阿武");
        //签到时间
        Map<String, Object> time5 = new HashMap<String,Object>();
        time5.put("value", DateUtil.getFomartDate(new Date(),"yyyy年MM月dd日 HH:mm:ss"));
        dataMap.put("car_number1",car_number1);
        dataMap.put("thing2",thing2);
        dataMap.put("time5",time5);
        paramMap.clear();
        paramMap.put("template_id", "ZYhHg5eJJim0LR3FLVaqKcVqW3p8GQk8qrTO40ffHXI");
        paramMap.put("touser", "ovmre6RUJJZCDtCyLxWYKSMgt7u8");
        paramMap.put("data", dataMap);
        String response = HttpsUtil.postJson(postUrL, JSONObject.toJSONString(paramMap));
        log.error("·==++--·推送微信模板信息内容:{}", JSONObject.toJSONString(paramMap));
        if(StringUtils.isBlank(response)){
            log.error("·==++--·推送微信模板信息:{}·--++==·", "失败");
        }else{
            JSONObject json = JSONObject.parseObject(response);
            log.error("·==++--·推送微信模板信息:{}·--++==·", Constants.equalsInteger(json.getInteger("errcode"),Constants.ZERO)?"成功":"失败"+json.getString("errmsg"));
        }
    }
    public void  sendUnFinishNotice(WxNoticeConfigMapper wxNoticeConfigMapper,Integer unFinishNum,String objCode,String token,
                                           List<String> openIds){
        try{
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/PlatformJobService.java
@@ -256,4 +256,5 @@
     */
    void sendUnFinishNotice();
    void dealJobFinish(List<Integer> jobIdList);
}
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/VisitsService.java
@@ -145,6 +145,7 @@
     * 处理待审核、审核中、已审核的数据取消业务
     * 2025年3月25日14:10:10
      */
    void  visitsSelfCancel(Integer visitId,Integer memberId);
    void  visitsCancel(Integer visitId,LoginUserInfo loginUserInfo);
    void resetPassword(ResetPasswordDTO resetPasswordDTO);
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformJobServiceImpl.java
@@ -688,10 +688,13 @@
        savePlatformLog(Constants.PlatformJobLogType.SIGN.getKey(),oldPlatformJob,platformJob,
                Constants.PlatformJobLogType.SIGN.getInfo());
        //签到微信通知 2025年3月26日14:25:00
        if(!Constants.equalsInteger(platformJob.getSingType(),Constants.TWO)&&StringUtils.isNotBlank(platformGroup.getSignInNoticeUsers())){
        logger.info("签到微信通知=========================>开始====签到类型=>"+signInDTO.getSignType()+"===>人员主键=>"+platformGroup.getSignInNoticeUsers());
        if(!Constants.equalsInteger(signInDTO.getSignType(),Constants.TWO)&&
                StringUtils.isNotBlank(platformGroup.getSignInNoticeUsers())){
            logger.info("签到微信通知=========================>进入");
            List<SystemUser> systemUserList = systemUserMapper.selectList(new QueryWrapper<SystemUser>().lambda()
                    .eq(SystemUser::getDeleted,Constants.ZERO).eq(SystemUser::getStatus,Constants.ZERO).isNotNull(SystemUser::getOpenid)
                    .in(SystemUser::getId,Arrays.asList(platformGroup.getSignInNoticeUsers().split(",")))
                    .in(SystemUser::getMemberId,Arrays.asList(platformGroup.getSignInNoticeUsers().split(",")))
            );
            if (com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(systemUserList)) {
                WxPlatNotice wxPlatNotice = new WxPlatNotice();
@@ -702,6 +705,7 @@
                );
            }
        }
        logger.info("签到微信通知=========================>结束");
    }
@@ -734,7 +738,7 @@
                    if(Objects.nonNull(platformGroup)){
                        List<SystemUser> systemUserList = systemUserMapper.selectList(new QueryWrapper<SystemUser>().lambda()
                                .eq(SystemUser::getDeleted,Constants.ZERO).eq(SystemUser::getStatus,Constants.ZERO).isNotNull(SystemUser::getOpenid)
                                .in(SystemUser::getId,Arrays.asList(platformGroup.getUnFinishNoticeUsers().split(",")))
                                .in(SystemUser::getMemberId,Arrays.asList(platformGroup.getUnFinishNoticeUsers().split(",")))
                        );
                        if (com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(systemUserList)) {
                            WxPlatNotice wxPlatNotice = new WxPlatNotice();
@@ -1652,7 +1656,7 @@
        platformJob.setPlatformName(platform.getName());
        this.broadcastAndLEed(platformJob,
                //Constants.PlatformLedContent.DONE.getInfo(),
                Constants.PlatformLedContent.IDEL_CONTNET.getInfo(),
                StringUtils.isBlank(platform.getLedContent())?Constants.PlatformLedContent.IDEL_CONTNET.getInfo():platform.getLedContent(),
                Constants.PlatformBroadcastContent.DONE.getInfo());
        return platformJob;
    }
@@ -2426,5 +2430,33 @@
    }
    /**
     * 手动完成作业
     * @param jobIdList
     */
    @Override
    public void dealJobFinish(List<Integer> jobIdList){
        if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(jobIdList)){
            List<PlatformJob> platformJobList = platformJobMapper.selectList(new QueryWrapper<PlatformJob>().lambda()
                    .eq(PlatformJob::getIsdeleted,Constants.ZERO)
                    .in(PlatformJob::getStatus,Constants.PlatformJobStatus.WAIT_CONFIRM,Constants.PlatformJobStatus.WART_SIGN_IN)
                    .in(PlatformJob::getId,jobIdList)
            );
            if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(platformJobList)){
                platformJobMapper.update(null,new UpdateWrapper<PlatformJob>().lambda()
                        .set(PlatformJob::getStatus,Constants.PlatformJobStatus.DONE.getKey())
                        .set(PlatformJob::getDoneDate,new Date())
                        .in(PlatformJob::getStatus,Constants.PlatformJobStatus.WAIT_CONFIRM,Constants.PlatformJobStatus.WART_SIGN_IN)
                        .eq(PlatformJob::getIsdeleted,Constants.ZERO)
                        .in(PlatformJob::getId,platformJobList.stream().map(i->i.getId()).collect(Collectors.toList())));
            }
        }
    }
}
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/VisitReasonServiceImpl.java
@@ -99,6 +99,7 @@
    public List<VisitReason> findList(VisitReason visitReason) {
        QueryWrapper<VisitReason> wrapper = new QueryWrapper<>(visitReason);
        wrapper.eq("isdeleted",Constants.ZERO);
        wrapper.orderByAsc("sortnum");
        return visitReasonMapper.selectList(wrapper);
    }
  
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/VisitsServiceImpl.java
@@ -1574,28 +1574,41 @@
    }
    @Override
    public void  visitsSelfCancel(Integer visitId,Integer memberId){
        Visits visits = visitsMapper.selectById(visitId);
        if(Objects.isNull(visits)){
            throw new BusinessException(ResponseStatus.DATA_EMPTY);
        }
        if(!(Constants.equalsInteger(memberId,visits.getMemberId()))){
            throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"无此操作权限");
        }
        this.visitsCancelBiz(visits);
    }
    /**
     * 处理待审核、审核中、已审核的数据取消业务
     * 2025年3月25日14:10:10
     */
    @Override
    public void  visitsCancel(Integer visitId,LoginUserInfo loginUserInfo){
        Visits visits = visitsMapper.selectById(visitId);
        if(Objects.isNull(visits)){
            throw new BusinessException(ResponseStatus.DATA_EMPTY);
        }
        if(!(Constants.equalsInteger(loginUserInfo.getMemberId(),visits.getMemberId()) ||
                Constants.equalsInteger(loginUserInfo.getMemberId(),visits.getCreateMemberId()) ||
                ( CollectionUtils.isNotEmpty(loginUserInfo.getPermissions()) &&
            loginUserInfo.getPermissions().stream().filter(i->i.equals("business:visits:cancel")).collect(Collectors.toList()).size()>0))){
        if(!(
                 CollectionUtils.isNotEmpty(loginUserInfo.getPermissions()) &&
                        loginUserInfo.getPermissions().stream().filter(i->i.equals("business:visits:cancel")).collect(Collectors.toList()).size()>0)){
            throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"无此操作权限");
        }
        this.visitsCancelBiz(visits);
    }
    /**
     * 处理待审核、审核中、已审核的数据取消业务
     * 2025年3月25日14:10:10
     */
    public void  visitsCancelBiz(Visits visits){
        UpdateWrapper<Visits> updateWrapper = new UpdateWrapper();
        updateWrapper.lambda().set(Visits::getStatus,Constants.VisitStatus.cancel)
                .set(Visits::getEditDate,DateUtil.getCurrDateTime())
                .set(Visits::getEditor,loginUserInfo.getId())
                .eq(Visits::getId,visitId);
                .set(Visits::getEditor,visits.getEditor())
                .eq(Visits::getId,visits.getId());
        //访客报备
        if(Constants.equalsInteger(visits.getType(),Constants.TWO)){
            if(!(Constants.equalsInteger(visits.getStatus(),Constants.VisitStatus.waitCheck)||Constants.equalsInteger(visits.getStatus(),Constants.VisitStatus.submitCheck)
@@ -1670,7 +1683,6 @@
                            .set(Notices::getInfo,"手动取消")
//                        .set(Notices::getStatus,Constants.ONE)
                            .set(Notices::getParam2,Constants.FOUR)//已取消
                            .eq(Notices::getIsdeleted,Constants.ZERO)
                            .eq(Notices::getStatus,Constants.ZERO)
                            .eq(Notices::getParam2,Constants.ZERO)//待处理
                            .eq(Notices::getObjId,visits.getId())
@@ -2076,7 +2088,6 @@
                            .set(Notices::getEditDate,new Date())
                            .set(Notices::getInfo,info)
                            .set(Notices::getParam2,Constants.FOUR)//已取消
                            .eq(Notices::getIsdeleted,Constants.ZERO)
                            .eq(Notices::getStatus,Constants.ZERO)
                            .eq(Notices::getParam2,Constants.ZERO)//待处理
                            .eq(Notices::getObjId,objId)
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/thrid/BoardServiceImpl.java
@@ -151,7 +151,7 @@
                List<PlatformJob> jobs = platformJobMapper.selectList (new MPJLambdaWrapper<PlatformJob>()
                        .select(PlatformJob::getTotalNum)
                        .eq(PlatformJob::getIsdeleted,Constants.ZERO)
                        .eq(PlatformJob::getOrigin,Constants.ZERO)
                                .apply(" ( origin = 0 or origin is null)  ")
                        .eq(PlatformJob::getPlatformGroupId,platformGroupId)
                        .apply("to_days(done_date) = to_days(now())")
                        .in(PlatformJob::getStatus, Constants.PlatformJobStatus.DONE.getKey()
@@ -962,6 +962,18 @@
                                Constants.PlatformJobStatus.LEAVED.getKey(),
                                Constants.PlatformJobStatus.AUTHED_LEAVE.getKey())
                        .apply("year(done_date) = year('"+DateUtil.getPlusTime2(month)+"') and month(done_date) = month('"+DateUtil.getPlusTime2(month)+"') "));
        List<PlatformJob>  yearNum = platformJobMapper.selectJoinList(PlatformJob.class,
                new MPJLambdaWrapper<PlatformJob>()
                        .selectAs(PlatformJob::getId,PlatformJob::getId)
                        .selectAs(PlatformJob::getTotalNum,PlatformJob::getTotalNum)
                        .select(PlatformJob::getStatus,PlatformJob::getStatus)
                        .select(PlatformJob::getType,PlatformJob::getType)
//                        .selectCount(PlatformJob::getPlatformId,PlatformJob::getCountum)
                        .eq(PlatformJob::getIsdeleted,Constants.ZERO)
                        .in(PlatformJob::getType,Constants.ONE,Constants.THREE)
                        .in(PlatformJob::getStatus,Constants.PlatformJobStatus.DONE.getKey(),Constants.PlatformJobStatus.LEAVED.getKey(),Constants.PlatformJobStatus.AUTHED_LEAVE.getKey())
                        .apply("year(done_date) = year('"+DateUtil.getPlusTime2(year)+"')   and done_date<=  now()  "));
        List<PlatformJob>  monthLastNum = platformJobMapper.selectJoinList(PlatformJob.class,
                new MPJLambdaWrapper<PlatformJob>()
                        .selectAs(PlatformJob::getId,PlatformJob::getId)
@@ -974,17 +986,7 @@
                        .in(PlatformJob::getStatus,Constants.PlatformJobStatus.DONE.getKey(),Constants.PlatformJobStatus.LEAVED.getKey(),Constants.PlatformJobStatus.AUTHED_LEAVE.getKey())
                        .apply("year(done_date) = year('"+DateUtil.getPlusTime2(lastMonth)+"') and month(done_date) = month('"+DateUtil.getPlusTime2(lastMonth)+"') and  done_date<= '"
                                +DateUtil.getPlusTime2(lastMonth)+"'"));
        List<PlatformJob>  yearNum = platformJobMapper.selectJoinList(PlatformJob.class,
                new MPJLambdaWrapper<PlatformJob>()
                        .selectAs(PlatformJob::getId,PlatformJob::getId)
                        .selectAs(PlatformJob::getTotalNum,PlatformJob::getTotalNum)
                        .select(PlatformJob::getStatus,PlatformJob::getStatus)
                        .select(PlatformJob::getType,PlatformJob::getType)
//                        .selectCount(PlatformJob::getPlatformId,PlatformJob::getCountum)
                        .eq(PlatformJob::getIsdeleted,Constants.ZERO)
                        .in(PlatformJob::getType,Constants.ONE,Constants.THREE)
                        .in(PlatformJob::getStatus,Constants.PlatformJobStatus.DONE.getKey(),Constants.PlatformJobStatus.LEAVED.getKey(),Constants.PlatformJobStatus.AUTHED_LEAVE.getKey())
                        .apply("year(done_date) = year('"+DateUtil.getPlusTime2(year)+"')   and done_date<= '"+DateUtil.getPlusTime2(year)+"'"));
        List<PlatformJob> yearLastNum = platformJobMapper.selectJoinList(PlatformJob.class,
                new MPJLambdaWrapper<PlatformJob>()
                        .selectAs(PlatformJob::getId,PlatformJob::getId)
@@ -994,7 +996,7 @@
                        .eq(PlatformJob::getIsdeleted,Constants.ZERO)
                        .in(PlatformJob::getType,Constants.ONE,Constants.THREE)
                        .in(PlatformJob::getStatus,Constants.PlatformJobStatus.DONE.getKey(),Constants.PlatformJobStatus.LEAVED.getKey(),Constants.PlatformJobStatus.AUTHED_LEAVE.getKey())
                        .apply("year(done_date) = year('"+DateUtil.getPlusTime2(lastYear)+"')  and done_date<= '"+DateUtil.getPlusTime2(lastYear)+"'"));
                        .apply("year(done_date) = year('"+DateUtil.getPlusTime2(lastYear)+"')  and done_date<=  now()  "));
        data.setMonthOutTotal(getSumTotalByList(monthNum,0,null));//本月出库量
        data.setMonthLastOutTotal(getSumTotalByList(monthLastNum,null,null) );//上月出库量