添加法人客户额度池

This commit is contained in:
tangfutang 2019-08-07 15:04:56 +08:00
parent c13db58982
commit ebaddfaaca
3 changed files with 88 additions and 28 deletions

View File

@ -41,6 +41,8 @@
// $("#STATUS_0").prop("checked", true);
init();
changeOtherRequired();
$("#STARTTIME").attr("ReadOnly","true");
$("#ENDTIME").attr("ReadOnly","true");
})
function init(){//根据国别确定省和城市是否必填
var custtypes = $("input[name='CUSTTYPE']").length;

View File

@ -4674,7 +4674,7 @@
</managerProperties>
</manager>
</class>
<class name="LB_EQUIPMENT_CAR_TEMP" label="二手车信息临时表" keyAttributes="ID">
<attributes>
<attribute name="ID" label="标识" type="STRING" length="32"/>
@ -4779,8 +4779,31 @@
<property name="createKey" value="true" />
</managerProperties>
</manager>
</class>
</class>
<class name="CUSTOMER_QUOTA_MONEY" label="客户信用额度" keyAttributes="id">
<attributes>
<attribute name="id" label="标识" type="STRING" length="32"/>
<attribute name="customerid" label="客户编码" type="STRING" length="32"/>
<attribute name="starttime" label="开始时间" type="STRING" length="32"/>
<attribute name="endtime" label="结束时间" type="STRING" length="32"/>
<attribute name="quotamoney" label="额度金额" type="STRING" length="20"/>
<attribute name="Remarks" label="备注" type="STRING" length="50"/>
<attribute name="key1" label="预留" type="STRING" length="50"/>
<attribute name="INPUTUSERID" label="登记人" type="STRING" length="32"/>
<attribute name="INPUTORGID" label="登记部门" type="STRING" length="32"/>
<attribute name="INPUTTIME" label="登记时间" type="STRING" length="32"/>
<attribute name="UPDATEUSERID" label="更新人" type="STRING" length="32"/>
<attribute name="UPDATEORGID" label="更新部门" type="STRING" length="32"/>
<attribute name="UPDATETIME" label="更新时间" type="STRING" length="32"/>
</attributes>
<manager>
<managerProperties>
<property name="table" value="customer_quota_money" />
<property name="createKey" value="true" />
</managerProperties>
</manager>
</class>
</package>
<package name="jbo.guaranty">
<class name="GUARANTY_CONTRACT" label="担保合同信息" keyAttributes="SERIALNO">

View File

@ -1,5 +1,6 @@
package com.tenwa.customer.handler.company;
import jbo.app.CUSTOMER_QUOTA_MONEY;
import jbo.app.tenwa.customer.CUSTOMER_INFO;
import jbo.app.tenwa.customer.CUSTOMER_TYPE;
@ -80,31 +81,42 @@ public class NewCustomerCompanyHandler extends CommonHandler{
protected void afterInsert(JBOTransaction tx, BizObject bo)
throws Exception {
//同步更新customer_info custkind字段和customer_type custstatus字段
String customerId=this.asPage.getAttribute("customerId").toString();
String custkind=bo.getAttribute("custkind").toString();
BizObjectManager custManager = JBOFactory.getBizObjectManager(CUSTOMER_INFO.CLASS_NAME);
BizObject cust = custManager.createQuery("customerid=:customerid ").setParameter("customerid",customerId).getSingleResult(true);
BizObjectManager custtypeManager = JBOFactory.getBizObjectManager(CUSTOMER_TYPE.CLASS_NAME);
BizObject custtype=custtypeManager.createQuery("customerid=:customerid and custtype='cust_type.cust'")
.setParameter("customerid",customerId).getSingleResult(true);
if(!custtype.getAttribute("custstatus").getString().equals(bo.getAttribute("status").getString())){
BizObjectQuery custtypebq = custtypeManager.createQuery("update O set custstatus=:custstatus,updateuserid=:updateuserid,updatetime=:updatetime,updateorgid=:updateorgid where customerid= :customerid and custtype='cust_type.cust'");
custtypebq.setParameter("custstatus",bo.getAttribute("status").getString());
custtypebq.setParameter("customerid",customerId);
custtypebq.setParameter("updateuserid", curUser.getUserID());
custtypebq.setParameter("updatetime",DateAssistant.getTodayNow());
custtypebq.setParameter("updateorgid",curUser.getOrgID());
custtypebq.executeUpdate();
}
if(!cust.getAttribute("custkind").getString().equals(bo.getAttribute("custkind").getString())){
BizObjectQuery custbq = custManager.createQuery("update O set custkind=:custkind,updateuserid=:updateuserid,updatetime=:updatetime,updateorgid=:updateorgid where customerid= :customerid ");
custbq.setParameter("customerid",customerId);
custbq.setParameter("updateuserid", curUser.getUserID());
custbq.setParameter("updatetime",DateAssistant.getTodayNow());
custbq.setParameter("updateorgid",curUser.getOrgID());
custbq.setParameter("custkind",custkind);
custbq.executeUpdate();
}
String customerId=this.asPage.getAttribute("customerId").toString();
String custkind=bo.getAttribute("custkind").toString();
BizObjectManager custManager = JBOFactory.getBizObjectManager(CUSTOMER_INFO.CLASS_NAME);
BizObject cust = custManager.createQuery("customerid=:customerid ").setParameter("customerid",customerId).getSingleResult(true);
BizObjectManager custtypeManager = JBOFactory.getBizObjectManager(CUSTOMER_TYPE.CLASS_NAME);
BizObject custtype=custtypeManager.createQuery("customerid=:customerid and custtype='cust_type.cust'")
.setParameter("customerid",customerId).getSingleResult(true);
if(!custtype.getAttribute("custstatus").getString().equals(bo.getAttribute("status").getString())){
BizObjectQuery custtypebq = custtypeManager.createQuery("update O set custstatus=:custstatus,updateuserid=:updateuserid,updatetime=:updatetime,updateorgid=:updateorgid where customerid= :customerid and custtype='cust_type.cust'");
custtypebq.setParameter("custstatus",bo.getAttribute("status").getString());
custtypebq.setParameter("customerid",customerId);
custtypebq.setParameter("updateuserid", curUser.getUserID());
custtypebq.setParameter("updatetime",DateAssistant.getTodayNow());
custtypebq.setParameter("updateorgid",curUser.getOrgID());
custtypebq.executeUpdate();
}
if(!cust.getAttribute("custkind").getString().equals(bo.getAttribute("custkind").getString())){
BizObjectQuery custbq = custManager.createQuery("update O set custkind=:custkind,updateuserid=:updateuserid,updatetime=:updatetime,updateorgid=:updateorgid where customerid= :customerid ");
custbq.setParameter("customerid",customerId);
custbq.setParameter("updateuserid", curUser.getUserID());
custbq.setParameter("updatetime",DateAssistant.getTodayNow());
custbq.setParameter("updateorgid",curUser.getOrgID());
custbq.setParameter("custkind",custkind);
custbq.executeUpdate();
}
//更新客户额度信息
BizObjectManager cqmManager = JBOFactory.getBizObjectManager(CUSTOMER_QUOTA_MONEY.CLASS_NAME,tx);
BizObject cqm = cqmManager.createQuery("customerid=:customerid ").setParameter("customerid",customerId).getSingleResult(true);
if( null == cqm){
BizObject cqmn = cqmManager.newObject();
cqmn.setAttributeValue("customerid",customerId);
cqmn.setAttributeValue("INPUTUSERID", curUser.getUserID());
cqmn.setAttributeValue("INPUTTIME",DateAssistant.getTodayNow());
cqmn.setAttributeValue("INPUTORGID",curUser.getOrgID());
cqmManager.saveObject(cqmn);
}
}
@Override
protected void afterUpdate(JBOTransaction tx, BizObject bo)
@ -155,5 +167,28 @@ public class NewCustomerCompanyHandler extends CommonHandler{
custbq.setParameter("updateorgid",curUser.getOrgID());
custbq.executeUpdate();
}
//更新客户额度信息
BizObjectManager cqmManager = JBOFactory.getBizObjectManager(CUSTOMER_QUOTA_MONEY.CLASS_NAME,tx);
BizObject cqm = cqmManager.createQuery("customerid=:customerid ").setParameter("customerid",customerId).getSingleResult(true);
if( null != cqm){
cqm.setAttributeValue("starttime",bo.getAttribute("starttime"));
cqm.setAttributeValue("endtime",bo.getAttribute("endtime"));
cqm.setAttributeValue("quotamoney",bo.getAttribute("quotamoney"));
cqm.setAttributeValue("updateuserid", curUser.getUserID());
cqm.setAttributeValue("updatetime",DateAssistant.getTodayNow());
cqm.setAttributeValue("updateorgid",curUser.getOrgID());
cqmManager.saveObject(cqm);
}else{
BizObject cqmn = cqmManager.newObject();
cqmn.setAttributeValue("starttime",bo.getAttribute("starttime"));
cqmn.setAttributeValue("endtime",bo.getAttribute("endtime"));
cqmn.setAttributeValue("quotamoney",bo.getAttribute("quotamoney"));
cqmn.setAttributeValue("customerid",customerId);
cqmn.setAttributeValue("INPUTUSERID", curUser.getUserID());
cqmn.setAttributeValue("INPUTTIME",DateAssistant.getTodayNow());
cqmn.setAttributeValue("INPUTORGID",curUser.getOrgID());
cqmManager.saveObject(cqmn);
}
}
}