From 86d368337175a7d7eed5e9330bd80a838ab4f396 Mon Sep 17 00:00:00 2001
From: jiazx0107@163.com <jiazx0107@163.com>
Date: 星期四, 09 十一月 2023 17:25:23 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/igds-api-gateway' into igds-api-gateway
---
src/main/java/com/fzzy/otherview/sh2023/pr/SHApi2104PR.java | 54 +++++++++++++++++++++++++++---------------------------
1 files changed, 27 insertions(+), 27 deletions(-)
diff --git a/src/main/java/com/fzzy/otherview/sh2023/pr/SHApi2104PR.java b/src/main/java/com/fzzy/otherview/sh2023/pr/SHApi2104PR.java
index bb2b057..5a2de76 100644
--- a/src/main/java/com/fzzy/otherview/sh2023/pr/SHApi2104PR.java
+++ b/src/main/java/com/fzzy/otherview/sh2023/pr/SHApi2104PR.java
@@ -111,17 +111,22 @@
*/
@DataResolver
public void saveData(SH2023Api2104 data) {
-
- ApiInfoData infoData = new ApiInfoData();
- infoData.setId(data.getBydh());
- infoData.setKqdm(data.getKqdm());
- infoData.setInteId(SH2023Constant.SH_2023_API_CODE_2104);
- infoData.setUpdateTime(new Date());
- infoData.setDataId(data.getBydh());
- infoData.setData(JSON.toJSONString(data));
- infoData.setCzbz(data.getCzbz());
- infoData.setRemarks("澶囨敞淇℃伅");
-
+ ApiInfoData infoData;
+ List<ApiInfoData> apiInfoList = apiInfoDataRep.getDataByInteAndData(SH2023Constant.SH_2023_API_CODE_2101, data.getBydh(),data.getKqdm());
+ if (apiInfoList.size() != 0) {
+ infoData = apiInfoList.get(0);
+ infoData.setData(JSON.toJSONString(data));
+ } else {
+ infoData = new ApiInfoData();
+ infoData.setId(ContextUtil.getUUID());
+ infoData.setKqdm(data.getKqdm());
+ infoData.setInteId(SH2023Constant.SH_2023_API_CODE_2104);
+ infoData.setUpdateTime(new Date());
+ infoData.setDataId(data.getBydh());
+ infoData.setData(JSON.toJSONString(data));
+ infoData.setCzbz(data.getCzbz());
+ infoData.setRemarks("澶囨敞淇℃伅");
+ }
apiInfoDataRep.save(infoData);
}
@@ -130,19 +135,21 @@
*/
@Expose
public void delData(SH2023Api2104 data) {
- apiInfoDataRep.deleteById(data.getBydh());
+ List<ApiInfoData> apiInfoList = apiInfoDataRep.getDataByInteAndData(SH2023Constant.SH_2023_API_CODE_2104, data.getBydh(),data.getKqdm());
+ apiInfoDataRep.deleteById(apiInfoList.get(0).getId());
}
/**
* sHApi2104PR#delUpdate
*/
@Expose
- public String delUpdate(SH2023Api2104 entity) {
- if (null == entity) {
+ public String delUpdate(SH2023Api2104 data) {
+ if (null == data) {
return "鏃犳暟鎹墽琛�";
}
- entity.setCzbz(Constant.CZBZ_D);
- apiInfoDataRep.updateStatus(entity.getBydh(), JSON.toJSONString(entity), Constant.CZBZ_D);
+ List<ApiInfoData> apiInfoList = apiInfoDataRep.getDataByInteAndData(SH2023Constant.SH_2023_API_CODE_2104, data.getBydh(),data.getKqdm());
+ data.setCzbz(Constant.CZBZ_D);
+ apiInfoDataRep.updateStatus(apiInfoList.get(0).getId(), JSON.toJSONString(data), Constant.CZBZ_D);
return null;
}
@@ -171,23 +178,16 @@
responseDto = apiService.pushData(param, apiConf, items);
if (responseDto.getSuccess() == 0) {
//鎺ㄩ�佹垚鍔燂紝鏇存柊鏁版嵁涓婁紶鐘舵��
-
ApiInfoData infoData;
for (SH2023Api2104 data : items) {
if (Constant.CZBZ_I.equals(data.getCzbz())) {
-
- infoData = new ApiInfoData();
- infoData.setId(data.getBydh());
- infoData.setKqdm(data.getKqdm());
- infoData.setInteType("21");
- infoData.setInteId(SH2023Constant.SH_2023_API_CODE_2104);
- infoData.setUpdateTime(new Date());
- infoData.setDataId(data.getBydh());
-
+ //鎺ㄩ�佹垚鍔燂紝鏇存柊鏁版嵁涓婁紶鐘舵��
+ List<ApiInfoData> apiInfoList = apiInfoDataRep.getDataByInteAndData(SH2023Constant.SH_2023_API_CODE_2104, data.getBydh(),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);
}
}
--
Gitblit v1.9.3