浏览代码

fix some bug

Mr.qian 3 周之前
父节点
当前提交
c54fbd35ce

+ 1 - 4
mall-service/src/main/java/com/txz/mall/controller/appcontroller/AppOrderController.java

@@ -18,7 +18,6 @@ import org.slf4j.LoggerFactory;
 import org.springframework.util.ObjectUtils;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
-import org.springframework.web.multipart.MultipartFile;
 import vo.MyRecord;
 import vo.StoreOrderCountItemVO;
 import vo.StoreOrderVO;
@@ -26,7 +25,6 @@ import vo.StoreOrderVO;
 import javax.annotation.Resource;
 import java.util.Date;
 import java.util.List;
-import java.util.Map;
 
 /**
  * Created by CodeGenerator on 2025/07/15.
@@ -268,8 +266,7 @@ public class AppOrderController {
         @ApiOperation("待处理红点数")
         @GetMapping("/pendingRedDots")
         public Result pendingRedDots() {
-            Map<Integer, Integer> integerIntegerMap = storeOrderService.pendingRedDots();
-            return Result.success(integerIntegerMap);
+            return Result.success(storeOrderService.pendingRedDots());
         }
 
 

+ 1 - 1
mall-service/src/main/java/com/txz/mall/service/StoreOrderService.java

@@ -169,7 +169,7 @@ public interface StoreOrderService extends Service<StoreOrder> {
      * 待处理红点数
      * @return
      */
-    Map<Integer,Integer> pendingRedDots();
+    PendingRedDotsVO pendingRedDots();
 
     List<StoreCombinationRankVO> getRank();
 

+ 14 - 10
mall-service/src/main/java/com/txz/mall/service/impl/StoreOrderServiceImpl.java

@@ -499,7 +499,7 @@ public class StoreOrderServiceImpl extends AbstractService<StoreOrder> implement
                             
                             (orderAddressVO == null || StringUtils.isBlank(orderAddressVO.getRealName())) ? "" : orderAddressVO.getRealName(),
                             (orderAddressVO == null || StringUtils.isBlank(orderAddressVO.getPhone())) ? "" : orderAddressVO.getPhone(),
-                            (orderAddressVO == null || StringUtils.isBlank(orderAddressVO.getDetail())) ? "" : orderAddressVO.getProvince()+orderAddressVO.getCity() + orderAddressVO.getDistrict()+orderAddressVO.getDetail(),
+                            (orderAddressVO == null || StringUtils.isBlank(orderAddressVO.getDetail())) ? "" : orderAddressVO.getProvince() + orderAddressVO.getCity() + orderAddressVO.getDistrict() + orderAddressVO.getDetail(),
                             // vo.getRealName(),
                             // vo.getUserPhone(),
                             // vo.getUserAddress(),
@@ -2428,8 +2428,8 @@ public class StoreOrderServiceImpl extends AbstractService<StoreOrder> implement
      * @return
      */
     @Override
-    public Map<Integer, Integer> pendingRedDots() {
-        Map<Integer, Integer> resultMap = new HashMap<>();
+    public PendingRedDotsVO pendingRedDots() {
+        // Map<Integer, Integer> resultMap = new HashMap<>();
         Long tokenUserId = AuthService.getTokenUserId(null);
         if (ObjectUtils.isEmpty(tokenUserId)) {
             throw new ServiceException("登陆用户不存在tokenUserId:" + tokenUserId);
@@ -2440,8 +2440,8 @@ public class StoreOrderServiceImpl extends AbstractService<StoreOrder> implement
         criteriaStorePinkToPay.andEqualTo("orderStatus", PinkOrderStatusEnum.GROUP_ORDER_TO_PAY.getKey());
         criteriaStorePinkToPay.andEqualTo("isDelete", 0);
         criteriaStorePinkToPay.andEqualTo("uid", tokenUserId);
-        int i = storePinkMapper.selectCountByCondition(conditionStoreStorePinkToPay);
-        resultMap.put(1, i);
+        int toPayNum = storePinkMapper.selectCountByCondition(conditionStoreStorePinkToPay);
+        // resultMap.put(1, i);
         
         // 中奖未填写收获地址数量
         Condition conditionStoreStorePinkPaid = new Condition(StorePink.class);
@@ -2449,8 +2449,8 @@ public class StoreOrderServiceImpl extends AbstractService<StoreOrder> implement
         criteriaStorePinkPaid.andEqualTo("orderStatus", PinkOrderStatusEnum.GROUP_ORDER_PAID.getKey());
         criteriaStorePinkPaid.andEqualTo("isDelete", 0);
         criteriaStorePinkPaid.andEqualTo("uid", tokenUserId);
-        int ii = storePinkMapper.selectCountByCondition(conditionStoreStorePinkPaid);
-        resultMap.put(2, ii);
+        int successNum = storePinkMapper.selectCountByCondition(conditionStoreStorePinkPaid);
+        // resultMap.put(2, ii);
         
         // 中奖未填写收获地址数量
         Condition conditionStoreStorePinkToShip = new Condition(StorePink.class);
@@ -2460,11 +2460,15 @@ public class StoreOrderServiceImpl extends AbstractService<StoreOrder> implement
         criteriaStorePinkToShip.andIn("orderStatus", integers);
         criteriaStorePinkToShip.andEqualTo("isDelete", 0);
         criteriaStorePinkToShip.andEqualTo("uid", tokenUserId);
-        int iii = storePinkMapper.selectCountByCondition(conditionStoreStorePinkToShip);
-        resultMap.put(4, iii);
+        int rewardNum = storePinkMapper.selectCountByCondition(conditionStoreStorePinkToShip);
+        // resultMap.put(4, iii);
         
         
-        return resultMap;
+        return PendingRedDotsVO.builder()
+                .toPayNum(toPayNum)
+                .successNum(successNum)
+                .rewardNum(rewardNum)
+                .build();
     }
     
     @Override

+ 20 - 0
mall-service/src/main/java/vo/PendingRedDotsVO.java

@@ -0,0 +1,20 @@
+package vo;
+
+import lombok.Builder;
+import lombok.Data;
+
+/**
+ * @author: MTD®️
+ * @date: 2025/9/11
+ */
+@Data
+@Builder
+public class PendingRedDotsVO {
+    
+    private Integer toPayNum;
+    
+    private Integer successNum;
+    
+    private Integer rewardNum;
+    
+}