diff --git a/src/main/java/com/zzjee/md/controller/MdBinController.java b/src/main/java/com/zzjee/md/controller/MdBinController.java index 3059c101..0e269c3e 100644 --- a/src/main/java/com/zzjee/md/controller/MdBinController.java +++ b/src/main/java/com/zzjee/md/controller/MdBinController.java @@ -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,553 +64,691 @@ 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") public class MdBinController extends BaseController { - /** - * Logger for this class - */ - private static final Logger logger = Logger.getLogger(MdBinController.class); + /** + * Logger for this class + */ + private static final Logger logger = Logger.getLogger(MdBinController.class); - @Autowired - private MdBinServiceI mdBinService; - @Autowired - private SystemService systemService; - @Autowired - private Validator validator; + @Autowired + private MdBinServiceI mdBinService; + @Autowired + private SystemService systemService; + @Autowired + private Validator validator; + @Autowired + private WmsPlcController wmsPlcController; + ExecutorService executor = Executors.newFixedThreadPool(8); + /** + * 仓位定义列表 页面跳转 + * + * @return + */ + @RequestMapping(params = "list") + public ModelAndView list(HttpServletRequest request) { + return new ModelAndView("com/zzjee/md/mdBinList"); + } - /** - * 仓位定义列表 页面跳转 - * - * @return - */ - @RequestMapping(params = "list") - 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"); - } - /** - * easyui AJAX请求数据 - * - * @param request - * @param response - * @param dataGrid - */ + @RequestMapping(params = "listc") + public ModelAndView listc(HttpServletRequest request) { + return new ModelAndView("com/zzjee/md/mdavabinlist"); + } - @RequestMapping(params = "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{ - //自定义追加查询条件 - }catch (Exception e) { - throw new BusinessException(e.getMessage()); - } - cq.add(); - this.mdBinService.getDataGridReturn(cq, true); - TagUtil.datagrid(response, dataGrid); - } + @RequestMapping(params = "listagv") + public ModelAndView listagv(HttpServletRequest request) { + return new ModelAndView("com/zzjee/md/mdbinagvlist"); + } - /** - * 删除仓位定义 - * - * @return - */ - @RequestMapping(params = "doDel") - @ResponseBody - public AjaxJson doDel(MdBinEntity mdBin, HttpServletRequest request) { - String message = null; - AjaxJson j = new AjaxJson(); - mdBin = systemService.getEntity(MdBinEntity.class, mdBin.getId()); - message = "仓位停用成功"; - try{ + /** + * easyui AJAX请求数据 + * + * @param request + * @param response + * @param dataGrid + */ - if(wmUtil.checkishavestock("bin",mdBin.getKuWeiBianMa())){ - message = "仓位停用成功,但是存在库存"; - j.setSuccess(false); - j.setMsg(message); - mdBin.setTingYong("Y"); - mdBinService.saveOrUpdate(mdBin); - return j; - }else{ - mdBinService.delete(mdBin); - } - systemService.addLog(message, Globals.Log_Type_DEL, Globals.Log_Leavel_INFO); - }catch(Exception e){ - e.printStackTrace(); - message = "仓位停用失败"; - throw new BusinessException(e.getMessage()); - } - j.setMsg(message); - return j; - } - /** - * 删除仓位定义 - * - * @return - */ - @RequestMapping(params = "doHad") - @ResponseBody - public AjaxJson doHad(MdBinEntity mdBin, HttpServletRequest request) { - String message = null; - AjaxJson j = new AjaxJson(); - mdBin = systemService.getEntity(MdBinEntity.class, mdBin.getId()); - message = "仓位同步有货成功"; - try{ + @RequestMapping(params = "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 { + //自定义追加查询条件 + } catch (Exception e) { + throw new BusinessException(e.getMessage()); + } + cq.add(); + this.mdBinService.getDataGridReturn(cq, true); + TagUtil.datagrid(response, dataGrid); + } + + /** + * 删除仓位定义 + * + * @return + */ + @RequestMapping(params = "doDel") + @ResponseBody + public AjaxJson doDel(MdBinEntity mdBin, HttpServletRequest request) { + String message = null; + AjaxJson j = new AjaxJson(); + mdBin = systemService.getEntity(MdBinEntity.class, mdBin.getId()); + message = "仓位停用成功"; + try { + + if (wmUtil.checkishavestock("bin", mdBin.getKuWeiBianMa())) { + message = "仓位停用成功,但是存在库存"; + j.setSuccess(false); + j.setMsg(message); + mdBin.setTingYong("Y"); + mdBinService.saveOrUpdate(mdBin); + return j; + } else { + mdBinService.delete(mdBin); + } + systemService.addLog(message, Globals.Log_Type_DEL, Globals.Log_Leavel_INFO); + } catch (Exception e) { + e.printStackTrace(); + message = "仓位停用失败"; + throw new BusinessException(e.getMessage()); + } + j.setMsg(message); + return j; + } + + /** + * 删除仓位定义 + * + * @return + */ + @RequestMapping(params = "doHad") + @ResponseBody + public AjaxJson doHad(MdBinEntity mdBin, HttpServletRequest request) { + String message = null; + AjaxJson j = new AjaxJson(); + mdBin = systemService.getEntity(MdBinEntity.class, mdBin.getId()); + message = "仓位同步有货成功"; + try { // mdBin.setTingYong("Y"); // mdBinService.saveOrUpdate(mdBin); - if(wmUtil.checkishavestock("bin",mdBin.getKuWeiBianMa())){ - RfidBuseEntity rfidBuseEntity = new RfidBuseEntity(); - rfidBuseEntity.setRfidType("CW"); - rfidBuseEntity.setRfidId1(mdBin.getKuWeiBianMa()); - rfidBuseEntity.setRfidId2("Y"); - rfidBuseEntity.setBpmStatus("1"); - systemService.save(rfidBuseEntity); - message = "仓位同步有货成功"; - j.setSuccess(false); - j.setMsg(message); - return j; - }else{ - RfidBuseEntity rfidBuseEntity = new RfidBuseEntity(); - rfidBuseEntity.setRfidType("CW"); - rfidBuseEntity.setRfidId1(mdBin.getKuWeiBianMa()); - rfidBuseEntity.setRfidId2("N"); - rfidBuseEntity.setBpmStatus("1"); - systemService.save(rfidBuseEntity); - message = "仓位同步无货成功"; - j.setSuccess(false); - j.setMsg(message); - return j; - } + if (wmUtil.checkishavestock("bin", mdBin.getKuWeiBianMa())) { + RfidBuseEntity rfidBuseEntity = new RfidBuseEntity(); + rfidBuseEntity.setRfidType("CW"); + rfidBuseEntity.setRfidId1(mdBin.getKuWeiBianMa()); + rfidBuseEntity.setRfidId2("Y"); + rfidBuseEntity.setBpmStatus("1"); + systemService.save(rfidBuseEntity); + message = "仓位同步有货成功"; + j.setSuccess(false); + j.setMsg(message); + return j; + } else { + RfidBuseEntity rfidBuseEntity = new RfidBuseEntity(); + rfidBuseEntity.setRfidType("CW"); + rfidBuseEntity.setRfidId1(mdBin.getKuWeiBianMa()); + rfidBuseEntity.setRfidId2("N"); + rfidBuseEntity.setBpmStatus("1"); + systemService.save(rfidBuseEntity); + message = "仓位同步无货成功"; + j.setSuccess(false); + j.setMsg(message); + return j; + } - }catch(Exception e){ - e.printStackTrace(); - message = "仓位同步失败功"; - throw new BusinessException(e.getMessage()); - } + } catch (Exception e) { + e.printStackTrace(); + message = "仓位同步失败功"; + throw new BusinessException(e.getMessage()); + } - } + } - @RequestMapping(params = "getbinall") - @ResponseBody - public AjaxJson getNoticeList(HttpServletRequest req) { - AjaxJson j = new AjaxJson(); - 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("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("cengshu"))){ - tsql = tsql + " and ws.znode like '%"+req.getParameter("cengshu")+"%' "; - } + @RequestMapping(params = "getbinall") + @ResponseBody + public AjaxJson getNoticeList(HttpServletRequest req) { + AjaxJson j = new AjaxJson(); + 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("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("cengshu"))) { + tsql = tsql + " and ws.znode like '%" + req.getParameter("cengshu") + "%' "; + } - String hangshu = req.getParameter("hangshu"); - String type = req.getParameter("type"); + String hangshu = req.getParameter("hangshu"); + String type = req.getParameter("type"); - System.out.print(tsql); - List> resultt = systemService - .findForJdbc(tsql); + System.out.print(tsql); + List> 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 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 { - if("fanxiang".equals(type)){ - try{ - int hangshuint = Integer.parseInt(hangshu); - int xnode = Integer.parseInt(resultt.get(i).get("xnode").toString()); + 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 { + jsonParts.put("xnode", resultt.get(i).get("xnode")); - }else{ - jsonParts.put("xnode", resultt.get(i).get("xnode")); + } - } + jsonParts.put("ynode", resultt.get(i).get("ynode")); - jsonParts.put("ynode", resultt.get(i).get("ynode")); + jsonParts.put("znode", resultt.get(i).get("znode")); - jsonParts.put("znode", resultt.get(i).get("znode")); + jsonParts.put("colour", resultt.get(i).get("colour")); - jsonParts.put("colour", resultt.get(i).get("colour")); + } catch (Exception e) { - }catch (Exception e){ - - } - result.add(jsonParts); - } - j.setObj(resultt.size()); + } + result.add(jsonParts); + } + j.setObj(resultt.size()); - Map attrs = new HashMap(); - attrs.put("messageList", result); + Map attrs = new HashMap(); + 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; - } + j.setAttributes(attrs); + } + } catch (Exception e) { + j.setSuccess(false); + } + 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> 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 { - /** - * 批量删除仓位定义 - * - * @return - */ - @RequestMapping(params = "doBatchDel") - @ResponseBody - public AjaxJson doBatchDel(String ids,HttpServletRequest request){ - String message = null; - AjaxJson j = new AjaxJson(); - message = "仓位停用成功"; - try{ - for(String id:ids.split(",")){ - MdBinEntity mdBin = systemService.getEntity(MdBinEntity.class, - id - ); - mdBin.setTingYong("Y"); - if(wmUtil.checkishavestock("bin",mdBin.getKuWeiBianMa())){ - message = "仓位停用成功,但是存在库存"; - mdBinService.updateEntitie(mdBin); + + 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 attrs = new HashMap(); + 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 mdblistfrom = systemService.findByProperty(MdBinEntity.class, "kuWeiBianMa", binfrom); + List 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); + } + + } + + /** + * 批量删除仓位定义 + * + * @return + */ + @RequestMapping(params = "doBatchDel") + @ResponseBody + public AjaxJson doBatchDel(String ids, HttpServletRequest request) { + String message = null; + AjaxJson j = new AjaxJson(); + message = "仓位停用成功"; + try { + for (String id : ids.split(",")) { + MdBinEntity mdBin = systemService.getEntity(MdBinEntity.class, + id + ); + mdBin.setTingYong("Y"); + if (wmUtil.checkishavestock("bin", mdBin.getKuWeiBianMa())) { + message = "仓位停用成功,但是存在库存"; + mdBinService.updateEntitie(mdBin); // j.setSuccess(false); // j.setMsg(message); // return j; - }else{ - mdBinService.delete(mdBin); - } - systemService.addLog(message, Globals.Log_Type_DEL, Globals.Log_Leavel_INFO); - } - }catch(Exception e){ - e.printStackTrace(); - message = "仓位停用失败"; - throw new BusinessException(e.getMessage()); - } - j.setMsg(message); - return j; - } + } else { + mdBinService.delete(mdBin); + } + systemService.addLog(message, Globals.Log_Type_DEL, Globals.Log_Leavel_INFO); + } + } catch (Exception e) { + e.printStackTrace(); + message = "仓位停用失败"; + throw new BusinessException(e.getMessage()); + } + j.setMsg(message); + return j; + } - /** - * 添加仓位定义 - * - * @return - */ - @RequestMapping(params = "doAdd") - @ResponseBody - public AjaxJson doAdd(MdBinEntity mdBin, HttpServletRequest request) { - String message = null; - AjaxJson j = new AjaxJson(); - message = "仓位定义添加成功"; - try{ + /** + * 添加仓位定义 + * + * @return + */ + @RequestMapping(params = "doAdd") + @ResponseBody + public AjaxJson doAdd(MdBinEntity mdBin, HttpServletRequest request) { + String message = null; + AjaxJson j = new AjaxJson(); + message = "仓位定义添加成功"; + try { - MdBinEntity mdb = null; - List mdblist = systemService.findByProperty(MdBinEntity.class, "kuWeiBianMa", mdBin.getKuWeiBianMa()); - for (MdBinEntity t:mdblist){ - if(t.getBinStore().equals(mdBin.getBinStore())){ - mdb = t; - } - } + MdBinEntity mdb = null; + List mdblist = systemService.findByProperty(MdBinEntity.class, "kuWeiBianMa", mdBin.getKuWeiBianMa()); + for (MdBinEntity t : mdblist) { + if (t.getBinStore().equals(mdBin.getBinStore())) { + mdb = t; + } + } // MdBinEntity mdBin1 = systemService.findUniqueByProperty(MdBinEntity.class, "kuWeiBianMa", mdBin.getKuWeiBianMa()); - if(mdb ==null ){ - mdBinService.save(mdBin); - systemService.addLog(message, Globals.Log_Type_INSERT, Globals.Log_Leavel_INFO); - }else{ - message = "库位编码或者库位条码已经存在"; + if (mdb == null) { + mdBinService.save(mdBin); + systemService.addLog(message, Globals.Log_Type_INSERT, Globals.Log_Leavel_INFO); + } else { + message = "库位编码或者库位条码已经存在"; j.setSuccess(false); } - }catch(Exception e){ - e.printStackTrace(); - message = "仓位定义添加失败"; - throw new BusinessException(e.getMessage()); - } - j.setMsg(message); - return j; - } + } catch (Exception e) { + e.printStackTrace(); + message = "仓位定义添加失败"; + throw new BusinessException(e.getMessage()); + } + j.setMsg(message); + return j; + } - /** - * 更新仓位定义 - * - * @return - */ - @RequestMapping(params = "doUpdate") - @ResponseBody - public AjaxJson doUpdate(MdBinEntity mdBin, HttpServletRequest request) { - String message = null; - AjaxJson j = new AjaxJson(); - message = "仓位定义更新成功"; - MdBinEntity t = mdBinService.get(MdBinEntity.class, mdBin.getId()); - try { - MyBeanUtils.copyBeanNotNull2Bean(mdBin, t); - mdBinService.saveOrUpdate(t); - systemService.addLog(message, Globals.Log_Type_UPDATE, Globals.Log_Leavel_INFO); - } catch (Exception e) { - e.printStackTrace(); - message = "仓位定义更新失败"; - throw new BusinessException(e.getMessage()); - } - j.setMsg(message); - return j; - } + /** + * 更新仓位定义 + * + * @return + */ + @RequestMapping(params = "doUpdate") + @ResponseBody + public AjaxJson doUpdate(MdBinEntity mdBin, HttpServletRequest request) { + String message = null; + AjaxJson j = new AjaxJson(); + message = "仓位定义更新成功"; + MdBinEntity t = mdBinService.get(MdBinEntity.class, mdBin.getId()); + try { + MyBeanUtils.copyBeanNotNull2Bean(mdBin, t); + mdBinService.saveOrUpdate(t); + systemService.addLog(message, Globals.Log_Type_UPDATE, Globals.Log_Leavel_INFO); + } catch (Exception e) { + e.printStackTrace(); + message = "仓位定义更新失败"; + throw new BusinessException(e.getMessage()); + } + j.setMsg(message); + return j; + } - /** - * 仓位定义新增页面跳转 - * - * @return - */ - @RequestMapping(params = "goAdd") - public ModelAndView goAdd(MdBinEntity mdBin, HttpServletRequest req) { - if (StringUtil.isNotEmpty(mdBin.getId())) { - mdBin = mdBinService.getEntity(MdBinEntity.class, mdBin.getId()); - req.setAttribute("mdBinPage", mdBin); - } - return new ModelAndView("com/zzjee/md/mdBin-add"); - } - /** - * 仓位定义编辑页面跳转 - * - * @return - */ - @RequestMapping(params = "goUpdate") - public ModelAndView goUpdate(MdBinEntity mdBin, HttpServletRequest req) { - if (StringUtil.isNotEmpty(mdBin.getId())) { - mdBin = mdBinService.getEntity(MdBinEntity.class, mdBin.getId()); - req.setAttribute("mdBinPage", mdBin); - } - return new ModelAndView("com/zzjee/md/mdBin-update"); - } + /** + * 仓位定义新增页面跳转 + * + * @return + */ + @RequestMapping(params = "goAdd") + public ModelAndView goAdd(MdBinEntity mdBin, HttpServletRequest req) { + if (StringUtil.isNotEmpty(mdBin.getId())) { + mdBin = mdBinService.getEntity(MdBinEntity.class, mdBin.getId()); + req.setAttribute("mdBinPage", mdBin); + } + return new ModelAndView("com/zzjee/md/mdBin-add"); + } - /** - * 导入功能跳转 - * - * @return - */ - @RequestMapping(params = "upload") - public ModelAndView upload(HttpServletRequest req) { - req.setAttribute("controller_name","mdBinController"); - return new ModelAndView("common/upload/pub_excel_upload"); - } + /** + * 仓位定义编辑页面跳转 + * + * @return + */ + @RequestMapping(params = "goUpdate") + public ModelAndView goUpdate(MdBinEntity mdBin, HttpServletRequest req) { + if (StringUtil.isNotEmpty(mdBin.getId())) { + mdBin = mdBinService.getEntity(MdBinEntity.class, mdBin.getId()); + req.setAttribute("mdBinPage", mdBin); + } + return new ModelAndView("com/zzjee/md/mdBin-update"); + } - /** - * 导出excel - * - * @param request - * @param response - */ - @RequestMapping(params = "exportXls") - 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 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); - return NormalExcelConstants.JEECG_EXCEL_VIEW; - } - /** - * 导出excel 使模板 - * - * @param request - * @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(), - "导出信息")); - modelMap.put(NormalExcelConstants.DATA_LIST,new ArrayList()); - return NormalExcelConstants.JEECG_EXCEL_VIEW; - } + /** + * 导入功能跳转 + * + * @return + */ + @RequestMapping(params = "upload") + public ModelAndView upload(HttpServletRequest req) { + req.setAttribute("controller_name", "mdBinController"); + return new ModelAndView("common/upload/pub_excel_upload"); + } - @SuppressWarnings("unchecked") - @RequestMapping(params = "importExcel", method = RequestMethod.POST) - @ResponseBody - public AjaxJson importExcel(HttpServletRequest request, HttpServletResponse response) { - AjaxJson j = new AjaxJson(); + /** + * 导出excel + * + * @param request + * @param response + */ + @RequestMapping(params = "exportXls") + 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 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); + return NormalExcelConstants.JEECG_EXCEL_VIEW; + } - MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; - Map fileMap = multipartRequest.getFileMap(); - for (Map.Entry entity : fileMap.entrySet()) { - MultipartFile file = entity.getValue();// 获取上传文件对象 - ImportParams params = new ImportParams(); - params.setTitleRows(2); - params.setHeadRows(1); - params.setNeedSave(true); - try { - List listMdBinEntitys = ExcelImportUtil.importExcel(file.getInputStream(),MdBinEntity.class,params); - for (MdBinEntity mdBin : listMdBinEntitys) { + /** + * 导出excel 使模板 + * + * @param request + * @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(), + "导出信息")); + modelMap.put(NormalExcelConstants.DATA_LIST, new ArrayList()); + return NormalExcelConstants.JEECG_EXCEL_VIEW; + } - MdBinEntity mdb = null; - List mdblist = systemService.findByProperty(MdBinEntity.class, "kuWeiBianMa", mdBin.getKuWeiBianMa()); - for (MdBinEntity t:mdblist){ - if(t.getKuWeiBianMa().equals(mdBin.getKuWeiBianMa())){ - mdb = t; - } - } - if(mdb!=null){ - MyBeanUtils.copyBeanNotNull2Bean(mdBin, mdb); - systemService.saveOrUpdate(mdb); - }else{ - mdBinService.save(mdBin); - } - } - j.setMsg("文件导入成功!"); - } catch (Exception e) { - j.setMsg("文件导入失败!"); - logger.error(ExceptionUtil.getExceptionMessage(e)); - }finally{ - try { - file.getInputStream().close(); - } catch (IOException e) { - e.printStackTrace(); - } - } - } - return j; - } + @SuppressWarnings("unchecked") + @RequestMapping(params = "importExcel", method = RequestMethod.POST) + @ResponseBody + public AjaxJson importExcel(HttpServletRequest request, HttpServletResponse response) { + AjaxJson j = new AjaxJson(); - @RequestMapping(method = RequestMethod.GET) - @ResponseBody - public List list() { - List listMdBins=mdBinService.getList(MdBinEntity.class); - return listMdBins; - } + MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; + Map fileMap = multipartRequest.getFileMap(); + for (Map.Entry entity : fileMap.entrySet()) { + MultipartFile file = entity.getValue();// 获取上传文件对象 + ImportParams params = new ImportParams(); + params.setTitleRows(2); + params.setHeadRows(1); + params.setNeedSave(true); + try { + List listMdBinEntitys = ExcelImportUtil.importExcel(file.getInputStream(), MdBinEntity.class, params); + for (MdBinEntity mdBin : listMdBinEntitys) { - @RequestMapping(value = "/{id}", method = RequestMethod.GET) - @ResponseBody - public ResponseEntity get(@PathVariable("id") String id) { - MdBinEntity task = mdBinService.get(MdBinEntity.class, id); - if (task == null) { - return new ResponseEntity(HttpStatus.NOT_FOUND); - } - return new ResponseEntity(task, HttpStatus.OK); - } + MdBinEntity mdb = null; + List mdblist = systemService.findByProperty(MdBinEntity.class, "kuWeiBianMa", mdBin.getKuWeiBianMa()); + for (MdBinEntity t : mdblist) { + if (t.getKuWeiBianMa().equals(mdBin.getKuWeiBianMa())) { + mdb = t; + } + } + if (mdb != null) { + MyBeanUtils.copyBeanNotNull2Bean(mdBin, mdb); + systemService.saveOrUpdate(mdb); + } else { + mdBinService.save(mdBin); + } + } + j.setMsg("文件导入成功!"); + } catch (Exception e) { + j.setMsg("文件导入失败!"); + logger.error(ExceptionUtil.getExceptionMessage(e)); + } finally { + try { + file.getInputStream().close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + return j; + } - @RequestMapping(method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE) - @ResponseBody - public ResponseEntity create(@RequestBody MdBinEntity mdBin, UriComponentsBuilder uriBuilder) { - //调用JSR303 Bean Validator进行校验,如果出错返回含400错误码及json格式的错误信息. - Set> failures = validator.validate(mdBin); - if (!failures.isEmpty()) { - return new ResponseEntity(BeanValidators.extractPropertyAndMessage(failures), HttpStatus.BAD_REQUEST); - } + @RequestMapping(method = RequestMethod.GET) + @ResponseBody + public List list() { + List listMdBins = mdBinService.getList(MdBinEntity.class); + return listMdBins; + } - //保存 - try{ - mdBinService.save(mdBin); - } catch (Exception e) { - e.printStackTrace(); - return new ResponseEntity(HttpStatus.NO_CONTENT); - } - //按照Restful风格约定,创建指向新任务的url, 也可以直接返回id或对象. - String id = mdBin.getId(); - URI uri = uriBuilder.path("/rest/mdBinController/" + id).build().toUri(); - HttpHeaders headers = new HttpHeaders(); - headers.setLocation(uri); + @RequestMapping(value = "/{id}", method = RequestMethod.GET) + @ResponseBody + public ResponseEntity get(@PathVariable("id") String id) { + MdBinEntity task = mdBinService.get(MdBinEntity.class, id); + if (task == null) { + return new ResponseEntity(HttpStatus.NOT_FOUND); + } + return new ResponseEntity(task, HttpStatus.OK); + } - return new ResponseEntity(headers, HttpStatus.CREATED); - } + @RequestMapping(method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE) + @ResponseBody + public ResponseEntity create(@RequestBody MdBinEntity mdBin, UriComponentsBuilder uriBuilder) { + //调用JSR303 Bean Validator进行校验,如果出错返回含400错误码及json格式的错误信息. + Set> failures = validator.validate(mdBin); + if (!failures.isEmpty()) { + return new ResponseEntity(BeanValidators.extractPropertyAndMessage(failures), HttpStatus.BAD_REQUEST); + } - @RequestMapping(value = "/{id}", method = RequestMethod.PUT, consumes = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity update(@RequestBody MdBinEntity mdBin) { - //调用JSR303 Bean Validator进行校验,如果出错返回含400错误码及json格式的错误信息. - Set> failures = validator.validate(mdBin); - if (!failures.isEmpty()) { - return new ResponseEntity(BeanValidators.extractPropertyAndMessage(failures), HttpStatus.BAD_REQUEST); - } + //保存 + try { + mdBinService.save(mdBin); + } catch (Exception e) { + e.printStackTrace(); + return new ResponseEntity(HttpStatus.NO_CONTENT); + } + //按照Restful风格约定,创建指向新任务的url, 也可以直接返回id或对象. + String id = mdBin.getId(); + URI uri = uriBuilder.path("/rest/mdBinController/" + id).build().toUri(); + HttpHeaders headers = new HttpHeaders(); + headers.setLocation(uri); - //保存 - try{ - mdBinService.saveOrUpdate(mdBin); - } catch (Exception e) { - e.printStackTrace(); - return new ResponseEntity(HttpStatus.NO_CONTENT); - } + return new ResponseEntity(headers, HttpStatus.CREATED); + } - //按Restful约定,返回204状态码, 无内容. 也可以返回200状态码. - return new ResponseEntity(HttpStatus.NO_CONTENT); - } + @RequestMapping(value = "/{id}", method = RequestMethod.PUT, consumes = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity update(@RequestBody MdBinEntity mdBin) { + //调用JSR303 Bean Validator进行校验,如果出错返回含400错误码及json格式的错误信息. + Set> failures = validator.validate(mdBin); + if (!failures.isEmpty()) { + return new ResponseEntity(BeanValidators.extractPropertyAndMessage(failures), HttpStatus.BAD_REQUEST); + } - @RequestMapping(value = "/{id}", method = RequestMethod.DELETE) - @ResponseStatus(HttpStatus.NO_CONTENT) - public void delete(@PathVariable("id") String id) { - mdBinService.deleteEntityById(MdBinEntity.class, id); - } + //保存 + try { + mdBinService.saveOrUpdate(mdBin); + } catch (Exception e) { + e.printStackTrace(); + return new ResponseEntity(HttpStatus.NO_CONTENT); + } - @RequestMapping(params = "addMdBin") - @ResponseBody - public void addMdBin(){ - List 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); - 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.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)); - mdBinEntityList.add(mdBinEntity); - } - } - } - mdBinService.batchSave(mdBinEntityList); + //按Restful约定,返回204状态码, 无内容. 也可以返回200状态码. + return new ResponseEntity(HttpStatus.NO_CONTENT); + } - } + @RequestMapping(value = "/{id}", method = RequestMethod.DELETE) + @ResponseStatus(HttpStatus.NO_CONTENT) + public void delete(@PathVariable("id") String id) { + mdBinService.deleteEntityById(MdBinEntity.class, id); + } + + @RequestMapping(params = "addMdBin") + @ResponseBody + public void addMdBin() { + List 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); + 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.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)); + mdBinEntityList.add(mdBinEntity); + } + } + } + mdBinService.batchSave(mdBinEntityList); + + } } diff --git a/src/main/java/com/zzjee/plc/controller/WmsPlcController.java b/src/main/java/com/zzjee/plc/controller/WmsPlcController.java index 08aeb956..ea9052ad 100644 --- a/src/main/java/com/zzjee/plc/controller/WmsPlcController.java +++ b/src/main/java/com/zzjee/plc/controller/WmsPlcController.java @@ -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 wmsPlcEntityList = new ArrayList(); + 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指令 diff --git a/src/main/java/com/zzjee/plc/entity/WmsPlcEntity.java b/src/main/java/com/zzjee/plc/entity/WmsPlcEntity.java index df595557..ba4a1ed6 100644 --- a/src/main/java/com/zzjee/plc/entity/WmsPlcEntity.java +++ b/src/main/java/com/zzjee/plc/entity/WmsPlcEntity.java @@ -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; + } } diff --git a/src/main/webapp/webpage/com/zzjee/md/mdbinagvlist.jsp b/src/main/webapp/webpage/com/zzjee/md/mdbinagvlist.jsp new file mode 100644 index 00000000..02e0a376 --- /dev/null +++ b/src/main/webapp/webpage/com/zzjee/md/mdbinagvlist.jsp @@ -0,0 +1,231 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> +<%@include file="/context/mytags.jsp" %> + +
+
+<%--
桃红色标识此储位有货,淡绿色标识此储位为空
--%> +
+ 仓库: + + + 开始: + + + 结束: + + + 层数: + + + 行数: + + + 列数: + + + + + +
+ + +
+
+ +
+
+ + diff --git a/src/main/webapp/webpage/com/zzjee/plc/wmsPlc-add.jsp b/src/main/webapp/webpage/com/zzjee/plc/wmsPlc-add.jsp index ecb07db5..dcc0868e 100644 --- a/src/main/webapp/webpage/com/zzjee/plc/wmsPlc-add.jsp +++ b/src/main/webapp/webpage/com/zzjee/plc/wmsPlc-add.jsp @@ -1,206 +1,222 @@ <%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@include file="/context/mytags.jsp"%> - - - - + + PLC指令 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - -
- - - -
-
-
-
- PLCIP: -
-
- - - -
-
- - -
-
- PLC端口: -
-
- - - -
-
- - -
-
- PLC型号: -
-
- - - -
-
- - -
-
- 指令备注: -
-
- - - -
-
- - -
-
- 执行时间: -
-
- - - -
-
- - -
-
- 执行顺序: -
-
- - - -
-
- - -
-
- 指令集: -
-
- - - -
-
- - -
-
- 备用1: -
-
- - - -
-
- - - - - -
-
- -
-
-
- - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ + + + + +
+ + + + + +
+ + + + + +
+ + + + + +
+ + + + + +
+ + + + + +
+ + + + + +
+ + + + + +
+ + + + + +
+ + + + + +
+ + + + + +
+ + + + + + + + +
+
- - \ No newline at end of file + diff --git a/src/main/webapp/webpage/com/zzjee/plc/wmsPlc-update.jsp b/src/main/webapp/webpage/com/zzjee/plc/wmsPlc-update.jsp index ad9393e4..4050e2e5 100644 --- a/src/main/webapp/webpage/com/zzjee/plc/wmsPlc-update.jsp +++ b/src/main/webapp/webpage/com/zzjee/plc/wmsPlc-update.jsp @@ -1,206 +1,210 @@ <%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@include file="/context/mytags.jsp"%> - - - - + + PLC指令 - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - -
- - - -
-
-
-
- PLCIP: -
-
- - - -
-
- - -
-
- PLC端口: -
-
- - - -
-
- - -
-
- PLC型号: -
-
- - - -
-
- - -
-
- 指令备注: -
-
- - - -
-
- - -
-
- 执行时间: -
-
- - - -
-
- - -
-
- 执行顺序: -
-
- - - -
-
- - -
-
- 指令集: -
-
- - - -
-
- - -
-
- 备用1: -
-
- - - -
-
- - - - - -
-
- -
-
-
- - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ + + + + +
+ + + + + +
+ + + + + +
+ + + + + +
+ + + + + +
+ + + + + +
+ + + + + +
+ + + + + +
+ + + + + +
+ + + + + +
+ + + + + +
+ + + + + + + + +
+
- - \ No newline at end of file + diff --git a/src/main/webapp/webpage/com/zzjee/plc/wmsPlc.js b/src/main/webapp/webpage/com/zzjee/plc/wmsPlc.js index 3c340156..5ec72b64 100644 --- a/src/main/webapp/webpage/com/zzjee/plc/wmsPlc.js +++ b/src/main/webapp/webpage/com/zzjee/plc/wmsPlc.js @@ -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); diff --git a/src/main/webapp/webpage/com/zzjee/plc/wmsPlcList.jsp b/src/main/webapp/webpage/com/zzjee/plc/wmsPlcList.jsp index cbd7aa74..32705719 100644 --- a/src/main/webapp/webpage/com/zzjee/plc/wmsPlcList.jsp +++ b/src/main/webapp/webpage/com/zzjee/plc/wmsPlcList.jsp @@ -14,14 +14,19 @@ - - - - - - - - + + + + + + + + + + + + +