Sfoglia il codice sorgente

上传参数解析

hbx 2 settimane fa
parent
commit
bfe10e524b

+ 47 - 0
sql/mes_param_parse_config.sql

@@ -0,0 +1,47 @@
+-- 上传参数解析配置表(方案二:配置化替代代码硬编码)
+-- 数据库:MySQL(mes_cloud_xz)
+CREATE TABLE mes_param_parse_config (
+	id varchar(64) NOT NULL COMMENT '编码',
+	line_sn varchar(50) NOT NULL COMMENT '产线编号(*表示所有产线)',
+	oprno varchar(50) NOT NULL COMMENT '工位号(如OP035,不含尾缀字母)',
+	craft varchar(50) NOT NULL COMMENT '工艺编码',
+	ps_pos int DEFAULT NULL COMMENT 'ps报文位置(从1开始)',
+	result_mode int DEFAULT 0 COMMENT '结果模式(0取报文Y/N 1固定OK)',
+	title varchar(255) DEFAULT NULL COMMENT '描述',
+	status char(1) DEFAULT '0' NOT NULL COMMENT '状态(0正常 1删除 2停用)',
+	create_by varchar(64) NOT NULL COMMENT '创建者',
+	create_date datetime NOT NULL COMMENT '创建时间',
+	update_by varchar(64) NOT NULL COMMENT '更新者',
+	update_date datetime NOT NULL COMMENT '更新时间',
+	remarks varchar(255) DEFAULT NULL COMMENT '备注信息',
+	PRIMARY KEY (id)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='上传参数解析配置';
+
+-- 种子数据:迁移原XT线硬编码规则
+-- OP010 底板码:ps第1、2段,结果固定OK
+INSERT INTO mes_param_parse_config (id, line_sn, oprno, craft, ps_pos, result_mode, title, status, create_by, create_date, update_by, update_date)
+VALUES ('ppc_xt_op010_1', 'XT', 'OP010', '400005', 1, 1, '底板码1(固定OK)', '0', 'system', NOW(), 'system', NOW());
+INSERT INTO mes_param_parse_config (id, line_sn, oprno, craft, ps_pos, result_mode, title, status, create_by, create_date, update_by, update_date)
+VALUES ('ppc_xt_op010_2', 'XT', 'OP010', '400005', 2, 1, '底板码2(固定OK)', '0', 'system', NOW(), 'system', NOW());
+-- OP060/OP100/OP130 程序名称:ps第1段,结果取报文Y/N
+INSERT INTO mes_param_parse_config (id, line_sn, oprno, craft, ps_pos, result_mode, title, status, create_by, create_date, update_by, update_date)
+VALUES ('ppc_xt_op060_1', 'XT', 'OP060', '300001', 1, 0, '程序名称', '0', 'system', NOW(), 'system', NOW());
+INSERT INTO mes_param_parse_config (id, line_sn, oprno, craft, ps_pos, result_mode, title, status, create_by, create_date, update_by, update_date)
+VALUES ('ppc_xt_op100_1', 'XT', 'OP100', '300001', 1, 0, '程序名称', '0', 'system', NOW(), 'system', NOW());
+INSERT INTO mes_param_parse_config (id, line_sn, oprno, craft, ps_pos, result_mode, title, status, create_by, create_date, update_by, update_date)
+VALUES ('ppc_xt_op130_1', 'XT', 'OP130', '300001', 1, 0, '程序名称', '0', 'system', NOW(), 'system', NOW());
+
+-- 后台菜单:挂在"生产管理"(menu_code=1672118505143263232)下
+INSERT INTO js_sys_menu (menu_code, parent_code, parent_codes, tree_sort, tree_sorts, tree_leaf, tree_level, tree_names,
+	menu_name, menu_type, menu_href, menu_target, menu_icon, menu_color, menu_title, permission, weight, is_show,
+	sys_code, module_codes, status, create_by, create_date, update_by, update_date, remarks)
+VALUES ('2043000000000000001', '1672118505143263232', '0,1672118505143263232,', 2060, '0000009290,0000002060,', '1', 1, '生产管理/上传参数解析配置',
+	'上传参数解析配置', '1', '/mes/mesParamParseConfig/list', '', '', '', '',
+	'mes:mesParamParseConfig:view,mes:mesParamParseConfig:edit', 40, '1', 'default', 'app', '0', 'system', NOW(), 'system', NOW(), '');
+
+-- 角色授权:凡是有"生产管理"菜单的角色,自动授予新菜单
+INSERT INTO js_sys_role_menu (role_code, menu_code)
+SELECT rm.role_code, '2043000000000000001'
+FROM js_sys_role_menu rm
+WHERE rm.menu_code = '1672118505143263232'
+	AND NOT EXISTS (SELECT 1 FROM js_sys_role_menu x WHERE x.role_code = rm.role_code AND x.menu_code = '2043000000000000001');

+ 15 - 0
src/main/java/com/jeesite/modules/mes/dao/MesParamParseConfigDao.java

@@ -0,0 +1,15 @@
+package com.jeesite.modules.mes.dao;
+
+import com.jeesite.common.dao.CrudDao;
+import com.jeesite.common.mybatis.annotation.MyBatisDao;
+import com.jeesite.modules.mes.entity.MesParamParseConfig;
+
+/**
+ * 上传参数解析配置DAO接口
+ * @author hzd
+ * @version 2026-10-10
+ */
+@MyBatisDao
+public interface MesParamParseConfigDao extends CrudDao<MesParamParseConfig> {
+
+}

+ 104 - 0
src/main/java/com/jeesite/modules/mes/entity/MesParamParseConfig.java

@@ -0,0 +1,104 @@
+package com.jeesite.modules.mes.entity;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.Size;
+
+import com.jeesite.common.entity.DataEntity;
+import com.jeesite.common.mybatis.annotation.Column;
+import com.jeesite.common.mybatis.annotation.Table;
+import com.jeesite.common.mybatis.mapper.query.QueryType;
+
+/**
+ * 上传参数解析配置Entity
+ * 工位上传结果时,按产线+工位配置解析ps报文参数(替代代码硬编码)
+ * @author hzd
+ * @version 2026-10-10
+ */
+@Table(name="mes_param_parse_config", alias="a", label="上传参数解析配置信息", columns={
+		@Column(name="id", attrName="id", label="编码", isPK=true),
+		@Column(name="line_sn", attrName="lineSn", label="产线编号", queryType=QueryType.LIKE),
+		@Column(name="oprno", attrName="oprno", label="工位号", queryType=QueryType.LIKE),
+		@Column(name="craft", attrName="craft", label="工艺编码", queryType=QueryType.LIKE),
+		@Column(name="ps_pos", attrName="psPos", label="ps报文位置", isQuery=false),
+		@Column(name="result_mode", attrName="resultMode", label="结果模式", isQuery=false),
+		@Column(name="title", attrName="title", label="描述", queryType=QueryType.LIKE),
+		@Column(name="status", attrName="status", label="状态", comment="状态(0正常 1删除 2停用)", isUpdate=false),
+		@Column(name="create_by", attrName="createBy", label="create_by", isUpdate=false, isQuery=false),
+		@Column(name="create_date", attrName="createDate", label="create_date", isUpdate=false, isQuery=false, isUpdateForce=true),
+		@Column(name="update_by", attrName="updateBy", label="update_by", isQuery=false),
+		@Column(name="update_date", attrName="updateDate", label="update_date", isQuery=false, isUpdateForce=true),
+	}, orderBy="a.line_sn asc, a.oprno asc, a.ps_pos asc"
+)
+public class MesParamParseConfig extends DataEntity<MesParamParseConfig> {
+
+	private static final long serialVersionUID = 1L;
+	private String lineSn;		// 产线编号(*表示所有产线)
+	private String oprno;		// 工位号
+	private String craft;		// 工艺编码
+	private Integer psPos;		// ps报文位置(从1开始)
+	private Integer resultMode;	// 结果模式(0取报文Y/N 1固定OK)
+	private String title;		// 描述
+
+	public MesParamParseConfig() {
+		this(null);
+	}
+
+	public MesParamParseConfig(String id){
+		super(id);
+	}
+
+	@NotBlank(message="产线编号不能为空")
+	@Size(min=0, max=50, message="产线编号长度不能超过 50 个字符")
+	public String getLineSn() {
+		return lineSn;
+	}
+
+	public void setLineSn(String lineSn) {
+		this.lineSn = lineSn;
+	}
+
+	@NotBlank(message="工位号不能为空")
+	@Size(min=0, max=50, message="工位号长度不能超过 50 个字符")
+	public String getOprno() {
+		return oprno;
+	}
+
+	public void setOprno(String oprno) {
+		this.oprno = oprno;
+	}
+
+	@NotBlank(message="工艺编码不能为空")
+	@Size(min=0, max=50, message="工艺编码长度不能超过 50 个字符")
+	public String getCraft() {
+		return craft;
+	}
+
+	public void setCraft(String craft) {
+		this.craft = craft;
+	}
+
+	public Integer getPsPos() {
+		return psPos;
+	}
+
+	public void setPsPos(Integer psPos) {
+		this.psPos = psPos;
+	}
+
+	public Integer getResultMode() {
+		return resultMode;
+	}
+
+	public void setResultMode(Integer resultMode) {
+		this.resultMode = resultMode;
+	}
+
+	@Size(min=0, max=255, message="描述长度不能超过 255 个字符")
+	public String getTitle() {
+		return title;
+	}
+
+	public void setTitle(String title) {
+		this.title = title;
+	}
+}

+ 115 - 0
src/main/java/com/jeesite/modules/mes/service/MesParamParseConfigService.java

@@ -0,0 +1,115 @@
+package com.jeesite.modules.mes.service;
+
+import java.util.List;
+
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import com.alibaba.fastjson.JSON;
+import com.jeesite.common.cache.CacheUtils;
+import com.jeesite.common.collect.ListUtils;
+import com.jeesite.common.entity.Page;
+import com.jeesite.common.lang.StringUtils;
+import com.jeesite.common.service.CrudService;
+import com.jeesite.modules.mes.dao.MesParamParseConfigDao;
+import com.jeesite.modules.mes.entity.MesParamParseConfig;
+
+/**
+ * 上传参数解析配置Service
+ * @author hzd
+ * @version 2026-10-10
+ */
+@Service
+public class MesParamParseConfigService extends CrudService<MesParamParseConfigDao, MesParamParseConfig> {
+
+	/**
+	 * 查询某产线某工位生效的参数解析配置(带缓存)
+	 * 匹配规则:line_sn 精确匹配或为*(所有产线);oprno 精确匹配(不含尾缀字母,如OP035A按OP035匹配)
+	 */
+	public List<MesParamParseConfig> findEnabledConfigs(String lineSn, String oprno){
+		if(StringUtils.isEmpty(lineSn) || StringUtils.isEmpty(oprno)){
+			return ListUtils.newArrayList();
+		}
+		List<MesParamParseConfig> all = getAllEnabled();
+		List<MesParamParseConfig> matched = ListUtils.newArrayList();
+		for (MesParamParseConfig config : all){
+			boolean lineOk = "*".equals(config.getLineSn()) || lineSn.equals(config.getLineSn());
+			boolean oprOk = StringUtils.isNotEmpty(config.getOprno()) && config.getOprno().equals(oprno);
+			if(lineOk && oprOk){
+				matched.add(config);
+			}
+		}
+		return matched;
+	}
+
+	private List<MesParamParseConfig> getAllEnabled(){
+		String cached = CacheUtils.get("paramParse","enabled","");
+		if(StringUtils.isNotEmpty(cached)){
+			List<MesParamParseConfig> lists = JSON.parseArray(cached, MesParamParseConfig.class);
+			if(!ListUtils.isEmpty(lists)){
+				return lists;
+			}
+		}
+
+		MesParamParseConfig query = new MesParamParseConfig();
+		query.setStatus("0");
+		List<MesParamParseConfig> lists = findList(query);
+		if(ListUtils.isEmpty(lists)){
+			lists = ListUtils.newArrayList();
+		}
+		CacheUtils.put("paramParse","enabled",JSON.toJSONString(lists));
+		return lists;
+	}
+
+	private void clearCache(){
+		CacheUtils.put("paramParse","enabled","");
+	}
+
+	@Override
+	public MesParamParseConfig get(MesParamParseConfig mesParamParseConfig) {
+		return super.get(mesParamParseConfig);
+	}
+
+	@Override
+	public Page<MesParamParseConfig> findPage(MesParamParseConfig mesParamParseConfig) {
+		return super.findPage(mesParamParseConfig);
+	}
+
+	@Override
+	public List<MesParamParseConfig> findList(MesParamParseConfig mesParamParseConfig) {
+		return super.findList(mesParamParseConfig);
+	}
+
+	/**
+	 * 保存数据(插入或更新)
+	 * @param mesParamParseConfig
+	 */
+	@Override
+	@Transactional
+	public void save(MesParamParseConfig mesParamParseConfig) {
+		super.save(mesParamParseConfig);
+		clearCache();
+	}
+
+	/**
+	 * 更新状态
+	 * @param mesParamParseConfig
+	 */
+	@Override
+	@Transactional
+	public void updateStatus(MesParamParseConfig mesParamParseConfig) {
+		super.updateStatus(mesParamParseConfig);
+		clearCache();
+	}
+
+	/**
+	 * 删除数据
+	 * @param mesParamParseConfig
+	 */
+	@Override
+	@Transactional
+	public void delete(MesParamParseConfig mesParamParseConfig) {
+		super.delete(mesParamParseConfig);
+		clearCache();
+	}
+}

+ 14 - 22
src/main/java/com/jeesite/modules/mes/service/MesProductRecordService.java

@@ -56,6 +56,9 @@ public class MesProductRecordService extends CrudService<MesProductRecordDao, Me
 	private MesTemplateItemsService mesTemplateItemsService;
 
 	@Autowired
+	private MesParamParseConfigService mesParamParseConfigService;
+
+	@Autowired
 	private MesProductRecordUnbindService mesProductRecordUnbindService;
 
 	@Autowired
@@ -1138,34 +1141,23 @@ public class MesProductRecordService extends CrudService<MesProductRecordDao, Me
 		return params;
 	}
 
