This commit is contained in:
zhouyahui 2018-07-30 13:14:43 +08:00
commit 8436dc86c0
10 changed files with 255 additions and 209 deletions

View File

@ -110,7 +110,7 @@
dwTemp.genHTMLObjectWindow(flowunid);
String sButtons[][] = {
{"true","","Button","保存","保存所有修改","save()","","","",""}
{"0010,0020".indexOf(phaseNo)>-1?"false":"true","","Button","保存","保存所有修改","save()","","","",""}
};
%><%@ include file="/Frame/resources/include/ui/include_info.jspf"%>
<script type="text/javascript">

View File

@ -16,20 +16,6 @@
size="50" expireTime="1200" />
<cache name="JBO关联对象缓存" loadClass="com.amarsoft.asquery.JBORelatedObjLoader" />
<cache name="APP_CONFIG缓存"
loadClass="apx.com.amarsoft.als.base.cache.loader.AppConfigLoader" />
<cache name="APP_CODE缓存"
loadClass="apx.com.amarsoft.als.base.cache.loader.AppCodeLoader" size="1000000"
expireTime="600" />
<!-- 备注:元代买注释 解放启动时间 -->
<cache name="APP_DO缓存"
loadClass="apx.com.amarsoft.als.base.cache.loader.AppAweDoLoader"
size="1000000" expireTime="600" />
<!-- 备注国家行业map注释 解放启动时间 -->
<cache name="APP_Constant缓存"
loadClass="apx.com.amarsoft.als.base.cache.loader.AppConstantLoader" />
<!-- <cache name="SYSCONF_CLTYPE" loadClass="com.amarsoft.app.creditline.cache.loader.CreditLineTypeDefinitionLoader"/>额度类型信息
<cache name="SYSCONF_LIMITATIONTYPE" loadClass="com.amarsoft.app.creditline.cache.loader.LimitationTypeDefinitionLoader"/>额度限制类型信息
<cache name="SYSCONF_CL_ERROR_TYPE" loadClass="com.amarsoft.app.creditline.cache.loader.ErrorTypeDefinitionLoader"/>额度异常点类型信息 -->
@ -37,14 +23,24 @@
<cache name="核算交易定义" loadClass="com.amarsoft.app.als.sys.SystemConfigLoader" />
<cache name="产品参数"
loadClass="com.amarsoft.app.als.prd.config.loader.ProductConfigLoader" />
<!-- prd缓存 -->
<cache name="PRD_NODEINFO_CATA缓存"
loadClass="apx.com.amarsoft.als.base.cache.loader.AppPrdCataLoader" />
<cache name="PRD_NODEINFO_LIBRARY缓存"
loadClass="apx.com.amarsoft.als.base.cache.loader.AppPrdLibraryLoader" />
<cache name="PRD_NODEINFO_MIDDLE缓存"
loadClass="apx.com.amarsoft.als.base.cache.loader.AppPrdMiddleLoader" />
<cache name="APP_TEMPLATE缓存"
loadClass="apx.com.amarsoft.als.base.cache.loader.AppTemplateLoader" />
<!-- APP缓存 BEGIN -->
<!-- 加载app_config.properties 及 app登录人踢下线先暂时注释 -->
<cache name="APP_CONFIG缓存" loadClass="apx.com.amarsoft.als.base.cache.loader.AppConfigLoader" />
<!-- 加载code词典 -->
<cache name="APP_CODE缓存" loadClass="apx.com.amarsoft.als.base.cache.loader.AppCodeLoader" />
<!-- 加载AweDo 和 APPBusiness模板信息 -->
<cache name="APP_DO缓存" loadClass="apx.com.amarsoft.als.base.cache.loader.AppAweDoLoader" />
<!-- 加载app模板字段 -->
<cache name="APP_TEMPLATE缓存" loadClass="apx.com.amarsoft.als.base.cache.loader.AppTemplateLoader" />
<!-- 一次性加载国家|行业|省市区多级联动菜单 -->
<cache name="APP_Constant缓存" loadClass="apx.com.amarsoft.als.base.cache.loader.AppConstantLoader" />
<!-- 加载APP流程节点配置 -->
<cache name="PRD_NODEINFO_CATA缓存" loadClass="apx.com.amarsoft.als.base.cache.loader.AppPrdCataLoader" />
<!-- 加载APP页签配置 -->
<cache name="PRD_NODEINFO_LIBRARY缓存" loadClass="apx.com.amarsoft.als.base.cache.loader.AppPrdLibraryLoader" />
<!-- 加载APP流程节点绑定页签配置 -->
<cache name="PRD_NODEINFO_MIDDLE缓存" loadClass="apx.com.amarsoft.als.base.cache.loader.AppPrdMiddleLoader" />
<!-- APP缓存 END -->
</CacheConfig>

View File

