txf 3 лет назад
Родитель
Сommit
e0b4f0c925

+ 16 - 4
src/main/java/com/steerinfo/dil/controller/TmstruckWeightResultController.java

@@ -32,14 +32,15 @@ public class TmstruckWeightResultController extends BaseRESTfulController {
 
 
     /**
-     * 接收计量实绩(计量实绩)
+     * 接收达钢计量数据
+     * @Author TXF
+     * @Date 2022/2/9 15:04
      * @param mapList
      * @return
-     */
+     **/
     @ApiModelProperty(value = "接收计量实绩")
     @ApiOperation(value = "接收计量实绩")
     @ApiParam(name = "orderNumber")
-
     @ApiImplicitParams({
             @ApiImplicitParam(
                     name = "orderNumber", value = "运输订单号", required = true, dataType = "String"
@@ -62,9 +63,20 @@ public class TmstruckWeightResultController extends BaseRESTfulController {
     )
     }
     )
+    @PostMapping("/receiveTmsTruckWeightResultByDaGang")
+    public RESTfulResult receiveTmsTruckWeightResultByDaGang(@RequestBody(required = false) List<Map<String, Object>> mapList) {
+        String s = tmstruckWeightResultServiceImpl.receiveTmsTruckWeightResultByDaGang(mapList);
+        return success(s);
+    }
+
+    /**
+     * 接收达兴计量实绩(计量实绩)
+     * @param mapList
+     * @return
+     */
     @PostMapping("/receiveTmsTruckWeightResult")
     public RESTfulResult receiveTmsTruckWeightResult(@RequestBody(required = false) List<Map<String, Object>> mapList) {
-        String s = tmstruckWeightResultServiceImpl.receiveTmsTruckWeightResult(mapList);
+        String s = tmstruckWeightResultServiceImpl.receiveTmsTruckWeightResultByDaXing(mapList);
         return success(s);
     }
 

+ 3 - 0
src/main/java/com/steerinfo/dil/mapper/TmstruckWeightResultMapper.java

@@ -39,4 +39,7 @@ public interface TmstruckWeightResultMapper extends IBaseMapper<TmstruckWeightRe
 
     //通过订单Id查询还没有净重的计量实绩
     Integer selectNoNetWeightResult(String orderNumber);
+
+    //查询采购订单信息
+    Map<String, Object> getPurOrderMesToKD(String orderNumber);
 }

+ 11 - 2
src/main/java/com/steerinfo/dil/service/ITmstruckWeightResultService.java

@@ -25,9 +25,18 @@ import java.util.Map;
 public interface ITmstruckWeightResultService {
 
     /**
-     * 接收计量实绩信息
+     * 接收达钢计量实绩信息
      * @param mapList
      * @return
      */
-    String receiveTmsTruckWeightResult(List<Map<String, Object>> mapList);
+    String receiveTmsTruckWeightResultByDaGang(List<Map<String, Object>> mapList);
+
+    /**
+     * 接收达兴计量实绩信息
+     * @Author TXF
+     * @Date 2022/2/9 14:56
+     * @param mapList
+     * @return
+     **/
+    String receiveTmsTruckWeightResultByDaXing(List<Map<String, Object>> mapList);
 }

+ 106 - 10
src/main/java/com/steerinfo/dil/service/impl/TmstruckWeightResultServiceImpl.java

@@ -9,19 +9,16 @@ import com.steerinfo.dil.model.TmstruckWeightResult;
 import com.steerinfo.dil.mapper.TmstruckWeightResultMapper;
 import com.steerinfo.dil.service.ITmstruckWeightResultService;
 import com.steerinfo.dil.util.DataChange;
+import com.steerinfo.dil.util.KDWebserviceUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
-import java.util.Arrays;
-import java.util.Date;
+import java.util.*;
 import java.math.BigDecimal;
 
-import java.util.List;
-import java.util.Map;
-
 /**
  * TmstruckWeightResult服务实现:
  * @author generator
@@ -53,8 +50,15 @@ public class TmstruckWeightResultServiceImpl implements ITmstruckWeightResultSer
     @Autowired
     TmstrainWeightResultMapper tmstrainWeightResultMapper;
 
+
+    //属于采购订单的订单类型(先计毛后计皮)
+    final private List<Integer> judgeOrderTypeList = Arrays.asList(5, 6, 7, 8, 9, 12, 14,15, 17, 18);
+
+    //老厂区需要给金蝶回传的数据订单类型
+    final private List<Integer> judgeToKDTypeList = Arrays.asList(6, 17);
+
     /**
-     * 接收计量实绩信息
+     * 接收达钢计量实绩信息
      *      "orderNumber":"WYSDD2021091000000002",
      *      "resultTareCalculateNumber":"1号汽车衡",
      *      "resultCrossCalculateNumber":"1号汽车衡",
@@ -70,7 +74,7 @@ public class TmstruckWeightResultServiceImpl implements ITmstruckWeightResultSer
      */
     @Override
     @Transactional
-    public String receiveTmsTruckWeightResult(List<Map<String, Object>> mapList){
+    public String receiveTmsTruckWeightResultByDaGang(List<Map<String, Object>> mapList){
         //遍历列表
         StringBuilder sb = new StringBuilder();
         for (Map<String, Object> map : mapList) {
@@ -81,12 +85,31 @@ public class TmstruckWeightResultServiceImpl implements ITmstruckWeightResultSer
                 sb.append(addTrainWeightResult(map));
             }else {
                 //走汽车衡
+                map.put("needCheckToKD", "1"); //老厂区专属变量 用于区分新、老厂区 老厂区需要给金蝶传输数据
                 sb.append(addTruckWeightResult(map));
             }
         }
         return sb.toString();
     }
 
+    /*
+     * 接收达兴计量实绩
+     * @Author TXF
+     * @Date 2022/2/9 14:57
+     * @param mapList
+     * @return
+     **/
+    @Transactional
+    @Override
+    public String receiveTmsTruckWeightResultByDaXing(List<Map<String, Object>> mapList) {
+        StringBuilder sb = new StringBuilder();
+        //遍历列表
+        for (Map<String, Object> map : mapList) {
+            sb.append(addTruckWeightResult(map));
+        }
+        return sb.toString();
+    }
+
     /**
      * 添加汽车衡计量实绩
      * @param map
@@ -109,15 +132,27 @@ public class TmstruckWeightResultServiceImpl implements ITmstruckWeightResultSer
         } catch (Exception e) {
             return e.getMessage();
         }
+        //如果含有这个变量则代表是老区订单需要判断是否回传给金蝶
+        if(map.get("needCheckToKD") != null){
+            if(map.get("resultNetWeight") != null){
+                String resultNetWeight = String.valueOf(map.get("resultNetWeight")); //如果净重不为空  或者净重不为0
+                if(!"null".equals(resultNetWeight) && !"".equals(resultNetWeight) && !"0".equals(resultNetWeight)){
+                    Integer orderType = DataChange.dataToBigDecimal(stringObjectMap.get("orderTypee")).intValue();
+                    if(judgeToKDTypeList.contains(orderType)){
+                        //回传数据给金蝶方法 返回1即为回传成功
+                        if(sendMesToKD(map, orderType) != 1){
+                            return map.get("orderNumber") + ":回传金蝶失败";
+                        }
+                    }
+                }
+            }
+        }
         tmstruckWeightResultMapper.updateByPrimaryKeySelective(tmstruckWeightResult);
         //推送数据
         utilsService.pushMesToWebsocket((String) stringObjectMap.get("capacityNumber"), "计量");
         return map.get("orderNumber") + "成功";
     }
 
-    //属于采购订单的订单类型(先计毛后计皮)
-    final private List<Integer> judgeOrderTypeList = Arrays.asList(5, 6, 7, 8, 9, 12, 14,15, 17, 18);
-
     /**
      * 生成汽运计量实体类
      * @Author TXF
@@ -414,4 +449,65 @@ public class TmstruckWeightResultServiceImpl implements ITmstruckWeightResultSer
     }
 
 
+    /**
+     * 回传数据给金蝶方法
+     * @Author TXF
+     * @Date 2022/2/9 15:46
+     * @param
+     * @return
+     **/
+    public int sendMesToKD(Map<String, Object> map, Integer orderType){
+        String orderNumber = (String) map.get("orderNumber");
+        Map<String, Object> mesMap = new HashMap<>();
+        switch (orderType){
+            case 1:
+            case 2:
+            case 3:
+            case 4:
+            case 5:
+            case 6:
+                //查询订单信息
+                mesMap = tmstruckWeightResultMapper.getPurOrderMesToKD(orderNumber);
+                break;
+            case 7:
+            case 8:
+            case 9:
+            case 10:
+            case 11:
+            case 12:
+            case 13:
+            case 14:
+            case 15:
+            case 16:
+            case 17:
+            case 18:
+        }
+        //将数据排序获得顺序的list
+        List<String> mesList = getMesList(map, mesMap);
+        //访问金蝶接口
+        return KDWebserviceUtil.sendMesToKD(mesList, orderNumber);
+    }
+
+    /**
+     * 上面方法的儿子方法
+     * @Author TXF
+     * @Date 2022/2/10 15:46
+     * @param map
+     * @param mesMap
+     * @return
+     **/
+    public List<String> getMesList(Map<String, Object> map, Map<String, Object> mesMap){
+        List<String> list = new ArrayList<>();
+        //按照顺序添加
+        list.add((String) map.get("resultPoundNo"));//磅单号
+        list.add((String) mesMap.get("capacityNumber")); //车牌号
+        list.add((String) map.get("resultCrossWeight")); //毛重
+        list.add((String) map.get("resultCrossWeightTime")); //毛重时间
+        list.add((String) map.get("resultTareWeight")); //皮重
+        list.add((String) map.get("resultTareWeightTime")); //皮重时间
+        list.add((String) map.get("resultNetWeight")); //净重
+        list.add((String) mesMap.get("No")); //采购、销售订单号
+        list.add((String) mesMap.get("easEntryId")); //采购、销售订单分录Id
+        return list;
+    }
 }

