Browse Source

Merge remote-tracking branch 'origin/develop' into develop

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

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

@@ -80,22 +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());
}
}
return null;
// userPointsDetailList.convert(x -> {
// if(x.getType().equals(2)){
// x.setPointsChange(-1*x.getPointsChange());
// }
// 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