相关方入职相关
parent
e269ab1399
commit
008944fb89
|
|
@ -1,60 +0,0 @@
|
||||||
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("修改")
|
|
||||||
@PutMapping("/edit")
|
|
||||||
public SingleResponse edit(@Validated @RequestBody UserCorpUpdateCmd userCorpUpdateCmd) {
|
|
||||||
userCorpService.edit(userCorpUpdateCmd);
|
|
||||||
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.UserExpandInfoServiceI;
|
||||||
|
import com.zcloud.basic.info.dto.UserExpandInfoAddCmd;
|
||||||
|
import com.zcloud.basic.info.dto.UserExpandInfoPageQry;
|
||||||
|
import com.zcloud.basic.info.dto.UserExpandInfoUpdateCmd;
|
||||||
|
import com.zcloud.basic.info.dto.clientobject.UserExpandInfoCO;
|
||||||
|
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 2026-01-05 14:12:18
|
||||||
|
*/
|
||||||
|
@Api(tags = "用户扩展信息表")
|
||||||
|
@RequestMapping("/${application.gateway}/userExpandInfo")
|
||||||
|
@RestController
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class UserExpandInfoController {
|
||||||
|
private final UserExpandInfoServiceI userExpandInfoService;
|
||||||
|
|
||||||
|
@ApiOperation("新增")
|
||||||
|
@PostMapping("/save")
|
||||||
|
public SingleResponse<UserExpandInfoCO> add(@Validated @RequestBody UserExpandInfoAddCmd cmd) {
|
||||||
|
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||||
|
return userExpandInfoService.add(cmd);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("分页")
|
||||||
|
@PostMapping("/list")
|
||||||
|
public PageResponse<UserExpandInfoCO> page(@RequestBody UserExpandInfoPageQry qry) {
|
||||||
|
return userExpandInfoService.listPage(qry);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("所有数据")
|
||||||
|
@GetMapping("/listAll")
|
||||||
|
public MultiResponse<UserExpandInfoCO> listAll() {
|
||||||
|
return MultiResponse.of(new ArrayList<UserExpandInfoCO>());
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("详情")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public SingleResponse<UserExpandInfoCO> getInfoById(@PathVariable("id") Long id) {
|
||||||
|
return SingleResponse.of(new UserExpandInfoCO());
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("删除")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public Response remove(@PathVariable("id") Long id) {
|
||||||
|
userExpandInfoService.remove(id);
|
||||||
|
return SingleResponse.buildSuccess();
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("删除多个")
|
||||||
|
@DeleteMapping("/ids")
|
||||||
|
public Response removeBatch(@RequestParam Long[] ids) {
|
||||||
|
userExpandInfoService.removeBatch(ids);
|
||||||
|
return SingleResponse.buildSuccess();
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("修改")
|
||||||
|
@PutMapping("/edit")
|
||||||
|
public SingleResponse edit(@Validated @RequestBody UserExpandInfoUpdateCmd userExpandInfoUpdateCmd) {
|
||||||
|
userExpandInfoService.edit(userExpandInfoUpdateCmd);
|
||||||
|
return SingleResponse.buildSuccess();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -55,6 +55,7 @@ import java.util.stream.Collectors;
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class UserAddExe {
|
public class UserAddExe {
|
||||||
private final UserGateway userGateway;
|
private final UserGateway userGateway;
|
||||||
|
private final UserExpandInfoGateway userExpandInfoGateway;
|
||||||
private UserCoConvertor userCoConvertor;
|
private UserCoConvertor userCoConvertor;
|
||||||
private final UserEmploymentLogGateway userEmploymentLogGateway;
|
private final UserEmploymentLogGateway userEmploymentLogGateway;
|
||||||
private final CorpInfoRepository corpInfoRepository;
|
private final CorpInfoRepository corpInfoRepository;
|
||||||
|
|
@ -66,8 +67,6 @@ public class UserAddExe {
|
||||||
@DubboReference
|
@DubboReference
|
||||||
private final MessageFacade messageFacade;
|
private final MessageFacade messageFacade;
|
||||||
private final CorpInfoQueryExe corpInfoQueryExe;
|
private final CorpInfoQueryExe corpInfoQueryExe;
|
||||||
private final UserCorpGateway userCorpGateway;
|
|
||||||
private final UserCorpRepository userCorpRepository;
|
|
||||||
private final UserChangeRecordGateway userChangeRecordGateway;
|
private final UserChangeRecordGateway userChangeRecordGateway;
|
||||||
private final UserCorpRecordGateway userCorpRecordGateway;
|
private final UserCorpRecordGateway userCorpRecordGateway;
|
||||||
private ZcloudRedisUtil zcloudRedisUtil;
|
private ZcloudRedisUtil zcloudRedisUtil;
|
||||||
|
|
@ -80,6 +79,7 @@ public class UserAddExe {
|
||||||
// this.sourceCode = sourceCode;
|
// this.sourceCode = sourceCode;
|
||||||
// }
|
// }
|
||||||
private final CodeConfig codeConfig;
|
private final CodeConfig codeConfig;
|
||||||
|
private final UserExpandInfoRepository userExpandInfoRepository;
|
||||||
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public boolean execute(UserAddCmd cmd) {
|
public boolean execute(UserAddCmd cmd) {
|
||||||
|
|
@ -190,20 +190,46 @@ public class UserAddExe {
|
||||||
// 12.29 不校验身份证号
|
// 12.29 不校验身份证号
|
||||||
// userRepository.checkUserIdCard(cmd.getId(),cmd.getUserIdCard());
|
// userRepository.checkUserIdCard(cmd.getId(),cmd.getUserIdCard());
|
||||||
|
|
||||||
if (userDO.getFlowFlag() != null && !userDO.getFlowFlag().equals(cmd.getFlowFlag())) {
|
UserExpandInfoDO userExpandInfoDO = userExpandInfoRepository.getInfoByPhone(userDO.getPhone());
|
||||||
if (UserFlowFlagEnum.FIXED.getCode().equals(cmd.getFlowFlag())) {
|
if (userExpandInfoDO.getFlowFlag() != null && !userExpandInfoDO.getFlowFlag().equals(cmd.getFlowFlag())) {
|
||||||
// 流动转固定
|
// 流动转固定
|
||||||
List<UserDO> listByPhone = userRepository.getListByPhone(userDO.getPhone(), Arrays.asList(UserEmploymentFlagEnum.ON.getCode(), UserEmploymentFlagEnum.ENTRY_AUDIT.getCode(), UserEmploymentFlagEnum.RESIGNATION_AUDIT.getCode()));
|
List<UserDO> listByPhone = userRepository.getListByPhone(userDO.getPhone(), Arrays.asList(UserEmploymentFlagEnum.ON.getCode(), UserEmploymentFlagEnum.ENTRY_AUDIT.getCode(), UserEmploymentFlagEnum.RESIGNATION_AUDIT.getCode()));
|
||||||
|
|
||||||
if (CollUtil.isNotEmpty(listByPhone) && listByPhone.size() > 1) {
|
if (CollUtil.isNotEmpty(listByPhone) ) {
|
||||||
throw new BizException("该用户存在多家未离职信息,不能修改人员流动状态");
|
throw new BizException("存在未离职信息,不能修改人员流动状态");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(AuthContext.getTenantId()==null){
|
||||||
|
//没有企业,可以修改
|
||||||
|
if(userExpandInfoDO == null){
|
||||||
|
//新增
|
||||||
|
UserExpandInfoE userExpandInfoE = new UserExpandInfoE();
|
||||||
|
userExpandInfoE.setUserExpandInfoId(userDO.getId().toString());
|
||||||
|
userExpandInfoE.setPhone(userDO.getPhone());
|
||||||
|
userExpandInfoE.setFlowFlag(cmd.getFlowFlag());
|
||||||
|
userExpandInfoGateway.add(userExpandInfoE);
|
||||||
|
}else{
|
||||||
|
if(cmd.getFlowFlag()!=null && !userExpandInfoDO.getFlowFlag().equals(cmd.getFlowFlag())) {
|
||||||
|
UserExpandInfoE userExpandInfoE = new UserExpandInfoE();
|
||||||
|
userExpandInfoE.setId(userExpandInfoDO.getId());
|
||||||
|
userExpandInfoE.setPhone(userDO.getPhone());
|
||||||
|
userExpandInfoE.setFlowFlag(cmd.getFlowFlag());
|
||||||
|
userExpandInfoGateway.update(userExpandInfoE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}else{
|
||||||
|
if(userExpandInfoDO != null && !userExpandInfoDO.getFlowFlag().equals(cmd.getFlowFlag())){
|
||||||
|
throw new BizException("该用户存在未离职信息,不能修改人员流动状态");
|
||||||
|
}
|
||||||
|
}
|
||||||
userE.setPhone(userDO.getPhone());
|
userE.setPhone(userDO.getPhone());
|
||||||
|
//修改手机号下除flowFlag的其他数据信息
|
||||||
|
userE.setFlowFlag(null);
|
||||||
userGateway.updateByPhone(userE);
|
userGateway.updateByPhone(userE);
|
||||||
|
|
||||||
|
|
||||||
// 底座同步修改姓名和邮箱
|
// 底座同步修改姓名和邮箱
|
||||||
if (StringUtils.isNotEmpty(userDO.getName())) {
|
if (StringUtils.isNotEmpty(userDO.getName())) {
|
||||||
if (!Objects.equals(userDO.getName(), cmd.getName()) || !Objects.equals(userDO.getEmail(), cmd.getEmail())) {
|
if (!Objects.equals(userDO.getName(), cmd.getName()) || !Objects.equals(userDO.getEmail(), cmd.getEmail())) {
|
||||||
|
|
@ -265,7 +291,8 @@ public class UserAddExe {
|
||||||
userGateway.update(userE);
|
userGateway.update(userE);
|
||||||
} else {
|
} else {
|
||||||
// 用户有企业id
|
// 用户有企业id
|
||||||
Integer flowFlag = userDO.getFlowFlag();
|
UserExpandInfoDO userExpandInfoDO = userExpandInfoRepository.getInfoByPhone(userDO.getPhone());
|
||||||
|
Integer flowFlag = userExpandInfoDO.getFlowFlag();
|
||||||
if (UserFlowFlagEnum.FIXED.getCode().equals(flowFlag)) {
|
if (UserFlowFlagEnum.FIXED.getCode().equals(flowFlag)) {
|
||||||
// 固定用户
|
// 固定用户
|
||||||
String username = userDO.getUsername();
|
String username = userDO.getUsername();
|
||||||
|
|
@ -290,6 +317,7 @@ public class UserAddExe {
|
||||||
u.setEmploymentFlag(UserEmploymentFlagEnum.ENTRY_AUDIT.getCode());
|
u.setEmploymentFlag(UserEmploymentFlagEnum.ENTRY_AUDIT.getCode());
|
||||||
BeanUtils.copyProperties(u, userE);
|
BeanUtils.copyProperties(u, userE);
|
||||||
userE.initFormOnboarding(cmd.getCorpinfoId(), cmd.getDepartmentId(), cmd.getPostName(), null);
|
userE.initFormOnboarding(cmd.getCorpinfoId(), cmd.getDepartmentId(), cmd.getPostName(), null);
|
||||||
|
userE.setFlowFlag(flowFlag);
|
||||||
userGateway.update(userE);
|
userGateway.update(userE);
|
||||||
corpFlag = true;
|
corpFlag = true;
|
||||||
break;
|
break;
|
||||||
|
|
@ -309,6 +337,7 @@ public class UserAddExe {
|
||||||
BeanUtils.copyProperties(user, userE);
|
BeanUtils.copyProperties(user, userE);
|
||||||
userE.setId(null);
|
userE.setId(null);
|
||||||
userE.initFormOnboarding(cmd.getCorpinfoId(), cmd.getDepartmentId(), cmd.getPostName(), UuidUtil.get32UUID());
|
userE.initFormOnboarding(cmd.getCorpinfoId(), cmd.getDepartmentId(), cmd.getPostName(), UuidUtil.get32UUID());
|
||||||
|
userE.setFlowFlag(flowFlag);
|
||||||
userRepository.saveOnboardingUser(userE);
|
userRepository.saveOnboardingUser(userE);
|
||||||
} else {
|
} else {
|
||||||
// 没有找到符合条件的用户
|
// 没有找到符合条件的用户
|
||||||
|
|
@ -330,6 +359,7 @@ public class UserAddExe {
|
||||||
// user表状态变为入职待审核
|
// user表状态变为入职待审核
|
||||||
BeanUtils.copyProperties(u, userE);
|
BeanUtils.copyProperties(u, userE);
|
||||||
userE.initFormOnboarding(cmd.getCorpinfoId(), cmd.getDepartmentId(), cmd.getPostName(), null);
|
userE.initFormOnboarding(cmd.getCorpinfoId(), cmd.getDepartmentId(), cmd.getPostName(), null);
|
||||||
|
userE.setFlowFlag(flowFlag);
|
||||||
userGateway.update(userE);
|
userGateway.update(userE);
|
||||||
corpFlag = true;
|
corpFlag = true;
|
||||||
break;
|
break;
|
||||||
|
|
@ -347,6 +377,7 @@ public class UserAddExe {
|
||||||
BeanUtils.copyProperties(user, userE);
|
BeanUtils.copyProperties(user, userE);
|
||||||
userE.setId(null);
|
userE.setId(null);
|
||||||
userE.initFormOnboarding(cmd.getCorpinfoId(), cmd.getDepartmentId(), cmd.getPostName(), UuidUtil.get32UUID());
|
userE.initFormOnboarding(cmd.getCorpinfoId(), cmd.getDepartmentId(), cmd.getPostName(), UuidUtil.get32UUID());
|
||||||
|
userE.setFlowFlag(flowFlag);
|
||||||
userRepository.saveOnboardingUser(userE);
|
userRepository.saveOnboardingUser(userE);
|
||||||
} else {
|
} else {
|
||||||
// 没有找到符合条件的用户
|
// 没有找到符合条件的用户
|
||||||
|
|
@ -437,18 +468,23 @@ public class UserAddExe {
|
||||||
}
|
}
|
||||||
|
|
||||||
//校验手机号
|
//校验手机号
|
||||||
|
|
||||||
List<UserDO> userList = userRepository.getListByPhone(userE.getPhone(), null);
|
List<UserDO> userList = userRepository.getListByPhone(userE.getPhone(), null);
|
||||||
Boolean addFlag = true;
|
Boolean addFlag = true;
|
||||||
UserDO userDOUpdate = null;
|
UserDO userDOUpdate = null;
|
||||||
if (CollUtil.isNotEmpty(userList)) {
|
if (CollUtil.isNotEmpty(userList)) {
|
||||||
if (UserFlowFlagEnum.FIXED.getCode().equals(cmd.getFlowFlag())) {
|
// UserExpandInfoDO userExpandInfoDO = userExpandInfoRepository.getInfoByPhone(userE.getPhone());
|
||||||
|
//获取在职企业信息
|
||||||
userList.forEach(u -> {
|
userList.forEach(u -> {
|
||||||
if (UserEmploymentFlagEnum.ON.getCode().equals(u.getEmploymentFlag())
|
if (UserEmploymentFlagEnum.ON.getCode().equals(u.getEmploymentFlag())
|
||||||
|| UserEmploymentFlagEnum.ENTRY_AUDIT.getCode().equals(u.getEmploymentFlag())
|
|| UserEmploymentFlagEnum.ENTRY_AUDIT.getCode().equals(u.getEmploymentFlag())
|
||||||
|| UserEmploymentFlagEnum.RESIGNATION_AUDIT.getCode().equals(u.getEmploymentFlag())) {
|
|| UserEmploymentFlagEnum.RESIGNATION_AUDIT.getCode().equals(u.getEmploymentFlag())) {
|
||||||
throw new BizException("该固定用户存在未离职信息,无法入职");
|
throw new BizException("该固定用户存在未离职信息,无法添加");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (UserFlowFlagEnum.FIXED.getCode().equals(cmd.getFlowFlag())) {
|
||||||
|
|
||||||
Optional<UserDO> optionalUserDO = userList.stream().filter(u -> AuthContext.getTenantId().equals(u.getCorpinfoId()) || u.getCorpinfoId() == null).findFirst();
|
Optional<UserDO> optionalUserDO = userList.stream().filter(u -> AuthContext.getTenantId().equals(u.getCorpinfoId()) || u.getCorpinfoId() == null).findFirst();
|
||||||
if (optionalUserDO.isPresent()) {
|
if (optionalUserDO.isPresent()) {
|
||||||
addFlag = false;
|
addFlag = false;
|
||||||
|
|
@ -477,10 +513,15 @@ public class UserAddExe {
|
||||||
if (!res) {
|
if (!res) {
|
||||||
throw new BizException("保存失败");
|
throw new BizException("保存失败");
|
||||||
}
|
}
|
||||||
|
//新增userExtandInfo
|
||||||
|
UserExpandInfoE userExpandInfoE = new UserExpandInfoE();
|
||||||
|
BeanUtils.copyProperties(userE, userExpandInfoE);
|
||||||
|
userExpandInfoE.initAdd(userE);
|
||||||
|
userExpandInfoGateway.add(userExpandInfoE);
|
||||||
} else {
|
} else {
|
||||||
userGateway.updateXgf(userE, userDOUpdate.getId());
|
userGateway.updateXgf(userE, userDOUpdate.getId());
|
||||||
|
//修改
|
||||||
|
userExpandInfoRepository.updateByPhone(userE.getPhone(),userE.getFlowFlag());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,34 +0,0 @@
|
||||||
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("修改失败");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
package com.zcloud.basic.info.command;
|
package com.zcloud.basic.info.command;
|
||||||
|
|
||||||
import com.alibaba.cola.exception.BizException;
|
import com.alibaba.cola.exception.BizException;
|
||||||
import com.zcloud.basic.info.domain.gateway.UserCorpGateway;
|
import com.zcloud.basic.info.domain.gateway.UserExpandInfoGateway;
|
||||||
import com.zcloud.basic.info.domain.model.UserCorpE;
|
import com.zcloud.basic.info.domain.model.UserExpandInfoE;
|
||||||
import com.zcloud.basic.info.dto.UserCorpAddCmd;
|
import com.zcloud.basic.info.dto.UserExpandInfoAddCmd;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
@ -14,20 +14,20 @@ import org.springframework.transaction.annotation.Transactional;
|
||||||
* web-app
|
* web-app
|
||||||
*
|
*
|
||||||
* @Author zhaokai
|
* @Author zhaokai
|
||||||
* @Date 2025-12-02 11:13:32
|
* @Date 2026-01-05 14:12:18
|
||||||
*/
|
*/
|
||||||
@Component
|
@Component
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class UserCorpAddExe {
|
public class UserExpandInfoAddExe {
|
||||||
private final UserCorpGateway userCorpGateway;
|
private final UserExpandInfoGateway userExpandInfoGateway;
|
||||||
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public boolean execute(UserCorpAddCmd cmd) {
|
public boolean execute(UserExpandInfoAddCmd cmd) {
|
||||||
UserCorpE userCorpE = new UserCorpE();
|
UserExpandInfoE userExpandInfoE = new UserExpandInfoE();
|
||||||
BeanUtils.copyProperties(cmd, userCorpE);
|
BeanUtils.copyProperties(cmd, userExpandInfoE);
|
||||||
boolean res = false;
|
boolean res = false;
|
||||||
try {
|
try {
|
||||||
res = userCorpGateway.add(userCorpE);
|
res = userExpandInfoGateway.add(userExpandInfoE);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
package com.zcloud.basic.info.command;
|
package com.zcloud.basic.info.command;
|
||||||
|
|
||||||
import com.alibaba.cola.exception.BizException;
|
import com.alibaba.cola.exception.BizException;
|
||||||
import com.zcloud.basic.info.domain.gateway.UserCorpGateway;
|
import com.zcloud.basic.info.domain.gateway.UserExpandInfoGateway;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
@ -11,16 +11,16 @@ import org.springframework.transaction.annotation.Transactional;
|
||||||
* web-app
|
* web-app
|
||||||
*
|
*
|
||||||
* @Author zhaokai
|
* @Author zhaokai
|
||||||
* @Date 2025-12-02 11:13:33
|
* @Date 2026-01-05 14:12:19
|
||||||
*/
|
*/
|
||||||
@Component
|
@Component
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class UserCorpRemoveExe {
|
public class UserExpandInfoRemoveExe {
|
||||||
private final UserCorpGateway userCorpGateway;
|
private final UserExpandInfoGateway userExpandInfoGateway;
|
||||||
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public boolean execute(Long id) {
|
public boolean execute(Long id) {
|
||||||
boolean res = userCorpGateway.deletedUserCorpById(id);
|
boolean res = userExpandInfoGateway.deletedUserExpandInfoById(id);
|
||||||
if (!res) {
|
if (!res) {
|
||||||
throw new BizException("删除失败");
|
throw new BizException("删除失败");
|
||||||
}
|
}
|
||||||
|
|
@ -29,7 +29,7 @@ public class UserCorpRemoveExe {
|
||||||
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public boolean execute(Long[] ids) {
|
public boolean execute(Long[] ids) {
|
||||||
boolean res = userCorpGateway.deletedUserCorpByIds(ids);
|
boolean res = userExpandInfoGateway.deletedUserExpandInfoByIds(ids);
|
||||||
if (!res) {
|
if (!res) {
|
||||||
throw new BizException("删除失败");
|
throw new BizException("删除失败");
|
||||||
}
|
}
|
||||||
|
|
@ -0,0 +1,34 @@
|
||||||
|
package com.zcloud.basic.info.command;
|
||||||
|
|
||||||
|
import com.alibaba.cola.exception.BizException;
|
||||||
|
import com.zcloud.basic.info.domain.gateway.UserExpandInfoGateway;
|
||||||
|
import com.zcloud.basic.info.domain.model.UserExpandInfoE;
|
||||||
|
import com.zcloud.basic.info.dto.UserExpandInfoUpdateCmd;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-app
|
||||||
|
*
|
||||||
|
* @Author zhaokai
|
||||||
|
* @Date 2026-01-05 14:12:19
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class UserExpandInfoUpdateExe {
|
||||||
|
private final UserExpandInfoGateway userExpandInfoGateway;
|
||||||
|
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void execute(UserExpandInfoUpdateCmd userExpandInfoUpdateCmd) {
|
||||||
|
UserExpandInfoE userExpandInfoE = new UserExpandInfoE();
|
||||||
|
BeanUtils.copyProperties(userExpandInfoUpdateCmd, userExpandInfoE);
|
||||||
|
boolean res = userExpandInfoGateway.update(userExpandInfoE);
|
||||||
|
if (!res) {
|
||||||
|
throw new BizException("修改失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -7,28 +7,20 @@ import com.alibaba.cola.exception.BizException;
|
||||||
import com.jjb.saas.system.client.user.facade.UserFacade;
|
import com.jjb.saas.system.client.user.facade.UserFacade;
|
||||||
import com.zcloud.basic.info.constant.RedisConstant;
|
import com.zcloud.basic.info.constant.RedisConstant;
|
||||||
import com.zcloud.basic.info.domain.enums.UserEmploymentFlagEnum;
|
import com.zcloud.basic.info.domain.enums.UserEmploymentFlagEnum;
|
||||||
import com.zcloud.basic.info.domain.enums.UserFlowFlagEnum;
|
|
||||||
import com.zcloud.basic.info.domain.gateway.UserGateway;
|
import com.zcloud.basic.info.domain.gateway.UserGateway;
|
||||||
import com.zcloud.basic.info.dto.AppUserLogOutCmd;
|
import com.zcloud.basic.info.dto.AppUserLogOutCmd;
|
||||||
import com.zcloud.basic.info.persistence.dataobject.UserCorpDO;
|
|
||||||
import com.zcloud.basic.info.persistence.dataobject.UserCorpRecordDO;
|
|
||||||
import com.zcloud.basic.info.persistence.dataobject.UserDO;
|
import com.zcloud.basic.info.persistence.dataobject.UserDO;
|
||||||
import com.zcloud.basic.info.persistence.repository.UserCorpRecordRepository;
|
import com.zcloud.basic.info.persistence.repository.UserCorpRecordRepository;
|
||||||
import com.zcloud.basic.info.persistence.repository.UserCorpRepository;
|
|
||||||
import com.zcloud.basic.info.persistence.repository.UserRepository;
|
import com.zcloud.basic.info.persistence.repository.UserRepository;
|
||||||
import com.zcloud.gbscommon.utils.Const;
|
|
||||||
import com.zcloud.gbscommon.utils.ZcloudRedisUtil;
|
import com.zcloud.gbscommon.utils.ZcloudRedisUtil;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.dubbo.config.annotation.DubboReference;
|
import org.apache.dubbo.config.annotation.DubboReference;
|
||||||
import org.junit.platform.commons.function.Try;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -42,7 +34,6 @@ import java.util.stream.Collectors;
|
||||||
public class UserRemoveExe {
|
public class UserRemoveExe {
|
||||||
private final UserGateway userGateway;
|
private final UserGateway userGateway;
|
||||||
private final UserRepository userRepository;
|
private final UserRepository userRepository;
|
||||||
private final UserCorpRepository userCorpRepository;
|
|
||||||
@DubboReference(check = false)
|
@DubboReference(check = false)
|
||||||
private UserFacade userFacade;
|
private UserFacade userFacade;
|
||||||
// @Autowired
|
// @Autowired
|
||||||
|
|
@ -97,19 +88,7 @@ public class UserRemoveExe {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
public boolean executeCheckOnboarding(AppUserLogOutCmd cmd) {
|
|
||||||
// 校验是否还有入职信息
|
|
||||||
UserDO userDO = userRepository.getInfoById(cmd.getId());
|
|
||||||
if(!UserEmploymentFlagEnum.RESIGNATION.equals(userDO.getEmploymentFlag().toString())){
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
List<UserCorpDO> userCorpDOS = userCorpRepository.listByUserIdAndNoStatus(cmd.getId(), 0);
|
|
||||||
if(CollUtil.isNotEmpty(userCorpDOS)){
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public boolean execute(Long[] ids) {
|
public boolean execute(Long[] ids) {
|
||||||
|
|
|
||||||
|
|
@ -11,14 +11,11 @@ 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.RoleDeptAddCmd;
|
||||||
import com.jjb.saas.system.client.user.request.UserUpdateQuitCmd;
|
import com.jjb.saas.system.client.user.request.UserUpdateQuitCmd;
|
||||||
import com.jjb.saas.system.client.user.response.UserDetailCO;
|
import com.jjb.saas.system.client.user.response.UserDetailCO;
|
||||||
import com.jjb.saas.system.enums.user.UserAuditStatusEnum;
|
|
||||||
import com.zcloud.basic.info.constant.RedisConstant;
|
import com.zcloud.basic.info.constant.RedisConstant;
|
||||||
import com.zcloud.basic.info.command.convertor.UserJobHandoverCoConvertor;
|
|
||||||
import com.zcloud.basic.info.domain.enums.*;
|
import com.zcloud.basic.info.domain.enums.*;
|
||||||
import com.zcloud.basic.info.domain.gateway.*;
|
import com.zcloud.basic.info.domain.gateway.*;
|
||||||
import com.zcloud.basic.info.domain.model.*;
|
import com.zcloud.basic.info.domain.model.*;
|
||||||
import com.zcloud.basic.info.dto.*;
|
import com.zcloud.basic.info.dto.*;
|
||||||
import com.zcloud.basic.info.dto.clientobject.UserJobHandoverCO;
|
|
||||||
import com.zcloud.basic.info.persistence.dataobject.*;
|
import com.zcloud.basic.info.persistence.dataobject.*;
|
||||||
import com.zcloud.basic.info.persistence.repository.*;
|
import com.zcloud.basic.info.persistence.repository.*;
|
||||||
import com.zcloud.gbscommon.utils.Tools;
|
import com.zcloud.gbscommon.utils.Tools;
|
||||||
|
|
@ -28,10 +25,8 @@ import com.zcloud.gbscommon.zcloudhidden.request.HiddenStatisticsListQry;
|
||||||
import com.zcloud.gbscommon.zcloudhidden.request.HiddenUpdateCmd;
|
import com.zcloud.gbscommon.zcloudhidden.request.HiddenUpdateCmd;
|
||||||
import com.zcloud.gbscommon.zcloudhidden.response.HiddenListByUserCO;
|
import com.zcloud.gbscommon.zcloudhidden.response.HiddenListByUserCO;
|
||||||
import com.zcloud.gbscommon.zcloudrisk.facade.ZcloudRiskFacade;
|
import com.zcloud.gbscommon.zcloudrisk.facade.ZcloudRiskFacade;
|
||||||
import com.zcloud.gbscommon.zcloudrisk.request.ListManagerStatusUpdateCmd;
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.catalina.User;
|
|
||||||
import org.apache.dubbo.config.annotation.DubboReference;
|
import org.apache.dubbo.config.annotation.DubboReference;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
@ -59,15 +54,10 @@ public class UserUpdateExe {
|
||||||
private final UserEmploymentLogGateway userEmploymentLogGateway;
|
private final UserEmploymentLogGateway userEmploymentLogGateway;
|
||||||
|
|
||||||
private final CorpInfoRepository corpInfoRepository;
|
private final CorpInfoRepository corpInfoRepository;
|
||||||
private final UserCorpRepository userCorpRepository;
|
|
||||||
private final UserCorpGateway userCorpGateway;
|
|
||||||
private final UserChangeRecordGateway userChangeRecordGateway;
|
private final UserChangeRecordGateway userChangeRecordGateway;
|
||||||
private final DepartmentRepository departmentRepository;
|
|
||||||
private final UserCorpRecordRepository userCorpRecordRepository;
|
private final UserCorpRecordRepository userCorpRecordRepository;
|
||||||
private final UserCorpRecordGateway userCorpRecordGateway;
|
private final UserCorpRecordGateway userCorpRecordGateway;
|
||||||
private final UserJobHandoverRepository userJobHandoverRepository;
|
private final UserJobHandoverRepository userJobHandoverRepository;
|
||||||
private final UserJobHandoverCoConvertor userJobHandoverCoConvertor;
|
|
||||||
private final UserChangeRecordRepository userChangeRecordRepository;
|
|
||||||
@DubboReference
|
@DubboReference
|
||||||
private UserFacade userFacade;
|
private UserFacade userFacade;
|
||||||
private ZcloudRedisUtil zcloudRedisUtil;
|
private ZcloudRedisUtil zcloudRedisUtil;
|
||||||
|
|
|
||||||
|
|
@ -1,24 +0,0 @@
|
||||||
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,24 @@
|
||||||
|
package com.zcloud.basic.info.command.convertor;
|
||||||
|
|
||||||
|
import com.zcloud.basic.info.dto.clientobject.UserExpandInfoCO;
|
||||||
|
import com.zcloud.basic.info.persistence.dataobject.UserExpandInfoDO;
|
||||||
|
import org.mapstruct.Mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-app
|
||||||
|
*
|
||||||
|
* @Author zhaokai
|
||||||
|
* @Date 2026-01-05 14:12:18
|
||||||
|
*/
|
||||||
|
@Mapper(componentModel = "spring")
|
||||||
|
public interface UserExpandInfoCoConvertor {
|
||||||
|
/**
|
||||||
|
* @param userExpandInfoDOs
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<UserExpandInfoCO> converDOsToCOs(List<UserExpandInfoDO> userExpandInfoDOs);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -1,42 +0,0 @@
|
||||||
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());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -9,9 +9,7 @@ import com.zcloud.basic.info.domain.enums.UserChangeRecordStatusEnum;
|
||||||
import com.zcloud.basic.info.dto.UserChangeRecordInfoQry;
|
import com.zcloud.basic.info.dto.UserChangeRecordInfoQry;
|
||||||
import com.zcloud.basic.info.dto.UserCorpRecordPageQry;
|
import com.zcloud.basic.info.dto.UserCorpRecordPageQry;
|
||||||
import com.zcloud.basic.info.dto.clientobject.UserCO;
|
import com.zcloud.basic.info.dto.clientobject.UserCO;
|
||||||
import com.zcloud.basic.info.dto.clientobject.UserChangeRecordCO;
|
|
||||||
import com.zcloud.basic.info.dto.clientobject.UserCorpRecordCO;
|
import com.zcloud.basic.info.dto.clientobject.UserCorpRecordCO;
|
||||||
import com.zcloud.basic.info.persistence.dataobject.UserChangeRecordDO;
|
|
||||||
import com.zcloud.basic.info.persistence.dataobject.UserCorpRecordDO;
|
import com.zcloud.basic.info.persistence.dataobject.UserCorpRecordDO;
|
||||||
import com.zcloud.basic.info.persistence.dataobject.UserDO;
|
import com.zcloud.basic.info.persistence.dataobject.UserDO;
|
||||||
import com.zcloud.basic.info.persistence.dataobject.UserJobHandoverDO;
|
import com.zcloud.basic.info.persistence.dataobject.UserJobHandoverDO;
|
||||||
|
|
@ -84,6 +82,7 @@ public class UserCorpRecordQueryExe {
|
||||||
userCO.setDepartmentName(userCorpRecordDO.getDepartmentName());
|
userCO.setDepartmentName(userCorpRecordDO.getDepartmentName());
|
||||||
userCO.setPostId(userCorpRecordDO.getPostId());
|
userCO.setPostId(userCorpRecordDO.getPostId());
|
||||||
userCO.setPostName(userCorpRecordDO.getPostName());
|
userCO.setPostName(userCorpRecordDO.getPostName());
|
||||||
|
userCO.setFlowFlag(userCorpRecordDO.getFlowFlag());
|
||||||
return userCO;
|
return userCO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,42 @@
|
||||||
|
package com.zcloud.basic.info.command.query;
|
||||||
|
|
||||||
|
import com.alibaba.cola.dto.PageResponse;
|
||||||
|
import com.zcloud.basic.info.command.convertor.UserExpandInfoCoConvertor;
|
||||||
|
import com.zcloud.basic.info.dto.UserExpandInfoPageQry;
|
||||||
|
import com.zcloud.basic.info.dto.clientobject.UserExpandInfoCO;
|
||||||
|
import com.zcloud.basic.info.persistence.dataobject.UserExpandInfoDO;
|
||||||
|
import com.zcloud.basic.info.persistence.repository.UserExpandInfoRepository;
|
||||||
|
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 2026-01-05 14:12:19
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class UserExpandInfoQueryExe {
|
||||||
|
private final UserExpandInfoRepository userExpandInfoRepository;
|
||||||
|
private final UserExpandInfoCoConvertor userExpandInfoCoConvertor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页
|
||||||
|
*
|
||||||
|
* @param userExpandInfoPageQry
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public PageResponse<UserExpandInfoCO> execute(UserExpandInfoPageQry userExpandInfoPageQry) {
|
||||||
|
Map<String, Object> params = PageQueryHelper.toHashMap(userExpandInfoPageQry);
|
||||||
|
PageResponse<UserExpandInfoDO> pageResponse = userExpandInfoRepository.listPage(params);
|
||||||
|
List<UserExpandInfoCO> examCenterCOS = userExpandInfoCoConvertor.converDOsToCOs(pageResponse.getData());
|
||||||
|
return PageResponse.of(examCenterCOS, pageResponse.getTotalCount(), pageResponse.getPageSize(), pageResponse.getPageIndex());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -11,7 +11,6 @@ import com.jjb.saas.framework.auth.model.SSOUser;
|
||||||
import com.jjb.saas.framework.auth.utils.AuthContext;
|
import com.jjb.saas.framework.auth.utils.AuthContext;
|
||||||
import com.jjb.saas.framework.utils.CaptchaUtils;
|
import com.jjb.saas.framework.utils.CaptchaUtils;
|
||||||
import com.jjb.saas.system.client.user.facade.UserFacade;
|
import com.jjb.saas.system.client.user.facade.UserFacade;
|
||||||
import com.jjb.saas.system.client.user.response.UserDetailCO;
|
|
||||||
import com.zcloud.basic.info.command.convertor.CorpInfoCoConvertor;
|
import com.zcloud.basic.info.command.convertor.CorpInfoCoConvertor;
|
||||||
import com.zcloud.basic.info.command.convertor.UserCoConvertor;
|
import com.zcloud.basic.info.command.convertor.UserCoConvertor;
|
||||||
import com.zcloud.basic.info.constant.RedisConstant;
|
import com.zcloud.basic.info.constant.RedisConstant;
|
||||||
|
|
@ -22,8 +21,9 @@ import com.zcloud.basic.info.dto.*;
|
||||||
import com.zcloud.basic.info.dto.clientobject.*;
|
import com.zcloud.basic.info.dto.clientobject.*;
|
||||||
import com.zcloud.basic.info.persistence.dataobject.UserCorpInfoDO;
|
import com.zcloud.basic.info.persistence.dataobject.UserCorpInfoDO;
|
||||||
import com.zcloud.basic.info.persistence.dataobject.UserDO;
|
import com.zcloud.basic.info.persistence.dataobject.UserDO;
|
||||||
|
import com.zcloud.basic.info.persistence.dataobject.UserExpandInfoDO;
|
||||||
import com.zcloud.basic.info.persistence.repository.CorpInfoRepository;
|
import com.zcloud.basic.info.persistence.repository.CorpInfoRepository;
|
||||||
import com.zcloud.basic.info.persistence.repository.UserCorpRepository;
|
import com.zcloud.basic.info.persistence.repository.UserExpandInfoRepository;
|
||||||
import com.zcloud.basic.info.persistence.repository.UserRepository;
|
import com.zcloud.basic.info.persistence.repository.UserRepository;
|
||||||
import com.zcloud.gbscommon.excelEntity.UserExcelExportEntity;
|
import com.zcloud.gbscommon.excelEntity.UserExcelExportEntity;
|
||||||
import com.zcloud.gbscommon.utils.PageQueryHelper;
|
import com.zcloud.gbscommon.utils.PageQueryHelper;
|
||||||
|
|
@ -36,7 +36,6 @@ import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.atomic.AtomicReference;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -52,10 +51,10 @@ public class UserQueryExe {
|
||||||
private final UserRepository userRepository;
|
private final UserRepository userRepository;
|
||||||
private final UserGateway userGateway;
|
private final UserGateway userGateway;
|
||||||
private final UserCoConvertor userCoConvertor;
|
private final UserCoConvertor userCoConvertor;
|
||||||
private final UserCorpRepository userCorpRepository;
|
|
||||||
private final CorpInfoRepository corpInfoRepository;
|
private final CorpInfoRepository corpInfoRepository;
|
||||||
private final CorpInfoCoConvertor corpInfoCoConvertor;
|
private final CorpInfoCoConvertor corpInfoCoConvertor;
|
||||||
private ZcloudRedisUtil zcloudRedisUtil;
|
private ZcloudRedisUtil zcloudRedisUtil;
|
||||||
|
private final UserExpandInfoRepository userExpandInfoRepository;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -102,6 +101,13 @@ public class UserQueryExe {
|
||||||
UserDO userDO = userRepository.getInfoById(id);
|
UserDO userDO = userRepository.getInfoById(id);
|
||||||
UserCO userCO = new UserCO();
|
UserCO userCO = new UserCO();
|
||||||
BeanUtils.copyProperties(userDO, userCO);
|
BeanUtils.copyProperties(userDO, userCO);
|
||||||
|
if(AuthContext.getTenantId()==null){
|
||||||
|
UserExpandInfoDO userExpandInfoDO = userExpandInfoRepository.getInfoByPhone(userDO.getPhone());
|
||||||
|
if(userExpandInfoDO!=null){
|
||||||
|
userCO.setFlowFlag(userExpandInfoDO.getFlowFlag());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return SingleResponse.of(userCO);
|
return SingleResponse.of(userCO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,58 +0,0 @@
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -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.UserExpandInfoServiceI;
|
||||||
|
import com.zcloud.basic.info.command.UserExpandInfoAddExe;
|
||||||
|
import com.zcloud.basic.info.command.UserExpandInfoRemoveExe;
|
||||||
|
import com.zcloud.basic.info.command.UserExpandInfoUpdateExe;
|
||||||
|
import com.zcloud.basic.info.command.query.UserExpandInfoQueryExe;
|
||||||
|
import com.zcloud.basic.info.dto.UserExpandInfoAddCmd;
|
||||||
|
import com.zcloud.basic.info.dto.UserExpandInfoPageQry;
|
||||||
|
import com.zcloud.basic.info.dto.UserExpandInfoUpdateCmd;
|
||||||
|
import com.zcloud.basic.info.dto.clientobject.UserExpandInfoCO;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-app
|
||||||
|
*
|
||||||
|
* @Author zhaokai
|
||||||
|
* @Date 2026-01-05 14:12:19
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class UserExpandInfoServiceImpl implements UserExpandInfoServiceI {
|
||||||
|
private final UserExpandInfoAddExe userExpandInfoAddExe;
|
||||||
|
private final UserExpandInfoUpdateExe userExpandInfoUpdateExe;
|
||||||
|
private final UserExpandInfoRemoveExe userExpandInfoRemoveExe;
|
||||||
|
private final UserExpandInfoQueryExe userExpandInfoQueryExe;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResponse<UserExpandInfoCO> listPage(UserExpandInfoPageQry qry) {
|
||||||
|
|
||||||
|
return userExpandInfoQueryExe.execute(qry);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SingleResponse add(UserExpandInfoAddCmd cmd) {
|
||||||
|
|
||||||
|
userExpandInfoAddExe.execute(cmd);
|
||||||
|
return SingleResponse.buildSuccess();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void edit(UserExpandInfoUpdateCmd userExpandInfoUpdateCmd) {
|
||||||
|
userExpandInfoUpdateExe.execute(userExpandInfoUpdateCmd);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void remove(Long id) {
|
||||||
|
userExpandInfoRemoveExe.execute(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void removeBatch(Long[] ids) {
|
||||||
|
userExpandInfoRemoveExe.execute(ids);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -202,11 +202,6 @@ public class UserServiceImpl implements UserServiceI {
|
||||||
userRemoveExe.executeLogOut(cmd);
|
userRemoveExe.executeLogOut(cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void checkOnboarding(AppUserLogOutCmd cmd) {
|
|
||||||
userRemoveExe.executeCheckOnboarding(cmd);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public UserLoginCO login(UserAppLoginCmd cmd) {
|
public UserLoginCO login(UserAppLoginCmd cmd) {
|
||||||
return userQueryExe.login(cmd);
|
return userQueryExe.login(cmd);
|
||||||
|
|
|
||||||
|
|
@ -1,27 +0,0 @@
|
||||||
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -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.UserExpandInfoAddCmd;
|
||||||
|
import com.zcloud.basic.info.dto.UserExpandInfoPageQry;
|
||||||
|
import com.zcloud.basic.info.dto.UserExpandInfoUpdateCmd;
|
||||||
|
import com.zcloud.basic.info.dto.clientobject.UserExpandInfoCO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-client
|
||||||
|
*
|
||||||
|
* @Author zhaokai
|
||||||
|
* @Date 2026-01-05 14:12:19
|
||||||
|
*/
|
||||||
|
public interface UserExpandInfoServiceI {
|
||||||
|
PageResponse<UserExpandInfoCO> listPage(UserExpandInfoPageQry qry);
|
||||||
|
|
||||||
|
SingleResponse<UserExpandInfoCO> add(UserExpandInfoAddCmd cmd);
|
||||||
|
|
||||||
|
void edit(UserExpandInfoUpdateCmd cmd);
|
||||||
|
|
||||||
|
void remove(Long id);
|
||||||
|
|
||||||
|
void removeBatch(Long[] ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -79,8 +79,6 @@ public interface UserServiceI {
|
||||||
|
|
||||||
void logOut(AppUserLogOutCmd cmd);
|
void logOut(AppUserLogOutCmd cmd);
|
||||||
|
|
||||||
void checkOnboarding(AppUserLogOutCmd cmd);
|
|
||||||
|
|
||||||
UserLoginCO login(UserAppLoginCmd cmd);
|
UserLoginCO login(UserAppLoginCmd cmd);
|
||||||
|
|
||||||
List<UserCorpInfoCO> getUserCorpList(Long id);
|
List<UserCorpInfoCO> getUserCorpList(Long id);
|
||||||
|
|
|
||||||
|
|
@ -1,61 +0,0 @@
|
||||||
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;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,59 +0,0 @@
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,33 @@
|
||||||
|
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 2026-01-05 14:12:18
|
||||||
|
*/
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class UserExpandInfoAddCmd extends Command {
|
||||||
|
@ApiModelProperty(value = "岗位名称", name = "phone", required = true)
|
||||||
|
@NotEmpty(message = "岗位名称不能为空")
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否流动人员,1-流动,0-固定人员", name = "flowFlag", required = true)
|
||||||
|
@NotNull(message = "是否流动人员,1-流动,0-固定人员不能为空")
|
||||||
|
private Integer flowFlag;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -8,10 +8,10 @@ import lombok.Data;
|
||||||
* web-client
|
* web-client
|
||||||
*
|
*
|
||||||
* @Author zhaokai
|
* @Author zhaokai
|
||||||
* @Date 2025-12-02 11:13:33
|
* @Date 2026-01-05 14:12:19
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class UserCorpPageQry extends PageQuery {
|
public class UserExpandInfoPageQry extends PageQuery {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询条件操作前缀,支持以下几种数据库查询操作:
|
* 查询条件操作前缀,支持以下几种数据库查询操作:
|
||||||
|
|
@ -23,6 +23,6 @@ public class UserCorpPageQry extends PageQuery {
|
||||||
* - `le`: 小于等于比较查询
|
* - `le`: 小于等于比较查询
|
||||||
* - `ne`: 不等比较查询,对应SQL的!=操作符
|
* - `ne`: 不等比较查询,对应SQL的!=操作符
|
||||||
*/
|
*/
|
||||||
private String likeUserCorpId;
|
private String likeUserExpandInfoId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,37 @@
|
||||||
|
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 2026-01-05 14:12:19
|
||||||
|
*/
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class UserExpandInfoUpdateCmd extends Command {
|
||||||
|
@ApiModelProperty(value = "主键id", name = "id", required = true)
|
||||||
|
@NotNull(message = "主键id不能为空")
|
||||||
|
private Long id;
|
||||||
|
@ApiModelProperty(value = "业务主键id", name = "userExpandInfoId", required = true)
|
||||||
|
@NotEmpty(message = "业务主键id不能为空")
|
||||||
|
private String userExpandInfoId;
|
||||||
|
@ApiModelProperty(value = "岗位名称", name = "phone", required = true)
|
||||||
|
@NotEmpty(message = "岗位名称不能为空")
|
||||||
|
private String phone;
|
||||||
|
@ApiModelProperty(value = "是否流动人员,1-流动,0-固定人员", name = "flowFlag", required = true)
|
||||||
|
@NotNull(message = "是否流动人员,1-流动,0-固定人员不能为空")
|
||||||
|
private Integer flowFlag;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -11,43 +11,22 @@ import java.time.LocalDateTime;
|
||||||
* web-client
|
* web-client
|
||||||
*
|
*
|
||||||
* @Author zhaokai
|
* @Author zhaokai
|
||||||
* @Date 2025-12-02 11:13:33
|
* @Date 2026-01-05 14:12:18
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class UserCorpCO extends ClientObject {
|
public class UserExpandInfoCO extends ClientObject {
|
||||||
//主键id
|
//主键id
|
||||||
@ApiModelProperty(value = "主键id")
|
@ApiModelProperty(value = "主键id")
|
||||||
private Long id;
|
private Long id;
|
||||||
//业务主键id
|
//业务主键id
|
||||||
@ApiModelProperty(value = "业务主键id")
|
@ApiModelProperty(value = "业务主键id")
|
||||||
private String userCorpId;
|
private String userExpandInfoId;
|
||||||
//用户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 = "岗位名称")
|
@ApiModelProperty(value = "岗位名称")
|
||||||
private String postName;
|
private String phone;
|
||||||
//角色id
|
//是否流动人员,1-流动,0-固定人员
|
||||||
@ApiModelProperty(value = "角色id")
|
@ApiModelProperty(value = "是否流动人员,1-流动,0-固定人员")
|
||||||
private Long roleId;
|
private Integer flowFlag;
|
||||||
//人员在部门中的排序
|
|
||||||
@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 = "乐观锁")
|
@ApiModelProperty(value = "乐观锁")
|
||||||
private Integer version;
|
private Integer version;
|
||||||
|
|
@ -1,30 +0,0 @@
|
||||||
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,30 @@
|
||||||
|
package com.zcloud.basic.info.domain.gateway;
|
||||||
|
|
||||||
|
import com.zcloud.basic.info.domain.model.UserExpandInfoE;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-domain
|
||||||
|
*
|
||||||
|
* @Author zhaokai
|
||||||
|
* @Date 2026-01-05 14:12:18
|
||||||
|
*/
|
||||||
|
public interface UserExpandInfoGateway {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增
|
||||||
|
*/
|
||||||
|
Boolean add(UserExpandInfoE userExpandInfoE);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
*/
|
||||||
|
Boolean update(UserExpandInfoE userExpandInfoE);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*/
|
||||||
|
Boolean deletedUserExpandInfoById(Long id);
|
||||||
|
|
||||||
|
Boolean deletedUserExpandInfoByIds(Long[] id);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -1,89 +0,0 @@
|
||||||
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();
|
|
||||||
this.employmentFlag = userE.getEmploymentFlag();
|
|
||||||
}
|
|
||||||
|
|
||||||
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());
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -33,6 +33,8 @@ public class UserCorpRecordE extends BaseE {
|
||||||
private Long postId;
|
private Long postId;
|
||||||
//岗位名称
|
//岗位名称
|
||||||
private String postName;
|
private String postName;
|
||||||
|
//是否流动人员,1-流动,0-固定人员
|
||||||
|
private Integer flowFlag;
|
||||||
//审批状态,1-待审批, 2-通过,3-驳回
|
//审批状态,1-待审批, 2-通过,3-驳回
|
||||||
private Integer status;
|
private Integer status;
|
||||||
//入职状态,1-在职 0-离职, 11-入职待审核, 10-离职待审核
|
//入职状态,1-在职 0-离职, 11-入职待审核, 10-离职待审核
|
||||||
|
|
@ -78,6 +80,7 @@ public class UserCorpRecordE extends BaseE {
|
||||||
this.employmentFlag = UserEmploymentFlagEnum.ON.getCode();
|
this.employmentFlag = UserEmploymentFlagEnum.ON.getCode();
|
||||||
this.status = UserChangeRecordStatusEnum.APPROVED.getCode();
|
this.status = UserChangeRecordStatusEnum.APPROVED.getCode();
|
||||||
this.startTime = LocalDateTime.now();
|
this.startTime = LocalDateTime.now();
|
||||||
|
this.flowFlag = userE.getFlowFlag();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void initAddFromApp(UserE userE,String corpName,String departmentName) {
|
public void initAddFromApp(UserE userE,String corpName,String departmentName) {
|
||||||
|
|
@ -90,6 +93,7 @@ public class UserCorpRecordE extends BaseE {
|
||||||
this.postName = userE.getPostName();
|
this.postName = userE.getPostName();
|
||||||
this.employmentFlag = UserEmploymentFlagEnum.NOT_ON.getCode();
|
this.employmentFlag = UserEmploymentFlagEnum.NOT_ON.getCode();
|
||||||
this.status = UserChangeRecordStatusEnum.PENDING.getCode();
|
this.status = UserChangeRecordStatusEnum.PENDING.getCode();
|
||||||
|
this.flowFlag = userE.getFlowFlag();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void executeResignation(UserCorpRecordE userCorpRecordE, UserE userE,Integer employmentFlag,Integer status) {
|
public void executeResignation(UserCorpRecordE userCorpRecordE, UserE userE,Integer employmentFlag,Integer status) {
|
||||||
|
|
@ -117,6 +121,7 @@ public class UserCorpRecordE extends BaseE {
|
||||||
this.status = status;
|
this.status = status;
|
||||||
this.startTime = LocalDateTime.now();
|
this.startTime = LocalDateTime.now();
|
||||||
this.endTime = LocalDateTime.now();
|
this.endTime = LocalDateTime.now();
|
||||||
|
this.flowFlag = userE.getFlowFlag();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void executeEntryAudit(UserCorpRecordE userCorpRecordE, UserE userE, Integer employmentFlag, Integer status) {
|
public void executeEntryAudit(UserCorpRecordE userCorpRecordE, UserE userE, Integer employmentFlag, Integer status) {
|
||||||
|
|
|
||||||
|
|
@ -322,15 +322,7 @@ public class UserE extends BaseE {
|
||||||
System.out.println(inputMd5);
|
System.out.println(inputMd5);
|
||||||
}
|
}
|
||||||
|
|
||||||
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());
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean verifyTransferFlow(UserE oldUserE, UserE newUserE) {
|
public boolean verifyTransferFlow(UserE oldUserE, UserE newUserE) {
|
||||||
if (newUserE.getFlowFlag() == null) {
|
if (newUserE.getFlowFlag() == null) {
|
||||||
|
|
@ -365,9 +357,9 @@ public class UserE extends BaseE {
|
||||||
List<UserE> userList = userEList.stream().
|
List<UserE> userList = userEList.stream().
|
||||||
filter(userE -> UserFlowFlagEnum.FIXED.getCode().equals(userE.getFlowFlag()))
|
filter(userE -> UserFlowFlagEnum.FIXED.getCode().equals(userE.getFlowFlag()))
|
||||||
.filter(userE -> !AuthContext.getTenantId().equals(userE.getCorpinfoId()))
|
.filter(userE -> !AuthContext.getTenantId().equals(userE.getCorpinfoId()))
|
||||||
.filter(userE -> UserEmploymentFlagEnum.ON.getCode().equals(userE.getEmploymentFlag()))
|
.filter(userE -> UserEmploymentFlagEnum.ON.getCode().equals(userE.getEmploymentFlag())
|
||||||
.filter(userE -> UserEmploymentFlagEnum.ENTRY_AUDIT.getCode().equals(userE.getEmploymentFlag()))
|
|| UserEmploymentFlagEnum.ENTRY_AUDIT.getCode().equals(userE.getEmploymentFlag())
|
||||||
.filter(userE -> UserEmploymentFlagEnum.RESIGNATION_AUDIT.getCode().equals(userE.getEmploymentFlag()))
|
|| UserEmploymentFlagEnum.RESIGNATION_AUDIT.getCode().equals(userE.getEmploymentFlag()))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
if (CollUtil.isNotEmpty(userList)) {
|
if (CollUtil.isNotEmpty(userList)) {
|
||||||
throw new BizException("当前手机号已在其他企业属于固定人员");
|
throw new BizException("当前手机号已在其他企业属于固定人员");
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,54 @@
|
||||||
|
package com.zcloud.basic.info.domain.model;
|
||||||
|
|
||||||
|
import com.jjb.saas.framework.domain.model.BaseE;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-domain
|
||||||
|
*
|
||||||
|
* @Author zhaokai
|
||||||
|
* @Date 2026-01-05 14:12:18
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class UserExpandInfoE extends BaseE {
|
||||||
|
//主键id
|
||||||
|
private Long id;
|
||||||
|
//业务主键id
|
||||||
|
private String userExpandInfoId;
|
||||||
|
//手机号
|
||||||
|
private String phone;
|
||||||
|
//是否流动人员,1-流动,0-固定人员
|
||||||
|
private Integer flowFlag;
|
||||||
|
//乐观锁
|
||||||
|
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) {
|
||||||
|
this.phone = userE.getPhone();
|
||||||
|
this.flowFlag = userE.getFlowFlag();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -1,57 +0,0 @@
|
||||||
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));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,57 @@
|
||||||
|
package com.zcloud.basic.info.gatewayimpl;
|
||||||
|
|
||||||
|
import com.jjb.saas.framework.auth.utils.AuthContext;
|
||||||
|
import com.zcloud.basic.info.domain.gateway.UserExpandInfoGateway;
|
||||||
|
import com.zcloud.basic.info.domain.model.UserExpandInfoE;
|
||||||
|
import com.zcloud.basic.info.persistence.dataobject.UserExpandInfoDO;
|
||||||
|
import com.zcloud.basic.info.persistence.repository.UserExpandInfoRepository;
|
||||||
|
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 2026-01-05 14:12:19
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class UserExpandInfoGatewayImpl implements UserExpandInfoGateway {
|
||||||
|
private final UserExpandInfoRepository userExpandInfoRepository;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean add(UserExpandInfoE userExpandInfoE) {
|
||||||
|
if(StringUtils.isEmpty(userExpandInfoE.getUserExpandInfoId())){
|
||||||
|
userExpandInfoE.setUserExpandInfoId(Tools.get32UUID());
|
||||||
|
}
|
||||||
|
|
||||||
|
UserExpandInfoDO d = new UserExpandInfoDO();
|
||||||
|
BeanUtils.copyProperties(userExpandInfoE, d);
|
||||||
|
userExpandInfoRepository.save(d);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean update(UserExpandInfoE userExpandInfoE) {
|
||||||
|
UserExpandInfoDO d = new UserExpandInfoDO();
|
||||||
|
BeanUtils.copyProperties(userExpandInfoE, d);
|
||||||
|
userExpandInfoRepository.updateById(d);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean deletedUserExpandInfoById(Long id) {
|
||||||
|
return userExpandInfoRepository.removeById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean deletedUserExpandInfoByIds(Long[] ids) {
|
||||||
|
return userExpandInfoRepository.removeByIds(Collections.singletonList(ids));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -1,66 +0,0 @@
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -45,6 +45,9 @@ public class UserCorpRecordDO extends BaseDO {
|
||||||
//岗位名称
|
//岗位名称
|
||||||
@ApiModelProperty(value = "岗位名称")
|
@ApiModelProperty(value = "岗位名称")
|
||||||
private String postName;
|
private String postName;
|
||||||
|
//是否流动人员,1-流动,0-固定人员
|
||||||
|
@ApiModelProperty(value = "是否流动人员,1-流动,0-固定人员")
|
||||||
|
private Integer flowFlag;
|
||||||
//审批状态,1-待审批, 2-通过,3-驳回
|
//审批状态,1-待审批, 2-通过,3-驳回
|
||||||
@ApiModelProperty(value = "审批状态,1-待审批, 2-通过,3-驳回")
|
@ApiModelProperty(value = "审批状态,1-待审批, 2-通过,3-驳回")
|
||||||
private Integer status;
|
private Integer status;
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,36 @@
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-infrastructure
|
||||||
|
*
|
||||||
|
* @Author zhaokai
|
||||||
|
* @Date 2026-01-05 14:12:18
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("user_expand_info")
|
||||||
|
@NoArgsConstructor
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class UserExpandInfoDO extends BaseDO {
|
||||||
|
//业务主键id
|
||||||
|
@ApiModelProperty(value = "业务主键id")
|
||||||
|
private String userExpandInfoId;
|
||||||
|
//手机号
|
||||||
|
@ApiModelProperty(value = "手机号")
|
||||||
|
private String phone;
|
||||||
|
//是否流动人员,1-流动,0-固定人员
|
||||||
|
@ApiModelProperty(value = "是否流动人员,1-流动,0-固定人员")
|
||||||
|
private Integer flowFlag;
|
||||||
|
|
||||||
|
public UserExpandInfoDO(String userExpandInfoId) {
|
||||||
|
this.userExpandInfoId = userExpandInfoId;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -1,22 +0,0 @@
|
||||||
package com.zcloud.basic.info.persistence.mapper;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import com.zcloud.basic.info.persistence.dataobject.UserCorpDO;
|
|
||||||
import com.zcloud.basic.info.persistence.dataobject.UserCorpInfoDO;
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* web-infrastructure
|
|
||||||
*
|
|
||||||
* @Author zhaokai
|
|
||||||
* @Date 2025-12-02 11:13:33
|
|
||||||
*/
|
|
||||||
@Mapper
|
|
||||||
public interface UserCorpMapper extends BaseMapper<UserCorpDO> {
|
|
||||||
|
|
||||||
UserCorpDO getInfoByUserId(Long userId, Long corpinfoId);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -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.UserExpandInfoDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-infrastructure
|
||||||
|
*
|
||||||
|
* @Author zhaokai
|
||||||
|
* @Date 2026-01-05 14:12:19
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface UserExpandInfoMapper extends BaseMapper<UserExpandInfoDO> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -1,41 +0,0 @@
|
||||||
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 com.zcloud.basic.info.persistence.dataobject.UserCorpInfoDO;
|
|
||||||
|
|
||||||
import javax.validation.constraints.NotNull;
|
|
||||||
import java.util.List;
|
|
||||||
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);
|
|
||||||
|
|
||||||
UserCorpDO getUserCorpInfoByUserId(Long userId);
|
|
||||||
|
|
||||||
List<UserCorpDO> listByUserIdAndCorpIdAndNoStatus(Long userId, Long corpinfoId, List<Integer> statusList);
|
|
||||||
|
|
||||||
List<UserCorpDO> listByUserIdAndCorpIdAndStatus(Long userId, Long corpinfoId, List<Integer> statusList);
|
|
||||||
|
|
||||||
List<UserCorpDO> listByUserIdAndNoStatus(Long userId, Integer status);
|
|
||||||
|
|
||||||
UserE executeResignation(UserCorpDO userCorpDO, Long corpinfoId, Integer employmentFlag);
|
|
||||||
|
|
||||||
UserE executeReviewStatus(Long id, Long corpinfoId, Integer reviewStatus);
|
|
||||||
|
|
||||||
void removeByUserId(Long userId);
|
|
||||||
|
|
||||||
List<UserCorpDO> getONCorpInfo(@NotNull(message = "用户id不能为空") Long id);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
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.UserExpandInfoDO;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-infrastructure
|
||||||
|
*
|
||||||
|
* @Author zhaokai
|
||||||
|
* @Date 2026-01-05 14:12:19
|
||||||
|
*/
|
||||||
|
public interface UserExpandInfoRepository extends BaseRepository<UserExpandInfoDO> {
|
||||||
|
PageResponse<UserExpandInfoDO> listPage(Map<String, Object> params);
|
||||||
|
|
||||||
|
UserExpandInfoDO getInfoByPhone(String phone);
|
||||||
|
|
||||||
|
void updateByPhone(String phone, Integer flowFlag);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -1,123 +0,0 @@
|
||||||
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.dataobject.UserCorpInfoDO;
|
|
||||||
import com.zcloud.basic.info.persistence.dataobject.UserCorpRecordDO;
|
|
||||||
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.Collections;
|
|
||||||
import java.util.List;
|
|
||||||
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 UserCorpDO getUserCorpInfoByUserId(Long userId) {
|
|
||||||
QueryWrapper<UserCorpDO> queryWrapper = new QueryWrapper<>();
|
|
||||||
queryWrapper.eq("user_id", userId);
|
|
||||||
return userCorpMapper.selectOne(queryWrapper);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<UserCorpDO> listByUserIdAndCorpIdAndNoStatus(Long userId, Long corpinfoId, List<Integer> statusList) {
|
|
||||||
QueryWrapper<UserCorpDO> queryWrapper = new QueryWrapper<>();
|
|
||||||
queryWrapper.eq("user_id", userId);
|
|
||||||
queryWrapper.eq("corpinfo_id", corpinfoId);
|
|
||||||
queryWrapper.notIn("employment_flag", statusList);
|
|
||||||
return list(queryWrapper);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<UserCorpDO> listByUserIdAndCorpIdAndStatus(Long userId, Long corpinfoId, List<Integer> statusList) {
|
|
||||||
QueryWrapper<UserCorpDO> queryWrapper = new QueryWrapper<>();
|
|
||||||
queryWrapper.eq("user_id", userId);
|
|
||||||
queryWrapper.eq("corpinfo_id", corpinfoId);
|
|
||||||
queryWrapper.in("employment_flag", statusList);
|
|
||||||
return list(queryWrapper);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<UserCorpDO> listByUserIdAndNoStatus(Long userId, Integer status) {
|
|
||||||
QueryWrapper<UserCorpDO> queryWrapper = new QueryWrapper<>();
|
|
||||||
queryWrapper.eq("user_id", userId);
|
|
||||||
queryWrapper.ne("employment_flag", status);
|
|
||||||
return list(queryWrapper);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public UserE executeResignation(UserCorpDO userCorpDO, Long corpinfoId, Integer employmentFlag) {
|
|
||||||
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);
|
|
||||||
userE.setId(userCorpDO.getUserId());
|
|
||||||
return userE;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void removeByUserId(Long userId) {
|
|
||||||
QueryWrapper<UserCorpDO> queryWrapper = new QueryWrapper<>();
|
|
||||||
queryWrapper.eq("user_id", userId);
|
|
||||||
remove(queryWrapper);
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public List<UserCorpDO> getONCorpInfo(Long id) {
|
|
||||||
QueryWrapper<UserCorpDO> queryWrapper = new QueryWrapper<>();
|
|
||||||
queryWrapper.eq("user_id", id);
|
|
||||||
queryWrapper.in("employment_flag", UserEmploymentFlagEnum.ON.getCode(), UserEmploymentFlagEnum.RESIGNATION_AUDIT.getCode());
|
|
||||||
return userCorpMapper.selectList(queryWrapper);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,69 @@
|
||||||
|
package com.zcloud.basic.info.persistence.repository.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
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.UserExpandInfoDO;
|
||||||
|
import com.zcloud.basic.info.persistence.mapper.UserExpandInfoMapper;
|
||||||
|
import com.zcloud.basic.info.persistence.repository.UserExpandInfoRepository;
|
||||||
|
import com.zcloud.gbscommon.utils.PageQueryHelper;
|
||||||
|
import com.zcloud.gbscommon.utils.Query;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-infrastructure
|
||||||
|
*
|
||||||
|
* @Author zhaokai
|
||||||
|
* @Date 2026-01-05 14:12:19
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class UserExpandInfoRepositoryImpl extends BaseRepositoryImpl<UserExpandInfoMapper, UserExpandInfoDO> implements UserExpandInfoRepository {
|
||||||
|
private final UserExpandInfoMapper userExpandInfoMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResponse<UserExpandInfoDO> listPage(Map<String, Object> params) {
|
||||||
|
IPage<UserExpandInfoDO> iPage = new Query<UserExpandInfoDO>().getPage(params);
|
||||||
|
QueryWrapper<UserExpandInfoDO> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper = PageQueryHelper.createPageQueryWrapper(queryWrapper, params);
|
||||||
|
queryWrapper.orderByDesc("create_time");
|
||||||
|
IPage<UserExpandInfoDO> result = userExpandInfoMapper.selectPage(iPage, queryWrapper);
|
||||||
|
return PageHelper.pageToResponse(result, result.getRecords());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public UserExpandInfoDO getInfoByPhone(String phone) {
|
||||||
|
QueryWrapper<UserExpandInfoDO> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq("phone", phone);
|
||||||
|
List<UserExpandInfoDO> userExpandInfoDOS = userExpandInfoMapper.selectList(queryWrapper);
|
||||||
|
if(CollUtil.isEmpty(userExpandInfoDOS)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return userExpandInfoDOS.get(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateByPhone(String phone, Integer flowFlag) {
|
||||||
|
//查询
|
||||||
|
UserExpandInfoDO userExpandInfoDO = getInfoByPhone(phone);
|
||||||
|
if(userExpandInfoDO == null) {
|
||||||
|
//新增
|
||||||
|
userExpandInfoDO = new UserExpandInfoDO();
|
||||||
|
userExpandInfoDO.setPhone(phone);
|
||||||
|
userExpandInfoDO.setFlowFlag(flowFlag);
|
||||||
|
userExpandInfoMapper.insert(userExpandInfoDO);
|
||||||
|
}else{
|
||||||
|
userExpandInfoDO.setFlowFlag(flowFlag);
|
||||||
|
userExpandInfoMapper.updateById(userExpandInfoDO);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -346,8 +346,6 @@ public class UserRepositoryImpl extends BaseRepositoryImpl<UserMapper, UserDO> i
|
||||||
if (userDO.getSort() == null) {
|
if (userDO.getSort() == null) {
|
||||||
userDO.setSort(9999);
|
userDO.setSort(9999);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
save(userDO);
|
save(userDO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,19 +0,0 @@
|
||||||
<?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>
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
<?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.UserExpandInfoMapper">
|
||||||
|
</mapper>
|
||||||
|
|
||||||
Loading…
Reference in New Issue