Просмотр исходного кода

修改获取工位当前工件接口

jingbo 5 месяцев назад
Родитель
Сommit
5764439f32

+ 12 - 9
src/main/java/com/jeesite/modules/mes/web/MesProductRecordController.java

@@ -4125,22 +4125,25 @@ public class MesProductRecordController extends BaseController {
 		String oprno = request.getParameter("oprno");
 		String oprno = request.getParameter("oprno");
 		String lineSn = request.getParameter("lineSn");
 		String lineSn = request.getParameter("lineSn");
 
 
-		MesDeviceTime mesDeviceTime = new MesDeviceTime();
-		mesDeviceTime.setOprno(oprno);
-		mesDeviceTime.setProductCate(lineSn);
-		MesDeviceTime mesDeviceTime1 = mesDeviceTimeService.findInfo(mesDeviceTime);
-		if(ObjectUtils.isEmpty(mesDeviceTime1)){
+		if(StringUtils.isEmpty(oprno) || StringUtils.isEmpty(lineSn)){
 			resp.setResult(Global.FALSE);
 			resp.setResult(Global.FALSE);
-			resp.setMessage("当前工位未加工工件");
+			resp.setMessage("参数错误");
 			return resp;
 			return resp;
 		}
 		}
-		if(mesDeviceTime1.getEndDate() == null){
+
+//		MesDeviceTime mesDeviceTime = new MesDeviceTime();
+//		mesDeviceTime.setOprno(oprno);
+//		mesDeviceTime.setProductCate(lineSn);
+//		MesDeviceTime mesDeviceTime1 = mesDeviceTimeService.findInfo(mesDeviceTime);
+		MesProcessProduct mesProcessProduct1 = mesProcessProductService.findByCateAndOprno(lineSn,oprno);
+
+		if(ObjectUtils.isEmpty(mesProcessProduct1)){
 			resp.setResult(Global.FALSE);
 			resp.setResult(Global.FALSE);
-			resp.setMessage("当前工位未加工工件");
+			resp.setMessage("当前工位暂无加工工件");
 			return resp;
 			return resp;
 		}
 		}
 
 
-		resp.setData(mesDeviceTime1.getSn());
+		resp.setData(mesProcessProduct1.getSn());
 		resp.setResult(Global.TRUE);
 		resp.setResult(Global.TRUE);
 		resp.setMessage("成功");
 		resp.setMessage("成功");
 
 

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

@@ -697,6 +697,7 @@ shiro:
     ${adminPath}/mes/mesProductRecord/pcunbind = anon
     ${adminPath}/mes/mesProductRecord/pcunbind = anon
     ${adminPath}/mes/mesProductRecord/pdaQueryIsSn = anon
     ${adminPath}/mes/mesProductRecord/pdaQueryIsSn = anon
     ${adminPath}/mes/mesProductRecord/pdaQueryQuality = anon
     ${adminPath}/mes/mesProductRecord/pdaQueryQuality = anon
+    ${adminPath}/mes/mesProductRecord/getCurSn= anon
     ${adminPath}/** = user
     ${adminPath}/** = user