소스 검색

半成品出入库,扫码BUG修复

jingbo 4 달 전
부모
커밋
40f218f06f

+ 38 - 0
src/main/java/com/jeesite/modules/mes/web/MesProductProgressController.java

@@ -149,6 +149,44 @@ public class MesProductProgressController extends BaseController {
 		return resp;
 	}
 
+	/*
+	* pda扫码出库
+	 */
+	@PostMapping(value = "pdaOut")
+	@ResponseBody
+	public CommonResp pdaOut(HttpServletRequest request) {
+		CommonResp resp = new CommonResp<>();
+		String sn = request.getParameter("sn");
+		String lineSn = request.getParameter("lineSn");
+		if (StringUtils.isEmpty(lineSn) || StringUtils.isEmpty(sn)){
+			resp.setResult(Global.FALSE);
+			resp.setMessage("参数错误");
+			return resp;
+		}
+		MesProductProgress mesProductProgress = new MesProductProgress();
+		mesProductProgress.setSn(sn);
+		mesProductProgress.setLineSn(lineSn);
+		MesProductProgress mesProductProgress1 = mesProductProgressService.getBySnAndLineSn(mesProductProgress);
+		if (ObjectUtils.isEmpty(mesProductProgress1)){
+			resp.setResult(Global.FALSE);
+			resp.setMessage("仓库不存在");
+			return resp;
+		}else if ("0".equals(mesProductProgress1.getState())){
+			mesProductProgress1.setState("1");
+			mesProductProgressService.update(mesProductProgress1);
+			resp.setResult(Global.TRUE);
+			resp.setMessage("出库成功");
+			return resp;
+		} else if ("1".equals(mesProductProgress1.getState())) {
+			resp.setResult(Global.FALSE);
+			resp.setMessage("该工件已出库");
+			return resp;
+		}
+		resp.setResult(Global.FALSE);
+		resp.setMessage("出库失败");
+		return resp;
+	}
+
 
 
 	

+ 23 - 5
src/main/java/com/jeesite/modules/mes/web/MesProductRecordController.java

@@ -177,6 +177,8 @@ public class MesProductRecordController extends BaseController {
 	private MesProductSampleRecordService mesProductSampleRecordService;
 	@Autowired
 	private OcrService ocrService;
+	@Autowired
+	 private MesProductProgressService mesProductProgressService;
 
 
 	/**
@@ -1927,6 +1929,19 @@ public class MesProductRecordController extends BaseController {
 //				return bs+"PZ";
 //			}
 //		}
+		MesProductProgress mesProductProgress = new MesProductProgress();
+		mesProductProgress.setSn(sn);
+		mesProductProgress.setLineSn(lineSn);
+		MesProductProgress mesProductProgressc1 = mesProductProgressService.getBySnAndLineSn(mesProductProgress);
+		if (!ObjectUtils.isEmpty(mesProductProgressc1)){
+			if ("1".equals(mesProductProgressc1.getState())){
+				ret = bs+"UD";
+				return ret;
+			}else if("0".equals(mesProductProgressc1.getState())){
+				ret = bs+"RK";
+				return ret;
+			}
+		}
 
 		return ret;
 	}
@@ -4528,11 +4543,14 @@ public class MesProductRecordController extends BaseController {
 		if ("true".equals(resp.getResult())){
 			try {
 				// 将二维码放置在工位
-				MesProductRecord mesProductRecord = new MesProductRecord();
-				mesProductRecord.setSn(sn);
-				mesProductRecord.setOprno(oprno);
-				mesProductRecord.setLineSn(lineSn);
-				mesProductRecordService.update(mesProductRecord);
+//				MesProductRecord mesProductRecord = new MesProductRecord();
+//				mesProductRecord.setSn(sn);
+//				mesProductRecord.setOprno(oprno);
+//				mesProductRecord.setLineSn(lineSn);
+//				mesProductRecordService.update(mesProductRecord);
+				MesProcessProduct mesProcessProduct = mesProcessProductService.findByCateAndOprno(lineSn, oprno);
+				mesProcessProduct.setSn(sn);
+				mesProcessProductService.update(mesProcessProduct);
 				resp.setResult(Global.TRUE);
 				resp.setMessage("扫码成功");
 				return resp;

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

@@ -78,6 +78,8 @@ public class ErrorMsg {
                 lmsg = "操作失败";
             } else if (processMsgRet.equalsIgnoreCase("ZG")) {
                 lmsg = "子工位未配置!";
+            } else if (processMsgRet.equalsIgnoreCase("RK")) {
+                lmsg = "半成品未出库";
             }
         }catch (Exception e){ }
         return lmsg;

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

@@ -707,6 +707,7 @@ shiro:
     ${adminPath}/mes/mesProductRecord/cancelCurSn= anon
     ${adminPath}/mes/mesProductRecord/ocr= anon
     ${adminPath}/mes/mesProductProgress/pdaIn= anon
+    ${adminPath}/mes/mesProductProgress/pdaOut= anon
     ${adminPath}/mes/mesMaterialKw/kwList= anon
     ${adminPath}/** = user