Prechádzať zdrojové kódy

送检、测量上传、结果判定

zhanghe 5 mesiacov pred
rodič
commit
d1f1ac3837

+ 86 - 0
src/main/java/com/jeesite/modules/mes/api/MesInspectionControllerApi.java

@@ -0,0 +1,86 @@
+package com.jeesite.modules.mes.api;
+
+import com.jeesite.common.config.Global;
+import com.jeesite.modules.erp.entity.MesProductOrder;
+import com.jeesite.modules.mes.entity.MesInspection;
+import com.jeesite.modules.mes.resp.CommonResp;
+import com.jeesite.modules.mes.service.MesInspectionService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @Author: zh
+ * @Date: 2026/5/26 下午2:20
+ * @Description: com.jeesite.modules.mes.api
+ */
+@Controller
+@RequestMapping(value = "${adminPath}/mes/mesInspectionApi")
+public class MesInspectionControllerApi {
+
+    @Autowired
+    private MesInspectionService mesInspectionService;
+
+    //保存送检
+    @PostMapping(value = "save")
+    @ResponseBody
+    public CommonResp save(@Validated MesInspection mesInspection, HttpServletRequest request, HttpServletResponse response) {
+        CommonResp<List<MesInspection>> resp = new CommonResp<>();
+        String lineSn = request.getParameter("lineSn");//所属产线产线编号
+        String sn = request.getParameter("sn");//所属产线产线编号
+        String inspectionSn = request.getParameter("inspectionSn");//所属产线产线编号
+        String oprno = request.getParameter("oprno ");
+        String inspectionContent = request.getParameter("inspectionContent");//检验内容
+        String remark = request.getParameter("remark");//备注
+        String type = request.getParameter("type");//(0首件、1过程、2末件、3复测)
+        if (lineSn.isEmpty()||inspectionSn.isEmpty()||oprno.isEmpty()||sn.isEmpty()){
+            resp.setResult(Global.FALSE);
+            resp.setMessage("参数不能为空!");
+            return resp;
+        }
+        if (type.isEmpty()){
+            resp.setResult(Global.FALSE);
+            resp.setMessage("请选择工件类型!");
+            return resp;
+        }
+        if (inspectionContent.isEmpty()){
+            resp.setResult(Global.FALSE);
+            resp.setMessage("检测内容不能为空!");
+            return resp;
+        }
+
+
+        //展示所有未结束的订单
+        mesInspection.setStates("0");//(0表示待上传,1表示待判定,2表示判定结束
+        mesInspectionService.save(mesInspection);
+        resp.setResult(Global.TRUE);
+        resp.setMessage("操作成功!");
+        return resp;
+    }
+
+    //根据日期生成编码(13位 = yyMMddHHmmss + 毫秒首位,按年月日时分秒生成)
+    @PostMapping(value = "genCode")
+    @ResponseBody
+    public CommonResp genCode(MesInspection mesInspection, HttpServletRequest request, HttpServletResponse response) {
+        CommonResp<String> resp = new CommonResp<>();
+        String code = new SimpleDateFormat("yyMMddHHmmssS").format(new Date());
+        if (code.length() > 13) {
+            code = code.substring(0, 13);
+        } else if (code.length() < 13) {
+            code = String.format("%-13s", code).replace(' ', '0');
+        }
+        resp.setData(code);
+        resp.setResult(Global.TRUE);
+        resp.setMessage("操作成功!");
+        return resp;
+    }
+}

+ 15 - 0
src/main/java/com/jeesite/modules/mes/dao/MesInspectionDao.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.MesInspection;
+
+/**
+ * mes_inspectionDAO接口
+ * @author system
+ * @version 2026-05-26
+ */
+@MyBatisDao
+public interface MesInspectionDao extends CrudDao<MesInspection> {
+	
+}

+ 180 - 0
src/main/java/com/jeesite/modules/mes/entity/MesInspection.java

