hzd 2 روز پیش
والد
کامیت
644638eb9e
20فایلهای تغییر یافته به همراه1197 افزوده شده و 5 حذف شده
  1. 2 0
      src/main/java/com/jeesite/modules/mes/dao/MesProductDao.java
  2. 15 0
      src/main/java/com/jeesite/modules/mes/dao/MesProductModifyDao.java
  3. 1 1
      src/main/java/com/jeesite/modules/mes/dao/MesProductModifyRecordDao.java
  4. 1 0
      src/main/java/com/jeesite/modules/mes/dao/MesProductQmDao.java
  5. 2 0
      src/main/java/com/jeesite/modules/mes/dao/MesProductRecordDao.java
  6. 127 0
      src/main/java/com/jeesite/modules/mes/entity/MesProductModify.java
  7. 12 1
      src/main/java/com/jeesite/modules/mes/service/MesProductModifyRecordService.java
  8. 390 0
      src/main/java/com/jeesite/modules/mes/service/MesProductModifyService.java
  9. 5 0
      src/main/java/com/jeesite/modules/mes/service/MesProductQmService.java
  10. 5 0
      src/main/java/com/jeesite/modules/mes/service/MesProductRecordService.java
  11. 8 0
      src/main/java/com/jeesite/modules/mes/service/MesProductService.java
  12. 289 0
      src/main/java/com/jeesite/modules/mes/web/MesProductModifyController.java
  13. 15 1
      src/main/resources/mappings/modules/mes/MesProductDao.xml
  14. 15 0
      src/main/resources/mappings/modules/mes/MesProductModifyDao.xml
  15. 5 1
      src/main/resources/mappings/modules/mes/MesProductModifyRecordDao.xml
  16. 5 0
      src/main/resources/mappings/modules/mes/MesProductQmDao.xml
  17. 5 1
      src/main/resources/mappings/modules/mes/MesProductRecordDao.xml
  18. 94 0
      src/main/resources/views/modules/mes/mesProductModifyDetail.html
  19. 64 0
      src/main/resources/views/modules/mes/mesProductModifyForm.html
  20. 137 0
      src/main/resources/views/modules/mes/mesProductModifyList.html

+ 2 - 0
src/main/java/com/jeesite/modules/mes/dao/MesProductDao.java

@@ -15,4 +15,6 @@ import java.util.List;
 public interface MesProductDao extends CrudDao<MesProduct> {
     MesProduct findInfo(MesProduct mesProduct);
     List<MesProduct> findByCount(MesProduct mesProduct);
+    MesProduct findInfo2(MesProduct mesProduct);
+    Boolean updateDate(MesProduct mesProduct);
 }

+ 15 - 0
src/main/java/com/jeesite/modules/mes/dao/MesProductModifyDao.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.MesProductModify;
+
+/**
+ * 工件码更换记录DAO接口
+ * @author hzd
+ * @version 2025-11-15
+ */
+@MyBatisDao
+public interface MesProductModifyDao extends CrudDao<MesProductModify> {
+	
+}

+ 1 - 1
src/main/java/com/jeesite/modules/mes/dao/MesProductModifyRecordDao.java

@@ -11,5 +11,5 @@ import com.jeesite.modules.mes.entity.MesProductModifyRecord;
  */
 @MyBatisDao
 public interface MesProductModifyRecordDao extends CrudDao<MesProductModifyRecord> {
-	
+    Boolean updateDate(MesProductModifyRecord mesProductModifyRecord);
 }

+ 1 - 0
src/main/java/com/jeesite/modules/mes/dao/MesProductQmDao.java

@@ -13,4 +13,5 @@ import com.jeesite.modules.mes.entity.MesProductQm;
 @MyBatisDao
 public interface MesProductQmDao extends CrudDao<MesProductQm> {
     MesProductQm findInfo(MesProductQm mesProductQm);
+    Boolean updateDate(MesProductQm mesProductQm);
 }

+ 2 - 0
src/main/java/com/jeesite/modules/mes/dao/MesProductRecordDao.java

@@ -26,4 +26,6 @@ public interface MesProductRecordDao extends CrudDao<MesProductRecord> {
 
     List<MesProductRecord> selectByOprno(MesProductRecord mesProductRecord);
 
+    Boolean updateDate(MesProductRecord mesProductRecord);
+
 }

+ 127 - 0
src/main/java/com/jeesite/modules/mes/entity/MesProductModify.java

@@ -0,0 +1,127 @@
+package com.jeesite.modules.mes.entity;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+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.mybatis.mapper.query.QueryType;
+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.Date;
+import java.util.List;
+
+/**
+ * 工件码更换记录Entity
+ * @author hzd
+ * @version 2025-11-15
+ */
+@Table(name="mes_product_modify", alias="a", label="工件码更换记录信息", columns={
+		@Column(name="id", attrName="id", label="id", isPK=true),
+		@Column(name="sn", attrName="sn", label="原工件码"),
+		@Column(name="newsn", attrName="newsn", label="新工件码"),
+		@Column(name="remark", attrName="remark", label="备注"),
+		@Column(name="old_date", attrName="oldDate", label="原创建日期", isUpdateForce=true),
+		@Column(name="modify_date", attrName="modifyDate", 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="更新日期", isQuery=false, isUpdateForce=true),
+	}, orderBy="a.update_date DESC"
+)
+public class MesProductModify extends DataEntity<MesProductModify> {
+	
+	private static final long serialVersionUID = 1L;
+	private String sn;		// 原工件码
+	private String newsn;		// 新工件码
+	private Date oldDate;		// 原创建日期
+	private Date modifyDate;		// 新创建日期
+	private List img = ListUtils.newArrayList();
+	private String  remark;
+	@ExcelFields({
+		@ExcelField(title="原工件码", attrName="sn", align=Align.CENTER, sort=20),
+		@ExcelField(title="新工件码", attrName="newsn", align=Align.CENTER, sort=30),
+		@ExcelField(title="原创建日期", attrName="oldDate", align=Align.CENTER, sort=40, dataFormat="yyyy-MM-dd hh:mm"),
+		@ExcelField(title="新创建日期", attrName="modifyDate", align=Align.CENTER, sort=50, dataFormat="yyyy-MM-dd hh:mm"),
+		@ExcelField(title="修改人", attrName="createBy", align=Align.CENTER, sort=60),
+		@ExcelField(title="修改日期", attrName="createDate", align=Align.CENTER, sort=70, dataFormat="yyyy-MM-dd"),
+	})
+	public MesProductModify() {
+		this(null);
+	}
+	
+	public MesProductModify(String id){
+		super(id);
+	}
+	
+	@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 getNewsn() {
+		return newsn;
+	}
+
+	public void setNewsn(String newsn) {
+		this.newsn = newsn;
+	}
+	
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+	public Date getOldDate() {
+		return oldDate;
+	}
+
+	public void setOldDate(Date oldDate) {
+		this.oldDate = oldDate;
+	}
+	
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+	public Date getModifyDate() {
+		return modifyDate;
+	}
+
+	public void setModifyDate(Date modifyDate) {
+		this.modifyDate = modifyDate;
+	}
+	
+	public Date getCreateDate_gte() {
+		return sqlMap.getWhere().getValue("create_date", QueryType.GTE);
+	}
+
+	public void setCreateDate_gte(Date createDate) {
+		sqlMap.getWhere().and("create_date", QueryType.GTE, createDate);
+	}
+	
+	public Date getCreateDate_lte() {
+		return sqlMap.getWhere().getValue("create_date", QueryType.LTE);
+	}
+
+	public void setCreateDate_lte(Date createDate) {
+		sqlMap.getWhere().and("create_date", QueryType.LTE, createDate);
+	}
+
+	public List getImg() {
+		return img;
+	}
+
+	public void setImg(List img) {
+		this.img = img;
+	}
+
+	public String getRemark() {
+		return remark;
+	}
+
+	public void setRemark(String remark) {
+		this.remark = remark;
+	}
+}

+ 12 - 1
src/main/java/com/jeesite/modules/mes/service/MesProductModifyRecordService.java

@@ -1,6 +1,9 @@
 package com.jeesite.modules.mes.service;
 
 import java.util.List;
