Merge branch 'main' of http://192.168.65.198:3000/toolchaintechnologycenter/spdm-backend
# Conflicts: # project/src/main/java/com/sdm/project/controller/SimulationNodeController.java # project/src/main/java/com/sdm/project/service/INodeService.java # project/src/main/java/com/sdm/project/service/impl/NodeServiceImpl.java
This commit is contained in:
@@ -6,6 +6,7 @@ import com.sdm.common.entity.req.project.DelNodeReq;
|
||||
import com.sdm.common.entity.req.project.RenameNodeReq;
|
||||
import com.sdm.common.entity.req.project.SpdmNodeListReq;
|
||||
import com.sdm.common.entity.resp.AllNodeByProjectIdAndTypeResp;
|
||||
import com.sdm.common.entity.resp.project.SimulationNodeResp;
|
||||
import com.sdm.common.feign.inter.project.ISimulationNodeFeignClient;
|
||||
import com.sdm.project.model.req.*;
|
||||
import com.sdm.project.service.INodeService;
|
||||
@@ -233,4 +234,15 @@ public class SimulationNodeController implements ISimulationNodeFeignClient {
|
||||
return nodeService.addTaskForData(req);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据List<uuid> 查询所有的 simulation_node 信息
|
||||
* @param
|
||||
* @return SimulationNode集合
|
||||
*/
|
||||
@PostMapping(value = "/querySimulationNodeByUuids")
|
||||
@Operation(summary = "根据uuids查询所有的node列表", description = "根据uuids查询所有的node列表")
|
||||
public SdmResponse<List<SimulationNodeResp>> querySimulationNodeByUuids(@RequestBody List<String>uuids) {
|
||||
return nodeService.querySimulationNodeByUuids(uuids);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.sdm.project.dao;
|
||||
|
||||
|
||||
import com.sdm.common.entity.resp.project.SimulationNodeResp;
|
||||
import com.sdm.project.model.bo.*;
|
||||
import com.sdm.project.model.po.*;
|
||||
import com.sdm.project.model.req.ProjectTreeReq;
|
||||
@@ -173,4 +174,6 @@ public interface SimulationProjectMapper {
|
||||
|
||||
List<RunNodePo> getRunListByNodeIdList(@Param("taskIdList") List<String> taskIdList);
|
||||
|
||||
List<SimulationNodeResp> querySimulationNodeByUuids(@Param("list")List<String> uuids);
|
||||
|
||||
}
|
||||
|
||||
@@ -206,7 +206,7 @@ public class ProjectNode extends BaseEntity {
|
||||
private String group;
|
||||
@JsonProperty(value = "bCapacity")
|
||||
private String bCapacity;
|
||||
private String flowTemplateName;
|
||||
private String flowTemplate;
|
||||
private String englishName;
|
||||
|
||||
private List<String> analyseSoftwareList;
|
||||
|
||||
@@ -229,7 +229,7 @@ public class TaskNode extends BaseEntity {
|
||||
private String group;
|
||||
@JsonProperty(value = "bCapacity")
|
||||
private String bCapacity;
|
||||
private String flowTemplateName;
|
||||
private String flowTemplate;
|
||||
|
||||
@JsonProperty(value = "tag1")
|
||||
private List<String> tag1;
|
||||
|
||||
@@ -46,9 +46,9 @@ public class SimulationRun implements Serializable {
|
||||
@TableField("taskId")
|
||||
private String taskId;
|
||||
|
||||
@ApiModelProperty(value = "流程模板名称")
|
||||
@TableField("templateName")
|
||||
private String templateName;
|
||||
@ApiModelProperty(value = "流程模板id")
|
||||
@TableField("flowTemplate")
|
||||
private String flowTemplate;
|
||||
|
||||
@ApiModelProperty(value = "Run状态 0:未执行 1:执行中 2:完成 3:失败")
|
||||
@TableField("status")
|
||||
@@ -62,9 +62,13 @@ public class SimulationRun implements Serializable {
|
||||
@TableField("currentStep")
|
||||
private Integer currentStep;
|
||||
|
||||
@ApiModelProperty(value = "当前的流程步骤名称")
|
||||
@TableField("currentStepName")
|
||||
private String currentStepName;
|
||||
|
||||
@ApiModelProperty(value = "Run执行结果 0:gray 1:red 2:yellow 3:green")
|
||||
@TableField("result")
|
||||
private Integer result;
|
||||
@TableField("achieveStatus")
|
||||
private Integer achieveStatus;
|
||||
|
||||
@ApiModelProperty(value = "run描述信息")
|
||||
@TableField("description")
|
||||
@@ -81,9 +85,14 @@ public class SimulationRun implements Serializable {
|
||||
@TableField("isPersonalTemplate")
|
||||
private String isPersonalTemplate;
|
||||
|
||||
@ApiModelProperty(value = "租户id")
|
||||
@TableField("tenantId")
|
||||
private Long tenantId;
|
||||
|
||||
@ApiModelProperty(value = "英文名")
|
||||
@TableField("englishName")
|
||||
private Long englishName;
|
||||
|
||||
@TableField("tag1")
|
||||
private String tag1;
|
||||
|
||||
|
||||
@@ -155,8 +155,8 @@ public class SimulationTask implements Serializable {
|
||||
private String bCapacity;
|
||||
|
||||
@ApiModelProperty(value = "任务流程模板")
|
||||
@TableField("flowTemplateName")
|
||||
private String flowTemplateName;
|
||||
@TableField("flowTemplate")
|
||||
private String flowTemplate;
|
||||
|
||||
@TableField("englishName")
|
||||
private String englishName;
|
||||
|
||||
@@ -154,7 +154,7 @@ public class TaskNodePo extends NodeAllBase {
|
||||
// private String group;
|
||||
private String groupName;
|
||||
private String bCapacity;
|
||||
private String flowTemplateName;
|
||||
private String flowTemplate;
|
||||
private String englishName;
|
||||
private String description;
|
||||
|
||||
|
||||
@@ -15,9 +15,9 @@ public class SpdmAddTaskRunReq {
|
||||
@Schema(description = "备注")
|
||||
private String description;
|
||||
|
||||
@NotBlank(message = "templateName不能为空")
|
||||
@Schema(description = "流程模板名称")
|
||||
private String templateName;
|
||||
@NotBlank(message = "flowTemplate不能为空")
|
||||
@Schema(description = "流程模板id")
|
||||
private String flowTemplate;
|
||||
|
||||
// @NotNull(message = "totalStep不能为空")
|
||||
@Schema(description = "总步骤")
|
||||
|
||||
@@ -263,7 +263,7 @@ public class TaskEditNodeReq extends BaseEntity {
|
||||
private String group;
|
||||
@JsonProperty(value = "bCapacity")
|
||||
private String bCapacity;
|
||||
private String flowTemplateName;
|
||||
private String flowTemplate;
|
||||
private String englishName;
|
||||
private String performanceType;
|
||||
|
||||
|
||||
@@ -100,7 +100,7 @@ public class SpdmNewTaskVo extends BaseEntity {
|
||||
private String groupName;
|
||||
@JsonProperty(value = "bCapacity")
|
||||
private String bCapacity;
|
||||
private String flowTemplateName;
|
||||
private String flowTemplate;
|
||||
private String englishName;
|
||||
|
||||
|
||||
|
||||
@@ -101,7 +101,7 @@ public class SpdmTaskVo extends BaseEntity {
|
||||
private String groupName;
|
||||
@JsonProperty(value = "bCapacity")
|
||||
private String bCapacity;
|
||||
private String flowTemplateName;
|
||||
private String flowTemplate;
|
||||
private String englishName;
|
||||
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.sdm.common.entity.req.project.DelNodeReq;
|
||||
import com.sdm.common.entity.req.project.RenameNodeReq;
|
||||
import com.sdm.common.entity.req.project.SpdmNodeListReq;
|
||||
import com.sdm.common.entity.resp.AllNodeByProjectIdAndTypeResp;
|
||||
import com.sdm.common.entity.resp.project.SimulationNodeResp;
|
||||
import com.sdm.project.model.entity.SimulationNode;
|
||||
import com.sdm.project.model.req.*;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -57,4 +58,7 @@ public interface INodeService extends IService<SimulationNode> {
|
||||
SdmResponse addNodeForData(SpdmAddNodeReq req);
|
||||
|
||||
SdmResponse addTaskForData(SpdmTaskReq req);
|
||||
|
||||
SdmResponse<List<SimulationNodeResp>> querySimulationNodeByUuids(List<String> uuids);
|
||||
|
||||
}
|
||||
|
||||
@@ -16,12 +16,14 @@ import com.sdm.common.entity.req.project.SpdmNodeListReq;
|
||||
import com.sdm.common.entity.req.system.QueryGroupDetailReq;
|
||||
import com.sdm.common.entity.req.system.UserQueryReq;
|
||||
import com.sdm.common.entity.resp.AllNodeByProjectIdAndTypeResp;
|
||||
import com.sdm.common.entity.resp.project.SimulationNodeResp;
|
||||
import com.sdm.common.entity.resp.system.CIDUserResp;
|
||||
import com.sdm.common.entity.resp.system.SysUserGroupDetailResp;
|
||||
import com.sdm.common.feign.impl.data.DataClientFeignClientImpl;
|
||||
import com.sdm.common.feign.impl.system.SysConfigFeignClientImpl;
|
||||
import com.sdm.common.feign.impl.system.SysUserFeignClientImpl;
|
||||
import com.sdm.common.feign.inter.data.IDataFeignClient;
|
||||
import com.sdm.common.log.CoreLogger;
|
||||
import com.sdm.common.utils.DateUtils;
|
||||
import com.sdm.common.utils.RandomUtil;
|
||||
import com.sdm.project.dao.SimulationDemandMapper;
|
||||
@@ -49,6 +51,7 @@ import org.apache.commons.lang3.StringUtils;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
||||
@@ -96,6 +99,9 @@ public class NodeServiceImpl extends ServiceImpl<SimulationNodeMapper, Simulatio
|
||||
@Autowired
|
||||
private SysConfigFeignClientImpl sysConfigFeignClient;
|
||||
|
||||
@Value("${node.batch.queryCounts:1000}")
|
||||
private Integer queryCounts;
|
||||
|
||||
private HashMap<String, String> idMap = new HashMap<>();
|
||||
|
||||
@Autowired
|
||||
@@ -218,8 +224,10 @@ public class NodeServiceImpl extends ServiceImpl<SimulationNodeMapper, Simulatio
|
||||
public SdmResponse list(SpdmNodeListReq req) {
|
||||
int pos = (req.getCurrent() - 1) * req.getSize();
|
||||
int limit = req.getSize();
|
||||
Long tenantId = ThreadLocalContext.getTenantId();
|
||||
List<SpdmNodeVo> nodeList = nodeMapper.getNodeList(req.getNodeType(), req.getNodeSubType(), req.getProgressStatus(), req.getNodeCode(), req.getManager(), req.getNodeName(),
|
||||
ThreadLocalContext.getTenantId(), pos, limit);
|
||||
tenantId, pos, limit);
|
||||
CoreLogger.info("getNodeList param:{},tenantId:{}", JSONObject.toJSONString(req), tenantId);
|
||||
if (CollectionUtils.isEmpty(nodeList)) {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("data", nodeList);
|
||||
@@ -1333,4 +1341,17 @@ public class NodeServiceImpl extends ServiceImpl<SimulationNodeMapper, Simulatio
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public SdmResponse<List<SimulationNodeResp>> querySimulationNodeByUuids(List<String> uuids) {
|
||||
if(CollectionUtils.isEmpty(uuids)){
|
||||
return SdmResponse.failed("参数为空");
|
||||
}
|
||||
if(uuids.size()>queryCounts){
|
||||
return SdmResponse.failed("单次批量查询不允许超过"+queryCounts);
|
||||
}
|
||||
List<SimulationNodeResp> simulationNodeResps = mapper.querySimulationNodeByUuids(uuids);
|
||||
return SdmResponse.success(simulationNodeResps);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -490,7 +490,7 @@ public class SimulationRunServiceImpl extends ServiceImpl<SimulationRunMapper, S
|
||||
simulationRun.setDescription(req.getDescription());
|
||||
simulationRun.setTotalStep(req.getTotalStep());
|
||||
simulationRun.setParentId(req.getParentId());
|
||||
simulationRun.setTemplateName(req.getTemplateName());
|
||||
simulationRun.setFlowTemplate(req.getFlowTemplate());
|
||||
simulationRun.setCreator(userId);
|
||||
simulationRun.setUpdater(userId);
|
||||
simulationRun.setTenantId(tenantId);
|
||||
|
||||
@@ -35,11 +35,11 @@
|
||||
|
||||
<insert id="batchAddSimulationTask" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into simulation_task (uuid,task_name,task_code,task_pool_name,task_pool_version,node_id,days,standard,fold_id,status,achieve_status,begin_time,end_time,progress,exe_status,confidence,analyse_target,analyse_software,description,difficult,tenant_id
|
||||
,creator,create_time,department,sectionName,groupName,bCapacity,flowTemplateName,englishName,demand_id,tag1,tag2,tag3,tag4,tag5,tag6,tag7,tag8,tag9,tag10) values
|
||||
,creator,create_time,department,sectionName,groupName,bCapacity,flowTemplate,englishName,demand_id,tag1,tag2,tag3,tag4,tag5,tag6,tag7,tag8,tag9,tag10) values
|
||||
<foreach collection='list' item='it' index='index' separator=','>
|
||||
(#{it.uuid},#{it.taskName},#{it.taskCode},'','',#{it.nodeId},#{it.days},#{it.standard},'',1,0,
|
||||
#{it.beginTime},#{it.endTime},0,1,#{it.confidence},#{it.analyseTarget},#{it.analyseSoftwares},#{it.description},#{it.difficult},#{it.tenantId},
|
||||
#{it.creator},#{it.createTime},#{it.department},#{it.section},#{it.group},#{it.bCapacity},#{it.flowTemplateName},#{it.englishName},#{it.demandId},#{it.tag1,typeHandler=com.sdm.project.handler.ListStringTypeHandler},#{it.tag2,typeHandler=com.sdm.project.handler.ListStringTypeHandler},
|
||||
#{it.creator},#{it.createTime},#{it.department},#{it.section},#{it.group},#{it.bCapacity},#{it.flowTemplate},#{it.englishName},#{it.demandId},#{it.tag1,typeHandler=com.sdm.project.handler.ListStringTypeHandler},#{it.tag2,typeHandler=com.sdm.project.handler.ListStringTypeHandler},
|
||||
#{it.tag3,typeHandler=com.sdm.project.handler.ListStringTypeHandler},#{it.tag4,typeHandler=com.sdm.project.handler.ListStringTypeHandler},
|
||||
#{it.tag5,typeHandler=com.sdm.project.handler.ListStringTypeHandler},#{it.tag6,typeHandler=com.sdm.project.handler.ListStringTypeHandler},
|
||||
#{it.tag7,typeHandler=com.sdm.project.handler.ListStringTypeHandler},#{it.tag8,typeHandler=com.sdm.project.handler.ListStringTypeHandler},
|
||||
@@ -186,8 +186,8 @@
|
||||
update_time = #{taskNode.updateTime},
|
||||
</if>
|
||||
|
||||
<if test="taskNode.flowTemplateName != null and taskNode.flowTemplateName != ''">
|
||||
flowTemplateName = #{taskNode.flowTemplateName},
|
||||
<if test="taskNode.flowTemplate != null and taskNode.flowTemplate != ''">
|
||||
flowTemplate = #{taskNode.flowTemplate},
|
||||
</if>
|
||||
|
||||
<if test="taskNode.englishName != null and taskNode.englishName != ''">
|
||||
@@ -646,6 +646,16 @@
|
||||
)
|
||||
</select>
|
||||
|
||||
<select id="querySimulationNodeByUuids" resultType="com.sdm.common.entity.resp.project.SimulationNodeResp">
|
||||
select uuid,ownRootNodeUuid,nodeName,nodeCode,englishName,nodeType,nodeSubType,nodeStatus,parentId,folderId,nodeLevel,beginTime,endTime,finishTime,progress,
|
||||
achieveStatus,nodeVersion,tenantId,description,detailImgUrl,creator,create_time,tag1,tag2,tag3,tag4,tag5,tag6,tag7,tag8,tag9,tag10
|
||||
from simulation_node where uuid in (
|
||||
<foreach collection='list' item='udid' index='index' separator=','>
|
||||
#{udid}
|
||||
</foreach>
|
||||
)
|
||||
</select>
|
||||
|
||||
<!-- <select id="getTaskList" resultType="com.sdm.project.entity.vo.SpdmTaskVo">-->
|
||||
<!-- select * from simulation_task where tenant_id = #{tenantId}-->
|
||||
<!-- <if test="taskName != null and taskName != ''">-->
|
||||
|
||||
Reference in New Issue
Block a user