李俊

第二法定计量单位为空时不校验secondQty数量

......@@ -109,12 +109,12 @@ public class CustomsDataInterface {
sw.stop();
// //3、TODO 校验子单
// sw.start("checkMawbDetail");
// result=mawbDetailServicel.checkMawbDetail(mawb);
// if(!result.getSuccess()){
// return result;
// }
// sw.stop();
sw.start("checkMawbDetail");
result=mawbDetailServicel.checkMawbDetail(mawb);
if(!result.getSuccess()){
return result;
}
sw.stop();
//4、保存运单到iclear中
......
......@@ -114,7 +114,6 @@ public class MawbDetail implements Serializable{
private String secondUnit;
@ApiModelProperty(value = "第二法定数量")
@NotNull(message="参数secondQty不能为空")
@Column(name = "SECONDQTY")
private Integer secondQty;
......
......@@ -5,10 +5,12 @@ import com.erry.iclear.dateInterface.api.request.MawbDetail;
import com.erry.iclear.dateInterface.api.response.ResultRS;
import com.erry.iclear.dateInterface.repository.MawbDetailRepository;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Objects;
/**
* @author Administrator
......@@ -22,7 +24,7 @@ public class MawbDetailService {
public void saveMawbDetail(List<MawbDetail> mawbDetailList){
log.info("");
log.info("");
}
......@@ -31,9 +33,17 @@ public class MawbDetailService {
public ResultRS checkMawbDetail(Mawb mawb){
ResultRS result = new ResultRS(Boolean.FALSE,null,null);
try{
for (MawbDetail detail : mawb.getMawbDetailList()) {
String secondUnit = detail.getSecondUnit();
if (StringUtils.isNotEmpty(secondUnit)) {
Integer secondQty = detail.getSecondQty();
if (Objects.isNull(secondQty)) {
result.setMsg("参数secondQty不能为空");
return result;
}
}
}
result.setSuccess(Boolean.TRUE);
}catch (Exception e){
log.error("checkMawbDetail() error:"+e.getMessage());
......