@@ -0,0 +1,180 @@
+package com.jeesite.modules.mes.entity;
+
+import javax.validation.constraints.Size;
+import java.util.Date;
+import com.jeesite.common.mybatis.annotation.JoinTable;
+import com.jeesite.common.mybatis.annotation.JoinTable.Type;
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+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;
+
+/**
+ * mes_inspectionEntity
+ * @author system
+ * @version 2026-05-26
+ */
+@Table(name="mes_inspection", alias="a", label="mes_inspection信息", columns={
+		@Column(name="id", attrName="id", label="id", isPK=true),
+		@Column(name="inspection_sn", attrName="inspectionSn", label="编号", isUpdate=false),
+		@Column(name="sn", attrName="sn", label="工件码", isUpdate=false),
+		@Column(name="oprno", attrName="oprno", label="工序", isUpdate=false),
+		@Column(name="inspection_content", attrName="inspectionContent", label="检查内容"),
+		@Column(name="end_detection_time", attrName="endDetectionTime", label="检测时间", isUpdateForce=true),
+		@Column(name="inspector", attrName="inspector", label="检测人", isUpdate=true),
+		@Column(name="result", attrName="result", label="检测结果"),
+		@Column(name="states", attrName="states", label="状态"),
+		@Column(name="create_by", attrName="createBy", label="送检人", isUpdate=false),
+		@Column(name="create_date", attrName="createDate", label="送检时间", isUpdate=false, isUpdateForce=true),
+		@Column(name="update_by", attrName="updateBy", label="更新者", isQuery=false),
+		@Column(name="update_date", attrName="updateDate", label="更新时间", isQuery=false, isUpdateForce=true),
+		@Column(name="result_by", attrName="resultBy", label="结果评定人"),
+		@Column(name="remark", attrName="remark", label="备注"),
+		@Column(name="tool", attrName="tool", label="测量工具", isUpdate=false),
+		@Column(name="type", attrName="type", label="送检类型", isUpdate=false),
+		@Column(name="line_sn", attrName="lineSn", label="产线编号"),
+	}, orderBy="a.update_date DESC"
+)
+public class MesInspection extends DataEntity<MesInspection> {
+
+	private static final long serialVersionUID = 1L;
+	private String inspectionSn;		// 编号
+	private String sn;		// 工件码
+	private String oprno;		// 工序
+	private String inspectionContent;		// 检查内容
+	private Date endDetectionTime;		// 检测时间
+	private String inspector;		// 检测人
+	private String result;		// 检测结果
+	private String states;		// 状态
+	private String resultBy;		// 结果评定人
+	private String remark;		// 备注
+	private String tool;		// 测量工具
+	private String type;		// 送检类型
+	private String lineSn;		// 产线编号
+
+
+	public MesInspection() {
+		this(null);
+	}
+
+	public MesInspection(String id){
+		super(id);
+	}
+
+	@Size(min=0, max=255, message="编号长度不能超过 255 个字符")
+	public String getInspectionSn() {
+		return inspectionSn;
+	}
+
+	public void setInspectionSn(String inspectionSn) {
+		this.inspectionSn = inspectionSn;
+	}
+
+	@Size(min=0, max=255, message="工件码长度不能超过 255 个字符")
+	public String getSn() {
+		return sn;
+	}
+
+	public void setSn(String sn) {
+		this.sn = sn;
+	}
+
+	@Size(min=0, max=255, message="工序长度不能超过 255 个字符")
+	public String getOprno() {
+		return oprno;
+	}
+
+	public void setOprno(String oprno) {
+		this.oprno = oprno;
+	}
+
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+	public Date getEndDetectionTime() {
+		return endDetectionTime;
+	}
+
+	public void setEndDetectionTime(Date endDetectionTime) {
+		this.endDetectionTime = endDetectionTime;
+	}
+
+	@Size(min=0, max=255, message="检测人长度不能超过 255 个字符")
+	public String getInspector() {
+		return inspector;
+	}
+
+	public void setInspector(String inspector) {
+		this.inspector = inspector;
+	}
+
+	@Size(min=0, max=255, message="检测结果长度不能超过 255 个字符")
+	public String getResult() {
+		return result;
+	}
+
+	public void setResult(String result) {
+		this.result = result;
+	}
+
+	@Size(min=0, max=255, message="状态长度不能超过 255 个字符")
+	public String getStates() {
+		return states;
+	}
+
+	public void setStates(String states) {
+		this.states = states;
+	}
+
+	@Size(min=0, max=255, message="结果评定人长度不能超过 255 个字符")
+	public String getResultBy() {
+		return resultBy;
+	}
+
+	public void setResultBy(String resultBy) {
+		this.resultBy = resultBy;
+	}
+
+	@Size(min=0, max=255, message="备注长度不能超过 255 个字符")
+	public String getRemark() {
+		return remark;
+	}
+
+	public void setRemark(String remark) {
+		this.remark = remark;
+	}
+
+	@Size(min=0, max=255, message="测量工具长度不能超过 255 个字符")
+	public String getTool() {
+		return tool;
+	}
+
+	public void setTool(String tool) {
+		this.tool = tool;
+	}
+
+	@Size(min=0, max=255, message="送检类型长度不能超过 255 个字符")
+	public String getType() {
+		return type;
+	}
+
+	public void setType(String type) {
+		this.type = type;
+	}
+
+	public String getInspectionContent() {
+		return inspectionContent;
+	}
+
+	public void setInspectionContent(String inspectionContent) {
+		this.inspectionContent = inspectionContent;
+	}
+
+	public String getLineSn() {
+		return lineSn;
+	}
+
+	public void setLineSn(String lineSn) {
+		this.lineSn = lineSn;
+	}
+}

+ 81 - 0
src/main/java/com/jeesite/modules/mes/service/MesInspectionService.java

@@ -0,0 +1,81 @@
+package com.jeesite.modules.mes.service;
+
+import java.util.List;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import com.jeesite.common.entity.Page;
+import com.jeesite.common.service.CrudService;
+import com.jeesite.modules.mes.entity.MesInspection;
+import com.jeesite.modules.mes.dao.MesInspectionDao;
+
+/**
+ * mes_inspectionService
+ * @author system
+ * @version 2026-05-26
+ */
+@Service
+public class MesInspectionService extends CrudService<MesInspectionDao, MesInspection> {
+	
+	/**
+	 * 获取单条数据
+	 * @param mesInspection
+	 * @return
+	 */
+	@Override
+	public MesInspection get(MesInspection mesInspection) {
+		return super.get(mesInspection);
+	}
+	
+	/**
+	 * 查询分页数据
+	 * @param mesInspection 查询条件
+	 * @param mesInspection.page 分页对象
+	 * @return
+	 */
+	@Override
+	public Page<MesInspection> findPage(MesInspection mesInspection) {
+		return super.findPage(mesInspection);
+	}
+	
+	/**
+	 * 查询列表数据
+	 * @param mesInspection
+	 * @return
+	 */
+	@Override
+	public List<MesInspection> findList(MesInspection mesInspection) {
+		return super.findList(mesInspection);
+	}
+	
+	/**
+	 * 保存数据(插入或更新)
+	 * @param mesInspection
+	 */
+	@Override
+	@Transactional
+	public void save(MesInspection mesInspection) {
+		super.save(mesInspection);
+	}
+	
+	/**
+	 * 更新状态
+	 * @param mesInspection
+	 */
+	@Override
+	@Transactional
+	public void updateStatus(MesInspection mesInspection) {
+		super.updateStatus(mesInspection);
+	}
+	
+	/**
+	 * 删除数据
+	 * @param mesInspection
+	 */
+	@Override
+	@Transactional
+	public void delete(MesInspection mesInspection) {
+		super.delete(mesInspection);
+	}
+	
+}

+ 311 - 0
src/main/java/com/jeesite/modules/mes/web/MesInspectionController.java

