From 4160155c7749e752ae13b935afe7a60fbbeeda6b Mon Sep 17 00:00:00 2001
From: YYC <1833023622@qq.com>
Date: 星期一, 30 十月 2023 11:52:44 +0800
Subject: [PATCH] 武汉接口

---
 src/main/java/com/fzzy/otherview/whhpjl/pr/WhjlApi1214PR.java |   41 ++++++++++++++++++++++++++---------------
 1 files changed, 26 insertions(+), 15 deletions(-)

diff --git a/src/main/java/com/fzzy/otherview/whhpjl/pr/WhjlApi1214PR.java b/src/main/java/com/fzzy/otherview/whhpjl/pr/WhjlApi1214PR.java
index 1ceaf32..c6c5c06 100644
--- a/src/main/java/com/fzzy/otherview/whhpjl/pr/WhjlApi1214PR.java
+++ b/src/main/java/com/fzzy/otherview/whhpjl/pr/WhjlApi1214PR.java
@@ -17,8 +17,7 @@
 import com.fzzy.api.utils.ContextUtil;
 import com.fzzy.api.view.repository.ApiInfoDataRep;
 import com.fzzy.otherview.whhpjl.WhjlConstant;
-import com.fzzy.otherview.whhpjl.dto.WhjlApi1214;
-import com.fzzy.otherview.whhpjl.dto.WhjlQDItem;
+import com.fzzy.otherview.whhpjl.dto.*;
 import org.apache.commons.lang.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.domain.PageRequest;
@@ -113,8 +112,13 @@
      * @return
      */
     @DataProvider
-    public List<WhjlQDItem> listItem(String id) {
-        return null;
+    public List<WhjlJCNL> listJCNL(String code) {
+        return JSON.parseArray(code, WhjlJCNL.class);
+    }
+
+    @DataProvider
+    public List<WhjlYQSB> listYQSB(String code) {
+        return JSON.parseArray(code, WhjlYQSB.class);
     }
 
     /**
@@ -126,17 +130,24 @@
      */
     @DataResolver
     public void saveData(WhjlApi1214 data) {
-        ApiInfoData infoData = new ApiInfoData();
-        infoData.setId(data.getBizId());
-        infoData.setKqdm(data.getKqdm());
-        infoData.setInteType(WhjlConstant.API_CATEGORY_12);
-        infoData.setInteId(WhjlConstant.API_CODE_1214);
-        infoData.setUpdateTime(new Date());
-        infoData.setDataId(data.getBizId());
-        infoData.setData(JSON.toJSONString(data));
-        infoData.setCzbz(data.getCzbz());
-        infoData.setRemarks("澶囨敞淇℃伅");
-
+        data.setJcnlList(JSON.toJSONString(data.getJcnl()));
+        data.setYqsbList(JSON.toJSONString(data.getYqsb()));
+        ApiInfoData infoData;
+        List<ApiInfoData> apiInfoList = apiInfoDataRep.getDataByInteAndData(WhjlConstant.API_CODE_1214, 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_1214);
+            infoData.setUpdateTime(new Date());
+            infoData.setDataId(data.getBizId());
+            infoData.setData(JSON.toJSONString(data));
+            infoData.setCzbz(Constant.CZBZ_I);
+            infoData.setRemarks("澶囨敞淇℃伅");
+        }
         apiInfoDataRep.save(infoData);
     }
 

--
Gitblit v1.9.3