|
@@ -2,6 +2,8 @@ package com.ydtech.modules.admin.controller;
|
|
|
|
|
|
|
|
|
|
|
|
|
import cn.dev33.satoken.stp.StpUtil;
|
|
import cn.dev33.satoken.stp.StpUtil;
|
|
|
|
|
+import cn.hutool.extra.spring.SpringUtil;
|
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
@@ -17,16 +19,16 @@ import com.ydtech.modules.admin.components.request.UnionPayRequest;
|
|
|
import com.ydtech.modules.admin.components.response.UnionPayResponse;
|
|
import com.ydtech.modules.admin.components.response.UnionPayResponse;
|
|
|
import com.ydtech.modules.admin.constants.RoleConstants;
|
|
import com.ydtech.modules.admin.constants.RoleConstants;
|
|
|
import com.ydtech.modules.admin.constants.UserWorkStatus;
|
|
import com.ydtech.modules.admin.constants.UserWorkStatus;
|
|
|
|
|
+import com.ydtech.modules.admin.dao.SysUserRecordMapper;
|
|
|
import com.ydtech.modules.admin.model.*;
|
|
import com.ydtech.modules.admin.model.*;
|
|
|
-import com.ydtech.modules.admin.model.dto.AgentUserDto;
|
|
|
|
|
-import com.ydtech.modules.admin.model.dto.QuTeamNumDto;
|
|
|
|
|
-import com.ydtech.modules.admin.model.dto.QuUserNumDto;
|
|
|
|
|
-import com.ydtech.modules.admin.model.dto.SysUserDto;
|
|
|
|
|
|
|
+import com.ydtech.modules.admin.model.dto.*;
|
|
|
import com.ydtech.modules.admin.model.po.SysUserBankCard;
|
|
import com.ydtech.modules.admin.model.po.SysUserBankCard;
|
|
|
import com.ydtech.modules.admin.model.po.SysUserIsDial;
|
|
import com.ydtech.modules.admin.model.po.SysUserIsDial;
|
|
|
import com.ydtech.modules.admin.model.po.SysUserTreeShowLevel;
|
|
import com.ydtech.modules.admin.model.po.SysUserTreeShowLevel;
|
|
|
import com.ydtech.modules.admin.model.vo.*;
|
|
import com.ydtech.modules.admin.model.vo.*;
|
|
|
import com.ydtech.modules.admin.service.*;
|
|
import com.ydtech.modules.admin.service.*;
|
|
|
|
|
+import com.ydtech.modules.admin.utils.DifferentPropertyUtils;
|
|
|
|
|
+import com.ydtech.modules.admin.utils.RecordUserUtils;
|
|
|
import com.ydtech.modules.base.controller.BaseController;
|
|
import com.ydtech.modules.base.controller.BaseController;
|
|
|
import com.ydtech.modules.base.model.dto.BaseDto;
|
|
import com.ydtech.modules.base.model.dto.BaseDto;
|
|
|
import com.ydtech.modules.base.model.dto.PageDto;
|
|
import com.ydtech.modules.base.model.dto.PageDto;
|
|
@@ -43,18 +45,20 @@ import com.ydtech.modules.protocol.utils.AssertionUtils;
|
|
|
import com.ydtech.security.utils.PasswordUtils;
|
|
import com.ydtech.security.utils.PasswordUtils;
|
|
|
import com.ydtech.utils.StringUtils;
|
|
import com.ydtech.utils.StringUtils;
|
|
|
import com.ydtech.utils.idgen.IdGenerate;
|
|
import com.ydtech.utils.idgen.IdGenerate;
|
|
|
-import io.swagger.annotations.*;
|
|
|
|
|
|
|
+import io.swagger.annotations.Api;
|
|
|
|
|
+import io.swagger.annotations.ApiImplicitParam;
|
|
|
|
|
+import io.swagger.annotations.ApiImplicitParams;
|
|
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.redis.core.StringRedisTemplate;
|
|
import org.springframework.data.redis.core.StringRedisTemplate;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
+import org.springframework.util.CollectionUtils;
|
|
|
import org.springframework.util.ObjectUtils;
|
|
import org.springframework.util.ObjectUtils;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
import javax.validation.Valid;
|
|
import javax.validation.Valid;
|
|
|
-import java.util.Date;
|
|
|
|
|
-import java.util.List;
|
|
|
|
|
-import java.util.Objects;
|
|
|
|
|
|
|
+import java.util.*;
|
|
|
|
|
|
|
|
import static com.ydtech.constants.RedisConstant.PHONE_VERIFICATION_CODE_KEY;
|
|
import static com.ydtech.constants.RedisConstant.PHONE_VERIFICATION_CODE_KEY;
|
|
|
|
|
|
|
@@ -528,6 +532,8 @@ public class SysUserController extends BaseController {
|
|
|
sysUserVo.setSysUser(sysUser);
|
|
sysUserVo.setSysUser(sysUser);
|
|
|
List<EsmUserImageQueryVo> esmUserImageQueryVo = esmUserImageService.getEsmUserImageQueryVo(userId);
|
|
List<EsmUserImageQueryVo> esmUserImageQueryVo = esmUserImageService.getEsmUserImageQueryVo(userId);
|
|
|
sysUserVo.setEsmUserImageVo(esmUserImageQueryVo);
|
|
sysUserVo.setEsmUserImageVo(esmUserImageQueryVo);
|
|
|
|
|
+ sysUserVo.setSysUserInfo(sysUserInfoService.getById(userId));
|
|
|
|
|
+ SpringUtil.getBean(RecordUserUtils.class).addRecord(JSONObject.parseObject(JSONObject.toJSONString(sysUserVo),SysUser2Vo.class),BaseController.getUserName());
|
|
|
return HttpResult.ok(sysUserVo);
|
|
return HttpResult.ok(sysUserVo);
|
|
|
}
|
|
}
|
|
|
// 查询推荐人
|
|
// 查询推荐人
|
|
@@ -541,6 +547,12 @@ public class SysUserController extends BaseController {
|
|
|
}
|
|
}
|
|
|
//查询详情信息
|
|
//查询详情信息
|
|
|
SysUserInfo userInfo = sysUserInfoService.getById(userId);
|
|
SysUserInfo userInfo = sysUserInfoService.getById(userId);
|
|
|
|
|
+
|
|
|
|
|
+ String addr = Optional.ofNullable(userInfo).map(SysUserInfo::getLiveAddress).orElse(null);
|
|
|
|
|
+ if (StringUtils.isNotEmpty(addr)){
|
|
|
|
|
+ userInfo.setLiveAddressString(addr.split(","));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
//查询用户绑定的银行卡信息
|
|
//查询用户绑定的银行卡信息
|
|
|
SysUserBankCard queryBank = new SysUserBankCard();
|
|
SysUserBankCard queryBank = new SysUserBankCard();
|
|
|
queryBank.setUserId(userId);
|
|
queryBank.setUserId(userId);
|
|
@@ -562,7 +574,8 @@ public class SysUserController extends BaseController {
|
|
|
sysUserVo.setSysUser(sysUser);
|
|
sysUserVo.setSysUser(sysUser);
|
|
|
sysUserVo.setSysUserInfo(userInfo);
|
|
sysUserVo.setSysUserInfo(userInfo);
|
|
|
sysUserVo.setEsmUserImageVo(esmUserImageQueryVo);
|
|
sysUserVo.setEsmUserImageVo(esmUserImageQueryVo);
|
|
|
-
|
|
|
|
|
|
|
+ //初始化添加人员修改记录
|
|
|
|
|
+ SpringUtil.getBean(RecordUserUtils.class).addRecord(JSONObject.parseObject(JSONObject.toJSONString(sysUserVo),SysUser2Vo.class),BaseController.getUserName());
|
|
|
return HttpResult.ok(sysUserVo);
|
|
return HttpResult.ok(sysUserVo);
|
|
|
|
|
|
|
|
}
|
|
}
|
|
@@ -951,4 +964,93 @@ public class SysUserController extends BaseController {
|
|
|
return HttpResult.ok("恢复成功");
|
|
return HttpResult.ok("恢复成功");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @version
|
|
|
|
|
+ * @author: hxl
|
|
|
|
|
+ * @Date: 2024/4/18 16:12
|
|
|
|
|
+ * @Description: 查询修改记录
|
|
|
|
|
+ */
|
|
|
|
|
+ @ApiOperation(value = "查询修改记录")
|
|
|
|
|
+ @GetMapping(value = "/getUserModificationRecords")
|
|
|
|
|
+ public HttpResult getUserModificationRecords(@RequestParam("userId") String userId) throws IllegalAccessException {
|
|
|
|
|
+ List<SysUserRecord> userList = SpringUtil.getBean(SysUserRecordMapper.class).queryByUserId(userId);
|
|
|
|
|
+ if (CollectionUtils.isEmpty(userList)){
|
|
|
|
|
+ return HttpResult.ok(new ArrayList[0]);
|
|
|
|
|
+ }
|
|
|
|
|
+ SysUserInfoQuery sysUserVo = new SysUserInfoQuery();
|
|
|
|
|
+ // 查询用户
|
|
|
|
|
+ SysUser sysUser = sysUserService.getById(userId);
|
|
|
|
|
+ // 查询角色
|
|
|
|
|
+ SysUserRole sysUserRole = sysUserRoleService.selectByUserId(userId);
|
|
|
|
|
+// SysUserRole sysUserRole = sysUserRoleService.getById(userId);
|
|
|
|
|
+ if (!ObjectUtils.isEmpty(sysUserRole)) {
|
|
|
|
|
+ sysUser.setRoleId(StringUtils.toString(sysUserRole.getRoleId()));
|
|
|
|
|
+ }
|
|
|
|
|
+ //查询 机构的上级
|
|
|
|
|
+ SysDept sysDept = sysDeptService.getById(sysUser.getDeptId());
|
|
|
|
|
+ sysUser.setPdeptId(sysDept.getParentId());
|
|
|
|
|
+ if ("19".equals(sysUser.getRoleId())) {
|
|
|
|
|
+ SysUser operator = sysUserService.getById(sysUser.getOperatorCode());
|
|
|
|
|
+ sysUser.setReferrerId(operator != null ? operator.getId() : "");
|
|
|
|
|
+ sysUser.setReferrerName(operator != null ? operator.getName() : "");
|
|
|
|
|
+ sysUserVo.setSysUser(sysUser);
|
|
|
|
|
+ sysUserVo.setSysUserInfo(sysUserInfoService.getById(userId));
|
|
|
|
|
+ List<EsmUserImageQueryVo> esmUserImageQueryVo = esmUserImageService.getEsmUserImageQueryVo(userId);
|
|
|
|
|
+ sysUserVo.setEsmUserImageVo(esmUserImageQueryVo);
|
|
|
|
|
+ return HttpResult.ok(DifferentPropertyUtils.ModificationRecordData(sysUserVo, userList));
|
|
|
|
|
+ }
|
|
|
|
|
+ // 查询推荐人
|
|
|
|
|
+ EsmUserReferrer referrer = esmUserReferrerService.getById(userId);
|
|
|
|
|
+ if (ObjectUtils.isEmpty(referrer)) {
|
|
|
|
|
+ sysUser.setReferrerId(null);
|
|
|
|
|
+ sysUser.setReferrerName(null);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ sysUser.setReferrerId(referrer.getReferrerId());
|
|
|
|
|
+ sysUser.setReferrerName(referrer.getReferrerName());
|
|
|
|
|
+ }
|
|
|
|
|
+ //查询详情信息
|
|
|
|
|
+ SysUserInfo userInfo = sysUserInfoService.getById(userId);
|
|
|
|
|
+ if (StringUtils.isNotEmpty(userInfo.getLiveAddress())){
|
|
|
|
|
+ userInfo.setLiveAddressString(userInfo.getLiveAddress().split(","));
|
|
|
|
|
+ }
|
|
|
|
|
+ //查询用户绑定的银行卡信息
|
|
|
|
|
+ SysUserBankCard queryBank = new SysUserBankCard();
|
|
|
|
|
+ queryBank.setUserId(userId);
|
|
|
|
|
+ queryBank.setAuditStatus("1");
|
|
|
|
|
+ HttpResult<List<SysUserBankCard>> userBankList = sysUserBankCardService.getUserBankListByQueryParam(queryBank);
|
|
|
|
|
+ if (!Objects.isNull(userInfo)) {
|
|
|
|
|
+ if (userBankList.getData().isEmpty()) {
|
|
|
|
|
+ userInfo.setBankName(null);
|
|
|
|
|
+ userInfo.setAccountno(null);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ userInfo.setBankName(userBankList.getData().get(0).getBankAccount());
|
|
|
|
|
+ userInfo.setAccountno(userBankList.getData().get(0).getBankNumber());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ List<EsmUserImageQueryVo> esmUserImageQueryVo = esmUserImageService.getEsmUserImageQueryVo(userId);
|
|
|
|
|
+ sysUserVo.setSysUser(sysUser);
|
|
|
|
|
+ sysUserVo.setSysUserInfo(userInfo);
|
|
|
|
|
+ sysUserVo.setEsmUserImageVo(esmUserImageQueryVo);
|
|
|
|
|
+ return HttpResult.ok(DifferentPropertyUtils.ModificationRecordData(sysUserVo, userList));
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 代理人和渠道添加批量设置管理人
|
|
|
|
|
+ */
|
|
|
|
|
+ @PostMapping("updateManagementPersonnel")
|
|
|
|
|
+ public HttpResult updateManagementPersonnel(@RequestBody UpdateManagementDto managementDto){
|
|
|
|
|
+ return sysUserService.updateManagementPersonnel(managementDto);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 代理人和渠道用户查询
|
|
|
|
|
+ */
|
|
|
|
|
+ @PostMapping("selectForAgentsAndChannelsPage")
|
|
|
|
|
+ public HttpResult selectForAgentsAndChannelsPage(@RequestBody AgentsAndChannelsDto agentsAndChannelsDto){
|
|
|
|
|
+ return sysUserService.selectForAgentsAndChannelsPage(agentsAndChannelsDto);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|