Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
f268108335
|
|
@ -170,4 +170,16 @@ public class Constants
|
|||
*/
|
||||
public static final String[] JOB_ERROR_STR = { "java.net.URL", "javax.naming.InitialContext", "org.yaml.snakeyaml",
|
||||
"org.springframework", "org.apache", "com.ruoyi.common.utils.file", "com.ruoyi.common.config", "com.ruoyi.generator" };
|
||||
|
||||
/**
|
||||
* 加密公钥
|
||||
*/
|
||||
public static final String publicKey = "MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKoR8mX0rGKLqzcWmOzbfj64K8ZIgOdHnzkXSOVOZbFu/TJhZ7rFAN+eaGkl3C4buccQd/EjEsj9ir7ijT7h96MCAwEAAQ==";
|
||||
|
||||
/**
|
||||
* 解密私钥
|
||||
*/
|
||||
public static final String privateKey = "MIIBVAIBADANBgkqhkiG9w0BAQEFAASCAT4wggE6AgEAAkEAqhHyZfSsYourNxaY7Nt+PrgrxkiA50efORdI5U5lsW79MmFnusUA355oaSXcLhu5xxB38SMSyP2KvuKNPuH3owIDAQABAkAfoiLyL+Z4lf4Myxk6xUDgLaWGximj20CUf+5BKKnlrK+Ed8gAkM0HqoTt2UZwA5E2MzS4EI2gjfQhz5X28uqxAiEA3wNFxfrCZlSZHb0gn2zDpWowcSxQAgiCstxGUoOqlW8CIQDDOerGKH5OmCJ4Z21v+F25WaHYPxCFMvwxpcw99EcvDQIgIdhDTIqD2jfYjPTY8Jj3EDGPbH2HHuffvflECt3Ek60CIQCFRlCkHpi7hthhYhovyloRYsM+IS9h/0BzlEAuO0ktMQIgSPT3aFAgJYwKpqRYKlLDVcflZFCKY7u3UP8iWi1Qw0Y=";
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,133 @@
|
|||
package com.bonus.common.utils;
|
||||
|
||||
import javax.crypto.Cipher;
|
||||
import java.security.KeyFactory;
|
||||
import java.security.PrivateKey;
|
||||
import java.security.PublicKey;
|
||||
import java.security.spec.PKCS8EncodedKeySpec;
|
||||
import java.security.spec.X509EncodedKeySpec;
|
||||
import java.util.Base64;
|
||||
|
||||
/**
|
||||
* @Author ma_sh
|
||||
* @create 2024/5/25 16:07
|
||||
*/
|
||||
public class RsaUtil {
|
||||
//签名算法名称
|
||||
private static final String RSA_KEY_ALGORITHM = "RSA";
|
||||
|
||||
//RSA密钥长度,默认密钥长度是1024,密钥长度必须是64的倍数,在512到65536位之间,不管是RSA还是RSA2长度推荐使用2048
|
||||
private static final int KEY_SIZE = 2048;
|
||||
|
||||
/**
|
||||
* 公钥加密(用于数据加密)
|
||||
*
|
||||
* @param data 加密前的字符串
|
||||
* @param publicKeyStr base64编码后的公钥
|
||||
* @return base64编码后的字符串
|
||||
* @throws Exception
|
||||
*/
|
||||
public static String encryptByPublicKey(String data, String publicKeyStr) throws Exception {
|
||||
//Java原生base64解码
|
||||
byte[] pubKey = Base64.getDecoder().decode(publicKeyStr);
|
||||
//创建X509编码密钥规范
|
||||
X509EncodedKeySpec x509KeySpec = new X509EncodedKeySpec(pubKey);
|
||||
//返回转换指定算法的KeyFactory对象
|
||||
KeyFactory keyFactory = KeyFactory.getInstance(RSA_KEY_ALGORITHM);
|
||||
//根据X509编码密钥规范产生公钥对象
|
||||
PublicKey publicKey = keyFactory.generatePublic(x509KeySpec);
|
||||
//根据转换的名称获取密码对象Cipher(转换的名称:算法/工作模式/填充模式)
|
||||
Cipher cipher = Cipher.getInstance(keyFactory.getAlgorithm());
|
||||
//用公钥初始化此Cipher对象(加密模式)
|
||||
cipher.init(Cipher.ENCRYPT_MODE, publicKey);
|
||||
//对数据加密
|
||||
byte[] encrypt = cipher.doFinal(data.getBytes());
|
||||
//返回base64编码后的字符串
|
||||
return Base64.getEncoder().encodeToString(encrypt);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 私钥解密(用于数据解密)
|
||||
*
|
||||
* @param data 解密前的字符串
|
||||
* @param privateKeyStr 私钥
|
||||
* @return 解密后的字符串
|
||||
* @throws Exception
|
||||
*/
|
||||
public static String decryptByPrivateKey(String data, String privateKeyStr) throws Exception {
|
||||
//Java原生base64解码
|
||||
byte[] priKey = Base64.getDecoder().decode(privateKeyStr);
|
||||
//创建PKCS8编码密钥规范
|
||||
PKCS8EncodedKeySpec pkcs8KeySpec = new PKCS8EncodedKeySpec(priKey);
|
||||
//返回转换指定算法的KeyFactory对象
|
||||
KeyFactory keyFactory = KeyFactory.getInstance(RSA_KEY_ALGORITHM);
|
||||
//根据PKCS8编码密钥规范产生私钥对象
|
||||
PrivateKey privateKey = keyFactory.generatePrivate(pkcs8KeySpec);
|
||||
//根据转换的名称获取密码对象Cipher(转换的名称:算法/工作模式/填充模式)
|
||||
Cipher cipher = Cipher.getInstance(keyFactory.getAlgorithm());
|
||||
//用私钥初始化此Cipher对象(解密模式)
|
||||
cipher.init(Cipher.DECRYPT_MODE, privateKey);
|
||||
//对数据解密
|
||||
byte[] decrypt = cipher.doFinal(Base64.getDecoder().decode(data));
|
||||
//返回字符串
|
||||
return new String(decrypt);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 私钥加密(用于数据签名)
|
||||
*
|
||||
* @param data 加密前的字符串
|
||||
* @param privateKeyStr base64编码后的私钥
|
||||
* @return base64编码后后的字符串
|
||||
* @throws Exception
|
||||
*/
|
||||
public static String encryptByPrivateKey(String data, String privateKeyStr) throws Exception {
|
||||
//Java原生base64解码
|
||||
byte[] priKey = Base64.getDecoder().decode(privateKeyStr);
|
||||
//创建PKCS8编码密钥规范
|
||||
PKCS8EncodedKeySpec pkcs8KeySpec = new PKCS8EncodedKeySpec(priKey);
|
||||
//返回转换指定算法的KeyFactory对象
|
||||
KeyFactory keyFactory = KeyFactory.getInstance(RSA_KEY_ALGORITHM);
|
||||
//根据PKCS8编码密钥规范产生私钥对象
|
||||
PrivateKey privateKey = keyFactory.generatePrivate(pkcs8KeySpec);
|
||||
//根据转换的名称获取密码对象Cipher(转换的名称:算法/工作模式/填充模式)
|
||||
Cipher cipher = Cipher.getInstance(keyFactory.getAlgorithm());
|
||||
//用私钥初始化此Cipher对象(加密模式)
|
||||
cipher.init(Cipher.ENCRYPT_MODE, privateKey);
|
||||
//对数据加密
|
||||
byte[] encrypt = cipher.doFinal(data.getBytes());
|
||||
//返回base64编码后的字符串
|
||||
return Base64.getEncoder().encodeToString(encrypt);
|
||||
}
|
||||
|
||||
/**
|
||||
* 公钥解密(用于数据验签)
|
||||
*
|
||||
* @param data 解密前的字符串
|
||||
* @param publicKeyStr base64编码后的公钥
|
||||
* @return 解密后的字符串
|
||||
* @throws Exception
|
||||
*/
|
||||
public static String decryptByPublicKey(String data, String publicKeyStr) throws Exception {
|
||||
//Java原生base64解码
|
||||
byte[] pubKey = Base64.getDecoder().decode(publicKeyStr);
|
||||
//创建X509编码密钥规范
|
||||
X509EncodedKeySpec x509KeySpec = new X509EncodedKeySpec(pubKey);
|
||||
//返回转换指定算法的KeyFactory对象
|
||||
KeyFactory keyFactory = KeyFactory.getInstance(RSA_KEY_ALGORITHM);
|
||||
//根据X509编码密钥规范产生公钥对象
|
||||
PublicKey publicKey = keyFactory.generatePublic(x509KeySpec);
|
||||
//根据转换的名称获取密码对象Cipher(转换的名称:算法/工作模式/填充模式)
|
||||
Cipher cipher = Cipher.getInstance(keyFactory.getAlgorithm());
|
||||
//用公钥初始化此Cipher对象(解密模式)
|
||||
cipher.init(Cipher.DECRYPT_MODE, publicKey);
|
||||
//对数据解密
|
||||
byte[] decrypt = cipher.doFinal(Base64.getDecoder().decode(data));
|
||||
//返回字符串
|
||||
return new String(decrypt);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -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;
|
||||
|
|
@ -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; // 解析错误
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -2,6 +2,8 @@ package com.bonus.tool.controller.system;
|
|||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import com.bonus.common.utils.RsaUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
|
|
@ -46,11 +48,12 @@ public class SysLoginController
|
|||
* @return 结果
|
||||
*/
|
||||
@PostMapping("/login")
|
||||
public AjaxResult login(@RequestBody LoginBody loginBody)
|
||||
{
|
||||
public AjaxResult login(@RequestBody LoginBody loginBody) throws Exception {
|
||||
String password = RsaUtil.decryptByPrivateKey(loginBody.getPassword(), Constants.privateKey);
|
||||
String username = RsaUtil.decryptByPrivateKey(loginBody.getUsername(), Constants.privateKey);
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
// 生成令牌
|
||||
String token = loginService.login(loginBody.getUsername(), loginBody.getPassword(), loginBody.getCode(),
|
||||
String token = loginService.login(username, password, loginBody.getCode(),
|
||||
loginBody.getUuid());
|
||||
ajax.put(Constants.TOKEN, token);
|
||||
return ajax;
|
||||
|
|
|
|||
|
|
@ -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 List<TbCertificationVo> certificateList;
|
||||
|
||||
/***
|
||||
* 附件集合
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -105,6 +105,11 @@ public class TbOtherPeopleVo {
|
|||
*/
|
||||
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);
|
||||
}
|
||||
|
|
@ -228,7 +228,7 @@ public class EpcServiceImpl implements EpcService {
|
|||
|
||||
// 设置标题和简介
|
||||
data.put("title", tbData.getName() != null ? tbData.getName() : "EPC总承包项目投标技术文件");
|
||||
data.put("Introduction", "项目经理、设计负责人、采购负责人、施工负责人、商务负责人等主要负责人");
|
||||
data.put("Introduction", "项目主要负责人");
|
||||
|
||||
int personNum = 1;
|
||||
// 处理项目核心人员信息
|
||||
|
|
|
|||
|
|
@ -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.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());
|
||||
//删除服务器图片
|
||||
|
|
|
|||
|
|
@ -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());
|
||||
//删除服务器图片
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ public class TestEPCDOC {
|
|||
String fileName = null;
|
||||
try {
|
||||
data.put("title","中老500千伏联网项目(老挝段)EPC总承包项目投标技术文件");
|
||||
data.put("Introduction","项目经理、设计负责人、采购负责人、施工负责人、商务负责人等主要负责人");
|
||||
data.put("Introduction","项目主要负责人");
|
||||
for (int i = 0; i < 4; i++) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("i",i + 1);
|
||||
|
|
@ -77,13 +77,13 @@ public class TestEPCDOC {
|
|||
map3.put("height", "207.85");
|
||||
map3.put("index",(100 * (i + 1)) + (j + 1));
|
||||
if(j == 0){
|
||||
map3.put("base64Url", FreeMarkerUtil.getImageBase("C:\\Users\\10488\\Desktop\\图片3.png"));
|
||||
map3.put("base64Url", FreeMarkerUtil.getImageBase("C:\\Users\\10488\\Desktop\\1.png"));
|
||||
}else if(j == 1){
|
||||
map3.put("base64Url",FreeMarkerUtil.getImageBase("C:\\Users\\10488\\Desktop\\图片4.png"));
|
||||
map3.put("base64Url",FreeMarkerUtil.getImageBase("C:\\Users\\10488\\Desktop\\1.png"));
|
||||
}else if(j == 2){
|
||||
map3.put("width", "481.15");
|
||||
map3.put("height", "634.5");
|
||||
map3.put("base64Url",FreeMarkerUtil.getImageBase("C:\\Users\\10488\\Desktop\\图片5.png"));
|
||||
map3.put("base64Url",FreeMarkerUtil.getImageBase("C:\\Users\\10488\\Desktop\\1.png"));
|
||||
}
|
||||
if(i == 0 && j == 0){
|
||||
map3.put("base64Url",FreeMarkerUtil.getImageBase("C:\\Users\\10488\\Desktop\\1.png"));
|
||||
|
|
@ -101,7 +101,7 @@ public class TestEPCDOC {
|
|||
map4.put("index",(10000 * (j + 1)) + (k + 1));
|
||||
map4.put("width", "481.15");
|
||||
map4.put("height", "634.5");
|
||||
map4.put("base64Url",FreeMarkerUtil.getImageBase("C:\\Users\\10488\\Desktop\\图片5.png"));
|
||||
map4.put("base64Url",FreeMarkerUtil.getImageBase("C:\\Users\\10488\\Desktop\\1.png"));
|
||||
imgList2.add(map4);
|
||||
}
|
||||
map3.put("imgList",imgList2);
|
||||
|
|
@ -114,7 +114,7 @@ public class TestEPCDOC {
|
|||
}
|
||||
data.put("list",list);
|
||||
data.put("list2",list2);
|
||||
WordUtils.exportMillCertificateWord2(null,null, data, "test", "EPC_DOC.ftl","C:\\Users\\10488\\Desktop\\test (2)\\");
|
||||
WordUtils.exportMillCertificateWord2(null,null, data, "test", "EPC_DOC.ftl","C:\\Users\\10488\\Desktop\\检索工具\\");
|
||||
} catch (Exception e) {
|
||||
log.error("EPC下载", e);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ public class TestGWDOC {
|
|||
map2.put("index", (100 * (i + 1)) + (j + 1));
|
||||
map2.put("width", "375.35");
|
||||
map2.put("height", "207.85");
|
||||
map2.put("base64Url", FreeMarkerUtil.getImageBase("C:\\Users\\10488\\Desktop\\图片5.png"));
|
||||
map2.put("base64Url", FreeMarkerUtil.getImageBase("C:\\Users\\10488\\Desktop\\1.png"));
|
||||
imgList.add(map2);
|
||||
}
|
||||
map.put("imgList", imgList);
|
||||
|
|
@ -86,7 +86,7 @@ public class TestGWDOC {
|
|||
map2.put("index", (1000 * (i + 1)) + (j + 1));
|
||||
map2.put("width", "481.15");
|
||||
map2.put("height", "634.5");
|
||||
map2.put("base64Url", FreeMarkerUtil.getImageBase("C:\\Users\\10488\\Desktop\\图片5.png"));
|
||||
map2.put("base64Url", FreeMarkerUtil.getImageBase("C:\\Users\\10488\\Desktop\\1.png"));
|
||||
zzList.add(map2);
|
||||
}
|
||||
for (int j = 0; j < 4; j++) {
|
||||
|
|
@ -109,7 +109,7 @@ public class TestGWDOC {
|
|||
map3.put("index", (10000 * (j + 1)) + (k + 1));
|
||||
map3.put("width", "481.15");
|
||||
map3.put("height", "634.5");
|
||||
map3.put("base64Url", FreeMarkerUtil.getImageBase("C:\\Users\\10488\\Desktop\\图片5.png"));
|
||||
map3.put("base64Url", FreeMarkerUtil.getImageBase("C:\\Users\\10488\\Desktop\\1.png"));
|
||||
imgList.add(map3);
|
||||
}
|
||||
map2.put("imgList", imgList);
|
||||
|
|
@ -124,7 +124,7 @@ public class TestGWDOC {
|
|||
map3.put("index", (100000 * (j + 1)) + (k + 1));
|
||||
map3.put("width", "481.15");
|
||||
map3.put("height", "634.5");
|
||||
map3.put("base64Url", FreeMarkerUtil.getImageBase("C:\\Users\\10488\\Desktop\\图片5.png"));
|
||||
map3.put("base64Url", FreeMarkerUtil.getImageBase("C:\\Users\\10488\\Desktop\\1.png"));
|
||||
imgList.add(map3);
|
||||
}
|
||||
map2.put("imgList", imgList);
|
||||
|
|
@ -196,7 +196,7 @@ public class TestGWDOC {
|
|||
map2.put("index", (1000000 * (i + 1)) + (j + 1));
|
||||
map2.put("width", "481.15");
|
||||
map2.put("height", "634.5");
|
||||
map2.put("base64Url", FreeMarkerUtil.getImageBase("C:\\Users\\10488\\Desktop\\图片5.png"));
|
||||
map2.put("base64Url", FreeMarkerUtil.getImageBase("C:\\Users\\10488\\Desktop\\1.png"));
|
||||
personImgList.add(map2);
|
||||
}
|
||||
map.put("userSettingList", userSettingList);
|
||||
|
|
@ -274,7 +274,7 @@ public class TestGWDOC {
|
|||
map3.put("index", (1000000 * (j + 1)) + (k + 1));
|
||||
map3.put("width", "481.15");
|
||||
map3.put("height", "634.5");
|
||||
map3.put("base64Url", FreeMarkerUtil.getImageBase("C:\\Users\\10488\\Desktop\\图片5.png"));
|
||||
map3.put("base64Url", FreeMarkerUtil.getImageBase("C:\\Users\\10488\\Desktop\\1.png"));
|
||||
imgList.add(map3);
|
||||
}
|
||||
map2.put("imgList", imgList);
|
||||
|
|
@ -290,7 +290,7 @@ public class TestGWDOC {
|
|||
map3.put("index", (1000000 * (j + 1)) + (k + 1));
|
||||
map3.put("width", "481.15");
|
||||
map3.put("height", "634.5");
|
||||
map3.put("base64Url", FreeMarkerUtil.getImageBase("C:\\Users\\10488\\Desktop\\图片5.png"));
|
||||
map3.put("base64Url", FreeMarkerUtil.getImageBase("C:\\Users\\10488\\Desktop\\1.png"));
|
||||
imgList.add(map3);
|
||||
}
|
||||
map2.put("imgList", imgList);
|
||||
|
|
|
|||
|
|
@ -4257,7 +4257,8 @@
|
|||
</w:r>
|
||||
</w:p>
|
||||
</w:ftr>
|
||||
<w:pgSz w:w="23811" w:h="16838" w:orient="landscape"/>
|
||||
<#-- <w:pgSz w:w="23811" w:h="16838" w:orient="landscape"/>-->
|
||||
<w:pgSz w:w="11906" w:h="16838"/>
|
||||
<w:pgMar w:top="1418" w:right="1134" w:bottom="992" w:left="1134" w:header="851" w:footer="992"
|
||||
w:gutter="0"/>
|
||||
<w:cols w:space="425"/>
|
||||
|
|
|
|||
|
|
@ -4257,7 +4257,8 @@
|
|||
</w:r>
|
||||
</w:p>
|
||||
</w:ftr>
|
||||
<w:pgSz w:w="23811" w:h="16838" w:orient="landscape"/>
|
||||
<#-- <w:pgSz w:w="23811" w:h="16838" w:orient="landscape"/>-->
|
||||
<w:pgSz w:w="11906" w:h="16838"/>
|
||||
<w:pgMar w:top="1418" w:right="1134" w:bottom="992" w:left="1134" w:header="851" w:footer="992"
|
||||
w:gutter="0"/>
|
||||
<w:cols w:space="425"/>
|
||||
|
|
|
|||
|
|
@ -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