@@ -0,0 +1,311 @@
+package com.jeesite.modules.mes.web;
+
+import java.util.Date;
+import java.util.List;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import com.jeesite.common.lang.DateUtils;
+import com.jeesite.modules.sys.utils.UserUtils;
+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.collect.ListUtils;
+import com.jeesite.common.collect.MapUtils;
+import com.jeesite.common.entity.Page;
+import com.jeesite.common.lang.StringUtils;
+import com.jeesite.common.web.BaseController;
+import com.jeesite.modules.file.entity.FileUpload;
+import com.jeesite.modules.file.service.FileUploadService;
+import com.jeesite.modules.file.utils.FileUploadUtils;
+import com.jeesite.modules.mes.entity.MesInspection;
+import com.jeesite.modules.mes.service.MesInspectionService;
+
+/**
+ * mes_inspectionController
+ * @author system
+ * @version 2026-05-26
+ */
+@Controller
+@RequestMapping(value = "${adminPath}/mes/mesInspection")
+public class MesInspectionController extends BaseController {
+
+	@Autowired
+	private MesInspectionService mesInspectionService;
+
+	@Autowired
+	private FileUploadService fileUploadService;
+
+	/**
+	 * 获取数据
+	 */
+	@ModelAttribute
+	public MesInspection get(String id, boolean isNewRecord) {
+		return mesInspectionService.get(id, isNewRecord);
+	}
+
+	/**
+	 * 查询列表
+	 */
+	@RequiresPermissions("mes:mesInspection:view")
+	@RequestMapping(value = {"list", ""})
+	public String list(MesInspection mesInspection, Model model) {
+		model.addAttribute("mesInspection", mesInspection);
+		return "modules/mes/mesInspectionList";
+	}
+
+	/**
+	 * 查询列表数据
+	 */
+	@RequiresPermissions("mes:mesInspection:view")
+	@RequestMapping(value = "listData")
+	@ResponseBody
+	public Page<MesInspection> listData(MesInspection mesInspection, HttpServletRequest request, HttpServletResponse response) {
+		mesInspection.setPage(new Page<>(request, response));
+		Page<MesInspection> page = mesInspectionService.findPage(mesInspection);
+		return page;
+	}
+
+	/**
+	 * 查看编辑表单
+	 */
+	@RequiresPermissions("mes:mesInspection:view")
+	@RequestMapping(value = "form")
+	public String form(MesInspection mesInspection, Model model) {
+		model.addAttribute("mesInspection", mesInspection);
+		return "modules/mes/mesInspectionForm";
+	}
+
+	/**
+	 * 保存数据
+	 */
+	@RequiresPermissions("mes:mesInspection:edit")
+	@PostMapping(value = "save")
+	@ResponseBody
+	public String save(@Validated MesInspection mesInspection) {
+		mesInspectionService.save(mesInspection);
+		return renderResult(Global.TRUE, text("保存mes_inspection成功!"));
+	}
+
+	/**
+	 * 删除数据
+	 */
+	@RequiresPermissions("mes:mesInspection:delete")
+	@RequestMapping(value = "delete")
+	@ResponseBody
+	public String delete(MesInspection mesInspection) {
+		mesInspectionService.delete(mesInspection);
+		return renderResult(Global.TRUE, text("删除mes_inspection成功!"));
+	}
+
+	/**
+	 * 上传文件页面(仅 states=0 待上传 状态可以进入)
+	 */
+	@RequiresPermissions("mes:mesInspection:uploadForm")
+	@RequestMapping(value = "uploadForm")
+	public String uploadForm(MesInspection mesInspection, Model model) {
+		model.addAttribute("mesInspection", mesInspection);
+		return "modules/mes/mesInspectionUpload";
+	}
+
+	/**
+	 * 详情页
+	 */
+	@RequiresPermissions("mes:mesInspection:view")
+	@RequestMapping(value = "detail")
+	public String detail(MesInspection mesInspection, Model model) {
+		model.addAttribute("mesInspection", mesInspection);
+		return "modules/mes/mesInspectionDetail";
+	}
+
+	/**
+	 * 保存上传文件,文件保存后将状态置为 1(待判定)
+	 */
+	@PostMapping(value = "uploadSave")
+	@ResponseBody
+	public String uploadSave(MesInspection mesInspection) {
+		// 重新查询,避免前端漏传字段被覆盖
+		MesInspection db = mesInspectionService.get(mesInspection.getId());
+		if (db == null) {
+			return renderResult(Global.FALSE, text("记录不存在!"));
+		}
+		if (!"0".equals(db.getStates())) {
+			return renderResult(Global.FALSE, text("当前状态不允许上传文件!"));
+		}
+
+		// 关联前端上传的附件
+		FileUploadUtils.saveFileUpload(mesInspection, db.getId(), "mesInspection_file");
+
+		// 状态改为 1(待判定)
+		db.setStates("1");
+		db.setInspector(UserUtils.getUser().getUserName());
+		db.setEndDetectionTime( new Date());
+		mesInspectionService.save(db);
+
+		return renderResult(Global.TRUE, text("上传成功!"));
+	}
+
+	/**
+	 * 结果判定页面
+	 */
+	@RequiresPermissions("mes:mesInspection:judgeForm")
+	@RequestMapping(value = "judgeForm")
+	public String judgeForm(MesInspection mesInspection, Model model) {
+		model.addAttribute("mesInspection", mesInspection);
+		return "modules/mes/mesInspectionJudge";
+	}
+
+	/**
+	 * 保存判定结果
+	 */
+	@RequiresPermissions("mes:mesInspection:edit")
+	@PostMapping(value = "judgeSave")
+	@ResponseBody
+	public String judgeSave(MesInspection mesInspection) {
+		MesInspection db = mesInspectionService.get(mesInspection.getId());
+		if (db == null) {
+			return renderResult(Global.FALSE, text("记录不存在!"));
+		}
+		if (!"1".equals(db.getStates())) {
+			return renderResult(Global.FALSE, text("当前状态不允许判定!"));
+		}
+
+		//
+		db.setResult(mesInspection.getResult());
+//		db.setRemark(mesInspection.getRemark());
+		db.setResultBy(UserUtils.getUser().getUserName());
+		db.setStates("2");
+		mesInspectionService.save(db);
+
+		return renderResult(Global.TRUE, text("判定成功!"));
+	}
+
+	/**
+	 * 查看
+	 */
+	@RequestMapping(value = "fileList")
+	@ResponseBody
+	public java.util.List<java.util.Map<String, Object>> fileList(String bizKey, String bizType) {
+		java.util.List<java.util.Map<String, Object>> result = ListUtils.newArrayList();
+		if (StringUtils.isBlank(bizKey) || StringUtils.isBlank(bizType)) {
+			return result;
+		}
+		FileUpload fu = new FileUpload();
+		fu.setBizKey(bizKey);
+		fu.setBizType(bizType);
+		java.util.List<FileUpload> list = fileUploadService.findList(fu);
+		if (ListUtils.isEmpty(list)) {
+			return result;
+		}
+		for (FileUpload fi : list) {
+			java.util.Map<String, Object> map = MapUtils.newHashMap();
+			map.put("fileName", fi.getFileName());
+			map.put("fileUrl", fi.getFileUrl());
+			result.add(map);
+		}
+		return result;
+	}
+
+	/**
+	 * 内联预览附件
+	 */
+
+	@RequestMapping(value = "viewFile")
+	public void viewFile(String bizKey, String bizType, String fileUrl,
+						 javax.servlet.http.HttpServletResponse response) {
+		try {
+			if (StringUtils.isBlank(bizKey) || StringUtils.isBlank(bizType) || StringUtils.isBlank(fileUrl)) {
+				response.sendError(404, "params missing");
+				return;
+			}
+			FileUpload q = new FileUpload();
+			q.setBizKey(bizKey);
+			q.setBizType(bizType);
+			java.util.List<FileUpload> list = fileUploadService.findList(q);
+			if (ListUtils.isEmpty(list)) {
+				response.sendError(404, "file not found");
+				return;
+			}
+			FileUpload fu = null;
+			for (FileUpload f : list) {
+				if (fileUrl.equals(f.getFileUrl())) {
+					fu = f;
+					break;
+				}
+			}
+			if (fu == null) {
+				response.sendError(404, "file not found");
+				return;
+			}
+			String url = fu.getFileUrl();
+			String baseDir = Global.getConfig("file.baseDir");
+			if (StringUtils.isBlank(baseDir)) {
+				baseDir = System.getProperty("user.home");
+			}
+			java.io.File file = new java.io.File(baseDir, url);
+			if (!file.exists() || !file.isFile()) {
+				response.sendError(404, "file not exist on disk");
+				return;
+			}
+			String contentType = getContentType(file.getName());
+			response.setContentType(contentType);
+			response.setContentLengthLong(file.length());
+			String encodedName = java.net.URLEncoder.encode(fu.getFileName(), "UTF-8").replace("+", "%20");
+			response.setHeader("Content-Disposition", "inline; filename*=UTF-8''" + encodedName);
+
+			try (java.io.InputStream in = new java.io.FileInputStream(file);
+				 java.io.OutputStream out = response.getOutputStream()) {
+				byte[] buf = new byte[8192];
+				int len;
+				while ((len = in.read(buf)) != -1) {
+					out.write(buf, 0, len);
+				}
+				out.flush();
+			}
+		} catch (Exception e) {
+			logger.error("内联预览文件失败", e);
+		}
+	}
+
+	/**
+	 * 根据文件扩展名获取 Content-Type
+	 */
+	private String getContentType(String fileName) {
+		if (StringUtils.isBlank(fileName)) return "application/octet-stream";
+		String ext = fileName.substring(fileName.lastIndexOf('.') + 1).toLowerCase();
+		switch (ext) {
+			case "pdf":  return "application/pdf";
+			case "png":  return "image/png";
+			case "jpg":  case "jpeg": return "image/jpeg";
+			case "gif":  return "image/gif";
+			case "bmp":  return "image/bmp";
+			case "svg":  return "image/svg+xml";
+			case "mp4":  return "video/mp4";
+			case "webm": return "video/webm";
+			case "mp3":  return "audio/mpeg";
+			case "wav":  return "audio/wav";
+			case "txt":  case "csv": case "log": return "text/plain; charset=utf-8";
+			case "html": case "htm": return "text/html; charset=utf-8";
+			case "xml":  return "text/xml; charset=utf-8";
+			case "json": return "application/json; charset=utf-8";
+			case "doc":  return "application/msword";
+			case "docx": return "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
+			case "xls":  return "application/vnd.ms-excel";
+			case "xlsx": return "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
+			case "ppt":  return "application/vnd.ms-powerpoint";
+			case "pptx": return "application/vnd.openxmlformats-officedocument.presentationml.presentation";
+			default:
+				String guess = java.net.URLConnection.guessContentTypeFromName(fileName);
+				return StringUtils.isNotBlank(guess) ? guess : "application/octet-stream";
+		}
+	}
+
+}

