泛微E8与Lims(实验室管理)对接发布webservice外部调用提交流程接口

时间: 2023-08-15 admin 互联网

泛微E8与Lims(实验室管理)对接发布webservice外部调用提交流程接口

泛微E8与Lims(实验室管理)对接发布webservice外部调用提交流程接口

需求:OA流程与lims系统的流程相对应,涉及到lims系统审批调用OA提交(货退回)流程接口,达到OA流程与lims流程审批一致。这里涉及到发布OA提交(或退回)接口给lims系统调用。OA系统有个RequestService requestService=new RequestService()对象,里面有个nextNodeByReject(请求id,人员id,签字意见)提交方法,将这个方法封装成lims想要传入的参数。

首先创建个interface的接口类,@WebMethod(实现类的方法名,映射路径):

package weaver.workflow.webservices;

import javax.jws.WebMethod;
import javax.jws.WebService;

@WebService
public interface Dosubmit {
    /**
     * 执行提交
     * @param entrustnum
     * @param staffnum
     * @param remark
     */
    @WebMethod(operationName = "dosubmitRequest" ,action = "urn:weaver.workflow.webservices.Dosubmit.dosubmitRequest")
    public String dosubmitRequest(String entrustnum,String staffnum,String remark);
}

实现类imp:

package weaver.workflow.webservices;

import com.customcode.util.XmActionLog;
import weaver.conn.RecordSet;
import weaver.general.BaseBean;
import weaver.soa.workflow.request.RequestService;

/**
 * @author Yuyb
 * @version 1.0
 * 类说明:
 * @date 2020/4/23 16:27
 */

public class DosubmitImp extends BaseBean implements Dosubmit{
    public String dosubmitRequest(String staffnum,String entrustnum ,String remark){
        String result="false";
        BaseBean baseBean = new BaseBean();
        XmActionLog alog = new XmActionLog();
        String actionName = "DosubmitImp";// 日志文件夹名称
        RequestService requestService=new RequestService();
        RecordSet rs_hr = new RecordSet();
        RecordSet rs_wf = new RecordSet();
        alog.info(actionName,"==========================start============================" );
        String maintable=baseBean.getPropValue("Limtlinks", "maintable");//读取配置文件参数值;
        String sql_hr="select id from hrmresource where loginid='"+staffnum+"'";
        rs_hr.execute(sql_hr);
        alog.info(actionName,"sql_hr==" +sql_hr);
        String staffid="";
        while(rs_hr.next()){
            staffid=rs_hr.getString("id");
        }
        alog.info(actionName,"staffid==" +staffid);
        String sql_wf ="select requestid from "+maintable+" where wtnum='"+entrustnum+"'";
        rs_wf.execute(sql_wf);
        alog.info(actionName,"sql_wf==" +sql_wf);
        String rid="";
        while (rs_wf.next()){
            rid=rs_wf.getString("requestid");
        }
        alog.info(actionName,"rid==" +rid);
        Boolean status=null;
        try{
         status=requestService.nextNodeBySubmit(null,Integer.parseInt(rid),Integer.parseInt(staffid),remark);
        }catch (Exception e){
            e.printStackTrace();
            alog.info(actionName,"msg===>>>"+e.getMessage());
            //return result;
        }
        alog.info(actionName,"status==" +status);
        if(status){
            result="true";
        }
        alog.info(actionName,"==========================end============================" );
        return result;
    }
}

将接口类和接口对应的实现类放入系统的服务器上编译,路径地址为:

ecology/classbean/weaver/workflow/webservices

找到/weaver/ecology/classbean/META-INF/xfire 底下的serveces.xml配置文件

添加对应接口类和实现类,如下图:

 保存配置文件,再访问ip地址/services就可看到自己定义的webservice接口了

 总结:以上是提交接口的发布,退回也是一样的步骤。lims调用提交接口系统只会返回false或者true,与lims系统对接常见的错误运维:1、节点的操作人不同。(流程节点不一致)2、lims人员权限问题。