169 Commits

Author SHA1 Message Date
a33981ac55 变更报表内容。 2023-10-26 18:46:32 +08:00
506f18abfe 修改oracle获取部门和坐席业绩的代码。 2023-10-25 18:11:56 +08:00
e4d641021e 加入BI机构当月个车续保率跟踪表上传导入功能。 2023-10-24 15:53:24 +08:00
6ddfe56e6d 保存进度! 2023-10-23 23:48:07 +08:00
a3c56df910 保存进度! 2023-10-23 17:46:30 +08:00
8b31ffb6d6 保存进度! 2023-10-22 01:15:34 +08:00
b794e99694 升级依赖。 2023-10-21 18:21:07 +08:00
321ff39e1c 保存进度! 2023-10-20 00:36:39 +08:00
05aabea1a2 完成基本上传导入前端代码 2023-10-18 18:36:11 +08:00
0caf428d67 制作非车渗透的上传报表。 2023-10-17 17:44:14 +08:00
0ad42d00a9 修复文件上传的问题。 2023-10-16 17:57:09 +08:00
16df86e3a7 保存进度! 2023-10-15 19:33:47 +08:00
636ae55b43 保存进度! 2023-10-15 10:45:58 +08:00
cb1c08fff4 完成bi报表导入的controller。 2023-10-13 18:33:33 +08:00
3c807a6efa 保存进度! 2023-10-12 18:31:54 +08:00
7964f8fbe0 完成mybatis导入函数。 2023-10-12 18:24:28 +08:00
a1de9387c8 保存进度! 2023-10-12 00:38:42 +08:00
0021873ef7 开始编写插入代码 2023-10-11 18:31:27 +08:00
be1a5ffb00 加入两个报表读取函数。 2023-10-10 19:05:17 +08:00
6d06ad934d 保存进度! 2023-10-09 23:46:46 +08:00
e805bf914b 完成读取车非渗透表。 2023-10-09 18:37:44 +08:00
e40b81672a 写了两个工具函数。 2023-10-09 00:18:07 +08:00
041ec287b9 开始开发车非渗透率BI表导入功能。
加入一些测试用数据文件。
2023-10-08 18:20:48 +08:00
e5dfb45c79 创建坐席记录文件。 2023-10-08 01:17:43 +08:00
19d658858e 111 2023-10-07 19:11:46 +08:00
5fa7639314 升级依赖 2023-10-06 08:38:28 +08:00
8a64561471 保存进度! 2023-10-06 08:28:02 +08:00
fdb345176e 升级依赖 2023-10-05 23:57:44 +08:00
c6e08981f7 保存进度! 2023-09-29 01:44:20 +08:00
a9c05eef2c 保存进度! 2023-09-28 19:19:06 +08:00
0c2c762721 保存进度! 2023-09-27 19:57:33 +08:00
b8df96ac42 保存进度! 2023-09-26 18:55:37 +08:00
580e917347 保存进度! 2023-09-26 00:43:51 +08:00
64824e6f74 保存进度! 2023-09-25 16:23:26 +08:00
099a1e65f6 保存进度! 2023-09-24 16:34:31 +08:00
a9b30dd293 保存进度! 2023-09-24 09:01:06 +08:00
f61f623f73 保存进度! 2023-09-24 01:17:54 +08:00
b03056d783 保存进度! 2023-09-22 19:22:04 +08:00
bcef8b4994 保存进度! 2023-09-21 22:58:01 +08:00
b91c7d281e 保存进度! 2023-09-21 18:36:31 +08:00
1d554056ac 保存进度! 2023-09-21 16:56:34 +08:00
0d0b61db3c 保存进度! 2023-09-19 19:00:20 +08:00
8fd5ee4904 保存进度! 2023-09-19 18:59:39 +08:00
fa4f211ac2 保存进度! 2023-09-18 18:32:21 +08:00
992606d77a 保存进度! 2023-09-15 18:05:03 +08:00
712aabfb99 保存进度! 2023-09-14 18:42:23 +08:00
9878abb946 保存进度! 2023-09-14 00:42:03 +08:00
7d0112b483 保存进度! 2023-09-13 22:54:43 +08:00
58f60b9eaf 保存进度! 2023-09-13 22:48:35 +08:00
4cd800e62b 保存进度! 2023-09-13 19:35:44 +08:00
4deed356f5 保存进度! 2023-09-13 18:01:07 +08:00
31d5e1622c 保存进度! 2023-09-12 18:12:27 +08:00
be5e426cee 保存进度! 2023-09-12 11:51:09 +08:00
7ea11e34a9 保存进度! 2023-09-11 18:27:06 +08:00
2edd5f67db 保存进度! 2023-09-11 11:49:58 +08:00
efebd548c6 保存进度! 2023-09-08 17:57:34 +08:00
22157b11eb 开始编写获奖相关的界面 2023-09-06 18:37:50 +08:00
bc7e56c336 加入奖项相关的代码 2023-09-06 16:26:47 +08:00
f54f6bbfea 保存进度! 2023-09-05 18:37:41 +08:00
21a50f4c61 保存进度! 2023-09-05 00:41:39 +08:00
075da72a73 保存进度! 2023-09-04 19:01:52 +08:00
ae68f047f4 开发个人业绩组件 2023-09-01 19:05:30 +08:00
7c5da24f5a 保存进度! 2023-08-31 20:34:36 +08:00
4d03abde27 保存进度! 2023-08-30 20:15:31 +08:00
08ea359cd1 保存进度! 2023-08-29 18:57:27 +08:00
8e0505bd49 完成坐席业绩的请求方法。 2023-08-29 10:55:30 +08:00
a74e612546 该死的node 20 2023-08-28 17:41:07 +08:00
42c2e8bdf7 完成坐席业绩查询代码 2023-08-26 19:26:13 +08:00
83be988941 保存进度! 2023-08-26 10:24:03 +08:00
2a92179adf 保存进度! 2023-08-25 23:00:43 +08:00
9976c852ba 保存进度! 2023-08-25 22:47:25 +08:00
fd59698264 保存进度! 2023-08-25 20:47:36 +08:00
f5a53e2f55 保存进度! 2023-08-15 09:51:54 +08:00
5b6285993f 保存进度! 2023-07-31 20:14:49 +08:00
b2a973f7bd 保存进度! 2023-07-30 22:12:14 +08:00
dcc925bb41 完成部门业绩和坐席排行榜的mybatis改造! 2023-07-30 22:11:00 +08:00
8fd60d6b24 parameterType!!! 2023-07-30 20:07:59 +08:00
090a551066 保存进度! 2023-07-30 19:11:56 +08:00
9483b49a20 mybatisUtils加入使用默认参数的工厂函数。 2023-07-30 19:03:53 +08:00
e436fbf89e Merge branch 'mybatis' of http://222.76.244.118:3000/CPICXIM/desktop_task_schedule into mybatis 2023-07-30 18:59:59 +08:00
0875919b5f 保存进度! 2023-07-30 18:59:48 +08:00
a5b008f056 保存进度! 2023-07-30 18:03:47 +08:00
ada65278a1 保存进度! 2023-07-30 00:27:57 +08:00
38ec1c7d6c 保存进度! 2023-07-29 01:13:43 +08:00
7ab604f3dd 保存进度! 2023-07-28 20:13:31 +08:00
374a87e1ee 保存进度! 2023-07-28 02:10:38 +08:00
7304ccf2e8 保存进度! 2023-07-27 21:43:56 +08:00
ff487c3fb6 保存进度! 2023-07-27 18:07:31 +08:00
a9b6e88733 改用mybatis 2023-07-27 16:34:59 +08:00
9111067e63 修正生成车非数据的bug。 2023-07-26 20:31:10 +08:00
702ab2c4d1 保存进度! 2023-07-25 19:11:27 +08:00
c08b85cbe4 保存进度! 2023-07-24 00:48:14 +08:00
068c56e1c9 升级依赖 2023-07-24 00:36:35 +08:00
73d03bfe9b 保存进度! 2023-07-24 00:17:39 +08:00
6d4ca8cf96 保存进度! 2023-07-24 00:13:19 +08:00
5344f2e0ea Merge branch 'feature-personal' of http://222.76.244.118:3000/CPICXIM/desktop_task_schedule into feature-personal 2023-07-18 18:48:55 +08:00
78ae920795 保存进度! 2023-07-18 18:48:48 +08:00
d39e731a1e 升级依赖 2023-07-17 00:04:59 +08:00
16574b6a47 保存进度! 2023-07-12 23:21:00 +08:00
c4b1c754a9 保存进度! 2023-07-11 18:35:17 +08:00
dbc5066aed 保存进度! 2023-07-11 10:49:14 +08:00
daa675b079 升级依赖。 2023-07-10 16:42:05 +08:00
47c30a4ea1 保存进度! 2023-06-25 18:29:36 +08:00
157ab0d76e 保存进度! 2023-06-21 18:47:17 +08:00
8c4293f374 保存进度! 2023-06-20 22:29:37 +08:00
f6ec7cbdfe 111 2023-06-19 22:12:49 +08:00
59bc739cac 升级依赖 2023-06-19 00:48:48 +08:00
30ea250264 保存进度! 2023-06-18 00:50:24 +08:00
a14f4b154f Merge branch 'feature-rankinglist' of http://222.76.244.118:3000/CPICXIM/desktop_task_schedule into feature-rankinglist 2023-06-17 23:37:56 +08:00
dfdde2f8d3 保存进度! 2023-06-16 18:35:19 +08:00
503a5bcdff 保存进度! 2023-06-16 09:54:26 +08:00
05dfb0483c Merge branch 'feature-rankinglist' of http://222.76.244.118:3000/CPICXIM/desktop_task_schedule into feature-rankinglist 2023-06-14 00:15:17 +08:00
3eeaf68593 保存进度! 2023-06-14 00:15:13 +08:00
20924be00e 升级依赖。 2023-06-13 18:10:57 +08:00
0e1338e54b 保存进度! 2023-06-12 18:29:24 +08:00
24266203ca Merge branch 'feature-rankinglist' of http://222.76.244.118:3000/CPICXIM/desktop_task_schedule into feature-rankinglist 2023-06-12 09:43:43 +08:00
88880962a9 升级依赖。 2023-06-12 09:43:34 +08:00
e2ccf553aa Merge branch 'feature-rankinglist' of http://222.76.244.118:3000/CPICXIM/desktop_task_schedule into feature-rankinglist 2023-06-10 00:42:45 +08:00
5856909e92 保存进度! 2023-06-10 00:42:43 +08:00
1b368deb9c 保存进度! 2023-06-09 16:57:13 +08:00
aa39cc4601 保存进度! 2023-06-09 16:37:50 +08:00
80e4b24e4f 保存进度! 2023-06-08 18:08:57 +08:00
664c2335ca 保存进度! 2023-06-07 17:19:47 +08:00
2f3e22fb3e 保存进度! 2023-06-06 18:51:11 +08:00
f9392ea2eb 开发排行榜组件 2023-06-06 17:31:16 +08:00
8b23d4ad4a 保存进度! 2023-06-06 16:16:34 +08:00
eeb01604b2 保存进度! 2023-06-05 18:14:36 +08:00
4eec8a9f18 完成排行榜代码,还没测试 2023-06-05 18:09:40 +08:00
6f65e18672 编写坐席排行榜接口 2023-06-05 11:45:20 +08:00
490e0e0e93 保存进度! 2023-06-05 00:12:21 +08:00
ec18d20461 Merge branch 'feature-data' of http://222.76.244.118:3000/CPICXIM/desktop_task_schedule into feature-data 2023-06-04 19:51:45 +08:00
d3ca1f9004 保存进度! 2023-06-04 19:11:44 +08:00
425b7be1a7 保存进度! 2023-06-04 16:01:05 +08:00
43ebc2babb 保存进度! 2023-06-03 18:15:07 +08:00
0184cbf2d5 保存进度! 2023-06-02 18:04:26 +08:00
9420e96539 Merge branch 'feature-data' of http://222.76.244.118:3000/CPICXIM/desktop_task_schedule into feature-data 2023-05-29 00:31:44 +08:00
631ee1170d 保存进度! 2023-05-29 00:30:38 +08:00
3bc20dea6c 保存进度! 2023-05-29 00:15:18 +08:00
5faf939c89 保存进度! 2023-05-29 00:07:59 +08:00
14cd4df5bb 保存进度! 2023-05-26 22:13:39 +08:00
7b7b97b343 保存进度! 2023-05-24 19:17:00 +08:00
01ae8f3486 升级依赖。 2023-05-24 17:43:06 +08:00
d696aeec82 进度 2023-05-18 18:45:18 +08:00
e48e68d680 完成业绩基本代码 2023-05-18 18:22:05 +08:00
fa79a8f8d1 保存进度! 2023-05-18 15:40:04 +08:00
34c60ada3e 修改了CROS的代码,options请求的origin为*。 2023-05-17 20:24:44 +08:00
21732f6bd2 保存进度! 2023-05-15 20:06:17 +08:00
b2ca0d946b 保存进度! 2023-05-15 00:03:42 +08:00
b19bdf77b4 保存进度! 2023-05-13 00:44:28 +08:00
bc6cd47eb2 保存进度! 2023-05-11 18:19:55 +08:00
9a83d7ac9a 保存进度! 2023-05-10 23:47:38 +08:00
dc3da1496d 保存进度! 2023-05-10 20:44:25 +08:00
52667f3d9c 修改了桌面霸屏页面:
1、读取已登录信息的代码;
2、根据已登录信息获取部门业绩的代码;
3、将数据结构代码移到 types 目录下。
2023-05-09 23:45:53 +08:00
d0c9383bf8 更新登录代码
保存坐席的信息,用于获取业绩数据。
2023-05-09 22:42:20 +08:00
8e9e36bb58 保存进度! 2023-05-09 20:24:37 +08:00
ed55dcc682 保存进度! 2023-05-04 00:13:48 +08:00
503e7ba86c 保存进度! 2023-05-02 09:46:28 +08:00
f7d48368c6 进度 2023-04-28 19:42:48 +08:00
0fb93d0ccd 完成登录功能。 2023-04-28 17:46:54 +08:00
6869294c26 保存进度! 2023-04-27 12:24:55 +08:00
c207de7b25 保存进度! 2023-04-26 20:20:43 +08:00
f31d9e9812 完成坐席工号查询接口。 2023-04-26 20:20:19 +08:00
2e72789a4f 完成坐席工号查询接口。 2023-04-26 20:19:49 +08:00
1e33383d22 升级依赖。 2023-04-21 19:32:35 +08:00
bea91eead2 修正一下 2023-04-20 20:00:54 +08:00
2b45c48e04 升级依赖。 2023-04-20 14:36:42 +08:00
faa515f0cc 更新依赖 2023-04-18 11:21:44 +08:00
ca48a48f4e Merge branch 'feature-data' of http://222.76.244.118:3000/CPICXIM/desktop_task_schedule into feature-data 2023-04-12 18:28:09 +08:00
4ef2c38bdf 保存进度! 2023-04-12 18:27:52 +08:00
155 changed files with 28240 additions and 14472 deletions

1
.gitignore vendored
View File

@@ -78,6 +78,7 @@ build/Release
# Dependency directories
node_modules/
node_modules_bak/
jspm_packages/
# Snowpack dependency directory (https://snowpack.dev/)

View File

@@ -0,0 +1,18 @@
SELECT *
FROM BI<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͸<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͳ<EFBFBD>Ʊ<EFBFBD>;
SELECT *
FROM BI<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϯ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͸ͳ<EFBFBD>Ʊ<EFBFBD>;
SELECT *
FROM BI<EFBFBD><EFBFBD>ϯ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͳ<EFBFBD>Ʊ<EFBFBD>;
/*
truncate table BI<42><49><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϯ<EFBFBD><CFAF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͸ͳ<CDB8>Ʊ<EFBFBD>;
BEGIN
telsale_bi_utils.<2E><><EFBFBD><EFBFBD>BI<42><49><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϯ<EFBFBD><CFAF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͸ͳ<CDB8>Ʊ<EFBFBD>;
telsale_bi_utils.<2E><><EFBFBD><EFBFBD>BI<42><49><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϯ<EFBFBD><CFAF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͳ<EFBFBD>Ʊ<EFBFBD>;
telsale_bi_utils.<2E><><EFBFBD><EFBFBD>BI<42><49><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5>ͳ<EFBFBD>Ʊ<EFBFBD>;
END;
*/

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,43 @@
CREATE OR REPLACE PACKAGE telsale_bi_utils IS
-- Author : WANGWEI-202
-- Created : 2023/10/12 15:31:13
-- Purpose : bi<62><69><EFBFBD>ݱ<EFBFBD><DDB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>صĹ<D8B5><C4B9><EFBFBD>
PROCEDURE <20><><EFBFBD><EFBFBD>BI<42><49><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϯ<EFBFBD><CFAF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͸<EFBFBD>ʸ<EFBFBD><CAB8>ٱ<EFBFBD>;
PROCEDURE <20><><EFBFBD><EFBFBD>BI<42><49><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϯ<EFBFBD><CFAF><EFBFBD><EFBFBD><EFBFBD>ʸ<EFBFBD><CAB8>ٱ<EFBFBD>;
PROCEDURE <20><><EFBFBD><EFBFBD>BI<42><49><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͸<EFBFBD>ʸ<EFBFBD><CAB8>ٱ<EFBFBD>;
PROCEDURE <20><><EFBFBD><EFBFBD>BI<42><49><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʸ<EFBFBD><CAB8>ٱ<EFBFBD>;
END telsale_bi_utils;
/
CREATE OR REPLACE PACKAGE BODY telsale_bi_utils IS
PROCEDURE <20><><EFBFBD><EFBFBD>BI<42><49><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϯ<EFBFBD><CFAF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͸<EFBFBD>ʸ<EFBFBD><CAB8>ٱ<EFBFBD> IS
BEGIN
EXECUTE IMMEDIATE 'truncate table BI<42><49><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϯ<EFBFBD><CFAF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͸<EFBFBD>ʸ<EFBFBD><CAB8>ٱ<EFBFBD>';
END;
PROCEDURE <20><><EFBFBD><EFBFBD>BI<42><49><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϯ<EFBFBD><CFAF><EFBFBD><EFBFBD><EFBFBD>ʸ<EFBFBD><CAB8>ٱ<EFBFBD> IS
BEGIN
EXECUTE IMMEDIATE 'truncate table BI<42><49><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϯ<EFBFBD><CFAF><EFBFBD><EFBFBD><EFBFBD>ʸ<EFBFBD><CAB8>ٱ<EFBFBD>';
END;
PROCEDURE <20><><EFBFBD><EFBFBD>BI<42><49><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͸<EFBFBD>ʸ<EFBFBD><CAB8>ٱ<EFBFBD> IS
BEGIN
EXECUTE IMMEDIATE 'truncate table BI<42><49><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͸<EFBFBD>ʸ<EFBFBD><CAB8>ٱ<EFBFBD>';
END;
PROCEDURE <20><><EFBFBD><EFBFBD>BI<42><49><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʸ<EFBFBD><CAB8>ٱ<EFBFBD> IS
BEGIN
EXECUTE IMMEDIATE 'truncate table BI<42><49><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¸<EFBFBD><C2B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʸ<EFBFBD><CAB8>ٱ<EFBFBD>';
END;
BEGIN
-- Initialization
NULL;
END telsale_bi_utils;
/

918
code/db/pkg/telsale_pkg.pck Normal file
View File

@@ -0,0 +1,918 @@
CREATE OR REPLACE PACKAGE telsale_pkg IS
-- Author : WANGWEI-202
-- Created : 2023/3/10 15:13:34
-- Purpose : 桌面霸屏项目基础数据生成包
PROCEDURE 车非基础数据
(
a_start_date IN DATE,
a_end_date IN DATE
);
PROCEDURE gen_车非临时数据
(
a_start_date IN DATE,
a_end_date IN DATE
);
PROCEDURE 续保基本数据;
PROCEDURE chefei_daily_job;
PROCEDURE xubao_daily_job;
END telsale_pkg;
/
CREATE OR REPLACE PACKAGE BODY telsale_pkg IS
PROCEDURE 车非基础数据
(
a_start_date IN DATE,
a_end_date IN DATE
) IS
--l_count INTEGER; --已有记录的数量
BEGIN
--产生临时数据
gen_车非临时数据(a_start_date,
a_end_date);
FOR caller_record IN (SELECT *
FROM desktop_archievement_admin.坐席车非每日保费_t)
LOOP
BEGIN
DELETE desktop_archievement_admin.坐席车非每日保费 cf
WHERE cf.签单日期 = caller_record.签单日期
AND cf.部门 = caller_record.部门
AND cf.经办人n = caller_record.经办人n
AND cf.坐席工号 = caller_record.坐席工号;
EXCEPTION
WHEN no_data_found THEN
dbms_output.put_line(caller_record.签单日期 || '无重复数据');
END;
INSERT INTO desktop_archievement_admin.坐席车非每日保费
VALUES caller_record;
END LOOP;
COMMIT;
/*EXCEPTION
WHEN OTHERS THEN
NULL;*/
END;
/**********************************************************************/
PROCEDURE gen_车非临时数据
(
a_start_date IN DATE,
a_end_date IN DATE
) IS
BEGIN
desktop_archievement_admin.clean_temp_data;
INSERT INTO desktop_archievement_admin.坐席车非每日保费_t
WITH aa AS
(SELECT to_char(t.signature_date,
'yyyy-mm-dd') 签单日期,
(to_char(T.signature_date,
'yyyy')) the_year,
(to_char(T.signature_date,
'mm')) the_month,
t.policy_no bdh,
t.endorsement_no pdh,
qt.t_cre tid,
QT.B_CRE BTID, -----添加字段
e.inception_date qbsj,
e.planned_end_date zzsj,
pt.premium_amount - nvl(pt.tax_amount,
0) bf
--,qt.qdbf - nvl(qt.qdbf_tax_amount,0) bf
,
nt.ecompensation_rate * (pt.premium_amount - nvl(pt.tax_amount,
0)) fxbf,
z.department_name bm,
z.department_code bmdm,
CASE
WHEN (et.telpartnercode LIKE '%HC%' OR
zx.workerno IN (SELECT code
FROM datacenter.dc_lsj_zx_hc)) THEN
'海沧丰骏'
ELSE
''
END 是否丰骏,
nvl(zx.workerno,
et.telpartnercode) 坐席工号,
(CASE
WHEN nvl(zx.workerno,
et.telpartnercode) = 'DX001' AND
xx.staff_name LIKE '%建发凯迪%' THEN
'林伟华'
WHEN nvl(zx.workerno,
et.telpartnercode) = 'DX001' AND
xx.staff_name NOT LIKE '%建发凯迪%' THEN
'其他'
ELSE
to_char(ys.坐席姓名)
END) 坐席名称,
YS.团队 坐席团队,
nvl(YS.团队,
y.section_office_name) 科室N,
nvl((CASE
WHEN nvl(zx.workerno,
et.telpartnercode) = 'DX001' AND
xx.staff_name LIKE '%建发凯迪%' THEN
'林伟华'
WHEN nvl(zx.workerno,
et.telpartnercode) = 'DX001' AND
xx.staff_name NOT LIKE '%建发凯迪%' THEN
'其他'
ELSE
to_char(ys.坐席姓名)
END),
xx.staff_name) 经办人N
FROM idst0.auto_agreement_request_t t
LEFT JOIN idst0.auto_agreement_t e
ON e.policy_no = t.policy_no
LEFT JOIN idst0.motorised_vehicle_t v
ON v.policy_no = e.policy_no
LEFT JOIN idst0.auto_premium_t pt
ON pt.policy_no = t.policy_no
AND pt.endorsement_no = t.endorsement_no
LEFT JOIN ywglxt.w_dxbd_i i
ON e.policy_no = i.bdh
LEFT JOIN idst0.rydm_t xx
ON xx.staff_code = nvl(i.zhjywy,
e.operator_code)
LEFT JOIN idst0.ks_t y
ON y.section_office_code = nvl(xx.section_office_code,
e.section_office_code)
LEFT JOIN idst0.bm_t z
ON z.department_code = nvl(xx.department_code,
e.department_code)
--left join datacenter.dc_cx_csteam ct on ct.jbrcode = xx.staff_code
LEFT JOIN idst0.auto_new_product_info_t nt
ON nt.policy_no = t.policy_no
AND nt.endorsement_no = t.endorsement_no
--left join ywglxt.q_auto_agreement_extend_t qe on qe.policy_no = e.policy_no
LEFT JOIN ywglxt.q_auto_agreement_t qt
ON qt.policy_no = e.policy_no
LEFT JOIN datacenter.dc_yangg_qdcode qd
ON qd.code = e.selling_channel_type
LEFT JOIN datacenter.dc_tb_jc_c_tag cl
ON cl.保单号 = e.policy_no
LEFT JOIN datacenter.dc_yangg_basecode_teams fg
ON fg.bm = z.department_name
AND fg.ks = y.section_office_name
--left join idst0.t_sell_policy_autobase_t zx on zx.policy_no=e.policy_no
--left join idst0.auto_agreement_extend_t et on et.policy_no = e.policy_no
LEFT JOIN idst0.auto_agreement_extend_t et
ON et.policy_no = e.policy_no
LEFT JOIN idst0.t_sell_policy_autobase_t zx
ON zx.policy_no = e.policy_no
LEFT JOIN datacenter.dc_YZH_ZXYS YS
ON YS.坐席工号 = nvl(zx.workerno,
et.telpartnercode)
--left join v_lsj_dimian dm on dm.vin=v.vin and e.selling_channel_type='25' and dm.MEMO like'%地面续保%'
--left join datacenter.dc_lsj_zx_team zt on zt.name=coalesce(zc.name,zc1.name,bc.name,dm.JBRMC)
WHERE t.signature_date >= to_date('2023-01-01 00:00:00',
'yyyy-mm-dd hh24:mi:ss')
AND t.signature_date < to_date(to_char(SYSDATE - 1,
'yyyy-mm-dd') || ' 23:59:59',
'yyyy-mm-dd hh24:mi:ss')
--and t.endorsement_no = '无'
AND e.policy_status = '1' --条件:保单有效
AND qt.tflag = '0' --条件:类型为个人
AND qt.usage_xm = '家庭自用车'
--条件:单程提车、摩托车、拖拉机
--and e.policy_no in ('AXIMC90Y1419B038594J','AXIMC90CTP19B039593R','AXIMC04CTP19B013473X')
AND e.planned_end_date - e.inception_date >= 360
--条件:保单周期
)
-----添加字段
,
dd2 AS
(SELECT 签单日期,
the_year,
the_month,
bm,
bmdm,
坐席工号,
坐席名称,
坐席团队,
科室N,
经办人N,
CASE
WHEN pdh = '无' THEN
tid
END tid,
to_number('1') 客户数,
COUNT(DISTINCT CASE
WHEN pdh = '无' THEN
bdh
END) 保单数,
SUM(bf) 保费
FROM (SELECT DISTINCT *
FROM aa) aa
GROUP BY bm,
bmdm,
CASE
WHEN pdh = '无' THEN
tid
END,
the_year,
the_month,
BTID,
坐席工号,
坐席名称,
坐席团队,
签单日期,
科室N,
经办人N
UNION
SELECT 签单日期,
the_year,
the_month,
bm,
bmdm,
坐席工号,
坐席名称,
坐席团队,
科室N,
经办人N,
CASE
WHEN btid = tid THEN
''
ELSE
btid
END btid,
to_number('0') 客户数,
to_number('0') 保单数,
to_number('0') 保费
FROM (SELECT DISTINCT *
FROM aa) aa),
DD AS
(SELECT *
FROM DD2
WHERE TID IS NOT NULL)
--select * from dd
,
bb AS
(SELECT DISTINCT q.policy_no bdh,
q.endorsement_no pdh,
qna.t_cre tid,
to_number(to_char(q.signature_date,
'yyyy')) || '年' nf,
(to_char(q.signature_date,
'mm')) mm_f,
to_char(q.signature_date,
'dd') || '日' dd,
q.signature_date sj,
round((pt.premium_amount - nvl(pt.taxamount,
0)) * c.rate / 100,
2) bf,
z.department_name bm
FROM idst0.nonauto_agreement_request_t q
LEFT JOIN idst0.nonauto_agreement_t e
ON e.policy_no = q.policy_no
LEFT JOIN idst0.nonauto_premium_t pt
ON pt.endorsement_no = q.endorsement_no
AND pt.policy_no = q.policy_no
LEFT JOIN idst0.reinsurance_t r
ON r.reinsurance_policy_no = e.policy_no
LEFT JOIN idst0.exrate_month_t c
ON pt.currency_code = c.bzh
AND to_char(q.signature_date,
'YYYY') = c.theyear
AND to_char(q.signature_date,
'fmmm') = c.themonth
LEFT JOIN idst0.rydm_t x
ON x.staff_code = e.operator_code
LEFT JOIN idst0.ks_t y
ON y.section_office_code = x.section_office_code
LEFT JOIN idst0.bm_t z
ON z.department_code = x.department_code
LEFT JOIN ywglxt.q_nonauto_agreement_t qna
ON qna.policy_no = q.policy_no
LEFT JOIN datacenter.dc_yangg_gkxzh gk
ON gk.product_code = e.product_code --分散型险种
--left join datacenter.dc_yangg_zbxzh zb on zb.product_code = e.product_code --政保险种
LEFT JOIN dd
ON dd.tid = qna.t_cre
WHERE qna.tflag = '0'
AND (CASE
WHEN q.endorsement_no != '无' AND
round((pt.premium_amount - nvl(pt.taxamount,
0)) * c.rate / 100,
2) != 0 THEN
'是'
END) IS NULL
--and q.endorsement_no = '无'
AND e.policy_status = '1'
AND gk.product_code IS NOT NULL
AND (e.product_code LIKE '2%' OR e.product_code LIKE '1106%' --意健 --责任
OR e.product_code LIKE '1107%' OR e.product_code LIKE '1108%' OR e.product_code LIKE '1307%' OR e.product_code LIKE '1304A400%' --家财
)
--and e.product_code not in ('22KC9800')
AND q.signature_date >= to_date('2023-01-01 00:00:00',
'yyyy-mm-dd hh24:mi:ss')
AND q.signature_date < to_date(to_char(SYSDATE - 1,
'yyyy-mm-dd') || ' 23:59:59',
'yyyy-mm-dd hh24:mi:ss')
AND e.planned_end_date - e.inception_date >= 90
AND dd.tid IS NOT NULL
--车险个人客户)
)
--SELECT * FROM BB
,
cc AS
(SELECT mm_f,
tid 融合证件,
COUNT(DISTINCT bdh) 融合保数,
SUM(bf) 融合保费
FROM bb
GROUP BY tid,
mm_f),
ff AS
(SELECT dd.*,
cc.*
FROM dd
LEFT JOIN cc
ON cc.融合证件 = dd.tid
AND cc.mm_f = dd.the_month) --OR cc.融合证件 = dd.btid
--select * from ff
SELECT to_date(签单日期,
'yyyy-mm-dd') 签单日期,
the_year 年份,
the_month 月份,
bm 部门,
bmdm 部门代码,
科室N,
经办人N,
坐席工号,
坐席名称,
坐席团队,
nvl(SUM(保费),
0) 车险个人客户保费,
nvl(SUM(融合保费),
0) 车非融合保费
FROM ff
WHERE to_date(ff.签单日期,
'yyyy-mm-dd') >= a_start_date
AND to_date(ff.签单日期,
'yyyy-mm-dd') < a_end_date
AND bm IN ('续保业务部',
'湖里支公司')
GROUP BY 签单日期,
the_year,
the_month,
bm,
bmdm,
坐席工号,
坐席名称,
坐席团队,
科室N,
经办人N
ORDER BY 部门,
坐席名称;
COMMIT;
END;
/**********************************************************************/
PROCEDURE 续保基本数据 IS
BEGIN
--清理旧数据
desktop_archievement_admin.clean_mensual_renewal;
--生成新数据
INSERT INTO desktop_archievement_admin.坐席续保统计
WITH cc AS
(SELECT pt.policy_no policy_no,
SUM(pt.premium_amount) premium_amount,
SUM(pt.tax_amount) tax_amount
FROM idst0.auto_premium_t pt
GROUP BY pt.policy_no)
,
bb AS
(SELECT t.policy_no 保单号,
(CASE
WHEN e.product_code LIKE '1102%' AND
e.product_code NOT LIKE '110224%' AND
e.product_code != '11026000' THEN
'机动车险保险'
WHEN e.product_code LIKE '1101%' OR
e.product_code LIKE '1301%' OR
e.product_code LIKE '11110000%' THEN
'财产险'
WHEN e.product_code LIKE '1107%' OR
e.product_code LIKE '1307%' OR
e.product_code LIKE '1304A400%' THEN
'责任险'
WHEN e.product_code LIKE '1106%' OR
e.product_code LIKE '51015700' THEN
'家财险'
WHEN (e.product_code LIKE '1104%' OR e.product_code LIKE '1204%' OR e.product_code LIKE '13040000%') AND
e.product_code NOT LIKE '120404%' THEN
'货运险'
WHEN e.product_code LIKE '1203%' OR
e.product_code LIKE '1103%' OR
e.product_code LIKE '120404%' THEN
'船舶险'
WHEN e.product_code LIKE '1305%' THEN
'工程险'
WHEN e.product_code LIKE '111%' AND
e.product_code NOT LIKE '11110000%' THEN
'农业险'
WHEN e.product_code LIKE '1109%' OR
e.product_code LIKE '1309%' THEN
'保证保险'
WHEN e.product_code LIKE '1312%' THEN
'特殊风险'
WHEN e.product_code LIKE '1308%' THEN
'信用险'
WHEN e.product_code LIKE '23%' THEN
'意外险'
WHEN e.product_code LIKE '22%' THEN
'健康险'
WHEN e.product_code LIKE '110224%' OR
e.product_code = '11026000' THEN
'交强险'
ELSE
'未分配'
END) AS 险种大类
FROM idst0.auto_agreement_request_t t
LEFT JOIN idst0.auto_agreement_t e
ON e.policy_no = t.policy_no)
,
aa1 AS
(SELECT a.policy_no 旧保单,
a.selling_shop_code 车商代码,
a.planned_end_date 到期时间,
CASE
WHEN to_number(to_char(a.planned_end_date,
'yyyy')) = '2022' AND
a.selling_shop_code || a.tel_sale_4s_code = '00GK' THEN
'个车专业化销售一科'
WHEN a.planned_end_date > to_date('2023-04-01 00:00:00',
'yyyy-mm-dd hh24:mi:ss') AND
(a.selling_shop_code || a.tel_sale_4s_code IN ('00EA',
'00F1',
'00G9')) THEN
'个车专业化销售一科'
ELSE
nvl(dt.科室名称,
z.section_office_name)
END 科室,
(CASE
WHEN to_number(to_char(a.planned_end_date,
'yyyy')) = '2023' AND
nvl(dt.部门,
y.department_name) NOT LIKE '湖里支公司' andcd.memo LIKE '%深圳%' OR
cd.memo LIKE '%地面%' and v.vehicle_brand IN ('特斯拉',
'蔚来',
'理想',
'小鹏',
'极氪',
'极狐',
'AITO',
'ARCFOX极狐',
'特斯拉(中国)',
'特斯拉(中国)') AND
v.vin NOT IN ('LJ1E6A2UXL7744108',
'LW433B10XL1001411',
'LJ1E6A3U2L7742089',
'L1NSPGHB0MA002652') THEN
'新能源车事业发展中心厦门分中心'
WHEN (CASE
WHEN to_number(to_char(a.planned_end_date,
'yyyy')) = '2022' AND
a.selling_shop_code || a.tel_sale_4s_code = '00GK' THEN
'集美支公司'
ELSE
nvl(dt.部门,
y.department_name)
END) = '湖里支公司' THEN
(CASE
WHEN to_number(to_char(a.planned_end_date,
'yyyy')) = '2022' AND
a.selling_shop_code || a.tel_sale_4s_code = '00GK' THEN
'集美支公司'
ELSE
nvl(dt.部门,
y.department_name)
END)
WHEN cd.memo LIKE '%地面%' OR
cd.memo LIKE '%深圳%' THEN
'续保业务部'
WHEN a.planned_end_date > to_date('2023-04-01 00:00:00',
'yyyy-mm-dd hh24:mi:ss') AND
(a.selling_shop_code || a.tel_sale_4s_code IN ('00EA',
'00F1',
'00G9')) THEN
'同安支公司'
ELSE
(CASE
WHEN to_number(to_char(a.planned_end_date,
'yyyy')) = '2022' AND
a.selling_shop_code || a.tel_sale_4s_code = '00GK' THEN
'集美支公司'
ELSE
nvl(dt.部门,
y.department_name)
END)
END) 责任部门,
qa.USAGE_XM 使用性质,
decode(qa.bd_type,
'1',
'单交强',
'2',
'单商业',
'3',
'交商共保',
'其它') 保单类型,
(CASE
WHEN (qa.bd_type = '1' AND nt.ecompensation_rate > 1) THEN
'是'
END) 高预赔,
x.staff_name AS 经办,
bb.险种大类,
cc.signature_date 新保单签发时间,
(SELECT hmd.管控类型
FROM (SELECT DISTINCT *
FROM dc_lsj_xb_hmd) hmd
WHERE hmd.vin = v.vin) 管控类型
FROM idst0.auto_agreement_t a
LEFT JOIN bb
ON bb.保单号 = a.policy_no
LEFT JOIN ywglxt.w_dxbd_i i
ON a.policy_no = i.bdh
LEFT JOIN idst0.motorised_vehicle_t v
ON a.policy_no = v.policy_no
LEFT JOIN ywglxt.q_auto_agreement_t qa
ON qa.policy_no = a.policy_no
LEFT JOIN idst0.auto_new_product_info_t nt
ON nt.policy_no = a.policy_no
AND nt.endorsement_no = '无'
LEFT JOIN idst0.rydm_t x
ON x.staff_code = nvl(upper(i.zhjywy),
a.operator_code)
LEFT JOIN idst0.bm_t y
ON x.department_code = y.department_code
LEFT JOIN idst0.ks_t z
ON x.section_office_code = z.section_office_code
LEFT JOIN cc pt
ON pt.policy_no = a.policy_no
LEFT JOIN (SELECT DISTINCT aa.policy_no,
vv.vin,
aa.inception_date,
t.signature_date,
(pt.premium_amount - nvl(pt.tax_amount,
0)) qdbf,
(CASE
WHEN aa.inception_date - aa.issue_date >= '30' THEN
vv.vin
END) if30,
bb.险种大类
FROM idst0.auto_agreement_t aa
LEFT JOIN bb
ON bb.保单号 = aa.policy_no
LEFT JOIN idst0.motorised_vehicle_t vv
ON vv.policy_no = aa.policy_no
LEFT JOIN idst0.auto_agreement_request_t t
ON t.policy_no = aa.policy_no
AND t.endorsement_no = '无'
LEFT JOIN idst0.auto_premium_t pt
ON pt.policy_no = aa.policy_no
AND pt.endorsement_no = '无'
WHERE aa.policy_no = vv.policy_no
AND aa.policy_status = '1' --and aa.product_code not in ('11022400','11023900','11024000','11024600','11026000')
AND aa.branch_company_code = '3080100'
AND (pt.premium_amount - nvl(pt.tax_amount,
0)) > 100
AND aa.inception_date >= to_date('2022-12-01 00:00:00',
'yyyy-mm-dd hh24:mi:ss')
AND aa.inception_date < to_date('2023-11-01 00:00:00',
'yyyy-mm-dd hh24:mi:ss')
AND aa.branch_company_code = vv.branch_company_code) cc
ON (cc.vin = v.vin AND cc.险种大类 = bb.险种大类)
AND cc.inception_date > a.planned_end_date - 30 --时间限制放宽为30天
LEFT JOIN dc_yangg_cx_dianxiaodoudi cd
ON cd.policy_no = a.policy_no
LEFT JOIN dc_tb_jc_c_tag dt
ON dt.保单号 = a.policy_no
LEFT JOIN idst0.auto_agreement_t aa
ON aa.policy_no = cc.policy_no
LEFT JOIN cc pt1
ON pt1.policy_no = aa.policy_no
WHERE a.policy_status = '1'
AND a.planned_end_date - a.inception_date > 270
AND a.planned_end_date >= to_date('2023-01-01 00:00:00',
'yyyy-mm-dd hh24:mi:ss')
AND a.planned_end_date < to_date('2023-10-01 00:00:00',
'yyyy-mm-dd hh24:mi:ss')),
aa2 AS
(SELECT a.policy_no 旧保单,
a.selling_shop_code 车商代码,
a.planned_end_date 到期时间,
CASE
WHEN to_number(to_char(a.planned_end_date,
'yyyy')) = '2022' AND
a.selling_shop_code || a.tel_sale_4s_code = '00GK' THEN
'个车专业化销售一科'
WHEN a.planned_end_date > to_date('2023-04-01 00:00:00',
'yyyy-mm-dd hh24:mi:ss') AND
(a.selling_shop_code || a.tel_sale_4s_code IN ('00EA',
'00F1',
'00G9')) THEN
'个车专业化销售一科'
ELSE
nvl(dt.科室名称,
z.section_office_name)
END 科室,
(CASE
WHEN to_number(to_char(a.planned_end_date,
'yyyy')) = '2023' AND
nvl(dt.部门,
y.department_name) NOT LIKE '湖里支公司' andcd.memo LIKE '%深圳%' OR
cd.memo LIKE '%地面%' and v.vehicle_brand IN ('特斯拉',
'蔚来',
'理想',
'小鹏',
'极氪',
'极狐',
'AITO',
'ARCFOX极狐',
'特斯拉(中国)',
'特斯拉(中国)') AND
v.vin NOT IN ('LJ1E6A2UXL7744108',
'LW433B10XL1001411',
'LJ1E6A3U2L7742089',
'L1NSPGHB0MA002652') THEN
'新能源车事业发展中心厦门分中心'
WHEN (CASE
WHEN to_number(to_char(a.planned_end_date,
'yyyy')) = '2022' AND
a.selling_shop_code || a.tel_sale_4s_code = '00GK' THEN
'集美支公司'
ELSE
nvl(dt.部门,
y.department_name)
END) = '湖里支公司' THEN
(CASE
WHEN to_number(to_char(a.planned_end_date,
'yyyy')) = '2022' AND
a.selling_shop_code || a.tel_sale_4s_code = '00GK' THEN
'集美支公司'
ELSE
nvl(dt.部门,
y.department_name)
END)
WHEN cd.memo LIKE '%地面%' OR
cd.memo LIKE '%深圳%' THEN
'续保业务部'
WHEN a.planned_end_date > to_date('2023-04-01 00:00:00',
'yyyy-mm-dd hh24:mi:ss') AND
(a.selling_shop_code || a.tel_sale_4s_code IN ('00EA',
'00F1',
'00G9')) THEN
'同安支公司'
ELSE
(CASE
WHEN to_number(to_char(a.planned_end_date,
'yyyy')) = '2022' AND
a.selling_shop_code || a.tel_sale_4s_code = '00GK' THEN
'集美支公司'
ELSE
nvl(dt.部门,
y.department_name)
END)
END) 责任部门,
qa.USAGE_XM 使用性质,
decode(qa.bd_type,
'1',
'单交强',
'2',
'单商业',
'3',
'交商共保',
'其它') 保单类型,
(CASE
WHEN (qa.bd_type = '1' AND nt.ecompensation_rate > 1) THEN
'是'
END) 高预赔,
x.staff_name AS 经办,
bb.险种大类,
cc.signature_date 新保单签发时间,
(SELECT hmd.管控类型
FROM (SELECT DISTINCT *
FROM dc_lsj_xb_hmd) hmd
WHERE hmd.vin = v.vin) 管控类型
FROM idst0.auto_agreement_t a
LEFT JOIN bb
ON bb.保单号 = a.policy_no
LEFT JOIN ywglxt.w_dxbd_i i
ON a.policy_no = i.bdh
LEFT JOIN idst0.motorised_vehicle_t v
ON a.policy_no = v.policy_no
LEFT JOIN ywglxt.q_auto_agreement_t qa
ON qa.policy_no = a.policy_no
LEFT JOIN idst0.auto_new_product_info_t nt
ON nt.policy_no = a.policy_no
AND nt.endorsement_no = '无'
LEFT JOIN idst0.rydm_t x
ON x.staff_code = nvl(upper(i.zhjywy),
a.operator_code)
LEFT JOIN idst0.bm_t y
ON x.department_code = y.department_code
LEFT JOIN idst0.ks_t z
ON x.section_office_code = z.section_office_code
LEFT JOIN cc pt
ON pt.policy_no = a.policy_no
LEFT JOIN (SELECT DISTINCT aa.policy_no,
vv.vin,
aa.inception_date,
t.signature_date,
(pt.premium_amount - nvl(pt.tax_amount,
0)) qdbf,
(CASE
WHEN aa.inception_date - aa.issue_date >= '30' THEN
vv.vin
END) if30,
bb.险种大类
FROM idst0.auto_agreement_t aa
LEFT JOIN bb
ON bb.保单号 = aa.policy_no
LEFT JOIN idst0.motorised_vehicle_t vv
ON vv.policy_no = aa.policy_no
LEFT JOIN idst0.auto_agreement_request_t t
ON t.policy_no = aa.policy_no
AND t.endorsement_no = '无'
LEFT JOIN idst0.auto_premium_t pt
ON pt.policy_no = aa.policy_no
AND pt.endorsement_no = '无'
WHERE aa.policy_no = vv.policy_no
AND aa.policy_status = '1' --and aa.product_code not in ('11022400','11023900','11024000','11024600','11026000')
AND aa.branch_company_code = '3080100'
AND (pt.premium_amount - nvl(pt.tax_amount,
0)) > 100
AND aa.inception_date >= to_date('2022-12-01 00:00:00',
'yyyy-mm-dd hh24:mi:ss')
AND aa.inception_date < to_date('2023-11-01 00:00:00',
'yyyy-mm-dd hh24:mi:ss')
AND aa.branch_company_code = vv.branch_company_code) cc
ON (cc.vin = v.vin AND cc.险种大类 = bb.险种大类)
AND cc.inception_date > a.planned_end_date - 30 --时间限制放宽为30天
LEFT JOIN dc_yangg_cx_dianxiaodoudi cd
ON cd.policy_no = a.policy_no
LEFT JOIN dc_tb_jc_c_tag dt
ON dt.保单号 = a.policy_no
LEFT JOIN idst0.auto_agreement_t aa
ON aa.policy_no = cc.policy_no
LEFT JOIN cc pt1
ON pt1.policy_no = aa.policy_no
WHERE a.policy_status = '1'
AND a.planned_end_date - a.inception_date > 270
AND a.planned_end_date >= to_date('2023-10-01 00:00:00',
'yyyy-mm-dd hh24:mi:ss')
AND a.planned_end_date < to_date('2024-01-01 00:00:00',
'yyyy-mm-dd hh24:mi:ss'))
,
aa3 AS
(SELECT DISTINCT *
FROM aa1
UNION ALL (SELECT DISTINCT *
FROM aa2))
,
AA AS
(SELECT AA3.*,
nvlzx.workerno,
et.telpartnercode) 坐席工号,
(CASE WHEN nvlzx.workerno,
et.telpartnercode) =
'DX001' AND aa3.经办 LIKE
'%建发凯迪%' THEN
'林伟华' WHEN nvlzx.workerno,
et.telpartnercode) =
'DX001' AND aa3.经办 NOT LIKE
'%建发凯迪%' THEN
'其他' ELSE to_char
(ys.坐席姓名) END) 坐席名称,
YS.团队 坐席团队 FROM AA3 LEFT JOIN idst0.auto_agreement_extend_t et ON et.policy_no = AA3.旧保单 LEFT JOIN idst0.t_sell_policy_autobase_t zx ON zx.policy_no = AA3.旧保单 LEFT JOIN dc_YZH_ZXYS YS ON YS.坐席工号 = nvlzx.workerno,
et.telpartnercode))
,
yxb AS
(
---已续保
SELECT aa.责任部门 部门,
aa.科室,
aa.经办,
aa.坐席团队,
aa.坐席名称,
aa.坐席工号,
--(case when a.标识='非首续'and A.责任部门='续保业务部' then '续保业务部' else A.部门 end) 部门,
(CASE
WHEN COUNT(1) IS NULL THEN
0
ELSE
COUNT(1)
END) 已续保累计
FROM aa
WHERE aa.使用性质 IN ('家庭自用车',
'企业客车')
AND aa.高预赔 IS NULL
AND aa.管控类型 IS NULL
AND aa.保单类型 IN '交商共保', '单交强'
AND aa.到期时间 >= to_date(to_char(SYSDATE,
'yyyy-mm') || '-01 00:00:00',
'yyyy-mm-dd hh24:mi:ss')
AND aa.到期时间 < to_date(to_char(SYSDATE - 1,
'yyyy-mm-dd') || ' 23:59:59',
'yyyy-mm-dd hh24:mi:ss')
AND aa.新保单签发时间 <= to_date(to_char(SYSDATE - 1,
'yyyy-mm-dd') || ' 23:59:59',
'yyyy-mm-dd hh24:mi:ss')
GROUP BY aa.责任部门,
aa.科室,
aa.经办,
aa.坐席团队,
aa.坐席名称,
aa.坐席工号)
--个车续保率=已续数-累计/到期数-累计
,
dqs AS
(
---到期数
SELECT aa.责任部门 部门,
aa.科室,
aa.经办,
aa.坐席团队,
aa.坐席名称,
aa.坐席工号,
(CASE
WHEN COUNT(1) IS NULL THEN
0
ELSE
COUNT(1)
END) 到期数
FROM aa
WHERE aa.使用性质 IN ('家庭自用车',
'企业客车')
AND aa.高预赔 IS NULL
AND aa.管控类型 IS NULL
AND aa.保单类型 IN '交商共保', '单交强'
AND aa.到期时间 >= to_date(to_char(SYSDATE,
'yyyy-mm') || '-01 00:00:00',
'yyyy-mm-dd hh24:mi:ss')
AND aa.到期时间 < to_date(to_char(SYSDATE - 1,
'yyyy-mm-dd') || ' 23:59:59',
'yyyy-mm-dd hh24:mi:ss')
GROUP BY aa.责任部门,
aa.科室,
aa.经办,
aa.坐席团队,
aa.坐席名称,
aa.坐席工号)
SELECT dqs.部门,
dqs.科室,
dqs.经办,
dqs.坐席团队,
dqs.坐席名称,
dqs.坐席工号,
yxb.已续保累计,
dqs.到期数
FROM yxb,
dqs --,sdqs,syxs,cyxs,cdqs
WHERE dqs.部门 = yxb.部门
AND dqs.经办 = yxb.经办
AND dqs.科室 = yxb.科室
AND dqs.坐席名称 = yxb.坐席名称
AND dqs.坐席工号 = yxb.坐席工号;
COMMIT;
END;
PROCEDURE chefei_daily_job IS
BEGIN
车非基础数据(SYSDATE - 3,
SYSDATE);
END;
PROCEDURE xubao_daily_job IS
BEGIN
续保基本数据;
END;
BEGIN
NULL;
END telsale_pkg;
/

View File

@@ -0,0 +1,918 @@
CREATE OR REPLACE PACKAGE telsale_pkg IS
-- Author : WANGWEI-202
-- Created : 2023/3/10 15:13:34
-- Purpose : <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɰ<EFBFBD>
PROCEDURE <20><><EFBFBD>ǻ<EFBFBD><C7BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
(
a_start_date IN DATE,
a_end_date IN DATE
);
PROCEDURE gen_<6E><5F><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>
(
a_start_date IN DATE,
a_end_date IN DATE
);
PROCEDURE <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;
PROCEDURE chefei_daily_job;
PROCEDURE xubao_daily_job;
END telsale_pkg;
/
CREATE OR REPLACE PACKAGE BODY telsale_pkg IS
PROCEDURE <20><><EFBFBD>ǻ<EFBFBD><C7BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
(
a_start_date IN DATE,
a_end_date IN DATE
) IS
--l_count INTEGER; --<2D><><EFBFBD>м<EFBFBD>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
BEGIN
--<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>
gen_<6E><5F><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>(a_start_date,
a_end_date);
FOR caller_record IN (SELECT *
FROM desktop_archievement_admin.<2E><>ϯ<EFBFBD><CFAF><EFBFBD><EFBFBD>ÿ<EFBFBD>ձ<EFBFBD><D5B1><EFBFBD>_t)
LOOP
BEGIN
DELETE desktop_archievement_admin.<2E><>ϯ<EFBFBD><CFAF><EFBFBD><EFBFBD>ÿ<EFBFBD>ձ<EFBFBD><D5B1><EFBFBD> cf
WHERE cf.ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD> = caller_record.ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
AND cf.<2E><><EFBFBD><EFBFBD> = caller_record.<2E><><EFBFBD><EFBFBD>
AND cf.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>n = caller_record.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>n
AND cf.<2E><>ϯ<EFBFBD><CFAF><EFBFBD><EFBFBD> = caller_record.<2E><>ϯ<EFBFBD><CFAF><EFBFBD><EFBFBD>;
EXCEPTION
WHEN no_data_found THEN
dbms_output.put_line(caller_record.ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD> || '<27><><EFBFBD>ظ<EFBFBD><D8B8><EFBFBD><EFBFBD><EFBFBD>');
END;
INSERT INTO desktop_archievement_admin.<2E><>ϯ<EFBFBD><CFAF><EFBFBD><EFBFBD>ÿ<EFBFBD>ձ<EFBFBD><D5B1><EFBFBD>
VALUES caller_record;
END LOOP;
COMMIT;
/*EXCEPTION
WHEN OTHERS THEN
NULL;*/
END;
/**********************************************************************/
PROCEDURE gen_<6E><5F><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>
(
a_start_date IN DATE,
a_end_date IN DATE
) IS
BEGIN
desktop_archievement_admin.clean_temp_data;
INSERT INTO desktop_archievement_admin.<2E><>ϯ<EFBFBD><CFAF><EFBFBD><EFBFBD>ÿ<EFBFBD>ձ<EFBFBD><D5B1><EFBFBD>_t
WITH aa AS
(SELECT to_char(t.signature_date,
'yyyy-mm-dd') ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,
(to_char(T.signature_date,
'yyyy')) the_year,
(to_char(T.signature_date,
'mm')) the_month,
t.policy_no bdh,
t.endorsement_no pdh,
qt.t_cre tid,
QT.B_CRE BTID, -----<2D><><EFBFBD><EFBFBD><EFBFBD>ֶ<EFBFBD>
e.inception_date qbsj,
e.planned_end_date zzsj,
pt.premium_amount - nvl(pt.tax_amount,
0) bf
--,qt.qdbf - nvl(qt.qdbf_tax_amount,0) bf
,
nt.ecompensation_rate * (pt.premium_amount - nvl(pt.tax_amount,
0)) fxbf,
z.department_name bm,
z.department_code bmdm,
CASE
WHEN (et.telpartnercode LIKE '%HC%' OR
zx.workerno IN (SELECT code
FROM datacenter.dc_lsj_zx_hc)) THEN
'<27><><EFBFBD>׷ῥ'
ELSE
''
END <20>Ƿ<EFBFBD><C7B7>ῥ,
nvl(zx.workerno,
et.telpartnercode) <20><>ϯ<EFBFBD><CFAF><EFBFBD><EFBFBD>,
(CASE
WHEN nvl(zx.workerno,
et.telpartnercode) = 'DX001' AND
xx.staff_name LIKE '%<25><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>%' THEN
'<27><>ΰ<EFBFBD><CEB0>'
WHEN nvl(zx.workerno,
et.telpartnercode) = 'DX001' AND
xx.staff_name NOT LIKE '%<25><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>%' THEN
'<27><><EFBFBD><EFBFBD>'
ELSE
to_char(ys.<2E><>ϯ<EFBFBD><CFAF><EFBFBD><EFBFBD>)
END) <20><>ϯ<EFBFBD><CFAF><EFBFBD><EFBFBD>,
YS.<2E>Ŷ<EFBFBD> <20><>ϯ<EFBFBD>Ŷ<EFBFBD>,
nvl(YS.<2E>Ŷ<EFBFBD>,
y.section_office_name) <20><><EFBFBD><EFBFBD>N,
nvl((CASE
WHEN nvl(zx.workerno,
et.telpartnercode) = 'DX001' AND
xx.staff_name LIKE '%<25><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>%' THEN
'<27><>ΰ<EFBFBD><CEB0>'
WHEN nvl(zx.workerno,
et.telpartnercode) = 'DX001' AND
xx.staff_name NOT LIKE '%<25><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>%' THEN
'<27><><EFBFBD><EFBFBD>'
ELSE
to_char(ys.<2E><>ϯ<EFBFBD><CFAF><EFBFBD><EFBFBD>)
END),
xx.staff_name) <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>N
FROM idst0.auto_agreement_request_t t
LEFT JOIN idst0.auto_agreement_t e
ON e.policy_no = t.policy_no
LEFT JOIN idst0.motorised_vehicle_t v
ON v.policy_no = e.policy_no
LEFT JOIN idst0.auto_premium_t pt
ON pt.policy_no = t.policy_no
AND pt.endorsement_no = t.endorsement_no
LEFT JOIN ywglxt.w_dxbd_i i
ON e.policy_no = i.bdh
LEFT JOIN idst0.rydm_t xx
ON xx.staff_code = nvl(i.zhjywy,
e.operator_code)
LEFT JOIN idst0.ks_t y
ON y.section_office_code = nvl(xx.section_office_code,
e.section_office_code)
LEFT JOIN idst0.bm_t z
ON z.department_code = nvl(xx.department_code,
e.department_code)
--left join datacenter.dc_cx_csteam ct on ct.jbrcode = xx.staff_code
LEFT JOIN idst0.auto_new_product_info_t nt
ON nt.policy_no = t.policy_no
AND nt.endorsement_no = t.endorsement_no
--left join ywglxt.q_auto_agreement_extend_t qe on qe.policy_no = e.policy_no
LEFT JOIN ywglxt.q_auto_agreement_t qt
ON qt.policy_no = e.policy_no
LEFT JOIN datacenter.dc_yangg_qdcode qd
ON qd.code = e.selling_channel_type
LEFT JOIN datacenter.dc_tb_jc_c_tag cl
ON cl.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> = e.policy_no
LEFT JOIN datacenter.dc_yangg_basecode_teams fg
ON fg.bm = z.department_name
AND fg.ks = y.section_office_name
--left join idst0.t_sell_policy_autobase_t zx on zx.policy_no=e.policy_no
--left join idst0.auto_agreement_extend_t et on et.policy_no = e.policy_no
LEFT JOIN idst0.auto_agreement_extend_t et
ON et.policy_no = e.policy_no
LEFT JOIN idst0.t_sell_policy_autobase_t zx
ON zx.policy_no = e.policy_no
LEFT JOIN datacenter.dc_YZH_ZXYS YS
ON YS.<2E><>ϯ<EFBFBD><CFAF><EFBFBD><EFBFBD> = nvl(zx.workerno,
et.telpartnercode)
--left join v_lsj_dimian dm on dm.vin=v.vin and e.selling_channel_type='25' and dm.MEMO like'%<25><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>%'
--left join datacenter.dc_lsj_zx_team zt on zt.name=coalesce(zc.name,zc1.name,bc.name,dm.JBRMC)
WHERE t.signature_date >= to_date('2023-01-01 00:00:00',
'yyyy-mm-dd hh24:mi:ss')
AND t.signature_date < to_date(to_char(SYSDATE - 1,
'yyyy-mm-dd') || ' 23:59:59',
'yyyy-mm-dd hh24:mi:ss')
--and t.endorsement_no = '<27><>'
AND e.policy_status = '1' --<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ч
AND qt.tflag = '0' --<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>
AND qt.usage_xm = '<27><>ͥ<EFBFBD><CDA5><EFBFBD>ó<EFBFBD>'
--<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E1B3B5>Ħ<EFBFBD>г<EFBFBD><D0B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
--and e.policy_no in ('AXIMC90Y1419B038594J','AXIMC90CTP19B039593R','AXIMC04CTP19B013473X')
AND e.planned_end_date - e.inception_date >= 360
--<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
)
-----<2D><><EFBFBD><EFBFBD><EFBFBD>ֶ<EFBFBD>
,
dd2 AS
(SELECT ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,
the_year,
the_month,
bm,
bmdm,
<20><>ϯ<EFBFBD><CFAF><EFBFBD><EFBFBD>,
<20><>ϯ<EFBFBD><CFAF><EFBFBD><EFBFBD>,
<20><>ϯ<EFBFBD>Ŷ<EFBFBD>,
<20><><EFBFBD><EFBFBD>N,
<20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>N,
CASE
WHEN pdh = '<27><>' THEN
tid
END tid,
to_number('1') <20>ͻ<EFBFBD><CDBB><EFBFBD>,
COUNT(DISTINCT CASE
WHEN pdh = '<27><>' THEN
bdh
END) <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,
SUM(bf) <20><><EFBFBD><EFBFBD>
FROM (SELECT DISTINCT *
FROM aa) aa
GROUP BY bm,
bmdm,
CASE
WHEN pdh = '<27><>' THEN
tid
END,
the_year,
the_month,
BTID,
<20><>ϯ<EFBFBD><CFAF><EFBFBD><EFBFBD>,
<20><>ϯ<EFBFBD><CFAF><EFBFBD><EFBFBD>,
<20><>ϯ<EFBFBD>Ŷ<EFBFBD>,
ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,
<20><><EFBFBD><EFBFBD>N,
<20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>N
UNION
SELECT ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,
the_year,
the_month,
bm,
bmdm,
<20><>ϯ<EFBFBD><CFAF><EFBFBD><EFBFBD>,
<20><>ϯ<EFBFBD><CFAF><EFBFBD><EFBFBD>,
<20><>ϯ<EFBFBD>Ŷ<EFBFBD>,
<20><><EFBFBD><EFBFBD>N,
<20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>N,
CASE
WHEN btid = tid THEN
''
ELSE
btid
END btid,
to_number('0') <20>ͻ<EFBFBD><CDBB><EFBFBD>,
to_number('0') <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,
to_number('0') <20><><EFBFBD><EFBFBD>
FROM (SELECT DISTINCT *
FROM aa) aa),
DD AS
(SELECT *
FROM DD2
WHERE TID IS NOT NULL)
--select * from dd
,
bb AS
(SELECT DISTINCT q.policy_no bdh,
q.endorsement_no pdh,
qna.t_cre tid,
to_number(to_char(q.signature_date,
'yyyy')) || '<27><>' nf,
(to_char(q.signature_date,
'mm')) mm_f,
to_char(q.signature_date,
'dd') || '<27><>' dd,
q.signature_date sj,
round((pt.premium_amount - nvl(pt.taxamount,
0)) * c.rate / 100,
2) bf,
z.department_name bm
FROM idst0.nonauto_agreement_request_t q
LEFT JOIN idst0.nonauto_agreement_t e
ON e.policy_no = q.policy_no
LEFT JOIN idst0.nonauto_premium_t pt
ON pt.endorsement_no = q.endorsement_no
AND pt.policy_no = q.policy_no
LEFT JOIN idst0.reinsurance_t r
ON r.reinsurance_policy_no = e.policy_no
LEFT JOIN idst0.exrate_month_t c
ON pt.currency_code = c.bzh
AND to_char(q.signature_date,
'YYYY') = c.theyear
AND to_char(q.signature_date,
'fmmm') = c.themonth
LEFT JOIN idst0.rydm_t x
ON x.staff_code = e.operator_code
LEFT JOIN idst0.ks_t y
ON y.section_office_code = x.section_office_code
LEFT JOIN idst0.bm_t z
ON z.department_code = x.department_code
LEFT JOIN ywglxt.q_nonauto_agreement_t qna
ON qna.policy_no = q.policy_no
LEFT JOIN datacenter.dc_yangg_gkxzh gk
ON gk.product_code = e.product_code --<2D><>ɢ<EFBFBD><C9A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
--left join datacenter.dc_yangg_zbxzh zb on zb.product_code = e.product_code --<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
LEFT JOIN dd
ON dd.tid = qna.t_cre
WHERE qna.tflag = '0'
AND (CASE
WHEN q.endorsement_no != '<27><>' AND
round((pt.premium_amount - nvl(pt.taxamount,
0)) * c.rate / 100,
2) != 0 THEN
'<27><>'
END) IS NULL
--and q.endorsement_no = '<27><>'
AND e.policy_status = '1'
AND gk.product_code IS NOT NULL
AND (e.product_code LIKE '2%' OR e.product_code LIKE '1106%' --<2D>⽡ --<2D><><EFBFBD><EFBFBD>
OR e.product_code LIKE '1107%' OR e.product_code LIKE '1108%' OR e.product_code LIKE '1307%' OR e.product_code LIKE '1304A400%' --<2D>Ҳ<EFBFBD>
)
--and e.product_code not in ('22KC9800')
AND q.signature_date >= to_date('2023-01-01 00:00:00',
'yyyy-mm-dd hh24:mi:ss')
AND q.signature_date < to_date(to_char(SYSDATE - 1,
'yyyy-mm-dd') || ' 23:59:59',
'yyyy-mm-dd hh24:mi:ss')
AND e.planned_end_date - e.inception_date >= 90
AND dd.tid IS NOT NULL
--<2D><><EFBFBD>ո<EFBFBD><D5B8>˿ͻ<CBBF>)
)
--SELECT * FROM BB
,
cc AS
(SELECT mm_f,
tid <20>ں<EFBFBD>֤<EFBFBD><D6A4>,
COUNT(DISTINCT bdh) <20>ںϱ<DABA><CFB1><EFBFBD>,
SUM(bf) <20>ںϱ<DABA><CFB1><EFBFBD>
FROM bb
GROUP BY tid,
mm_f),
ff AS
(SELECT dd.*,
cc.*
FROM dd
LEFT JOIN cc
ON cc.<2E>ں<EFBFBD>֤<EFBFBD><D6A4> = dd.tid
AND cc.mm_f = dd.the_month) --OR cc.<2E>ں<EFBFBD>֤<EFBFBD><D6A4> = dd.btid
--select * from ff
SELECT to_date(ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,
'yyyy-mm-dd') ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,
the_year <20><><EFBFBD><EFBFBD>,
the_month <20>·<EFBFBD>,
bm <20><><EFBFBD><EFBFBD>,
bmdm <20><><EFBFBD>Ŵ<EFBFBD><C5B4><EFBFBD>,
<20><><EFBFBD><EFBFBD>N,
<20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>N,
<20><>ϯ<EFBFBD><CFAF><EFBFBD><EFBFBD>,
<20><>ϯ<EFBFBD><CFAF><EFBFBD><EFBFBD>,
<20><>ϯ<EFBFBD>Ŷ<EFBFBD>,
nvl(SUM(<28><><EFBFBD><EFBFBD>),
0) <20><><EFBFBD>ո<EFBFBD><D5B8>˿ͻ<CBBF><CDBB><EFBFBD><EFBFBD><EFBFBD>,
nvl(SUM(<28>ںϱ<DABA><CFB1><EFBFBD>),
0) <20><><EFBFBD><EFBFBD><EFBFBD>ںϱ<DABA><CFB1><EFBFBD>
FROM ff
WHERE to_date(ff.ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,
'yyyy-mm-dd') >= a_start_date
AND to_date(ff.ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,
'yyyy-mm-dd') < a_end_date
AND bm IN ('<27><><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD>',
'<27><><EFBFBD><EFBFBD>֧<EFBFBD><D6A7>˾')
GROUP BY ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,
the_year,
the_month,
bm,
bmdm,
<20><>ϯ<EFBFBD><CFAF><EFBFBD><EFBFBD>,
<20><>ϯ<EFBFBD><CFAF><EFBFBD><EFBFBD>,
<20><>ϯ<EFBFBD>Ŷ<EFBFBD>,
<20><><EFBFBD><EFBFBD>N,
<20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>N
ORDER BY <20><><EFBFBD><EFBFBD>,
<20><>ϯ<EFBFBD><CFAF><EFBFBD><EFBFBD>;
COMMIT;
END;
/**********************************************************************/
PROCEDURE <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> IS
BEGIN
--<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
desktop_archievement_admin.clean_mensual_renewal;
--<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
INSERT INTO desktop_archievement_admin.<2E><>ϯ<EFBFBD><CFAF><EFBFBD><EFBFBD>ͳ<EFBFBD><CDB3>
WITH cc AS
(SELECT pt.policy_no policy_no,
SUM(pt.premium_amount) premium_amount,
SUM(pt.tax_amount) tax_amount
FROM idst0.auto_premium_t pt
GROUP BY pt.policy_no)
,
bb AS
(SELECT t.policy_no <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,
(CASE
WHEN e.product_code LIKE '1102%' AND
e.product_code NOT LIKE '110224%' AND
e.product_code != '11026000' THEN
'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ձ<EFBFBD><D5B1><EFBFBD>'
WHEN e.product_code LIKE '1101%' OR
e.product_code LIKE '1301%' OR
e.product_code LIKE '11110000%' THEN
'<27>Ʋ<EFBFBD><C6B2><EFBFBD>'
WHEN e.product_code LIKE '1107%' OR
e.product_code LIKE '1307%' OR
e.product_code LIKE '1304A400%' THEN
'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
WHEN e.product_code LIKE '1106%' OR
e.product_code LIKE '51015700' THEN
'<27>Ҳ<EFBFBD><D2B2><EFBFBD>'
WHEN (e.product_code LIKE '1104%' OR e.product_code LIKE '1204%' OR e.product_code LIKE '13040000%') AND
e.product_code NOT LIKE '120404%' THEN
'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
WHEN e.product_code LIKE '1203%' OR
e.product_code LIKE '1103%' OR
e.product_code LIKE '120404%' THEN
'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
WHEN e.product_code LIKE '1305%' THEN
'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
WHEN e.product_code LIKE '111%' AND
e.product_code NOT LIKE '11110000%' THEN
'ũҵ<C5A9><D2B5>'
WHEN e.product_code LIKE '1109%' OR
e.product_code LIKE '1309%' THEN
'<27><>֤<EFBFBD><D6A4><EFBFBD><EFBFBD>'
WHEN e.product_code LIKE '1312%' THEN
'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
WHEN e.product_code LIKE '1308%' THEN
'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
WHEN e.product_code LIKE '23%' THEN
'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
WHEN e.product_code LIKE '22%' THEN
'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
WHEN e.product_code LIKE '110224%' OR
e.product_code = '11026000' THEN
'<27><>ǿ<EFBFBD><C7BF>'
ELSE
<><CEB4><EFBFBD><EFBFBD>'
END) AS <20><><EFBFBD>ִ<EFBFBD><D6B4><EFBFBD>
FROM idst0.auto_agreement_request_t t
LEFT JOIN idst0.auto_agreement_t e
ON e.policy_no = t.policy_no)
,
aa1 AS
(SELECT a.policy_no <20>ɱ<EFBFBD><C9B1><EFBFBD>,
a.selling_shop_code <20><><EFBFBD>̴<EFBFBD><CCB4><EFBFBD>,
a.planned_end_date <20><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>,
CASE
WHEN to_number(to_char(a.planned_end_date,
'yyyy')) = '2022' AND
a.selling_shop_code || a.tel_sale_4s_code = '00GK' THEN
'<27><><EFBFBD><EFBFBD>רҵ<D7A8><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>'
WHEN a.planned_end_date > to_date('2023-04-01 00:00:00',
'yyyy-mm-dd hh24:mi:ss') AND
(a.selling_shop_code || a.tel_sale_4s_code IN ('00EA',
'00F1',
'00G9')) THEN
'<27><><EFBFBD><EFBFBD>רҵ<D7A8><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>'
ELSE
nvl(dt.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,
z.section_office_name)
END <20><><EFBFBD><EFBFBD>,
(CASE
WHEN to_number(to_char(a.planned_end_date,
'yyyy')) = '2023' AND
nvl(dt.<2E><><EFBFBD><EFBFBD>,
y.department_name) NOT LIKE '<27><><EFBFBD><EFBFBD>֧<EFBFBD><D6A7>˾' and<6E><64>cd.memo LIKE '%<25><><EFBFBD><EFBFBD>%' OR
cd.memo LIKE '%<25><><EFBFBD><EFBFBD>%' <20><>and v.vehicle_brand IN ('<27><>˹<EFBFBD><CBB9>',
<><CEB5>',
'<27><><EFBFBD><EFBFBD>',
'С<><D0A1>',
'<27><><EFBFBD><EFBFBD>',
'<27><><EFBFBD><EFBFBD>',
'AITO',
'ARCFOX<4F><58><EFBFBD><EFBFBD>',
'<27><>˹<EFBFBD><CBB9><EFBFBD><EFBFBD><EFBFBD>й<EFBFBD><D0B9><EFBFBD>',
'<27><>˹<EFBFBD><CBB9>(<28>й<EFBFBD>)') AND
v.vin NOT IN ('LJ1E6A2UXL7744108',
'LW433B10XL1001411',
'LJ1E6A3U2L7742089',
'L1NSPGHB0MA002652') THEN
'<27><><EFBFBD><EFBFBD>Դ<EFBFBD><D4B4><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5>չ<EFBFBD><D5B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ŷ<EFBFBD><C5B7><EFBFBD><EFBFBD><EFBFBD>'
WHEN (CASE
WHEN to_number(to_char(a.planned_end_date,
'yyyy')) = '2022' AND
a.selling_shop_code || a.tel_sale_4s_code = '00GK' THEN
'<27><><EFBFBD><EFBFBD>֧<EFBFBD><D6A7>˾'
ELSE
nvl(dt.<2E><><EFBFBD><EFBFBD>,
y.department_name)
END) = '<27><><EFBFBD><EFBFBD>֧<EFBFBD><D6A7>˾' THEN
(CASE
WHEN to_number(to_char(a.planned_end_date,
'yyyy')) = '2022' AND
a.selling_shop_code || a.tel_sale_4s_code = '00GK' THEN
'<27><><EFBFBD><EFBFBD>֧<EFBFBD><D6A7>˾'
ELSE
nvl(dt.<2E><><EFBFBD><EFBFBD>,
y.department_name)
END)
WHEN <20><>cd.memo LIKE '%<25><><EFBFBD><EFBFBD>%' OR
cd.memo LIKE '%<25><><EFBFBD><EFBFBD>%' <20><> THEN
'<27><><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD>'
WHEN a.planned_end_date > to_date('2023-04-01 00:00:00',
'yyyy-mm-dd hh24:mi:ss') AND
(a.selling_shop_code || a.tel_sale_4s_code IN ('00EA',
'00F1',
'00G9')) THEN
<><CDAC>֧<EFBFBD><D6A7>˾'
ELSE
(CASE
WHEN to_number(to_char(a.planned_end_date,
'yyyy')) = '2022' AND
a.selling_shop_code || a.tel_sale_4s_code = '00GK' THEN
'<27><><EFBFBD><EFBFBD>֧<EFBFBD><D6A7>˾'
ELSE
nvl(dt.<2E><><EFBFBD><EFBFBD>,
y.department_name)
END)
END) <20><><EFBFBD>β<EFBFBD><CEB2><EFBFBD>,
qa.USAGE_XM ʹ<><CAB9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,
decode(qa.bd_type,
'1',
'<27><><EFBFBD><EFBFBD>ǿ',
'2',
'<27><><EFBFBD><EFBFBD>ҵ',
'3',
'<27><><EFBFBD>̹<EFBFBD><CCB9><EFBFBD>',
'<27><><EFBFBD><EFBFBD>') <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,
(CASE
WHEN (qa.bd_type = '1' AND nt.ecompensation_rate > 1) THEN
'<27><>'
END) <20><>Ԥ<EFBFBD><D4A4>,
x.staff_name AS <20><><EFBFBD><EFBFBD>,
bb.<2E><><EFBFBD>ִ<EFBFBD><D6B4><EFBFBD>,
cc.signature_date <20>±<EFBFBD><C2B1><EFBFBD>ǩ<EFBFBD><C7A9>ʱ<EFBFBD><CAB1>,
(SELECT hmd.<2E>ܿ<EFBFBD><DCBF><EFBFBD><EFBFBD><EFBFBD>
FROM (SELECT DISTINCT *
FROM dc_lsj_xb_hmd) hmd
WHERE hmd.vin = v.vin) <20>ܿ<EFBFBD><DCBF><EFBFBD><EFBFBD><EFBFBD>
FROM idst0.auto_agreement_t a
LEFT JOIN bb
ON bb.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> = a.policy_no
LEFT JOIN ywglxt.w_dxbd_i i
ON a.policy_no = i.bdh
LEFT JOIN idst0.motorised_vehicle_t v
ON a.policy_no = v.policy_no
LEFT JOIN ywglxt.q_auto_agreement_t qa
ON qa.policy_no = a.policy_no
LEFT JOIN idst0.auto_new_product_info_t nt
ON nt.policy_no = a.policy_no
AND nt.endorsement_no = '<27><>'
LEFT JOIN idst0.rydm_t x
ON x.staff_code = nvl(upper(i.zhjywy),
a.operator_code)
LEFT JOIN idst0.bm_t y
ON x.department_code = y.department_code
LEFT JOIN idst0.ks_t z
ON x.section_office_code = z.section_office_code
LEFT JOIN cc pt
ON pt.policy_no = a.policy_no
LEFT JOIN (SELECT DISTINCT aa.policy_no,
vv.vin,
aa.inception_date,
t.signature_date,
(pt.premium_amount - nvl(pt.tax_amount,
0)) qdbf,
(CASE
WHEN aa.inception_date - aa.issue_date >= '30' THEN
vv.vin
END) if30,
bb.<2E><><EFBFBD>ִ<EFBFBD><D6B4><EFBFBD>
FROM idst0.auto_agreement_t aa
LEFT JOIN bb
ON bb.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> = aa.policy_no
LEFT JOIN idst0.motorised_vehicle_t vv
ON vv.policy_no = aa.policy_no
LEFT JOIN idst0.auto_agreement_request_t t
ON t.policy_no = aa.policy_no
AND t.endorsement_no = '<27><>'
LEFT JOIN idst0.auto_premium_t pt
ON pt.policy_no = aa.policy_no
AND pt.endorsement_no = '<27><>'
WHERE aa.policy_no = vv.policy_no
AND aa.policy_status = '1' --and aa.product_code not in ('11022400','11023900','11024000','11024600','11026000')
AND aa.branch_company_code = '3080100'
AND (pt.premium_amount - nvl(pt.tax_amount,
0)) > 100
AND aa.inception_date >= to_date('2022-12-01 00:00:00',
'yyyy-mm-dd hh24:mi:ss')
AND aa.inception_date < to_date('2023-11-01 00:00:00',
'yyyy-mm-dd hh24:mi:ss')
AND aa.branch_company_code = vv.branch_company_code) cc
ON (cc.vin = v.vin AND cc.<2E><><EFBFBD>ִ<EFBFBD><D6B4><EFBFBD> = bb.<2E><><EFBFBD>ִ<EFBFBD><D6B4><EFBFBD>)
AND cc.inception_date > a.planned_end_date - 30 --ʱ<><CAB1><EFBFBD><EFBFBD><EFBFBD>Ʒſ<C6B7>Ϊ30<33><30>
LEFT JOIN dc_yangg_cx_dianxiaodoudi cd
ON cd.policy_no = a.policy_no
LEFT JOIN dc_tb_jc_c_tag dt
ON dt.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> = a.policy_no
LEFT JOIN idst0.auto_agreement_t aa
ON aa.policy_no = cc.policy_no
LEFT JOIN cc pt1
ON pt1.policy_no = aa.policy_no
WHERE a.policy_status = '1'
AND a.planned_end_date - a.inception_date > 270
AND a.planned_end_date >= to_date('2023-01-01 00:00:00',
'yyyy-mm-dd hh24:mi:ss')
AND a.planned_end_date < to_date('2023-10-01 00:00:00',
'yyyy-mm-dd hh24:mi:ss')),
aa2 AS
(SELECT a.policy_no <20>ɱ<EFBFBD><C9B1><EFBFBD>,
a.selling_shop_code <20><><EFBFBD>̴<EFBFBD><CCB4><EFBFBD>,
a.planned_end_date <20><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>,
CASE
WHEN to_number(to_char(a.planned_end_date,
'yyyy')) = '2022' AND
a.selling_shop_code || a.tel_sale_4s_code = '00GK' THEN
'<27><><EFBFBD><EFBFBD>רҵ<D7A8><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>'
WHEN a.planned_end_date > to_date('2023-04-01 00:00:00',
'yyyy-mm-dd hh24:mi:ss') AND
(a.selling_shop_code || a.tel_sale_4s_code IN ('00EA',
'00F1',
'00G9')) THEN
'<27><><EFBFBD><EFBFBD>רҵ<D7A8><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>'
ELSE
nvl(dt.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,
z.section_office_name)
END <20><><EFBFBD><EFBFBD>,
(CASE
WHEN to_number(to_char(a.planned_end_date,
'yyyy')) = '2023' AND
nvl(dt.<2E><><EFBFBD><EFBFBD>,
y.department_name) NOT LIKE '<27><><EFBFBD><EFBFBD>֧<EFBFBD><D6A7>˾' and<6E><64>cd.memo LIKE '%<25><><EFBFBD><EFBFBD>%' OR
cd.memo LIKE '%<25><><EFBFBD><EFBFBD>%' <20><>and v.vehicle_brand IN ('<27><>˹<EFBFBD><CBB9>',
<><CEB5>',
'<27><><EFBFBD><EFBFBD>',
'С<><D0A1>',
'<27><><EFBFBD><EFBFBD>',
'<27><><EFBFBD><EFBFBD>',
'AITO',
'ARCFOX<4F><58><EFBFBD><EFBFBD>',
'<27><>˹<EFBFBD><CBB9><EFBFBD><EFBFBD><EFBFBD>й<EFBFBD><D0B9><EFBFBD>',
'<27><>˹<EFBFBD><CBB9>(<28>й<EFBFBD>)') AND
v.vin NOT IN ('LJ1E6A2UXL7744108',
'LW433B10XL1001411',
'LJ1E6A3U2L7742089',
'L1NSPGHB0MA002652') THEN
'<27><><EFBFBD><EFBFBD>Դ<EFBFBD><D4B4><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5>չ<EFBFBD><D5B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ŷ<EFBFBD><C5B7><EFBFBD><EFBFBD><EFBFBD>'
WHEN (CASE
WHEN to_number(to_char(a.planned_end_date,
'yyyy')) = '2022' AND
a.selling_shop_code || a.tel_sale_4s_code = '00GK' THEN
'<27><><EFBFBD><EFBFBD>֧<EFBFBD><D6A7>˾'
ELSE
nvl(dt.<2E><><EFBFBD><EFBFBD>,
y.department_name)
END) = '<27><><EFBFBD><EFBFBD>֧<EFBFBD><D6A7>˾' THEN
(CASE
WHEN to_number(to_char(a.planned_end_date,
'yyyy')) = '2022' AND
a.selling_shop_code || a.tel_sale_4s_code = '00GK' THEN
'<27><><EFBFBD><EFBFBD>֧<EFBFBD><D6A7>˾'
ELSE
nvl(dt.<2E><><EFBFBD><EFBFBD>,
y.department_name)
END)
WHEN <20><>cd.memo LIKE '%<25><><EFBFBD><EFBFBD>%' OR
cd.memo LIKE '%<25><><EFBFBD><EFBFBD>%' <20><> THEN
'<27><><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD>'
WHEN a.planned_end_date > to_date('2023-04-01 00:00:00',
'yyyy-mm-dd hh24:mi:ss') AND
(a.selling_shop_code || a.tel_sale_4s_code IN ('00EA',
'00F1',
'00G9')) THEN
<><CDAC>֧<EFBFBD><D6A7>˾'
ELSE
(CASE
WHEN to_number(to_char(a.planned_end_date,
'yyyy')) = '2022' AND
a.selling_shop_code || a.tel_sale_4s_code = '00GK' THEN
'<27><><EFBFBD><EFBFBD>֧<EFBFBD><D6A7>˾'
ELSE
nvl(dt.<2E><><EFBFBD><EFBFBD>,
y.department_name)
END)
END) <20><><EFBFBD>β<EFBFBD><CEB2><EFBFBD>,
qa.USAGE_XM ʹ<><CAB9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,
decode(qa.bd_type,
'1',
'<27><><EFBFBD><EFBFBD>ǿ',
'2',
'<27><><EFBFBD><EFBFBD>ҵ',
'3',
'<27><><EFBFBD>̹<EFBFBD><CCB9><EFBFBD>',
'<27><><EFBFBD><EFBFBD>') <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,
(CASE
WHEN (qa.bd_type = '1' AND nt.ecompensation_rate > 1) THEN
'<27><>'
END) <20><>Ԥ<EFBFBD><D4A4>,
x.staff_name AS <20><><EFBFBD><EFBFBD>,
bb.<2E><><EFBFBD>ִ<EFBFBD><D6B4><EFBFBD>,
cc.signature_date <20>±<EFBFBD><C2B1><EFBFBD>ǩ<EFBFBD><C7A9>ʱ<EFBFBD><CAB1>,
(SELECT hmd.<2E>ܿ<EFBFBD><DCBF><EFBFBD><EFBFBD><EFBFBD>
FROM (SELECT DISTINCT *
FROM dc_lsj_xb_hmd) hmd
WHERE hmd.vin = v.vin) <20>ܿ<EFBFBD><DCBF><EFBFBD><EFBFBD><EFBFBD>
FROM idst0.auto_agreement_t a
LEFT JOIN bb
ON bb.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> = a.policy_no
LEFT JOIN ywglxt.w_dxbd_i i
ON a.policy_no = i.bdh
LEFT JOIN idst0.motorised_vehicle_t v
ON a.policy_no = v.policy_no
LEFT JOIN ywglxt.q_auto_agreement_t qa
ON qa.policy_no = a.policy_no
LEFT JOIN idst0.auto_new_product_info_t nt
ON nt.policy_no = a.policy_no
AND nt.endorsement_no = '<27><>'
LEFT JOIN idst0.rydm_t x
ON x.staff_code = nvl(upper(i.zhjywy),
a.operator_code)
LEFT JOIN idst0.bm_t y
ON x.department_code = y.department_code
LEFT JOIN idst0.ks_t z
ON x.section_office_code = z.section_office_code
LEFT JOIN cc pt
ON pt.policy_no = a.policy_no
LEFT JOIN (SELECT DISTINCT aa.policy_no,
vv.vin,
aa.inception_date,
t.signature_date,
(pt.premium_amount - nvl(pt.tax_amount,
0)) qdbf,
(CASE
WHEN aa.inception_date - aa.issue_date >= '30' THEN
vv.vin
END) if30,
bb.<2E><><EFBFBD>ִ<EFBFBD><D6B4><EFBFBD>
FROM idst0.auto_agreement_t aa
LEFT JOIN bb
ON bb.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> = aa.policy_no
LEFT JOIN idst0.motorised_vehicle_t vv
ON vv.policy_no = aa.policy_no
LEFT JOIN idst0.auto_agreement_request_t t
ON t.policy_no = aa.policy_no
AND t.endorsement_no = '<27><>'
LEFT JOIN idst0.auto_premium_t pt
ON pt.policy_no = aa.policy_no
AND pt.endorsement_no = '<27><>'
WHERE aa.policy_no = vv.policy_no
AND aa.policy_status = '1' --and aa.product_code not in ('11022400','11023900','11024000','11024600','11026000')
AND aa.branch_company_code = '3080100'
AND (pt.premium_amount - nvl(pt.tax_amount,
0)) > 100
AND aa.inception_date >= to_date('2022-12-01 00:00:00',
'yyyy-mm-dd hh24:mi:ss')
AND aa.inception_date < to_date('2023-11-01 00:00:00',
'yyyy-mm-dd hh24:mi:ss')
AND aa.branch_company_code = vv.branch_company_code) cc
ON (cc.vin = v.vin AND cc.<2E><><EFBFBD>ִ<EFBFBD><D6B4><EFBFBD> = bb.<2E><><EFBFBD>ִ<EFBFBD><D6B4><EFBFBD>)
AND cc.inception_date > a.planned_end_date - 30 --ʱ<><CAB1><EFBFBD><EFBFBD><EFBFBD>Ʒſ<C6B7>Ϊ30<33><30>
LEFT JOIN dc_yangg_cx_dianxiaodoudi cd
ON cd.policy_no = a.policy_no
LEFT JOIN dc_tb_jc_c_tag dt
ON dt.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> = a.policy_no
LEFT JOIN idst0.auto_agreement_t aa
ON aa.policy_no = cc.policy_no
LEFT JOIN cc pt1
ON pt1.policy_no = aa.policy_no
WHERE a.policy_status = '1'
AND a.planned_end_date - a.inception_date > 270
AND a.planned_end_date >= to_date('2023-10-01 00:00:00',
'yyyy-mm-dd hh24:mi:ss')
AND a.planned_end_date < to_date('2024-01-01 00:00:00',
'yyyy-mm-dd hh24:mi:ss'))
,
aa3 AS
(SELECT DISTINCT *
FROM aa1
UNION ALL (SELECT DISTINCT *
FROM aa2))
,
AA AS
(SELECT AA3.*,
nvl<76><6C>zx.workerno,
et.telpartnercode) <20><>ϯ<EFBFBD><CFAF><EFBFBD><EFBFBD>,
(CASE WHEN nvl<76><6C>zx.workerno,
et.telpartnercode) =
'DX001' AND aa3.<2E><><EFBFBD><EFBFBD> LIKE
'%<25><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>%' THEN
'<27><>ΰ<EFBFBD><CEB0>' WHEN nvl<76><6C>zx.workerno,
et.telpartnercode) =
'DX001' AND aa3.<2E><><EFBFBD><EFBFBD> NOT LIKE
'%<25><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>%' THEN
'<27><><EFBFBD><EFBFBD>' ELSE to_char
(ys.<2E><>ϯ<EFBFBD><CFAF><EFBFBD><EFBFBD>) END) <20><>ϯ<EFBFBD><CFAF><EFBFBD><EFBFBD>,
YS.<2E>Ŷ<EFBFBD> <20><>ϯ<EFBFBD>Ŷ<EFBFBD> FROM AA3 LEFT JOIN idst0.auto_agreement_extend_t et ON et.policy_no = AA3.<2E>ɱ<EFBFBD><C9B1><EFBFBD> LEFT JOIN idst0.t_sell_policy_autobase_t zx ON zx.policy_no = AA3.<2E>ɱ<EFBFBD><C9B1><EFBFBD> LEFT JOIN dc_YZH_ZXYS YS ON YS.<2E><>ϯ<EFBFBD><CFAF><EFBFBD><EFBFBD> = nvl<76><6C>zx.workerno,
et.telpartnercode))
,
yxb AS
(
---<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SELECT aa.<2E><><EFBFBD>β<EFBFBD><CEB2><EFBFBD> <20><><EFBFBD><EFBFBD>,
aa.<2E><><EFBFBD><EFBFBD>,
aa.<2E><><EFBFBD><EFBFBD>,
aa.<2E><>ϯ<EFBFBD>Ŷ<EFBFBD>,
aa.<2E><>ϯ<EFBFBD><CFAF><EFBFBD><EFBFBD>,
aa.<2E><>ϯ<EFBFBD><CFAF><EFBFBD><EFBFBD>,
--(case when a.<2E><>ʶ='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'and A.<2E><><EFBFBD>β<EFBFBD><CEB2><EFBFBD>='<27><><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD>' then '<27><><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD>' else A.<2E><><EFBFBD><EFBFBD> end) <20><><EFBFBD><EFBFBD>,
(CASE
WHEN COUNT(1) IS NULL THEN
0
ELSE
COUNT(1)
END) <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ۼ<EFBFBD>
FROM aa
WHERE aa.ʹ<><CAB9><EFBFBD><EFBFBD><EFBFBD><EFBFBD> IN ('<27><>ͥ<EFBFBD><CDA5><EFBFBD>ó<EFBFBD>',
'<27><>ҵ<EFBFBD>ͳ<EFBFBD>')
AND aa.<2E><>Ԥ<EFBFBD><D4A4> IS NULL
AND aa.<2E>ܿ<EFBFBD><DCBF><EFBFBD><EFBFBD><EFBFBD> IS NULL
AND aa.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> IN <20><> '<27><><EFBFBD>̹<EFBFBD><CCB9><EFBFBD>', '<27><><EFBFBD><EFBFBD>ǿ' <20><>
AND aa.<2E><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1> >= to_date(to_char(SYSDATE,
'yyyy-mm') || '-01 00:00:00',
'yyyy-mm-dd hh24:mi:ss')
AND aa.<2E><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1> < to_date(to_char(SYSDATE - 1,
'yyyy-mm-dd') || ' 23:59:59',
'yyyy-mm-dd hh24:mi:ss')
AND aa.<2E>±<EFBFBD><C2B1><EFBFBD>ǩ<EFBFBD><C7A9>ʱ<EFBFBD><CAB1> <= to_date(to_char(SYSDATE - 1,
'yyyy-mm-dd') || ' 23:59:59',
'yyyy-mm-dd hh24:mi:ss')
GROUP BY aa.<2E><><EFBFBD>β<EFBFBD><CEB2><EFBFBD>,
aa.<2E><><EFBFBD><EFBFBD>,
aa.<2E><><EFBFBD><EFBFBD>,
aa.<2E><>ϯ<EFBFBD>Ŷ<EFBFBD>,
aa.<2E><>ϯ<EFBFBD><CFAF><EFBFBD><EFBFBD>,
aa.<2E><>ϯ<EFBFBD><CFAF><EFBFBD><EFBFBD>)
--<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-<2D>ۼ<EFBFBD>/<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-<2D>ۼ<EFBFBD>
,
dqs AS
(
---<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SELECT aa.<2E><><EFBFBD>β<EFBFBD><CEB2><EFBFBD> <20><><EFBFBD><EFBFBD>,
aa.<2E><><EFBFBD><EFBFBD>,
aa.<2E><><EFBFBD><EFBFBD>,
aa.<2E><>ϯ<EFBFBD>Ŷ<EFBFBD>,
aa.<2E><>ϯ<EFBFBD><CFAF><EFBFBD><EFBFBD>,
aa.<2E><>ϯ<EFBFBD><CFAF><EFBFBD><EFBFBD>,
(CASE
WHEN COUNT(1) IS NULL THEN
0
ELSE
COUNT(1)
END) <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
FROM aa
WHERE aa.ʹ<><CAB9><EFBFBD><EFBFBD><EFBFBD><EFBFBD> IN ('<27><>ͥ<EFBFBD><CDA5><EFBFBD>ó<EFBFBD>',
'<27><>ҵ<EFBFBD>ͳ<EFBFBD>')
AND aa.<2E><>Ԥ<EFBFBD><D4A4> IS NULL
AND aa.<2E>ܿ<EFBFBD><DCBF><EFBFBD><EFBFBD><EFBFBD> IS NULL
AND aa.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> IN <20><> '<27><><EFBFBD>̹<EFBFBD><CCB9><EFBFBD>', '<27><><EFBFBD><EFBFBD>ǿ' <20><>
AND aa.<2E><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1> >= to_date(to_char(SYSDATE,
'yyyy-mm') || '-01 00:00:00',
'yyyy-mm-dd hh24:mi:ss')
AND aa.<2E><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1> < to_date(to_char(SYSDATE - 1,
'yyyy-mm-dd') || ' 23:59:59',
'yyyy-mm-dd hh24:mi:ss')
GROUP BY aa.<2E><><EFBFBD>β<EFBFBD><CEB2><EFBFBD>,
aa.<2E><><EFBFBD><EFBFBD>,
aa.<2E><><EFBFBD><EFBFBD>,
aa.<2E><>ϯ<EFBFBD>Ŷ<EFBFBD>,
aa.<2E><>ϯ<EFBFBD><CFAF><EFBFBD><EFBFBD>,
aa.<2E><>ϯ<EFBFBD><CFAF><EFBFBD><EFBFBD>)
SELECT dqs.<2E><><EFBFBD><EFBFBD>,
dqs.<2E><><EFBFBD><EFBFBD>,
dqs.<2E><><EFBFBD><EFBFBD>,
dqs.<2E><>ϯ<EFBFBD>Ŷ<EFBFBD>,
dqs.<2E><>ϯ<EFBFBD><CFAF><EFBFBD><EFBFBD>,
dqs.<2E><>ϯ<EFBFBD><CFAF><EFBFBD><EFBFBD>,
yxb.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ۼ<EFBFBD>,
dqs.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
FROM yxb,
dqs --,sdqs,syxs,cyxs,cdqs
WHERE dqs.<2E><><EFBFBD><EFBFBD> = yxb.<2E><><EFBFBD><EFBFBD>
AND dqs.<2E><><EFBFBD><EFBFBD> = yxb.<2E><><EFBFBD><EFBFBD>
AND dqs.<2E><><EFBFBD><EFBFBD> = yxb.<2E><><EFBFBD><EFBFBD>
AND dqs.<2E><>ϯ<EFBFBD><CFAF><EFBFBD><EFBFBD> = yxb.<2E><>ϯ<EFBFBD><CFAF><EFBFBD><EFBFBD>
AND dqs.<2E><>ϯ<EFBFBD><CFAF><EFBFBD><EFBFBD> = yxb.<2E><>ϯ<EFBFBD><CFAF><EFBFBD><EFBFBD>;
COMMIT;
END;
PROCEDURE chefei_daily_job IS
BEGIN
<20><><EFBFBD>ǻ<EFBFBD><C7BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(SYSDATE - 3,
SYSDATE);
END;
PROCEDURE xubao_daily_job IS
BEGIN
<20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;
END;
BEGIN
NULL;
END telsale_pkg;
/

View File

@@ -0,0 +1,99 @@
CREATE OR REPLACE PACKAGE telsaler_reward_pkg IS
-- Author : WANGWEI-202
-- Created : 2023/9/13 10:05:43
-- Purpose : <20><>ϯ<EFBFBD><CFAF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>صİ<D8B5>
PROCEDURE add_telsaler_reward
(
a_reward_index VARCHAR2,
a_telsaler_name VARCHAR2
);
PROCEDURE update_telsaler_reward
(
a_rec_id INTEGER,
a_telsaler_name VARCHAR2,
a_reward_index VARCHAR2
);
PROCEDURE delete_telsaler_reward(a_rec_id INTEGER);
END telsaler_reward_pkg;
/
CREATE OR REPLACE PACKAGE BODY telsaler_reward_pkg IS
PROCEDURE add_telsaler_reward
(
a_reward_index VARCHAR2,
a_telsaler_name VARCHAR2
) IS
BEGIN
BEGIN
INSERT INTO telsaler_reward
(reward_index,
telsaler_name)
VALUES
(a_reward_index,
a_telsaler_name);
EXCEPTION
WHEN OTHERS THEN
IF SQLCODE = -00001
THEN
raise_application_error(-20001,
<>ظ<EFBFBD>');
END IF;
END;
COMMIT;
END;
PROCEDURE update_telsaler_reward
(
a_rec_id INTEGER,
a_telsaler_name VARCHAR2,
a_reward_index VARCHAR2
) IS
BEGIN
/*MERGE INTO telsaler_reward r
USING (SELECT COUNT(*) COUNT
FROM telsaler_reward
WHERE rec_id = a_rec_id) a
ON (a.count > 0)
WHEN MATCHED THEN
UPDATE
SET r.reward_index = a_reward_index,
r.telsaler_name = a_telsaler_name
WHERE r.rec_id = a_rec_id
WHEN NOT MATCHED THEN
INSERT
(reward_index,
telsaler_name)
VALUES
(a_reward_index,
a_telsaler_name);*/
BEGIN
UPDATE telsaler_reward r
SET r.reward_index = a_reward_index,
r.telsaler_name = a_telsaler_name
WHERE r.rec_id = a_rec_id;
EXCEPTION
WHEN no_data_found THEN
raise_application_error(-20002,
'<27>޴˼<DEB4>¼<EFBFBD><C2BC>');
END;
COMMIT;
END;
PROCEDURE delete_telsaler_reward(a_rec_id INTEGER) IS
BEGIN
DELETE telsaler_reward
WHERE rec_id = a_rec_id;
COMMIT;
END;
BEGIN
NULL;
END telsaler_reward_pkg;
/

View File

@@ -9,25 +9,25 @@ SELECT b.reward_name,
WHERE a.reward_index = b.reward_index;
--<EFBFBD><EFBFBD>ϯ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SELECT s.saler_code,
s.saler_name,
t.team_code,
t.team,
bm.department_code,
bm.department_name
SELECT DISTINCT s.saler_code,
s.saler_name,
t.team_code,
t.team,
bm.department_code,
bm.department_name
FROM tele_saler s,
tele_saler_team t,
idst0.bm_t bm
WHERE s.team_code = t.team_code
AND t.department_code = bm.department_code
AND s.saler_name = '<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
AND s.saler_code = '61136';
SELECT *
FROM tele_saler_team t
WHERE t.team_code = '107077'
SELECT *
FROM <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ÿ<EFBFBD>ձ<EFBFBD><EFBFBD><EFBFBD>
FROM <EFBFBD><EFBFBD>ϯ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ÿ<EFBFBD>ձ<EFBFBD><EFBFBD><EFBFBD>
ORDER BY <EFBFBD><EFBFBD>ϯ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>,
ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;
@@ -39,3 +39,39 @@ SELECT
0) || '%' <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
FROM <EFBFBD><EFBFBD>ϯ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͳ<EFBFBD><EFBFBD>
GROUP BY <EFBFBD><EFBFBD><EFBFBD><EFBFBD>;
--<EFBFBD><EFBFBD><EFBFBD>Ǹ<EFBFBD><EFBFBD><EFBFBD>ÿ<EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD>
SELECT <EFBFBD>·<EFBFBD>,
<EFBFBD><EFBFBD><EFBFBD>Ŵ<EFBFBD><EFBFBD><EFBFBD>,
<EFBFBD><EFBFBD>ϯ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>,
SUM(<EFBFBD><EFBFBD><EFBFBD>ո<EFBFBD><EFBFBD>˿ͻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>),
SUM(<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ںϱ<EFBFBD><EFBFBD><EFBFBD>),
round(SUM(<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ںϱ<EFBFBD><EFBFBD><EFBFBD>) / SUM(<EFBFBD><EFBFBD><EFBFBD>ո<EFBFBD><EFBFBD>˿ͻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) * 100,
2) <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͸<EFBFBD><EFBFBD>
FROM <EFBFBD><EFBFBD>ϯ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ÿ<EFBFBD>ձ<EFBFBD><EFBFBD><EFBFBD>
GROUP BY <EFBFBD>·<EFBFBD>,
<EFBFBD><EFBFBD><EFBFBD>Ŵ<EFBFBD><EFBFBD><EFBFBD>,
<EFBFBD><EFBFBD>ϯ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
HAVING <EFBFBD>·<EFBFBD> = '06<EFBFBD><EFBFBD>'
ORDER BY <EFBFBD><EFBFBD><EFBFBD>Ŵ<EFBFBD><EFBFBD><EFBFBD>,
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͸<EFBFBD><EFBFBD> DESC;
SELECT <EFBFBD><EFBFBD>ϯ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>,
round(SUM(<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ںϱ<EFBFBD><EFBFBD><EFBFBD>) / SUM(<EFBFBD><EFBFBD><EFBFBD>ո<EFBFBD><EFBFBD>˿ͻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) * 100,
2) <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͸<EFBFBD><EFBFBD>
FROM <EFBFBD><EFBFBD>ϯ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ÿ<EFBFBD>ձ<EFBFBD><EFBFBD><EFBFBD>
WHERE <EFBFBD><EFBFBD><EFBFBD>Ŵ<EFBFBD><EFBFBD><EFBFBD> = 'QDI'
AND <EFBFBD>·<EFBFBD> = '05'
AND <EFBFBD><EFBFBD><EFBFBD><EFBFBD> = '2023'
GROUP BY <EFBFBD><EFBFBD>ϯ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
ORDER BY <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͸<EFBFBD><EFBFBD> DESC;
--<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SELECT <EFBFBD><EFBFBD>ϯ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>,
round(nvl(SUM(<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ۼ<EFBFBD>) / SUM(<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) * 100,
0),
2) <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
FROM <EFBFBD><EFBFBD>ϯ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͳ<EFBFBD><EFBFBD> xb
WHERE xb.<EFBFBD><EFBFBD><EFBFBD><EFBFBD> = '<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
GROUP BY <EFBFBD><EFBFBD>ϯ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
ORDER BY <EFBFBD><EFBFBD>ϯ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> DESC;

View File

@@ -0,0 +1,14 @@
drop table BI<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¸<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʸ<EFBFBD><EFBFBD>ٱ<EFBFBD>;
create table BI<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¸<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʸ<EFBFBD><EFBFBD>ٱ<EFBFBD>
(
"<EFBFBD><EFBFBD><EFBFBD>β<EFBFBD><EFBFBD><EFBFBD>" varchar2(100),
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŀ<EFBFBD><EFBFBD>ֵ1(%)" number,
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><C8AB>" integer,
"<EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ռ<EFBFBD><EFBFBD>(%)" number,
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʣ<EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>(%)" number,
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʣ<EFBFBD>ȫ<EFBFBD>£<EFBFBD>(%)" number,
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(%)" number,
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(%)" number,
"ƽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǰǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" integer,
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD>" number
);

View File

@@ -0,0 +1,15 @@
drop table BI<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϯ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʸ<EFBFBD><EFBFBD>ٱ<EFBFBD>;
create table BI<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϯ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʸ<EFBFBD><EFBFBD>ٱ<EFBFBD>
(
"<EFBFBD><EFBFBD><EFBFBD>β<EFBFBD><EFBFBD><EFBFBD>" varchar2(100),
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" varchar2(30),
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŀ<EFBFBD><EFBFBD>ֵ1(%)" number default 0,
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><C8AB>" integer default 0,
"<EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ռ<EFBFBD><EFBFBD>(%)" number default 0,
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʣ<EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>(%)" number default 0,
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʣ<EFBFBD>ȫ<EFBFBD>£<EFBFBD>(%)" number default 0,
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(%)" number default 0,
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(%)" number default 0,
"ƽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǰǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" integer default 0,
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD>" number
)

View File

@@ -0,0 +1,14 @@
--drop table BI<EFBFBD><EFBFBD>ϯ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͳ<EFBFBD>Ʊ<EFBFBD>;
create table BI<EFBFBD><EFBFBD>ϯ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͳ<EFBFBD>Ʊ<EFBFBD>
(
summary_date date default sysdate not null,
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> varchar2(20) not null,
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŀ<EFBFBD><EFBFBD>ֵ NUMBER default 0 not null,
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȫ<EFBFBD><EFBFBD> NUMBER default 0 not null,
<EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ռ<EFBFBD><EFBFBD> NUMBER default 0 not null,
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ NUMBER default 0 not null,
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȫ<EFBFBD><EFBFBD> NUMBER default 0 not null,
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> NUMBER default 0 not null,
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> NUMBER default 0 not null
);
comment on table BI<EFBFBD><EFBFBD>ϯ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͳ<EFBFBD>Ʊ<EFBFBD> is '<EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD><EFBFBD><EFBFBD>BI<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϯȫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݡ<EFBFBD>';

View File

@@ -0,0 +1,14 @@
create table BI<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϯ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͸<EFBFBD>ʸ<EFBFBD><EFBFBD>ٱ<EFBFBD>
(
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD>" varchar2(100),
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD>" varchar2(100) not null,
"<EFBFBD><EFBFBD><EFBFBD>ձ<EFBFBD><EFBFBD><EFBFBD>(<28><>)" number default 0,
"<EFBFBD><EFBFBD><EFBFBD>ձ<EFBFBD><EFBFBD><EFBFBD>ռ<EFBFBD><EFBFBD>" number default 0,
"<EFBFBD>dz<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(<28><>)" number default 0,
"<EFBFBD><EFBFBD><EFBFBD>±<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͸<EFBFBD><EFBFBD>" number default 0,
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͸<EFBFBD>ʻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" number default 0,
"<EFBFBD><EFBFBD><EFBFBD>¿ͻ<EFBFBD><EFBFBD><EFBFBD>͸<EFBFBD><EFBFBD>" number default 0,
"<EFBFBD>ͻ<EFBFBD><EFBFBD><EFBFBD>͸<EFBFBD>ʻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" number default 0,
"<EFBFBD><EFBFBD><EFBFBD>³<EFBFBD><EFBFBD>ǿ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" number default 0,
"<EFBFBD>;<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" number default 0
);

View File

@@ -0,0 +1,17 @@
drop table BI<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͸<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͳ<EFBFBD>Ʊ<EFBFBD>;
create table BI<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͸<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͳ<EFBFBD>Ʊ<EFBFBD>
(
<EFBFBD><EFBFBD><EFBFBD><EFBFBD> varchar2(100) not null,
"Ŀ<EFBFBD><EFBFBD>ֵ-<2D><><EFBFBD><EFBFBD>" number default 0 not null,
Ŀ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> number default 0 not null,
"<EFBFBD><EFBFBD><EFBFBD>ձ<EFBFBD><EFBFBD><EFBFBD>" number default 0 not null,
<EFBFBD><EFBFBD><EFBFBD>ձ<EFBFBD><EFBFBD><EFBFBD>ռ<EFBFBD><EFBFBD> number default 0 not null,
"<EFBFBD>dz<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" number default 0 not null,
<EFBFBD><EFBFBD><EFBFBD>±<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͸<EFBFBD><EFBFBD> number default 0 not null,
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͸<EFBFBD>ʻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> number default 0 not null,
<EFBFBD><EFBFBD><EFBFBD>¿ͻ<EFBFBD><EFBFBD><EFBFBD>͸<EFBFBD><EFBFBD> number default 0 not null,
<EFBFBD>ͻ<EFBFBD><EFBFBD><EFBFBD>͸<EFBFBD>ʻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> number default 0 not null,
<EFBFBD><EFBFBD><EFBFBD>³<EFBFBD><EFBFBD>ǿ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> number default 0 not null,
<EFBFBD>;<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> number default 0 not null
);
comment on table BI<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͸<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͳ<EFBFBD>Ʊ<EFBFBD> is '<EFBFBD><EFBFBD><EFBFBD><EFBFBD>BIϵͳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͸<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';

View File

@@ -0,0 +1,17 @@
drop table telsaler_reward;
create table telsaler_reward
(
rec_id integer not null,
reward_index integer not null,
telsaler_name varchar2(100) not null,
telsaler_code varchar2(20)
);
CREATE OR REPLACE TRIGGER telsaler_reward_id
BEFORE INSERT ON telsaler_reward
FOR EACH ROW
BEGIN
SELECT desktop_archievement_seq.nextval
INTO :new.rec_id
FROM dual;
END;

View File

@@ -0,0 +1,28 @@
drop table <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ÿ<EFBFBD>ձ<EFBFBD><EFBFBD><EFBFBD>;
create table <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ÿ<EFBFBD>ձ<EFBFBD><EFBFBD><EFBFBD>
(
ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> DATE not null,
<EFBFBD>·<EFBFBD> VARCHAR2(10) not null,
<EFBFBD><EFBFBD><EFBFBD><EFBFBD> VARCHAR2(100) not null,
<EFBFBD><EFBFBD><EFBFBD>Ŵ<EFBFBD><EFBFBD><EFBFBD> varchar2(10) not null,
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>n VARCHAR2(100) not null,
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>n VARCHAR2(100),
<EFBFBD><EFBFBD>ϯ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> VARCHAR2(20),
<EFBFBD><EFBFBD>ϯ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> VARCHAR2(30),
<EFBFBD><EFBFBD>ϯ<EFBFBD>Ŷ<EFBFBD> VARCHAR2(100),
<EFBFBD><EFBFBD><EFBFBD>ո<EFBFBD><EFBFBD>˿ͻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> NUMBER(16,2),
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ںϱ<EFBFBD><EFBFBD><EFBFBD> NUMBER(16,2)
)
tablespace DESKTOP_ARCHIEVEMENT
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 64K
next 1M
minextents 1
maxextents unlimited
);
-- Grant/Revoke object privileges
grant select, insert, delete on <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ÿ<EFBFBD>ձ<EFBFBD><EFBFBD><EFBFBD> to DATACENTER;

View File

@@ -0,0 +1,18 @@
drop table _T;
create global temporary table _T
(
DATE not null,
VARCHAR2(10) not null,
VARCHAR2(100) not null,
varchar2(100) not null,
n VARCHAR2(100) not null,
n VARCHAR2(100),
VARCHAR2(20),
VARCHAR2(30),
VARCHAR2(100),
NUMBER(16,2),
NUMBER(16,2)
)
on commit preserve rows;
-- Grant/Revoke object privileges
grant select, insert, delete, alter on _T to DATACENTER;

View File

@@ -1,9 +1,11 @@
--INSERT INTO desktop_archievement_admin.<EFBFBD><EFBFBD>ϯ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ÿ<EFBFBD>ձ<EFBFBD><EFBFBD><EFBFBD>
WITH aa AS
(SELECT to_char(t.signature_date,
'yyyy-mm-dd') ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,
(to_char(T.signature_date,
'mm')) || '<EFBFBD><EFBFBD>' mm,
'yyyy')) the_year,
(to_char(T.signature_date,
'mm')) the_month,
t.policy_no bdh,
t.endorsement_no pdh,
qt.t_cre tid,
@@ -17,6 +19,7 @@ WITH aa AS
nt.ecompensation_rate * (pt.premium_amount - nvl(pt.tax_amount,
0)) fxbf,
z.department_name bm,
z.department_code bmdm,
CASE
WHEN (et.telpartnercode LIKE '%HC%' OR zx.workerno IN (SELECT code
FROM datacenter.dc_lsj_zx_hc)) THEN
@@ -116,8 +119,10 @@ WITH aa AS
,
dd2 AS
(SELECT ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,
mm,
the_year,
the_month,
bm,
bmdm,
<EFBFBD><EFBFBD>ϯ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>,
<EFBFBD><EFBFBD>ϯ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>,
<EFBFBD><EFBFBD>ϯ<EFBFBD>Ŷ<EFBFBD>,
@@ -136,11 +141,13 @@ dd2 AS
FROM (SELECT DISTINCT *
FROM aa) aa
GROUP BY bm,
bmdm,
CASE
WHEN pdh = '<EFBFBD><EFBFBD>' THEN
tid
END,
mm,
the_year,
the_month,
BTID,
<EFBFBD><EFBFBD>ϯ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>,
<EFBFBD><EFBFBD>ϯ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>,
@@ -150,8 +157,10 @@ dd2 AS
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>N
UNION
SELECT ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,
mm,
the_year,
the_month,
bm,
bmdm,
<EFBFBD><EFBFBD>ϯ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>,
<EFBFBD><EFBFBD>ϯ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>,
<EFBFBD><EFBFBD>ϯ<EFBFBD>Ŷ<EFBFBD>,
@@ -181,7 +190,7 @@ bb AS
to_number(to_char(q.signature_date,
'yyyy')) || '<EFBFBD><EFBFBD>' nf,
(to_char(q.signature_date,
'mm')) || '<EFBFBD><EFBFBD>' mm_f,
'mm')) mm_f,
to_char(q.signature_date,
'dd') || '<EFBFBD><EFBFBD>' dd,
q.signature_date sj,
@@ -258,11 +267,14 @@ ff AS
FROM dd
LEFT JOIN cc
ON cc.<EFBFBD>ں<EFBFBD>֤<EFBFBD><EFBFBD> = dd.tid
AND cc.mm_f = dd.mm) --OR cc.<EFBFBD>ں<EFBFBD>֤<EFBFBD><EFBFBD> = dd.btid
AND cc.mm_f = dd.the_month) --OR cc.<EFBFBD>ں<EFBFBD>֤<EFBFBD><EFBFBD> = dd.btid
--select * from ff
SELECT ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,
--mm,
SELECT to_date(ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,
'yyyy-mm-dd') ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,
the_year <EFBFBD><EFBFBD><EFBFBD><EFBFBD>,
the_month <EFBFBD>·<EFBFBD>,
bm <EFBFBD><EFBFBD><EFBFBD><EFBFBD>,
bmdm <EFBFBD><EFBFBD><EFBFBD>Ŵ<EFBFBD><EFBFBD><EFBFBD>,
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>N,
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>N,
<EFBFBD><EFBFBD>ϯ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>,
@@ -273,16 +285,26 @@ SELECT ǩ
nvl(SUM(<EFBFBD>ںϱ<EFBFBD><EFBFBD><EFBFBD>),
0) <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ںϱ<EFBFBD><EFBFBD><EFBFBD>
FROM ff
WHERE ff.ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> = '2023-03-09'
WHERE to_date(ff.ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,
'yyyy-mm-dd') >= DATE '2023-06-01'
AND to_date(ff.ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,
'yyyy-mm-dd') < DATE '2023-07-01'
AND bm IN ('<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>',
'<EFBFBD><EFBFBD><EFBFBD><EFBFBD>֧<EFBFBD><EFBFBD>˾')
GROUP BY ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,
mm,
the_year,
the_month,
bm,
bmdm,
<EFBFBD><EFBFBD>ϯ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>,
<EFBFBD><EFBFBD>ϯ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>,
<EFBFBD><EFBFBD>ϯ<EFBFBD>Ŷ<EFBFBD>,
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>N,
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>N
ORDER BY <EFBFBD><EFBFBD><EFBFBD><EFBFBD>,
<EFBFBD><EFBFBD>ϯ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD>ϯ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>;
/*
SELECT *
FROM desktop_archievement_admin.<2E><>ϯ<EFBFBD><CFAF><EFBFBD><EFBFBD>ÿ<EFBFBD>ձ<EFBFBD><D5B1><EFBFBD>;
*/

View File

@@ -0,0 +1,259 @@
with aa1 as (select
to_char(t.signature_date,'yyyy-mm-dd') 签发日期
,t.policy_no 保单号_车险
,qt.t_cre TID
,qt.b_cre BTID
,V.PLATE_NUMBER 车牌号
from
idst0.auto_agreement_request_t t
left join idst0.auto_agreement_t e on e.policy_no = t.policy_no
left join idst0.motorised_vehicle_t v on v.policy_no = e.policy_no
left join idst0.auto_premium_t pt on pt.policy_no = t.policy_no and pt.endorsement_no = t.endorsement_no
left join ywglxt.w_dxbd_i i on e.policy_no = i.bdh
left join idst0.rydm_t xx on xx.staff_code = nvl(i.zhjywy,e.operator_code)
left join idst0.ks_t y on y.section_office_code = nvl(xx.section_office_code,e.section_office_code)
left join idst0.bm_t z on z.department_code = nvl(xx.department_code,e.department_code)
--left join ywglxt.q_auto_agreement _extend_t qe on qe.policy_no = e.policy_no
left join ywglxt.q_auto_agreement_t qt on qt.policy_no = e.policy_no
left join dc_tb_jc_c_tag cl on cl.保单号 = e.policy_no
--left join dc_yangg_basecode_teams fg on fg.bm = z.department_name and fg.ks = y.section_office_name
left join idst0.auto_agreement_extend_t et on et.policy_no = e.policy_no
left join idst0.t_sell_policy_autobase_t zx on zx.policy_no = e.policy_no
left join dc_YZH_ZXYS YS ON YS.坐席工号= nvlzx.workerno,et.telpartnercode)
where
t.signature_date >= sysdate-365
AND t.signature_date < sysdate+90
and e.policy_status = '1' --条件:保单有效
--AND V.PLATE_NUMBER='LVHRM1810F5024561'
and qt.tflag = '0' --条件:类型为个人
--AND qt.t_cre='440881198901110216'
and t.endorsement_no='无'
and qt.usage_xm = '家庭自用车'
and e.planned_end_date - e.inception_date >= 360 --条件:保单周期
and et.LICENSEOWNERCERTIFICATETYPE not in ('17','15','13')
)
,DD2 AS
(SELECT AA1.签发日期,AA1.TID 证件号,AA1.保单号_车险 FROM AA1
union
SELECT AA1.签发日期,AA1.BTID 证件号,AA1.保单号_车险 FROM AA1 )
--select * from dd2
,dd3 AS (SELECT DISTINCT DD2.证件号,dd2.保单号_车险,
case when DD2.证件号 is not null then row_number() over (partition by DD2.证件号 order by DD2.签发日期 desc) else 1 end Crow_no1 FROM DD2 )
,dd4 AS (SELECT DISTINCT AA1.车牌号,AA1.保单号_车险,
case when AA1.车牌号 is not null then row_number() over (partition by AA1.车牌号 order by AA1.签发日期 desc) else 1 end Crow_no2 FROM aa1 )
--,dd as (
--select dd2.*
--,case when DD2.TID is not null then row_number() over (partition by DD2.TID order by DD2.签单日期 desc) else 1 end Crow_no
--from dd2)
,dd5 AS (SELECT DD3.证件号,dd3.保单号_车险 from dd3 where dd3.Crow_no1='1')
,dd6 AS (SELECT DD4.车牌号,dd4.保单号_车险 from dd4 where dd4.Crow_no2='1')
,bb as (
select
'非车' 条线名称
,to_char(q.signature_date,'yyyy-mm-dd') 签发日期
,nvl(dd5.保单号_车险,dd6.保单号_车险) 保单号_车险
,q.policy_no 保单号_非车
--,q.endorsement_no pdh
,qna.t_cre tid
,qna.B_cre Btid
,(case when nvl(dd5.保单号_车险,dd6.保单号_车险)IS NOT NULL THEN '是' else '' end )是否分公司融合
--,'' 客户数_分公司
--,qna.tbrmc 投保人名称
,JYX.LICENSE_PLATE_NO 车牌号
,round((pt.premium_amount-nvl(pt.taxamount,0))*c.rate/100,2) 车险签发保费
,x.staff_name 经办姓名
,X.STAFF_CODE 经办代码
,y.section_office_name 科室名称
,z.department_name 部门
,(case when nvlzx.workerno,et.telpartnercode) = 'DX001' and x.staff_name like '%建发凯迪%' then '林伟华'
when nvlzx.workerno,et.telpartnercode) = 'DX001' and x.staff_name not like '%建发凯迪%' then '其他'
when x.staff_name like '%建发汽车续保%' then '林伟华'
when x.staff_name like '%建发凯通泰成续保%' and e.planned_end_date < to_date('2023-09-30 00:00:00', 'yyyy-mm-dd hh24:mi:ss') then '李定定'
when x.staff_name like '%建发凯通泰成续保%' then '周阳'
else to_char(ys.坐席姓名) END) 坐席名称
,nvlzx.workerno,et.telpartnercode) 坐席代码
,YS.团队 坐席团队
,cl.管理渠道21版 管理渠道
,cl.新转续 ntr
,(select AUTO_NAME from idst0.auto_store_t where auto_code = qna.AGENT_CODE) dldmc
,(case when gk.product_name like '%驾乘%' or gk.product_code in'23XZ9800','23YZ9800') THEN '1' ELSE '' END) 是否驾乘
,'' 车商代码
,'' 品牌
,qna.life_salesperson 寿险代码
,nvl(ca.plan_name,ra.plan_name) 产品方案名称
,E.INCEPTION_DATE 起保日期
--,QNA.PRODUCT_CODE 险种代码
FROM
idst0.nonauto_agreement_request_t q
left join idst0.nonauto_agreement_t e on e.policy_no = q.policy_no
left join idst0.nonauto_premium_t pt on pt.endorsement_no = q.endorsement_no and pt.policy_no = q.policy_no
--left join idst0.reinsurance_t r on r.reinsurance_policy_no = e.policy_no
left join idst0.exrate_month_t c on pt.currency_code = c.bzh
and to_char(q.signature_date,'YYYY') = c.theyear and to_char(q.signature_date,'fmmm') = c.themonth
left join idst0.rydm_t x on x.staff_code = e.operator_code
left join idst0.ks_t y on y.section_office_code = x.section_office_code
left join idst0.bm_t z on z.department_code = x.department_code
left join ywglxt.q_nonauto_agreement_t qna on qna.policy_no = q.policy_no
left join dc_yangg_gkxzh gk on gk.product_code = e.product_code --分散型险种
left join dd5 on dd5.证件号 = qna.t_cre
left join IDst0.nonauto_vehicle_info_t JYX ON JYX.POLICY_NO=q.policy_no
left join dd6 on dd6.车牌号 = JYX.LICENSE_PLATE_NO
left join idst0.auto_agreement_extend_t et on et.policy_no = e.policy_no
left join idst0.T_SELL_POLICY_PROPERTY_INFO_T zx on zx.policy_no = e.policy_no
left join dc_YZH_ZXYS YS ON YS.坐席工号= nvlzx.workerno,et.telpartnercode)
left join dc_tb_jc_c_tag cl on cl.保单号 = nvl(dd5.保单号_车险,dd6.保单号_车险)
left join idst0.ryx_agreement_t ra on ra.policy_no = e.policy_no
left join idst0.cibs_agreement_t ca on ca.policy_no = e.policy_no
--left join (SELECT CX.POLICY_NO,CX.LIFE_SALESPERSON,CX.VEHICLE_BRAND FROM ywglxt.q_Auto_Agreement_t CX) cx on cx.policy_no=rmi.保单号_车险
--left join ywglxt.v_xzh xzh on xzh.product_code = e.product_code
--left join ywglxt.q_auto_agreement_t qtt on qtt.plate_number = JYX.LICENSE_PLATE_NO 剔除车非不是家用车
where
qna.tflag = '0'
and (case when q.endorsement_no !='无' and round((pt.premium_amount-nvl(pt.taxamount,0))*c.rate/100,2) !=0 then '是' end) is null
--and q.endorsement_no = '无'
and nvl(dd5.证件号,dd6.车牌号) is not null
and q.signature_date >= sysdate-5
AND q.signature_date < sysdate
--AND qna.t_cre='350623198706075199'
--and (case when JYX.LICENSE_PLATE_NO is not null and qtt.usage_xm='家庭自用车' then '是' when JYX.LICENSE_PLATE_NO is null then '是' end )IS NOT NULL 剔除车非不是家用车
and e.policy_status = '1'
and gk.product_code is not null
and (e.product_code like '2%' or e.product_code like '1106%' --意健 --责任
or e.product_code like '1107%' or e.product_code like '1108%' or e.product_code like '1307%' or e.product_code like '1304A400%' --家财
)
--AND qna.policy_no='AXIMQDI30V23FP0062SH'
)
,BB3 AS (SELECT bb.tid ,COUNT(*) 次数 from bb group by bb.tid )
,bb2 as (
select bb.*
,case when bb.是否驾乘 ='1' then row_number() over (partition by bb.tid,bb.是否驾乘 order by bb.签发日期 desc) else 1 end JCrow_no
,case when bb.tid IS not NULL then row_number() over (partition by bb.tid order by bb.签发日期 desc) else 1 end CFrow_no
,BB3.次数
from BB
LEFT JOIN BB3 ON BB3.tid =bb.tid
)
,BB4 AS(select bb2.*
,(CASE when bb2.次数='1' THEN '1'
WHEN bb2.次数 = '2' and BB2.是否驾乘 ='1' and jcROW_NO ='1' then '1'
-- WHEN bb2.次数 = '2' and BB2.是否驾乘 is null and CFROW_NO ='2' then '0'
WHEN bb2.次数 = '2' and BB2.是否驾乘 is null and CFROW_NO ='1' then '1'
WHEN bb2.次数 > '2' AND cfROW_NO ='1' then '1' --BB2.是否驾乘 ='1' and
-- WHEN bb2.次数 > '2' AND BB2.是否驾乘 IS NULL THEN '1'--AND CFROW_NO ='1'
ELSE '0' END ) 客户数
from bb2
/*,ff AS(
SELECT
to_char(rmi.签发日期,'yyyy-mm-dd') 签发日期
,RMI.保单号_车险
,rmi.保单号_非车
,rmi.车险签发保费
,RMI.条线名称
,RMI.是否分公司融合
,RMI.客户数_分公司
,cl.经办姓名
,CL.科室名称
,CL.部门
,(case when nvlzx.workerno,et.telpartnercode) = 'DX001' and cl.经办姓名 like '%建发凯迪%' then '林伟华'
when nvl(zx.workerno,et.telpartnercode) = 'DX001' and cl.经办姓名 not like '%建发凯迪%' then '其他'
else to_char(ys.坐席姓名) END) 坐席名称
,YS.团队 坐席团队
,cl.管理渠道21版 管理渠道
,cl.新转续 ntr
,(select AUTO_NAME from idst0.auto_store_t where auto_code = nvl(e.selling_shop_code,e.tel_sale_4s_code)) dldmc
FROM DC_CF_RMI rmi
left join idst0.auto_agreement_t e on e.policy_no = rmi.保单号_车险
left join dc_tb_jc_c_tag cl on cl.保单号 = e.policy_no
--left join dc_yangg_basecode_teams fg on fg.bm = z.department_name and fg.ks = y.section_office_name
left join idst0.auto_agreement_extend_t et on et.policy_no = e.policy_no
left join idst0.t_sell_policy_autobase_t zx on zx.policy_no = e.policy_no
left join dc_YZH_ZXYS YS ON YS.坐席工号= nvlzx.workerno,et.telpartnercode))*/
,aa as (select
'车险' 条线名称
,to_char(t.signature_date,'yyyy-mm-dd') 签发日期
,t.policy_no 保单号_车险
--,t.endorsement_no pdh
,'' 保单号_非车
,'' 是否分公司融合
,(case when qt.bd_type in ('1','2') THEN '1'
when qt.bd_type = '3' and qt.xzh_xm='商业险' then '1' ELSE '0'END )客户数_分公司
--,decode(qT.bd_type,'1','单交强','2','单商业','3','交商共保','其它') 保单类型
,qt.t_cre TID
,qt.b_cre BTID
--,QT.TBRMC 投保人名称
,V.PLATE_NUMBER 车牌号
,pt.premium_amount - nvl(pt.tax_amount,0) 车险签发保费
,xx.staff_name 经办姓名
,XX.STAFF_CODE 经办代码
,y.section_office_name 科室名称
,z.department_name 部门
,(case when nvlzx.workerno,et.telpartnercode) = 'DX001' and xx.staff_name like '%建发凯迪%' then '林伟华'
when nvl(zx.workerno,et.telpartnercode) = 'DX001' and xx.staff_name not like '%建发凯迪%' then '其他'
when xx.staff_name like '%建发汽车续保%' then '林伟华'
when xx.staff_name like '%建发凯通泰成续保%' and e.planned_end_date < to_date('2023-09-30 00:00:00', 'yyyy-mm-dd hh24:mi:ss') then '李定定'
when xx.staff_name like '%建发凯通泰成续保%' then '周阳'
else to_char(ys.坐席姓名) END) 坐席名称
,nvl(zx.workerno,et.telpartnercode) 坐席代码
,YS.团队 坐席团队
,cl.管理渠道21版 管理渠道
,cl.新转续 ntr
,(select AUTO_NAME from idst0.auto_store_t where auto_code = nvl(e.selling_shop_code,e.tel_sale_4s_code)) dldmc
,e.selling_shop_code 车商代码
,qt.life_salesperson 寿险代码
,QT.VEHICLE_BRAND 品牌
,'' 产品方案名称
,E.INCEPTION_DATE 起保日期
--,QT.PRODUCT_CODE 险种代码
from
idst0.auto_agreement_request_t t
left join idst0.auto_agreement_t e on e.policy_no = t.policy_no
left join idst0.motorised_vehicle_t v on v.policy_no = e.policy_no
left join idst0.auto_premium_t pt on pt.policy_no = t.policy_no and pt.endorsement_no = t.endorsement_no
left join ywglxt.w_dxbd_i i on e.policy_no = i.bdh
left join idst0.rydm_t xx on xx.staff_code = nvl(i.zhjywy,e.operator_code)
left join idst0.ks_t y on y.section_office_code = nvl(xx.section_office_code,e.section_office_code)
left join idst0.bm_t z on z.department_code = nvl(xx.department_code,e.department_code)
--left join ywglxt.q_auto_agreement _extend_t qe on qe.policy_no = e.policy_no
left join ywglxt.q_auto_agreement_t qt on qt.policy_no = e.policy_no
left join dc_tb_jc_c_tag cl on cl.保单号 = e.policy_no
--left join dc_yangg_basecode_teams fg on fg.bm = z.department_name and fg.ks = y.section_office_name
left join idst0.auto_agreement_extend_t et on et.policy_no = e.policy_no
left join idst0.t_sell_policy_autobase_t zx on zx.policy_no = e.policy_no
left join dc_YZH_ZXYS YS ON YS.坐席工号= nvlzx.workerno,et.telpartnercode)
where
t.signature_date >= sysdate-5
AND t.signature_date < sysdate
AND e.policy_status = '1' --条件:保单有效
--AND qt.t_cre='350623198706075199'
and qt.tflag = '0' --条件:类型为个人
and t.endorsement_no='无'
and qt.usage_xm = '家庭自用车'
and e.planned_end_date - e.inception_date >= 360 --条件:保单周期
and et.LICENSEOWNERCERTIFICATETYPE not in ('17','15','13')
--AND e.policy_no='AXIMC01Y2023B015820W'
)
select "签发日期","保单号_车险","保单号_非车","条线名称","是否分公司融合","客户数","车险签发保费","经办姓名","经办代码","科室名称","部门","坐席名称","坐席代码","坐席团队","管理渠道","NTR","DLDMC","车商代码","寿险代码","品牌","产品方案名称","起保日期","车牌号"
from bb4
UNION
select "签发日期","保单号_车险","保单号_非车","条线名称","是否分公司融合","客户数_分公司","车险签发保费","经办姓名","经办代码","科室名称","部门","坐席名称","坐席代码","坐席团队","管理渠道","NTR","DLDMC","车商代码","寿险代码","品牌","产品方案名称","起保日期","车牌号"
from AA
--UNION
--Select "签发日期","保单号_车险","保单号_非车","条线名称","是否分公司融合","客户数_分公司","车险签发保费","经办姓名","科室名称","部门","坐席名称","坐席团队","管理渠道","NTR","DLDMC"
--from ff

View File

@@ -67,25 +67,28 @@ module.exports = {
js: "espree",
"<template>": "espree",
},
project: "./tsconfig.json",
extraFileExtensions: [".vue",],
},
plugins: ["eslint-plugin-vue",],
extends: [
"plugin:vue/vue3-essential",
"plugin:vue/recommended",
"eslint:recommended",
"standard-with-typescript",
"standard-with-typescript",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
],
rules: {
indent: ["warn", 4,],
"no-trailing-spaces": ["error", {"ignoreComments": true,},],
// 圆括号中的空格,为空不加空格,紧跟花括号、方括号、圆括号时也不加入空格
"space-in-parens": ["error", "always", { exceptions: ["{}", "[]", "()", "empty",], },],
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
"no-unused-vars": "warn",
semi: ["error", "always",], // 控制行尾部分号
quotes: ["error", "double",],
"semi-spacing": ["error", {"before": false, "after": true,},], // 控制行尾部分号
"quotes": ["error", "double",],
"comma-dangle": ["error", {
arrays: "always",
objects: "always",
@@ -109,6 +112,7 @@ module.exports = {
"vue/html-indent": ["error", 4,],
// typescript
"@typescript-eslint/indent": ["warn", 4,],
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-extra-semi": "off",
"@typescript-eslint/no-inferrable-types": "off",
"@typescript-eslint/no-unused-vars": "warn",
@@ -149,10 +153,12 @@ module.exports = {
"plugin:@typescript-eslint/recommended",
],
rules: {
"no-trailing-spaces": ["error", {"ignoreComments": true,},],
// 圆括号中的空格,为空不加空格,紧跟花括号、方括号、圆括号时也不加入空格
"space-in-parens": ["error", "always", { exceptions: ["{}", "[]", "()", "empty",], },],
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/indent": ["error", 4,],
"@typescript-eslint/no-extra-semi": "off",
"@typescript-eslint/no-inferrable-types": "off",
@@ -188,6 +194,7 @@ module.exports = {
"prefer-const": "warn",
"spaced-comment": "error",
"space-before-function-paren": "off",
"semi-spacing": ["error", {"before": false, "after": true,},],
},
},
],

File diff suppressed because it is too large Load Diff

View File

@@ -1,38 +1,40 @@
{
"name": "task_schedule",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview"
},
"dependencies": {
"@babel/eslint-parser": "^7.21.3",
"@element-plus/icons-vue": "^2.1.0",
"@typescript-eslint/eslint-plugin": "^5.58.0",
"@typescript-eslint/parser": "^5.58.0",
"axios": "^1.3.5",
"babel": "^6.23.0",
"echarts": "^5.4.2",
"element-plus": "^2.3.3",
"moment": "^2.29.4",
"vue": "^3.2.47",
"vue-router": "^4.1.6",
"vuex": "^4.1.0"
},
"devDependencies": {
"@babel/eslint-parser": "^7.21.3",
"@vitejs/plugin-vue": "^4.1.0",
"@vue/cli-plugin-eslint": "^5.0.8",
"eslint": "^8.38.0",
"eslint-config-recommended": "^4.1.0",
"eslint-config-standard-with-typescript": "^34.0.1",
"eslint-plugin-vue": "^9.10.0",
"sass": "^1.62.0",
"typescript": "^5.0.4",
"vite": "^4.2.1",
"vue-eslint-parser": "^9.1.1"
}
"name": "task_schedule",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview"
},
"dependencies": {
"@element-plus/icons-vue": "^2.1.0",
"echarts": "^5.4.3",
"element-plus": "^2.4.1",
"mitt": "^3.0.1",
"moment": "^2.29.4",
"sass-loader": "^13.3.2",
"vue": "^3.3.6",
"vue-router": "^4.2.5",
"vuex": "^4.1.0"
},
"devDependencies": {
"@babel/eslint-parser": "^7.22.15",
"@rushstack/eslint-patch": "^1.5.1",
"@typescript-eslint/eslint-plugin": "^6.8.0",
"@vitejs/plugin-vue": "^4.4.0",
"@vue/cli-plugin-eslint": "^5.0.8",
"@vue/eslint-config-typescript": "^12.0.0",
"axios": "^1.5.1",
"babel": "^6.23.0",
"eslint-config-recommended": "^4.1.0",
"eslint-config-standard-with-typescript": "^39.1.1",
"eslint-plugin-vue": "^9.17.0",
"node-sass": "^9.0.0",
"sass": "^1.69.4",
"style-loader": "^3.3.3",
"ts-node": "^10.9.1",
"vue-eslint-parser": "^9.3.2"
}
}

View File

@@ -2,7 +2,7 @@
* @Author: Kane
* @Date: 2023-02-15 09:25:52
* @LastEditors: Kane
* @LastEditTime: 2023-03-17 14:31:14
* @LastEditTime: 2023-08-25 10:53:30
* @FilePath: /task_schedule/src/App.vue
* @Description:
* 应用的框架
@@ -17,7 +17,7 @@
</template>
<script lang="ts">
import zhCn from "element-plus/lib/locale/lang/zh-cn"; // element-plus语言组件
import zhCn from "element-plus/es/locale/lang/zh-cn"; // element-plus语言组件
export default {
name: "App",

View File

@@ -0,0 +1,56 @@
/*
* @Author: Kane
* @Date: 2023-02-24 09:36:08
* @LastEditors: Kane
* @LastEditTime: 2023-06-15 15:50:00
* @FilePath: /task_schedule/src/assets/css/public/_public.scss
* @Description: 公共变量
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
//背景色
$wrap-bg-color:#fff;
$span-font-color:#5f5f5f;
//阴影
$box-shadow:0px 0px 20px -10px rgb(14 18 22 / 25%);
$box-shadow-hover:0px 0px 20px -10px rgb(14 18 22 / 50%);
//文字大小
$font-size-normal:14px;
//查询框
@mixin query-box-wrap {
padding: 0px 10px;
span {
font-weight: normal;
display: block;
text-align: right;
font-size: $font-size-normal;
color: $span-font-color;
}
:deep(.el-row) {
display: flex;
align-items: center;
justify-content: left;
}
.el-row+.el-row {
margin-top: 10px;
}
.button-wrapper-right {
display: flex;
justify-content: right;
align-items: center;
}
.button-wrapper-left {
display: flex;
justify-content: left;
align-items: center;
}
}

View File

@@ -29,11 +29,13 @@ export default {
setup( props )
{
const ui = reactive({
mensualList: [],
});
// 设置图表
const initCharts = () =>
const initCharts = (): void =>
{
console.log( "每月业绩", props.chartData );
const chartDom = document.getElementById( "chartWrapper" );
const myChart = echarts.init( chartDom as HTMLDivElement );
const option = {
@@ -43,7 +45,7 @@ export default {
},
yAxis: {
type: "value",
data: [200, 400, 600, 800, 1000,],
data: [400, 600, 800, 1000, 1200,],
},
series: [
{
@@ -53,7 +55,7 @@ export default {
],
};
option && myChart.setOption( option );
myChart.setOption( option );
window.onresize = function ()
{

View File

@@ -0,0 +1,166 @@
<!--
* @Author: Kane
* @Date: 2023-08-30 14:08:57
* @LastEditors: Kane
* @FilePath: /task_schedule/src/components/CallerArchievementComponent.vue
* @Description:
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
-->
<template>
<div class="caller-archievment-wrapper">
<h1>{{ CallerName }}</h1>
<table>
<tr>
<th>当月保费</th><td>{{ PresentMonthPremium }}&nbsp;万元</td>
</tr>
<tr>
<th>车非渗透率</th><td>{{ props.attachingRate }}%</td>
</tr>
<tr>
<th>续保率</th><td>{{ props.renewalRate }}%</td>
</tr>
</table>
</div>
</template>
<script lang="ts">
import { computed } from "vue";
interface CallerArchievementComponentUI
{
callerName: string,
thisMonthPremium: number,
attachingRate: string,
renewalRate: string,
}
export default {
name: "CallerArchievementComponent",
props: {
callerName: {
type: String,
require: true,
default: (): string => "",
},
thisMonthPremium: {
type: Number,
require: true,
default: (): number => 0,
},
attachingRate: {
type: String,
require: true,
default: (): string => "0.0",
},
renewalRate: {
type: String,
require: true,
default: (): string => "0.0",
},
},
setup( props )
{
const ui: CallerArchievementComponentUI = {
callerName: "",
thisMonthPremium: 0,
attachingRate: "0.0",
renewalRate: "0.0",
};
const PresentMonthPremium = computed((): string =>
{
return ( props.thisMonthPremium / 10000 ).toFixed( 2 );
});
const CallerName = computed((): string =>
{
return props.callerName;
});
return {
CallerName,
PresentMonthPremium,
ui,
props,
};
},
};
</script>
<style scoped lang="scss">
.caller-archievment-wrapper
{
width: 300px;
height: 120px;
border-radius: 5px;
margin-bottom: 30px;
display: flex;
flex-direction: column;
justify-content: flex-start;
align-items: center;
background-color: #fff;
color: #4f4f4f;
font-size: 15px;
h1 {
background-color: #fecb96;
width: 100%;
text-align: center;
border-radius: 5px 5px 0px 0px;
margin: 0px;
padding: 5px 0px;
color: #da3703;
font: {
size: 1.2rem;
weight: 100;
family: "FZ-ZHUOHEI";
}
}
table {
border-collapse: collapse;
border-radius: 0px 0px 5px 5px;
width: 100%;
margin-top: 5px;
background-color: #ffffff;
font: {
size: 14px;
}
th,td {
padding: 9px;
border-bottom: 1.5px solid #ebeef5;
}
th {
width: 5.2rem;
text-align: right;
}
th.caller-name {
text-align: center;
background-color: yellow;
}
td {
text-align: left;
}
tr:nth-child(even) {
background-color: #f5f6f7;
}
tr:last-child td,th {
border-bottom: none;
}
}
}
</style>

View File

@@ -15,8 +15,8 @@
alt=""
>
<div class="title-wrapper">
<span>"消7灭6"突围战</span>
<span>月入营坐席</span>
<span>"消8灭70"突围战</span>
<span>{{ props.month }}月入营坐席</span>
</div>
</div>
</div>
@@ -37,9 +37,9 @@ export default {
default: () => [],
},
},
setup()
setup( props )
{
return {};
return { props, };
},
};
</script>

View File

@@ -157,6 +157,7 @@ export default {
display: inline-block;
text-align: center;
color: #fff;
margin-top: 0px;
font: {
size: 1.5rem;

View File

@@ -0,0 +1,166 @@
<!--
* @Author: Kane
* @Date: 2023-06-06 11:01:01
* @LastEditors: Kane
* @FilePath: /task_schedule/src/components/RankingListComponent.vue
* @Description: 排行榜组件
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
-->
<template>
<div class="rankinglist-wrapper">
<div class="rankinglist-title">
<span>{{ props.title }}</span>
</div>
<el-table
:data="topFive"
stripe
style="width:100%;"
:header-cell-style="{background:'#fecb96'}"
>
<el-table-column
label="名次"
width="60"
align="center"
>
<template #default="ranking">
<span class="rankinglist-index">{{ ranking.row.index }}</span>
</template>
</el-table-column>
<el-table-column
label="名称"
width="160"
align="center"
>
<template #default="ranking">
<span class="rankinglist-index">{{ ranking.row.callerName }}</span>
</template>
</el-table-column>
<el-table-column
label="指标"
width="80"
align="center"
>
<template #default="ranking">
<span class="rankinglist-index">{{ ranking.row.appraiseValue }}</span>
</template>
</el-table-column>
</el-table>
</div>
</template>
<script lang="ts">
/* eslint-disable */
import { computed } from "vue";
interface RankingListItem
{
index: number;
callerName: string;
appraiseValue: string;
}
export default {
name: "RankingListComponent",
props: {
title: {
type: String,
require: true,
default: () => "",
},
rankingList: {
type: Array,
require: true,
default: () => [],
},
},
/**
* setup函数
* @param props 组件的props属性。
*/
setup(props)
{
/**
* 计算对象用于获取top5.
*/
const topFive = computed(() =>
{
const rankingList = props.rankingList; // eslint-disable-line
rankingList.sort((a, b) =>
{
// @ts-ignore
return a.index - b.index;
});
return rankingList.slice(0, 5);
});
return { props, topFive, };
},
};
</script>
<style lang="scss" scoped>
.rankinglist-wrapper {
// border: 1px solid red;
border-radius: 5px;
width: 300px;
height: 270px;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
margin-bottom: 15px;
}
.rankinglist-index {
display: block;
text-align: center;
}
:deep(.el-table)
{
border-radius: 0px 0px 5px 5px;
}
:deep(.el-table__header-wrapper) {
thead {
th{
div{
// font-family: "FZ-ZHUOHEI";
font-weight: 500;
font-size: 15px;
color: #da3703;
}
}
}
}
.rankinglist-title {
color: #da3703;
background-color: #fecc96;
width: 100%;
border-radius: 5px 5px 0px 0px;
height: 1.5rem;
display: flex;
justify-content: center;
align-items: center;
padding-top: 10px;
padding-bottom: 0px;
span {
font: {
size: 1rem;
weight: 700;
}
}
}
</style>

View File

@@ -42,42 +42,44 @@ export default {
};
</script>
<style lang="scss" scoped>
.layout-container {
height: 100vh;
width: 100vw;
max-height: 100vh;
max-width: 100vw;
.layout-header {
height: 50px;
@media screen {
.layout-container {
height: 100vh;
width: 100vw;
max-height: 50px;
max-height: 100vh;
max-width: 100vw;
padding: 0px;
}
.layout-header {
height: 50px;
width: 100vw;
max-height: 50px;
max-width: 100vw;
.layout-container-down {
height: calc(100vh - 50px);
max-height: calc(100vh - 50px);
width: 100vw;
max-width: 100vw;
.layout-aside {
height: calc(100vh - 50px);
max-height: calc(100vh - 50px);
min-height: calc(100vh - 50px);
width: 200px;
overflow-x: hidden;
background-color: #2f4156;
padding: 0px;
}
.layout-main {
padding: 0px;
.layout-container-down {
height: calc(100vh - 50px);
width: calc( 100vw - 200px );
max-height: calc(100vh - 50px);
width: 100vw;
max-width: 100vw;
.layout-aside {
height: calc(100vh - 50px);
max-height: calc(100vh - 50px);
min-height: calc(100vh - 50px);
width: 200px;
overflow-x: hidden;
background-color: #2f4156;
}
.layout-main {
padding: 0px;
height: calc(100vh - 50px);
width: calc(100vw - 200px);
}
}
}
}

View File

@@ -116,7 +116,7 @@ export default {
width: 100%;
}
.el-menu {
:deep(.el-menu) {
border-right: none;
/* border-left: 5px solid #1d74b2; */
overflow: auto;

View File

@@ -11,8 +11,8 @@
<div class="header-wrapper">
<span class="company-name">CPIC</span>
<div class="version-wrapper">
<span>测试版</span>
<span>Build-202303251257</span>
<span>桌面霸屏后台管理</span>
<span>Build-20230915</span>
</div>
<div class="buttons-wrapper">
<component
@@ -35,7 +35,7 @@ export default {
/**
* 退出登录
*/
const Logout = ():void =>
const Logout = (): void =>
{
ElMessageBox.confirm(
"是否要退出系统?",
@@ -46,11 +46,12 @@ export default {
type: "warning",
}
)
.then(() =>
.then((): void =>
{
// debugger;
logout();
});
})
.catch((): void => {});
};
return { Logout, };
@@ -91,7 +92,11 @@ export default {
align-items: start;
font: {
size: 0.5rem;
size: 0.75rem;
}
>*+* {
margin-top: 1px;
}
}

View File

@@ -11,7 +11,7 @@
* @Author: Kane
* @Date: 2023-01-04 11:40:03
* @LastEditors: Kane
* @LastEditTime: 2023-03-27 18:19:35
* @LastEditTime: 2023-09-27 11:19:05
* @FilePath: /it-console/src/layout/components/Main.vue
* @Description:
*
@@ -37,6 +37,6 @@ export default {
.el-scrollbar {
height: 100%;
width: 100%;
background-color: #ecf2f9;
/* background-color: #ecf2f9; */
}
</style>

View File

@@ -62,22 +62,31 @@ const routes = [
component: ()=> import( "../layout/Index.vue" ),
children:[
{
path:"/staff_data",
name:"StaffDataManagement",
path:"/telsaler_data",
name:"TelsalerManagement",
meta: {
title:"坐席管理",
icon: "user",
},
component: ()=> import( "../views/StaffManagement.vue" ),
component: ()=> import( "../views/telsaler/TelsalerManagementView.vue" ),
},
{
path:"/archievement_data",
name:"ArchievementDataManagement",
path: "/data_management",
name: "DataManagement",
meta: {
title:"数据管理",
title: "数据管理",
icon: "document",
},
component: ()=> import( "../views/DataManagement.vue" ),
component: ()=> import( "../views/data/DataManagement.vue" ),
},
{
path:"/reward_management",
name:"RewardManagement",
meta: {
title:"奖励管理",
icon: "document",
},
component: ()=> import( "../views/RewardManagement.vue" ),
},
],
},

View File

@@ -1,6 +1,6 @@
/*
* @Author: Kane
* @Date: 2023-03-02 15:48:44
* @Date: 2023-04-27 15:29:10
* @LastEditors: Kane
* @FilePath: /task_schedule/src/test/test.ts
* @Description:
@@ -8,33 +8,11 @@
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
import { queryDepartmentArchievement } from "../utils/archievement.js";
// import { testRankingListRequest } from "./testRankingListRequest.js";
interface Cat
{
name: string;
purrs: boolean;
}
// testRankingListRequest();
interface Dog
{
// name: string;
barks: true;
wags: true;
}
type CatOrDog = Cat | Dog;
const animal: CatOrDog =
{
name: "kaka",
purrs: true,
barks: true,
wags: true,
};
const arr: string[] = [];
console.log( "test" );
const gainers: Array<string | number> = ["kane", 588,];
const kane = { a: 100, b: 200, };
console.log( "检查instanceof", arr instanceof String );

View File

@@ -14,13 +14,12 @@
"target": "ESNext",
"module": "ESNext",
// "module": "CommonJS",
// "moduleResolution": "node",
"moduleResolution": "node",
"strict": true,
"jsx": "preserve",
"sourceMap": true,
"resolveJsonModule": true,
"esModuleInterop": false,
"esModuleInterop": true,
"baseUrl": "./", // paths 路径解析起点
"paths": { // 别名路径设置
"@/*": [
@@ -46,5 +45,8 @@
],
"exclude": [
"./node_modules",
]
],
"ts-node": {
"esm": true
},
}

View File

@@ -0,0 +1,17 @@
/*
* @Author: Kane
* @Date: 2023-05-09 22:03:26
* @LastEditors: Kane
* @FilePath: /task_schedule/src/data/cpicxim/Department.ts
* @Description: 部门数据结构
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
interface Department
{
departmentName: string;
departmentCode: string;
}
export { type Department };

View File

@@ -0,0 +1,18 @@
/*
* @Author: Kane
* @Date: 2023-06-06 17:44:48
* @LastEditors: Kane
* @FilePath: /task_schedule/src/types/cpicxim/RankingListItem.ts
* @Description: 排行榜元素
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
interface RankingListItem
{
index: number;
callerName: string;
appraiseValue: string;
}
export { type RankingListItem };

View File

@@ -0,0 +1,21 @@
/*
* @Author: Kane
* @Date: 2023-05-09 22:18:04
* @LastEditors: Kane
* @FilePath: /task_schedule/src/types/cpicxim/TelSaler.ts
* @Description: 坐席类型
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
interface TelSaler
{
telSalerCode: string;
telSalerName: string;
teamCode: string;
teamName: string;
departmentCode: string;
departmentName: string;
}
export { type TelSaler };

View File

@@ -0,0 +1,79 @@
/*
* @Author: Kane
* @Date: 2023-10-17 11:18:19
* @LastEditors: Kane
* @FilePath: /task_schedule/src/utils/BIReport.ts
* @Description: BI报表相关的代码
*
* Copyright (c) ${2023} by Kane, All Rights Reserved.
*/
import { service as instance } from "./api/request.js";
import { API_URL } from "./api/config.js";
import { type AxiosResponse } from "axios";
interface BIReportType
{
reportTypeCode: number;
reportTypeName: string;
}
interface ImportBIReportRequest
{
filePath: string,
reportType: number,
firstRow: number,
sheetIndex: number,
}
interface ImportBIReportResponse
{
success: boolean,
message: string,
importedCount: number,
}
type ImportBIReportResponseHandler = ( response: ImportBIReportResponse, error?: any ) => void;
/**
*
* @param request 请求参数
* @param handler 调用者提供的请求结果处理函数
*/
function importBIReport( request: ImportBIReportRequest, handler: any ): void
{
const importResponse: ImportBIReportResponse = {
success: false,
message: "",
importedCount: 0,
};
instance.request({
url: API_URL.URL_IMPORT_REPORT,
method: "post",
data: request,
})
.then(( response: AxiosResponse<any, any> ): any =>
{
const data: ImportBIReportResponse = response.data;
importResponse.success = data.success ?? false;
importResponse.message = data.message ?? "";
importResponse.importedCount = data.importedCount ?? 0;
handler( importResponse, null );
})
.catch(( error: any ): any =>
{
importResponse.message = "请求导入报表错误,请查看控制台!";
console.log( error );
handler( importResponse, error );
});
}
export {
type BIReportType,
type ImportBIReportRequest,
type ImportBIReportResponse,
type ImportBIReportResponseHandler,
importBIReport
};

View File

@@ -23,6 +23,32 @@ interface LoginInfo
password: string;
}
interface LoginCallerInfo
{
telsaler_code: string;
}
interface RequestResult
{
success: boolean;
message: string;
}
interface LoginCallerResult extends RequestResult
{
tel_saler_code: string;
tel_saler_name: string;
team_code: string;
team_name: string;
department_code: string;
department_name: string;
}
/**
* 内勤员工登录
* @param data 内勤员工登录信息
* @returns 返回一个Promise对象用于给调用者添加链式处理。
*/
async function login( data: LoginInfo ): Promise<AxiosResponse<any, any>>
{
return await instance.request(
@@ -30,10 +56,27 @@ async function login( data: LoginInfo ): Promise<AxiosResponse<any, any>>
method: "post",
url: API_URL.URL_LOGIN,
data,
}
);
});
}
/**
* 坐席登录函数
* @param data 坐席登录信息
* @returns 返回一个Promise对象用于给调用者添加链式处理。
*/
async function loginCaller( data: LoginCallerInfo ): Promise<AxiosResponse<any, any>>
{
return await instance.request(
{
method: "post",
url: API_URL.URL_LOGIN_CALLER,
data,
});
}
/**
* 退出登录
*/
function logout(): void
{
cleanStaffInfo();
@@ -42,4 +85,11 @@ function logout(): void
void router.push( "/login" );
}
export { type LoginInfo, login, logout };
export {
type LoginInfo,
type LoginCallerInfo,
type LoginCallerResult,
login,
loginCaller,
logout
};

View File

@@ -0,0 +1,12 @@
/*
* @Author: Kane
* @Date: 2023-09-14 00:22:04
* @LastEditors: Kane
* @FilePath: /task_schedule/src/utils/api/eventBus.ts
* @Description: 消息总线。
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
import mitt from "mitt";
export default mitt();

View File

@@ -7,10 +7,49 @@
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
export const API_URL = {
const API_URL = {
// URL_LOGIN: import.meta.env.VITE_URL_LOGIN,
URL_LOGIN: "http://222.76.244.118:11101/admin-system/account/p13_account_check",
// URL_LOGIN: "http://222.76.244.118:11101/admin-system/account/p13_account_check",
URL_LOGIN: "http://10.39.0.41:8081/admin-system/account/p13_account_check",
// URL_LOGIN_CALLER: "http://localhost:8080/desktop_archievement_backend/account/query_telsaler_info.do",
// URL_LOGIN_CALLER: "http://222.76.244.118:11101/desktop_archievement_backend/account/query_telsaler_info.do",
URL_LOGIN_CALLER: "http://10.39.0.41:8081/desktop_archievement_backend/account/query_telsaler_info.do",
// URL_DEPARTMENT_ARCHIEVEMENT: import.meta.env.VITE_URL_DEPARTMENT_ARCHIEVEMENT,
URL_DEPARTMENT_ARCHIEVEMENT: "http://222.76.244.118:11101/desktop_archievement_backend/archievement/query_department_archievement.do",
// URL_DEPARTMENT_ARCHIEVEMENT: "http://222.76.244.118:11101/desktop_archievement_backend/archievement/query_department_archievement.do",
URL_DEPARTMENT_ARCHIEVEMENT: "http://10.39.0.41:8081/desktop_archievement_backend/archievement/query_department_archievement.do",
// URL_RANKINGLIST: "http://localhost:8080/desktop_archievement_backend/archievement/query_ranking_list.do",
// URL_RANKINGLIST: "http://222.76.244.118:11101/desktop_archievement_backend/archievement/query_ranking_list.do",
URL_RANKINGLIST: "http://10.39.0.41:8081/desktop_archievement_backend/archievement/query_ranking_list.do",
// 坐席业绩查询
// URL_CALLER_ARCHIEVEMENT: "http://222.76.244.118:11101/desktop_archievement_backend/archievement/query_caller_archievement.do",
URL_CALLER_ARCHIEVEMENT: "http://10.39.0.41:8081/desktop_archievement_backend/archievement/query_caller_archievement.do",
/** 奖项相关 **/
// 查询奖励项目
// URL_RWARD_PROJECTS: "http://222.76.244.118:11101/desktop_archievement_backend/rewards/query_reward_projects.do",
URL_RWARD_PROJECTS: "http://10.39.0.41:8081/desktop_archievement_backend/rewards/query_reward_projects.do",
// 查询获奖人员
URL_REWARD_GAINERS: "http://10.39.0.41:8081/desktop_archievement_backend/rewards/query_reward_gainers.do",
// URL_REWARD_GAINERS: "http://222.76.244.118:11101/desktop_archievement_backend/rewards/query_reward_gainers.do",
// 添加获奖人员
URL_ADD_REWARD_TELSALER: "http://10.39.0.41:8081/desktop_archievement_backend/rewards/add_telsaler_reward.do",
// URL_ADD_REWARD_TELSALER: "http://222.76.244.118:11101/desktop_archievement_backend/rewards/add_telsaler_reward.do",
// 更新获奖人员
URL_UPDATE_REWARD_TELSALER: "http://10.39.0.41:8081/desktop_archievement_backend/rewards/update_telsaler_reward.do",
// URL_ADD_REWARD_TELSALER: "http://222.76.244.118:11101/desktop_archievement_backend/rewards/update_telsaler_reward.do",
// 删除获奖人员
URL_DEL_REWARD_TELSALER: "http://10.39.0.41:8081/desktop_archievement_backend/rewards/delete_telsaler_reward.do",
// URL_ADD_REWARD_TELSALER: "http://222.76.244.118:11101/desktop_archievement_backend/rewards/delete_telsaler_reward.do",
// 上传文件
URL_UPLOAD_FILE: "http://10.39.0.41:8081/desktop_archievement_backend/file/file-upload.do",
// URL_UPLOAD_FILE: "http://222.76.244.118:11101/desktop_archievement_backend/file/file-upload.do",
// 导入报表
URL_IMPORT_REPORT: "http://10.39.0.41:8081/desktop_archievement_backend/import_bi_data/excel.do",
// URL_IMPORT_REPORT: "http://222.76.244.118:11101/desktop_archievement_backend/import_bi_data/excel.do",
};
export { API_URL };

View File

@@ -7,7 +7,8 @@
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
import { StaffInfo } from "@/data/cpicxim/StaffInfo.js";
import { StaffInfo } from "../../types/cpicxim/StaffInfo.js";
import { type TelSaler } from "@/types/cpicxim/TelSaler.js";
const STUFF_ITEM = "stuff_info";
const CALLER_ITEM = "call_info";
@@ -43,7 +44,7 @@ function saveStaffInfo( stuff: StaffInfo ): void
const json = JSON.stringify( stuff );
window.localStorage.setItem( STUFF_ITEM, json );
};
}
function cleanStaffInfo(): void
{
@@ -62,14 +63,38 @@ function getUserType(): string
return userType;
}
function saveCallerInfo( callerCode: string ): void
function saveCallerInfo( callerInfo: TelSaler ): void
{
window.localStorage.setItem( CALLER_ITEM, callerCode );
const json = JSON.stringify( callerInfo );
window.localStorage.setItem( CALLER_ITEM, json );
}
function getCallerInfo(): string
function getCallerInfo(): TelSaler
{
return window.localStorage.getItem( CALLER_ITEM ) ?? "";
const json = window.localStorage.getItem( CALLER_ITEM ) ?? "";
let storeCallerInfo = null;
try
{
storeCallerInfo = JSON.parse( json );
}
catch ( error )
{
storeCallerInfo = {};
}
const callInfo: TelSaler = {
telSalerCode: storeCallerInfo.telSalerCode ?? "",
telSalerName: storeCallerInfo.telSalerName ?? "",
teamCode: storeCallerInfo.teamCode ?? "",
teamName: storeCallerInfo.teamName ?? "",
departmentCode: storeCallerInfo.departmentCode ?? "",
departmentName: storeCallerInfo.departmentName ?? "",
};
return callInfo;
}
function clearCallerInfo(): void
@@ -77,7 +102,8 @@ function clearCallerInfo(): void
window.localStorage.removeItem( CALLER_ITEM );
}
export {
export
{
loadStaffInfo,
saveStaffInfo,
cleanStaffInfo,

View File

@@ -0,0 +1,64 @@
/*
* @Author: Kane
* @Date: 2023-06-12 14:48:55
* @LastEditors: Kane
* @FilePath: /task_schedule/src/utils/api/loginRequest.ts
* @Description:
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
import axios, { type AxiosInstance } from "axios";
const loginInstance: AxiosInstance = axios.create(
{
baseURL: "",
timeout: 10000,
}
);
// 拦截器
// 登录用的请求不需要加上token。
loginInstance.interceptors.request.use(
/**
* 请求拦截方法,用于对请求参数和内容进行预处理。
* 因为是登录请求所以不需要加入token。
* @param config axios传递的配置对象
* @returns 返回给axios的配置对象
*/
( config ) =>
{
return config;
},
/**
* 请求拦截,当请求发送失败时调用。
* @param reason axios 传递的对象
* @returns 返回一个Promise对象提供给调用者。
*/
async ( reason ) =>
{
return await Promise.reject( reason );
});
// 响应拦截器
loginInstance.interceptors.response.use(
/**
* 响应成功后调用,用于对响应结果进行预处理
* @param response axios传递的响应结果
* @returns 返回预处理后的响应结果,这里返回的结果,会传递给用户用户提供的响应处理结果方法。
*/
( response ) =>
{
return response;
},
/**
* 请求调用结果不为2xx时被调用。用于对错误进行预处理。
* @param error axios传递的错误内容。
* @returns 返回预处理后的错误信息对象,会传递给用户提供的相应处理方法。
*/
async ( error ) =>
{
return await Promise.reject( error );
});
export { loginInstance as instance };

View File

@@ -19,8 +19,15 @@ const service: AxiosInstance = axios.create(
// 请求拦截
service.interceptors.request.use(
/**
* 请求拦截器在此加入token
* @param config 配置对象,在此加入token。
* @returns 返回修改完的配置对象
*/
( config ) =>
{
config.headers.token = "123";
return config;
},
async ( error ) =>

View File

@@ -3,15 +3,17 @@
* @Date: 2023-03-17 15:17:44
* @LastEditors: Kane
* @FilePath: /task_schedule/src/utils/archievement.ts
* @Description: 请求业绩数据
* @Description: 请求业绩数据相关的方法。
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
import { service as instance } from "./api/request.js";
import { API_URL } from "./api/config.js";
// import { type AxiosResponse } from "axios";
import { type Department } from "../types/cpicxim/Department.js";
import { type TelSaler } from "../types/cpicxim/TelSaler.js";
import { type AxiosResponse } from "axios";
interface Archievement
interface DepartmentArchievement // 定义业绩对象的结构
{
success: boolean;
message: string;
@@ -24,47 +26,228 @@ interface Archievement
backward_list: string[];
}
interface CallerArchievement // 坐席业绩对象
{
success: boolean;
message: string;
total_archievement: number;
moto_premium_present_month: number;
mensual_archievement_list: number[];
insurance_renewal_rate: string;
attaching_rate: string;
}
interface MenusalArchievementItem // 每月业绩清单的项目
{
month: number;
premium: string;
}
/**
* 获取部门业绩数据,并调用回调函数进行渲染。
* @param render 用于给组件更新数据的回调函数
* @param departmentInfo 作为请求参数的部门参数对象
* @param render 用于给组件更新数据的回调函数用DepartmentArchievement对象调用
*/
function queryDepartmentArchievement( render: any ): void
function queryDepartmentArchievement( departmentInfo: Department, render: any ): void
{
// 默认的部门业绩对象
const archievement: DepartmentArchievement = {
success: false,
message: "",
total_archievement: 0,
mensual_archievement_list: [],
insurance_renewal_rate: "",
attaching_rate: "",
leading_reward_gainers: [],
advance_reward_gainers: [],
backward_list: [],
};
instance.request({
method: "post",
url: API_URL.URL_DEPARTMENT_ARCHIEVEMENT,
data: departmentInfo,
})
// 请求结束,将请求的结果写入业绩对象,然后调用功能渲染函数。
.then(( response ) =>
{
const archievement: Archievement = {
success: false,
message: "",
total_archievement: 0,
mensual_archievement_list: [],
insurance_renewal_rate: "",
attaching_rate: "",
leading_reward_gainers: [],
advance_reward_gainers: [],
backward_list: [],
};
const data = response.data ?? {};
archievement.success = data.success ?? false;
archievement.message = data.message ?? "";
archievement.mensual_archievement_list = data.mensual_archievement_list ?? [];
archievement.message = data.message ?? "服务器没有返回调用结果消息,请检查日志!";
archievement.total_archievement = data.total_archievement;
archievement.mensual_archievement_list = [];
archievement.insurance_renewal_rate = data.insurance_renewal_rate ?? "0.0";
archievement.attaching_rate = data.attaching_rate ?? "0.0";
archievement.leading_reward_gainers = data.leading_reward_gainers ?? [];
archievement.advance_reward_gainers = data.advance_reward_gainers ?? [];
archievement.backward_list = data.backward_list ?? [];
render( data );
// 转换每月业绩数据用month排序以后保留premium。
data.mensual_archievement_list.sort(( a: any, b: any ) => a.month - b.month );
data.mensual_archievement_list.forEach(( item: any ) =>
{
archievement.mensual_archievement_list.push( item.premium );
});
console.log( "每月业绩", archievement );
// 调用渲染函数
if ( render !== undefined )
{
render( archievement );
}
})
// 请求失败,将失败原因写入业绩对象,调用渲染函数
.catch(( error ) =>
{
console.log( error );
archievement.success = false;
archievement.message = String( error );
// 调用渲染函数
if ( render !== undefined )
{
render( archievement );
}
console.log( `queryDepartmentArchievement:查询部门${departmentInfo.departmentCode}业绩失败,原因${error}` );
});
}
export { queryDepartmentArchievement, type Archievement };
/**
* 查询坐席的业绩,并调用渲染函数.
* 1、请求坐席业绩的数据
* 2、对每月业绩清单进行检查如果有缺少则用0代替检查的结果是12个月的清单让调用者自己截断
* 3、将检查后的清单写入到业绩对象中只写金额
* 4、即使请求失败也将失败的message写入业绩对象调用渲染函数
* @param callerInfo 坐席的信息参数,用于请求业绩;
* @param render 渲染函数用业绩对象CallerArchievement作为参数
*/
function queryCallerArchievement( callerInfo: TelSaler, render: any ): void
{
const caller = {
callerCode: callerInfo.telSalerCode,
callName: callerInfo.telSalerName,
};
// 默认的业绩对象
const callArchievement: CallerArchievement = {
success: false,
message: "",
total_archievement: 0,
moto_premium_present_month: 0,
mensual_archievement_list: [],
insurance_renewal_rate: "0.0",
attaching_rate: "0.0",
};
// 发送请求
instance.request({
method: "post",
url: API_URL.URL_CALLER_ARCHIEVEMENT,
data: caller,
})
// 请求完成时
.then(( response: AxiosResponse<any, any> ) =>
{
const data = response.data ?? {};
console.log( "个人业绩数据", data );
callArchievement.success = data.success ?? false;
callArchievement.message = data.message ?? "服务器没有返回调用结果消息,请检查日志!";
callArchievement.total_archievement = data.total_archievement ?? 0;
callArchievement.moto_premium_present_month = data.motoPremiumPresentMonth ?? 0;
callArchievement.mensual_archievement_list = [];
callArchievement.insurance_renewal_rate = data.insurance_renewal_rate ?? "0.0";
callArchievement.attaching_rate = data.attaching_rate ?? "0.0";
// 检查业绩清单有没有缺漏缺漏的用0补上
const checkedList = checkMensualArchievement( data.mensual_archievement_list );
// 排序一下
checkedList.sort(( a: MenusalArchievementItem, b: MenusalArchievementItem ): number =>
{
return a.month - b.month;
});
// 将排序后的每月业绩写到业绩对象中
checkedList.forEach(( item: MenusalArchievementItem ): void =>
{
const premium = Number( item.premium );
callArchievement.mensual_archievement_list.push( premium );
});
// 调用渲染函数
if ( render !== undefined )
{
render( callArchievement );
}
console.log( `queryCallerArchievement查询结果${data}` );
})
// 请求失败将失败的原因保存到message属性调用渲染函数
.catch(( error: any ) =>
{
callArchievement.success = false;
callArchievement.message = String( error );
// 调用渲染函数
if ( render !== undefined )
{
render( callArchievement );
}
console.log( `queryCallerArchievement:查询坐席${callerInfo.telSalerCode}业绩失败,原因${error}` );
});
}
/**
* 检查服务器返回的每月业绩数组检查是否有缺漏缺少的月份业绩用0代替。
* 检查的结果是12个月的清单由调用者自己进行截断。
* @param mensualArchievementList MenusalArchievementItem类型的数组为业绩清单
* @returns 返回MenusalArchievementItem数组为检查过的清单
*/
function checkMensualArchievement( mensualArchievementList: MenusalArchievementItem[]): MenusalArchievementItem[]
{
const checkedList: MenusalArchievementItem[] = [];
const itemMap = new Map();
itemMap.set( 1, "0" );
itemMap.set( 2, "0" );
itemMap.set( 3, "0" );
itemMap.set( 4, "0" );
itemMap.set( 5, "0" );
itemMap.set( 6, "0" );
itemMap.set( 7, "0" );
itemMap.set( 8, "0" );
itemMap.set( 9, "0" );
itemMap.set( 10, "0" );
itemMap.set( 11, "0" );
itemMap.set( 12, "0" );
mensualArchievementList.forEach(( item: MenusalArchievementItem ): void =>
{
itemMap.set( item.month, item.premium );
});
itemMap.forEach(( value, key, map ) =>
{
const item: MenusalArchievementItem = {
month: key,
premium: value,
};
checkedList.push( item );
});
return checkedList;
}
export {
queryDepartmentArchievement,
queryCallerArchievement,
type DepartmentArchievement,
type CallerArchievement
};

View File

@@ -0,0 +1,20 @@
/*
* @Author: Kane
* @Date: 2023-09-27 14:13:47
* @LastEditors: Kane
* @FilePath: /task_schedule/src/utils/fileUpload.ts
* @Description: 文件上传相关
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
interface FileUploadResponse
{
success: boolean;
message: string;
fileList: string[];
}
export {
type FileUploadResponse
};

View File

@@ -0,0 +1,116 @@
/*
* @Author: Kane
* @Date: 2023-06-06 17:40:31
* @LastEditors: Kane
* @FilePath: /task_schedule/src/utils/ranking.ts
* @Description: 排行榜相关的代码
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
import { service as instance } from "./api/request.js";
import { API_URL } from "./api/config.js";
import { type RankingListItem } from "../types/cpicxim/RankingListItem.js";
/**
* 用于请求排行榜数据请求参数
*/
interface RankingListRequest
{
departmentCode: string;
year: string;
month: string;
}
interface RankingListResponse
{
success: boolean;
message: string;
departmentCode: string;
year: string;
month: string;
attachingRateRankingList: RankingListItem[];
renewalRateRankingList: RankingListItem[];
}
// 判断用的正则表达式
const regexMonth = "(0[1-9])|(1[0-2])";
/**
* 请求坐席排行榜。
* @param reqParam 请求参数
* @param rander 保存请求结果的回调函数
* @returns 返回RankingListResponse对象里面包含请求状态和数据。
*/
function requestRankingList( reqParam: RankingListRequest, rander: any ): void // eslint-disable-line
{
// let attachingRankingList: RankingListItem[];
// let renewalRankintList: RankingListItem[];
const rankingListResponse: RankingListResponse = {
success: false,
message: "",
departmentCode: reqParam.departmentCode,
year: reqParam.year,
month: reqParam.month,
attachingRateRankingList: [],
renewalRateRankingList: [],
};
// 检查请求参数
// TODO: 这里要加一个对month的正则表达式验证。
instance.request(
{
method: "post",
url: API_URL.URL_RANKINGLIST,
data: reqParam,
})
.then(( response ) =>
{
const data: RankingListResponse = response.data as RankingListResponse;
rankingListResponse.success = data.success ?? false;
rankingListResponse.message = data.message ?? "";
rankingListResponse.departmentCode = data.departmentCode ?? "";
rankingListResponse.year = data.year ?? "";
rankingListResponse.month = data.month ?? "";
// 遍历排行榜元素
for ( const item of ( data.attachingRateRankingList ?? [] )) // eslint-disable-line
{
const index: number = item.index ?? -1;
if ( index === -1 )
{
continue;
}
rankingListResponse.attachingRateRankingList.push( item );
}
for ( const item of ( data.renewalRateRankingList ?? [] )) // eslint-disable-line
{
const index: number = item.index ?? -1;
if ( index === -1 )
{
continue;
}
rankingListResponse.renewalRateRankingList.push( item );
}
// 调用回调函数保存数据
rander( rankingListResponse );
})
.catch(( error ) =>
{
console.log( error );
});
}
export {
type RankingListRequest,
type RankingListResponse,
requestRankingList
};

View File

@@ -0,0 +1,346 @@
/*
* @Author: Kane
* @Date: 2023-09-11 09:59:00
* @LastEditors: Kane
* @FilePath: /task_schedule/src/utils/reward.ts
* @Description: 奖励相关的API
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
import { type AxiosResponse } from "axios";
import { service as instance } from "./api/request.js";
import { API_URL } from "./api/config.js";
interface RewardProject
{
rewardCode: number;
rewardName: string;
}
interface RewardProjectResponse
{
success: boolean;
message: string;
rewardList: RewardProject[] | null;
}
interface RewardGainer
{
recID: number;
callerName: string;
callerCode: string;
rewardProjectCode: string;
rewardProjectName: string;
}
interface RewardGainerResponse
{
success: boolean;
message: string;
gainerList: RewardGainer[] | null;
}
interface AddRewardTelsalerRequest
{
telsalerName: string;
rewardIndex: number;
}
interface AddRewardTelsalerResponse
{
success: boolean;
message: string;
}
interface UpdateRewardTelsalerRequest
{
recordID: number,
telsalerName: string;
rewardIndex: number;
}
interface UpdateRewardTelsalerResponse
{
success: boolean;
message: string;
}
interface DeleteRewardTelsalerRequest
{
recordID: number[];
}
interface DeleteRewardTelsalerResponse
{
success: boolean;
message: string;
}
/**
* 请求奖项清单
* @param handler 用于处理请求数据的回调函数;
*/
function requestRewardPorjectsList( handler: any ): void
{
if ( handler === undefined || handler === null )
{
return;
}
const rewardResponse: RewardProjectResponse = {
success: false,
message: "",
rewardList: [],
};
instance.request({
url: API_URL.URL_RWARD_PROJECTS,
method: "post",
})
// 请求成功,检查服务器返回结果
.then(( response: AxiosResponse<any, any> ): void =>
{
const data = response.data ?? {};
rewardResponse.success = data.success ?? false;
rewardResponse.message = data.message ?? "";
rewardResponse.rewardList = checkRewardProjects( data.rewardList ?? []);
handler( rewardResponse, null );
})
.catch(( error: any ): void =>
{
console.log( error );
rewardResponse.success = false;
handler( rewardResponse, error );
});
}
/**
* 请求获奖人员清单
* @param handler 处理请求结果的回调函数
*/
function requestRewardGainers( handler: any ): void
{
if ( handler === undefined || handler === null )
{
return;
}
const rewardResponse: RewardGainerResponse = {
success: false,
message: "",
gainerList: [],
};
instance.request({
url: API_URL.URL_REWARD_GAINERS,
method: "post",
})
.then(( response: AxiosResponse<any, any> ): void =>
{
const data = response.data ?? {};
rewardResponse.success = data.success;
rewardResponse.message = data.message;
rewardResponse.gainerList = checkRewardGainers( data.gainerList );
handler( rewardResponse, null );
})
.catch(( error: any ): void =>
{
console.log( error );
rewardResponse.success = false;
handler( rewardResponse, error );
});
}
function addRewardTelsaler( data: AddRewardTelsalerRequest, handler: any ): void
{
if ( handler === undefined || handler === null )
{
return;
}
const addResponse: AddRewardTelsalerResponse = {
success: false,
message: "",
};
instance.request({
method: "post",
url: API_URL.URL_ADD_REWARD_TELSALER,
data,
})
.then(( response: AxiosResponse<any, any> ): void =>
{
const data: AddRewardTelsalerResponse = response.data ?? {};
addResponse.success = data.success ?? false;
addResponse.message = data.message ?? "";
handler( addResponse );
})
.catch(( error ): void =>
{
console.log( error );
addResponse.success = false;
addResponse.message = "请求添加获奖坐席失败,请查看控制台!";
handler( addResponse, error );
});
}
/**
* 请求更新获奖坐席根据请求结果调用handler函数。
* @param data 请求数据
* @param handler 处理请求结果数据的回调函数。
*/
function updateTelsalerReward( data: UpdateRewardTelsalerRequest, handler: any ): void
{
if ( handler === undefined || handler === null )
{
return;
}
const updateResponse: UpdateRewardTelsalerResponse = {
success: false,
message: "",
};
instance.request({
method: "post",
url: API_URL.URL_UPDATE_REWARD_TELSALER,
data,
})
.then(( response: AxiosResponse<any, any> ): any =>
{
const data: UpdateRewardTelsalerResponse = response.data ?? {};
updateResponse.success = data.success ?? false;
updateResponse.message = data.message ?? "";
handler( updateResponse );
})
.catch(( error: any ): void =>
{
updateResponse.success = false;
updateResponse.message = "请求更新获奖坐席失败,请查看控制台!";
console.log( error );
handler( updateResponse, error );
});
}
/**
* 请求删除获奖坐席。
* @param data 请求数据
* @param handler 处理请求结果的回调函数
*/
function deleteRewardTelsaler( data: DeleteRewardTelsalerRequest, handler: any ): void
{
if ( handler === undefined || handler === null )
{
return;
}
const deleteResponse: DeleteRewardTelsalerResponse = {
success: false,
message: "",
};
instance.request({
method: "post",
url: API_URL.URL_DEL_REWARD_TELSALER,
data,
})
.then(( response: AxiosResponse<any, any> ): void =>
{
const data: DeleteRewardTelsalerResponse = response.data ?? {};
deleteResponse.success = data.success ?? false;
deleteResponse.message = data.message ?? "";
handler( deleteResponse );
})
.catch(( error: any ): void =>
{
deleteResponse.message = "请求删除获奖坐席失败,请检查日志!";
deleteResponse.success = false;
console.log( error );
handler( deleteResponse, error );
});
}
// **功能函数 **********************************/
function checkRewardProjects( data: any[]): RewardProject[] | null
{
const rewardList: RewardProject[] = [];
// 检查一下参数的类型,如果不是数组返回 null
if ( !( data instanceof Array ))
{
return null;
}
data.forEach(( item: any ) =>
{
const reward = {
rewardCode: item.rewardCode ?? "",
rewardName: item.rewardName ?? "",
};
rewardList.push( reward );
});
return rewardList;
}
function checkRewardGainers( gainers: any[]): RewardGainer[] | null
{
const gainerList: RewardGainer[] = [];
if ( !( gainers instanceof Array ))
{
return null;
}
gainers.forEach(( item: RewardGainer ): void =>
{
const gainer: RewardGainer = {
recID: item.recID ?? "",
callerName: item.callerName ?? "",
callerCode: item.callerCode ?? "",
rewardProjectCode: item.rewardProjectCode ?? "",
rewardProjectName: item.rewardProjectName ?? "",
};
gainerList.push( gainer );
});
return gainerList;
}
export {
type RewardProject,
type RewardGainer,
type RewardProjectResponse,
type RewardGainerResponse,
type DeleteRewardTelsalerRequest,
type DeleteRewardTelsalerResponse,
type AddRewardTelsalerRequest,
type AddRewardTelsalerResponse,
type UpdateRewardTelsalerRequest,
type UpdateRewardTelsalerResponse,
requestRewardPorjectsList,
requestRewardGainers,
addRewardTelsaler,
updateTelsalerReward,
deleteRewardTelsaler
};

View File

@@ -1,26 +0,0 @@
<!--
* @Author: Kane
* @Date: 2023-03-23 16:05:08
* @LastEditors: Kane
* @FilePath: /task_schedule/src/views/DataManagemant.vue
* @Description:
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
-->
<template>
<div>
数据管理
</div>
</template>
<script lang="ts">
export default {
name: "DataManagement",
setup()
{
return {};
},
};
</script>
<style lang="scss" scoped>
</style>

View File

@@ -26,7 +26,7 @@ export default {
{
height: 2000px;
width: 2000px;
background-color: aquamarine;
// background-color: aquamarine;
padding: 0px;
}
</style>

View File

@@ -17,7 +17,7 @@
<div class="center-wrapper">
<span class="slogan">对标先进&nbsp;比学赶超</span>
<div class="total-archievement-wrapper">
<span>业绩</span>
<span>我的车险业绩</span>
<span>{{ getTotalArchievement }}</span>
</div>
<div class="archievement-wrapper">
@@ -31,41 +31,89 @@
:percentage="ui.attaching_rate"
/>
</div>
<div
class="total-archievement-charts-wrapper"
>
<ArchievementChart
:chart-data="ui.chartData"
/>
<div class="total-archievement-charts-wrapper">
<ArchievementChart :chart-data="ui.chartData" />
</div>
</div>
<div class="reward-wrapper">
<HonorListComponent
month=""
:month="ui.currentMonth"
:leading-reward="ui.leading_reward_gainers"
:advance-reward="ui.advance_reward_gainers"
/>
<DishonorListComponent
month=""
:month="ui.currentMonth"
:dishonor-persons="ui.dishonorPersons"
/>
</div>
</div>
<div class="right-wrapper" />
<div class="right-wrapper">
<CallerArchievementComponent
:caller-name="callerInfo.telSalerName"
:this-month-premium="ui.callerPersentMonthPremium"
:attaching-rate="ui.callerAttachingRate"
:renewal-rate="ui.callerRenewalRate"
/>
<RankingListComponent
title="渗透率"
:ranking-list="ui.attachingRankingList"
/>
<RankingListComponent
title="续保率"
:ranking-list="ui.renewalRankingList"
/>
</div>
</div>
</template>
<script lang="ts">
import { computed, reactive, onBeforeMount } from "vue";
import { computed, reactive, onBeforeMount, onUnmounted } from "vue";
import { useRouter } from "vue-router";
import { getCallerInfo } from "@/utils/api/localStorage.js";
import { ElMessage } from "element-plus";
import { type Archievement, queryDepartmentArchievement } from "@/utils/archievement.js";
import
{
type DepartmentArchievement,
type CallerArchievement,
queryDepartmentArchievement,
queryCallerArchievement
} from "@/utils/archievement.js";
import { type RankingListItem } from "@/types/cpicxim/RankingListItem.js";
import
{
type RankingListRequest,
type RankingListResponse,
requestRankingList
} from "@/utils/ranking.js";
import { type Department } from "@/types/cpicxim/Department";
import ArchievementChart from "@/components/ArchievementChartComponent.vue";
import ArchievementCompleteRateComponent from "@/components/ArchievementCompleteRateComponent.vue";
import HonorListComponent from "@/components/HonorListComponent.vue";
import DishonorListComponent from "@/components/DishonorListComponent.vue";
import RankingListComponent from "@/components/RankingListComponent.vue";
import CallerArchievementComponent from "@/components/CallerArchievementComponent.vue";
import { logout } from "@/utils/account.js";
import { type TelSaler } from "@/types/cpicxim/TelSaler";
interface ui
{
currentMonth: string;
chartData: number[];
totalArchievement: number;
attaching_rate: string;
insurance_renewal_rate: string; // 续保率
leading_reward_gainers: string[]; // 领跑奖
advance_reward_gainers: string[]; // 飞跃奖
dishonorPersons: string[];
showUI: boolean; // 用来刷新页面的开关
attachingRankingList: RankingListItem[]; // 坐席车非渗透率榜单
renewalRankingList: RankingListItem[];
callerAttachingRate: string;
callerRenewalRate: string;
callerPersentMonthPremium: number;
}
export default {
name: "DesktopArchievement",
@@ -74,12 +122,34 @@ export default {
ArchievementCompleteRateComponent,
HonorListComponent,
DishonorListComponent,
RankingListComponent,
CallerArchievementComponent,
},
setup()
{
const monthIndex = new Date();
const thisMonth: number = monthIndex.getMonth(); // getMonth返回值从0开始。
const thisMonthString = thisMonth > 10 ? String( thisMonth ) : "0" + String( thisMonth );
const thisYear: number = monthIndex.getFullYear();
const thisYearString: string = String( thisYear );
const numInChinese = [
"一",
"二",
"三",
"四",
"五",
"六",
"七",
"八",
"九",
"十",
"十一",
"十二",
];
const router = useRouter();
const callerInfo = getCallerInfo();
const ui = reactive({
const callerInfo: TelSaler = getCallerInfo();
const ui: ui = reactive({
currentMonth: numInChinese[monthIndex.getMonth() - 1],
chartData: [0,], // 业绩表
totalArchievement: 0, // 总业绩
attaching_rate: "", // 车非渗透率
@@ -88,28 +158,48 @@ export default {
advance_reward_gainers: ["",], // 飞跃奖
dishonorPersons: ["",],
showUI: true, // 用来刷新页面的开关
attachingRankingList: [], // 坐席车非渗透率榜单
renewalRankingList: [], // 坐席续保率榜单
callerAttachingRate: "0.0",
callerRenewalRate: "0.0",
callerPersentMonthPremium: 0,
});
let timerHandler = 0;
const getTotalArchievement = computed(() =>
const getTotalArchievement = computed((): string =>
{
const cnyFormat = new Intl.NumberFormat( "zh-cn",
{
style: "currency",
currency: "CNY",
minimumFractionDigits: 0,
});
const cnyFormat = new Intl.NumberFormat( "zh-cn", {
style: "currency",
currency: "CNY",
minimumFractionDigits: 0,
});
const archievement = cnyFormat.format( ui.totalArchievement );
return archievement;
});
// 绘制数据
const renderData = ( data:Archievement ) =>
/**
* 将请求函数获取的部门业绩数据,渲染到页面上。
* @param data DepartmentArchievementl类型的部门业绩数据对象
*/
const applyDepartmentArchievementData = ( data: DepartmentArchievement ): void =>
{
console.log( "部门业绩数据", data );
// console.log( "部门业绩数据", data );
ui.chartData = data.mensual_archievement_list;
ui.totalArchievement = data.total_archievement;
// 检查请求是否成功
if ( !data.success )
{
// 失败就提示消息,然后退出
ElMessage({
message: data.message,
type: "error",
});
return;
}
// ui.chartData = data.mensual_archievement_list;
// ui.totalArchievement = data.total_archievement;
ui.attaching_rate = data.attaching_rate;
ui.insurance_renewal_rate = data.insurance_renewal_rate;
ui.leading_reward_gainers = data.leading_reward_gainers;
@@ -120,11 +210,65 @@ export default {
// 先不显示界面往队列中加入显示队列的回调让vue刷新组件。
ui.showUI = false;
setTimeout(() => { ui.showUI = true; }, 0 );
setTimeout(() =>
{
ui.showUI = true;
}, 0 );
};
/**
* 将请求的坐席业绩数据渲染到页面
* @param data
*/
const applyCallerArchievementData = ( data: CallerArchievement ): void =>
{
// 检查请求是否成功
if ( !data.success )
{
// 失败就提示消息,然后退出
ElMessage({
message: data.message,
type: "error",
});
return;
}
ui.chartData = data.mensual_archievement_list.slice( 0, thisMonth );
ui.totalArchievement = data.total_archievement;
ui.callerAttachingRate = data.attaching_rate;
ui.callerRenewalRate = data.insurance_renewal_rate;
ui.callerPersentMonthPremium = data.moto_premium_present_month;
// ui.callerPersentMonthPremium = data.mensual_archievement_list[thisMonth];
console.log( "业绩清单", data );
ui.showUI = false;
setTimeout(() =>
{
ui.showUI = true;
}, 0 );
};
const applyRankingListData = ( data: RankingListResponse ): void =>
{
ui.attachingRankingList = data.attachingRateRankingList;
ui.renewalRankingList = data.renewalRateRankingList;
// 更新UI
// 先不显示界面往队列中加入显示队列的回调让vue刷新组件。
ui.showUI = false;
console.log( "获取排行榜后的ui:", data );
setTimeout(() =>
{
ui.showUI = true;
}, 0 );
};
// 退出桌面霸屏
const logoutDesktopArchievement = () =>
const logoutDesktopArchievement = (): void =>
{
console.log( "111" );
logout();
@@ -133,7 +277,7 @@ export default {
};
// 检查存储的登录信息,不存在则返回登录页面
if ( callerInfo === "" )
if ( callerInfo.telSalerCode === "" )
{
ElMessage({
message: "登录信息失效,请重新登录!",
@@ -141,15 +285,61 @@ export default {
center: true,
});
router.push( "/login" );
router.push( "/login" ).then(() => {}).catch(() => {});
}
/**
* 用于定时对页面进行刷新,其中会请求最新的业绩数据。
*/
const refresh = (): void =>
{
const deparmentInfo: Department = {
departmentCode: callerInfo.departmentCode,
departmentName: callerInfo.departmentName,
};
const rankinglistRequest: RankingListRequest = {
departmentCode: callerInfo.departmentCode,
year: thisYearString,
month: thisMonthString,
};
console.log( "refresh", rankinglistRequest );
queryDepartmentArchievement( deparmentInfo, applyDepartmentArchievementData );
queryCallerArchievement( callerInfo, applyCallerArchievementData );
requestRankingList( rankinglistRequest, applyRankingListData );
};
/**
* 加载前
*/
onBeforeMount(() =>
{
queryDepartmentArchievement( renderData );
// 设置每10分钟刷新一次
timerHandler = setInterval( refresh, 600 * 1000 );
refresh();
});
return { ui, getTotalArchievement, renderData, logoutDesktopArchievement, };
/**
* 页面卸载前
*/
onUnmounted((): void =>
{
// 退出页面前关掉定时器
clearInterval( timerHandler );
});
return {
ui,
callerInfo,
timerHandler,
getTotalArchievement,
renderData: applyDepartmentArchievementData,
refresh,
logoutDesktopArchievement,
};
},
};
</script>
@@ -163,7 +353,7 @@ export default {
width: 100vw;
padding: 5mm;
display: flex;
justify-content: end;
justify-content: flex-end;
align-items: stretch;
}
@@ -271,8 +461,44 @@ export default {
}
.right-wrapper {
min-width: 400px;
min-width: 300px;
width: 25%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: flex-start;
// >*+* {
// margin-top: 15px;
// }
>h1 {
font: {
family: "FZ-ZHUOHEI";
weight: 100;
size: 30px;
}
color: $color-bg-04;
text-align: center;
width: 300px;
}
.carousel-item {
// 为了限制走马灯组件的高度
display: block;
height: 260px;
width: 300px;
}
// >div {
// // 为了限制走马灯组件的高度
// display: block;
// height: 260px;
// width: 300px;
// }
}
</style>
<style lang="scss">
@@ -283,7 +509,7 @@ body {
$color-bg-03,
$color-bg-04,
$color-bg-05,
$color-bg-05);
$color-bg-05 );
}
div {

View File

@@ -68,9 +68,10 @@
import { reactive, onBeforeMount } from "vue";
import { useRouter } from "vue-router";
import { saveStaffInfo, getUserType, saveUserType, getCallerInfo, saveCallerInfo } from "@/utils/api/localStorage";
import { login } from "@/utils/account";
import { login, loginCaller, type LoginCallerInfo, type LoginCallerResult } from "@/utils/account";
import { ElMessage } from "element-plus";
import { StaffInfo } from "@/data/cpicxim/StaffInfo";
import { StaffInfo } from "@/types/cpicxim/StaffInfo";
import { type TelSaler } from "@/types/cpicxim/TelSaler";
export default {
name: "LoginPage",
@@ -91,15 +92,18 @@ export default {
currentMenu: "",
});
const savedP13uid = () =>
/**
* 保存p13账号
*/
const savedP13uid = (): void =>
{
window.localStorage.setItem( "stuff_account", ui.account );
};
/**
*
* 登录函数根据ui.currentMenu判断登录的是坐席还是员工。
*/
const onLogin = () =>
const onLogin = (): void =>
{
// 保存用户类型
saveUserType( ui.currentMenu );
@@ -114,13 +118,14 @@ export default {
};
login( info )
// 调用成功
.then(( response ) =>
{
const data = response.data ?? { success: false, };
if ( data.success === true )
{
// 提示登录成功并保存到localStorage然后路由跳转
// 提示登录成功并保存到localStorage然后路由跳转
ElMessage({
message: data.message,
type: "success",
@@ -140,7 +145,7 @@ export default {
saveStaffInfo( staffInfo );
// 跳转路由
router.push( "/desktop" );
router.push( "/desktop" ).then(() => {}).catch(() => {});
}
else
{
@@ -153,19 +158,72 @@ export default {
console.log( data );
})
// 调用失败
.catch(( error ) =>
{
debugger;
// debugger;
console.log( `登录失败,返回信息:${error}` );
});
}
else if ( ui.currentMenu === "tele_saler" )
{
// 是坐席,将坐席工号保存到本地,然后跳转
saveCallerInfo( ui.account );
// 是坐席
const loginInfo: LoginCallerInfo = {
telsaler_code: ui.account,
};
// 跳转路由
router.push( "/desktop_archievement" );
// 登录
loginCaller( loginInfo )
// 调用接口成功
.then(( response ) =>
{
const data: LoginCallerResult = response.data ?? { success: false, };
// debugger;
// 查看標志位
if ( data.success )
{
// 查询成功,显示一个提示,保存工号,并跳转路由
ElMessage({
message: `验证成功,登录用户 ${data.tel_saler_name}`,
type: "success",
});
const telsaler: TelSaler = {
telSalerCode: data.tel_saler_code,
telSalerName: data.tel_saler_name,
teamCode: data.team_code,
teamName: data.team_name,
departmentCode: data.department_code,
departmentName: data.department_name,
};
saveCallerInfo( telsaler );
router.push( "/desktop_archievement" ).then(() => {}).catch(() => {});
}
else
{
// 查詢失敗
ElMessage({
message: "验证失败,请检查输入的工号。",
type: "error",
});
}
})
// 调用接口失败
.catch(( error ) =>
{
const message = `登录失败,返回信息:${error}`;
console.log( message );
ElMessage({
message,
type: "error",
});
});
}
};
@@ -182,16 +240,16 @@ export default {
const callInfo = getCallerInfo();
// 判断是否已经记录了坐席工号,有则提示已登录,然后跳转路由
if ( callInfo !== "" )
if ( callInfo.telSalerCode.length !== 0 )
{
ElMessage({
message: `已登录账号:${callInfo}`,
message: `已登录账号:${callInfo.telSalerName}`,
type: "success",
center: true,
});
// 跳转路由
router.push( "/desktop_archievement" );
router.push( "/desktop_archievement" ).then(() => {}).catch(() => {});
}
}
else if ( staffType === "cpicxim_staff" )
@@ -200,7 +258,7 @@ export default {
}
});
const onToggleMenu = ( type: string ) =>
const onToggleMenu = ( type: string ): void =>
{
ui.currentMenu = type;
};
@@ -268,25 +326,25 @@ export default {
}
.menu-tab {
text-align: center;
margin-bottom: 15px;
margin-top: 25px;
text-align: center;
margin-bottom: 15px;
margin-top: 25px;
li {
display: inline-block;
padding: 10px 24px;
margin: 0 10px;
// background-color: #fff;
color: #1d6ddc;
font-size: 16px;
border-radius: 5px;
cursor: pointer;
li {
display: inline-block;
padding: 10px 24px;
margin: 0 10px;
// background-color: #fff;
color: #1d6ddc;
font-size: 16px;
border-radius: 5px;
cursor: pointer;
&.current {
background-color: #1d6ddc;
color: #fff;
&.current {
background-color: #1d6ddc;
color: #fff;
}
}
}
}
.form-label {

View File

@@ -0,0 +1,393 @@
<!--
* @Author: Kane
* @Date: 2023-03-23 16:05:08
* @LastEditors: Kane
* @FilePath: /task_schedule/src/views/RewardManagement.vue
* @Description:
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
-->
<template>
<div
v-if="ui.showUI"
class="wrapper"
>
<div class="reward-wrapper">
<div class="reward-gainer-wrapper">
<el-divider content-position="left">
90俱乐部 & 消7灭6包围战
</el-divider>
<div class="toolbutton-wrapper">
<el-button
type="primary"
icon="documentAdd"
@click="onAddRewardGainer"
>
新增
</el-button>
<el-button
type="danger"
icon="delete"
@click="onDeleteRewardGainer"
>
删除
</el-button>
<el-button
type="warning"
icon="Refresh"
@click="refresh"
>
刷新
</el-button>
</div>
<el-table
ref="rewardTelsalerTable"
border
stripe
style="width:100%;"
:data="rewardGainerData"
>
<el-table-column type="selection" />
<el-table-column
label="坐席名称"
align="center"
>
<template #default="rewardGainer">
<span
class="reward-gainer-td"
@dblclick="onEditRewardGainer(rewardGainer.row.recID, rewardGainer.row.callerName, rewardGainer.row.rewardProjectCode)"
>{{ rewardGainer.row.callerName }}</span>
</template>
</el-table-column>
<el-table-column
label="奖项名称"
align="center"
>
<template #default="rewardGainer">
<span
class="reward-gainer-td"
@dblclick="onEditRewardGainer( rewardGainer.row.recID, rewardGainer.row.callerName, rewardGainer.row.rewardProjectCode)"
>{{ rewardGainer.row.rewardProjectName }}</span>
</template>
</el-table-column>
</el-table>
<div class="pagination-wrapper">
<el-pagination
v-model="ui.tablePageIndex"
class="pull_left"
size="small"
background
:page-size="ui.tablePageSize"
:page-sizes="[10, 20, 50, 100]"
layout="total, sizes, prev, pager, next, jumper"
:total="(ui.rewardGainerList ?? []).length"
@current-change="onCurrentPageIndexChange"
@size-change="onTablePageSizeChange"
/>
</div>
</div>
</div>
<div
v-if="ui.showEditRewardGainerDialog"
class="dialog-wrapper"
>
<el-dialog
v-model="ui.showEditRewardGainerDialog"
title="编辑获奖人员"
width="400px"
>
<RewardGainerDialog
:selected-rec-id="(ui.selectedRecID ?? -9999)"
:selected-reward-project-code="ui.selectedRewardProjectCode"
:selected-telsaler-name="ui.selectedTelsalerName"
/>
</el-dialog>
</div>
</div>
</template>
<script lang="ts">
import { reactive, computed, onBeforeMount, ref } from "vue";
import { type RewardGainer, type RewardGainerResponse, requestRewardGainers, type DeleteRewardTelsalerResponse, deleteRewardTelsaler, type DeleteRewardTelsalerRequest } from "@/utils/reward.js";
import eventBus from "@/utils/api/EventBus.js";
import { ElMessage, ElMessageBox, type ElTable } from "element-plus";
import RewardGainerDialog from "@/views/reward/RewardTelsaler.vue";
interface UI
{
showUI: boolean;
showEditRewardGainerDialog: boolean;
rewardGainerList: RewardGainer[] | null;
tablePageIndex: number;
tablePageSize: number;
selectedRecID: number | null;
selectedTelsalerName: string;
selectedRewardProjectCode: number;
}
export default {
name: "RewardManagement",
components: { RewardGainerDialog, },
setup()
{
const ui: UI = reactive({
showUI: true,
showEditRewardGainerDialog: false,
rewardGainerList: null,
tablePageIndex: 1,
tablePageSize: 10,
selectedRecID: null,
selectedTelsalerName: "",
selectedRewardProjectCode: -999,
});
const rewardTelsalerTable = ref<InstanceType<typeof ElTable>>();
/** 请求数据相关 ***************************/
const requestRewardTelsalerListHandler = ( response: RewardGainerResponse, error: any ): void =>
{
if ( !response.success )
{
console.log( error );
ElMessageBox({
message: "请求获奖人列表失败,请查看日志!",
type: "error",
center: true,
})
.then((): void => {})
.catch((): void => {});
return;
}
ui.rewardGainerList = response.gainerList;
console.log( "请求获奖人员列表", ui.rewardGainerList );
refreshUI();
};
/** 表格相关 ***************************/
const tableHeight = computed((): number =>
{
return ( ui.tablePageSize + 1 ) * 40;
});
/**
* 用于根据分页组件的参数,生成表格用的数据。
*/
const rewardGainerData = computed((): RewardGainer[] =>
{
// 防御性验证
if ( ui.rewardGainerList === null )
{
return [];
}
const startIndex = ui.tablePageSize * ( ui.tablePageIndex - 1 );
const endIndex = startIndex + ui.tablePageSize;
const data = ui.rewardGainerList.slice( startIndex, endIndex );
console.log( ui.tablePageSize, ui.tablePageIndex );
console.log( "表格数据:", data );
return data;
});
const onCurrentPageIndexChange = ( pageIndex: number ): void =>
{
ui.tablePageIndex = pageIndex;
};
const onTablePageSizeChange = ( pageSize: number ): void =>
{
ui.tablePageSize = pageSize;
};
/** 功能按钮相关 *******************************/
/**
* 添加获奖坐席
*/
const onAddRewardGainer = (): void =>
{
ui.selectedRecID = -1;
ui.selectedRewardProjectCode = 3;
ui.selectedTelsalerName = "";
ui.showEditRewardGainerDialog = true;
};
/**
* 响应用户在表格中的双击
* @param telsalerName
* @param rewardProjectName
*/
const onEditRewardGainer = ( recID: number, telsalerName: string, rewardProjectCode: number ): void =>
{
console.log( "编辑获奖清单", recID, telsalerName, rewardProjectCode );
ui.selectedRecID = recID;
ui.selectedTelsalerName = telsalerName;
ui.selectedRewardProjectCode = rewardProjectCode;
ui.showEditRewardGainerDialog = true;
};
/**
* 响应点击删除按钮
*/
const onDeleteRewardGainer = (): void =>
{
const selectedRecord: RewardGainer[] = rewardTelsalerTable.value?.getSelectionRows();
const deleteRequest: DeleteRewardTelsalerRequest = {
recordID: [],
};
if ( selectedRecord !== undefined )
{
selectedRecord.forEach(( item: RewardGainer ): void =>
{
deleteRequest.recordID.push( item.recID );
});
}
deleteRewardTelsaler( deleteRequest, deleteTelsalerRewardHandler );
};
/** 回调函数 ************************/
const deleteTelsalerRewardHandler = ( response: DeleteRewardTelsalerResponse, error: any ): void =>
{
if ( response.success )
{
ElMessage({
message: response.message,
type: "success",
});
}
else
{
ElMessageBox({
message: response.message,
type: "error",
})
.then(() => {})
.catch(() => {});
}
refresh();
};
/** 事件相关 ***************/
/** 订阅新增和保存修改获奖者事件 */
eventBus.on( "onSavedRewardTelsaler", (): void =>
{
// 关闭对话框后,重新请求获奖清单,刷新页面。
ui.showEditRewardGainerDialog = false;
refresh();
});
/**
* 用于刷新页面
*/
const refresh = (): void =>
{
requestRewardGainers( requestRewardTelsalerListHandler );
};
const refreshUI = (): void =>
{
ui.showUI = false;
setTimeout(() =>
{
ui.showUI = true;
}, 0 );
};
onBeforeMount((): void =>
{
refresh();
});
return {
ui,
tableHeight,
rewardGainerData,
rewardTelsalerTable,
onCurrentPageIndexChange,
onTablePageSizeChange,
onEditRewardGainer,
refresh,
onAddRewardGainer,
onDeleteRewardGainer,
};
},
};
</script>
<style lang="scss" scoped>
@import "@/assets/css/public/_public.scss";
.wrapper {
margin: 10px;
// padding: 10px;
// background-color: #fff;
// border-radius: 5px;
// box-shadow: $box-shadow;
// &:hover {
// box-shadow: $box-shadow-hover;
// }
min-width: 800px;
>*+* {
margin-top: 10px;
}
}
.reward-wrapper {
display: flex;
justify-content: center;
align-items: center;
>div {
background-color: #fff;
border-radius: 5px;
box-shadow: $box-shadow;
padding: 10px;
&:hover {
box-shadow: $box-shadow-hover;
}
}
>*+* {
margin-left: 10px;
}
}
.reward-gainer-wrapper {
flex-grow: 1;
}
.dishonor-wrapper {
flex-grow: 1;
}
.toolbutton-wrapper {
text-align: left;
margin-bottom: 10px;
>*+* {
margin-left: 15px;
}
}
.pagination-wrapper {
margin-top: 10px;
display: flex;
justify-content: flex-end;
}
.reward-gainer-td {
cursor: pointer;
display: block;
}
</style>

View File

@@ -1,26 +0,0 @@
<!--
* @Author: Kane
* @Date: 2023-03-23 16:05:08
* @LastEditors: Kane
* @FilePath: /task_schedule/src/views/DataManagemant.vue
* @Description:
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
-->
<template>
<div>
人员管理
</div>
</template>
<script lang="ts">
export default {
name: "StaffManagement",
setup()
{
return {};
},
};
</script>
<style lang="scss" scoped>
</style>

View File

@@ -0,0 +1,115 @@
<!--
* @Author: Kane
* @Date: 2023-09-25 09:48:25
* @LastEditors: Kane
* @FilePath: /task_schedule/src/views/data/DataManagement.vue
* @Description: 数据管理view
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
-->
<template>
<div class="data_management_wrapper">
<!-- <div class="telsaler-dataupload-wrapper">
<el-upload
v-model="ui.fileList"
drag
action="http://localhost:8080/desktop_archievement_backend/file/file-upload.do"
:on-preview="handlePreview"
:on-remove="handleRemove"
:on-success="handleUploadSuccess"
:before-remove="beforeRemove"
:limit="1"
:on-exceed="handleExceed"
:data="ui.uploadData"
name="files"
>
<el-button type="primary">
上传
</el-button>
<template #tip>
<div class="el-upload__tip">
文件不能大于100MB
</div>
</template>
</el-upload>
</div> -->
<el-tabs>
<el-tab-pane label="坐席车非渗透率">
<TelsalerAttachingRateView />
</el-tab-pane>
<el-tab-pane label="坐席续保率">
坐席车非渗透率
</el-tab-pane>
<el-tab-pane label="机构">
坐席车非渗透率
</el-tab-pane>
</el-tabs>
</div>
</template>
<script lang="ts">
import { ref, reactive } from "vue";
import { ElMessage, ElMessageBox, type UploadFile, type UploadFiles, type UploadProps, type UploadUserFile } from "element-plus";
import TelsalerAttachingRateView from "@/views/data/bi/TelsalerAttachingRateView.vue";
export default {
name: "DataManagement",
components: { TelsalerAttachingRateView, },
setup()
{
const ui = reactive({
showUI: false,
fileList: ref<UploadUserFile[]>([]),
uploadData: {
"task-name": "1234",
},
});
const handleRemove: UploadProps["onRemove"] = ( file, uploadFile ) =>
{
console.log( file, uploadFile );
};
const handlePreview: UploadProps["onPreview"] = ( uploadFile ) =>
{
console.log( uploadFile );
};
const handleExceed: UploadProps["onExceed"] = ( files, uploadFiles ) =>
{
ElMessage.warning( "一次只能上传三个文件!" );
};
const beforeRemove: UploadProps["beforeRemove"] = async ( uploadFile, uploadFiles ) =>
{
return await ElMessageBox.confirm(
`放弃上传${uploadFile.name}`
)
.then(() => true, () => false );
};
const handleUploadSuccess = ( response: any, uploadFile: UploadFile, uploadFiles: UploadFiles ): void =>
{
console.log( response );
};
return {
ui,
handleRemove,
handlePreview,
handleExceed,
beforeRemove,
handleUploadSuccess,
};
},
};
</script>
<style lang="scss">
.data_management_wrapper {
margin: 10px;
min-width: 800px;
>*+* {
margin-top: 10px;
}
}
</style>

View File

@@ -0,0 +1,238 @@
<!--
* @Author: Kane
* @Date: 2023-10-17 10:56:43
* @LastEditors: Kane
* @FilePath: /task_schedule/src/views/data/bi/BiDataUploadView.vue
* @Description:
*
* Copyright (c) ${2023} by Kane, All Rights Reserved.
-->
<template>
<div class="bi-dataupload-wrapper">
<div class="query-box-wrapper">
<el-row :gutter="10">
<el-col :span="4">
<span>报表类型</span>
</el-col>
<el-col :span="9">
<el-select v-model="ui.selectedReportType">
<el-option
v-for="item in ui.reportType"
:key="item.reportTypeCode"
:label="item.reportTypeName"
:value="item.reportTypeCode"
width="100%"
/>
</el-select>
</el-col>
<el-col :span="4">
<span>sheet编号</span>
</el-col>
<el-col :span="6">
<el-input v-model.lazy.number="ui.sheetIndex" />
</el-col>
</el-row>
<el-row :gutter="10">
<el-col :span="4">
<span>起始行</span>
</el-col>
<el-col :span="9">
<el-input v-model.lazy.number="ui.firstRow" />
</el-col>
<el-col :span="11">
<span style="text-align:left;color:red;">*从0开始计数</span>
</el-col>
</el-row>
</div>
<el-upload
drag
action="http://222.76.244.118:11101/desktop_archievement_backend/file/file-upload.do"
name="files"
:show-file-list="false"
:data="ui.uploadParameters"
:on-success="onUploadSuccess"
>
<el-icon class="el-icon--upload">
<upload-filled />
</el-icon>
<div class="el-upload__text">
将文件拖到此处<em>点击上传</em>
</div>
</el-upload>
</div>
</template>
<script lang="ts">
import { reactive, ref } from "vue";
import {
type BIReportType,
type ImportBIReportRequest,
type ImportBIReportResponse,
type ImportBIReportResponseHandler,
importBIReport
} from "@/utils/BIReport.js";
import { type FileUploadResponse } from "@/utils/fileUpload.js";
// import { UploadFilled } from "@element-plus/icons-vue";
import { type UploadProps, type UploadFile, type UploadFiles, ElMessage, ElMessageBox } from "element-plus";
interface UI
{
showUI: boolean,
selectedReportType: number,
reportType: BIReportType[],
sheetIndex: number,
firstRow: number,
hasCaption: boolean,
uploadParameters: any,
showFileList: boolean,
}
export default {
name: "BiDataUploadView",
props: {
reportType: {
type: Number,
require: true,
default: (): number => -9999,
},
},
setup()
{
const ui: UI = reactive({
showUI: false,
selectedReportType: 0,
reportType: [
{
reportTypeCode: 0,
reportTypeName: "坐席车非渗透率",
},
{
reportTypeCode: 1,
reportTypeName: "坐席续保率",
},
{
reportTypeCode: 2,
reportTypeName: "部门车非渗透率",
},
{
reportTypeCode: 3,
reportTypeName: "当月个车续保率跟踪报表【机构】",
},],
sheetIndex: 0,
firstRow: 2,
hasCaption: true,
uploadParameters: {
"task-name": "1234",
},
showFileList: false,
});
/**
* 文件上传成功响应函数
* @param response 响应结果参数
* @param uploadFile
* @param uploadFiles
*/
const onUploadSuccess: UploadProps["onSuccess"] = ( response: FileUploadResponse, uploadFile: UploadFile, uploadFiles: UploadFiles ): void =>
{
// 先判断成功标志位
if ( response.success )
{
// 成功,发出导入报表请求
if ( response.fileList.length === 0 )
{
// 上传文件路径有问题,提示一下
ElMessageBox.confirm(
"上传文件的保存路径有误,请联系开发人员。",
"上传文件错误",
{
confirmButtonText: "确定",
type: "warning",
center: true,
}
)
.then((): void => {})
.catch((): void => {});
}
const request: ImportBIReportRequest = {
filePath: response.fileList[0],
reportType: ui.selectedReportType,
firstRow: ui.firstRow,
sheetIndex: ui.sheetIndex,
};
console.log( "请求参数", request );
// 发出请求
importBIReport( request, importResponseHandler );
}
else
{
// 失败了,提示一下
ElMessageBox.confirm(
response.message,
"上传文件错误",
{
confirmButtonText: "确定",
type: "warning",
center: true,
}
)
.then((): void => {})
.catch((): void => {});
}
};
/**
* handler函数
* @param response
* @param error
*/
const importResponseHandler: ImportBIReportResponseHandler = ( response: ImportBIReportResponse, error?: any ): void =>
{
if ( response.success )
{
ElMessage({
type: "success",
message: response.message,
});
}
else
{
ElMessageBox.confirm(
response.message,
"导入错误",
{
confirmButtonText: "确定",
type: "warning",
center: true,
}
)
.then((): void => {})
.catch((): void => {});
console.log( error );
}
};
return {
ui,
onUploadSuccess,
};
},
};
</script>
<style lang="scss" scoped>
@import "@/assets/css/public/_public.scss";
.bi-dataupload-wrapper {
// max-width: 600px;
width: 100%;
>*+* {
margin-top: 10px;
}
}
.query-box-wrapper {
@include query-box-wrap;
}
</style>

View File

@@ -0,0 +1,31 @@
<!--
* @Author: Kane
* @Date: 2023-10-17 14:53:17
* @LastEditors: Kane
* @FilePath: /task_schedule/src/views/data/bi/DepartmentArchievementView.vue
* @Description:
*
* Copyright (c) ${2023} by Kane, All Rights Reserved.
-->
<template>
<div class="wrapper" />
</template>
<script lang="ts">
import { reactive } from "vue";
export default {
name: "DepartmentArchievementView",
setup()
{
const ui = reactive({
showUI: true,
});
},
};
</script>
<style lang="scss" scoped>
.wrapper {
margin: 10px;
}
</style>

View File

@@ -0,0 +1,142 @@
<!--
* @Author: Kane
* @Date: 2023-10-17 14:41:39
* @LastEditors: Kane
* @FilePath: /task_schedule/src/views/data/bi/TelsalerAttachingRateView.vue
* @Description: BI坐席车非渗透率数据管理界面
*
* Copyright (c) ${2023} by Kane, All Rights Reserved.
-->
<template>
<div class="wrapper">
<el-row :gutter="10">
<el-col :span="8">
<el-button
type="warning"
icon="upload"
@click="showUploadFileDialog"
>
上传
</el-button>
</el-col>
</el-row>
<el-table
border
stripe
style="width:100%;"
>
<el-table-column
type="selection"
align="center"
/>
<el-table-column
label="部门"
align="center"
width="200"
/>
<el-table-column
label="名称"
align="center"
width="200"
/>
<el-table-column
label="车险保费(万)"
align="center"
/>
<el-table-column
label="非车险保费(万)"
align="center"
/>
<el-table-column
label="当月保费渗透率"
align="center"
/>
<el-table-column
label="渗透率环比上月"
align="center"
/>
</el-table>
<div class="pagination_wrapper">
<el-pagination
v-model="ui.tableCurrentPageIndex"
class="pull_left"
size="small"
background
:page-size="ui.tablePageSize"
:page-sizes="[10, 20, 50, 100]"
layout="total, sizes, prev, pager, next, jumper"
:total="0"
@current-change="onCurrentPageIndexChange"
@size-change="onTablePageSizeChange"
/>
</div>
<div
class="upload-dialog-wrapper"
>
<el-dialog
v-model="ui.showUploadDialog"
title="上传报表"
width="600px"
:close-on-click-modal="false"
:close-on-press-escape="false"
:show-close="true"
>
<BiDataUploadView />
</el-dialog>
</div>
</div>
</template>
<script lang="ts">
import { reactive } from "vue";
import BiDataUploadView from "@/views/data/bi/BiDataUploadView.vue";
export default {
name: "TelsalerAttachingRateView",
components: { BiDataUploadView, },
setup()
{
const ui = reactive({
showUI: true,
showUploadDialog: false,
tableCurrentPageIndex: 1,
tablePageSize: 10,
});
const showUploadFileDialog = (): void =>
{
ui.showUploadDialog = true;
};
const onCurrentPageIndexChange = ( index: number ): void =>
{
ui.tableCurrentPageIndex = index;
};
const onTablePageSizeChange = ( pageSize: number ): void =>
{
ui.tablePageSize = pageSize;
};
return {
ui,
showUploadFileDialog,
onCurrentPageIndexChange,
onTablePageSizeChange,
};
},
};
</script>
<style lang="scss" scoped>
.wrapper {
margin: 10px;
>*+* {
margin-top: 10px;
}
}
.pagination_wrapper {
display: flex;
justify-content: flex-end;
}
</style>

View File

@@ -0,0 +1,30 @@
src/views/data/bi/TelsalerAttachingRateView.vue<!--
* @Author: Kane
* @Date: 2023-10-17 14:41:39
* @LastEditors: Kane
* @FilePath: /task_schedule/src/views/data/TelsalerAttachingRateView.vue
* @Description:
*
* Copyright (c) ${2023} by Kane, All Rights Reserved.
-->
<template>
<div class="wrapper" />
</template>
<script lang="ts">
import { reactive } from "vue";
export default {
name: "TelsalerAttachingRateView",
setup()
{
const ui = reactive({
showUI: true,
});
},
};
</script>
<style lang="scss" scoped>
.wrapper {
margin: 10px;
}
</style>

View File

@@ -0,0 +1,239 @@
<!--
* @Author: Kane
* @Date: 2023-09-12 10:43:39
* @LastEditors: Kane
* @FilePath: /task_schedule/src/views/reward/RewardTelsaler.vue
* @Description:
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
-->
<template>
<div
v-if="ui.showUI"
class="reward-gainer-wrapper"
>
<el-row :gutter="10">
<el-col :span="8">
<span>奖励类型</span>
</el-col>
<el-col :span="16">
<el-select
v-model="ui.selectedRewardProjectCode"
value-key="rewardCode"
>
<el-option
v-for="item in ui.rewardProjectList"
:key="item.rewardCode"
:label="item.rewardName"
:value="item.rewardCode"
/>
</el-select>
</el-col>
</el-row>
<el-row :gutter="10">
<el-col :span="8">
<span>坐席名称</span>
</el-col>
<el-col :span="16">
<el-input v-model.trim.lazy="ui.selectedRewardTelsalerName" />
</el-col>
</el-row>
<div class="tool-button-wrapper">
<el-button
type="primary"
icon="select"
@click="onSaveRewardTelsaler"
>
保存
</el-button>
<el-button
type="danger"
icon="Close"
>
放弃
</el-button>
</div>
</div>
</template>
<script lang="ts">
import { reactive, onBeforeMount } from "vue";
import { ElMessage, ElMessageBox } from "element-plus";
import {
type RewardProject,
type RewardProjectResponse,
type AddRewardTelsalerRequest,
type AddRewardTelsalerResponse,
type UpdateRewardTelsalerRequest,
type UpdateRewardTelsalerResponse,
requestRewardPorjectsList,
addRewardTelsaler,
updateTelsalerReward
} from "@/utils/reward.js";
import eventBus from "@/utils/api/EventBus.js";
interface RewardGainerUI
{
showUI: boolean;
showEditRewardGainerDialog: boolean;
rewardProjectList: RewardProject[] | null;
selectedRewardProjectCode: number | undefined;
selectedRewardTelsalerName: string;
selectedRecID: number;
}
export default {
name: "RewardTelsaler",
props: {
selectedRecId: {
type: Number,
require: true,
default: (): number => -9999,
},
selectedRewardProjectCode: {
type: Number,
require: true,
default: (): number => -999,
},
selectedTelsalerName: {
type: String,
require: true,
default: (): string => "",
},
},
setup( props )
{
const ui: RewardGainerUI = reactive({
showUI: true,
showEditRewardGainerDialog: false,
rewardProjectList: [],
selectedRewardProjectCode: 1,
selectedRewardTelsalerName: "",
selectedRecID: 0,
});
/**
* 请求奖项清单的回调函数,用于处理请求结果。
* @param response 请求奖项清单的响应对象
* @param error 请求失败时的错误对象
*/
const applyRewardProjectsData = ( response: RewardProjectResponse, error: any ): void =>
{
if ( !response.success )
{
ElMessageBox({
message: "请求奖励项目失败,请查看日志!",
type: "error",
})
.then((): void => {})
.catch((): void => {});
return;
}
ui.rewardProjectList = response.rewardList;
};
const refresh = (): void =>
{
requestRewardPorjectsList( applyRewardProjectsData );
};
onBeforeMount((): void =>
{
ui.selectedRewardProjectCode = props.selectedRewardProjectCode;
ui.selectedRewardTelsalerName = props.selectedTelsalerName;
ui.selectedRecID = props.selectedRecId;
refresh();
});
const onSaveRewardTelsaler = (): void =>
{
if ( props.selectedRecId === -1 )
{
// 新增
const addRequest: AddRewardTelsalerRequest = {
rewardIndex: ui.selectedRewardProjectCode as number,
telsalerName: ui.selectedRewardTelsalerName,
};
addRewardTelsaler( addRequest, addRewardTelsalerHandler );
}
else
{
// 更新
const updateRequest: UpdateRewardTelsalerRequest = {
recordID: ui.selectedRecID,
telsalerName: ui.selectedRewardTelsalerName,
rewardIndex: ui.selectedRewardProjectCode as number,
};
updateTelsalerReward( updateRequest, updateTelsalerRewardHandler );
}
};
const addRewardTelsalerHandler = ( data: AddRewardTelsalerResponse, error: any ): void =>
{
if ( data.success )
{
ElMessage({
message: data.message,
type: "success",
});
}
else
{
ElMessage({
message: data.message,
type: "error",
});
}
eventBus.emit( "onSavedRewardTelsaler" );
};
const updateTelsalerRewardHandler = ( data: UpdateRewardTelsalerResponse, error: any ): void =>
{
if ( data.success )
{
ElMessage({
message: data.message,
type: "success",
});
}
else
{
ElMessage({
message: data.message,
type: "error",
});
}
eventBus.emit( "onSavedRewardTelsaler" );
};
// onBeforeUpdate((): void =>
// {
// refresh();
// });
return { ui, onSaveRewardTelsaler, };
},
};
</script>
<style lang="scss" scoped>
@import "@/assets/css/public/_public.scss";
.reward-gainer-wrapper {
width: 300px;
@include query-box-wrap;
}
.tool-button-wrapper {
display: flex;
justify-content: flex-end;
margin-top: 15px;
}
</style>

View File

@@ -0,0 +1,185 @@
<!--
* @Author: Kane
* @Date: 2023-03-23 16:05:08
* @LastEditors: Kane
* @FilePath: /task_schedule/src/views/telsaler/TelsalerManagement.vue
* @Description:
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
-->
<template>
<div class="wrapper">
<div class="query_wrapper">
<el-row :gutter="10">
<el-col :span="2">
<span>工号</span>
</el-col>
<el-col :span="4">
<el-input v-model.trim.lazy="ui.caller_code" />
</el-col>
<el-col :span="2">
<span>姓名</span>
</el-col>
<el-col :span="4">
<el-input />
</el-col>
<el-col :span="2">
<span>部门代码</span>
</el-col>
<el-col :span="4">
<el-input />
</el-col>
<el-col :span="2">
<span>部门名称</span>
</el-col>
<el-col :span="4">
<el-input />
</el-col>
</el-row>
<el-row :gutter="10">
<el-col :span="2">
<span>团队</span>
</el-col>
<el-col :span="10">
<el-input />
</el-col>
<el-col :span="12">
<div class="query-button">
<el-button
type="primary"
icon="search"
>
查询
</el-button>
<el-button icon="refresh">
重置
</el-button>
</div>
</el-col>
</el-row>
</div>
<el-table
border
stripe
style="width:100%;"
:height="tableHeight"
>
<el-table-column
type="selection"
align="center"
/>
<el-table-column
label="工号"
align="center"
width="120"
/>
<el-table-column
label="名称"
align="center"
width="200"
/>
<el-table-column
label="团队名称"
align="center"
/>
<el-table-column
label="部门"
align="center"
width="300"
/>
</el-table>
<div class="pagination_wrapper">
<el-pagination
v-model="ui.table_current_page_index"
class="pull_left"
size="small"
background
:page-size="ui.table_page_size"
:page-sizes="[10, 20, 50, 100]"
layout="total, sizes, prev, pager, next, jumper"
:total="ui.callers.length"
@current-change="onCurrentPageIndexChange"
@size-change="onTablePageSizeChange"
/>
</div>
</div>
</template>
<script lang="ts">
import { reactive, computed } from "vue";
export default {
name: "TelsalerManagement",
setup()
{
const ui = reactive({
caller_code: "",
caller_name: "",
section_office_code: "",
section_office_name: "",
table_current_page_index: 1,
table_page_size: 50,
callers: [],
});
const onCurrentPageIndexChange = ( pageIndex: number ): void =>
{
ui.table_current_page_index = pageIndex;
};
/**
* 设置表格每页显示记录的数量
* @param pageSize 表格页记录数量
*/
const onTablePageSizeChange = ( pageSize: number ): void =>
{
ui.table_page_size = pageSize;
};
/**
* 表格高度
*/
const tableHeight = computed(() =>
{
return 10 * 50 + 40;
});
return { ui, onCurrentPageIndexChange, onTablePageSizeChange, tableHeight, };
},
};
</script>
<style lang="scss" scoped>
@import "@/assets/css/public/_public.scss";
.wrapper {
padding: 10px;
background-color: #fff;
min-width: 800px;
> *+* {
margin-top: 10px;
}
}
.query_wrapper {
// display: flex;
border-radius: 5px;
padding: 15px;
@include query-box-wrap;
.query-button {
display: flex;
justify-content: flex-end;
align-items: center;
}
}
.pagination_wrapper
{
display: flex;
justify-content: flex-end;
}
</style>

View File

@@ -0,0 +1,69 @@
<!--
* @Author: Kane
* @Date: 2023-09-27 10:13:31
* @LastEditors: Kane
* @FilePath: /task_schedule/src/views/telsaler/TelsalerManagementView.vue
* @Description:
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
-->
<template>
<div
v-if="ui.showUI"
class="telsaler-management-view-wrapper"
>
<el-tabs type="border-card">
<el-tab-pane>
<template #label>
<el-icon><User /></el-icon>
<span>坐席管理</span>
</template>
<TelsalerManagement />
</el-tab-pane>
<el-tab-pane>
<template #label>
<el-icon><Document /></el-icon>
<span>导入导出</span>
</template>
导入导出
</el-tab-pane>
</el-tabs>
</div>
</template>
<script lang="ts">
import { ref, reactive } from "vue";
// import { User } from "@element-plus/icons-vue";
import TelsalerManagement from "@/views/telsaler/TelsalerManagement.vue";
export default {
name: "TelsalerManagementView",
components: { TelsalerManagement, },
setup()
{
const ui = reactive({
showUI: true,
});
return {
ui,
};
},
};
</script>
<style scoped lang="scss">
.telsaler-management-view-wrapper {
margin: 10px 10px;
min-width: 800px;
>*+* {
margin-top: 10px;
}
span {
margin-left: 4px;
vertical-align: middle;
}
}
</style>

View File

@@ -19,6 +19,7 @@
"sourceMap": true,
"resolveJsonModule": true,
"esModuleInterop": false,
"isolatedModules": true,
"baseUrl": "./", // paths 路径解析起点
"paths": { // 别名路径设置
"@/*": [
@@ -34,6 +35,7 @@
]
},
"include": [
"src/**/*",
"src/**/*.ts",
"src/**/*.tsx",
"src/**/*.vue",

View File

@@ -2,7 +2,7 @@
* @Author: Kane
* @Date: 2023-02-15 09:25:52
* @LastEditors: Kane
* @LastEditTime: 2023-03-30 21:09:30
* @LastEditTime: 2023-06-25 09:51:13
* @FilePath: /task_schedule/vite.config.js
* @Description:
*
@@ -18,6 +18,7 @@ export default defineConfig(( command, mode ) =>
const env = loadEnv( mode, process.cwd(), "" );
return {
server:{ host: "localhost", port: 5173, },
plugins: [vue(),],
base: "./",
resolve: {

View File

@@ -0,0 +1,14 @@
{
// 使用 IntelliSense 了解相关属性。
// 悬停以查看现有属性的描述。
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "java",
"name": "Current File",
"request": "launch",
"mainClass": "${file}"
}
]
}

View File

@@ -1,4 +1,8 @@
{
"java.configuration.updateBuildConfiguration": "automatic",
"java.compile.nullAnalysis.mode": "automatic"
"java.compile.nullAnalysis.mode": "automatic",
"vue.codeActions.enabled": false,
"java.debug.settings.onBuildFailureProceed": true,
"java.checkstyle.version": "10.12.4",
"java.checkstyle.configuration": "/D:/DevTools/vscode/代码格式化/eclipse-java-google-style.xml"
}

View File

@@ -0,0 +1,6 @@
{
"name": "desktop_archievement_backend",
"lockfileVersion": 3,
"requires": true,
"packages": {}
}

View File

@@ -11,16 +11,19 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.9</maven.compiler.source>
<maven.compiler.target>1.9</maven.compiler.target>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<spring.version>5.3.24</spring.version>
<log4j2.version>2.20.0</log4j2.version>
<!-- <spring.version>6.0.11</spring.version> -->
</properties>
<dependencies>
<!-- https://mvnrepository.com/artifact/junit/junit -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<version>4.13.2</version>
<scope>test</scope>
</dependency>
<dependency>
@@ -28,7 +31,12 @@
<artifactId>spring-context</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${spring.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
@@ -80,19 +88,81 @@
<version>2.13.4</version>
</dependency>
<dependency>
<!-- <dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc8</artifactId>
<version>19.3.0.0.0</version>
</dependency> -->
<dependency>
<groupId>com.oracle.database.jdbc</groupId>
<artifactId>ojdbc10</artifactId>
<version>19.19.0.0</version>
</dependency>
<dependency>
<groupId>com.oracle.database.nls</groupId>
<artifactId>orai18n</artifactId>
<version>23.2.0.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-core -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.20.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-slf4j2-impl -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j2-impl</artifactId>
<version>2.20.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-api -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.20.0</version>
</dependency>
<!-- POI -->
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>5.2.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>5.2.3</version>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.5.13</version>
</dependency>
</dependencies>
<build>
<finalName>desktop_archievement_backend</finalName>
<resources>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.properties</include>
<include>**/*.xml</include>
</includes>
<filtering>false</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.2.2</version>
<version>3.3.2</version>
<configuration></configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@@ -102,6 +172,16 @@
<skipTests>true</skipTests>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>17</source>
<target>17</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@@ -0,0 +1,19 @@
/*
* @Author: Kane
* @Date: 2023-07-27 11:05:53
* @LastEditors: Kane
* @FilePath: /desktop_archievement_backend/src/main/java/com/cpic/xim/mybatis/mapper/ArchievementMapper.java
* @Description:
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
package com.cpic.xim.mybatis.mapper;
import java.util.HashMap;
public interface ArchievementMapper
{
public void getDepartmentArchievement( HashMap<String, Object> params );
public void getCallerArchievement( HashMap<String, Object> params );
}

View File

@@ -0,0 +1,34 @@
/*
* @Author: Kane
* @Date: 2023-10-11 16:47:59
* @LastEditors: Kane
* @FilePath: /desktop_archievement_backend/src/main/java/com/cpic/xim/mybatis/mapper/ImportBIArchievementDataMapper.java
* @Description:
*
* Copyright (c) ${2023} by Kane, All Rights Reserved.
*/
package com.cpic.xim.mybatis.mapper;
import com.cpic.xim.mybatis.pojo.BIDepartmentAttachingRateRecord;
import com.cpic.xim.mybatis.pojo.BIDepartmentRenewalRateRecord;
import com.cpic.xim.mybatis.pojo.BITelsalerAttachingRateRecord;
import com.cpic.xim.mybatis.pojo.BITelsalerRenewalRateRecord;
public interface ImportBIArchievementDataMapper
{
public void insertTelsalerAttachingRateDataToDB( BITelsalerAttachingRateRecord record);
public void insertTelsalerRenewalRateDataToDB( BITelsalerRenewalRateRecord record );
public void insertDepartmentAttachingRateDataToDB(BIDepartmentAttachingRateRecord record);
public void insertDepartmentRenewalRateDataToDB(BIDepartmentRenewalRateRecord record);
public void cleanTelsalerAttachingRateData();
public void cleanTelsalerRenewalRateData();
public void cleanDepartmentAttachingRateData();
public void cleanDepartmentRenewalRateData();
}

View File

@@ -0,0 +1,17 @@
/*
* @Author: Kane
* @Date: 2023-07-29 22:59:09
* @LastEditors: Kane
* @FilePath: /desktop_archievement_backend/src/main/java/com/cpic/xim/mybatis/mapper/RankingListMapper.java
* @Description:
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
package com.cpic.xim.mybatis.mapper;
import java.util.HashMap;
public interface RankingListMapper
{
public void getRankingList( HashMap<String, Object> params );
}

View File

@@ -0,0 +1,29 @@
/*
* @Author: Kane
* @Date: 2023-09-06 11:17:44
* @LastEditors: Kane
* @FilePath: /desktop_archievement_backend/src/main/java/com/cpic/xim/mybatis/mapper/RewardsMapper.java
* @Description:
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
package com.cpic.xim.mybatis.mapper;
import java.util.ArrayList;
import java.util.HashMap;
import com.cpic.xim.mybatis.pojo.RewardGainer;
import com.cpic.xim.mybatis.pojo.RewardProject;
public interface RewardsMapper
{
public ArrayList<RewardProject> queryRewardProjects();
public ArrayList<RewardGainer> queryRewardTelsaler();
public void addRewardTelSaler( HashMap<String, Object> params );
public void updateRewardTelSaler( HashMap<String, Object> params );
public void deleteRewardTelSaler( HashMap<String, Object> params );
}

View File

@@ -0,0 +1,296 @@
/*
* @Author: Kane
* @Date: 2023-10-10 14:50:55
* @LastEditors: Kane
* @FilePath: /desktop_archievement_backend/src/main/java/com/cpic/xim/mybatis/pojo/BIDepartmentAttachingRateRecord.java
* @Description:
*
* Copyright (c) ${2023} by Kane, All Rights Reserved.
*/
package com.cpic.xim.mybatis.pojo;
public class BIDepartmentAttachingRateRecord
{
// 部门
private String departmentName;
// 目标值-机构
private double departmentObject;
// 目标差距
private double objectGap;
// 车险保费(万)
private double motoPremium;
// 车险保费占比
private double motoPremiumProPortion;
// 非车保费(万)
private double nomotoPremium;
// 当月保费渗透率
private double attachingRate;
// 保费渗透率环比上月
private double attachingRateChange;
// 车险客户数
private int motoInsuranceCustomerCount;
// 当月客户渗透率
private double customerHandleRate;
// 客户渗透率环比上月
private double customerHandleRateChange;
// 当月车非客均保费
private double premiumPerCustomer;
// 客均保费环比上月
private double premiumPerCustomerChange;
public BIDepartmentAttachingRateRecord( String departmentName, double departmentObject,
double objectGap, double motoPremium, double motoPremiumProPortion,
double nomotoPremium, double attachingRate, double attachingRateChange,
int motoInsuranceCustomerCount, double customerHandleRate,
double customerHandleRateChange, double premiumPerCustomer,
double premiumPerCustomerChange )
{
this.departmentName = departmentName;
this.departmentObject = departmentObject;
this.objectGap = objectGap;
this.motoPremium = motoPremium;
this.motoPremiumProPortion = motoPremiumProPortion;
this.nomotoPremium = nomotoPremium;
this.attachingRate = attachingRate;
this.attachingRateChange = attachingRateChange;
this.motoInsuranceCustomerCount = motoInsuranceCustomerCount;
this.customerHandleRate = customerHandleRate;
this.customerHandleRateChange = customerHandleRateChange;
this.premiumPerCustomer = premiumPerCustomer;
this.premiumPerCustomerChange = premiumPerCustomerChange;
}
public int getMotoInsuranceCustomerCount()
{
return motoInsuranceCustomerCount;
}
public void setMotoInsuranceCustomerCount( int motoInsuranceCustomerCount )
{
this.motoInsuranceCustomerCount = motoInsuranceCustomerCount;
}
@Override
public String toString()
{
return "BIDepartmentAttachingRateRecord [departmentName=" + departmentName
+ ", departmentObject=" + departmentObject + ", objectGap=" + objectGap
+ ", motoPremium=" + motoPremium + ", motoPremiumProPortion="
+ motoPremiumProPortion + ", nomotoPremium=" + nomotoPremium + ", attachingRate="
+ attachingRate + ", attachingRateChange=" + attachingRateChange
+ ", motoInsuranceCustomerCount=" + motoInsuranceCustomerCount
+ ", customerHandleRate=" + customerHandleRate + ", customerHandleRateChange="
+ customerHandleRateChange + ", premiumPerCustomer=" + premiumPerCustomer
+ ", premiumPerCustomerChange=" + premiumPerCustomerChange + "]";
}
@Override
public int hashCode()
{
final int prime = 31;
int result = 1;
result = prime * result + ((departmentName == null) ? 0 : departmentName.hashCode());
long temp;
temp = Double.doubleToLongBits( departmentObject );
result = prime * result + (int) (temp ^ (temp >>> 32));
temp = Double.doubleToLongBits( objectGap );
result = prime * result + (int) (temp ^ (temp >>> 32));
temp = Double.doubleToLongBits( motoPremium );
result = prime * result + (int) (temp ^ (temp >>> 32));
temp = Double.doubleToLongBits( motoPremiumProPortion );
result = prime * result + (int) (temp ^ (temp >>> 32));
temp = Double.doubleToLongBits( nomotoPremium );
result = prime * result + (int) (temp ^ (temp >>> 32));
temp = Double.doubleToLongBits( attachingRate );
result = prime * result + (int) (temp ^ (temp >>> 32));
temp = Double.doubleToLongBits( attachingRateChange );
result = prime * result + (int) (temp ^ (temp >>> 32));
result = prime * result + motoInsuranceCustomerCount;
temp = Double.doubleToLongBits( customerHandleRate );
result = prime * result + (int) (temp ^ (temp >>> 32));
temp = Double.doubleToLongBits( customerHandleRateChange );
result = prime * result + (int) (temp ^ (temp >>> 32));
temp = Double.doubleToLongBits( premiumPerCustomer );
result = prime * result + (int) (temp ^ (temp >>> 32));
temp = Double.doubleToLongBits( premiumPerCustomerChange );
result = prime * result + (int) (temp ^ (temp >>> 32));
return result;
}
@Override
public boolean equals( Object obj )
{
if ( this == obj )
return true;
if ( obj == null )
return false;
if ( getClass() != obj.getClass() )
return false;
BIDepartmentAttachingRateRecord other = (BIDepartmentAttachingRateRecord) obj;
if ( departmentName == null )
{
if ( other.departmentName != null )
return false;
}
else if ( !departmentName.equals( other.departmentName ) )
return false;
if ( Double.doubleToLongBits( departmentObject ) != Double
.doubleToLongBits( other.departmentObject ) )
return false;
if ( Double.doubleToLongBits( objectGap ) != Double.doubleToLongBits( other.objectGap ) )
return false;
if ( Double.doubleToLongBits( motoPremium ) != Double
.doubleToLongBits( other.motoPremium ) )
return false;
if ( Double.doubleToLongBits( motoPremiumProPortion ) != Double
.doubleToLongBits( other.motoPremiumProPortion ) )
return false;
if ( Double.doubleToLongBits( nomotoPremium ) != Double
.doubleToLongBits( other.nomotoPremium ) )
return false;
if ( Double.doubleToLongBits( attachingRate ) != Double
.doubleToLongBits( other.attachingRate ) )
return false;
if ( Double.doubleToLongBits( attachingRateChange ) != Double
.doubleToLongBits( other.attachingRateChange ) )
return false;
if ( motoInsuranceCustomerCount != other.motoInsuranceCustomerCount )
return false;
if ( Double.doubleToLongBits( customerHandleRate ) != Double
.doubleToLongBits( other.customerHandleRate ) )
return false;
if ( Double.doubleToLongBits( customerHandleRateChange ) != Double
.doubleToLongBits( other.customerHandleRateChange ) )
return false;
if ( Double.doubleToLongBits( premiumPerCustomer ) != Double
.doubleToLongBits( other.premiumPerCustomer ) )
return false;
if ( Double.doubleToLongBits( premiumPerCustomerChange ) != Double
.doubleToLongBits( other.premiumPerCustomerChange ) )
return false;
return true;
}
public String getDepartmentName()
{
return departmentName;
}
public void setDepartmentName( String departmentName )
{
this.departmentName = departmentName;
}
public double getDepartmentObject()
{
return departmentObject;
}
public void setDepartmentObject( double departmentObject )
{
this.departmentObject = departmentObject;
}
public double getObjectGap()
{
return objectGap;
}
public void setObjectGap( double objectGap )
{
this.objectGap = objectGap;
}
public double getMotoPremium()
{
return motoPremium;
}
public void setMotoPremium( double motoPremium )
{
this.motoPremium = motoPremium;
}
public double getMotoPremiumProPortion()
{
return motoPremiumProPortion;
}
public void setMotoPremiumProPortion( double motoPremiumProPortion )
{
this.motoPremiumProPortion = motoPremiumProPortion;
}
public double getNomotoPremium()
{
return nomotoPremium;
}
public void setNomotoPremium( double nomotoPremium )
{
this.nomotoPremium = nomotoPremium;
}
public double getAttachingRate()
{
return attachingRate;
}
public void setAttachingRate( double attachingRate )
{
this.attachingRate = attachingRate;
}
public double getAttachingRateChange()
{
return attachingRateChange;
}
public void setAttachingRateChange( double attachingRateChange )
{
this.attachingRateChange = attachingRateChange;
}
public double getCustomerHandleRate()
{
return customerHandleRate;
}
public void setCustomerHandleRate( double customerHandleRate )
{
this.customerHandleRate = customerHandleRate;
}
public double getCustomerHandleRateChange()
{
return customerHandleRateChange;
}
public void setCustomerHandleRateChange( double customerHandleRateChange )
{
this.customerHandleRateChange = customerHandleRateChange;
}
public double getPremiumPerCustomer()
{
return premiumPerCustomer;
}
public void setPremiumPerCustomer( double premiumPerCustomer )
{
this.premiumPerCustomer = premiumPerCustomer;
}
public double getPremiumPerCustomerChange()
{
return premiumPerCustomerChange;
}
public void setPremiumPerCustomerChange( double premiumPerCustomerChange )
{
this.premiumPerCustomerChange = premiumPerCustomerChange;
}
}

View File

@@ -0,0 +1,214 @@
/*
* @Author: Kane
* @Date: 2023-10-24 11:06:29
* @LastEditors: Kane
* @FilePath: /desktop_archievement_backend/src/main/java/com/cpic/xim/mybatis/pojo/BIDepartmentRenewalRateRecord.java
* @Description: BI机构当月个车续保率跟踪表记录对象
*
* Copyright (c) ${2023} by Kane, All Rights Reserved.
*/
package com.cpic.xim.mybatis.pojo;
public class BIDepartmentRenewalRateRecord
{
private String 责任部门;
private double 机构目标值;
private int 到期数全月;
private double 序时到期数占比;
private double 个车续保率序时;
private double 个车续保率全月;
private double 环比昨日;
private double 环比上月;
private int 平均提前签单天数;
private double 环比;
public BIDepartmentRenewalRateRecord() {}
public BIDepartmentRenewalRateRecord( String 责任部门, double 机构目标值, int 到期数全月, double 序时到期数占比,
double 个车续保率序时, double 个车续保率全月, double 环比昨日, double 环比上月, int 平均提前签单天数, double 环比 )
{
this.责任部门 = 责任部门;
this.机构目标值 = 机构目标值;
this.到期数全月 = 到期数全月;
this.序时到期数占比 = 序时到期数占比;
this.个车续保率序时 = 个车续保率序时;
this.个车续保率全月 = 个车续保率全月;
this.环比昨日 = 环比昨日;
this.环比上月 = 环比上月;
this.平均提前签单天数 = 平均提前签单天数;
this.环比 = 环比;
}
public String get责任部门()
{
return 责任部门;
}
public void set责任部门( String 责任部门 )
{
this.责任部门 = 责任部门;
}
public double get机构目标值()
{
return 机构目标值;
}
public void set机构目标值( double 机构目标值 )
{
this.机构目标值 = 机构目标值;
}
public int get到期数全月()
{
return 到期数全月;
}
public void set到期数全月( int 到期数全月 )
{
this.到期数全月 = 到期数全月;
}
public double get序时到期数占比()
{
return 序时到期数占比;
}
public void set序时到期数占比( double 序时到期数占比 )
{
this.序时到期数占比 = 序时到期数占比;
}
public double get个车续保率序时()
{
return 个车续保率序时;
}
public void set个车续保率序时( double 个车续保率序时 )
{
this.个车续保率序时 = 个车续保率序时;
}
public double get个车续保率全月()
{
return 个车续保率全月;
}
public void set个车续保率全月( double 个车续保率全月 )
{
this.个车续保率全月 = 个车续保率全月;
}
public double get环比昨日()
{
return 环比昨日;
}
public void set环比昨日( double 环比昨日 )
{
this.环比昨日 = 环比昨日;
}
public double get环比上月()
{
return 环比上月;
}
public void set环比上月( double 环比上月 )
{
this.环比上月 = 环比上月;
}
public int get平均提前签单天数()
{
return 平均提前签单天数;
}
public void set平均提前签单天数( int 平均提前签单天数 )
{
this.平均提前签单天数 = 平均提前签单天数;
}
public double get环比()
{
return 环比;
}
public void set环比( double 环比 )
{
this.环比 = 环比;
}
@Override
public int hashCode()
{
final int prime = 31;
int result = 1;
result = prime * result + ((责任部门 == null) ? 0 : 责任部门.hashCode());
long temp;
temp = Double.doubleToLongBits( 机构目标值 );
result = prime * result + (int) (temp ^ (temp >>> 32));
result = prime * result + 到期数全月;
temp = Double.doubleToLongBits( 序时到期数占比 );
result = prime * result + (int) (temp ^ (temp >>> 32));
temp = Double.doubleToLongBits( 个车续保率序时 );
result = prime * result + (int) (temp ^ (temp >>> 32));
temp = Double.doubleToLongBits( 个车续保率全月 );
result = prime * result + (int) (temp ^ (temp >>> 32));
temp = Double.doubleToLongBits( 环比昨日 );
result = prime * result + (int) (temp ^ (temp >>> 32));
temp = Double.doubleToLongBits( 环比上月 );
result = prime * result + (int) (temp ^ (temp >>> 32));
result = prime * result + 平均提前签单天数;
temp = Double.doubleToLongBits( 环比 );
result = prime * result + (int) (temp ^ (temp >>> 32));
return result;
}
@Override
public boolean equals( Object obj )
{
if ( this == obj )
return true;
if ( obj == null )
return false;
if ( getClass() != obj.getClass() )
return false;
BIDepartmentRenewalRateRecord other = (BIDepartmentRenewalRateRecord) obj;
if ( 责任部门 == null )
{
if ( other.责任部门 != null )
return false;
}
else if ( !责任部门.equals( other.责任部门 ) )
return false;
if ( Double.doubleToLongBits( 机构目标值 ) != Double.doubleToLongBits( other.机构目标值 ) )
return false;
if ( 到期数全月 != other.到期数全月 )
return false;
if ( Double.doubleToLongBits( 序时到期数占比 ) != Double.doubleToLongBits( other.序时到期数占比 ) )
return false;
if ( Double.doubleToLongBits( 个车续保率序时 ) != Double.doubleToLongBits( other.个车续保率序时 ) )
return false;
if ( Double.doubleToLongBits( 个车续保率全月 ) != Double.doubleToLongBits( other.个车续保率全月 ) )
return false;
if ( Double.doubleToLongBits( 环比昨日 ) != Double.doubleToLongBits( other.环比昨日 ) )
return false;
if ( Double.doubleToLongBits( 环比上月 ) != Double.doubleToLongBits( other.环比上月 ) )
return false;
if ( 平均提前签单天数 != other.平均提前签单天数 )
return false;
if ( Double.doubleToLongBits( 环比 ) != Double.doubleToLongBits( other.环比 ) )
return false;
return true;
}
@Override
public String toString()
{
return "BIDepartmentRenewalRateRecord [责任部门=" + 责任部门 + ", 机构目标值=" + 机构目标值 + ", 到期数全月="
+ 到期数全月 + ", 序时到期数占比=" + 序时到期数占比 + ", 个车续保率序时=" + 个车续保率序时 + ", 个车续保率全月=" + 个车续保率全月
+ ", 环比昨日=" + 环比昨日 + ", 环比上月=" + 环比上月 + ", 平均提前签单天数=" + 平均提前签单天数 + ", 环比=" + 环比
+ "]";
}
}

View File

@@ -0,0 +1,311 @@
/*
* @Author: Kane
* @Date: 2023-10-08 14:45:13
* @LastEditors: Kane
* @FilePath: /desktop_archievement_backend/src/main/java/com/cpic/xim/mybatis/pojo/BITelsalerAttachingRateRecord.java
* @Description: 用于存放BI导出每日电销坐席车险非车险保费和车非渗透率数据.
*
* Copyright (c) ${2023} by Kane, All Rights Reserved.
*/
package com.cpic.xim.mybatis.pojo;
import java.time.LocalDate;
import com.fasterxml.jackson.annotation.JsonProperty;
public class BITelsalerAttachingRateRecord
{
// 部门
@JsonProperty( "departmentName" )
private String departmentName;
// 统计日期
@JsonProperty( "summaryDate" )
private LocalDate summaryDate;
// 坐席名称
@JsonProperty( "telsalerName" )
private String telsalerName;
// 车险保费
@JsonProperty( "motoPremium" )
private double motoPremium;
// 非车险保费
@JsonProperty( "nomotoPremium" )
private double nomotoPremium;
// 车险保费占比
@JsonProperty( "motoPremiumProportion" )
private double motoPremiumProportion;
// 渗透率
@JsonProperty( "attachingRate" )
private double attachingRate;
// 渗透率环比上月
@JsonProperty( "attachingRateChange" )
private double attachingRateChange;
// 当月客户渗透率
@JsonProperty( "customerHandleRateCell" )
private double customerHandleRate;
// 客户渗透率环比上月
@JsonProperty( "customerHandleRateChangeCell" )
private double customerHandleRateChange;
// 当月车非客均保费
@JsonProperty( "noMotoPremiumPerCustomerCell" )
private double noMotoPremiumPerCustomer;
// 客均保费环比上月
@JsonProperty( "noMotoPremiumPerCustomerChangeCell" )
private double noMotoPremiumPerCustomerChange;
public BITelsalerAttachingRateRecord( String departmentName, LocalDate summaryDate,
String telsalerName, double motoPremium, double nomotoPremium,
double motoPremiumProportion, double attachingRate, double attachingRateChange,
double customerHandleRate, double customerHandleRateChange,
double noMotoPremiumPerCustomer, double noMotoPremiumPerCustomerChange )
{
this.departmentName = departmentName;
this.summaryDate = summaryDate;
this.telsalerName = telsalerName;
this.motoPremium = motoPremium;
this.nomotoPremium = nomotoPremium;
this.motoPremiumProportion = motoPremiumProportion;
this.attachingRate = attachingRate;
this.attachingRateChange = attachingRateChange;
this.customerHandleRate = customerHandleRate;
this.customerHandleRateChange = customerHandleRateChange;
this.noMotoPremiumPerCustomer = noMotoPremiumPerCustomer;
this.noMotoPremiumPerCustomerChange = noMotoPremiumPerCustomerChange;
}
public BITelsalerAttachingRateRecord()
{}
public double getCustomerHandleRate()
{
return customerHandleRate;
}
public void setCustomerHandleRate( double customerHandleRate )
{
this.customerHandleRate = customerHandleRate;
}
public double getCustomerHandleRateChange()
{
return customerHandleRateChange;
}
public void setCustomerHandleRateChange( double customerHandleRateChange )
{
this.customerHandleRateChange = customerHandleRateChange;
}
public double getNoMotoPremiumPerCustomer()
{
return noMotoPremiumPerCustomer;
}
public void setNoMotoPremiumPerCustomer( double noMotoPremiumPerCustomer )
{
this.noMotoPremiumPerCustomer = noMotoPremiumPerCustomer;
}
public double getNoMotoPremiumPerCustomerChange()
{
return noMotoPremiumPerCustomerChange;
}
public void setNoMotoPremiumPerCustomerChange( double noMotoPremiumPerCustomerChange )
{
this.noMotoPremiumPerCustomerChange = noMotoPremiumPerCustomerChange;
}
@Override
public String toString()
{
return "BITelsalerAttachingRateRecord [departmentName=" + departmentName + ", summaryDate="
+ summaryDate + ", telsalerName=" + telsalerName + ", motoPremium=" + motoPremium
+ ", nomotoPremium=" + nomotoPremium + ", motoPremiumProportion="
+ motoPremiumProportion + ", attachingRate=" + attachingRate
+ ", attachingRateChange=" + attachingRateChange + ", customerHandleRate="
+ customerHandleRate + ", customerHandleRateChange=" + customerHandleRateChange
+ ", noMotoPremiumPerCustomer=" + noMotoPremiumPerCustomer
+ ", noMotoPremiumPerCustomerChange=" + noMotoPremiumPerCustomerChange + "]";
}
@Override
public int hashCode()
{
final int prime = 31;
int result = 1;
result = prime * result + ((departmentName == null) ? 0 : departmentName.hashCode());
result = prime * result + ((summaryDate == null) ? 0 : summaryDate.hashCode());
result = prime * result + ((telsalerName == null) ? 0 : telsalerName.hashCode());
long temp;
temp = Double.doubleToLongBits( motoPremium );
result = prime * result + (int) (temp ^ (temp >>> 32));
temp = Double.doubleToLongBits( nomotoPremium );
result = prime * result + (int) (temp ^ (temp >>> 32));
temp = Double.doubleToLongBits( motoPremiumProportion );
result = prime * result + (int) (temp ^ (temp >>> 32));
temp = Double.doubleToLongBits( attachingRate );
result = prime * result + (int) (temp ^ (temp >>> 32));
temp = Double.doubleToLongBits( attachingRateChange );
result = prime * result + (int) (temp ^ (temp >>> 32));
temp = Double.doubleToLongBits( customerHandleRate );
result = prime * result + (int) (temp ^ (temp >>> 32));
temp = Double.doubleToLongBits( customerHandleRateChange );
result = prime * result + (int) (temp ^ (temp >>> 32));
temp = Double.doubleToLongBits( noMotoPremiumPerCustomer );
result = prime * result + (int) (temp ^ (temp >>> 32));
temp = Double.doubleToLongBits( noMotoPremiumPerCustomerChange );
result = prime * result + (int) (temp ^ (temp >>> 32));
return result;
}
@Override
public boolean equals( Object obj )
{
if ( this == obj )
return true;
if ( obj == null )
return false;
if ( getClass() != obj.getClass() )
return false;
BITelsalerAttachingRateRecord other = (BITelsalerAttachingRateRecord) obj;
if ( departmentName == null )
{
if ( other.departmentName != null )
return false;
}
else if ( !departmentName.equals( other.departmentName ) )
return false;
if ( summaryDate == null )
{
if ( other.summaryDate != null )
return false;
}
else if ( !summaryDate.equals( other.summaryDate ) )
return false;
if ( telsalerName == null )
{
if ( other.telsalerName != null )
return false;
}
else if ( !telsalerName.equals( other.telsalerName ) )
return false;
if ( Double.doubleToLongBits( motoPremium ) != Double
.doubleToLongBits( other.motoPremium ) )
return false;
if ( Double.doubleToLongBits( nomotoPremium ) != Double
.doubleToLongBits( other.nomotoPremium ) )
return false;
if ( Double.doubleToLongBits( motoPremiumProportion ) != Double
.doubleToLongBits( other.motoPremiumProportion ) )
return false;
if ( Double.doubleToLongBits( attachingRate ) != Double
.doubleToLongBits( other.attachingRate ) )
return false;
if ( Double.doubleToLongBits( attachingRateChange ) != Double
.doubleToLongBits( other.attachingRateChange ) )
return false;
if ( Double.doubleToLongBits( customerHandleRate ) != Double
.doubleToLongBits( other.customerHandleRate ) )
return false;
if ( Double.doubleToLongBits( customerHandleRateChange ) != Double
.doubleToLongBits( other.customerHandleRateChange ) )
return false;
if ( Double.doubleToLongBits( noMotoPremiumPerCustomer ) != Double
.doubleToLongBits( other.noMotoPremiumPerCustomer ) )
return false;
if ( Double.doubleToLongBits( noMotoPremiumPerCustomerChange ) != Double
.doubleToLongBits( other.noMotoPremiumPerCustomerChange ) )
return false;
return true;
}
public LocalDate getSummaryDate()
{
return summaryDate;
}
public void setSummaryDate( LocalDate summaryDate )
{
this.summaryDate = summaryDate;
}
public String getTelsalerName()
{
return telsalerName;
}
public void setTelsalerName( String telsalerName )
{
this.telsalerName = telsalerName;
}
public double getMotoPremium()
{
return motoPremium;
}
public void setMotoPremium( double motoPremium )
{
this.motoPremium = motoPremium;
}
public double getNomotoPremium()
{
return nomotoPremium;
}
public void setNomotoPremium( double nomotoPremium )
{
this.nomotoPremium = nomotoPremium;
}
public double getMotoPremiumProportion()
{
return motoPremiumProportion;
}
public void setMotoPremiumProportion( double motoPremiumProportion )
{
this.motoPremiumProportion = motoPremiumProportion;
}
public double getAttachingRate()
{
return attachingRate;
}
public void setAttachingRate( double attachingRate )
{
this.attachingRate = attachingRate;
}
public double getAttachingRateChange()
{
return attachingRateChange;
}
public void setAttachingRateChange( double attachingRateChange )
{
this.attachingRateChange = attachingRateChange;
}
public String getDepartmentName()
{
return departmentName;
}
public void setDepartmentName( String departmentName )
{
this.departmentName = departmentName;
}
}

View File

@@ -0,0 +1,236 @@
/*
* @Author: Kane
* @Date: 2023-10-09 21:45:39
* @LastEditors: Kane
* @FilePath: /desktop_archievement_backend/src/main/java/com/cpic/xim/mybatis/pojo/BITelsalerRenewalRateRecord.java
* @Description: BI导出的续保率Excel文件行记录。
*
* Copyright (c) ${2023} by Kane, All Rights Reserved.
*/
package com.cpic.xim.mybatis.pojo;
public class BITelsalerRenewalRateRecord
{
private String 责任部门;
private String 责任人;
private double 机构目标值;
private double 到期数全月;
private double 序时到期数占比;
private double 个车续保率序时;
private double 个车续保率全月;
private double 环比昨日;
private double 环比上月;
private double 平均提前签单天数;
private double 环比;
public BITelsalerRenewalRateRecord( String 责任部门, String 责任人, double 机构目标值, double 到期数全月,
double 序时到期数占比, double 个车续保率序时, double 个车续保率全月, double 环比昨日, double 环比上月,
double 平均提前签单天数, double 环比 )
{
this.责任部门 = 责任部门;
this.责任人 = 责任人;
this.机构目标值 = 机构目标值;
this.到期数全月 = 到期数全月;
this.序时到期数占比 = 序时到期数占比;
this.个车续保率序时 = 个车续保率序时;
this.个车续保率全月 = 个车续保率全月;
this.环比昨日 = 环比昨日;
this.环比上月 = 环比上月;
this.平均提前签单天数 = 平均提前签单天数;
this.环比 = 环比;
}
public double get平均提前签单天数()
{
return 平均提前签单天数;
}
public void set平均提前签单天数( double 平均提前签单天数 )
{
this.平均提前签单天数 = 平均提前签单天数;
}
public double get环比()
{
return 环比;
}
public void set环比( double 环比 )
{
this.环比 = 环比;
}
public String get责任部门()
{
return 责任部门;
}
public void set责任部门( String 责任部门 )
{
this.责任部门 = 责任部门;
}
@Override
public int hashCode()
{
final int prime = 31;
int result = 1;
result = prime * result + ((责任部门 == null) ? 0 : 责任部门.hashCode());
result = prime * result + ((责任人 == null) ? 0 : 责任人.hashCode());
long temp;
temp = Double.doubleToLongBits( 机构目标值 );
result = prime * result + (int) (temp ^ (temp >>> 32));
temp = Double.doubleToLongBits( 到期数全月 );
result = prime * result + (int) (temp ^ (temp >>> 32));
temp = Double.doubleToLongBits( 序时到期数占比 );
result = prime * result + (int) (temp ^ (temp >>> 32));
temp = Double.doubleToLongBits( 个车续保率序时 );
result = prime * result + (int) (temp ^ (temp >>> 32));
temp = Double.doubleToLongBits( 个车续保率全月 );
result = prime * result + (int) (temp ^ (temp >>> 32));
temp = Double.doubleToLongBits( 环比昨日 );
result = prime * result + (int) (temp ^ (temp >>> 32));
temp = Double.doubleToLongBits( 环比上月 );
result = prime * result + (int) (temp ^ (temp >>> 32));
temp = Double.doubleToLongBits( 平均提前签单天数 );
result = prime * result + (int) (temp ^ (temp >>> 32));
temp = Double.doubleToLongBits( 环比 );
result = prime * result + (int) (temp ^ (temp >>> 32));
return result;
}
@Override
public boolean equals( Object obj )
{
if ( this == obj )
return true;
if ( obj == null )
return false;
if ( getClass() != obj.getClass() )
return false;
BITelsalerRenewalRateRecord other = (BITelsalerRenewalRateRecord) obj;
if ( 责任部门 == null )
{
if ( other.责任部门 != null )
return false;
}
else if ( !责任部门.equals( other.责任部门 ) )
return false;
if ( 责任人 == null )
{
if ( other.责任人 != null )
return false;
}
else if ( !责任人.equals( other.责任人 ) )
return false;
if ( Double.doubleToLongBits( 机构目标值 ) != Double.doubleToLongBits( other.机构目标值 ) )
return false;
if ( Double.doubleToLongBits( 到期数全月 ) != Double.doubleToLongBits( other.到期数全月 ) )
return false;
if ( Double.doubleToLongBits( 序时到期数占比 ) != Double.doubleToLongBits( other.序时到期数占比 ) )
return false;
if ( Double.doubleToLongBits( 个车续保率序时 ) != Double.doubleToLongBits( other.个车续保率序时 ) )
return false;
if ( Double.doubleToLongBits( 个车续保率全月 ) != Double.doubleToLongBits( other.个车续保率全月 ) )
return false;
if ( Double.doubleToLongBits( 环比昨日 ) != Double.doubleToLongBits( other.环比昨日 ) )
return false;
if ( Double.doubleToLongBits( 环比上月 ) != Double.doubleToLongBits( other.环比上月 ) )
return false;
if ( Double.doubleToLongBits( 平均提前签单天数 ) != Double.doubleToLongBits( other.平均提前签单天数 ) )
return false;
if ( Double.doubleToLongBits( 环比 ) != Double.doubleToLongBits( other.环比 ) )
return false;
return true;
}
@Override
public String toString()
{
return "BITelsalerRenewalRateRecord [责任部门=" + 责任部门 + ", 责任人=" + 责任人 + ", 机构目标值=" + 机构目标值
+ ", 到期数全月=" + 到期数全月 + ", 序时到期数占比=" + 序时到期数占比 + ", 个车续保率序时=" + 个车续保率序时
+ ", 个车续保率全月=" + 个车续保率全月 + ", 环比昨日=" + 环比昨日 + ", 环比上月=" + 环比上月 + ", 平均提前签单天数="
+ 平均提前签单天数 + ", 环比=" + 环比 + "]";
}
public String get责任人()
{
return 责任人;
}
public void set责任人( String 责任人 )
{
this.责任人 = 责任人;
}
public double get机构目标值()
{
return 机构目标值;
}
public void set机构目标值( double 机构目标值 )
{
this.机构目标值 = 机构目标值;
}
public double get到期数全月()
{
return 到期数全月;
}
public void set到期数全月( double 到期数全月 )
{
this.到期数全月 = 到期数全月;
}
public double get序时到期数占比()
{
return 序时到期数占比;
}
public void set序时到期数占比( double 序时到期数占比 )
{
this.序时到期数占比 = 序时到期数占比;
}
public double get个车续保率序时()
{
return 个车续保率序时;
}
public void set个车续保率序时( double 个车续保率序时 )
{
this.个车续保率序时 = 个车续保率序时;
}
public double get个车续保率全月()
{
return 个车续保率全月;
}
public void set个车续保率全月( double 个车续保率全月 )
{
this.个车续保率全月 = 个车续保率全月;
}
public double get环比昨日()
{
return 环比昨日;
}
public void set环比昨日( double 环比昨日 )
{
this.环比昨日 = 环比昨日;
}
public double get环比上月()
{
return 环比上月;
}
public void set环比上月( double 环比上月 )
{
this.环比上月 = 环比上月;
}
}

View File

@@ -0,0 +1,93 @@
/*
* @Author: Kane
* @Date: 2023-07-27 11:12:19
* @LastEditors: Kane
* @FilePath: /desktop_archievement_backend/src/main/java/com/cpic/xim/mybatis/pojo/MensualArchievementItem.java
* @Description: 每月业绩对象。
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
package com.cpic.xim.mybatis.pojo;
import com.fasterxml.jackson.annotation.JsonProperty;
public class MensualArchievementItem
{
public MensualArchievementItem()
{}
public MensualArchievementItem( int month, String premium)
{
this.month = month;
this.premium = premium;
}
public int getMonth()
{
return month;
}
public void setMonth( int month )
{
this.month = month;
}
public String getPremium()
{
return premium;
}
public void setPremium( String premium )
{
this.premium = premium;
}
@Override
public int hashCode()
{
final int prime = 31;
int result = 1;
result = prime * result + month;
result = prime * result + ((premium == null) ? 0 : premium.hashCode());
return result;
}
@Override
public boolean equals( Object obj )
{
if ( this == obj )
return true;
if ( obj == null )
return false;
if ( getClass() != obj.getClass() )
return false;
MensualArchievementItem other = (MensualArchievementItem) obj;
if ( month != other.month )
return false;
if ( premium == null )
{
if ( other.premium != null )
return false;
} else if ( !premium.equals( other.premium ) )
return false;
return true;
}
@Override
public String toString()
{
return "MensualArchievementItem [month=" + month + ", premium=" + premium + "]";
}
// 月份
@JsonProperty( "month" )
private int month;
// 月总保费
@JsonProperty( "premium" )
private String premium;
}

View File

@@ -0,0 +1,149 @@
/*
* @Author: Kane
* @Date: 2023-09-07 15:18:46
* @LastEditors: Kane
* @FilePath: /desktop_archievement_backend/src/main/java/com/cpic/xim/mybatis/pojo/RewardGainer.java
* @Description: 获奖人对象
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
package com.cpic.xim.mybatis.pojo;
import com.fasterxml.jackson.annotation.JsonProperty;
public class RewardGainer
{
public RewardGainer()
{}
public RewardGainer( int recID, String callerName, String callerCode, int rewardProjectCode,
String rewardProjectName)
{
this.recID = recID;
this.callerName = callerName;
this.callerCode = callerCode;
this.rewardProjectCode = rewardProjectCode;
this.rewardProjectName = rewardProjectName;
}
@Override
public String toString()
{
return "RewardGainer [recID=" + recID + ", callerName=" + callerName + ", callerCode="
+ callerCode + ", rewardProjectCode=" + rewardProjectCode + ", rewardProjectName="
+ rewardProjectName + "]";
}
@Override
public int hashCode()
{
final int prime = 31;
int result = 1;
result = prime * result + recID;
result = prime * result + ((callerName == null) ? 0 : callerName.hashCode());
result = prime * result + ((callerCode == null) ? 0 : callerCode.hashCode());
result = prime * result + rewardProjectCode;
result = prime * result + ((rewardProjectName == null) ? 0 : rewardProjectName.hashCode());
return result;
}
@Override
public boolean equals( Object obj )
{
if ( this == obj )
return true;
if ( obj == null )
return false;
if ( getClass() != obj.getClass() )
return false;
RewardGainer other = (RewardGainer) obj;
if ( recID != other.recID )
return false;
if ( callerName == null )
{
if ( other.callerName != null )
return false;
} else if ( !callerName.equals( other.callerName ) )
return false;
if ( callerCode == null )
{
if ( other.callerCode != null )
return false;
} else if ( !callerCode.equals( other.callerCode ) )
return false;
if ( rewardProjectCode != other.rewardProjectCode )
return false;
if ( rewardProjectName == null )
{
if ( other.rewardProjectName != null )
return false;
} else if ( !rewardProjectName.equals( other.rewardProjectName ) )
return false;
return true;
}
public int getRecID()
{
return recID;
}
public void setRecID( int recID )
{
this.recID = recID;
}
public String getCallerName()
{
return callerName;
}
public void setCallerName( String callerName )
{
this.callerName = callerName;
}
public String getCallerCode()
{
return callerCode;
}
public void setCallerCode( String callerCode )
{
this.callerCode = callerCode;
}
public int getRewardProjectCode()
{
return rewardProjectCode;
}
public void setRewardProjectCode( int rewardProjectCode )
{
this.rewardProjectCode = rewardProjectCode;
}
public String getRewardProjectName()
{
return rewardProjectName;
}
public void setRewardProjectName( String rewardProjectName )
{
this.rewardProjectName = rewardProjectName;
}
@JsonProperty( "recID" )
private int recID;
@JsonProperty( "callerName" )
private String callerName;
@JsonProperty( "callerCode" )
private String callerCode;
@JsonProperty( "rewardProjectCode" )
private int rewardProjectCode;
@JsonProperty( "rewardProjectName" )
private String rewardProjectName;
}

View File

@@ -0,0 +1,90 @@
/*
* @Author: Kane
* @Date: 2023-09-06 11:00:35
* @LastEditors: Kane
* @FilePath: /desktop_archievement_backend/src/main/java/com/cpic/xim/mybatis/pojo/RewardProject.java
* @Description: 奖励项目对象
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
package com.cpic.xim.mybatis.pojo;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* 奖励项目对象
*/
public class RewardProject
{
public RewardProject( int rewardCode, String rewardName)
{
this.rewardCode = rewardCode;
this.rewardName = rewardName;
}
public int getRewardCode()
{
return rewardCode;
}
public void setRewardCode( int rewardCode )
{
this.rewardCode = rewardCode;
}
public String getRewardName()
{
return rewardName;
}
public void setRewardName( String rewardName )
{
this.rewardName = rewardName;
}
@Override
public String toString()
{
return "RewardProject [rewardCode=" + rewardCode + ", rewardName=" + rewardName + "]";
}
@Override
public int hashCode()
{
final int prime = 31;
int result = 1;
result = prime * result + rewardCode;
result = prime * result + ((rewardName == null) ? 0 : rewardName.hashCode());
return result;
}
@Override
public boolean equals( Object obj )
{
if ( this == obj )
return true;
if ( obj == null )
return false;
if ( getClass() != obj.getClass() )
return false;
RewardProject other = (RewardProject) obj;
if ( rewardCode != other.rewardCode )
return false;
if ( rewardName == null )
{
if ( other.rewardName != null )
return false;
} else if ( !rewardName.equals( other.rewardName ) )
return false;
return true;
}
// 奖励项目代码
@JsonProperty("rewardCode")
private int rewardCode;
// 奖励项目名称
@JsonProperty("rewardName")
private String rewardName;
}

View File

@@ -0,0 +1,341 @@
/*
* @Author: Kane
* @Date: 2023-10-07 23:29:22
* @LastEditors: Kane
* @FilePath: /desktop_archievement_backend/src/main/java/com/cpic/xim/mybatis/pojo/TelsalerFromJYGL.java
* @Description: 经营管理系统中导出的电销坐席数据记录。
*
* Copyright (c) ${2023} by Kane, All Rights Reserved.
*/
package com.cpic.xim.mybatis.pojo;
import java.time.LocalDate;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* 经营管理系统中导出的电销坐席数据记录。
* @author Kane
*/
public class TelsalerFromJYGL
{
// 名称
@JsonProperty("telsalerName")
private String telsalerName;
// 坐席工号
@JsonProperty("telsalerCode")
private String telsalerCode;
// 籍贯
@JsonProperty("nativePlace")
private String nativePlace;
// 参加工作时间
@JsonProperty("startWorkingDate")
private LocalDate startWorkingDate;
// 入司时间
@JsonProperty("employmentDate")
private LocalDate employmentDate;
// 业务类型
@JsonProperty("business")
private String business;
// 办公地省
@JsonProperty("province")
private String province;
// 办公地市
@JsonProperty("city")
private String city;
// 人员类别
@JsonProperty("employmentType")
private String employmentType;
// 现任岗位
@JsonProperty("quarters")
private String quarters;
// 现任职级
@JsonProperty("rank")
private String rank;
// 机构名称
@JsonProperty("branchName")
private String branchName;
// 职场分类
@JsonProperty("workPlaceType")
private String workPlaceType;
public TelsalerFromJYGL() {}
@Override
public String toString()
{
return "TelsalerFromJYGL [telsalerName=" + telsalerName + ", telsalerCode=" + telsalerCode
+ ", nativePlace=" + nativePlace + ", startWorkingDate=" + startWorkingDate
+ ", employmentDate=" + employmentDate + ", business=" + business + ", province="
+ province + ", city=" + city + ", employmentType=" + employmentType + ", quarters="
+ quarters + ", rank=" + rank + ", branchName=" + branchName + ", workPlaceType="
+ workPlaceType + "]";
}
@Override
public int hashCode()
{
final int prime = 31;
int result = 1;
result = prime * result + ((telsalerName == null) ? 0 : telsalerName.hashCode());
result = prime * result + ((telsalerCode == null) ? 0 : telsalerCode.hashCode());
result = prime * result + ((nativePlace == null) ? 0 : nativePlace.hashCode());
result = prime * result + ((startWorkingDate == null) ? 0 : startWorkingDate.hashCode());
result = prime * result + ((employmentDate == null) ? 0 : employmentDate.hashCode());
result = prime * result + ((business == null) ? 0 : business.hashCode());
result = prime * result + ((province == null) ? 0 : province.hashCode());
result = prime * result + ((city == null) ? 0 : city.hashCode());
result = prime * result + ((employmentType == null) ? 0 : employmentType.hashCode());
result = prime * result + ((quarters == null) ? 0 : quarters.hashCode());
result = prime * result + ((rank == null) ? 0 : rank.hashCode());
result = prime * result + ((branchName == null) ? 0 : branchName.hashCode());
result = prime * result + ((workPlaceType == null) ? 0 : workPlaceType.hashCode());
return result;
}
@Override
public boolean equals( Object obj )
{
if ( this == obj )
return true;
if ( obj == null )
return false;
if ( getClass() != obj.getClass() )
return false;
TelsalerFromJYGL other = (TelsalerFromJYGL) obj;
if ( telsalerName == null )
{
if ( other.telsalerName != null )
return false;
}
else if ( !telsalerName.equals( other.telsalerName ) )
return false;
if ( telsalerCode == null )
{
if ( other.telsalerCode != null )
return false;
}
else if ( !telsalerCode.equals( other.telsalerCode ) )
return false;
if ( nativePlace == null )
{
if ( other.nativePlace != null )
return false;
}
else if ( !nativePlace.equals( other.nativePlace ) )
return false;
if ( startWorkingDate == null )
{
if ( other.startWorkingDate != null )
return false;
}
else if ( !startWorkingDate.equals( other.startWorkingDate ) )
return false;
if ( employmentDate == null )
{
if ( other.employmentDate != null )
return false;
}
else if ( !employmentDate.equals( other.employmentDate ) )
return false;
if ( business == null )
{
if ( other.business != null )
return false;
}
else if ( !business.equals( other.business ) )
return false;
if ( province == null )
{
if ( other.province != null )
return false;
}
else if ( !province.equals( other.province ) )
return false;
if ( city == null )
{
if ( other.city != null )
return false;
}
else if ( !city.equals( other.city ) )
return false;
if ( employmentType == null )
{
if ( other.employmentType != null )
return false;
}
else if ( !employmentType.equals( other.employmentType ) )
return false;
if ( quarters == null )
{
if ( other.quarters != null )
return false;
}
else if ( !quarters.equals( other.quarters ) )
return false;
if ( rank == null )
{
if ( other.rank != null )
return false;
}
else if ( !rank.equals( other.rank ) )
return false;
if ( branchName == null )
{
if ( other.branchName != null )
return false;
}
else if ( !branchName.equals( other.branchName ) )
return false;
if ( workPlaceType == null )
{
if ( other.workPlaceType != null )
return false;
}
else if ( !workPlaceType.equals( other.workPlaceType ) )
return false;
return true;
}
public String getTelsalerName()
{
return telsalerName;
}
public void setTelsalerName( String telsalerName )
{
this.telsalerName = telsalerName;
}
public String getTelsalerCode()
{
return telsalerCode;
}
public void setTelsalerCode( String telsalerCode )
{
this.telsalerCode = telsalerCode;
}
public String getNativePlace()
{
return nativePlace;
}
public void setNativePlace( String nativePlace )
{
this.nativePlace = nativePlace;
}
public LocalDate getStartWorkingDate()
{
return startWorkingDate;
}
public void setStartWorkingDate( LocalDate startWorkingDate )
{
this.startWorkingDate = startWorkingDate;
}
public LocalDate getEmploymentDate()
{
return employmentDate;
}
public void setEmploymentDate( LocalDate employmentDate )
{
this.employmentDate = employmentDate;
}
public String getBusiness()
{
return business;
}
public void setBusiness( String business )
{
this.business = business;
}
public String getProvince()
{
return province;
}
public void setProvince( String province )
{
this.province = province;
}
public String getCity()
{
return city;
}
public void setCity( String city )
{
this.city = city;
}
public String getEmploymentType()
{
return employmentType;
}
public void setEmploymentType( String employmentType )
{
this.employmentType = employmentType;
}
public String getQuarters()
{
return quarters;
}
public void setQuarters( String quarters )
{
this.quarters = quarters;
}
public String getRank()
{
return rank;
}
public void setRank( String rank )
{
this.rank = rank;
}
public String getBranchName()
{
return branchName;
}
public void setBranchName( String branchName )
{
this.branchName = branchName;
}
public String getWorkPlaceType()
{
return workPlaceType;
}
public void setWorkPlaceType( String workPlaceType )
{
this.workPlaceType = workPlaceType;
}
}

View File

@@ -0,0 +1,128 @@
/*
* @Author: Kane
* @Date: 2023-07-27 17:22:55
* @LastEditors: Kane
* @FilePath: /desktop_archievement_backend/src/main/java/com/cpic/xim/mybatis/utils/MybatisUtils.java
* @Description: mybatis的工具集合
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
package com.cpic.xim.mybatis.utils;
import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.ExecutorType;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;
public class MybatisUtils
{
private static HashMap<String, SqlSession> SessionMap = new HashMap<>(5);
private static HashMap<String, SqlSession> SessionMapBatch = new HashMap<>(5);
private static String DEFAULT_CONFIGFILE = "mybatis/mybatis-config.xml";
/**
*
* @param configFile
* @return
* @throws IOException
*/
public static SqlSession getSqlSession( String configFile ) throws IOException
{
// 根据配置文件的路径查找是否已经创建了对应的session
SqlSession session = SessionMap.get( configFile );
// 找到就直接返回
if ( session != null )
{
return session;
}
// 没找到就创建一个
InputStream configIS = Resources.getResourceAsStream( configFile );
SqlSessionFactory factory = new SqlSessionFactoryBuilder().build( configIS );
session = factory.openSession();
// 保存
SessionMap.put( configFile, session );
return session;
}
public static SqlSession getSqlSessionBatch( String configFile ) throws IOException
{
SqlSession sessionBatch = SessionMapBatch.get( configFile );
if ( sessionBatch != null )
{
return sessionBatch;
}
// 没有缓存的就创建一个新的
InputStream configIS = Resources.getResourceAsStream( configFile );
SqlSessionFactory factory = new SqlSessionFactoryBuilder().build( configIS );
sessionBatch = factory.openSession(ExecutorType.BATCH, false );
//保存
SessionMapBatch.put( configFile, sessionBatch );
return sessionBatch;
}
/**
*
* @return
* @throws IOException
*/
public static SqlSession getSqlSession() throws IOException
{
// 根据配置文件的路径查找是否已经创建了对应的session
SqlSession session = SessionMap.get( DEFAULT_CONFIGFILE );
// 找到就直接返回
if ( session != null )
{
return session;
}
// 没找到就创建一个
InputStream configIS = Resources.getResourceAsStream( DEFAULT_CONFIGFILE );
SqlSessionFactory factory = new SqlSessionFactoryBuilder().build( configIS );
session = factory.openSession();
// 保存
SessionMap.put( DEFAULT_CONFIGFILE, session );
return session;
}
/**
* 获取一个Batch模式的sqlsession使用默认路径的mybatis-config.xml文件。
* 先判断SessionMapBatch中是否有和配置文件对应的缓存的sqlsession对象有就直接使用。
* 没有就创建一个新的然后放入SessionMapBatch中。
* @return ExecutorType.BATCH模式的sqlsession实例对象
* @throws IOException 读取配置文件错误时抛出IOException异常
*/
public static SqlSession getSqlSessionBatch() throws IOException
{
SqlSession sessionBatch = SessionMapBatch.get( DEFAULT_CONFIGFILE );
if ( sessionBatch != null )
{
return sessionBatch;
}
// 没有缓存的就创建一个新的
InputStream configIS = Resources.getResourceAsStream( DEFAULT_CONFIGFILE );
SqlSessionFactory factory = new SqlSessionFactoryBuilder().build( configIS );
sessionBatch = factory.openSession(ExecutorType.BATCH, false );
//保存
SessionMapBatch.put( DEFAULT_CONFIGFILE, sessionBatch );
return sessionBatch;
}
}

View File

@@ -16,6 +16,7 @@ import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
@SuppressWarnings( "unused" )
public final class TeleSalerInfo
{
/**
@@ -38,7 +39,15 @@ public final class TeleSalerInfo
this.departmentName = departmentName;
}
public static TeleSalerInfo queryTeleSalerInfo( String code )
/**
* 查询坐席工号的static方法。
* @param telsalerCode 坐席工号
* @return TeleSalerInfo对象。
* @throws ClassNotFoundException
* @throws SQLException
*/
public static TeleSalerInfo queryTeleSalerInfo( String telsalerCode )
throws ClassNotFoundException, SQLException
{
TeleSalerInfo info = null;
@@ -47,6 +56,92 @@ public final class TeleSalerInfo
String password = "Cpic123456";
String jdbcURL = "jdbc:oracle:thin:@10.39.0.86:1521:xmcx1";
Connection connection = null;
PreparedStatement statement = null;
ResultSet result = null;
String sql = """
SELECT s.saler_code,
s.saler_name,
t.team_code,
t.team,
bm.department_code,
bm.department_name
FROM tele_saler s,
tele_saler_team t,
idst0.bm_t bm
WHERE s.team_code = t.team_code
AND t.department_code = bm.department_code
AND s.saler_code = ? """;
// String sql = "SELECT DISTINCT s.saler_code, s.saler_name, \n"
// + " t.team_code, t.team, \n"
// + " bm.department_code, bm.department_name \n"
// + " FROM tele_saler s, tele_saler_team t, \n"
// + " i dst0.bm_t bm \n" + " WHERE s.team_code = t.team_code \n"
// + " AND t.department_code = bm.department_code \n" + " AND s.saler_code = ? ";
try
{
Class.forName( "oracle.jdbc.driver.OracleDriver" );
connection = DriverManager.getConnection( jdbcURL, userName, password );
statement = connection.prepareStatement( sql );
statement.setString( 1, telsalerCode );
result = statement.executeQuery();
if ( result.next() )
{
String code = result.getString( 1 );
String name = result.getString( 2 );
String teamCode = result.getString( 3 );
String teamName = result.getString( 4 );
String departmentCode = result.getString( 5 );
String departmentName = result.getString( 6 );
info = new TeleSalerInfo( code, name, teamCode, teamName, departmentCode,
departmentName );
}
}
finally
{
try
{
if ( result != null )
{
result.close();
}
}
catch ( Exception exception )
{
exception.printStackTrace();
}
try
{
if ( statement != null )
{
statement.close();
}
}
catch ( Exception exception )
{
exception.printStackTrace();
}
try
{
if ( connection != null )
{
connection.close();
}
}
catch ( Exception exception )
{
exception.printStackTrace();
}
}
return info;
}

View File

@@ -0,0 +1,319 @@
/*
* @Author: Kane
* @Date: 2023-05-02 09:52:15
* @LastEditors: Kane
* @FilePath: /desktop_archievement_backend/src/main/java/com/cpic/xim/utils/archievement/CallerArchievement.java
* @Description:
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
package com.cpic.xim.utils.archievement;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import org.apache.ibatis.session.SqlSession;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.cpic.xim.mybatis.mapper.ArchievementMapper;
import com.cpic.xim.mybatis.pojo.MensualArchievementItem;
import com.cpic.xim.mybatis.utils.MybatisUtils;
import com.fasterxml.jackson.annotation.JsonProperty;
public class CallerArchievement
{
private static Logger logger = LoggerFactory.getLogger( CallerArchievement.class );
private static ArrayList<MensualArchievementItem> monthArray = null;
// 静态代码块
static
{
// 初始化月份
monthArray = new ArrayList<MensualArchievementItem>( 12 );
monthArray.add( new MensualArchievementItem( 1, "0" ) );
monthArray.add( new MensualArchievementItem( 2, "0" ) );
monthArray.add( new MensualArchievementItem( 3, "0" ) );
monthArray.add( new MensualArchievementItem( 4, "0" ) );
monthArray.add( new MensualArchievementItem( 5, "0" ) );
monthArray.add( new MensualArchievementItem( 6, "0" ) );
monthArray.add( new MensualArchievementItem( 7, "0" ) );
monthArray.add( new MensualArchievementItem( 8, "0" ) );
monthArray.add( new MensualArchievementItem( 9, "0" ) );
monthArray.add( new MensualArchievementItem( 10, "0" ) );
monthArray.add( new MensualArchievementItem( 11, "0" ) );
monthArray.add( new MensualArchievementItem( 12, "0" ) );
}
public static CallerArchievement getCallerArchievement( String callerCode ) throws IOException
{
CallerArchievement archievement = null;
SqlSession session = MybatisUtils.getSqlSession();
ArchievementMapper mapper = session.getMapper( ArchievementMapper.class );
HashMap<String, Object> params = new HashMap<String, Object>();
Integer totalArchievement = null;
double motoPremiumPresentMonth = 0;
String attachingRate = null;
String renewalRate = null;
ArrayList<MensualArchievementItem> mensual = null;
params.put( "a_caller_code", callerCode );
mapper.getCallerArchievement( params );
// 总业绩
if ( params.get( "a_total" ) instanceof Integer )
{
totalArchievement = (Integer) params.get( "a_total" );
}
else
{
totalArchievement = Integer.valueOf( 0 );
}
// 当月车险保费
motoPremiumPresentMonth = ((Double) params.get( "a_present_month" )).doubleValue();
// 车非融合
if ( params.get( "a_attaching_rate" ) instanceof String )
{
attachingRate = (String) params.get( "a_attaching_rate" );
}
else
{
attachingRate = "0.0";
}
// 续保率
if ( params.get( "a_renewal_rate" ) instanceof String )
{
renewalRate = (String) params.get( "a_renewal_rate" );
}
else
{
renewalRate = "0.0";
}
// 处理每月业绩
// ArrayList<MensualArchievementItem> mensualList = new
// ArrayList<>(CallerArchievement.monthArray);
// 数据库接收的每月业绩,要检查是否有缺漏
if ( params.get( "a_mensual_cur" ) instanceof ArrayList )
{
mensual = (ArrayList<MensualArchievementItem>) params.get( "a_mensual_cur" );
}
archievement = new CallerArchievement( callerCode, totalArchievement,
motoPremiumPresentMonth, mensual, renewalRate, attachingRate );
return archievement;
}
public static Logger getLogger()
{
return logger;
}
public static void setLogger( Logger logger )
{
CallerArchievement.logger = logger;
}
public static ArrayList<MensualArchievementItem> getMonthArray()
{
return monthArray;
}
public static void setMonthArray( ArrayList<MensualArchievementItem> monthArray )
{
CallerArchievement.monthArray = monthArray;
}
@JsonProperty( "caller_code" )
private String callerCode;
@JsonProperty( "total_archievement" )
private long totalArchievement; // 总业绩
@JsonProperty( "motoPremiumPresentMonth" )
private double motoPremiumPresentMonth; // 当月车险保费
// 每月业绩列表
// 要保证数据是按照月份排序。
@JsonProperty( "mensual_archievement_list" )
private ArrayList<MensualArchievementItem> mensualArchievementList;
@JsonProperty( "insurance_renewal_rate" )
private String insuranceRenewalRate; // 续保率
@JsonProperty( "attaching_rate" )
private String attachingRate; // 车非渗透率
/**
* 构造函数
* @param callerCode
* @param totalArchievement
* @param mensualArchievementList
* @param insuranceRenewalRate
* @param attachingRate
*/
public CallerArchievement( String callerCode, long totalArchievement,
double motoPremiumPresentMonth,
ArrayList<MensualArchievementItem> mensualArchievementList, String insuranceRenewalRate,
String attachingRate )
{
this.callerCode = callerCode;
this.totalArchievement = totalArchievement;
this.motoPremiumPresentMonth = motoPremiumPresentMonth;
this.mensualArchievementList = mensualArchievementList;
this.insuranceRenewalRate = insuranceRenewalRate;
this.attachingRate = attachingRate;
}
public CallerArchievement()
{
this.totalArchievement = 0;
this.motoPremiumPresentMonth = 0;
this.mensualArchievementList = null;
this.insuranceRenewalRate = "";
this.attachingRate = "";
this.callerCode = "";
}
@Override
public String toString()
{
return "CallerArchievement [callerCode=" + callerCode + ", totalArchievement="
+ totalArchievement + ", motoPremiumPresentMonth=" + motoPremiumPresentMonth
+ ", mensualArchievementList=" + mensualArchievementList + ", insuranceRenewalRate="
+ insuranceRenewalRate + ", attachingRate=" + attachingRate + "]";
}
@Override
public int hashCode()
{
final int prime = 31;
int result = 1;
result = prime * result + ((callerCode == null) ? 0 : callerCode.hashCode());
result = prime * result + (int) (totalArchievement ^ (totalArchievement >>> 32));
long temp;
temp = Double.doubleToLongBits( motoPremiumPresentMonth );
result = prime * result + (int) (temp ^ (temp >>> 32));
result = prime * result
+ ((mensualArchievementList == null) ? 0 : mensualArchievementList.hashCode());
result = prime * result
+ ((insuranceRenewalRate == null) ? 0 : insuranceRenewalRate.hashCode());
result = prime * result + ((attachingRate == null) ? 0 : attachingRate.hashCode());
return result;
}
@Override
public boolean equals( Object obj )
{
if ( this == obj )
return true;
if ( obj == null )
return false;
if ( getClass() != obj.getClass() )
return false;
CallerArchievement other = (CallerArchievement) obj;
if ( callerCode == null )
{
if ( other.callerCode != null )
return false;
}
else if ( !callerCode.equals( other.callerCode ) )
return false;
if ( totalArchievement != other.totalArchievement )
return false;
if ( Double.doubleToLongBits( motoPremiumPresentMonth ) != Double
.doubleToLongBits( other.motoPremiumPresentMonth ) )
return false;
if ( mensualArchievementList == null )
{
if ( other.mensualArchievementList != null )
return false;
}
else if ( !mensualArchievementList.equals( other.mensualArchievementList ) )
return false;
if ( insuranceRenewalRate == null )
{
if ( other.insuranceRenewalRate != null )
return false;
}
else if ( !insuranceRenewalRate.equals( other.insuranceRenewalRate ) )
return false;
if ( attachingRate == null )
{
if ( other.attachingRate != null )
return false;
}
else if ( !attachingRate.equals( other.attachingRate ) )
return false;
return true;
}
public double getMotoPremiumPresentMonth()
{
return motoPremiumPresentMonth;
}
public void setMotoPremiumPresentMonth( double motoPremiumPresentMonth )
{
this.motoPremiumPresentMonth = motoPremiumPresentMonth;
}
public String getCallerCode()
{
return callerCode;
}
public void setCallerCode( String callerCode )
{
this.callerCode = callerCode;
}
public long getTotalArchievement()
{
return totalArchievement;
}
public void setTotalArchievement( long totalArchievement )
{
this.totalArchievement = totalArchievement;
}
public ArrayList<MensualArchievementItem> getMensualArchievementList()
{
return mensualArchievementList;
}
public void setMensualArchievementList(
ArrayList<MensualArchievementItem> mensualArchievementList )
{
this.mensualArchievementList = mensualArchievementList;
}
public String getInsuranceRenewalRate()
{
return insuranceRenewalRate;
}
public void setInsuranceRenewalRate( String insuranceRenewalRate )
{
this.insuranceRenewalRate = insuranceRenewalRate;
}
public String getAttachingRate()
{
return attachingRate;
}
public void setAttachingRate( String attachingRate )
{
this.attachingRate = attachingRate;
}
}

View File

@@ -0,0 +1,172 @@
/*
* @Author: Kane
* @Date: 2023-05-02 10:11:27
* @LastEditors: Kane
* @FilePath: /desktop_archievement_backend/src/main/java/com/cpic/xim/utils/archievement/DepartmentArchievement.java
* @Description:
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
package com.cpic.xim.utils.archievement;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import org.apache.ibatis.session.SqlSession;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.cpic.xim.mybatis.mapper.ArchievementMapper;
import com.cpic.xim.mybatis.pojo.MensualArchievementItem;
import com.cpic.xim.mybatis.utils.MybatisUtils;
import com.fasterxml.jackson.annotation.JsonProperty;
public class DepartmentArchievement
{
// log4j2
private static Logger logger = LoggerFactory.getLogger(DepartmentArchievement.class);
/**
* 默认的构造函数提供给json使用。
*/
public DepartmentArchievement()
{
this.totalArchievement = 0;
this.mensualArchievementList = null;
this.insuranceRenewalRate = "";
this.attachingRate = "";
this.departmentCode = "";
}
/**
* @brief 构造函数,提供所有成员对象的值。
* @param departmentCode 部门代码
* @param totalArchievement 总业绩
* @param mensualArchievementList 每月业绩表
* @param insuranceRenewalRate 续保率
* @param attachingRate 车非渗透率
*/
public DepartmentArchievement( String departmentCode, long totalArchievement,
ArrayList<MensualArchievementItem> mensualArchievementList, String insuranceRenewalRate, String attachingRate)
{
this.departmentCode = departmentCode;
this.totalArchievement = totalArchievement;
this.mensualArchievementList = mensualArchievementList;
this.insuranceRenewalRate = insuranceRenewalRate;
this.attachingRate = attachingRate;
}
/**
* 静态方法,用于根据部门代码,查询部门业绩,生成一个 DepartmentArchievement 对象。
* @param departmentCode 部门代码
* @return
* @throws IOException
*/
@SuppressWarnings("unchecked")
public static DepartmentArchievement getDepartmentArchievement( String departmentCode )
throws IOException
{
DepartmentArchievement archievement = null;
try
{
SqlSession session = MybatisUtils.getSqlSession();
ArchievementMapper mapper = session.getMapper(ArchievementMapper.class);
// 参数集合
HashMap<String, Object> params = new HashMap<>(5);
params.put("a_department_code", departmentCode);
mapper.getDepartmentArchievement(params);
Integer totalArchievement = (Integer)params.get("a_total");
String attachingRate = (String)params.get("a_attaching_rate");
String renewalRate = (String)params.get("a_renewal_rate");
ArrayList<MensualArchievementItem> mensual = (ArrayList<MensualArchievementItem>)params.get("a_mensual_cur");
archievement = new DepartmentArchievement(
departmentCode,
totalArchievement.intValue(),
mensual,
renewalRate,
attachingRate);
}
catch ( IOException error )
{
String errorMessage = "查询" + departmentCode + "业绩时出现错误。";
logger.error(errorMessage, error);
throw error;
}
return archievement;
}
public long getTotalArchievement()
{
return totalArchievement;
}
public void setTotalArchievement( long totalArchievement )
{
this.totalArchievement = totalArchievement;
}
public ArrayList<MensualArchievementItem> getMensualArchievementList()
{
return mensualArchievementList;
}
public void setMensualArchievementList( ArrayList<MensualArchievementItem> mensualArchievementList )
{
this.mensualArchievementList = mensualArchievementList;
}
public String getInsuranceRenewalRate()
{
return insuranceRenewalRate;
}
public void setInsuranceRenewalRate( String insuranceRenewalRate )
{
this.insuranceRenewalRate = insuranceRenewalRate;
}
public String getAttachingRate()
{
return attachingRate;
}
public void setAttachingRate( String attachingRate )
{
this.attachingRate = attachingRate;
}
public String getDepartmentCode()
{
return departmentCode;
}
public void setDepartmentCode( String departmentCode )
{
this.departmentCode = departmentCode;
}
@JsonProperty( "department_code" )
private String departmentCode;
@JsonProperty( "total_archievement" )
private long totalArchievement; // 总业绩
// 每月业绩列表
// 要保证数据是按照月份排序。
@JsonProperty( "mensual_archievement_list" )
private ArrayList<MensualArchievementItem> mensualArchievementList;
@JsonProperty( "insurance_renewal_rate" )
private String insuranceRenewalRate; // 续保率
@JsonProperty( "attaching_rate" )
private String attachingRate; // 车非渗透率
}

View File

@@ -0,0 +1,535 @@
/*
* @Author: Kane
* @Date: 2023-10-08 15:02:15
* @LastEditors: Kane
* @FilePath: /desktop_archievement_backend/src/main/java/com/cpic/xim/utils/data/ImportBIExcelData.java
* @Description: 坐席业绩相关的数据操作方法。
*
* Copyright (c) ${2023} by Kane, All Rights Reserved.
*/
package com.cpic.xim.utils.data;
import java.io.File;
import java.io.IOException;
import java.time.LocalDate;
import java.util.ArrayList;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.usermodel.WorkbookFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.cpic.xim.mybatis.pojo.BIDepartmentAttachingRateRecord;
import com.cpic.xim.mybatis.pojo.BIDepartmentRenewalRateRecord;
import com.cpic.xim.mybatis.pojo.BITelsalerAttachingRateRecord;
import com.cpic.xim.mybatis.pojo.BITelsalerRenewalRateRecord;
import com.cpic.xim.utils.poi.MyPOIUtils;
/**
* 坐席业绩相关的数据操作方法。
*/
public final class ImportBIExcelData
{
private static Logger logger = LoggerFactory.getLogger( ImportBIExcelData.class );
private static String[] TelsalerAttachingRateExcelTitle = new String[]
{ "部门", "经办", "车险保费(万)", "车险保费占比", "非车保费(万)", "当月保费渗透率", "保费渗透率环比上月", "当月客户渗透率", "客户渗透率环比上月",
"当月车非客均保费", "客均保费环比上月"};
private static String[] TelSalerRenewalRateExcelTitle = new String[]
{ "责任部门", "责任人", "机构目标值1(%)", "到期数-全月", "序时到期数占比(%)", "个车续保率(序时)(%)", "个车续保率(全月)(%)", "环比昨日(%)",
"环比上月(%)", "平均提前签单天数", "环比"};
private static String[] DepartmentAttachingRateExcelTitle = new String[]
{ "部门", "目标值-机构", "目标差距", "车险保费(万)", "车险保费占比", "非车保费(万)", "当月保费渗透率", "保费渗透率环比上月", "车险客户数", "当月客户渗透率",
"客户渗透率环比上月", "当月车非客均保费", "客均保费环比上月"};
private static String[] DepartmentRenewalRateExcelTitle = new String[]
{ "责任部门", "机构目标值1(%)", "到期数-全月", "序时到期数占比(%)", "个车续保率(序时)(%)", "个车续保率(全月)(%)", "环比昨日(%)",
"环比上月(%)", "平均提前签单天数", "环比",};
/**
* 用于通过对比标题行判断excel文件格式的函数。
* @param sheet
* @param caption 标题行文字
* @param captionRowIndex 标题行索引
* @param title 字段行文字数组
* @param titleRowIndex 字段行索引
* @return 返回判断结果
*/
private static boolean checkExcelFormat( Sheet sheet, String caption, int captionRowIndex,
String[] title, int titleRowIndex )
{
boolean result = true;
Row captionRow = sheet.getRow( captionRowIndex );
Row titleRow = sheet.getRow( titleRowIndex );
if ( caption != null && !caption.isEmpty() )
{
try
{
int captionCellNum = captionRow.getFirstCellNum();
String captionString = MyPOIUtils.getStringCellValue( captionRow, captionCellNum );
if ( !caption.equals( captionString ) )
{
result = false;
}
}
catch ( NullPointerException error )
{
result = false;
}
}
if ( title.length != 0 )
{
int cellIndex = 0;
try
{
for ( Cell cell : titleRow )
{
String cellString = MyPOIUtils.getStringCellValue( cell );
if ( !cellString.equals( title[cellIndex] ) )
{
result = false;
break;
}
cellIndex++;
}
}
catch ( NullPointerException error )
{
result = false;
}
}
return result;
}
/**
* 从excel文件读取坐席的车非渗透率数据
* @param filePath 文件路径
* @param SheetIndex sheet索引
* @param firstRow 数据起始行
* @return 返回一个ArrayList保存的TelsalerAttachingRateRecord记录数组。
* @throws IOException 打开excel文件错误时抛出。
* @throws InvalidFormatException excel单元格格式错误时抛出
*/
public static ArrayList<BITelsalerAttachingRateRecord> importBITelsalerAttachingRateRecordFromXlsx(
String filePath, int SheetIndex, int firstRow )
throws IOException, InvalidFormatException
{
ArrayList<BITelsalerAttachingRateRecord> records = new ArrayList<>( 200 );
Workbook wb = null;
Sheet sheet = null;
String name = null;
String departmentName = null;
String departmentCurrentRow = null;
try
{
wb = WorkbookFactory.create( new File( filePath ) );
sheet = wb.getSheetAt( SheetIndex );
// 先验证格式,不对就抛出错误
if ( !checkExcelFormat( sheet, null, 0, TelsalerAttachingRateExcelTitle, 0 ) )
{
throw new InvalidFormatException( "Excel文件格式错误请检查报表内容" );
}
for ( Row row : sheet )
{
int rowIndex = row.getRowNum();
// 从数据行开始
if ( row.getRowNum() < firstRow )
{
continue;
}
try
{
// 部门
try
{
departmentCurrentRow = MyPOIUtils.getStringCellValue( row, 0 );
// 因为是合并列,所以要判断一下是不是空的
if ( !departmentCurrentRow.equals( "" )
&& !departmentCurrentRow.equals( "合计" ) )
{
// 不是空的,也不是合计,说明是新部门的数据,更新部门名称
departmentName = departmentCurrentRow;
}
}
catch ( NullPointerException error )
{
// cell是空的说明还是上一行的部门
}
// 坐席名称
name = MyPOIUtils.getStringCellValue( row, 1 );
// 忽略坐席名称为空的行
if ( name.equals( "全流程" ) || name.equals( "其他" ) || name.isEmpty() )
{
continue;
}
// 车险保费
double motoPremium = MyPOIUtils.getNumbericCellValue( row, 2 );
// 非车险保费
double nomotoPremium = MyPOIUtils.getNumbericCellValue( row, 4 );
// 车险保费占比
double motoPremiumProPortion = MyPOIUtils.getNumbericCellValue( row, 3 ) * 100;
// 当月保费渗透率
double attachingRate = MyPOIUtils.getNumbericCellValue( row, 5 ) * 100;
// 保费渗透率环比上月
double attachingRateChange = MyPOIUtils.getNumbericCellValue( row, 6 ) * 100;
// 当月客户渗透率
double customerHandleRateCell = MyPOIUtils.getNumbericCellValue( row, 7 ) * 100;
// 客户渗透率环比上月
double customerHandleRateChangeCell =
MyPOIUtils.getNumbericCellValue( row, 8 ) * 100;
// 当月车非客均保费
double noMotoPremiumPerCustomerCell =
MyPOIUtils.getNumbericCellValue( row, 9 ) * 100;
// 客均保费环比上月
double noMotoPremiumPerCustomerChangeCell =
MyPOIUtils.getNumbericCellValue( row, 10 ) * 100;
BITelsalerAttachingRateRecord record = new BITelsalerAttachingRateRecord(
departmentName, LocalDate.now(), name, motoPremium, nomotoPremium,
motoPremiumProPortion, attachingRate, attachingRateChange,
customerHandleRateCell, customerHandleRateChangeCell,
noMotoPremiumPerCustomerCell, noMotoPremiumPerCustomerChangeCell );
records.add( record );
}
catch ( IllegalStateException error )
{
error.printStackTrace();
}
catch ( NumberFormatException error )
{
error.printStackTrace();
}
catch ( NullPointerException error )
{
String message = "" + String.valueOf( rowIndex ) + "行出现NullPointerException异常";
logger.error( message, error );
}
}
}
finally
{
try
{
if ( wb != null )
{
wb.close();
}
}
catch ( IOException error )
{
error.printStackTrace();
}
}
return records;
}
/**
* 从excel文件读取坐席的车非渗透率数据。
* @param filePath
* @param hasCaptionRow
* @param summaryDate
* @return
*/
public static ArrayList<BITelsalerRenewalRateRecord> importBITelsalerRenewalRateFromXlsx(
String filePath, int sheetIndex, int firstRow )
throws IOException, InvalidFormatException
{
ArrayList<BITelsalerRenewalRateRecord> records = new ArrayList<>( 200 );
Workbook wb = null;
Sheet sheet = null;
try
{
wb = WorkbookFactory.create( new File( filePath ) );
sheet = wb.getSheetAt( sheetIndex );
int rowIndex = 0;
String 责任部门 = null;
String 当前行责任部门 = null;
String 责任人 = null;
if ( !checkExcelFormat( sheet, null, 0, TelSalerRenewalRateExcelTitle, 0 ) )
{
throw new InvalidFormatException( "格式错误,请检查报表内容!" );
}
for ( Row row : sheet )
{
rowIndex = row.getRowNum();
// 从数据行开始
if ( row.getRowNum() < firstRow )
{
continue;
}
try
{
// 处理责任部门列
// 如果读取到的当前行责任部门不为空且与前一行责任部门不同,说明是另一个部门的数据
try
{
当前行责任部门 = MyPOIUtils.getStringCellValue( row, 0 );
if ( !当前行责任部门.isEmpty() && !当前行责任部门.equals( 责任部门 ) )
{
责任部门 = 当前行责任部门;
}
}
catch ( NullPointerException error )
{
}
// 判断责任人,如果是空值,就跳过此行
责任人 = MyPOIUtils.getStringCellValue( row, 1 );
if ( 责任人.isEmpty() == true )
{
continue;
}
double 机构目标值 = MyPOIUtils.getNumbericCellValue( row, 2 ) * 100;
double 到期数全月 = MyPOIUtils.getNumbericCellValue( row, 3 );
double 序时到期数占比 = MyPOIUtils.getNumbericCellValue( row, 4 ) * 100;
double 个车续保率序时 = MyPOIUtils.getNumbericCellValue( row, 5 ) * 100;
double 个车续保率全月 = MyPOIUtils.getNumbericCellValue( row, 6 ) * 100;
double 环比昨日 = MyPOIUtils.getNumbericCellValue( row, 7 ) * 100;
double 环比上月 = MyPOIUtils.getNumbericCellValue( row, 8 ) * 100;
double 平均提前签单天数 = MyPOIUtils.getNumbericCellValue( row, 9 );
double 环比 = MyPOIUtils.getNumbericCellValue( row, 10 );
BITelsalerRenewalRateRecord record = new BITelsalerRenewalRateRecord( 责任部门, 责任人,
机构目标值, 到期数全月, 序时到期数占比, 个车续保率序时, 个车续保率全月, 环比昨日, 环比上月, 平均提前签单天数, 环比 );
records.add( record );
}
catch ( NullPointerException error )
{
String message = "" + String.valueOf( rowIndex ) + "行出现NullPointerException异常";
logger.error( message, error );
}
}
}
finally
{
try
{
if ( wb != null )
{
wb.close();
}
}
catch ( Exception error )
{
error.printStackTrace();
}
}
return records;
}
/**
* 读取BI机构当月个车续保率跟踪表
* @param filePath
* @param sheetIndex
* @param firstRow
* @return
* @throws IOException
* @throws InvalidFormatException
*/
public static ArrayList<BIDepartmentAttachingRateRecord> importBIDepartmentAttachingRateRecordsFromXlsx(
String filePath, int sheetIndex, int firstRow )
throws IOException, InvalidFormatException
{
ArrayList<BIDepartmentAttachingRateRecord> records = new ArrayList<>( 5 );
Workbook wb = null;
try
{
wb = WorkbookFactory.create( new File( filePath ) );
Sheet sheet = wb.getSheetAt( sheetIndex );
int rowIndex = 0;
if ( !checkExcelFormat( sheet, null, 0, DepartmentAttachingRateExcelTitle, 0 ) )
{
throw new InvalidFormatException( "Excel文件格式错误请检查报表内容" );
}
for ( Row row : sheet )
{
rowIndex = row.getRowNum();
// 从数据行开始
if ( row.getRowNum() < firstRow )
{
continue;
}
try
{
String departmentName = MyPOIUtils.getStringCellValue( row, 0 );
if ( departmentName.isEmpty() || departmentName.equals( "合计" ) )
{
continue;
}
double departmentObject = MyPOIUtils.getNumbericCellValue( row, 1 ) * 100;
double objectGap = MyPOIUtils.getNumbericCellValue( row, 2 ) * 100;
double motoPremium = MyPOIUtils.getNumbericCellValue( row, 3 );
double motoPremiumProPortion = MyPOIUtils.getNumbericCellValue( row, 4 ) * 100;
double nomotoPremium = MyPOIUtils.getNumbericCellValue( row, 5 );
double attachingRate = MyPOIUtils.getNumbericCellValue( row, 6 ) * 100;
double attachingRateChange = MyPOIUtils.getNumbericCellValue( row, 7 ) * 100;
int motoInsuranceCustomerCount = (int)MyPOIUtils.getNumbericCellValue( row, 8 );
double customerHandleRate = MyPOIUtils.getNumbericCellValue( row, 9 ) * 100;
double customerHandleRateChange =
MyPOIUtils.getNumbericCellValue( row, 10 ) * 100;
double premiumPerCustomer = MyPOIUtils.getNumbericCellValue( row, 11 ) * 100;
double premiumPerCustomerChange =
MyPOIUtils.getNumbericCellValue( row, 12 ) * 100;
BIDepartmentAttachingRateRecord record = new BIDepartmentAttachingRateRecord(
departmentName, departmentObject, objectGap, motoPremium,
motoPremiumProPortion, nomotoPremium, attachingRate,
attachingRateChange, motoInsuranceCustomerCount, customerHandleRate, customerHandleRateChange,
premiumPerCustomer, premiumPerCustomerChange );
records.add( record );
}
catch ( NullPointerException error )
{
String message = "" + String.valueOf( rowIndex ) + "行出现NullPointerException异常";
logger.error( message, error );
}
}
}
finally
{
try
{
if ( wb != null )
{
wb.close();
}
}
catch ( Exception error )
{
String message = "关闭" + filePath + "时出现异常!";
logger.error( message, error );
}
}
return records;
}
public static ArrayList<BIDepartmentRenewalRateRecord> importBIDepartmentRenewalRateRecordsFromXlsx(
String filePath, int sheetIndex, int firstRow )
throws IOException, InvalidFormatException
{
ArrayList<BIDepartmentRenewalRateRecord> records = new ArrayList<>( 20 );
Workbook wb = null;
try
{
wb = WorkbookFactory.create( new File( filePath ) );
Sheet sheet = wb.getSheetAt( sheetIndex );
int rowIndex = 0;
if ( !checkExcelFormat( sheet, null, 0, DepartmentRenewalRateExcelTitle, 0 ) )
{
throw new InvalidFormatException( "Excel文件格式错误请检查报表内容" );
}
for ( Row row : sheet )
{
rowIndex = row.getRowNum();
if ( rowIndex < firstRow )
{
continue;
}
try
{
String 责任部门 = MyPOIUtils.getStringCellValue( row, 0 );
// 部门为空或者是合计行,就跳过
if ( 责任部门.isEmpty() || 责任部门.equals( "合计" ) )
{
continue;
}
double 机构目标值 = MyPOIUtils.getNumbericCellValue( row, 1 ) * 100;
int 到期数全月 = (int) MyPOIUtils.getNumbericCellValue( row, 2 );
double 序时到期数占比 = MyPOIUtils.getNumbericCellValue( row, 3 ) * 100;
double 个车续保率序时 = MyPOIUtils.getNumbericCellValue( row, 4 ) * 100;
double 个车续保率全月 = MyPOIUtils.getNumbericCellValue( row, 5 ) * 100;
double 环比昨日 = MyPOIUtils.getNumbericCellValue( row, 6 ) * 100;
double 环比上月 = MyPOIUtils.getNumbericCellValue( row, 7 ) * 100;
int 平均提前签单天数 = (int) MyPOIUtils.getNumbericCellValue( row, 8 );
double 环比 = MyPOIUtils.getNumbericCellValue( row, 9 ) * 100;
BIDepartmentRenewalRateRecord record = new BIDepartmentRenewalRateRecord( 责任部门,
机构目标值, 到期数全月, 序时到期数占比, 个车续保率序时, 个车续保率全月, 环比昨日, 环比上月, 平均提前签单天数, 环比 );
records.add( record );
}
catch ( NullPointerException error )
{
String message = "" + String.valueOf( rowIndex ) + "行出现NullPointerException异常";
logger.error( message, error );
}
}
}
finally
{
if ( wb != null )
{
try
{
wb.close();
}
catch ( Exception error )
{
error.printStackTrace();
}
}
}
return records;
}
}

View File

@@ -0,0 +1,64 @@
/*
* @Author: Kane
* @Date: 2023-10-07 23:17:13
* @LastEditors: Kane
* @FilePath: /desktop_archievement_backend/src/main/java/com/cpic/xim/utils/data/TelsalerData.java
* @Description: 电销坐席数据导入导出
*
* Copyright (c) ${2023} by Kane, All Rights Reserved.
*/
package com.cpic.xim.utils.data;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.usermodel.WorkbookFactory;
import com.cpic.xim.mybatis.pojo.TelsalerFromJYGL;
public class TelsalerData
{
/**
*
* @param filePath Xlsx文件路径。
* @return
*/
public static ArrayList<TelsalerFromJYGL> importTelsalersFromXlsx( String filePath )
{
ArrayList<TelsalerFromJYGL> telsalers = new ArrayList<>();
Workbook wb = null;
try
{
wb = WorkbookFactory.create( new File( filePath ) );
}
catch ( IOException error )
{
}
finally
{
try
{
if ( wb != null )
{
wb.close();
}
}
catch ( IOException error )
{
error.printStackTrace();
}
}
return telsalers;
}
public static int importTelsalers( ArrayList<TelsalerFromJYGL> telsalers )
{
int importedCount = 0;
return importedCount;
}
}

View File

@@ -0,0 +1,25 @@
/*
* @Author: Kane
* @Date: 2023-07-28 18:39:50
* @LastEditors: Kane
* @FilePath: /desktop_archievement_backend/src/main/java/com/cpic/xim/utils/exception/ConfigFileExecption.java
* @Description: 配置文件异常
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
package com.cpic.xim.utils.exception;
public class ConfigFileExecption extends Exception
{
public ConfigFileExecption()
{
super("配置文件错误!");
}
public ConfigFileExecption( String message )
{
super( message );
}
}

View File

@@ -0,0 +1,23 @@
/*
* @Author: Kane
* @Date: 2023-06-05 10:36:30
* @LastEditors: Kane
* @FilePath: /desktop_archievement_backend/src/main/java/com/cpic/xim/utils/exception/DepartmentCodeNotFoundException.java
* @Description:
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
package com.cpic.xim.utils.exception;
public class DepartmentCodeNotFoundException extends Exception
{
public DepartmentCodeNotFoundException()
{
super("部门代码无效!");
}
public DepartmentCodeNotFoundException( String message )
{
super( message );
}
}

View File

@@ -0,0 +1,23 @@
/*
* @Author: Kane
* @Date: 2023-06-05 10:56:33
* @LastEditors: Kane
* @FilePath: /desktop_archievement_backend/src/main/java/com/cpic/xim/utils/exception/ParameterExecption.java
* @Description: 用于表示参数错误的异常对象。
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
package com.cpic.xim.utils.exception;
public class ParameterExecption extends Exception
{
public ParameterExecption()
{
super("参数错误!");
}
public ParameterExecption(String message )
{
super( message );
}
}

View File

@@ -0,0 +1,76 @@
/*
* @Author: Kane
* @Date: 2023-10-08 22:12:05
* @LastEditors: Kane
* @FilePath: /desktop_archievement_backend/src/main/java/com/cpic/xim/utils/poi/MyPOIUtils.java
* @Description: POI相关的工具
*
* Copyright (c) ${2023} by Kane, All Rights Reserved.
*/
package com.cpic.xim.utils.poi;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Row.MissingCellPolicy;
public class MyPOIUtils
{
public static String getStringCellValue( Cell cell )
{
switch( cell.getCellType() )
{
case STRING:
return cell.getStringCellValue();
default:
return "";
}
}
public static String getStringCellValue( Row row, int columnIndex )
{
Cell cell = row.getCell(columnIndex, MissingCellPolicy.RETURN_NULL_AND_BLANK);
switch( cell.getCellType() )
{
case STRING:
return cell.getStringCellValue();
default:
return "";
}
}
public static double getNumbericCellValue( Cell cell )
{
double value = 0.0;
switch ( cell.getCellType() )
{
case NUMERIC:
value = cell.getNumericCellValue();
break;
default:
value = 0.0;
break;
}
return value;
}
public static double getNumbericCellValue( Row row, int columnIndex )
{
double value = 0.0;
Cell cell = row.getCell( columnIndex, MissingCellPolicy.RETURN_NULL_AND_BLANK );
switch ( cell.getCellType() )
{
case NUMERIC:
value = cell.getNumericCellValue();
break;
default:
value = 0.0;
break;
}
return value;
}
}

View File

@@ -0,0 +1,64 @@
/*
* @Author: Kane
* @Date: 2023-06-03 20:02:28
* @LastEditors: Kane
* @FilePath: /desktop_archievement_backend/src/main/java/com/cpic/xim/utils/ranking/CallerRanking.java
* @Description: 坐席排行榜项目
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
package com.cpic.xim.utils.ranking;
import com.fasterxml.jackson.annotation.JsonProperty;
public class CallerRankingItem
{
public CallerRankingItem() {}
public CallerRankingItem( int index, String callName, String appraiseValue )
{
this.index = index;
this.callerName = callName;
this.appraiseValue = appraiseValue;
}
public int getIndex()
{
return index;
}
public void setIndex( int index )
{
this.index = index;
}
public String getCallerName()
{
return callerName;
}
public void setCallerName( String callerName )
{
this.callerName = callerName;
}
public String getAppraiseValue()
{
return appraiseValue;
}
public void setAppraiseValue( String appraiseValue )
{
this.appraiseValue = appraiseValue;
}
@JsonProperty("index")
private int index;
@JsonProperty("callerName")
private String callerName;
@JsonProperty("appraiseValue")
private String appraiseValue;
}

View File

@@ -0,0 +1,256 @@
/*
* @Author: Kane
* @Date: 2023-06-05 08:55:06
* @LastEditors: Kane
* @FilePath: /desktop_archievement_backend/src/main/java/com/cpic/xim/utils/ranking/CallerRankingList.java
* @Description: 坐席排行榜对象
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
package com.cpic.xim.utils.ranking;
import java.io.IOException;
import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashMap;
import org.apache.ibatis.session.SqlSession;
import com.cpic.xim.mybatis.mapper.RankingListMapper;
import com.cpic.xim.mybatis.utils.MybatisUtils;
import oracle.jdbc.OracleCallableStatement;
import oracle.jdbc.OracleTypes;
public class CallerRankingList
{
// 以后要改
private static String jdbcURL = "jdbc:oracle:thin:@10.39.0.86:1521:xmcx1";
private static String userName = "desktop_archievement_admin";
private static String password = "Cpic123456";
private CallerRankingList( String departmentCode, String year, String month,
ArrayList<CallerRankingItem> attachingRateRankingList,
ArrayList<CallerRankingItem> renewalRateRankingList)
{
this.departmentCode = departmentCode;
this.year = year;
this.month = month;
this.attachingRateRankingList = attachingRateRankingList;
this.renewalRateRankingList = renewalRateRankingList;
}
@SuppressWarnings("unchecked")
public static CallerRankingList getCallerRankingList( String departmentCode, String year,
String month ) throws IOException
{
CallerRankingList rankingList = null;
// String monthRegx = "(0[1-9])|(1[0-2])";
// String yearRegx = "202[0-9]";
SqlSession session = MybatisUtils.getSqlSession();
RankingListMapper mapper = session.getMapper(RankingListMapper.class);
HashMap<String,Object> params = new HashMap<>();
params.put("a_department_code", departmentCode);
params.put("a_year", year);
params.put("a_month", month);
mapper.getRankingList(params);
ArrayList<CallerRankingItem> attachingRateRankingList = (ArrayList<CallerRankingItem>)params.get("a_attaching_ranking_list");
ArrayList<CallerRankingItem> renewalRateList = (ArrayList<CallerRankingItem>)params.get("a_renewal_ranking_list");
rankingList = new CallerRankingList(departmentCode, year, month, attachingRateRankingList, renewalRateList);
return rankingList;
}
/**
* @brief static方法用于查询部门坐席排行榜
* @param departmentCode 部门代码
* @param year 排行榜年份
* @param month 排行榜月份
* @return CallerRankingList的实例对象
*/
public static CallerRankingList getCallerRankingList2( String departmentCode, String year,
String month ) throws ClassNotFoundException, SQLException
{
CallerRankingList rankingList = null;
Connection connection = null;
CallableStatement statement = null;
ResultSet cur_attaching = null;
ResultSet cur_renewal = null;
String sql = """
{call telsale_archievement_pkg.caller_arch_ranking_list(?,?,?,?,?)}
""";
// String monthRegx = "(0[1-9])|(1[0-2])";
// String yearRegx = "20[0-2][0-0]";
ArrayList<CallerRankingItem> attachingRateRankingList = new ArrayList<>();
ArrayList<CallerRankingItem> renewalRateRankingList = new ArrayList<>();
int index = 1;
try
{
Class.forName( "oracle.jdbc.driver.OracleDriver" );
connection = DriverManager.getConnection( jdbcURL, userName, password );
statement = connection.prepareCall( sql );
statement.setString( 1, departmentCode );
statement.setString( 2, year );
statement.setString( 3, month );
statement.registerOutParameter( 4, OracleTypes.CURSOR );
statement.registerOutParameter( 5, OracleTypes.CURSOR );
statement.execute();
// 车非渗透率
cur_attaching = ((OracleCallableStatement) statement).getCursor( 4 );
index = 1;
while (cur_attaching.next())
{
String callerName = cur_attaching.getString( 1 );
String appraiseValue = cur_attaching.getString( 2 );
CallerRankingItem caller =
new CallerRankingItem( index, callerName, appraiseValue );
attachingRateRankingList.add( caller );
index++;
}
// 续保率
cur_renewal = ((OracleCallableStatement) statement).getCursor( 5 );
index = 1;
while (cur_renewal.next())
{
String callerName = cur_renewal.getString( 1 );
String appraiseValue = cur_renewal.getString( 2 );
CallerRankingItem caller =
new CallerRankingItem( index, callerName, appraiseValue );
renewalRateRankingList.add( caller );
index++;
}
rankingList = new CallerRankingList( departmentCode, year, month,
attachingRateRankingList, renewalRateRankingList );
}
finally
{
try
{
if ( cur_attaching != null )
{
cur_attaching.close();
}
}
catch ( Exception exception )
{
exception.printStackTrace();
}
try
{
if ( statement != null )
{
statement.close();
}
}
catch ( Exception exception )
{
exception.printStackTrace();
}
try
{
if ( connection != null )
{
connection.close();
}
}
catch ( Exception exception )
{
exception.printStackTrace();
}
}
return rankingList;
}
public String getDepartmentCode()
{
return departmentCode;
}
public void setDepartmentCode( String departmentCode )
{
this.departmentCode = departmentCode;
}
public String getYear()
{
return year;
}
public void setYear( String year )
{
this.year = year;
}
public String getMonth()
{
return month;
}
public void setMonth( String month )
{
this.month = month;
}
public ArrayList<CallerRankingItem> getAttachingRateRankingList()
{
return attachingRateRankingList;
}
public void setAttachingRateRankingList( ArrayList<CallerRankingItem> attachingRateRankingList )
{
this.attachingRateRankingList = attachingRateRankingList;
}
public ArrayList<CallerRankingItem> getRenewalRateRankingList()
{
return renewalRateRankingList;
}
public void setRenewalRateRankingList( ArrayList<CallerRankingItem> renewalRateRankingList )
{
this.renewalRateRankingList = renewalRateRankingList;
}
// 部门代码
private String departmentCode;
// 排行榜年份
private String year;
// 排行榜统计月份
private String month;
// 车非融合率排行
private ArrayList<CallerRankingItem> attachingRateRankingList;
// 续保率排行
private ArrayList<CallerRankingItem> renewalRateRankingList;
}

View File

@@ -0,0 +1,91 @@
/*
* @Author: Kane
* @Date: 2023-04-05 22:34:36
* @LastEditors: Kane
* @FilePath: /desktop_archievement_backend/src/main/java/com/cpic/xim/web/controllers/QueryResponse.java
* @Description:
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
package com.cpic.xim.web.controllers;
import com.fasterxml.jackson.annotation.JsonProperty;
public class QueryResponse
{
@JsonProperty( "success" )
private boolean success;
@JsonProperty( "message" )
private String message;
public QueryResponse( boolean success, String message )
{
this.success = success;
this.message = message;
}
public QueryResponse()
{
this.success = false;
this.message = "";
}
public boolean isSuccess()
{
return success;
}
public void setSuccess( boolean success )
{
this.success = success;
}
public String getMessage()
{
return message;
}
public void setMessage( String message )
{
this.message = message;
}
@Override
public int hashCode()
{
final int prime = 31;
int result = 1;
result = prime * result + (success ? 1231 : 1237);
result = prime * result + ((message == null) ? 0 : message.hashCode());
return result;
}
@Override
public boolean equals( Object obj )
{
if ( this == obj )
return true;
if ( obj == null )
return false;
if ( getClass() != obj.getClass() )
return false;
QueryResponse other = (QueryResponse) obj;
if ( success != other.success )
return false;
if ( message == null )
{
if ( other.message != null )
return false;
}
else if ( !message.equals( other.message ) )
return false;
return true;
}
@Override
public String toString()
{
return "QueryResult [success=" + success + ", message=" + message + "]";
}
}

View File

@@ -1,74 +0,0 @@
/*
* @Author: Kane
* @Date: 2023-04-05 22:34:36
* @LastEditors: Kane
* @FilePath: /desktop_archievement_backend/src/main/java/com/cpic/xim/web/controllers/QueryResult.java
* @Description:
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
package com.cpic.xim.web.controllers;
import com.fasterxml.jackson.annotation.JsonProperty;
public class QueryResult {
public QueryResult(boolean success, String message) {
this.success = success;
this.message = message;
}
public QueryResult() {
this.success = false;
this.message = "";
}
public boolean isSuccess() {
return success;
}
public void setSuccess(boolean success) {
this.success = success;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + (success ? 1231 : 1237);
result = prime * result + ((message == null) ? 0 : message.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj) return true;
if (obj == null) return false;
if (getClass() != obj.getClass()) return false;
QueryResult other = (QueryResult) obj;
if (success != other.success) return false;
if (message == null) {
if (other.message != null) return false;
} else if (!message.equals(other.message)) return false;
return true;
}
@Override
public String toString() {
return "QueryResult [success=" + success + ", message=" + message + "]";
}
@JsonProperty("success")
private boolean success;
@JsonProperty("message")
private String message;
}

View File

@@ -11,18 +11,22 @@ package com.cpic.xim.web.controllers.account;
import java.sql.SQLException;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import com.cpic.xim.utils.account.CpicXIMStaffInfo;
import com.cpic.xim.utils.account.TeleSalerInfo;
@Controller
//@CrossOrigin
@RequestMapping( "/account" )
public class StaffInfoQueryController
{
/**
* @description:
* @param {String} account: 前端发送的请求内容员工的P13账号或P09工号。
* @param account: 前端发送的请求内容员工的P13账号或P09工号。
* @return {*}
*/
@RequestMapping( "/query_staff_info.do" )
@@ -54,12 +58,52 @@ public class StaffInfoQueryController
return result;
}
/**
* 查询坐席工号的接口方法。
* @param telSaler
* @return 返回表示查询结果的 TeleSalerQueryResult 对象转换成JSON。
*/
@RequestMapping( "/query_telsaler_info.do" )
@ResponseBody
public TeleSalerQueryResult queryTeleSalerInfo( String teleSalerCode )
public TeleSalerQueryResult queryTeleSalerInfo(
@RequestBody TelsalerQueryRequest telSaler )
{
TeleSalerQueryResult result = new TeleSalerQueryResult();
TeleSalerInfo saler = null;
try
{
saler = TeleSalerInfo.queryTeleSalerInfo( telSaler.getTelSalerCode() );
// 根据返回结果是否为 null判断是否查询到坐席信息
if ( saler != null )
{
// 不为 null有查询到
result.setTelSalerCode( saler.getCode() );
result.setTelSalerName( saler.getName() );
result.setTeamCode( saler.getTeamCode() );
result.setTeamName( saler.getTeamName() );
result.setDepartmentCode( saler.getDepartmentCode() );
result.setDepartmentName( saler.getDepartmentName() );
result.setSuccess( true );
} else
{
// 为 null 则没查询到
result.setSuccess( false );
result.setMessage( "未查询到坐席信息!" );
}
}
catch ( SQLException error )
{
result.setSuccess( false );
result.setMessage( "查询工号失败,失败原因:" + error.getMessage() );
}
catch ( ClassNotFoundException error )
{
result.setSuccess( false );
result.setMessage( error.getMessage() );
}
return result;
}

View File

@@ -9,10 +9,10 @@
*/
package com.cpic.xim.web.controllers.account;
import com.cpic.xim.web.controllers.QueryResult;
import com.cpic.xim.web.controllers.QueryResponse;
import com.fasterxml.jackson.annotation.JsonProperty;
public class TeleSalerQueryResult extends QueryResult
public class TeleSalerQueryResult extends QueryResponse
{
public TeleSalerQueryResult()
@@ -31,23 +31,23 @@ public class TeleSalerQueryResult extends QueryResult
* @param departmentCode: 部门代码
* @param departmentName: 部门名称
*/
public TeleSalerQueryResult( boolean success, String message, String teleSalerCode,
String teleSalerName, String teamCode, String teamName, String departmentCode,
public TeleSalerQueryResult( boolean success, String message, String telSalerCode,
String telSalerName, String teamCode, String teamName, String departmentCode,
String departmentName)
{
super( success, message );
this.teleSalerCode = teleSalerCode;
this.teleSalerName = teleSalerName;
this.telSalerCode = telSalerCode;
this.telSalerName = telSalerName;
this.teamCode = teamCode;
this.teamName = teamName;
this.departmentCode = departmentCode;
this.departmentName = departmentName;
}
public String getTeleSalerCode()
public String getTelSalerCode()
{
return teleSalerCode;
return telSalerCode;
}
/**
@@ -55,19 +55,19 @@ public class TeleSalerQueryResult extends QueryResult
* @param {String} teleSalerCode
* @return {*}
*/
public void setTeleSalerCode( String teleSalerCode )
public void setTelSalerCode( String telSalerCode )
{
this.teleSalerCode = teleSalerCode;
this.telSalerCode = telSalerCode;
}
public String getTeleSalerName()
public String getTelSalerName()
{
return teleSalerName;
return telSalerName;
}
public void setTeleSalerName( String teleSalerName )
public void setTelSalerName( String telSalerName )
{
this.teleSalerName = teleSalerName;
this.telSalerName = telSalerName;
}
public String getTeamCode()
@@ -110,11 +110,11 @@ public class TeleSalerQueryResult extends QueryResult
this.departmentName = departmentName;
}
@JsonProperty( "tele_saler_code" )
private String teleSalerCode;
@JsonProperty( "tel_saler_code" )
private String telSalerCode;
@JsonProperty( "tele_saler_name" )
private String teleSalerName;
@JsonProperty( "tel_saler_name" )
private String telSalerName;
@JsonProperty( "team_code" )
private String teamCode;

View File

@@ -0,0 +1,35 @@
/*
* @Author: Kane
* @Date: 2023-04-28 14:40:49
* @LastEditors: Kane
* @FilePath: /desktop_archievement_backend/src/main/java/com/cpic/xim/web/controllers/account/TelsalerQueryRequest.java
* @Description:
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
package com.cpic.xim.web.controllers.account;
import com.fasterxml.jackson.annotation.JsonProperty;
public class TelsalerQueryRequest
{
public TelsalerQueryRequest() {}
public TelsalerQueryRequest( String telSalerCode )
{
this.telSalerCode = telSalerCode;
}
public String getTelSalerCode()
{
return telSalerCode;
}
public void setTelSalerCode( String telSalerCode )
{
this.telSalerCode = telSalerCode;
}
@JsonProperty("telsaler_code")
private String telSalerCode;
}

View File

@@ -4,60 +4,153 @@
* @LastEditors: Kane
* @FilePath: /desktop_archievement_backend/src/main/java/com/cpic/xim/web/controllers/archievement/ArchievementQueryController.java
* @Description:
* 业绩查询控制器:
* 1、queryDepartmentArchievement响应部门业绩查询
* 2、
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
package com.cpic.xim.web.controllers.archievement;
import java.util.Vector;
import java.io.IOException;
import java.util.ArrayList;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.cpic.xim.utils.archievement.CallerArchievement;
import com.cpic.xim.utils.archievement.DepartmentArchievement;
import com.cpic.xim.utils.ranking.CallerRankingItem;
import com.cpic.xim.utils.ranking.CallerRankingList;
import com.cpic.xim.web.controllers.archievement.RankingList.RankingListRequest;
import com.cpic.xim.web.controllers.archievement.RankingList.RankingListResponse;
import com.cpic.xim.web.controllers.archievement.caller.CallerArchievementQueryRequest;
import com.cpic.xim.web.controllers.archievement.caller.CallerArchievementQueryResponse;
import com.cpic.xim.web.controllers.archievement.department.DepartmentArchievementQueryRequest;
import com.cpic.xim.web.controllers.archievement.department.DepartmentArchievementQueryResult;
@Controller
@RequestMapping( "/archievement" )
public class ArchievementQueryController
{
@PostMapping( "/query_caller_archievement.do" )
public void queryCallerArchievement()
{
// 日志
private static Logger logger = LoggerFactory.getLogger( ArchievementQueryController.class );
}
/**
* 查询坐席业绩
*/
// @PostMapping( "/query_caller_archievement.do" )
// public void queryCallerArchievement()
// {
// }
/**
* 查询部门业绩
* @param request DepartmentArchievementQueryRequest 类型的部门参数。
* @return 返回 DepartmentArchievementQueryResult 对象。
*/
@PostMapping( "/query_department_archievement.do" )
@ResponseBody
public DepartmentArchievementQueryResult queryDepartmentArchievement()
public DepartmentArchievementQueryResult queryDepartmentArchievement(
@RequestBody DepartmentArchievementQueryRequest request )
{
DepartmentArchievementQueryResult result = new DepartmentArchievementQueryResult();
DepartmentArchievement departmentArch = null;
genTestDepartmentData( result );
try
{
// 查询业绩
departmentArch =
DepartmentArchievement.getDepartmentArchievement( request.getDepartmentCode() );
result.setTotalArchievement( departmentArch.getTotalArchievement() );
result.setInsuranceRenewalRate( departmentArch.getInsuranceRenewalRate() );
result.setAttachingRate( departmentArch.getAttachingRate() );
// result.addAdvanceRewardGainer( "沈群" );
// result.addLeadingRewardGainer( "王鸿津" );
// result.addLeadingRewardGainer( "林宗泽" );
// result.addBackwardStaff( "王炜" );
result.setMensualArchievementList( departmentArch.getMensualArchievementList() );
}
catch ( IOException error )
{
}
result.setSuccess( true );
result.setMessage( "成功" );
return result;
}
void genTestDepartmentData( DepartmentArchievementQueryResult data )
@ResponseBody
@PostMapping( "/query_caller_archievement.do" )
public CallerArchievementQueryResponse queryCallerArchievement(
@RequestBody CallerArchievementQueryRequest request )
{
Vector<Integer> mensual_archievement = new Vector<Integer>();
CallerArchievementQueryResponse result = null;
mensual_archievement.add( 200 );
mensual_archievement.add( 213 );
mensual_archievement.add( 333 );
mensual_archievement.add( 444 );
mensual_archievement.add( 555 );
mensual_archievement.add( 666 );
try
{
CallerArchievement archievement =
CallerArchievement.getCallerArchievement( request.getCallerCode() );
data.setSuccess( true );
data.setMessage( "成功" );
data.setTotalArchievement( 1234567890 );
data.setInsuranceRenewalRate( "65" );
data.setAttachingRate( "75" );
data.addAdvanceRewardGainer( "沈群" );
data.addLeadingRewardGainer( "王鸿津" );
data.addLeadingRewardGainer( "林宗泽" );
data.addBackwardStaff( "王炜" );
data.setMensualArchievementList( null );
data.setMensualArchievementList( mensual_archievement );
result = new CallerArchievementQueryResponse( true, "查询成功", archievement.getCallerCode(),
request.getCallName(), archievement.getTotalArchievement(), archievement.getMotoPremiumPresentMonth(),
archievement.getMensualArchievementList(),
archievement.getInsuranceRenewalRate(), archievement.getAttachingRate() );
}
catch ( IOException error )
{
result = new CallerArchievementQueryResponse(false, error.getMessage(), null, null, 0, 0, null, null, null);
}
return result;
}
@RequestMapping( "/query_ranking_list.do" )
@ResponseBody
public RankingListResponse queryCallerArchievementRankingList(
@RequestBody RankingListRequest request )
{
String departmentCode = request.getDepartmentCode();
String year = request.getYear();
String month = request.getMonth();
boolean success = false;
String message = "";
ArrayList<CallerRankingItem> attachingRateRankingList = null;
ArrayList<CallerRankingItem> renewalRateRankingList = null;
try
{
CallerRankingList rankingList =
CallerRankingList.getCallerRankingList( departmentCode, year, month );
attachingRateRankingList = rankingList.getAttachingRateRankingList();
renewalRateRankingList = rankingList.getRenewalRateRankingList();
success = true;
message = "调用成功!";
}
catch ( IOException error )
{
success = false;
message = "获取排行榜失败,原因:" + error.getMessage();
logger.error( message, error );
}
RankingListResponse response = new RankingListResponse( success, message, departmentCode,
year, month, attachingRateRankingList, renewalRateRankingList );
return response;
}
}

Some files were not shown because too many files have changed in this diff Show More