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

微浦MES,PDA 备料品质套料 调整,采用实际线别

xiaost 2 дней назад
Родитель
Сommit
8a5293bf3e
1 измененных файлов с 9 добавлено и 5 удалено
  1. 9 5
      src/com/uas/mes/pda/service/impl/PdaSMTServiceImpl.java

+ 9 - 5
src/com/uas/mes/pda/service/impl/PdaSMTServiceImpl.java

@@ -2344,6 +2344,7 @@ public class PdaSMTServiceImpl implements PdaSMTService {
 		Object prodcode = map1.get("dsl_prodcode");
 		Integer ps_id = 0;
 		Integer dl_id = 0;
+		String mainline = "";
 		boolean success = Boolean.valueOf(String.valueOf(map1.get("success")));
 		SqlRowList rs;
 		int cn=0;
@@ -2354,14 +2355,15 @@ public class PdaSMTServiceImpl implements PdaSMTService {
 		}
 		//校验成功
 		if(success){
-			rs = baseDao.queryForRowSet("select dl_id,dl_hasmake,dl_smtid,dl_table,dl_decode,dl_prodcode from deviceline where dl_linecode=? and dl_macode=?",linecode,ma_code);
+			rs = baseDao.queryForRowSet("select dl_id,dl_hasmake,dl_smtid,dl_table,dl_decode,dl_prodcode,dl_mainline from deviceline where dl_linecode=? and dl_macode=?",linecode,ma_code);
 			if(rs.next()){
 				dl_id = rs.getInt("dl_id");
 				table = rs.getString("dl_table");
 				ma_prodcode = rs.getString("dl_prodcode");
+				mainline = rs.getGeneralString("dl_mainline");
 				//无论上料还是接料,判断devsmtlocation 表中是否有记录,并且是否有料卷号,
 				//有记录,没有料卷号 --上料,接料:则更新物料编号.  有料卷号--上料、接料:则更新成已校验
-				ps_id = baseDao.getJdbcTemplate().queryForObject("select max(ps_id) from productsmt left join productsmtlocation on psl_psid=ps_id where ps_linecode=? and ps_prodcode=? and ps_statuscode='AUDITED' AND PSL_TABLE=?", Integer.class,linecode,ma_prodcode,table);
+				ps_id = baseDao.getJdbcTemplate().queryForObject("select max(ps_id) from productsmt left join productsmtlocation on psl_psid=ps_id where ps_linecode=? and ps_prodcode=? and ps_statuscode='AUDITED' AND PSL_TABLE=?", Integer.class,StringUtil.hasText(mainline)?mainline:linecode,ma_prodcode,table);
 				if(ps_id == null ||ps_id == 0){
 					throw new APIErrorException(APIErrorCode.BUSINESS_FAILED,"线别+产品对应的站位表不存在!");
 				}else if(ps_id!=rs.getInt("dl_smtid")){//更新排位表ID
@@ -2788,12 +2790,14 @@ public class PdaSMTServiceImpl implements PdaSMTService {
 		Object macode = null;
 		Object table = null;
 		Object ps_prodcode = null;
+		String mainline = null;
 		Map<String,Object> mapR = new HashMap<String,Object>();
-		rs = baseDao.queryForRowSet("select dl_macode,dl_table,dl_prodcode from deviceline where dl_linecode = ?",linecode);
+		rs = baseDao.queryForRowSet("select dl_macode,dl_table,dl_prodcode,DL_MAINLINE from deviceline where dl_linecode = ?",linecode);
 		if(rs.next()){
 			macode = rs.getString("dl_macode");
 			table = rs.getString("dl_table");
 			ps_prodcode = rs.getString("dl_prodcode");
+			mainline = rs.getString("dl_mainline");
 		}
 		//是否存在有校验记录,或者点了重新校验recheck==1
 		int cn = baseDao.getJdbcTemplate().queryForObject("select count(1) from devsmtlocation where " +
@@ -2807,7 +2811,7 @@ public class PdaSMTServiceImpl implements PdaSMTService {
 					+ "      and  psl_location not in (select distinct dsl_location from devsmtlocation where "
 					+ "        dsl_linecode=? and dsl_makecode=? and dsl_table=? and dsl_status=0 and dsl_quaifcheck = -1) "
 					+ " group by psl_location order by psl_detno)"
-					+ " ) where rownum<=20 ", linecode, ps_prodcode, table, linecode, macode, table);
+					+ " ) where rownum<=20 ", StringUtil.hasText(mainline)?mainline:linecode, ps_prodcode, table, linecode, macode, table);
 			if (rs.next()) {
 				mapR.put("NotCheckLocation", rs.getResultList());
 			} else {
@@ -2816,7 +2820,7 @@ public class PdaSMTServiceImpl implements PdaSMTService {
 			//未校验站位数量
 			rs = baseDao.queryForRowSet("select count(1) cn from (select distinct psl_location from productsmtlocation left join productsmt on ps_id=psl_psid where ps_linecode = ? and "
 					+ " ps_prodcode = ? and psl_table = ? and psl_location not in (select distinct dsl_location from devsmtlocation where "
-					+ " dsl_linecode=? and dsl_makecode=? and dsl_table=? and dsl_status=0 and dsl_quaifcheck = -1)) ", linecode, ps_prodcode, table, linecode, macode, table);
+					+ " dsl_linecode=? and dsl_makecode=? and dsl_table=? and dsl_status=0 and dsl_quaifcheck = -1)) ", StringUtil.hasText(mainline)?mainline:linecode, ps_prodcode, table, linecode, macode, table);
 			if (rs.next()) {
 				mapR.put("NotCheckCount", rs.getInt("cn"));
 			} else {