From 76a6e71310e4abc19e5733c02cf35c1eb8b3a727 Mon Sep 17 00:00:00 2001
From: CZT <czt18638530771@163.com>
Date: 星期一, 30 十月 2023 20:33:51 +0800
Subject: [PATCH] 优化上海接口批次号

---
 src/main/java/com/fzzy/otherview/whhpjl/pr/WhjlApi1211PR.java |   45 +++++++++++++++++++++------------------------
 1 files changed, 21 insertions(+), 24 deletions(-)

diff --git a/src/main/java/com/fzzy/otherview/whhpjl/pr/WhjlApi1211PR.java b/src/main/java/com/fzzy/otherview/whhpjl/pr/WhjlApi1211PR.java
index 22e7470..27d5d92 100644
--- a/src/main/java/com/fzzy/otherview/whhpjl/pr/WhjlApi1211PR.java
+++ b/src/main/java/com/fzzy/otherview/whhpjl/pr/WhjlApi1211PR.java
@@ -18,7 +18,9 @@
 import com.fzzy.api.view.repository.ApiInfoDataRep;
 import com.fzzy.otherview.whhpjl.WhjlConstant;
 import com.fzzy.otherview.whhpjl.dto.WhjlApi1211;
+import com.fzzy.otherview.whhpjl.dto.WhjlApi1211;
 import com.fzzy.otherview.whhpjl.dto.WhjlQDItem;
+import com.fzzy.otherview.whhpjl.dto.WhjlZCMX;
 import org.apache.commons.lang.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.domain.PageRequest;
@@ -113,8 +115,8 @@
      * @return
      */
     @DataProvider
-    public List<WhjlQDItem> listItem(String id) {
-        return null;
+    public List<WhjlZCMX> listItem(String code) {
+        return JSON.parseArray(code, WhjlZCMX.class);
     }
 
     /**
@@ -126,17 +128,23 @@
      */
     @DataResolver
     public void saveData(WhjlApi1211 data) {
-        ApiInfoData infoData = new ApiInfoData();
-        infoData.setId(data.getBizId());
-        infoData.setKqdm(data.getKqdm());
-        infoData.setInteType(WhjlConstant.API_CATEGORY_12);
-        infoData.setInteId(WhjlConstant.API_CODE_1211);
-        infoData.setUpdateTime(new Date());
-        infoData.setDataId(data.getBizId());
-        infoData.setData(JSON.toJSONString(data));
-        infoData.setCzbz(data.getCzbz());
-        infoData.setRemarks("澶囨敞淇℃伅");
-
+        data.setZcmxList(JSON.toJSONString(data.getZcmx()));
+        ApiInfoData infoData;
+        List<ApiInfoData> apiInfoList = apiInfoDataRep.getDataByInteAndData(WhjlConstant.API_CODE_1211, data.getBizId(), data.getKqdm());
+        if (apiInfoList.size() != 0) {
+            infoData = apiInfoList.get(0);
+            infoData.setData(JSON.toJSONString(data));
+        } else {
+            infoData = new ApiInfoData();
+            infoData.setId(data.getBizId());
+            infoData.setKqdm(data.getKqdm());
+            infoData.setInteId(WhjlConstant.API_CODE_1211);
+            infoData.setUpdateTime(new Date());
+            infoData.setDataId(data.getBizId());
+            infoData.setData(JSON.toJSONString(data));
+            infoData.setCzbz(Constant.CZBZ_I);
+            infoData.setRemarks("澶囨敞淇℃伅");
+        }
         apiInfoDataRep.save(infoData);
     }
 
@@ -154,17 +162,6 @@
         return null;
     }
 
-    /**
-     * 鍒犻櫎鍚堝悓鍟嗗搧娓呭崟
-     * whjlApi1211PR#delItem
-     *
-     * @param data
-     * @return
-     */
-    @Expose
-    public String delItem(WhjlQDItem data) {
-        return null;
-    }
 
     /**
      * 涓婁紶

--
Gitblit v1.9.3