Procházet zdrojové kódy

微浦MES,飞达需要校验调整,在线上料数据有解绑记录的再次绑定新的飞达才需要校验

xiaost před 1 týdnem
rodič
revize
145cd60f53

+ 6 - 4
src/com/uas/mes/pda/service/impl/PdaSMTServiceImpl.java

@@ -2562,9 +2562,11 @@ public class PdaSMTServiceImpl implements PdaSMTService {
 			baseDao.execute("update devsmtlocation set DSL_FECODE=? where dsl_id in (select dsl_id from devsmtlocation " +
 					"where dsl_location=? and dsl_status=0 )",fecode,location);
 
-			//非虚拟线才更新是否飞达校验
-			baseDao.execute("update devsmtlocation set dsl_iffeedcheck=-1 where dsl_id in (select dsl_id from devsmtlocation left join line on dsl_linecode=li_code " +
-					"where dsl_location=? and dsl_status=0 and nvl(li_isvirtual,0)=0) and DSL_FECODE=?",location,fecode);
+			//非虚拟线才,这个站位有过解绑飞达操作,再次绑定,则需要更新是否飞达校验,
+			baseDao.execute("update devsmtlocation a set dsl_iffeedcheck=-1 where dsl_id in (select dsl_id from devsmtlocation left join line on dsl_linecode=li_code " +
+					"where dsl_location=? and dsl_status=0 and nvl(li_isvirtual,0)=0) and DSL_FECODE=? " +
+					" and (dsl_iffeedcheck=2 or exists(select 1 from devsmtlocation b where b.dsl_iffeedcheck=2 " +
+					"  and a.dsl_makecode=b.dsl_makecode and a.dsl_location=b.dsl_location and a.dsl_table=b.dsl_table and a.dsl_linecode=b.dsl_linecode))",location,fecode);
 
             SqlRowList rs1 = baseDao.queryForRowSet("select DSL_MAKECODE,DSL_TABLE,DSL_LINECODE,nvl(li_isvirtual,0)li_isvirtual  from devsmtlocation left join line on dsl_linecode=li_code " +
 					" where dsl_location=? and dsl_status=0 and DSL_FECODE=? ",location,fecode);
@@ -2628,7 +2630,7 @@ public class PdaSMTServiceImpl implements PdaSMTService {
 					fecode,map.get("FE_ID"),type,"站位:"+location,SystemSession.getUser().getEm_name(),location);
 		}
 		//如果站位是在线的devsmtlocation 表里面并且dsl_status=0,并且线别非虚拟线别 未校验不可以接料
-		baseDao.execute("update devsmtlocation set dsl_iffeedcheck=0,DSL_FECODE=null " +
+		baseDao.execute("update devsmtlocation set dsl_iffeedcheck=2,DSL_FECODE=null " +
 				" where dsl_location=? and dsl_fecode=? ",location,fecode); //and nvl(li_isvirtual,0)=0 虚拟非虚拟线解绑都更新
 		Map<String, Object> rmap = new HashMap<>();
 		rmap.put("location",location);