From 6ebc9bcfcabd125851152c01d2053056f0fa93b1 Mon Sep 17 00:00:00 2001 From: wangpengfei <1928057482@qq.com> Date: Sun, 21 Jan 2024 23:02:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E4=BA=BA=E8=B4=AD=E4=B9=B0=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../biz/shoppingcart/ShoppingCartService.java | 70 +++++++++++-------- .../VegetableCellarService.java | 7 ++ 2 files changed, 47 insertions(+), 30 deletions(-) diff --git a/src/main/java/com/yxt/yythmall/biz/shoppingcart/ShoppingCartService.java b/src/main/java/com/yxt/yythmall/biz/shoppingcart/ShoppingCartService.java index e31aa8b..25d73ed 100644 --- a/src/main/java/com/yxt/yythmall/biz/shoppingcart/ShoppingCartService.java +++ b/src/main/java/com/yxt/yythmall/biz/shoppingcart/ShoppingCartService.java @@ -121,37 +121,47 @@ public class ShoppingCartService extends MybatisBaseService().eq("sid",vo.getCustomerSid())); vo.setRemarks("已减免附加费"); - if(weight<=100){ - if(weight==20){ - if(lpkCustomer.getIsPurchase().equals("1")){ - double a =0.5; - double t=Double.valueOf(vo.getTotalPrice())*a; - BigDecimal bg = new BigDecimal(t); - vo.setTotalPrice(String.valueOf(bg.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue())); - vo.setRemarks("已享受新人专享5折优惠"); - }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())); - 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{ - 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())); + if(weight>=20 && weight<=100){ +// if(weight==20){ +// if(lpkCustomer.getIsPurchase().equals("1")){ +// double a =0.5; +// double t=Double.valueOf(vo.getTotalPrice())*a; +// BigDecimal bg = new BigDecimal(t); +// vo.setTotalPrice(String.valueOf(bg.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue())); +// vo.setRemarks("已享受新人专享5折优惠"); +// }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())); +// 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{ +// 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)+"元"); +// } + 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)+"元"); - } + 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){ double a =1.05; double d=Double.valueOf(vo.getTotalPrice()); diff --git a/src/main/java/com/yxt/yythmall/biz/vegetablecellar/VegetableCellarService.java b/src/main/java/com/yxt/yythmall/biz/vegetablecellar/VegetableCellarService.java index 58cba59..524b0d0 100644 --- a/src/main/java/com/yxt/yythmall/biz/vegetablecellar/VegetableCellarService.java +++ b/src/main/java/com/yxt/yythmall/biz/vegetablecellar/VegetableCellarService.java @@ -8,6 +8,7 @@ import com.yxt.common.base.utils.StringUtils; import com.yxt.common.core.query.PagerQuery; import com.yxt.common.core.result.ResultBean; import com.yxt.common.core.vo.PagerVo; +import com.yxt.yythmall.api.lpkcustomer.LpkCustomer; import com.yxt.yythmall.api.lpkgoods.LpkGoods; import com.yxt.yythmall.api.ordorder.OrdOrder; import com.yxt.yythmall.api.ordorderdetails.OrdOrderDetail; @@ -16,6 +17,7 @@ import com.yxt.yythmall.api.transferrecords.TransferRecords; import com.yxt.yythmall.api.transferrecordsgoodsdetails.TransferRecordsGoodsDetails; import com.yxt.yythmall.api.vegetablecellar.*; import com.yxt.yythmall.biz.empcard.EmpCardService; +import com.yxt.yythmall.biz.lpkcustomer.LpkCustomerService; import com.yxt.yythmall.biz.lpkgoods.LpkGoodsService; import com.yxt.yythmall.biz.ordorder.OrdOrderService; import com.yxt.yythmall.biz.ordorderdetails.OrdOrderDetailService; @@ -48,6 +50,8 @@ public class VegetableCellarService extends MybatisBaseService().eq("sid",ordOrder.getUserSid())); + customer.setIsPurchase("0"); + lpkCustomerService.updateById(customer); return rb.success().setMsg("成功"); } @Transactional(rollbackFor = Exception.class)