Commit baacc4b1 authored by 莫林毅's avatar 莫林毅

预分析与建模->数据模型管理 ->模型维护 功能 增加 ‘数据编码’字段[! 后台代码代码 不完全改动]

parent 66b8c680
...@@ -28,6 +28,8 @@ public class ModelParameter implements Serializable{ ...@@ -28,6 +28,8 @@ public class ModelParameter implements Serializable{
private Long taskId;//任务表ID private Long taskId;//任务表ID
private Long ifSystemDefault;//是否系统默认 private Long ifSystemDefault;//是否系统默认
private String parameterCode; /// 参数编码 by molinyi
@Id @Id
@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="ModelParameterSequence") @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="ModelParameterSequence")
@SequenceGenerator(name = "ModelParameterSequence", sequenceName = "fxjm_model_parameter_info_t_seq", allocationSize=1) @SequenceGenerator(name = "ModelParameterSequence", sequenceName = "fxjm_model_parameter_info_t_seq", allocationSize=1)
...@@ -73,4 +75,12 @@ public class ModelParameter implements Serializable{ ...@@ -73,4 +75,12 @@ public class ModelParameter implements Serializable{
public void setIfSystemDefault(Long ifSystemDefault) { public void setIfSystemDefault(Long ifSystemDefault) {
this.ifSystemDefault = ifSystemDefault; this.ifSystemDefault = ifSystemDefault;
} }
public String getParameterCode() {
return parameterCode;
}
public void setParameterCode(String parameterCode) {
this.parameterCode = parameterCode;
}
} }
...@@ -27,6 +27,11 @@ public interface ModelParameterDao extends JpaSpecificationExecutor<ModelParamet ...@@ -27,6 +27,11 @@ public interface ModelParameterDao extends JpaSpecificationExecutor<ModelParamet
@Modifying @Modifying
@Query("update ModelParameter mp set mp.parameterName=:parameterName,mp.parameterValue=:parameterValue, mp.parameterDataType=:parameterDataType where mp.parameterId =:parameterId") @Query("update ModelParameter mp set mp.parameterName=:parameterName,mp.parameterValue=:parameterValue, mp.parameterDataType=:parameterDataType where mp.parameterId =:parameterId")
void updateParamByParameterId(@Param("parameterName")String parameterName,@Param("parameterValue")String parameterValue,@Param("parameterDataType")String parameterDataType,@Param("parameterId")Long parameterId); void updateParamByParameterId(@Param("parameterName")String parameterName,@Param("parameterValue")String parameterValue,@Param("parameterDataType")String parameterDataType,@Param("parameterId")Long parameterId);
//根据参数ID更新参数信息 by molinyi
@Modifying
@Query("update ModelParameter mp set mp.parameterName=:parameterName,mp.parameterCode=:parameterCode,mp.parameterValue=:parameterValue, mp.parameterDataType=:parameterDataType where mp.parameterId =:parameterId")
void updateParamByParameterId(@Param("parameterName")String parameterName,@Param("parameterCode")String parameterCode,@Param("parameterValue")String parameterValue,@Param("parameterDataType")String parameterDataType,@Param("parameterId")Long parameterId);
//根据数据模型ID查找参数d //根据数据模型ID查找参数d
List<ModelParameter> findByDataModelId(Long dataModelId); List<ModelParameter> findByDataModelId(Long dataModelId);
......
...@@ -30,6 +30,11 @@ public class ModelParameterService { ...@@ -30,6 +30,11 @@ public class ModelParameterService {
public void updateParameterByParameterId(String parameterName,String parameterValue,String parameterDataType,Long parameterId){ public void updateParameterByParameterId(String parameterName,String parameterValue,String parameterDataType,Long parameterId){
modelParameterDao.updateParamByParameterId(parameterName, parameterValue, parameterDataType, parameterId); modelParameterDao.updateParamByParameterId(parameterName, parameterValue, parameterDataType, parameterId);
} }
//根据参数ID更新参数
@Transactional(readOnly=false)
public void updateParameterByParameterId(String parameterName,String parameterCode,String parameterValue,String parameterDataType,Long parameterId){
modelParameterDao.updateParamByParameterId(parameterName, parameterCode,parameterValue, parameterDataType, parameterId);
}
//根据参数ID删除一条参数信息 //根据参数ID删除一条参数信息
@Transactional(readOnly=false) @Transactional(readOnly=false)
......
...@@ -158,7 +158,33 @@ public class ModelParameterConfigurationController { ...@@ -158,7 +158,33 @@ public class ModelParameterConfigurationController {
} }
} }
//修改参数信息 by molinyi
@RequestMapping(value = "/UpdateParameter",method=RequestMethod.GET)
@ResponseBody
public void updateParameters(
@RequestParam(value="paramName",defaultValue="") String paramName,
@RequestParam(value="paramCode",defaultValue="") String paramCode,
@RequestParam(value="paramValue",defaultValue="") String paramValue,
@RequestParam(value="paramType",defaultValue="") String paramType,
@RequestParam(value="paramId",defaultValue="") String paramId,
@RequestParam(value="dataModelId",defaultValue="") String dataModelId){
if(paramId.trim().equals("")){
ModelParameter modelParameter = new ModelParameter();
modelParameter.setDataModelId(Long.parseLong(dataModelId));
modelParameter.setParameterName(paramName);
modelParameter.setParameterCode(paramCode);
modelParameter.setParameterValue(paramValue);
modelParameter.setParameterDataType(paramType);
modelParameterDao.save(modelParameter);
}else{
// modelParameterService.updateParameterByParameterId(paramName, paramValue, paramType, Long.parseLong(paramId.split(":")[1]));
modelParameterService.updateParameterByParameterId(paramName,paramCode, paramValue, paramType, Long.parseLong(paramId.split(":")[1]));
}
}
//修改数据模型 //修改数据模型
@RequestMapping(value = "/updateDataModelForm",method=RequestMethod.POST) @RequestMapping(value = "/updateDataModelForm",method=RequestMethod.POST)
public String updateDataModelForm(HttpServletResponse response,HttpServletRequest request) throws NumberFormatException, ParseException{ public String updateDataModelForm(HttpServletResponse response,HttpServletRequest request) throws NumberFormatException, ParseException{
......
...@@ -264,7 +264,7 @@ ...@@ -264,7 +264,7 @@
$.dialog({ $.dialog({
title:"数据模型标题:"+dataModelTitle, title:"数据模型标题:"+dataModelTitle,
content:"<div id='paramList'>"+ content:"<div id='paramList'>"+
"<div class='col-xs-12'><div class='panel panel-default'><div class='panel-heading'>参数列表</div><div class='panel-body'> <table class='table table-hover table-striped'> <thead> <tr> <th width='20%'>参数ID号</th> <th width='35%'>参数名</th> <th width='20%'>参数值</th> <th width='25%'>参数类型</th> </tr> </thead> <tbody> </tbody> </table> </div> </div> </div>"+ "<div class='col-xs-12'><div class='panel panel-default'><div class='panel-heading'>参数列表</div><div class='panel-body'> <table class='table table-hover table-striped' width='300'> <thead> <tr> <th width='15%'>参数ID号</th> <th width='35%'>参数名</th><th width='35%'>参数编码</th> <th width='20%'>参数值</th> <th width='25%'>参数类型</th> </tr> </thead> <tbody> </tbody> </table> </div> </div> </div>"+
"</div>", "</div>",
lock:true, lock:true,
width:800, width:800,
...@@ -290,6 +290,7 @@ ...@@ -290,6 +290,7 @@
data[i].parameterValue=""; data[i].parameterValue="";
} }
paramTbody.append($("<tr></tr>").append("<td>"+data[i].parameterId+"</td>") paramTbody.append($("<tr></tr>").append("<td>"+data[i].parameterId+"</td>")
.append("<td>"+data[i].parameterCode+"</td>")
.append("<td>"+data[i].parameterName+"</td>") .append("<td>"+data[i].parameterName+"</td>")
.append("<td>"+data[i].parameterValue+"</td>") .append("<td>"+data[i].parameterValue+"</td>")
.append("<td>"+data[i].parameterDataType+"</td>")); .append("<td>"+data[i].parameterDataType+"</td>"));
......
...@@ -570,7 +570,7 @@ table_pagging.prototype = { ...@@ -570,7 +570,7 @@ table_pagging.prototype = {
} }
function radioChoose(clickObj){ function radioChoose(clickObj){
alert();
var obj = eval("(" + jsonData + ")"); var obj = eval("(" + jsonData + ")");
//alert(obj); //alert(obj);
if(clickObj.checked){ if(clickObj.checked){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment