| | |
| | | import com.doumee.dao.business.join.ApproveJoinMapper; |
| | | import com.doumee.dao.business.model.*; |
| | | import com.doumee.dao.business.vo.ApproveDataVO; |
| | | import com.doumee.dao.system.join.NoticesJoinMapper; |
| | | import com.doumee.dao.web.reqeust.ConfirmTaskDTO; |
| | | import com.doumee.dao.web.reqeust.PlatformBooksApplyDTO; |
| | | import com.doumee.dao.web.reqeust.PlatformBooksCheckNumDTO; |
| | | import com.doumee.dao.web.reqeust.RevokeDTO; |
| | |
| | | |
| | | @Autowired |
| | | private PlatformBooksMapper platformBooksMapper; |
| | | |
| | | @Autowired |
| | | private NoticesJoinMapper noticesJoinMapper; |
| | | |
| | | @Autowired |
| | | private ApproveTemplMapper approveTemplMapper; |
| | |
| | | .eq(pageWrap.getModel().getPlateNum() != null, PlatformBooks::getPlateNum, pageWrap.getModel().getPlateNum()) |
| | | .eq(pageWrap.getModel().getDriverPhone() != null, PlatformBooks::getDriverPhone, pageWrap.getModel().getDriverPhone()) |
| | | .ge(pageWrap.getModel().getQueryDate() != null, PlatformBooks::getCreateDate, pageWrap.getModel().getQueryDate()) |
| | | .ge(pageWrap.getModel().getArriveDateStart() != null, PlatformBooks::getArriveDate, Utils.Date.getStart(pageWrap.getModel().getArriveDateStart())) |
| | | .le(pageWrap.getModel().getArriveDateEnd() != null, PlatformBooks::getArriveDate, Utils.Date.getEnd(pageWrap.getModel().getArriveDateEnd())) |
| | | .orderByDesc(PlatformBooks::getCreateDate) |
| | | ; |
| | | for(PageWrap.SortData sortData: pageWrap.getSorts()) { |
| | | if (sortData.getDirection().equalsIgnoreCase(PageWrap.DESC)) { |
| | | queryWrapper.orderByDesc(sortData.getProperty()); |
| | | } else { |
| | | queryWrapper.orderByAsc(sortData.getProperty()); |
| | | PageData<PlatformBooks> pageData = PageData.from(platformBooksMapper.selectPage(page, queryWrapper)); |
| | | for (PlatformBooks platformBooks:pageData.getRecords()) { |
| | | if(Constants.equalsInteger(platformBooks.getStatus(),Constants.ONE)){ |
| | | String auditName = approveService.getApproveUserName(platformBooks.getId(),Constants.approveObjectType.reason); |
| | | platformBooks.setAuditName(auditName); |
| | | } |
| | | } |
| | | return PageData.from(platformBooksMapper.selectPage(page, queryWrapper)); |
| | | |
| | | return pageData; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public long count(PlatformBooks platformBooks) { |
| | |
| | | } |
| | | //查询每日配置的总预约量 |
| | | PlatformReason platformReason = platformReasonMapper.selectById(platformBooksCheckNumDTO.getReasonId()); |
| | | if(Objects.isNull(platformReason)|| Constants.equalsInteger(platformReason.getIsdeleted(),Constants.ZERO)){ |
| | | if(Objects.isNull(platformReason)|| !Constants.equalsInteger(platformReason.getIsdeleted(),Constants.ZERO)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"入园原因信息异常,请刷新重试"); |
| | | } |
| | | List<PlatformBooks> platformBooksList = platformBooksMapper.selectList(new QueryWrapper<PlatformBooks>().lambda() |
| | |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | PlatformReason platformReason = platformReasonMapper.selectById(platformBooksApplyDTO.getReasonId()); |
| | | if(Objects.isNull(platformReason)|| Constants.equalsInteger(platformReason.getIsdeleted(),Constants.ZERO)){ |
| | | if(Objects.isNull(platformReason)|| !Constants.equalsInteger(platformReason.getIsdeleted(),Constants.ZERO)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"入园原因信息异常,请刷新重试"); |
| | | } |
| | | ApproveTempl approveTempl = approveTemplMapper.selectOne(new QueryWrapper<ApproveTempl>().lambda() |
| | | .eq(ApproveTempl::getIsdeleted,Constants.ZERO) |
| | | .eq(ApproveTempl::getObjId,platformReason.getId()) |
| | | .last(" limit 1") |
| | | ); |
| | | ApproveTempl approveTempl = approveTemplMapper.selectById(platformReason.getId()); |
| | | if(Objects.isNull(approveTempl)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"未配置审批流,请联系管理员"); |
| | | } |
| | | |
| | | if(Constants.equalsInteger(platformBooksApplyDTO.getUserId(),platformBooksApplyDTO.getDriverId())){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"人员信息匹配错误"); |
| | | } |
| | | if(Objects.nonNull(platformReason.getLimitNum())&&platformReason.getLimitNum().compareTo(platformBooksApplyDTO.getTotalNum())>0){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"超出入园申请线质量"); |
| | | if(!Constants.equalsInteger(approveTempl.getIsdeleted(),Constants.ZERO)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"审批流已停用,请联系管理员"); |
| | | } |
| | | PlatformBooks platformBooks = new PlatformBooks(); |
| | | BeanUtils.copyProperties(platformBooksApplyDTO,platformBooks); |
| | |
| | | platformBooks.setIsdeleted(Constants.ZERO); |
| | | platformBooks.setStatus(Constants.ZERO); |
| | | platformBooks.setDriverId(platformBooksApplyDTO.getUserId()); |
| | | platformBooks.setEditDate(new Date()); |
| | | platformBooksMapper.insert(platformBooks); |
| | | |
| | | //创建审批流信息 |
| | | approveService.createApproveFlow(5,platformBooks.getId(),platformBooks.getDriverId()); |
| | | approveService.createApproveForPlatfrom(platformReason.getApproveTemplId(),platformBooks.getId(),platformBooks.getDriverId()); |
| | | return platformBooks.getId(); |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = {BusinessException.class,Exception.class}) |
| | | public Integer edit(PlatformBooksApplyDTO platformBooksApplyDTO){ |
| | | if(Objects.isNull(platformBooksApplyDTO) |
| | | || Objects.isNull(platformBooksApplyDTO.getId()) |
| | | || StringUtils.isBlank(platformBooksApplyDTO.getContractNum()) |
| | | || Objects.isNull(platformBooksApplyDTO.getArriveDate()) |
| | | || Objects.isNull(platformBooksApplyDTO.getInType()) |
| | | || Objects.isNull(platformBooksApplyDTO.getTotalNum()) |
| | | || StringUtils.isBlank(platformBooksApplyDTO.getCarCodeFront()) |
| | | || StringUtils.isBlank(platformBooksApplyDTO.getCarCodeBack()) |
| | | || Objects.isNull(platformBooksApplyDTO.getDriverId()) |
| | | || StringUtils.isBlank(platformBooksApplyDTO.getDriverPhone()) |
| | | || StringUtils.isBlank(platformBooksApplyDTO.getDriverName()) |
| | | || StringUtils.isBlank(platformBooksApplyDTO.getTransportImg()) |
| | | ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | PlatformBooks platformBooks = platformBooksMapper.selectById(platformBooksApplyDTO.getId()); |
| | | if(Objects.isNull(platformBooks)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | if(!Constants.equalsInteger(platformBooks.getStatus(),Constants.ZERO)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"业务状态已流转"); |
| | | } |
| | | BeanUtils.copyProperties(platformBooksApplyDTO,platformBooks); |
| | | platformBooks.setEditDate(new Date()); |
| | | platformBooks.setReasonId(null); |
| | | platformBooks.setInReason(null); |
| | | platformBooksMapper.updateById(platformBooks); |
| | | return platformBooks.getId(); |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | |
| | | if(Objects.isNull(model)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"未查询到预约记录"); |
| | | } |
| | | String prefixUrl = systemDictDataBiz.queryByCode(Constants.FTP,Constants.FTP_RESOURCE_PATH).getCode() + |
| | | systemDictDataBiz.queryByCode(Constants.FTP,Constants.PLATFORM).getCode(); |
| | | model.setPrefixUrl(prefixUrl); |
| | | |
| | | ApproveDataVO approveDataVO = approveService.arrangeApprovedData(id, |
| | | 5, |
| | | 6, |
| | | memberId); |
| | | model.setApproveDateVO(approveDataVO); |
| | | List<Approve> approveList = approveDataVO.getApproveList(); |
| | |
| | | .eq(Approve::getObjId,revokeDTO.getId()) |
| | | ); |
| | | } |
| | | |
| | | |
| | | |
| | | } |