|  |  |  | 
|---|
|  |  |  | import org.springframework.util.CollectionUtils; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import java.math.BigDecimal; | 
|---|
|  |  |  | import java.util.Arrays; | 
|---|
|  |  |  | import java.util.Date; | 
|---|
|  |  |  | import java.util.List; | 
|---|
|  |  |  | import java.util.Objects; | 
|---|
|  |  |  | import java.util.*; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 月台入园预约信息表Service实现 | 
|---|
|  |  |  | 
|---|
|  |  |  | queryWrapper | 
|---|
|  |  |  | .selectAll(PlatformBooks.class) | 
|---|
|  |  |  | .selectAs(PlatformJob::getStatus,PlatformBooks::getJobStatus) | 
|---|
|  |  |  | .selectAs(SystemUser::getRealname,PlatformBooks::getEditUserName) | 
|---|
|  |  |  | .leftJoin(PlatformJob.class,PlatformJob::getId,PlatformBooks::getJobId) | 
|---|
|  |  |  | .leftJoin(SystemUser.class,SystemUser::getId,PlatformJob::getEditDate) | 
|---|
|  |  |  | .eq(pageWrap.getModel().getId() != null, PlatformBooks::getId, pageWrap.getModel().getId()) | 
|---|
|  |  |  | .eq(pageWrap.getModel().getCreator() != null, PlatformBooks::getCreator, pageWrap.getModel().getCreator()) | 
|---|
|  |  |  | .ge(pageWrap.getModel().getCreateDate() != null, PlatformBooks::getCreateDate, Utils.Date.getStart(pageWrap.getModel().getCreateDate())) | 
|---|
|  |  |  | 
|---|
|  |  |  | if(Objects.isNull(platformReason)|| !Constants.equalsInteger(platformReason.getIsdeleted(),Constants.ZERO)){ | 
|---|
|  |  |  | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"入园原因信息异常,请刷新重试"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if(platformBooksApplyDTO.getTotalNum().compareTo(platformReason.getLimitNum())>Constants.ZERO){ | 
|---|
|  |  |  | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"任务量超出单日可作业量,请修改后重新输入!"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | PlatformGroup platformGroup= platformGroupMapper.selectById(platformReason.getGroupId()); | 
|---|
|  |  |  | if(Objects.isNull(platformGroup)){ | 
|---|
|  |  |  | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"未查询到绑定月台组数据"); | 
|---|
|  |  |  | 
|---|
|  |  |  | platformBooks.setReasonId(null); | 
|---|
|  |  |  | platformBooks.setInReason(null); | 
|---|
|  |  |  | platformBooksMapper.updateById(platformBooks); | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | Map<String,Object> jsonMap = new HashMap<>(); | 
|---|
|  |  |  | String title = ApproveServiceImpl.creatPlatformBookNotice(platformBooks,jsonMap); | 
|---|
|  |  |  | noticesJoinMapper.update(null,new UpdateWrapper<Notices>().lambda() | 
|---|
|  |  |  | .set(Notices::getParam1,JSONObject.toJSONString(jsonMap)) | 
|---|
|  |  |  | .set(Notices::getTitle,title) | 
|---|
|  |  |  | .eq(Notices::getObjType,Constants.noticesObjectType.reason) | 
|---|
|  |  |  | .eq(Notices::getTitle,title) | 
|---|
|  |  |  | .eq(Notices::getObjId,platformBooks.getId()) | 
|---|
|  |  |  | ); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | return platformBooks.getId(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|