cez 2023-01-24 16:00:39 +08:00
commit 25f4aaf0da
15 changed files with 2305 additions and 12080 deletions

View File

@ -1,21 +1,21 @@
JEEWMSQQ交流群335607153 有任何问题可以加群交流
JEEWMSQQ交流群335607153 有任何问题可以加群交流 基于JEECG-BOOT开发的前后端分离版本于20221111日发布届时欢迎大家多多提意见
**智能制造产品JEEMES已经开源** (https://gitee.com/erzhongxmu/jeemes) 欢迎大家STAR
测试系统地址 http://47.113.229.131:9080/wms 用户名test 密码123456 本地启动的用户名admin 密码llg123
android app也已经开源近期更新会比较频繁 app开源地址 https://gitee.com/erzhongxmu/jeewmsapp和https://gitee.com/erzhongxmu/jeewmsapp-uni正在测试完善
测试系统地址 http://47.113.229.131:9080/jeewms 用户名test 密码123456 本地启动的用户名admin 密码llg123
android app也已经开源近期更新会比较频繁 app开源地址 https://gitee.com/erzhongxmu/JeeWMSapp-uni
大家看到了star一下谢谢本团队会持续更新一直开源
欢迎喜欢的朋友一起来优化功能。
开源不易,如果大家需要购买华为云可以通过我们的专属链接,优惠多多 [华为云服务器优惠购买](https://account.huaweicloud.com/obmgr/invitation/invitation.html?bpName=0000000100000002F529029E50A53299E1C24B9DC20691B285756AA52DA030F9E7013E8FF7E22C3EFF074BF9586E43C07842F8F96D38EC45878383D1D406B2F7341FC7D6635CED56&inviteCode=0000000100000002FC491B524CF3FDCE52F12DFD3BB98C8AB2DD5D05BA2CCD464D69E4293D91369A&bindType=1&isDefault=1)
一、项目简介:
jeewms在经过多家公司上线运行后,为了降低物流仓储企业的信息化成本,决定全面开源
JeeWMS在经过多家公司上线运行后,为了降低物流仓储企业的信息化成本,决定全面开源
此产品。针对有特殊信息化需求的企业,提供高性价比的实施服务。
产品特点:
1、适用范围第三方物流仓储企业冷链仓库自营仓储等。
2、技术特点基于JAVA的WEB后台基于ANDROID开发的PDA系统。
2、技术特点基于JAVA的WEB后台基于UNIAPP开发的PDA系统。
3、功能特点涵盖订单管理系统OMS仓储管理系统WMS计费管理系统BMS现场作业系统RF第三方接口模块
4、接口支持已经对接SAP ECCSAP HANA 数据库用友U8百胜E3UAS。
@ -53,7 +53,7 @@ android app也已经开源近期更新会比较频繁 app开源地址 https:
5、主要技术
开发语言JAVA。
6、技术架构
基础架构基于jeecg。技术架构为SpringMVC+Hibernat+Minidao(类Mybatis)+Easyui(UI库)+ Jquery + Boostrap + Ehcache + Redis + Ztree等基础架构
基础架构基于jeecg。技术架构为SpringMVC+Hibernat+Minidao(类Mybatis)+Easyui(UI库)+ Jquery + Bootstrap + Ehcache + Redis + Ztree等基础架构
四、技术支持:

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -806,7 +806,7 @@
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.8.3</version>
<version>1.15.3</version>
</dependency>
<!-- google 工具类 -->
<dependency>

File diff suppressed because it is too large Load Diff

View File

@ -1,19 +1,24 @@
package com.zzjee.plc.controller;
import HslCommunication.Core.Types.OperateResult;
import HslCommunication.Profinet.Siemens.SiemensPLCS;
import HslCommunication.Profinet.Siemens.SiemensS7Net;
import com.zzjee.plc.entity.WmsPlcEntity;
import com.zzjee.plc.service.WmsPlcServiceI;
import java.util.ArrayList;
import java.util.List;
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;
@ -32,6 +37,7 @@ import org.jeecgframework.web.system.service.SystemService;
import org.jeecgframework.core.util.MyBeanUtils;
import java.io.OutputStream;
import org.jeecgframework.core.util.BrowserUtils;
import org.jeecgframework.poi.excel.ExcelExportUtil;
import org.jeecgframework.poi.excel.ExcelImportUtil;
@ -42,12 +48,16 @@ import org.jeecgframework.poi.excel.entity.vo.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.vo.TemplateExcelConstants;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.jeecgframework.core.util.ResourceUtil;
import java.io.IOException;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import java.util.Map;
import java.util.HashMap;
import org.jeecgframework.core.util.ExceptionUtil;
import org.springframework.http.ResponseEntity;
@ -61,400 +71,493 @@ import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.jeecgframework.core.beanvalidator.BeanValidators;
import java.util.Set;
import javax.validation.ConstraintViolation;
import javax.validation.Validator;
import java.net.URI;
import org.springframework.http.MediaType;
import org.springframework.web.util.UriComponentsBuilder;
/**
* @author onlineGenerator
* @version V1.0
* @Title: Controller
* @Description: PLC
* @author onlineGenerator
* @date 2022-09-12 18:33:25
* @version V1.0
*
*/
@Controller
@RequestMapping("/wmsPlcController")
public class WmsPlcController extends BaseController {
/**
* Logger for this class
*/
private static final Logger logger = Logger.getLogger(WmsPlcController.class);
/**
* Logger for this class
*/
private static final Logger logger = Logger.getLogger(WmsPlcController.class);
@Autowired
private WmsPlcServiceI wmsPlcService;
@Autowired
private SystemService systemService;
@Autowired
private Validator validator;
@Autowired
private WmsPlcServiceI wmsPlcService;
@Autowired
private SystemService systemService;
@Autowired
private Validator validator;
/**
* PLC
*
* @return
*/
@RequestMapping(params = "list")
public ModelAndView list(HttpServletRequest request) {
return new ModelAndView("com/zzjee/plc/wmsPlcList");
}
/**
* PLC
*
* @return
*/
@RequestMapping(params = "list")
public ModelAndView list(HttpServletRequest request) {
return new ModelAndView("com/zzjee/plc/wmsPlcList");
}
/**
* easyui AJAX
*
* @param request
* @param response
* @param dataGrid
*/
/**
* easyui AJAX
*
* @param request
* @param response
* @param dataGrid
*/
@RequestMapping(params = "datagrid")
public void datagrid(WmsPlcEntity wmsPlc, HttpServletRequest request, HttpServletResponse response, DataGrid dataGrid) {
CriteriaQuery cq = new CriteriaQuery(WmsPlcEntity.class, dataGrid);
//查询条件组装器
org.jeecgframework.core.extend.hqlsearch.HqlGenerateUtil.installHql(cq, wmsPlc, request.getParameterMap());
try {
//自定义追加查询条件
} catch (Exception e) {
throw new BusinessException(e.getMessage());
}
cq.add();
this.wmsPlcService.getDataGridReturn(cq, true);
TagUtil.datagrid(response, dataGrid);
}
@RequestMapping(params = "datagrid")
public void datagrid(WmsPlcEntity wmsPlc,HttpServletRequest request, HttpServletResponse response, DataGrid dataGrid) {
CriteriaQuery cq = new CriteriaQuery(WmsPlcEntity.class, dataGrid);
//查询条件组装器
org.jeecgframework.core.extend.hqlsearch.HqlGenerateUtil.installHql(cq, wmsPlc, request.getParameterMap());
try{
//自定义追加查询条件
}catch (Exception e) {
throw new BusinessException(e.getMessage());
}
cq.add();
this.wmsPlcService.getDataGridReturn(cq, true);
TagUtil.datagrid(response, dataGrid);
}
/**
* PLC
*
* @return
*/
@RequestMapping(params = "doDel")
@ResponseBody
public AjaxJson doDel(WmsPlcEntity wmsPlc, HttpServletRequest request) {
String message = null;
AjaxJson j = new AjaxJson();
wmsPlc = systemService.getEntity(WmsPlcEntity.class, wmsPlc.getId());
message = "PLC指令删除成功";
try {
wmsPlcService.delete(wmsPlc);
systemService.addLog(message, Globals.Log_Type_DEL, Globals.Log_Leavel_INFO);
} catch (Exception e) {
e.printStackTrace();
message = "PLC指令删除失败";
throw new BusinessException(e.getMessage());
}
j.setMsg(message);
return j;
}
/**
* PLC
*
* @return
*/
@RequestMapping(params = "doDel")
@ResponseBody
public AjaxJson doDel(WmsPlcEntity wmsPlc, HttpServletRequest request) {
String message = null;
AjaxJson j = new AjaxJson();
wmsPlc = systemService.getEntity(WmsPlcEntity.class, wmsPlc.getId());
message = "PLC指令删除成功";
try{
wmsPlcService.delete(wmsPlc);
systemService.addLog(message, Globals.Log_Type_DEL, Globals.Log_Leavel_INFO);
}catch(Exception e){
e.printStackTrace();
message = "PLC指令删除失败";
throw new BusinessException(e.getMessage());
}
j.setMsg(message);
return j;
}
/**
* PLC
*
* @return
*/
@RequestMapping(params = "dotoup")
@ResponseBody
public AjaxJson dotoup(String ids, HttpServletRequest request) {
String message = null;
AjaxJson j = new AjaxJson();
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 runu() {
WmsPlcEntity wmsPlc = null;
String hql = "";
List<WmsPlcEntity> wmsPlcEntityList = new ArrayList<WmsPlcEntity>();
hql = "from WmsPlcEntity t where t.comNo = ? ";
wmsPlcEntityList = systemService.findHql(hql, "runu");
if (!CollectionUtils.isEmpty(wmsPlcEntityList)) {
wmsPlc = wmsPlcEntityList.get(0);
}
String[] coms = wmsPlc.getComCons().split(";");
for (String com : coms) {
String comid[] = com.split(",");
String comno = comid[0];
String comstep = comid[1];
run("", comno, comstep);
}
/**
* PLC
*
* @return
*/
@RequestMapping(params = "dotoup")
@ResponseBody
public AjaxJson dotoup(String ids,HttpServletRequest request){
String message = null;
AjaxJson j = new AjaxJson();
message = "PLC指令执行成功";
try{
for(String id:ids.split(",")){
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) {
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]));
}
}
}
public void run(String id, String comNo, String stepNum) {
System.out.println("id:" + id + ";comNo:" + comNo + ";stepNum:" + stepNum);
if (stepNum.equals("0")) {
return;
}
WmsPlcEntity wmsPlc = null;
if (StringUtil.isNotEmpty(id)) {
wmsPlc = systemService.getEntity(WmsPlcEntity.class, id);
}
if (StringUtil.isNotEmpty(comNo)) {
//执行完指令等待时间
Thread.sleep(Long.parseLong(wmsPlc.getComTime()));
}
}catch(Exception e){
e.printStackTrace();
message = "PLC指令执行失败";
throw new BusinessException(e.getMessage());
}
j.setMsg(message);
return j;
}
/**
* PLC
*
* @return
*/
@RequestMapping(params = "doBatchDel")
@ResponseBody
public AjaxJson doBatchDel(String ids,HttpServletRequest request){
String message = null;
AjaxJson j = new AjaxJson();
message = "PLC指令删除成功";
try{
for(String id:ids.split(",")){
WmsPlcEntity wmsPlc = systemService.getEntity(WmsPlcEntity.class,
id
);
wmsPlcService.delete(wmsPlc);
systemService.addLog(message, Globals.Log_Type_DEL, Globals.Log_Leavel_INFO);
}
}catch(Exception e){
e.printStackTrace();
message = "PLC指令删除失败";
throw new BusinessException(e.getMessage());
}
j.setMsg(message);
return j;
}
String hql = "";
List<WmsPlcEntity> wmsPlcEntityList = new ArrayList<WmsPlcEntity>();
hql = "from WmsPlcEntity t where t.comNo = ? ";
wmsPlcEntityList = systemService.findHql(hql, comNo);
if (!CollectionUtils.isEmpty(wmsPlcEntityList)) {
wmsPlc = wmsPlcEntityList.get(0);
}
}
if (wmsPlc != null) {
long start = System.currentTimeMillis();
SiemensPLCS siemensPLCS = SiemensPLCS.S200Smart;
SiemensS7Net siemensS7Net = null;
siemensS7Net = new SiemensS7Net(siemensPLCS);
siemensS7Net.setIpAddress(wmsPlc.getPlcIp());
siemensS7Net.setPort(Integer.parseInt(wmsPlc.getPlcPort()));
OperateResult connect = siemensS7Net.ConnectServer();
if (connect.IsSuccess) {
System.out.println("connect success");
} else {
System.out.println("connect error");
try {
siemensS7Net.ConnectClose();
} catch (Exception e) {
e.printStackTrace();
}
}
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 = comCons.split(";");
for (String com : coms) {
System.out.println("指令:" + com);
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;
System.out.println("runfloat" + Math.abs(runfloat));
siemensS7Net.Write(defaultAddress, Math.abs(runfloat));
} else if (split[0].equals("-float")) {
Float runfloat = Float.parseFloat(split[2]) * stepNumrun;
System.out.println("runfloat" + runfloat);
siemensS7Net.Write(defaultAddress, runfloat);
} else if (split[0].equals("int")) {
Float runfloat = Float.parseFloat(split[2]) * stepNumrun;
Float abs = Math.abs(runfloat);
int runint = abs.intValue();
System.out.println("runint" + runint);
siemensS7Net.Write(defaultAddress, runint);
} else if (split[0].equals("-int")) {
Float runfloat = Float.parseFloat(split[2]) * stepNumrun;
int runint = runfloat.intValue();
System.out.println("runint" + runint);
siemensS7Net.Write(defaultAddress, runint);
}
}
//执行完指令等待时间
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 + "毫秒" + comCons);
}
/**
* PLC
*
* @return
*/
@RequestMapping(params = "doAdd")
@ResponseBody
public AjaxJson doAdd(WmsPlcEntity wmsPlc, HttpServletRequest request) {
String message = null;
AjaxJson j = new AjaxJson();
message = "PLC指令添加成功";
try{
wmsPlcService.save(wmsPlc);
systemService.addLog(message, Globals.Log_Type_INSERT, Globals.Log_Leavel_INFO);
}catch(Exception e){
e.printStackTrace();
message = "PLC指令添加失败";
throw new BusinessException(e.getMessage());
}
j.setMsg(message);
return j;
}
}
/**
* PLC
*
* @return
*/
@RequestMapping(params = "doUpdate")
@ResponseBody
public AjaxJson doUpdate(WmsPlcEntity wmsPlc, HttpServletRequest request) {
String message = null;
AjaxJson j = new AjaxJson();
message = "PLC指令更新成功";
WmsPlcEntity t = wmsPlcService.get(WmsPlcEntity.class, wmsPlc.getId());
try {
MyBeanUtils.copyBeanNotNull2Bean(wmsPlc, t);
wmsPlcService.saveOrUpdate(t);
systemService.addLog(message, Globals.Log_Type_UPDATE, Globals.Log_Leavel_INFO);
} catch (Exception e) {
e.printStackTrace();
message = "PLC指令更新失败";
throw new BusinessException(e.getMessage());
}
j.setMsg(message);
return j;
}
/**
* PLC
*
* @return
*/
@RequestMapping(params = "doBatchDel")
@ResponseBody
public AjaxJson doBatchDel(String ids, HttpServletRequest request) {
String message = null;
AjaxJson j = new AjaxJson();
message = "PLC指令删除成功";
try {
for (String id : ids.split(",")) {
WmsPlcEntity wmsPlc = systemService.getEntity(WmsPlcEntity.class,
id
);
wmsPlcService.delete(wmsPlc);
systemService.addLog(message, Globals.Log_Type_DEL, Globals.Log_Leavel_INFO);
}
} catch (Exception e) {
e.printStackTrace();
message = "PLC指令删除失败";
throw new BusinessException(e.getMessage());
}
j.setMsg(message);
return j;
}
/**
* PLC
*
* @return
*/
@RequestMapping(params = "goAdd")
public ModelAndView goAdd(WmsPlcEntity wmsPlc, HttpServletRequest req) {
if (StringUtil.isNotEmpty(wmsPlc.getId())) {
wmsPlc = wmsPlcService.getEntity(WmsPlcEntity.class, wmsPlc.getId());
req.setAttribute("wmsPlcPage", wmsPlc);
}
return new ModelAndView("com/zzjee/plc/wmsPlc-add");
}
/**
* PLC
*
* @return
*/
@RequestMapping(params = "goUpdate")
public ModelAndView goUpdate(WmsPlcEntity wmsPlc, HttpServletRequest req) {
if (StringUtil.isNotEmpty(wmsPlc.getId())) {
wmsPlc = wmsPlcService.getEntity(WmsPlcEntity.class, wmsPlc.getId());
req.setAttribute("wmsPlcPage", wmsPlc);
}
return new ModelAndView("com/zzjee/plc/wmsPlc-update");
}
/**
* PLC
*
* @return
*/
@RequestMapping(params = "doAdd")
@ResponseBody
public AjaxJson doAdd(WmsPlcEntity wmsPlc, HttpServletRequest request) {
String message = null;
AjaxJson j = new AjaxJson();
message = "PLC指令添加成功";
try {
wmsPlcService.save(wmsPlc);
systemService.addLog(message, Globals.Log_Type_INSERT, Globals.Log_Leavel_INFO);
} catch (Exception e) {
e.printStackTrace();
message = "PLC指令添加失败";
throw new BusinessException(e.getMessage());
}
j.setMsg(message);
return j;
}
/**
*
*
* @return
*/
@RequestMapping(params = "upload")
public ModelAndView upload(HttpServletRequest req) {
req.setAttribute("controller_name","wmsPlcController");
return new ModelAndView("common/upload/pub_excel_upload");
}
/**
* PLC
*
* @return
*/
@RequestMapping(params = "doUpdate")
@ResponseBody
public AjaxJson doUpdate(WmsPlcEntity wmsPlc, HttpServletRequest request) {
String message = null;
AjaxJson j = new AjaxJson();
message = "PLC指令更新成功";
WmsPlcEntity t = wmsPlcService.get(WmsPlcEntity.class, wmsPlc.getId());
try {
MyBeanUtils.copyBeanNotNull2Bean(wmsPlc, t);
wmsPlcService.saveOrUpdate(t);
systemService.addLog(message, Globals.Log_Type_UPDATE, Globals.Log_Leavel_INFO);
} catch (Exception e) {
e.printStackTrace();
message = "PLC指令更新失败";
throw new BusinessException(e.getMessage());
}
j.setMsg(message);
return j;
}
/**
* excel
*
* @param request
* @param response
*/
@RequestMapping(params = "exportXls")
public String exportXls(WmsPlcEntity wmsPlc,HttpServletRequest request,HttpServletResponse response
, DataGrid dataGrid,ModelMap modelMap) {
CriteriaQuery cq = new CriteriaQuery(WmsPlcEntity.class, dataGrid);
org.jeecgframework.core.extend.hqlsearch.HqlGenerateUtil.installHql(cq, wmsPlc, request.getParameterMap());
List<WmsPlcEntity> wmsPlcs = this.wmsPlcService.getListByCriteriaQuery(cq,false);
modelMap.put(NormalExcelConstants.FILE_NAME,"PLC指令");
modelMap.put(NormalExcelConstants.CLASS,WmsPlcEntity.class);
modelMap.put(NormalExcelConstants.PARAMS,new ExportParams("PLC指令列表", "导出人:"+ResourceUtil.getSessionUserName().getRealName(),
"导出信息"));
modelMap.put(NormalExcelConstants.DATA_LIST,wmsPlcs);
return NormalExcelConstants.JEECG_EXCEL_VIEW;
}
/**
* excel 使
*
* @param request
* @param response
*/
@RequestMapping(params = "exportXlsByT")
public String exportXlsByT(WmsPlcEntity wmsPlc,HttpServletRequest request,HttpServletResponse response
, DataGrid dataGrid,ModelMap modelMap) {
modelMap.put(NormalExcelConstants.FILE_NAME,"PLC指令");
modelMap.put(NormalExcelConstants.CLASS,WmsPlcEntity.class);
modelMap.put(NormalExcelConstants.PARAMS,new ExportParams("PLC指令列表", "导出人:"+ResourceUtil.getSessionUserName().getRealName(),
"导出信息"));
modelMap.put(NormalExcelConstants.DATA_LIST,new ArrayList());
return NormalExcelConstants.JEECG_EXCEL_VIEW;
}
@SuppressWarnings("unchecked")
@RequestMapping(params = "importExcel", method = RequestMethod.POST)
@ResponseBody
public AjaxJson importExcel(HttpServletRequest request, HttpServletResponse response) {
AjaxJson j = new AjaxJson();
/**
* PLC
*
* @return
*/
@RequestMapping(params = "goAdd")
public ModelAndView goAdd(WmsPlcEntity wmsPlc, HttpServletRequest req) {
if (StringUtil.isNotEmpty(wmsPlc.getId())) {
wmsPlc = wmsPlcService.getEntity(WmsPlcEntity.class, wmsPlc.getId());
req.setAttribute("wmsPlcPage", wmsPlc);
}
return new ModelAndView("com/zzjee/plc/wmsPlc-add");
}
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
MultipartFile file = entity.getValue();// 获取上传文件对象
ImportParams params = new ImportParams();
params.setTitleRows(2);
params.setHeadRows(1);
params.setNeedSave(true);
try {
List<WmsPlcEntity> listWmsPlcEntitys = ExcelImportUtil.importExcel(file.getInputStream(),WmsPlcEntity.class,params);
for (WmsPlcEntity wmsPlc : listWmsPlcEntitys) {
wmsPlcService.save(wmsPlc);
}
j.setMsg("文件导入成功!");
} catch (Exception e) {
j.setMsg("文件导入失败!");
logger.error(ExceptionUtil.getExceptionMessage(e));
}finally{
try {
file.getInputStream().close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
return j;
}
/**
* PLC
*
* @return
*/
@RequestMapping(params = "goUpdate")
public ModelAndView goUpdate(WmsPlcEntity wmsPlc, HttpServletRequest req) {
if (StringUtil.isNotEmpty(wmsPlc.getId())) {
wmsPlc = wmsPlcService.getEntity(WmsPlcEntity.class, wmsPlc.getId());
req.setAttribute("wmsPlcPage", wmsPlc);
}
return new ModelAndView("com/zzjee/plc/wmsPlc-update");
}
@RequestMapping(method = RequestMethod.GET)
@ResponseBody
public List<WmsPlcEntity> list() {
List<WmsPlcEntity> listWmsPlcs=wmsPlcService.getList(WmsPlcEntity.class);
return listWmsPlcs;
}
/**
*
*
* @return
*/
@RequestMapping(params = "upload")
public ModelAndView upload(HttpServletRequest req) {
req.setAttribute("controller_name", "wmsPlcController");
return new ModelAndView("common/upload/pub_excel_upload");
}
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
@ResponseBody
public ResponseEntity<?> get(@PathVariable("id") String id) {
WmsPlcEntity task = wmsPlcService.get(WmsPlcEntity.class, id);
if (task == null) {
return new ResponseEntity(HttpStatus.NOT_FOUND);
}
return new ResponseEntity(task, HttpStatus.OK);
}
/**
* excel
*
* @param request
* @param response
*/
@RequestMapping(params = "exportXls")
public String exportXls(WmsPlcEntity wmsPlc, HttpServletRequest request, HttpServletResponse response
, DataGrid dataGrid, ModelMap modelMap) {
CriteriaQuery cq = new CriteriaQuery(WmsPlcEntity.class, dataGrid);
org.jeecgframework.core.extend.hqlsearch.HqlGenerateUtil.installHql(cq, wmsPlc, request.getParameterMap());
List<WmsPlcEntity> wmsPlcs = this.wmsPlcService.getListByCriteriaQuery(cq, false);
modelMap.put(NormalExcelConstants.FILE_NAME, "PLC指令");
modelMap.put(NormalExcelConstants.CLASS, WmsPlcEntity.class);
modelMap.put(NormalExcelConstants.PARAMS, new ExportParams("PLC指令列表", "导出人:" + ResourceUtil.getSessionUserName().getRealName(),
"导出信息"));
modelMap.put(NormalExcelConstants.DATA_LIST, wmsPlcs);
return NormalExcelConstants.JEECG_EXCEL_VIEW;
}
@RequestMapping(method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
@ResponseBody
public ResponseEntity<?> create(@RequestBody WmsPlcEntity wmsPlc, UriComponentsBuilder uriBuilder) {
//调用JSR303 Bean Validator进行校验如果出错返回含400错误码及json格式的错误信息.
Set<ConstraintViolation<WmsPlcEntity>> failures = validator.validate(wmsPlc);
if (!failures.isEmpty()) {
return new ResponseEntity(BeanValidators.extractPropertyAndMessage(failures), HttpStatus.BAD_REQUEST);
}
/**
* excel 使
*
* @param request
* @param response
*/
@RequestMapping(params = "exportXlsByT")
public String exportXlsByT(WmsPlcEntity wmsPlc, HttpServletRequest request, HttpServletResponse response
, DataGrid dataGrid, ModelMap modelMap) {
modelMap.put(NormalExcelConstants.FILE_NAME, "PLC指令");
modelMap.put(NormalExcelConstants.CLASS, WmsPlcEntity.class);
modelMap.put(NormalExcelConstants.PARAMS, new ExportParams("PLC指令列表", "导出人:" + ResourceUtil.getSessionUserName().getRealName(),
"导出信息"));
modelMap.put(NormalExcelConstants.DATA_LIST, new ArrayList());
return NormalExcelConstants.JEECG_EXCEL_VIEW;
}
//保存
try{
wmsPlcService.save(wmsPlc);
} catch (Exception e) {
e.printStackTrace();
return new ResponseEntity(HttpStatus.NO_CONTENT);
}
//按照Restful风格约定创建指向新任务的url, 也可以直接返回id或对象.
String id = wmsPlc.getId();
URI uri = uriBuilder.path("/rest/wmsPlcController/" + id).build().toUri();
HttpHeaders headers = new HttpHeaders();
headers.setLocation(uri);
@SuppressWarnings("unchecked")
@RequestMapping(params = "importExcel", method = RequestMethod.POST)
@ResponseBody
public AjaxJson importExcel(HttpServletRequest request, HttpServletResponse response) {
AjaxJson j = new AjaxJson();
return new ResponseEntity(headers, HttpStatus.CREATED);
}
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
MultipartFile file = entity.getValue();// 获取上传文件对象
ImportParams params = new ImportParams();
params.setTitleRows(2);
params.setHeadRows(1);
params.setNeedSave(true);
try {
List<WmsPlcEntity> listWmsPlcEntitys = ExcelImportUtil.importExcel(file.getInputStream(), WmsPlcEntity.class, params);
for (WmsPlcEntity wmsPlc : listWmsPlcEntitys) {
wmsPlcService.save(wmsPlc);
}
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(value = "/{id}", method = RequestMethod.PUT, consumes = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<?> update(@RequestBody WmsPlcEntity wmsPlc) {
//调用JSR303 Bean Validator进行校验如果出错返回含400错误码及json格式的错误信息.
Set<ConstraintViolation<WmsPlcEntity>> failures = validator.validate(wmsPlc);
if (!failures.isEmpty()) {
return new ResponseEntity(BeanValidators.extractPropertyAndMessage(failures), HttpStatus.BAD_REQUEST);
}
@RequestMapping(method = RequestMethod.GET)
@ResponseBody
public List<WmsPlcEntity> list() {
List<WmsPlcEntity> listWmsPlcs = wmsPlcService.getList(WmsPlcEntity.class);
return listWmsPlcs;
}
//保存
try{
wmsPlcService.saveOrUpdate(wmsPlc);
} catch (Exception e) {
e.printStackTrace();
return new ResponseEntity(HttpStatus.NO_CONTENT);
}
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
@ResponseBody
public ResponseEntity<?> get(@PathVariable("id") String id) {
WmsPlcEntity task = wmsPlcService.get(WmsPlcEntity.class, id);
if (task == null) {
return new ResponseEntity(HttpStatus.NOT_FOUND);
}
return new ResponseEntity(task, HttpStatus.OK);
}
//按Restful约定返回204状态码, 无内容. 也可以返回200状态码.
return new ResponseEntity(HttpStatus.NO_CONTENT);
}
@RequestMapping(method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
@ResponseBody
public ResponseEntity<?> create(@RequestBody WmsPlcEntity wmsPlc, UriComponentsBuilder uriBuilder) {
//调用JSR303 Bean Validator进行校验如果出错返回含400错误码及json格式的错误信息.
Set<ConstraintViolation<WmsPlcEntity>> failures = validator.validate(wmsPlc);
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) {
wmsPlcService.deleteEntityById(WmsPlcEntity.class, id);
}
//保存
try {
wmsPlcService.save(wmsPlc);
} catch (Exception e) {
e.printStackTrace();
return new ResponseEntity(HttpStatus.NO_CONTENT);
}
//按照Restful风格约定创建指向新任务的url, 也可以直接返回id或对象.
String id = wmsPlc.getId();
URI uri = uriBuilder.path("/rest/wmsPlcController/" + id).build().toUri();
HttpHeaders headers = new HttpHeaders();
headers.setLocation(uri);
return new ResponseEntity(headers, HttpStatus.CREATED);
}
@RequestMapping(value = "/{id}", method = RequestMethod.PUT, consumes = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<?> update(@RequestBody WmsPlcEntity wmsPlc) {
//调用JSR303 Bean Validator进行校验如果出错返回含400错误码及json格式的错误信息.
Set<ConstraintViolation<WmsPlcEntity>> failures = validator.validate(wmsPlc);
if (!failures.isEmpty()) {
return new ResponseEntity(BeanValidators.extractPropertyAndMessage(failures), HttpStatus.BAD_REQUEST);
}
//保存
try {
wmsPlcService.saveOrUpdate(wmsPlc);
} catch (Exception e) {
e.printStackTrace();
return new ResponseEntity(HttpStatus.NO_CONTENT);
}
//按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) {
wmsPlcService.deleteEntityById(WmsPlcEntity.class, id);
}
}

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

@ -7,14 +7,7 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@ -32,15 +25,7 @@ import org.jeecgframework.core.constant.Globals;
import org.jeecgframework.core.extend.hqlsearch.parse.ObjectParseUtil;
import org.jeecgframework.core.extend.hqlsearch.parse.PageValueConvertRuleEnum;
import org.jeecgframework.core.extend.hqlsearch.parse.vo.HqlRuleEnum;
import org.jeecgframework.core.util.JSONHelper;
import org.jeecgframework.core.util.ListUtils;
import org.jeecgframework.core.util.MutiLangSqlCriteriaUtil;
import org.jeecgframework.core.util.MutiLangUtil;
import org.jeecgframework.core.util.ResourceUtil;
import org.jeecgframework.core.util.SetListSort;
import org.jeecgframework.core.util.StringUtil;
import org.jeecgframework.core.util.YouBianCodeUtil;
import org.jeecgframework.core.util.oConvertUtils;
import org.jeecgframework.core.util.*;
import org.jeecgframework.tag.core.easyui.TagUtil;
import org.jeecgframework.tag.vo.datatable.SortDirection;
import org.jeecgframework.tag.vo.easyui.ComboTreeModel;
@ -277,36 +262,6 @@ public class SystemController extends BaseController {
return new ModelAndView("system/type/typeListForTypegroup");
}
// @RequestMapping(params = "typeGroupTree")
// @ResponseBody
// public List<ComboTree> typeGroupTree(HttpServletRequest request, HttpServletResponse response, DataGrid dataGrid) {
// CriteriaQuery cq = new CriteriaQuery(TSTypegroup.class);
// List<TSTypegroup> typeGroupList = systemService.getListByCriteriaQuery(cq, false);
// List<ComboTree> trees = new ArrayList<ComboTree>();
// for (TSTypegroup obj : typeGroupList) {
// ComboTree tree = new ComboTree();
// tree.setId(obj.getId());
// tree.setText(obj.getTypegroupname());
// List<TSType> types = obj.getTSTypes();
// if (types != null) {
// if (types.size() > 0) {
// //tree.setState("closed");
// List<ComboTree> children = new ArrayList<ComboTree>();
// for (TSType type : types) {
// ComboTree tree2 = new ComboTree();
// tree2.setId(type.getId());
// tree2.setText(type.getTypename());
// children.add(tree2);
// }
// tree.setChildren(children);
// }
// }
// //tree.setChecked(false);
// trees.add(tree);
// }
// return trees;
// }
@RequestMapping(params = "typeGridTree")
@ResponseBody
@Deprecated // add-begin-end--Author:zhangguoming Date:20140928 for数据字典修改该方法启用数据字典不在已树结构展示了
@ -360,41 +315,6 @@ public class SystemController extends BaseController {
return treeGrids;
}
// private void assembleConditionForMutilLang(CriteriaQuery cq, String typegroupname, List<String> typegroupnameKeyList) {
// Map<String,String> typegroupnameMap = new HashMap<String, String>();
// for (String nameKey : typegroupnameKeyList) {
// String name = mutiLangService.getLang(nameKey);
// typegroupnameMap.put(nameKey, name);
// }
// List<String> tepegroupnameParamList = new ArrayList<String>();
// for (Map.Entry<String, String> entry : typegroupnameMap.entrySet()) {
// String key = entry.getKey();
// String value = entry.getValue();
// if (typegroupname.startsWith("*") && typegroupname.endsWith("*")) {
// if (value.contains(typegroupname)) {
// tepegroupnameParamList.add(key);
// }
// } else if(typegroupname.startsWith("*")) {
// if (value.endsWith(typegroupname.substring(1))) {
// tepegroupnameParamList.add(key);
// }
// } else if(typegroupname.endsWith("*")) {
// if (value.startsWith(typegroupname.substring(0, typegroupname.length() -1))) {
// tepegroupnameParamList.add(key);
// }
// } else {
// if (value.equals(typegroupname)) {
// tepegroupnameParamList.add(key);
// }
// }
// }
//
// if (tepegroupnameParamList.size() > 0) {
// cq.in("typegroupname", tepegroupnameParamList.toArray());
// cq.add();
// }
// }
/**
* IDG
*
@ -1255,7 +1175,9 @@ public class SystemController extends BaseController {
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
MultipartFile mf=multipartRequest.getFile("file");// 获取上传文件对象
fileName = mf.getOriginalFilename();// 获取文件名
String savePath = file.getPath() + File.separator + fileName;
String fileExt = fileName.substring(fileName.lastIndexOf(".") + 1).toLowerCase();
// TODO: 2022/11/30 判断文件后缀
String savePath = file.getPath() + File.separator + fileName;
File savefile = new File(savePath);
FileCopyUtils.copy(mf.getBytes(), savefile);
msg="上传成功";

View File

@ -0,0 +1,293 @@
<%@ 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="float: left; padding-left: 0px;padding-top: 5px;">
<span style="vertical-align:middle;display:-moz-inline-box;display:inline-block;width: 55px;text-align:left;"
title="仓库">仓库: </span>
<input type="text" name="cangku" value="agv" style="width: 55px; height: 30px;">
</span>
<span style="vertical-align:middle;display:-moz-inline-box;display:inline-block;width: 55px;text-align:right;"
title="层数">层数: </span>
<input type="text" name="cengshu" value="01" style="width: 55px; height: 30px;">
</span>
<span style="vertical-align:middle;display:-moz-inline-box;display:inline-block;width: 55px;text-align:right;"
title="行数">行数: </span>
<input type="text" name="hangshu" value="03" style="width: 55px; height: 30px;">
</span>
<span style="vertical-align:middle;display:-moz-inline-box;display:inline-block;width: 55px;text-align:right;"
title="列数">列数: </span>
<input type="text" name="lieshu" value="03" style="width: 55px; height: 30px;">
</span>
</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: 55px;text-align:left;"
title="开始">开始: </span>
<input type="text" id = "chuweiid" name="chuwei" style="width: 55px; height: 30px;">
</span>
<span style="vertical-align:middle;display:-moz-inline-box;display:inline-block;width: 55px;text-align:right;"
title="结束">结束: </span>
<input type="text" id = "desid" name="des" style="width: 55px; height: 30px;">
</span>
<span style="vertical-align:middle;display:-moz-inline-box;display:inline-block;width: 75px;text-align:right;"
title="开始指令">开始指令: </span>
<t:dictSelect id="startcom" field="startcom" type="list" extendJson="{class:'form-control'}"
dictTable="wms_plc" dictField="com_no" dictText="com_remark" hasLabel="false" ></t:dictSelect>
</span>
<span style="vertical-align:middle;display:-moz-inline-box;display:inline-block;width: 75px;text-align:right;"
title="中间指令">中间指令: </span>
<t:dictSelect id="midcom" field="midcom" type="list" extendJson="{class:'form-control'}"
dictTable="wms_plc" dictField="com_no" dictText="com_remark" hasLabel="false" ></t:dictSelect>
</span>
<span style="vertical-align:middle;display:-moz-inline-box;display:inline-block;width: 75px;text-align:right;"
title="结束指令">结束指令: </span>
<t:dictSelect id="endcom" field="endcom" type="list" extendJson="{class:'form-control'}"
dictTable="wms_plc" dictField="com_no" dictText="com_remark" hasLabel="false" ></t:dictSelect>
</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('diaodu')">调度</button> </span>
<button onclick="chaxun('diaoduu')">U型调度</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;
var startcom;
var midcom;
var endcom;
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");
startcom = 'no';
midcom = 'no';
endcom = 'no';
var countstartcom=$("#startcom option").length;
var countmidcom=$("#midcom option").length;
var countendcom=$("#endcom option").length;
for(var i=0;i<countstartcom;i++) {
if ($("#startcom").get(0).options[i].selected) {
startcom = $("#startcom").get(0).options[i].value;
}
}
for(var i=0;i<countmidcom;i++) {
if ($("#midcom").get(0).options[i].selected) {
midcom = $("#midcom").get(0).options[i].value;
}
}
for(var i=0;i<countendcom;i++) {
if ($("#endcom").get(0).options[i].selected) {
endcom = $("#endcom").get(0).options[i].value;
}
}
//加载消息
var url = "mdBinController.do?getbinallagv&binstore=" +
cangku +
"&binid=" + chuwei +
"&des=" + des+
"&cengshu=" + cengshu+
"&hangshu=" + hangshu+
"&type=" + type+
"&startcom=" + startcom+
"&midcom=" + midcom+
"&endcom=" + endcom;
$.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].binid+ " </div> ";
// tincount = list[i].tincount + 0;
// if (tincount > 0) {
// messageContent += " <a class='a01 all' href='javascript:void(0);' onclick='javascript:addtab(\"" + list[i].des + "\")';return false;'>";
// messageContent += list[i].binid + " </a> ";
//
// } else {
// messageContent += " <a class='a02 all' href='javascript:void(0);' >";
// messageContent += list[i].binid + " </a> ";
//
// }
}
// var aList = $('.all')
// console.log(aList)
// for (var i = 0; i < messageList.length; i++) {
// tincount = messageList[i].tincount + 0;
// if (tincount > 0) {
// messageContent += " <a class='a01' href='javascript:void(0);' onclick='javascript:addtab(\"" + messageList[i].des + "\")';return false;'>";
// messageContent += messageList[i].binid + " </a> ";
//
// } else {
// messageContent += " <a class='a02' href='javascript:void(0);' >";
// messageContent += messageList[i].binid + " </a> ";
//
// }
// }
}
$("#bottom").html(messageContent);
// console.dir(messageContent);
}
}
});
}
function print(id) {
if (begindate == "" || enddate == "") {
alert("开始或者结束日期不能为空");
} else {
var url = "mvCusCostController.do?doPrint&id=" + id + "&begindate=" + begindate + "&enddate=" + enddate;
window.open(url);
}
}
</script>

View File

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

View File

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

View File

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

View File

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

View File

@ -36,9 +36,9 @@
<%-- <t:dgToolBar title="批量删除" icon="icon-remove" url="wmToUpGoodsController.do?doBatchDel" funname="deleteALLSelect"></t:dgToolBar> --%>
<t:dgToolBar title="查看" icon="icon-search" url="wmToUpGoodsController.do?goUpdate" funname="detail"></t:dgToolBar>
<t:dgToolBar title="导入库存" icon="icon-put" funname="ImportXls"></t:dgToolBar>
<t:dgToolBar title="清空基础数据" icon="icon-put" funname="ImportXls"></t:dgToolBar>
<t:dgToolBar title="清空库存数据" icon="icon-put" funname="ImportXls"></t:dgToolBar>
<t:dgToolBar title="清空业务数据" icon="icon-put" funname="ImportXls"></t:dgToolBar>
<%-- <t:dgToolBar title="清空基础数据" icon="icon-put" funname="ImportXls"></t:dgToolBar>--%>
<%-- <t:dgToolBar title="清空库存数据" icon="icon-put" funname="ImportXls"></t:dgToolBar>--%>
<%-- <t:dgToolBar title="清空业务数据" icon="icon-put" funname="ImportXls"></t:dgToolBar>--%>
<t:dgToolBar title="导出" icon="icon-putout" funname="ExportXls"></t:dgToolBar>
<t:dgToolBar title="模板下载" icon="icon-putout" funname="ExportXlsByT"></t:dgToolBar>

View File

@ -1,141 +1,160 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="org.jeecgframework.core.util.SysThemesUtil,org.jeecgframework.core.enums.SysThemesEnum"%>
<%@include file="/context/mytags.jsp"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@page import="org.jeecgframework.core.util.SysThemesUtil,org.jeecgframework.core.enums.SysThemesEnum" %>
<%@include file="/context/mytags.jsp" %>
<%
session.setAttribute("lang","zh-cn");
SysThemesEnum sysTheme = SysThemesUtil.getSysTheme(request);
String lhgdialogTheme = SysThemesUtil.getLhgdialogTheme(sysTheme);
session.setAttribute("lang", "zh-cn");
SysThemesEnum sysTheme = SysThemesUtil.getSysTheme(request);
String lhgdialogTheme = SysThemesUtil.getLhgdialogTheme(sysTheme);
%>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta charset="utf-8" />
<title><t:mutiLang langKey="jeect.platform"/></title>
<link rel="shortcut icon" href="images/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
<!-- bootstrap & fontawesome -->
<link rel="stylesheet" href="plug-in/ace/css/bootstrap.css" />
<link rel="stylesheet" href="plug-in/ace/css/font-awesome.css" />
<link rel="stylesheet" type="text/css" href="plug-in/accordion/css/accordion.css">
<!-- text fonts -->
<link rel="stylesheet" href="plug-in/ace/css/ace-fonts.css" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
<meta charset="utf-8"/>
<title><t:mutiLang langKey="jeect.platform"/></title>
<link rel="shortcut icon" href="images/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"/>
<!-- bootstrap & fontawesome -->
<link rel="stylesheet" href="plug-in/ace/css/bootstrap.css"/>
<link rel="stylesheet" href="plug-in/ace/css/font-awesome.css"/>
<link rel="stylesheet" type="text/css" href="plug-in/accordion/css/accordion.css">
<!-- text fonts -->
<link rel="stylesheet" href="plug-in/ace/css/ace-fonts.css"/>
<link rel="stylesheet" href="plug-in/ace/css/jquery-ui.css" />
<!-- ace styles -->
<link rel="stylesheet" href="plug-in/ace/css/ace.css" class="ace-main-stylesheet" id="main-ace-style" />
<!--[if lte IE 9]>
<link rel="stylesheet" href="plug-in/ace/css/ace-part2.css" class="ace-main-stylesheet" />
<![endif]-->
<link rel="stylesheet" href="plug-in/ace/css/jquery-ui.css"/>
<!-- ace styles -->
<link rel="stylesheet" href="plug-in/ace/css/ace.css" class="ace-main-stylesheet" id="main-ace-style"/>
<!--[if lte IE 9]>
<link rel="stylesheet" href="plug-in/ace/css/ace-part2.css" class="ace-main-stylesheet"/>
<![endif]-->
<!--[if lte IE 9]>
<link rel="stylesheet" href="plug-in/ace/css/ace-ie.css" />
<![endif]-->
<!-- ace settings handler -->
<script src="plug-in/ace/js/ace-extra.js"></script>
<!--[if lte IE 9]>
<link rel="stylesheet" href="plug-in/ace/css/ace-ie.css"/>
<![endif]-->
<!-- ace settings handler -->
<script src="plug-in/ace/js/ace-extra.js"></script>
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lte IE 8]>
<script src="plug-in/ace/js/html5shiv.js"></script>
<script src="plug-in/ace/js/respond.js"></script>
<![endif]-->
<!--[if lte IE 8]>
<script src="plug-in/ace/js/html5shiv.js"></script>
<script src="plug-in/ace/js/respond.js"></script>
<![endif]-->
</head>
<body class="login-layout light-login">
<div class="main-container">
<div class="main-content">
<div class="row">
<div class="col-sm-10 col-sm-offset-1">
<div class="login-container">
<div class="center">
<h1 id="id-text2" class="grey">
<!-- <i class="ace-icon fa fa-leaf green"></i> -->
<t:mutiLang langKey="com.sysname"/>
</h1>
<!-- <h4 class="blue" id="id-company-text">www.zzjee.org</h4> -->
</div>
<div class="space-6"></div>
<div class="position-relative">
<div id="login-box" class="login-box visible widget-box no-border">
<div class="widget-body">
<form id="loinForm" class="form-horizontal" check="loginController.do?checkuser" role="form" action="loginController.do?login" method="post">
<div class="widget-main">
<div class="alert alert-warning alert-dismissible" role="alert" id="errMsgContiner">
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<div id="showErrMsg"></div>
</div>
<h4 class="header blue lighter bigger">
<i class="ace-icon fa fa-coffee green"></i>
用户登录
</h4>
<div class="space-6"></div>
<label class="block clearfix">
<div class="main-content">
<div class="row">
<div class="col-sm-10 col-sm-offset-1">
<div class="login-container">
<div class="center">
<h1 id="id-text2" class="grey">
<!-- <i class="ace-icon fa fa-leaf green"></i> -->
<t:mutiLang langKey="com.sysname"/>
</h1>
<!-- <h4 class="blue" id="id-company-text">www.zzjee.org</h4> -->
</div>
<div class="space-6"></div>
<div class="position-relative">
<div id="login-box" class="login-box visible widget-box no-border">
<div class="widget-body">
<form id="loinForm" class="form-horizontal" check="loginController.do?checkuser"
role="form" action="loginController.do?login" method="post">
<div class="widget-main">
<div class="alert alert-warning alert-dismissible" role="alert"
id="errMsgContiner">
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">&times;</span></button>
<div id="showErrMsg"></div>
</div>
<h4 class="header blue lighter bigger">
<i class="ace-icon fa fa-coffee green"></i>
<t:mutiLang langKey="login.info"/>
</h4>
<div class="space-6"></div>
<label class="block clearfix">
<span class="block input-icon input-icon-right">
<input type="text" name="userName" class="form-control" placeholder="请输入用户名" id="userName" value="admin"/>
<input type="text" name="userName" class="form-control" id="userName"
value="admin"/>
<i class="ace-icon fa fa-user"></i>
</span>
</label>
<label class="block clearfix">
</label>
<label class="block clearfix">
<span class="block input-icon input-icon-right">
<input type="password" name="password" class="form-control" placeholder="请输入密码" id="password" value="llg123"/>
<input type="password" name="password" class="form-control" id="password"
value="llg123"/>
<i class="ace-icon fa fa-lock"></i>
</span>
</label>
<label class="block clearfix">
<div class="input-group">
<input type="text" style="width:150px" name="randCode" class="form-control" placeholder="请输入验证码" id="randCode"/>
<span class="input-group-addon" style="padding: 0px;"><img id="randCodeImage" src="randCodeImage" /></span>
</label>
<label class="block clearfix">
<div class="input-group">
<input type="text" style="width:150px" name="randCode"
class="form-control" id="randCode"/>
<span class="input-group-addon" style="padding: 0px;"><img
id="randCodeImage" src="randCodeImage"/></span>
</div>
</label>
<div class="space"></div>
<div class="clearfix">
<label class="inline">
<input type="checkbox" class="ace" id="on_off" name="remember"
value="yes"/>
<span class="lbl">
<t:mutiLang langKey="login.saveusername"/>
</span>
</label>
<button type="button" id="but_login" onclick="checkUser()"
class="width-35 pull-right btn btn-sm btn-primary">
<i class="ace-icon fa fa-key"></i>
<span class="bigger-110">
<t:mutiLang langKey="login.login"/>
</span>
</button>
</div>
<div class="space-4"></div>
</div>
<div class="toolbar clearfix">
<div style="float: right">
<a href="#" class="forgot-password-link">
语言
<i class="ace-icon fa fa-arrow-right"></i>
<t:dictSelect id="langCode" field="langCode" typeGroupCode="lang"
hasLabel="false"
extendJson="{style:'padding:2px; width:80px;'}"
defaultVal="zh-cn"></t:dictSelect>
</a>
</div>
</div>
</form>
</div>
</div>
</label>
<div class="space"></div>
<div class="clearfix">
<label class="inline">
<input type="checkbox" class="ace" id="on_off" name="remember" value="yes"/>
<span class="lbl">记住用户名</span>
</label>
<button type="button" id="but_login" onclick="checkUser()" class="width-35 pull-right btn btn-sm btn-primary">
<i class="ace-icon fa fa-key"></i>
<span class="bigger-110" >登录</span>
</button>
</div>
<div class="space-4"></div>
<%-- <div class="center"><h4 class="blue" id="id-company-text">&copy; 本系统未在任何平台出售源码版权归jeewms所有如果需要服务请联系13850081872</h4></div>--%>
<div class="navbar-fixed-top align-right">
<br/>
&nbsp;
<a id="btn-login-dark" class="blue" href="#" onclick="darkStyle()">Dark</a>
&nbsp;
<span class="blue">/</span>
&nbsp;
<a id="btn-login-blur" class="blue" href="#" onclick="blurStyle()">Blur</a>
&nbsp;
<span class="blue">/</span>
&nbsp;
<a id="btn-login-light" class="blue" href="#" onclick="lightStyle()">Light</a>
&nbsp; &nbsp; &nbsp;
</div>
</div>
</div>
<div class="toolbar clearfix">
<div style="float: right">
<a href="#" class="forgot-password-link">
语言
<i class="ace-icon fa fa-arrow-right"></i>
<t:dictSelect id="langCode" field="langCode" typeGroupCode="lang" hasLabel="false" extendJson="{style:'padding:2px; width:80px;'}" defaultVal="zh-cn"></t:dictSelect>
</a>
</div>
</div>
</form>
</div>
</div>
<%-- <div class="center"><h4 class="blue" id="id-company-text">&copy; 本系统未在任何平台出售源码版权归jeewms所有如果需要服务请联系13850081872</h4></div>--%>
<div class="navbar-fixed-top align-right">
<br />
&nbsp;
<a id="btn-login-dark" class="blue" href="#" onclick="darkStyle()">Dark</a>
&nbsp;
<span class="blue">/</span>
&nbsp;
<a id="btn-login-blur" class="blue" href="#" onclick="blurStyle()">Blur</a>
&nbsp;
<span class="blue">/</span>
&nbsp;
<a id="btn-login-light" class="blue" href="#" onclick="lightStyle()">Light</a>
&nbsp; &nbsp; &nbsp;
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript" src="plug-in/jquery/jquery-1.8.3.min.js"></script>
@ -146,209 +165,214 @@
<script type="text/javascript" src="plug-in/login/js/iphone.check.js"></script>
<script type="text/javascript" src="plug-in/login/js/login.js"></script>
<script type="text/javascript">
$(function(){
optErrMsg();
});
$("#errMsgContiner").hide();
function optErrMsg(){
$("#showErrMsg").html('');
$("#errMsgContiner").hide();
}
//输入验证码,回车登录
$(document).keydown(function(e){
if(e.keyCode == 13) {
$("#but_login").click();
}
});
//验证用户信息
function checkUser(){
if(!validForm()){
return false;
}
newLogin();
}
//表单验证
function validForm(){
if($.trim($("#userName").val()).length==0){
showErrorMsg("请输入用户名");
return false;
}
if($.trim($("#password").val()).length==0){
showErrorMsg("请输入密码");
return false;
}
if($.trim($("#randCode").val()).length==0){
showErrorMsg("请输入验证码");
return false;
}
return true;
}
//登录处理函数
function newLogin(orgId) {
setCookie();
var actionurl=$('form').attr('action');//提交路径
var checkurl=$('form').attr('check');//验证路径
var formData = new Object();
var data=$(":input").each(function() {
formData[this.name] =$("#"+this.name ).val();
$(function () {
optErrMsg();
});
formData['orgId'] = orgId ? orgId : "";
//语言
formData['langCode']=$("#langCode").val();
formData['langCode'] = $("#langCode option:selected").val();
$.ajax({
async : false,
cache : false,
type : 'POST',
url : checkurl,// 请求的action路径
data : formData,
error : function() {// 请求失败处理函数
},
success : function(data) {
var d = $.parseJSON(data);
if (d.success) {
if (d.attributes.orgNum > 1) {
//用户拥有多个部门,需选择部门进行登录
var title, okButton;
if($("#langCode").val() == 'en') {
title = "Please select Org";
okButton = "Ok";
} else {
title = "请选择组织机构";
okButton = "确定";
}
$.dialog({
id: 'LHG1976D',
title: title,
max: false,
min: false,
drag: false,
resize: false,
content: 'url:userController.do?userOrgSelect&userId=' + d.attributes.user.id,
lock:true,
button : [ {
name : okButton,
focus : true,
callback : function() {
iframe = this.iframe.contentWindow;
var orgId = $('#orgId', iframe.document).val();
$("#errMsgContiner").hide();
formData['orgId'] = orgId ? orgId : "";
$.ajax({
async : false,
cache : false,
type : 'POST',
url : 'loginController.do?changeDefaultOrg',// 请求的action路径
data : formData,
error : function() {// 请求失败处理函数
},
success : function(data) {
window.location.href = actionurl;
}
});
this.close();
return false;
}
}],
close: function(){
setTimeout("window.location.href='"+actionurl+"'", 10);
}
});
} else {
window.location.href = actionurl;
}
} else {
showErrorMsg(d.msg);
if(d.msg === "用户名或密码错误" || d.msg === "验证码错误")
reloadRandCodeImage();
function optErrMsg() {
$("#showErrMsg").html('');
$("#errMsgContiner").hide();
}
//输入验证码,回车登录
$(document).keydown(function (e) {
if (e.keyCode == 13) {
$("#but_login").click();
}
}
});
}
//登录提示消息显示
function showErrorMsg(msg){
$("#errMsgContiner").show();
$("#showErrMsg").html(msg);
window.setTimeout(optErrMsg,3000);
}
/**
* 刷新验证码
*/
$('#randCodeImage').click(function(){
reloadRandCodeImage();
});
function reloadRandCodeImage() {
var date = new Date();
var img = document.getElementById("randCodeImage");
img.src='randCodeImage?a=' + date.getTime();
}
function darkStyle(){
$('body').attr('class', 'login-layout');
$('#id-text2').attr('class', 'red');
$('#id-company-text').attr('class', 'blue');
e.preventDefault();
}
function lightStyle(){
$('body').attr('class', 'login-layout light-login');
$('#id-text2').attr('class', 'grey');
$('#id-company-text').attr('class', 'blue');
//验证用户信息
function checkUser() {
if (!validForm()) {
return false;
}
newLogin();
}
e.preventDefault();
}
function blurStyle(){
$('body').attr('class', 'login-layout blur-login');
$('#id-text2').attr('class', 'white');
$('#id-company-text').attr('class', 'light-blue');
//表单验证
function validForm() {
if ($.trim($("#userName").val()).length == 0) {
showErrorMsg("请输入用户名");
return false;
}
e.preventDefault();
}
//设置cookie
function setCookie()
{
if ($('#on_off').val() == '1') {
$("input[iscookie='true']").each(function() {
$.cookie(this.name, $("#"+this.name).val(), "/",24);
$.cookie("COOKIE_NAME","true", "/",24);
});
} else {
$("input[iscookie='true']").each(function() {
$.cookie(this.name,null);
$.cookie("COOKIE_NAME",null);
});
}
}
//读取cookie
function getCookie()
{
var COOKIE_NAME=$.cookie("COOKIE_NAME");
if (COOKIE_NAME !=null) {
$("input[iscookie='true']").each(function() {
$($("#"+this.name).val( $.cookie(this.name)));
if("admin" == $.cookie(this.name)) {
$("#randCode").focus();
} else {
$("#password").val("");
$("#password").focus();
}
});
$("#on_off").attr("checked", true);
$("#on_off").val("1");
}
else
{
$("#on_off").attr("checked", false);
$("#on_off").val("0");
$("#randCode").focus();
}
}
if ($.trim($("#password").val()).length == 0) {
showErrorMsg("请输入密码");
return false;
}
if ($.trim($("#randCode").val()).length == 0) {
showErrorMsg("请输入验证码");
return false;
}
return true;
}
//登录处理函数
function newLogin(orgId) {
setCookie();
var actionurl = $('form').attr('action');//提交路径
var checkurl = $('form').attr('check');//验证路径
var formData = new Object();
var data = $(":input").each(function () {
formData[this.name] = $("#" + this.name).val();
});
formData['orgId'] = orgId ? orgId : "";
//语言
formData['langCode'] = $("#langCode").val();
formData['langCode'] = $("#langCode option:selected").val();
$.ajax({
async: false,
cache: false,
type: 'POST',
url: checkurl,// 请求的action路径
data: formData,
error: function () {// 请求失败处理函数
},
success: function (data) {
var d = $.parseJSON(data);
if (d.success) {
if (d.attributes.orgNum > 1) {
//用户拥有多个部门,需选择部门进行登录
var title, okButton;
if ($("#langCode").val() == 'en') {
title = "Please select Org";
okButton = "Ok";
} else {
title = "请选择组织机构";
okButton = "确定";
}
$.dialog({
id: 'LHG1976D',
title: title,
max: false,
min: false,
drag: false,
resize: false,
content: 'url:userController.do?userOrgSelect&userId=' + d.attributes.user.id,
lock: true,
button: [{
name: okButton,
focus: true,
callback: function () {
iframe = this.iframe.contentWindow;
var orgId = $('#orgId', iframe.document).val();
formData['orgId'] = orgId ? orgId : "";
$.ajax({
async: false,
cache: false,
type: 'POST',
url: 'loginController.do?changeDefaultOrg',// 请求的action路径
data: formData,
error: function () {// 请求失败处理函数
},
success: function (data) {
window.location.href = actionurl;
}
});
this.close();
return false;
}
}],
close: function () {
setTimeout("window.location.href='" + actionurl + "'", 10);
}
});
} else {
window.location.href = actionurl;
}
} else {
showErrorMsg(d.msg);
if (d.msg === "用户名或密码错误" || d.msg === "验证码错误")
reloadRandCodeImage();
}
}
});
}
//登录提示消息显示
function showErrorMsg(msg) {
$("#errMsgContiner").show();
$("#showErrMsg").html(msg);
window.setTimeout(optErrMsg, 3000);
}
/**
* 刷新验证码
*/
$('#randCodeImage').click(function () {
reloadRandCodeImage();
});
function reloadRandCodeImage() {
var date = new Date();
var img = document.getElementById("randCodeImage");
img.src = 'randCodeImage?a=' + date.getTime();
}
function darkStyle() {
$('body').attr('class', 'login-layout');
$('#id-text2').attr('class', 'red');
$('#id-company-text').attr('class', 'blue');
e.preventDefault();
}
function lightStyle() {
$('body').attr('class', 'login-layout light-login');
$('#id-text2').attr('class', 'grey');
$('#id-company-text').attr('class', 'blue');
e.preventDefault();
}
function blurStyle() {
$('body').attr('class', 'login-layout blur-login');
$('#id-text2').attr('class', 'white');
$('#id-company-text').attr('class', 'light-blue');
e.preventDefault();
}
//设置cookie
function setCookie() {
if ($('#on_off').val() == '1') {
$("input[iscookie='true']").each(function () {
$.cookie(this.name, $("#" + this.name).val(), "/", 24);
$.cookie("COOKIE_NAME", "true", "/", 24);
});
} else {
$("input[iscookie='true']").each(function () {
$.cookie(this.name, null);
$.cookie("COOKIE_NAME", null);
});
}
}
//读取cookie
function getCookie() {
var COOKIE_NAME = $.cookie("COOKIE_NAME");
if (COOKIE_NAME != null) {
$("input[iscookie='true']").each(function () {
$($("#" + this.name).val($.cookie(this.name)));
if ("admin" == $.cookie(this.name)) {
$("#randCode").focus();
} else {
$("#password").val("");
$("#password").focus();
}
});
$("#on_off").attr("checked", true);
$("#on_off").val("1");
} else {
$("#on_off").attr("checked", false);
$("#on_off").val("0");
$("#randCode").focus();
}
}
</script>
<%=lhgdialogTheme %>
</body>