瀏覽代碼

修改报错

wangqian 4 周之前
父節點
當前提交
b090918732

+ 1 - 1
pom.xml

@@ -9,7 +9,7 @@
         <relativePath/> <!-- lookup parent from repository -->
     </parent>
     <groupId>cn.gov.customs</groupId>
-    <artifactId>wxjy-data-serivce</artifactId>
+    <artifactId>wxjy-data-service</artifactId>
     <version>0.0.1-SNAPSHOT</version>
     <name>wxjy-data-service</name>
     <description>Data Service project for Spring Boot</description>

File diff suppressed because it is too large
+ 0 - 0
src/main/java/cn/gov/customs/data/entity/wxjy/bus/EntryHead.java


+ 9 - 4
src/main/java/cn/gov/customs/data/timer/H2018NewDeclaredGoodsUtil.java

@@ -2,9 +2,11 @@ package cn.gov.customs.data.timer;
 
 
 import cn.gov.customs.data.entity.wxjy.bus.NewDeclaredGoods;
+import cn.gov.customs.data.entity.wxjy.common.PubCustomsMapping;
 import cn.gov.customs.data.repository.h2018.H2018Repository;
 import cn.gov.customs.data.repository.wxjy.WxjyRepository;
 import cn.gov.customs.data.repository.wxjy.bus.NewDeclaredGoodsRepository;
