From e51c4eea7f81d38af354d2980e918b3fd093e126 Mon Sep 17 00:00:00 2001 From: 18110972313 <780768673@qq.com> Date: Fri, 16 May 2025 17:58:17 +0800 Subject: [PATCH] =?UTF-8?q?update=20MES=E7=89=A9=E6=96=99=E6=B6=88?= =?UTF-8?q?=E8=80=97=E6=8E=A5=E5=8F=A3=EF=BC=8C=E4=BF=AE=E6=94=B9SAP?= =?UTF-8?q?=E8=BF=87=E8=B4=A6=E6=97=A5=E6=9C=9F=E6=8A=A5=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/cim/idm/service/QMSService.java | 11 ++++++ .../cim/idm/service/impl/QMSServiceImpl.java | 38 +++++++++++++++++++ 2 files changed, 49 insertions(+) diff --git a/zi-wms-inf/src/main/java/com/cim/idm/service/QMSService.java b/zi-wms-inf/src/main/java/com/cim/idm/service/QMSService.java index 67d1f2e..17738c2 100644 --- a/zi-wms-inf/src/main/java/com/cim/idm/service/QMSService.java +++ b/zi-wms-inf/src/main/java/com/cim/idm/service/QMSService.java @@ -1,6 +1,7 @@ package com.cim.idm.service; +import com.cim.idm.framework.data.EventInfo; import com.cim.idm.wmsextend.generic.errorHandler.CustomException; /** @@ -17,4 +18,14 @@ public interface QMSService { */ String PreIQCInfoSend (String receiveActNo, String siteName, String opCode, String erpFactory) throws CustomException; + + /** + * 调用QMS质检接口 + * @param sendQMSUrl QMS质检url + * @param sendQMSJson QMS质检报文 + * @return QMS返回状态码 + * @throws CustomException + */ + String sendQMSByUrlJson (String sendQMSUrl,String sendQMSJson, EventInfo eventInfo) throws CustomException; + } diff --git a/zi-wms-inf/src/main/java/com/cim/idm/service/impl/QMSServiceImpl.java b/zi-wms-inf/src/main/java/com/cim/idm/service/impl/QMSServiceImpl.java index 55caf5c..f184706 100644 --- a/zi-wms-inf/src/main/java/com/cim/idm/service/impl/QMSServiceImpl.java +++ b/zi-wms-inf/src/main/java/com/cim/idm/service/impl/QMSServiceImpl.java @@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.cim.idm.data.ErpMessageLog; import com.cim.idm.framework.IDMFrameServiceProxy; +import com.cim.idm.framework.data.EventInfo; import com.cim.idm.framework.util.time.TimeStampUtil; import com.cim.idm.service.QMSService; import com.cim.idm.util.MessageLogUtil; @@ -568,4 +569,41 @@ public class QMSServiceImpl implements QMSService{ return code; } + + + /** + * 质检信息发送QMS + * @throws CustomException + */ + @Override + public String sendQMSByUrlJson(String sendQMSUrl, String sendQMSJson, EventInfo eventInfo) throws CustomException { + String httpPost = NCHttpUtil.httpPost(baseUrl + sendQMSUrl, sendQMSJson); + org.json.JSONObject jsonObject = new org.json.JSONObject(httpPost); + String code = jsonObject.getString("code"); + String msg = ""; + if (!"200".equals(code)) { + msg = jsonObject.getString("msg"); + } +// String msg = jsonObject.getString("msg"); + //JSONObject object = (JSONObject) jsonObject.get("data"); + Thread t = new Thread(new Runnable(){ + public void run(){ + // run方法具体重写 + UUID uuid = UUID.randomUUID(); + ErpMessageLog erplog = new ErpMessageLog(); + erplog.setEventUser(""); + erplog.setServerName("WmsToQMS"); + erplog.setEventName(eventInfo.getEventName()); + erplog.setId(uuid.toString()); + erplog.setInterfaceTime(ConvertUtil.getCurrTime("yyyy-MM-dd HH:mm:ss")); + erplog.setMessageId(UUID.randomUUID().toString()); + erplog.setSendMsg(sendQMSJson); + erplog.setReturnMsg2(httpPost.toString()); + erplog.setResultCode(code); + MessageLogUtil.writeMessageLog(erplog); + }}); + t.start(); + return msg; + + } }