Compare commits

..

No commits in common. "5c50425e9667447bb0671bb872be973b13c87f61" and "45d1c340d8135a23f8b950fcb975454a5cc35d2d" have entirely different histories.

9 changed files with 26 additions and 87 deletions

View File

@ -20,7 +20,7 @@ spring:
file-extension: yml
shared-configs:
- config-common.yml
# - config-port.yml
- config-port.yml
- config-mq.yml
- config-log.yml
- config-sdk-server.yml
@ -38,5 +38,3 @@ spring:
namespace: ${spring.cloud.nacos.config.namespace}
inetutils:
preferred-networks: 192.168.10.28
server:
port: 8081

View File

@ -117,7 +117,7 @@ public class AppUserController {
}
@ApiOperation("app获取用户在职企业-轮询")
@PostMapping("/getUserCorpByPhone")
public SingleResponse<UserLoginCO> getUserCorpByPhone(@Validated @RequestBody UserAppPhoneCmd cmd) {
public SingleResponse<UserLoginCO> getUserCorpByPhone(@Validated @RequestBody UserAppLoginCmd cmd) {
return SingleResponse.of(userService.getUserCorpByPhone(cmd));
}
@ApiOperation("app获取用户在职企业")

View File

@ -37,7 +37,10 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils;
import org.springframework.web.multipart.MultipartFile;
import java.util.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@ -77,32 +80,6 @@ public class UserImportExe {
if (roleCOMultiResponse == null || CollUtil.isEmpty(roleCOMultiResponse.getData())) {
throw new BizException("未创建角色,请联系管理员");
}
//
Boolean b = corpInfoRepository.isSupper();
Long roleId = null;
List<RoleCO> roleCOList = roleCOMultiResponse.getData();
if(b){
//是
Optional<RoleCO> superCorpRoleOpt = roleCOList.stream()
.filter(roleCO -> roleCO.getRoleName().contains("股份端普通用户"))
.findFirst();
if (superCorpRoleOpt.isPresent()) {
roleId = superCorpRoleOpt.get().getId();
}
}else{
// 普通租户查找普通用户或个人账号
Optional<RoleCO> normalRoleOpt = roleCOList.stream()
.filter(roleCO -> roleCO.getRoleName().contains("普通用户") ||
roleCO.getRoleName().contains("个人账户"))
.findFirst();
if (normalRoleOpt.isPresent()) {
roleId = normalRoleOpt.get().getId();
}
}
if(roleId == null){
throw new BizException("未创建角色,请联系管理员");
}
// 部门数据
List<DepartmentDO> departmentDOList = departmentRepository.listByCorpInfoId(corpinfoId);
List<DepartmentDO> departmentDOTempList = new ArrayList<>();
@ -125,7 +102,7 @@ public class UserImportExe {
// 开始处理导入逻辑
for (UserExcelImportEntity importEntity : list) {
try {
processSingleUser(importEntity, corpFlag, corpinfoId, corpInfoDO, departmentDOList, departmentDOTempList, postDOList, userDOList, userDOTempList, roleId);
processSingleUser(importEntity, corpFlag, corpinfoId, corpInfoDO, departmentDOList, departmentDOTempList, postDOList, userDOList, userDOTempList, roleCOMultiResponse.getData());
} catch (Exception e) {
if(CollUtil.isNotEmpty(departmentDOTempList)){
// 删除底座创建的部门
@ -154,7 +131,7 @@ public class UserImportExe {
List<PostDO> postDOList,
List<UserDO> userDOList,
List<UserDO> userDOTempList,
Long roleId) {
List<RoleCO> roleList) {
// 1. 处理部门层级获取最终部门ID
Long departmentId = processDepartmentHierarchy(importEntity, corpinfoId, departmentDOList, departmentDOTempList);
@ -163,7 +140,7 @@ public class UserImportExe {
Long postId = processPost(importEntity, corpinfoId, corpInfoDO, departmentId, postDOList);
// 3. 处理角色信息
// Long roleId = processRoleInfo(importEntity, roleList);
Long roleId = processRoleInfo(importEntity, roleList);
// 4. 处理用户信息
processUserInfo(importEntity, corpFlag, corpinfoId, corpInfoDO, departmentId, postId, userDOList, userDOTempList, roleId);
@ -369,20 +346,20 @@ public class UserImportExe {
*
*/
private Long processRoleInfo(UserExcelImportEntity importEntity, List<RoleCO> roleList) {
// if(StringUtils.isBlank(importEntity.getRoleName())){
// throw new BizException("角色名称不能为空");
// }
// try {
// Map<String, RoleCO> roleCOMap = roleList.stream().collect(Collectors.toMap(RoleCO::getRoleName, role -> role));
// String roleName = importEntity.getRoleName();
// if(roleCOMap.get(roleName) == null){
// throw new BizException("角色不存在: " + roleName);
// }
// return roleCOMap.get(roleName).getId();
// }catch (IllegalStateException e){
// throw new BizException("系统角色名称重复,请联系管理员");
// }
return null;
if(StringUtils.isBlank(importEntity.getRoleName())){
throw new BizException("角色名称不能为空");
}
try {
Map<String, RoleCO> roleCOMap = roleList.stream().collect(Collectors.toMap(RoleCO::getRoleName, role -> role));
String roleName = importEntity.getRoleName();
if(roleCOMap.get(roleName) == null){
throw new BizException("角色不存在: " + roleName);
}
return roleCOMap.get(roleName).getId();
}catch (IllegalStateException e){
throw new BizException("系统角色名称重复,请联系管理员");
}
}
/**

View File

@ -267,7 +267,7 @@ public class UserQueryExe {
userLoginCO.setUserCO(userCoConvertor.converDOToCO(userDO));
return userLoginCO;
}
public UserLoginCO getUserCorpByPhone(UserAppPhoneCmd cmd) {
public UserLoginCO getUserCorpByPhone(UserAppLoginCmd cmd) {
UserLoginCO userLoginCO = new UserLoginCO();
//返回企业列表
//根据手机号获取用户列表

View File

@ -214,7 +214,7 @@ public class UserServiceImpl implements UserServiceI {
}
@Override
public UserLoginCO getUserCorpByPhone(UserAppPhoneCmd cmd) {
public UserLoginCO getUserCorpByPhone(UserAppLoginCmd cmd) {
return userQueryExe.getUserCorpByPhone(cmd);
}

View File

@ -91,6 +91,6 @@ public interface UserServiceI {
List<UserCO> getUserList();
UserLoginCO getUserCorpByPhone(UserAppPhoneCmd cmd);
UserLoginCO getUserCorpByPhone(UserAppLoginCmd cmd);
}

View File

@ -1,24 +0,0 @@
package com.zcloud.basic.info.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotEmpty;
/**
* web-client
*
* @Author zhangyue
* @Date 2025-11-04 14:07:36
*/
@Data
public class UserAppPhoneCmd {
@ApiModelProperty(value = "手机号", name = "phone", required = true)
@NotEmpty(message = "手机号不能为空")
private String phone;
}

View File

@ -41,6 +41,5 @@ public interface CorpInfoRepository extends BaseRepository<CorpInfoDO> {
List<CorpInfoDO> getByIdList(List<Long> corpinfoIds);
Boolean isSupper();
}

View File

@ -268,16 +268,5 @@ public class CorpInfoRepositoryImpl extends BaseRepositoryImpl<CorpInfoMapper, C
return update(updateWrapper);
}
@Override
public Boolean isSupper() {
//判断当前企业是否是监管端
CorpInfoDO corpInfoDO = corpInfoMapper.selectById(AuthContext.getTenantId());
if(corpInfoDO == null)
throw new BizException("当前企业不存在");
if(CorpTypeEnum.share.getCode().equals(corpInfoDO.getType()))
return true;
return false;
}
}