暂存
This commit is contained in:
parent
dbfb3f23d5
commit
c60b41a154
@ -755,10 +755,12 @@
|
||||
}
|
||||
|
||||
function setIdexpiry(){
|
||||
var curDate = new Date();
|
||||
;
|
||||
var date = document.getElementById("IDEXPIRY");
|
||||
var dateValue = "";
|
||||
dateValue = date.value;
|
||||
AsDialog.OpenCalender(date,"yyyy/MM/dd","1900/01/01","2100/12/31",function(dateValue){
|
||||
AsDialog.OpenCalender(date,"yyyy/MM/dd",curDate.toLocaleDateString(),"2099/12/31",function(dateValue){
|
||||
var myNewValue = "",myValue="";
|
||||
myValue = this.dayValue;
|
||||
if(typeof(myValue)!="undefined" && myValue!="undefined"){
|
||||
|
||||
@ -410,6 +410,35 @@
|
||||
</managerProperties>
|
||||
</manager>
|
||||
</class>
|
||||
<class name="FC_JJ_REPAY_PLAN" label="资方租金计划信息--九江" describe="资方租金计划信息--九江" keyAttributes="ID">
|
||||
<attributes>
|
||||
<attribute name="ID" label="唯一标识" type="STRING" length="32" />
|
||||
<attribute name="FC_FILE_ID" label="资金渠道申请ID" type="STRING" length="32"/>
|
||||
<attribute name="FC_PUSH_NAME" label="资金渠道申请ID" type="STRING" length="32"/>
|
||||
<attribute name="FC_REQUEST_ID" label="资金渠道申请ID" type="STRING" length="32"/>
|
||||
<attribute name="BSN_CNL_NO" label="业务渠道编号" type="STRING" length="32"/>
|
||||
<attribute name="TECH_CNL_NO" label="技术渠道编号" type="STRING" length="32"/>
|
||||
<attribute name="DUE_BILL_NO" label="借据号" type="STRING" length="32"/>
|
||||
<attribute name="LOAN_INIT_PRIN" label="贷款总本金" type="STRING" length="32"/>
|
||||
<attribute name="LOAN_INIT_TERM" label="分期总期数" type="STRING" length="32"/>
|
||||
<attribute name="ALL_DISCOUNT_AMT" label="优惠总金额" type="STRING" length="32"/>
|
||||
<attribute name="CURR_TERM" label="期次" type="STRING" length="32"/>
|
||||
<attribute name="PMT_DUE_DATE" label="还款日期" type="STRING" length="32"/>
|
||||
<attribute name="LOAN_TERM_PRIN" label="本金" type="STRING" length="32"/>
|
||||
<attribute name="LOAN_TERM_INTEREST" label="利息" type="STRING" length="32"/>
|
||||
<attribute name="LOAN_TERM_FEE" label="租金" type="STRING" length="32"/>
|
||||
<attribute name="SUB_DUE_BILL_NO" label="子借据号" type="STRING" length="32"/>
|
||||
<attribute name="DISCOUNT_AMT" label="优惠金额" type="STRING" length="32"/>
|
||||
<attribute name="CREATE_TIME" label="创建时间" type="STRING" length="32"/>
|
||||
<attribute name="UPDATE_TIME" label="修改时间" type="STRING" length="32"/>
|
||||
</attributes>
|
||||
<manager>
|
||||
<managerProperties>
|
||||
<property name="table" value="fc_jj_repay_plan"/>
|
||||
<property name="createKey" value="true" />
|
||||
</managerProperties>
|
||||
</manager>
|
||||
</class>
|
||||
<class name="FC_YC_PREPAY_QUERY" label="瓊품써헌桿炬쌈왯코휭" describe="瓊품써헌桿炬쌈왯코휭" keyAttributes="ID">
|
||||
<attributes>
|
||||
<attribute name="ID" label="顆寧깃街" type="STRING" length="32" />
|
||||
|
||||
@ -0,0 +1,76 @@
|
||||
package com.tenwa.voucher.serviceImp;
|
||||
|
||||
import com.amarsoft.are.jbo.JBOException;
|
||||
import com.amarsoft.awe.util.Transaction;
|
||||
import com.amarsoft.dict.als.cache.CacheLoaderFactory;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class FundIncomeVoucherJJCCB extends FundIncomeVoucherInfoServiceImpl {
|
||||
@Override
|
||||
public void run() {
|
||||
Transaction Sqlca =null;
|
||||
try {
|
||||
Sqlca = Transaction.createTransaction(CacheLoaderFactory.getDataSource());
|
||||
//todo 头上线将生产环境的编号放进来
|
||||
setVoucherConfigNo("PZ2021101200000035");
|
||||
setCorpusChannelNo("JJCCB");
|
||||
generateVoucher(Sqlca);
|
||||
} catch (JBOException e) {
|
||||
e.printStackTrace();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}finally {
|
||||
try {
|
||||
if(Sqlca!=null){
|
||||
Sqlca.disConnect();
|
||||
Sqlca = null;
|
||||
}
|
||||
} catch (JBOException e) {
|
||||
e.printStackTrace();
|
||||
try {
|
||||
Sqlca.rollback();
|
||||
} catch (JBOException jboException) {
|
||||
jboException.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 每条凭证各自差异数据放到参数List
|
||||
* @param param
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public void addRespectiveParam(Map<String,String> param) throws Exception {
|
||||
String money = "";
|
||||
//100202为九江银行
|
||||
if("100202".equals(param.get("subjectsCode"))){
|
||||
money=param.get("TRANS_AMT");
|
||||
param.put("contractNo","");
|
||||
param.put("customerNo","");
|
||||
param.put("customerName","");
|
||||
//应财务要求九江银行填固定值(一般编码为银行的,都是11213,分内部外部)
|
||||
param.put("cashFlow","11213");
|
||||
}
|
||||
//长期应收款\回租\汽车\本金
|
||||
if("1531020101".equals(param.get("subjectsCode"))){
|
||||
money=param.get("TRANS_AMT");
|
||||
}
|
||||
//未实现融资收益\回租\汽车 或 长期应收款\回租\汽车\利息
|
||||
if("15320201".equals(param.get("subjectsCode"))||"1531020102".equals(param.get("subjectsCode"))){
|
||||
money=this.getInterestTotalByContractId(param.get("contractId"));
|
||||
}
|
||||
//debit:借;credit:贷
|
||||
if("1".equals(param.get("entrydc"))) {
|
||||
param.put("debitMoney",money);
|
||||
param.put("creditMoney","0.00");
|
||||
}else{
|
||||
param.put("debitMoney","0.00");
|
||||
param.put("creditMoney",money);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -36,12 +36,13 @@ public class CorpusSourceFileCopy {
|
||||
|
||||
private String contractId;
|
||||
private String fileType;
|
||||
private String channelNo;
|
||||
|
||||
public void doCopy(JBOTransaction tx) throws Exception {
|
||||
BizObjectManager ffpBom = null;
|
||||
ffpBom = JBOFactory.getBizObjectManager(FC_FILE_PUSH.CLASS_NAME,tx);
|
||||
//todo 添加渠道商的选择,哪些需要拷表哪些不需要
|
||||
String fileSql = "select ID,FILE_STS from O where FILE_TYPE='"+fileType+"' and FILE_STS='2'";
|
||||
String fileSql = "select ID,FILE_STS from O where FILE_TYPE='"+fileType+"' and CHANNEL_NO ='"+channelNo+"' and FILE_STS='2'";
|
||||
List<BizObject> ffpBoList = ffpBom.createQuery(fileSql).getResultList(true);
|
||||
if(ffpBoList.size()==0){
|
||||
ARE.getLog().info("暂时没有需要拷表的资方文件");
|
||||
@ -685,5 +686,12 @@ public class CorpusSourceFileCopy {
|
||||
public String getFileType() { return fileType; }
|
||||
|
||||
public void setFileType(String fileType) { this.fileType = fileType; }
|
||||
public String getChannelNo() {
|
||||
return channelNo;
|
||||
}
|
||||
|
||||
public void setChannelNo(String channelNo) {
|
||||
this.channelNo = channelNo;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -28,6 +28,7 @@ public class CorpusSourceRentPlanCopy extends CorpusSourceFileCopy implements Jo
|
||||
try {
|
||||
tx = JBOFactory.createJBOTransaction();
|
||||
setFileType("RepayPlan");
|
||||
setChannelNo("PSBC");
|
||||
doCopy(tx);
|
||||
tx.commit();
|
||||
QuartzUtil.insertLog(startime,"com.tenwa.lease.app.quartzmession.CorpusSourceRentPlanCopy", "success", "³É¹¦", curUserId);
|
||||
|
||||
@ -0,0 +1,146 @@
|
||||
package com.tenwa.lease.app.quartzmession;
|
||||
|
||||
import com.amarsoft.are.ARE;
|
||||
import com.amarsoft.are.jbo.*;
|
||||
import com.amarsoft.are.util.StringFunction;
|
||||
import com.amarsoft.awe.util.Transaction;
|
||||
import com.base.util.QuartzUtil;
|
||||
import jbo.app.tenwa.calc.LC_RENT_PLAN;
|
||||
import jbo.oti.FC_FILE_PUSH;
|
||||
import jbo.oti.FC_YC_FILE_REPAY_PLAN;
|
||||
import org.quartz.Job;
|
||||
import org.quartz.JobExecutionContext;
|
||||
import org.quartz.JobExecutionException;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 资方租金计划拷贝
|
||||
*/
|
||||
public class CorpusSourceRentPlanJJCCB extends CorpusSourceFileCopy implements Job {
|
||||
private String fileType;
|
||||
private String channelNo;
|
||||
public String getFileType() { return fileType; }
|
||||
|
||||
public void setFileType(String fileType) { this.fileType = fileType; }
|
||||
public String getChannelNo() {
|
||||
return channelNo;
|
||||
}
|
||||
|
||||
public void setChannelNo(String channelNo) {
|
||||
this.channelNo = channelNo;
|
||||
}
|
||||
@Override
|
||||
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
|
||||
String startime = StringFunction.getTodayNow();
|
||||
Object userId = jobExecutionContext.getTrigger().getJobDataMap().get("CurUserId");
|
||||
String curUserId = userId == null? "system" : userId.toString();
|
||||
|
||||
JBOTransaction tx = null;
|
||||
try {
|
||||
tx = JBOFactory.createJBOTransaction();
|
||||
setFileType("RepayPlan");
|
||||
setChannelNo("JJCCB");
|
||||
this.doCopy(tx);
|
||||
tx.commit();
|
||||
QuartzUtil.insertLog(startime,"com.tenwa.lease.app.quartzmession.CorpusSourceRentPlanCopy", "success", "成功", curUserId);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
QuartzUtil.insertLog(startime,"com.tenwa.lease.app.quartzmession.CorpusSourceRentPlanCopy", "error", "失败", curUserId);
|
||||
try {
|
||||
if (tx != null) {
|
||||
tx.rollback();
|
||||
}
|
||||
} catch (JBOException e1) {
|
||||
e1.printStackTrace();
|
||||
}
|
||||
throw new JobExecutionException(e);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 执行自己类所需的操作
|
||||
* @param fyfrpBoList
|
||||
* @param tx
|
||||
* @throws Exception
|
||||
*/
|
||||
public void respectiveDo(List<BizObject> fyfrpBoList , JBOTransaction tx) throws Exception {
|
||||
//获取对应的合同
|
||||
Map<String,String> contractMap = getContractIdMap(fyfrpBoList);
|
||||
if(contractMap.size()==0){
|
||||
String fcFileId = fyfrpBoList.get(0).getAttribute("FC_REQUEST_ID").toString();
|
||||
ARE.getLog().error("未找到FC_REQUEST_ID: "+fcFileId+" 对应的合同ID");
|
||||
throw new Exception("未找到FC_REQUEST_ID: "+fcFileId+" 对应的合同ID");
|
||||
}
|
||||
Transaction Sqlca = Transaction.createTransaction(tx);
|
||||
//===顺序不能错===
|
||||
//0.将租金计划拷贝到历史表
|
||||
copyRentPlanFormatToHis(contractMap,"安鹏原正式租金计划",tx);
|
||||
//1.更新租金计划表(直接文件每条信息更新,不需要遍历)
|
||||
updateRentPlan(fyfrpBoList,tx);
|
||||
for(Map.Entry<String,String> entry : contractMap.entrySet()){
|
||||
String contractId = entry.getKey();
|
||||
Map<String ,String > param = getParamByContractId(contractId,tx);
|
||||
//2.更新剩余本金
|
||||
updateAllRemainCorpus(contractId,Sqlca);
|
||||
//3.更新SP分润计划
|
||||
updateSplitSP(param,Sqlca);
|
||||
//4.插入分润计划
|
||||
insertProfitPlan(param,tx);
|
||||
//5.拷贝现金流到历史表
|
||||
copyCashFlowFormatToHis(contractId,"安鹏原正式现金流",tx);
|
||||
//6.生成新的现金流
|
||||
createCashFlowByContractId(contractId,Sqlca);
|
||||
//7.测算IRR
|
||||
calcIRR(param,tx);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据文件ID获取《租金计划》信息
|
||||
* @param fcFileId
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<BizObject> getFileInfoByFileId(String fcFileId) throws Exception {
|
||||
String sql = "select fr.CONTRACT_ID,O.FC_REQUEST_ID,O.LEND_TERM,O.ANS_REPAYMENT_DATE,O.ANS_PRINCIPAL,O.ANS_INTEREST,ANS_REPAYMENT_MONEY from O left join jbo.oti.FC_REQUEST fr on O.FC_REQUEST_ID=fr.ID where fr.DEL_FLAG='0' and O.FC_FILE_ID=:fcFileId";
|
||||
BizObjectManager fyfrpBom = JBOFactory.getBizObjectManager("FC_JJ_REPAY_PLAN.CLASS_NAME");
|
||||
List<BizObject> fyfrpBoList = fyfrpBom.createQuery(sql).setParameter("fcFileId",fcFileId).getResultList(false);
|
||||
if(fyfrpBoList.size()==0){
|
||||
ARE.getLog().error("未找到FC_REQUEST_ID: "+fcFileId+" 对应的资方还款计划");
|
||||
throw new Exception("未找到FC_REQUEST_ID: "+fcFileId+" 对应的资方还款计划");
|
||||
}
|
||||
return fyfrpBoList;
|
||||
}
|
||||
public void updateRentPlan(List<BizObject> fyfrpBoList,JBOTransaction tx) throws JBOException, ParseException {
|
||||
BizObjectManager lrpBom = null;
|
||||
lrpBom = JBOFactory.getBizObjectManager(LC_RENT_PLAN.CLASS_NAME,tx);
|
||||
//更新租金计划表
|
||||
for(BizObject bo : fyfrpBoList){
|
||||
//获取参数
|
||||
String contractId = bo.getAttribute("CONTRACT_ID").toString();
|
||||
String lendTerm = bo.getAttribute("CURR_TERM").toString();
|
||||
String principal = bo.getAttribute("LOAN_TERM_PRIN").toString();
|
||||
String interest = bo.getAttribute("LOAN_TERM_INTEREST").toString();
|
||||
String rent = bo.getAttribute("LOAN_TERM_FEE").toString();
|
||||
String repaymentDate = bo.getAttribute("PMT_DUE_DATE").toString();
|
||||
//转换日期格式
|
||||
Date date = new SimpleDateFormat("yyyyMMdd").parse(repaymentDate);
|
||||
repaymentDate = new SimpleDateFormat("yyyy/MM/dd").format(date);
|
||||
//更新租金计划表
|
||||
BizObject lrpBo = lrpBom.createQuery("CONTRACT_ID=:contractId and PLAN_LIST=:lendTerm").setParameter("contractId",contractId).setParameter("lendTerm",lendTerm).getSingleResult(true);
|
||||
lrpBo.setAttributeValue("RENT",rent);
|
||||
lrpBo.setAttributeValue("CORPUS",principal);
|
||||
lrpBo.setAttributeValue("INTEREST",interest);
|
||||
lrpBo.setAttributeValue("CORPUS_BUSINESS",principal);
|
||||
lrpBo.setAttributeValue("INTEREST_BUSINESS",interest);
|
||||
lrpBo.setAttributeValue("PLAN_DATE",repaymentDate);
|
||||
lrpBom.saveObject(lrpBo);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -31,6 +31,7 @@ public class CorpusSourceRentResultCopy extends CorpusSourceFileCopy implements
|
||||
try {
|
||||
tx = JBOFactory.createJBOTransaction();
|
||||
setFileType("RepayResult");
|
||||
setChannelNo("PSBC");
|
||||
doCopy(tx);
|
||||
tx.commit();
|
||||
QuartzUtil.insertLog(startime,"com.tenwa.lease.app.quartzmession.CorpusSourceRentPlanCopy", "success", "³É¹¦", curUserId);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user