From cd091408dcff794e3001e43b99a6d521cfff36dc Mon Sep 17 00:00:00 2001
From: CZT <czt18638530771@163.com>
Date: 星期一, 13 十一月 2023 21:04:04 +0800
Subject: [PATCH] 优化上海接口批次号问题

---
 src/main/java/com/fzzy/otherview/sh2023/pr/SHApi2102PR.java |   28 +++++++++++-----------------
 1 files changed, 11 insertions(+), 17 deletions(-)

diff --git a/src/main/java/com/fzzy/otherview/sh2023/pr/SHApi2102PR.java b/src/main/java/com/fzzy/otherview/sh2023/pr/SHApi2102PR.java
index 6babe56..26e00e1 100644
--- a/src/main/java/com/fzzy/otherview/sh2023/pr/SHApi2102PR.java
+++ b/src/main/java/com/fzzy/otherview/sh2023/pr/SHApi2102PR.java
@@ -151,7 +151,7 @@
 
     @Expose
     public String pushData(List<SH2023Api2102> items) {
-        ResponseDto responseDto;
+
         String result = "";
 
         String kqdm = items.get(0).getDrhwdm().substring(0, 21);
@@ -170,27 +170,21 @@
             return "绯荤粺娌℃湁褰撳墠鎺ㄩ�佸崗璁厤缃紝鎵ц澶辫触";
         }
 
-        //鎺ㄩ�侊紝鏁版嵁涓洪泦鍚堝舰寮�
-        responseDto = apiService.pushData(param, apiConf, items);
-        if (responseDto.getSuccess() == 0) {
-            //鎺ㄩ�佹垚鍔燂紝鏇存柊鏁版嵁涓婁紶鐘舵��
 
-            ApiInfoData infoData;
-            for (SH2023Api2102 data : items) {
+        ResponseDto responseDto;
+        ApiInfoData infoData;
+        for (SH2023Api2102 data : items) {
+            //鎺ㄩ�侊紝鏁版嵁涓洪泦鍚堝舰寮�
+            responseDto = apiService.pushData(param, apiConf, data);
+            if (responseDto.getSuccess() == 0) {
+                //鎺ㄩ�佹垚鍔燂紝鏇存柊鏁版嵁涓婁紶鐘舵��
                 if (Constant.CZBZ_I.equals(data.getCzbz())) {
-
-                    infoData = new ApiInfoData();
-                    infoData.setId(data.getDrdh());
-                    infoData.setKqdm(data.getDrhwdm().substring(0, 21));
-                    infoData.setInteType("21");
-                    infoData.setInteId(SH2023Constant.SH_2023_API_CODE_2102);
-                    infoData.setUpdateTime(new Date());
-                    infoData.setDataId(data.getDrdh());
-
+                    List<ApiInfoData> apiInfoList = apiInfoDataRep.getDataByInteAndData(SH2023Constant.SH_2023_API_CODE_2102, data.getDrdh(), data.getDrdw());
                     data.setCzbz(Constant.CZBZ_U);
+                    infoData = apiInfoList.get(0);
+                    infoData.setUpdateTime(new Date());
                     infoData.setCzbz(Constant.CZBZ_U);
                     infoData.setData(JSON.toJSONString(data));
-
                     apiInfoDataRep.save(infoData);
                 }
             }

--
Gitblit v1.9.3