+import cn.gov.customs.data.repository.wxjy.common.PubCustomsMappingRepository;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -40,17 +42,20 @@ public class H2018NewDeclaredGoodsUtil {
    @Autowired
    private WxjyRepository dao;
 
+    @Autowired
+    private PubCustomsMappingRepository mappingRepository;
+
     @Autowired
     private NewDeclaredGoodsRepository newDeclaredGoodsRepository;
 
    @SuppressWarnings("unchecked")
    public void toDoDataMain(Date statBegin, List<String> list) {
        Date date = new Date();
-       List<Object[]> custMapping = (List<Object[]>) dao.getQueryBySql("select customs_code,mapping_code from BUS_PUB_CUSTOMS_MAPPING");
+       List<PubCustomsMapping> custMapping = mappingRepository.findAll();
        Map<String,String> map = new HashMap<String,String>();
-       for (Object[] m : custMapping) {
-           String pCustomCode = (String)m[1];
-           map.put((String)m[0], pCustomCode);
+       for (PubCustomsMapping m : custMapping) {
+           String pCustomCode = m.getMappingCode();
+           map.put(m.getCustomsCode(), pCustomCode);
        }
        dao.executeUpdate("delete from WXJY_NEW_DECLARED_GOODS");
        //危险货物

+ 71 - 67
src/main/java/cn/gov/customs/data/timer/H2018ZhDangerGoodsUtil.java

@@ -483,6 +483,7 @@ public class H2018ZhDangerGoodsUtil {
 							e.setPreReleaseDate(preReleaseDate);// 81时间
 							e.setPassMode("1");// 一体化通关
 							e.setDeclPort(declPort);
+							e.setCustomsCode(rootCustomsMap.get(declPort));
 							e.setIePort(iePort);
 							e.setIeDate(ieDate);
 							e.setDeclDate(declDate);
@@ -672,7 +673,7 @@ public class H2018ZhDangerGoodsUtil {
 							e.setManChkTimeEnd(manChkTimeEnd);//查验结束时间
 							e.setManProcResult(manProcResult);
 							e.setManProcIdea(manProcIdea);
-							e.setCheckCustomsCode(checkCustomsCode);
+							e.setCheckCustomsCode(rootCustomsMap.get(checkCustomsCode));
 							dao.executeUpdate("delete from WXJY_ENTRY_HEAD where ENTRY_ID = ?", entryId);
 							entryHeadRepository.save(e);
 						}
@@ -751,7 +752,7 @@ public class H2018ZhDangerGoodsUtil {
 												if (ieFlag.equals("0")) {
 													if (codeTs[16] != null) {
 														//syncChemicalsCiq只可能是包含了危化品,因为这个表的数据就是查询的系统中危险品模块里用户已经维护的包含了危化品的数据
-														Object[] obj = (Object[]) dao.getObjectBySql("select * from iedg_sync_chemicals_ciq where CIQ_CODE = ?", (String) codeTs[16]);
+														Object[] obj = (Object[]) iedgRepository.getObjectBySql("select * from iedg_sync_chemicals_ciq where CIQ_CODE = ?", (String) codeTs[16]);
 														if (obj != null) {
 															if (codeTs[16] != null) {
 																entity.setGoodsType("1,2,3");
@@ -1191,6 +1192,7 @@ public class H2018ZhDangerGoodsUtil {
 								e.setPassMode("3");// 转关
 							}
 							e.setDeclPort(declPort);
+							e.setCustomsCode(rootCustomsMap.get(declPort));
 							e.setIePort(iePort);
 							e.setIeDate(ieDate);
 							e.setDeclDate(declDate);
@@ -1389,7 +1391,7 @@ public class H2018ZhDangerGoodsUtil {
 							e.setManChkTimeEnd(manChkTimeEnd);//查验结束时间
 							e.setManProcResult(manProcResult);
 							e.setManProcIdea(manProcIdea);
-							e.setCheckCustomsCode(checkCustomsCode);
+							e.setCheckCustomsCode(rootCustomsMap.get(checkCustomsCode));
 							dao.executeUpdate("delete from WXJY_ENTRY_HEAD where ENTRY_ID = ?", entryId);
 							entryHeadRepository.save(e);
 						}
@@ -1468,7 +1470,7 @@ public class H2018ZhDangerGoodsUtil {
 												if (ieFlag.equals("0")) {
 													if (codeTs[16] != null) {
 														//syncChemicalsCiq只可能是包含了危化品,因为这个表的数据就是查询的系统中危险品模块里用户已经维护的包含了危化品的数据
-														Object[] obj = (Object[]) dao.getObjectBySql("select * from iedg_sync_chemicals_ciq where CIQ_CODE = ?", (String) codeTs[16]);
+														Object[] obj = (Object[]) iedgRepository.getObjectBySql("select * from iedg_sync_chemicals_ciq where CIQ_CODE = ?", (String) codeTs[16]);
 														if (obj != null) {
 															if (codeTs[16] != null) {
 																entity.setGoodsType("1,2,3");
@@ -1809,6 +1811,7 @@ public class H2018ZhDangerGoodsUtil {
 							e.setPreReleaseDate(preReleaseDate);// 81时间
 							e.setPassMode("2");// 一体化通关
 							e.setDeclPort(declPort);
+							e.setCustomsCode(rootCustomsMap.get(declPort));
 							e.setIePort(iePort);
 							e.setIeDate(ieDate);
 							e.setDeclDate(declDate);
@@ -1995,7 +1998,7 @@ public class H2018ZhDangerGoodsUtil {
 							e.setManChkTimeEnd(manChkTimeEnd);//查验结束时间
 							e.setManProcResult(manProcResult);
 							e.setManProcIdea(manProcIdea);
-							e.setCheckCustomsCode(checkCustomsCode);
+							e.setCheckCustomsCode(rootCustomsMap.get(checkCustomsCode));
 							dao.executeUpdate("delete from WXJY_ENTRY_HEAD where ENTRY_ID = ?", entryId);
 							entryHeadRepository.save(e);
 
@@ -2075,7 +2078,7 @@ public class H2018ZhDangerGoodsUtil {
 												if (ieFlag.equals("0")) {
 													if (codeTs[16] != null) {
 														//syncChemicalsCiq只可能是包含了危化品,因为这个表的数据就是查询的系统中危险品模块里用户已经维护的包含了危化品的数据
-														Object[] obj = (Object[]) dao.getObjectBySql("select * from iedg_sync_chemicals_ciq where CIQ_CODE = ?", (String) codeTs[16]);
+														Object[] obj = (Object[]) iedgRepository.getObjectBySql("select * from iedg_sync_chemicals_ciq where CIQ_CODE = ?", (String) codeTs[16]);
 														if (obj != null) {
 															if (codeTs[16] != null) {
 																entity.setGoodsType("1,2,3");
@@ -2806,41 +2809,42 @@ public class H2018ZhDangerGoodsUtil {
 					String customCodeT = (String) s[2];
 					if (customCode.equals(customCodeT)) {// 找到了既是唯一一条
 						CustomMonthlyStatFinal stat = new CustomMonthlyStatFinal();
+						stat.setCustomCode(customCodeT);
 						stat.setMonth((String) s[1]);
-						stat.setImpDeclCount(Integer.valueOf(((BigDecimal) s[2]).toString()));
-						stat.setImpManDeclCount(Integer.valueOf(((BigDecimal) s[3]).toString()));
-						stat.setImpManualAuditDeclCount(Integer.valueOf(((BigDecimal) s[4]).toString()));
-						stat.setImpDeclCountLastMonth(Integer.valueOf(((BigDecimal) s[5]).toString()));
-						stat.setImpDeclCountLastYearDecember(Integer.valueOf(((BigDecimal) s[6]).toString()));
-						stat.setImpDeclCountCurentYear(Integer.valueOf(((BigDecimal) s[7]).toString()));
-						stat.setImpDeclCountYearBeforeLast(Integer.valueOf(((BigDecimal) s[8]).toString()));
-						stat.setImpTotalCost((BigDecimal) s[9]);
-						stat.setImpTotalCostLastMonth((BigDecimal) s[10]);
-						stat.setImpTotalCostLastYearDecember((BigDecimal) s[11]);
-						stat.setImpTotalCostCurentYear((BigDecimal) s[12]);
-						stat.setImpTotalCostYearBeforeLast((BigDecimal) s[13]);
-						stat.setImpCuCost((BigDecimal) s[14]);
-						stat.setImpCuCostLastMonth((BigDecimal) s[15]);
-						stat.setImpCuCostLastYearDecember((BigDecimal) s[16]);
-						stat.setImpCuCostCurentYear((BigDecimal) s[17]);
-						stat.setImpCuCostYearBeforeLast((BigDecimal) s[18]);
-						stat.setExpDeclCount(Integer.valueOf(((BigDecimal) s[19]).toString()));
-						stat.setExpManDeclCount(Integer.valueOf(((BigDecimal) s[20]).toString()));
-						stat.setExpManualAuditDeclCount(Integer.valueOf(((BigDecimal) s[21]).toString()));
-						stat.setExpDeclCountLastMonth(Integer.valueOf(((BigDecimal) s[22]).toString()));
-						stat.setExpDeclCountLastYearDecember(Integer.valueOf(((BigDecimal) s[23]).toString()));
-						stat.setExpDeclCountCurentYear(Integer.valueOf(((BigDecimal) s[24]).toString()));
-						stat.setExpDeclCountYearBeforeLast(Integer.valueOf(((BigDecimal) s[25]).toString()));
-						stat.setExpTotalCost((BigDecimal) s[26]);
-						stat.setExpTotalCostLastMonth((BigDecimal) s[27]);
-						stat.setExpTotalCostLastYearDecember((BigDecimal) s[28]);
-						stat.setExpTotalCostCurentYear((BigDecimal) s[29]);
-						stat.setExpTotalCostYearBeforeLast((BigDecimal) s[30]);
-						stat.setExpCuCost((BigDecimal) s[31]);
-						stat.setExpCuCostLastMonth((BigDecimal) s[32]);
-						stat.setExpCuCostLastYearDecember((BigDecimal) s[33]);
-						stat.setExpCuCostCurentYear((BigDecimal) s[34]);
-						stat.setExpCuCostYearBeforeLast((BigDecimal) s[35]);
+						stat.setImpDeclCount(Integer.valueOf(((BigDecimal) s[3]).intValue()));
+						stat.setImpManDeclCount(Integer.valueOf(((BigDecimal) s[4]).intValue()));
+						stat.setImpManualAuditDeclCount(Integer.valueOf(((BigDecimal) s[5]).intValue()));
+						stat.setImpDeclCountLastMonth(Integer.valueOf(((BigDecimal) s[6]).intValue()));
+						stat.setImpDeclCountLastYearDecember(Integer.valueOf(((BigDecimal) s[7]).intValue()));
+						stat.setImpDeclCountCurentYear(Integer.valueOf(((BigDecimal) s[8]).intValue()));
+						stat.setImpDeclCountYearBeforeLast(Integer.valueOf(((BigDecimal) s[9]).intValue()));
+						stat.setImpTotalCost((BigDecimal) s[10]);
+						stat.setImpTotalCostLastMonth((BigDecimal) s[11]);
+						stat.setImpTotalCostLastYearDecember((BigDecimal) s[12]);
+						stat.setImpTotalCostCurentYear((BigDecimal) s[13]);
+						stat.setImpTotalCostYearBeforeLast((BigDecimal) s[14]);
+						stat.setImpCuCost((BigDecimal) s[15]);
+						stat.setImpCuCostLastMonth((BigDecimal) s[16]);
+						stat.setImpCuCostLastYearDecember((BigDecimal) s[17]);
+						stat.setImpCuCostCurentYear((BigDecimal) s[18]);
+						stat.setImpCuCostYearBeforeLast((BigDecimal) s[19]);
+						stat.setExpDeclCount(Integer.valueOf(((BigDecimal) s[20]).intValue()));
+						stat.setExpManDeclCount(Integer.valueOf(((BigDecimal) s[21]).intValue()));
+						stat.setExpManualAuditDeclCount(Integer.valueOf(((BigDecimal) s[22]).intValue()));
+						stat.setExpDeclCountLastMonth(Integer.valueOf(((BigDecimal) s[23]).intValue()));
+						stat.setExpDeclCountLastYearDecember(Integer.valueOf(((BigDecimal) s[24]).intValue()));
+						stat.setExpDeclCountCurentYear(Integer.valueOf(((BigDecimal) s[25]).intValue()));
+						stat.setExpDeclCountYearBeforeLast(Integer.valueOf(((BigDecimal) s[26]).intValue()));
+						stat.setExpTotalCost((BigDecimal) s[27]);
+						stat.setExpTotalCostLastMonth((BigDecimal) s[28]);
+						stat.setExpTotalCostLastYearDecember((BigDecimal) s[29]);
+						stat.setExpTotalCostCurentYear((BigDecimal) s[30]);
+						stat.setExpTotalCostYearBeforeLast((BigDecimal) s[31]);
+						stat.setExpCuCost((BigDecimal) s[32]);
+						stat.setExpCuCostLastMonth((BigDecimal) s[33]);
+						stat.setExpCuCostLastYearDecember((BigDecimal) s[34]);
+						stat.setExpCuCostCurentYear((BigDecimal) s[35]);
+						stat.setExpCuCostYearBeforeLast((BigDecimal) s[36]);
 						stat.setId(dao.getGuidStringBySql());
 						customMonthlyStatFinalRepository.save(stat);
 						existData = true;
@@ -2882,10 +2886,10 @@ public class H2018ZhDangerGoodsUtil {
 							monthSdf.format(lastMonthDate), customCode);
 					if (lastMonthData != null && lastMonthData.size() > 0) {
 						for (Object[] s : lastMonthData) {
-							stat.setImpDeclCountLastMonth(Integer.valueOf(((BigDecimal)  s[6]).toString()));
+							stat.setImpDeclCountLastMonth(Integer.valueOf(((BigDecimal)  s[6]).intValue()));
 							stat.setImpCuCostLastMonth((BigDecimal) s[15]);
 							stat.setImpTotalCostLastMonth((BigDecimal) s[10]);
-							stat.setExpDeclCountLastMonth(Integer.valueOf(((BigDecimal)  s[22]).toString()));
+							stat.setExpDeclCountLastMonth(Integer.valueOf(((BigDecimal)  s[22]).intValue()));
 							stat.setExpCuCostLastMonth((BigDecimal) s[31]);
 							stat.setExpTotalCostLastMonth((BigDecimal) s[26]);
 
@@ -2897,10 +2901,10 @@ public class H2018ZhDangerGoodsUtil {
 								stat.setExpCuCostCurentYear(zero);
 								stat.setExpTotalCostCurentYear(zero);
 								// 去年12月也就是上个月
-								stat.setImpDeclCountLastYearDecember(Integer.valueOf(((BigDecimal) s[3]).toString()));
+								stat.setImpDeclCountLastYearDecember(Integer.valueOf(((BigDecimal) s[3]).intValue()));
 								stat.setImpCuCostLastYearDecember((BigDecimal) s[14]);
 								stat.setImpTotalCostLastYearDecember((BigDecimal) s[9]);
-								stat.setExpDeclCountLastYearDecember(Integer.valueOf(((BigDecimal) s[21]).toString()));
+								stat.setExpDeclCountLastYearDecember(Integer.valueOf(((BigDecimal) s[21]).intValue()));
 								stat.setExpCuCostLastYearDecember((BigDecimal) s[30]);
 								stat.setExpTotalCostLastYearDecember((BigDecimal) s[25]);
 								// 前年平均值需要重新查询&计算
@@ -2927,7 +2931,7 @@ public class H2018ZhDangerGoodsUtil {
 										BigDecimal sumExpTotalCostYBL = new BigDecimal(0);
 
 										for (Object[] t : yearBeforeLastData) {
-											Integer impCount = Integer.valueOf(((BigDecimal) t[3]).toString());
+											Integer impCount = Integer.valueOf(((BigDecimal) t[3]).intValue());
 											if (impCount != null && impCount != 0) {
 												sumImpDeclCountYBL += impCount;
 												BigDecimal mul = new BigDecimal(impCount);
@@ -2942,7 +2946,7 @@ public class H2018ZhDangerGoodsUtil {
 												}
 											}
 
-											Integer expCount = Integer.valueOf(((BigDecimal) t[21]).toString());
+											Integer expCount = Integer.valueOf(((BigDecimal) t[21]).intValue());
 											if (expCount != null && expCount != 0) {
 												sumExpDeclCountYBL += expCount;
 												BigDecimal mul = new BigDecimal(expCount);
@@ -2998,24 +3002,24 @@ public class H2018ZhDangerGoodsUtil {
 									stat.setExpTotalCostYearBeforeLast(zero);
 								}
 							} else {
-								stat.setImpDeclCountCurentYear(Integer.valueOf(((BigDecimal) s[8]).toString()));
+								stat.setImpDeclCountCurentYear(Integer.valueOf(((BigDecimal) s[8]).intValue()));
 								stat.setImpCuCostCurentYear((BigDecimal) s[17]);
 								stat.setImpTotalCostCurentYear((BigDecimal) s[12]);
-								stat.setExpDeclCountCurentYear(Integer.valueOf(((BigDecimal) s[24]).toString()));
+								stat.setExpDeclCountCurentYear(Integer.valueOf(((BigDecimal) s[24]).intValue()));
 								stat.setExpCuCostCurentYear((BigDecimal) s[33]);
 								stat.setExpTotalCostCurentYear((BigDecimal) s[28]);
 								// 去年12月数据是上个月对应字段的值
-								stat.setImpDeclCountLastYearDecember(Integer.valueOf(((BigDecimal) s[7]).toString()));
+								stat.setImpDeclCountLastYearDecember(Integer.valueOf(((BigDecimal) s[7]).intValue()));
 								stat.setImpCuCostLastYearDecember((BigDecimal) s[16]);
 								stat.setImpTotalCostLastYearDecember((BigDecimal) s[11]);
-								stat.setExpDeclCountLastYearDecember(Integer.valueOf(((BigDecimal) s[23]).toString()));
+								stat.setExpDeclCountLastYearDecember(Integer.valueOf(((BigDecimal) s[23]).intValue()));
 								stat.setExpCuCostLastYearDecember((BigDecimal) s[32]);
 								stat.setExpTotalCostLastYearDecember((BigDecimal) s[27]);
 
-								stat.setImpDeclCountYearBeforeLast(Integer.valueOf(((BigDecimal) s[9]).toString()));
+								stat.setImpDeclCountYearBeforeLast(Integer.valueOf(((BigDecimal) s[9]).intValue()));
 								stat.setImpCuCostYearBeforeLast((BigDecimal) s[18]);
 								stat.setImpTotalCostYearBeforeLast((BigDecimal) s[13]);
-								stat.setExpDeclCountYearBeforeLast(Integer.valueOf(((BigDecimal) s[25]).toString()));
+								stat.setExpDeclCountYearBeforeLast(Integer.valueOf(((BigDecimal) s[25]).intValue()));
 								stat.setExpCuCostYearBeforeLast((BigDecimal) s[34]);
 								stat.setExpTotalCostYearBeforeLast((BigDecimal) s[29]);
 							}
@@ -3093,23 +3097,23 @@ public class H2018ZhDangerGoodsUtil {
 
 				for (Object[] s : copyList) {
 					if (customCode.equals((String) s[2])) {
-						sumImpDeclCount += Integer.valueOf(((BigDecimal) s[3]).toString());
-						sumImpManDeclCount += Integer.valueOf(((BigDecimal) s[4]).toString());
-						sumImpAuditDeclCount += Integer.valueOf(((BigDecimal) s[5]).toString());
-						sumImpDeclCountLastMonth += s[6] != null ? Integer.valueOf(((BigDecimal) s[6]).toString()) : 0;
-						sumImpDeclCountLastYearDecember += s[7] != null ? Integer.valueOf(((BigDecimal) s[7]).toString())
+						sumImpDeclCount += Integer.valueOf(((BigDecimal) s[3]).intValue());
+						sumImpManDeclCount += Integer.valueOf(((BigDecimal) s[4]).intValue());
+						sumImpAuditDeclCount += Integer.valueOf(((BigDecimal) s[5]).intValue());
+						sumImpDeclCountLastMonth += s[6] != null ? Integer.valueOf(((BigDecimal) s[6]).intValue()) : 0;
+						sumImpDeclCountLastYearDecember += s[7] != null ? Integer.valueOf(((BigDecimal) s[7]).intValue())
 								: 0;
-						sumImpDeclCountCurentYear += s[8] != null ? Integer.valueOf(((BigDecimal) s[8]).toString()) : 0;
-						sumImpDeclCountYearBeforeLast += s[9] != null ? Integer.valueOf(((BigDecimal) s[9]).toString()) : 0;
-
-						sumExpDeclCount += Integer.valueOf(((BigDecimal) s[20]).toString());
-						sumExpManDeclCount += Integer.valueOf(((BigDecimal) s[21]).toString());
-						sumExpAuditDeclCount += Integer.valueOf(((BigDecimal) s[22]).toString());
-						sumExpDeclCountLastMonth += s[23] != null ? Integer.valueOf(((BigDecimal) s[23]).toString()) : 0;
-						sumExpDeclCountLastYearDecember += s[24] != null ? Integer.valueOf(((BigDecimal) s[24]).toString())
+						sumImpDeclCountCurentYear += s[8] != null ? Integer.valueOf(((BigDecimal) s[8]).intValue()) : 0;
+						sumImpDeclCountYearBeforeLast += s[9] != null ? Integer.valueOf(((BigDecimal) s[9]).intValue()) : 0;
+
+						sumExpDeclCount += Integer.valueOf(((BigDecimal) s[20]).intValue());
+						sumExpManDeclCount += Integer.valueOf(((BigDecimal) s[21]).intValue());
+						sumExpAuditDeclCount += Integer.valueOf(((BigDecimal) s[22]).intValue());
+						sumExpDeclCountLastMonth += s[23] != null ? Integer.valueOf(((BigDecimal) s[23]).intValue()) : 0;
+						sumExpDeclCountLastYearDecember += s[24] != null ? Integer.valueOf(((BigDecimal) s[24]).intValue())
 								: 0;
-						sumExpDeclCountCurentYear += s[25] != null ? Integer.valueOf(((BigDecimal) s[25]).toString()) : 0;
-						sumExpDeclCountYearBeforeLast += s[26] != null ? Integer.valueOf(((BigDecimal) s[26]).toString()) : 0;
+						sumExpDeclCountCurentYear += s[25] != null ? Integer.valueOf(((BigDecimal) s[25]).intValue()) : 0;
+						sumExpDeclCountYearBeforeLast += s[26] != null ? Integer.valueOf(((BigDecimal) s[26]).intValue()) : 0;
 
 						BigDecimal impCurMonthMultiply = (BigDecimal) s[3];
 						BigDecimal impLastMonthMultiply = s[6] != null ? (BigDecimal) s[6] : new BigDecimal(0);

+ 71 - 67
src/main/java/cn/gov/customs/data/timer/H2018ZhOldDangerGoodsUtil.java

@@ -483,6 +483,7 @@ public class H2018ZhOldDangerGoodsUtil {
 							e.setPreReleaseDate(preReleaseDate);// 81时间
 							e.setPassMode("1");// 一体化通关
 							e.setDeclPort(declPort);
+							e.setCustomsCode(rootCustomsMap.get(declPort));
 							e.setIePort(iePort);
 							e.setIeDate(ieDate);
 							e.setDeclDate(declDate);
@@ -672,7 +673,7 @@ public class H2018ZhOldDangerGoodsUtil {
 							e.setManChkTimeEnd(manChkTimeEnd);//查验结束时间
 							e.setManProcResult(manProcResult);
 							e.setManProcIdea(manProcIdea);
-							e.setCheckCustomsCode(checkCustomsCode);
+							e.setCheckCustomsCode(rootCustomsMap.get(checkCustomsCode));
 							dao.executeUpdate("delete from WXJY_ENTRY_HEAD where ENTRY_ID = ?", entryId);
 
 							entryHeadRepository.save(e);
@@ -752,7 +753,7 @@ public class H2018ZhOldDangerGoodsUtil {
 												if (ieFlag.equals("0")) {
 													if (codeTs[16] != null) {
 														//syncChemicalsCiq只可能是包含了危化品,因为这个表的数据就是查询的系统中危险品模块里用户已经维护的包含了危化品的数据
-														Object[] obj = (Object[]) dao.getObjectBySql("select * from iedg_sync_chemicals_ciq where CIQ_CODE = ?", (String) codeTs[16]);
+														Object[] obj = (Object[]) iedgRepository.getObjectBySql("select * from iedg_sync_chemicals_ciq where CIQ_CODE = ?", (String) codeTs[16]);
 														if (obj != null) {
 															if (codeTs[16] != null) {
 																entity.setGoodsType("1,2,3");
@@ -1192,6 +1193,7 @@ public class H2018ZhOldDangerGoodsUtil {
 								e.setPassMode("3");// 转关
 							}
 							e.setDeclPort(declPort);
+							e.setCustomsCode(rootCustomsMap.get(declPort));
 							e.setIePort(iePort);
 							e.setIeDate(ieDate);
 							e.setDeclDate(declDate);
@@ -1390,7 +1392,7 @@ public class H2018ZhOldDangerGoodsUtil {
 							e.setManChkTimeEnd(manChkTimeEnd);//查验结束时间
 							e.setManProcResult(manProcResult);
 							e.setManProcIdea(manProcIdea);
-							e.setCheckCustomsCode(checkCustomsCode);
+							e.setCheckCustomsCode(rootCustomsMap.get(checkCustomsCode));
 							dao.executeUpdate("delete from WXJY_ENTRY_HEAD where ENTRY_ID = ?", entryId);
 							entryHeadRepository.save(e);
 						}
@@ -1469,7 +1471,7 @@ public class H2018ZhOldDangerGoodsUtil {
 												if (ieFlag.equals("0")) {
 													if (codeTs[16] != null) {
 														//syncChemicalsCiq只可能是包含了危化品,因为这个表的数据就是查询的系统中危险品模块里用户已经维护的包含了危化品的数据
-														Object[] obj = (Object[]) dao.getObjectBySql("select * from iedg_sync_chemicals_ciq where CIQ_CODE = ?", (String) codeTs[16]);
+														Object[] obj = (Object[]) iedgRepository.getObjectBySql("select * from iedg_sync_chemicals_ciq where CIQ_CODE = ?", (String) codeTs[16]);
 														if (obj != null) {
 															if (codeTs[16] != null) {
 																entity.setGoodsType("1,2,3");
@@ -1810,6 +1812,7 @@ public class H2018ZhOldDangerGoodsUtil {
 							e.setPreReleaseDate(preReleaseDate);// 81时间
 							e.setPassMode("2");// 一体化通关
 							e.setDeclPort(declPort);
+							e.setCustomsCode(rootCustomsMap.get(declPort));
 							e.setIePort(iePort);
 							e.setIeDate(ieDate);
 							e.setDeclDate(declDate);
@@ -1996,7 +1999,7 @@ public class H2018ZhOldDangerGoodsUtil {
 							e.setManChkTimeEnd(manChkTimeEnd);//查验结束时间
 							e.setManProcResult(manProcResult);
 							e.setManProcIdea(manProcIdea);
-							e.setCheckCustomsCode(checkCustomsCode);
+							e.setCheckCustomsCode(rootCustomsMap.get(checkCustomsCode));
 							dao.executeUpdate("delete from WXJY_ENTRY_HEAD where ENTRY_ID = ?", entryId);
 							entryHeadRepository.save(e);
 
@@ -2076,7 +2079,7 @@ public class H2018ZhOldDangerGoodsUtil {
 												if (ieFlag.equals("0")) {
 													if (codeTs[16] != null) {
 														//syncChemicalsCiq只可能是包含了危化品,因为这个表的数据就是查询的系统中危险品模块里用户已经维护的包含了危化品的数据
-														Object[] obj = (Object[]) dao.getObjectBySql("select * from iedg_sync_chemicals_ciq where CIQ_CODE = ?", (String) codeTs[16]);
+														Object[] obj = (Object[]) iedgRepository.getObjectBySql("select * from iedg_sync_chemicals_ciq where CIQ_CODE = ?", (String) codeTs[16]);
 														if (obj != null) {
 															if (codeTs[16] != null) {
 																entity.setGoodsType("1,2,3");
@@ -2807,41 +2810,42 @@ public class H2018ZhOldDangerGoodsUtil {
 					String customCodeT = (String) s[2];
 					if (customCode.equals(customCodeT)) {// 找到了既是唯一一条
 						CustomMonthlyStatFinal stat = new CustomMonthlyStatFinal();
+						stat.setCustomCode(customCodeT);
 						stat.setMonth((String) s[1]);
-						stat.setImpDeclCount(Integer.valueOf(((BigDecimal) s[2]).toString()));
-						stat.setImpManDeclCount(Integer.valueOf(((BigDecimal) s[3]).toString()));
-						stat.setImpManualAuditDeclCount(Integer.valueOf(((BigDecimal) s[4]).toString()));
-						stat.setImpDeclCountLastMonth(Integer.valueOf(((BigDecimal) s[5]).toString()));
-						stat.setImpDeclCountLastYearDecember(Integer.valueOf(((BigDecimal) s[6]).toString()));
-						stat.setImpDeclCountCurentYear(Integer.valueOf(((BigDecimal) s[7]).toString()));
-						stat.setImpDeclCountYearBeforeLast(Integer.valueOf(((BigDecimal) s[8]).toString()));
-						stat.setImpTotalCost((BigDecimal) s[9]);
-						stat.setImpTotalCostLastMonth((BigDecimal) s[10]);
-						stat.setImpTotalCostLastYearDecember((BigDecimal) s[11]);
-						stat.setImpTotalCostCurentYear((BigDecimal) s[12]);
-						stat.setImpTotalCostYearBeforeLast((BigDecimal) s[13]);
-						stat.setImpCuCost((BigDecimal) s[14]);
-						stat.setImpCuCostLastMonth((BigDecimal) s[15]);
-						stat.setImpCuCostLastYearDecember((BigDecimal) s[16]);
-						stat.setImpCuCostCurentYear((BigDecimal) s[17]);
-						stat.setImpCuCostYearBeforeLast((BigDecimal) s[18]);
-						stat.setExpDeclCount(Integer.valueOf(((BigDecimal) s[19]).toString()));
-						stat.setExpManDeclCount(Integer.valueOf(((BigDecimal) s[20]).toString()));
-						stat.setExpManualAuditDeclCount(Integer.valueOf(((BigDecimal) s[21]).toString()));
-						stat.setExpDeclCountLastMonth(Integer.valueOf(((BigDecimal) s[22]).toString()));
-						stat.setExpDeclCountLastYearDecember(Integer.valueOf(((BigDecimal) s[23]).toString()));
-						stat.setExpDeclCountCurentYear(Integer.valueOf(((BigDecimal) s[24]).toString()));
-						stat.setExpDeclCountYearBeforeLast(Integer.valueOf(((BigDecimal) s[25]).toString()));
-						stat.setExpTotalCost((BigDecimal) s[26]);
-						stat.setExpTotalCostLastMonth((BigDecimal) s[27]);
-						stat.setExpTotalCostLastYearDecember((BigDecimal) s[28]);
-						stat.setExpTotalCostCurentYear((BigDecimal) s[29]);
-						stat.setExpTotalCostYearBeforeLast((BigDecimal) s[30]);
-						stat.setExpCuCost((BigDecimal) s[31]);
-						stat.setExpCuCostLastMonth((BigDecimal) s[32]);
-						stat.setExpCuCostLastYearDecember((BigDecimal) s[33]);
-						stat.setExpCuCostCurentYear((BigDecimal) s[34]);
-						stat.setExpCuCostYearBeforeLast((BigDecimal) s[35]);
+						stat.setImpDeclCount(Integer.valueOf(((BigDecimal) s[3]).intValue()));
+						stat.setImpManDeclCount(Integer.valueOf(((BigDecimal) s[4]).intValue()));
+						stat.setImpManualAuditDeclCount(Integer.valueOf(((BigDecimal) s[5]).intValue()));
+						stat.setImpDeclCountLastMonth(Integer.valueOf(((BigDecimal) s[6]).intValue()));
+						stat.setImpDeclCountLastYearDecember(Integer.valueOf(((BigDecimal) s[7]).intValue()));
+						stat.setImpDeclCountCurentYear(Integer.valueOf(((BigDecimal) s[8]).intValue()));
+						stat.setImpDeclCountYearBeforeLast(Integer.valueOf(((BigDecimal) s[9]).intValue()));
+						stat.setImpTotalCost((BigDecimal) s[10]);
+						stat.setImpTotalCostLastMonth((BigDecimal) s[11]);
+						stat.setImpTotalCostLastYearDecember((BigDecimal) s[12]);
+						stat.setImpTotalCostCurentYear((BigDecimal) s[13]);
+						stat.setImpTotalCostYearBeforeLast((BigDecimal) s[14]);
+						stat.setImpCuCost((BigDecimal) s[15]);
+						stat.setImpCuCostLastMonth((BigDecimal) s[16]);
+						stat.setImpCuCostLastYearDecember((BigDecimal) s[17]);
+						stat.setImpCuCostCurentYear((BigDecimal) s[18]);
+						stat.setImpCuCostYearBeforeLast((BigDecimal) s[19]);
+						stat.setExpDeclCount(Integer.valueOf(((BigDecimal) s[20]).intValue()));
+						stat.setExpManDeclCount(Integer.valueOf(((BigDecimal) s[21]).intValue()));
+						stat.setExpManualAuditDeclCount(Integer.valueOf(((BigDecimal) s[22]).intValue()));
+						stat.setExpDeclCountLastMonth(Integer.valueOf(((BigDecimal) s[23]).intValue()));
+						stat.setExpDeclCountLastYearDecember(Integer.valueOf(((BigDecimal) s[24]).intValue()));
+						stat.setExpDeclCountCurentYear(Integer.valueOf(((BigDecimal) s[25]).intValue()));
+						stat.setExpDeclCountYearBeforeLast(Integer.valueOf(((BigDecimal) s[26]).intValue()));
+						stat.setExpTotalCost((BigDecimal) s[27]);
+						stat.setExpTotalCostLastMonth((BigDecimal) s[28]);
+						stat.setExpTotalCostLastYearDecember((BigDecimal) s[29]);
+						stat.setExpTotalCostCurentYear((BigDecimal) s[30]);
+						stat.setExpTotalCostYearBeforeLast((BigDecimal) s[31]);
+						stat.setExpCuCost((BigDecimal) s[32]);
+						stat.setExpCuCostLastMonth((BigDecimal) s[33]);
+						stat.setExpCuCostLastYearDecember((BigDecimal) s[34]);
+						stat.setExpCuCostCurentYear((BigDecimal) s[35]);
+						stat.setExpCuCostYearBeforeLast((BigDecimal) s[36]);
 						stat.setId(dao.getGuidStringBySql());
 						customMonthlyStatFinalRepository.save(stat);
 						existData = true;
@@ -2883,10 +2887,10 @@ public class H2018ZhOldDangerGoodsUtil {
 							monthSdf.format(lastMonthDate), customCode);
 					if (lastMonthData != null && lastMonthData.size() > 0) {
 						for (Object[] s : lastMonthData) {
-							stat.setImpDeclCountLastMonth(Integer.valueOf(((BigDecimal)  s[6]).toString()));
+							stat.setImpDeclCountLastMonth(Integer.valueOf(((BigDecimal)  s[6]).intValue()));
 							stat.setImpCuCostLastMonth((BigDecimal) s[15]);
 							stat.setImpTotalCostLastMonth((BigDecimal) s[10]);
-							stat.setExpDeclCountLastMonth(Integer.valueOf(((BigDecimal)  s[22]).toString()));
+							stat.setExpDeclCountLastMonth(Integer.valueOf(((BigDecimal)  s[22]).intValue()));
 							stat.setExpCuCostLastMonth((BigDecimal) s[31]);
 							stat.setExpTotalCostLastMonth((BigDecimal) s[26]);
 
@@ -2898,10 +2902,10 @@ public class H2018ZhOldDangerGoodsUtil {
 								stat.setExpCuCostCurentYear(zero);
 								stat.setExpTotalCostCurentYear(zero);
 								// 去年12月也就是上个月
-								stat.setImpDeclCountLastYearDecember(Integer.valueOf(((BigDecimal) s[3]).toString()));
+								stat.setImpDeclCountLastYearDecember(Integer.valueOf(((BigDecimal) s[3]).intValue()));
 								stat.setImpCuCostLastYearDecember((BigDecimal) s[14]);
 								stat.setImpTotalCostLastYearDecember((BigDecimal) s[9]);
-								stat.setExpDeclCountLastYearDecember(Integer.valueOf(((BigDecimal) s[21]).toString()));
+								stat.setExpDeclCountLastYearDecember(Integer.valueOf(((BigDecimal) s[21]).intValue()));
 								stat.setExpCuCostLastYearDecember((BigDecimal) s[30]);
 								stat.setExpTotalCostLastYearDecember((BigDecimal) s[25]);
 								// 前年平均值需要重新查询&计算
@@ -2928,7 +2932,7 @@ public class H2018ZhOldDangerGoodsUtil {
 										BigDecimal sumExpTotalCostYBL = new BigDecimal(0);
 
 										for (Object[] t : yearBeforeLastData) {
-											Integer impCount = Integer.valueOf(((BigDecimal) t[3]).toString());
+											Integer impCount = Integer.valueOf(((BigDecimal) t[3]).intValue());
 											if (impCount != null && impCount != 0) {
 												sumImpDeclCountYBL += impCount;
 												BigDecimal mul = new BigDecimal(impCount);
@@ -2943,7 +2947,7 @@ public class H2018ZhOldDangerGoodsUtil {
 												}
 											}
 
-											Integer expCount = Integer.valueOf(((BigDecimal) t[21]).toString());
+											Integer expCount = Integer.valueOf(((BigDecimal) t[21]).intValue());
 											if (expCount != null && expCount != 0) {
 												sumExpDeclCountYBL += expCount;
 												BigDecimal mul = new BigDecimal(expCount);
@@ -2999,24 +3003,24 @@ public class H2018ZhOldDangerGoodsUtil {
 									stat.setExpTotalCostYearBeforeLast(zero);
 								}
 							} else {
-								stat.setImpDeclCountCurentYear(Integer.valueOf(((BigDecimal) s[8]).toString()));
+								stat.setImpDeclCountCurentYear(Integer.valueOf(((BigDecimal) s[8]).intValue()));
 								stat.setImpCuCostCurentYear((BigDecimal) s[17]);
 								stat.setImpTotalCostCurentYear((BigDecimal) s[12]);
-								stat.setExpDeclCountCurentYear(Integer.valueOf(((BigDecimal) s[24]).toString()));
+								stat.setExpDeclCountCurentYear(Integer.valueOf(((BigDecimal) s[24]).intValue()));
 								stat.setExpCuCostCurentYear((BigDecimal) s[33]);
 								stat.setExpTotalCostCurentYear((BigDecimal) s[28]);
 								// 去年12月数据是上个月对应字段的值
-								stat.setImpDeclCountLastYearDecember(Integer.valueOf(((BigDecimal) s[7]).toString()));
+								stat.setImpDeclCountLastYearDecember(Integer.valueOf(((BigDecimal) s[7]).intValue()));
 								stat.setImpCuCostLastYearDecember((BigDecimal) s[16]);
 								stat.setImpTotalCostLastYearDecember((BigDecimal) s[11]);
-								stat.setExpDeclCountLastYearDecember(Integer.valueOf(((BigDecimal) s[23]).toString()));
+								stat.setExpDeclCountLastYearDecember(Integer.valueOf(((BigDecimal) s[23]).intValue()));
 								stat.setExpCuCostLastYearDecember((BigDecimal) s[32]);
 								stat.setExpTotalCostLastYearDecember((BigDecimal) s[27]);
 
-								stat.setImpDeclCountYearBeforeLast(Integer.valueOf(((BigDecimal) s[9]).toString()));
+								stat.setImpDeclCountYearBeforeLast(Integer.valueOf(((BigDecimal) s[9]).intValue()));
 								stat.setImpCuCostYearBeforeLast((BigDecimal) s[18]);
 								stat.setImpTotalCostYearBeforeLast((BigDecimal) s[13]);
-								stat.setExpDeclCountYearBeforeLast(Integer.valueOf(((BigDecimal) s[25]).toString()));
+								stat.setExpDeclCountYearBeforeLast(Integer.valueOf(((BigDecimal) s[25]).intValue()));
 								stat.setExpCuCostYearBeforeLast((BigDecimal) s[34]);
 								stat.setExpTotalCostYearBeforeLast((BigDecimal) s[29]);
 							}
@@ -3094,23 +3098,23 @@ public class H2018ZhOldDangerGoodsUtil {
 
 				for (Object[] s : copyList) {
 					if (customCode.equals((String) s[2])) {
-						sumImpDeclCount += Integer.valueOf(((BigDecimal) s[3]).toString());
-						sumImpManDeclCount += Integer.valueOf(((BigDecimal) s[4]).toString());
-						sumImpAuditDeclCount += Integer.valueOf(((BigDecimal) s[5]).toString());
-						sumImpDeclCountLastMonth += s[6] != null ? Integer.valueOf(((BigDecimal) s[6]).toString()) : 0;
-						sumImpDeclCountLastYearDecember += s[7] != null ? Integer.valueOf(((BigDecimal) s[7]).toString())
+						sumImpDeclCount += Integer.valueOf(((BigDecimal) s[3]).intValue());
+						sumImpManDeclCount += Integer.valueOf(((BigDecimal) s[4]).intValue());
+						sumImpAuditDeclCount += Integer.valueOf(((BigDecimal) s[5]).intValue());
+						sumImpDeclCountLastMonth += s[6] != null ? Integer.valueOf(((BigDecimal) s[6]).intValue()) : 0;
+						sumImpDeclCountLastYearDecember += s[7] != null ? Integer.valueOf(((BigDecimal) s[7]).intValue())
 								: 0;
-						sumImpDeclCountCurentYear += s[8] != null ? Integer.valueOf(((BigDecimal) s[8]).toString()) : 0;
-						sumImpDeclCountYearBeforeLast += s[9] != null ? Integer.valueOf(((BigDecimal) s[9]).toString()) : 0;
-
-						sumExpDeclCount += Integer.valueOf(((BigDecimal) s[20]).toString());
-						sumExpManDeclCount += Integer.valueOf(((BigDecimal) s[21]).toString());
-						sumExpAuditDeclCount += Integer.valueOf(((BigDecimal) s[22]).toString());
-						sumExpDeclCountLastMonth += s[23] != null ? Integer.valueOf(((BigDecimal) s[23]).toString()) : 0;
-						sumExpDeclCountLastYearDecember += s[24] != null ? Integer.valueOf(((BigDecimal) s[24]).toString())
+						sumImpDeclCountCurentYear += s[8] != null ? Integer.valueOf(((BigDecimal) s[8]).intValue()) : 0;
+						sumImpDeclCountYearBeforeLast += s[9] != null ? Integer.valueOf(((BigDecimal) s[9]).intValue()) : 0;
+
+						sumExpDeclCount += Integer.valueOf(((BigDecimal) s[20]).intValue());
+						sumExpManDeclCount += Integer.valueOf(((BigDecimal) s[21]).intValue());
+						sumExpAuditDeclCount += Integer.valueOf(((BigDecimal) s[22]).intValue());
+						sumExpDeclCountLastMonth += s[23] != null ? Integer.valueOf(((BigDecimal) s[23]).intValue()) : 0;
+						sumExpDeclCountLastYearDecember += s[24] != null ? Integer.valueOf(((BigDecimal) s[24]).intValue())
 								: 0;
-						sumExpDeclCountCurentYear += s[25] != null ? Integer.valueOf(((BigDecimal) s[25]).toString()) : 0;
-						sumExpDeclCountYearBeforeLast += s[26] != null ? Integer.valueOf(((BigDecimal) s[26]).toString()) : 0;
+						sumExpDeclCountCurentYear += s[25] != null ? Integer.valueOf(((BigDecimal) s[25]).intValue()) : 0;
+						sumExpDeclCountYearBeforeLast += s[26] != null ? Integer.valueOf(((BigDecimal) s[26]).intValue()) : 0;
 
 						BigDecimal impCurMonthMultiply = (BigDecimal) s[3];
 						BigDecimal impLastMonthMultiply = s[6] != null ? (BigDecimal) s[6] : new BigDecimal(0);

Some files were not shown because too many files changed in this diff