港澳台运费
This commit is contained in:
@@ -40,7 +40,24 @@ public class ExpressFeeServiceImpl extends ServiceImpl<ExpressFeeDao, ExpressFee
|
|||||||
* @return 费用
|
* @return 费用
|
||||||
*/
|
*/
|
||||||
private BigDecimal calculateSFExpressFee(BigDecimal weight, String regionCode) {
|
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;
|
int weightInterval;
|
||||||
BigDecimal additionalWeight;
|
BigDecimal additionalWeight;
|
||||||
if (weight.compareTo(new BigDecimal(0)) >= 0 && weight.compareTo(new BigDecimal(3)) < 0) {
|
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);
|
ExpressFee expressFee = this.getOne(queryWrapper);
|
||||||
BigDecimal firstWeightFee = expressFee.getFirstWeightFee();
|
BigDecimal firstWeightFee = expressFee.getFirstWeightFee();
|
||||||
BigDecimal additionalWeightFee = (expressFee.getAdditionalWeightFee()).multiply(additionalWeight);
|
BigDecimal additionalWeightFee = (expressFee.getAdditionalWeightFee()).multiply(additionalWeight);
|
||||||
return firstWeightFee.add(additionalWeightFee);
|
flag = firstWeightFee.add(additionalWeightFee);
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user