瀏覽代碼

增加胶管更换

jingbo 2 天之前
父節點
當前提交
383f9e57e2

+ 15 - 0
src/main/java/com/jeesite/modules/mes/dao/MesProductGlueDao.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.MesProductGlue;
+
+/**
+ * 胶水更换记录DAO接口
+ * @author hzd
+ * @version 2026-03-03
+ */
+@MyBatisDao
+public interface MesProductGlueDao extends CrudDao<MesProductGlue> {
+	
+}

+ 87 - 0
src/main/java/com/jeesite/modules/mes/entity/MesProductGlue.java

@@ -0,0 +1,87 @@
+package com.jeesite.modules.mes.entity;
+
+import com.jeesite.common.collect.ListUtils;
+import com.jeesite.common.entity.DataEntity;
+import com.jeesite.common.mybatis.annotation.Column;
+import com.jeesite.common.mybatis.annotation.Table;
+import com.jeesite.common.utils.excel.annotation.ExcelField;
+import com.jeesite.common.utils.excel.annotation.ExcelField.Align;
+import com.jeesite.common.utils.excel.annotation.ExcelFields;
+
+import javax.validation.constraints.Size;
+import java.util.List;
+
+/**
+ * 胶水更换记录Entity
+ * @author hzd
+ * @version 2026-03-03
+ */
+@Table(name="mes_product_glue", alias="a", label="胶水更换记录信息", columns={
+		@Column(name="id", attrName="id", label="id", isPK=true),
+		@Column(name="line_sn", attrName="lineSn", label="产线编号"),
+		@Column(name="oprno", attrName="oprno", label="工位号"),
+		@Column(name="remark", attrName="remark", label="备注"),
+		@Column(name="create_by", attrName="createBy", label="更换人", isUpdate=false, isQuery=false),
+		@Column(name="create_date", attrName="createDate", label="更换日期", isUpdate=false, isQuery=false, isUpdateForce=true),
+		@Column(name="update_by", attrName="updateBy", label="update_by", isQuery=false),
+		@Column(name="update_date", attrName="updateDate", label="更新日期", isQuery=false, isUpdateForce=true),
+	}, orderBy="a.update_date DESC"
+)
+public class MesProductGlue extends DataEntity<MesProductGlue> {
+	
+	private static final long serialVersionUID = 1L;
+	private String lineSn;		// 产线编号
+	private String oprno;		// 工位号
+	private String remark;		// 备注
+	private List img = ListUtils.newArrayList();//图片
+
+	@ExcelFields({
+		@ExcelField(title="产线编号", attrName="lineSn", align=Align.CENTER, sort=20),
+		@ExcelField(title="工位号", attrName="oprno", align=Align.CENTER, sort=30),
+		@ExcelField(title="备注", attrName="remark", align=Align.CENTER, sort=40),
+		@ExcelField(title="更换人", attrName="createBy", align=Align.CENTER, sort=50),
+		@ExcelField(title="更换日期", attrName="createDate", align=Align.CENTER, sort=60, dataFormat="yyyy-MM-dd hh:mm"),
+	})
+	public MesProductGlue() {
+		this(null);
+	}
+	
+	public MesProductGlue(String id){
+		super(id);
+	}
+	
+	@Size(min=0, max=10, message="产线编号长度不能超过 10 个字符")
+	public String getLineSn() {
+		return lineSn;
+	}
+
+	public void setLineSn(String lineSn) {
+		this.lineSn = lineSn;
+	}
+	
+	@Size(min=0, max=10, message="工位号长度不能超过 10 个字符")
+	public String getOprno() {
+		return oprno;
+	}
+
+	public void setOprno(String oprno) {
+		this.oprno = oprno;
+	}
+	
+	@Size(min=0, max=255, message="备注长度不能超过 255 个字符")
+	public String getRemark() {
+		return remark;
+	}
+
+	public void setRemark(String remark) {
+		this.remark = remark;
+	}
+
+	public List getImg() {
+		return img;
+	}
+
+	public void setImg(List img) {
+		this.img = img;
+	}
+}

