From fae4bd828a6b81b95f53e285fcb4749fbd80c7bf Mon Sep 17 00:00:00 2001
From: CZT <czt18638530771@163.com>
Date: 星期一, 04 九月 2023 17:31:46 +0800
Subject: [PATCH] 增加粮情层行转换配置

---
 igds-core/src/main/java/com/ld/igds/view/DepotStorePR.java |   50 +++++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 43 insertions(+), 7 deletions(-)

diff --git a/igds-core/src/main/java/com/ld/igds/view/DepotStorePR.java b/igds-core/src/main/java/com/ld/igds/view/DepotStorePR.java
index 247e658..7b0f58e 100644
--- a/igds-core/src/main/java/com/ld/igds/view/DepotStorePR.java
+++ b/igds-core/src/main/java/com/ld/igds/view/DepotStorePR.java
@@ -4,8 +4,8 @@
 import com.bstek.dorado.annotation.DataResolver;
 import com.bstek.dorado.annotation.Expose;
 import com.bstek.dorado.data.provider.Page;
+import com.ld.igds.constant.DepotStatus;
 import com.ld.igds.models.DepotStore;
-import com.ld.igds.view.service.HDepotService;
 import com.ld.igds.view.service.HDepotStoreService;
 import org.springframework.stereotype.Component;
 
@@ -30,19 +30,17 @@
 
 
     /**
-     * depotStorePR#pageListDepotStore
+     * depotStorePR#pageList
      *
      * @Desc: 鍒嗛〉鏌ヨ搴撳瓨淇℃伅
      * @author: Andy
      * @update-time: 2022/11/17
      */
     @DataProvider
-    public void pageListDepotStore(Page<DepotStore> page, Map<String, Object> param) throws Exception {
-
+    public void pageList(Page<DepotStore> page, Map<String, Object> param) throws Exception {
         if (null == param) {
             param = new HashMap<>();
         }
-
         depotStoreService.listDepotStore(page, param);
     }
 
@@ -52,15 +50,53 @@
      * @param data
      */
     @DataResolver
-    public void saveDepotStore(DepotStore data) {
+    public String saveDepotStore(DepotStore data) throws Exception {
+
+        //濡傛灉浠撳簱鐘舵��=灏佷粨/鍏ュ簱涓�/鍑哄簱涓�
+        if (DepotStatus.STATUS_2.getCode().equals(data.getDepotStatus()) ||
+                DepotStatus.STATUS_3.getCode().equals(data.getDepotStatus()) ||
+                DepotStatus.STATUS_4.getCode().equals(data.getDepotStatus()) ||
+                DepotStatus.STATUS_31.getCode().equals(data.getDepotStatus()) ||
+                DepotStatus.STATUS_32.getCode().equals(data.getDepotStatus()) ||
+                DepotStatus.STATUS_33.getCode().equals(data.getDepotStatus()) ||
+                DepotStatus.STATUS_34.getCode().equals(data.getDepotStatus())) {
+
+            if (null == data.getFoodYear()) return "璐т綅鐘舵��=灏佷粨/鍏ュ簱涓�/鍑哄簱涓紝鏀惰揣骞村害涓嶈兘涓虹┖";
+
+            if (null == data.getCountry()) return "璐т綅鐘舵��=灏佷粨/鍏ュ簱涓�/鍑哄簱涓紝鍥藉埆涓嶈兘涓虹┖";
+
+            if (null == data.getFoodLocation()) return "璐т綅鐘舵��=灏佷粨/鍏ュ簱涓�/鍑哄簱涓紝绮浜у湴涓嶈兘涓虹┖";
+
+            if (null == data.getFoodLocation()) return "璐т綅鐘舵��=灏佷粨/鍏ュ簱涓�/鍑哄簱涓紝绮浜у湴涓嶈兘涓虹┖";
+
+            if (null == data.getStoreDate()) return "璐т綅鐘舵��=灏佷粨/鍏ュ簱涓�/鍑哄簱涓紝鍏ュ簱鏃堕棿涓嶅彲涓虹┖";
+        }
+
+        //璐т綅鐘舵��=灏佷粨/鍑哄簱涓紝蹇呭~
+        if (DepotStatus.STATUS_3.getCode().equals(data.getDepotStatus()) ||
+                DepotStatus.STATUS_4.getCode().equals(data.getDepotStatus()) ||
+                DepotStatus.STATUS_31.getCode().equals(data.getDepotStatus()) ||
+                DepotStatus.STATUS_32.getCode().equals(data.getDepotStatus()) ||
+                DepotStatus.STATUS_33.getCode().equals(data.getDepotStatus()) ||
+                DepotStatus.STATUS_34.getCode().equals(data.getDepotStatus())) {
+
+            if (null == data.getFullDate()) return "璐т綅鐘舵��=灏佷粨/鍑哄簱涓紝灏佷粨鏃堕棿涓嶅彲涓虹┖";
+        }
+
+        //璐т綅鐘舵��=绌轰粨锛屽繀濉�傛渶鍚庝竴杞︾伯椋熷嚭浠撴椂闂�
+        if (DepotStatus.STATUS_1.getCode().equals(data.getDepotStatus())) {
+            if (null == data.getOutDate()) return "璐т綅鐘舵��=绌轰粨锛屽嚭浠撳畬鎴愭椂闂翠笉鍙负绌�";
+        }
 
         depotStoreService.saveDepotStore(data);
 
-        //鏇存柊搴撳瓨鍜岀姸鎬�
+        //鏍规嵁搴撳瓨淇℃伅鏇存柊鍒颁粨搴撲俊鎭紝浠撳簱鍌ㄧ伯淇℃伅浠ュ綋鍓嶄负鍑�
         depotPR.updateByStore(data);
 
         //杩滅▼鍚屾鐘舵��
         depotPR.pullDepotStatus(data.getCompanyId(), data.getDepotId(), data.getDepotStatus());
+
+        return null;
     }
 
     /**

--
Gitblit v1.9.3