+ 138 - 0
src/main/java/com/steerinfo/dil/util/KDWebserviceUtil.java

@@ -0,0 +1,138 @@
+package com.steerinfo.dil.util;
+
+import com.steerinfo.dil.wsdl.WSJJBoomFacadeSrvProxyServiceLocator;
+import org.dom4j.Document;
+import org.dom4j.DocumentHelper;
+import org.dom4j.Element;
+
+import java.util.List;
+
+/**
+ * @ author    :TXF
+ * @ time      :2022/2/10 10:07
+ */
+
+public class KDWebserviceUtil {
+    /**
+     *
+     * 推送数据给金蝶接口
+     * @Author TXF
+     * @Date 2022/2/10 17:16
+     * @param dataList 9个数据
+     * @return Integer   1 成功  0 失败
+     **/
+    public static int sendMesToKD(List<String> dataList, String orderNumber){
+        try {
+            String xml = asXmlData(dataList);
+            Log4jUtils.toLoggerInfo(xml);
+            WSJJBoomFacadeSrvProxyServiceLocator locator = new WSJJBoomFacadeSrvProxyServiceLocator();
+            String res = locator.getWSJJBoomFacade().transferEASInterfaceMethod(xml,"weighSoucNew");
+            if("OK".equals(res)){
+                return 1;
+            }else {
+                Log4jUtils.toLoggerWarning(orderNumber+ "数据推送金蝶失败:"+ res);
+                return 0;
+            }
+        } catch (Exception e) {
+            Log4jUtils.toLoggerWarning(orderNumber + "数据推送金蝶失败:" + e.getMessage());
+            return 0;
+        }
+    }
+
+
+    /**
+     * 创建计量数据 金蝶xml格式字符串
+     * @Author TXF
+     * @Date 2022/2/10 17:32
+     * @param dataList
+     * @return
+     **/
+    public static String asXmlData(List<String> dataList){
+        // 创建一个Document实例
+        Document doc = DocumentHelper.createDocument();
+        // 添加根节点
+        Element table = doc.addElement("table");
+        //添加第子节点
+        table.addElement("rowCount").addText("1");
+        int size = dataList.size();
+        table.addElement("headCount").addText(size + "");
+        Element head = table.addElement("head");
+        //添加body下的r1下的子节点
+        Element r1 = table.addElement("body").addElement("r1");
+        //添加head的子节点
+        for (int i = 0; i < size; i++) {
+            head.addElement("h" + (i + 1)).addText(dataList.get(i));
+            r1.addElement("r1c" + (i + 1)).addText(dataList.get(i));
+        }
+        return doc.asXML();
+    }
+
+
+}
+
+
+
+
+/**
+ * 封装的访问webservice的工具类:(有局限性,数据量小的xml报文可用,较大则会出现stackoverflow的异常)
+ *
+ * @param reqXML
+ *            请求的xml
+ * @param endPoint
+ *            webservice的路径除去?wsdl:例如:http://1.202.235.66:7002/webService/PartsService(没有?wsdl)
+ * @param namespace
+ *            名称空间
+ * @param method
+ *            方法名称
+ * @return	返回报文结果(xml)
+ */
+//    public static String loadWebService(String reqXML, String endPoint, String namespace, String method) {
+//        String responseXml = "";
+//        RPCServiceClient serviceClient = null;
+//        try {
+//            /* 调用理赔系统的接口 */
+//            String nameSpace = namespace;
+//            QName qname = new QName(nameSpace, method);
+//            serviceClient = new RPCServiceClient();
+//            Options options = serviceClient.getOptions();
+//            EndpointReference targetEPR = new EndpointReference(endPoint);
+//            options.setTo(targetEPR);
+//            options.setTimeOutInMilliSeconds(30000);
+//            Object[] rtnObjs = serviceClient.invokeBlocking(qname, new Object[] { reqXML },
+//                    new Class[] { String.class });
+//            responseXml = rtnObjs[0].toString();
+//        } catch (Exception e) {
+//            e.toString();
+//        }
+//        return responseXml;
+//    }
+
+/**
+ * axis方式访问webservice
+ *
+ * @param
+ *            请求的xml的报文
+ * @param
+ *            webservice的wsdl地址,例如:http://1.202.235.66:7002/webService/PartsService?wsdl
+ * @param
+ *            调用方法的命名空间
+ * @param
+ *            调用的方法名
+ * @return 返回调用的报文(xml)
+ *
+ */
+//    public static String invokRemoveWSDLByAxis(String reqXML, String endPoint, String namespace, String method) {
+//        String responseXML = "";
+//        Service service = new Service();
+//        try {
+//            Call call = (Call) service.createCall();
+//            call.setTargetEndpointAddress(endPoint);
+//            call.setOperationName(new javax.xml.namespace.QName(namespace, method));
+//            call.addParameter("arg0", XMLType.XSD_STRING, ParameterMode.IN);
+//            call.setReturnType(XMLType.XSD_STRING);
+//            responseXML = (String) call.invoke(new Object[] { reqXML });
+//        } catch (Exception e) {
+//            e.printStackTrace();
+//        }
+//        return responseXML;
+//    }