+
+import org.checkerframework.checker.units.qual.A;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -23,7 +26,10 @@ import javax.validation.ConstraintViolationException;
  */
 @Service
 public class MesProductModifyRecordService extends CrudService<MesProductModifyRecordDao, MesProductModifyRecord> {
-	
+
+	@Autowired
+	private MesProductModifyRecordDao mesProductModifyRecordDao;
+
 	/**
 	 * 获取单条数据
 	 * @param mesProductModifyRecord
@@ -54,6 +60,11 @@ public class MesProductModifyRecordService extends CrudService<MesProductModifyR
 	public List<MesProductModifyRecord> findList(MesProductModifyRecord mesProductModifyRecord) {
 		return super.findList(mesProductModifyRecord);
 	}
+
+	@Transactional
+	public void updateDate(MesProductModifyRecord mesProductModifyRecord) {
+		mesProductModifyRecordDao.updateDate(mesProductModifyRecord);
+	}
 	
 	/**
 	 * 保存数据(插入或更新)

+ 390 - 0
src/main/java/com/jeesite/modules/mes/service/MesProductModifyService.java

@@ -0,0 +1,390 @@
+package com.jeesite.modules.mes.service;
+
+import com.jeesite.common.collect.ListUtils;
+import com.jeesite.common.config.Global;
+import com.jeesite.common.entity.Page;
+import com.jeesite.common.lang.ObjectUtils;
+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.MesProductModifyDao;
+import com.jeesite.modules.mes.entity.*;
+import org.springframework.beans.factory.annotation.Autowired;
+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.Date;
+import java.util.List;
+
+/**
+ * 工件码更换记录Service
+ * @author hzd
+ * @version 2025-11-15
+ */
+@Service
+public class MesProductModifyService extends CrudService<MesProductModifyDao, MesProductModify> {
+
+	@Autowired
+	private MesProductService mesProductService;
+
+	@Autowired
+	private MesProductRecordService mesProductRecordService;
+
+	@Autowired
+	private MesProductModifyRecordService mesProductModifyRecordService;
+
+	@Autowired
+	private MesProductQmService mesProductQmService;
+
+	@Autowired
+	private MesProductCcdService mesProductCcdService;
+
+//	@Autowired
+//	private MesProductCcdFileService mesProductCcdFileService;
+//
+//    @Autowired
+//    private MesProductInsulation2Service mesProductInsulation2Service;
+
+	@Autowired
+	private MesProductProdService mesProductProdService;
+
+	@Autowired
+	private MesProductYgslService mesProductYgslService;
+
+	@Autowired
+	private MesDeviceTimeService mesDeviceTimeService;
+
+	@Autowired
+	private MesTorsionalProcessService mesTorsionalProcessService;
+
+	@Autowired
+	private MesProductCmtService mesProductCmtService;
+
+	@Autowired
+	private MesProductGp12Service mesProductGp12Service;
+
+//	@Autowired
+//	private MesOp290PhotoService mesOp290PhotoService;
+
+	@Autowired
+	private MesProductCcService mesProductCcService;
+
+//	@Autowired
+//	private MesProductHelperService mesProductHelperService;
+//
+//	@Autowired
+//	private MesProductFxdingService mesProductFxdingService;
+
+
+	/**
+	 * 获取单条数据
+	 * @param mesProductModify
+	 * @return
+	 */
+	@Override
+	public MesProductModify get(MesProductModify mesProductModify) {
+		return super.get(mesProductModify);
+	}
+	
+	/**
+	 * 查询分页数据
+	 * @param mesProductModify 查询条件
+	 * @param mesProductModify.page 分页对象
+	 * @return
+	 */
+	@Override
+	public Page<MesProductModify> findPage(MesProductModify mesProductModify) {
+		return super.findPage(mesProductModify);
+	}
+	
+	/**
+	 * 查询列表数据
+	 * @param mesProductModify
+	 * @return
+	 */
+	@Override
+	public List<MesProductModify> findList(MesProductModify mesProductModify) {
+		return super.findList(mesProductModify);
+	}
+	
+	/**
+	 * 保存数据(插入或更新)
+	 * @param mesProductModify
+	 */
+	@Override
+	@Transactional
+	public void save(MesProductModify mesProductModify) {
+		MesProduct mesProduct = new MesProduct();
+		mesProduct.setSn(mesProductModify.getSn());
+		MesProduct mesProduct1 = mesProductService.findInfo2(mesProduct);
+		String sn = mesProductModify.getSn();
+		String newsn = mesProductModify.getNewsn();
+		if(!ObjectUtils.isEmpty(mesProduct1)) {
+			mesProductModify.setOldDate(mesProduct1.getCreateDate());
+			mesProductModify.setModifyDate(new Date());
+			super.save(mesProductModify);
+
+			// 保存上传图片
+			FileUploadUtils.saveFileUpload(mesProductModify, mesProductModify.getId(), "mesProductModify_image");
+
+
+			// 更新产品表
+			mesProduct1.setSn(newsn);
+			mesProductService.updateDate(mesProduct1);
+			// 更新生产记录表
+			MesProductRecord mesProductRecord = new MesProductRecord();
+			mesProductRecord.setSn(sn);
+			mesProductRecord.getSqlMap().getOrder().setOrderBy("a.oprno ASC,a.craft ASC");
+			List<MesProductRecord> lists = mesProductRecordService.findList(mesProductRecord);
+			if(!ListUtils.isEmpty(lists)) {
+				for (MesProductRecord mesProductRecord1 : lists) {
+					mesProductRecord1.setCreateDate(mesProductRecord1.getCreateDate());
+					mesProductRecord1.setSn(newsn);
+					mesProductRecord1.setUpdateDate(mesProductRecord1.getUpdateDate());
+					mesProductRecordService.updateDate(mesProductRecord1);
+				}
+			}
+
+			// 更新修改记录
+			MesProductModifyRecord mesProductModifyRecord = new MesProductModifyRecord();
+			mesProductModifyRecord.setSn(sn);
+			List<MesProductModifyRecord> lists2 = mesProductModifyRecordService.findList(mesProductModifyRecord);
+			if(!ListUtils.isEmpty(lists2)) {
+				for (MesProductModifyRecord mesProductModifyRecord1 : lists2) {
+					mesProductModifyRecord1.setSn(newsn);
+					mesProductModifyRecordService.updateDate(mesProductModifyRecord1);
+				}
+			}
+
+			// 气密
+			MesProductQm mesProductQm = new MesProductQm();
+			mesProductQm.setComponentNum(sn);
+			List<MesProductQm> lists3 = mesProductQmService.findList(mesProductQm);
+			if(!ListUtils.isEmpty(lists3)){
+				for (MesProductQm mesProductQm1:lists3){
+					mesProductQm1.setComponentNum(newsn);
+					mesProductQmService.updateDate(mesProductQm1);
+				}
+			}
+
+			// CCD
+			MesProductCcd mesProductCcd = new MesProductCcd();
+			mesProductCcd.setSn(sn);
+			List<MesProductCcd> lists4 = mesProductCcdService.findList(mesProductCcd);
+			if(!ListUtils.isEmpty(lists4)){
+				for (MesProductCcd mesProductCcd1:lists4){
+					mesProductCcd1.setSn(newsn);
+					mesProductCcdService.update(mesProductCcd1);
+				}
+			}
+//			MesProductCcdFile mesProductCcdFile = new MesProductCcdFile();
+//			mesProductCcdFile.setSn(sn);
+//			List<MesProductCcdFile> lists44 = mesProductCcdFileService.findList(mesProductCcdFile);
+//			if(!ListUtils.isEmpty(lists44)){
+//				for (MesProductCcdFile mesProductCcdFile1:lists44){
+//					mesProductCcdFile1.setSn(newsn);
+//					mesProductCcdFileService.update(mesProductCcdFile1);
+//				}
+//			}
+//
+//			//绝缘耐压
+//			MesProductInsulation2 mesProductInsulation2 = new MesProductInsulation2();
+//			mesProductInsulation2.setSn(sn);
+//			List<MesProductInsulation2> lists5 = mesProductInsulation2Service.findList(mesProductInsulation2);
+//			if(!ListUtils.isEmpty(lists5)){
+//				for (MesProductInsulation2 mesProductInsulation21:lists5){
+//					mesProductInsulation21.setSn(newsn);
+//					mesProductInsulation2Service.update(mesProductInsulation21);
+//				}
+//			}
+
+			//拉铆
+			MesProductProd mesProductProd = new MesProductProd();
+			mesProductProd.setSn(sn);
+			List<MesProductProd> lists6 = mesProductProdService.findList(mesProductProd);
+			if(!ListUtils.isEmpty(lists6)){
+				for (MesProductProd mesProductProd1:lists6){
+					mesProductProd1.setSn(newsn);
+					mesProductProdService.update(mesProductProd1);
+				}
+			}
+
+			//拧紧
+			MesProductYgsl mesProductYgsl = new MesProductYgsl();
+			mesProductYgsl.setSn(sn);
+			List<MesProductYgsl> lists7 = mesProductYgslService.findList(mesProductYgsl);
+			if(!ListUtils.isEmpty(lists7)){
+				for (MesProductYgsl mesProductProd1:lists7){
+					mesProductProd1.setSn(newsn);
+					mesProductYgslService.update(mesProductProd1);
+				}
+			}
+
+			//工位时间
+			MesDeviceTime mesDeviceTime = new MesDeviceTime();
+			mesDeviceTime.setSn(sn);
+			List<MesDeviceTime> lists8 = mesDeviceTimeService.findList(mesDeviceTime);
+			if(!ListUtils.isEmpty(lists8)){
+				for (MesDeviceTime mesProductProd1:lists8){
+					mesProductProd1.setSn(newsn);
+					mesDeviceTimeService.update(mesProductProd1);
+				}
+			}
+
+			//尺寸检测
+			MesProductCc mesProductCc = new MesProductCc();
+			mesProductCc.setSn(sn);
+			List<MesProductCc> lists9 = mesProductCcService.findList(mesProductCc);
+			if(!ListUtils.isEmpty(lists9)){
+				for (MesProductCc mesProductProd1:lists9){
+					mesProductProd1.setSn(newsn);
+					mesProductCcService.update(mesProductProd1);
+				}
+			}
+
+			//拍照
+			MesProductGp12 mesProductGp12 = new MesProductGp12();
+			mesProductGp12.setSn(sn);
+			List<MesProductGp12> lists10 = mesProductGp12Service.findList(mesProductGp12);
+			if(!ListUtils.isEmpty(lists10)){
+				for (MesProductGp12 mesProductProd1:lists10){
+					mesProductProd1.setSn(newsn);
+					mesProductGp12Service.update(mesProductProd1);
+				}
+			}
+
+//			//拍照
+//			MesOp290Photo mesOp290Photo = new MesOp290Photo();
+//			mesOp290Photo.setSn(sn);
+//			List<MesOp290Photo> lists11 = mesOp290PhotoService.findList(mesOp290Photo);
+//			if(!ListUtils.isEmpty(lists11)){
+//				for (MesOp290Photo mesProductProd1:lists11){
+//					mesProductProd1.setSn(newsn);
+//					mesOp290PhotoService.update(mesProductProd1);
+//				}
+//			}
+//
+//			//不良审核
+//			MesProductHelper mesProductHelper = new MesProductHelper();
+//			mesProductHelper.setSn(sn);
+//			List<MesProductHelper> lists12 = mesProductHelperService.findList(mesProductHelper);
+//			if(!ListUtils.isEmpty(lists12)){
+//				for (MesProductHelper mesProductProd1:lists12){
+//					mesProductProd1.setSn(newsn);
+//					mesProductHelperService.update(mesProductProd1);
+//				}
+//			}
+
+			//扭力
+			MesTorsionalProcess mesTorsionalProcess = new MesTorsionalProcess();
+			mesTorsionalProcess.setSn(sn);
+			List<MesTorsionalProcess> lists13 = mesTorsionalProcessService.findList(mesTorsionalProcess);
+			if(!ListUtils.isEmpty(lists13)){
+				for (MesTorsionalProcess mesProductProd1:lists13){
+					mesProductProd1.setSn(newsn);
+					mesTorsionalProcessService.update(mesProductProd1);
+				}
+			}
+
+			//cmt
+			MesProductCmt mesProductCmt = new MesProductCmt();
+			mesProductCmt.setSn(sn);
+			List<MesProductCmt> lists14 = mesProductCmtService.findList(mesProductCmt);
+			if(!ListUtils.isEmpty(lists14)){
+				for (MesProductCmt mesProductProd1:lists14){
+					mesProductProd1.setSn(newsn);
+					mesProductCmtService.update(mesProductProd1);
+				}
+			}
+
+//			// 不良
+//			MesProductFxding mesProductFxding = new MesProductFxding();
+//			mesProductFxding.setSn(sn);
+//			List<MesProductFxding> lists15 = mesProductFxdingService.findList(mesProductFxding);
+//			if(!ListUtils.isEmpty(lists15)){
+//				for (MesProductFxding mesProductProd1:lists15){
+//					mesProductProd1.setSn(newsn);
+//					mesProductFxdingService.update(mesProductProd1);
+//				}
+//			}
+
+
+		}
+
+	}
+
+	/**
+	 * 导入数据
+	 * @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<MesProductModify> list = ei.getDataList(MesProductModify.class);
+			for (MesProductModify mesProductModify : list) {
+				try{
+					ValidatorUtils.validateWithException(mesProductModify);
+					this.save(mesProductModify);
+					successNum++;
+					successMsg.append("<br/>" + successNum + "、编号 " + mesProductModify.getId() + " 导入成功");
+				} catch (Exception e) {
+					failureNum++;
+					String msg = "<br/>" + failureNum + "、编号 " + mesProductModify.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 mesProductModify
+	 */
+	@Override
+	@Transactional
+	public void updateStatus(MesProductModify mesProductModify) {
+		super.updateStatus(mesProductModify);
+	}
+	
+	/**
+	 * 删除数据
+	 * @param mesProductModify
+	 */
+	@Override
+	@Transactional
+	public void delete(MesProductModify mesProductModify) {
+		super.delete(mesProductModify);
+	}
+	
+}

+ 5 - 0
src/main/java/com/jeesite/modules/mes/service/MesProductQmService.java

@@ -88,6 +88,11 @@ public class MesProductQmService extends CrudService<MesProductQmDao, MesProduct
 		return super.findList(mesProductQm);
 	}
 
+	@Transactional
+	public void updateDate(MesProductQm mesProductQm) {
+		mesProductQmDao.updateDate(mesProductQm);
+	}
+
 	/**
 	 * 保存数据(插入或更新)
 	 * @param mesProductQm

+ 5 - 0
src/main/java/com/jeesite/modules/mes/service/MesProductRecordService.java

@@ -231,6 +231,11 @@ public class MesProductRecordService extends CrudService<MesProductRecordDao, Me
 		return mesProductRecordDao.selectByOprno(mesProductRecord);
 	}
 
+	@Transactional
+	public void updateDate(MesProductRecord mesProductRecord){
+		mesProductRecordDao.updateDate(mesProductRecord);
+	}
+
 
 	/**
 	 * 保存数据(插入或更新)

+ 8 - 0
src/main/java/com/jeesite/modules/mes/service/MesProductService.java

@@ -43,6 +43,14 @@ public class MesProductService extends CrudService<MesProductDao, MesProduct> {
 		return dao.findInfo(mesProduct);
 	}
 
+	public MesProduct findInfo2(MesProduct mesProduct) {
+		return dao.findInfo2(mesProduct);
+	}
+
+	public void updateDate(MesProduct mesProduct) {
+		dao.updateDate(mesProduct);
+	}
+
 	public List<MesProduct> findByCount(MesProduct mesProduct) {
 		return  dao.findByCount(mesProduct);
 	}

+ 289 - 0
src/main/java/com/jeesite/modules/mes/web/MesProductModifyController.java

@@ -0,0 +1,289 @@
+package com.jeesite.modules.mes.web;
+
+import com.alibaba.druid.util.StringUtils;
+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.lang.ObjectUtils;
+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.MesProduct;
+import com.jeesite.modules.mes.entity.MesProductModify;
+import com.jeesite.modules.mes.resp.CommonResp;
+import com.jeesite.modules.mes.service.MesProductModifyService;
+import com.jeesite.modules.mes.service.MesProductService;
+import com.jeesite.modules.mes.util.CommonUitl;
+import com.jeesite.modules.sys.entity.User;
+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 org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.transaction.Transactional;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 工件码更换记录Controller
+ * @author hzd
+ * @version 2025-11-15
+ */
+@Controller
+@RequestMapping(value = "${adminPath}/mes/mesProductModify")
+public class MesProductModifyController extends BaseController {
+
+	@Autowired
+	private MesProductModifyService mesProductModifyService;
+
+	@Autowired
+	private MesProductService mesProductService;
+
+	@Autowired
+	private FileUploadService fileUploadService;
+	
+	/**
+	 * 获取数据
+	 */
+	@ModelAttribute
+	public MesProductModify get(String id, boolean isNewRecord) {
+		return mesProductModifyService.get(id, isNewRecord);
+	}
+	
+	/**
+	 * 查询列表
+	 */
+	@RequiresPermissions("mes:mesProductModify:view")
+	@RequestMapping(value = {"list", ""})
+	public String list(MesProductModify mesProductModify, Model model) {
+		model.addAttribute("mesProductModify", mesProductModify);
+		return "modules/mes/mesProductModifyList";
+	}
+	
+	/**
+	 * 查询列表数据
+	 */
+	@RequiresPermissions("mes:mesProductModify:view")
+	@RequestMapping(value = "listData")
+	@ResponseBody
+	public Page<MesProductModify> listData(MesProductModify mesProductModify, HttpServletRequest request, HttpServletResponse response) {
+		mesProductModify.setPage(new Page<>(request, response));
+		Page<MesProductModify> page = mesProductModifyService.findPage(mesProductModify);
+		return page;
+	}
+
+	/**
+	 * 查看编辑表单
+	 */
+	@RequiresPermissions("mes:mesProductModify:view")
+	@RequestMapping(value = "form")
+	public String form(MesProductModify mesProductModify, Model model) {
+		model.addAttribute("mesProductModify", mesProductModify);
+		return "modules/mes/mesProductModifyForm";
+	}
+
+	@RequiresPermissions("mes:mesProductModify:view")
+	@RequestMapping(value = "detail")
+	public String detail(MesProductModify mesProductModify, Model model) {
+		model.addAttribute("mesProductModify", mesProductModify);
+		return "modules/mes/mesProductModifyDetail";
+	}
+
+	/**
+	 * 保存数据
+	 */
+	@RequiresPermissions("mes:mesProductModify:edit")
+	@PostMapping(value = "save")
+	@ResponseBody
+	public String save(@Validated MesProductModify mesProductModify) {
+		if(StringUtils.isEmpty(mesProductModify.getSn())){
+			return renderResult(Global.FALSE, text("旧工件码不能为空!"));
+		}
+		if(StringUtils.isEmpty(mesProductModify.getNewsn())){
+			return renderResult(Global.FALSE, text("新工件码不能为空!"));
+		}
+		if(mesProductModify.getNewsn().equals(mesProductModify.getSn())){
+			return renderResult(Global.FALSE, text("新工件码与就工件码不能一样!"));
+		}
+
+		MesProduct mesProduct0 = new MesProduct();
+		mesProduct0.setSn(mesProductModify.getNewsn());
+		MesProduct mesProduct11 = mesProductService.findInfo(mesProduct0);
+		if(!ObjectUtils.isEmpty(mesProduct11)){
+			return renderResult(Global.FALSE, text("新工件码系统已存在!"));
+		}
+
+		MesProduct mesProduct1 = new MesProduct();
+		mesProduct1.setSn(mesProductModify.getSn());
+		MesProduct mesProduct = mesProductService.findInfo(mesProduct1);
+		if(ObjectUtils.isEmpty(mesProduct)){
+			return renderResult(Global.TRUE, text("产品信息不存在!"));
+		}
+
+		String checkProductSn = Global.getConfig("mes.check.productSn");
+		if(checkProductSn.equals("1")){
+			if(!CommonUitl.checkProductSn(mesProductModify.getNewsn(),mesProduct.getCate())){
+				return renderResult(Global.TRUE, text("工件码不正确!"));
+			}
+		}
+
+		mesProductModifyService.save(mesProductModify);
+		return renderResult(Global.TRUE, text("保存工件码更换记录成功!"));
+	}
+
+	/**
+	 * 导出数据
+	 */
+	@RequiresPermissions("mes:mesProductModify:view")
+	@RequestMapping(value = "exportData")
+	public void exportData(MesProductModify mesProductModify, HttpServletResponse response) {
+		List<MesProductModify> list = mesProductModifyService.findList(mesProductModify);
+		String fileName = "工件码更换记录" + DateUtils.getDate("yyyyMMddHHmmss") + ".xlsx";
+		try(ExcelExport ee = new ExcelExport("工件码更换记录", MesProductModify.class)){
+			ee.setDataList(list).write(response, fileName);
+		}
+	}
+
+	/**
+	 * 下载模板
+	 */
+	@RequiresPermissions("mes:mesProductModify:view")
+	@RequestMapping(value = "importTemplate")
+	public void importTemplate(HttpServletResponse response) {
+		MesProductModify mesProductModify = new MesProductModify();
+		List<MesProductModify> list = ListUtils.newArrayList(mesProductModify);
+		String fileName = "工件码更换记录模板.xlsx";
+		try(ExcelExport ee = new ExcelExport("工件码更换记录", MesProductModify.class, Type.IMPORT)){
+			ee.setDataList(list).write(response, fileName);
+		}
+	}
+
+	/**
+	 * 导入数据
+	 */
+	@ResponseBody
+	@RequiresPermissions("mes:mesProductModify:edit")
+	@PostMapping(value = "importData")
+	public String importData(MultipartFile file) {
+		try {
+			String message = mesProductModifyService.importData(file);
+			return renderResult(Global.TRUE, "posfull:"+message);
+		} catch (Exception ex) {
+			return renderResult(Global.FALSE, "posfull:"+ex.getMessage());
+		}
+	}
+
+	@RequiresPermissions("mes:mesProductModify:api")
+	@RequestMapping(value = "add")
+	@ResponseBody
+	@Transactional
+	public CommonResp add(MesProductModify mesProductModify, HttpServletRequest request) {
+		Map<String, Object> map = MapUtils.newHashMap();
+		CommonResp<Map<String, Object>> resp = new CommonResp<>();
+		resp.setResult(Global.FALSE);
+
+		if(StringUtils.isEmpty(mesProductModify.getSn())){
+			resp.setMessage("旧工件码不能为空");
+			return resp;
+		}
+		if(StringUtils.isEmpty(mesProductModify.getNewsn())){
+			resp.setMessage("新工件码不能为空!");
+			return resp;
+		}
+
+		MesProduct mesProduct1 = new MesProduct();
+		mesProduct1.setSn(mesProductModify.getSn());
+		MesProduct mesProduct = mesProductService.findInfo(mesProduct1);
+		if(ObjectUtils.isEmpty(mesProduct)){
+			resp.setMessage("产品信息不存在");
+			return resp;
+		}
+
+
+
+		String checkProductSn = Global.getConfig("mes.check.productSn");
+		if(checkProductSn.equals("1")){
+			if(!CommonUitl.checkProductSn(mesProductModify.getNewsn(),mesProduct.getCate())){
+				resp.setMessage("工件码不正确");
+				return resp;
+			}
+		}
+		if(mesProductModify.getNewsn().equals(mesProductModify.getSn())){
+			resp.setMessage("新工件码与就工件码不能一样");
+			return resp;
+		}
+
+		MesProduct mesProduct0 = new MesProduct();
+		mesProduct0.setSn(mesProductModify.getNewsn());
+		MesProduct mesProduct11 = mesProductService.findInfo(mesProduct0);
+		if(!ObjectUtils.isEmpty(mesProduct11)){
+			resp.setMessage("新工件码系统已存在");
+			return resp;
+		}
+
+		mesProductModifyService.save(mesProductModify);
+
+		resp.setResult(Global.TRUE);
+		return resp;
+	}
+
+	@RequiresPermissions("mes:mesProductModify:api")
+	@RequestMapping(value = "ulist")
+	@ResponseBody
+	public CommonResp ulist(MesProductModify mesProductModify, HttpServletRequest request, HttpServletResponse response) {
+		User user = UserUtils.getUser();
+		mesProductModify.setCreateBy(user.getUserCode());
+
+		mesProductModify.setPage(new Page<>(request, response));
+		Page<MesProductModify> page = mesProductModifyService.findPage(mesProductModify);
+
+		CommonResp<Page> resp = new CommonResp<>();
+
+		resp.setData(page);
+		resp.setResult(Global.TRUE);
+		return resp;
+	}
+
+	/**
+	 * 详情
+	 */
+	@RequiresPermissions("mes:mesProductModify:api")
+	@RequestMapping(value = "info")
+	@ResponseBody
+	public CommonResp info(MesProductModify info, HttpServletRequest request) {
+		String host = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + "/js";
+
+		FileUpload fu = new FileUpload();
+		fu.setBizKey(info.getId());
+		fu.setBizType("mesProductModify_image");
+		List<FileUpload> finfo = fileUploadService.findList(fu);
+		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);
+		}
+		info.setImg(imgList);
+		CommonResp<MesProductModify> resp = new CommonResp<>();
+		resp.setData(info);
+		return resp;
+	}
+	
+}

+ 15 - 1
src/main/resources/mappings/modules/mes/MesProductDao.xml

@@ -1,7 +1,11 @@
 <?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.MesProductDao">
-	
+	<update id="updateDate">
+		update ${sqlMap.table.toSql()}
+		set sn=#{sn}
+		WHERE id = #{id}
+	</update>
 	<!-- 查询数据
 	<select id="findList" resultType="MesProduct">
 		SELECT ${sqlMap.column.toSql()}
@@ -25,5 +29,15 @@
 		FROM mes_product
 		WHERE batch_sn=#{batchSn}
 	</select>
+
+	<select id="findInfo2" resultType="com.jeesite.modules.mes.entity.MesProduct">
+		SELECT ${sqlMap.column.toSql()}
+		FROM ${sqlMap.table.toSql()}
+		<where>
+			${sqlMap.where.toSql()}
+		</where>
+		ORDER BY ${sqlMap.order.toSql()}
+		LIMIT 1
+	</select>
 	
 </mapper>

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

+ 5 - 1
src/main/resources/mappings/modules/mes/MesProductModifyRecordDao.xml

@@ -11,5 +11,9 @@
 		</where>
 		ORDER BY ${sqlMap.order.toSql()}
 	</select> -->
-	
+	<update id="updateDate">
+		update ${sqlMap.table.toSql()}
+		set sn=#{sn}
+		WHERE id = #{id}
+	</update>
 </mapper>

+ 5 - 0
src/main/resources/mappings/modules/mes/MesProductQmDao.xml

@@ -21,4 +21,9 @@
         ORDER BY ${sqlMap.order.toSql()}
         LIMIT 1
     </select>
+    <update id="updateDate">
+        update ${sqlMap.table.toSql()}
+        set component_num=#{componentNum}
+        WHERE id = #{id}
+    </update>
 </mapper>

+ 5 - 1
src/main/resources/mappings/modules/mes/MesProductRecordDao.xml

@@ -1,7 +1,11 @@
 <?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.MesProductRecordDao">
-
+    <update id="updateDate">
+        update mes_product_record
+        set create_date=#{createDate},update_date=#{updateDate},sn=#{sn}
+        WHERE id = #{id}
+    </update>
     <!-- 查询数据
     <select id="findList" resultType="MesProductRecord">
         SELECT ${sqlMap.column.toSql()}

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

@@ -0,0 +1,94 @@
+<% layout('/layouts/default.html', {title: '报废记录详情', libs: ['validate','dataGrid','fileupload']}){ %>
+
+<style>
+	table{
+		width: 100%;
+	}
+	th,td{
+		padding: 10px;
+	}
+	.table.table-bordered th {
+		width: 200px;
+	}
+</style>
+<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> 记录详情
+			</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="${mesProductModify}" action="${ctx}/mes/mesProductModify/save" method="post" class="form-horizontal">
+		<div class="box-body">
+			<div class="form-unit">${text('基本信息')}</div>
+			<table class="table table-bordered">
+				<tr>
+					<th class="mpc-header">旧工件码</th>
+					<td>${mesProductModify.sn}</td>
+				</tr>
+				<tr>
+					<th class="mpc-header">新工件码</th>
+					<td>${mesProductModify.newsn}</td>
+				</tr>
+				<tr>
+					<th class="mpc-header">原创建日期</th>
+					<td>${mesProductModify.oldDate,dateFormat='yyyy-MM-dd HH:mm'}</td>
+				</tr>
+				<tr>
+					<th class="mpc-header">新创建日期</th>
+					<td>${mesProductModify.modifyDate,dateFormat='yyyy-MM-dd HH:mm'}</td>
+				</tr>
+
+				<tr>
+					<th class="mpc-header">备注</th>
+					<td>${mesProductModify.remark}</td>
+				</tr>
+				<tr>
+					<th class="mpc-header">修改人</th>
+					<td>${mesProductModify.createBy}</td>
+				</tr>
+				<tr>
+					<th class="mpc-header">修改时间</th>
+					<td>${mesProductModify.createDate,dateFormat='yyyy-MM-dd HH:mm'}</td>
+				</tr>
+				<tr>
+					<th class="mpc-header">图片</th>
+					<td>
+						<#form:fileupload id="uploadImage" bizKey="${mesProductModify.id}" bizType="mesProductModify_image"
+						uploadType="image" 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>
+	</#form:form>
+</div>
+</div>
+<% } %>
+<script>
+
+</script>
+<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>

