修改仿真分析项库关联流程模版bug
This commit is contained in:
33
1-sql/2025-12-30/system/simulation_app_call_record.sql
Normal file
33
1-sql/2025-12-30/system/simulation_app_call_record.sql
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
/*
|
||||||
|
Navicat Premium Dump SQL
|
||||||
|
|
||||||
|
Source Server : 基线版本
|
||||||
|
Source Server Type : MySQL
|
||||||
|
Source Server Version : 80043 (8.0.43)
|
||||||
|
Source Host : 192.168.65.161:3306
|
||||||
|
Source Schema : spdm_baseline
|
||||||
|
|
||||||
|
Target Server Type : MySQL
|
||||||
|
Target Server Version : 80043 (8.0.43)
|
||||||
|
File Encoding : 65001
|
||||||
|
|
||||||
|
Date: 30/12/2025 20:03:18
|
||||||
|
*/
|
||||||
|
|
||||||
|
SET NAMES utf8mb4;
|
||||||
|
SET FOREIGN_KEY_CHECKS = 0;
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- Table structure for simulation_app_call_record
|
||||||
|
-- ----------------------------
|
||||||
|
DROP TABLE IF EXISTS `simulation_app_call_record`;
|
||||||
|
CREATE TABLE `simulation_app_call_record` (
|
||||||
|
`id` int NOT NULL AUTO_INCREMENT,
|
||||||
|
`appName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '应用名称',
|
||||||
|
`appType` tinyint NOT NULL COMMENT '应用类型 1:本地应用 2:云应用 3:hpc求解应用 4:web应用',
|
||||||
|
`creator` bigint NOT NULL COMMENT '应用调用人',
|
||||||
|
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '应用调用时间',
|
||||||
|
PRIMARY KEY (`id`) USING BTREE
|
||||||
|
) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;
|
||||||
|
|
||||||
|
SET FOREIGN_KEY_CHECKS = 1;
|
||||||
@@ -147,4 +147,10 @@ public class FlowController implements ISimulationFlowFeignClient {
|
|||||||
return IFlowService.queryFlowTemplateInfoByTemplateCode(templateCode);
|
return IFlowService.queryFlowTemplateInfoByTemplateCode(templateCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/queryValidFlowTemplate")
|
||||||
|
public SdmResponse<List<FlowTemplateResp>> queryValidFlowTemplateInfo()
|
||||||
|
{
|
||||||
|
return IFlowService.queryValidFlowTemplateInfo();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -95,4 +95,10 @@ public interface IFlowService {
|
|||||||
*/
|
*/
|
||||||
SdmResponse<FlowTemplateResp> queryFlowTemplateInfoByTemplateCode(String templateCode);
|
SdmResponse<FlowTemplateResp> queryFlowTemplateInfoByTemplateCode(String templateCode);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取系统中有效的流程模版
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
SdmResponse<List<FlowTemplateResp>> queryValidFlowTemplateInfo();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -544,4 +544,22 @@ public class FlowServiceImpl extends BaseService implements IFlowService {
|
|||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SdmResponse<List<FlowTemplateResp>> queryValidFlowTemplateInfo()
|
||||||
|
{
|
||||||
|
SdmResponse<List<FlowTemplateResp>> response = SdmResponse.success();
|
||||||
|
String condition = " approveType=2 AND templateStatus=1 ";
|
||||||
|
List<SimulationFlowTemplate> flowTemplates = flowMapper.queryFlowTemplateByCondition(condition);
|
||||||
|
List<FlowTemplateResp> flowTemplateRespList = new ArrayList<>();
|
||||||
|
for(SimulationFlowTemplate flowTemplate : flowTemplates)
|
||||||
|
{
|
||||||
|
FlowTemplateResp flowTemplateResp = new FlowTemplateResp();
|
||||||
|
flowTemplateResp.templateCode = flowTemplate.getTemplateCode();
|
||||||
|
flowTemplateResp.templateName = flowTemplate.getTemplateName();
|
||||||
|
flowTemplateRespList.add(flowTemplateResp);
|
||||||
|
}
|
||||||
|
response.setData(flowTemplateRespList);
|
||||||
|
return response;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import com.sdm.common.feign.inter.capability.ISimulationFlowFeignClient;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -123,4 +124,20 @@ public class SimulationFlowFeignClientImpl implements ISimulationFlowFeignClient
|
|||||||
return SdmResponse.failed("查询流程模板信息失败异常");
|
return SdmResponse.failed("查询流程模板信息失败异常");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SdmResponse<List<FlowTemplateResp>> queryValidFlowTemplateInfo()
|
||||||
|
{
|
||||||
|
SdmResponse<List<FlowTemplateResp>> response;
|
||||||
|
try {
|
||||||
|
response = flowFeignClient.queryValidFlowTemplateInfo();
|
||||||
|
if (!response.isSuccess()) {
|
||||||
|
return SdmResponse.failed("查询有效流程模板信息失败");
|
||||||
|
}
|
||||||
|
return response;
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("查询有效流程模板信息失败异常", e);
|
||||||
|
return SdmResponse.failed("查询有效流程模板信息失败异常");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,4 +36,7 @@ public interface ISimulationFlowFeignClient {
|
|||||||
@GetMapping("/flow/queryFlowTemplateInfoByTemplateCode")
|
@GetMapping("/flow/queryFlowTemplateInfoByTemplateCode")
|
||||||
SdmResponse<FlowTemplateResp> queryFlowTemplateInfoByTemplateCode(@RequestParam("templateCode") String templateCode);
|
SdmResponse<FlowTemplateResp> queryFlowTemplateInfoByTemplateCode(@RequestParam("templateCode") String templateCode);
|
||||||
|
|
||||||
|
@GetMapping("/flow/queryValidFlowTemplate")
|
||||||
|
SdmResponse<List<FlowTemplateResp>> queryValidFlowTemplateInfo();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,9 +16,11 @@ import com.sdm.common.entity.req.data.GetFileSimulationMappingReq;
|
|||||||
import com.sdm.common.entity.req.data.SaveFileSimulationMappingReq;
|
import com.sdm.common.entity.req.data.SaveFileSimulationMappingReq;
|
||||||
import com.sdm.common.entity.req.system.LaunchApproveReq;
|
import com.sdm.common.entity.req.system.LaunchApproveReq;
|
||||||
import com.sdm.common.entity.req.task.BindTaskAndFlowTemplateReq;
|
import com.sdm.common.entity.req.task.BindTaskAndFlowTemplateReq;
|
||||||
|
import com.sdm.common.entity.resp.capability.FlowTemplateResp;
|
||||||
import com.sdm.common.entity.resp.data.FileMetadataInfoResp;
|
import com.sdm.common.entity.resp.data.FileMetadataInfoResp;
|
||||||
import com.sdm.common.feign.impl.project.SimulationTaskFeignClientImpl;
|
import com.sdm.common.feign.impl.project.SimulationTaskFeignClientImpl;
|
||||||
import com.sdm.common.feign.impl.system.ApproveFeignClientImpl;
|
import com.sdm.common.feign.impl.system.ApproveFeignClientImpl;
|
||||||
|
import com.sdm.common.feign.inter.capability.ISimulationFlowFeignClient;
|
||||||
import com.sdm.common.feign.inter.data.IFileSimulationMappingFeignClient;
|
import com.sdm.common.feign.inter.data.IFileSimulationMappingFeignClient;
|
||||||
import com.sdm.common.feign.inter.project.ISimulationTaskFeignClient;
|
import com.sdm.common.feign.inter.project.ISimulationTaskFeignClient;
|
||||||
import com.sdm.common.service.BaseService;
|
import com.sdm.common.service.BaseService;
|
||||||
@@ -62,6 +64,9 @@ public class SimulationTaskPoolServiceImpl extends BaseService implements ISimul
|
|||||||
@Autowired
|
@Autowired
|
||||||
private ISimulationTaskFeignClient simulationTaskFeignClient;
|
private ISimulationTaskFeignClient simulationTaskFeignClient;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISimulationFlowFeignClient simulationFlowFeignClient;
|
||||||
|
|
||||||
@Value("${approve.replyUrl}")
|
@Value("${approve.replyUrl}")
|
||||||
private String approveReplyUrl;
|
private String approveReplyUrl;
|
||||||
|
|
||||||
@@ -429,8 +434,20 @@ public class SimulationTaskPoolServiceImpl extends BaseService implements ISimul
|
|||||||
JSONObject poolJson = JSONObject.parseObject(contents);
|
JSONObject poolJson = JSONObject.parseObject(contents);
|
||||||
List<SimulatePoolTaskFlowTemplateRelate> templateRelates = mapper.queryTaskFlowRelateByPoolVersion(poolName,version);
|
List<SimulatePoolTaskFlowTemplateRelate> templateRelates = mapper.queryTaskFlowRelateByPoolVersion(poolName,version);
|
||||||
Map<String,String> taskFlowMap = new HashMap<>();
|
Map<String,String> taskFlowMap = new HashMap<>();
|
||||||
|
Map<String,FlowTemplateResp> validFlowTemplateMap = new HashMap<>();
|
||||||
|
SdmResponse<List<FlowTemplateResp>> validFlowTemplates = simulationFlowFeignClient.queryValidFlowTemplateInfo();
|
||||||
|
if(validFlowTemplates.isSuccess()) {
|
||||||
|
List<FlowTemplateResp> flowTemplates = validFlowTemplates.getData();
|
||||||
|
for(FlowTemplateResp templateResp : flowTemplates)
|
||||||
|
{
|
||||||
|
String flowCode = templateResp.templateCode;
|
||||||
|
validFlowTemplateMap.put(flowCode,templateResp);
|
||||||
|
}
|
||||||
|
}
|
||||||
for(SimulatePoolTaskFlowTemplateRelate relate : templateRelates)
|
for(SimulatePoolTaskFlowTemplateRelate relate : templateRelates)
|
||||||
{
|
{
|
||||||
|
if(!validFlowTemplateMap.containsKey(relate.flowCode))
|
||||||
|
continue;
|
||||||
String flowTemplates = taskFlowMap.get(relate.taskUuid);
|
String flowTemplates = taskFlowMap.get(relate.taskUuid);
|
||||||
if(flowTemplates == null)
|
if(flowTemplates == null)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user