|
|
@ -69,7 +69,7 @@ public class ShoppingCartService extends MybatisBaseService<ShoppingCartMapper, |
|
|
|
ShoppingCart entity=new ShoppingCart(); |
|
|
|
List<ShoppingCartVo> list= baseMapper.ShoppingCartList(query.getCustomerSid(),query.getBrandId()); |
|
|
|
list.forEach(s->{ |
|
|
|
s.setTotalPrice(String.valueOf((int)(Double.valueOf(s.getPrice())* Double.valueOf(s.getGoodsNumber())))); |
|
|
|
s.setTotalPrice(removeZeros(String.valueOf((Double.valueOf(s.getPrice())* Double.valueOf(s.getGoodsNumber()))))); |
|
|
|
s.setIconUrl(fileUploadComponent.getUrlPrefix() +s.getIconUrl()); |
|
|
|
}); |
|
|
|
|
|
|
@ -121,7 +121,21 @@ public class ShoppingCartService extends MybatisBaseService<ShoppingCartMapper, |
|
|
|
int weight=Integer.parseInt(vo.getTotalWeight()); |
|
|
|
LpkCustomer lpkCustomer=lpkCustomerService.getOne(new QueryWrapper<LpkCustomer>().eq("sid",vo.getCustomerSid())); |
|
|
|
vo.setRemarks("已减免附加费"); |
|
|
|
if(weight>=20 && weight<=100){ |
|
|
|
if(weight<=99){ |
|
|
|
if(weight<=20){ |
|
|
|
vo.setRemarks("不足20斤,请继续选菜"); |
|
|
|
}else{ |
|
|
|
double a =1.1; |
|
|
|
double d=Double.valueOf(vo.getTotalPrice()); |
|
|
|
double t=Double.valueOf(vo.getTotalPrice())*a; |
|
|
|
BigDecimal bg = new BigDecimal(t); |
|
|
|
vo.setTotalPrice(String.valueOf(bg.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue())); |
|
|
|
// String c =String.valueOf(Double.valueOf(vo.getTotalPrice())-d);
|
|
|
|
double f=Double.valueOf(vo.getTotalPrice())-d; |
|
|
|
BigDecimal bgd = new BigDecimal(f); |
|
|
|
String c =String.valueOf(bgd.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue()); |
|
|
|
vo.setRemarks("包含附加费"+removeZeros(c)+"元"); |
|
|
|
} |
|
|
|
// if(weight==20){
|
|
|
|
// if(lpkCustomer.getIsPurchase().equals("1")){
|
|
|
|
// double a =0.5;
|
|
|
@ -152,17 +166,8 @@ public class ShoppingCartService extends MybatisBaseService<ShoppingCartMapper, |
|
|
|
// String c =String.valueOf(bgd.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
|
|
|
|
// vo.setRemarks("包含附加费"+removeZeros(c)+"元");
|
|
|
|
// }
|
|
|
|
double a =1.1; |
|
|
|
double d=Double.valueOf(vo.getTotalPrice()); |
|
|
|
double t=Double.valueOf(vo.getTotalPrice())*a; |
|
|
|
BigDecimal bg = new BigDecimal(t); |
|
|
|
vo.setTotalPrice(String.valueOf(bg.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue())); |
|
|
|
// String c =String.valueOf(Double.valueOf(vo.getTotalPrice())-d);
|
|
|
|
double f=Double.valueOf(vo.getTotalPrice())-d; |
|
|
|
BigDecimal bgd = new BigDecimal(f); |
|
|
|
String c =String.valueOf(bgd.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue()); |
|
|
|
vo.setRemarks("包含附加费"+removeZeros(c)+"元"); |
|
|
|
}else if(weight>=101 && weight<=200){ |
|
|
|
|
|
|
|
}else if(weight>=100 && weight<=199){ |
|
|
|
double a =1.05; |
|
|
|
double d=Double.valueOf(vo.getTotalPrice()); |
|
|
|
double t=Double.valueOf(vo.getTotalPrice())*a; |
|
|
|