@ -2883,6 +2883,29 @@
<property name="createKey" value="true" />
</managerProperties>
</manager>
</class>
<class name="CUSTOMER_TYPE_TEMP" label="客户类别表" keyAttributes="id">
<attributes>
<attribute name="id" label="标识" type="STRING" length="32"/>
<attribute name="customerid" label="客户编号" type="STRING" length="200"/>
<attribute name="custtype" label="客户类别" type="STRING" length="32"/>
<attribute name="custstatus" label="客户状态" type="STRING" length="32"/>
<attribute name="status" label="该类别是否有效" type="STRING" length="32"/>
<attribute name="isoriginal" label="是否原始类别" type="STRING" length="32"/>
<attribute name="inputorgid" label="登记机构" type="STRING" length="32"/>
<attribute name="inputuserid" label="登记人" type="STRING" length="32"/>
<attribute name="updateorgid" label="更新机构" type="STRING" length="32"/>
<attribute name="updateuserid" label="更新人员" type="STRING" length="32"/>
<attribute name="inputtime" label="登记时间" type="STRING" length="32"/>
<attribute name="updatetime" label="更新时间" type="STRING" length="32"/>
<attribute name="FLOWUNID" label="流程编号" type="STRING" length="32"/>
</attributes>
<manager>
<managerProperties>
<property name="table" value="CUSTOMER_TYPE_TEMP" />
<property name="createKey" value="true" />
</managerProperties>
</manager>
</class>
</package>
</jbo>

View File

