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.util.CollectionUtils;
import static org.apache.commons.lang3.StringUtils.*;
/**
* 运单列表Service业务层处理
*
@ -216,13 +214,13 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb
boolean isNew = true;
EmisWaybill emisWaybillOld = null;
if( !isEmpty(emisWaybillSave.getBillCode()) ){
if( !StringUtils.isEmpty(emisWaybillSave.getBillCode()) ){
emisWaybillOld = this.selectEmisWaybillByBillCode(emisWaybillSave.getBillCode());
if(emisWaybillOld!=null){
isNew=false;
}
}else{
if( !isEmpty(emisWaybillSave.getOrderSn()) ){
if( !StringUtils.isEmpty(emisWaybillSave.getOrderSn()) ){
emisWaybillOld = this.selectEmisWaybillByOrderSn(emisWaybillSave.getOrderSn());
if(emisWaybillOld!=null){
isNew=false;
@ -288,13 +286,13 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb
// 子单号拼接
StringBuilder sb = new StringBuilder();
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());
}
// 物品名称
if(isEmpty(emisWaybillSave.getGoodsInfo())){
if(StringUtils.isEmpty(emisWaybillSave.getGoodsInfo())){
if(!CollectionUtils.isEmpty(emisWaybillSave.getCargoList()) ){
StringBuilder sb = new StringBuilder();
for(EmisWaybillCargo cargo:emisWaybillSave.getCargoList()){
@ -463,7 +461,7 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb
public void calcSettledWeight(EmisWaybill emisWaybill) throws CalcException {
if(
StringUtils.isAnyEmpty(emisWaybill.getProductType(),
isAnyEmpty(emisWaybill.getProductType(),
emisWaybill.getTransLineType(),
emisWaybill.getBillWeight(),
emisWaybill.getTotalVolume()
@ -479,7 +477,7 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb
EmisTransLine emisTransLine= getTransLineByCode(emisWaybill.getTransLineType());
double volumeWeight=0.0D;
if(!isEmpty(emisTransLine.getMeterRate())) {
if(!StringUtils.isEmpty(emisTransLine.getMeterRate())) {
volumeWeight=totalVolume * (1000000 / Double.valueOf(emisTransLine.getMeterRate()));
}