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