工位管理

master
Limy 4 years ago
parent 3cace1741a
commit f8d79370f9

@ -1,6 +1,16 @@
package com.ruoyi.web.controller.nanjing;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.nanjing.domain.TBdLinetype;
import com.ruoyi.nanjing.domain.TBdProductinfo;
import com.ruoyi.nanjing.domain.TBdStationtype;
import com.ruoyi.nanjing.service.ITBdLinetypeService;
import com.ruoyi.nanjing.service.ITBdStationtypeService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
@ -33,11 +43,19 @@ public class TBdSubstationController extends BaseController
@Autowired
private ITBdSubstationService tBdSubstationService;
@Autowired
private ITBdLinetypeService linetypeService;
@Autowired
private ITBdStationtypeService stationtypeService;
@RequiresPermissions("nanjing:SubStation:view")
@GetMapping()
public String SubStation()
public String SubStation(ModelMap map)
{
List<TBdLinetype> linetypes = linetypeService.selectTBdLinetypeList(new TBdLinetype());
List<TBdStationtype> stationtypes = stationtypeService.selectTBdStationtypeList(new TBdStationtype());
map.addAttribute("linename",linetypes);
map.addAttribute("stationtype",stationtypes);
return prefix + "/SubStation";
}
@ -72,8 +90,23 @@ public class TBdSubstationController extends BaseController
*
*/
@GetMapping("/add")
public String add()
public String add(ModelMap map)
{
//工位序号+
List<TBdSubstation> list = tBdSubstationService.selectStationcode();
int max = Convert.toInt(list.get(0).getStationID());
list.get(0).setStationID(max+1L);
//排序id+
List<TBdSubstation> list1 = tBdSubstationService.selectOrderid();
int max1 = Convert.toInt(list.get(0).getOrderID());
list.get(0).setOrderID(max1+1L);
List<TBdLinetype> linetypes = linetypeService.selectTBdLinetypeList(new TBdLinetype());
List<TBdStationtype> stationtypes = stationtypeService.selectTBdStationtypeList(new TBdStationtype());
map.addAttribute("si",list);
map.addAttribute("oi",list);
map.addAttribute("linename",linetypes);
map.addAttribute("stationtype",stationtypes);
return prefix + "/add";
}
@ -86,7 +119,14 @@ public class TBdSubstationController extends BaseController
@ResponseBody
public AjaxResult addSave(TBdSubstation tBdSubstation)
{
return toAjax(tBdSubstationService.insertTBdSubstation(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);
}
/**
@ -95,6 +135,10 @@ public class TBdSubstationController extends BaseController
@GetMapping("/edit/{ID}")
public String edit(@PathVariable("ID") Long ID, ModelMap mmap)
{
List<TBdLinetype> linetypes = linetypeService.selectTBdLinetypeList(new TBdLinetype());
List<TBdStationtype> stationtypes = stationtypeService.selectTBdStationtypeList(new TBdStationtype());
mmap.addAttribute("linename",linetypes);
mmap.addAttribute("stationtype",stationtypes);
TBdSubstation tBdSubstation = tBdSubstationService.selectTBdSubstationById(ID);
mmap.put("tBdSubstation", tBdSubstation);
return prefix + "/edit";
@ -109,7 +153,16 @@ public class TBdSubstationController extends BaseController
@ResponseBody
public AjaxResult editSave(TBdSubstation tBdSubstation)
{
return toAjax(tBdSubstationService.updateTBdSubstation(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);
}
/**
@ -121,6 +174,12 @@ public class TBdSubstationController extends BaseController
@ResponseBody
public AjaxResult remove(String ids)
{
return toAjax(tBdSubstationService.deleteTBdSubstationByIds(ids));
int result = tBdSubstationService.deleteTBdSubstationByIds(ids);
if(result>0){
Map map = new HashMap<String,Object>();
map.put("stationID",ids);
tBdSubstationService.deletePara(map);
}
return toAjax(result);
}
}

@ -4,6 +4,7 @@ import java.util.Date;
import java.util.List;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.framework.util.ShiroUtils;
import com.ruoyi.nanjing.domain.TBdProductinfo;
import com.ruoyi.nanjing.service.ITBdProductinfoService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
@ -128,20 +129,57 @@ public class TRpProductchangeinfoController extends BaseController
return toAjax(tRpProductchangeinfoService.updateTRpProductchangeinfo(tRpProductchangeinfo));
}
/**
*
*/
@RequiresPermissions("nanjing:ProductChangeInfo:start")
@PostMapping("/start")
@ResponseBody
public AjaxResult start(HttpServletRequest request){
String ids = request.getParameter("id");
String msg = "";
TRpProductchangeinfo tRpProductchangeinfo = tRpProductchangeinfoService.selectTRpProductchangeinfoById(Convert.toLong(ids));
if(tRpProductchangeinfo.getBeginTime()==null){
tRpProductchangeinfo.setBeginTime(new Date());
return toAjax(tRpProductchangeinfoService.updateTRpProductchangeinfo(tRpProductchangeinfo));
}else{
return toAjax(0);
tRpProductchangeinfo.setOperator(ShiroUtils.getLoginName());
int res = tRpProductchangeinfoService.updateTRpProductchangeinfo(tRpProductchangeinfo);
if(res>0){
msg = "已开始!";
return AjaxResult.success(msg);
}
}
else
{
msg="不能重复开始!";
}
return AjaxResult.error(msg);
}
/**
*
*/
@RequiresPermissions("nanjing:ProductChangeInfo:end")
@PostMapping("/end")
@ResponseBody
public AjaxResult end(HttpServletRequest request){
String ids = request.getParameter("id");
String msg = "";
TRpProductchangeinfo tRpProductchangeinfo = tRpProductchangeinfoService.selectTRpProductchangeinfoById(Convert.toLong(ids));
if(tRpProductchangeinfo.getBeginTime()==null){
msg= "未开始,不能结束!";
}
else
{
tRpProductchangeinfo.setEndTime(new Date());
tRpProductchangeinfo.setOperator(ShiroUtils.getLoginName());
int res = tRpProductchangeinfoService.updateTRpProductchangeinfo(tRpProductchangeinfo);
if(res>0){
msg = "已结束!";
return AjaxResult.success(msg);
}
}
return AjaxResult.error(msg);
}
/**
*
*/

@ -6,50 +6,10 @@
<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="ProductId"/>-->
<select name="ProductId">
<option value="">全部</option>
<option th:each="ls:${list}" th:value="${ls.productID}" th:text="${ls.productName}"></option>
</select>
</li>
<li>
生产负责人:
<input type="text" name="PersonInCharge"/>
</li>
<!-- <li class="select-time">-->
<!-- <label>开始时间:</label>-->
<!-- <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginBeginTime]"/>-->
<!-- <span>-</span>-->
<!-- <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endBeginTime]"/>-->
<!-- </li>-->
<li>
<a class="btn btn-success btn-rounded btn-sm" onclick="$.operate.add()" shiro:hasPermission="nanjing:ProductChangeInfo:add"><i class="fa fa-plus"></i> 添加</a>
<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 class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success btn-rounded btn-sm" onclick="$.operate.add()" shiro:hasPermission="nanjing:ProductChangeInfo:add"><i class="fa fa-plus"></i> 添加</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;查询全部</a>
</div>
<!-- <div class="btn-group-sm" id="toolbar" role="group">-->
<!-- -->
<!-- <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="nanjing:ProductChangeInfo:edit">-->
<!-- <i class="fa fa-edit"></i> 修改-->
<!-- </a>-->
<!-- <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="nanjing:ProductChangeInfo:remove">-->
<!-- <i class="fa fa-remove"></i> 删除-->
<!-- </a>-->
<!-- <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="nanjing:ProductChangeInfo:export">-->
<!-- <i class="fa fa-download"></i> 导出-->
<!-- </a>-->
<!-- </div>-->
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
</div>
@ -123,10 +83,34 @@
contentType: false,
processData: false,
dataType: "json",
success: function (res) {
console.log(res)
if (res >0)
success: function (result) {
console.log(result.msg);
if (result.code == web_status.SUCCESS){
$.table.refresh();
}else{
alert(result.msg);
}
}
})
}
function endP(id){
var formData = new FormData();
formData.append("id",id);
$.ajax({
type: "post",
url: prefix+"/end",
data: formData,
contentType: false,
processData: false,
dataType: "json",
success: function (result) {
console.log(result.msg);
if (result.code == web_status.SUCCESS){
$.table.refresh();
}else{
alert(result.msg);
}
}
})
}

