|
@@ -1,6 +1,9 @@
|
|
|
package com.steerinfo.dil.util;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
+import com.steerinfo.dil.wsdl.LoginUtil;
|
|
|
+import com.steerinfo.dil.wsdl.ServiceInfo;
|
|
|
+import com.steerinfo.dil.wsdl.WSContext;
|
|
|
import com.steerinfo.dil.wsdl.WSUpDaxingMeteringSystemFacadeSrvProxyServiceLocator;
|
|
|
import org.dom4j.Document;
|
|
|
import org.dom4j.DocumentHelper;
|
|
@@ -25,18 +28,26 @@ public class KDWebserviceUtil {
|
|
|
public static int sendMesToKD(Map<String, Object> map){
|
|
|
try {
|
|
|
String xml = asXmlData(map);
|
|
|
- Log4jUtils.toLoggerInfo(xml);
|
|
|
+ System.out.println(xml);
|
|
|
+ ServiceInfo service = new ServiceInfo("user", "dgjt@kingdee", "eas", "A004", "L2", 1);
|
|
|
+ service.setServername("172.16.62.243" , "8888");
|
|
|
+ WSContext wsContext = LoginUtil.doEASLogin(service);
|
|
|
+ String sessionId = wsContext.getSessionId();
|
|
|
+ if(null == sessionId) {
|
|
|
+ System.out.println("[error]: 登陆有问题");
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
WSUpDaxingMeteringSystemFacadeSrvProxyServiceLocator locator = new WSUpDaxingMeteringSystemFacadeSrvProxyServiceLocator();
|
|
|
String res = locator.getWSUpDaxingMeteringSystemFacade().saveWeighBill(xml);
|
|
|
Map returnMap = JSON.parseObject(res, Map.class);
|
|
|
if("S02".equals(String.valueOf(returnMap.get("Status")))){
|
|
|
return 1;
|
|
|
}else {
|
|
|
- Log4jUtils.toLoggerWarning(map.get("orderNumber")+ "数据推送金蝶失败:"+ returnMap.get("MessageText"));
|
|
|
+ System.out.println((map.get("orderNumber")+ "数据推送金蝶失败:"+ returnMap.get("MessageText")));
|
|
|
return 0;
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
- Log4jUtils.toLoggerWarning(map.get("orderNumber") + "数据推送金蝶失败:" + e.getMessage());
|
|
|
+ System.out.println(map.get("orderNumber") + "数据推送金蝶失败:" + e.getMessage());
|
|
|
return 0;
|
|
|
}
|
|
|
}
|