+ 140 - 0
src/main/java/com/jeesite/modules/mes/service/MesProductGlueService.java

@@ -0,0 +1,140 @@
+package com.jeesite.modules.mes.service;
+
+import com.jeesite.common.config.Global;
+import com.jeesite.common.entity.Page;
+import com.jeesite.common.service.CrudService;
+import com.jeesite.common.service.ServiceException;
+import com.jeesite.common.utils.excel.ExcelImport;
+import com.jeesite.common.validator.ValidatorUtils;
+import com.jeesite.modules.file.utils.FileUploadUtils;
+import com.jeesite.modules.mes.dao.MesProductGlueDao;
+import com.jeesite.modules.mes.entity.MesProductGlue;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.validation.ConstraintViolation;
+import javax.validation.ConstraintViolationException;
+import java.util.List;
+
+/**
+ * 胶水更换记录Service
+ * @author hzd
+ * @version 2026-03-03
+ */
+@Service
+public class MesProductGlueService extends CrudService<MesProductGlueDao, MesProductGlue> {
+	
+	/**
+	 * 获取单条数据
+	 * @param mesProductGlue
+	 * @return
+	 */
+	@Override
+	public MesProductGlue get(MesProductGlue mesProductGlue) {
+		return super.get(mesProductGlue);
+	}
+	
+	/**
+	 * 查询分页数据
+	 * @param mesProductGlue 查询条件
+	 * @param mesProductGlue.page 分页对象
+	 * @return
+	 */
+	@Override
+	public Page<MesProductGlue> findPage(MesProductGlue mesProductGlue) {
+		return super.findPage(mesProductGlue);
+	}
+	
+	/**
+	 * 查询列表数据
+	 * @param mesProductGlue
+	 * @return
+	 */
+	@Override
+	public List<MesProductGlue> findList(MesProductGlue mesProductGlue) {
+		return super.findList(mesProductGlue);
+	}
+	
+	/**
+	 * 保存数据(插入或更新)
+	 * @param mesProductGlue
+	 */
+	@Override
+	@Transactional
+	public void save(MesProductGlue mesProductGlue) {
+		super.save(mesProductGlue);
+		// 保存上传图片
+		FileUploadUtils.saveFileUpload(mesProductGlue, mesProductGlue.getId(), "mesProductGlue_image");
+	}
+
+	/**
+	 * 导入数据
+	 * @param file 导入的数据文件
+	 */
+	@Transactional
+	public String importData(MultipartFile file) {
+		if (file == null){
+			throw new ServiceException(text("请选择导入的数据文件!"));
+		}
+		int successNum = 0; int failureNum = 0;
+		StringBuilder successMsg = new StringBuilder();
+		StringBuilder failureMsg = new StringBuilder();
+		try(ExcelImport ei = new ExcelImport(file, 2, 0)){
+			List<MesProductGlue> list = ei.getDataList(MesProductGlue.class);
+			for (MesProductGlue mesProductGlue : list) {
+				try{
+					ValidatorUtils.validateWithException(mesProductGlue);
+					this.save(mesProductGlue);
+					successNum++;
+					successMsg.append("<br/>" + successNum + "、编号 " + mesProductGlue.getId() + " 导入成功");
+				} catch (Exception e) {
+					failureNum++;
+					String msg = "<br/>" + failureNum + "、编号 " + mesProductGlue.getId() + " 导入失败:";
+					if (e instanceof ConstraintViolationException){
+						ConstraintViolationException cve = (ConstraintViolationException)e;
+						for (ConstraintViolation<?> violation : cve.getConstraintViolations()) {
+							msg += Global.getText(violation.getMessage()) + " ("+violation.getPropertyPath()+")";
+						}
+					}else{
+						msg += e.getMessage();
+					}
+					failureMsg.append(msg);
+					logger.error(msg, e);
+				}
+			}
+		} catch (Exception e) {
+			logger.error(e.getMessage(), e);
+			failureMsg.append(e.getMessage());
+			return failureMsg.toString();
+		}
+		if (failureNum > 0) {
+			failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:");
+			throw new ServiceException(failureMsg.toString());
+		}else{
+			successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:");
+		}
+		return successMsg.toString();
+	}
+	
+	/**
+	 * 更新状态
+	 * @param mesProductGlue
+	 */
+	@Override
+	@Transactional
+	public void updateStatus(MesProductGlue mesProductGlue) {
+		super.updateStatus(mesProductGlue);
+	}
+	
+	/**
+	 * 删除数据
+	 * @param mesProductGlue
+	 */
+	@Override
+	@Transactional
+	public void delete(MesProductGlue mesProductGlue) {
+		super.delete(mesProductGlue);
+	}
+	
+}

