From 757ee5dc2ca4185d3c60db1e8c35d2e96e15c50c Mon Sep 17 00:00:00 2001
From: CZT <czt18638530771@163.com>
Date: 星期四, 14 十二月 2023 17:35:46 +0800
Subject: [PATCH] 上海省平台共享接口-监控信息更新

---
 src/main/java/com/fzzy/push/sh2023/SH2023ApiRemoteService.java |   69 ++++++++++++++++++++++++++++++++++
 1 files changed, 69 insertions(+), 0 deletions(-)

diff --git a/src/main/java/com/fzzy/push/sh2023/SH2023ApiRemoteService.java b/src/main/java/com/fzzy/push/sh2023/SH2023ApiRemoteService.java
index 5d97a28..6d59bdd 100644
--- a/src/main/java/com/fzzy/push/sh2023/SH2023ApiRemoteService.java
+++ b/src/main/java/com/fzzy/push/sh2023/SH2023ApiRemoteService.java
@@ -162,6 +162,64 @@
         }
     }
 
+    @Override
+    public ResponseDto pullData(ApiParam param, ApiConfs conf) {
+        String inteId = param.getInteId();
+        String kqdm = param.getKqdm();
+
+        try {
+            if (null == conf) {
+                conf = apiCommonService.getConf(kqdm);
+            }
+
+            //娣诲姞鏃ュ織
+            ApiLog apiLog = new ApiLog();
+            apiLog.setId(ContextUtil.getUUID());
+            apiLog.setInteId(inteId);
+
+            if (StringUtils.isEmpty(inteId)) {
+                ResponseDto responseDto = new ResponseDto(99, "娌℃湁鑾峰彇鍒版帴鍙�");
+                apiLog.setStatus(99);
+                apiLog.setResult("娌℃湁鑾峰彇鍒版帴鍙�");
+                apiLogRep.save(apiLog);
+                return responseDto;
+            }
+
+            if (conf == null) {
+                ResponseDto responseDto = new ResponseDto(99, "娌℃湁鑾峰彇鍒颁笂浼犻厤缃�");
+                apiLog.setStatus(99);
+                apiLog.setResult("娌℃湁鑾峰彇鍒颁笂浼犻厤缃�");
+                apiLogRep.save(apiLog);
+                return responseDto;
+            }
+
+            //鏌ヨ搴撳尯淇℃伅琛屾斂鍖哄垝鐮�
+            List<Api1102> api1102List = api1102Rep.findPushData(kqdm);
+            //灏佽鏁版嵁
+            SH2023PullReqDto reqData = new SH2023PullReqDto();;
+
+            reqData.setName(conf.getUserName());
+            reqData.setPwd(conf.getAppCode());
+
+            log.info("鎷夊彇鍏变韩鏁版嵁璇锋眰淇℃伅=" + JSON.toJSONString(reqData));
+
+            String url = conf.getApiUrl().replace("UPLOAD", "Shared");
+            SH2023PullRespDto responseDto = SH2023HttpClientUtil.postPullData(url + inteId, JSON.toJSONString(reqData));
+
+            apiLog.setStatus(responseDto.getRetcode() == 200 ? 0 : responseDto.getRetcode());
+            apiLog.setResult(responseDto.getRetMsg());
+            apiLogRep.save(apiLog);
+            ResponseDto resd = new ResponseDto();
+            resd.setSuccess(responseDto.getRetcode() == 200 ? 0 : responseDto.getRetcode());
+            resd.setMsg(responseDto.getRetMsg());
+            resd.setData(responseDto.getData());
+            return resd;
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            return new ResponseDto(99, e.getMessage());
+        }
+    }
+
     /**
      * 杞负JSON
      *
@@ -294,6 +352,8 @@
             api1109.setWjl(JSON.toJSONString(map));
             //涓婃捣甯傚钩鍙版枃浠跺悕绉拌鍒欙細搴撳尯缂栫爜_涓氬姟娴佹按鍙穇鍒嗙被鐮乢椤哄簭鐮�.jpg锛屼緥濡傦細91310114703439394M001_142211080101_GL_00.jpg
             api1109.setWjmc(getWjmc(api1109.getWjlx(), api1109.getWjmc()));
+            //涓氬姟绫诲瀷
+            api1109.setYwdh(getYwdh(api1109.getWjlx(), api1109.getWjmc()));
             //璁剧疆绌哄睘鎬т负榛樿鍊�
             changeObject(api1109);
             return api1109;
@@ -1189,6 +1249,14 @@
         }
         return wjmc;
     }
+    private String getYwdh(String wjlx, String wjmc) {
+        String ywdh = "";
+        String[] s = wjmc.split("_");
+        if ("2".equals(wjlx) || "3".equals(wjlx)) {
+            ywdh = s[1];
+        }
+        return ywdh;
+    }
 
     private Object changeObject(Object object) {
         // 浣跨敤鍙嶅皠鑾峰彇灞炴�у垪琛� vo涓哄疄浣撳璞″悕
@@ -1218,4 +1286,5 @@
         }
         return object;
     }
+
 }
\ No newline at end of file

--
Gitblit v1.9.3