Merge remote-tracking branch 'origin/main'

main
dearLin 2025-11-10 09:39:12 +08:00
commit afe539b2f9
28 changed files with 357 additions and 119 deletions

1
.gitignore vendored
View File

@ -36,3 +36,4 @@ build/
.DS_Store
/.idea/
.idea

View File

@ -12,6 +12,7 @@ import com.zcloud.basic.info.api.UserServiceI;
import com.zcloud.basic.info.dto.*;
import com.zcloud.basic.info.dto.clientobject.UserCO;
import com.zcloud.gbscommon.translateaop.TranslateField;
import com.zcloud.gbscommon.utils.Tools;
import com.zcloud.gbscommon.zclouddepartment.response.ZcloudDepartmentInfoCo;
import com.zcloud.gbscommon.zclouduser.response.ZcloudUserCo;
import io.swagger.annotations.Api;
@ -20,9 +21,9 @@ import lombok.AllArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import java.util.*;
import java.util.stream.Collectors;
/**
* web-adapter
@ -108,5 +109,19 @@ public class UserController {
userService.edit(userUpdateCmd);
return SingleResponse.buildSuccess();
}
@ApiOperation("导出用户列表")
@PostMapping("/exportUserTable")
public void exportPointTable(@Validated @RequestBody UserExportQry qry, HttpServletResponse httpServletResponse) {
List<Long> dataIds = Collections.emptyList();
if(qry.getIds() != null && qry.getIds().length > 0){
dataIds = Arrays.stream(qry.getIds())
.filter(Objects::nonNull) // 过滤掉null
.filter(str -> !str.trim().isEmpty()) // 过滤掉空字符串
.map(Long::valueOf)
.collect(Collectors.toList());
}
userService.exportUserTable(httpServletResponse, dataIds, Long.valueOf(qry.getCorpinfoId()));
}
}

View File

@ -27,7 +27,7 @@ import java.util.ArrayList;
* @Author zhangyue
* @Date 2025-11-06 19:15:37
*/
@Api(tags = "用户资质信息")
@Api(tags = "用户履职记录")
@RequestMapping("/${application.gateway}/userEmploymentLog")
@RestController
@AllArgsConstructor

View File

