Merge branch 'ap007' into dailyfix
This commit is contained in:
commit
e19d3e4842
@ -509,15 +509,11 @@
|
||||
<attributes>
|
||||
<attribute name="ID" label="唯一标识" type="STRING" length="32" />
|
||||
<attribute name="FC_REQUEST_ID" label="资方请求id" type="STRING" length="32"/>
|
||||
<attribute name="OVERDUE_LIST" label="逾期开始期次" type="STRING" length="32"/>
|
||||
<attribute name="FIRST_OVERDUE_CORPUS" label="逾期第一期本金" type="STRING" length="32"/>
|
||||
<attribute name="FIRST_OVERDUE_INTEREST" label="逾期第一期利息" type="STRING" length="32"/>
|
||||
<attribute name="FIRST_OVERDUE_PENALTY" label="逾期第一期罚息" type="STRING" length="32"/>
|
||||
<attribute name="SECOND_OVERDUE_CORPUS" label="逾期第二期本金" type="STRING" length="32"/>
|
||||
<attribute name="SECOND_OVERDUE_INTEREST" label="逾期第二期利息" type="STRING" length="32"/>
|
||||
<attribute name="SECOND_OVERDUE_PENALTY" label="逾期第二期罚息" type="STRING" length="32"/>
|
||||
<attribute name="ALL_REMAIN_CORPUS" label="回购本金" type="STRING" length="32"/>
|
||||
<attribute name="ALL_REMAIN_INTEREST" label="回购利息" type="STRING" length="32"/>
|
||||
<attribute name="ALL_REMAIN_PENALTY" label="回购罚息" type="STRING" length="32"/>
|
||||
<attribute name="BUYBACK_MONEY" label="实际回购总金额" type="STRING" length="32"/>
|
||||
<attribute name="ALL_REMAIN_MONEY" label="回购金额(本金+利息),不包含罚息" type="STRING" length="32"/>
|
||||
<attribute name="IS_CONFIRM" label="是否已确认" type="STRING" length="32"/>
|
||||
<attribute name="VOUCHER_STATUS" label="凭证状态:0,未生成,1,已生成" type="STRING" length="32"/>
|
||||
<attribute name="INPUTUSERID" label="登记人" type="STRING" length="32"/>
|
||||
<attribute name="INPUTTIME" label="登记时间" type="STRING" length="32"/>
|
||||
|
||||
@ -1,58 +0,0 @@
|
||||
<%@ page contentType="text/html; charset=GBK"%><%@
|
||||
include file="/Frame/resources/include/include_begin_info.jspf"%><%
|
||||
|
||||
String id = CurPage.getParameter("ID");
|
||||
String fcRequestId = CurPage.getParameter("fcRequestId");
|
||||
String firstOverdueCorpus = CurPage.getParameter("firstOverdueCorpus");
|
||||
String firstOverdueInterest = CurPage.getParameter("firstOverdueInterest");
|
||||
String secondOverdueCorpus = CurPage.getParameter("secondOverdueCorpus");
|
||||
String secondOverdueInterest = CurPage.getParameter("secondOverdueInterest");
|
||||
String overdueList = CurPage.getParameter("overdueList");
|
||||
String voucherStatus = CurPage.getParameter("voucherStatus");
|
||||
String allRemainMoney = CurPage.getParameter("allRemainMoney");
|
||||
String readOnly = "0";
|
||||
if("1".equals(voucherStatus)){
|
||||
readOnly="1";
|
||||
}
|
||||
ASObjectModel doTemp = new ASObjectModel("FC_BUYBACK_INFO");
|
||||
ASObjectWindow dwTemp = new ASObjectWindow(CurPage,doTemp,request);
|
||||
dwTemp.Style="2"; //设置DW风格 1:Grid 2:Freeform
|
||||
dwTemp.ReadOnly = readOnly; //设置是否只读 1:只读 0:可写
|
||||
dwTemp.genHTMLObjectWindow(id);
|
||||
|
||||
String sButtons[][] = {
|
||||
{"0".equals(readOnly)?"true":"false","All","Button","保存","保存所有修改","save()","","","",""},
|
||||
{"true","","Button","返回","返回","returnList()","","","",""},
|
||||
};
|
||||
sButtonPosition = "south";
|
||||
%><%@include file="/Frame/resources/include/ui/include_info.jspf"%>
|
||||
<script type="text/javascript">
|
||||
window.onload=function(){
|
||||
var id = getItemValue(0,0,"ID");
|
||||
if(typeof(id)=="undefined" || id.length==0){
|
||||
setItemValue(0,0,"FC_REQUEST_ID","<%=fcRequestId%>");
|
||||
setItemValue(0,0,"FIRST_OVERDUE_CORPUS","<%=firstOverdueCorpus%>");
|
||||
setItemValue(0,0,"FIRST_OVERDUE_INTEREST","<%=firstOverdueInterest%>");
|
||||
setItemValue(0,0,"SECOND_OVERDUE_CORPUS","<%=secondOverdueCorpus%>");
|
||||
setItemValue(0,0,"SECOND_OVERDUE_INTEREST","<%=secondOverdueInterest%>");
|
||||
setItemValue(0,0,"OVERDUE_LIST","<%=overdueList%>");
|
||||
setItemValue(0,0,"ALL_REMAIN_MONEY","<%=allRemainMoney%>");
|
||||
}
|
||||
}
|
||||
function returnList(){
|
||||
AsControl.OpenComp("com/tenwa/apzl/settleLoan/FcBuyBackList.jsp","","_self","");
|
||||
}
|
||||
function save(){
|
||||
var allRemainMoney = getItemValue(0,0,"ALL_REMAIN_MONEY");
|
||||
var firstOverduePenalty = getItemValue(0,0,"FIRST_OVERDUE_PENALTY");
|
||||
var secondOverduePenalty = getItemValue(0,0,"SECOND_OVERDUE_PENALTY");
|
||||
var buybackMoney = getItemValue(0,0,"BUYBACK_MONEY");
|
||||
var buybackMoneySum = eval( allRemainMoney +"+"+ firstOverduePenalty +"+"+ secondOverduePenalty) ;
|
||||
if(buybackMoney!=buybackMoneySum.toFixed(2)){
|
||||
alert("本金利息罚息金额相加总额"+buybackMoneySum+"与所填‘回购总金额’不相等");
|
||||
return;
|
||||
}
|
||||
as_save(0);
|
||||
}
|
||||
</script>
|
||||
<%@ include file="/Frame/resources/include/include_end.jspf"%>
|
||||
@ -5,8 +5,10 @@
|
||||
Content:
|
||||
History Log:
|
||||
*/
|
||||
String userID = CurUser.getUserID();
|
||||
ASObjectModel doTemp = new ASObjectModel("FC_BUYBACK_LIST");
|
||||
ASObjectWindow dwTemp = new ASObjectWindow(CurPage,doTemp,request);
|
||||
dwTemp.MultiSelect = true;
|
||||
dwTemp.Style="1"; //--设置为Grid风格--
|
||||
dwTemp.ReadOnly = "1"; //只读模式
|
||||
dwTemp.setPageSize(20);
|
||||
@ -14,61 +16,39 @@
|
||||
|
||||
//0、是否展示 1、 权限控制 2、 展示类型 3、按钮显示名称 4、按钮解释文字 5、按钮触发事件代码 6、 7、 8、 9、图标,CSS层叠样式 10、风格
|
||||
String sButtons[][] = {
|
||||
{"true","","Button","新增","新增","newRecord()","","","","btn_icon_detail",""},
|
||||
{"true","","Button","修改","修改","viewAndEdit()","","","","btn_icon_detail",""},
|
||||
{"true","","Button","删除","删除","deleteRecord()","","","","btn_icon_delete",""},
|
||||
|
||||
{"true","","Button","确认","确认回购信息无误","confirmRecord()","","","","btn_icon_detail",""},
|
||||
};
|
||||
%><%@include file="/Frame/resources/include/ui/include_list.jspf"%>
|
||||
<script type="text/javascript">
|
||||
function newRecord(){
|
||||
var param = '';
|
||||
AsDialog.OpenSelector("CorpusSourceContract",param,"dialogWidth=" + parseInt(window.screen.width * 0.8) + "px dialogHeight=" + parseInt(window.screen.height * 0.6) + "px",function(sReturn) {
|
||||
if (!sReturn || sReturn == "_CANCEL_" || sReturn == "_NONE_") {
|
||||
//alert(getHtmlMessage('1'));//请选择一条信息!
|
||||
return;
|
||||
}
|
||||
debugger;
|
||||
sReturn = sReturn.split("@");
|
||||
var fcRequestId=sReturn[0];
|
||||
var contractId=sReturn[1];
|
||||
var result = AsControl.RunJavaMethod("com.ap.BuyBack", "isHasCheck","fcRequestId="+fcRequestId);
|
||||
if(result>0){
|
||||
alert("该合同已经回购,请勿重复发起");
|
||||
return;
|
||||
}
|
||||
var result = AsControl.RunJavaMethod("com.ap.BuyBack", "getBuyBackInfoByContract","contractId="+contractId);
|
||||
var firstOverdueCorpus = result.FIRST_OVERDUE_CORPUS;
|
||||
var firstOverdueInterest = result.FIRST_OVERDUE_INTEREST;
|
||||
var secondOverdueCorpus = result.SECOND_OVERDUE_CORPUS;
|
||||
var secondOverdueInterest = result.SECOND_OVERDUE_INTEREST;
|
||||
var overdueList = result.OVERDUE_LIST;
|
||||
var allRemainMoney = result.ALL_REMAIN_MONEY;
|
||||
var param = 'fcRequestId='+fcRequestId+'&firstOverdueCorpus='+firstOverdueCorpus+'&firstOverdueInterest='+firstOverdueInterest+'&secondOverdueCorpus='+secondOverdueCorpus+'&secondOverdueInterest='+secondOverdueInterest+'&overdueList='+overdueList+'&allRemainMoney='+allRemainMoney;
|
||||
var sUrl = "com/tenwa/apzl/settleLoan/FcBuyBackInfo.jsp";
|
||||
AsControl.OpenView(sUrl,param,'_self','');
|
||||
function confirmRecord(){
|
||||
|
||||
},'请选择对应的资方合同');
|
||||
|
||||
}
|
||||
function viewAndEdit(){
|
||||
var sUrl = "com/tenwa/apzl/settleLoan/FcBuyBackInfo.jsp";
|
||||
var id = getItemValue(0,getRow(0),'ID');
|
||||
if(typeof(id)=="undefined" || id.length==0){
|
||||
alert("请先选择对应的数据");
|
||||
var fcRequestIds = getItemValueArray(0,"FC_REQUEST_ID")+","+TablePage.getCheckedItemValueArrayWithOtherPage("FC_REQUEST_ID",s_c_p[0]);
|
||||
var isConfirms = getItemValueArray(0,"IS_CONFIRM")+","+TablePage.getCheckedItemValueArrayWithOtherPage("IS_CONFIRM",s_c_p[0]);
|
||||
if("," == fcRequestIds){
|
||||
alert("请先勾选需要确认的数据");
|
||||
return;
|
||||
}
|
||||
var voucherStatus = getItemValue(0,getRow(0),'VOUCHER_STATUS');
|
||||
var sPara ='ID='+id+'&voucherStatus='+voucherStatus;
|
||||
AsControl.OpenView(sUrl,sPara ,'_self','');
|
||||
}
|
||||
function deleteRecord(){
|
||||
var sPara = getItemValue(0,getRow(0),'ID');
|
||||
if(typeof(sPara)=="undefined" || sPara.length==0 ){
|
||||
alert("请选择一条数据!");
|
||||
return ;
|
||||
var isConfirmArray = isConfirms.split(",");
|
||||
for(var i=0 ; i<isConfirmArray.length ; i++){
|
||||
var isConfirm = isConfirmArray[i];
|
||||
if(isConfirm==1){
|
||||
alert("请勿勾选已确认的合同");
|
||||
return;
|
||||
}
|
||||
}
|
||||
if(confirm('确实要删除吗?'))
|
||||
as_delete(0);
|
||||
fcRequestIds = fcRequestIds.replace(/,/ig,"@");
|
||||
var confirmResult = AsControl.RunJavaMethodTrans("com.ap.BuyBack", "confirmBuyBack","fcRequestIds="+fcRequestIds);
|
||||
if(confirmResult!=""){
|
||||
confirmResult = confirmResult + "\n\r确认要进行确认吗?";
|
||||
if(!confirm(confirmResult)){
|
||||
return;
|
||||
}
|
||||
}
|
||||
var sResult = AsControl.RunJavaMethodTrans("com.ap.BuyBack", "updateBuyBackConfirm","fcRequestIds="+fcRequestIds+",userID=<%=userID%>");
|
||||
reloadSelf();
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
<%@ include file="/Frame/resources/include/include_end.jspf"%>
|
||||
@ -1,24 +1,29 @@
|
||||
package com.ap;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.amarsoft.are.jbo.*;
|
||||
import com.amarsoft.are.util.StringFunction;
|
||||
import jbo.app.tenwa.calc.LC_RENT_INCOME;
|
||||
import jbo.app.tenwa.calc.LC_RENT_PLAN;
|
||||
import jbo.oti.FC_BUYBACK_INFO;
|
||||
import jbo.oti.FC_REQUEST;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class BuyBack {
|
||||
|
||||
private String contractId;
|
||||
private String fcRequestId;
|
||||
|
||||
private String fcRequestIds;
|
||||
private String userID;
|
||||
/**
|
||||
* 获取开始逾期的两期的本金利息以及开始期次
|
||||
* @return JSON格式的字符串
|
||||
* 获取剩余本金利息
|
||||
* @return
|
||||
* @throws JBOException
|
||||
*/
|
||||
public String getBuyBackInfoByContract() throws JBOException {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
public Map<String,String> getBuyBackInfoByContract(String contractId) throws JBOException {
|
||||
Map<String,String> map = new HashMap<>();
|
||||
//获取实收表最后一期信息记录
|
||||
String sql = "select sum(rent) as v.rent,sum(CORPUS) as v.corpus,sum(INTEREST) as v.interest,PLAN_LIST,PLAN_ID from O where CONTRACT_ID='"+contractId+"' "
|
||||
+ "and plan_list=(select max(plan_list) from O where CONTRACT_ID='"+contractId+"') group by PLAN_LIST";
|
||||
@ -47,63 +52,102 @@ public class BuyBack {
|
||||
//不带0为当期;带1为下一期;带2为下两期
|
||||
//+1期为通用,故挪到上面来
|
||||
BizObject boLRP1 = boqLRP.setParameter("planList",planList+1).getSingleResult(false);
|
||||
String corpus1 = "0.00";
|
||||
String interest1 = "0.00";
|
||||
if(boLRP1!=null){
|
||||
corpus1 = boLRP1.getAttribute("corpus").toString();
|
||||
interest1 = boLRP1.getAttribute("interest").toString();
|
||||
}
|
||||
|
||||
if(planListIsComplete){
|
||||
BizObject boLRP2 = boqLRP.setParameter("planList",planList+2).getSingleResult(false);
|
||||
String corpus2 = "0.00";
|
||||
String interest2 = "0.00";
|
||||
if(boLRP2!=null){
|
||||
corpus2 = boLRP2.getAttribute("corpus").toString();
|
||||
interest2 = boLRP2.getAttribute("interest").toString();
|
||||
}
|
||||
jsonObject.put("FIRST_OVERDUE_CORPUS",corpus1);
|
||||
jsonObject.put("FIRST_OVERDUE_INTEREST",interest1);
|
||||
jsonObject.put("SECOND_OVERDUE_CORPUS",corpus2);
|
||||
jsonObject.put("SECOND_OVERDUE_INTEREST",interest2);
|
||||
jsonObject.put("OVERDUE_LIST",planList+1);
|
||||
jsonObject.put("ALL_REMAIN_MONEY",new BigDecimal(allRemainCorpus).add(new BigDecimal(interest1)).add(new BigDecimal(interest2)).setScale(2,BigDecimal.ROUND_HALF_UP).toString());
|
||||
map.put("ALL_REMAIN_CORPUS",allRemainCorpus);
|
||||
map.put("ALL_REMAIN_INTEREST",new BigDecimal(interest1).add(new BigDecimal(interest2)).setScale(2,BigDecimal.ROUND_HALF_UP).toString());
|
||||
}else{
|
||||
String buyBackCorpus = new BigDecimal(boLRP.getAttribute("corpus").toString()).subtract(new BigDecimal(corpus)).setScale(2,BigDecimal.ROUND_HALF_UP).toString();
|
||||
String buyBackInterest = new BigDecimal(boLRP.getAttribute("interest").toString()).subtract(new BigDecimal(interest)).setScale(2,BigDecimal.ROUND_HALF_UP).toString();
|
||||
jsonObject.put("FIRST_OVERDUE_CORPUS",buyBackCorpus);
|
||||
jsonObject.put("FIRST_OVERDUE_INTEREST",buyBackInterest);
|
||||
jsonObject.put("SECOND_OVERDUE_CORPUS",corpus1);
|
||||
jsonObject.put("SECOND_OVERDUE_INTEREST",interest1);
|
||||
jsonObject.put("OVERDUE_LIST",planList);
|
||||
jsonObject.put("ALL_REMAIN_MONEY", new BigDecimal(allRemainCorpus).subtract(new BigDecimal(corpus)).add(new BigDecimal(buyBackInterest)).add(new BigDecimal(interest1)).setScale(2,BigDecimal.ROUND_HALF_UP).toString());
|
||||
map.put("ALL_REMAIN_CORPUS",new BigDecimal(allRemainCorpus).subtract(new BigDecimal(corpus)).setScale(2,BigDecimal.ROUND_HALF_UP).toString());
|
||||
map.put("ALL_REMAIN_INTEREST",new BigDecimal(buyBackInterest).add(new BigDecimal(interest1)).setScale(2,BigDecimal.ROUND_HALF_UP).toString());
|
||||
}
|
||||
return jsonObject.toString();
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
* 检验是否已经回购
|
||||
* 确认回购本金利息和系统计算出的是否相等
|
||||
* @param tx
|
||||
* @return
|
||||
* @throws JBOException
|
||||
*/
|
||||
public String isHasCheck() throws JBOException {
|
||||
BizObjectManager bomFBI = JBOFactory.getBizObjectManager(FC_BUYBACK_INFO.CLASS_NAME);
|
||||
int boFBI = bomFBI.createQuery("FC_REQUEST_ID=:fcRequestId").setParameter("fcRequestId",fcRequestId).getTotalCount();
|
||||
return boFBI+"";
|
||||
public String confirmBuyBack(JBOTransaction tx) throws JBOException {
|
||||
String corpusResult = "";
|
||||
String interestResult = "";
|
||||
String[] idArray = fcRequestIds.split("@");
|
||||
for(String fcRequestId : idArray){
|
||||
BizObjectManager bomFBI = JBOFactory.getBizObjectManager(FC_BUYBACK_INFO.CLASS_NAME,tx);
|
||||
BizObject boFR = JBOFactory.getBizObjectManager(FC_REQUEST.CLASS_NAME,tx).createQuery("ID=:fcRequestId")
|
||||
.setParameter("fcRequestId",fcRequestId).getSingleResult(false);
|
||||
if(boFR==null){
|
||||
continue;
|
||||
}
|
||||
String contractId = boFR.getAttribute("CONTRACT_ID").toString();
|
||||
String contractNo = boFR.getAttribute("CONTRACT_NO").toString();
|
||||
|
||||
BizObject boFBI = bomFBI.createQuery("FC_REQUEST_ID=:fcRequestId").setParameter("fcRequestId",fcRequestId).getSingleResult(false);
|
||||
String allRemainCorpus = boFBI.getAttribute("ALL_REMAIN_CORPUS").toString();
|
||||
String allRemainInterest = boFBI.getAttribute("ALL_REMAIN_INTEREST").toString();
|
||||
Map<String,String> buyBack= this.getBuyBackInfoByContract(contractId);
|
||||
if(!allRemainCorpus.equals(buyBack.get("ALL_REMAIN_CORPUS"))){
|
||||
corpusResult = corpusResult + contractNo + ",";
|
||||
}
|
||||
if(!allRemainInterest.equals(buyBack.get("ALL_REMAIN_INTEREST"))){
|
||||
interestResult = interestResult + contractNo + ",";
|
||||
}
|
||||
}
|
||||
corpusResult = corpusResult==""?"":"以下合同的回购本金与系统剩余应还本金不相等:"+corpusResult+"\n";
|
||||
interestResult = interestResult==""?"":"以下合同的回购利息与系统剩余应还利息不相等:"+interestResult+"\n";
|
||||
return corpusResult + interestResult ;
|
||||
}
|
||||
|
||||
/**
|
||||
* 确认回购
|
||||
* @param tx
|
||||
* @return
|
||||
* @throws JBOException
|
||||
*/
|
||||
public String updateBuyBackConfirm(JBOTransaction tx) throws JBOException {
|
||||
String[] idArray = fcRequestIds.split("@");
|
||||
BizObjectManager bomFBI = JBOFactory.getBizObjectManager(FC_BUYBACK_INFO.CLASS_NAME, tx);
|
||||
BizObjectQuery boqFBI = bomFBI.createQuery("FC_REQUEST_ID=:fcRequestId");
|
||||
for(String fcRequestId : idArray) {
|
||||
BizObject boFBI = boqFBI.setParameter("fcRequestId",fcRequestId).getSingleResult(true);
|
||||
boFBI.setAttributeValue("IS_CONFIRM","1");
|
||||
boFBI.setAttributeValue("UPDATEUSERID",userID);
|
||||
boFBI.setAttributeValue("UPDATETIME", StringFunction.getTodayNow());
|
||||
bomFBI.saveObject(boFBI);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getContractId() {
|
||||
return contractId;
|
||||
}
|
||||
|
||||
public void setContractId(String contractId) {
|
||||
this.contractId = contractId;
|
||||
}
|
||||
|
||||
public String getFcRequestId() {
|
||||
return fcRequestId;
|
||||
}
|
||||
|
||||
public void setFcRequestId(String fcRequestId) {
|
||||
this.fcRequestId = fcRequestId;
|
||||
}
|
||||
public String getFcRequestIds() {
|
||||
return fcRequestIds;
|
||||
}
|
||||
public void setFcRequestIds(String fcRequestIds) {
|
||||
this.fcRequestIds = fcRequestIds;
|
||||
}
|
||||
public String getUserID() {return userID;}
|
||||
public void setUserID(String userID) {this.userID = userID;}
|
||||
}
|
||||
|
||||
@ -20,41 +20,25 @@ public interface FC_BUYBACK_INFO {
|
||||
*/
|
||||
public static final String FC_REQUEST_ID = "FC_REQUEST_ID";
|
||||
/**
|
||||
* 逾期开始期次 STRING(32)<br>
|
||||
* 回购本金 STRING(32)<br>
|
||||
*/
|
||||
public static final String OVERDUE_LIST = "OVERDUE_LIST";
|
||||
public static final String ALL_REMAIN_CORPUS = "ALL_REMAIN_CORPUS";
|
||||
/**
|
||||
* 逾期第一期本金 STRING(32)<br>
|
||||
* 回购利息 STRING(32)<br>
|
||||
*/
|
||||
public static final String FIRST_OVERDUE_CORPUS = "FIRST_OVERDUE_CORPUS";
|
||||
public static final String ALL_REMAIN_INTEREST = "ALL_REMAIN_INTEREST";
|
||||
/**
|
||||
* 逾期第一期利息 STRING(32)<br>
|
||||
* 回购罚息 STRING(32)<br>
|
||||
*/
|
||||
public static final String FIRST_OVERDUE_INTEREST = "FIRST_OVERDUE_INTEREST";
|
||||
/**
|
||||
* 逾期第一期罚息 STRING(32)<br>
|
||||
*/
|
||||
public static final String FIRST_OVERDUE_PENALTY = "FIRST_OVERDUE_PENALTY";
|
||||
/**
|
||||
* 逾期第二期本金 STRING(32)<br>
|
||||
*/
|
||||
public static final String SECOND_OVERDUE_CORPUS = "SECOND_OVERDUE_CORPUS";
|
||||
/**
|
||||
* 逾期第二期利息 STRING(32)<br>
|
||||
*/
|
||||
public static final String SECOND_OVERDUE_INTEREST = "SECOND_OVERDUE_INTEREST";
|
||||
/**
|
||||
* 逾期第二期罚息 STRING(32)<br>
|
||||
*/
|
||||
public static final String SECOND_OVERDUE_PENALTY = "SECOND_OVERDUE_PENALTY";
|
||||
public static final String ALL_REMAIN_PENALTY = "ALL_REMAIN_PENALTY";
|
||||
/**
|
||||
* 实际回购总金额 STRING(32)<br>
|
||||
*/
|
||||
public static final String BUYBACK_MONEY = "BUYBACK_MONEY";
|
||||
/**
|
||||
* 回购金额(本金+利息),不包含罚息 STRING(32)<br>
|
||||
* 是否已确认 STRING(32)<br>
|
||||
*/
|
||||
public static final String ALL_REMAIN_MONEY = "ALL_REMAIN_MONEY";
|
||||
public static final String IS_CONFIRM = "IS_CONFIRM";
|
||||
/**
|
||||
* 凭证状态:0,未生成,1,已生成 STRING(32)<br>
|
||||
*/
|
||||
|
||||
@ -5,6 +5,7 @@ import com.amarsoft.are.jbo.*;
|
||||
import com.amarsoft.are.util.StringFunction;
|
||||
import com.amarsoft.awe.util.Transaction;
|
||||
import com.base.util.QuartzUtil;
|
||||
import jbo.oti.FC_BUYBACK_INFO;
|
||||
import jbo.oti.FC_YC_FILE_REPAY_RESULT;
|
||||
import org.quartz.Job;
|
||||
import org.quartz.JobExecutionContext;
|
||||
@ -59,14 +60,16 @@ public class CorpusSourceRentResultCopy extends CorpusSourceFileCopy implements
|
||||
//0.获取所有参数(以文件信息为基础,将合同参数补充进去)
|
||||
List<Map<String,String>> allParam = this.getAllParam(fyfrpBoList,tx);
|
||||
for(Map<String,String> param : allParam){
|
||||
//1.插入租金实收表
|
||||
this.insertRentIncome(param,tx);
|
||||
// 2.0根据状态的不同,来进行不同的操作
|
||||
//2.1如果当期正常结清或者当期逾期结清,
|
||||
|
||||
// 1.0根据状态的不同,来进行不同的操作
|
||||
//1.1如果当期正常结清或者当期逾期结清,
|
||||
if("0".equals(param.get("repaymentFlag"))){
|
||||
this.insertRentIncome(param,tx);
|
||||
updateRentPlanStatus(param,tx);
|
||||
//2.2如果提前结清 并且 为借款人本人账户,则视为客户本人提前结清,直接变更租金计划表租金计划
|
||||
}else if("3".equals(param.get("repaymentFlag"))&&"0".equals(param.get("repaymentSource"))){
|
||||
}
|
||||
//1.2如果提前结清 并且 为借款人本人账户,则视为客户本人提前结清,直接变更租金计划表租金计划
|
||||
if("3".equals(param.get("repaymentFlag"))&&"0".equals(param.get("repaymentSource"))){
|
||||
this.insertRentIncome(param,tx);
|
||||
//租金计划,现金流存历史表
|
||||
//每个合同只有一次提前结清,只有提前结清才会走这里,所以按照合同id来执行
|
||||
copyRentPlanFormatToHis(param.get("contractId"),param.get("fcRequestId"),"邮储提前结清前租金计划",tx);
|
||||
@ -79,12 +82,14 @@ public class CorpusSourceRentResultCopy extends CorpusSourceFileCopy implements
|
||||
createCashFlowByContractId(param.get("contractId"),Sqlca);
|
||||
//重新Irr计算
|
||||
calcIRR(param,tx);
|
||||
//2.3如果提请结清 并且 为非借款人本人账户,则视为我方回购,需改变资方状态,我方能继续扣款
|
||||
}else if("3".equals(param.get("repaymentFlag"))&&"1".equals(param.get("repaymentSource"))){
|
||||
}
|
||||
//1.3如果提请结清 并且 为非借款人本人账户,则视为我方回购,需改变资方状态,我方能继续扣款
|
||||
if("3".equals(param.get("repaymentFlag"))&&"1".equals(param.get("repaymentSource"))){
|
||||
int result = 1;
|
||||
//变更资方资源(要有日志)
|
||||
try{
|
||||
changeCorpusSource(param,tx);
|
||||
createBuyBackInfo(param,tx);
|
||||
}catch (JBOException e){
|
||||
result = 0;
|
||||
e.printStackTrace();
|
||||
@ -99,6 +104,20 @@ public class CorpusSourceRentResultCopy extends CorpusSourceFileCopy implements
|
||||
}
|
||||
|
||||
}
|
||||
public void createBuyBackInfo(Map<String,String> param, JBOTransaction tx) throws JBOException {
|
||||
BizObjectManager bomFBI = JBOFactory.getBizObjectManager(FC_BUYBACK_INFO.CLASS_NAME,tx);
|
||||
BizObject boFBI = bomFBI.newObject();
|
||||
boFBI.setAttributeValue("FC_REQUEST_ID",param.get("fcRequestId"));
|
||||
boFBI.setAttributeValue("ALL_REMAIN_CORPUS",param.get("principal"));
|
||||
boFBI.setAttributeValue("ALL_REMAIN_INTEREST",param.get("interest"));
|
||||
boFBI.setAttributeValue("ALL_REMAIN_PENALTY",param.get("penalty"));
|
||||
boFBI.setAttributeValue("BUYBACK_MONEY",param.get("repaymentMoney"));
|
||||
boFBI.setAttributeValue("IS_CONFIRM","0");
|
||||
boFBI.setAttributeValue("VOUCHER_STATUS","0");
|
||||
boFBI.setAttributeValue("INPUTUSERID","system");
|
||||
boFBI.setAttributeValue("INPUTTIME",StringFunction.getTodayNow());
|
||||
bomFBI.saveObject(boFBI);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据文件ID获取《租金实收》信息
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user