wei.zhou

提交代码

......@@ -110,8 +110,9 @@ public class CustomsDataInterface {
//4、保存运单到iclear中
sw.start("processChmConsignment");
//if(result.getSuccess()){
//TODO 等待校验逻辑完善后,由result.getSuccess() 判断
if(true){
chmConsignmentService.processChmConsignment(mawb, timeStamp);
chmConsignmentService.processChmConsignment(mawb, timeStamp,appId);
}
sw.stop();
......
......@@ -39,7 +39,7 @@ public class ChmConsignmentService {
* 转换主单
* @return
*/
public ChmConsignment convertToChmConsignment(Mawb mawb,Date pushTime){
public ChmConsignment convertToChmConsignment(Mawb mawb,Date pushTime,String creator){
ChmConsignment result = new ChmConsignment();
try{
//进出口标志:固定值 E
......@@ -103,8 +103,8 @@ public class ChmConsignmentService {
result.setNetWeight(mawb.getNetWt());
//杂费币制
DictionaryEntries otherDictionaryEntries = Constant.dictionaryEntriesCache.get(Constant.CURRENCY_SYSTEM+mawb.getOtherCurr());
result.setInsuranceCostCurrencyDic(otherDictionaryEntries);
result.setInsuranceCostCurrency(otherDictionaryEntries.getChineseName());
result.setOtherCurrencyDic(otherDictionaryEntries);
result.setOtherCurrency(otherDictionaryEntries.getChineseName());
//杂费/率
result.setOtherCost(mawb.getOtherRate());
//杂费标志
......@@ -136,7 +136,7 @@ public class ChmConsignmentService {
//境内收发货人名称
result.setOperateUnitName(mawb.getTradeName());
//TODO 成交方式
//成交方式
DictionaryEntries dealModeDictionaryEntries = Constant.dictionaryEntriesCache.get(Constant.CLINCH_TYPE+mawb.getTransMode());
result.setDealModeDic(dealModeDictionaryEntries);
result.setDealMode(dealModeDictionaryEntries.getChineseName());
......@@ -177,7 +177,7 @@ public class ChmConsignmentService {
//推送时间作为创建时间,可以用来校验数据的有序性,如果新的推送时间小于已有的创建时间,就不更新数据
result.setCreateTime(new Date());
result.setUpdateTime(pushTime);
result.setCreator(creator);
}catch (Exception e){
e.printStackTrace();
......@@ -244,11 +244,11 @@ public class ChmConsignmentService {
* @param mawb
* @param timeStamp
*/
public void processChmConsignment(Mawb mawb, String timeStamp) {
public void processChmConsignment(Mawb mawb, String timeStamp,String creator) {
try {
Date pushTime = DateUtils.timeStampToDate(Long.valueOf(timeStamp));
ChmConsignment chmConsignment=this.convertToChmConsignment(mawb,pushTime);
ChmConsignment chmConsignment=this.convertToChmConsignment(mawb,pushTime,creator);
List<ChmConsignmentDetail> chmConsignmentDetailList = new ArrayList<>();
mawb.getMawbDetailList().forEach(detail ->{
chmConsignmentDetailList.add(chmConsignmentDetailService.convertToChmConsignmentDetail(detail,chmConsignment));
......
......@@ -23,7 +23,7 @@ public class ChmConsignmentServiceTest extends IClearApiApplicationTests {
try{
Mawb mawb = this.createNewMawb();
String timeStamp = String.valueOf(new Date().getTime());
chmConsignmentService.processChmConsignment(mawb,timeStamp);
chmConsignmentService.processChmConsignment(mawb,timeStamp,"CTM");
}catch (Exception e){
e.printStackTrace();
......