@ -1,6 +1,7 @@
package com.zcloud.basic.info.web;
import com.alibaba.cola.exception.BizException;
import com.zcloud.basic.info.api.UserQualificationInfoServiceI;
import com.zcloud.basic.info.dto.UserQualificationInfoAddCmd;
import com.zcloud.basic.info.dto.UserQualificationInfoPageQry;
@ -16,6 +17,7 @@ import com.jjb.saas.framework.auth.utils.AuthContext;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.apache.commons.lang.StringUtils;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@ -28,7 +30,7 @@ import java.util.Objects;
* @Author SondonYong
* @Date 2025-10-31 09:50:26
*/
@Api(tags = "人员资格证书管理")
@Api(tags = "人员资格证书管理1-特种,2-安全")
@RequestMapping("/${application.gateway}/userQualificationInfo")
@RestController
@AllArgsConstructor
@ -39,13 +41,22 @@ public class UserQualificationInfoController {
@PostMapping("/save")
public SingleResponse<UserQualificationInfoCO> add(@Validated @RequestBody UserQualificationInfoAddCmd cmd) {
SSOUser ssoUser = AuthContext.getCurrentUser();
if(cmd.getQualificationinfoType() == 1
&& (StringUtils.isEmpty(cmd.getOperatingProject()) || StringUtils.isEmpty(cmd.getOperatingProjectName()))){
throw new BizException("操作项目不能为空。");
}
return userQualificationInfoService.add(cmd);
}
@ApiOperation("修改")
@PutMapping("/edit")
public SingleResponse edit(@Validated @RequestBody UserQualificationInfoUpdateCmd userQualificationInfoUpdateCmd) {
userQualificationInfoService.edit(userQualificationInfoUpdateCmd);
public SingleResponse edit(@Validated @RequestBody UserQualificationInfoUpdateCmd cmd) {
if(cmd.getQualificationinfoType() == 1
&& (StringUtils.isEmpty(cmd.getOperatingProject()) || StringUtils.isEmpty(cmd.getOperatingProjectName()))){
throw new BizException("操作项目不能为空。");
}
userQualificationInfoService.edit(cmd);
return SingleResponse.buildSuccess();
}

View File

@ -41,13 +41,13 @@ public class PostRemoveExe {
@Transactional(rollbackFor = Exception.class)
public boolean execute(Long id) {
// 这段代码后续放到user的方法中, 校验是否有人员使用该岗位
// QueryWrapper queryWrapper = new QueryWrapper();
// queryWrapper.eq("post_id", id);
// queryWrapper.eq("delete_enum", "FALSE");
// List userPostList = userRepository.list(queryWrapper);
// if (userPostList != null && userPostList.size() > 0) {
// throw new BizException("岗位有相应人员,请解除相关岗位信息后删除。");
// }
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.eq("post_id", id);
queryWrapper.eq("delete_enum", "FALSE");
List userPostList = userRepository.list(queryWrapper);
if (userPostList != null && userPostList.size() > 0) {
throw new BizException("岗位有相应人员,请解除相关岗位信息后删除。");
}
boolean res = postGateway.deletedPostById(id);
postDepartmentGateway.deletedPostDepartment(id);
@ -65,13 +65,13 @@ public class PostRemoveExe {
throw new BizException("岗位ID不能为空");
}
// 这段代码后续放到user的方法中, 校验是否有人员使用该岗位
// QueryWrapper<UserDO> queryWrapper = new QueryWrapper();
// queryWrapper.in("post_id", ids);
// queryWrapper.eq("delete_enum", "FALSE");
// List<UserDO> userPostList = userRepository.list(queryWrapper);
// if (userPostList != null && userPostList.size() > 0) {
// throw new BizException("岗位有相应人员,请解除相关岗位信息后删除。");
// }
QueryWrapper<UserDO> queryWrapper = new QueryWrapper();
queryWrapper.in("post_id", ids);
queryWrapper.eq("delete_enum", "FALSE");
List<UserDO> userPostList = userRepository.list(queryWrapper);
if (userPostList != null && userPostList.size() > 0) {
throw new BizException("岗位有相应人员,请解除相关岗位信息后删除。");
}
boolean res = postGateway.deletedPostByIds(ids);
postDepartmentGateway.deletedPostDepartment(ids);

View File

@ -3,17 +3,17 @@ package com.zcloud.basic.info.command;
import com.alibaba.cola.exception.BizException;
import com.jjb.saas.framework.auth.model.SSOUser;
import com.jjb.saas.framework.auth.utils.AuthContext;
import com.jjb.saas.system.client.role.facade.RoleFacade;
import com.jjb.saas.system.client.user.facade.UserFacade;
import com.jjb.saas.system.client.user.request.FacadeUserAddCmd;
import com.zcloud.basic.info.command.convertor.UserCoConvertor;
import com.zcloud.basic.info.domain.gateway.CorpInfoGateway;
import com.zcloud.basic.info.domain.gateway.UserEmploymentLogGateway;
import com.zcloud.basic.info.domain.gateway.UserGateway;
import com.zcloud.basic.info.domain.model.UserE;
import com.zcloud.basic.info.domain.model.UserEmploymentLogE;
import com.zcloud.basic.info.dto.UserAddCmd;
import com.zcloud.basic.info.dto.UserXgfAddCmd;
import com.zcloud.basic.info.persistence.dataobject.CorpInfoDO;
import com.zcloud.basic.info.persistence.dataobject.UserEmploymentLogDO;
import com.zcloud.basic.info.persistence.repository.CorpInfoRepository;
import com.zcloud.gbscommon.utils.Tools;
import lombok.AllArgsConstructor;
import org.apache.dubbo.config.annotation.DubboReference;
@ -22,8 +22,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils;
/**
@ -37,12 +36,13 @@ public class UserAddExe {
private final UserGateway userGateway;
private UserCoConvertor userCoConvertor;
private final UserEmploymentLogGateway userEmploymentLogGateway;
private final CorpInfoRepository corpInfoRepository;
// @Autowired
// private RedisTemplate<String, Object> redisTemplate;
@DubboReference(check = false)
private UserFacade userFacade;
@DubboReference
private RoleFacade roleFacade;
// @DubboReference(check = false)
// private UserFacade userFacade;
// @DubboReference
// private RoleFacade roleFacade;
@Transactional(rollbackFor = Exception.class)
public boolean execute(UserAddCmd cmd) {
@ -51,17 +51,18 @@ public class UserAddExe {
UserE userE = new UserE();
BeanUtils.copyProperties(cmd, userE);
userE.initAdd(tenantId, userE);
CorpInfoDO corpInfoDO = corpInfoRepository.getById(userE.getCorpinfoId());
String corpName = null;
UserEmploymentLogE userEmploymentLogE = new UserEmploymentLogE();
BeanUtils.copyProperties(userE, userEmploymentLogE);
userEmploymentLogE.initAdd(userEmploymentLogE);
boolean res = false;
try {
res = userGateway.add(userE);
if(corpInfoDO != null && !ObjectUtils.isEmpty(corpInfoDO.getCorpName())){
corpName = corpInfoDO.getCorpName();
}
userEmploymentLogE.initAdd(userEmploymentLogE, corpName, userE.getId());
userEmploymentLogGateway.add(userEmploymentLogE);
// FacadeUserAddCmd facadeUserAddCmd = new FacadeUserAddCmd();
// facadeUserAddCmd.setAccount(userE.getUsername());
// FacadeUserAddCmd facadeUserAddCmd = userCoConvertor.converEToFacadeUserAddCmd(userE);
// userFacade.addUser(facadeUserAddCmd);
} catch (Exception e) {
throw new RuntimeException(e);
}
@ -77,14 +78,18 @@ public class UserAddExe {
UserE userE = new UserE();
BeanUtils.copyProperties(cmd, userE);
userE.initAdd(tenantId, userE);
CorpInfoDO corpInfoDO = corpInfoRepository.getById(userE.getCorpinfoId());
String corpName = null;
UserEmploymentLogE userEmploymentLogE = new UserEmploymentLogE();
BeanUtils.copyProperties(userE, userEmploymentLogE);
boolean res = false;
try {
res = userGateway.add(userE);
// FacadeUserAddCmd facadeUserAddCmd = new FacadeUserAddCmd();
// facadeUserAddCmd.setAccount(userE.getUsername());
// FacadeUserAddCmd facadeUserAddCmd = userCoConvertor.converEToFacadeUserAddCmd(userE);
// userFacade.addUser(facadeUserAddCmd);
if(corpInfoDO != null && !ObjectUtils.isEmpty(corpInfoDO.getCorpName())){
corpName = corpInfoDO.getCorpName();
}
userEmploymentLogE.initAdd(userEmploymentLogE, corpName, userE.getId());
userEmploymentLogGateway.add(userEmploymentLogE);
} catch (Exception e) {
throw new RuntimeException(e);
}

View File

@ -1,9 +1,15 @@
package com.zcloud.basic.info.command;
import com.alibaba.cola.exception.BizException;
import com.zcloud.basic.info.domain.gateway.UserEmploymentLogGateway;
import com.zcloud.basic.info.domain.gateway.UserGateway;
import com.zcloud.basic.info.domain.model.UserE;
import com.zcloud.basic.info.domain.model.UserEmploymentLogE;
import com.zcloud.basic.info.dto.UserUpdateCmd;
import com.zcloud.basic.info.persistence.dataobject.CorpInfoDO;
import com.zcloud.basic.info.persistence.dataobject.UserDO;
import com.zcloud.basic.info.persistence.repository.CorpInfoRepository;
import com.zcloud.basic.info.persistence.repository.UserRepository;
import com.zcloud.gbscommon.utils.Const;
import com.zcloud.gbscommon.utils.ZcloudRedisUtil;
import lombok.AllArgsConstructor;
@ -11,8 +17,7 @@ import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils;
/**
@ -24,6 +29,12 @@ import org.springframework.transaction.annotation.Transactional;
@AllArgsConstructor
public class UserUpdateExe {
private final UserGateway userGateway;
private final UserRepository userRepository;
private final UserEmploymentLogGateway userEmploymentLogGateway;
private final CorpInfoRepository corpInfoRepository;
@Autowired
private ZcloudRedisUtil zcloudRedisUtil;
@ -31,7 +42,28 @@ public class UserUpdateExe {
public void execute(UserUpdateCmd userUpdateCmd) {
UserE userE = new UserE();
BeanUtils.copyProperties(userUpdateCmd, userE);
boolean res = userGateway.update(userE);
UserDO userDO = userRepository.getInfoById(userUpdateCmd.getId());
UserE oldUserE = new UserE();
BeanUtils.copyProperties(userDO, oldUserE);
boolean transferPositionFlag = userE.verifyTransferPosition(oldUserE, userE);
String corpName = null;
boolean res = false;
try {
res = userGateway.update(userE);
if (transferPositionFlag) {
UserEmploymentLogE userEmploymentLogE = new UserEmploymentLogE();
CorpInfoDO corpInfoDO = corpInfoRepository.getById(userE.getCorpinfoId());
if(corpInfoDO != null && !ObjectUtils.isEmpty(corpInfoDO.getCorpName())){
corpName = corpInfoDO.getCorpName();
}
userEmploymentLogE.initAdd(userEmploymentLogE, corpName, userE.getId());
userEmploymentLogGateway.add(userEmploymentLogE);
}
} catch (Exception e) {
throw new RuntimeException(e);
}
if (!res) {
throw new BizException("修改失败");
}

View File

@ -4,6 +4,7 @@ import com.jjb.saas.system.client.user.request.FacadeUserAddCmd;
import com.zcloud.basic.info.domain.model.UserE;
import com.zcloud.basic.info.dto.clientobject.UserCO;
import com.zcloud.basic.info.persistence.dataobject.UserDO;
import com.zcloud.gbscommon.excelEntity.UserExcelExportEntity;
import com.zcloud.gbscommon.zclouduser.response.ZcloudUserCo;
import org.mapstruct.Mapper;
@ -23,6 +24,7 @@ public interface UserCoConvertor {
* @return
*/
List<UserCO> converDOsToCOs(List<UserDO> userDOs);
List<UserExcelExportEntity> converDOsToExcelEntitys(List<UserDO> userDOs);
UserCO converDOToCO(UserDO userDO);
FacadeUserAddCmd converEToFacadeUserAddCmd(UserE userE);

View File

@ -2,28 +2,27 @@ package com.zcloud.basic.info.command.query;
import com.alibaba.cola.dto.MultiResponse;
import com.alibaba.cola.dto.PageResponse;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.alibaba.cola.dto.Response;
import com.alibaba.cola.dto.SingleResponse;
import com.jjb.saas.system.client.role.facade.RoleFacade;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.zcloud.basic.info.command.convertor.UserCoConvertor;
import com.zcloud.basic.info.domain.gateway.UserGateway;
import com.zcloud.basic.info.domain.model.UserE;
import com.zcloud.basic.info.dto.UserPageQry;
import com.zcloud.basic.info.dto.UserQryCmd;
import com.zcloud.basic.info.dto.UserVerifyQryCmd;
import com.zcloud.basic.info.dto.clientobject.ImgFilesCO;
import com.zcloud.basic.info.dto.clientobject.UserCO;
import com.zcloud.basic.info.persistence.dataobject.ImgFilesDO;
import com.zcloud.basic.info.persistence.dataobject.UserDO;
import com.zcloud.basic.info.persistence.repository.UserRepository;
import com.zcloud.gbscommon.excelEntity.UserExcelExportEntity;
import com.zcloud.gbscommon.utils.PageQueryHelper;
import lombok.AllArgsConstructor;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -40,7 +39,6 @@ public class UserQueryExe {
private final UserRepository userRepository;
private final UserGateway userGateway;
private final UserCoConvertor userCoConvertor;
private final RoleFacade roleFacade;
/**
*
@ -114,5 +112,20 @@ public class UserQueryExe {
UserDO byId = userRepository.getById(aLong);
return userCoConvertor.converDOToCO(byId);
}
/**
*
*/
public void exportUserTable(HttpServletResponse httpServletResponse, List<Long> dataIds, Long corpinfoId) {
Map<String, Object> params = new HashMap<>();
params.put("corpinfoId", corpinfoId);
if(dataIds != null && !dataIds.isEmpty()) {
params.put("userIdList", dataIds);
}
List<UserDO> userDOList = userRepository.listAll(params);
List<UserExcelExportEntity> userExcelExportEntities = userCoConvertor.converDOsToExcelEntitys(userDOList);
UserE userE = new UserE();
userE.exportUserTable(httpServletResponse, userExcelExportEntities);
}
}

View File

@ -14,6 +14,7 @@ import com.zcloud.basic.info.dto.clientobject.UserCO;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletResponse;
import java.util.Collection;
import java.util.List;
@ -56,6 +57,11 @@ public class UserServiceImpl implements UserServiceI {
userUpdateExe.execute(userUpdateCmd);
}
@Override
public void exportUserTable(HttpServletResponse httpServletResponse, List<Long> dataIds, Long corpinfoId) {
userQueryExe.exportUserTable(httpServletResponse, dataIds, corpinfoId);
}
@Override
public void remove(Long id) {
userRemoveExe.execute(id);

View File

@ -8,6 +8,7 @@ import com.alibaba.cola.dto.SingleResponse;
import com.zcloud.basic.info.dto.*;
import com.zcloud.basic.info.dto.clientobject.UserCO;
import javax.servlet.http.HttpServletResponse;
import java.util.Collection;
import java.util.List;
@ -25,6 +26,8 @@ public interface UserServiceI {
void edit(UserUpdateCmd cmd);
void exportUserTable(HttpServletResponse httpServletResponse, List<Long> dataIds, Long corpinfoId);
void remove(Long id);
void removeBatch(Long[] ids);

View File

@ -120,5 +120,12 @@ public class UserAddCmd extends Command {
@ApiModelProperty(value = "政治面貌名称", name = "politicalAffiliationName")
private String politicalAffiliationName;
@ApiModelProperty(value = "企业名称")
private String corpinfoName;
@ApiModelProperty(value = "部门名称")
private String departmentName;
@ApiModelProperty(value = "岗位名称")
private String postName;
}

View File

@ -13,6 +13,6 @@ import lombok.Data;
@Data
public class UserEmploymentLogQryCmd{
private String likeUserEmploymentLogId;
private Long eqUserId;
}

View File

@ -0,0 +1,37 @@
package com.zcloud.basic.info.dto;
import com.alibaba.cola.dto.PageQuery;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotEmpty;
/**
* web-client
*
* @Author zhangyue
* @Date 2025-11-04 14:07:36
*/
@Data
public class UserExportQry extends PageQuery {
/**
* ,
* - `like`: SQLLIKE
* - `eq`: SQL=
* - `gt`:
* - `lt`:
* - `ge`:
* - `le`:
* - `ne`: SQL!=
*/
@ApiModelProperty(value = "人员id列表", name = "ids")
private String[] ids;
@ApiModelProperty(value = "企业id", name = "corpinfoId", required = true)
@NotEmpty(message = "企业id不能为空")
private String corpinfoId;
}

View File

@ -1,15 +1,12 @@
package com.zcloud.basic.info.dto;
import com.alibaba.cola.dto.Command;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import javax.validation.constraints.*;
import java.time.LocalDate;
import java.util.Date;
/**
* web-client
@ -37,19 +34,28 @@ public class UserQualificationInfoAddCmd extends Command {
@NotEmpty(message = "资质名称不能为空")
private String qualificationName;
@ApiModelProperty(value = "人员资质证书有效期-开始时间", name = "startValidityTime", required = true)
@NotNull(message = "人员资质证书有效期开始时间不能为空")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date startValidityTime;
@ApiModelProperty(value = "人员资质证书有效期-结束时间", name = "endValidityTime", required = true)
@NotNull(message = "人员资质证书有效期结束时间不能为空")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date endValidityTime;
@ApiModelProperty(value = "证书编号", name = "certificateNo", required = true)
@NotEmpty(message = "证书编号不能为空")
private String certificateNo;
@ApiModelProperty(value = "资质类型,1-特种作业证书,2-安全人员证书", name = "qualificationinfoType", required = true)
@NotNull(message = "资质类型不能为空")
private Integer qualificationinfoType;
// 证书作业类别-字典编码
@ApiModelProperty(value = "证书作业类别-字典编码", name = "qualificationinfoCategory", required = true)
@NotEmpty(message = "证书作业类别不能为空")
private String qualificationinfoCategory;
// 证书作业类别名称
@ApiModelProperty(value = "证书作业类别名称", name = "qualificationinfoCategoryName", required = true)
@NotEmpty(message = "证书作业类别不能为空")
private String qualificationinfoCategoryName;
// 操作项目-字典编码(特种有,安全没有)
@ApiModelProperty(value = "操作项目-字典编码(特种有,安全没有)", name = "operatingProject")
private String operatingProject;
// 操作项目名称(特种有,安全没有)
@ApiModelProperty(value = "操作项目名称(特种有,安全没有)", name = "operatingProjectName")
private String operatingProjectName;
}

View File

@ -6,6 +6,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.Date;
@ -36,15 +37,12 @@ public class UserQualificationInfoPageQry extends PageQuery {
private String userIdString;
private Long eqUserId;
@ApiModelProperty(value = "证书名称编号模糊查询", name = "keyWords")
private String keyWords;
@ApiModelProperty(value = "资质类型,1-特种作业证书,2-安全人员证书", name = "eqQualificationinfoType", required = true)
@NotNull(message = "资质类型不能为空")
private Integer eqQualificationinfoType;
@ApiModelProperty(value = "结束时间", name = "geEndValidityTime")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date geEndValidityTime;
@ApiModelProperty(value = "证书类型(字典编码)", name = "eqQualificationinfoCategory")
private String eqQualificationinfoCategory;
@ApiModelProperty(value = "开始时间", name = "leStartValidityTime")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date leStartValidityTime;
}

View File

@ -39,18 +39,27 @@ public class UserQualificationInfoUpdateCmd extends Command {
@NotEmpty(message = "资质名称不能为空")
private String qualificationName;
@ApiModelProperty(value = "人员资质证书有效期开始时间", name = "startValidityTime", required = true)
@NotNull(message = "人员资质证书有效期开始时间不能为空")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date startValidityTime;
@ApiModelProperty(value = "人员资质证书有效期结束时间", name = "endValidityTime", required = true)
@NotNull(message = "人员资质证书有效期结束时间不能为空")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date endValidityTime;
@ApiModelProperty(value = "证书编号", name = "certificateNo", required = true)
@NotEmpty(message = "证书编号不能为空")
private String certificateNo;
@ApiModelProperty(value = "资质类型,1-特种作业证书,2-安全人员证书", name = "qualificationinfoType", required = true)
@NotNull(message = "资质类型不能为空")
private Integer qualificationinfoType;
// 证书作业类别-字典编码
@ApiModelProperty(value = "证书作业类别-字典编码", name = "qualificationinfoCategory")
@NotEmpty(message = "证书作业类别编码不能为空")
private String qualificationinfoCategory;
// 证书作业类别名称
@ApiModelProperty(value = "证书作业类别名称", name = "qualificationinfoCategoryName")
@NotEmpty(message = "证书作业类别不能为空")
private String qualificationinfoCategoryName;
// 操作项目-字典编码(特种有,安全没有)
@ApiModelProperty(value = "操作项目-字典编码(特种有,安全没有)", name = "operatingProject")
private String operatingProject;
// 操作项目名称(特种有,安全没有)
@ApiModelProperty(value = "操作项目名称(特种有,安全没有)", name = "operatingProjectName")
private String operatingProjectName;
}

View File

@ -78,7 +78,6 @@ public class UserXgfAddCmd extends Command {
private String userIdCard;
@ApiModelProperty(value = "人脸头像url", name = "userAvatarUrl", required = true)
@NotEmpty(message = "人脸头像url不能为空")
private String userAvatarUrl;
@ApiModelProperty(value = "现住址", name = "currentAddress", required = true)
@ -128,5 +127,11 @@ public class UserXgfAddCmd extends Command {
@NotEmpty(message = "政治面貌名称不能为空")
private String politicalAffiliationName;
@ApiModelProperty(value = "企业名称")
private String corpinfoName;
@ApiModelProperty(value = "部门名称")
private String departmentName;
@ApiModelProperty(value = "岗位名称")
private String postName;
}

View File

@ -1,13 +1,10 @@
package com.zcloud.basic.info.dto.clientobject;
import com.alibaba.cola.dto.ClientObject;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Date;
@ -30,16 +27,9 @@ public class UserQualificationInfoCO extends ClientObject {
//用户id
@ApiModelProperty(value = "用户id")
private Long userId;
//资质名称
@ApiModelProperty(value = "资质名称")
//证书名称
@ApiModelProperty(value = "证书名称")
private String qualificationName;
//人员资质证书有效期
@ApiModelProperty(value = "人员资质证书有效期开始时间")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date startValidityTime;
@ApiModelProperty(value = "人员资质证书有效期结束时间")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date endValidityTime;
//证书编号
@ApiModelProperty(value = "证书编号")
private String certificateNo;
@ -98,5 +88,14 @@ public class UserQualificationInfoCO extends ClientObject {
//环境
@ApiModelProperty(value = "环境")
private String env;
@ApiModelProperty(value = "人员名称")
private String userName;
@ApiModelProperty(value = "入职状态")
private String employmentFlagName;
@ApiModelProperty(value = "部门名称")
private String departmentName;
}

View File

@ -1,16 +1,17 @@
package com.zcloud.basic.info.domain.model;
import com.alibaba.cola.dto.Response;
import com.alibaba.cola.exception.BizException;
import com.jjb.saas.framework.domain.model.BaseE;
import com.zcloud.gbscommon.utils.DateUtil;
import com.zcloud.gbscommon.utils.FileUpload;
import com.zcloud.gbscommon.excelEntity.UserExcelExportEntity;
import com.zcloud.gbscommon.utils.ExcelUtils;
import com.zcloud.gbscommon.utils.Tools;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.util.ObjectUtils;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.time.LocalDateTime;
import java.util.List;
/**
* web-domain
@ -63,6 +64,13 @@ public class UserE extends BaseE {
private String phone;
private String rankLevelName;
//企业名称
private String corpinfoName;
//部门名称
private String departmentName;
//岗位名称
private String postName;
//人员在部门中的排序
private Integer sort;
//乐观锁
@ -124,5 +132,37 @@ public class UserE extends BaseE {
return Response.buildSuccess();
}
}
/**
*
* @param oldUserE
* @param newUserE
* @return
*/
public boolean verifyTransferPosition(UserE oldUserE, UserE newUserE) {
if (oldUserE.getCorpinfoId() != newUserE.getCorpinfoId()){
return true;
}
if (oldUserE.getDepartmentId() != newUserE.getDepartmentId()){
return true;
}
if (oldUserE.getPostId() != newUserE.getPostId()){
return true;
}
if(oldUserE.getEmploymentFlag() != newUserE.getEmploymentFlag()){
return true;
}
return false;
}
// 导出
public void exportUserTable(HttpServletResponse httpServletResponse, List<UserExcelExportEntity> userExcelEntities) {
try {
ExcelUtils.exportExcel(httpServletResponse,UserExcelExportEntity.class,"人员信息", userExcelEntities);
}catch (Exception e) {
throw new BizException("导出失败");
}
}
}

View File

@ -59,8 +59,10 @@ public class UserEmploymentLogE extends BaseE {
//环境
private String env;
public void initAdd(UserEmploymentLogE userEmploymentLogE) {
public void initAdd(UserEmploymentLogE userEmploymentLogE, String corpinfoName, Long user_id) {
userEmploymentLogE.setUserEmploymentLogId(Tools.get32UUID());
userEmploymentLogE.setCorpinfoName(corpinfoName);
userEmploymentLogE.setUserId(user_id);
}
}

View File

@ -28,9 +28,6 @@ public class UserQualificationInfoE extends BaseE {
private Long userId;
//资质名称
private String qualificationName;
//人员资质证书有效期
private Date startValidityTime;
private Date endValidityTime;
//证书编号
private String certificateNo;

View File

@ -27,6 +27,7 @@ public class UserGatewayImpl implements UserGateway {
UserDO d = new UserDO();
BeanUtils.copyProperties(userE, d);
userRepository.save(d);
userE.setId(d.getId());
return true;
}

View File

@ -33,11 +33,6 @@ public class UserQualificationInfoDO extends BaseDO {
//资质名称
@ApiModelProperty(value = "资质名称")
private String qualificationName;
//人员资质证书有效期
@ApiModelProperty(value = "人员资质证书有效期")
private Date startValidityTime;
@ApiModelProperty(value = "人员资质证书有效期")
private Date endValidityTime;
//证书编号
@ApiModelProperty(value = "证书编号")
private String certificateNo;
@ -58,6 +53,18 @@ public class UserQualificationInfoDO extends BaseDO {
@ApiModelProperty(value = "操作项目名称(特种有,安全没有)")
private String operatingProjectName;
@ApiModelProperty(value = "人员名称")
@TableField(exist = false)
private String userName;
@ApiModelProperty(value = "入职状态, 1-入职 0-离职")
@TableField(exist = false)
private String employmentFlagName;
@ApiModelProperty(value = "部门名称")
@TableField(exist = false)
private String departmentName;
public UserQualificationInfoDO(String userQualificationinfoId) {
this.userQualificationinfoId = userQualificationinfoId;
}

View File

@ -1,8 +1,12 @@
package com.zcloud.basic.info.persistence.mapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zcloud.basic.info.persistence.dataobject.UserDO;
import com.zcloud.basic.info.persistence.dataobject.UserQualificationInfoDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* web-infrastructure
@ -12,5 +16,7 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface UserQualificationInfoMapper extends BaseMapper<UserQualificationInfoDO> {
IPage<UserQualificationInfoDO> selectQualificationInfoPage(IPage<UserQualificationInfoDO> page, @Param("ew") QueryWrapper<UserQualificationInfoDO> queryWrapper);
}

View File

@ -31,26 +31,19 @@ public class UserQualificationInfoRepositoryImpl extends BaseRepositoryImpl<User
@Override
public PageResponse<UserQualificationInfoDO> listPage(Map<String,Object> params) {
Object keyWords = params.get("keyWords");
IPage<UserQualificationInfoDO> iPage = new Query<UserQualificationInfoDO>().getPage(params);
QueryWrapper<UserQualificationInfoDO> queryWrapper = new QueryWrapper<>();
queryWrapper = PageQueryHelper.createPageQueryWrapper(queryWrapper, params);
if (keyWords != null && !Tools.isEmpty(keyWords.toString())) {
queryWrapper.and(i -> i.like("qualification_name", keyWords).or().like("certificate_no", keyWords));
}
queryWrapper.orderByDesc("create_time");
IPage<UserQualificationInfoDO> result = userQualificationInfoMapper.selectPage(iPage, queryWrapper);
queryWrapper = PageQueryHelper.createPageQueryWrapper(queryWrapper, params, "a.");
queryWrapper.eq("a.delete_enum", "FALSE");
queryWrapper.orderByDesc("a.create_time");
IPage<UserQualificationInfoDO> result = userQualificationInfoMapper.selectQualificationInfoPage(iPage, queryWrapper);
return PageHelper.pageToResponse(result, result.getRecords());
}
@Override
public MultiResponse<UserQualificationInfoDO> list(Map<String, Object> params) {
Object keyWords = params.get("keyWords");
QueryWrapper<UserQualificationInfoDO> queryWrapper = new QueryWrapper<>();
queryWrapper = PageQueryHelper.createPageQueryWrapper(queryWrapper, params);
if (keyWords != null && !Tools.isEmpty(keyWords.toString())) {
queryWrapper.and(i -> i.like("qualification_name", keyWords).or().like("certificate_no", keyWords));
}
queryWrapper.orderByDesc("create_time");
List<UserQualificationInfoDO> result = userQualificationInfoMapper.selectList(queryWrapper);
return MultiResponse.of(result);

View File

@ -70,6 +70,12 @@
<if test="params.postId != null">
and u.post_id = #{params.postId}
</if>
<if test="params.userIdList != null and params.userIdList.size() > 0">
and u.id in
<foreach item="item" index="index" collection="params.userIdList" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where>
order by
u.create_time desc

View File

@ -4,5 +4,42 @@
<mapper namespace="com.zcloud.basic.info.persistence.mapper.UserQualificationInfoMapper">
<select id="selectQualificationInfoPage" resultType="com.zcloud.basic.info.persistence.dataobject.UserQualificationInfoDO">
select
a.id,
a.user_qualificationinfo_id,
a.corpinfo_id,
a.user_id,
a.qualification_name,
a.certificate_no,
a.qualificationinfo_type,
a.qualificationinfo_category,
a.qualificationinfo_category_name,
a.operating_project,
a.operating_project_name,
a.delete_enum,
a.tenant_id,
a.org_id,
a.version,
a.create_time,
a.update_time,
a.create_id,
a.update_id,
a.create_name,
a.update_name,
a.remarks,
a.env,
u.name as userName,
case
when u.employment_flag = '1' then '在职'
when u.employment_flag = '0' then '离职'
else '离职'
end as employmentFlagName,
d.name as departmentName
from user_qualification_info a
left join user u on a.user_id = u.id
left join department d on u.department_id = d.id
${ew.customSqlSegment}
</select>
</mapper>