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:
@@ -45,7 +45,7 @@
|
||||
<div class="container mb10">
|
||||
<el-form inline size="small" :model="searchForm" label-width="96px">
|
||||
<el-row>
|
||||
<el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||
<el-col :xs="24" :sm="12" :md="8" :lg="5" :xl="5">
|
||||
<el-form-item label="用户ID:">
|
||||
<el-input
|
||||
v-model="searchForm.uidStr"
|
||||
@@ -56,7 +56,7 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||
<el-col :xs="24" :sm="12" :md="8" :lg="5" :xl="5">
|
||||
<el-form-item label="用户名称:">
|
||||
<el-input
|
||||
v-model="searchForm.nickName"
|
||||
@@ -67,7 +67,7 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||
<el-col :xs="24" :sm="12" :md="8" :lg="5" :xl="5">
|
||||
<el-form-item label="手机号:">
|
||||
<el-input
|
||||
v-model="searchForm.phone"
|
||||
@@ -78,7 +78,7 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||
<el-col :xs="24" :sm="12" :md="10" :lg="8" :xl="8">
|
||||
<el-form-item label="时间选择:">
|
||||
<el-date-picker
|
||||
v-model="timeVal"
|
||||
@@ -90,11 +90,12 @@
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
class="date-range-width"
|
||||
@change="onchangeTime"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||
<el-col :xs="24" :sm="12" :md="6" :lg="4" :xl="4">
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleSearch">搜索</el-button>
|
||||
<el-button @click="handleReset">重置</el-button>
|
||||
@@ -119,7 +120,6 @@
|
||||
<span>{{ scope.row.nickName || '-' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="title" label="标题" min-width="150" show-overflow-tooltip />
|
||||
<el-table-column label="积分变动" min-width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="scope.row.type === 1 ? 'success' : 'danger'" size="small">
|
||||
@@ -356,7 +356,10 @@ export default {
|
||||
text-align: right;
|
||||
}
|
||||
.filter-input {
|
||||
width: 180px;
|
||||
width: 150px;
|
||||
}
|
||||
.date-range-width {
|
||||
width: 350px;
|
||||
}
|
||||
.overview-card--all .hint-text {
|
||||
display: block;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<div class="container">
|
||||
<el-form inline size="small" :model="userFrom" label-width="90px">
|
||||
<el-row>
|
||||
<el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||
<el-col :xs="24" :sm="12" :md="6" :lg="5" :xl="5">
|
||||
<el-form-item label="用户搜索:">
|
||||
<el-input
|
||||
v-model="userFrom.keywords"
|
||||
@@ -16,7 +16,19 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||
<el-col :xs="24" :sm="12" :md="6" :lg="5" :xl="5">
|
||||
<el-form-item label="用户ID:">
|
||||
<el-input-number
|
||||
v-model="userFrom.uid"
|
||||
:min="1"
|
||||
:controls="false"
|
||||
placeholder="请输入用户ID"
|
||||
class="selWidth"
|
||||
@keyup.enter.native="seachList"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="10" :lg="8" :xl="8">
|
||||
<el-form-item label="时间选择:">
|
||||
<el-date-picker
|
||||
v-model="timeVal"
|
||||
@@ -27,11 +39,12 @@
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
class="date-range-width"
|
||||
@change="onchangeTime"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||
<el-col :xs="24" :sm="12" :md="6" :lg="5" :xl="5">
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="small" @click="seachList">搜索</el-button>
|
||||
<el-button size="small" @click="handleReset">重置</el-button>
|
||||
@@ -114,6 +127,7 @@ export default {
|
||||
},
|
||||
userFrom: {
|
||||
keywords: '',
|
||||
uid: null,
|
||||
dateLimit: '',
|
||||
page: 1,
|
||||
limit: 15,
|
||||
@@ -129,6 +143,7 @@ export default {
|
||||
this.listLoading = true;
|
||||
const params = { ...this.userFrom };
|
||||
if (!params.keywords) delete params.keywords;
|
||||
if (!params.uid) delete params.uid;
|
||||
if (!params.dateLimit) delete params.dateLimit;
|
||||
|
||||
getExternalUserList(params)
|
||||
@@ -146,7 +161,7 @@ export default {
|
||||
this.getList();
|
||||
},
|
||||
handleReset() {
|
||||
this.userFrom = { keywords: '', dateLimit: '', page: 1, limit: 15 };
|
||||
this.userFrom = { keywords: '', uid: null, dateLimit: '', page: 1, limit: 15 };
|
||||
this.timeVal = [];
|
||||
this.getList();
|
||||
},
|
||||
@@ -201,6 +216,9 @@ export default {
|
||||
text-align: right;
|
||||
}
|
||||
.selWidth {
|
||||
width: 200px;
|
||||
width: 160px;
|
||||
}
|
||||
.date-range-width {
|
||||
width: 350px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -37,6 +37,9 @@ public class UserSearchRequest implements Serializable {
|
||||
@ApiModelProperty(value = "关键字")
|
||||
private String keywords;
|
||||
|
||||
@ApiModelProperty(value = "用户uid")
|
||||
private Integer uid;
|
||||
|
||||
@ApiModelProperty(value = "时间")
|
||||
private String dateLimit;
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
@@ -51,7 +52,7 @@ public class UserIntegralRecordResponse implements Serializable {
|
||||
private String title;
|
||||
|
||||
@ApiModelProperty(value = "积分")
|
||||
private Integer integral;
|
||||
private BigDecimal integral;
|
||||
|
||||
@ApiModelProperty(value = "剩余")
|
||||
private Integer balance;
|
||||
|
||||
@@ -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