k94314517
2024-12-19 ebd3867b9b896afd5768f04afaf53b905d01f64b
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/VisitsServiceImpl.java
@@ -82,7 +82,7 @@
    @Autowired
    private RetentionMapper retentionMapper;
    @Autowired
    private VisitsMapper visitsMapper;
    private VisitsJoinMapper visitsMapper;
    @Autowired
    private ApproveMapper approveMapper;
    @Autowired
@@ -297,7 +297,7 @@
        //发送微信公众号通知 - 申请提交成功待审核
        if(StringUtils.isNotBlank(visits.getOpenid())){
            WxPlatNotice wxPlatNotice = new WxPlatNotice();
            wxPlatNotice.sendVisitTemplateNotice(
            wxPlatNotice.sendVisitTemplateNotice(systemDictDataBiz,
                    wxNoticeConfigMapper,visits,
                    Constants.equalsInteger(visits.getType(),Constants.TWO)?WxPlatConstants.visitReportContent.visitReportUpload:WxPlatConstants.visitContent.visitUpload,
                    systemDictDataBiz.queryByCode(Constants.WX_PLATFORM,Constants.WX_PLATFORM_ACCESS_TOKEN).getCode(),
@@ -331,6 +331,19 @@
        //初始化访客信息
//        initVisitInfo(visits,date);
        visitsMapper.insert(visits);
        if(Objects.nonNull(visits.getLoginUserInfo())){
            SystemUser systemUser = systemUserMapper.selectById(visits.getLoginUserInfo().getId());
            if(Objects.nonNull(systemUser)&&StringUtils.isNotBlank(systemUser.getOpenid())){
                WxPlatNotice wxPlatNotice = new WxPlatNotice();
                wxPlatNotice.sendVisitTemplateNotice(systemDictDataBiz,
                        wxNoticeConfigMapper,visits,
                        Constants.equalsInteger(visits.getType(),Constants.TWO)?WxPlatConstants.visitReportContent.visitReportUpload:WxPlatConstants.visitContent.visitUpload,
                        systemDictDataBiz.queryByCode(Constants.WX_PLATFORM,Constants.WX_PLATFORM_ACCESS_TOKEN).getCode(),
                        Arrays.asList(systemUser.getOpenid().split(","))
                );
            }
        }
        approveService.createApproveFlow(visits.getType(),visits.getId(),visits.getReceptMemberId());
        return visits.getId();
    }
@@ -1260,6 +1273,23 @@
        queryWrapper.isNull(Visits::getParentId);
        queryWrapper.eq(Objects.nonNull(pageWrap.getModel().getMemberId()),Visits::getMemberId,pageWrap.getModel().getMemberId());
        queryWrapper.eq(Objects.nonNull(pageWrap.getModel().getReceptMemberId()),Visits::getReceptMemberId,pageWrap.getModel().getReceptMemberId());
        if(Objects.nonNull(pageWrap.getModel().getBusinessStatus())){
            if(Constants.equalsInteger(pageWrap.getModel().getBusinessStatus(),Constants.TWO)){
                queryWrapper.in(Visits::getStatus,
                        Constants.VisitStatus.xfSuccess,
                        Constants.VisitStatus.xfFail,
                        Constants.VisitStatus.signin,
                        Constants.VisitStatus.signout,
                        Constants.VisitStatus.invalid,
                        Constants.VisitStatus.pass
                        );
            }else{
                queryWrapper.eq(Visits::getStatus,pageWrap.getModel().getBusinessStatus());
            }
        }
        queryWrapper.orderByDesc(Visits::getCreateDate);
        IPage<Visits> result = visitsJoinMapper.selectJoinPage(page, Visits.class,queryWrapper);
@@ -1392,6 +1422,30 @@
                            memberId)
            );
//        }
        if(Constants.equalsInteger(visits.getStatus(),Constants.VisitStatus.waitCheck)||Constants.equalsInteger(visits.getStatus(),Constants.VisitStatus.submitCheck)){
            Notices notices = noticesJoinMapper.selectOne(new QueryWrapper<Notices>().lambda().eq(Notices::getObjId,visits.getId())
                    .eq(Notices::getType,Constants.equalsInteger(visits.getType(),Constants.TWO)?Constants.noticesObjectType.visitReporting:Constants.noticesObjectType.visit)
                    .eq(Notices::getUserId,memberId)
                    .eq(Notices::getSendacopy,Constants.ZERO)
                    .last(" limit 1 ")
            );
            visitDetailVO.setInfoStatus(1);
            if(Objects.nonNull(notices)){
                visitDetailVO.setInfo(notices.getInfo());
            }else{
                visitDetailVO.setInfo("暂无");
            }
        }else if(Constants.equalsInteger(visits.getStatus(),Constants.VisitStatus.noPass)){
            visitDetailVO.setInfoStatus(Constants.VisitStatus.noPass);
            visitDetailVO.setInfo("审批未通过");
        }else if(Constants.equalsInteger(visits.getStatus(),Constants.VisitStatus.cancel)){
            visitDetailVO.setInfoStatus(Constants.VisitStatus.cancel);
            visitDetailVO.setInfo("已取消");
        }else{
            visitDetailVO.setInfoStatus(Constants.VisitStatus.pass);
            visitDetailVO.setInfo("审批已通过");
        }
        return visitDetailVO;
    }
@@ -1768,7 +1822,7 @@
                SmsEmailServiceImpl.sendVisitTimeOutSms(systemDictDataBiz,
                        emayService,smsEmailMapper,smsConfigMapper,
                        SmsConstants.visitContent.visitTimeOutSignOutNum,
                        visitReportTimeCount.toString(),Arrays.asList(mobile.split(","))
                        visitTimeCount.toString(),Arrays.asList(mobile.split(","))
                );
            }
        }