添加系统参数配置
This commit is contained in:
@@ -22,6 +22,7 @@ import com.sdm.common.feign.inter.data.IDataFeignClient;
|
||||
import com.sdm.common.utils.HttpUtil;
|
||||
import com.sdm.common.utils.SystemOperate;
|
||||
import com.sdm.project.common.KeyResultTypeEnum;
|
||||
import com.sdm.project.dao.YAMapper.BosimModuleMap;
|
||||
import com.sdm.project.model.entity.SimulationRunKeyResult;
|
||||
import com.sdm.project.model.req.KeyResultReq;
|
||||
import com.sdm.project.model.req.YA.*;
|
||||
@@ -83,6 +84,9 @@ public class YAModelController {
|
||||
|
||||
@Value("${YA.default.userId}")
|
||||
private Long userId;
|
||||
|
||||
@Autowired
|
||||
BosimModuleMap moduleMap;
|
||||
/**
|
||||
* 保存仿真模型数据
|
||||
*
|
||||
@@ -133,6 +137,7 @@ public class YAModelController {
|
||||
rsp.setCode("-200");
|
||||
rsp.setMessage(uploadRespond.getMessage());
|
||||
}
|
||||
|
||||
return rsp;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
package com.sdm.project.model.entity.YA;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@TableName("SimulationKeyResult")
|
||||
@Data
|
||||
public class SimulationKeyResult implements Serializable {
|
||||
|
||||
@@ -14,110 +16,132 @@ public class SimulationKeyResult implements Serializable {
|
||||
/**
|
||||
* 仿真模型内部ID
|
||||
*/
|
||||
@TableField("ID")
|
||||
private String ID;
|
||||
|
||||
/**
|
||||
* 仿真模型外部编码
|
||||
*/
|
||||
@TableField("Number")
|
||||
private String Number;
|
||||
|
||||
/**
|
||||
* 仿真模型名称
|
||||
*/
|
||||
@TableField("Name")
|
||||
private String Name;
|
||||
|
||||
/**
|
||||
* 仿真模型描述
|
||||
*/
|
||||
@TableField("Description")
|
||||
private String Description;
|
||||
|
||||
/**
|
||||
* 所属仿真实例化规划编码
|
||||
*/
|
||||
@TableField("Project")
|
||||
private String Project;
|
||||
|
||||
/**
|
||||
* 所属方案编码
|
||||
*/
|
||||
@TableField("Edition")
|
||||
private String Edition;
|
||||
|
||||
/**
|
||||
* 父节点编码
|
||||
*/
|
||||
@TableField("Parent")
|
||||
private String Parent;
|
||||
|
||||
/**
|
||||
* 关联仿真分析项编码
|
||||
*/
|
||||
@TableField("Scenario")
|
||||
private String Scenario;
|
||||
|
||||
/**
|
||||
* 所属仿真分析活动
|
||||
*/
|
||||
@TableField("WorkTask")
|
||||
private String WorkTask;
|
||||
|
||||
/**
|
||||
* 主文件ID
|
||||
*/
|
||||
@TableField("File")
|
||||
private String File;
|
||||
|
||||
/**
|
||||
* 子文件文件夹ID
|
||||
*/
|
||||
@TableField("Folder")
|
||||
private String Folder;
|
||||
|
||||
/**
|
||||
* 关联仿真模型定义ID
|
||||
*/
|
||||
@TableField("ModelDefinition")
|
||||
private String ModelDefinition;
|
||||
|
||||
/**
|
||||
* 分析类型
|
||||
*/
|
||||
@TableField("AnalysisType")
|
||||
private Byte AnalysisType;
|
||||
|
||||
/**
|
||||
* 格式类型
|
||||
*/
|
||||
@TableField("FormatType")
|
||||
private Byte FormatType;
|
||||
|
||||
/**
|
||||
* 安全等级
|
||||
*/
|
||||
@TableField("LevelType")
|
||||
private Byte LevelType;
|
||||
|
||||
/**
|
||||
* 可用状态
|
||||
*/
|
||||
@TableField("StatusType")
|
||||
private Byte StatusType;
|
||||
|
||||
/**
|
||||
* 修订版本
|
||||
*/
|
||||
@TableField("Version")
|
||||
private String Version;
|
||||
|
||||
/**
|
||||
* 仿真模型所有者
|
||||
*/
|
||||
@TableField("Owner")
|
||||
private String Owner;
|
||||
|
||||
/**
|
||||
* 仿真模型创建者
|
||||
*/
|
||||
@TableField("Creator")
|
||||
private String Creator;
|
||||
|
||||
/**
|
||||
* 仿真模型更新者
|
||||
*/
|
||||
@TableField("Modifier")
|
||||
private String Modifier;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField("CreateTime")
|
||||
private Date CreateTime;
|
||||
|
||||
/**
|
||||
* 最近更新时间
|
||||
*/
|
||||
@TableField("LastUpdateTime")
|
||||
private Date LastUpdateTime;
|
||||
}
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
package com.sdm.project.model.entity.YA;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@TableName("SimulationModel")
|
||||
@Data
|
||||
public class SimulationModel implements Serializable {
|
||||
|
||||
@@ -13,110 +16,132 @@ public class SimulationModel implements Serializable {
|
||||
/**
|
||||
* 仿真模型内部ID
|
||||
*/
|
||||
@TableField("ID")
|
||||
private String ID;
|
||||
|
||||
/**
|
||||
* 仿真模型外部编码
|
||||
*/
|
||||
@TableField("Number")
|
||||
private String Number;
|
||||
|
||||
/**
|
||||
* 仿真模型名称
|
||||
*/
|
||||
@TableField("Name")
|
||||
private String Name;
|
||||
|
||||
/**
|
||||
* 仿真模型描述
|
||||
*/
|
||||
@TableField("Description")
|
||||
private String Description;
|
||||
|
||||
/**
|
||||
* 所属仿真实例化规划编码
|
||||
*/
|
||||
@TableField("Project")
|
||||
private String Project;
|
||||
|
||||
/**
|
||||
* 所属方案编码
|
||||
*/
|
||||
@TableField("Edition")
|
||||
private String Edition;
|
||||
|
||||
/**
|
||||
* 父节点编码
|
||||
*/
|
||||
@TableField("Parent")
|
||||
private String Parent;
|
||||
|
||||
/**
|
||||
* 关联仿真分析项编码
|
||||
*/
|
||||
@TableField("Scenario")
|
||||
private String Scenario;
|
||||
|
||||
/**
|
||||
* 所属仿真分析活动
|
||||
*/
|
||||
@TableField("WorkTask")
|
||||
private String WorkTask;
|
||||
|
||||
/**
|
||||
* 主文件ID
|
||||
*/
|
||||
@TableField("File")
|
||||
private String File;
|
||||
|
||||
/**
|
||||
* 子文件文件夹ID
|
||||
*/
|
||||
@TableField("Folder")
|
||||
private String Folder;
|
||||
|
||||
/**
|
||||
* 关联仿真模型定义ID
|
||||
*/
|
||||
@TableField("ModelDefinition")
|
||||
private String ModelDefinition;
|
||||
|
||||
/**
|
||||
* 分析类型
|
||||
*/
|
||||
@TableField("AnalysisType")
|
||||
private Byte AnalysisType;
|
||||
|
||||
/**
|
||||
* 格式类型
|
||||
*/
|
||||
@TableField("FormatType")
|
||||
private Byte FormatType;
|
||||
|
||||
/**
|
||||
* 安全等级
|
||||
*/
|
||||
@TableField("LevelType")
|
||||
private Byte LevelType;
|
||||
|
||||
/**
|
||||
* 可用状态
|
||||
*/
|
||||
@TableField("StatusType")
|
||||
private Byte StatusType;
|
||||
|
||||
/**
|
||||
* 修订版本
|
||||
*/
|
||||
@TableField("Version")
|
||||
private String Version;
|
||||
|
||||
/**
|
||||
* 仿真模型所有者
|
||||
*/
|
||||
@TableField("Owner")
|
||||
private String Owner;
|
||||
|
||||
/**
|
||||
* 仿真模型创建者
|
||||
*/
|
||||
@TableField("Creator")
|
||||
private String Creator;
|
||||
|
||||
/**
|
||||
* 仿真模型更新者
|
||||
*/
|
||||
@TableField("Modifier")
|
||||
private String Modifier;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField("CreateTime")
|
||||
private Date CreateTime;
|
||||
|
||||
/**
|
||||
* 最近更新时间
|
||||
*/
|
||||
@TableField("LastUpdateTime")
|
||||
private Date LastUpdateTime;
|
||||
}
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
package com.sdm.project.model.entity.YA;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@TableName("SimulationReport")
|
||||
@Data
|
||||
public class SimulationReport implements Serializable {
|
||||
|
||||
@@ -14,65 +16,78 @@ public class SimulationReport implements Serializable {
|
||||
/**
|
||||
* 仿真报告内部ID
|
||||
*/
|
||||
@TableField("ID")
|
||||
private String ID;
|
||||
|
||||
/**
|
||||
* 仿真报告外部编码
|
||||
*/
|
||||
@TableField("Number")
|
||||
private String Number;
|
||||
|
||||
/**
|
||||
* 关联文档对象编码
|
||||
*/
|
||||
@TableField("Document")
|
||||
private String Document;
|
||||
|
||||
/**
|
||||
* 关联文档模版对象编码
|
||||
*/
|
||||
@TableField("DocTemplate")
|
||||
private String DocTemplate;
|
||||
|
||||
/**
|
||||
* 作业任务
|
||||
*/
|
||||
@TableField("SimulationJob")
|
||||
private String SimulationJob;
|
||||
|
||||
/**
|
||||
* 仿真报告文件
|
||||
*/
|
||||
@TableField("File")
|
||||
private String File;
|
||||
|
||||
/**
|
||||
* 仿真场景
|
||||
*/
|
||||
@TableField("SimulationEdition")
|
||||
private String SimulationEdition;
|
||||
|
||||
/**
|
||||
* 仿真结果
|
||||
*/
|
||||
@TableField("SimulationResult")
|
||||
private String SimulationResult;
|
||||
|
||||
/**
|
||||
* 仿真模型所有者
|
||||
*/
|
||||
@TableField("Owner")
|
||||
private String Owner;
|
||||
|
||||
/**
|
||||
* 仿真模型创建者
|
||||
*/
|
||||
@TableField("Creator")
|
||||
private String Creator;
|
||||
|
||||
/**
|
||||
* 仿真模型更新者
|
||||
*/
|
||||
@TableField("Modifier")
|
||||
private String Modifier;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField("CreateTime")
|
||||
private Date CreateTime;
|
||||
|
||||
/**
|
||||
* 最近更新时间
|
||||
*/
|
||||
@TableField("LastUpdateTime")
|
||||
private Date LastUpdateTime;
|
||||
}
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
package com.sdm.project.model.entity.YA;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@TableName("SimulationWorkTask")
|
||||
@Data
|
||||
public class SimulationWorkTask implements Serializable {
|
||||
|
||||
@@ -13,105 +15,126 @@ public class SimulationWorkTask implements Serializable {
|
||||
/**
|
||||
* 活动对象内部编号
|
||||
*/
|
||||
@TableField("ID")
|
||||
private String ID;
|
||||
|
||||
/**
|
||||
* 活动对象编码
|
||||
*/
|
||||
@TableField("Number")
|
||||
private String Number;
|
||||
|
||||
/**
|
||||
* 活动对象名称
|
||||
*/
|
||||
@TableField("Name")
|
||||
private String Name;
|
||||
|
||||
/**
|
||||
* 描述信息
|
||||
*/
|
||||
@TableField("Description")
|
||||
private String Description;
|
||||
|
||||
/**
|
||||
* 所属规划
|
||||
*/
|
||||
@TableField("Project")
|
||||
private String Project;
|
||||
|
||||
/**
|
||||
* 所属方案
|
||||
*/
|
||||
@TableField("Edition")
|
||||
private String Edition;
|
||||
|
||||
/**
|
||||
* 所属父节点
|
||||
*/
|
||||
@TableField("Parent")
|
||||
private String Parent;
|
||||
|
||||
/**
|
||||
* 关联仿真流程实例
|
||||
*/
|
||||
@TableField("WorkProcess")
|
||||
private String WorkProcess;
|
||||
|
||||
/**
|
||||
* 关联分析项
|
||||
*/
|
||||
@TableField("Scenario")
|
||||
private String Scenario;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
@TableField("StartAt")
|
||||
private Date StartAt;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
@TableField("EndAt")
|
||||
private Date EndAt;
|
||||
|
||||
/**
|
||||
* 计划开始时间
|
||||
*/
|
||||
@TableField("PlanStartAt")
|
||||
private Date PlanStartAt;
|
||||
|
||||
/**
|
||||
* 计划结束时间
|
||||
*/
|
||||
@TableField("PlanEndAt")
|
||||
private Date PlanEndAt;
|
||||
|
||||
/**
|
||||
* 数据访问控制级别
|
||||
*/
|
||||
@TableField("LevelType")
|
||||
private Byte LevelType;
|
||||
|
||||
/**
|
||||
* 可用状态
|
||||
*/
|
||||
@TableField("StatusType")
|
||||
private Byte StatusType;
|
||||
|
||||
/**
|
||||
* 修订版本
|
||||
*/
|
||||
@TableField("Version")
|
||||
private String Version;
|
||||
|
||||
/**
|
||||
* 所有者
|
||||
*/
|
||||
@TableField("Owner")
|
||||
private String Owner;
|
||||
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
@TableField("Creator")
|
||||
private String Creator;
|
||||
|
||||
/**
|
||||
* 更新者
|
||||
*/
|
||||
@TableField("Modifier")
|
||||
private String Modifier;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField("CreateTime")
|
||||
private Date CreateTime;
|
||||
|
||||
/**
|
||||
* 最近修改时间
|
||||
*/
|
||||
@TableField("LastUpdateTime")
|
||||
private Date LastUpdateTime;
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ import com.sdm.system.model.bo.FormConfigure;
|
||||
import com.sdm.system.model.entity.SysDataDictionary;
|
||||
import com.sdm.system.model.entity.SysDictionaryClass;
|
||||
import com.sdm.system.model.entity.SysFormConfigure;
|
||||
import com.sdm.system.model.entity.SystemParamConfigBean;
|
||||
import com.sdm.system.model.req.system.FormConfigureReq;
|
||||
import com.sdm.system.model.resp.SimuDictionaryResp;
|
||||
import com.sdm.system.service.IDataDictionaryService;
|
||||
@@ -346,5 +347,40 @@ public class SimulationSystemConfigController implements ISysConfigFeignClient {
|
||||
{
|
||||
return service.updateUserFormConfigure(configure);
|
||||
}
|
||||
|
||||
@PostMapping(value = "/addSystemParamConfigure")
|
||||
@ResponseBody
|
||||
SdmResponse addSystemParam(@RequestBody SystemParamConfigBean systemParamConfigBean)
|
||||
{
|
||||
return service.addSystemParamConfig(systemParamConfigBean);
|
||||
}
|
||||
|
||||
@PostMapping(value = "/updateSystemParamConfigure")
|
||||
@ResponseBody
|
||||
SdmResponse updateSystemParam(@RequestBody SystemParamConfigBean systemParamConfigBean)
|
||||
{
|
||||
return service.updateSystemParamConfig(systemParamConfigBean);
|
||||
}
|
||||
|
||||
@GetMapping(value = "/deleteSystemParamConfigure")
|
||||
@ResponseBody
|
||||
SdmResponse deleteSystemParam(@RequestParam("paramName") String paramName)
|
||||
{
|
||||
return service.deleteSystemParamConfig(paramName);
|
||||
}
|
||||
|
||||
@GetMapping(value = "/querySystemParamConfigure")
|
||||
@ResponseBody
|
||||
SdmResponse querySystemParam(@RequestParam("paramName") String paramName)
|
||||
{
|
||||
return service.querySystemParamConfig(paramName);
|
||||
}
|
||||
|
||||
@GetMapping(value = "/querySystemAllParamConfigure")
|
||||
@ResponseBody
|
||||
SdmResponse querySystemAllParam()
|
||||
{
|
||||
return service.querySystemAllParamConfig();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.sdm.common.entity.req.system.DictTagReq;
|
||||
import com.sdm.system.model.bo.DictionaryClass;
|
||||
import com.sdm.system.model.bo.FormConfigure;
|
||||
import com.sdm.system.model.entity.SimulationApproveFlowMapBean;
|
||||
import com.sdm.system.model.entity.SystemParamConfigBean;
|
||||
import org.apache.ibatis.annotations.*;
|
||||
|
||||
import java.util.List;
|
||||
@@ -85,4 +86,17 @@ public interface SimulationSystemMapper {
|
||||
" ORDER BY dictName, dictValue" +
|
||||
"</script>")
|
||||
List<DataDictionary> batchQueryDictionaryIds(@Param("tenantId") long tenantId, @Param("items") List<DictTagReq> items);
|
||||
|
||||
@Insert("INSERT INTO system_param_config(paramName,paramValue,tenantId,creator) VALUES (#{configBean.paramName},#{configBean.paramValue},#{configBean.tenantId},#{configBean.creator})")
|
||||
int addSystemParamConfig(@Param("configBean") SystemParamConfigBean configBean);
|
||||
|
||||
@Delete("DELETE FROM system_param_config WHERE paramName=#{paramName} AND tenantId=#{tenantId}")
|
||||
int deleteSystemParamConfig(@Param("paramName")String paramName,@Param("tenantId")long tenantId);
|
||||
|
||||
@Select("SELECT * FROM system_param_config WHERE paramName=#{paramName} AND tenantId=#{tenantId}")
|
||||
List<SystemParamConfigBean> querySystemParamConfig(@Param("paramName")String paramName,@Param("tenantId") long tenantId);
|
||||
|
||||
@Select("SELECT * FROM system_param_config WHERE tenantId=#{tenantId}")
|
||||
List<SystemParamConfigBean> querySystemAllParamConfig(@Param("tenantId") long tenantId);
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.sdm.system.model.entity;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class SystemParamConfigBean {
|
||||
|
||||
public Long id;
|
||||
|
||||
public String paramName;
|
||||
|
||||
public String paramValue;
|
||||
|
||||
public List<String> values = new ArrayList<>();
|
||||
|
||||
public Long tenantId;
|
||||
|
||||
public Long creator;
|
||||
|
||||
public String createTime;
|
||||
}
|
||||
@@ -5,6 +5,7 @@ import com.sdm.common.entity.bo.DataDictionary;
|
||||
import com.sdm.common.entity.req.system.DictTagReq;
|
||||
import com.sdm.system.model.bo.DictionaryClass;
|
||||
import com.sdm.system.model.bo.FormConfigure;
|
||||
import com.sdm.system.model.entity.SystemParamConfigBean;
|
||||
import com.sdm.system.model.req.system.FormConfigureReq;
|
||||
import com.sdm.system.model.resp.SimuDictionaryResp;
|
||||
|
||||
@@ -56,4 +57,14 @@ public interface ISimulationSystemConfigService {
|
||||
|
||||
SdmResponse<Map<String, Map<String, Integer>>> batchQueryDictionaryIds(DictTagReq.BatchDictIdQueryReq req);
|
||||
|
||||
SdmResponse addSystemParamConfig(SystemParamConfigBean configBean);
|
||||
|
||||
SdmResponse updateSystemParamConfig(SystemParamConfigBean configBean);
|
||||
|
||||
SdmResponse deleteSystemParamConfig(String paramName);
|
||||
|
||||
SdmResponse querySystemParamConfig(String paramName);
|
||||
|
||||
SdmResponse querySystemAllParamConfig();
|
||||
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@ import com.sdm.system.model.bo.DictionaryClass;
|
||||
import com.sdm.system.model.bo.FormConfigure;
|
||||
import com.sdm.system.model.entity.SysFormConfigure;
|
||||
import com.sdm.system.model.entity.SysFormUserConfigure;
|
||||
import com.sdm.system.model.entity.SystemParamConfigBean;
|
||||
import com.sdm.system.model.req.system.FormConfigureReq;
|
||||
import com.sdm.system.model.resp.SimuDictionaryResp;
|
||||
import com.sdm.system.service.IFormConfigureService;
|
||||
@@ -572,6 +573,125 @@ public class SimulationSystemConfigServiceImpl extends BaseService implements IS
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加系统参数配置
|
||||
* @param configBean
|
||||
* @return
|
||||
*/
|
||||
public SdmResponse addSystemParamConfig(SystemParamConfigBean configBean)
|
||||
{
|
||||
String paramName = configBean.paramName;
|
||||
long tenantId = ThreadLocalContext.getTenantId();
|
||||
long creator = ThreadLocalContext.getUserId();
|
||||
SdmResponse response = SdmResponse.success();
|
||||
List<SystemParamConfigBean> paramBeans = mapper.querySystemParamConfig(paramName,tenantId);
|
||||
if(!paramBeans.isEmpty())
|
||||
{
|
||||
response = SdmResponse.success("系统参数已存在");
|
||||
}
|
||||
else
|
||||
{
|
||||
for(String paramValue : configBean.values)
|
||||
{
|
||||
SystemParamConfigBean bean = new SystemParamConfigBean();
|
||||
bean.paramName = paramName;
|
||||
bean.tenantId = tenantId;
|
||||
bean.creator = creator;
|
||||
bean.paramValue = paramValue;
|
||||
if(mapper.addSystemParamConfig(bean) <= 0)
|
||||
{
|
||||
response = SdmResponse.failed("添加系统参数失败");
|
||||
mapper.deleteSystemParamConfig(paramName,tenantId);
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改系统参数配置
|
||||
* @param configBean
|
||||
* @return
|
||||
*/
|
||||
public SdmResponse updateSystemParamConfig(SystemParamConfigBean configBean)
|
||||
{
|
||||
long tenantId = ThreadLocalContext.getTenantId();
|
||||
mapper.deleteSystemParamConfig(configBean.paramName,tenantId);
|
||||
return addSystemParamConfig(configBean);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除系统参数配置
|
||||
* @param paramName
|
||||
* @return
|
||||
*/
|
||||
public SdmResponse deleteSystemParamConfig(String paramName)
|
||||
{
|
||||
SdmResponse response = SdmResponse.success();
|
||||
long tenantId = ThreadLocalContext.getTenantId();
|
||||
if(mapper.deleteSystemParamConfig(paramName,tenantId) < 0)
|
||||
{
|
||||
response = SdmResponse.failed("删除系统配置失败");
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询系统参数配置
|
||||
* @param paramName
|
||||
* @return
|
||||
*/
|
||||
public SdmResponse querySystemParamConfig(String paramName)
|
||||
{
|
||||
long tenantId = ThreadLocalContext.getTenantId();
|
||||
List<SystemParamConfigBean> paramBeans = mapper.querySystemParamConfig(paramName,tenantId);
|
||||
SystemParamConfigBean bean = new SystemParamConfigBean();
|
||||
bean.paramName = paramName;
|
||||
bean.tenantId = tenantId;
|
||||
for(SystemParamConfigBean paramBean : paramBeans)
|
||||
{
|
||||
bean.values.add(paramBean.paramValue);
|
||||
bean.creator = paramBean.creator;
|
||||
bean.createTime = paramBean.createTime;
|
||||
}
|
||||
return SdmResponse.success(bean);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询所有的系统参数配置
|
||||
* @return
|
||||
*/
|
||||
public SdmResponse querySystemAllParamConfig()
|
||||
{
|
||||
long tenantId = ThreadLocalContext.getTenantId();
|
||||
List<SystemParamConfigBean> paramBeans = mapper.querySystemAllParamConfig(tenantId);
|
||||
Map<String,List<SystemParamConfigBean>> paramMap = new HashMap<>();
|
||||
for(SystemParamConfigBean bean : paramBeans)
|
||||
{
|
||||
List<SystemParamConfigBean> configBeans = paramMap.computeIfAbsent(bean.paramName, k -> new ArrayList<>());
|
||||
configBeans.add(bean);
|
||||
}
|
||||
List<SystemParamConfigBean> allParams = new ArrayList<>();
|
||||
for(String paramName : paramMap.keySet())
|
||||
{
|
||||
List<SystemParamConfigBean> configBeans = paramMap.get(paramName);
|
||||
SystemParamConfigBean bean = new SystemParamConfigBean();
|
||||
bean.paramName = paramName;
|
||||
bean.tenantId = tenantId;
|
||||
for(SystemParamConfigBean configBean : configBeans)
|
||||
{
|
||||
bean.values.add(configBean.paramValue);
|
||||
bean.creator = configBean.creator;
|
||||
bean.createTime = configBean.createTime;
|
||||
}
|
||||
allParams.add(bean);
|
||||
}
|
||||
return SdmResponse.success(allParams);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user