工位管理-参数设置动态展示

dep_wangsr
Limy 4 years ago
parent f8d79370f9
commit 1f7ed1b0b3

@ -6,6 +6,7 @@ import java.util.List;
import java.util.Map;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.framework.util.ShiroUtils;
import com.ruoyi.nanjing.domain.TBdLinetype;
import com.ruoyi.nanjing.domain.TBdProductinfo;
import com.ruoyi.nanjing.domain.TBdStationtype;
@ -29,6 +30,8 @@ import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
import javax.servlet.http.HttpServletRequest;
/**
* Controller
*
@ -119,14 +122,14 @@ public class TBdSubstationController extends BaseController
@ResponseBody
public AjaxResult addSave(TBdSubstation tBdSubstation)
{
int result = tBdSubstationService.insertTBdSubstation(tBdSubstation);
if (result>0){
Map map = new HashMap<String,Object>();
map.put("tableName",tBdSubstation.getTableName());
map.put("ParaAmount",tBdSubstation.getParaCount());
tBdSubstationService.createTable(map);
}
return toAjax(result);
tBdSubstation.setUniteID(0L);
tBdSubstation.setUserID(ShiroUtils.getUserId().toString());
return toAjax(tBdSubstationService.insertTBdSubstation(tBdSubstation));
}
/**
@ -144,6 +147,14 @@ public class TBdSubstationController extends BaseController
return prefix + "/edit";
}
@GetMapping("/editParam/{ID}")
public String editParam(@PathVariable("ID") Long ID,ModelMap modelMap)
{
TBdSubstation tBdSubstation = tBdSubstationService.selectTBdSubstationById(ID);
modelMap.put("tBdSubstation", tBdSubstation);
return prefix + "/editParam";
}
/**
*
*/
@ -154,15 +165,12 @@ public class TBdSubstationController extends BaseController
public AjaxResult editSave(TBdSubstation tBdSubstation)
{
tBdSubstation.setUpdateTime(new Date());
int result = tBdSubstationService.updateTBdSubstation(tBdSubstation);
if(result>0){
Map map = new HashMap<String,Object>();
map.put("paraCount",tBdSubstation.getParaCount());
map.put("tableName",tBdSubstation.getTableName());
map.put("stationID",tBdSubstation.getStationID());
tBdSubstationService.updateTable(map);
}
return toAjax(result);
return toAjax(tBdSubstationService.updateTBdSubstation(tBdSubstation));
}
/**
@ -174,12 +182,11 @@ public class TBdSubstationController extends BaseController
@ResponseBody
public AjaxResult remove(String ids)
{
int result = tBdSubstationService.deleteTBdSubstationByIds(ids);
if(result>0){
TBdSubstation substation = tBdSubstationService.selectTBdSubstationById(Convert.toLong(ids));
Map map = new HashMap<String,Object>();
map.put("stationID",ids);
map.put("stationID",substation.getStationID());
tBdSubstationService.deletePara(map);
}
return toAjax(result);
// tBdSubstationService.deleteTBdSubstationByIds(ids)
return toAjax(1);
}
}

@ -0,0 +1,153 @@
package com.ruoyi.web.controller.nanjing;
import java.util.List;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.nanjing.domain.TSyStationparameternotes;
import com.ruoyi.nanjing.service.ITSyStationparameternotesService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
import javax.servlet.http.HttpServletRequest;
/**
* Controller
*
* @author limy
* @date 2021-01-27
*/
@Controller
@RequestMapping("/nanjing/StationParameterNotes")
public class TSyStationparameternotesController extends BaseController
{
private String prefix = "nanjing/StationParameterNotes";
@Autowired
private ITSyStationparameternotesService tSyStationparameternotesService;
@RequiresPermissions("nanjing:StationParameterNotes:view")
@GetMapping()
public String StationParameterNotes()
{
return prefix + "/StationParameterNotes";
}
/**
*
*/
@RequiresPermissions("nanjing:StationParameterNotes:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(TSyStationparameternotes tSyStationparameternotes)
{
startPage();
List<TSyStationparameternotes> list = tSyStationparameternotesService.selectTSyStationparameternotesList(tSyStationparameternotes);
return getDataTable(list);
}
/**
*
*/
@RequiresPermissions("nanjing:StationParameterNotes:export")
@Log(title = "工位参数定义", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(TSyStationparameternotes tSyStationparameternotes)
{
List<TSyStationparameternotes> list = tSyStationparameternotesService.selectTSyStationparameternotesList(tSyStationparameternotes);
ExcelUtil<TSyStationparameternotes> util = new ExcelUtil<TSyStationparameternotes>(TSyStationparameternotes.class);
return util.exportExcel(list, "StationParameterNotes");
}
/**
*
*/
@GetMapping("/add")
public String add()
{
return prefix + "/add";
}
/**
*
*/
@RequiresPermissions("nanjing:StationParameterNotes:add")
@Log(title = "工位参数定义", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(TSyStationparameternotes tSyStationparameternotes)
{
return toAjax(tSyStationparameternotesService.insertTSyStationparameternotes(tSyStationparameternotes));
}
/**
*
*/
@GetMapping("/edit/{id}")
public String edit(@PathVariable("id") Long id, ModelMap mmap)
{
TSyStationparameternotes tSyStationparameternotes = tSyStationparameternotesService.selectTSyStationparameternotesById(id);
mmap.put("tSyStationparameternotes", tSyStationparameternotes);
return prefix + "/edit";
}
/**
*
*/
@RequiresPermissions("nanjing:StationParameterNotes:edit")
@Log(title = "工位参数定义", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(TSyStationparameternotes tSyStationparameternotes)
{
return toAjax(tSyStationparameternotesService.updateTSyStationparameternotes(tSyStationparameternotes));
}
/**
*
*/
@RequiresPermissions("nanjing:StationParameterNotes:remove")
@Log(title = "工位参数定义", businessType = BusinessType.DELETE)
@PostMapping( "/remove")
@ResponseBody
public AjaxResult remove(String ids)
{
return toAjax(tSyStationparameternotesService.deleteTSyStationparameternotesByIds(ids));
}
@RequiresPermissions("nanjing:SubStation:param")
@PostMapping("/getParamData")
@ResponseBody
public AjaxResult getParamData(HttpServletRequest request){
String paraMean="";
String stationID = request.getParameter("stationID");
String para = request.getParameter("para");
List<TSyStationparameternotes> tSyStationparameternotes = tSyStationparameternotesService.selectByStationID(stationID);
for (TSyStationparameternotes sp:tSyStationparameternotes)
{
if(sp.getParaColumn().equals(para)){
paraMean = sp.getParaMeaning();
break;
}
else {
paraMean="";
}
}
// TSyStationparameternotes tSyStationparameternotes = tSyStationparameternotesService.getParaVal(stationID,para);
// if(tSyStationparameternotes.getParaMeaning().equals("")||tSyStationparameternotes.getParaMeaning()==null){
// return AjaxResult.error(" ");
// }
return AjaxResult.success(paraMean);
}
}

@ -1053,6 +1053,34 @@ var table = {
$.modal.open("修改" + table.options.modalName, $.operate.editUrl(id));
}
},
editParameter:function(id){
table.set();
if($.common.isEmpty(id) && table.options.type == table_type.bootstrapTreeTable) {
var row = $("#" + table.options.id).bootstrapTreeTable('getSelections')[0];
if ($.common.isEmpty(row)) {
$.modal.alertWarning("请至少选择一条记录");
return;
}
var url = table.options.editParamUrl.replace("{id}", row[table.options.uniqueId]);
$.modal.open("修改" + table.options.modalName, url);
} else {
$.modal.open("修改" + table.options.modalName, $.operate.paramUrl(id));
}
},
paramUrl: function(id) {
var url = "/404.html";
if ($.common.isNotEmpty(id)) {
url = table.options.editParamUrl.replace("{id}", id);
} else {
var id = $.common.isEmpty(table.options.uniqueId) ? $.table.selectFirstColumns() : $.table.selectColumns(table.options.uniqueId);
if (id.length == 0) {
$.modal.alertWarning("请至少选择一条记录");
return;
}
url = table.options.editParamUrl.replace("{id}", id);
}
return url;
},
// 修改信息以tab页展现
editTab: function(id) {
table.set();

@ -22,39 +22,6 @@
<input name="PersonInCharge" class="form-control" type="text">
</div>
</div>
<!-- <div class="form-group"> -->
<!-- <label class="col-sm-3 control-label">开始时间:</label>-->
<!-- <div class="col-sm-8">-->
<!-- <div class="input-group date">-->
<!-- <input name="BeginTime" class="form-control" placeholder="yyyy-MM-dd" type="text">-->
<!-- <span class="input-group-addon"><i class="fa fa-calendar"></i></span>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="form-group"> -->
<!-- <label class="col-sm-3 control-label">结束时间:</label>-->
<!-- <div class="col-sm-8">-->
<!-- <div class="input-group date">-->
<!-- <input name="EndTime" class="form-control" placeholder="yyyy-MM-dd" type="text">-->
<!-- <span class="input-group-addon"><i class="fa fa-calendar"></i></span>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="form-group"> -->
<!-- <label class="col-sm-3 control-label">操作员:</label>-->
<!-- <div class="col-sm-8">-->
<!-- <input name="Operator" class="form-control" type="text">-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="form-group"> -->
<!-- <label class="col-sm-3 control-label">插入时间:</label>-->
<!-- <div class="col-sm-8">-->
<!-- <div class="input-group date">-->
<!-- <input name="InsertTime" class="form-control" placeholder="yyyy-MM-dd" type="text">-->
<!-- <span class="input-group-addon"><i class="fa fa-calendar"></i></span>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
</form>
</div>
<th:block th:include="include :: footer" />

@ -0,0 +1,150 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('工位参数定义列表')" />
</head>
<body class="gray-bg">
<div class="container-div">
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="formId">
<div class="select-list">
<ul>
<li>
<label>表名:</label>
<input type="text" name="tabelName"/>
</li>
<li>
<label>参数名:</label>
<input type="text" name="paraColumn"/>
</li>
<li>
<label>参数值:</label>
<input type="text" name="paraMeaning"/>
</li>
<li>
<label>工位ID</label>
<input type="text" name="stationID"/>
</li>
<li>
<label>工位码:</label>
<input type="text" name="stationCode"/>
</li>
<li>
<label>父工位ID</label>
<input type="text" name="parentStationID"/>
</li>
<li>
<label>父工位码:</label>
<input type="text" name="parentStationCode"/>
</li>
<li>
<label>父工位名:</label>
<input type="text" name="parentStationName"/>
</li>
<li>
<label>是否显示:</label>
<input type="text" name="usedFlag"/>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="nanjing:StationParameterNotes:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="nanjing:StationParameterNotes:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="nanjing:StationParameterNotes:remove">
<i class="fa fa-remove"></i> 删除
</a>
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="nanjing:StationParameterNotes:export">
<i class="fa fa-download"></i> 导出
</a>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('nanjing:StationParameterNotes:edit')}]];
var removeFlag = [[${@permission.hasPermi('nanjing:StationParameterNotes:remove')}]];
var prefix = ctx + "nanjing/StationParameterNotes";
$(function() {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
modalName: "工位参数定义",
columns: [{
checkbox: true
},
{
field: 'id',
title: 'id',
visible: false
},
{
field: 'tabelName',
title: '表名'
},
{
field: 'paraColumn',
title: '参数名'
},
{
field: 'paraMeaning',
title: '参数值'
},
{
field: 'stationID',
title: '工位ID'
},
{
field: 'stationCode',
title: '工位码'
},
{
field: 'parentStationID',
title: '父工位ID'
},
{
field: 'parentStationCode',
title: '父工位码'
},
{
field: 'parentStationName',
title: '父工位名'
},
{
field: 'usedFlag',
title: '是否显示'
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
return actions.join('');
}
}]
};
$.table.init(options);
});
</script>
</body>
</html>