+ 64 - 0
src/main/resources/views/modules/mes/mesProductModifyForm.html

@@ -0,0 +1,64 @@
+<% 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(mesProductModify.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="${mesProductModify}" action="${ctx}/mes/mesProductModify/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="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="newsn" 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:mesProductModify: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>

+ 137 - 0
src/main/resources/views/modules/mes/mesProductModifyList.html

@@ -0,0 +1,137 @@
+<% 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="#" class="btn btn-default" id="btnExport"><i class="glyphicon glyphicon-export"></i> 导出</a>
+				<% if(hasPermi('mes:mesProductModify:edit')){ %>
+						<a href="#" class="btn btn-default" id="btnImport"><i class="glyphicon glyphicon-import"></i> 导入</a>
+					<a href="${ctx}/mes/mesProductModify/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="${mesProductModify}" action="${ctx}/mes/mesProductModify/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="sn" maxlength="255" class="form-control width-260"/>
+					</div>
+				</div>
+				<div class="form-group">
+					<label class="control-label">${text('新工件码')}:</label>
+					<div class="control-inline">
+						<#form:input path="newsn" maxlength="255" class="form-control width-260"/>
+					</div>
+				</div>
+				<div class="form-group">
+					<label class="control-label">${text('修改人')}:</label>
+					<div class="control-inline">
+						<#form:input path="createBy" 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="createDate_gte" readonly="true" maxlength="20" class="form-control laydate width-date"
+							dataFormat="date" data-type="date" data-format="yyyy-MM-dd" data-done="createDate_lte.click()"/>
+						&nbsp;-&nbsp;
+						<#form:input path="createDate_lte" readonly="true" maxlength="20" class="form-control laydate width-date"
+							dataFormat="date" data-type="date" data-format="yyyy-MM-dd"/>
+					</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:'sn', index:'a.sn', width:280, align:"center", frozen:true},
+		{header:'${text("新工件码")}', name:'newsn', index:'a.newsn', width:280, align:"center"},
+		{header:'${text("原创建日期")}', name:'oldDate', index:'a.old_date', width:150, align:"center"},
+		{header:'${text("新创建日期")}', name:'modifyDate', index:'a.modify_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:'updateDate', index:'a.update_date', width:150, align:"center"},
+		{header:'${text("备注")}', name:'remark', index:'a.remark', width:150, align:"center"},
+		{header:'${text("操作")}', name:'actions', width:120, formatter: function(val, obj, row, act){
+			var actions = [];
+				actions.push('<a href="${ctx}/mes/mesProductModify/detail?id='+row.id+'" class="btnList" title="${text("详情")}"><i class="fa fa-pencil"></i></a>&nbsp;');
+			return actions.join('');
+		}}
+	],
+	// 加载成功后执行事件
+	ajaxSuccess: function(data){
+		
+	}
+});
+</script><script>
+$('#btnExport').click(function(){
+	js.ajaxSubmitForm($('#searchForm'), {
+		url:'${ctx}/mes/mesProductModify/exportData',
+		downloadFile:true
+	});
+});
+$('#btnImport').click(function(){
+	js.layer.open({
+		type: 1,
+		area: ['400px'],
+		title: '${text("导入工件码更换记录")}',
+		resize: false,
+		scrollbar: true,
+		content: js.template('importTpl'),
+		btn: ['<i class="fa fa-check"></i> ${text("导入")}',
+			'<i class="fa fa-remove"></i> ${text("关闭")}'],
+		btn1: function(index, layero){
+			var form = {
+				inputForm: layero.find('#inputForm'),
+				file: layero.find('#file').val()
+			};
+		    if (form.file == '' || (!js.endWith(form.file, '.xls') && !js.endWith(form.file, '.xlsx'))){
+		    	js.showMessage("${text('文件不正确,请选择后缀为“xls”或“xlsx”的文件。')}", null, 'warning');
+		        return false;
+		    }
+			js.ajaxSubmitForm(form.inputForm, function(data){
+				js.showMessage(data.message);
+				if(data.result == Global.TRUE){
+					js.layer.closeAll();
+				}
+				page();
+			}, "json");
+			return true;
+		}
+	});
+});
+</script>
+<script id="importTpl" type="text/template">//<!--
+<form id="inputForm" action="${ctx}/mes/mesProductModify/importData" method="post" enctype="multipart/form-data"
+	class="form-horizontal mt20 mb10" style="overflow:auto;max-height:200px;">
+	<div class="row">
+		<div class="col-xs-12 col-xs-offset-1">
+			<input type="file" id="file" name="file" class="form-file"/>
+			<div class="mt10 pt5" style="color:red">
+				${text('提示:仅允许导入“xls”或“xlsx”格式文件!')}
+			</div>
+			<div class="mt10 pt5">
+				<a href="${ctx}/mes/mesProductModify/importTemplate" class="btn btn-default btn-xs"><i class="fa fa-file-excel-o"></i> ${text('下载模板')}</a>
+			</div>
+		</div>
+	</div>
+</form>
+//--></script>