This commit is contained in:
dzc committed 2025-03-31 19:26:04 +08:00
1 parent 5f0fee0917
commit 3abb866eb1
7 files changed
+82 -12

No files matched your search

@@ -543,9 +543,9 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
String userDefaultRole = ParamResolver.getStr("USER_DEFAULT_ROLE");
List<Long> roleIds = roleList.stream().filter(v -> ObjectUtil.equals(v.getRoleCode(), walletAutoCreate) || ObjectUtil.equals(v.getRoleCode(), userDefaultRole)).map(SysRole::getRoleId).toList();
// 用户手机号重复判断
List<String> userPoneList = excelList.stream().map(UserExcelFaceVo::getMobile).toList();
List<String> userPoneList = excelList.stream().map(UserExcelFaceVo::getMobile).filter(ObjectUtil::isNotEmpty).toList();
// 用户名重复判断
List<String> usernameList = excelList.stream().map(UserExcelFaceVo::getUsername).toList();
List<String> usernameList = excelList.stream().map(UserExcelFaceVo::getUsername).filter(ObjectUtil::isNotEmpty).toList();
// 读取图片
Map<String, PictureData> images = ExcelTool.getPictureFromExcel(file, 1);
for (UserExcelFaceVo v : excelList) {
@@ -584,15 +584,18 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
// if (ObjectUtil.isEmpty(face)) {
// errorMsg.add("人脸照片为空");
// }
if (ObjectUtil.isNotEmpty(v.getMobile())) {
long userPhone = userPoneList.stream().filter(i -> ObjectUtil.equals(i, v.getMobile())).count();
if (userPhone > 1) {
errorMsg.add("用手机号 <" + v.getMobile() + "> 重复");
}
long userPhone = userPoneList.stream().filter(i -> ObjectUtil.equals(i, v.getMobile())).count();
if (userPhone > 1) {
errorMsg.add("用手机号 <" + v.getMobile() + "> 重复");
}
long repetitionUsername = usernameList.stream().filter(i -> ObjectUtil.equals(i, v.getUsername())).count();
if (repetitionUsername > 1) {
errorMsg.add("用户名 <" + v.getUsername() + "> 重复");
if (ObjectUtil.isNotEmpty(v.getUsername())) {
long repetitionUsername = usernameList.stream().filter(i -> ObjectUtil.equals(i, v.getUsername())).count();
if (repetitionUsername > 1) {
errorMsg.add("用户名 <" + v.getUsername() + "> 重复");
}
}
if (CollUtil.isEmpty(errorMsg)) {
@@ -29,4 +29,6 @@ public class WalletTransactionSumAndCountDto {
private Long walletTypeId;
private Long walletId;
}
@@ -0,0 +1,32 @@
package com.bsd.pjcloud.wallet.api.vo.rule;
import lombok.Data;
@Data
public class WalletRuleJoinUserConfigVo {
/**
* 用户相关
*/
private Long userId;
private String username;
/**
* 钱包相关
*/
private Long walletId;
private Long walletTypeId;
/**
* 总充值余额
*/
private Long totalTopUpBalance;
/**
* 总的转账余额
*/
private Long totalTransferBalance;
}
@@ -60,11 +60,18 @@ public class WalletRuleJoinController {
@Operation(summary = "通过id查询", description = "通过id查询")
@GetMapping("join-detail/{id}")
@PreAuthorize("@pms.hasPermission('dzc_walletRuleMchConfig_view')")
// @PreAuthorize("@pms.hasPermission('dzc_walletRuleMchConfig_view')")
public R joinDetail(@PathVariable("id") Long id) {
return R.ok(walletRuleJoinService.joinDetail(id));
}
@Operation(summary = "查询用户转账配置", description = "查询用户转账配置")
@GetMapping("user-config/{walletId}")
// @PreAuthorize("@pms.hasPermission('dzc_walletRuleMchConfig_view')")
public R userConfig(@PathVariable("walletId") Long walletId) {
return R.ok(walletRuleJoinService.userConfig(walletId));
}
@Operation(summary = "新增钱包规则配置", description = "新增钱包规则配置")
@SysLog("新增钱包规则配置")
@PostMapping
@@ -4,9 +4,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.bsd.pjcloud.common.data.datascope.DataScope;
import com.bsd.pjcloud.wallet.api.dto.rule.WalletRuleJoinDto;
import com.bsd.pjcloud.wallet.api.entity.mch.MchRuleJoinDtoEntity;
import com.bsd.pjcloud.wallet.api.entity.rule.WalletRuleJoinEntity;
import com.bsd.pjcloud.wallet.api.vo.mch.MchRuleJoinDtoVo;
import com.bsd.pjcloud.wallet.api.vo.rule.WalletRuleJoinUserConfigVo;
import com.bsd.pjcloud.wallet.api.vo.rule.WalletRuleJoinVo;
import java.util.ArrayList;
@@ -37,4 +36,9 @@ public interface WalletRuleJoinService extends IService<WalletRuleJoinEntity> {
* 复杂详情
*/
WalletRuleJoinVo joinDetail(Long id);
/**
* 用户配置
*/
WalletRuleJoinUserConfigVo userConfig(Long walletId);
}
@@ -10,11 +10,16 @@ import com.bsd.pjcloud.admin.api.utils.DataUtil;
import com.bsd.pjcloud.common.core.util.BeanUtils;
import com.bsd.pjcloud.common.core.util.R;
import com.bsd.pjcloud.common.data.datascope.DataScope;
import com.bsd.pjcloud.wallet.api.constant.WalletBizEnum;
import com.bsd.pjcloud.wallet.api.dto.WalletTransactionSumAndCountDto;
import com.bsd.pjcloud.wallet.api.dto.rule.WalletRuleJoinDto;
import com.bsd.pjcloud.wallet.api.entity.WalletTypeEntity;
import com.bsd.pjcloud.wallet.api.entity.rule.WalletRuleJoinEntity;
import com.bsd.pjcloud.wallet.api.vo.WalletManageVo;
import com.bsd.pjcloud.wallet.api.vo.WalletTransactionSumAndCountVo;
import com.bsd.pjcloud.wallet.api.vo.rule.WalletRuleJoinUserConfigVo;
import com.bsd.pjcloud.wallet.api.vo.rule.WalletRuleJoinVo;
import com.bsd.pjcloud.wallet.mapper.WalletTransactionMapper;
import com.bsd.pjcloud.wallet.mapper.rule.WalletRuleJoinMapper;
import com.bsd.pjcloud.wallet.service.WalletRuleJoinService;
import com.bsd.pjcloud.wallet.service.WalletTypeService;
@@ -36,6 +41,8 @@ import java.util.Map;
@Service
public class WalletRuleJoinServiceImpl extends ServiceImpl<WalletRuleJoinMapper, WalletRuleJoinEntity> implements WalletRuleJoinService {
private final WalletTransactionMapper walletTransactionMapper;
private final WalletTypeService walletTypeService;
private final RemoteDeptService remoteDeptService;
@@ -109,6 +116,18 @@ public class WalletRuleJoinServiceImpl extends ServiceImpl<WalletRuleJoinMapper,
return baseMapper.joinDetail(id);
}
@Override
public WalletRuleJoinUserConfigVo userConfig(Long walletId) {
WalletRuleJoinUserConfigVo configVo = new WalletRuleJoinUserConfigVo();
// 查询用户充值的总余额
WalletTransactionSumAndCountDto totalTopupDto = new WalletTransactionSumAndCountDto();
totalTopupDto.setBizTypes(WalletBizEnum.getTopUpCodes());
totalTopupDto.setType(WalletTransactionSumAndCountDto.TYPE_INCOME);
totalTopupDto.setWalletId(walletId);
List<WalletTransactionSumAndCountVo> totalTopupVo = walletTransactionMapper.sumAndCount(totalTopupDto);
return null;
}
/**
* 是否重复
*/
@@ -58,6 +58,9 @@
from wallet_transaction a
<where>
a.del_flag = 0 and a.dept_id is not null
<if test="dto.walletId != null">
a.wallet_id = ${dto.walletId}
</if>
<if test="dto.walletTypeId != null">
</if>
<if test="dto.type != null">