+ 15 - 0
src/main/resources/mappings/modules/mes/MesInspectionDao.xml

@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.jeesite.modules.mes.dao.MesInspectionDao">
+	
+	<!-- 查询数据
+	<select id="findList" resultType="MesInspection">
+		SELECT ${sqlMap.column.toSql()}
+		FROM ${sqlMap.table.toSql()}
+		<where>
+			${sqlMap.where.toSql()}
+		</where>
+		ORDER BY ${sqlMap.order.toSql()}
+	</select> -->
+	
+</mapper>

+ 133 - 0
src/main/resources/views/modules/mes/mesInspectionDetail.html

@@ -0,0 +1,133 @@
+<% layout('/layouts/default.html', {title: '三坐标检查详情', libs: ['fileupload']}){ %>
+<div class="main-content">
+	<div class="box box-main">
+		<div class="box-header with-border">
+			<div class="box-title">
+				<i class="fa icon-eye"></i> ${text('检查详情')}
+			</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>
+		<div class="box-body">
+			<div class="form-unit">${text('基本信息')}</div>
+			<table class="table table-bordered">
+				<tr>
+					<th class="mpc-header" style="width:120px;">编号</th>
+					<td>${mesInspection.inspectionSn}</td>
+					<th class="mpc-header" style="width:120px;">工件码</th>
+					<td>${mesInspection.sn}</td>
+				</tr>
+				<tr>
+					<th class="mpc-header">工序</th>
+					<td>${mesInspection.oprno}</td>
+					<th class="mpc-header">产线</th>
+					<td>${mesInspection.lineSn}</td>
+				</tr>
+				<tr>
+					<th class="mpc-header">检测时间</th>
+					<td>${@DateUtils.formatDateTime(mesInspection.endDetectionTime)}</td>
+					<th class="mpc-header">检测人</th>
+					<td>${mesInspection.inspector}</td>
+				</tr>
+				<tr>
+					<th class="mpc-header">检测结果</th>
+					<td>${mesInspection.result}</td>
+					<th class="mpc-header">状态</th>
+					<td>
+						<% if(mesInspection.states == '0'){ %>待上传<% }
+						   else if(mesInspection.states == '1'){ %>待判定<% }
+						   else if(mesInspection.states == '2'){ %>判定结束<% }
+						   else { %>${mesInspection.states}<% } %>
+					</td>
+				</tr>
+				<tr>
+					<th class="mpc-header">送检人</th>
+					<td>${mesInspection.createBy}</td>
+					<th class="mpc-header">送检时间</th>
+					<td>${@DateUtils.formatDateTime(mesInspection.createDate)}</td>
+				</tr>
+				<tr>
+					<th class="mpc-header">结果评定人</th>
+					<td>${mesInspection.resultBy}</td>
+					<th class="mpc-header">测量工具</th>
+					<td>${@DictUtils.getDictLabel('mes_inspection_tool', mesInspection.tool, '')}</td>
+				</tr>
+				<tr>
+					<th class="mpc-header">送检类型</th>
+					<td>${@DictUtils.getDictLabel('mes_inspection_type', mesInspection.type, '')}</td>
+					<th class="mpc-header">检验内容</th>
+					<td>${mesInspection.inspectionContent}</td>
+				</tr>
+				<tr>
+					<th class="mpc-header">备注</th>
+					<td colspan="3">${mesInspection.remark}</td>
+				</tr>
+				<tr>
+					<th class="mpc-header">附件</th>
+					<td colspan="3">
+						<#form:fileupload id="uploadFile" bizKey="${mesInspection.id}" bizType="mesInspection_file"
+							uploadType="all" class="" readonly="true" preview="true"/>
+					</td>
+				</tr>
+			</table>
+		</div>
+		<div class="box-footer">
+			<div class="row">
+				<div class="col-sm-offset-2 col-sm-10">
+					<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>
+	</div>
+</div>
+<% } %>
+<script>
+// 在每个附件的"下载"按钮前注入"查看"按钮
+$(function(){
+    var bizKey = '${mesInspection.id}';
+    var bizType = 'mesInspection_file';
+
+    function buildViewUrl(fileUrl){
+        return '${ctx}/mes/mesInspection/viewFile'
+            + '?bizKey=' + encodeURIComponent(bizKey)
+            + '&bizType=' + encodeURIComponent(bizType)
+            + '&fileUrl=' + encodeURIComponent(fileUrl);
+    }
+
+    function injectButtons(fileList){
+        var $downloads = $('#uploadFile').closest('td').find('a').filter(function(){
+            var $a = $(this);
+            if($a.data('view-injected')) return false;
+            var text = $.trim($a.text());
+            return text.indexOf('下载') !== -1 || $a.find('i.fa-download').length > 0;
+        });
+        if(!$downloads.length) return false;
+        $downloads.each(function(idx){
+            var $a = $(this);
+            var f = fileList[idx];
+            if(!f) return;
+            $a.data('view-injected', true);
+            var $view = $('<a class="btn btn-info btn-xs" target="_blank" style="margin-right:4px;">'
+                        + '<i class="fa fa-eye"></i> 查看</a>');
+            $view.attr('href', buildViewUrl(f.fileUrl));
+            $a.before($view);
+        });
+        return true;
+    }
+
+    $.get('${ctx}/mes/mesInspection/fileList', {
+        bizKey: bizKey,
+        bizType: bizType
+    }, function(list){
+        if(!list || !list.length) return;
+        var tries = 0;
+        var timer = setInterval(function(){
+            tries++;
+            if(injectButtons(list) || tries >= 10){
+                clearInterval(timer);
+            }
+        }, 300);
+    });
+});
+</script>

+ 146 - 0
src/main/resources/views/modules/mes/mesInspectionForm.html

@@ -0,0 +1,146 @@
+<% 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(mesInspection.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="${mesInspection}" action="${ctx}/mes/mesInspection/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 hide">*</span> ${text('编号')}:<i class="fa icon-question hide"></i></label>
+							<div class="col-sm-8">
+								<#form:input path="inspectionSn" maxlength="255" class="form-control"/>
+							</div>
+						</div>
+					</div>
+					<div class="col-xs-6">
+						<div class="form-group">
+							<label class="control-label col-sm-4" title="">
+								<span class="required hide">*</span> ${text('工件码')}:<i class="fa icon-question hide"></i></label>
+							<div class="col-sm-8">
+								<#form:input path="sn" maxlength="255" class="form-control"/>
+							</div>
+						</div>
+					</div>
+					<div class="col-xs-6">
+						<div class="form-group">
+							<label class="control-label col-sm-4" title="">
+								<span class="required hide">*</span> ${text('工序')}:<i class="fa icon-question hide"></i></label>
+							<div class="col-sm-8">
+								<#form:input path="oprno" maxlength="255" class="form-control"/>
+							</div>
+						</div>
+					</div>
+					<div class="col-xs-6">
+						<div class="form-group">
+							<label class="control-label col-sm-4" title="">
+								<span class="required hide">*</span> ${text('检测时间')}:<i class="fa icon-question hide"></i></label>
+							<div class="col-sm-8">
+								<#form:input path="endDetectionTime" readonly="true" maxlength="20" class="form-control laydate"
+									dataFormat="datetime" data-type="datetime" data-format="yyyy-MM-dd HH:mm"/>
+							</div>
+						</div>
+					</div>
+					<div class="col-xs-6">
+						<div class="form-group">
+							<label class="control-label col-sm-4" title="">
+								<span class="required hide">*</span> ${text('检测人')}:<i class="fa icon-question hide"></i></label>
+							<div class="col-sm-8">
+								<#form:input path="inspector" maxlength="255" class="form-control"/>
+							</div>
+						</div>
+					</div>
+					<div class="col-xs-6">
+						<div class="form-group">
+							<label class="control-label col-sm-4" title="">
+								<span class="required hide">*</span> ${text('检测结果')}:<i class="fa icon-question hide"></i></label>
+							<div class="col-sm-8">
+								<#form:input path="result" maxlength="255" class="form-control"/>
+							</div>
+						</div>
+					</div>
+					<div class="col-xs-6">
+						<div class="form-group">
+							<label class="control-label col-sm-4" title="">
+								<span class="required hide">*</span> ${text('状态')}:<i class="fa icon-question hide"></i></label>
+							<div class="col-sm-8">
+								<#form:radio path="states" dictType="mes_inspection_states" class="form-control" />
+							</div>
+						</div>
+					</div>
+					<div class="col-xs-6">
+						<div class="form-group">
+							<label class="control-label col-sm-4" title="">
+								<span class="required hide">*</span> ${text('结果评定人')}:<i class="fa icon-question hide"></i></label>
+							<div class="col-sm-8">
+								<#form:input path="resultBy" maxlength="255" class="form-control"/>
+							</div>
+						</div>
+					</div>
+					<div class="col-xs-6">
+						<div class="form-group">
+							<label class="control-label col-sm-4" title="">
+								<span class="required hide">*</span> ${text('备注')}:<i class="fa icon-question hide"></i></label>
+							<div class="col-sm-8">
+								<#form:input path="remark" maxlength="255" class="form-control"/>
+							</div>
+						</div>
+					</div>
+					<div class="col-xs-6">
+						<div class="form-group">
+							<label class="control-label col-sm-4" title="">
+								<span class="required hide">*</span> ${text('测量工具')}:<i class="fa icon-question hide"></i></label>
+							<div class="col-sm-8">
+								<#form:radio path="tool" dictType="mes_inspection_tool" class="form-control" />
+							</div>
+						</div>
+					</div>
+					<div class="col-xs-6">
+						<div class="form-group">
+							<label class="control-label col-sm-4" title="">
+								<span class="required hide">*</span> ${text('送检类型')}:<i class="fa icon-question hide"></i></label>
+							<div class="col-sm-8">
+								<#form:radio path="type" dictType="mes_inspection_type" 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:mesInspection: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>

+ 177 - 0
src/main/resources/views/modules/mes/mesInspectionJudge.html

@@ -0,0 +1,177 @@
+<% layout('/layouts/default.html', {title: '三坐标检查结果判定', libs: ['validate','fileupload']}){ %>
+<div class="main-content">
+	<div class="box box-main">
+		<div class="box-header with-border">
+			<div class="box-title">
+				<i class="fa icon-check"></i> ${text('结果判定')}
+			</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="${mesInspection}" action="${ctx}/mes/mesInspection/judgeSave" 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">${text('编号')}:</label>
+							<div class="col-sm-8">
+								<#form:input path="inspectionSn" maxlength="255" class="form-control" readonly="true"/>
+							</div>
+						</div>
+					</div>
+					<div class="col-xs-6">
+						<div class="form-group">
+							<label class="control-label col-sm-4">${text('工件码')}:</label>
+							<div class="col-sm-8">
+								<#form:input path="sn" maxlength="255" class="form-control" readonly="true"/>
+							</div>
+						</div>
+					</div>
+					<div class="col-xs-6">
+						<div class="form-group">
+							<label class="control-label col-sm-4">${text('工序')}:</label>
+							<div class="col-sm-8">
+								<#form:input path="oprno" maxlength="255" class="form-control" readonly="true"/>
+							</div>
+						</div>
+					</div>
+					<div class="col-xs-6">
+						<div class="form-group">
+							<label class="control-label col-sm-4">${text('送检时间')}:</label>
+							<div class="col-sm-8">
+								<input type="text" class="form-control" readonly="readonly"
+									value="${@DateUtils.formatDateTime(mesInspection.createDate)}"/>
+							</div>
+						</div>
+					</div>
+					<div class="col-xs-6">
+						<div class="form-group">
+							<label class="control-label col-sm-4">${text('检测时间')}:</label>
+							<div class="col-sm-8">
+								<input type="text" class="form-control" readonly="readonly"
+									value="${@DateUtils.formatDateTime(mesInspection.endDetectionTime)}"/>
+							</div>
+						</div>
+					</div>
+					<div class="col-xs-6">
+						<div class="form-group">
+							<label class="control-label col-sm-4">${text('送检人')}:</label>
+							<div class="col-sm-8">
+								<#form:input path="createBy" class="form-control" readonly="true"/>
+							</div>
+						</div>
+					</div>
+					<div class="col-xs-12">
+						<div class="form-group">
+							<label class="control-label col-sm-2">${text('已上传文件')}:</label>
+							<div class="col-sm-10">
+								<#form:fileupload id="uploadFile" bizKey="${mesInspection.id}" bizType="mesInspection_file"
+									uploadType="all" class="" readonly="true" preview="true"/>
+							</div>
+						</div>
+					</div>
+					<div class="col-xs-12">
+						<div class="form-group">
+							<label class="control-label col-sm-2"><span class="required">*</span> ${text('检测结果')}:</label>
+							<div class="col-sm-10">
+								<#form:input path="result" maxlength="255" class="form-control required" placeholder="OK / NG"/>
+							</div>
+						</div>
+					</div>
+				</div>
+			</div>
+			<div class="box-footer">
+				<div class="row">
+					<div class="col-sm-offset-2 col-sm-10">
+						<% if (hasPermi('mes:mesInspection: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");
+	}
+});
+
+// 在每个附件的"下载"按钮前注入"查看"按钮,走后端 viewFile 接口 inline 输出
+$(function(){
+    var bizKey = '${mesInspection.id}';
+    var bizType = 'mesInspection_file';
+
+    function buildViewUrl(fileUrl){
+        return '${ctx}/mes/mesInspection/viewFile'
+            + '?bizKey=' + encodeURIComponent(bizKey)
+            + '&bizType=' + encodeURIComponent(bizType)
+            + '&fileUrl=' + encodeURIComponent(fileUrl);
+    }
+
+    // 判断是否是 Office 文件(浏览器无法直接内嵌预览)
+    function isOfficeFile(fileName){
+        if(!fileName) return false;
+        return /\.(xlsx?|docx?|pptx?)$/i.test(fileName);
+    }
+
+    function injectButtons(fileList){
+        var $downloads = $('#uploadFile').closest('td, .col-sm-10').find('a').filter(function(){
+            var $a = $(this);
+            if($a.data('view-injected')) return false;
+            var text = $.trim($a.text());
+            return text.indexOf('下载') !== -1 || $a.find('i.fa-download').length > 0;
+        });
+        if(!$downloads.length) return false;
+        $downloads.each(function(idx){
+            var $a = $(this);
+            var f = fileList[idx];
+            if(!f) return;
+            $a.data('view-injected', true);
+
+            var viewUrl = buildViewUrl(f.fileUrl);
+            var href;
+            if(isOfficeFile(f.fileName)){
+                // Office 文件用微软在线预览(需要服务可公网访问;内网环境改用 kkFileView 等)
+                href = 'https://view.officeapps.live.com/op/view.aspx?src=' + encodeURIComponent(location.origin + viewUrl);
+            } else {
+                href = viewUrl;
+            }
+
+            var $view = $('<a class="btn btn-info btn-xs" target="_blank" style="margin-right:4px;">'
+                        + '<i class="fa fa-eye"></i> 查看</a>');
+            $view.attr('href', href);
+            $a.before($view);
+        });
+        return true;
+    }
+
+    $.get('${ctx}/mes/mesInspection/fileList', {
+        bizKey: bizKey,
+        bizType: bizType
+    }, function(list){
+        if(!list || !list.length) return;
+        var tries = 0;
+        var timer = setInterval(function(){
+            tries++;
+            if(injectButtons(list) || tries >= 10){
+                clearInterval(timer);
+            }
+        }, 300);
+    });
+});
+</script>

+ 163 - 0
src/main/resources/views/modules/mes/mesInspectionList.html

@@ -0,0 +1,163 @@
+<% 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:mesInspection:edit')){ %>
+					<a href="${ctx}/mes/mesInspection/form" class="btn btn-default btnTool" title="${text('新增mes_inspection')}"><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="${mesInspection}" action="${ctx}/mes/mesInspection/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="inspectionSn" maxlength="255" class="form-control width-120"/>
+					</div>
+				</div>
+				<div class="form-group">
+					<label class="control-label">${text('工件码')}:</label>
+					<div class="control-inline">
+						<#form:input path="sn" maxlength="255" 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="255" class="form-control width-120"/>
+					</div>
+				</div>
+				<div class="form-group">
+					<label class="control-label">${text('检测时间')}:</label>
+					<div class="control-inline">
+						<#form:input path="endDetectionTime" readonly="true" maxlength="20" class="form-control laydate width-datetime"
+							dataFormat="datetime" data-type="datetime" data-format="yyyy-MM-dd HH:mm"/>
+					</div>
+				</div>
+				<div class="form-group">
+					<label class="control-label">${text('检测人')}:</label>
+					<div class="control-inline">
+						<#form:input path="inspector" maxlength="255" class="form-control width-120"/>
+					</div>
+				</div>
+				<div class="form-group">
+					<label class="control-label">${text('检测结果')}:</label>
+					<div class="control-inline">
+						<#form:input path="result" maxlength="255" class="form-control width-120"/>
+					</div>
+				</div>
+				<div class="form-group">
+					<label class="control-label">${text('状态')}:</label>
+					<div class="control-inline">
+						<#form:radio path="states" dictType="mes_inspection_states" class="form-control"/>
+					</div>
+				</div>
+				<div class="form-group">
+					<label class="control-label">${text('送检人')}:</label>
+					<div class="control-inline">
+						<#form:input path="createBy" maxlength="64" class="form-control width-120"/>
+					</div>
+				</div>
+				<div class="form-group">
+					<label class="control-label">${text('送检时间')}:</label>
+					<div class="control-inline">
+						<#form:input path="createDate" class="form-control width-120"/>
+					</div>
+				</div>
+				<div class="form-group">
+					<label class="control-label">${text('结果评定人')}:</label>
+					<div class="control-inline">
+						<#form:input path="resultBy" maxlength="255" class="form-control width-120"/>
+					</div>
+				</div>
+				<div class="form-group">
+					<label class="control-label">${text('备注')}:</label>
+					<div class="control-inline">
+						<#form:input path="remark" maxlength="255" class="form-control width-120"/>
+					</div>
+				</div>
+				<div class="form-group">
+					<label class="control-label">${text('测量工具')}:</label>
+					<div class="control-inline">
+						<#form:radio path="tool" dictType="mes_inspection_tool" class="form-control"/>
+					</div>
+				</div>
+				<div class="form-group">
+					<label class="control-label">${text('送检类型')}:</label>
+					<div class="control-inline">
+						<#form:radio path="type" dictType="mes_inspection_type" class="form-control"/>
+					</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:'inspectionSn', index:'a.inspection_sn', width:150, align:"left" },
+		{header:'${text("工件码")}', name:'sn', index:'a.sn', width:150, align:"left"},
+		{header:'${text("工序")}', name:'oprno', index:'a.oprno', width:150, align:"left"},
+		{header:'${text("检测时间")}', name:'endDetectionTime', index:'a.end_detection_time', width:150, align:"center"},
+		{header:'${text("检测人")}', name:'inspector', index:'a.inspector', width:150, align:"left"},
+		{header:'${text("检测结果")}', name:'result', index:'a.result', width:150, align:"left"},
+		{header:'${text("状态")}', name:'states', index:'a.states', width:150, align:"center", formatter: function(val, obj, row, act){
+			return js.getDictLabel(${@DictUtils.getDictListJson('mes_inspection_states')}, val, '${text("未知")}', true);
+		}},
+		{header:'${text("送检人")}', name:'createBy', index:'a.create_by', width:150, align:"left"},
+		{header:'${text("送检时间")}', name:'createDate', index:'a.create_date', width:150, align:"center"},
+		{header:'${text("结果评定人")}', name:'resultBy', index:'a.result_by', width:150, align:"left"},
+		{header:'${text("备注")}', name:'remark', index:'a.remark', width:150, align:"left"},
+		{header:'${text("测量工具")}', name:'tool', index:'a.tool', width:150, align:"center", formatter: function(val, obj, row, act){
+			return js.getDictLabel(${@DictUtils.getDictListJson('mes_inspection_tool')}, val, '${text("未知")}', true);
+		}},
+		{header:'${text("送检类型")}', name:'type', index:'a.type', width:150, align:"center", formatter: function(val, obj, row, act){
+			return js.getDictLabel(${@DictUtils.getDictListJson('mes_inspection_type')}, val, '${text("未知")}', true);
+		}},
+		{header:'${text("操作")}', name:'actions', width:180, formatter: function(val, obj, row, act){
+			var actions = [];
+			//<% if(hasPermi('mes:mesInspection:edit')){ %>
+
+			//<% } %>
+			//<% if(hasPermi('mes:mesInspection:view')){ %>
+				actions.push('<a href="${ctx}/mes/mesInspection/detail?id='+row.id+'" class="btnList" title="${text("详情")}"><i class="fa fa-eye"></i></a>&nbsp;');
+			//<% } %>
+
+				// <% if(hasPermi('mes:mesInspection:uploadForm')){ %>
+				if(row.states === '0'){
+					actions.push('<a href="${ctx}/mes/mesInspection/uploadForm?id='+row.id+'" class="btnList" title="${text("上传文件")}"><i class="fa fa-upload"></i></a>&nbsp;');
+				}
+				//<% } %>
+				// <% if(hasPermi('mes:mesInspection:judgeForm')){ %>
+				if(row.states === '1'){
+					actions.push('<a href="${ctx}/mes/mesInspection/judgeForm?id='+row.id+'" class="btnList" title="${text("结果判定")}"><i class="fa fa-check-square-o"></i></a>&nbsp;');
+				}
+				//<% } %>
+				// <% if(hasPermi('mes:mesInspection:delete')){ %>
+				actions.push('<a href="${ctx}/mes/mesInspection/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>

+ 88 - 0
src/main/resources/views/modules/mes/mesInspectionUpload.html

@@ -0,0 +1,88 @@
+<% layout('/layouts/default.html', {title: '三坐标检查上传文件', libs: ['validate','fileupload']}){ %>
+<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('上传检测文件')}
+			</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="${mesInspection}" action="${ctx}/mes/mesInspection/uploadSave" 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">${text('编号')}:</label>
+							<div class="col-sm-8">
+								<#form:input path="inspectionSn" maxlength="255" class="form-control" readonly="true"/>
+							</div>
+						</div>
+					</div>
+					<div class="col-xs-6">
+						<div class="form-group">
+							<label class="control-label col-sm-4">${text('工件码')}:</label>
+							<div class="col-sm-8">
+								<#form:input path="sn" maxlength="255" class="form-control" readonly="true"/>
+							</div>
+						</div>
+					</div>
+					<div class="col-xs-6">
+						<div class="form-group">
+							<label class="control-label col-sm-4">${text('工序')}:</label>
+							<div class="col-sm-8">
+								<#form:input path="oprno" maxlength="255" class="form-control" readonly="true"/>
+							</div>
+						</div>
+					</div>
+					<div class="col-xs-6">
+						<div class="form-group">
+							<label class="control-label col-sm-4">${text('送检时间')}:</label>
+							<div class="col-sm-8">
+								<input type="text" class="form-control" readonly="readonly"
+									value="${@DateUtils.formatDateTime(mesInspection.createDate)}"/>
+							</div>
+						</div>
+					</div>
+					<div class="col-xs-12">
+						<div class="form-group">
+							<label class="control-label col-sm-2">${text('附件上传')}:</label>
+							<div class="col-sm-10">
+								<#form:fileupload id="uploadFile" bizKey="${mesInspection.id}" bizType="mesInspection_file"
+									uploadType="all" allowSuffixes="pdf" class="" readonly="false" preview="true"/>
+							</div>
+						</div>
+					</div>
+				</div>
+			</div>
+			<div class="box-footer">
+				<div class="row">
+					<div class="col-sm-offset-2 col-sm-10">
+						<% if (hasPermi('mes:mesInspection: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>