From 13391e649a65a374e390066a35b52c61a6feaa3f Mon Sep 17 00:00:00 2001 From: CZT <czt18638530771@163.com> Date: 星期二, 14 十一月 2023 21:19:40 +0800 Subject: [PATCH] 调整心跳指令返回 --- src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1206.java | 4 src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1204.java | 10 ++ src/main/java/com/fzzy/push/sh2023/dto/SH2023Api1104.java | 172 ++++++++++++++++++++++++++++++---- src/main/java/com/fzzy/api/view/repository/Api1104Rep.java | 7 + src/main/java/com/fzzy/order/OrderServer.java | 4 src/main/java/com/fzzy/push/sh2023/SH2023ApiRemoteService.java | 82 ++++++++++------ 6 files changed, 226 insertions(+), 53 deletions(-) diff --git a/src/main/java/com/fzzy/api/view/repository/Api1104Rep.java b/src/main/java/com/fzzy/api/view/repository/Api1104Rep.java index a330db0..67e5fe3 100644 --- a/src/main/java/com/fzzy/api/view/repository/Api1104Rep.java +++ b/src/main/java/com/fzzy/api/view/repository/Api1104Rep.java @@ -46,4 +46,11 @@ */ @Query("from Api1104 where kqdm=:kqdm and zhgxsj >=:start and zhgxsj <:end order by zhgxsj ") List<Api1104> findPushDataTime(@Param("kqdm") String kqdm, @Param("start") Date start, @Param("end") Date end); + + /** + * @param + * @return + */ + @Query("from Api1104 where cfbh=:cfbh ") + List<Api1104> findDataByCfbh(@Param("cfbh") String cfbh); } diff --git a/src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1204.java b/src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1204.java index a412655..bbb1b5f 100644 --- a/src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1204.java +++ b/src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1204.java @@ -1,6 +1,7 @@ package com.fzzy.async.fzzy40.impl; import com.fzzy.api.Constant; +import com.fzzy.api.entity.Api1102; import com.fzzy.api.entity.Api1105; import com.fzzy.api.entity.Api1204; import com.fzzy.api.entity.ApiLog; @@ -36,6 +37,8 @@ @Autowired private ApiLogRep apiLogRep; @Autowired + private Api1102Rep api1102Rep; + @Autowired private Api1204Rep api1204Rep; @Autowired private ApiCommonService commonService; @@ -68,6 +71,8 @@ log.info("-------------娌℃湁鑾峰彇鍒扮伯椋熷叆搴撶粨绠椾俊鎭�------------------"); return; } + //鏍规嵁搴撳尯浠g爜鑾峰彇搴撳尯淇℃伅 + Api1102 api1102 = api1102Rep.findById(kqdm).get(); Api1204 apiData; Api1105 api1105; @@ -78,6 +83,11 @@ //鍏ュ簱缁撶畻鍗曞彿:搴撳尯浠g爜 + yyyyMMdd + 4涓洪『搴忓彿 apiData.setRkjsdh(kqdm + sysData.getId()); + //鍚堝悓鍙� + if(StringUtils.isNotEmpty(sysData.getContractId())){ + apiData.setHth(api1102.getDwdm() + sysData.getContractId()); + } + if(StringUtils.isNotEmpty(sysData.getDepotId())){ api1105 = commonService.getApi1105Cache(sysData.getDepotId()); //璐т綅浠g爜 diff --git a/src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1206.java b/src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1206.java index 5a57bfc..aa68e8e 100644 --- a/src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1206.java +++ b/src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1206.java @@ -67,7 +67,7 @@ } //鏍规嵁搴撳尯浠g爜鑾峰彇搴撳尯淇℃伅 - Api1102 api1201 = api1102Rep.findById(kqdm).get(); + Api1102 api1102 = api1102Rep.findById(kqdm).get(); Api1206 apiData; List<Api1206> api1206List; @@ -79,7 +79,7 @@ //鍚堝悓鍙� if(StringUtils.isNotEmpty(sysData.getContractId())){ - apiData.setHth(api1201.getDwdm() + sysData.getContractId()); + apiData.setHth(api1102.getDwdm() + sysData.getContractId()); } //缁撶畻閲嶉噺銆佺粨绠楀崟浠枫�佺粨绠楅噾棰濄�佺粨绠楁椂闂� diff --git a/src/main/java/com/fzzy/order/OrderServer.java b/src/main/java/com/fzzy/order/OrderServer.java index 8cf015d..f83f2d1 100644 --- a/src/main/java/com/fzzy/order/OrderServer.java +++ b/src/main/java/com/fzzy/order/OrderServer.java @@ -40,7 +40,9 @@ //蹇冭烦鎸囦护锛岀洿鎺ヨ繑鍥� if(OrderConstant.ORDER_TYPE_0.equals(req.getType())){ - return new OrderResp(OrderResult.ORDER_CODE_500.getCode(), OrderResult.ORDER_CODE_500.getResult()); + OrderResp resp = new OrderResp(OrderResult.ORDER_CODE_200.getCode(), OrderResult.ORDER_CODE_500.getResult()); + log.info("蹇冭烦鎸囦护杩斿洖淇℃伅={}", resp); + return resp; } try { diff --git a/src/main/java/com/fzzy/push/sh2023/SH2023ApiRemoteService.java b/src/main/java/com/fzzy/push/sh2023/SH2023ApiRemoteService.java index 25bdc64..52c60e7 100644 --- a/src/main/java/com/fzzy/push/sh2023/SH2023ApiRemoteService.java +++ b/src/main/java/com/fzzy/push/sh2023/SH2023ApiRemoteService.java @@ -47,6 +47,8 @@ @Autowired private Api1102Rep api1102Rep; @Autowired + private Api1103Rep api1103Rep; + @Autowired private Api1104Rep api1104Rep; @Autowired private Api1208Rep api1208Rep; @@ -221,6 +223,21 @@ if (SH2023Constant.SH_2023_API_CODE_1104.equals(inteId)) { SH2023Api1104 api1104 = new SH2023Api1104(); Api1104 apiData = (Api1104) data; + + //鏌ヨ浠撴埧淇℃伅 + List<Api1103> api1103List = api1103Rep.findPushDataByCfdm(apiData.getCfbh()); + List<Api1104> api1104List = api1104Rep.findDataByCfbh(apiData.getCfbh()); + int num = 2; + if (null != api1104List && api1104List.size() > 0) { + num = api1104List.size(); + } + if (null != api1103List && api1103List.size() > 0) { + Api1103 api1103 = api1103List.get(0); + BeanUtils.copyProperties(api1103, api1104); + api1104.setCwc(api1103.getCwc() / num); + api1104.setCnc(api1103.getCnc() / num); + api1104.setSjcr(api1103.getSjcr() / num); + } BeanUtils.copyProperties(apiData, api1104); api1104.setAjdm(apiData.getAjdh()); api1104.setCfdm(apiData.getCfbh()); @@ -352,13 +369,13 @@ //璁剧疆绮杞崲骞村害 List<Api1404> api1404List = api1404Rep.getDataByJhmxdh(apiData.getJhmxh()); - if(null != api1404List && api1404List.size() >0){ + if (null != api1404List && api1404List.size() > 0) { api1202.setLhnd(api1404List.get(0).getShnd()); } //璁剧疆鎵规鍙� List<Api1208> api1208List = api1208Rep.findDataByHwdm(api1202.getHwdm()); - if(null != api1208List && api1208List.size() > 0){ + if (null != api1208List && api1208List.size() > 0) { api1202.setPch(apiData.getHwdm() + api1208List.get(0).getShnd()); } //璁剧疆绌哄睘鎬т负榛樿鍊� @@ -384,7 +401,7 @@ } //璁剧疆鎵规鍙� List<Api1208> api1208List = api1208Rep.findDataByHwdm(api1203.getHwdm()); - if(null != api1208List && api1208List.size() > 0){ + if (null != api1208List && api1208List.size() > 0) { api1203.setPch(apiData.getHwdm() + api1208List.get(0).getShnd()); } @@ -399,13 +416,19 @@ api1204.setBjw(ShAreaBjw.getBjw(code)); //璁剧疆鎵规鍙� - if(StringUtils.isNotEmpty(api1204.getHth())){ + if (StringUtils.isNotEmpty(api1204.getHth())) { List<Api1202> api1202List = api1202Rep.getDataByRkjsdh(api1204.getRkjsdh()); - if(null != api1202List && api1202List.size() > 0){ + if (null != api1202List && api1202List.size() > 0) { List<Api1208> api1208List = api1208Rep.findDataByHwdm(api1202List.get(0).getHwdm()); - if(null != api1208List && api1208List.size() > 0){ + if (null != api1208List && api1208List.size() > 0) { api1204.setPch(api1208List.get(0).getHwdm() + api1208List.get(0).getShnd()); } + } + } + if (StringUtils.isNotEmpty(api1204.getHwdm())) { + List<Api1208> api1208List = api1208Rep.findDataByHwdm(api1204.getHwdm()); + if (null != api1208List && api1208List.size() > 0) { + api1204.setPch(api1208List.get(0).getHwdm() + api1208List.get(0).getShnd()); } } @@ -430,13 +453,13 @@ //璁剧疆绮杞崲骞村害 List<Api1404> api1404List = api1404Rep.getDataByJhmxdh(apiData.getJhmxh()); - if(null != api1404List && api1404List.size() >0){ + if (null != api1404List && api1404List.size() > 0) { api1205.setLhnd(api1404List.get(0).getShnd()); } //璁剧疆鎵规鍙� List<Api1208> api1208List = api1208Rep.findDataByHwdm(api1205.getHwdm()); - if(null != api1208List && api1208List.size() > 0){ + if (null != api1208List && api1208List.size() > 0) { api1205.setPch(apiData.getHwdm() + api1208List.get(0).getShnd()); } @@ -450,16 +473,15 @@ BeanUtils.copyProperties(apiData, api1206); api1206.setBjw(ShAreaBjw.getBjw(code)); //鎵规鍙� - if(StringUtils.isNotEmpty(api1206.getHth())){ + if (StringUtils.isNotEmpty(api1206.getHth())) { List<Api1205> api1205List = api1205Rep.getDataByCkjsdh(api1206.getCkjsdh()); - if(null != api1205List && api1205List.size() > 0){ + if (null != api1205List && api1205List.size() > 0) { List<Api1208> api1208List = api1208Rep.findDataByHwdm(api1205List.get(0).getHwdm()); - if(null != api1208List && api1208List.size() > 0){ + if (null != api1208List && api1208List.size() > 0) { api1206.setPch(api1208List.get(0).getHwdm() + api1208List.get(0).getShnd()); } } } - //璁剧疆绌哄睘鎬т负榛樿鍊� changeObject(api1206); return api1206; @@ -474,7 +496,7 @@ api1207.setBjw(ShAreaBjw.getBjw(code)); List<Api1208> api1208List = api1208Rep.findDataByHwdm(api1207.getDchwdm()); - if(null != api1208List && api1208List.size() > 0){ + if (null != api1208List && api1208List.size() > 0) { api1207.setPch(api1207.getDchwdm() + api1208List.get(0).getShnd()); } @@ -510,7 +532,7 @@ api1209.setBjw(ShAreaBjw.getBjw(code)); api1209.setJzrq(apiData.getYwrq()); List<Api1208> api1208List = api1208Rep.findDataByHwdm(api1209.getHwdm()); - if(null != api1208List && api1208List.size() > 0){ + if (null != api1208List && api1208List.size() > 0) { api1209.setPch(api1209.getHwdm() + api1208List.get(0).getShnd()); } @@ -525,7 +547,7 @@ BeanUtils.copyProperties(apiData, api1210); api1210.setBjw(ShAreaBjw.getBjw(code)); List<Api1208> api1208List = api1208Rep.findDataByHwdm(api1210.getHwdm()); - if(null != api1208List && api1208List.size() > 0){ + if (null != api1208List && api1208List.size() > 0) { api1210.setPch(apiData.getHwdm() + api1208List.get(0).getShnd()); } @@ -542,7 +564,7 @@ api1211.setBjw(ShAreaBjw.getBjw(code)); api1211.setPch(apiData.getHwdm() + DateFormatUtils.format(apiData.getYwrq(), "yyyyMM")); List<Api1208> api1208List = api1208Rep.findDataByHwdm(api1211.getHwdm()); - if(null != api1208List && api1208List.size() > 0){ + if (null != api1208List && api1208List.size() > 0) { api1211.setPch(apiData.getHwdm() + api1208List.get(0).getShnd()); } @@ -580,7 +602,7 @@ api1302.setLwmx(apiData.getLswdzjh()); List<Api1208> api1208List = api1208Rep.findDataByHwdm(api1302.getHwdm()); - if(null != api1208List && api1208List.size() > 0){ + if (null != api1208List && api1208List.size() > 0) { api1302.setPch(apiData.getHwdm() + api1208List.get(0).getShnd()); } @@ -594,7 +616,7 @@ BeanUtils.copyProperties(apiData, api1303); api1303.setBjw(ShAreaBjw.getBjw(code)); List<Api1208> api1208List = api1208Rep.findDataByHwdm(api1303.getHwdm()); - if(null != api1208List && api1208List.size() > 0){ + if (null != api1208List && api1208List.size() > 0) { api1303.setPch(apiData.getHwdm() + api1208List.get(0).getShnd()); } //璁剧疆绌哄睘鎬т负榛樿鍊� @@ -607,7 +629,7 @@ BeanUtils.copyProperties(apiData, api1304); api1304.setBjw(ShAreaBjw.getBjw(code)); List<Api1208> api1208List = api1208Rep.findDataByHwdm(api1304.getHwdm()); - if(null != api1208List && api1208List.size() > 0){ + if (null != api1208List && api1208List.size() > 0) { api1304.setPch(apiData.getHwdm() + api1208List.get(0).getShnd()); } @@ -693,8 +715,8 @@ String lsxzdm = "122"; String pch = ""; List<Api1208> api1208List = api1208Rep.getDataByHwdm(api1310.getHwdm()); - if(null != api1208List && api1208List.size() > 0){ - if(StringUtils.isNotEmpty(api1208List.get(0).getLsxzdm())){ + if (null != api1208List && api1208List.size() > 0) { + if (StringUtils.isNotEmpty(api1208List.get(0).getLsxzdm())) { lsxzdm = api1208List.get(0).getLsxzdm(); pch = apiData.getHwdm() + api1208List.get(0).getShnd(); } @@ -702,16 +724,16 @@ //璁剧疆鎵规鍙� api1310.setPch(pch); api1310.setLsxzdm(lsxzdm); - if (api1310.getYpsl() == 0.0){ + if (api1310.getYpsl() == 0.0) { api1310.setYpsl(5.0); } - if(StringUtils.isEmpty(api1310.getQyrxm())){ + if (StringUtils.isEmpty(api1310.getQyrxm())) { api1310.setQyrxm("鎵︽牱浜�"); } - if(StringUtils.isEmpty(api1310.getJdrxm())){ + if (StringUtils.isEmpty(api1310.getJdrxm())) { api1310.setJdrxm("鐩戠潱浜�"); } - if(StringUtils.isEmpty(api1310.getShrxm())){ + if (StringUtils.isEmpty(api1310.getShrxm())) { api1310.setShrxm("瀹℃牳浜�"); } @@ -779,7 +801,7 @@ SH2023Api2102 apiData = new SH2023Api2102(); BeanUtils.copyProperties(data, apiData); List<Api1208> api1208List = api1208Rep.findDataByHwdm(apiData.getDrhwdm()); - if(null != api1208List && api1208List.size() > 0){ + if (null != api1208List && api1208List.size() > 0) { apiData.setPch(apiData.getDrhwdm() + api1208List.get(0).getShnd()); } //璁剧疆绌哄睘鎬т负榛樿鍊� @@ -814,12 +836,12 @@ return data; } - private String getWjmc(String wjlx, String wjmc){ - if("2".equals(wjlx) || "3".equals(wjlx) || "4".equals(wjlx) || "5".equals(wjlx)){ - if(wjmc.endsWith(".jpg")) { + private String getWjmc(String wjlx, String wjmc) { + if ("2".equals(wjlx) || "3".equals(wjlx) || "4".equals(wjlx) || "5".equals(wjlx)) { + if (wjmc.endsWith(".jpg")) { wjmc = wjmc.replaceAll(".jpg", "_00.jpg"); } - if(wjmc.endsWith(".png")) { + if (wjmc.endsWith(".png")) { wjmc = wjmc.replaceAll(".png", "_00.png"); } } diff --git a/src/main/java/com/fzzy/push/sh2023/dto/SH2023Api1104.java b/src/main/java/com/fzzy/push/sh2023/dto/SH2023Api1104.java index 23ab0ed..ac5daf4 100644 --- a/src/main/java/com/fzzy/push/sh2023/dto/SH2023Api1104.java +++ b/src/main/java/com/fzzy/push/sh2023/dto/SH2023Api1104.java @@ -29,30 +29,159 @@ @PropertyDef(label = "浠撴埧(鎴栨补缃�)缂栫爜") private String cfdm; - @PropertyDef(label = "寤掗棿闀垮害") - private Double ajcd; + @PropertyDef(label = "浠撴埧绫诲瀷浠g爜") + private String cflxdm; - @PropertyDef(label = "寤掗棿瀹藉害") - private Double ajkd; - - @PropertyDef(label = "寤掗棿楂樺害") - private Double ajgd; - - @PropertyDef(label = "寤掗棿璁捐浠撳") - private Double ajsjcr; - - @PropertyDef(label = "寤掗棿鑱旂郴鐢佃瘽") - private String ajlxdh; - + @PropertyDef(label = "浜や粯浣跨敤鏃ユ湡") @JSONField(format = "yyyy-MM-dd") - @PropertyDef(label = "寤掗棿鍚敤鏃ユ湡") - private Date ajqyrq; + private Date jfsyrq; - @PropertyDef(label = "浣跨敤搴撳尯浠g爜") - private String sykqdm; + @PropertyDef(label = "寤鸿鍗曚綅") + private String jsdw; - @PropertyDef(label = "寤掗棿鐘舵��") - private String ajzt; + @PropertyDef(label = "璁捐浣跨敤骞撮檺") + private String sjsynx; + + @PropertyDef(label = "璁捐鍗曚綅") + private String sjdw; + + @PropertyDef(label = "鐩戠悊鍗曚綅") + private String jldw; + + @PropertyDef(label = "澧欎綋缁撴瀯") + private String qtjg; + + @PropertyDef(label = "鎴块《缁撴瀯") + private String fdjg; + + @PropertyDef(label = "鎴挎灦缁撴瀯") + private String fjjg; + + @PropertyDef(label = "鍦伴潰缁撴瀯") + private String dmjg; + + @PropertyDef(label = "璁捐浠撳") + private Double sjcr; + + @PropertyDef(label = "浠撳闀�") + private Double cwc; + + @PropertyDef(label = "浠撳瀹�") + private Double cwk; + + @PropertyDef(label = "浠撳妾愰珮") + private Double cwyg; + + @PropertyDef(label = "浠撳椤堕珮") + private Double cwdg; + + @PropertyDef(label = "绛掍粨澶栧緞") + private Double tcwj; + + @PropertyDef(label = "浠撳唴闀�") + private Double cnc; + + @PropertyDef(label = "浠撳唴瀹�") + private Double cnk; + + @PropertyDef(label = "浠撳唴妾愰珮") + private Double cnyg; + + @PropertyDef(label = "浠撳唴瑁呯伯绾块珮") + private Double cnzlxg; + + @PropertyDef(label = "绛掍粨鍐呭緞") + private Double tcnj; + + @PropertyDef(label = "浠撳唴浣撶Н") + private Double cntj; + + @PropertyDef(label = "浠撻棬鏁伴噺") + private Integer cmsl; + + @PropertyDef(label = "浠撻棬浣嶇疆") + private String cmwz; + + @PropertyDef(label = "浠撻棬楂樺害") + private Double cmgd; + + @PropertyDef(label = "浠撻棬瀹藉害") + private Double cmkd; + + @PropertyDef(label = "鎸$伯闂ㄥ瀷寮�") + private String dlmxs; + + @PropertyDef(label = "浠撴埧鏄惁瀹屽ソ") + private String cfsfwh; + + @PropertyDef(label = "鍌ㄧ伯鍔熸晥") + private String clgx; + + @PropertyDef(label = "鑳藉惁闅旂儹淇濇俯") + private String nfgrbw; + + @PropertyDef(label = "闅旂儹淇濇俯鎺柦") + private String grbwcs; + + @PropertyDef(label = "闅旂儹鎬ц兘") + private String grxn; + + @PropertyDef(label = "缁撴瀯鏉愭枡") + private String jgcl; + + @PropertyDef(label = "姘斿瘑鎬�") + private String qmx; + + @PropertyDef(label = "鏄惁宸茶繘琛屼俊鎭寲鏀归��") + private String sfyjxxxhgz; + + @PropertyDef(label = "绮儏鎶�鏈�") + private String lqjs; + + @PropertyDef(label = "鑳藉惁鏁h鍌ㄥ瓨") + private String nfszcc; + + @PropertyDef(label = "鏈夋棤闃查紶闃查泙闃茶櫕瑁呯疆鍙婅鏂�") + private String ywfsfqfczz; + + @PropertyDef(label = "鏈夋棤闃茬伀闃茬垎闃茬洍璁炬柦") + private String ywfhfbfdss; + + @PropertyDef(label = "鏈夋棤鏈烘閫氶璁炬柦") + private String ywjxtfss; + + @PropertyDef(label = "閫氶绯荤粺鍨嬪紡") + private String tfxtxs; + + @PropertyDef(label = "閫氶鎶�鏈�") + private String tfjs; + + @PropertyDef(label = "鑳藉惁鐜祦鐔忚捀鏉�铏�") + private String nfhlxzsc; + + @PropertyDef(label = "鏉�铏妧鏈�") + private String scjs; + + @PropertyDef(label = "鑳藉惁瀵屾爱浣庢哀姘旇皟鍌ㄧ伯") + private String nffddyqtcl; + + @PropertyDef(label = "鎺ф俯鎶�鏈�") + private String kwjs; + + @PropertyDef(label = "瀹宠櫕妫�娴嬫柟寮�") + private String hcjcfs; + + @PropertyDef(label = "浠撴埧鐘舵��") + private String cfzt; + + @PropertyDef(label = "淇濈鍛�") + private String bgr; + + @PropertyDef(label = "浠撴埧缁忓害") + private Double jd; + + @PropertyDef(label = "浠撴埧绾害") + private Double wd; @PropertyDef(label = "鎿嶄綔鏍囧織") private String czbz; @@ -61,6 +190,9 @@ @PropertyDef(label = "鏈�鍚庢洿鏂版椂闂�") private Date zhgxsj; + @PropertyDef(label = "绮鎬ц川浠g爜") + private String lsxzdm; + @PropertyDef(label = "鏍囪浣�") private String bjw; -- Gitblit v1.9.3