|
|
@@ -117,7 +117,7 @@ public class PdaMsdServiceImpl implements PdaMsdService {
|
|
|
String pr_msdlevel = null;
|
|
|
Double pr_msdlifetime = null;
|
|
|
SqlRowList barrs = baseDao.queryForRowSet("select bar_code,bar_prodcode,pr_code,nvl(pr_msdlevel,'无') pr_msdlevel," +
|
|
|
- "max(mi_msdlifttime) mi_msdlifttime,pr_ismsd,max(pr_statuscode) pr_statuscode " +
|
|
|
+ "max(PR_MAXTIME) mi_msdlifttime,pr_ismsd,max(pr_statuscode) pr_statuscode " +
|
|
|
"from barcode left join product on pr_code = bar_prodcode left join msdinfo on mi_msdlevel = pr_msdlevel " +
|
|
|
"where bar_code=? group by bar_code,bar_prodcode,pr_code,pr_msdlevel,pr_ismsd", bar_code);
|
|
|
if(barrs.next()){
|
|
|
@@ -153,7 +153,7 @@ public class PdaMsdServiceImpl implements PdaMsdService {
|
|
|
int count = baseDao.getCount("select count(*) from product where instr('"+bar_code+"',PR_CODE)>0 and nvl(pr_Statuscode,' ') ='AUDITED'");
|
|
|
if(count == 1){
|
|
|
Object[] prods = baseDao.getFieldsDataByCondition("product left join msdinfo on mi_msdlevel = pr_msdlevel",
|
|
|
- "pr_code,pr_msdlevel,pr_ismsd,max(mi_msdlifttime)", "instr('"+bar_code+"',PR_CODE)>0 and nvl(pr_Statuscode,' ') ='AUDITED' group by PR_CODE, PR_MSDLEVEL, PR_ISMSD");
|
|
|
+ "pr_code,pr_msdlevel,pr_ismsd,max(PR_MAXTIME)", "instr('"+bar_code+"',PR_CODE)>0 and nvl(pr_Statuscode,' ') ='AUDITED' group by PR_CODE, PR_MSDLEVEL, PR_ISMSD");
|
|
|
pr_code = prods[0];
|
|
|
if(NumberUtil.isEmpty(prods[2])){
|
|
|
throw new APIErrorException(APIErrorCode.ILLEGAL_ARGUMENTS, "条码:"+bar_code+"对应物料:"+pr_code+"非湿敏元件,不能进行登记!");
|
|
|
@@ -219,7 +219,8 @@ public class PdaMsdServiceImpl implements PdaMsdService {
|
|
|
// 3、获取物料资料表中维护的烘烤温度,烘烤时长返回至客户端
|
|
|
Object msdLevel = rs.getGeneralString("mb_msdlevel");
|
|
|
if(StringUtil.hasText(msdLevel)){
|
|
|
- rs = baseDao.queryForRowSet("select mi_msdplanoventime MI_PLANOVENTIME,mi_msdoventemp MI_OVENTEMP from msdinfo where mi_msdlevel = ?",msdLevel);
|
|
|
+ //rs = baseDao.queryForRowSet("select mi_msdplanoventime MI_PLANOVENTIME,mi_msdoventemp MI_OVENTEMP from msdinfo where mi_msdlevel = ?",msdLevel);
|
|
|
+ rs = baseDao.queryForRowSet("select PR_BAKETIME MI_PLANOVENTIME,PR_TEMPERATURE MI_OVENTEMP from product left join barcode on bar_prodcode=pr_code where bar_code=?",bar_code);
|
|
|
if(rs.next()){
|
|
|
return rs.getResultList();
|
|
|
}else {
|
|
|
@@ -387,4 +388,49 @@ public class PdaMsdServiceImpl implements PdaMsdService {
|
|
|
throw new APIErrorException(APIErrorCode.ILLEGAL_ARGUMENTS, "条码:"+bar_code+"尚未登记!");
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Map<String, Object> checkSealBarcode(String bar_code) {
|
|
|
+ // 1、判断bar_code 条码号不能为空并且在msdbarcode 表中存在
|
|
|
+ getLog(bar_code);
|
|
|
+ SqlRowList rs = baseDao.queryForRowSet("select mb_barcode,mb_prodcode,mb_status,mb_planoventime planoventime,round((sysdate - mb_actiondate) * 24.0,2) oventime," +
|
|
|
+ " (nvl(mb_planoventime,0)*60 - ceil((sysdate - mb_actiondate) * 24.0 * 60.0)) restOventime from MSDBARCODE left join product on pr_code = mb_prodcode where mb_barcode = ?",bar_code);
|
|
|
+ if(rs.next()){
|
|
|
+ if(rs.getString("mb_status").equals("密封中")){
|
|
|
+ throw new APIErrorException(APIErrorCode.BUSINESS_FAILED,"条码:" + bar_code + ",目前是密封中状态请勿重复操作!");
|
|
|
+ }else if(rs.getString("mb_status").equals("暴露中")){
|
|
|
+ throw new APIErrorException(APIErrorCode.BUSINESS_FAILED,"条码:" + bar_code + ",目前是暴露中状态请放入烘烤箱烘烤足够后再操作!");
|
|
|
+ }else if(rs.getString("mb_status").equals("防潮柜")||rs.getString("mb_status").equals("烘烤中")){//暴露中状态可以直接重新密封
|
|
|
+ if(rs.getString("mb_status").equals("烘烤中")){//烘烤中 则判断是否烘烤足够
|
|
|
+ if(rs.getDouble("restOventime") > 0.0 ){
|
|
|
+ throw new APIErrorException(APIErrorCode.ILLEGAL_ARGUMENTS, "条码:"+bar_code+"烘烤时长不足,不允许出烘烤!" +
|
|
|
+ "计划烘烤时长为:"+rs.getDouble("planoventime")+"(H),已烘烤时长为:"+rs.getDouble("oventime")+"(H)");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return rs.getCurrentMap();
|
|
|
+ }else {
|
|
|
+ throw new APIErrorException(APIErrorCode.BUSINESS_FAILED,"条码:" + bar_code + ","+rs.getString("mb_status")+",不允许此操作!");
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ throw new APIErrorException(APIErrorCode.ILLEGAL_ARGUMENTS, "条码:"+bar_code+"尚未登记!");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Map<String, Object> confirmSealBarcode(String bar_code) {
|
|
|
+ Map<String, Object> barMsg = checkSealBarcode(bar_code);
|
|
|
+ baseDao.updateByCondition("MSDBARCODE","mb_status='密封中',mb_actiondate=sysdate,MB_EXPOSURETIME=0", "mb_barcode='"+bar_code+"'");
|
|
|
+ baseDao.execute("insert into MSDLog(ms_id,ms_date,ms_barcode,ms_level,ms_lifetime,ms_action," +
|
|
|
+ " ms_man,ms_location,ms_prodcode,ms_batchcode,ms_qty,MS_REMARK) "
|
|
|
+ + " select msdlog_seq.nextval,sysdate,ms_barcode,ms_level,ms_lifetime,'重新密封','" +
|
|
|
+ SystemSession.getUser().getEm_name()+"',ms_location,ms_prodcode,ms_batchcode,ms_qty,'重新密封成功。' "
|
|
|
+ + "from (select msdlog.* from msdlog where ms_barcode='"+bar_code+"' order by ms_id desc) where rownum=1");
|
|
|
+ SqlRowList rs = baseDao.queryForRowSet("select MB_BARCODE,MB_PRODCODE,PR_DETAIL,PR_SPEC,MB_MSDLEVEL,round(MB_EXPOSURETIME/60,2) MB_EXPOSURETIME,MB_FLOORLIFE from msdbarcode left join product on pr_code = mb_prodcode where mb_barcode =?"
|
|
|
+ , bar_code);
|
|
|
+ if(rs.next()){
|
|
|
+ return rs.getCurrentMap();
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
}
|