|
|
@@ -644,6 +644,12 @@ public class PdaSMTServiceImpl implements PdaSMTService {
|
|
|
}else{
|
|
|
showSmtError(APIErrorCode.BUSINESS_FAILED,"站位未上料无需接料",handleType,linecode,location,ps_prodcode,"",bool,table);
|
|
|
}
|
|
|
+
|
|
|
+ rs = baseDao.queryForRowSet("select * from (select dsl_id,dsl_barcode,dsl_repcode,dsl_prodcode from devSMTLocation where dsl_linecode=? and dsl_makecode=? and dsl_location=? and dsl_table=? and dsl_status=0 and dsl_ifcheck = 0 order by dsl_id desc) where rownum=1",linecode,ma_code,location,map.get("DL_TABLE"));
|
|
|
+ if(rs.next()){
|
|
|
+ showSmtError(APIErrorCode.BUSINESS_FAILED,"站位存在未校验条码,无法接料",handleType,linecode,location,ps_prodcode,"",bool,table);
|
|
|
+ }
|
|
|
+
|
|
|
rs = baseDao.queryForRowSet("select psl_baseqty,psl_prodcode,psl_repcode,psl_feeder,psl_id from productsmtlocation "
|
|
|
+" where psl_psid=? and psl_location=? and psl_table=? ",map.get("PS_ID"),location, map.get("DL_TABLE"));
|
|
|
if (rs.next())
|
|
|
@@ -651,7 +657,7 @@ public class PdaSMTServiceImpl implements PdaSMTService {
|
|
|
psl_prodcode = rs.getString("psl_prodcode");
|
|
|
}
|
|
|
String type="barcode";
|
|
|
- rs = baseDao.queryForRowSet("select dsl_barcode,dsl_repcode from devSMTLocation where dsl_linecode=? and dsl_makecode=? and dsl_location=? and dsl_table =? and dsl_status=0 and dsl_barcode=?",linecode,ma_code,location,map.get("DL_TABLE"),bar_code);
|
|
|
+ rs = baseDao.queryForRowSet("select dsl_barcode,dsl_repcode from devSMTLocation where dsl_linecode=? and dsl_makecode=? and dsl_location=? and dsl_table =? and dsl_barcode=?",linecode,ma_code,location,map.get("DL_TABLE"),bar_code);
|
|
|
if(rs.next()){
|
|
|
if(isBarcode){
|
|
|
showSmtError(APIErrorCode.BUSINESS_FAILED,"不允许接同一个料卷号",handleType,linecode,location,ps_prodcode,"料卷"+bar_code,bool,table);
|
|
|
@@ -1212,9 +1218,9 @@ public class PdaSMTServiceImpl implements PdaSMTService {
|
|
|
map.get("DL_MACODE"),map.get("DL_TABLE"));
|
|
|
if(rs0.next() && rs0.getInt("cn") > 0){
|
|
|
unloadLocation = rs0.getString("psl_location");
|
|
|
- if(!("强制启动").equals(op)){
|
|
|
- throw new APIErrorException(APIErrorCode.BUSINESS_SMTFORCE,"站位["+unloadLocation+"]没有上料料卷不允许启动");
|
|
|
- }
|
|
|
+// if(!("强制启动").equals(op)){
|
|
|
+// throw new APIErrorException(APIErrorCode.BUSINESS_SMTFORCE,"站位["+unloadLocation+"]没有上料料卷不允许启动");
|
|
|
+// }
|
|
|
}
|
|
|
// rs0 = baseDao.queryForRowSet("select wm_concat(distinct dsl_location) dsl_location,count(1) cn from devsmtlocation where dsl_linecode=? and dsl_makecode=? and dsl_table=?"
|
|
|
// +" and dsl_status=0 and (dsl_prodcode,dsl_location) not in (select psl_repcode,psl_location from productsmt left join productsmtlocation on ps_id=psl_psid"
|
|
|
@@ -1416,8 +1422,8 @@ public class PdaSMTServiceImpl implements PdaSMTService {
|
|
|
//ps_id,table,linecode,ma_code,table
|
|
|
Map<String,Object> mapR = new HashMap <String, Object>();
|
|
|
rs=baseDao.queryForRowSet("select * from (select psl_location from(select min(psl_detno)psl_detno,psl_location from productsmtlocation "
|
|
|
- +" where psl_psid=? 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_ifcheck = -1) "
|
|
|
+ +" where psl_psid=? and psl_table=? and psl_location in (select distinct dsl_location from devsmtlocation where "
|
|
|
+ +" dsl_linecode=? and dsl_makecode=? and dsl_table=? and dsl_status=0 and dsl_ifcheck = 0) "
|
|
|
+" group by psl_location order by psl_detno asc)) where rownum<=20 ",ps_id,table,linecode,ma_code,table);
|
|
|
if(rs.next()){
|
|
|
mapR.put("NotCheckLocation", rs.getResultList());
|
|
|
@@ -1425,8 +1431,8 @@ public class PdaSMTServiceImpl implements PdaSMTService {
|
|
|
mapR.put("NotCheckLocation", "");
|
|
|
}
|
|
|
rs=baseDao.queryForRowSet("select count(1) cn from (select distinct psl_location from productsmtlocation where psl_psid=? 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_ifcheck = -1)) ",ps_id,table,linecode,ma_code,table);
|
|
|
+ +" psl_location in (select distinct dsl_location from devsmtlocation where "
|
|
|
+ +" dsl_linecode=? and dsl_makecode=? and dsl_table=? and dsl_status=0 and dsl_ifcheck = 0)) ",ps_id,table,linecode,ma_code,table);
|
|
|
if(rs.next()){
|
|
|
mapR.put("NotCheckCount", rs.getInt("cn"));
|
|
|
}else{
|
|
|
@@ -1437,8 +1443,8 @@ public class PdaSMTServiceImpl implements PdaSMTService {
|
|
|
+" not in(select dsl_location,dsl_fprodcode from devsmtlocation where dsl_linecode=? "
|
|
|
+" and dsl_makecode=? and dsl_status=0 and dsl_ifcheck=-1)",Integer.class,ps_id,table,linecode,ma_code);
|
|
|
if(psl_id == null || psl_id == 0){
|
|
|
- baseDao.execute("update deviceline set dl_checkcount=nvl(dl_checkcount,0)+1 where dl_id=?",dl_id);
|
|
|
- baseDao.execute("update devsmtlocation set dsl_ifcheck = 0 where dsl_linecode=? and dsl_makecode=? and dsl_table=? and dsl_status=0",linecode,ma_code,table);
|
|
|
+ //baseDao.execute("update deviceline set dl_checkcount=nvl(dl_checkcount,0)+1 where dl_id=?",dl_id);
|
|
|
+ //baseDao.execute("update devsmtlocation set dsl_ifcheck = 0 where dsl_linecode=? and dsl_makecode=? and dsl_table=? and dsl_status=0",linecode,ma_code,table);
|
|
|
baseDao.execute(INSERT_SMTLOG,SystemSession.getUser().getEm_name(),"校验","完成一次校验",linecode,"",0,map.get("DL_PRODCODE"),"",map.get("DL_TABLE"),Integer.valueOf(returnMake(linecode,dl_prodcode,map.get("DL_TABLE")).get("hasmake").toString()) == -1 ? returnMake(linecode,dl_prodcode,map.get("DL_TABLE")).get("macode"):"");
|
|
|
}
|
|
|
}
|
|
|
@@ -1626,7 +1632,7 @@ public class PdaSMTServiceImpl implements PdaSMTService {
|
|
|
//重新校验
|
|
|
@Override
|
|
|
public Map<String, Object> startCheck(String linecode) {
|
|
|
- baseDao.execute("update devsmtlocation set dsl_ifcheck =0 where dsl_linecode = ? and dsl_status = 0 and dsl_ifcheck = -1",linecode);
|
|
|
+ //baseDao.execute("update devsmtlocation set dsl_ifcheck =0 where dsl_linecode = ? and dsl_status = 0 and dsl_ifcheck = -1",linecode);
|
|
|
SqlRowList rs = baseDao.queryForRowSet("select dl_prodcode,dl_table from deviceline where dl_linecode = ?",linecode);
|
|
|
if(rs.next()){
|
|
|
baseDao.execute(INSERT_SMTLOG,SystemSession.getUser().getEm_name(),"校验","重新校验",linecode,"",0,rs.getString("dl_prodcode"),"",rs.getString("dl_table"),Integer.valueOf(returnMake(linecode,rs.getString("dl_prodcode"),rs.getString("dl_table")).get("hasmake").toString()) == -1 ? returnMake(linecode,rs.getString("dl_prodcode"),rs.getString("dl_table")).get("macode"):"");
|
|
|
@@ -1650,8 +1656,8 @@ public class PdaSMTServiceImpl implements PdaSMTService {
|
|
|
|
|
|
//未校验站位前二十条
|
|
|
rs=baseDao.queryForRowSet("select * from (select psl_location from(select min(psl_detno)psl_detno,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_ifcheck = -1) "
|
|
|
+ +" where ps_linecode = ? and ps_prodcode = ? and psl_table = ? and psl_location in (select distinct dsl_location from devsmtlocation where "
|
|
|
+ +" dsl_linecode=? and dsl_makecode=? and dsl_table=? and dsl_status=0 and dsl_ifcheck = 0) "
|
|
|
+" group by psl_location order by psl_detno)) where rownum<=20 ",linecode,ps_prodcode,table,linecode,macode,table);
|
|
|
if(rs.next()){
|
|
|
mapR.put("NotCheckLocation", rs.getResultList());
|
|
|
@@ -1660,8 +1666,8 @@ 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_ifcheck = -1)) ",linecode,ps_prodcode,table,linecode,macode,table);
|
|
|
+ +" ps_prodcode = ? and psl_table = ? and psl_location in (select distinct dsl_location from devsmtlocation where "
|
|
|
+ +" dsl_linecode=? and dsl_makecode=? and dsl_table=? and dsl_status=0 and dsl_ifcheck = 0)) ",linecode,ps_prodcode,table,linecode,macode,table);
|
|
|
if(rs.next()){
|
|
|
mapR.put("NotCheckCount", rs.getInt("cn"));
|
|
|
}else{
|