WebService对接对方WebService的数据格式

作者官方网站:http://www.wxl568.cn

/**  
* @Description: 与ECP接口相关工具类
*/
public class EcpCallBackUtil {
    private static final String SYSTEM_ID = "HRSS-GPS";
    private static final Logger logger = LoggerFactory.getLogger(EcpCallBackUtil.class);
    
    private EcpCallBackUtil() {    }
    
    public static long ecpStartWorkFlowClockAddressBiz(List<EcpClockAddresDetailed> list,EcpClockAddressFlow addressFlow,List<EcpClockAddresDetailedFlow> adFlows,String url){
        long resultFlag=-1l;
            try {
                ProcessServiceImplServiceLocator locator = new ProcessServiceImplServiceLocator();
                ProcessService implPort = locator.getProcessServiceImplPort(new URL(url));
                if(list != null && !list.isEmpty()){
                    // 启动流程接口
                    // 构造ProcessCmd
                    ProcessCmd cmd = new ProcessCmd();
                    // 设置流程流程的key,该key为流程定义时指定的key,也可以指定为cmd.setActDefId(1001);该actDefId为bpm_definition表中//的actDefId字段值
                    cmd.setFlowKey(EcpRunStatusUtils.ECP_CLOCK_ADDRSS_FLOW);
                    // 设置启动用户//,必需要
                    cmd.setUserAccount(addressFlow.getSqrgh());
                    // 设置业务ID
                    cmd.setBusinessDocumentKey(String.valueOf(list.get(0).getId()));
                    cmd.setRequestSystemId(SYSTEM_ID);    
                    //SUB LIST
                    Main m = new Main("",EcpRunStatusUtils.MAIN_TABLE_NAME, addressFlow);
                    Sub sub = new Sub(EcpRunStatusUtils.SUB_TABLE_NAME, adFlows);
                    List<Sub> s = new ArrayList<>();
                    s.add(sub);
                    List<Opinion> p = new ArrayList<>();
                    FromData fromData = new FromData(m, s, p);
                    cmd.setFormData(JSONObject.fromObject(fromData).toString());
                    cmd.setExtParameters(new ProcessCmdExtParametersEntry[1]);
                    cmd.setFormDataMap(new ProcessCmdFormDataMapEntry[1]);
                    cmd.setVariables(new ProcessCmdVariablesEntry[1]);
                    ProcessRunResult processRun = implPort.start(cmd);
                    if (processRun.getRunId() != null) {
                        resultFlag =processRun.getRunId();
                    } else {
                        resultFlag = -1;
                    }
                }
            } catch (Exception e) {
                logger.error(e.getMessage(),e);
            }
        return resultFlag;
    }
    
}

主题

public class Main {
    private String tableName;
    private Object fields; 
    private String tableId;
    
    public Main() {
        super();
    }
    public Main( String tableName, Object fields) {
        super();
        this.tableName = tableName;
        this.fields = fields;
    }
    public Main(String tableId ,String tableName, Object fields) {
        super();
        this.tableName = tableName;
        this.fields = fields;
        this.tableId=tableId;
    }
    public String getTableId() {
        return tableId;
    }
    public void setTableId(String tableId) {
        this.tableId = tableId;
    }
    public String getTableName() {
        return tableName;
    }
    public void setTableName(String tableName) {
        this.tableName = tableName;
    }
    public Object getFields() {
        return fields;
    }
    public void setFields(Object fields) {
        this.fields = fields;
    }
}
 

json数据

import java.util.List;

public class Sub {
    private String tableName;
    private List fields;
    
    public Sub() {
        super();
    }
    public Sub(String tableName, List fields) {
        super();
        this.tableName = tableName;
        this.fields = fields;
    }
    public String getTableName() {
        return tableName;
    }
    public void setTableName(String tableName) {
        this.tableName = tableName;
    }
    public List getFields() {
        return fields;
    }
    public void setFields(List fields) {
        this.fields = fields;
    }
}
 

public class Opinion {
    private String name;
    private String value;
    public Opinion() {
        super();
    }
    public Opinion(String name, String value) {
        super();
        this.name = name;
        this.value = value;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getValue() {
        return value;
    }
    public void setValue(String value) {
        this.value = value;
    }
    
}

作者官方网站:http://www.wxl568.cn

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值