apzl_leasing/calc/com/tenwa/reckon/adjustInterest/AdjustInterestController.java
2018-09-20 16:10:15 +08:00

392 lines
17 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package com.tenwa.reckon.adjustInterest;
import java.math.BigDecimal;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.Hashtable;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import jbo.app.tenwa.calc.LC_ADJUST_CONTRACT;
import jbo.app.tenwa.calc.LC_ADJUST_CONTRACT_TEMP;
import jbo.app.tenwa.calc.LC_CALC_CONDITION;
import jbo.app.tenwa.calc.LC_CALC_CONDITION_HIS;
import jbo.app.tenwa.calc.LC_CALC_CONDITION_TEMP;
import jbo.app.tenwa.calc.LC_CASH_FLOW_HIS;
import jbo.app.tenwa.calc.LC_CASH_FLOW_TEMP;
import jbo.app.tenwa.calc.LC_FUND_PLAN;
import jbo.app.tenwa.calc.LC_FUND_PLAN_TEMP;
import jbo.app.tenwa.calc.LC_RENT_PLAN_HIS;
import jbo.app.tenwa.calc.LC_RENT_PLAN_TEMP;
import jbo.app.tenwa.calc.LC_STANDARD_INTEREST;
import jbo.app.tenwa.calc.LC_STANDARD_INTEREST_TEMP;
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.LC_OCCUPY_RENT_LIST;
import com.amarsoft.app.awe.config.InitDBType;
import com.amarsoft.are.jbo.BizObject;
import com.amarsoft.are.jbo.JBOException;
import com.amarsoft.are.jbo.JBOFactory;
import com.amarsoft.are.jbo.JBOTransaction;
import com.tenwa.comm.util.jboutil.DataOperatorUtil;
import com.tenwa.reckon.adjustInterest.service.TransRateService;
import com.tenwa.reckon.adjustInterest.service.impl.PmtNextDayServiceImpl;
import com.tenwa.reckon.adjustInterest.service.impl.PmtNextListServiceImpl;
import com.tenwa.reckon.adjustInterest.service.impl.PmtNextMonthServiceImpl;
import com.tenwa.reckon.adjustInterest.service.impl.PmtNextYearServiceImpl;
import com.tenwa.reckon.bean.ConditionBean;
import com.tenwa.reckon.bean.FundRentPlanBean;
import com.tenwa.reckon.bean.InterContBean;
import com.tenwa.reckon.bean.TabCalBean;
import com.tenwa.reckon.executor.CashFlowExecutor;
import com.tenwa.reckon.executor.EvenRentExecutor;
import com.tenwa.reckon.executor.FundRentPlanExecutor;
import com.tenwa.reckon.help.AdjustInterestDaoUtil;
import com.tenwa.reckon.help.CalcConditionCopyService;
import com.tenwa.reckon.help.FundPlanDAOImpl;
import com.tenwa.reckon.util.DateUtil;
import com.tenwa.reckon.util.DictTools;
import com.tenwa.reckon.util.ObjectConvertUtils;
import com.tenwa.reckon.util.TbBeanTools;
import com.tenwa.reckon.util.TransRateHelper;
public class AdjustInterestController{
public String datetype="interestdate";
private String flowunid;
private String adjustid;
private String payment_number;
private String product_id;
public String run() {
try{
String check=this.adjustCheck(this.payment_number);
if(!check.equals("true")){
return check;
}
Hashtable<String, String> result=this.initTransRate(payment_number,this.flowunid);
return result.get("message");
}catch(Exception e){
e.printStackTrace();
}
return null;
}
public String adjustCheck(String payment_number) throws JBOException{
BizObject list=JBOFactory.createBizObjectQuery(LC_OCCUPY_RENT_LIST.CLASS_NAME,"payment_number=:payment_number").setParameter("payment_number", payment_number).getSingleResult(false);
if(list!=null){
return "Ͷ<EFBFBD>ű<EFBFBD><EFBFBD><EFBFBD>:"+payment_number+"<EFBFBD><EFBFBD>"+list.getAttribute("FLOW_NAME").getString()+"<EFBFBD><EFBFBD>,<2C><><EFBFBD>ܷ<EFBFBD><DCB7><EFBFBD><EFBFBD><EFBFBD>Ϣ";
}
return "true";
}
/**
* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>Ϣ
* @param payment_number
* @param flowunid
* @return
* @throws Exception
*/
@SuppressWarnings("unchecked")
public String adjustStartDateYear(String flowunid,String adjustdate) throws Exception{
List<BizObject> standards=JBOFactory.createBizObjectQuery(LC_STANDARD_INTEREST.CLASS_NAME,"START_DATE>'"+DateUtil.addDate(adjustdate, DateUtil.TIME_YEAR, -1)+"' and start_date<='"+adjustdate+"' order by start_date").getResultList(false);
BizObject adjust=new BizObject(LC_STANDARD_INTEREST.CLASS_NAME);
if(standards.size()==0){
return "";
}
Calendar cal = Calendar.getInstance();
cal.setTime(DateUtil.getTimeByFormat(adjustdate, "yyyy/MM/dd"));
int month=cal.get(Calendar.MONTH)+1;
int day=cal.get(Calendar.DATE);
String sql="";
if("MYSQL".equals(InitDBType.DBTYPE)){
sql="select * from O left join jbo.app.tenwa.calc.LC_CALC_CONDITION_STATUS stat on o.payment_number=stat.payment_number where '"+adjustdate+"'>O.start_date"
+ " and v.SUBSTR(O.start_date,6,2)="+month+" and v.SUBSTR(O.start_date,9,2)="+day+" and stat.PLAN_STATUS='31' and O.ADJUST_TYPE<>'fixed' and O.ADJUST_STYLE='start_date_year' "
+ " and not exists (select 1 from jbo.app.tenwa.calc.LC_ADJUST_CONTRACT ac where ac.adjust_date='"+adjustdate+"'and o.payment_number=ac.payment_number and ac.status='rate_change_in')";
}else{
sql="select * from O left join jbo.app.tenwa.calc.LC_CALC_CONDITION_STATUS stat on o.payment_number=stat.payment_number where '"+adjustdate+"'>v.to_char(O.start_date)"
+ " and v.SUBSTR(v.to_char(O.start_date),6,2)="+month+" and v.SUBSTR(v.to_char(O.start_date),9,2)="+day+" and stat.PLAN_STATUS='31' and O.ADJUST_TYPE<>'fixed' and O.ADJUST_STYLE='start_date_year'"
+ " and not exists (select 1 from jbo.app.tenwa.calc.LC_ADJUST_CONTRACT ac where ac.adjust_date='"+adjustdate+"'and o.payment_number=ac.payment_number and ac.status='rate_change_in')";
}
List<BizObject> list=JBOFactory.createBizObjectQuery(LC_CALC_CONDITION.CLASS_NAME,sql).getResultList(false);
//<2F><>װ<EFBFBD>µĸ<C2B5><C4B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
adjust.setAttributesValue(standards.get(standards.size()-1));
adjust.setAttributeValue("id",adjustdate);
adjust.setAttributeValue("START_DATE",adjustdate);
for(int i=0;i<standards.size()-1;i++){
adjust.setAttributeValue("RATE_HALF",new BigDecimal(adjust.getAttribute("RATE_HALF").getString()).add(new BigDecimal(standards.get(i).getAttribute("RATE_HALF").getString())).toString());
adjust.setAttributeValue("RATE_ONE",new BigDecimal(adjust.getAttribute("RATE_ONE").getString()).add(new BigDecimal(standards.get(i).getAttribute("RATE_ONE").getString())).toString());
adjust.setAttributeValue("RATE_THREE",new BigDecimal(adjust.getAttribute("RATE_THREE").getString()).add(new BigDecimal(standards.get(i).getAttribute("RATE_THREE").getString())).toString());
adjust.setAttributeValue("RATE_FIVE",new BigDecimal(adjust.getAttribute("RATE_FIVE").getString()).add(new BigDecimal(standards.get(i).getAttribute("RATE_FIVE").getString())).toString());
adjust.setAttributeValue("RATE_ABOVEFIVE",new BigDecimal(adjust.getAttribute("RATE_ABOVEFIVE").getString()).add(new BigDecimal(standards.get(i).getAttribute("RATE_ABOVEFIVE").getString())).toString());
}
//
FundPlanDAOImpl fundPlanDAO =new FundPlanDAOImpl();
List<String> datelist;
for(BizObject condition:list){
String payment_number=condition.getAttribute("payment_number").getString();
ConditionBean cb=ObjectConvertUtils.converBizObjectToBean(ConditionBean.class, condition);
cb.setDocId(flowunid);
DictTools.getReversDict(cb);
FundRentPlanBean oldRentPlanContext = fundPlanDAO.findContractFundRentPlanList(payment_number);
oldRentPlanContext.setDocId(flowunid);
String newDate = TransRateHelper.getNewDateByAdjustType(cb.getAdjustStyle(),adjust.getAttribute("start_date").getString());
if("plandate".equals(datetype)){
datelist=oldRentPlanContext.getPlanDateList();
}else{
datelist=oldRentPlanContext.getInterestDateList();
}
cb.setAdjustStyle("next_day");
int startList = TransRateHelper.getStartListFromRentPlan(datelist, newDate);
BizObject contract=JBOFactory.createBizObjectQuery(LB_CONTRACT_INFO.CLASS_NAME,"id=:id").setParameter("id",condition.getAttribute("contract_id").getString()).getSingleResult(false);
this.processTransRate(oldRentPlanContext, startList, cb, condition, adjust, newDate, adjust.getAttribute("id").getString(), flowunid, contract.getAttribute("PRODUCT_ID").getString());
}
return "";
}
public Hashtable<String, String> initTransRate(String payment_number, String flowunid) throws Exception {
BizObject adjust=JBOFactory.createBizObjectQuery(LC_STANDARD_INTEREST_TEMP.CLASS_NAME,"flowunid=:flowunid").setParameter("flowunid", flowunid).getSingleResult(false);
BizObject flow=JBOFactory.createBizObjectQuery(FLOW_BUSSINESS_OBJECT.CLASS_NAME,"flow_unid=:flowunid").setParameter("flowunid",flowunid).getSingleResult(false);
FundPlanDAOImpl fundPlanDAO =new FundPlanDAOImpl();
BizObject condition=JBOFactory.createBizObjectQuery(LC_CALC_CONDITION.CLASS_NAME,"payment_number=:paymentnumber").setParameter("paymentnumber",payment_number).getSingleResult(false);
ConditionBean cb=ObjectConvertUtils.converBizObjectToBean(ConditionBean.class, condition);
cb.setDocId(flowunid);
DictTools.getReversDict(cb);
FundRentPlanBean oldRentPlanContext = fundPlanDAO.findContractFundRentPlanList(payment_number);
oldRentPlanContext.setDocId(flowunid);
String newDate = TransRateHelper.getNewDateByAdjustType(cb.getAdjustStyle(),adjust.getAttribute("start_date").getString());
//
List<String> dateList;
/*if("plandate".equals(this.datetype)){
dateList=oldRentPlanContext.getPlanDateList();
}else{
dateList=oldRentPlanContext.getInterestDateList();
}*/
dateList=oldRentPlanContext.getPlanDateList();
int startList = TransRateHelper.getStartListFromRentPlan(dateList, newDate);
if("next_list".equals(cb.getAdjustStyle())){
startList++;
}
return this.processTransRate(oldRentPlanContext, startList, cb, condition, adjust, newDate,flow.getAttribute("flow_key").getString(),flowunid,product_id);
}
/**
* <20><>Ϣ
* @param oldRentPlanContext <20><>Ϣǰ<CFA2><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
* @param startList <09><>Ϣ<EFBFBD><CFA2>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>
* @param cb <09><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>װ<EFBFBD><D7B0><EFBFBD><EFBFBD>
* @param condition <09><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ʵ<EFBFBD><CAB5>
* @param adjust <09><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
* @param newDate <09><>Ϣ<EFBFBD><CFA2>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>
* @param adjustid <09><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD><CABD> <20><><EFBFBD><EFBFBD>
* @param flowunid <09><><EFBFBD>̱<EFBFBD><CCB1><EFBFBD>
* @param product_id <09><>ƷID
* @return
* @throws Exception
*/
public Hashtable<String, String> processTransRate(FundRentPlanBean oldRentPlanContext,int startList,ConditionBean cb,BizObject condition,BizObject adjust,String newDate,String adjustid,String flowunid,String product_id) throws Exception {
FundPlanDAOImpl fundPlanDAO =new FundPlanDAOImpl();
String payment_number=condition.getAttribute("payment_number").getString();
boolean isRateEven = TransRateHelper.isRateEvenFromStartList(oldRentPlanContext.getYearRateList(), startList);
String rentIncome = fundPlanDAO.findRentIncomeByRentList(payment_number, startList);
String msgs = "";
if (startList == 0) {
msgs += "\<EFBFBD>ű<EFBFBD><EFBFBD><EFBFBD>:" + payment_number + "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>!\n<EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD>ڲ<EFBFBD><EFBFBD>ں<EFBFBD>ͬ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.\<EFBFBD><EFBFBD><EFBFBD>е<EFBFBD>Ϣ.";
} else if (!isRateEven) {
msgs += "\<EFBFBD>ű<EFBFBD><EFBFBD><EFBFBD>:" + payment_number + "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>!\n<EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>֮<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʲ<EFBFBD><EFBFBD><EFBFBD>ͬ.\<EFBFBD><EFBFBD><EFBFBD>е<EFBFBD>Ϣ.";
} else if ("next_list".equals(cb.getAdjustStyle()) && startList > cb.getIncomeNumber()) {
msgs += "\<EFBFBD>ű<EFBFBD><EFBFBD><EFBFBD>:" + payment_number + "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>!\n<EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD>Ϣ<EFBFBD><EFBFBD>ͬ<EFBFBD>ҵ<EFBFBD>Ϣ<EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>ͬ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD>.\<EFBFBD><EFBFBD><EFBFBD>е<EFBFBD>Ϣ.";
} else if ("fixed".equals(cb.getAdjustType())) {
msgs += "\<EFBFBD>ű<EFBFBD><EFBFBD><EFBFBD>:" + payment_number + "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>!\n<EFBFBD><EFBFBD>ͬ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>̶<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD>ͬ.\<EFBFBD><EFBFBD><EFBFBD>е<EFBFBD>Ϣ.";
} else if(new BigDecimal(rentIncome).compareTo(BigDecimal.ZERO)==1){
msgs += "\<EFBFBD>ű<EFBFBD><EFBFBD><EFBFBD>:" + payment_number + "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>!\n<EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>֮<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.\<EFBFBD><EFBFBD><EFBFBD>е<EFBFBD>Ϣ.";
}
Hashtable<String, String> resultMap = new Hashtable<String, String>();
InterContBean icb = new InterContBean();
if (msgs.length() > 0) {
resultMap.put("message", msgs);
resultMap.put("isSuccess", "false");
} else {
TabCalBean tcb = TbBeanTools.getTabInfo("pay_process");
tcb.setDocId(flowunid);
tcb.setCondition(condition);//<2F><>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8>
tcb.setProductId(product_id);//<2F><>Ϣ<EFBFBD><CFA2><EFBFBD>Ҳ<EFBFBD><D2B2><EFBFBD><EFBFBD>ļ<EFBFBD>
tcb.setPlanCValue(payment_number);
tcb.setCb(cb);
String oldYearRate =condition.getAttribute("YEAR_RATE").getString();
String newYearRate = TransRateHelper.getNewRate(cb, oldYearRate, adjust);
JBOTransaction tx=JBOFactory.createJBOTransaction();
AdjustInterestDaoUtil ce=new AdjustInterestDaoUtil(tx);
try{
icb.setContractId(condition.getAttribute("contract_id").getString());
icb.setAdjustId(adjustid);
icb.setStartList(startList);
icb.setOldYearRate(oldYearRate);
icb.setNewYearRate(newYearRate);
icb.setAdjustDate(newDate);
icb.setDocId(flowunid);
icb.setPaymentNumber(payment_number);
icb.setOldIrr(cb.getIrr());
icb.setDateType(this.datetype);
//<2F><><EFBFBD><EFBFBD><EFBFBD>ƻ<EFBFBD>
//<2F><><EFBFBD><EFBFBD><EFBFBD>ʻ<EFBFBD><CABB><EFBFBD> rate/360*365
//cb.setYearRate(newYearRate);
//DictTools.setYearRate(tcb);
//icb.setNewYearRate(cb.getYearRate());
processPmtTranRate(cb, oldRentPlanContext, icb,tcb);
FundRentPlanExecutor rp=new EvenRentExecutor(tx);
rp.addRentPlan(oldRentPlanContext, tcb, 1);
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ԭ δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
cb.setYearRate(newYearRate);
icb.setNewYearRate(newYearRate);
// <20>ʽ<EFBFBD><CABD>ƻ<EFBFBD> <20><>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>
Map<String,String> fromCondition=new HashMap<String, String>();
fromCondition.put("payment_number", payment_number);
Map<String,String> other=new HashMap<String, String>();
other.put("flowunid",flowunid);
DataOperatorUtil.copyJBOSet(LC_FUND_PLAN.CLASS_NAME, fromCondition, LC_FUND_PLAN_TEMP.CLASS_NAME, null, other, null, tx);
//<2F>ֽ<EFBFBD><D6BD><EFBFBD>
CashFlowExecutor idd = new CashFlowExecutor(tx);
String realIrr=idd.run(cb,tcb);
icb.setNewIrr(realIrr);
cb.setIrr(realIrr);
ce.addCondition(cb, tcb);
resultMap.put("oldIrr", icb.getOldIrr());
resultMap.put("newIrr", realIrr);
resultMap.put("startList", "" + startList);
resultMap.put("oldRate", oldYearRate);
resultMap.put("newRate", newYearRate);
resultMap.put("adjustDate", newDate);
resultMap.put("message", "\<EFBFBD>ű<EFBFBD><EFBFBD><EFBFBD>:"+payment_number+"<EFBFBD><EFBFBD>Ϣ<EFBFBD>ɹ<EFBFBD>!");
resultMap.put("isOver", "true");
resultMap.put("isSuccess", "true");
icb.setModReason("his_rate_change");
icb.setStatus("rate_change_in");
fundPlanDAO.insertLastStandInfo(icb,tx);
CalcConditionCopyService ser=new CalcConditionCopyService();
ser.onhireToHis(flowunid, payment_number, tx);
}catch(Exception e){
tx.rollback();
e.printStackTrace();
}finally{
tx.commit();
}
}
return resultMap;
}
/**
*
* @param cb
* @param oldRentPlanContext
* @param icb
* @param tcb
* @throws Exception
*/
private static void processPmtTranRate(ConditionBean cb, FundRentPlanBean oldRentPlanContext, InterContBean icb,TabCalBean tcb) throws Exception {
TransRateService rtrs = null;
if ("next_day".equals(cb.getAdjustStyle())) {
rtrs = new PmtNextDayServiceImpl();
} else if ("next_month".equals(cb.getAdjustStyle())) {
rtrs = new PmtNextMonthServiceImpl();
} else if ("next_year".equals(cb.getAdjustStyle())) {
rtrs = new PmtNextYearServiceImpl();
} else if ("next_list".equals(cb.getAdjustStyle())) {
rtrs = new PmtNextListServiceImpl();
}
//<2F><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>/360*365
cb.setYearRate(icb.getNewYearRate());
DictTools.setYearRate(tcb);
icb.setNewYearRate(cb.getYearRate());
rtrs.processPmtTranRate(cb, oldRentPlanContext, icb,tcb);
}
/**
* <20><><EFBFBD><EFBFBD>
*/
public void runCancel() {
try{
String sql="delete from O where flowunid='"+this.flowunid+"' and payment_number='"+this.payment_number+"'";
JBOFactory.createBizObjectQuery(LC_ADJUST_CONTRACT_TEMP.CLASS_NAME,sql).executeUpdate();
JBOFactory.createBizObjectQuery(LC_CALC_CONDITION_TEMP.CLASS_NAME,sql).executeUpdate();
JBOFactory.createBizObjectQuery(LC_RENT_PLAN_TEMP.CLASS_NAME,sql).executeUpdate();
JBOFactory.createBizObjectQuery(LC_FUND_PLAN_TEMP.CLASS_NAME,sql).executeUpdate();
JBOFactory.createBizObjectQuery(LC_CASH_FLOW_TEMP.CLASS_NAME,sql).executeUpdate();
JBOFactory.createBizObjectQuery(LC_CALC_CONDITION_HIS.CLASS_NAME,sql).executeUpdate();
JBOFactory.createBizObjectQuery(LC_RENT_PLAN_HIS.CLASS_NAME,sql).executeUpdate();
JBOFactory.createBizObjectQuery(LC_CASH_FLOW_HIS.CLASS_NAME,sql).executeUpdate();
}catch(Exception e){
e.printStackTrace();
}
}
/**
* ɾ<><C9BE><EFBFBD><EFBFBD><EFBFBD>л<EFBFBD>׼<EFBFBD><D7BC><EFBFBD><EFBFBD>
* @return
*/
@SuppressWarnings("unchecked")
public String deleteStandardInfo() {
try{
List<BizObject> list1=JBOFactory.createBizObjectQuery(LC_ADJUST_CONTRACT_TEMP.CLASS_NAME,"adjust_id = :adjust_id").setParameter("adjust_id",this.adjustid).getResultList(false);
List<BizObject> list2=JBOFactory.createBizObjectQuery(LC_ADJUST_CONTRACT.CLASS_NAME,"adjust_id = :adjust_id").setParameter("adjust_id",this.adjustid).getResultList(false);
if((null==list1||list1.size()==0)&&(null==list2||list2.size()==0)){
JBOFactory.createBizObjectQuery(LC_STANDARD_INTEREST.CLASS_NAME,"delete O WHERE ID=:id").setParameter("id",this.adjustid).executeUpdate();
return "ɾ<EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD>";
}else{
return "<EFBFBD>ü<EFBFBD>¼<EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD>Ϣ<EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>";
}
}catch(Exception e){
e.printStackTrace();
}
return null;
}
public String getAdjustid() {
return adjustid;
}
public void setAdjustid(String adjustid) {
this.adjustid = adjustid;
}
public String getFlowunid() {
return flowunid;
}
public void setFlowunid(String flowunid) {
this.flowunid = flowunid;
}
public String getPayment_number() {
return payment_number;
}
public void setPayment_number(String payment_number) {
this.payment_number = payment_number;
}
public String getProduct_id() {
return product_id;
}
public void setProduct_id(String product_id) {
this.product_id = product_id;
}
}