|
|
@@ -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); |
|
|
|
} |
|
|
|
} |