Переглянути джерело

新增展示积分明细的接口

tags/V1.8.0^2
douzhenjun 1 рік тому
джерело
коміт
6ba5fcfe18
5 змінених файлів з 66 додано та 0 видалено
  1. +8
    -0
      tuoheng-api/src/main/java/com/tuoheng/api/controller/MyController.java
  2. +5
    -0
      tuoheng-api/src/main/java/com/tuoheng/api/entity/domain/UserPointsDetail.java
  3. +2
    -0
      tuoheng-api/src/main/java/com/tuoheng/api/service/IUserPointsDetailService.java
  4. +26
    -0
      tuoheng-api/src/main/java/com/tuoheng/api/service/impl/UserPointsDetailServiceImpl.java
  5. +25
    -0
      tuoheng-api/src/main/java/com/tuoheng/api/utils/PointsTitleConstants.java

+ 8
- 0
tuoheng-api/src/main/java/com/tuoheng/api/controller/MyController.java Переглянути файл

@@ -32,4 +32,12 @@ public class MyController {
public JsonResult exchange(UserPointsDetailQuery userPointsDetailQuery) {
return userPointsDetailService.exchange(userPointsDetailQuery);
}
/**
* 我的积分明细
*/
@GetMapping("/pointsDetail")
public JsonResult pointsDetail(UserPointsDetailQuery userPointsDetailQuery){
return userPointsDetailService.pointsDetail(userPointsDetailQuery);
}
}

+ 5
- 0
tuoheng-api/src/main/java/com/tuoheng/api/entity/domain/UserPointsDetail.java Переглянути файл

@@ -61,6 +61,11 @@ public class UserPointsDetail extends BaseEntity implements Serializable {
* 操作人名称
*/
private String operatorName;
/**
* 变动活动名称
*/
private String changeName;

/**
* 商铺名称

+ 2
- 0
tuoheng-api/src/main/java/com/tuoheng/api/service/IUserPointsDetailService.java Переглянути файл

@@ -13,4 +13,6 @@ import com.tuoheng.common.utils.JsonResult;
*/
public interface IUserPointsDetailService extends IBaseService<UserPointsDetail> {
JsonResult exchange(UserPointsDetailQuery userPointsDetailQuery);
JsonResult pointsDetail(UserPointsDetailQuery userPointsDetailQuery);
}

+ 26
- 0
tuoheng-api/src/main/java/com/tuoheng/api/service/impl/UserPointsDetailServiceImpl.java Переглянути файл

@@ -17,6 +17,9 @@ import com.tuoheng.common.utils.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
* 全民护河公告表 服务实现类
*
@@ -72,4 +75,27 @@ public class UserPointsDetailServiceImpl extends BaseServiceImpl<UserPointsDetai
}
return JsonResult.success(pageData);
}

@Override
public JsonResult pointsDetail(UserPointsDetailQuery userPointsDetailQuery) {
Integer tenantId = userPointsDetailQuery.getTenantId();
String openid = userPointsDetailQuery.getOpenid();
List<UserPointsDetail> userPointsDetailResult = new ArrayList<>();
List<UserPointsDetail> userPointsDetailList = userPointsDetailMapper.selectList(new LambdaQueryWrapper<UserPointsDetail>()
.eq(UserPointsDetail::getTenantId, tenantId)
.eq(UserPointsDetail::getOpenid, openid)
.eq(UserPointsDetail::getMark, 1)
.isNotNull(UserPointsDetail::getChangeName));
for (UserPointsDetail userPointsDetail : userPointsDetailList) {
UserPointsDetail userPointsDetail1 = new UserPointsDetail();
userPointsDetail1.setChangeName(userPointsDetail.getChangeName());
userPointsDetail1.setCreateTime(userPointsDetail.getCreateTime());
if(userPointsDetail.getType().equals(1)){
userPointsDetail1.setPointsChange(userPointsDetail.getPointsChange());
}else{
userPointsDetail1.setPointsChange(-1 * userPointsDetail.getPointsChange());
}
}
return null;
}
}

+ 25
- 0
tuoheng-api/src/main/java/com/tuoheng/api/utils/PointsTitleConstants.java Переглянути файл

@@ -0,0 +1,25 @@
package com.tuoheng.api.utils;

/**
* @Description
* @Author douzhenjun
* @DATE 2023/6/6
**/
public class PointsTitleConstants {
public static final String EXCHANGE_PRODUCTS = "兑换商品";
public static final String SUBMIT_PICTURE = "上传美拍";
public static final String SUBMIT_FEEDBACK = "河湖问题反馈";
public static final String VOLUNTEER_ACTIVITY = "参与志愿者活动";
public static final String PROTECT_RIVER_SUGGESTION = "护河建议";
public static final String FOLLOW_TIKTOK = "关注抖音";
public static final String WATCH_VIDEO = "观看学习视频";
public static final String USER_REGISTRY = "用户注册";
}

Завантаження…
Відмінити
Зберегти