From 30155d34eade43e1713ee1022a9af4d4744acda1 Mon Sep 17 00:00:00 2001 From: LSH Date: 星期一, 13 二月 2023 17:27:27 +0800 Subject: [PATCH] # --- src/main/java/com/zy/asrs/task/handler/StandingHandler.java | 47 ++++------------------------------------------- 1 files changed, 4 insertions(+), 43 deletions(-) diff --git a/src/main/java/com/zy/asrs/task/handler/StandingHandler.java b/src/main/java/com/zy/asrs/task/handler/StandingHandler.java index 7611e9f..0cfdb7f 100644 --- a/src/main/java/com/zy/asrs/task/handler/StandingHandler.java +++ b/src/main/java/com/zy/asrs/task/handler/StandingHandler.java @@ -12,6 +12,7 @@ import com.zy.asrs.service.*; import com.zy.asrs.task.AbstractHandler; import com.zy.asrs.task.core.ReturnT; +import com.zy.asrs.utils.PostMesDataUtils; import com.zy.common.constant.MesConstant; import com.zy.common.model.enums.WorkNoType; import com.zy.common.service.CommonService; @@ -62,7 +63,7 @@ List<LocMast> locMasts = locMastService.selectList(new EntityWrapper<LocMast>() .eq("fire_status", 0) .eq("loc_sts", "F") - .eq("pack_status", 4)); + .eq("pack_status", 5)); Integer ioType = 101; //鍏ュ嚭搴撶被鍨� //闈欑疆瀹屾垚鍑哄簱绔�104 for(LocMast locMast : locMasts){ @@ -115,14 +116,14 @@ if (locMast.getLocSts().equals("F")) { locMast.setLocSts("R"); locMast.setModiTime(now); - locMast.setPackStatus(5); //5:闈欑疆瀹屾垚 + locMast.setPackStatus(6); //6:闈欑疆瀹屾垚 CombParam combParam = new CombParam(); combParam.setPackNo(locMast.getBarcode()); combParam.setLocNo(locMast.getLocNo()); combParam.setPackSts(6); combParam.setRequestTime(DateUtils.convert(new Date())); - postMesData(inpath,combParam); + new PostMesDataUtils().postMesData("MES绯荤粺",mesUrl,inpath,combParam); if (!locMastService.updateById(locMast)) { throw new CoolException("棰勭害搴撲綅鐘舵�佸け璐ワ紝搴撲綅鍙凤細"+locMast.getLocNo()); @@ -139,46 +140,6 @@ e.printStackTrace(); TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); return FAIL.setMsg(e.getMessage()); - } - return SUCCESS; - } - private ReturnT<String> postMesData(String mesPath,Object combParam){ - if(combParam != null){ - String response = ""; - boolean success = false; - try { - response = new HttpHandler.Builder() - .setUri(mesUrl) - .setPath(mesPath) - .setJson(JSON.toJSONString(combParam)) - .build() - .doPost(); - JSONObject jsonObject = JSON.parseObject(response); - if (jsonObject.getInteger("code").equals(200)) { - success = true; - } else { - log.error("璇锋眰鎺ュ彛澶辫触锛侊紒锛乽rl锛歿}锛況equest锛歿}锛況esponse锛歿}", mesUrl+mesPath, JSON.toJSONString(combParam), response); - throw new CoolException("涓婃姤mes绯荤粺澶辫触"); - } - } catch (Exception e) { - log.error("fail", e); -// TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); - return FAIL.setMsg(e.getMessage()); - } finally { - try { - // 淇濆瓨鎺ュ彛鏃ュ織 - // MesConstant.URL + MesConstant.PAKIN_URL, - apiLogService.save( - "涓婃姤mes绯荤粺", - mesUrl + mesPath, - null, - "127.0.0.1", - JSON.toJSONString(combParam), - response, - success - ); - } catch (Exception e) { log.error("", e); } - } } return SUCCESS; } -- Gitblit v1.9.1