|
|
@@ -301,12 +301,19 @@ public class MESHelperServiceImpl implements MESHelperService {
|
|
|
SqlRowList mhc = baseDao.queryForRowSet("SELECT * FROM(SELECT mhc_id, mhc_indate, trunc((sysdate - mhc_indate) * 1440) minute " +
|
|
|
"FROM makehourcount WHERE mhc_macode = '"+Moname+"' AND mhc_linecode = '"+LineNO+"' AND mhc_sourcecode = '"+Username+"' " +
|
|
|
"ORDER BY mhc_indate DESC) WHERE ROWNUM = 1");
|
|
|
+
|
|
|
+ SqlRowList sc = baseDao.queryForRowSet("select sc_stepcode,sc_stepname from Source where sc_code = '"+Username+"'");
|
|
|
+ String sc_stepcode="";
|
|
|
+ if(sc.next()){
|
|
|
+ sc_stepcode = sc.getString("sc_stepcode");
|
|
|
+ }
|
|
|
+
|
|
|
if(mhc.next()){
|
|
|
if(mhc.getInt("minute") > 10){
|
|
|
baseDao.execute("insert into makehourcount(mhc_id, mhc_macode, mhc_indate, mhc_type, mhc_sourcecode, " +
|
|
|
"mhc_inman, mhc_qty, mhc_linecode, mhc_pcbcount, mhc_stepcode)" +
|
|
|
"values(makehourcount_seq.nextval,'"+Moname+"',sysdate,'','"+Username+"'," +
|
|
|
- "'"+Username+"',1,'"+LineNO+"',1,'AOI')");
|
|
|
+ "'"+Username+"',1,'"+LineNO+"',1,'"+sc_stepcode+"')");
|
|
|
}else {
|
|
|
baseDao.updateByCondition("makehourcount", "MHC_QTY = MHC_QTY+1", "mhc_id='" + mhc.getString("mhc_id") + "'");
|
|
|
}
|
|
|
@@ -315,7 +322,7 @@ public class MESHelperServiceImpl implements MESHelperService {
|
|
|
baseDao.execute("insert into makehourcount(mhc_id, mhc_macode, mhc_indate, mhc_type, mhc_sourcecode, " +
|
|
|
"mhc_inman, mhc_qty, mhc_linecode, mhc_pcbcount, mhc_stepcode)" +
|
|
|
"values(makehourcount_seq.nextval,'"+Moname+"',sysdate,'','"+Username+"'," +
|
|
|
- "'"+Username+"',1,'"+LineNO+"',1,'AOI')");
|
|
|
+ "'"+Username+"',1,'"+LineNO+"',1,'"+sc_stepcode+"')");
|
|
|
}
|
|
|
|
|
|
rmap.put("code","0");
|