规范化代码格式-业务类修改2.0
This commit is contained in:
parent
6c5fd2522e
commit
19b473bad9
@ -34,6 +34,12 @@ import java.util.concurrent.TimeUnit;
|
|||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工作流审批服务实现类
|
||||||
|
*
|
||||||
|
* @version 1.0
|
||||||
|
* @since 2025
|
||||||
|
*/
|
||||||
@Service
|
@Service
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class ActivitiProcessServiceImpl implements ActivitiProcessService {
|
public class ActivitiProcessServiceImpl implements ActivitiProcessService {
|
||||||
@ -59,8 +65,9 @@ public class ActivitiProcessServiceImpl implements ActivitiProcessService {
|
|||||||
/**
|
/**
|
||||||
* 发起审批流程 - 初始化审批数据
|
* 发起审批流程 - 初始化审批数据
|
||||||
* 根据机型ID和用户ID查找待审批的参数数据,生成变更说明并返回给前端显示
|
* 根据机型ID和用户ID查找待审批的参数数据,生成变更说明并返回给前端显示
|
||||||
|
*
|
||||||
* @param modelID 发动机型号ID
|
* @param modelID 发动机型号ID
|
||||||
* @param userID 用户ID
|
* @param userID 用户ID
|
||||||
* @return 包含审批数据的DTO列表
|
* @return 包含审批数据的DTO列表
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@ -365,6 +372,7 @@ public class ActivitiProcessServiceImpl implements ActivitiProcessService {
|
|||||||
return Arrays.asList(currentAssignees.split(","));
|
return Arrays.asList(currentAssignees.split(","));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void processApproval(
|
public void processApproval(
|
||||||
EngineReviewListPojo flow,
|
EngineReviewListPojo flow,
|
||||||
HandleApprovalDTO request,
|
HandleApprovalDTO request,
|
||||||
@ -457,6 +465,7 @@ public class ActivitiProcessServiceImpl implements ActivitiProcessService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void cancelProcess(
|
public void cancelProcess(
|
||||||
EngineReviewListPojo flow,
|
EngineReviewListPojo flow,
|
||||||
ApprovalConfigPojo node,
|
ApprovalConfigPojo node,
|
||||||
@ -511,6 +520,8 @@ public class ActivitiProcessServiceImpl implements ActivitiProcessService {
|
|||||||
// 更新发起和已办
|
// 更新发起和已办
|
||||||
myself.updateTasks(flow, status.getDesc(), 0, node);
|
myself.updateTasks(flow, status.getDesc(), 0, node);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void updateTasks(
|
public void updateTasks(
|
||||||
EngineReviewListPojo flow,
|
EngineReviewListPojo flow,
|
||||||
String status,
|
String status,
|
||||||
@ -534,6 +545,7 @@ public class ActivitiProcessServiceImpl implements ActivitiProcessService {
|
|||||||
.doUpdate(CompletedTaskPojo.class);
|
.doUpdate(CompletedTaskPojo.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void processNextNode(
|
public void processNextNode(
|
||||||
EngineReviewListPojo flow,
|
EngineReviewListPojo flow,
|
||||||
ApprovalConfigPojo currentNode,
|
ApprovalConfigPojo currentNode,
|
||||||
@ -618,6 +630,7 @@ public class ActivitiProcessServiceImpl implements ActivitiProcessService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void addNodeTodo(
|
public void addNodeTodo(
|
||||||
EngineReviewListPojo flow,
|
EngineReviewListPojo flow,
|
||||||
ApprovalConfigPojo node,
|
ApprovalConfigPojo node,
|
||||||
@ -654,6 +667,14 @@ public class ActivitiProcessServiceImpl implements ActivitiProcessService {
|
|||||||
myself.updateTasks(flow, node.getNodeName(), enableReturn, node);
|
myself.updateTasks(flow, node.getNodeName(), enableReturn, node);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新流程标题
|
||||||
|
* 更新审批流程的标题信息,同时更新相关的待办、已办和发起任务的标题
|
||||||
|
*
|
||||||
|
* @param flowId 流程ID
|
||||||
|
* @param title 新的流程标题
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public void updateFlowTitle(String flowId, String title) {
|
public void updateFlowTitle(String flowId, String title) {
|
||||||
@ -689,6 +710,14 @@ public class ActivitiProcessServiceImpl implements ActivitiProcessService {
|
|||||||
.doUpdate(InitiatedTaskPojo.class);
|
.doUpdate(InitiatedTaskPojo.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 继续审批流程
|
||||||
|
* 重新发起审批流程,清除原流程节点的所有待办任务并重新分配
|
||||||
|
*
|
||||||
|
* @param flowId 流程ID
|
||||||
|
* @param userId 用户ID
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void continueApproval(String flowId, String userId) {
|
public void continueApproval(String flowId, String userId) {
|
||||||
EngineReviewListPojo reviewListPojo = bd.getBusinessDatabase()
|
EngineReviewListPojo reviewListPojo = bd.getBusinessDatabase()
|
||||||
@ -754,11 +783,25 @@ public class ActivitiProcessServiceImpl implements ActivitiProcessService {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取可编辑节点
|
||||||
|
* 获取指定流程中可编辑的审批节点列表
|
||||||
|
*
|
||||||
|
* @param flowId 流程ID
|
||||||
|
* @return 可编辑节点列表
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<String> getEditableNodes(String flowId) {
|
public List<String> getEditableNodes(String flowId) {
|
||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新节点配置
|
||||||
|
* 更新审批流程中的节点配置信息
|
||||||
|
*
|
||||||
|
* @param form 更新节点表单对象
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void updateNode(UpdateNodeForm form) {
|
public void updateNode(UpdateNodeForm form) {
|
||||||
// 检查流程
|
// 检查流程
|
||||||
@ -787,6 +830,7 @@ public class ActivitiProcessServiceImpl implements ActivitiProcessService {
|
|||||||
* 从外部平台发起审批时,在本地系统创建相应的审批流程记录
|
* 从外部平台发起审批时,在本地系统创建相应的审批流程记录
|
||||||
*
|
*
|
||||||
* @param request 审批请求对象,包含审批的基本信息
|
* @param request 审批请求对象,包含审批的基本信息
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void startActivitiByPlatform(ApprovalByPlatformRequest request) {
|
public void startActivitiByPlatform(ApprovalByPlatformRequest request) {
|
||||||
@ -810,6 +854,13 @@ public class ActivitiProcessServiceImpl implements ActivitiProcessService {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断是否为直送流程
|
||||||
|
* 检查指定流程是否为直送流程
|
||||||
|
*
|
||||||
|
* @param flowId 流程ID
|
||||||
|
* @return 是否为直送流程
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean getIsDirect(String flowId) {
|
public boolean getIsDirect(String flowId) {
|
||||||
EngineReviewListPojo flow = bd.getBusinessDatabase()
|
EngineReviewListPojo flow = bd.getBusinessDatabase()
|
||||||
@ -823,6 +874,13 @@ public class ActivitiProcessServiceImpl implements ActivitiProcessService {
|
|||||||
return flow.getPreNode() != -1;
|
return flow.getPreNode() != -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取审批用户节点
|
||||||
|
* 获取指定流程的审批节点及其相关用户信息
|
||||||
|
*
|
||||||
|
* @param flowId 流程ID
|
||||||
|
* @return 审批用户节点DTO
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public ApprovalNodesDTO getApprovalUsers(String flowId) {
|
public ApprovalNodesDTO getApprovalUsers(String flowId) {
|
||||||
ApprovalNodesDTO nodes = new ApprovalNodesDTO();
|
ApprovalNodesDTO nodes = new ApprovalNodesDTO();
|
||||||
@ -862,6 +920,14 @@ public class ActivitiProcessServiceImpl implements ActivitiProcessService {
|
|||||||
return nodes;
|
return nodes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 直送审批到指定节点
|
||||||
|
* 将审批流程直接发送到指定节点,跳过中间节点
|
||||||
|
*
|
||||||
|
* @param flowId 流程ID
|
||||||
|
* @param userId 用户ID
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void directSendingApproval(String flowId, String userId) {
|
public void directSendingApproval(String flowId, String userId) {
|
||||||
// 获取当前流程审批的参数
|
// 获取当前流程审批的参数
|
||||||
@ -950,6 +1016,13 @@ public class ActivitiProcessServiceImpl implements ActivitiProcessService {
|
|||||||
bd.getBusinessDatabase().doInsert(record);
|
bd.getBusinessDatabase().doInsert(record);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取退回节点列表
|
||||||
|
* 获取可以退回的审批节点列表
|
||||||
|
*
|
||||||
|
* @param flowId 流程ID
|
||||||
|
* @return 退回节点列表
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<String> getReturnNodes(String flowId) {
|
public List<String> getReturnNodes(String flowId) {
|
||||||
EngineReviewListPojo flow = bd.getBusinessDatabase()
|
EngineReviewListPojo flow = bd.getBusinessDatabase()
|
||||||
@ -969,6 +1042,13 @@ public class ActivitiProcessServiceImpl implements ActivitiProcessService {
|
|||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理退回至指定节点
|
||||||
|
* 将审批流程退回至指定节点
|
||||||
|
*
|
||||||
|
* @param form 退回节点表单
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void handleReturnToNode(HandleReturnNodeForm form) {
|
public void handleReturnToNode(HandleReturnNodeForm form) {
|
||||||
// 查找流程
|
// 查找流程
|
||||||
|
|||||||
@ -22,6 +22,12 @@ import java.util.stream.Collectors;
|
|||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分析常用参数服务实现类
|
||||||
|
*
|
||||||
|
* @version 1.0
|
||||||
|
* @since 2025
|
||||||
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
public class AnalysisCommonParametersServiceImpl implements AnalysisCommonParametersService {
|
public class AnalysisCommonParametersServiceImpl implements AnalysisCommonParametersService {
|
||||||
@ -41,6 +47,13 @@ public class AnalysisCommonParametersServiceImpl implements AnalysisCommonParame
|
|||||||
private static final Pattern ALL_NUMBER_PATTERN = Pattern.compile("^[-+]?\\d+(\\.\\d+)?([Ee][-+]?\\d+)?$");
|
private static final Pattern ALL_NUMBER_PATTERN = Pattern.compile("^[-+]?\\d+(\\.\\d+)?([Ee][-+]?\\d+)?$");
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据常用参数选择模型参数
|
||||||
|
* 根据分析请求对象筛选符合条件的模型参数
|
||||||
|
*
|
||||||
|
* @param analysisRequest 分析请求对象
|
||||||
|
* @return 模型参数视图列表
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public ArrayList<AnalysisModelParamterView> selectModelParamByCommon(AnalysisRequest analysisRequest) {
|
public ArrayList<AnalysisModelParamterView> selectModelParamByCommon(AnalysisRequest analysisRequest) {
|
||||||
// if (ObjectUtils.isEmpty(analysisRequest.getModelIds()) || ObjectUtils.isEmpty(analysisRequest) || ObjectUtils.isEmpty(analysisRequest.getCommonId())) {
|
// if (ObjectUtils.isEmpty(analysisRequest.getModelIds()) || ObjectUtils.isEmpty(analysisRequest) || ObjectUtils.isEmpty(analysisRequest.getCommonId())) {
|
||||||
@ -78,6 +91,13 @@ public class AnalysisCommonParametersServiceImpl implements AnalysisCommonParame
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 显示报表
|
||||||
|
* 根据模型列表生成分析报表
|
||||||
|
*
|
||||||
|
* @param models 模型ID列表
|
||||||
|
* @return 分析模型参数视图和参数对象
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public AnalysisModelParamterViewAndParam showReport(List<String> models) {
|
public AnalysisModelParamterViewAndParam showReport(List<String> models) {
|
||||||
|
|
||||||
@ -86,8 +106,13 @@ public class AnalysisCommonParametersServiceImpl implements AnalysisCommonParame
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//返回参数列表
|
/**
|
||||||
|
* 显示报表参数列表
|
||||||
|
* 根据报表请求返回参数列表
|
||||||
|
*
|
||||||
|
* @param request 报表请求对象
|
||||||
|
* @return 分析模型参数视图和参数对象
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public AnalysisModelParamterViewAndParam showReportParamList(ReportRequest request) {
|
public AnalysisModelParamterViewAndParam showReportParamList(ReportRequest request) {
|
||||||
|
|
||||||
@ -95,6 +120,13 @@ public class AnalysisCommonParametersServiceImpl implements AnalysisCommonParame
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 模糊查询模型
|
||||||
|
* 根据报表请求条件模糊匹配符合条件的模型
|
||||||
|
*
|
||||||
|
* @param request 报表请求对象
|
||||||
|
* @return 引擎模型POJO列表
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<DataEntryEngineModelPojo> selectModelByLike(ReportRequest request) {
|
public List<DataEntryEngineModelPojo> selectModelByLike(ReportRequest request) {
|
||||||
if (request.getEngineCapacityMax() != null &&
|
if (request.getEngineCapacityMax() != null &&
|
||||||
@ -118,6 +150,12 @@ public class AnalysisCommonParametersServiceImpl implements AnalysisCommonParame
|
|||||||
.doQuery(DataEntryEngineModelPojo.class));
|
.doQuery(DataEntryEngineModelPojo.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取可用参数
|
||||||
|
* 返回系统中所有可用的参数名称列表
|
||||||
|
*
|
||||||
|
* @return 可用参数名称列表
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<String> getAvailableParameters() {
|
public List<String> getAvailableParameters() {
|
||||||
List<ParameterPojo> modelParams = businessDatabase.getBusinessDatabase()
|
List<ParameterPojo> modelParams = businessDatabase.getBusinessDatabase()
|
||||||
@ -187,9 +225,15 @@ public class AnalysisCommonParametersServiceImpl implements AnalysisCommonParame
|
|||||||
return andParam;
|
return andParam;
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
/**
|
||||||
|
* 显示报表2
|
||||||
|
* 根据模型列表生成分析报表(第二个实现)
|
||||||
|
*
|
||||||
|
* @param models 模型ID列表
|
||||||
|
* @return 分析模型参数视图和参数对象
|
||||||
|
*/
|
||||||
public AnalysisModelParamterViewAndParam showReport2(List<String> models) {
|
public AnalysisModelParamterViewAndParam showReport2(List<String> models) {
|
||||||
// 查询所有符合条件的机型
|
// 查询所有符合条件的机型
|
||||||
// List<DataEntryEngineModelPojo> engineModelPojos = selectModelByLike(request);
|
|
||||||
List<DataEntryEngineModelPojo> engineModelPojos = businessDatabase.getBusinessDatabase()
|
List<DataEntryEngineModelPojo> engineModelPojos = businessDatabase.getBusinessDatabase()
|
||||||
.in("id", models)
|
.in("id", models)
|
||||||
.doQuery(DataEntryEngineModelPojo.class);
|
.doQuery(DataEntryEngineModelPojo.class);
|
||||||
@ -253,6 +297,9 @@ public class AnalysisCommonParametersServiceImpl implements AnalysisCommonParame
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 验证所有数值类型
|
* 验证所有数值类型
|
||||||
|
*
|
||||||
|
* @param str 待验证的字符串
|
||||||
|
* @return 是否为数字
|
||||||
*/
|
*/
|
||||||
public static boolean isNumber(String str) {
|
public static boolean isNumber(String str) {
|
||||||
if (str == null || str.trim().isEmpty()) {
|
if (str == null || str.trim().isEmpty()) {
|
||||||
@ -261,7 +308,14 @@ public class AnalysisCommonParametersServiceImpl implements AnalysisCommonParame
|
|||||||
return ALL_NUMBER_PATTERN.matcher(str.trim()).matches();
|
return ALL_NUMBER_PATTERN.matcher(str.trim()).matches();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 分批处理机型
|
/**
|
||||||
|
* 分批处理机型
|
||||||
|
* 将模型列表按照指定批次大小分割
|
||||||
|
*
|
||||||
|
* @param source 源模型列表
|
||||||
|
* @param batchSize 批次大小
|
||||||
|
* @return 分割后的批次列表
|
||||||
|
*/
|
||||||
private List<List<DataEntryEngineModelPojo>> splitModelBatch(
|
private List<List<DataEntryEngineModelPojo>> splitModelBatch(
|
||||||
List<DataEntryEngineModelPojo> source,
|
List<DataEntryEngineModelPojo> source,
|
||||||
int batchSize
|
int batchSize
|
||||||
|
|||||||
@ -36,6 +36,12 @@ import java.util.concurrent.TimeUnit;
|
|||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 对标报告服务实现类
|
||||||
|
*
|
||||||
|
* @version 1.0
|
||||||
|
* @since 2025
|
||||||
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class BenchmarkingReportServiceImpl implements BenchmarkingReportService {
|
public class BenchmarkingReportServiceImpl implements BenchmarkingReportService {
|
||||||
@Resource
|
@Resource
|
||||||
@ -60,6 +66,13 @@ public class BenchmarkingReportServiceImpl implements BenchmarkingReportService
|
|||||||
private static final int FLOW_LOCK_EXPIRE_SECONDS = 5;
|
private static final int FLOW_LOCK_EXPIRE_SECONDS = 5;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 插入报告
|
||||||
|
* 创建新的对标报告并启动审批流程
|
||||||
|
*
|
||||||
|
* @param form 保存对标报告表单
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public void insertReport(SaveBenchmarkingReportForm form) {
|
public void insertReport(SaveBenchmarkingReportForm form) {
|
||||||
@ -103,6 +116,13 @@ public class BenchmarkingReportServiceImpl implements BenchmarkingReportService
|
|||||||
bd.getBusinessDatabase().doBatchInsert(approvalConfigs);
|
bd.getBusinessDatabase().doBatchInsert(approvalConfigs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新报告
|
||||||
|
* 修改已有对标报告的信息
|
||||||
|
*
|
||||||
|
* @param form 更新对标报告表单
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void updateReport(UpdateBenchmarkingReportForm form) {
|
public void updateReport(UpdateBenchmarkingReportForm form) {
|
||||||
// 验证报告
|
// 验证报告
|
||||||
@ -125,6 +145,13 @@ public class BenchmarkingReportServiceImpl implements BenchmarkingReportService
|
|||||||
.doUpdate(report);
|
.doUpdate(report);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除报告
|
||||||
|
* 逻辑删除指定ID的对标报告
|
||||||
|
*
|
||||||
|
* @param reportId 报告ID
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public void deleteReport(String reportId) {
|
public void deleteReport(String reportId) {
|
||||||
@ -149,6 +176,14 @@ public class BenchmarkingReportServiceImpl implements BenchmarkingReportService
|
|||||||
.doUpdate(BenchmarkingReportPojo.class);
|
.doUpdate(BenchmarkingReportPojo.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上传文件
|
||||||
|
* 将文件上传到服务器并返回访问路径
|
||||||
|
*
|
||||||
|
* @param file 文件对象
|
||||||
|
* @param userId 用户ID
|
||||||
|
* @return 文件访问路径
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String uploadFile(MultipartFile file, String userId) {
|
public String uploadFile(MultipartFile file, String userId) {
|
||||||
String currentTenantId = runtimeAppContextService.getCurrentTenantId();
|
String currentTenantId = runtimeAppContextService.getCurrentTenantId();
|
||||||
@ -179,6 +214,13 @@ public class BenchmarkingReportServiceImpl implements BenchmarkingReportService
|
|||||||
return fileUploadDTO.getData().getUrl() +"&download=download&token=" + tokenXdap;
|
return fileUploadDTO.getData().getUrl() +"&download=download&token=" + tokenXdap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 启动报告审批
|
||||||
|
* 开始对标报告的审批流程
|
||||||
|
*
|
||||||
|
* @param form 审批人员表单
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public void startReportApproval(ApprovalPersonForm form) {
|
public void startReportApproval(ApprovalPersonForm form) {
|
||||||
@ -282,6 +324,14 @@ public class BenchmarkingReportServiceImpl implements BenchmarkingReportService
|
|||||||
.doUpdate(BenchmarkingReportPojo.class);
|
.doUpdate(BenchmarkingReportPojo.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 继续审批
|
||||||
|
* 继续执行对标报告的审批流程
|
||||||
|
*
|
||||||
|
* @param flowId 流程ID
|
||||||
|
* @param userId 用户ID
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public void continueApproval(String flowId, String userId) {
|
public void continueApproval(String flowId, String userId) {
|
||||||
@ -348,6 +398,13 @@ public class BenchmarkingReportServiceImpl implements BenchmarkingReportService
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 重启报告审批
|
||||||
|
* 重新启动对标报告的审批流程
|
||||||
|
*
|
||||||
|
* @param form 重启报告审批表单
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public void restartReportApproval(RestartReportApprovalForm form) {
|
public void restartReportApproval(RestartReportApprovalForm form) {
|
||||||
@ -491,6 +548,14 @@ public class BenchmarkingReportServiceImpl implements BenchmarkingReportService
|
|||||||
.doUpdate(BenchmarkingReportPojo.class);
|
.doUpdate(BenchmarkingReportPojo.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 直接发送审批
|
||||||
|
* 将审批流程直接发送到指定节点
|
||||||
|
*
|
||||||
|
* @param reportId 报告ID
|
||||||
|
* @param userId 用户ID
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public void directSendingApproval(String reportId, String userId) {
|
public void directSendingApproval(String reportId, String userId) {
|
||||||
@ -580,6 +645,13 @@ public class BenchmarkingReportServiceImpl implements BenchmarkingReportService
|
|||||||
bd.getBusinessDatabase().doInsert(record);
|
bd.getBusinessDatabase().doInsert(record);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理退回至节点
|
||||||
|
* 将审批流程退回至指定节点
|
||||||
|
*
|
||||||
|
* @param form 退回节点表单
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public void handleReturnToNode(HandleReturnNodeForm form) {
|
public void handleReturnToNode(HandleReturnNodeForm form) {
|
||||||
@ -671,6 +743,13 @@ public class BenchmarkingReportServiceImpl implements BenchmarkingReportService
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理退回
|
||||||
|
* 处理对标报告审批的退回操作
|
||||||
|
*
|
||||||
|
* @param request 审批请求
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public void handleReturn(HandleApprovalRequest request) {
|
public void handleReturn(HandleApprovalRequest request) {
|
||||||
@ -723,6 +802,13 @@ public class BenchmarkingReportServiceImpl implements BenchmarkingReportService
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取审批列表
|
||||||
|
* 获取对标报告的审批列表信息
|
||||||
|
*
|
||||||
|
* @param form 审批列表表单
|
||||||
|
* @return 待办和报告列表视图的分页查询结果
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public PageQueryResult<TodoAndReportListView> getApprovalList(ApprovalListForm form) {
|
public PageQueryResult<TodoAndReportListView> getApprovalList(ApprovalListForm form) {
|
||||||
PageQueryResult<TodoAndReportListView> result = bd.getBusinessDatabase()
|
PageQueryResult<TodoAndReportListView> result = bd.getBusinessDatabase()
|
||||||
@ -737,6 +823,13 @@ public class BenchmarkingReportServiceImpl implements BenchmarkingReportService
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置审批当前用户
|
||||||
|
* 为审批列表设置当前用户信息
|
||||||
|
*
|
||||||
|
* @param result 待办和报告列表视图的分页查询结果
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
private void setApprovalCurrentUser(PageQueryResult<TodoAndReportListView> result) {
|
private void setApprovalCurrentUser(PageQueryResult<TodoAndReportListView> result) {
|
||||||
result.getResult().forEach(item -> {
|
result.getResult().forEach(item -> {
|
||||||
if (item.getCurrentUsers() == null || item.getCurrentUsers().isEmpty()) {
|
if (item.getCurrentUsers() == null || item.getCurrentUsers().isEmpty()) {
|
||||||
@ -753,6 +846,13 @@ public class BenchmarkingReportServiceImpl implements BenchmarkingReportService
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据条件获取对标报告
|
||||||
|
* 根据筛选条件查询对标报告列表
|
||||||
|
*
|
||||||
|
* @param form 对标报告页面表单
|
||||||
|
* @return 待办和报告视图的分页查询结果
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public PageQueryResult<TodoAndReportView> getBenchmarkingReportByCondition(BenchmarkingReportPageForm form) {
|
public PageQueryResult<TodoAndReportView> getBenchmarkingReportByCondition(BenchmarkingReportPageForm form) {
|
||||||
PageQueryResult<TodoAndReportView> result = bd.getBusinessDatabase()
|
PageQueryResult<TodoAndReportView> result = bd.getBusinessDatabase()
|
||||||
@ -775,6 +875,13 @@ public class BenchmarkingReportServiceImpl implements BenchmarkingReportService
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置当前审批人
|
||||||
|
* 为报告列表设置当前审批人信息
|
||||||
|
*
|
||||||
|
* @param result 待办和报告视图的分页查询结果
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
private void setCurrentApprovers(PageQueryResult<TodoAndReportView> result) {
|
private void setCurrentApprovers(PageQueryResult<TodoAndReportView> result) {
|
||||||
result.getResult().forEach(item -> {
|
result.getResult().forEach(item -> {
|
||||||
ApprovalXdapUsersPojo approvalXdapUser = bd.getBusinessDatabase()
|
ApprovalXdapUsersPojo approvalXdapUser = bd.getBusinessDatabase()
|
||||||
@ -784,6 +891,13 @@ public class BenchmarkingReportServiceImpl implements BenchmarkingReportService
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理报告审批
|
||||||
|
* 处理对标报告的审批请求
|
||||||
|
*
|
||||||
|
* @param request 处理审批请求
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public void handleReportApproval(HandleApprovalRequest request) {
|
public void handleReportApproval(HandleApprovalRequest request) {
|
||||||
@ -832,12 +946,30 @@ public class BenchmarkingReportServiceImpl implements BenchmarkingReportService
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 验证是否为当前处理人
|
/**
|
||||||
|
* 验证是否有权限
|
||||||
|
* 检查用户是否有处理当前节点的权限
|
||||||
|
*
|
||||||
|
* @param node 审批配置节点
|
||||||
|
* @param userId 用户ID
|
||||||
|
* @return 是否有权限
|
||||||
|
*/
|
||||||
private boolean hasPermission(ApprovalConfigPojo node, String userId) {
|
private boolean hasPermission(ApprovalConfigPojo node, String userId) {
|
||||||
return JSON.parseArray(node.getAssignees())
|
return JSON.parseArray(node.getAssignees())
|
||||||
.toJavaList(String.class).contains(userId);
|
.toJavaList(String.class).contains(userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理审批逻辑
|
||||||
|
* 执行对标报告审批的核心逻辑
|
||||||
|
*
|
||||||
|
* @param flow 审批流程POJO
|
||||||
|
* @param request 处理审批请求
|
||||||
|
* @param currentNode 当前节点
|
||||||
|
* @param lastedRecord 最后一条记录
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
public void processApprovalLogic(
|
public void processApprovalLogic(
|
||||||
ApprovalFlowPojo flow,
|
ApprovalFlowPojo flow,
|
||||||
HandleApprovalRequest request,
|
HandleApprovalRequest request,
|
||||||
@ -887,6 +1019,16 @@ public class BenchmarkingReportServiceImpl implements BenchmarkingReportService
|
|||||||
myself.processNextNode(flow, currentNode, request.getUserId());
|
myself.processNextNode(flow, currentNode, request.getUserId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理下一个节点
|
||||||
|
* 处理审批流程的下一个节点
|
||||||
|
*
|
||||||
|
* @param flow 审批流程POJO
|
||||||
|
* @param currentNode 当前节点
|
||||||
|
* @param userId 用户ID
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
public void processNextNode(ApprovalFlowPojo flow, ApprovalConfigPojo currentNode, String userId) {
|
public void processNextNode(ApprovalFlowPojo flow, ApprovalConfigPojo currentNode, String userId) {
|
||||||
// 查询报告状态
|
// 查询报告状态
|
||||||
BenchmarkingReportPojo report = bd.getBusinessDatabase()
|
BenchmarkingReportPojo report = bd.getBusinessDatabase()
|
||||||
@ -920,6 +1062,18 @@ public class BenchmarkingReportServiceImpl implements BenchmarkingReportService
|
|||||||
.doUpdate(ApprovalFlowPojo.class);
|
.doUpdate(ApprovalFlowPojo.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加节点待办
|
||||||
|
* 为指定节点添加待办任务
|
||||||
|
*
|
||||||
|
* @param flow 审批流程POJO
|
||||||
|
* @param node 审批节点
|
||||||
|
* @param report 对标报告POJO
|
||||||
|
* @param createBy 创建者
|
||||||
|
* @param enableReturn 是否允许退回
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
public void addNodeTodo(
|
public void addNodeTodo(
|
||||||
ApprovalFlowPojo flow,
|
ApprovalFlowPojo flow,
|
||||||
ApprovalConfigPojo node,
|
ApprovalConfigPojo node,
|
||||||
@ -957,6 +1111,17 @@ public class BenchmarkingReportServiceImpl implements BenchmarkingReportService
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取消流程
|
||||||
|
* 取消当前审批流程
|
||||||
|
*
|
||||||
|
* @param flow 审批流程POJO
|
||||||
|
* @param node 审批节点
|
||||||
|
* @param status 状态
|
||||||
|
* @param userId 用户ID
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
public void cancelProcess(
|
public void cancelProcess(
|
||||||
ApprovalFlowPojo flow,
|
ApprovalFlowPojo flow,
|
||||||
ApprovalConfigPojo node,
|
ApprovalConfigPojo node,
|
||||||
@ -1009,6 +1174,7 @@ public class BenchmarkingReportServiceImpl implements BenchmarkingReportService
|
|||||||
myself.updateTasks(flow, Objects.equals(report.getStatus(), "RETURNED") ? "已撤回" : "已拒绝", 0, node);
|
myself.updateTasks(flow, Objects.equals(report.getStatus(), "RETURNED") ? "已撤回" : "已拒绝", 0, node);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void updateTasks(ApprovalFlowPojo flow, String status, Integer enableReturn, ApprovalConfigPojo currentNode) {
|
public void updateTasks(ApprovalFlowPojo flow, String status, Integer enableReturn, ApprovalConfigPojo currentNode) {
|
||||||
// 更新已办和发起的节点状态
|
// 更新已办和发起的节点状态
|
||||||
bd.getBusinessDatabase()
|
bd.getBusinessDatabase()
|
||||||
|
|||||||
@ -15,11 +15,23 @@ import javax.annotation.Resource;
|
|||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通用参数服务实现类
|
||||||
|
*
|
||||||
|
* @version 1.0
|
||||||
|
* @since 2025
|
||||||
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class CommonParameterServiceImpl implements CommonParameterService {
|
public class CommonParameterServiceImpl implements CommonParameterService {
|
||||||
@Resource
|
@Resource
|
||||||
private BusinessDatabase bd;
|
private BusinessDatabase bd;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取系统和参数
|
||||||
|
* 查询所有子系统和参数信息
|
||||||
|
*
|
||||||
|
* @return 子系统和参数项列表
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<ModelCommonItem> getSystemAndPara() {
|
public List<ModelCommonItem> getSystemAndPara() {
|
||||||
List<ParameterPojo> parameters = bd.getBusinessDatabase()
|
List<ParameterPojo> parameters = bd.getBusinessDatabase()
|
||||||
@ -37,6 +49,13 @@ public class CommonParameterServiceImpl implements CommonParameterService {
|
|||||||
return convertToModelCommonItemList(parameters);
|
return convertToModelCommonItemList(parameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取模型常用参数
|
||||||
|
* 根据用户ID查询模型常用参数
|
||||||
|
*
|
||||||
|
* @param userId 用户ID
|
||||||
|
* @return 模型常用参数列表
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<ModelCommon> getModelCommonParameter(String userId) {
|
public List<ModelCommon> getModelCommonParameter(String userId) {
|
||||||
List<CommonParameterPojo> commonParameters = bd.getBusinessDatabase()
|
List<CommonParameterPojo> commonParameters = bd.getBusinessDatabase()
|
||||||
@ -61,6 +80,13 @@ public class CommonParameterServiceImpl implements CommonParameterService {
|
|||||||
return convertToModelCommonList(modelCommonParameters, commonParameters);
|
return convertToModelCommonList(modelCommonParameters, commonParameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 插入模型常用参数
|
||||||
|
* 保存新的模型常用参数配置
|
||||||
|
*
|
||||||
|
* @param form 模型常用参数插入表单
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public void insertModelCommonParameter(ModelCommonParameterInsertForm form) {
|
public void insertModelCommonParameter(ModelCommonParameterInsertForm form) {
|
||||||
@ -85,6 +111,13 @@ public class CommonParameterServiceImpl implements CommonParameterService {
|
|||||||
bd.getBusinessDatabase().doBatchInsert(modelCommonParameters);
|
bd.getBusinessDatabase().doBatchInsert(modelCommonParameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新模型常用参数
|
||||||
|
* 修改已有的模型常用参数配置
|
||||||
|
*
|
||||||
|
* @param form 模型常用参数更新表单
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public void updateModelCommonParameter(ModelCommonParameterUpdateForm form) {
|
public void updateModelCommonParameter(ModelCommonParameterUpdateForm form) {
|
||||||
@ -100,6 +133,13 @@ public class CommonParameterServiceImpl implements CommonParameterService {
|
|||||||
bd.getBusinessDatabase().doBatchInsert(modelCommonParameters);
|
bd.getBusinessDatabase().doBatchInsert(modelCommonParameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取分析常用参数
|
||||||
|
* 根据用户ID查询分析常用参数
|
||||||
|
*
|
||||||
|
* @param userId 用户ID
|
||||||
|
* @return 分析常用参数POJO列表
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<AnalysisCommonParametersPojo> getAnalysisCommonParameter(String userId) {
|
public List<AnalysisCommonParametersPojo> getAnalysisCommonParameter(String userId) {
|
||||||
return bd.getBusinessDatabase()
|
return bd.getBusinessDatabase()
|
||||||
@ -109,6 +149,13 @@ public class CommonParameterServiceImpl implements CommonParameterService {
|
|||||||
.doQuery(AnalysisCommonParametersPojo.class);
|
.doQuery(AnalysisCommonParametersPojo.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 插入分析常用参数
|
||||||
|
* 保存新的分析常用参数配置
|
||||||
|
*
|
||||||
|
* @param form 分析常用参数插入表单
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public void insertAnalysisCommonParameter(AnalysisCommonParameterInsertForm form) {
|
public void insertAnalysisCommonParameter(AnalysisCommonParameterInsertForm form) {
|
||||||
@ -132,6 +179,13 @@ public class CommonParameterServiceImpl implements CommonParameterService {
|
|||||||
bd.getBusinessDatabase().doInsert(analysisCommonParameter);
|
bd.getBusinessDatabase().doInsert(analysisCommonParameter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新分析常用参数
|
||||||
|
* 修改已有的分析常用参数配置
|
||||||
|
*
|
||||||
|
* @param form 分析常用参数更新表单
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public void updateAnalysisCommonParameter(AnalysisCommonParameterUpdateForm form) {
|
public void updateAnalysisCommonParameter(AnalysisCommonParameterUpdateForm form) {
|
||||||
@ -149,6 +203,10 @@ public class CommonParameterServiceImpl implements CommonParameterService {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* ParameterPojo 列表转换为 ModelCommonItem 列表
|
* ParameterPojo 列表转换为 ModelCommonItem 列表
|
||||||
|
* 将参数POJO列表转换为模型常用项列表
|
||||||
|
*
|
||||||
|
* @param parameterList 参数POJO列表
|
||||||
|
* @return 模型常用项列表
|
||||||
*/
|
*/
|
||||||
public static List<ModelCommonItem> convertToModelCommonItemList(List<ParameterPojo> parameterList) {
|
public static List<ModelCommonItem> convertToModelCommonItemList(List<ParameterPojo> parameterList) {
|
||||||
if (parameterList == null || parameterList.isEmpty()) {
|
if (parameterList == null || parameterList.isEmpty()) {
|
||||||
@ -194,6 +252,11 @@ public class CommonParameterServiceImpl implements CommonParameterService {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 将 ModelCommonParametersPojo 列表转换为 ModelCommon 列表
|
* 将 ModelCommonParametersPojo 列表转换为 ModelCommon 列表
|
||||||
|
* 将模型常用参数POJO列表转换为模型常用列表
|
||||||
|
*
|
||||||
|
* @param paramsList 模型常用参数POJO列表
|
||||||
|
* @param commonParameters 通用参数POJO列表
|
||||||
|
* @return 模型常用列表
|
||||||
*/
|
*/
|
||||||
private List<ModelCommon> convertToModelCommonList(
|
private List<ModelCommon> convertToModelCommonList(
|
||||||
List<ModelCommonParametersPojo> paramsList, List<CommonParameterPojo> commonParameters
|
List<ModelCommonParametersPojo> paramsList, List<CommonParameterPojo> commonParameters
|
||||||
@ -250,6 +313,11 @@ public class CommonParameterServiceImpl implements CommonParameterService {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 将List 转换为 ModelCommonParametersPojo 列表
|
* 将List 转换为 ModelCommonParametersPojo 列表
|
||||||
|
* 将参数项列表转换为模型常用参数POJO列表
|
||||||
|
*
|
||||||
|
* @param parameters 参数项列表
|
||||||
|
* @param commonId 通用ID
|
||||||
|
* @return 模型常用参数POJO列表
|
||||||
*/
|
*/
|
||||||
private List<ModelCommonParametersPojo> convertToModelCommonParameters(
|
private List<ModelCommonParametersPojo> convertToModelCommonParameters(
|
||||||
List<ParameterItem> parameters, String commonId) {
|
List<ParameterItem> parameters, String commonId) {
|
||||||
|
|||||||
@ -45,12 +45,10 @@ import java.util.*;
|
|||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* 数据录入发动机型号服务实现类
|
||||||
* 发动机型号数据表 服务实现类
|
|
||||||
* </p>
|
|
||||||
*
|
*
|
||||||
* @author Lys111
|
* @version 1.0
|
||||||
* @since 2025-11-12
|
* @since 2025
|
||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
@ -75,6 +73,12 @@ public class DataEntryEngineModelServiceImpl implements DataEntryEngineModelServ
|
|||||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询所有发动机型号
|
||||||
|
* 获取数据库中所有发动机型号数据
|
||||||
|
*
|
||||||
|
* @return 发动机型号POJO列表
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<DataEntryEngineModelPojo> selectAll() {
|
public List<DataEntryEngineModelPojo> selectAll() {
|
||||||
List<DataEntryEngineModelPojo> modelPojos = sw.buildFromDatasource("xdap_app_223770822127386625")
|
List<DataEntryEngineModelPojo> modelPojos = sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
@ -84,6 +88,13 @@ public class DataEntryEngineModelServiceImpl implements DataEntryEngineModelServ
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 条件分页查询发动机型号
|
||||||
|
* 根据指定条件分页查询发动机型号数据
|
||||||
|
*
|
||||||
|
* @param request 数据录入发动机型号页面请求对象
|
||||||
|
* @return 分页结果DTO
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public PageResultDTO<DataEntryEngineModelDto> selectByConditionPage(DataEntryEngineModelPageRequest request) {
|
public PageResultDTO<DataEntryEngineModelDto> selectByConditionPage(DataEntryEngineModelPageRequest request) {
|
||||||
//责任人ID
|
//责任人ID
|
||||||
@ -175,6 +186,15 @@ public class DataEntryEngineModelServiceImpl implements DataEntryEngineModelServ
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Excel导入发动机型号数据
|
||||||
|
* 从Excel文件导入发动机型号相关信息
|
||||||
|
*
|
||||||
|
* @param file Excel文件
|
||||||
|
* @param userId 用户ID
|
||||||
|
* @param ycOrOt 玉柴或其他标识
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
// @Transactional
|
// @Transactional
|
||||||
public void excelImport(MultipartFile file, String userId, String ycOrOt) {
|
public void excelImport(MultipartFile file, String userId, String ycOrOt) {
|
||||||
@ -200,6 +220,14 @@ public class DataEntryEngineModelServiceImpl implements DataEntryEngineModelServ
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 插入发动机型号数据
|
||||||
|
* 添加新的发动机型号数据到数据库
|
||||||
|
*
|
||||||
|
* @param request 数据录入发动机型号页面请求对象
|
||||||
|
* @param userId 用户ID
|
||||||
|
* @return 插入结果
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public int insert(DataEntryEngineModelPageRequest request, String userId) {/*
|
public int insert(DataEntryEngineModelPageRequest request, String userId) {/*
|
||||||
@ -299,6 +327,12 @@ public class DataEntryEngineModelServiceImpl implements DataEntryEngineModelServ
|
|||||||
|
|
||||||
//模板管理审批完成触发更新 参数版本
|
//模板管理审批完成触发更新 参数版本
|
||||||
//遍历所有机型 把所有机型的版本加一 状态为未分发 绑定新版参数新版参数版本加一 所有新参数值为空 重新走分发
|
//遍历所有机型 把所有机型的版本加一 状态为未分发 绑定新版参数新版参数版本加一 所有新参数值为空 重新走分发
|
||||||
|
/**
|
||||||
|
* 更新模型到新版本
|
||||||
|
* 将所有机型更新到新版本并绑定新参数
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public void updateModelForNewVersion() {
|
public void updateModelForNewVersion() {
|
||||||
@ -322,7 +356,16 @@ public class DataEntryEngineModelServiceImpl implements DataEntryEngineModelServ
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//为每个机型绑定参数
|
/**
|
||||||
|
* 为每个机型绑定参数
|
||||||
|
* 将参数与发动机型号进行绑定
|
||||||
|
*
|
||||||
|
* @param modelPojo 发动机型号POJO
|
||||||
|
* @param parameters 参数列表
|
||||||
|
* @param newVersionNum 新版本号
|
||||||
|
* @param xdapUsersPojo 用户POJO
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
public void saveDataParamDetail(DataEntryEngineModelPojo modelPojo, List<ParameterPojo> parameters, Integer newVersionNum, XdapUsers xdapUsersPojo) {
|
public void saveDataParamDetail(DataEntryEngineModelPojo modelPojo, List<ParameterPojo> parameters, Integer newVersionNum, XdapUsers xdapUsersPojo) {
|
||||||
/*
|
/*
|
||||||
遍历机型
|
遍历机型
|
||||||
@ -395,11 +438,25 @@ public class DataEntryEngineModelServiceImpl implements DataEntryEngineModelServ
|
|||||||
// 又不在这生成待办了 改为管理员进去选择责任人后待办 batchInsertTodoTask(todoTaskPojos);
|
// 又不在这生成待办了 改为管理员进去选择责任人后待办 batchInsertTodoTask(todoTaskPojos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量插入待办任务
|
||||||
|
* 批量添加待办任务到数据库
|
||||||
|
*
|
||||||
|
* @param todoTaskPojos 待办任务POJO列表
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
public void batchInsertTodoTask(List<TodoTaskPojo> todoTaskPojos) {
|
public void batchInsertTodoTask(List<TodoTaskPojo> todoTaskPojos) {
|
||||||
sw.buildFromDatasource("xdap_app_223770822127386625").doBatchInsert(todoTaskPojos);
|
sw.buildFromDatasource("xdap_app_223770822127386625").doBatchInsert(todoTaskPojos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Excel导出发动机型号数据
|
||||||
|
* 导出发动机型号数据到Excel文件
|
||||||
|
*
|
||||||
|
* @param response HTTP响应对象
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void excelExport(HttpServletResponse response) {
|
public void excelExport(HttpServletResponse response) {
|
||||||
try {
|
try {
|
||||||
@ -432,6 +489,13 @@ public class DataEntryEngineModelServiceImpl implements DataEntryEngineModelServ
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据型号ID查询发动机型号
|
||||||
|
* 通过ID获取特定的发动机型号信息
|
||||||
|
*
|
||||||
|
* @param modelId 型号ID
|
||||||
|
* @return 发动机型号POJO
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public DataEntryEngineModelPojo selectBymodelId(String modelId) {
|
public DataEntryEngineModelPojo selectBymodelId(String modelId) {
|
||||||
if (ObjectUtils.isNotEmpty(modelId)) {
|
if (ObjectUtils.isNotEmpty(modelId)) {
|
||||||
@ -445,6 +509,12 @@ public class DataEntryEngineModelServiceImpl implements DataEntryEngineModelServ
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 条件分页查询版本信息
|
||||||
|
* 根据条件分页获取版本信息
|
||||||
|
*
|
||||||
|
* @return 分页结果DTO
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public PageResultDTO<DataEntryEngineModelDto> selectVersionByConditionPage() {
|
public PageResultDTO<DataEntryEngineModelDto> selectVersionByConditionPage() {
|
||||||
List<DataEntryEngineModelDto> list = sw.buildFromDatasource("xdap_app_223770822127386625")
|
List<DataEntryEngineModelDto> list = sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
@ -457,6 +527,13 @@ public class DataEntryEngineModelServiceImpl implements DataEntryEngineModelServ
|
|||||||
return pageResultDTO;
|
return pageResultDTO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除发动机型号
|
||||||
|
* 根据ID删除指定的发动机型号数据
|
||||||
|
*
|
||||||
|
* @param modelId 型号ID
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void delete(String modelId) {
|
public void delete(String modelId) {
|
||||||
EngineReviewListPojo model = sw.buildFromDatasource("xdap_app_223770822127386625")
|
EngineReviewListPojo model = sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
@ -478,6 +555,14 @@ public class DataEntryEngineModelServiceImpl implements DataEntryEngineModelServ
|
|||||||
.doDelete(DataEntryEngineModelPojo.class);
|
.doDelete(DataEntryEngineModelPojo.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置响应
|
||||||
|
* 设置HTTP响应的头部信息用于文件下载
|
||||||
|
*
|
||||||
|
* @param response HTTP响应对象
|
||||||
|
* @param fileName 文件名
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
private void setupResponse(HttpServletResponse response, String fileName) throws IOException {
|
private void setupResponse(HttpServletResponse response, String fileName) throws IOException {
|
||||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||||
response.setCharacterEncoding("utf-8");
|
response.setCharacterEncoding("utf-8");
|
||||||
|
|||||||
@ -17,32 +17,74 @@ import java.util.Collections;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据录入服务实现类
|
||||||
|
*
|
||||||
|
* @version 1.0
|
||||||
|
* @since 2025
|
||||||
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
public class DataEntryServiceImpl implements DataEntryService {
|
public class DataEntryServiceImpl implements DataEntryService {
|
||||||
@Resource
|
@Resource
|
||||||
private MpaasQueryFactory sw;
|
private MpaasQueryFactory sw;
|
||||||
|
/**
|
||||||
|
* 读取Excel文件
|
||||||
|
* 从上传的Excel文件中读取数据
|
||||||
|
*
|
||||||
|
* @param file Excel文件
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void readExcel(MultipartFile file) {
|
public void readExcel(MultipartFile file) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 写入Excel文件
|
||||||
|
* 将数据写入Excel文件并输出到响应
|
||||||
|
*
|
||||||
|
* @param form 选项表单
|
||||||
|
* @param response HTTP响应对象
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void writeExcel(OptionForm form, HttpServletResponse response) {
|
public void writeExcel(OptionForm form, HttpServletResponse response) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 插入参数
|
||||||
|
* 根据模板表单插入新的参数数据
|
||||||
|
*
|
||||||
|
* @param form 模板表单
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void insertParameter(TemplateForm form) {
|
public void insertParameter(TemplateForm form) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据条件获取参数
|
||||||
|
* 根据选项表单条件查询参数列表
|
||||||
|
*
|
||||||
|
* @param form 选项表单
|
||||||
|
* @return 参数POJO列表
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<ParameterPojo> getParameterByCondition(OptionForm form) {
|
public List<ParameterPojo> getParameterByCondition(OptionForm form) {
|
||||||
List<ParameterPojo> parameters = sw.buildFromDatasource("xdap_app_223770822127386625").doQuery(ParameterPojo.class);
|
List<ParameterPojo> parameters = sw.buildFromDatasource("xdap_app_223770822127386625").doQuery(ParameterPojo.class);
|
||||||
return parameters;
|
return parameters;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据条件获取模板
|
||||||
|
* 根据模板名称查询模板列表
|
||||||
|
*
|
||||||
|
* @param templateName 模板名称
|
||||||
|
* @return 模板POJO列表
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<TemplatePojo> getTemplateByCondition(String templateName) {
|
public List<TemplatePojo> getTemplateByCondition(String templateName) {
|
||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
|
|||||||
@ -43,12 +43,10 @@ import java.util.stream.Collectors;
|
|||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* 发动机参数详情服务实现类
|
||||||
* 参数详情 服务实现类
|
|
||||||
* </p>
|
|
||||||
*
|
*
|
||||||
* @author Lys111
|
* @version 1.0
|
||||||
* @since 2025-11-13
|
* @since 2025
|
||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
@ -72,7 +70,11 @@ public class EngineParamDetailServiceImpl implements EngineParamDetailService {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 返回参数列表
|
* 返回参数列表
|
||||||
|
* 根据模型ID和TC数据标志选择参数列表
|
||||||
*
|
*
|
||||||
|
* @param modelID 发动机型号ID
|
||||||
|
* @param tcData TC数据标识
|
||||||
|
* @return 参数列表映射
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public HashMap<String, List<String>> selectParamList(String modelID, String tcData) {
|
public HashMap<String, List<String>> selectParamList(String modelID, String tcData) {
|
||||||
@ -166,6 +168,13 @@ public class EngineParamDetailServiceImpl implements EngineParamDetailService {
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询参数列表和模型
|
||||||
|
* 根据模型ID获取参数列表和模型信息
|
||||||
|
*
|
||||||
|
* @param modelID 发动机型号ID
|
||||||
|
* @return 参数列表和模型映射
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Map<String, HashMap<String, List<String>>> selectParamListAndModel(String modelID) {
|
public Map<String, HashMap<String, List<String>>> selectParamListAndModel(String modelID) {
|
||||||
HashMap<String, HashMap<String, List<String>>> map = new HashMap<>();
|
HashMap<String, HashMap<String, List<String>>> map = new HashMap<>();
|
||||||
@ -179,7 +188,12 @@ public class EngineParamDetailServiceImpl implements EngineParamDetailService {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Excel导入
|
* Excel导入
|
||||||
|
* 从Excel文件导入参数详情数据
|
||||||
*
|
*
|
||||||
|
* @param file Excel文件
|
||||||
|
* @param modelId 型号ID
|
||||||
|
* @param userId 用户ID
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void excelImport(MultipartFile file, String modelId, String userId) {
|
public void excelImport(MultipartFile file, String modelId, String userId) {
|
||||||
@ -209,6 +223,15 @@ public class EngineParamDetailServiceImpl implements EngineParamDetailService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Excel导出
|
||||||
|
* 导出参数详情数据到Excel文件
|
||||||
|
*
|
||||||
|
* @param response HTTP响应对象
|
||||||
|
* @param modelId 型号ID
|
||||||
|
* @param userId 用户ID
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void excelExport(
|
public void excelExport(
|
||||||
HttpServletResponse response,
|
HttpServletResponse response,
|
||||||
@ -272,6 +295,13 @@ public class EngineParamDetailServiceImpl implements EngineParamDetailService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据参数查询值
|
||||||
|
* 根据参数详情请求查询参数值
|
||||||
|
*
|
||||||
|
* @param engineParamDetailRequest 发动机参数详情请求
|
||||||
|
* @return 参数详情DTO列表
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<EngineParamDetailDTO> selectValueByParam(EngineParamDetailRequest engineParamDetailRequest) {
|
public List<EngineParamDetailDTO> selectValueByParam(EngineParamDetailRequest engineParamDetailRequest) {
|
||||||
String engineModelID = engineParamDetailRequest.getEngineModelID();
|
String engineModelID = engineParamDetailRequest.getEngineModelID();
|
||||||
@ -294,6 +324,13 @@ public class EngineParamDetailServiceImpl implements EngineParamDetailService {
|
|||||||
return engineParamDetailDTOS;
|
return engineParamDetailDTOS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据多个参数查询值
|
||||||
|
* 根据参数详情请求查询多个参数的值
|
||||||
|
*
|
||||||
|
* @param engineParamDetailRequest 发动机参数详情请求
|
||||||
|
* @return 参数详情DTO映射
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Map<String, List<EngineParamDetailDTO>> selectValueByMoreParam(EngineParamDetailRequest engineParamDetailRequest) {
|
public Map<String, List<EngineParamDetailDTO>> selectValueByMoreParam(EngineParamDetailRequest engineParamDetailRequest) {
|
||||||
|
|
||||||
@ -434,7 +471,9 @@ public class EngineParamDetailServiceImpl implements EngineParamDetailService {
|
|||||||
* 修改数据
|
* 修改数据
|
||||||
* 保存编辑 此处不开始审批
|
* 保存编辑 此处不开始审批
|
||||||
*
|
*
|
||||||
* @param engineParamDetailPojos
|
* @param engineParamDetailPojos 参数详情POJO列表
|
||||||
|
* @param currentUserId 当前用户ID
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void updateParamValue(List<EngineParamDetailPojo> engineParamDetailPojos, String currentUserId) {
|
public void updateParamValue(List<EngineParamDetailPojo> engineParamDetailPojos, String currentUserId) {
|
||||||
@ -567,6 +606,14 @@ public class EngineParamDetailServiceImpl implements EngineParamDetailService {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新并插入填写人
|
||||||
|
* 分解任务并更新填写人信息
|
||||||
|
*
|
||||||
|
* @param engineParamDetailPojos 参数详情POJO列表
|
||||||
|
* @param userID 用户ID
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
//分解任务
|
//分解任务
|
||||||
@Override
|
@Override
|
||||||
public void updateToInsertFiledBy(List<EngineParamDetailPojo> engineParamDetailPojos, String userID) {
|
public void updateToInsertFiledBy(List<EngineParamDetailPojo> engineParamDetailPojos, String userID) {
|
||||||
@ -679,16 +726,36 @@ public class EngineParamDetailServiceImpl implements EngineParamDetailService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量插入待办任务
|
||||||
|
* 批量插入待办任务到数据库
|
||||||
|
*
|
||||||
|
* @param todoTaskPojos 待办任务POJO列表
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
@Transactional // 发生任何异常都回滚
|
@Transactional // 发生任何异常都回滚
|
||||||
public void batchInsertTodoTask(List<TodoTaskPojo> todoTaskPojos) {
|
public void batchInsertTodoTask(List<TodoTaskPojo> todoTaskPojos) {
|
||||||
sw.buildFromDatasource("xdap_app_223770822127386625").doBatchInsert(todoTaskPojos);
|
sw.buildFromDatasource("xdap_app_223770822127386625").doBatchInsert(todoTaskPojos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量插入发起任务
|
||||||
|
* 批量插入发起任务到数据库
|
||||||
|
*
|
||||||
|
* @param taskPojos 发起任务POJO列表
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
@Transactional // 发生任何异常都回滚
|
@Transactional // 发生任何异常都回滚
|
||||||
public void batchInsertInitiatedTask(List<InitiatedTaskPojo> taskPojos) {
|
public void batchInsertInitiatedTask(List<InitiatedTaskPojo> taskPojos) {
|
||||||
sw.buildFromDatasource("xdap_app_223770822127386625").doBatchInsert(taskPojos);
|
sw.buildFromDatasource("xdap_app_223770822127386625").doBatchInsert(taskPojos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询所有新版本参数
|
||||||
|
* 查询所有最新版本的参数信息
|
||||||
|
*
|
||||||
|
* @return 参数POJO列表
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<ParameterPojo> selectAllByNewVersion() {
|
public List<ParameterPojo> selectAllByNewVersion() {
|
||||||
//读取已通过审核的版本 DRAFT(草稿)、APPROVING(审批中)、COMPLETE(已完成)、RETURNED(已撤回)、REJECTED(已拒绝)
|
//读取已通过审核的版本 DRAFT(草稿)、APPROVING(审批中)、COMPLETE(已完成)、RETURNED(已撤回)、REJECTED(已拒绝)
|
||||||
@ -737,6 +804,12 @@ public class EngineParamDetailServiceImpl implements EngineParamDetailService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询所有新版本参数包括TC
|
||||||
|
* 查询所有最新版本的参数信息,包括TC数据
|
||||||
|
*
|
||||||
|
* @return 参数POJO列表
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<ParameterPojo> selectAllAndTcByNewVersion() {
|
public List<ParameterPojo> selectAllAndTcByNewVersion() {
|
||||||
//读取已通过审核的版本 DRAFT(草稿)、APPROVING(审批中)、COMPLETE(已完成)、RETURNED(已撤回)、REJECTED(已拒绝)
|
//读取已通过审核的版本 DRAFT(草稿)、APPROVING(审批中)、COMPLETE(已完成)、RETURNED(已撤回)、REJECTED(已拒绝)
|
||||||
@ -766,6 +839,13 @@ public class EngineParamDetailServiceImpl implements EngineParamDetailService {
|
|||||||
.doQuery(ParameterPojo.class);
|
.doQuery(ParameterPojo.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据模型查询新版本参数详情
|
||||||
|
* 根据模型ID查询最新版本的参数详情
|
||||||
|
*
|
||||||
|
* @param modelId 模型ID
|
||||||
|
* @return 参数详情POJO列表
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<EngineParamDetailPojo> selectByModelNewVersion(String modelId) {
|
public List<EngineParamDetailPojo> selectByModelNewVersion(String modelId) {
|
||||||
|
|
||||||
@ -788,6 +868,13 @@ public class EngineParamDetailServiceImpl implements EngineParamDetailService {
|
|||||||
).collect(Collectors.toList());
|
).collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据责任人ID查询参数详情
|
||||||
|
* 根据责任人ID查询相关的参数详情
|
||||||
|
*
|
||||||
|
* @param resId 责任人ID
|
||||||
|
* @return 参数详情POJO列表
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<EngineParamDetailPojo> selectByResId(String resId) {
|
public List<EngineParamDetailPojo> selectByResId(String resId) {
|
||||||
if (ObjectUtils.isEmpty(resId)) {
|
if (ObjectUtils.isEmpty(resId)) {
|
||||||
@ -809,6 +896,13 @@ public class EngineParamDetailServiceImpl implements EngineParamDetailService {
|
|||||||
).collect(Collectors.toList());
|
).collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据填写人ID查询参数详情
|
||||||
|
* 根据填写人ID查询相关的参数详情
|
||||||
|
*
|
||||||
|
* @param filledId 填写人ID
|
||||||
|
* @return 参数详情POJO列表
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<EngineParamDetailPojo> selectByfiledId(String filledId) {
|
public List<EngineParamDetailPojo> selectByfiledId(String filledId) {
|
||||||
if (ObjectUtils.isEmpty(filledId)) {
|
if (ObjectUtils.isEmpty(filledId)) {
|
||||||
@ -827,6 +921,13 @@ public class EngineParamDetailServiceImpl implements EngineParamDetailService {
|
|||||||
).collect(Collectors.toList());
|
).collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据审批ID查询参数详情
|
||||||
|
* 根据审批ID查询相关的参数详情
|
||||||
|
*
|
||||||
|
* @param approvalId 审批ID
|
||||||
|
* @return 参数详情POJO列表
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<EngineParamDetailPojo> selectByapprovalId(String approvalId) {
|
public List<EngineParamDetailPojo> selectByapprovalId(String approvalId) {
|
||||||
if (ObjectUtils.isNotEmpty(approvalId)) {
|
if (ObjectUtils.isNotEmpty(approvalId)) {
|
||||||
@ -837,6 +938,13 @@ public class EngineParamDetailServiceImpl implements EngineParamDetailService {
|
|||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据ID查询参数详情
|
||||||
|
* 根据ID查询单个参数详情
|
||||||
|
*
|
||||||
|
* @param id 参数详情ID
|
||||||
|
* @return 参数详情POJO
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public EngineParamDetailPojo selectById(String id) {
|
public EngineParamDetailPojo selectById(String id) {
|
||||||
List<EngineParamDetailPojo> engineParamDetailPojos = sw.buildFromDatasource("xdap_app_223770822127386625")
|
List<EngineParamDetailPojo> engineParamDetailPojos = sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
@ -848,6 +956,13 @@ public class EngineParamDetailServiceImpl implements EngineParamDetailService {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询版本列表
|
||||||
|
* 根据模型ID查询版本列表
|
||||||
|
*
|
||||||
|
* @param modelId 模型ID
|
||||||
|
* @return 版本号列表
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<Integer> selectVersionList(String modelId) {
|
public List<Integer> selectVersionList(String modelId) {
|
||||||
if (ObjectUtils.isNotEmpty(modelId)) {
|
if (ObjectUtils.isNotEmpty(modelId)) {
|
||||||
@ -861,6 +976,15 @@ public class EngineParamDetailServiceImpl implements EngineParamDetailService {
|
|||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据类型查询人员
|
||||||
|
* 根据子系统、部门和类型查询相关人员
|
||||||
|
*
|
||||||
|
* @param subSystem 子系统
|
||||||
|
* @param dept 部门
|
||||||
|
* @param type 类型
|
||||||
|
* @return 用户POJO列表
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<XdapUsers> selectPersonoByType(String subSystem, String dept, Integer type) {
|
public List<XdapUsers> selectPersonoByType(String subSystem, String dept, Integer type) {
|
||||||
List<XdapUsers> xdapUsersPojos = new ArrayList<>();
|
List<XdapUsers> xdapUsersPojos = new ArrayList<>();
|
||||||
@ -882,6 +1006,14 @@ public class EngineParamDetailServiceImpl implements EngineParamDetailService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置响应
|
||||||
|
* 设置HTTP响应头部信息用于文件下载
|
||||||
|
*
|
||||||
|
* @param response HTTP响应对象
|
||||||
|
* @param fileName 文件名
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
private void setupResponse(HttpServletResponse response, String fileName) throws IOException {
|
private void setupResponse(HttpServletResponse response, String fileName) throws IOException {
|
||||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||||
response.setCharacterEncoding("utf-8");
|
response.setCharacterEncoding("utf-8");
|
||||||
|
|||||||
@ -24,6 +24,12 @@ import java.util.Date;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发动机审核列表服务实现类
|
||||||
|
*
|
||||||
|
* @version 1.0
|
||||||
|
* @since 2025
|
||||||
|
*/
|
||||||
@Service
|
@Service
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class EngineReviewListServiceImpl implements EngineReviewListService {
|
public class EngineReviewListServiceImpl implements EngineReviewListService {
|
||||||
@ -32,6 +38,13 @@ public class EngineReviewListServiceImpl implements EngineReviewListService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private XdapDeptUsersService xdapDeptUsersService;
|
private XdapDeptUsersService xdapDeptUsersService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据用户ID查询发动机审核列表
|
||||||
|
* 根据请求参数查询发动机审核列表信息
|
||||||
|
*
|
||||||
|
* @param engineReviewListRequest 发动机审核列表请求
|
||||||
|
* @return 分页结果DTO
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public PageResultDTO<EngineReviewListPojo> selectEngineReviewListByUserId(EngineReviewListRequest engineReviewListRequest) {
|
public PageResultDTO<EngineReviewListPojo> selectEngineReviewListByUserId(EngineReviewListRequest engineReviewListRequest) {
|
||||||
|
|
||||||
@ -87,6 +100,13 @@ public class EngineReviewListServiceImpl implements EngineReviewListService {
|
|||||||
return pageResultDTO;
|
return pageResultDTO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 撤回审批
|
||||||
|
* 撤回指定ID的审批流程
|
||||||
|
*
|
||||||
|
* @param approvalId 审批ID
|
||||||
|
* @return 撤回结果
|
||||||
|
*/
|
||||||
//撤回审批
|
//撤回审批
|
||||||
@Override
|
@Override
|
||||||
public String returnApproval(String approvalId) {
|
public String returnApproval(String approvalId) {
|
||||||
|
|||||||
@ -13,6 +13,12 @@ import org.springframework.stereotype.Service;
|
|||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 模型菜单权限服务实现类
|
||||||
|
*
|
||||||
|
* @version 1.0
|
||||||
|
* @since 2025
|
||||||
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
public class ModelMenuPermissionServiceImpl implements ModelMenuPermissionService {
|
public class ModelMenuPermissionServiceImpl implements ModelMenuPermissionService {
|
||||||
@ -21,6 +27,12 @@ public class ModelMenuPermissionServiceImpl implements ModelMenuPermissionServic
|
|||||||
BusinessDatabase businessDatabase;
|
BusinessDatabase businessDatabase;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询菜单列表
|
||||||
|
* 查询所有的菜单列表信息
|
||||||
|
*
|
||||||
|
* @return 菜单列表视图
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<MenuListView> selectMenus() {
|
public List<MenuListView> selectMenus() {
|
||||||
|
|
||||||
@ -58,6 +70,13 @@ public class ModelMenuPermissionServiceImpl implements ModelMenuPermissionServic
|
|||||||
return views;
|
return views;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据菜单名称查询菜单
|
||||||
|
* 根据菜单名称查询菜单信息
|
||||||
|
*
|
||||||
|
* @param menuName 菜单名称
|
||||||
|
* @return 菜单字典POJO
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public ModelMenuDictionaryPojo selectMenuById(String menuName) {
|
public ModelMenuDictionaryPojo selectMenuById(String menuName) {
|
||||||
if (ObjectUtils.isEmpty(menuName)) {
|
if (ObjectUtils.isEmpty(menuName)) {
|
||||||
|
|||||||
@ -25,6 +25,12 @@ import java.util.*;
|
|||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 模型角色服务实现类
|
||||||
|
*
|
||||||
|
* @version 1.0
|
||||||
|
* @since 2025
|
||||||
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
public class ModelRoleServiceImpl implements ModelRoleService {
|
public class ModelRoleServiceImpl implements ModelRoleService {
|
||||||
@ -36,6 +42,13 @@ public class ModelRoleServiceImpl implements ModelRoleService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
XdapDeptUsersService xdapDeptUsersService;
|
XdapDeptUsersService xdapDeptUsersService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加角色
|
||||||
|
* 根据请求参数添加新角色
|
||||||
|
*
|
||||||
|
* @param request 模型角色请求
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void addRoles(ModelRolesRequest request) {
|
public void addRoles(ModelRolesRequest request) {
|
||||||
List<ModelRolesPojo> modelRolesPojos = businessDatabase.getBusinessDatabase()
|
List<ModelRolesPojo> modelRolesPojos = businessDatabase.getBusinessDatabase()
|
||||||
@ -54,11 +67,24 @@ public class ModelRoleServiceImpl implements ModelRoleService {
|
|||||||
.doInsert(modelRolesPojo);
|
.doInsert(modelRolesPojo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询角色
|
||||||
|
* 根据用户ID分页查询角色信息
|
||||||
|
*
|
||||||
|
* @param userID 用户ID
|
||||||
|
* @return 角色POJO分页结果
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public PageResultDTO<ModelRolesPojo> selectRolesByPage(String userID) {
|
public PageResultDTO<ModelRolesPojo> selectRolesByPage(String userID) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询所有角色
|
||||||
|
* 查询系统中的所有角色信息
|
||||||
|
*
|
||||||
|
* @return 角色POJO列表
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<ModelRolesPojo> selectRoles() {
|
public List<ModelRolesPojo> selectRoles() {
|
||||||
List<ModelRolesPojo> modelRolesPojos = businessDatabase.getBusinessDatabase()
|
List<ModelRolesPojo> modelRolesPojos = businessDatabase.getBusinessDatabase()
|
||||||
@ -67,6 +93,13 @@ public class ModelRoleServiceImpl implements ModelRoleService {
|
|||||||
return modelRolesPojos;
|
return modelRolesPojos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新角色权限
|
||||||
|
* 根据请求列表更新角色权限信息
|
||||||
|
*
|
||||||
|
* @param requests 角色权限关联请求列表
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public void updatePerForRole(List<RolePerJoinRequest> requests) {
|
public void updatePerForRole(List<RolePerJoinRequest> requests) {
|
||||||
@ -135,6 +168,14 @@ public class ModelRoleServiceImpl implements ModelRoleService {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新角色
|
||||||
|
* 根据角色信息和用户ID更新角色
|
||||||
|
*
|
||||||
|
* @param modelRolesPojo 模型角色POJO
|
||||||
|
* @param userID 用户ID
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void updateRole(ModelRolesPojo modelRolesPojo, String userID) {
|
public void updateRole(ModelRolesPojo modelRolesPojo, String userID) {
|
||||||
modelRolesPojo.setLastUpdatedBy(userID);
|
modelRolesPojo.setLastUpdatedBy(userID);
|
||||||
@ -147,6 +188,13 @@ public class ModelRoleServiceImpl implements ModelRoleService {
|
|||||||
.doUpdate(ModelRolesPojo.class);
|
.doUpdate(ModelRolesPojo.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据用户查询权限
|
||||||
|
* 根据用户或部门ID查询权限信息
|
||||||
|
*
|
||||||
|
* @param userOrDepID 用户或部门ID
|
||||||
|
* @return 菜单参数视图列表
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<MenuParamView> selectPersByUser(String userOrDepID) {
|
public List<MenuParamView> selectPersByUser(String userOrDepID) {
|
||||||
if (ObjectUtils.isEmpty(userOrDepID)) {
|
if (ObjectUtils.isEmpty(userOrDepID)) {
|
||||||
@ -166,6 +214,13 @@ public class ModelRoleServiceImpl implements ModelRoleService {
|
|||||||
return paramViews;
|
return paramViews;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据角色查询权限
|
||||||
|
* 根据角色ID查询权限信息
|
||||||
|
*
|
||||||
|
* @param roleID 角色ID
|
||||||
|
* @return 菜单参数视图列表
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<MenuParamView> selectPersByRole(String roleID) {
|
public List<MenuParamView> selectPersByRole(String roleID) {
|
||||||
if (ObjectUtils.isEmpty(roleID)) {
|
if (ObjectUtils.isEmpty(roleID)) {
|
||||||
@ -229,6 +284,14 @@ public class ModelRoleServiceImpl implements ModelRoleService {
|
|||||||
return menuParamViews;
|
return menuParamViews;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除角色
|
||||||
|
* 根据角色ID和用户ID删除角色
|
||||||
|
*
|
||||||
|
* @param roleID 角色ID
|
||||||
|
* @param userID 用户ID
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public void removeRoles(String roleID, String userID) {
|
public void removeRoles(String roleID, String userID) {
|
||||||
@ -250,6 +313,13 @@ public class ModelRoleServiceImpl implements ModelRoleService {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户角色绑定
|
||||||
|
* 将用户或部门与角色进行绑定
|
||||||
|
*
|
||||||
|
* @param userRoleBindingRequest 用户角色绑定请求
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public void userRoleBinding(UserRoleBindingRequest userRoleBindingRequest) {
|
public void userRoleBinding(UserRoleBindingRequest userRoleBindingRequest) {
|
||||||
@ -279,6 +349,13 @@ public class ModelRoleServiceImpl implements ModelRoleService {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据角色查询用户或部门
|
||||||
|
* 根据角色ID查询关联的用户或部门信息
|
||||||
|
*
|
||||||
|
* @param roleID 角色ID
|
||||||
|
* @return 用户或部门信息映射
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public HashMap<String, List<String>> selectUserOrDeptByRole(String roleID) {
|
public HashMap<String, List<String>> selectUserOrDeptByRole(String roleID) {
|
||||||
if (ObjectUtils.isEmpty(roleID)) {
|
if (ObjectUtils.isEmpty(roleID)) {
|
||||||
|
|||||||
@ -27,6 +27,12 @@ import java.time.LocalDateTime;
|
|||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 参数服务实现类
|
||||||
|
*
|
||||||
|
* @version 1.0
|
||||||
|
* @since 2025
|
||||||
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class ParameterServiceImpl implements ParameterService {
|
public class ParameterServiceImpl implements ParameterService {
|
||||||
@Resource
|
@Resource
|
||||||
@ -34,6 +40,13 @@ public class ParameterServiceImpl implements ParameterService {
|
|||||||
@Resource
|
@Resource
|
||||||
private ParameterService myself;
|
private ParameterService myself;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据条件获取参数
|
||||||
|
* 根据页面表单条件查询参数信息
|
||||||
|
*
|
||||||
|
* @param form 参数页面表单
|
||||||
|
* @return 参数POJO分页结果
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public MyPageResult<ParameterPojo> getParameterByCondition(ParameterPageForm form) {
|
public MyPageResult<ParameterPojo> getParameterByCondition(ParameterPageForm form) {
|
||||||
TemplatePojo template = bd.getBusinessDatabase()
|
TemplatePojo template = bd.getBusinessDatabase()
|
||||||
@ -43,21 +56,10 @@ public class ParameterServiceImpl implements ParameterService {
|
|||||||
if (template == null) {
|
if (template == null) {
|
||||||
throw new CommonException("模板未找到");
|
throw new CommonException("模板未找到");
|
||||||
}
|
}
|
||||||
// List<String> partsNames = permissionGetter.getParamPermissions(permissionGetter.getUserId());
|
|
||||||
// Set<String> objects = new HashSet<>();
|
|
||||||
// objects.addAll(permissionGetter.getParamPermissions(template.getTemplateName()));
|
|
||||||
// objects.addAll(bd.getBusinessDatabase()
|
|
||||||
// .viewQueryMode(true)
|
|
||||||
// .view("selectParametersByTIdAndCreateBy")
|
|
||||||
// .setVar("templateId", template.getId())
|
|
||||||
// .setVar("createdBy", permissionGetter.getCurrentUserId())
|
|
||||||
// .doQuery(ParameterPojo.class).stream().map(ParameterPojo::getId).collect(Collectors.toList()));
|
|
||||||
// List<String> parameterIds = new ArrayList<>(objects);
|
|
||||||
PageQueryResult<ParameterPojo> parameterPageQueryResult = bd.getBusinessDatabase()
|
PageQueryResult<ParameterPojo> parameterPageQueryResult = bd.getBusinessDatabase()
|
||||||
.viewQueryMode(true)
|
.viewQueryMode(true)
|
||||||
.view("selectParametersByTId")
|
.view("selectParametersByTId")
|
||||||
.setVar("templateId", template.getId())
|
.setVar("templateId", template.getId())
|
||||||
// .setVar("parameterIds", parameterIds)
|
|
||||||
.like("parameter_name", form.getParameterName())
|
.like("parameter_name", form.getParameterName())
|
||||||
.like("parts_name", form.getPartsName())
|
.like("parts_name", form.getPartsName())
|
||||||
.like("parameter_type", form.getParameterType())
|
.like("parameter_type", form.getParameterType())
|
||||||
@ -69,6 +71,13 @@ public class ParameterServiceImpl implements ParameterService {
|
|||||||
return myPageResult;
|
return myPageResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 维护参数
|
||||||
|
* 根据表单信息维护参数信息
|
||||||
|
*
|
||||||
|
* @param form 更新参数表单
|
||||||
|
* @return 模板信息视图
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public TemplateInfoView maintenanceParameters(UpdateParameterForm form) {
|
public TemplateInfoView maintenanceParameters(UpdateParameterForm form) {
|
||||||
@ -113,6 +122,10 @@ public class ParameterServiceImpl implements ParameterService {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验模板状态
|
* 校验模板状态
|
||||||
|
* 校验模板的当前状态是否允许修改
|
||||||
|
*
|
||||||
|
* @param benchmark 模板基准信息
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public void validateTemplateStatus(TemplateBenchmark benchmark) {
|
public void validateTemplateStatus(TemplateBenchmark benchmark) {
|
||||||
// 当前修改的模板不为最新版
|
// 当前修改的模板不为最新版
|
||||||
@ -139,6 +152,11 @@ public class ParameterServiceImpl implements ParameterService {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建/复用新版本模板
|
* 创建/复用新版本模板
|
||||||
|
* 根据基准信息和用户ID创建或复用新版本模板
|
||||||
|
*
|
||||||
|
* @param benchmark 模板基准信息
|
||||||
|
* @param userId 用户ID
|
||||||
|
* @return 模板POJO
|
||||||
*/
|
*/
|
||||||
public TemplatePojo createOrReuseNewTemplate(TemplateBenchmark benchmark, String userId) {
|
public TemplatePojo createOrReuseNewTemplate(TemplateBenchmark benchmark, String userId) {
|
||||||
TemplatePojo baseTemplate = benchmark.getBaseTemplate();
|
TemplatePojo baseTemplate = benchmark.getBaseTemplate();
|
||||||
@ -161,6 +179,13 @@ public class ParameterServiceImpl implements ParameterService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取模板基准
|
||||||
|
* 根据模板行ID获取模板基准信息
|
||||||
|
*
|
||||||
|
* @param templateRowId 模板行ID
|
||||||
|
* @return 模板基准信息
|
||||||
|
*/
|
||||||
public TemplateBenchmark getTemplateBenchmark(String templateRowId) {
|
public TemplateBenchmark getTemplateBenchmark(String templateRowId) {
|
||||||
// 基准模板(用户选择的要比较的版本)
|
// 基准模板(用户选择的要比较的版本)
|
||||||
TemplatePojo baseTemplate = bd.getBusinessDatabase()
|
TemplatePojo baseTemplate = bd.getBusinessDatabase()
|
||||||
@ -191,6 +216,9 @@ public class ParameterServiceImpl implements ParameterService {
|
|||||||
return new TemplateBenchmark(baseTemplate, lastTemplate, parameters);
|
return new TemplateBenchmark(baseTemplate, lastTemplate, parameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 模板基准信息封装类
|
||||||
|
*/
|
||||||
/**
|
/**
|
||||||
* 模板基准信息封装类
|
* 模板基准信息封装类
|
||||||
*/
|
*/
|
||||||
@ -202,6 +230,9 @@ public class ParameterServiceImpl implements ParameterService {
|
|||||||
private final List<ParameterPojo> parameters;
|
private final List<ParameterPojo> parameters;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 参数处理结果封装类
|
||||||
|
*/
|
||||||
/**
|
/**
|
||||||
* 参数处理结果封装类
|
* 参数处理结果封装类
|
||||||
*/
|
*/
|
||||||
@ -212,6 +243,13 @@ public class ParameterServiceImpl implements ParameterService {
|
|||||||
private final List<RevisionRecordPojo> revisionRecords;
|
private final List<RevisionRecordPojo> revisionRecords;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计算下一个版本号
|
||||||
|
* 根据当前版本号计算下一个版本号
|
||||||
|
*
|
||||||
|
* @param currentVersion 当前版本号
|
||||||
|
* @return 下一个版本号
|
||||||
|
*/
|
||||||
private Integer calculateNextVersion(Integer currentVersion) {
|
private Integer calculateNextVersion(Integer currentVersion) {
|
||||||
try {
|
try {
|
||||||
return currentVersion + 1;
|
return currentVersion + 1;
|
||||||
@ -220,6 +258,18 @@ public class ParameterServiceImpl implements ParameterService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理参数
|
||||||
|
* 根据表单和现有参数处理参数变更
|
||||||
|
*
|
||||||
|
* @param parameterForms 参数表单列表
|
||||||
|
* @param existingParameters 现有参数列表
|
||||||
|
* @param baseTemplate 基础模板
|
||||||
|
* @param newTemplate 新模板
|
||||||
|
* @param userId 用户ID
|
||||||
|
* @param isLastComplete 是否最后完成
|
||||||
|
* @return 参数处理结果
|
||||||
|
*/
|
||||||
public ParameterProcessingResult processParameters(
|
public ParameterProcessingResult processParameters(
|
||||||
List<ParameterForm> parameterForms,
|
List<ParameterForm> parameterForms,
|
||||||
List<ParameterPojo> existingParameters,
|
List<ParameterPojo> existingParameters,
|
||||||
@ -271,6 +321,15 @@ public class ParameterServiceImpl implements ParameterService {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 处理新增参数
|
* 处理新增参数
|
||||||
|
* 处理参数表单中的新增操作
|
||||||
|
*
|
||||||
|
* @param form 参数表单
|
||||||
|
* @param newTemplate 新模板
|
||||||
|
* @param newParameters 新参数列表
|
||||||
|
* @param revisionRecords 修订记录列表
|
||||||
|
* @param baseTemplate 基础模板
|
||||||
|
* @param userId 用户ID
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
private void handleInsertOperation(
|
private void handleInsertOperation(
|
||||||
ParameterForm form, TemplatePojo newTemplate,
|
ParameterForm form, TemplatePojo newTemplate,
|
||||||
@ -320,6 +379,16 @@ public class ParameterServiceImpl implements ParameterService {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 处理更新参数
|
* 处理更新参数
|
||||||
|
* 处理参数表单中的更新操作
|
||||||
|
*
|
||||||
|
* @param form 参数表单
|
||||||
|
* @param parameterMap 参数映射
|
||||||
|
* @param newTemplate 新模板
|
||||||
|
* @param newParameters 新参数列表
|
||||||
|
* @param revisionRecords 修订记录列表
|
||||||
|
* @param baseTemplate 基础模板
|
||||||
|
* @param userId 用户ID
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
private void handleUpdateOperation(
|
private void handleUpdateOperation(
|
||||||
ParameterForm form, Map<String, ParameterPojo> parameterMap,
|
ParameterForm form, Map<String, ParameterPojo> parameterMap,
|
||||||
@ -363,6 +432,14 @@ public class ParameterServiceImpl implements ParameterService {
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取参数变更
|
||||||
|
* 获取两个参数对象之间的变更信息
|
||||||
|
*
|
||||||
|
* @param originalParameter 原始参数
|
||||||
|
* @param updatedParameter 更新后参数
|
||||||
|
* @return 参数变更信息
|
||||||
|
*/
|
||||||
private String getParameterChange(ParameterPojo originalParameter, ParameterPojo updatedParameter) {
|
private String getParameterChange(ParameterPojo originalParameter, ParameterPojo updatedParameter) {
|
||||||
return handleParameterChange("参数名", originalParameter.getParameterName(), updatedParameter.getParameterName()) +
|
return handleParameterChange("参数名", originalParameter.getParameterName(), updatedParameter.getParameterName()) +
|
||||||
handleParameterChange("参数类型", originalParameter.getParameterType(), updatedParameter.getParameterType()) +
|
handleParameterChange("参数类型", originalParameter.getParameterType(), updatedParameter.getParameterType()) +
|
||||||
@ -374,6 +451,15 @@ public class ParameterServiceImpl implements ParameterService {
|
|||||||
handleParameterChange("部门名", originalParameter.getDepartment(), updatedParameter.getDepartment());
|
handleParameterChange("部门名", originalParameter.getDepartment(), updatedParameter.getDepartment());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理参数变更
|
||||||
|
* 处理单个参数字段的变更信息
|
||||||
|
*
|
||||||
|
* @param name 参数名称
|
||||||
|
* @param originalParameter 原始参数值
|
||||||
|
* @param updatedParameter 更新后参数值
|
||||||
|
* @return 参数变更信息
|
||||||
|
*/
|
||||||
private String handleParameterChange(String name, String originalParameter, String updatedParameter) {
|
private String handleParameterChange(String name, String originalParameter, String updatedParameter) {
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
if ((originalParameter == null && (updatedParameter == null || updatedParameter.isEmpty()))) {
|
if ((originalParameter == null && (updatedParameter == null || updatedParameter.isEmpty()))) {
|
||||||
@ -399,6 +485,14 @@ public class ParameterServiceImpl implements ParameterService {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 处理删除参数
|
* 处理删除参数
|
||||||
|
* 处理参数表单中的删除操作
|
||||||
|
*
|
||||||
|
* @param form 参数表单
|
||||||
|
* @param parameterMap 参数映射
|
||||||
|
* @param newTemplate 新模板
|
||||||
|
* @param revisionRecords 修订记录列表
|
||||||
|
* @param baseTemplate 基础模板
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
private void handleDeleteOperation(
|
private void handleDeleteOperation(
|
||||||
ParameterForm form, Map<String, ParameterPojo> parameterMap,
|
ParameterForm form, Map<String, ParameterPojo> parameterMap,
|
||||||
@ -424,6 +518,13 @@ public class ParameterServiceImpl implements ParameterService {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 处理未修改参数
|
* 处理未修改参数
|
||||||
|
* 处理参数表单中的未修改操作
|
||||||
|
*
|
||||||
|
* @param form 参数表单
|
||||||
|
* @param parameterMap 参数映射
|
||||||
|
* @param newParameters 新参数列表
|
||||||
|
* @param isLastComplete 是否最后完成
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
private void handleUnchangedOperation(
|
private void handleUnchangedOperation(
|
||||||
ParameterForm form, Map<String, ParameterPojo> parameterMap,
|
ParameterForm form, Map<String, ParameterPojo> parameterMap,
|
||||||
@ -441,6 +542,14 @@ public class ParameterServiceImpl implements ParameterService {
|
|||||||
newParameters.add(unchangedParameter);
|
newParameters.add(unchangedParameter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查找未匹配的参数
|
||||||
|
* 查找参数映射中未在参数表单中出现的参数
|
||||||
|
*
|
||||||
|
* @param parameterMap 参数映射
|
||||||
|
* @param parameterForms 参数表单列表
|
||||||
|
* @return 未匹配的参数列表
|
||||||
|
*/
|
||||||
public List<ParameterPojo> findUnmatchedParameters(
|
public List<ParameterPojo> findUnmatchedParameters(
|
||||||
Map<String, ParameterPojo> parameterMap,
|
Map<String, ParameterPojo> parameterMap,
|
||||||
List<ParameterForm> parameterForms) {
|
List<ParameterForm> parameterForms) {
|
||||||
@ -456,6 +565,12 @@ public class ParameterServiceImpl implements ParameterService {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存所有数据
|
* 保存所有数据
|
||||||
|
* 保存模板和参数处理结果的所有数据
|
||||||
|
*
|
||||||
|
* @param originalTemplate 原始模板
|
||||||
|
* @param newTemplate 新模板
|
||||||
|
* @param result 参数处理结果
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public void saveAllData(TemplatePojo originalTemplate, TemplatePojo newTemplate, ParameterProcessingResult result) {
|
public void saveAllData(TemplatePojo originalTemplate, TemplatePojo newTemplate, ParameterProcessingResult result) {
|
||||||
List<String> parameterIds = bd.getBusinessDatabase()
|
List<String> parameterIds = bd.getBusinessDatabase()
|
||||||
@ -492,6 +607,11 @@ public class ParameterServiceImpl implements ParameterService {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建模板参数关联
|
* 创建模板参数关联
|
||||||
|
* 创建模板和参数的关联对象
|
||||||
|
*
|
||||||
|
* @param templateId 模板ID
|
||||||
|
* @param parameterId 参数ID
|
||||||
|
* @return 模板参数关联POJO
|
||||||
*/
|
*/
|
||||||
private TemplateAndParameterPojo createTemplateAndParameter(String templateId, String parameterId) {
|
private TemplateAndParameterPojo createTemplateAndParameter(String templateId, String parameterId) {
|
||||||
TemplateAndParameterPojo tap = new TemplateAndParameterPojo();
|
TemplateAndParameterPojo tap = new TemplateAndParameterPojo();
|
||||||
|
|||||||
@ -17,12 +17,10 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* 责任人服务实现类
|
||||||
* 责任人表 服务实现类
|
|
||||||
* </p>
|
|
||||||
*
|
*
|
||||||
* @author Lys111
|
* @version 1.0
|
||||||
* @since 2025-11-13
|
* @since 2025
|
||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
@ -32,6 +30,14 @@ public class ResponsiblePerServiceImpl implements ResponsiblePerService {
|
|||||||
private MpaasQueryFactory sw;
|
private MpaasQueryFactory sw;
|
||||||
@Autowired
|
@Autowired
|
||||||
private XdapDeptUsersService xdapDeptUsersService;
|
private XdapDeptUsersService xdapDeptUsersService;
|
||||||
|
/**
|
||||||
|
* 根据部门和人员查询责任人
|
||||||
|
* 根据部门名称和人员名称查询责任人信息
|
||||||
|
*
|
||||||
|
* @param department 部门名称
|
||||||
|
* @param resPerson 人员名称
|
||||||
|
* @return 责任人POJO
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public ResponsiblePersonPojo selectByDepAndPer(String department, String resPerson) {
|
public ResponsiblePersonPojo selectByDepAndPer(String department, String resPerson) {
|
||||||
if (ObjectUtils.isEmpty(department) || ObjectUtils.isEmpty(resPerson)) {
|
if (ObjectUtils.isEmpty(department) || ObjectUtils.isEmpty(resPerson)) {
|
||||||
@ -52,6 +58,13 @@ public class ResponsiblePerServiceImpl implements ResponsiblePerService {
|
|||||||
return ResponsiblePerson;
|
return ResponsiblePerson;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据部门查询责任人
|
||||||
|
* 根据部门ID查询责任人信息
|
||||||
|
*
|
||||||
|
* @param departmentId 部门ID
|
||||||
|
* @return 责任人POJO
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public ResponsiblePersonPojo selectByDep(String departmentId) {
|
public ResponsiblePersonPojo selectByDep(String departmentId) {
|
||||||
if (ObjectUtils.isEmpty(departmentId) && ObjectUtils.isEmpty(departmentId)) {
|
if (ObjectUtils.isEmpty(departmentId) && ObjectUtils.isEmpty(departmentId)) {
|
||||||
@ -68,6 +81,13 @@ public class ResponsiblePerServiceImpl implements ResponsiblePerService {
|
|||||||
return ResponsiblePerson;
|
return ResponsiblePerson;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据用户ID查询责任人
|
||||||
|
* 根据用户列表查询相关责任人信息
|
||||||
|
*
|
||||||
|
* @param userIds 用户列表
|
||||||
|
* @return 责任人POJO列表
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<ResponsiblePersonPojo> selectByUserId(List<XdapUsers> userIds) {
|
public List<ResponsiblePersonPojo> selectByUserId(List<XdapUsers> userIds) {
|
||||||
if (ObjectUtils.isEmpty(userIds)) {
|
if (ObjectUtils.isEmpty(userIds)) {
|
||||||
@ -83,6 +103,13 @@ public class ResponsiblePerServiceImpl implements ResponsiblePerService {
|
|||||||
return personPojos;
|
return personPojos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据部门名称查询责任人
|
||||||
|
* 根据部门名称查询相关责任人信息
|
||||||
|
*
|
||||||
|
* @param departmentName 部门名称
|
||||||
|
* @return 责任人POJO列表
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<ResponsiblePersonPojo> selectByDepName(String departmentName) {
|
public List<ResponsiblePersonPojo> selectByDepName(String departmentName) {
|
||||||
XdapDepartments XdapDepartments = xdapDeptUsersService.selectDeptByName(departmentName);
|
XdapDepartments XdapDepartments = xdapDeptUsersService.selectDeptByName(departmentName);
|
||||||
@ -95,6 +122,13 @@ public class ResponsiblePerServiceImpl implements ResponsiblePerService {
|
|||||||
return personPojos;
|
return personPojos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 插入责任人
|
||||||
|
* 插入责任人信息到数据库
|
||||||
|
*
|
||||||
|
* @param ResponsiblePerson 责任人POJO
|
||||||
|
* @return 插入结果
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Object insert(ResponsiblePersonPojo ResponsiblePerson) {
|
public Object insert(ResponsiblePersonPojo ResponsiblePerson) {
|
||||||
Object testDemo = null;
|
Object testDemo = null;
|
||||||
@ -108,6 +142,12 @@ public class ResponsiblePerServiceImpl implements ResponsiblePerService {
|
|||||||
return testDemo;
|
return testDemo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询所有责任人
|
||||||
|
* 查询数据库中所有的责任人信息
|
||||||
|
*
|
||||||
|
* @return 责任人POJO列表
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<ResponsiblePersonPojo> seelctAll() {
|
public List<ResponsiblePersonPojo> seelctAll() {
|
||||||
List<ResponsiblePersonPojo> personPojos = sw.buildFromDatasource("xdap_app_223770822127386625")
|
List<ResponsiblePersonPojo> personPojos = sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
@ -115,6 +155,13 @@ public class ResponsiblePerServiceImpl implements ResponsiblePerService {
|
|||||||
return personPojos;
|
return personPojos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据ID查询责任人
|
||||||
|
* 根据责任人ID查询责任人信息
|
||||||
|
*
|
||||||
|
* @param responsiblePersonId 责任人ID
|
||||||
|
* @return 责任人POJO
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public ResponsiblePersonPojo selectById(String responsiblePersonId) {
|
public ResponsiblePersonPojo selectById(String responsiblePersonId) {
|
||||||
if (ObjectUtils.isEmpty(responsiblePersonId)) {
|
if (ObjectUtils.isEmpty(responsiblePersonId)) {
|
||||||
@ -130,6 +177,14 @@ public class ResponsiblePerServiceImpl implements ResponsiblePerService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据子系统和部门查询责任人
|
||||||
|
* 根据子系统名称和部门名称查询责任人信息
|
||||||
|
*
|
||||||
|
* @param subSystem 子系统名称
|
||||||
|
* @param dept 部门名称
|
||||||
|
* @return 责任人POJO列表
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<ResponsiblePersonPojo> selectBysubSystemDept(String subSystem, String dept) {
|
public List<ResponsiblePersonPojo> selectBysubSystemDept(String subSystem, String dept) {
|
||||||
List<ResponsiblePersonPojo> personPojos = sw.buildFromDatasource("xdap_app_223770822127386625")
|
List<ResponsiblePersonPojo> personPojos = sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
|
|||||||
@ -34,6 +34,12 @@ import java.util.List;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 责任人服务实现类
|
||||||
|
*
|
||||||
|
* @version 1.0
|
||||||
|
* @since 2025
|
||||||
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class ResponsiblePersonServiceImpl implements ResponsiblePersonService {
|
public class ResponsiblePersonServiceImpl implements ResponsiblePersonService {
|
||||||
@Resource
|
@Resource
|
||||||
@ -44,6 +50,11 @@ public class ResponsiblePersonServiceImpl implements ResponsiblePersonService {
|
|||||||
private XdapDeptUsersService xdapDeptUsersService;
|
private XdapDeptUsersService xdapDeptUsersService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
/**
|
||||||
|
* 保存责任人信息
|
||||||
|
*
|
||||||
|
* @param form 责任人表单数据
|
||||||
|
*/
|
||||||
public void saveResponsiblePerson(ResponsiblePersonForm form) {
|
public void saveResponsiblePerson(ResponsiblePersonForm form) {
|
||||||
List<ResponsiblePersonPojo> responsiblePeople = bd.getBusinessDatabase()
|
List<ResponsiblePersonPojo> responsiblePeople = bd.getBusinessDatabase()
|
||||||
.eq("department_id", form.getDepartmentId())
|
.eq("department_id", form.getDepartmentId())
|
||||||
@ -66,6 +77,11 @@ public class ResponsiblePersonServiceImpl implements ResponsiblePersonService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
/**
|
||||||
|
* 保存填写人信息
|
||||||
|
*
|
||||||
|
* @param form 填写人表单数据
|
||||||
|
*/
|
||||||
public void saveFilledPerson(FilledPersonForm form) {
|
public void saveFilledPerson(FilledPersonForm form) {
|
||||||
List<ResponsiblePersonPojo> responsiblePeople = bd.getBusinessDatabase()
|
List<ResponsiblePersonPojo> responsiblePeople = bd.getBusinessDatabase()
|
||||||
.eq("userId", form.getUserId())
|
.eq("userId", form.getUserId())
|
||||||
@ -81,12 +97,16 @@ public class ResponsiblePersonServiceImpl implements ResponsiblePersonService {
|
|||||||
responsiblePerson.setDepartmentId(form.getDepartmentId());
|
responsiblePerson.setDepartmentId(form.getDepartmentId());
|
||||||
responsiblePerson.setUserId(form.getUserId());
|
responsiblePerson.setUserId(form.getUserId());
|
||||||
responsiblePerson.setSubsystem(form.getSubsystem());
|
responsiblePerson.setSubsystem(form.getSubsystem());
|
||||||
// responsiblePerson.setPartsName(form.getPartsName());
|
|
||||||
responsiblePerson.setPersonLevel(2);
|
responsiblePerson.setPersonLevel(2);
|
||||||
bd.getBusinessDatabase().doInsert(responsiblePerson);
|
bd.getBusinessDatabase().doInsert(responsiblePerson);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
/**
|
||||||
|
* 更新责任人信息
|
||||||
|
*
|
||||||
|
* @param form 更新责任人表单数据
|
||||||
|
*/
|
||||||
public void updateResponsiblePerson(UpdateResponsiblePersonForm form) {
|
public void updateResponsiblePerson(UpdateResponsiblePersonForm form) {
|
||||||
bd.getBusinessDatabase()
|
bd.getBusinessDatabase()
|
||||||
.rowid("id", form.getRowId())
|
.rowid("id", form.getRowId())
|
||||||
@ -99,6 +119,11 @@ public class ResponsiblePersonServiceImpl implements ResponsiblePersonService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
/**
|
||||||
|
* 更新填写人信息
|
||||||
|
*
|
||||||
|
* @param form 更新填写人表单数据
|
||||||
|
*/
|
||||||
public void updateFilledPerson(UpdateFilledPersonForm form) {
|
public void updateFilledPerson(UpdateFilledPersonForm form) {
|
||||||
bd.getBusinessDatabase()
|
bd.getBusinessDatabase()
|
||||||
.rowid("id", form.getRowId())
|
.rowid("id", form.getRowId())
|
||||||
@ -111,6 +136,11 @@ public class ResponsiblePersonServiceImpl implements ResponsiblePersonService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
/**
|
||||||
|
* 删除责任人信息
|
||||||
|
*
|
||||||
|
* @param rowId 行ID
|
||||||
|
*/
|
||||||
public void deleteResponsiblePerson(String rowId) {
|
public void deleteResponsiblePerson(String rowId) {
|
||||||
bd.getBusinessDatabase()
|
bd.getBusinessDatabase()
|
||||||
.rowid("id", rowId)
|
.rowid("id", rowId)
|
||||||
@ -118,6 +148,12 @@ public class ResponsiblePersonServiceImpl implements ResponsiblePersonService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
/**
|
||||||
|
* 获取部门责任人信息
|
||||||
|
*
|
||||||
|
* @param form 部门责任人分页表单
|
||||||
|
* @return 部门责任人分页查询结果
|
||||||
|
*/
|
||||||
public PageQueryResult<ResponsiblePersonPojo> getDeptResponsible(DeptResponsiblePageForm form) {
|
public PageQueryResult<ResponsiblePersonPojo> getDeptResponsible(DeptResponsiblePageForm form) {
|
||||||
|
|
||||||
return bd.getBusinessDatabase()
|
return bd.getBusinessDatabase()
|
||||||
@ -128,6 +164,12 @@ public class ResponsiblePersonServiceImpl implements ResponsiblePersonService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
/**
|
||||||
|
* 获取部门填写人信息
|
||||||
|
*
|
||||||
|
* @param form 部门填写人分页表单
|
||||||
|
* @return 部门填写人分页查询结果
|
||||||
|
*/
|
||||||
public PageQueryResult<ResponsiblePersonPojo> getDeptFilled(DeptResponsiblePageForm form) {
|
public PageQueryResult<ResponsiblePersonPojo> getDeptFilled(DeptResponsiblePageForm form) {
|
||||||
return bd.getBusinessDatabase()
|
return bd.getBusinessDatabase()
|
||||||
.viewQueryMode(true).view("getResponsibleAndName")
|
.viewQueryMode(true).view("getResponsibleAndName")
|
||||||
@ -136,6 +178,12 @@ public class ResponsiblePersonServiceImpl implements ResponsiblePersonService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
/**
|
||||||
|
* 判断用户是否为责任人
|
||||||
|
*
|
||||||
|
* @param userId 用户ID
|
||||||
|
* @return 是否为责任人
|
||||||
|
*/
|
||||||
public Boolean isResponsiblePerson(String userId) {
|
public Boolean isResponsiblePerson(String userId) {
|
||||||
List<ResponsiblePersonPojo> responsiblePeople = bd.getBusinessDatabase()
|
List<ResponsiblePersonPojo> responsiblePeople = bd.getBusinessDatabase()
|
||||||
.eq("userId", userId)
|
.eq("userId", userId)
|
||||||
@ -144,6 +192,11 @@ public class ResponsiblePersonServiceImpl implements ResponsiblePersonService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
/**
|
||||||
|
* 获取所有子系统
|
||||||
|
*
|
||||||
|
* @return 所有子系统的集合
|
||||||
|
*/
|
||||||
public Set<String> getAllSubsystem() {
|
public Set<String> getAllSubsystem() {
|
||||||
List<ParameterPojo> templates = bd
|
List<ParameterPojo> templates = bd
|
||||||
.getBusinessDatabase()
|
.getBusinessDatabase()
|
||||||
@ -154,6 +207,13 @@ public class ResponsiblePersonServiceImpl implements ResponsiblePersonService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
/**
|
||||||
|
* 根据部门和子系统获取用户
|
||||||
|
*
|
||||||
|
* @param dept 部门名称
|
||||||
|
* @param subsystem 子系统名称
|
||||||
|
* @return 部门用户的ArrayList
|
||||||
|
*/
|
||||||
public ArrayList<XdapUsers> getUserBydepartment(String dept,String subsystem) {
|
public ArrayList<XdapUsers> getUserBydepartment(String dept,String subsystem) {
|
||||||
if (ObjectUtils.isEmpty(dept)) {
|
if (ObjectUtils.isEmpty(dept)) {
|
||||||
return null;
|
return null;
|
||||||
@ -176,6 +236,11 @@ public class ResponsiblePersonServiceImpl implements ResponsiblePersonService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
/**
|
||||||
|
* 导出责任人信息
|
||||||
|
*
|
||||||
|
* @param response HTTP响应对象
|
||||||
|
*/
|
||||||
public void exportPerson(HttpServletResponse response) {
|
public void exportPerson(HttpServletResponse response) {
|
||||||
String fileName = "部门责任人_" +
|
String fileName = "部门责任人_" +
|
||||||
LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd_HH-mm-ss"));
|
LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd_HH-mm-ss"));
|
||||||
@ -205,6 +270,11 @@ public class ResponsiblePersonServiceImpl implements ResponsiblePersonService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
/**
|
||||||
|
* 导出空责任人模板
|
||||||
|
*
|
||||||
|
* @param response HTTP响应对象
|
||||||
|
*/
|
||||||
public void exportVoidPerson(HttpServletResponse response) {
|
public void exportVoidPerson(HttpServletResponse response) {
|
||||||
String fileName = "部门责任人导入模板_" +
|
String fileName = "部门责任人导入模板_" +
|
||||||
LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd_HH-mm-ss"));
|
LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd_HH-mm-ss"));
|
||||||
@ -231,6 +301,13 @@ public class ResponsiblePersonServiceImpl implements ResponsiblePersonService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
/**
|
||||||
|
* 导入责任人信息
|
||||||
|
*
|
||||||
|
* @param file 上传的文件
|
||||||
|
* @param userId 用户ID
|
||||||
|
* @return 操作响应结果
|
||||||
|
*/
|
||||||
public MyResponse importPerson(MultipartFile file, String userId) {
|
public MyResponse importPerson(MultipartFile file, String userId) {
|
||||||
// 验证文件是否为工作表
|
// 验证文件是否为工作表
|
||||||
if (file == null || file.isEmpty()) {
|
if (file == null || file.isEmpty()) {
|
||||||
@ -261,6 +338,14 @@ public class ResponsiblePersonServiceImpl implements ResponsiblePersonService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
/**
|
||||||
|
* 根据部门和用户名获取用户视图
|
||||||
|
*
|
||||||
|
* @param department 部门名称
|
||||||
|
* @param userAccount 用户账号
|
||||||
|
* @param username 用户名
|
||||||
|
* @return 用户视图对象
|
||||||
|
*/
|
||||||
public XdapUserView getUserByDeptAndName(String department, String userAccount, String username) {
|
public XdapUserView getUserByDeptAndName(String department, String userAccount, String username) {
|
||||||
XdapUserView xdapUserView = new XdapUserView();
|
XdapUserView xdapUserView = new XdapUserView();
|
||||||
xdapUserView.setDepartmentId(
|
xdapUserView.setDepartmentId(
|
||||||
@ -279,6 +364,12 @@ public class ResponsiblePersonServiceImpl implements ResponsiblePersonService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
|
/**
|
||||||
|
* 导入所有责任人信息
|
||||||
|
*
|
||||||
|
* @param cachedDataList 缓存的数据列表
|
||||||
|
* @param problems 问题收集对象
|
||||||
|
*/
|
||||||
public void importAllPerson(List<ResponsiblePersonPojo> cachedDataList, MyResponse problems) {
|
public void importAllPerson(List<ResponsiblePersonPojo> cachedDataList, MyResponse problems) {
|
||||||
cachedDataList.forEach(item -> {
|
cachedDataList.forEach(item -> {
|
||||||
List<ResponsiblePersonPojo> responsiblePeople = bd.getBusinessDatabase()
|
List<ResponsiblePersonPojo> responsiblePeople = bd.getBusinessDatabase()
|
||||||
|
|||||||
@ -32,6 +32,12 @@ import java.time.format.DateTimeFormatter;
|
|||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TC数据查询服务实现类
|
||||||
|
*
|
||||||
|
* @version 1.0
|
||||||
|
* @since 2025
|
||||||
|
*/
|
||||||
@Service
|
@Service
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class TcDataQueryServiceImpl implements TcDataQueryService {
|
public class TcDataQueryServiceImpl implements TcDataQueryService {
|
||||||
@ -57,6 +63,14 @@ public class TcDataQueryServiceImpl implements TcDataQueryService {
|
|||||||
|
|
||||||
//产品编号(状态代号) = 状态机
|
//产品编号(状态代号) = 状态机
|
||||||
@Override
|
@Override
|
||||||
|
/**
|
||||||
|
* 根据产品编号查询TC数据
|
||||||
|
*
|
||||||
|
* @param productNumber 产品编号
|
||||||
|
* @param partsName 部件名称
|
||||||
|
* @param parameterName 参数名称
|
||||||
|
* @return 分类属性映射
|
||||||
|
*/
|
||||||
public HashMap<String, List<ClassificationAttributePojo>> tcDataSelectByC(String productNumber, String partsName, String parameterName) {
|
public HashMap<String, List<ClassificationAttributePojo>> tcDataSelectByC(String productNumber, String partsName, String parameterName) {
|
||||||
|
|
||||||
EnginePartsCollectionPojo enginePartsCollection = bd.getTCDatabase()
|
EnginePartsCollectionPojo enginePartsCollection = bd.getTCDatabase()
|
||||||
@ -77,6 +91,12 @@ public class TcDataQueryServiceImpl implements TcDataQueryService {
|
|||||||
|
|
||||||
//通过状态代号(产品编号)
|
//通过状态代号(产品编号)
|
||||||
@Override
|
@Override
|
||||||
|
/**
|
||||||
|
* 根据产品编号查询所有TC数据
|
||||||
|
*
|
||||||
|
* @param engineModelPojo 引擎模型对象
|
||||||
|
* @return 引擎参数详情列表
|
||||||
|
*/
|
||||||
public ArrayList<EngineParamDetailPojo> tcDataSelectAllByproductNumber(DataEntryEngineModelPojo engineModelPojo) {
|
public ArrayList<EngineParamDetailPojo> tcDataSelectAllByproductNumber(DataEntryEngineModelPojo engineModelPojo) {
|
||||||
String productNumber = engineModelPojo.getProductNumber();
|
String productNumber = engineModelPojo.getProductNumber();
|
||||||
HashMap<String, List<ClassificationAttributePojo>> stringListHashMap = new HashMap<>();
|
HashMap<String, List<ClassificationAttributePojo>> stringListHashMap = new HashMap<>();
|
||||||
@ -134,12 +154,24 @@ public class TcDataQueryServiceImpl implements TcDataQueryService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
/**
|
||||||
|
* 根据部件名称查询所有TC数据
|
||||||
|
*
|
||||||
|
* @param analysisRequest 分析请求对象
|
||||||
|
* @return 引擎参数详情映射
|
||||||
|
*/
|
||||||
public Map<String, List<EngineParamDetailPojo>> tcDataSelectAllByPartsName(AnalysisRequest analysisRequest) {
|
public Map<String, List<EngineParamDetailPojo>> tcDataSelectAllByPartsName(AnalysisRequest analysisRequest) {
|
||||||
return tcDataSelectAllByPartsNameFunctionOptimized(analysisRequest);
|
return tcDataSelectAllByPartsNameFunctionOptimized(analysisRequest);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
/**
|
||||||
|
* 根据部件名称查询所有TC数据(备份方法)
|
||||||
|
*
|
||||||
|
* @param analysisRequest 分析请求对象
|
||||||
|
* @return 引擎参数详情映射
|
||||||
|
*/
|
||||||
public Map<String, List<EngineParamDetailPojo>> tcDataSelectAllByPartsNameBack(AnalysisRequest analysisRequest) {
|
public Map<String, List<EngineParamDetailPojo>> tcDataSelectAllByPartsNameBack(AnalysisRequest analysisRequest) {
|
||||||
return tcDataSelectAllByPartsNameFunction(analysisRequest);
|
return tcDataSelectAllByPartsNameFunction(analysisRequest);
|
||||||
|
|
||||||
@ -369,6 +401,11 @@ public class TcDataQueryServiceImpl implements TcDataQueryService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
/**
|
||||||
|
* 导出Excel A格式
|
||||||
|
*
|
||||||
|
* @param response HTTP响应对象
|
||||||
|
*/
|
||||||
public void excelExportA(HttpServletResponse response) {
|
public void excelExportA(HttpServletResponse response) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -397,6 +434,11 @@ public class TcDataQueryServiceImpl implements TcDataQueryService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
/**
|
||||||
|
* 导出Excel B格式
|
||||||
|
*
|
||||||
|
* @param response HTTP响应对象
|
||||||
|
*/
|
||||||
public void excelExportB(HttpServletResponse response) {
|
public void excelExportB(HttpServletResponse response) {
|
||||||
try (ExcelWriter excelWriter = EasyExcel.write(response.getOutputStream()).build()) {
|
try (ExcelWriter excelWriter = EasyExcel.write(response.getOutputStream()).build()) {
|
||||||
ArrayList<ClassificationAttributePojo> enginePartsCollections = new ArrayList<>();
|
ArrayList<ClassificationAttributePojo> enginePartsCollections = new ArrayList<>();
|
||||||
@ -419,6 +461,12 @@ public class TcDataQueryServiceImpl implements TcDataQueryService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
/**
|
||||||
|
* 模型对比导出
|
||||||
|
*
|
||||||
|
* @param request 模型对比导出请求对象
|
||||||
|
* @param response HTTP响应对象
|
||||||
|
*/
|
||||||
public void modelComparisonExport(ModelComparisonExportRequest request, HttpServletResponse response) {
|
public void modelComparisonExport(ModelComparisonExportRequest request, HttpServletResponse response) {
|
||||||
List<ModelItem> models = request.getModelIds();
|
List<ModelItem> models = request.getModelIds();
|
||||||
String userID = request.getUserID();
|
String userID = request.getUserID();
|
||||||
@ -616,6 +664,12 @@ public class TcDataQueryServiceImpl implements TcDataQueryService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
/**
|
||||||
|
* 根据版本查询TC数据
|
||||||
|
*
|
||||||
|
* @param analysisRequest 版本分析请求对象
|
||||||
|
* @return 引擎参数详情映射
|
||||||
|
*/
|
||||||
public Map<String, List<EngineParamDetailPojo>> tcDataSelectByVersion(AnalysisVerRequest analysisRequest) {
|
public Map<String, List<EngineParamDetailPojo>> tcDataSelectByVersion(AnalysisVerRequest analysisRequest) {
|
||||||
// List<EngineParamDetailPojo> allPojos = new ArrayList<>();
|
// List<EngineParamDetailPojo> allPojos = new ArrayList<>();
|
||||||
List<ParameterPojo> parameters = engineParamDetailService.selectAllAndTcByNewVersion();
|
List<ParameterPojo> parameters = engineParamDetailService.selectAllAndTcByNewVersion();
|
||||||
@ -758,6 +812,12 @@ public class TcDataQueryServiceImpl implements TcDataQueryService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
/**
|
||||||
|
* 批量根据产品编号查询所有TC数据
|
||||||
|
*
|
||||||
|
* @param engineModelPojos 引擎模型对象列表
|
||||||
|
* @return 引擎参数详情列表
|
||||||
|
*/
|
||||||
public List<EngineParamDetailPojo> tcDataSelectAllByproductNumberBatch(List<DataEntryEngineModelPojo> engineModelPojos) {
|
public List<EngineParamDetailPojo> tcDataSelectAllByproductNumberBatch(List<DataEntryEngineModelPojo> engineModelPojos) {
|
||||||
// 收集所有 productNumber
|
// 收集所有 productNumber
|
||||||
Set<String> productNumbers = engineModelPojos.stream()
|
Set<String> productNumbers = engineModelPojos.stream()
|
||||||
|
|||||||
@ -28,6 +28,12 @@ import java.util.concurrent.TimeUnit;
|
|||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 模板审批服务实现类
|
||||||
|
*
|
||||||
|
* @version 1.0
|
||||||
|
* @since 2025
|
||||||
|
*/
|
||||||
@Service
|
@Service
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class TemplateApprovalServiceImpl implements TemplateApprovalService {
|
public class TemplateApprovalServiceImpl implements TemplateApprovalService {
|
||||||
@ -47,6 +53,12 @@ public class TemplateApprovalServiceImpl implements TemplateApprovalService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
|
/**
|
||||||
|
* 开始审批流程
|
||||||
|
*
|
||||||
|
* @param request 启动审批请求对象
|
||||||
|
* @return 审批流程ID
|
||||||
|
*/
|
||||||
public String startApproval(StartApprovalRequest request) {
|
public String startApproval(StartApprovalRequest request) {
|
||||||
// 验证能否发起审批
|
// 验证能否发起审批
|
||||||
TemplatePojo template = bd.getBusinessDatabase()
|
TemplatePojo template = bd.getBusinessDatabase()
|
||||||
@ -195,6 +207,12 @@ public class TemplateApprovalServiceImpl implements TemplateApprovalService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
|
/**
|
||||||
|
* 继续审批流程
|
||||||
|
*
|
||||||
|
* @param flowId 流程ID
|
||||||
|
* @param userId 用户ID
|
||||||
|
*/
|
||||||
public void continueApproval(String flowId, String userId) {
|
public void continueApproval(String flowId, String userId) {
|
||||||
ApprovalFlowPojo flow = bd.getBusinessDatabase()
|
ApprovalFlowPojo flow = bd.getBusinessDatabase()
|
||||||
.eq("id", flowId)
|
.eq("id", flowId)
|
||||||
@ -276,6 +294,12 @@ public class TemplateApprovalServiceImpl implements TemplateApprovalService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
|
/**
|
||||||
|
* 直送审批
|
||||||
|
*
|
||||||
|
* @param templateId 模板ID
|
||||||
|
* @param userId 用户ID
|
||||||
|
*/
|
||||||
public void directSendingApproval(String templateId, String userId) {
|
public void directSendingApproval(String templateId, String userId) {
|
||||||
// 获取模板
|
// 获取模板
|
||||||
TemplatePojo template = bd.getBusinessDatabase()
|
TemplatePojo template = bd.getBusinessDatabase()
|
||||||
@ -365,6 +389,12 @@ public class TemplateApprovalServiceImpl implements TemplateApprovalService {
|
|||||||
|
|
||||||
// 查询所有流程
|
// 查询所有流程
|
||||||
@Override
|
@Override
|
||||||
|
/**
|
||||||
|
* 获取审批列表
|
||||||
|
*
|
||||||
|
* @param form 审批列表表单
|
||||||
|
* @return 待办和模板视图分页结果
|
||||||
|
*/
|
||||||
public PageQueryResult<TodoAndTemplateView> getApprovalList(ApprovalListForm form) {
|
public PageQueryResult<TodoAndTemplateView> getApprovalList(ApprovalListForm form) {
|
||||||
PageQueryResult<TodoAndTemplateView> result = bd.getBusinessDatabase()
|
PageQueryResult<TodoAndTemplateView> result = bd.getBusinessDatabase()
|
||||||
.viewQueryMode(true)
|
.viewQueryMode(true)
|
||||||
@ -396,6 +426,11 @@ public class TemplateApprovalServiceImpl implements TemplateApprovalService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
|
/**
|
||||||
|
* 处理审批
|
||||||
|
*
|
||||||
|
* @param request 审批处理请求对象
|
||||||
|
*/
|
||||||
public void handleApproval(HandleApprovalRequest request) {
|
public void handleApproval(HandleApprovalRequest request) {
|
||||||
// 验证流程状态和用户权限
|
// 验证流程状态和用户权限
|
||||||
ApprovalFlowPojo flow = bd.getBusinessDatabase()
|
ApprovalFlowPojo flow = bd.getBusinessDatabase()
|
||||||
@ -455,6 +490,7 @@ public class TemplateApprovalServiceImpl implements TemplateApprovalService {
|
|||||||
.toJavaList(String.class).contains(userId);
|
.toJavaList(String.class).contains(userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void processApprovalLogic(
|
public void processApprovalLogic(
|
||||||
ApprovalFlowPojo flow,
|
ApprovalFlowPojo flow,
|
||||||
HandleApprovalRequest request,
|
HandleApprovalRequest request,
|
||||||
@ -519,6 +555,7 @@ public class TemplateApprovalServiceImpl implements TemplateApprovalService {
|
|||||||
myself.processNextNode(flow, currentNode, request.getUserId());
|
myself.processNextNode(flow, currentNode, request.getUserId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void cancelProcess(
|
public void cancelProcess(
|
||||||
ApprovalFlowPojo flow,
|
ApprovalFlowPojo flow,
|
||||||
ApprovalConfigPojo node,
|
ApprovalConfigPojo node,
|
||||||
@ -574,6 +611,7 @@ public class TemplateApprovalServiceImpl implements TemplateApprovalService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 处理下一节点流转
|
// 处理下一节点流转
|
||||||
|
@Override
|
||||||
public void processNextNode(
|
public void processNextNode(
|
||||||
ApprovalFlowPojo flow,
|
ApprovalFlowPojo flow,
|
||||||
ApprovalConfigPojo currentNode,
|
ApprovalConfigPojo currentNode,
|
||||||
@ -628,6 +666,7 @@ public class TemplateApprovalServiceImpl implements TemplateApprovalService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 检查节点是否完成
|
// 检查节点是否完成
|
||||||
|
@Override
|
||||||
public boolean checkNodeComplete(ApprovalFlowPojo flow, ApprovalConfigPojo node) {
|
public boolean checkNodeComplete(ApprovalFlowPojo flow, ApprovalConfigPojo node) {
|
||||||
ApprovalRecordPojo lastedRecord = bd.getBusinessDatabase()
|
ApprovalRecordPojo lastedRecord = bd.getBusinessDatabase()
|
||||||
.eq("flow_id", flow.getId())
|
.eq("flow_id", flow.getId())
|
||||||
@ -645,6 +684,7 @@ public class TemplateApprovalServiceImpl implements TemplateApprovalService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void addNodeTodo(
|
public void addNodeTodo(
|
||||||
ApprovalFlowPojo flow,
|
ApprovalFlowPojo flow,
|
||||||
ApprovalConfigPojo node,
|
ApprovalConfigPojo node,
|
||||||
@ -684,6 +724,12 @@ public class TemplateApprovalServiceImpl implements TemplateApprovalService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
/**
|
||||||
|
* 获取退回节点
|
||||||
|
*
|
||||||
|
* @param flowId 流程ID
|
||||||
|
* @return 退回节点列表
|
||||||
|
*/
|
||||||
public List<String> getReturnNodes(String flowId) {
|
public List<String> getReturnNodes(String flowId) {
|
||||||
ApprovalFlowPojo flow = bd.getBusinessDatabase()
|
ApprovalFlowPojo flow = bd.getBusinessDatabase()
|
||||||
.eq("id", flowId)
|
.eq("id", flowId)
|
||||||
@ -699,6 +745,12 @@ public class TemplateApprovalServiceImpl implements TemplateApprovalService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
/**
|
||||||
|
* 获取审批用户
|
||||||
|
*
|
||||||
|
* @param templateId 模板ID
|
||||||
|
* @return 审批节点DTO
|
||||||
|
*/
|
||||||
public ApprovalNodesDTO getApprovalUsers(String templateId) {
|
public ApprovalNodesDTO getApprovalUsers(String templateId) {
|
||||||
ApprovalNodesDTO nodes = new ApprovalNodesDTO();
|
ApprovalNodesDTO nodes = new ApprovalNodesDTO();
|
||||||
nodes.setProcessTitle("");
|
nodes.setProcessTitle("");
|
||||||
@ -743,6 +795,12 @@ public class TemplateApprovalServiceImpl implements TemplateApprovalService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
/**
|
||||||
|
* 获取是否直送
|
||||||
|
*
|
||||||
|
* @param flowId 流程ID
|
||||||
|
* @return 是否直送
|
||||||
|
*/
|
||||||
public boolean getIsDirect(String flowId) {
|
public boolean getIsDirect(String flowId) {
|
||||||
ApprovalFlowPojo flow = bd.getBusinessDatabase()
|
ApprovalFlowPojo flow = bd.getBusinessDatabase()
|
||||||
.eq("id", flowId)
|
.eq("id", flowId)
|
||||||
@ -757,6 +815,12 @@ public class TemplateApprovalServiceImpl implements TemplateApprovalService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
|
/**
|
||||||
|
* 更新流程标题
|
||||||
|
*
|
||||||
|
* @param flowId 流程ID
|
||||||
|
* @param title 流程标题
|
||||||
|
*/
|
||||||
public void updateFlowTitle(String flowId, String title) {
|
public void updateFlowTitle(String flowId, String title) {
|
||||||
ApprovalFlowPojo flow = bd.getBusinessDatabase()
|
ApprovalFlowPojo flow = bd.getBusinessDatabase()
|
||||||
.eq("id", flowId)
|
.eq("id", flowId)
|
||||||
@ -791,6 +855,12 @@ public class TemplateApprovalServiceImpl implements TemplateApprovalService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
/**
|
||||||
|
* 获取可编辑节点
|
||||||
|
*
|
||||||
|
* @param flowId 流程ID
|
||||||
|
* @return 可编辑节点列表
|
||||||
|
*/
|
||||||
public List<String> getEditableNodes(String flowId) {
|
public List<String> getEditableNodes(String flowId) {
|
||||||
ApprovalFlowPojo flow = bd.getBusinessDatabase()
|
ApprovalFlowPojo flow = bd.getBusinessDatabase()
|
||||||
.eq("id", flowId)
|
.eq("id", flowId)
|
||||||
@ -815,6 +885,11 @@ public class TemplateApprovalServiceImpl implements TemplateApprovalService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
|
/**
|
||||||
|
* 更新节点
|
||||||
|
*
|
||||||
|
* @param form 更新节点表单
|
||||||
|
*/
|
||||||
public void updateNode(UpdateNodeForm form) {
|
public void updateNode(UpdateNodeForm form) {
|
||||||
// 检查流程
|
// 检查流程
|
||||||
ApprovalFlowPojo flow = bd.getBusinessDatabase()
|
ApprovalFlowPojo flow = bd.getBusinessDatabase()
|
||||||
@ -837,6 +912,11 @@ public class TemplateApprovalServiceImpl implements TemplateApprovalService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
/**
|
||||||
|
* 更新节点配置
|
||||||
|
*
|
||||||
|
* @param form 更新节点表单
|
||||||
|
*/
|
||||||
public void updateNodeConfig(UpdateNodeForm form) {
|
public void updateNodeConfig(UpdateNodeForm form) {
|
||||||
// 获取可更新流程节点名称
|
// 获取可更新流程节点名称
|
||||||
List<ApprovalConfigPojo> nodes = bd.getBusinessDatabase()
|
List<ApprovalConfigPojo> nodes = bd.getBusinessDatabase()
|
||||||
@ -929,6 +1009,14 @@ public class TemplateApprovalServiceImpl implements TemplateApprovalService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
/**
|
||||||
|
* 更新任务
|
||||||
|
*
|
||||||
|
* @param flow 审批流程POJO
|
||||||
|
* @param status 状态
|
||||||
|
* @param enableReturn 是否启用退回
|
||||||
|
* @param currentNode 当前节点
|
||||||
|
*/
|
||||||
public void updateTasks(ApprovalFlowPojo flow, String status, Integer enableReturn, ApprovalConfigPojo currentNode) {
|
public void updateTasks(ApprovalFlowPojo flow, String status, Integer enableReturn, ApprovalConfigPojo currentNode) {
|
||||||
// 更新已办和发起的节点状态
|
// 更新已办和发起的节点状态
|
||||||
bd.getBusinessDatabase()
|
bd.getBusinessDatabase()
|
||||||
@ -945,6 +1033,12 @@ public class TemplateApprovalServiceImpl implements TemplateApprovalService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
/**
|
||||||
|
* 获取模板变更
|
||||||
|
*
|
||||||
|
* @param form 审批和参数表单
|
||||||
|
* @return 模板变更视图分页结果
|
||||||
|
*/
|
||||||
public PageQueryResult<TemplateChangeView> getTemplateChanges(ApprovalAndParameterForm form) {
|
public PageQueryResult<TemplateChangeView> getTemplateChanges(ApprovalAndParameterForm form) {
|
||||||
TemplatePojo template = bd.getBusinessDatabase()
|
TemplatePojo template = bd.getBusinessDatabase()
|
||||||
.eq("id", form.getTemplateId())
|
.eq("id", form.getTemplateId())
|
||||||
@ -979,6 +1073,12 @@ public class TemplateApprovalServiceImpl implements TemplateApprovalService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
/**
|
||||||
|
* 获取审批流程
|
||||||
|
*
|
||||||
|
* @param form 审批流程表单
|
||||||
|
* @return 审批流程节点视图
|
||||||
|
*/
|
||||||
public ApprovalFlowNodeView getApprovalProcess(ApprovalFlowForm form) {
|
public ApprovalFlowNodeView getApprovalProcess(ApprovalFlowForm form) {
|
||||||
ApprovalFlowNodeView flowNodeView = new ApprovalFlowNodeView();
|
ApprovalFlowNodeView flowNodeView = new ApprovalFlowNodeView();
|
||||||
ApprovalFlowPojo approvalFlow = bd.getBusinessDatabase()
|
ApprovalFlowPojo approvalFlow = bd.getBusinessDatabase()
|
||||||
|
|||||||
@ -33,6 +33,12 @@ import java.time.format.DateTimeFormatter;
|
|||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 模板服务实现类
|
||||||
|
*
|
||||||
|
* @version 1.0
|
||||||
|
* @since 2025
|
||||||
|
*/
|
||||||
@Service
|
@Service
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class TemplateServiceImpl implements TemplateService {
|
public class TemplateServiceImpl implements TemplateService {
|
||||||
@ -40,6 +46,12 @@ public class TemplateServiceImpl implements TemplateService {
|
|||||||
private BusinessDatabase bd;
|
private BusinessDatabase bd;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
/**
|
||||||
|
* 根据条件获取模板
|
||||||
|
*
|
||||||
|
* @param form 模板页面表单
|
||||||
|
* @return 模板分页查询结果
|
||||||
|
*/
|
||||||
public PageQueryResult<TemplatePojo> getTemplateByCondition(TemplatePageForm form) {
|
public PageQueryResult<TemplatePojo> getTemplateByCondition(TemplatePageForm form) {
|
||||||
return bd.getBusinessDatabase()
|
return bd.getBusinessDatabase()
|
||||||
.viewQueryMode(true)
|
.viewQueryMode(true)
|
||||||
@ -49,6 +61,11 @@ public class TemplateServiceImpl implements TemplateService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
/**
|
||||||
|
* 插入模板
|
||||||
|
*
|
||||||
|
* @param form 插入模板表单
|
||||||
|
*/
|
||||||
public void insertTemplate(InsertTemplateForm form) {
|
public void insertTemplate(InsertTemplateForm form) {
|
||||||
TemplatePojo template = bd.getBusinessDatabase()
|
TemplatePojo template = bd.getBusinessDatabase()
|
||||||
.viewQueryMode(true)
|
.viewQueryMode(true)
|
||||||
@ -72,6 +89,11 @@ public class TemplateServiceImpl implements TemplateService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
|
/**
|
||||||
|
* 更新模板
|
||||||
|
*
|
||||||
|
* @param form 更新模板表单
|
||||||
|
*/
|
||||||
public void updateTemplate(UpdateTemplateForm form) {
|
public void updateTemplate(UpdateTemplateForm form) {
|
||||||
TemplatePojo template = bd.getBusinessDatabase()
|
TemplatePojo template = bd.getBusinessDatabase()
|
||||||
.viewQueryMode(true)
|
.viewQueryMode(true)
|
||||||
@ -134,6 +156,14 @@ public class TemplateServiceImpl implements TemplateService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
|
/**
|
||||||
|
* 导入模板
|
||||||
|
*
|
||||||
|
* @param file 模板文件
|
||||||
|
* @param templateRowId 模板行ID
|
||||||
|
* @param userId 用户ID
|
||||||
|
* @return 操作响应结果
|
||||||
|
*/
|
||||||
public MyResponse importTemplate(MultipartFile file, String templateRowId, String userId) {
|
public MyResponse importTemplate(MultipartFile file, String templateRowId, String userId) {
|
||||||
// 验证文件是否为工作表
|
// 验证文件是否为工作表
|
||||||
if (file == null || file.isEmpty()) {
|
if (file == null || file.isEmpty()) {
|
||||||
@ -164,6 +194,12 @@ public class TemplateServiceImpl implements TemplateService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
/**
|
||||||
|
* 导出模板
|
||||||
|
*
|
||||||
|
* @param form 导出模板表单
|
||||||
|
* @param response HTTP响应对象
|
||||||
|
*/
|
||||||
public void exportTemplate(ExportTemplateForm form, HttpServletResponse response) {
|
public void exportTemplate(ExportTemplateForm form, HttpServletResponse response) {
|
||||||
TemplatePojo templateDB = bd.getBusinessDatabase()
|
TemplatePojo templateDB = bd.getBusinessDatabase()
|
||||||
.rowid("id", form.getTemplateRowId())
|
.rowid("id", form.getTemplateRowId())
|
||||||
@ -206,6 +242,12 @@ public class TemplateServiceImpl implements TemplateService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
/**
|
||||||
|
* 获取模板版本
|
||||||
|
*
|
||||||
|
* @param form 模板行ID表单
|
||||||
|
* @return 模板版本列表
|
||||||
|
*/
|
||||||
public List<TemplatePojo> getTemplateVersion(TemplateRowIdForm form) {
|
public List<TemplatePojo> getTemplateVersion(TemplateRowIdForm form) {
|
||||||
TemplatePojo template = bd.getBusinessDatabase()
|
TemplatePojo template = bd.getBusinessDatabase()
|
||||||
.rowid("id", form.getTemplateRowId())
|
.rowid("id", form.getTemplateRowId())
|
||||||
@ -217,6 +259,12 @@ public class TemplateServiceImpl implements TemplateService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
/**
|
||||||
|
* 根据ID获取模板
|
||||||
|
*
|
||||||
|
* @param templateId 模板ID
|
||||||
|
* @return 模板POJO对象
|
||||||
|
*/
|
||||||
public TemplatePojo getTemplateById(String templateId) {
|
public TemplatePojo getTemplateById(String templateId) {
|
||||||
return bd.getBusinessDatabase()
|
return bd.getBusinessDatabase()
|
||||||
.eq("id", templateId)
|
.eq("id", templateId)
|
||||||
@ -224,6 +272,11 @@ public class TemplateServiceImpl implements TemplateService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
/**
|
||||||
|
* 删除模板
|
||||||
|
*
|
||||||
|
* @param templateId 模板ID
|
||||||
|
*/
|
||||||
public void deleteTemplate(String templateId) {
|
public void deleteTemplate(String templateId) {
|
||||||
TemplatePojo template = bd.getBusinessDatabase()
|
TemplatePojo template = bd.getBusinessDatabase()
|
||||||
.eq("id", templateId)
|
.eq("id", templateId)
|
||||||
@ -240,6 +293,15 @@ public class TemplateServiceImpl implements TemplateService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
|
/**
|
||||||
|
* 处理表格数据
|
||||||
|
*
|
||||||
|
* @param dataList 参数数据列表
|
||||||
|
* @param sheetName 表格名称
|
||||||
|
* @param templateRowId 模板行ID
|
||||||
|
* @param createBy 创建者
|
||||||
|
* @param problems 问题收集对象
|
||||||
|
*/
|
||||||
public void processSheetData(List<ParameterPojo> dataList, String sheetName,
|
public void processSheetData(List<ParameterPojo> dataList, String sheetName,
|
||||||
String templateRowId, String createBy, MyResponse problems) {
|
String templateRowId, String createBy, MyResponse problems) {
|
||||||
if (dataList.isEmpty()) {
|
if (dataList.isEmpty()) {
|
||||||
@ -465,80 +527,6 @@ public class TemplateServiceImpl implements TemplateService {
|
|||||||
return includeColumnFieldNames;
|
return includeColumnFieldNames;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void insertAndUpdateParameters(
|
|
||||||
List<ParameterPojo> dataList, TemplatePojo lastTemplate
|
|
||||||
) {
|
|
||||||
// 获取原模板参数
|
|
||||||
List<ParameterPojo> parameters = bd.getBusinessDatabase().viewQueryMode(true)
|
|
||||||
.view("selectParametersByTemplateId")
|
|
||||||
.setVar("template_id", lastTemplate.getId())
|
|
||||||
.doQuery(ParameterPojo.class);
|
|
||||||
|
|
||||||
// 筛选变更和新增的参数
|
|
||||||
ProcessResult processResult = processParameters(parameters, dataList);
|
|
||||||
List<ParameterPojo> toAdd = processResult.getToAdd();
|
|
||||||
List<ParameterChange> toUpdate = processResult.getToUpdate();
|
|
||||||
|
|
||||||
if (!toAdd.isEmpty()) {
|
|
||||||
// 保存参数
|
|
||||||
bd.getBusinessDatabase().doBatchInsert(toAdd);
|
|
||||||
List<TemplateAndParameterPojo> relations = new ArrayList<>();
|
|
||||||
|
|
||||||
// 保存关联关系
|
|
||||||
toAdd.forEach(parameter -> {
|
|
||||||
TemplateAndParameterPojo relation = new TemplateAndParameterPojo();
|
|
||||||
RevisionRecordPojo record = new RevisionRecordPojo();
|
|
||||||
relation.setTemplateId(lastTemplate.getId());
|
|
||||||
relation.setParameterId(parameter.getId());
|
|
||||||
relations.add(relation);
|
|
||||||
});
|
|
||||||
bd.getBusinessDatabase().doBatchInsert(relations);
|
|
||||||
|
|
||||||
// 保存修改记录
|
|
||||||
List<RevisionRecordPojo> revisionRecords = toAdd.stream()
|
|
||||||
.map(parameter -> {
|
|
||||||
return new RevisionRecordPojo(
|
|
||||||
lastTemplate.getTemplateName(),
|
|
||||||
lastTemplate.getVersion(),
|
|
||||||
parameter.getParameterNumber(),
|
|
||||||
"新增参数",
|
|
||||||
lastTemplate.getId(),
|
|
||||||
null,
|
|
||||||
Timestamp.valueOf(LocalDateTime.now()),
|
|
||||||
parameter.getId(),
|
|
||||||
lastTemplate.getReturnNum()
|
|
||||||
);
|
|
||||||
})
|
|
||||||
.collect(Collectors.toList());
|
|
||||||
bd.getBusinessDatabase().doBatchInsert(revisionRecords);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!toUpdate.isEmpty()) {
|
|
||||||
|
|
||||||
toUpdate.forEach(parameterChange -> {
|
|
||||||
// 更新参数
|
|
||||||
parameterChange.getUpdated().setId(parameterChange.getOriginal().getId());
|
|
||||||
bd.getBusinessDatabase()
|
|
||||||
.eq("id", parameterChange.getUpdated().getId())
|
|
||||||
.doUpdate(parameterChange.getUpdated());
|
|
||||||
|
|
||||||
// 保存修改记录
|
|
||||||
RevisionRecordPojo record = new RevisionRecordPojo(
|
|
||||||
lastTemplate.getTemplateName(),
|
|
||||||
lastTemplate.getVersion(),
|
|
||||||
parameterChange.getUpdated().getParameterNumber(),
|
|
||||||
parameterChange.getChangeDescription(),
|
|
||||||
lastTemplate.getId(),
|
|
||||||
parameterChange.getOriginal().getId(),
|
|
||||||
Timestamp.valueOf(LocalDateTime.now()),
|
|
||||||
parameterChange.getUpdated().getId(),
|
|
||||||
lastTemplate.getReturnNum()
|
|
||||||
);
|
|
||||||
bd.getBusinessDatabase().doInsert(record);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private String getParameterChange(ParameterPojo originalParameter, ParameterPojo updatedParameter) {
|
private String getParameterChange(ParameterPojo originalParameter, ParameterPojo updatedParameter) {
|
||||||
return handleParameterChange("参数名", originalParameter.getParameterName(), updatedParameter.getParameterName()) +
|
return handleParameterChange("参数名", originalParameter.getParameterName(), updatedParameter.getParameterName()) +
|
||||||
handleParameterChange("参数类型", originalParameter.getParameterType(), updatedParameter.getParameterType()) +
|
handleParameterChange("参数类型", originalParameter.getParameterType(), updatedParameter.getParameterType()) +
|
||||||
@ -570,69 +558,13 @@ public class TemplateServiceImpl implements TemplateService {
|
|||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Getter
|
|
||||||
public static class ProcessResult {
|
|
||||||
private List<ParameterPojo> toAdd;
|
|
||||||
private List<ParameterChange> toUpdate;
|
|
||||||
|
|
||||||
public ProcessResult(List<ParameterPojo> toAdd, List<ParameterChange> toUpdate) {
|
|
||||||
this.toAdd = toAdd;
|
|
||||||
this.toUpdate = toUpdate;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Getter
|
|
||||||
public static class ParameterChange {
|
|
||||||
private ParameterPojo original;
|
|
||||||
private ParameterPojo updated;
|
|
||||||
private String changeDescription;
|
|
||||||
|
|
||||||
public ParameterChange(ParameterPojo original, ParameterPojo updated, String changeDescription) {
|
|
||||||
this.original = original;
|
|
||||||
this.updated = updated;
|
|
||||||
this.changeDescription = changeDescription;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public ProcessResult processParameters(List<ParameterPojo> oldList, List<ParameterPojo> newList) {
|
|
||||||
// 过滤掉newList中number为空的项
|
|
||||||
List<ParameterPojo> validNewList = newList.stream()
|
|
||||||
.filter(p -> p.getParameterNumber() != null
|
|
||||||
&& !p.getParameterNumber().toString().trim().isEmpty())
|
|
||||||
.collect(Collectors.toList());
|
|
||||||
|
|
||||||
List<ParameterPojo> toAdd = new ArrayList<>();
|
|
||||||
List<ParameterChange> toUpdate = new ArrayList<>();
|
|
||||||
|
|
||||||
// 创建旧列表中number到Parameter的映射
|
|
||||||
Map<Object, ParameterPojo> oldMap = oldList.stream()
|
|
||||||
.filter(p -> p.getParameterNumber() != null
|
|
||||||
&& !p.getParameterNumber().toString().trim().isEmpty())
|
|
||||||
.collect(Collectors.toMap(
|
|
||||||
ParameterPojo::getParameterNumber,
|
|
||||||
p -> p,
|
|
||||||
(existing, replacement) -> existing));
|
|
||||||
|
|
||||||
// 处理新列表中的每个参数
|
|
||||||
for (ParameterPojo newParam : validNewList) {
|
|
||||||
Integer number = newParam.getParameterNumber();
|
|
||||||
|
|
||||||
if (oldMap.containsKey(number)) {
|
|
||||||
ParameterPojo oldParam = oldMap.get(number);
|
|
||||||
String changeDescription = getParameterChange(oldParam, newParam);
|
|
||||||
ParameterChange change = new ParameterChange(oldParam, newParam, changeDescription);
|
|
||||||
toUpdate.add(change);
|
|
||||||
oldMap.remove(number);
|
|
||||||
} else {
|
|
||||||
toAdd.add(newParam);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return new ProcessResult(toAdd, toUpdate);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
/**
|
||||||
|
* 导出多个模板
|
||||||
|
*
|
||||||
|
* @param response HTTP响应对象
|
||||||
|
*/
|
||||||
public void exportMultipleTemplates(HttpServletResponse response) {
|
public void exportMultipleTemplates(HttpServletResponse response) {
|
||||||
try {
|
try {
|
||||||
String fileName = "全部模板_" +
|
String fileName = "全部模板_" +
|
||||||
|
|||||||
@ -32,12 +32,10 @@ import java.util.function.Function;
|
|||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* 待办任务服务实现类
|
||||||
* 待办事项表 服务实现类
|
|
||||||
* </p>
|
|
||||||
*
|
*
|
||||||
* @author Lys111
|
* @version 1.0
|
||||||
* @since 2025-11-18
|
* @since 2025
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class TodoTaskServiceImpl implements TodoTaskService {
|
public class TodoTaskServiceImpl implements TodoTaskService {
|
||||||
@ -69,12 +67,23 @@ public class TodoTaskServiceImpl implements TodoTaskService {
|
|||||||
private static final String dateFormat = "yyyy-MM-dd HH:mm:ss";
|
private static final String dateFormat = "yyyy-MM-dd HH:mm:ss";
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
/**
|
||||||
|
* 批量插入待办任务
|
||||||
|
*
|
||||||
|
* @param taskPojos 待办任务POJO列表
|
||||||
|
*/
|
||||||
public void batchInsert(List<TodoTaskPojo> taskPojos) {
|
public void batchInsert(List<TodoTaskPojo> taskPojos) {
|
||||||
sw.buildFromDatasource("xdap_app_223770822127386625")
|
sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
.doBatchInsert(taskPojos);
|
.doBatchInsert(taskPojos);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
/**
|
||||||
|
* 分页查询发起任务
|
||||||
|
*
|
||||||
|
* @param taskRequest 待办任务请求对象
|
||||||
|
* @return 发起任务分页结果DTO
|
||||||
|
*/
|
||||||
public PageResultDTO<InitiatedTaskPojo> selectByPage(TodoTaskRequest taskRequest) {
|
public PageResultDTO<InitiatedTaskPojo> selectByPage(TodoTaskRequest taskRequest) {
|
||||||
if (ObjectUtils.isEmpty(taskRequest.getCreatedById())) {
|
if (ObjectUtils.isEmpty(taskRequest.getCreatedById())) {
|
||||||
throw new RuntimeException("请传入发起人");
|
throw new RuntimeException("请传入发起人");
|
||||||
@ -117,6 +126,12 @@ public class TodoTaskServiceImpl implements TodoTaskService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
/**
|
||||||
|
* 分页查询责任人待办任务
|
||||||
|
*
|
||||||
|
* @param todoTaskRequest 待办任务请求对象
|
||||||
|
* @return 待办任务分页结果DTO
|
||||||
|
*/
|
||||||
public PageResultDTO<TodoTaskPojo> selectByresPersonTodoPage(TodoTaskRequest todoTaskRequest) {
|
public PageResultDTO<TodoTaskPojo> selectByresPersonTodoPage(TodoTaskRequest todoTaskRequest) {
|
||||||
|
|
||||||
PageResultDTO<TodoTaskPojo> pageResultDTO = new PageResultDTO<>();
|
PageResultDTO<TodoTaskPojo> pageResultDTO = new PageResultDTO<>();
|
||||||
@ -157,6 +172,12 @@ public class TodoTaskServiceImpl implements TodoTaskService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
/**
|
||||||
|
* 分页查询责任人已办任务
|
||||||
|
*
|
||||||
|
* @param taskRequest 待办任务请求对象
|
||||||
|
* @return 已办任务分页结果DTO
|
||||||
|
*/
|
||||||
public PageResultDTO<CompletedTaskPojo> selectByresPersonCompletedPage(TodoTaskRequest taskRequest) {
|
public PageResultDTO<CompletedTaskPojo> selectByresPersonCompletedPage(TodoTaskRequest taskRequest) {
|
||||||
|
|
||||||
PageResultDTO<CompletedTaskPojo> pageResultDTO = new PageResultDTO<>();
|
PageResultDTO<CompletedTaskPojo> pageResultDTO = new PageResultDTO<>();
|
||||||
@ -211,6 +232,12 @@ public class TodoTaskServiceImpl implements TodoTaskService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
/**
|
||||||
|
* 创建责任人任务
|
||||||
|
*
|
||||||
|
* @param paramDetailPojosAll 引擎参数详情DTO列表
|
||||||
|
* @param userID 用户ID
|
||||||
|
*/
|
||||||
public void createResPerson(List<EngineParamDetailDTO> paramDetailPojosAll, String userID) {
|
public void createResPerson(List<EngineParamDetailDTO> paramDetailPojosAll, String userID) {
|
||||||
|
|
||||||
if (ObjectUtils.isEmpty(paramDetailPojosAll)) {
|
if (ObjectUtils.isEmpty(paramDetailPojosAll)) {
|
||||||
@ -295,6 +322,11 @@ public class TodoTaskServiceImpl implements TodoTaskService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
|
/**
|
||||||
|
* 待办任务退回
|
||||||
|
*
|
||||||
|
* @param todoReturnRequest 待办退回请求对象
|
||||||
|
*/
|
||||||
public void todoReturn(TodoReturnRequest todoReturnRequest) {
|
public void todoReturn(TodoReturnRequest todoReturnRequest) {
|
||||||
String todoTaskId = todoReturnRequest.getTodoTaskId();
|
String todoTaskId = todoReturnRequest.getTodoTaskId();
|
||||||
if (ObjectUtils.isEmpty(todoTaskId)) {
|
if (ObjectUtils.isEmpty(todoTaskId)) {
|
||||||
@ -361,6 +393,12 @@ public class TodoTaskServiceImpl implements TodoTaskService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
/**
|
||||||
|
* 返回云柴待办任务
|
||||||
|
*
|
||||||
|
* @param ycGetTodoTaskRequest 云柴获取待办任务请求对象
|
||||||
|
* @return 云柴待办任务结果DTO列表
|
||||||
|
*/
|
||||||
public List<YcTodoTaskResultDTO> returnTodoTask(YcGetTodoTaskRequest ycGetTodoTaskRequest) {
|
public List<YcTodoTaskResultDTO> returnTodoTask(YcGetTodoTaskRequest ycGetTodoTaskRequest) {
|
||||||
String username = ycGetTodoTaskRequest.getUsername();
|
String username = ycGetTodoTaskRequest.getUsername();
|
||||||
if (ObjectUtils.isEmpty(username)) {
|
if (ObjectUtils.isEmpty(username)) {
|
||||||
@ -390,11 +428,23 @@ public class TodoTaskServiceImpl implements TodoTaskService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
/**
|
||||||
|
* 返回已办任务
|
||||||
|
*
|
||||||
|
* @param ycGetTodoTaskRequest 云柴获取待办任务请求对象
|
||||||
|
* @return 云柴已办任务通用结果DTO分页结果
|
||||||
|
*/
|
||||||
public PageResultDTO<YcTodoTaskCommonResultDTO> returnCompleted(YcGetTodoTaskRequest ycGetTodoTaskRequest) {
|
public PageResultDTO<YcTodoTaskCommonResultDTO> returnCompleted(YcGetTodoTaskRequest ycGetTodoTaskRequest) {
|
||||||
return commonTodoTask(ycGetTodoTaskRequest, "已办");
|
return commonTodoTask(ycGetTodoTaskRequest, "已办");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
/**
|
||||||
|
* 返回发起任务
|
||||||
|
*
|
||||||
|
* @param ycGetTodoTaskRequest 云柴获取待办任务请求对象
|
||||||
|
* @return 云柴发起任务通用结果DTO分页结果
|
||||||
|
*/
|
||||||
public PageResultDTO<YcTodoTaskCommonResultDTO> returnInitiator(YcGetTodoTaskRequest ycGetTodoTaskRequest) {
|
public PageResultDTO<YcTodoTaskCommonResultDTO> returnInitiator(YcGetTodoTaskRequest ycGetTodoTaskRequest) {
|
||||||
return commonTodoTask(ycGetTodoTaskRequest, "发起");
|
return commonTodoTask(ycGetTodoTaskRequest, "发起");
|
||||||
}
|
}
|
||||||
@ -492,11 +542,21 @@ public class TodoTaskServiceImpl implements TodoTaskService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional // 发生任何异常都回滚
|
@Transactional // 发生任何异常都回滚
|
||||||
|
/**
|
||||||
|
* 批量插入待办任务
|
||||||
|
*
|
||||||
|
* @param todoTaskPojos 待办任务POJO列表
|
||||||
|
*/
|
||||||
public void batchInsertTodoTask(List<TodoTaskPojo> todoTaskPojos) {
|
public void batchInsertTodoTask(List<TodoTaskPojo> todoTaskPojos) {
|
||||||
sw.buildFromDatasource("xdap_app_223770822127386625").doBatchInsert(todoTaskPojos);
|
sw.buildFromDatasource("xdap_app_223770822127386625").doBatchInsert(todoTaskPojos);
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
@Transactional // 发生任何异常都回滚
|
@Transactional // 发生任何异常都回滚
|
||||||
|
/**
|
||||||
|
* 批量插入发起任务
|
||||||
|
*
|
||||||
|
* @param taskPojos 发起任务POJO列表
|
||||||
|
*/
|
||||||
public void batchInsertInitiatedTask(List<InitiatedTaskPojo> taskPojos) {
|
public void batchInsertInitiatedTask(List<InitiatedTaskPojo> taskPojos) {
|
||||||
sw.buildFromDatasource("xdap_app_223770822127386625").doBatchInsert(taskPojos);
|
sw.buildFromDatasource("xdap_app_223770822127386625").doBatchInsert(taskPojos);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,16 +15,15 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* XDAP部门用户服务实现类
|
||||||
* 部门成员关系表 服务实现类
|
|
||||||
* </p>
|
|
||||||
*
|
*
|
||||||
* @author Lys111
|
* @version 1.0
|
||||||
* @since 2025-11-19
|
* @since 2025
|
||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
@ -37,6 +36,12 @@ public class XdapDeptUsersServiceImpl implements XdapDeptUsersService {
|
|||||||
private RuntimeDatasourceService runtimeDatasourceService;
|
private RuntimeDatasourceService runtimeDatasourceService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
/**
|
||||||
|
* 根据ID查询部门
|
||||||
|
*
|
||||||
|
* @param deptId 部门ID
|
||||||
|
* @return 部门对象
|
||||||
|
*/
|
||||||
public XdapDepartments selectDeptByID(String deptId) {
|
public XdapDepartments selectDeptByID(String deptId) {
|
||||||
if (ObjectUtils.isEmpty(deptId)) {
|
if (ObjectUtils.isEmpty(deptId)) {
|
||||||
return null;
|
return null;
|
||||||
@ -51,6 +56,12 @@ public class XdapDeptUsersServiceImpl implements XdapDeptUsersService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
/**
|
||||||
|
* 根据名称查询部门
|
||||||
|
*
|
||||||
|
* @param deptName 部门名称
|
||||||
|
* @return 部门对象
|
||||||
|
*/
|
||||||
public XdapDepartments selectDeptByName(String deptName) {
|
public XdapDepartments selectDeptByName(String deptName) {
|
||||||
if (ObjectUtils.isEmpty(deptName)) {
|
if (ObjectUtils.isEmpty(deptName)) {
|
||||||
return null;
|
return null;
|
||||||
@ -65,6 +76,12 @@ public class XdapDeptUsersServiceImpl implements XdapDeptUsersService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
/**
|
||||||
|
* 根据部门名称查询用户
|
||||||
|
*
|
||||||
|
* @param deptName 部门名称
|
||||||
|
* @return 用户列表
|
||||||
|
*/
|
||||||
public List<XdapUsers> selectUserByName(String deptName) {
|
public List<XdapUsers> selectUserByName(String deptName) {
|
||||||
XdapDepartments xdapDepartmentsPojo = selectDeptByName(deptName);
|
XdapDepartments xdapDepartmentsPojo = selectDeptByName(deptName);
|
||||||
List<XdapUsers> xdapUsersPojos = new ArrayList<>();
|
List<XdapUsers> xdapUsersPojos = new ArrayList<>();
|
||||||
@ -90,17 +107,29 @@ public class XdapDeptUsersServiceImpl implements XdapDeptUsersService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
/**
|
||||||
|
* 根据人员姓名查询用户
|
||||||
|
*
|
||||||
|
* @param personName 人员姓名
|
||||||
|
* @return 用户列表
|
||||||
|
*/
|
||||||
public List<XdapUsers> selectUserByPersonName(String personName) {
|
public List<XdapUsers> selectUserByPersonName(String personName) {
|
||||||
if (ObjectUtils.isEmpty(personName)) {
|
if (ObjectUtils.isEmpty(personName)) {
|
||||||
return null;
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
List<XdapUsers> departmentsPojos = runtimeDatasourceService.buildTenantMpaasQuery("xdap_app_223770822127386625")
|
return runtimeDatasourceService.buildTenantMpaasQuery("xdap_app_223770822127386625")
|
||||||
.eq("username", personName)
|
.eq("username", personName)
|
||||||
.doQuery(XdapUsers.class);
|
.doQuery(XdapUsers.class);
|
||||||
return departmentsPojos;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
/**
|
||||||
|
* 根据用户列表和部门名称查询用户
|
||||||
|
*
|
||||||
|
* @param xdapUsersPojos 用户对象列表
|
||||||
|
* @param dpName 部门对象
|
||||||
|
* @return 匹配的用户对象
|
||||||
|
*/
|
||||||
public XdapUsers selectUserByUserListAndDeptName(List<XdapUsers> xdapUsersPojos, XdapDepartments dpName) {
|
public XdapUsers selectUserByUserListAndDeptName(List<XdapUsers> xdapUsersPojos, XdapDepartments dpName) {
|
||||||
|
|
||||||
if (ObjectUtils.isNotEmpty(xdapUsersPojos) && ObjectUtils.isNotEmpty(dpName)) {
|
if (ObjectUtils.isNotEmpty(xdapUsersPojos) && ObjectUtils.isNotEmpty(dpName)) {
|
||||||
@ -128,6 +157,12 @@ public class XdapDeptUsersServiceImpl implements XdapDeptUsersService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
/**
|
||||||
|
* 根据ID查询用户
|
||||||
|
*
|
||||||
|
* @param userId 用户ID
|
||||||
|
* @return 用户对象
|
||||||
|
*/
|
||||||
public XdapUsers selectUserByID(String userId) {
|
public XdapUsers selectUserByID(String userId) {
|
||||||
|
|
||||||
if (ObjectUtils.isEmpty(userId)) {
|
if (ObjectUtils.isEmpty(userId)) {
|
||||||
@ -143,6 +178,12 @@ public class XdapDeptUsersServiceImpl implements XdapDeptUsersService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
/**
|
||||||
|
* 根据用户编码查询用户
|
||||||
|
*
|
||||||
|
* @param userCode 用户编码
|
||||||
|
* @return 用户对象
|
||||||
|
*/
|
||||||
public XdapUsers selectUserByCode(String userCode) {
|
public XdapUsers selectUserByCode(String userCode) {
|
||||||
|
|
||||||
if (ObjectUtils.isEmpty(userCode)) {
|
if (ObjectUtils.isEmpty(userCode)) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user