1。灵活分润计划
This commit is contained in:
parent
bd2f223c4a
commit
7591a35f5d
@ -776,6 +776,7 @@
|
||||
<attribute name="RISK_ACCRUAL_RATIO" label="风险计提比率" type="DOUBLE" length="22" scale="6"/>
|
||||
<attribute name="STRATEGIC_COEFFICIENT" label="战略系数" type="DOUBLE" length="22" scale="6"/>
|
||||
<attribute name="STRATEGY_ROA" label="战略ROA" type="DOUBLE" length="22" scale="6"/>
|
||||
<attribute name="SPLIT_TYPE" label="是否灵活分润" type="STRING"/>
|
||||
</attributes>
|
||||
<manager>
|
||||
<managerProperties>
|
||||
@ -1076,6 +1077,7 @@
|
||||
<attribute name="RISK_ACCRUAL_RATIO" label="风险计提比率" type="DOUBLE" length="22" scale="6"/>
|
||||
<attribute name="STRATEGIC_COEFFICIENT" label="战略系数" type="DOUBLE" length="22" scale="6"/>
|
||||
<attribute name="STRATEGY_ROA" label="战略ROA" type="DOUBLE" length="22" scale="6"/>
|
||||
<attribute name="SPLIT_TYPE" label="是否灵活分润" type="STRING"/>
|
||||
</attributes>
|
||||
<manager>
|
||||
<managerProperties>
|
||||
@ -1416,6 +1418,7 @@
|
||||
<attribute name="RISK_ACCRUAL_RATIO" label="风险计提比率" type="DOUBLE" length="22" scale="6"/>
|
||||
<attribute name="STRATEGIC_COEFFICIENT" label="战略系数" type="DOUBLE" length="22" scale="6"/>
|
||||
<attribute name="STRATEGY_ROA" label="战略ROA" type="DOUBLE" length="22" scale="6"/>
|
||||
<attribute name="SPLIT_TYPE" label="是否灵活分润" type="STRING"/>
|
||||
</attributes>
|
||||
<manager>
|
||||
<managerProperties>
|
||||
@ -2773,6 +2776,7 @@
|
||||
<attribute name="RISK_ACCRUAL_RATIO" label="风险计提比率" type="DOUBLE" length="22" scale="6"/>
|
||||
<attribute name="STRATEGIC_COEFFICIENT" label="战略系数" type="DOUBLE" length="22" scale="6"/>
|
||||
<attribute name="STRATEGY_ROA" label="战略ROA" type="DOUBLE" length="22" scale="6"/>
|
||||
<attribute name="SPLIT_TYPE" label="是否灵活分润" type="STRING"/>
|
||||
</attributes>
|
||||
<manager>
|
||||
<managerProperties>
|
||||
@ -3355,6 +3359,7 @@
|
||||
<attribute name="RISK_ACCRUAL_RATIO" label="风险计提比率" type="DOUBLE" length="22" scale="6"/>
|
||||
<attribute name="STRATEGIC_COEFFICIENT" label="战略系数" type="DOUBLE" length="22" scale="6"/>
|
||||
<attribute name="STRATEGY_ROA" label="战略ROA" type="DOUBLE" length="22" scale="6"/>
|
||||
<attribute name="SPLIT_TYPE" label="是否灵活分润" type="STRING"/>
|
||||
</attributes>
|
||||
<manager>
|
||||
<managerProperties>
|
||||
|
||||
@ -344,16 +344,23 @@ public class CreateTransactionExecutor implements Transaction {
|
||||
* @throws JBOException
|
||||
* @throws Exception
|
||||
*/
|
||||
public void insertRentPlan_SP (String splittingRatio,com.amarsoft.awe.util.Transaction Sqlca) throws Exception{
|
||||
public void insertRentPlan_SP (String splittingRatio,com.amarsoft.awe.util.Transaction Sqlca,String splitType) throws Exception{
|
||||
BizObjectManager BmLRP=JBOFactory.getBizObjectManager(LC_RENT_PLAN.CLASS_NAME, Sqlca);
|
||||
BizObjectManager BmLCC=JBOFactory.getBizObjectManager(LC_CALC_CONDITION.CLASS_NAME, Sqlca);
|
||||
java.text.SimpleDateFormat format = new java.text.SimpleDateFormat("yyyy/MM/dd");
|
||||
String day ="0";
|
||||
Long start = format.parse(startDate).getTime();
|
||||
|
||||
List<BizObject> BoLRP = BmLRP.createQuery("payment_number=:payment_number order by plan_list").setParameter("payment_number", this.plannumber).getResultList(false);
|
||||
BizObject boLCC = BmLCC.createQuery("select IRR,CAUTION_MONEY,HANDLING_CHARGE_MONEY from O where payment_number=:payment_number").setParameter("payment_number", this.plannumber).getSingleResult(false);
|
||||
String irr = boLCC.getAttribute("IRR").toString();
|
||||
String cautionMoney = boLCC.getAttribute("CAUTION_MONEY").toString();
|
||||
String handlingChargeMoney = boLCC.getAttribute("HANDLING_CHARGE_MONEY").toString();
|
||||
BigDecimal irr_b = new BigDecimal(irr).divide(new BigDecimal("100"));
|
||||
BigDecimal cautionMoney_b = new BigDecimal(cautionMoney);
|
||||
BigDecimal handlingChargeMoney_b = new BigDecimal(handlingChargeMoney);
|
||||
Connection conn = Sqlca.getConnection(Sqlca);
|
||||
PreparedStatement ps = null;
|
||||
BigDecimal corpus_sp = new BigDecimal("0.00");
|
||||
BigDecimal interest_sp = new BigDecimal("0.00");
|
||||
try{
|
||||
ps = conn.prepareStatement("update lc_rent_plan set CORPUS_SP = ?,INTEREST_SP = ? where payment_number = '" + this.plannumber + "' and plan_list = ?");
|
||||
for(int i = 0; i < BoLRP.size(); i ++){
|
||||
@ -361,9 +368,28 @@ public class CreateTransactionExecutor implements Transaction {
|
||||
BigDecimal allRemainCorpus =new BigDecimal(BoLRP.get(i).getAttribute("ALL_REMAIN_CORPUS").toString());
|
||||
BigDecimal interest =new BigDecimal(BoLRP.get(i).getAttribute("INTEREST").toString());
|
||||
BigDecimal ratio = new BigDecimal(splittingRatio).divide(new BigDecimal("100"));
|
||||
|
||||
corpus_sp = corpus.add(allRemainCorpus).multiply(ratio).multiply(new BigDecimal("30")).divide(new BigDecimal("360"),2,BigDecimal.ROUND_HALF_UP);
|
||||
BigDecimal interest_sp = interest.subtract(corpus_sp);
|
||||
//是否灵活分润
|
||||
if("Y".equals(splitType)){
|
||||
BigDecimal baseMoney;
|
||||
if(i==0){
|
||||
baseMoney = corpus.add(allRemainCorpus).subtract(cautionMoney_b).subtract(handlingChargeMoney_b);
|
||||
}else{
|
||||
baseMoney = corpus.add(allRemainCorpus).subtract(cautionMoney_b);
|
||||
}
|
||||
|
||||
if(baseMoney.compareTo(new BigDecimal("0"))==1){
|
||||
// 分润金额 = (本期剩余本金+本期本金-保证金)*(对客IRR-安鹏给渠道IRR)/12
|
||||
interest_sp = baseMoney.multiply(irr_b.subtract(ratio)).divide(new BigDecimal("12"),2,BigDecimal.ROUND_HALF_UP);
|
||||
corpus_sp = interest.subtract(interest_sp);
|
||||
}else{
|
||||
interest_sp = new BigDecimal("0.00");
|
||||
corpus_sp = interest.subtract(interest_sp);
|
||||
}
|
||||
}else{
|
||||
corpus_sp = corpus.add(allRemainCorpus).multiply(ratio).multiply(new BigDecimal("30")).divide(new BigDecimal("360"),2,BigDecimal.ROUND_HALF_UP);
|
||||
interest_sp = interest.subtract(corpus_sp);
|
||||
}
|
||||
|
||||
ps.setString(1, corpus_sp.toString());
|
||||
ps.setString(2, interest_sp.toString());
|
||||
ps.setString(3, (i + 1) + "");
|
||||
@ -379,7 +405,11 @@ public class CreateTransactionExecutor implements Transaction {
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void insertRentPlan_SP_Flexible(String ratio,Transaction Sqlca){
|
||||
|
||||
}
|
||||
|
||||
public void setCashFlow(String paymentNumber, String productId, com.amarsoft.awe.util.Transaction Sqlca) throws Exception {
|
||||
String sql = "";
|
||||
sql += "INSERT INTO LC_CASH_FLOW (id,project_id,project_plan_number,contract_id,contract_plan_number,payment_number";
|
||||
|
||||
@ -605,4 +605,8 @@ public interface LC_CALC_CONDITION{
|
||||
* Õ½ÂÔROA DOUBLE(22)<br>
|
||||
*/
|
||||
public static final String STRATEGY_ROA = "STRATEGY_ROA";
|
||||
/**
|
||||
* 是否灵活分润<br>
|
||||
*/
|
||||
public static final String SPLIT_TYPE = "SPLIT_TYPE";
|
||||
}
|
||||
@ -605,4 +605,8 @@ public interface LC_CALC_CONDITION_HIS{
|
||||
* Õ½ÂÔROA DOUBLE(22)<br>
|
||||
*/
|
||||
public static final String STRATEGY_ROA = "STRATEGY_ROA";
|
||||
/**
|
||||
* 是否灵活分润<br>
|
||||
*/
|
||||
public static final String SPLIT_TYPE = "SPLIT_TYPE";
|
||||
}
|
||||
@ -605,4 +605,8 @@ public interface LC_CALC_CONDITION_TEMP{
|
||||
* Õ½ÂÔROA DOUBLE(22)<br>
|
||||
*/
|
||||
public static final String STRATEGY_ROA = "STRATEGY_ROA";
|
||||
/**
|
||||
* 是否灵活分润<br>
|
||||
*/
|
||||
public static final String SPLIT_TYPE = "SPLIT_TYPE";
|
||||
}
|
||||
@ -609,4 +609,8 @@ public interface LC_CONTRACT_CONDITION{
|
||||
* Õ½ÂÔROA DOUBLE(22)<br>
|
||||
*/
|
||||
public static final String STRATEGY_ROA = "STRATEGY_ROA";
|
||||
/**
|
||||
* 是否灵活分润<br>
|
||||
*/
|
||||
public static final String SPLIT_TYPE = "SPLIT_TYPE";
|
||||
}
|
||||
@ -609,4 +609,8 @@ public interface LC_PROJ_CONDITION{
|
||||
* Õ½ÂÔROA DOUBLE(22)<br>
|
||||
*/
|
||||
public static final String STRATEGY_ROA = "STRATEGY_ROA";
|
||||
/**
|
||||
* 是否灵活分润<br>
|
||||
*/
|
||||
public static final String SPLIT_TYPE = "SPLIT_TYPE";
|
||||
}
|
||||
@ -54,6 +54,10 @@ public class FundIncomeEndRentPlanModify extends BaseBussiness{
|
||||
String payment_number=bo.getAttribute("payment_number").toString();
|
||||
String contractId=bo.getAttribute("contract_id").toString();
|
||||
String productId = Sqlca.getString("select product_id from lb_contract_info where id='"+contractId+"'");
|
||||
//是否灵活分润
|
||||
String splitType = Sqlca.getString( "select attribute5 from business_type where typeno = '" + productId + "'" );
|
||||
//暂时先用从产品读取的,待客户确认是否要存表
|
||||
//String splitType = Sqlca.getString("select split_type from lc_calc_condition where contract_id='"+contractId+"'");
|
||||
String calType = "onHire_process";
|
||||
String projectPlanNumber = bo.getAttribute("project_plan_number").toString();
|
||||
CreateTransactionExecutor cre = new CreateTransactionExecutor();
|
||||
@ -71,7 +75,7 @@ public class FundIncomeEndRentPlanModify extends BaseBussiness{
|
||||
if("".equals(splittingRatio)||splittingRatio==null){
|
||||
|
||||
}else{
|
||||
cre.insertRentPlan_SP(splittingRatio, Sqlca);
|
||||
cre.insertRentPlan_SP(splittingRatio, Sqlca,splitType);
|
||||
}
|
||||
/* Date fact_date=df.parse(bo.getAttribute("fact_date").toString());
|
||||
Date base_date=fact_date;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user