PLC调度

master
erzhongxmu 2022-10-22 11:18:30 +08:00
parent 4ac7cb7a1b
commit be62e55b97
8 changed files with 1477 additions and 930 deletions

File diff suppressed because it is too large Load Diff

View File

@ -10,10 +10,13 @@ import java.text.SimpleDateFormat;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.zzjee.wm.entity.WmToMoveGoodsEntity;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
@ -163,48 +166,8 @@ public class WmsPlcController extends BaseController {
message = "PLC指令执行成功";
try{
for(String id:ids.split(",")){
long start = System.currentTimeMillis();
WmsPlcEntity wmsPlc = systemService.getEntity(WmsPlcEntity.class,
id
);
SiemensPLCS siemensPLCS = SiemensPLCS.S200Smart;
SiemensS7Net siemensS7Net = null;
siemensS7Net = new SiemensS7Net(siemensPLCS);
siemensS7Net.setIpAddress(wmsPlc.getPlcIp());
siemensS7Net.setPort(Integer.parseInt(wmsPlc.getPlcPort()) );
OperateResult connect = siemensS7Net.ConnectServer();
if(connect.IsSuccess){
System.out.println("connect success");
}else{
System.out.println("connect error");
}
String[] coms = wmsPlc.getComCons().split(";");
for (String com : coms) {
Thread.sleep(500);
String[] split = com.split(",");
String defaultAddress = split[1];
if(split[0].equals("boolean")){
if(split[2].equals("false")){
siemensS7Net.Write(defaultAddress,false);
}else{
siemensS7Net.Write(defaultAddress,true);
}
}
else if(split[0].equals("float")){
siemensS7Net.Write(defaultAddress,Float.parseFloat(split[2]));
}
}
//执行完指令等待时间
Thread.sleep(Long.parseLong(wmsPlc.getComTime()));
long end = System.currentTimeMillis();
long times = end - start;
org.jeecgframework.core.util.LogUtil.info(wmsPlc.getComRemark()+"总耗时" + times + "毫秒"+wmsPlc.getComCons());
}
run(id,"","");
}
}catch(Exception e){
e.printStackTrace();
message = "PLC指令执行失败";
@ -212,6 +175,91 @@ public class WmsPlcController extends BaseController {
}
j.setMsg(message);
return j;
}
public void run(String id,String comNo,String stepNum){
if(stepNum.equals("0")){
return;
}
WmsPlcEntity wmsPlc = null ;
if(StringUtil.isNotEmpty(id)){
wmsPlc = systemService.getEntity(WmsPlcEntity.class,id);
}
if(StringUtil.isNotEmpty(comNo)){
String hql = "";
List<WmsPlcEntity> wmsPlcEntityList = new ArrayList<WmsPlcEntity>();
hql = "from WmsPlcEntity t where t.comNo = ? ";
wmsPlcEntityList = systemService.findHql(hql,comNo);
if(!CollectionUtils.isEmpty(wmsPlcEntityList)){
wmsPlc = wmsPlcEntityList.get(0);
}
}
if(wmsPlc != null){
long start = System.currentTimeMillis();
SiemensPLCS siemensPLCS = SiemensPLCS.S200Smart;
SiemensS7Net siemensS7Net = null;
siemensS7Net = new SiemensS7Net(siemensPLCS);
siemensS7Net.setIpAddress(wmsPlc.getPlcIp());
siemensS7Net.setPort(Integer.parseInt(wmsPlc.getPlcPort()) );
OperateResult connect = siemensS7Net.ConnectServer();
if(connect.IsSuccess){
System.out.println("connect success");
}else{
System.out.println("connect error");
}
String comCons = wmsPlc.getComCons();
String query01 = wmsPlc.getQuery01();
String query02 = wmsPlc.getQuery02();
Float stepNumrun = Float.valueOf("1");
if(StringUtil.isNotEmpty(stepNum)){
stepNumrun =Float.parseFloat(stepNum);
}else{
stepNumrun =Float.parseFloat(wmsPlc.getSetpNum());
}
Float stepTime = Float.parseFloat(wmsPlc.getSetpTime());
comCons = StringUtils.replace(comCons,"{query01}",query01);
comCons = StringUtils.replace(comCons,"{query02}",query02);
String[] coms = wmsPlc.getComCons().split(";");
for (String com : coms) {
try {
Thread.sleep(500);
}catch (Exception e){
e.printStackTrace();
}
String[] split = com.split(",");
String defaultAddress = split[1];
if(split[0].equals("boolean")){
if(split[2].equals("false")){
siemensS7Net.Write(defaultAddress,false);
}else{
siemensS7Net.Write(defaultAddress,true);
}
}
else if(split[0].equals("float")){
Float runfloat = Float.parseFloat(split[2]) * stepNumrun;
siemensS7Net.Write(defaultAddress,runfloat);
}
}
//执行完指令等待时间
try{
Float sleeptime = Math.abs(stepNumrun * stepTime) ;
Thread.sleep(sleeptime.longValue());
}catch (Exception e){
e.printStackTrace();
}
long end = System.currentTimeMillis();
long times = end - start;
org.jeecgframework.core.util.LogUtil.info(wmsPlc.getComRemark()+"总耗时" + times + "毫秒"+wmsPlc.getComCons());
}
}
/**
* PLC

View File

@ -22,7 +22,7 @@ import org.jeecgframework.poi.excel.annotation.Excel;
* @Title: Entity
* @Description: PLC
* @author onlineGenerator
* @date 2022-09-12 18:33:25
* @date 2022-10-22 10:15:15
* @version V1.0
*
*/
@ -30,7 +30,7 @@ import org.jeecgframework.poi.excel.annotation.Excel;
@Table(name = "wms_plc", schema = "")
@SuppressWarnings("serial")
public class WmsPlcEntity implements java.io.Serializable {
/**主键*/
/**id*/
private String id;
/**创建人名称*/
private String createName;
@ -74,10 +74,25 @@ public class WmsPlcEntity implements java.io.Serializable {
/**备用1*/
@Excel(name="备用1")
private String remark1;
/**指令编号*/
@Excel(name="指令编号")
private String comNo;
/**单步参数1*/
@Excel(name="单步参数1")
private String query01;
/**单步参数2*/
@Excel(name="单步参数2")
private String query02;
/**单步时间*/
@Excel(name="单步时间")
private String setpTime;
/**步数*/
@Excel(name="步数")
private String setpNum;
/**
*: java.lang.String
*@return: java.lang.String
*@return: java.lang.String id
*/
@Id
@GeneratedValue(generator = "paymentableGenerator")
@ -89,7 +104,7 @@ public class WmsPlcEntity implements java.io.Serializable {
/**
*: java.lang.String
*@param: java.lang.String
*@param: java.lang.String id
*/
public void setId(String id){
this.id = id;
@ -130,7 +145,7 @@ public class WmsPlcEntity implements java.io.Serializable {
*: java.util.Date
*@return: java.util.Date
*/
@Column(name ="CREATE_DATE",nullable=true,length=20)
@Column(name ="CREATE_DATE",nullable=true)
public Date getCreateDate(){
return this.createDate;
}
@ -178,7 +193,7 @@ public class WmsPlcEntity implements java.io.Serializable {
*: java.util.Date
*@return: java.util.Date
*/
@Column(name ="UPDATE_DATE",nullable=true,length=20)
@Column(name ="UPDATE_DATE",nullable=true)
public Date getUpdateDate(){
return this.updateDate;
}
@ -338,7 +353,7 @@ public class WmsPlcEntity implements java.io.Serializable {
*: java.lang.String
*@return: java.lang.String
*/
@Column(name ="COM_CONS",nullable=true,length=32)
@Column(name ="COM_CONS",nullable=true)
public String getComCons(){
return this.comCons;
}
@ -366,4 +381,84 @@ public class WmsPlcEntity implements java.io.Serializable {
public void setRemark1(String remark1){
this.remark1 = remark1;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
@Column(name ="COM_NO",nullable=true,length=32)
public String getComNo(){
return this.comNo;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setComNo(String comNo){
this.comNo = comNo;
}
/**
*: java.lang.String
*@return: java.lang.String 1
*/
@Column(name ="QUERY01",nullable=true,length=32)
public String getQuery01(){
return this.query01;
}
/**
*: java.lang.String
*@param: java.lang.String 1
*/
public void setQuery01(String query01){
this.query01 = query01;
}
/**
*: java.lang.String
*@return: java.lang.String 2
*/
@Column(name ="QUERY02",nullable=true,length=32)
public String getQuery02(){
return this.query02;
}
/**
*: java.lang.String
*@param: java.lang.String 2
*/
public void setQuery02(String query02){
this.query02 = query02;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
@Column(name ="SETP_TIME",nullable=true,length=32)
public String getSetpTime(){
return this.setpTime;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setSetpTime(String setpTime){
this.setpTime = setpTime;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
@Column(name ="SETP_NUM",nullable=true,length=32)
public String getSetpNum(){
return this.setpNum;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setSetpNum(String setpNum){
this.setpNum = setpNum;
}
}

View File

@ -0,0 +1,231 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@include file="/context/mytags.jsp" %>
<t:base type="jquery,easyui,tools,DatePicker"></t:base>
<div class="easyui-layout" fit="true">
<div style="padding:0px;border:0px">
<%-- <div style="margin-left:100px"> 桃红色标识此储位有货,淡绿色标识此储位为空</div>--%>
<div name="searchColums" style="float: left; padding-left: 0px;padding-top: 5px;">
<span style="vertical-align:middle;display:-moz-inline-box;display:inline-block;width: 90px;text-align:right;"
title="仓库">仓库: </span>
<input type="text" name="cangku" value="agv" style="width: 100px; height: 30px;">
</span>
<span style="vertical-align:middle;display:-moz-inline-box;display:inline-block;width: 90px;text-align:right;"
title="开始">开始: </span>
<input type="text" id = "chuweiid" name="chuwei" style="width: 80px; height: 30px;">
</span>
<span style="vertical-align:middle;display:-moz-inline-box;display:inline-block;width: 90px;text-align:right;"
title="结束">结束: </span>
<input type="text" id = "desid" name="des" style="width: 80px; height: 30px;">
</span>
<span style="vertical-align:middle;display:-moz-inline-box;display:inline-block;width: 90px;text-align:right;"
title="层数">层数: </span>
<input type="text" name="cengshu" value="01" style="width: 20px; height: 30px;">
</span>
<span style="vertical-align:middle;display:-moz-inline-box;display:inline-block;width: 90px;text-align:right;"
title="行数">行数: </span>
<input type="text" name="hangshu" value="03" style="width: 20px; height: 30px;">
</span>
<span style="vertical-align:middle;display:-moz-inline-box;display:inline-block;width: 90px;text-align:right;"
title="列数">列数: </span>
<input type="text" name="lieshu" value="03" style="width: 20px; height: 30px;">
</span>
<span style="vertical-align:middle;display:-moz-inline-box;display:inline-block;width: 90px;text-align:right;">
<button onclick="chaxun('zhengxiang')">查询</button> </span>
<button onclick="chaxun('fanxiang')">调度</button> </span>
</div>
</div>
<div id="bottom" style="margin-top:60px;border:2px">
</div>
</div>
<style type="text/css">
#bottom{
/*width: 1000px;*/
/*background: red;*/
/*width: 100%;*/
}
a.a01:link, a.a01:visited {
font-size: 12px;
font-family: verdana;
/*width: 90px;*/
margin: 1px;
color: #1A1A1A;
display: inline-table;
background-color: #FF4040;
}
a.a01:active, a.a01:hover {
font-size: 12px;
font-family: verdana;
/*width: 90px;*/
margin: 1px;
color: #1A1A1A;
display: inline-table;
}
a.a02:link, a.a01:visited {
font-size: 12px;
font-family: verdana;
/*width: 90px;*/
margin: 1px;
color: #1A1A1A;
display: inline-table;
background-color: #66CD00;
}
a.a02:active, a.a01:hover {
font-size: 12px;
font-family: verdana;
/*width: 90px;*/
margin: 1px;
color: #1A1A1A;
display: inline-table;
}
.all{
/*display: inline-block;*/
width: 160.5px;
height:160.5px;
line-height: 160.5px;
text-align: center;
margin-right: 1px;
margin-bottom: 1px;
}
#bottom{
display: flex;
flex-wrap: wrap;
margin: auto;
}
</style>
<script type="text/javascript">
function addtab(name) {
var binid = document.getElementById("chuweiid").value
if(!binid){
document.getElementById("chuweiid").value = name;
}else{
document.getElementById("desid").value =name;
}
}
$(document).ready(function () {
chaxun();
// $("#mvCusCostListtb").find("input[name='outtime_begin']").attr("class","Wdate").click(function(){WdatePicker({dateFmt:'yyyy-MM-dd'});});
// $("#mvCusCostListtb").find("input[name='outtime_end']").attr("class","Wdate").click(function(){WdatePicker({dateFmt:'yyyy-MM-dd'});});
});
function chaxun(type) {
var cangku;
var chuwei;
var des;
cangku = $('input[name="cangku"]').attr("value");
chuwei = $('input[name="chuwei"]').attr("value");
var hangshu = $('input[name="hangshu"]').attr("value") * 1;
var lieshu = $('input[name="lieshu"]').attr("value") * 1;
var cengshu = $('input[name="cengshu"]').attr("value");
des = $('input[name="des"]').attr("value");
//加载消息
var url = "mdBinController.do?getbinallagv&binstore=" + cangku + "&binid=" + chuwei + "&des=" + des+ "&cengshu=" + cengshu+ "&hangshu=" + hangshu+ "&type=" + type;
$.ajax({
url: url,
type: "GET",
dataType: "JSON",
async: false,
success: function (data) {
if (data.success) {
var messageList = data.attributes.messageList;
var messageCount = data.obj;
var messageContent = "";
var tincount = 0;
if (messageList.length > 0) {
let num = hangshu * lieshu +1; // 行数乘以列数 计算一共有多少格子
let obj ={
bin_store: "",
binid: "",
colour: "white",
des: "",
tincount: "",
xnode: "",
ynode: "",
znode: "",
} ;// 创建一个空数字 用于填充空格子(因为空格子后台不返回 前端循环渲染需要填充数据)
let list = []; // 创建数组填充所有格子
//循环填充数组
for(let s = 0 ; s < num ; s ++){
list.push(obj);
}
for(let o = 0; o < messageList.length; o++){
if(messageList[o].ynode*1 == 1){
console.log(messageList[o].ynode*1 * messageList[o].xnode*1 )
list[messageList[o].ynode*1 * messageList[o].xnode*1 ] = messageList[o]
}
else{
console.log((messageList[o].ynode*1 - 1) * hangshu*1 + messageList[o].xnode*1)
list[(messageList[o].ynode*1 - 1) * hangshu*1 + messageList[o].xnode*1 ] = messageList[o]
}
}
// console.log(list)
//计算宽度
var width = 170.5 * hangshu*1
$("#bottom").css("width",width);
for (let i = 1; i < list.length; i++) {
messageContent += " <div class='all' href='javascript:void(0);' style='background:" +list[i].colour+"' id='" +list[i].binid+"' onclick='javascript:addtab(\"" + list[i].binid + "\")';return false;'>";
messageContent += list[i].tincount+ " </div> ";
// tincount = list[i].tincount + 0;
// if (tincount > 0) {
// messageContent += " <a class='a01 all' href='javascript:void(0);' onclick='javascript:addtab(\"" + list[i].des + "\")';return false;'>";
// messageContent += list[i].binid + " </a> ";
//
// } else {
// messageContent += " <a class='a02 all' href='javascript:void(0);' >";
// messageContent += list[i].binid + " </a> ";
//
// }
}
// var aList = $('.all')
// console.log(aList)
// for (var i = 0; i < messageList.length; i++) {
// tincount = messageList[i].tincount + 0;
// if (tincount > 0) {
// messageContent += " <a class='a01' href='javascript:void(0);' onclick='javascript:addtab(\"" + messageList[i].des + "\")';return false;'>";
// messageContent += messageList[i].binid + " </a> ";
//
// } else {
// messageContent += " <a class='a02' href='javascript:void(0);' >";
// messageContent += messageList[i].binid + " </a> ";
//
// }
// }
}
$("#bottom").html(messageContent);
// console.dir(messageContent);
}
}
});
}
function print(id) {
if (begindate == "" || enddate == "") {
alert("开始或者结束日期不能为空");
} else {
var url = "mvCusCostController.do?doPrint&id=" + id + "&begindate=" + begindate + "&enddate=" + enddate;
window.open(url);
}
}
</script>

View File

@ -1,206 +1,222 @@
<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<html>
<head>
<title>PLC指令</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="online/template/ledefault/css/vendor.css">
<link rel="stylesheet" href="online/template/ledefault/css/bootstrap-theme.css">
<link rel="stylesheet" href="online/template/ledefault/css/bootstrap.css">
<link rel="stylesheet" href="online/template/ledefault/css/app.css">
<link rel="stylesheet" href="plug-in/Validform/css/metrole/style.css" type="text/css"/>
<link rel="stylesheet" href="plug-in/Validform/css/metrole/tablefrom.css" type="text/css"/>
<script type="text/javascript" src="plug-in/jquery/jquery-1.8.3.js"></script>
<script type="text/javascript" src="plug-in/tools/dataformat.js"></script>
<script type="text/javascript" src="plug-in/easyui/jquery.easyui.min.1.3.2.js"></script>
<script type="text/javascript" src="plug-in/easyui/locale/zh-cn.js"></script>
<script type="text/javascript" src="plug-in/tools/syUtil.js"></script>
<script type="text/javascript" src="plug-in/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="plug-in/lhgDialog/lhgdialog.min.js"></script>
<script type="text/javascript" src="plug-in/tools/curdtools_zh-cn.js"></script>
<script type="text/javascript" src="plug-in/tools/easyuiextend.js"></script>
<script type="text/javascript" src="plug-in/Validform/js/Validform_v5.3.1_min_zh-cn.js"></script>
<script type="text/javascript" src="plug-in/Validform/js/Validform_Datatype_zh-cn.js"></script>
<script type="text/javascript" src="plug-in/Validform/js/datatype_zh-cn.js"></script>
<script type="text/javascript" src="plug-in/Validform/plugin/passwordStrength/passwordStrength-min.js"></script>
<script type="text/javascript" charset="utf-8" src="plug-in/ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="plug-in/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript">
<t:base type="jquery,easyui,tools,DatePicker"></t:base>
<script type="text/javascript">
//编写自定义JS代码
</script>
</head>
</head>
<body>
<t:formvalid formid="formobj" dialog="true" usePlugin="password" layout="table" action="wmsPlcController.do?doAdd" tiptype="1" >
<input type="hidden" id="btn_sub" class="btn_sub"/>
<input type="hidden" id="id" name="id"/>
<div class="tab-wrapper">
<!-- tab -->
<ul class="nav nav-tabs">
<li role="presentation" class="active"><a href="javascript:void(0);">PLC指令</a></li>
</ul>
<!-- tab内容 -->
<div class="con-wrapper" id="con-wrapper1" style="display: block;">
<div class="row form-wrapper">
<div class="row show-grid">
<div class="col-xs-3 text-center">
<b>PLCIP</b>
</div>
<div class="col-xs-3">
<input id="plcIp" name="plcIp" type="text" class="form-control"
ignore="ignore"
/>
<span class="Validform_checktip" style="float:left;height:0px;"></span>
<label class="Validform_label" style="display: none">PLCIP</label>
</div>
</div>
<div class="row show-grid">
<div class="col-xs-3 text-center">
<b>PLC端口</b>
</div>
<div class="col-xs-3">
<input id="plcPort" name="plcPort" type="text" class="form-control"
ignore="ignore"
/>
<span class="Validform_checktip" style="float:left;height:0px;"></span>
<label class="Validform_label" style="display: none">PLC端口</label>
</div>
</div>
<div class="row show-grid">
<div class="col-xs-3 text-center">
<b>PLC型号</b>
</div>
<div class="col-xs-3">
<input id="plcType" name="plcType" type="text" class="form-control"
ignore="ignore"
/>
<span class="Validform_checktip" style="float:left;height:0px;"></span>
<label class="Validform_label" style="display: none">PLC型号</label>
</div>
</div>
<div class="row show-grid">
<div class="col-xs-3 text-center">
<b>指令备注:</b>
</div>
<div class="col-xs-3">
<input id="comRemark" name="comRemark" type="text" class="form-control"
ignore="ignore"
/>
<span class="Validform_checktip" style="float:left;height:0px;"></span>
<label class="Validform_label" style="display: none">指令备注</label>
</div>
</div>
<div class="row show-grid">
<div class="col-xs-3 text-center">
<b>执行时间:</b>
</div>
<div class="col-xs-3">
<input id="comTime" name="comTime" type="text" class="form-control"
ignore="ignore"
/>
<span class="Validform_checktip" style="float:left;height:0px;"></span>
<label class="Validform_label" style="display: none">执行时间</label>
</div>
</div>
<div class="row show-grid">
<div class="col-xs-3 text-center">
<b>执行顺序:</b>
</div>
<div class="col-xs-3">
<input id="comSeq" name="comSeq" type="text" class="form-control"
ignore="ignore"
/>
<span class="Validform_checktip" style="float:left;height:0px;"></span>
<label class="Validform_label" style="display: none">执行顺序</label>
</div>
</div>
<div class="row show-grid">
<div class="col-xs-3 text-center">
<b>指令集:</b>
</div>
<div class="col-xs-3">
<textarea id="comCons" class="form-control" rows="6"
ignore="ignore"
name="comCons"></textarea>
<span class="Validform_checktip" style="float:left;height:0px;"></span>
<label class="Validform_label" style="display: none">指令集</label>
</div>
</div>
<div class="row show-grid">
<div class="col-xs-3 text-center">
<b>备用1</b>
</div>
<div class="col-xs-3">
<input id="remark1" name="remark1" type="text" class="form-control"
ignore="ignore"
/>
<span class="Validform_checktip" style="float:left;height:0px;"></span>
<label class="Validform_label" style="display: none">备用1</label>
</div>
</div>
<div class="row" id = "sub_tr" style="display: none;">
<div class="col-xs-12 layout-header">
<div class="col-xs-6"></div>
<div class="col-xs-6"><button type="button" onclick="neibuClick();" class="btn btn-default">提交</button></div>
</div>
</div>
</div>
</div>
<div class="con-wrapper" id="con-wrapper2" style="display: block;"></div>
</div>
</t:formvalid>
<script type="text/javascript">
$(function(){
//查看模式情况下,删除和上传附件功能禁止使用
if(location.href.indexOf("load=detail")!=-1){
$(".jeecgDetail").hide();
}
if(location.href.indexOf("mode=read")!=-1){
//查看模式控件禁用
$("#formobj").find(":input").attr("disabled","disabled");
}
if(location.href.indexOf("mode=onbutton")!=-1){
//其他模式显示提交按钮
$("#sub_tr").show();
}
});
var neibuClickFlag = false;
function neibuClick() {
neibuClickFlag = true;
$('#btn_sub').trigger('click');
}
</script>
<t:formvalid formid="formobj" dialog="true" usePlugin="password" layout="table" action="wmsPlcController.do?doAdd" >
<input id="id" name="id" type="hidden" value="${wmsPlcPage.id }"/>
<input id="createName" name="createName" type="hidden" value="${wmsPlcPage.createName }"/>
<input id="createBy" name="createBy" type="hidden" value="${wmsPlcPage.createBy }"/>
<input id="createDate" name="createDate" type="hidden" value="${wmsPlcPage.createDate }"/>
<input id="updateName" name="updateName" type="hidden" value="${wmsPlcPage.updateName }"/>
<input id="updateBy" name="updateBy" type="hidden" value="${wmsPlcPage.updateBy }"/>
<input id="updateDate" name="updateDate" type="hidden" value="${wmsPlcPage.updateDate }"/>
<input id="sysOrgCode" name="sysOrgCode" type="hidden" value="${wmsPlcPage.sysOrgCode }"/>
<input id="sysCompanyCode" name="sysCompanyCode" type="hidden" value="${wmsPlcPage.sysCompanyCode }"/>
<input id="bpmStatus" name="bpmStatus" type="hidden" value="${wmsPlcPage.bpmStatus }"/>
<table style="width: 600px;" cellpadding="0" cellspacing="1" class="formtable">
<tr>
<td align="right">
<label class="Validform_label">
PLCIP:
</label>
</td>
<td class="value">
<input id="plcIp" name="plcIp" type="text" style="width: 150px" class="inputxt"
ignore="ignore"
/>
<span class="Validform_checktip"></span>
<label class="Validform_label" style="display: none;">PLCIP</label>
</td>
<tr>
<td align="right">
<label class="Validform_label">
PLC端口:
</label>
</td>
<td class="value">
<input id="plcPort" name="plcPort" type="text" style="width: 150px" class="inputxt"
ignore="ignore"
/>
<span class="Validform_checktip"></span>
<label class="Validform_label" style="display: none;">PLC端口</label>
</td>
</tr>
<tr>
<td align="right">
<label class="Validform_label">
PLC型号:
</label>
</td>
<td class="value">
<input id="plcType" name="plcType" type="text" style="width: 150px" class="inputxt"
ignore="ignore"
/>
<span class="Validform_checktip"></span>
<label class="Validform_label" style="display: none;">PLC型号</label>
</td>
<tr>
<td align="right">
<label class="Validform_label">
指令备注:
</label>
</td>
<td class="value">
<input id="comRemark" name="comRemark" type="text" style="width: 150px" class="inputxt"
ignore="ignore"
/>
<span class="Validform_checktip"></span>
<label class="Validform_label" style="display: none;">指令备注</label>
</td>
</tr>
<tr>
<td align="right">
<label class="Validform_label">
执行时间:
</label>
</td>
<td class="value">
<input id="comTime" name="comTime" type="text" style="width: 150px" class="inputxt"
ignore="ignore"
/>
<span class="Validform_checktip"></span>
<label class="Validform_label" style="display: none;">执行时间</label>
</td>
<tr>
<td align="right">
<label class="Validform_label">
执行顺序:
</label>
</td>
<td class="value">
<input id="comSeq" name="comSeq" type="text" style="width: 150px" class="inputxt"
ignore="ignore"
/>
<span class="Validform_checktip"></span>
<label class="Validform_label" style="display: none;">执行顺序</label>
</td>
</tr>
<tr>
<td align="right">
<label class="Validform_label">
指令集:
</label>
</td>
<td class="value">
<textarea style="width:600px;" class="inputxt" rows="6" id="comCons" name="comCons"
ignore="ignore"
></textarea>
<span class="Validform_checktip"></span>
<label class="Validform_label" style="display: none;">指令集</label>
</td>
<tr>
<td align="right">
<label class="Validform_label">
备用1:
</label>
</td>
<td class="value">
<input id="remark1" name="remark1" type="text" style="width: 150px" class="inputxt"
ignore="ignore"
/>
<span class="Validform_checktip"></span>
<label class="Validform_label" style="display: none;">备用1</label>
</td>
</tr>
<tr>
<td align="right">
<label class="Validform_label">
指令编号:
</label>
</td>
<td class="value">
<input id="comNo" name="comNo" type="text" style="width: 150px" class="inputxt"
ignore="ignore"
/>
<span class="Validform_checktip"></span>
<label class="Validform_label" style="display: none;">指令编号</label>
</td>
<tr>
<td align="right">
<label class="Validform_label">
单步参数1:
</label>
</td>
<td class="value">
<input id="query01" name="query01" type="text" style="width: 150px" class="inputxt"
ignore="ignore"
/>
<span class="Validform_checktip"></span>
<label class="Validform_label" style="display: none;">单步参数1</label>
</td>
</tr>
<tr>
<td align="right">
<label class="Validform_label">
单步参数2:
</label>
</td>
<td class="value">
<input id="query02" name="query02" type="text" style="width: 150px" class="inputxt"
ignore="ignore"
/>
<span class="Validform_checktip"></span>
<label class="Validform_label" style="display: none;">单步参数2</label>
</td>
<tr>
<td align="right">
<label class="Validform_label">
单步时间:
</label>
</td>
<td class="value">
<input id="setpTime" name="setpTime" type="text" style="width: 150px" class="inputxt"
ignore="ignore"
/>
<span class="Validform_checktip"></span>
<label class="Validform_label" style="display: none;">单步时间</label>
</td>
</tr>
<tr>
<td align="right">
<label class="Validform_label">
步数:
</label>
</td>
<td class="value">
<input id="setpNum" name="setpNum" type="text" style="width: 150px" class="inputxt"
ignore="ignore"
/>
<span class="Validform_checktip"></span>
<label class="Validform_label" style="display: none;">步数</label>
</td>
<td align="right">
<label class="Validform_label">
</label>
</td>
<td class="value">
</td>
</tr>
</table>
</t:formvalid>
</body>
<script src = "webpage/com/zzjee/plc/wmsPlc.js"></script>
</html>
<script src = "webpage/com/zzjee/plc/wmsPlc.js"></script>

View File

@ -1,206 +1,210 @@
<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<html>
<head>
<title>PLC指令</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="online/template/ledefault/css/vendor.css">
<link rel="stylesheet" href="online/template/ledefault/css/bootstrap-theme.css">
<link rel="stylesheet" href="online/template/ledefault/css/bootstrap.css">
<link rel="stylesheet" href="online/template/ledefault/css/app.css">
<link rel="stylesheet" href="plug-in/Validform/css/metrole/style.css" type="text/css"/>
<link rel="stylesheet" href="plug-in/Validform/css/metrole/tablefrom.css" type="text/css"/>
<script type="text/javascript" src="plug-in/jquery/jquery-1.8.3.js"></script>
<script type="text/javascript" src="plug-in/tools/dataformat.js"></script>
<script type="text/javascript" src="plug-in/easyui/jquery.easyui.min.1.3.2.js"></script>
<script type="text/javascript" src="plug-in/easyui/locale/zh-cn.js"></script>
<script type="text/javascript" src="plug-in/tools/syUtil.js"></script>
<script type="text/javascript" src="plug-in/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="plug-in/lhgDialog/lhgdialog.min.js"></script>
<script type="text/javascript" src="plug-in/tools/curdtools_zh-cn.js"></script>
<script type="text/javascript" src="plug-in/tools/easyuiextend.js"></script>
<script type="text/javascript" src="plug-in/Validform/js/Validform_v5.3.1_min_zh-cn.js"></script>
<script type="text/javascript" src="plug-in/Validform/js/Validform_Datatype_zh-cn.js"></script>
<script type="text/javascript" src="plug-in/Validform/js/datatype_zh-cn.js"></script>
<script type="text/javascript" src="plug-in/Validform/plugin/passwordStrength/passwordStrength-min.js"></script>
<script type="text/javascript" charset="utf-8" src="plug-in/ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="plug-in/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript">
<t:base type="jquery,easyui,tools,DatePicker"></t:base>
<script type="text/javascript">
//编写自定义JS代码
</script>
</head>
</head>
<body>
<t:formvalid formid="formobj" dialog="true" usePlugin="password" layout="table" action="wmsPlcController.do?doUpdate" tiptype="1" >
<input type="hidden" id="btn_sub" class="btn_sub"/>
<input type="hidden" name="id" value='${wmsPlcPage.id}' >
<div class="tab-wrapper">
<!-- tab -->
<ul class="nav nav-tabs">
<li role="presentation" class="active"><a href="javascript:void(0);">PLC指令</a></li>
</ul>
<!-- tab内容 -->
<div class="con-wrapper" id="con-wrapper1" style="display: block;">
<div class="row form-wrapper">
<div class="row show-grid">
<div class="col-xs-3 text-center">
<b>PLCIP</b>
</div>
<div class="col-xs-3">
<input id="plcIp" name="plcIp" type="text" class="form-control"
ignore="ignore"
value='${wmsPlcPage.plcIp}' />
<span class="Validform_checktip" style="float:left;height:0px;"></span>
<label class="Validform_label" style="display: none">PLCIP</label>
</div>
</div>
<div class="row show-grid">
<div class="col-xs-3 text-center">
<b>PLC端口</b>
</div>
<div class="col-xs-3">
<input id="plcPort" name="plcPort" type="text" class="form-control"
ignore="ignore"
value='${wmsPlcPage.plcPort}' />
<span class="Validform_checktip" style="float:left;height:0px;"></span>
<label class="Validform_label" style="display: none">PLC端口</label>
</div>
</div>
<div class="row show-grid">
<div class="col-xs-3 text-center">
<b>PLC型号</b>
</div>
<div class="col-xs-3">
<input id="plcType" name="plcType" type="text" class="form-control"
ignore="ignore"
value='${wmsPlcPage.plcType}' />
<span class="Validform_checktip" style="float:left;height:0px;"></span>
<label class="Validform_label" style="display: none">PLC型号</label>
</div>
</div>
<div class="row show-grid">
<div class="col-xs-3 text-center">
<b>指令备注:</b>
</div>
<div class="col-xs-3">
<input id="comRemark" name="comRemark" type="text" class="form-control"
ignore="ignore"
value='${wmsPlcPage.comRemark}' />
<span class="Validform_checktip" style="float:left;height:0px;"></span>
<label class="Validform_label" style="display: none">指令备注</label>
</div>
</div>
<div class="row show-grid">
<div class="col-xs-3 text-center">
<b>执行时间:</b>
</div>
<div class="col-xs-3">
<input id="comTime" name="comTime" type="text" class="form-control"
ignore="ignore"
value='${wmsPlcPage.comTime}' />
<span class="Validform_checktip" style="float:left;height:0px;"></span>
<label class="Validform_label" style="display: none">执行时间</label>
</div>
</div>
<div class="row show-grid">
<div class="col-xs-3 text-center">
<b>执行顺序:</b>
</div>
<div class="col-xs-3">
<input id="comSeq" name="comSeq" type="text" class="form-control"
ignore="ignore"
value='${wmsPlcPage.comSeq}' />
<span class="Validform_checktip" style="float:left;height:0px;"></span>
<label class="Validform_label" style="display: none">执行顺序</label>
</div>
</div>
<div class="row show-grid">
<div class="col-xs-3 text-center">
<b>指令集:</b>
</div>
<div class="col-xs-3">
<textarea id="comCons" class="form-control" rows="6"
ignore="ignore"
name="comCons">${wmsPlcPage.comCons}</textarea>
<span class="Validform_checktip" style="float:left;height:0px;"></span>
<label class="Validform_label" style="display: none">指令集</label>
</div>
</div>
<div class="row show-grid">
<div class="col-xs-3 text-center">
<b>备用1</b>
</div>
<div class="col-xs-3">
<input id="remark1" name="remark1" type="text" class="form-control"
ignore="ignore"
value='${wmsPlcPage.remark1}' />
<span class="Validform_checktip" style="float:left;height:0px;"></span>
<label class="Validform_label" style="display: none">备用1</label>
</div>
</div>
<div class="row" id = "sub_tr" style="display: none;">
<div class="col-xs-12 layout-header">
<div class="col-xs-6"></div>
<div class="col-xs-6"><button type="button" onclick="neibuClick();" class="btn btn-default">提交</button></div>
</div>
</div>
</div>
</div>
<div class="con-wrapper" id="con-wrapper2" style="display: block;"></div>
</div>
</t:formvalid>
<script type="text/javascript">
$(function(){
//查看模式情况下,删除和上传附件功能禁止使用
if(location.href.indexOf("load=detail")!=-1){
$(".jeecgDetail").hide();
}
if(location.href.indexOf("mode=read")!=-1){
//查看模式控件禁用
$("#formobj").find(":input").attr("disabled","disabled");
}
if(location.href.indexOf("mode=onbutton")!=-1){
//其他模式显示提交按钮
$("#sub_tr").show();
}
});
var neibuClickFlag = false;
function neibuClick() {
neibuClickFlag = true;
$('#btn_sub').trigger('click');
}
</script>
<t:formvalid formid="formobj" dialog="true" usePlugin="password" layout="table" action="wmsPlcController.do?doUpdate" >
<input id="id" name="id" type="hidden" value="${wmsPlcPage.id }">
<input id="createName" name="createName" type="hidden" value="${wmsPlcPage.createName }">
<input id="createBy" name="createBy" type="hidden" value="${wmsPlcPage.createBy }">
<input id="createDate" name="createDate" type="hidden" value="${wmsPlcPage.createDate }">
<input id="updateName" name="updateName" type="hidden" value="${wmsPlcPage.updateName }">
<input id="updateBy" name="updateBy" type="hidden" value="${wmsPlcPage.updateBy }">
<input id="updateDate" name="updateDate" type="hidden" value="${wmsPlcPage.updateDate }">
<input id="sysOrgCode" name="sysOrgCode" type="hidden" value="${wmsPlcPage.sysOrgCode }">
<input id="sysCompanyCode" name="sysCompanyCode" type="hidden" value="${wmsPlcPage.sysCompanyCode }">
<input id="bpmStatus" name="bpmStatus" type="hidden" value="${wmsPlcPage.bpmStatus }">
<table style="width: 600px;" cellpadding="0" cellspacing="1" class="formtable">
<tr>
<td align="right">
<label class="Validform_label">
PLCIP:
</label>
</td>
<td class="value">
<input id="plcIp" name="plcIp" type="text" style="width: 150px" class="inputxt"
ignore="ignore"
value='${wmsPlcPage.plcIp}'>
<span class="Validform_checktip"></span>
<label class="Validform_label" style="display: none;">PLCIP</label>
</td>
<tr>
<td align="right">
<label class="Validform_label">
PLC端口:
</label>
</td>
<td class="value">
<input id="plcPort" name="plcPort" type="text" style="width: 150px" class="inputxt"
ignore="ignore"
value='${wmsPlcPage.plcPort}'>
<span class="Validform_checktip"></span>
<label class="Validform_label" style="display: none;">PLC端口</label>
</td>
</tr>
<tr>
<td align="right">
<label class="Validform_label">
PLC型号:
</label>
</td>
<td class="value">
<input id="plcType" name="plcType" type="text" style="width: 150px" class="inputxt"
ignore="ignore"
value='${wmsPlcPage.plcType}'>
<span class="Validform_checktip"></span>
<label class="Validform_label" style="display: none;">PLC型号</label>
</td>
<tr>
<td align="right">
<label class="Validform_label">
指令备注:
</label>
</td>
<td class="value">
<input id="comRemark" name="comRemark" type="text" style="width: 150px" class="inputxt"
ignore="ignore"
value='${wmsPlcPage.comRemark}'>
<span class="Validform_checktip"></span>
<label class="Validform_label" style="display: none;">指令备注</label>
</td>
</tr>
<tr>
<td align="right">
<label class="Validform_label">
执行时间:
</label>
</td>
<td class="value">
<input id="comTime" name="comTime" type="text" style="width: 150px" class="inputxt"
ignore="ignore"
value='${wmsPlcPage.comTime}'>
<span class="Validform_checktip"></span>
<label class="Validform_label" style="display: none;">执行时间</label>
</td>
<tr>
<td align="right">
<label class="Validform_label">
执行顺序:
</label>
</td>
<td class="value">
<input id="comSeq" name="comSeq" type="text" style="width: 150px" class="inputxt"
ignore="ignore"
value='${wmsPlcPage.comSeq}'>
<span class="Validform_checktip"></span>
<label class="Validform_label" style="display: none;">执行顺序</label>
</td>
</tr>
<tr>
<td align="right">
<label class="Validform_label">
指令集:
</label>
</td>
<td class="value">
<textarea id="comCons" style="width:600px;" class="inputxt" rows="6" name="comCons"
ignore="ignore"
>${wmsPlcPage.comCons}</textarea>
<span class="Validform_checktip"></span>
<label class="Validform_label" style="display: none;">指令集</label>
</td>
<tr>
<td align="right">
<label class="Validform_label">
备用1:
</label>
</td>
<td class="value">
<input id="remark1" name="remark1" type="text" style="width: 150px" class="inputxt"
ignore="ignore"
value='${wmsPlcPage.remark1}'>
<span class="Validform_checktip"></span>
<label class="Validform_label" style="display: none;">备用1</label>
</td>
</tr>
<tr>
<td align="right">
<label class="Validform_label">
指令编号:
</label>
</td>
<td class="value">
<input id="comNo" name="comNo" type="text" style="width: 150px" class="inputxt"
ignore="ignore"
value='${wmsPlcPage.comNo}'>
<span class="Validform_checktip"></span>
<label class="Validform_label" style="display: none;">指令编号</label>
</td>
<tr>
<td align="right">
<label class="Validform_label">
单步参数1:
</label>
</td>
<td class="value">
<input id="query01" name="query01" type="text" style="width: 150px" class="inputxt"
ignore="ignore"
value='${wmsPlcPage.query01}'>
<span class="Validform_checktip"></span>
<label class="Validform_label" style="display: none;">单步参数1</label>
</td>
</tr>
<tr>
<td align="right">
<label class="Validform_label">
单步参数2:
</label>
</td>
<td class="value">
<input id="query02" name="query02" type="text" style="width: 150px" class="inputxt"
ignore="ignore"
value='${wmsPlcPage.query02}'>
<span class="Validform_checktip"></span>
<label class="Validform_label" style="display: none;">单步参数2</label>
</td>
<tr>
<td align="right">
<label class="Validform_label">
单步时间:
</label>
</td>
<td class="value">
<input id="setpTime" name="setpTime" type="text" style="width: 150px" class="inputxt"
ignore="ignore"
value='${wmsPlcPage.setpTime}'>
<span class="Validform_checktip"></span>
<label class="Validform_label" style="display: none;">单步时间</label>
</td>
</tr>
<tr>
<td align="right">
<label class="Validform_label">
步数:
</label>
</td>
<td class="value">
<input id="setpNum" name="setpNum" type="text" style="width: 150px" class="inputxt"
ignore="ignore"
value='${wmsPlcPage.setpNum}'>
<span class="Validform_checktip"></span>
<label class="Validform_label" style="display: none;">步数</label>
</td>
<td align="right">
<label class="Validform_label">
</label>
</td>
<td class="value">
</td>
</tr>
</table>
</t:formvalid>
</body>
<script src = "webpage/com/zzjee/plc/wmsPlc.js"></script>
</html>
<script src = "webpage/com/zzjee/plc/wmsPlc.js"></script>

View File

@ -21,6 +21,10 @@ function commonUpload(callback){
}
});
}
function browseImages(inputId, Img) {// 图片管理器,可多个上传共用
}
function browseFiles(inputId, file) {// 文件管理器,可多个上传共用
}
function decode(value, id) {//value传入值,id接受值
var last = value.lastIndexOf("/");
var filename = value.substring(last + 1, value.length);

View File

@ -14,14 +14,19 @@
<t:dgCol title="所属部门" field="sysOrgCode" hidden="true" queryMode="single" width="120"></t:dgCol>
<t:dgCol title="所属公司" field="sysCompanyCode" hidden="true" queryMode="single" width="120"></t:dgCol>
<t:dgCol title="流程状态" field="bpmStatus" hidden="true" queryMode="single" dictionary="bpm_status" width="120"></t:dgCol>
<t:dgCol title="PLCIP" field="plcIp" query="true" queryMode="single" width="120"></t:dgCol>
<t:dgCol title="PLC端口" field="plcPort" query="true" queryMode="single" width="120"></t:dgCol>
<t:dgCol title="PLC型号" field="plcType" query="true" queryMode="single" width="120"></t:dgCol>
<t:dgCol title="指令备注" field="comRemark" query="true" queryMode="single" width="120"></t:dgCol>
<t:dgCol title="执行时间(毫秒)" field="comTime" queryMode="single" width="120"></t:dgCol>
<t:dgCol title="执行顺序" field="comSeq" queryMode="single" width="120"></t:dgCol>
<t:dgCol title="指令集" field="comCons" queryMode="single" width="120"></t:dgCol>
<t:dgCol title="备用1" field="remark1" queryMode="single" width="120"></t:dgCol>
<t:dgCol title="PLCIP" field="plcIp" queryMode="group" width="120"></t:dgCol>
<t:dgCol title="PLC端口" field="plcPort" queryMode="group" width="120"></t:dgCol>
<t:dgCol title="PLC型号" field="plcType" query="true" queryMode="group" width="120"></t:dgCol>
<t:dgCol title="指令备注" field="comRemark" query="true" queryMode="group" width="120"></t:dgCol>
<t:dgCol title="执行时间" field="comTime" queryMode="group" width="120"></t:dgCol>
<t:dgCol title="执行顺序" field="comSeq" queryMode="group" width="120"></t:dgCol>
<t:dgCol title="指令集" field="comCons" queryMode="group" width="120"></t:dgCol>
<t:dgCol title="备用1" field="remark1" queryMode="group" width="120"></t:dgCol>
<t:dgCol title="指令编号" field="comNo" query="true" queryMode="single" width="120"></t:dgCol>
<t:dgCol title="单步参数1" field="query01" queryMode="single" width="120"></t:dgCol>
<t:dgCol title="单步参数2" field="query02" queryMode="single" width="120"></t:dgCol>
<t:dgCol title="单步时间" field="setpTime" queryMode="single" width="120"></t:dgCol>
<t:dgCol title="步数" field="setpNum" queryMode="single" width="120"></t:dgCol>
<t:dgCol title="操作" field="opt" width="100"></t:dgCol>
<t:dgDelOpt title="删除" url="wmsPlcController.do?doDel&id={id}" urlclass="ace_button" urlfont="fa-trash-o"/>
<t:dgToolBar title="录入" icon="icon-add" url="wmsPlcController.do?goAdd" funname="add"></t:dgToolBar>