@ -0,0 +1,79 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('新增工位参数定义')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-StationParameterNotes-add">
<div class="form-group">
<label class="col-sm-3 control-label">表名:</label>
<div class="col-sm-8">
<input name="tabelName" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">参数名:</label>
<div class="col-sm-8">
<input name="paraColumn" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">参数值:</label>
<div class="col-sm-8">
<input name="paraMeaning" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">工位ID</label>
<div class="col-sm-8">
<input name="stationID" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">工位码:</label>
<div class="col-sm-8">
<input name="stationCode" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">父工位ID</label>
<div class="col-sm-8">
<input name="parentStationID" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">父工位码:</label>
<div class="col-sm-8">
<input name="parentStationCode" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">父工位名:</label>
<div class="col-sm-8">
<input name="parentStationName" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">是否显示:</label>
<div class="col-sm-8">
<input name="usedFlag" class="form-control" type="text">
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var prefix = ctx + "nanjing/StationParameterNotes"
$("#form-StationParameterNotes-add").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-StationParameterNotes-add').serialize());
}
}
</script>
</body>
</html>

@ -0,0 +1,80 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('修改工位参数定义')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-StationParameterNotes-edit" th:object="${tSyStationparameternotes}">
<input name="id" th:field="*{id}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">表名:</label>
<div class="col-sm-8">
<input name="tabelName" th:field="*{tabelName}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">参数名:</label>
<div class="col-sm-8">
<input name="paraColumn" th:field="*{paraColumn}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">参数值:</label>
<div class="col-sm-8">
<input name="paraMeaning" th:field="*{paraMeaning}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">工位ID</label>
<div class="col-sm-8">
<input name="stationID" th:field="*{stationID}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">工位码:</label>
<div class="col-sm-8">
<input name="stationCode" th:field="*{stationCode}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">父工位ID</label>
<div class="col-sm-8">
<input name="parentStationID" th:field="*{parentStationID}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">父工位码:</label>
<div class="col-sm-8">
<input name="parentStationCode" th:field="*{parentStationCode}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">父工位名:</label>
<div class="col-sm-8">
<input name="parentStationName" th:field="*{parentStationName}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">是否显示:</label>
<div class="col-sm-8">
<input name="usedFlag" th:field="*{usedFlag}" class="form-control" type="text">
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var prefix = ctx + "nanjing/StationParameterNotes";
$("#form-StationParameterNotes-edit").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-StationParameterNotes-edit').serialize());
}
}
</script>
</body>
</html>

@ -52,6 +52,7 @@
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('nanjing:SubStation:edit')}]];
var removeFlag = [[${@permission.hasPermi('nanjing:SubStation:remove')}]];
var paramFlag = [[${@permission.hasPermi('nanjing:SubStation:param')}]];
var prefix = ctx + "nanjing/SubStation";
$(function() {
@ -61,6 +62,7 @@
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
editParamUrl:prefix+"/editParam/{id}",
modalName: "工位管理",
columns: [
{
@ -93,13 +95,20 @@
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>修改</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a> ');
actions.push('<a class="btn btn-info btn-xs ' + paramFlag + '" href="javascript:void(0)" onclick="jmpParam(\'' + row.id + '\')"><i class="fa fa-anchor"></i>参数设置</a>');
return actions.join('');
}
}]
};
$.table.init(options);
});
function jmpParam(id) {
var url = table.options.editParamUrl.replace("{id}", id);
console.log(url);
$.modal.open("修改工位参数", url);
}
</script>
</body>
</html>

@ -0,0 +1,150 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('修改工位参数')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-SubStation-editParam" th:object="${tBdSubstation}">
<input name="ID" th:field="*{ID}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">工位序号:</label>
<div class="col-sm-8">
<input id="StationID" name="StationID" th:field="*{StationID}" class="form-control" readonly="readonly">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">工位名称:</label>
<div class="col-sm-8">
<input name="StationName" th:field="*{StationName}" class="form-control" readonly="readonly">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">工位代码:</label>
<div class="col-sm-8">
<input name="StationCode" th:field="*{StationCode}" class="form-control" readonly="readonly">
</div>
</div>
<!-- <div class="form-group">-->
<!-- <label class="col-sm-3 control-label">工位类型:</label>-->
<!-- <div class="col-sm-8">-->
<!-- <select name="StationType" class="form-control m-b" th:field="*{StationType}">-->
<!-- <option th:each="st:${stationtype}" th:value="${st.ID}" th:text="${st.typeName}"></option>-->
<!-- </select>-->
<!-- </div>-->
<!-- </div>-->
<div class="form-group">
<label class="col-sm-3 control-label">系统数据表:</label>
<div class="col-sm-8">
<input name="TableName" th:field="*{TableName}" class="form-control" readonly="readonly">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">参数个数:</label>
<div class="col-sm-8">
<input id="paraCount" name="paraCount" th:field="*{paraCount}" class="form-control" readonly="readonly">
</div>
</div>
<!-- <div class="form-group" id="parameter">-->
<!-- </div>-->
<!-- <div class="form-group">-->
<!-- <label class="col-sm-3 control-label">排序id</label>-->
<!-- <div class="col-sm-8">-->
<!-- <input name="OrderID" th:field="*{OrderID}" class="form-control" type="text">-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="form-group">-->
<!-- <label class="col-sm-3 control-label">上下限是否显示:</label>-->
<!-- <div class="col-sm-8">-->
<!-- <select name="LimitID" class="form-control m-b" th:field="*{LimitID}" th:with="type=${@dict.getType('limitshow')}">-->
<!-- <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>-->
<!-- </select>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="form-group">-->
<!-- <label class="col-sm-3 control-label">线路类型:</label>-->
<!-- <div class="col-sm-8">-->
<!-- <select name="LineID" class="form-control" th:field="*{LineID}">-->
<!-- <option th:each="st:${linename}" th:value="${st.LineID}" th:text="${st.LineTypeName}"></option>-->
<!-- </select>-->
<!-- </div>-->
<!-- </div>-->
</form>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var prefix = ctx + "nanjing/StationParameterNotes";
$("#form-SubStation-editParam").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
var formData = new FormData();
formData.append("StationID",$("StationID").val());
formData.append("StationCode",$("StationCode").val());
formData.append("TableName",$("TableName").val());
for ()
$.operate.save(prefix + "/editParmSave", formData ); //$('#form-SubStation-editParam').serialize()
}
}
$(function() {
var paramCount = $('#paraCount').val();
console.log(paramCount);
var i =0;
while(i<paramCount) {
i++;
createELm(i);
}
});
//根据参数个数生成元素
function createELm(num) {
var formid = document.getElementById("form-SubStation-editParam");
var doc = document.createElement("div");
doc.setAttribute("class","form-group");
formid.appendChild(doc);
// var doc = document.getElementById("parameter");
//添加lable
var elm = document.createElement("label");
elm.innerText="参数"+num+":";
elm.setAttribute("class","col-sm-3 control-label");
doc.appendChild(elm);
//添加div
var div1 = document.createElement("div");
div1.setAttribute("class","col-sm-8");
doc.appendChild(div1);
// 在div中添加txt
var txt = document.createElement("input");
var name = "Para"+num;
txt.setAttribute("name",name);
txt.setAttribute("class","form-control");
div1.appendChild(txt);
//换行
// var br = document.createElement("br");
// doc.after(br);
//填充参数数据
var formData = new FormData();
formData.append("stationID",$('#StationID').val());
formData.append("para",name);
$.ajax({
type: "post",
url: ctx + "nanjing/StationParameterNotes/getParamData",
data: formData,
contentType: false,
processData: false,
dataType: "json",
success: function (result) {
console.log(result.msg);
if (result.code == web_status.SUCCESS){
txt.value = result.msg;
}else{
txt.value = "";
}
}
});
}
</script>
</body>
</html>

@ -0,0 +1,163 @@
package com.ruoyi.nanjing.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* T_SY_StationParameterNotes
*
* @author limy
* @date 2021-01-27
*/
public class TSyStationparameternotes extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** id */
private Long id;
/** 表名 */
@Excel(name = "表名")
private String tabelName;
/** 参数名 */
@Excel(name = "参数名")
private String paraColumn;
/** 参数值 */
@Excel(name = "参数值")
private String paraMeaning;
/** 工位ID */
@Excel(name = "工位ID")
private String stationID;
/** 工位码 */
@Excel(name = "工位码")
private String stationCode;
/** 父工位ID */
@Excel(name = "父工位ID")
private String parentStationID;
/** 父工位码 */
@Excel(name = "父工位码")
private String parentStationCode;
/** 父工位名 */
@Excel(name = "父工位名")
private String parentStationName;
/** 是否显示 */
@Excel(name = "是否显示")
private String usedFlag;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setTabelName(String tabelName)
{
this.tabelName = tabelName;
}
public String getTabelName()
{
return tabelName;
}
public void setParaColumn(String paraColumn)
{
this.paraColumn = paraColumn;
}
public String getParaColumn()
{
return paraColumn;
}
public void setParaMeaning(String paraMeaning)
{
this.paraMeaning = paraMeaning;
}
public String getParaMeaning()
{
return paraMeaning;
}
public void setStationID(String stationID)
{
this.stationID = stationID;
}
public String getStationID()
{
return stationID;
}
public void setStationCode(String stationCode)
{
this.stationCode = stationCode;
}
public String getStationCode()
{
return stationCode;
}
public void setParentStationID(String parentStationID)
{
this.parentStationID = parentStationID;
}
public String getParentStationID()
{
return parentStationID;
}
public void setParentStationCode(String parentStationCode)
{
this.parentStationCode = parentStationCode;
}
public String getParentStationCode()
{
return parentStationCode;
}
public void setParentStationName(String parentStationName)
{
this.parentStationName = parentStationName;
}
public String getParentStationName()
{
return parentStationName;
}
public void setUsedFlag(String usedFlag)
{
this.usedFlag = usedFlag;
}
public String getUsedFlag()
{
return usedFlag;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("tabelName", getTabelName())
.append("paraColumn", getParaColumn())
.append("paraMeaning", getParaMeaning())
.append("stationID", getStationID())
.append("stationCode", getStationCode())
.append("parentStationID", getParentStationID())
.append("parentStationCode", getParentStationCode())
.append("parentStationName", getParentStationName())
.append("usedFlag", getUsedFlag())
.toString();
}
}

@ -70,4 +70,5 @@ public interface TBdSubstationMapper
void updateTable(Map map);
void deletePara(Map map);
}

@ -0,0 +1,65 @@
package com.ruoyi.nanjing.mapper;
import java.util.List;
import com.ruoyi.nanjing.domain.TSyStationparameternotes;
/**
* Mapper
*
* @author limy
* @date 2021-01-27
*/
public interface TSyStationparameternotesMapper
{
/**
*
*
* @param id ID
* @return
*/
public TSyStationparameternotes selectTSyStationparameternotesById(Long id);
/**
*
*
* @param tSyStationparameternotes
* @return
*/
public List<TSyStationparameternotes> selectTSyStationparameternotesList(TSyStationparameternotes tSyStationparameternotes);
/**
*
*
* @param tSyStationparameternotes
* @return
*/
public int insertTSyStationparameternotes(TSyStationparameternotes tSyStationparameternotes);
/**
*
*
* @param tSyStationparameternotes
* @return
*/
public int updateTSyStationparameternotes(TSyStationparameternotes tSyStationparameternotes);
/**
*
*
* @param id ID
* @return
*/
public int deleteTSyStationparameternotesById(Long id);
/**
*
*
* @param ids ID
* @return
*/
public int deleteTSyStationparameternotesByIds(String[] ids);
TSyStationparameternotes getParaVal(String stationID, String para);
List<TSyStationparameternotes> selectByStationID(String stationID);
}

@ -70,4 +70,5 @@ public interface ITBdSubstationService
void updateTable(Map map);
void deletePara(Map map);
}

@ -0,0 +1,65 @@
package com.ruoyi.nanjing.service;
import java.util.List;
import com.ruoyi.nanjing.domain.TSyStationparameternotes;
/**
* Service
*
* @author limy
* @date 2021-01-27
*/
public interface ITSyStationparameternotesService
{
/**
*
*
* @param id ID
* @return
*/
public TSyStationparameternotes selectTSyStationparameternotesById(Long id);
/**
*
*
* @param tSyStationparameternotes
* @return
*/
public List<TSyStationparameternotes> selectTSyStationparameternotesList(TSyStationparameternotes tSyStationparameternotes);
/**
*
*
* @param tSyStationparameternotes
* @return
*/
public int insertTSyStationparameternotes(TSyStationparameternotes tSyStationparameternotes);
/**
*
*
* @param tSyStationparameternotes
* @return
*/
public int updateTSyStationparameternotes(TSyStationparameternotes tSyStationparameternotes);
/**
*
*
* @param ids ID
* @return
*/
public int deleteTSyStationparameternotesByIds(String ids);
/**
*
*
* @param id ID
* @return
*/
public int deleteTSyStationparameternotesById(Long id);
TSyStationparameternotes getParaVal(String stationID, String para);
List<TSyStationparameternotes> selectByStationID(String stationID);
}

@ -118,4 +118,5 @@ public class TBdSubstationServiceImpl implements ITBdSubstationService
public void deletePara(Map map) {
tBdSubstationMapper.deletePara(map);
}
}

@ -0,0 +1,104 @@
package com.ruoyi.nanjing.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.nanjing.mapper.TSyStationparameternotesMapper;
import com.ruoyi.nanjing.domain.TSyStationparameternotes;
import com.ruoyi.nanjing.service.ITSyStationparameternotesService;
import com.ruoyi.common.core.text.Convert;
/**
* Service
*
* @author limy
* @date 2021-01-27
*/
@Service
public class TSyStationparameternotesServiceImpl implements ITSyStationparameternotesService
{
@Autowired
private TSyStationparameternotesMapper tSyStationparameternotesMapper;
/**
*
*
* @param id ID
* @return
*/
@Override
public TSyStationparameternotes selectTSyStationparameternotesById(Long id)
{
return tSyStationparameternotesMapper.selectTSyStationparameternotesById(id);
}
/**
*
*
* @param tSyStationparameternotes
* @return
*/
@Override
public List<TSyStationparameternotes> selectTSyStationparameternotesList(TSyStationparameternotes tSyStationparameternotes)
{
return tSyStationparameternotesMapper.selectTSyStationparameternotesList(tSyStationparameternotes);
}
/**
*
*
* @param tSyStationparameternotes
* @return
*/
@Override
public int insertTSyStationparameternotes(TSyStationparameternotes tSyStationparameternotes)
{
return tSyStationparameternotesMapper.insertTSyStationparameternotes(tSyStationparameternotes);
}
/**
*
*
* @param tSyStationparameternotes
* @return
*/
@Override
public int updateTSyStationparameternotes(TSyStationparameternotes tSyStationparameternotes)
{
return tSyStationparameternotesMapper.updateTSyStationparameternotes(tSyStationparameternotes);
}
/**
*
*
* @param ids ID
* @return
*/
@Override
public int deleteTSyStationparameternotesByIds(String ids)
{
return tSyStationparameternotesMapper.deleteTSyStationparameternotesByIds(Convert.toStrArray(ids));
}
/**
*
*
* @param id ID
* @return
*/
@Override
public int deleteTSyStationparameternotesById(Long id)
{
return tSyStationparameternotesMapper.deleteTSyStationparameternotesById(id);
}
@Override
public TSyStationparameternotes getParaVal(String stationID, String para) {
return tSyStationparameternotesMapper.getParaVal(stationID,para);
}
@Override
public List<TSyStationparameternotes> selectByStationID(String stationID) {
return tSyStationparameternotesMapper.selectByStationID(stationID);
}
}

@ -72,22 +72,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
)
}
</select>
<update id="updateTable" parameterType="map" statementType="CALLABLE">
<select id="updateTable" parameterType="map" statementType="CALLABLE" resultMap="TBdSubstationResult">
{
call SP_Pro_UpdateParaTable(
#{paraCount,mode=IN,jdbcType=BIGINT},
#{paraCount,mode=IN,jdbcType=INTEGER},
#{tableName,mode=IN,jdbcType=VARCHAR},
#{stationID,mode=IN,jdbcType=BIGINT}
#{stationID,mode=IN,jdbcType=INTEGER}
)
}
</update>
<delete id="deletePara" parameterType="map" statementType="CALLABLE">
</select>
<select id="deletePara" parameterType="map" statementType="CALLABLE" resultMap="TBdSubstationResult">
{
call SP_Pro_DeleteStationPara(
#{stationID,mode=IN,jdbcType=VARCHAR}
#{stationID,mode=IN,jdbcType=INTEGER}
)
}
</delete>
</select>
<select id="selectTBdSubstationList" parameterType="TBdSubstation" resultMap="TBdSubstationResult">
<include refid="selectTBdSubstationVo"/>
<where>

@ -0,0 +1,108 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.nanjing.mapper.TSyStationparameternotesMapper">
<resultMap type="TSyStationparameternotes" id="TSyStationparameternotesResult">
<result property="id" column="ID" />
<result property="tabelName" column="TabelName" />
<result property="paraColumn" column="ParaColumn" />
<result property="paraMeaning" column="ParaMeaning" />
<result property="stationID" column="StationID" />
<result property="stationCode" column="StationCode" />
<result property="parentStationID" column="ParentStationID" />
<result property="parentStationCode" column="ParentStationCode" />
<result property="parentStationName" column="ParentStationName" />
<result property="usedFlag" column="UsedFlag" />
</resultMap>
<sql id="selectTSyStationparameternotesVo">
select ID, TabelName, ParaColumn, ParaMeaning, StationID, StationCode, ParentStationID, ParentStationCode, ParentStationName, UsedFlag from T_SY_StationParameterNotes
</sql>
<select id="selectTSyStationparameternotesList" parameterType="TSyStationparameternotes" resultMap="TSyStationparameternotesResult">
<include refid="selectTSyStationparameternotesVo"/>
<where>
<if test="tabelName != null and tabelName != ''"> and TabelName like ('%' + #{tabelName} + '%')</if>
<if test="paraColumn != null and paraColumn != ''"> and ParaColumn = #{paraColumn}</if>
<if test="paraMeaning != null "> and ParaMeaning = #{paraMeaning}</if>
<if test="stationID != null and stationID != ''"> and StationID = #{stationID}</if>
<if test="stationCode != null "> and StationCode = #{stationCode}</if>
<if test="parentStationID != null and parentStationID != ''"> and ParentStationID = #{parentStationID}</if>
<if test="parentStationCode != null "> and ParentStationCode = #{parentStationCode}</if>
<if test="parentStationName != null "> and ParentStationName like ('%' + #{parentStationName} + '%')</if>
<if test="usedFlag != null and usedFlag != ''"> and UsedFlag = #{usedFlag}</if>
</where>
</select>
<select id="selectTSyStationparameternotesById" parameterType="Long" resultMap="TSyStationparameternotesResult">
<include refid="selectTSyStationparameternotesVo"/>
where ID = #{id}
</select>
<select id="getParaVal" resultMap="TSyStationparameternotesResult">
select ID, TabelName, ParaColumn, ParaMeaning, StationID, StationCode, ParentStationID, ParentStationCode, ParentStationName, UsedFlag from T_SY_StationParameterNotes
where StationID = #{param1} and ParaColumn = #{param2}
</select>
<select id="selectByStationID" parameterType="String" resultMap="TSyStationparameternotesResult">
select ID, TabelName, ParaColumn, ParaMeaning, StationID, StationCode, ParentStationID, ParentStationCode, ParentStationName, UsedFlag from T_SY_StationParameterNotes
where StationID = #{stationID}
</select>
<insert id="insertTSyStationparameternotes" parameterType="TSyStationparameternotes">
insert into T_SY_StationParameterNotes
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">ID,</if>
<if test="tabelName != null">TabelName,</if>
<if test="paraColumn != null">ParaColumn,</if>
<if test="paraMeaning != null">ParaMeaning,</if>
<if test="stationID != null">StationID,</if>
<if test="stationCode != null">StationCode,</if>
<if test="parentStationID != null">ParentStationID,</if>
<if test="parentStationCode != null">ParentStationCode,</if>
<if test="parentStationName != null">ParentStationName,</if>
<if test="usedFlag != null">UsedFlag,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="tabelName != null">#{tabelName},</if>
<if test="paraColumn != null">#{paraColumn},</if>
<if test="paraMeaning != null">#{paraMeaning},</if>
<if test="stationID != null">#{stationID},</if>
<if test="stationCode != null">#{stationCode},</if>
<if test="parentStationID != null">#{parentStationID},</if>
<if test="parentStationCode != null">#{parentStationCode},</if>
<if test="parentStationName != null">#{parentStationName},</if>
<if test="usedFlag != null">#{usedFlag},</if>
</trim>
</insert>
<update id="updateTSyStationparameternotes" parameterType="TSyStationparameternotes">
update T_SY_StationParameterNotes
<trim prefix="SET" suffixOverrides=",">
<if test="tabelName != null">TabelName = #{tabelName},</if>
<if test="paraColumn != null">ParaColumn = #{paraColumn},</if>
<if test="paraMeaning != null">ParaMeaning = #{paraMeaning},</if>
<if test="stationID != null">StationID = #{stationID},</if>
<if test="stationCode != null">StationCode = #{stationCode},</if>
<if test="parentStationID != null">ParentStationID = #{parentStationID},</if>
<if test="parentStationCode != null">ParentStationCode = #{parentStationCode},</if>
<if test="parentStationName != null">ParentStationName = #{parentStationName},</if>
<if test="usedFlag != null">UsedFlag = #{usedFlag},</if>
</trim>
where ID = #{id}
</update>
<delete id="deleteTSyStationparameternotesById" parameterType="Long">
delete from T_SY_StationParameterNotes where ID = #{id}
</delete>
<delete id="deleteTSyStationparameternotesByIds" parameterType="String">
delete from T_SY_StationParameterNotes where ID in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
Loading…
Cancel
Save