Compare commits
10 Commits
feature-pe
...
7d0112b483
Author | SHA1 | Date | |
---|---|---|---|
7d0112b483 | |||
58f60b9eaf | |||
4cd800e62b | |||
4deed356f5 | |||
31d5e1622c | |||
be5e426cee | |||
7ea11e34a9 | |||
2edd5f67db | |||
efebd548c6 | |||
22157b11eb |
17
code/db/建表/坐席奖励表.sql
Normal file
17
code/db/建表/坐席奖励表.sql
Normal file
@@ -0,0 +1,17 @@
|
||||
drop table telsaler_reward;
|
||||
create table telsaler_reward
|
||||
(
|
||||
rec_id integer not null,
|
||||
reward_index integer not null,
|
||||
telsaler_name varchar2(100) not null,
|
||||
telsaler_code varchar2(20)
|
||||
);
|
||||
|
||||
CREATE OR REPLACE TRIGGER telsaler_reward_id
|
||||
BEFORE INSERT ON telsaler_reward
|
||||
FOR EACH ROW
|
||||
BEGIN
|
||||
SELECT desktop_archievement_seq.nextval
|
||||
INTO :new.rec_id
|
||||
FROM dual;
|
||||
END;
|
@@ -112,6 +112,7 @@ module.exports = {
|
||||
"vue/html-indent": ["error", 4,],
|
||||
// typescript
|
||||
"@typescript-eslint/indent": ["warn", 4,],
|
||||
"@typescript-eslint/no-explicit-any": "warn",
|
||||
"@typescript-eslint/no-extra-semi": "off",
|
||||
"@typescript-eslint/no-inferrable-types": "off",
|
||||
"@typescript-eslint/no-unused-vars": "warn",
|
||||
@@ -157,7 +158,7 @@ module.exports = {
|
||||
"space-in-parens": ["error", "always", { exceptions: ["{}", "[]", "()", "empty",], },],
|
||||
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
|
||||
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
|
||||
"@typescript-eslint/no-explicit-any": "warn",
|
||||
"@typescript-eslint/no-explicit-any": "off",
|
||||
"@typescript-eslint/indent": ["error", 4,],
|
||||
"@typescript-eslint/no-extra-semi": "off",
|
||||
"@typescript-eslint/no-inferrable-types": "off",
|
||||
|
120
code/web/task_schedule/package-lock.json
generated
120
code/web/task_schedule/package-lock.json
generated
@@ -24,7 +24,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/eslint-parser": "^7.22.15",
|
||||
"@typescript-eslint/eslint-plugin": "^6.6.0",
|
||||
"@typescript-eslint/eslint-plugin": "^6.7.0",
|
||||
"@vitejs/plugin-vue": "^4.3.4",
|
||||
"@vue/cli-plugin-eslint": "^5.0.8",
|
||||
"axios": "~1.5.0",
|
||||
@@ -1560,16 +1560,16 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/eslint-plugin": {
|
||||
"version": "6.6.0",
|
||||
"resolved": "https://registry.npmmirror.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.6.0.tgz",
|
||||
"integrity": "sha512-CW9YDGTQnNYMIo5lMeuiIG08p4E0cXrXTbcZ2saT/ETE7dWUrNxlijsQeU04qAAKkILiLzdQz+cGFxCJjaZUmA==",
|
||||
"version": "6.7.0",
|
||||
"resolved": "https://registry.npmmirror.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.7.0.tgz",
|
||||
"integrity": "sha512-gUqtknHm0TDs1LhY12K2NA3Rmlmp88jK9Tx8vGZMfHeNMLE3GH2e9TRub+y+SOjuYgtOmok+wt1AyDPZqxbNag==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@eslint-community/regexpp": "^4.5.1",
|
||||
"@typescript-eslint/scope-manager": "6.6.0",
|
||||
"@typescript-eslint/type-utils": "6.6.0",
|
||||
"@typescript-eslint/utils": "6.6.0",
|
||||
"@typescript-eslint/visitor-keys": "6.6.0",
|
||||
"@typescript-eslint/scope-manager": "6.7.0",
|
||||
"@typescript-eslint/type-utils": "6.7.0",
|
||||
"@typescript-eslint/utils": "6.7.0",
|
||||
"@typescript-eslint/visitor-keys": "6.7.0",
|
||||
"debug": "^4.3.4",
|
||||
"graphemer": "^1.4.0",
|
||||
"ignore": "^5.2.4",
|
||||
@@ -1591,34 +1591,34 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/scope-manager": {
|
||||
"version": "6.6.0",
|
||||
"resolved": "https://registry.npmmirror.com/@typescript-eslint/scope-manager/-/scope-manager-6.6.0.tgz",
|
||||
"integrity": "sha512-pT08u5W/GT4KjPUmEtc2kSYvrH8x89cVzkA0Sy2aaOUIw6YxOIjA8ilwLr/1fLjOedX1QAuBpG9XggWqIIfERw==",
|
||||
"version": "6.7.0",
|
||||
"resolved": "https://registry.npmmirror.com/@typescript-eslint/scope-manager/-/scope-manager-6.7.0.tgz",
|
||||
"integrity": "sha512-lAT1Uau20lQyjoLUQ5FUMSX/dS07qux9rYd5FGzKz/Kf8W8ccuvMyldb8hadHdK/qOI7aikvQWqulnEq2nCEYA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "6.6.0",
|
||||
"@typescript-eslint/visitor-keys": "6.6.0"
|
||||
"@typescript-eslint/types": "6.7.0",
|
||||
"@typescript-eslint/visitor-keys": "6.7.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^16.0.0 || >=18.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/types": {
|
||||
"version": "6.6.0",
|
||||
"resolved": "https://registry.npmmirror.com/@typescript-eslint/types/-/types-6.6.0.tgz",
|
||||
"integrity": "sha512-CB6QpJQ6BAHlJXdwUmiaXDBmTqIE2bzGTDLADgvqtHWuhfNP3rAOK7kAgRMAET5rDRr9Utt+qAzRBdu3AhR3sg==",
|
||||
"version": "6.7.0",
|
||||
"resolved": "https://registry.npmmirror.com/@typescript-eslint/types/-/types-6.7.0.tgz",
|
||||
"integrity": "sha512-ihPfvOp7pOcN/ysoj0RpBPOx3HQTJTrIN8UZK+WFd3/iDeFHHqeyYxa4hQk4rMhsz9H9mXpR61IzwlBVGXtl9Q==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": "^16.0.0 || >=18.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/visitor-keys": {
|
||||
"version": "6.6.0",
|
||||
"resolved": "https://registry.npmmirror.com/@typescript-eslint/visitor-keys/-/visitor-keys-6.6.0.tgz",
|
||||
"integrity": "sha512-L61uJT26cMOfFQ+lMZKoJNbAEckLe539VhTxiGHrWl5XSKQgA0RTBZJW2HFPy5T0ZvPVSD93QsrTKDkfNwJGyQ==",
|
||||
"version": "6.7.0",
|
||||
"resolved": "https://registry.npmmirror.com/@typescript-eslint/visitor-keys/-/visitor-keys-6.7.0.tgz",
|
||||
"integrity": "sha512-/C1RVgKFDmGMcVGeD8HjKv2bd72oI1KxQDeY8uc66gw9R0OK0eMq48cA+jv9/2Ag6cdrsUGySm1yzYmfz0hxwQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "6.6.0",
|
||||
"@typescript-eslint/types": "6.7.0",
|
||||
"eslint-visitor-keys": "^3.4.1"
|
||||
},
|
||||
"engines": {
|
||||
@@ -1705,13 +1705,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/type-utils": {
|
||||
"version": "6.6.0",
|
||||
"resolved": "https://registry.npmmirror.com/@typescript-eslint/type-utils/-/type-utils-6.6.0.tgz",
|
||||
"integrity": "sha512-8m16fwAcEnQc69IpeDyokNO+D5spo0w1jepWWY2Q6y5ZKNuj5EhVQXjtVAeDDqvW6Yg7dhclbsz6rTtOvcwpHg==",
|
||||
"version": "6.7.0",
|
||||
"resolved": "https://registry.npmmirror.com/@typescript-eslint/type-utils/-/type-utils-6.7.0.tgz",
|
||||
"integrity": "sha512-f/QabJgDAlpSz3qduCyQT0Fw7hHpmhOzY/Rv6zO3yO+HVIdPfIWhrQoAyG+uZVtWAIS85zAyzgAFfyEr+MgBpg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@typescript-eslint/typescript-estree": "6.6.0",
|
||||
"@typescript-eslint/utils": "6.6.0",
|
||||
"@typescript-eslint/typescript-estree": "6.7.0",
|
||||
"@typescript-eslint/utils": "6.7.0",
|
||||
"debug": "^4.3.4",
|
||||
"ts-api-utils": "^1.0.1"
|
||||
},
|
||||
@@ -1728,22 +1728,22 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/types": {
|
||||
"version": "6.6.0",
|
||||
"resolved": "https://registry.npmmirror.com/@typescript-eslint/types/-/types-6.6.0.tgz",
|
||||
"integrity": "sha512-CB6QpJQ6BAHlJXdwUmiaXDBmTqIE2bzGTDLADgvqtHWuhfNP3rAOK7kAgRMAET5rDRr9Utt+qAzRBdu3AhR3sg==",
|
||||
"version": "6.7.0",
|
||||
"resolved": "https://registry.npmmirror.com/@typescript-eslint/types/-/types-6.7.0.tgz",
|
||||
"integrity": "sha512-ihPfvOp7pOcN/ysoj0RpBPOx3HQTJTrIN8UZK+WFd3/iDeFHHqeyYxa4hQk4rMhsz9H9mXpR61IzwlBVGXtl9Q==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": "^16.0.0 || >=18.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/typescript-estree": {
|
||||
"version": "6.6.0",
|
||||
"resolved": "https://registry.npmmirror.com/@typescript-eslint/typescript-estree/-/typescript-estree-6.6.0.tgz",
|
||||
"integrity": "sha512-hMcTQ6Al8MP2E6JKBAaSxSVw5bDhdmbCEhGW/V8QXkb9oNsFkA4SBuOMYVPxD3jbtQ4R/vSODBsr76R6fP3tbA==",
|
||||
"version": "6.7.0",
|
||||
"resolved": "https://registry.npmmirror.com/@typescript-eslint/typescript-estree/-/typescript-estree-6.7.0.tgz",
|
||||
"integrity": "sha512-dPvkXj3n6e9yd/0LfojNU8VMUGHWiLuBZvbM6V6QYD+2qxqInE7J+J/ieY2iGwR9ivf/R/haWGkIj04WVUeiSQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "6.6.0",
|
||||
"@typescript-eslint/visitor-keys": "6.6.0",
|
||||
"@typescript-eslint/types": "6.7.0",
|
||||
"@typescript-eslint/visitor-keys": "6.7.0",
|
||||
"debug": "^4.3.4",
|
||||
"globby": "^11.1.0",
|
||||
"is-glob": "^4.0.3",
|
||||
@@ -1760,12 +1760,12 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/visitor-keys": {
|
||||
"version": "6.6.0",
|
||||
"resolved": "https://registry.npmmirror.com/@typescript-eslint/visitor-keys/-/visitor-keys-6.6.0.tgz",
|
||||
"integrity": "sha512-L61uJT26cMOfFQ+lMZKoJNbAEckLe539VhTxiGHrWl5XSKQgA0RTBZJW2HFPy5T0ZvPVSD93QsrTKDkfNwJGyQ==",
|
||||
"version": "6.7.0",
|
||||
"resolved": "https://registry.npmmirror.com/@typescript-eslint/visitor-keys/-/visitor-keys-6.7.0.tgz",
|
||||
"integrity": "sha512-/C1RVgKFDmGMcVGeD8HjKv2bd72oI1KxQDeY8uc66gw9R0OK0eMq48cA+jv9/2Ag6cdrsUGySm1yzYmfz0hxwQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "6.6.0",
|
||||
"@typescript-eslint/types": "6.7.0",
|
||||
"eslint-visitor-keys": "^3.4.1"
|
||||
},
|
||||
"engines": {
|
||||
@@ -1880,17 +1880,17 @@
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@typescript-eslint/utils": {
|
||||
"version": "6.6.0",
|
||||
"resolved": "https://registry.npmmirror.com/@typescript-eslint/utils/-/utils-6.6.0.tgz",
|
||||
"integrity": "sha512-mPHFoNa2bPIWWglWYdR0QfY9GN0CfvvXX1Sv6DlSTive3jlMTUy+an67//Gysc+0Me9pjitrq0LJp0nGtLgftw==",
|
||||
"version": "6.7.0",
|
||||
"resolved": "https://registry.npmmirror.com/@typescript-eslint/utils/-/utils-6.7.0.tgz",
|
||||
"integrity": "sha512-MfCq3cM0vh2slSikQYqK2Gq52gvOhe57vD2RM3V4gQRZYX4rDPnKLu5p6cm89+LJiGlwEXU8hkYxhqqEC/V3qA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@eslint-community/eslint-utils": "^4.4.0",
|
||||
"@types/json-schema": "^7.0.12",
|
||||
"@types/semver": "^7.5.0",
|
||||
"@typescript-eslint/scope-manager": "6.6.0",
|
||||
"@typescript-eslint/types": "6.6.0",
|
||||
"@typescript-eslint/typescript-estree": "6.6.0",
|
||||
"@typescript-eslint/scope-manager": "6.7.0",
|
||||
"@typescript-eslint/types": "6.7.0",
|
||||
"@typescript-eslint/typescript-estree": "6.7.0",
|
||||
"semver": "^7.5.4"
|
||||
},
|
||||
"engines": {
|
||||
@@ -1901,35 +1901,35 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/scope-manager": {
|
||||
"version": "6.6.0",
|
||||
"resolved": "https://registry.npmmirror.com/@typescript-eslint/scope-manager/-/scope-manager-6.6.0.tgz",
|
||||
"integrity": "sha512-pT08u5W/GT4KjPUmEtc2kSYvrH8x89cVzkA0Sy2aaOUIw6YxOIjA8ilwLr/1fLjOedX1QAuBpG9XggWqIIfERw==",
|
||||
"version": "6.7.0",
|
||||
"resolved": "https://registry.npmmirror.com/@typescript-eslint/scope-manager/-/scope-manager-6.7.0.tgz",
|
||||
"integrity": "sha512-lAT1Uau20lQyjoLUQ5FUMSX/dS07qux9rYd5FGzKz/Kf8W8ccuvMyldb8hadHdK/qOI7aikvQWqulnEq2nCEYA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "6.6.0",
|
||||
"@typescript-eslint/visitor-keys": "6.6.0"
|
||||
"@typescript-eslint/types": "6.7.0",
|
||||
"@typescript-eslint/visitor-keys": "6.7.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^16.0.0 || >=18.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/types": {
|
||||
"version": "6.6.0",
|
||||
"resolved": "https://registry.npmmirror.com/@typescript-eslint/types/-/types-6.6.0.tgz",
|
||||
"integrity": "sha512-CB6QpJQ6BAHlJXdwUmiaXDBmTqIE2bzGTDLADgvqtHWuhfNP3rAOK7kAgRMAET5rDRr9Utt+qAzRBdu3AhR3sg==",
|
||||
"version": "6.7.0",
|
||||
"resolved": "https://registry.npmmirror.com/@typescript-eslint/types/-/types-6.7.0.tgz",
|
||||
"integrity": "sha512-ihPfvOp7pOcN/ysoj0RpBPOx3HQTJTrIN8UZK+WFd3/iDeFHHqeyYxa4hQk4rMhsz9H9mXpR61IzwlBVGXtl9Q==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": "^16.0.0 || >=18.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/typescript-estree": {
|
||||
"version": "6.6.0",
|
||||
"resolved": "https://registry.npmmirror.com/@typescript-eslint/typescript-estree/-/typescript-estree-6.6.0.tgz",
|
||||
"integrity": "sha512-hMcTQ6Al8MP2E6JKBAaSxSVw5bDhdmbCEhGW/V8QXkb9oNsFkA4SBuOMYVPxD3jbtQ4R/vSODBsr76R6fP3tbA==",
|
||||
"version": "6.7.0",
|
||||
"resolved": "https://registry.npmmirror.com/@typescript-eslint/typescript-estree/-/typescript-estree-6.7.0.tgz",
|
||||
"integrity": "sha512-dPvkXj3n6e9yd/0LfojNU8VMUGHWiLuBZvbM6V6QYD+2qxqInE7J+J/ieY2iGwR9ivf/R/haWGkIj04WVUeiSQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "6.6.0",
|
||||
"@typescript-eslint/visitor-keys": "6.6.0",
|
||||
"@typescript-eslint/types": "6.7.0",
|
||||
"@typescript-eslint/visitor-keys": "6.7.0",
|
||||
"debug": "^4.3.4",
|
||||
"globby": "^11.1.0",
|
||||
"is-glob": "^4.0.3",
|
||||
@@ -1946,12 +1946,12 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/visitor-keys": {
|
||||
"version": "6.6.0",
|
||||
"resolved": "https://registry.npmmirror.com/@typescript-eslint/visitor-keys/-/visitor-keys-6.6.0.tgz",
|
||||
"integrity": "sha512-L61uJT26cMOfFQ+lMZKoJNbAEckLe539VhTxiGHrWl5XSKQgA0RTBZJW2HFPy5T0ZvPVSD93QsrTKDkfNwJGyQ==",
|
||||
"version": "6.7.0",
|
||||
"resolved": "https://registry.npmmirror.com/@typescript-eslint/visitor-keys/-/visitor-keys-6.7.0.tgz",
|
||||
"integrity": "sha512-/C1RVgKFDmGMcVGeD8HjKv2bd72oI1KxQDeY8uc66gw9R0OK0eMq48cA+jv9/2Ag6cdrsUGySm1yzYmfz0hxwQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "6.6.0",
|
||||
"@typescript-eslint/types": "6.7.0",
|
||||
"eslint-visitor-keys": "^3.4.1"
|
||||
},
|
||||
"engines": {
|
||||
|
@@ -12,7 +12,7 @@
|
||||
"@babel/eslint-parser": "^7.22.15",
|
||||
"@element-plus/icons-vue": "^2.1.0",
|
||||
"@rushstack/eslint-patch": "^1.3.3",
|
||||
"@vue/eslint-config-typescript": "^11.0.3",
|
||||
"@vue/eslint-config-typescript": "^12.0.0",
|
||||
"babel": "^6.23.0",
|
||||
"echarts": "^5.4.3",
|
||||
"element-plus": "^2.3.12",
|
||||
@@ -25,7 +25,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/eslint-parser": "^7.22.15",
|
||||
"@typescript-eslint/eslint-plugin": "^6.6.0",
|
||||
"@typescript-eslint/eslint-plugin": "^6.7.0",
|
||||
"@vitejs/plugin-vue": "^4.3.4",
|
||||
"@vue/cli-plugin-eslint": "^5.0.8",
|
||||
"axios": "~1.5.0",
|
||||
|
@@ -12,4 +12,7 @@
|
||||
|
||||
// testRankingListRequest();
|
||||
|
||||
const arr: string[] = [];
|
||||
|
||||
console.log( "test" );
|
||||
console.log( "检查instanceof:", arr instanceof String );
|
||||
|
@@ -26,4 +26,12 @@ export const API_URL = {
|
||||
|
||||
// 坐席业绩查询
|
||||
URL_CALLER_ARCHIEVEMENT: "http://10.39.0.41:8081/desktop_archievement_backend/archievement/query_caller_archievement.do",
|
||||
|
||||
/** 奖项相关 **/
|
||||
// 查询奖励项目
|
||||
// URL_RWARD_PROJECTS: "http://222.76.244.118:11101/desktop_archievement_backend/rewards/query_reward_projects.do"
|
||||
URL_RWARD_PROJECTS: "http://10.39.0.41:8081/desktop_archievement_backend/rewards/query_reward_projects.do",
|
||||
// 查询获奖人员
|
||||
// URL_REWARD_GAINERS: "http://{{生产地址}}/desktop_archievement_backend/rewards/query_reward_gainers.do"
|
||||
URL_REWARD_GAINERS: "http://222.76.244.118:11101/desktop_archievement_backend/rewards/query_reward_gainers.do",
|
||||
};
|
||||
|
181
code/web/task_schedule/src/utils/reward.ts
Normal file
181
code/web/task_schedule/src/utils/reward.ts
Normal file
@@ -0,0 +1,181 @@
|
||||
/*
|
||||
* @Author: Kane
|
||||
* @Date: 2023-09-11 09:59:00
|
||||
* @LastEditors: Kane
|
||||
* @FilePath: /task_schedule/src/utils/reward.ts
|
||||
* @Description: 奖励相关的API
|
||||
*
|
||||
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||
*/
|
||||
import { type AxiosResponse } from "axios";
|
||||
import { service as instance } from "./api/request.js";
|
||||
import { API_URL } from "./api/config.js";
|
||||
|
||||
interface RewardProject
|
||||
{
|
||||
rewardCode: number;
|
||||
rewardName: string;
|
||||
}
|
||||
|
||||
interface RewardProjectResponse
|
||||
{
|
||||
success: boolean;
|
||||
message: string;
|
||||
rewardList: RewardProject[] | null;
|
||||
}
|
||||
|
||||
interface RewardGainer
|
||||
{
|
||||
recID: number;
|
||||
callerName: string;
|
||||
callerCode: string;
|
||||
rewardProjectCode: string;
|
||||
rewardProjectName: string;
|
||||
}
|
||||
|
||||
interface RewardGainerResponse
|
||||
{
|
||||
success: boolean;
|
||||
message: string;
|
||||
gainerList: RewardGainer[] | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 请求奖项清单
|
||||
* @param handler 用于处理请求数据的回调函数;
|
||||
*/
|
||||
function requestRewardPorjectsList( handler: any ): void
|
||||
{
|
||||
if ( handler === undefined || handler === null )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
const rewardResponse: RewardProjectResponse = {
|
||||
success: false,
|
||||
message: "",
|
||||
rewardList: [],
|
||||
};
|
||||
|
||||
instance.request({
|
||||
url: API_URL.URL_RWARD_PROJECTS,
|
||||
method: "post",
|
||||
})
|
||||
// 请求成功,检查服务器返回结果
|
||||
.then(( response: AxiosResponse<any, any> ): void =>
|
||||
{
|
||||
const data = response.data ?? {};
|
||||
rewardResponse.success = data.success ?? false;
|
||||
rewardResponse.message = data.message ?? "";
|
||||
rewardResponse.rewardList = checkRewardProjects( data.rewardList ?? []);
|
||||
|
||||
handler( rewardResponse, null );
|
||||
})
|
||||
.catch(( error: any ): void =>
|
||||
{
|
||||
console.log( error );
|
||||
|
||||
rewardResponse.success = false;
|
||||
|
||||
handler( rewardResponse, error );
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param handler
|
||||
*/
|
||||
function requestRewardGainers( handler: any ): void
|
||||
{
|
||||
if ( handler === undefined || handler === null )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
const rewardResponse: RewardGainerResponse = {
|
||||
success: false,
|
||||
message: "",
|
||||
gainerList: [],
|
||||
};
|
||||
|
||||
instance.request({
|
||||
url: API_URL.URL_REWARD_GAINERS,
|
||||
method: "post",
|
||||
})
|
||||
.then(( response: AxiosResponse<any, any> ): void =>
|
||||
{
|
||||
const data = response.data ?? {};
|
||||
|
||||
rewardResponse.success = data.success;
|
||||
rewardResponse.message = data.message;
|
||||
rewardResponse.gainerList = checkRewardGainers( data.gainerList );
|
||||
|
||||
handler( rewardResponse, null );
|
||||
})
|
||||
.catch(( error: any ): void =>
|
||||
{
|
||||
console.log( error );
|
||||
|
||||
rewardResponse.success = false;
|
||||
|
||||
handler( rewardResponse, error );
|
||||
});
|
||||
}
|
||||
|
||||
// **功能函数 **********************************/
|
||||
function checkRewardProjects( data: any[]): RewardProject[] | null
|
||||
{
|
||||
const rewardList: RewardProject[] = [];
|
||||
|
||||
// 检查一下参数的类型,如果不是数组返回 null
|
||||
if ( !( data instanceof Array ))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
data.forEach(( item: any ) =>
|
||||
{
|
||||
const reward = {
|
||||
rewardCode: item.rewardCode ?? "",
|
||||
rewardName: item.rewardName ?? "",
|
||||
};
|
||||
|
||||
rewardList.push( reward );
|
||||
});
|
||||
|
||||
return rewardList;
|
||||
}
|
||||
|
||||
function checkRewardGainers( gainers: any[]): RewardGainer[] | null
|
||||
{
|
||||
const gainerList: RewardGainer[] = [];
|
||||
|
||||
if ( !( gainers instanceof Array ))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
gainers.forEach(( item: RewardGainer ): void =>
|
||||
{
|
||||
const gainer: RewardGainer = {
|
||||
recID: item.recID ?? "",
|
||||
callerName: item.callerName ?? "",
|
||||
callerCode: item.callerCode ?? "",
|
||||
rewardProjectCode: item.rewardProjectCode ?? "",
|
||||
rewardProjectName: item.rewardProjectName ?? "",
|
||||
};
|
||||
|
||||
gainerList.push( gainer );
|
||||
});
|
||||
|
||||
return gainerList;
|
||||
}
|
||||
|
||||
export {
|
||||
type RewardProject,
|
||||
type RewardGainer,
|
||||
type RewardProjectResponse,
|
||||
type RewardGainerResponse,
|
||||
requestRewardPorjectsList,
|
||||
requestRewardGainers
|
||||
};
|
@@ -2,25 +2,318 @@
|
||||
* @Author: Kane
|
||||
* @Date: 2023-03-23 16:05:08
|
||||
* @LastEditors: Kane
|
||||
* @FilePath: /task_schedule/src/views/DataManagemant.vue
|
||||
* @FilePath: /task_schedule/src/views/DataManagement.vue
|
||||
* @Description:
|
||||
*
|
||||
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||
-->
|
||||
<template>
|
||||
<div>
|
||||
数据管理
|
||||
<div
|
||||
v-if="ui.showUI"
|
||||
class="wrapper"
|
||||
>
|
||||
<div class="reward-wrapper">
|
||||
<div class="reward-gainer-wrapper">
|
||||
<el-divider content-position="left">
|
||||
90俱乐部
|
||||
</el-divider>
|
||||
<div class="toolbutton-wrapper">
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="documentAdd"
|
||||
>
|
||||
新增
|
||||
</el-button>
|
||||
<el-button
|
||||
type="danger"
|
||||
icon="delete"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
<el-button
|
||||
type="warning"
|
||||
icon="Refresh"
|
||||
@click="refresh"
|
||||
>
|
||||
刷新
|
||||
</el-button>
|
||||
</div>
|
||||
<el-table
|
||||
border
|
||||
stripe
|
||||
style="width:100%;"
|
||||
:height="tableHeight"
|
||||
:data="rewardGainerData"
|
||||
>
|
||||
<el-table-column type="selection" />
|
||||
<el-table-column
|
||||
label="坐席名称"
|
||||
align="center"
|
||||
>
|
||||
<template #default="rewardGainer">
|
||||
<span
|
||||
class="reward-gainer-td"
|
||||
@dblclick="onEditRewardGainer(rewardGainer.row.recID, rewardGainer.row.callerName, rewardGainer.row.rewardProjectCode)"
|
||||
>{{ rewardGainer.row.callerName }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="奖项名称"
|
||||
align="center"
|
||||
>
|
||||
<template #default="rewardGainer">
|
||||
<span
|
||||
class="reward-gainer-td"
|
||||
@dblclick="onEditRewardGainer( rewardGainer.row.recID, rewardGainer.row.callerName, rewardGainer.row.rewardProjectCode)"
|
||||
>{{ rewardGainer.row.rewardProjectName }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="pagination-wrapper">
|
||||
<el-pagination
|
||||
v-model="ui.tablePageIndex"
|
||||
class="pull_left"
|
||||
size="small"
|
||||
background
|
||||
:page-size="ui.tablePageSize"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="(ui.rewardGainerList ?? []).length"
|
||||
@current-change="onCurrentPageIndexChange"
|
||||
@size-change="onTablePageSizeChange"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
v-if="ui.showEditRewardGainerDialog"
|
||||
class="dialog-wrapper"
|
||||
>
|
||||
<el-dialog
|
||||
v-model="ui.showEditRewardGainerDialog"
|
||||
title="编辑获奖人员"
|
||||
width="400px"
|
||||
>
|
||||
<RewardGainerDialog
|
||||
:selected-rec-id="(ui.selectedRecID ?? -9999)"
|
||||
:selected-reward-project-code="ui.selectedRewardProjectCode"
|
||||
:selected-telsaler-name="ui.selectedTelsalerName"
|
||||
/>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
import { reactive, computed, onBeforeMount } from "vue";
|
||||
import {
|
||||
type RewardProject,
|
||||
type RewardGainer,
|
||||
type RewardProjectResponse,
|
||||
type RewardGainerResponse,
|
||||
requestRewardPorjectsList,
|
||||
requestRewardGainers
|
||||
} from "@/utils/reward.js";
|
||||
import { ElMessageBox } from "element-plus";
|
||||
import RewardGainerDialog from "@/views/reward/RewardTelsaler.vue";
|
||||
|
||||
interface UI
|
||||
{
|
||||
showUI: boolean;
|
||||
showEditRewardGainerDialog: boolean;
|
||||
rewardGainerList: RewardGainer[] | null;
|
||||
tablePageIndex: number;
|
||||
tablePageSize: number;
|
||||
selectedRecID: number | null;
|
||||
selectedTelsalerName: string;
|
||||
selectedRewardProjectCode: number;
|
||||
}
|
||||
|
||||
export default {
|
||||
name: "DataManagement",
|
||||
components: { RewardGainerDialog, },
|
||||
setup()
|
||||
{
|
||||
return {};
|
||||
const ui: UI = reactive({
|
||||
showUI: true,
|
||||
showEditRewardGainerDialog: false,
|
||||
rewardGainerList: null,
|
||||
tablePageIndex: 1,
|
||||
tablePageSize: 10,
|
||||
selectedRecID: null,
|
||||
selectedTelsalerName: "",
|
||||
selectedRewardProjectCode: -999,
|
||||
});
|
||||
|
||||
/** 请求数据相关 ***************************/
|
||||
const applyGainerList = ( response: RewardGainerResponse, error: any ): void =>
|
||||
{
|
||||
if ( !response.success )
|
||||
{
|
||||
console.log( error );
|
||||
|
||||
ElMessageBox({
|
||||
message: "请求获奖人列表失败,请查看日志!",
|
||||
type: "error",
|
||||
center: true,
|
||||
})
|
||||
.then((): void => {})
|
||||
.catch((): void => {});
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
ui.rewardGainerList = response.gainerList;
|
||||
|
||||
console.log( "请求获奖人员列表", ui.rewardGainerList );
|
||||
};
|
||||
|
||||
/** 表格相关 ***************************/
|
||||
const tableHeight = computed((): number =>
|
||||
{
|
||||
return ( ui.tablePageSize + 1 ) * 40;
|
||||
});
|
||||
|
||||
/**
|
||||
* 用于根据分页组件的参数,生成表格用的数据。
|
||||
*/
|
||||
const rewardGainerData = computed((): RewardGainer[] =>
|
||||
{
|
||||
// 防御性验证
|
||||
if ( ui.rewardGainerList === null )
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
const startIndex = ui.tablePageSize * ( ui.tablePageIndex - 1 );
|
||||
const endIndex = startIndex + ui.tablePageSize;
|
||||
const data = ui.rewardGainerList.slice( startIndex, endIndex );
|
||||
console.log( ui.tablePageSize, ui.tablePageIndex );
|
||||
console.log( "表格数据:", data );
|
||||
|
||||
return data;
|
||||
});
|
||||
|
||||
const onCurrentPageIndexChange = ( pageIndex: number ): void =>
|
||||
{
|
||||
ui.tablePageIndex = pageIndex;
|
||||
};
|
||||
|
||||
const onTablePageSizeChange = ( pageSize: number ): void =>
|
||||
{
|
||||
ui.tablePageSize = pageSize;
|
||||
};
|
||||
|
||||
// 表格编辑相关
|
||||
/**
|
||||
* 响应用户在表格中的双击
|
||||
* @param telsalerName
|
||||
* @param rewardProjectName
|
||||
*/
|
||||
const onEditRewardGainer = ( recID: number, telsalerName: string, rewardProjectCode: number ): void =>
|
||||
{
|
||||
console.log( "编辑获奖清单", recID, telsalerName, rewardProjectCode );
|
||||
|
||||
ui.selectedRecID = recID;
|
||||
ui.selectedTelsalerName = telsalerName;
|
||||
ui.selectedRewardProjectCode = rewardProjectCode;
|
||||
ui.showEditRewardGainerDialog = true;
|
||||
};
|
||||
|
||||
/**
|
||||
* 用于刷新页面
|
||||
*/
|
||||
const refresh = (): void =>
|
||||
{
|
||||
requestRewardGainers( applyGainerList );
|
||||
};
|
||||
|
||||
onBeforeMount((): void =>
|
||||
{
|
||||
refresh();
|
||||
});
|
||||
|
||||
return {
|
||||
ui,
|
||||
tableHeight,
|
||||
rewardGainerData,
|
||||
onCurrentPageIndexChange,
|
||||
onTablePageSizeChange,
|
||||
onEditRewardGainer,
|
||||
refresh,
|
||||
};
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import "@/assets/css/public/_public.scss";
|
||||
|
||||
.wrapper {
|
||||
margin: 10px;
|
||||
padding: 10px;
|
||||
|
||||
// background-color: #fff;
|
||||
// border-radius: 5px;
|
||||
// box-shadow: $box-shadow;
|
||||
|
||||
// &:hover {
|
||||
// box-shadow: $box-shadow-hover;
|
||||
// }
|
||||
|
||||
min-width: 800px;
|
||||
|
||||
>*+* {
|
||||
margin-top: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.reward-wrapper {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
>div {
|
||||
background-color: #fff;
|
||||
border-radius: 5px;
|
||||
box-shadow: $box-shadow;
|
||||
|
||||
padding: 10px;
|
||||
|
||||
&:hover {
|
||||
box-shadow: $box-shadow-hover;
|
||||
}
|
||||
}
|
||||
|
||||
>*+* {
|
||||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.reward-gainer-wrapper {
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
.dishonor-wrapper {
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
.toolbutton-wrapper {
|
||||
text-align: left;
|
||||
margin-bottom: 10px;
|
||||
>*+* {
|
||||
margin-left: 15px;
|
||||
}
|
||||
}
|
||||
|
||||
.pagination-wrapper {
|
||||
margin-top: 10px;
|
||||
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.reward-gainer-td {
|
||||
cursor: pointer;
|
||||
|
||||
display: block;
|
||||
}
|
||||
</style>
|
||||
|
@@ -26,7 +26,7 @@ export default {
|
||||
{
|
||||
height: 2000px;
|
||||
width: 2000px;
|
||||
background-color: aquamarine;
|
||||
// background-color: aquamarine;
|
||||
padding: 0px;
|
||||
}
|
||||
</style>
|
||||
|
@@ -188,4 +188,5 @@ export default {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
171
code/web/task_schedule/src/views/reward/RewardTelsaler.vue
Normal file
171
code/web/task_schedule/src/views/reward/RewardTelsaler.vue
Normal file
@@ -0,0 +1,171 @@
|
||||
<!--
|
||||
* @Author: Kane
|
||||
* @Date: 2023-09-12 10:43:39
|
||||
* @LastEditors: Kane
|
||||
* @FilePath: /task_schedule/src/views/reward/RewardTelsaler.vue
|
||||
* @Description:
|
||||
*
|
||||
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||
-->
|
||||
<template>
|
||||
<div
|
||||
v-if="ui.showUI"
|
||||
class="reward-gainer-wrapper"
|
||||
>
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="8">
|
||||
<span>奖励类型</span>
|
||||
</el-col>
|
||||
<el-col :span="16">
|
||||
<el-select
|
||||
v-model="ui.selectedRewardProjectCode"
|
||||
value-key="rewardCode"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in ui.rewardProjectList"
|
||||
:key="item.rewardCode"
|
||||
:label="item.rewardName"
|
||||
:value="item.rewardCode"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="8">
|
||||
<span>坐席名称</span>
|
||||
</el-col>
|
||||
<el-col :span="16">
|
||||
<el-input v-model.trim.lazy="ui.selectedRewardTelsalerName" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div class="tool-button-wrapper">
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="select"
|
||||
>
|
||||
保存
|
||||
</el-button>
|
||||
<el-button
|
||||
type="danger"
|
||||
icon="Close"
|
||||
>
|
||||
放弃
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
import { reactive, onBeforeMount } from "vue";
|
||||
import
|
||||
{
|
||||
type RewardProject,
|
||||
type RewardGainer,
|
||||
type RewardProjectResponse,
|
||||
type RewardGainerResponse,
|
||||
requestRewardPorjectsList,
|
||||
requestRewardGainers
|
||||
} from "@/utils/reward.js";
|
||||
import { ElMessageBox } from "element-plus";
|
||||
|
||||
interface RewardGainerUI
|
||||
{
|
||||
showUI: boolean;
|
||||
showEditRewardGainerDialog: boolean;
|
||||
rewardProjectList: RewardProject[] | null;
|
||||
selectedRewardProjectCode: number | undefined;
|
||||
selectedRewardTelsalerName: string;
|
||||
selectedRecID: number;
|
||||
}
|
||||
|
||||
export default {
|
||||
name: "RewardTelsaler",
|
||||
props: {
|
||||
selectedRecId: {
|
||||
type: Number,
|
||||
require: true,
|
||||
default: (): number => -9999,
|
||||
},
|
||||
selectedRewardProjectCode: {
|
||||
type: Number,
|
||||
require: true,
|
||||
default: (): number => -999,
|
||||
},
|
||||
selectedTelsalerName: {
|
||||
type: String,
|
||||
require: true,
|
||||
default: (): string => "",
|
||||
},
|
||||
},
|
||||
setup( props )
|
||||
{
|
||||
const ui: RewardGainerUI = reactive({
|
||||
showUI: true,
|
||||
showEditRewardGainerDialog: false,
|
||||
rewardProjectList: [],
|
||||
selectedRewardProjectCode: 1,
|
||||
selectedRewardTelsalerName: "",
|
||||
selectedRecID: 0,
|
||||
});
|
||||
|
||||
const applyRewardProjectsData = ( response: RewardProjectResponse, error: any ): void =>
|
||||
{
|
||||
if ( !response.success )
|
||||
{
|
||||
ElMessageBox({
|
||||
message: "请求奖励项目失败,请查看日志!",
|
||||
type: "error",
|
||||
})
|
||||
.then((): void => {})
|
||||
.catch((): void => {});
|
||||
|
||||
console.log( "请求奖励项目失败:", error );
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
console.log( "请求奖励项目结果", response.rewardList );
|
||||
|
||||
ui.rewardProjectList = response.rewardList;
|
||||
};
|
||||
|
||||
const refresh = (): void =>
|
||||
{
|
||||
requestRewardPorjectsList( applyRewardProjectsData );
|
||||
};
|
||||
|
||||
onBeforeMount((): void =>
|
||||
{
|
||||
ui.selectedRewardProjectCode = props.selectedRewardProjectCode;
|
||||
ui.selectedRewardTelsalerName = props.selectedTelsalerName;
|
||||
ui.selectedRecID = props.selectedRecId;
|
||||
|
||||
refresh();
|
||||
|
||||
console.log( props.selectedRewardProjectCode );
|
||||
});
|
||||
|
||||
// onBeforeUpdate((): void =>
|
||||
// {
|
||||
// refresh();
|
||||
// });
|
||||
|
||||
return { ui, };
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import "@/assets/css/public/_public.scss";
|
||||
|
||||
.reward-gainer-wrapper {
|
||||
width: 300px;
|
||||
|
||||
@include query-box-wrap;
|
||||
}
|
||||
|
||||
.tool-button-wrapper {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
|
||||
margin-top: 15px;
|
||||
}
|
||||
</style>
|
@@ -122,10 +122,19 @@
|
||||
<artifactId>mybatis</artifactId>
|
||||
<version>3.5.13</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
<build>
|
||||
<finalName>desktop_archievement_backend</finalName>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<includes>
|
||||
<include>**/*.properties</include>
|
||||
<include>**/*.xml</include>
|
||||
</includes>
|
||||
<filtering>false</filtering>
|
||||
</resource>
|
||||
</resources>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
|
@@ -12,8 +12,13 @@ package com.cpic.xim.mybatis.mapper;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import com.cpic.xim.mybatis.pojo.RewardProject;
|
||||
import com.cpic.xim.mybatis.pojo.RewardGainer;
|
||||
|
||||
public interface RewardsMapper
|
||||
{
|
||||
public ArrayList<RewardProject> queryRewardProjects();
|
||||
|
||||
public ArrayList<RewardGainer> queryRewardTelsaler();
|
||||
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,149 @@
|
||||
/*
|
||||
* @Author: Kane
|
||||
* @Date: 2023-09-07 15:18:46
|
||||
* @LastEditors: Kane
|
||||
* @FilePath: /desktop_archievement_backend/src/main/java/com/cpic/xim/mybatis/pojo/RewardGainer.java
|
||||
* @Description: 获奖人对象
|
||||
*
|
||||
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||
*/
|
||||
package com.cpic.xim.mybatis.pojo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
public class RewardGainer
|
||||
{
|
||||
public RewardGainer()
|
||||
{}
|
||||
|
||||
public RewardGainer( int recID, String callerName, String callerCode, int rewardProjectCode,
|
||||
String rewardProjectName)
|
||||
{
|
||||
this.recID = recID;
|
||||
this.callerName = callerName;
|
||||
this.callerCode = callerCode;
|
||||
this.rewardProjectCode = rewardProjectCode;
|
||||
this.rewardProjectName = rewardProjectName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "RewardGainer [recID=" + recID + ", callerName=" + callerName + ", callerCode="
|
||||
+ callerCode + ", rewardProjectCode=" + rewardProjectCode + ", rewardProjectName="
|
||||
+ rewardProjectName + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + recID;
|
||||
result = prime * result + ((callerName == null) ? 0 : callerName.hashCode());
|
||||
result = prime * result + ((callerCode == null) ? 0 : callerCode.hashCode());
|
||||
result = prime * result + rewardProjectCode;
|
||||
result = prime * result + ((rewardProjectName == null) ? 0 : rewardProjectName.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals( Object obj )
|
||||
{
|
||||
if ( this == obj )
|
||||
return true;
|
||||
if ( obj == null )
|
||||
return false;
|
||||
if ( getClass() != obj.getClass() )
|
||||
return false;
|
||||
RewardGainer other = (RewardGainer) obj;
|
||||
if ( recID != other.recID )
|
||||
return false;
|
||||
if ( callerName == null )
|
||||
{
|
||||
if ( other.callerName != null )
|
||||
return false;
|
||||
} else if ( !callerName.equals( other.callerName ) )
|
||||
return false;
|
||||
if ( callerCode == null )
|
||||
{
|
||||
if ( other.callerCode != null )
|
||||
return false;
|
||||
} else if ( !callerCode.equals( other.callerCode ) )
|
||||
return false;
|
||||
if ( rewardProjectCode != other.rewardProjectCode )
|
||||
return false;
|
||||
if ( rewardProjectName == null )
|
||||
{
|
||||
if ( other.rewardProjectName != null )
|
||||
return false;
|
||||
} else if ( !rewardProjectName.equals( other.rewardProjectName ) )
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
public int getRecID()
|
||||
{
|
||||
return recID;
|
||||
}
|
||||
|
||||
public void setRecID( int recID )
|
||||
{
|
||||
this.recID = recID;
|
||||
}
|
||||
|
||||
public String getCallerName()
|
||||
{
|
||||
return callerName;
|
||||
}
|
||||
|
||||
public void setCallerName( String callerName )
|
||||
{
|
||||
this.callerName = callerName;
|
||||
}
|
||||
|
||||
public String getCallerCode()
|
||||
{
|
||||
return callerCode;
|
||||
}
|
||||
|
||||
public void setCallerCode( String callerCode )
|
||||
{
|
||||
this.callerCode = callerCode;
|
||||
}
|
||||
|
||||
public int getRewardProjectCode()
|
||||
{
|
||||
return rewardProjectCode;
|
||||
}
|
||||
|
||||
public void setRewardProjectCode( int rewardProjectCode )
|
||||
{
|
||||
this.rewardProjectCode = rewardProjectCode;
|
||||
}
|
||||
|
||||
public String getRewardProjectName()
|
||||
{
|
||||
return rewardProjectName;
|
||||
}
|
||||
|
||||
public void setRewardProjectName( String rewardProjectName )
|
||||
{
|
||||
this.rewardProjectName = rewardProjectName;
|
||||
}
|
||||
|
||||
@JsonProperty( "recID" )
|
||||
private int recID;
|
||||
|
||||
@JsonProperty( "callerName" )
|
||||
private String callerName;
|
||||
|
||||
@JsonProperty( "callerCode" )
|
||||
private String callerCode;
|
||||
|
||||
@JsonProperty( "rewardProjectCode" )
|
||||
private int rewardProjectCode;
|
||||
|
||||
@JsonProperty( "rewardProjectName" )
|
||||
private String rewardProjectName;
|
||||
}
|
@@ -28,8 +28,7 @@ public class MybatisUtils
|
||||
* @return
|
||||
* @throws IOException
|
||||
*/
|
||||
public static SqlSession getSqlSession(String configFile )
|
||||
throws IOException
|
||||
public static SqlSession getSqlSession( String configFile ) throws IOException
|
||||
{
|
||||
// 根据配置文件的路径,查找是否已经创建了对应的session
|
||||
SqlSession session = SessionMap.get( configFile );
|
||||
@@ -51,8 +50,7 @@ public class MybatisUtils
|
||||
return session;
|
||||
}
|
||||
|
||||
public static SqlSession getSqlSession()
|
||||
throws IOException
|
||||
public static SqlSession getSqlSession() throws IOException
|
||||
{
|
||||
// 根据配置文件的路径,查找是否已经创建了对应的session
|
||||
SqlSession session = SessionMap.get( DEFAULT_CONFIGFILE );
|
||||
|
@@ -11,14 +11,14 @@ package com.cpic.xim.web.controllers;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
public class QueryResult {
|
||||
public class QueryResponse {
|
||||
|
||||
public QueryResult(boolean success, String message) {
|
||||
public QueryResponse(boolean success, String message) {
|
||||
this.success = success;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public QueryResult() {
|
||||
public QueryResponse() {
|
||||
this.success = false;
|
||||
this.message = "";
|
||||
}
|
||||
@@ -53,7 +53,7 @@ public class QueryResult {
|
||||
if (this == obj) return true;
|
||||
if (obj == null) return false;
|
||||
if (getClass() != obj.getClass()) return false;
|
||||
QueryResult other = (QueryResult) obj;
|
||||
QueryResponse other = (QueryResponse) obj;
|
||||
if (success != other.success) return false;
|
||||
if (message == null) {
|
||||
if (other.message != null) return false;
|
@@ -9,10 +9,10 @@
|
||||
*/
|
||||
package com.cpic.xim.web.controllers.account;
|
||||
|
||||
import com.cpic.xim.web.controllers.QueryResult;
|
||||
import com.cpic.xim.web.controllers.QueryResponse;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
public class TeleSalerQueryResult extends QueryResult
|
||||
public class TeleSalerQueryResult extends QueryResponse
|
||||
{
|
||||
|
||||
public TeleSalerQueryResult()
|
||||
|
@@ -11,10 +11,10 @@ package com.cpic.xim.web.controllers.archievement.RankingList;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import com.cpic.xim.utils.ranking.CallerRankingItem;
|
||||
import com.cpic.xim.web.controllers.QueryResult;
|
||||
import com.cpic.xim.web.controllers.QueryResponse;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
public class RankingListResponse extends QueryResult
|
||||
public class RankingListResponse extends QueryResponse
|
||||
{
|
||||
public RankingListResponse()
|
||||
{
|
||||
|
@@ -10,11 +10,11 @@
|
||||
package com.cpic.xim.web.controllers.archievement.caller;
|
||||
|
||||
import com.cpic.xim.mybatis.pojo.MensualArchievementItem;
|
||||
import com.cpic.xim.web.controllers.QueryResult;
|
||||
import com.cpic.xim.web.controllers.QueryResponse;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class CallerArchievementQueryResult extends QueryResult
|
||||
public class CallerArchievementQueryResult extends QueryResponse
|
||||
{
|
||||
/**
|
||||
*
|
||||
|
@@ -14,14 +14,14 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Vector;
|
||||
import com.cpic.xim.mybatis.pojo.MensualArchievementItem;
|
||||
import com.cpic.xim.web.controllers.QueryResult;
|
||||
import com.cpic.xim.web.controllers.QueryResponse;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
/**
|
||||
* 查询部门业绩返回结果。
|
||||
* MensualArchievementList 每月业绩,要保证数据是按照月份排序。
|
||||
*/
|
||||
public class DepartmentArchievementQueryResult extends QueryResult
|
||||
public class DepartmentArchievementQueryResult extends QueryResponse
|
||||
{
|
||||
public DepartmentArchievementQueryResult()
|
||||
{
|
||||
@@ -46,7 +46,8 @@ public class DepartmentArchievementQueryResult extends QueryResult
|
||||
return mensualArchievementList;
|
||||
}
|
||||
|
||||
public void setMensualArchievementList( ArrayList<MensualArchievementItem> mensualArchievementList )
|
||||
public void setMensualArchievementList(
|
||||
ArrayList<MensualArchievementItem> mensualArchievementList )
|
||||
{
|
||||
this.mensualArchievementList = mensualArchievementList;
|
||||
}
|
||||
|
@@ -19,6 +19,7 @@ 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.RewardGainer;
|
||||
import com.cpic.xim.mybatis.pojo.RewardProject;
|
||||
import com.cpic.xim.mybatis.utils.MybatisUtils;
|
||||
|
||||
@@ -29,7 +30,8 @@ public class RewardController
|
||||
// 日志
|
||||
private static Logger logger = LoggerFactory.getLogger( RewardController.class );
|
||||
|
||||
private RewardController() {}
|
||||
private RewardController()
|
||||
{}
|
||||
|
||||
/**
|
||||
* 相应查询获奖项目清单的请求
|
||||
@@ -43,6 +45,8 @@ public class RewardController
|
||||
|
||||
SqlSession session = null;
|
||||
|
||||
logger.debug( "查询奖项清单。" );
|
||||
|
||||
try
|
||||
{
|
||||
session = MybatisUtils.getSqlSession();
|
||||
@@ -53,12 +57,43 @@ public class RewardController
|
||||
response.setSuccess( true );
|
||||
response.setMessage( "查询成功!" );
|
||||
response.setRewardList( rewards );
|
||||
|
||||
logger.debug( "查询奖项清单," + response.getMessage() + "," + rewards.toString() );
|
||||
}
|
||||
catch ( IOException error )
|
||||
{
|
||||
response.setSuccess( false );
|
||||
response.setMessage( "查询失败!" + error.getMessage() );
|
||||
response.setRewardList( null );
|
||||
|
||||
logger.debug( "查询奖项清单," + response.getMessage() + "," + error.getMessage() );
|
||||
}
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
@PostMapping( "/query_reward_gainers.do" )
|
||||
@ResponseBody
|
||||
RewardGainersResponse queryRewardGainers()
|
||||
{
|
||||
RewardGainersResponse response = new RewardGainersResponse();
|
||||
|
||||
try
|
||||
{
|
||||
SqlSession session = MybatisUtils.getSqlSession();
|
||||
RewardsMapper mapper = session.getMapper( RewardsMapper.class );
|
||||
|
||||
ArrayList<RewardGainer> gainers = mapper.queryRewardTelsaler();
|
||||
|
||||
response.setSuccess( true );
|
||||
response.setMessage( "查询成功!" );
|
||||
response.setGainerList( gainers );
|
||||
}
|
||||
catch ( IOException error )
|
||||
{
|
||||
response.setSuccess( false );
|
||||
response.setMessage( "查询失败!" + error.getMessage() );
|
||||
response.setGainerList( null );
|
||||
}
|
||||
|
||||
return response;
|
||||
|
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* @Author: Kane
|
||||
* @Date: 2023-09-07 17:16:12
|
||||
* @LastEditors: Kane
|
||||
* @FilePath: /desktop_archievement_backend/src/main/java/com/cpic/xim/web/controllers/rewards/RewardGainersResponse.java
|
||||
* @Description:
|
||||
*
|
||||
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||
*/
|
||||
|
||||
package com.cpic.xim.web.controllers.rewards;
|
||||
|
||||
import com.cpic.xim.mybatis.pojo.RewardGainer;
|
||||
import com.cpic.xim.web.controllers.QueryResponse;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class RewardGainersResponse extends QueryResponse
|
||||
{
|
||||
public RewardGainersResponse( boolean success, String message,
|
||||
ArrayList<RewardGainer> gainerList)
|
||||
{
|
||||
super( success, message );
|
||||
|
||||
this.gainerList = gainerList;
|
||||
}
|
||||
|
||||
public RewardGainersResponse()
|
||||
{
|
||||
super();
|
||||
|
||||
this.gainerList = null;
|
||||
}
|
||||
|
||||
public ArrayList<RewardGainer> getGainerList()
|
||||
{
|
||||
return gainerList;
|
||||
}
|
||||
|
||||
public void setGainerList( ArrayList<RewardGainer> gainerList )
|
||||
{
|
||||
this.gainerList = gainerList;
|
||||
}
|
||||
|
||||
@JsonProperty( "gainerList" )
|
||||
private ArrayList<RewardGainer> gainerList;
|
||||
}
|
@@ -10,11 +10,11 @@
|
||||
package com.cpic.xim.web.controllers.rewards;
|
||||
|
||||
import com.cpic.xim.mybatis.pojo.RewardProject;
|
||||
import com.cpic.xim.web.controllers.QueryResult;
|
||||
import com.cpic.xim.web.controllers.QueryResponse;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class RewardProjectsResponse extends QueryResult
|
||||
public class RewardProjectsResponse extends QueryResponse
|
||||
{
|
||||
public RewardProjectsResponse( boolean success, String message,
|
||||
ArrayList<RewardProject> rewardList)
|
||||
|
@@ -8,4 +8,23 @@
|
||||
<id property="rewardCode" column="reward_index" />
|
||||
<result property="rewardName" column="reward_name" javaType="String"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="queryRewardTelsaler" resultMap="RewardGainerMapper">
|
||||
SELECT hjr.rec_id rec_id,
|
||||
hjr.telsaler_name telsaler_name,
|
||||
hjr.telsaler_code telsaler_code,
|
||||
xm.reward_name reward_name,
|
||||
xm.reward_index reward_index
|
||||
FROM telsaler_reward hjr,
|
||||
reward_projects xm
|
||||
WHERE hjr.reward_index = xm.reward_index
|
||||
order by xm.reward_index desc
|
||||
</select>
|
||||
<resultMap id="RewardGainerMapper" type="com.cpic.xim.mybatis.pojo.RewardGainer">
|
||||
<id column="rec_id" property="recID" />
|
||||
<result column="telsaler_name" property="callerName" />
|
||||
<result column="telsaler_code" property="callerCode" />
|
||||
<result column="reward_name" property="rewardProjectName" />
|
||||
<result column="reward_index" property="rewardProjectCode" />
|
||||
</resultMap>
|
||||
</mapper>
|
@@ -25,6 +25,7 @@ import org.slf4j.LoggerFactory;
|
||||
import com.cpic.xim.mybatis.mapper.ArchievementMapper;
|
||||
import com.cpic.xim.mybatis.mapper.RewardsMapper;
|
||||
import com.cpic.xim.mybatis.pojo.MensualArchievementItem;
|
||||
import com.cpic.xim.mybatis.pojo.RewardGainer;
|
||||
import com.cpic.xim.mybatis.pojo.RewardProject;
|
||||
import com.cpic.xim.mybatis.utils.MybatisUtils;
|
||||
import com.cpic.xim.utils.ranking.CallerRankingList;
|
||||
@@ -135,4 +136,27 @@ public class DesktopArchievementTest
|
||||
assert (false);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testQueryGainers()
|
||||
{
|
||||
SqlSession session = null;
|
||||
|
||||
try
|
||||
{
|
||||
session = MybatisUtils.getSqlSession();
|
||||
RewardsMapper mapper = session.getMapper( RewardsMapper.class );
|
||||
|
||||
ArrayList<RewardGainer> gainers = mapper.queryRewardTelsaler();
|
||||
|
||||
System.out.println( gainers );
|
||||
|
||||
assert( gainers != null );
|
||||
}
|
||||
catch ( IOException error )
|
||||
{
|
||||
System.out.println( error.getMessage() );
|
||||
assert (false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user