Browse Source

胶水有效期

hzd 3 days ago
parent
commit
11149d46c0

+ 15 - 0
src/main/java/com/jeesite/modules/mes/dao/MesGlueDao.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.MesGlue;
+
+/**
+ * 胶水有效期管理DAO接口
+ * @author hzd
+ * @version 2025-04-16
+ */
+@MyBatisDao
+public interface MesGlueDao extends CrudDao<MesGlue> {
+    MesGlue findInfo(MesGlue mesGlue);
+}

+ 15 - 0
src/main/java/com/jeesite/modules/mes/dao/MesGlueRecordDao.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.MesGlueRecord;
+
+/**
+ * 工位胶水拆封记录DAO接口
+ * @author hzd
+ * @version 2025-04-17
+ */
+@MyBatisDao
+public interface MesGlueRecordDao extends CrudDao<MesGlueRecord> {
+    MesGlueRecord findInfo(MesGlueRecord mesGlueRecord);
+}

+ 102 - 0
src/main/java/com/jeesite/modules/mes/entity/MesGlue.java

@@ -0,0 +1,102 @@
+package com.jeesite.modules.mes.entity;
+
+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;
+
+import javax.validation.constraints.Size;
+
+/**
+ * 胶水有效期管理Entity
+ * @author hzd
+ * @version 2025-04-16
+ */
+@Table(name="mes_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="title", attrName="title", label="名称", queryType=QueryType.LIKE),
+		@Column(name="days", attrName="days", label="保质期", comment="保质期(天)"),
+		@Column(name="cfdays", attrName="cfdays", label="拆封有效期", comment="拆封有效期(天)"),
+		@Column(name="remark", attrName="remark", label="备注"),
+		@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="修改日期", isUpdateForce=true),
+	}, orderBy="a.update_date DESC"
+)
+public class MesGlue extends DataEntity<MesGlue> {
+	
+	private static final long serialVersionUID = 1L;
+	private String lineSn;		// 产线
+	private String oprno;		// 工位号
+	private String title;		// 名称
+	private String days;		// 保质期(天)
+	private String cfdays;		// 拆封有效期(天)
+	private String remark;		// 备注
+
+	public MesGlue() {
+		this(null);
+	}
+	
+	public MesGlue(String id){
+		super(id);
+	}
+	
+	@Size(min=0, max=255, message="产线长度不能超过 255 个字符")
+	public String getLineSn() {
+		return lineSn;
+	}
+
+	public void setLineSn(String lineSn) {
+		this.lineSn = lineSn;
+	}
+	
+	@Size(min=0, max=255, message="工位号长度不能超过 255 个字符")
+	public String getOprno() {
+		return oprno;
+	}
+
+	public void setOprno(String oprno) {
+		this.oprno = oprno;
+	}
+	
+	@Size(min=0, max=255, message="名称长度不能超过 255 个字符")
+	public String getTitle() {
+		return title;
+	}
+
+	public void setTitle(String title) {
+		this.title = title;
+	}
+	
+	@Size(min=0, max=255, message="保质期长度不能超过 255 个字符")
+	public String getDays() {
+		return days;
+	}
+
+	public void setDays(String days) {
+		this.days = days;
+	}
+	
+	@Size(min=0, max=255, message="拆封有效期长度不能超过 255 个字符")
+	public String getCfdays() {
+		return cfdays;
+	}
+
+	public void setCfdays(String cfdays) {
+		this.cfdays = cfdays;
+	}
+	
+	@Size(min=0, max=255, message="备注长度不能超过 255 个字符")
+	public String getRemark() {
+		return remark;
+	}
+
+	public void setRemark(String remark) {
+		this.remark = remark;
+	}
+	
+}

+ 168 - 0
src/main/java/com/jeesite/modules/mes/entity/MesGlueRecord.java

