Jelajahi Sumber

来料检验

hou 1 bulan lalu
induk
melakukan
13df118433

+ 0 - 19
db/mes_product_rivet.sql

@@ -1,19 +0,0 @@
-CREATE TABLE IF NOT EXISTS mes_product_rivet (
-    id           VARCHAR(64)   NOT NULL PRIMARY KEY COMMENT '主键',
-    sn           VARCHAR(50)   NOT NULL COMMENT '工件码',
-    line_sn      VARCHAR(30)   NOT NULL COMMENT '产线编号',
-    oprno        VARCHAR(20)   NOT NULL COMMENT '工位号',
-    point_no     INT           NOT NULL COMMENT '铆接点序号(1-7)',
-    batch_id     VARCHAR(64)   NULL COMMENT '上传批次号(同一次 batchUpload 相同)',
-    result       VARCHAR(4)    NOT NULL COMMENT 'OK/NG',
-    stroke       DECIMAL(10,3) NULL COMMENT '行程值',
-    pressure     DECIMAL(10,3) NULL COMMENT '压力值',
-    hold_time    INT           NULL COMMENT '保压时间(ms)',
-    record_time  DATETIME      NULL COMMENT '采集时间',
-    create_by    VARCHAR(64)   NULL COMMENT '上传人',
-    create_date  DATETIME      NULL COMMENT '上传时间',
-    update_by    VARCHAR(64)   NULL,
-    update_date  DATETIME      NULL,
-    KEY idx_rivet_sn_batch (sn, batch_id),
-    KEY idx_rivet_sn_line_oprno_point (sn, line_sn, oprno, point_no)
-) COMMENT='套筒压铆过程参数';

+ 0 - 12
db/mes_product_rivet_history.sql

@@ -1,14 +0,0 @@
-
-ALTER TABLE mes_product_rivet
-    ADD COLUMN batch_id VARCHAR(64) NULL COMMENT '上传批次号(同一次 batchUpload 相同)' AFTER point_no;
-
-ALTER TABLE mes_product_rivet
-    DROP INDEX uk_sn_line_oprno_point;
-
-ALTER TABLE mes_product_rivet
-    ADD INDEX idx_rivet_sn_batch (sn, batch_id);
-
-ALTER TABLE mes_product_rivet
-    ADD INDEX idx_rivet_sn_line_oprno_point (sn, line_sn, oprno, point_no);

+ 0 - 1
db/mes_product_rivet_menu.sql

@@ -1,13 +0,0 @@
-

File diff ditekan karena terlalu besar
+ 3071 - 2161
mes_cloud_199_0y7a.sql


+ 124 - 19
src/main/java/com/jeesite/modules/mes/web/MesMaterialCheckRecordController.java

@@ -4,6 +4,8 @@ import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
 import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
@@ -161,6 +163,7 @@ public class MesMaterialCheckRecordController extends BaseController {
 			for(MesMaterialReport mesMaterialReport1:reports){
 				if(mesMaterialReport1.getState().equals("0")){
 					mesMaterialReport1.setState("1");
+					mesMaterialReport1.setFaNums(mesMaterialCheckRecord.getFaNums());
 					mesMaterialReportService.update(mesMaterialReport1);
 				}
 			}
@@ -265,39 +268,140 @@ public class MesMaterialCheckRecordController extends BaseController {
 	@RequestMapping(value = "getSnInfo")
 	@ResponseBody
 	public CommonResp getSnInfo(HttpServletRequest req) {
+//		String sn = req.getParameter("sn");
+//		CommonResp<Map<String, Object>> resp = new CommonResp<>();
+//
+//		if(StringUtils.isEmpty(sn)){
+//			resp.setResult(Global.FALSE);
+//			resp.setMessage("参数错误");
+//			return resp;
+//		}
+//		String[] result = sn.split("_");
+//		if(result.length!=3){
+//			resp.setResult(Global.FALSE);
+//			resp.setMessage("二维码格式错误");
+//			return resp;
+//		}
+//		MesMaterial mesMaterial = new MesMaterial();
+//		mesMaterial.setErpSn(result[0]);
+//		MesMaterial ma = mesMaterialService.findInfo(mesMaterial);
+//		if(ObjectUtils.isEmpty(ma)){
+//			resp.setResult(Global.FALSE);
+//			resp.setMessage("物料不存在");
+//			return resp;
+//		}
+//		MesMaterialCheck mci = new MesMaterialCheck();
+//		mci.setMaterialId(ma.getId());
+//		List<MesMaterialCheck> mitList = mesMaterialCheckService.findList(mci);
+//		String host = req.getScheme() + "://" + req.getServerName() + ":" + req.getServerPort() + "/js";
+//
+//		for (MesMaterialCheck item:mitList){
+//			DictData dictData = new DictData();
+//			dictData.setDictType("mes_material_org");
+//			dictData.setDictValue(item.getOrg());
+//			List<DictData> dic = dictDataService.findList(dictData);
+//			if(!ListUtils.isEmpty(dic)){
+//				item.setOrgName(dic.get(0).getDictLabel());
+//			}
+//
+//			FileUpload fu = new FileUpload();
+//			fu.setBizKey(item.getId());
+//			fu.setBizType("mesMaterialCheck_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);
+//			}
+//			item.setImg(imgList);
+//		}
+//
+//		//根据来料码补充物料报检实际数量  如果查到关联物料则添加实际数量,查不到默认为发货数量
+//		Long nums;//实际报检数量
+//		MesMaterialReport mesMaterialReport = new MesMaterialReport();
+//		mesMaterialReport.setSn(sn);
+//		MesMaterialReport mesMaterialReport1 = mesMaterialReportService.findInfo(mesMaterialReport);
+//		if (mesMaterialReport1!= null){
+//			nums = mesMaterialReport1.getNums();
+//		}else{
+//			nums=Long.valueOf(result[2]);
+//		}
+//		Map<String, Object> map = MapUtils.newHashMap();
+//		map.put("sn",sn);
+//		map.put("nums",nums);
+//		map.put("result", result);
+//		map.put("info", ma);
+//		map.put("mitList", mitList);
+//		resp.setData(map);
+//		resp.setResult(Global.TRUE);
+//		return resp;
+
 		String sn = req.getParameter("sn");
 		CommonResp<Map<String, Object>> resp = new CommonResp<>();
 
-		if(StringUtils.isEmpty(sn)){
+		if (StringUtils.isEmpty(sn)) {
 			resp.setResult(Global.FALSE);
 			resp.setMessage("参数错误");
 			return resp;
 		}
-		String[] result = sn.split("_");
-		if(result.length!=3){
+
+		// 新规则解析:料号+版本号+供应商码+日期流水号(最后11位为日期+流水)
+		if (sn.length() < 12) {
+			resp.setResult(Global.FALSE);
+			resp.setMessage("二维码格式错误");
+			return resp;
+		}
+		String dateSerial = sn.substring(sn.length() - 11);
+		if (!dateSerial.matches("\\d{11}")) {
 			resp.setResult(Global.FALSE);
 			resp.setMessage("二维码格式错误");
 			return resp;
 		}
+		String remaining = sn.substring(0, sn.length() - 11);
+		Pattern pattern = Pattern.compile("^(\\d+)([A-Z]\\.[\\d]+)([A-Z]\\d+)$");
+		Matcher matcher = pattern.matcher(remaining);
+		if (!matcher.matches()) {
+			resp.setResult(Global.FALSE);
+			resp.setMessage("二维码格式错误");
+			return resp;
+		}
+
+		String materialId = matcher.group(1);      // 料号
+		String yyMMdd = dateSerial.substring(0, 6); // 日期部分,如260601
+		String faDateStr = "20" + yyMMdd.substring(0, 2) + "-"
+				+ yyMMdd.substring(2, 4) + "-"
+				+ yyMMdd.substring(4, 6);           // 转换为yyyy-MM-dd
+
+		// 组装与原接口一致的result数组:[料号, 日期, 发货数量]
+		String[] result = new String[]{materialId, faDateStr, "0"};
+
+		// 查询物料信息
 		MesMaterial mesMaterial = new MesMaterial();
 		mesMaterial.setErpSn(result[0]);
 		MesMaterial ma = mesMaterialService.findInfo(mesMaterial);
-		if(ObjectUtils.isEmpty(ma)){
+		if (ObjectUtils.isEmpty(ma)) {
 			resp.setResult(Global.FALSE);
 			resp.setMessage("物料不存在");
 			return resp;
 		}
+
+		// 查询物料检查项列表并补充组织名称和图片
 		MesMaterialCheck mci = new MesMaterialCheck();
 		mci.setMaterialId(ma.getId());
 		List<MesMaterialCheck> mitList = mesMaterialCheckService.findList(mci);
 		String host = req.getScheme() + "://" + req.getServerName() + ":" + req.getServerPort() + "/js";
 
-		for (MesMaterialCheck item:mitList){
+		for (MesMaterialCheck item : mitList) {
 			DictData dictData = new DictData();
 			dictData.setDictType("mes_material_org");
 			dictData.setDictValue(item.getOrg());
 			List<DictData> dic = dictDataService.findList(dictData);
-			if(!ListUtils.isEmpty(dic)){
+			if (!ListUtils.isEmpty(dic)) {
 				item.setOrgName(dic.get(0).getDictLabel());
 			}
 
@@ -306,37 +410,38 @@ public class MesMaterialCheckRecordController extends BaseController {
 			fu.setBizType("mesMaterialCheck_image");
 			List<FileUpload> finfo = fileUploadService.findList(fu);
 			List imgList = ListUtils.newArrayList();
-			for (FileUpload fi:finfo){
+			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());
-
+				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);
 			}
 			item.setImg(imgList);
 		}
 
-		//根据来料码补充物料报检实际数量  如果查到关联物料则添加实际数量,查不到默认为发货数量
-		Long nums;//实际报检数量
+		// 根据来料码补充实际报检数量
+		Long nums;
 		MesMaterialReport mesMaterialReport = new MesMaterialReport();
 		mesMaterialReport.setSn(sn);
 		MesMaterialReport mesMaterialReport1 = mesMaterialReportService.findInfo(mesMaterialReport);
-		if (mesMaterialReport1!= null){
+		if (mesMaterialReport1 != null) {
 			nums = mesMaterialReport1.getNums();
-		}else{
-			nums=Long.valueOf(result[2]);
+		} else {
+			nums = Long.valueOf(result[2]);  // 新规则下默认为0
 		}
+
 		Map<String, Object> map = MapUtils.newHashMap();
-		map.put("sn",sn);
-		map.put("nums",nums);
+		map.put("sn", sn);
+		map.put("nums", nums);
 		map.put("result", result);
 		map.put("info", ma);
 		map.put("mitList", mitList);
 		resp.setData(map);
 		resp.setResult(Global.TRUE);
 		return resp;
+
 	}
 	/**
 	 * 详情编辑

+ 192 - 32
src/main/java/com/jeesite/modules/mes/web/MesMaterialReportController.java

@@ -4,6 +4,8 @@ import java.text.ParseException;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
@@ -158,53 +160,128 @@ public class MesMaterialReportController extends BaseController {
 	@ResponseBody
 	public CommonResp getMaterialInfo( HttpServletRequest req) {
 
+//		40100000843A.1G44010026060100001
+//		料号+版本号+供应商码+流水号
+//		40100000843 + A.1 + G440100 + 26060100001
+
+//		String materialCode = req.getParameter("materialCode");
+//		CommonResp<Map<String, Object>> resp = new CommonResp<>();
+//
+//		if (StringUtils.isEmpty(materialCode)){
+//			resp.setResult(Global.FALSE);
+//			resp.setMessage("来料码不能为空!");
+//			return resp;
+//
+//		}
+//		String[] parts = materialCode.split("_",-1);
+//		if(parts.length < 3){
+//			resp.setResult(Global.FALSE);
+//			resp.setMessage("二维码规则不正确!");
+//			return resp;
+//		}
+//		String materialId = parts[0];
+//		String faDate = parts[1];
+//		String nums = parts[2];
+//		if (parts.length!= 3||StringUtils.isEmpty(materialId)||StringUtils.isEmpty(faDate)||StringUtils.isEmpty(nums)){
+//			resp.setResult(Global.FALSE);
+//			resp.setMessage("二维码规则不正确!");
+//			return resp;
+//		}
+//		String faDate1=null;
+//		try {
+//			faDate1 = DateLocalUtils.getCurrentDate2(faDate);
+//		} catch (ParseException e) {
+//			resp.setResult(Global.FALSE);
+//			resp.setMessage("二维码规则不正确!");
+//			return resp;
+//		}
+//		MesMaterial mesMaterial = new MesMaterial();
+//		mesMaterial.setErpSn(materialId);
+//		MesMaterial material = mesMaterialService.findInfo(mesMaterial);
+//		if(material==null){
+//			resp.setResult(Global.FALSE);
+//			resp.setMessage("物料不存在!");
+//			return resp;
+//		}
+//		HashMap<String, Object> hashMap = new HashMap<>();
+//		hashMap.put("title", material.getTitle());//物料
+//		hashMap.put("faDate", faDate1);//发货日期
+//		hashMap.put("nums", nums);//数量
+//
+//		resp.setData(hashMap);
+//		resp.setResult(Global.TRUE);
+//		return resp;
+
 		String materialCode = req.getParameter("materialCode");
 		CommonResp<Map<String, Object>> resp = new CommonResp<>();
 
-		if (StringUtils.isEmpty(materialCode)){
+		if (StringUtils.isEmpty(materialCode)) {
 			resp.setResult(Global.FALSE);
 			resp.setMessage("来料码不能为空!");
 			return resp;
+		}
 
+		// 1. 长度校验:至少11位日期流水号 + 料号等
+		if (materialCode.length() < 12) {
+			resp.setResult(Global.FALSE);
+			resp.setMessage("二维码规则不正确!");
+			return resp;
 		}
-		String[] parts = materialCode.split("_",-1);
-		if(parts.length < 3){
+
+		// 2. 提取最后11位日期流水号
+		String dateSerial = materialCode.substring(materialCode.length() - 11);
+		// 校验是否为纯数字
+		if (!dateSerial.matches("\\d{11}")) {
 			resp.setResult(Global.FALSE);
 			resp.setMessage("二维码规则不正确!");
 			return resp;
 		}
-		String materialId = parts[0];
-		String faDate = parts[1];
-		String nums = parts[2];
-		if (parts.length!= 3||StringUtils.isEmpty(materialId)||StringUtils.isEmpty(faDate)||StringUtils.isEmpty(nums)){
+
+		// 3. 剩余部分格式:数字料号 + 版本号(字母.数字) + 供应商码(字母+数字)
+		String remaining = materialCode.substring(0, materialCode.length() - 11);
+		Pattern pattern = Pattern.compile("^(\\d+)([A-Z]\\.[\\d]+)([A-Z]\\d+)$");
+		Matcher matcher = pattern.matcher(remaining);
+		if (!matcher.matches()) {
 			resp.setResult(Global.FALSE);
 			resp.setMessage("二维码规则不正确!");
 			return resp;
 		}
-		String faDate1=null;
+
+		String materialId = matcher.group(1);  // 料号
+
+		// 4. 日期转换(沿用原有工具)
+		String yyMMdd = dateSerial.substring(0, 6);  // 260601
+		String faDateStr = "20" + yyMMdd.substring(0, 2) + "-"
+				+ yyMMdd.substring(2, 4) + "-"
+				+ yyMMdd.substring(4, 6);            // 2026-06-01
+		String faDate1;
 		try {
-			faDate1 = DateLocalUtils.getCurrentDate2(faDate);
-		} catch (ParseException e) {
+			faDate1 = faDateStr;
+		} catch (Exception e) {
 			resp.setResult(Global.FALSE);
-			resp.setMessage("二维码规则不正确!");
+			resp.setMessage("二维码日期解析失败!");
 			return resp;
 		}
+
+		// 5. 查询物料
 		MesMaterial mesMaterial = new MesMaterial();
 		mesMaterial.setErpSn(materialId);
 		MesMaterial material = mesMaterialService.findInfo(mesMaterial);
-		if(material==null){
+		if (material == null) {
 			resp.setResult(Global.FALSE);
 			resp.setMessage("物料不存在!");
 			return resp;
 		}
+
 		HashMap<String, Object> hashMap = new HashMap<>();
-		hashMap.put("title", material.getTitle());//物料
-		hashMap.put("faDate", faDate1);//发货日期
-		hashMap.put("nums", nums);//数量
+		hashMap.put("title", material.getTitle());
+		hashMap.put("faDate", faDate1);
+		hashMap.put("nums", 0);   // 数量固定为0
 
 		resp.setData(hashMap);
 		resp.setResult(Global.TRUE);
 		return resp;
+
 	}
 
 
@@ -216,65 +293,148 @@ public class MesMaterialReportController extends BaseController {
 	@RequestMapping(value = "submit")
 	@ResponseBody
 	public CommonResp submit(HttpServletRequest req) {
+//		CommonResp<Map<String, Object>> resp = new CommonResp<>();
+//		String materialCode = req.getParameter("materialCode").trim();
+//		String nums = req.getParameter("nums");
+//		String remark = req.getParameter("remark");
+//		String[] parts = materialCode.split("_",-1);
+//		if(parts.length < 3){
+//			resp.setResult(Global.FALSE);
+//			resp.setMessage("二维码规则不正确!");
+//			return resp;
+//		}
+//		String materialId = parts[0];
+//		String faDate = parts[1];
+//		String faNums = parts[2];
+//		if (parts.length!= 3||StringUtils.isEmpty(materialId)||StringUtils.isEmpty(faDate)||StringUtils.isEmpty(nums)){
+//			resp.setResult(Global.FALSE);
+//			resp.setMessage("二维码规则不正确!");
+//			return resp;
+//		}
+//		String faDate1=null;
+//        try {
+//             faDate1 = DateLocalUtils.getCurrentDate2(faDate);
+//        } catch (ParseException e) {
+//			resp.setResult(Global.FALSE);
+//			resp.setMessage("二维码规则不正确!");
+//			return resp;
+//
+//        }
+//        MesMaterial mesMaterial = new MesMaterial();
+//		mesMaterial.setErpSn(materialId);
+//		MesMaterial material = mesMaterialService.findInfo(mesMaterial);
+//		if(material==null){
+//			resp.setResult(Global.FALSE);
+//			resp.setMessage("物料不存在!");
+//			return resp;
+//		}
+//
+//		//检查物料码是否已报检
+//		MesMaterialReport mesMaterialReport = new MesMaterialReport();
+//		mesMaterialReport.setSn(materialCode);
+//		mesMaterialReport.setStatus("0");
+//		MesMaterialReport mesMaterialReport12 = mesMaterialReportService.findInfo(mesMaterialReport);
+//		if(!ObjectUtils.isEmpty(mesMaterialReport12)){
+//			resp.setResult(Global.FALSE);
+//			resp.setMessage("该批物料已报检,勿重复操作!");
+//			return resp;
+//		}
+//
+//		MesMaterialReport mesMaterialReport1 = new MesMaterialReport();
+//		mesMaterialReport1.setSn(materialCode);
+//		mesMaterialReport1.setMaterialId(material.getId());
+//		mesMaterialReport1.setFaDate(faDate1);
+//		mesMaterialReport1.setFaNums(Long.valueOf(faNums));
+//		mesMaterialReport1.setState("0");
+//		mesMaterialReport1.setStatus("0");
+//		mesMaterialReport1.setRemark(remark);
+//		mesMaterialReport1.setNums(Long.valueOf(nums));
+//		mesMaterialReportService.save(mesMaterialReport1);
+//		resp.setResult(Global.TRUE);
+//		return resp;
+
 		CommonResp<Map<String, Object>> resp = new CommonResp<>();
 		String materialCode = req.getParameter("materialCode").trim();
 		String nums = req.getParameter("nums");
 		String remark = req.getParameter("remark");
-		String[] parts = materialCode.split("_",-1);
-		if(parts.length < 3){
+
+		// 1. 解析新规则条码
+		if (StringUtils.isEmpty(materialCode) || materialCode.length() < 12) {
 			resp.setResult(Global.FALSE);
 			resp.setMessage("二维码规则不正确!");
 			return resp;
 		}
-		String materialId = parts[0];
-		String faDate = parts[1];
-		String faNums = parts[2];
-		if (parts.length!= 3||StringUtils.isEmpty(materialId)||StringUtils.isEmpty(faDate)||StringUtils.isEmpty(nums)){
+
+		// 取出最后11位日期流水号
+		String dateSerial = materialCode.substring(materialCode.length() - 11);
+		if (!dateSerial.matches("\\d{11}")) {
 			resp.setResult(Global.FALSE);
 			resp.setMessage("二维码规则不正确!");
 			return resp;
 		}
-		String faDate1=null;
-        try {
-             faDate1 = DateLocalUtils.getCurrentDate2(faDate);
-        } catch (ParseException e) {
+
+		// 剩余部分:料号 + 版本号 + 供应商码
+		String remaining = materialCode.substring(0, materialCode.length() - 11);
+		Pattern pattern = Pattern.compile("^(\\d+)([A-Z]\\.[\\d]+)([A-Z]\\d+)$");
+		Matcher matcher = pattern.matcher(remaining);
+		if (!matcher.matches()) {
 			resp.setResult(Global.FALSE);
 			resp.setMessage("二维码规则不正确!");
 			return resp;
+		}
+
+		String materialId = matcher.group(1);      // 料号
+		String yyMMdd = dateSerial.substring(0, 6); // 日期部分 260601
+		String faDateStr = "20" + yyMMdd.substring(0, 2) + "-"
+				+ yyMMdd.substring(2, 4) + "-"
+				+ yyMMdd.substring(4, 6);           // 转换为 yyyy-MM-dd
 
-        }
-        MesMaterial mesMaterial = new MesMaterial();
+		// 2. 日期格式转换(沿用原有工具)
+		String faDate1;
+		try {
+			faDate1 = DateLocalUtils.getCurrentDate2(faDateStr);
+		} catch (ParseException e) {
+			resp.setResult(Global.FALSE);
+			resp.setMessage("二维码日期解析失败!");
+			return resp;
+		}
+
+		// 3. 检查物料是否存在
+		MesMaterial mesMaterial = new MesMaterial();
 		mesMaterial.setErpSn(materialId);
 		MesMaterial material = mesMaterialService.findInfo(mesMaterial);
-		if(material==null){
+		if (material == null) {
 			resp.setResult(Global.FALSE);
 			resp.setMessage("物料不存在!");
 			return resp;
 		}
 
-		//检查物料码是否已报检
+		// 4. 检查物料码是否已报检
 		MesMaterialReport mesMaterialReport = new MesMaterialReport();
 		mesMaterialReport.setSn(materialCode);
 		mesMaterialReport.setStatus("0");
 		MesMaterialReport mesMaterialReport12 = mesMaterialReportService.findInfo(mesMaterialReport);
-		if(!ObjectUtils.isEmpty(mesMaterialReport12)){
+		if (!ObjectUtils.isEmpty(mesMaterialReport12)) {
 			resp.setResult(Global.FALSE);
 			resp.setMessage("该批物料已报检,勿重复操作!");
 			return resp;
 		}
 
+		// 5. 保存报检记录
 		MesMaterialReport mesMaterialReport1 = new MesMaterialReport();
 		mesMaterialReport1.setSn(materialCode);
 		mesMaterialReport1.setMaterialId(material.getId());
 		mesMaterialReport1.setFaDate(faDate1);
-		mesMaterialReport1.setFaNums(Long.valueOf(faNums));
+		mesMaterialReport1.setFaNums(0L);          // 新规则无来料数量,固定为0
 		mesMaterialReport1.setState("0");
 		mesMaterialReport1.setStatus("0");
 		mesMaterialReport1.setRemark(remark);
-		mesMaterialReport1.setNums(Long.valueOf(nums));
+		mesMaterialReport1.setNums(Long.valueOf(nums)); // 实际收料数量从前端获取
+
 		mesMaterialReportService.save(mesMaterialReport1);
 		resp.setResult(Global.TRUE);
 		return resp;
+
 	}
 
 	@RequiresPermissions("mes:mesMaterialReport:api")

+ 64 - 27
src/main/resources/views/modules/mes/mesMaterialCheckRecordForm.html

@@ -54,18 +54,18 @@
 					<div class="col-xs-12">
 						<div class="form-group">
 							<label class="control-label col-sm-2" title="">
-								<span class="required ">*</span> ${text('发货数量')}:<i class="fa icon-question hide"></i></label>
+								<span class="required ">*</span> ${text('报检数量')}:<i class="fa icon-question hide"></i></label>
 							<div class="col-sm-10">
-								<input type="number" readonly class="form-control"  name="faNums" v-model="faNums"  >
+								<input type="number" readonly class="form-control"  name="nums" v-model="nums"  >
 							</div>
 						</div>
 					</div>
 					<div class="col-xs-12">
 						<div class="form-group">
 							<label class="control-label col-sm-2" title="">
-								<span class="required ">*</span> ${text('实际数量')}:<i class="fa icon-question hide"></i></label>
+								<span class="required ">*</span> ${text('合格数量')}:<i class="fa icon-question hide"></i></label>
 							<div class="col-sm-10">
-								<input type="number" readonly class="form-control"  name="nums" v-model="nums"  >
+								<input type="number" class="form-control"  name="faNums" v-model="faNums"  >
 							</div>
 						</div>
 					</div>
@@ -268,31 +268,67 @@ var vm = new Vue({
 			return result;
 		},
 		getData(){
+			// var that = this;
+			// if(this.sn.trim() === ''){
+			// 	layer.msg("请先扫码");
+			// 	return  ;
+			// }
+			// $.post("getSnInfo",{sn:this.sn},function (res){
+			// 	if(res.result=='false'){
+			// 		that.is_show=false;
+			// 		that.msg=res.message;
+			// 		that.materialTitle="";
+			// 		that.materialId="";
+			// 		that.faDate="";
+			// 		that.nums=0;
+			// 		that.faNums=0;
+			// 		that.options=[];
+			// 		that.formatData();
+			// 	}else {
+			// 		that.msg="";
+			// 		that.is_show=true;
+			// 		that.materialTitle=res.data.info.title;
+			// 		that.materialId=res.data.info.id;
+			// 		that.faDate=that.convertNumberToDate(res.data.result[1]);
+			// 		that.faNums=res.data.result[2];//发货数量
+			// 		that.nums=res.data.nums;//实际报检数量
+			// 		that.options=res.data.mitList;
+			//
+			// 		for (let o in that.options){
+			// 			that.options[o]['result'] = "";
+			// 		}
+			// 		console.log(res);
+			// 		console.log("--");
+			// 		that.formatData();
+			// 	}
+			// })
+
 			var that = this;
 			if(this.sn.trim() === ''){
 				layer.msg("请先扫码");
-				return  ;
+				return;
 			}
 			$.post("getSnInfo",{sn:this.sn},function (res){
-				if(res.result=='false'){
-					that.is_show=false;
-					that.msg=res.message;
-					that.materialTitle="";
-					that.materialId="";
-					that.faDate="";
-					that.nums=0;
-					that.faNums=0;
-					that.options=[];
+				if(res.result == 'false'){
+					that.is_show = false;
+					that.msg = res.message;
+					that.materialTitle = "";
+					that.materialId = "";
+					that.faDate = "";
+					that.nums = 0;
+					that.faNums = 0;
+					that.options = [];
 					that.formatData();
-				}else {
-					that.msg="";
-					that.is_show=true;
-					that.materialTitle=res.data.info.title;
-					that.materialId=res.data.info.id;
-					that.faDate=that.convertNumberToDate(res.data.result[1]);
-					that.faNums=res.data.result[2];//发货数量
-					that.nums=res.data.nums;//实际报检数量
-					that.options=res.data.mitList;
+				} else {
+					that.msg = "";
+					that.is_show = true;
+					that.materialTitle = res.data.info.title;
+					that.materialId = res.data.info.id;
+					// 直接使用后端返回的格式化日期
+					that.faDate = res.data.result[1];          // "2026-06-01"
+					that.faNums = res.data.result[2];          // 发货数量,现在为"0"
+					that.nums = res.data.nums;                 // 实际报检数量
+					that.options = res.data.mitList;
 
 					for (let o in that.options){
 						that.options[o]['result'] = "";
@@ -301,7 +337,8 @@ var vm = new Vue({
 					console.log("--");
 					that.formatData();
 				}
-			})
+			});
+
 		},
 		convertNumberToDate(number) {
 			let year = Math.floor(number / 10000);
@@ -337,9 +374,9 @@ var vm = new Vue({
 								 that.is_show=true;
 								 that.materialTitle=res.data.info.title;
 								 that.materialId=res.data.info.id;
-								 that.faDate=res.data.result[1];
-								 that.nums=res.data.result[2];
-								 that.nums=res.data.nums;
+								 that.faDate = res.data.result[1];        // 直接用字符串
+								 that.faNums = res.data.result[2];        // 发货数量
+								 that.nums = res.data.nums;               // 实际数量
 								 that.options=res.data.mitList;
 								 console.log(res);
 								 console.log("--");

+ 4 - 4
src/main/resources/views/modules/mes/mesMaterialCheckRecordFormEdit.html

@@ -45,18 +45,18 @@
                 <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>
+                            <span class="required hide">*</span> ${text('报检数量')}:<i class="fa icon-question hide"></i></label>
                         <div class="col-sm-8">
-                            <#form:input path="faNums" readonly="true" maxlength="9" class="form-control digits"/>
+                            <#form:input path="nums" maxlength="9" class="form-control digits" readonly="true"/>
                         </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>
+                            <span class="required hide">*</span> ${text('合格数量')}:<i class="fa icon-question hide"></i></label>
                         <div class="col-sm-8">
-                            <#form:input path="nums" maxlength="9" class="form-control digits" readonly="true"/>
+                            <#form:input path="faNums" readonly="true" maxlength="9" class="form-control digits"/>
                         </div>
                     </div>
                 </div>

+ 5 - 5
src/main/resources/views/modules/mes/mesMaterialCheckRecordInfo.html

@@ -25,13 +25,13 @@
 					<td>${mesMaterialCheckRecord.faDate}</td>
 				</tr>
 				<tr>
-					<th class="mpc-header">发货数量</th>
-					<td>${mesMaterialCheckRecord.faNums}</td>
+					<th class="mpc-header">报检数量</th>
+					<td>${mesMaterialCheckRecord.nums}</td>
 				</tr>
 				<tr>
-				<th class="mpc-header">实际数量</th>
-				<td>${mesMaterialCheckRecord.nums}</td>
-			</tr>
+					<th class="mpc-header">合格数量</th>
+					<td>${mesMaterialCheckRecord.faNums}</td>
+				</tr>
 				<tr>
 					<th class="mpc-header">结果</th>
 					<td>${@DictUtils.getDictLabel("mes_material_check_record_state",mesMaterialCheckRecord.state,"未知")}</td>

+ 1 - 1
src/main/resources/views/modules/mes/mesMaterialCheckRecordList.html

@@ -65,7 +65,7 @@ $('#dataGrid').dataGrid({
 		{header:'${text("物料")}', name:'materialTitle', index:'b.title', width:200, align:"center"},
 		// {header:'${text("发货日期")}', name:'faDate', index:'a.fa_date', width:120, align:"center"},
 		// {header:'${text("发货数量")}', name:'faNums', index:'a.fa_nums', width:100, align:"center"},
-		{header:'${text("实际数量")}', name:'nums', index:'a.nums', width:100, align:"center"},
+		{header:'${text("报检数量")}', name:'nums', index:'a.nums', width:100, align:"center"},
 		{header:'${text("结果")}', name:'state', index:'a.state', width:100, align:"center", formatter: function(val, obj, row, act){
 				return js.getDictLabel(${@DictUtils.getDictListJson('mes_material_check_record_state')}, val, '${text("未知")}', true);
 			}},

+ 4 - 4
src/main/resources/views/modules/mes/mesMaterialReportForm.html

@@ -36,18 +36,18 @@
 					<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>
+								<span class="required hide">*</span> ${text('报检数量')}:<i class="fa icon-question hide"></i></label>
 							<div class="col-sm-8">
-								<#form:input path="faNums" readonly="true" maxlength="9" class="form-control digits"/>
+								<#form:input path="nums" maxlength="9" class="form-control digits"/>
 							</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>
+								<span class="required hide">*</span> ${text('合格数量')}:<i class="fa icon-question hide"></i></label>
 							<div class="col-sm-8">
-								<#form:input path="nums" maxlength="9" class="form-control digits"/>
+								<#form:input path="faNums" readonly="true" maxlength="9" class="form-control digits"/>
 							</div>
 						</div>
 					</div>

+ 2 - 2
src/main/resources/views/modules/mes/mesMaterialReportList.html

@@ -76,8 +76,8 @@ $('#dataGrid').dataGrid({
 	columnModel: [
 		{header:'${text("来料码")}', name:'sn', index:'a.sn', width:250, align:"center",frozen:true,},
 		{header:'${text("发货日期")}', name:'faDate', index:'a.fa_date', width:120, align:"center"},
-		{header:'${text("发货数量")}', name:'faNums', index:'a.fa_nums', width:100, align:"center"},
-		{header:'${text("实际数量")}', name:'nums', index:'a.nums', width:100, align:"center"},
+		// {header:'${text("发货数量")}', name:'faNums', index:'a.fa_nums', width:100, align:"center"},
+		{header:'${text("报检数量")}', name:'nums', index:'a.nums', width:100, align:"center"},
 		{header:'${text("状态")}', name:'state', index:'a.state', width:100, align:"center", formatter: function(val, obj, row, act){
 			return js.getDictLabel(${@DictUtils.getDictListJson('material_report_state')}, val, '${text("未知")}', true);
 		}},