Showing
1 changed file
with
65 additions
and
26 deletions
| ... | @@ -66,27 +66,39 @@ public class ChmConsignmentService { | ... | @@ -66,27 +66,39 @@ public class ChmConsignmentService { |
| 66 | result.setCustomsNo(mawb.getCustomMaster()); | 66 | result.setCustomsNo(mawb.getCustomMaster()); |
| 67 | //征免性质 | 67 | //征免性质 |
| 68 | DictionaryEntries levyTypeDictionaryEntries = Constant.dictionaryEntriesCache.get(Constant.NATURE_EXEMPTION+mawb.getCutMode()); | 68 | DictionaryEntries levyTypeDictionaryEntries = Constant.dictionaryEntriesCache.get(Constant.NATURE_EXEMPTION+mawb.getCutMode()); |
| 69 | - result.setTaxNatureDic(levyTypeDictionaryEntries); | 69 | + if(!Objects.equals(levyTypeDictionaryEntries,null)){ |
| 70 | - result.setTaxNature(levyTypeDictionaryEntries.getChineseName()); | 70 | + result.setTaxNatureDic(levyTypeDictionaryEntries); |
| 71 | + result.setTaxNature(levyTypeDictionaryEntries.getChineseName()); | ||
| 72 | + } | ||
| 73 | + | ||
| 71 | //报关/转关关系标志:固定值0 ,但数据字典里没有0 | 74 | //报关/转关关系标志:固定值0 ,但数据字典里没有0 |
| 72 | 75 | ||
| 73 | 76 | ||
| 74 | //经停港/指运港 | 77 | //经停港/指运港 |
| 75 | ChmCarryPort chmCarryPort =Constant.chmCarryPortCache.get(mawb.getDistinatePort()); | 78 | ChmCarryPort chmCarryPort =Constant.chmCarryPortCache.get(mawb.getDistinatePort()); |
| 76 | - result.setThroughStopPortDic(chmCarryPort); | 79 | + if(!Objects.equals(chmCarryPort,null)){ |
| 77 | - result.setThroughStopPort(chmCarryPort.getPortNo()); | 80 | + result.setThroughStopPortDic(chmCarryPort); |
| 81 | + result.setThroughStopPort(chmCarryPort.getPortNo()); | ||
| 82 | + } | ||
| 83 | + | ||
| 78 | 84 | ||
| 79 | //TODO 报关标志【待确认】 | 85 | //TODO 报关标志【待确认】 |
| 80 | DictionaryEntries declaredDocTypeDictionaryEntries = Constant.dictionaryEntriesCache.get(Constant.DECLARED_DOC_TYPE + mawb.getEdiId()); | 86 | DictionaryEntries declaredDocTypeDictionaryEntries = Constant.dictionaryEntriesCache.get(Constant.DECLARED_DOC_TYPE + mawb.getEdiId()); |
| 81 | - result.setDeclaredDocTypeDic(declaredDocTypeDictionaryEntries); | 87 | + if(!Objects.equals(declaredDocTypeDictionaryEntries,null)){ |
| 82 | - result.setDeclaredDocType(declaredDocTypeDictionaryEntries.getChineseName()); | 88 | + result.setDeclaredDocTypeDic(declaredDocTypeDictionaryEntries); |
| 89 | + result.setDeclaredDocType(declaredDocTypeDictionaryEntries.getChineseName()); | ||
| 90 | + } | ||
| 91 | + | ||
| 83 | 92 | ||
| 84 | //海关编号 | 93 | //海关编号 |
| 85 | result.setCustomsNo(mawb.getEntryId()); | 94 | result.setCustomsNo(mawb.getEntryId()); |
| 86 | //运费币制 | 95 | //运费币制 |
| 87 | DictionaryEntries currencyDictionaryEntries = Constant.dictionaryEntriesCache.get(Constant.CURRENCY_SYSTEM+mawb.getFeeCurr()); | 96 | DictionaryEntries currencyDictionaryEntries = Constant.dictionaryEntriesCache.get(Constant.CURRENCY_SYSTEM+mawb.getFeeCurr()); |
| 88 | - result.setTransCurrencyDic(currencyDictionaryEntries); | 97 | + if(!Objects.equals(currencyDictionaryEntries,null)){ |
| 89 | - result.setTransCurrency(currencyDictionaryEntries.getChineseName()); | 98 | + result.setTransCurrencyDic(currencyDictionaryEntries); |
| 99 | + result.setTransCurrency(currencyDictionaryEntries.getChineseName()); | ||
| 100 | + } | ||
| 101 | + | ||
| 90 | 102 | ||
| 91 | //TODO 运费标记:固定值 3 【iclear中, 和成交方式相关,只有成交方式 1、2 时,才能传 3 】 | 103 | //TODO 运费标记:固定值 3 【iclear中, 和成交方式相关,只有成交方式 1、2 时,才能传 3 】 |
| 92 | 104 | ||
| ... | @@ -100,8 +112,11 @@ public class ChmConsignmentService { | ... | @@ -100,8 +112,11 @@ public class ChmConsignmentService { |
| 100 | 112 | ||
| 101 | //保险费币制 | 113 | //保险费币制 |
| 102 | DictionaryEntries insuranceDictionaryEntries = Constant.dictionaryEntriesCache.get(Constant.CURRENCY_SYSTEM+mawb.getInsurCurr()); | 114 | DictionaryEntries insuranceDictionaryEntries = Constant.dictionaryEntriesCache.get(Constant.CURRENCY_SYSTEM+mawb.getInsurCurr()); |
| 103 | - result.setInsuranceCostCurrencyDic(insuranceDictionaryEntries); | 115 | + if(!Objects.equals(insuranceDictionaryEntries,null)){ |
| 104 | - result.setInsuranceCostCurrency(insuranceDictionaryEntries.getChineseName()); | 116 | + result.setInsuranceCostCurrencyDic(insuranceDictionaryEntries); |
| 117 | + result.setInsuranceCostCurrency(insuranceDictionaryEntries.getChineseName()); | ||
| 118 | + } | ||
| 119 | + | ||
| 105 | 120 | ||
| 106 | //保险费标记 ,根据transMode决定 | 121 | //保险费标记 ,根据transMode决定 |
| 107 | 122 | ||
| ... | @@ -113,8 +128,11 @@ public class ChmConsignmentService { | ... | @@ -113,8 +128,11 @@ public class ChmConsignmentService { |
| 113 | result.setNetWeight(mawb.getNetWt()); | 128 | result.setNetWeight(mawb.getNetWt()); |
| 114 | //杂费币制 | 129 | //杂费币制 |
| 115 | DictionaryEntries otherDictionaryEntries = Constant.dictionaryEntriesCache.get(Constant.CURRENCY_SYSTEM+mawb.getOtherCurr()); | 130 | DictionaryEntries otherDictionaryEntries = Constant.dictionaryEntriesCache.get(Constant.CURRENCY_SYSTEM+mawb.getOtherCurr()); |
| 116 | - result.setOtherCurrencyDic(otherDictionaryEntries); | 131 | + if(!Objects.equals(otherDictionaryEntries,null)){ |
| 117 | - result.setOtherCurrency(otherDictionaryEntries.getChineseName()); | 132 | + result.setOtherCurrencyDic(otherDictionaryEntries); |
| 133 | + result.setOtherCurrency(otherDictionaryEntries.getChineseName()); | ||
| 134 | + } | ||
| 135 | + | ||
| 118 | //杂费/率 | 136 | //杂费/率 |
| 119 | result.setOtherCost(mawb.getOtherRate()); | 137 | result.setOtherCost(mawb.getOtherRate()); |
| 120 | //杂费标志 | 138 | //杂费标志 |
| ... | @@ -130,34 +148,49 @@ public class ChmConsignmentService { | ... | @@ -130,34 +148,49 @@ public class ChmConsignmentService { |
| 130 | result.setEnteringNo(mawb.getPreEntryId()); | 148 | result.setEnteringNo(mawb.getPreEntryId()); |
| 131 | //启运国/运抵国 | 149 | //启运国/运抵国 |
| 132 | DictionaryEntries fromCountryDictionaryEntries = Constant.dictionaryEntriesCache.get(Constant.COUNTRY+mawb.getTradeCountry()); | 150 | DictionaryEntries fromCountryDictionaryEntries = Constant.dictionaryEntriesCache.get(Constant.COUNTRY+mawb.getTradeCountry()); |
| 133 | - result.setFromCountryDic(fromCountryDictionaryEntries); | 151 | + if(!Objects.equals(fromCountryDictionaryEntries,null)){ |
| 134 | - result.setFromCountry(fromCountryDictionaryEntries.getChineseName()); | 152 | + result.setFromCountryDic(fromCountryDictionaryEntries); |
| 153 | + result.setFromCountry(fromCountryDictionaryEntries.getChineseName()); | ||
| 154 | + } | ||
| 155 | + | ||
| 135 | 156 | ||
| 136 | 157 | ||
| 137 | //监管方式 | 158 | //监管方式 |
| 138 | DictionaryEntries tradeModeDictionaryEntries = Constant.dictionaryEntriesCache.get(Constant.SUPERVISION_MODE+mawb.getTradeMode()); | 159 | DictionaryEntries tradeModeDictionaryEntries = Constant.dictionaryEntriesCache.get(Constant.SUPERVISION_MODE+mawb.getTradeMode()); |
| 139 | - result.setTradeModeDic(tradeModeDictionaryEntries); | 160 | + if(!Objects.equals(tradeModeDictionaryEntries,null)){ |
| 140 | - result.setTradeMode(tradeModeDictionaryEntries.getChineseName()); | 161 | + result.setTradeModeDic(tradeModeDictionaryEntries); |
| 162 | + result.setTradeMode(tradeModeDictionaryEntries.getChineseName()); | ||
| 163 | + } | ||
| 164 | + | ||
| 141 | 165 | ||
| 142 | 166 | ||
| 143 | //境内收发货人编号 | 167 | //境内收发货人编号 |
| 144 | result.setTradeCoSCC(mawb.getTradeCode()); | 168 | result.setTradeCoSCC(mawb.getTradeCode()); |
| 145 | //运输方式代码 | 169 | //运输方式代码 |
| 146 | DictionaryEntries vehicleWayDictionaryEntries = Constant.dictionaryEntriesCache.get(Constant.VEHICLE_WAY_CODE+mawb.getTrafMode()); | 170 | DictionaryEntries vehicleWayDictionaryEntries = Constant.dictionaryEntriesCache.get(Constant.VEHICLE_WAY_CODE+mawb.getTrafMode()); |
| 147 | - result.setVehicleWay(vehicleWayDictionaryEntries); | 171 | + if(!Objects.equals(vehicleWayDictionaryEntries,null)){ |
| 148 | - result.setVehicleWayCode(vehicleWayDictionaryEntries.getCode()); | 172 | + result.setVehicleWay(vehicleWayDictionaryEntries); |
| 173 | + result.setVehicleWayCode(vehicleWayDictionaryEntries.getCode()); | ||
| 174 | + } | ||
| 175 | + | ||
| 149 | 176 | ||
| 150 | //境内收发货人名称 | 177 | //境内收发货人名称 |
| 151 | result.setOperateUnitName(mawb.getTradeName()); | 178 | result.setOperateUnitName(mawb.getTradeName()); |
| 152 | //成交方式 | 179 | //成交方式 |
| 153 | DictionaryEntries dealModeDictionaryEntries = Constant.dictionaryEntriesCache.get(Constant.CLINCH_TYPE+mawb.getTransMode()); | 180 | DictionaryEntries dealModeDictionaryEntries = Constant.dictionaryEntriesCache.get(Constant.CLINCH_TYPE+mawb.getTransMode()); |
| 154 | - result.setDealModeDic(dealModeDictionaryEntries); | 181 | + if(!Objects.equals(dealModeDictionaryEntries,null)){ |
| 155 | - result.setDealMode(dealModeDictionaryEntries.getChineseName()); | 182 | + result.setDealModeDic(dealModeDictionaryEntries); |
| 183 | + result.setDealMode(dealModeDictionaryEntries.getChineseName()); | ||
| 184 | + } | ||
| 185 | + | ||
| 156 | 186 | ||
| 157 | //包装种类 | 187 | //包装种类 |
| 158 | DictionaryEntries packageTypeDictionaryEntries = Constant.dictionaryEntriesCache.get(Constant.NEW_PACKAGE_TYPE+mawb.getWrapType()); | 188 | DictionaryEntries packageTypeDictionaryEntries = Constant.dictionaryEntriesCache.get(Constant.NEW_PACKAGE_TYPE+mawb.getWrapType()); |
| 159 | - result.setPackageTypeDic(packageTypeDictionaryEntries); | 189 | + if(!Objects.equals(packageTypeDictionaryEntries,null)){ |
| 160 | - result.setPackageType(packageTypeDictionaryEntries.getChineseName()); | 190 | + result.setPackageTypeDic(packageTypeDictionaryEntries); |
| 191 | + result.setPackageType(packageTypeDictionaryEntries.getChineseName()); | ||
| 192 | + } | ||
| 193 | + | ||
| 161 | 194 | ||
| 162 | 195 | ||
| 163 | //TODO 生产核销单位统一信用代码---报关形式类型 | 196 | //TODO 生产核销单位统一信用代码---报关形式类型 |
| ... | @@ -170,8 +203,11 @@ public class ChmConsignmentService { | ... | @@ -170,8 +203,11 @@ public class ChmConsignmentService { |
| 170 | 203 | ||
| 171 | //贸易国别 | 204 | //贸易国别 |
| 172 | DictionaryEntries tradeAreaCodeDictionaryEntries=Constant.dictionaryEntriesCache.get(Constant.COUNTRY+mawb.getTradeAreaCode()); | 205 | DictionaryEntries tradeAreaCodeDictionaryEntries=Constant.dictionaryEntriesCache.get(Constant.COUNTRY+mawb.getTradeAreaCode()); |
| 173 | - result.setTradeAreaCodeDic(tradeAreaCodeDictionaryEntries); | 206 | + if(!Objects.equals(tradeAreaCodeDictionaryEntries,null)){ |
| 174 | - result.setTradeAreaCode(tradeAreaCodeDictionaryEntries.getChineseName()); | 207 | + result.setTradeAreaCodeDic(tradeAreaCodeDictionaryEntries); |
| 208 | + result.setTradeAreaCode(tradeAreaCodeDictionaryEntries.getChineseName()); | ||
| 209 | + } | ||
| 210 | + | ||
| 175 | 211 | ||
| 176 | //标记及号码 | 212 | //标记及号码 |
| 177 | result.setDeclaredRemark(mawb.getMarkNo()); | 213 | result.setDeclaredRemark(mawb.getMarkNo()); |
| ... | @@ -192,8 +228,11 @@ public class ChmConsignmentService { | ... | @@ -192,8 +228,11 @@ public class ChmConsignmentService { |
| 192 | 228 | ||
| 193 | //运单状态: 待申报海关 | 229 | //运单状态: 待申报海关 |
| 194 | DictionaryEntries transferWaybillStatusDictionaryEntries=Constant.dictionaryEntriesCache.get(Constant.TRANSFER_WAY_BILL_STATUS+"5"); | 230 | DictionaryEntries transferWaybillStatusDictionaryEntries=Constant.dictionaryEntriesCache.get(Constant.TRANSFER_WAY_BILL_STATUS+"5"); |
| 195 | - result.setConsStatusDic(transferWaybillStatusDictionaryEntries); | 231 | + if(!Objects.equals(transferWaybillStatusDictionaryEntries,null)){ |
| 196 | - result.setConsStatus(transferWaybillStatusDictionaryEntries.getChineseName()); | 232 | + result.setConsStatusDic(transferWaybillStatusDictionaryEntries); |
| 233 | + result.setConsStatus(transferWaybillStatusDictionaryEntries.getChineseName()); | ||
| 234 | + } | ||
| 235 | + | ||
| 197 | //推送时间作为创建时间,可以用来校验数据的有序性,如果新的推送时间小于已有的创建时间,就不更新数据 | 236 | //推送时间作为创建时间,可以用来校验数据的有序性,如果新的推送时间小于已有的创建时间,就不更新数据 |
| 198 | result.setCreateTime(new Date()); | 237 | result.setCreateTime(new Date()); |
| 199 | result.setUpdateTime(pushTime); | 238 | result.setUpdateTime(pushTime); | ... | ... |
-
Please register or login to post a comment