1.发起提前结清的不再进行代偿
This commit is contained in:
parent
bab0a37e08
commit
ffda1bdef0
@ -2407,6 +2407,7 @@
|
||||
<attribute name="FAILURE_REASON" label="失败原因" type="STRING"/>
|
||||
<attribute name="SUBJECTID" label="主体id" type="STRING"/>
|
||||
<attribute name="SUBJECTNAME" label="主体名称" type="STRING"/>
|
||||
<attribute name="payment_number" label="投放编号" type="STRING"/>
|
||||
</attributes>
|
||||
<manager>
|
||||
<managerProperties>
|
||||
|
||||
@ -137,4 +137,8 @@ public interface VI_LC_AUDIT_RENT_PLAN{
|
||||
* Ö÷ÌåÃû³Æ STRING(20)<br>
|
||||
*/
|
||||
public static final String SUBJECTNAME = "SUBJECTNAME";
|
||||
/**
|
||||
* Ͷ·Å±àºÅ STRING(20)<br>
|
||||
*/
|
||||
public static final String payment_number = "payment_number";
|
||||
}
|
||||
@ -1,98 +1,78 @@
|
||||
create view vi_lc_audit_rent_plan as SELECT LCRP.ID AS ID,
|
||||
LCI.DISTRIBUTOR_ID AS DISTRIBUTOR_ID,
|
||||
LCRP.CONTRACT_ID AS CONTRACT_ID,
|
||||
LCI.CONTRACT_NUMBER AS CONTRACT_NUMBER,
|
||||
LUL.CUSTOMER_ID AS CUSTOMER_ID,
|
||||
LUL.CUSTOMER_NAME AS CUSTOMER_NAME,
|
||||
LCRP.PLAN_LIST AS PLAN_LIST,
|
||||
LCRP.PLAN_DATE AS PLAN_DATE,
|
||||
(LCRP.RENT + `nvl`(VIRP.PENALTY_OVER, 0)) AS FACT_RENT,
|
||||
LCRP.CORPUS AS FACT_CORPUS,
|
||||
LCRP.INTEREST AS FACT_INTEREST,
|
||||
(VIRP.RENT_OVER + `nvl`(VIRP.PENALTY_OVER, 0)) AS RENT,
|
||||
LCRP.RENT AS PLAN_RENT,
|
||||
VIRP.CORPUS_OVER AS CORPUS,
|
||||
VIRP.INTEREST_OVER AS INTEREST,
|
||||
`nvl`(VIRP.PENALTY_OVER, 0) AS PENALTY,
|
||||
CAT.BANK_NAME AS BANK_NAME,
|
||||
CAT.ACCOUNT AS ACCOUNT,
|
||||
CAT.ACC_NUMBER AS ACC_NUMBER,
|
||||
CAT.MOBILE AS MOBILE,
|
||||
ifnull(CAT.SIGN_STATUS, 'N') AS SIGN_STATUS,
|
||||
ifnull(LCRP.AUDIT_STATE, 'N') AS AUDIT_STATE,
|
||||
ifnull(LCRP.COLLECT_STATUS, '未收款') AS COLLECT_STATUS,
|
||||
ifnull(LCRP.COLLECT_MSG, '') AS COLLECT_MSG,
|
||||
LCRP.FAILURE_TIME AS FAILURE_TIME,
|
||||
LCRP.FAILURE_REASON AS FAILURE_REASON,
|
||||
LCRP.BATCH_STATUS AS BATCH_STATUS,
|
||||
LCRP.BATCH_NO AS BATCH_NO,
|
||||
LCRP.BATCH_SN AS BATCH_SN,
|
||||
lci.SUBJECTID AS SUBJECTID,
|
||||
lci.SUBJECTNAME AS SUBJECTNAME
|
||||
FROM (((((APZL.LC_RENT_PLAN LCRP LEFT JOIN (
|
||||
SELECT APZL.LC_RENT_INCOME.PAYMENT_NUMBER AS PAYMENT_NUMBER,
|
||||
APZL.LC_RENT_INCOME.PLAN_LIST AS PLAN_LIST,
|
||||
APZL.LC_RENT_INCOME.PLAN_ID AS PLAN_ID,
|
||||
sum(APZL.LC_RENT_INCOME.RENT) AS RENT,
|
||||
sum(APZL.LC_RENT_INCOME.CORPUS) AS CORPUS,
|
||||
sum(APZL.LC_RENT_INCOME.INTEREST) AS INTEREST,
|
||||
sum(APZL.LC_RENT_INCOME.PENALTY) AS PENALTY,
|
||||
sum(APZL.LC_RENT_INCOME.CORPUS_ADJUST) AS CORPUS_ADJUST,
|
||||
sum(APZL.LC_RENT_INCOME.INTEREST_ADJUST) AS INTEREST_ADJUST,
|
||||
sum(APZL.LC_RENT_INCOME.PENALTY_ADJUST) AS PENALTY_ADJUST
|
||||
FROM APZL.LC_RENT_INCOME
|
||||
WHERE (APZL.LC_RENT_INCOME.ROLL_BACK = '0')
|
||||
GROUP BY APZL.LC_RENT_INCOME.PAYMENT_NUMBER, APZL.LC_RENT_INCOME.PLAN_LIST, APZL.LC_RENT_INCOME.PLAN_ID
|
||||
) LCFI ON (((LCRP.PAYMENT_NUMBER = LCFI.PAYMENT_NUMBER) AND (LCRP.PLAN_LIST = LCFI.PLAN_LIST) AND
|
||||
(LCRP.ID = LCFI.PLAN_ID)))) LEFT JOIN APZL.VI_LC_RENT_PLAN VIRP ON ((VIRP.ID = LCRP.ID))) LEFT JOIN APZL.LB_CONTRACT_INFO LCI ON ((LCI.ID = LCRP.CONTRACT_ID))) LEFT JOIN APZL.LB_UNION_LESSEE LUL ON ((LUL.CONTRACT_ID = LCI.ID)))
|
||||
LEFT JOIN (
|
||||
SELECT DISTINCT APZL.CUSTOMER_ACCOUNT.BANK_NAME AS BANK_NAME,
|
||||
APZL.CUSTOMER_ACCOUNT.ACCOUNT AS ACCOUNT,
|
||||
APZL.CUSTOMER_ACCOUNT.ACC_NUMBER AS ACC_NUMBER,
|
||||
APZL.CUSTOMER_ACCOUNT.CUSTOMERID AS CUSTOMERID,
|
||||
APZL.CUSTOMER_ACCOUNT.ACC_TYPE AS ACC_TYPE,
|
||||
APZL.CUSTOMER_ACCOUNT.MOBILE AS MOBILE,
|
||||
APZL.CUSTOMER_ACCOUNT.SIGN_STATUS AS SIGN_STATUS,
|
||||
APZL.CUSTOMER_ACCOUNT.CONTRACT_ID AS CONTRACT_ID
|
||||
FROM APZL.CUSTOMER_ACCOUNT
|
||||
) CAT ON (((CAT.ACC_TYPE = 'Debit') AND (CAT.CONTRACT_ID = LCRP.CONTRACT_ID))))
|
||||
WHERE ((LCI.CONTRACT_STATUS = '31') AND (LCI.BUSINESSTYPE = '1') AND (VIRP.RENT_OVER > 0));
|
||||
|
||||
-- comment on column vi_lc_audit_rent_plan.id not supported: 标识
|
||||
|
||||
-- comment on column vi_lc_audit_rent_plan.DISTRIBUTOR_ID not supported: 经销商IDid
|
||||
|
||||
-- comment on column vi_lc_audit_rent_plan.contract_id not supported: 合同编号
|
||||
|
||||
-- comment on column vi_lc_audit_rent_plan.contract_number not supported: 业务合同号
|
||||
|
||||
-- comment on column vi_lc_audit_rent_plan.customer_id not supported: 承租人编号
|
||||
|
||||
-- comment on column vi_lc_audit_rent_plan.CUSTOMER_NAME not supported: 承租人名称
|
||||
|
||||
-- comment on column vi_lc_audit_rent_plan.plan_list not supported: 期次
|
||||
|
||||
-- comment on column vi_lc_audit_rent_plan.plan_date not supported: 计划日期
|
||||
|
||||
-- comment on column vi_lc_audit_rent_plan.fact_corpus not supported: 财务本金
|
||||
|
||||
-- comment on column vi_lc_audit_rent_plan.fact_interest not supported: 财务租息
|
||||
|
||||
-- comment on column vi_lc_audit_rent_plan.plan_rent not supported: 租金
|
||||
|
||||
-- comment on column vi_lc_audit_rent_plan.bank_name not supported: 开户银行
|
||||
|
||||
-- comment on column vi_lc_audit_rent_plan.account not supported: 帐户名称
|
||||
|
||||
-- comment on column vi_lc_audit_rent_plan.acc_number not supported: 银行账号
|
||||
|
||||
-- comment on column vi_lc_audit_rent_plan.mobile not supported: 手机号
|
||||
|
||||
-- comment on column vi_lc_audit_rent_plan.FAILURE_TIME not supported: 失败时间
|
||||
|
||||
-- comment on column vi_lc_audit_rent_plan.FAILURE_REASON not supported: 失败原因
|
||||
|
||||
-- comment on column vi_lc_audit_rent_plan.BATCH_STATUS not supported: 批量处理状态
|
||||
|
||||
-- comment on column vi_lc_audit_rent_plan.BATCH_NO not supported: 批量交易流水号,若拆分,以,分割
|
||||
|
||||
DELIMITER $$
|
||||
|
||||
ALTER ALGORITHM=UNDEFINED DEFINER=`apzl`@`%` SQL SECURITY DEFINER VIEW `vi_lc_audit_rent_plan` AS
|
||||
SELECT
|
||||
`lcrp`.`ID` AS `ID`,
|
||||
`lci`.`distributor_id` AS `DISTRIBUTOR_ID`,
|
||||
`lcrp`.`CONTRACT_ID` AS `CONTRACT_ID`,
|
||||
`lci`.`CONTRACT_NUMBER` AS `CONTRACT_NUMBER`,
|
||||
`lul`.`CUSTOMER_ID` AS `CUSTOMER_ID`,
|
||||
`lul`.`CUSTOMER_NAME` AS `CUSTOMER_NAME`,
|
||||
`lcrp`.`PLAN_LIST` AS `PLAN_LIST`,
|
||||
`lcrp`.`PLAN_DATE` AS `PLAN_DATE`,
|
||||
(`lcrp`.`RENT` + `nvl`(`virp`.`penalty_over`,0)) AS `FACT_RENT`,
|
||||
`lcrp`.`CORPUS` AS `FACT_CORPUS`,
|
||||
`lcrp`.`INTEREST` AS `FACT_INTEREST`,
|
||||
(`virp`.`rent_over` + `nvl`(`virp`.`penalty_over`,0)) AS `RENT`,
|
||||
`lcrp`.`RENT` AS `PLAN_RENT`,
|
||||
`virp`.`corpus_over` AS `CORPUS`,
|
||||
`virp`.`interest_over` AS `INTEREST`,
|
||||
`nvl`(
|
||||
`virp`.`penalty_over`,0) AS `PENALTY`,
|
||||
`cat`.`BANK_NAME` AS `BANK_NAME`,
|
||||
`cat`.`ACCOUNT` AS `ACCOUNT`,
|
||||
`cat`.`ACC_NUMBER` AS `ACC_NUMBER`,
|
||||
`cat`.`MOBILE` AS `MOBILE`,
|
||||
IFNULL(`cat`.`SIGN_STATUS`,'N') AS `SIGN_STATUS`,
|
||||
IFNULL(`lcrp`.`AUDIT_STATE`,'N') AS `AUDIT_STATE`,
|
||||
IFNULL(`lcrp`.`COLLECT_STATUS`,'δÊÕ¿î') AS `COLLECT_STATUS`,
|
||||
IFNULL(`lcrp`.`COLLECT_MSG`,'') AS `COLLECT_MSG`,
|
||||
`lcrp`.`FAILURE_TIME` AS `FAILURE_TIME`,
|
||||
`lcrp`.`FAILURE_REASON` AS `FAILURE_REASON`,
|
||||
`lcrp`.`BATCH_STATUS` AS `BATCH_STATUS`,
|
||||
`lcrp`.`BATCH_NO` AS `BATCH_NO`,
|
||||
`lcrp`.`batch_sn` AS `BATCH_SN`,
|
||||
`lci`.`SUBJECTID` AS `SUBJECTID`,
|
||||
`lci`.`SUBJECTNAME` AS `SUBJECTNAME`,
|
||||
`lcrp`.`PAYMENT_NUMBER` AS `payment_number`
|
||||
FROM (((((`apzl`.`lc_rent_plan` `lcrp`
|
||||
LEFT JOIN (SELECT
|
||||
`apzl`.`lc_rent_income`.`PAYMENT_NUMBER` AS `PAYMENT_NUMBER`,
|
||||
`apzl`.`lc_rent_income`.`PLAN_LIST` AS `PLAN_LIST`,
|
||||
`apzl`.`lc_rent_income`.`PLAN_ID` AS `PLAN_ID`,
|
||||
SUM(`apzl`.`lc_rent_income`.`RENT`) AS `RENT`,
|
||||
SUM(`apzl`.`lc_rent_income`.`CORPUS`) AS `CORPUS`,
|
||||
SUM(`apzl`.`lc_rent_income`.`INTEREST`) AS `INTEREST`,
|
||||
SUM(`apzl`.`lc_rent_income`.`PENALTY`) AS `PENALTY`,
|
||||
SUM(`apzl`.`lc_rent_income`.`CORPUS_ADJUST`) AS `CORPUS_ADJUST`,
|
||||
SUM(`apzl`.`lc_rent_income`.`INTEREST_ADJUST`) AS `INTEREST_ADJUST`,
|
||||
SUM(`apzl`.`lc_rent_income`.`PENALTY_ADJUST`) AS `PENALTY_ADJUST`
|
||||
FROM `apzl`.`lc_rent_income`
|
||||
WHERE (`apzl`.`lc_rent_income`.`ROLL_BACK` = '0')
|
||||
GROUP BY `apzl`.`lc_rent_income`.`PAYMENT_NUMBER`,`apzl`.`lc_rent_income`.`PLAN_LIST`,`apzl`.`lc_rent_income`.`PLAN_ID`) `lcfi`
|
||||
ON (((`lcrp`.`PAYMENT_NUMBER` = `lcfi`.`PAYMENT_NUMBER`)
|
||||
AND (`lcrp`.`PLAN_LIST` = `lcfi`.`PLAN_LIST`)
|
||||
AND (`lcrp`.`ID` = `lcfi`.`PLAN_ID`))))
|
||||
LEFT JOIN `apzl`.`vi_lc_rent_plan` `virp`
|
||||
ON ((`virp`.`id` = `lcrp`.`ID`)))
|
||||
LEFT JOIN `apzl`.`lb_contract_info` `lci`
|
||||
ON ((`lci`.`ID` = `lcrp`.`CONTRACT_ID`)))
|
||||
LEFT JOIN `apzl`.`lb_union_lessee` `lul`
|
||||
ON ((`lul`.`CONTRACT_ID` = `lci`.`ID`)))
|
||||
LEFT JOIN (SELECT DISTINCT
|
||||
`apzl`.`customer_account`.`bank_name` AS `BANK_NAME`,
|
||||
`apzl`.`customer_account`.`account` AS `ACCOUNT`,
|
||||
`apzl`.`customer_account`.`acc_number` AS `ACC_NUMBER`,
|
||||
`apzl`.`customer_account`.`customerid` AS `CUSTOMERID`,
|
||||
`apzl`.`customer_account`.`acc_type` AS `ACC_TYPE`,
|
||||
`apzl`.`customer_account`.`MOBILE` AS `MOBILE`,
|
||||
`apzl`.`customer_account`.`sign_status` AS `SIGN_STATUS`,
|
||||
`apzl`.`customer_account`.`CONTRACT_ID` AS `CONTRACT_ID`
|
||||
FROM `apzl`.`customer_account`) `cat`
|
||||
ON (((`cat`.`ACC_TYPE` = 'Debit')
|
||||
AND (`cat`.`CONTRACT_ID` = `lcrp`.`CONTRACT_ID`))))
|
||||
WHERE ((`lci`.`CONTRACT_STATUS` = '31')
|
||||
AND (`lci`.`BUSINESSTYPE` = '1')
|
||||
AND (`virp`.`rent_over` > 0))$$
|
||||
|
||||
DELIMITER ;
|
||||
3
src_sql/投产SQL/V20200206/zhbb_20200206.sql
Normal file
3
src_sql/投产SQL/V20200206/zhbb_20200206.sql
Normal file
@ -0,0 +1,3 @@
|
||||
delete from AWE_DO_CATALOG where dono='ViLcReviewAuditRentPlanListRepay';
|
||||
Insert Into AWE_DO_CATALOG (dono,doname,dodescribe,dotype,doclass,isinuse,colcount,modeid,jboclass,jbofrom,jbowhere,jbogroup,jboorder,businessprocess,exportflag,inputuser,inputtime,updateuser,updatetime,remark,isvalidate,parent) Values ('ViLcReviewAuditRentPlanListRepay','代收复审列表',null,'30030',null,'1','1','default','jbo.com.tenwa.lease.comm.VI_LC_AUDIT_RENT_PLAN','O left join jbo.app.tenwa.calc.LC_FUND_RENT_ADJUST_TEMP lfrat on lfrat.payment_number=O.payment_number',' v.date_format(O.PLAN_DATE,''%Y/%m/%d'') <= v.date_format(v.sysdate(),''%Y/%m/%d'') and O.COLLECT_STATUS in (''未收款'',''部分收款'') and lfrat.id is null','','plan_date','',null,'SYS_Designer','2019/06/05 10:43:14','SYS_Designer','2020/01/19 11:36:20','','1','');
|
||||
|
||||
@ -60,7 +60,7 @@ public class DistributorMarginCompensation implements Job {
|
||||
String repay_date = sdf.format(dt_add);
|
||||
System.out.println("代偿计划日期日期为:"+repay_date+"之前的租金计划");
|
||||
|
||||
List<BizObject> bos = JBOFactory.getBizObjectManager(VI_LC_AUDIT_RENT_PLAN.CLASS_NAME, tx).createQuery("O.COLLECT_STATUS IN ('未收款', '部分收款') and O.PLAN_DATE <= '"+repay_date+"' and ( O.BATCH_STATUS<>'process' or o.BATCH_STATUS IS NULL ) and O.DISTRIBUTOR_ID='"+distributor_no+"'").getResultList(false);
|
||||
List<BizObject> bos = JBOFactory.getBizObjectManager(VI_LC_AUDIT_RENT_PLAN.CLASS_NAME, tx).createQuery(" select id,penalty,rent from O left join jbo.app.tenwa.calc.LC_FUND_RENT_ADJUST_TEMP lfrat on lfrat.payment_number=O.payment_number where O.COLLECT_STATUS IN ('未收款', '部分收款') and O.PLAN_DATE <= '"+repay_date+"' and ( O.BATCH_STATUS<>'process' or o.BATCH_STATUS IS NULL ) and lfrat.id is null and O.DISTRIBUTOR_ID='"+distributor_no+"'").getResultList(false);
|
||||
if(bos.size()==0){
|
||||
System.out.println("经销商:"+distributor_no+"没有可以核销的租金");
|
||||
continue;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user