@@ -0,0 +1,168 @@
+package com.jeesite.modules.mes.entity;
+
+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.JoinTable;
+import com.jeesite.common.mybatis.annotation.JoinTable.Type;
+import com.jeesite.common.mybatis.annotation.Table;
+
+import javax.validation.constraints.Size;
+import java.util.Date;
+
+/**
+ * 工位胶水拆封记录Entity
+ * @author hzd
+ * @version 2025-04-17
+ */
+@Table(name="mes_glue_record", alias="a", label="工位胶水拆封记录信息", columns={
+		@Column(name="id", attrName="id", label="id", isPK=true),
+		@Column(name="glue_id", attrName="glueId", label="glue_id"),
+		@Column(name="barcode", attrName="barcode", label="物料批次"),
+		@Column(name="sc_date", attrName="scDate", label="生产日期", isUpdateForce=true),
+		@Column(name="cf_date", attrName="cfDate", label="拆封日期", isUpdateForce=true),
+		@Column(name="oprno", attrName="oprno", label="工位号"),
+		@Column(name="lose_date", attrName="loseDate", label="拆封失效日期", isUpdateForce=true),
+		@Column(name="validity_date", attrName="validityDate", label="失效日期", isUpdateForce=true),
+		@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="update_by", isQuery=false),
+		@Column(name="update_date", attrName="updateDate", label="update_date", isQuery=false, isUpdateForce=true),
+	},joinTable={
+		@JoinTable(type=Type.JOIN, entity=MesGlue.class, attrName="this", alias="b",
+				on="b.id = a.glue_id",
+				columns={
+						@Column(name="title", attrName="glueTitle", label="名称"),
+						@Column(name="line_sn", attrName="lineSn", label="产线"),
+//						@Column(name="oprno", attrName="oprno", label="工位"),
+						@Column(name="days", attrName="days", label="有效期"),
+						@Column(name="cfdays", attrName="cfdays", label="拆封有效期"),
+				}),
+}, orderBy="a.update_date DESC"
+)
+public class MesGlueRecord extends DataEntity<MesGlueRecord> {
+
+	private static final long serialVersionUID = 1L;
+	private String glueId;		// glue_id
+	private String barcode;		// 物料批次
+	private Date scDate;		// 生产日期
+	private Date cfDate;		// 拆封日期
+	private Date loseDate;		// 失效日期
+	private Date validityDate;		// 失效日期
+	private String title;
+	private String lineSn;
+	private String oprno;
+	private String days;
+	private String cfdays;
+	private String glueTitle;
+
+
+	public MesGlueRecord() {
+		this(null);
+	}
+
+	public MesGlueRecord(String id){
+		super(id);
+	}
+
+	@Size(min=0, max=64, message="glue_id长度不能超过 64 个字符")
+	public String getGlueId() {
+		return glueId;
+	}
+
+	public void setGlueId(String glueId) {
+		this.glueId = glueId;
+	}
+
+	@Size(min=0, max=255, message="物料批次长度不能超过 255 个字符")
+	public String getBarcode() {
+		return barcode;
+	}
+
+	public void setBarcode(String barcode) {
+		this.barcode = barcode;
+	}
+
+	@JsonFormat(pattern = "yyyy-MM-dd")
+	public Date getScDate() {
+		return scDate;
+	}
+
+	public void setScDate(Date scDate) {
+		this.scDate = scDate;
+	}
+
+	@JsonFormat(pattern = "yyyy-MM-dd")
+	public Date getCfDate() {
+		return cfDate;
+	}
+
+	public void setCfDate(Date cfDate) {
+		this.cfDate = cfDate;
+	}
+
+	@JsonFormat(pattern = "yyyy-MM-dd")
+	public Date getLoseDate() {
+		return loseDate;
+	}
+
+	public void setLoseDate(Date loseDate) {
+		this.loseDate = loseDate;
+	}
+
+	public String getTitle() {
+		return title;
+	}
+
+	public void setTitle(String title) {
+		this.title = title;
+	}
+
+	public String getLineSn() {
+		return lineSn;
+	}
+
+	public void setLineSn(String lineSn) {
+		this.lineSn = lineSn;
+	}
+
+	public String getOprno() {
+		return oprno;
+	}
+
+	public void setOprno(String oprno) {
+		this.oprno = oprno;
+	}
+
+	public String getDays() {
+		return days;
+	}
+
+	public void setDays(String days) {
+		this.days = days;
+	}
+
+	public String getCfdays() {
+		return cfdays;
+	}
+
+	public void setCfdays(String cfdays) {
+		this.cfdays = cfdays;
+	}
+
+	public String getGlueTitle() {
+		return glueTitle;
+	}
+
+	public void setGlueTitle(String glueTitle) {
+		this.glueTitle = glueTitle;
+	}
+	@JsonFormat(pattern = "yyyy-MM-dd")
+	public Date getValidityDate() {
+		return validityDate;
+	}
+
+	public void setValidityDate(Date validityDate) {
+		this.validityDate = validityDate;
+	}
+}

+ 139 - 0
src/main/java/com/jeesite/modules/mes/service/MesGlueRecordService.java

@@ -0,0 +1,139 @@
+package com.jeesite.modules.mes.service;
+
+import com.jeesite.common.collect.ListUtils;
+import com.jeesite.common.entity.Page;
+import com.jeesite.common.service.CrudService;
+import com.jeesite.modules.mes.dao.MesGlueRecordDao;
+import com.jeesite.modules.mes.entity.MesGlue;
+import com.jeesite.modules.mes.entity.MesGlueRecord;
+import com.jeesite.modules.mes.util.CommonUitl;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.ObjectUtils;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 工位胶水拆封记录Service
+ * @author hzd
+ * @version 2025-04-17
+ */
+@Service
+public class MesGlueRecordService extends CrudService<MesGlueRecordDao, MesGlueRecord> {
+
+	@Autowired
+	private MesGlueRecordDao mesGlueRecordDao;
+
+	@Autowired
+	private MesGlueService mesGlueService;
+
+	/**
+	 * 获取单条数据
+	 * @param mesGlueRecord
+	 * @return
+	 */
+	@Override
+	public MesGlueRecord get(MesGlueRecord mesGlueRecord) {
+		return super.get(mesGlueRecord);
+	}
+
+	public MesGlueRecord findInfo(MesGlueRecord mesGlueRecord) {
+		return mesGlueRecordDao.findInfo(mesGlueRecord);
+	}
+
+
+	/**
+	 * 查询分页数据
+	 * @param mesGlueRecord 查询条件
+	 * @param mesGlueRecord.page 分页对象
+	 * @return
+	 */
+	@Override
+	public Page<MesGlueRecord> findPage(MesGlueRecord mesGlueRecord) {
+		return super.findPage(mesGlueRecord);
+	}
+
+	/**
+	 * 查询列表数据
+	 * @param mesGlueRecord
+	 * @return
+	 */
+	@Override
+	public List<MesGlueRecord> findList(MesGlueRecord mesGlueRecord) {
+		return super.findList(mesGlueRecord);
+	}
+
+	/**
+	 * 保存数据(插入或更新)
+	 * @param mesGlueRecord
+	 */
+	@Override
+	@Transactional
+	public void save(MesGlueRecord mesGlueRecord) {
+		super.save(mesGlueRecord);
+	}
+
+	/**
+	 * 更新状态
+	 * @param mesGlueRecord
+	 */
+	@Override
+	@Transactional
+	public void updateStatus(MesGlueRecord mesGlueRecord) {
+		super.updateStatus(mesGlueRecord);
+	}
+
+	/**
+	 * 删除数据
+	 * @param mesGlueRecord
+	 */
+	@Override
+	@Transactional
+	public void delete(MesGlueRecord mesGlueRecord) {
+		super.delete(mesGlueRecord);
+	}
+
+	public Boolean checkDateJs(String oprno, String lineSn) {
+		MesGlue mesGlue = new MesGlue();
+		mesGlue.setOprno(CommonUitl.formatOprno(oprno));
+		mesGlue.setStatus("0");
+		mesGlue.setLineSn(lineSn);
+		List<MesGlue> lists = mesGlueService.findList(mesGlue);
+		if(ListUtils.isEmpty(lists)){
+			return true;
+		}
+
+		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+		Date now = new Date();
+
+		for (MesGlue mesGlue1 : lists) {
+			MesGlueRecord mesGlueRecord = new MesGlueRecord();
+			mesGlueRecord.setGlueId(mesGlue1.getId());
+			mesGlueRecord.setOprno(oprno);
+			mesGlueRecord.getSqlMap().getOrder().setOrderBy("a.id desc");
+			MesGlueRecord mesGlueRecord1 = mesGlueRecordDao.findInfo(mesGlueRecord);
+			if(ObjectUtils.isEmpty(mesGlueRecord1)){
+				return false;
+			}
+
+			try {
+				SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy-MM-dd"); // 定义日期时间格式
+				String strDate = sdf2.format(mesGlueRecord1.getLoseDate());
+
+				Date date1 = sdf.parse(strDate+" 23:59:59");
+
+				if (date1.compareTo(now) < 0) {
+					return false;
+				}
+			} catch (ParseException e) {
+				e.printStackTrace();
+			}
+		}
+		return true;
+	}
+
+}

+ 89 - 0
src/main/java/com/jeesite/modules/mes/service/MesGlueService.java

@@ -0,0 +1,89 @@
+package com.jeesite.modules.mes.service;
+
+import com.jeesite.common.entity.Page;
+import com.jeesite.common.service.CrudService;
+import com.jeesite.modules.mes.dao.MesGlueDao;
+import com.jeesite.modules.mes.entity.MesGlue;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+
+/**
+ * 胶水有效期管理Service
+ * @author hzd
+ * @version 2025-04-16
+ */
+@Service
+public class MesGlueService extends CrudService<MesGlueDao, MesGlue> {
+
+	@Autowired
+	private MesGlueDao mesGlueDao;
+
+	/**
+	 * 获取单条数据
+	 * @param mesGlue
+	 * @return
+	 */
+	@Override
+	public MesGlue get(MesGlue mesGlue) {
+		return super.get(mesGlue);
+	}
+
+	public MesGlue findInfo(MesGlue mesGlue) {
+		return mesGlueDao.findInfo(mesGlue);
+	}
+	
+	/**
+	 * 查询分页数据
+	 * @param mesGlue 查询条件
+	 * @param mesGlue.page 分页对象
+	 * @return
+	 */
+	@Override
+	public Page<MesGlue> findPage(MesGlue mesGlue) {
+		return super.findPage(mesGlue);
+	}
+	
+	/**
+	 * 查询列表数据
+	 * @param mesGlue
+	 * @return
+	 */
+	@Override
+	public List<MesGlue> findList(MesGlue mesGlue) {
+		return super.findList(mesGlue);
+	}
+	
+	/**
+	 * 保存数据(插入或更新)
+	 * @param mesGlue
+	 */
+	@Override
+	@Transactional
+	public void save(MesGlue mesGlue) {
+		super.save(mesGlue);
+	}
+	
+	/**
+	 * 更新状态
+	 * @param mesGlue
+	 */
+	@Override
+	@Transactional
+	public void updateStatus(MesGlue mesGlue) {
+		super.updateStatus(mesGlue);
+	}
+	
+	/**
+	 * 删除数据
+	 * @param mesGlue
+	 */
+	@Override
+	@Transactional
+	public void delete(MesGlue mesGlue) {
+		super.delete(mesGlue);
+	}
+	
+}

+ 28 - 0
src/main/java/com/jeesite/modules/mes/util/CommonUitl.java

@@ -24,6 +24,7 @@ import java.text.DateFormat;
 import java.text.DecimalFormat;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
+import java.time.LocalDate;
 import java.util.*;
 import java.util.concurrent.TimeUnit;
 
@@ -571,4 +572,31 @@ public class CommonUitl {
         return true;
     }
 
