|
|
@@ -265,9 +265,24 @@ public class StepWorkServiceImpl implements StepWorkService {
|
|
|
" select makebad_seq.nextval,ma_code,ms_code,ms_sncode,'EIS对接',sysdate,?,?,?,'',?,sp_soncode,0 from make left join makeserial on ms_makecode=ma_code left join " +
|
|
|
" stepproduct on sp_mothercode=ma_prodcode and sp_stepcode=ms_nextstepcode where ms_sncode=? and ms_makecode=?", stepcode, sccode, item, BgCode, sncode, macode);
|
|
|
}
|
|
|
- //将不良的序列号的状态码设为3
|
|
|
- baseDao.execute("update makeserial set ms_status='3' where ms_sncode=? and ms_makecode=?", sncode, macode);
|
|
|
- stepPassed(macode, sccode, sncode, usercode, "NG");
|
|
|
+ if("GX0030".equals(stepcode)) { //只是这道工序需要这样
|
|
|
+ int cn = baseDao.getJdbcTemplate().queryForObject(" select count(1) from MAKEBADCOUNT_USING " +
|
|
|
+ " where mbc_sncode=? and mbc_stepcode=? and nvl(mbc_status,0)=0", Integer.class, sncode, stepcode);
|
|
|
+ if (cn == 0) {
|
|
|
+ //如果当前工序是第一次不良则不过站
|
|
|
+ baseDao.execute("insert into MAKEBADCOUNT_USING(mbc_id,mbc_sncode,mbc_stepcode,mbc_status,mbc_indate) " +
|
|
|
+ " values(MAKEBADCOUNT_USING_seq.nextval,?,?,0,sysdate)", sncode, stepcode);
|
|
|
+ throw new ApiStepWorkException(new StepWorkApiResult(false,400,"上传MES失败,第一次不良!"));
|
|
|
+ } else {
|
|
|
+ //将不良的序列号的状态码设为3
|
|
|
+ baseDao.execute("update makeserial set ms_status='3' where ms_sncode=? and ms_makecode=?", sncode, macode);
|
|
|
+ stepPassed(macode, sccode, sncode, usercode, "NG");
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ //将不良的序列号的状态码设为3
|
|
|
+ baseDao.execute("update makeserial set ms_status='3' where ms_sncode=? and ms_makecode=?", sncode, macode);
|
|
|
+ stepPassed(macode, sccode, sncode, usercode, "NG");
|
|
|
+ }
|
|
|
} else {
|
|
|
//不良采集为良品是更新
|
|
|
if (msstepcode!=null && msstepcode.toString().equals(stepcode) && result == "PASS") {
|