PLC调度

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

View File

@ -1,4 +1,5 @@
package com.zzjee.md.controller;
import java.io.IOException;
import java.net.URI;
import java.util.ArrayList;
@ -6,15 +7,19 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.validation.ConstraintViolation;
import javax.validation.Validator;
import com.zzjee.plc.controller.WmsPlcController;
import com.zzjee.rfid.entity.RfidBuseEntity;
import com.zzjee.wmutil.wmUtil;
import org.apache.log4j.Logger;
import org.apache.xmlbeans.impl.xb.xsdschema.Public;
import org.jeecgframework.core.beanvalidator.BeanValidators;
import org.jeecgframework.core.common.controller.BaseController;
import org.jeecgframework.core.common.exception.BusinessException;
@ -32,6 +37,7 @@ import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.entity.vo.NormalExcelConstants;
import org.jeecgframework.tag.core.easyui.TagUtil;
import org.jeecgframework.web.system.service.SystemService;
import org.omg.CORBA.PUBLIC_MEMBER;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
@ -58,12 +64,11 @@ import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
/**
* @author erzhongxmu
* @version V1.0
* @Title: Controller
* @Description:
* @author erzhongxmu
* @date 2017-08-15 23:17:02
* @version V1.0
*
*/
@Controller
@RequestMapping("/mdBinController")
@ -79,7 +84,9 @@ public class MdBinController extends BaseController {
private SystemService systemService;
@Autowired
private Validator validator;
@Autowired
private WmsPlcController wmsPlcController;
ExecutorService executor = Executors.newFixedThreadPool(8);
/**
@ -91,10 +98,17 @@ public class MdBinController extends BaseController {
public ModelAndView list(HttpServletRequest request) {
return new ModelAndView("com/zzjee/md/mdBinList");
}
@RequestMapping(params = "listc")
public ModelAndView listc(HttpServletRequest request) {
return new ModelAndView("com/zzjee/md/mdavabinlist");
}
@RequestMapping(params = "listagv")
public ModelAndView listagv(HttpServletRequest request) {
return new ModelAndView("com/zzjee/md/mdbinagvlist");
}
/**
* easyui AJAX
*
@ -104,13 +118,13 @@ public class MdBinController extends BaseController {
*/
@RequestMapping(params = "datagrid")
public void datagrid(MdBinEntity mdBin,HttpServletRequest request, HttpServletResponse response, DataGrid dataGrid) {
public void datagrid(MdBinEntity mdBin, HttpServletRequest request, HttpServletResponse response, DataGrid dataGrid) {
CriteriaQuery cq = new CriteriaQuery(MdBinEntity.class, dataGrid);
//查询条件组装器
org.jeecgframework.core.extend.hqlsearch.HqlGenerateUtil.installHql(cq, mdBin, request.getParameterMap());
try{
try {
//自定义追加查询条件
}catch (Exception e) {
} catch (Exception e) {
throw new BusinessException(e.getMessage());
}
cq.add();
@ -130,20 +144,20 @@ public class MdBinController extends BaseController {
AjaxJson j = new AjaxJson();
mdBin = systemService.getEntity(MdBinEntity.class, mdBin.getId());
message = "仓位停用成功";
try{
try {
if(wmUtil.checkishavestock("bin",mdBin.getKuWeiBianMa())){
if (wmUtil.checkishavestock("bin", mdBin.getKuWeiBianMa())) {
message = "仓位停用成功,但是存在库存";
j.setSuccess(false);
j.setMsg(message);
mdBin.setTingYong("Y");
mdBinService.saveOrUpdate(mdBin);
return j;
}else{
} else {
mdBinService.delete(mdBin);
}
systemService.addLog(message, Globals.Log_Type_DEL, Globals.Log_Leavel_INFO);
}catch(Exception e){
} catch (Exception e) {
e.printStackTrace();
message = "仓位停用失败";
throw new BusinessException(e.getMessage());
@ -151,6 +165,7 @@ public class MdBinController extends BaseController {
j.setMsg(message);
return j;
}
/**
*
*
@ -163,10 +178,10 @@ public class MdBinController extends BaseController {
AjaxJson j = new AjaxJson();
mdBin = systemService.getEntity(MdBinEntity.class, mdBin.getId());
message = "仓位同步有货成功";
try{
try {
// mdBin.setTingYong("Y");
// mdBinService.saveOrUpdate(mdBin);
if(wmUtil.checkishavestock("bin",mdBin.getKuWeiBianMa())){
if (wmUtil.checkishavestock("bin", mdBin.getKuWeiBianMa())) {
RfidBuseEntity rfidBuseEntity = new RfidBuseEntity();
rfidBuseEntity.setRfidType("CW");
rfidBuseEntity.setRfidId1(mdBin.getKuWeiBianMa());
@ -177,7 +192,7 @@ public class MdBinController extends BaseController {
j.setSuccess(false);
j.setMsg(message);
return j;
}else{
} else {
RfidBuseEntity rfidBuseEntity = new RfidBuseEntity();
rfidBuseEntity.setRfidType("CW");
rfidBuseEntity.setRfidId1(mdBin.getKuWeiBianMa());
@ -190,7 +205,7 @@ public class MdBinController extends BaseController {
return j;
}
}catch(Exception e){
} catch (Exception e) {
e.printStackTrace();
message = "仓位同步失败功";
throw new BusinessException(e.getMessage());
@ -207,17 +222,17 @@ public class MdBinController extends BaseController {
j.setObj(0);
String tsql = "select * "
+ " from wv_bin_all ws where 1 = 1 ";
if(!StringUtil.isEmpty(req.getParameter("binstore"))){
tsql = tsql + " and ws.bin_store like '%"+req.getParameter("binstore")+"%' ";
if (!StringUtil.isEmpty(req.getParameter("binstore"))) {
tsql = tsql + " and ws.bin_store like '%" + req.getParameter("binstore") + "%' ";
}
if(!StringUtil.isEmpty(req.getParameter("binid"))){
tsql = tsql + " and ws.binid like '%"+req.getParameter("binid")+"%' ";
if (!StringUtil.isEmpty(req.getParameter("binid"))) {
tsql = tsql + " and ws.binid like '%" + req.getParameter("binid") + "%' ";
}
if(!StringUtil.isEmpty(req.getParameter("des"))){
tsql = tsql + " and ws.des like '%"+req.getParameter("des")+"%' ";
if (!StringUtil.isEmpty(req.getParameter("des"))) {
tsql = tsql + " and ws.des like '%" + req.getParameter("des") + "%' ";
}
if(!StringUtil.isEmpty(req.getParameter("cengshu"))){
tsql = tsql + " and ws.znode like '%"+req.getParameter("cengshu")+"%' ";
if (!StringUtil.isEmpty(req.getParameter("cengshu"))) {
tsql = tsql + " and ws.znode like '%" + req.getParameter("cengshu") + "%' ";
}
String hangshu = req.getParameter("hangshu");
@ -229,28 +244,27 @@ public class MdBinController extends BaseController {
// list = this.tSSmsService.getMsgsList(curUser,curDate);
//将List转换成JSON存储
JSONArray result = new JSONArray();
if(resultt!=null && resultt.size()>0){
for(int i=0;i<resultt.size();i++){
if (resultt != null && resultt.size() > 0) {
for (int i = 0; i < resultt.size(); i++) {
JSONObject jsonParts = new JSONObject();
jsonParts.put("bin_store", resultt.get(i).get("bin_store"));
jsonParts.put("binid", resultt.get(i).get("binid"));
jsonParts.put("des", resultt.get(i).get("des"));
jsonParts.put("tincount", resultt.get(i).get("tincount"));
try{
try {
if("fanxiang".equals(type)){
try{
if ("fanxiang".equals(type)) {
try {
int hangshuint = Integer.parseInt(hangshu);
int xnode = Integer.parseInt(resultt.get(i).get("xnode").toString());
jsonParts.put("xnode", hangshuint+1-xnode);
}catch (Exception e){
jsonParts.put("xnode", hangshuint + 1 - xnode);
} catch (Exception e) {
}
}else{
} else {
jsonParts.put("xnode", resultt.get(i).get("xnode"));
}
@ -261,7 +275,7 @@ public class MdBinController extends BaseController {
jsonParts.put("colour", resultt.get(i).get("colour"));
}catch (Exception e){
} catch (Exception e) {
}
result.add(jsonParts);
@ -269,7 +283,7 @@ public class MdBinController extends BaseController {
j.setObj(resultt.size());
Map<String,Object> attrs = new HashMap<String, Object>();
Map<String, Object> attrs = new HashMap<String, Object>();
attrs.put("messageList", result);
// String tip = MutiLangUtil.getMutiLangInstance().getLang("message.tip");
// attrs.put("tip", tip);
@ -283,7 +297,135 @@ public class MdBinController extends BaseController {
return j;
}
@RequestMapping(params = "getbinallagv")
@ResponseBody
public AjaxJson getbinallagv(HttpServletRequest req) {
AjaxJson j = new AjaxJson();
String hangshu = req.getParameter("hangshu");
String type = req.getParameter("type");
String binFrom = req.getParameter("binid");
String binTo = req.getParameter("des");
if ("diaodu".equals(type)) {//调度需要方式指令
// 异步发送指令
if(StringUtil.isEmpty(binFrom)){
j.setMsg("开始储位为空");
j.setSuccess(false);
return j;
}
if(StringUtil.isEmpty(binTo)){
j.setMsg("结束储位为空");
j.setSuccess(false);
return j;
}
try {
executor.execute(new Runnable() {
@Override
public void run() {
runagv(binFrom, binTo);
}
});
} catch (Exception e) {
}
}
try {
j.setObj(0);
String tsql = "select * "
+ " from wv_bin_all ws where 1 = 1 ";
if (!StringUtil.isEmpty(req.getParameter("binstore"))) {
tsql = tsql + " and ws.bin_store like '%" + req.getParameter("binstore") + "%' ";
}
if (!StringUtil.isEmpty(req.getParameter("cengshu"))) {
tsql = tsql + " and ws.znode like '%" + req.getParameter("cengshu") + "%' ";
}
System.out.print(tsql);
List<Map<String, Object>> resultt = systemService
.findForJdbc(tsql);
// list = this.tSSmsService.getMsgsList(curUser,curDate);
//将List转换成JSON存储
JSONArray result = new JSONArray();
if (resultt != null && resultt.size() > 0) {
for (int i = 0; i < resultt.size(); i++) {
JSONObject jsonParts = new JSONObject();
jsonParts.put("bin_store", resultt.get(i).get("bin_store"));
jsonParts.put("binid", resultt.get(i).get("binid"));
jsonParts.put("des", resultt.get(i).get("des"));
jsonParts.put("tincount", resultt.get(i).get("tincount"));
try {
jsonParts.put("xnode", resultt.get(i).get("xnode"));
jsonParts.put("ynode", resultt.get(i).get("ynode"));
jsonParts.put("znode", resultt.get(i).get("znode"));
jsonParts.put("colour", resultt.get(i).get("colour"));
} catch (Exception e) {
}
result.add(jsonParts);
}
j.setObj(resultt.size());
Map<String, Object> attrs = new HashMap<String, Object>();
attrs.put("messageList", result);
// String tip = MutiLangUtil.getMutiLangInstance().getLang("message.tip");
// attrs.put("tip", tip);
// String seeAll = MutiLangUtil.getMutiLangInstance().getLang("message.seeAll");
// attrs.put("seeAll", seeAll);
j.setAttributes(attrs);
}
} catch (Exception e) {
j.setSuccess(false);
}
return j;
}
public void runagv(String binfrom, String binto) {
List<MdBinEntity> mdblistfrom = systemService.findByProperty(MdBinEntity.class, "kuWeiBianMa", binfrom);
List<MdBinEntity> mdblistto = systemService.findByProperty(MdBinEntity.class, "kuWeiBianMa", binto);
MdBinEntity mdBinEntityfrom = mdblistfrom.get(0);
MdBinEntity mdBinEntityto = mdblistto.get(0);
String x0 = mdBinEntityfrom.getXnode();
String x1 = mdBinEntityto.getXnode();
int xStep = Integer.parseInt(x1) - Integer.parseInt(x0) ;
String y0 = mdBinEntityfrom.getYnode();
String y1 = mdBinEntityto.getYnode();
int yStep = Integer.parseInt(y1) - Integer.parseInt(y0) ;
String xstepNum = "1";
String ystepNum = "1";
String hxstepNum = "1";
xstepNum = Integer.toString(xStep);
ystepNum = Integer.toString(yStep);
if(y0.equals("1")){
wmsPlcController.run("","run",xstepNum);
}else{
wmsPlcController.run("","run",ystepNum);
}
if(xStep>0 && yStep>0){
hxstepNum = "1";
wmsPlcController.run("","change",hxstepNum);
}
if(y0.equals("1")){
wmsPlcController.run("","run",ystepNum);
}else{
wmsPlcController.run("","run",xstepNum);
}
}
/**
*
@ -292,28 +434,28 @@ public class MdBinController extends BaseController {
*/
@RequestMapping(params = "doBatchDel")
@ResponseBody
public AjaxJson doBatchDel(String ids,HttpServletRequest request){
public AjaxJson doBatchDel(String ids, HttpServletRequest request) {
String message = null;
AjaxJson j = new AjaxJson();
message = "仓位停用成功";
try{
for(String id:ids.split(",")){
try {
for (String id : ids.split(",")) {
MdBinEntity mdBin = systemService.getEntity(MdBinEntity.class,
id
);
mdBin.setTingYong("Y");
if(wmUtil.checkishavestock("bin",mdBin.getKuWeiBianMa())){
if (wmUtil.checkishavestock("bin", mdBin.getKuWeiBianMa())) {
message = "仓位停用成功,但是存在库存";
mdBinService.updateEntitie(mdBin);
// j.setSuccess(false);
// j.setMsg(message);
// return j;
}else{
} else {
mdBinService.delete(mdBin);
}
systemService.addLog(message, Globals.Log_Type_DEL, Globals.Log_Leavel_INFO);
}
}catch(Exception e){
} catch (Exception e) {
e.printStackTrace();
message = "仓位停用失败";
throw new BusinessException(e.getMessage());
@ -334,25 +476,25 @@ public class MdBinController extends BaseController {
String message = null;
AjaxJson j = new AjaxJson();
message = "仓位定义添加成功";
try{
try {
MdBinEntity mdb = null;
List<MdBinEntity> mdblist = systemService.findByProperty(MdBinEntity.class, "kuWeiBianMa", mdBin.getKuWeiBianMa());
for (MdBinEntity t:mdblist){
if(t.getBinStore().equals(mdBin.getBinStore())){
for (MdBinEntity t : mdblist) {
if (t.getBinStore().equals(mdBin.getBinStore())) {
mdb = t;
}
}
// MdBinEntity mdBin1 = systemService.findUniqueByProperty(MdBinEntity.class, "kuWeiBianMa", mdBin.getKuWeiBianMa());
if(mdb ==null ){
if (mdb == null) {
mdBinService.save(mdBin);
systemService.addLog(message, Globals.Log_Type_INSERT, Globals.Log_Leavel_INFO);
}else{
} else {
message = "库位编码或者库位条码已经存在";
j.setSuccess(false);
}
}catch(Exception e){
} catch (Exception e) {
e.printStackTrace();
message = "仓位定义添加失败";
throw new BusinessException(e.getMessage());
@ -400,6 +542,7 @@ public class MdBinController extends BaseController {
}
return new ModelAndView("com/zzjee/md/mdBin-add");
}
/**
*
*
@ -421,7 +564,7 @@ public class MdBinController extends BaseController {
*/
@RequestMapping(params = "upload")
public ModelAndView upload(HttpServletRequest req) {
req.setAttribute("controller_name","mdBinController");
req.setAttribute("controller_name", "mdBinController");
return new ModelAndView("common/upload/pub_excel_upload");
}
@ -432,18 +575,19 @@ public class MdBinController extends BaseController {
* @param response
*/
@RequestMapping(params = "exportXls")
public String exportXls(MdBinEntity mdBin,HttpServletRequest request,HttpServletResponse response
, DataGrid dataGrid,ModelMap modelMap) {
public String exportXls(MdBinEntity mdBin, HttpServletRequest request, HttpServletResponse response
, DataGrid dataGrid, ModelMap modelMap) {
CriteriaQuery cq = new CriteriaQuery(MdBinEntity.class, dataGrid);
org.jeecgframework.core.extend.hqlsearch.HqlGenerateUtil.installHql(cq, mdBin, request.getParameterMap());
List<MdBinEntity> mdBins = this.mdBinService.getListByCriteriaQuery(cq,false);
modelMap.put(NormalExcelConstants.FILE_NAME,"仓位定义");
modelMap.put(NormalExcelConstants.CLASS,MdBinEntity.class);
modelMap.put(NormalExcelConstants.PARAMS,new ExportParams("仓位定义列表", "导出人:"+ResourceUtil.getSessionUserName().getRealName(),
List<MdBinEntity> mdBins = this.mdBinService.getListByCriteriaQuery(cq, false);
modelMap.put(NormalExcelConstants.FILE_NAME, "仓位定义");
modelMap.put(NormalExcelConstants.CLASS, MdBinEntity.class);
modelMap.put(NormalExcelConstants.PARAMS, new ExportParams("仓位定义列表", "导出人:" + ResourceUtil.getSessionUserName().getRealName(),
"导出信息"));
modelMap.put(NormalExcelConstants.DATA_LIST,mdBins);
modelMap.put(NormalExcelConstants.DATA_LIST, mdBins);
return NormalExcelConstants.JEECG_EXCEL_VIEW;
}
/**
* excel 使
*
@ -451,13 +595,13 @@ public class MdBinController extends BaseController {
* @param response
*/
@RequestMapping(params = "exportXlsByT")
public String exportXlsByT(MdBinEntity mdBin,HttpServletRequest request,HttpServletResponse response
, DataGrid dataGrid,ModelMap modelMap) {
modelMap.put(NormalExcelConstants.FILE_NAME,"仓位定义");
modelMap.put(NormalExcelConstants.CLASS,MdBinEntity.class);
modelMap.put(NormalExcelConstants.PARAMS,new ExportParams("仓位定义列表", "导出人:"+ResourceUtil.getSessionUserName().getRealName(),
public String exportXlsByT(MdBinEntity mdBin, HttpServletRequest request, HttpServletResponse response
, DataGrid dataGrid, ModelMap modelMap) {
modelMap.put(NormalExcelConstants.FILE_NAME, "仓位定义");
modelMap.put(NormalExcelConstants.CLASS, MdBinEntity.class);
modelMap.put(NormalExcelConstants.PARAMS, new ExportParams("仓位定义列表", "导出人:" + ResourceUtil.getSessionUserName().getRealName(),
"导出信息"));
modelMap.put(NormalExcelConstants.DATA_LIST,new ArrayList());
modelMap.put(NormalExcelConstants.DATA_LIST, new ArrayList());
return NormalExcelConstants.JEECG_EXCEL_VIEW;
}
@ -476,20 +620,20 @@ public class MdBinController extends BaseController {
params.setHeadRows(1);
params.setNeedSave(true);
try {
List<MdBinEntity> listMdBinEntitys = ExcelImportUtil.importExcel(file.getInputStream(),MdBinEntity.class,params);
List<MdBinEntity> listMdBinEntitys = ExcelImportUtil.importExcel(file.getInputStream(), MdBinEntity.class, params);
for (MdBinEntity mdBin : listMdBinEntitys) {
MdBinEntity mdb = null;
List<MdBinEntity> mdblist = systemService.findByProperty(MdBinEntity.class, "kuWeiBianMa", mdBin.getKuWeiBianMa());
for (MdBinEntity t:mdblist){
if(t.getKuWeiBianMa().equals(mdBin.getKuWeiBianMa())){
for (MdBinEntity t : mdblist) {
if (t.getKuWeiBianMa().equals(mdBin.getKuWeiBianMa())) {
mdb = t;
}
}
if(mdb!=null){
if (mdb != null) {
MyBeanUtils.copyBeanNotNull2Bean(mdBin, mdb);
systemService.saveOrUpdate(mdb);
}else{
} else {
mdBinService.save(mdBin);
}
}
@ -497,7 +641,7 @@ public class MdBinController extends BaseController {
} catch (Exception e) {
j.setMsg("文件导入失败!");
logger.error(ExceptionUtil.getExceptionMessage(e));
}finally{
} finally {
try {
file.getInputStream().close();
} catch (IOException e) {
@ -511,7 +655,7 @@ public class MdBinController extends BaseController {
@RequestMapping(method = RequestMethod.GET)
@ResponseBody
public List<MdBinEntity> list() {
List<MdBinEntity> listMdBins=mdBinService.getList(MdBinEntity.class);
List<MdBinEntity> listMdBins = mdBinService.getList(MdBinEntity.class);
return listMdBins;
}
@ -535,7 +679,7 @@ public class MdBinController extends BaseController {
}
//保存
try{
try {
mdBinService.save(mdBin);
} catch (Exception e) {
e.printStackTrace();
@ -559,7 +703,7 @@ public class MdBinController extends BaseController {
}
//保存
try{
try {
mdBinService.saveOrUpdate(mdBin);
} catch (Exception e) {
e.printStackTrace();
@ -578,28 +722,28 @@ public class MdBinController extends BaseController {
@RequestMapping(params = "addMdBin")
@ResponseBody
public void addMdBin(){
public void addMdBin() {
List<MdBinEntity> mdBinEntityList = new ArrayList<>();
for (int i = 1; i <= 15; i++) {
for (int j = 1; j <= 6; j++) {
for (int k = 1; k <= 30; k++) {
MdBinEntity mdBinEntity = new MdBinEntity();
String kuweibianma = "A"+String.format("%02d",i)+"-"+String.format("%02d",j)+"-"+String.format("%02d",k);
String kuweibianma = "A" + String.format("%02d", i) + "-" + String.format("%02d", j) + "-" + String.format("%02d", k);
mdBinEntity.setKuWeiBianMa(kuweibianma);
mdBinEntity.setKuWeiTiaoMa(kuweibianma);
mdBinEntity.setKuWeiMingCheng("A1");
mdBinEntity.setKuWeiLeiXing("收货储位");
mdBinEntity.setKuWeiShuXing("常温");
mdBinEntity.setShangJiaCiXu(String.format("%02d",i)+String.format("%02d",j)+String.format("%02d",k));
mdBinEntity.setQuHuoCiXu(String.format("%02d",i)+String.format("%02d",j)+String.format("%02d",k));
mdBinEntity.setShangJiaCiXu(String.format("%02d", i) + String.format("%02d", j) + String.format("%02d", k));
mdBinEntity.setQuHuoCiXu(String.format("%02d", i) + String.format("%02d", j) + String.format("%02d", k));
mdBinEntity.setTiJiDanWei("0");
mdBinEntity.setZhongLiangDanWei("5");
mdBinEntity.setZuiDaTuoPan("2");
mdBinEntity.setTingYong("N");
mdBinEntity.setBinStore("BJTZ7");
mdBinEntity.setXnode(String.format("%02d",i));
mdBinEntity.setYnode(String.format("%02d",j));
mdBinEntity.setZnode(String.format("%02d",k));
mdBinEntity.setXnode(String.format("%02d", i));
mdBinEntity.setYnode(String.format("%02d", j));
mdBinEntity.setZnode(String.format("%02d", k));
mdBinEntityList.add(mdBinEntity);
}
}

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,11 +166,40 @@ public class WmsPlcController extends BaseController {
message = "PLC指令执行成功";
try{
for(String id:ids.split(",")){
run(id,"","");
}
}catch(Exception e){
e.printStackTrace();
message = "PLC指令执行失败";
throw new BusinessException(e.getMessage());
}
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();
WmsPlcEntity wmsPlc = systemService.getEntity(WmsPlcEntity.class,
id
);
SiemensPLCS siemensPLCS = SiemensPLCS.S200Smart;
SiemensS7Net siemensS7Net = null;
siemensS7Net = new SiemensS7Net(siemensPLCS);
@ -179,10 +211,25 @@ public class WmsPlcController extends BaseController {
}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")){
@ -193,25 +240,26 @@ public class WmsPlcController extends BaseController {
}
}
else if(split[0].equals("float")){
siemensS7Net.Write(defaultAddress,Float.parseFloat(split[2]));
Float runfloat = Float.parseFloat(split[2]) * stepNumrun;
siemensS7Net.Write(defaultAddress,runfloat);
}
}
//执行完指令等待时间
Thread.sleep(Long.parseLong(wmsPlc.getComTime()));
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());
}
}catch(Exception e){
e.printStackTrace();
message = "PLC指令执行失败";
throw new BusinessException(e.getMessage());
}
j.setMsg(message);
return j;
}
/**
* 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>
<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" >
<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"
<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>
<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"
<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>
<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"
<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>
<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"
<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>
<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"
<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>
<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"
<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"
<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"
name="comCons"></textarea>
<span class="Validform_checktip" style="float:left;height:0px;"></span>
<label class="Validform_label" style="display: none">指令集</label>
</div>
</div>
></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"
<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>
<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"
<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>
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"
<div class="con-wrapper" id="con-wrapper2" style="display: block;"></div>
</div>
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>
<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>
</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>
<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"
<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" 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"
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" 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"
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" 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"
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" 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"
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" 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"
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" 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"
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"
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"
>${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" 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>
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>
<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>
</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>