用户离职相关,流动人员,等
parent
6340fc6149
commit
e0ed80a261
|
|
@ -11,6 +11,7 @@ import com.zcloud.basic.info.api.UserServiceI;
|
|||
import com.zcloud.basic.info.dto.*;
|
||||
import com.zcloud.basic.info.dto.clientobject.UserCO;
|
||||
import com.zcloud.basic.info.plan.DockingRZUserPlanJob;
|
||||
import com.zcloud.basic.info.dto.clientobject.UserXmfCO;
|
||||
import com.zcloud.gbscommon.translateaop.TranslateField;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
|
@ -135,7 +136,6 @@ public class UserController {
|
|||
@ApiOperation("修改密码")
|
||||
@PostMapping("/updatePassword")
|
||||
public Response updatePassword(@Validated @RequestBody UserUpdatePassWordCmd userUpdatePassWordCmd){
|
||||
|
||||
return userService.updatePassword(userUpdatePassWordCmd);
|
||||
}
|
||||
@ApiOperation("根据登录人密码获取查询人手机号和身份证号")
|
||||
|
|
@ -158,6 +158,23 @@ public class UserController {
|
|||
dockingRZPlanJob.execute("");
|
||||
return SingleResponse.buildSuccess();
|
||||
}
|
||||
@ApiOperation("相关方用户列表分页")
|
||||
@PostMapping("/listXgf")
|
||||
public PageResponse<UserXmfCO> listXgf(@RequestBody UserPageQry qry) {
|
||||
return userService.listXgf(qry);
|
||||
}
|
||||
@ApiOperation("PC离职")
|
||||
@PostMapping("/resignation")
|
||||
public SingleResponse resignation(@RequestBody UserResignationCmd userResignationCmd) {
|
||||
userService.resignation(userResignationCmd);
|
||||
return SingleResponse.buildSuccess();
|
||||
}
|
||||
/* @ApiOperation("PC审核通过-驳回")
|
||||
@PostMapping("/resignation")
|
||||
public SingleResponse resignation(@RequestBody UserResignationCmd userResignationCmd) {
|
||||
userService.resignation(userResignationCmd);
|
||||
return SingleResponse.buildSuccess();
|
||||
}*/
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,82 @@
|
|||
package com.zcloud.basic.info.web;
|
||||
|
||||
|
||||
import com.alibaba.cola.dto.MultiResponse;
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.alibaba.cola.dto.Response;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import com.jjb.saas.framework.auth.model.SSOUser;
|
||||
import com.jjb.saas.framework.auth.utils.AuthContext;
|
||||
import com.zcloud.basic.info.api.UserCorpServiceI;
|
||||
import com.zcloud.basic.info.dto.UserCorpAddCmd;
|
||||
import com.zcloud.basic.info.dto.UserCorpPageQry;
|
||||
import com.zcloud.basic.info.dto.UserCorpUpdateCmd;
|
||||
import com.zcloud.basic.info.dto.clientobject.UserCorpCO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* web-adapter
|
||||
*
|
||||
* @Author zhaokai
|
||||
* @Date 2025-12-02 11:13:33
|
||||
*/
|
||||
@Api(tags = "用户企业表")
|
||||
@RequestMapping("/${application.gateway}/userCorp")
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
public class UserCorpController {
|
||||
private final UserCorpServiceI userCorpService;
|
||||
|
||||
@ApiOperation("新增")
|
||||
@PostMapping("/save")
|
||||
public SingleResponse<UserCorpCO> add(@Validated @RequestBody UserCorpAddCmd cmd) {
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
return userCorpService.add(cmd);
|
||||
}
|
||||
|
||||
@ApiOperation("分页")
|
||||
@PostMapping("/list")
|
||||
public PageResponse<UserCorpCO> page(@RequestBody UserCorpPageQry qry) {
|
||||
return userCorpService.listPage(qry);
|
||||
}
|
||||
|
||||
@ApiOperation("所有数据")
|
||||
@GetMapping("/listAll")
|
||||
public MultiResponse<UserCorpCO> listAll() {
|
||||
return MultiResponse.of(new ArrayList<UserCorpCO>());
|
||||
}
|
||||
|
||||
@ApiOperation("详情")
|
||||
@GetMapping("/{id}")
|
||||
public SingleResponse<UserCorpCO> getInfoById(@PathVariable("id") Long id) {
|
||||
return SingleResponse.of(new UserCorpCO());
|
||||
}
|
||||
|
||||
@ApiOperation("删除")
|
||||
@DeleteMapping("/{id}")
|
||||
public Response remove(@PathVariable("id") Long id) {
|
||||
userCorpService.remove(id);
|
||||
return SingleResponse.buildSuccess();
|
||||
}
|
||||
|
||||
@ApiOperation("删除多个")
|
||||
@DeleteMapping("/ids")
|
||||
public Response removeBatch(@RequestParam Long[] ids) {
|
||||
userCorpService.removeBatch(ids);
|
||||
return SingleResponse.buildSuccess();
|
||||
}
|
||||
|
||||
@ApiOperation("修改")
|
||||
@PutMapping("/edit")
|
||||
public SingleResponse edit(@Validated @RequestBody UserCorpUpdateCmd userCorpUpdateCmd) {
|
||||
userCorpService.edit(userCorpUpdateCmd);
|
||||
return SingleResponse.buildSuccess();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -11,21 +11,14 @@ import com.jjb.saas.framework.auth.utils.AuthContext;
|
|||
import com.jjb.saas.system.client.role.response.RoleCO;
|
||||
import com.zcloud.basic.info.command.convertor.UserCoConvertor;
|
||||
import com.zcloud.basic.info.command.query.CorpInfoQueryExe;
|
||||
import com.zcloud.basic.info.domain.gateway.CorpInfoGateway;
|
||||
import com.zcloud.basic.info.domain.gateway.UserEmploymentLogGateway;
|
||||
import com.zcloud.basic.info.domain.gateway.UserGateway;
|
||||
import com.zcloud.basic.info.domain.model.DepartmentE;
|
||||
import com.zcloud.basic.info.domain.model.PostE;
|
||||
import com.zcloud.basic.info.domain.model.UserE;
|
||||
import com.zcloud.basic.info.domain.model.UserEmploymentLogE;
|
||||
import com.zcloud.basic.info.domain.enums.UserFlowFlagEnum;
|
||||
import com.zcloud.basic.info.domain.gateway.*;
|
||||
import com.zcloud.basic.info.domain.model.*;
|
||||
import com.zcloud.basic.info.dto.CorpInfoAddCmd;
|
||||
import com.zcloud.basic.info.dto.UserAddCmd;
|
||||
import com.zcloud.basic.info.dto.UserXgfAddCmd;
|
||||
import com.zcloud.basic.info.persistence.dataobject.*;
|
||||
import com.zcloud.basic.info.persistence.repository.CorpInfoRepository;
|
||||
import com.zcloud.basic.info.persistence.repository.DepartmentRepository;
|
||||
import com.zcloud.basic.info.persistence.repository.PostRepository;
|
||||
import com.zcloud.basic.info.persistence.repository.UserRepository;
|
||||
import com.zcloud.basic.info.persistence.repository.*;
|
||||
import com.zcloud.gbscommon.excelEntity.UserExcelImportEntity;
|
||||
import com.zcloud.gbscommon.utils.Tools;
|
||||
import lombok.AllArgsConstructor;
|
||||
|
|
@ -63,6 +56,8 @@ public class UserAddExe {
|
|||
@DubboReference
|
||||
private ConfDictTreeFacade confDictTreeFacade;
|
||||
private final CorpInfoQueryExe corpInfoQueryExe;
|
||||
private final UserCorpGateway userCorpGateway;
|
||||
private final UserChangeRecordGateway userChangeRecordGateway;
|
||||
|
||||
|
||||
|
||||
|
|
@ -113,23 +108,37 @@ public class UserAddExe {
|
|||
BeanUtils.copyProperties(cmd, userE);
|
||||
userE.initAdd(tenantId, userE);
|
||||
CorpInfoDO corpInfoDO = corpInfoRepository.getById(userE.getCorpinfoId());
|
||||
String corpName = null;
|
||||
UserEmploymentLogE userEmploymentLogE = new UserEmploymentLogE();
|
||||
BeanUtils.copyProperties(userE, userEmploymentLogE);
|
||||
boolean res = false;
|
||||
try {
|
||||
res = userGateway.add(userE);
|
||||
if(corpInfoDO != null && !ObjectUtils.isEmpty(corpInfoDO.getCorpName())){
|
||||
corpName = corpInfoDO.getCorpName();
|
||||
}
|
||||
userEmploymentLogE.initAdd(userEmploymentLogE, corpName, userE.getId());
|
||||
userEmploymentLogGateway.add(userEmploymentLogE);
|
||||
res = userGateway.addXgf(userE);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
if (!res) {
|
||||
throw new BizException("保存失败");
|
||||
}
|
||||
|
||||
if(UserFlowFlagEnum.FLOW.getCode().equals(cmd.getFlowFlag())){
|
||||
//流动人员
|
||||
UserCorpE userCorpE = new UserCorpE();
|
||||
BeanUtils.copyProperties(cmd, userCorpE);
|
||||
userCorpE.initAdd(tenantId, userE);
|
||||
userCorpGateway.add(userCorpE);
|
||||
}
|
||||
//页面相关保存user_corp
|
||||
/**
|
||||
* 非流动人员用户只能在一个企业,
|
||||
* 同步gbs,流动人员企业固定
|
||||
*/
|
||||
DepartmentDO departmentDO = departmentRepository.getById(userE.getDepartmentId());
|
||||
// 增加用户变更记录
|
||||
UserChangeRecordE userChangeRecordE = new UserChangeRecordE();
|
||||
BeanUtils.copyProperties(cmd, userChangeRecordE);
|
||||
userChangeRecordE.initUserAdd( userE,corpInfoDO.getCorpName(),departmentDO.getName());
|
||||
userChangeRecordGateway.add(userChangeRecordE);
|
||||
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,40 @@
|
|||
package com.zcloud.basic.info.command;
|
||||
|
||||
import com.alibaba.cola.exception.BizException;
|
||||
import com.zcloud.basic.info.domain.gateway.UserCorpGateway;
|
||||
import com.zcloud.basic.info.domain.model.UserCorpE;
|
||||
import com.zcloud.basic.info.dto.UserCorpAddCmd;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
|
||||
/**
|
||||
* web-app
|
||||
*
|
||||
* @Author zhaokai
|
||||
* @Date 2025-12-02 11:13:32
|
||||
*/
|
||||
@Component
|
||||
@AllArgsConstructor
|
||||
public class UserCorpAddExe {
|
||||
private final UserCorpGateway userCorpGateway;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean execute(UserCorpAddCmd cmd) {
|
||||
UserCorpE userCorpE = new UserCorpE();
|
||||
BeanUtils.copyProperties(cmd, userCorpE);
|
||||
boolean res = false;
|
||||
try {
|
||||
res = userCorpGateway.add(userCorpE);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
if (!res) {
|
||||
throw new BizException("保存失败");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
package com.zcloud.basic.info.command;
|
||||
|
||||
import com.alibaba.cola.exception.BizException;
|
||||
import com.zcloud.basic.info.domain.gateway.UserCorpGateway;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
|
||||
/**
|
||||
* web-app
|
||||
*
|
||||
* @Author zhaokai
|
||||
* @Date 2025-12-02 11:13:33
|
||||
*/
|
||||
@Component
|
||||
@AllArgsConstructor
|
||||
public class UserCorpRemoveExe {
|
||||
private final UserCorpGateway userCorpGateway;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean execute(Long id) {
|
||||
boolean res = userCorpGateway.deletedUserCorpById(id);
|
||||
if (!res) {
|
||||
throw new BizException("删除失败");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean execute(Long[] ids) {
|
||||
boolean res = userCorpGateway.deletedUserCorpByIds(ids);
|
||||
if (!res) {
|
||||
throw new BizException("删除失败");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
package com.zcloud.basic.info.command;
|
||||
|
||||
import com.alibaba.cola.exception.BizException;
|
||||
import com.zcloud.basic.info.domain.gateway.UserCorpGateway;
|
||||
import com.zcloud.basic.info.domain.model.UserCorpE;
|
||||
import com.zcloud.basic.info.dto.UserCorpUpdateCmd;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
|
||||
/**
|
||||
* web-app
|
||||
*
|
||||
* @Author zhaokai
|
||||
* @Date 2025-12-02 11:13:34
|
||||
*/
|
||||
@Component
|
||||
@AllArgsConstructor
|
||||
public class UserCorpUpdateExe {
|
||||
private final UserCorpGateway userCorpGateway;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void execute(UserCorpUpdateCmd userCorpUpdateCmd) {
|
||||
UserCorpE userCorpE = new UserCorpE();
|
||||
BeanUtils.copyProperties(userCorpUpdateCmd, userCorpE);
|
||||
boolean res = userCorpGateway.update(userCorpE);
|
||||
if (!res) {
|
||||
throw new BizException("修改失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2,22 +2,35 @@ package com.zcloud.basic.info.command;
|
|||
|
||||
import com.alibaba.cola.dto.Response;
|
||||
import com.alibaba.cola.exception.BizException;
|
||||
import com.jjb.saas.framework.auth.utils.AuthContext;
|
||||
import com.jjb.saas.system.client.user.facade.UserFacade;
|
||||
import com.zcloud.basic.info.domain.enums.UserEmploymentFlagEnum;
|
||||
import com.zcloud.basic.info.domain.enums.UserFlowFlagEnum;
|
||||
import com.zcloud.basic.info.domain.gateway.UserChangeRecordGateway;
|
||||
import com.zcloud.basic.info.domain.gateway.UserCorpGateway;
|
||||
import com.zcloud.basic.info.domain.gateway.UserEmploymentLogGateway;
|
||||
import com.zcloud.basic.info.domain.gateway.UserGateway;
|
||||
import com.zcloud.basic.info.domain.model.UserChangeRecordE;
|
||||
import com.zcloud.basic.info.domain.model.UserCorpE;
|
||||
import com.zcloud.basic.info.domain.model.UserE;
|
||||
import com.zcloud.basic.info.domain.model.UserEmploymentLogE;
|
||||
import com.zcloud.basic.info.dto.UserResignationCmd;
|
||||
import com.zcloud.basic.info.dto.UserUpdateCmd;
|
||||
import com.zcloud.basic.info.dto.UserUpdateFaceUrlCmd;
|
||||
import com.zcloud.basic.info.dto.UserUpdatePassWordCmd;
|
||||
import com.zcloud.basic.info.persistence.dataobject.CorpInfoDO;
|
||||
import com.zcloud.basic.info.persistence.dataobject.DepartmentDO;
|
||||
import com.zcloud.basic.info.persistence.dataobject.UserCorpDO;
|
||||
import com.zcloud.basic.info.persistence.dataobject.UserDO;
|
||||
import com.zcloud.basic.info.persistence.repository.CorpInfoRepository;
|
||||
import com.zcloud.basic.info.persistence.repository.DepartmentRepository;
|
||||
import com.zcloud.basic.info.persistence.repository.UserCorpRepository;
|
||||
import com.zcloud.basic.info.persistence.repository.UserRepository;
|
||||
import com.zcloud.gbscommon.utils.Const;
|
||||
import com.zcloud.gbscommon.utils.PageQueryHelper;
|
||||
import com.zcloud.gbscommon.utils.ZcloudRedisUtil;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.apache.catalina.User;
|
||||
import org.apache.dubbo.config.annotation.DubboReference;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
|
@ -29,10 +42,11 @@ import java.util.Map;
|
|||
|
||||
|
||||
/**
|
||||
* web-app
|
||||
* @Author zhangyue
|
||||
* @Date 2025-11-04 14:07:38
|
||||
*/
|
||||
* web-app
|
||||
*
|
||||
* @Author zhangyue
|
||||
* @Date 2025-11-04 14:07:38
|
||||
*/
|
||||
@Component
|
||||
@AllArgsConstructor
|
||||
public class UserUpdateExe {
|
||||
|
|
@ -43,8 +57,10 @@ public class UserUpdateExe {
|
|||
private final UserEmploymentLogGateway userEmploymentLogGateway;
|
||||
|
||||
private final CorpInfoRepository corpInfoRepository;
|
||||
// @Autowired
|
||||
// private ZcloudRedisUtil zcloudRedisUtil;
|
||||
private final UserCorpRepository userCorpRepository;
|
||||
private final UserCorpGateway userCorpGateway;
|
||||
private final UserChangeRecordGateway userChangeRecordGateway;
|
||||
private final DepartmentRepository departmentRepository;
|
||||
@DubboReference
|
||||
private UserFacade userFacade;
|
||||
|
||||
|
|
@ -59,29 +75,49 @@ public class UserUpdateExe {
|
|||
boolean transferPositionFlag = userE.verifyTransferPosition(oldUserE, userE);
|
||||
String corpName = null;
|
||||
|
||||
boolean res = false;
|
||||
try {
|
||||
res = userGateway.update(userE);
|
||||
// userFacade.updatePassword()
|
||||
// 保存履职记录
|
||||
if (transferPositionFlag) {
|
||||
UserEmploymentLogE userEmploymentLogE = new UserEmploymentLogE();
|
||||
CorpInfoDO corpInfoDO = corpInfoRepository.getById(userE.getCorpinfoId());
|
||||
if(corpInfoDO != null && !ObjectUtils.isEmpty(corpInfoDO.getCorpName())){
|
||||
corpName = corpInfoDO.getCorpName();
|
||||
}
|
||||
userEmploymentLogE.initAdd(userEmploymentLogE, corpName, userE.getId());
|
||||
userEmploymentLogGateway.add(userEmploymentLogE);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
boolean res = userGateway.update(userE);
|
||||
// 保存履职记录
|
||||
if (!res) {
|
||||
throw new BizException("修改失败");
|
||||
}
|
||||
//删除redis数据
|
||||
// zcloudRedisUtil.del(Const.REDIS_USER_PREFIX+userUpdateCmd.getId());
|
||||
UserCorpDO infoByUserId = userCorpRepository.getInfoByUserId(userDO.getId(), AuthContext.getTenantId());
|
||||
if (UserFlowFlagEnum.FLOW.getCode().equals(userUpdateCmd.getFlowFlag())) {
|
||||
//流动人员,修改部门企业等信息
|
||||
if (infoByUserId != null) {
|
||||
UserCorpE userCorpE = new UserCorpE();
|
||||
BeanUtils.copyProperties(infoByUserId, userCorpE);
|
||||
userCorpE.initUpdate(userE);
|
||||
userCorpGateway.update(userCorpE);
|
||||
} else {
|
||||
UserCorpE userCorpE = new UserCorpE();
|
||||
userCorpE.initAdd(AuthContext.getTenantId(), userE);
|
||||
userCorpGateway.add(userCorpE);
|
||||
BeanUtils.copyProperties(userCorpE, infoByUserId);
|
||||
}
|
||||
}
|
||||
if (transferPositionFlag) {
|
||||
//保存用户变更记录
|
||||
CorpInfoDO corpInfoDO = corpInfoRepository.getById(userE.getCorpinfoId());
|
||||
if (corpInfoDO != null && !ObjectUtils.isEmpty(corpInfoDO.getCorpName())) {
|
||||
corpName = corpInfoDO.getCorpName();
|
||||
}
|
||||
DepartmentDO departmentDO = departmentRepository.getById(userE.getDepartmentId());
|
||||
if (UserFlowFlagEnum.FLOW.getCode().equals(userDO.getFlowFlag())) {
|
||||
//获取
|
||||
UserCorpE userCorpE = new UserCorpE();
|
||||
BeanUtils.copyProperties(infoByUserId, userCorpE);
|
||||
oldUserE.setDepartmentId(infoByUserId.getDepartmentId());
|
||||
oldUserE.setOldFlowInfo(userCorpE);
|
||||
}
|
||||
// 增加用户变更记录
|
||||
UserChangeRecordE userChangeRecordE = new UserChangeRecordE();
|
||||
userChangeRecordE.initUserUpdate(userE, oldUserE, corpName, departmentDO.getName());
|
||||
userChangeRecordGateway.add(userChangeRecordE);
|
||||
//TODO 处理未完成的工作
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -107,5 +143,30 @@ public class UserUpdateExe {
|
|||
BeanUtils.copyProperties(cmd, userDO);
|
||||
return userRepository.updateFaceUrl(userDO);
|
||||
}
|
||||
|
||||
public void executeResignation(UserResignationCmd userResignationCmd) {
|
||||
//获取用户信息,并更新离职状态为离职
|
||||
UserDO userDO = userRepository.getInfoById(userResignationCmd.getUserId());
|
||||
//
|
||||
UserE userE=null;
|
||||
if(UserFlowFlagEnum.FLOW.getCode().equals(userDO.getFlowFlag())){
|
||||
Long corpinfoId = userResignationCmd.getCorpinfoId()==null?AuthContext.getTenantId():userResignationCmd.getCorpinfoId();
|
||||
userE=userCorpRepository.executeResignation(userDO.getId(), corpinfoId);
|
||||
}else{
|
||||
|
||||
userE = new UserE();
|
||||
BeanUtils.copyProperties(userDO, userE);
|
||||
userE.setEmploymentFlag(UserEmploymentFlagEnum.RESIGNATION.getCode());
|
||||
userGateway.update(userE);
|
||||
}
|
||||
if(userE==null){
|
||||
return;
|
||||
}
|
||||
// 增加用户变更记录
|
||||
UserChangeRecordE userChangeRecordE = new UserChangeRecordE();
|
||||
userChangeRecordE.executeResignation(userE,UserEmploymentFlagEnum.RESIGNATION.getCode());
|
||||
userChangeRecordGateway.add(userChangeRecordE);
|
||||
//TODO 处理未完成工作
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.zcloud.basic.info.command.convertor;
|
|||
import com.jjb.saas.system.client.user.request.FacadeUserAddCmd;
|
||||
import com.zcloud.basic.info.domain.model.UserE;
|
||||
import com.zcloud.basic.info.dto.clientobject.UserCO;
|
||||
import com.zcloud.basic.info.dto.clientobject.UserXmfCO;
|
||||
import com.zcloud.basic.info.persistence.dataobject.UserDO;
|
||||
import com.zcloud.gbscommon.excelEntity.UserExcelExportEntity;
|
||||
import com.zcloud.gbscommon.excelEntity.UserExcelImportEntity;
|
||||
|
|
@ -32,5 +33,7 @@ public interface UserCoConvertor {
|
|||
|
||||
List<ZcloudUserCo> converCOsToDubboCOs(List<UserCO> userCOList);
|
||||
ZcloudUserCo converCOToDubboCO(UserCO userCO);
|
||||
|
||||
List<UserXmfCO> converDOsToXgfCOs(List<UserDO> data);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,24 @@
|
|||
package com.zcloud.basic.info.command.convertor;
|
||||
|
||||
import com.zcloud.basic.info.dto.clientobject.UserCorpCO;
|
||||
import com.zcloud.basic.info.persistence.dataobject.UserCorpDO;
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* web-app
|
||||
*
|
||||
* @Author zhaokai
|
||||
* @Date 2025-12-02 11:13:33
|
||||
*/
|
||||
@Mapper(componentModel = "spring")
|
||||
public interface UserCorpCoConvertor {
|
||||
/**
|
||||
* @param userCorpDOs
|
||||
* @return
|
||||
*/
|
||||
List<UserCorpCO> converDOsToCOs(List<UserCorpDO> userCorpDOs);
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
package com.zcloud.basic.info.command.query;
|
||||
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.zcloud.basic.info.command.convertor.UserCorpCoConvertor;
|
||||
import com.zcloud.basic.info.dto.UserCorpPageQry;
|
||||
import com.zcloud.basic.info.dto.clientobject.UserCorpCO;
|
||||
import com.zcloud.basic.info.persistence.dataobject.UserCorpDO;
|
||||
import com.zcloud.basic.info.persistence.repository.UserCorpRepository;
|
||||
import com.zcloud.gbscommon.utils.PageQueryHelper;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* web-app
|
||||
*
|
||||
* @Author zhaokai
|
||||
* @Date 2025-12-02 11:13:33
|
||||
*/
|
||||
@Component
|
||||
@AllArgsConstructor
|
||||
public class UserCorpQueryExe {
|
||||
private final UserCorpRepository userCorpRepository;
|
||||
private final UserCorpCoConvertor userCorpCoConvertor;
|
||||
|
||||
/**
|
||||
* 分页
|
||||
*
|
||||
* @param userCorpPageQry
|
||||
* @return
|
||||
*/
|
||||
public PageResponse<UserCorpCO> execute(UserCorpPageQry userCorpPageQry) {
|
||||
Map<String, Object> params = PageQueryHelper.toHashMap(userCorpPageQry);
|
||||
PageResponse<UserCorpDO> pageResponse = userCorpRepository.listPage(params);
|
||||
List<UserCorpCO> examCenterCOS = userCorpCoConvertor.converDOsToCOs(pageResponse.getData());
|
||||
return PageResponse.of(examCenterCOS, pageResponse.getTotalCount(), pageResponse.getPageSize(), pageResponse.getPageIndex());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -16,7 +16,10 @@ import com.zcloud.basic.info.dto.UserPageQry;
|
|||
import com.zcloud.basic.info.dto.UserQryCmd;
|
||||
import com.zcloud.basic.info.dto.UserVerifyQryCmd;
|
||||
import com.zcloud.basic.info.dto.clientobject.UserCO;
|
||||
import com.zcloud.basic.info.dto.clientobject.UserXmfCO;
|
||||
import com.zcloud.basic.info.persistence.dataobject.UserCorpDO;
|
||||
import com.zcloud.basic.info.persistence.dataobject.UserDO;
|
||||
import com.zcloud.basic.info.persistence.repository.UserCorpRepository;
|
||||
import com.zcloud.basic.info.persistence.repository.UserRepository;
|
||||
import com.zcloud.gbscommon.excelEntity.UserExcelExportEntity;
|
||||
import com.zcloud.gbscommon.utils.DesensitizationUtils;
|
||||
|
|
@ -41,6 +44,7 @@ public class UserQueryExe {
|
|||
private final UserRepository userRepository;
|
||||
private final UserGateway userGateway;
|
||||
private final UserCoConvertor userCoConvertor;
|
||||
private final UserCorpRepository userCorpRepository;
|
||||
|
||||
/**
|
||||
* 分页
|
||||
|
|
@ -92,6 +96,16 @@ public class UserQueryExe {
|
|||
UserCO userCO = new UserCO();
|
||||
BeanUtils.copyProperties(userDO, userCO);
|
||||
desensitize(userCO);
|
||||
//如果是相关方流动人员,查找岗位部门
|
||||
UserCorpDO userCorpDO = userCorpRepository.getInfoByUserId(userCO.getId(),AuthContext.getTenantId());
|
||||
if(userCorpDO != null){
|
||||
userCO.setDepartmentId(userCorpDO.getDepartmentId());
|
||||
userCO.setPostId(userCorpDO.getPostId());
|
||||
userCO.setPostName(userCorpDO.getPostName());
|
||||
userCO.setRoleId(userCorpDO.getRoleId());
|
||||
userCO.setSort(userCorpDO.getSort());
|
||||
userCO.setCorpinfoId(userCorpDO.getCorpinfoId());
|
||||
}
|
||||
return SingleResponse.of(userCO);
|
||||
}
|
||||
|
||||
|
|
@ -177,5 +191,17 @@ public class UserQueryExe {
|
|||
UserDO userDO = userRepository.getEncryInfo(userE);
|
||||
return SingleResponse.of(userCoConvertor.converDOToCO(userDO));
|
||||
}
|
||||
|
||||
public PageResponse<UserXmfCO> listXgf(UserPageQry userPageQry) {
|
||||
Map<String, Object> params = PageQueryHelper.toHashMap(userPageQry);
|
||||
UserE userE = new UserE();
|
||||
userE.dataProcessingRights(AuthContext.getTenantId(), params);
|
||||
PageResponse<UserDO> pageResponse = userRepository.listXgf(params);
|
||||
List<UserXmfCO> userXmfCOList = userCoConvertor.converDOsToXgfCOs(pageResponse.getData());
|
||||
// if(CollUtil.isNotEmpty(userXmfCOList)){
|
||||
// userXmfCOList.forEach(this::desensitize);
|
||||
// }
|
||||
return PageResponse.of(userXmfCOList, pageResponse.getTotalCount(), pageResponse.getPageSize(), pageResponse.getPageIndex());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,59 @@
|
|||
package com.zcloud.basic.info.service;
|
||||
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import com.zcloud.basic.info.api.UserCorpServiceI;
|
||||
import com.zcloud.basic.info.command.UserCorpAddExe;
|
||||
import com.zcloud.basic.info.command.UserCorpRemoveExe;
|
||||
import com.zcloud.basic.info.command.UserCorpUpdateExe;
|
||||
import com.zcloud.basic.info.command.query.UserCorpQueryExe;
|
||||
import com.zcloud.basic.info.dto.UserCorpAddCmd;
|
||||
import com.zcloud.basic.info.dto.UserCorpPageQry;
|
||||
import com.zcloud.basic.info.dto.UserCorpUpdateCmd;
|
||||
import com.zcloud.basic.info.dto.clientobject.UserCorpCO;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* web-app
|
||||
*
|
||||
* @Author zhaokai
|
||||
* @Date 2025-12-02 11:13:33
|
||||
*/
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class UserCorpServiceImpl implements UserCorpServiceI {
|
||||
private final UserCorpAddExe userCorpAddExe;
|
||||
private final UserCorpUpdateExe userCorpUpdateExe;
|
||||
private final UserCorpRemoveExe userCorpRemoveExe;
|
||||
private final UserCorpQueryExe userCorpQueryExe;
|
||||
|
||||
@Override
|
||||
public PageResponse<UserCorpCO> listPage(UserCorpPageQry qry) {
|
||||
|
||||
return userCorpQueryExe.execute(qry);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SingleResponse add(UserCorpAddCmd cmd) {
|
||||
|
||||
userCorpAddExe.execute(cmd);
|
||||
return SingleResponse.buildSuccess();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void edit(UserCorpUpdateCmd userCorpUpdateCmd) {
|
||||
userCorpUpdateExe.execute(userCorpUpdateCmd);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void remove(Long id) {
|
||||
userCorpRemoveExe.execute(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeBatch(Long[] ids) {
|
||||
userCorpRemoveExe.execute(ids);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -12,6 +12,7 @@ import com.zcloud.basic.info.command.UserUpdateExe;
|
|||
import com.zcloud.basic.info.command.query.UserQueryExe;
|
||||
import com.zcloud.basic.info.dto.*;
|
||||
import com.zcloud.basic.info.dto.clientobject.UserCO;
|
||||
import com.zcloud.basic.info.dto.clientobject.UserXmfCO;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
|
@ -135,5 +136,16 @@ public class UserServiceImpl implements UserServiceI {
|
|||
public SingleResponse<UserCO> getEncryInfo(UserCheckPassWordCmd userCheckPassWordCmd) {
|
||||
return userQueryExe.getEncryInfo(userCheckPassWordCmd);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResponse<UserXmfCO> listXgf(UserPageQry qry) {
|
||||
return userQueryExe.listXgf(qry);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void resignation(UserResignationCmd userResignationCmd) {
|
||||
userUpdateExe.executeResignation(userResignationCmd);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,27 @@
|
|||
package com.zcloud.basic.info.api;
|
||||
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import com.zcloud.basic.info.dto.UserCorpAddCmd;
|
||||
import com.zcloud.basic.info.dto.UserCorpPageQry;
|
||||
import com.zcloud.basic.info.dto.UserCorpUpdateCmd;
|
||||
import com.zcloud.basic.info.dto.clientobject.UserCorpCO;
|
||||
|
||||
/**
|
||||
* web-client
|
||||
*
|
||||
* @Author zhaokai
|
||||
* @Date 2025-12-02 11:19:34
|
||||
*/
|
||||
public interface UserCorpServiceI {
|
||||
PageResponse<UserCorpCO> listPage(UserCorpPageQry qry);
|
||||
|
||||
SingleResponse<UserCorpCO> add(UserCorpAddCmd cmd);
|
||||
|
||||
void edit(UserCorpUpdateCmd cmd);
|
||||
|
||||
void remove(Long id);
|
||||
|
||||
void removeBatch(Long[] ids);
|
||||
}
|
||||
|
||||
|
|
@ -7,6 +7,7 @@ import com.alibaba.cola.dto.Response;
|
|||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import com.zcloud.basic.info.dto.*;
|
||||
import com.zcloud.basic.info.dto.clientobject.UserCO;
|
||||
import com.zcloud.basic.info.dto.clientobject.UserXmfCO;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
|
@ -54,5 +55,9 @@ public interface UserServiceI {
|
|||
Boolean updateUserFaceUrl(UserUpdateFaceUrlCmd cmd);
|
||||
|
||||
SingleResponse<UserCO> getEncryInfo(UserCheckPassWordCmd userCheckPassWordCmd);
|
||||
|
||||
PageResponse<UserXmfCO> listXgf(UserPageQry qry);
|
||||
|
||||
void resignation(UserResignationCmd userResignationCmd);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -83,6 +83,8 @@ public class UserChangeRecordAddCmd extends Command {
|
|||
@ApiModelProperty(value = "变更后负责岗位名称", name = "postNameAfter", required = true)
|
||||
@NotEmpty(message = "变更后负责岗位名称不能为空")
|
||||
private String postNameAfter;
|
||||
@ApiModelProperty(value = "离职原因")
|
||||
private String resignationReason;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -75,5 +75,7 @@ public class UserChangeRecordUpdateCmd extends Command {
|
|||
@ApiModelProperty(value = "变更后负责岗位名称", name = "postNameAfter", required = true)
|
||||
@NotEmpty(message = "变更后负责岗位名称不能为空")
|
||||
private String postNameAfter;
|
||||
@ApiModelProperty(value = "离职原因")
|
||||
private String resignationReason;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,61 @@
|
|||
package com.zcloud.basic.info.dto;
|
||||
|
||||
import com.alibaba.cola.dto.Command;
|
||||
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 zhaokai
|
||||
* @Date 2025-12-02 11:13:32
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class UserCorpAddCmd extends Command {
|
||||
@ApiModelProperty(value = "用户id", name = "userId", required = true)
|
||||
@NotNull(message = "用户id不能为空")
|
||||
private Long userId;
|
||||
|
||||
@ApiModelProperty(value = "企业id", name = "corpinfoId", required = true)
|
||||
@NotNull(message = "企业id不能为空")
|
||||
private Long corpinfoId;
|
||||
|
||||
@ApiModelProperty(value = "部门id", name = "departmentId", required = true)
|
||||
@NotNull(message = "部门id不能为空")
|
||||
private Long departmentId;
|
||||
|
||||
@ApiModelProperty(value = "岗位id", name = "postId", required = true)
|
||||
@NotNull(message = "岗位id不能为空")
|
||||
private Long postId;
|
||||
|
||||
@ApiModelProperty(value = "岗位名称", name = "postName", required = true)
|
||||
@NotEmpty(message = "岗位名称不能为空")
|
||||
private String postName;
|
||||
|
||||
@ApiModelProperty(value = "角色id", name = "roleId", required = true)
|
||||
@NotNull(message = "角色id不能为空")
|
||||
private Long roleId;
|
||||
|
||||
@ApiModelProperty(value = "人员在部门中的排序", name = "sort", required = true)
|
||||
@NotNull(message = "人员在部门中的排序不能为空")
|
||||
private Integer sort;
|
||||
|
||||
@ApiModelProperty(value = "是否部门领导0否1是", name = "departmentLeaderFlag", required = true)
|
||||
@NotNull(message = "是否部门领导0否1是不能为空")
|
||||
private Integer departmentLeaderFlag;
|
||||
|
||||
@ApiModelProperty(value = "入职状态,1-在职 0-离职, 2-入职待审核, 3-离职待审核", name = "employmentFlag", required = true)
|
||||
@NotNull(message = "入职状态,1-在职 0-离职, 2-入职待审核, 3-离职待审核不能为空")
|
||||
private Integer employmentFlag;
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
package com.zcloud.basic.info.dto;
|
||||
|
||||
import com.alibaba.cola.dto.PageQuery;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
/**
|
||||
* web-client
|
||||
*
|
||||
* @Author zhaokai
|
||||
* @Date 2025-12-02 11:13:33
|
||||
*/
|
||||
@Data
|
||||
public class UserCorpPageQry extends PageQuery {
|
||||
|
||||
/**
|
||||
* 查询条件操作前缀,支持以下几种数据库查询操作:
|
||||
* - `like`: 模糊匹配查询,对应SQL的LIKE操作符
|
||||
* - `eq`: 等值查询,对应SQL的=操作符
|
||||
* - `gt`: 大于比较查询
|
||||
* - `lt`: 小于比较查询
|
||||
* - `ge`: 大于等于比较查询
|
||||
* - `le`: 小于等于比较查询
|
||||
* - `ne`: 不等比较查询,对应SQL的!=操作符
|
||||
*/
|
||||
private String likeUserCorpId;
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
package com.zcloud.basic.info.dto;
|
||||
|
||||
import com.alibaba.cola.dto.Command;
|
||||
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 zhaokai
|
||||
* @Date 2025-12-02 11:13:34
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class UserCorpUpdateCmd extends Command {
|
||||
@ApiModelProperty(value = "主键id", name = "id", required = true)
|
||||
@NotNull(message = "主键id不能为空")
|
||||
private Long id;
|
||||
@ApiModelProperty(value = "业务主键id", name = "userCorpId", required = true)
|
||||
@NotEmpty(message = "业务主键id不能为空")
|
||||
private String userCorpId;
|
||||
@ApiModelProperty(value = "用户id", name = "userId", required = true)
|
||||
@NotEmpty(message = "用户id不能为空")
|
||||
@NotNull(message = "用户id不能为空")
|
||||
private Long userId;
|
||||
@ApiModelProperty(value = "企业id", name = "corpinfoId", required = true)
|
||||
@NotNull(message = "企业id不能为空")
|
||||
private Long corpinfoId;
|
||||
@ApiModelProperty(value = "部门id", name = "departmentId", required = true)
|
||||
@NotNull(message = "部门id不能为空")
|
||||
private Long departmentId;
|
||||
@ApiModelProperty(value = "岗位id", name = "postId", required = true)
|
||||
@NotNull(message = "岗位id不能为空")
|
||||
private Long postId;
|
||||
@ApiModelProperty(value = "岗位名称", name = "postName", required = true)
|
||||
@NotEmpty(message = "岗位名称不能为空")
|
||||
private String postName;
|
||||
@ApiModelProperty(value = "角色id", name = "roleId", required = true)
|
||||
@NotNull(message = "角色id不能为空")
|
||||
private Long roleId;
|
||||
@ApiModelProperty(value = "人员在部门中的排序", name = "sort", required = true)
|
||||
@NotNull(message = "人员在部门中的排序不能为空")
|
||||
private Integer sort;
|
||||
@ApiModelProperty(value = "是否部门领导0否1是", name = "departmentLeaderFlag", required = true)
|
||||
@NotNull(message = "是否部门领导0否1是不能为空")
|
||||
private Integer departmentLeaderFlag;
|
||||
@ApiModelProperty(value = "入职状态,1-在职 0-离职, 2-入职待审核, 3-离职待审核", name = "employmentFlag", required = true)
|
||||
@NotNull(message = "入职状态,1-在职 0-离职, 2-入职待审核, 3-离职待审核不能为空")
|
||||
private Integer employmentFlag;
|
||||
}
|
||||
|
||||
|
|
@ -28,6 +28,7 @@ public class UserPageQry extends PageQuery {
|
|||
private Long eqDepartmentId;
|
||||
private Long eqPostId;
|
||||
private Long eqRoleId;
|
||||
@ApiModelProperty(value = "是否流动人员,1-流动,0-固定人员")
|
||||
private Integer eqEmploymentFlag;
|
||||
private String likeName;
|
||||
private String likeUsername;
|
||||
|
|
@ -38,5 +39,6 @@ public class UserPageQry extends PageQuery {
|
|||
@ApiModelProperty(value = "身份证号")
|
||||
private String likeUserIdCard;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,37 @@
|
|||
package com.zcloud.basic.info.dto;
|
||||
|
||||
import com.alibaba.cola.dto.PageQuery;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
* web-client
|
||||
*
|
||||
* @Author zhangyue
|
||||
* @Date 2025-11-04 14:07:36
|
||||
*/
|
||||
@Data
|
||||
public class UserResignationCmd implements Serializable {
|
||||
|
||||
/**
|
||||
* 查询条件操作前缀,支持以下几种数据库查询操作:
|
||||
* - `like`: 模糊匹配查询,对应SQL的LIKE操作符
|
||||
* - `eq`: 等值查询,对应SQL的=操作符
|
||||
* - `gt`: 大于比较查询
|
||||
* - `lt`: 小于比较查询
|
||||
* - `ge`: 大于等于比较查询
|
||||
* - `le`: 小于等于比较查询
|
||||
* - `ne`: 不等比较查询,对应SQL的!=操作符
|
||||
*/
|
||||
@ApiModelProperty(value = "用户id")
|
||||
private Long userId;
|
||||
//企业id
|
||||
@ApiModelProperty(value = "企业id")
|
||||
private Long corpinfoId;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -89,6 +89,8 @@ public class UserUpdateCmd extends Command {
|
|||
private String politicalAffiliation;
|
||||
@ApiModelProperty(value = "政治面貌名称", name = "politicalAffiliationName")
|
||||
private String politicalAffiliationName;
|
||||
|
||||
// 入职状态
|
||||
@ApiModelProperty(value = "是否流动人员,1-流动,0-固定人员")
|
||||
private Integer flowFlag;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -74,4 +74,6 @@ public class UserChangeRecordCO extends ClientObject {
|
|||
//变更后状态
|
||||
@ApiModelProperty(value = "变更后状态")
|
||||
private Integer userStatusAfter;
|
||||
@ApiModelProperty(value = "离职原因")
|
||||
private String resignationReason;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,88 @@
|
|||
package com.zcloud.basic.info.dto.clientobject;
|
||||
|
||||
import com.alibaba.cola.dto.ClientObject;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
|
||||
/**
|
||||
* web-client
|
||||
*
|
||||
* @Author zhaokai
|
||||
* @Date 2025-12-02 11:13:33
|
||||
*/
|
||||
@Data
|
||||
public class UserCorpCO extends ClientObject {
|
||||
//主键id
|
||||
@ApiModelProperty(value = "主键id")
|
||||
private Long id;
|
||||
//业务主键id
|
||||
@ApiModelProperty(value = "业务主键id")
|
||||
private String userCorpId;
|
||||
//用户id
|
||||
@ApiModelProperty(value = "用户id")
|
||||
private Long userId;
|
||||
//企业id
|
||||
@ApiModelProperty(value = "企业id")
|
||||
private Long corpinfoId;
|
||||
//部门id
|
||||
@ApiModelProperty(value = "部门id")
|
||||
private Long departmentId;
|
||||
//岗位id
|
||||
@ApiModelProperty(value = "岗位id")
|
||||
private Long postId;
|
||||
//岗位名称
|
||||
@ApiModelProperty(value = "岗位名称")
|
||||
private String postName;
|
||||
//角色id
|
||||
@ApiModelProperty(value = "角色id")
|
||||
private Long roleId;
|
||||
//人员在部门中的排序
|
||||
@ApiModelProperty(value = "人员在部门中的排序")
|
||||
private Integer sort;
|
||||
//是否部门领导0否1是
|
||||
@ApiModelProperty(value = "是否部门领导0否1是")
|
||||
private Integer departmentLeaderFlag;
|
||||
//入职状态,1-在职 0-离职, 2-入职待审核, 3-离职待审核
|
||||
@ApiModelProperty(value = "入职状态,1-在职 0-离职, 2-入职待审核, 3-离职待审核")
|
||||
private Integer employmentFlag;
|
||||
//乐观锁
|
||||
@ApiModelProperty(value = "乐观锁")
|
||||
private Integer version;
|
||||
//创建人
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private Long createId;
|
||||
//创建人姓名
|
||||
@ApiModelProperty(value = "创建人姓名")
|
||||
private String createName;
|
||||
//创建时间
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
//更新人
|
||||
@ApiModelProperty(value = "更新人")
|
||||
private Long updateId;
|
||||
//修改人名称
|
||||
@ApiModelProperty(value = "修改人名称")
|
||||
private String updateName;
|
||||
//更新时间
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
//描述
|
||||
@ApiModelProperty(value = "描述")
|
||||
private String remarks;
|
||||
//是否删除
|
||||
@ApiModelProperty(value = "是否删除")
|
||||
private String deleteEnum;
|
||||
//租户ID
|
||||
@ApiModelProperty(value = "租户ID")
|
||||
private Long tenantId;
|
||||
//机构ID
|
||||
@ApiModelProperty(value = "机构ID")
|
||||
private Long orgId;
|
||||
//环境
|
||||
@ApiModelProperty(value = "环境")
|
||||
private String env;
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,185 @@
|
|||
package com.zcloud.basic.info.dto.clientobject;
|
||||
|
||||
import com.alibaba.cola.dto.ClientObject;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.zcloud.gbscommon.translateaop.TranslateEunm;
|
||||
import com.zcloud.gbscommon.translateaop.ZCloudTranslate;
|
||||
import com.zcloud.gbscommon.translateaop.ZCloudTranslates;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
/**
|
||||
* web-client
|
||||
*
|
||||
* @Author zhangyue
|
||||
* @Date 2025-11-04 14:07:33
|
||||
*/
|
||||
@Data
|
||||
public class UserXmfCO extends ClientObject {
|
||||
//GBS用户id
|
||||
@ApiModelProperty(value = "GBS用户id")
|
||||
private Long id;
|
||||
//业务主键id老系统id
|
||||
@ApiModelProperty(value = "业务主键id老系统id")
|
||||
private String userId;
|
||||
//登录账号
|
||||
@ApiModelProperty(value = "登录账号")
|
||||
private String username;
|
||||
//姓名
|
||||
@ApiModelProperty(value = "姓名")
|
||||
private String name;
|
||||
//企业id
|
||||
@ApiModelProperty(value = "企业id")
|
||||
private Long corpinfoId;
|
||||
@ApiModelProperty(value = "企业名称")
|
||||
private String corpinfoName;
|
||||
//是否主账号1是0否
|
||||
@ApiModelProperty(value = "是否主账号1是0否")
|
||||
private Integer mainCorpFlag;
|
||||
//用户类型,1监管2企业3相关方
|
||||
@ApiModelProperty(value = "用户类型,1监管2企业3相关方")
|
||||
private Integer userType;
|
||||
//部门id
|
||||
@ApiModelProperty(value = "部门id")
|
||||
private Long departmentId;
|
||||
//部门id
|
||||
@ApiModelProperty(value = "部门名称")
|
||||
private String departmentName;
|
||||
//岗位id
|
||||
@ApiModelProperty(value = "岗位id")
|
||||
private Long postId;
|
||||
//岗位id
|
||||
@ApiModelProperty(value = "岗位名称")
|
||||
private String postName;
|
||||
//角色id
|
||||
@ApiModelProperty(value = "角色id")
|
||||
private Long roleId;
|
||||
//邮箱
|
||||
@ApiModelProperty(value = "邮箱")
|
||||
private String email;
|
||||
//人员类型编码(主要负责人等)
|
||||
@ApiModelProperty(value = "人员类型编码(主要负责人等)")
|
||||
private String personnelType;
|
||||
//人员类型翻译
|
||||
@ApiModelProperty(value = "人员类型翻译")
|
||||
private String personnelTypeName;
|
||||
//民族编码问一下有没有组件
|
||||
@ApiModelProperty(value = "民族编码问一下有没有组件")
|
||||
private String nation;
|
||||
//民族名称
|
||||
@ApiModelProperty(value = "民族名称")
|
||||
private String nationName;
|
||||
//身份证号
|
||||
@ApiModelProperty(value = "身份证号")
|
||||
private String userIdCard;
|
||||
//人脸头像url
|
||||
@ApiModelProperty(value = "人脸头像url")
|
||||
private String userAvatarUrl;
|
||||
//现住址
|
||||
@ApiModelProperty(value = "现住址")
|
||||
private String currentAddress;
|
||||
//户口所在地
|
||||
@ApiModelProperty(value = "户口所在地")
|
||||
private String locationAddress;
|
||||
|
||||
@ApiModelProperty(value = "职级")
|
||||
private String rankLevel;
|
||||
@ApiModelProperty(value = "职级名称")
|
||||
private String rankLevelName;
|
||||
@ApiModelProperty(value = "手机号")
|
||||
private String phone;
|
||||
//人员在部门中的排序
|
||||
@ApiModelProperty(value = "人员在部门中的排序")
|
||||
private Integer sort;
|
||||
//乐观锁
|
||||
@ApiModelProperty(value = "乐观锁")
|
||||
private Integer version;
|
||||
//创建人
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private Long createId;
|
||||
//创建人姓名
|
||||
@ApiModelProperty(value = "创建人姓名")
|
||||
private String createName;
|
||||
//创建时间
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date createTime;
|
||||
//更新人
|
||||
@ApiModelProperty(value = "更新人")
|
||||
private Long updateId;
|
||||
//修改人名称
|
||||
@ApiModelProperty(value = "修改人名称")
|
||||
private String updateName;
|
||||
//更新时间
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date updateTime;
|
||||
//描述
|
||||
@ApiModelProperty(value = "描述")
|
||||
private String remarks;
|
||||
//是否删除
|
||||
@ApiModelProperty(value = "是否删除")
|
||||
private String deleteEnum;
|
||||
//租户ID
|
||||
@ApiModelProperty(value = "租户ID")
|
||||
private Long tenantId;
|
||||
//机构ID
|
||||
@ApiModelProperty(value = "机构ID")
|
||||
private Long orgId;
|
||||
//环境
|
||||
@ApiModelProperty(value = "环境")
|
||||
private String env;
|
||||
//是否部门领导0否1是
|
||||
@ApiModelProperty(value = "是否部门领导0否1是")
|
||||
private Integer departmentLeaderFlag;
|
||||
//是否分管领导0否1是
|
||||
@ApiModelProperty(value = "是否分管领导0否1是")
|
||||
private Integer deputyLeaderFlag;
|
||||
//文化程度 数据字典
|
||||
@ApiModelProperty(value = "文化程度 数据字典")
|
||||
private String culturalLevel;
|
||||
//文化程度名称
|
||||
@ApiModelProperty(value = "文化程度名称")
|
||||
private String culturalLevelName;
|
||||
//婚姻状态
|
||||
@ApiModelProperty(value = "婚姻状态")
|
||||
private String maritalStatus;
|
||||
//婚姻状态名称
|
||||
@ApiModelProperty(value = "婚姻状态名称")
|
||||
private String maritalStatusName;
|
||||
//政治面貌
|
||||
@ApiModelProperty(value = "政治面貌")
|
||||
private String politicalAffiliation;
|
||||
//政治面貌名称
|
||||
@ApiModelProperty(value = "政治面貌名称")
|
||||
private String politicalAffiliationName;
|
||||
private String mappingName;
|
||||
private String mappingUserName;
|
||||
private String mappingPostName;
|
||||
private String mappingDeptName;
|
||||
// 入职状态
|
||||
@ApiModelProperty(value = "入职状态 1-在职 0-离职, 2-入职待审核, 3-离职待审核")
|
||||
private Integer employmentFlag;
|
||||
// 入职状态
|
||||
@ApiModelProperty(value = "是否流动人员,1-流动,0-固定人员")
|
||||
private Integer flowFlag;
|
||||
//用户所属企业id
|
||||
@ApiModelProperty(value = "用户所属企业id")
|
||||
private String userCorpId;
|
||||
|
||||
// 年龄
|
||||
@ApiModelProperty(value = "年龄")
|
||||
private Integer age;
|
||||
|
||||
//生日
|
||||
@ApiModelProperty(value = "生日")
|
||||
private String birthday;
|
||||
|
||||
// 性别
|
||||
@ApiModelProperty(value = "性别")
|
||||
private String sex;
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
package com.zcloud.basic.info.domain.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 入职状态,1-在职 0-离职, 2-信息变更中, 3-已退休
|
||||
*/
|
||||
@Getter
|
||||
public enum UserEmploymentFlagEnum {
|
||||
/**
|
||||
* 枚举值
|
||||
*/
|
||||
ON(1, "在职"),
|
||||
RESIGNATION(0, "离职"),
|
||||
INFO_CHANGE(2, "信息变更中"),
|
||||
RETIREMENT(3, "已退休"),
|
||||
;
|
||||
private final Integer code;
|
||||
private final String desc;
|
||||
|
||||
UserEmploymentFlagEnum(Integer code, String desc) {
|
||||
this.code = code;
|
||||
this.desc = desc;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
package com.zcloud.basic.info.domain.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 是否流动人员,1-流动,0-固定人员
|
||||
*/
|
||||
@Getter
|
||||
public enum UserFlowFlagEnum {
|
||||
/**
|
||||
* 枚举值
|
||||
*/
|
||||
FIXED(0, "固定人员"),
|
||||
FLOW(1, "流动人员"),
|
||||
;
|
||||
private final Integer code;
|
||||
private final String desc;
|
||||
|
||||
UserFlowFlagEnum(Integer code, String desc) {
|
||||
this.code = code;
|
||||
this.desc = desc;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
package com.zcloud.basic.info.domain.gateway;
|
||||
|
||||
import com.zcloud.basic.info.domain.model.UserCorpE;
|
||||
|
||||
/**
|
||||
* web-domain
|
||||
*
|
||||
* @Author zhaokai
|
||||
* @Date 2025-12-02 11:13:33
|
||||
*/
|
||||
public interface UserCorpGateway {
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
Boolean add(UserCorpE userCorpE);
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
Boolean update(UserCorpE userCorpE);
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
Boolean deletedUserCorpById(Long id);
|
||||
|
||||
Boolean deletedUserCorpByIds(Long[] id);
|
||||
}
|
||||
|
||||
|
|
@ -37,5 +37,7 @@ public interface UserGateway {
|
|||
* 修改密码
|
||||
*/
|
||||
Response updatePassword(UserE userE);
|
||||
|
||||
boolean addXgf(UserE userE);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.zcloud.basic.info.domain.model;
|
||||
|
||||
import com.jjb.saas.framework.domain.model.BaseE;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
|
@ -51,5 +52,55 @@ public class UserChangeRecordE extends BaseE {
|
|||
private String postNameAfter;
|
||||
//变更后状态
|
||||
private Integer userStatusAfter;
|
||||
//
|
||||
private String resignationReason;
|
||||
|
||||
public void initUserAdd(UserE userE, String corpinfoName, String departmentName) {
|
||||
this.setUserId(userE.getId());
|
||||
this.setChangeTime(new Date());
|
||||
this.setCorpinfoIdAfter(userE.getCorpinfoId());
|
||||
this.setCorpinfoNameAfter(corpinfoName);
|
||||
this.setDepartmentIdAfter(userE.getDepartmentId());
|
||||
this.setDepartmentNameAfter(departmentName);
|
||||
this.setPostIdAfter(userE.getPostId());
|
||||
this.setPostNameAfter(userE.getPostName());
|
||||
this.status = 1;
|
||||
}
|
||||
|
||||
public void initUserUpdate(UserE userE, UserE oldUserE, String corpName, String name) {
|
||||
this.setUserId(userE.getId());
|
||||
this.setChangeTime(new Date());
|
||||
this.setCorpinfoIdBefore(oldUserE.getCorpinfoId());
|
||||
this.setCorpinfoNameBefore(oldUserE.getCorpinfoName());
|
||||
this.setDepartmentIdBefore(oldUserE.getDepartmentId());
|
||||
this.setDepartmentNameBefore(oldUserE.getDepartmentName());
|
||||
this.setPostIdBefore(oldUserE.getPostId());
|
||||
this.setPostNameBefore(oldUserE.getPostName());
|
||||
this.setCorpinfoIdAfter(userE.getCorpinfoId());
|
||||
this.setCorpinfoNameAfter(corpName);
|
||||
this.setDepartmentIdAfter(userE.getDepartmentId());
|
||||
this.setDepartmentNameAfter(name);
|
||||
this.setPostIdAfter(userE.getPostId());
|
||||
this.setPostNameAfter(userE.getPostName());
|
||||
this.status = oldUserE.getEmploymentFlag();
|
||||
}
|
||||
|
||||
public void executeResignation(UserE userE, Integer code) {
|
||||
this.setUserId(userE.getId());
|
||||
this.setChangeTime(new Date());
|
||||
this.setCorpinfoIdBefore(userE.getCorpinfoId());
|
||||
this.setCorpinfoNameBefore(userE.getCorpinfoName());
|
||||
this.setDepartmentIdBefore(userE.getDepartmentId());
|
||||
this.setDepartmentNameBefore(userE.getDepartmentName());
|
||||
this.setPostIdBefore(userE.getPostId());
|
||||
this.setPostNameBefore(userE.getPostName());
|
||||
this.setCorpinfoIdAfter(null);
|
||||
this.setCorpinfoNameAfter(null);
|
||||
this.setDepartmentIdAfter(null);
|
||||
this.setDepartmentNameAfter(null);
|
||||
this.setPostIdAfter(null);
|
||||
this.setPostNameAfter(null);
|
||||
this.status = code;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,87 @@
|
|||
package com.zcloud.basic.info.domain.model;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.jjb.saas.framework.domain.model.BaseE;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* web-domain
|
||||
*
|
||||
* @Author zhaokai
|
||||
* @Date 2025-12-02 11:13:33
|
||||
*/
|
||||
@Data
|
||||
public class UserCorpE extends BaseE {
|
||||
//主键id
|
||||
private Long id;
|
||||
//业务主键id
|
||||
private String userCorpId;
|
||||
//用户id
|
||||
private Long userId;
|
||||
//企业id
|
||||
private Long corpinfoId;
|
||||
//部门id
|
||||
private Long departmentId;
|
||||
//岗位id
|
||||
private Long postId;
|
||||
//岗位名称
|
||||
private String postName;
|
||||
//角色id
|
||||
private Long roleId;
|
||||
//人员在部门中的排序
|
||||
private Integer sort;
|
||||
//是否部门领导0否1是
|
||||
private Integer departmentLeaderFlag;
|
||||
//入职状态,1-在职 0-离职, 2-入职待审核, 3-离职待审核
|
||||
private Integer employmentFlag;
|
||||
//乐观锁
|
||||
private Integer version;
|
||||
//创建人
|
||||
private Long createId;
|
||||
//创建人姓名
|
||||
private String createName;
|
||||
//创建时间
|
||||
private LocalDateTime createTime;
|
||||
//更新人
|
||||
private Long updateId;
|
||||
//修改人名称
|
||||
private String updateName;
|
||||
//更新时间
|
||||
private LocalDateTime updateTime;
|
||||
//描述
|
||||
private String remarks;
|
||||
//是否删除
|
||||
private String deleteEnum;
|
||||
//租户ID
|
||||
private Long tenantId;
|
||||
//机构ID
|
||||
private Long orgId;
|
||||
//环境
|
||||
private String env;
|
||||
private String corpinfoName;
|
||||
|
||||
private String departmentName;
|
||||
|
||||
public void initAdd(Long tenantId, UserE userE) {
|
||||
this.corpinfoId = tenantId;
|
||||
this.userId = userE.getId();
|
||||
this.departmentId = userE.getDepartmentId();
|
||||
this.postName = userE.getPostName();
|
||||
this.roleId = userE.getRoleId();
|
||||
this.sort = userE.getSort();
|
||||
this.departmentLeaderFlag = userE.getDepartmentLeaderFlag();
|
||||
}
|
||||
|
||||
public void initUpdate(UserE userE) {
|
||||
this.setDepartmentId(userE.getDepartmentId());
|
||||
this.setPostId(userE.getPostId());
|
||||
this.setPostName(userE.getPostName());
|
||||
this.setRoleId(userE.getRoleId());
|
||||
this.setSort(userE.getSort());
|
||||
this.setDepartmentLeaderFlag(userE.getDepartmentLeaderFlag());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -6,6 +6,7 @@ import com.alibaba.cola.exception.BizException;
|
|||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.jjb.saas.framework.domain.model.BaseE;
|
||||
import com.zcloud.basic.info.domain.enums.CorpTypeEnum;
|
||||
import com.zcloud.basic.info.domain.enums.UserFlowFlagEnum;
|
||||
import com.zcloud.basic.info.domain.gateway.DepartmentGateway;
|
||||
import com.zcloud.gbscommon.excelEntity.UserExcelExportEntity;
|
||||
import com.zcloud.gbscommon.excelEntity.UserExcelImportEntity;
|
||||
|
|
@ -153,6 +154,7 @@ public class UserE extends BaseE {
|
|||
private String sex;
|
||||
|
||||
|
||||
|
||||
public void initAdd(Long tenantId, UserE userE) {
|
||||
userE.setUserId(Tools.get32UUID());
|
||||
userE.setTenantId(!ObjectUtils.isEmpty(userE.getTenantId()) ? userE.getTenantId() : tenantId);
|
||||
|
|
@ -169,16 +171,16 @@ public class UserE extends BaseE {
|
|||
* @return
|
||||
*/
|
||||
public boolean verifyTransferPosition(UserE oldUserE, UserE newUserE) {
|
||||
if (oldUserE.getCorpinfoId() != newUserE.getCorpinfoId()) {
|
||||
if (!oldUserE.getCorpinfoId().equals(newUserE.getCorpinfoId())) {
|
||||
return true;
|
||||
}
|
||||
if (oldUserE.getDepartmentId() != newUserE.getDepartmentId()) {
|
||||
if (!oldUserE.getDepartmentId().equals(newUserE.getDepartmentId())) {
|
||||
return true;
|
||||
}
|
||||
if (oldUserE.getPostId() != newUserE.getPostId()) {
|
||||
if (!oldUserE.getPostId().equals(newUserE.getPostId())) {
|
||||
return true;
|
||||
}
|
||||
if (oldUserE.getEmploymentFlag() != newUserE.getEmploymentFlag()) {
|
||||
if (!oldUserE.getEmploymentFlag().equals(newUserE.getEmploymentFlag())) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
@ -225,10 +227,19 @@ public class UserE extends BaseE {
|
|||
public void encryptionPassword() {
|
||||
|
||||
this.setPassword(Sm2Util.encryptHex(MD5.md5(password), publicKey));
|
||||
if(StringUtils.isNotEmpty(newPassword)){
|
||||
if (StringUtils.isNotEmpty(newPassword)) {
|
||||
this.setNewPassword(Sm2Util.encryptHex(MD5.md5(newPassword), publicKey));
|
||||
}
|
||||
}
|
||||
|
||||
public void setOldFlowInfo(UserCorpE userCorpE) {
|
||||
this.setDepartmentId(userCorpE.getDepartmentId());
|
||||
this.setPostId(userCorpE.getPostId());
|
||||
this.setDepartmentName(userCorpE.getDepartmentName());
|
||||
this.setPostName(userCorpE.getPostName());
|
||||
this.setCorpinfoName(userCorpE.getCorpinfoName());
|
||||
this.setCorpinfoId(userCorpE.getCorpinfoId());
|
||||
this.setEmploymentFlag(userCorpE.getEmploymentFlag());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,57 @@
|
|||
package com.zcloud.basic.info.gatewayimpl;
|
||||
|
||||
import com.alibaba.cola.exception.BizException;
|
||||
import com.zcloud.basic.info.domain.gateway.UserCorpGateway;
|
||||
import com.zcloud.basic.info.domain.model.UserCorpE;
|
||||
import com.zcloud.basic.info.persistence.dataobject.UserCorpDO;
|
||||
import com.zcloud.basic.info.persistence.repository.UserCorpRepository;
|
||||
import com.zcloud.gbscommon.utils.Tools;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
/**
|
||||
* web-infrastructure
|
||||
*
|
||||
* @Author zhaokai
|
||||
* @Date 2025-12-02 11:13:33
|
||||
*/
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class UserCorpGatewayImpl implements UserCorpGateway {
|
||||
private final UserCorpRepository userCorpRepository;
|
||||
|
||||
@Override
|
||||
public Boolean add(UserCorpE userCorpE) {
|
||||
if(StringUtils.isEmpty(userCorpE.getUserCorpId())){
|
||||
userCorpE.setUserCorpId(Tools.get32UUID());
|
||||
}
|
||||
UserCorpDO d = new UserCorpDO();
|
||||
BeanUtils.copyProperties(userCorpE, d);
|
||||
userCorpRepository.save(d);
|
||||
userCorpE.setId(d.getId());
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean update(UserCorpE userCorpE) {
|
||||
UserCorpDO d = new UserCorpDO();
|
||||
BeanUtils.copyProperties(userCorpE, d);
|
||||
userCorpRepository.updateById(d);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deletedUserCorpById(Long id) {
|
||||
return userCorpRepository.removeById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deletedUserCorpByIds(Long[] ids) {
|
||||
return userCorpRepository.removeByIds(Collections.singletonList(ids));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -34,6 +34,16 @@ public class UserGatewayImpl implements UserGateway {
|
|||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean addXgf(UserE userE) {
|
||||
UserDO d = new UserDO();
|
||||
BeanUtils.copyProperties(userE, d);
|
||||
userE.resetPassword();
|
||||
userRepository.saveUserXgf(d);
|
||||
userE.setId(d.getId());
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean update(UserE userE) {
|
||||
UserDO d = new UserDO();
|
||||
|
|
|
|||
|
|
@ -74,6 +74,8 @@ public class UserChangeRecordDO extends BaseDO {
|
|||
//变更后状态
|
||||
@ApiModelProperty(value = "变更后状态")
|
||||
private Integer userStatusAfter;
|
||||
@ApiModelProperty(value = "离职原因")
|
||||
private String resignationReason;
|
||||
|
||||
public UserChangeRecordDO(String userChangeRecordId) {
|
||||
this.userChangeRecordId = userChangeRecordId;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,66 @@
|
|||
package com.zcloud.basic.info.persistence.dataobject;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.jjb.saas.framework.repository.basedo.BaseDO;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* web-infrastructure
|
||||
*
|
||||
* @Author zhaokai
|
||||
* @Date 2025-12-02 11:13:33
|
||||
*/
|
||||
@Data
|
||||
@TableName("user_corp")
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class UserCorpDO extends BaseDO {
|
||||
//业务主键id
|
||||
@ApiModelProperty(value = "业务主键id")
|
||||
private String userCorpId;
|
||||
//用户id
|
||||
@ApiModelProperty(value = "用户id")
|
||||
private Long userId;
|
||||
//企业id
|
||||
@ApiModelProperty(value = "企业id")
|
||||
private Long corpinfoId;
|
||||
//部门id
|
||||
@ApiModelProperty(value = "部门id")
|
||||
private Long departmentId;
|
||||
//岗位id
|
||||
@ApiModelProperty(value = "岗位id")
|
||||
private Long postId;
|
||||
//岗位名称
|
||||
@ApiModelProperty(value = "岗位名称")
|
||||
private String postName;
|
||||
//角色id
|
||||
@ApiModelProperty(value = "角色id")
|
||||
private Long roleId;
|
||||
//人员在部门中的排序
|
||||
@ApiModelProperty(value = "人员在部门中的排序")
|
||||
private Integer sort;
|
||||
//是否部门领导0否1是
|
||||
@ApiModelProperty(value = "是否部门领导0否1是")
|
||||
private Integer departmentLeaderFlag;
|
||||
//入职状态,1-在职 0-离职, 2-入职待审核, 3-离职待审核
|
||||
@ApiModelProperty(value = "入职状态,1-在职 0-离职, 2-入职待审核, 3-离职待审核")
|
||||
private Integer employmentFlag;
|
||||
|
||||
@ApiModelProperty(value = "企业名称")
|
||||
@TableField(exist = false)
|
||||
private String corpinfoName;
|
||||
|
||||
@ApiModelProperty(value = "部门名称")
|
||||
@TableField(exist = false)
|
||||
private String departmentName;
|
||||
|
||||
public UserCorpDO(String userCorpId) {
|
||||
this.userCorpId = userCorpId;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -125,6 +125,8 @@ public class UserDO extends BaseDO {
|
|||
// 入职状态
|
||||
@ApiModelProperty(value = "是否流动人员,1-流动,0-固定人员")
|
||||
private Integer flowFlag;
|
||||
//用户所属企业id
|
||||
private String userCorpId;
|
||||
|
||||
|
||||
//密码
|
||||
|
|
|
|||
|
|
@ -0,0 +1,18 @@
|
|||
package com.zcloud.basic.info.persistence.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.zcloud.basic.info.persistence.dataobject.UserCorpDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* web-infrastructure
|
||||
*
|
||||
* @Author zhaokai
|
||||
* @Date 2025-12-02 11:13:33
|
||||
*/
|
||||
@Mapper
|
||||
public interface UserCorpMapper extends BaseMapper<UserCorpDO> {
|
||||
|
||||
UserCorpDO getInfoByUserId(Long userId, Long corpinfoId);
|
||||
}
|
||||
|
||||
|
|
@ -28,5 +28,7 @@ public interface UserMapper extends BaseMapper<UserDO> {
|
|||
List<DepartmentLeaderStatictiscDO> getDepartmentLeaderByDepartmentId(List<Long> departmentIds);
|
||||
|
||||
Integer countUser(@Param("params") Map<String, Object> params);
|
||||
|
||||
IPage<UserDO> listXgf(IPage<UserDO> iPage, Map<String, Object> params);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,23 @@
|
|||
package com.zcloud.basic.info.persistence.repository;
|
||||
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.jjb.saas.framework.repository.repo.BaseRepository;
|
||||
import com.zcloud.basic.info.domain.model.UserE;
|
||||
import com.zcloud.basic.info.persistence.dataobject.UserCorpDO;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* web-infrastructure
|
||||
*
|
||||
* @Author zhaokai
|
||||
* @Date 2025-12-02 11:13:33
|
||||
*/
|
||||
public interface UserCorpRepository extends BaseRepository<UserCorpDO> {
|
||||
PageResponse<UserCorpDO> listPage(Map<String, Object> params);
|
||||
|
||||
UserCorpDO getInfoByUserId(Long userId, Long tenantId);
|
||||
|
||||
UserE executeResignation(Long id, Long corpinfoId);
|
||||
}
|
||||
|
||||
|
|
@ -66,5 +66,8 @@ public interface UserRepository extends BaseRepository<UserDO> {
|
|||
|
||||
UserDO getEncryInfo(UserE userE);
|
||||
|
||||
void saveUserXgf(UserDO d);
|
||||
|
||||
PageResponse<UserDO> listXgf(Map<String, Object> params);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,60 @@
|
|||
package com.zcloud.basic.info.persistence.repository.impl;
|
||||
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.jjb.saas.framework.repository.common.PageHelper;
|
||||
import com.jjb.saas.framework.repository.repo.impl.BaseRepositoryImpl;
|
||||
import com.zcloud.basic.info.domain.enums.UserEmploymentFlagEnum;
|
||||
import com.zcloud.basic.info.domain.model.UserE;
|
||||
import com.zcloud.basic.info.persistence.dataobject.UserCorpDO;
|
||||
import com.zcloud.basic.info.persistence.mapper.UserCorpMapper;
|
||||
import com.zcloud.basic.info.persistence.repository.UserCorpRepository;
|
||||
import com.zcloud.gbscommon.utils.PageQueryHelper;
|
||||
import com.zcloud.gbscommon.utils.Query;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* web-infrastructure
|
||||
*
|
||||
* @Author zhaokai
|
||||
* @Date 2025-12-02 11:13:33
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class UserCorpRepositoryImpl extends BaseRepositoryImpl<UserCorpMapper, UserCorpDO> implements UserCorpRepository {
|
||||
private final UserCorpMapper userCorpMapper;
|
||||
|
||||
@Override
|
||||
public PageResponse<UserCorpDO> listPage(Map<String, Object> params) {
|
||||
IPage<UserCorpDO> iPage = new Query<UserCorpDO>().getPage(params);
|
||||
QueryWrapper<UserCorpDO> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper = PageQueryHelper.createPageQueryWrapper(queryWrapper, params);
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
IPage<UserCorpDO> result = userCorpMapper.selectPage(iPage, queryWrapper);
|
||||
return PageHelper.pageToResponse(result, result.getRecords());
|
||||
}
|
||||
|
||||
@Override
|
||||
public UserCorpDO getInfoByUserId(Long userId, Long corpinfoId) {
|
||||
return userCorpMapper.getInfoByUserId(userId, corpinfoId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public UserE executeResignation(Long id, Long corpinfoId) {
|
||||
UserCorpDO userCorpDO = getInfoByUserId(id, corpinfoId);
|
||||
if (userCorpDO == null) {
|
||||
return null;
|
||||
}
|
||||
userCorpDO.setEmploymentFlag(UserEmploymentFlagEnum.RESIGNATION.getCode());
|
||||
userCorpMapper.updateById(userCorpDO);
|
||||
UserE userE = new UserE();
|
||||
BeanUtils.copyProperties(userCorpDO, userE);
|
||||
return userE;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -20,10 +20,9 @@ import com.jjb.saas.system.client.role.response.RoleCO;
|
|||
import com.jjb.saas.system.client.system.facade.SystemFacade;
|
||||
import com.jjb.saas.system.client.tenant.facade.TenantFacade;
|
||||
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.UserAddCmd;
|
||||
import com.jjb.saas.system.client.user.request.UserUpdateCmd;
|
||||
import com.jjb.saas.system.client.user.request.UserUpdatePasswordCmd;
|
||||
import com.jjb.saas.system.client.user.request.*;
|
||||
import com.zcloud.basic.info.domain.enums.UserFlowFlagEnum;
|
||||
import com.zcloud.basic.info.domain.model.UserCorpE;
|
||||
import com.zcloud.basic.info.domain.model.UserE;
|
||||
import com.zcloud.basic.info.persistence.dataobject.DepartmentLeaderStatictiscDO;
|
||||
import com.zcloud.basic.info.persistence.dataobject.UserDO;
|
||||
|
|
@ -217,6 +216,49 @@ public class UserRepositoryImpl extends BaseRepositoryImpl<UserMapper, UserDO> i
|
|||
save(userDO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveUserXgf(UserDO userDO) {
|
||||
if(StringUtils.isEmpty(userDO.getUsername())){
|
||||
userDO.setUsername(userDO.getPhone());
|
||||
}
|
||||
|
||||
//TODO 流动人员同步gbs需要指定特殊tenantId
|
||||
// if(UserFlowFlagEnum.FLOW.getCode().equals(userDO.getFlowFlag())){
|
||||
// FacadeUserRegisterCmd facadeUserRegisterCmd = new FacadeUserRegisterCmd();
|
||||
// facadeUserRegisterCmd.setAccount(userDO.getUsername());
|
||||
// facadeUserRegisterCmd.setName(userDO.getName());
|
||||
// facadeUserRegisterCmd.setMobile(userDO.getPhone());
|
||||
// facadeUserRegisterCmd.setPassword(userDO.getPassword());
|
||||
// facadeUserRegisterCmd.setTenantId(1111111L);
|
||||
// facadeUserRegisterCmd.setAppKey("");
|
||||
// facadeUserRegisterCmd.setOrgId(11111L);
|
||||
//// facadeUserRegisterCmd.setRoleCodes(Collections.singletonList(userDO.getRoleId()));
|
||||
//
|
||||
// SingleResponse<Long> register = userFacade.register(facadeUserRegisterCmd);
|
||||
// userDO.setId(register.getData());
|
||||
// userDO.setCorpinfoId(null);
|
||||
// }else{
|
||||
UserAddCmd userAddCmd = new UserAddCmd();
|
||||
userAddCmd.setAccount(userDO.getUsername());
|
||||
userAddCmd.setName(userDO.getName());
|
||||
RoleDeptAddCmd roleDeptAddCmd = new RoleDeptAddCmd();
|
||||
roleDeptAddCmd.setRoleId(userDO.getRoleId());
|
||||
roleDeptAddCmd.setDeptId(userDO.getDepartmentId());
|
||||
List<RoleDeptAddCmd> roleDeptAddCmdList = Collections.singletonList(roleDeptAddCmd);
|
||||
userAddCmd.setRoleDepts(roleDeptAddCmdList);
|
||||
SingleResponse<Long> gbsResult = userFacade.add(userAddCmd);
|
||||
userDO.setId(gbsResult.getData());
|
||||
// }
|
||||
|
||||
if(userDO.getSort() == null){
|
||||
userDO.setSort(9999);
|
||||
}
|
||||
// 新增用户默认在职
|
||||
userDO.setEmploymentFlag(1);
|
||||
|
||||
save(userDO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateInfoById(UserDO userDO) {
|
||||
updateById(userDO);
|
||||
|
|
@ -314,7 +356,7 @@ public class UserRepositoryImpl extends BaseRepositoryImpl<UserMapper, UserDO> i
|
|||
|
||||
@Override
|
||||
public UserDO getEncryInfo(UserE userE) {
|
||||
// TODO 验证老密码是否正确
|
||||
// 验证老密码是否正确
|
||||
AccountPasswordCheckCmd accountPasswordCheckCmd = new AccountPasswordCheckCmd();
|
||||
accountPasswordCheckCmd.setUserId(AuthContext.getUserId());
|
||||
accountPasswordCheckCmd.setPassword(userE.getPassword());
|
||||
|
|
@ -324,5 +366,12 @@ public class UserRepositoryImpl extends BaseRepositoryImpl<UserMapper, UserDO> i
|
|||
}
|
||||
return getById(userE.getId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResponse<UserDO> listXgf(Map<String, Object> params) {
|
||||
IPage<UserDO> iPage = new Query<UserDO>().getPage(params);
|
||||
IPage<UserDO> result = userMapper.listXgf(iPage, params);
|
||||
return PageHelper.pageToResponse(result, result.getRecords());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,17 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<mapper namespace="com.zcloud.basic.info.persistence.mapper.UserCorpMapper">
|
||||
|
||||
<select id="getInfoByUserId" resultType="com.zcloud.basic.info.persistence.dataobject.UserCorpDO">
|
||||
select uc.*, ci.corp_name as corpinfoName, di.name as departmentName
|
||||
from user_corp uc
|
||||
left join corp_info ci on uc.corpinfo_id = ci.id
|
||||
left join department di on uc.department_id = di.id
|
||||
where uc.user_id = #{userId}
|
||||
and uc.corpinfo_id = #{corpinfoId}
|
||||
and uc.delete_enum = 'FALSE'
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
|
|
@ -211,6 +211,7 @@
|
|||
u.political_affiliation,
|
||||
u.political_affiliation_name,
|
||||
u.employment_flag,
|
||||
u.flow_flag,
|
||||
CASE
|
||||
WHEN LENGTH(u.user_id_card) > 0
|
||||
AND MOD(SUBSTRING(u.user_id_card, 17, 1), 2) = 1 THEN
|
||||
|
|
@ -269,5 +270,107 @@
|
|||
</where>
|
||||
</select>
|
||||
|
||||
<select id="listXgf" resultType="com.zcloud.basic.info.persistence.dataobject.UserDO">
|
||||
SELECT
|
||||
u.id AS id,
|
||||
u.username AS username,
|
||||
u.name AS name,
|
||||
u.main_corp_flag AS mainCorpFlag,
|
||||
u.user_type AS userType,
|
||||
u.department_id AS departmentId,
|
||||
u.post_id AS postId,
|
||||
u.role_id AS roleId,
|
||||
u.email AS email,
|
||||
u.phone AS phone,
|
||||
u.personnel_type AS personnelType,
|
||||
u.personnel_type_name AS personnelTypeName,
|
||||
u.nation AS nation,
|
||||
u.nation_name AS nationName,
|
||||
u.user_id_card AS userIdCard,
|
||||
u.user_avatar_url AS userAvatarUrl,
|
||||
u.current_address AS currentAddress,
|
||||
u.location_address AS locationAddress,
|
||||
u.rank_level AS rankLevel,
|
||||
u.rank_level_name AS rankLevelName,
|
||||
u.sort AS sort,
|
||||
u.department_leader_flag AS departmentLeaderFlag,
|
||||
u.flow_flag AS flowFlag,
|
||||
cp.user_corp_id as userCorpId,
|
||||
CASE
|
||||
WHEN u.flow_flag = 0 THEN u.employment_flag
|
||||
WHEN u.flow_flag = 1 THEN cp.employment_flag
|
||||
END AS employmentFlag,
|
||||
|
||||
CASE
|
||||
WHEN u.flow_flag = 0 THEN ud.name
|
||||
WHEN u.flow_flag = 1 THEN cpd.name
|
||||
END AS departmentName,
|
||||
CASE
|
||||
WHEN u.flow_flag = 0 THEN cu.corp_name
|
||||
WHEN u.flow_flag = 1 THEN ccp.corp_name
|
||||
END AS corpName,
|
||||
CASE
|
||||
WHEN u.flow_flag = 0 THEN u.department_id
|
||||
WHEN u.flow_flag = 1 THEN cpd.id
|
||||
END AS queryDepartmentId,
|
||||
CASE
|
||||
WHEN u.flow_flag = 0 THEN u.corpinfo_id
|
||||
WHEN u.flow_flag = 1 THEN cp.corpinfo_id
|
||||
END AS corpinfoId
|
||||
FROM
|
||||
user u
|
||||
LEFT JOIN user_corp cp ON u.id = cp.user_id AND cp.delete_enum = 'FALSE'
|
||||
LEFT JOIN department ud ON u.department_id = ud.id
|
||||
LEFT JOIN department cpd ON ud.parent_id = cpd.id
|
||||
AND cpd.delete_enum = 'FALSE'
|
||||
AND cp.corpinfo_id = cpd.corpinfo_id
|
||||
LEFT JOIN corp_info cu ON u.corpinfo_id = cu.id
|
||||
LEFT JOIN corp_info ccp ON cp.corpinfo_id = ccp.id
|
||||
WHERE
|
||||
(
|
||||
u.corpinfo_id IS NULL
|
||||
OR u.corpinfo_id = ''
|
||||
OR u.id != u.corpinfo_id
|
||||
)
|
||||
|
||||
AND u.delete_enum = 'FALSE'
|
||||
<if test="params.eqCorpinfoId != null">
|
||||
AND (
|
||||
(u.flow_flag = 0 AND u.corpinfo_id = #{params.eqCorpinfoId} )
|
||||
OR
|
||||
(u.flow_flag = 1 AND cp.corpinfo_id = #{params.eqCorpinfoId} )
|
||||
)
|
||||
</if>
|
||||
<if test="params.eqDepartmentId != null and params.eqDepartmentId != ''">
|
||||
AND (
|
||||
(u.flow_flag = 0 AND u.department_id = #{params.eqDepartmentId} )
|
||||
OR
|
||||
(u.flow_flag = 1 AND cp.id = #{params.eqDepartmentId} )
|
||||
)
|
||||
</if>
|
||||
<if test="params.eqDepartmentId != null and params.eqDepartmentId != ''">
|
||||
AND (
|
||||
(u.flow_flag = 0 AND u.department_id = #{params.eqDepartmentId} )
|
||||
OR
|
||||
(u.flow_flag = 1 AND cp.id = #{params.eqDepartmentId} )
|
||||
)
|
||||
</if>
|
||||
<if test="params.likeName != null and params.likeName != ''">
|
||||
AND u.name LIKE CONCAT('%', #{params.likeName}, '%')
|
||||
</if>
|
||||
<if test="params.likeUserIdCard != null and params.likeUserIdCard != ''">
|
||||
AND u.user_id_card = #{params.likeUserIdCard}
|
||||
</if>
|
||||
<if test="params.eqEmploymentFlag != null and params.eqEmploymentFlag != ''">
|
||||
AND u.employment_flag = #{params.eqEmploymentFlag}
|
||||
</if>
|
||||
|
||||
|
||||
ORDER BY
|
||||
u.sort ASC, u.create_time DESC
|
||||
|
||||
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue