yangyb 1 mese fa
parent
commit
8ce3f15f73
19 ha cambiato i file con 217 aggiunte e 40 eliminazioni
  1. 51 0
      mall-api/src/main/java/com/txz/mall/vo/StoreOrderCountItemVO.java
  2. 14 4
      mall-service/src/main/java/com/txz/mall/controller/CategoryController.java
  3. 8 2
      mall-service/src/main/java/com/txz/mall/controller/StoreCombinationController.java
  4. 8 2
      mall-service/src/main/java/com/txz/mall/controller/StoreFlashActivityController.java
  5. 24 8
      mall-service/src/main/java/com/txz/mall/controller/StoreOrderController.java
  6. 14 8
      mall-service/src/main/java/com/txz/mall/controller/StorePinkController.java
  7. 8 2
      mall-service/src/main/java/com/txz/mall/controller/StoreProductAttrResultController.java
  8. 1 1
      mall-service/src/main/java/com/txz/mall/controller/StoreProductController.java
  9. 8 2
      mall-service/src/main/java/com/txz/mall/controller/StoreProductRuleController.java
  10. 15 9
      mall-service/src/main/java/com/txz/mall/controller/UserAddressController.java
  11. 1 1
      mall-service/src/main/java/com/txz/mall/controller/UserSignController.java
  12. 9 0
      mall-service/src/main/java/com/txz/mall/service/StoreOrderService.java
  13. 2 0
      mall-service/src/main/java/com/txz/mall/service/impl/CategoryServiceImpl.java
  14. 46 1
      mall-service/src/main/java/com/txz/mall/service/impl/StoreOrderServiceImpl.java
  15. 1 0
      mall-service/src/main/java/com/txz/mall/service/impl/StorePinkServiceImpl.java
  16. 1 0
      mall-service/src/main/java/com/txz/mall/service/impl/StoreProductRuleServiceImpl.java
  17. 1 0
      mall-service/src/main/java/com/txz/mall/service/impl/SystemGroupDataServiceImpl.java
  18. 3 0
      mall-service/src/main/java/com/txz/mall/service/impl/UserSignServiceImpl.java
  19. 2 0
      mall-service/src/main/resources/bootstrap.properties

+ 51 - 0
mall-api/src/main/java/com/txz/mall/vo/StoreOrderCountItemVO.java

@@ -0,0 +1,51 @@
+package com.txz.mall.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "StoreOrderCountItemResponse对象", description = "订单状态数量")
+public class StoreOrderCountItemVO implements Serializable {
+
+    private static final long serialVersionUID = -8605913636959651047L;
+
+    @ApiModelProperty(value = "总数")
+    private Integer all;
+
+    @ApiModelProperty(value = "未支付")
+    private Integer unPaid;
+
+    @ApiModelProperty(value = "未发货")
+    private Integer notShipped;
+
+    @ApiModelProperty(value = "待收货")
+    private Integer spike;
+
+    @ApiModelProperty(value = "待评价")
+    private Integer bargain;
+
+    @ApiModelProperty(value = "交易完成")
+    private Integer complete;
+
+    @ApiModelProperty(value = "待核销")
+    private Integer toBeWrittenOff;
+
+    @ApiModelProperty(value = "退款中")
+    private Integer refunding;
+
+    @ApiModelProperty(value = "已退款")
+    private Integer refunded;
+
+    @ApiModelProperty(value = "0 未退款 1 申请中 2 已退款")
+    private Integer refundStatus;
+
+    @ApiModelProperty(value = "已删除")
+    private Integer deleted;
+}

+ 14 - 4
mall-service/src/main/java/com/txz/mall/controller/CategoryController.java

@@ -11,15 +11,19 @@ import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
+import org.apache.commons.lang.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 import tk.mybatis.mapper.entity.Condition;
+import tk.mybatis.mapper.entity.Example;
 
 import javax.annotation.Resource;
+import java.util.Comparator;
 import java.util.Date;
 import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * Created by CodeGenerator on 2025/07/11.