-	// 获取质量参数数组
+	// 获取质量参数数组(配置驱动:按产线+工位读取mes_param_parse_config解析ps报文)
 	public List<ParamsResp> getQualityParamsXz(String oprno,String lineSn,String ps){
-		String oldOprno = oprno;
-		oprno = CommonUitl.formatOprno(oprno);
 		List<ParamsResp> params = new ArrayList<>();
 		if(StringUtils.isEmpty(ps)){
 			return params;
 		}
-		if(lineSn.equals("XT")){
-			switch (oprno){
-				case "OP010":
-					ParamsResp paramsResp = getParamsRespXz(ps,"400005",1);
-					paramsResp.setResult("OK");
-					params.add(paramsResp);
-					ParamsResp paramsResp2 = getParamsRespXz(ps,"400005",2);
-					paramsResp2.setResult("OK");
-					params.add(paramsResp2);
-					break;
-				case "OP060":
-					params.add(getParamsRespXz(ps,"300001",1)); // 程序名称
-					break;
-				case "OP100":
-					params.add(getParamsRespXz(ps,"300001",1)); // 程序名称
-					break;
-				case "OP130":
-					params.add(getParamsRespXz(ps,"300001",1)); // 程序名称
-					break;
+		oprno = CommonUitl.formatOprno(oprno);
+		List<MesParamParseConfig> configs = mesParamParseConfigService.findEnabledConfigs(lineSn, oprno);
+		for (MesParamParseConfig config : configs){
+			if(config.getPsPos() == null || config.getPsPos() < 1){
+				continue;
+			}
+			ParamsResp paramsResp = getParamsRespXz(ps, config.getCraft(), config.getPsPos());
+			if(config.getResultMode() != null && config.getResultMode() == 1){
+				paramsResp.setResult("OK"); // 固定OK(如底板码绑定类参数)
 			}
+			params.add(paramsResp);
 		}
 
 		return params;

+ 119 - 0
src/main/java/com/jeesite/modules/mes/web/MesParamParseConfigController.java

@@ -0,0 +1,119 @@
+package com.jeesite.modules.mes.web;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import com.jeesite.common.config.Global;
+import com.jeesite.common.entity.Page;
+import com.jeesite.common.web.BaseController;
+import com.jeesite.modules.mes.entity.MesParamParseConfig;
+import com.jeesite.modules.mes.service.MesParamParseConfigService;
+
+/**
+ * 上传参数解析配置Controller
+ * @author hzd
+ * @version 2026-10-10
+ */
+@Controller
+@RequestMapping(value = "${adminPath}/mes/mesParamParseConfig")
+public class MesParamParseConfigController extends BaseController {
+
+	@Autowired
+	private MesParamParseConfigService mesParamParseConfigService;
+
+	/**
+	 * 获取数据
+	 */
+	@ModelAttribute
+	public MesParamParseConfig get(String id, boolean isNewRecord) {
+		return mesParamParseConfigService.get(id, isNewRecord);
+	}
+
+	/**
+	 * 查询列表
+	 */
+	@RequiresPermissions("mes:mesParamParseConfig:view")
+	@RequestMapping(value = {"list", ""})
+	public String list(MesParamParseConfig mesParamParseConfig, Model model) {
+		model.addAttribute("mesParamParseConfig", mesParamParseConfig);
+		return "modules/mes/mesParamParseConfigList";
+	}
+
+	/**
+	 * 查询列表数据
+	 */
+	@RequiresPermissions("mes:mesParamParseConfig:view")
+	@RequestMapping(value = "listData")
+	@ResponseBody
+	public Page<MesParamParseConfig> listData(MesParamParseConfig mesParamParseConfig, HttpServletRequest request, HttpServletResponse response) {
+		mesParamParseConfig.setPage(new Page<>(request, response));
+		Page<MesParamParseConfig> page = mesParamParseConfigService.findPage(mesParamParseConfig);
+		return page;
+	}
+
+	/**
+	 * 查看编辑表单
+	 */
+	@RequiresPermissions("mes:mesParamParseConfig:view")
+	@RequestMapping(value = "form")
+	public String form(MesParamParseConfig mesParamParseConfig, Model model) {
+		model.addAttribute("mesParamParseConfig", mesParamParseConfig);
+		return "modules/mes/mesParamParseConfigForm";
+	}
+
+	/**
+	 * 保存数据
+	 */
+	@RequiresPermissions("mes:mesParamParseConfig:edit")
+	@PostMapping(value = "save")
+	@ResponseBody
+	public String save(@Validated MesParamParseConfig mesParamParseConfig) {
+		mesParamParseConfigService.save(mesParamParseConfig);
+		return renderResult(Global.TRUE, text("保存上传参数解析配置成功!"));
+	}
+
+	/**
+	 * 停用数据
+	 */
+	@RequiresPermissions("mes:mesParamParseConfig:edit")
+	@RequestMapping(value = "disable")
+	@ResponseBody
+	public String disable(MesParamParseConfig mesParamParseConfig) {
+		mesParamParseConfig.setStatus(MesParamParseConfig.STATUS_DISABLE);
+		mesParamParseConfigService.updateStatus(mesParamParseConfig);
+		return renderResult(Global.TRUE, text("停用上传参数解析配置成功"));
+	}
+
+	/**
+	 * 启用数据
+	 */
+	@RequiresPermissions("mes:mesParamParseConfig:edit")
+	@RequestMapping(value = "enable")
+	@ResponseBody
+	public String enable(MesParamParseConfig mesParamParseConfig) {
+		mesParamParseConfig.setStatus(MesParamParseConfig.STATUS_NORMAL);
+		mesParamParseConfigService.updateStatus(mesParamParseConfig);
+		return renderResult(Global.TRUE, text("启用上传参数解析配置成功"));
+	}
+
+	/**
+	 * 删除数据
+	 */
+	@RequiresPermissions("mes:mesParamParseConfig:edit")
+	@RequestMapping(value = "delete")
+	@ResponseBody
+	public String delete(MesParamParseConfig mesParamParseConfig) {
+		mesParamParseConfigService.delete(mesParamParseConfig);
+		return renderResult(Global.TRUE, text("删除上传参数解析配置成功!"));
+	}
+}

+ 107 - 0
src/main/resources/views/modules/mes/mesParamParseConfigForm.html

@@ -0,0 +1,107 @@
+<% layout('/layouts/default.html', {title: '上传参数解析配置管理', libs: ['validate']}){ %>
+<div class="main-content">
+	<div class="box box-main">
+		<div class="box-header with-border">
+			<div class="box-title">
+				<i class="fa icon-note"></i> ${text(mesParamParseConfig.isNewRecord ? '新增参数解析配置' : '编辑参数解析配置')}
+			</div>
+			<div class="box-tools pull-right">
+				<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
+			</div>
+		</div>
+		<#form:form id="inputForm" model="${mesParamParseConfig}" action="${ctx}/mes/mesParamParseConfig/save" method="post" class="form-horizontal">
+			<div class="box-body">
+				<div class="form-unit">${text('基本信息')}</div>
+				<#form:hidden path="id"/>
+				<div class="row">
+					<div class="col-xs-6">
+						<div class="form-group">
+							<label class="control-label col-sm-4" title="">
+								<span class="required ">*</span> ${text('产线编号')}:<i class="fa icon-question" title="填写产线编号(如XT),*表示所有产线"></i></label>
+							<div class="col-sm-8">
+								<#form:input path="lineSn" maxlength="50" class="form-control required"/>
+							</div>
+						</div>
+					</div>
+					<div class="col-xs-6">
+						<div class="form-group">
+							<label class="control-label col-sm-4" title="">
+								<span class="required ">*</span> ${text('工位号')}:<i class="fa icon-question" title="填写工位号(如OP035),不带尾缀字母"></i></label>
+							<div class="col-sm-8">
+								<#form:input path="oprno" maxlength="50" class="form-control required"/>
+							</div>
+						</div>
+					</div>
+				</div>
+				<div class="row">
+					<div class="col-xs-6">
+						<div class="form-group">
+							<label class="control-label col-sm-4" title="">
+								<span class="required ">*</span> ${text('工艺编码')}:<i class="fa icon-question" title="对应mes_product_record的craft,需与建档模板工艺一致"></i></label>
+							<div class="col-sm-8">
+								<#form:input path="craft" maxlength="50" class="form-control required"/>
+							</div>
+						</div>
+					</div>
+					<div class="col-xs-6">
+						<div class="form-group">
+							<label class="control-label col-sm-4" title="">
+								<span class="required ">*</span> ${text('ps报文位置')}:<i class="fa icon-question" title="ps报文按|分割后的段序号,从1开始"></i></label>
+							<div class="col-sm-8">
+								<#form:input path="psPos" type="number" min="1" class="form-control required"/>
+							</div>
+						</div>
+					</div>
+				</div>
+				<div class="row">
+					<div class="col-xs-6">
+						<div class="form-group">
+							<label class="control-label col-sm-4" title="">
+								${text('结果模式')}:<i class="fa icon-question" title="取报文Y/N:结果取该段首字符Y/N;固定OK:结果强制为OK(底板码绑定类参数)"></i></label>
+							<div class="col-sm-8">
+								<select name="resultMode" class="form-control">
+									<option value="0" ${mesParamParseConfig.resultMode == null || mesParamParseConfig.resultMode == 0 ? 'selected' : ''}>取报文Y/N</option>
+									<option value="1" ${mesParamParseConfig.resultMode == 1 ? 'selected' : ''}>固定OK</option>
+								</select>
+							</div>
+						</div>
+					</div>
+					<div class="col-xs-6">
+						<div class="form-group">
+							<label class="control-label col-sm-4" title="">
+								${text('描述')}:</label>
+							<div class="col-sm-8">
+								<#form:input path="title" maxlength="255" class="form-control"/>
+							</div>
+						</div>
+					</div>
+				</div>
+			</div>
+			<div class="box-footer">
+				<div class="row">
+					<div class="col-sm-offset-2 col-sm-10">
+						<% if (hasPermi('mes:mesParamParseConfig:edit')){ %>
+							<button type="submit" class="btn btn-sm btn-primary" id="btnSubmit"><i class="fa fa-check"></i> ${text('保 存')}</button>&nbsp;
+						<% } %>
+						<button type="button" class="btn btn-sm btn-default" id="btnCancel" onclick="js.closeCurrentTabPage()"><i class="fa fa-reply-all"></i> ${text('关 闭')}</button>
+					</div>
+				</div>
+			</div>
+		</#form:form>
+	</div>
+</div>
+<% } %>
+<script>
+$("#inputForm").validate({
+	submitHandler: function(form){
+		js.ajaxSubmitForm($(form), function(data){
+			js.showMessage(data.message);
+			if(data.result == Global.TRUE){
+				js.closeCurrentTabPage(function(contentWindow){
+					contentWindow.page();
+				});
+			}
+		}, "json");
+    }
+});
+</script>

+ 89 - 0
src/main/resources/views/modules/mes/mesParamParseConfigList.html

@@ -0,0 +1,89 @@
+<% layout('/layouts/default.html', {title: '上传参数解析配置管理', libs: ['dataGrid']}){ %>
+<div class="main-content">
+	<div class="box box-main">
+		<div class="box-header">
+			<div class="box-title">
+				<i class="fa icon-notebook"></i> ${text('上传参数解析配置管理')}
+			</div>
+			<div class="box-tools pull-right">
+				<a href="#" class="btn btn-default" id="btnSearch" title="${text('查询')}"><i class="fa fa-filter"></i> ${text('查询')}</a>
+				<% if(hasPermi('mes:mesParamParseConfig:edit')){ %>
+					<a href="${ctx}/mes/mesParamParseConfig/form?isNewRecord" class="btn btn-default btnTool" title="${text('新增参数解析配置')}"><i class="fa fa-plus"></i> ${text('新增')}</a>
+				<% } %>
+				<a href="#" class="btn btn-default" id="btnSetting" title="${text('设置')}"><i class="fa fa-navicon"></i></a>
+			</div>
+		</div>
+		<div class="box-body">
+			<#form:form id="searchForm" model="${mesParamParseConfig}" action="${ctx}/mes/mesParamParseConfig/listData" method="post" class="form-inline hide"
+					data-page-no="${parameter.pageNo}" data-page-size="${parameter.pageSize}" data-order-by="${parameter.orderBy}">
+				<div class="form-group">
+					<label class="control-label">${text('产线编号')}:</label>
+					<div class="control-inline">
+						<#form:input path="lineSn" maxlength="50" class="form-control width-120"/>
+					</div>
+				</div>
+				<div class="form-group">
+					<label class="control-label">${text('工位号')}:</label>
+					<div class="control-inline">
+						<#form:input path="oprno" maxlength="50" class="form-control width-120"/>
+					</div>
+				</div>
+				<div class="form-group">
+					<label class="control-label">${text('工艺编码')}:</label>
+					<div class="control-inline">
+						<#form:input path="craft" maxlength="50" class="form-control width-120"/>
+					</div>
+				</div>
+				<div class="form-group">
+					<label class="control-label">${text('状态')}:</label>
+					<div class="control-inline width-120">
+						<#form:select path="status" dictType="sys_search_status" blankOption="true" class="form-control isQuick"/>
+					</div>
+				</div>
+				<div class="form-group">
+					<button type="submit" class="btn btn-primary btn-sm">${text('查询')}</button>
+					<button type="reset" class="btn btn-default btn-sm">${text('重置')}</button>
+				</div>
+			</#form:form>
+			<table id="dataGrid"></table>
+			<div id="dataGridPage"></div>
+		</div>
+	</div>
+</div>
+<% } %>
+<script>
+// 初始化DataGrid对象
+$('#dataGrid').dataGrid({
+	searchForm: $("#searchForm"),
+	columnModel: [
+		{header:'${text("产线编号")}', name:'lineSn', index:'a.line_sn', width:100, align:"center", frozen:true},
+		{header:'${text("工位号")}', name:'oprno', index:'a.oprno', width:100, align:"center"},
+		{header:'${text("工艺编码")}', name:'craft', index:'a.craft', width:100, align:"center"},
+		{header:'${text("ps报文位置")}', name:'psPos', index:'a.ps_pos', width:100, align:"center"},
+		{header:'${text("结果模式")}', name:'resultMode', index:'a.result_mode', width:120, align:"center", formatter: function(val, obj, row, act){
+			if(val == 1) return '固定OK';
+			return '取报文Y/N';
+		}},
+		{header:'${text("描述")}', name:'title', index:'a.title', width:200, align:"center"},
+		{header:'${text("状态")}', name:'status', index:'a.status', width:80, align:"center", formatter: function(val, obj, row, act){
+			return js.getDictLabel(${@DictUtils.getDictListJson('sys_search_status')}, val, '${text("未知")}', true);
+		}},
+		{header:'${text("操作")}', name:'actions', width:150, formatter: function(val, obj, row, act){
+			var actions = [];
+			<% if(hasPermi('mes:mesParamParseConfig:edit')){ %>
+				actions.push('<a href="${ctx}/mes/mesParamParseConfig/form?id='+row.id+'" class="btnList" title="${text("编辑")}"><i class="fa fa-pencil"></i></a>&nbsp;');
+				if (row.status == Global.STATUS_NORMAL){
+					actions.push('<a href="${ctx}/mes/mesParamParseConfig/disable?id='+row.id+'" class="btnList" title="${text("停用")}" data-confirm="${text("确认要停用该配置吗?")}"><i class="glyphicon glyphicon-ban-circle"></i></a>&nbsp;');
+				} else if (row.status == Global.STATUS_DISABLE){
+					actions.push('<a href="${ctx}/mes/mesParamParseConfig/enable?id='+row.id+'" class="btnList" title="${text("启用")}" data-confirm="${text("确认要启用该配置吗?")}"><i class="glyphicon glyphicon-ok-circle"></i></a>&nbsp;');
+				}
+				actions.push('<a href="${ctx}/mes/mesParamParseConfig/delete?id='+row.id+'" class="btnList" title="${text("删除")}" data-confirm="${text("确认要删除该配置吗?")}"><i class="fa fa-trash-o"></i></a>&nbsp;');
+			<% } %>
+			return actions.join('');
+		}}
+	],
+	ajaxSuccess: function(data){
+
+	}
+});
+</script>