+ 42 - 0
src/main/java/com/steerinfo/dil/util/Log4jUtils.java

@@ -0,0 +1,42 @@
+package com.steerinfo.dil.util;
+
+import org.apache.poi.ss.formula.functions.T;
+import sun.reflect.CallerSensitive;
+import sun.reflect.Reflection;
+
+import java.util.logging.Logger;
+
+/**
+ * @ author    :TXF
+ * @ time      :2022/2/10 21:08
+ */
+
+public class Log4jUtils {
+
+    public static Logger logger = null;
+
+    /**
+     * 输出日志信息
+     * @Author TXF
+     * @Date 2022/2/10 21:47
+     * @param mes
+     * @return
+     **/
+
+    public static void toLoggerInfo(String mes){
+        logger = Logger.getLogger(new Exception().getStackTrace()[1].getClassName());
+        logger.info("\n" + mes);
+    }
+
+    /**
+     * 输出警告信息
+     * @Author TXF
+     * @Date 2022/2/10 21:49
+     * @param mes
+     * @return
+     **/
+    public static void toLoggerWarning(String mes){
+        logger = Logger.getLogger(new Exception().getStackTrace()[1].getClassName());
+        logger.warning("\n" + mes);
+    }
+}

+ 189 - 0
src/main/java/com/steerinfo/dil/wsdl/WSJJBoomFacadeSoapBindingStub.java

