|  |  |  | 
|---|
|  |  |  | 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.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.core.utils.Constants; | 
|---|
|  |  |  | import com.doumee.core.utils.DateUtil; | 
|---|
|  |  |  | import com.doumee.core.utils.SmsConstants; | 
|---|
|  |  |  | import com.doumee.core.utils.Utils; | 
|---|
|  |  |  | import com.doumee.dao.business.*; | 
|---|
|  |  |  | import com.doumee.dao.business.dao.CompanyMapper; | 
|---|
|  |  |  | import com.doumee.dao.business.dao.SmsEmailMapper; | 
|---|
|  |  |  | import com.doumee.dao.business.dto.ApproveDTO; | 
|---|
|  |  |  | import com.doumee.dao.business.join.ApproveJoinMapper; | 
|---|
|  |  |  | import com.doumee.dao.business.join.CarUseBookJoinMapper; | 
|---|
|  |  |  | 
|---|
|  |  |  | 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.doumee.service.business.third.EmayService; | 
|---|
|  |  |  | import com.github.xiaoymin.knife4j.core.util.CollectionUtils; | 
|---|
|  |  |  | import com.github.yulichang.wrapper.MPJLambdaWrapper; | 
|---|
|  |  |  | import io.swagger.models.auth.In; | 
|---|
|  |  |  | import javafx.application.Platform; | 
|---|
|  |  |  | import lombok.extern.slf4j.Slf4j; | 
|---|
|  |  |  | import org.apache.commons.lang3.StringUtils; | 
|---|
|  |  |  | import org.apache.xpath.operations.Bool; | 
|---|
|  |  |  | import org.springframework.beans.BeanUtils; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | import org.springframework.context.annotation.Bean; | 
|---|
|  |  |  | import org.springframework.stereotype.Service; | 
|---|
|  |  |  | import org.springframework.transaction.annotation.Transactional; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | private PlatformLogMapper platformLogMapper; | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private PlatformReasonMapper platformReasonMapper; | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private PlatformGroupMapper platformGroupMapper; | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private VisitParkMapper visitParkMapper; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private SmsConfigMapper smsConfigMapper; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private SmsEmailMapper smsEmailMapper; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private EmayService emayService; | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | 
|---|
|  |  |  | if(CollectionUtils.isNotEmpty(noticesList)){ | 
|---|
|  |  |  | //待我处理的数据 | 
|---|
|  |  |  | internalHomeVO.setNoticeWaitNum( | 
|---|
|  |  |  | noticesList.stream().filter(i->Constants.equalsInteger(i.getUserId(),memberId) | 
|---|
|  |  |  | noticesList.stream().filter(i-> | 
|---|
|  |  |  | Constants.equalsInteger(i.getUserId(),memberId) | 
|---|
|  |  |  | &&Constants.equalsInteger(i.getStatus(),Constants.ZERO) | 
|---|
|  |  |  | &&Constants.equalsInteger(i.getSendacopy(),Constants.ZERO) | 
|---|
|  |  |  | ).count() | 
|---|
|  |  |  | ); | 
|---|
|  |  |  | //已处理数据 | 
|---|
|  |  |  | internalHomeVO.setNoticeDealNum( | 
|---|
|  |  |  | noticesList.stream().filter(i->Constants.equalsInteger(i.getUserId(),memberId) | 
|---|
|  |  |  | noticesList.stream().filter(i-> | 
|---|
|  |  |  | Constants.equalsInteger(i.getUserId(),memberId) | 
|---|
|  |  |  | &&StringUtils.equals(i.getParam4(),i.getUserId().toString()) | 
|---|
|  |  |  | &&Constants.equalsInteger(i.getStatus(),Constants.ONE) | 
|---|
|  |  |  | &&Constants.equalsInteger(i.getSendacopy(),Constants.ZERO) | 
|---|
|  |  |  | 
|---|
|  |  |  | 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) | 
|---|
|  |  |  | ).count() | 
|---|
|  |  |  | ); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | this.organizeApproveCopyData(approveTempl,approveCopyList,businessId,approveList); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | approveJoinMapper.insert(approveList); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | approve.setTemplatId(approveTempl.getId()); | 
|---|
|  |  |  | approve.setChekorId(memberId); | 
|---|
|  |  |  | approve.setStatus(i==0?Constants.ONE:Constants.ZERO); | 
|---|
|  |  |  | approve.setStatusInfo(i==0?"审批中":"处理中"); | 
|---|
|  |  |  | 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.setAddrParam(approveParam.getAddrParam()); | 
|---|
|  |  |  | approve.setType(Constants.ZERO); | 
|---|
|  |  |  | approveList.add(approve); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if(Constants.equalsInteger(approve.getStatus(),Constants.ONE) && StringUtils.isNotBlank(member.getPhone())){ | 
|---|
|  |  |  | //发送短信通知 | 
|---|
|  |  |  | if(Constants.equalsInteger(noticeType,Constants.noticesObjectType.reason)){ | 
|---|
|  |  |  | //物流车预约 | 
|---|
|  |  |  | SmsEmailServiceImpl.sendPlatformBookSms(systemDictDataBiz, | 
|---|
|  |  |  | emayService,smsEmailMapper,smsConfigMapper,platformBooksMapper,businessId, | 
|---|
|  |  |  | SmsConstants.platformBookContent.platformBookWaitAudit, | 
|---|
|  |  |  | null,Arrays.asList(member.getPhone().split(",")) | 
|---|
|  |  |  | ); | 
|---|
|  |  |  | }else if(Constants.equalsInteger(noticeType,Constants.noticesObjectType.visit)){ | 
|---|
|  |  |  | //访客申请 | 
|---|
|  |  |  | SmsEmailServiceImpl.sendVisitSms(systemDictDataBiz, | 
|---|
|  |  |  | emayService,smsEmailMapper,smsConfigMapper,visitsMapper,businessId, | 
|---|
|  |  |  | SmsConstants.visitContent.visitNotice, | 
|---|
|  |  |  | null,Arrays.asList(member.getPhone().split(",")) | 
|---|
|  |  |  | ); | 
|---|
|  |  |  | }else if(Constants.equalsInteger(noticeType,Constants.noticesObjectType.visitReporting)){ | 
|---|
|  |  |  | //访客报备 | 
|---|
|  |  |  | SmsEmailServiceImpl.sendVisitReportSms(systemDictDataBiz, | 
|---|
|  |  |  | emayService,smsEmailMapper,smsConfigMapper,visitsMapper,businessId, | 
|---|
|  |  |  | SmsConstants.visitReportingContent.visitReportingNotice, | 
|---|
|  |  |  | null,Arrays.asList(member.getPhone().split(",")) | 
|---|
|  |  |  | ); | 
|---|
|  |  |  | }else if(Constants.equalsInteger(noticeType,Constants.noticesObjectType.useCar)){ | 
|---|
|  |  |  | //用车申请 | 
|---|
|  |  |  | SmsEmailServiceImpl.sendCarUseSms(systemDictDataBiz, | 
|---|
|  |  |  | emayService,smsEmailMapper,smsConfigMapper,carUseBookMapper,businessId, | 
|---|
|  |  |  | SmsConstants.carUseBookContent.carUseBookWaitAudit, | 
|---|
|  |  |  | null,Arrays.asList(member.getPhone().split(",")) | 
|---|
|  |  |  | ); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | }else{ | 
|---|
|  |  |  | waitModel.setStatus(level.getStatus()); | 
|---|
|  |  |  | waitModel.setType(Constants.ZERO); | 
|---|
|  |  |  | //waitModel.setStatusInfo(passList.size()<=0?StringUtils.defaultString(level.getTitle(),"审批人"):"抄送或签审批人"); | 
|---|
|  |  |  | waitModel.setTitle(passList.size()<=0?StringUtils.defaultString(level.getTitle(),"审批人"):"抄送或签审批人"); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | .last(" limit 1") | 
|---|
|  |  |  | ); | 
|---|
|  |  |  | if(Objects.isNull(approve)){ | 
|---|
|  |  |  | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"未查询到审批数据"); | 
|---|
|  |  |  | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"申请已被他人审批"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if(!approve.getStatus().equals(Constants.ONE)){ | 
|---|
|  |  |  | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"审批记录状态错误!"); | 
|---|
|  |  |  | 
|---|
|  |  |  | .in(Approve::getId,approveList.stream().map(m->m.getId()).collect(Collectors.toList()))); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | /**开启下一级别的数据为待审核**/ | 
|---|
|  |  |  |  | 
|---|
|  |  |  | List<Approve> waitAuditList = approveJoinMapper.selectJoinList(Approve.class, | 
|---|
|  |  |  | new MPJLambdaWrapper<Approve>() | 
|---|
|  |  |  | .selectAll(Approve.class) | 
|---|
|  |  |  | .selectAs(Member::getPhone,Approve::getMemberPhone) | 
|---|
|  |  |  | .leftJoin(Member.class,Member::getId,Approve::getChekorId) | 
|---|
|  |  |  | .eq(Approve::getStatus,Constants.approveStatus.wait) | 
|---|
|  |  |  | .eq(Approve::getObjId,approve.getObjId()) | 
|---|
|  |  |  | .eq(Approve::getObjType,approve.getObjType()) | 
|---|
|  |  |  | .eq(Approve::getLevel,(approve.getLevel()+1))); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | approveJoinMapper.update(null,new UpdateWrapper<Approve>() | 
|---|
|  |  |  | .lambda() | 
|---|
|  |  |  | .set(Approve::getStatus,Constants.approveStatus.auditIng) | 
|---|
|  |  |  | 
|---|
|  |  |  | .eq(Approve::getObjType,approve.getObjType()) | 
|---|
|  |  |  | .eq(Approve::getLevel,(approve.getLevel()+1)) | 
|---|
|  |  |  | ); | 
|---|
|  |  |  | //发送短信通知  下级审批人 | 
|---|
|  |  |  | List<String> memberPhone = waitAuditList.stream().filter(i->StringUtils.isNotBlank(i.getMemberPhone())).map(i->i.getMemberPhone()).collect(Collectors.toList()); | 
|---|
|  |  |  | //物流车预约 | 
|---|
|  |  |  | if(approveDTO.getObjType().equals(Constants.approveObjectType.reason)){ | 
|---|
|  |  |  | SmsEmailServiceImpl.sendPlatformBookSms(systemDictDataBiz, | 
|---|
|  |  |  | emayService,smsEmailMapper,smsConfigMapper,platformBooksMapper,approveDTO.getObjId(), | 
|---|
|  |  |  | SmsConstants.platformBookContent.platformBookWaitAudit, | 
|---|
|  |  |  | approveDTO.getCheckInfo(),memberPhone | 
|---|
|  |  |  | ); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | else if(approveDTO.getObjType().equals(Constants.approveObjectType.cityUseCar) | 
|---|
|  |  |  | || approveDTO.getObjType().equals(Constants.approveObjectType.unCityUseCar)){ | 
|---|
|  |  |  | SmsEmailServiceImpl.sendCarUseSms(systemDictDataBiz, | 
|---|
|  |  |  | emayService,smsEmailMapper,smsConfigMapper,carUseBookMapper,approveDTO.getObjId(), | 
|---|
|  |  |  | SmsConstants.hiddenDangerContent.hiddenDangerDealUser, | 
|---|
|  |  |  | approveDTO.getCheckInfo(),memberPhone); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //访客申请/报备 | 
|---|
|  |  |  | if(approveDTO.getObjType().equals(Constants.approveObjectType.unConstructionVisit) | 
|---|
|  |  |  | ||approveDTO.getObjType().equals(Constants.approveObjectType.constructionVisit) | 
|---|
|  |  |  | ||approveDTO.getObjType().equals(Constants.approveObjectType.visitReporting)) { | 
|---|
|  |  |  | 
|---|
|  |  |  | visitsMapper.update(null,new UpdateWrapper<Visits>().lambda().set(Visits::getStatus,Constants.ONE).eq(Visits::getId,visits.getId())); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | }else if(approveDTO.getObjType().equals(Constants.approveObjectType.cityUseCar)||approveDTO.getObjType().equals( | 
|---|
|  |  |  | if(approveDTO.getObjType().equals(Constants.approveObjectType.cityUseCar)||approveDTO.getObjType().equals( | 
|---|
|  |  |  | Constants.approveObjectType.unCityUseCar)){ | 
|---|
|  |  |  | this.updDriver(approveDTO,approve,false); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | visits.setEditDate(new Date()); | 
|---|
|  |  |  | visits.setEditor(approveDTO.getLoginUserInfo().getMemberId()); | 
|---|
|  |  |  | //下发访客报备车辆信息 | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if(approveDTO.getObjType().equals(Constants.approveObjectType.visitReporting)){ | 
|---|
|  |  |  | if(Constants.equalsInteger(approveDTO.getStatus(),Constants.TWO)&&approveDTO.getObjType().equals(Constants.approveObjectType.visitReporting)){ | 
|---|
|  |  |  | Boolean sendStatus = true; | 
|---|
|  |  |  | //查询当前启用的停车场 | 
|---|
|  |  |  | List<Parks> parksList = parksMapper.selectList(new QueryWrapper<Parks>() | 
|---|
|  |  |  | 
|---|
|  |  |  | visitPark.setStartTime(visits.getStarttime()); | 
|---|
|  |  |  | visitPark.setEndTime(visits.getEndtime()); | 
|---|
|  |  |  | visitPark.setParkHkId(parks.getHkId()); | 
|---|
|  |  |  | visitPark.setObjType(Constants.ZERO); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | CarChargeAddRequest param = new CarChargeAddRequest(); | 
|---|
|  |  |  | param.setPlateNo(visitPark.getCarCode()); | 
|---|
|  |  |  | param.setParkSyscode(visitPark.getParkHkId()); | 
|---|
|  |  |  | param.setStartTime(Objects.isNull(visitPark.getStartTime())?DateUtil.getDate(new Date(),"yyyy-MM-dd"):DateUtil.getShortTimeToNull(visitPark.getStartTime())); | 
|---|
|  |  |  | param.setEndTime(Objects.isNull(visitPark.getEndTime())?"2999-12-31":DateUtil.getShortTimeToNull(visitPark.getEndTime())); | 
|---|
|  |  |  | BaseResponse response = HKService.carChargeAddtion(param); | 
|---|
|  |  |  | ParkReservationAddRequest request = new ParkReservationAddRequest(); | 
|---|
|  |  |  | request.setPlateNo(visitPark.getCarCode()); | 
|---|
|  |  |  | request.setParkSyscode(visitPark.getParkHkId()); | 
|---|
|  |  |  | request.setPhoneNo(visits.getPhone()); | 
|---|
|  |  |  | request.setOwner(visits.getName()); | 
|---|
|  |  |  | request.setAllowTimes(Constants.ONE+""); | 
|---|
|  |  |  | request.setIsCharge(Constants.ONE+""); | 
|---|
|  |  |  | request.setStartTime(Objects.isNull(visitPark.getStartTime())?DateUtil.getISO8601Timestamp2(new Date()):DateUtil.getISO8601Timestamp2(visitPark.getStartTime())); | 
|---|
|  |  |  | request.setEndTime(Objects.isNull(visitPark.getEndTime())?"2999-12-31T00:00:00+08:00":DateUtil.getISO8601Timestamp2(visitPark.getEndTime())); | 
|---|
|  |  |  | BaseResponse response =  HKService.parkReservationAddition(request); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | visitPark.setHkDate(new Date()); | 
|---|
|  |  |  | if(response!=null | 
|---|
|  |  |  | && StringUtils.equals(response.getCode(), HKConstants.RESPONSE_SUCCEE)){ | 
|---|
|  |  |  | ParkReservationAddResponse parkReservationAddResponse = (ParkReservationAddResponse) response.getData(); | 
|---|
|  |  |  | visitPark.setHkId(parkReservationAddResponse.getReserveOrderNo()); | 
|---|
|  |  |  | visitPark.setHkStatus(Constants.ONE); | 
|---|
|  |  |  | visitPark.setRemark("包期成功"); | 
|---|
|  |  |  | }else{ | 
|---|
|  |  |  | 
|---|
|  |  |  | sendStatus = false; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | parkBookList.add(visitPark); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | visitParkMapper.insert(parkBookList); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | visits.setStatus(Constants.VisitStatus.xfFail); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | //访客报备 | 
|---|
|  |  |  | if(approveDTO.getObjType().equals(Constants.approveObjectType.visitReporting)){ | 
|---|
|  |  |  | //发送短信通知 | 
|---|
|  |  |  | SmsEmailServiceImpl.sendVisitReportSms(systemDictDataBiz, | 
|---|
|  |  |  | emayService,smsEmailMapper,smsConfigMapper,visitsMapper,visits.getId(), | 
|---|
|  |  |  | Constants.equalsInteger(approveDTO.getStatus(),Constants.TWO)?SmsConstants.visitReportingContent.visitReportingAuditSuccess: | 
|---|
|  |  |  | SmsConstants.visitReportingContent.visitReportingAuditFail, | 
|---|
|  |  |  | approveDTO.getCheckInfo(),null | 
|---|
|  |  |  | ); | 
|---|
|  |  |  | }else{ //访客申请 | 
|---|
|  |  |  | //发送短信通知 | 
|---|
|  |  |  | SmsEmailServiceImpl.sendVisitSms(systemDictDataBiz, | 
|---|
|  |  |  | emayService,smsEmailMapper,smsConfigMapper,visitsMapper,visits.getId(), | 
|---|
|  |  |  | Constants.equalsInteger(approveDTO.getStatus(),Constants.TWO)?SmsConstants.visitContent.visitAuditSuccess: | 
|---|
|  |  |  | SmsConstants.visitContent.visitAuditFail, | 
|---|
|  |  |  | approveDTO.getCheckInfo(),null | 
|---|
|  |  |  | ); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | visitsMapper.updateById(visits); | 
|---|
|  |  |  | }else if(approveDTO.getObjType().equals(Constants.approveObjectType.cityUseCar)||approveDTO.getObjType().equals( | 
|---|
|  |  |  | Constants.approveObjectType.unCityUseCar)){ | 
|---|
|  |  |  | this.updDriver(approveDTO,approve,true); | 
|---|
|  |  |  | CarUseBook carUseBook = carUseBookJoinMapper.selectById(approveDTO.getObjId()); | 
|---|
|  |  |  | if(Objects.nonNull(carUseBook)){ | 
|---|
|  |  |  | Member member = memberMapper.selectById(carUseBook.getMemberId()); | 
|---|
|  |  |  | if(Objects.nonNull(member)&&StringUtils.isNotBlank(member.getPhone())){ | 
|---|
|  |  |  | SmsEmailServiceImpl.sendCarUseSms(systemDictDataBiz, | 
|---|
|  |  |  | emayService,smsEmailMapper,smsConfigMapper,carUseBookMapper,approveDTO.getObjId(), | 
|---|
|  |  |  | Constants.equalsInteger(approveDTO.getStatus(),Constants.TWO)?SmsConstants.carUseBookContent.carUseBookAuditSuccess: | 
|---|
|  |  |  | SmsConstants.carUseBookContent.carUseBookAuditFail, | 
|---|
|  |  |  | approveDTO.getCheckInfo(),Arrays.asList(member.getPhone().split(",")) | 
|---|
|  |  |  | ); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | }else if(approveDTO.getObjType().equals(Constants.approveObjectType.reason)){ | 
|---|
|  |  |  | //物流车预约 | 
|---|
|  |  |  | PlatformBooks platformBooks = platformBooksMapper.selectById(approveDTO.getObjId()); | 
|---|
|  |  |  | 
|---|
|  |  |  | 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 platformLog = new PlatformLog(); | 
|---|
|  |  |  | platformLog.setCreateDate(new Date()); | 
|---|
|  |  |  | platformLog.setJobId(platformJob.getId()); | 
|---|
|  |  |  | platformLog.setIsdeleted(Constants.ZERO); | 
|---|
|  |  |  | 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); | 
|---|
|  |  |  | if(Constants.equalsInteger(approveDTO.getStatus(),Constants.TWO)){ | 
|---|
|  |  |  | PlatformReason platformReason = platformReasonMapper.selectById(platformBooks.getReasonId()); | 
|---|
|  |  |  | if(Objects.isNull(platformReason)){ | 
|---|
|  |  |  | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"未查询到入园原因数据"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | PlatformGroup platformGroup = platformGroupMapper.selectById(platformReason.getGroupId()); | 
|---|
|  |  |  | if(Objects.isNull(platformGroup)){ | 
|---|
|  |  |  | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"未查询到入园原因配置月台组数据"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //生成任务记录 | 
|---|
|  |  |  | PlatformJob platformJob = platformBooks.toPlatformJob(); | 
|---|
|  |  |  | platformJob.setId(null); | 
|---|
|  |  |  | platformJob.setPlatformGroupId(platformReason.getGroupId().intValue()); | 
|---|
|  |  |  | if(Constants.equalsInteger(platformGroup.getType(),Constants.ZERO)){ | 
|---|
|  |  |  | platformJob.setType(Constants.platformJobType.wxcxh); | 
|---|
|  |  |  | }else if(Constants.equalsInteger(platformGroup.getType(),Constants.ONE)){ | 
|---|
|  |  |  | platformJob.setType(Constants.platformJobType.wxczh); | 
|---|
|  |  |  | }else{ | 
|---|
|  |  |  | platformJob.setType(Constants.platformJobType.sgscxh); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | platformJob.setStatus(Constants.PlatformJobStatus.WART_SIGN_IN.getKey()); | 
|---|
|  |  |  | platformJobMapper.insert(platformJob); | 
|---|
|  |  |  | platformBooks.setJobId(platformJob.getId()); | 
|---|
|  |  |  | platformBooksMapper.updateById(platformBooks); | 
|---|
|  |  |  | //生成任务操作记录 | 
|---|
|  |  |  | PlatformLog platformLog = new PlatformLog(); | 
|---|
|  |  |  | platformLog.setCreateDate(new Date()); | 
|---|
|  |  |  | platformLog.setJobId(platformJob.getId()); | 
|---|
|  |  |  | platformLog.setIsdeleted(Constants.ZERO); | 
|---|
|  |  |  | 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); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | //发送短信通知 | 
|---|
|  |  |  | SmsEmailServiceImpl.sendPlatformBookSms(systemDictDataBiz, | 
|---|
|  |  |  | emayService,smsEmailMapper,smsConfigMapper,platformBooksMapper,platformBooks.getId(), | 
|---|
|  |  |  | Constants.equalsInteger(approveDTO.getStatus(),Constants.TWO)?SmsConstants.platformBookContent.platformBookAuditSuccess: | 
|---|
|  |  |  | SmsConstants.platformBookContent.platformBookAuditFail, | 
|---|
|  |  |  | approveDTO.getCheckInfo(),null | 
|---|
|  |  |  | ); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //TODO 发送微信公众号消息 | 
|---|
|  |  |  |  | 
|---|
|  |  |  | }else{ | 
|---|
|  |  |  | throw new BusinessException(ResponseStatus.BAD_REQUEST); | 
|---|