Compare commits
No commits in common. "main" and "dev_xiangguanfang" have entirely different histories.
|
|
@ -115,11 +115,6 @@ public class AppUserController {
|
|||
public SingleResponse<UserLoginCO> login(@Validated @RequestBody UserAppLoginCmd cmd) {
|
||||
return SingleResponse.of(userService.login(cmd));
|
||||
}
|
||||
@ApiOperation("app获取用户在职企业-轮询")
|
||||
@PostMapping("/getUserCorpByPhone")
|
||||
public SingleResponse<UserLoginCO> getUserCorpByPhone(@Validated @RequestBody UserAppPhoneCmd cmd) {
|
||||
return SingleResponse.of(userService.getUserCorpByPhone(cmd));
|
||||
}
|
||||
@ApiOperation("app获取用户在职企业")
|
||||
@PostMapping("/getUserCorpList/{id}")
|
||||
public MultiResponse<UserCorpInfoCO> getUserCorpList(@PathVariable("id") Long id) {
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ import com.alibaba.cola.dto.PageResponse;
|
|||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import com.zcloud.basic.info.api.CorpInfoServiceI;
|
||||
import com.zcloud.basic.info.command.convertor.CorpInfoCoConvertor;
|
||||
import com.zcloud.basic.info.domain.enums.CorpTypeEnum;
|
||||
import com.zcloud.basic.info.dto.CorpInfoAddCmd;
|
||||
import com.zcloud.basic.info.dto.CorpInfoPageQry;
|
||||
import com.zcloud.basic.info.dto.CorpInfoUpdateCmd;
|
||||
|
|
@ -80,10 +79,4 @@ public class ZcloudCorpFacadeImpl implements ZcloudCorpFacade {
|
|||
public SingleResponse<Boolean> verifyCorpInfo() {
|
||||
return SingleResponse.of(corpInfoService.verifyCorpInfo());
|
||||
}
|
||||
|
||||
@Override
|
||||
public MultiResponse<Integer> listCorpType(Integer enterpriseType) {
|
||||
return MultiResponse.of(CorpTypeEnum.getCodesByEnterpriseType(enterpriseType));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,27 +1,17 @@
|
|||
package com.zcloud.basic.info.facade;
|
||||
|
||||
import com.alibaba.cola.dto.MultiResponse;
|
||||
import com.jjb.saas.framework.auth.model.SSOUser;
|
||||
import com.jjb.saas.framework.auth.utils.AuthContext;
|
||||
import com.zcloud.basic.info.api.ImgFilesServiceI;
|
||||
import com.zcloud.basic.info.command.convertor.ImgFilesCoConvertor;
|
||||
import com.zcloud.basic.info.domain.utils.Smb;
|
||||
import com.zcloud.basic.info.dto.ImgFilesQryCmd;
|
||||
import com.zcloud.basic.info.dto.clientobject.ImgFilesCO;
|
||||
import com.zcloud.gbscommon.utils.DateUtil;
|
||||
import com.zcloud.gbscommon.utils.Tools;
|
||||
import com.zcloud.gbscommon.zcloudimgfiles.facade.ZcloudImgFilesFacade;
|
||||
import com.zcloud.gbscommon.zcloudimgfiles.request.ZcloudImgFilesQryCmd;
|
||||
import com.zcloud.gbscommon.zcloudimgfiles.response.ZcloudImgFilesCO;
|
||||
import org.apache.dubbo.config.annotation.DubboService;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.InputStream;
|
||||
import java.util.Base64;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
@ -42,60 +32,4 @@ public class ZcloudImgFilesFacadeImpl implements ZcloudImgFilesFacade {
|
|||
List<ZcloudImgFilesCO> zcloudImgFilesCo = imgFilesCoConvertor.converCOsToDubboCOs(response.getData());
|
||||
return MultiResponse.of(zcloudImgFilesCo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String saveFile(String multipartFile, String fileName, String path) {
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
String filePath = ssoUser.getTenantId().toString() + "/" + DateUtil.getMonth() + "/" + path;
|
||||
// 文件上传并获取上传路径
|
||||
String resultFilePath = null;
|
||||
try {
|
||||
resultFilePath = Smb.saveFile(base64ToInputStream(multipartFile),fileName, filePath);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
return resultFilePath;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String saveFile(byte[] bytes, String fileName, String path) {
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
String filePath = ssoUser.getTenantId().toString() + "/" + DateUtil.getMonth() + "/" + path;
|
||||
// 文件上传并获取上传路径
|
||||
String resultFilePath = null;
|
||||
try {
|
||||
resultFilePath = Smb.saveFile(new ByteArrayInputStream(bytes),fileName, filePath);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
return resultFilePath;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String saveFile(byte[] bytes, String fileName, String path, Long corpinfoId) {
|
||||
String filePath = corpinfoId.toString() + "/" + DateUtil.getMonth() + "/" + path;
|
||||
// 文件上传并获取上传路径
|
||||
String resultFilePath = null;
|
||||
try {
|
||||
resultFilePath = Smb.saveFile(new ByteArrayInputStream(bytes),fileName, filePath);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
return resultFilePath;
|
||||
}
|
||||
|
||||
|
||||
public static InputStream base64ToInputStream(String base64String) {
|
||||
if (base64String == null || base64String.isEmpty()) {
|
||||
throw new IllegalArgumentException("Base64 string is null or empty");
|
||||
}
|
||||
|
||||
String data = base64String;
|
||||
if (base64String.contains(",")) {
|
||||
data = base64String.substring(base64String.indexOf(",") + 1);
|
||||
}
|
||||
|
||||
byte[] bytes = Base64.getDecoder().decode(data);
|
||||
return new ByteArrayInputStream(bytes);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,18 +57,4 @@ public class ZcloudUserFacadeImpl implements ZcloudUserFacade {
|
|||
List<ZcloudUserCo> zcloudUserCo = userCoConvertor.converCOsToDubboCOs(users);
|
||||
return MultiResponse.of(zcloudUserCo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MultiResponse<ZcloudUserCo> listUserByUserName(Collection<String> collection) {
|
||||
List<UserCO> users = userServiceI.listUserByUserName(collection);
|
||||
List<ZcloudUserCo> zcloudUserCo = userCoConvertor.converCOsToDubboCOs(users);
|
||||
return MultiResponse.of(zcloudUserCo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MultiResponse<ZcloudUserCo> listUserByUserNameV1(Collection<String> collection) {
|
||||
List<UserCO> users = userServiceI.listUserByUserNameV1(collection);
|
||||
List<ZcloudUserCo> zcloudUserCo = userCoConvertor.converCOsToDubboCOs(users);
|
||||
return MultiResponse.of(zcloudUserCo);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,16 +51,10 @@ public class CorpInfoController {
|
|||
|
||||
@ApiOperation("分页")
|
||||
@PostMapping("/list")
|
||||
|
||||
@PreAuthorize("@pms.hasAnyPermission('zgszhgl','zgsqyxxgl','gszhxxgl','qyd-xgf-zhgl')")
|
||||
public PageResponse<CorpInfoCO> page(@Validated @RequestBody CorpInfoPageQry qry) {
|
||||
return corpInfoService.listPage(qry);
|
||||
}
|
||||
@ApiOperation("分页")
|
||||
@PostMapping("/basicList")
|
||||
@PreAuthorize("@pms.hasAnyPermission('zgszhgl','zgsqyxxgl','gszhxxgl','qyd-xgf-zhgl')")
|
||||
public PageResponse<CorpInfoCO> pageBasic(@Validated @RequestBody CorpInfoPageQry qry) {
|
||||
return corpInfoService.listPageBasic(qry);
|
||||
}
|
||||
|
||||
@ApiOperation("分页")
|
||||
@PostMapping("/listNoPms")
|
||||
|
|
|
|||
|
|
@ -91,12 +91,6 @@ public class DepartmentController {
|
|||
return MultiResponse.of(departmentService.listAllTree());
|
||||
}
|
||||
|
||||
@ApiOperation("所有企业下部门树状所有数据根据企业类型")
|
||||
@PostMapping("/listAllTreeByCorpType")
|
||||
public MultiResponse<DepartmentTreeInfoCO> listAllTreeByCorpType( @RequestBody DepartmentTreeQry qry) {
|
||||
return MultiResponse.of(departmentService.listAllTreeByCorpType(qry));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -71,12 +71,6 @@ public class UserController {
|
|||
return userService.listPage(qry);
|
||||
}
|
||||
|
||||
@ApiOperation("其他页面的用户分页,不需要权限控制")
|
||||
@PostMapping("/pageByNopermission")
|
||||
public PageResponse<UserCO> pageByNopermission(@RequestBody UserPageQry qry) {
|
||||
return userService.pageByNopermission(qry);
|
||||
}
|
||||
|
||||
@ApiOperation("所有数据")
|
||||
@GetMapping("/listAll")
|
||||
public MultiResponse<UserCO> listAll(UserQryCmd userQryCmd) {
|
||||
|
|
@ -89,11 +83,6 @@ public class UserController {
|
|||
public SingleResponse<UserCO> getInfoById(@PathVariable("id") Long id) {
|
||||
return userService.getInfoById(id);
|
||||
}
|
||||
@ApiOperation("详情")
|
||||
@GetMapping("/getInfoByUserName/{userName}")
|
||||
public SingleResponse<UserCO> getInfoByUserName(@PathVariable("userName") String userName) {
|
||||
return userService.getInfoByUserName(userName);
|
||||
}
|
||||
@ApiOperation("获取当前登录人信息")
|
||||
@GetMapping("/getInfo")
|
||||
public SingleResponse<UserCO> getInfo() {
|
||||
|
|
@ -180,11 +169,5 @@ public class UserController {
|
|||
return SingleResponse.buildSuccess();
|
||||
}
|
||||
|
||||
@ApiOperation("根据手机号获取用户userId")
|
||||
@PostMapping("/getUserIdByPhone")
|
||||
public SingleResponse<UserCO> getUserIdByPhone(@Validated @RequestBody GetUserIdByPhoneCmd getUserIdByPhoneCmd) {
|
||||
return userService.getUserIdByPhone(getUserIdByPhoneCmd);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -29,7 +29,6 @@ import com.zcloud.basic.info.dto.*;
|
|||
import com.zcloud.basic.info.persistence.dataobject.*;
|
||||
import com.zcloud.basic.info.persistence.repository.*;
|
||||
import com.zcloud.gbscommon.utils.DateUtil;
|
||||
import com.zcloud.gbscommon.utils.Tools;
|
||||
import com.zcloud.gbscommon.utils.UuidUtil;
|
||||
import com.zcloud.gbscommon.utils.ZcloudRedisUtil;
|
||||
import lombok.AllArgsConstructor;
|
||||
|
|
@ -120,7 +119,7 @@ public class UserAddExe {
|
|||
userE.setRoleId(roleId);
|
||||
}
|
||||
try {
|
||||
userE.resetPassword();
|
||||
|
||||
res = userGateway.add(userE);
|
||||
if (corpInfoDO != null && !ObjectUtils.isEmpty(corpInfoDO.getCorpName())) {
|
||||
corpName = corpInfoDO.getCorpName();
|
||||
|
|
@ -142,8 +141,9 @@ public class UserAddExe {
|
|||
UserE userE = new UserE();
|
||||
userE.checkPassword(cmd.getNewPassword(), cmd.getConfirmPassword());
|
||||
|
||||
// TODO 需要修改 获取redis验证码
|
||||
if (!"369258".equals(cmd.getPhoneCode()) && !"dev".equals(codeConfig.getProfile())) {
|
||||
// 获取redis验证码
|
||||
if (!"dev".equals(codeConfig.getProfile())) {
|
||||
|
||||
|
||||
Object phoneCodeObj = zcloudRedisUtil.get(RedisConstant.PHONE_CODE_KEY + cmd.getPhone());
|
||||
if (phoneCodeObj == null || !phoneCodeObj.toString().equals(cmd.getPhoneCode())) {
|
||||
|
|
@ -191,7 +191,7 @@ public class UserAddExe {
|
|||
// userRepository.checkUserIdCard(cmd.getId(),cmd.getUserIdCard());
|
||||
|
||||
UserExpandInfoDO userExpandInfoDO = userExpandInfoRepository.getInfoByPhone(userDO.getPhone());
|
||||
if (userExpandInfoDO!=null &&userExpandInfoDO.getFlowFlag() != null && !userExpandInfoDO.getFlowFlag().equals(cmd.getFlowFlag())) {
|
||||
if (userExpandInfoDO.getFlowFlag() != null && !userExpandInfoDO.getFlowFlag().equals(cmd.getFlowFlag())) {
|
||||
// 流动转固定
|
||||
List<UserDO> listByPhone = userRepository.getListByPhone(userDO.getPhone(), Arrays.asList(UserEmploymentFlagEnum.ON.getCode(), UserEmploymentFlagEnum.ENTRY_AUDIT.getCode(), UserEmploymentFlagEnum.RESIGNATION_AUDIT.getCode()));
|
||||
|
||||
|
|
@ -282,17 +282,16 @@ public class UserAddExe {
|
|||
}
|
||||
|
||||
UserE userE = new UserE();
|
||||
UserExpandInfoDO userExpandInfoDO = userExpandInfoRepository.getInfoByPhone(userDO.getPhone());
|
||||
|
||||
if (userDO.getCorpinfoId() == null) {
|
||||
BeanUtils.copyProperties(cmd, userE);
|
||||
|
||||
// user表状态变为入职待审核
|
||||
userE.setEmploymentFlag(UserEmploymentFlagEnum.ENTRY_AUDIT.getCode());
|
||||
userE.setFlowFlag(userExpandInfoDO.getFlowFlag());
|
||||
userGateway.update(userE);
|
||||
} else {
|
||||
// 用户有企业id
|
||||
|
||||
UserExpandInfoDO userExpandInfoDO = userExpandInfoRepository.getInfoByPhone(userDO.getPhone());
|
||||
Integer flowFlag = userExpandInfoDO.getFlowFlag();
|
||||
if (UserFlowFlagEnum.FIXED.getCode().equals(flowFlag)) {
|
||||
// 固定用户
|
||||
|
|
@ -337,7 +336,7 @@ public class UserAddExe {
|
|||
UserDO user = firstUserWithIdCard.get();
|
||||
BeanUtils.copyProperties(user, userE);
|
||||
userE.setId(null);
|
||||
userE.initFormOnboarding(cmd.getCorpinfoId(), cmd.getDepartmentId(), cmd.getPostName(), Tools.get32UUID());
|
||||
userE.initFormOnboarding(cmd.getCorpinfoId(), cmd.getDepartmentId(), cmd.getPostName(), UuidUtil.get32UUID());
|
||||
userE.setFlowFlag(flowFlag);
|
||||
userRepository.saveOnboardingUser(userE);
|
||||
} else {
|
||||
|
|
@ -377,7 +376,7 @@ public class UserAddExe {
|
|||
UserDO user = firstUserWithIdCard.get();
|
||||
BeanUtils.copyProperties(user, userE);
|
||||
userE.setId(null);
|
||||
userE.initFormOnboarding(cmd.getCorpinfoId(), cmd.getDepartmentId(), cmd.getPostName(), Tools.get32UUID());
|
||||
userE.initFormOnboarding(cmd.getCorpinfoId(), cmd.getDepartmentId(), cmd.getPostName(), UuidUtil.get32UUID());
|
||||
userE.setFlowFlag(flowFlag);
|
||||
userRepository.saveOnboardingUser(userE);
|
||||
} else {
|
||||
|
|
@ -475,16 +474,17 @@ public class UserAddExe {
|
|||
UserDO userDOUpdate = null;
|
||||
if (CollUtil.isNotEmpty(userList)) {
|
||||
// UserExpandInfoDO userExpandInfoDO = userExpandInfoRepository.getInfoByPhone(userE.getPhone());
|
||||
//获取在职企业信息
|
||||
userList.forEach(u -> {
|
||||
if (UserEmploymentFlagEnum.ON.getCode().equals(u.getEmploymentFlag())
|
||||
|| UserEmploymentFlagEnum.ENTRY_AUDIT.getCode().equals(u.getEmploymentFlag())
|
||||
|| UserEmploymentFlagEnum.RESIGNATION_AUDIT.getCode().equals(u.getEmploymentFlag())) {
|
||||
throw new BizException("该固定用户存在未离职信息,无法添加");
|
||||
}
|
||||
});
|
||||
|
||||
if (UserFlowFlagEnum.FIXED.getCode().equals(cmd.getFlowFlag())) {
|
||||
//获取在职企业信息
|
||||
userList.forEach(u -> {
|
||||
if (UserEmploymentFlagEnum.ON.getCode().equals(u.getEmploymentFlag())
|
||||
|| UserEmploymentFlagEnum.ENTRY_AUDIT.getCode().equals(u.getEmploymentFlag())
|
||||
|| UserEmploymentFlagEnum.RESIGNATION_AUDIT.getCode().equals(u.getEmploymentFlag())) {
|
||||
throw new BizException("该固定用户存在未离职信息,无法添加");
|
||||
}
|
||||
});
|
||||
|
||||
Optional<UserDO> optionalUserDO = userList.stream().filter(u -> AuthContext.getTenantId().equals(u.getCorpinfoId()) || u.getCorpinfoId() == null).findFirst();
|
||||
if (optionalUserDO.isPresent()) {
|
||||
addFlag = false;
|
||||
|
|
@ -501,7 +501,6 @@ public class UserAddExe {
|
|||
userDOUpdate = optionalUserDO.get();
|
||||
}
|
||||
}
|
||||
//userE.setUserId(userList.get(0).getUserId());
|
||||
}
|
||||
|
||||
boolean res = false;
|
||||
|
|
@ -514,9 +513,11 @@ public class UserAddExe {
|
|||
if (!res) {
|
||||
throw new BizException("保存失败");
|
||||
}
|
||||
|
||||
userExpandInfoRepository.updateByPhone(cmd.getPhone(),cmd.getFlowFlag());
|
||||
|
||||
//新增userExtandInfo
|
||||
UserExpandInfoE userExpandInfoE = new UserExpandInfoE();
|
||||
BeanUtils.copyProperties(userE, userExpandInfoE);
|
||||
userExpandInfoE.initAdd(userE);
|
||||
userExpandInfoGateway.add(userExpandInfoE);
|
||||
} else {
|
||||
userGateway.updateXgf(userE, userDOUpdate.getId());
|
||||
//修改
|
||||
|
|
|
|||
|
|
@ -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("系统角色名称重复,请联系管理员");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -3,10 +3,8 @@ package com.zcloud.basic.info.command;
|
|||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.alibaba.cola.dto.Response;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import com.alibaba.cola.exception.BizException;
|
||||
import com.jjb.saas.system.client.user.facade.UserFacade;
|
||||
import com.jjb.saas.system.client.user.response.UserDetailCO;
|
||||
import com.zcloud.basic.info.constant.RedisConstant;
|
||||
import com.zcloud.basic.info.domain.enums.UserEmploymentFlagEnum;
|
||||
import com.zcloud.basic.info.domain.gateway.UserGateway;
|
||||
|
|
@ -48,7 +46,7 @@ public class UserRemoveExe {
|
|||
userGateway.deletedUserById(id);
|
||||
} catch (Exception e){
|
||||
e.printStackTrace();
|
||||
throw new BizException("数据异常,请联系管理员删除");
|
||||
throw new BizException("删除失败");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
@ -59,13 +57,12 @@ public class UserRemoveExe {
|
|||
UserDO userDO = userRepository.getById(cmd.getId());
|
||||
|
||||
// 获取redis验证码
|
||||
if (!"369258".equals(cmd.getPhoneCode())) {
|
||||
Object phoneCodeObj = zcloudRedisUtil.get(RedisConstant.PHONE_CODE_KEY + userDO.getPhone());
|
||||
if (phoneCodeObj == null || !phoneCodeObj.toString().equals(cmd.getPhoneCode())) {
|
||||
throw new BizException("验证码已过期或错误");
|
||||
}
|
||||
zcloudRedisUtil.del(RedisConstant.PHONE_CODE_KEY + userDO.getPhone());
|
||||
Object phoneCodeObj = zcloudRedisUtil.get(RedisConstant.PHONE_CODE_KEY + userDO.getPhone());
|
||||
if(phoneCodeObj == null || !phoneCodeObj.toString().equals(cmd.getPhoneCode())){
|
||||
throw new BizException("验证码已过期或错误");
|
||||
}
|
||||
zcloudRedisUtil.del(RedisConstant.PHONE_CODE_KEY + userDO.getPhone());
|
||||
|
||||
try {
|
||||
//TODO 处理所有未完成的工作,如果是非固定人员,包括所有企业的未完成工作
|
||||
// 如果是固定人员,判断是否离职
|
||||
|
|
@ -75,29 +72,14 @@ public class UserRemoveExe {
|
|||
if(CollUtil.isNotEmpty(userDOList)){
|
||||
throw new BizException("您目前还有未离职信息,无法直接注销,请先在\"就职单位\"页面中离职");
|
||||
}
|
||||
List<UserDO> userDOListALl = userRepository.getListByPhone(userDO.getPhone(),null);
|
||||
|
||||
// 删除用户表
|
||||
Long userId = cmd.getId();
|
||||
userGateway.deletedUserByPhone(userDO.getPhone());
|
||||
|
||||
|
||||
userDOListALl.forEach(info -> {
|
||||
SingleResponse<UserDetailCO> detail=null;
|
||||
try {
|
||||
log.info("updateXgf,GBS获取用户信息{}", info.getId());
|
||||
detail = userFacade.getDetail(info.getId());
|
||||
log.info("updateXgf,GBS获取用户信息返回: {}", JSONUtil.toJsonStr(detail));
|
||||
|
||||
if(detail.getData() != null){
|
||||
log.info("删除底座用户信息,userId:{}",info.getId());
|
||||
Response delete = userFacade.delete(info.getId());
|
||||
log.info("删除底座用户信息,userId:{},返回结果:{}",info.getId(), JSONUtil.toJsonStr( delete));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("updateXgf,GBS删除用户失败: {}", e.getMessage());
|
||||
}
|
||||
});
|
||||
userGateway.deletedUserById(userId);
|
||||
|
||||
log.info("删除底座用户信息,userId:{}",userId);
|
||||
Response delete = userFacade.delete(cmd.getId());
|
||||
log.info("删除底座用户信息,userId:{},返回结果:{}",userId, JSONUtil.toJsonStr( delete));
|
||||
|
||||
} catch (Exception e){
|
||||
e.printStackTrace();
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@ import com.jjb.saas.system.client.user.facade.UserFacade;
|
|||
import com.jjb.saas.system.client.user.request.RoleDeptAddCmd;
|
||||
import com.jjb.saas.system.client.user.request.UserUpdateQuitCmd;
|
||||
import com.jjb.saas.system.client.user.response.UserDetailCO;
|
||||
import com.sun.xml.bind.v2.TODO;
|
||||
import com.zcloud.basic.info.constant.RedisConstant;
|
||||
import com.zcloud.basic.info.domain.enums.*;
|
||||
import com.zcloud.basic.info.domain.gateway.*;
|
||||
|
|
@ -88,10 +87,6 @@ public class UserUpdateExe {
|
|||
}
|
||||
|
||||
}
|
||||
if(!Objects.equals(userE.getUserIdCard(), userDO.getUserIdCard())){
|
||||
//判断
|
||||
userRepository.checkUserIdCard(userUpdateCmd.getId(),userUpdateCmd.getUserIdCard());
|
||||
}
|
||||
|
||||
CorpInfoDO corpInfoDO = corpInfoRepository.getById(userDO.getCorpinfoId());
|
||||
if(corpInfoDO != null){
|
||||
|
|
@ -139,10 +134,9 @@ public class UserUpdateExe {
|
|||
}else {
|
||||
// 企业端/监管端
|
||||
boolean res = userGateway.update(userE);
|
||||
if(!Objects.equals(userE.getPhone(), userDO.getPhone())
|
||||
|| !Objects.equals(userE.getEmail(), userDO.getEmail())
|
||||
|| !Objects.equals(userE.getName(), userDO.getName())
|
||||
|| !Objects.equals(userE.getRoleId(), userDO.getRoleId())){
|
||||
if(!userE.getPhone().equals(userDO.getPhone())
|
||||
|| !userE.getEmail().equals(userDO.getEmail())
|
||||
|| !userE.getName().equals(userDO.getName())){
|
||||
// 判断底座是否有该用户信息,如果没有则不调用底座
|
||||
SingleResponse<UserDetailCO> detail = null;
|
||||
try {
|
||||
|
|
@ -204,13 +198,10 @@ public class UserUpdateExe {
|
|||
|
||||
// 根据手机号查询用户信息
|
||||
List<UserDO> listByPhone = userRepository.getListByPhone(cmd.getPhone(),null);
|
||||
if(CollUtil.isEmpty(listByPhone)){
|
||||
throw new BizException("手机号不存在");
|
||||
}
|
||||
|
||||
UserE userE = new UserE();
|
||||
userE.checkPassword(cmd.getNewPassword(), cmd.getConfirmPassword());
|
||||
//TODO 需要修改
|
||||
if (!"369258".equals(cmd.getPhoneCode())) {
|
||||
if (!"123".equals(cmd.getPhoneCode())) {
|
||||
// 获取redis验证码
|
||||
Object phoneCodeObj = zcloudRedisUtil.get(RedisConstant.PHONE_CODE_KEY + cmd.getPhone());
|
||||
if (phoneCodeObj == null || !phoneCodeObj.toString().equals(cmd.getPhoneCode())) {
|
||||
|
|
@ -228,10 +219,7 @@ public class UserUpdateExe {
|
|||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean updatePasswordFromApp(AppUserUpdatePassWordCmd cmd) {
|
||||
//新密码和旧密码不能相同
|
||||
if (cmd.getPassword().equals(cmd.getNewPassword())) {
|
||||
throw new BizException("新密码不能与旧密码相同");
|
||||
}
|
||||
|
||||
UserE userE = new UserE();
|
||||
userE.checkPassword(cmd.getNewPassword(), cmd.getConfirmPassword());
|
||||
|
||||
|
|
|
|||
|
|
@ -69,32 +69,6 @@ public class CorpInfoQueryExe {
|
|||
if (CollUtil.isEmpty(examCenterCOS)) {
|
||||
return PageResponse.of(examCenterCOS, pageResponse.getTotalCount(), pageResponse.getPageSize(), pageResponse.getPageIndex());
|
||||
}
|
||||
processList(examCenterCOS, pageResponse);
|
||||
return PageResponse.of(examCenterCOS, pageResponse.getTotalCount(), pageResponse.getPageSize(), pageResponse.getPageIndex());
|
||||
}
|
||||
/**
|
||||
* 分页
|
||||
*
|
||||
* @param corpInfoPageQry
|
||||
* @return
|
||||
*/
|
||||
public PageResponse<CorpInfoCO> executeBasic(CorpInfoPageQry corpInfoPageQry) {
|
||||
|
||||
Map<String, Object> parmas = PageQueryHelper.toHashMap(corpInfoPageQry);
|
||||
if (corpInfoPageQry.getLeCreateTime() != null) {
|
||||
parmas.put("leCreateTime", corpInfoPageQry.getLeCreateTime().plusDays(1));
|
||||
}
|
||||
PageResponse<CorpInfoDO> pageResponse = corpInfoRepository.listBasicPage(parmas);
|
||||
List<CorpInfoCO> examCenterCOS = corpInfoCoConvertor.converDOsToCOs(pageResponse.getData());
|
||||
if (CollUtil.isEmpty(examCenterCOS)) {
|
||||
return PageResponse.of(examCenterCOS, pageResponse.getTotalCount(), pageResponse.getPageSize(), pageResponse.getPageIndex());
|
||||
}
|
||||
processList(examCenterCOS, pageResponse);
|
||||
return PageResponse.of(examCenterCOS, pageResponse.getTotalCount(), pageResponse.getPageSize(), pageResponse.getPageIndex());
|
||||
}
|
||||
|
||||
private void processList(List<CorpInfoCO> examCenterCOS, PageResponse<CorpInfoDO> pageResponse){
|
||||
|
||||
//examCenterCOS获取id集合
|
||||
List<Long> corpInfoIdList = examCenterCOS.stream().map(CorpInfoCO::getId).collect(Collectors.toList());
|
||||
List<CorpFormDO> corpFormDOList = corpFormRepository.getCorpListByTypeList(corpInfoIdList, Arrays.asList(CorpFormTypeEnum.SELECTFROM.getCode()));
|
||||
|
|
@ -110,6 +84,7 @@ public class CorpInfoQueryExe {
|
|||
.collect(Collectors.joining(",")));
|
||||
}
|
||||
});
|
||||
return PageResponse.of(examCenterCOS, pageResponse.getTotalCount(), pageResponse.getPageSize(), pageResponse.getPageIndex());
|
||||
}
|
||||
|
||||
public PageResponse<CorpInfoCO> executeNoPms(CorpInfoPageQry corpInfoPageQry) {
|
||||
|
|
@ -214,7 +189,7 @@ public class CorpInfoQueryExe {
|
|||
List<CorpDepartmentE> corpInfoList = corpInfoCoConvertor.converDOsToCorpDepartCOs(pageResponse.getData());
|
||||
corpInfoList.forEach(corpInfo -> {
|
||||
Map<String, Object> departParmas = new HashMap<>();
|
||||
departParmas.put("eqCorpinfoId", corpInfo.getId());
|
||||
departParmas.put("eqId", corpInfo.getId());
|
||||
List<DepartmentDO> list = departmentRepository.listByParams(departParmas);
|
||||
if (CollUtil.isNotEmpty(list)) {
|
||||
List<DepartmentE> departmentES = corpInfoCoConvertor.converDOsToDepartE(list);
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|||
import com.jjb.saas.framework.auth.utils.AuthContext;
|
||||
import com.zcloud.basic.info.command.convertor.DepartmentCoConvertor;
|
||||
import com.zcloud.basic.info.domain.enums.CommonFlagEnum;
|
||||
import com.zcloud.basic.info.domain.enums.CorpTypeEnum;
|
||||
import com.zcloud.basic.info.dto.*;
|
||||
import com.zcloud.basic.info.dto.clientobject.*;
|
||||
import com.zcloud.basic.info.persistence.dataobject.DepartmentDO;
|
||||
|
|
@ -153,17 +152,13 @@ public class DepartmentQueryExe {
|
|||
}
|
||||
|
||||
public List<DepartmentTreeInfoCO> listAllTree() {
|
||||
|
||||
List<DepartmentDO> pageResponse = departmentRepository.listAllTree();
|
||||
if (CollUtil.isEmpty(pageResponse)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
List<DepartmentTreeInfoCO> result2 = getDepartmentAllTree(pageResponse);
|
||||
return result2;
|
||||
}
|
||||
|
||||
private List<DepartmentTreeInfoCO> getDepartmentAllTree(List<DepartmentDO> pageResponse) {
|
||||
List<DepartmentTreeInfoCO> examCenterCOS = departmentCoConvertor.converDOsToInfoCOs(pageResponse);
|
||||
Map<Long, String> corpinfoMap = corpInfoRepository.getCorpinfoNameByCorpinfoId(examCenterCOS.stream().map(DepartmentTreeInfoCO::getCorpinfoId).distinct().collect(Collectors.toList()));
|
||||
Map<Long, String> corpinfoMap = corpInfoRepository.getCorpinfoNameByCorpinfoId(examCenterCOS.stream().map(DepartmentTreeInfoCO::getCorpinfoId).collect(Collectors.toList()));
|
||||
if (CollUtil.isNotEmpty(corpinfoMap)) {
|
||||
List<Long> departmentIds = examCenterCOS.stream().peek(examCenterCO -> {
|
||||
examCenterCO.setCorpinfoName(corpinfoMap.getOrDefault(examCenterCO.getCorpinfoId(), StringUtils.EMPTY));
|
||||
|
|
@ -177,30 +172,16 @@ public class DepartmentQueryExe {
|
|||
//按照企业分组
|
||||
List<List<DepartmentTreeInfoCO>> result1= new ArrayList<>();
|
||||
List<DepartmentTreeInfoCO> result2= new ArrayList<>();
|
||||
// Map<Long, List<DepartmentTreeInfoCO>> corpMap = examCenterCOS.stream().collect(Collectors.groupingBy(DepartmentTreeInfoCO::getCorpinfoId));
|
||||
// corpMap.forEach((corpId, list) -> {
|
||||
List<DepartmentTreeInfoCO> departmentTreeInfoCOS = Tools.buildEntityTree(examCenterCOS, "id", "parentId", "childrenList", 0L);
|
||||
Map<Long, List<DepartmentTreeInfoCO>> corpMap = examCenterCOS.stream().collect(Collectors.groupingBy(DepartmentTreeInfoCO::getCorpinfoId));
|
||||
corpMap.forEach((corpId, list) -> {
|
||||
List<DepartmentTreeInfoCO> departmentTreeInfoCOS = Tools.buildEntityTree(list, "id", "parentId", "childrenList", 0L);
|
||||
if(CollUtil.isNotEmpty(departmentTreeInfoCOS)){
|
||||
result2.addAll(departmentTreeInfoCOS);
|
||||
}
|
||||
// });
|
||||
});
|
||||
|
||||
|
||||
return result2;
|
||||
}
|
||||
|
||||
public Collection<DepartmentTreeInfoCO> listAllTreeByCorpType(DepartmentTreeQry qry) {
|
||||
Map<String, Object> parmas = PageQueryHelper.toHashMap(qry);
|
||||
List<Integer> enterpriseType =CorpTypeEnum.getCodesByEnterpriseType(qry.getEnterpriseType());
|
||||
if (CollUtil.isNotEmpty(enterpriseType)) {
|
||||
parmas.put("inType",enterpriseType);
|
||||
}
|
||||
List<DepartmentDO> pageResponse = departmentRepository.listAllTreeByCorpType(parmas);
|
||||
if (CollUtil.isEmpty(pageResponse)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
List<DepartmentTreeInfoCO> result2 = getDepartmentAllTree(pageResponse);
|
||||
return result2;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -110,25 +110,6 @@ public class UserQueryExe {
|
|||
|
||||
return SingleResponse.of(userCO);
|
||||
}
|
||||
/**
|
||||
* 详情
|
||||
*
|
||||
* @param userName
|
||||
* @return
|
||||
*/
|
||||
public SingleResponse<UserCO> executeGetInfoByUserName(String userName) {
|
||||
UserDO userDO = userRepository.getInfoByUserName(userName);
|
||||
UserCO userCO = new UserCO();
|
||||
BeanUtils.copyProperties(userDO, userCO);
|
||||
if(AuthContext.getTenantId()==null){
|
||||
UserExpandInfoDO userExpandInfoDO = userExpandInfoRepository.getInfoByPhone(userDO.getPhone());
|
||||
if(userExpandInfoDO!=null){
|
||||
userCO.setFlowFlag(userExpandInfoDO.getFlowFlag());
|
||||
}
|
||||
}
|
||||
|
||||
return SingleResponse.of(userCO);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -164,29 +145,6 @@ public class UserQueryExe {
|
|||
return userCOS;
|
||||
}
|
||||
|
||||
|
||||
public List<UserCO> listUserByUserName(Collection<String> collection) {
|
||||
QueryWrapper<UserDO> userDOQueryWrapper = new QueryWrapper<>();
|
||||
userDOQueryWrapper.in("username",collection);
|
||||
userDOQueryWrapper.eq("employment_flag", 1);
|
||||
userDOQueryWrapper.eq("delete_enum", "FALSE");
|
||||
userDOQueryWrapper.groupBy("username");
|
||||
List<UserDO> list = userRepository.list(userDOQueryWrapper);
|
||||
List<UserCO> userCOS = userCoConvertor.converDOsToCOs(list);
|
||||
return userCOS;
|
||||
}
|
||||
|
||||
|
||||
public List<UserCO> listUserByUserNameV1(Collection<String> collection) {
|
||||
QueryWrapper<UserDO> userDOQueryWrapper = new QueryWrapper<>();
|
||||
userDOQueryWrapper.in("username",collection);
|
||||
userDOQueryWrapper.eq("delete_enum", "FALSE");
|
||||
userDOQueryWrapper.groupBy("username");
|
||||
List<UserDO> list = userRepository.list(userDOQueryWrapper);
|
||||
List<UserCO> userCOS = userCoConvertor.converDOsToCOs(list);
|
||||
return userCOS;
|
||||
}
|
||||
|
||||
public List<UserCO> getUserList() {
|
||||
List<UserDO> list = userRepository.list();
|
||||
List<UserCO> userCOS = userCoConvertor.converDOsToCOs(list);
|
||||
|
|
@ -284,9 +242,7 @@ public class UserQueryExe {
|
|||
//判断用户信息是否完善
|
||||
UserE userCheck = new UserE();
|
||||
BeanUtils.copyProperties(userDO, userCheck);
|
||||
UserExpandInfoDO userExpandInfoDO = userExpandInfoRepository.getInfoByPhone(userDO.getPhone());
|
||||
Boolean b = userCheck.checkUserInfoComplete(userCheck,userExpandInfoDO==null?null:userExpandInfoDO.getFlowFlag());
|
||||
|
||||
Boolean b = userCheck.checkUserInfoComplete(userCheck);
|
||||
userLoginCO.setIsInfoComplete(b);
|
||||
|
||||
List<Long> userIds = userDOList.stream().map(UserDO::getId).collect(Collectors.toList());
|
||||
|
|
@ -297,28 +253,6 @@ public class UserQueryExe {
|
|||
userLoginCO.setUserCO(userCoConvertor.converDOToCO(userDO));
|
||||
return userLoginCO;
|
||||
}
|
||||
public UserLoginCO getUserCorpByPhone(UserAppPhoneCmd cmd) {
|
||||
UserLoginCO userLoginCO = new UserLoginCO();
|
||||
//返回企业列表
|
||||
//根据手机号获取用户列表
|
||||
List<UserDO> userDOList = userRepository.getListByPhone(cmd.getPhone(),null);
|
||||
if(CollUtil.isEmpty(userDOList)){
|
||||
throw new BizException("用户不存在");
|
||||
}
|
||||
//获取在职的用户取第一个
|
||||
UserDO userDO = userDOList.stream().filter(userDO1 -> UserEmploymentFlagEnum.ON.getCode().equals(userDO1.getEmploymentFlag())).findFirst().orElse(null);
|
||||
if(userDO == null){
|
||||
userDO = userDOList.get(0);
|
||||
}
|
||||
|
||||
List<Long> userIds = userDOList.stream().map(UserDO::getId).collect(Collectors.toList());
|
||||
List<UserCorpInfoDO> userCorpDOS = userRepository.getListByUserIds(userIds);
|
||||
List<UserCorpInfoCO> corpInfoCOS = corpInfoCoConvertor.converUserInfoDOsToCOs(userCorpDOS);
|
||||
|
||||
userLoginCO.setUserCorpInfoCOList(corpInfoCOS);
|
||||
userLoginCO.setUserCO(userCoConvertor.converDOToCO(userDO));
|
||||
return userLoginCO;
|
||||
}
|
||||
|
||||
public List<UserCorpInfoCO> getUserCorpList(Long id) {
|
||||
//返回企业列表
|
||||
|
|
@ -346,23 +280,5 @@ public class UserQueryExe {
|
|||
captchaCO.setCaptchaKey(captchaKey);
|
||||
return captchaCO;
|
||||
}
|
||||
|
||||
public SingleResponse<UserCO> getUserIdByPhone(GetUserIdByPhoneCmd getUserIdByPhoneCmd) {
|
||||
UserDO userDO =userRepository.getUserIdByPhone(getUserIdByPhoneCmd.getPhone());
|
||||
return SingleResponse.of(userCoConvertor.converDOToCO(userDO));
|
||||
|
||||
}
|
||||
|
||||
public PageResponse<UserCO> pageByNopermission(UserPageQry userPageQry) {
|
||||
Map<String, Object> params = PageQueryHelper.toHashMap(userPageQry);
|
||||
UserE userE = new UserE();
|
||||
userE.dataProcessingRights(AuthContext.getTenantId(), params);
|
||||
PageResponse<UserDO> pageResponse = userRepository.pageByNopermission(params);
|
||||
List<UserCO> examCenterCOS = userCoConvertor.converDOsToCOs(pageResponse.getData());
|
||||
|
||||
return PageResponse.of(examCenterCOS, pageResponse.getTotalCount(), pageResponse.getPageSize(), pageResponse.getPageIndex());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -42,11 +42,6 @@ public class CorpInfoServiceImpl implements CorpInfoServiceI {
|
|||
|
||||
return corpInfoQueryExe.execute(qry);
|
||||
}
|
||||
@Override
|
||||
public PageResponse<CorpInfoCO> listPageBasic(CorpInfoPageQry qry) {
|
||||
|
||||
return corpInfoQueryExe.executeBasic(qry);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResponse<CorpInfoCO> listPageNoPms(CorpInfoPageQry qry) {
|
||||
|
|
|
|||
|
|
@ -88,13 +88,6 @@ public class DepartmentServiceImpl implements DepartmentServiceI {
|
|||
public List<DepartmentTreeInfoCO> listAllTree() {
|
||||
return departmentQueryExe.listAllTree();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<DepartmentTreeInfoCO> listAllTreeByCorpType(DepartmentTreeQry qry) {
|
||||
return departmentQueryExe.listAllTreeByCorpType(qry);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@Cacheable(value = "deptAllNameCache", key="'deptId:'+#deptId")
|
||||
public String getFullNameForList(Long deptId, List<DepartmentCO> list) {
|
||||
|
|
|
|||
|
|
@ -126,16 +126,6 @@ public class UserServiceImpl implements UserServiceI {
|
|||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<UserCO> listUserByUserName(Collection<String> collection) {
|
||||
return userQueryExe.listUserByUserName(collection);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<UserCO> listUserByUserNameV1(Collection<String> collection) {
|
||||
return userQueryExe.listUserByUserNameV1(collection);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<UserCO> getUserList() {
|
||||
return userQueryExe.getUserList();
|
||||
|
|
@ -150,10 +140,6 @@ public class UserServiceImpl implements UserServiceI {
|
|||
public SingleResponse<UserCO> getInfoById(Long id) {
|
||||
return userQueryExe.executeGetInfo(id);
|
||||
}
|
||||
@Override
|
||||
public SingleResponse<UserCO> getInfoByUserName(String userName) {
|
||||
return userQueryExe.executeGetInfoByUserName(userName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Response verifyUser(UserVerifyQryCmd userVerifyQryCmd) {
|
||||
|
|
@ -222,11 +208,6 @@ public class UserServiceImpl implements UserServiceI {
|
|||
|
||||
}
|
||||
|
||||
@Override
|
||||
public UserLoginCO getUserCorpByPhone(UserAppPhoneCmd cmd) {
|
||||
return userQueryExe.getUserCorpByPhone(cmd);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<UserCorpInfoCO> getUserCorpList(Long id) {
|
||||
return userQueryExe.getUserCorpList(id);
|
||||
|
|
@ -237,15 +218,5 @@ public class UserServiceImpl implements UserServiceI {
|
|||
|
||||
return userQueryExe.generateCaptcha();
|
||||
}
|
||||
|
||||
@Override
|
||||
public SingleResponse<UserCO> getUserIdByPhone(GetUserIdByPhoneCmd getUserIdByPhoneCmd) {
|
||||
return userQueryExe.getUserIdByPhone(getUserIdByPhoneCmd);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResponse<UserCO> pageByNopermission(UserPageQry qry) {
|
||||
return userQueryExe.pageByNopermission(qry);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ import java.util.List;
|
|||
*/
|
||||
public interface CorpInfoServiceI {
|
||||
PageResponse<CorpInfoCO> listPage(CorpInfoPageQry qry);
|
||||
PageResponse<CorpInfoCO> listPageBasic(CorpInfoPageQry qry);
|
||||
PageResponse<CorpInfoCO> listPageNoPms(CorpInfoPageQry qry);
|
||||
|
||||
MultiResponse<CorpInfoCO> listAll(CorpInfoQry corpInfoQry);
|
||||
|
|
|
|||
|
|
@ -43,6 +43,5 @@ public interface DepartmentServiceI {
|
|||
String getFullNameForList(Long deptId, List<DepartmentCO> list);
|
||||
|
||||
|
||||
Collection<DepartmentTreeInfoCO> listAllTreeByCorpType(DepartmentTreeQry qry);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -51,14 +51,10 @@ public interface UserServiceI {
|
|||
|
||||
List<UserCO> listByUserIds(Collection<Long> collection);
|
||||
|
||||
List<UserCO> listUserByUserName(Collection<String> collection);
|
||||
|
||||
List<UserCO> listUserByUserNameV1(Collection<String> collection);
|
||||
List<UserCO> getUserList();
|
||||
|
||||
|
||||
SingleResponse<UserCO> getInfoById(Long id);
|
||||
|
||||
SingleResponse<UserCO> getInfoByUserName(String userName);
|
||||
Response verifyUser(UserVerifyQryCmd userVerifyQryCmd);
|
||||
|
||||
SingleResponse<UserCO> getInfoBySession();
|
||||
|
|
@ -88,13 +84,5 @@ public interface UserServiceI {
|
|||
List<UserCorpInfoCO> getUserCorpList(Long id);
|
||||
|
||||
CaptchaCO generateCaptcha();
|
||||
|
||||
SingleResponse<UserCO> getUserIdByPhone(GetUserIdByPhoneCmd getUserIdByPhoneCmd);
|
||||
|
||||
PageResponse<UserCO> pageByNopermission(UserPageQry qry);
|
||||
|
||||
List<UserCO> getUserList();
|
||||
|
||||
UserLoginCO getUserCorpByPhone(UserAppPhoneCmd cmd);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -32,8 +32,8 @@ public class CorpDepartmentQry extends PageQuery {
|
|||
@ApiModelProperty(value = "分公司名称", name = "likeCorpName")
|
||||
private String likeCorpName;
|
||||
|
||||
@ApiModelProperty(value = "分公司状态编码", name = "eqCorpState")
|
||||
private String eqCorpState;
|
||||
@ApiModelProperty(value = "分公司状态编码", name = "eqCorpStateCode")
|
||||
private String eqCorpStateCode;
|
||||
|
||||
@ApiModelProperty(value = "是否启用,1:启用,0:关闭", name = "eqUseFlag")
|
||||
private String eqUseFlag;
|
||||
|
|
|
|||
|
|
@ -68,10 +68,6 @@ public class CorpInfoPageQry extends PageQuery {
|
|||
@ApiModelProperty(value = "企业类型1:监管 2:企业 3:相关方", name = "enterpriseType", required = true)
|
||||
private Integer enterpriseType;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "企业类型1:监管 2:企业 3:相关方", name = "enterpriseTypeList", required = true)
|
||||
private List<Integer> enterpriseTypeList;
|
||||
|
||||
@ApiModelProperty(value = "统一社会信用代码", name = "code", required = true)
|
||||
private String eqCode;
|
||||
|
||||
|
|
|
|||
|
|
@ -4,8 +4,6 @@ import com.alibaba.cola.dto.PageQuery;
|
|||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* web-client
|
||||
|
|
@ -31,11 +29,6 @@ public class DepartmentTreeQry {
|
|||
private Long eqCorpinfoId;
|
||||
@ApiModelProperty(value = "父id", name = "eqParentId")
|
||||
private Long eqParentId;
|
||||
@ApiModelProperty(value = "企业类型(0-普通企业,1-集团单位,2-股份单位,3-相关方企业,4-货主单位,5-驻港单位)", name = "inType")
|
||||
private List<Integer> inType;
|
||||
|
||||
@ApiModelProperty(value = "企业类型1:监管 2:企业 3:相关方", name = "enterpriseType")
|
||||
private List<Integer> enterpriseType;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,32 +0,0 @@
|
|||
package com.zcloud.basic.info.dto;
|
||||
|
||||
import com.alibaba.cola.dto.Command;
|
||||
import com.jjb.saas.security.starter.serialize.dto.MaskDTO;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* web-client
|
||||
*
|
||||
* @Author zhangyue
|
||||
* @Date 2025-11-04 14:07:38
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class GetUserIdByPhoneCmd {
|
||||
|
||||
@ApiModelProperty(value = "手机号", name = "phone")
|
||||
@NotEmpty(message = "手机号不能为空")
|
||||
private String phone;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -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;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -4,8 +4,6 @@ import com.alibaba.cola.dto.PageQuery;
|
|||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* web-client
|
||||
|
|
@ -48,17 +46,10 @@ public class UserPageQry extends PageQuery {
|
|||
private String eqPersonnelType;
|
||||
@ApiModelProperty(value = "身份证号")
|
||||
private String likeUserIdCard;
|
||||
@ApiModelProperty(value = "是否流动人员,1-流动,0-固定人员")
|
||||
private String eqFlowFlag;
|
||||
|
||||
|
||||
private String menuPath;
|
||||
|
||||
private Integer noMain;
|
||||
@ApiModelProperty(value = "企业类型(0-普通企业,1-集团单位,2-股份单位,3-相关方企业,4-货主单位,5-驻港单位, 6-物资中心)", name = "inType")
|
||||
private List<Integer> inType;
|
||||
|
||||
@ApiModelProperty(value = "企业类型1:监管 2:企业 3:相关方", name = "enterpriseType")
|
||||
private Integer enterpriseType;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,8 @@
|
|||
package com.zcloud.basic.info.dto;
|
||||
|
||||
import com.alibaba.cola.dto.PageQuery;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
|
||||
/**
|
||||
* web-client
|
||||
|
|
@ -29,20 +26,12 @@ public class UserQryCmd {
|
|||
private String eqCorpinfoId;
|
||||
private String eqDepartmentId;
|
||||
private String eqPostId;
|
||||
private Integer eqEmploymentFlag;
|
||||
|
||||
private Long corpinfoId;
|
||||
private Long departmentId;
|
||||
private Long postId;
|
||||
private String username;
|
||||
private Integer noMain;
|
||||
private String isMyCorp;
|
||||
|
||||
@ApiModelProperty(value = "是否流动人员,1-流动,0-固定人员", name = "flowFlag")
|
||||
private Integer flowFlag;
|
||||
// 入职状态
|
||||
@ApiModelProperty(value = "入职状态 入职状态,0-离职, 1-在职, 2-信息变更中, 3-未入职, 4-实习生, 5-实习结束, 6-退休, 7-劳务派遣, 8-劳务派遣结束, 11-入职待审核, 10-离职待审核")
|
||||
private Integer employmentFlag;
|
||||
@ApiModelProperty(value = "是否存在人资系统, 1-是, 0-否")
|
||||
private Integer rzFlag;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -34,8 +34,6 @@ public class CorpDepartmentCO extends ClientObject {
|
|||
private String corpType4;
|
||||
@ApiModelProperty(value = "企业状态")
|
||||
private String corpState;
|
||||
@ApiModelProperty(value = "企业状态名称")
|
||||
private String corpStateName;
|
||||
@ApiModelProperty(value = "是否启用,1:启用,0:关闭")
|
||||
private Integer useFlag;
|
||||
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ public class UserCO extends ClientObject {
|
|||
//人员在部门中的排序
|
||||
@ApiModelProperty(value = "人员在部门中的排序")
|
||||
private Integer sort;
|
||||
@ApiModelProperty(value = "是否存在人资系统, 1-是, 0-否")
|
||||
@ApiModelProperty(value = "是否存在人资系统, 1-存在, 0-不存在")
|
||||
private Integer rzFlag;
|
||||
|
||||
//乐观锁
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
package com.zcloud.basic.info.domain.enums;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.*;
|
||||
|
|
@ -18,8 +17,7 @@ public enum CorpTypeEnum {
|
|||
share(2,"股份单位",UserTypeEnum.JG.getCode()),
|
||||
serviceProvider(3, "相关方企业",UserTypeEnum.XGF.getCode()),
|
||||
cargoOwner(4, "货主单位",UserTypeEnum.XGF.getCode()),
|
||||
portUnit(5, "驻港单位",UserTypeEnum.XGF.getCode()),
|
||||
materialCenter(6, "物资中心",UserTypeEnum.QY.getCode());
|
||||
portUnit(5, "驻港单位",UserTypeEnum.XGF.getCode());
|
||||
|
||||
private static final Map<Integer, List<Integer>> ENTERPRISE_TYPE_CODE_MAP = new HashMap<>();
|
||||
|
||||
|
|
@ -47,18 +45,6 @@ public enum CorpTypeEnum {
|
|||
public static List<Integer> getCodesByEnterpriseType(Integer enterpriseType) {
|
||||
return ENTERPRISE_TYPE_CODE_MAP.getOrDefault(enterpriseType, Collections.emptyList());
|
||||
}
|
||||
public static List<Integer> getCodesByEnterpriseType(List<Integer> enterpriseTypeList) {
|
||||
if(CollUtil.isEmpty(enterpriseTypeList)){
|
||||
return null;
|
||||
}
|
||||
return enterpriseTypeList.stream()
|
||||
.flatMap(enterpriseType ->
|
||||
ENTERPRISE_TYPE_CODE_MAP.getOrDefault(enterpriseType, Collections.emptyList()).stream())
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
|
||||
}
|
||||
|
||||
public static Integer getUserTypeByCode(Integer code) {
|
||||
for (CorpTypeEnum corpType : values()) {
|
||||
if (corpType.code.equals(code)) {
|
||||
|
|
|
|||
|
|
@ -57,6 +57,5 @@ public interface UserGateway {
|
|||
|
||||
void updateXgf(UserE userE, Long id);
|
||||
|
||||
void deletedUserByPhone(String phone);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -37,8 +37,6 @@ public class CorpDepartmentE extends ClientObject {
|
|||
private String corpType4;
|
||||
@ApiModelProperty(value = "企业状态")
|
||||
private String corpState;
|
||||
@ApiModelProperty(value = "企业状态名称")
|
||||
private String corpStateName;
|
||||
@ApiModelProperty(value = "是否启用,1:启用,0:关闭")
|
||||
private Integer useFlag;
|
||||
|
||||
|
|
|
|||
|
|
@ -188,7 +188,7 @@ public class CorpInfoE extends BaseE {
|
|||
|
||||
public void checkList(int size){
|
||||
if(size > 0){
|
||||
throw new BizException("统一社会信用代码重复。");
|
||||
throw new BizException("社会统一信用代码重复。");
|
||||
}
|
||||
}
|
||||
public static Boolean isCorp() {
|
||||
|
|
|
|||
|
|
@ -161,11 +161,11 @@ public class UserE extends BaseE {
|
|||
// 微信openid
|
||||
private String openId;
|
||||
|
||||
public static Boolean checkUserInfoComplete(UserE userE, Integer flowFlag) {
|
||||
public static Boolean checkUserInfoComplete(UserE userE) {
|
||||
return StringUtils.isNotEmpty(userE.getUsername()) &&
|
||||
StringUtils.isNotEmpty(userE.getPhone()) &&
|
||||
StringUtils.isNotEmpty(userE.getUserIdCard()) &&
|
||||
flowFlag != null;
|
||||
userE.getFlowFlag() != null;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -306,13 +306,6 @@ public class UserE extends BaseE {
|
|||
String s1 = MD5.md5(password);
|
||||
return s.equalsIgnoreCase(s1);
|
||||
}
|
||||
public Boolean checkUserEncryptionPassword(String password, String content) {
|
||||
String newPassword = DataEncryptDecryptUtil.sm2Decrypt(privateKey, publicKey, password);
|
||||
String oldPassword = DataEncryptDecryptUtil.sm2Decrypt(privateKey, publicKey, content);
|
||||
// String s1 = MD5.md5(password);
|
||||
return newPassword.equalsIgnoreCase(oldPassword);
|
||||
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
String publicKey = "0402df2195296d4062ac85ad766994d73e871b887e18efb9a9a06b4cebc72372869b7da6c347c129dee2b46a0f279ff066b01c76208c2a052af75977c722a2ccee";
|
||||
|
|
@ -373,10 +366,7 @@ public class UserE extends BaseE {
|
|||
}
|
||||
//判断是否在当前企业存在
|
||||
//判断是否有当前企业
|
||||
boolean flag = userEList.stream().filter(userE -> UserEmploymentFlagEnum.ON.getCode().equals(userE.getEmploymentFlag())
|
||||
|| UserEmploymentFlagEnum.ENTRY_AUDIT.getCode().equals(userE.getEmploymentFlag())
|
||||
|| UserEmploymentFlagEnum.RESIGNATION_AUDIT.getCode().equals(userE.getEmploymentFlag())
|
||||
).anyMatch(userE -> AuthContext.getTenantId().equals(userE.getCorpinfoId()));
|
||||
boolean flag = userEList.stream().anyMatch(userE -> AuthContext.getTenantId().equals(userE.getCorpinfoId()));
|
||||
if (flag) {
|
||||
throw new BizException("当前手机号当前企业已存在");
|
||||
}
|
||||
|
|
@ -392,7 +382,5 @@ public class UserE extends BaseE {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -272,19 +272,13 @@ public class Smb {
|
|||
// return this.saveFile(multipartFile,Const.FILEPATHFILE);
|
||||
// }
|
||||
|
||||
public static String saveFile(MultipartFile file, String filePath) throws Exception{
|
||||
// 生成文件名
|
||||
String fileName = Tools.get32UUID() + file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
|
||||
// 根据项目类型生成项目文件
|
||||
sshSftp(file, fileName, filePath);
|
||||
// 返回文件保存目录
|
||||
return filePath + "/" + fileName;
|
||||
}
|
||||
public static String saveFile(InputStream fileio, String fileName, String filePath) throws Exception{
|
||||
// 根据项目类型生成项目文件
|
||||
sshSftpForInput(fileio, fileName, filePath);
|
||||
// 返回文件保存目录
|
||||
return filePath + "/" + fileName;
|
||||
}
|
||||
public static String saveFile(MultipartFile file, String filePath) throws Exception{
|
||||
// 生成文件名
|
||||
String fileName = Tools.get32UUID() + file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
|
||||
// 根据项目类型生成项目文件
|
||||
sshSftp(file, fileName, filePath);
|
||||
// 返回文件保存目录
|
||||
return filePath + "/" + fileName;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ package com.zcloud.basic.info.gatewayimpl;
|
|||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.alibaba.cola.dto.Response;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.jjb.saas.system.client.user.facade.UserFacade;
|
||||
import com.jjb.saas.system.client.user.request.RoleDeptAddCmd;
|
||||
|
|
@ -222,11 +221,5 @@ public class UserGatewayImpl implements UserGateway {
|
|||
this.update(userE);
|
||||
userRepository.updateXgf(userE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deletedUserByPhone(String phone) {
|
||||
|
||||
userRepository.deletedUserByPhone(phone);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ import java.util.Map;
|
|||
*/
|
||||
@Mapper
|
||||
@DataScopes({
|
||||
@DataScope(method = "selectUserBasicPage", menuPerms = ""),
|
||||
@DataScope(method = "selectUserPage", menuPerms = ""),
|
||||
@DataScope(method = "corpUserMiddlePage", menuPerms = ""),
|
||||
})
|
||||
public interface CorpInfoMapper extends BaseMapper<CorpInfoDO> {
|
||||
|
|
@ -28,7 +28,6 @@ public interface CorpInfoMapper extends BaseMapper<CorpInfoDO> {
|
|||
IPage<CorpInfoDO> corpUserMiddlePage(IPage<CorpInfoDO> iPage, Map<String, Object> params, String menuPerms);
|
||||
|
||||
IPage<CorpInfoDO> selectUserPage(IPage<CorpInfoDO> iPage, @Param("ew") QueryWrapper<CorpInfoDO> queryWrapper, String menuPerms);
|
||||
IPage<CorpInfoDO> selectUserBasicPage(IPage<CorpInfoDO> iPage, @Param("ew") QueryWrapper<CorpInfoDO> queryWrapper, String menuPerms);
|
||||
|
||||
IPage<CorpInfoDO> selectUserPageNoPms(IPage<CorpInfoDO> iPage, @Param("ew") QueryWrapper<CorpInfoDO> queryWrapper, String menuPerms);
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@ import org.apache.ibatis.annotations.Mapper;
|
|||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* web-infrastructure
|
||||
|
|
@ -27,7 +26,5 @@ public interface DepartmentMapper extends BaseMapper<DepartmentDO> {
|
|||
|
||||
List<DepartmentDO> listAllTree();
|
||||
IPage<DepartmentDO> selectDeptPage(IPage<DepartmentDO> iPage, @Param("ew") QueryWrapper<DepartmentDO> queryWrapper, String menuPerms);
|
||||
|
||||
List<DepartmentDO> listAllTreeByCorpType(Map<String, Object> parmas);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -32,8 +32,6 @@ public interface UserMapper extends BaseMapper<UserDO> {
|
|||
|
||||
UserDO getInfoById(@Param("id") Long id);
|
||||
|
||||
UserDO getInfoByUserName(@Param("params") Map<String, Object> params);
|
||||
|
||||
List<DepartmentLeaderStatictiscDO> getDepartmentLeaderByDepartmentId(List<Long> departmentIds);
|
||||
|
||||
Integer countUser(@Param("params") Map<String, Object> params);
|
||||
|
|
@ -41,11 +39,5 @@ public interface UserMapper extends BaseMapper<UserDO> {
|
|||
IPage<UserDO> listXgf(IPage<UserDO> iPage, Map<String, Object> params, String menuPerms);
|
||||
|
||||
List<UserCorpInfoDO> getListByUserIds(List<Long> userIds);
|
||||
|
||||
void deletedUserByPhone(String phone);
|
||||
|
||||
UserDO getUserIdByPhone(String phone);
|
||||
|
||||
IPage<UserDO> pageByNopermission(IPage<UserDO> iPage, @Param("ew") QueryWrapper<UserDO> queryWrapper);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ import java.util.Map;
|
|||
*/
|
||||
public interface CorpInfoRepository extends BaseRepository<CorpInfoDO> {
|
||||
PageResponse<CorpInfoDO> listPage(Map<String, Object> parmas);
|
||||
PageResponse<CorpInfoDO> listBasicPage(Map<String, Object> parmas);
|
||||
PageResponse<CorpInfoDO> listPageNoPms(Map<String, Object> parmas);
|
||||
List<CorpInfoDO> listAll(Map<String, Object> params);
|
||||
|
||||
|
|
@ -41,6 +40,5 @@ public interface CorpInfoRepository extends BaseRepository<CorpInfoDO> {
|
|||
|
||||
List<CorpInfoDO> getByIdList(List<Long> corpinfoIds);
|
||||
|
||||
Boolean isSupper();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -36,7 +36,5 @@ public interface DepartmentRepository extends BaseRepository<DepartmentDO> {
|
|||
List<DepartmentDO> listAllTree();
|
||||
|
||||
boolean existsByName(@NotEmpty(message = "名称不能为空") String name);
|
||||
|
||||
List<DepartmentDO> listAllTreeByCorpType(Map<String, Object> parmas);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -34,8 +34,6 @@ public interface UserRepository extends BaseRepository<UserDO> {
|
|||
Boolean checkUserDepartment(Long[] ids);
|
||||
|
||||
UserDO getInfoById(Long id);
|
||||
|
||||
UserDO getInfoByUserName(String userName);
|
||||
Response countUser(Map<String,Object> params);
|
||||
|
||||
List<UserDO> listByPostId(Long postId);
|
||||
|
|
@ -83,7 +81,7 @@ public interface UserRepository extends BaseRepository<UserDO> {
|
|||
|
||||
UserDO getByPhoneAndIdCard(String phone, String idCardNumber);
|
||||
|
||||
void checkUserIdCard( Long id, String userIdCard);
|
||||
void checkUserIdCard(@NotNull(message = "手机号不能为空") String phone, String userIdCard);
|
||||
|
||||
List<UserDO> getListByPhone(String phone,List<Integer> employmentFlagList);
|
||||
|
||||
|
|
@ -92,11 +90,5 @@ public interface UserRepository extends BaseRepository<UserDO> {
|
|||
List<UserDO> getByIdCard(String userIdCard, List<Integer> employmentFlagList);
|
||||
|
||||
void updateXgf(UserE userE);
|
||||
|
||||
void deletedUserByPhone(String phone);
|
||||
|
||||
UserDO getUserIdByPhone(@NotEmpty(message = "手机号不能为空") String phone);
|
||||
|
||||
PageResponse<UserDO> pageByNopermission(Map<String, Object> params);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -66,44 +66,21 @@ public class CorpInfoRepositoryImpl extends BaseRepositoryImpl<CorpInfoMapper, C
|
|||
public PageResponse<CorpInfoDO> listPage(Map<String, Object> params) {
|
||||
IPage<CorpInfoDO> iPage = new Query<CorpInfoDO>().getPage(params);
|
||||
QueryWrapper<CorpInfoDO> queryWrapper = new QueryWrapper<>();
|
||||
String menuPerms = "";
|
||||
initParams(queryWrapper, menuPerms, params);
|
||||
IPage<CorpInfoDO> result = corpInfoMapper.selectUserPage(iPage, queryWrapper, menuPerms);
|
||||
return PageHelper.pageToResponse(result, result.getRecords());
|
||||
}
|
||||
@Override
|
||||
public PageResponse<CorpInfoDO> listBasicPage(Map<String, Object> params) {
|
||||
IPage<CorpInfoDO> iPage = new Query<CorpInfoDO>().getPage(params);
|
||||
QueryWrapper<CorpInfoDO> queryWrapper = new QueryWrapper<>();
|
||||
String menuPerms = "";
|
||||
initParams(queryWrapper, menuPerms, params);
|
||||
IPage<CorpInfoDO> result = corpInfoMapper.selectUserBasicPage(iPage, queryWrapper, menuPerms);
|
||||
return PageHelper.pageToResponse(result, result.getRecords());
|
||||
}
|
||||
private void initParams(QueryWrapper<CorpInfoDO> queryWrapper, String menuPerms, Map<String, Object> params){
|
||||
queryWrapper = PageQueryHelper.createPageQueryWrapper(queryWrapper, params);
|
||||
List<Integer> enterpriseType = CorpTypeEnum.getCodesByEnterpriseType((Integer) params.get("enterpriseType"));
|
||||
if (CollUtil.isNotEmpty(enterpriseType)) {
|
||||
queryWrapper.in("type", enterpriseType);
|
||||
}
|
||||
if (params.get("enterpriseTypeList") != null
|
||||
&& params.get("enterpriseTypeList") instanceof List){
|
||||
List<Integer> enterpriseTypeList = (List<Integer>) params.get("enterpriseTypeList");
|
||||
if (enterpriseTypeList != null && enterpriseTypeList.size() > 0){
|
||||
List<Integer> entTypeList = CorpTypeEnum.getCodesByEnterpriseType(enterpriseTypeList);
|
||||
if (CollUtil.isNotEmpty(entTypeList)) {
|
||||
queryWrapper.in("type", entTypeList);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
queryWrapper.orderByAsc("corp_order").orderByDesc("create_time");
|
||||
|
||||
String menuPerms = "";
|
||||
if (!ObjectUtils.isEmpty(params.get("menuPath"))) {
|
||||
menuPerms = MenuEnum.getMenuKeyByPath(params.get("menuPath").toString());
|
||||
}
|
||||
queryWrapper.eq("delete_enum", "FALSE");
|
||||
IPage<CorpInfoDO> result = corpInfoMapper.selectUserPage(iPage, queryWrapper, menuPerms);
|
||||
return PageHelper.pageToResponse(result, result.getRecords());
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResponse<CorpInfoDO> listPageNoPms(Map<String, Object> params) {
|
||||
IPage<CorpInfoDO> iPage = new Query<CorpInfoDO>().getPage(params);
|
||||
|
|
@ -279,16 +256,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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -130,11 +130,6 @@ public class DepartmentRepositoryImpl extends BaseRepositoryImpl<DepartmentMappe
|
|||
return departmentMapper.listAllTree();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DepartmentDO> listAllTreeByCorpType(Map<String, Object> parmas) {
|
||||
return departmentMapper.listAllTreeByCorpType(parmas);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean existsByName(String name) {
|
||||
QueryWrapper<DepartmentDO> queryWrapper = new QueryWrapper<>();
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@ import com.jjb.saas.system.client.role.response.RoleCO;
|
|||
import com.jjb.saas.system.client.user.facade.UserFacade;
|
||||
import com.jjb.saas.system.client.user.request.*;
|
||||
import com.jjb.saas.system.client.user.response.UserDetailCO;
|
||||
import com.zcloud.basic.info.domain.enums.CorpTypeEnum;
|
||||
import com.zcloud.basic.info.domain.enums.MenuEnum;
|
||||
import com.zcloud.basic.info.domain.enums.UserEmploymentFlagEnum;
|
||||
import com.zcloud.basic.info.domain.enums.UserTypeEnum;
|
||||
|
|
@ -123,41 +122,6 @@ public class UserRepositoryImpl extends BaseRepositoryImpl<UserMapper, UserDO> i
|
|||
return PageHelper.pageToResponse(result, result.getRecords());
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResponse<UserDO> pageByNopermission(Map<String, Object> params) {
|
||||
if (params.get("inDepartmentId") != null) {
|
||||
Long[] inDepartmentIds = (Long[]) params.get("inDepartmentId");
|
||||
if (inDepartmentIds == null || inDepartmentIds.length == 0) {
|
||||
params.remove("inDepartmentId");
|
||||
}
|
||||
}
|
||||
QueryWrapper<UserDO> queryWrapper = new QueryWrapper<>();
|
||||
List<Integer> enterpriseType = CorpTypeEnum.getCodesByEnterpriseType((Integer) params.get("enterpriseType"));
|
||||
if (CollUtil.isNotEmpty(enterpriseType)) {
|
||||
params.remove("enterpriseType");
|
||||
queryWrapper.in("c.type", enterpriseType);
|
||||
queryWrapper.eq("c.use_flag", 1);
|
||||
}
|
||||
List<Integer> inType = (List<Integer>) params.get("inType");
|
||||
if (CollUtil.isNotEmpty(inType)) {
|
||||
queryWrapper.in("c.type", inType);
|
||||
queryWrapper.eq("c.use_flag", 1);
|
||||
}
|
||||
params.remove("inType");
|
||||
IPage<UserDO> iPage = new Query<UserDO>().getPage(params);
|
||||
|
||||
queryWrapper = PageQueryHelper.createPageQueryWrapper(queryWrapper, params, "u.");
|
||||
queryWrapper.eq("u.delete_enum", "FALSE");
|
||||
if (!ObjectUtils.isEmpty(params.get("noMain"))) {
|
||||
queryWrapper.apply("u.id != u.corpinfo_id");
|
||||
}
|
||||
|
||||
|
||||
queryWrapper.orderByAsc("c.corp_order").orderByAsc("u.sort").orderByDesc("u.create_time");
|
||||
IPage<UserDO> result = userMapper.pageByNopermission(iPage, queryWrapper);
|
||||
return PageHelper.pageToResponse(result, result.getRecords());
|
||||
}
|
||||
|
||||
@DubboReference
|
||||
private ZcloudImgFilesFacade zcloudImgFilesFacade;
|
||||
|
||||
|
|
@ -177,10 +141,8 @@ public class UserRepositoryImpl extends BaseRepositoryImpl<UserMapper, UserDO> i
|
|||
// List<Long> ids = new ArrayList<>();
|
||||
// ids.add(1999009782763397120L);
|
||||
// Map<Long, String> sd1 = zcloudDepartmentFacade.listFullName(ids);
|
||||
if (!ObjectUtils.isEmpty(params.get("eqEmploymentFlag"))){
|
||||
params.put("employmentFlag", params.get("eqEmploymentFlag"));
|
||||
}
|
||||
if (!ObjectUtils.isEmpty(params.get("isMyCorp"))) {
|
||||
|
||||
if (ObjectUtils.isEmpty(params.get("corpinfoId"))) {
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
params.put("corpinfoId", ssoUser.getTenantId());
|
||||
}
|
||||
|
|
@ -223,13 +185,6 @@ public class UserRepositoryImpl extends BaseRepositoryImpl<UserMapper, UserDO> i
|
|||
return userMapper.getInfoById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public UserDO getInfoByUserName(String username) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("username", username);
|
||||
return userMapper.getInfoByUserName(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Response countUser(Map<String, Object> params) {
|
||||
if (!ObjectUtils.isEmpty(params.get("username"))) {
|
||||
|
|
@ -301,8 +256,6 @@ public class UserRepositoryImpl extends BaseRepositoryImpl<UserMapper, UserDO> i
|
|||
if (userDo.getUserId() == null) {
|
||||
userDo.setUserId(Tools.get32UUID());
|
||||
}
|
||||
// 新增企业时,主账号默认入职
|
||||
userDo.setEmploymentFlag(1);
|
||||
save(userDo);
|
||||
userE.setId(userDo.getId());
|
||||
}
|
||||
|
|
@ -312,8 +265,6 @@ public class UserRepositoryImpl extends BaseRepositoryImpl<UserMapper, UserDO> i
|
|||
if (StringUtils.isEmpty(userDO.getUsername())) {
|
||||
userDO.setUsername(userDO.getPhone());
|
||||
}
|
||||
|
||||
|
||||
UserAddCmd userAddCmd = new UserAddCmd();
|
||||
userAddCmd.setAccount(userDO.getUsername());
|
||||
userAddCmd.setName(userDO.getName());
|
||||
|
|
@ -375,12 +326,7 @@ public class UserRepositoryImpl extends BaseRepositoryImpl<UserMapper, UserDO> i
|
|||
if (StringUtils.isEmpty(userDO.getUsername())) {
|
||||
userDO.setUsername(userDO.getPhone());
|
||||
}
|
||||
// userDO.setId(gbsResult.getData());
|
||||
|
||||
if (userDO.getSort() == null) {
|
||||
userDO.setSort(9999);
|
||||
}
|
||||
save(userDO);
|
||||
UserAddCmd userAddCmd = new UserAddCmd();
|
||||
userAddCmd.setAccount(userDO.getUsername());
|
||||
userAddCmd.setName(userDO.getName());
|
||||
|
|
@ -389,14 +335,18 @@ public class UserRepositoryImpl extends BaseRepositoryImpl<UserMapper, UserDO> i
|
|||
roleDeptAddCmd.setDeptId(userDO.getDepartmentId());
|
||||
List<RoleDeptAddCmd> roleDeptAddCmdList = Collections.singletonList(roleDeptAddCmd);
|
||||
userAddCmd.setRoleDepts(roleDeptAddCmdList);
|
||||
userAddCmd.setId(userDO.getId());
|
||||
log.info("GBS新增用户开始,用户信息:{}", JSONUtil.toJsonStr(userAddCmd));
|
||||
SingleResponse<Long> gbsResult = userFacade.add(userAddCmd);
|
||||
log.info("GBS新增用户结束,用户id:{},结果:{}", gbsResult.getData(), JSONUtil.toJsonStr(gbsResult));
|
||||
if (!gbsResult.isSuccess()) {
|
||||
throw new RuntimeException("GBS新增用户失败,用户id:" + gbsResult.getData());
|
||||
}
|
||||
userDO.setId(gbsResult.getData());
|
||||
|
||||
if (userDO.getSort() == null) {
|
||||
userDO.setSort(9999);
|
||||
}
|
||||
save(userDO);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -442,24 +392,14 @@ public class UserRepositoryImpl extends BaseRepositoryImpl<UserMapper, UserDO> i
|
|||
userDOUpdate.setId(id);
|
||||
userDOUpdate.setPassword(password);
|
||||
updateById(userDOUpdate);
|
||||
SingleResponse<UserDetailCO> detail = null;
|
||||
try {
|
||||
log.info("updateXgf,GBS获取用户信息{}", id);
|
||||
detail = userFacade.getDetail(id);
|
||||
log.info("updateXgf,GBS获取用户信息返回: {}", JSONUtil.toJsonStr(detail));
|
||||
} catch (Exception e) {
|
||||
log.error("updateXgf,GBS获取用户信息失败: {}", e.getMessage());
|
||||
}
|
||||
if(detail.getData() != null){
|
||||
//更新gbs密码
|
||||
UserUpdatePasswordCmd userUpdatePasswordCmd = new UserUpdatePasswordCmd();
|
||||
userUpdatePasswordCmd.setId(id);
|
||||
userUpdatePasswordCmd.setPassword(password);
|
||||
log.info("更新用户密码id:{}", id);
|
||||
Response response = userFacade.updatePassword(userUpdatePasswordCmd);
|
||||
log.info("更新密码结果:{}", response);
|
||||
}
|
||||
|
||||
//更新gbs密码
|
||||
UserUpdatePasswordCmd userUpdatePasswordCmd = new UserUpdatePasswordCmd();
|
||||
userUpdatePasswordCmd.setId(id);
|
||||
userUpdatePasswordCmd.setPassword(password);
|
||||
log.info("更新用户密码id:{}", id);
|
||||
Response response = userFacade.updatePassword(userUpdatePasswordCmd);
|
||||
log.info("更新密码结果:{}", response);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -490,7 +430,7 @@ public class UserRepositoryImpl extends BaseRepositoryImpl<UserMapper, UserDO> i
|
|||
if (multiResponse.isSuccess()) {
|
||||
List<RoleCO> roleCOList = multiResponse.getData();
|
||||
for (RoleCO roleCO : roleCOList) {
|
||||
if (roleCO.getRoleName().contains("普通用户") || roleCO.getRoleName().contains("个人账号")) {
|
||||
if ("默认通用角色".equals(roleCO.getRoleName())) {
|
||||
return roleCO.getId();
|
||||
}
|
||||
}
|
||||
|
|
@ -511,40 +451,17 @@ public class UserRepositoryImpl extends BaseRepositoryImpl<UserMapper, UserDO> i
|
|||
|
||||
@Override
|
||||
public Response updatePassword(UserDO userDO) {
|
||||
UserDO oldUserDO = getById(userDO.getId());
|
||||
// TODO 验证老密码是否正确
|
||||
if (userDO.getPassword() != null && !userDO.getPassword().equals("")) {
|
||||
SingleResponse<UserDetailCO> detail = null;
|
||||
try {
|
||||
log.info("updateXgf,GBS获取用户信息{}", userDO.getId());
|
||||
detail = userFacade.getDetail(userDO.getId());
|
||||
log.info("updateXgf,GBS获取用户信息返回: {}", JSONUtil.toJsonStr(detail));
|
||||
} catch (Exception e) {
|
||||
log.error("updateXgf,GBS获取用户信息失败: {}", e.getMessage());
|
||||
AccountPasswordCheckCmd accountPasswordCheckCmd = new AccountPasswordCheckCmd();
|
||||
accountPasswordCheckCmd.setUserId(userDO.getId());
|
||||
accountPasswordCheckCmd.setPassword(userDO.getPassword());
|
||||
SingleResponse<Long> response = accountFacade.checkPassword(accountPasswordCheckCmd);
|
||||
if (!response.isSuccess()) {
|
||||
return Response.buildFailure("原密码不正确");
|
||||
}
|
||||
if(detail.getData() != null){
|
||||
AccountPasswordCheckCmd accountPasswordCheckCmd = new AccountPasswordCheckCmd();
|
||||
accountPasswordCheckCmd.setUserId(userDO.getId());
|
||||
accountPasswordCheckCmd.setPassword(userDO.getPassword());
|
||||
log.info("updateXgf,GBS验证用户密码请求:{}", JSONUtil.toJsonStr(accountPasswordCheckCmd));
|
||||
SingleResponse<Long> response = accountFacade.checkPassword(accountPasswordCheckCmd);
|
||||
log.info("updateXgf,GBS验证用户密码返回:{}", JSONUtil.toJsonStr(response));
|
||||
if (!response.isSuccess()) {
|
||||
throw new BizException("原密码不正确");
|
||||
}
|
||||
}else{
|
||||
//验证本地密码
|
||||
UserE userE = new UserE();
|
||||
Boolean checkUserPassword = userE.checkUserEncryptionPassword(userDO.getPassword(), oldUserDO.getPassword());
|
||||
log.info("updateXgf,验证用户本地密码结果:{}",checkUserPassword);
|
||||
if(!checkUserPassword){
|
||||
throw new BizException("密码错误");
|
||||
}
|
||||
}
|
||||
}else{
|
||||
log.info("updateXgf,密码为空,不进行密码验证");
|
||||
}
|
||||
|
||||
UserDO oldUserDO = getById(userDO.getId());
|
||||
//修改多个密码
|
||||
String phone = oldUserDO.getPhone();
|
||||
|
||||
|
|
@ -614,10 +531,10 @@ public class UserRepositoryImpl extends BaseRepositoryImpl<UserMapper, UserDO> i
|
|||
}
|
||||
|
||||
@Override
|
||||
public void checkUserIdCard(Long id, String userIdCard) {
|
||||
public void checkUserIdCard(String phone, String userIdCard) {
|
||||
Map<String, Object> verifyParam = new HashMap<>();
|
||||
verifyParam.put("userIdCard", userIdCard);
|
||||
verifyParam.put("id", id);
|
||||
verifyParam.put("phone", phone);
|
||||
Integer count = userMapper.countUser(verifyParam);
|
||||
if (count > 0) {
|
||||
throw new BizException("身份证号已经存在,请联系管理员");
|
||||
|
|
@ -688,15 +605,5 @@ public class UserRepositoryImpl extends BaseRepositoryImpl<UserMapper, UserDO> i
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deletedUserByPhone(String phone) {
|
||||
userMapper.deletedUserByPhone(phone);
|
||||
}
|
||||
|
||||
@Override
|
||||
public UserDO getUserIdByPhone(String phone) {
|
||||
return userMapper.getUserIdByPhone(phone);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -37,12 +37,6 @@
|
|||
<if test="params.eqVillage != null and params.eqVillage.trim() != ''">
|
||||
AND c.village = #{params.eqVillage}
|
||||
</if>
|
||||
<if test="params.eqUseFlag != null ">
|
||||
AND c.use_flag = #{params.eqUseFlag}
|
||||
</if>
|
||||
<if test="params.eqCorpState != null and params.eqCorpState.trim() != ''">
|
||||
AND c.corp_state = #{params.eqCorpState}
|
||||
</if>
|
||||
group by c.id
|
||||
ORDER BY
|
||||
c.corp_order ASC,
|
||||
|
|
@ -52,12 +46,7 @@
|
|||
<select id="selectUserPage" resultType="com.zcloud.basic.info.persistence.dataobject.CorpInfoDO">
|
||||
SELECT *
|
||||
FROM corp_info
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
<select id="selectUserBasicPage" resultType="com.zcloud.basic.info.persistence.dataobject.CorpInfoDO">
|
||||
SELECT *
|
||||
FROM corp_info
|
||||
${ew.customSqlSegment}
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
<select id="selectUserPageNoPms" resultType="com.zcloud.basic.info.persistence.dataobject.CorpInfoDO">
|
||||
|
|
|
|||
|
|
@ -5,30 +5,12 @@
|
|||
<mapper namespace="com.zcloud.basic.info.persistence.mapper.DepartmentMapper">
|
||||
|
||||
<select id="listAllTree" resultType="com.zcloud.basic.info.persistence.dataobject.DepartmentDO">
|
||||
select d.*
|
||||
from department d
|
||||
left join corp_info c on d.corpinfo_id = c.id
|
||||
where d.delete_enum = 'FALSE'
|
||||
order by c.corp_order, c.create_time desc, d.dep_order, d.create_time desc
|
||||
select * from department where delete_enum = 'FALSE' order by dep_order, create_time desc
|
||||
</select>
|
||||
<select id="selectDeptPage" resultType="com.zcloud.basic.info.persistence.dataobject.DepartmentDO">
|
||||
SELECT *
|
||||
FROM department
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
<select id="listAllTreeByCorpType" resultType="com.zcloud.basic.info.persistence.dataobject.DepartmentDO">
|
||||
select d.*
|
||||
from department d
|
||||
left join corp_info c on d.corpinfo_id = c.id
|
||||
where d.delete_enum = 'FALSE'
|
||||
and c.delete_enum = 'FALSE'
|
||||
<if test="inType != null and inType.size() > 0">
|
||||
and c.type in
|
||||
<foreach collection="inType" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
order by c.corp_order, c.create_time desc,d.dep_order, d.create_time desc
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@
|
|||
<mapper namespace="com.zcloud.basic.info.persistence.mapper.UserMapper">
|
||||
<select id="selectListAll" resultType="com.zcloud.basic.info.persistence.dataobject.UserDO">
|
||||
select
|
||||
c.corp_name as corpinfoName,
|
||||
d.name as department_name,
|
||||
p.post_name,
|
||||
u.id,
|
||||
|
|
@ -52,8 +51,6 @@
|
|||
u.political_affiliation,
|
||||
u.political_affiliation_name,
|
||||
u.employment_flag,
|
||||
u.flow_flag,
|
||||
u.rz_flag,
|
||||
CASE
|
||||
WHEN LENGTH(FROM_BASE64(u.user_id_card)) > 0
|
||||
AND MOD(SUBSTRING(FROM_BASE64(u.user_id_card), 17, 1), 2) = 1 THEN
|
||||
|
|
@ -84,17 +81,6 @@
|
|||
<if test="params.departmentId != null">
|
||||
and u.department_id = #{params.departmentId}
|
||||
</if>
|
||||
<if test="params.employmentFlag != null">
|
||||
and u.employment_flag = #{params.employmentFlag}
|
||||
</if>
|
||||
<if test="params.flowFlag != null">
|
||||
and u.flow_flag = #{params.flowFlag}
|
||||
</if>
|
||||
<if test="params.rzFlag != null">
|
||||
and u.rz_flag = #{params.rzFlag}
|
||||
</if>
|
||||
|
||||
|
||||
<if test="params.postId != null">
|
||||
and u.post_id = #{params.postId}
|
||||
</if>
|
||||
|
|
@ -157,7 +143,6 @@
|
|||
u.political_affiliation,
|
||||
u.political_affiliation_name,
|
||||
u.employment_flag,
|
||||
u.flow_flag,
|
||||
CASE
|
||||
WHEN LENGTH(FROM_BASE64(u.user_id_card)) > 0
|
||||
AND MOD(SUBSTRING(FROM_BASE64(u.user_id_card), 17, 1), 2) = 1 THEN
|
||||
|
|
@ -179,86 +164,14 @@
|
|||
left join post p on p.id = u.post_id
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
<select id="pageByNopermission" resultType="com.zcloud.basic.info.persistence.dataobject.UserDO">
|
||||
select
|
||||
d.name as department_name,
|
||||
p.post_name,
|
||||
c.corp_name as corpinfoName,
|
||||
u.id,
|
||||
u.user_id,
|
||||
u.username,
|
||||
u.name,
|
||||
u.corpinfo_id,
|
||||
u.main_corp_flag,
|
||||
u.user_type,
|
||||
u.department_id,
|
||||
u.post_id,
|
||||
u.role_id,
|
||||
u.email,
|
||||
u.phone,
|
||||
u.personnel_type,
|
||||
u.personnel_type_name,
|
||||
u.nation,
|
||||
u.nation_name,
|
||||
u.user_id_card,
|
||||
u.user_avatar_url,
|
||||
u.current_address,
|
||||
u.location_address,
|
||||
u.rank_level,
|
||||
u.rank_level_name,
|
||||
u.sort,
|
||||
u.version,
|
||||
u.create_id,
|
||||
u.create_name,
|
||||
u.create_time,
|
||||
u.update_id,
|
||||
u.update_name,
|
||||
u.update_time,
|
||||
u.remarks,
|
||||
u.delete_enum,
|
||||
u.tenant_id,
|
||||
u.org_id,
|
||||
u.env,
|
||||
u.department_leader_flag,
|
||||
u.deputy_leader_flag,
|
||||
u.cultural_level,
|
||||
u.cultural_level_name,
|
||||
u.marital_status,
|
||||
u.marital_status_name,
|
||||
u.political_affiliation,
|
||||
u.political_affiliation_name,
|
||||
u.employment_flag,
|
||||
u.flow_flag,
|
||||
CASE
|
||||
WHEN LENGTH(FROM_BASE64(u.user_id_card)) > 0
|
||||
AND MOD(SUBSTRING(FROM_BASE64(u.user_id_card), 17, 1), 2) = 1 THEN
|
||||
'男'
|
||||
WHEN LENGTH(FROM_BASE64(u.user_id_card)) > 0
|
||||
AND MOD(SUBSTRING(FROM_BASE64(u.user_id_card), 17, 1), 2) = 0 THEN
|
||||
'女'
|
||||
END AS sex,
|
||||
|
||||
CASE
|
||||
WHEN LENGTH(FROM_BASE64(u.user_id_card)) > 0 THEN
|
||||
(YEAR(NOW()) - SUBSTRING(FROM_BASE64(u.user_id_card), 7, 4)) ELSE NULL
|
||||
END AS age,
|
||||
|
||||
cast(substring(FROM_BASE64(u.user_id_card), 7, 8) AS DATE) AS birthday
|
||||
from user u
|
||||
left join corp_info c on c.id = u.corpinfo_id
|
||||
left join department d on d.id = u.department_id
|
||||
left join post p on p.id = u.post_id
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
<select id="getInfoById" resultType="com.zcloud.basic.info.persistence.dataobject.UserDO">
|
||||
select
|
||||
d.name as department_name,
|
||||
CASE
|
||||
WHEN c.type IN (3,4, 5) THEN u.post_name
|
||||
WHEN c.type IN (1, 2, 3) THEN u.post_name
|
||||
ELSE p.post_name
|
||||
END AS post_name,
|
||||
c.corp_name corpinfo_name,
|
||||
u.id,
|
||||
u.password,
|
||||
u.user_id,
|
||||
|
|
@ -306,17 +219,17 @@
|
|||
u.employment_flag,
|
||||
u.flow_flag,
|
||||
CASE
|
||||
WHEN LENGTH(FROM_BASE64(u.user_id_card)) > 0
|
||||
AND MOD(SUBSTRING(FROM_BASE64(u.user_id_card), 17, 1), 2) = 1 THEN
|
||||
'男'
|
||||
WHEN LENGTH(FROM_BASE64(u.user_id_card)) > 0
|
||||
AND MOD(SUBSTRING(FROM_BASE64(u.user_id_card), 17, 1), 2) = 0 THEN
|
||||
'女'
|
||||
WHEN LENGTH(FROM_BASE64(u.user_id_card)) > 0
|
||||
AND MOD(SUBSTRING(FROM_BASE64(u.user_id_card), 17, 1), 2) = 1 THEN
|
||||
'男'
|
||||
WHEN LENGTH(FROM_BASE64(u.user_id_card)) > 0
|
||||
AND MOD(SUBSTRING(FROM_BASE64(u.user_id_card), 17, 1), 2) = 0 THEN
|
||||
'女'
|
||||
END AS sex,
|
||||
|
||||
CASE
|
||||
WHEN LENGTH(FROM_BASE64(u.user_id_card)) > 0 THEN
|
||||
(YEAR(NOW()) - SUBSTRING(FROM_BASE64(u.user_id_card), 7, 4)) ELSE NULL
|
||||
(YEAR(NOW()) - SUBSTRING(FROM_BASE64(u.user_id_card), 7, 4)) ELSE NULL
|
||||
END AS age,
|
||||
|
||||
cast(substring(FROM_BASE64(u.user_id_card), 7, 8) AS DATE) AS birthday
|
||||
|
|
@ -328,90 +241,6 @@
|
|||
u.id = #{id}
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="getInfoByUserName" resultType="com.zcloud.basic.info.persistence.dataobject.UserDO">
|
||||
select
|
||||
d.name as department_name,
|
||||
CASE
|
||||
WHEN c.type IN (3,4, 5) THEN u.post_name
|
||||
ELSE p.post_name
|
||||
END AS post_name,
|
||||
c.corp_name corpinfo_name,
|
||||
u.id,
|
||||
u.password,
|
||||
u.user_id,
|
||||
u.username,
|
||||
u.name,
|
||||
u.corpinfo_id,
|
||||
u.main_corp_flag,
|
||||
u.user_type,
|
||||
u.department_id,
|
||||
u.post_id,
|
||||
u.role_id,
|
||||
u.email,
|
||||
u.phone,
|
||||
u.personnel_type,
|
||||
u.personnel_type_name,
|
||||
u.nation,
|
||||
u.nation_name,
|
||||
u.user_id_card,
|
||||
u.user_avatar_url,
|
||||
u.current_address,
|
||||
u.location_address,
|
||||
u.rank_level,
|
||||
u.rank_level_name,
|
||||
u.sort,
|
||||
u.version,
|
||||
u.create_id,
|
||||
u.create_name,
|
||||
u.create_time,
|
||||
u.update_id,
|
||||
u.update_name,
|
||||
u.update_time,
|
||||
u.remarks,
|
||||
u.delete_enum,
|
||||
u.tenant_id,
|
||||
u.org_id,
|
||||
u.env,
|
||||
u.department_leader_flag,
|
||||
u.deputy_leader_flag,
|
||||
u.cultural_level,
|
||||
u.cultural_level_name,
|
||||
u.marital_status,
|
||||
u.marital_status_name,
|
||||
u.political_affiliation,
|
||||
u.political_affiliation_name,
|
||||
u.employment_flag,
|
||||
u.flow_flag,
|
||||
CASE
|
||||
WHEN LENGTH(FROM_BASE64(u.user_id_card)) > 0
|
||||
AND MOD(SUBSTRING(FROM_BASE64(u.user_id_card), 17, 1), 2) = 1 THEN
|
||||
'男'
|
||||
WHEN LENGTH(FROM_BASE64(u.user_id_card)) > 0
|
||||
AND MOD(SUBSTRING(FROM_BASE64(u.user_id_card), 17, 1), 2) = 0 THEN
|
||||
'女'
|
||||
END AS sex,
|
||||
|
||||
CASE
|
||||
WHEN LENGTH(FROM_BASE64(u.user_id_card)) > 0 THEN
|
||||
(YEAR(NOW()) - SUBSTRING(FROM_BASE64(u.user_id_card), 7, 4)) ELSE NULL
|
||||
END AS age,
|
||||
|
||||
cast(substring(FROM_BASE64(u.user_id_card), 7, 8) AS DATE) AS birthday
|
||||
from user u
|
||||
left join corp_info c on c.id = u.corpinfo_id
|
||||
left join department d on d.id = u.department_id
|
||||
left join post p on p.id = u.post_id
|
||||
<where>
|
||||
<if test="params.corpinfoId != null and params.corpinfoId != ''">
|
||||
and u.corpinfo_id = #{params.corpinfoId}
|
||||
</if>
|
||||
and u.username = #{params.username}
|
||||
and u.delete_enum = 'FALSE'
|
||||
</where>
|
||||
order by u.create_time desc
|
||||
limit 1
|
||||
</select>
|
||||
<select id="getDepartmentLeaderByDepartmentId" resultType="com.zcloud.basic.info.persistence.dataobject.DepartmentLeaderStatictiscDO">
|
||||
select
|
||||
u.department_id AS departmentId,
|
||||
|
|
@ -526,11 +355,5 @@
|
|||
and u.employment_flag =1
|
||||
and u.delete_enum = 'FALSE'
|
||||
</select>
|
||||
<update id="deletedUserByPhone">
|
||||
update user set delete_enum = 'TRUE' where phone = #{phone}
|
||||
</update>
|
||||
<select id="getUserIdByPhone" resultType="com.zcloud.basic.info.persistence.dataobject.UserDO">
|
||||
select * from user where phone = #{phone} limit 1;
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue