新增中车还款日逻辑
This commit is contained in:
parent
ccbf2fce75
commit
cdc4d2292c
@ -1,26 +1,7 @@
|
||||
package com.tenwa.reckon.executor;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
|
||||
import com.amarsoft.app.util.ProductParamUtil;
|
||||
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.jbo.*;
|
||||
import com.amarsoft.are.util.json.JSONEncoder;
|
||||
import com.amarsoft.are.util.json.JSONObject;
|
||||
import com.amarsoft.awe.util.ASResultSet;
|
||||
@ -32,42 +13,29 @@ import com.tenwa.lease.flow.comm.service.ServiceOperatorEnum;
|
||||
import com.tenwa.lease.flow.comm.serviceImp.LeaseFlowBaseServiceImp;
|
||||
import com.tenwa.officetempalte.util.ExcelVersionEnum;
|
||||
import com.tenwa.quartz.StringUtil;
|
||||
import com.tenwa.reckon.bean.AdjustBean;
|
||||
import com.tenwa.reckon.bean.ConditionBean;
|
||||
import com.tenwa.reckon.bean.FundRentPlanBean;
|
||||
import com.tenwa.reckon.bean.FundRentPlanIrr;
|
||||
import com.tenwa.reckon.bean.KnowingTableBean;
|
||||
import com.tenwa.reckon.bean.TabCalBean;
|
||||
import com.tenwa.reckon.bean.*;
|
||||
import com.tenwa.reckon.executor.rentChange.RentChangeExe;
|
||||
import com.tenwa.reckon.executor.rentTerminate.RentTerminateExe;
|
||||
import com.tenwa.reckon.help.CalYearRateFromRent;
|
||||
import com.tenwa.reckon.help.ConditionHelper;
|
||||
import com.tenwa.reckon.help.RentPlanContrCalDAOImpl;
|
||||
import com.tenwa.reckon.util.DateUtil;
|
||||
import com.tenwa.reckon.util.DictTools;
|
||||
import com.tenwa.reckon.util.ExcelReader;
|
||||
import com.tenwa.reckon.util.MoneyUtils;
|
||||
import com.tenwa.reckon.util.ObjectConvertUtils;
|
||||
import com.tenwa.reckon.util.TbBeanTools;
|
||||
|
||||
import jbo.app.tenwa.calc.LC_CALC_CONDITION;
|
||||
import jbo.app.tenwa.calc.LC_CALC_CONDITION_TEMP;
|
||||
import jbo.app.tenwa.calc.LC_CALC_RULES_TEMP;
|
||||
import jbo.app.tenwa.calc.LC_CASH_FLOW;
|
||||
import jbo.app.tenwa.calc.LC_CASH_FLOW_TEMP;
|
||||
import jbo.app.tenwa.calc.LC_EBANK;
|
||||
import jbo.app.tenwa.calc.LC_EBANK_PROCESS;
|
||||
import jbo.app.tenwa.calc.LC_EBANK_TEMP;
|
||||
import jbo.app.tenwa.calc.LC_FUND_PLAN;
|
||||
import jbo.app.tenwa.calc.LC_FUND_PLAN_TEMP;
|
||||
import jbo.app.tenwa.calc.LC_FUND_RENT_ADJUST_TEMP;
|
||||
import jbo.app.tenwa.calc.LC_RENT_PLAN;
|
||||
import jbo.app.tenwa.calc.LC_RENT_PLAN_TEMP;
|
||||
import com.tenwa.reckon.util.*;
|
||||
import jbo.app.tenwa.calc.*;
|
||||
import jbo.com.tenwa.entity.comm.flow.FLOW_BUSSINESS_OBJECT;
|
||||
import jbo.com.tenwa.lease.comm.LB_CONTRACT_INFO;
|
||||
import jbo.com.tenwa.lease.comm.LB_EQUIPMENT_TEMP;
|
||||
import jbo.com.tenwa.lease.comm.LC_PAY_CONDTION_TEMP;
|
||||
import jbo.sys.CODE_LIBRARY;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author chuang 租金测算主入口
|
||||
@ -288,19 +256,29 @@ public class CreateTransactionExecutor implements Transaction {
|
||||
JBOTransaction tx=null;
|
||||
BizObjectManager Bm=JBOFactory.getBizObjectManager(LC_CALC_CONDITION.CLASS_NAME, Sqlca);
|
||||
BizObject boLCC = Bm.createQuery("contract_id='" + contractId + "'").getSingleResult(true);
|
||||
BizObjectManager bmLCI=JBOFactory.getBizObjectManager(LB_CONTRACT_INFO.CLASS_NAME, Sqlca);
|
||||
BizObject boLCI = bmLCI.createQuery("contract_id='" + contractId + "'").getSingleResult(false);
|
||||
//获取期次
|
||||
if(boLCC != null) {
|
||||
String settleMethod = boLCC.getAttribute("SETTLE_METHOD").getString();
|
||||
String defaultDueDay = ProductParamUtil.getProductParameterValue(productId, "PRD0301", settleMethod, "DefaultDueDay");
|
||||
int incomeNumber = boLCC.getAttribute("INCOME_NUMBER").getInt();
|
||||
//期初-期末
|
||||
String periodType = boLCC.getAttribute("PERIOD_TYPE").getString();
|
||||
String incomeIntervalMonth = boLCC.getAttribute("INCOME_INTERVAL_MONTH").getInt() + "";
|
||||
List<String> planDateList = null;
|
||||
if("02".equals(defaultDueDay)) {
|
||||
planDateList = getPlanDateListFixed(incomeNumber, periodType, incomeIntervalMonth, startDate);
|
||||
} else {
|
||||
planDateList = getPlanDateList(incomeNumber, periodType, incomeIntervalMonth, startDate);
|
||||
//是否为中车产品(无论期初期末,无论是按固定还款日还是按起租日,只要是中车的,一律按这套逻辑来---唐福堂)
|
||||
String channel = boLCI.getAttribute("CHANNEL")==null?"":boLCI.getAttribute("CHANNEL").toString();
|
||||
if("zc".equals(channel)){
|
||||
planDateList = getPlanDateListZC(incomeNumber, incomeIntervalMonth, startDate);
|
||||
}else{
|
||||
if("02".equals(defaultDueDay)) {
|
||||
planDateList = getPlanDateListFixed(incomeNumber, periodType, incomeIntervalMonth, startDate);
|
||||
} else {
|
||||
planDateList = getPlanDateList(incomeNumber, periodType, incomeIntervalMonth, startDate);
|
||||
}
|
||||
}
|
||||
|
||||
String insertSql="insert into lc_rent_plan(id,quot_id,cust_id, project_id, project_plan_number,contract_id,contract_plan_number,payment_number,plan_list,plan_date,plan_status,rent,corpus,interest,penalty,corpus_business,interest_business,rent_adjust,all_remain_corpus,settle_method,coin,year_rate,memo,flowunid,inputuserid,inputorgid,inputtime,updateuserid,updateorgid,updatetime,interest_date) select id,quot_id,cust_id, project_id, project_plan_number,contract_id,contract_plan_number,payment_number,plan_list,plan_date,plan_status,rent,corpus,interest,penalty,corpus_business,interest_business,rent_adjust,all_remain_corpus,settle_method,coin,year_rate,memo,flowunid,inputuserid,inputorgid,inputtime,updateuserid,updateorgid,updatetime,interest_date from lc_pay_rent_plan where payment_number = '" + this.plannumber + "'";
|
||||
Sqlca.executeSQL(new SqlObject(insertSql));
|
||||
Connection conn = Sqlca.getConnection(Sqlca);
|
||||
@ -454,7 +432,27 @@ public class CreateTransactionExecutor implements Transaction {
|
||||
sql +=" )t group by t.plan_date ";
|
||||
Sqlca.executeSQL(new SqlObject(sql));
|
||||
}
|
||||
|
||||
//中车产品获取还款日
|
||||
public static List<String> getPlanDateListZC(int incomeNumber, String incomeIntervalMonth, String startDate) throws ParseException {
|
||||
List<String> planDate = new ArrayList<String>();
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(com.amarsoft.app.als.sys.tools.DateUtil.parseStringToDate(startDate, "yyyy/MM/dd"));
|
||||
int day = calendar.get(Calendar.DAY_OF_MONTH);
|
||||
calendar.set(Calendar.DAY_OF_MONTH, 15);
|
||||
if(day <= 15){
|
||||
calendar.add(Calendar.MONTH, 1);
|
||||
}else{
|
||||
calendar.add(Calendar.MONTH, 2);
|
||||
}
|
||||
int addMonth = Integer.parseInt(incomeIntervalMonth);
|
||||
for(int i = 0; i < incomeNumber; i ++) {
|
||||
if(i!=0){
|
||||
calendar.add(Calendar.MONTH, addMonth);
|
||||
}
|
||||
planDate.add(com.amarsoft.app.als.sys.tools.DateUtil.formatDateToString(calendar.getTime(), "yyyy/MM/dd"));
|
||||
}
|
||||
return planDate;
|
||||
}
|
||||
//固定还款日
|
||||
public static List<String> getPlanDateListFixed(int incomeNumber, String periodType, String incomeIntervalMonth, String startDate) throws ParseException {
|
||||
List<String> planDate = new ArrayList<String>();
|
||||
@ -462,6 +460,7 @@ public class CreateTransactionExecutor implements Transaction {
|
||||
calendar.setTime(com.amarsoft.app.als.sys.tools.DateUtil.parseStringToDate(startDate, "yyyy/MM/dd"));
|
||||
int day = calendar.get(Calendar.DAY_OF_MONTH);
|
||||
boolean flag = false;
|
||||
//期末
|
||||
if("period_type_0".equals(periodType)) {
|
||||
if(day >= 1 && day <= 9) {
|
||||
day = 5;
|
||||
@ -1076,7 +1075,7 @@ public class CreateTransactionExecutor implements Transaction {
|
||||
}
|
||||
/**
|
||||
* 租金计划变更 更新现金流前先计算增值税
|
||||
* @param tx
|
||||
* @param
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user