xuhaifeng 3 долоо хоног өмнө
parent
commit
139d5f7b42

+ 1 - 1
admin-ui/src/views/app/user/index.vue

@@ -589,7 +589,7 @@ export default {
                 this.userViewForm = {
                     appUserId: row.id,
                     pageNum: 1,
-                    pageSize: 15
+                    pageSize: 10
                 }
                 this.activeValue = '1'
                 this.getMemberCouponData()

+ 1 - 1
admin-ui/src/views/goods/goodsComment/index.vue

@@ -360,7 +360,7 @@ export default {
             queryCommentReply: {
                 goodsCommentId: 0,
                 pageNum: 1,
-                pageSize: 15
+                pageSize: 10
             },
             ReplyCommentLoading: false,
             ReplyCommenttotal: 0,

+ 1 - 1
admin-ui/src/views/order/statistics/charge.vue

@@ -150,7 +150,7 @@ export default {
       // 查询参数
       queryParams: {
         pageNum: 1,
-        pageSize: 15,
+        pageSize: 10,
         startDate: undefined,
         endDate: undefined
       },

+ 1 - 1
admin-ui/src/views/order/statistics/chargeStore.vue

@@ -154,7 +154,7 @@ export default {
       // 查询参数
       queryParams: {
         pageNum: 1,
-        pageSize: 15,
+        pageSize: 10,
         storeType: '',
         startDate: undefined,
         endDate: undefined

+ 1 - 1
admin-ui/src/views/order/statistics/factory/bystore.vue

@@ -151,7 +151,7 @@ export default {
       // 查询参数
       queryParams: {
         pageNum: 1,
-        pageSize: 15,
+        pageSize: 10,
         startDate: null,
         endDate: null,
         storeId: null

+ 13 - 14
yiqi-admin/src/main/java/com/yiqi/admin/controller/settlement/SettlementStoreStatisticsController.java

@@ -1,11 +1,11 @@
 package com.yiqi.admin.controller.settlement;
 
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.yiqi.common.constant.UrlConstants;
 import com.yiqi.common.core.controller.BaseController;
 import com.yiqi.common.core.domain.AjaxResult;
 import com.yiqi.common.core.page.TableDataInfo;
 import com.yiqi.common.utils.DateUtils;
-import com.yiqi.common.utils.SecurityUtils;
 import com.yiqi.common.utils.poi.ExcelUtil;
 import com.yiqi.core.domain.SettlementStoreStatistics;
 import com.yiqi.core.service.ISettlementStoreStatisticsService;
@@ -87,7 +87,7 @@ public class SettlementStoreStatisticsController extends BaseController {
         Long storeId = getLoginUser().getStoreId();
 
         // 获取订单统计趋势
-        List<SettlementStoreStatistics> orderTrend = settlementStoreStatisticsService.generateStoreStatisticsByDate(storeId, start, end);
+        List<SettlementStoreStatistics> orderTrend = settlementStoreStatisticsService.queryStoreStatisticsByDate(storeId, start, end);
 
         // 获取充值统计趋势
         List<StoreChargeStatistics> chargeTrend = settlementStoreStatisticsService.generateChargeStatisticsByDate(storeId, start, end);
@@ -114,7 +114,7 @@ public class SettlementStoreStatisticsController extends BaseController {
         Long storeId = getLoginUser().getStoreId();
 
         List<SettlementStoreStatistics> list = settlementStoreStatisticsService
-                .generateStoreStatisticsByDate(storeId, start, end);
+                .queryStoreStatisticsByDate(storeId, start, end);
         return getDataTable(list);
     }
 
@@ -152,14 +152,13 @@ public class SettlementStoreStatisticsController extends BaseController {
      */
     @GetMapping("/charge/bystore")
     public TableDataInfo chargeByStore(@RequestParam(required = false) String startDate,
+                                       @RequestParam(required = false) Integer storeType,
                                        @RequestParam(required = false) Long storeId,
                                        @RequestParam(defaultValue = "1") Integer pageNum,
-                                       @RequestParam(defaultValue = "15") Integer pageSize) {
-
-        startPage();
+                                       @RequestParam(defaultValue = "10") Integer pageSize) {
         Date start = startDate != null ? DateUtils.parseDate(startDate) : DateUtils.addDays(new Date(), -1);
-        List<StoreChargeStatistics> chargeTrend = settlementStoreStatisticsService.generateChargeStatisticsByStore(storeId, start);
-        return getDataTable(chargeTrend);
+        Page<StoreChargeStatistics> chargeTrend = settlementStoreStatisticsService.generateChargeStatisticsByStore(storeId, storeType, start, pageSize, pageNum);
+        return getDataTable(chargeTrend.getRecords(), chargeTrend.getTotal());
     }
 
     /**
@@ -167,12 +166,12 @@ public class SettlementStoreStatisticsController extends BaseController {
      */
     @PostMapping("/charge/export/bystore")
     public void chargeExport(HttpServletResponse response, @RequestParam(required = false) String startDate,
+                             @RequestParam(required = false) Integer storeType,
                              @RequestParam(required = false) Long storeId) {
-
         Date start = startDate != null ? DateUtils.parseDate(startDate) : DateUtils.addDays(new Date(), -1);
-        List<StoreChargeStatistics> chargeTrend = settlementStoreStatisticsService.generateChargeStatisticsByStore(storeId, start);
+        Page<StoreChargeStatistics> chargeTrend = settlementStoreStatisticsService.generateChargeStatisticsByStore(storeId, storeType, start, 500, 1);
         ExcelUtil<StoreChargeStatistics> util = new ExcelUtil<>(StoreChargeStatistics.class);
-        util.exportExcel(response, chargeTrend, "门店每日充值统计");
+        util.exportExcel(response, chargeTrend.getRecords(), "门店每日充值统计");
     }
 
     /**
@@ -217,8 +216,8 @@ public class SettlementStoreStatisticsController extends BaseController {
      */
     @PostMapping("/list/bystore/export")
     public void storeExport(@RequestParam(required = false) String startDate,
-                                     @RequestParam(required = false) String endDate,
-                                     @RequestParam(required = false) Long storeId,
+                            @RequestParam(required = false) String endDate,
+                            @RequestParam(required = false) Long storeId,
                             HttpServletResponse response) {
 
         if (getStoreId() != null) {
@@ -244,7 +243,7 @@ public class SettlementStoreStatisticsController extends BaseController {
         Long storeId = getLoginUser().getStoreId();
 
         List<SettlementStoreStatistics> list = settlementStoreStatisticsService
-                .generateStoreStatisticsByDate(storeId, start, end);
+                .queryStoreStatisticsByDate(storeId, start, end);
 
         ExcelUtil<SettlementStoreStatistics> util = new ExcelUtil<>(SettlementStoreStatistics.class);
         util.exportExcel(response, list, "门店按日期交易统计");

+ 1 - 9
yiqi-api/src/main/java/com/yiqi/api/controller/order/WeAppOrderClothController.java

@@ -245,15 +245,7 @@ public class WeAppOrderClothController {
         //2=待付款,3=服务中,4=待配送,5=配送中,6=待取衣(到店自取),7=待评价,8=已完成,100=已取消
         if ("2".equals(orderClothAppQueryDTO.getOrderStatus())) {
             queryWrapper.and(orderClothLambdaQueryWrapper -> orderClothLambdaQueryWrapper
-                    .eq(OrderCloth::getOrderStatus, ClothOrderStatusType.APPOINTMENT.getCode())
-                    .or()
-                    .eq(OrderCloth::getOrderStatus, ClothOrderStatusType.WAITING_TO_DOOR.getCode())
-                    .or()
-                    .eq(OrderCloth::getOrderStatus, ClothOrderStatusType.HAS_TO_DOOR.getCode())
-                    .or()
-                    .eq(OrderCloth::getOrderStatus, ClothOrderStatusType.HAS_TAKING.getCode())
-                    .or()
-                    .eq(OrderCloth::getOrderStatus, ClothOrderStatusType.WAITING_FOR_PAY.getCode())
+                    .eq(OrderCloth::getPayStatus, PayStatus.WAITING_TO_PAY.getCode())
             );
         }
         if ("3".equals(orderClothAppQueryDTO.getOrderStatus())) {

+ 8 - 5
yiqi-common/src/main/java/com/yiqi/common/enums/RechargeRefundStatusType.java

@@ -5,15 +5,18 @@ package com.yiqi.common.enums;
  *
  *
  * @author ruoyi
+ *
+ *
+ *
  */
 public enum RechargeRefundStatusType {
     OK("0", "正常"),
     REFUND_APPLYING("1", "退款申请中"),
-    REFUNDING("2", "退款处理中"),
-    REFUND_AGREE("3", "退款成功"),
-    REFUND_REFUSE("8", "退款拒绝"),
-    REFUND_CANCEL("9", "退款取消"),
-    ERROR("-1", "退款异常"),
+    REFUNDING("2", "退款中"),
+    REFUND_SUCCESS("3", "退款成功"),
+    REFUND_CANCEL("-1", "退款取消"),
+    REFUND_REFUSE("-2", "退款驳回"),
+    ERROR("-3", "退款失败"),
 ;
     private final String code;
     private final String info;

+ 3 - 2
yiqi-common/src/main/java/com/yiqi/core/service/ISettlementStoreStatisticsService.java

@@ -3,6 +3,7 @@ package com.yiqi.core.service;
 import java.util.Date;
 import java.util.List;
 
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.yiqi.core.domain.SettlementStoreStatistics;
 import com.yiqi.order.domain.dto.SettlementFactoryStatisticsDto;
@@ -30,7 +31,7 @@ public interface ISettlementStoreStatisticsService extends IService<SettlementSt
      *
      * @return 门店每日统计集合
      */
-    List<SettlementStoreStatistics> generateStoreStatisticsByDate(Long storeId, Date start, Date end);
+    List<SettlementStoreStatistics> queryStoreStatisticsByDate(Long storeId, Date start, Date end);
 
 
     /**
@@ -103,7 +104,7 @@ public interface ISettlementStoreStatisticsService extends IService<SettlementSt
      * @param start
      * @return
      */
-    List<StoreChargeStatistics> generateChargeStatisticsByStore(Long storeId, Date start);
+    Page<StoreChargeStatistics> generateChargeStatisticsByStore(Long storeId, Integer storeType, Date start, Integer pageSize, Integer pageNum );
 
     /**
      * 查询门店每日统计列表

+ 2 - 2
yiqi-core/src/main/java/com/yiqi/app/service/impl/AppCouponItemServiceImpl.java

@@ -354,14 +354,14 @@ public class AppCouponItemServiceImpl extends ServiceImpl<AppCouponItemMapper, A
 
     @Override
     public int countTodaySendNumber(String dateTimeNow) {
-        return baseMapper.countTodaySendNumber(SecurityUtils.getLoginUser().getOrgId(),
+        return baseMapper.countTodaySendNumber(SecurityUtils.getLoginUser().getStoreId(),
                 SecurityUtils.getLoginUser().getSourceType(),
                 dateTimeNow);
     }
 
     @Override
     public int countTodayHxNumber(String dateTimeNow) {
-        return baseMapper.countTodayHxNumber(SecurityUtils.getLoginUser().getOrgId(),
+        return baseMapper.countTodayHxNumber(SecurityUtils.getLoginUser().getStoreId(),
                 SecurityUtils.getLoginUser().getSourceType(),
                 dateTimeNow);
     }

+ 10 - 0
yiqi-core/src/main/java/com/yiqi/core/mapper/SettlementStoreStatisticsMapper.java

@@ -87,6 +87,16 @@ public interface SettlementStoreStatisticsMapper extends BaseMapper<SettlementSt
     SettlementStoreStatistics orderStatisticsByDate(@Param("storeId") Long storeId, @Param("day") Integer day);
 
 
+    /**
+     * 查询订单统计
+     *
+     * @param storeId 门店id
+     * @param day 开始日期
+     * @return 结果
+     */
+    List<SettlementStoreStatistics> queryStoreStatisticsByDate(@Param("storeId") Long storeId,  @Param("startDay") Integer startDay, @Param("endDay") Integer endDay);
+
+
     /**
      * 查询订单统计
      *

+ 17 - 11
yiqi-core/src/main/java/com/yiqi/core/service/impl/SettlementStoreStatisticsServiceImpl.java

@@ -8,6 +8,7 @@ import cn.binarywang.wx.miniapp.api.WxMaShopAfterSaleService;
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.date.DateUtil;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.yiqi.common.enums.*;
 import com.yiqi.common.utils.CurrencyUtil;
 import com.yiqi.common.utils.DateUtils;
@@ -76,12 +77,10 @@ public class SettlementStoreStatisticsServiceImpl extends ServiceImpl<Settlement
     }
 
     @Override
-    public List<SettlementStoreStatistics> generateStoreStatisticsByDate(Long storeId, Date start, Date end) {
+    public List<SettlementStoreStatistics> queryStoreStatisticsByDate(Long storeId, Date start, Date end) {
         Integer startDay = Integer.parseInt(DateUtil.format(start, "yyyyMMdd"));
         Integer endDay = Integer.parseInt(DateUtil.format(end, "yyyyMMdd"));
-        List<SettlementStoreStatistics> result = baseMapper.selectList(new QueryWrapper<SettlementStoreStatistics>().lambda()
-                .eq(SettlementStoreStatistics::getStoreId, storeId)
-                .between(SettlementStoreStatistics::getDay, startDay, endDay));
+        List<SettlementStoreStatistics> result = baseMapper.queryStoreStatisticsByDate(storeId, startDay, endDay);
         return result;
     }
 
@@ -287,7 +286,7 @@ public class SettlementStoreStatisticsServiceImpl extends ServiceImpl<Settlement
             // 2. 查询门店当日充值退款记录
             List<OrderRechargeRefund> refundList = orderRechargeRefundService.list(new QueryWrapper<OrderRechargeRefund>().lambda()
                     .eq(storeId != null, OrderRechargeRefund::getStoreId, storeId)
-                    .eq(OrderRechargeRefund::getRefundStatus, RechargeRefundStatusType.REFUND_AGREE.getCode())
+                    .eq(OrderRechargeRefund::getRefundStatus, RechargeRefundStatusType.REFUND_SUCCESS.getCode())
                     .eq(OrderRechargeRefund::getDelFlag, StatusType.OK.getCode())
                     .between(OrderRechargeRefund::getRefundTime, DateUtils.getStartTime(date), DateUtils.getEndTime(date)));
             // 3. 构建统计实体
@@ -317,7 +316,7 @@ public class SettlementStoreStatisticsServiceImpl extends ServiceImpl<Settlement
             // 2. 查询门店当日充值退款记录
             List<OrderRechargeRefund> refundList = orderRechargeRefundService.list(new QueryWrapper<OrderRechargeRefund>().lambda()
                     .eq(storeId != 0L, OrderRechargeRefund::getStoreId, storeId)
-                    .eq(OrderRechargeRefund::getRefundStatus, RechargeRefundStatusType.REFUND_AGREE.getCode())
+                    .eq(OrderRechargeRefund::getRefundStatus, RechargeRefundStatusType.REFUND_SUCCESS.getCode())
                     .eq(OrderRechargeRefund::getDelFlag, StatusType.OK.getCode())
                     .between(OrderRechargeRefund::getRefundTime, startDate, endDate));
 
@@ -364,17 +363,22 @@ public class SettlementStoreStatisticsServiceImpl extends ServiceImpl<Settlement
     }
 
     @Override
-    public List<StoreChargeStatistics> generateChargeStatisticsByStore(Long storeId, Date start) {
+    public Page<StoreChargeStatistics> generateChargeStatisticsByStore(Long storeId, Integer storeType, Date start, Integer pageSize, Integer pageNum) {
         // 1. 获取所有有效门店
         QueryWrapper queryWrapper = new QueryWrapper();
         queryWrapper.eq("del_flag", StatusType.OK.getCode());
         if (storeId != null) {
             queryWrapper.eq("store_id", storeId);
         }
-        List<SysStore> storeList = storeService.list(queryWrapper);
+        if(storeType != null){
+            queryWrapper.eq("store_type", storeType);
+        }
+        Page<StoreChargeStatistics> pageRes = new Page<>(pageNum, pageSize);
+        Page page = new Page<>(pageNum, pageSize);
+        Page<SysStore> storeList = storeService.page(page, queryWrapper);
         List<StoreChargeStatistics> resultList = new ArrayList<>();
         // 2. 遍历门店生成统计数据
-        for (SysStore store : storeList) {
+        for (SysStore store : storeList.getRecords()) {
             try {
                 // 1. 查询门店当日充值记录
                 List<OrderRecharge> rechargeList = orderRechargeService.list(new QueryWrapper<OrderRecharge>().lambda()
@@ -386,7 +390,7 @@ public class SettlementStoreStatisticsServiceImpl extends ServiceImpl<Settlement
                 // 2. 查询门店当日充值退款记录
                 List<OrderRechargeRefund> refundList = orderRechargeRefundService.list(new QueryWrapper<OrderRechargeRefund>().lambda()
                         .eq(OrderRechargeRefund::getStoreId, storeId)
-                        .eq(OrderRechargeRefund::getRefundStatus, RechargeRefundStatusType.REFUND_AGREE.getCode())
+                        .eq(OrderRechargeRefund::getRefundStatus, RechargeRefundStatusType.REFUND_SUCCESS.getCode())
                         .eq(OrderRechargeRefund::getDelFlag, StatusType.OK.getCode())
                         .between(OrderRechargeRefund::getRefundTime, DateUtils.getStartTime(start), DateUtils.getEndTime(start)));
                 // 4.1 构建统计实体
@@ -401,7 +405,9 @@ public class SettlementStoreStatisticsServiceImpl extends ServiceImpl<Settlement
                 log.error("统计门店[{}]每日充值统计失败: {}", store.getId(), e.getMessage());
             }
         }
-        return resultList;
+        pageRes.setRecords(resultList);
+        pageRes.setTotal(storeList.getTotal());
+        return pageRes;
     }
 
 

+ 4 - 4
yiqi-core/src/main/java/com/yiqi/order/service/impl/OrderRechargeServiceImpl.java

@@ -342,11 +342,11 @@ public class OrderRechargeServiceImpl extends ServiceImpl<OrderRechargeMapper, O
         rechargePasswordCardService.updateById(card);
 
         // 2. 更新订单状态
-        orderRecharge.setRefundStatus(RechargeRefundStatusType.REFUND_AGREE.getCode());
+        orderRecharge.setRefundStatus(RechargeRefundStatusType.REFUND_SUCCESS.getCode());
         updateById(orderRecharge);
 
         // 3. 更新退款申请状态
-        refundOrder.setRefundStatus(RechargeRefundStatusType.REFUND_AGREE.getCode());
+        refundOrder.setRefundStatus(RechargeRefundStatusType.REFUND_SUCCESS.getCode());
         orderRechargeRefundService.updateById(refundOrder);
 
         return 1;
@@ -1266,11 +1266,11 @@ public class OrderRechargeServiceImpl extends ServiceImpl<OrderRechargeMapper, O
         //查询退款订单
         OrderRechargeRefund orderRechargeRefund = orderRechargeRefundService.selectOrderRechargeOrderNo(orderNo);
         orderRecharge.setRefundAmount(CurrencyUtil.add(orderRechargeRefund.getRefundAmount(), orderRechargeRefund.getRefundAmount()));
-        orderRecharge.setRefundStatus(RechargeRefundStatusType.REFUND_AGREE.getCode());
+        orderRecharge.setRefundStatus(RechargeRefundStatusType.REFUND_SUCCESS.getCode());
         this.updateById(orderRecharge);
 
         // 3. 更新退款申请状态
-        orderRechargeRefund.setRefundStatus(RechargeRefundStatusType.REFUND_AGREE.getCode());
+        orderRechargeRefund.setRefundStatus(RechargeRefundStatusType.REFUND_SUCCESS.getCode());
         orderRechargeRefundService.updateById(orderRechargeRefund);
 
         RechargePasswordCard rechargePasswordCard = rechargePasswordCardService.getOne(new QueryWrapper<RechargePasswordCard>().lambda()

+ 3 - 3
yiqi-core/src/main/resources/mapper/app/AppCouponItemMapper.xml

@@ -376,7 +376,7 @@
     </select>
     <select id="countTodaySendNumber" resultType="java.lang.Integer">
         select count(*) from app_coupon_item
-        where store_id = #{orgId}  and activity_info_id is not null
+        where store_id = #{orgId} and source = 'storeSend'
         <if test="dateTimeNow != null and dateTimeNow !=''">
             <![CDATA[and create_time >= concat(#{dateTimeNow}, ' 00:00:00')]]>
             <![CDATA[and create_time <= concat(#{dateTimeNow}, ' 23:59:59')]]>
@@ -386,8 +386,8 @@
         select count(*) from app_coupon_item
         where used_store_id = #{orgId}
         <if test="dateTimeNow != null and dateTimeNow !=''">
-            <![CDATA[and update_time >= concat(#{dateTimeNow}, ' 00:00:00')]]>
-            <![CDATA[and update_time <= concat(#{dateTimeNow}, ' 23:59:59')]]>
+            <![CDATA[and used_time >= concat(#{dateTimeNow}, ' 00:00:00')]]>
+            <![CDATA[and used_time <= concat(#{dateTimeNow}, ' 23:59:59')]]>
         </if>
     </select>
 </mapper>

+ 7 - 0
yiqi-core/src/main/resources/mapper/core/SettlementStoreStatisticsMapper.xml

@@ -483,6 +483,13 @@
     </if>
         and  store_id !=0 group by store_id order by clothOrderAmount desc
     </select>
+    <select id="queryStoreStatisticsByDate" resultType="com.yiqi.core.domain.SettlementStoreStatistics">
+        select * from settlement_store_statistics where day >= #{startDay} and day &lt;= #{endDay}
+        <if test="storeId != null">
+            and store_id = #{storeId}
+        </if>
+        order by day desc
+    </select>
 
 
 </mapper>