人员库
This commit is contained in:
parent
b727497d69
commit
aa8d681013
|
|
@ -0,0 +1,73 @@
|
|||
package com.bonus.web.controller.enterprise;
|
||||
|
||||
import com.bonus.common.annotation.RequiresPermissions;
|
||||
import com.bonus.common.annotation.SysLog;
|
||||
import com.bonus.common.core.controller.BaseController;
|
||||
import com.bonus.common.core.domain.AjaxResult;
|
||||
import com.bonus.common.core.page.TableDataInfo;
|
||||
import com.bonus.common.domain.mainDatabase.dto.EnterprisePersonnelDto;
|
||||
import com.bonus.common.domain.mainDatabase.vo.EnterprisePersonnelVo;
|
||||
import com.bonus.common.enums.OperaType;
|
||||
import com.bonus.web.service.enterprise.PersonnelService;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @className: EnterprisePersonnelController
|
||||
* @author: cwchen
|
||||
* @date: 2025-10-22-16:10
|
||||
* @version: 1.0
|
||||
* @description: 企业人员库-web层
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mainDatabase/personnel")
|
||||
public class EnterprisePersonnelController extends BaseController {
|
||||
|
||||
@Resource(name = "PersonnelService")
|
||||
private PersonnelService personnelService;
|
||||
|
||||
@ApiOperation(value = "人员库", notes = "查询列表")
|
||||
@GetMapping("getList")
|
||||
@SysLog(title = "人员库", module = "企业知识库->人员库->查询列表", businessType = OperaType.QUERY, details = "查询列表", logType = 1)
|
||||
@RequiresPermissions("enterpriseLibrary:personnel:list")
|
||||
public TableDataInfo getList(EnterprisePersonnelDto dto) {
|
||||
startPage();
|
||||
List<EnterprisePersonnelVo> list = personnelService.getList(dto);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "人员库", notes = "新增人员库")
|
||||
@PostMapping("addData")
|
||||
@SysLog(title = "人员库", module = "企业知识库->人员库->新增人员库", businessType = OperaType.INSERT, details = "新增人员库", logType = 1)
|
||||
@RequiresPermissions("enterpriseLibrary:personnel:add")
|
||||
public AjaxResult addData(@RequestBody EnterprisePersonnelDto dto) {
|
||||
return personnelService.addData(dto);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "人员库", notes = "修改人员库")
|
||||
@PostMapping("editData")
|
||||
@SysLog(title = "人员库", module = "企业知识库->人员库->修改人员库", businessType = OperaType.UPDATE, details = "修改人员库", logType = 1)
|
||||
@RequiresPermissions("enterpriseLibrary:personnel:edit")
|
||||
public AjaxResult editData(@RequestBody EnterprisePersonnelDto dto) {
|
||||
return personnelService.editData(dto);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "人员库", notes = "删除人员库")
|
||||
@PostMapping("delData")
|
||||
@SysLog(title = "人员库", module = "企业知识库->人员库->删除人员库", businessType = OperaType.DELETE, details = "删除人员库", logType = 1)
|
||||
@RequiresPermissions("enterpriseLibrary:personnel:del")
|
||||
public AjaxResult delData(@RequestBody EnterprisePersonnelDto dto) {
|
||||
return personnelService.delData(dto);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "人员库", notes = "查询详情")
|
||||
@GetMapping("getDetailData")
|
||||
@SysLog(title = "人员库", module = "企业知识库->人员库->查询详情", businessType = OperaType.QUERY, details = "查询详情", logType = 1)
|
||||
@RequiresPermissions("enterpriseLibrary:personnel:detail")
|
||||
public AjaxResult getDetailData(EnterprisePersonnelDto dto) {
|
||||
return personnelService.getDetailData(dto);
|
||||
}
|
||||
}
|
||||
|
|
@ -10,9 +10,7 @@ import com.bonus.file.service.FileUploadService;
|
|||
import com.bonus.file.service.SourceFileService;
|
||||
import com.bonus.file.util.FileUtil;
|
||||
import com.bonus.file.util.MinioUtil;
|
||||
import com.bonus.mainDataBase.service.ITestService;
|
||||
import com.bonus.ocr.service.OcrService;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
|
|
@ -48,8 +46,6 @@ public class FileUploadController {
|
|||
@Resource
|
||||
private MinioUtil minioUtil;
|
||||
|
||||
@Resource(name = "TestService")
|
||||
private ITestService testService;
|
||||
|
||||
|
||||
@PostMapping(value = "uploadFile")
|
||||
|
|
|
|||
|
|
@ -0,0 +1,386 @@
|
|||
package com.bonus.web.service.enterprise;
|
||||
|
||||
import com.bonus.common.constant.CertificateConstants;
|
||||
import com.bonus.common.constant.TableConstants;
|
||||
import com.bonus.common.core.domain.AjaxResult;
|
||||
import com.bonus.common.domain.file.po.ResourceFilePo;
|
||||
import com.bonus.common.domain.file.vo.ResourceFileVo;
|
||||
import com.bonus.common.domain.file.vo.SysFile;
|
||||
import com.bonus.common.domain.mainDatabase.dto.EnterprisePersonnelDto;
|
||||
import com.bonus.common.domain.mainDatabase.po.EnterprisePersonnel;
|
||||
import com.bonus.common.domain.mainDatabase.po.ErrorInfo;
|
||||
import com.bonus.common.domain.mainDatabase.po.PersonnelCertificate;
|
||||
import com.bonus.common.domain.mainDatabase.vo.EnterprisePersonnelVo;
|
||||
import com.bonus.common.domain.mainDatabase.vo.EnterpriseVo;
|
||||
import com.bonus.common.utils.CertificateUtil;
|
||||
import com.bonus.common.utils.ValidatorsUtils;
|
||||
import com.bonus.file.service.FileUploadService;
|
||||
import com.bonus.file.service.SourceFileService;
|
||||
import com.bonus.mainDataBase.service.IMDCertificateService;
|
||||
import com.bonus.mainDataBase.service.IMDErrorInfoService;
|
||||
import com.bonus.mainDataBase.service.IMDPersonnelService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @className:PersonnelService
|
||||
* @author:cwchen
|
||||
* @date:2025-10-22-16:12
|
||||
* @version:1.0
|
||||
* @description:人员库-业务实现层
|
||||
*/
|
||||
@Service(value = "PersonnelService")
|
||||
@Slf4j
|
||||
public class PersonnelService {
|
||||
|
||||
@Resource(name = "IMDPersonnelService")
|
||||
private IMDPersonnelService imdPersonnelService;
|
||||
|
||||
@Resource(name = "IMDCertificateService")
|
||||
private IMDCertificateService imdCertificateService;
|
||||
|
||||
@Resource(name = "SourceFileService")
|
||||
private SourceFileService sourceFileService;
|
||||
|
||||
@Resource(name = "IMDErrorInfoService")
|
||||
private IMDErrorInfoService imdErrorInfoService;
|
||||
|
||||
@Resource(name = "FileUploadService")
|
||||
private FileUploadService fileUploadService;
|
||||
|
||||
@Resource(name = "ValidatorsUtils")
|
||||
private ValidatorsUtils validatorsUtils;
|
||||
|
||||
/**
|
||||
* 人员库->查询列表
|
||||
*
|
||||
* @param dto
|
||||
* @return TableDataInfo
|
||||
* @author cwchen
|
||||
* @date 2025/10/22 16:18
|
||||
*/
|
||||
public List<EnterprisePersonnelVo> getList(EnterprisePersonnelDto dto) {
|
||||
return imdPersonnelService.getList(dto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 人员库->新增人员库
|
||||
*
|
||||
* @param dto
|
||||
* @return AjaxResult
|
||||
* @author cwchen
|
||||
* @date 2025/10/22 17:11
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public AjaxResult addData(EnterprisePersonnelDto dto) {
|
||||
// 校验数据是否合法
|
||||
String validResult = validatorsUtils.valid(dto, EnterprisePersonnelDto.ADD.class);
|
||||
if (StringUtils.isNotBlank(validResult)) {
|
||||
return AjaxResult.error(validResult);
|
||||
}
|
||||
try {
|
||||
// 1.人员身份证不能重复
|
||||
int result = imdPersonnelService.isRepeat(dto);
|
||||
if(result > 0){
|
||||
return AjaxResult.error("身份证号码已存在");
|
||||
}
|
||||
// 2.添加人员库数据
|
||||
imdPersonnelService.operPersonnelData(dto, 1);
|
||||
// 3.添加文件
|
||||
for (ResourceFilePo file : dto.getFiles()) {
|
||||
file.setBusinessId(dto.getPersonnelId()); // 业务id
|
||||
file.setSourceTable(TableConstants.TB_ENTERPRISE_PERSONNEL); // 来源表
|
||||
}
|
||||
sourceFileService.saveResourceFile(dto.getFiles());
|
||||
// 处理资质信息和职称信息
|
||||
if(CollectionUtils.isNotEmpty(dto.getPersonnelCertificateFiles())){
|
||||
for (EnterprisePersonnelDto.PersonnelCertificateDto item : dto.getPersonnelCertificateFiles()) {
|
||||
// 添加人员id
|
||||
item.getPersonnelCertificate().setPersonnelId(dto.getPersonnelId());
|
||||
}
|
||||
// 添加人员证书
|
||||
imdCertificateService.addCertificateData(dto.getPersonnelCertificateFiles());
|
||||
// 创建证书资源文件和证书异常消息集合
|
||||
List<ResourceFilePo> certificateList = new ArrayList<>();
|
||||
List<ErrorInfo> errorInfos = new ArrayList<>();
|
||||
for (EnterprisePersonnelDto.PersonnelCertificateDto item : dto.getPersonnelCertificateFiles()) {
|
||||
item.getResourceFilePo().setBusinessId(item.getPersonnelCertificate().getPersonnelCertificateId());// 添加证书id
|
||||
item.getResourceFilePo().setSourceTable(TableConstants.TB_PERSONNEL_CERTIFICATE); // 来源表
|
||||
certificateList.add(item.getResourceFilePo());
|
||||
// 检查证书资源文件是否存在过期
|
||||
ErrorInfo errorInfo = CertificateUtil.checkCertificateState(item.getPersonnelCertificate().getCertificateValidityPeriod(),
|
||||
item.getPersonnelCertificate().getCertificateType(),
|
||||
item.getPersonnelCertificate().getPersonnelCertificateId(),
|
||||
dto.getEnterpriseId());
|
||||
if (Objects.nonNull(errorInfo)) {
|
||||
errorInfos.add(errorInfo);
|
||||
}
|
||||
}
|
||||
// 添加证书资源文件
|
||||
sourceFileService.saveResourceFile(certificateList);
|
||||
// 存在证书过期异常信息则添加
|
||||
if(CollectionUtils.isNotEmpty(errorInfos)){
|
||||
imdErrorInfoService.addErrorInfo(errorInfos);
|
||||
}
|
||||
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||
return AjaxResult.error();
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 人员库->修改人员库
|
||||
*
|
||||
* @param dto
|
||||
* @return AjaxResult
|
||||
* @author cwchen
|
||||
* @date 2025/10/22 17:14
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public AjaxResult editData(EnterprisePersonnelDto dto) {
|
||||
// 校验数据是否合法
|
||||
String validResult = validatorsUtils.valid(dto, EnterprisePersonnelDto.UPDATE.class);
|
||||
if (StringUtils.isNotBlank(validResult)) {
|
||||
return AjaxResult.error(validResult);
|
||||
}
|
||||
try {
|
||||
// 1.人员身份证不能重复
|
||||
int result = imdPersonnelService.isRepeat(dto);
|
||||
if(result > 0){
|
||||
return AjaxResult.error("身份证号码已存在");
|
||||
}
|
||||
// 2.修改人员库数据
|
||||
imdPersonnelService.operPersonnelData(dto, 2);
|
||||
// 3.如果存在新增文件,则添加
|
||||
if(CollectionUtils.isNotEmpty(dto.getFiles())){
|
||||
for (ResourceFilePo file : dto.getFiles()) {
|
||||
file.setBusinessId(dto.getPersonnelId()); // 业务id
|
||||
file.setSourceTable(TableConstants.TB_ENTERPRISE_PERSONNEL); // 来源表
|
||||
}
|
||||
sourceFileService.saveResourceFile(dto.getFiles());
|
||||
}
|
||||
// 4.如果存在删除的文件则删除系统资源文件
|
||||
if (CollectionUtils.isNotEmpty(dto.getDelFiles())) {
|
||||
sourceFileService.delResourceFile(dto.getDelFiles(), TableConstants.TB_ENTERPRISE_PERSONNEL);
|
||||
}
|
||||
|
||||
// 异常信息删除集合
|
||||
List<ErrorInfo> delErrorInfoList = new ArrayList<>();
|
||||
// 处理资质信息和职称信息
|
||||
if(CollectionUtils.isNotEmpty(dto.getPersonnelCertificateFiles())){
|
||||
// 查询人员职位是否发生了变化,是否导致证书类型也发生了变化
|
||||
List<PersonnelCertificate> changeList = imdCertificateService.getCertificateChange(dto.getPersonnelCertificateFiles(),dto.getPersonnelId());
|
||||
if(CollectionUtils.isNotEmpty(changeList)){
|
||||
// 删除证书
|
||||
imdCertificateService.delCertificate(changeList);
|
||||
List<ResourceFilePo> delFiles = new ArrayList<>();
|
||||
for (PersonnelCertificate item : changeList) {
|
||||
// 添加需要删除的资源文件
|
||||
ResourceFilePo delResourceFilePo = setResourceFile(item);
|
||||
delFiles.add(delResourceFilePo);
|
||||
// 添加需要删除的异常信息
|
||||
ErrorInfo delErrorInfo = setErrorInfo(item);
|
||||
delErrorInfoList.add(delErrorInfo);
|
||||
}
|
||||
// 删除证书资源文件根据业务id、来源表、业务类型
|
||||
sourceFileService.delResourceFileBybusinessId(delFiles);
|
||||
}
|
||||
|
||||
// 修改人员证书
|
||||
imdCertificateService.editCertificateData(dto.getPersonnelCertificateFiles());
|
||||
// 创建证书资源文件和证书异常消息集合
|
||||
List<ResourceFilePo> certificateList = new ArrayList<>();
|
||||
List<ErrorInfo> errorInfos = new ArrayList<>();
|
||||
for (EnterprisePersonnelDto.PersonnelCertificateDto item : dto.getPersonnelCertificateFiles()) {
|
||||
if(Objects.nonNull(item.getResourceFilePo())){
|
||||
item.getResourceFilePo().setBusinessId(item.getPersonnelCertificate().getPersonnelCertificateId());// 添加证书id
|
||||
item.getResourceFilePo().setSourceTable(TableConstants.TB_PERSONNEL_CERTIFICATE); // 来源表
|
||||
certificateList.add(item.getResourceFilePo());
|
||||
}
|
||||
// 添加需要删除的异常信息
|
||||
ErrorInfo delErrorInfo = setErrorInfo(item.getPersonnelCertificate());
|
||||
delErrorInfoList.add(delErrorInfo);
|
||||
// 检查证书资源文件是否存在过期
|
||||
ErrorInfo errorInfo = CertificateUtil.checkCertificateState(item.getPersonnelCertificate().getCertificateValidityPeriod(),
|
||||
item.getPersonnelCertificate().getCertificateType(),
|
||||
item.getPersonnelCertificate().getPersonnelCertificateId(),
|
||||
dto.getEnterpriseId());
|
||||
if (Objects.nonNull(errorInfo)) {
|
||||
errorInfos.add(errorInfo);
|
||||
}
|
||||
}
|
||||
// 添加证书资源文件
|
||||
if(CollectionUtils.isNotEmpty(certificateList)){
|
||||
sourceFileService.saveResourceFile(certificateList);
|
||||
}
|
||||
// 删除异常信息数据-根据业务id、业务类型、来源表
|
||||
imdErrorInfoService.delErrorInfoByBusinessId(delErrorInfoList);
|
||||
// 存在证书过期异常信息则添加
|
||||
if(CollectionUtils.isNotEmpty(errorInfos)){
|
||||
imdErrorInfoService.addErrorInfo(errorInfos);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||
return AjaxResult.error();
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 人员库->删除人员库
|
||||
*
|
||||
* @param dto
|
||||
* @return AjaxResult
|
||||
* @author cwchen
|
||||
* @date 2025/10/22 17:15
|
||||
*/
|
||||
public AjaxResult delData(EnterprisePersonnelDto dto) {
|
||||
// 1.校验数据是否合法
|
||||
String validResult = validatorsUtils.valid(dto, EnterprisePersonnelDto.DELETE.class);
|
||||
if (StringUtils.isNotBlank(validResult)) {
|
||||
return AjaxResult.error(validResult);
|
||||
}
|
||||
try {
|
||||
// 2.判断人员是否被引用
|
||||
int useNum = imdPersonnelService.getUseNum(dto);
|
||||
if(useNum > 0) {
|
||||
return AjaxResult.error("人员已被企业业绩关联,无法删除");
|
||||
}
|
||||
// 3.删除人员
|
||||
imdPersonnelService.operPersonnelData(dto,3);
|
||||
// 4.删除人员相关资源文件
|
||||
sourceFileService.delResourceFileByTable(dto.getPersonnelId(),TableConstants.TB_ENTERPRISE_PERSONNEL);
|
||||
// 查询人员相关证书
|
||||
List<PersonnelCertificate> certificateList = imdCertificateService.getCertificates(dto);
|
||||
// 异常信息删除、人员证书集合
|
||||
List<ErrorInfo> delErrorInfoList = new ArrayList<>();
|
||||
List<ResourceFilePo> delFiles = new ArrayList<>();
|
||||
if(CollectionUtils.isNotEmpty(certificateList)){
|
||||
for (PersonnelCertificate item : certificateList) {
|
||||
// 添加需要删除的资源文件
|
||||
ResourceFilePo delResourceFilePo = setResourceFile(item);
|
||||
delFiles.add(delResourceFilePo);
|
||||
// 添加需要删除的异常信息
|
||||
ErrorInfo delErrorInfo = setErrorInfo(item);
|
||||
delErrorInfoList.add(delErrorInfo);
|
||||
}
|
||||
}
|
||||
// 删除证书资源文件根据业务id、来源表、业务类型
|
||||
sourceFileService.delResourceFileBybusinessId(delFiles);
|
||||
// 删除异常信息数据-根据业务id、业务类型、来源表
|
||||
imdErrorInfoService.delErrorInfoByBusinessId(delErrorInfoList);
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||
return AjaxResult.error();
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 人员库->人员库详情
|
||||
*
|
||||
* @param dto
|
||||
* @return AjaxResult
|
||||
* @author cwchen
|
||||
* @date 2025/10/22 17:16
|
||||
*/
|
||||
public AjaxResult getDetailData(EnterprisePersonnelDto dto) {
|
||||
// 1.校验数据是否合法
|
||||
String validResult = validatorsUtils.valid(dto, EnterprisePersonnelDto.QUERY.class);
|
||||
if (StringUtils.isNotBlank(validResult)) {
|
||||
return AjaxResult.error(validResult);
|
||||
}
|
||||
EnterprisePersonnelVo.PersonnelDetailVo detailVo = new EnterprisePersonnelVo.PersonnelDetailVo();
|
||||
List<EnterprisePersonnelVo.CertificateDetailVo> certificateDetailList = new ArrayList<>();
|
||||
// 2.查询人员详情
|
||||
EnterprisePersonnel personnel = imdPersonnelService.getPersonnelData(dto);
|
||||
detailVo.setEnterprisePersonnel(personnel);
|
||||
// 3.查询人员关联资源文件
|
||||
List<ResourceFileVo> fileVoList = sourceFileService.getFilesByTable(dto.getPersonnelId(),TableConstants.TB_ENTERPRISE_PERSONNEL);
|
||||
// 4.取minio中的文件访问路径
|
||||
List<ResourceFileVo> resourceFileVos = setFile(fileVoList);
|
||||
detailVo.setResourceFileVoList(resourceFileVos);
|
||||
|
||||
// 5.查询人员证书
|
||||
List<PersonnelCertificate> certificateList = imdCertificateService.getCertificates(dto);
|
||||
if(CollectionUtils.isNotEmpty(certificateList)){
|
||||
for (PersonnelCertificate item : certificateList) {
|
||||
EnterprisePersonnelVo.CertificateDetailVo vo = new EnterprisePersonnelVo.CertificateDetailVo();
|
||||
vo.setCertificate(item);
|
||||
List<ResourceFileVo> filesByTable = sourceFileService.getFilesByTable(item.getPersonnelCertificateId(), TableConstants.TB_ENTERPRISE_PERSONNEL);
|
||||
// 取minio中的文件访问路径
|
||||
List<ResourceFileVo> fileVos = setFile(filesByTable);
|
||||
vo.setFileVoList(fileVos);
|
||||
certificateDetailList.add(vo);
|
||||
}
|
||||
}
|
||||
detailVo.setCertificateDetailList(certificateDetailList);
|
||||
return AjaxResult.success(detailVo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 异常信息赋值
|
||||
* @param item
|
||||
* @return ErrorInfo
|
||||
* @author cwchen
|
||||
* @date 2025/10/24 12:13
|
||||
*/
|
||||
public ErrorInfo setErrorInfo(PersonnelCertificate item) {
|
||||
ErrorInfo errorInfo = new ErrorInfo();
|
||||
errorInfo.setSourceTable(TableConstants.TB_PERSONNEL_CERTIFICATE);
|
||||
errorInfo.setBusinessId(item.getPersonnelCertificateId());
|
||||
errorInfo.setBusinessType(item.getCertificateType());
|
||||
return errorInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 资源文件赋值
|
||||
* @param item
|
||||
* @return ResourceFilePo
|
||||
* @author cwchen
|
||||
* @date 2025/10/24 12:15
|
||||
*/
|
||||
public ResourceFilePo setResourceFile(PersonnelCertificate item) {
|
||||
ResourceFilePo resourceFilePo = new ResourceFilePo();
|
||||
resourceFilePo.setBusinessId(item.getPersonnelCertificateId());
|
||||
resourceFilePo.setSourceTable(TableConstants.TB_PERSONNEL_CERTIFICATE);
|
||||
resourceFilePo.setFileType(item.getCertificateType());
|
||||
return resourceFilePo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 文件访问路径赋值
|
||||
* @param fileVoList
|
||||
* @return List<ResourceFileVo>
|
||||
* @author cwchen
|
||||
* @date 2025/10/24 13:37
|
||||
*/
|
||||
public List<ResourceFileVo> setFile(List<ResourceFileVo> fileVoList){
|
||||
if(CollectionUtils.isNotEmpty(fileVoList)){
|
||||
for (ResourceFileVo file : fileVoList) {
|
||||
SysFile sysFile = fileUploadService.getFile(file.getFilePath());
|
||||
if(Objects.nonNull(sysFile)){
|
||||
file.setLsFilePath(sysFile.getUrl());
|
||||
}
|
||||
}
|
||||
}
|
||||
return fileVoList;
|
||||
}
|
||||
}
|
||||
|
|
@ -11,4 +11,10 @@ public class TableConstants {
|
|||
|
||||
/**企业主体表*/
|
||||
public static final String TB_ENTERPRISE = "tb_enterprise";
|
||||
|
||||
/**企业人员库表*/
|
||||
public static final String TB_ENTERPRISE_PERSONNEL = "tb_enterprise_personnel";
|
||||
|
||||
/**人员证书*/
|
||||
public static final String TB_PERSONNEL_CERTIFICATE = "tb_personnel_certificate";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,207 @@
|
|||
package com.bonus.common.domain.mainDatabase.dto;
|
||||
|
||||
import com.bonus.common.core.domain.model.LoginUser;
|
||||
import com.bonus.common.domain.file.po.ResourceFilePo;
|
||||
import com.bonus.common.domain.mainDatabase.po.PersonnelCertificate;
|
||||
import com.bonus.common.utils.SecurityUtils;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* 企业人员库表
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class EnterprisePersonnelDto {
|
||||
|
||||
/**
|
||||
* 人员id
|
||||
*/
|
||||
@NotNull(message = "人员id不能为空", groups = {UPDATE.class, DELETE.class, QUERY.class})
|
||||
private Long personnelId;
|
||||
|
||||
/**
|
||||
* 企业id
|
||||
*/
|
||||
@NotNull(message = "企业id不能为空", groups = {ADD.class, UPDATE.class, DELETE.class, QUERY.class})
|
||||
private Long enterpriseId;
|
||||
|
||||
/**
|
||||
* 人员职位(字典表配置)
|
||||
*/
|
||||
@NotBlank(message = "人员职位不能为空", groups = {ADD.class, UPDATE.class})
|
||||
@Length(max = 32, message = "人员职位字符长度不能超过32", groups = {ADD.class, UPDATE.class})
|
||||
private String personnelPosition;
|
||||
|
||||
/**
|
||||
* 人员姓名
|
||||
*/
|
||||
@NotBlank(message = "人员姓名不能为空", groups = {ADD.class, UPDATE.class})
|
||||
@Length(max = 32, message = "人员姓名字符长度不能超过32", groups = {ADD.class, UPDATE.class})
|
||||
private String personnelName;
|
||||
|
||||
/**
|
||||
* 身份证号码
|
||||
*/
|
||||
@NotBlank(message = "身份证号码不能为空", groups = {ADD.class, UPDATE.class})
|
||||
@Length(max = 32, message = "身份证号码字符长度不能超过32", groups = {ADD.class, UPDATE.class})
|
||||
private String personnelIdCard;
|
||||
|
||||
/**
|
||||
* 入职时间
|
||||
*/
|
||||
@NotNull(message = "入职时间不能为空", groups = {ADD.class, UPDATE.class})
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private Date employmentDate;
|
||||
|
||||
/**
|
||||
* 从业年限
|
||||
*/
|
||||
@NotBlank(message = "从业年限不能为空", groups = {ADD.class, UPDATE.class})
|
||||
@Length(max = 32, message = "从业年限字符长度不能超过32", groups = {ADD.class, UPDATE.class})
|
||||
private String employmentYears;
|
||||
|
||||
/**
|
||||
* 毕业院校
|
||||
*/
|
||||
@NotBlank(message = "毕业院校不能为空", groups = {ADD.class, UPDATE.class})
|
||||
@Length(max = 64, message = "毕业院校字符长度不能超过64", groups = {ADD.class, UPDATE.class})
|
||||
private String graduateSchool;
|
||||
|
||||
/**
|
||||
* 毕业专业
|
||||
*/
|
||||
@NotBlank(message = "毕业专业不能为空", groups = {ADD.class, UPDATE.class})
|
||||
@Length(max = 64, message = "毕业专业字符长度不能超过64", groups = {ADD.class, UPDATE.class})
|
||||
private String graduationMajor;
|
||||
|
||||
/**
|
||||
* 学历
|
||||
*/
|
||||
@NotBlank(message = "学历不能为空", groups = {ADD.class, UPDATE.class})
|
||||
@Length(max = 32, message = "学历字符长度不能超过32", groups = {ADD.class, UPDATE.class})
|
||||
private String qualification;
|
||||
|
||||
/**
|
||||
* 毕业时间
|
||||
*/
|
||||
@NotNull(message = "毕业时间不能为空", groups = {ADD.class, UPDATE.class})
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private Date graduationDate;
|
||||
|
||||
/**
|
||||
* 联系方式
|
||||
*/
|
||||
@NotBlank(message = "联系方式不能为空", groups = {ADD.class, UPDATE.class})
|
||||
@Length(max = 11, message = "联系方式字符长度不能超过11", groups = {ADD.class, UPDATE.class})
|
||||
private String personnelPhone;
|
||||
|
||||
/**
|
||||
* 人员简介
|
||||
*/
|
||||
@Length(max = 300, message = "人员简介字符长度不能超过300", groups = {ADD.class, UPDATE.class})
|
||||
private String personnelIntroduction;
|
||||
|
||||
/**
|
||||
* 是否存在过期证件 0.未过期 1.已过期
|
||||
*/
|
||||
private String expiredState;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private Long createUserId = Optional.ofNullable(SecurityUtils.getLoginUser())
|
||||
.map(LoginUser::getUserId)
|
||||
.orElse(null);
|
||||
;
|
||||
|
||||
/**
|
||||
* 创建人姓名
|
||||
*/
|
||||
private String createUserName = Optional.ofNullable(SecurityUtils.getLoginUser())
|
||||
.map(LoginUser::getUsername)
|
||||
.orElse(null);
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
private Long updateUserId = Optional.ofNullable(SecurityUtils.getLoginUser())
|
||||
.map(LoginUser::getUserId)
|
||||
.orElse(null);
|
||||
;
|
||||
|
||||
/**
|
||||
* 修改人姓名
|
||||
*/
|
||||
private String updateUserName = Optional.ofNullable(SecurityUtils.getLoginUser())
|
||||
.map(LoginUser::getUsername)
|
||||
.orElse(null);
|
||||
|
||||
|
||||
/**
|
||||
* 资源文件
|
||||
*/
|
||||
@NotEmpty(message = "文件不能为空", groups = {EnterpriseDto.ADD.class})
|
||||
@Size(min = 5, max = 7, message = "最少需要上传四个文件", groups = {EnterpriseDto.ADD.class})
|
||||
private List<ResourceFilePo> files;
|
||||
|
||||
/**
|
||||
* 证书文件
|
||||
*/
|
||||
private List<PersonnelCertificateDto> personnelCertificateFiles;
|
||||
|
||||
|
||||
/**
|
||||
* 删除的文件路径
|
||||
*/
|
||||
private List<String> delFiles;
|
||||
|
||||
@Data
|
||||
public static class PersonnelCertificateDto {
|
||||
private PersonnelCertificate personnelCertificate;
|
||||
private ResourceFilePo resourceFilePo;
|
||||
/**
|
||||
* 证书删除的文件路径
|
||||
*/
|
||||
private List<String> delFiles;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询条件限制
|
||||
*/
|
||||
public interface QUERY {
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增条件限制
|
||||
*/
|
||||
public interface ADD {
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改条件限制
|
||||
*/
|
||||
public interface UPDATE {
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除条件限制
|
||||
*/
|
||||
public interface DELETE {
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,117 @@
|
|||
package com.bonus.common.domain.mainDatabase.po;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
/**
|
||||
* 企业人员库表
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class EnterprisePersonnel {
|
||||
/**
|
||||
* 人员id
|
||||
*/
|
||||
private Long personnelId;
|
||||
|
||||
/**
|
||||
* 企业id
|
||||
*/
|
||||
private Long enterpriseId;
|
||||
|
||||
/**
|
||||
* 人员职位(字典表配置)
|
||||
*/
|
||||
private String personnelPosition;
|
||||
|
||||
/**
|
||||
* 人员姓名
|
||||
*/
|
||||
private String personnelName;
|
||||
|
||||
/**
|
||||
* 入职时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private Date employmentDate;
|
||||
|
||||
/**
|
||||
* 从业年限
|
||||
*/
|
||||
private String employmentYears;
|
||||
|
||||
/**
|
||||
* 毕业院校
|
||||
*/
|
||||
private String graduateSchool;
|
||||
|
||||
/**
|
||||
* 毕业专业
|
||||
*/
|
||||
private String graduationMajor;
|
||||
|
||||
/**
|
||||
* 学历
|
||||
*/
|
||||
private String qualification;
|
||||
|
||||
/**
|
||||
* 毕业时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private Date graduationDate;
|
||||
|
||||
/**
|
||||
* 联系方式
|
||||
*/
|
||||
private String personnelPhone;
|
||||
|
||||
/**
|
||||
* 人员简介
|
||||
*/
|
||||
private String personnelIntroduction;
|
||||
|
||||
/**
|
||||
* 是否存在过期证件 0.未过期 1.已过期
|
||||
*/
|
||||
private String expiredState;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private Long createUserId;
|
||||
|
||||
/**
|
||||
* 创建人姓名
|
||||
*/
|
||||
private String createUserName;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
private Long updateUserId;
|
||||
|
||||
/**
|
||||
* 修改人姓名
|
||||
*/
|
||||
private String updateUserName;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
package com.bonus.common.domain.mainDatabase.po;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 人员证书
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class PersonnelCertificate {
|
||||
/**
|
||||
* 人员证书id
|
||||
*/
|
||||
private Long personnelCertificateId;
|
||||
|
||||
/**
|
||||
* 人员id
|
||||
*/
|
||||
private Long personnelId;
|
||||
|
||||
/**
|
||||
* 人员证书类型(字典表配置)
|
||||
*/
|
||||
private String certificateType;
|
||||
|
||||
/**
|
||||
* 专业类型
|
||||
*/
|
||||
private String professionalType;
|
||||
|
||||
/**
|
||||
* 证书编号
|
||||
*/
|
||||
private String certificateCode;
|
||||
|
||||
/**
|
||||
* 级别
|
||||
*/
|
||||
private String certificateLevel;
|
||||
|
||||
/**
|
||||
* 证书有效期
|
||||
*/
|
||||
private String certificateValidityPeriod;
|
||||
|
||||
/**
|
||||
* 使用有效期
|
||||
*/
|
||||
private String useValidityPeriod;
|
||||
|
||||
/**
|
||||
* 注册专业
|
||||
*/
|
||||
private String registerProfessional;
|
||||
|
||||
/**
|
||||
* 职称名称
|
||||
*/
|
||||
private String titleName;
|
||||
|
||||
/**
|
||||
* 专业名称
|
||||
*/
|
||||
private String professionalName;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,75 @@
|
|||
package com.bonus.common.domain.mainDatabase.vo;
|
||||
|
||||
import com.bonus.common.domain.file.po.ResourceFilePo;
|
||||
import com.bonus.common.domain.file.vo.ResourceFileVo;
|
||||
import com.bonus.common.domain.mainDatabase.po.EnterprisePersonnel;
|
||||
import com.bonus.common.domain.mainDatabase.po.PersonnelCertificate;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 企业人员库表
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class EnterprisePersonnelVo {
|
||||
|
||||
|
||||
/**
|
||||
* 人员id
|
||||
*/
|
||||
private Long personnelId;
|
||||
|
||||
/**
|
||||
* 企业id
|
||||
*/
|
||||
private Long enterpriseId;
|
||||
|
||||
/**
|
||||
* 人员职位(字典表配置)
|
||||
*/
|
||||
private String personnelPosition;
|
||||
|
||||
/**
|
||||
* 人员姓名
|
||||
*/
|
||||
private String personnelName;
|
||||
|
||||
/**
|
||||
* 入职时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy/MM/dd", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private Date employmentDate;
|
||||
|
||||
/**
|
||||
* 从业年限
|
||||
*/
|
||||
private String employmentYears;
|
||||
|
||||
/**人员详情*/
|
||||
@Data
|
||||
public static class PersonnelDetailVo {
|
||||
private EnterprisePersonnel enterprisePersonnel;
|
||||
/**人员相关资源文件*/
|
||||
private List<ResourceFileVo> resourceFileVoList;
|
||||
/**人员相关证书*/
|
||||
private List<CertificateDetailVo> certificateDetailList;
|
||||
}
|
||||
|
||||
/**人员证书*/
|
||||
@Data
|
||||
public static class CertificateDetailVo {
|
||||
private PersonnelCertificate certificate;
|
||||
private List<ResourceFileVo> fileVoList;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,54 +1,128 @@
|
|||
package com.bonus.common.utils;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.lang.generator.UUIDGenerator;
|
||||
import com.bonus.common.domain.mainDatabase.po.ErrorInfo;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Objects;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @className:CertificateUtil
|
||||
* @author:cwchen
|
||||
* @date:2025-10-23-10:00
|
||||
* @version:1.0
|
||||
* @description:证书工具类
|
||||
* @className: CertificateUtil
|
||||
* @author: cwchen
|
||||
* @date: 2025-10-23-10:00
|
||||
* @version: 1.0
|
||||
* @description: 证书工具类
|
||||
*/
|
||||
public class CertificateUtil {
|
||||
|
||||
/**
|
||||
* 证书类型与错误信息的映射
|
||||
*/
|
||||
private static final Map<String, String> CERTIFICATE_ERROR_MAP = new HashMap<>();
|
||||
|
||||
static {
|
||||
// 初始化证书类型与错误信息的映射
|
||||
CERTIFICATE_ERROR_MAP.put("national_emblem_id_card", "身份证过期");
|
||||
CERTIFICATE_ERROR_MAP.put("constructor_certificate", "建造师证书过期");
|
||||
CERTIFICATE_ERROR_MAP.put("safety_assessment_certificate_b", "安全考核B证过期");
|
||||
CERTIFICATE_ERROR_MAP.put("safety_assessment_certificate_c", "安全考核C证过期");
|
||||
CERTIFICATE_ERROR_MAP.put("professional_title_certificate", "质检员证过期");
|
||||
CERTIFICATE_ERROR_MAP.put("quality_inspector_certificate", "质检员证过期");
|
||||
CERTIFICATE_ERROR_MAP.put("construction_worker_certificate", "施工员证过期");
|
||||
CERTIFICATE_ERROR_MAP.put("materials_officer_certificate", "材料员证过期");
|
||||
CERTIFICATE_ERROR_MAP.put("mechanic_s_certificate", "机械员证过期");
|
||||
CERTIFICATE_ERROR_MAP.put("cost_engineer_certificate", "造价员证过期");
|
||||
}
|
||||
|
||||
/**
|
||||
* 长期有效的标识
|
||||
*/
|
||||
private static final String[] PERMANENT_INDICATORS = {"长期", "永久"};
|
||||
|
||||
/**
|
||||
* 检查证书是否过期
|
||||
*
|
||||
* @param endDate
|
||||
* @param certificateType
|
||||
* @return ErrorInfo
|
||||
* @param endDate 结束日期
|
||||
* @param certificateType 证书类型
|
||||
* @param businessId 业务ID
|
||||
* @param enterpriseId 企业ID
|
||||
* @return ErrorInfo 错误信息,如果未过期返回null
|
||||
* @author cwchen
|
||||
* @date 2025/10/23 10:02
|
||||
*/
|
||||
public static ErrorInfo checkCertificateState(String endDate, String certificateType, Long businessId, Long enterpriseId) {
|
||||
boolean flag = false;
|
||||
StringBuilder sb = new StringBuilder();
|
||||
switch (certificateType) {
|
||||
case "national_emblem_id_card": // 身份证
|
||||
if(!endDate.contains("长期") || !endDate.contains("永久")){
|
||||
String[] split = endDate.split("-");
|
||||
if(split.length == 2){
|
||||
flag = DateTimeHelper.isExpired(split[1]);
|
||||
}
|
||||
}
|
||||
sb.append("身份证过期");
|
||||
break;
|
||||
}
|
||||
if(!flag){
|
||||
public static ErrorInfo checkCertificateState(String endDate, String certificateType,
|
||||
Long businessId, Long enterpriseId) {
|
||||
// 检查证书是否过期
|
||||
boolean isExpired = isCertificateExpired(endDate, certificateType);
|
||||
|
||||
if (!isExpired) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// 构建错误信息
|
||||
return buildErrorInfo(businessId, enterpriseId, certificateType);
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查证书是否过期
|
||||
*/
|
||||
private static boolean isCertificateExpired(String endDate, String certificateType) {
|
||||
// 处理空值情况
|
||||
if (endDate == null || endDate.trim().isEmpty()) {
|
||||
return true; // 如果日期为空,视为过期
|
||||
}
|
||||
|
||||
// 身份证特殊处理
|
||||
if ("national_emblem_id_card".equals(certificateType)) {
|
||||
return isIdCardExpired(endDate);
|
||||
}
|
||||
|
||||
// 其他证书直接检查过期
|
||||
return DateTimeHelper.isExpired(endDate);
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查身份证是否过期
|
||||
*/
|
||||
private static boolean isIdCardExpired(String endDate) {
|
||||
// 检查是否为长期有效
|
||||
for (String indicator : PERMANENT_INDICATORS) {
|
||||
if (endDate.contains(indicator)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// 处理日期格式:起始日期-结束日期
|
||||
String[] dateParts = endDate.split("-");
|
||||
if (dateParts.length == 2) {
|
||||
return DateTimeHelper.isExpired(dateParts[1]);
|
||||
}
|
||||
|
||||
// 如果格式不符合预期,按普通日期处理
|
||||
return DateTimeHelper.isExpired(endDate);
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建错误信息对象
|
||||
*/
|
||||
private static ErrorInfo buildErrorInfo(Long businessId, Long enterpriseId, String certificateType) {
|
||||
String errorContent = CERTIFICATE_ERROR_MAP.getOrDefault(certificateType, "证书过期");
|
||||
|
||||
ErrorInfo errorInfo = new ErrorInfo();
|
||||
errorInfo.setErrorId(UUID.randomUUID().toString().replace("-", ""));
|
||||
errorInfo.setErrorId(generateErrorId());
|
||||
errorInfo.setBusinessId(businessId);
|
||||
errorInfo.setEnterpriseId(enterpriseId);
|
||||
errorInfo.setErrorTime(new Date());
|
||||
errorInfo.setErrorContent(sb.toString());
|
||||
errorInfo.setErrorContent(errorContent);
|
||||
|
||||
return errorInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成错误ID
|
||||
*/
|
||||
private static String generateErrorId() {
|
||||
return UUID.randomUUID().toString().replace("-", "");
|
||||
}
|
||||
}
|
||||
|
|
@ -57,4 +57,13 @@ public interface ISourceFileMapper {
|
|||
* @date 2025/10/23 13:43
|
||||
*/
|
||||
List<ResourceFileVo> getFilesByTable(@Param("businessId") Long businessId, @Param("dataBaseName") String dataBaseName);
|
||||
|
||||
/**
|
||||
* 删除证书资源文件根据业务id、来源表、业务类型
|
||||
* @param delFiles
|
||||
* @return void
|
||||
* @author cwchen
|
||||
* @date 2025/10/24 11:10
|
||||
*/
|
||||
void delResourceFileBybusinessId(List<ResourceFilePo> delFiles);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -79,4 +79,15 @@ public class SourceFileService {
|
|||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除证书资源文件根据业务id、来源表、业务类型
|
||||
* @param delFiles
|
||||
* @return void
|
||||
* @author cwchen
|
||||
* @date 2025/10/24 11:10
|
||||
*/
|
||||
public void delResourceFileBybusinessId(List<ResourceFilePo> delFiles) {
|
||||
mapper.delResourceFileBybusinessId(delFiles);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,4 +65,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
FROM sys_resource_file
|
||||
WHERE business_id = #{businessId} AND source_table = #{dataBaseName} AND del_flag = '0'
|
||||
</select>
|
||||
|
||||
<!--删除证书资源文件根据业务id、来源表、业务类型-->
|
||||
<update id="delResourceFileBybusinessId">
|
||||
UPDATE sys_resource_file
|
||||
SET del_flag = '1'
|
||||
WHERE EXISTS (
|
||||
SELECT 1 FROM (
|
||||
<foreach collection="list" item="item" separator=" UNION ALL ">
|
||||
SELECT
|
||||
#{item.sourceTable} AS source_table,
|
||||
#{item.businessId} AS business_id,
|
||||
#{item.businessType} AS business_type
|
||||
</foreach>
|
||||
) t
|
||||
WHERE sys_resource_file.source_table = t.source_table
|
||||
AND sys_resource_file.business_id = t.business_id
|
||||
AND sys_resource_file.business_type = t.business_type
|
||||
)
|
||||
</update>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,63 @@
|
|||
package com.bonus.mainDataBase.mapper;
|
||||
|
||||
import com.bonus.common.domain.mainDatabase.dto.EnterprisePersonnelDto;
|
||||
import com.bonus.common.domain.mainDatabase.po.PersonnelCertificate;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @className:IMDCertificateMapper
|
||||
* @author:cwchen
|
||||
* @date:2025-10-24-10:02
|
||||
* @version:1.0
|
||||
* @description:人员证书-数据层
|
||||
*/
|
||||
@Repository(value = "IMDCertificateMapper")
|
||||
public interface IMDCertificateMapper {
|
||||
/**
|
||||
* 添加人员证书
|
||||
* @param list
|
||||
* @return void
|
||||
* @author cwchen
|
||||
* @date 2025/10/24 10:08
|
||||
*/
|
||||
void addCertificateData(List<EnterprisePersonnelDto.PersonnelCertificateDto> list);
|
||||
|
||||
/**
|
||||
* 查询人员职位是否发生了变化,是否导致证书类型也发生了变化
|
||||
* @param list
|
||||
* @return List<PersonnelCertificate>
|
||||
* @author cwchen
|
||||
* @date 2025/10/24 10:46
|
||||
*/
|
||||
List<PersonnelCertificate> getCertificateChange(@Param("list") List<EnterprisePersonnelDto.PersonnelCertificateDto> list,@Param("personnelId") Long personnelId);
|
||||
|
||||
/**
|
||||
* 删除证书
|
||||
* @param list
|
||||
* @return void
|
||||
* @author cwchen
|
||||
* @date 2025/10/24 11:02
|
||||
*/
|
||||
void delCertificate(List<PersonnelCertificate> list);
|
||||
|
||||
/**
|
||||
* 修改人员证书
|
||||
* @param list
|
||||
* @return void
|
||||
* @author cwchen
|
||||
* @date 2025/10/24 11:16
|
||||
*/
|
||||
void editCertificateData(List<EnterprisePersonnelDto.PersonnelCertificateDto> list);
|
||||
|
||||
/**
|
||||
* 查询人员相关证书
|
||||
* @param dto
|
||||
* @return List<PersonnelCertificate>
|
||||
* @author cwchen
|
||||
* @date 2025/10/24 13:12
|
||||
*/
|
||||
List<PersonnelCertificate> getCertificates(EnterprisePersonnelDto dto);
|
||||
}
|
||||
|
|
@ -47,4 +47,13 @@ public interface IMDErrorInfoMapper {
|
|||
* @date 2025/10/23 13:10
|
||||
*/
|
||||
void delErrorByTable(@Param("businessId") Long businessId, @Param("sourceTable") String sourceTable);
|
||||
|
||||
/**
|
||||
* 删除异常信息数据-根据业务id、业务类型、来源表
|
||||
* @param list
|
||||
* @return void
|
||||
* @author cwchen
|
||||
* @date 2025/10/24 12:18
|
||||
*/
|
||||
void delErrorInfoByBusinessId(List<ErrorInfo> list);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,69 @@
|
|||
package com.bonus.mainDataBase.mapper;
|
||||
|
||||
import com.bonus.common.domain.mainDatabase.dto.EnterpriseDto;
|
||||
import com.bonus.common.domain.mainDatabase.dto.EnterprisePersonnelDto;
|
||||
import com.bonus.common.domain.mainDatabase.po.EnterprisePersonnel;
|
||||
import com.bonus.common.domain.mainDatabase.vo.EnterprisePersonnelVo;
|
||||
import com.bonus.common.domain.mainDatabase.vo.EnterpriseVo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @className: IMDPersonnelMapper
|
||||
* @author: cwchen
|
||||
* @date: 2025-10-22-16:25
|
||||
* @version: 1.0
|
||||
* @description: 人员库-数据层
|
||||
*/
|
||||
@Repository(value = "IMDPersonnelMapper")
|
||||
public interface IMDPersonnelMapper {
|
||||
|
||||
/**
|
||||
* 人员库->查询列表
|
||||
*
|
||||
* @param dto
|
||||
* @return List<EnterprisePersonnelVo>
|
||||
* @author cwchen
|
||||
* @date 2025/10/23 17:43
|
||||
*/
|
||||
List<EnterprisePersonnelVo> getList(EnterprisePersonnelDto dto);
|
||||
|
||||
/**
|
||||
* 操作人员库数据
|
||||
* @param dto
|
||||
* @param type 1.新增 2.修改 3.删除
|
||||
* @return void
|
||||
* @author cwchen
|
||||
* @date 2025/10/23 18:19
|
||||
*/
|
||||
void operPersonnelData(@Param("params") EnterprisePersonnelDto dto,@Param("type") int type);
|
||||
|
||||
/**
|
||||
* 人员身份证不能重复
|
||||
* @param dto
|
||||
* @return int
|
||||
* @author cwchen
|
||||
* @date 2025/10/23 18:34
|
||||
*/
|
||||
int isRepeat(EnterprisePersonnelDto dto);
|
||||
|
||||
/**
|
||||
* 判断人员是否被引用
|
||||
* @param dto
|
||||
* @return int
|
||||
* @author cwchen
|
||||
* @date 2025/10/24 13:05
|
||||
*/
|
||||
int getUseNum(EnterprisePersonnelDto dto);
|
||||
|
||||
/**
|
||||
* 查询人员详情
|
||||
* @param dto
|
||||
* @return EnterprisePersonnel
|
||||
* @author cwchen
|
||||
* @date 2025/10/24 13:27
|
||||
*/
|
||||
EnterprisePersonnel getPersonnelData(EnterprisePersonnelDto dto);
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
package com.bonus.mainDataBase.service;
|
||||
|
||||
import com.bonus.common.domain.mainDatabase.dto.EnterprisePersonnelDto;
|
||||
import com.bonus.common.domain.mainDatabase.po.PersonnelCertificate;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @className:IMDCertificateService
|
||||
* @author:cwchen
|
||||
* @date:2025-10-24-10:00
|
||||
* @version:1.0
|
||||
* @description:人员证书-业务层
|
||||
*/
|
||||
public interface IMDCertificateService {
|
||||
/**
|
||||
* 添加人员证书
|
||||
* @param personnelCertificateFiles
|
||||
* @return void
|
||||
* @author cwchen
|
||||
* @date 2025/10/24 10:45
|
||||
*/
|
||||
void addCertificateData(List<EnterprisePersonnelDto.PersonnelCertificateDto> personnelCertificateFiles);
|
||||
|
||||
/**
|
||||
* 查询人员职位是否发生了变化,是否导致证书类型也发生了变化
|
||||
* @param personnelCertificateFiles
|
||||
* @param personnelId
|
||||
* @return List<PersonnelCertificate>
|
||||
* @author cwchen
|
||||
* @date 2025/10/24 10:45
|
||||
*/
|
||||
List<PersonnelCertificate> getCertificateChange(List<EnterprisePersonnelDto.PersonnelCertificateDto> personnelCertificateFiles,Long personnelId);
|
||||
|
||||
/**
|
||||
* 删除证书
|
||||
* @param changeList
|
||||
* @return void
|
||||
* @author cwchen
|
||||
* @date 2025/10/24 11:01
|
||||
*/
|
||||
void delCertificate(List<PersonnelCertificate> changeList);
|
||||
|
||||
/**
|
||||
* 修改人员证书
|
||||
* @param personnelCertificateFiles
|
||||
* @return void
|
||||
* @author cwchen
|
||||
* @date 2025/10/24 11:15
|
||||
*/
|
||||
void editCertificateData(List<EnterprisePersonnelDto.PersonnelCertificateDto> personnelCertificateFiles);
|
||||
|
||||
/**
|
||||
* 查询人员相关证书
|
||||
* @param dto
|
||||
* @return List<PersonnelCertificate>
|
||||
* @author cwchen
|
||||
* @date 2025/10/24 13:11
|
||||
*/
|
||||
List<PersonnelCertificate> getCertificates(EnterprisePersonnelDto dto);
|
||||
}
|
||||
|
|
@ -45,4 +45,13 @@ public interface IMDErrorInfoService {
|
|||
* @date 2025/10/23 13:10
|
||||
*/
|
||||
void delErrorByTable(Long enterpriseId, String tbEnterprise);
|
||||
|
||||
/**
|
||||
* 删除异常信息数据-根据业务id、业务类型、来源表
|
||||
* @param errorInfoList
|
||||
* @return void
|
||||
* @author cwchen
|
||||
* @date 2025/10/24 12:18
|
||||
*/
|
||||
void delErrorInfoByBusinessId(List<ErrorInfo> errorInfoList);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,63 @@
|
|||
package com.bonus.mainDataBase.service;
|
||||
|
||||
import com.bonus.common.domain.mainDatabase.dto.EnterprisePersonnelDto;
|
||||
import com.bonus.common.domain.mainDatabase.po.EnterprisePersonnel;
|
||||
import com.bonus.common.domain.mainDatabase.vo.EnterprisePersonnelVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @className:IMDPersonnelService
|
||||
* @author:cwchen
|
||||
* @date:2025-10-23-17:36
|
||||
* @version:1.0
|
||||
* @description:人员库-具体业务层
|
||||
*/
|
||||
public interface IMDPersonnelService {
|
||||
|
||||
/**
|
||||
* 人员库->查询列表
|
||||
* @param dto
|
||||
* @return List<EnterprisePersonnelVo>
|
||||
* @author cwchen
|
||||
* @date 2025/10/23 17:41
|
||||
*/
|
||||
List<EnterprisePersonnelVo> getList(EnterprisePersonnelDto dto);
|
||||
|
||||
/**
|
||||
* 操作人员库数据
|
||||
* @param dto
|
||||
* @param type
|
||||
* @return void
|
||||
* @author cwchen
|
||||
* @date 2025/10/23 18:18
|
||||
*/
|
||||
void operPersonnelData(EnterprisePersonnelDto dto, int type);
|
||||
|
||||
/**
|
||||
* 人员身份证不能重复
|
||||
* @param dto
|
||||
* @return int
|
||||
* @author cwchen
|
||||
* @date 2025/10/23 18:34
|
||||
*/
|
||||
int isRepeat(EnterprisePersonnelDto dto);
|
||||
|
||||
/**
|
||||
* 判断人员是否被引用
|
||||
* @param dto
|
||||
* @return int
|
||||
* @author cwchen
|
||||
* @date 2025/10/24 13:04
|
||||
*/
|
||||
int getUseNum(EnterprisePersonnelDto dto);
|
||||
|
||||
/**
|
||||
* 查询人员详情
|
||||
* @param dto
|
||||
* @return EnterprisePersonnel
|
||||
* @author cwchen
|
||||
* @date 2025/10/24 13:26
|
||||
*/
|
||||
EnterprisePersonnel getPersonnelData(EnterprisePersonnelDto dto);
|
||||
}
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
package com.bonus.mainDataBase.service.impl;
|
||||
|
||||
import com.bonus.common.domain.mainDatabase.dto.EnterprisePersonnelDto;
|
||||
import com.bonus.common.domain.mainDatabase.po.PersonnelCertificate;
|
||||
import com.bonus.mainDataBase.mapper.IMDCertificateMapper;
|
||||
import com.bonus.mainDataBase.service.IMDCertificateService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* @className:MDCertificateServiceImpl
|
||||
* @author:cwchen
|
||||
* @date:2025-10-24-10:01
|
||||
* @version:1.0
|
||||
* @description:人员证书-业务实现层
|
||||
*/
|
||||
@Service(value = "IMDCertificateService")
|
||||
@Slf4j
|
||||
public class MDCertificateServiceImpl implements IMDCertificateService {
|
||||
|
||||
@Resource(name = "IMDCertificateMapper")
|
||||
private IMDCertificateMapper imdCertificateMapper;
|
||||
|
||||
|
||||
@Override
|
||||
public void addCertificateData(List<EnterprisePersonnelDto.PersonnelCertificateDto> personnelCertificateFiles) {
|
||||
imdCertificateMapper.addCertificateData(personnelCertificateFiles);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PersonnelCertificate> getCertificateChange(List<EnterprisePersonnelDto.PersonnelCertificateDto> personnelCertificateFiles,Long personnelId) {
|
||||
try {
|
||||
return Optional.ofNullable(imdCertificateMapper.getCertificateChange(personnelCertificateFiles,personnelId)).orElse(new ArrayList<>());
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delCertificate(List<PersonnelCertificate> list) {
|
||||
imdCertificateMapper.delCertificate(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void editCertificateData(List<EnterprisePersonnelDto.PersonnelCertificateDto> list) {
|
||||
imdCertificateMapper.editCertificateData(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PersonnelCertificate> getCertificates(EnterprisePersonnelDto dto) {
|
||||
try {
|
||||
return Optional.ofNullable(imdCertificateMapper.getCertificates(dto)).orElse(new ArrayList<>());
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -38,4 +38,9 @@ public class MDErrorInfoServiceImpl implements IMDErrorInfoService {
|
|||
public void delErrorByTable(Long businessId, String sourceTable) {
|
||||
imdErrorInfoMapper.delErrorByTable(businessId,sourceTable);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delErrorInfoByBusinessId(List<ErrorInfo> errorInfoList) {
|
||||
imdErrorInfoMapper.delErrorInfoByBusinessId(errorInfoList);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,77 @@
|
|||
package com.bonus.mainDataBase.service.impl;
|
||||
|
||||
import com.bonus.common.domain.mainDatabase.dto.EnterprisePersonnelDto;
|
||||
import com.bonus.common.domain.mainDatabase.po.EnterprisePersonnel;
|
||||
import com.bonus.common.domain.mainDatabase.vo.EnterprisePersonnelVo;
|
||||
import com.bonus.common.domain.mainDatabase.vo.EnterpriseVo;
|
||||
import com.bonus.mainDataBase.mapper.IMDPersonnelMapper;
|
||||
import com.bonus.mainDataBase.service.IMDPersonnelService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* @className:MDPersonnelServiceImpl
|
||||
* @author:cwchen
|
||||
* @date:2025-10-23-17:37
|
||||
* @version:1.0
|
||||
* @description:人员库-具体业务实现层
|
||||
*/
|
||||
@Service(value = "IMDPersonnelService")
|
||||
@Slf4j
|
||||
public class MDPersonnelServiceImpl implements IMDPersonnelService {
|
||||
|
||||
@Resource(name = "IMDPersonnelMapper")
|
||||
private IMDPersonnelMapper imdPersonnelMapper;
|
||||
|
||||
@Override
|
||||
public List<EnterprisePersonnelVo> getList(EnterprisePersonnelDto dto) {
|
||||
try {
|
||||
List<EnterprisePersonnelVo> list = Optional.ofNullable(imdPersonnelMapper.getList(dto)).orElse(new ArrayList<>());
|
||||
return list;
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
return new ArrayList<>();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void operPersonnelData(EnterprisePersonnelDto dto, int type) {
|
||||
imdPersonnelMapper.operPersonnelData(dto,type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int isRepeat(EnterprisePersonnelDto dto) {
|
||||
try {
|
||||
return Optional.ofNullable(imdPersonnelMapper.isRepeat(dto)).orElse(0);
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getUseNum(EnterprisePersonnelDto dto) {
|
||||
try {
|
||||
return Optional.ofNullable(imdPersonnelMapper.getUseNum(dto)).orElse(0);
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnterprisePersonnel getPersonnelData(EnterprisePersonnelDto dto) {
|
||||
try {
|
||||
return Optional.ofNullable(imdPersonnelMapper.getPersonnelData(dto)).orElse(new EnterprisePersonnel());
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
return new EnterprisePersonnel();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
package com.bonus.mainDataBase.service.impl;
|
||||
|
||||
import com.bonus.common.domain.file.po.ResourceFilePo;
|
||||
import com.bonus.mainDataBase.service.ITestService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @className:TestServiceImpl
|
||||
* @author:cwchen
|
||||
* @date:2025-10-17-16:50
|
||||
* @version:1.0
|
||||
* @description:测试
|
||||
*/
|
||||
@Service(value = "TestService")
|
||||
public class TestServiceImpl implements ITestService {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,80 @@
|
|||
<?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.bonus.mainDataBase.mapper.IMDCertificateMapper">
|
||||
|
||||
<!--添加人员证书-->
|
||||
<insert id="addCertificateData" useGeneratedKeys="true" keyProperty="personnelCertificate.personnelCertificateId" keyColumn="personnel_certificate_id">
|
||||
INSERT INTO tb_personnel_certificate
|
||||
(personnel_id, certificate_type, professional_type, certificate_code, certificate_level,
|
||||
certificate_validity_period,use_validity_period,register_professional,title_name,professional_name)
|
||||
VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
#{item.personnelCertificate.personnelId},
|
||||
#{item.personnelCertificate.certificateType},
|
||||
#{item.personnelCertificate.professionalType},
|
||||
#{item.personnelCertificate.certificateCode},
|
||||
#{item.personnelCertificate.certificateLevel},
|
||||
#{item.personnelCertificate.certificateValidityPeriod},
|
||||
#{item.personnelCertificate.useValidityPeriod},
|
||||
#{item.personnelCertificate.registerProfessional},
|
||||
#{item.personnelCertificate.titleName},
|
||||
#{item.personnelCertificate.professionalName}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<!--查询人员职位是否发生了变化,是否导致证书类型也发生了变化-->
|
||||
<select id="getCertificateChange" resultType="com.bonus.common.domain.mainDatabase.po.PersonnelCertificate">
|
||||
SELECT personnel_certificate_id AS personnelCertificateId,
|
||||
personnel_id AS personnelId,
|
||||
certificate_type AS certificateType
|
||||
FROM tb_personnel_certificate
|
||||
WHERE personnel_id = #{personnelId}
|
||||
AND del_flag = '0'
|
||||
<if test="list != null and list.size() > 0">
|
||||
AND personnel_certificate_id NOT IN
|
||||
<foreach collection="list" item="item" open="(" close=")" separator=",">
|
||||
#{item.personnelCertificate.personnelCertificateId}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!--删除证书-->
|
||||
<update id="delCertificate">
|
||||
UPDATE tb_personnel_certificate SET del_flag = '1' WHERE personnel_certificate_id IN
|
||||
<foreach collection="list" item="item" open="(" close=")" separator=",">
|
||||
#{item.personnelCertificateId}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<!--修改证书-->
|
||||
<update id="editCertificateData">
|
||||
<foreach collection="list" item="item" separator=";">
|
||||
UPDATE tb_personnel_certificate
|
||||
SET
|
||||
certificate_type = #{item.personnelCertificate.certificateType},
|
||||
professional_type = #{item.personnelCertificate.professionalType},
|
||||
certificate_code = #{item.personnelCertificate.certificateCode},
|
||||
certificate_level = #{item.personnelCertificate.certificateLevel},
|
||||
certificate_validity_period = #{item.personnelCertificate.certificateValidityPeriod},
|
||||
use_validity_period = #{item.personnelCertificate.useValidityPeriod},
|
||||
register_professional = #{item.personnelCertificate.registerProfessional},
|
||||
title_name = #{item.personnelCertificate.titleName},
|
||||
professional_name = #{item.personnelCertificate.professionalName}
|
||||
WHERE personnel_certificate_id = #{item.personnelCertificate.personnelCertificateId}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<!--查询人员相关证书-->
|
||||
<select id="getCertificates" resultType="com.bonus.common.domain.mainDatabase.po.PersonnelCertificate">
|
||||
SELECT personnel_certificate_id AS personnelCertificateId,
|
||||
personnel_id AS personnelId,
|
||||
certificate_type AS certificateType
|
||||
FROM tb_personnel_certificate
|
||||
WHERE personnel_id = #{personnelId}
|
||||
AND del_flag = '0'
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -40,4 +40,22 @@
|
|||
<delete id="delErrorByTable">
|
||||
DELETE FROM tb_error_info WHERE business_id = #{businessId} AND source_table = #{sourceTable}
|
||||
</delete>
|
||||
|
||||
<!--删除异常信息数据-根据业务id、业务类型、来源表-->
|
||||
<delete id="delErrorInfoByBusinessId">
|
||||
DELETE FROM tb_error_info
|
||||
WHERE EXISTS (
|
||||
SELECT 1 FROM (
|
||||
<foreach collection="list" item="item" separator=" UNION ALL ">
|
||||
SELECT
|
||||
#{item.businessId} AS business_id,
|
||||
#{item.sourceTable} AS source_table,
|
||||
#{item.businessType} AS business_type
|
||||
</foreach>
|
||||
) t
|
||||
WHERE tb_error_info.business_id = t.business_id
|
||||
AND tb_error_info.source_table = t.source_table
|
||||
AND tb_error_info.business_type = t.business_type
|
||||
)
|
||||
</delete>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,122 @@
|
|||
<?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.bonus.mainDataBase.mapper.IMDPersonnelMapper">
|
||||
|
||||
<!--人员库->查询列表-->
|
||||
<select id="getList" resultType="com.bonus.common.domain.mainDatabase.vo.EnterprisePersonnelVo">
|
||||
SELECT tep.enterprise_id AS enterpriseId,
|
||||
tep.personnel_id AS personnelId,
|
||||
tep.personnel_name AS personnelName,
|
||||
tep.employment_date AS employmentDate,
|
||||
tep.employment_years AS employmentYears,
|
||||
sdd.dict_label AS personnelPosition
|
||||
FROM tb_enterprise_personnel tep
|
||||
LEFT JOIN sys_dict_data sdd ON tep.personnel_position = sdd.dict_value
|
||||
WHERE enterprise_id = #{enterpriseId} AND tep.del_flag = '0'
|
||||
<if test="personnelName!=null and personnelName!=''">
|
||||
AND INSTR(tep.personnel_name,#{personnelName}) > 0
|
||||
</if>
|
||||
<if test="personnelPosition!=null and personnelPosition!=''">
|
||||
AND tep.personnel_position = #{personnelPosition}
|
||||
</if>
|
||||
ORDER BY update_time DESC
|
||||
</select>
|
||||
|
||||
<!--判断主体企业是否被引用-->
|
||||
<select id="getUseNum" resultType="java.lang.Integer">
|
||||
SELECT COUNT(*) AS num FROM tb_enterprise_performance WHERE project_manager = #{personnelId} AND del_flag = '0'
|
||||
</select>
|
||||
|
||||
<!--人员身份证不能重复-->
|
||||
<select id="isRepeat" resultType="java.lang.Integer">
|
||||
<if test="personnelId == null">
|
||||
SELECT COUNT(*) FROM tb_enterprise_personnel WHERE personnel_id_card = #{personnelIdCard} AND del_flag = '0';
|
||||
</if>
|
||||
<if test="personnelId!=null">
|
||||
SELECT COUNT(*) FROM tb_enterprise_personnel WHERE personnel_id_card = #{personnelIdCard} AND del_flag = '0' AND personnel_id !=#{personnelId}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!--操作人员库数据-->
|
||||
<insert id="operPersonnelData" useGeneratedKeys="true" keyProperty="params.personnelId" keyColumn="personnel_id">
|
||||
<if test="type == 1">
|
||||
INSERT INTO tb_enterprise_personnel
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="params.enterpriseId != null">enterprise_id,</if>
|
||||
<if test="params.personnelPosition != null and params.personnelPosition!=''">personnel_position,</if>
|
||||
<if test="params.personnelName != null and params.personnelName!=''">personnel_name,</if>
|
||||
<if test="params.personnelIdCard != null and params.personnelIdCard!=''">personnel_id_card,</if>
|
||||
<if test="params.employmentDate != null">employment_date,</if>
|
||||
<if test="params.employmentYears != null and params.employmentYears!=''">employment_years,</if>
|
||||
<if test="params.graduateSchool != null and params.graduateSchool!=''">graduate_school,</if>
|
||||
<if test="params.graduationMajor != null and params.graduationMajor!=''">graduation_major,</if>
|
||||
<if test="params.qualification != null and params.qualification!=''">qualification,</if>
|
||||
<if test="params.graduationDate != null">graduation_date,</if>
|
||||
<if test="params.personnelPhone != null and params.personnelPhone!=''">personnel_phone,</if>
|
||||
<if test="params.personnelIntroduction != null and params.personnelIntroduction!=''">personnel_introduction,</if>
|
||||
create_user_id,
|
||||
create_user_name,
|
||||
update_user_id,
|
||||
update_user_name
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="params.enterpriseId != null">#{params.enterpriseId},</if>
|
||||
<if test="params.personnelPosition != null and params.personnelPosition!=''">#{params.personnelPosition},</if>
|
||||
<if test="params.personnelName != null and params.personnelName!=''">#{params.personnelName},</if>
|
||||
<if test="params.personnelIdCard != null and params.personnelIdCard!=''">#{params.personnelIdCard},</if>
|
||||
<if test="params.employmentDate != null">#{params.employmentDate},</if>
|
||||
<if test="params.employmentYears != null and params.employmentYears!=''">#{params.employmentYears},</if>
|
||||
<if test="params.graduateSchool != null and params.graduateSchool!=''">#{params.graduateSchool},</if>
|
||||
<if test="params.graduationMajor != null and params.graduationMajor!=''">#{params.graduationMajor},</if>
|
||||
<if test="params.qualification != null and params.qualification!=''">#{params.qualification},</if>
|
||||
<if test="params.graduationDate != null">#{params.graduationDate},</if>
|
||||
<if test="params.personnelPhone != null and params.personnelPhone!=''">#{params.personnelPhone},</if>
|
||||
<if test="params.personnelIntroduction != null and params.personnelIntroduction!=''">#{params.personnelIntroduction},</if>
|
||||
#{params.createUserId},
|
||||
#{params.createUserName},
|
||||
#{params.updateUserId},
|
||||
#{params.updateUserName},
|
||||
</trim>
|
||||
</if>
|
||||
<if test="type == 2">
|
||||
UPDATE tb_enterprise_personnel
|
||||
SET
|
||||
personnel_position = #{params.personnelPosition},
|
||||
personnel_name = #{params.personnelName},
|
||||
personnel_id_card = #{params.personnelIdCard},
|
||||
employment_date = #{params.employmentDate},
|
||||
employment_years = #{params.employmentYears},
|
||||
graduate_school = #{params.graduateSchool},
|
||||
graduation_major = #{params.graduationMajor},
|
||||
qualification = #{params.qualification},
|
||||
graduation_date = #{params.graduationDate},
|
||||
personnel_phone = #{params.personnelPhone},
|
||||
personnel_introduction = #{params.personnelIntroduction}
|
||||
WHERE personnel_id = #{params.personnelId};
|
||||
</if>
|
||||
<if test="type == 3">
|
||||
UPDATE tb_enterprise_personnel SET del_flag = '1' WHERE personnel_id = #{params.personnelId}
|
||||
</if>
|
||||
</insert>
|
||||
|
||||
<!--查询人员详情-->
|
||||
<select id="getPersonnelData" resultType="com.bonus.common.domain.mainDatabase.po.EnterprisePersonnel">
|
||||
SELECT personnel_id AS personnelId,
|
||||
enterprise_id AS enterpriseId,
|
||||
personnel_position AS personnelPosition,
|
||||
personnel_name AS personnelName,
|
||||
personnel_id_card AS personnelIdCard,
|
||||
employment_date AS employmentDate,
|
||||
employment_years AS employmentYears,
|
||||
graduate_school AS graduateSchool,
|
||||
graduation_major AS graduationMajor,
|
||||
qualification AS qualification,
|
||||
graduation_date AS graduationDate,
|
||||
personnel_phone AS personnelPhone,
|
||||
personnel_introduction AS personnelIntroduction
|
||||
FROM tb_enterprise_personnel
|
||||
WHERE personnel_id = #{personnelId}
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue