接口平台发起流程租金测算

This commit is contained in:
lixuebo 2019-08-14 14:00:37 +08:00
parent 5658ff2b34
commit 74db9b2426
3 changed files with 100 additions and 6 deletions

View File

@ -148,6 +148,67 @@ public class BaseFlowStartAction extends FlowBussionAction {
}
return sReturn;
}
private String submitFlowunid;
private String submitFlowNo;
private String submitUserId;
public String getSubmitFlowunid() {
return submitFlowunid;
}
public void setSubmitFlowunid(String submitFlowunid) {
this.submitFlowunid = submitFlowunid;
}
public String getSubmitFlowNo() {
return submitFlowNo;
}
public void setSubmitFlowNo(String submitFlowNo) {
this.submitFlowNo = submitFlowNo;
}
public String getSubmitUserId() {
return submitUserId;
}
public void setSubmitUserId(String submitUserId) {
this.submitUserId = submitUserId;
}
//接口平台提交流程方法
public String submitFlow(JBOTransaction tx){
try {
//开始根据参数提交指定步骤
String submitTask = this.getSubmitTask();
Transaction tran = Transaction.createTransaction(tx);
String taskNo = tran.getString("SELECT SERIALNO FROM FLOW_TASK WHERE objectno='"+submitFlowunid+"' and flowno='"+submitFlowNo+"' ORDER BY begintime DESC LIMIT 1");
//执行需要提交的步骤
FlowAction flowAction = new FlowAction();
//设置当前处理人
flowAction.setTaskNo(taskNo);
flowAction.setFlowNo(submitFlowNo);
flowAction.setUserID(submitUserId);
flowAction.setNextNodeType("TASK");
if("1000".equals(submitTask)){
flowAction.setPhaseOpinion(submitTask);
flowAction.setPhaseAction("AutoFinish");
}else{
flowAction.setPhaseOpinion(submitTask);
String actionScript = tran.getString("select actionscript from flow_model where phaseno ='"+submitTask+"' and flowno ='"+submitFlowNo+"'");
if(actionScript==null)
throw new Exception( "未找到流程信息" );
JSONArray ja = JSONArray.parseArray(actionScript);
JSONObject obj = ja.getJSONObject(0);
flowAction.setPhaseAction(obj.getString("userinfo").replaceAll(","," "));
}
flowAction.submit( tx );
return "success@"+submitFlowunid;
} catch (Exception e) {
e.printStackTrace();
return "error_message";
}
}
/**
* 发起流程之前自定义操作
* @param tx

View File

@ -19,7 +19,7 @@ import com.tenwa.flow.baseBussion.BaseBussiness;
*/
public class BusinessApplicationPfToTemp extends BaseBussiness {
/**自然人客户
/**自然人客户基本信息
* @throws Exception
* @throws JBOException */
public static void savePerson(BizObject boCRT,String serial) throws Exception{
@ -48,6 +48,29 @@ public class BusinessApplicationPfToTemp extends BaseBussiness {
boCRT.setAttributeValue("REMARK",customerBo.getAttribute("REMARK").toString());
}
/**法人客户基本信息
* @throws Exception
* @throws JBOException */
public static void saveCompany(BizObject boCRT,String serial) throws Exception{
BizObject customerBo = JBOFactory.createBizObjectQuery(PF_CUSTOMER_PERSON.CLASS_NAME,"SERIAL=:serial").setParameter("serial",serial).getSingleResult(false);
boCRT.setAttributeValue("company_name",customerBo.getAttribute("company_name").toString());
boCRT.setAttributeValue("enterprisename",customerBo.getAttribute("enterprisename").toString());
boCRT.setAttributeValue("custkind",customerBo.getAttribute("custkind").toString());
boCRT.setAttributeValue("certid",customerBo.getAttribute("certid").toString());
boCRT.setAttributeValue("provincecode",customerBo.getAttribute("provincecode").toString());
boCRT.setAttributeValue("citycode",customerBo.getAttribute("citycode").toString());
boCRT.setAttributeValue("registercapital",customerBo.getAttribute("registercapital").toString());
boCRT.setAttributeValue("establish_date",customerBo.getAttribute("establish_date").toString());
boCRT.setAttributeValue("reg_address",customerBo.getAttribute("reg_address").toString());
boCRT.setAttributeValue("operat_address",customerBo.getAttribute("operat_address").toString());
boCRT.setAttributeValue("tel",customerBo.getAttribute("tel").toString());
boCRT.setAttributeValue("wealth_name",customerBo.getAttribute("wealth_name").toString());
boCRT.setAttributeValue("wealth_tel",customerBo.getAttribute("wealth_tel").toString());
boCRT.setAttributeValue("company_tel",customerBo.getAttribute("company_tel").toString());
boCRT.setAttributeValue("business_income",customerBo.getAttribute("business_income").toString());
boCRT.setAttributeValue("unit_properties",customerBo.getAttribute("unit_properties").toString());
}
/**自然人客户居住地址
* @throws Exception
* @throws JBOException */

View File

@ -3,6 +3,7 @@ package com.tenwa.lease.flow.project.commbusiness;
import com.tenwa.util.SerialNumberUtil;
import jbo.app.tenwa.calc.LC_CALC_CONDITION_TEMP;
import jbo.app.tenwa.customer.CUSTOMER_ACCOUNT_TEMP;
import jbo.app.tenwa.customer.CUSTOMER_ADDRESS;
@ -37,6 +38,7 @@ import jbo.sys.PF_GUARANTEE_UNIT;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Vector;
import com.amarsoft.are.jbo.BizObject;
import com.amarsoft.are.jbo.BizObjectManager;
@ -44,12 +46,15 @@ import com.amarsoft.are.jbo.JBOException;
import com.amarsoft.are.jbo.JBOFactory;
import com.amarsoft.are.jbo.JBOTransaction;
import com.amarsoft.are.util.StringFunction;
import com.amarsoft.awe.dw.ASObjectModel;
import com.amarsoft.awe.dw.ui.validator.ValidateRule;
import com.amarsoft.awe.util.Transaction;
import com.amarsoft.context.ASUser;
import com.tenwa.comm.util.jboutil.DataOperatorUtil;
import com.tenwa.flow.baseBussion.BaseBussiness;
import com.tenwa.flow.util.FlowUtil;
import com.tenwa.reckon.executor.CreateTransactionExecutor;
import com.tenwa.reckon.product.ProductCondition;
/**
* 项目基本信息初始化
* @author 我是周亚辉
@ -226,12 +231,16 @@ public class LBProjectIntoTempInitCarBusiness extends BaseBussiness {
String calType = "proj_process";
otherProperty.clear();
otherProperty.put("FLOWUNID",this.getAttribute("FlowUnid").toString());
BizObject proj = JBOFactory.getBizObjectManager( "jbo.com.tenwa.lease.comm.LB_PROJECT_INFO_TEMP", tx ).createQuery( "flowunid=:flowunid" ).setParameter( "flowunid", flowunid ).getSingleResult( false );
String sSerialType = ( proj == null ) ? "" : proj.getAttribute( "PROJECT_NO" ).getString();
String planNumber = SerialNumberUtil.getPlannumber( sSerialType, calType, tx );
String planNumber = SerialNumberUtil.getPlannumber(this.getAttribute("ProjectNo").toString(), calType, tx );
otherProperty.put("PROJECT_PLAN_NUMBER", planNumber);
ASObjectModel doTemp = new ASObjectModel("LoanSimulationBasicInfo");
/*设置模板属性*/
Vector<ValidateRule> vali=new Vector<ValidateRule>();
//费用规则
ProductCondition pc=new ProductCondition();
String calcRules=pc.getProductRules(doTemp, this.getAttribute("ProductId").toString(),vali);
// TO DO 补上商务条件剩余信息
DataOperatorUtil.copyJBOSet(PF_CALC_CONDITION.CLASS_NAME,fromCondtion,LC_CALC_CONDITION_TEMP.CLASS_NAME,null,otherProperty,null,tx);
@ -317,7 +326,8 @@ public class LBProjectIntoTempInitCarBusiness extends BaseBussiness {
}
}
}else{
//法人客户基本信息
BusinessApplicationPfToTemp.saveCompany(boCRT,serial);
}
bomC.saveObject(boCRT);
} catch (Exception e) {