年龄输入删除,年龄根据身份证号在后台进行计算,资格证书和证书编号非必填,可以有多个

This commit is contained in:
马三炮 2025-06-03 16:53:13 +08:00
parent 7721c92d35
commit 0f3e0cc0e1
11 changed files with 367 additions and 40 deletions

View File

@ -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 info;

View File

@ -1,5 +1,9 @@
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.Collection;
import java.util.HashSet;
@ -12,7 +16,7 @@ import com.bonus.common.core.text.StrFormatter;
/**
* 字符串工具类
*
*
* @author ruoyi
*/
public class StringUtils extends org.apache.commons.lang3.StringUtils
@ -28,7 +32,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
/**
* 获取参数不为空值
*
*
* @param value defaultValue 要判断的value
* @return value 返回值
*/
@ -39,7 +43,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
/**
* * 判断一个Collection是否为空 包含ListSetQueue
*
*
* @param coll 要判断的Collection
* @return true为空 false非空
*/
@ -50,7 +54,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
/**
* * 判断一个Collection是否非空包含ListSetQueue
*
*
* @param coll 要判断的Collection
* @return true非空 false
*/
@ -61,7 +65,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
/**
* * 判断一个对象数组是否为空
*
*
* @param objects 要判断的对象数组
** @return true为空 false非空
*/
@ -72,7 +76,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
/**
* * 判断一个对象数组是否非空
*
*
* @param objects 要判断的对象数组
* @return true非空 false
*/
@ -83,7 +87,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
/**
* * 判断一个Map是否为空
*
*
* @param map 要判断的Map
* @return true为空 false非空
*/
@ -94,7 +98,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
/**
* * 判断一个Map是否为空
*
*
* @param map 要判断的Map
* @return true非空 false
*/
@ -105,7 +109,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
/**
* * 判断一个字符串是否为空串
*
*
* @param str String
* @return true为空 false非空
*/
@ -116,7 +120,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
/**
* * 判断一个字符串是否为非空串
*
*
* @param str String
* @return true非空串 false空串
*/
@ -127,7 +131,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
/**
* * 判断一个对象是否为空
*
*
* @param object Object
* @return true为空 false非空
*/
@ -138,7 +142,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
/**
* * 判断一个对象是否非空
*
*
* @param object Object
* @return true非空 false
*/
@ -149,7 +153,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
/**
* * 判断一个对象是否是数组类型Java基本型别的数组
*
*
* @param object 对象
* @return true是数组 false不是数组
*/
@ -211,7 +215,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
/**
* 截取字符串
*
*
* @param str 字符串
* @param start 开始
* @return 结果
@ -242,7 +246,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
/**
* 截取字符串
*
*
* @param str 字符串
* @param start 开始
* @param end 结束
@ -288,7 +292,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
/**
* 在字符串中查找第一个出现的 `open` 和最后一个出现的 `close` 之间的子字符串
*
*
* @param str 要截取的字符串
* @param open 起始字符串
* @param close 结束字符串
@ -314,7 +318,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
/**
* 判断是否为空并且不是空白字符
*
*
* @param str 要判断的value
* @return 结果
*/
@ -344,7 +348,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
* 通常使用format("this is {} for {}", "a", "b") -> this is a for b<br>
* 转义{} format("this is \\{} for {}", "a", "b") -> this is \{} for a<br>
* 转义\ format("this is \\\\{} for {}", "a", "b") -> this is \a for b<br>
*
*
* @param template 文本模板被替换的部分用 {} 表示
* @param params 参数值
* @return 格式化后的文本
@ -360,7 +364,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
/**
* 是否为http(s)://开头
*
*
* @param link 链接
* @return 结果
*/
@ -371,7 +375,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
/**
* 字符串转set
*
*
* @param str 字符串
* @param sep 分隔符
* @return set集合
@ -383,7 +387,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
/**
* 字符串转list
*
*
* @param str 字符串
* @param sep 分隔符
* @param filterBlank 过滤纯空白
@ -520,7 +524,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
/**
* 是否包含字符串
*
*
* @param str 验证字符串
* @param strs 字符串组
* @return 包含返回true
@ -542,7 +546,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
/**
* 将下划线大写方式命名的字符串转换为驼峰式如果转换前的下划线大写方式命名的字符串为空则返回空字符串 例如HELLO_WORLD->HelloWorld
*
*
* @param name 转换前的下划线大写方式命名的字符串
* @return 转换后的驼峰式命名的字符串
*/
@ -616,7 +620,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
/**
* 查找指定字符串是否匹配指定字符串列表中的任意一个字符串
*
*
* @param str 指定字符串
* @param strs 需要检查的字符串数组
* @return 是否匹配
@ -638,11 +642,11 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
}
/**
* 判断url是否与规则配置:
* ? 表示单个字符;
* * 表示一层路径内的任意字符串不可跨层级;
* 判断url是否与规则配置:
* ? 表示单个字符;
* * 表示一层路径内的任意字符串不可跨层级;
* ** 表示任意层路径;
*
*
* @param pattern 匹配规则
* @param url 需要匹配的url
* @return
@ -661,7 +665,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
/**
* 数字左边补齐0使之达到指定长度注意如果数字转换为字符串后长度大于size则只保留 最后size个字符
*
*
* @param num 数字对象
* @param size 字符串指定长度
* @return 返回数字的字符串格式该字符串为指定长度
@ -673,7 +677,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
/**
* 字符串左补齐如果原始字符串s长度大于size则只保留最后size个字符
*
*
* @param s 原始字符串
* @param size 字符串指定长度
* @param c 用于补齐的字符
@ -707,4 +711,47 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
}
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; // 解析错误
}
}
}

View File

@ -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;
}

View File

@ -117,6 +117,11 @@ public class TbKeyPeopleVo {
*/
private String updateUser;
/**
*资格证书集合
*/
private List<TbCertificationVo> certificateList;
/***
* 附件集合
*/

