20220909休眠流程增加延期逻辑
This commit is contained in:
parent
70528e70fa
commit
5652e825b8
@ -1,6 +1,7 @@
|
||||
<%@page import="com.amarsoft.awe.control.model.Parameter"%>
|
||||
<%@ page contentType="text/html; charset=GBK"%>
|
||||
<%@ page import="com.tenwa.reckon.product.ASObjectWindowCalc" %>
|
||||
<%@ page import="com.tenwa.jbo.manager.DataUtil" %>
|
||||
<%@ include file="/Frame/resources/include/include_begin_info.jspf"%>
|
||||
<style>
|
||||
#div_my0 > form {
|
||||
@ -53,6 +54,9 @@
|
||||
doTemp.setDefaultValue("flowunid", flowunid);
|
||||
doTemp.setDefaultValue("payment_number", paymentNumber);
|
||||
doTemp.setHtmlEvent("START_LIST","onchange","startListChange");
|
||||
doTemp.setHtmlEvent("DELAY_START_LIST", "onchange", "changeDelayStartList");
|
||||
doTemp.setHtmlEvent("DELAY_END_LIST", "onchange", "changeDelayEndList");
|
||||
doTemp.setHtmlEvent("CHANGE_TYPE", "onchange", "changeType");
|
||||
|
||||
doTemp.appendJboWhere(" and payment_number='"+paymentNumber+"'");
|
||||
|
||||
@ -67,6 +71,11 @@
|
||||
doTemp.setDefaultValue("DORMANT_YEAR_RATE",rents.get(rentLists-1).getAttribute("YEAR_RATE").getString());
|
||||
doTemp.setDefaultValue("IRR_OLD",irr);
|
||||
}
|
||||
List<Map<String, String>> dataList = DataUtil.query("select 1 from lc_calc_subsection_info where payment_number = ?", Sqlca, paymentNumber);
|
||||
String canChange = "yes";
|
||||
if (dataList.size() > 1) {
|
||||
canChange = "no";
|
||||
}
|
||||
ASObjectWindowCalc dwTemp = new ASObjectWindowCalc(CurPage, doTemp,request);
|
||||
/*Parameter p=new Parameter("NodeNo",nodeNo+"_1");
|
||||
Parameter p2=new Parameter("payment_number",paymentNumber);
|
||||
@ -96,6 +105,7 @@
|
||||
%><%@ include file="/Frame/resources/include/ui/include_info.jspf"%>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
changeType();
|
||||
var zcContractNum=getItemValue(0,0,"zc_contract_num");
|
||||
if(zcContractNum == undefined || zcContractNum == '' ){
|
||||
setItemValue(0,0,"zc_contract_num","<%=zcContractNum%>");
|
||||
@ -111,11 +121,15 @@ $(function(){
|
||||
if(Number(endList)<Number(startList)){
|
||||
alert("结束期次不可以小于开始期次!");
|
||||
setItemValue(0,0,"END_LIST","");
|
||||
setItemValue(0, 0, 'DELAY_START_LIST', '');
|
||||
setItemValue(0, 0, 'DELAY_END_LIST', '');
|
||||
return;
|
||||
}
|
||||
if(Number(endList)==<%=rentLists%>){
|
||||
alert("休眠结束期次不可以为最大期次");
|
||||
setItemValue(0,0,"END_LIST","");
|
||||
setItemValue(0, 0, 'DELAY_START_LIST', '');
|
||||
setItemValue(0, 0, 'DELAY_END_LIST', '');
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -123,17 +137,24 @@ $(function(){
|
||||
$("#END_LIST").change(function(){
|
||||
var endList = $("#END_LIST").val();
|
||||
var startList = $("#START_LIST").val();
|
||||
if(endList.indexOf("-")!=-1){
|
||||
alert("此处不能输入负数!");
|
||||
$("#END_LIST").val(endList.replace("-",""));
|
||||
}
|
||||
if(typeof(startList)!=undefined && startList !="" ){
|
||||
if(Number(endList)<Number(startList)){
|
||||
alert("结束期次不可以小于开始期次!");
|
||||
setItemValue(0,0,"END_LIST","");
|
||||
setItemValue(0, 0, 'DELAY_START_LIST', '');
|
||||
setItemValue(0, 0, 'DELAY_END_LIST', '');
|
||||
return;
|
||||
}
|
||||
}
|
||||
const changeType = getItemValue(0, 0, 'CHANGE_TYPE');
|
||||
if (changeType === 'dormancy_delay') {
|
||||
const delayStartList = getItemValue(0, 0, 'DELAY_START_LIST');
|
||||
if (delayStartList !== '' && Number(delayStartList) <= Number(endList)) {
|
||||
alert('延期开始期次必须大于休眠结束期次');
|
||||
setItemValue(0, 0, 'DELAY_START_LIST', '');
|
||||
setItemValue(0, 0, 'DELAY_END_LIST', '');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@ -144,6 +165,10 @@ function saveRecord(sPostEvents)
|
||||
AsDebug.alert("提示","只有尾款的的项十二条目并且大于还租次数才能展期变更!");
|
||||
return;
|
||||
} */
|
||||
if ('<%=canChange%>' === 'no') {
|
||||
alert('发现多条分段融数据,不允许进行变更');
|
||||
return;
|
||||
}
|
||||
var zcContractNum=getItemValue(0,0,"zc_contract_num");
|
||||
var contract_date=getItemValue(0,0,"contract_date");
|
||||
if(zcContractNum == undefined || zcContractNum == '' ){
|
||||
@ -154,6 +179,10 @@ function saveRecord(sPostEvents)
|
||||
alert("合同签署时间不能为空!");
|
||||
return;
|
||||
}
|
||||
const changeType = getItemValue(0, 0, 'CHANGE_TYPE');
|
||||
if (changeType === 'delay') {
|
||||
setItemValue(0, 0, 'START_LIST', '');
|
||||
}
|
||||
var result = AsControl.RunJavaMethodTrans("com.tenwa.channelportal.action.alpha.RentDormantAction","saveRentDormantAction","flowUnid=<%=flowunid%>,contractDate="+contract_date+",zcContractNum="+zcContractNum);
|
||||
// alert("休眠还款协议编号为:" + result);
|
||||
//检查是否进行过变更
|
||||
@ -193,6 +222,9 @@ function cancelChange(){
|
||||
function run()
|
||||
{
|
||||
var result = AsControl.RunJavaMethodTrans("com.tenwa.reckon.executor.CreateTransactionExecutor","runRentdormant","flowunid=<%=flowunid%>,plannumber=<%=paymentNumber%>,productId=<%=ProductId%>,calType=pay_process");
|
||||
if (result.result === 'false') {
|
||||
alert('测算失败: ' + result.msg);
|
||||
}
|
||||
window.location.href=window.location.href;
|
||||
}
|
||||
|
||||
@ -214,5 +246,120 @@ function startListChange(){
|
||||
}
|
||||
}
|
||||
|
||||
function changeType() {
|
||||
const changeType = getItemValue(0, 0, 'CHANGE_TYPE');
|
||||
if (changeType) {
|
||||
const startList = getItemValue(0, 0, 'START_LIST');
|
||||
const endList = getItemValue(0, 0, 'END_LIST');
|
||||
const dormantYearRate = getItemValue(0, 0, 'DORMANT_YEAR_RATE');
|
||||
const delayStartList = getItemValue(0, 0, 'DELAY_START_LIST');
|
||||
const delayEndList = getItemValue(0, 0, 'DELAY_END_LIST');
|
||||
switch (changeType) {
|
||||
case 'dormancy':
|
||||
hideItem(0, 'DELAY_START_LIST');
|
||||
setItemRequired(0, 'DELAY_START_LIST', false);
|
||||
if (delayStartList) {
|
||||
setItemValue(0, 0, 'DELAY_START_LIST', '');
|
||||
}
|
||||
hideItem(0, 'DELAY_END_LIST');
|
||||
setItemRequired(0, 'DELAY_END_LIST', false);
|
||||
if (delayEndList) {
|
||||
setItemValue(0, 0, 'DELAY_END_LIST', '');
|
||||
}
|
||||
showItem(0, 'START_LIST');
|
||||
setItemRequired(0, 'START_LIST', true);
|
||||
showItem(0, 'END_LIST');
|
||||
setItemRequired(0, 'END_LIST', true);
|
||||
showItem(0, 'DORMANT_YEAR_RATE');
|
||||
setItemRequired(0, 'DORMANT_YEAR_RATE', true);
|
||||
break;
|
||||
case "delay":
|
||||
hideItem(0, 'START_LIST');
|
||||
setItemRequired(0, 'START_LIST', false);
|
||||
if (startList) {
|
||||
setItemValue(0, 0, 'START_LIST', '');
|
||||
}
|
||||
hideItem(0, 'END_LIST');
|
||||
setItemRequired(0, 'END_LIST', false);
|
||||
if (endList) {
|
||||
setItemValue(0, 0, 'END_LIST', '');
|
||||
}
|
||||
hideItem(0, 'DORMANT_YEAR_RATE');
|
||||
setItemRequired(0, 'DORMANT_YEAR_RATE', false);
|
||||
if (dormantYearRate) {
|
||||
setItemValue(0, 0, 'DORMANT_YEAR_RATE', '');
|
||||
}
|
||||
showItem(0, 'DELAY_START_LIST');
|
||||
setItemRequired(0, 'DELAY_START_LIST', true);
|
||||
showItem(0, 'DELAY_END_LIST');
|
||||
setItemRequired(0, 'DELAY_END_LIST', true);
|
||||
break;
|
||||
case 'dormancy_delay':
|
||||
showItem(0, 'START_LIST');
|
||||
setItemRequired(0, 'START_LIST', true);
|
||||
showItem(0, 'END_LIST');
|
||||
setItemRequired(0, 'END_LIST', true);
|
||||
showItem(0, 'DORMANT_YEAR_RATE');
|
||||
setItemRequired(0, 'DORMANT_YEAR_RATE', true);
|
||||
showItem(0, 'DELAY_START_LIST');
|
||||
setItemRequired(0, 'DELAY_START_LIST', true);
|
||||
showItem(0, 'DELAY_END_LIST');
|
||||
setItemRequired(0, 'DELAY_END_LIST', true);
|
||||
setItemRequired(0, 'END_LIST', false);
|
||||
if (!endList) {
|
||||
setItemValue(0, 0, 'DELAY_START_LIST', '');
|
||||
setItemValue(0, 0, 'DELAY_END_LIST', '');
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function changeDelayStartList() {
|
||||
const changeType = getItemValue(0, 0, 'CHANGE_TYPE');
|
||||
const endList = getItemValue(0, 0, 'END_LIST');
|
||||
const delayStartList = getItemValue(0, 0, 'DELAY_START_LIST');
|
||||
if (changeType === 'dormancy_delay') {
|
||||
if (!endList) {
|
||||
alert('请先填写休眠结束期次');
|
||||
setItemValue(0, 0, 'DELAY_START_LIST', '');
|
||||
return;
|
||||
}
|
||||
if (Number(delayStartList) <= Number(endList)) {
|
||||
alert('延期开始期次必须大于休眠结束期次');
|
||||
setItemValue(0, 0, 'DELAY_START_LIST', '');
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (delayStartList !== '') {
|
||||
if (Number(delayStartList) <= 0) {
|
||||
alert('延期开始期次必须大于0');
|
||||
setItemValue(0, 0, 'DELAY_START_LIST', '');
|
||||
} else {
|
||||
const result = AsControl.RunJavaMethod("com.tenwa.reckon.executor.RentCalHelper", "findPlanDateByRentList", "paymentnumber=<%=paymentNumber%>,startList=" + delayStartList);
|
||||
if(result.result !== 'true') {
|
||||
alert(result.message);
|
||||
setItemValue(0 ,0, 'DELAY_START_LIST', '');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function changeDelayEndList() {
|
||||
const delayStartList = getItemValue(0, 0, 'DELAY_START_LIST');
|
||||
if (delayStartList === '') {
|
||||
alert('请先填写延期开始期次');
|
||||
setItemValue(0, 0, 'DELAY_END_LIST', '');
|
||||
return;
|
||||
}
|
||||
const delayEndList = getItemValue(0, 0, 'DELAY_END_LIST');
|
||||
if (delayEndList !== '') {
|
||||
if (Number(delayEndList) < Number(delayStartList)) {
|
||||
alert('延期后总期数必须大于或等于延期开始期次');
|
||||
setItemValue(0, 0, 'DELAY_END_LIST', '');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
<%@ include file="/Frame/resources/include/include_end.jspf"%>
|
||||
|
||||
@ -4688,6 +4688,10 @@
|
||||
<attribute name="UPDATEORGID" label="更新部门" type="STRING" length="32"/>
|
||||
<attribute name="UPDATETIME" label="更新时间" type="STRING" length="32"/>
|
||||
<attribute name="IRR_OLD" label="休眠变更前IRR" type="DOUBLE" length="22" scale="6"/>
|
||||
|
||||
<attribute name="CHANGE_TYPE" label="变更类型" type="STRING" length="32"/>
|
||||
<attribute name="DELAY_START_LIST" label="延期开始期次" type="STRING" length="20"/>
|
||||
<attribute name="DELAY_END_LIST" label="延期后总期数" type="STRING" length="20" />
|
||||
</attributes>
|
||||
<manager>
|
||||
<managerProperties>
|
||||
@ -4712,6 +4716,10 @@
|
||||
<attribute name="UPDATEORGID" label="更新部门" type="STRING" length="32"/>
|
||||
<attribute name="UPDATETIME" label="更新时间" type="STRING" length="32"/>
|
||||
<attribute name="IRR_OLD" label="休眠变更前IRR" type="DOUBLE" length="22" scale="6"/>
|
||||
|
||||
<attribute name="CHANGE_TYPE" label="变更类型" type="STRING" length="32"/>
|
||||
<attribute name="DELAY_START_LIST" label="延期开始期次" type="STRING" length="20"/>
|
||||
<attribute name="DELAY_END_LIST" label="延期后总期数" type="STRING" length="20" />
|
||||
</attributes>
|
||||
<manager>
|
||||
<managerProperties>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -78,6 +78,11 @@ public class RentCalHelper {
|
||||
BizObject rentplan=JBOFactory.createBizObjectQuery(LC_RENT_PLAN.CLASS_NAME,"PAYMENT_NUMBER=:paymentnumber and plan_list=:planlist")
|
||||
.setParameter("paymentnumber", paymentnumber).setParameter("planlist", startList).getSingleResult(false);
|
||||
|
||||
if (rentplan == null) {
|
||||
jsonObject.appendElement("result", "false");
|
||||
jsonObject.appendElement("message","填写的期次以超出租金计划期次,请重新填写");
|
||||
return JSONEncoder.encode(jsonObject);
|
||||
}
|
||||
@SuppressWarnings("unchecked")
|
||||
List<BizObject> rentincome=JBOFactory.createBizObjectQuery(LC_RENT_INCOME.CLASS_NAME,"plan_id=:planid and ROLL_BACK='0'").setParameter("planid", rentplan.getAttribute("ID").getString()).getResultList(false);
|
||||
|
||||
@ -89,7 +94,7 @@ public class RentCalHelper {
|
||||
jsonObject.appendElement("result", "true");
|
||||
jsonObject.appendElement("message",rentplan.getAttribute("plan_date").getString());
|
||||
}
|
||||
} catch (JBOException e) {
|
||||
} catch (Exception e) {
|
||||
jsonObject.appendElement("result", "false");
|
||||
jsonObject.appendElement("message","服务器繁忙,请稍后再试!");
|
||||
e.printStackTrace();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user