From ab8b3af2bc6460dba2a807d27004e128d772ab24 Mon Sep 17 00:00:00 2001
From: YYC <1833023622@qq.com>
Date: 星期五, 12 七月 2024 09:30:09 +0800
Subject: [PATCH] 增城配置

---
 src/main/java/com/fzzy/otherview/gd2022/pr/GDApi1023PR.java |   55 +++++++++++++++++++++++++------------------------------
 1 files changed, 25 insertions(+), 30 deletions(-)

diff --git a/src/main/java/com/fzzy/otherview/gd2022/pr/GDApi1023PR.java b/src/main/java/com/fzzy/otherview/gd2022/pr/GDApi1023PR.java
index 62d64bf..afa744e 100644
--- a/src/main/java/com/fzzy/otherview/gd2022/pr/GDApi1023PR.java
+++ b/src/main/java/com/fzzy/otherview/gd2022/pr/GDApi1023PR.java
@@ -16,15 +16,9 @@
 import com.fzzy.api.service.ApiRemoteService;
 import com.fzzy.api.utils.ContextUtil;
 import com.fzzy.api.view.repository.ApiInfoDataRep;
-import com.fzzy.otherview.gd2022.dto.GdApi1023;
-import com.fzzy.otherview.gd2022.dto.GdApi1023Dtl;
-import com.fzzy.otherview.gd2022.dto.GdApi1023People;
-import com.fzzy.otherview.gd2022.dto.GdApi1023Way;
+import com.fzzy.push.gd2022.dto.Gd2022Api1023;
 import com.fzzy.push.gd2022.ApiCodeConstant;
-import com.fzzy.push.sh2023.SH2023Constant;
-import com.fzzy.push.sh2023.dto.SH2023Api2103;
 import org.apache.commons.lang.StringUtils;
-import org.apache.commons.lang.time.DateFormatUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.domain.PageRequest;
 import org.springframework.data.domain.Pageable;
@@ -61,7 +55,7 @@
      * @return
      */
     @DataProvider
-    public void listData(Page<GdApi1023> page, ApiParam param) {
+    public void listData(Page<Gd2022Api1023> page, ApiParam param) {
 
         Pageable pageable = PageRequest.of(page.getPageNo() - 1, page.getPageSize(), Sort.Direction.DESC, "updateTime");
 
@@ -98,11 +92,11 @@
         };
         org.springframework.data.domain.Page<ApiInfoData> japPage = apiInfoDataRep.findAll(specification, pageable);
         page.setEntityCount((int) japPage.getTotalElements());
-        List<GdApi1023> list = new ArrayList<>();
-        GdApi1023 gdApi1023;
+        List<Gd2022Api1023> list = new ArrayList<>();
+        Gd2022Api1023 GD2022Api1023;
         for (ApiInfoData infoData : japPage.getContent()) {
-            gdApi1023 = JSONObject.parseObject(infoData.getData(), GdApi1023.class);
-            list.add(gdApi1023);
+            GD2022Api1023 = JSONObject.parseObject(infoData.getData(), Gd2022Api1023.class);
+            list.add(GD2022Api1023);
         }
         page.setEntities(list);
 
@@ -112,7 +106,7 @@
      * gDApi1023PR#saveData
      */
     @DataResolver
-    public void saveData(GdApi1023 data) {
+    public void saveData(Gd2022Api1023 data) {
         ApiInfoData infoData;
         List<ApiInfoData> apiInfoList = apiInfoDataRep.getDataByInteAndData(ApiCodeConstant.API_1023, data.getXzbm(), data.getKqdm());
         if (apiInfoList.size() != 0) {
@@ -136,7 +130,7 @@
      * gDApi1023PR#delData
      */
     @Expose
-    public void delData(GdApi1023 data) {
+    public void delData(Gd2022Api1023 data) {
         List<ApiInfoData> apiInfoList = apiInfoDataRep.getDataByInteAndData(ApiCodeConstant.API_1023, data.getXzbm(), data.getKqdm());
         apiInfoDataRep.deleteById(apiInfoList.get(0).getId());
     }
@@ -145,7 +139,7 @@
      * gDApi1023PR#delUpdate
      */
     @Expose
-    public String delUpdate(GdApi1023 data) {
+    public String delUpdate(Gd2022Api1023 data) {
         if (null == data) {
             return "鏃犳暟鎹墽琛�";
         }
@@ -162,7 +156,7 @@
      * @return
      */
     @Expose
-    public String pushData(List<GdApi1023> items) {
+    public String pushData(List<Gd2022Api1023> items) {
         ResponseDto responseDto;
         String result = "";
 
@@ -182,20 +176,21 @@
             return "绯荤粺娌℃湁褰撳墠鎺ㄩ�佸崗璁厤缃紝鎵ц澶辫触";
         }
 
-        //鎺ㄩ�侊紝鏁版嵁涓洪泦鍚堝舰寮�
-        responseDto = apiService.pushData(param, apiConf, items);
-        if (responseDto.getSuccess() == 0) {
-            //鎺ㄩ�佹垚鍔燂紝鏇存柊鏁版嵁涓婁紶鐘舵��
-
-            ApiInfoData infoData;
-            for (GdApi1023 data : items) {
-                List<ApiInfoData> apiInfoList = apiInfoDataRep.getDataByInteAndData(ApiCodeConstant.API_1023, data.getXzbm(), data.getKqdm());
-                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);
+        ApiInfoData infoData;
+        for (Gd2022Api1023 data : items) {
+            //鎺ㄩ�侊紝鏁版嵁涓洪泦鍚堝舰寮�
+            responseDto = apiService.pushData(param, apiConf, data);
+            if (responseDto.getSuccess() == 0) {
+                if (Constant.CZBZ_I.equals(data.getCzbz())) {
+                    //鎺ㄩ�佹垚鍔燂紝鏇存柊鏁版嵁涓婁紶鐘舵��
+                    List<ApiInfoData> apiInfoList = apiInfoDataRep.getDataByInteAndData(ApiCodeConstant.API_1023, data.getXzbm(), data.getKqdm());
+                    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);
+                }
             }
             result += responseDto.toString();
         }

--
Gitblit v1.9.3