@ -2,6 +2,7 @@
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('工位管理列表')" />
<th:block th:include="include :: select2-css" />
</head>
<body class="gray-bg">
<div class="container-div">
@ -11,146 +12,43 @@
<div class="select-list">
<ul>
<!-- <li>-->
<!-- <label>工位id</label>-->
<!-- <input type="text" name="StationID"/>-->
<!-- <label>工位代码</label>-->
<!-- <input type="text" name="StationCode"/>-->
<!-- </li>-->
<li>
<label>工位代码:</label>
<input type="text" name="StationCode"/>
</li>
<li>
<label>工位类型:</label>
<select name="StationType">
<option value="">所有</option>
<option value="-1">代码生成请选择字典属性</option>
<option th:each="st:${stationtype}" th:value="${st.ID}" th:text="${st.typeName}"></option>
</select>
</li>
<li>
<label>机台id</label>
<input type="text" name="MachineID"/>
</li>
<li>
<label>连接id</label>
<input type="text" name="UniteID"/>
</li>
<li>
<label>实际code</label>
<input type="text" name="CustomerCode"/>
</li>
<li>
<label>工位名称:</label>
<input type="text" name="StationName"/>
</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>前工位id</label>
<input type="text" name="PreStationID"/>
</li>
<li>
<label>前工位码:</label>
<input type="text" name="PreStationCode"/>
</li>
<li>
<label>备注:</label>
<input type="text" name="Reamark"/>
</li>
<li>
<label>用户id</label>
<input type="text" name="UserID"/>
</li>
<!-- <li class="select-time">-->
<!-- <label>更新时间:</label>-->
<!-- <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginUpdateTime]"/>-->
<!-- <span>-</span>-->
<!-- <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endUpdateTime]"/>-->
<!-- </li>-->
<li>
<label>表名称:</label>
<input type="text" name="TableName"/>
</li>
<li>
<label>是否子工位:</label>
<input type="text" name="IsSemi"/>
</li>
<li>
<label>是否弃用工位:</label>
<input type="text" name="IsNGStation"/>
</li>
<li>
<label>数据:</label>
<input type="text" name="HaveData"/>
</li>
<li>
<label>是否显示:</label>
<select name="IsShow">
<label>线路名称:</label>
<select name="LineID">
<option value="">所有</option>
<option value="-1">代码生成请选择字典属性</option>
<option th:each="st:${linename}" th:value="${st.LineID}" th:text="${st.LineTypeName}"></option>
</select>
</li>
<li>
<label>是否有效,上位机使用该字段:</label>
<input type="text" name="UseFlag"/>
</li>
<li>
<label>参数个数:</label>
<input type="text" name="paraCount"/>
</li>
<li>
<label>排序id</label>
<input type="text" name="OrderID"/>
</li>
<li>
<label>限制id</label>
<input type="text" name="LimitID"/>
</li>
<li>
<label>图片路径:</label>
<input type="text" name="ImageUrl"/>
</li>
<li>
<label>线路id</label>
<input type="text" name="LineID"/>
</li>
<li>
<a class="btn btn-success btn-rounded btn-sm" onclick="$.operate.add()" shiro:hasPermission="nanjing:SubStation:add"><i class="fa fa-plus"></i> 新增工位</a>
<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>
<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:SubStation:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="nanjing:SubStation:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="nanjing:SubStation:remove">
<i class="fa fa-remove"></i> 删除
</a>
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="nanjing:SubStation: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" />
<th:block th:include="include :: select2-js" />
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('nanjing:SubStation:edit')}]];
var removeFlag = [[${@permission.hasPermi('nanjing:SubStation:remove')}]];
@ -164,22 +62,11 @@
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
modalName: "工位管理",
columns: [{
checkbox: true
},
columns: [
{
field: 'OrderID',
field: 'orderID',
title: '排序id'
},
// {
// field: 'ID',
// title: 'id',
// visible: false
// },
// {
// field: 'StationID',
// title: '工位id'
// },
{
field: 'stationCode',
title: '工位代码'
@ -189,101 +76,24 @@
title: '工位名称'
},
{
field: 'stationType',
field: 'stationtype.typeName',
title: '工位类型'
},
// {
// field: 'MachineID',
// title: '机台id'
// },
// {
// field: 'UniteID',
// title: '连接id'
// },
// {
// field: 'CustomerCode',
// title: '实际code'
// },
//
// {
// field: 'ParentStationID',
// title: '父工位id'
// },
// {
// field: 'ParentStationCode',
// title: '父工位码'
// },
// {
// field: 'ParentStationName',
// title: '父工位名'
// },
// {
// field: 'PreStationID',
// title: '前工位id'
// },
// {
// field: 'PreStationCode',
// title: '前工位码'
// },
// {
// field: 'Reamark',
// title: '备注'
// },
// {
// field: 'UserID',
// title: '用户id'
// },
// {
// field: 'UpdateTime',
// title: '更新时间'
// },
// {
// field: 'TableName',
// title: '表名称'
// },
// {
// field: 'IsSemi',
// title: '是否子工位'
// },
// {
// field: 'IsNGStation',
// title: '是否弃用工位'
// },
// {
// field: 'HaveData',
// title: '数据'
// },
// {
// field: 'IsShow',
// title: '是否显示'
// },
// {
// field: 'UseFlag',
// title: '是否有效,上位机使用该字段'
// },
{
field: 'paraCount',
title: '参数个数'
},
// {
// field: 'LimitID',
// title: '限制id'
// },
// {
// field: 'ImageUrl',
// title: '图片路径'
// },
{
field: 'lineID',
title: '线路id'
field: 'linetype.lineTypeName',
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>');
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('');
}
}]

@ -2,134 +2,41 @@
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('新增工位管理')" />
<th:block th:include="include :: select2-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-SubStation-add">
<div class="form-group">
<label class="col-sm-3 control-label">工位id</label>
<label class="col-sm-3 control-label">工位序号:</label>
<div class="col-sm-8">
<input name="StationID" class="form-control" type="text">
<input name="StationID" class="form-control" th:each="si:${si}" th:value="${si.StationID}" readonly="readonly">
</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">工位类型:</label>
<div class="col-sm-8">
<select name="StationType" class="form-control m-b">
<option value="">所有</option>
</select>
<span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">机台id</label>
<div class="col-sm-8">
<input name="MachineID" 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="UniteID" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">实际code</label>
<div class="col-sm-8">
<input name="CustomerCode" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<div class="form-group">
<label class="col-sm-3 control-label">工位名称:</label>
<div class="col-sm-8">
<input name="StationName" 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">前工位id</label>
<div class="col-sm-8">
<input name="PreStationID" 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="PreStationCode" 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="Reamark" 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="UserID" 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="TableName" 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="IsSemi" 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="IsNGStation" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">数据:</label>
<div class="form-group">
<label class="col-sm-3 control-label">工位代码:</label>
<div class="col-sm-8">
<input name="HaveData" class="form-control" type="text">
<input id="stationCode" name="StationCode" class="form-control" type="text" onchange="fillTableName()">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">是否显示</label>
<label class="col-sm-3 control-label">工位类型:</label>
<div class="col-sm-8">
<select name="IsShow" class="form-control m-b">
<option value="">所有</option>
<select name="StationType" class="form-control m-b">
<option th:each="st:${stationtype}" th:value="${st.ID}" th:text="${st.typeName}"></option>
</select>
<span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">是否有效,上位机使用该字段</label>
<label class="col-sm-3 control-label">系统数据表:</label>
<div class="col-sm-8">
<input name="UseFlag" class="form-control" type="text">
<input id="tableName" name="TableName" class="form-control" readonly="readonly">
</div>
</div>
<div class="form-group">
@ -138,33 +45,32 @@
<input name="paraCount" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<div class="form-group">
<label class="col-sm-3 control-label">排序id</label>
<div class="col-sm-8">
<input name="OrderID" class="form-control" type="text">
<input name="OrderID" class="form-control" th:each="oi:${oi}" th:value="${oi.OrderID}" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">限制id</label>
<label class="col-sm-3 control-label">上下限是否显示</label>
<div class="col-sm-8">
<input name="LimitID" 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="ImageUrl" class="form-control" type="text">
<select name="LimitID" class="form-control m-b" 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">线路id</label>
<label class="col-sm-3 control-label">线路类型:</label>
<div class="col-sm-8">
<input name="LineID" class="form-control" type="text">
<select name="LineID" class="form-control">
<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" />
<th:block th:include="include :: select2-js" />
<script th:inline="javascript">
var prefix = ctx + "nanjing/SubStation"
$("#form-SubStation-add").validate({
@ -176,6 +82,9 @@
$.operate.save(prefix + "/add", $('#form-SubStation-add').serialize());
}
}
function fillTableName() {
$('#tableName').val("T_RP_StationPara_"+$('#stationCode').val().toString().trim());
}
</script>
</body>
</html>