@ -614,6 +614,7 @@ public class GetFlowAction {
param.put("AssignSubmittype", bo.getAttribute("Assignsubmittype").getString());
param.put("EndTime", bo.getAttribute("endtime").getString());
param.put("RoleId", curPage.getUser().hasRole("401")?"401":"");
param.put("flowstate", bo.getAttribute("flowstate").getString());
return param;
}
/**

View File

@ -64,7 +64,7 @@ public class LoanSimulationBasicInfoController {
LoanSimulationBasicService service = new LoanSimulationBasicServiceImpl();
try {
return service.saveInfo(request, response, tx, sqlca, ReturnMapUtil);
return service.run(request, response, tx, sqlca, ReturnMapUtil);
} catch (Exception e) {
return ReturnMapUtil.rollback(e);
}

View File

@ -37,8 +37,8 @@ public class CustomerPersonDoQueryManage extends AbstractAweDoQueryManage {
bo.setAttributeValue("CUSTOMERID", customerId);
bo.setAttributeValue("FULLNAME", cust.getAttribute("customername")
.getString());
bo.setAttributeValue("status", custtype.getAttribute("custstatus")
.getString());
// bo.setAttributeValue("status", custtype.getAttribute("custstatus")
// .getString());
bo.setAttributeValue("CERTTYPE", cust.getAttribute("certtype")
.getString());
bo.setAttributeValue("CERTID", cust.getAttribute("certid").getString());
@ -47,7 +47,7 @@ public class CustomerPersonDoQueryManage extends AbstractAweDoQueryManage {
}
protected void initDisplayForEdit(BizObject bo) throws JBOException {
String customerId = this.fieldMap.get("customerId").toString();
String customerId = bo.getAttribute("customerId").toString();
BizObject cust = JBOFactory
.getBizObjectManager(CUSTOMER_INFO.CLASS_NAME)
@ -62,13 +62,10 @@ public class CustomerPersonDoQueryManage extends AbstractAweDoQueryManage {
bo.setAttributeValue("CUSTOMERID", customerId);
bo.setAttributeValue("FULLNAME", cust.getAttribute("customername")
.getString());
bo.setAttributeValue("status", custtype.getAttribute("custstatus")
.getString());
bo.setAttributeValue("CERTTYPE", cust.getAttribute("certtype")
.getString());
bo.setAttributeValue("CERTID", cust.getAttribute("certid").getString());
bo.setAttributeValue("COUNTRY", cust.getAttribute("nationcode")
.getString());
// bo.setAttributeValue("status", custtype.getAttribute("custstatus"));
bo.setAttributeValue("CERTTYPE", cust.getAttribute("certtype"));
bo.setAttributeValue("CERTID", cust.getAttribute("certid"));
bo.setAttributeValue("COUNTRY", cust.getAttribute("nationcode"));
}
public void setFieldMap(Map<String, Object> fieldMap) {

View File

@ -398,95 +398,71 @@ public class TenwaFlowTask extends FlowTask {
* @throws Exception
*/
public String getFlowRebackInfo() throws Exception {
Map<String, Object> resultJson = new HashMap<String, Object>();
BizObjectManager bm = JBOFactory.getBizObjectManager(FLOW_MODEL.CLASS_NAME, this.baseTrans);
BizObject bo = bm.createQuery("flowno=:flowno and phaseno=:phaseno").setParameter("flowno", this.FlowNo).setParameter("phaseno", this.PhaseNo).getSingleResult(false);
String backnexttype = bo.getAttribute("BACKSTEPNEXTTYPE").getString();// backnextCust
String backSteps = bo.getAttribute("BACKSTEPS").getString();// 01申请人发起(0010)
List<Map<String, String>> backStepList = new ArrayList<Map<String, String>>();
resultJson.put("backnexttype", backnexttype);
resultJson.put("backstept", backStepList);
BizObjectManager bm = JBOFactory.getBizObjectManager(
FLOW_MODEL.CLASS_NAME, this.baseTrans);
BizObject bo = bm.createQuery("flowno=:flowno and phaseno=:phaseno")
.setParameter("flowno", this.FlowNo)
.setParameter("phaseno", this.PhaseNo).getSingleResult(false);
String backnexttype = bo.getAttribute("BACKSTEPNEXTTYPE").getString();
if (backnexttype == "") {
backnexttype = "";
}
String backSteps = bo.getAttribute("BACKSTEPS").getString();
String returnMessage = "{\"backnexttype\":\"" + backnexttype
+ "\",\"backstept\":[";
String fixedSteps = "";
if (backSteps != null && backSteps.length() > 1) {
if (backSteps.length() > 1) {
fixedSteps = this.getBackStepsByConfig(backSteps);
}
String sql = "";
Map<String,String>condition=new HashMap<String,String>();
if (backSteps.length() <= 1) {
//没有判断退回路径时
if(this.ForkState.equals("INFORK")){
//第一种并行中退回
sql="select o.phaseno,o.phasename from (";
sql=sql+ " SELECT * FROM flow_task START WITH serialno =:serialno CONNECT BY PRIOR relativeserialno = serialno ";
sql=sql+" )o left join FLOW_MODEL fm on o.phaseno=fm.phaseno and o.flowno=fm.flowno where to_number(fm.phaseno)<to_number('" + this.PhaseNo + "') and (nvl(o.forkstate,'e') <>'INFORK' OR (nvl(o.forkstate,'e') ='INFORK' and forkno=:forkno) )and fm.ATTRIBUTE7='01' order by begintime";
condition.put("serialno", this.RelativeSerialNo);
condition.put("forkno", this.ForkNo);
}else{
//第二种一般路径不能退回并行中
sql="select o.phaseno,o.phasename from ( ";
sql=sql+" SELECT * FROM flow_task START WITH serialno =:serialno CONNECT BY PRIOR relativeserialno = serialno ";
sql=sql+" )o left join FLOW_MODEL fm on o.phaseno=fm.phaseno and o.flowno=fm.flowno where to_number(fm.phaseno)<to_number('" + this.PhaseNo + "') and nvl(o.forkstate,'e') <>'INFORK' and fm.ATTRIBUTE7='01' order by begintime";
condition.put("serialno", this.RelativeSerialNo);
}
sql = " SELECT O.phaseno,O.phasename FROM O left join jbo.sys.FLOW_MODEL fm on o.phaseno=fm.phaseno and o.flowno=fm.flowno WHERE o.flowno=:flowno and o.objectno='"
+ this.ObjectNo + "' ";
sql += "AND O.phaseno<'"
+ this.PhaseNo
+ "' and fm.ATTRIBUTE7='01' order by O.phaseno DESC,begintime desc";
} else {
sql = " SELECT O.phaseno,O.phasename FROM flow_task O WHERE o.flowno=:flowno and o.objectno=:objectno ";
sql += "AND O.phaseno in (" + fixedSteps + ") order by O.phaseno DESC,begintime desc";
condition.put("flowno", this.FlowNo);
condition.put("objectno", this.ObjectNo);
sql = " SELECT O.phaseno,O.phasename FROM O WHERE o.flowno=:flowno and o.objectno='"
+ this.ObjectNo + "' ";
sql += "AND O.phaseno in (" + fixedSteps
+ ") order by O.phaseno DESC,begintime desc";
}
List<Map<String,String>>bos= DataOperatorUtil.getDataBySql(this.baseTrans,sql,condition);
BizObjectManager taskManages = JBOFactory.getBizObjectManager(FLOW_TASK.CLASS_NAME, this.baseTrans);
if(bos.size() == 0 && this.RelativeSerialNo != null) {
BizObject fromTask = null;
if(this.AssignedTaskNo.length() > 0) {
BizObjectQuery fromQuery = taskManages.createQuery("o.flowno=:flowno and o.objectno=:objectno and o.flowstate in ('START','NORMAL') and o.phaseopinion1=:phaseopinion1");
fromQuery.setParameter("flowno", this.FlowNo);
fromQuery.setParameter("objectno", this.ObjectNo);
fromQuery.setParameter("phaseopinion1", this.PhaseNo);
List<BizObject> result = fromQuery.getResultList(false);
if (result.size() > 0) {
fromTask = result.get(0);
}
}
if(fromTask == null) {
BizObjectQuery fromQuery = taskManages.createQuery("o.SerialNo=:SerialNo and o.objectno=:objectno");
fromQuery.setParameter("SerialNo", this.RelativeSerialNo);
fromQuery.setParameter("objectno", this.ObjectNo);
fromTask = fromQuery.getSingleResult(false);
}
if(fromTask != null) {
Map<String, String> step = new HashMap<String, String>();
step.put("phaseNo", fromTask.getAttribute("phaseno").getString());
step.put("phaseName", fromTask.getAttribute("phasename").getString());
backStepList.add(step);
}
}
// else if (backSteps.length() == 0) {
// // 加载退回上一步
// Map<String, String> step = new HashMap<String, String>();
// step.put("phaseNo", bos.get(0).getAttribute("phaseno").getString());
// step.put("phaseName", bos.get(0).getAttribute("phasename").getString());
// backStepList.add(step);
// }
else {
List<BizObject> bos = JBOFactory
.getBizObjectManager(FLOW_TASK.CLASS_NAME, this.baseTrans)
.createQuery(sql).setParameter("flowno", this.FlowNo)
.getResultList(false);
if (backSteps.length() == 0) {
// ¼ÓÔØÍË»ØÉÏÒ»²½
returnMessage += "{\"phaseNo\":\""
+ bos.get(0).getAttribute("phaseno").getString()
+ "\",\"phaseName\":\""
+ bos.get(0).getAttribute("phasename").getString() + "\"}";
} else {
Map<String, String> tasks = new HashMap<String, String>();
int findex = 0;
for (int i = 0; i < bos.size(); i++) {
if (!tasks.containsKey(bos.get(i).get("PHASENO"))) {
tasks.put(bos.get(i).get("PHASENO"), "");
Map<String, String> step = new HashMap<String, String>();
step.put("phaseNo", bos.get(i).get("PHASENO"));
step.put("phaseName", bos.get(i).get("PHASENAME"));
backStepList.add(step);
if (!tasks.containsKey(bos.get(i).getAttribute("phaseno")
.getString())) {
findex++;
if (findex > 1) {
returnMessage += ",";
}
tasks.put(bos.get(i).getAttribute("phaseno").getString(),
"");
returnMessage += "{\"phaseNo\":\""
+ bos.get(i).getAttribute("phaseno").getString()
+ "\",\"phaseName\":\""
+ bos.get(i).getAttribute("phasename").getString()
+ "\"}";
}
}
}
return JSON.toJSONString(resultJson);
returnMessage += "]}";
return returnMessage;
}
/**
* 获得流程退回信息
*

View File

@ -143,8 +143,8 @@ public class BusinessApproveManager {
public String saveApproveOpinion(JBOTransaction tx){
try{
BizObjectManager bomFT = JBOFactory.getBizObjectManager(FLOW_TASK.CLASS_NAME,tx);
BizObject boFT = bomFT.createQuery("objectno=:flowunid and phaseno=:phaseNo and relativeobjectno is not null")
.setParameter("flowunid", flowunid).setParameter("phaseNo", phaseNo).getSingleResult(true);
BizObject boFT = bomFT.createQuery("objectno=:flowunid and phaseno=:phaseNo and serialno=:serialno and relativeobjectno is not null")
.setParameter("flowunid", flowunid).setParameter("phaseNo", phaseNo).setParameter("serialno", serialNo).getSingleResult(true);
BizObjectManager bomFO = JBOFactory.getBizObjectManager(FLOW_OPINION.CLASS_NAME,tx);
BizObject bo = bomFO.createQuery("serialno='"+serialNo+"'").getSingleResult(true);
if(boFT != null){

View File

@ -17,6 +17,8 @@ import jbo.app.tenwa.customer.CUSTOMER_INFO;
import jbo.app.tenwa.customer.CUSTOMER_INFO_TEMP;
import jbo.app.tenwa.customer.CUSTOMER_PERSON;
import jbo.app.tenwa.customer.CUSTOMER_PERSON_TEMP;
import jbo.app.tenwa.customer.CUSTOMER_TYPE;
import jbo.app.tenwa.customer.CUSTOMER_TYPE_TEMP;
import com.amarsoft.are.jbo.BizObject;
import com.amarsoft.awe.util.Transaction;
@ -37,6 +39,7 @@ public class LBCustomerRelaTempToFormalBusiness extends BaseBussiness {
Map<String,String>otherProperty=new HashMap<String,String>();
otherProperty.put("customerid", unionList.size()>0?unionList.get(0).getAttribute("customerid").toString():UUID.randomUUID().toString().replaceAll("-", ""));
DataOperatorUtil.copyJBOSet(CUSTOMER_INFO_TEMP.CLASS_NAME, fromCondtion,CUSTOMER_INFO.CLASS_NAME, null,otherProperty,cc, Sqlca);
DataOperatorUtil.copyJBOSet(CUSTOMER_TYPE_TEMP.CLASS_NAME, fromCondtion,CUSTOMER_TYPE.CLASS_NAME, null,otherProperty,cc, Sqlca);
for(BizObject union:unionList){
fromCondtion.clear();
fromCondtion.put("customerid", union.getAttribute("customerid").getString());
@ -69,7 +72,7 @@ public class LBCustomerRelaTempToFormalBusiness extends BaseBussiness {
DataOperatorUtil.copyJBOSet(CUSTOMER_ADDRESS_TEMP.CLASS_NAME, fromCondtion, CUSTOMER_ADDRESS.CLASS_NAME, toCondtion, null, cc, Sqlca);
}*/
String sMessage="true";
String sMessage="true";
return sMessage;
}
}

View File

@ -1,115 +1,164 @@
package com.tenwa.lease.flow.project.commbusiness;
import jbo.app.tenwa.customer.CUSTOMER_COMPANY_TEMP;
import jbo.app.tenwa.customer.CUSTOMER_INFO_TEMP;
import jbo.app.tenwa.customer.CUSTOMER_PERSON_TEMP;
import jbo.app.tenwa.customer.CUSTOMER_TYPE_TEMP;
import jbo.app.tenwa.customer.DISTRIBUTOR_INFO;
import jbo.com.tenwa.lease.carbrand.BUSINESS_STATUS;
import jbo.com.tenwa.lease.comm.LB_EQUIPMENT_CAR_TEMP;
import jbo.com.tenwa.lease.comm.LB_PROJECT_INFO_TEMP;
import jbo.com.tenwa.lease.comm.LB_UNION_LESSEE_TEMP;
import com.amarsoft.are.jbo.BizObject;
import com.amarsoft.are.jbo.BizObjectManager;
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.util.Transaction;
import com.amarsoft.context.ASUser;
import com.tenwa.flow.baseBussion.BaseBussiness;
/**
* 项目基本信息初始化
* @author xu
*
* @author 我是周亚辉
* 存量客户未考虑,待后期周亚辉完善不会完善跳起来打
*/
public class LBProjectIntoTempInitCarBusiness extends BaseBussiness {
@Override
public Object run(Transaction Sqlca) throws Exception {
this.initBussinessParam(Sqlca);
BizObjectManager bm = JBOFactory.getBizObjectManager(LB_PROJECT_INFO_TEMP.CLASS_NAME);
BizObjectManager bmCPT = JBOFactory.getBizObjectManager(CUSTOMER_PERSON_TEMP.CLASS_NAME,Sqlca);
BizObjectManager bmLULT = JBOFactory.getBizObjectManager(LB_UNION_LESSEE_TEMP.CLASS_NAME,Sqlca);
BizObjectManager bmCCT = JBOFactory.getBizObjectManager(CUSTOMER_COMPANY_TEMP.CLASS_NAME,Sqlca);
BizObjectManager bmLECT = JBOFactory.getBizObjectManager(LB_EQUIPMENT_CAR_TEMP.CLASS_NAME,Sqlca);
// BizObjectManager bmLCIT = JBOFactory.getBizObjectManager(LB_CONTRACT_INFO_TEMP.CLASS_NAME,Sqlca);
BizObjectManager bmCI = JBOFactory.getBizObjectManager(CUSTOMER_INFO_TEMP.CLASS_NAME,Sqlca);
Sqlca.join(bm);
BizObject bo = bm.newObject();
BizObject boLULT = bmLULT.newObject();
BizObject bmLEC = bmLECT.newObject();
//BizObject bmLCI = bmLCIT.newObject();
BizObject bmC = bmCI.newObject();
this.initBussinessParam(Sqlca);
ASUser asUser=new ASUser(this.getAttribute("CurUserID").toString());
initBusinessApply(Sqlca,asUser);
String sMessage="true";
return sMessage;
}
public String initBusinessApply(JBOTransaction tx,ASUser asUser) throws Exception {
String className = "";
String colName = "";
if("03".equals(this.getAttribute("CustomerType"))){ // 自然人
className = CUSTOMER_PERSON_TEMP.CLASS_NAME;
colName = "FULLNAME";
}else{ // 法人
className = CUSTOMER_COMPANY_TEMP.CLASS_NAME;
colName = "enterprisename";
}
BizObjectManager bmCTT =JBOFactory.getBizObjectManager(CUSTOMER_TYPE_TEMP.CLASS_NAME,tx);
BizObjectManager bomC = JBOFactory.getBizObjectManager(className); //自然人表或者法人信息表
BizObjectManager bm = JBOFactory.getBizObjectManager(LB_PROJECT_INFO_TEMP.CLASS_NAME,tx);
BizObjectManager bmLULT = JBOFactory.getBizObjectManager(LB_UNION_LESSEE_TEMP.CLASS_NAME,tx);
BizObjectManager bmLECT = JBOFactory.getBizObjectManager(LB_EQUIPMENT_CAR_TEMP.CLASS_NAME,tx);
BizObjectManager bmCI = JBOFactory.getBizObjectManager(CUSTOMER_INFO_TEMP.CLASS_NAME,tx);
BizObjectManager bsbom = JBOFactory.getBizObjectManager(BUSINESS_STATUS.CLASS_NAME, tx);
String deptid = asUser.getOrgID();
String distributoIid="";
String vndrName="";
if(deptid.startsWith("8006")) {
BizObject distributor_bo=JBOFactory.createBizObjectQuery(DISTRIBUTOR_INFO.CLASS_NAME,"orgid=:orgid").setParameter("orgid",deptid).getSingleResult(false);
if(distributor_bo!=null){
distributoIid=distributor_bo.getAttribute("distributor_no").toString();
vndrName=distributor_bo.getAttribute("distributor_name").toString();
}
}
BizObject bmC = this.saveCustomerInfo(bmCI, tx, asUser,distributoIid);//新增主表客户信息
String customerId = bmC.getAttribute("customerid").getString();
this.saveCustomerType(bmCTT, tx, customerId,asUser);//证件类型临时表
this.savePersonOrCompany(bomC, tx, colName,customerId,asUser);//自然人||法人
this.saveEquipmentCar(bmLECT, tx, asUser,vndrName); //车辆租赁物信息表
this.saveUnionLessee(bmLULT, tx, customerId, asUser);//union表
this.saveProjInfo(bm, tx, asUser,distributoIid);//保存项目信息表
this.saveBusinessStatus(bsbom, tx, asUser);//项目进度表
String sMessage="true";
return sMessage;
}
private BizObject saveCustomerInfo(BizObjectManager bomCI,JBOTransaction tx,ASUser asUser,String distributoIid)throws JBOException{
BizObject bmC = bomCI.newObject();//保存客户信息
try {
//客户信息表
bmC.setAttributeValue("customername", this.getAttribute("custname"));//自然人名称
bmC.setAttributeValue("customertype", this.getAttribute("CustomerType"));//客户类型
bmC.setAttributeValue("distributor_id", distributoIid);
bmC.setAttributeValue("certtype", this.getAttribute("certtype"));//证件类型
bmC.setAttributeValue("certid", this.getAttribute("certid"));//证件号
bmC.setAttributeValue("inputuserid", asUser.getUserID());//登记人
bmC.setAttributeValue("inputorgid", asUser.getOrgID());//登记部门
bmC.setAttributeValue("flowunid", this.getAttribute("FlowUnid"));//流程ID
bmC.setAttributeValue("inputtime", StringFunction.getTodayNow());//登记时间,系统当前时间
bmCI.saveObject(bmC);
String customerId = bmC.getAttribute("customerid").getString();
String deptid = asUser.getOrgID() ;
if(deptid.startsWith("8006")) {
BizObject distributor_bo=JBOFactory.createBizObjectQuery(DISTRIBUTOR_INFO.CLASS_NAME,"orgid=:orgid").setParameter("orgid",deptid).getSingleResult(false);
if(distributor_bo!=null) {
bmC.setAttributeValue("distributor_id",distributor_bo.getAttribute("distributor_no"));//经销商ID
}
}
/* //合同信息表
bmLCI.setAttributeValue("FLOWUNID", this.getAttribute("FlowUnid"));//流程ID
bmLCI.setAttributeValue("PRODUCT_ID", this.getAttribute("ProductId"));//产品ID
String versionID = UUID.randomUUID().toString().replaceAll("-", "");
bmLCI.setAttributeValue("VERSIONID", versionID);//版本ID
bmLCI.setAttributeValue("INPUTUSERID", asUser.getUserID());//登记人
bmLCI.setAttributeValue("INPUTORGID", asUser.getOrgID());//登记部门
bmLCI.setAttributeValue("INPUTTIME", StringFunction.getTodayNow());//登记时间,系统当前时间
*/
BizObject boCRT = null;
BizObject bmCC = null;
if("03".equals(this.getAttribute("CustomerType"))){//自然人
boCRT = bmCPT.newObject();
//自然人信息表
boCRT.setAttributeValue("flowunid", this.getAttribute("FlowUnid"));//流程ID
boCRT.setAttributeValue("customerid", customerId);//自然人ID
boCRT.setAttributeValue("FULLNAME", this.getAttribute("custname"));//自然人名称
boCRT.setAttributeValue("CERTTYPE", this.getAttribute("certtype"));//证件类型
boCRT.setAttributeValue("CERTID", this.getAttribute("certid"));//自然人证件号
boCRT.setAttributeValue("INPUTUSERID", asUser.getUserID());//登记人
boCRT.setAttributeValue("INPUTORGID", asUser.getOrgID());//登记部门
boCRT.setAttributeValue("inputtime", StringFunction.getTodayNow());//登记时间,系统当前时间
boCRT.setAttributeValue("BALANCESHEET", "申请人");
bmCPT.saveObject(boCRT);
}else{
bmCC = bmCCT.newObject();
bmCC.setAttributeValue("flowunid", this.getAttribute("FlowUnid"));//流程ID
bmCC.setAttributeValue("customerid", customerId);//法人ID
bmCC.setAttributeValue("enterprisename", this.getAttribute("custname"));//法人名称
bmCC.setAttributeValue("certid", this.getAttribute("certid"));//法人证件号
bmCC.setAttributeValue("certtype", this.getAttribute("certtype"));//证件类型
bmCC.setAttributeValue("inputuserid", asUser.getUserID());//登记人
bmCC.setAttributeValue("inputorgid", asUser.getOrgID());//登记部门
bmCC.setAttributeValue("inputtime", StringFunction.getTodayNow());//登记时间,系统当前时间
bmCCT.saveObject(bmCC);
}
//车辆租赁物信息表
bomCI.saveObject(bmC);
} catch (Exception e) {
tx.rollback();
e.printStackTrace();
}
return bmC;
}
private void savePersonOrCompany(BizObjectManager bomC,JBOTransaction tx,String colName,String customerId,ASUser asUser)throws JBOException{
BizObject boCRT = bomC.newObject();//新建自然人||法人
try {
boCRT.setAttributeValue("flowunid", this.getAttribute("FlowUnid"));//流程ID
boCRT.setAttributeValue("customerid", customerId);//自然人ID
boCRT.setAttributeValue(colName, this.getAttribute("custname"));//自然人名称
boCRT.setAttributeValue("CERTTYPE", this.getAttribute("certtype"));//证件类型
boCRT.setAttributeValue("CERTID", this.getAttribute("certid"));//自然人证件号
boCRT.setAttributeValue("INPUTUSERID", asUser.getUserID());//登记人
boCRT.setAttributeValue("INPUTORGID", asUser.getOrgID());//登记部门
boCRT.setAttributeValue("inputtime", StringFunction.getTodayNow());//登记时间,系统当前时间
if("03".equals(this.getAttribute("CustomerType")))boCRT.setAttributeValue("BALANCESHEET", "申请人");
bomC.saveObject(boCRT);
} catch (Exception e) {
tx.rollback();
e.printStackTrace();
}
}
//存储客户类型信息(仅用于承租人)
private void saveCustomerType(BizObjectManager bomCT,JBOTransaction tx,String customerId,ASUser asUser) throws JBOException{
BizObject boCT = bomCT.newObject();//保存客户类型
try {
boCT.setAttributeValue("CUSTOMERID", customerId);
boCT.setAttributeValue("custstatus", "status02");
boCT.setAttributeValue("status", "valid");
boCT.setAttributeValue("isoriginal", "yes");
boCT.setAttributeValue("CUSTTYPE", "cust_type.cust"); //承租人
boCT.setAttributeValue("INPUTUSERID", asUser.getUserID());
boCT.setAttributeValue("INPUTORGID", asUser.getOrgID());
boCT.setAttributeValue("INPUTTIME", StringFunction.getTodayNow());
boCT.setAttributeValue("FLOWUNID", this.getAttribute("FlowUnid"));
bomCT.saveObject(boCT);
} catch (Exception e) {
tx.rollback();
e.printStackTrace();
}
}
private void saveEquipmentCar(BizObjectManager bomCI,JBOTransaction tx,ASUser asUser,String vndrName)throws JBOException{
BizObject bmLEC = bomCI.newObject();//保存客户信息
try {
//客户信息表
bmLEC.setAttributeValue("PROJECT_ID",this.getAttribute("ProjectId"));//项目ID
bmLEC.setAttributeValue("FLOWUNID", this.getAttribute("FlowUnid"));//流程ID
bmLEC.setAttributeValue("BRAND", this.getAttribute("productModel"));//品牌
bmLEC.setAttributeValue("car_series", this.getAttribute("carSeries"));//车系
bmLEC.setAttributeValue("MODEL", this.getAttribute("carSystem"));//型号
bmLEC.setAttributeValue("modelId", this.getAttribute("modelid"));//车型ID
bmLEC.setAttributeValue("NOW_TOTAL", this.getAttribute("price"));//车辆指导价
// bmLEC.setAttributeValue("VNDR_NAME", asUser.getUserName());//供应商
bmLEC.setAttributeValue("VNDR_NAME", vndrName);//供应商
bmLEC.setAttributeValue("DISPLACEMENT", this.getAttribute("liter"));//排量
bmLEC.setAttributeValue("gears", this.getAttribute("geartype"));//档位
bmLEC.setAttributeValue("INPUTUSERID", asUser.getUserID());//登记人
bmLEC.setAttributeValue("INPUTORGID", asUser.getOrgID());//登记部门
bmLEC.setAttributeValue("INPUTTIME", StringFunction.getTodayNow());//登记时间,系统当前时间
//承租人信息表
bomCI.saveObject(bmLEC);
} catch (Exception e) {
tx.rollback();
e.printStackTrace();
}
}
private void saveUnionLessee(BizObjectManager bomLUL,JBOTransaction tx,String customerId,ASUser asUser)throws Exception {
BizObject boLULT = bomLUL.newObject();//保存联合承租人信息
try {
//联合承租人信息表
boLULT.setAttributeValue("FLOWUNID", this.getAttribute("FlowUnid"));//流程ID
boLULT.setAttributeValue("CUSTOMER_ID", customerId);//承租人ID
boLULT.setAttributeValue("CUSTOMER_NAME", this.getAttribute("custname"));//承租人名称
@ -118,22 +167,22 @@ public class LBProjectIntoTempInitCarBusiness extends BaseBussiness {
boLULT.setAttributeValue("INPUTUSERID", asUser.getUserID());//登记人
boLULT.setAttributeValue("INPUTORGID", asUser.getOrgID());//登记部门
boLULT.setAttributeValue("INPUTTIME", StringFunction.getTodayNow());//登记时间,系统当前时间
//项目信息表
String inputorgid = asUser.getOrgID() ;
if(inputorgid.startsWith("8006")) {
BizObject distributor_bo=JBOFactory.createBizObjectQuery(DISTRIBUTOR_INFO.CLASS_NAME,"orgid=:orgid").setParameter("orgid",inputorgid).getSingleResult(false);
if(distributor_bo!=null) {
bo.setAttributeValue("distributor_id",distributor_bo.getAttribute("distributor_no"));//经销商ID
bmLEC.setAttributeValue("VNDR_NAME", distributor_bo.getAttribute("distributor_name"));//将经销商名称放到租赁物中的经销商名称中
}
}
bomLUL.saveObject(boLULT);
} catch (Exception e) {
tx.rollback();
e.printStackTrace();
}
}
private void saveProjInfo(BizObjectManager bomLPI,JBOTransaction tx ,ASUser asUser,String distributoIid) throws Exception{
BizObject bo = bomLPI.newObject();//保存项目信息
try {
bo.setAttributeValue(LB_PROJECT_INFO_TEMP.distributor_id, distributoIid);
bo.setAttributeValue("FLOWUNID", this.getAttribute("FlowUnid"));//流程ID
bo.setAttributeValue("id", this.getAttribute("ProjectId"));//项目ID
bo.setAttributeValue("PROJECT_NO",this.getAttribute("ProjectNo"));//申请编号
bo.setAttributeValue("project_name",this.getAttribute("ProjectNo")+"-"+this.getAttribute("ProductName"));
bo.setAttributeValue("CAR_TYPE",this.getAttribute("carAttributes"));//车辆属性
bo.setAttributeValue("LEAS_FORM", this.getAttribute("leasehold"));//租赁方式
//bo.setAttributeValue("VERSIONID", versionID);//版本ID
bo.setAttributeValue("PRODUCT_ID",this.getAttribute("ProductId"));//产品ID
bo.setAttributeValue("PRODUCT_NAME",this.getAttribute("ProductName"));//产品名称
bo.setAttributeValue("Is_Flow","inFlow");//在流程中-inFlow流程结束-outFlow
@ -142,26 +191,27 @@ public class LBProjectIntoTempInitCarBusiness extends BaseBussiness {
bo.setAttributeValue("INPUTTIME", StringFunction.getTodayNow());//登记时间,系统当前时间
bo.setAttributeValue("BUSINESSTYPE", this.getAttribute("businessType"));//业务类型
bo.setAttributeValue("project_manage",asUser.getUserID());//项目经理
bo.setAttributeValue("project_dept",inputorgid);//出单部门
bo.setAttributeValue("project_dept",asUser.getOrgID());//出单部门
bo.setAttributeValue("PROJECT_STATUS","0");//项目状态
bo.setAttributeValue("PROJECT_DATE",StringFunction.getTodayNow());//项目状态
bm.saveObject(bo);
bmLULT.saveObject(boLULT);
bmLECT.saveObject(bmLEC);
//bmLCIT.saveObject(bmLCI);
bmCI.saveObject(bmC);
//入项目进度表
BizObjectManager bsbom = JBOFactory.getBizObjectManager(BUSINESS_STATUS.CLASS_NAME, Sqlca);
BizObject bsbo = bsbom.newObject();
bsbo.setAttributeValue(BUSINESS_STATUS.contract_number,this.getAttribute("ProjectNo"));
bsbo.setAttributeValue(BUSINESS_STATUS.business_status,"1");
bsbo.setAttributeValue(BUSINESS_STATUS.inputuserid,asUser.getUserID());
bsbo.setAttributeValue(BUSINESS_STATUS.inputtime,StringFunction.getTodayNow());
bsbo.setAttributeValue(BUSINESS_STATUS.inputorgid,asUser.getOrgID());
bsbom.saveObject(bsbo);
String sMessage="true";
return sMessage;
bomLPI.saveObject(bo);
}catch (Exception e){
tx.rollback();
e.printStackTrace();
}
}
private void saveBusinessStatus(BizObjectManager bsbom,JBOTransaction tx ,ASUser asUser) throws Exception{
BizObject bsbo = bsbom.newObject();
try {
bsbo.setAttributeValue(BUSINESS_STATUS.contract_number,this.getAttribute("ProjectNo"));
bsbo.setAttributeValue(BUSINESS_STATUS.business_status,"1");
bsbo.setAttributeValue(BUSINESS_STATUS.inputuserid,asUser.getUserID());
bsbo.setAttributeValue(BUSINESS_STATUS.inputtime,StringFunction.getTodayNow());
bsbo.setAttributeValue(BUSINESS_STATUS.inputorgid,asUser.getOrgID());
bsbom.saveObject(bsbo);
}catch (Exception e){
tx.rollback();
e.printStackTrace();
}
}
}