| | |
| | | import com.doumee.core.haikang.model.param.request.ParkReservationAddRequest; |
| | | import com.doumee.core.haikang.model.param.respose.ParkReservationAddResponse; |
| | | import com.doumee.core.haikang.service.HKService; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.service.business.third.model.PageData; |
| | | import com.doumee.service.business.third.model.PageWrap; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.core.utils.DateUtil; |
| | | import com.doumee.core.utils.SmsConstants; |
| | |
| | | import com.doumee.core.wx.wxPlat.WxPlatNotice; |
| | | import com.doumee.dao.business.*; |
| | | import com.doumee.dao.business.dao.CompanyMapper; |
| | | import com.doumee.dao.business.dao.MemberMapper; |
| | | import com.doumee.dao.business.dao.SmsConfigMapper; |
| | | import com.doumee.dao.business.dao.SmsEmailMapper; |
| | | import com.doumee.dao.business.dto.ApproveDTO; |
| | |
| | | import com.doumee.dao.business.join.VisitsJoinMapper; |
| | | import com.doumee.dao.business.model.*; |
| | | import com.doumee.dao.business.vo.ApproveDataVO; |
| | | import com.doumee.dao.business.model.Member; |
| | | import com.doumee.dao.system.SystemUserMapper; |
| | | import com.doumee.dao.system.dto.NoticesDTO; |
| | | import com.doumee.dao.system.join.NoticesJoinMapper; |
| | |
| | | @Autowired |
| | | private CarDriverMapper carDriverMapper; |
| | | |
| | | @Autowired |
| | | private VisitsMapper visitsMapper; |
| | | |
| | | @Autowired |
| | | private VisitsJoinMapper visitsJoinMapper; |
| | | private VisitsJoinMapper visitsMapper; |
| | | |
| | | @Autowired |
| | | private CarUseBookJoinMapper carUseBookJoinMapper; |
| | |
| | | Constants.equalsInteger(i.getUserId(),memberId) |
| | | &&Constants.equalsInteger(i.getStatus(),Constants.ZERO) |
| | | &&Constants.equalsInteger(i.getSendacopy(),Constants.ZERO) |
| | | &&StringUtils.equals(i.getParam2(),"0") |
| | | ).count() |
| | | ); |
| | | //已处理数据 |
| | |
| | | noticesJoinMapper.selectCount(new QueryWrapper<Notices>().lambda().eq(Notices::getParam3,memberId)) |
| | | ); |
| | | //抄送我的数据 |
| | | internalHomeVO.setNoticeCopyNum( |
| | | internalHomeVO.setNoticeCopyNum( |
| | | noticesList.stream().filter(i->Constants.equalsInteger(i.getUserId(),memberId) |
| | | &&Constants.equalsInteger(i.getSendacopy(),Constants.ONE) |
| | | &&Constants.equalsInteger(i.getReaded(),Constants.ZERO) |
| | |
| | | noticesList.stream().filter(i->Constants.equalsInteger(i.getUserId(),noticesDTO.getMemberId()) |
| | | &&Constants.equalsInteger(i.getStatus(),Constants.ZERO) |
| | | &&Constants.equalsInteger(i.getSendacopy(),Constants.ZERO) |
| | | &&StringUtils.equals(i.getParam2(),"0") |
| | | ).count() |
| | | ); |
| | | internalHomeVO.setNoticeDealNum( |
| | |
| | | * @param tempType 模板类型 0非施工人员访客申请 1施工人员访客申请 2访客报备 3公车市内用车 4公车室外用车 5市公司物流车预约 |
| | | * @param businessId 业务主键 根据 tempType |
| | | * @param createMemberId 提交流程人员 |
| | | * @param applyMember 申请人对象(如果为空,默认为提交人) |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = {Exception.class,BusinessException.class}) |
| | | public void createApproveFlow(Integer tempType,Integer businessId,Integer createMemberId){ |
| | | public void createApproveFlow(Integer tempType,Integer businessId,Integer createMemberId,Member applyMember){ |
| | | //查询处理模板 |
| | | ApproveTempl approveTempl = approveTemplMapper.selectOne(new QueryWrapper<ApproveTempl>().lambda() |
| | | .eq(ApproveTempl::getType,tempType) |
| | |
| | | } |
| | | List<ApproveParam> approveCopyList = approveParamAllList.stream().filter(i->i.getType().equals(Constants.ONE)).collect(Collectors.toList()); |
| | | |
| | | Member createMember = memberMapper.selectById(createMemberId); |
| | | Member createMember = memberMapper.selectById(createMemberId); |
| | | if(Objects.isNull(createMember)|| Objects.isNull(createMember.getCompanyId())){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"申请人组织信息异常"); |
| | | } |
| | | List<Approve> approveList = new ArrayList<>(); |
| | | |
| | | this.organizeApproveData(approveTempl,approveParamList,createMember,businessId,approveList); |
| | | |
| | | this.organizeApproveData(approveTempl,approveParamList,createMember,applyMember,businessId,approveList); |
| | | if(CollectionUtils.isEmpty(approveList)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"审批流配置错误"); |
| | | } |
| | | |
| | | //处理抄送数据 |
| | | if(CollectionUtils.isNotEmpty(approveCopyList)){ |
| | | this.organizeApproveCopyData(approveTempl,approveCopyList,businessId,approveList); |
| | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = {Exception.class,BusinessException.class}) |
| | | public void createApproveForPlatfrom(Integer tempId,Integer businessId,Integer createMemberId){ |
| | | public void createApproveForPlatfrom(Integer tempId,Integer businessId,Integer createMemberId ){ |
| | | //查询处理模板 |
| | | ApproveTempl approveTempl = approveTemplMapper.selectById(tempId); |
| | | if(Objects.isNull(approveTempl)){ |
| | |
| | | } |
| | | List<Approve> approveList = new ArrayList<>(); |
| | | |
| | | this.organizeApproveData(approveTempl,approveParamList,createMember,businessId,approveList); |
| | | this.organizeApproveData(approveTempl,approveParamList,createMember,null,businessId,approveList); |
| | | |
| | | if(CollectionUtils.isEmpty(approveList)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"审批流配置错误"); |
| | |
| | | * @param businessId |
| | | * @param approveList |
| | | */ |
| | | public void organizeApproveData(ApproveTempl approveTempl,List<ApproveParam> approveParamList,Member createMember,Integer businessId,List<Approve> approveList){ |
| | | public void organizeApproveData(ApproveTempl approveTempl,List<ApproveParam> approveParamList,Member createMember,Member applyMember,Integer businessId,List<Approve> approveList){ |
| | | |
| | | if(applyMember ==null){ |
| | | applyMember = createMember; |
| | | } |
| | | //创建默认人信息 |
| | | Approve createUserApprove = new Approve(); |
| | | createUserApprove.setRemark("发起申请"); |
| | | createUserApprove.setCreateDate(new Date()); |
| | | createUserApprove.setIsdeleted(Constants.ZERO); |
| | | createUserApprove.setTemplatId(approveTempl.getId()); |
| | | createUserApprove.setChekorId(createMember.getId()); |
| | | createUserApprove.setChekorId(applyMember.getId()); |
| | | createUserApprove.setCheckDate(createUserApprove.getCreateDate()); |
| | | createUserApprove.setStatus(Constants.approveStatus.pass); |
| | | createUserApprove.setTitle("发起申请"); |
| | |
| | | approveList.add(createUserApprove); |
| | | |
| | | //查询所有待处理人 |
| | | String token = systemDictDataBiz.queryByCode(Constants.WX_PLATFORM,Constants.WX_PLATFORM_ACCESS_TOKEN).getCode(); |
| | | // String token = systemDictDataBiz.queryByCode(Constants.WX_PLATFORM,Constants.WX_PLATFORM_ACCESS_TOKEN).getCode(); |
| | | //审批业务数据 |
| | | for (int i = 0; i < approveParamList.size(); i++) { |
| | | ApproveParam approveParam = approveParamList.get(i); |
| | |
| | | title = this.createNoticesData(noticeType,businessId,title,jsonMap); |
| | | } |
| | | if(j==0){ |
| | | //默认生成一条 申请人的数据 标记删除状态用于处理到 任务中心(我发起)使用 |
| | | Notices notices = new Notices(); |
| | | notices.setCreateDate(new Date()); |
| | | notices.setIsdeleted(Constants.ONE); |
| | | notices.setObjId(businessId); |
| | | notices.setObjType(noticeType); |
| | | notices.setType(noticeType); |
| | | notices.setTitle(title); |
| | | notices.setParam1(JSONObject.toJSONString(jsonMap)); |
| | | notices.setStatus(Constants.ZERO); |
| | | notices.setReaded(Constants.ZERO); |
| | | notices.setSendacopy(Constants.ZERO); |
| | | notices.setParam2("0"); |
| | | notices.setParam3(createMember.getId().toString()); |
| | | notices.setInfo("处理中"); |
| | | noticesJoinMapper.insert(notices); |
| | | //访客人员不生成此记录 |
| | | if(!(Constants.equalsInteger(noticeType,Constants.noticesObjectType.visit)&&Constants.equalsInteger(applyMember.getType(),Constants.ONE))){ |
| | | //默认生成一条 申请人的数据 标记删除状态用于处理到 任务中心(我发起)使用 |
| | | Notices notices = new Notices(); |
| | | notices.setCreateDate(new Date()); |
| | | notices.setIsdeleted(Constants.ONE); |
| | | notices.setObjId(businessId); |
| | | notices.setObjType(noticeType); |
| | | notices.setType(noticeType); |
| | | notices.setTitle(title); |
| | | notices.setParam1(JSONObject.toJSONString(jsonMap)); |
| | | notices.setStatus(Constants.ZERO); |
| | | notices.setReaded(Constants.ZERO); |
| | | notices.setSendacopy(Constants.ZERO); |
| | | notices.setParam2("0"); |
| | | notices.setParam3(createMember.getId().toString()); |
| | | notices.setInfo("处理中"); |
| | | noticesJoinMapper.insert(notices); |
| | | } |
| | | } |
| | | if(CollectionUtils.isEmpty(memberList)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"未查询到审批人信息"); |
| | |
| | | wxPlatNotice.sendPlatformBookTemplateNotice(systemDictDataBiz, |
| | | wxNoticeConfigMapper, |
| | | platformBooksMapper.selectById(businessId), |
| | | WxPlatConstants.platformBookContent.platformBookWaitAudit, |
| | | token, |
| | | WxPlatConstants.platformBookContent.platformBookWaitAudit, |
| | | Arrays.asList(member.getSystemOpenid().split(",")), |
| | | Constants.ONE); |
| | | } |
| | |
| | | if(StringUtils.isNotBlank(member.getSystemOpenid())){ |
| | | wxPlatNotice.sendVisitTemplateNotice(systemDictDataBiz, |
| | | wxNoticeConfigMapper,visitsMapper.selectById(businessId), WxPlatConstants.visitContent.visitWaitAudit, |
| | | token, |
| | | Arrays.asList(member.getSystemOpenid().split(",")) |
| | | ); |
| | | } |
| | |
| | | if(StringUtils.isNotBlank(member.getSystemOpenid())){ |
| | | wxPlatNotice.sendVisitTemplateNotice(systemDictDataBiz, |
| | | wxNoticeConfigMapper,visitsMapper.selectById(businessId), WxPlatConstants.visitReportContent.visitReportWaitAudit, |
| | | token, |
| | | Arrays.asList(member.getSystemOpenid().split(",")) |
| | | ); |
| | | } |
| | |
| | | wxNoticeConfigMapper, |
| | | carUseBookMapper.selectById(businessId), |
| | | WxPlatConstants.carUseBookContent.carUseBookWaitAudit, |
| | | token, |
| | | Arrays.asList(member.getSystemOpenid().split(",")), |
| | | Constants.ONE); |
| | | } |
| | |
| | | if(Constants.equalsInteger(noticeType,Constants.noticesObjectType.visit) |
| | | || Constants.equalsInteger(noticeType,Constants.noticesObjectType.visitReporting)){ |
| | | //访客记录与访客报备 |
| | | Visits visits = visitsJoinMapper.selectJoinOne(Visits.class, |
| | | Visits visits = visitsMapper.selectJoinOne(Visits.class, |
| | | new MPJLambdaWrapper<Visits>().selectAll(Visits.class) |
| | | .selectAs(Member::getName,Visits::getReceptMemberName) |
| | | .selectAs(Company::getName,Visits::getReceptMemberDepartment) |
| | |
| | | if(Objects.isNull(platformBooks)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"未查询到业务数据信息"); |
| | | } |
| | | title = "[物流车入园预约]申请人-" + platformBooks.getDriverName(); |
| | | jsonMap.put("inType", "入库类型:"+(Constants.equalsInteger(platformBooks.getInType(),Constants.ZERO)?"整托盘":"件烟")); |
| | | jsonMap.put("totalNum", "总运输量:"+platformBooks.getTotalNum()+"万支"); |
| | | jsonMap.put("arriveDate", "到场时间:" + DateUtil.DateToStr(platformBooks.getArriveDate() , "yyyy-MM-dd HH:mm")); |
| | | jsonMap.put("carNum", "车牌照:"+platformBooks.getCarCodeFront()); |
| | | title = ApproveServiceImpl.creatPlatformBookNotice(platformBooks,jsonMap); |
| | | // title = "[物流车入园预约]申请人-" + platformBooks.getDriverName(); |
| | | // jsonMap.put("inType", "入库类型:"+(Constants.equalsInteger(platformBooks.getInType(),Constants.ZERO)?"整托盘":"件烟")); |
| | | // jsonMap.put("totalNum", "总运输量:"+platformBooks.getTotalNum()+"万支"); |
| | | // jsonMap.put("arriveDate", "到场时间:" + DateUtil.DateToStr(platformBooks.getArriveDate() , "yyyy-MM-dd HH:mm")); |
| | | // jsonMap.put("carNum", "车牌照:"+platformBooks.getCarCodeFront()); |
| | | } |
| | | return title; |
| | | } |
| | | |
| | | public static String creatPlatformBookNotice(PlatformBooks platformBooks,Map<String,Object> jsonMap){ |
| | | jsonMap.put("inType", "作业类型:"+(Constants.equalsInteger(platformBooks.getInType(),Constants.ZERO)?"整托盘":"件烟")); |
| | | jsonMap.put("totalNum", "总运输量:"+platformBooks.getTotalNum()+"万支"); |
| | | jsonMap.put("arriveDate", "到场时间:" + DateUtil.DateToStr(platformBooks.getArriveDate() , "yyyy-MM-dd HH:mm")); |
| | | jsonMap.put("carNum", "车牌照:"+platformBooks.getCarCodeFront()); |
| | | return "[物流车入园预约]申请人-" + platformBooks.getDriverName() ; |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | || Objects.isNull(approveDTO.getLoginUserInfo())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | if(approveDTO.getStatus().equals(Constants.THREE)&&StringUtils.isBlank(approveDTO.getCheckInfo())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"请输入拒绝说明"); |
| | | if(!(Constants.equalsInteger(approveDTO.getObjType(),Constants.THREE)||Constants.equalsInteger(approveDTO.getObjType(),Constants.FOUR))){ |
| | | if(approveDTO.getStatus().equals(Constants.THREE)&&StringUtils.isBlank(approveDTO.getCheckInfo())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"请输入拒绝说明"); |
| | | } |
| | | } |
| | | Approve approve = approveMapper.selectOne(new QueryWrapper<Approve>() |
| | | .lambda() |
| | |
| | | .set(Notices::getInfo,"已拒绝") |
| | | .eq(Notices::getObjId,notices.getObjId()) |
| | | .eq(Notices::getObjType,notices.getObjType()) |
| | | .eq(Notices::getReaded,Constants.ZERO) |
| | | // .eq(Notices::getReaded,Constants.ZERO) |
| | | .ne(Notices::getId,notices.getId()) |
| | | ); |
| | | } |
| | |
| | | wxNoticeConfigMapper, |
| | | platformBooksMapper.selectById(approveDTO.getObjId()), |
| | | WxPlatConstants.platformBookContent.platformBookWaitAudit, |
| | | systemDictDataBiz.queryByCode(Constants.WX_PLATFORM,Constants.WX_PLATFORM_ACCESS_TOKEN).getCode(), |
| | | openIdList, |
| | | Constants.ONE); |
| | | } |
| | |
| | | //发送微信公众号通知 |
| | | wxPlatNotice.sendCarUseBookTemplateNotice(systemDictDataBiz, |
| | | wxNoticeConfigMapper,carUseBook, |
| | | WxPlatConstants.carUseBookContent.carUseBookWaitAudit, |
| | | systemDictDataBiz.queryByCode(Constants.WX_PLATFORM,Constants.WX_PLATFORM_ACCESS_TOKEN).getCode(), |
| | | WxPlatConstants.carUseBookContent.carUseBookWaitAudit, |
| | | openIdList,1); |
| | | } |
| | | } |
| | |
| | | wxPlatNotice.sendVisitTemplateNotice(systemDictDataBiz, |
| | | wxNoticeConfigMapper,visitsMapper.selectById(approveDTO.getObjId()), |
| | | approveDTO.getObjType().equals(Constants.approveObjectType.visitReporting)?WxPlatConstants.visitReportContent.visitReportWaitAudit:WxPlatConstants.visitContent.visitWaitAudit, |
| | | systemDictDataBiz.queryByCode(Constants.WX_PLATFORM,Constants.WX_PLATFORM_ACCESS_TOKEN).getCode(), |
| | | openIdList |
| | | ); |
| | | } |
| | |
| | | SmsConstants.visitContent.visitAuditFail, |
| | | approveDTO.getCheckInfo(),null |
| | | ); |
| | | if(Constants.equalsInteger(approveDTO.getStatus(),Constants.TWO)){ |
| | | SmsEmailServiceImpl.sendVisitSms(systemDictDataBiz, |
| | | emayService,smsEmailMapper,smsConfigMapper,visitsMapper,visits.getId(), |
| | | SmsConstants.visitContent.visitAuditSuccessToVisiter, |
| | | approveDTO.getCheckInfo(),null |
| | | ); |
| | | } |
| | | objCode = Constants.equalsInteger(approveDTO.getStatus(),Constants.TWO)? WxPlatConstants.visitContent.visitAuditSuccess: |
| | | WxPlatConstants.visitContent.visitAuditFail; |
| | | } |
| | |
| | | if(Objects.nonNull(visits) && StringUtils.isNotBlank(visits.getOpenid())){ |
| | | wxPlatNotice.sendVisitTemplateNotice(systemDictDataBiz, |
| | | wxNoticeConfigMapper,visits, objCode, |
| | | systemDictDataBiz.queryByCode(Constants.WX_PLATFORM,Constants.WX_PLATFORM_ACCESS_TOKEN).getCode(), |
| | | Arrays.asList(visits.getOpenid().split(",")) |
| | | ); |
| | | } |
| | |
| | | wxPlatNotice.sendCarUseBookTemplateNotice(systemDictDataBiz, |
| | | wxNoticeConfigMapper,carUseBook, |
| | | Constants.equalsInteger(approveDTO.getStatus(),Constants.TWO)?WxPlatConstants.carUseBookContent.carUseBookAuditSuccess: WxPlatConstants.carUseBookContent.carUseBookAuditFail, |
| | | systemDictDataBiz.queryByCode(Constants.WX_PLATFORM,Constants.WX_PLATFORM_ACCESS_TOKEN).getCode(), |
| | | Arrays.asList(systemUser.getOpenid().split(",")),0); |
| | | } |
| | | } |
| | |
| | | if(Objects.nonNull(driver) && StringUtils.isNotBlank(driver.getOpenid())){ |
| | | //发送微信公众号通知 |
| | | wxPlatNotice.sendPlatformBookTemplateNotice(systemDictDataBiz, |
| | | wxNoticeConfigMapper,platformBooks, |
| | | wxNoticeConfigMapper, platformBooks, |
| | | Constants.equalsInteger(approveDTO.getStatus(),Constants.TWO)?WxPlatConstants.platformBookContent.platformBookAuditSuccess: WxPlatConstants.platformBookContent.platformBookAuditFail, |
| | | systemDictDataBiz.queryByCode(Constants.WX_PLATFORM,Constants.WX_PLATFORM_ACCESS_TOKEN).getCode(), |
| | | Arrays.asList(driver.getOpenid().split(",")),0); |
| | | } |
| | | |