修复
This commit is contained in:
@@ -313,14 +313,21 @@ public class BuyOrderController {
|
||||
BigDecimal totalWeight = new BigDecimal(0);
|
||||
for (ProductRequestVo product : products) {
|
||||
ShopProduct shopProduct = shopProductService.getById(product.getProductId());
|
||||
if(shopProduct.getIsFreeMail()==0){
|
||||
continue;
|
||||
}
|
||||
BigDecimal weight = BigDecimal.valueOf(Double.valueOf(shopProduct.getWeight()) / 1000.0);
|
||||
totalWeight = totalWeight.add(weight.multiply(new BigDecimal(product.getQuantity())));
|
||||
}
|
||||
totalWeight = totalWeight.setScale(0, RoundingMode.UP);
|
||||
QueryWrapper<SysConfigEntity> configQueryWrapper = new QueryWrapper<>();
|
||||
configQueryWrapper.eq("param_key", "DEFAULT_EXPRESS");
|
||||
SysConfigEntity config = sysConfigService.getOne(configQueryWrapper);
|
||||
BigDecimal expressFee = expressFeeService.calculateExpressFee(config.getParamValue(), totalWeight, regionCode);
|
||||
BigDecimal expressFee = new BigDecimal(0);
|
||||
if(totalWeight.compareTo(BigDecimal.ZERO)!=0){
|
||||
totalWeight = totalWeight.setScale(0, RoundingMode.UP);
|
||||
QueryWrapper<SysConfigEntity> configQueryWrapper = new QueryWrapper<>();
|
||||
configQueryWrapper.eq("param_key", "DEFAULT_EXPRESS");
|
||||
SysConfigEntity config = sysConfigService.getOne(configQueryWrapper);
|
||||
expressFee = expressFeeService.calculateExpressFee(config.getParamValue(), totalWeight, regionCode);
|
||||
}
|
||||
|
||||
return R.ok().put("result", expressFee);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user