• OA和别的系统对接的java文件,调的websevice接口的参考实例



    在这里插入图片描述

    //代码块
    package com.bj520.action;

    import com.alibaba.fastjson.JSON;
    import com.bj520.service.zs.Webfcs;
    import com.bj520.service.zs.WebfcsLocator;
    import com.bj520.util.LogUtil;
    import com.bj520.util.ZsResultUtil;
    import weaver.conn.RecordSet;
    import weaver.interfaces.workflow.action.Action;
    import weaver.soa.workflow.request.RequestInfo;

    import javax.xml.rpc.ServiceException;
    import java.rmi.RemoteException;
    import java.util.ArrayList;
    import java.util.HashMap;
    import java.util.List;
    import java.util.Map;

    /**

      • Description: 追溯礼服转移回写
      • Created by cyb
      • Date:2019/12/18
        */

    public class ZsLiFuZhuanYi implements Action {
    private String status; // 0 未送审 1 送审 2门店接收

    public String getStatus() {
        return status;
    }
    
    public void setStatus(String status) {
        this.status = status;
    }
    
    @Override
    public String execute(RequestInfo request) {
        LogUtil log = new LogUtil("追溯礼服转移回写", request);
        String requestId = request.getRequestid();  //获取请求requestId
        String maintable = request.getRequestManager().getBillTableName(); //获取当前流程的数据表名称
        RecordSet rs = new RecordSet();
        String sql_wf;
        if (status.equals("0") || status.equals("1")) {
            sql_wf = "select d.zsid,d.zslx from " + maintable + " m ," + maintable + "_dt1 d " +
                    " where m.id=d.mainid  and m.requestid=" + requestId;
        } else {
            sql_wf = "select d.message1,d.message2 from " + maintable + " m ," + maintable + "_dt2 d " +
                    " where m.id=d.mainid and d.type='S' and m.requestid=" + requestId;
        }
    
        log.info(sql_wf);
        rs.execute(sql_wf);
        List> list = new ArrayList<>();
        while (rs.next()) {
            Map map = new HashMap<>();
            map.put("iId", rs.getString(1));
            map.put("cType", rs.getString(2));
            map.put("cState", status);
            list.add(map);
        }
        Webfcs webfcs = new WebfcsLocator();
        String result;
        try {
            result = webfcs.getWebfcsSoap12().API_WRITER_FZADJUST(JSON.toJSONString(list));
            log.info(JSON.toJSONString(list));
            log.info(result);
            if (!ZsResultUtil.isSuccess(result)) {
                return FAILURE_AND_CONTINUE;
            }
        } catch (RemoteException | ServiceException e) {
            e.printStackTrace();
            log.info("Exception=>>>>>" + e.getMessage());
            return FAILURE_AND_CONTINUE;
        }
        log.end();
        return SUCCESS;
    
    }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51

    }

  • 相关阅读:
    [LeetCode/力扣][Java] 0315. 计算右侧小于当前元素的个数(Count of Smaller Numbers After Self)
    spring事务面试题
    1043 输出PATest
    6- 华为云查看容器日志
    数据库知识之图的创建以及各种遍历、生成树的形成
    golang数组
    『无为则无心』Python面向对象 — 58、类方法和静态方法
    VSCode中Java程序入口的数据输入流的常用形式
    如何优雅的创建线程
    MPLS BGP virtual private network OptionC实验
  • 原文地址:https://blog.csdn.net/J2724731264/article/details/133957508