This commit is contained in:
linfso 2024-04-29 17:49:14 +08:00
parent 3d77fce137
commit a1dde190f7

View File

@ -36,8 +36,6 @@ import com.xdadan.erp.emis.mapper.EmisWaybillMapper;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import static org.apache.commons.lang3.StringUtils.*;
/** /**
* 运单列表Service业务层处理 * 运单列表Service业务层处理
* *
@ -216,13 +214,13 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb
boolean isNew = true; boolean isNew = true;
EmisWaybill emisWaybillOld = null; EmisWaybill emisWaybillOld = null;
if( !isEmpty(emisWaybillSave.getBillCode()) ){ if( !StringUtils.isEmpty(emisWaybillSave.getBillCode()) ){
emisWaybillOld = this.selectEmisWaybillByBillCode(emisWaybillSave.getBillCode()); emisWaybillOld = this.selectEmisWaybillByBillCode(emisWaybillSave.getBillCode());
if(emisWaybillOld!=null){ if(emisWaybillOld!=null){
isNew=false; isNew=false;
} }
}else{ }else{
if( !isEmpty(emisWaybillSave.getOrderSn()) ){ if( !StringUtils.isEmpty(emisWaybillSave.getOrderSn()) ){
emisWaybillOld = this.selectEmisWaybillByOrderSn(emisWaybillSave.getOrderSn()); emisWaybillOld = this.selectEmisWaybillByOrderSn(emisWaybillSave.getOrderSn());
if(emisWaybillOld!=null){ if(emisWaybillOld!=null){
isNew=false; isNew=false;
@ -288,13 +286,13 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb
// 子单号拼接 // 子单号拼接
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
for(int i=0;i<emisWaybillSave.getParcelQty().intValue();i++){ for(int i=0;i<emisWaybillSave.getParcelQty().intValue();i++){
sb.append(emisWaybillSave.getBillCode()+ leftPad(String.valueOf(i),4,"0")+","); sb.append(emisWaybillSave.getBillCode()+ StringUtils.leftPad(String.valueOf(i),4,"0")+",");
} }
emisWaybillSave.setBillCodeSub(sb.toString()); emisWaybillSave.setBillCodeSub(sb.toString());
} }
// 物品名称 // 物品名称
if(isEmpty(emisWaybillSave.getGoodsInfo())){ if(StringUtils.isEmpty(emisWaybillSave.getGoodsInfo())){
if(!CollectionUtils.isEmpty(emisWaybillSave.getCargoList()) ){ if(!CollectionUtils.isEmpty(emisWaybillSave.getCargoList()) ){
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
for(EmisWaybillCargo cargo:emisWaybillSave.getCargoList()){ for(EmisWaybillCargo cargo:emisWaybillSave.getCargoList()){
@ -463,7 +461,7 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb
public void calcSettledWeight(EmisWaybill emisWaybill) throws CalcException { public void calcSettledWeight(EmisWaybill emisWaybill) throws CalcException {
if( if(
StringUtils.isAnyEmpty(emisWaybill.getProductType(), isAnyEmpty(emisWaybill.getProductType(),
emisWaybill.getTransLineType(), emisWaybill.getTransLineType(),
emisWaybill.getBillWeight(), emisWaybill.getBillWeight(),
emisWaybill.getTotalVolume() emisWaybill.getTotalVolume()
@ -479,7 +477,7 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb
EmisTransLine emisTransLine= getTransLineByCode(emisWaybill.getTransLineType()); EmisTransLine emisTransLine= getTransLineByCode(emisWaybill.getTransLineType());
double volumeWeight=0.0D; double volumeWeight=0.0D;
if(!isEmpty(emisTransLine.getMeterRate())) { if(!StringUtils.isEmpty(emisTransLine.getMeterRate())) {
volumeWeight=totalVolume * (1000000 / Double.valueOf(emisTransLine.getMeterRate())); volumeWeight=totalVolume * (1000000 / Double.valueOf(emisTransLine.getMeterRate()));
} }