|
|
@@ -2347,7 +2347,7 @@ public class PdaSMTServiceImpl implements PdaSMTService {
|
|
|
boolean success = Boolean.valueOf(String.valueOf(map1.get("success")));
|
|
|
SqlRowList rs;
|
|
|
int cn=0;
|
|
|
- cn=baseDao.getCount("select count(1) from devsmtlocation where dsl_linecode='"+linecode+"' and dsl_table ='"+map.get("DL_TABLE")+"' and dsl_location = '"+map1.get("dsl_location")+"' and dsl_status = 0");
|
|
|
+ cn = baseDao.getCount("select count(1) from devsmtlocation where dsl_linecode='"+linecode+"' and dsl_table ='"+map.get("DL_TABLE")+"' and dsl_location = '"+map1.get("dsl_location")+"' and dsl_status = 0");
|
|
|
if(cn==0){
|
|
|
baseDao.execute(INSERT_SMTLOG,SystemSession.getUser().getEm_name(),"品质校验","校验失败,站位未上料",linecode,location,-1,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"):"","");
|
|
|
throw new APIErrorException(APIErrorCode.BUSINESS_FAILED,"无上料记录!");
|
|
|
@@ -2747,6 +2747,40 @@ public class PdaSMTServiceImpl implements PdaSMTService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public Map<String, Object> quaCheckLoc(String li_code,String ma_code,String dl_table,String location) {
|
|
|
+ SqlRowList rs = baseDao.queryForRowSet("select dl_id,dl_statuscode,dl_mainline,dl_prodcode " +
|
|
|
+ " from deviceline where dl_linecode=? and DL_MACODE=? and dl_table=? ",li_code,ma_code,dl_table);
|
|
|
+ if(rs.next()){
|
|
|
+ String mainline = rs.getGeneralString("dl_mainline");
|
|
|
+ String prodcode = rs.getString("dl_prodcode");
|
|
|
+ int ps_id = 0;
|
|
|
+ //查询是否存在排位表
|
|
|
+ rs = baseDao.queryForRowSet("select ps_id,ps_devcode from productsmt left join productsmtlocation on ps_id = psl_psid" +
|
|
|
+ " where ps_prodcode = ? and ps_linecode=? and psl_table = ? and ps_statuscode='AUDITED'",
|
|
|
+ prodcode,StringUtil.hasText(mainline)?mainline:li_code,dl_table); //线别+物料唯一
|
|
|
+ if(rs.next()){
|
|
|
+ ps_id = rs.getInt("ps_id");
|
|
|
+ }else{
|
|
|
+ throw new APIErrorException(APIErrorCode.DATA_NOT_FOUND,"当前线别"+li_code+"+产品:"+prodcode+"+板面:"+dl_table+",未维护已审核的排位表,无法上料或者接料");
|
|
|
+ }
|
|
|
+ String psl_prodcode;
|
|
|
+ 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=? ", ps_id, location,dl_table);
|
|
|
+ if (rs.next()) {
|
|
|
+ psl_prodcode = rs.getString("psl_prodcode");
|
|
|
+ } else {
|
|
|
+ throw new APIErrorException(APIErrorCode.DATA_NOT_FOUND, "站位:" + location + "不在排位表中!");
|
|
|
+ }
|
|
|
+ Map<String,Object> map = new HashMap<>();
|
|
|
+ map.put("prodcode",psl_prodcode);
|
|
|
+ map.put("location",location);
|
|
|
+ return map;
|
|
|
+ }else{
|
|
|
+ throw new APIErrorException(APIErrorCode.BUSINESS_FAILED,"线别["+li_code+"]+工单["+ma_code+"]+板面["+dl_table+"],未绑定!");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
//因为需要调用两次,所以封装了一个获取未校验站位的方法
|
|
|
private Map<String, Object> quaUnLoading(String linecode,int recheck){
|