+ 53 - 53
src/main/java/com/jeesite/modules/mes/web/MesIconsController.java

@@ -85,81 +85,81 @@ public class MesIconsController extends BaseController {
 
 		return page;
 	}
-	@RequestMapping(value = "icons")
-	@ResponseBody
-	public CommonResp icons(MesIcons mesIcons,HttpServletRequest req) {
-		String host = req.getScheme() + "://" + req.getServerName() + ":" + req.getServerPort() + "/js";
-		List<MesIcons> list = mesIconsService.findList(mesIcons);
-		List<Map<String, Object>> mapList = ListUtils.newArrayList();
-		Subject subject = UserUtils.getSubject();
-		for (MesIcons mi : list) {
-			if(subject.isPermitted(mi.getAuth())){
-				Map<String, Object> map = MapUtils.newHashMap();
-				map.put("title", mi.getTitle());
-				map.put("mode", mi.getMode());
-				// 获取图片
-				FileUpload fu = new FileUpload();
-				fu.setBizKey(mi.getId());
-				fu.setBizType("mesIcons_image");
-				List<FileUpload> finfo = fileUploadService.findList(fu);
-				if(finfo!=null&&finfo.size()>0){
-					map.put("img", host + finfo.get(0).getFileUrl());
-				}else{
-					map.put("img", host + "");
-				}
-
-				mapList.add(map);
-			}
-		}
-
-		CommonResp<List<Map<String, Object>>> resp = new CommonResp<>();
-		resp.setData(mapList);
-		resp.setResult(Global.TRUE);
-		return resp;
-	}
 //	@RequestMapping(value = "icons")
 //	@ResponseBody
 //	public CommonResp icons(MesIcons mesIcons,HttpServletRequest req) {
-//		CommonResp<List<MesIconsResp>> resp = new CommonResp<>();
-//		String icons = CacheUtils.get("mes_icons","icons","");
-//		if(icons != null && !icons.isEmpty()){
-//			List<MesIconsResp> lists1 = JSON.parseArray(icons,MesIconsResp.class);
-//			if(!ListUtils.isEmpty(lists1)){
-//				resp.setData(lists1);
-//				resp.setResult(Global.TRUE);
-//				return resp;
-//			}
-//		}
-//
-//		List<MesIconsResp> mapList = ListUtils.newArrayList();
 //		String host = req.getScheme() + "://" + req.getServerName() + ":" + req.getServerPort() + "/js";
 //		List<MesIcons> list = mesIconsService.findList(mesIcons);
+//		List<Map<String, Object>> mapList = ListUtils.newArrayList();
 //		Subject subject = UserUtils.getSubject();
 //		for (MesIcons mi : list) {
 //			if(subject.isPermitted(mi.getAuth())){
-//				MesIconsResp map = new MesIconsResp();
-//				map.setTitle(mi.getTitle());
-//				map.setMode(mi.getMode());
-//				map.setImg("");
+//				Map<String, Object> map = MapUtils.newHashMap();
+//				map.put("title", mi.getTitle());
+//				map.put("mode", mi.getMode());
 //				// 获取图片
 //				FileUpload fu = new FileUpload();
 //				fu.setBizKey(mi.getId());
 //				fu.setBizType("mesIcons_image");
 //				List<FileUpload> finfo = fileUploadService.findList(fu);
-//				if(ListUtils.isNotEmpty(finfo)){
-//					map.setImg(finfo.get(0).getFileUrl());
+//				if(finfo!=null&&finfo.size()>0){
+//					map.put("img", host + finfo.get(0).getFileUrl());
+//				}else{
+//					map.put("img", host + "");
 //				}
+//
 //				mapList.add(map);
 //			}
 //		}
-//		if(!ListUtils.isEmpty(mapList)){
-//			CacheUtils.put("mes_icons","icons",JSON.toJSONString(mapList));
-//		}
 //
+//		CommonResp<List<Map<String, Object>>> resp = new CommonResp<>();
 //		resp.setData(mapList);
 //		resp.setResult(Global.TRUE);
 //		return resp;
 //	}
+	@RequestMapping(value = "icons")
+	@ResponseBody
+	public CommonResp icons(MesIcons mesIcons,HttpServletRequest req) {
+		CommonResp<List<MesIconsResp>> resp = new CommonResp<>();
+//		String icons = CacheUtils.get("mes_icons","icons","");
+//		if(icons != null && !icons.isEmpty()){
+//			List<MesIconsResp> lists1 = JSON.parseArray(icons,MesIconsResp.class);
+//			if(!ListUtils.isEmpty(lists1)){
+//				resp.setData(lists1);
+//				resp.setResult(Global.TRUE);
+//				return resp;
+//			}
+//		}
+
+		List<MesIconsResp> mapList = ListUtils.newArrayList();
+		String host = req.getScheme() + "://" + req.getServerName() + ":" + req.getServerPort() + "/js";
+		List<MesIcons> list = mesIconsService.findList(mesIcons);
+		Subject subject = UserUtils.getSubject();
+		for (MesIcons mi : list) {
+			if(subject.isPermitted(mi.getAuth())){
+				MesIconsResp map = new MesIconsResp();
+				map.setTitle(mi.getTitle());
+				map.setMode(mi.getMode());
+				map.setImg("");
+				// 获取图片
+				FileUpload fu = new FileUpload();
+				fu.setBizKey(mi.getId());
+				fu.setBizType("mesIcons_image");
+				List<FileUpload> finfo = fileUploadService.findList(fu);
+				if(ListUtils.isNotEmpty(finfo)){
+					map.setImg(finfo.get(0).getFileUrl());
+				}
+				mapList.add(map);
+			}
+		}
+//		if(!ListUtils.isEmpty(mapList)){
+//			CacheUtils.put("mes_icons","icons",JSON.toJSONString(mapList));
+//		}
+
+		resp.setData(mapList);
+		resp.setResult(Global.TRUE);
+		return resp;
+	}
 
 	/**
 	 * 查看编辑表单

+ 204 - 0
src/main/java/com/jeesite/modules/mes/web/MesProductGlueController.java

@@ -0,0 +1,204 @@
+package com.jeesite.modules.mes.web;
+
+import com.jeesite.common.collect.ListUtils;
+import com.jeesite.common.collect.MapUtils;
+import com.jeesite.common.config.Global;
+import com.jeesite.common.entity.Page;
+import com.jeesite.common.lang.DateUtils;
+import com.jeesite.common.utils.excel.ExcelExport;
+import com.jeesite.common.utils.excel.annotation.ExcelField.Type;
+import com.jeesite.common.web.BaseController;
+import com.jeesite.modules.file.entity.FileUpload;
+import com.jeesite.modules.file.service.FileUploadService;
+import com.jeesite.modules.mes.entity.MesProductGlue;
+import com.jeesite.modules.mes.resp.CommonResp;
+import com.jeesite.modules.mes.service.MesProductGlueService;
+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 org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 胶水更换记录Controller
+ * @author hzd
+ * @version 2026-03-03
+ */
+@Controller
+@RequestMapping(value = "${adminPath}/mes/mesProductGlue")
+public class MesProductGlueController extends BaseController {
+
+	@Autowired
+	private MesProductGlueService mesProductGlueService;
+
+	@Autowired
+	protected FileUploadService fileUploadService;
+	
+	/**
+	 * 获取数据
+	 */
+	@ModelAttribute
+	public MesProductGlue get(String id, boolean isNewRecord) {
+		return mesProductGlueService.get(id, isNewRecord);
+	}
+	
+	/**
+	 * 查询列表
+	 */
+	@RequiresPermissions("mes:mesProductGlue:view")
+	@RequestMapping(value = {"list", ""})
+	public String list(MesProductGlue mesProductGlue, Model model) {
+		model.addAttribute("mesProductGlue", mesProductGlue);
+		return "modules/mes/mesProductGlueList";
+	}
+	
+	/**
+	 * 查询列表数据
+	 */
+	@RequiresPermissions("mes:mesProductGlue:view")
+	@RequestMapping(value = "listData")
+	@ResponseBody
+	public Page<MesProductGlue> listData(MesProductGlue mesProductGlue, HttpServletRequest request, HttpServletResponse response) {
+		mesProductGlue.setPage(new Page<>(request, response));
+		Page<MesProductGlue> page = mesProductGlueService.findPage(mesProductGlue);
+		return page;
+	}
+
+	/**
+	 * 查看编辑表单
+	 */
+	@RequiresPermissions("mes:mesProductGlue:view")
+	@RequestMapping(value = "form")
+	public String form(MesProductGlue mesProductGlue, Model model) {
+		model.addAttribute("mesProductGlue", mesProductGlue);
+		return "modules/mes/mesProductGlueForm";
+	}
+
+	/**
+	 * 保存数据
+	 */
+	@RequiresPermissions("mes:mesProductGlue:edit")
+	@PostMapping(value = "save")
+	@ResponseBody
+	public String save(@Validated MesProductGlue mesProductGlue) {
+		mesProductGlueService.save(mesProductGlue);
+		return renderResult(Global.TRUE, text("保存胶水更换记录成功!"));
+	}
+
+	/**
+	 * 导出数据
+	 */
+	@RequiresPermissions("mes:mesProductGlue:view")
+	@RequestMapping(value = "exportData")
+	public void exportData(MesProductGlue mesProductGlue, HttpServletResponse response) {
+		List<MesProductGlue> list = mesProductGlueService.findList(mesProductGlue);
+		String fileName = "胶水更换记录" + DateUtils.getDate("yyyyMMddHHmmss") + ".xlsx";
+		try(ExcelExport ee = new ExcelExport("胶水更换记录", MesProductGlue.class)){
+			ee.setDataList(list).write(response, fileName);
+		}
+	}
+
+	/**
+	 * 下载模板
+	 */
+	@RequiresPermissions("mes:mesProductGlue:view")
+	@RequestMapping(value = "importTemplate")
+	public void importTemplate(HttpServletResponse response) {
+		MesProductGlue mesProductGlue = new MesProductGlue();
+		List<MesProductGlue> list = ListUtils.newArrayList(mesProductGlue);
+		String fileName = "胶水更换记录模板.xlsx";
+		try(ExcelExport ee = new ExcelExport("胶水更换记录", MesProductGlue.class, Type.IMPORT)){
+			ee.setDataList(list).write(response, fileName);
+		}
+	}
+
+	/**
+	 * 导入数据
+	 */
+	@ResponseBody
+	@RequiresPermissions("mes:mesProductGlue:edit")
+	@PostMapping(value = "importData")
+	public String importData(MultipartFile file) {
+		try {
+			String message = mesProductGlueService.importData(file);
+			return renderResult(Global.TRUE, "posfull:"+message);
+		} catch (Exception ex) {
+			return renderResult(Global.FALSE, "posfull:"+ex.getMessage());
+		}
+	}
+
+//	@RequiresPermissions(value={"mes:mesProductGlue:apia", "mes:mesProductGlue:apib"}, logical= Logical.OR)
+	@PostMapping("/submit")
+	@ResponseBody
+	public String submit(MesProductGlue mesProductGlue) {
+		mesProductGlueService.save(mesProductGlue);
+		return renderResult(Global.TRUE, text("操作成功!"));
+	}
+
+//	@RequiresPermissions(value={"mes:mesProductGlue:apia", "mes:mesProductGlue:apib"}, logical= Logical.OR)
+	@RequestMapping("lists")
+	@ResponseBody
+	public CommonResp<List<MesProductGlue>> lists(MesProductGlue mesProductGlue, HttpServletRequest request, HttpServletResponse response){
+
+		CommonResp<List<MesProductGlue>> resp = new CommonResp<>();
+
+		// 构造图片访问的基础URL
+		String host = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + "/js";
+
+		// 从 request 获取并设置分页参数
+		mesProductGlue.setPage(new Page<>(request, response));
+
+		// 分页查询
+		Page<MesProductGlue> page = mesProductGlueService.findPage(mesProductGlue);
+		List<MesProductGlue> list = page.getList();
+
+		resp.setData(list);
+		resp.setResult(Global.TRUE);
+		return resp;
+	}
+
+//	@RequiresPermissions(value={"mes:mesProductGlue:apia", "mes:mesProductGlue:apib"}, logical= Logical.OR)
+	@RequestMapping("info")
+	@ResponseBody
+	public CommonResp<MesProductGlue> info(MesProductGlue mesProductGlue, HttpServletRequest request, HttpServletResponse response){
+
+		CommonResp<MesProductGlue> resp = new CommonResp<>();
+
+		// 构造图片访问的基础URL
+		String host = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + "/js";
+
+		// 图片
+		FileUpload fu = new FileUpload();
+		fu.setBizKey(mesProductGlue.getId());
+		fu.setBizType("mesProductGlue_image");
+		List<FileUpload> finfo = fileUploadService.findList(fu);
+		if (!ListUtils.isEmpty(finfo)) {
+			List imgList = ListUtils.newArrayList();
+			for (FileUpload fi : finfo) {
+				Map<String, Object> map1 = MapUtils.newHashMap();
+				map1.put("id", fi.getFileEntity().getFileId());
+				map1.put("url", host + fi.getFileUrl());
+				map1.put("name", fi.getFileName());
+				map1.put("size", fi.getFileEntity().getFileSize());
+
+				imgList.add(map1);
+			}
+			mesProductGlue.setImg(imgList);
+		}
+
+		resp.setData(mesProductGlue);
+		resp.setResult(Global.TRUE);
+		return resp;
+	}
+	
+}

+ 32 - 2
src/main/java/com/jeesite/modules/mes/web/MesProductRecordController.java

@@ -13,6 +13,7 @@ import java.nio.file.Paths;
 import java.text.DateFormat;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
+import java.time.Duration;
 import java.time.LocalDate;
 import java.time.LocalDateTime;
 import java.time.ZoneId;
@@ -207,6 +208,8 @@ public class MesProductRecordController extends BaseController {
 	private MesProductCcService mesProductCcService;
 	@Autowired
 	private MesProductOprnoService mesProductOprnoService;
+	@Autowired
+	private MesProductGlueService mesProductGlueService;
 
 
 	/**
@@ -1013,6 +1016,30 @@ public class MesProductRecordController extends BaseController {
 						}
 					}
 				}
+				if(CommonUitl.formatOprno(oprno).equals("OP210") || CommonUitl.formatOprno(oprno).equals("OP360")){ // 胶管更换(210\360)
+					String check250 = Global.getConfig("mes.check.op210");
+					if(check250.equals("1")) {
+						// 获取当前时间
+						LocalDateTime now = LocalDateTime.now();
+						// 定义一个持续时间为4小时
+						Duration duration = Duration.ofHours(4);
+						// 从当前时间减去4小时
+						LocalDateTime fourHoursAgo = now.minus(duration);
+						// 定义时间格式
+						DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+						// 格式化时间为字符串
+						String formattedDateTime = fourHoursAgo.format(formatter);
+
+						MesProductGlue mesProductGlue = new MesProductGlue();
+						mesProductGlue.setOprno(oldOprno);
+						mesProductGlue.setLineSn(lineSn);
+						mesProductGlue.getSqlMap().getWhere().and("a.create_date",QueryType.GTE,formattedDateTime);
+						List<MesProductGlue> glues = mesProductGlueService.findList(mesProductGlue);
+						if(ListUtils.isEmpty(glues)){
+							return "RSJS";
+						}
+					}
+				}
 
 			}catch(Exception e){
 
@@ -1536,7 +1563,7 @@ public class MesProductRecordController extends BaseController {
 						if(!ObjectUtils.isEmpty(mesDeviceTime)){
 							long twoHoursInMillis = 1 * 60 * 1000;
 							long timeDifference = System.currentTimeMillis() - mesDeviceTime.getStartDate().getTime();
-							if(timeDifference > twoHoursInMillis){
+							if(timeDifference < twoHoursInMillis){
 								return "RSCS";
 							}
 						}
@@ -3846,9 +3873,11 @@ public class MesProductRecordController extends BaseController {
 						mesDeviceTime.getSqlMap().getWhere().and("end_date",QueryType.IS_NOT_NULL, null);
 						//按时间排序
 						mesDeviceTime.getSqlMap().getOrder().setOrderBy("start_date desc limit 1");
+						MesDeviceTime mesDeviceTime1 = mesDeviceTimeService.findList(mesDeviceTime).get(0);
+						System.out.println("mesDeviceTime1:"+mesDeviceTime1.getEndDate());
 						// 当前时间要在这个工件结束时间三分钟后
 						long twoHoursInMillis = 3 * 60 * 1000;
-						long timeDifference = System.currentTimeMillis() - mesDeviceTime.getEndDate().getTime();
+						long timeDifference = System.currentTimeMillis() - mesDeviceTime1.getEndDate().getTime();
 						if(timeDifference < twoHoursInMillis){
 							return renderResult(Global.FALSE, text("未在规定时间内!"));
 						}
@@ -3870,6 +3899,7 @@ public class MesProductRecordController extends BaseController {
 						mesProductModifyRecord.setOprno(oprno);
 						mesProductModifyRecord.setCraft("100000");
 						mesProductModifyRecord.setSource("1");
+						mesProductModifyRecord.setContent(result);
 						mesProductModifyRecordService.save(mesProductModifyRecord);
 					}
 

+ 1 - 1
src/main/java/com/jeesite/modules/mes/web/MesProductRepairController.java

@@ -258,7 +258,7 @@ public class MesProductRepairController extends BaseController {
 
 		mesProductRepairService.save(mesProductRepair);
 
-		resp.setMessage("操作成");
+		resp.setMessage("操作成");
 		resp.setResult(Global.TRUE);
 		return resp;
 	}

+ 15 - 0
src/main/resources/mappings/modules/mes/MesProductGlueDao.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.MesProductGlueDao">
+	
+	<!-- 查询数据
+	<select id="findList" resultType="MesProductGlue">
+		SELECT ${sqlMap.column.toSql()}
+		FROM ${sqlMap.table.toSql()}
+		<where>
+			${sqlMap.where.toSql()}
+		</where>
+		ORDER BY ${sqlMap.order.toSql()}
+	</select> -->
+	
+</mapper>