From a962c8c1fd9da787c355a63a2e43675f21dd4f25 Mon Sep 17 00:00:00 2001
From: jiaosong <jiaosong6760@dingtalk.com>
Date: 星期四, 17 八月 2023 16:09:15 +0800
Subject: [PATCH] #设备导入

---
 server/src/main/java/doumeemes/service/ext/impl/WorkPlansExtServiceImpl.java |   15 ++++++++++++++-
 1 files changed, 14 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..4885ee4 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,16 @@
                     i.setFinishUnQualifiedNum(Objects.isNull(plansExtListVO.getUnqulifiedNum())?Constants.ZERO:plansExtListVO.getUnqulifiedNum());
                     i.setFinishNum(Objects.isNull(plansExtListVO.getDoneNum())?Constants.ZERO:plansExtListVO.getDoneNum());
                 }
+                i.setHasExpire(false);
+                i.setStatus(Constants.formatIntegerNum(i.getStatus()));
+                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()));
+                    }
+                }
+
+
             });
         }
         return PageData.from(new PageInfo<>(result));

--
Gitblit v1.9.3