@@ -0,0 +1,189 @@
+/**
+ * WSJJBoomFacadeSoapBindingStub.java
+ *
+ * This file was auto-generated from WSDL
+ * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
+ */
+
+package com.steerinfo.dil.wsdl;
+
+public class WSJJBoomFacadeSoapBindingStub extends org.apache.axis.client.Stub implements WSJJBoomFacadeSrvProxy {
+    private java.util.Vector cachedSerClasses = new java.util.Vector();
+    private java.util.Vector cachedSerQNames = new java.util.Vector();
+    private java.util.Vector cachedSerFactories = new java.util.Vector();
+    private java.util.Vector cachedDeserFactories = new java.util.Vector();
+
+    static org.apache.axis.description.OperationDesc [] _operations;
+
+    static {
+        _operations = new org.apache.axis.description.OperationDesc[1];
+        _initOperationDesc1();
+    }
+
+    private static void _initOperationDesc1(){
+        org.apache.axis.description.OperationDesc oper;
+        org.apache.axis.description.ParameterDesc param;
+        oper = new org.apache.axis.description.OperationDesc();
+        oper.setName("transferEASInterfaceMethod");
+        param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "xml"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), String.class, false, false);
+        oper.addParameter(param);
+        param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "methodName"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), String.class, false, false);
+        oper.addParameter(param);
+        oper.setReturnType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
+        oper.setReturnClass(String.class);
+        oper.setReturnQName(new javax.xml.namespace.QName("", "transferEASInterfaceMethodReturn"));
+        oper.setStyle(org.apache.axis.constants.Style.RPC);
+        oper.setUse(org.apache.axis.constants.Use.ENCODED);
+        oper.addFault(new org.apache.axis.description.FaultDesc(
+                      new javax.xml.namespace.QName("http://172.16.62.243:56898/ormrpc/services/WSJJBoomFacade", "fault"),
+                      "WSInvokeException",
+                      new javax.xml.namespace.QName("urn:client.jjboomfacade", "WSInvokeException"), 
+                      true
+                     ));
+        _operations[0] = oper;
+
+    }
+
+    public WSJJBoomFacadeSoapBindingStub() throws org.apache.axis.AxisFault {
+         this(null);
+    }
+
+    public WSJJBoomFacadeSoapBindingStub(java.net.URL endpointURL, javax.xml.rpc.Service service) throws org.apache.axis.AxisFault {
+         this(service);
+         super.cachedEndpoint = endpointURL;
+    }
+
+    public WSJJBoomFacadeSoapBindingStub(javax.xml.rpc.Service service) throws org.apache.axis.AxisFault {
+        if (service == null) {
+            super.service = new org.apache.axis.client.Service();
+        } else {
+            super.service = service;
+        }
+        ((org.apache.axis.client.Service)super.service).setTypeMappingVersion("1.1");
+            Class cls;
+            javax.xml.namespace.QName qName;
+            javax.xml.namespace.QName qName2;
+            Class beansf = org.apache.axis.encoding.ser.BeanSerializerFactory.class;
+            Class beandf = org.apache.axis.encoding.ser.BeanDeserializerFactory.class;
+            Class enumsf = org.apache.axis.encoding.ser.EnumSerializerFactory.class;
+            Class enumdf = org.apache.axis.encoding.ser.EnumDeserializerFactory.class;
+            Class arraysf = org.apache.axis.encoding.ser.ArraySerializerFactory.class;
+            Class arraydf = org.apache.axis.encoding.ser.ArrayDeserializerFactory.class;
+            Class simplesf = org.apache.axis.encoding.ser.SimpleSerializerFactory.class;
+            Class simpledf = org.apache.axis.encoding.ser.SimpleDeserializerFactory.class;
+            Class simplelistsf = org.apache.axis.encoding.ser.SimpleListSerializerFactory.class;
+            Class simplelistdf = org.apache.axis.encoding.ser.SimpleListDeserializerFactory.class;
+            qName = new javax.xml.namespace.QName("urn:client.jjboomfacade", "WSInvokeException");
+            cachedSerQNames.add(qName);
+            cls = WSInvokeException.class;
+            cachedSerClasses.add(cls);
+            cachedSerFactories.add(beansf);
+            cachedDeserFactories.add(beandf);
+
+    }
+
+    protected org.apache.axis.client.Call createCall() throws java.rmi.RemoteException {
+        try {
+            org.apache.axis.client.Call _call = super._createCall();
+            if (super.maintainSessionSet) {
+                _call.setMaintainSession(super.maintainSession);
+            }
+            if (super.cachedUsername != null) {
+                _call.setUsername(super.cachedUsername);
+            }
+            if (super.cachedPassword != null) {
+                _call.setPassword(super.cachedPassword);
+            }
+            if (super.cachedEndpoint != null) {
+                _call.setTargetEndpointAddress(super.cachedEndpoint);
+            }
+            if (super.cachedTimeout != null) {
+                _call.setTimeout(super.cachedTimeout);
+            }
+            if (super.cachedPortName != null) {
+                _call.setPortName(super.cachedPortName);
+            }
+            java.util.Enumeration keys = super.cachedProperties.keys();
+            while (keys.hasMoreElements()) {
+                String key = (String) keys.nextElement();
+                _call.setProperty(key, super.cachedProperties.get(key));
+            }
+            // All the type mapping information is registered
+            // when the first call is made.
+            // The type mapping information is actually registered in
+            // the TypeMappingRegistry of the service, which
+            // is the reason why registration is only needed for the first call.
+            synchronized (this) {
+                if (firstCall()) {
+                    // must set encoding style before registering serializers
+                    _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
+                    _call.setEncodingStyle(org.apache.axis.Constants.URI_SOAP11_ENC);
+                    for (int i = 0; i < cachedSerFactories.size(); ++i) {
+                        Class cls = (Class) cachedSerClasses.get(i);
+                        javax.xml.namespace.QName qName =
+                                (javax.xml.namespace.QName) cachedSerQNames.get(i);
+                        Object x = cachedSerFactories.get(i);
+                        if (x instanceof Class) {
+                            Class sf = (Class)
+                                 cachedSerFactories.get(i);
+                            Class df = (Class)
+                                 cachedDeserFactories.get(i);
+                            _call.registerTypeMapping(cls, qName, sf, df, false);
+                        }
+                        else if (x instanceof javax.xml.rpc.encoding.SerializerFactory) {
+                            org.apache.axis.encoding.SerializerFactory sf = (org.apache.axis.encoding.SerializerFactory)
+                                 cachedSerFactories.get(i);
+                            org.apache.axis.encoding.DeserializerFactory df = (org.apache.axis.encoding.DeserializerFactory)
+                                 cachedDeserFactories.get(i);
+                            _call.registerTypeMapping(cls, qName, sf, df, false);
+                        }
+                    }
+                }
+            }
+            return _call;
+        }
+        catch (Throwable _t) {
+            throw new org.apache.axis.AxisFault("Failure trying to get the Call object", _t);
+        }
+    }
+
+    public String transferEASInterfaceMethod(String xml, String methodName) throws java.rmi.RemoteException, WSInvokeException {
+        if (super.cachedEndpoint == null) {
+            throw new org.apache.axis.NoEndPointException();
+        }
+        org.apache.axis.client.Call _call = createCall();
+        _call.setOperation(_operations[0]);
+        _call.setUseSOAPAction(true);
+        _call.setSOAPActionURI("");
+        _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
+        _call.setOperationName(new javax.xml.namespace.QName("http://webservice.app.facade.jjboom.custom.eas.kingdee.com", "transferEASInterfaceMethod"));
+
+        setRequestHeaders(_call);
+        setAttachments(_call);
+ try {        Object _resp = _call.invoke(new Object[] {xml, methodName});
+
+        if (_resp instanceof java.rmi.RemoteException) {
+            throw (java.rmi.RemoteException)_resp;
+        }
+        else {
+            extractAttachments(_call);
+            try {
+                return (String) _resp;
+            } catch (Exception _exception) {
+                return (String) org.apache.axis.utils.JavaUtils.convert(_resp, String.class);
+            }
+        }
+  } catch (org.apache.axis.AxisFault axisFaultException) {
+    if (axisFaultException.detail != null) {
+        if (axisFaultException.detail instanceof java.rmi.RemoteException) {
+              throw (java.rmi.RemoteException) axisFaultException.detail;
+         }
+        if (axisFaultException.detail instanceof WSInvokeException) {
+              throw (WSInvokeException) axisFaultException.detail;
+         }
+   }
+  throw axisFaultException;
+}
+    }
+
+}

+ 12 - 0
src/main/java/com/steerinfo/dil/wsdl/WSJJBoomFacadeSrvProxy.java

@@ -0,0 +1,12 @@
+/**
+ * WSJJBoomFacadeSrvProxy.java
+ *
+ * This file was auto-generated from WSDL
+ * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
+ */
+
+package com.steerinfo.dil.wsdl;
+
+public interface WSJJBoomFacadeSrvProxy extends java.rmi.Remote {
+    public String transferEASInterfaceMethod(String xml, String methodName) throws java.rmi.RemoteException, WSInvokeException;
+}

+ 16 - 0
src/main/java/com/steerinfo/dil/wsdl/WSJJBoomFacadeSrvProxyService.java

@@ -0,0 +1,16 @@
+/**
+ * WSJJBoomFacadeSrvProxyService.java
+ *
+ * This file was auto-generated from WSDL
+ * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
+ */
+
+package com.steerinfo.dil.wsdl;
+
+public interface WSJJBoomFacadeSrvProxyService extends javax.xml.rpc.Service {
+    public String getWSJJBoomFacadeAddress();
+
+    public WSJJBoomFacadeSrvProxy getWSJJBoomFacade() throws javax.xml.rpc.ServiceException;
+
+    public WSJJBoomFacadeSrvProxy getWSJJBoomFacade(java.net.URL portAddress) throws javax.xml.rpc.ServiceException;
+}

