From 530af60d6c6a82c11ab2c4aeb6a691c0c0c64eaf Mon Sep 17 00:00:00 2001
From: CZT <czt18638530771@163.com>
Date: 星期二, 02 一月 2024 16:44:49 +0800
Subject: [PATCH] 调整1307-仓内视频图像同步信息
---
src/main/java/com/fzzy/push/sh2023/SH2023ApiRemoteService.java | 141 ++++++++++++++++++++++++++++++++++++++++------
1 files changed, 121 insertions(+), 20 deletions(-)
diff --git a/src/main/java/com/fzzy/push/sh2023/SH2023ApiRemoteService.java b/src/main/java/com/fzzy/push/sh2023/SH2023ApiRemoteService.java
index b6ee00b..f4820d2 100644
--- a/src/main/java/com/fzzy/push/sh2023/SH2023ApiRemoteService.java
+++ b/src/main/java/com/fzzy/push/sh2023/SH2023ApiRemoteService.java
@@ -54,11 +54,15 @@
@Autowired
private Api1208Rep api1208Rep;
@Autowired
+ private Api1210Rep api1210Rep;
+ @Autowired
private Api1109Rep api1109Rep;
@Autowired
private Api1202Rep api1202Rep;
@Autowired
private Api1205Rep api1205Rep;
+ @Autowired
+ private Api1403Rep api1403Rep;
@Autowired
private Api1404Rep api1404Rep;
@@ -162,6 +166,61 @@
}
}
+ @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;
+ }
+
+ //灏佽鏁版嵁
+ 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
*
@@ -183,7 +242,6 @@
list.add(object);
return JSON.toJSONString(list);
}
-
}
/**
@@ -195,7 +253,6 @@
* @return
*/
private Object getJsonApiData(String inteId, Object data, String code) {
- List<Object> list = new ArrayList<>();
//鍏蜂綋鏍规嵁鎺ュ彛杩涜灏佽
if (SH2023Constant.SH_2023_API_CODE_1101.equals(inteId)) {
SH2023Api1101 api1101 = new SH2023Api1101();
@@ -242,7 +299,12 @@
BeanUtils.copyProperties(apiData, api1104);
api1104.setAjdm(apiData.getAjdh());
api1104.setCfdm(apiData.getCfbh());
- api1104.setLsxzdm("122");
+
+ //璁剧疆绮鎬ц川浠g爜(鏌ョ湅寤掗棿瀵瑰簲鐨勬渶鏂板簱瀛樿繘琛岃祴鍊�)
+ List<Api1208> api1208List = api1208Rep.findDataByHwdm(api1104.getAjdm() + "01");
+ if (null != api1208List && api1208List.size() > 0) {
+ api1104.setLsxzdm(api1208List.get(0).getLsxzdm());
+ }
//璁剧疆绌哄睘鎬т负榛樿鍊�
changeObject(api1104);
@@ -295,7 +357,7 @@
//涓婃捣甯傚钩鍙版枃浠跺悕绉拌鍒欙細搴撳尯缂栫爜_涓氬姟娴佹按鍙穇鍒嗙被鐮乢椤哄簭鐮�.jpg锛屼緥濡傦細91310114703439394M001_142211080101_GL_00.jpg
api1109.setWjmc(getWjmc(api1109.getWjlx(), api1109.getWjmc()));
//涓氬姟绫诲瀷
- api1109.setYwdh(getYwdh(api1109.getWjlx(), api1109.getWjmc()));
+ api1109.setYwdh(getYwdh(api1109.getWjlx(), api1109.getWjmc(), api1109.getYwdh()));
//璁剧疆绌哄睘鎬т负榛樿鍊�
changeObject(api1109);
return api1109;
@@ -327,6 +389,7 @@
BeanUtils.copyProperties(data, api1112);
api1112.setHdrychsj(api1112.getQdzgzchzyzgsj());
api1112.setBjw(ShAreaBjw.getBjw(code));
+ api1112.setZy("01");
//璁剧疆绌哄睘鎬т负榛樿鍊�
changeObject(api1112);
@@ -375,18 +438,29 @@
if (StringUtils.isEmpty(api1202.getRkjsdh())) {
api1202.setRkjsdh("0");
}
-
- //璁剧疆绮杞崲骞村害
+ //璁剧疆绮杞崲骞村害,鏍规嵁璁″垝鏄庣粏鍙锋煡璇㈣鍒掓槑缁嗭紝鍐嶆牴鎹鍒掓槑缁嗘煡璇㈣疆鎹㈣鍒�
List<Api1404> api1404List = api1404Rep.getDataByJhmxdh(apiData.getJhmxh());
if (null != api1404List && api1404List.size() > 0) {
- api1202.setLhnd(api1404List.get(0).getShnd());
+ List<Api1403> api1403List = api1403Rep.getDataByLhjhdh(api1404List.get(0).getLhjhdh());
+ if(null != api1403List && api1403List.size() > 0){
+ if(StringUtils.isNotEmpty(api1403List.get(0).getJhnd())){
+ api1202.setLhnd(api1403List.get(0).getJhnd());
+ }
+ }
}
-
+ //鏌ヨ绮鎬ц川杞彉鍗曞彿(鏍规嵁鍏ュ簱鏃堕棿鍜岃揣浣嶄唬鐮佹煡璇㈢伯椋熸�ц川杞彉鍗�)
+ List<Api1210> api1210List = api1210Rep.findDataByHwdmAndTime(api1202.getHwdm(), api1202.getCmsj());
+ if (null != api1210List && api1210List.size() > 0) {
+ api1202.setLsxzzbdh(api1210List.get(0).getLsxzzbdh());
+ }
//璁剧疆鎵规鍙�
List<Api1208> api1208List = api1208Rep.findDataByHwdm(api1202.getHwdm());
if (null != api1208List && api1208List.size() > 0) {
api1202.setPch(apiData.getHwdm() + api1208List.get(0).getShnd());
}
+ //绮鎬ц川
+ api1202.setLsxzdm("200");
+
//璁剧疆绌哄睘鎬т负榛樿鍊�
changeObject(api1202);
return api1202;
@@ -413,7 +487,14 @@
if (null != api1208List && api1208List.size() > 0) {
api1203.setPch(apiData.getHwdm() + api1208List.get(0).getShnd());
}
-
+ //璁剧疆璐ㄦ缂栫爜(榛樿绛夊悓浜庡叆搴撹川妫�鍗曞彿),鑻ヤ负鑸硅繍锛屽垯璁剧疆涓虹郴缁熷唴鑸硅繍鐨勫崟鍙�
+ api1203.setZjbh(api1203.getRkjydh());
+ List<Api1202> api1202List = api1202Rep.getDataById(api1203.getRkywdh());
+ if (null != api1202List && api1202List.size() > 0) {
+ if(api1202List.get(0).getYsgj().equals("3")){
+ api1203.setZjbh(api1202List.get(0).getBizId().substring(2));
+ }
+ }
//璁剧疆绌哄睘鎬т负榛樿鍊�
changeObject(api1203);
return api1203;
@@ -463,7 +544,12 @@
//璁剧疆绮杞崲骞村害
List<Api1404> api1404List = api1404Rep.getDataByJhmxdh(apiData.getJhmxh());
if (null != api1404List && api1404List.size() > 0) {
- api1205.setLhnd(api1404List.get(0).getShnd());
+ List<Api1403> api1403List = api1403Rep.getDataByLhjhdh(api1404List.get(0).getLhjhdh());
+ if(null != api1403List && api1403List.size() > 0){
+ if(StringUtils.isNotEmpty(api1403List.get(0).getJhnd())){
+ api1205.setLhnd(api1403List.get(0).getJhnd());
+ }
+ }
}
//璁剧疆鎵规鍙�
@@ -472,6 +558,8 @@
api1205.setPch(apiData.getHwdm() + api1208List.get(0).getShnd());
}
+ //绮鎬ц川
+ api1205.setLsxzdm("200");
//璁剧疆绌哄睘鎬т负榛樿鍊�
changeObject(api1205);
return api1205;
@@ -545,6 +633,9 @@
api1209.setPch(api1209.getHwdm() + api1208List.get(0).getShnd());
}
+ //绮鎬ц川,鏆傛椂榛樿鍖虹骇鍌ㄥ
+ api1209.setLsxzdm("122");
+
//璁剧疆绌哄睘鎬т负榛樿鍊�
changeObject(api1209);
return api1209;
@@ -576,7 +667,8 @@
if (null != api1208List && api1208List.size() > 0) {
api1211.setPch(apiData.getHwdm() + api1208List.get(0).getShnd());
}
-
+ //涓荤绮簱浠g爜
+ api1211.setZglkdm(apiData.getKqdm());
//璁剧疆绌哄睘鎬т负榛樿鍊�
changeObject(api1211);
return api1211;
@@ -785,6 +877,22 @@
api1403.setJhzxdwmc(api1101List.get(0).getDwmc());
api1403.setBjw(ShAreaBjw.getBjw(code));
+ //鏌ヨ杞崲璁″垝鐨勮疆鍏ユ暟閲忓拰杞嚭鏁伴噺
+ List<Api1404> list = api1404Rep.getDataByLhjhdh(api1403.getLhjhdh());
+ Double lrsl = 0.0, lcsl = 0.0; //鐢ㄤ簬缁熻杞叆鏁伴噺鍜岃疆鍑烘暟閲�
+ if(null != list && list.size() > 0){
+ for (Api1404 api1404 : list) {
+ if(null!= api1404.getLhlx() && "2".equals(api1404.getLhlx())){
+ lrsl += api1404.getLhsl();
+ }
+ if(null!= api1404.getLhlx() && "1".equals(api1404.getLhlx())){
+ lcsl += api1404.getLhsl();
+ }
+ }
+ }
+ api1403.setLrsl(lrsl/1000 + "");
+ api1403.setLcsl(lcsl/1000 + "");
+
//璁剧疆绌哄睘鎬т负榛樿鍊�
changeObject(api1403);
return api1403;
@@ -875,7 +983,7 @@
map.put(ceng, new ArrayList<>());
}
map.get(ceng).add(Double.valueOf(grain[0]));
- lwmx += grain[1] + ":" + grain[2] + ":" + grain[3] + "$" + grain[0];
+ lwmx += grain[2] + ":" + grain[3] +":" + grain[1] + "$" + grain[0];
if (Double.valueOf(grain[0]) <= -100) {
lwmx += "$" + "1" + "#";
errorNum++;
@@ -1191,8 +1299,7 @@
}
return wjmc;
}
- private String getYwdh(String wjlx, String wjmc) {
- String ywdh = "";
+ private String getYwdh(String wjlx, String wjmc, String ywdh) {
String[] s = wjmc.split("_");
if ("2".equals(wjlx) || "3".equals(wjlx)) {
ywdh = s[1];
@@ -1227,12 +1334,6 @@
}
}
return object;
- }
-
- @Override
- public ResponseDto pullData(ApiParam param, ApiConfs conf) {
- //璇ュ崗璁棤姝ゅ疄鐜�
- return null;
}
}
\ No newline at end of file
--
Gitblit v1.9.3