Browse Source

新增展示积分明细的接口修改称分页

tags/V1.8.0^2
douzhenjun 1 year ago
parent
commit
81004ad12c
1 changed files with 20 additions and 13 deletions
  1. +20
    -13
      tuoheng-api/src/main/java/com/tuoheng/api/service/impl/UserPointsDetailServiceImpl.java

+ 20
- 13
tuoheng-api/src/main/java/com/tuoheng/api/service/impl/UserPointsDetailServiceImpl.java View File

@@ -80,23 +80,30 @@ public class UserPointsDetailServiceImpl extends BaseServiceImpl<UserPointsDetai
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>()
// List<UserPointsDetail> userPointsDetailResult = new ArrayList<>();
IPage<UserPointsDetail> page = new Page<UserPointsDetail>(userPointsDetailQuery.getPage(), userPointsDetailQuery.getLimit());
IPage<UserPointsDetail> userPointsDetailList = userPointsDetailMapper.selectPage(page, 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());
userPointsDetailList.convert(x -> {
if(x.getType().equals(2)){
x.setPointsChange(-1*x.getPointsChange());
}
userPointsDetailResult.add(userPointsDetail1);
}
return JsonResult.success(userPointsDetailResult);
return x;
});
// 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());
// }
// userPointsDetailResult.add(userPointsDetail1);
// }
return JsonResult.success(userPointsDetailList);
}
}

Loading…
Cancel
Save