+    public static List<Date> getLoseDate(String scDate,String days,String cfdays){
+        ArrayList<Date> list = new ArrayList<>();
+        System.err.println("scDate:"+scDate);
+        System.err.println("days:"+days);
+        System.err.println("cfdays:"+cfdays);
+        int day = Integer.parseInt(days);
+        int cf = Integer.parseInt(cfdays);
+
+        String[] scDates = scDate.split("-");
+        // 创建一个特定的日期,例如2023年1月1日
+        LocalDate specificDate = LocalDate.of(Integer.valueOf(scDates[0]), Integer.valueOf(scDates[1]), Integer.valueOf(scDates[2]));
+        // 在这个日期上增加10天
+        LocalDate dateAfterTenDays1 = specificDate.plusDays(day);
+        System.err.println("dateAfterTenDays1.toString():"+dateAfterTenDays1.toString());
+        Date d1 = CommonUitl.String2Date(dateAfterTenDays1.toString());
+
+        // 获取当前日期
+        LocalDate today = LocalDate.now();
+        // 在当前日期上增加10天
+        LocalDate dateAfterTenDays2 = today.plusDays(cf);
+        Date d2 = CommonUitl.String2Date(dateAfterTenDays2.toString());
+
+        list.add(d1);//有效期
+        list.add(d2);//拆封有效期
+        return list;
+    }
+
 }

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

@@ -0,0 +1,119 @@
+package com.jeesite.modules.mes.web;
+
+import com.jeesite.common.config.Global;
+import com.jeesite.common.entity.Page;
+import com.jeesite.common.web.BaseController;
+import com.jeesite.modules.mes.entity.MesGlue;
+import com.jeesite.modules.mes.service.MesGlueService;
+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 javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * 胶水有效期管理Controller
+ * @author hzd
+ * @version 2025-04-16
+ */
+@Controller
+@RequestMapping(value = "${adminPath}/mes/mesGlue")
+public class MesGlueController extends BaseController {
+
+	@Autowired
+	private MesGlueService mesGlueService;
+	
+	/**
+	 * 获取数据
+	 */
+	@ModelAttribute
+	public MesGlue get(String id, boolean isNewRecord) {
+		return mesGlueService.get(id, isNewRecord);
+	}
+	
+	/**
+	 * 查询列表
+	 */
+	@RequiresPermissions("mes:mesGlue:view")
+	@RequestMapping(value = {"list", ""})
+	public String list(MesGlue mesGlue, Model model) {
+		model.addAttribute("mesGlue", mesGlue);
+		return "modules/mes/mesGlueList";
+	}
+	
+	/**
+	 * 查询列表数据
+	 */
+	@RequiresPermissions("mes:mesGlue:view")
+	@RequestMapping(value = "listData")
+	@ResponseBody
+	public Page<MesGlue> listData(MesGlue mesGlue, HttpServletRequest request, HttpServletResponse response) {
+		mesGlue.setPage(new Page<>(request, response));
+		Page<MesGlue> page = mesGlueService.findPage(mesGlue);
+		return page;
+	}
+
+	/**
+	 * 查看编辑表单
+	 */
+	@RequiresPermissions("mes:mesGlue:view")
+	@RequestMapping(value = "form")
+	public String form(MesGlue mesGlue, Model model) {
+		model.addAttribute("mesGlue", mesGlue);
+		return "modules/mes/mesGlueForm";
+	}
+
+	/**
+	 * 保存数据
+	 */
+	@RequiresPermissions("mes:mesGlue:edit")
+	@PostMapping(value = "save")
+	@ResponseBody
+	public String save(@Validated MesGlue mesGlue) {
+		mesGlueService.save(mesGlue);
+		return renderResult(Global.TRUE, text("保存胶水管理成功!"));
+	}
+	
+	/**
+	 * 停用数据
+	 */
+	@RequiresPermissions("mes:mesGlue:edit")
+	@RequestMapping(value = "disable")
+	@ResponseBody
+	public String disable(MesGlue mesGlue) {
+		mesGlue.setStatus(MesGlue.STATUS_DISABLE);
+		mesGlueService.updateStatus(mesGlue);
+		return renderResult(Global.TRUE, text("停用胶水管理成功"));
+	}
+	
+	/**
+	 * 启用数据
+	 */
+	@RequiresPermissions("mes:mesGlue:edit")
+	@RequestMapping(value = "enable")
+	@ResponseBody
+	public String enable(MesGlue mesGlue) {
+		mesGlue.setStatus(MesGlue.STATUS_NORMAL);
+		mesGlueService.updateStatus(mesGlue);
+		return renderResult(Global.TRUE, text("启用胶水管理成功"));
+	}
+	
+	/**
+	 * 删除数据
+	 */
+	@RequiresPermissions("mes:mesGlue:edit")
+	@RequestMapping(value = "delete")
+	@ResponseBody
+	public String delete(MesGlue mesGlue) {
+		mesGlueService.delete(mesGlue);
+		return renderResult(Global.TRUE, text("删除胶水管理成功!"));
+	}
+	
+}

+ 165 - 0
src/main/java/com/jeesite/modules/mes/web/MesGlueRecordController.java

