新增:hpc应用配置增加动态命令相关配置。

This commit is contained in:
2026-03-05 16:28:16 +08:00
parent 344516b379
commit 9ca3077fb0
10 changed files with 721 additions and 2 deletions

View File

@@ -0,0 +1,31 @@
package com.sdm.common.entity.req.pbs;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.List;
/**
* <p>
* 仿真软件命令配置表
* </p>
*
* @author author
* @since 2025-12-01
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@Schema(description = "仿真软件hpc命令配置远程请求")
public class SimulationHpcCommandAllReq implements Serializable {
private static final long serialVersionUID = 1L;
private SimulationHpcCommandReq commandReq;
private List<SimulationHpcCommandPlaceholderReq> placeholderReqList;
}

View File

@@ -0,0 +1,71 @@
package com.sdm.common.entity.req.pbs;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* <p>
* 仿真工具命令占位符配置表
* </p>
*
* @author author
* @since 2025-12-01
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@Schema(description = "仿真工具hpc命令占位符配置表")
public class SimulationHpcCommandPlaceholderReq implements Serializable {
private static final long serialVersionUID = 1L;
@Schema(description = "自增主键")
private Long id;
@Schema(description = "app注册的Id")
private String appUuid;
@Schema(description = "占位符英文名称")
private String keyEnName;
@Schema(description = "占位符中文名称")
private String keyCnName;
@Schema(description = "占位符值的类型file:共享云盘文件input:用户自定义输入)")
private String valueType;
@Schema(description = "是否展示Y:是N:否N时必须填写默认值")
private String isDisplay;
@Schema(description = "是否拼接Y:是N:否N时不用拼接到命令")
private String featchType;
@Schema(description = "默认值valueType为file且isDisplay为N时必填")
private String defaultValue;
@Schema(description = "文件正则表达式valueType为file时必填用于过滤对应的求解文件")
private String fileRegular;
@Schema(description = "创建者ID")
private Long creatorId;
@Schema(description = "创建时间")
private LocalDateTime createTime;
@Schema(description = "更新者ID")
private Long updaterId;
@Schema(description = "修改时间")
private LocalDateTime updateTime;
}

View File

@@ -0,0 +1,66 @@
package com.sdm.common.entity.req.pbs;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;
/**
* <p>
* 仿真软件命令配置表
* </p>
*
* @author author
* @since 2025-12-01
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@Schema(description = "仿真软件hpc命令配置表")
public class SimulationHpcCommandReq implements Serializable {
private static final long serialVersionUID = 1L;
@Schema(description = "自增主键")
private Long id;
@Schema(description = "app注册的Id")
private String appUuid;
@Schema(description = "软件名称,对应的simulation_app_repository的appName名字建议格式appName_v1")
private String softName;
@Schema(description = "软件版本号")
private String softVersion;
@Schema(description = "功能描述(如:电池仿真)")
private String functionDsc;
@Schema(description = "功能对应的CMD命令")
private String command;
@Schema(description = "预留-软件执行完成后筛选回传文件正则,用于过滤回传文件")
private String postFileRegular;
@Schema(description = "创建者ID")
private Long creatorId;
@Schema(description = "创建时间")
private LocalDateTime createTime;
@Schema(description = "更新者ID")
private Long updaterId;
@Schema(description = "修改时间")
private LocalDateTime updateTime;
}

View File

@@ -0,0 +1,35 @@
package com.sdm.common.entity.resp.pbs.hpc;
import com.sdm.common.entity.req.pbs.SimulationHpcCommandPlaceholderReq;
import com.sdm.common.entity.req.pbs.SimulationHpcCommandReq;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.List;
/**
* <p>
* 仿真软件命令配置表
* </p>
*
* @author author
* @since 2025-12-01
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@Schema(description = "仿真软件hpc命令配置远程请求")
public class SimulationHpcCommandAllResp implements Serializable {
private static final long serialVersionUID = 1L;
private String appUuid;
private SimulationHpcCommandReq commandReq;
private List<SimulationHpcCommandPlaceholderReq> placeholderReqList;
}

View File

@@ -0,0 +1,69 @@
package com.sdm.common.feign.impl.pbs;
import com.sdm.common.common.SdmResponse;
import com.sdm.common.entity.req.pbs.SimulationHpcCommandAllReq;
import com.sdm.common.entity.resp.pbs.hpc.SimulationHpcCommandAllResp;
import com.sdm.common.feign.inter.pbs.ISimulationHpcCommandFeignClient;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.List;
@Slf4j
@Component
public class SimulationHpcCommandFeignClientImpl implements ISimulationHpcCommandFeignClient {
@Autowired
private ISimulationHpcCommandFeignClient simulationHpcCommandFeignClient;
@Override
public SdmResponse<String> hpcCommandSaveDb(SimulationHpcCommandAllReq req) {
SdmResponse<String> response;
try {
response = simulationHpcCommandFeignClient.hpcCommandSaveDb(req);
return response;
} catch (Exception e) {
log.error("hpcCommandSaveDb Exception:{}", e.getMessage());
return SdmResponse.failed("Hpc命令配置保存失败:"+e.getMessage());
}
}
@Override
public SdmResponse<String> hpcCommandUpdateDb(SimulationHpcCommandAllReq allReq) {
SdmResponse<String> response;
try {
response = simulationHpcCommandFeignClient.hpcCommandUpdateDb(allReq);
return response;
} catch (Exception e) {
log.error("hpcCommandUpdateDb Exception:{}", e.getMessage());
return SdmResponse.failed("Hpc命令配置修改失败:"+e.getMessage());
}
}
@Override
public SdmResponse<String> deleteHpcCommandConfigs(String appId) {
SdmResponse<String> response;
try {
response = simulationHpcCommandFeignClient.deleteHpcCommandConfigs(appId);
return response;
} catch (Exception e) {
log.error("deleteHpcCommandConfigs Exception:{}", e.getMessage());
return SdmResponse.failed("Hpc命令配置删除失败:"+e.getMessage());
}
}
@Override
public SdmResponse<List<SimulationHpcCommandAllResp>> getHpcCommandConfigs(List<String> hpcUuidList) {
SdmResponse<List<SimulationHpcCommandAllResp>> response;
try {
response = simulationHpcCommandFeignClient.getHpcCommandConfigs(hpcUuidList);
return response;
} catch (Exception e) {
log.error("getHpcCommandConfigs Exception:{}", e.getMessage());
return SdmResponse.failed("Hpc命令配置查询失败:"+e.getMessage());
}
}
}