From af085dd2fdea97c66ed9520f31754e1025d9dc02 Mon Sep 17 00:00:00 2001
From: cloudroam <cloudroam>
Date: 星期二, 10 十二月 2024 16:06:58 +0800
Subject: [PATCH] 582-在售商品可以直接进行删除,需要进行优化,在售商品删除提示无法删除,需要先进行下架再进行删除

---
 src/main/java/com/mzl/flower/service/system/UserService.java |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/src/main/java/com/mzl/flower/service/system/UserService.java b/src/main/java/com/mzl/flower/service/system/UserService.java
index 855ec56..e5286b5 100644
--- a/src/main/java/com/mzl/flower/service/system/UserService.java
+++ b/src/main/java/com/mzl/flower/service/system/UserService.java
@@ -21,6 +21,7 @@
 import com.mzl.flower.service.customer.CustomerService;
 import com.mzl.flower.service.partner.PartnerService;
 import com.mzl.flower.service.point.CustomerPointService;
+import com.mzl.flower.service.supplier.StationService;
 import com.mzl.flower.service.supplier.SupplierService;
 import com.mzl.flower.utils.TreeBuilderUtil;
 import com.mzl.flower.utils.UUIDGenerator;
@@ -79,6 +80,8 @@
 
     @Autowired
     private CustomerPointMapper customerPointMapper;
+    @Autowired
+    private StationService stationService;
 
 
     public User findUserByOpenId(String openId, String sessionKey, String unionId
@@ -201,13 +204,15 @@
             if(customerPoint == null){
                 result.setCurrentPoint(0);
             }else{
-                Integer currentPoint =customerPoint.getTotalPoint()-customerPoint.getUsedPoint()-customerPoint.getExpiredPoint();
+                Integer currentPoint =customerPoint.getTotalPoint()-customerPoint.getUsedPoint()-customerPoint.getExpiredPoint()-customerPoint.getDeductionPoint();
                 result.setCurrentPoint(currentPoint>=0?currentPoint:0);
             }
         }else if(Constants.USER_TYPE.supplier.name().equals(user.getType())){
             result.setSupplierDTO(supplierService.getCurrentSupplier());
         }else if(Constants.USER_TYPE.partner.name().equals(user.getType())){
             result.setPartnerDTO(partnerService.getCurrentPartner());
+        }else if (Constants.USER_TYPE.admin.name().equals(user.getType())){
+            result.setMainWarehouse(stationService.getMainWarehouse(user.getId()));
         }
         result.setBindWechat(wechatMapper.selectCount(new LambdaQueryWrapper<UserWechat>()
                 .eq(UserWechat::getUserId, userId)) > 0);

--
Gitblit v1.9.3