Merge remote-tracking branch 'origin/main' into main
# Conflicts: # web-adapter/src/main/java/com/zcloud/basic/info/app/AppUserController.java # web-infrastructure/src/main/java/com/zcloud/basic/info/persistence/repository/UserCorpRepository.java # web-infrastructure/src/main/java/com/zcloud/basic/info/persistence/repository/impl/UserCorpRepositoryImpl.javamain
commit
67654360ea
|
|
@ -0,0 +1,53 @@
|
|||
package com.zcloud.basic.info.app;
|
||||
|
||||
|
||||
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.UserCorpRecordServiceI;
|
||||
import com.zcloud.basic.info.dto.UserCorpRecordAddCmd;
|
||||
import com.zcloud.basic.info.dto.UserCorpRecordPageQry;
|
||||
import com.zcloud.basic.info.dto.UserCorpRecordUpdateCmd;
|
||||
import com.zcloud.basic.info.dto.clientobject.UserCO;
|
||||
import com.zcloud.basic.info.dto.clientobject.UserCorpRecordCO;
|
||||
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-03 10:21:58
|
||||
*/
|
||||
@Api(tags = "APP用户入职企业记录表")
|
||||
@RequestMapping("/${application.gateway}/app/userCorpRecord")
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
public class ApUserCorpRecordController {
|
||||
private final UserCorpRecordServiceI userCorpRecordService;
|
||||
|
||||
|
||||
@ApiOperation("就职单位记录分页")
|
||||
@PostMapping("/list")
|
||||
public PageResponse<UserCorpRecordCO> page(@RequestBody UserCorpRecordPageQry qry) {
|
||||
return userCorpRecordService.listPage(qry);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("就职单位用户信息详情")
|
||||
@GetMapping("/getInfoById/{id}")
|
||||
public SingleResponse<UserCO> getInfoById(@PathVariable("id") Long id) {
|
||||
return SingleResponse.of(userCorpRecordService.getInfoById(id));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -66,6 +66,13 @@ public class AppUserController {
|
|||
return SingleResponse.buildSuccess();
|
||||
}
|
||||
|
||||
@ApiOperation("用户离职申请")
|
||||
@PostMapping("/appUserResignation")
|
||||
public Response appUserResignation(@Validated @RequestBody AppUserResignationCmd appUserResignationCmd){
|
||||
userService.appUserResignation(appUserResignationCmd);
|
||||
return SingleResponse.buildSuccess();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,11 +2,7 @@ package com.zcloud.basic.info.web;
|
|||
|
||||
|
||||
import com.zcloud.basic.info.api.UserChangeRecordServiceI;
|
||||
import com.zcloud.basic.info.dto.UserChangeRecordAddCmd;
|
||||
import com.zcloud.basic.info.dto.UserChangeRecordPageQry;
|
||||
import com.zcloud.basic.info.dto.UserChangeRecordListQry;
|
||||
import com.zcloud.basic.info.dto.UserChangeRecordUpdateCmd;
|
||||
import com.zcloud.basic.info.dto.UserChangeRecordRemoveCmd;
|
||||
import com.zcloud.basic.info.dto.*;
|
||||
import com.alibaba.cola.dto.MultiResponse;
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.alibaba.cola.dto.Response;
|
||||
|
|
@ -33,50 +29,18 @@ import org.springframework.web.bind.annotation.*;
|
|||
public class UserChangeRecordController {
|
||||
private final UserChangeRecordServiceI userChangeRecordService;
|
||||
|
||||
@ApiOperation("新增")
|
||||
@PostMapping("/save")
|
||||
public SingleResponse<UserChangeRecordCO> add(@Validated @RequestBody UserChangeRecordAddCmd cmd) {
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
return userChangeRecordService.add(cmd);
|
||||
}
|
||||
|
||||
@ApiOperation("修改")
|
||||
@PutMapping("/edit")
|
||||
public SingleResponse edit(@Validated @RequestBody UserChangeRecordUpdateCmd cmd) {
|
||||
userChangeRecordService.edit(cmd);
|
||||
return SingleResponse.buildSuccess();
|
||||
}
|
||||
|
||||
@ApiOperation("分页")
|
||||
@ApiOperation(value = "分页",hidden = true)
|
||||
@PostMapping("/list")
|
||||
public PageResponse<UserChangeRecordCO> page(@RequestBody UserChangeRecordPageQry qry) {
|
||||
return userChangeRecordService.listPage(qry);
|
||||
}
|
||||
|
||||
@ApiOperation("所有数据")
|
||||
@PostMapping("/listAll")
|
||||
public MultiResponse<UserChangeRecordCO> listAll(@RequestBody UserChangeRecordListQry qry) {
|
||||
return userChangeRecordService.list(qry);
|
||||
}
|
||||
|
||||
@ApiOperation("详情")
|
||||
@GetMapping("/getInfoById")
|
||||
public SingleResponse<UserChangeRecordCO> getInfoById(@RequestParam(value = "id") Long id) {
|
||||
return userChangeRecordService.getInfoById(id);
|
||||
}
|
||||
|
||||
@ApiOperation("删除")
|
||||
@PutMapping("/remove")
|
||||
public Response remove(@RequestParam(value = "id") Long id) {
|
||||
userChangeRecordService.remove(id);
|
||||
return SingleResponse.buildSuccess();
|
||||
}
|
||||
|
||||
@ApiOperation("删除多个")
|
||||
@PutMapping("/removeBatch")
|
||||
public Response removeBatch(@Validated @RequestBody UserChangeRecordRemoveCmd cmd) {
|
||||
userChangeRecordService.removeBatch(cmd.getIds());
|
||||
return SingleResponse.buildSuccess();
|
||||
@ApiOperation("变更记录详情详情")
|
||||
@PostMapping("/getChangerRecordInfoById")
|
||||
public SingleResponse<UserChangeRecordCO> getChangerRecordInfoById(@RequestBody UserChangeRecordInfoQry userChangeRecordInfoQry) {
|
||||
return SingleResponse.of(userChangeRecordService.getChangerRecordInfoById(userChangeRecordInfoQry));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -164,12 +164,12 @@ public class UserController {
|
|||
userService.resignation(userResignationCmd);
|
||||
return SingleResponse.buildSuccess();
|
||||
}
|
||||
/* @ApiOperation("PC审核通过-驳回")
|
||||
@PostMapping("/resignation")
|
||||
public SingleResponse resignation(@RequestBody UserResignationCmd userResignationCmd) {
|
||||
userService.resignation(userResignationCmd);
|
||||
@ApiOperation("PC审核通过-驳回")
|
||||
@PostMapping("/reviewStatus")
|
||||
public SingleResponse reviewStatus(@RequestBody UserReviewStatusCmd userReviewStatusCmd) {
|
||||
userService.reviewStatus(userReviewStatusCmd);
|
||||
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.UserCorpRecordServiceI;
|
||||
import com.zcloud.basic.info.dto.UserCorpRecordAddCmd;
|
||||
import com.zcloud.basic.info.dto.UserCorpRecordPageQry;
|
||||
import com.zcloud.basic.info.dto.UserCorpRecordUpdateCmd;
|
||||
import com.zcloud.basic.info.dto.clientobject.UserCorpRecordCO;
|
||||
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-03 10:21:58
|
||||
*/
|
||||
@Api(tags = "用户入职企业记录表")
|
||||
@RequestMapping("/${application.gateway}/userCorpRecord")
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
public class UserCorpRecordController {
|
||||
private final UserCorpRecordServiceI userCorpRecordService;
|
||||
|
||||
@ApiOperation("新增")
|
||||
@PostMapping("/save")
|
||||
public SingleResponse<UserCorpRecordCO> add(@Validated @RequestBody UserCorpRecordAddCmd cmd) {
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
return userCorpRecordService.add(cmd);
|
||||
}
|
||||
|
||||
@ApiOperation("分页")
|
||||
@PostMapping("/list")
|
||||
public PageResponse<UserCorpRecordCO> page(@RequestBody UserCorpRecordPageQry qry) {
|
||||
return userCorpRecordService.listPage(qry);
|
||||
}
|
||||
|
||||
@ApiOperation("所有数据")
|
||||
@GetMapping("/listAll")
|
||||
public MultiResponse<UserCorpRecordCO> listAll() {
|
||||
return MultiResponse.of(new ArrayList<UserCorpRecordCO>());
|
||||
}
|
||||
|
||||
@ApiOperation("详情")
|
||||
@GetMapping("/{id}")
|
||||
public SingleResponse<UserCorpRecordCO> getInfoById(@PathVariable("id") Long id) {
|
||||
return SingleResponse.of(new UserCorpRecordCO());
|
||||
}
|
||||
|
||||
@ApiOperation("删除")
|
||||
@DeleteMapping("/{id}")
|
||||
public Response remove(@PathVariable("id") Long id) {
|
||||
userCorpRecordService.remove(id);
|
||||
return SingleResponse.buildSuccess();
|
||||
}
|
||||
|
||||
@ApiOperation("删除多个")
|
||||
@DeleteMapping("/ids")
|
||||
public Response removeBatch(@RequestParam Long[] ids) {
|
||||
userCorpRecordService.removeBatch(ids);
|
||||
return SingleResponse.buildSuccess();
|
||||
}
|
||||
|
||||
@ApiOperation("修改")
|
||||
@PutMapping("/edit")
|
||||
public SingleResponse edit(@Validated @RequestBody UserCorpRecordUpdateCmd userCorpRecordUpdateCmd) {
|
||||
userCorpRecordService.edit(userCorpRecordUpdateCmd);
|
||||
return SingleResponse.buildSuccess();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -46,7 +46,7 @@ public class UserAddExe {
|
|||
private final UserCorpGateway userCorpGateway;
|
||||
private final UserCorpRepository userCorpRepository;
|
||||
private final UserChangeRecordGateway userChangeRecordGateway;
|
||||
|
||||
private final UserCorpRecordGateway userCorpRecordGateway;
|
||||
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
|
|
@ -221,6 +221,13 @@ public class UserAddExe {
|
|||
* 同步gbs,流动人员企业固定
|
||||
*/
|
||||
DepartmentDO departmentDO = departmentRepository.getById(userE.getDepartmentId());
|
||||
|
||||
//增加用户入职企业
|
||||
UserCorpRecordE userCorpRecordE = new UserCorpRecordE();
|
||||
BeanUtils.copyProperties(cmd, userCorpRecordE);
|
||||
userCorpRecordE.initAdd(userE,corpInfoDO.getCorpName(),departmentDO.getName());
|
||||
userCorpRecordGateway.add(userCorpRecordE);
|
||||
|
||||
// 增加用户变更记录
|
||||
UserChangeRecordE userChangeRecordE = new UserChangeRecordE();
|
||||
BeanUtils.copyProperties(cmd, userChangeRecordE);
|
||||
|
|
@ -228,7 +235,6 @@ public class UserAddExe {
|
|||
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.UserCorpRecordGateway;
|
||||
import com.zcloud.basic.info.domain.model.UserCorpRecordE;
|
||||
import com.zcloud.basic.info.dto.UserCorpRecordAddCmd;
|
||||
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-03 10:21:58
|
||||
*/
|
||||
@Component
|
||||
@AllArgsConstructor
|
||||
public class UserCorpRecordAddExe {
|
||||
private final UserCorpRecordGateway userCorpRecordGateway;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean execute(UserCorpRecordAddCmd cmd) {
|
||||
UserCorpRecordE userCorpRecordE = new UserCorpRecordE();
|
||||
BeanUtils.copyProperties(cmd, userCorpRecordE);
|
||||
boolean res = false;
|
||||
try {
|
||||
res = userCorpRecordGateway.add(userCorpRecordE);
|
||||
} 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.UserCorpRecordGateway;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
|
||||
/**
|
||||
* web-app
|
||||
*
|
||||
* @Author zhaokai
|
||||
* @Date 2025-12-03 10:21:59
|
||||
*/
|
||||
@Component
|
||||
@AllArgsConstructor
|
||||
public class UserCorpRecordRemoveExe {
|
||||
private final UserCorpRecordGateway userCorpRecordGateway;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean execute(Long id) {
|
||||
boolean res = userCorpRecordGateway.deletedUserCorpRecordById(id);
|
||||
if (!res) {
|
||||
throw new BizException("删除失败");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean execute(Long[] ids) {
|
||||
boolean res = userCorpRecordGateway.deletedUserCorpRecordByIds(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.UserCorpRecordGateway;
|
||||
import com.zcloud.basic.info.domain.model.UserCorpRecordE;
|
||||
import com.zcloud.basic.info.dto.UserCorpRecordUpdateCmd;
|
||||
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-03 10:21:59
|
||||
*/
|
||||
@Component
|
||||
@AllArgsConstructor
|
||||
public class UserCorpRecordUpdateExe {
|
||||
private final UserCorpRecordGateway userCorpRecordGateway;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void execute(UserCorpRecordUpdateCmd userCorpRecordUpdateCmd) {
|
||||
UserCorpRecordE userCorpRecordE = new UserCorpRecordE();
|
||||
BeanUtils.copyProperties(userCorpRecordUpdateCmd, userCorpRecordE);
|
||||
boolean res = userCorpRecordGateway.update(userCorpRecordE);
|
||||
if (!res) {
|
||||
throw new BizException("修改失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -4,28 +4,14 @@ 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.UserChangeRecordStatusEnum;
|
||||
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.basic.info.domain.gateway.*;
|
||||
import com.zcloud.basic.info.domain.model.*;
|
||||
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.Const;
|
||||
import com.zcloud.gbscommon.utils.PageQueryHelper;
|
||||
import com.zcloud.gbscommon.utils.ZcloudRedisUtil;
|
||||
|
|
@ -38,6 +24,7 @@ import org.springframework.stereotype.Component;
|
|||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
|
|
@ -61,6 +48,8 @@ public class UserUpdateExe {
|
|||
private final UserCorpGateway userCorpGateway;
|
||||
private final UserChangeRecordGateway userChangeRecordGateway;
|
||||
private final DepartmentRepository departmentRepository;
|
||||
private final UserCorpRecordRepository userCorpRecordRepository;
|
||||
private final UserCorpRecordGateway userCorpRecordGateway;
|
||||
@DubboReference
|
||||
private UserFacade userFacade;
|
||||
|
||||
|
|
@ -95,7 +84,7 @@ public class UserUpdateExe {
|
|||
BeanUtils.copyProperties(userCorpE, infoByUserId);
|
||||
}
|
||||
}
|
||||
if (transferPositionFlag) {
|
||||
/* if (transferPositionFlag) {
|
||||
//保存用户变更记录
|
||||
CorpInfoDO corpInfoDO = corpInfoRepository.getById(userE.getCorpinfoId());
|
||||
if (corpInfoDO != null && !ObjectUtils.isEmpty(corpInfoDO.getCorpName())) {
|
||||
|
|
@ -116,7 +105,7 @@ public class UserUpdateExe {
|
|||
//TODO 处理未完成的工作
|
||||
|
||||
|
||||
}
|
||||
}*/
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -149,11 +138,11 @@ public class UserUpdateExe {
|
|||
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{
|
||||
Long corpinfoId = userResignationCmd.getCorpinfoId()==null?AuthContext.getTenantId():userResignationCmd.getCorpinfoId();
|
||||
|
||||
if(UserFlowFlagEnum.FLOW.getCode().equals(userDO.getFlowFlag())){
|
||||
userE=userCorpRepository.executeResignation(userDO.getId(), corpinfoId,UserEmploymentFlagEnum.RESIGNATION.getCode());
|
||||
}else{
|
||||
userE = new UserE();
|
||||
BeanUtils.copyProperties(userDO, userE);
|
||||
userE.setEmploymentFlag(UserEmploymentFlagEnum.RESIGNATION.getCode());
|
||||
|
|
@ -162,11 +151,146 @@ public class UserUpdateExe {
|
|||
if(userE==null){
|
||||
return;
|
||||
}
|
||||
//修改企业入职记录
|
||||
|
||||
UserCorpRecordDO userCorpRecordDO = userCorpRecordRepository.getInfoByUserId(userDO.getId(), corpinfoId,UserEmploymentFlagEnum.ON.getCode());
|
||||
UserCorpRecordE userCorpRecordE = new UserCorpRecordE();
|
||||
if(userCorpRecordDO!=null){
|
||||
BeanUtils.copyProperties(userCorpRecordDO, userCorpRecordE);
|
||||
userCorpRecordE.executeResignation(userCorpRecordE,userE);
|
||||
userCorpRecordGateway.update(userCorpRecordE);
|
||||
}else{
|
||||
userCorpRecordE.initResignation(userE);
|
||||
userCorpRecordGateway.add(userCorpRecordE);
|
||||
}
|
||||
|
||||
// 增加用户变更记录
|
||||
UserChangeRecordE userChangeRecordE = new UserChangeRecordE();
|
||||
userChangeRecordE.executeResignation(userE,UserEmploymentFlagEnum.RESIGNATION.getCode());
|
||||
userChangeRecordE.executeResignation(userE,UserEmploymentFlagEnum.RESIGNATION.getCode(),UserChangeRecordStatusEnum.APPROVED.getCode());
|
||||
userChangeRecordGateway.add(userChangeRecordE);
|
||||
//TODO 处理未完成工作
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void executeReviewStatus(UserReviewStatusCmd userReviewStatusCmd) {
|
||||
//获取用户信息,并更新审核状态
|
||||
UserDO userDO = userRepository.getInfoById(userReviewStatusCmd.getUserId());
|
||||
//
|
||||
UserEmploymentFlagEnum employmentFlagEnum = UserEmploymentFlagEnum.getByCode(userReviewStatusCmd.getEmploymentFlag());
|
||||
Integer employmentFlagAfter = null;
|
||||
switch (employmentFlagEnum) {
|
||||
case ENTRY_AUDIT:
|
||||
//入职待审核
|
||||
ReviewEntryAudit(userDO,userReviewStatusCmd);
|
||||
break;
|
||||
case RESIGNATION_AUDIT:
|
||||
//离职待审核
|
||||
ReviewResignationAudit(userDO,userReviewStatusCmd);
|
||||
break;
|
||||
default:
|
||||
throw new IllegalArgumentException("审核记录已完成");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void ReviewResignationAudit(UserDO userDO, UserReviewStatusCmd userReviewStatusCmd) {
|
||||
Integer reviewStatus = userReviewStatusCmd.getReviewStatus();
|
||||
//TODO 驳回需要待处理,暂时按照只能通过处理
|
||||
Integer employmentFlag = UserChangeRecordStatusEnum.APPROVED.getCode().equals(reviewStatus)?UserEmploymentFlagEnum.RESIGNATION.getCode():UserEmploymentFlagEnum.ON.getCode();
|
||||
UserE userE = null;
|
||||
Long corpinfoId = userReviewStatusCmd.getCorpinfoId() == null ? AuthContext.getTenantId() : userReviewStatusCmd.getCorpinfoId();
|
||||
if (UserFlowFlagEnum.FLOW.getCode().equals(userDO.getFlowFlag())) {
|
||||
userE = userCorpRepository.executeReviewStatus(userDO.getId(), corpinfoId, employmentFlag);
|
||||
} else {
|
||||
userE = new UserE();
|
||||
BeanUtils.copyProperties(userDO, userE);
|
||||
userE.setEmploymentFlag(employmentFlag);
|
||||
userGateway.update(userE);
|
||||
}
|
||||
if (userE == null) {
|
||||
return;
|
||||
}
|
||||
if(UserChangeRecordStatusEnum.APPROVED.getCode().equals(reviewStatus)){
|
||||
//修改企业入职记录
|
||||
UserCorpRecordDO userCorpRecordDO = userCorpRecordRepository.getInfoByUserId(userDO.getId(), corpinfoId, UserEmploymentFlagEnum.ON.getCode());
|
||||
UserCorpRecordE userCorpRecordE = new UserCorpRecordE();
|
||||
if(userCorpRecordDO!=null){
|
||||
BeanUtils.copyProperties(userCorpRecordDO, userCorpRecordE);
|
||||
userCorpRecordDO.setEmploymentFlag(UserEmploymentFlagEnum.RESIGNATION.getCode());
|
||||
userCorpRecordDO.setUpdateTime(LocalDateTime.now());
|
||||
userCorpRecordRepository.updateById(userCorpRecordDO);
|
||||
userCorpRecordE.executeResignation(userCorpRecordE,userE);
|
||||
userCorpRecordGateway.update(userCorpRecordE);
|
||||
}else{
|
||||
userCorpRecordE.initResignation(userE);
|
||||
userCorpRecordGateway.add(userCorpRecordE);
|
||||
}
|
||||
// 增加用户变更记录
|
||||
UserChangeRecordE userChangeRecordE = new UserChangeRecordE();
|
||||
userChangeRecordE.executeReviewStatus(userE, UserEmploymentFlagEnum.RESIGNATION.getCode());
|
||||
userChangeRecordGateway.add(userChangeRecordE);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void ReviewEntryAudit(UserDO userDO,UserReviewStatusCmd userReviewStatusCmd) {
|
||||
Integer reviewStatus = userReviewStatusCmd.getReviewStatus();
|
||||
//TODO 驳回需要待处理,暂时按照只能通过处理
|
||||
Integer employmentFlag = UserChangeRecordStatusEnum.APPROVED.getCode().equals(reviewStatus)?UserEmploymentFlagEnum.ON.getCode():UserEmploymentFlagEnum.NOT_ON.getCode();
|
||||
UserE userE = null;
|
||||
Long corpinfoId = userReviewStatusCmd.getCorpinfoId() == null ? AuthContext.getTenantId() : userReviewStatusCmd.getCorpinfoId();
|
||||
if (UserFlowFlagEnum.FLOW.getCode().equals(userDO.getFlowFlag())) {
|
||||
userE = userCorpRepository.executeReviewStatus(userDO.getId(), corpinfoId, employmentFlag);
|
||||
} else {
|
||||
userE = new UserE();
|
||||
BeanUtils.copyProperties(userDO, userE);
|
||||
userE.setEmploymentFlag(employmentFlag);
|
||||
userGateway.update(userE);
|
||||
}
|
||||
if (userE == null) {
|
||||
return;
|
||||
}
|
||||
if(UserChangeRecordStatusEnum.APPROVED.getCode().equals(reviewStatus)){
|
||||
//增加企业入职记录
|
||||
//增加用户入职企业. 驳回不增加下边信息
|
||||
CorpInfoDO corpInfoDO = corpInfoRepository.getById(userE.getCorpinfoId());
|
||||
DepartmentDO departmentDO = departmentRepository.getById(userE.getDepartmentId());
|
||||
|
||||
UserCorpRecordE userCorpRecordE = new UserCorpRecordE();
|
||||
BeanUtils.copyProperties(userDO, userCorpRecordE);
|
||||
userCorpRecordE.initAdd(userE,corpInfoDO.getCorpName(),departmentDO.getName());
|
||||
userCorpRecordGateway.add(userCorpRecordE);
|
||||
// 增加用户变更记录
|
||||
UserChangeRecordE userChangeRecordE = new UserChangeRecordE();
|
||||
userChangeRecordE.executeReviewStatus(userE, UserEmploymentFlagEnum.ON.getCode());
|
||||
userChangeRecordGateway.add(userChangeRecordE);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void appUserResignation(AppUserResignationCmd appUserResignationCmd) {
|
||||
//更新状态,添加记录
|
||||
UserDO userDO = userRepository.getInfoById(appUserResignationCmd.getId());
|
||||
if(userDO==null){
|
||||
throw new IllegalArgumentException("用户信息不存在");
|
||||
}
|
||||
UserE userE = null;
|
||||
Long corpinfoId = appUserResignationCmd.getCorpinfoId()==null?AuthContext.getTenantId():appUserResignationCmd.getCorpinfoId();
|
||||
if(UserFlowFlagEnum.FLOW.getCode().equals(userDO.getFlowFlag())){
|
||||
userE=userCorpRepository.executeResignation(userDO.getId(), corpinfoId,UserEmploymentFlagEnum.RESIGNATION_AUDIT.getCode());
|
||||
}else{
|
||||
userE = new UserE();
|
||||
BeanUtils.copyProperties(userDO, userE);
|
||||
userE.setEmploymentFlag(UserEmploymentFlagEnum.RESIGNATION_AUDIT.getCode());
|
||||
userGateway.update(userE);
|
||||
}
|
||||
//插入变更记录
|
||||
UserChangeRecordE userChangeRecordE = new UserChangeRecordE();
|
||||
userChangeRecordE.executeResignation(userE,UserEmploymentFlagEnum.RESIGNATION_AUDIT.getCode(),UserChangeRecordStatusEnum.PENDING.getCode());
|
||||
userChangeRecordGateway.add(userChangeRecordE);
|
||||
//TODO 处理未完成工作
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
package com.zcloud.basic.info.command.convertor;
|
||||
|
||||
import com.zcloud.basic.info.dto.clientobject.UserCorpRecordCO;
|
||||
import com.zcloud.basic.info.persistence.dataobject.UserCorpRecordDO;
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* web-app
|
||||
*
|
||||
* @Author zhaokai
|
||||
* @Date 2025-12-03 10:21:58
|
||||
*/
|
||||
@Mapper(componentModel = "spring")
|
||||
public interface UserCorpRecordCoConvertor {
|
||||
/**
|
||||
* @param userCorpRecordDOs
|
||||
* @return
|
||||
*/
|
||||
List<UserCorpRecordCO> converDOsToCOs(List<UserCorpRecordDO> userCorpRecordDOs);
|
||||
|
||||
UserCorpRecordCO convertDOToCO(UserCorpRecordDO userCorpRecordDO);
|
||||
}
|
||||
|
||||
|
|
@ -220,7 +220,6 @@ public class CorpInfoQueryExe {
|
|||
if (StringUtils.isEmpty(corpInfoDO.getCorpName())
|
||||
|| StringUtils.isEmpty(corpInfoDO.getProvince())
|
||||
|| StringUtils.isEmpty(corpInfoDO.getAddressBusiness())
|
||||
|| corpInfoDO.getScaleType()==null
|
||||
|| StringUtils.isEmpty(corpInfoDO.getLrName())
|
||||
|| StringUtils.isEmpty(corpInfoDO.getContactsPhone())
|
||||
|| corpInfoDO.getCreateDate() == null
|
||||
|
|
|
|||
|
|
@ -1,16 +1,25 @@
|
|||
package com.zcloud.basic.info.command.query;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.alibaba.cola.dto.MultiResponse;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.jjb.saas.framework.auth.utils.AuthContext;
|
||||
import com.zcloud.basic.info.command.convertor.UserChangeRecordCoConvertor;
|
||||
import com.zcloud.basic.info.command.convertor.UserJobHandoverCoConvertor;
|
||||
import com.zcloud.basic.info.domain.enums.UserChangeRecordStatusEnum;
|
||||
import com.zcloud.basic.info.dto.UserChangeRecordInfoQry;
|
||||
import com.zcloud.basic.info.dto.UserChangeRecordPageQry;
|
||||
import com.zcloud.basic.info.dto.UserChangeRecordListQry;
|
||||
import com.zcloud.basic.info.dto.clientobject.UserChangeRecordCO;
|
||||
import com.zcloud.basic.info.persistence.dataobject.UserChangeRecordDO;
|
||||
import com.zcloud.basic.info.persistence.dataobject.UserJobHandoverDO;
|
||||
import com.zcloud.basic.info.persistence.repository.UserChangeRecordRepository;
|
||||
import com.zcloud.basic.info.persistence.repository.UserJobHandoverRepository;
|
||||
import com.zcloud.gbscommon.utils.PageQueryHelper;
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.apache.catalina.User;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
|
||||
|
|
@ -29,6 +38,8 @@ import java.util.Map;
|
|||
public class UserChangeRecordQueryExe {
|
||||
private final UserChangeRecordRepository userChangeRecordRepository;
|
||||
private final UserChangeRecordCoConvertor userChangeRecordCoConvertor;
|
||||
private final UserJobHandoverRepository userJobHandoverRepository;
|
||||
private final UserJobHandoverCoConvertor userJobHandoverCoConvertor;
|
||||
|
||||
/**
|
||||
* 分页
|
||||
|
|
@ -56,5 +67,30 @@ public class UserChangeRecordQueryExe {
|
|||
return SingleResponse.of(co);
|
||||
}
|
||||
|
||||
public UserChangeRecordCO getChangerRecordInfoById(UserChangeRecordInfoQry userChangeRecordInfoQry) {
|
||||
QueryWrapper<UserChangeRecordDO> queryWrapper = new QueryWrapper<>();
|
||||
if(userChangeRecordInfoQry.getCorpinfoId() == null){
|
||||
userChangeRecordInfoQry.setCorpinfoId(AuthContext.getTenantId());
|
||||
}
|
||||
queryWrapper.eq("corpinfo_id_before", userChangeRecordInfoQry.getCorpinfoId());
|
||||
queryWrapper.eq("user_id", userChangeRecordInfoQry.getUserId());
|
||||
queryWrapper.eq("status", UserChangeRecordStatusEnum.PENDING.getCode());
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
queryWrapper.last("limit 1");
|
||||
UserChangeRecordDO userChangeRecordDO = userChangeRecordRepository.getOne(queryWrapper);
|
||||
if(userChangeRecordDO == null){
|
||||
return null;
|
||||
}
|
||||
UserChangeRecordCO co = new UserChangeRecordCO();
|
||||
BeanUtils.copyProperties(userChangeRecordDO, co);
|
||||
|
||||
//组装未完成的工作
|
||||
List<UserJobHandoverDO> userJobHandoverDOList = userJobHandoverRepository.getListByChangerRecordId(co.getUserChangeRecordId());
|
||||
if(CollUtil.isNotEmpty(userJobHandoverDOList))
|
||||
co.setUserJobHandoverCOList(userJobHandoverCoConvertor.converDOsToCOs(userJobHandoverDOList));
|
||||
return co;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,68 @@
|
|||
package com.zcloud.basic.info.command.query;
|
||||
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.zcloud.basic.info.command.convertor.UserCorpRecordCoConvertor;
|
||||
import com.zcloud.basic.info.dto.UserCorpRecordPageQry;
|
||||
import com.zcloud.basic.info.dto.clientobject.UserCO;
|
||||
import com.zcloud.basic.info.dto.clientobject.UserCorpRecordCO;
|
||||
import com.zcloud.basic.info.persistence.dataobject.UserCorpRecordDO;
|
||||
import com.zcloud.basic.info.persistence.dataobject.UserDO;
|
||||
import com.zcloud.basic.info.persistence.repository.UserCorpRecordRepository;
|
||||
import com.zcloud.basic.info.persistence.repository.UserRepository;
|
||||
import com.zcloud.gbscommon.utils.PageQueryHelper;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* web-app
|
||||
*
|
||||
* @Author zhaokai
|
||||
* @Date 2025-12-03 10:21:59
|
||||
*/
|
||||
@Component
|
||||
@AllArgsConstructor
|
||||
public class UserCorpRecordQueryExe {
|
||||
private final UserCorpRecordRepository userCorpRecordRepository;
|
||||
private final UserCorpRecordCoConvertor userCorpRecordCoConvertor;
|
||||
private final UserRepository userRepository;
|
||||
|
||||
/**
|
||||
* 分页
|
||||
*
|
||||
* @param userCorpRecordPageQry
|
||||
* @return
|
||||
*/
|
||||
public PageResponse<UserCorpRecordCO> execute(UserCorpRecordPageQry userCorpRecordPageQry) {
|
||||
Map<String, Object> params = PageQueryHelper.toHashMap(userCorpRecordPageQry);
|
||||
PageResponse<UserCorpRecordDO> pageResponse = userCorpRecordRepository.listPage(params);
|
||||
List<UserCorpRecordCO> examCenterCOS = userCorpRecordCoConvertor.converDOsToCOs(pageResponse.getData());
|
||||
return PageResponse.of(examCenterCOS, pageResponse.getTotalCount(), pageResponse.getPageSize(), pageResponse.getPageIndex());
|
||||
}
|
||||
|
||||
public UserCO getInfoById(Long id) {
|
||||
UserCorpRecordDO userCorpRecordDO = userCorpRecordRepository.getById(id);
|
||||
if (userCorpRecordDO == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
UserCorpRecordCO userCorpRecordCO = userCorpRecordCoConvertor.convertDOToCO(userCorpRecordDO);
|
||||
//补充用户信息
|
||||
Long userId = userCorpRecordDO.getUserId();
|
||||
UserDO userDO = userRepository.getInfoById(userId);
|
||||
UserCO userCO = new UserCO();
|
||||
BeanUtils.copyProperties(userDO, userCO);
|
||||
userCO.setCorpinfoId(userCorpRecordDO.getCorpinfoId());
|
||||
userCO.setCorpinfoName(userCorpRecordDO.getCorpinfoName());
|
||||
userCO.setDepartmentId(userCorpRecordDO.getDepartmentId());
|
||||
userCO.setDepartmentName(userCorpRecordDO.getDepartmentName());
|
||||
userCO.setPostId(userCorpRecordDO.getPostId());
|
||||
userCO.setPostName(userCorpRecordDO.getPostName());
|
||||
return userCO;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -6,10 +6,7 @@ import com.zcloud.basic.info.command.UserChangeRecordAddExe;
|
|||
import com.zcloud.basic.info.command.UserChangeRecordRemoveExe;
|
||||
import com.zcloud.basic.info.command.UserChangeRecordUpdateExe;
|
||||
import com.zcloud.basic.info.command.query.UserChangeRecordQueryExe;
|
||||
import com.zcloud.basic.info.dto.UserChangeRecordAddCmd;
|
||||
import com.zcloud.basic.info.dto.UserChangeRecordPageQry;
|
||||
import com.zcloud.basic.info.dto.UserChangeRecordListQry;
|
||||
import com.zcloud.basic.info.dto.UserChangeRecordUpdateCmd;
|
||||
import com.zcloud.basic.info.dto.*;
|
||||
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
|
|
@ -66,5 +63,10 @@ public class UserChangeRecordServiceImpl implements UserChangeRecordServiceI {
|
|||
public void removeBatch(Long[] ids) {
|
||||
userChangeRecordRemoveExe.execute(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public UserChangeRecordCO getChangerRecordInfoById(UserChangeRecordInfoQry userChangeRecordInfoQry) {
|
||||
return userChangeRecordQueryExe.getChangerRecordInfoById(userChangeRecordInfoQry);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,66 @@
|
|||
package com.zcloud.basic.info.service;
|
||||
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import com.zcloud.basic.info.api.UserCorpRecordServiceI;
|
||||
import com.zcloud.basic.info.command.UserCorpRecordAddExe;
|
||||
import com.zcloud.basic.info.command.UserCorpRecordRemoveExe;
|
||||
import com.zcloud.basic.info.command.UserCorpRecordUpdateExe;
|
||||
import com.zcloud.basic.info.command.query.UserCorpRecordQueryExe;
|
||||
import com.zcloud.basic.info.dto.UserCorpRecordAddCmd;
|
||||
import com.zcloud.basic.info.dto.UserCorpRecordPageQry;
|
||||
import com.zcloud.basic.info.dto.UserCorpRecordUpdateCmd;
|
||||
import com.zcloud.basic.info.dto.clientobject.UserCO;
|
||||
import com.zcloud.basic.info.dto.clientobject.UserCorpRecordCO;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* web-app
|
||||
*
|
||||
* @Author zhaokai
|
||||
* @Date 2025-12-03 10:21:59
|
||||
*/
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class UserCorpRecordServiceImpl implements UserCorpRecordServiceI {
|
||||
private final UserCorpRecordAddExe userCorpRecordAddExe;
|
||||
private final UserCorpRecordUpdateExe userCorpRecordUpdateExe;
|
||||
private final UserCorpRecordRemoveExe userCorpRecordRemoveExe;
|
||||
private final UserCorpRecordQueryExe userCorpRecordQueryExe;
|
||||
|
||||
@Override
|
||||
public PageResponse<UserCorpRecordCO> listPage(UserCorpRecordPageQry qry) {
|
||||
|
||||
return userCorpRecordQueryExe.execute(qry);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SingleResponse add(UserCorpRecordAddCmd cmd) {
|
||||
|
||||
userCorpRecordAddExe.execute(cmd);
|
||||
return SingleResponse.buildSuccess();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void edit(UserCorpRecordUpdateCmd userCorpRecordUpdateCmd) {
|
||||
userCorpRecordUpdateExe.execute(userCorpRecordUpdateCmd);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void remove(Long id) {
|
||||
userCorpRecordRemoveExe.execute(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeBatch(Long[] ids) {
|
||||
userCorpRecordRemoveExe.execute(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public UserCO getInfoById(Long id) {
|
||||
return userCorpRecordQueryExe.getInfoById(id);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -177,5 +177,15 @@ public class UserServiceImpl implements UserServiceI {
|
|||
public void resignation(UserResignationCmd userResignationCmd) {
|
||||
userUpdateExe.executeResignation(userResignationCmd);
|
||||
}
|
||||
@Override
|
||||
public void reviewStatus(UserReviewStatusCmd userReviewStatusCmd) {
|
||||
userUpdateExe.executeReviewStatus(userReviewStatusCmd);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void appUserResignation(AppUserResignationCmd appUserResignationCmd) {
|
||||
userUpdateExe.appUserResignation(appUserResignationCmd);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,7 @@
|
|||
package com.zcloud.basic.info.api;
|
||||
|
||||
import com.alibaba.cola.dto.MultiResponse;
|
||||
import com.zcloud.basic.info.dto.UserChangeRecordAddCmd;
|
||||
import com.zcloud.basic.info.dto.UserChangeRecordPageQry;
|
||||
import com.zcloud.basic.info.dto.UserChangeRecordListQry;
|
||||
import com.zcloud.basic.info.dto.UserChangeRecordUpdateCmd;
|
||||
import com.zcloud.basic.info.dto.*;
|
||||
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
|
|
@ -30,5 +27,7 @@ public interface UserChangeRecordServiceI {
|
|||
void remove(Long id);
|
||||
|
||||
void removeBatch(Long[] ids);
|
||||
|
||||
UserChangeRecordCO getChangerRecordInfoById(UserChangeRecordInfoQry userChangeRecordInfoQry);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,30 @@
|
|||
package com.zcloud.basic.info.api;
|
||||
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import com.zcloud.basic.info.dto.UserCorpRecordAddCmd;
|
||||
import com.zcloud.basic.info.dto.UserCorpRecordPageQry;
|
||||
import com.zcloud.basic.info.dto.UserCorpRecordUpdateCmd;
|
||||
import com.zcloud.basic.info.dto.clientobject.UserCO;
|
||||
import com.zcloud.basic.info.dto.clientobject.UserCorpRecordCO;
|
||||
|
||||
/**
|
||||
* web-client
|
||||
*
|
||||
* @Author zhaokai
|
||||
* @Date 2025-12-03 10:21:59
|
||||
*/
|
||||
public interface UserCorpRecordServiceI {
|
||||
PageResponse<UserCorpRecordCO> listPage(UserCorpRecordPageQry qry);
|
||||
|
||||
SingleResponse<UserCorpRecordCO> add(UserCorpRecordAddCmd cmd);
|
||||
|
||||
void edit(UserCorpRecordUpdateCmd cmd);
|
||||
|
||||
void remove(Long id);
|
||||
|
||||
void removeBatch(Long[] ids);
|
||||
|
||||
UserCO getInfoById(Long id);
|
||||
}
|
||||
|
||||
|
|
@ -69,5 +69,9 @@ public interface UserServiceI {
|
|||
PageResponse<UserXmfCO> listXgf(UserPageQry qry);
|
||||
|
||||
void resignation(UserResignationCmd userResignationCmd);
|
||||
|
||||
void reviewStatus(UserReviewStatusCmd userReviewStatusCmd);
|
||||
|
||||
void appUserResignation(AppUserResignationCmd appUserResignationCmd);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,39 @@
|
|||
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;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* web-client
|
||||
*
|
||||
* @Author zhangyue
|
||||
* @Date 2025-11-04 14:07:38
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class AppUserResignationCmd implements Serializable {
|
||||
|
||||
@ApiModelProperty(value = "用户id", name = "id", required = true)
|
||||
@NotNull(message = "用户id不能为空")
|
||||
private Long id;
|
||||
//企业id
|
||||
@ApiModelProperty(value = "企业id", name = "corpinfoId", required = true)
|
||||
@NotNull(message = "企业id不能为空")
|
||||
private Long corpinfoId;
|
||||
//离职原因
|
||||
@ApiModelProperty(value = "离职原因", name = "resignationReason", required = true)
|
||||
@NotEmpty(message = "离职原因不能为空")
|
||||
private String resignationReason;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -9,6 +9,7 @@ import javax.validation.constraints.NotEmpty;
|
|||
import javax.validation.constraints.NotNull;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -47,8 +48,10 @@ public class CorpInfoPageQry extends PageQuery {
|
|||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private LocalDate leCreateDate;
|
||||
|
||||
@ApiModelProperty(value = "企业类型", name = "eqType")
|
||||
@ApiModelProperty(value = "企业类型,0-普通企业,1-集团单位,2-股份单位,3-相关方企业,4-货主单位,5-驻港单位", name = "eqType")
|
||||
private Integer eqType;
|
||||
@ApiModelProperty(value = "企业类型集合,0-普通企业,1-集团单位,2-股份单位,3-相关方企业,4-货主单位,5-驻港单位", name = "inType")
|
||||
private List<Integer> inType;
|
||||
|
||||
@ApiModelProperty(value = "启用状态", name = "eqUseFlag")
|
||||
private Integer eqUseFlag;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,35 @@
|
|||
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 UserChangeRecordInfoQry implements Serializable {
|
||||
|
||||
/**
|
||||
* 查询条件操作前缀,支持以下几种数据库查询操作:
|
||||
* - `like`: 模糊匹配查询,对应SQL的LIKE操作符
|
||||
* - `eq`: 等值查询,对应SQL的=操作符
|
||||
* - `gt`: 大于比较查询
|
||||
* - `lt`: 小于比较查询
|
||||
* - `ge`: 大于等于比较查询
|
||||
* - `le`: 小于等于比较查询
|
||||
* - `ne`: 不等比较查询,对应SQL的!=操作符
|
||||
*/
|
||||
@ApiModelProperty(value = "企业ID")
|
||||
private Long corpinfoId;
|
||||
@ApiModelProperty(value = "用户ID")
|
||||
private Long userId;
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
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;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* web-client
|
||||
*
|
||||
* @Author zhaokai
|
||||
* @Date 2025-12-03 10:21:58
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class UserCorpRecordAddCmd 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 = "企业名称", name = "corpinfoName", required = true)
|
||||
@NotEmpty(message = "企业名称不能为空")
|
||||
private String corpinfoName;
|
||||
|
||||
@ApiModelProperty(value = "部门id", name = "departmentId", required = true)
|
||||
@NotNull(message = "部门id不能为空")
|
||||
private Long departmentId;
|
||||
|
||||
@ApiModelProperty(value = "部门名称", name = "departmentName", required = true)
|
||||
@NotEmpty(message = "部门名称不能为空")
|
||||
private String departmentName;
|
||||
|
||||
@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 = "审批状态,1-待审批, 2-通过,3-驳回", name = "status", required = true)
|
||||
@NotNull(message = "审批状态,1-待审批, 2-通过,3-驳回不能为空")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "入职状态,1-在职 0-离职, 11-入职待审核, 10-离职待审核", name = "employmentFlag", required = true)
|
||||
@NotNull(message = "入职状态,1-在职 0-离职, 11-入职待审核, 10-离职待审核不能为空")
|
||||
private Integer employmentFlag;
|
||||
|
||||
@ApiModelProperty(value = "开始时间", name = "startTime", required = true)
|
||||
@NotEmpty(message = "开始时间不能为空")
|
||||
private LocalDateTime startTime;
|
||||
|
||||
@ApiModelProperty(value = "结束时间", name = "endTime", required = true)
|
||||
@NotEmpty(message = "结束时间不能为空")
|
||||
private LocalDateTime endTime;
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -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-03 10:21:59
|
||||
*/
|
||||
@Data
|
||||
public class UserCorpRecordPageQry extends PageQuery {
|
||||
|
||||
/**
|
||||
* 查询条件操作前缀,支持以下几种数据库查询操作:
|
||||
* - `like`: 模糊匹配查询,对应SQL的LIKE操作符
|
||||
* - `eq`: 等值查询,对应SQL的=操作符
|
||||
* - `gt`: 大于比较查询
|
||||
* - `lt`: 小于比较查询
|
||||
* - `ge`: 大于等于比较查询
|
||||
* - `le`: 小于等于比较查询
|
||||
* - `ne`: 不等比较查询,对应SQL的!=操作符
|
||||
*/
|
||||
private String likeUserCorpRecordId;
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
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;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* web-client
|
||||
*
|
||||
* @Author zhaokai
|
||||
* @Date 2025-12-03 10:21:59
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class UserCorpRecordUpdateCmd extends Command {
|
||||
@ApiModelProperty(value = "主键id", name = "id", required = true)
|
||||
@NotNull(message = "主键id不能为空")
|
||||
private Long id;
|
||||
@ApiModelProperty(value = "业务主键id", name = "userCorpRecordId", required = true)
|
||||
@NotEmpty(message = "业务主键id不能为空")
|
||||
private String userCorpRecordId;
|
||||
@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 = "企业名称", name = "corpinfoName", required = true)
|
||||
@NotEmpty(message = "企业名称不能为空")
|
||||
private String corpinfoName;
|
||||
@ApiModelProperty(value = "部门id", name = "departmentId", required = true)
|
||||
@NotNull(message = "部门id不能为空")
|
||||
private Long departmentId;
|
||||
@ApiModelProperty(value = "部门名称", name = "departmentName", required = true)
|
||||
@NotEmpty(message = "部门名称不能为空")
|
||||
private String departmentName;
|
||||
@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 = "审批状态,1-待审批, 2-通过,3-驳回", name = "status", required = true)
|
||||
@NotNull(message = "审批状态,1-待审批, 2-通过,3-驳回不能为空")
|
||||
private Integer status;
|
||||
@ApiModelProperty(value = "入职状态,1-在职 0-离职, 11-入职待审核, 10-离职待审核", name = "employmentFlag", required = true)
|
||||
@NotNull(message = "入职状态,1-在职 0-离职, 11-入职待审核, 10-离职待审核不能为空")
|
||||
private Integer employmentFlag;
|
||||
@ApiModelProperty(value = "开始时间", name = "startTime", required = true)
|
||||
@NotEmpty(message = "开始时间不能为空")
|
||||
private LocalDateTime startTime;
|
||||
@ApiModelProperty(value = "结束时间", name = "endTime", required = true)
|
||||
@NotEmpty(message = "结束时间不能为空")
|
||||
private LocalDateTime endTime;
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
package com.zcloud.basic.info.dto;
|
||||
|
||||
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 UserReviewStatusCmd 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;
|
||||
//审核状态
|
||||
@ApiModelProperty(value = "审核状态,2-通过,3-驳回")
|
||||
private Integer reviewStatus;
|
||||
//审核状态
|
||||
@ApiModelProperty(value = "入职状态,1-在职 0-离职, 11-入职待审核, 10-离职待审核")
|
||||
private Integer employmentFlag;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -7,6 +7,7 @@ import lombok.Data;
|
|||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* web-client
|
||||
|
|
@ -76,4 +77,9 @@ public class UserChangeRecordCO extends ClientObject {
|
|||
private Integer userStatusAfter;
|
||||
@ApiModelProperty(value = "离职原因")
|
||||
private String resignationReason;
|
||||
|
||||
@ApiModelProperty(value = "工作交接记录信息")
|
||||
private List<UserJobHandoverCO> userJobHandoverCOList;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,94 @@
|
|||
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-03 10:21:58
|
||||
*/
|
||||
@Data
|
||||
public class UserCorpRecordCO extends ClientObject {
|
||||
//主键id
|
||||
@ApiModelProperty(value = "主键id")
|
||||
private Long id;
|
||||
//业务主键id
|
||||
@ApiModelProperty(value = "业务主键id")
|
||||
private String userCorpRecordId;
|
||||
//用户id
|
||||
@ApiModelProperty(value = "用户id")
|
||||
private Long userId;
|
||||
//企业id
|
||||
@ApiModelProperty(value = "企业id")
|
||||
private Long corpinfoId;
|
||||
//企业名称
|
||||
@ApiModelProperty(value = "企业名称")
|
||||
private String corpinfoName;
|
||||
//部门id
|
||||
@ApiModelProperty(value = "部门id")
|
||||
private Long departmentId;
|
||||
//部门名称
|
||||
@ApiModelProperty(value = "部门名称")
|
||||
private String departmentName;
|
||||
//岗位id
|
||||
@ApiModelProperty(value = "岗位id")
|
||||
private Long postId;
|
||||
//岗位名称
|
||||
@ApiModelProperty(value = "岗位名称")
|
||||
private String postName;
|
||||
//审批状态,1-待审批, 2-通过,3-驳回
|
||||
@ApiModelProperty(value = "审批状态,1-待审批, 2-通过,3-驳回")
|
||||
private Integer status;
|
||||
//入职状态,1-在职 0-离职, 11-入职待审核, 10-离职待审核
|
||||
@ApiModelProperty(value = "入职状态,1-在职 0-离职, 11-入职待审核, 10-离职待审核")
|
||||
private Integer employmentFlag;
|
||||
//开始时间
|
||||
@ApiModelProperty(value = "开始时间")
|
||||
private LocalDateTime startTime;
|
||||
//结束时间
|
||||
@ApiModelProperty(value = "结束时间")
|
||||
private LocalDateTime endTime;
|
||||
//乐观锁
|
||||
@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;
|
||||
}
|
||||
|
||||
|
|
@ -3,7 +3,8 @@ package com.zcloud.basic.info.domain.enums;
|
|||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 入职状态,1-在职 0-离职,, 2-信息变更中, 3-已退休, 11-入职待审核, 10-离职待审核
|
||||
* 入入职状态,0-离职, 1-在职, 2-信息变更中, 3-未入职, 4-实习生, 5-实习结束, 6-退休, 7-劳务派遣, 8-劳务派遣结束, 11-入职待审核, 10-离职待审核',
|
||||
*
|
||||
*/
|
||||
@Getter
|
||||
public enum UserEmploymentFlagEnum {
|
||||
|
|
@ -13,9 +14,10 @@ public enum UserEmploymentFlagEnum {
|
|||
RESIGNATION(0, "离职"),
|
||||
ON(1, "在职"),
|
||||
INFO_CHANGE(2, "信息变更中"),
|
||||
RETIREMENT(3, "已退休"),
|
||||
NOT_ON(3, "未入职"),
|
||||
ENTRY_AUDIT(11, "入职待审核"),
|
||||
RESIGNATION_AUDIT(10, "离职待审核")
|
||||
RESIGNATION_AUDIT(10, "离职待审核"),
|
||||
// REJECT(12, "驳回"),
|
||||
;
|
||||
private final Integer code;
|
||||
private final String desc;
|
||||
|
|
@ -24,4 +26,13 @@ public enum UserEmploymentFlagEnum {
|
|||
this.code = code;
|
||||
this.desc = desc;
|
||||
}
|
||||
//根据code获取枚举值
|
||||
public static UserEmploymentFlagEnum getByCode(Integer code) {
|
||||
for (UserEmploymentFlagEnum item : values()) {
|
||||
if (item.getCode().equals(code)) {
|
||||
return item;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,30 @@
|
|||
package com.zcloud.basic.info.domain.gateway;
|
||||
|
||||
import com.zcloud.basic.info.domain.model.UserCorpRecordE;
|
||||
|
||||
/**
|
||||
* web-domain
|
||||
*
|
||||
* @Author zhaokai
|
||||
* @Date 2025-12-03 10:21:59
|
||||
*/
|
||||
public interface UserCorpRecordGateway {
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
Boolean add(UserCorpRecordE userCorpRecordE);
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
Boolean update(UserCorpRecordE userCorpRecordE);
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
Boolean deletedUserCorpRecordById(Long id);
|
||||
|
||||
Boolean deletedUserCorpRecordByIds(Long[] id);
|
||||
}
|
||||
|
||||
|
|
@ -86,11 +86,15 @@ public class UserChangeRecordE extends BaseE {
|
|||
this.setDepartmentNameAfter(name);
|
||||
this.setPostIdAfter(userE.getPostId());
|
||||
this.setPostNameAfter(userE.getPostName());
|
||||
this.setUserStatusAfter(userE.getEmploymentFlag());
|
||||
this.setUserStatusAfter(oldUserE.getEmploymentFlag());
|
||||
this.setStatus(UserChangeRecordStatusEnum.APPROVED.getCode());
|
||||
}
|
||||
|
||||
public void executeResignation(UserE userE, Integer code) {
|
||||
/**
|
||||
* 离职相关
|
||||
* @param userE
|
||||
* @param code
|
||||
*/
|
||||
public void executeResignation(UserE userE, Integer code, Integer status) {
|
||||
this.setUserId(userE.getId());
|
||||
this.setChangeTime(new Date());
|
||||
this.setCorpinfoIdBefore(userE.getCorpinfoId());
|
||||
|
|
@ -99,13 +103,40 @@ public class UserChangeRecordE extends BaseE {
|
|||
this.setDepartmentNameBefore(userE.getDepartmentName());
|
||||
this.setPostIdBefore(userE.getPostId());
|
||||
this.setPostNameBefore(userE.getPostName());
|
||||
this.setUserStatusBefore(userE.getEmploymentFlag());
|
||||
this.setCorpinfoIdAfter(null);
|
||||
this.setCorpinfoNameAfter(null);
|
||||
this.setDepartmentIdAfter(null);
|
||||
this.setDepartmentNameAfter(null);
|
||||
this.setPostIdAfter(null);
|
||||
this.setPostNameAfter(null);
|
||||
this.setStatus(UserChangeRecordStatusEnum.PENDING.getCode());
|
||||
this.setUserStatusAfter(code);
|
||||
this.setStatus(status);
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核相关
|
||||
* @param userE
|
||||
* @param employmentFlagAfter
|
||||
*/
|
||||
public void executeReviewStatus(UserE userE, Integer employmentFlagAfter) {
|
||||
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.setUserStatusBefore(userE.getEmploymentFlag());
|
||||
this.setCorpinfoIdAfter(null);
|
||||
this.setCorpinfoNameAfter(null);
|
||||
this.setDepartmentIdAfter(null);
|
||||
this.setDepartmentNameAfter(null);
|
||||
this.setPostIdAfter(null);
|
||||
this.setPostNameAfter(null);
|
||||
this.setUserStatusAfter(employmentFlagAfter);
|
||||
this.setStatus(UserChangeRecordStatusEnum.APPROVED.getCode());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,107 @@
|
|||
package com.zcloud.basic.info.domain.model;
|
||||
|
||||
import com.jjb.saas.framework.domain.model.BaseE;
|
||||
import com.zcloud.basic.info.domain.enums.UserChangeRecordStatusEnum;
|
||||
import com.zcloud.basic.info.domain.enums.UserEmploymentFlagEnum;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* web-domain
|
||||
*
|
||||
* @Author zhaokai
|
||||
* @Date 2025-12-03 10:21:58
|
||||
*/
|
||||
@Data
|
||||
public class UserCorpRecordE extends BaseE {
|
||||
//主键id
|
||||
private Long id;
|
||||
//业务主键id
|
||||
private String userCorpRecordId;
|
||||
//用户id
|
||||
private Long userId;
|
||||
//企业id
|
||||
private Long corpinfoId;
|
||||
//企业名称
|
||||
private String corpinfoName;
|
||||
//部门id
|
||||
private Long departmentId;
|
||||
//部门名称
|
||||
private String departmentName;
|
||||
//岗位id
|
||||
private Long postId;
|
||||
//岗位名称
|
||||
private String postName;
|
||||
//审批状态,1-待审批, 2-通过,3-驳回
|
||||
private Integer status;
|
||||
//入职状态,1-在职 0-离职, 11-入职待审核, 10-离职待审核
|
||||
private Integer employmentFlag;
|
||||
//开始时间
|
||||
private LocalDateTime startTime;
|
||||
//结束时间
|
||||
private LocalDateTime endTime;
|
||||
//乐观锁
|
||||
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;
|
||||
|
||||
public void initAdd(UserE userE,String corpName,String departmentName) {
|
||||
this.userId = userE.getId();
|
||||
this.corpinfoId = userE.getCorpinfoId();
|
||||
this.corpinfoName = corpName;
|
||||
this.departmentId = userE.getDepartmentId();
|
||||
this.departmentName = departmentName;
|
||||
this.postId = userE.getPostId();
|
||||
this.postName = userE.getPostName();
|
||||
this.employmentFlag = UserEmploymentFlagEnum.ON.getCode();
|
||||
this.status = UserChangeRecordStatusEnum.APPROVED.getCode();
|
||||
this.startTime = LocalDateTime.now();
|
||||
}
|
||||
|
||||
public void executeResignation(UserCorpRecordE userCorpRecordE, UserE userE) {
|
||||
this.corpinfoName = userCorpRecordE.getCorpinfoName();
|
||||
this.departmentId = userE.getDepartmentId();
|
||||
this.departmentName = userE.getDepartmentName();
|
||||
this.postId = userE.getPostId();
|
||||
this.postName = userE.getPostName();
|
||||
this.employmentFlag = UserEmploymentFlagEnum.RESIGNATION.getCode();
|
||||
this.status = UserChangeRecordStatusEnum.APPROVED.getCode();
|
||||
this.endTime = LocalDateTime.now();
|
||||
}
|
||||
|
||||
public void initResignation(UserE userE) {
|
||||
this.userId = userE.getId();
|
||||
this.corpinfoId = userE.getCorpinfoId();
|
||||
this.corpinfoName = userE.getCorpinfoName();
|
||||
this.departmentId = userE.getDepartmentId();
|
||||
this.departmentName = userE.getDepartmentName();
|
||||
this.postId = userE.getPostId();
|
||||
this.postName = userE.getPostName();
|
||||
this.employmentFlag = UserEmploymentFlagEnum.RESIGNATION.getCode();
|
||||
this.status = UserChangeRecordStatusEnum.APPROVED.getCode();
|
||||
this.startTime = LocalDateTime.now();
|
||||
this.endTime = LocalDateTime.now();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -4,7 +4,9 @@ import com.zcloud.basic.info.domain.gateway.UserChangeRecordGateway;
|
|||
import com.zcloud.basic.info.domain.model.UserChangeRecordE;
|
||||
import com.zcloud.basic.info.persistence.dataobject.UserChangeRecordDO;
|
||||
import com.zcloud.basic.info.persistence.repository.UserChangeRecordRepository;
|
||||
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;
|
||||
|
||||
|
|
@ -23,9 +25,13 @@ public class UserChangeRecordGatewayImpl implements UserChangeRecordGateway {
|
|||
|
||||
@Override
|
||||
public Boolean add(UserChangeRecordE userChangeRecordE) {
|
||||
if(StringUtils.isEmpty(userChangeRecordE.getUserChangeRecordId())){
|
||||
userChangeRecordE.setUserChangeRecordId(Tools.get32UUID());
|
||||
}
|
||||
UserChangeRecordDO d = new UserChangeRecordDO();
|
||||
BeanUtils.copyProperties(userChangeRecordE, d);
|
||||
userChangeRecordRepository.save(d);
|
||||
userChangeRecordE.setId(d.getId());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,60 @@
|
|||
package com.zcloud.basic.info.gatewayimpl;
|
||||
|
||||
import com.jjb.saas.framework.auth.utils.AuthContext;
|
||||
import com.zcloud.basic.info.domain.gateway.UserCorpRecordGateway;
|
||||
import com.zcloud.basic.info.domain.model.UserCorpRecordE;
|
||||
import com.zcloud.basic.info.persistence.dataobject.UserCorpRecordDO;
|
||||
import com.zcloud.basic.info.persistence.repository.UserCorpRecordRepository;
|
||||
import com.zcloud.gbscommon.utils.Tools;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
/**
|
||||
* web-infrastructure
|
||||
*
|
||||
* @Author zhaokai
|
||||
* @Date 2025-12-03 10:21:59
|
||||
*/
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class UserCorpRecordGatewayImpl implements UserCorpRecordGateway {
|
||||
private final UserCorpRecordRepository userCorpRecordRepository;
|
||||
|
||||
@Override
|
||||
public Boolean add(UserCorpRecordE userCorpRecordE) {
|
||||
if(StringUtils.isEmpty(userCorpRecordE.getUserCorpRecordId())){
|
||||
userCorpRecordE.setUserCorpRecordId(Tools.get32UUID());
|
||||
}
|
||||
if(userCorpRecordE.getCorpinfoId() == null){
|
||||
userCorpRecordE.setCorpinfoId(AuthContext.getTenantId());
|
||||
}
|
||||
UserCorpRecordDO d = new UserCorpRecordDO();
|
||||
BeanUtils.copyProperties(userCorpRecordE, d);
|
||||
userCorpRecordRepository.save(d);
|
||||
userCorpRecordE.setId(d.getId());
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean update(UserCorpRecordE userCorpRecordE) {
|
||||
UserCorpRecordDO d = new UserCorpRecordDO();
|
||||
BeanUtils.copyProperties(userCorpRecordE, d);
|
||||
userCorpRecordRepository.updateById(d);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deletedUserCorpRecordById(Long id) {
|
||||
return userCorpRecordRepository.removeById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deletedUserCorpRecordByIds(Long[] ids) {
|
||||
return userCorpRecordRepository.removeByIds(Collections.singletonList(ids));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
package com.zcloud.basic.info.persistence.dataobject;
|
||||
|
||||
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;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* web-infrastructure
|
||||
*
|
||||
* @Author zhaokai
|
||||
* @Date 2025-12-03 10:21:59
|
||||
*/
|
||||
@Data
|
||||
@TableName("user_corp_record")
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class UserCorpRecordDO extends BaseDO {
|
||||
//业务主键id
|
||||
@ApiModelProperty(value = "业务主键id")
|
||||
private String userCorpRecordId;
|
||||
//用户id
|
||||
@ApiModelProperty(value = "用户id")
|
||||
private Long userId;
|
||||
//企业id
|
||||
@ApiModelProperty(value = "企业id")
|
||||
private Long corpinfoId;
|
||||
//企业名称
|
||||
@ApiModelProperty(value = "企业名称")
|
||||
private String corpinfoName;
|
||||
//部门id
|
||||
@ApiModelProperty(value = "部门id")
|
||||
private Long departmentId;
|
||||
//部门名称
|
||||
@ApiModelProperty(value = "部门名称")
|
||||
private String departmentName;
|
||||
//岗位id
|
||||
@ApiModelProperty(value = "岗位id")
|
||||
private Long postId;
|
||||
//岗位名称
|
||||
@ApiModelProperty(value = "岗位名称")
|
||||
private String postName;
|
||||
//审批状态,1-待审批, 2-通过,3-驳回
|
||||
@ApiModelProperty(value = "审批状态,1-待审批, 2-通过,3-驳回")
|
||||
private Integer status;
|
||||
//入职状态,1-在职 0-离职, 11-入职待审核, 10-离职待审核
|
||||
@ApiModelProperty(value = "入职状态,1-在职 0-离职, 11-入职待审核, 10-离职待审核")
|
||||
private Integer employmentFlag;
|
||||
//开始时间
|
||||
@ApiModelProperty(value = "开始时间")
|
||||
private LocalDateTime startTime;
|
||||
//结束时间
|
||||
@ApiModelProperty(value = "结束时间")
|
||||
private LocalDateTime endTime;
|
||||
|
||||
public UserCorpRecordDO(String userCorpRecordId) {
|
||||
this.userCorpRecordId = userCorpRecordId;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
package com.zcloud.basic.info.persistence.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.zcloud.basic.info.persistence.dataobject.UserCorpRecordDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* web-infrastructure
|
||||
*
|
||||
* @Author zhaokai
|
||||
* @Date 2025-12-03 10:21:59
|
||||
*/
|
||||
@Mapper
|
||||
public interface UserCorpRecordMapper extends BaseMapper<UserCorpRecordDO> {
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
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.persistence.dataobject.UserCorpRecordDO;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* web-infrastructure
|
||||
*
|
||||
* @Author zhaokai
|
||||
* @Date 2025-12-03 10:21:59
|
||||
*/
|
||||
public interface UserCorpRecordRepository extends BaseRepository<UserCorpRecordDO> {
|
||||
PageResponse<UserCorpRecordDO> listPage(Map<String, Object> params);
|
||||
|
||||
UserCorpRecordDO getInfoByUserId(Long id, Long corpinfoId, Integer code);
|
||||
}
|
||||
|
||||
|
|
@ -25,5 +25,8 @@ public interface UserCorpRepository extends BaseRepository<UserCorpDO> {
|
|||
|
||||
UserE executeResignation(Long id, Long corpinfoId);
|
||||
|
||||
UserE executeResignation(Long id, Long corpinfoId, Integer employmentFlag);
|
||||
|
||||
UserE executeReviewStatus(Long id, Long corpinfoId, Integer reviewStatus);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -21,5 +21,7 @@ public interface UserJobHandoverRepository extends BaseRepository<UserJobHandove
|
|||
List<UserJobHandoverDO> list(Map<String, Object> params);
|
||||
|
||||
SingleResponse<UserJobHandoverDO> getInfoById(Long id);
|
||||
|
||||
List<UserJobHandoverDO> getListByChangerRecordId(String userChangeRecordId);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,48 @@
|
|||
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.persistence.dataobject.UserCorpRecordDO;
|
||||
import com.zcloud.basic.info.persistence.mapper.UserCorpRecordMapper;
|
||||
import com.zcloud.basic.info.persistence.repository.UserCorpRecordRepository;
|
||||
import com.zcloud.gbscommon.utils.PageQueryHelper;
|
||||
import com.zcloud.gbscommon.utils.Query;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* web-infrastructure
|
||||
*
|
||||
* @Author zhaokai
|
||||
* @Date 2025-12-03 10:21:59
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class UserCorpRecordRepositoryImpl extends BaseRepositoryImpl<UserCorpRecordMapper, UserCorpRecordDO> implements UserCorpRecordRepository {
|
||||
private final UserCorpRecordMapper userCorpRecordMapper;
|
||||
|
||||
@Override
|
||||
public PageResponse<UserCorpRecordDO> listPage(Map<String, Object> params) {
|
||||
IPage<UserCorpRecordDO> iPage = new Query<UserCorpRecordDO>().getPage(params);
|
||||
QueryWrapper<UserCorpRecordDO> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper = PageQueryHelper.createPageQueryWrapper(queryWrapper, params);
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
IPage<UserCorpRecordDO> result = userCorpRecordMapper.selectPage(iPage, queryWrapper);
|
||||
return PageHelper.pageToResponse(result, result.getRecords());
|
||||
}
|
||||
|
||||
@Override
|
||||
public UserCorpRecordDO getInfoByUserId(Long id, Long corpinfoId, Integer code) {
|
||||
QueryWrapper<UserCorpRecordDO> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("user_id", id);
|
||||
queryWrapper.eq("corpinfo_id", corpinfoId);
|
||||
queryWrapper.eq("employment_flag", code);
|
||||
return userCorpRecordMapper.selectOne(queryWrapper);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -63,12 +63,25 @@ public class UserCorpRepositoryImpl extends BaseRepositoryImpl<UserCorpMapper, U
|
|||
}
|
||||
|
||||
@Override
|
||||
public UserE executeResignation(Long id, Long corpinfoId) {
|
||||
public UserE executeResignation(Long id, Long corpinfoId, Integer employmentFlag) {
|
||||
UserCorpDO userCorpDO = getInfoByUserId(id, corpinfoId);
|
||||
if (userCorpDO == null) {
|
||||
return null;
|
||||
}
|
||||
userCorpDO.setEmploymentFlag(UserEmploymentFlagEnum.RESIGNATION.getCode());
|
||||
userCorpDO.setEmploymentFlag(employmentFlag);
|
||||
userCorpMapper.updateById(userCorpDO);
|
||||
UserE userE = new UserE();
|
||||
BeanUtils.copyProperties(userCorpDO, userE);
|
||||
return userE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public UserE executeReviewStatus(Long id, Long corpinfoId, Integer employmentFlag) {
|
||||
UserCorpDO userCorpDO = getInfoByUserId(id, corpinfoId);
|
||||
if (userCorpDO == null) {
|
||||
return null;
|
||||
}
|
||||
userCorpDO.setEmploymentFlag(employmentFlag);
|
||||
userCorpMapper.updateById(userCorpDO);
|
||||
UserE userE = new UserE();
|
||||
BeanUtils.copyProperties(userCorpDO, userE);
|
||||
|
|
|
|||
|
|
@ -51,5 +51,15 @@ public class UserJobHandoverRepositoryImpl extends BaseRepositoryImpl<UserJobHan
|
|||
public SingleResponse<UserJobHandoverDO> getInfoById(Long id) {
|
||||
return SingleResponse.of(userJobHandoverMapper.selectById(id));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<UserJobHandoverDO> getListByChangerRecordId(String userChangeRecordId) {
|
||||
|
||||
QueryWrapper<UserJobHandoverDO> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("user_change_record_id", userChangeRecordId);
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
List<UserJobHandoverDO> result = userJobHandoverMapper.selectList(queryWrapper);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,8 @@
|
|||
<?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.UserCorpRecordMapper">
|
||||
|
||||
</mapper>
|
||||
|
||||
Loading…
Reference in New Issue