Kaynağa Gözat

fixed 积分、余额记录查询

fushengqian 1 yıl önce
ebeveyn
işleme
2dea874379

+ 5 - 0
fuint-application/src/main/java/com/fuint/common/service/impl/BalanceServiceImpl.java

@@ -19,6 +19,7 @@ import com.fuint.repository.mapper.MtBalanceMapper;
 import com.fuint.repository.mapper.MtUserMapper;
 import com.fuint.repository.model.MtBalance;
 import com.fuint.repository.model.MtBanner;
+import com.fuint.repository.model.MtPoint;
 import com.fuint.repository.model.MtUser;
 import com.github.pagehelper.Page;
 import com.github.pagehelper.PageHelper;
@@ -85,6 +86,10 @@ public class BalanceServiceImpl extends ServiceImpl<MtBalanceMapper, MtBalance>
         if (StringUtils.isNotBlank(mobile)) {
             lambdaQueryWrapper.eq(MtBalance::getMobile, mobile);
         }
+        String storeId = paginationRequest.getSearchParams().get("storeId") == null ? "" : paginationRequest.getSearchParams().get("storeId").toString();
+        if (StringUtils.isNotBlank(storeId)) {
+            lambdaQueryWrapper.eq(MtBalance::getStoreId, storeId);
+        }
 
         lambdaQueryWrapper.orderByDesc(MtBalance::getId);
         List<MtBalance> balanceList = mtBalanceMapper.selectList(lambdaQueryWrapper);

+ 4 - 0
fuint-application/src/main/java/com/fuint/common/service/impl/PointServiceImpl.java

@@ -76,6 +76,10 @@ public class PointServiceImpl extends ServiceImpl<MtPointMapper, MtPoint> implem
         if (StringUtils.isNotBlank(userId)) {
             lambdaQueryWrapper.eq(MtPoint::getUserId, userId);
         }
+        String storeId = paginationRequest.getSearchParams().get("storeId") == null ? "" : paginationRequest.getSearchParams().get("storeId").toString();
+        if (StringUtils.isNotBlank(storeId)) {
+            lambdaQueryWrapper.eq(MtPoint::getStoreId, storeId);
+        }
 
         lambdaQueryWrapper.orderByDesc(MtPoint::getId);
         List<MtPoint> pointList = mtPointMapper.selectList(lambdaQueryWrapper);

+ 5 - 2
fuint-application/src/main/java/com/fuint/module/backendApi/controller/BackendBalanceController.java

@@ -81,7 +81,6 @@ public class BackendBalanceController extends BaseController {
         if (accountInfo == null) {
             return getFailureResult(1001, "请先登录");
         }
-
         Map<String, Object> searchParams = new HashMap<>();
         if (StringUtil.isNotEmpty(mobile)) {
             searchParams.put("mobile", mobile);
@@ -95,6 +94,10 @@ public class BackendBalanceController extends BaseController {
         if (StringUtil.isNotEmpty(status)) {
             searchParams.put("status", status);
         }
+        Integer storeId = accountInfo.getStoreId();
+        if (storeId != null && storeId > 0) {
+            searchParams.put("storeId", storeId);
+        }
 
         PaginationRequest paginationRequest = new PaginationRequest();
         paginationRequest.setCurrentPage(page);
@@ -111,7 +114,7 @@ public class BackendBalanceController extends BaseController {
     /**
      * 提交充值
      *
-     * @param request  HttpServletRequest对象
+     * @param request HttpServletRequest对象
      * @return
      */
     @ApiOperation(value = "提交充值")

+ 5 - 0
fuint-application/src/main/java/com/fuint/module/backendApi/controller/BackendPointController.java

@@ -102,6 +102,11 @@ public class BackendPointController extends BaseController {
             searchParams.put("status", status);
         }
 
+        Integer storeId = accountInfo.getStoreId();
+        if (storeId != null && storeId > 0) {
+            searchParams.put("storeId", storeId);
+        }
+
         paginationRequest.setSearchParams(searchParams);
         PaginationResponse<PointDto> paginationResponse = pointService.queryPointListByPagination(paginationRequest);
 

+ 3 - 1
fuint-repository/src/main/java/com/fuint/repository/model/MtBalance.java

@@ -29,6 +29,9 @@ public class MtBalance implements Serializable {
     @TableId(value = "ID", type = IdType.AUTO)
     private Integer id;
 
+    @ApiModelProperty("所属店铺ID")
+    private Integer storeId;
+
     @ApiModelProperty("手机号")
     private String mobile;
 
@@ -56,5 +59,4 @@ public class MtBalance implements Serializable {
     @ApiModelProperty("状态,A正常;D作废")
     private String status;
 
-
 }

+ 5 - 5
fuint-repository/src/main/java/com/fuint/repository/model/MtPoint.java

@@ -11,9 +11,7 @@ import lombok.Getter;
 import lombok.Setter;
 
 /**
- * <p>
- * 积分变化表
- * </p>
+ * 会员积分记录表
  *
  * Created by FSQ
  * CopyRight https://www.fuint.cn
@@ -21,7 +19,7 @@ import lombok.Setter;
 @Getter
 @Setter
 @TableName("mt_point")
-@ApiModel(value = "MtPoint对象", description = "积分变化表")
+@ApiModel(value = "MtPoint对象", description = "会员积分记录表")
 public class MtPoint implements Serializable {
 
     private static final long serialVersionUID = 1L;
@@ -30,6 +28,9 @@ public class MtPoint implements Serializable {
     @TableId(value = "ID", type = IdType.AUTO)
     private Integer id;
 
+    @ApiModelProperty("所属店铺ID")
+    private Integer storeId;
+
     @ApiModelProperty("用户ID")
     private Integer userId;
 
@@ -54,5 +55,4 @@ public class MtPoint implements Serializable {
     @ApiModelProperty("状态,A正常;D作废")
     private String status;
 
-
 }