@@ -0,0 +1,165 @@
+package com.jeesite.modules.mes.web;
+
+import com.jeesite.common.config.Global;
+import com.jeesite.common.entity.Page;
+import com.jeesite.common.web.BaseController;
+import com.jeesite.modules.mes.entity.MesGlue;
+import com.jeesite.modules.mes.entity.MesGlueRecord;
+import com.jeesite.modules.mes.service.MesGlueRecordService;
+import com.jeesite.modules.mes.service.MesGlueService;
+import com.jeesite.modules.mes.util.CommonUitl;
+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.util.ObjectUtils;
+import org.springframework.util.StringUtils;
+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 javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 工位胶水拆封记录Controller
+ * @author hzd
+ * @version 2025-04-17
+ */
+@Controller
+@RequestMapping(value = "${adminPath}/mes/mesGlueRecord")
+public class MesGlueRecordController extends BaseController {
+
+	@Autowired
+	private MesGlueRecordService mesGlueRecordService;
+
+	@Autowired
+	private MesGlueService mesGlueService;
+
+	/**
+	 * 获取数据
+	 */
+	@ModelAttribute
+	public MesGlueRecord get(String id, boolean isNewRecord) {
+		return mesGlueRecordService.get(id, isNewRecord);
+	}
+
+	/**
+	 * 查询列表
+	 */
+	@RequiresPermissions("mes:mesGlueRecord:view")
+	@RequestMapping(value = {"list", ""})
+	public String list(MesGlueRecord mesGlueRecord, Model model) {
+		model.addAttribute("mesGlueRecord", mesGlueRecord);
+		return "modules/mes/mesGlueRecordList";
+	}
+
+	/**
+	 * 查询列表数据
+	 */
+	@RequiresPermissions("mes:mesGlueRecord:view")
+	@RequestMapping(value = "listData")
+	@ResponseBody
+	public Page<MesGlueRecord> listData(MesGlueRecord mesGlueRecord, HttpServletRequest request, HttpServletResponse response) {
+		mesGlueRecord.setPage(new Page<>(request, response));
+		Page<MesGlueRecord> page = mesGlueRecordService.findPage(mesGlueRecord);
+		return page;
+	}
+
+	/**
+	 * 查看编辑表单
+	 */
+	@RequiresPermissions("mes:mesGlueRecord:view")
+	@RequestMapping(value = "form")
+	public String form(MesGlueRecord mesGlueRecord, Model model) {
+		model.addAttribute("mesGlueRecord", mesGlueRecord);
+		return "modules/mes/mesGlueRecordForm";
+	}
+
+	/**
+	 * 保存数据
+	 */
+	@RequiresPermissions("mes:mesGlueRecord:edit")
+	@PostMapping(value = "save")
+	@ResponseBody
+	public String save(@Validated MesGlueRecord mesGlueRecord) {
+		mesGlueRecordService.save(mesGlueRecord);
+		return renderResult(Global.TRUE, text("保存工位胶水拆封记录成功!"));
+	}
+
+	@RequestMapping(value = {"olist", ""})
+	public String olist(MesGlueRecord mesGlueRecord, Model model, HttpServletRequest request) {
+		String oprno = request.getParameter("oprno");
+		String ucode = request.getParameter("ucode");
+		String lineSn = request.getParameter("lineSn");
+		model.addAttribute("mesGlueRecord", mesGlueRecord);
+		model.addAttribute("oprno", oprno);
+		model.addAttribute("ucode", ucode);
+		model.addAttribute("lineSn", lineSn);
+
+		return "modules/mes/mesGlueRecordOlist";
+	}
+
+	@RequestMapping(value = "listData2")
+	@ResponseBody
+	public Page<MesGlueRecord> listData2(MesGlueRecord mesGlueRecord, HttpServletRequest request, HttpServletResponse response) {
+		mesGlueRecord.setPage(new Page<>(request, response));
+		Page<MesGlueRecord> page = mesGlueRecordService.findPage(mesGlueRecord);
+		return page;
+	}
+
+	@RequestMapping(value = "edit")
+	public String edit(MesGlueRecord mesGlueRecord, Model model, HttpServletRequest request) {
+		String ucode = request.getParameter("ucode");
+		model.addAttribute("ucode", ucode);
+		model.addAttribute("mesGlueRecord", mesGlueRecord);
+		String oriOprno = CommonUitl.formatOprno(mesGlueRecord.getOprno()); // 原始工位,不带ABCD
+		MesGlue mesGlue = new MesGlue();
+		mesGlue.setOprno(oriOprno);
+		mesGlue.setLineSn(mesGlueRecord.getLineSn());
+		mesGlue.setStatus("0");
+		List<MesGlue> glues = mesGlueService.findList(mesGlue);
+		model.addAttribute("glues", glues);
+
+		return "modules/mes/mesGlueRecordEdit";
+	}
+
+	/**
+	 * 保存数据
+	 */
+	@PostMapping(value = "editSave")
+	@ResponseBody
+	public String editSave(@Validated MesGlueRecord mesGlueRecord, HttpServletRequest request) {
+		if(StringUtils.isEmpty(mesGlueRecord.getOprno())||StringUtils.isEmpty(mesGlueRecord.getLineSn())){
+			return renderResult(Global.TRUE, text("参数错误!"));
+		}
+		String ucode = request.getParameter("ucode");
+
+		String oriOprno = CommonUitl.formatOprno(mesGlueRecord.getOprno()); // 原始工位,不带ABCD
+
+		MesGlue mesGlue = mesGlueService.get(mesGlueRecord.getGlueId());
+		if(ObjectUtils.isEmpty(mesGlue) || !mesGlue.getStatus().equals("0")){
+			return renderResult(Global.TRUE, text("不需要更换胶水!"));
+		}
+		if(!(mesGlue.getOprno().equals(oriOprno) && mesGlue.getLineSn().equals(mesGlueRecord.getLineSn()))){
+			return renderResult(Global.TRUE, text("不需要更换胶水!"));
+		}
+
+
+		// 计算胶水有效期
+		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); // 定义日期时间格式
+		String scDateStr = sdf.format(mesGlueRecord.getScDate());
+		mesGlueRecord.setCfDate(new Date());
+		List<Date> loseDate = CommonUitl.getLoseDate(scDateStr,mesGlue.getDays(),mesGlue.getCfdays());
+		mesGlueRecord.setLoseDate(loseDate.get(1));
+		mesGlueRecord.setValidityDate(loseDate.get(0));
+		mesGlueRecord.setCreateBy(ucode);
+		mesGlueRecordService.save(mesGlueRecord);
+		return renderResult(Global.TRUE, text("操作成功!"));
+	}
+}

+ 8 - 0
src/main/java/com/jeesite/modules/mes/web/MesProductRecordController.java

@@ -211,6 +211,8 @@ public class MesProductRecordController extends BaseController {
 	private MesProductOprnoService mesProductOprnoService;
 	@Autowired
 	private MesProductGlueService mesProductGlueService;
+    @Autowired
+    private MesGlueRecordService mesGlueRecordService;
 
 
 	/**
@@ -1304,6 +1306,12 @@ public class MesProductRecordController extends BaseController {
 					}
 				}
 			}
+
+			// 判断胶水是否在有效期内
+			Boolean checkJs = mesGlueRecordService.checkDateJs(oldOprno,lineSn);
+			if(!checkJs){
+				return "RSJL"; // 胶水失效
+			}
 		}
 
 		if(CommonUitl.checkDbjOprno(oldOprno,lineSn)){ // 单部件

+ 2 - 0
src/main/java/com/jeesite/modules/utils/ErrorMsg.java

@@ -48,6 +48,8 @@ public class ErrorMsg {
                 lmsg = "该工件存在未处理的报警信息";
             } else if (processMsgRet.equalsIgnoreCase("JZ")) {
                 lmsg = "超过规定时间时间";
+            }else if(processMsgRet.equalsIgnoreCase("JL")) {
+                lmsg = "胶水失效或未绑定";
             }
         }catch (Exception e){ }
         return lmsg;

+ 5 - 1
src/main/resources/config/application.yml

@@ -54,7 +54,7 @@ jdbc:
   # Mysql 数据库配置
   type: mysql
   driver: com.mysql.cj.jdbc.Driver
-  url: jdbc:mysql://127.0.0.1:3307/mescloud?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=CONVERT_TO_NULL&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true
+  url: jdbc:mysql://127.0.0.1:3306/mescloud?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=CONVERT_TO_NULL&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true
 #  url: jdbc:mysql://192.168.21.99:3306/mescloud?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=CONVERT_TO_NULL&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true
 #  url: jdbc:mysql://127.0.0.1:3306/mes_cloud_x13?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=CONVERT_TO_NULL&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true
   username: mescloud
@@ -675,6 +675,10 @@ shiro:
     ${adminPath}/mes/mesRepairItems/submit = anon
     ${adminPath}/mes/mesProductQm/addItem = anon
     ${adminPath}/mes/mesProductRecord/dp350 = anon
+    ${adminPath}/mes/mesGlueRecord/olist = anon
+    ${adminPath}/mes/mesGlueRecord/editSave = anon
+    ${adminPath}/mes/mesGlueRecord/edit = anon
+    ${adminPath}/mes/mesGlueRecord/listData2 = anon
     ${adminPath}/** = user
 
 

+ 24 - 0
src/main/resources/mappings/modules/mes/MesGlueDao.xml

@@ -0,0 +1,24 @@
+<?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.MesGlueDao">
+	
+	<!-- 查询数据
+	<select id="findList" resultType="MesGlue">
+		SELECT ${sqlMap.column.toSql()}
+		FROM ${sqlMap.table.toSql()}
+		<where>
+			${sqlMap.where.toSql()}
+		</where>
+		ORDER BY ${sqlMap.order.toSql()}
+	</select> -->
+
+    <select id="findInfo" resultType="com.jeesite.modules.mes.entity.MesGlue">
+        SELECT ${sqlMap.column.toSql()}
+        FROM ${sqlMap.table.toSql()}
+        <where>
+            ${sqlMap.where.toSql()}
+        </where>
+        ORDER BY ${sqlMap.order.toSql()}
+        LIMIT 1
+    </select>
+</mapper>

+ 24 - 0
src/main/resources/mappings/modules/mes/MesGlueRecordDao.xml

@@ -0,0 +1,24 @@
+<?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.MesGlueRecordDao">
+	
+	<!-- 查询数据
+	<select id="findList" resultType="MesGlueRecord">
+		SELECT ${sqlMap.column.toSql()}
+		FROM ${sqlMap.table.toSql()}
+		<where>
+			${sqlMap.where.toSql()}
+		</where>
+		ORDER BY ${sqlMap.order.toSql()}
+	</select> -->
+
+    <select id="findInfo" resultType="com.jeesite.modules.mes.entity.MesGlueRecord">
+        SELECT ${sqlMap.column.toSql()}
+        FROM ${sqlMap.table.toSql()}
+        <where>
+            ${sqlMap.where.toSql()}
+        </where>
+        ORDER BY ${sqlMap.order.toSql()}
+        LIMIT 1
+    </select>
+</mapper>

+ 100 - 0
src/main/resources/views/modules/mes/mesGlueForm.html

@@ -0,0 +1,100 @@
+<% 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(mesGlue.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="${mesGlue}" action="${ctx}/mes/mesGlue/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="lineSn" 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="title" 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="days" 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="cfdays" 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>
+			</div>
+			<div class="box-footer">
+				<div class="row">
+					<div class="col-sm-offset-2 col-sm-10">
+						<% if (hasPermi('mes:mesGlue: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>

+ 94 - 0
src/main/resources/views/modules/mes/mesGlueList.html

@@ -0,0 +1,94 @@
+<% 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:mesGlue:edit')){ %>
+					<a href="${ctx}/mes/mesGlue/form" 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="${mesGlue}" action="${ctx}/mes/mesGlue/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="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="title" 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 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:150, align:"center", frozen:true},
+		{header:'${text("工位号")}', name:'oprno', index:'a.oprno', width:150, align:"center"},
+		{header:'${text("名称")}', name:'title', index:'a.title', width:150, align:"center"},
+		{header:'${text("保质期")}', name:'days', index:'a.days', width:150, align:"center"},
+		{header:'${text("拆封有效期")}', name:'cfdays', index:'a.cfdays', width:150, align:"center"},
+		{header:'${text("备注")}', name:'remark', index:'a.remark', width:150, align:"center"},
+		{header:'${text("状态")}', name:'status', index:'a.status', width:150, align:"center", formatter: function(val, obj, row, act){
+			return js.getDictLabel(${@DictUtils.getDictListJson('sys_search_status')}, val, '${text("未知")}', true);
+		}},
+		{header:'${text("修改日期")}', name:'updateDate', index:'a.update_date', width:150, align:"center"},
+		{header:'${text("操作")}', name:'actions', width:120, formatter: function(val, obj, row, act){
+			var actions = [];
+			//<% if(hasPermi('mes:mesGlue:edit')){ %>
+				actions.push('<a href="${ctx}/mes/mesGlue/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/mesGlue/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/mesGlue/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/mesGlue/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>

+ 75 - 0
src/main/resources/views/modules/mes/mesGlueRecordEdit.html

@@ -0,0 +1,75 @@
+<% 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(mesGlueRecord.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="${mesGlueRecord}" action="${ctx}/mes/mesGlueRecord/editSave" method="post" class="form-horizontal">
+			<div class="box-body">
+				<div class="form-unit">${text('基本信息')}</div>
+				<#form:hidden path="id"/>
+				<#form:hidden path="oprno"/>
+				<#form:hidden path="lineSn"/>
+				<input type="hidden" name="ucode" value="${ucode}">
+				<div class="row">
+					<div class="col-xs-12">
+						<div class="form-group">
+							<label class="control-label col-sm-4" title="">
+								<span class="required ">*</span> ${text('胶名称')}:<i class="fa icon-question hide"></i></label>
+							<div class="col-sm-8">
+								<#form:select path="glueId"  blankOption="true" items="${glues}" itemLabel="title" itemValue="id" class="form-control required" />
+							</div>
+						</div>
+					</div>
+					<div class="col-xs-12">
+						<div class="form-group">
+							<label class="control-label col-sm-4" title="">
+								<span class="required">*</span> ${text('物料批次')}:<i class="fa icon-question hide"></i></label>
+							<div class="col-sm-8">
+								<#form:input path="barcode" maxlength="255" class="form-control required"/>
+							</div>
+						</div>
+					</div>
+					<div class="col-xs-12">
+						<div class="form-group">
+							<label class="control-label col-sm-4" title="">
+								<span class="required">*</span> ${text('生产日期')}:<i class="fa icon-question hide"></i></label>
+							<div class="col-sm-8">
+								<#form:input path="scDate" readonly="true" maxlength="20" class="form-control laydate required"
+									dataFormat="date" data-type="date" data-format="yyyy-MM-dd"/>
+							</div>
+						</div>
+					</div>
+				</div>
+			</div>
+			<div class="box-footer">
+				<div class="row">
+					<div class="col-sm-offset-2 col-sm-10">
+						<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>

+ 94 - 0
src/main/resources/views/modules/mes/mesGlueRecordForm.html

@@ -0,0 +1,94 @@
+<% 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(mesGlueRecord.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="${mesGlueRecord}" action="${ctx}/mes/mesGlueRecord/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('glue_id')}:<i class="fa icon-question hide"></i></label>
+							<div class="col-sm-8">
+								<#form:input path="glueId" maxlength="64" 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="barcode" 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="scDate" 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="cfDate" 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="loseDate" readonly="true" maxlength="20" class="form-control laydate"
+									dataFormat="datetime" data-type="datetime" data-format="yyyy-MM-dd HH:mm"/>
+							</div>
+						</div>
+					</div>
+				</div>
+			</div>
+			<div class="box-footer">
+				<div class="row">
+					<div class="col-sm-offset-2 col-sm-10">
+						<% if (hasPermi('mes:mesGlueRecord: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>

+ 98 - 0
src/main/resources/views/modules/mes/mesGlueRecordList.html

@@ -0,0 +1,98 @@
+<% 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:mesGlueRecord:edit')){ %>
+<!--					<a href="${ctx}/mes/mesGlueRecord/form" 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="${mesGlueRecord}" action="${ctx}/mes/mesGlueRecord/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="barcode" 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="scDate" 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="cfDate" 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="loseDate" 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="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">
+					<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:'glueTitle', index:'b.title', width:150, align:"center", frozen:true},
+		{header:'${text("产线")}', name:'lineSn', index:'b.lineSn', width:150, align:"center"},
+		{header:'${text("工位号")}', name:'oprno', index:'b.oprno', width:150, align:"center"},
+		{header:'${text("物料批次")}', name:'barcode', index:'a.barcode', width:150, align:"center"},
+		{header:'${text("生产日期")}', name:'scDate', index:'a.sc_date', width:150, align:"center"},
+		{header:'${text("拆封日期")}', name:'cfDate', index:'a.cf_date', width:150, align:"center"},
+		{header:'${text("拆封失效日期")}', name:'loseDate', index:'a.lose_date', width:150, align:"center"},
+		{header:'${text("失效日期")}', name:'validityDate', index:'a.validity_date', width:150, align:"center"},
+		{header:'${text("更换人")}', name:'createBy', index:'a.create_by', width:150, align:"center"},
+		{header:'${text("更换日期")}', name:'createDate', index:'a.create_date', width:150, align:"center"},
+		// {header:'${text("操作")}', name:'actions', width:120, formatter: function(val, obj, row, act){
+		// 	var actions = [];
+		// 	//<% if(hasPermi('mes:mesGlueRecord:edit')){ %>
+		// 		actions.push('<a href="${ctx}/mes/mesGlueRecord/form?id='+row.id+'" class="btnList" title="${text("编辑工位胶水拆封记录")}"><i class="fa fa-pencil"></i></a>&nbsp;');
+		// 	//<% } %>
+		// 	return actions.join('');
+		// }}
+	],
+	// 加载成功后执行事件
+	ajaxSuccess: function(data){
+
+	}
+});
+</script>

+ 98 - 0
src/main/resources/views/modules/mes/mesGlueRecordOlist.html

@@ -0,0 +1,98 @@
+<% 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>
+				<a href="${ctx}/mes/mesGlueRecord/edit?oprno=${oprno}&lineSn=${lineSn}&ucode=${ucode}" 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="${mesGlueRecord}" action="${ctx}/mes/mesGlueRecord/listData2" method="post" class="form-inline hide"
+					data-page-no="${parameter.pageNo}" data-page-size="${parameter.pageSize}" data-order-by="${parameter.orderBy}">
+				<#form:hidden path="oprno"/>
+				<#form:hidden path="lineSn"/>
+				<input type="hidden" name="ucode" value="${ucode}">
+				<div class="form-group">
+					<label class="control-label">${text('物料批次')}:</label>
+					<div class="control-inline">
+						<#form:input path="barcode" 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="scDate" 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="cfDate" 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="loseDate" 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="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">
+					<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:'glueTitle', index:'b.title', width:150, align:"center", frozen:true},
+		// {header:'${text("产线")}', name:'lineSn', index:'b.line_sn', width:150, align:"center"},
+		// {header:'${text("工位号")}', name:'oprno', index:'b.oprno', width:150, align:"center"},
+		{header:'${text("物料批次")}', name:'barcode', index:'a.barcode', width:150, align:"center"},
+		{header:'${text("生产日期")}', name:'scDate', index:'a.sc_date', width:150, align:"center"},
+		{header:'${text("拆封日期")}', name:'cfDate', index:'a.cf_date', width:150, align:"center"},
+		{header:'${text("拆封失效日期")}', name:'loseDate', index:'a.lose_date', width:150, align:"center"},
+		{header:'${text("失效日期")}', name:'validityDate', index:'a.validity_date', width:150, align:"center"},
+		{header:'${text("更换人")}', name:'createBy', index:'a.create_by', width:150, align:"center"},
+		{header:'${text("更换日期")}', name:'createDate', index:'a.create_date', width:150, align:"center"},
+		// {header:'${text("操作")}', name:'actions', width:120, formatter: function(val, obj, row, act){
+		// 	var actions = [];
+		// 	//<% if(hasPermi('mes:mesGlueRecord:edit')){ %>
+		// 		actions.push('<a href="${ctx}/mes/mesGlueRecord/form?id='+row.id+'" class="btnList" title="${text("编辑工位胶水拆封记录")}"><i class="fa fa-pencil"></i></a>&nbsp;');
+		// 	//<% } %>
+		// 	return actions.join('');
+		// }}
+	],
+	// 加载成功后执行事件
+	ajaxSuccess: function(data){
+
+	}
+});
+</script>