📄 getdatafromeys.java
字号:
package com.mdcl.mocha.jlcmcc.interfaceforWS;
import java.util.Date;
import java.util.List;
import com.mdcl.mocha.bpm.sdk.ServiceManager;
import com.mdcl.mocha.bpm.sdk.boins.BoInsException;
import com.mdcl.mocha.bpm.sdk.boins.entity.IBoInstance;
import com.mdcl.mocha.bpm.sdk.boins.service.IBoInstanceService;
import com.mdcl.mocha.bpm.sdk.document.entity.IContent;
import com.mdcl.mocha.bpm.sdk.document.entity.IDocument;
import com.mdcl.mocha.bpm.sdk.license.ExpiryException;
import com.mdcl.mocha.bpm.sdk.license.LicenseException;
import com.mdcl.mocha.bpm.sdk.license.NotFoundModuleException;
import com.mdcl.mocha.bpm.sdk.osm.IOrgMgmtService;
import com.mdcl.mocha.bpm.sdk.osm.OsmException;
import com.mdcl.mocha.bpm.sdk.osm.entity.OrgBean;
/**
* <strong>Title : GetDataFromeYS<br></strong>
* <strong>Description : </strong>吉林移动BPM与预算系统的接口类<br>
* <strong>Create on : 2007-9-12<br></strong>
* <p>
* <strong>Copyright (C) Mocha Software Co.,Ltd.<br></strong>
* <p>
* @author liulf@mochasoft.com.cn<br>
* @version <strong>Mocha BPM v6.2</strong><br>
* <br>
* <strong>修改历史:</strong><br>
* 修改人 : zhanghd 修改日期: 2007-10-14 修改描述: 通过流程实例获得部门编号<br>
* -------------------------------------------<br>
* <br>
* <br>
*/
public class GetDataFromeYS {
/**
*
* 通过流程实例从预算系统取回:项目编号、项目名称、剩余项目金额。
*
* @param IBoins
* <i>流程实例</i>
* @return 包括项目编号、项目名称、剩余项目金额Map的List
*/
public List getdataBuMen(String IBoins){
// 通过流程实例获得部门编号 @param departId
String departId = "";
try {
//System.out.println("-------------### 通过流程实例获得部门编号开始 ###-------------bumenID="+IBoins);
IBoInstanceService IBoSer = (IBoInstanceService)ServiceManager.getInstance().getService(IBoInstanceService.class);
IOrgMgmtService OrgService=(IOrgMgmtService)ServiceManager.getInstance().getService(IOrgMgmtService.class);
IBoInstance iboins = (IBoInstance)IBoSer.getBizObjectInstance(IBoins);
IDocument idoc = (IDocument)iboins.getDocument();
IContent ConID = (IContent) idoc.getContent("chengbanbumen");
OrgBean orBean=OrgService.getOrgById(ConID.getItemValue());
departId=orBean.getOrgno();
//System.out.println("-------------### bumenID ###-------------"+departId);
} catch (NotFoundModuleException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (ExpiryException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (LicenseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (BoInsException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (OsmException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
//System.out.println("-------------### 预算系统接口开始 ###-------------");
WSYuSuan WSYS=new WSYuSuan();
return WSYS.getGetProceedingMsg(IBoins, ((new Date()).getYear()+1900)+"0000",((new Date()).getYear()+1900)+"0000", "1");
}
/**
*
* 通过合同编号从预算系统取回"合同已支付的金额"。
*
* @param pactID
* <i>合同编号</i>
* @return 合同已支付的金额
*/
public String getdataPact(String pactID){
//System.out.println("-------------### 预算系统接口开始 ###-------------");
WSYuSuan WSYS=new WSYuSuan();
return WSYS.getGetContractMoneyPayed(pactID);
}
/**
*
* 向预算系统传入合同信息
*
* @param IBoInID
* <i>合同流程实例ID</i>
* @return 成功:true 失败:false
*/
public boolean setPactData(String IBoInID){
GetBiaoDanInf GBDinf= new GetBiaoDanInf();
BiaoDianBean BDbean=GBDinf.getBiaoDanInf(IBoInID);
//System.out.println("-------------### 预算系统接口开始 ###-------------");
WSYuSuan WSYS=new WSYuSuan();
return WSYS.setSendContractMsg(BDbean);
}
/**
*
* 获得所有审批中的合同金额
*
* @param chengbenxiangmubianhao
* <i>项目编号</i>
* @param IBoInID
* <i>流程实例ID</i>
* @return 合同金额
*/
public double getShenPiZhongMoney(String chengbenxiangmubianhao,String IBoInID){
double result=0;
try {
//根据业务流程实例ID获取所有此业务流程定义下的流程实例
IBoInstanceService IBoInService = (IBoInstanceService)ServiceManager.getInstance().getService(IBoInstanceService.class);
IBoInstance IBoIn=IBoInService.getBizObjectInstance(IBoInID);
String BoDefID=IBoIn.getBoDefID();
List IBoInlist=IBoInService.getInstancesByBoDefId(BoDefID);
//根据流程实例取得所有审批中的合同金额之和
for(int i=0;i<IBoInlist.size();i++){
IBoInstance t_IBoIn=(IBoInstance)IBoInlist.get(i);
if(!t_IBoIn.ifFinished()){
IDocument t_Doc=t_IBoIn.getDocument();
IContent t_ICo=null;
try{
t_ICo=t_Doc.getContent("chengbenxiangmubianhao");
//System.out.println("----------### chengbenxiangmubianhao="+t_ICo.getItemValue()+" ###--------");
if(t_ICo.getItemValue().equalsIgnoreCase(chengbenxiangmubianhao)){
t_ICo=t_Doc.getContent("hetongjine");
//System.out.println("----------### hetongjine="+t_ICo.getItemValue()+" ###--------");
String t_str=t_ICo.getItemValue();
if(t_str.equalsIgnoreCase("")){
result+=Double.parseDouble(t_str);
}
}
}catch(Exception e){}
}
}
} catch (NotFoundModuleException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (ExpiryException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (LicenseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (BoInsException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return result;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -