年龄输入删除,年龄根据身份证号在后台进行计算,资格证书和证书编号非必填,可以有多个
This commit is contained in:
parent
7721c92d35
commit
0f3e0cc0e1
|
|
@ -34,7 +34,12 @@ public enum TableType {
|
||||||
/**
|
/**
|
||||||
* 分包商业绩信息
|
* 分包商业绩信息
|
||||||
*/
|
*/
|
||||||
TB_SUB_PERF("tb_sub_perf", "分包商业绩信息");
|
TB_SUB_PERF("tb_sub_perf", "分包商业绩信息"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 资格证书
|
||||||
|
*/
|
||||||
|
TB_CERTIFICATION("tb_certification", "资格证书");
|
||||||
|
|
||||||
private final String code;
|
private final String code;
|
||||||
private final String info;
|
private final String info;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,9 @@
|
||||||
package com.bonus.common.utils;
|
package com.bonus.common.utils;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.Period;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
|
import java.time.format.DateTimeParseException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
|
@ -707,4 +711,47 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
|
||||||
}
|
}
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据身份证号码计算年龄
|
||||||
|
* @param idCard 身份证号码(15位或18位)
|
||||||
|
* @return 年龄(周岁),若身份证格式错误返回 -1
|
||||||
|
*/
|
||||||
|
public static int calculateAge(String idCard) {
|
||||||
|
if (idCard == null || idCard.isEmpty()) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 去除空格
|
||||||
|
idCard = idCard.trim();
|
||||||
|
|
||||||
|
try {
|
||||||
|
LocalDate birthDate;
|
||||||
|
if (idCard.length() == 18) {
|
||||||
|
// 18位身份证:提取 YYYYMMDD
|
||||||
|
String birthStr = idCard.substring(6, 14);
|
||||||
|
birthDate = LocalDate.parse(birthStr, DateTimeFormatter.BASIC_ISO_DATE);
|
||||||
|
} else if (idCard.length() == 15) {
|
||||||
|
// 15位身份证:提取 YYMMDD,补全为 19YYMMDD
|
||||||
|
String birthStr = "19" + idCard.substring(6, 12);
|
||||||
|
birthDate = LocalDate.parse(birthStr, DateTimeFormatter.BASIC_ISO_DATE);
|
||||||
|
} else {
|
||||||
|
return -1; // 长度错误
|
||||||
|
}
|
||||||
|
|
||||||
|
// 计算当前日期与出生日期的差值
|
||||||
|
LocalDate now = LocalDate.now();
|
||||||
|
Period period = Period.between(birthDate, now);
|
||||||
|
|
||||||
|
// 若还未到今年生日,年龄减1
|
||||||
|
int age = period.getYears();
|
||||||
|
if (now.isBefore(birthDate.withYear(now.getYear()))) {
|
||||||
|
age--;
|
||||||
|
}
|
||||||
|
|
||||||
|
return Math.max(age, 0); // 防止负数(如未来日期)
|
||||||
|
} catch (DateTimeParseException | IndexOutOfBoundsException e) {
|
||||||
|
return -1; // 解析错误
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -0,0 +1,50 @@
|
||||||
|
package com.bonus.tool.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 资格证书
|
||||||
|
* @author 马三炮
|
||||||
|
* @date 2025/6/3
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class TbCertificationVo {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键id
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 表名称(每个主表的表名称)
|
||||||
|
*/
|
||||||
|
private String tableName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 资源表id
|
||||||
|
*/
|
||||||
|
private Long tableId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 资格证书
|
||||||
|
*/
|
||||||
|
private String diploma;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 证书编号
|
||||||
|
*/
|
||||||
|
private String diplomaNum;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 级别
|
||||||
|
*/
|
||||||
|
private String level;
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 附件集合
|
||||||
|
*/
|
||||||
|
private List<TbFileSourceVo> tbFileSourceVoList;
|
||||||
|
}
|
||||||
|
|
@ -117,6 +117,11 @@ public class TbKeyPeopleVo {
|
||||||
*/
|
*/
|
||||||
private String updateUser;
|
private String updateUser;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*资格证书集合
|
||||||
|
*/
|
||||||
|
private List<TbCertificationVo> certificateList;
|
||||||
|
|
||||||
/***
|
/***
|
||||||
* 附件集合
|
* 附件集合
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -105,6 +105,11 @@ public class TbOtherPeopleVo {
|
||||||
*/
|
*/
|
||||||
private String updateUser;
|
private String updateUser;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*资格证书集合
|
||||||
|
*/
|
||||||
|
private List<TbCertificationVo> certificateList;
|
||||||
|
|
||||||
/***
|
/***
|
||||||
* 附件集合
|
* 附件集合
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
package com.bonus.tool.mapper;
|
||||||
|
|
||||||
|
import com.bonus.tool.dto.TbCertificationVo;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface TbCertificationMapper {
|
||||||
|
/**
|
||||||
|
* 新增资格证书
|
||||||
|
* @param tbCertificationVo
|
||||||
|
*/
|
||||||
|
void addTbCertification(TbCertificationVo tbCertificationVo);
|
||||||
|
|
||||||
|
List<TbCertificationVo> getTbCertificateList(@Param("tableId") Long tableId, @Param("tableName")String tableName);
|
||||||
|
|
||||||
|
void delTbCertification(@Param("tableId") Long tableId, @Param("tableName")String tableName);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,31 @@
|
||||||
|
package com.bonus.tool.service;
|
||||||
|
|
||||||
|
import com.bonus.tool.dto.TbCertificationVo;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface TbCertificationService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增资格证书
|
||||||
|
* @param certificateList
|
||||||
|
* @param tableId
|
||||||
|
* @param tableName
|
||||||
|
*/
|
||||||
|
void addTbCertification(List<TbCertificationVo> certificateList, Long tableId, String tableName);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取资格证书列表
|
||||||
|
* @param tableId
|
||||||
|
* @param tableName
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<TbCertificationVo> getTbCertificateList(Long tableId, String tableName);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除资格证书
|
||||||
|
* @param tableId
|
||||||
|
* @param tableName
|
||||||
|
*/
|
||||||
|
void delTbCertification(Long tableId, String tableName);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,98 @@
|
||||||
|
package com.bonus.tool.service.impl;
|
||||||
|
|
||||||
|
import com.bonus.common.enums.TableType;
|
||||||
|
import com.bonus.common.utils.SecurityUtils;
|
||||||
|
import com.bonus.system.service.ISysFileService;
|
||||||
|
import com.bonus.tool.dto.TbCertificationVo;
|
||||||
|
import com.bonus.tool.dto.TbFileSourceVo;
|
||||||
|
import com.bonus.tool.mapper.TbCertificationMapper;
|
||||||
|
import com.bonus.tool.service.TbCertificationService;
|
||||||
|
import com.bonus.tool.service.TbFileSourceService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author 马三炮
|
||||||
|
* @date 2025/6/3
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Slf4j
|
||||||
|
public class TbCertificationServiceImpl implements TbCertificationService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private TbCertificationMapper tbCertificationMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private TbFileSourceService tbFileSourceService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ISysFileService iSysFileService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增资格证书
|
||||||
|
* @param certificateList
|
||||||
|
* @param tableId
|
||||||
|
* @param tableName
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void addTbCertification(List<TbCertificationVo> certificateList, Long tableId, String tableName) {
|
||||||
|
if (certificateList!=null){
|
||||||
|
for (TbCertificationVo tbCertificationVo:certificateList) {
|
||||||
|
tbCertificationVo.setTableId(tableId);
|
||||||
|
tbCertificationVo.setTableName(tableName);
|
||||||
|
tbCertificationMapper.addTbCertification(tbCertificationVo);
|
||||||
|
//新增附件信息
|
||||||
|
tbFileSourceService.addTbFileSource(tbCertificationVo.getTbFileSourceVoList(),tbCertificationVo.getId(), TableType.TB_CERTIFICATION.getCode());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取资格证书列表
|
||||||
|
* @param tableId
|
||||||
|
* @param tableName
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<TbCertificationVo> getTbCertificateList(Long tableId, String tableName) {
|
||||||
|
List<TbCertificationVo> TbCertificationVoList = tbCertificationMapper.getTbCertificateList(tableId,tableName);
|
||||||
|
for (TbCertificationVo tbCertificationVo: TbCertificationVoList) {
|
||||||
|
//获取人员附件
|
||||||
|
List<TbFileSourceVo> tbFileSourceVoList = tbFileSourceService.getTbFileSourceList(tbCertificationVo.getId(),TableType.TB_CERTIFICATION.getCode());
|
||||||
|
tbCertificationVo.setTbFileSourceVoList(tbFileSourceVoList);
|
||||||
|
}
|
||||||
|
return TbCertificationVoList;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除资格证书
|
||||||
|
* @param tableId
|
||||||
|
* @param tableName
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void delTbCertification(Long tableId, String tableName) {
|
||||||
|
|
||||||
|
List<TbCertificationVo> TbCertificationVoList = tbCertificationMapper.getTbCertificateList(tableId,tableName);
|
||||||
|
for (TbCertificationVo tbCertificationVo: TbCertificationVoList) {
|
||||||
|
//获取人员附件
|
||||||
|
List<TbFileSourceVo> tbFileSourceVoList = tbFileSourceService.getTbFileSourceList(tbCertificationVo.getId(),TableType.TB_CERTIFICATION.getCode());
|
||||||
|
//删除服务器图片
|
||||||
|
if (tbFileSourceVoList.size()>0){
|
||||||
|
for (TbFileSourceVo TbFileSource:tbFileSourceVoList) {
|
||||||
|
try {
|
||||||
|
iSysFileService.deleteFile(TbFileSource.getFilePath());
|
||||||
|
}catch (Exception e){
|
||||||
|
log.error("删除照片失败!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//删除附件信息表中信息
|
||||||
|
tbFileSourceService.delTbFileSource(tbCertificationVo.getId(),TableType.TB_KEY_PEOPLE.getCode());
|
||||||
|
}
|
||||||
|
tbCertificationMapper.delTbCertification(tableId,tableName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -6,14 +6,12 @@ import com.bonus.common.exception.ServiceException;
|
||||||
import com.bonus.common.utils.SecurityUtils;
|
import com.bonus.common.utils.SecurityUtils;
|
||||||
import com.bonus.common.utils.StringUtils;
|
import com.bonus.common.utils.StringUtils;
|
||||||
import com.bonus.system.service.ISysFileService;
|
import com.bonus.system.service.ISysFileService;
|
||||||
import com.bonus.tool.dto.ComCorePersonBean;
|
import com.bonus.tool.dto.*;
|
||||||
import com.bonus.tool.dto.TbCompanyPerfRelVo;
|
|
||||||
import com.bonus.tool.dto.TbKeyPeopleVo;
|
|
||||||
import com.bonus.tool.dto.TbFileSourceVo;
|
|
||||||
import com.bonus.tool.mapper.EpcMapper;
|
import com.bonus.tool.mapper.EpcMapper;
|
||||||
import com.bonus.tool.mapper.SouthMapper;
|
import com.bonus.tool.mapper.SouthMapper;
|
||||||
import com.bonus.tool.mapper.StateGridMapper;
|
import com.bonus.tool.mapper.StateGridMapper;
|
||||||
import com.bonus.tool.mapper.TbKeyPeopleMapper;
|
import com.bonus.tool.mapper.TbKeyPeopleMapper;
|
||||||
|
import com.bonus.tool.service.TbCertificationService;
|
||||||
import com.bonus.tool.service.TbCompanyPerfRelService;
|
import com.bonus.tool.service.TbCompanyPerfRelService;
|
||||||
import com.bonus.tool.service.TbFileSourceService;
|
import com.bonus.tool.service.TbFileSourceService;
|
||||||
import com.bonus.tool.service.TbKeyPeopleServcie;
|
import com.bonus.tool.service.TbKeyPeopleServcie;
|
||||||
|
|
@ -55,6 +53,9 @@ public class TbKeyPeopleServiceImpl implements TbKeyPeopleServcie {
|
||||||
@Resource
|
@Resource
|
||||||
private SouthMapper southMapper;
|
private SouthMapper southMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private TbCertificationService tbCertificationService;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 关键人员列表
|
* 关键人员列表
|
||||||
|
|
@ -67,6 +68,9 @@ public class TbKeyPeopleServiceImpl implements TbKeyPeopleServcie {
|
||||||
List<TbKeyPeopleVo> tbKeyPeopleVoList = tbKeyPeopleMapper.getTbKeyPeopleList(tbKeyPeopleVo);
|
List<TbKeyPeopleVo> tbKeyPeopleVoList = tbKeyPeopleMapper.getTbKeyPeopleList(tbKeyPeopleVo);
|
||||||
if (tbKeyPeopleVoList.size()>0){
|
if (tbKeyPeopleVoList.size()>0){
|
||||||
for (TbKeyPeopleVo tbKeyPeople: tbKeyPeopleVoList) {
|
for (TbKeyPeopleVo tbKeyPeople: tbKeyPeopleVoList) {
|
||||||
|
//获取资格证书信息
|
||||||
|
List<TbCertificationVo> certificateList = tbCertificationService.getTbCertificateList(tbKeyPeople.getId(),TableType.TB_KEY_PEOPLE.getCode());
|
||||||
|
tbKeyPeople.setCertificateList(certificateList);
|
||||||
//获取人员附件
|
//获取人员附件
|
||||||
List<TbFileSourceVo> tbFileSourceVoList = tbFileSourceService.getTbFileSourceList(tbKeyPeople.getId(),TableType.TB_KEY_PEOPLE.getCode());
|
List<TbFileSourceVo> tbFileSourceVoList = tbFileSourceService.getTbFileSourceList(tbKeyPeople.getId(),TableType.TB_KEY_PEOPLE.getCode());
|
||||||
tbKeyPeople.setTbFileSourceVoList(tbFileSourceVoList);
|
tbKeyPeople.setTbFileSourceVoList(tbFileSourceVoList);
|
||||||
|
|
@ -84,6 +88,9 @@ public class TbKeyPeopleServiceImpl implements TbKeyPeopleServcie {
|
||||||
public TbKeyPeopleVo getTbKeyPeopleById(TbKeyPeopleVo tbKeyPeopleVo) {
|
public TbKeyPeopleVo getTbKeyPeopleById(TbKeyPeopleVo tbKeyPeopleVo) {
|
||||||
|
|
||||||
TbKeyPeopleVo tbKeyPeople = tbKeyPeopleMapper.getTbKeyPeopleById(tbKeyPeopleVo);
|
TbKeyPeopleVo tbKeyPeople = tbKeyPeopleMapper.getTbKeyPeopleById(tbKeyPeopleVo);
|
||||||
|
//获取资格证书信息
|
||||||
|
List<TbCertificationVo> certificateList = tbCertificationService.getTbCertificateList(tbKeyPeople.getId(),TableType.TB_KEY_PEOPLE.getCode());
|
||||||
|
tbKeyPeople.setCertificateList(certificateList);
|
||||||
//获取人员附件
|
//获取人员附件
|
||||||
List<TbFileSourceVo> tbFileSourceVoList = tbFileSourceService.getTbFileSourceList(tbKeyPeople.getId(),TableType.TB_KEY_PEOPLE.getCode());
|
List<TbFileSourceVo> tbFileSourceVoList = tbFileSourceService.getTbFileSourceList(tbKeyPeople.getId(),TableType.TB_KEY_PEOPLE.getCode());
|
||||||
tbKeyPeople.setTbFileSourceVoList(tbFileSourceVoList);
|
tbKeyPeople.setTbFileSourceVoList(tbFileSourceVoList);
|
||||||
|
|
@ -104,8 +111,13 @@ public class TbKeyPeopleServiceImpl implements TbKeyPeopleServcie {
|
||||||
}
|
}
|
||||||
tbKeyPeopleVo.setCreateUser(SecurityUtils.getLoginUser().getUsername());
|
tbKeyPeopleVo.setCreateUser(SecurityUtils.getLoginUser().getUsername());
|
||||||
tbKeyPeopleVo.setCreateTime(new Date());
|
tbKeyPeopleVo.setCreateTime(new Date());
|
||||||
|
tbKeyPeopleVo.setAge(String.valueOf(StringUtils.calculateAge(tbKeyPeopleVo.getIdCard())));
|
||||||
log.info("对象信息{}",tbKeyPeopleVo);
|
log.info("对象信息{}",tbKeyPeopleVo);
|
||||||
|
//新增关键人员
|
||||||
tbKeyPeopleMapper.addTbKeyPeople(tbKeyPeopleVo);
|
tbKeyPeopleMapper.addTbKeyPeople(tbKeyPeopleVo);
|
||||||
|
//新增资格证书
|
||||||
|
tbCertificationService.addTbCertification(tbKeyPeopleVo.getCertificateList(),tbKeyPeopleVo.getId(), TableType.TB_KEY_PEOPLE.getCode());
|
||||||
|
//新增附件信息
|
||||||
tbFileSourceService.addTbFileSource(tbKeyPeopleVo.getTbFileSourceVoList(),tbKeyPeopleVo.getId(), TableType.TB_KEY_PEOPLE.getCode());
|
tbFileSourceService.addTbFileSource(tbKeyPeopleVo.getTbFileSourceVoList(),tbKeyPeopleVo.getId(), TableType.TB_KEY_PEOPLE.getCode());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -121,7 +133,12 @@ public class TbKeyPeopleServiceImpl implements TbKeyPeopleServcie {
|
||||||
throw new ServiceException("身份证已存在");
|
throw new ServiceException("身份证已存在");
|
||||||
}
|
}
|
||||||
tbKeyPeopleVo.setUpdateUser(SecurityUtils.getLoginUser().getUsername());
|
tbKeyPeopleVo.setUpdateUser(SecurityUtils.getLoginUser().getUsername());
|
||||||
|
tbKeyPeopleVo.setAge(String.valueOf(StringUtils.calculateAge(tbKeyPeopleVo.getIdCard())));
|
||||||
tbKeyPeopleMapper.updateTbKeyPeople(tbKeyPeopleVo);
|
tbKeyPeopleMapper.updateTbKeyPeople(tbKeyPeopleVo);
|
||||||
|
//先删后增资格证书信息
|
||||||
|
tbCertificationService.delTbCertification(tbKeyPeopleVo.getId(),TableType.TB_KEY_PEOPLE.getCode());
|
||||||
|
tbCertificationService.addTbCertification(tbKeyPeopleVo.getCertificateList(),tbKeyPeopleVo.getId(), TableType.TB_KEY_PEOPLE.getCode());
|
||||||
|
//先删后增附件信息
|
||||||
tbFileSourceService.delTbFileSource(tbKeyPeopleVo.getId(),TableType.TB_KEY_PEOPLE.getCode());
|
tbFileSourceService.delTbFileSource(tbKeyPeopleVo.getId(),TableType.TB_KEY_PEOPLE.getCode());
|
||||||
tbFileSourceService.addTbFileSource(tbKeyPeopleVo.getTbFileSourceVoList(),tbKeyPeopleVo.getId(),TableType.TB_KEY_PEOPLE.getCode());
|
tbFileSourceService.addTbFileSource(tbKeyPeopleVo.getTbFileSourceVoList(),tbKeyPeopleVo.getId(),TableType.TB_KEY_PEOPLE.getCode());
|
||||||
}
|
}
|
||||||
|
|
@ -156,6 +173,8 @@ public class TbKeyPeopleServiceImpl implements TbKeyPeopleServcie {
|
||||||
throw new ServiceException("关键人员已绑定南网模板");
|
throw new ServiceException("关键人员已绑定南网模板");
|
||||||
}
|
}
|
||||||
tbKeyPeopleMapper.delTbKeyPeople(tbKeyPeopleVo);
|
tbKeyPeopleMapper.delTbKeyPeople(tbKeyPeopleVo);
|
||||||
|
//删除资格证书信息
|
||||||
|
tbCertificationService.delTbCertification(tbKeyPeopleVo.getId(),TableType.TB_KEY_PEOPLE.getCode());
|
||||||
//获取人员附件
|
//获取人员附件
|
||||||
List<TbFileSourceVo> tbFileSourceVoList = tbFileSourceService.getTbFileSourceList(tbKeyPeopleVo.getId(),TableType.TB_KEY_PEOPLE.getCode());
|
List<TbFileSourceVo> tbFileSourceVoList = tbFileSourceService.getTbFileSourceList(tbKeyPeopleVo.getId(),TableType.TB_KEY_PEOPLE.getCode());
|
||||||
//删除服务器图片
|
//删除服务器图片
|
||||||
|
|
|
||||||
|
|
@ -5,14 +5,12 @@ import com.bonus.common.exception.ServiceException;
|
||||||
import com.bonus.common.utils.SecurityUtils;
|
import com.bonus.common.utils.SecurityUtils;
|
||||||
import com.bonus.common.utils.StringUtils;
|
import com.bonus.common.utils.StringUtils;
|
||||||
import com.bonus.system.service.ISysFileService;
|
import com.bonus.system.service.ISysFileService;
|
||||||
import com.bonus.tool.dto.ComCorePersonBean;
|
import com.bonus.tool.dto.*;
|
||||||
import com.bonus.tool.dto.ComOtherPersonBean;
|
|
||||||
import com.bonus.tool.dto.TbFileSourceVo;
|
|
||||||
import com.bonus.tool.dto.TbOtherPeopleVo;
|
|
||||||
import com.bonus.tool.mapper.EpcMapper;
|
import com.bonus.tool.mapper.EpcMapper;
|
||||||
import com.bonus.tool.mapper.SouthMapper;
|
import com.bonus.tool.mapper.SouthMapper;
|
||||||
import com.bonus.tool.mapper.StateGridMapper;
|
import com.bonus.tool.mapper.StateGridMapper;
|
||||||
import com.bonus.tool.mapper.TbOtherPeopleMapper;
|
import com.bonus.tool.mapper.TbOtherPeopleMapper;
|
||||||
|
import com.bonus.tool.service.TbCertificationService;
|
||||||
import com.bonus.tool.service.TbFileSourceService;
|
import com.bonus.tool.service.TbFileSourceService;
|
||||||
import com.bonus.tool.service.TbOtherPeopleService;
|
import com.bonus.tool.service.TbOtherPeopleService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
@ -50,6 +48,11 @@ public class TbOtherPeopleServiceImpl implements TbOtherPeopleService {
|
||||||
@Resource
|
@Resource
|
||||||
private SouthMapper southMapper;
|
private SouthMapper southMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private TbCertificationService tbCertificationService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 其他人员列表查询
|
* 其他人员列表查询
|
||||||
* @param
|
* @param
|
||||||
|
|
@ -61,6 +64,9 @@ public class TbOtherPeopleServiceImpl implements TbOtherPeopleService {
|
||||||
List<TbOtherPeopleVo> tbOtherPeopleVoList = tbOtherPeopleMapper.getTbOtherPeopleList(tbOtherPeopleVo);
|
List<TbOtherPeopleVo> tbOtherPeopleVoList = tbOtherPeopleMapper.getTbOtherPeopleList(tbOtherPeopleVo);
|
||||||
if (tbOtherPeopleVoList.size()>0){
|
if (tbOtherPeopleVoList.size()>0){
|
||||||
for (TbOtherPeopleVo tbOtherPeople: tbOtherPeopleVoList) {
|
for (TbOtherPeopleVo tbOtherPeople: tbOtherPeopleVoList) {
|
||||||
|
//获取资格证书信息
|
||||||
|
List<TbCertificationVo> certificateList = tbCertificationService.getTbCertificateList(tbOtherPeople.getId(),TableType.TB_OTHER_PEOPLE.getCode());
|
||||||
|
tbOtherPeople.setCertificateList(certificateList);
|
||||||
//获取人员附件
|
//获取人员附件
|
||||||
List<TbFileSourceVo> tbFileSourceVoList = tbFileSourceService.getTbFileSourceList(tbOtherPeople.getId(), TableType.TB_OTHER_PEOPLE.getCode());
|
List<TbFileSourceVo> tbFileSourceVoList = tbFileSourceService.getTbFileSourceList(tbOtherPeople.getId(), TableType.TB_OTHER_PEOPLE.getCode());
|
||||||
tbOtherPeople.setTbFileSourceVoList(tbFileSourceVoList);
|
tbOtherPeople.setTbFileSourceVoList(tbFileSourceVoList);
|
||||||
|
|
@ -77,6 +83,9 @@ public class TbOtherPeopleServiceImpl implements TbOtherPeopleService {
|
||||||
@Override
|
@Override
|
||||||
public TbOtherPeopleVo getTbOtherPeopleById(TbOtherPeopleVo tbOtherPeopleVo) {
|
public TbOtherPeopleVo getTbOtherPeopleById(TbOtherPeopleVo tbOtherPeopleVo) {
|
||||||
TbOtherPeopleVo tbOtherPeople = tbOtherPeopleMapper.getTbOtherPeopleById(tbOtherPeopleVo);
|
TbOtherPeopleVo tbOtherPeople = tbOtherPeopleMapper.getTbOtherPeopleById(tbOtherPeopleVo);
|
||||||
|
//获取资格证书信息
|
||||||
|
List<TbCertificationVo> certificateList = tbCertificationService.getTbCertificateList(tbOtherPeople.getId(),TableType.TB_OTHER_PEOPLE.getCode());
|
||||||
|
tbOtherPeople.setCertificateList(certificateList);
|
||||||
//获取人员附件
|
//获取人员附件
|
||||||
List<TbFileSourceVo> tbFileSourceVoList = tbFileSourceService.getTbFileSourceList(tbOtherPeople.getId(),TableType.TB_OTHER_PEOPLE.getCode());
|
List<TbFileSourceVo> tbFileSourceVoList = tbFileSourceService.getTbFileSourceList(tbOtherPeople.getId(),TableType.TB_OTHER_PEOPLE.getCode());
|
||||||
tbOtherPeople.setTbFileSourceVoList(tbFileSourceVoList);
|
tbOtherPeople.setTbFileSourceVoList(tbFileSourceVoList);
|
||||||
|
|
@ -98,6 +107,8 @@ public class TbOtherPeopleServiceImpl implements TbOtherPeopleService {
|
||||||
tbOtherPeopleVo.setCreateUser(SecurityUtils.getLoginUser().getUsername());
|
tbOtherPeopleVo.setCreateUser(SecurityUtils.getLoginUser().getUsername());
|
||||||
tbOtherPeopleVo.setCreateTime(new Date());
|
tbOtherPeopleVo.setCreateTime(new Date());
|
||||||
tbOtherPeopleMapper.addTbOtherPeople(tbOtherPeopleVo);
|
tbOtherPeopleMapper.addTbOtherPeople(tbOtherPeopleVo);
|
||||||
|
//新增资格证书
|
||||||
|
tbCertificationService.addTbCertification(tbOtherPeopleVo.getCertificateList(),tbOtherPeopleVo.getId(), TableType.TB_OTHER_PEOPLE.getCode());
|
||||||
tbFileSourceService.addTbFileSource(tbOtherPeopleVo.getTbFileSourceVoList(),tbOtherPeopleVo.getId(), TableType.TB_OTHER_PEOPLE.getCode());
|
tbFileSourceService.addTbFileSource(tbOtherPeopleVo.getTbFileSourceVoList(),tbOtherPeopleVo.getId(), TableType.TB_OTHER_PEOPLE.getCode());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -116,6 +127,9 @@ public class TbOtherPeopleServiceImpl implements TbOtherPeopleService {
|
||||||
}
|
}
|
||||||
tbOtherPeopleVo.setUpdateUser(SecurityUtils.getLoginUser().getUsername());
|
tbOtherPeopleVo.setUpdateUser(SecurityUtils.getLoginUser().getUsername());
|
||||||
tbOtherPeopleMapper.updateTbOtherPeople(tbOtherPeopleVo);
|
tbOtherPeopleMapper.updateTbOtherPeople(tbOtherPeopleVo);
|
||||||
|
//先删后增资格证书信息
|
||||||
|
tbCertificationService.delTbCertification(tbOtherPeopleVo.getId(),TableType.TB_OTHER_PEOPLE.getCode());
|
||||||
|
tbCertificationService.addTbCertification(tbOtherPeopleVo.getCertificateList(),tbOtherPeopleVo.getId(), TableType.TB_OTHER_PEOPLE.getCode());
|
||||||
tbFileSourceService.delTbFileSource(tbOtherPeopleVo.getId(),TableType.TB_OTHER_PEOPLE.getCode());
|
tbFileSourceService.delTbFileSource(tbOtherPeopleVo.getId(),TableType.TB_OTHER_PEOPLE.getCode());
|
||||||
tbFileSourceService.addTbFileSource(tbOtherPeopleVo.getTbFileSourceVoList(),tbOtherPeopleVo.getId(),TableType.TB_OTHER_PEOPLE.getCode());
|
tbFileSourceService.addTbFileSource(tbOtherPeopleVo.getTbFileSourceVoList(),tbOtherPeopleVo.getId(),TableType.TB_OTHER_PEOPLE.getCode());
|
||||||
|
|
||||||
|
|
@ -147,6 +161,8 @@ public class TbOtherPeopleServiceImpl implements TbOtherPeopleService {
|
||||||
throw new ServiceException("关键人员已绑定南网模板");
|
throw new ServiceException("关键人员已绑定南网模板");
|
||||||
}
|
}
|
||||||
tbOtherPeopleMapper.delTbOtherPeople(tbOtherPeopleVo);
|
tbOtherPeopleMapper.delTbOtherPeople(tbOtherPeopleVo);
|
||||||
|
//删除资格证书信息
|
||||||
|
tbCertificationService.delTbCertification(tbOtherPeopleVo.getId(),TableType.TB_OTHER_PEOPLE.getCode());
|
||||||
//获取人员附件
|
//获取人员附件
|
||||||
List<TbFileSourceVo> tbFileSourceVoList = tbFileSourceService.getTbFileSourceList(tbOtherPeopleVo.getId(),TableType.TB_OTHER_PEOPLE.getCode());
|
List<TbFileSourceVo> tbFileSourceVoList = tbFileSourceService.getTbFileSourceList(tbOtherPeopleVo.getId(),TableType.TB_OTHER_PEOPLE.getCode());
|
||||||
//删除服务器图片
|
//删除服务器图片
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,33 @@
|
||||||
|
<?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.tool.mapper.TbCertificationMapper">
|
||||||
|
|
||||||
|
<insert id="addTbCertification" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
insert into tb_certification
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="tableName != null and tableName != ''">table_name,</if>
|
||||||
|
<if test="tableId != null and tableId != ''">table_id,</if>
|
||||||
|
<if test="diploma != null and diploma != ''">diploma,</if>
|
||||||
|
<if test="diplomaNum != null and diplomaNum != ''">diploma_num,</if>
|
||||||
|
<if test="level != null and level != ''">level,</if>
|
||||||
|
del_flag
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="tableName != null and tableName != ''">#{tableName},</if>
|
||||||
|
<if test="tableId != null and tableId != ''">#{tableId},</if>
|
||||||
|
<if test="diploma != null and diploma != ''">#{diploma},</if>
|
||||||
|
<if test="diplomaNum != null and diplomaNum != ''">#{diplomaNum},</if>
|
||||||
|
<if test="level != null and level != ''">#{level},</if>
|
||||||
|
0
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
<delete id="delTbCertification">
|
||||||
|
update tb_certification set del_flag=1 where table_id = #{tableId} and table_name = #{tableName}
|
||||||
|
</delete>
|
||||||
|
<select id="getTbCertificateList" resultType="com.bonus.tool.dto.TbCertificationVo">
|
||||||
|
select id,table_name as tableName,table_id as tableId,diploma as diploma,diploma_num as diplomaNum,
|
||||||
|
level as level
|
||||||
|
from tb_certification where del_flag=0 and table_name = #{tableName} and table_id = #{tableId}
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
Loading…
Reference in New Issue