@@ -107,12 +111,18 @@ public class CategoryController {
     public Result<List<Category>> list(@RequestBody Category category, @RequestParam(defaultValue = "1") Integer page, @RequestParam(defaultValue = "10") Integer size) {
 
         Condition condition = new Condition(category.getClass());
-//        Criteria criteria = condition.createCriteria();
-//        criteria.andEqualTo("name", city.getName());
+        Example.Criteria criteria = condition.createCriteria();
+        if (StringUtils.isNotBlank(category.getName())) {
+            criteria.andLike("name", category.getName());
+        }
+        criteria.andEqualTo("isDelete", 0);
         PageInfo pageInfo = null;
         try {
             PageHelper.startPage(page, size);
             List<Category> list = categoryService.findByCondition(condition);
+            list = list.stream()
+                    .sorted(Comparator.comparing(Category::getCreateTime).reversed())
+                    .collect(Collectors.toList());
             pageInfo = new PageInfo(list);
         } catch (Exception e) {
             log.error("查询对象操作异常e:{}", e);
@@ -137,14 +147,14 @@ public class CategoryController {
 
     @ApiOperation(value = "根据id集合获取分类列表")
     @GetMapping(value = "/list/ids")
-    @ApiImplicitParam(name = "ids", value="分类id集合")
+    @ApiImplicitParam(name = "ids", value = "分类id集合")
     public Result<List<Category>> getByIds(@Validated @RequestParam(name = "ids") String ids) {
         return Result.success(categoryService.findByIds(ids));
     }
 
     @ApiOperation(value = "更改分类状态")
     @GetMapping(value = "/updateStatus/{id}")
-    @ApiImplicitParam(name = "id", value="分类id")
+    @ApiImplicitParam(name = "id", value = "分类id")
     public Result getByIds(@Validated @PathVariable(name = "id") Long id) {
         if (categoryService.updateStatus(id)) {
             return Result.success("修改成功");

+ 8 - 2
mall-service/src/main/java/com/txz/mall/controller/StoreCombinationController.java

@@ -15,10 +15,13 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.web.bind.annotation.*;
 import tk.mybatis.mapper.entity.Condition;
+import tk.mybatis.mapper.entity.Example;
 
 import javax.annotation.Resource;
+import java.util.Comparator;
 import java.util.Date;
 import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * Created by CodeGenerator on 2025/07/14.
@@ -113,11 +116,14 @@ public class StoreCombinationController {
         PageHelper.startPage(page, size);
 
         Condition condition = new Condition(storeCombination.getClass());
-//        Criteria criteria = condition.createCriteria();
-//        criteria.andEqualTo("name", city.getName());
+        Example.Criteria criteria = condition.createCriteria();
+        criteria.andEqualTo("isDelete", 0);
         PageInfo pageInfo = null;
         try {
             List<StoreCombination> list = storeCombinationService.findByCondition(condition);
+            list = list.stream()
+                    .sorted(Comparator.comparing(StoreCombination::getCreateTime).reversed())
+                    .collect(Collectors.toList());
             pageInfo = new PageInfo(list);
         } catch (Exception e) {
             log.error("查询对象操作异常e:{}", e);

+ 8 - 2
mall-service/src/main/java/com/txz/mall/controller/StoreFlashActivityController.java

@@ -12,10 +12,13 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.web.bind.annotation.*;
 import tk.mybatis.mapper.entity.Condition;
+import tk.mybatis.mapper.entity.Example;
 
 import javax.annotation.Resource;
+import java.util.Comparator;
 import java.util.Date;
 import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * Created by CodeGenerator on 2025/07/14.
@@ -108,11 +111,14 @@ public class StoreFlashActivityController {
         PageHelper.startPage(page, size);
 
         Condition condition = new Condition(storeFlashActivity.getClass());
-//        Criteria criteria = condition.createCriteria();
-//        criteria.andEqualTo("name", city.getName());
+        Example.Criteria criteria = condition.createCriteria();
+        criteria.andEqualTo("isDelete", 0);
         PageInfo pageInfo = null;
         try {
             List<StoreFlashActivity> list = storeFlashActivityService.findByCondition(condition);
+            list = list.stream()
+                    .sorted(Comparator.comparing(StoreFlashActivity::getCreateTime).reversed())
+                    .collect(Collectors.toList());
             pageInfo = new PageInfo(list);
         } catch (Exception e) {
             log.error("查询对象操作异常e:{}", e);

+ 24 - 8
mall-service/src/main/java/com/txz/mall/controller/StoreOrderController.java

@@ -6,21 +6,26 @@ import com.txz.mall.core.Result;
 import com.txz.mall.core.ResultCode;
 import com.txz.mall.model.StoreOrder;
 import com.txz.mall.service.StoreOrderService;
+import com.txz.mall.vo.StoreOrderCountItemVO;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import org.hibernate.validator.constraints.Range;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.web.bind.annotation.*;
 import tk.mybatis.mapper.entity.Condition;
+import tk.mybatis.mapper.entity.Example;
 
 import javax.annotation.Resource;
+import java.util.Comparator;
 import java.util.Date;
 import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * Created by CodeGenerator on 2025/07/15.
  */
-@Api(tags = "[后台]storeOrder管理")
+@Api(tags = "[后台]订单管理")
 @RestController
 @RequestMapping("/store/order")
 public class StoreOrderController {
@@ -31,7 +36,7 @@ public class StoreOrderController {
     private StoreOrderService storeOrderService;
 
     @PostMapping("/add")
-    @ApiOperation(value = "storeOrder新增")
+    @ApiOperation(value = "订单新增")
     public Result add(@RequestBody StoreOrder storeOrder) {
         if (storeOrder == null) {
             return Result.fail(ResultCode.OBJECT_IS_NULL);
@@ -48,7 +53,7 @@ public class StoreOrderController {
     }
 
     @PostMapping("/delete")
-    @ApiOperation(value = "storeOrder删除")
+    @ApiOperation(value = "订单删除")
     public Result delete(@RequestParam Long id) {
         if (id == null) {
             return Result.fail(ResultCode.ID_IS_NULL);
@@ -66,7 +71,7 @@ public class StoreOrderController {
     }
 
     @PostMapping("/update")
-    @ApiOperation(value = "storeOrder更新")
+    @ApiOperation(value = "订单更新")
     public Result update(@RequestBody StoreOrder storeOrder) {
         if (storeOrder == null) {
             return Result.fail(ResultCode.OBJECT_IS_NULL);
@@ -86,7 +91,7 @@ public class StoreOrderController {
     }
 
     @PostMapping("/detail")
-    @ApiOperation(value = "storeOrder获取详情")
+    @ApiOperation(value = "订单获取详情")
     public Result<StoreOrder> detail(@RequestParam Long id) {
         if (id == null) {
             return Result.fail(ResultCode.ID_IS_NULL);
@@ -102,16 +107,19 @@ public class StoreOrderController {
     }
 
     @PostMapping("/list")
-    @ApiOperation(value = "storeOrder获取列表")
+    @ApiOperation(value = "订单获取列表")
     public Result<List<StoreOrder>> list(@RequestBody StoreOrder storeOrder, @RequestParam(defaultValue = "1") Integer page, @RequestParam(defaultValue = "10") Integer size) {
         PageHelper.startPage(page, size);
 
         Condition condition = new Condition(storeOrder.getClass());
-//        Criteria criteria = condition.createCriteria();
-//        criteria.andEqualTo("name", city.getName());
+        Example.Criteria criteria = condition.createCriteria();
+        criteria.andEqualTo("isDelete", 0);
         PageInfo pageInfo = null;
         try {
             List<StoreOrder> list = storeOrderService.findByCondition(condition);
+            list = list.stream()
+                    .sorted(Comparator.comparing(StoreOrder::getCreateTime).reversed())
+                    .collect(Collectors.toList());
             pageInfo = new PageInfo(list);
         } catch (Exception e) {
             log.error("查询对象操作异常e:{}", e);
@@ -119,4 +127,12 @@ public class StoreOrderController {
         }
         return Result.success(pageInfo);
     }
+
+    @ApiOperation(value = "获取订单各状态数量")
+    @GetMapping(value = "/status/num")
+    public Result<StoreOrderCountItemVO> getOrderStatusNum(
+            @RequestParam(value = "dateLimit", defaultValue = "") String dateLimit,
+            @RequestParam(value = "type", defaultValue = "2") @Range(min = 0, max = 2, message = "未知的订单类型") Integer type) {
+        return Result.success(storeOrderService.getOrderStatusNum(dateLimit, type));
+    }
 }

+ 14 - 8
mall-service/src/main/java/com/txz/mall/controller/StorePinkController.java

@@ -12,15 +12,18 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.web.bind.annotation.*;
 import tk.mybatis.mapper.entity.Condition;
+import tk.mybatis.mapper.entity.Example;
 
 import javax.annotation.Resource;
+import java.util.Comparator;
 import java.util.Date;
 import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * Created by CodeGenerator on 2025/07/15.
  */
-@Api(tags = "[后台]storePink管理")
+@Api(tags = "[后台]拼团管理")
 @RestController
 @RequestMapping("/store/pink")
 public class StorePinkController {
@@ -31,7 +34,7 @@ public class StorePinkController {
     private StorePinkService storePinkService;
 
     @PostMapping("/add")
-    @ApiOperation(value = "storePink新增")
+    @ApiOperation(value = "拼团新增")
     public Result add(@RequestBody StorePink storePink) {
         if (storePink == null) {
             return Result.fail(ResultCode.OBJECT_IS_NULL);
@@ -48,7 +51,7 @@ public class StorePinkController {
     }
 
     @PostMapping("/delete")
-    @ApiOperation(value = "storePink删除")
+    @ApiOperation(value = "拼团删除")
     public Result delete(@RequestParam Long id) {
         if (id == null) {
             return Result.fail(ResultCode.ID_IS_NULL);
@@ -66,7 +69,7 @@ public class StorePinkController {
     }
 
     @PostMapping("/update")
-    @ApiOperation(value = "storePink更新")
+    @ApiOperation(value = "拼团更新")
     public Result update(@RequestBody StorePink storePink) {
         if (storePink == null) {
             return Result.fail(ResultCode.OBJECT_IS_NULL);
@@ -86,7 +89,7 @@ public class StorePinkController {
     }
 
     @PostMapping("/detail")
-    @ApiOperation(value = "storePink获取详情")
+    @ApiOperation(value = "拼团获取详情")
     public Result<StorePink> detail(@RequestParam Long id) {
         if (id == null) {
             return Result.fail(ResultCode.ID_IS_NULL);
@@ -102,16 +105,19 @@ public class StorePinkController {
     }
 
     @PostMapping("/list")
-    @ApiOperation(value = "storePink获取列表")
+    @ApiOperation(value = "拼团获取列表")
     public Result<List<StorePink>> list(@RequestBody StorePink storePink, @RequestParam(defaultValue = "1") Integer page, @RequestParam(defaultValue = "10") Integer size) {
         PageHelper.startPage(page, size);
 
         Condition condition = new Condition(storePink.getClass());
-//        Criteria criteria = condition.createCriteria();
-//        criteria.andEqualTo("name", city.getName());
+        Example.Criteria criteria = condition.createCriteria();
+        criteria.andEqualTo("isDelete", 0);
         PageInfo pageInfo = null;
         try {
             List<StorePink> list = storePinkService.findByCondition(condition);
+            list = list.stream()
+                    .sorted(Comparator.comparing(StorePink::getCreateTime).reversed())
+                    .collect(Collectors.toList());
             pageInfo = new PageInfo(list);
         } catch (Exception e) {
             log.error("查询对象操作异常e:{}", e);

+ 8 - 2
mall-service/src/main/java/com/txz/mall/controller/StoreProductAttrResultController.java

@@ -12,10 +12,13 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.web.bind.annotation.*;
 import tk.mybatis.mapper.entity.Condition;
+import tk.mybatis.mapper.entity.Example;
 
 import javax.annotation.Resource;
+import java.util.Comparator;
 import java.util.Date;
 import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * Created by CodeGenerator on 2025/07/11.
@@ -112,11 +115,14 @@ public class StoreProductAttrResultController {
         PageHelper.startPage(page, size);
 
         Condition condition = new Condition(storeProductAttrResult.getClass());
-//        Criteria criteria = condition.createCriteria();
-//        criteria.andEqualTo("name", city.getName());
+        Example.Criteria criteria = condition.createCriteria();
+        criteria.andEqualTo("isDelete", 0);
         PageInfo pageInfo = null;
         try {
             List<StoreProductAttrResult> list = storeProductAttrResultService.findByCondition(condition);
+            list = list.stream()
+                    .sorted(Comparator.comparing(StoreProductAttrResult::getCreateTime).reversed())
+                    .collect(Collectors.toList());
             pageInfo = new PageInfo(list);
         } catch (Exception e) {
             log.error("查询对象操作异常e:{}", e);

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

@@ -167,7 +167,7 @@ public class StoreProductController {
 
         Condition condition = new Condition(storeProduct.getClass());
         Criteria criteria = condition.createCriteria();
-        criteria.andEqualTo("is_delete", 1);
+        criteria.andEqualTo("isDelete", 0);
         PageInfo pageInfo = null;
         try {
             List<StoreProduct> list = storeProductService.findByCondition(condition);

+ 8 - 2
mall-service/src/main/java/com/txz/mall/controller/StoreProductRuleController.java

@@ -12,10 +12,13 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.web.bind.annotation.*;
 import tk.mybatis.mapper.entity.Condition;
+import tk.mybatis.mapper.entity.Example;
 
 import javax.annotation.Resource;
+import java.util.Comparator;
 import java.util.Date;
 import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * Created by CodeGenerator on 2025/07/11.
@@ -112,11 +115,14 @@ public class StoreProductRuleController {
         PageHelper.startPage(page, size);
 
         Condition condition = new Condition(storeProductRule.getClass());
-//        Criteria criteria = condition.createCriteria();
-//        criteria.andEqualTo("name", city.getName());
+        Example.Criteria criteria = condition.createCriteria();
+        criteria.andEqualTo("isDelete", 0);
         PageInfo pageInfo = null;
         try {
             List<StoreProductRule> list = storeProductRuleService.findByCondition(condition);
+            list = list.stream()
+                    .sorted(Comparator.comparing(StoreProductRule::getCreateTime).reversed())
+                    .collect(Collectors.toList());
             pageInfo = new PageInfo(list);
         } catch (Exception e) {
             log.error("查询对象操作异常e:{}", e);

+ 15 - 9
mall-service/src/main/java/com/txz/mall/controller/UserAddressController.java

@@ -12,15 +12,18 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.web.bind.annotation.*;
 import tk.mybatis.mapper.entity.Condition;
+import tk.mybatis.mapper.entity.Example;
 
 import javax.annotation.Resource;
+import java.util.Comparator;
 import java.util.Date;
 import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * Created by CodeGenerator on 2025/07/15.
  */
-@Api(tags = "[后台]userAddress管理")
+@Api(tags = "[APP]收获地址管理")
 @RestController
 @RequestMapping("/user/address")
 public class UserAddressController {
@@ -31,7 +34,7 @@ public class UserAddressController {
     private UserAddressService userAddressService;
 
     @PostMapping("/add")
-    @ApiOperation(value = "userAddress新增")
+    @ApiOperation(value = "收获地址新增")
     public Result add(@RequestBody UserAddress userAddress) {
         if (userAddress == null) {
             return Result.fail(ResultCode.OBJECT_IS_NULL);
@@ -48,7 +51,7 @@ public class UserAddressController {
     }
 
     @PostMapping("/delete")
-    @ApiOperation(value = "userAddress删除")
+    @ApiOperation(value = "收获地址删除")
     public Result delete(@RequestParam Long id) {
         if (id == null) {
             return Result.fail(ResultCode.ID_IS_NULL);
@@ -66,7 +69,7 @@ public class UserAddressController {
     }
 
     @PostMapping("/update")
-    @ApiOperation(value = "userAddress更新")
+    @ApiOperation(value = "收获地址更新")
     public Result update(@RequestBody UserAddress userAddress) {
         if (userAddress == null) {
             return Result.fail(ResultCode.OBJECT_IS_NULL);
@@ -86,7 +89,7 @@ public class UserAddressController {
     }
 
     @PostMapping("/detail")
-    @ApiOperation(value = "userAddress获取详情")
+    @ApiOperation(value = "收获地址获取详情")
     public Result<UserAddress> detail(@RequestParam Long id) {
         if (id == null) {
             return Result.fail(ResultCode.ID_IS_NULL);
@@ -102,16 +105,19 @@ public class UserAddressController {
     }
 
     @PostMapping("/list")
-    @ApiOperation(value = "userAddress获取列表")
+    @ApiOperation(value = "收获地址获取列表")
     public Result<List<UserAddress>> list(@RequestBody UserAddress userAddress, @RequestParam(defaultValue = "1") Integer page, @RequestParam(defaultValue = "10") Integer size) {
         PageHelper.startPage(page, size);
 
         Condition condition = new Condition(userAddress.getClass());
-//        Criteria criteria = condition.createCriteria();
-//        criteria.andEqualTo("name", city.getName());
+        Example.Criteria criteria = condition.createCriteria();
+        criteria.andEqualTo("isDelete", 0);
         PageInfo pageInfo = null;
         try {
             List<UserAddress> list = userAddressService.findByCondition(condition);
+            list = list.stream()
+                    .sorted(Comparator.comparing(UserAddress::getCreateTime).reversed())
+                    .collect(Collectors.toList());
             pageInfo = new PageInfo(list);
         } catch (Exception e) {
             log.error("查询对象操作异常e:{}", e);
@@ -121,7 +127,7 @@ public class UserAddressController {
     }
 
     @PostMapping("/default")
-    @ApiOperation(value = "userAddress更新")
+    @ApiOperation(value = "收获地址更新")
     public Result defaultAddress(@RequestParam("id") Long id) {
         if (id == null) {
             return Result.fail(ResultCode.OBJECT_IS_NULL);

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

@@ -15,7 +15,7 @@ import javax.annotation.Resource;
 /**
  * Created by CodeGenerator on 2025/07/11.
  */
-@Api(tags = "[小程序]签到管理")
+@Api(tags = "[APP]签到管理")
 @RestController
 @RequestMapping("/user/sign")
 public class UserSignController {

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

@@ -2,6 +2,7 @@ package com.txz.mall.service;
 
 import com.txz.mall.core.Service;
 import com.txz.mall.model.StoreOrder;
+import com.txz.mall.vo.StoreOrderCountItemVO;
 
 
 /**
@@ -9,4 +10,12 @@ import com.txz.mall.model.StoreOrder;
  */
 public interface StoreOrderService extends Service<StoreOrder> {
 
+    /**
+     * 获取订单状态数量
+     *
+     * @param dateLimit 时间端
+     * @param type      订单类型:0普通订单,1-视频号订单, 2-全部订单
+     * @return StoreOrderCountItemResponse
+     */
+    StoreOrderCountItemVO getOrderStatusNum(String dateLimit, Integer type);
 }

+ 2 - 0
mall-service/src/main/java/com/txz/mall/service/impl/CategoryServiceImpl.java

@@ -66,6 +66,7 @@ public class CategoryServiceImpl extends AbstractService<Category> implements Ca
     private int getChildCountByPid(Long pid) {
         Condition condition = new Condition(Category.class);
         Example.Criteria criteria = condition.createCriteria();
+        criteria.andEqualTo("isDelete", 0);
         criteria.andEqualTo("pid", pid);
         List<Category> list = this.findByCondition(condition);
         return list.size();
@@ -76,6 +77,7 @@ public class CategoryServiceImpl extends AbstractService<Category> implements Ca
         List<CategoryTreeVO> treeList = new ArrayList<>();
         Condition condition = new Condition(Category.class);
         Example.Criteria criteria = condition.createCriteria();
+        criteria.andEqualTo("isDelete", 0);
         criteria.andEqualTo("type", type);
 
         if (null != categoryIdList && categoryIdList.size() > 0) {

+ 46 - 1
mall-service/src/main/java/com/txz/mall/service/impl/StoreOrderServiceImpl.java

@@ -1,9 +1,11 @@
 package com.txz.mall.service.impl;
 
+import com.txz.mall.constants.Constants;
 import com.txz.mall.core.AbstractService;
 import com.txz.mall.dao.StoreOrderMapper;
 import com.txz.mall.model.StoreOrder;
 import com.txz.mall.service.StoreOrderService;
+import com.txz.mall.vo.StoreOrderCountItemVO;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -17,6 +19,49 @@ import javax.annotation.Resource;
 @Transactional
 public class StoreOrderServiceImpl extends AbstractService<StoreOrder> implements StoreOrderService {
     @Resource
-    private StoreOrderMapper mStoreOrderMapper;
+    private StoreOrderMapper storeOrderMapper;
 
+    @Override
+    public StoreOrderCountItemVO getOrderStatusNum(String dateLimit, Integer type) {
+        StoreOrderCountItemVO response = new StoreOrderCountItemVO();
+        if (type.equals(2)) {
+            type = null;
+        }
+        // 全部订单
+        response.setAll(getCount(dateLimit, Constants.ORDER_STATUS_ALL, type));
+        // 未支付订单
+        response.setUnPaid(getCount(dateLimit, Constants.ORDER_STATUS_UNPAID, type));
+        // 未发货订单
+        response.setNotShipped(getCount(dateLimit, Constants.ORDER_STATUS_NOT_SHIPPED, type));
+        // 待收货订单
+        response.setSpike(getCount(dateLimit, Constants.ORDER_STATUS_SPIKE, type));
+        // 待评价订单
+        response.setBargain(getCount(dateLimit, Constants.ORDER_STATUS_BARGAIN, type));
+        // 交易完成订单
+        response.setComplete(getCount(dateLimit, Constants.ORDER_STATUS_COMPLETE, type));
+        // 待核销订单
+        response.setToBeWrittenOff(getCount(dateLimit, Constants.ORDER_STATUS_TOBE_WRITTEN_OFF, type));
+        // 退款中订单
+        response.setRefunding(getCount(dateLimit, Constants.ORDER_STATUS_REFUNDING, type));
+        // 已退款订单
+        response.setRefunded(getCount(dateLimit, Constants.ORDER_STATUS_REFUNDED, type));
+        // 已删除订单
+        response.setDeleted(getCount(dateLimit, Constants.ORDER_STATUS_DELETED, type));
+        return response;
+    }
+
+    private Integer getCount(String dateLimit, String status, Integer type) {
+        //总数只计算时间
+//        QueryWrapper<StoreOrder> queryWrapper = new QueryWrapper<>();
+//        if (StrUtil.isNotBlank(dateLimit)) {
+//            dateLimitUtilVo dateLimitUtilVo = DateUtil.getDateLimit(dateLimit);
+//            queryWrapper.between("create_time", dateLimitUtilVo.getStartTime(), dateLimitUtilVo.getEndTime());
+//        }
+//        getStatusWhereNew(queryWrapper, status);
+//        if (ObjectUtil.isNotNull(type)) {
+//            queryWrapper.eq("type", type);
+//        }
+//        return dao.selectCount(queryWrapper);
+        return 0;
+    }
 }

+ 1 - 0
mall-service/src/main/java/com/txz/mall/service/impl/StorePinkServiceImpl.java

@@ -35,6 +35,7 @@ public class StorePinkServiceImpl extends AbstractService<StorePink> implements
     public List<StorePinkDetailVO> getAdminList(Integer pinkId) {
         Condition condition = new Condition(StorePink.class);
         Example.Criteria criteria = condition.createCriteria();
+        criteria.andEqualTo("isDelete", 0);
         criteria.andEqualTo("id", pinkId);
         criteria.andEqualTo("kId", pinkId);
         List<StorePink> pinkList = findByCondition(condition);

+ 1 - 0
mall-service/src/main/java/com/txz/mall/service/impl/StoreProductRuleServiceImpl.java

@@ -46,6 +46,7 @@ public class StoreProductRuleServiceImpl extends AbstractService<StoreProductRul
         }
         Condition condition = new Condition(StoreProductRule.class);
         Example.Criteria criteria = condition.createCriteria();
+        criteria.andEqualTo("isDelete", 0);
         criteria.andEqualTo("ruleName", ruleName);
         return findByCondition(condition);
     }

+ 1 - 0
mall-service/src/main/java/com/txz/mall/service/impl/SystemGroupDataServiceImpl.java

@@ -26,6 +26,7 @@ public class SystemGroupDataServiceImpl extends AbstractService<SystemGroupData>
     public List<SystemGroupData> configDetail(Long groupId, Integer status) {
         Condition condition = new Condition(SystemGroupData.class);
         Example.Criteria criteria = condition.createCriteria();
+        criteria.andEqualTo("isDelete", 0);
         criteria.andEqualTo("gid", groupId);
         if (status != null) {
             criteria.andEqualTo("status", status);

+ 3 - 0
mall-service/src/main/java/com/txz/mall/service/impl/UserSignServiceImpl.java

@@ -102,6 +102,7 @@ public class UserSignServiceImpl extends AbstractService<UserSign> implements Us
     private boolean hasSignedToday(Long USER_ID) {
         Condition condition = new Condition(UserSign.class);
         Example.Criteria criteria = condition.createCriteria();
+        criteria.andEqualTo("isDelete", 0);
         criteria.andEqualTo("uid", USER_ID);
         criteria.andLike("signDate", new SimpleDateFormat("yyyy-MM-dd").format(new Date()) + "%");
         return userSignMapper.selectByCondition(condition).size() > 0;
@@ -112,6 +113,7 @@ public class UserSignServiceImpl extends AbstractService<UserSign> implements Us
         Date yesterday = DateUtils.addDays(new Date(), -1);
         Condition condition = new Condition(UserSign.class);
         Example.Criteria criteria = condition.createCriteria();
+        criteria.andEqualTo("isDelete", 0);
         criteria.andEqualTo("uid", USER_ID);
         criteria.andLike("signDate", new SimpleDateFormat("yyyy-MM-dd").format(yesterday) + "%");
         List<UserSign> list = userSignMapper.selectByCondition(condition);
@@ -134,6 +136,7 @@ public class UserSignServiceImpl extends AbstractService<UserSign> implements Us
         // 获取最新的签到记录
         Condition condition = new Condition(UserSign.class);
         Example.Criteria criteria = condition.createCriteria();
+        criteria.andEqualTo("isDelete", 0);
         criteria.andEqualTo("uid", userId);
         condition.orderBy("id").desc();
         List<UserSign> list = userSignMapper.selectByCondition(condition);

+ 2 - 0
mall-service/src/main/resources/bootstrap.properties

@@ -58,4 +58,6 @@ management.endpoint.shutdown.enabled=true
 management.endpoints.web.base-path=/${spring.application.name}
 management.endpoints.web.path-mapping.shutdown=/shutThisBoot
 management.server.address=127.0.0.1
+server.servlet.context-path=/mall
+mybatis.configuration.auto-mapping-behavior:full