From a52c743aa44dde176adf3159c8dd71a69ba778d5 Mon Sep 17 00:00:00 2001
From: CZT <czt18638530771@163.com>
Date: 星期五, 12 一月 2024 19:45:17 +0800
Subject: [PATCH] 优化上海接口

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

diff --git a/src/main/java/com/fzzy/push/sh2023/SH2023ApiRemoteService.java b/src/main/java/com/fzzy/push/sh2023/SH2023ApiRemoteService.java
index 0166dba..176a42a 100644
--- a/src/main/java/com/fzzy/push/sh2023/SH2023ApiRemoteService.java
+++ b/src/main/java/com/fzzy/push/sh2023/SH2023ApiRemoteService.java
@@ -16,9 +16,12 @@
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang.StringUtils;
 import org.apache.commons.lang.time.DateFormatUtils;
+import com.fzzy.api.utils.NumberUtil;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+
+import java.lang.reflect.Field;
 import java.util.*;
 
 /**
@@ -41,15 +44,27 @@
     @Autowired
     private ApiLogRep apiLogRep;
     @Autowired
+    private Api1101Rep api1101Rep;
+    @Autowired
     private Api1102Rep api1102Rep;
     @Autowired
+    private Api1103Rep api1103Rep;
+    @Autowired
     private Api1104Rep api1104Rep;
+    @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;
 
     @Override
     public String getProtocol() {
@@ -75,7 +90,6 @@
             //娣诲姞鏃ュ織
             ApiLog apiLog = new ApiLog();
             apiLog.setId(ContextUtil.getUUID());
-
 
             //鑻ヤ负璐㈠姟1501銆�1502銆�1503鎺ュ彛锛屽垯鎺ュ彛缂栫爜濉啓1114
             if (SH2023Constant.SH_2023_API_CODE_1114_1501.equals(param.getInteId())
@@ -110,7 +124,7 @@
             //鑾峰彇鎸囦护id
             String key = RedisConst.buildKey(RedisConst.KYE_ORDER, conf.getKqdm());
             OrderData orderData = (OrderData) redisUtil.get(key);
-            if (StringUtils.isEmpty(orderData.getOrderid())) {
+            if (null == orderData || StringUtils.isEmpty(orderData.getOrderid())) {
                 log.error("鎸囦护id澶辨晥=" + jsonData);
                 ResponseDto responseDto = new ResponseDto(99, "鎸囦护id澶辨晥");
                 apiLog.setStatus(99);
@@ -129,21 +143,13 @@
 
             //韬唤绛惧悕锛屼娇鐢ㄨ嚜鏈塕SA绉侀挜杩涜鍔犲瘑(鍦板尯琛屾斂鍖哄垝浠g爜_褰撳ぉ鏃ユ湡)
             reqData.setAccess_token(ShRSAUtils.sign(reqData.getUid() + "_" + DateFormatUtils.format(new Date(), "yyyy-MM-dd"), conf.getPassword()));
-            //鏁版嵁鎬绘潯鏁�
-            if (SH2023Constant.SH_2023_API_CODE_1114_1501.equals(param.getInteId())
-                    || SH2023Constant.SH_2023_API_CODE_1114_1502.equals(param.getInteId())
-                    || SH2023Constant.SH_2023_API_CODE_1114_1503.equals(param.getInteId())) {
-                reqData.setDatalength(1);
-            }else {
-                List<Object> list = (List<Object>) data;
-                reqData.setDatalength(list.size());
-            }
+            reqData.setDatalength(1);
 
             //浣跨敤鍖虹骇骞冲彴鍏挜瀵规暟鎹繘琛孯SA鍔犲瘑
             reqData.setData(ShRSAUtils.encryptByPubKey(jsonData, conf.getPublicKey()));
             //鎽樿锛屾暟鎹富浣撶殑MD5鍊�
             reqData.setDigst(MyMD5Util.encrypt(jsonData));
-
+            log.info("涓婃姤鏁版嵁淇℃伅=" + JSON.toJSONString(reqData));
             SH2023RespDto responseDto = SH2023HttpClientUtil.postPushData(conf.getApiUrl() + inteId, JSON.toJSONString(reqData), conf);
 
             apiLog.setStatus(responseDto.getCode() == 200 ? 0 : responseDto.getCode());
@@ -160,20 +166,11 @@
         }
     }
 
-    /**
-     * 鎺ㄩ�佽储鍔℃暟鎹帴鍙�
-     *
-     * @param param
-     * @param conf
-     * @param data
-     * @return
-     */
-    private ResponseDto pushFinanceData(ApiParam param, ApiConfs conf, Object data) {
-
+    @Override
+    public ResponseDto pullData(ApiParam param, ApiConfs conf) {
         String inteId = param.getInteId();
         String kqdm = param.getKqdm();
-        //鏌ヨ搴撳尯淇℃伅琛屾斂鍖哄垝鐮�
-        List<Api1102> api1102List = api1102Rep.findPushData(conf.getKqdm());
+
         try {
             if (null == conf) {
                 conf = apiCommonService.getConf(kqdm);
@@ -182,9 +179,7 @@
             //娣诲姞鏃ュ織
             ApiLog apiLog = new ApiLog();
             apiLog.setId(ContextUtil.getUUID());
-            apiLog.setInteId("1114");
-            String jsonData = getJsonData(inteId, data, api1102List.get(0).getXzqhdm());
-            log.info("鎺ュ彛鏁版嵁淇℃伅=" + jsonData);
+            apiLog.setInteId(inteId);
 
             if (StringUtils.isEmpty(inteId)) {
                 ResponseDto responseDto = new ResponseDto(99, "娌℃湁鑾峰彇鍒版帴鍙�");
@@ -193,9 +188,6 @@
                 apiLogRep.save(apiLog);
                 return responseDto;
             }
-            apiLog.setData(jsonData);
-            apiLog.setKqdm(kqdm);
-            apiLog.setUploadTime(new Date());
 
             if (conf == null) {
                 ResponseDto responseDto = new ResponseDto(99, "娌℃湁鑾峰彇鍒颁笂浼犻厤缃�");
@@ -205,44 +197,23 @@
                 return responseDto;
             }
 
-            //鑾峰彇鎸囦护id
-            String key = RedisConst.buildKey(RedisConst.KYE_ORDER, conf.getKqdm());
-            OrderData orderData = (OrderData) redisUtil.get(key);
-            if (StringUtils.isEmpty(orderData.getOrderid())) {
-                ResponseDto responseDto = new ResponseDto(99, "鎸囦护id澶辨晥");
-                apiLog.setStatus(99);
-                apiLog.setResult("鎸囦护id澶辨晥");
-                apiLogRep.save(apiLog);
-                return responseDto;
-            }
+            //灏佽鏁版嵁
+            SH2023PullReqDto reqData = new SH2023PullReqDto();;
 
-            //灏佽鎺ㄩ�佹暟鎹�
-            SH2023ReqDto reqData = new SH2023ReqDto();
-            reqData.setId(ContextUtil.getUUID());
-            //鑾峰彇韬唤ID锛屽嵆琛屾斂鍖哄垝鐮�
-            reqData.setUid(conf.getUserName());
-            //鎸囦护id
-            reqData.setOrderid(orderData.getOrderid());
-            //韬唤绛惧悕锛屼娇鐢ㄨ嚜鏈塕SA绉侀挜杩涜鍔犲瘑(鍦板尯琛屾斂鍖哄垝浠g爜_褰撳ぉ鏃ユ湡)
-            reqData.setAccess_token(ShRSAUtils.sign(reqData.getUid() + "_" + DateFormatUtils.format(new Date(), "yyyy-MM-dd"), conf.getPassword()));
-            //鏁版嵁鎬绘潯鏁�
-            List<Object> list = (List<Object>) data;
-            reqData.setDatalength(list.size());
+            reqData.setName(conf.getUserName());
+            reqData.setPwd(conf.getAppCode());
+            log.info("鎷夊彇鍏变韩鏁版嵁璇锋眰淇℃伅=" + JSON.toJSONString(reqData));
 
-            //浣跨敤鍖虹骇骞冲彴鍏挜瀵规暟鎹繘琛孯SA鍔犲瘑
-            reqData.setData(ShRSAUtils.encryptByPubKey(jsonData, conf.getPublicKey()));
+            String url = conf.getApiUrl().replace("UPLOAD", "Shared");
+            SH2023PullRespDto responseDto = SH2023HttpClientUtil.postPullData(url + inteId, JSON.toJSONString(reqData));
 
-            //鎽樿锛屾暟鎹富浣撶殑MD5鍊�
-            reqData.setDigst(MyMD5Util.encrypt(jsonData));
-
-            SH2023RespDto responseDto = SH2023HttpClientUtil.postPushData(conf.getApiUrl() + inteId, JSON.toJSONString(reqData), conf);
-            apiLog.setStatus(responseDto.getCode() == 200 ? 0 : responseDto.getCode());
-            apiLog.setResult(responseDto.getResult());
+            apiLog.setStatus(responseDto.getRetcode() == 200 ? 0 : responseDto.getRetcode());
+            apiLog.setResult(responseDto.getRetMsg());
             apiLogRep.save(apiLog);
             ResponseDto resd = new ResponseDto();
-            resd.setSuccess(responseDto.getCode() == 200 ? 0 : responseDto.getCode());
-            resd.setMsg(responseDto.getResult());
-
+            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);
@@ -251,724 +222,901 @@
     }
 
     /**
-     * 璋冩暣鏁版嵁灏佽锛岃幏鍙杍son鏁版嵁
+     * 杞负JSON
+     *
+     * @param inteId
+     * @param data
+     * @param code
+     * @return
+     */
+    private String getJsonData(String inteId, Object data, String code) {
+        //鑻ヤ负璐㈠姟1501銆�1502銆�1503鎺ュ彛锛屽垯鎺ュ彛缂栫爜濉啓1114
+        if (SH2023Constant.SH_2023_API_CODE_1114_1501.equals(inteId)
+                || SH2023Constant.SH_2023_API_CODE_1114_1502.equals(inteId)
+                || SH2023Constant.SH_2023_API_CODE_1114_1503.equals(inteId)) {
+            Object object = getJsonFinanceData(inteId, data);
+            return JSON.toJSONString(object);
+        } else {
+            List<Object> list = new ArrayList<>();
+            Object object = getJsonApiData(inteId, data, code);
+            list.add(object);
+            return JSON.toJSONString(list);
+        }
+    }
+
+    /**
+     * 甯歌鎺ュ彛灏佽
+     *
+     * @param inteId
+     * @param data
+     * @param code
+     * @return
+     */
+    private Object getJsonApiData(String inteId, Object data, String code) {
+        //鍏蜂綋鏍规嵁鎺ュ彛杩涜灏佽
+        if (SH2023Constant.SH_2023_API_CODE_1101.equals(inteId)) {
+            SH2023Api1101 api1101 = new SH2023Api1101();
+            BeanUtils.copyProperties(data, api1101);
+
+            //璁剧疆绌哄睘鎬т负榛樿鍊�
+            changeObject(api1101);
+            return api1101;
+        }
+        if (SH2023Constant.SH_2023_API_CODE_1102.equals(inteId)) {
+            SH2023Api1102 api1102 = new SH2023Api1102();
+            BeanUtils.copyProperties(data, api1102);
+
+            //璁剧疆绌哄睘鎬т负榛樿鍊�
+            changeObject(api1102);
+            return api1102;
+        }
+        if (SH2023Constant.SH_2023_API_CODE_1103.equals(inteId)) {
+            SH2023Api1103 api1103 = new SH2023Api1103();
+            BeanUtils.copyProperties(data, api1103);
+
+            //璁剧疆绌哄睘鎬т负榛樿鍊�
+            changeObject(api1103);
+            return api1103;
+        }
+        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());
+
+            //璁剧疆绮鎬ц川浠g爜(鏌ョ湅寤掗棿瀵瑰簲鐨勬渶鏂板簱瀛樿繘琛岃祴鍊�)
+            List<Api1208> api1208List = api1208Rep.findDataByHwdm(api1104.getAjdm() + "01");
+            if (null != api1208List && api1208List.size() > 0) {
+                api1104.setLsxzdm(api1208List.get(0).getLsxzdm());
+            }
+
+            //璁剧疆绌哄睘鎬т负榛樿鍊�
+            changeObject(api1104);
+            return api1104;
+        }
+        if (SH2023Constant.SH_2023_API_CODE_1105.equals(inteId)) {
+            SH2023Api1105 api1105 = new SH2023Api1105();
+            BeanUtils.copyProperties(data, api1105);
+
+            //璁剧疆绌哄睘鎬т负榛樿鍊�
+            changeObject(api1105);
+            return api1105;
+        }
+        if (SH2023Constant.SH_2023_API_CODE_1106.equals(inteId)) {
+            SH2023Api1106 api1106 = new SH2023Api1106();
+            BeanUtils.copyProperties(data, api1106);
+            api1106.setBjw(ShAreaBjw.getBjw(code));
+
+            //璁剧疆绌哄睘鎬т负榛樿鍊�
+            changeObject(api1106);
+            return api1106;
+        }
+        if (SH2023Constant.SH_2023_API_CODE_1107.equals(inteId)) {
+            SH2023Api1107 api1107 = new SH2023Api1107();
+            BeanUtils.copyProperties(data, api1107);
+            api1107.setBjw(ShAreaBjw.getBjw(code));
+
+            //璁剧疆绌哄睘鎬т负榛樿鍊�
+            changeObject(api1107);
+            return api1107;
+        }
+        if (SH2023Constant.SH_2023_API_CODE_1108.equals(inteId)) {
+            SH2023Api1108 api1108 = new SH2023Api1108();
+            BeanUtils.copyProperties(data, api1108);
+            api1108.setBjw(ShAreaBjw.getBjw(code));
+
+            //璁剧疆绌哄睘鎬т负榛樿鍊�
+            changeObject(api1108);
+            return api1108;
+        }
+        if (SH2023Constant.SH_2023_API_CODE_1109.equals(inteId)) {
+            SH2023Api1109 api1109 = new SH2023Api1109();
+            Api1109 apiData = (Api1109) data;
+            BeanUtils.copyProperties(apiData, api1109);
+            api1109.setBjw(ShAreaBjw.getBjw(code));
+
+            Map<String, String> map = new HashMap<>();
+            map.put(apiData.getWjmc(), FileUtils.fileToByteString(apiData.getWjdz()));
+            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(), api1109.getYwdh()));
+            //璁剧疆绌哄睘鎬т负榛樿鍊�
+            changeObject(api1109);
+            return api1109;
+        }
+        if (SH2023Constant.SH_2023_API_CODE_1110.equals(inteId)) {
+            SH2023Api1110 api1110 = new SH2023Api1110();
+            Api1110 apiData = (Api1110) data;
+            BeanUtils.copyProperties(apiData, api1110);
+            api1110.setBjw(ShAreaBjw.getBjw(code));
+            api1110.setAjdm(apiData.getHwdm().substring(0, 28));
+            api1110.setAjxdwz(apiData.getHwxdwz());
+            api1110.setAjwzys(apiData.getHwwzys());
+
+            //璁剧疆绌哄睘鎬т负榛樿鍊�
+            changeObject(api1110);
+            return api1110;
+        }
+        if (SH2023Constant.SH_2023_API_CODE_1111.equals(inteId)) {
+            SH2023Api1111 api1111 = new SH2023Api1111();
+            BeanUtils.copyProperties(data, api1111);
+            api1111.setBjw(ShAreaBjw.getBjw(code));
+
+            //璁剧疆绌哄睘鎬т负榛樿鍊�
+            changeObject(api1111);
+            return api1111;
+        }
+        if (SH2023Constant.SH_2023_API_CODE_1112.equals(inteId)) {
+            SH2023Api1112 api1112 = new SH2023Api1112();
+            BeanUtils.copyProperties(data, api1112);
+            api1112.setHdrychsj(api1112.getQdzgzchzyzgsj());
+            api1112.setBjw(ShAreaBjw.getBjw(code));
+            api1112.setZy("01");
+
+            //璁剧疆绌哄睘鎬т负榛樿鍊�
+            changeObject(api1112);
+            return api1112;
+        }
+        if (SH2023Constant.SH_2023_API_CODE_1113.equals(inteId)) {
+            SH2023Api1113 api1113 = new SH2023Api1113();
+            BeanUtils.copyProperties(data, api1113);
+            api1113.setBjw(ShAreaBjw.getBjw(code));
+
+            //璁剧疆绌哄睘鎬т负榛樿鍊�
+            changeObject(api1113);
+            return api1113;
+        }
+        if (SH2023Constant.SH_2023_API_CODE_1201.equals(inteId)) {
+            SH2023Api1201 api1201 = new SH2023Api1201();
+            BeanUtils.copyProperties(data, api1201);
+            api1201.setBjw(ShAreaBjw.getBjw(code));
+            api1201.setHtsfzz("0");
+            //鍚堝悓绛捐鍦扮偣涓嶈兘涓虹┖鎴栧~鏃�
+            if (StringUtils.isEmpty(api1201.getQddd())) {
+                api1201.setQddd("绛捐鍦扮偣");
+            }
+            //鍚堝悓瀹℃牳浜轰笉鑳戒负绌烘垨濉棤
+            if (StringUtils.isEmpty(api1201.getShr())) {
+                api1201.setShr("瀹℃壒浜�");
+            }
+            //璁剧疆璐攢鏂瑰紡,榛樿瀹㈡埛缁熶竴淇$敤鐮佷负绌猴紝鍒欎负浜ч攢锛屽弽涔嬩负绔炰环锛�(1-瀹氬悜锛�2-绔炰环锛�3-浜ч攢)
+            api1201.setGxfs("2");
+            if(StringUtils.isEmpty(api1201.getKhtyshxydm())){
+                api1201.setGxfs("3");
+            }
+            //璁剧疆绌哄睘鎬т负榛樿鍊�
+            changeObject(api1201);
+            return api1201;
+        }
+        if (SH2023Constant.SH_2023_API_CODE_1202.equals(inteId)) {
+            SH2023Api1202 api1202 = new SH2023Api1202();
+            Api1202 apiData = (Api1202) data;
+            BeanUtils.copyProperties(apiData, api1202);
+            api1202.setBjw(ShAreaBjw.getBjw(code));
+            api1202.setJzrq(apiData.getCmsj());
+            if (StringUtils.isEmpty(api1202.getCddm())) {
+                api1202.setCddm(api1202.getHwdm().substring(2, 8));
+            }
+            if (StringUtils.isEmpty(api1202.getRkjsdh())) {
+                api1202.setRkjsdh("0");
+            }
+            //璁剧疆绮杞崲骞村害,鏍规嵁璁″垝鏄庣粏鍙锋煡璇㈣鍒掓槑缁嗭紝鍐嶆牴鎹鍒掓槑缁嗘煡璇㈣疆鎹㈣鍒�
+            List<Api1404> api1404List = api1404Rep.getDataByJhmxdh(apiData.getJhmxh());
+            if (null != api1404List && api1404List.size() > 0) {
+                api1202.setShnd(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;
+        }
+        if (SH2023Constant.SH_2023_API_CODE_1203.equals(inteId)) {
+            SH2023Api1203 api1203 = new SH2023Api1203();
+            Api1203 apiData = (Api1203) data;
+            BeanUtils.copyProperties(apiData, api1203);
+            api1203.setBjw(ShAreaBjw.getBjw(code));
+            if (StringUtils.isEmpty(api1203.getJyxm())) {
+                api1203.setJyxm("0");
+            }
+            if (StringUtils.isEmpty(api1203.getJyz())) {
+                api1203.setJyz("0");
+            }
+            if (StringUtils.isEmpty(api1203.getZkj())) {
+                api1203.setZkj("0");
+            }
+            if (StringUtils.isEmpty(api1203.getZkl())) {
+                api1203.setZkl("0");
+            }
+            //璁剧疆鎵规鍙�
+            List<Api1208> api1208List = api1208Rep.findDataByHwdm(api1203.getHwdm());
+            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;
+        }
+        if (SH2023Constant.SH_2023_API_CODE_1204.equals(inteId)) {
+            SH2023Api1204 api1204 = new SH2023Api1204();
+            Api1204 apiData = (Api1204) data;
+            BeanUtils.copyProperties(apiData, api1204);
+            api1204.setBjw(ShAreaBjw.getBjw(code));
+
+            //璁剧疆鎵规鍙�
+            if (StringUtils.isNotEmpty(api1204.getHth())) {
+                List<Api1202> api1202List = api1202Rep.getDataByRkjsdh(api1204.getRkjsdh());
+                if (null != api1202List && api1202List.size() > 0) {
+                    List<Api1208> api1208List = api1208Rep.findDataByHwdm(api1202List.get(0).getHwdm());
+                    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());
+                }
+            }
+
+            //璁剧疆绌哄睘鎬т负榛樿鍊�
+            changeObject(api1204);
+            return api1204;
+        }
+        if (SH2023Constant.SH_2023_API_CODE_1205.equals(inteId)) {
+
+            SH2023Api1205 api1205 = new SH2023Api1205();
+            Api1205 apiData = (Api1205) data;
+            BeanUtils.copyProperties(apiData, api1205);
+            api1205.setBjw(ShAreaBjw.getBjw(code));
+
+            api1205.setJzrq(apiData.getCmsj());
+            if (StringUtils.isEmpty(api1205.getCddm())) {
+                api1205.setCddm(api1205.getHwdm().substring(2, 8));
+            }
+            if (StringUtils.isEmpty(api1205.getCkjsdh())) {
+                api1205.setCkjsdh("0");
+            }
+
+            //璁剧疆绮杞崲骞村害
+            List<Api1404> api1404List = api1404Rep.getDataByJhmxdh(apiData.getJhmxh());
+            if (null != api1404List && api1404List.size() > 0) {
+                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());
+                    }
+                }
+            }
+
+            //璁剧疆鎵规鍙�
+            List<Api1208> api1208List = api1208Rep.findDataByHwdm(api1205.getHwdm());
+            if (null != api1208List && api1208List.size() > 0) {
+                api1205.setPch(apiData.getHwdm() + api1208List.get(0).getShnd());
+            }
+
+            //璁剧疆绌哄睘鎬т负榛樿鍊�
+            changeObject(api1205);
+            return api1205;
+        }
+        if (SH2023Constant.SH_2023_API_CODE_1206.equals(inteId)) {
+            SH2023Api1206 api1206 = new SH2023Api1206();
+            Api1206 apiData = (Api1206) data;
+            BeanUtils.copyProperties(apiData, api1206);
+            api1206.setBjw(ShAreaBjw.getBjw(code));
+            //鎵规鍙�
+            if (StringUtils.isNotEmpty(api1206.getHth())) {
+                List<Api1205> api1205List = api1205Rep.getDataByCkjsdh(api1206.getCkjsdh());
+                if (null != api1205List && api1205List.size() > 0) {
+                    List<Api1208> api1208List = api1208Rep.findDataByHwdm(api1205List.get(0).getHwdm());
+                    if (null != api1208List && api1208List.size() > 0) {
+                        api1206.setPch(api1208List.get(0).getHwdm() + api1208List.get(0).getShnd());
+                    }
+                }
+            }
+            //璁剧疆绌哄睘鎬т负榛樿鍊�
+            changeObject(api1206);
+            return api1206;
+        }
+        if (SH2023Constant.SH_2023_API_CODE_1207.equals(inteId)) {
+            //鍊掍粨鍊掑嚭
+            SH2023Api1207 api1207 = new SH2023Api1207();
+            Api1207 apiData = (Api1207) data;
+            BeanUtils.copyProperties(apiData, api1207);
+
+            api1207.setDcrq(apiData.getDcrq());
+            api1207.setBjw(ShAreaBjw.getBjw(code));
+
+            List<Api1208> api1208List = api1208Rep.findDataByHwdm(api1207.getDchwdm());
+            if (null != api1208List && api1208List.size() > 0) {
+                api1207.setPch(api1207.getDchwdm() + api1208List.get(0).getShnd());
+            }
+
+            //璁剧疆绌哄睘鎬т负榛樿鍊�
+            changeObject(api1207);
+            return api1207;
+        }
+        if (SH2023Constant.SH_2023_API_CODE_1208.equals(inteId)) {
+            SH2023Api1208 api1208 = new SH2023Api1208();
+            Api1208 apiData = (Api1208) data;
+            BeanUtils.copyProperties(apiData, api1208);
+            api1208.setZglkdm(api1208.getHwdm().substring(0, 21));
+
+            api1208.setBjw(ShAreaBjw.getBjw(code));
+            //璁剧疆鎵规鍙�
+            api1208.setPch(apiData.getHwdm() + apiData.getShnd());
+            if (StringUtils.isEmpty(api1208.getCd())) {
+                api1208.setCd(api1208.getHwdm().substring(2, 8));
+            }
+            //鍖呰鍌ㄧ伯鏄紝鏍告煡鍖呭瓨绮寘鏁�
+            if(null == apiData.getBclbs()){
+                apiData.setBclbs(0);
+            }
+            if("2".equals(apiData.getClfs()) && apiData.getBclbs() == 0){
+                apiData.setBclbs((int)(apiData.getSjsl()/25));
+            }
+            //璁剧疆绌哄睘鎬т负榛樿鍊�
+            changeObject(api1208);
+            return api1208;
+        }
+        if (SH2023Constant.SH_2023_API_CODE_1209.equals(inteId)) {
+
+            SH2023Api1209 api1209 = new SH2023Api1209();
+            Api1209 apiData = (Api1209) data;
+
+            BeanUtils.copyProperties(apiData, api1209);
+            api1209.setDjlx("2");
+            api1209.setSzjl(apiData.getQzszkl());
+            api1209.setZrshde(apiData.getQzzrshde());
+            api1209.setBjw(ShAreaBjw.getBjw(code));
+            api1209.setJzrq(apiData.getYwrq());
+            List<Api1208> api1208List = api1208Rep.findDataByHwdm(api1209.getHwdm());
+            if (null != api1208List && api1208List.size() > 0) {
+                api1209.setPch(api1209.getHwdm() + api1208List.get(0).getShnd());
+            }
+
+            //绮鎬ц川,鏆傛椂榛樿鍖虹骇鍌ㄥ
+            api1209.setLsxzdm("122");
+
+            //璁剧疆绌哄睘鎬т负榛樿鍊�
+            changeObject(api1209);
+            return api1209;
+        }
+        if (SH2023Constant.SH_2023_API_CODE_1210.equals(inteId)) {
+            SH2023Api1210 api1210 = new SH2023Api1210();
+            Api1210 apiData = (Api1210) data;
+
+            BeanUtils.copyProperties(apiData, api1210);
+            api1210.setBjw(ShAreaBjw.getBjw(code));
+            List<Api1208> api1208List = api1208Rep.findDataByHwdm(api1210.getHwdm());
+            if (null != api1208List && api1208List.size() > 0) {
+                api1210.setPch(apiData.getHwdm() + api1208List.get(0).getShnd());
+            }
+
+            //鑻ヨ鍒掓槑缁嗗彿涓虹┖锛岃缃鍒掓槑缁嗗彿锛屾牴鎹垝杞�ц川鏌ヨ鍑哄叆搴撲俊鎭幏鍙栬鍒掑彿
+            if(StringUtils.isEmpty(api1210.getJhmxdh())){
+                if("200".equals(api1210.getHzqlsxzdm())){
+                    //鑻ュ垝杞墠鎬ц川涓哄晢鍝佺伯锛屽垯鏌ヨ鍏ュ簱淇℃伅鑾峰彇璁″垝鏄庣粏鍙�
+                    List<Api1202> api1202List = api1202Rep.getDataByHwdmAndTime(api1210.getHwdm(), api1210.getHzrq());
+                    if (null != api1202List && api1202List.size() > 0) {
+                        api1210.setJhmxdh(api1202List.get(0).getJhmxh());
+                    }
+                }
+                if("200".equals(api1210.getHzhlsxzdm())){
+                    //鑻ュ垝杞悗鎬ц川涓哄晢鍝佺伯锛屽垯鏌ヨ鍑哄簱淇℃伅鑾峰彇璁″垝鏄庣粏鍙�
+                    List<Api1205> api1205List = api1205Rep.getDataByHwdmAndTime(api1210.getHwdm(), api1210.getHzrq());
+                    if (null != api1205List && api1205List.size() > 0) {
+                        api1210.setJhmxdh(api1205List.get(0).getJhmxh());
+                    }
+                }
+            }
+
+            //璁剧疆绌哄睘鎬т负榛樿鍊�
+            changeObject(api1210);
+            return api1210;
+        }
+        if (SH2023Constant.SH_2023_API_CODE_1211.equals(inteId)) {
+            SH2023Api1211 api1211 = new SH2023Api1211();
+            Api1211 apiData = (Api1211) data;
+
+            BeanUtils.copyProperties(apiData, api1211);
+            api1211.setZglkdm(api1211.getKqdm());
+            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) {
+                api1211.setPch(apiData.getHwdm() + api1208List.get(0).getShnd());
+            }
+            //涓荤绮簱浠g爜
+            api1211.setZglkdm(apiData.getKqdm());
+            //璁剧疆绌哄睘鎬т负榛樿鍊�
+            changeObject(api1211);
+            return api1211;
+        }
+        if (SH2023Constant.SH_2023_API_CODE_1212.equals(inteId)) {
+            SH2023Api1212 api1212 = new SH2023Api1212();
+            BeanUtils.copyProperties(data, api1212);
+            api1212.setBjw(ShAreaBjw.getBjw(code));
+
+            //璁剧疆绌哄睘鎬т负榛樿鍊�
+            changeObject(api1212);
+            return api1212;
+        }
+        if (SH2023Constant.SH_2023_API_CODE_1301.equals(inteId)) {
+            SH2023Api1301 api1301 = new SH2023Api1301();
+            BeanUtils.copyProperties(data, api1301);
+            api1301.setBjw(ShAreaBjw.getBjw(code));
+
+            //璁剧疆绌哄睘鎬т负榛樿鍊�
+            changeObject(api1301);
+            return api1301;
+        }
+        if (SH2023Constant.SH_2023_API_CODE_1302.equals(inteId)) {
+            SH2023Api1302 api1302 = new SH2023Api1302();
+            Api1302 apiData = (Api1302) data;
+            BeanUtils.copyProperties(apiData, api1302);
+            api1302.setBjw(ShAreaBjw.getBjw(code));
+            api1302.setLqjs("1");
+            //鎵规鍙�
+            List<Api1208> api1208List = api1208Rep.findDataByHwdm(api1302.getHwdm());
+            if (null != api1208List && api1208List.size() > 0) {
+                api1302.setPch(apiData.getHwdm() + api1208List.get(0).getShnd());
+            }
+            //缁熻灞傞珮銆佸眰浣庛�佸眰鍧囨俯绛変俊鎭�
+            api1302 = packageData1302(api1302);
+
+            //璁剧疆绌哄睘鎬т负榛樿鍊�
+            changeObject(api1302);
+            return api1302;
+        }
+        if (SH2023Constant.SH_2023_API_CODE_1303.equals(inteId)) {
+            SH2023Api1303 api1303 = new SH2023Api1303();
+            Api1303 apiData = (Api1303) data;
+            BeanUtils.copyProperties(apiData, api1303);
+            api1303.setBjw(ShAreaBjw.getBjw(code));
+            List<Api1208> api1208List = api1208Rep.findDataByHwdm(api1303.getHwdm());
+            if (null != api1208List && api1208List.size() > 0) {
+                api1303.setPch(apiData.getHwdm() + api1208List.get(0).getShnd());
+            }
+            //璁剧疆绌哄睘鎬т负榛樿鍊�
+            changeObject(api1303);
+            return api1303;
+        }
+        if (SH2023Constant.SH_2023_API_CODE_1304.equals(inteId)) {
+            SH2023Api1304 api1304 = new SH2023Api1304();
+            Api1304 apiData = (Api1304) data;
+            BeanUtils.copyProperties(apiData, api1304);
+            api1304.setBjw(ShAreaBjw.getBjw(code));
+            List<Api1208> api1208List = api1208Rep.findDataByHwdm(api1304.getHwdm());
+            if (null != api1208List && api1208List.size() > 0) {
+                api1304.setPch(apiData.getHwdm() + api1208List.get(0).getShnd());
+            }
+
+            //璁剧疆绌哄睘鎬т负榛樿鍊�
+            changeObject(api1304);
+            return api1304;
+        }
+        if (SH2023Constant.SH_2023_API_CODE_1305.equals(inteId)) {
+            SH2023Api1305 api1305 = new SH2023Api1305();
+            Api1305 apiData = (Api1305) data;
+            BeanUtils.copyProperties(apiData, api1305);
+            api1305.setBjw(ShAreaBjw.getBjw(code));
+            api1305.setAjdm(apiData.getTfzydh().substring(0, 28));
+            //涓婃捣閫氶浣滀笟鍗曞彿锛氬粧闂翠唬鐮�+yyyyMMdd+3浣嶉『搴忓彿
+            api1305.setAjdm(apiData.getTfzydh().substring(0, 28));
+            api1305.setTfzydh(apiData.getTfzydh().substring(0, 28) + apiData.getTfzydh().substring(30));
+            if (StringUtils.isEmpty(api1305.getTfmd())) {
+                api1305.setTfmd("1"); //闄嶆俯閫氶
+            }
+            //璁剧疆绌哄睘鎬т负榛樿鍊�
+            changeObject(api1305);
+            return api1305;
+        }
+        if (SH2023Constant.SH_2023_API_CODE_1306.equals(inteId)) {
+            SH2023Api1306 api1306 = new SH2023Api1306();
+            Api1306 apiData = (Api1306) data;
+            BeanUtils.copyProperties(apiData, api1306);
+            api1306.setBjw(ShAreaBjw.getBjw(code));
+            api1306.setPch(apiData.getXzzydh().substring(0, 30) + DateFormatUtils.format(apiData.getXzkssj(), "yyyy"));
+            api1306.setAjdm(apiData.getHwdm().substring(0, 28));
+            //涓婃捣鐔忚捀浣滀笟鍗曞彿锛氳揣浣嶄唬鐮�+yyyyMMdd + 3浣嶉『搴忓彿
+            api1306.setXzzydh(apiData.getHwdm() + apiData.getBizId());
+            if (StringUtils.isEmpty(api1306.getSyff())) {
+                api1306.setSyff("0"); //娼В娉�
+            }
+            //璁剧疆绌哄睘鎬т负榛樿鍊�
+            changeObject(api1306);
+            return api1306;
+        }
+        if (SH2023Constant.SH_2023_API_CODE_1307.equals(inteId)) {
+            SH2023Api1307 api1307 = new SH2023Api1307();
+            Api1307 apiData = (Api1307) data;
+            BeanUtils.copyProperties(apiData, api1307);
+            api1307.setBjw(ShAreaBjw.getBjw(code));
+            api1307.setAjdm(apiData.getHwdm().substring(0, 28));
+
+            //璁剧疆绌哄睘鎬т负榛樿鍊�
+            changeObject(api1307);
+            return api1307;
+        }
+        if (SH2023Constant.SH_2023_API_CODE_1308.equals(inteId)) {
+            SH2023Api1308 api1308 = new SH2023Api1308();
+            Api1308 apiData = (Api1308) data;
+
+            BeanUtils.copyProperties(apiData, api1308);
+            api1308.setBjw(ShAreaBjw.getBjw(code));
+
+            //璁剧疆绌哄睘鎬т负榛樿鍊�
+            changeObject(api1308);
+            return api1308;
+        }
+        if (SH2023Constant.SH_2023_API_CODE_1309.equals(inteId)) {
+            SH2023Api1309 api1309 = new SH2023Api1309();
+            BeanUtils.copyProperties(data, api1309);
+            api1309.setBjw(ShAreaBjw.getBjw(code));
+            //璁剧疆绌哄睘鎬т负榛樿鍊�
+            changeObject(api1309);
+            return api1309;
+        }
+        if (SH2023Constant.SH_2023_API_CODE_1310.equals(inteId)) {
+            SH2023Api1310 api1310 = new SH2023Api1310();
+            Api1310 apiData = (Api1310) data;
+            BeanUtils.copyProperties(apiData, api1310);
+            api1310.setBjw(ShAreaBjw.getBjw(code));
+            api1310.setJyrq(apiData.getJysj());
+
+            if (StringUtils.isEmpty(api1310.getJyxm())) {
+                api1310.setJyxm("0");
+            }
+            if (StringUtils.isEmpty(api1310.getJyxmz())) {
+                api1310.setJyxmz("0");
+            }
+            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())) {
+                    lsxzdm = api1208List.get(0).getLsxzdm();
+                    pch = apiData.getHwdm() + api1208List.get(0).getShnd();
+                }
+            }
+            //璁剧疆鎵规鍙�
+            api1310.setPch(pch);
+            api1310.setLsxzdm(lsxzdm);
+            if (api1310.getYpsl() == 0.0) {
+                api1310.setYpsl(5.0);
+            }
+            if (StringUtils.isEmpty(api1310.getQyrxm())) {
+                api1310.setQyrxm("鎵︽牱浜�");
+            }
+            if (StringUtils.isEmpty(api1310.getJdrxm())) {
+                api1310.setJdrxm("鐩戠潱浜�");
+            }
+            if (StringUtils.isEmpty(api1310.getShrxm())) {
+                api1310.setShrxm("瀹℃牳浜�");
+            }
+            if (StringUtils.isEmpty(api1310.getBglx())) {
+                api1310.setBglx("1");
+            }
+
+            //璁剧疆绌哄睘鎬т负榛樿鍊�
+            changeObject(api1310);
+            return api1310;
+        }
+        if (SH2023Constant.SH_2023_API_CODE_1311.equals(inteId)) {
+            SH2023Api1311 api1311 = new SH2023Api1311();
+            BeanUtils.copyProperties(data, api1311);
+            api1311.setBjw(ShAreaBjw.getBjw(code));
+
+            //璁剧疆绌哄睘鎬т负榛樿鍊�
+            changeObject(api1311);
+            return api1311;
+        }
+        if (SH2023Constant.SH_2023_API_CODE_1401.equals(inteId)) {
+            SH2023Api1401 api1401 = new SH2023Api1401();
+            BeanUtils.copyProperties(data, api1401);
+            api1401.setBjw(ShAreaBjw.getBjw(code));
+
+            //璁剧疆绌哄睘鎬т负榛樿鍊�
+            changeObject(api1401);
+            return api1401;
+        }
+        if (SH2023Constant.SH_2023_API_CODE_1402.equals(inteId)) {
+            SH2023Api1402 api1402 = new SH2023Api1402();
+            BeanUtils.copyProperties(data, api1402);
+            api1402.setBjw(ShAreaBjw.getBjw(code));
+
+            //璁剧疆绌哄睘鎬т负榛樿鍊�
+            changeObject(api1402);
+            return api1402;
+        }
+        if (SH2023Constant.SH_2023_API_CODE_1403.equals(inteId)) {
+            SH2023Api1403 api1403 = new SH2023Api1403();
+            Api1403 apiData = (Api1403) data;
+            BeanUtils.copyProperties(apiData, api1403);
+            List<Api1101> api1101List = api1101Rep.findDataByDwdm(apiData.getLhjhdh().substring(0, 18));
+
+            api1403.setJhzxdw(api1101List.get(0).getDwdm());
+            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 + "");
+            api1403.setLcsl(lcsl + "");
+
+            //璁剧疆绌哄睘鎬т负榛樿鍊�
+            changeObject(api1403);
+            return api1403;
+        }
+        if (SH2023Constant.SH_2023_API_CODE_1404.equals(inteId)) {
+            SH2023Api1404 api1404 = new SH2023Api1404();
+            BeanUtils.copyProperties(data, api1404);
+            api1404.setMxzt("1");
+            api1404.setBjw(ShAreaBjw.getBjw(code));
+
+            //璁剧疆绌哄睘鎬т负榛樿鍊�
+            changeObject(api1404);
+            return api1404;
+        }
+        if (SH2023Constant.SH_2023_API_CODE_2101.equals(inteId)) {
+            //璁剧疆绌哄睘鎬т负榛樿鍊�
+            changeObject(data);
+            return data;
+        }
+        if (SH2023Constant.SH_2023_API_CODE_2102.equals(inteId)) {
+            SH2023Api2102 apiData = new SH2023Api2102();
+            BeanUtils.copyProperties(data, apiData);
+            List<Api1208> api1208List = api1208Rep.findDataByHwdm(apiData.getDrhwdm());
+            if (null != api1208List && api1208List.size() > 0) {
+                apiData.setPch(apiData.getDrhwdm() + api1208List.get(0).getShnd());
+            }
+            //璁剧疆绌哄睘鎬т负榛樿鍊�
+            changeObject(apiData);
+            return apiData;
+        }
+        if (SH2023Constant.SH_2023_API_CODE_2103.equals(inteId)) {
+            SH2023Api2103 apiData = new SH2023Api2103();
+            BeanUtils.copyProperties(data, apiData);
+            //璁剧疆绌哄睘鎬т负榛樿鍊�
+            changeObject(apiData);
+            return apiData;
+        }
+        if (SH2023Constant.SH_2023_API_CODE_2104.equals(inteId)) {
+            //璁剧疆绌哄睘鎬т负榛樿鍊�
+            changeObject(data);
+            return data;
+        }
+        if (SH2023Constant.SH_2023_API_CODE_2203.equals(inteId)) {
+
+            //璁剧疆绌哄睘鎬т负榛樿鍊�
+            changeObject(data);
+            return data;
+        }
+        if (SH2023Constant.SH_2023_API_CODE_2204.equals(inteId)) {
+            //璁剧疆绌哄睘鎬т负榛樿鍊�
+            changeObject(data);
+            return data;
+        }
+        //璁剧疆绌哄睘鎬т负榛樿鍊�
+        changeObject(data);
+        return data;
+    }
+
+    /**
+     * 鏍规嵁涓婃捣鏁版嵁鏍煎紡杩涜灏佽
+     * 灞傚潎娓╋細
+     * 灞傞珮娓╋細
+     * 灞備綆娓╋細
+     * 鍚勮寖鍥村潎娓╋細
+     * 绮俯鏄庣粏锛�
+     * 绮俯鐘舵�侊細
+     * 寮傚父鐐逛釜鏁帮細
+     *
+     * @param data
+     * @return
+     */
+    private SH2023Api1302 packageData1302(SH2023Api1302 data) {
+        if (StringUtils.isEmpty(data.getLswdzjh())) {
+            return data;
+        }
+        String lswdzjh = data.getLswdzjh();
+        String[] split = lswdzjh.split("\\|");
+        Map<Integer, List<Double>> map = new HashMap<>();
+        Integer ceng;
+        Integer errorNum = 0;  //寮傚父鐐逛釜鏁�
+        String lwmx = "";   //绮俯鏄庣粏
+        String lwzt = "0";  //绮俯鐘舵��
+        String gfwjw = "";  //鍚勮寖鍥村潎娓�
+        for (String s : split) {
+            String[] grain = s.split(",");
+            ceng = Integer.valueOf(grain[1]);
+            if (null == map.get(ceng)) {
+                map.put(ceng, new ArrayList<>());
+            }
+            map.get(ceng).add(Double.valueOf(grain[0]));
+            lwmx +=  grain[2]  + ":" + grain[3]  +":" + grain[1] + "$" + grain[0];
+            if (Double.valueOf(grain[0]) <= -100) {
+                lwmx += "$" + "1" + "#";
+                errorNum++;
+            } else {
+                lwmx += "$" + "5" + "#";
+            }
+        }
+        String cpjw = "";  //灞傚钩鍧囨俯
+        String czgw = "";  //灞傛渶楂樻俯
+        String czdw = "";  //灞傛渶浣庢俯
+
+        List<Double> payPoints;
+        Double sum;
+        int num;
+        Double tempH;
+        Double tempL;
+        Double tempA;
+        Double tempValue1 = 0.0; //鑼冨洿鍧囨俯1
+        Double tempValue2 = 0.0; //鑼冨洿鍧囨俯2
+        Double tempValue3 = 0.0; //鑼冨洿鍧囨俯3
+        Integer numValue = 0; //璁$畻鑼冨洿鍧囨俯
+        for (Integer cengNum : map.keySet()) {
+            payPoints = map.get(cengNum);
+            sum = 0.0;
+            num = 0;
+            tempH = null;
+            tempL = null;
+            tempA = 0.0;
+            for (Double point : payPoints) {
+                if(point > -100){
+                    sum += point;
+                    num++;
+                    if (tempH == null) {
+                        tempH = point;
+                    }
+                    if (tempL == null) {
+                        tempL = point;
+                    }
+                    if (tempH < point) {
+                        tempH = point;
+                    }
+                    if (tempL > point) {
+                        tempL = point;
+                    }
+                }
+            }
+            if (num > 0) {
+                tempA = sum / num;
+            }
+            cpjw += cengNum + "$" + NumberUtil.keepPrecision(tempA, 1) + "#";
+            czgw += cengNum + "$" + tempH + "#";
+            czdw += cengNum + "$" + tempL + "#";
+            //鑼冨洿鍧囨俯灏佽
+            if (cengNum == 1) {
+                tempValue1 = NumberUtil.keepPrecision(tempA, 1);
+            } else if (cengNum == map.keySet().size()) {
+                tempValue3 = NumberUtil.keepPrecision(tempA, 1);
+            } else {
+                tempValue2 += tempA;
+                numValue++;
+            }
+        }
+
+        if (errorNum > 0) {
+            lwzt = "2";
+        }
+        if (numValue > 0) {
+            tempValue2 = NumberUtil.keepPrecision(tempValue2 / numValue, 1);
+        }
+        gfwjw += tempValue1 + "#";
+        if (map.keySet().size() == 2) {
+            gfwjw += tempValue3 + "#";
+        }
+        if (map.keySet().size() > 3) {
+            gfwjw += tempValue2 + "#" + tempValue3 + "#";
+        }
+        data.setCpjw(cpjw);
+        data.setCzgw(czgw);
+        data.setCzdw(czdw);
+        data.setGfwjw(gfwjw);
+        data.setLwmx(lwmx);
+        data.setLwzt(lwzt);
+        data.setYcdgs(errorNum);
+
+        return data;
+    }
+
+    /**
+     * 鑾峰彇璐㈠姟鏁版嵁json
      *
      * @param inteId
      * @param data
      * @return
-     * @throws Exception
      */
-    private String getJsonData(String inteId, Object data, String code) {
-        //鍏蜂綋鏍规嵁鎺ュ彛杩涜灏佽
-        if (SH2023Constant.SH_2023_API_CODE_1101.equals(inteId)) {
-            SH2023Api1101 api1101;
-            //鏈�鍚庤浆鎹负json
-            List<SH2023Api1101> list = new ArrayList<>();
-            //鎶奷ata杞寲鎴恖ist闆嗗悎
-            List<Api1101> api1101List = castList(data, Api1101.class);
-            //鏌ヨ寤掗棿鏁�
-            List<Api1104> api1104List = api1104Rep.findPushData(api1101List.get(0).getKqdm());
-            for (Api1101 apiData : api1101List) {
-                api1101 = new SH2023Api1101();
-                BeanUtils.copyProperties(apiData, api1101);
-                api1101.setAjs(api1104List.size());
-                api1101.setBjw(ShAreaBjw.getBjw(code));
-                list.add(api1101);
-            }
-            return JSON.toJSONString(list);
-        }
-        if (SH2023Constant.SH_2023_API_CODE_1102.equals(inteId)) {
-            SH2023Api1102 api1102;
-            //鏈�鍚庤浆鎹负json
-            List<SH2023Api1102> list = new ArrayList<>();
-            //鎶奷ata杞寲鎴恖ist闆嗗悎
-            List<Api1102> api1101List = castList(data, Api1102.class);
-            //鏌ヨ寤掗棿鏁�
-            List<Api1104> api1104List = api1104Rep.findPushData(api1101List.get(0).getKqdm());
-            //璁$畻鍌ㄥ浠撳
-            Double count = 0.0;
-            for (Api1104 api1104 : api1104List) {
-                count = count + api1104.getAjsjcrong();
-            }
-            for (Api1102 apiData : api1101List) {
-                api1102 = new SH2023Api1102();
-                BeanUtils.copyProperties(apiData, api1102);
-                api1102.setAjs(api1104List.size());
-                api1102.setBjw(ShAreaBjw.getBjw(code));
-                api1102.setKqsx("2");
-                api1102.setCbcr(count);
-                list.add(api1102);
-            }
-            return JSON.toJSONString(list);
-        }
-        if (SH2023Constant.SH_2023_API_CODE_1103.equals(inteId)) {
-            SH2023Api1103 api1103;
-            //鏈�鍚庤浆鎹负json
-            List<SH2023Api1103> list = new ArrayList<>();
-            //鎶奷ata杞寲鎴恖ist闆嗗悎
-            List<Api1103> api1103List = castList(data, Api1103.class);
-            //鏌ヨ寤掗棿鏁�
-            List<Api1104> api1104List = api1104Rep.findPushData(api1103List.get(0).getKqdm());
-            for (Api1103 apiData : api1103List) {
-                api1103 = new SH2023Api1103();
-                BeanUtils.copyProperties(apiData, api1103);
-                api1103.setAjs(api1104List.size());
-                api1103.setBjw(ShAreaBjw.getBjw(code));
-                list.add(api1103);
-            }
-            return JSON.toJSONString(list);
-        }
-        if (SH2023Constant.SH_2023_API_CODE_1104.equals(inteId)) {
-            SH2023Api1104 api1104;
-            //鏈�鍚庤浆鎹负json
-            List<SH2023Api1104> list = new ArrayList<>();
-            //鎶奷ata杞寲鎴恖ist闆嗗悎
-            List<Api1104> api1104List = castList(data, Api1104.class);
-            for (Api1104 apiData : api1104List) {
-                api1104 = new SH2023Api1104();
-                BeanUtils.copyProperties(apiData, api1104);
-                api1104.setAjdm(apiData.getAjdh());
-                api1104.setCfdm(apiData.getCfbh());
-                api1104.setSykqdm(apiData.getKqdm());
-                api1104.setBjw(ShAreaBjw.getBjw(code));
-                list.add(api1104);
-            }
-            return JSON.toJSONString(list);
-        }
-        if (SH2023Constant.SH_2023_API_CODE_1105.equals(inteId)) {
-            SH2023Api1105 api1105;
-            //鏈�鍚庤浆鎹负json
-            List<SH2023Api1105> list = new ArrayList<>();
-            //鎶奷ata杞寲鎴恖ist闆嗗悎
-            List<Api1105> api1105List = castList(data, Api1105.class);
-            for (Api1105 apiData : api1105List) {
-                api1105 = new SH2023Api1105();
-                BeanUtils.copyProperties(apiData, api1105);
-                api1105.setBjw(ShAreaBjw.getBjw(code));
-                list.add(api1105);
-            }
-            return JSON.toJSONString(list);
-        }
-        if (SH2023Constant.SH_2023_API_CODE_1106.equals(inteId)) {
-            SH2023Api1106 api1106;
-            //鏈�鍚庤浆鎹负json
-            List<SH2023Api1106> list = new ArrayList<>();
-            //鎶奷ata杞寲鎴恖ist闆嗗悎
-            List<Api1106> api1106List = castList(data, Api1106.class);
-            for (Api1106 apiData : api1106List) {
-                api1106 = new SH2023Api1106();
-                BeanUtils.copyProperties(apiData, api1106);
-                api1106.setBjw(ShAreaBjw.getBjw(code));
-                list.add(api1106);
-            }
-            return JSON.toJSONString(list);
-        }
-        if (SH2023Constant.SH_2023_API_CODE_1107.equals(inteId)) {
-            SH2023Api1107 api1107;
-            //鏈�鍚庤浆鎹负json
-            List<SH2023Api1107> list = new ArrayList<>();
-            //鎶奷ata杞寲鎴恖ist闆嗗悎
-            List<Api1107> api1107List = castList(data, Api1107.class);
-            for (Api1107 apiData : api1107List) {
-                api1107 = new SH2023Api1107();
-                BeanUtils.copyProperties(apiData, api1107);
-                api1107.setBjw(ShAreaBjw.getBjw(code));
-                list.add(api1107);
-            }
-            return JSON.toJSONString(list);
-        }
-        if (SH2023Constant.SH_2023_API_CODE_1108.equals(inteId)) {
-            SH2023Api1108 api1108;
-            //鏈�鍚庤浆鎹负json
-            List<SH2023Api1108> list = new ArrayList<>();
-            //鎶奷ata杞寲鎴恖ist闆嗗悎
-            List<Api1108> api1108List = castList(data, Api1108.class);
-            for (Api1108 apiData : api1108List) {
-                api1108 = new SH2023Api1108();
-                BeanUtils.copyProperties(apiData, api1108);
-                api1108.setBjw(ShAreaBjw.getBjw(code));
-                list.add(api1108);
-            }
-            return JSON.toJSONString(list);
-        }
-        if (SH2023Constant.SH_2023_API_CODE_1109.equals(inteId)) {
-            SH2023Api1109 api1109;
-            //鏈�鍚庤浆鎹负json
-            List<SH2023Api1109> list = new ArrayList<>();
-            //鎶奷ata杞寲鎴恖ist闆嗗悎
-            List<Api1109> api1109List = castList(data, Api1109.class);
-            Map<String, String> map;
-            for (Api1109 apiData : api1109List) {
-                api1109 = new SH2023Api1109();
-                BeanUtils.copyProperties(apiData, api1109);
-                api1109.setBjw(ShAreaBjw.getBjw(code));
-                if ("1".equals(api1109.getWjlx())) {
-                    api1109.setYwdh("鏃�");
-                }
-                map = new HashMap<>();
-                map.put(apiData.getWjmc(), FileUtils.fileToByteString(apiData.getWjdz()));
-                api1109.setWjl(JSON.toJSONString(map));
-                list.add(api1109);
-            }
-            return JSON.toJSONString(list);
-        }
-        if (SH2023Constant.SH_2023_API_CODE_1110.equals(inteId)) {
-            SH2023Api1110 api1110;
-            //鏈�鍚庤浆鎹负json
-            List<SH2023Api1110> list = new ArrayList<>();
-            HashSet<String> set = new HashSet<>();
-            //鎶奷ata杞寲鎴恖ist闆嗗悎
-            List<Api1110> api1110List = castList(data, Api1110.class);
-            for (Api1110 apiData : api1110List) {
-                // 鍥犱负寤掗棿鏄牴鎹揣浣嶆埅鍙栵紝鎵�浠ヨ鍒ゆ柇寤掗棿鏄惁閲嶅
-                if (!set.add(apiData.getHwdm().substring(0, 28))) {
-                    continue;
-                }
-                api1110 = new SH2023Api1110();
-                BeanUtils.copyProperties(apiData, api1110);
-                api1110.setBjw(ShAreaBjw.getBjw(code));
-                api1110.setAjdm(apiData.getHwdm().substring(0, 28));
-                api1110.setAjxdwz(apiData.getHwxdwz());
-                api1110.setAjwzys(apiData.getHwwzys());
-                list.add(api1110);
-            }
-            return JSON.toJSONString(list);
-        }
-        if (SH2023Constant.SH_2023_API_CODE_1111.equals(inteId)) {
-            SH2023Api1111 api1111;
-            //鏈�鍚庤浆鎹负json
-            List<SH2023Api1111> list = new ArrayList<>();
-            //鎶奷ata杞寲鎴恖ist闆嗗悎
-            List<Api1111> api1111List = castList(data, Api1111.class);
-            for (Api1111 apiData : api1111List) {
-                api1111 = new SH2023Api1111();
-                BeanUtils.copyProperties(apiData, api1111);
-                api1111.setBjw(ShAreaBjw.getBjw(code));
-                list.add(api1111);
-            }
-            return JSON.toJSONString(list);
-        }
-        if (SH2023Constant.SH_2023_API_CODE_1112.equals(inteId)) {
-            SH2023Api1112 api1112;
-            //鏈�鍚庤浆鎹负json
-            List<SH2023Api1112> list = new ArrayList<>();
-            //鎶奷ata杞寲鎴恖ist闆嗗悎
-            List<Api1112> api1112List = castList(data, Api1112.class);
-            for (Api1112 apiData : api1112List) {
-                api1112 = new SH2023Api1112();
-                BeanUtils.copyProperties(apiData, api1112);
-                api1112.setHdrychsj(api1112.getQdzgzchzyzgsj());
-                api1112.setBjw(ShAreaBjw.getBjw(code));
-                list.add(api1112);
-            }
-            return JSON.toJSONString(list);
-        }
-        if (SH2023Constant.SH_2023_API_CODE_1113.equals(inteId)) {
-            SH2023Api1113 api1113;
-            //鏈�鍚庤浆鎹负json
-            List<SH2023Api1113> list = new ArrayList<>();
-            //鎶奷ata杞寲鎴恖ist闆嗗悎
-            List<Api1113> api1113List = castList(data, Api1113.class);
-            for (Api1113 apiData : api1113List) {
-                api1113 = new SH2023Api1113();
-                BeanUtils.copyProperties(apiData, api1113);
-                api1113.setBjw(ShAreaBjw.getBjw(code));
-                list.add(api1113);
-            }
-            return JSON.toJSONString(list);
-        }
-        if (SH2023Constant.SH_2023_API_CODE_1201.equals(inteId)) {
-            SH2023Api1201 api1201;
-            //鏈�鍚庤浆鎹负json
-            List<SH2023Api1201> list = new ArrayList<>();
-            //鎶奷ata杞寲鎴恖ist闆嗗悎
-            List<Api1201> api1201List = castList(data, Api1201.class);
-            for (Api1201 apiData : api1201List) {
-                api1201 = new SH2023Api1201();
-                BeanUtils.copyProperties(apiData, api1201);
-                api1201.setBjw(ShAreaBjw.getBjw(code));
-                api1201.setHtsfzz("0");
-                list.add(api1201);
-            }
-            return JSON.toJSONString(list);
-        }
-        if (SH2023Constant.SH_2023_API_CODE_1202.equals(inteId)) {
-            SH2023Api1202 api1202;
-            //鏈�鍚庤浆鎹负json
-            List<SH2023Api1202> list = new ArrayList<>();
-            //鎶奷ata杞寲鎴恖ist闆嗗悎
-            List<Api1202> api1202List = castList(data, Api1202.class);
-            for (Api1202 apiData : api1202List) {
-                api1202 = new SH2023Api1202();
-                BeanUtils.copyProperties(apiData, api1202);
-                api1202.setBjw(ShAreaBjw.getBjw(code));
-                api1202.setPch(apiData.getHwdm() + apiData.getShnd());
-                //todo 椹宠繍鍗曞彿(2104)  妫�鏂ゅ崟鍙�(2101)   鍧囦负闈炲繀濉�
-                api1202.setJzrq(apiData.getCmsj());
-                list.add(api1202);
-            }
-            return JSON.toJSONString(list);
-        }
-        if (SH2023Constant.SH_2023_API_CODE_1203.equals(inteId)) {
-            SH2023Api1203 api1203;
-            //鏈�鍚庤浆鎹负json
-            List<SH2023Api1203> list = new ArrayList<>();
-            //鎶奷ata杞寲鎴恖ist闆嗗悎
-            List<Api1203> api1203List = castList(data, Api1203.class);
-            for (Api1203 apiData : api1203List) {
-                api1203 = new SH2023Api1203();
-                BeanUtils.copyProperties(apiData, api1203);
-                api1203.setBjw(ShAreaBjw.getBjw(code));
-                //鏌ヨ鏀惰幏骞翠唤
-                List<Api1202> api1202List = api1202Rep.getDataById(apiData.getRkywdh());
-                api1203.setPch(apiData.getHwdm() + api1202List.get(0).getShnd());
-                list.add(api1203);
-            }
-            return JSON.toJSONString(list);
-        }
-        if (SH2023Constant.SH_2023_API_CODE_1204.equals(inteId)) {
-            SH2023Api1204 api1204;
-            //鏈�鍚庤浆鎹负json
-            List<SH2023Api1204> list = new ArrayList<>();
-            //鎶奷ata杞寲鎴恖ist闆嗗悎
-            List<Api1204> api1204List = castList(data, Api1204.class);
-            for (Api1204 apiData : api1204List) {
-                api1204 = new SH2023Api1204();
-                BeanUtils.copyProperties(apiData, api1204);
-                api1204.setBjw(ShAreaBjw.getBjw(code));
-                api1204.setPch(apiData.getHwdm() + DateFormatUtils.format(apiData.getJssj(), "yyyy"));
-                list.add(api1204);
-            }
-            return JSON.toJSONString(list);
-        }
-        if (SH2023Constant.SH_2023_API_CODE_1205.equals(inteId)) {
-            SH2023Api1205 api1205;
-            //鏈�鍚庤浆鎹负json
-            List<SH2023Api1205> list = new ArrayList<>();
-            //鎶奷ata杞寲鎴恖ist闆嗗悎
-            List<Api1205> api1205List = castList(data, Api1205.class);
-            for (Api1205 apiData : api1205List) {
-                api1205 = new SH2023Api1205();
-                BeanUtils.copyProperties(apiData, api1205);
-                api1205.setBjw(ShAreaBjw.getBjw(code));
-                api1205.setPch(apiData.getHwdm() + DateFormatUtils.format(apiData.getCmsj(), "yyyy"));
-                api1205.setJzrq(apiData.getCmsj());
-                api1205.setJhmxh("鏃�");
-                api1205.setJjlx("鏃�");
-                list.add(api1205);
-            }
-            return JSON.toJSONString(list);
-        }
-        if (SH2023Constant.SH_2023_API_CODE_1206.equals(inteId)) {
-            SH2023Api1206 api1206;
-            //鏈�鍚庤浆鎹负json
-            List<SH2023Api1206> list = new ArrayList<>();
-            //鎶奷ata杞寲鎴恖ist闆嗗悎
-            List<Api1206> api1206List = castList(data, Api1206.class);
-            for (Api1206 apiData : api1206List) {
-                api1206 = new SH2023Api1206();
-                BeanUtils.copyProperties(apiData, api1206);
-                api1206.setBjw(ShAreaBjw.getBjw(code));
-                List<Api1205> api1205List = api1205Rep.getDataById(apiData.getCkjsdh());
-                api1206.setPch(api1205List.get(0).getHwdm() + DateFormatUtils.format(api1205List.get(0).getCmsj(), "yyyy"));
-                list.add(api1206);
-            }
-            return JSON.toJSONString(list);
-        }
-        if (SH2023Constant.SH_2023_API_CODE_1207.equals(inteId)) {
-            SH2023Api1207 api1207;
-            //鏈�鍚庤浆鎹负json
-            List<SH2023Api1207> list = new ArrayList<>();
-            //鎶奷ata杞寲鎴恖ist闆嗗悎
-            List<Api1207> api1207List = castList(data, Api1207.class);
-            for (Api1207 apiData : api1207List) {
-                api1207 = new SH2023Api1207();
-                BeanUtils.copyProperties(apiData, api1207);
-
-                api1207.setDcrq(apiData.getDcrq());
-                api1207.setBjw(ShAreaBjw.getBjw(code));
-                //TODO 搴撹皟鍗曞彿
-
-                list.add(api1207);
-            }
-            return JSON.toJSONString(list);
-        }
-        if (SH2023Constant.SH_2023_API_CODE_1208.equals(inteId)) {
-            SH2023Api1208 api1208;
-            //鏈�鍚庤浆鎹负json
-            List<SH2023Api1208> list = new ArrayList<>();
-            //鎶奷ata杞寲鎴恖ist闆嗗悎
-            List<Api1208> api1208List = castList(data, Api1208.class);
-            for (Api1208 apiData : api1208List) {
-                api1208 = new SH2023Api1208();
-                BeanUtils.copyProperties(apiData, api1208);
-                api1208.setZglkdm(api1208.getHwdm().substring(0, 21));
-
-                //TODO 鏉ョ伯浠g爜
-
-                api1208.setBjw(ShAreaBjw.getBjw(code));
-                api1208.setPch(apiData.getHwdm() + apiData.getShnd());
-                list.add(api1208);
-            }
-            return JSON.toJSONString(list);
-        }
-        if (SH2023Constant.SH_2023_API_CODE_1209.equals(inteId)) {
-            SH2023Api1209 api1209;
-            //鏈�鍚庤浆鎹负json
-            List<SH2023Api1209> list = new ArrayList<>();
-            //鎶奷ata杞寲鎴恖ist闆嗗悎
-            List<Api1209> api1209List = castList(data, Api1209.class);
-            for (Api1209 apiData : api1209List) {
-                api1209 = new SH2023Api1209();
-                BeanUtils.copyProperties(apiData, api1209);
-
-                api1209.setDjlx("2");
-                api1209.setSzjl(apiData.getQzszkl());
-                api1209.setZrshde(apiData.getQzzrshde());
-                api1209.setBjw(ShAreaBjw.getBjw(code));
-                api1209.setJzrq(apiData.getYwrq());
-                api1209.setBz("鏃�");
-                api1209.setPch(apiData.getHwdm() + DateFormatUtils.format(apiData.getYwrq(), "yyyy"));
-                list.add(api1209);
-            }
-            return JSON.toJSONString(list);
-        }
-        if (SH2023Constant.SH_2023_API_CODE_1210.equals(inteId)) {
-            SH2023Api1210 api1210;
-            //鏈�鍚庤浆鎹负json
-            List<SH2023Api1210> list = new ArrayList<>();
-            //鎶奷ata杞寲鎴恖ist闆嗗悎
-            List<Api1210> api1210List = castList(data, Api1210.class);
-            for (Api1210 apiData : api1210List) {
-                api1210 = new SH2023Api1210();
-                BeanUtils.copyProperties(apiData, api1210);
-
-                api1210.setBjw(ShAreaBjw.getBjw(code));
-                api1210.setPch(apiData.getHwdm() + DateFormatUtils.format(apiData.getHzrq(), "yyyy"));
-                list.add(api1210);
-            }
-            return JSON.toJSONString(list);
-        }
-        if (SH2023Constant.SH_2023_API_CODE_1211.equals(inteId)) {
-            SH2023Api1211 api1211;
-            //鏈�鍚庤浆鎹负json
-            List<SH2023Api1211> list = new ArrayList<>();
-            //鎶奷ata杞寲鎴恖ist闆嗗悎
-            List<Api1211> api1211List = castList(data, Api1211.class);
-            for (Api1211 apiData : api1211List) {
-                api1211 = new SH2023Api1211();
-                BeanUtils.copyProperties(apiData, api1211);
-
-                //TODO 璐т綅浠g爜 绮鎬ц川浠g爜 鏉ョ伯浠g爜
-
-                api1211.setBjw(ShAreaBjw.getBjw(code));
-                list.add(api1211);
-            }
-            return JSON.toJSONString(list);
-        }
-        if (SH2023Constant.SH_2023_API_CODE_1212.equals(inteId)) {
-            SH2023Api1212 api1212;
-            //鏈�鍚庤浆鎹负json
-            List<SH2023Api1212> list = new ArrayList<>();
-            //鎶奷ata杞寲鎴恖ist闆嗗悎
-            List<Api1212> api1212List = castList(data, Api1212.class);
-            for (Api1212 apiData : api1212List) {
-                api1212 = new SH2023Api1212();
-                BeanUtils.copyProperties(apiData, api1212);
-                api1212.setBjw(ShAreaBjw.getBjw(code));
-                list.add(api1212);
-            }
-            return JSON.toJSONString(list);
-        }
-        if (SH2023Constant.SH_2023_API_CODE_1301.equals(inteId)) {
-            SH2023Api1301 api1301;
-            //鏈�鍚庤浆鎹负json
-            List<SH2023Api1301> list = new ArrayList<>();
-            //鎶奷ata杞寲鎴恖ist闆嗗悎
-            List<Api1301> api1301List = castList(data, Api1301.class);
-            for (Api1301 apiData : api1301List) {
-                api1301 = new SH2023Api1301();
-                BeanUtils.copyProperties(apiData, api1301);
-                api1301.setBjw(ShAreaBjw.getBjw(code));
-                list.add(api1301);
-            }
-            return JSON.toJSONString(list);
-        }
-        if (SH2023Constant.SH_2023_API_CODE_1302.equals(inteId)) {
-            SH2023Api1302 api1302;
-            //鏈�鍚庤浆鎹负json
-            List<SH2023Api1302> list = new ArrayList<>();
-            //鎶奷ata杞寲鎴恖ist闆嗗悎
-            List<Api1302> api1302List = castList(data, Api1302.class);
-            for (Api1302 apiData : api1302List) {
-                api1302 = new SH2023Api1302();
-                BeanUtils.copyProperties(apiData, api1302);
-                api1302.setBjw(ShAreaBjw.getBjw(code));
-                api1302.setPch(apiData.getHwdm() + DateFormatUtils.format(apiData.getJcsj(), "yyyy"));
-                api1302.setCpjw(String.valueOf(apiData.getLspjw()));
-                api1302.setCzgw(String.valueOf(apiData.getLspjw()));
-                api1302.setCzdw(String.valueOf(apiData.getLspjw()));
-                api1302.setGfwjw(String.valueOf(apiData.getLspjw()));
-                api1302.setLwmx(apiData.getLswdzjh());
-
-                list.add(api1302);
-            }
-            return JSON.toJSONString(list);
-        }
-        if (SH2023Constant.SH_2023_API_CODE_1303.equals(inteId)) {
-            SH2023Api1303 api1303;
-            //鏈�鍚庤浆鎹负json
-            List<SH2023Api1303> list = new ArrayList<>();
-            //鎶奷ata杞寲鎴恖ist闆嗗悎
-            List<Api1303> api1303List = castList(data, Api1303.class);
-            for (Api1303 apiData : api1303List) {
-                api1303 = new SH2023Api1303();
-                BeanUtils.copyProperties(apiData, api1303);
-                api1303.setBjw(ShAreaBjw.getBjw(code));
-                api1303.setPch(apiData.getHwdm() + DateFormatUtils.format(apiData.getJcsj(), "yyyy"));
-                list.add(api1303);
-            }
-            return JSON.toJSONString(list);
-        }
-        if (SH2023Constant.SH_2023_API_CODE_1304.equals(inteId)) {
-            SH2023Api1304 api1304;
-            //鏈�鍚庤浆鎹负json
-            List<SH2023Api1304> list = new ArrayList<>();
-            //鎶奷ata杞寲鎴恖ist闆嗗悎
-            List<Api1304> api1304List = castList(data, Api1304.class);
-            for (Api1304 apiData : api1304List) {
-                api1304 = new SH2023Api1304();
-                BeanUtils.copyProperties(apiData, api1304);
-                api1304.setBjw(ShAreaBjw.getBjw(code));
-                api1304.setPch(apiData.getHwdm() + DateFormatUtils.format(apiData.getJcsj(), "yyyy"));
-                list.add(api1304);
-            }
-            return JSON.toJSONString(list);
-        }
-        if (SH2023Constant.SH_2023_API_CODE_1305.equals(inteId)) {
-            SH2023Api1305 api1305;
-            //鏈�鍚庤浆鎹负json
-            List<SH2023Api1305> list = new ArrayList<>();
-            //鎶奷ata杞寲鎴恖ist闆嗗悎
-            List<Api1305> api1305List = castList(data, Api1305.class);
-            for (Api1305 apiData : api1305List) {
-                api1305 = new SH2023Api1305();
-                BeanUtils.copyProperties(apiData, api1305);
-                api1305.setBjw(ShAreaBjw.getBjw(code));
-                api1305.setAjdm(apiData.getTfzydh().substring(0, 28));
-                list.add(api1305);
-            }
-            return JSON.toJSONString(list);
-        }
-        if (SH2023Constant.SH_2023_API_CODE_1306.equals(inteId)) {
-            SH2023Api1306 api1306;
-            //鏈�鍚庤浆鎹负json
-            List<SH2023Api1306> list = new ArrayList<>();
-            //鎶奷ata杞寲鎴恖ist闆嗗悎
-            List<Api1306> api1306List = castList(data, Api1306.class);
-            for (Api1306 apiData : api1306List) {
-                api1306 = new SH2023Api1306();
-                BeanUtils.copyProperties(apiData, api1306);
-                api1306.setBjw(ShAreaBjw.getBjw(code));
-                api1306.setPch(apiData.getXzzydh().substring(0, 30) + DateFormatUtils.format(apiData.getXzkssj(), "yyyy"));
-                api1306.setAjdm(apiData.getXzzydh().substring(0, 28));
-                list.add(api1306);
-            }
-            return JSON.toJSONString(list);
-        }
-        if (SH2023Constant.SH_2023_API_CODE_1307.equals(inteId)) {
-            SH2023Api1307 api1307;
-            //鏈�鍚庤浆鎹负json
-            List<SH2023Api1307> list = new ArrayList<>();
-            //鎶奷ata杞寲鎴恖ist闆嗗悎
-            List<Api1307> api1307List = castList(data, Api1307.class);
-            for (Api1307 apiData : api1307List) {
-                api1307 = new SH2023Api1307();
-                BeanUtils.copyProperties(apiData, api1307);
-                api1307.setBjw(ShAreaBjw.getBjw(code));
-                api1307.setAjdm(apiData.getHwdm().substring(0, 28));
-                List<Api1109> api1109List = api1109Rep.getDataByFileId(apiData.getFileStorageId());
-                api1307.setTxbh(api1109List.get(0).getWjmc());
-                list.add(api1307);
-            }
-            return JSON.toJSONString(list);
-        }
-        if (SH2023Constant.SH_2023_API_CODE_1310.equals(inteId)) {
-            SH2023Api1310 api1310;
-            //鏈�鍚庤浆鎹负json
-            List<SH2023Api1310> list = new ArrayList<>();
-            //鎶奷ata杞寲鎴恖ist闆嗗悎
-            List<Api1310> api1310List = castList(data, Api1310.class);
-            for (Api1310 apiData : api1310List) {
-                api1310 = new SH2023Api1310();
-                BeanUtils.copyProperties(apiData, api1310);
-                api1310.setBjw(ShAreaBjw.getBjw(code));
-                api1310.setJyrq(apiData.getJysj());
-                api1310.setPch(apiData.getHwdm() + DateFormatUtils.format(apiData.getJysj(), "yyyy"));
-                List<Api1202> api1202List = api1202Rep.getDataByHwdm(apiData.getHwdm());
-                api1310.setLspzdm(api1202List.get(0).getLspzdm());
-                list.add(api1310);
-            }
-            return JSON.toJSONString(list);
-        }
-        if (SH2023Constant.SH_2023_API_CODE_1401.equals(inteId)) {
-            SH2023Api1401 api1401;
-            //鏈�鍚庤浆鎹负json
-            List<SH2023Api1401> list = new ArrayList<>();
-            //鎶奷ata杞寲鎴恖ist闆嗗悎
-            List<Api1401> api1401List = castList(data, Api1401.class);
-            for (Api1401 apiData : api1401List) {
-                api1401 = new SH2023Api1401();
-                BeanUtils.copyProperties(apiData, api1401);
-                api1401.setBjw(ShAreaBjw.getBjw(code));
-                list.add(api1401);
-            }
-            return JSON.toJSONString(list);
-        }
-        if (SH2023Constant.SH_2023_API_CODE_1402.equals(inteId)) {
-            SH2023Api1402 api1402;
-            //鏈�鍚庤浆鎹负json
-            List<SH2023Api1402> list = new ArrayList<>();
-            //鎶奷ata杞寲鎴恖ist闆嗗悎
-            List<Api1402> api1402List = castList(data, Api1402.class);
-            for (Api1402 apiData : api1402List) {
-                api1402 = new SH2023Api1402();
-                BeanUtils.copyProperties(apiData, api1402);
-                api1402.setBjw(ShAreaBjw.getBjw(code));
-                list.add(api1402);
-            }
-            return JSON.toJSONString(list);
-        }
-        if (SH2023Constant.SH_2023_API_CODE_1403.equals(inteId)) {
-            SH2023Api1403 api1403;
-            //鏈�鍚庤浆鎹负json
-            List<SH2023Api1403> list = new ArrayList<>();
-            //鎶奷ata杞寲鎴恖ist闆嗗悎
-            List<Api1403> api1403List = castList(data, Api1403.class);
-            for (Api1403 apiData : api1403List) {
-                api1403 = new SH2023Api1403();
-                BeanUtils.copyProperties(apiData, api1403);
-                api1403.setJhzxdw(apiData.getJhxddw());
-                api1403.setJhzxdwmc(apiData.getJhxddwmc());
-                list.add(api1403);
-            }
-            return JSON.toJSONString(list);
-        }
-        if (SH2023Constant.SH_2023_API_CODE_1404.equals(inteId)) {
-            SH2023Api1404 api1404;
-            //鏈�鍚庤浆鎹负json
-            List<SH2023Api1404> list = new ArrayList<>();
-            //鎶奷ata杞寲鎴恖ist闆嗗悎
-            List<Api1404> api1404List = castList(data, Api1404.class);
-            for (Api1404 apiData : api1404List) {
-                api1404 = new SH2023Api1404();
-                BeanUtils.copyProperties(apiData, api1404);
-                //TODO 鏄庣粏鐘舵��
-
-                list.add(api1404);
-            }
-            return JSON.toJSONString(list);
-        }
-
-        if (SH2023Constant.SH_2023_API_CODE_2102.equals(inteId)) {
-            SH2023Api2102 api2102;
-            //鏈�鍚庤浆鎹负json
-            List<SH2023Api2102> list = new ArrayList<>();
-            //鎶奷ata杞寲鎴恖ist闆嗗悎
-            List<Api1207> api1207List = castList(data, Api1207.class);
-            for (Api1207 apiData : api1207List) {
-                api2102 = new SH2023Api2102();
-                BeanUtils.copyProperties(apiData, api2102);
-                api2102.setDrdh(apiData.getDcdh());
-                api2102.setDcrq(apiData.getDcrq());
-                api2102.setPch(api2102.getDrhwdm() + DateFormatUtils.format(apiData.getDcrq(), "yyyy"));
-                api2102.setBjw(ShAreaBjw.getBjw(code));
-                //TODO 搴撹皟鍗曞彿
-
-                list.add(api2102);
-            }
-            return JSON.toJSONString(list);
-        }
-        if (SH2023Constant.SH_2023_API_CODE_2203.equals(inteId)) {
-            SH2023Api2203 api2203;
-            //鏈�鍚庤浆鎹负json
-            List<SH2023Api2203> list = new ArrayList<>();
-            //鎶奷ata杞寲鎴恖ist闆嗗悎
-            List<Api1201> api1201List = castList(data, Api1201.class);
-            for (Api1201 apiData : api1201List) {
-                api2203 = new SH2023Api2203();
-                BeanUtils.copyProperties(apiData, api2203);
-                api2203.setHtbh(apiData.getHth());
-
-//                api2203.setBdh();
-                api2203.setCjrq(apiData.getQdrq());
-//                api2203.setJyzt();
-//                api2203.setLsxz();
-//                api2203.setLspzmx();
-//                api2203.setScnf();
-//                api2203.setKd();
-                //
-                list.add(api2203);
-            }
-            return JSON.toJSONString(list);
-        }
-        if (SH2023Constant.SH_2023_API_CODE_2204.equals(inteId)) {
-            SH2023Api2204 api2204;
-            //鏈�鍚庤浆鎹负json
-            List<SH2023Api2204> list = new ArrayList<>();
-            //鎶奷ata杞寲鎴恖ist闆嗗悎
-            List<Api1310> api1310List = castList(data, Api1310.class);
-            for (Api1310 apiData : api1310List) {
-                api2204 = new SH2023Api2204();
-                BeanUtils.copyProperties(apiData, api2204);
-//                api2204.setSf();
-//                api2204.setRksf();
-//                api2204.setlldm();
-                api2204.setBjw(ShAreaBjw.getBjw(code));
-                api2204.setPch(apiData.getHwdm() + DateFormatUtils.format(apiData.getJysj(), "yyyy"));
-                list.add(api2204);
-            }
-            return JSON.toJSONString(list);
-        }
+    private Object getJsonFinanceData(String inteId, Object data) {
         //璐㈠姟鎶ヨ〃鏁版嵁灏佽
-        if (SH2023Constant.SH_2023_API_CODE_1114_1501.equals(inteId)){
-            List<SHFinanceDto> list = copyApi1501((Api1501) data);
-            return JSON.toJSONString(list);
+        if (SH2023Constant.SH_2023_API_CODE_1114_1501.equals(inteId)) {
+            return copyApi1501((Api1501) data);
+        } else if (SH2023Constant.SH_2023_API_CODE_1114_1502.equals(inteId)) {
+            return copyApi1502((Api1502) data);
+        } else {
+            return copyApi1503((Api1503) data);
         }
-        if (SH2023Constant.SH_2023_API_CODE_1114_1502.equals(inteId)){
-            List<SHFinanceDto> list = copyApi1502((Api1502) data);
-            return JSON.toJSONString(list);
-        }
-        if (SH2023Constant.SH_2023_API_CODE_1114_1503.equals(inteId)){
-            List<SHFinanceDto> list = copyApi1503((Api1503) data);
-            return JSON.toJSONString(list);
-        }
-
-        return JSON.toJSONString(data);
     }
 
-    /**
-     * Object绫诲瀷杞彉涓篖ist
-     *
-     * @param obj
-     * @param clazz
-     * @param <T>
-     * @return
-     */
-    public static <T> List<T> castList(Object obj, Class<T> clazz) {
-        List<T> result = new ArrayList<T>();
-        if (obj instanceof List<?>) {
-            for (Object o : (List<?>) obj) {
-                result.add(clazz.cast(o));
-            }
-            return result;
-        }
-        return null;
-    }
-
-
-    private List<SHFinanceDto> copyApi1503(Api1503 data) {
-        Api1503 api1503 = data;
+    private List<SHFinanceDto> copyApi1503(Api1503 api1503) {
         List<SHFinanceDto> list = new ArrayList<>();
         SHFinanceDto shFinanceDto = new SHFinanceDto();
         shFinanceDto.setDwdm(api1503.getDwdm());
@@ -1018,8 +1166,7 @@
         return list;
     }
 
-    private List<SHFinanceDto> copyApi1502(Api1502 data) {
-        Api1502 api1502 = data;
+    private List<SHFinanceDto> copyApi1502(Api1502 api1502) {
         List<SHFinanceDto> list = new ArrayList<>();
         SHFinanceDto shFinanceDto = new SHFinanceDto();
         shFinanceDto.setDwdm(api1502.getDwdm());
@@ -1071,8 +1218,7 @@
         return list;
     }
 
-    private List<SHFinanceDto> copyApi1501(Api1501 data) {
-        Api1501 api1501 = data;
+    private List<SHFinanceDto> copyApi1501(Api1501 api1501) {
         List<SHFinanceDto> list = new ArrayList<>();
         SHFinanceDto shFinanceDto = new SHFinanceDto();
         shFinanceDto.setDwdm(api1501.getDwdm());
@@ -1160,11 +1306,7 @@
         return list;
     }
 
-    private void paddingData(SHFinanceDto common,
-                             List<SHFinanceDto> list,
-                             String zbmc,
-                             String zbz1,
-                             String zbz2) {
+    private void paddingData(SHFinanceDto common, List<SHFinanceDto> list, String zbmc, String zbz1, String zbz2) {
         SHFinanceDto shFinanceDto = new SHFinanceDto();
         BeanUtils.copyProperties(common, shFinanceDto);
         shFinanceDto.setZbmc(zbmc);
@@ -1172,4 +1314,53 @@
         shFinanceDto.setZbz2(zbz2);
         list.add(shFinanceDto);
     }
+
+    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")) {
+                wjmc = wjmc.replaceAll(".png", "_00.png");
+            }
+        }
+        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涓哄疄浣撳璞″悕
+        Field[] fields = object.getClass().getDeclaredFields();
+        for (Field field : fields) {
+            field.setAccessible(true);
+            try {
+                // 鍒ゆ柇灞炴�у�兼槸鍚︿负null
+                if (field.get(object) == null || field.get(object) == "") {
+                    //鏍规嵁绫诲瀷璁剧疆榛樿鍊�
+                    if (field.getType() == String.class) {
+                        field.set(object, "鏃�");
+                    }
+                    if (field.getType() == Integer.class) {
+                        field.set(object, 0);
+                    }
+                    if (field.getType() == Double.class) {
+                        field.set(object, 0.0);
+                    }
+                    if (field.getType() == Date.class) {
+                        field.set(object, new Date());
+                    }
+                }
+            } catch (IllegalAccessException e) {
+                e.printStackTrace();
+            }
+        }
+        return object;
+    }
+
 }
\ No newline at end of file

--
Gitblit v1.9.3