+ 142 - 0
src/main/java/com/steerinfo/dil/wsdl/WSJJBoomFacadeSrvProxyServiceLocator.java

@@ -0,0 +1,142 @@
+/**
+ * WSJJBoomFacadeSrvProxyServiceLocator.java
+ *
+ * This file was auto-generated from WSDL
+ * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
+ */
+
+package com.steerinfo.dil.wsdl;
+
+public class WSJJBoomFacadeSrvProxyServiceLocator extends org.apache.axis.client.Service implements WSJJBoomFacadeSrvProxyService {
+
+    public WSJJBoomFacadeSrvProxyServiceLocator() {
+    }
+
+
+    public WSJJBoomFacadeSrvProxyServiceLocator(org.apache.axis.EngineConfiguration config) {
+        super(config);
+    }
+
+    public WSJJBoomFacadeSrvProxyServiceLocator(String wsdlLoc, javax.xml.namespace.QName sName) throws javax.xml.rpc.ServiceException {
+        super(wsdlLoc, sName);
+    }
+
+    // Use to get a proxy class for WSJJBoomFacade
+    private String WSJJBoomFacade_address = "http://172.16.62.243:56898/ormrpc/services/WSJJBoomFacade";
+
+    public String getWSJJBoomFacadeAddress() {
+        return WSJJBoomFacade_address;
+    }
+
+    // The WSDD service name defaults to the port name.
+    private String WSJJBoomFacadeWSDDServiceName = "WSJJBoomFacade";
+
+    public String getWSJJBoomFacadeWSDDServiceName() {
+        return WSJJBoomFacadeWSDDServiceName;
+    }
+
+    public void setWSJJBoomFacadeWSDDServiceName(String name) {
+        WSJJBoomFacadeWSDDServiceName = name;
+    }
+
+    public WSJJBoomFacadeSrvProxy getWSJJBoomFacade() throws javax.xml.rpc.ServiceException {
+       java.net.URL endpoint;
+        try {
+            endpoint = new java.net.URL(WSJJBoomFacade_address);
+        }
+        catch (java.net.MalformedURLException e) {
+            throw new javax.xml.rpc.ServiceException(e);
+        }
+        return getWSJJBoomFacade(endpoint);
+    }
+
+    public WSJJBoomFacadeSrvProxy getWSJJBoomFacade(java.net.URL portAddress) throws javax.xml.rpc.ServiceException {
+        try {
+            WSJJBoomFacadeSoapBindingStub _stub = new WSJJBoomFacadeSoapBindingStub(portAddress, this);
+            _stub.setPortName(getWSJJBoomFacadeWSDDServiceName());
+            return _stub;
+        }
+        catch (org.apache.axis.AxisFault e) {
+            return null;
+        }
+    }
+
+    public void setWSJJBoomFacadeEndpointAddress(String address) {
+        WSJJBoomFacade_address = address;
+    }
+
+    /**
+     * For the given interface, get the stub implementation.
+     * If this service has no port for the given interface,
+     * then ServiceException is thrown.
+     */
+    public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException {
+        try {
+            if (WSJJBoomFacadeSrvProxy.class.isAssignableFrom(serviceEndpointInterface)) {
+                WSJJBoomFacadeSoapBindingStub _stub = new WSJJBoomFacadeSoapBindingStub(new java.net.URL(WSJJBoomFacade_address), this);
+                _stub.setPortName(getWSJJBoomFacadeWSDDServiceName());
+                return _stub;
+            }
+        }
+        catch (Throwable t) {
+            throw new javax.xml.rpc.ServiceException(t);
+        }
+        throw new javax.xml.rpc.ServiceException("There is no stub implementation for the interface:  " + (serviceEndpointInterface == null ? "null" : serviceEndpointInterface.getName()));
+    }
+
+    /**
+     * For the given interface, get the stub implementation.
+     * If this service has no port for the given interface,
+     * then ServiceException is thrown.
+     */
+    public java.rmi.Remote getPort(javax.xml.namespace.QName portName, Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException {
+        if (portName == null) {
+            return getPort(serviceEndpointInterface);
+        }
+        String inputPortName = portName.getLocalPart();
+        if ("WSJJBoomFacade".equals(inputPortName)) {
+            return getWSJJBoomFacade();
+        }
+        else  {
+            java.rmi.Remote _stub = getPort(serviceEndpointInterface);
+            ((org.apache.axis.client.Stub) _stub).setPortName(portName);
+            return _stub;
+        }
+    }
+
+    public javax.xml.namespace.QName getServiceName() {
+        return new javax.xml.namespace.QName("http://172.16.62.243:56898/ormrpc/services/WSJJBoomFacade", "WSJJBoomFacadeSrvProxyService");
+    }
+
+    private java.util.HashSet ports = null;
+
+    public java.util.Iterator getPorts() {
+        if (ports == null) {
+            ports = new java.util.HashSet();
+            ports.add(new javax.xml.namespace.QName("http://172.16.62.243:56898/ormrpc/services/WSJJBoomFacade", "WSJJBoomFacade"));
+        }
+        return ports.iterator();
+    }
+
+    /**
+    * Set the endpoint address for the specified port name.
+    */
+    public void setEndpointAddress(String portName, String address) throws javax.xml.rpc.ServiceException {
+        
+if ("WSJJBoomFacade".equals(portName)) {
+            setWSJJBoomFacadeEndpointAddress(address);
+        }
+        else 
+{ // Unknown Port Name
+            throw new javax.xml.rpc.ServiceException(" Cannot set Endpoint Address for Unknown Port" + portName);
+        }
+    }
+
+    /**
+    * Set the endpoint address for the specified port name.
+    */
+    public void setEndpointAddress(javax.xml.namespace.QName portName, String address) throws javax.xml.rpc.ServiceException {
+        setEndpointAddress(portName.getLocalPart(), address);
+    }
+
+}

+ 13 - 0
src/main/resources/com/steerinfo/dil/mapper/TmstruckWeightResultMapper.xml

@@ -748,4 +748,17 @@
         where OO.ORDER_NUMBER = #{orderNumber}
           and TWR.RESULT_NET_WEIGHT is null
     </select>
+
+<!--  查询采购订单信息给金蝶  -->
+    <select id="getPurOrderMesToKD" parameterType="string" resultType="java.util.Map">
+        select APO.PURCHASE_ORDER_NO    "No",
+               APO.EAS_ENTRY_ID     "easEntryId",
+               RC.CAPACITY_NUMBER   "capacityNumber"
+        from OMSTRUCK_ORDER OO
+        left join AMS_PURCHASE_ORDER APO
+        on OO.ORDER_PLAN_ID = APO.PURCHASE_ORDER_ID
+        left join RMS_CAPACITY RC
+        on RC.CAPACITY_ID = OO.CAPACITY_ID
+        where OO.ORDER_NUMBER = #{orderNumber}
+    </select>
 </mapper>

+ 134 - 0
src/main/test/com/test/Test2.java

@@ -0,0 +1,134 @@
+package com.test;
+
+import com.steerinfo.dil.util.Log4jUtils;
+import org.apache.axis.client.Call;
+import org.apache.axis.client.Service;
+import org.apache.axis.encoding.XMLType;
+import org.dom4j.Document;
+import org.dom4j.DocumentHelper;
+import org.dom4j.Element;
+import org.dom4j.io.OutputFormat;
+import org.dom4j.io.XMLWriter;
+import org.hibernate.mapping.Array;
+import org.junit.Test;
+
+import javax.xml.rpc.ParameterMode;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.logging.Logger;
+
+/**
+ * @ author    :TXF
+ * @ time      :2022/2/10 11:05
+ */
+
+public class Test2 {
+    @Test
+    public void test() {
+        try {
+            // 创建一个Document实例
+            Document doc = DocumentHelper.createDocument();
+
+            // 添加根节点
+            Element root = doc.addElement("root");
+
+            // 在根节点下添加第一个子节点
+            Element oneChildElement = root.addElement("person").addAttribute("attr", "root noe");
+            oneChildElement.addElement("people")
+                    .addAttribute("attr", "child one")
+                    .addText("person one child one");
+            oneChildElement.addElement("people")
+                    .addAttribute("attr", "child two")
+                    .addText("person one child two");
+
+            // 在根节点下添加第一个子节点
+            Element twoChildElement = root.addElement("person").addAttribute("attr", "root two");
+            twoChildElement.addElement("people")
+                    .addAttribute("attr", "child one")
+                    .addText("person two child one");
+            twoChildElement.addElement("people")
+                    .addAttribute("attr", "child two")
+                    .addText("person two child two");
+
+            // xml格式化样式
+            // OutputFormat format = OutputFormat.createPrettyPrint(); // 默认样式
+
+            // 自定义xml样式
+            OutputFormat format = new OutputFormat();
+            format.setIndentSize(2);  // 行缩进
+            format.setNewlines(true); // 一个结点为一行
+            format.setTrimText(true); // 去重空格
+            format.setPadText(true);
+            format.setNewLineAfterDeclaration(false); // 放置xml文件中第二行为空白行
+            System.out.println(doc.asXML());
+            // 输出xml文件
+            XMLWriter writer = new XMLWriter(new FileOutputStream("E:\\asd.xml"), format);
+            writer.write(doc);
+            System.out.println("dom4j CreateDom4j success!");
+        } catch (UnsupportedEncodingException e) {
+            e.printStackTrace();
+        } catch (FileNotFoundException e) {
+            e.printStackTrace();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+    }
+
+    public static String asXmlDate(List<String> dataList) {
+        // 创建一个Document实例
+        Document doc = DocumentHelper.createDocument();
+        // 添加根节点
+        Element table = doc.addElement("table");
+        //添加第子节点
+        table.addElement("rowCount").addText("1");
+        table.addElement("headCount").addText("9");
+        Element head = table.addElement("head");
+        //添加body下的r1下的子节点
+        Element r1 = table.addElement("body").addElement("r1");
+        //添加head的子节点
+        for (int i = 0; i < dataList.size(); i++) {
+            head.addElement("h" + (i + 1)).addText(dataList.get(i));
+            r1.addElement("r1c" + (i + 1)).addText(dataList.get(i));
+        }
+        return doc.asXML();
+    }
+
+    public static String invokRemoveWSDLByAxis(String reqXML, String endPoint) {
+        String responseXML = "";
+        Service service = new Service();
+        try {
+            Call call = (Call) service.createCall();
+            call.setTargetEndpointAddress(endPoint);
+            call.setOperationName(new javax.xml.namespace.QName("http://webservice.app.facade.jjboom.custom.eas.kingdee.com", "transferEASInterfaceMethod"));
+            call.addParameter("username", XMLType.XSD_STRING, ParameterMode.IN);
+            call.setReturnType(XMLType.XSD_STRING);
+            responseXML = (String) call.invoke(new Object[]{reqXML, "weighSoucNew"});
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return responseXML;
+    }
+
+    @Test
+    public void test4() {
+        ArrayList<String> list = new ArrayList<>();
+        for (int i = 1; i < 10; i++) {
+            list.add(i + "");
+        }
+        String testXml = asXmlDate(list);
+        System.out.println(testXml);
+    }
+
+    @Test
+    public void test5(){
+//        System.out.println(String.valueOf(null));
+        System.out.println(String.valueOf("null"));
+        System.out.println(String.valueOf(""));
+        System.out.println(String.valueOf(0));
+    }
+}

+ 67 - 0
src/main/test/test23.java

@@ -0,0 +1,67 @@
+import com.steerinfo.dil.util.Log4jUtils;
+import org.apache.axis.client.Call;
+import org.apache.axis.client.Service;
+import org.apache.axis.encoding.XMLType;
+import org.dom4j.Document;
+import org.dom4j.DocumentHelper;
+import org.dom4j.Element;
+import org.junit.Test;
+import sun.reflect.CallerSensitive;
+
+import javax.xml.rpc.ParameterMode;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @ author    :TXF
+ * @ time      :2022/2/10 16:36
+ */
+
+public class test23 {
+    public static void main(String[] args) {
+        ArrayList<String> list = new ArrayList<>();
+        for (int i = 1; i < 10; i++) {
+            list.add(i + "");
+        }
+        String testXml = asXmlDate(list);
+        String url = "http://172.16.62.243:56898/ormrpc/services/WSJJBoomFacade";
+        String s = invokRemoveWSDLByAxis(testXml, url);
+        System.out.println(s);
+    }
+
+    public static String asXmlDate(List<String> dataList){
+        // 创建一个Document实例
+        Document doc = DocumentHelper.createDocument();
+        // 添加根节点
+        Element table = doc.addElement("table");
+        //添加第子节点
+        table.addElement("rowCount").addText("1");
+        table.addElement("headCount").addText("9");
+        Element head = table.addElement("head");
+        //添加body下的r1下的子节点
+        Element r1 = table.addElement("body").addElement("r1");
+        //添加head的子节点
+        for (int i = 0; i < dataList.size(); i++) {
+            head.addElement("h" + (i + 1)).addText(dataList.get(i));
+            r1.addElement("r1c" + (i + 1)).addText(dataList.get(i));
+        }
+        return doc.asXML();
+    }
+
+    public static String invokRemoveWSDLByAxis(String reqXML, String endPoint) {
+        String responseXML = "";
+        Service service = new Service();
+        try {
+            Call call = (Call) service.createCall();
+            call.setTargetEndpointAddress(endPoint);
+            call.setOperationName(new javax.xml.namespace.QName("WSJJBoomFacade"));
+            call.addParameter("arg0", XMLType.XSD_STRING, ParameterMode.IN);
+            call.setReturnType(XMLType.XSD_STRING);
+            responseXML = (String) call.invoke(new Object[] { reqXML });
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return responseXML;
+    }
+
+}