From 74db9b24267e68425bd17d893cb427edf23c1ffe Mon Sep 17 00:00:00 2001 From: lixuebo Date: Wed, 14 Aug 2019 14:00:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=B9=B3=E5=8F=B0=E5=8F=91?= =?UTF-8?q?=E8=B5=B7=E6=B5=81=E7=A8=8B=E7=A7=9F=E9=87=91=E6=B5=8B=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../flow/action/comm/BaseFlowStartAction.java | 61 +++++++++++++++++++ .../BusinessApplicationPfToTemp.java | 25 +++++++- .../LBProjectIntoTempInitCarBusiness.java | 20 ++++-- 3 files changed, 100 insertions(+), 6 deletions(-) diff --git a/src_sys/com/tenwa/flow/action/comm/BaseFlowStartAction.java b/src_sys/com/tenwa/flow/action/comm/BaseFlowStartAction.java index 6dba4f5e1..3433f6a21 100644 --- a/src_sys/com/tenwa/flow/action/comm/BaseFlowStartAction.java +++ b/src_sys/com/tenwa/flow/action/comm/BaseFlowStartAction.java @@ -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 diff --git a/src_tenwa/com/tenwa/lease/flow/project/commbusiness/BusinessApplicationPfToTemp.java b/src_tenwa/com/tenwa/lease/flow/project/commbusiness/BusinessApplicationPfToTemp.java index 4e5476468..622db7e4b 100644 --- a/src_tenwa/com/tenwa/lease/flow/project/commbusiness/BusinessApplicationPfToTemp.java +++ b/src_tenwa/com/tenwa/lease/flow/project/commbusiness/BusinessApplicationPfToTemp.java @@ -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 */ diff --git a/src_tenwa/com/tenwa/lease/flow/project/commbusiness/LBProjectIntoTempInitCarBusiness.java b/src_tenwa/com/tenwa/lease/flow/project/commbusiness/LBProjectIntoTempInitCarBusiness.java index d81d092ee..ed2b6f3e5 100644 --- a/src_tenwa/com/tenwa/lease/flow/project/commbusiness/LBProjectIntoTempInitCarBusiness.java +++ b/src_tenwa/com/tenwa/lease/flow/project/commbusiness/LBProjectIntoTempInitCarBusiness.java @@ -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 vali=new Vector(); + //费用规则 + 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) {