| | |
| | | import com.doumee.biz.system.SystemDictDataBiz; |
| | | import com.doumee.core.constants.ResponseStatus; |
| | | import com.doumee.core.exception.BusinessException; |
| | | import com.doumee.core.haikang.model.HKConstants; |
| | | import com.doumee.core.haikang.model.param.BaseResponse; |
| | | import com.doumee.core.haikang.model.param.request.CarChargeAddRequest; |
| | | import com.doumee.core.haikang.service.HKService; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.utils.Constants; |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.doumee.service.business.impl.hksync.HkSyncParkServiceImpl; |
| | | import com.doumee.service.business.impl.hksync.fhk.HkSyncVehicleFromHKServiceImpl; |
| | | import com.doumee.service.system.NoticesService; |
| | | import com.github.xiaoymin.knife4j.core.util.CollectionUtils; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | |
| | | private PlatformJobMapper platformJobMapper; |
| | | @Autowired |
| | | private PlatformLogMapper platformLogMapper; |
| | | @Autowired |
| | | private PlatformReasonMapper platformReasonMapper; |
| | | |
| | | |
| | | @Autowired |
| | | private ParksMapper parksMapper; |
| | | |
| | | @Autowired |
| | | private ParkBookMapper parkBookMapper; |
| | | |
| | | |
| | | @Override |
| | |
| | | List<String> memberNameList =memberList.stream().map(m->m.getName()).collect(Collectors.toList()); |
| | | String memberNames = String.join(",",memberNameList); |
| | | Integer noticeType = Constants.approveTypeToNoticeType(approveTempl.getType()); |
| | | String title = "【访客申请】申请人 - "; |
| | | String title = "[访客申请]申请人-"; |
| | | Map<String,Object> jsonMap = new HashMap<>(); |
| | | for (int j = 0; j < memberList.size(); j++) { |
| | | Member member = memberList.get(j); |
| | |
| | | approve.setTemplatId(approveTempl.getId()); |
| | | approve.setChekorId(memberId); |
| | | approve.setStatus(i==0?Constants.ONE:Constants.ZERO); |
| | | approve.setStatusInfo(i==0?"审批中":"待审批"); |
| | | approve.setTitle("审批人"); |
| | | approve.setStatusInfo(i==0?"审批中":"处理中"); |
| | | approve.setTitle(StringUtils.isBlank(approveParam.getRemark())?"审批中":approveParam.getRemark()); |
| | | approve.setIsEndCheck((i+1) == approveParamList.size()?Constants.ONE:Constants.ZERO); |
| | | approve.setObjId(businessId); |
| | | approve.setLevel(i+1); |
| | |
| | | if(Constants.equalsInteger(noticeType,Constants.noticesObjectType.visit)){ |
| | | title = title + visits.getName(); |
| | | }else{ |
| | | title = "【访客报备】申请人 - " + visits.getName(); |
| | | title = "[访客报备]申请人-" + visits.getName(); |
| | | } |
| | | jsonMap.put("name", "访问人:" + visits.getCompanyName() + " - " + visits.getReceptMemberName()); |
| | | jsonMap.put("sTime", "入园时间:" + DateUtil.DateToStr(visits.getStarttime() , "yyyy-MM-dd HH:mm")); |
| | |
| | | if(Objects.isNull(carUseBook)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"未查询到业务数据信息"); |
| | | } |
| | | title = "【用车申请】申请人 - " + carUseBook.getMemberName(); |
| | | title = "[用车申请]申请人-" + carUseBook.getMemberName(); |
| | | jsonMap.put("name", "申请人:" + carUseBook.getCompanyName() + " - " + carUseBook.getMemberName()); |
| | | jsonMap.put("sTime", "开始时间:" + DateUtil.DateToStr(carUseBook.getStartTime() , "yyyy-MM-dd HH:mm")); |
| | | jsonMap.put("eTime", "结束时间:" + DateUtil.DateToStr(carUseBook.getEndTime() , "yyyy-MM-dd HH:mm")); |
| | |
| | | if(Objects.isNull(platformBooks)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"未查询到业务数据信息"); |
| | | } |
| | | title = "【物流车入园预约】申请人 - " + platformBooks.getDriverName(); |
| | | 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")); |
| | |
| | | private List<Approve> getLevelInfoFromList(Approve level,List<Approve> approveGroupList) { |
| | | List<Approve> list = new ArrayList<>(); |
| | | if(Constants.equalsInteger(level.getApproveType(),Constants.TWO)){ |
| | | level.setApproveType(Constants.ZERO); |
| | | level.setApproveType(Constants.TWO); |
| | | //如果是单人审批 |
| | | list.add(level); |
| | | return list; |
| | |
| | | waitModel.setType(Constants.ZERO); |
| | | waitModel.setTitle(StringUtils.defaultString(level.getTitle(),"审批人")); |
| | | waitModel.setStatus(Constants.equalsInteger(waitList.get(Constants.ZERO).getStatus(),Constants.ONE)?Constants.ONE:Constants.ZERO); |
| | | waitModel.setStatusInfo("处理中"); |
| | | if(Constants.equalsInteger(level.getStatus(),Constants.approveStatus.auditIng) |
| | | ||Constants.equalsInteger(level.getStatus(),Constants.approveStatus.pass)){ |
| | | waitModel.setMemberName(waitList.size() +"人会签"); |
| | | if(Constants.equalsInteger(waitModel.getStatus(),Constants.approveStatus.wait)){ |
| | | waitModel.setStatusInfo("待处理"); |
| | | }else if(Constants.equalsInteger(waitModel.getStatus(),Constants.approveStatus.auditIng)){ |
| | | waitModel.setStatusInfo("处理中"); |
| | | } |
| | | |
| | | waitModel.setMemberName(waitList.size() +"人会签"); |
| | | // if(Constants.equalsInteger(level.getStatus(),Constants.approveStatus.auditIng) |
| | | // ||Constants.equalsInteger(level.getStatus(),Constants.approveStatus.pass)){ |
| | | // waitModel.setMemberName(waitList.size() +"人会签"); |
| | | // } |
| | | if(CollectionUtils.isNotEmpty(waitList)){ |
| | | waitModel.setCreateDate(waitList.get(Constants.ZERO).getCreateDate()); |
| | | } |
| | |
| | | }else { |
| | | if((waitList.size()> 0 || otherPassList.size()>0)){ |
| | | Approve waitModel = new Approve(); |
| | | waitModel.setApproveType(Constants.ONE); |
| | | waitModel.setApproveType(Constants.ZERO); |
| | | if(Constants.equalsInteger(level.getStatus(),Constants.approveStatus.pass)){ |
| | | waitModel.setStatus(Constants.approveStatus.pass); |
| | | waitModel.setStatus(level.getStatus()); |
| | | waitModel.setType(Constants.ONE); |
| | | waitModel.setTitle("审批人(抄送或签审批人)"); |
| | | }else{ |
| | | waitModel.setStatus(level.getStatus()); |
| | | waitModel.setType(Constants.ZERO); |
| | | waitModel.setStatusInfo(passList.size()<=0?StringUtils.defaultString(level.getTitle(),"审批人"):"抄送或签审批人"); |
| | | waitModel.setStatus(passList.size()>0?Constants.ONE:Constants.ZERO); |
| | | //waitModel.setStatusInfo(passList.size()<=0?StringUtils.defaultString(level.getTitle(),"审批人"):"抄送或签审批人"); |
| | | waitModel.setTitle(passList.size()<=0?StringUtils.defaultString(level.getTitle(),"审批人"):"抄送或签审批人"); |
| | | |
| | | } |
| | | List<Approve> approveList = new ArrayList<>(); |
| | | approveList.addAll(waitList); |
| | |
| | | if(Constants.equalsInteger(waitModel.getStatus(),Constants.approveStatus.pass)){ |
| | | waitModel.setMemberName("已抄送"+ approveList.size() +"人"); |
| | | }else if(Constants.equalsInteger(waitModel.getStatus(),Constants.approveStatus.wait)){ |
| | | waitModel.setMemberName("处理中"); |
| | | waitModel.setMemberName(waitList.size() +"人或签"); |
| | | waitModel.setStatusInfo("待处理"); |
| | | }else{ |
| | | waitModel.setMemberName(waitList.size() +"人或签"); |
| | | waitModel.setStatusInfo("处理中"); |
| | | } |
| | | waitModel.setApproveList(approveList); |
| | | list.add(waitModel); |
| | |
| | | return Constants.ZERO; |
| | | } |
| | | |
| | | @Override |
| | | public String getApproveUserName(Integer businessId,Integer businessType){ |
| | | List<Approve> approveList = approveJoinMapper.selectJoinList(Approve.class,new MPJLambdaWrapper<Approve>() |
| | | .selectAll(Approve.class) |
| | | .selectAs(Member::getName,Approve::getMemberName) |
| | | .leftJoin(Member.class,Member::getId,Approve::getChekorId) |
| | | .eq(Approve::getObjId,businessId) |
| | | .eq(Approve::getObjType,businessType) |
| | | .eq(Approve::getType,Constants.ZERO) |
| | | .eq(Approve::getStatus,Constants.approveStatus.auditIng) |
| | | ); |
| | | if(CollectionUtils.isNotEmpty(approveList)){ |
| | | List<String> names = approveList.stream().map(m->m.getMemberName()).collect(Collectors.toList()); |
| | | return String.join(",",names); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | noticesJoinMapper.update(null,new UpdateWrapper<Notices>().lambda() |
| | | .set(Notices::getEditDate,new Date()) |
| | | .set(Notices::getParam4,approveDTO.getLoginUserInfo().getMemberId()) |
| | | .set(Notices::getInfo,"审批未通过") |
| | | .set(Notices::getInfo,"已拒绝") |
| | | .set(Notices::getReaded,Constants.ONE) |
| | | .set(Notices::getParam2,Constants.TWO) |
| | | .set(Notices::getStatus,Constants.ONE) |
| | |
| | | .set(Notices::getSendacopy,Constants.ONE) |
| | | .set(Notices::getStatus,Constants.ONE) |
| | | .set(Notices::getParam2,Constants.TWO) |
| | | .set(Notices::getInfo,"审批未通过") |
| | | .set(Notices::getInfo,"已拒绝") |
| | | .eq(Notices::getObjId,notices.getObjId()) |
| | | .eq(Notices::getObjType,notices.getObjType()) |
| | | .eq(Notices::getReaded,Constants.ZERO) |
| | |
| | | if(Objects.nonNull(visits)){ |
| | | if(Constants.equalsInteger(visits.getStatus(),Constants.ZERO)){ |
| | | visitsMapper.update(null,new UpdateWrapper<Visits>().lambda().set(Visits::getStatus,Constants.ONE).eq(Visits::getId,visits.getId())); |
| | | }else{ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"未查询到业务数据对象!请刷新重试"); |
| | | } |
| | | } |
| | | |
| | |
| | | .set(Notices::getEditDate,new Date()) |
| | | .set(Notices::getReaded,Constants.ONE) |
| | | .set(Notices::getStatus,Constants.ONE) |
| | | .set(Notices::getInfo,Constants.equalsInteger(approveDTO.getStatus(),Constants.TWO)?"已通过":"已拒绝") |
| | | .set(dealBusinessBean,Notices::getParam2,Constants.ONE) |
| | | .set(Notices::getParam4,approveDTO.getLoginUserInfo().getMemberId()) |
| | | .eq(Notices::getId,notices.getId()) |
| | |
| | | String info = ""; |
| | | List<String> memberNameList = Arrays.asList(memberNames.split(",")); |
| | | if(Constants.equalsInteger(memberNameList.size(),Constants.ONE)){ |
| | | info = "待 "+memberNameList.get(0)+" 处理中"; |
| | | info = "待"+memberNameList.get(0)+"处理中"; |
| | | }else{ |
| | | info = "待 "+memberNameList.get(0)+" 等"+memberNameList.size()+"人处理中"; |
| | | info = "待"+memberNameList.get(0)+"等"+memberNameList.size()+"人处理中"; |
| | | } |
| | | //更新该业务数据的所有记录信息 |
| | | noticesJoinMapper.update(null,new UpdateWrapper<Notices>().lambda() |
| | | .set(!dealBusinessBean,Notices::getInfo,info) |
| | | .set(dealBusinessBean,Notices::getInfo,"审批通过") |
| | | .set(dealBusinessBean,Notices::getInfo,"已通过") |
| | | .set(Notices::getParam5,memberNames) |
| | | .eq(Notices::getObjId,notices.getObjId()) |
| | | .eq(Notices::getObjType,notices.getObjType())); |
| | |
| | | copyNotices.setEditDate(new Date()); |
| | | copyNotices.setParam2("2"); |
| | | copyNotices.setParam3(""); |
| | | copyNotices.setInfo("审批通过"); |
| | | copyNotices.setInfo("已通过"); |
| | | copyNotices.setUserId(copyApprove.getChekorId()); |
| | | copyNotices.setStatus(Constants.ZERO); |
| | | copyNotices.setSendacopy(Constants.ONE); |
| | |
| | | notices.setParam5(memberNames); |
| | | notices.setRemark(nextDealApprove.getMemberName()); |
| | | if(Constants.equalsInteger(memberNameList.size(),Constants.ONE)){ |
| | | notices.setInfo("待 "+memberNameList.get(0)+" 处理中"); |
| | | notices.setInfo("待"+memberNameList.get(0)+"处理中"); |
| | | }else{ |
| | | notices.setInfo("待 "+memberNameList.get(0)+" 等"+memberNameList.size()+"人处理中"); |
| | | notices.setInfo("待"+memberNameList.get(0)+"等"+memberNameList.size()+"人处理中"); |
| | | } |
| | | noticesJoinMapper.insert(newNotices); |
| | | } |
| | | return memberNames; |
| | | } |
| | | |
| | | |
| | | |
| | | public void dealBusinessData(ApproveDTO approveDTO,Approve approve){ |
| | | if(approveDTO.getObjType().equals(Constants.approveObjectType.unConstructionVisit) |
| | |
| | | visits.setStatus(approveDTO.getStatus()); |
| | | visits.setEditDate(new Date()); |
| | | visits.setEditor(approveDTO.getLoginUserInfo().getMemberId()); |
| | | //下发访客报备车辆信息 |
| | | |
| | | if(approveDTO.getObjType().equals(Constants.approveObjectType.visitReporting)){ |
| | | Boolean sendStatus = true; |
| | | //查询当前启用的停车场 |
| | | List<Parks> parksList = parksMapper.selectList(new QueryWrapper<Parks>() |
| | | .lambda() |
| | | .isNotNull(Parks::getHkId) |
| | | .eq(Parks::getIsdeleted,Constants.ZERO)); |
| | | List<ParkBook> parkBookList = new ArrayList<>(); |
| | | if(CollectionUtils.isNotEmpty(parksList)){ |
| | | for (Parks parks:parksList) { |
| | | ParkBook parkBook = new ParkBook(); |
| | | parkBook.setIsdeleted(Constants.ZERO); |
| | | parkBook.setCreateDate(new Date()); |
| | | parkBook.setVisitId(visits.getId()); |
| | | parkBook.setCarCode(visits.getCarNos()); |
| | | parkBook.setParkId(parks.getId()); |
| | | parkBook.setOrigin(Constants.TWO); |
| | | parkBook.setStartTime(visits.getStarttime()); |
| | | parkBook.setEndTime(visits.getEndtime()); |
| | | parkBook.setMemberId( visits.getMemberId()); |
| | | parkBook.setTimeType(Constants.ONE); |
| | | parkBook.setParkHkId(parks.getHkId()); |
| | | |
| | | CarChargeAddRequest param = new CarChargeAddRequest(); |
| | | param.setPlateNo(parkBook.getCarCode()); |
| | | param.setParkSyscode(parkBook.getParkHkId()); |
| | | param.setStartTime(Objects.isNull(parkBook.getStartTime())?DateUtil.getDate(new Date(),"yyyy-MM-dd"):DateUtil.getShortTimeToNull(parkBook.getStartTime())); |
| | | param.setEndTime(Objects.isNull(parkBook.getEndTime())?"2999-12-31":DateUtil.getShortTimeToNull(parkBook.getEndTime())); |
| | | BaseResponse response = HKService.carChargeAddtion(param); |
| | | parkBook.setHkDate(new Date()); |
| | | if(response!=null |
| | | && StringUtils.equals(response.getCode(), HKConstants.RESPONSE_SUCCEE)){ |
| | | parkBook.setHkStatus(Constants.ONE); |
| | | parkBook.setRemark("包期成功"); |
| | | }else{ |
| | | parkBook.setHkStatus(Constants.TWO); |
| | | parkBook.setRemark("包期失败~"); |
| | | //下发失败 标记主业务状态为下发失败 |
| | | sendStatus = false; |
| | | } |
| | | parkBookList.add(parkBook); |
| | | } |
| | | parkBookMapper.insert(parkBookList); |
| | | } |
| | | if(sendStatus){ |
| | | visits.setStatus(Constants.VisitStatus.xfFail); |
| | | }else{ |
| | | visits.setStatus(Constants.VisitStatus.xfSuccess); |
| | | } |
| | | } |
| | | |
| | | visitsMapper.updateById(visits); |
| | | }else if(approveDTO.getObjType().equals(Constants.approveObjectType.cityUseCar)||approveDTO.getObjType().equals( |
| | | Constants.approveObjectType.unCityUseCar)){ |
| | |
| | | platformBooks.setStatus(approveDTO.getStatus()); |
| | | platformBooks.setEditDate(new Date()); |
| | | platformBooks.setEditor(approveDTO.getLoginUserInfo().getMemberId()); |
| | | PlatformReason platformReason = platformReasonMapper.selectById(platformBooks.getReasonId()); |
| | | |
| | | //生成任务记录 |
| | | PlatformJob platformJob = platformBooks.toPlatformJob(); |
| | | platformJob.setPlatformGroupId(platformReason.getGroupId().intValue()); |
| | | platformJob.setType(Constants.platformJobType.sgscxh); |
| | | platformJob.setStatus(Constants.PlatformJobStatus.WART_SIGN_IN.getKey()); |
| | | platformJobMapper.insert(platformJob); |
| | | platformBooks.setJobId(platformJob.getId()); |
| | | platformBooksMapper.updateById(platformBooks); |
| | |
| | | platformLog.setCreateDate(new Date()); |
| | | platformLog.setJobId(platformJob.getId()); |
| | | platformLog.setIsdeleted(Constants.ZERO); |
| | | platformLog.setObjType(Constants.PlatformJobStatus.WART_SIGN_IN.getKey()); |
| | | platformLog.setParam4(platformJob.getCarCodeFront()); |
| | | platformLog.setContent(Constants.PlatformJobLogType.CREATE.getInfo()); |
| | | platformLog.setObjType(Constants.PlatformJobLogType.CREATE.getKey()); |
| | | platformLog.setObjId(platformJob.getId().toString()); |
| | | platformLog.setAfterContent(JSONObject.toJSONString(platformJob)); |
| | | platformLogMapper.insert(platformLog); |