27 changed files with 978 additions and 133 deletions
@ -0,0 +1,23 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<project version="4"> |
||||
|
<component name="fastRequestCollection"> |
||||
|
<option name="detail"> |
||||
|
<CollectionDetail> |
||||
|
<option name="childList"> |
||||
|
<list> |
||||
|
<CollectionDetail> |
||||
|
<option name="groupId" value="1" /> |
||||
|
<option name="id" value="1" /> |
||||
|
<option name="name" value="Default Group" /> |
||||
|
<option name="type" value="1" /> |
||||
|
</CollectionDetail> |
||||
|
</list> |
||||
|
</option> |
||||
|
<option name="groupId" value="-1" /> |
||||
|
<option name="id" value="0" /> |
||||
|
<option name="name" value="Root" /> |
||||
|
<option name="type" value="1" /> |
||||
|
</CollectionDetail> |
||||
|
</option> |
||||
|
</component> |
||||
|
</project> |
@ -0,0 +1,8 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<project version="4"> |
||||
|
<component name="fastRequestCurrentProjectConfig"> |
||||
|
<option name="domain" value="localhost:8011" /> |
||||
|
<option name="enableEnv" value="dev" /> |
||||
|
<option name="enableProject" value="community" /> |
||||
|
</component> |
||||
|
</project> |
@ -0,0 +1,6 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<project version="4"> |
||||
|
<component name="VcsDirectoryMappings"> |
||||
|
<mapping directory="$PROJECT_DIR$/.." vcs="Git" /> |
||||
|
</component> |
||||
|
</project> |
@ -1,33 +1,33 @@ |
|||||
/* |
///*
|
||||
* Copyright 2019-2020 Zheng Jie |
// * Copyright 2019-2020 Zheng Jie
|
||||
* |
// *
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
// * Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License. |
// * you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at |
// * You may obtain a copy of the License at
|
||||
* |
// *
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
// * http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
// *
|
||||
* Unless required by applicable law or agreed to in writing, software |
// * Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
// * distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
// * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and |
// * See the License for the specific language governing permissions and
|
||||
* limitations under the License. |
// * limitations under the License.
|
||||
*/ |
// */
|
||||
package org.nl.config; |
//package org.nl.config;
|
||||
|
//
|
||||
import org.springframework.context.annotation.Bean; |
//import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration; |
//import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.socket.server.standard.ServerEndpointExporter; |
//import org.springframework.web.socket.server.standard.ServerEndpointExporter;
|
||||
|
//
|
||||
/** |
///**
|
||||
* @author ZhangHouYing |
// * @author ZhangHouYing
|
||||
* @date 2019-08-24 15:44 |
// * @date 2019-08-24 15:44
|
||||
*/ |
// */
|
||||
@Configuration |
//@Configuration
|
||||
public class WebSocketConfig { |
//public class WebSocketConfig {
|
||||
|
//
|
||||
@Bean |
// @Bean
|
||||
public ServerEndpointExporter serverEndpointExporter() { |
// public ServerEndpointExporter serverEndpointExporter() {
|
||||
return new ServerEndpointExporter(); |
// return new ServerEndpointExporter();
|
||||
} |
// }
|
||||
} |
//}
|
||||
|
@ -0,0 +1,85 @@ |
|||||
|
package org.nl.wms.database.eas.controller; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.IdType; |
||||
|
import com.baomidou.mybatisplus.annotation.TableId; |
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
import com.baomidou.mybatisplus.extension.activerecord.Model; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
import lombok.ToString; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* {@code @Description:} (EasOutInBillDetail)实体类 |
||||
|
* {@code @Author:} gbx |
||||
|
* |
||||
|
* @since 2024-02-22 |
||||
|
*/ |
||||
|
@Data |
||||
|
@ToString |
||||
|
@EqualsAndHashCode(callSuper = false) |
||||
|
@SuppressWarnings("serial") |
||||
|
@TableName("InventoryInfo") |
||||
|
public class InventoryInfo extends Model<InventoryInfo> { |
||||
|
|
||||
|
private static final long serialVersionUID = -7739291296662381393L; |
||||
|
//@TableId(value = "id", type = IdType.NONE)
|
||||
|
|
||||
|
/** |
||||
|
* 主键id |
||||
|
*/ |
||||
|
@TableId(value = "id", type = IdType.NONE) |
||||
|
private String id; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 单据编号 |
||||
|
*/ |
||||
|
private String djbh; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 物料编码 |
||||
|
*/ |
||||
|
private String wlbm; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 物料名称 |
||||
|
*/ |
||||
|
private String wlmc; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 库位编码 |
||||
|
*/ |
||||
|
private String kwbm; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 库位名称 |
||||
|
*/ |
||||
|
private String kwmc; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 库位类型 |
||||
|
*/ |
||||
|
private String kwlx; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 数量 |
||||
|
*/ |
||||
|
private String sl; |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
@ -0,0 +1,295 @@ |
|||||
|
/** |
||||
|
* WSContext.java |
||||
|
* |
||||
|
* This file was auto-generated from WSDL |
||||
|
* by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. |
||||
|
*/ |
||||
|
|
||||
|
package org.nl.wms.ext.eas; |
||||
|
|
||||
|
public class WSContext implements java.io.Serializable { |
||||
|
private int dbType; |
||||
|
|
||||
|
private String dcName; |
||||
|
|
||||
|
private String password; |
||||
|
|
||||
|
private String sessionId; |
||||
|
|
||||
|
private String slnName; |
||||
|
|
||||
|
private String userName; |
||||
|
|
||||
|
public WSContext() { |
||||
|
} |
||||
|
|
||||
|
public WSContext( |
||||
|
int dbType, |
||||
|
String dcName, |
||||
|
String password, |
||||
|
String sessionId, |
||||
|
String slnName, |
||||
|
String userName) { |
||||
|
this.dbType = dbType; |
||||
|
this.dcName = dcName; |
||||
|
this.password = password; |
||||
|
this.sessionId = sessionId; |
||||
|
this.slnName = slnName; |
||||
|
this.userName = userName; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* Gets the dbType value for this WSContext. |
||||
|
* |
||||
|
* @return dbType |
||||
|
*/ |
||||
|
public int getDbType() { |
||||
|
return dbType; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* Sets the dbType value for this WSContext. |
||||
|
* |
||||
|
* @param dbType |
||||
|
*/ |
||||
|
public void setDbType(int dbType) { |
||||
|
this.dbType = dbType; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* Gets the dcName value for this WSContext. |
||||
|
* |
||||
|
* @return dcName |
||||
|
*/ |
||||
|
public String getDcName() { |
||||
|
return dcName; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* Sets the dcName value for this WSContext. |
||||
|
* |
||||
|
* @param dcName |
||||
|
*/ |
||||
|
public void setDcName(String dcName) { |
||||
|
this.dcName = dcName; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* Gets the password value for this WSContext. |
||||
|
* |
||||
|
* @return password |
||||
|
*/ |
||||
|
public String getPassword() { |
||||
|
return password; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* Sets the password value for this WSContext. |
||||
|
* |
||||
|
* @param password |
||||
|
*/ |
||||
|
public void setPassword(String password) { |
||||
|
this.password = password; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* Gets the sessionId value for this WSContext. |
||||
|
* |
||||
|
* @return sessionId |
||||
|
*/ |
||||
|
public String getSessionId() { |
||||
|
return sessionId; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* Sets the sessionId value for this WSContext. |
||||
|
* |
||||
|
* @param sessionId |
||||
|
*/ |
||||
|
public void setSessionId(String sessionId) { |
||||
|
this.sessionId = sessionId; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* Gets the slnName value for this WSContext. |
||||
|
* |
||||
|
* @return slnName |
||||
|
*/ |
||||
|
public String getSlnName() { |
||||
|
return slnName; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* Sets the slnName value for this WSContext. |
||||
|
* |
||||
|
* @param slnName |
||||
|
*/ |
||||
|
public void setSlnName(String slnName) { |
||||
|
this.slnName = slnName; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* Gets the userName value for this WSContext. |
||||
|
* |
||||
|
* @return userName |
||||
|
*/ |
||||
|
public String getUserName() { |
||||
|
return userName; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* Sets the userName value for this WSContext. |
||||
|
* |
||||
|
* @param userName |
||||
|
*/ |
||||
|
public void setUserName(String userName) { |
||||
|
this.userName = userName; |
||||
|
} |
||||
|
|
||||
|
private Object __equalsCalc = null; |
||||
|
public synchronized boolean equals(Object obj) { |
||||
|
if (!(obj instanceof WSContext)) return false; |
||||
|
WSContext other = (WSContext) obj; |
||||
|
if (obj == null) return false; |
||||
|
if (this == obj) return true; |
||||
|
if (__equalsCalc != null) { |
||||
|
return (__equalsCalc == obj); |
||||
|
} |
||||
|
__equalsCalc = obj; |
||||
|
boolean _equals; |
||||
|
_equals = true && |
||||
|
this.dbType == other.getDbType() && |
||||
|
((this.dcName==null && other.getDcName()==null) || |
||||
|
(this.dcName!=null && |
||||
|
this.dcName.equals(other.getDcName()))) && |
||||
|
((this.password==null && other.getPassword()==null) || |
||||
|
(this.password!=null && |
||||
|
this.password.equals(other.getPassword()))) && |
||||
|
((this.sessionId==null && other.getSessionId()==null) || |
||||
|
(this.sessionId!=null && |
||||
|
this.sessionId.equals(other.getSessionId()))) && |
||||
|
((this.slnName==null && other.getSlnName()==null) || |
||||
|
(this.slnName!=null && |
||||
|
this.slnName.equals(other.getSlnName()))) && |
||||
|
((this.userName==null && other.getUserName()==null) || |
||||
|
(this.userName!=null && |
||||
|
this.userName.equals(other.getUserName()))); |
||||
|
__equalsCalc = null; |
||||
|
return _equals; |
||||
|
} |
||||
|
|
||||
|
private boolean __hashCodeCalc = false; |
||||
|
public synchronized int hashCode() { |
||||
|
if (__hashCodeCalc) { |
||||
|
return 0; |
||||
|
} |
||||
|
__hashCodeCalc = true; |
||||
|
int _hashCode = 1; |
||||
|
_hashCode += getDbType(); |
||||
|
if (getDcName() != null) { |
||||
|
_hashCode += getDcName().hashCode(); |
||||
|
} |
||||
|
if (getPassword() != null) { |
||||
|
_hashCode += getPassword().hashCode(); |
||||
|
} |
||||
|
if (getSessionId() != null) { |
||||
|
_hashCode += getSessionId().hashCode(); |
||||
|
} |
||||
|
if (getSlnName() != null) { |
||||
|
_hashCode += getSlnName().hashCode(); |
||||
|
} |
||||
|
if (getUserName() != null) { |
||||
|
_hashCode += getUserName().hashCode(); |
||||
|
} |
||||
|
__hashCodeCalc = false; |
||||
|
return _hashCode; |
||||
|
} |
||||
|
|
||||
|
// Type metadata
|
||||
|
private static org.apache.axis.description.TypeDesc typeDesc = |
||||
|
new org.apache.axis.description.TypeDesc(WSContext.class, true); |
||||
|
|
||||
|
static { |
||||
|
typeDesc.setXmlType(new javax.xml.namespace.QName("urn:client", "WSContext")); |
||||
|
org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); |
||||
|
elemField.setFieldName("dbType"); |
||||
|
elemField.setXmlName(new javax.xml.namespace.QName("", "dbType")); |
||||
|
elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "int")); |
||||
|
elemField.setNillable(false); |
||||
|
typeDesc.addFieldDesc(elemField); |
||||
|
elemField = new org.apache.axis.description.ElementDesc(); |
||||
|
elemField.setFieldName("dcName"); |
||||
|
elemField.setXmlName(new javax.xml.namespace.QName("", "dcName")); |
||||
|
elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); |
||||
|
elemField.setNillable(true); |
||||
|
typeDesc.addFieldDesc(elemField); |
||||
|
elemField = new org.apache.axis.description.ElementDesc(); |
||||
|
elemField.setFieldName("password"); |
||||
|
elemField.setXmlName(new javax.xml.namespace.QName("", "password")); |
||||
|
elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); |
||||
|
elemField.setNillable(true); |
||||
|
typeDesc.addFieldDesc(elemField); |
||||
|
elemField = new org.apache.axis.description.ElementDesc(); |
||||
|
elemField.setFieldName("sessionId"); |
||||
|
elemField.setXmlName(new javax.xml.namespace.QName("", "sessionId")); |
||||
|
elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); |
||||
|
elemField.setNillable(true); |
||||
|
typeDesc.addFieldDesc(elemField); |
||||
|
elemField = new org.apache.axis.description.ElementDesc(); |
||||
|
elemField.setFieldName("slnName"); |
||||
|
elemField.setXmlName(new javax.xml.namespace.QName("", "slnName")); |
||||
|
elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); |
||||
|
elemField.setNillable(true); |
||||
|
typeDesc.addFieldDesc(elemField); |
||||
|
elemField = new org.apache.axis.description.ElementDesc(); |
||||
|
elemField.setFieldName("userName"); |
||||
|
elemField.setXmlName(new javax.xml.namespace.QName("", "userName")); |
||||
|
elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); |
||||
|
elemField.setNillable(true); |
||||
|
typeDesc.addFieldDesc(elemField); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* Return type metadata object |
||||
|
*/ |
||||
|
public static org.apache.axis.description.TypeDesc getTypeDesc() { |
||||
|
return typeDesc; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* Get Custom Serializer |
||||
|
*/ |
||||
|
public static org.apache.axis.encoding.Serializer getSerializer( |
||||
|
String mechType, |
||||
|
Class _javaType, |
||||
|
javax.xml.namespace.QName _xmlType) { |
||||
|
return |
||||
|
new org.apache.axis.encoding.ser.BeanSerializer( |
||||
|
_javaType, _xmlType, typeDesc); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* Get Custom Deserializer |
||||
|
*/ |
||||
|
public static org.apache.axis.encoding.Deserializer getDeserializer( |
||||
|
String mechType, |
||||
|
Class _javaType, |
||||
|
javax.xml.namespace.QName _xmlType) { |
||||
|
return |
||||
|
new org.apache.axis.encoding.ser.BeanDeserializer( |
||||
|
_javaType, _xmlType, typeDesc); |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,88 @@ |
|||||
|
package org.nl.wms.ext.eas; |
||||
|
|
||||
|
|
||||
|
import com.alibaba.fastjson2.JSON; |
||||
|
import com.alibaba.fastjson2.JSONObject; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.apache.axis.client.Call; |
||||
|
import org.apache.axis.client.Service; |
||||
|
import org.apache.axis.message.SOAPHeaderElement; |
||||
|
|
||||
|
import javax.xml.namespace.QName; |
||||
|
|
||||
|
/** |
||||
|
* WmsToEasService |
||||
|
* |
||||
|
* @author gbx |
||||
|
* @since 2024-03-29 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
public class WmsToEasService { |
||||
|
|
||||
|
public static void sendWebService(String json) { |
||||
|
try { |
||||
|
String http = "http://192.168.100.100:8080/ormrpc/services/"; |
||||
|
//用户
|
||||
|
String user = "user"; |
||||
|
//密码
|
||||
|
String password = "Noble123!9"; |
||||
|
//数据中心
|
||||
|
String datacenter = "test"; |
||||
|
//服务
|
||||
|
String wsdlservice = "WSNLMESFacade"; |
||||
|
//方法
|
||||
|
String operationName = "dealTask"; |
||||
|
try { |
||||
|
String[] msg = null; |
||||
|
Service s = new Service(); |
||||
|
Call call = (Call) s.createCall(); |
||||
|
call.setOperationName("login"); |
||||
|
//登录的webservice的wsdl的地址
|
||||
|
call.setTargetEndpointAddress(http + "EASLogin?wsdl"); |
||||
|
call.setReturnType(new QName("urn:client", "WSContext")); |
||||
|
//本地根据wsdl文件建立的返回对象
|
||||
|
call.setReturnClass(WSContext.class); |
||||
|
call.setReturnQName(new QName("", "loginReturn")); |
||||
|
//超时时间 自由配置
|
||||
|
call.setTimeout(1000 * 60); |
||||
|
call.setMaintainSession(true); |
||||
|
WSContext result = null; |
||||
|
//解决方案:eas
|
||||
|
//语言:L2 简体中文 L3 繁体中文
|
||||
|
//数据库类型:0 SQL Server 1 Oracle 2 DB2
|
||||
|
result = (WSContext) call.invoke(new Object[]{user, password, "eas", datacenter, "L2", 1, "BaseDB"}); |
||||
|
//关键点,获取登录时返回的sessionid
|
||||
|
String sessionId = result.getSessionId(); |
||||
|
System.out.println(sessionId); |
||||
|
//登录失败抛出异常
|
||||
|
if (sessionId == null) { |
||||
|
log.error("sendWebService调用结果"+"login Eas Fail"); |
||||
|
throw new Exception("login Eas Fail"); |
||||
|
} |
||||
|
call.clearOperation(); |
||||
|
//超时时间 自由配置
|
||||
|
call.setTimeout(1000 * 60); |
||||
|
call.setMaintainSession(true); |
||||
|
call.setTargetEndpointAddress(http + wsdlservice + "?wsdl"); |
||||
|
call.setReturnQName(new QName("", "dealTaskReturn")); |
||||
|
//具体某个方法
|
||||
|
call.setOperationName(operationName); |
||||
|
//关键点 传sessionid
|
||||
|
call.addHeader(new SOAPHeaderElement("http://login.webservice.bos.kingdee.com", "SessionId", sessionId)); |
||||
|
//接口报文
|
||||
|
Object invoke = call.invoke(new Object[]{json}); |
||||
|
JSONObject jsonObject = JSON.parseObject((String) invoke); |
||||
|
int results = jsonObject.getIntValue("result"); |
||||
|
log.error("sendWebService调用:"+"调用成功!"); |
||||
|
log.error("sendWebService调用结果:"+invoke.toString()); |
||||
|
log.error("sendWebService调用结果:"+results); |
||||
|
System.out.println(invoke); |
||||
|
} catch (Exception e) { |
||||
|
log.error("sendWebService调用结果:"+e.toString()); |
||||
|
e.printStackTrace(); |
||||
|
} |
||||
|
} finally { |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
} |
@ -0,0 +1,110 @@ |
|||||
|
package org.nl.test; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.apache.axis.message.SOAPHeaderElement; |
||||
|
import org.junit.jupiter.api.DisplayName; |
||||
|
import org.junit.jupiter.api.Test; |
||||
|
import org.junit.jupiter.api.extension.ExtendWith; |
||||
|
import org.nl.wms.database.eas.dao.EasOutInBill; |
||||
|
import org.nl.wms.database.eas.dao.EasOutInBillDetail; |
||||
|
import org.nl.wms.database.eas.service.IeasOutInBillService; |
||||
|
import org.nl.wms.ext.eas.WSContext; |
||||
|
import org.springframework.boot.test.context.SpringBootTest; |
||||
|
import org.springframework.test.context.junit.jupiter.SpringExtension; |
||||
|
import org.apache.axis.client.Call; |
||||
|
import org.apache.axis.client.Service; |
||||
|
|
||||
|
import javax.annotation.Resource; |
||||
|
import javax.xml.namespace.QName; |
||||
|
import java.util.HashSet; |
||||
|
import java.util.List; |
||||
|
import java.util.Set; |
||||
|
import java.util.stream.Collectors; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* @author LuJ |
||||
|
* @date 2022-03-30 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@ExtendWith(SpringExtension.class) |
||||
|
@SpringBootTest |
||||
|
@DisplayName("event test") |
||||
|
public class EventTest { |
||||
|
|
||||
|
@Resource |
||||
|
private IeasOutInBillService easOutInBillService; |
||||
|
|
||||
|
@Test |
||||
|
public void getEasOutInBills() { |
||||
|
// //Eas视图查询未提交的单据
|
||||
|
// List<EasOutInBill> easOutInBillDetail = easOutInBillService.getEasBills();
|
||||
|
// if (!easOutInBillDetail.isEmpty()) {
|
||||
|
// //本地查询未提交的单据
|
||||
|
// Set<String> existingId = new HashSet<>(easOutInBillService.queryExistBills());
|
||||
|
// List<EasOutInBillDetail> insertBills = easOutInBillDetail.stream()
|
||||
|
// .filter(e -> !existingId.contains(e.getDjid())).map(e ->
|
||||
|
// {
|
||||
|
// //oracle实体转换
|
||||
|
// EasOutInBillDetail workorder = new EasOutInBillDetail();
|
||||
|
// workorder.setBtbz(e.getBtbz());
|
||||
|
// return workorder;
|
||||
|
// }).collect(Collectors.toList());
|
||||
|
// if (insertBills.size() > 0) {
|
||||
|
// easOutInBillService.createBills(insertBills);
|
||||
|
// }
|
||||
|
// }
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
@Test |
||||
|
public void webServiceTest() { |
||||
|
String http="http://188.188.5.18:6888/ormrpc/services/"; |
||||
|
String user = "user"; //用户
|
||||
|
String password = "noble123666"; //密码
|
||||
|
String datacenter = "cs"; //数据中心
|
||||
|
String wsdlservice = "WSNLMESFacade"; //服务
|
||||
|
String operationName = "dealTask"; //方法
|
||||
|
try{ |
||||
|
String[] msg = null; |
||||
|
Service s = new Service(); |
||||
|
Call call=(Call)s.createCall(); |
||||
|
call.setOperationName("login"); |
||||
|
call.setTargetEndpointAddress(http + "EASLogin?wsdl"); //登录的webservice的wsdl的地址
|
||||
|
call.setReturnType(new QName("urn:client","WSContext")); |
||||
|
call.setReturnClass(WSContext.class);//本地根据wsdl文件建立的返回对象
|
||||
|
call.setReturnQName(new QName("","loginReturn")); |
||||
|
call.setTimeout(1000*60); //超时时间 自由配置
|
||||
|
call.setMaintainSession(true); |
||||
|
WSContext result = null; |
||||
|
//解决方案:eas
|
||||
|
//语言:L2 简体中文 L3 繁体中文
|
||||
|
//数据库类型:0 SQL Server 1 Oracle 2 DB2
|
||||
|
result = (WSContext)call.invoke(new Object[]{user,password,"eas", datacenter,"L2",1,"BaseDB"}); |
||||
|
String sessionId = result.getSessionId(); //关键点,获取登录时返回的sessionid
|
||||
|
System.out.println(sessionId); |
||||
|
if(sessionId == null){ //登录失败抛出异常
|
||||
|
throw new Exception("login Eas Fail"); |
||||
|
} |
||||
|
call.clearOperation(); |
||||
|
call.setTimeout(1000*60); //超时时间 自由配置
|
||||
|
call.setMaintainSession(true); |
||||
|
call.setTargetEndpointAddress(http+wsdlservice+"?wsdl"); |
||||
|
call.setReturnQName(new QName("","dealTaskReturn")); |
||||
|
call.setOperationName(operationName); //具体某个方法
|
||||
|
call.addHeader(new SOAPHeaderElement("http://login.webservice.bos.kingdee.com","SessionId",sessionId));//关键点 传sessionid
|
||||
|
String json = ""; //接口报文
|
||||
|
Object invoke = call.invoke(new Object[]{json}); |
||||
|
System.out.println(invoke); |
||||
|
}catch(Exception e){ |
||||
|
e.printStackTrace(); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
Loading…
Reference in new issue