yi.wang

Merge remote-tracking branch 'origin/master'

......@@ -62,7 +62,7 @@ public class BasfDataInterface {
if(!Objects.equals(saveIClearApiLogResult,null)){
log.info("请求保存成功,msgId:"+saveIClearApiLogResult.getMsgId());
basfc.setMsgId(saveIClearApiLogResult.getMsgId());
basfc.getBasfcDetailList().forEach(d->{
basfc.getConsignmentList().forEach(d->{
d.setMsgId(saveIClearApiLogResult.getMsgId());
});
saveMawbBasfResult = basfService.saveMawbBasf(basfc);
......@@ -78,12 +78,12 @@ public class BasfDataInterface {
//2、TODO 校验主单
/*sw.start("checkMawb");
sw.start("checkBasfMawb");
result=basfService.checkBasfMawb(saveMawbBasfResult);
if(!result.getSuccess()){
return result;
}
sw.stop();*/
sw.stop();
// //3、TODO 校验子单
// sw.start("checkMawbDetail");
......
......@@ -10,6 +10,7 @@ import org.hibernate.annotations.DynamicUpdate;
import javax.persistence.*;
import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;
......@@ -50,7 +51,8 @@ public class Basfc implements Serializable {
@ApiModelProperty(value = "运单ID", name = "consignmentId", example = "运单记录的唯一ID")
@Column(name = "CONSIGNMENTID")
@NotBlank(message="参数consignmentId不能为空!")
@NotNull(message="参数consignmentId不能为空!")
// @NotBlank(message="参数consignmentId不能为空!")
private Long consignmentId;
@ApiModelProperty(value = "运单类型",name = "consType", example = "A/B/C/D")
......@@ -89,8 +91,8 @@ public class Basfc implements Serializable {
private String EANNo;
@Valid
@ApiModelProperty(value = "运单明细", name = "basfcDetailList", example = "")
@ApiModelProperty(value = "运单明细", name = "consignmentList", example = "")
@OneToMany(cascade = CascadeType.PERSIST)
@JoinColumn(name = "BASFCID")
private List<BasfcDetail> basfcDetailList;
private List<BasfcDetail> consignmentList;
}
......
......@@ -30,8 +30,8 @@ public class BasfcDetail {
private Long basfId;
@Column(name="CONSIGNMENTDETAILID")
@NotBlank(message="参数consignmentDetailId不能为空")
private String consignmentDetailId;
@NotNull(message="参数consignmentDetailId不能为空")
private Long consignmentDetailId;
@ApiModelProperty(value = "商品编号")
@NotBlank(message="参数skuCode不能为空")
......
......@@ -77,10 +77,10 @@ public class BasfService {
basfMawb.setEANNo(basfc.getEANNo());
//明细
List<BasfMawbDetail> mawbDetailList = new ArrayList<>();
if (basfc.getBasfcDetailList().size()>0){
for (BasfcDetail basfcDetail : basfc.getBasfcDetailList()){
if (basfc.getConsignmentList().size()>0){
for (BasfcDetail basfcDetail : basfc.getConsignmentList()){
BasfMawbDetail mawbDetail = new BasfMawbDetail();
mawbDetail.setDetailId(basfcDetail.getConsignmentDetailId());
mawbDetail.setDetailId(String.valueOf(basfcDetail.getConsignmentDetailId()));
mawbDetail.setGmodel(basfcDetail.getModel());
mawbDetail.setCodeTS(basfcDetail.getSkuCode());
mawbDetail.setGname(basfcDetail.getSkuName());
......
......@@ -240,7 +240,7 @@ public class ChmConsignmentService {
//运单号
result.setConsignmentCode(mawb.getBillNo());
//运单类型
DictionaryEntries consType = Constant.dictionaryEntriesCache.get(Constant.MSG_TYPE_C);
DictionaryEntries consType = Constant.dictionaryEntriesCache.get(Constant.consType_C);
if(consType != null){
result.setConsTypeId(consType);
result.setConsType(consType.getChineseName());
......@@ -586,10 +586,10 @@ public class ChmConsignmentService {
}
//更新:
//如果有数据并且满足条件后才能更新数据
//条件1、状态为 待申报海关
//条件1、状态为 C类待申报
//条件2、本次推送时间 > 上次推送的时间
}else if(!Objects.equals(chmConsignmentDB,null)
&& Objects.equals(chmConsignmentDB.getConsStatusDic().getCode(),"transferWaybillStatus_5")
&& Objects.equals(chmConsignmentDB.getConsStatusDic().getCode(),"transferWaybillStatus_16")
//TODO 提交时需要打开
&& pushTime.getTime()>chmConsignmentDB.getUpdateTime().getTime()
){
......