View File

@ -105,6 +105,11 @@ public class TbOtherPeopleVo {
*/
private String updateUser;
/**
*资格证书集合
*/
private List<TbCertificationVo> certificateList;
/***
* 附件集合
*/

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);
}
}

View File

@ -6,14 +6,12 @@ import com.bonus.common.exception.ServiceException;
import com.bonus.common.utils.SecurityUtils;
import com.bonus.common.utils.StringUtils;
import com.bonus.system.service.ISysFileService;
import com.bonus.tool.dto.ComCorePersonBean;
import com.bonus.tool.dto.TbCompanyPerfRelVo;
import com.bonus.tool.dto.TbKeyPeopleVo;
import com.bonus.tool.dto.TbFileSourceVo;
import com.bonus.tool.dto.*;
import com.bonus.tool.mapper.EpcMapper;
import com.bonus.tool.mapper.SouthMapper;
import com.bonus.tool.mapper.StateGridMapper;
import com.bonus.tool.mapper.TbKeyPeopleMapper;
import com.bonus.tool.service.TbCertificationService;
import com.bonus.tool.service.TbCompanyPerfRelService;
import com.bonus.tool.service.TbFileSourceService;
import com.bonus.tool.service.TbKeyPeopleServcie;
@ -55,6 +53,9 @@ public class TbKeyPeopleServiceImpl implements TbKeyPeopleServcie {
@Resource
private SouthMapper southMapper;
@Resource
private TbCertificationService tbCertificationService;
/**
* 关键人员列表
@ -67,6 +68,9 @@ public class TbKeyPeopleServiceImpl implements TbKeyPeopleServcie {
List<TbKeyPeopleVo> tbKeyPeopleVoList = tbKeyPeopleMapper.getTbKeyPeopleList(tbKeyPeopleVo);
if (tbKeyPeopleVoList.size()>0){
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());
tbKeyPeople.setTbFileSourceVoList(tbFileSourceVoList);
@ -84,6 +88,9 @@ public class TbKeyPeopleServiceImpl implements TbKeyPeopleServcie {
public TbKeyPeopleVo getTbKeyPeopleById(TbKeyPeopleVo 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());
tbKeyPeople.setTbFileSourceVoList(tbFileSourceVoList);
@ -104,8 +111,13 @@ public class TbKeyPeopleServiceImpl implements TbKeyPeopleServcie {
}
tbKeyPeopleVo.setCreateUser(SecurityUtils.getLoginUser().getUsername());
tbKeyPeopleVo.setCreateTime(new Date());
tbKeyPeopleVo.setAge(String.valueOf(StringUtils.calculateAge(tbKeyPeopleVo.getIdCard())));
log.info("对象信息{}",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());
}
@ -121,7 +133,12 @@ public class TbKeyPeopleServiceImpl implements TbKeyPeopleServcie {
throw new ServiceException("身份证已存在");
}
tbKeyPeopleVo.setUpdateUser(SecurityUtils.getLoginUser().getUsername());
tbKeyPeopleVo.setAge(String.valueOf(StringUtils.calculateAge(tbKeyPeopleVo.getIdCard())));
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.addTbFileSource(tbKeyPeopleVo.getTbFileSourceVoList(),tbKeyPeopleVo.getId(),TableType.TB_KEY_PEOPLE.getCode());
}
@ -156,6 +173,8 @@ public class TbKeyPeopleServiceImpl implements TbKeyPeopleServcie {
throw new ServiceException("关键人员已绑定南网模板");
}
tbKeyPeopleMapper.delTbKeyPeople(tbKeyPeopleVo);
//删除资格证书信息
tbCertificationService.delTbCertification(tbKeyPeopleVo.getId(),TableType.TB_KEY_PEOPLE.getCode());
//获取人员附件
List<TbFileSourceVo> tbFileSourceVoList = tbFileSourceService.getTbFileSourceList(tbKeyPeopleVo.getId(),TableType.TB_KEY_PEOPLE.getCode());
//删除服务器图片

View File

@ -5,14 +5,12 @@ import com.bonus.common.exception.ServiceException;
import com.bonus.common.utils.SecurityUtils;
import com.bonus.common.utils.StringUtils;
import com.bonus.system.service.ISysFileService;
import com.bonus.tool.dto.ComCorePersonBean;
import com.bonus.tool.dto.ComOtherPersonBean;
import com.bonus.tool.dto.TbFileSourceVo;
import com.bonus.tool.dto.TbOtherPeopleVo;
import com.bonus.tool.dto.*;
import com.bonus.tool.mapper.EpcMapper;
import com.bonus.tool.mapper.SouthMapper;
import com.bonus.tool.mapper.StateGridMapper;
import com.bonus.tool.mapper.TbOtherPeopleMapper;
import com.bonus.tool.service.TbCertificationService;
import com.bonus.tool.service.TbFileSourceService;
import com.bonus.tool.service.TbOtherPeopleService;
import lombok.extern.slf4j.Slf4j;
@ -50,6 +48,11 @@ public class TbOtherPeopleServiceImpl implements TbOtherPeopleService {
@Resource
private SouthMapper southMapper;
@Resource
private TbCertificationService tbCertificationService;
/**
* 其他人员列表查询
* @param
@ -61,6 +64,9 @@ public class TbOtherPeopleServiceImpl implements TbOtherPeopleService {
List<TbOtherPeopleVo> tbOtherPeopleVoList = tbOtherPeopleMapper.getTbOtherPeopleList(tbOtherPeopleVo);
if (tbOtherPeopleVoList.size()>0){
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());
tbOtherPeople.setTbFileSourceVoList(tbFileSourceVoList);
@ -77,6 +83,9 @@ public class TbOtherPeopleServiceImpl implements TbOtherPeopleService {
@Override
public TbOtherPeopleVo getTbOtherPeopleById(TbOtherPeopleVo 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());
tbOtherPeople.setTbFileSourceVoList(tbFileSourceVoList);
@ -98,6 +107,8 @@ public class TbOtherPeopleServiceImpl implements TbOtherPeopleService {
tbOtherPeopleVo.setCreateUser(SecurityUtils.getLoginUser().getUsername());
tbOtherPeopleVo.setCreateTime(new Date());
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());
}
@ -116,6 +127,9 @@ public class TbOtherPeopleServiceImpl implements TbOtherPeopleService {
}
tbOtherPeopleVo.setUpdateUser(SecurityUtils.getLoginUser().getUsername());
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.addTbFileSource(tbOtherPeopleVo.getTbFileSourceVoList(),tbOtherPeopleVo.getId(),TableType.TB_OTHER_PEOPLE.getCode());
@ -147,6 +161,8 @@ public class TbOtherPeopleServiceImpl implements TbOtherPeopleService {
throw new ServiceException("关键人员已绑定南网模板");
}
tbOtherPeopleMapper.delTbOtherPeople(tbOtherPeopleVo);
//删除资格证书信息
tbCertificationService.delTbCertification(tbOtherPeopleVo.getId(),TableType.TB_OTHER_PEOPLE.getCode());
//获取人员附件
List<TbFileSourceVo> tbFileSourceVoList = tbFileSourceService.getTbFileSourceList(tbOtherPeopleVo.getId(),TableType.TB_OTHER_PEOPLE.getCode());
//删除服务器图片

View File

@ -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>