港澳台运费

This commit is contained in:
wangjinlei
2023-11-23 11:01:21 +08:00
parent c45c3d9c11
commit 82c598e172

View File

@@ -40,7 +40,24 @@ public class ExpressFeeServiceImpl extends ServiceImpl<ExpressFeeDao, ExpressFee
* @return 费用
*/
private BigDecimal calculateSFExpressFee(BigDecimal weight, String regionCode) {
// 判断运费计算区间
BigDecimal flag ;
if(regionCode.equals("710000")){//台湾
BigDecimal addWF ;
if(weight.compareTo(new BigDecimal(1))>0){
addWF = (weight.subtract(new BigDecimal(1))).multiply(new BigDecimal(20));
}else {
addWF = new BigDecimal(0);
}
flag = addWF.add(new BigDecimal(28));
} else if (regionCode.equals("810000")||regionCode.equals("820000")) {//香港澳门
BigDecimal addWF ;
if(weight.compareTo(new BigDecimal(1))>0){
addWF = (weight.subtract(new BigDecimal(1))).multiply(new BigDecimal(11));
}else {
addWF = new BigDecimal(0);
}
flag = addWF.add(new BigDecimal(24));
}else{
int weightInterval;
BigDecimal additionalWeight;
if (weight.compareTo(new BigDecimal(0)) >= 0 && weight.compareTo(new BigDecimal(3)) < 0) {
@@ -63,7 +80,9 @@ public class ExpressFeeServiceImpl extends ServiceImpl<ExpressFeeDao, ExpressFee
ExpressFee expressFee = this.getOne(queryWrapper);
BigDecimal firstWeightFee = expressFee.getFirstWeightFee();
BigDecimal additionalWeightFee = (expressFee.getAdditionalWeightFee()).multiply(additionalWeight);
return firstWeightFee.add(additionalWeightFee);
flag = firstWeightFee.add(additionalWeightFee);
}
return flag;
}
/**