feat(sxsy80): 外部用户 UID 筛选与积分明细展示
User list API accepts uid; admin external pages tighten filters and integral log maps self-bonus rows via wa_selfbonus_log for display. Made-with: Cursor
This commit is contained in:
@@ -19,9 +19,11 @@ import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.zbkj.common.utils.CrmebDateUtil;
|
||||
import com.zbkj.common.vo.DateLimitUtilVo;
|
||||
import com.zbkj.common.model.consignment.WaSelfbonusLog;
|
||||
import com.zbkj.common.model.user.User;
|
||||
import com.zbkj.common.model.user.UserIntegralRecord;
|
||||
import com.zbkj.service.dao.UserIntegralRecordDao;
|
||||
import com.zbkj.service.dao.consignment.WaSelfbonusLogDao;
|
||||
import com.zbkj.service.service.UserIntegralRecordService;
|
||||
import com.zbkj.service.service.UserService;
|
||||
import org.slf4j.Logger;
|
||||
@@ -33,7 +35,9 @@ import org.springframework.transaction.support.TransactionTemplate;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -62,6 +66,9 @@ public class UserIntegralRecordServiceImpl extends ServiceImpl<UserIntegralRecor
|
||||
@Autowired
|
||||
private UserService userService;
|
||||
|
||||
@Autowired
|
||||
private WaSelfbonusLogDao waSelfbonusLogDao;
|
||||
|
||||
@Autowired
|
||||
private TransactionTemplate transactionTemplate;
|
||||
|
||||
@@ -155,7 +162,8 @@ public class UserIntegralRecordServiceImpl extends ServiceImpl<UserIntegralRecor
|
||||
LambdaQueryWrapper<UserIntegralRecord> lqw = Wrappers.lambdaQuery();
|
||||
lqw.select(UserIntegralRecord::getId, UserIntegralRecord::getTitle, UserIntegralRecord::getBalance, UserIntegralRecord::getIntegral,
|
||||
UserIntegralRecord::getMark, UserIntegralRecord::getUid, UserIntegralRecord::getUpdateTime,
|
||||
UserIntegralRecord::getType, UserIntegralRecord::getLinkType, UserIntegralRecord::getStatus, UserIntegralRecord::getCreateTime);
|
||||
UserIntegralRecord::getType, UserIntegralRecord::getLinkType, UserIntegralRecord::getStatus, UserIntegralRecord::getCreateTime,
|
||||
UserIntegralRecord::getWaSelfbonusLogid);
|
||||
lqw.eq(UserIntegralRecord::getStatus, IntegralRecordConstants.INTEGRAL_RECORD_STATUS_COMPLETE);
|
||||
|
||||
String nameKey = StrUtil.isNotBlank(request.getNickName()) ? request.getNickName() : request.getKeywords();
|
||||
@@ -213,9 +221,28 @@ public class UserIntegralRecordServiceImpl extends ServiceImpl<UserIntegralRecor
|
||||
if (CollUtil.isEmpty(list)) {
|
||||
return CommonPage.copyPageInfo(page, CollUtil.newArrayList());
|
||||
}
|
||||
List<Integer> selfBonusLogIds = list.stream()
|
||||
.map(UserIntegralRecord::getWaSelfbonusLogid)
|
||||
.filter(ObjectUtil::isNotNull)
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
Map<Integer, BigDecimal> selfBonusIntegralMap = new HashMap<>();
|
||||
if (CollUtil.isNotEmpty(selfBonusLogIds)) {
|
||||
waSelfbonusLogDao.selectBatchIds(selfBonusLogIds).forEach(log -> {
|
||||
if (ObjectUtil.isNotNull(log) && ObjectUtil.isNotNull(log.getMoney())) {
|
||||
selfBonusIntegralMap.put(log.getId(), log.getMoney().multiply(new BigDecimal("0.5")).setScale(3, RoundingMode.DOWN));
|
||||
}
|
||||
});
|
||||
}
|
||||
List<UserIntegralRecordResponse> responseList = list.stream().map(i -> {
|
||||
UserIntegralRecordResponse response = new UserIntegralRecordResponse();
|
||||
BeanUtils.copyProperties(i, response);
|
||||
if (ObjectUtil.isNotNull(i.getWaSelfbonusLogid())) {
|
||||
BigDecimal convertedIntegral = selfBonusIntegralMap.get(i.getWaSelfbonusLogid());
|
||||
if (ObjectUtil.isNotNull(convertedIntegral)) {
|
||||
response.setIntegral(convertedIntegral);
|
||||
}
|
||||
}
|
||||
// 获取用户昵称
|
||||
User user = userService.getById(i.getUid());
|
||||
if (ObjectUtil.isNotNull(user)) {
|
||||
|
||||
@@ -142,6 +142,10 @@ public class UserServiceImpl extends ServiceImpl<UserDao, User> implements UserS
|
||||
map.put("isPromoter", request.getIsPromoter() ? 1 : 0);
|
||||
}
|
||||
|
||||
if (request.getUid() != null) {
|
||||
map.put("uid", request.getUid());
|
||||
}
|
||||
|
||||
if (StrUtil.isNotBlank(request.getGroupId())) {
|
||||
List<Integer> groupIdList = CrmebUtil.stringToArray(request.getGroupId());
|
||||
map.put("groupIdList", groupIdList);
|
||||
|
||||
@@ -29,6 +29,9 @@
|
||||
<if test="isPromoter != null and isPromoter !='' or isPromoter == 0 ">
|
||||
and u.is_promoter = #{isPromoter}
|
||||
</if>
|
||||
<if test="uid != null">
|
||||
and u.uid = #{uid}
|
||||
</if>
|
||||
<if test="groupId != null and groupId !='' ">
|
||||
and u.group_id in
|
||||
<foreach item="group_id" collection="groupIdList" open="(" separator="," close=")">
|
||||
|
||||
Reference in New Issue
Block a user