@ -8,129 +8,35 @@
<form class="form-horizontal m" id="form-SubStation-edit" th:object="${tBdSubstation}">
<input name="ID" th:field="*{ID}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">工位id</label>
<label class="col-sm-3 control-label">工位序号</label>
<div class="col-sm-8">
<input name="StationID" th:field="*{StationID}" class="form-control" type="text">
<input 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="StationCode" th:field="*{StationCode}" 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="StationType" class="form-control m-b">
<option value="">所有</option>
</select>
<span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">机台id</label>
<div class="col-sm-8">
<input name="MachineID" th:field="*{MachineID}" 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="UniteID" th:field="*{UniteID}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">实际code</label>
<div class="col-sm-8">
<input name="CustomerCode" th:field="*{CustomerCode}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<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" 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">前工位id</label>
<div class="col-sm-8">
<input name="PreStationID" th:field="*{PreStationID}" 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="PreStationCode" th:field="*{PreStationCode}" 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="Reamark" th:field="*{Reamark}" 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="UserID" th:field="*{UserID}" 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="TableName" th:field="*{TableName}" 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="IsSemi" th:field="*{IsSemi}" 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="IsNGStation" th:field="*{IsNGStation}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">数据:</label>
<label class="col-sm-3 control-label">工位代码:</label>
<div class="col-sm-8">
<input name="HaveData" th:field="*{HaveData}" class="form-control" type="text">
<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>
<label class="col-sm-3 control-label">工位类型:</label>
<div class="col-sm-8">
<select name="IsShow" class="form-control m-b">
<option value="">所有</option>
<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>
<span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">是否有效,上位机使用该字段</label>
<label class="col-sm-3 control-label">系统数据表:</label>
<div class="col-sm-8">
<input name="UseFlag" th:field="*{UseFlag}" class="form-control" type="text">
<input name="TableName" th:field="*{TableName}" class="form-control" readonly="readonly">
</div>
</div>
<div class="form-group">
@ -146,21 +52,19 @@
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">限制id</label>
<label class="col-sm-3 control-label">上下限是否显示</label>
<div class="col-sm-8">
<input name="LimitID" th:field="*{LimitID}" 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="ImageUrl" th:field="*{ImageUrl}" class="form-control" type="text">
<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">线路id</label>
<label class="col-sm-3 control-label">线路类型:</label>
<div class="col-sm-8">
<input name="LineID" th:field="*{LineID}" class="form-control" type="text">
<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>

@ -116,6 +116,25 @@ public class TBdSubstation extends BaseEntity
// @Excel(name = "图片路径")
private String ImageUrl;
public TBdLinetype getLinetype() {
return linetype;
}
public void setLinetype(TBdLinetype linetype) {
this.linetype = linetype;
}
public TBdStationtype getStationtype() {
return stationtype;
}
public void setStationtype(TBdStationtype stationtype) {
this.stationtype = stationtype;
}
private TBdLinetype linetype;
private TBdStationtype stationtype;
@Override
public Date getUpdateTime() {
return UpdateTime;

@ -1,6 +1,8 @@
package com.ruoyi.nanjing.mapper;
import java.util.List;
import java.util.Map;
import com.ruoyi.nanjing.domain.TBdSubstation;
/**
@ -58,4 +60,14 @@ public interface TBdSubstationMapper
* @return
*/
public int deleteTBdSubstationByIds(String[] IDs);
List<TBdSubstation> selectStationcode();
List<TBdSubstation> selectOrderid();
void createTable(Map map);
void updateTable(Map map);
void deletePara(Map map);
}

@ -1,6 +1,8 @@
package com.ruoyi.nanjing.service;
import java.util.List;
import java.util.Map;
import com.ruoyi.nanjing.domain.TBdSubstation;
/**
@ -58,4 +60,14 @@ public interface ITBdSubstationService
* @return
*/
public int deleteTBdSubstationById(Long ID);
List<TBdSubstation> selectStationcode();
List<TBdSubstation> selectOrderid();
void createTable(Map map);
void updateTable(Map map);
void deletePara(Map map);
}

@ -1,6 +1,8 @@
package com.ruoyi.nanjing.service.impl;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.nanjing.mapper.TBdSubstationMapper;
@ -91,4 +93,29 @@ public class TBdSubstationServiceImpl implements ITBdSubstationService
{
return tBdSubstationMapper.deleteTBdSubstationById(ID);
}
@Override
public List<TBdSubstation> selectStationcode() {
return tBdSubstationMapper.selectStationcode();
}
@Override
public List<TBdSubstation> selectOrderid() {
return tBdSubstationMapper.selectOrderid();
}
@Override
public void createTable(Map map) {
tBdSubstationMapper.createTable(map);
}
@Override
public void updateTable(Map map) {
tBdSubstationMapper.updateTable(map);
}
@Override
public void deletePara(Map map) {
tBdSubstationMapper.deletePara(map);
}
}

@ -32,47 +32,97 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="LimitID" column="LimitID" />
<result property="ImageUrl" column="ImageUrl" />
<result property="LineID" column="LineID" />
<association property="stationtype" column="StationName" javaType="com.ruoyi.nanjing.domain.TBdStationtype" resultMap="stationtp"/>
<association property="linetype" column="LineTypeName" javaType="com.ruoyi.nanjing.domain.TBdLinetype" resultMap="lineName"/>
</resultMap>
<resultMap id="lineName" type="com.ruoyi.nanjing.domain.TBdLinetype">
<result property="LineID" column="LineID" />
<result property="LineTypeName" column="LineTypeName" />
</resultMap>
<resultMap id="stationtp" type="com.ruoyi.nanjing.domain.TBdStationtype">
<result property="ID" column="ID" />
<result property="typeName" column="Type_Name" />
</resultMap>
<sql id="selectTBdSubstationVo">
select ID, StationID, StationCode, StationType, MachineID, UniteID, CustomerCode, StationName, ParentStationID, ParentStationCode, ParentStationName, PreStationID, PreStationCode, Reamark, UserID, UpdateTime, TableName, IsSemi, IsNGStation, HaveData, IsShow, UseFlag, paraCount, OrderID, LimitID, ImageUrl, LineID from T_BD_SubStation
select t1.ID,t1.StationID, t1.StationCode, t1.StationType, t1.MachineID, t1.UniteID,
t1.CustomerCode, t1.StationName, t1.ParentStationID, t1.ParentStationCode, t1.ParentStationName,
t1.PreStationID, t1.PreStationCode, t1.Reamark, t1.UserID, t1.UpdateTime, t1.TableName, t1.IsSemi,
t1.IsNGStation, t1.HaveData, t1.IsShow, t1.UseFlag, t1.paraCount, t1.OrderID,t1.LimitID, t1.ImageUrl, t1.LineID,
t2.LineTypeName,t3.Type_Name from T_BD_SubStation t1
left join T_BD_LineType t2 on t1.LineID = t2.LineID
left join T_BD_StationType t3 on t1.StationType = t3.ID
</sql>
<select id="selectStationcode" resultMap="TBdSubstationResult">
select top 1 * from T_BD_SubStation order by StationID desc
</select>
<select id="selectOrderid" resultMap="TBdSubstationResult">
select top 1 * from T_BD_SubStation order by OrderID desc
</select>
<select id="createTable" parameterType="map" statementType="CALLABLE" resultMap="TBdSubstationResult">
{
call SP_SY_CreatStationTableByStationCode(
#{tableName,mode=IN,jdbcType=VARCHAR},
#{ParaAmount,mode=IN,jdbcType=BIGINT}
)
}
</select>
<update id="updateTable" parameterType="map" statementType="CALLABLE">
{
call SP_Pro_UpdateParaTable(
#{paraCount,mode=IN,jdbcType=BIGINT},
#{tableName,mode=IN,jdbcType=VARCHAR},
#{stationID,mode=IN,jdbcType=BIGINT}
)
}
</update>
<delete id="deletePara" parameterType="map" statementType="CALLABLE">
{
call SP_Pro_DeleteStationPara(
#{stationID,mode=IN,jdbcType=VARCHAR}
)
}
</delete>
<select id="selectTBdSubstationList" parameterType="TBdSubstation" resultMap="TBdSubstationResult">
<include refid="selectTBdSubstationVo"/>
<where>
<if test="StationID != null "> and StationID = #{StationID}</if>
<if test="StationCode != null and StationCode != ''"> and StationCode = #{StationCode}</if>
<if test="StationType != null "> and StationType = #{StationType}</if>
<if test="MachineID != null and MachineID != ''"> and MachineID = #{MachineID}</if>
<if test="UniteID != null "> and UniteID = #{UniteID}</if>
<if test="CustomerCode != null and CustomerCode != ''"> and CustomerCode = #{CustomerCode}</if>
<if test="StationName != null "> and StationName like ('%' + #{StationName} + '%')</if>
<if test="ParentStationID != null and ParentStationID != ''"> and ParentStationID = #{ParentStationID}</if>
<if test="ParentStationCode != null and ParentStationCode != ''"> and ParentStationCode = #{ParentStationCode}</if>
<if test="ParentStationName != null "> and ParentStationName like ('%' + #{ParentStationName} + '%')</if>
<if test="PreStationID != null and PreStationID != ''"> and PreStationID = #{PreStationID}</if>
<if test="PreStationCode != null and PreStationCode != ''"> and PreStationCode = #{PreStationCode}</if>
<if test="Reamark != null "> and Reamark = #{Reamark}</if>
<if test="UserID != null and UserID != ''"> and UserID = #{UserID}</if>
<if test="UpdateTime != null "> and UpdateTime = #{UpdateTime}</if>
<if test="TableName != null "> and TableName like ('%' + #{TableName} + '%')</if>
<if test="IsSemi != null and IsSemi != ''"> and IsSemi = #{IsSemi}</if>
<if test="IsNGStation != null and IsNGStation != ''"> and IsNGStation = #{IsNGStation}</if>
<if test="HaveData != null and HaveData != ''"> and HaveData = #{HaveData}</if>
<if test="IsShow != null and IsShow != ''"> and IsShow = #{IsShow}</if>
<if test="UseFlag != null and UseFlag != ''"> and UseFlag = #{UseFlag}</if>
<if test="paraCount != null "> and paraCount = #{paraCount}</if>
<if test="OrderID != null "> and OrderID = #{OrderID}</if>
<if test="LimitID != null and LimitID != ''"> and LimitID = #{LimitID}</if>
<if test="ImageUrl != null "> and ImageUrl = #{ImageUrl}</if>
<if test="LineID != null "> and LineID = #{LineID}</if>
<if test="StationID != null "> and t1.StationID = #{StationID}</if>
<if test="StationCode != null and StationCode != ''"> and t1.StationCode = #{StationCode}</if>
<if test="StationType != null "> and t1.StationType = #{StationType}</if>
<if test="MachineID != null and MachineID != ''"> and t1.MachineID = #{MachineID}</if>
<if test="UniteID != null "> and t1.UniteID = #{UniteID}</if>
<if test="CustomerCode != null and CustomerCode != ''"> and t1.CustomerCode = #{CustomerCode}</if>
<if test="StationName != null "> and t1.StationName like ('%' + #{StationName} + '%')</if>
<if test="ParentStationID != null and ParentStationID != ''"> and t1.ParentStationID = #{ParentStationID}</if>
<if test="ParentStationCode != null and ParentStationCode != ''"> and t1.ParentStationCode = #{ParentStationCode}</if>
<if test="ParentStationName != null "> and t1.ParentStationName like ('%' + #{ParentStationName} + '%')</if>
<if test="PreStationID != null and PreStationID != ''"> and t1.PreStationID = #{PreStationID}</if>
<if test="PreStationCode != null and PreStationCode != ''"> and t1.PreStationCode = #{PreStationCode}</if>
<if test="Reamark != null "> and t1.Reamark = #{Reamark}</if>
<if test="UserID != null and UserID != ''"> and t1.UserID = #{UserID}</if>
<if test="UpdateTime != null "> and t1.UpdateTime = #{UpdateTime}</if>
<if test="TableName != null "> and t1.TableName like ('%' + #{TableName} + '%')</if>
<if test="IsSemi != null and IsSemi != ''"> and t1.IsSemi = #{IsSemi}</if>
<if test="IsNGStation != null and IsNGStation != ''"> and t1.IsNGStation = #{IsNGStation}</if>
<if test="HaveData != null and HaveData != ''"> and t1.HaveData = #{HaveData}</if>
<if test="IsShow != null and IsShow != ''"> and t1.IsShow = #{IsShow}</if>
<if test="UseFlag != null and UseFlag != ''"> and t1.UseFlag = #{UseFlag}</if>
<if test="paraCount != null "> and t1.paraCount = #{paraCount}</if>
<if test="OrderID != null "> and t1.OrderID = #{OrderID}</if>
<if test="LimitID != null and LimitID != ''"> and t1.LimitID = #{LimitID}</if>
<if test="ImageUrl != null "> and t1.ImageUrl = #{ImageUrl}</if>
<if test="LineID != null "> and t1.LineID = #{LineID}</if>
</where>
</select>
<select id="selectTBdSubstationById" parameterType="Long" resultMap="TBdSubstationResult">
<include refid="selectTBdSubstationVo"/>
where ID = #{ID}
where t1.ID = #{ID}
</select>
<insert id="insertTBdSubstation" parameterType="TBdSubstation">

Loading…
Cancel
Save