星瀚移动端调用道可维斯影像开发原创
金蝶云社区-阿伟仔
阿伟仔
3人赞赏了该文章 517次浏览 未经作者许可,禁止转载编辑于2022年07月11日 11:12:20

有的时候,影像系统需要支持移动影像,但是移动影像不能通过配置完成,这时就需要通过开发插件完成。

以下以道可维斯作为案例。

  1. 影像系统地址,可以通过影像人员沟通获取。

  2. 插件开发

    首先按照影像系统方提供的wsdl,生成wsdl类。生成wsdl类这一部分通过百度即可。

    然后编写移动单据点击按钮插件

    重点代码:


//          同步移动影像
IScanWebServiceImplServiceSoapProxy implServiceSoapProxy = new IScanWebServiceImplServiceSoapProxy(); //生成的wsdl类
String URL = implServiceSoapProxy.getMobileViewUrl("KDDE-KD-04-20220424-03001"); //通过影像编码获取影像地址
System.out.println(URL);


      完整代码:

public class baseMoImg extends AbstractMobFormPlugin {
	
	
	@Override
	public void registerListener(EventObject e) {
		// TODO Auto-generated method stub
		super.registerListener(e);
		
		Button imageno =  getControl("batm_imageno");
		if(imageno != null) {
			imageno.addClickListener(this);
		}
	}
	
	@Override
	public void click(EventObject evt) {
		// TODO Auto-generated method stub
		super.click(evt);
		
		Control control = (Control) evt.getSource();
		String keyName = control.getKey();
		switch (keyName) {
		//打开移动影像
		case "batm_imageno":
			String billno = this.getModel().getValue("imageno").toString();
			OpenMoUrl(billno);
			//OpenMoUrl("KDDE-KD-04-20220424-03001");
			break;
		}
	}
	
	private void OpenMoUrl(String billno) {

		IScanWebServiceImplServiceSoapProxy implServiceSoapProxy = new IScanWebServiceImplServiceSoapProxy();
		String URL = "";
		if(billno.equals("")) {
			this.getView().showErrorNotification("暂无影像!");
			return;
		}
		try {
			URL = implServiceSoapProxy.getMobileViewUrl(billno);
			this.getView().openUrl(URL);
			return;
		} catch (RemoteException e) {
			// TODO Auto-generated catch block
			//e.printStackTrace();
			this.getView().showErrorNotification(billno+"影像系统发生故障。请联系管理员!"+e.getMessage());
		}
		this.getView().showErrorNotification("暂无影像!");
	}
	
}

  3.审批节点查看:审批节点按钮显示

赞 3