tao.mo

381 IDE推送至IClear-api修改

mt
2021年8月13日13:59:47
......@@ -88,13 +88,13 @@ public class CustomsDataInterface {
sw.stop();
// //2、TODO 校验主单
// sw.start("checkMawb");
// result=mawbService.checkMawb(mawb);
// if(!result.getSuccess()){
// return result;
// }
// sw.stop();
//2、TODO 校验主单
sw.start("checkMawb");
result=mawbService.checkMawb(mawb);
if(!result.getSuccess()){
return result;
}
sw.stop();
// //3、TODO 校验子单
// sw.start("checkMawbDetail");
......
......@@ -221,6 +221,11 @@ public class ChmConsignment implements Serializable {
@Column(name = "TRADE_CO_SCC")
private String tradeCoSCC;
/**
* 境内发货人(经营单位编码)
*/
@Column(name = "OPERATE_UNIT_CODE")
private String operateUnitCode;
/**
* 境内发货人(经营单位名称)
......
......@@ -151,7 +151,9 @@ public class ChmConsignmentService {
result.setTradeMode(tradeModeDictionaryEntries.getChineseName());
}
//境内收发货人编号
result.setTradeCoSCC(mawb.getTradeCode());
//result.setTradeCoSCC(mawb.getTradeCode());
//境内发货人(经营单位编码)
result.setOperateUnitCode(mawb.getTradeCode());
//运输方式代码
DictionaryEntries vehicleWayDictionaryEntries = Constant.dictionaryEntriesCache.get(Constant.VEHICLE_WAY_CODE+mawb.getTrafMode());
if(!Objects.equals(vehicleWayDictionaryEntries,null)){
......@@ -454,7 +456,6 @@ public class ChmConsignmentService {
//更新数据
log.info("更新主单"+ mawb.getBillNo());
//由于订单明细中,无法确定唯一一条数据,所以无法做到update,只能先删除在插入
for(ChmConsignmentDetail newDetail:chmConsignment.getChmConsignmentDetailList()){
for(ChmConsignmentDetail oldDetail: chmConsignmentDB.getChmConsignmentDetailList()){
if(Objects.equals(newDetail.getDetailId(),oldDetail.getDetailId())){
......
......@@ -89,6 +89,7 @@ public class MawbService {
Header[] headers = HttpHeader.custom()
.other("Content-Type", "application/json")
.build();
log.info("******************* : " + this.iclearCheckUrl);
//推送海关回执数据
HttpConfig config = HttpConfig.custom()
.headers(headers)
......@@ -99,7 +100,7 @@ public class MawbService {
IClearCheckResponseResult iclearCheckResponseResult = JsonToJava.parseJson(json, IClearCheckResponseResult.class);
result.setSuccess(iclearCheckResponseResult.getSuccess());
result.setMsg(iclearCheckResponseResult.getMessage());
log.info("checkMawb start>>>>>>>>>> mawb:"+gson.toJson(mawb) +" result :" +result.getSuccess() +" iclear check response : " + json + " status : " + result.getSuccess());
log.info("<<<<<<<< checkMawb start >>>>>>>>>> mawb:"+gson.toJson(mawb) +" result :" +result.getSuccess() +" iclear check response : " + json + " status : " + result.getSuccess());
}catch (Exception e){
log.error("checkMawb() error:" + e.getMessage());
}
......
......@@ -25,7 +25,7 @@ public class HttpClientTest {
String masbJson ="{\"ieFlag\":\"E\",\"type\":\"EX\",\"agentCode\":\"1111980005\",\"agentName\":\"联邦快递(中国)有限公司\",\"billNo\":\"07127275242_00062210\",\"contrNo\":\"FY2016\",\"customMaster\":\"2233\",\"cutMode\":\"101\",\"declTrnRel\":\"0\",\"distinatePort\":\"ASM000\",\"ediId\":\"001\",\"entryId\":\"25512456\",\"feeCurr\":\"EUR\",\"feeMark\":\"3\",\"feeRate\":3.65,\"grossWet\":4,\"iePort\":\"0101\",\"insurCurr\":\"MOP\",\"insurMark\":\"3\",\"insurRate\":0.02457,\"netWt\":3.857,\"ownerCode\":\"1234567890\",\"ownerName\":\"琥博信息科技有限公司\",\"packNo\":1,\"tradeCountry\":\"US\",\"tradeMode\":\"0110\",\"tradeCode\":\"1234567890\",\"trafMode\":\"5\",\"tradeName\":\"琥博信息科技有限公司\",\"transMode\":\"3\",\"wrapType\":\"22\",\"tradeCodeScc\":\"123456789012345678\",\"ownerCodeScc\":\"123456789012345678\",\"tradeAreaCode\":\"US\",\"entyPortCode\":\"310302\",\"goodsPlace\":\"\",\"declareName\":\"申报人员姓名_50\",\"overseasConsignorCode\":\"AEO Code 50位\",\"overseasConsigneeCode\":\"境外收货人编码_50位\",\"overseasConsigneeEname\":\"境外收货人名称(外文)_400\",\"mawbDetailList\":[{\"detailId\":\"12251\",\"classMark\":\"\",\"codeTS\":\"8538900000\",\"declPrice\":128,\"declTotal\":128,\"dutyMode\":\"1\",\"exgNo\":\"\",\"exgVersion\":\"\",\"firstUnit\":\"035\",\"firstQty\":0,\"gunit\":\"007\",\"gmodel\":\"用于PLC可编程控制器|琥博|6ES7153|无其他1\",\"gname\":\"PLC可编程控制器零件/接口模块\",\"gno\":\"1\",\"gqty\":1,\"originCountry\":\"US\",\"secondQty\":222,\"tradeCurr\":\"USD\",\"useTo\":\"03\",\"ciqCode\":\"001\",\"destinationCountry\":\"CNY\",\"destCode\":\"110102\",\"districtCode\":\"4408W\"},{\"detailId\":\"12252\",\"classMark\":\"\",\"codeTS\":\"8538900000\",\"declPrice\":94.47,\"declTotal\":188.94,\"dutyMode\":\"1\",\"exgNo\":\"\",\"exgVersion\":\"\",\"firstUnit\":\"035\",\"firstQty\":0,\"gunit\":\"007\",\"gmodel\":\"用于PLC可编程控制器|琥博|6ES7331|无其他2\",\"gname\":\"PLC可编程控制器零件/输入模块\",\"gno\":\"2\",\"gqty\":2,\"originCountry\":\"US\",\"secondQty\":222,\"tradeCurr\":\"USD\",\"useTo\":\"03\",\"ciqCode\":\"\",\"destinationCountry\":\"CHN\",\"destCode\":\"\",\"districtCode\":\"4408W\"},{\"detailId\":\"12601\",\"classMark\":\"\",\"codeTS\":\"8538900001\",\"declPrice\":94.47,\"declTotal\":188.94,\"dutyMode\":\"1\",\"exgNo\":\"\",\"exgVersion\":\"\",\"firstUnit\":\"035\",\"firstQty\":0,\"gunit\":\"007\",\"gmodel\":\"用于PLC可编程控制器|琥博|6ES7331|无其他3\",\"gname\":\"PLC可编程控制器零件/输入模块\",\"gno\":\"2\",\"gqty\":2,\"originCountry\":\"US\",\"secondQty\":222,\"tradeCurr\":\"USD\",\"useTo\":\"03\",\"ciqCode\":\"\",\"destinationCountry\":\"CHN\",\"destCode\":\"\",\"districtCode\":\"4408W\"}]}";
String masbJson ="{\"ieFlag\":\"I\",\"type\":\" 0\",\"agentCode\":\"1111980005\",\"agentName\":\"联邦快递\",\"billNo\":\"282327119067\",\"contrNo\":\"3006635555/3006636664\",\"customMaster\":\"0207\",\"cutMode\":\"299\",\"declTrnRel\":\"0\",\"distinatePort\":\"DEU000\",\"ediId\":\"1\",\"feeCurr\":\"EUR\",\"feeMark\":\"3\",\"feeRate\":110.9,\"grossWet\":4.6,\"iePort\":\"0207\",\"insurCurr\":\"EUR\",\"insurMark\":\"\",\"insurRate\":0.74,\"netWt\":32,\"ownerCode\":\"9112011660\",\"ownerName\":\"西门子电气传动有限公司\",\"packNo\":1,\"tradeCountry\":\"USA\",\"tradeMode\":\"0110\",\"tradeCode\":\"9112011660\",\"trafMode\":\"5\",\"tradeName\":\"西门子电气传动有限公司\",\"transMode\":\"1\",\"wrapType\":\"23\",\"tradeCodeScc\":\"91120116600587482L\",\"ownerCodeScc\":\"91120116600587482L\",\"tradeAreaCode\":\"DEU\",\"entyPortCode\":\"110101\",\"goodsPlace\":\"\",\"declareName\":\"Jimmy shen\",\"overseasConsigneeEname\":\"PRYSMIAN KABEL UND SYSTEME GMBH\",\"mawbDetailList\":[{\"detailId\":\"488\",\"classMark\":\"\",\"codeTS\":\"63041121\",\"declPrice\":3365,\"declTotal\":3365,\"dutyMode\":\"1\",\"exgNo\":\"\",\"exgVersion\":\"\",\"firstUnit\":\"011\",\"firstQty\":1,\"originCountry\":\"CHN\",\"secondUnit\":\"035\",\"secondQty\":1,\"tradeCurr\":\"EUR\",\"useTo\":\"03\",\"destinationCountry\":\"DEU\",\"ciqCode\":\"\",\"destCode\":\"110102\",\"districtCode\":\"44079\",\"gno\":1,\"gname\":\"手工针织床罩\",\"gmodel\":\"品名:针织罩|品牌类型:2|出口享惠情况:1|织造方法[针织、钩编、机织、手工、刺绣等]:手工|成分含量:布料|GTIN:|CAS:|其他[非必报要素,请根据实际情况填报]:|\",\"gqty\":1,\"gunit\":\"007\"},{\"detailId\":\"489\",\"classMark\":\"\",\"codeTS\":\"6203391090\",\"declPrice\":9369,\"declTotal\":9369,\"dutyMode\":\"1\",\"exgNo\":\"\",\"exgVersion\":\"\",\"firstUnit\":\"011\",\"firstQty\":3,\"originCountry\":\"CHN\",\"secondUnit\":\"035\",\"secondQty\":1,\"tradeCurr\":\"EUR\",\"useTo\":\"03\",\"destinationCountry\":\"DEU\",\"ciqCode\":\"\",\"destCode\":\"110102\",\"districtCode\":\"44079\",\"gno\":2,\"gname\":\"丝制男式上衣\",\"gmodel\":\"品名:丝质上衣|品牌类型:1|出口享惠情况:0|织造方法[机织等]:手工|种类[西服、便服套装、上衣、长裤、马裤、工装裤等]:上衣|类别[男式]:大码|成分含量:蚕丝|是否开襟:是|是否有扣:有|是否有拉链:无|品牌[中文及外文名称]:无|货号:001|GTIN:|CAS:|其他[非必报要素,请根据实际情况填报]:|\",\"gqty\":3,\"gunit\":\"007\"}]}";
......@@ -46,14 +46,14 @@ public class HttpClientTest {
.build();
HCB hcb = HCB.custom()
.timeout(3000)
.timeout(20000)
.pool(100, 10)
.sslpv(SSLs.SSLProtocolVersion.TLSv1_2)
.ssl()
.retry(3);
// String url = "https://40.73.78.157:8780/customs/sendMawb";
String url = "https://192.168.1.75:8780/customs/sendMawb";
String url = "https://127.0.0.1:8780/customs/sendMawb";
HttpConfig config = HttpConfig.custom()
.headers(headers)
.url(url)
......
......@@ -11,7 +11,7 @@ public class IClearCheckTest {
//调用IClear接口进行运单数据校验
String objJson = "{\"chmConsignmentDetailList\":[{\"amount\":3365,\"chmConsignment\":{\"$ref\":\"$\"},\"contentDescription\":null,\"currency\":\"欧元\",\"currencyDic\":{\"chineseName\":\"欧元\",\"code\":\"currencySystem_EUR\",\"dictCode\":\"currencySystem\",\"ext2\":\"EUR\",\"ext3\":\"GBR\",\"ext6\":\"300\",\"id\":84605},\"destinationCountry\":\"德意志联邦共和国\",\"destinationCountryDic\":{\"chineseName\":\"德意志联邦共和国\",\"code\":\"Country_DE\",\"dictCode\":\"Country\",\"ext2\":\"DE\",\"ext3\":\"DEU\",\"ext6\":\"304\",\"id\":84415},\"detailId\":\"204\",\"domesticDestination\":null,\"domesticDestinationMapping\":null,\"habitat\":\"中华人民共和国\",\"habitatDic\":{\"chineseName\":\"中华人民共和国\",\"code\":\"Country_CN\",\"dictCode\":\"Country\",\"ext2\":\"CN\",\"ext3\":\"CHN\",\"ext6\":\"142\",\"id\":84355},\"id\":null,\"knockdownNumber\":1.0,\"knockdownUnit\":\"个\",\"knockdownUnitDic\":{\"chineseName\":\"个\",\"code\":\"transactionUnit_007\",\"dictCode\":\"transactionUnit\",\"ext2\":\"007\",\"ext3\":\"GBR\",\"ext6\":\"EA\",\"id\":84139},\"levyType\":\"照章征税\",\"levyTypeDic\":{\"chineseName\":\"照章征税\",\"code\":\"levyType_1\",\"dictCode\":\"levyType\",\"ext2\":\"1\",\"ext3\":\"GBR\",\"ext6\":null,\"id\":84515},\"model\":\"4|0|控制电机用|240KW|西门子/SIEMENS|6RA8081-6GV62-0AA0|||\",\"oriRegion\":3365,\"origplacecode\":\"\",\"origplacecodeMapping\":null,\"qtyLegalFirst\":1.0,\"qtyLegalSecond\":1.0,\"skuCode\":\"8504409999\",\"skuName\":\"变频调速装置\",\"unitLegalFirst\":\"千克\",\"unitLegalFirstId\":{\"chineseName\":\"千克\",\"code\":\"transactionUnit_035\",\"dictCode\":\"transactionUnit\",\"ext2\":\"035\",\"ext3\":\"GBR\",\"ext6\":\"KGS\",\"id\":84148},\"unitLegalSecond\":\"千克\",\"unitLegalSecondId\":{\"$ref\":\"$.chmConsignmentDetailList[0].unitLegalFirstId\"}}],\"consStatus\":\"待申报海关\",\"consStatusDic\":{\"chineseName\":\"待申报海关\",\"code\":\"transferWaybillStatus_5\",\"dictCode\":\"transferWaybillStatus\",\"ext2\":\"5\",\"ext3\":\"GBR\",\"ext6\":null,\"id\":84492},\"consType\":\"D\",\"consTypeId\":{\"chineseName\":\"D\",\"code\":\"consType_D\",\"dictCode\":\"consType\",\"ext2\":\"D\",\"ext3\":\"GBR\",\"ext6\":null,\"id\":84512},\"consignmentCode\":\"774426960555\",\"consignmentHeadCode\":null,\"contractCode\":\"3006622200\",\"counts\":1,\"createTime\":1628681350830,\"creator\":\"IDE-ICLEAR-API\",\"customsNo\":null,\"dealMode\":\"CIF、CIP、DDP、DDU、DAP\",\"dealModeDic\":{\"chineseName\":\"CIF、CIP、DDP、DDU、DAP\",\"code\":\"ClinchType_CIF\",\"dictCode\":\"ClinchType\",\"ext2\":\"CIF\",\"ext3\":\"GBR\",\"ext6\":\"1\",\"id\":83977},\"declaredDocType\":null,\"declaredDocTypeDic\":null,\"declaredPort\":null,\"declaredRemark\":null,\"declaredUnitName\":\"Jimmy shen\",\"enteringNo\":null,\"fromCountry\":\"美国\",\"fromCountryDic\":{\"chineseName\":\"美国\",\"code\":\"Country_US\",\"dictCode\":\"Country\",\"ext2\":\"US\",\"ext3\":\"USA\",\"ext6\":\"502\",\"id\":84653},\"grossWeight\":4.6,\"id\":null,\"insuranceCost\":0.74,\"insuranceCostCurrency\":\"欧元\",\"insuranceCostCurrencyDic\":{\"$ref\":\"$.chmConsignmentDetailList[0].currencyDic\"},\"netWeight\":32,\"operateUnitName\":\"西门子电气传动有限公司\",\"otherCost\":null,\"otherCurrency\":null,\"otherCurrencyDic\":null,\"overseasConsignorCode\":null,\"overseasConsignorFnCname\":\"PRYSMIAN KABEL UND SYSTEME GMBH\",\"ownerCode\":\"91120116600587482L\",\"ownerCodeScc\":\"91120116600587482L\",\"ownerName\":\"西门子电气传动有限公司\",\"packageType\":\"木制或竹藤等植物性材料制盒/箱\",\"packageTypeDic\":{\"chineseName\":\"木制或竹藤等植物性材料制盒/箱\",\"code\":\"NewPackageType_23\",\"dictCode\":\"NewPackageType\",\"ext2\":\"23\",\"ext3\":\"GBR\",\"ext6\":null,\"id\":83934},\"portId\":{\"chineseName\":\"TSN\",\"code\":\"port_tsn\",\"dictCode\":\"port\",\"ext2\":null,\"ext3\":null,\"ext6\":null,\"id\":125028},\"portName\":\"TSN\",\"recordCode\":null,\"taxNature\":\"中外合资\",\"taxNatureDic\":{\"chineseName\":\"中外合资\",\"code\":\"natureExemption_601\",\"dictCode\":\"natureExemption\",\"ext2\":\"601\",\"ext3\":\"GBR\",\"ext6\":null,\"id\":84122},\"throughStopPort\":\"304\",\"throughStopPortDic\":{\"createName\":\"ADMIN\",\"createTime\":\"\",\"id\":5457,\"pcCode\":\"DEU000\",\"portEngName\":\"Germany\",\"portName\":\"德国\",\"portNo\":\"304\"},\"tradeAreaCode\":\"德意志联邦共和国\",\"tradeAreaCodeDic\":{\"$ref\":\"$.chmConsignmentDetailList[0].destinationCountryDic\"},\"tradeCoSCC\":\"91120116600587482L\",\"tradeMode\":\"一般贸易\",\"tradeModeDic\":{\"chineseName\":\"一般贸易\",\"code\":\"supervisionMode_110\",\"dictCode\":\"supervisionMode\",\"ext2\":\"0110\",\"ext3\":\"GBR\",\"ext6\":null,\"id\":84000},\"transCost\":110.9,\"transCurrency\":\"欧元\",\"transCurrencyDic\":{\"$ref\":\"$.chmConsignmentDetailList[0].currencyDic\"},\"updateTime\":null,\"vehicleWay\":{\"chineseName\":\"航空运输\",\"code\":\"VehicleWayCode_5\",\"dictCode\":\"VehicleWayCode\",\"ext2\":\"5\",\"ext3\":\"GBR\",\"ext6\":null,\"id\":83986},\"vehicleWayCode\":\"VehicleWayCode_5\"}";
String url = "http://127.0.0.1:8080/chmConsignmentController/checkChmAndDetaliD";
String url = "http://40.73.78.157:8081/chmConsignmentController/checkChmAndDetaliD";
Header[] headers = HttpHeader.custom()
.other("Content-Type", "application/json")
......