Compare commits
24 Commits
a5b008f056
...
feature-pe
Author | SHA1 | Date | |
---|---|---|---|
bc7e56c336 | |||
f54f6bbfea | |||
21a50f4c61 | |||
075da72a73 | |||
ae68f047f4 | |||
7c5da24f5a | |||
4d03abde27 | |||
08ea359cd1 | |||
8e0505bd49 | |||
a74e612546 | |||
42c2e8bdf7 | |||
83be988941 | |||
2a92179adf | |||
9976c852ba | |||
fd59698264 | |||
f5a53e2f55 | |||
5b6285993f | |||
b2a973f7bd | |||
dcc925bb41 | |||
8fd60d6b24 | |||
090a551066 | |||
9483b49a20 | |||
e436fbf89e | |||
0875919b5f |
@@ -8,7 +8,10 @@ CREATE OR REPLACE PACKAGE telsale_archievement_pkg IS
|
|||||||
|
|
||||||
-- <20>쳣
|
-- <20>쳣
|
||||||
DEPARTMENTCODE_EXCEPTION_CODE CONSTANT INTEGER := -20000;
|
DEPARTMENTCODE_EXCEPTION_CODE CONSTANT INTEGER := -20000;
|
||||||
DEPARTMENTCODE_EXCEPTION_MSG CONSTANT VARCHAR2(100) := '<27><><EFBFBD>Ŵ<EFBFBD><C5B4><EFBFBD><EFBFBD><EFBFBD>Ч';
|
DEPARTMENTCODE_EXCEPTION_MSG CONSTANT VARCHAR2(100) := '<27><><EFBFBD>Ŵ<EFBFBD><C5B4><EFBFBD><EFBFBD><EFBFBD>Ч<EFBFBD><EFBFBD>';
|
||||||
|
|
||||||
|
CALLERCODE_EXCEPTION_CODE CONSTANT INTEGER := -20001;
|
||||||
|
CALLERCODE_EXCEPTION_MSG CONSTANT VARCHAR2(100) := '<27><>ϯ<EFBFBD><CFAF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ч<EFBFBD><D0A7>';
|
||||||
|
|
||||||
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,147 +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
|
||||||
|
|
||||||
-- <20><><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5>
|
-- <20><><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5>
|
||||||
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');
|
||||||
-- <20><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
-- <20><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
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
|
||||||
-- <20><><EFBFBD><EFBFBD>û<EFBFBD><C3BB><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƣ<EFBFBD>˵<EFBFBD><CBB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>׳<EFBFBD><D7B3>쳣
|
-- <20><><EFBFBD><EFBFBD>û<EFBFBD><C3BB><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƣ<EFBFBD>˵<EFBFBD><CBB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>׳<EFBFBD><D7B3>쳣
|
||||||
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;
|
||||||
|
--<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><CDB8>
|
||||||
|
SELECT DECODE(SUM(CF.<2E><><EFBFBD>ո<EFBFBD><D5B8>˿ͻ<CBBF><CDBB><EFBFBD><EFBFBD><EFBFBD>),
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
ROUND((SUM(CF.<2E><><EFBFBD><EFBFBD><EFBFBD>ںϱ<DABA><CFB1><EFBFBD>) / SUM(CF.<2E><><EFBFBD>ո<EFBFBD><D5B8>˿ͻ<CBBF><CDBB><EFBFBD><EFBFBD><EFBFBD>) * 100),
|
||||||
|
2))
|
||||||
|
INTO A_ATTACHING_RATE
|
||||||
|
FROM <20><>ϯ<EFBFBD><CFAF><EFBFBD><EFBFBD>ÿ<EFBFBD>ձ<EFBFBD><D5B1><EFBFBD> CF
|
||||||
|
WHERE CF.<2E>·<EFBFBD> = L_THIS_MONTH
|
||||||
|
AND CF.<2E><><EFBFBD><EFBFBD> = L_THIS_YEAR
|
||||||
|
AND <20><><EFBFBD>Ŵ<EFBFBD><C5B4><EFBFBD> = A_DEPARTMENT_CODE;
|
||||||
|
--<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
SELECT DECODE(SUM(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>),
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
ROUND(SUM(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ۼ<EFBFBD>) / SUM(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) * 100,
|
||||||
|
2))
|
||||||
|
INTO A_RENEWAL_RATE
|
||||||
|
FROM <20><>ϯ<EFBFBD><CFAF><EFBFBD><EFBFBD>ͳ<EFBFBD><CDB3>
|
||||||
|
WHERE <20><><EFBFBD><EFBFBD> = L_DEPARTMENT_NAME;
|
||||||
|
--<2D><>ҵ<EFBFBD><D2B5>
|
||||||
|
SELECT ROUND(NVL(SUM(CF.<2E><><EFBFBD>ո<EFBFBD><D5B8>˿ͻ<CBBF><CDBB><EFBFBD><EFBFBD><EFBFBD> + CF.<2E><><EFBFBD><EFBFBD><EFBFBD>ںϱ<DABA><CFB1><EFBFBD>),
|
||||||
|
0),
|
||||||
|
0)
|
||||||
|
INTO A_TOTAL
|
||||||
|
FROM <20><>ϯ<EFBFBD><CFAF><EFBFBD><EFBFBD>ÿ<EFBFBD>ձ<EFBFBD><D5B1><EFBFBD> CF
|
||||||
|
WHERE <20><><EFBFBD>Ŵ<EFBFBD><C5B4><EFBFBD> = A_DEPARTMENT_CODE
|
||||||
|
AND ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD> >= L_FIRSTDAY
|
||||||
|
AND ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <= SYSDATE;
|
||||||
|
--ÿ<><C3BF>ҵ<EFBFBD><D2B5>
|
||||||
|
OPEN A_MENSUAL_CUR FOR
|
||||||
|
SELECT CF.<2E>·<EFBFBD> MM,
|
||||||
|
ROUND(NVL(SUM(CF.<2E><><EFBFBD>ո<EFBFBD><D5B8>˿ͻ<CBBF><CDBB><EFBFBD><EFBFBD><EFBFBD> + CF.<2E><><EFBFBD><EFBFBD><EFBFBD>ںϱ<DABA><CFB1><EFBFBD>) / 10000,
|
||||||
|
0),
|
||||||
|
0) BF
|
||||||
|
FROM <20><>ϯ<EFBFBD><CFAF><EFBFBD><EFBFBD>ÿ<EFBFBD>ձ<EFBFBD><D5B1><EFBFBD> CF
|
||||||
|
WHERE <20><><EFBFBD>Ŵ<EFBFBD><C5B4><EFBFBD> = A_DEPARTMENT_CODE
|
||||||
|
AND ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD> >= TO_DATE(TO_CHAR(SYSDATE,
|
||||||
|
'yyyy') || '-01-01 00:00:00',
|
||||||
|
'yyyy-mm-dd hh24:mi:ss')
|
||||||
|
AND ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD> < TO_DATE(TO_CHAR(SYSDATE,
|
||||||
|
'yyyy-mm') || '-01 00:00:00',
|
||||||
|
'yyyy-mm-dd hh24:mi:ss')
|
||||||
|
GROUP BY CF.<2E>·<EFBFBD>
|
||||||
|
ORDER BY CF.<2E>·<EFBFBD>;
|
||||||
|
END;
|
||||||
|
|
||||||
|
/*******************************************************/
|
||||||
|
-- <20><>ϯҵ<CFAF><D2B5>
|
||||||
|
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
|
||||||
|
--<2D><>ѯ<EFBFBD><D1AF>ϯ<EFBFBD><CFAF><EFBFBD>ƣ<EFBFBD><C6A3><EFBFBD>֤<EFBFBD><D6A4><EFBFBD><EFBFBD>
|
||||||
|
BEGIN
|
||||||
|
SELECT saler_name
|
||||||
|
INTO l_caller_name
|
||||||
|
FROM tele_saler
|
||||||
|
WHERE saler_code = a_caller_code;
|
||||||
|
EXCEPTION
|
||||||
|
-- <20><><EFBFBD><EFBFBD>û<EFBFBD>в<EFBFBD>ѯ<EFBFBD><D1AF><EFBFBD><EFBFBD>ϯ<EFBFBD><CFAF><EFBFBD>ƣ<EFBFBD>˵<EFBFBD><CBB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>׳<EFBFBD><D7B3>쳣
|
||||||
|
WHEN no_data_found THEN
|
||||||
|
raise_application_error(CALLERCODE_EXCEPTION_CODE,
|
||||||
|
CALLERCODE_EXCEPTION_MSG);
|
||||||
END;
|
END;
|
||||||
|
|
||||||
--<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><CDB8>
|
l_this_month := to_char(SYSDATE,
|
||||||
SELECT decode(SUM(cf.<2E><><EFBFBD>ո<EFBFBD><D5B8>˿ͻ<CBBF><CDBB><EFBFBD><EFBFBD><EFBFBD>),
|
'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');
|
||||||
|
|
||||||
|
--<2D>ܳ<EFBFBD><DCB3>ձ<EFBFBD><D5B1><EFBFBD>
|
||||||
|
SELECT round(nvl(SUM(cf.<2E><><EFBFBD>ո<EFBFBD><D5B8>˿ͻ<CBBF><CDBB><EFBFBD><EFBFBD><EFBFBD>),
|
||||||
|
0),
|
||||||
|
2) bf
|
||||||
|
INTO a_total
|
||||||
|
FROM <20><>ϯ<EFBFBD><CFAF><EFBFBD><EFBFBD>ÿ<EFBFBD>ձ<EFBFBD><D5B1><EFBFBD> cf
|
||||||
|
WHERE cf.<2E><>ϯ<EFBFBD><CFAF><EFBFBD><EFBFBD> = a_caller_code
|
||||||
|
AND cf.<2E><><EFBFBD><EFBFBD> = l_this_year;
|
||||||
|
|
||||||
|
--<2D><><EFBFBD><CDB8>
|
||||||
|
SELECT decode(nvl(SUM(cf.<2E><><EFBFBD>ո<EFBFBD><D5B8>˿ͻ<CBBF><CDBB><EFBFBD><EFBFBD><EFBFBD>),
|
||||||
|
0),
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
round((SUM(cf.<2E><><EFBFBD><EFBFBD><EFBFBD>ںϱ<DABA><CFB1><EFBFBD>) / SUM(cf.<2E><><EFBFBD>ո<EFBFBD><D5B8>˿ͻ<CBBF><CDBB><EFBFBD><EFBFBD><EFBFBD>) * 100),
|
round(SUM(cf.<2E><><EFBFBD><EFBFBD><EFBFBD>ںϱ<DABA><CFB1><EFBFBD>) / SUM(cf.<2E><><EFBFBD>ո<EFBFBD><D5B8>˿ͻ<CBBF><CDBB><EFBFBD><EFBFBD><EFBFBD>) * 100,
|
||||||
2))
|
2))
|
||||||
INTO a_attaching_rate
|
INTO a_attaching_rate
|
||||||
FROM <20><>ϯ<EFBFBD><CFAF><EFBFBD><EFBFBD>ÿ<EFBFBD>ձ<EFBFBD><D5B1><EFBFBD> cf
|
FROM <20><>ϯ<EFBFBD><CFAF><EFBFBD><EFBFBD>ÿ<EFBFBD>ձ<EFBFBD><D5B1><EFBFBD> cf
|
||||||
WHERE cf.<2E>·<EFBFBD> = l_this_month
|
WHERE cf.<2E><EFBFBD>ϯ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> = a_caller_code
|
||||||
AND cf.<2E><><EFBFBD><EFBFBD> = l_this_year
|
AND cf.<2E><><EFBFBD><EFBFBD> = l_this_year
|
||||||
AND <EFBFBD><EFBFBD><EFBFBD>Ŵ<EFBFBD><EFBFBD><EFBFBD> = a_department_code;
|
AND cf.<2E>·<EFBFBD> = l_this_month;
|
||||||
|
|
||||||
--<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
--<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
SELECT decode(SUM(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>),
|
SELECT decode(nvl(SUM(xb.<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>),
|
||||||
|
0),
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
round(SUM(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ۼ<EFBFBD>) / SUM(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) * 100,
|
round(SUM(xb.<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ۼ<EFBFBD>) / SUM(xb.<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) * 100,
|
||||||
2))
|
2)) xbl
|
||||||
INTO a_renewal_rate
|
INTO a_renewal_rate
|
||||||
FROM <20><>ϯ<EFBFBD><CFAF><EFBFBD><EFBFBD>ͳ<EFBFBD><CDB3>
|
FROM <20><>ϯ<EFBFBD><CFAF><EFBFBD><EFBFBD>ͳ<EFBFBD><CDB3> xb
|
||||||
WHERE <20><><EFBFBD><EFBFBD> = l_department_name;
|
WHERE xb.<2E><>ϯ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> = a_caller_code;
|
||||||
|
|
||||||
--<2D><>ҵ<EFBFBD><D2B5>
|
|
||||||
SELECT round(nvl(SUM(cf.<2E><><EFBFBD>ո<EFBFBD><D5B8>˿ͻ<CBBF><CDBB><EFBFBD><EFBFBD><EFBFBD> + cf.<2E><><EFBFBD><EFBFBD><EFBFBD>ںϱ<DABA><CFB1><EFBFBD>),
|
|
||||||
0),
|
|
||||||
0)
|
|
||||||
INTO a_total
|
|
||||||
FROM <20><>ϯ<EFBFBD><CFAF><EFBFBD><EFBFBD>ÿ<EFBFBD>ձ<EFBFBD><D5B1><EFBFBD> cf
|
|
||||||
WHERE <20><><EFBFBD>Ŵ<EFBFBD><C5B4><EFBFBD> = a_department_code
|
|
||||||
AND ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD> >= l_firstday
|
|
||||||
AND ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <= SYSDATE;
|
|
||||||
|
|
||||||
--ÿ<><C3BF>ҵ<EFBFBD><D2B5>
|
--ÿ<><C3BF>ҵ<EFBFBD><D2B5>
|
||||||
OPEN a_mensual_cur FOR
|
OPEN A_MENSUAL_CUR FOR
|
||||||
SELECT cf.<2E>·<EFBFBD> mm,
|
SELECT CF.<2E>·<EFBFBD> MM,
|
||||||
round(nvl(SUM(cf.<2E><><EFBFBD>ո<EFBFBD><D5B8>˿ͻ<CBBF><CDBB><EFBFBD><EFBFBD><EFBFBD> + cf.<2E><><EFBFBD><EFBFBD><EFBFBD>ںϱ<DABA><CFB1><EFBFBD>) / 10000,
|
ROUND(NVL(SUM(CF.<2E><><EFBFBD>ո<EFBFBD><D5B8>˿ͻ<CBBF><CDBB><EFBFBD><EFBFBD><EFBFBD> + CF.<2E><><EFBFBD><EFBFBD><EFBFBD>ںϱ<DABA><CFB1><EFBFBD>),
|
||||||
0),
|
0),
|
||||||
0) bf
|
0) BF
|
||||||
FROM <20><>ϯ<EFBFBD><CFAF><EFBFBD><EFBFBD>ÿ<EFBFBD>ձ<EFBFBD><D5B1><EFBFBD> cf
|
FROM <20><>ϯ<EFBFBD><CFAF><EFBFBD><EFBFBD>ÿ<EFBFBD>ձ<EFBFBD><D5B1><EFBFBD> CF
|
||||||
WHERE <20><EFBFBD><EFBFBD>Ŵ<EFBFBD><EFBFBD><EFBFBD> = a_department_code
|
WHERE cf.<2E><>ϯ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> = a_caller_code
|
||||||
AND ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD> >= to_date(to_char(SYSDATE,
|
AND ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD> >= 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 ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD> < to_date(to_char(SYSDATE,
|
AND ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <= SYSDATE
|
||||||
'yyyy-mm') || '-01 00:00:00',
|
GROUP BY CF.<2E>·<EFBFBD>
|
||||||
'yyyy-mm-dd hh24:mi:ss')
|
ORDER BY CF.<2E>·<EFBFBD>;
|
||||||
GROUP BY cf.<2E>·<EFBFBD>
|
|
||||||
ORDER BY cf.<2E>·<EFBFBD>;
|
|
||||||
END;
|
END;
|
||||||
|
|
||||||
/*******************************************************/
|
/*******************************************************/
|
||||||
-- <20><>ϯ<EFBFBD><CFAF><EFBFBD>а<EFBFBD>
|
-- <20><>ϯ<EFBFBD><CFAF><EFBFBD>а<EFBFBD>
|
||||||
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
|
||||||
-- <20><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
-- <20><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
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
|
||||||
-- <20><><EFBFBD><EFBFBD>û<EFBFBD><C3BB><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƣ<EFBFBD>˵<EFBFBD><CBB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>׳<EFBFBD><D7B3>쳣
|
-- <20><><EFBFBD><EFBFBD>û<EFBFBD><C3BB><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƣ<EFBFBD>˵<EFBFBD><CBB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>׳<EFBFBD><D7B3>쳣
|
||||||
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;
|
||||||
|
-- <20><><EFBFBD><EFBFBD><EFBFBD>ں<EFBFBD><DABA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>а<EFBFBD>
|
||||||
-- <20><><EFBFBD><EFBFBD><EFBFBD>ں<EFBFBD><DABA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>а<EFBFBD>
|
OPEN A_ATTACHING_RANKING_LIST FOR
|
||||||
OPEN a_attaching_ranking_list FOR
|
SELECT ROWNUM,
|
||||||
SELECT <20><>ϯ<EFBFBD><CFAF><EFBFBD><EFBFBD>,
|
<20><>ϯ<EFBFBD><CFAF><EFBFBD><EFBFBD> AS CALLER_NAME,
|
||||||
round(decode(SUM(<EFBFBD><EFBFBD><EFBFBD>ո<EFBFBD><EFBFBD>˿ͻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>),
|
<20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> AS ATTACHING_RATE
|
||||||
0,
|
FROM (SELECT <20><>ϯ<EFBFBD><CFAF><EFBFBD><EFBFBD>,
|
||||||
0,
|
ROUND(DECODE(nvl(SUM(<28><><EFBFBD>ո<EFBFBD><D5B8>˿ͻ<CBBF><CDBB><EFBFBD><EFBFBD><EFBFBD>),
|
||||||
(SUM(<28><><EFBFBD><EFBFBD><EFBFBD>ںϱ<DABA><CFB1><EFBFBD>) / SUM(<28><><EFBFBD>ո<EFBFBD><D5B8>˿ͻ<CBBF><CDBB><EFBFBD><EFBFBD><EFBFBD>)) * 100),
|
0),
|
||||||
2) <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><CDB8>
|
0,
|
||||||
FROM <20><>ϯ<EFBFBD><CFAF><EFBFBD><EFBFBD>ÿ<EFBFBD>ձ<EFBFBD><D5B1><EFBFBD>
|
0,
|
||||||
WHERE <20>·<EFBFBD> = a_month
|
(SUM(<28><><EFBFBD><EFBFBD><EFBFBD>ںϱ<DABA><CFB1><EFBFBD>) / SUM(<28><><EFBFBD>ո<EFBFBD><D5B8>˿ͻ<CBBF><CDBB><EFBFBD><EFBFBD><EFBFBD>)) * 100),
|
||||||
AND <20><><EFBFBD><EFBFBD> = a_year
|
2) <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><CDB8>
|
||||||
AND <20><><EFBFBD>Ŵ<EFBFBD><EFBFBD><EFBFBD> = a_department_code
|
FROM <20><>ϯ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ÿ<EFBFBD>ձ<EFBFBD><EFBFBD><EFBFBD>
|
||||||
GROUP BY <20><>ϯ<EFBFBD><CFAF><EFBFBD><EFBFBD>
|
WHERE <20>·<EFBFBD> = A_MONTH
|
||||||
ORDER BY <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><CDB8> DESC;
|
AND <20><><EFBFBD><EFBFBD> = A_YEAR
|
||||||
|
AND <20><><EFBFBD>Ŵ<EFBFBD><C5B4><EFBFBD> = A_DEPARTMENT_CODE
|
||||||
|
GROUP BY <20><>ϯ<EFBFBD><CFAF><EFBFBD><EFBFBD>
|
||||||
|
ORDER BY <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><CDB8> DESC);
|
||||||
-- <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>а<EFBFBD>
|
-- <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>а<EFBFBD>
|
||||||
OPEN a_renewal_ranking_list FOR
|
OPEN A_RENEWAL_RANKING_LIST FOR
|
||||||
SELECT <EFBFBD><EFBFBD>ϯ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>,
|
SELECT ROWNUM,
|
||||||
round(nvl((SUM(<28><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ۼ<EFBFBD>) / SUM(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)) * 100,
|
<20><>ϯ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> AS CALLER_NAME,
|
||||||
0),
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> AS RENEWAL_RATE
|
||||||
2) <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
FROM (SELECT <20><>ϯ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>,
|
||||||
FROM <20><>ϯ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͳ<EFBFBD><EFBFBD> xb
|
decode(nvl(SUM(xb.<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>),
|
||||||
WHERE xb.<2E><><EFBFBD><EFBFBD> = l_department_name
|
0),
|
||||||
GROUP BY <20><>ϯ<EFBFBD><CFAF><EFBFBD><EFBFBD>
|
0,
|
||||||
ORDER BY <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> DESC;
|
0,
|
||||||
|
round(SUM(xb.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ۼ<EFBFBD>) / SUM(xb.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) * 100,
|
||||||
|
2)) <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
FROM <20><>ϯ<EFBFBD><CFAF><EFBFBD><EFBFBD>ͳ<EFBFBD><CDB3> XB
|
||||||
|
WHERE XB.<2E><><EFBFBD><EFBFBD> = L_DEPARTMENT_NAME
|
||||||
|
GROUP BY <20><>ϯ<EFBFBD><CFAF><EFBFBD><EFBFBD>
|
||||||
|
ORDER BY <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 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
@@ -1,18 +1,18 @@
|
|||||||
drop table <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ÿ<EFBFBD>ձ<EFBFBD><EFBFBD><EFBFBD>_T;
|
drop table 车非每日保费_T;
|
||||||
create global temporary table <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ÿ<EFBFBD>ձ<EFBFBD><EFBFBD><EFBFBD>_T
|
create global temporary table 车非每日保费_T
|
||||||
(
|
(
|
||||||
ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> DATE not null,
|
签单日期 DATE not null,
|
||||||
<EFBFBD>·<EFBFBD> VARCHAR2(10) not null,
|
月份 VARCHAR2(10) not null,
|
||||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD> VARCHAR2(100) not null,
|
部门 VARCHAR2(100) not null,
|
||||||
<EFBFBD><EFBFBD><EFBFBD>Ŵ<EFBFBD><EFBFBD><EFBFBD> varchar2(100) not null,
|
部门代码 varchar2(100) not null,
|
||||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>n VARCHAR2(100) not null,
|
科室n VARCHAR2(100) not null,
|
||||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>n VARCHAR2(100),
|
经办人n VARCHAR2(100),
|
||||||
<EFBFBD><EFBFBD>ϯ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> VARCHAR2(20),
|
坐席工号 VARCHAR2(20),
|
||||||
<EFBFBD><EFBFBD>ϯ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> VARCHAR2(30),
|
坐席名称 VARCHAR2(30),
|
||||||
<EFBFBD><EFBFBD>ϯ<EFBFBD>Ŷ<EFBFBD> VARCHAR2(100),
|
坐席团队 VARCHAR2(100),
|
||||||
<EFBFBD><EFBFBD><EFBFBD>ո<EFBFBD><EFBFBD>˿ͻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> NUMBER(16,2),
|
车险个人客户保费 NUMBER(16,2),
|
||||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ںϱ<EFBFBD><EFBFBD><EFBFBD> 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 <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ÿ<EFBFBD>ձ<EFBFBD><EFBFBD><EFBFBD>_T to DATACENTER;
|
grant select, insert, delete, alter on 车非每日保费_T to DATACENTER;
|
||||||
|
@@ -67,25 +67,28 @@ 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: [
|
||||||
"plugin:vue/vue3-essential",
|
"plugin:vue/vue3-essential",
|
||||||
"plugin:vue/recommended",
|
"plugin:vue/recommended",
|
||||||
"eslint:recommended",
|
"eslint:recommended",
|
||||||
// "standard-with-typescript",
|
"standard-with-typescript",
|
||||||
"plugin:@typescript-eslint/eslint-recommended",
|
"plugin:@typescript-eslint/eslint-recommended",
|
||||||
"plugin:@typescript-eslint/recommended",
|
"plugin:@typescript-eslint/recommended",
|
||||||
],
|
],
|
||||||
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",
|
||||||
@@ -144,11 +147,12 @@ module.exports = {
|
|||||||
plugins: ["@typescript-eslint",],
|
plugins: ["@typescript-eslint",],
|
||||||
extends: [
|
extends: [
|
||||||
"eslint:recommended",
|
"eslint:recommended",
|
||||||
// "standard-with-typescript",
|
"standard-with-typescript",
|
||||||
"plugin:@typescript-eslint/eslint-recommended",
|
"plugin:@typescript-eslint/eslint-recommended",
|
||||||
"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",
|
||||||
@@ -189,6 +193,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,},],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
973
code/web/task_schedule/package-lock.json
generated
973
code/web/task_schedule/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -9,29 +9,32 @@
|
|||||||
"preview": "vite preview"
|
"preview": "vite preview"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/eslint-parser": "^7.22.9",
|
"@babel/eslint-parser": "^7.22.15",
|
||||||
"@element-plus/icons-vue": "^2.1.0",
|
"@element-plus/icons-vue": "^2.1.0",
|
||||||
"axios": "^1.4.0",
|
"@rushstack/eslint-patch": "^1.3.3",
|
||||||
|
"@vue/eslint-config-typescript": "^11.0.3",
|
||||||
"babel": "^6.23.0",
|
"babel": "^6.23.0",
|
||||||
"echarts": "^5.4.3",
|
"echarts": "^5.4.3",
|
||||||
"element-plus": "^2.3.8",
|
"element-plus": "^2.3.12",
|
||||||
"moment": "^2.29.4",
|
"moment": "^2.29.4",
|
||||||
"sass-loader": "^13.3.2",
|
"sass-loader": "^13.3.2",
|
||||||
|
"ts-node": "^10.9.1",
|
||||||
"vue": "^3.3.4",
|
"vue": "^3.3.4",
|
||||||
"vue-router": "^4.2.4",
|
"vue-router": "^4.2.4",
|
||||||
"vuex": "^4.1.0"
|
"vuex": "^4.1.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/eslint-parser": "^7.22.9",
|
"@babel/eslint-parser": "^7.22.15",
|
||||||
"@typescript-eslint/eslint-plugin": "^6.2.0",
|
"@typescript-eslint/eslint-plugin": "^6.6.0",
|
||||||
"@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",
|
||||||
|
"axios": "~1.5.0",
|
||||||
"eslint-config-recommended": "^4.1.0",
|
"eslint-config-recommended": "^4.1.0",
|
||||||
"eslint-plugin-vue": "^9.15.1",
|
"eslint-config-standard-with-typescript": "^39.0.0",
|
||||||
|
"eslint-plugin-vue": "^9.17.0",
|
||||||
"node-sass": "^9.0.0",
|
"node-sass": "^9.0.0",
|
||||||
"sass": "^1.64.1",
|
"sass": "^1.66.1",
|
||||||
"style-loader": "^3.3.3",
|
"style-loader": "^3.3.3",
|
||||||
"typescript": "^5.1.6",
|
|
||||||
"vue-eslint-parser": "^9.3.1"
|
"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",
|
||||||
|
@@ -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>
|
@@ -103,7 +103,7 @@ export default {
|
|||||||
// border: 1px solid red;
|
// border: 1px solid red;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
width: 300px;
|
width: 300px;
|
||||||
height: 250px;
|
height: 260px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.rankinglist-index {
|
.rankinglist-index {
|
||||||
|
@@ -8,6 +8,8 @@
|
|||||||
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { testRankingListRequest } from "./testRankingListRequest.js";
|
// import { testRankingListRequest } from "./testRankingListRequest.js";
|
||||||
|
|
||||||
testRankingListRequest();
|
// testRankingListRequest();
|
||||||
|
|
||||||
|
console.log( "test" );
|
||||||
|
@@ -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
|
||||||
|
},
|
||||||
}
|
}
|
@@ -24,4 +24,6 @@ export const API_URL = {
|
|||||||
// URL_RANKINGLIST: "http://222.76.244.118:11101/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_RANKINGLIST: "http://10.39.0.41:8081/desktop_archievement_backend/archievement/query_ranking_list.do",
|
||||||
|
|
||||||
|
// 坐席业绩查询
|
||||||
|
URL_CALLER_ARCHIEVEMENT: "http://10.39.0.41:8081/desktop_archievement_backend/archievement/query_caller_archievement.do",
|
||||||
};
|
};
|
||||||
|
@@ -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
|
||||||
|
};
|
||||||
|
@@ -32,6 +32,9 @@ interface RankingListResponse
|
|||||||
renewalRateRankingList: RankingListItem[];
|
renewalRateRankingList: RankingListItem[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 判断用的正则表达式
|
||||||
|
const regexMonth = "(0[1-9])|(1[0-2])";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 请求坐席排行榜。
|
* 请求坐席排行榜。
|
||||||
* @param reqParam 请求参数
|
* @param reqParam 请求参数
|
||||||
@@ -53,6 +56,9 @@ function requestRankingList( reqParam: RankingListRequest, rander: any ): void /
|
|||||||
renewalRateRankingList: [],
|
renewalRateRankingList: [],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 检查请求参数
|
||||||
|
// TODO: 这里要加一个对month的正则表达式验证。
|
||||||
|
|
||||||
instance.request(
|
instance.request(
|
||||||
{
|
{
|
||||||
method: "post",
|
method: "post",
|
||||||
|
@@ -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">
|
||||||
@@ -48,16 +48,19 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="right-wrapper">
|
<div class="right-wrapper">
|
||||||
<h1>本大爷</h1>
|
<CallerArchievementComponent
|
||||||
|
:caller-name="callerInfo.telSalerName"
|
||||||
|
:this-month-premium="ui.callerPersentMonthPremium"
|
||||||
|
:attaching-rate="ui.callerAttachingRate"
|
||||||
|
:renewal-rate="ui.callerRenewalRate"
|
||||||
|
/>
|
||||||
<div class="carousel-item">
|
<div class="carousel-item">
|
||||||
<el-carousel
|
<el-carousel
|
||||||
arrow="never"
|
arrow="never"
|
||||||
indicator-position="none"
|
indicator-position="none"
|
||||||
:interval="4000"
|
:interval="4000"
|
||||||
>
|
>
|
||||||
<el-carousel-item
|
<el-carousel-item :key="1">
|
||||||
:key="1"
|
|
||||||
>
|
|
||||||
<RankingListComponent :ranking-list="ui.attachingRankingList" />
|
<RankingListComponent :ranking-list="ui.attachingRankingList" />
|
||||||
</el-carousel-item>
|
</el-carousel-item>
|
||||||
<el-carousel-item :key="2">
|
<el-carousel-item :key="2">
|
||||||
@@ -88,15 +91,27 @@ 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
|
||||||
import { RankingListItem } from "@/types/cpicxim/RankingListItem.js";
|
{
|
||||||
import { type RankingListRequest, type RankingListResponse, requestRankingList } from "@/utils/ranking.js";
|
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";
|
||||||
|
|
||||||
@@ -113,6 +128,9 @@ interface ui
|
|||||||
showUI: boolean; // 用来刷新页面的开关
|
showUI: boolean; // 用来刷新页面的开关
|
||||||
attachingRankingList: RankingListItem[]; // 坐席车非渗透率榜单
|
attachingRankingList: RankingListItem[]; // 坐席车非渗透率榜单
|
||||||
renewalRankingList: RankingListItem[];
|
renewalRankingList: RankingListItem[];
|
||||||
|
callerAttachingRate: string;
|
||||||
|
callerRenewalRate: string;
|
||||||
|
callerPersentMonthPremium: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@@ -123,11 +141,29 @@ 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: ui = reactive({
|
const ui: ui = reactive({
|
||||||
@@ -142,29 +178,46 @@ export default {
|
|||||||
showUI: true, // 用来刷新页面的开关
|
showUI: true, // 用来刷新页面的开关
|
||||||
attachingRankingList: [], // 坐席车非渗透率榜单
|
attachingRankingList: [], // 坐席车非渗透率榜单
|
||||||
renewalRankingList: [], // 坐席续保率榜单
|
renewalRankingList: [], // 坐席续保率榜单
|
||||||
|
callerAttachingRate: "0.0",
|
||||||
|
callerRenewalRate: "0.0",
|
||||||
|
callerPersentMonthPremium: 0,
|
||||||
});
|
});
|
||||||
let 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 applyArchievementData = ( 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;
|
||||||
@@ -175,7 +228,44 @@ 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 =>
|
const applyRankingListData = ( data: RankingListResponse ): void =>
|
||||||
@@ -189,11 +279,14 @@ export default {
|
|||||||
|
|
||||||
console.log( "获取排行榜后的ui:", data );
|
console.log( "获取排行榜后的ui:", data );
|
||||||
|
|
||||||
setTimeout(() => { ui.showUI = true; }, 0 );
|
setTimeout(() =>
|
||||||
|
{
|
||||||
|
ui.showUI = true;
|
||||||
|
}, 0 );
|
||||||
};
|
};
|
||||||
|
|
||||||
// 退出桌面霸屏
|
// 退出桌面霸屏
|
||||||
const logoutDesktopArchievement = () =>
|
const logoutDesktopArchievement = (): void =>
|
||||||
{
|
{
|
||||||
console.log( "111" );
|
console.log( "111" );
|
||||||
logout();
|
logout();
|
||||||
@@ -210,28 +303,29 @@ 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,
|
||||||
};
|
};
|
||||||
|
|
||||||
const rankinglistRequest: RankingListRequest =
|
const rankinglistRequest: RankingListRequest = {
|
||||||
{
|
|
||||||
departmentCode: callerInfo.departmentCode,
|
departmentCode: callerInfo.departmentCode,
|
||||||
year: "2023",
|
year: thisYearString,
|
||||||
month: "06",
|
month: thisMonthString,
|
||||||
};
|
};
|
||||||
|
|
||||||
queryDepartmentArchievement( deparmentInfo, applyArchievementData );
|
console.log( "refresh", rankinglistRequest );
|
||||||
|
|
||||||
|
queryDepartmentArchievement( deparmentInfo, applyDepartmentArchievementData );
|
||||||
|
queryCallerArchievement( callerInfo, applyCallerArchievementData );
|
||||||
requestRankingList( rankinglistRequest, applyRankingListData );
|
requestRankingList( rankinglistRequest, applyRankingListData );
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -255,7 +349,15 @@ export default {
|
|||||||
clearInterval( timerHandler );
|
clearInterval( timerHandler );
|
||||||
});
|
});
|
||||||
|
|
||||||
return { ui, callerInfo, timerHandler, getTotalArchievement, renderData: applyArchievementData, refresh, logoutDesktopArchievement, };
|
return {
|
||||||
|
ui,
|
||||||
|
callerInfo,
|
||||||
|
timerHandler,
|
||||||
|
getTotalArchievement,
|
||||||
|
renderData: applyDepartmentArchievementData,
|
||||||
|
refresh,
|
||||||
|
logoutDesktopArchievement,
|
||||||
|
};
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
@@ -388,12 +490,13 @@ export default {
|
|||||||
// >*+* {
|
// >*+* {
|
||||||
// margin-top: 15px;
|
// margin-top: 15px;
|
||||||
// }
|
// }
|
||||||
> h1 {
|
>h1 {
|
||||||
font: {
|
font: {
|
||||||
family: "FZ-ZHUOHEI";
|
family: "FZ-ZHUOHEI";
|
||||||
weight: 100;
|
weight: 100;
|
||||||
size: 30px;
|
size: 30px;
|
||||||
}
|
}
|
||||||
|
|
||||||
color: $color-bg-04;
|
color: $color-bg-04;
|
||||||
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
@@ -401,11 +504,19 @@ export default {
|
|||||||
width: 300px;
|
width: 300px;
|
||||||
}
|
}
|
||||||
|
|
||||||
> div {
|
.carousel-item {
|
||||||
|
// 为了限制走马灯组件的高度
|
||||||
display: block;
|
display: block;
|
||||||
height: 260px;
|
height: 260px;
|
||||||
width: 300px;
|
width: 300px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// >div {
|
||||||
|
// // 为了限制走马灯组件的高度
|
||||||
|
// display: block;
|
||||||
|
// height: 260px;
|
||||||
|
// width: 300px;
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
@@ -416,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;
|
||||||
};
|
};
|
||||||
|
@@ -120,7 +120,7 @@ export default {
|
|||||||
callers: [],
|
callers: [],
|
||||||
});
|
});
|
||||||
|
|
||||||
const onCurrentPageIndexChange = ( pageIndex: number ) =>
|
const onCurrentPageIndexChange = ( pageIndex: number ): void =>
|
||||||
{
|
{
|
||||||
ui.table_current_page_index = pageIndex;
|
ui.table_current_page_index = pageIndex;
|
||||||
};
|
};
|
||||||
@@ -129,7 +129,7 @@ export default {
|
|||||||
* 设置表格每页显示记录的数量
|
* 设置表格每页显示记录的数量
|
||||||
* @param pageSize 表格页记录数量
|
* @param pageSize 表格页记录数量
|
||||||
*/
|
*/
|
||||||
const onTablePageSizeChange = ( pageSize: number ) =>
|
const onTablePageSizeChange = ( pageSize: number ): void =>
|
||||||
{
|
{
|
||||||
ui.table_page_size = pageSize;
|
ui.table_page_size = pageSize;
|
||||||
};
|
};
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"resolveJsonModule": true,
|
"resolveJsonModule": true,
|
||||||
"esModuleInterop": false,
|
"esModuleInterop": false,
|
||||||
|
"isolatedModules": true,
|
||||||
"baseUrl": "./", // paths 路径解析起点
|
"baseUrl": "./", // paths 路径解析起点
|
||||||
"paths": { // 别名路径设置
|
"paths": { // 别名路径设置
|
||||||
"@/*": [
|
"@/*": [
|
||||||
|
@@ -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
|
||||||
}
|
}
|
@@ -2,7 +2,7 @@
|
|||||||
* @Author: Kane
|
* @Author: Kane
|
||||||
* @Date: 2023-07-27 11:05:53
|
* @Date: 2023-07-27 11:05:53
|
||||||
* @LastEditors: Kane
|
* @LastEditors: Kane
|
||||||
* @FilePath: /desktop_archievement_backend/src/main/java/com/cpic/xim/mybatis/mapper/ArchivementMapper.java
|
* @FilePath: /desktop_archievement_backend/src/main/java/com/cpic/xim/mybatis/mapper/ArchievementMapper.java
|
||||||
* @Description:
|
* @Description:
|
||||||
*
|
*
|
||||||
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||||
@@ -13,5 +13,7 @@ import java.util.HashMap;
|
|||||||
|
|
||||||
public interface ArchievementMapper
|
public interface ArchievementMapper
|
||||||
{
|
{
|
||||||
public void getDepartmentArchievement(HashMap<String, Object> params);
|
public void getDepartmentArchievement( HashMap<String, Object> params );
|
||||||
}
|
|
||||||
|
public void getCallerArchievement( HashMap<String, Object> params );
|
||||||
|
}
|
||||||
|
@@ -13,5 +13,5 @@ import java.util.HashMap;
|
|||||||
|
|
||||||
public interface RankingListMapper
|
public interface RankingListMapper
|
||||||
{
|
{
|
||||||
public void getRankdingList( HashMap<String, Object> params );
|
public void getRankingList( HashMap<String, Object> params );
|
||||||
}
|
}
|
@@ -0,0 +1,19 @@
|
|||||||
|
/*
|
||||||
|
* @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 com.cpic.xim.mybatis.pojo.RewardProject;
|
||||||
|
|
||||||
|
public interface RewardsMapper
|
||||||
|
{
|
||||||
|
public ArrayList<RewardProject> queryRewardProjects();
|
||||||
|
}
|
@@ -16,18 +16,18 @@ public class MensualArchievementItem
|
|||||||
public MensualArchievementItem()
|
public MensualArchievementItem()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
public MensualArchievementItem( String month, String premium)
|
public MensualArchievementItem( int month, String premium)
|
||||||
{
|
{
|
||||||
this.month = month;
|
this.month = month;
|
||||||
this.premium = premium;
|
this.premium = premium;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getMonth()
|
public int getMonth()
|
||||||
{
|
{
|
||||||
return month;
|
return month;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setMonth( String month )
|
public void setMonth( int month )
|
||||||
{
|
{
|
||||||
this.month = month;
|
this.month = month;
|
||||||
}
|
}
|
||||||
@@ -42,18 +42,14 @@ public class MensualArchievementItem
|
|||||||
this.premium = premium;
|
this.premium = premium;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString()
|
|
||||||
{
|
|
||||||
return "MensualArchievementItem [month=" + month + ", premium=" + premium + "]";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode()
|
public int hashCode()
|
||||||
{
|
{
|
||||||
final int prime = 31;
|
final int prime = 31;
|
||||||
int result = 1;
|
int result = 1;
|
||||||
result = prime * result + ((month == null) ? 0 : month.hashCode());
|
result = prime * result + month;
|
||||||
result = prime * result + ((premium == null) ? 0 : premium.hashCode());
|
result = prime * result + ((premium == null) ? 0 : premium.hashCode());
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -68,11 +64,7 @@ public class MensualArchievementItem
|
|||||||
if ( getClass() != obj.getClass() )
|
if ( getClass() != obj.getClass() )
|
||||||
return false;
|
return false;
|
||||||
MensualArchievementItem other = (MensualArchievementItem) obj;
|
MensualArchievementItem other = (MensualArchievementItem) obj;
|
||||||
if ( month == null )
|
if ( month != other.month )
|
||||||
{
|
|
||||||
if ( other.month != null )
|
|
||||||
return false;
|
|
||||||
} else if ( !month.equals( other.month ) )
|
|
||||||
return false;
|
return false;
|
||||||
if ( premium == null )
|
if ( premium == null )
|
||||||
{
|
{
|
||||||
@@ -83,9 +75,17 @@ public class MensualArchievementItem
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString()
|
||||||
|
{
|
||||||
|
return "MensualArchievementItem [month=" + month + ", premium=" + premium + "]";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 月份
|
// 月份
|
||||||
@JsonProperty( "month" )
|
@JsonProperty( "month" )
|
||||||
private String month;
|
private int month;
|
||||||
|
|
||||||
// 月总保费
|
// 月总保费
|
||||||
@JsonProperty( "premium" )
|
@JsonProperty( "premium" )
|
||||||
|
@@ -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;
|
||||||
|
}
|
@@ -20,6 +20,7 @@ import org.apache.ibatis.session.SqlSessionFactoryBuilder;
|
|||||||
public class MybatisUtils
|
public class MybatisUtils
|
||||||
{
|
{
|
||||||
private static HashMap<String, SqlSession> SessionMap = new HashMap<>();
|
private static HashMap<String, SqlSession> SessionMap = new HashMap<>();
|
||||||
|
private static String DEFAULT_CONFIGFILE = "mybatis/mybatis-config.xml";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -48,5 +49,28 @@ public class MybatisUtils
|
|||||||
SessionMap.put(configFile, session);
|
SessionMap.put(configFile, session);
|
||||||
|
|
||||||
return 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;
|
||||||
|
}
|
||||||
}
|
}
|
@@ -8,4 +8,200 @@
|
|||||||
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
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; // 车非渗透率
|
||||||
|
}
|
||||||
|
@@ -22,9 +22,6 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
|||||||
|
|
||||||
public class DepartmentArchievement
|
public class DepartmentArchievement
|
||||||
{
|
{
|
||||||
// mybatis配置文件路径
|
|
||||||
private static String mybatisConfigFile = "mybatis/mybatis-config.xml";
|
|
||||||
|
|
||||||
// log4j2
|
// log4j2
|
||||||
private static Logger logger = LoggerFactory.getLogger(DepartmentArchievement.class);
|
private static Logger logger = LoggerFactory.getLogger(DepartmentArchievement.class);
|
||||||
|
|
||||||
@@ -64,6 +61,7 @@ public class DepartmentArchievement
|
|||||||
* @return
|
* @return
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public static DepartmentArchievement getDepartmentArchievement( String departmentCode )
|
public static DepartmentArchievement getDepartmentArchievement( String departmentCode )
|
||||||
throws IOException
|
throws IOException
|
||||||
{
|
{
|
||||||
@@ -71,7 +69,7 @@ public class DepartmentArchievement
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
SqlSession session = MybatisUtils.getSqlSession( mybatisConfigFile );
|
SqlSession session = MybatisUtils.getSqlSession();
|
||||||
ArchievementMapper mapper = session.getMapper(ArchievementMapper.class);
|
ArchievementMapper mapper = session.getMapper(ArchievementMapper.class);
|
||||||
|
|
||||||
// 参数集合
|
// 参数集合
|
||||||
|
@@ -16,7 +16,9 @@ import java.sql.DriverManager;
|
|||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
import org.apache.ibatis.session.SqlSession;
|
import org.apache.ibatis.session.SqlSession;
|
||||||
|
import com.cpic.xim.mybatis.mapper.RankingListMapper;
|
||||||
import com.cpic.xim.mybatis.utils.MybatisUtils;
|
import com.cpic.xim.mybatis.utils.MybatisUtils;
|
||||||
import oracle.jdbc.OracleCallableStatement;
|
import oracle.jdbc.OracleCallableStatement;
|
||||||
import oracle.jdbc.OracleTypes;
|
import oracle.jdbc.OracleTypes;
|
||||||
@@ -28,9 +30,6 @@ public class CallerRankingList
|
|||||||
private static String userName = "desktop_archievement_admin";
|
private static String userName = "desktop_archievement_admin";
|
||||||
private static String password = "Cpic123456";
|
private static String password = "Cpic123456";
|
||||||
|
|
||||||
// 配置文件路径
|
|
||||||
private static String configFilePath = "mybatis/mybatis-config.xml";
|
|
||||||
|
|
||||||
private CallerRankingList( String departmentCode, String year, String month,
|
private CallerRankingList( String departmentCode, String year, String month,
|
||||||
ArrayList<CallerRankingItem> attachingRateRankingList,
|
ArrayList<CallerRankingItem> attachingRateRankingList,
|
||||||
ArrayList<CallerRankingItem> renewalRateRankingList)
|
ArrayList<CallerRankingItem> renewalRateRankingList)
|
||||||
@@ -42,16 +41,30 @@ public class CallerRankingList
|
|||||||
this.renewalRateRankingList = renewalRateRankingList;
|
this.renewalRateRankingList = renewalRateRankingList;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static CallerRankingList getCallerRankingList2( String departmentCode, String year,
|
@SuppressWarnings("unchecked")
|
||||||
|
public static CallerRankingList getCallerRankingList( String departmentCode, String year,
|
||||||
String month ) throws IOException
|
String month ) throws IOException
|
||||||
{
|
{
|
||||||
CallerRankingList rankingList = null;
|
CallerRankingList rankingList = null;
|
||||||
|
|
||||||
String monthRegx = "(0[1-9])|(1[0-2])";
|
// String monthRegx = "(0[1-9])|(1[0-2])";
|
||||||
String yearRegx = "202[0-9]";
|
// String yearRegx = "202[0-9]";
|
||||||
|
|
||||||
SqlSession session = MybatisUtils.getSqlSession(yearRegx);
|
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;
|
return rankingList;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -62,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;
|
||||||
@@ -74,8 +87,8 @@ 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]";
|
||||||
|
|
||||||
ArrayList<CallerRankingItem> attachingRateRankingList = new ArrayList<>();
|
ArrayList<CallerRankingItem> attachingRateRankingList = new ArrayList<>();
|
||||||
ArrayList<CallerRankingItem> renewalRateRankingList = new ArrayList<>();
|
ArrayList<CallerRankingItem> renewalRateRankingList = new ArrayList<>();
|
||||||
|
@@ -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;
|
||||||
|
@@ -14,31 +14,40 @@
|
|||||||
package com.cpic.xim.web.controllers.archievement;
|
package com.cpic.xim.web.controllers.archievement;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.sql.SQLException;
|
|
||||||
import java.util.ArrayList;
|
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()
|
||||||
{
|
// {
|
||||||
|
|
||||||
}
|
// }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询部门业绩
|
* 查询部门业绩
|
||||||
@@ -56,8 +65,8 @@ public class ArchievementQueryController
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
// 查询业绩
|
// 查询业绩
|
||||||
departmentArch = DepartmentArchievement
|
departmentArch =
|
||||||
.getDepartmentArchievement( request.getDepartmentCode() );
|
DepartmentArchievement.getDepartmentArchievement( request.getDepartmentCode() );
|
||||||
|
|
||||||
result.setTotalArchievement( departmentArch.getTotalArchievement() );
|
result.setTotalArchievement( departmentArch.getTotalArchievement() );
|
||||||
result.setInsuranceRenewalRate( departmentArch.getInsuranceRenewalRate() );
|
result.setInsuranceRenewalRate( departmentArch.getInsuranceRenewalRate() );
|
||||||
@@ -70,7 +79,7 @@ public class ArchievementQueryController
|
|||||||
}
|
}
|
||||||
catch ( IOException error )
|
catch ( IOException error )
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
result.setSuccess( true );
|
result.setSuccess( true );
|
||||||
@@ -79,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(
|
||||||
@@ -106,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
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
@@ -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.QueryResult;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
public class CallerArchievementQueryResult extends QueryResult
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @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,13 +2,13 @@
|
|||||||
* @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.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -23,7 +23,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
|||||||
*/
|
*/
|
||||||
public class DepartmentArchievementQueryResult extends QueryResult
|
public class DepartmentArchievementQueryResult extends QueryResult
|
||||||
{
|
{
|
||||||
DepartmentArchievementQueryResult()
|
public DepartmentArchievementQueryResult()
|
||||||
{
|
{
|
||||||
mensualArchievementList = new ArrayList<MensualArchievementItem>();
|
mensualArchievementList = new ArrayList<MensualArchievementItem>();
|
||||||
advanceRewardGainers = new Vector<String>();
|
advanceRewardGainers = new Vector<String>();
|
@@ -11,6 +11,7 @@ package com.cpic.xim.web.controllers.caller;
|
|||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
|
||||||
|
@SuppressWarnings("all")
|
||||||
public class QueryCallerRequest
|
public class QueryCallerRequest
|
||||||
{
|
{
|
||||||
public QueryCallerRequest() {}
|
public QueryCallerRequest() {}
|
||||||
|
@@ -0,0 +1,66 @@
|
|||||||
|
/*
|
||||||
|
* @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 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.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
import com.cpic.xim.mybatis.mapper.RewardsMapper;
|
||||||
|
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;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
session = MybatisUtils.getSqlSession();
|
||||||
|
|
||||||
|
RewardsMapper mapper = session.getMapper(RewardsMapper.class);
|
||||||
|
ArrayList<RewardProject> rewards = mapper.queryRewardProjects();
|
||||||
|
|
||||||
|
response.setSuccess(true);
|
||||||
|
response.setMessage("查询成功!");
|
||||||
|
response.setRewardList(rewards);
|
||||||
|
}
|
||||||
|
catch (IOException error )
|
||||||
|
{
|
||||||
|
response.setSuccess(false);
|
||||||
|
response.setMessage("查询失败!" + error.getMessage());
|
||||||
|
response.setRewardList(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
}
|
@@ -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.QueryResult;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
public class RewardProjectsResponse extends QueryResult
|
||||||
|
{
|
||||||
|
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;
|
||||||
|
}
|
@@ -9,8 +9,17 @@
|
|||||||
#{a_total, mode=OUT, jdbcType=INTEGER, javaType=Integer},
|
#{a_total, mode=OUT, jdbcType=INTEGER, javaType=Integer},
|
||||||
#{a_mensual_cur, mode=OUT, jdbcType=CURSOR, resultMap=MensualArchievementMapper})
|
#{a_mensual_cur, mode=OUT, jdbcType=CURSOR, resultMap=MensualArchievementMapper})
|
||||||
</select>
|
</select>
|
||||||
|
<select id="getCallerArchievement" 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">
|
<resultMap id="MensualArchievementMapper" type="MensualArchievementItem">
|
||||||
<id property="month" column="mm" />
|
<id property="month" column="mm" javaType="INT"/>
|
||||||
<result property="premium" column="bf" />
|
<result property="premium" column="bf" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
</mapper>
|
</mapper>
|
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?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">
|
<!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">
|
<mapper namespace="com.cpic.xim.mybatis.mapper.RankingListMapper">
|
||||||
<select id="getRankdingList" statementType="CALLABLE" parameterMap="java.util.HashMap">
|
<select id="getRankingList" statementType="CALLABLE" parameterType="java.util.HashMap">
|
||||||
call telsale_archievement_pkg.caller_arch_ranking_list(
|
call telsale_archievement_pkg.caller_arch_ranking_list(
|
||||||
#{a_department_code,mode=IN,jdbcType=VARCHAR},
|
#{a_department_code,mode=IN,jdbcType=VARCHAR},
|
||||||
#{a_year,mode=IN,jdbcType=VARCHAR},
|
#{a_year,mode=IN,jdbcType=VARCHAR},
|
||||||
@@ -10,12 +10,12 @@
|
|||||||
#{a_renewal_ranking_list,mode=OUT,jdbcType=CURSOR, resultMap=RenewalRateRankingMap})
|
#{a_renewal_ranking_list,mode=OUT,jdbcType=CURSOR, resultMap=RenewalRateRankingMap})
|
||||||
</select>
|
</select>
|
||||||
<resultMap id="AttachingRateRankingMap" type="CallerRankingItem">
|
<resultMap id="AttachingRateRankingMap" type="CallerRankingItem">
|
||||||
<id property="index" column="rownum" jdbcType="Integer" javaType="int"/>
|
<id property="index" column="rownum" jdbcType="INTEGER" javaType="int"/>
|
||||||
<result property="callerName" column="caller_name" jdbcType="VARCHAR" javaType="String"/>
|
<result property="callerName" column="caller_name" jdbcType="VARCHAR" javaType="String"/>
|
||||||
<result property="appraiseValue" column="attaching_rate" jdbcType="VARCHAR" javaType="String"/>
|
<result property="appraiseValue" column="attaching_rate" jdbcType="VARCHAR" javaType="String"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
<resultMap id="RenewalRateRankingMap" type="CallerRankingItem">
|
<resultMap id="RenewalRateRankingMap" type="CallerRankingItem">
|
||||||
<id property="index" column="rownum" jdbcType="Integer" javaType="int"/>
|
<id property="index" column="rownum" jdbcType="INTEGER" javaType="int"/>
|
||||||
<result property="callerName" column="caller_name" jdbcType="VARCHAR" javaType="String"/>
|
<result property="callerName" column="caller_name" jdbcType="VARCHAR" javaType="String"/>
|
||||||
<result property="appraiseValue" column="renewal_rate" jdbcType="VARCHAR" javaType="String"/>
|
<result property="appraiseValue" column="renewal_rate" jdbcType="VARCHAR" javaType="String"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
@@ -0,0 +1,11 @@
|
|||||||
|
<?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
|
||||||
|
</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>
|
||||||
|
</mapper>
|
@@ -24,5 +24,7 @@
|
|||||||
<mappers>
|
<mappers>
|
||||||
<!-- <mapper resource="mybatis/mapper/StaffMapper.xml" /> -->
|
<!-- <mapper resource="mybatis/mapper/StaffMapper.xml" /> -->
|
||||||
<mapper resource="mybatis/mapper/ArchievementMapper.xml" />
|
<mapper resource="mybatis/mapper/ArchievementMapper.xml" />
|
||||||
|
<mapper resource="mybatis/mapper/RankingListMapper.xml" />
|
||||||
|
<mapper resource="mybatis/mapper/RewardsMapper.xml" />
|
||||||
</mappers>
|
</mappers>
|
||||||
</configuration>
|
</configuration>
|
@@ -13,25 +13,27 @@ import static org.junit.Assert.assertNotNull;
|
|||||||
import static org.junit.Assert.assertTrue;
|
import static org.junit.Assert.assertTrue;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.sql.SQLException;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
|
||||||
import org.apache.ibatis.io.Resources;
|
import org.apache.ibatis.io.Resources;
|
||||||
import org.apache.ibatis.session.SqlSession;
|
import org.apache.ibatis.session.SqlSession;
|
||||||
import org.apache.ibatis.session.SqlSessionFactory;
|
import org.apache.ibatis.session.SqlSessionFactory;
|
||||||
import org.apache.ibatis.session.SqlSessionFactoryBuilder;
|
import org.apache.ibatis.session.SqlSessionFactoryBuilder;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
import com.cpic.xim.mybatis.mapper.ArchievementMapper;
|
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.MensualArchievementItem;
|
||||||
|
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;
|
||||||
|
|
||||||
import com.cpic.xim.utils.archievement.DepartmentArchievement;
|
|
||||||
|
|
||||||
@SuppressWarnings( "all" )
|
@SuppressWarnings( "all" )
|
||||||
public class DesktopArchievementTest
|
public class DesktopArchievementTest
|
||||||
{
|
{
|
||||||
private static String configFilePath = "mybatis/mybatis-config.xml";
|
private static String configFilePath = "mybatis/mybatis-config.xml";
|
||||||
|
private static Logger logger = LoggerFactory.getLogger( DesktopArchievementTest.class );
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testCallerRankingList()
|
public void testCallerRankingList()
|
||||||
@@ -42,13 +44,11 @@ public class DesktopArchievementTest
|
|||||||
{
|
{
|
||||||
rankingList = CallerRankingList.getCallerRankingList( "QDI", "2023", "06" );
|
rankingList = CallerRankingList.getCallerRankingList( "QDI", "2023", "06" );
|
||||||
}
|
}
|
||||||
catch ( SQLException error )
|
catch ( IOException error )
|
||||||
{
|
{
|
||||||
error.printStackTrace();
|
String message = "获取排行榜失败,原因:" + error.getMessage();
|
||||||
}
|
|
||||||
catch ( ClassNotFoundException error )
|
logger.error( message, error );
|
||||||
{
|
|
||||||
error.printStackTrace();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
assertNotNull( rankingList );
|
assertNotNull( rankingList );
|
||||||
@@ -87,17 +87,52 @@ public class DesktopArchievementTest
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testDepartmentArchievement2()
|
public void testCallerArchievement()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
DepartmentArchievement arch = DepartmentArchievement.getDepartmentArchievement( "QDI" );
|
SqlSession session = MybatisUtils.getSqlSession();
|
||||||
|
ArchievementMapper mapper = session.getMapper( ArchievementMapper.class );
|
||||||
System.out.println( arch.toString() );
|
|
||||||
|
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 )
|
catch ( IOException error )
|
||||||
{
|
{
|
||||||
assert (false);
|
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 );
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
BIN
文档/变更/2023-07-10.docx
Normal file
BIN
文档/变更/2023-07-10.docx
Normal file
Binary file not shown.
Reference in New Issue
Block a user