Browse Source

活跃会员数统计功能

fushengqian 1 year ago
parent
commit
8caea9d15b

+ 4 - 3
fuint-application/src/main/java/com/fuint/common/service/impl/ConfirmLogServiceImpl.java

@@ -145,9 +145,10 @@ public class ConfirmLogServiceImpl extends ServiceImpl<MtConfirmLogMapper, MtCon
 
     /**
      * 获取卡券核销数量
-     * @param storeId   店铺ID
-     * @param beginTime 开始时间
-     * @param endTime   结束时间
+     * @param merchantId 商户ID
+     * @param storeId    店铺ID
+     * @param beginTime  开始时间
+     * @param endTime    结束时间
      * @return
      * */
     @Override

+ 1 - 0
fuint-application/src/main/java/com/fuint/common/service/impl/MemberServiceImpl.java

@@ -123,6 +123,7 @@ public class MemberServiceImpl extends ServiceImpl<MtUserMapper, MtUser> impleme
                         MtUserAction mtUserAction = new MtUserAction();
                         mtUserAction.setUserId(mtUser.getId());
                         mtUserAction.setStoreId(mtUser.getStoreId());
+                        mtUserAction.setMerchantId(mtUser.getMerchantId());
                         mtUserAction.setParam(TimeUtils.formatDate(activeTime, "yyyy-MM-dd HH:mm:ss"));
                         mtUserAction.setAction(UserActionEnum.LOGIN.getKey());
                         mtUserAction.setDescription(UserActionEnum.LOGIN.getValue());

+ 9 - 0
fuint-application/src/main/java/com/fuint/common/service/impl/UserActionServiceImpl.java

@@ -50,6 +50,14 @@ public class UserActionServiceImpl extends ServiceImpl<MtUserActionMapper, MtUse
         if (StringUtils.isNotBlank(description)) {
             lambdaQueryWrapper.like(MtUserAction::getDescription, description);
         }
+        String merchantId = paginationRequest.getSearchParams().get("merchantId") == null ? "" : paginationRequest.getSearchParams().get("merchantId").toString();
+        if (StringUtils.isNotBlank(merchantId)) {
+            lambdaQueryWrapper.eq(MtUserAction::getMerchantId, merchantId);
+        }
+        String storeId = paginationRequest.getSearchParams().get("storeId") == null ? "" : paginationRequest.getSearchParams().get("storeId").toString();
+        if (StringUtils.isNotBlank(storeId)) {
+            lambdaQueryWrapper.eq(MtUserAction::getStoreId, storeId);
+        }
         String status = paginationRequest.getSearchParams().get("status") == null ? "" : paginationRequest.getSearchParams().get("status").toString();
         if (StringUtils.isNotBlank(status)) {
             lambdaQueryWrapper.eq(MtUserAction::getStatus, status);
@@ -93,6 +101,7 @@ public class UserActionServiceImpl extends ServiceImpl<MtUserActionMapper, MtUse
             MtUserAction mtUserAction = new MtUserAction();
             mtUserAction.setAction(reqUserAction.getAction());
             mtUserAction.setUserId(reqUserAction.getUserId());
+            mtUserAction.setMerchantId(reqUserAction.getMerchantId());
             mtUserAction.setStoreId(reqUserAction.getStoreId());
             mtUserAction.setParam(reqUserAction.getParam());
             mtUserAction.setOperator(reqUserAction.getOperator());

+ 1 - 1
fuint-application/src/main/java/com/fuint/module/backendApi/controller/BackendMemberController.java

@@ -261,7 +261,7 @@ public class BackendMemberController extends BaseController {
         } else {
             memberInfo = memberService.queryMemberById(Integer.parseInt(id));
         }
-
+        memberInfo.setMerchantId(accountInfo.getMerchantId());
         memberInfo.setName(name);
         memberInfo.setStatus(status);
         memberInfo.setGradeId(gradeId);

+ 1 - 1
fuint-repository/src/main/java/com/fuint/repository/mapper/MtConfirmLogMapper.java

@@ -16,7 +16,7 @@ public interface MtConfirmLogMapper extends BaseMapper<MtConfirmLog> {
 
     Long getConfirmNum(@Param("userCouponId") Integer userCouponId);
 
-    Long getConfirmLogCount(@Param("userCouponId") Integer merchantId, @Param("userCouponId") Integer storeId, @Param("beginTime") Date beginTime, @Param("endTime") Date endTime);
+    Long getConfirmLogCount(@Param("merchantId") Integer merchantId, @Param("storeId") Integer storeId, @Param("beginTime") Date beginTime, @Param("endTime") Date endTime);
 
     List<MtConfirmLog> getOrderConfirmLogList(@Param("orderId") Integer orderId);