• 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

    }

  • 相关阅读:
    [找规律]Array Concatenation 2022CCPC桂林站C
    微服务项目实战-黑马头条(十三):持续集成
    工程伦理--13.2 “邻避效应”成因分析
    2023考研王道计算机408数据结构+操作系统+计算机组成原理+计算机网络
    栈的和队列的实现
    excel初级应用案例——杜邦分析仪
    js绘制的漂亮玫瑰曲线rose curve
    Java 请求华为云认证接口API
    2022年浙江财经大学MBA录取名单
    FreeRTOS自我救赎1之基本知识
  • 原文地址:https://blog.csdn.net/J2724731264/article/details/133957508