Commit 3147f583 authored by stone's avatar stone

【feat】财务收支一览表功能

parent 86c9e2cb
package com.hand.hls.hlcm.util; package com.hand.hls.hlcm.util;
import com.hand.hls.hlcm.contact.service.IBusinessContactService;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
...@@ -13,8 +10,7 @@ import java.util.regex.Pattern; ...@@ -13,8 +10,7 @@ import java.util.regex.Pattern;
* @description * @description
*/ */
public class DelHtmlScript { public class DelHtmlScript {
@Autowired
private IBusinessContactService service;
/** /**
* 定义script的正则表达式 * 定义script的正则表达式
*/ */
......
...@@ -93,10 +93,10 @@ public class MailSend { ...@@ -93,10 +93,10 @@ public class MailSend {
// 创建多重消息 // 创建多重消息
// 设置文本消息部分 // 设置文本消息部分
//判断是html格式还是文本格式 //判断是html格式还是文本格式
if (CONTENT_TYPE_HTML.equals(jsonObject.optString("content_type"))) { // if (CONTENT_TYPE_HTML.equals(jsonObject.optString("content_type"))) {
//删除html标签 // //删除html标签
body=DelHtmlScript.delHtmlTag(body); // body=DelHtmlScript.delHtmlTag(body);
} // }
messageBodyPart.setText(body); messageBodyPart.setText(body);
multipart.addBodyPart(messageBodyPart); multipart.addBodyPart(messageBodyPart);
...@@ -140,7 +140,7 @@ public class MailSend { ...@@ -140,7 +140,7 @@ public class MailSend {
jb.put("content_type", "text/html"); jb.put("content_type", "text/html");
jb.put("attch_flag", "Y"); jb.put("attch_flag", "Y");
jb.put("attch_file_name", "财务收支一览表.xlsx"); jb.put("attch_file_name", "财务收支一览表.xlsx");
jb.put("attch_file_path", "d:/222.txt"); jb.put("attch_file_path", "D:/u01/hls_file/task_excel/excel1589481201751.xlsx");
try{ try{
mailSend.sendMain(jb.toString()); mailSend.sendMain(jb.toString());
}catch(Exception e){ }catch(Exception e){
......
...@@ -65,6 +65,7 @@ ...@@ -65,6 +65,7 @@
NVL((SELECT SUM(nvl(c.lease_item_amount, 0)) NVL((SELECT SUM(nvl(c.lease_item_amount, 0))
FROM con_contract c FROM con_contract c
WHERE c.contract_status <> 'CANCEL' WHERE c.contract_status <> 'CANCEL'
AND c.data_class='NORMAL'
AND to_char(add_months(c.lease_start_date, 1), AND to_char(add_months(c.lease_start_date, 1),
'yyyymm') = to_char(SYSDATE, 'yyyymm') 'yyyymm') = to_char(SYSDATE, 'yyyymm')
AND nvl(c.payment_deduction, 'NO_DEDUCTION') = AND nvl(c.payment_deduction, 'NO_DEDUCTION') =
...@@ -73,6 +74,7 @@ ...@@ -73,6 +74,7 @@
nvl(c.down_payment, 0)) nvl(c.down_payment, 0))
FROM con_contract c FROM con_contract c
WHERE c.contract_status <> 'CANCEL' WHERE c.contract_status <> 'CANCEL'
AND c.data_class='NORMAL'
AND to_char(add_months(c.lease_start_date, 1), AND to_char(add_months(c.lease_start_date, 1),
'yyyymm') = to_char(SYSDATE, 'yyyymm') 'yyyymm') = to_char(SYSDATE, 'yyyymm')
AND nvl(c.payment_deduction, 'NO_DEDUCTION') <> AND nvl(c.payment_deduction, 'NO_DEDUCTION') <>
...@@ -83,6 +85,7 @@ ...@@ -83,6 +85,7 @@
NVL((SELECT SUM(nvl(c.lease_item_amount, 0)) NVL((SELECT SUM(nvl(c.lease_item_amount, 0))
FROM con_contract c FROM con_contract c
WHERE c.contract_status <> 'CANCEL' WHERE c.contract_status <> 'CANCEL'
AND c.data_class='NORMAL'
AND to_char(c.lease_start_date, 'yyyymm') = AND to_char(c.lease_start_date, 'yyyymm') =
to_char(SYSDATE, 'yyyymm') to_char(SYSDATE, 'yyyymm')
AND nvl(c.payment_deduction, 'NO_DEDUCTION') = AND nvl(c.payment_deduction, 'NO_DEDUCTION') =
...@@ -91,6 +94,7 @@ ...@@ -91,6 +94,7 @@
nvl(c.down_payment, 0)) nvl(c.down_payment, 0))
FROM con_contract c FROM con_contract c
WHERE c.contract_status <> 'CANCEL' WHERE c.contract_status <> 'CANCEL'
AND c.data_class='NORMAL'
AND to_char(c.lease_start_date, 'yyyymm') = AND to_char(c.lease_start_date, 'yyyymm') =
to_char(SYSDATE, 'yyyymm') to_char(SYSDATE, 'yyyymm')
AND nvl(c.payment_deduction, 'NO_DEDUCTION') <> AND nvl(c.payment_deduction, 'NO_DEDUCTION') <>
......
...@@ -4,13 +4,13 @@ ...@@ -4,13 +4,13 @@
<bm:operation name="query"> <bm:operation name="query">
<bm:query-sql><![CDATA[ <bm:query-sql><![CDATA[
SELECT v.monthly, SELECT v.monthly,
SUM(NVL(purchase_amount,0)) total_purchase_amount, SUM(NVL(purchase_amount, 0)) total_purchase_amount,
SUM(NVL(down_payment,0)) total_down_payment, SUM(NVL(down_payment, 0)) total_down_payment,
SUM(NVL(lease_amount,0)) total_lease_amount, SUM(NVL(lease_amount, 0)) total_lease_amount,
(SUM(NVL(purchase_amount,0))+ SUM(NVL(down_payment,0))+SUM(NVL(lease_amount,0))) total_amount, (SUM(NVL(purchase_amount, 0)) + SUM(NVL(down_payment, 0)) +
SUM(NVL(outflow_amount,0)) total_outflow_amount SUM(NVL(lease_amount, 0))) total_amount,
FROM (SELECT SUM(NVL(outflow_amount, 0)) total_outflow_amount
to_char(t.calendar_date,'yyyy/mm') monthly, FROM (SELECT to_char(t.calendar_date, 'yyyy/mm') monthly,
t.calendar_date, t.calendar_date,
decode(to_char(t.calendar_date, 'd'), decode(to_char(t.calendar_date, 'd'),
1, 1,
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
(SELECT 1 (SELECT 1
FROM con_contract ct FROM con_contract ct
WHERE ct.contract_status IN WHERE ct.contract_status IN
('INCEPT', 'PENDING','ETING', 'REPURING') ('INCEPT', 'PENDING', 'ETING', 'REPURING')
AND ct.contract_id = contract_id)) purchase_amount, --留购金 AND ct.contract_id = contract_id)) purchase_amount, --留购金
(SELECT SUM(due_amount - nvl(received_amount, 0)) (SELECT SUM(due_amount - nvl(received_amount, 0))
FROM con_contract_cashflow FROM con_contract_cashflow
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
(SELECT 1 (SELECT 1
FROM con_contract ct FROM con_contract ct
WHERE ct.contract_status IN WHERE ct.contract_status IN
('INCEPT', 'PENDING','ETING', 'REPURING') ('INCEPT', 'PENDING', 'ETING', 'REPURING')
AND ct.contract_id = contract_id)) down_payment, --首付款 AND ct.contract_id = contract_id)) down_payment, --首付款
(SELECT SUM(due_amount) (SELECT SUM(due_amount)
FROM con_contract_cashflow ccc FROM con_contract_cashflow ccc
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
(SELECT 1 (SELECT 1
FROM con_contract ct FROM con_contract ct
WHERE ct.contract_status IN WHERE ct.contract_status IN
('INCEPT', 'PENDING','ETING', 'REPURING') ('INCEPT', 'PENDING', 'ETING', 'REPURING')
AND ct.contract_id = contract_id)) lease_amount, --租金 AND ct.contract_id = contract_id)) lease_amount, --租金
(CASE (CASE
WHEN to_char(SYSDATE, 'dd') <= 20 AND WHEN to_char(SYSDATE, 'dd') <= 20 AND
...@@ -65,42 +65,57 @@ ...@@ -65,42 +65,57 @@
NVL((SELECT SUM(nvl(c.lease_item_amount, 0)) NVL((SELECT SUM(nvl(c.lease_item_amount, 0))
FROM con_contract c FROM con_contract c
WHERE c.contract_status <> 'CANCEL' WHERE c.contract_status <> 'CANCEL'
AND c.data_class = 'NORMAL'
AND to_char(add_months(c.lease_start_date, 1), AND to_char(add_months(c.lease_start_date, 1),
'yyyymm') = to_char(SYSDATE, 'yyyymm') 'yyyymm') =
to_char(SYSDATE,
'yyyymm')
AND nvl(c.payment_deduction, 'NO_DEDUCTION') = AND nvl(c.payment_deduction, 'NO_DEDUCTION') =
'NO_DEDUCTION'),0) + 'NO_DEDUCTION'),
0) +
NVL((SELECT SUM(nvl(c.lease_item_amount, 0) - NVL((SELECT SUM(nvl(c.lease_item_amount, 0) -
nvl(c.down_payment, 0)) nvl(c.down_payment, 0))
FROM con_contract c FROM con_contract c
WHERE c.contract_status <> 'CANCEL' WHERE c.contract_status <> 'CANCEL'
AND c.data_class = 'NORMAL'
AND to_char(add_months(c.lease_start_date, 1), AND to_char(add_months(c.lease_start_date, 1),
'yyyymm') = to_char(SYSDATE, 'yyyymm') 'yyyymm') =
to_char(SYSDATE,
'yyyymm')
AND nvl(c.payment_deduction, 'NO_DEDUCTION') <> AND nvl(c.payment_deduction, 'NO_DEDUCTION') <>
'NO_DEDUCTION'),0) 'NO_DEDUCTION'),
0)
WHEN to_char(SYSDATE, 'dd') > 20 AND WHEN to_char(SYSDATE, 'dd') > 20 AND
to_char(add_months(t.calendar_date, -1), 'yyyymm') = to_char(add_months(t.calendar_date, -1), 'yyyymmdd') =
to_char(SYSDATE, 'yyyymm') || 20 THEN to_char(SYSDATE, 'yyyymm') || 20 THEN
NVL((SELECT SUM(nvl(c.lease_item_amount, 0)) NVL((SELECT SUM(nvl(c.lease_item_amount, 0))
FROM con_contract c FROM con_contract c
WHERE c.contract_status <> 'CANCEL' WHERE c.contract_status <> 'CANCEL'
AND to_char(c.lease_start_date, 'yyyymmdd') = AND c.data_class = 'NORMAL'
to_char(SYSDATE, 'yyyymmdd') AND to_char(c.lease_start_date, 'yyyymm') =
to_char(SYSDATE,
'yyyymm')
AND nvl(c.payment_deduction, 'NO_DEDUCTION') = AND nvl(c.payment_deduction, 'NO_DEDUCTION') =
'NO_DEDUCTION'),0) + 'NO_DEDUCTION'),
0) +
NVL((SELECT SUM(nvl(c.lease_item_amount, 0) - NVL((SELECT SUM(nvl(c.lease_item_amount, 0) -
nvl(c.down_payment, 0)) nvl(c.down_payment, 0))
FROM con_contract c FROM con_contract c
WHERE c.contract_status <> 'CANCEL' WHERE c.contract_status <> 'CANCEL'
AND to_char(c.lease_start_date, 'yyyymmdd') = AND c.data_class = 'NORMAL'
to_char(SYSDATE, 'yyyymmdd') AND to_char(c.lease_start_date, 'yyyymm') =
to_char(SYSDATE,
'yyyymm')
AND nvl(c.payment_deduction, 'NO_DEDUCTION') <> AND nvl(c.payment_deduction, 'NO_DEDUCTION') <>
'NO_DEDUCTION'),0) 'NO_DEDUCTION'),
0)
ELSE ELSE
0 0
END) outflow_amount END) outflow_amount
FROM (SELECT s.calendar_date FROM (SELECT s.calendar_date
FROM fnd_calendar_details s FROM fnd_calendar_details s
WHERE trunc(s.calendar_date) >= trunc(SYSDATE) WHERE trunc(s.calendar_date) >=
trunc(SYSDATE)
AND trunc(s.calendar_date) <= ANY AND trunc(s.calendar_date) <= ANY
(SELECT trunc(due_date) (SELECT trunc(due_date)
FROM con_contract_cashflow ccc FROM con_contract_cashflow ccc
...@@ -109,7 +124,10 @@ ...@@ -109,7 +124,10 @@
(SELECT 1 (SELECT 1
FROM con_contract t FROM con_contract t
WHERE t.contract_status IN WHERE t.contract_status IN
('INCEPT', 'PENDING','ETING', 'REPURING') ('INCEPT',
'PENDING',
'ETING',
'REPURING')
AND t.contract_id = ccc.contract_id AND t.contract_id = ccc.contract_id
AND t.data_class = 'NORMAL')) AND t.data_class = 'NORMAL'))
ORDER BY s.calendar_date) t) v ORDER BY s.calendar_date) t) v
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<et:ReportTask xmlns:t="leaf.application.action" xmlns:a="http://www.leaf-framework.org/application" xmlns:et="leaf.plugin.export.task" xmlns:p="uncertain.proc" reportDir="/u01/hls_file/task_excel/"> <et:ReportTask xmlns:t="leaf.application.action" xmlns:a="http://www.leaf-framework.org/application" xmlns:et="leaf.plugin.export.task" xmlns:p="uncertain.proc" reportDir="D:/u01/hls_file/task_excel">
<!--下载报表的权限校验--> <!--下载报表的权限校验-->
<p:procedure name="pre-service"> <p:procedure name="pre-service">
<p:set field="@success" value="true"/> <p:set field="@success" value="true"/>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<!-- var para = $ctx.current_parameter || $ctx.parameter;--> <!-- var para = $ctx.current_parameter || $ctx.parameter;-->
<!-- println(para.toXML());--> <!-- println(para.toXML());-->
$ctx.parameter.file_name='财务收支一览表.xlsx'; $ctx.parameter.file_name='财务收支一览表.xlsx';
$ctx.parameter.file_path = '/u01/hls_file/task_excel/'; $ctx.parameter.file_path = 'D:/u01/hls_file/task_excel';
]]></s:server-script> ]]></s:server-script>
<dr:excel-report enableTask="true" fileName="${/parameter/@file_name}"> <dr:excel-report enableTask="true" fileName="${/parameter/@file_name}">
<dr:styles> <dr:styles>
......
...@@ -29,6 +29,8 @@ ...@@ -29,6 +29,8 @@
attch_file_path:mail_list_result[i].attch_file_path, attch_file_path:mail_list_result[i].attch_file_path,
attch_flag:mail_list_result[i].attch_flag //附件标志 attch_flag:mail_list_result[i].attch_flag //附件标志
}; };
println('1111');
println(mail_list_result[i].attch_file_path);
var sm = new MailSend(); var sm = new MailSend();
var stringResult = sm.sendMain(JSON.stringify(jsonString));//调用接口 var stringResult = sm.sendMain(JSON.stringify(jsonString));//调用接口
var ob = JSON.parse(stringResult);//将接口返回的string字符串解析成对象 var ob = JSON.parse(stringResult);//将接口返回的string字符串解析成对象
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment