Compare commits
91 Commits
f9392ea2eb
...
64824e6f74
Author | SHA1 | Date |
---|---|---|
Kane Wang | 64824e6f74 | |
unknown | 099a1e65f6 | |
unknown | a9b30dd293 | |
unknown | f61f623f73 | |
Kane Wang | b03056d783 | |
unknown | bcef8b4994 | |
Kane Wang | b91c7d281e | |
Kane Wang | 1d554056ac | |
Kane Wang | 0d0b61db3c | |
Kane Wang | 8fd5ee4904 | |
Kane Wang | fa4f211ac2 | |
Kane Wang | 992606d77a | |
Kane Wang | 712aabfb99 | |
unknown | 9878abb946 | |
unknown | 7d0112b483 | |
unknown | 58f60b9eaf | |
Kane Wang | 4cd800e62b | |
Kane Wang | 4deed356f5 | |
Kane Wang | 31d5e1622c | |
Kane Wang | be5e426cee | |
Kane Wang | 7ea11e34a9 | |
Kane Wang | 2edd5f67db | |
Kane Wang | efebd548c6 | |
Kane Wang | 22157b11eb | |
Kane Wang | bc7e56c336 | |
Kane Wang | f54f6bbfea | |
unknown | 21a50f4c61 | |
Kane Wang | 075da72a73 | |
Kane Wang | ae68f047f4 | |
Kane Wang | 7c5da24f5a | |
Kane Wang | 4d03abde27 | |
Kane Wang | 08ea359cd1 | |
Kane Wang | 8e0505bd49 | |
Kane Wang | a74e612546 | |
Kane Wang | 42c2e8bdf7 | |
unknown | 83be988941 | |
Kane Wang | 2a92179adf | |
Kane Wang | 9976c852ba | |
Kane Wang | fd59698264 | |
Kane Wang | f5a53e2f55 | |
Kane Wang | 5b6285993f | |
unknown | b2a973f7bd | |
unknown | dcc925bb41 | |
Kane Wang | 8fd60d6b24 | |
Kane Wang | 090a551066 | |
Kane Wang | 9483b49a20 | |
unknown | e436fbf89e | |
unknown | 0875919b5f | |
Kane Wang | a5b008f056 | |
unknown | ada65278a1 | |
unknown | 38ec1c7d6c | |
Kane Wang | 7ab604f3dd | |
unknown | 374a87e1ee | |
unknown | 7304ccf2e8 | |
Kane Wang | ff487c3fb6 | |
Kane Wang | a9b6e88733 | |
Kane Wang | 9111067e63 | |
Kane Wang | 702ab2c4d1 | |
unknown | c08b85cbe4 | |
unknown | 068c56e1c9 | |
unknown | 73d03bfe9b | |
Kane Wang | 6d4ca8cf96 | |
Kane Wang | 5344f2e0ea | |
Kane Wang | 78ae920795 | |
unknown | d39e731a1e | |
Kane Wang | 16574b6a47 | |
Kane Wang | c4b1c754a9 | |
Kane Wang | dbc5066aed | |
Kane Wang | daa675b079 | |
Kane Wang | 47c30a4ea1 | |
Kane Wang | 157ab0d76e | |
Kane Wang | 8c4293f374 | |
Kane Wang | f6ec7cbdfe | |
unknown | 59bc739cac | |
unknown | 30ea250264 | |
unknown | a14f4b154f | |
Kane Wang | dfdde2f8d3 | |
Kane Wang | 503a5bcdff | |
unknown | 05dfb0483c | |
unknown | 3eeaf68593 | |
Kane Wang | 20924be00e | |
Kane Wang | 0e1338e54b | |
Kane Wang | 24266203ca | |
Kane Wang | 88880962a9 | |
unknown | e2ccf553aa | |
unknown | 5856909e92 | |
Kane Wang | 1b368deb9c | |
Kane Wang | aa39cc4601 | |
Kane Wang | 80e4b24e4f | |
Kane Wang | 664c2335ca | |
Kane Wang | 2f3e22fb3e |
|
@ -8,7 +8,10 @@ CREATE OR REPLACE PACKAGE telsale_archievement_pkg IS
|
||||||
|
|
||||||
-- 异常
|
-- 异常
|
||||||
DEPARTMENTCODE_EXCEPTION_CODE CONSTANT INTEGER := -20000;
|
DEPARTMENTCODE_EXCEPTION_CODE CONSTANT INTEGER := -20000;
|
||||||
DEPARTMENTCODE_EXCEPTION_MSG CONSTANT VARCHAR2(100) := '部门代码无效';
|
DEPARTMENTCODE_EXCEPTION_MSG CONSTANT VARCHAR2(100) := '部门代码无效。';
|
||||||
|
|
||||||
|
CALLERCODE_EXCEPTION_CODE CONSTANT INTEGER := -20001;
|
||||||
|
CALLERCODE_EXCEPTION_MSG CONSTANT VARCHAR2(100) := '坐席工号无效。';
|
||||||
|
|
||||||
PROCEDURE department_archievement
|
PROCEDURE department_archievement
|
||||||
(
|
(
|
||||||
|
@ -19,6 +22,15 @@ CREATE OR REPLACE PACKAGE telsale_archievement_pkg IS
|
||||||
a_mensual_cur OUT cur_type
|
a_mensual_cur OUT cur_type
|
||||||
);
|
);
|
||||||
|
|
||||||
|
PROCEDURE caller_archievement
|
||||||
|
(
|
||||||
|
a_caller_code IN VARCHAR2,
|
||||||
|
a_attaching_rate OUT VARCHAR2,
|
||||||
|
a_renewal_rate OUT VARCHAR2,
|
||||||
|
a_total OUT INTEGER,
|
||||||
|
a_mensual_cur OUT cur_type
|
||||||
|
);
|
||||||
|
|
||||||
PROCEDURE caller_arch_ranking_list
|
PROCEDURE caller_arch_ranking_list
|
||||||
(
|
(
|
||||||
a_department_code IN VARCHAR2,
|
a_department_code IN VARCHAR2,
|
||||||
|
@ -30,146 +42,231 @@ CREATE OR REPLACE PACKAGE telsale_archievement_pkg IS
|
||||||
|
|
||||||
END telsale_archievement_pkg;
|
END telsale_archievement_pkg;
|
||||||
/
|
/
|
||||||
CREATE OR REPLACE PACKAGE BODY telsale_archievement_pkg IS
|
CREATE OR REPLACE PACKAGE BODY TELSALE_ARCHIEVEMENT_PKG IS
|
||||||
|
-- 部门业绩
|
||||||
-- 保费渗透率
|
PROCEDURE DEPARTMENT_ARCHIEVEMENT
|
||||||
PROCEDURE department_archievement
|
|
||||||
(
|
(
|
||||||
a_department_code IN VARCHAR2,
|
A_DEPARTMENT_CODE IN VARCHAR2,
|
||||||
a_attaching_rate OUT VARCHAR2,
|
A_ATTACHING_RATE OUT VARCHAR2,
|
||||||
a_renewal_rate OUT VARCHAR2,
|
A_RENEWAL_RATE OUT VARCHAR2,
|
||||||
a_total OUT INTEGER,
|
A_TOTAL OUT INTEGER,
|
||||||
a_mensual_cur OUT cur_type
|
A_MENSUAL_CUR OUT CUR_TYPE
|
||||||
) IS
|
) IS
|
||||||
l_this_month VARCHAR2(4);
|
L_THIS_MONTH VARCHAR2(4);
|
||||||
l_this_year VARCHAR2(4);
|
L_THIS_YEAR VARCHAR2(4);
|
||||||
l_firstday DATE;
|
L_FIRSTDAY DATE;
|
||||||
l_department_name VARCHAR2(100);
|
L_DEPARTMENT_NAME VARCHAR2(100);
|
||||||
BEGIN
|
BEGIN
|
||||||
l_this_month := to_char(SYSDATE,
|
L_THIS_MONTH := TO_CHAR(SYSDATE,
|
||||||
'mm');
|
'mm');
|
||||||
l_this_year := to_char(SYSDATE,
|
L_THIS_YEAR := TO_CHAR(SYSDATE,
|
||||||
'yyyy');
|
'yyyy');
|
||||||
l_firstday := to_date(to_char(SYSDATE,
|
L_FIRSTDAY := TO_DATE(TO_CHAR(SYSDATE,
|
||||||
'yyyy') || '-01-01 00:00:00',
|
'yyyy') || '-01-01 00:00:00',
|
||||||
'yyyy-mm-dd hh24:mi:ss');
|
'yyyy-mm-dd hh24:mi:ss');
|
||||||
-- 获取部门名称
|
-- 获取部门名称
|
||||||
BEGIN
|
BEGIN
|
||||||
SELECT department_name
|
SELECT DEPARTMENT_NAME
|
||||||
INTO l_department_name
|
INTO L_DEPARTMENT_NAME
|
||||||
FROM idst0.bm_t bm
|
FROM IDST0.BM_T BM
|
||||||
WHERE bm.department_code = a_department_code;
|
WHERE BM.DEPARTMENT_CODE = A_DEPARTMENT_CODE;
|
||||||
EXCEPTION
|
EXCEPTION
|
||||||
-- 如果没有找到部门名称,说明代码错误,抛出异常
|
-- 如果没有找到部门名称,说明代码错误,抛出异常
|
||||||
WHEN NO_DATA_FOUND THEN
|
WHEN NO_DATA_FOUND THEN
|
||||||
raise_application_error(DEPARTMENTCODE_EXCEPTION_CODE,
|
RAISE_APPLICATION_ERROR(DEPARTMENTCODE_EXCEPTION_CODE,
|
||||||
DEPARTMENTCODE_EXCEPTION_MSG);
|
DEPARTMENTCODE_EXCEPTION_MSG);
|
||||||
|
END;
|
||||||
|
--车非渗透率
|
||||||
|
SELECT DECODE(SUM(CF.车险个人客户保费),
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
ROUND((SUM(CF.车非融合保费) / SUM(CF.车险个人客户保费) * 100),
|
||||||
|
2))
|
||||||
|
INTO A_ATTACHING_RATE
|
||||||
|
FROM 坐席车非每日保费 CF
|
||||||
|
WHERE CF.月份 = L_THIS_MONTH
|
||||||
|
AND CF.年份 = L_THIS_YEAR
|
||||||
|
AND 部门代码 = A_DEPARTMENT_CODE;
|
||||||
|
--续保率
|
||||||
|
SELECT DECODE(SUM(到期数),
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
ROUND(SUM(已续保累计) / SUM(到期数) * 100,
|
||||||
|
2))
|
||||||
|
INTO A_RENEWAL_RATE
|
||||||
|
FROM 坐席续保统计
|
||||||
|
WHERE 部门 = L_DEPARTMENT_NAME;
|
||||||
|
--总业绩
|
||||||
|
SELECT ROUND(NVL(SUM(CF.车险个人客户保费 + CF.车非融合保费),
|
||||||
|
0),
|
||||||
|
0)
|
||||||
|
INTO A_TOTAL
|
||||||
|
FROM 坐席车非每日保费 CF
|
||||||
|
WHERE 部门代码 = A_DEPARTMENT_CODE
|
||||||
|
AND 签单日期 >= L_FIRSTDAY
|
||||||
|
AND 签单日期 <= SYSDATE;
|
||||||
|
--每月业绩
|
||||||
|
OPEN A_MENSUAL_CUR FOR
|
||||||
|
SELECT CF.月份 MM,
|
||||||
|
ROUND(NVL(SUM(CF.车险个人客户保费 + CF.车非融合保费) / 10000,
|
||||||
|
0),
|
||||||
|
0) BF
|
||||||
|
FROM 坐席车非每日保费 CF
|
||||||
|
WHERE 部门代码 = A_DEPARTMENT_CODE
|
||||||
|
AND 签单日期 >= TO_DATE(TO_CHAR(SYSDATE,
|
||||||
|
'yyyy') || '-01-01 00:00:00',
|
||||||
|
'yyyy-mm-dd hh24:mi:ss')
|
||||||
|
AND 签单日期 < TO_DATE(TO_CHAR(SYSDATE,
|
||||||
|
'yyyy-mm') || '-01 00:00:00',
|
||||||
|
'yyyy-mm-dd hh24:mi:ss')
|
||||||
|
GROUP BY CF.月份
|
||||||
|
ORDER BY CF.月份;
|
||||||
|
END;
|
||||||
|
|
||||||
|
/*******************************************************/
|
||||||
|
-- 坐席业绩
|
||||||
|
PROCEDURE caller_archievement
|
||||||
|
(
|
||||||
|
a_caller_code IN VARCHAR2,
|
||||||
|
a_attaching_rate OUT VARCHAR2,
|
||||||
|
a_renewal_rate OUT VARCHAR2,
|
||||||
|
a_total OUT INTEGER,
|
||||||
|
a_mensual_cur OUT cur_type
|
||||||
|
) IS
|
||||||
|
l_caller_name VARCHAR2(100);
|
||||||
|
l_this_month VARCHAR2(4);
|
||||||
|
l_this_year VARCHAR2(4);
|
||||||
|
l_firstday DATE;
|
||||||
|
BEGIN
|
||||||
|
--查询坐席名称,验证代码
|
||||||
|
BEGIN
|
||||||
|
SELECT saler_name
|
||||||
|
INTO l_caller_name
|
||||||
|
FROM tele_saler
|
||||||
|
WHERE saler_code = a_caller_code;
|
||||||
|
EXCEPTION
|
||||||
|
-- 如果没有查询到坐席名称,说明代码有误,抛出异常
|
||||||
|
WHEN no_data_found THEN
|
||||||
|
raise_application_error(CALLERCODE_EXCEPTION_CODE,
|
||||||
|
CALLERCODE_EXCEPTION_MSG);
|
||||||
END;
|
END;
|
||||||
|
|
||||||
--车非渗透率
|
l_this_month := to_char(SYSDATE,
|
||||||
SELECT decode(SUM(cf.车险个人客户保费),
|
'mm');
|
||||||
|
l_this_year := to_char(SYSDATE,
|
||||||
|
'yyyy');
|
||||||
|
l_firstday := to_date(l_this_year || '-01-01 00:00:00',
|
||||||
|
'yyyy-mm-dd hh24:mi:ss');
|
||||||
|
|
||||||
|
--总车险保费
|
||||||
|
SELECT round(nvl(SUM(cf.车险个人客户保费),
|
||||||
|
0),
|
||||||
|
2) bf
|
||||||
|
INTO a_total
|
||||||
|
FROM 坐席车非每日保费 cf
|
||||||
|
WHERE cf.坐席工号 = a_caller_code
|
||||||
|
AND cf.年份 = l_this_year;
|
||||||
|
|
||||||
|
--渗透率
|
||||||
|
SELECT decode(nvl(SUM(cf.车险个人客户保费),
|
||||||
|
0),
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
round((SUM(cf.车非融合保费) / SUM(cf.车险个人客户保费) * 100),
|
round(SUM(cf.车非融合保费) / SUM(cf.车险个人客户保费) * 100,
|
||||||
2))
|
2))
|
||||||
INTO a_attaching_rate
|
INTO a_attaching_rate
|
||||||
FROM 坐席车非每日保费 cf
|
FROM 坐席车非每日保费 cf
|
||||||
WHERE cf.月份 = l_this_month
|
WHERE cf.坐席工号 = a_caller_code
|
||||||
AND cf.年份 = l_this_year
|
AND cf.年份 = l_this_year
|
||||||
AND 部门代码 = a_department_code;
|
AND cf.月份 = l_this_month;
|
||||||
|
|
||||||
--续保率
|
--续保率
|
||||||
SELECT decode(SUM(到期数),
|
SELECT decode(nvl(SUM(xb.到期数),
|
||||||
|
0),
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
round(SUM(已续保累计) / SUM(到期数) * 100,
|
round(SUM(xb.已续保累计) / SUM(xb.到期数) * 100,
|
||||||
2))
|
2)) xbl
|
||||||
INTO a_renewal_rate
|
INTO a_renewal_rate
|
||||||
FROM 坐席续保统计
|
FROM 坐席续保统计 xb
|
||||||
WHERE 部门 = l_department_name;
|
WHERE xb.坐席工号 = a_caller_code;
|
||||||
|
|
||||||
--总业绩
|
|
||||||
SELECT round(nvl(SUM(cf.车险个人客户保费 + cf.车非融合保费),
|
|
||||||
0),
|
|
||||||
0)
|
|
||||||
INTO a_total
|
|
||||||
FROM 坐席车非每日保费 cf
|
|
||||||
WHERE 部门代码 = a_department_code
|
|
||||||
AND 签单日期 >= l_firstday
|
|
||||||
AND 签单日期 <= SYSDATE;
|
|
||||||
|
|
||||||
--每月业绩
|
--每月业绩
|
||||||
OPEN a_mensual_cur FOR
|
OPEN A_MENSUAL_CUR FOR
|
||||||
SELECT cf.月份 mm,
|
SELECT CF.月份 MM,
|
||||||
round(nvl(SUM(cf.车险个人客户保费 + cf.车非融合保费) / 10000,
|
ROUND(NVL(SUM(CF.车险个人客户保费 + CF.车非融合保费),
|
||||||
0),
|
0),
|
||||||
0) bf
|
0) BF
|
||||||
FROM 坐席车非每日保费 cf
|
FROM 坐席车非每日保费 CF
|
||||||
WHERE 部门代码 = a_department_code
|
WHERE cf.坐席工号 = a_caller_code
|
||||||
AND 签单日期 >= to_date(to_char(SYSDATE,
|
AND 签单日期 >= TO_DATE(TO_CHAR(SYSDATE,
|
||||||
'yyyy') || '-01-01 00:00:00',
|
'yyyy') || '-01-01 00:00:00',
|
||||||
'yyyy-mm-dd hh24:mi:ss')
|
'yyyy-mm-dd hh24:mi:ss')
|
||||||
AND 签单日期 < to_date(to_char(SYSDATE,
|
AND 签单日期 <= SYSDATE
|
||||||
'yyyy-mm') || '-01 00:00:00',
|
GROUP BY CF.月份
|
||||||
'yyyy-mm-dd hh24:mi:ss')
|
ORDER BY CF.月份;
|
||||||
GROUP BY cf.月份
|
|
||||||
ORDER BY cf.月份;
|
|
||||||
END;
|
END;
|
||||||
|
|
||||||
/*******************************************************/
|
/*******************************************************/
|
||||||
-- 坐席排行榜
|
-- 坐席排行榜
|
||||||
PROCEDURE caller_arch_ranking_list
|
PROCEDURE CALLER_ARCH_RANKING_LIST
|
||||||
(
|
(
|
||||||
a_department_code IN VARCHAR2,
|
A_DEPARTMENT_CODE IN VARCHAR2,
|
||||||
a_year IN VARCHAR2,
|
A_YEAR IN VARCHAR2,
|
||||||
a_month IN VARCHAR2,
|
A_MONTH IN VARCHAR2,
|
||||||
a_attaching_ranking_list OUT cur_type,
|
A_ATTACHING_RANKING_LIST OUT CUR_TYPE,
|
||||||
a_renewal_ranking_list OUT cur_type
|
A_RENEWAL_RANKING_LIST OUT CUR_TYPE
|
||||||
) IS
|
) IS
|
||||||
l_department_name VARCHAR2(100);
|
L_DEPARTMENT_NAME VARCHAR2(100);
|
||||||
BEGIN
|
BEGIN
|
||||||
-- 获取部门名称
|
-- 获取部门名称
|
||||||
BEGIN
|
BEGIN
|
||||||
SELECT department_name
|
SELECT DEPARTMENT_NAME
|
||||||
INTO l_department_name
|
INTO L_DEPARTMENT_NAME
|
||||||
FROM idst0.bm_t bm
|
FROM IDST0.BM_T BM
|
||||||
WHERE bm.department_code = a_department_code;
|
WHERE BM.DEPARTMENT_CODE = A_DEPARTMENT_CODE;
|
||||||
EXCEPTION
|
EXCEPTION
|
||||||
-- 如果没有找到部门名称,说明代码错误,抛出异常
|
-- 如果没有找到部门名称,说明代码错误,抛出异常
|
||||||
WHEN NO_DATA_FOUND THEN
|
WHEN NO_DATA_FOUND THEN
|
||||||
raise_application_error(DEPARTMENTCODE_EXCEPTION_CODE,
|
RAISE_APPLICATION_ERROR(DEPARTMENTCODE_EXCEPTION_CODE,
|
||||||
DEPARTMENTCODE_EXCEPTION_MSG);
|
DEPARTMENTCODE_EXCEPTION_MSG);
|
||||||
|
|
||||||
END;
|
END;
|
||||||
|
|
||||||
-- 车非融合率排行榜
|
-- 车非融合率排行榜
|
||||||
OPEN a_attaching_ranking_list FOR
|
OPEN A_ATTACHING_RANKING_LIST FOR
|
||||||
SELECT 坐席名称,
|
SELECT ROWNUM,
|
||||||
round(nvl(SUM(车非融合保费) / SUM(车险个人客户保费),
|
坐席名称 AS CALLER_NAME,
|
||||||
0) * 100,
|
车非渗透率 AS ATTACHING_RATE
|
||||||
2) 车非渗透率
|
FROM (SELECT 坐席名称,
|
||||||
FROM 坐席车非每日保费
|
ROUND(DECODE(nvl(SUM(车险个人客户保费),
|
||||||
WHERE 月份 = a_month
|
0),
|
||||||
AND 年份 = a_year
|
0,
|
||||||
AND 部门代码 = a_department_code
|
0,
|
||||||
GROUP BY 坐席名称
|
(SUM(车非融合保费) / SUM(车险个人客户保费)) * 100),
|
||||||
--HAVING 月份 = '06月'
|
2) 车非渗透率
|
||||||
ORDER BY 车非渗透率 DESC;
|
FROM 坐席车非每日保费
|
||||||
|
WHERE 月份 = A_MONTH
|
||||||
|
AND 年份 = A_YEAR
|
||||||
|
AND 部门代码 = A_DEPARTMENT_CODE
|
||||||
|
GROUP BY 坐席名称
|
||||||
|
ORDER BY 车非渗透率 DESC);
|
||||||
-- 续保率排行榜
|
-- 续保率排行榜
|
||||||
OPEN a_renewal_ranking_list FOR
|
OPEN A_RENEWAL_RANKING_LIST FOR
|
||||||
SELECT 坐席名称,
|
SELECT ROWNUM,
|
||||||
round(nvl((SUM(已续保累计) / SUM(到期数)) * 100,
|
坐席名称 AS CALLER_NAME,
|
||||||
0),
|
续保率 AS RENEWAL_RATE
|
||||||
2) 续保率
|
FROM (SELECT 坐席名称,
|
||||||
FROM 坐席续保统计 xb
|
decode(nvl(SUM(xb.到期数),
|
||||||
WHERE xb.部门 = l_department_name
|
0),
|
||||||
GROUP BY 坐席名称
|
0,
|
||||||
ORDER BY 续保率 DESC;
|
0,
|
||||||
|
round(SUM(xb.已续保累计) / SUM(xb.到期数) * 100,
|
||||||
|
2)) 续保率
|
||||||
|
FROM 坐席续保统计 XB
|
||||||
|
WHERE XB.部门 = L_DEPARTMENT_NAME
|
||||||
|
GROUP BY 坐席名称
|
||||||
|
ORDER BY 续保率 DESC);
|
||||||
END;
|
END;
|
||||||
|
|
||||||
BEGIN
|
BEGIN
|
||||||
NULL;
|
NULL;
|
||||||
END telsale_archievement_pkg;
|
END TELSALE_ARCHIEVEMENT_PKG;
|
||||||
/
|
/
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -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 '湖里支公司' and(cd.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 '湖里支公司' and(cd.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.*,
|
||||||
|
nvl(zx.workerno,
|
||||||
|
et.telpartnercode) 坐席工号,
|
||||||
|
(CASE WHEN nvl(zx.workerno,
|
||||||
|
et.telpartnercode) =
|
||||||
|
'DX001' AND aa3.经办 LIKE
|
||||||
|
'%建发凯迪%' THEN
|
||||||
|
'林伟华' WHEN nvl(zx.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.坐席工号 = nvl(zx.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;
|
||||||
|
/
|
|
@ -0,0 +1,99 @@
|
||||||
|
CREATE OR REPLACE PACKAGE telsaler_reward_pkg IS
|
||||||
|
|
||||||
|
-- Author : WANGWEI-202
|
||||||
|
-- Created : 2023/9/13 10:05:43
|
||||||
|
-- Purpose : 坐席奖励相关的包
|
||||||
|
|
||||||
|
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,
|
||||||
|
'值重复');
|
||||||
|
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,
|
||||||
|
'无此记录!');
|
||||||
|
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;
|
||||||
|
/
|
|
@ -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;
|
|
@ -1,18 +1,18 @@
|
||||||
drop table 车非每日保费_T;
|
drop table 车非每日保费_T;
|
||||||
create global temporary table 车非每日保费_T
|
create global temporary table 车非每日保费_T
|
||||||
(
|
(
|
||||||
签单日期 DATE not null,
|
签单日期 DATE not null,
|
||||||
月份 VARCHAR2(10) not null,
|
月份 VARCHAR2(10) not null,
|
||||||
部门 VARCHAR2(100) not null,
|
部门 VARCHAR2(100) not null,
|
||||||
部门代码 varchar2(100) not null,
|
部门代码 varchar2(100) not null,
|
||||||
科室n VARCHAR2(100) not null,
|
科室n VARCHAR2(100) not null,
|
||||||
经办人n VARCHAR2(100),
|
经办人n VARCHAR2(100),
|
||||||
坐席工号 VARCHAR2(20),
|
坐席工号 VARCHAR2(20),
|
||||||
坐席名称 VARCHAR2(30),
|
坐席名称 VARCHAR2(30),
|
||||||
坐席团队 VARCHAR2(100),
|
坐席团队 VARCHAR2(100),
|
||||||
车险个人客户保费 NUMBER(16,2),
|
车险个人客户保费 NUMBER(16,2),
|
||||||
车非融合保费 NUMBER(16,2)
|
车非融合保费 NUMBER(16,2)
|
||||||
)
|
)
|
||||||
on commit preserve rows;
|
on commit preserve rows;
|
||||||
-- Grant/Revoke object privileges
|
-- Grant/Revoke object privileges
|
||||||
grant select, insert, delete, alter on 车非每日保费_T to DATACENTER;
|
grant select, insert, delete, alter on 车非每日保费_T to DATACENTER;
|
||||||
|
|
|
@ -1,36 +1,50 @@
|
||||||
INSERT INTO desktop_archievement_admin.坐席车非每日保费
|
--INSERT INTO desktop_archievement_admin.坐席车非每日保费
|
||||||
WITH aa AS
|
WITH aa AS
|
||||||
(SELECT to_char(t.signature_date,
|
(SELECT to_char(t.signature_date,
|
||||||
'yyyy-mm-dd') 签单日期,
|
'yyyy-mm-dd') 签单日期,
|
||||||
(to_char(T.signature_date,
|
(to_char(T.signature_date,
|
||||||
'yyyy')) the_year,
|
'yyyy')) the_year,
|
||||||
(to_char(T.signature_date,
|
(to_char(T.signature_date,
|
||||||
'mm')) the_month,
|
'mm')) the_month,
|
||||||
t.policy_no bdh,
|
t.policy_no bdh,
|
||||||
t.endorsement_no pdh,
|
t.endorsement_no pdh,
|
||||||
qt.t_cre tid,
|
qt.t_cre tid,
|
||||||
QT.B_CRE BTID, -----添加字段
|
QT.B_CRE BTID, -----添加字段
|
||||||
e.inception_date qbsj,
|
e.inception_date qbsj,
|
||||||
e.planned_end_date zzsj,
|
e.planned_end_date zzsj,
|
||||||
pt.premium_amount - nvl(pt.tax_amount,
|
pt.premium_amount - nvl(pt.tax_amount,
|
||||||
0) bf
|
0) bf
|
||||||
--,qt.qdbf - nvl(qt.qdbf_tax_amount,0) bf
|
--,qt.qdbf - nvl(qt.qdbf_tax_amount,0) bf
|
||||||
,
|
,
|
||||||
nt.ecompensation_rate * (pt.premium_amount - nvl(pt.tax_amount,
|
nt.ecompensation_rate * (pt.premium_amount - nvl(pt.tax_amount,
|
||||||
0)) fxbf,
|
0)) fxbf,
|
||||||
z.department_name bm,
|
z.department_name bm,
|
||||||
z.department_code bmdm,
|
z.department_code bmdm,
|
||||||
CASE
|
CASE
|
||||||
WHEN (et.telpartnercode LIKE '%HC%' OR
|
WHEN (et.telpartnercode LIKE '%HC%' OR zx.workerno IN (SELECT code
|
||||||
zx.workerno IN (SELECT code
|
FROM datacenter.dc_lsj_zx_hc)) THEN
|
||||||
FROM datacenter.dc_lsj_zx_hc)) THEN
|
'海沧丰骏'
|
||||||
'海沧丰骏'
|
ELSE
|
||||||
ELSE
|
''
|
||||||
''
|
END 是否丰骏,
|
||||||
END 是否丰骏,
|
nvl(zx.workerno,
|
||||||
nvl(zx.workerno,
|
et.telpartnercode) 坐席工号,
|
||||||
et.telpartnercode) 坐席工号,
|
(CASE
|
||||||
(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,
|
WHEN nvl(zx.workerno,
|
||||||
et.telpartnercode) = 'DX001' AND
|
et.telpartnercode) = 'DX001' AND
|
||||||
xx.staff_name LIKE '%建发凯迪%' THEN
|
xx.staff_name LIKE '%建发凯迪%' THEN
|
||||||
|
@ -41,269 +55,256 @@ INSERT INTO desktop_archievement_admin.
|
||||||
'其他'
|
'其他'
|
||||||
ELSE
|
ELSE
|
||||||
to_char(ys.坐席姓名)
|
to_char(ys.坐席姓名)
|
||||||
END) 坐席名称,
|
END),
|
||||||
YS.团队 坐席团队,
|
xx.staff_name) 经办人N
|
||||||
nvl(YS.团队,
|
FROM idst0.auto_agreement_request_t t
|
||||||
y.section_office_name) 科室N,
|
LEFT JOIN idst0.auto_agreement_t e
|
||||||
nvl((CASE
|
ON e.policy_no = t.policy_no
|
||||||
WHEN nvl(zx.workerno,
|
LEFT JOIN idst0.motorised_vehicle_t v
|
||||||
et.telpartnercode) = 'DX001' AND
|
ON v.policy_no = e.policy_no
|
||||||
xx.staff_name LIKE '%建发凯迪%' THEN
|
LEFT JOIN idst0.auto_premium_t pt
|
||||||
'林伟华'
|
ON pt.policy_no = t.policy_no
|
||||||
WHEN nvl(zx.workerno,
|
AND pt.endorsement_no = t.endorsement_no
|
||||||
et.telpartnercode) = 'DX001' AND
|
LEFT JOIN ywglxt.w_dxbd_i i
|
||||||
xx.staff_name NOT LIKE '%建发凯迪%' THEN
|
ON e.policy_no = i.bdh
|
||||||
'其他'
|
LEFT JOIN idst0.rydm_t xx
|
||||||
ELSE
|
ON xx.staff_code = nvl(i.zhjywy,
|
||||||
to_char(ys.坐席姓名)
|
e.operator_code)
|
||||||
END),
|
LEFT JOIN idst0.ks_t y
|
||||||
xx.staff_name) 经办人N
|
ON y.section_office_code = nvl(xx.section_office_code,
|
||||||
FROM idst0.auto_agreement_request_t t
|
e.section_office_code)
|
||||||
LEFT JOIN idst0.auto_agreement_t e
|
LEFT JOIN idst0.bm_t z
|
||||||
ON e.policy_no = t.policy_no
|
ON z.department_code = nvl(xx.department_code,
|
||||||
LEFT JOIN idst0.motorised_vehicle_t v
|
e.department_code)
|
||||||
ON v.policy_no = e.policy_no
|
--left join datacenter.dc_cx_csteam ct on ct.jbrcode = xx.staff_code
|
||||||
LEFT JOIN idst0.auto_premium_t pt
|
LEFT JOIN idst0.auto_new_product_info_t nt
|
||||||
ON pt.policy_no = t.policy_no
|
ON nt.policy_no = t.policy_no
|
||||||
AND pt.endorsement_no = t.endorsement_no
|
AND nt.endorsement_no = t.endorsement_no
|
||||||
LEFT JOIN ywglxt.w_dxbd_i i
|
--left join ywglxt.q_auto_agreement_extend_t qe on qe.policy_no = e.policy_no
|
||||||
ON e.policy_no = i.bdh
|
LEFT JOIN ywglxt.q_auto_agreement_t qt
|
||||||
LEFT JOIN idst0.rydm_t xx
|
ON qt.policy_no = e.policy_no
|
||||||
ON xx.staff_code = nvl(i.zhjywy,
|
LEFT JOIN datacenter.dc_yangg_qdcode qd
|
||||||
e.operator_code)
|
ON qd.code = e.selling_channel_type
|
||||||
LEFT JOIN idst0.ks_t y
|
LEFT JOIN datacenter.dc_tb_jc_c_tag cl
|
||||||
ON y.section_office_code = nvl(xx.section_office_code,
|
ON cl.保单号 = e.policy_no
|
||||||
e.section_office_code)
|
LEFT JOIN datacenter.dc_yangg_basecode_teams fg
|
||||||
LEFT JOIN idst0.bm_t z
|
ON fg.bm = z.department_name
|
||||||
ON z.department_code = nvl(xx.department_code,
|
AND fg.ks = y.section_office_name
|
||||||
e.department_code)
|
--left join idst0.t_sell_policy_autobase_t zx on zx.policy_no=e.policy_no
|
||||||
--left join datacenter.dc_cx_csteam ct on ct.jbrcode = xx.staff_code
|
--left join idst0.auto_agreement_extend_t et on et.policy_no = e.policy_no
|
||||||
LEFT JOIN idst0.auto_new_product_info_t nt
|
LEFT JOIN idst0.auto_agreement_extend_t et
|
||||||
ON nt.policy_no = t.policy_no
|
ON et.policy_no = e.policy_no
|
||||||
AND nt.endorsement_no = t.endorsement_no
|
LEFT JOIN idst0.t_sell_policy_autobase_t zx
|
||||||
--left join ywglxt.q_auto_agreement_extend_t qe on qe.policy_no = e.policy_no
|
ON zx.policy_no = e.policy_no
|
||||||
LEFT JOIN ywglxt.q_auto_agreement_t qt
|
LEFT JOIN datacenter.dc_YZH_ZXYS YS
|
||||||
ON qt.policy_no = e.policy_no
|
ON YS.坐席工号 = nvl(zx.workerno,
|
||||||
LEFT JOIN datacenter.dc_yangg_qdcode qd
|
et.telpartnercode)
|
||||||
ON qd.code = e.selling_channel_type
|
--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_tb_jc_c_tag cl
|
--left join datacenter.dc_lsj_zx_team zt on zt.name=coalesce(zc.name,zc1.name,bc.name,dm.JBRMC)
|
||||||
ON cl.保单号 = e.policy_no
|
WHERE t.signature_date >= to_date('2023-01-01 00:00:00',
|
||||||
LEFT JOIN datacenter.dc_yangg_basecode_teams fg
|
'yyyy-mm-dd hh24:mi:ss')
|
||||||
ON fg.bm = z.department_name
|
AND t.signature_date < to_date(to_char(SYSDATE - 1,
|
||||||
AND fg.ks = y.section_office_name
|
'yyyy-mm-dd') || ' 23:59:59',
|
||||||
--left join idst0.t_sell_policy_autobase_t zx on zx.policy_no=e.policy_no
|
'yyyy-mm-dd hh24:mi:ss')
|
||||||
--left join idst0.auto_agreement_extend_t et on et.policy_no = e.policy_no
|
--and t.endorsement_no = '无'
|
||||||
LEFT JOIN idst0.auto_agreement_extend_t et
|
AND e.policy_status = '1' --条件:保单有效
|
||||||
ON et.policy_no = e.policy_no
|
AND qt.tflag = '0' --条件:类型为个人
|
||||||
LEFT JOIN idst0.t_sell_policy_autobase_t zx
|
AND qt.usage_xm = '家庭自用车'
|
||||||
ON zx.policy_no = e.policy_no
|
--条件:单程提车、摩托车、拖拉机
|
||||||
LEFT JOIN datacenter.dc_YZH_ZXYS YS
|
--and e.policy_no in ('AXIMC90Y1419B038594J','AXIMC90CTP19B039593R','AXIMC04CTP19B013473X')
|
||||||
ON YS.坐席工号 = nvl(zx.workerno,
|
AND e.planned_end_date - e.inception_date >= 360
|
||||||
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')
|
dd2 AS
|
||||||
AND t.signature_date < to_date(to_char(SYSDATE - 1,
|
(SELECT 签单日期,
|
||||||
'yyyy-mm-dd') || ' 23:59:59',
|
the_year,
|
||||||
'yyyy-mm-dd hh24:mi:ss')
|
the_month,
|
||||||
--and t.endorsement_no = '无'
|
bm,
|
||||||
AND e.policy_status = '1' --条件:保单有效
|
bmdm,
|
||||||
AND qt.tflag = '0' --条件:类型为个人
|
坐席工号,
|
||||||
AND qt.usage_xm = '家庭自用车'
|
坐席名称,
|
||||||
--条件:单程提车、摩托车、拖拉机
|
坐席团队,
|
||||||
--and e.policy_no in ('AXIMC90Y1419B038594J','AXIMC90CTP19B039593R','AXIMC04CTP19B013473X')
|
科室N,
|
||||||
AND e.planned_end_date - e.inception_date >= 360
|
经办人N,
|
||||||
--条件:保单周期
|
CASE
|
||||||
)
|
WHEN pdh = '无' THEN
|
||||||
-----添加字段
|
tid
|
||||||
,
|
END tid,
|
||||||
dd2 AS
|
to_number('1') 客户数,
|
||||||
(SELECT 签单日期,
|
COUNT(DISTINCT CASE
|
||||||
the_year,
|
WHEN pdh = '无' THEN
|
||||||
the_month,
|
bdh
|
||||||
bm,
|
END) 保单数,
|
||||||
bmdm,
|
SUM(bf) 保费
|
||||||
坐席工号,
|
FROM (SELECT DISTINCT *
|
||||||
坐席名称,
|
FROM aa) aa
|
||||||
坐席团队,
|
GROUP BY bm,
|
||||||
科室N,
|
bmdm,
|
||||||
经办人N,
|
CASE
|
||||||
CASE
|
WHEN pdh = '无' THEN
|
||||||
WHEN pdh = '无' THEN
|
tid
|
||||||
tid
|
END,
|
||||||
END tid,
|
the_year,
|
||||||
to_number('1') 客户数,
|
the_month,
|
||||||
COUNT(DISTINCT CASE
|
BTID,
|
||||||
WHEN pdh = '无' THEN
|
坐席工号,
|
||||||
bdh
|
坐席名称,
|
||||||
END) 保单数,
|
坐席团队,
|
||||||
SUM(bf) 保费
|
签单日期,
|
||||||
FROM (SELECT DISTINCT *
|
科室N,
|
||||||
FROM aa) aa
|
经办人N
|
||||||
GROUP BY bm,
|
UNION
|
||||||
bmdm,
|
SELECT 签单日期,
|
||||||
CASE
|
the_year,
|
||||||
WHEN pdh = '无' THEN
|
the_month,
|
||||||
tid
|
bm,
|
||||||
END,
|
bmdm,
|
||||||
the_year,
|
坐席工号,
|
||||||
the_month,
|
坐席名称,
|
||||||
BTID,
|
坐席团队,
|
||||||
坐席工号,
|
科室N,
|
||||||
坐席名称,
|
经办人N,
|
||||||
坐席团队,
|
CASE
|
||||||
签单日期,
|
WHEN btid = tid THEN
|
||||||
科室N,
|
''
|
||||||
经办人N
|
ELSE
|
||||||
UNION
|
btid
|
||||||
SELECT 签单日期,
|
END btid,
|
||||||
the_year,
|
to_number('0') 客户数,
|
||||||
the_month,
|
to_number('0') 保单数,
|
||||||
bm,
|
to_number('0') 保费
|
||||||
bmdm,
|
FROM (SELECT DISTINCT *
|
||||||
坐席工号,
|
FROM aa) aa),
|
||||||
坐席名称,
|
DD AS
|
||||||
坐席团队,
|
(SELECT *
|
||||||
科室N,
|
FROM DD2
|
||||||
经办人N,
|
WHERE TID IS NOT NULL)
|
||||||
CASE
|
--select * from dd
|
||||||
WHEN btid = tid THEN
|
,
|
||||||
''
|
bb AS
|
||||||
ELSE
|
(SELECT DISTINCT q.policy_no bdh,
|
||||||
btid
|
q.endorsement_no pdh,
|
||||||
END btid,
|
qna.t_cre tid,
|
||||||
to_number('0') 客户数,
|
to_number(to_char(q.signature_date,
|
||||||
to_number('0') 保单数,
|
'yyyy')) || '年' nf,
|
||||||
to_number('0') 保费
|
(to_char(q.signature_date,
|
||||||
FROM (SELECT DISTINCT *
|
'mm')) mm_f,
|
||||||
FROM aa) aa),
|
to_char(q.signature_date,
|
||||||
DD AS
|
'dd') || '日' dd,
|
||||||
(SELECT *
|
q.signature_date sj,
|
||||||
FROM DD2
|
round((pt.premium_amount - nvl(pt.taxamount,
|
||||||
WHERE TID IS NOT NULL)
|
0)) * c.rate / 100,
|
||||||
--select * from dd
|
2) bf,
|
||||||
,
|
z.department_name bm
|
||||||
bb AS
|
FROM idst0.nonauto_agreement_request_t q
|
||||||
(SELECT DISTINCT q.policy_no bdh,
|
LEFT JOIN idst0.nonauto_agreement_t e
|
||||||
q.endorsement_no pdh,
|
ON e.policy_no = q.policy_no
|
||||||
qna.t_cre tid,
|
LEFT JOIN idst0.nonauto_premium_t pt
|
||||||
to_number(to_char(q.signature_date,
|
ON pt.endorsement_no = q.endorsement_no
|
||||||
'yyyy')) || '年' nf,
|
AND pt.policy_no = q.policy_no
|
||||||
(to_char(q.signature_date,
|
LEFT JOIN idst0.reinsurance_t r
|
||||||
'mm')) mm_f,
|
ON r.reinsurance_policy_no = e.policy_no
|
||||||
to_char(q.signature_date,
|
LEFT JOIN idst0.exrate_month_t c
|
||||||
'dd') || '日' dd,
|
ON pt.currency_code = c.bzh
|
||||||
q.signature_date sj,
|
AND to_char(q.signature_date,
|
||||||
round((pt.premium_amount - nvl(pt.taxamount,
|
'YYYY') = c.theyear
|
||||||
0)) * c.rate / 100,
|
AND to_char(q.signature_date,
|
||||||
2) bf,
|
'fmmm') = c.themonth
|
||||||
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
|
LEFT JOIN idst0.rydm_t x
|
||||||
ON x.staff_code = e.operator_code
|
ON x.staff_code = e.operator_code
|
||||||
LEFT JOIN idst0.ks_t y
|
LEFT JOIN idst0.ks_t y
|
||||||
ON y.section_office_code = x.section_office_code
|
ON y.section_office_code = x.section_office_code
|
||||||
LEFT JOIN idst0.bm_t z
|
LEFT JOIN idst0.bm_t z
|
||||||
ON z.department_code = x.department_code
|
ON z.department_code = x.department_code
|
||||||
LEFT JOIN ywglxt.q_nonauto_agreement_t qna
|
LEFT JOIN ywglxt.q_nonauto_agreement_t qna
|
||||||
ON qna.policy_no = q.policy_no
|
ON qna.policy_no = q.policy_no
|
||||||
LEFT JOIN datacenter.dc_yangg_gkxzh gk
|
LEFT JOIN datacenter.dc_yangg_gkxzh gk
|
||||||
ON gk.product_code = e.product_code --分散型险种
|
ON gk.product_code = e.product_code --分散型险种
|
||||||
--left join datacenter.dc_yangg_zbxzh zb on zb.product_code = e.product_code --政保险种
|
--left join datacenter.dc_yangg_zbxzh zb on zb.product_code = e.product_code --政保险种
|
||||||
LEFT JOIN dd
|
LEFT JOIN dd
|
||||||
ON dd.tid = qna.t_cre
|
ON dd.tid = qna.t_cre
|
||||||
WHERE qna.tflag = '0'
|
WHERE qna.tflag = '0'
|
||||||
AND (CASE
|
AND (CASE
|
||||||
WHEN q.endorsement_no != '无' AND
|
WHEN q.endorsement_no != '无' AND
|
||||||
round((pt.premium_amount - nvl(pt.taxamount,
|
round((pt.premium_amount - nvl(pt.taxamount,
|
||||||
0)) * c.rate / 100,
|
0)) * c.rate / 100,
|
||||||
2) != 0 THEN
|
2) != 0 THEN
|
||||||
'是'
|
'是'
|
||||||
END) IS NULL
|
END) IS NULL
|
||||||
--and q.endorsement_no = '无'
|
--and q.endorsement_no = '无'
|
||||||
AND e.policy_status = '1'
|
AND e.policy_status = '1'
|
||||||
AND gk.product_code IS NOT NULL
|
AND gk.product_code IS NOT NULL
|
||||||
AND (e.product_code LIKE '2%' OR e.product_code LIKE '1106%' --意健 --责任
|
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%' --家财
|
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 e.product_code not in ('22KC9800')
|
||||||
AND q.signature_date >= to_date('2023-01-01 00:00:00',
|
AND q.signature_date >= to_date('2023-01-01 00:00:00',
|
||||||
'yyyy-mm-dd hh24:mi:ss')
|
'yyyy-mm-dd hh24:mi:ss')
|
||||||
AND q.signature_date < to_date(to_char(SYSDATE - 1,
|
AND q.signature_date < to_date(to_char(SYSDATE - 1,
|
||||||
'yyyy-mm-dd') || ' 23:59:59',
|
'yyyy-mm-dd') || ' 23:59:59',
|
||||||
'yyyy-mm-dd hh24:mi:ss')
|
'yyyy-mm-dd hh24:mi:ss')
|
||||||
AND e.planned_end_date - e.inception_date >= 90
|
AND e.planned_end_date - e.inception_date >= 90
|
||||||
AND dd.tid IS NOT NULL
|
AND dd.tid IS NOT NULL
|
||||||
--车险个人客户)
|
--车险个人客户)
|
||||||
)
|
)
|
||||||
--SELECT * FROM BB
|
--SELECT * FROM BB
|
||||||
,
|
,
|
||||||
cc AS
|
cc AS
|
||||||
(SELECT mm_f,
|
(SELECT mm_f,
|
||||||
tid 融合证件,
|
tid 融合证件,
|
||||||
COUNT(DISTINCT bdh) 融合保数,
|
COUNT(DISTINCT bdh) 融合保数,
|
||||||
SUM(bf) 融合保费
|
SUM(bf) 融合保费
|
||||||
FROM bb
|
FROM bb
|
||||||
GROUP BY tid,
|
GROUP BY tid,
|
||||||
mm_f),
|
mm_f),
|
||||||
ff AS
|
ff AS
|
||||||
(SELECT dd.*,
|
(SELECT dd.*,
|
||||||
cc.*
|
cc.*
|
||||||
FROM dd
|
FROM dd
|
||||||
LEFT JOIN cc
|
LEFT JOIN cc
|
||||||
ON cc.融合证件 = dd.tid
|
ON cc.融合证件 = dd.tid
|
||||||
AND cc.mm_f = dd.the_month) --OR cc.融合证件 = dd.btid
|
AND cc.mm_f = dd.the_month) --OR cc.融合证件 = dd.btid
|
||||||
--select * from ff
|
--select * from ff
|
||||||
SELECT to_date(签单日期,
|
SELECT to_date(签单日期,
|
||||||
'yyyy-mm-dd') 签单日期,
|
'yyyy-mm-dd') 签单日期,
|
||||||
the_year 年份,
|
the_year 年份,
|
||||||
the_month 月份,
|
the_month 月份,
|
||||||
bm 部门,
|
bm 部门,
|
||||||
bmdm 部门代码,
|
bmdm 部门代码,
|
||||||
科室N,
|
科室N,
|
||||||
经办人N,
|
经办人N,
|
||||||
坐席工号,
|
坐席工号,
|
||||||
坐席名称,
|
坐席名称,
|
||||||
坐席团队,
|
坐席团队,
|
||||||
nvl(SUM(保费),
|
nvl(SUM(保费),
|
||||||
0) 车险个人客户保费,
|
0) 车险个人客户保费,
|
||||||
nvl(SUM(融合保费),
|
nvl(SUM(融合保费),
|
||||||
0) 车非融合保费
|
0) 车非融合保费
|
||||||
FROM ff
|
FROM ff
|
||||||
WHERE to_date(ff.签单日期,
|
WHERE to_date(ff.签单日期,
|
||||||
'yyyy-mm-dd') >= DATE '2023-01-01'
|
'yyyy-mm-dd') >= DATE '2023-06-01'
|
||||||
AND to_date(ff.签单日期,
|
AND to_date(ff.签单日期,
|
||||||
'yyyy-mm-dd') <= SYSDATE
|
'yyyy-mm-dd') < DATE '2023-07-01'
|
||||||
AND bm IN ('续保业务部',
|
AND bm IN ('续保业务部',
|
||||||
'湖里支公司')
|
'湖里支公司')
|
||||||
GROUP BY 签单日期,
|
GROUP BY 签单日期,
|
||||||
the_year,
|
the_year,
|
||||||
the_month,
|
the_month,
|
||||||
bm,
|
bm,
|
||||||
bmdm,
|
bmdm,
|
||||||
坐席工号,
|
坐席工号,
|
||||||
坐席名称,
|
坐席名称,
|
||||||
坐席团队,
|
坐席团队,
|
||||||
科室N,
|
科室N,
|
||||||
经办人N
|
经办人N
|
||||||
ORDER BY 部门,
|
ORDER BY 部门,
|
||||||
坐席名称;
|
坐席名称;
|
||||||
|
|
||||||
|
/*
|
||||||
SELECT *
|
SELECT *
|
||||||
FROM desktop_archievement_admin.坐席车非每日保费;
|
FROM desktop_archievement_admin.坐席车非每日保费;
|
||||||
|
*/
|
||||||
|
|
|
@ -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.坐席工号= nvl(zx.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 nvl(zx.workerno,et.telpartnercode) = 'DX001' and x.staff_name like '%建发凯迪%' then '林伟华'
|
||||||
|
when nvl(zx.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) 坐席名称
|
||||||
|
,nvl(zx.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.坐席工号= nvl(zx.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 nvl(zx.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.坐席工号= nvl(zx.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 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 '其他'
|
||||||
|
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.坐席工号= nvl(zx.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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -67,6 +67,8 @@ module.exports = {
|
||||||
js: "espree",
|
js: "espree",
|
||||||
"<template>": "espree",
|
"<template>": "espree",
|
||||||
},
|
},
|
||||||
|
project: "./tsconfig.json",
|
||||||
|
extraFileExtensions: [".vue",],
|
||||||
},
|
},
|
||||||
plugins: ["eslint-plugin-vue",],
|
plugins: ["eslint-plugin-vue",],
|
||||||
extends: [
|
extends: [
|
||||||
|
@ -79,13 +81,14 @@ module.exports = {
|
||||||
],
|
],
|
||||||
rules: {
|
rules: {
|
||||||
indent: ["warn", 4,],
|
indent: ["warn", 4,],
|
||||||
|
"no-trailing-spaces": ["error", {"ignoreComments": true,},],
|
||||||
// 圆括号中的空格,为空不加空格,紧跟花括号、方括号、圆括号时也不加入空格
|
// 圆括号中的空格,为空不加空格,紧跟花括号、方括号、圆括号时也不加入空格
|
||||||
"space-in-parens": ["error", "always", { exceptions: ["{}", "[]", "()", "empty",], },],
|
"space-in-parens": ["error", "always", { exceptions: ["{}", "[]", "()", "empty",], },],
|
||||||
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
|
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
|
||||||
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
|
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
|
||||||
"no-unused-vars": "warn",
|
"no-unused-vars": "warn",
|
||||||
semi: ["error", "always",], // 控制行尾部分号
|
"semi-spacing": ["error", {"before": false, "after": true,},], // 控制行尾部分号
|
||||||
quotes: ["error", "double",],
|
"quotes": ["error", "double",],
|
||||||
"comma-dangle": ["error", {
|
"comma-dangle": ["error", {
|
||||||
arrays: "always",
|
arrays: "always",
|
||||||
objects: "always",
|
objects: "always",
|
||||||
|
@ -109,6 +112,7 @@ module.exports = {
|
||||||
"vue/html-indent": ["error", 4,],
|
"vue/html-indent": ["error", 4,],
|
||||||
// typescript
|
// typescript
|
||||||
"@typescript-eslint/indent": ["warn", 4,],
|
"@typescript-eslint/indent": ["warn", 4,],
|
||||||
|
"@typescript-eslint/no-explicit-any": "warn",
|
||||||
"@typescript-eslint/no-extra-semi": "off",
|
"@typescript-eslint/no-extra-semi": "off",
|
||||||
"@typescript-eslint/no-inferrable-types": "off",
|
"@typescript-eslint/no-inferrable-types": "off",
|
||||||
"@typescript-eslint/no-unused-vars": "warn",
|
"@typescript-eslint/no-unused-vars": "warn",
|
||||||
|
@ -149,10 +153,12 @@ module.exports = {
|
||||||
"plugin:@typescript-eslint/recommended",
|
"plugin:@typescript-eslint/recommended",
|
||||||
],
|
],
|
||||||
rules: {
|
rules: {
|
||||||
|
"no-trailing-spaces": ["error", {"ignoreComments": true,},],
|
||||||
// 圆括号中的空格,为空不加空格,紧跟花括号、方括号、圆括号时也不加入空格
|
// 圆括号中的空格,为空不加空格,紧跟花括号、方括号、圆括号时也不加入空格
|
||||||
"space-in-parens": ["error", "always", { exceptions: ["{}", "[]", "()", "empty",], },],
|
"space-in-parens": ["error", "always", { exceptions: ["{}", "[]", "()", "empty",], },],
|
||||||
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
|
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
|
||||||
"no-debugger": 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/indent": ["error", 4,],
|
||||||
"@typescript-eslint/no-extra-semi": "off",
|
"@typescript-eslint/no-extra-semi": "off",
|
||||||
"@typescript-eslint/no-inferrable-types": "off",
|
"@typescript-eslint/no-inferrable-types": "off",
|
||||||
|
@ -188,6 +194,7 @@ module.exports = {
|
||||||
"prefer-const": "warn",
|
"prefer-const": "warn",
|
||||||
"spaced-comment": "error",
|
"spaced-comment": "error",
|
||||||
"space-before-function-paren": "off",
|
"space-before-function-paren": "off",
|
||||||
|
"semi-spacing": ["error", {"before": false, "after": true,},],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -9,31 +9,32 @@
|
||||||
"preview": "vite preview"
|
"preview": "vite preview"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/eslint-parser": "^7.21.8",
|
|
||||||
"@element-plus/icons-vue": "^2.1.0",
|
"@element-plus/icons-vue": "^2.1.0",
|
||||||
"axios": "^1.4.0",
|
"echarts": "^5.4.3",
|
||||||
"babel": "^6.23.0",
|
"element-plus": "^2.3.14",
|
||||||
"echarts": "^5.4.2",
|
"mitt": "^3.0.1",
|
||||||
"element-plus": "^2.3.6",
|
|
||||||
"moment": "^2.29.4",
|
"moment": "^2.29.4",
|
||||||
"sass-loader": "^13.3.1",
|
"sass-loader": "^13.3.2",
|
||||||
"vue": "^3.3.4",
|
"vue": "^3.3.4",
|
||||||
"vue-router": "^4.2.2",
|
"vue-router": "^4.2.5",
|
||||||
"vuex": "^4.1.0"
|
"vuex": "^4.1.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/eslint-parser": "^7.21.8",
|
"@babel/eslint-parser": "^7.22.15",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.59.9",
|
"@rushstack/eslint-patch": "^1.4.0",
|
||||||
"@typescript-eslint/parser": "^5.59.9",
|
"@typescript-eslint/eslint-plugin": "^6.7.2",
|
||||||
"@vitejs/plugin-vue": "^4.2.3",
|
"@vitejs/plugin-vue": "^4.3.4",
|
||||||
"@vue/cli-plugin-eslint": "^5.0.8",
|
"@vue/cli-plugin-eslint": "^5.0.8",
|
||||||
|
"@vue/eslint-config-typescript": "^12.0.0",
|
||||||
|
"axios": "^1.5.0",
|
||||||
|
"babel": "^6.23.0",
|
||||||
"eslint-config-recommended": "^4.1.0",
|
"eslint-config-recommended": "^4.1.0",
|
||||||
"eslint-config-standard-with-typescript": "^35.0.0",
|
"eslint-config-standard-with-typescript": "^39.1.0",
|
||||||
"eslint-plugin-vue": "^9.14.1",
|
"eslint-plugin-vue": "^9.17.0",
|
||||||
"node-sass": "^9.0.0",
|
"node-sass": "^9.0.0",
|
||||||
"sass": "^1.62.1",
|
"sass": "^1.68.0",
|
||||||
"style-loader": "^3.3.3",
|
"style-loader": "^3.3.3",
|
||||||
"typescript": "^5.1.3",
|
"ts-node": "^10.9.1",
|
||||||
"vue-eslint-parser": "^9.3.0"
|
"vue-eslint-parser": "^9.3.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* @Author: Kane
|
* @Author: Kane
|
||||||
* @Date: 2023-02-15 09:25:52
|
* @Date: 2023-02-15 09:25:52
|
||||||
* @LastEditors: Kane
|
* @LastEditors: Kane
|
||||||
* @LastEditTime: 2023-03-17 14:31:14
|
* @LastEditTime: 2023-08-25 10:53:30
|
||||||
* @FilePath: /task_schedule/src/App.vue
|
* @FilePath: /task_schedule/src/App.vue
|
||||||
* @Description:
|
* @Description:
|
||||||
* 应用的框架:
|
* 应用的框架:
|
||||||
|
@ -17,7 +17,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<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 {
|
export default {
|
||||||
name: "App",
|
name: "App",
|
||||||
|
|
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
|
@ -29,11 +29,13 @@ export default {
|
||||||
setup( props )
|
setup( props )
|
||||||
{
|
{
|
||||||
const ui = reactive({
|
const ui = reactive({
|
||||||
|
mensualList: [],
|
||||||
});
|
});
|
||||||
|
|
||||||
// 设置图表
|
// 设置图表
|
||||||
const initCharts = () =>
|
const initCharts = (): void =>
|
||||||
{
|
{
|
||||||
|
console.log( "每月业绩", props.chartData );
|
||||||
const chartDom = document.getElementById( "chartWrapper" );
|
const chartDom = document.getElementById( "chartWrapper" );
|
||||||
const myChart = echarts.init( chartDom as HTMLDivElement );
|
const myChart = echarts.init( chartDom as HTMLDivElement );
|
||||||
const option = {
|
const option = {
|
||||||
|
@ -53,7 +55,7 @@ export default {
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
option && myChart.setOption( option );
|
myChart.setOption( option );
|
||||||
|
|
||||||
window.onresize = function ()
|
window.onresize = function ()
|
||||||
{
|
{
|
||||||
|
|
|
@ -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 }} 万元</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>
|
|
@ -15,7 +15,7 @@
|
||||||
alt=""
|
alt=""
|
||||||
>
|
>
|
||||||
<div class="title-wrapper">
|
<div class="title-wrapper">
|
||||||
<span>"消7灭6"突围战</span>
|
<span>"消8灭70"突围战</span>
|
||||||
<span>{{ props.month }}月入营坐席</span>
|
<span>{{ props.month }}月入营坐席</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -9,7 +9,40 @@
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
<div class="rankinglist-wrapper">
|
<div class="rankinglist-wrapper">
|
||||||
排行榜组件
|
<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>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -42,7 +75,7 @@ export default {
|
||||||
* setup函数
|
* setup函数
|
||||||
* @param props 组件的props属性。
|
* @param props 组件的props属性。
|
||||||
*/
|
*/
|
||||||
setup( props )
|
setup(props)
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* 计算对象,用于获取top5.
|
* 计算对象,用于获取top5.
|
||||||
|
@ -51,13 +84,13 @@ export default {
|
||||||
{
|
{
|
||||||
const rankingList = props.rankingList; // eslint-disable-line
|
const rankingList = props.rankingList; // eslint-disable-line
|
||||||
|
|
||||||
rankingList.sort(( a, b ) =>
|
rankingList.sort((a, b) =>
|
||||||
{
|
{
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
return a.index - b.index;
|
return a.index - b.index;
|
||||||
});
|
});
|
||||||
|
|
||||||
return rankingList.slice(0,5);
|
return rankingList.slice(0, 5);
|
||||||
});
|
});
|
||||||
|
|
||||||
return { props, topFive, };
|
return { props, topFive, };
|
||||||
|
@ -66,13 +99,34 @@ export default {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.rankinglist-wrapper
|
.rankinglist-wrapper {
|
||||||
{
|
// border: 1px solid red;
|
||||||
border: 1px solid red;
|
border-radius: 5px;
|
||||||
|
|
||||||
width: 300px;
|
width: 300px;
|
||||||
height: 250px;
|
height: 260px;
|
||||||
|
|
||||||
font-size: 12px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.rankinglist-index {
|
||||||
|
display: block;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.el-table)
|
||||||
|
{
|
||||||
|
border-radius: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.el-table__header-wrapper) {
|
||||||
|
thead {
|
||||||
|
th{
|
||||||
|
div{
|
||||||
|
// font-family: "FZ-ZHUOHEI";
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 15px;
|
||||||
|
color: #da3703;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -116,7 +116,7 @@ export default {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-menu {
|
:deep(.el-menu) {
|
||||||
border-right: none;
|
border-right: none;
|
||||||
/* border-left: 5px solid #1d74b2; */
|
/* border-left: 5px solid #1d74b2; */
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
|
|
|
@ -11,8 +11,8 @@
|
||||||
<div class="header-wrapper">
|
<div class="header-wrapper">
|
||||||
<span class="company-name">CPIC</span>
|
<span class="company-name">CPIC</span>
|
||||||
<div class="version-wrapper">
|
<div class="version-wrapper">
|
||||||
<span>测试版</span>
|
<span>桌面霸屏后台管理</span>
|
||||||
<span>Build-202303251257</span>
|
<span>Build-20230915</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="buttons-wrapper">
|
<div class="buttons-wrapper">
|
||||||
<component
|
<component
|
||||||
|
@ -35,7 +35,7 @@ export default {
|
||||||
/**
|
/**
|
||||||
* 退出登录
|
* 退出登录
|
||||||
*/
|
*/
|
||||||
const Logout = ():void =>
|
const Logout = (): void =>
|
||||||
{
|
{
|
||||||
ElMessageBox.confirm(
|
ElMessageBox.confirm(
|
||||||
"是否要退出系统?",
|
"是否要退出系统?",
|
||||||
|
@ -46,11 +46,12 @@ export default {
|
||||||
type: "warning",
|
type: "warning",
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
.then(() =>
|
.then((): void =>
|
||||||
{
|
{
|
||||||
// debugger;
|
// debugger;
|
||||||
logout();
|
logout();
|
||||||
});
|
})
|
||||||
|
.catch((): void => {});
|
||||||
};
|
};
|
||||||
|
|
||||||
return { Logout, };
|
return { Logout, };
|
||||||
|
@ -93,6 +94,10 @@ export default {
|
||||||
font: {
|
font: {
|
||||||
size: 0.5rem;
|
size: 0.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
>*+* {
|
||||||
|
margin-top: 1px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.company-name {
|
.company-name {
|
||||||
|
|
|
@ -71,14 +71,23 @@ const routes = [
|
||||||
component: ()=> import( "../views/StaffManagement.vue" ),
|
component: ()=> import( "../views/StaffManagement.vue" ),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path:"/archievement_data",
|
path: "/data_management",
|
||||||
name:"ArchievementDataManagement",
|
name: "DataManagement",
|
||||||
meta: {
|
meta: {
|
||||||
title:"数据管理",
|
title: "数据管理",
|
||||||
icon: "document",
|
icon: "document",
|
||||||
},
|
},
|
||||||
component: ()=> import( "../views/DataManagement.vue" ),
|
component: ()=> import( "../views/DataManagement.vue" ),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path:"/reward_management",
|
||||||
|
name:"RewardManagement",
|
||||||
|
meta: {
|
||||||
|
title:"奖励管理",
|
||||||
|
icon: "document",
|
||||||
|
},
|
||||||
|
component: ()=> import( "../views/RewardManagement.vue" ),
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
|
@ -8,6 +8,11 @@
|
||||||
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { testNewCitizen } from "./identify.js";
|
// import { testRankingListRequest } from "./testRankingListRequest.js";
|
||||||
|
|
||||||
testNewCitizen();
|
// testRankingListRequest();
|
||||||
|
|
||||||
|
const arr: string[] = [];
|
||||||
|
|
||||||
|
console.log( "test" );
|
||||||
|
console.log( "检查instanceof:", arr instanceof String );
|
||||||
|
|
|
@ -14,13 +14,12 @@
|
||||||
"target": "ESNext",
|
"target": "ESNext",
|
||||||
"module": "ESNext",
|
"module": "ESNext",
|
||||||
// "module": "CommonJS",
|
// "module": "CommonJS",
|
||||||
// "moduleResolution": "node",
|
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
"strict": true,
|
"strict": true,
|
||||||
"jsx": "preserve",
|
"jsx": "preserve",
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"resolveJsonModule": true,
|
"resolveJsonModule": true,
|
||||||
"esModuleInterop": false,
|
"esModuleInterop": true,
|
||||||
"baseUrl": "./", // paths 路径解析起点
|
"baseUrl": "./", // paths 路径解析起点
|
||||||
"paths": { // 别名路径设置
|
"paths": { // 别名路径设置
|
||||||
"@/*": [
|
"@/*": [
|
||||||
|
@ -46,5 +45,8 @@
|
||||||
],
|
],
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"./node_modules",
|
"./node_modules",
|
||||||
]
|
],
|
||||||
|
"ts-node": {
|
||||||
|
"esm": true
|
||||||
|
},
|
||||||
}
|
}
|
|
@ -12,6 +12,6 @@ interface Department
|
||||||
{
|
{
|
||||||
departmentName: string;
|
departmentName: string;
|
||||||
departmentCode: string;
|
departmentCode: string;
|
||||||
};
|
}
|
||||||
|
|
||||||
export { type Department };
|
export { type Department };
|
||||||
|
|
|
@ -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 };
|
|
@ -16,6 +16,6 @@ interface TelSaler
|
||||||
teamName: string;
|
teamName: string;
|
||||||
departmentCode: string;
|
departmentCode: string;
|
||||||
departmentName: string;
|
departmentName: string;
|
||||||
};
|
}
|
||||||
|
|
||||||
export { type TelSaler };
|
export { type TelSaler };
|
||||||
|
|
|
@ -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();
|
|
@ -7,11 +7,44 @@
|
||||||
*
|
*
|
||||||
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
* 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: 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://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://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: 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",
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export { API_URL };
|
||||||
|
|
|
@ -44,7 +44,7 @@ function saveStaffInfo( stuff: StaffInfo ): void
|
||||||
const json = JSON.stringify( stuff );
|
const json = JSON.stringify( stuff );
|
||||||
|
|
||||||
window.localStorage.setItem( STUFF_ITEM, json );
|
window.localStorage.setItem( STUFF_ITEM, json );
|
||||||
};
|
}
|
||||||
|
|
||||||
function cleanStaffInfo(): void
|
function cleanStaffInfo(): void
|
||||||
{
|
{
|
||||||
|
@ -102,7 +102,8 @@ function clearCallerInfo(): void
|
||||||
window.localStorage.removeItem( CALLER_ITEM );
|
window.localStorage.removeItem( CALLER_ITEM );
|
||||||
}
|
}
|
||||||
|
|
||||||
export {
|
export
|
||||||
|
{
|
||||||
loadStaffInfo,
|
loadStaffInfo,
|
||||||
saveStaffInfo,
|
saveStaffInfo,
|
||||||
cleanStaffInfo,
|
cleanStaffInfo,
|
||||||
|
|
|
@ -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 };
|
|
@ -13,14 +13,21 @@ import axios, { type AxiosInstance } from "axios";
|
||||||
const service: AxiosInstance = axios.create(
|
const service: AxiosInstance = axios.create(
|
||||||
{
|
{
|
||||||
baseURL: "",
|
baseURL: "",
|
||||||
timeout: 5000,
|
timeout: 10000,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
// 请求拦截
|
// 请求拦截
|
||||||
service.interceptors.request.use(
|
service.interceptors.request.use(
|
||||||
|
/**
|
||||||
|
* 请求拦截器,在此加入token
|
||||||
|
* @param config 配置对象,在此加入token。
|
||||||
|
* @returns 返回修改完的配置对象
|
||||||
|
*/
|
||||||
( config ) =>
|
( config ) =>
|
||||||
{
|
{
|
||||||
|
config.headers.token = "123";
|
||||||
|
|
||||||
return config;
|
return config;
|
||||||
},
|
},
|
||||||
async ( error ) =>
|
async ( error ) =>
|
||||||
|
|
|
@ -3,16 +3,17 @@
|
||||||
* @Date: 2023-03-17 15:17:44
|
* @Date: 2023-03-17 15:17:44
|
||||||
* @LastEditors: Kane
|
* @LastEditors: Kane
|
||||||
* @FilePath: /task_schedule/src/utils/archievement.ts
|
* @FilePath: /task_schedule/src/utils/archievement.ts
|
||||||
* @Description: 请求业绩数据
|
* @Description: 请求业绩数据相关的方法。
|
||||||
*
|
*
|
||||||
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||||
*/
|
*/
|
||||||
import { service as instance } from "./api/request.js";
|
import { service as instance } from "./api/request.js";
|
||||||
import { API_URL } from "./api/config.js";
|
import { API_URL } from "./api/config.js";
|
||||||
import { type Department } from "@/types/cpicxim/Department.js";
|
import { type Department } from "../types/cpicxim/Department.js";
|
||||||
// import { type AxiosResponse } from "axios";
|
import { type TelSaler } from "../types/cpicxim/TelSaler.js";
|
||||||
|
import { type AxiosResponse } from "axios";
|
||||||
|
|
||||||
interface Archievement
|
interface DepartmentArchievement // 定义业绩对象的结构
|
||||||
{
|
{
|
||||||
success: boolean;
|
success: boolean;
|
||||||
message: string;
|
message: string;
|
||||||
|
@ -25,48 +26,223 @@ interface Archievement
|
||||||
backward_list: string[];
|
backward_list: string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface CallerArchievement // 坐席业绩对象
|
||||||
|
{
|
||||||
|
success: boolean;
|
||||||
|
message: string;
|
||||||
|
total_archievement: 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( departmentInfo: Department, 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({
|
instance.request({
|
||||||
method: "post",
|
method: "post",
|
||||||
url: API_URL.URL_DEPARTMENT_ARCHIEVEMENT,
|
url: API_URL.URL_DEPARTMENT_ARCHIEVEMENT,
|
||||||
data: departmentInfo,
|
data: departmentInfo,
|
||||||
})
|
})
|
||||||
|
// 请求结束,将请求的结果写入业绩对象,然后调用功能渲染函数。
|
||||||
.then(( response ) =>
|
.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 ?? {};
|
const data = response.data ?? {};
|
||||||
|
|
||||||
archievement.success = data.success ?? false;
|
archievement.success = data.success ?? false;
|
||||||
archievement.message = data.message ?? "";
|
archievement.message = data.message ?? "服务器没有返回调用结果消息,请检查日志!";
|
||||||
archievement.mensual_archievement_list = data.mensual_archievement_list ?? [];
|
archievement.total_archievement = data.total_archievement;
|
||||||
|
archievement.mensual_archievement_list = [];
|
||||||
archievement.insurance_renewal_rate = data.insurance_renewal_rate ?? "0.0";
|
archievement.insurance_renewal_rate = data.insurance_renewal_rate ?? "0.0";
|
||||||
archievement.attaching_rate = data.attaching_rate ?? "0.0";
|
archievement.attaching_rate = data.attaching_rate ?? "0.0";
|
||||||
archievement.leading_reward_gainers = data.leading_reward_gainers ?? [];
|
archievement.leading_reward_gainers = data.leading_reward_gainers ?? [];
|
||||||
archievement.advance_reward_gainers = data.advance_reward_gainers ?? [];
|
archievement.advance_reward_gainers = data.advance_reward_gainers ?? [];
|
||||||
archievement.backward_list = data.backward_list ?? [];
|
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 ) =>
|
.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,
|
||||||
|
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 ?? {};
|
||||||
|
|
||||||
|
callArchievement.success = data.success ?? false;
|
||||||
|
callArchievement.message = data.message ?? "服务器没有返回调用结果消息,请检查日志!";
|
||||||
|
callArchievement.total_archievement = data.total_archievement ?? 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
|
||||||
|
};
|
||||||
|
|
|
@ -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
|
||||||
|
};
|
|
@ -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
|
||||||
|
};
|
|
@ -1,26 +1,40 @@
|
||||||
<!--
|
<!--
|
||||||
* @Author: Kane
|
* @Author: Kane
|
||||||
* @Date: 2023-03-23 16:05:08
|
* @Date: 2023-09-25 09:48:25
|
||||||
* @LastEditors: Kane
|
* @LastEditors: Kane
|
||||||
* @FilePath: /task_schedule/src/views/DataManagemant.vue
|
* @FilePath: /task_schedule/src/views/DataManagement.vue
|
||||||
* @Description:
|
* @Description: 数据管理view
|
||||||
*
|
*
|
||||||
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div class="data_management_wrapper">
|
||||||
数据管理
|
数据管理
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
import { ref, reactive } from "vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "DataManagement",
|
name: "DataManagement",
|
||||||
setup()
|
setup()
|
||||||
{
|
{
|
||||||
return {};
|
const ui = reactive({
|
||||||
|
showUI: false,
|
||||||
|
});
|
||||||
|
|
||||||
|
return { ui, };
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss">
|
||||||
|
.data_management_wrapper {
|
||||||
|
margin: 10px;
|
||||||
|
|
||||||
|
min-width: 800px;
|
||||||
|
|
||||||
|
>*+* {
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -26,7 +26,7 @@ export default {
|
||||||
{
|
{
|
||||||
height: 2000px;
|
height: 2000px;
|
||||||
width: 2000px;
|
width: 2000px;
|
||||||
background-color: aquamarine;
|
// background-color: aquamarine;
|
||||||
padding: 0px;
|
padding: 0px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
<div class="center-wrapper">
|
<div class="center-wrapper">
|
||||||
<span class="slogan">对标先进 比学赶超</span>
|
<span class="slogan">对标先进 比学赶超</span>
|
||||||
<div class="total-archievement-wrapper">
|
<div class="total-archievement-wrapper">
|
||||||
<span>总业绩</span>
|
<span>我的车险业绩</span>
|
||||||
<span>{{ getTotalArchievement }}</span>
|
<span>{{ getTotalArchievement }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="archievement-wrapper">
|
<div class="archievement-wrapper">
|
||||||
|
@ -31,12 +31,8 @@
|
||||||
:percentage="ui.attaching_rate"
|
:percentage="ui.attaching_rate"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div class="total-archievement-charts-wrapper">
|
||||||
class="total-archievement-charts-wrapper"
|
<ArchievementChart :chart-data="ui.chartData" />
|
||||||
>
|
|
||||||
<ArchievementChart
|
|
||||||
:chart-data="ui.chartData"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="reward-wrapper">
|
<div class="reward-wrapper">
|
||||||
|
@ -52,8 +48,40 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="right-wrapper">
|
<div class="right-wrapper">
|
||||||
<RankingListComponent />
|
<CallerArchievementComponent
|
||||||
<RankingListComponent />
|
:caller-name="callerInfo.telSalerName"
|
||||||
|
:this-month-premium="ui.callerPersentMonthPremium"
|
||||||
|
:attaching-rate="ui.callerAttachingRate"
|
||||||
|
:renewal-rate="ui.callerRenewalRate"
|
||||||
|
/>
|
||||||
|
<div class="carousel-item">
|
||||||
|
<el-carousel
|
||||||
|
arrow="never"
|
||||||
|
indicator-position="none"
|
||||||
|
:interval="4000"
|
||||||
|
>
|
||||||
|
<el-carousel-item :key="1">
|
||||||
|
<RankingListComponent :ranking-list="ui.attachingRankingList" />
|
||||||
|
</el-carousel-item>
|
||||||
|
<el-carousel-item :key="2">
|
||||||
|
<RankingListComponent :ranking-list="ui.renewalRankingList" />
|
||||||
|
</el-carousel-item>
|
||||||
|
</el-carousel>
|
||||||
|
</div>
|
||||||
|
<div class="carousel-item">
|
||||||
|
<el-carousel
|
||||||
|
arrow="never"
|
||||||
|
indicator-position="none"
|
||||||
|
:interval="4000"
|
||||||
|
>
|
||||||
|
<el-carousel-item :key="1">
|
||||||
|
<RankingListComponent :ranking-list="ui.attachingRankingList" />
|
||||||
|
</el-carousel-item>
|
||||||
|
<el-carousel-item :key="2">
|
||||||
|
<RankingListComponent :ranking-list="ui.renewalRankingList" />
|
||||||
|
</el-carousel-item>
|
||||||
|
</el-carousel>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -63,16 +91,48 @@ import { computed, reactive, onBeforeMount, onUnmounted } from "vue";
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
import { getCallerInfo } from "@/utils/api/localStorage.js";
|
import { getCallerInfo } from "@/utils/api/localStorage.js";
|
||||||
import { ElMessage } from "element-plus";
|
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 { type Department } from "@/types/cpicxim/Department";
|
||||||
import ArchievementChart from "@/components/ArchievementChartComponent.vue";
|
import ArchievementChart from "@/components/ArchievementChartComponent.vue";
|
||||||
import ArchievementCompleteRateComponent from "@/components/ArchievementCompleteRateComponent.vue";
|
import ArchievementCompleteRateComponent from "@/components/ArchievementCompleteRateComponent.vue";
|
||||||
import HonorListComponent from "@/components/HonorListComponent.vue";
|
import HonorListComponent from "@/components/HonorListComponent.vue";
|
||||||
import DishonorListComponent from "@/components/DishonorListComponent.vue";
|
import DishonorListComponent from "@/components/DishonorListComponent.vue";
|
||||||
import RankingListComponent from "@/components/RankingListComponent.vue";
|
import RankingListComponent from "@/components/RankingListComponent.vue";
|
||||||
|
import CallerArchievementComponent from "@/components/CallerArchievementComponent.vue";
|
||||||
import { logout } from "@/utils/account.js";
|
import { logout } from "@/utils/account.js";
|
||||||
import { type TelSaler } from "@/types/cpicxim/TelSaler";
|
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 {
|
export default {
|
||||||
name: "DesktopArchievement",
|
name: "DesktopArchievement",
|
||||||
components: {
|
components: {
|
||||||
|
@ -81,14 +141,32 @@ export default {
|
||||||
HonorListComponent,
|
HonorListComponent,
|
||||||
DishonorListComponent,
|
DishonorListComponent,
|
||||||
RankingListComponent,
|
RankingListComponent,
|
||||||
|
CallerArchievementComponent,
|
||||||
},
|
},
|
||||||
setup()
|
setup()
|
||||||
{
|
{
|
||||||
const monthIndex = new Date();
|
const monthIndex = new Date();
|
||||||
const numInChinese = ["一", "二", "三", "四", "五", "六", "七", "八", "九", "十", "十一", "十二",];
|
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 router = useRouter();
|
||||||
const callerInfo: TelSaler = getCallerInfo();
|
const callerInfo: TelSaler = getCallerInfo();
|
||||||
const ui = reactive({
|
const ui: ui = reactive({
|
||||||
currentMonth: numInChinese[monthIndex.getMonth() - 1],
|
currentMonth: numInChinese[monthIndex.getMonth() - 1],
|
||||||
chartData: [0,], // 业绩表
|
chartData: [0,], // 业绩表
|
||||||
totalArchievement: 0, // 总业绩
|
totalArchievement: 0, // 总业绩
|
||||||
|
@ -98,29 +176,48 @@ export default {
|
||||||
advance_reward_gainers: ["",], // 飞跃奖
|
advance_reward_gainers: ["",], // 飞跃奖
|
||||||
dishonorPersons: ["",],
|
dishonorPersons: ["",],
|
||||||
showUI: true, // 用来刷新页面的开关
|
showUI: true, // 用来刷新页面的开关
|
||||||
|
attachingRankingList: [], // 坐席车非渗透率榜单
|
||||||
|
renewalRankingList: [], // 坐席续保率榜单
|
||||||
|
callerAttachingRate: "0.0",
|
||||||
|
callerRenewalRate: "0.0",
|
||||||
|
callerPersentMonthPremium: 0,
|
||||||
});
|
});
|
||||||
const timerHandler = 0;
|
let timerHandler = 0;
|
||||||
|
|
||||||
const getTotalArchievement = computed(() =>
|
const getTotalArchievement = computed((): string =>
|
||||||
{
|
{
|
||||||
const cnyFormat = new Intl.NumberFormat( "zh-cn",
|
const cnyFormat = new Intl.NumberFormat( "zh-cn", {
|
||||||
{
|
style: "currency",
|
||||||
style: "currency",
|
currency: "CNY",
|
||||||
currency: "CNY",
|
minimumFractionDigits: 0,
|
||||||
minimumFractionDigits: 0,
|
});
|
||||||
});
|
|
||||||
const archievement = cnyFormat.format( ui.totalArchievement );
|
const archievement = cnyFormat.format( ui.totalArchievement );
|
||||||
|
|
||||||
return archievement;
|
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.attaching_rate = data.attaching_rate;
|
||||||
ui.insurance_renewal_rate = data.insurance_renewal_rate;
|
ui.insurance_renewal_rate = data.insurance_renewal_rate;
|
||||||
ui.leading_reward_gainers = data.leading_reward_gainers;
|
ui.leading_reward_gainers = data.leading_reward_gainers;
|
||||||
|
@ -131,11 +228,65 @@ export default {
|
||||||
// 先不显示界面,往队列中加入显示队列的回调,让vue刷新组件。
|
// 先不显示界面,往队列中加入显示队列的回调,让vue刷新组件。
|
||||||
ui.showUI = false;
|
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.mensual_archievement_list[thisMonth];
|
||||||
|
|
||||||
|
// console.log( "业绩清单", ui.chartData );
|
||||||
|
// console.log( "当月", data.mensual_archievement_list );
|
||||||
|
|
||||||
|
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" );
|
console.log( "111" );
|
||||||
logout();
|
logout();
|
||||||
|
@ -152,35 +303,61 @@ export default {
|
||||||
center: true,
|
center: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
router.push( "/login" );
|
router.push( "/login" ).then(() => {}).catch(() => {});
|
||||||
}
|
}
|
||||||
|
|
||||||
const refresh = () =>
|
/**
|
||||||
|
* 用于定时对页面进行刷新,其中会请求最新的业绩数据。
|
||||||
|
*/
|
||||||
|
const refresh = (): void =>
|
||||||
{
|
{
|
||||||
const deparmentInfo:Department =
|
const deparmentInfo: Department = {
|
||||||
{
|
|
||||||
departmentCode: callerInfo.departmentCode,
|
departmentCode: callerInfo.departmentCode,
|
||||||
departmentName: callerInfo.departmentName,
|
departmentName: callerInfo.departmentName,
|
||||||
};
|
};
|
||||||
|
|
||||||
queryDepartmentArchievement( deparmentInfo, renderData );
|
const rankinglistRequest: RankingListRequest = {
|
||||||
|
departmentCode: callerInfo.departmentCode,
|
||||||
|
year: thisYearString,
|
||||||
|
month: thisMonthString,
|
||||||
|
};
|
||||||
|
|
||||||
|
console.log( "refresh", rankinglistRequest );
|
||||||
|
|
||||||
|
queryDepartmentArchievement( deparmentInfo, applyDepartmentArchievementData );
|
||||||
|
queryCallerArchievement( callerInfo, applyCallerArchievementData );
|
||||||
|
requestRankingList( rankinglistRequest, applyRankingListData );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 加载前
|
||||||
|
*/
|
||||||
onBeforeMount(() =>
|
onBeforeMount(() =>
|
||||||
{
|
{
|
||||||
// 设置每10分钟刷新一次
|
// 设置每10分钟刷新一次
|
||||||
// timerHandler = setInterval( refresh, 5000 );
|
timerHandler = setInterval( refresh, 600 * 1000 );
|
||||||
|
|
||||||
refresh();
|
refresh();
|
||||||
});
|
});
|
||||||
|
|
||||||
onUnmounted(():void =>
|
/**
|
||||||
|
* 页面卸载前
|
||||||
|
*/
|
||||||
|
onUnmounted((): void =>
|
||||||
{
|
{
|
||||||
// 退出页面前关掉定时器
|
// 退出页面前关掉定时器
|
||||||
clearInterval( timerHandler );
|
clearInterval( timerHandler );
|
||||||
});
|
});
|
||||||
|
|
||||||
return { ui, callerInfo, timerHandler, getTotalArchievement, renderData, refresh, logoutDesktopArchievement, };
|
return {
|
||||||
|
ui,
|
||||||
|
callerInfo,
|
||||||
|
timerHandler,
|
||||||
|
getTotalArchievement,
|
||||||
|
renderData: applyDepartmentArchievementData,
|
||||||
|
refresh,
|
||||||
|
logoutDesktopArchievement,
|
||||||
|
};
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -310,9 +487,36 @@ export default {
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
|
|
||||||
>*+* {
|
// >*+* {
|
||||||
margin-top: 15px;
|
// 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>
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
@ -323,7 +527,7 @@ body {
|
||||||
$color-bg-03,
|
$color-bg-03,
|
||||||
$color-bg-04,
|
$color-bg-04,
|
||||||
$color-bg-05,
|
$color-bg-05,
|
||||||
$color-bg-05);
|
$color-bg-05 );
|
||||||
}
|
}
|
||||||
|
|
||||||
div {
|
div {
|
||||||
|
|
|
@ -71,7 +71,7 @@ import { saveStaffInfo, getUserType, saveUserType, getCallerInfo, saveCallerInfo
|
||||||
import { login, loginCaller, type LoginCallerInfo, type LoginCallerResult } from "@/utils/account";
|
import { login, loginCaller, type LoginCallerInfo, type LoginCallerResult } from "@/utils/account";
|
||||||
import { ElMessage } from "element-plus";
|
import { ElMessage } from "element-plus";
|
||||||
import { StaffInfo } from "@/types/cpicxim/StaffInfo";
|
import { StaffInfo } from "@/types/cpicxim/StaffInfo";
|
||||||
import { TelSaler } from "@/types/cpicxim/TelSaler";
|
import { type TelSaler } from "@/types/cpicxim/TelSaler";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "LoginPage",
|
name: "LoginPage",
|
||||||
|
@ -95,7 +95,7 @@ export default {
|
||||||
/**
|
/**
|
||||||
* 保存p13账号
|
* 保存p13账号
|
||||||
*/
|
*/
|
||||||
const savedP13uid = () =>
|
const savedP13uid = (): void =>
|
||||||
{
|
{
|
||||||
window.localStorage.setItem( "stuff_account", ui.account );
|
window.localStorage.setItem( "stuff_account", ui.account );
|
||||||
};
|
};
|
||||||
|
@ -103,7 +103,7 @@ export default {
|
||||||
/**
|
/**
|
||||||
* 登录函数,根据ui.currentMenu判断登录的是坐席还是员工。
|
* 登录函数,根据ui.currentMenu判断登录的是坐席还是员工。
|
||||||
*/
|
*/
|
||||||
const onLogin = () =>
|
const onLogin = (): void =>
|
||||||
{
|
{
|
||||||
// 保存用户类型
|
// 保存用户类型
|
||||||
saveUserType( ui.currentMenu );
|
saveUserType( ui.currentMenu );
|
||||||
|
@ -145,7 +145,7 @@ export default {
|
||||||
saveStaffInfo( staffInfo );
|
saveStaffInfo( staffInfo );
|
||||||
|
|
||||||
// 跳转路由
|
// 跳转路由
|
||||||
router.push( "/desktop" );
|
router.push( "/desktop" ).then(() => {}).catch(() => {});
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -177,12 +177,12 @@ export default {
|
||||||
// 调用接口成功
|
// 调用接口成功
|
||||||
.then(( response ) =>
|
.then(( response ) =>
|
||||||
{
|
{
|
||||||
const data:LoginCallerResult = response.data ?? { success: false, };
|
const data: LoginCallerResult = response.data ?? { success: false, };
|
||||||
|
|
||||||
// debugger;
|
// debugger;
|
||||||
|
|
||||||
// 查看標志位
|
// 查看標志位
|
||||||
if ( data.success === true )
|
if ( data.success )
|
||||||
{
|
{
|
||||||
// 查询成功,显示一个提示,保存工号,并跳转路由
|
// 查询成功,显示一个提示,保存工号,并跳转路由
|
||||||
ElMessage({
|
ElMessage({
|
||||||
|
@ -190,7 +190,7 @@ export default {
|
||||||
type: "success",
|
type: "success",
|
||||||
});
|
});
|
||||||
|
|
||||||
const telsaler:TelSaler = {
|
const telsaler: TelSaler = {
|
||||||
telSalerCode: data.tel_saler_code,
|
telSalerCode: data.tel_saler_code,
|
||||||
telSalerName: data.tel_saler_name,
|
telSalerName: data.tel_saler_name,
|
||||||
teamCode: data.team_code,
|
teamCode: data.team_code,
|
||||||
|
@ -201,7 +201,7 @@ export default {
|
||||||
|
|
||||||
saveCallerInfo( telsaler );
|
saveCallerInfo( telsaler );
|
||||||
|
|
||||||
router.push( "/desktop_archievement" );
|
router.push( "/desktop_archievement" ).then(() => {}).catch(() => {});
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -249,7 +249,7 @@ export default {
|
||||||
});
|
});
|
||||||
|
|
||||||
// 跳转路由
|
// 跳转路由
|
||||||
router.push( "/desktop_archievement" );
|
router.push( "/desktop_archievement" ).then(() => {}).catch(() => {});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ( staffType === "cpicxim_staff" )
|
else if ( staffType === "cpicxim_staff" )
|
||||||
|
@ -258,7 +258,7 @@ export default {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const onToggleMenu = ( type: string ) =>
|
const onToggleMenu = ( type: string ): void =>
|
||||||
{
|
{
|
||||||
ui.currentMenu = type;
|
ui.currentMenu = type;
|
||||||
};
|
};
|
||||||
|
|
|
@ -0,0 +1,391 @@
|
||||||
|
<!--
|
||||||
|
* @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
|
||||||
|
{
|
||||||
|
ElMessage({
|
||||||
|
message: response.message,
|
||||||
|
type: "error",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
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>
|
|
@ -2,25 +2,191 @@
|
||||||
* @Author: Kane
|
* @Author: Kane
|
||||||
* @Date: 2023-03-23 16:05:08
|
* @Date: 2023-03-23 16:05:08
|
||||||
* @LastEditors: Kane
|
* @LastEditors: Kane
|
||||||
* @FilePath: /task_schedule/src/views/DataManagemant.vue
|
* @FilePath: /task_schedule/src/views/StaffManagement.vue
|
||||||
* @Description:
|
* @Description:
|
||||||
*
|
*
|
||||||
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<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>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
import { reactive, computed } from "vue";
|
||||||
export default {
|
export default {
|
||||||
name: "StaffManagement",
|
name: "StaffManagement",
|
||||||
setup()
|
setup()
|
||||||
{
|
{
|
||||||
return {};
|
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>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.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>
|
</style>
|
||||||
|
|
|
@ -0,0 +1,249 @@
|
||||||
|
<!--
|
||||||
|
* @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 RewardGainerResponse,
|
||||||
|
type DeleteRewardTelsalerRequest,
|
||||||
|
type DeleteRewardTelsalerResponse,
|
||||||
|
type AddRewardTelsalerRequest,
|
||||||
|
type AddRewardTelsalerResponse,
|
||||||
|
type UpdateRewardTelsalerRequest,
|
||||||
|
type UpdateRewardTelsalerResponse,
|
||||||
|
requestRewardPorjectsList,
|
||||||
|
addRewardTelsaler,
|
||||||
|
updateTelsalerReward,
|
||||||
|
deleteRewardTelsaler
|
||||||
|
} 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 => {});
|
||||||
|
|
||||||
|
console.log( "请求奖励项目失败:", error );
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log( "请求奖励项目结果", response.rewardList );
|
||||||
|
|
||||||
|
ui.rewardProjectList = response.rewardList;
|
||||||
|
};
|
||||||
|
|
||||||
|
const refresh = (): void =>
|
||||||
|
{
|
||||||
|
requestRewardPorjectsList( applyRewardProjectsData );
|
||||||
|
};
|
||||||
|
|
||||||
|
onBeforeMount((): void =>
|
||||||
|
{
|
||||||
|
ui.selectedRewardProjectCode = props.selectedRewardProjectCode;
|
||||||
|
ui.selectedRewardTelsalerName = props.selectedTelsalerName;
|
||||||
|
ui.selectedRecID = props.selectedRecId;
|
||||||
|
|
||||||
|
refresh();
|
||||||
|
|
||||||
|
console.log( props.selectedRewardProjectCode );
|
||||||
|
});
|
||||||
|
|
||||||
|
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>
|
|
@ -19,6 +19,7 @@
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"resolveJsonModule": true,
|
"resolveJsonModule": true,
|
||||||
"esModuleInterop": false,
|
"esModuleInterop": false,
|
||||||
|
"isolatedModules": true,
|
||||||
"baseUrl": "./", // paths 路径解析起点
|
"baseUrl": "./", // paths 路径解析起点
|
||||||
"paths": { // 别名路径设置
|
"paths": { // 别名路径设置
|
||||||
"@/*": [
|
"@/*": [
|
||||||
|
@ -34,6 +35,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
|
"src/**/*",
|
||||||
"src/**/*.ts",
|
"src/**/*.ts",
|
||||||
"src/**/*.tsx",
|
"src/**/*.tsx",
|
||||||
"src/**/*.vue",
|
"src/**/*.vue",
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* @Author: Kane
|
* @Author: Kane
|
||||||
* @Date: 2023-02-15 09:25:52
|
* @Date: 2023-02-15 09:25:52
|
||||||
* @LastEditors: Kane
|
* @LastEditors: Kane
|
||||||
* @LastEditTime: 2023-03-30 21:09:30
|
* @LastEditTime: 2023-06-25 09:51:13
|
||||||
* @FilePath: /task_schedule/vite.config.js
|
* @FilePath: /task_schedule/vite.config.js
|
||||||
* @Description:
|
* @Description:
|
||||||
*
|
*
|
||||||
|
@ -18,6 +18,7 @@ export default defineConfig(( command, mode ) =>
|
||||||
const env = loadEnv( mode, process.cwd(), "" );
|
const env = loadEnv( mode, process.cwd(), "" );
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
server:{ host: "localhost", port: 5173, },
|
||||||
plugins: [vue(),],
|
plugins: [vue(),],
|
||||||
base: "./",
|
base: "./",
|
||||||
resolve: {
|
resolve: {
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
"java.configuration.updateBuildConfiguration": "automatic",
|
"java.configuration.updateBuildConfiguration": "automatic",
|
||||||
"java.compile.nullAnalysis.mode": "automatic",
|
"java.compile.nullAnalysis.mode": "automatic",
|
||||||
"vue.codeActions.enabled": false
|
"vue.codeActions.enabled": false,
|
||||||
|
"java.debug.settings.onBuildFailureProceed": true
|
||||||
}
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"name": "desktop_archievement_backend",
|
||||||
|
"lockfileVersion": 3,
|
||||||
|
"requires": true,
|
||||||
|
"packages": {}
|
||||||
|
}
|
|
@ -14,7 +14,7 @@
|
||||||
<maven.compiler.source>17</maven.compiler.source>
|
<maven.compiler.source>17</maven.compiler.source>
|
||||||
<maven.compiler.target>17</maven.compiler.target>
|
<maven.compiler.target>17</maven.compiler.target>
|
||||||
<spring.version>5.3.24</spring.version>
|
<spring.version>5.3.24</spring.version>
|
||||||
<!-- <spring.version>6.0.8</spring.version> -->
|
<!-- <spring.version>6.0.11</spring.version> -->
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
@ -87,19 +87,60 @@
|
||||||
<version>2.13.4</version>
|
<version>2.13.4</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<!-- <dependency>
|
||||||
<groupId>com.oracle</groupId>
|
<groupId>com.oracle</groupId>
|
||||||
<artifactId>ojdbc8</artifactId>
|
<artifactId>ojdbc8</artifactId>
|
||||||
<version>19.3.0.0.0</version>
|
<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>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.mybatis</groupId>
|
||||||
|
<artifactId>mybatis</artifactId>
|
||||||
|
<version>3.5.13</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<build>
|
<build>
|
||||||
<finalName>desktop_archievement_backend</finalName>
|
<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>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-war-plugin</artifactId>
|
<artifactId>maven-war-plugin</artifactId>
|
||||||
<version>3.2.2</version>
|
<version>3.3.2</version>
|
||||||
|
<configuration></configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
|
|
@ -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 );
|
||||||
|
}
|
|
@ -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 );
|
||||||
|
}
|
|
@ -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 );
|
||||||
|
}
|
|
@ -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;
|
||||||
|
}
|
|
@ -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;
|
||||||
|
}
|
|
@ -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;
|
||||||
|
}
|
|
@ -0,0 +1,74 @@
|
||||||
|
/*
|
||||||
|
* @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.SqlSession;
|
||||||
|
import org.apache.ibatis.session.SqlSessionFactory;
|
||||||
|
import org.apache.ibatis.session.SqlSessionFactoryBuilder;
|
||||||
|
|
||||||
|
public class MybatisUtils
|
||||||
|
{
|
||||||
|
private static HashMap<String, SqlSession> SessionMap = new HashMap<>();
|
||||||
|
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 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;
|
||||||
|
}
|
||||||
|
}
|
|
@ -9,3 +9,199 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.cpic.xim.utils.archievement;
|
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;
|
||||||
|
/**
|
||||||
|
* 构造函数
|
||||||
|
* @param callerCode
|
||||||
|
* @param totalArchievement
|
||||||
|
* @param mensualArchievementList
|
||||||
|
* @param insuranceRenewalRate
|
||||||
|
* @param attachingRate
|
||||||
|
*/
|
||||||
|
public CallerArchievement( String callerCode, long totalArchievement,
|
||||||
|
ArrayList<MensualArchievementItem> mensualArchievementList, String insuranceRenewalRate,
|
||||||
|
String attachingRate)
|
||||||
|
{
|
||||||
|
this.callerCode = callerCode;
|
||||||
|
this.totalArchievement = totalArchievement;
|
||||||
|
this.mensualArchievementList = mensualArchievementList;
|
||||||
|
this.insuranceRenewalRate = insuranceRenewalRate;
|
||||||
|
this.attachingRate = attachingRate;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 静态代码块
|
||||||
|
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 CallerArchievement()
|
||||||
|
{
|
||||||
|
this.totalArchievement = 0;
|
||||||
|
this.mensualArchievementList = null;
|
||||||
|
this.insuranceRenewalRate = "";
|
||||||
|
this.attachingRate = "";
|
||||||
|
this.callerCode = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
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 );
|
||||||
|
}
|
||||||
|
|
||||||
|
// 车非融合
|
||||||
|
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);
|
||||||
|
// 数据库接收的每月业绩,要检查是否有缺漏
|
||||||
|
mensual = (ArrayList<MensualArchievementItem>) params.get( "a_mensual_cur" );
|
||||||
|
|
||||||
|
archievement = new CallerArchievement( callerCode, totalArchievement, mensual, renewalRate,
|
||||||
|
attachingRate );
|
||||||
|
|
||||||
|
return archievement;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Logger getLogger()
|
||||||
|
{
|
||||||
|
return logger;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setLogger( Logger logger )
|
||||||
|
{
|
||||||
|
CallerArchievement.logger = logger;
|
||||||
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonProperty( "caller_code" )
|
||||||
|
private String callerCode;
|
||||||
|
|
||||||
|
@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; // 车非渗透率
|
||||||
|
}
|
||||||
|
|
|
@ -9,22 +9,21 @@
|
||||||
*/
|
*/
|
||||||
package com.cpic.xim.utils.archievement;
|
package com.cpic.xim.utils.archievement;
|
||||||
|
|
||||||
import java.sql.Connection;
|
import java.io.IOException;
|
||||||
import java.sql.DriverManager;
|
import java.util.ArrayList;
|
||||||
import java.sql.ResultSet;
|
import java.util.HashMap;
|
||||||
import java.sql.SQLException;
|
import org.apache.ibatis.session.SqlSession;
|
||||||
import java.util.Vector;
|
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;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
import oracle.jdbc.OracleCallableStatement;
|
|
||||||
import oracle.jdbc.OracleTypes;
|
|
||||||
|
|
||||||
public class DepartmentArchievement
|
public class DepartmentArchievement
|
||||||
{
|
{
|
||||||
|
// log4j2
|
||||||
// 以后要改
|
private static Logger logger = LoggerFactory.getLogger(DepartmentArchievement.class);
|
||||||
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";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 默认的构造函数,提供给json使用。
|
* 默认的构造函数,提供给json使用。
|
||||||
|
@ -32,21 +31,24 @@ public class DepartmentArchievement
|
||||||
public DepartmentArchievement()
|
public DepartmentArchievement()
|
||||||
{
|
{
|
||||||
this.totalArchievement = 0;
|
this.totalArchievement = 0;
|
||||||
this.mensualArchievementList = new Vector<>();
|
this.mensualArchievementList = null;
|
||||||
this.insuranceRenewalRate = "";
|
this.insuranceRenewalRate = "";
|
||||||
this.attachingRate = "";
|
this.attachingRate = "";
|
||||||
|
this.departmentCode = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief 构造函数,提供所有成员对象的值。
|
* @brief 构造函数,提供所有成员对象的值。
|
||||||
* @param totalArchievement
|
* @param departmentCode 部门代码
|
||||||
* @param mensualArchievementList
|
* @param totalArchievement 总业绩
|
||||||
* @param insuranceRenewalRate
|
* @param mensualArchievementList 每月业绩表
|
||||||
* @param attachingRate
|
* @param insuranceRenewalRate 续保率
|
||||||
|
* @param attachingRate 车非渗透率
|
||||||
*/
|
*/
|
||||||
public DepartmentArchievement( long totalArchievement, Vector<Long> mensualArchievementList,
|
public DepartmentArchievement( String departmentCode, long totalArchievement,
|
||||||
String insuranceRenewalRate, String attachingRate)
|
ArrayList<MensualArchievementItem> mensualArchievementList, String insuranceRenewalRate, String attachingRate)
|
||||||
{
|
{
|
||||||
|
this.departmentCode = departmentCode;
|
||||||
this.totalArchievement = totalArchievement;
|
this.totalArchievement = totalArchievement;
|
||||||
this.mensualArchievementList = mensualArchievementList;
|
this.mensualArchievementList = mensualArchievementList;
|
||||||
this.insuranceRenewalRate = insuranceRenewalRate;
|
this.insuranceRenewalRate = insuranceRenewalRate;
|
||||||
|
@ -57,86 +59,45 @@ public class DepartmentArchievement
|
||||||
* 静态方法,用于根据部门代码,查询部门业绩,生成一个 DepartmentArchievement 对象。
|
* 静态方法,用于根据部门代码,查询部门业绩,生成一个 DepartmentArchievement 对象。
|
||||||
* @param departmentCode 部门代码
|
* @param departmentCode 部门代码
|
||||||
* @return
|
* @return
|
||||||
* @throws SQLException
|
* @throws IOException
|
||||||
* @throws ClassNotFoundException
|
|
||||||
*/
|
*/
|
||||||
public static DepartmentArchievement queryDepartmentArchievement( String departmentCode )
|
@SuppressWarnings("unchecked")
|
||||||
throws SQLException, ClassNotFoundException
|
public static DepartmentArchievement getDepartmentArchievement( String departmentCode )
|
||||||
|
throws IOException
|
||||||
{
|
{
|
||||||
Connection connection = null;
|
|
||||||
java.sql.CallableStatement statement = null;
|
|
||||||
ResultSet menusual_cursor = null;
|
|
||||||
|
|
||||||
DepartmentArchievement archievement = null;
|
DepartmentArchievement archievement = null;
|
||||||
|
|
||||||
String sql = "{call telsale_archievement_pkg.department_archievement(?,?,?,?,?)}";
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Class.forName( "oracle.jdbc.driver.OracleDriver" );
|
SqlSession session = MybatisUtils.getSqlSession();
|
||||||
connection = DriverManager.getConnection( jdbcURL, userName, password );
|
ArchievementMapper mapper = session.getMapper(ArchievementMapper.class);
|
||||||
statement = connection.prepareCall( sql );
|
|
||||||
|
|
||||||
statement.setString( 1, departmentCode );
|
// 参数集合
|
||||||
statement.registerOutParameter( 2, java.sql.Types.VARCHAR );
|
HashMap<String, Object> params = new HashMap<>(5);
|
||||||
statement.registerOutParameter( 3, java.sql.Types.VARCHAR );
|
|
||||||
statement.registerOutParameter( 4, java.sql.Types.INTEGER );
|
|
||||||
statement.registerOutParameter( 5, OracleTypes.CURSOR );
|
|
||||||
|
|
||||||
statement.execute();
|
params.put("a_department_code", departmentCode);
|
||||||
|
|
||||||
Vector<Long> menusual_list = new Vector<Long>();
|
mapper.getDepartmentArchievement(params);
|
||||||
String attach_rate = statement.getString( 2 );
|
|
||||||
String renewal_rate = statement.getString( 3 );
|
|
||||||
long totalArchievement = statement.getInt( 4 );
|
|
||||||
|
|
||||||
menusual_cursor = ((OracleCallableStatement) statement).getCursor( 5 );
|
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");
|
||||||
|
|
||||||
while ( menusual_cursor.next())
|
archievement = new DepartmentArchievement(
|
||||||
{
|
departmentCode,
|
||||||
menusual_list.add( menusual_cursor.getLong( 2 ) );
|
totalArchievement.intValue(),
|
||||||
}
|
mensual,
|
||||||
|
renewalRate,
|
||||||
archievement = new DepartmentArchievement( totalArchievement, menusual_list,
|
attachingRate);
|
||||||
renewal_rate, attach_rate );
|
|
||||||
}
|
}
|
||||||
finally
|
catch ( IOException error )
|
||||||
{
|
{
|
||||||
try
|
String errorMessage = "查询" + departmentCode + "业绩时出现错误。";
|
||||||
{
|
|
||||||
if ( menusual_cursor != null )
|
|
||||||
{
|
|
||||||
menusual_cursor.close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch ( Exception exception )
|
|
||||||
{
|
|
||||||
exception.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
try
|
logger.error(errorMessage, error);
|
||||||
{
|
|
||||||
if ( statement != null )
|
|
||||||
{
|
|
||||||
statement.close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch ( Exception exception )
|
|
||||||
{
|
|
||||||
exception.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
try
|
throw error;
|
||||||
{
|
|
||||||
if ( connection != null )
|
|
||||||
{
|
|
||||||
connection.close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch ( Exception exception )
|
|
||||||
{
|
|
||||||
exception.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return archievement;
|
return archievement;
|
||||||
|
@ -152,12 +113,12 @@ public class DepartmentArchievement
|
||||||
this.totalArchievement = totalArchievement;
|
this.totalArchievement = totalArchievement;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Vector<Long> getMensualArchievementList()
|
public ArrayList<MensualArchievementItem> getMensualArchievementList()
|
||||||
{
|
{
|
||||||
return mensualArchievementList;
|
return mensualArchievementList;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setMensualArchievementList( Vector<Long> mensualArchievementList )
|
public void setMensualArchievementList( ArrayList<MensualArchievementItem> mensualArchievementList )
|
||||||
{
|
{
|
||||||
this.mensualArchievementList = mensualArchievementList;
|
this.mensualArchievementList = mensualArchievementList;
|
||||||
}
|
}
|
||||||
|
@ -182,13 +143,26 @@ public class DepartmentArchievement
|
||||||
this.attachingRate = 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" )
|
@JsonProperty( "total_archievement" )
|
||||||
private long totalArchievement; // 总业绩
|
private long totalArchievement; // 总业绩
|
||||||
|
|
||||||
// 每月业绩列表
|
// 每月业绩列表
|
||||||
// 要保证数据是按照月份排序。
|
// 要保证数据是按照月份排序。
|
||||||
@JsonProperty( "mensual_archievement_list" )
|
@JsonProperty( "mensual_archievement_list" )
|
||||||
private Vector<Long> mensualArchievementList;
|
private ArrayList<MensualArchievementItem> mensualArchievementList;
|
||||||
|
|
||||||
@JsonProperty( "insurance_renewal_rate" )
|
@JsonProperty( "insurance_renewal_rate" )
|
||||||
private String insuranceRenewalRate; // 续保率
|
private String insuranceRenewalRate; // 续保率
|
||||||
|
|
|
@ -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 );
|
||||||
|
}
|
||||||
|
}
|
|
@ -9,12 +9,17 @@
|
||||||
*/
|
*/
|
||||||
package com.cpic.xim.utils.ranking;
|
package com.cpic.xim.utils.ranking;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
import java.sql.CallableStatement;
|
import java.sql.CallableStatement;
|
||||||
import java.sql.Connection;
|
import java.sql.Connection;
|
||||||
import java.sql.DriverManager;
|
import java.sql.DriverManager;
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.util.Vector;
|
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.OracleCallableStatement;
|
||||||
import oracle.jdbc.OracleTypes;
|
import oracle.jdbc.OracleTypes;
|
||||||
|
|
||||||
|
@ -26,8 +31,8 @@ public class CallerRankingList
|
||||||
private static String password = "Cpic123456";
|
private static String password = "Cpic123456";
|
||||||
|
|
||||||
private CallerRankingList( String departmentCode, String year, String month,
|
private CallerRankingList( String departmentCode, String year, String month,
|
||||||
Vector<CallerRankingItem> attachingRateRankingList,
|
ArrayList<CallerRankingItem> attachingRateRankingList,
|
||||||
Vector<CallerRankingItem> renewalRateRankingList)
|
ArrayList<CallerRankingItem> renewalRateRankingList)
|
||||||
{
|
{
|
||||||
this.departmentCode = departmentCode;
|
this.departmentCode = departmentCode;
|
||||||
this.year = year;
|
this.year = year;
|
||||||
|
@ -36,6 +41,33 @@ public class CallerRankingList
|
||||||
this.renewalRateRankingList = renewalRateRankingList;
|
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方法,用于查询部门坐席排行榜
|
* @brief static方法,用于查询部门坐席排行榜
|
||||||
* @param departmentCode 部门代码
|
* @param departmentCode 部门代码
|
||||||
|
@ -43,7 +75,7 @@ public class CallerRankingList
|
||||||
* @param month 排行榜月份
|
* @param month 排行榜月份
|
||||||
* @return CallerRankingList的实例对象
|
* @return CallerRankingList的实例对象
|
||||||
*/
|
*/
|
||||||
public static CallerRankingList getCallerRankingList( String departmentCode, String year,
|
public static CallerRankingList getCallerRankingList2( String departmentCode, String year,
|
||||||
String month ) throws ClassNotFoundException, SQLException
|
String month ) throws ClassNotFoundException, SQLException
|
||||||
{
|
{
|
||||||
CallerRankingList rankingList = null;
|
CallerRankingList rankingList = null;
|
||||||
|
@ -55,11 +87,11 @@ public class CallerRankingList
|
||||||
String sql = """
|
String sql = """
|
||||||
{call telsale_archievement_pkg.caller_arch_ranking_list(?,?,?,?,?)}
|
{call telsale_archievement_pkg.caller_arch_ranking_list(?,?,?,?,?)}
|
||||||
""";
|
""";
|
||||||
String monthRegx = "(0[1-9])|(1[0-2])";
|
// String monthRegx = "(0[1-9])|(1[0-2])";
|
||||||
String yearRegx = "20[0-2][0-0]";
|
// String yearRegx = "20[0-2][0-0]";
|
||||||
|
|
||||||
Vector<CallerRankingItem> attachingRateRankingList = new Vector<>();
|
ArrayList<CallerRankingItem> attachingRateRankingList = new ArrayList<>();
|
||||||
Vector<CallerRankingItem> renewalRateRankingList = new Vector<>();
|
ArrayList<CallerRankingItem> renewalRateRankingList = new ArrayList<>();
|
||||||
|
|
||||||
int index = 1;
|
int index = 1;
|
||||||
|
|
||||||
|
@ -81,7 +113,7 @@ public class CallerRankingList
|
||||||
cur_attaching = ((OracleCallableStatement) statement).getCursor( 4 );
|
cur_attaching = ((OracleCallableStatement) statement).getCursor( 4 );
|
||||||
index = 1;
|
index = 1;
|
||||||
|
|
||||||
while ( cur_attaching.next())
|
while (cur_attaching.next())
|
||||||
{
|
{
|
||||||
String callerName = cur_attaching.getString( 1 );
|
String callerName = cur_attaching.getString( 1 );
|
||||||
String appraiseValue = cur_attaching.getString( 2 );
|
String appraiseValue = cur_attaching.getString( 2 );
|
||||||
|
@ -98,7 +130,7 @@ public class CallerRankingList
|
||||||
cur_renewal = ((OracleCallableStatement) statement).getCursor( 5 );
|
cur_renewal = ((OracleCallableStatement) statement).getCursor( 5 );
|
||||||
index = 1;
|
index = 1;
|
||||||
|
|
||||||
while ( cur_renewal.next())
|
while (cur_renewal.next())
|
||||||
{
|
{
|
||||||
String callerName = cur_renewal.getString( 1 );
|
String callerName = cur_renewal.getString( 1 );
|
||||||
String appraiseValue = cur_renewal.getString( 2 );
|
String appraiseValue = cur_renewal.getString( 2 );
|
||||||
|
@ -153,7 +185,6 @@ public class CallerRankingList
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return rankingList;
|
return rankingList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -187,22 +218,22 @@ public class CallerRankingList
|
||||||
this.month = month;
|
this.month = month;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Vector<CallerRankingItem> getAttachingRateRankingList()
|
public ArrayList<CallerRankingItem> getAttachingRateRankingList()
|
||||||
{
|
{
|
||||||
return attachingRateRankingList;
|
return attachingRateRankingList;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAttachingRateRankingList( Vector<CallerRankingItem> attachingRateRankingList )
|
public void setAttachingRateRankingList( ArrayList<CallerRankingItem> attachingRateRankingList )
|
||||||
{
|
{
|
||||||
this.attachingRateRankingList = attachingRateRankingList;
|
this.attachingRateRankingList = attachingRateRankingList;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Vector<CallerRankingItem> getRenewalRateRankingList()
|
public ArrayList<CallerRankingItem> getRenewalRateRankingList()
|
||||||
{
|
{
|
||||||
return renewalRateRankingList;
|
return renewalRateRankingList;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRenewalRateRankingList( Vector<CallerRankingItem> renewalRateRankingList )
|
public void setRenewalRateRankingList( ArrayList<CallerRankingItem> renewalRateRankingList )
|
||||||
{
|
{
|
||||||
this.renewalRateRankingList = renewalRateRankingList;
|
this.renewalRateRankingList = renewalRateRankingList;
|
||||||
}
|
}
|
||||||
|
@ -217,9 +248,9 @@ public class CallerRankingList
|
||||||
private String month;
|
private String month;
|
||||||
|
|
||||||
// 车非融合率排行
|
// 车非融合率排行
|
||||||
private Vector<CallerRankingItem> attachingRateRankingList;
|
private ArrayList<CallerRankingItem> attachingRateRankingList;
|
||||||
|
|
||||||
// 续保率排行
|
// 续保率排行
|
||||||
private Vector<CallerRankingItem> renewalRateRankingList;
|
private ArrayList<CallerRankingItem> renewalRateRankingList;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,14 +11,14 @@ package com.cpic.xim.web.controllers;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
|
||||||
public class QueryResult {
|
public class QueryResponse {
|
||||||
|
|
||||||
public QueryResult(boolean success, String message) {
|
public QueryResponse(boolean success, String message) {
|
||||||
this.success = success;
|
this.success = success;
|
||||||
this.message = message;
|
this.message = message;
|
||||||
}
|
}
|
||||||
|
|
||||||
public QueryResult() {
|
public QueryResponse() {
|
||||||
this.success = false;
|
this.success = false;
|
||||||
this.message = "";
|
this.message = "";
|
||||||
}
|
}
|
||||||
|
@ -53,7 +53,7 @@ public class QueryResult {
|
||||||
if (this == obj) return true;
|
if (this == obj) return true;
|
||||||
if (obj == null) return false;
|
if (obj == null) return false;
|
||||||
if (getClass() != obj.getClass()) return false;
|
if (getClass() != obj.getClass()) return false;
|
||||||
QueryResult other = (QueryResult) obj;
|
QueryResponse other = (QueryResponse) obj;
|
||||||
if (success != other.success) return false;
|
if (success != other.success) return false;
|
||||||
if (message == null) {
|
if (message == null) {
|
||||||
if (other.message != null) return false;
|
if (other.message != null) return false;
|
|
@ -11,7 +11,6 @@ package com.cpic.xim.web.controllers.account;
|
||||||
|
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.web.bind.annotation.CrossOrigin;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
|
|
@ -9,10 +9,10 @@
|
||||||
*/
|
*/
|
||||||
package com.cpic.xim.web.controllers.account;
|
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;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
|
||||||
public class TeleSalerQueryResult extends QueryResult
|
public class TeleSalerQueryResult extends QueryResponse
|
||||||
{
|
{
|
||||||
|
|
||||||
public TeleSalerQueryResult()
|
public TeleSalerQueryResult()
|
||||||
|
|
|
@ -13,31 +13,41 @@
|
||||||
|
|
||||||
package com.cpic.xim.web.controllers.archievement;
|
package com.cpic.xim.web.controllers.archievement;
|
||||||
|
|
||||||
import java.sql.SQLException;
|
import java.io.IOException;
|
||||||
import java.util.Vector;
|
import java.util.ArrayList;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
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.archievement.DepartmentArchievement;
|
||||||
import com.cpic.xim.utils.ranking.CallerRankingItem;
|
import com.cpic.xim.utils.ranking.CallerRankingItem;
|
||||||
import com.cpic.xim.utils.ranking.CallerRankingList;
|
import com.cpic.xim.utils.ranking.CallerRankingList;
|
||||||
import com.cpic.xim.web.controllers.archievement.RankingList.RankingListRequest;
|
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.RankingList.RankingListResponse;
|
||||||
|
import com.cpic.xim.web.controllers.archievement.caller.CallerArchievementQueryRequest;
|
||||||
|
import com.cpic.xim.web.controllers.archievement.caller.CallerArchievementQueryResult;
|
||||||
|
import com.cpic.xim.web.controllers.archievement.department.DepartmentArchievementQueryRequest;
|
||||||
|
import com.cpic.xim.web.controllers.archievement.department.DepartmentArchievementQueryResult;
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping( "/archievement" )
|
@RequestMapping( "/archievement" )
|
||||||
public class ArchievementQueryController
|
public class ArchievementQueryController
|
||||||
{
|
{
|
||||||
|
// 日志
|
||||||
|
private static Logger logger = LoggerFactory.getLogger( ArchievementQueryController.class );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询坐席业绩
|
* 查询坐席业绩
|
||||||
*/
|
*/
|
||||||
@PostMapping( "/query_caller_archievement.do" )
|
// @PostMapping( "/query_caller_archievement.do" )
|
||||||
public void queryCallerArchievement()
|
// public void queryCallerArchievement()
|
||||||
{
|
// {
|
||||||
|
|
||||||
}
|
// }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询部门业绩
|
* 查询部门业绩
|
||||||
|
@ -55,8 +65,8 @@ public class ArchievementQueryController
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// 查询业绩
|
// 查询业绩
|
||||||
departmentArch = DepartmentArchievement
|
departmentArch =
|
||||||
.queryDepartmentArchievement( request.getDepartmentCode() );
|
DepartmentArchievement.getDepartmentArchievement( request.getDepartmentCode() );
|
||||||
|
|
||||||
result.setTotalArchievement( departmentArch.getTotalArchievement() );
|
result.setTotalArchievement( departmentArch.getTotalArchievement() );
|
||||||
result.setInsuranceRenewalRate( departmentArch.getInsuranceRenewalRate() );
|
result.setInsuranceRenewalRate( departmentArch.getInsuranceRenewalRate() );
|
||||||
|
@ -67,11 +77,7 @@ public class ArchievementQueryController
|
||||||
result.addBackwardStaff( "王炜" );
|
result.addBackwardStaff( "王炜" );
|
||||||
result.setMensualArchievementList( departmentArch.getMensualArchievementList() );
|
result.setMensualArchievementList( departmentArch.getMensualArchievementList() );
|
||||||
}
|
}
|
||||||
catch ( SQLException error )
|
catch ( IOException error )
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
catch ( ClassNotFoundException error )
|
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -82,6 +88,31 @@ public class ArchievementQueryController
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ResponseBody
|
||||||
|
@PostMapping( "/query_caller_archievement.do" )
|
||||||
|
public CallerArchievementQueryResult queryCallerArchievement(
|
||||||
|
@RequestBody CallerArchievementQueryRequest request )
|
||||||
|
{
|
||||||
|
CallerArchievementQueryResult result = null;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
CallerArchievement archievement =
|
||||||
|
CallerArchievement.getCallerArchievement( request.getCallerCode() );
|
||||||
|
|
||||||
|
result = new CallerArchievementQueryResult( true, "查询成功", archievement.getCallerCode(),
|
||||||
|
request.getCallName(), archievement.getTotalArchievement(),
|
||||||
|
archievement.getMensualArchievementList(),
|
||||||
|
archievement.getInsuranceRenewalRate(), archievement.getAttachingRate() );
|
||||||
|
}
|
||||||
|
catch ( IOException error )
|
||||||
|
{
|
||||||
|
result = new CallerArchievementQueryResult(false, error.getMessage(), null, null, 0, null, null, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
@RequestMapping( "/query_ranking_list.do" )
|
@RequestMapping( "/query_ranking_list.do" )
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public RankingListResponse queryCallerArchievementRankingList(
|
public RankingListResponse queryCallerArchievementRankingList(
|
||||||
|
@ -94,8 +125,8 @@ public class ArchievementQueryController
|
||||||
boolean success = false;
|
boolean success = false;
|
||||||
String message = "";
|
String message = "";
|
||||||
|
|
||||||
Vector<CallerRankingItem> attachingRateRankingList = null;
|
ArrayList<CallerRankingItem> attachingRateRankingList = null;
|
||||||
Vector<CallerRankingItem> renewalRateRankingList = null;
|
ArrayList<CallerRankingItem> renewalRateRankingList = null;
|
||||||
|
|
||||||
|
|
||||||
try
|
try
|
||||||
|
@ -109,19 +140,12 @@ public class ArchievementQueryController
|
||||||
success = true;
|
success = true;
|
||||||
message = "调用成功!";
|
message = "调用成功!";
|
||||||
}
|
}
|
||||||
catch ( SQLException error )
|
catch ( IOException error )
|
||||||
{
|
{
|
||||||
success = false;
|
success = false;
|
||||||
message = "获取排行榜失败,原因:" + error.getMessage();
|
message = "获取排行榜失败,原因:" + error.getMessage();
|
||||||
|
|
||||||
error.printStackTrace();
|
logger.error( message, error );
|
||||||
}
|
|
||||||
catch ( ClassNotFoundException error )
|
|
||||||
{
|
|
||||||
success = false;
|
|
||||||
message = "获取排行榜失败,原因:oracle驱动加载失败!" + error.getMessage();
|
|
||||||
|
|
||||||
error.printStackTrace();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RankingListResponse response = new RankingListResponse( success, message, departmentCode,
|
RankingListResponse response = new RankingListResponse( success, message, departmentCode,
|
||||||
|
|
|
@ -1,8 +0,0 @@
|
||||||
|
|
||||||
|
|
||||||
package com.cpic.xim.web.controllers.archievement;
|
|
||||||
|
|
||||||
public class CallerArchievementQueryResult
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
|
@ -9,12 +9,12 @@
|
||||||
*/
|
*/
|
||||||
package com.cpic.xim.web.controllers.archievement.RankingList;
|
package com.cpic.xim.web.controllers.archievement.RankingList;
|
||||||
|
|
||||||
import java.util.Vector;
|
import java.util.ArrayList;
|
||||||
import com.cpic.xim.utils.ranking.CallerRankingItem;
|
import com.cpic.xim.utils.ranking.CallerRankingItem;
|
||||||
import com.cpic.xim.web.controllers.QueryResult;
|
import com.cpic.xim.web.controllers.QueryResponse;
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
|
||||||
public class RankingListResponse extends QueryResult
|
public class RankingListResponse extends QueryResponse
|
||||||
{
|
{
|
||||||
public RankingListResponse()
|
public RankingListResponse()
|
||||||
{
|
{
|
||||||
|
@ -22,8 +22,8 @@ public class RankingListResponse extends QueryResult
|
||||||
}
|
}
|
||||||
|
|
||||||
public RankingListResponse( boolean success, String message, String departmentCode, String year,
|
public RankingListResponse( boolean success, String message, String departmentCode, String year,
|
||||||
String month, Vector<CallerRankingItem> attachingRateRankingList,
|
String month, ArrayList<CallerRankingItem> attachingRateRankingList,
|
||||||
Vector<CallerRankingItem> renewalRateRankingList)
|
ArrayList<CallerRankingItem> renewalRateRankingList)
|
||||||
{
|
{
|
||||||
super( success, message );
|
super( success, message );
|
||||||
|
|
||||||
|
@ -64,22 +64,22 @@ public class RankingListResponse extends QueryResult
|
||||||
this.month = month;
|
this.month = month;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Vector<CallerRankingItem> getAttachingRateRankingList()
|
public ArrayList<CallerRankingItem> getAttachingRateRankingList()
|
||||||
{
|
{
|
||||||
return attachingRateRankingList;
|
return attachingRateRankingList;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAttachingRateRankingList( Vector<CallerRankingItem> attachingRateRankingList )
|
public void setAttachingRateRankingList( ArrayList<CallerRankingItem> attachingRateRankingList )
|
||||||
{
|
{
|
||||||
this.attachingRateRankingList = attachingRateRankingList;
|
this.attachingRateRankingList = attachingRateRankingList;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Vector<CallerRankingItem> getRenewalRateRankingList()
|
public ArrayList<CallerRankingItem> getRenewalRateRankingList()
|
||||||
{
|
{
|
||||||
return renewalRateRankingList;
|
return renewalRateRankingList;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRenewalRateRankingList( Vector<CallerRankingItem> renewalRateRankingList )
|
public void setRenewalRateRankingList( ArrayList<CallerRankingItem> renewalRateRankingList )
|
||||||
{
|
{
|
||||||
this.renewalRateRankingList = renewalRateRankingList;
|
this.renewalRateRankingList = renewalRateRankingList;
|
||||||
}
|
}
|
||||||
|
@ -98,9 +98,9 @@ public class RankingListResponse extends QueryResult
|
||||||
|
|
||||||
// 车非融合率排行
|
// 车非融合率排行
|
||||||
@JsonProperty( "attachingRateRankingList" )
|
@JsonProperty( "attachingRateRankingList" )
|
||||||
private Vector<CallerRankingItem> attachingRateRankingList;
|
private ArrayList<CallerRankingItem> attachingRateRankingList;
|
||||||
|
|
||||||
// 续保率排行
|
// 续保率排行
|
||||||
@JsonProperty( "renewalRateRankingList" )
|
@JsonProperty( "renewalRateRankingList" )
|
||||||
private Vector<CallerRankingItem> renewalRateRankingList;
|
private ArrayList<CallerRankingItem> renewalRateRankingList;
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,43 @@
|
||||||
|
/*
|
||||||
|
* @Author: Kane
|
||||||
|
* @Date: 2023-08-26 13:20:32
|
||||||
|
* @LastEditors: Kane
|
||||||
|
* @FilePath: /desktop_archievement_backend/src/main/java/com/cpic/xim/web/controllers/archievement/caller/CallerArchievementQueryRequest.java
|
||||||
|
* @Description:
|
||||||
|
*
|
||||||
|
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||||
|
*/
|
||||||
|
package com.cpic.xim.web.controllers.archievement.caller;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
|
||||||
|
public class CallerArchievementQueryRequest
|
||||||
|
{
|
||||||
|
public CallerArchievementQueryRequest() {}
|
||||||
|
|
||||||
|
public String getCallerCode()
|
||||||
|
{
|
||||||
|
return callerCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCallerCode( String callerCode )
|
||||||
|
{
|
||||||
|
this.callerCode = callerCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCallName()
|
||||||
|
{
|
||||||
|
return callName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCallName( String callName )
|
||||||
|
{
|
||||||
|
this.callName = callName;
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonProperty("callerCode")
|
||||||
|
private String callerCode;
|
||||||
|
|
||||||
|
@JsonProperty("callerName")
|
||||||
|
private String callName;
|
||||||
|
}
|
|
@ -0,0 +1,123 @@
|
||||||
|
/*
|
||||||
|
* @Author: Kane
|
||||||
|
* @Date: 2023-06-06 17:35:54
|
||||||
|
* @LastEditors: Kane
|
||||||
|
* @FilePath: /desktop_archievement_backend/src/main/java/com/cpic/xim/web/controllers/archievement/caller/CallerArchievementQueryResult.java
|
||||||
|
* @Description:
|
||||||
|
*
|
||||||
|
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||||
|
*/
|
||||||
|
package com.cpic.xim.web.controllers.archievement.caller;
|
||||||
|
|
||||||
|
import com.cpic.xim.mybatis.pojo.MensualArchievementItem;
|
||||||
|
import com.cpic.xim.web.controllers.QueryResponse;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
public class CallerArchievementQueryResult extends QueryResponse
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param success
|
||||||
|
* @param message
|
||||||
|
* @param callerCode
|
||||||
|
* @param callerName
|
||||||
|
* @param totalArchievement
|
||||||
|
* @param mensualArchievementList
|
||||||
|
* @param insuranceRenewalRate
|
||||||
|
* @param attachingRate
|
||||||
|
*/
|
||||||
|
public CallerArchievementQueryResult( boolean success, String message, String callerCode,
|
||||||
|
String callerName, long totalArchievement,
|
||||||
|
ArrayList<MensualArchievementItem> mensualArchievementList, String insuranceRenewalRate,
|
||||||
|
String attachingRate)
|
||||||
|
{
|
||||||
|
super( success, message );
|
||||||
|
this.callerCode = callerCode;
|
||||||
|
this.callerName = callerName;
|
||||||
|
this.totalArchievement = totalArchievement;
|
||||||
|
this.mensualArchievementList = mensualArchievementList;
|
||||||
|
this.insuranceRenewalRate = insuranceRenewalRate;
|
||||||
|
this.attachingRate = attachingRate;
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonProperty("callerCode")
|
||||||
|
String callerCode;
|
||||||
|
|
||||||
|
public String getCallerCode()
|
||||||
|
{
|
||||||
|
return callerCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCallerCode( String callerCode )
|
||||||
|
{
|
||||||
|
this.callerCode = callerCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCallerName()
|
||||||
|
{
|
||||||
|
return callerName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCallerName( String callerName )
|
||||||
|
{
|
||||||
|
this.callerName = callerName;
|
||||||
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonProperty("callerName")
|
||||||
|
String callerName;
|
||||||
|
|
||||||
|
@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; // 车非渗透率
|
||||||
|
}
|
|
@ -8,7 +8,7 @@
|
||||||
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.cpic.xim.web.controllers.archievement;
|
package com.cpic.xim.web.controllers.archievement.department;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
|
|
@ -2,27 +2,30 @@
|
||||||
* @Author: Kane
|
* @Author: Kane
|
||||||
* @Date: 2023-03-16 09:32:53
|
* @Date: 2023-03-16 09:32:53
|
||||||
* @LastEditors: Kane
|
* @LastEditors: Kane
|
||||||
* @FilePath: /desktop_archievement_backend/src/main/java/com/cpic/xim/web/controllers/archievement/DepartmentArchievementQueryResult.java
|
* @FilePath: /desktop_archievement_backend/src/main/java/com/cpic/xim/web/controllers/archievement/department/DepartmentArchievementQueryResult.java
|
||||||
* @Description:
|
* @Description:
|
||||||
*
|
*
|
||||||
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.cpic.xim.web.controllers.archievement;
|
package com.cpic.xim.web.controllers.archievement.department;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
|
import com.cpic.xim.mybatis.pojo.MensualArchievementItem;
|
||||||
|
import com.cpic.xim.web.controllers.QueryResponse;
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
import com.cpic.xim.web.controllers.QueryResult;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询部门业绩返回结果。
|
* 查询部门业绩返回结果。
|
||||||
* MensualArchievementList 每月业绩,要保证数据是按照月份排序。
|
* MensualArchievementList 每月业绩,要保证数据是按照月份排序。
|
||||||
*/
|
*/
|
||||||
public class DepartmentArchievementQueryResult extends QueryResult
|
public class DepartmentArchievementQueryResult extends QueryResponse
|
||||||
{
|
{
|
||||||
DepartmentArchievementQueryResult()
|
public DepartmentArchievementQueryResult()
|
||||||
{
|
{
|
||||||
mensualArchievementList = new Vector<Long>();
|
mensualArchievementList = new ArrayList<MensualArchievementItem>();
|
||||||
advanceRewardGainers = new Vector<String>();
|
advanceRewardGainers = new Vector<String>();
|
||||||
leadingRewardGainers = new Vector<String>();
|
leadingRewardGainers = new Vector<String>();
|
||||||
backwardList = new Vector<String>();
|
backwardList = new Vector<String>();
|
||||||
|
@ -38,12 +41,13 @@ public class DepartmentArchievementQueryResult extends QueryResult
|
||||||
this.totalArchievement = totalArchievement;
|
this.totalArchievement = totalArchievement;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Vector<Long> getMensualArchievementList()
|
public List<MensualArchievementItem> getMensualArchievementList()
|
||||||
{
|
{
|
||||||
return mensualArchievementList;
|
return mensualArchievementList;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setMensualArchievementList( Vector<Long> mensualArchievementList )
|
public void setMensualArchievementList(
|
||||||
|
ArrayList<MensualArchievementItem> mensualArchievementList )
|
||||||
{
|
{
|
||||||
this.mensualArchievementList = mensualArchievementList;
|
this.mensualArchievementList = mensualArchievementList;
|
||||||
}
|
}
|
||||||
|
@ -119,7 +123,7 @@ public class DepartmentArchievementQueryResult extends QueryResult
|
||||||
// 每月业绩列表
|
// 每月业绩列表
|
||||||
// 要保证数据是按照月份排序。
|
// 要保证数据是按照月份排序。
|
||||||
@JsonProperty( "mensual_archievement_list" )
|
@JsonProperty( "mensual_archievement_list" )
|
||||||
private Vector<Long> mensualArchievementList;
|
private ArrayList<MensualArchievementItem> mensualArchievementList;
|
||||||
|
|
||||||
@JsonProperty( "insurance_renewal_rate" )
|
@JsonProperty( "insurance_renewal_rate" )
|
||||||
private String insuranceRenewalRate; // 续保率
|
private String insuranceRenewalRate; // 续保率
|
|
@ -0,0 +1,26 @@
|
||||||
|
/*
|
||||||
|
* @Author: Kane
|
||||||
|
* @Date: 2023-06-19 10:01:43
|
||||||
|
* @LastEditors: Kane
|
||||||
|
* @FilePath: /desktop_archievement_backend/src/main/java/com/cpic/xim/web/controllers/caller/CallerController.java
|
||||||
|
* @Description:
|
||||||
|
*
|
||||||
|
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||||
|
*/
|
||||||
|
package com.cpic.xim.web.controllers.caller;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/caller")
|
||||||
|
public class CallerController
|
||||||
|
{
|
||||||
|
public CallerController() {}
|
||||||
|
|
||||||
|
@RequestMapping("/quer_caller.do")
|
||||||
|
public static void queryCaller()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,25 @@
|
||||||
|
/*
|
||||||
|
* @Author: Kane
|
||||||
|
* @Date: 2023-06-19 15:33:23
|
||||||
|
* @LastEditors: Kane
|
||||||
|
* @FilePath: /desktop_archievement_backend/src/main/java/com/cpic/xim/web/controllers/caller/QueryCallerRequest.java
|
||||||
|
* @Description:
|
||||||
|
*
|
||||||
|
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||||
|
*/
|
||||||
|
package com.cpic.xim.web.controllers.caller;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
|
||||||
|
@SuppressWarnings("all")
|
||||||
|
public class QueryCallerRequest
|
||||||
|
{
|
||||||
|
public QueryCallerRequest() {}
|
||||||
|
|
||||||
|
private String callerCode;
|
||||||
|
private String callerName;
|
||||||
|
private String teamCode;
|
||||||
|
private String teamName;
|
||||||
|
private String departmentCode;
|
||||||
|
private String departmentName;
|
||||||
|
}
|
|
@ -0,0 +1,91 @@
|
||||||
|
/*
|
||||||
|
* @Author: Kane
|
||||||
|
* @Date: 2023-09-21 11:35:57
|
||||||
|
* @LastEditors: Kane
|
||||||
|
* @FilePath: /desktop_archievement_backend/src/main/java/com/cpic/xim/web/controllers/rewards/AddTelsalerRequest.java
|
||||||
|
* @Description:
|
||||||
|
*
|
||||||
|
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||||
|
*/
|
||||||
|
package com.cpic.xim.web.controllers.rewards;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
|
||||||
|
public class AddTelsalerRequest
|
||||||
|
{
|
||||||
|
public AddTelsalerRequest() {}
|
||||||
|
|
||||||
|
public AddTelsalerRequest( String rewardIndex, String telsalerName )
|
||||||
|
{
|
||||||
|
this.rewardIndex = rewardIndex;
|
||||||
|
this.telsalerName = telsalerName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRewardIndex()
|
||||||
|
{
|
||||||
|
return rewardIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRewardIndex( String rewardIndex )
|
||||||
|
{
|
||||||
|
this.rewardIndex = rewardIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTelsalerName()
|
||||||
|
{
|
||||||
|
return telsalerName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTelsalerName( String telsalerName )
|
||||||
|
{
|
||||||
|
this.telsalerName = telsalerName;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString()
|
||||||
|
{
|
||||||
|
return "AddTelsalerRequest [rewardIndex=" + rewardIndex + ", telsalerName=" + telsalerName
|
||||||
|
+ "]";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode()
|
||||||
|
{
|
||||||
|
final int prime = 31;
|
||||||
|
int result = 1;
|
||||||
|
result = prime * result + ((rewardIndex == null) ? 0 : rewardIndex.hashCode());
|
||||||
|
result = prime * result + ((telsalerName == null) ? 0 : telsalerName.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;
|
||||||
|
AddTelsalerRequest other = (AddTelsalerRequest) obj;
|
||||||
|
if ( rewardIndex == null )
|
||||||
|
{
|
||||||
|
if ( other.rewardIndex != null )
|
||||||
|
return false;
|
||||||
|
} else if ( !rewardIndex.equals( other.rewardIndex ) )
|
||||||
|
return false;
|
||||||
|
if ( telsalerName == null )
|
||||||
|
{
|
||||||
|
if ( other.telsalerName != null )
|
||||||
|
return false;
|
||||||
|
} else if ( !telsalerName.equals( other.telsalerName ) )
|
||||||
|
return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonProperty("rewardIndex")
|
||||||
|
private String rewardIndex;
|
||||||
|
|
||||||
|
@JsonProperty("telsalerName")
|
||||||
|
private String telsalerName;
|
||||||
|
}
|
|
@ -0,0 +1,25 @@
|
||||||
|
/*
|
||||||
|
* @Author: Kane
|
||||||
|
* @Date: 2023-09-21 11:35:57
|
||||||
|
* @LastEditors: Kane
|
||||||
|
* @FilePath: /desktop_archievement_backend/src/main/java/com/cpic/xim/web/controllers/rewards/AddTelsalerResponse.java
|
||||||
|
* @Description:
|
||||||
|
*
|
||||||
|
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||||
|
*/
|
||||||
|
package com.cpic.xim.web.controllers.rewards;
|
||||||
|
|
||||||
|
import com.cpic.xim.web.controllers.QueryResponse;
|
||||||
|
|
||||||
|
public class AddTelsalerResponse extends QueryResponse
|
||||||
|
{
|
||||||
|
public AddTelsalerResponse()
|
||||||
|
{
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public AddTelsalerResponse( boolean success, String message )
|
||||||
|
{
|
||||||
|
super( success, message );
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,66 @@
|
||||||
|
/*
|
||||||
|
* @Author: Kane
|
||||||
|
* @Date: 2023-09-21 11:35:57
|
||||||
|
* @LastEditors: Kane
|
||||||
|
* @FilePath: /desktop_archievement_backend/src/main/java/com/cpic/xim/web/controllers/rewards/DeleteTelsalerRequest.java
|
||||||
|
* @Description:
|
||||||
|
*
|
||||||
|
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||||
|
*/
|
||||||
|
package com.cpic.xim.web.controllers.rewards;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
|
||||||
|
public class DeleteTelsalerRequest
|
||||||
|
{
|
||||||
|
public DeleteTelsalerRequest() {}
|
||||||
|
|
||||||
|
public DeleteTelsalerRequest( int[] recordID)
|
||||||
|
{
|
||||||
|
this.recordID = recordID;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString()
|
||||||
|
{
|
||||||
|
return "DeleteTelsalerRequest [recordID=" + Arrays.toString( recordID ) + "]";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode()
|
||||||
|
{
|
||||||
|
final int prime = 31;
|
||||||
|
int result = 1;
|
||||||
|
result = prime * result + Arrays.hashCode( recordID );
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals( Object obj )
|
||||||
|
{
|
||||||
|
if ( this == obj )
|
||||||
|
return true;
|
||||||
|
if ( obj == null )
|
||||||
|
return false;
|
||||||
|
if ( getClass() != obj.getClass() )
|
||||||
|
return false;
|
||||||
|
DeleteTelsalerRequest other = (DeleteTelsalerRequest) obj;
|
||||||
|
if ( !Arrays.equals( recordID, other.recordID ) )
|
||||||
|
return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int[] getRecordID()
|
||||||
|
{
|
||||||
|
return recordID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRecordID( int[] recordID )
|
||||||
|
{
|
||||||
|
this.recordID = recordID;
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonProperty("recordID")
|
||||||
|
private int[] recordID;
|
||||||
|
}
|
|
@ -0,0 +1,25 @@
|
||||||
|
/*
|
||||||
|
* @Author: Kane
|
||||||
|
* @Date: 2023-09-21 11:35:57
|
||||||
|
* @LastEditors: Kane
|
||||||
|
* @FilePath: /desktop_archievement_backend/src/main/java/com/cpic/xim/web/controllers/rewards/AddTelsalerResponse.java
|
||||||
|
* @Description:
|
||||||
|
*
|
||||||
|
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||||
|
*/
|
||||||
|
package com.cpic.xim.web.controllers.rewards;
|
||||||
|
|
||||||
|
import com.cpic.xim.web.controllers.QueryResponse;
|
||||||
|
|
||||||
|
public class DeleteTelsalerResponse extends QueryResponse
|
||||||
|
{
|
||||||
|
public DeleteTelsalerResponse()
|
||||||
|
{
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public DeleteTelsalerResponse( boolean success, String message )
|
||||||
|
{
|
||||||
|
super( success, message );
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,242 @@
|
||||||
|
/*
|
||||||
|
* @Author: Kane
|
||||||
|
* @Date: 2023-09-06 10:41:34
|
||||||
|
* @LastEditors: Kane
|
||||||
|
* @FilePath: /desktop_archievement_backend/src/main/java/com/cpic/xim/web/controllers/rewards/RewardController.java
|
||||||
|
* @Description: 坐席奖励相关的请求
|
||||||
|
*
|
||||||
|
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||||
|
*/
|
||||||
|
package com.cpic.xim.web.controllers.rewards;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import org.apache.ibatis.exceptions.PersistenceException;
|
||||||
|
import org.apache.ibatis.session.SqlSession;
|
||||||
|
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.mybatis.mapper.RewardsMapper;
|
||||||
|
import com.cpic.xim.mybatis.pojo.RewardGainer;
|
||||||
|
import com.cpic.xim.mybatis.pojo.RewardProject;
|
||||||
|
import com.cpic.xim.mybatis.utils.MybatisUtils;
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
@RequestMapping( "/rewards" )
|
||||||
|
public class RewardController
|
||||||
|
{
|
||||||
|
// 日志
|
||||||
|
private static Logger logger = LoggerFactory.getLogger( RewardController.class );
|
||||||
|
|
||||||
|
private RewardController()
|
||||||
|
{}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 相应查询获奖项目清单的请求
|
||||||
|
* @return 获奖项目清单的response对象
|
||||||
|
*/
|
||||||
|
@PostMapping( "/query_reward_projects.do" )
|
||||||
|
@ResponseBody
|
||||||
|
public RewardProjectsResponse queryRewardProjecrts()
|
||||||
|
{
|
||||||
|
RewardProjectsResponse response = new RewardProjectsResponse();
|
||||||
|
SqlSession session = null;
|
||||||
|
|
||||||
|
logger.debug( "查询奖项清单。" );
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
session = MybatisUtils.getSqlSession();
|
||||||
|
session.clearCache();
|
||||||
|
|
||||||
|
RewardsMapper mapper = session.getMapper( RewardsMapper.class );
|
||||||
|
ArrayList<RewardProject> rewards = mapper.queryRewardProjects();
|
||||||
|
|
||||||
|
response.setSuccess( true );
|
||||||
|
response.setMessage( "查询成功!" );
|
||||||
|
response.setRewardList( rewards );
|
||||||
|
|
||||||
|
logger.debug( "查询奖项清单," + response.getMessage() + "," + rewards.toString() );
|
||||||
|
}
|
||||||
|
catch ( IOException error )
|
||||||
|
{
|
||||||
|
response.setSuccess( false );
|
||||||
|
response.setMessage( "查询失败!" + error.getMessage() );
|
||||||
|
response.setRewardList( null );
|
||||||
|
|
||||||
|
logger.debug( "查询奖项清单," + response.getMessage() + "," + error.getMessage() );
|
||||||
|
}
|
||||||
|
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping( "/query_reward_gainers.do" )
|
||||||
|
@ResponseBody
|
||||||
|
RewardGainersResponse queryRewardGainers()
|
||||||
|
{
|
||||||
|
RewardGainersResponse response = new RewardGainersResponse();
|
||||||
|
SqlSession session = null;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
session = MybatisUtils.getSqlSession();
|
||||||
|
|
||||||
|
RewardsMapper mapper = session.getMapper( RewardsMapper.class );
|
||||||
|
|
||||||
|
ArrayList<RewardGainer> gainers = mapper.queryRewardTelsaler();
|
||||||
|
|
||||||
|
response.setSuccess( true );
|
||||||
|
response.setMessage( "查询成功!" );
|
||||||
|
response.setGainerList( gainers );
|
||||||
|
}
|
||||||
|
catch ( PersistenceException error )
|
||||||
|
{
|
||||||
|
response.setSuccess( false );
|
||||||
|
response.setMessage( "查询失败!" + error.getMessage() );
|
||||||
|
response.setGainerList( null );
|
||||||
|
}
|
||||||
|
catch ( IOException error )
|
||||||
|
{
|
||||||
|
response.setSuccess( false );
|
||||||
|
response.setMessage( "查询失败!" + error.getMessage() );
|
||||||
|
response.setGainerList( null );
|
||||||
|
}
|
||||||
|
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping( "/add_telsaler_reward.do" )
|
||||||
|
@ResponseBody
|
||||||
|
public AddTelsalerResponse addTelsalerReward( @RequestBody AddTelsalerRequest request )
|
||||||
|
{
|
||||||
|
AddTelsalerResponse response = new AddTelsalerResponse();
|
||||||
|
SqlSession session = null;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
session = MybatisUtils.getSqlSession();
|
||||||
|
|
||||||
|
RewardsMapper mapper = session.getMapper( RewardsMapper.class );
|
||||||
|
HashMap<String, Object> params = new HashMap<>( 3 );
|
||||||
|
|
||||||
|
params.put( "a_reward_index", request.getRewardIndex() );
|
||||||
|
params.put( "a_telsaler_name", request.getTelsalerName() );
|
||||||
|
|
||||||
|
mapper.addRewardTelSaler( params );
|
||||||
|
session.commit();
|
||||||
|
|
||||||
|
response.setSuccess( true );
|
||||||
|
response.setMessage( "添加成功!" );
|
||||||
|
}
|
||||||
|
catch ( PersistenceException error )
|
||||||
|
{
|
||||||
|
if ( session != null )
|
||||||
|
{
|
||||||
|
session.rollback();
|
||||||
|
}
|
||||||
|
|
||||||
|
logger.error( "添加获奖坐席失败,原因:" + error.getMessage() );
|
||||||
|
|
||||||
|
response.setSuccess( false );
|
||||||
|
response.setMessage( error.getMessage() );
|
||||||
|
}
|
||||||
|
catch ( IOException error )
|
||||||
|
{
|
||||||
|
logger.error( "添加获奖坐席失败,原因:" + error.getMessage() );
|
||||||
|
|
||||||
|
response.setSuccess( false );
|
||||||
|
response.setMessage( error.getMessage() );
|
||||||
|
}
|
||||||
|
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping( "/delete_telsaler_reward.do" )
|
||||||
|
@ResponseBody
|
||||||
|
public DeleteTelsalerResponse deleteTelsalerReward( @RequestBody DeleteTelsalerRequest request )
|
||||||
|
{
|
||||||
|
DeleteTelsalerResponse response = new DeleteTelsalerResponse();
|
||||||
|
SqlSession session = null;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
session = MybatisUtils.getSqlSession();
|
||||||
|
RewardsMapper mapper = session.getMapper( RewardsMapper.class );
|
||||||
|
|
||||||
|
HashMap<String, Object> param = new HashMap<String, Object>( 3 );
|
||||||
|
|
||||||
|
int[] records = request.getRecordID();
|
||||||
|
|
||||||
|
for ( int index = 0; index < records.length; index++ )
|
||||||
|
{
|
||||||
|
param.put( "a_rec_id", records[index] );
|
||||||
|
|
||||||
|
mapper.deleteRewardTelSaler( param );
|
||||||
|
}
|
||||||
|
|
||||||
|
response.setSuccess( true );
|
||||||
|
response.setMessage( "删除成功!" );
|
||||||
|
}
|
||||||
|
catch ( IOException error )
|
||||||
|
{
|
||||||
|
logger.error( "删除获奖坐席失败,原因:" + error.getMessage() );
|
||||||
|
|
||||||
|
response.setSuccess( false );
|
||||||
|
response.setMessage( error.getMessage() );
|
||||||
|
}
|
||||||
|
catch ( PersistenceException error )
|
||||||
|
{
|
||||||
|
logger.error( "删除获奖坐席失败,原因:" + error.getMessage() );
|
||||||
|
|
||||||
|
response.setSuccess( false );
|
||||||
|
response.setMessage( error.getMessage() );
|
||||||
|
}
|
||||||
|
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping( "update_telsaler_reward.do" )
|
||||||
|
@ResponseBody
|
||||||
|
UpdateTelsalerResponse updateTelsalerReward( @RequestBody UpdateTelsalerRequest request )
|
||||||
|
{
|
||||||
|
UpdateTelsalerResponse response = new UpdateTelsalerResponse();
|
||||||
|
SqlSession session = null;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
session = MybatisUtils.getSqlSession();
|
||||||
|
RewardsMapper mapper = session.getMapper( RewardsMapper.class );
|
||||||
|
HashMap<String, Object> params = new HashMap<>( 3 );
|
||||||
|
|
||||||
|
params.put( "a_rec_id", request.getRecordID() );
|
||||||
|
params.put( "a_telsaler_name", request.getTelsalerName() );
|
||||||
|
params.put( "a_reward_index", request.getRewardIndex() );
|
||||||
|
|
||||||
|
mapper.updateRewardTelSaler( params );
|
||||||
|
|
||||||
|
response.setSuccess( true );
|
||||||
|
response.setMessage( "更新成功!" );
|
||||||
|
}
|
||||||
|
catch ( IOException error )
|
||||||
|
{
|
||||||
|
logger.error( "更新获奖坐席失败,原因:" + error.getMessage() );
|
||||||
|
|
||||||
|
response.setSuccess( false );
|
||||||
|
response.setMessage( error.getMessage() );
|
||||||
|
}
|
||||||
|
catch ( PersistenceException error )
|
||||||
|
{
|
||||||
|
logger.error( "更新获奖坐席失败,原因:" + error.getMessage() );
|
||||||
|
|
||||||
|
response.setSuccess( false );
|
||||||
|
response.setMessage( error.getMessage() );
|
||||||
|
}
|
||||||
|
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,47 @@
|
||||||
|
/*
|
||||||
|
* @Author: Kane
|
||||||
|
* @Date: 2023-09-07 17:16:12
|
||||||
|
* @LastEditors: Kane
|
||||||
|
* @FilePath: /desktop_archievement_backend/src/main/java/com/cpic/xim/web/controllers/rewards/RewardGainersResponse.java
|
||||||
|
* @Description:
|
||||||
|
*
|
||||||
|
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.cpic.xim.web.controllers.rewards;
|
||||||
|
|
||||||
|
import com.cpic.xim.mybatis.pojo.RewardGainer;
|
||||||
|
import com.cpic.xim.web.controllers.QueryResponse;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
public class RewardGainersResponse extends QueryResponse
|
||||||
|
{
|
||||||
|
public RewardGainersResponse( boolean success, String message,
|
||||||
|
ArrayList<RewardGainer> gainerList)
|
||||||
|
{
|
||||||
|
super( success, message );
|
||||||
|
|
||||||
|
this.gainerList = gainerList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RewardGainersResponse()
|
||||||
|
{
|
||||||
|
super();
|
||||||
|
|
||||||
|
this.gainerList = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayList<RewardGainer> getGainerList()
|
||||||
|
{
|
||||||
|
return gainerList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGainerList( ArrayList<RewardGainer> gainerList )
|
||||||
|
{
|
||||||
|
this.gainerList = gainerList;
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonProperty( "gainerList" )
|
||||||
|
private ArrayList<RewardGainer> gainerList;
|
||||||
|
}
|
|
@ -0,0 +1,46 @@
|
||||||
|
/*
|
||||||
|
* @Author: Kane
|
||||||
|
* @Date: 2023-09-06 10:59:45
|
||||||
|
* @LastEditors: Kane
|
||||||
|
* @FilePath: /desktop_archievement_backend/src/main/java/com/cpic/xim/web/controllers/rewards/RewardProjectsResponse.java
|
||||||
|
* @Description: 奖励项目请求结果
|
||||||
|
*
|
||||||
|
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||||
|
*/
|
||||||
|
package com.cpic.xim.web.controllers.rewards;
|
||||||
|
|
||||||
|
import com.cpic.xim.mybatis.pojo.RewardProject;
|
||||||
|
import com.cpic.xim.web.controllers.QueryResponse;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
public class RewardProjectsResponse extends QueryResponse
|
||||||
|
{
|
||||||
|
public RewardProjectsResponse( boolean success, String message,
|
||||||
|
ArrayList<RewardProject> rewardList)
|
||||||
|
{
|
||||||
|
super( success, message );
|
||||||
|
|
||||||
|
this.rewardList = rewardList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RewardProjectsResponse()
|
||||||
|
{
|
||||||
|
super();
|
||||||
|
|
||||||
|
this.rewardList = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayList<RewardProject> getRewardList()
|
||||||
|
{
|
||||||
|
return rewardList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRewardList( ArrayList<RewardProject> rewardList )
|
||||||
|
{
|
||||||
|
this.rewardList = rewardList;
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonProperty("rewardList")
|
||||||
|
private ArrayList<RewardProject> rewardList;
|
||||||
|
}
|
|
@ -0,0 +1,109 @@
|
||||||
|
/*
|
||||||
|
* @Author: Kane
|
||||||
|
* @Date: 2023-09-21 16:01:51
|
||||||
|
* @LastEditors: Kane
|
||||||
|
* @FilePath: /desktop_archievement_backend/src/main/java/com/cpic/xim/web/controllers/rewards/UpdateTelsalerRequest.java
|
||||||
|
* @Description:
|
||||||
|
*
|
||||||
|
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.cpic.xim.web.controllers.rewards;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
|
||||||
|
public class UpdateTelsalerRequest
|
||||||
|
{
|
||||||
|
public UpdateTelsalerRequest() {}
|
||||||
|
|
||||||
|
public UpdateTelsalerRequest( int recordID, String rewardIndex, String telsalerName )
|
||||||
|
{
|
||||||
|
this.recordID = recordID;
|
||||||
|
this.rewardIndex = rewardIndex;
|
||||||
|
this.telsalerName = telsalerName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRewardIndex()
|
||||||
|
{
|
||||||
|
return rewardIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRewardIndex( String rewardIndex )
|
||||||
|
{
|
||||||
|
this.rewardIndex = rewardIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTelsalerName()
|
||||||
|
{
|
||||||
|
return telsalerName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTelsalerName( String telsalerName )
|
||||||
|
{
|
||||||
|
this.telsalerName = telsalerName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getRecordID()
|
||||||
|
{
|
||||||
|
return recordID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRecordID( int recordID )
|
||||||
|
{
|
||||||
|
this.recordID = recordID;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString()
|
||||||
|
{
|
||||||
|
return "UpdateTelsalerRequest [recordID=" + recordID + ", rewardIndex=" + rewardIndex
|
||||||
|
+ ", telsalerName=" + telsalerName + "]";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode()
|
||||||
|
{
|
||||||
|
final int prime = 31;
|
||||||
|
int result = 1;
|
||||||
|
result = prime * result + recordID;
|
||||||
|
result = prime * result + ((rewardIndex == null) ? 0 : rewardIndex.hashCode());
|
||||||
|
result = prime * result + ((telsalerName == null) ? 0 : telsalerName.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;
|
||||||
|
UpdateTelsalerRequest other = (UpdateTelsalerRequest) obj;
|
||||||
|
if ( recordID != other.recordID )
|
||||||
|
return false;
|
||||||
|
if ( rewardIndex == null )
|
||||||
|
{
|
||||||
|
if ( other.rewardIndex != null )
|
||||||
|
return false;
|
||||||
|
} else if ( !rewardIndex.equals( other.rewardIndex ) )
|
||||||
|
return false;
|
||||||
|
if ( telsalerName == null )
|
||||||
|
{
|
||||||
|
if ( other.telsalerName != null )
|
||||||
|
return false;
|
||||||
|
} else if ( !telsalerName.equals( other.telsalerName ) )
|
||||||
|
return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonProperty("recordID")
|
||||||
|
private int recordID;
|
||||||
|
|
||||||
|
@JsonProperty("rewardIndex")
|
||||||
|
private String rewardIndex;
|
||||||
|
|
||||||
|
@JsonProperty("telsalerName")
|
||||||
|
private String telsalerName;
|
||||||
|
}
|
|
@ -0,0 +1,25 @@
|
||||||
|
/*
|
||||||
|
* @Author: Kane
|
||||||
|
* @Date: 2023-09-21 11:35:57
|
||||||
|
* @LastEditors: Kane
|
||||||
|
* @FilePath: /desktop_archievement_backend/src/main/java/com/cpic/xim/web/controllers/rewards/UpdateTelsalerResponsense.java
|
||||||
|
* @Description:
|
||||||
|
*
|
||||||
|
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||||
|
*/
|
||||||
|
package com.cpic.xim.web.controllers.rewards;
|
||||||
|
|
||||||
|
import com.cpic.xim.web.controllers.QueryResponse;
|
||||||
|
|
||||||
|
public class UpdateTelsalerResponse extends QueryResponse
|
||||||
|
{
|
||||||
|
public UpdateTelsalerResponse()
|
||||||
|
{
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public UpdateTelsalerResponse( boolean success, String message )
|
||||||
|
{
|
||||||
|
super( success, message );
|
||||||
|
}
|
||||||
|
}
|
|
@ -17,10 +17,14 @@ import javax.servlet.ServletRequest;
|
||||||
import javax.servlet.ServletResponse;
|
import javax.servlet.ServletResponse;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.http.HttpMethod;
|
import org.springframework.http.HttpMethod;
|
||||||
|
|
||||||
public class CrosFilter implements Filter
|
public class CrosFilter implements Filter
|
||||||
{
|
{
|
||||||
|
private static Logger logger = LoggerFactory.getLogger(CrosFilter.class);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void doFilter( ServletRequest req, ServletResponse resp, FilterChain chain )
|
public void doFilter( ServletRequest req, ServletResponse resp, FilterChain chain )
|
||||||
throws ServletException, IOException
|
throws ServletException, IOException
|
||||||
|
@ -30,7 +34,7 @@ public class CrosFilter implements Filter
|
||||||
String method = request.getMethod();
|
String method = request.getMethod();
|
||||||
String originHeader = request.getHeader( "Origin" );
|
String originHeader = request.getHeader( "Origin" );
|
||||||
|
|
||||||
System.out.println( "收到" + method + "请求,来自" + originHeader);
|
logger.info( "收到" + method + "请求,来自" + originHeader);
|
||||||
|
|
||||||
// 如果是Options请求
|
// 如果是Options请求
|
||||||
if ( method.equals(HttpMethod.OPTIONS.toString()) )
|
if ( method.equals(HttpMethod.OPTIONS.toString()) )
|
||||||
|
|
|
@ -0,0 +1,28 @@
|
||||||
|
<Configuration status="WARN" monitorInterval="300">
|
||||||
|
<Appenders>
|
||||||
|
<Console name="Console" target="SYSTEM_OUT">
|
||||||
|
<PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} ### %msg%n" />
|
||||||
|
<ThresholdFilter level="trace" onMatch="ACCEPT" onMismatch="DENY" />
|
||||||
|
</Console>
|
||||||
|
<RollingFile name="rolling_file" filename="d:/logs/桌面霸屏/app.log"
|
||||||
|
filePattern="d:/logs/桌面霸屏/logs/$${date:yyyy-MM}/app-%d{MM-dd-yyyy}-%i.log.gz">
|
||||||
|
<PatternLayout>
|
||||||
|
<Pattern>[%t][%level][%d{HH:mm:ss.SSS}][%logger.%M{36}#%L] %msg%n</Pattern>
|
||||||
|
</PatternLayout>
|
||||||
|
<Policies>
|
||||||
|
<TimeBasedTriggeringPolicy interval="1" />
|
||||||
|
<SizeBasedTriggeringPolicy size="20MB" />
|
||||||
|
<DefaultRolloverStrategy max="20" />
|
||||||
|
</Policies>
|
||||||
|
</RollingFile>
|
||||||
|
</Appenders>
|
||||||
|
<Loggers>
|
||||||
|
<!-- <Logger name="mylog" level="info">
|
||||||
|
<AppenderRef ref="rolling_file" />
|
||||||
|
</Logger> -->
|
||||||
|
<Root level="debug">
|
||||||
|
<AppenderRef ref="rolling_file" />
|
||||||
|
<AppenderRef ref="Console" />
|
||||||
|
</Root>
|
||||||
|
</Loggers>
|
||||||
|
</Configuration>
|
|
@ -0,0 +1,4 @@
|
||||||
|
jdbc.oracle.driver=oracle.jdbc.driver.OracleDriver
|
||||||
|
jdbc.oracle.xmcx1.url=jdbc:oracle:thin:@10.39.0.86:1521:xmcx1
|
||||||
|
jdbc.oracle.xmcx1.username=desktop_archievement_admin
|
||||||
|
jdbc.oracle.xmcx1.password=Cpic123456
|
|
@ -0,0 +1,25 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "https://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.cpic.xim.mybatis.mapper.ArchievementMapper">
|
||||||
|
<select id="getDepartmentArchievement" flushCache="true" statementType="CALLABLE" parameterType="java.util.HashMap">
|
||||||
|
call telsale_archievement_pkg.department_archievement(
|
||||||
|
#{a_department_code, mode=IN, jdbcType=VARCHAR},
|
||||||
|
#{a_attaching_rate, mode=OUT, jdbcType=VARCHAR},
|
||||||
|
#{a_renewal_rate, mode=OUT, jdbcType=VARCHAR},
|
||||||
|
#{a_total, mode=OUT, jdbcType=INTEGER, javaType=Integer},
|
||||||
|
#{a_mensual_cur, mode=OUT, jdbcType=CURSOR, resultMap=MensualArchievementMapper})
|
||||||
|
</select>
|
||||||
|
<select id="getCallerArchievement" flushCache="true" statementType="CALLABLE" parameterType="java.util.HashMap">
|
||||||
|
call telsale_archievement_pkg.caller_archievement(
|
||||||
|
#{a_caller_code, mode=IN, jdbcType=VARCHAR},
|
||||||
|
#{a_attaching_rate, mode=OUT, jdbcType=VARCHAR},
|
||||||
|
#{a_renewal_rate, mode=OUT, jdbcType=VARCHAR},
|
||||||
|
#{a_total, mode=OUT, jdbcType=INTEGER, javaType=Integer},
|
||||||
|
#{a_mensual_cur, mode=OUT, jdbcType=CURSOR, resultMap=MensualArchievementMapper})
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<resultMap id="MensualArchievementMapper" type="MensualArchievementItem">
|
||||||
|
<id property="month" column="mm" javaType="INT"/>
|
||||||
|
<result property="premium" column="bf" />
|
||||||
|
</resultMap>
|
||||||
|
</mapper>
|
|
@ -0,0 +1,22 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "https://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.cpic.xim.mybatis.mapper.RankingListMapper">
|
||||||
|
<select id="getRankingList" flushCache="true" statementType="CALLABLE" parameterType="java.util.HashMap">
|
||||||
|
call telsale_archievement_pkg.caller_arch_ranking_list(
|
||||||
|
#{a_department_code,mode=IN,jdbcType=VARCHAR},
|
||||||
|
#{a_year,mode=IN,jdbcType=VARCHAR},
|
||||||
|
#{a_month,mode=IN,jdbcType=VARCHAR},
|
||||||
|
#{a_attaching_ranking_list,mode=OUT,jdbcType=CURSOR, resultMap=AttachingRateRankingMap},
|
||||||
|
#{a_renewal_ranking_list,mode=OUT,jdbcType=CURSOR, resultMap=RenewalRateRankingMap})
|
||||||
|
</select>
|
||||||
|
<resultMap id="AttachingRateRankingMap" type="CallerRankingItem">
|
||||||
|
<id property="index" column="rownum" jdbcType="INTEGER" javaType="int"/>
|
||||||
|
<result property="callerName" column="caller_name" jdbcType="VARCHAR" javaType="String"/>
|
||||||
|
<result property="appraiseValue" column="attaching_rate" jdbcType="VARCHAR" javaType="String"/>
|
||||||
|
</resultMap>
|
||||||
|
<resultMap id="RenewalRateRankingMap" type="CallerRankingItem">
|
||||||
|
<id property="index" column="rownum" jdbcType="INTEGER" javaType="int"/>
|
||||||
|
<result property="callerName" column="caller_name" jdbcType="VARCHAR" javaType="String"/>
|
||||||
|
<result property="appraiseValue" column="renewal_rate" jdbcType="VARCHAR" javaType="String"/>
|
||||||
|
</resultMap>
|
||||||
|
</mapper>
|
|
@ -0,0 +1,50 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "https://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.cpic.xim.mybatis.mapper.RewardsMapper">
|
||||||
|
<select id="queryRewardProjects" resultMap="RewardProjectMap">
|
||||||
|
select reward_index, reward_name from reward_projects order by reward_index desc
|
||||||
|
</select>
|
||||||
|
<resultMap id="RewardProjectMap" type="com.cpic.xim.mybatis.pojo.RewardProject">
|
||||||
|
<id property="rewardCode" column="reward_index" />
|
||||||
|
<result property="rewardName" column="reward_name" javaType="String"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<select id="queryRewardTelsaler" flushCache="true" resultMap="RewardGainerMapper">
|
||||||
|
SELECT hjr.rec_id rec_id,
|
||||||
|
hjr.telsaler_name telsaler_name,
|
||||||
|
hjr.telsaler_code telsaler_code,
|
||||||
|
xm.reward_name reward_name,
|
||||||
|
xm.reward_index reward_index
|
||||||
|
FROM telsaler_reward hjr,
|
||||||
|
reward_projects xm
|
||||||
|
WHERE hjr.reward_index = xm.reward_index
|
||||||
|
order by xm.reward_index desc
|
||||||
|
</select>
|
||||||
|
<resultMap id="RewardGainerMapper" type="com.cpic.xim.mybatis.pojo.RewardGainer">
|
||||||
|
<id column="rec_id" property="recID" />
|
||||||
|
<result column="telsaler_name" property="callerName" />
|
||||||
|
<result column="telsaler_code" property="callerCode" />
|
||||||
|
<result column="reward_name" property="rewardProjectName" />
|
||||||
|
<result column="reward_index" property="rewardProjectCode" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<select id="addRewardTelSaler" flushCache="true" statementType="CALLABLE" parameterType="java.util.HashMap">
|
||||||
|
call telsaler_reward_pkg.add_telsaler_reward(
|
||||||
|
#{a_reward_index,mode=IN,jdbcType=VARCHAR},
|
||||||
|
#{a_telsaler_name,mode=IN,jdbcType=VARCHAR})
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 删除获奖坐席记录 -->
|
||||||
|
<select id="deleteRewardTelSaler" flushCache="true" statementType="CALLABLE" parameterType="java.util.HashMap">
|
||||||
|
call telsaler_reward_pkg.delete_telsaler_reward(
|
||||||
|
#{a_rec_id,mode=IN,jdbcType=INTEGER})
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 更新获奖坐席 -->
|
||||||
|
<select id="updateRewardTelSaler" statementType="CALLABLE" flushCache="true" parameterType="java.util.HashMap" >
|
||||||
|
call telsaler_reward_pkg.update_telsaler_reward(
|
||||||
|
#{a_rec_id,mode=IN,jdbcType=INTEGER},
|
||||||
|
#{a_telsaler_name,mode=IN,jdbcType=VARCHAR},
|
||||||
|
#{a_reward_index,mode=IN,jdbcType=VARCHAR})
|
||||||
|
</select>
|
||||||
|
</mapper>
|
|
@ -0,0 +1,37 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "https://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.cpic.xim.mybatis.mapper.StaffMapper">
|
||||||
|
<select id="queryCpicStaff" resultMap="CpicXIMStaff" >
|
||||||
|
SELECT ry.p13uid,
|
||||||
|
ry.staff_code,
|
||||||
|
ry.staff_name,
|
||||||
|
bm.department_code,
|
||||||
|
bm.department_name,
|
||||||
|
ksh.section_office_code,
|
||||||
|
ksh.section_office_name
|
||||||
|
FROM idst0.rydm_t ry,
|
||||||
|
idst0.ks_t ksh,
|
||||||
|
idst0.bm_t bm
|
||||||
|
WHERE ry.staff_code = #{staffCode,mode=IN}
|
||||||
|
AND ry.department_code = bm.department_code
|
||||||
|
AND ry.section_office_code = ksh.section_office_code
|
||||||
|
</select>
|
||||||
|
<resultMap id="CpicXIMStaff" type="com.cpic.xim.mybatis.pojo.CpicStaff">
|
||||||
|
<!-- <constructor>
|
||||||
|
<arg column="p13uid" name="p13uid"/>
|
||||||
|
<arg column="staff_code" name="staffCode"/>
|
||||||
|
<arg column="staff_name" name="staffName"/>
|
||||||
|
<arg column="department_code" name="departmentCode"/>
|
||||||
|
<arg column="department_name" name="departmentName"/>
|
||||||
|
<arg column="section_office_code" name="sectionOfficeCode"/>
|
||||||
|
<arg column="section_office_name" name="sectionOfficeName"/>
|
||||||
|
</constructor> -->
|
||||||
|
<id property="staffCode" column="staff_code"/>
|
||||||
|
<result property="staffName" column="staff_name"/>
|
||||||
|
<result property="p13UID" column="p13uid"/>
|
||||||
|
<result property="departmentCode" column="department_code"/>
|
||||||
|
<result property="departmentName" column="department_name"/>
|
||||||
|
<result property="sectionOfficeCode" column="section_office_code"/>
|
||||||
|
<result property="sectionOfficeName" column="section_office_name"/>
|
||||||
|
</resultMap>
|
||||||
|
</mapper>
|
|
@ -0,0 +1,30 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "https://mybatis.org/dtd/mybatis-3-config.dtd">
|
||||||
|
<configuration>
|
||||||
|
<properties resource="mybatis/jdbc.properties" />
|
||||||
|
|
||||||
|
<!-- 类型别名 -->
|
||||||
|
<typeAliases>
|
||||||
|
<package name="com.cpic.xim.mybatis.pojo" />
|
||||||
|
<package name="com.cpic.xim.utils.ranking" />
|
||||||
|
</typeAliases>
|
||||||
|
|
||||||
|
<environments default="development">
|
||||||
|
<environment id="development">
|
||||||
|
<transactionManager type="JDBC" />
|
||||||
|
<dataSource type="POOLED">
|
||||||
|
<property name="driver" value="${jdbc.oracle.driver}" />
|
||||||
|
<property name="url" value="${jdbc.oracle.xmcx1.url}" />
|
||||||
|
<property name="username" value="${jdbc.oracle.xmcx1.username}" />
|
||||||
|
<property name="password" value="${jdbc.oracle.xmcx1.password}" />
|
||||||
|
</dataSource>
|
||||||
|
</environment>
|
||||||
|
</environments>
|
||||||
|
|
||||||
|
<mappers>
|
||||||
|
<!-- <mapper resource="mybatis/mapper/StaffMapper.xml" /> -->
|
||||||
|
<mapper resource="mybatis/mapper/ArchievementMapper.xml" />
|
||||||
|
<mapper resource="mybatis/mapper/RankingListMapper.xml" />
|
||||||
|
<mapper resource="mybatis/mapper/RewardsMapper.xml" />
|
||||||
|
</mappers>
|
||||||
|
</configuration>
|
|
@ -9,46 +9,154 @@
|
||||||
*/
|
*/
|
||||||
package com.cpic.xim.DesktopArchievement.test;
|
package com.cpic.xim.DesktopArchievement.test;
|
||||||
|
|
||||||
import java.sql.SQLException;
|
import static org.junit.Assert.assertNotNull;
|
||||||
|
import static org.junit.Assert.assertTrue;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import org.apache.ibatis.io.Resources;
|
||||||
|
import org.apache.ibatis.session.SqlSession;
|
||||||
|
import org.apache.ibatis.session.SqlSessionFactory;
|
||||||
|
import org.apache.ibatis.session.SqlSessionFactoryBuilder;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import com.cpic.xim.utils.archievement.DepartmentArchievement;
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import com.cpic.xim.mybatis.mapper.ArchievementMapper;
|
||||||
|
import com.cpic.xim.mybatis.mapper.RewardsMapper;
|
||||||
|
import com.cpic.xim.mybatis.pojo.MensualArchievementItem;
|
||||||
|
import com.cpic.xim.mybatis.pojo.RewardGainer;
|
||||||
|
import com.cpic.xim.mybatis.pojo.RewardProject;
|
||||||
|
import com.cpic.xim.mybatis.utils.MybatisUtils;
|
||||||
import com.cpic.xim.utils.ranking.CallerRankingList;
|
import com.cpic.xim.utils.ranking.CallerRankingList;
|
||||||
|
|
||||||
@SuppressWarnings("all")
|
@SuppressWarnings( "all" )
|
||||||
public class DesktopArchievementTest
|
public class DesktopArchievementTest
|
||||||
{
|
{
|
||||||
@Test
|
private static String configFilePath = "mybatis/mybatis-config.xml";
|
||||||
public void testQueryArchievement()
|
private static Logger logger = LoggerFactory.getLogger( DesktopArchievementTest.class );
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
DepartmentArchievement.queryDepartmentArchievement( "QDI" );
|
|
||||||
}
|
|
||||||
catch ( SQLException error )
|
|
||||||
{
|
|
||||||
System.out.println( error.getMessage() );
|
|
||||||
}
|
|
||||||
catch ( ClassNotFoundException error )
|
|
||||||
{
|
|
||||||
System.out.println( error.getMessage() );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testCallerRankingList()
|
public void testCallerRankingList()
|
||||||
{
|
{
|
||||||
|
CallerRankingList rankingList = null;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
CallerRankingList rankingList =
|
rankingList = CallerRankingList.getCallerRankingList( "QDI", "2023", "06" );
|
||||||
CallerRankingList.getCallerRankingList( "QDI", "2023", "05" );
|
|
||||||
}
|
}
|
||||||
catch ( SQLException error )
|
catch ( IOException error )
|
||||||
{
|
{
|
||||||
error.printStackTrace();
|
String message = "获取排行榜失败,原因:" + error.getMessage();
|
||||||
|
|
||||||
|
logger.error( message, error );
|
||||||
}
|
}
|
||||||
catch ( ClassNotFoundException error )
|
|
||||||
|
assertNotNull( rankingList );
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testDepartmentArchievement()
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
error.printStackTrace();
|
InputStream configFile = Resources.getResourceAsStream( configFilePath );
|
||||||
|
SqlSessionFactoryBuilder builder = new SqlSessionFactoryBuilder();
|
||||||
|
SqlSessionFactory factory = builder.build( configFile );
|
||||||
|
SqlSession session = factory.openSession();
|
||||||
|
|
||||||
|
ArchievementMapper mapper = session.getMapper( ArchievementMapper.class );
|
||||||
|
ArrayList<MensualArchievementItem> mensual = null;
|
||||||
|
HashMap<String, Object> params = new HashMap<>();
|
||||||
|
|
||||||
|
params.put( "a_department_code", "QDI" );
|
||||||
|
|
||||||
|
mapper.getDepartmentArchievement( params );
|
||||||
|
|
||||||
|
mensual = (ArrayList<MensualArchievementItem>) params.get( "a_mensual_cur" );
|
||||||
|
Integer total = (Integer) params.get( "a_total" );
|
||||||
|
|
||||||
|
System.out.println( params.toString() );
|
||||||
|
System.out.println( mensual.toString() );
|
||||||
|
|
||||||
|
assertTrue( params.size() > 1 );
|
||||||
|
}
|
||||||
|
catch ( IOException error )
|
||||||
|
{
|
||||||
|
assert (false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testCallerArchievement()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
SqlSession session = MybatisUtils.getSqlSession();
|
||||||
|
ArchievementMapper mapper = session.getMapper( ArchievementMapper.class );
|
||||||
|
|
||||||
|
ArrayList<MensualArchievementItem> mensual = null;
|
||||||
|
HashMap<String, Object> params = new HashMap<>();
|
||||||
|
|
||||||
|
params.put( "a_caller_code", "61136" );
|
||||||
|
|
||||||
|
mapper.getCallerArchievement( params );
|
||||||
|
|
||||||
|
Object obj = params.get( "a_mensual_cur" );
|
||||||
|
mensual = (ArrayList<MensualArchievementItem>) params.get( "a_mensual_cur" );
|
||||||
|
|
||||||
|
System.out.println( params.toString() );
|
||||||
|
System.out.println( mensual.toString() );
|
||||||
|
System.out.println( obj.getClass() );
|
||||||
|
|
||||||
|
assertTrue( params.size() > 1 );
|
||||||
|
}
|
||||||
|
catch ( IOException error )
|
||||||
|
{
|
||||||
|
assert (false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testRewardProjects()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
SqlSession session = MybatisUtils.getSqlSession();
|
||||||
|
RewardsMapper mapper = session.getMapper( RewardsMapper.class );
|
||||||
|
|
||||||
|
ArrayList<RewardProject> rewards = mapper.queryRewardProjects();
|
||||||
|
|
||||||
|
System.out.println( rewards );
|
||||||
|
assert (rewards.isEmpty() == false);
|
||||||
|
|
||||||
|
}
|
||||||
|
catch ( IOException error )
|
||||||
|
{
|
||||||
|
assert (false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testQueryGainers()
|
||||||
|
{
|
||||||
|
SqlSession session = null;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
session = MybatisUtils.getSqlSession();
|
||||||
|
RewardsMapper mapper = session.getMapper( RewardsMapper.class );
|
||||||
|
|
||||||
|
ArrayList<RewardGainer> gainers = mapper.queryRewardTelsaler();
|
||||||
|
|
||||||
|
System.out.println( gainers );
|
||||||
|
|
||||||
|
assert( gainers != null );
|
||||||
|
}
|
||||||
|
catch ( IOException error )
|
||||||
|
{
|
||||||
|
System.out.println( error.getMessage() );
|
||||||
|
assert (false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue