Ver Fonte

湿敏条码管控修改,上料站位顺序显示修改

callm há 5 anos atrás
pai
commit
00ed48650b

+ 44 - 0
src/com/uas/mes/api/pda/PdaMsdController.java

@@ -227,4 +227,48 @@ public class PdaMsdController extends BaseApiController{
 			return bar_code;
 		}
 	}
+
+	/**
+	 * 真空密封登记 - 校验
+	 * @param bar_code 条码号
+	 * @return
+	 */
+	@RequestMapping(value="/checkSealBarcode.action")
+	@ResponseBody
+	public ModelMap checkSealBarcode(HttpServletRequest request,String bar_code){
+		Employee employee = (Employee) request.getSession().getAttribute(
+				"employee");
+		if (employee == null){
+			throw new APIErrorException(APIErrorCode.NOT_AUTHENTED, "会话已断开!");
+		}
+		if(StringUtil.isEmpty(bar_code)){
+			throw new APIErrorException(APIErrorCode.ILLEGAL_ARGUMENTS, "请输入条码编号");
+		}
+		return success(pdaMsdService.checkSealBarcode(parseBarCode(bar_code)));
+	}
+
+	/**
+	 * 重新密封确认
+	 * @param bar_code
+	 * @return
+	 */
+	/**
+	 * 真空密封登记 - 确认
+	 * @param bar_code 条码号
+	 * @return
+	 */
+	@RequestMapping(value="/confirmSealBarcode.action",method = RequestMethod.POST)
+	@ResponseBody
+	public ModelMap confirmSealBarcode(HttpServletRequest request,String bar_code){
+		Employee employee = (Employee) request.getSession().getAttribute(
+				"employee");
+		if (employee == null){
+			throw new APIErrorException(APIErrorCode.NOT_AUTHENTED, "会话已断开!");
+		}
+		if(StringUtil.isEmpty(bar_code)){
+			throw new APIErrorException(APIErrorCode.ILLEGAL_ARGUMENTS, "请输入条码编号");
+		}
+		return success(pdaMsdService.confirmSealBarcode(parseBarCode(bar_code)));
+	}
+
 }

+ 4 - 0
src/com/uas/mes/pda/service/PdaMsdService.java

@@ -25,4 +25,8 @@ public interface PdaMsdService {
 
 	Map<String, Object> confirmOutBox(String bar_code);
 
+	Map<String, Object> checkSealBarcode(String parseBarCode);
+
+	Map<String, Object> confirmSealBarcode(String parseBarCode);
+
 }

+ 49 - 3
src/com/uas/mes/pda/service/impl/PdaMsdServiceImpl.java

@@ -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;
+	}
 }

+ 2 - 2
src/com/uas/mes/pda/service/impl/PdaSMTServiceImpl.java

@@ -163,7 +163,7 @@ public class PdaSMTServiceImpl implements PdaSMTService {
 	public List<Map<String, Object>> getSmtLocation(int ps_id,String dl_table) {
 		SqlRowList rs = baseDao.queryForRowSet("select max(psl_prodcode)psl_prodcode,max(psl_feeder)psl_feeder, "
 				+"psl_location,psl_table, wm_concat(psl_repcode)psl_repcode from productsmt left join "
-				+"productsmtlocation on ps_id=psl_psid where ps_id=? and psl_table=? group by psl_location,psl_table"
+				+"productsmtlocation on ps_id=psl_psid where ps_id=? and psl_table=? group by psl_location,psl_table order by psl_location"
 				,ps_id,dl_table);
 		if(rs.next()){
 			return rs.getResultList();
@@ -1467,7 +1467,7 @@ 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) "
-		    		+" group by psl_location order by psl_detno)) where rownum<=20 ",linecode,ps_prodcode,table,linecode,macode,table);
+		    		+" group by psl_location order by psl_location)) where rownum<=20 ",linecode,ps_prodcode,table,linecode,macode,table);
 				if(rs.next()){
 					mapR.put("NotFeedLocation", rs.getResultList());
 				}else{