From 7ea82c44c119e30f13451e86911b32ad40ff86d8 Mon Sep 17 00:00:00 2001 From: jiangping <jp@doumee.com> Date: 星期三, 16 八月 2023 09:15:41 +0800 Subject: [PATCH] 修復bug --- server/src/main/java/doumeemes/service/ext/impl/WorkPlansExtServiceImpl.java | 16 +++++++++++++++- 1 files changed, 15 insertions(+), 1 deletions(-) diff --git a/server/src/main/java/doumeemes/service/ext/impl/WorkPlansExtServiceImpl.java b/server/src/main/java/doumeemes/service/ext/impl/WorkPlansExtServiceImpl.java index b25630b..e0e1c37 100644 --- a/server/src/main/java/doumeemes/service/ext/impl/WorkPlansExtServiceImpl.java +++ b/server/src/main/java/doumeemes/service/ext/impl/WorkPlansExtServiceImpl.java @@ -32,6 +32,7 @@ import org.springframework.web.multipart.MultipartFile; import java.math.BigDecimal; +import java.time.LocalDate; import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -96,7 +97,9 @@ || Objects.isNull(workPlansSaveDTO.getNum()) || Objects.isNull(workPlansSaveDTO.getFactoryId()) || Objects.isNull(workPlansSaveDTO.getUnitId()) - || Objects.isNull(workPlansSaveDTO.getMaterialId())){ + || Objects.isNull(workPlansSaveDTO.getMaterialId()) + || Objects.isNull(workPlansSaveDTO.getStartDate()) + || workPlansSaveDTO.getStartDate().getTime() > workPlansSaveDTO.getPlanDate().getTime()){ throw new BusinessException(ResponseStatus.BAD_REQUEST); } WorkPlans workPlans = new WorkPlans(); @@ -172,6 +175,17 @@ i.setFinishUnQualifiedNum(Objects.isNull(plansExtListVO.getUnqulifiedNum())?Constants.ZERO:plansExtListVO.getUnqulifiedNum()); i.setFinishNum(Objects.isNull(plansExtListVO.getDoneNum())?Constants.ZERO:plansExtListVO.getDoneNum()); } + + if ( !i.getStatus().equals(Constants.WORKPLANHISTORY_TYPE.done) && + !i.getStatus().equals(Constants.WORKPLANHISTORY_TYPE.close)){ + if (Objects.nonNull(i.getPlanDate())){ + i.setHasExpire(DateUtil.toDateLocalDateTime(i.getPlanDate()).toLocalDate().isBefore(LocalDate.now())); + }else { + i.setHasExpire(false); + } + } + + }); } return PageData.from(new PageInfo<>(result)); -- Gitblit v1.9.3