|
|
|
@ -1,10 +1,5 @@
|
|
|
|
|
package com.imitate.web.module.simulation.service;
|
|
|
|
|
|
|
|
|
|
import java.time.LocalDateTime;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
|
|
import com.imitate.web.params.ClearTextKeyBodyParam;
|
|
|
|
@ -31,6 +26,13 @@ import com.imitate.web.persistence.mapper.SecretImportMapper;
|
|
|
|
|
import com.imitate.web.persistence.mapper.SecretIssueMailboxMapper;
|
|
|
|
|
import com.imitate.web.persistence.mapper.SecretIssuePrivateMapper;
|
|
|
|
|
import com.imitate.web.persistence.mapper.SecretIssueSubordinateMapper;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
|
import java.time.LocalDateTime;
|
|
|
|
|
import java.time.format.DateTimeFormatter;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
@Service
|
|
|
|
|
public class SecretBodyService {
|
|
|
|
@ -65,8 +67,6 @@ public class SecretBodyService {
|
|
|
|
|
private EncryptedKeyBodyMapper encryptedKeyBodyMapper;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 密钥体导入
|
|
|
|
|
*/
|
|
|
|
@ -86,6 +86,7 @@ public class SecretBodyService {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 更新已发布状态
|
|
|
|
|
*
|
|
|
|
|
* @param id
|
|
|
|
|
*/
|
|
|
|
|
public void publisherSecret(Integer id) {
|
|
|
|
@ -107,10 +108,9 @@ public class SecretBodyService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 密钥体申请
|
|
|
|
|
*
|
|
|
|
|
* @param param
|
|
|
|
|
*/
|
|
|
|
|
public void addSecretAsk(SecretAskParam param) {
|
|
|
|
@ -120,6 +120,7 @@ public class SecretBodyService {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 密钥体导入
|
|
|
|
|
*
|
|
|
|
|
* @param productNumber
|
|
|
|
|
* @param fileName
|
|
|
|
|
*/
|
|
|
|
@ -177,10 +178,9 @@ public class SecretBodyService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 密钥体列表
|
|
|
|
|
*
|
|
|
|
|
* @param param
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
@ -193,6 +193,7 @@ public class SecretBodyService {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 密钥体导入 - 修改状态
|
|
|
|
|
*
|
|
|
|
|
* @param type 1.删除 2. 还原 3.清理
|
|
|
|
|
* @param id
|
|
|
|
|
*/
|
|
|
|
@ -224,9 +225,13 @@ public class SecretBodyService {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 密钥体导入 - 添加密钥体接收单
|
|
|
|
|
*
|
|
|
|
|
* @param id 导入的 密钥体列表中某条记录的id 状态改为已使用
|
|
|
|
|
*/
|
|
|
|
|
public void addSecretBodyAcceptance(Integer id) {
|
|
|
|
|
LocalDateTime now = LocalDateTime.now();
|
|
|
|
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
String nowAsString = formatter.format(now);
|
|
|
|
|
SecretImport secretImport = secretImportMapper.selectByPrimaryKey(id);
|
|
|
|
|
if (secretImport != null) {
|
|
|
|
|
secretImport.setCurrentStatus("已使用");
|
|
|
|
@ -246,15 +251,16 @@ public class SecretBodyService {
|
|
|
|
|
secretBodyAcceptance.setCodeCarriers(secretImport.getApplyModel());
|
|
|
|
|
secretBodyAcceptance.setNumber(secretImport.getNumber());
|
|
|
|
|
secretBodyAcceptance.setNotes("备注");
|
|
|
|
|
secretBodyAcceptance.setCreateTime(nowAsString);
|
|
|
|
|
secretBodyAcceptance.setUpdateTime(nowAsString);
|
|
|
|
|
secretBodyAcceptanceMapper.insertSelective(secretBodyAcceptance);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 密钥体导入-密钥体接收单列表
|
|
|
|
|
*
|
|
|
|
|
* @param param
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
@ -265,10 +271,9 @@ public class SecretBodyService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 密钥体配发 - 向下级配发列表
|
|
|
|
|
*
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public PageInfo<SecretIssueSubordinate> belowIssueList(SecretIssueSubordinateParam param) {
|
|
|
|
@ -280,6 +285,7 @@ public class SecretBodyService {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 密钥体配发 - 邮箱配发列表
|
|
|
|
|
*
|
|
|
|
|
* @param param
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
@ -290,9 +296,9 @@ public class SecretBodyService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 密钥体配发 - 向专用密码管理系统配发列表
|
|
|
|
|
*
|
|
|
|
|
* @param param
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
@ -303,17 +309,19 @@ public class SecretBodyService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 密钥体配发 - 1 向下级配发 2 向邮箱配发 3 向专用密码管理系统配发
|
|
|
|
|
*
|
|
|
|
|
* @param id
|
|
|
|
|
*/
|
|
|
|
|
public void issue(Integer type, Integer id) {
|
|
|
|
|
LocalDateTime now = LocalDateTime.now();
|
|
|
|
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
String nowAsString = formatter.format(now);
|
|
|
|
|
SecretImport secretImport = secretImportMapper.selectByPrimaryKey(id);
|
|
|
|
|
if (secretImport != null) {
|
|
|
|
|
secretImport.setCurrentStatus("已使用");
|
|
|
|
|
secretImport.setUpdateTime(nowAsString);
|
|
|
|
|
secretImportMapper.updateByPrimaryKeySelective(secretImport);
|
|
|
|
|
switch (type) {
|
|
|
|
|
case 1:
|
|
|
|
@ -332,9 +340,10 @@ public class SecretBodyService {
|
|
|
|
|
secretIssueSubordinate.setApplyManagerSysName("申请管理系统名称");
|
|
|
|
|
secretIssueSubordinate.setApplyManagerModelName("申请管理系统实体标识");
|
|
|
|
|
secretIssueSubordinate.setQuantity(secretImport.getApplyNum());
|
|
|
|
|
secretIssueSubordinate.setQuantityTime(LocalDateTime.now());
|
|
|
|
|
secretIssueSubordinate.setQuantityTime(nowAsString);
|
|
|
|
|
secretIssueSubordinate.setDistCode("配发编号");
|
|
|
|
|
secretIssueSubordinate.setApplyCode("申请编号");
|
|
|
|
|
secretIssueSubordinate.setUpdateTime(nowAsString);
|
|
|
|
|
secretIssueSubordinateMapper.insertSelective(secretIssueSubordinate);
|
|
|
|
|
break;
|
|
|
|
|
case 2:
|
|
|
|
@ -353,6 +362,8 @@ public class SecretBodyService {
|
|
|
|
|
secretIssueMailbox.setOverTime(LocalDateTime.now());
|
|
|
|
|
secretIssueMailbox.setNotificationFlag("通知标志");
|
|
|
|
|
secretIssueMailbox.setDeleteFlag("删除标志");
|
|
|
|
|
secretIssueMailbox.setCreateTime(nowAsString);
|
|
|
|
|
secretIssueMailbox.setUpdateTime(nowAsString);
|
|
|
|
|
secretIssueMailboxMapper.insertSelective(secretIssueMailbox);
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
@ -362,19 +373,17 @@ public class SecretBodyService {
|
|
|
|
|
secretIssuePrivate.setProductCode(secretImport.getProductNum());
|
|
|
|
|
secretIssuePrivate.setIssueManagerSysName("配发管理系统名称");
|
|
|
|
|
secretIssuePrivate.setSyncStatus("已同步");
|
|
|
|
|
secretIssuePrivate.setCreateTime(nowAsString);
|
|
|
|
|
secretIssuePrivate.setUpdateTime(nowAsString);
|
|
|
|
|
secretIssuePrivateMapper.insertSelective(secretIssuePrivate);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 密钥体载体包封 - 明文载体包封
|
|
|
|
|
*/
|
|
|
|
@ -391,20 +400,4 @@ public class SecretBodyService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|