Compare commits
167
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
177e0e4d97 | ||
|
|
f74a2322e4 | ||
|
|
822cdbf539 | ||
|
|
d75f21c17e | ||
|
|
ffee8611fe | ||
|
|
0e8f5e7b14 | ||
|
|
115407026f | ||
|
|
9f545952e4 | ||
|
|
1988e031e5 | ||
|
|
44b0f6ca2b | ||
|
|
ae866f0791 | ||
|
|
4610ac4737 | ||
|
|
6d6920a2b3 | ||
|
|
c7041fa69e | ||
|
|
370f5e0089 | ||
|
|
a47f27967e | ||
|
|
6c08f5f141 | ||
|
|
690f688c6a | ||
|
|
63cc815022 | ||
|
|
8f00d07377 | ||
|
|
2e90ec71cc | ||
|
|
a43806c4e9 | ||
|
|
237df3ef38 | ||
|
|
bd9fece99c | ||
|
|
47cebd3392 | ||
|
|
61e049cc47 | ||
|
|
ad03177e50 | ||
|
|
3db3301fe3 | ||
|
|
fa9a186a5e | ||
|
|
3cea926a1e | ||
|
|
fe82afd934 | ||
|
|
96242b5c00 | ||
|
|
291f6a4eaa | ||
|
|
98dc17552d | ||
|
|
e9784f7957 | ||
|
|
175238e291 | ||
|
|
3c822d581c | ||
|
|
77d72d1d78 | ||
|
|
9dbdd911d9 | ||
|
|
0022497f64 | ||
|
|
9714e97a71 | ||
|
|
65f5755422 | ||
|
|
677b4d5080 | ||
|
|
49f316dd82 | ||
|
|
b6aecf4e64 | ||
|
|
cd7f5661de | ||
|
|
6e005f2f4e | ||
|
|
03f8be4c98 | ||
|
|
b2b96290bf | ||
|
|
80d1cebc0f | ||
|
|
e064e312da | ||
|
|
173eaa1b60 | ||
|
|
ff4de69409 | ||
|
|
6b13ab307a | ||
|
|
b57482b0be | ||
|
|
41ab299602 | ||
|
|
e1eeafa13b | ||
|
|
e535308048 | ||
|
|
b03c4db189 | ||
|
|
a6aebf34b4 | ||
|
|
46c0c15bf2 | ||
|
|
e47a02f4cd | ||
|
|
6f404e466c | ||
|
|
40506c561c | ||
|
|
c73c1089ee | ||
|
|
fe014a56c8 | ||
|
|
24b1967ba9 | ||
|
|
c9020ee8d3 | ||
|
|
1a9c557899 | ||
|
|
8eca7a0232 | ||
|
|
b580502f48 | ||
|
|
654a842ed9 | ||
|
|
a58a007809 | ||
|
|
fdd6fce15c | ||
|
|
3a8252e81d | ||
|
|
4f8ca1b97b | ||
|
|
4ba67b70c5 | ||
|
|
58acc58338 | ||
|
|
410bd6efa6 | ||
|
|
a00d361f6b | ||
|
|
464abc6521 | ||
|
|
7362ca6b8a | ||
|
|
309bdc467e | ||
|
|
33470b1a04 | ||
|
|
66b90d1c14 | ||
|
|
de888296d9 | ||
|
|
fb699c5227 | ||
|
|
60edd2726d | ||
|
|
10c2b4737f | ||
|
|
a6935d9f42 | ||
|
|
ab7fe2a199 | ||
|
|
1495841ad2 | ||
|
|
9f583d8850 | ||
|
|
6381d7ab9c | ||
|
|
34c3c59c0c | ||
|
|
7b473e5e36 | ||
|
|
f5247cc21f | ||
|
|
1c7ba176f6 | ||
|
|
e45f571cd2 | ||
|
|
492e44bb80 | ||
|
|
66bb39bc18 | ||
|
|
5d66a58af9 | ||
|
|
9686399c80 | ||
|
|
19f6973a1f | ||
|
|
bffd4fa7df | ||
|
|
86862ea0a7 | ||
|
|
da9169f774 | ||
|
|
a972e556d9 | ||
|
|
b093d95463 | ||
|
|
a7bad9d444 | ||
|
|
9533c976f2 | ||
|
|
79c8bd0da1 | ||
|
|
7c337a40a7 | ||
|
|
3b25a26540 | ||
|
|
428992ca6d | ||
|
|
a59914b95c | ||
|
|
5c9cfbb7c3 | ||
|
|
9d157d17d5 | ||
|
|
f88bb0af52 | ||
|
|
117d9185f4 | ||
|
|
4d9051d5f9 | ||
|
|
6c3047abf2 | ||
|
|
9b15cb694d | ||
|
|
08b487accf | ||
|
|
3bc6566f2d | ||
|
|
fbf8b11d4f | ||
|
|
f2d63353b0 | ||
|
|
707e41025c | ||
|
|
8f1d3fdf2a | ||
|
|
24cd7cfdca | ||
|
|
2ca6c5f1cd | ||
|
|
5e4f95c10d | ||
|
|
de69956a71 | ||
|
|
7d316cdf47 | ||
|
|
9d6c2f2a14 | ||
|
|
569e23322f | ||
|
|
fe5ca6619c | ||
|
|
f73a09e91c | ||
|
|
9916e792db | ||
|
|
36bbbbf180 | ||
|
|
b8108c4908 | ||
|
|
06236177a3 | ||
|
|
930b806a25 | ||
|
|
0f6fc575d5 | ||
|
|
4446515656 | ||
|
|
3c7bda80bb | ||
|
|
f37963f141 | ||
|
|
5d0dc81279 | ||
|
|
22626eb9d5 | ||
|
|
0b5ec13aab | ||
|
|
595d702e9e | ||
|
|
a4a0265a82 | ||
|
|
430817655a | ||
|
|
536ca94d8b | ||
|
|
cb0d45c81b | ||
|
|
a20771f420 | ||
|
|
23b560ca01 | ||
|
|
cd6d48c22e | ||
|
|
5d6ab34fd2 | ||
|
|
ae4c5e7ee6 | ||
|
|
e7669dc8bc | ||
|
|
560fe0dc19 | ||
|
|
9086453544 | ||
|
|
8adaff4445 | ||
|
|
9942105af9 | ||
|
|
714bba6733 | ||
|
|
f09b695903 |
@@ -0,0 +1,8 @@
|
|||||||
|
-- aed表加字段
|
||||||
|
ALTER TABLE `aed_equipment_manger`
|
||||||
|
ADD COLUMN `geo_collect_type` tinyint NULL DEFAULT 0 COMMENT '位置数据维护方式(0-地图选点,1-手动维护)' AFTER `latitude`;
|
||||||
|
ADD COLUMN `ay_id` varchar(255) NULL COMMENT '安眼平台系统id' AFTER `name`;
|
||||||
|
|
||||||
|
-- 应急资源表加字段
|
||||||
|
ALTER TABLE `emergency_resource`
|
||||||
|
ADD COLUMN `ay_id` varchar(255) NULL COMMENT '安眼平台系统id' AFTER `run_time`;
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
UPDATE aed_equipment_manger m
|
||||||
|
JOIN aed_location_equipment l ON m.id = l.equipment_id
|
||||||
|
SET m.install_address = l.address;
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
--修复生日数据
|
||||||
|
UPDATE sys_user
|
||||||
|
SET birthday = DATE_FORMAT(SUBSTRING(id_card, 7, 8), '%Y-%m-%d')
|
||||||
|
WHERE
|
||||||
|
id_card IS NOT NULL
|
||||||
|
AND birthday IS NULL;
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
/*
|
||||||
|
Navicat Premium Data Transfer
|
||||||
|
|
||||||
|
Source Server : 蚁熊-阿里云
|
||||||
|
Source Server Type : MySQL
|
||||||
|
Source Server Version : 80404
|
||||||
|
Source Host : localhost:3306
|
||||||
|
Source Schema : health_consult
|
||||||
|
|
||||||
|
Target Server Type : MySQL
|
||||||
|
Target Server Version : 80404
|
||||||
|
File Encoding : 65001
|
||||||
|
|
||||||
|
Date: 10/12/2025 15:53:17
|
||||||
|
*/
|
||||||
|
|
||||||
|
SET NAMES utf8mb4;
|
||||||
|
SET FOREIGN_KEY_CHECKS = 0;
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- Table structure for im_msg_read_log
|
||||||
|
-- ----------------------------
|
||||||
|
DROP TABLE IF EXISTS `im_msg_read_log`;
|
||||||
|
CREATE TABLE `im_msg_read_log` (
|
||||||
|
`id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'id',
|
||||||
|
`group_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '群组ID',
|
||||||
|
`from_account` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '发送者账号',
|
||||||
|
`to_account` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '接受者账号',
|
||||||
|
`msg_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '消息ID(腾讯IM平台生成的消息ID)',
|
||||||
|
`read_count` int NOT NULL COMMENT '读取次数(点击次数)',
|
||||||
|
`read_time` datetime NOT NULL COMMENT '读取时间',
|
||||||
|
PRIMARY KEY (`id`) USING BTREE,
|
||||||
|
UNIQUE INDEX `group_id`(`group_id` ASC, `msg_id` ASC) USING BTREE
|
||||||
|
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
|
||||||
|
|
||||||
|
SET FOREIGN_KEY_CHECKS = 1;
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
ALTER TABLE `emergency_resource`
|
||||||
|
ADD COLUMN `geo_collect_type` tinyint NULL DEFAULT 0 COMMENT '位置数据维护方式(0-地图选点,1-手动维护)' AFTER `ay_id`;
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
--心率
|
||||||
|
ALTER TABLE `watch_stat_user_info_day_heart_rate`
|
||||||
|
ADD COLUMN `new_value` int NULL DEFAULT NULL COMMENT '最新值' AFTER `last_upload_time`,
|
||||||
|
ADD COLUMN `silence_new_value` int NULL COMMENT '静息心率最新值' AFTER `new_value`;
|
||||||
|
|
||||||
|
-- 血氧
|
||||||
|
ALTER TABLE `watch_stat_user_info_day_spo2`
|
||||||
|
ADD COLUMN `new_value` decimal(4, 0) NULL COMMENT '最新值' AFTER `last_upload_time`;
|
||||||
|
|
||||||
|
-- 压力
|
||||||
|
ALTER TABLE `watch_stat_user_info_day_stress`
|
||||||
|
ADD COLUMN `new_value` decimal(4, 0) NULL COMMENT '最新值' AFTER `last_upload_time`;
|
||||||
|
|
||||||
|
-- 体温
|
||||||
|
ALTER TABLE `watch_stat_user_info_day_temp`
|
||||||
|
ADD COLUMN `new_value` decimal(5, 2) NULL COMMENT '最新值' AFTER `last_upload_time`,
|
||||||
|
ADD COLUMN `skin_new_value` decimal(5, 2) NULL COMMENT '体表温度最新值' AFTER `new_value`;
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
### 心率原始数据修正
|
||||||
|
update watch_data_heart_rate set silence_value = null where silence_value = 0.00;
|
||||||
|
|
||||||
|
|
||||||
|
### 心率日汇总表数据修正
|
||||||
|
UPDATE watch_stat_user_info_day_heart_rate stat
|
||||||
|
LEFT JOIN (
|
||||||
|
SELECT
|
||||||
|
bind_user_id,
|
||||||
|
ifnull( max( silence_value ), 0 ) AS silence_max_value,
|
||||||
|
ifnull( min( silence_value ), 0 ) AS silence_min_value,
|
||||||
|
ifnull( avg( silence_value ), 0 ) AS silence_avg_value,
|
||||||
|
data_date
|
||||||
|
FROM
|
||||||
|
watch_data_heart_rate
|
||||||
|
GROUP BY
|
||||||
|
bind_user_id,
|
||||||
|
data_date
|
||||||
|
) DATA ON stat.user_id = DATA.bind_user_id
|
||||||
|
SET stat.silence_max_value = DATA.silence_max_value,
|
||||||
|
stat.silence_min_value = DATA.silence_min_value,
|
||||||
|
stat.silence_avg_value = DATA.silence_avg_value;
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- Table structure for health_user_employee_ex
|
||||||
|
-- ----------------------------
|
||||||
|
ALTER TABLE `emergency_resource`
|
||||||
|
ADD COLUMN `manager` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '负责人';
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- Table structure for health_user_employee_ex
|
||||||
|
-- ----------------------------
|
||||||
|
ALTER TABLE `health_user_employee_ex`
|
||||||
|
ADD COLUMN `lifeguard_name2` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '急救人员2姓名',
|
||||||
|
ADD COLUMN `lifeguard_phone2` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '急救人员2电话';
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
--重置专家排序
|
||||||
|
update `con_doctor` set sort = 9999;
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
-- ----------------------------
|
||||||
|
-- Table structure for emergency_screen_animation 应急大屏开屏动画表
|
||||||
|
-- ----------------------------
|
||||||
|
CREATE TABLE `emergency_screen_animation` (
|
||||||
|
`id` bigint NOT NULL COMMENT 'ID',
|
||||||
|
`title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标题',
|
||||||
|
`video_url` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '动画地址',
|
||||||
|
`description` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '简介',
|
||||||
|
`create_by` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人',
|
||||||
|
`create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
|
||||||
|
`update_by` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人',
|
||||||
|
`update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
|
||||||
|
`del_flag` tinyint NOT NULL DEFAULT 0 COMMENT '删除状态(0-正常,1-已删除)',
|
||||||
|
PRIMARY KEY (`id`) USING BTREE
|
||||||
|
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
|
||||||
|
|
||||||
|
SET FOREIGN_KEY_CHECKS = 1;
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
ALTER TABLE `emergency_order`
|
||||||
|
ADD COLUMN `destroy_group` tinyint(1) NULL DEFAULT 0 COMMENT '是否解散群聊(0:否 1:是)' AFTER `major_user_two_avatar`;
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
-- 消息通知表
|
||||||
|
CREATE TABLE `sys_message_notice` (
|
||||||
|
`id` varchar(32) NOT NULL COMMENT 'id',
|
||||||
|
`title` varchar(255) DEFAULT NULL COMMENT '标题',
|
||||||
|
`content` text COMMENT '内容',
|
||||||
|
`scope_type` int(2) DEFAULT NULL COMMENT '范围(1-指定部门,2-指定人群,3-既指定部门又指定人群)',
|
||||||
|
`org_code` varchar(100) DEFAULT NULL COMMENT '创建机构',
|
||||||
|
`notice_status` int(2) DEFAULT '1' COMMENT '通知状态(0:否 1:是)',
|
||||||
|
`start_time` datetime DEFAULT NULL COMMENT '通知开始时间',
|
||||||
|
`end_time` datetime DEFAULT NULL COMMENT '通知结束时间',
|
||||||
|
`del_flag` varchar(1) DEFAULT '0' COMMENT '删除状态(0-正常,1-已删除)',
|
||||||
|
`create_by` varchar(50) DEFAULT NULL COMMENT '创建人',
|
||||||
|
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||||
|
`update_by` varchar(50) DEFAULT NULL COMMENT '更新人',
|
||||||
|
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
KEY `idx_org_code` (`org_code`),
|
||||||
|
KEY `idx_notice_status` (`notice_status`),
|
||||||
|
KEY `idx_start_time` (`start_time`),
|
||||||
|
KEY `idx_end_time` (`end_time`),
|
||||||
|
KEY `idx_del_flag` (`del_flag`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='消息通知表';
|
||||||
|
|
||||||
|
-- 消息通知范围表
|
||||||
|
CREATE TABLE `sys_message_notice_scope` (
|
||||||
|
`id` varchar(32) NOT NULL COMMENT 'id',
|
||||||
|
`notice_id` varchar(32) NOT NULL COMMENT '消息id',
|
||||||
|
`type` int(2) DEFAULT NULL COMMENT '类别(1-指定部门,2-指定人群)',
|
||||||
|
`scope_id` varchar(100) DEFAULT NULL COMMENT '限制范围标识(如:部门Code,人员ID)',
|
||||||
|
`record` varchar(255) DEFAULT NULL COMMENT '记录值(例:部门名称,人员名称)',
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
KEY `idx_notice_id` (`notice_id`),
|
||||||
|
KEY `idx_type` (`type`),
|
||||||
|
KEY `idx_scope_notice` (`scope_id`, `notice_id`) COMMENT '联表查询复合索引,支持WHERE scope_id + JOIN notice_id'
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='消息通知范围表';
|
||||||
@@ -609,7 +609,7 @@ CREATE TABLE `con_helper` (
|
|||||||
`graduation_time` date NULL DEFAULT NULL COMMENT '毕业时间',
|
`graduation_time` date NULL DEFAULT NULL COMMENT '毕业时间',
|
||||||
`registration_time` datetime NULL DEFAULT NULL COMMENT '注册时间',
|
`registration_time` datetime NULL DEFAULT NULL COMMENT '注册时间',
|
||||||
`address` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '联系地址',
|
`address` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '联系地址',
|
||||||
`helper_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '小助手编号',
|
`helper_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '全科医生编号',
|
||||||
`flag` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '是否接受咨询1接受咨询2拒绝咨询',
|
`flag` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '是否接受咨询1接受咨询2拒绝咨询',
|
||||||
`work_time` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '参加工作时间',
|
`work_time` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '参加工作时间',
|
||||||
`practicing_experience` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '执业经历',
|
`practicing_experience` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '执业经历',
|
||||||
@@ -626,7 +626,7 @@ CREATE TABLE `con_helper` (
|
|||||||
`memo` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '备注',
|
`memo` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '备注',
|
||||||
`org_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '所属部门',
|
`org_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '所属部门',
|
||||||
PRIMARY KEY (`id`) USING BTREE
|
PRIMARY KEY (`id`) USING BTREE
|
||||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '小助手表' ROW_FORMAT = Dynamic;
|
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '全科医生表' ROW_FORMAT = Dynamic;
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- Table structure for con_helper_online
|
-- Table structure for con_helper_online
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
-- QH_WAT_MONITOR_DATA 新增 EVENT_ID(事件ID)和 LOCATE_TIME(定位时间)字段
|
||||||
|
-- 数据库:118-DM 达梦数据库,SQL 全大写规范
|
||||||
|
ALTER TABLE "QH_WAT_MONITOR_DATA" ADD "EVENT_ID" VARCHAR(64) DEFAULT NULL;
|
||||||
|
ALTER TABLE "QH_WAT_MONITOR_DATA" ADD "LOCATE_TIME" DATETIME DEFAULT NULL;
|
||||||
|
|
||||||
|
COMMENT ON COLUMN "QH_WAT_MONITOR_DATA"."EVENT_ID" IS '事件ID';
|
||||||
|
COMMENT ON COLUMN "QH_WAT_MONITOR_DATA"."LOCATE_TIME" IS '定位时间';
|
||||||
|
|
||||||
|
CREATE INDEX "IDX_EVENT_ID" ON "QH_WAT_MONITOR_DATA"("EVENT_ID");
|
||||||
|
CREATE INDEX "IDX_WATCH_NO_EVENT_ID" ON "QH_WAT_MONITOR_DATA"("WATCH_NO", "EVENT_ID");
|
||||||
+42
-5
@@ -94,7 +94,7 @@ public interface AnYanClient {
|
|||||||
* @param healthRoomDTO
|
* @param healthRoomDTO
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
IPage<HealthPlaceHomDetailsVO> healthPlaceHomDetailList(HealthRoomDTO healthRoomDTO);
|
IPage<HealthPlaceHomeDetailsVO> healthPlaceHomDetailList(HealthRoomDTO healthRoomDTO);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 当年体检异常人数统计
|
* 当年体检异常人数统计
|
||||||
@@ -132,7 +132,7 @@ public interface AnYanClient {
|
|||||||
* @param token
|
* @param token
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
AnYanUserInfoResult getAnYanUserInfo(String token);
|
AnYanUserInfoResult getAnYanUserInfo(String token, String username);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量拉取安眼平台AED信息 , 用于定时任务更新本地数据的AED数据
|
* 批量拉取安眼平台AED信息 , 用于定时任务更新本地数据的AED数据
|
||||||
@@ -152,11 +152,10 @@ public interface AnYanClient {
|
|||||||
/**
|
/**
|
||||||
* 一人一案信息详情接口 (用大屏首页重点关爱趋势预警滚动列表点击数据详情)
|
* 一人一案信息详情接口 (用大屏首页重点关爱趋势预警滚动列表点击数据详情)
|
||||||
*
|
*
|
||||||
* @param anYanUserId 安眼系统的用户ID (从上级列表接口获取) 与 idNo 参数二选一即可
|
* @param employeeNum 工号
|
||||||
* @param idNo 安眼系统的用户身份证号 (从上级列表接口获取) 与 anYanUserId 参数二选一即可
|
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
CareUserListVo careUserDetails(String anYanUserId, String idNo);
|
CareUserListVo careUserDetails(String anYanUserId, String employeeNum);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 一人一案分页列表查询接口(用大屏首页重点关爱趋势预警弹窗列表)
|
* 一人一案分页列表查询接口(用大屏首页重点关爱趋势预警弹窗列表)
|
||||||
@@ -173,4 +172,42 @@ public interface AnYanClient {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
IPage<EmergencyContactVO> queryEmergencyContact(EmergencyContactParam param);
|
IPage<EmergencyContactVO> queryEmergencyContact(EmergencyContactParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量更新员工关键信息接口
|
||||||
|
*
|
||||||
|
* @param employeeNumList
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<AnYanUpdateUserBatchInfo> updateUserBatch(List<String> employeeNumList);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新单个员工扩展信息
|
||||||
|
* 是否是借调人员 这个判断是依据 数据中是否存在currentOfficeId来决定的,存在说明是借调人员,不存在说明不是借调人员
|
||||||
|
*
|
||||||
|
* @param employeeNum
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
AnYanUserEmployee updateEmployeeNum(String employeeNum);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 体检数据
|
||||||
|
*
|
||||||
|
* @param param
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
IPage<AnYanHealthCheckNew> queryAnYanHealthCheckNew(AnYanHealthCheckNewParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询体检数据
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
AnYanEmpHealthCheckNew queryEmpHealthCheckNew(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据检查id、科室编号、科室名称查询体检记录
|
||||||
|
*/
|
||||||
|
List<HealthCheckProject> queryHealthCheckProject(AnYanHealthCheckProjectParam param);
|
||||||
}
|
}
|
||||||
|
|||||||
+67
-14
@@ -34,10 +34,7 @@ import org.springframework.util.LinkedMultiValueMap;
|
|||||||
import org.springframework.util.MultiValueMap;
|
import org.springframework.util.MultiValueMap;
|
||||||
import org.springframework.web.client.HttpClientErrorException;
|
import org.springframework.web.client.HttpClientErrorException;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.*;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Objects;
|
|
||||||
import java.util.UUID;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -106,6 +103,9 @@ public class AnYanClientExecutor implements AnYanClient {
|
|||||||
ResponseEntity<AuthResult> authResult = RestTemplateUtil.postExchangeForGetTokenByPassword(AnYanApiEnum.QUERY_AUTH_TOKEN, formData, headers, AuthResult.class);
|
ResponseEntity<AuthResult> authResult = RestTemplateUtil.postExchangeForGetTokenByPassword(AnYanApiEnum.QUERY_AUTH_TOKEN, formData, headers, AuthResult.class);
|
||||||
if (HttpStatus.OK.equals(authResult.getStatusCode())
|
if (HttpStatus.OK.equals(authResult.getStatusCode())
|
||||||
&& ObjectUtils.isNotEmpty(authResult.getBody())) {
|
&& ObjectUtils.isNotEmpty(authResult.getBody())) {
|
||||||
|
String token = authResult.getBody().getAccess_token();
|
||||||
|
int expireSeconds = ObjectUtil.isNotEmpty(authResult.getBody().getExpires_in()) ? authResult.getBody().getExpires_in() : 3600;
|
||||||
|
redisClientUtil.set(new RedisKeyPrefix(expireSeconds, AnYanConstants.AN_YAN_API_USER_TOKEN_PREFIX), username, token);
|
||||||
return authResult.getBody();
|
return authResult.getBody();
|
||||||
} else {
|
} else {
|
||||||
log.error("------安眼系统获取token失败(密码模式){}------", authResult.getBody());
|
log.error("------安眼系统获取token失败(密码模式){}------", authResult.getBody());
|
||||||
@@ -146,6 +146,7 @@ public class AnYanClientExecutor implements AnYanClient {
|
|||||||
if (ObjectUtil.isNotEmpty(authResult) && StrUtil.isNotEmpty(authResult.getAccess_token())) {
|
if (ObjectUtil.isNotEmpty(authResult) && StrUtil.isNotEmpty(authResult.getAccess_token())) {
|
||||||
int expireSeconds = ObjectUtil.isNotEmpty(authResult.getExpires_in()) ? authResult.getExpires_in() : 7200;
|
int expireSeconds = ObjectUtil.isNotEmpty(authResult.getExpires_in()) ? authResult.getExpires_in() : 7200;
|
||||||
redisClientUtil.set(new RedisKeyPrefix(expireSeconds, AnYanConstants.AN_YAN_API_TOKEN_PREFIX), "publicToken", authResult.getAccess_token());
|
redisClientUtil.set(new RedisKeyPrefix(expireSeconds, AnYanConstants.AN_YAN_API_TOKEN_PREFIX), "publicToken", authResult.getAccess_token());
|
||||||
|
log.info("---------刷新安眼token成功-------新的token:{},剩余过期时间:{}", authResult.getAccess_token(), authResult.getExpires_in());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -219,9 +220,9 @@ public class AnYanClientExecutor implements AnYanClient {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Retryable(maxAttempts = 2)
|
@Retryable(maxAttempts = 2)
|
||||||
public IPage<HealthPlaceHomDetailsVO> healthPlaceHomDetailList(HealthRoomDTO healthRoomDTO) {
|
public IPage<HealthPlaceHomeDetailsVO> healthPlaceHomDetailList(HealthRoomDTO healthRoomDTO) {
|
||||||
AnYanResult<Object> result = RestTemplateUtil.postExchange(AnYanApiEnum.HEALTH_PLACE_ROOM_INFO_LIST, buildTokenHeader(), healthRoomDTO);
|
AnYanResult<Object> result = RestTemplateUtil.postExchange(AnYanApiEnum.HEALTH_PLACE_ROOM_INFO_LIST, buildTokenHeader(), healthRoomDTO);
|
||||||
return new PageResultToBeanUtil<HealthPlaceHomDetailsVO>().transform(result, HealthPlaceHomDetailsVO.class);
|
return new PageResultToBeanUtil<HealthPlaceHomeDetailsVO>().transform(result, HealthPlaceHomeDetailsVO.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -294,51 +295,103 @@ public class AnYanClientExecutor implements AnYanClient {
|
|||||||
* @date 2025/10/24 17:00
|
* @date 2025/10/24 17:00
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public AnYanUserInfoResult getAnYanUserInfo(String token) {
|
@Retryable(maxAttempts = 2)
|
||||||
|
public AnYanUserInfoResult getAnYanUserInfo(String token, String username) {
|
||||||
HttpHeaders headers = new HttpHeaders();
|
HttpHeaders headers = new HttpHeaders();
|
||||||
headers.add(AnYanConstants.AUTHORIZATION, AnYanConstants.TOKEN_TYPE + token);
|
headers.add(AnYanConstants.AUTHORIZATION, AnYanConstants.TOKEN_TYPE + token);
|
||||||
|
long time1 = System.currentTimeMillis();
|
||||||
ResponseEntity<AnYanUserInfoResult> exchange = RestTemplateUtil.getExchange(AnYanApiEnum.USER_INFO_UNIT_V2, headers, AnYanUserInfoResult.class);
|
ResponseEntity<AnYanUserInfoResult> exchange = RestTemplateUtil.getExchange(AnYanApiEnum.USER_INFO_UNIT_V2, headers, AnYanUserInfoResult.class);
|
||||||
|
long time2 = System.currentTimeMillis();
|
||||||
|
log.info("根据token获取用户信息耗时:" + (time2 - time1) + "ms");
|
||||||
|
redisClientUtil.set(new RedisKeyPrefix(-1, AnYanConstants.AN_YAN_API_USERINFO_PREFIX), username, exchange);
|
||||||
return BeanUtil.toBean(exchange.getBody(), AnYanUserInfoResult.class);
|
return BeanUtil.toBean(exchange.getBody(), AnYanUserInfoResult.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Retryable(maxAttempts = 2)
|
||||||
public List<AnYanAedInfo> queryAnYanAedInfo() {
|
public List<AnYanAedInfo> queryAnYanAedInfo() {
|
||||||
//安眼接口本身支持分页查询 , 因此方法用于定时任务批量查询更新 , 这里一次性查询所有
|
//安眼接口本身支持分页查询 , 因此方法用于定时任务批量查询更新 , 这里一次性查询所有
|
||||||
AnYanResult<Object> result = RestTemplateUtil.postExchange(AnYanApiEnum.QUERY_AN_YAN_AED, buildTokenHeader(), new AnYanAedParam());
|
AnYanResult<Object> result = RestTemplateUtil.postExchange(AnYanApiEnum.QUERY_AN_YAN_AED, buildTokenHeader(), new AnYanAedParam());
|
||||||
IPage<AnYanAedInfo> aedPage = new PageResultToBeanUtil<AnYanAedInfo>().transform(result, AnYanAedInfo.class);
|
IPage<AnYanAedInfo> aedPage = new PageResultToBeanUtil<AnYanAedInfo>().transform(result, AnYanAedInfo.class);
|
||||||
return aedPage.getRecords();
|
return aedPage.getRecords();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<CarePersonList> homeCarePersonList(){
|
@Retryable(maxAttempts = 2)
|
||||||
|
public List<CarePersonList> homeCarePersonList() {
|
||||||
AnYanResult<Object> result = RestTemplateUtil.postExchange(AnYanApiEnum.CARE_PERSON_BY_TIME, buildTokenHeader(), null);
|
AnYanResult<Object> result = RestTemplateUtil.postExchange(AnYanApiEnum.CARE_PERSON_BY_TIME, buildTokenHeader(), null);
|
||||||
List<Object> listMaps = (List<Object>) result.getData();
|
List<Object> listMaps = (List<Object>) result.getData();
|
||||||
return listMaps.stream().map(lMap -> BeanUtil.toBean(lMap, CarePersonList.class)).collect(Collectors.toList());
|
return listMaps.stream().map(lMap -> BeanUtil.toBean(lMap, CarePersonList.class)).collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CareUserListVo careUserDetails(String anYanUserId, String idNo){
|
@Retryable(maxAttempts = 2)
|
||||||
|
public CareUserListVo careUserDetails(String anYanUserId, String employeeNum) {
|
||||||
JSONObject param = new JSONObject();
|
JSONObject param = new JSONObject();
|
||||||
if(StrUtil.isNotEmpty(anYanUserId)){
|
if (StrUtil.isNotEmpty(anYanUserId)) {
|
||||||
param.put("id", anYanUserId);
|
param.put("id", anYanUserId);
|
||||||
}
|
}
|
||||||
if(StrUtil.isNotEmpty(idNo)){
|
if (StrUtil.isNotEmpty(employeeNum)) {
|
||||||
param.put("idNo", idNo);
|
param.put("employeeNum", employeeNum);
|
||||||
}
|
}
|
||||||
AnYanResult<Object> result = RestTemplateUtil.postExchange(AnYanApiEnum.CARE_PERSON_Details, buildTokenHeader(), param);
|
AnYanResult<Object> result = RestTemplateUtil.postExchange(AnYanApiEnum.CARE_PERSON_Details, buildTokenHeader(), param);
|
||||||
return BeanUtil.toBean(result.getData(), CareUserListVo.class);
|
return BeanUtil.toBean(result.getData(), CareUserListVo.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IPage<CareUserListVo> careUserDetailsPage(CareUserDetailsParam param){
|
@Retryable(maxAttempts = 2)
|
||||||
|
public IPage<CareUserListVo> careUserDetailsPage(CareUserDetailsParam param) {
|
||||||
AnYanResult<Object> result = RestTemplateUtil.postExchange(AnYanApiEnum.CARE_PERSON_PAGE_LIST, buildTokenHeader(), param);
|
AnYanResult<Object> result = RestTemplateUtil.postExchange(AnYanApiEnum.CARE_PERSON_PAGE_LIST, buildTokenHeader(), param);
|
||||||
return new PageResultToBeanUtil<CareUserListVo>().transform(result, CareUserListVo.class);
|
return new PageResultToBeanUtil<CareUserListVo>().transform(result, CareUserListVo.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IPage<EmergencyContactVO> queryEmergencyContact(EmergencyContactParam param){
|
@Retryable(maxAttempts = 2)
|
||||||
|
public IPage<EmergencyContactVO> queryEmergencyContact(EmergencyContactParam param) {
|
||||||
AnYanResult<Object> result = RestTemplateUtil.postExchange(AnYanApiEnum.QUERY_EMPLOYEE_CARE_PERSON, buildTokenHeader(), param);
|
AnYanResult<Object> result = RestTemplateUtil.postExchange(AnYanApiEnum.QUERY_EMPLOYEE_CARE_PERSON, buildTokenHeader(), param);
|
||||||
return new PageResultToBeanUtil<EmergencyContactVO>().transform(result, EmergencyContactVO.class);
|
return new PageResultToBeanUtil<EmergencyContactVO>().transform(result, EmergencyContactVO.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Retryable(maxAttempts = 2)
|
||||||
|
public List<AnYanUpdateUserBatchInfo> updateUserBatch(List<String> employeeNumList) {
|
||||||
|
Map<String, List<String>> map = new HashMap<>(1);
|
||||||
|
map.put("employeeNumList", employeeNumList);
|
||||||
|
AnYanResult<Object> result = RestTemplateUtil.postExchange(AnYanApiEnum.FIND_VITAL_INFO, buildTokenHeader(), map);
|
||||||
|
List<Object> listMaps = (List<Object>) result.getData();
|
||||||
|
return listMaps.stream().map(lMap -> BeanUtil.toBean(lMap, AnYanUpdateUserBatchInfo.class)).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Retryable(maxAttempts = 2)
|
||||||
|
public AnYanUserEmployee updateEmployeeNum(String employeeNum) {
|
||||||
|
Map<String, String> map = new HashMap<>(1);
|
||||||
|
map.put("employeeNum", employeeNum);
|
||||||
|
AnYanResult<Object> result = RestTemplateUtil.postExchange(AnYanApiEnum.FIND_BY_EMPLOYEENUM, buildTokenHeader(), map);
|
||||||
|
return BeanUtil.toBean(result.getData(), AnYanUserEmployee.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Retryable(maxAttempts = 2)
|
||||||
|
public IPage<AnYanHealthCheckNew> queryAnYanHealthCheckNew(AnYanHealthCheckNewParam param) {
|
||||||
|
AnYanResult<Object> result = RestTemplateUtil.postExchange(AnYanApiEnum.HEALTH_CHECK_NEW, buildTokenHeader(), param);
|
||||||
|
return new PageResultToBeanUtil<AnYanHealthCheckNew>().transform(result, AnYanHealthCheckNew.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Retryable(maxAttempts = 2)
|
||||||
|
public AnYanEmpHealthCheckNew queryEmpHealthCheckNew(String id) {
|
||||||
|
AnYanResult<Object> result = RestTemplateUtil.getExchange(AnYanApiEnum.CHECK_NEW_BY_ID, buildTokenHeader(), id);
|
||||||
|
return BeanUtil.toBean(result.getData(), AnYanEmpHealthCheckNew.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Retryable(maxAttempts = 2)
|
||||||
|
public List<HealthCheckProject> queryHealthCheckProject(AnYanHealthCheckProjectParam param) {
|
||||||
|
AnYanResult<Object> result = RestTemplateUtil.postExchange(AnYanApiEnum.HEALTH_CHECK_PROJECT, buildTokenHeader(), param);
|
||||||
|
List<Object> listMaps = (List<Object>) result.getData();
|
||||||
|
return listMaps.stream().map(lMap -> BeanUtil.toBean(lMap, HealthCheckProject.class)).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+10
-16
@@ -1,4 +1,4 @@
|
|||||||
package com.renkang.restaurant.config;
|
package com.renkang.anyan.config;
|
||||||
|
|
||||||
import com.renkang.anyan.client.AnYanClient;
|
import com.renkang.anyan.client.AnYanClient;
|
||||||
import com.renkang.anyan.config.AnYanProperties;
|
import com.renkang.anyan.config.AnYanProperties;
|
||||||
@@ -22,7 +22,6 @@ import java.nio.charset.StandardCharsets;
|
|||||||
import java.time.Duration;
|
import java.time.Duration;
|
||||||
import java.time.temporal.ChronoUnit;
|
import java.time.temporal.ChronoUnit;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: AnYanClient xj安眼系统接口调用客户端
|
* @Description: AnYanClient xj安眼系统接口调用客户端
|
||||||
@@ -55,27 +54,22 @@ public class AnYanRestTemplateConfig {
|
|||||||
* 自定义拦截器处理接口鉴权失败, 配合spring retry使用从而避免因token失效导致的接口调用失败
|
* 自定义拦截器处理接口鉴权失败, 配合spring retry使用从而避免因token失效导致的接口调用失败
|
||||||
*/
|
*/
|
||||||
public ClientHttpRequestInterceptor authInterceptor() {
|
public ClientHttpRequestInterceptor authInterceptor() {
|
||||||
// 添加重试次数限制
|
|
||||||
AtomicInteger retryCount = new AtomicInteger(0);
|
|
||||||
int maxRetries = 5;
|
|
||||||
return (httpRequest, bytes, clientHttpRequestExecution) -> {
|
return (httpRequest, bytes, clientHttpRequestExecution) -> {
|
||||||
ClientHttpResponse execute;
|
ClientHttpResponse execute;
|
||||||
try {
|
try {
|
||||||
// 获取请求URL
|
|
||||||
String url = httpRequest.getURI().toString();
|
|
||||||
// 排除特定接口不执行拦截逻辑
|
|
||||||
boolean shouldSkip = url.contains(AnYanApiEnum.QUERY_AUTH_TOKEN.getMethodPath());
|
|
||||||
execute = clientHttpRequestExecution.execute(httpRequest, bytes);
|
execute = clientHttpRequestExecution.execute(httpRequest, bytes);
|
||||||
if (shouldSkip) {
|
|
||||||
return execute;
|
|
||||||
}
|
|
||||||
HttpStatus httpStatus = execute.getStatusCode();
|
HttpStatus httpStatus = execute.getStatusCode();
|
||||||
if (Arrays.asList(HttpStatus.UNAUTHORIZED, HttpStatus.FORBIDDEN).contains(httpStatus)
|
if (Arrays.asList(HttpStatus.UNAUTHORIZED, HttpStatus.FORBIDDEN).contains(httpStatus)) {
|
||||||
&& retryCount.getAndIncrement() < maxRetries) {
|
// 获取请求URL
|
||||||
SpringContextUtils.getBean("anYanClientExecutor", AnYanClient.class).refreshToken();
|
String url = httpRequest.getURI().toString();
|
||||||
|
// 排除特定接口不执行刷新token逻辑(获取token接口,根据token获取个人信息接口)
|
||||||
|
if (!url.contains(AnYanApiEnum.QUERY_AUTH_TOKEN.getMethodPath()) && !url.contains(AnYanApiEnum.USER_INFO_UNIT_V2.getMethodPath())) {
|
||||||
|
log.info("---------安眼token过期,触发刷新token机制-------已过期的token:{}", httpRequest.getHeaders().getFirst("authorization"));
|
||||||
|
SpringContextUtils.getBean("anYanClientExecutor", AnYanClient.class).refreshToken();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("---------安眼平台API调用异常-------e{}", e.getMessage(), e);
|
log.error("---------安眼平台API调用异常-------e{},接口:{}", e.getMessage(), httpRequest.getURI(), e);
|
||||||
ExceptionAssertsUtil.fail("安眼平台API调用失败");
|
ExceptionAssertsUtil.fail("安眼平台API调用失败");
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
|
|||||||
+10
-1
@@ -63,8 +63,11 @@ public class RestTemplateUtil {
|
|||||||
String url = getProperties().getPublicHost() + api.getMethodPath();
|
String url = getProperties().getPublicHost() + api.getMethodPath();
|
||||||
HttpEntity<MultiValueMap<String, String>> requestEntity = new HttpEntity<>(formData, headers);
|
HttpEntity<MultiValueMap<String, String>> requestEntity = new HttpEntity<>(formData, headers);
|
||||||
log.info("开始发送请求到: {},入参:{}", url, formData);
|
log.info("开始发送请求到: {},入参:{}", url, formData);
|
||||||
|
long time1 = System.currentTimeMillis();
|
||||||
ResponseEntity<T> response = getRestTemplate().exchange(url, api.getHttpMethod(), requestEntity, responseType);
|
ResponseEntity<T> response = getRestTemplate().exchange(url, api.getHttpMethod(), requestEntity, responseType);
|
||||||
log.info("收到响应: {}", response);
|
log.info("收到响应: {}", response);
|
||||||
|
long time2 = System.currentTimeMillis();
|
||||||
|
log.info("获取token(密码模式) 耗时:" + (time2 - time1) + "ms");
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -108,6 +111,12 @@ public class RestTemplateUtil {
|
|||||||
return getRestTemplate().exchange(url, api.getHttpMethod(), requestEntity, responseType);
|
return getRestTemplate().exchange(url, api.getHttpMethod(), requestEntity, responseType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static AnYanResult<Object> getExchange(AnYanApiEnum api, HttpHeaders headers, String id) {
|
||||||
|
String url = getProperties().getHost() + api.getMethodPath() + "/" + id;
|
||||||
|
HttpEntity<Object> requestEntity = new HttpEntity<>(headers);
|
||||||
|
return responseHandler(getRestTemplate().exchange(url, api.getHttpMethod(), requestEntity, AnYanResult.class));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ResponseEntity 转 Result
|
* ResponseEntity 转 Result
|
||||||
*
|
*
|
||||||
@@ -118,7 +127,7 @@ public class RestTemplateUtil {
|
|||||||
if (HttpStatus.OK.equals(entity.getStatusCode()) && ObjectUtils.isNotEmpty(entity.getBody())) {
|
if (HttpStatus.OK.equals(entity.getStatusCode()) && ObjectUtils.isNotEmpty(entity.getBody())) {
|
||||||
return entity.getBody();
|
return entity.getBody();
|
||||||
} else {
|
} else {
|
||||||
return AnYanResult.error("天眼系统API调用失败");
|
return AnYanResult.error("外部平台API调用失败");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+10
@@ -34,6 +34,16 @@ public interface AnYanConstants {
|
|||||||
*/
|
*/
|
||||||
String AN_YAN_API_TOKEN_PREFIX = "exterior:anyan:api:";
|
String AN_YAN_API_TOKEN_PREFIX = "exterior:anyan:api:";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 缓存安眼用户登录token
|
||||||
|
*/
|
||||||
|
String AN_YAN_API_USER_TOKEN_PREFIX = "exterior:anyan:api:access_token";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 缓存安眼用户信息
|
||||||
|
*/
|
||||||
|
String AN_YAN_API_USERINFO_PREFIX = "exterior:anyan:api:userinfo";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 部分业务接口需要代入的请求头参数Roles
|
* 部分业务接口需要代入的请求头参数Roles
|
||||||
*/
|
*/
|
||||||
|
|||||||
+27
-2
@@ -94,12 +94,37 @@ public enum AnYanApiEnum {
|
|||||||
/**
|
/**
|
||||||
* 17.一人一案分页列表接口 (用大屏首页重点关爱趋势二级弹窗列表)
|
* 17.一人一案分页列表接口 (用大屏首页重点关爱趋势二级弹窗列表)
|
||||||
*/
|
*/
|
||||||
CARE_PERSON_PAGE_LIST("aygc-znhpt-sys/0/api/empPersonFile/findPage", "", HttpMethod.POST),
|
CARE_PERSON_PAGE_LIST("/aygc-znhpt-sys/0/api/empPersonFile/findPage", "", HttpMethod.POST),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 18.查询关爱联络员信息及急救人员查询接口
|
* 18.查询关爱联络员信息及急救人员查询接口
|
||||||
*/
|
*/
|
||||||
QUERY_EMPLOYEE_CARE_PERSON("aygc-znhpt-sys/0/api/empCareEmp/findPageByIdNo", "", HttpMethod.POST);
|
QUERY_EMPLOYEE_CARE_PERSON("/aygc-znhpt-sys/0/api/empCareEmp/findPage", "", HttpMethod.POST),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 19.批量更新员工关键信息接口
|
||||||
|
*/
|
||||||
|
FIND_VITAL_INFO("/aygc-znhpt-sys/0/api/empBasicInfo/find-vital-info","", HttpMethod.POST),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 20.更新单个员工扩展信息
|
||||||
|
*/
|
||||||
|
FIND_BY_EMPLOYEENUM("/aygc-znhpt-sys/0/api/empBasicInfo/find-by-employeeNum","", HttpMethod.POST),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 22.体检数据
|
||||||
|
*/
|
||||||
|
HEALTH_CHECK_NEW("/aygc-znhpt-sys/0/api/empHealthCheckNew/findPage","",HttpMethod.POST),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 23.根据体检id查询体检数据
|
||||||
|
*/
|
||||||
|
CHECK_NEW_BY_ID("/aygc-znhpt-sys/0/api/empHealthCheckNew","",HttpMethod.GET),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 24.根据检查id、科室编号、科室名称查询体检记录
|
||||||
|
*/
|
||||||
|
HEALTH_CHECK_PROJECT("/aygc-znhpt-sys/0/api/empHealthCheckNew/getCheckProjects","",HttpMethod.POST);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 接口路径
|
* 接口路径
|
||||||
|
|||||||
+5
@@ -31,4 +31,9 @@ public class AnYanAedParam {
|
|||||||
*/
|
*/
|
||||||
@Schema(title = "pageSize")
|
@Schema(title = "pageSize")
|
||||||
private Integer pageSize = 9999;
|
private Integer pageSize = 9999;
|
||||||
|
/**
|
||||||
|
* pageType
|
||||||
|
*/
|
||||||
|
@Schema(title = "pageType")
|
||||||
|
private String pageType = "plus";
|
||||||
}
|
}
|
||||||
|
|||||||
+41
@@ -0,0 +1,41 @@
|
|||||||
|
package com.renkang.anyan.model.dto;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Schema(title = "安眼系统体检数据接口参数", description = "安眼系统体检数据接口参数")
|
||||||
|
public class AnYanHealthCheckNewParam {
|
||||||
|
|
||||||
|
@JsonProperty("name")
|
||||||
|
@Schema(name = "员工姓名")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@JsonProperty("hospitalName")
|
||||||
|
@Schema(name = "医院名称")
|
||||||
|
private String hospitalName;
|
||||||
|
|
||||||
|
@JsonProperty("checkDateEnd")
|
||||||
|
@Schema(name = "结束检查日期")
|
||||||
|
private String checkDateEnd;
|
||||||
|
|
||||||
|
@JsonProperty("checkDateStart")
|
||||||
|
@Schema(name = "开始检查日期")
|
||||||
|
private String checkDateStart;
|
||||||
|
|
||||||
|
@JsonProperty("employeeNum")
|
||||||
|
@Schema(name = "统一认证编号")
|
||||||
|
private String employeeNum;
|
||||||
|
|
||||||
|
@JsonProperty("pageNo")
|
||||||
|
@Schema(name = "页码")
|
||||||
|
private Integer pageNo = 1;
|
||||||
|
|
||||||
|
@JsonProperty("pageSize")
|
||||||
|
@Schema(name = "页码")
|
||||||
|
private Integer pageSize = 10;
|
||||||
|
|
||||||
|
@Schema(title = "pageType")
|
||||||
|
private String pageType = "plus";
|
||||||
|
}
|
||||||
+14
@@ -0,0 +1,14 @@
|
|||||||
|
package com.renkang.anyan.model.dto;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class AnYanHealthCheckProjectParam {
|
||||||
|
@Schema(title = "检查id")
|
||||||
|
private String checkId;
|
||||||
|
@Schema(title = "科室编号")
|
||||||
|
private String departNo;
|
||||||
|
@Schema(title = "科室名称")
|
||||||
|
private String departName;
|
||||||
|
}
|
||||||
+45
@@ -0,0 +1,45 @@
|
|||||||
|
package com.renkang.anyan.model.dto;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Schema(title = "安眼系统健康小屋接口参数", description = "安眼系统健康小屋接口参数")
|
||||||
|
public class AnYanHealthRoomParam {
|
||||||
|
|
||||||
|
@JsonProperty("checkInDateBegin")
|
||||||
|
@Schema(name = "检测开始时间")
|
||||||
|
private String checkInDateBegin;
|
||||||
|
|
||||||
|
@JsonProperty("checkInDateEnd")
|
||||||
|
@Schema(name = "检测结束时间")
|
||||||
|
private String checkInDateEnd;
|
||||||
|
|
||||||
|
@JsonProperty("checkType")
|
||||||
|
@Schema(name = "检测类型")
|
||||||
|
private String checkType;
|
||||||
|
|
||||||
|
@JsonProperty("healthRoomId")
|
||||||
|
@Schema(name = "小屋id")
|
||||||
|
private String healthRoomId;
|
||||||
|
|
||||||
|
@JsonProperty("name")
|
||||||
|
@Schema(name = "名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@JsonProperty("pageNo")
|
||||||
|
@Schema(name = "页码")
|
||||||
|
private Integer pageNo = 1;
|
||||||
|
|
||||||
|
@JsonProperty("pageSize")
|
||||||
|
@Schema(name = "页码")
|
||||||
|
private Integer pageSize = 10;
|
||||||
|
|
||||||
|
@JsonProperty("successFlag")
|
||||||
|
@Schema(name = "是否成功空降 目前各个小屋没有这个值")
|
||||||
|
private String successFlag;
|
||||||
|
|
||||||
|
@Schema(title = "pageType")
|
||||||
|
private String pageType = "plus";
|
||||||
|
}
|
||||||
+6
@@ -1,5 +1,6 @@
|
|||||||
package com.renkang.anyan.model.dto;
|
package com.renkang.anyan.model.dto;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@@ -31,4 +32,9 @@ public class CareUserDetailsParam {
|
|||||||
*/
|
*/
|
||||||
@Schema(title = "pageSize")
|
@Schema(title = "pageSize")
|
||||||
private Integer pageSize = 10;
|
private Integer pageSize = 10;
|
||||||
|
|
||||||
|
@Schema(title = "pageType")
|
||||||
|
private String pageType = "plus";
|
||||||
|
|
||||||
|
private int year = DateUtil.thisYear();
|
||||||
}
|
}
|
||||||
|
|||||||
+8
@@ -11,6 +11,11 @@ public class EmergencyContactParam {
|
|||||||
*/
|
*/
|
||||||
@Schema(title = "员工ID")
|
@Schema(title = "员工ID")
|
||||||
private String emId;
|
private String emId;
|
||||||
|
/**
|
||||||
|
* 工号
|
||||||
|
*/
|
||||||
|
@Schema(title = "工号")
|
||||||
|
private String employeeNum;
|
||||||
/**
|
/**
|
||||||
* 身份证号
|
* 身份证号
|
||||||
*/
|
*/
|
||||||
@@ -31,4 +36,7 @@ public class EmergencyContactParam {
|
|||||||
*/
|
*/
|
||||||
@Schema(title = "pageSize")
|
@Schema(title = "pageSize")
|
||||||
private Integer pageSize = 10;
|
private Integer pageSize = 10;
|
||||||
|
|
||||||
|
@Schema(title = "pageType")
|
||||||
|
private String pageType = "plus";
|
||||||
}
|
}
|
||||||
|
|||||||
+3
@@ -64,6 +64,9 @@ public class HealthRoomDTO {
|
|||||||
@Schema(title = "每页数量")
|
@Schema(title = "每页数量")
|
||||||
private Integer pageSize;
|
private Integer pageSize;
|
||||||
|
|
||||||
|
@Schema(title = "pageType")
|
||||||
|
private String pageType = "plus";
|
||||||
|
|
||||||
public HealthRoomDTO() {
|
public HealthRoomDTO() {
|
||||||
Date date = new Date();
|
Date date = new Date();
|
||||||
this.checkInDateBegin = DateUtil.beginOfYear(date);
|
this.checkInDateBegin = DateUtil.beginOfYear(date);
|
||||||
|
|||||||
+3
@@ -46,4 +46,7 @@ public class HealthSignListParam {
|
|||||||
*/
|
*/
|
||||||
@Schema(title = "pageSize")
|
@Schema(title = "pageSize")
|
||||||
private Integer pageSize = 10;
|
private Integer pageSize = 10;
|
||||||
|
|
||||||
|
@Schema(title = "pageType")
|
||||||
|
private String pageType = "plus";
|
||||||
}
|
}
|
||||||
|
|||||||
+3
@@ -58,6 +58,9 @@ public class MedicalAbnormalDTO {
|
|||||||
@Schema(title = "每页数量")
|
@Schema(title = "每页数量")
|
||||||
private Integer pageSize;
|
private Integer pageSize;
|
||||||
|
|
||||||
|
@Schema(title = "pageType")
|
||||||
|
private String pageType = "plus";
|
||||||
|
|
||||||
public MedicalAbnormalDTO() {
|
public MedicalAbnormalDTO() {
|
||||||
Date date = new Date();
|
Date date = new Date();
|
||||||
this.checkInDateBegin = DateUtil.beginOfYear(date);
|
this.checkInDateBegin = DateUtil.beginOfYear(date);
|
||||||
|
|||||||
+11
-15
@@ -1,13 +1,10 @@
|
|||||||
package com.renkang.anyan.model.vo;
|
package com.renkang.anyan.model.vo;
|
||||||
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.math.RoundingMode;
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@@ -62,21 +59,20 @@ public class AnYanAedInfo {
|
|||||||
@Schema(title = "更新时间")
|
@Schema(title = "更新时间")
|
||||||
private Date updateDate;
|
private Date updateDate;
|
||||||
|
|
||||||
public String getLon() {
|
public String getSecondOfficeName() {
|
||||||
//安眼提供的经纬度过长, 在这里只保留6位小数
|
if(null != secondOfficeName){
|
||||||
if(StrUtil.isNotEmpty(lon)){
|
// 处理返数据中的空格和换行符
|
||||||
BigDecimal bigDecimal = BigDecimal.valueOf(Double.parseDouble(lon)).setScale(6, RoundingMode.HALF_UP);
|
return secondOfficeName.replaceAll(" ","").replaceAll("\r\n","");
|
||||||
return bigDecimal.toString();
|
|
||||||
}
|
}
|
||||||
return lon;
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getLat() {
|
public String getThirdOfficeName() {
|
||||||
//安眼提供的经纬度过长, 在这里只保留6位小数
|
if(null != thirdOfficeName){
|
||||||
if(StrUtil.isNotEmpty(lat)){
|
// 处理返数据中的空格和换行符
|
||||||
BigDecimal bigDecimal = BigDecimal.valueOf(Double.parseDouble(lat)).setScale(6, RoundingMode.HALF_UP);
|
return thirdOfficeName.replaceAll(" ","").replaceAll("\r\n","");
|
||||||
return bigDecimal.toString();
|
|
||||||
}
|
}
|
||||||
return lat;
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+31
@@ -0,0 +1,31 @@
|
|||||||
|
package com.renkang.anyan.model.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Schema(title = "安眼系统体检数据接口返回", description = "安眼系统体检数据接口返回")
|
||||||
|
public class AnYanEmpHealthCheckNew {
|
||||||
|
@Schema(title = "姓名")
|
||||||
|
private String name;
|
||||||
|
@Schema(title = "性别编号")
|
||||||
|
private String sexCode;
|
||||||
|
@Schema(title = "性别")
|
||||||
|
private String sexCodeText;
|
||||||
|
@Schema(title = "出生日期")
|
||||||
|
private String birthday;
|
||||||
|
@Schema(title = "身份证号")
|
||||||
|
private String idNo;
|
||||||
|
@Schema(title = "单位全称")
|
||||||
|
private String workUnit;
|
||||||
|
@Schema(title = "民族编号")
|
||||||
|
private String nationalityValue;
|
||||||
|
@Schema(title = "民族")
|
||||||
|
private String nationalityValueText;
|
||||||
|
@Schema(title = "电话号码")
|
||||||
|
private String phone;
|
||||||
|
@Schema(title = "员工编号 非统一认证编号")
|
||||||
|
private String empId;
|
||||||
|
@Schema(title = "体检数据")
|
||||||
|
private AnYanMedicalNew empHealthCheckNew;
|
||||||
|
}
|
||||||
+22
@@ -0,0 +1,22 @@
|
|||||||
|
package com.renkang.anyan.model.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class AnYanHealthCheckDepart {
|
||||||
|
@Schema(title = "科室记录编号")
|
||||||
|
private String id;
|
||||||
|
@Schema(title = "科室体检编号")
|
||||||
|
private String checkId;
|
||||||
|
@Schema(title = "科室编号")
|
||||||
|
private String departNo;
|
||||||
|
@Schema(title = "科室名称")
|
||||||
|
private String departName;
|
||||||
|
@Schema(title = "小结")
|
||||||
|
private String summary;
|
||||||
|
@Schema(title = "小结日期")
|
||||||
|
private String summaryDate;
|
||||||
|
@Schema(title = "小结医生(科室医生)")
|
||||||
|
private String summaryDoctor;
|
||||||
|
}
|
||||||
+66
@@ -0,0 +1,66 @@
|
|||||||
|
package com.renkang.anyan.model.vo;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Schema(title = "安眼系统体检数据接口返回", description = "安眼系统体检数据接口返回")
|
||||||
|
public class AnYanHealthCheckNew {
|
||||||
|
|
||||||
|
@JsonProperty("id")
|
||||||
|
@Schema(name = "id")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@JsonProperty("idCard")
|
||||||
|
@Schema(name = "身份证号")
|
||||||
|
private String idCard;
|
||||||
|
|
||||||
|
@JsonProperty("name")
|
||||||
|
@Schema(name = "员工姓名")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@JsonProperty("hospitalName")
|
||||||
|
@Schema(name = "员工体检医院")
|
||||||
|
private String hospitalName;
|
||||||
|
|
||||||
|
@JsonProperty("checkDate")
|
||||||
|
@Schema(name = "员工体检日期")
|
||||||
|
private String checkDate;
|
||||||
|
|
||||||
|
@JsonProperty("checkDoctor")
|
||||||
|
@Schema(name = "员工体检医生")
|
||||||
|
private String checkDoctor;
|
||||||
|
|
||||||
|
@JsonProperty("checkId")
|
||||||
|
@Schema(name = "员工体检编号")
|
||||||
|
private String checkId;
|
||||||
|
|
||||||
|
@JsonProperty("workUnit")
|
||||||
|
@Schema(name = "员工单位名称")
|
||||||
|
private String workUnit;
|
||||||
|
|
||||||
|
@JsonProperty("sexCode")
|
||||||
|
@Schema(name = "员工性别编号")
|
||||||
|
private String sexCode;
|
||||||
|
|
||||||
|
@JsonProperty("sexCodeText")
|
||||||
|
@Schema(name = "员工性别")
|
||||||
|
private String sexCodeText;
|
||||||
|
|
||||||
|
@JsonProperty("nationalityValue")
|
||||||
|
@Schema(name = "员工民族编号")
|
||||||
|
private String nationalityValue;
|
||||||
|
|
||||||
|
@JsonProperty("nationalityValueText")
|
||||||
|
@Schema(name = "员工民族")
|
||||||
|
private String nationalityValueText;
|
||||||
|
|
||||||
|
@JsonProperty("phone")
|
||||||
|
@Schema(name = "员工电话号")
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
@JsonProperty("employeeNum")
|
||||||
|
@Schema(name = "员工统一认证编号")
|
||||||
|
private String employeeNum;
|
||||||
|
}
|
||||||
+70
@@ -0,0 +1,70 @@
|
|||||||
|
package com.renkang.anyan.model.vo;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Schema(title = "安眼系统健康小屋接口返回", description = "安眼系统健康小屋接口返回")
|
||||||
|
public class AnYanHealthRoom {
|
||||||
|
|
||||||
|
@JsonProperty("id")
|
||||||
|
@Schema(name = "id")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@JsonProperty("departId")
|
||||||
|
@Schema(name = "单位id")
|
||||||
|
private String departId;
|
||||||
|
|
||||||
|
@JsonProperty("departName")
|
||||||
|
@Schema(name = "单位名称")
|
||||||
|
private String departName;
|
||||||
|
|
||||||
|
@JsonProperty("roomId")
|
||||||
|
@Schema(name = "健康小屋id")
|
||||||
|
private String roomId;
|
||||||
|
|
||||||
|
@JsonProperty("name")
|
||||||
|
@Schema(name = "名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@JsonProperty("idCard")
|
||||||
|
@Schema(name = "身份证号")
|
||||||
|
private String idCard;
|
||||||
|
|
||||||
|
@JsonProperty("checkInDate")
|
||||||
|
@Schema(name = "检查日期")
|
||||||
|
private String checkInDate;
|
||||||
|
|
||||||
|
@JsonProperty("checkType")
|
||||||
|
@Schema(name = "检查类型")
|
||||||
|
private String checkType;
|
||||||
|
|
||||||
|
@JsonProperty("checkTypeName")
|
||||||
|
@Schema(name = "检查类型名称")
|
||||||
|
private String checkTypeName;
|
||||||
|
|
||||||
|
@JsonProperty("lastVal")
|
||||||
|
@Schema(name = "去年体检值 目前各个小屋没有这个值")
|
||||||
|
private String lastVal;
|
||||||
|
|
||||||
|
@JsonProperty("goalVal")
|
||||||
|
@Schema(name = "标值 各个小屋的指标并不一致")
|
||||||
|
private String goalVal;
|
||||||
|
|
||||||
|
@JsonProperty("currentVal")
|
||||||
|
@Schema(name = "当前测量值")
|
||||||
|
private String currentVal;
|
||||||
|
|
||||||
|
@JsonProperty("compareVal")
|
||||||
|
@Schema(name = "控降差值 目前各个小屋没有这个值")
|
||||||
|
private String compareVal;
|
||||||
|
|
||||||
|
@JsonProperty("successFlag")
|
||||||
|
@Schema(name = "是否成功空降 目前各个小屋没有这个值")
|
||||||
|
private String successFlag;
|
||||||
|
|
||||||
|
@JsonProperty("employeeNum")
|
||||||
|
@Schema(name = "员工统一编号")
|
||||||
|
private String employeeNum;
|
||||||
|
}
|
||||||
+41
@@ -0,0 +1,41 @@
|
|||||||
|
package com.renkang.anyan.model.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class AnYanMedicalNew {
|
||||||
|
@Schema(title = "查询id")
|
||||||
|
private String id;
|
||||||
|
@Schema(title = "身份证号")
|
||||||
|
private String idCard;
|
||||||
|
@Schema(title = "名称")
|
||||||
|
private String name;
|
||||||
|
@Schema(title = "医院名称")
|
||||||
|
private String hospitalName;
|
||||||
|
@Schema(title = "检查日期")
|
||||||
|
private String checkDate;
|
||||||
|
@Schema(title = "检查医生名称")
|
||||||
|
private String checkDoctor;
|
||||||
|
@Schema(title = "医院检查编号")
|
||||||
|
private String checkNo;
|
||||||
|
@Schema(title = "检查编号")
|
||||||
|
private String checkId;
|
||||||
|
@Schema(title = "体检综述")
|
||||||
|
private String checkResult;
|
||||||
|
@Schema(title = "体检建议")
|
||||||
|
private String checkSuggestion;
|
||||||
|
@Schema(title = "科室体检数据")
|
||||||
|
private List<AnYanHealthCheckDepart> healthCheckDepartList;
|
||||||
|
@Schema(title = "二级单位id")
|
||||||
|
private String secondOfficeId;
|
||||||
|
@Schema(title = "二级单位名称")
|
||||||
|
private String secondOfficeName;
|
||||||
|
@Schema(title = "三级单位id")
|
||||||
|
private String thirdOfficeId;
|
||||||
|
@Schema(title = "三级单位名称")
|
||||||
|
private String thirdOfficeName;
|
||||||
|
|
||||||
|
}
|
||||||
+23
@@ -0,0 +1,23 @@
|
|||||||
|
package com.renkang.anyan.model.vo;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Schema(title = "安眼系统批量更新员工关键信息接口返回对象", description = "安眼系统批量更新员工关键信息接口返回对象")
|
||||||
|
public class AnYanUpdateUserBatchInfo {
|
||||||
|
|
||||||
|
@JsonProperty("id")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@JsonProperty("employeeNum")
|
||||||
|
private String employeeNum;
|
||||||
|
|
||||||
|
@JsonProperty("phone")
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
@JsonProperty("idNo")
|
||||||
|
private String idNo;
|
||||||
|
|
||||||
|
}
|
||||||
+141
@@ -0,0 +1,141 @@
|
|||||||
|
package com.renkang.anyan.model.vo;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Schema(title = "安眼系统更新单个员工扩展信息接口返回对象", description = "安眼系统更新单个员工扩展信息接口返回对象")
|
||||||
|
public class AnYanUserEmployee {
|
||||||
|
|
||||||
|
@JsonProperty("id")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@JsonProperty("employeeNum")
|
||||||
|
@Schema(name = "员工统一认证编号")
|
||||||
|
private String employeeNum;
|
||||||
|
|
||||||
|
@JsonProperty("name")
|
||||||
|
@Schema(name = "员工名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@JsonProperty("sexCode")
|
||||||
|
@Schema(name = "员工性别编号")
|
||||||
|
private String sexCode;
|
||||||
|
|
||||||
|
@JsonProperty("sexCodeText")
|
||||||
|
@Schema(name = "员工性别")
|
||||||
|
private String sexCodeText;
|
||||||
|
|
||||||
|
@JsonProperty("nationalityValue")
|
||||||
|
@Schema(name = "员工民族编号")
|
||||||
|
private String nationalityValue;
|
||||||
|
|
||||||
|
@JsonProperty("nationalityValueText")
|
||||||
|
@Schema(name = "员工民族")
|
||||||
|
private String nationalityValueText;
|
||||||
|
|
||||||
|
@JsonProperty("phone")
|
||||||
|
@Schema(name = "员工手机号")
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
@JsonProperty("idNo")
|
||||||
|
@Schema(name = "员工身份证号")
|
||||||
|
private String idNo;
|
||||||
|
|
||||||
|
@JsonProperty("birthPlace")
|
||||||
|
@Schema(name = "出生地")
|
||||||
|
private String birthPlace;
|
||||||
|
|
||||||
|
@JsonProperty("educationCode")
|
||||||
|
@Schema(name = "文化程度编号")
|
||||||
|
private String educationCode;
|
||||||
|
|
||||||
|
@JsonProperty("educationCodeText")
|
||||||
|
@Schema(name = "文化程度")
|
||||||
|
private String educationCodeText;
|
||||||
|
|
||||||
|
@JsonProperty("marriageCode")
|
||||||
|
@Schema(name = "婚姻概况编号")
|
||||||
|
private String marriageCode;
|
||||||
|
|
||||||
|
@JsonProperty("marriageCodeText")
|
||||||
|
@Schema(name = "婚姻概况")
|
||||||
|
private String marriageCodeText;
|
||||||
|
|
||||||
|
@JsonProperty("householdTypeCode")
|
||||||
|
@Schema(name = "户籍性质")
|
||||||
|
private String householdTypeCode;
|
||||||
|
|
||||||
|
@JsonProperty("workUnitId")
|
||||||
|
@Schema(name = "单位id 原工作单位")
|
||||||
|
private String workUnitId;
|
||||||
|
|
||||||
|
@JsonProperty("parentWorkIds")
|
||||||
|
@Schema(name = "父单位id")
|
||||||
|
private String parentWorkIds;
|
||||||
|
|
||||||
|
@JsonProperty("currentOfficeId")
|
||||||
|
@Schema(name = "现工作单位id")
|
||||||
|
private String currentOfficeId;
|
||||||
|
|
||||||
|
@JsonProperty("currentOfficeIdText")
|
||||||
|
@Schema(name = "现工作单位")
|
||||||
|
private String currentOfficeIdText;
|
||||||
|
|
||||||
|
@JsonProperty("workUnit")
|
||||||
|
@Schema(name = "单位名称")
|
||||||
|
private String workUnit;
|
||||||
|
|
||||||
|
@JsonProperty("birthday")
|
||||||
|
@Schema(name = "出生日期")
|
||||||
|
private String birthday;
|
||||||
|
|
||||||
|
@JsonProperty("homeId")
|
||||||
|
@Schema(name = "健康小屋id")
|
||||||
|
private String homeId;
|
||||||
|
|
||||||
|
@JsonProperty("homePlace")
|
||||||
|
@Schema(name = "健康小屋地点")
|
||||||
|
private String homePlace;
|
||||||
|
|
||||||
|
@JsonProperty("posts")
|
||||||
|
@Schema(name = "职位编号")
|
||||||
|
private String posts;
|
||||||
|
|
||||||
|
@JsonProperty("postsText")
|
||||||
|
@Schema(name = "职位")
|
||||||
|
private String postsText;
|
||||||
|
|
||||||
|
@JsonProperty("heartBloodVesselCheck")
|
||||||
|
@Schema(name = "心血管检查 有/无")
|
||||||
|
private String heartBloodVesselCheck;
|
||||||
|
|
||||||
|
@JsonProperty("brainBloodVesselCheck")
|
||||||
|
@Schema(name = "脑血管检查 有/无")
|
||||||
|
private String brainBloodVesselCheck;
|
||||||
|
|
||||||
|
@JsonProperty("cancerCheck")
|
||||||
|
@Schema(name = "癌症筛查 有/无")
|
||||||
|
private String cancerCheck;
|
||||||
|
|
||||||
|
@JsonProperty("ctaResult")
|
||||||
|
@Schema(name = "冠状CTA检查结果 1: '无', 2: '轻度狭窄',3: '中度狭窄',4: '重度狭窄'")
|
||||||
|
private Integer ctaResult;
|
||||||
|
|
||||||
|
@JsonProperty("age")
|
||||||
|
@Schema(name = "年龄")
|
||||||
|
private Integer age;
|
||||||
|
|
||||||
|
@JsonProperty("isHealthAdmin")
|
||||||
|
@Schema(name = "是否为健康管理员 1-是 2-否")
|
||||||
|
private Integer isHealthAdmin;
|
||||||
|
|
||||||
|
@JsonProperty("inFormedBookAttached")
|
||||||
|
@Schema(name = "是否上传知情同意书 有值-是 null-否")
|
||||||
|
private String inFormedBookAttached;
|
||||||
|
|
||||||
|
@JsonProperty("existHealthAdmCommit")
|
||||||
|
@Schema(name = "是否上传保密承诺书 true-是 false-否")
|
||||||
|
private Boolean existHealthAdmCommit;
|
||||||
|
}
|
||||||
+36
-1
@@ -3,6 +3,10 @@ package com.renkang.anyan.model.vo;
|
|||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.Period;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@Schema(title="重点关爱趋势预警信息",description="重点关爱趋势预警信息")
|
@Schema(title="重点关爱趋势预警信息",description="重点关爱趋势预警信息")
|
||||||
public class CareUserListVo {
|
public class CareUserListVo {
|
||||||
@@ -19,7 +23,10 @@ public class CareUserListVo {
|
|||||||
private Integer age;
|
private Integer age;
|
||||||
|
|
||||||
@Schema(title = "性别")
|
@Schema(title = "性别")
|
||||||
private String sex;
|
private String sexCode;
|
||||||
|
|
||||||
|
@Schema(title = "身份证号")
|
||||||
|
private String idNo;
|
||||||
|
|
||||||
@Schema(title = "工作单位")
|
@Schema(title = "工作单位")
|
||||||
private String workUnit ;
|
private String workUnit ;
|
||||||
@@ -153,4 +160,32 @@ public class CareUserListVo {
|
|||||||
@Schema(title = "日常生活管理反馈")
|
@Schema(title = "日常生活管理反馈")
|
||||||
private String lifeManageResponse;
|
private String lifeManageResponse;
|
||||||
|
|
||||||
|
public Double getBmi() {
|
||||||
|
if (bmi == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return Math.round(bmi * 10) / 10.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getAge() {
|
||||||
|
if (age != null) {
|
||||||
|
return age;
|
||||||
|
}
|
||||||
|
if (idNo == null || idNo.length() != 18) {
|
||||||
|
return null; // 身份证号无效时返回null
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
// 截取出生日期字符串
|
||||||
|
String birthDateStr = idNo.substring(6, 14);
|
||||||
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd");
|
||||||
|
LocalDate birthDate = LocalDate.parse(birthDateStr, formatter);
|
||||||
|
LocalDate now = LocalDate.now();
|
||||||
|
if (birthDate.isAfter(now)) {
|
||||||
|
return null; // 出生日期在未来,返回null
|
||||||
|
}
|
||||||
|
return Period.between(birthDate, now).getYears();
|
||||||
|
} catch (Exception e) {
|
||||||
|
return null; // 解析异常返回null
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-1
@@ -16,5 +16,9 @@ public class CareUserVO {
|
|||||||
private String lifeguardName;
|
private String lifeguardName;
|
||||||
@Schema(title = "急救人员电话")
|
@Schema(title = "急救人员电话")
|
||||||
private String lifeguardPhone;
|
private String lifeguardPhone;
|
||||||
|
//20251223 改为两个急救人员 ,为改动最小化 没有改数据结构
|
||||||
|
@Schema(title = "急救人员2姓名")
|
||||||
|
private String lifeguardName2;
|
||||||
|
@Schema(title = "急救人员2电话")
|
||||||
|
private String lifeguardPhone2;
|
||||||
}
|
}
|
||||||
|
|||||||
+6
@@ -55,6 +55,12 @@ public class EmergencyContactVO {
|
|||||||
@Schema(title = "急救人员电话")
|
@Schema(title = "急救人员电话")
|
||||||
private String firstAiderPhone;
|
private String firstAiderPhone;
|
||||||
|
|
||||||
|
@Schema(title = "急救人2员姓名")
|
||||||
|
private String firstAiderName2;
|
||||||
|
|
||||||
|
@Schema(title = "急救人2员电话")
|
||||||
|
private String firstAiderPhone2;
|
||||||
|
|
||||||
@Schema(title = "重点关爱人员是否倒班(1是 2否)")
|
@Schema(title = "重点关爱人员是否倒班(1是 2否)")
|
||||||
private Integer keycareShiftWork;
|
private Integer keycareShiftWork;
|
||||||
|
|
||||||
|
|||||||
+32
@@ -0,0 +1,32 @@
|
|||||||
|
package com.renkang.anyan.model.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class HealthCheckProject {
|
||||||
|
@Schema(title = "项目记录编号")
|
||||||
|
private String id;
|
||||||
|
@Schema(title = "项目体检编号")
|
||||||
|
private String checkId;
|
||||||
|
@Schema(title = "科室编号")
|
||||||
|
private String departNo;
|
||||||
|
@Schema(title = "科室名称")
|
||||||
|
private String departName;
|
||||||
|
@Schema(title = "项目编号")
|
||||||
|
private String projectNo;
|
||||||
|
@Schema(title = "项目名称")
|
||||||
|
private String projectName;
|
||||||
|
@Schema(title = "项目体检值")
|
||||||
|
private String resultValue;
|
||||||
|
@Schema(title = "是否异常")
|
||||||
|
private String abnormal;
|
||||||
|
@Schema(title = "异常结果")
|
||||||
|
private String abnormalResult;
|
||||||
|
@Schema(title = "单位")
|
||||||
|
private String unit;
|
||||||
|
@Schema(title = "参考值")
|
||||||
|
private String referenceValue;
|
||||||
|
@Schema(title = "是否心脑血管项目0否 1是")
|
||||||
|
private String bloodBrain;
|
||||||
|
}
|
||||||
+31
-4
@@ -2,21 +2,44 @@ package com.renkang.anyan.model.vo;
|
|||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import org.jeecg.common.aspect.annotation.Dict;
|
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@Schema(title="健康小屋数据详情列表", description="健康小屋数据详情列表")
|
@Schema(title="健康小屋数据详情列表", description="健康小屋数据详情列表")
|
||||||
public class HealthPlaceHomDetailsVO {
|
public class HealthPlaceHomeDetailsVO {
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
@Schema(title = "id")
|
||||||
|
private String id;
|
||||||
|
/**
|
||||||
|
* 单位id
|
||||||
|
*/
|
||||||
|
@Schema(title = "单位id")
|
||||||
|
private String departId;
|
||||||
/**
|
/**
|
||||||
* 单位
|
* 单位
|
||||||
*/
|
*/
|
||||||
@Schema(title = "单位")
|
@Schema(title = "单位")
|
||||||
private String departName;
|
private String departName;
|
||||||
|
/**
|
||||||
|
* 健康小屋id
|
||||||
|
*/
|
||||||
|
@Schema(title = "健康小屋id")
|
||||||
|
private String roomId;
|
||||||
|
@Schema(title = "健康小屋名称")
|
||||||
|
private String roomName;
|
||||||
|
@Schema(title = "地址")
|
||||||
|
private String address;
|
||||||
/**
|
/**
|
||||||
* 姓名
|
* 姓名
|
||||||
*/
|
*/
|
||||||
@Schema(title = "姓名")
|
@Schema(title = "姓名")
|
||||||
private String name;
|
private String name;
|
||||||
|
/**
|
||||||
|
* 身份证号
|
||||||
|
*/
|
||||||
|
@Schema(title = "身份证号")
|
||||||
|
private String idCard;
|
||||||
/**
|
/**
|
||||||
* 检查日期
|
* 检查日期
|
||||||
*/
|
*/
|
||||||
@@ -24,10 +47,12 @@ public class HealthPlaceHomDetailsVO {
|
|||||||
private String checkInDate;
|
private String checkInDate;
|
||||||
/**
|
/**
|
||||||
* 检查类型 11:BMI/21:收缩压/22:舒张压/31:血糖/41:低密度脂蛋白/42:总胆固醇/43:甘油三酯/51:尿酸/61:同型半胱氨酸 等等,缺失的可以继续加
|
* 检查类型 11:BMI/21:收缩压/22:舒张压/31:血糖/41:低密度脂蛋白/42:总胆固醇/43:甘油三酯/51:尿酸/61:同型半胱氨酸 等等,缺失的可以继续加
|
||||||
|
* 字典废弃 新接口返回了name
|
||||||
*/
|
*/
|
||||||
@Schema(title = "检查类型 11:BMI/21:收缩压/22:舒张压/31:血糖/41:低密度脂蛋白/42:总胆固醇/43:甘油三酯/51:尿酸/61:同型半胱氨酸 等等,缺失的可以继续加")
|
@Schema(title = "检查类型")
|
||||||
@Dict(dicCode = "xj_check_type")
|
|
||||||
private String checkType;
|
private String checkType;
|
||||||
|
@Schema(title = "检查类型名称")
|
||||||
|
private String checkTypeName;
|
||||||
/**
|
/**
|
||||||
* 去年体检值 前一年的体检值(初始值)
|
* 去年体检值 前一年的体检值(初始值)
|
||||||
*/
|
*/
|
||||||
@@ -53,4 +78,6 @@ public class HealthPlaceHomDetailsVO {
|
|||||||
*/
|
*/
|
||||||
@Schema(title = "是否成功空降,1:是/0.否")
|
@Schema(title = "是否成功空降,1:是/0.否")
|
||||||
private String successFlag;
|
private String successFlag;
|
||||||
|
@Schema(title = "员工统一编号")
|
||||||
|
private String employeeNum;
|
||||||
}
|
}
|
||||||
+12
@@ -47,4 +47,16 @@ public class HealthRoomBaseVO {
|
|||||||
*/
|
*/
|
||||||
@Schema(title = "运转时间(分钟)")
|
@Schema(title = "运转时间(分钟)")
|
||||||
private Integer runTime;
|
private Integer runTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 管理人员
|
||||||
|
*/
|
||||||
|
@Schema(title = "管理人员")
|
||||||
|
private String manager;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 联系电话
|
||||||
|
*/
|
||||||
|
@Schema(title = "联系电话")
|
||||||
|
private String phone;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,61 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<artifactId>health-bank</artifactId>
|
||||||
|
<groupId>com.renkang</groupId>
|
||||||
|
<version>2.0.0</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>health-bank-api</artifactId>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<maven.compiler.source>8</maven.compiler.source>
|
||||||
|
<maven.compiler.target>8</maven.compiler.target>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
</properties>
|
||||||
|
<dependencies>
|
||||||
|
<!-- feign -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-openfeign</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<!-- 控制openfeign中bcpkix依赖的版本 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.bouncycastle</groupId>
|
||||||
|
<artifactId>bcpkix-jdk18on</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<!-- sentinel限流熔断降级-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.jeecgframework.boot</groupId>
|
||||||
|
<artifactId>jeecg-boot-base-core</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.pagehelper</groupId>
|
||||||
|
<artifactId>pagehelper</artifactId>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-source-plugin</artifactId>
|
||||||
|
<version>${maven-source-plugin.version}</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>attach-sources</id>
|
||||||
|
<goals>
|
||||||
|
<goal>jar</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
</project>
|
||||||
+16
@@ -0,0 +1,16 @@
|
|||||||
|
package com.renkang.bank.constant;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author feng
|
||||||
|
* @date 2026-02-05
|
||||||
|
*/
|
||||||
|
public interface HealthBankConstants {
|
||||||
|
/**
|
||||||
|
* 积分变化-增加积分
|
||||||
|
*/
|
||||||
|
Integer CHANGE_TYPE_ADD = 1;
|
||||||
|
/**
|
||||||
|
*积分变化-扣减积分
|
||||||
|
*/
|
||||||
|
Integer CHANGE_TYPE_DEDUCT = 2;
|
||||||
|
}
|
||||||
+44
@@ -0,0 +1,44 @@
|
|||||||
|
package com.renkang.bank.enums;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author: feng
|
||||||
|
* @description: 积分来源枚举类
|
||||||
|
* @date 2026/02/05 09:38
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
public enum PointsSourceEnum {
|
||||||
|
// 积分变更类型
|
||||||
|
TYPE_1_SURVEY(1, "survey", "积分打卡"),
|
||||||
|
TYPE_2_USE(2, "use", "礼品兑换"),
|
||||||
|
TYPE_2_VIOLATION(2, "violation", "违规扣除"),
|
||||||
|
TYPE_2_EXPIRED(2, "expired", "过期清除");
|
||||||
|
/**
|
||||||
|
* 类型1-获得积分,2-扣减积分
|
||||||
|
*/
|
||||||
|
public final Integer changeType;
|
||||||
|
/**
|
||||||
|
* source 标识
|
||||||
|
*/
|
||||||
|
public final String source;
|
||||||
|
/**
|
||||||
|
* 来源描述
|
||||||
|
*/
|
||||||
|
public final String desc;
|
||||||
|
|
||||||
|
PointsSourceEnum(Integer changeType, String source, String desc) {
|
||||||
|
this.changeType = changeType;
|
||||||
|
this.source = source;
|
||||||
|
this.desc = desc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static PointsSourceEnum getBySource(String source) {
|
||||||
|
for (PointsSourceEnum value : PointsSourceEnum.values()) {
|
||||||
|
if (value.source.equals(source)) {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
+25
@@ -0,0 +1,25 @@
|
|||||||
|
package com.renkang.bank.model.dto;
|
||||||
|
|
||||||
|
import com.renkang.bank.model.po.PointsRule;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.jeecg.base.PageInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author pj
|
||||||
|
* @version 1.0
|
||||||
|
* @description: 积分规则分页dto
|
||||||
|
* @date 2026/2/5 18:11
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class PointsRulePageDTO extends PageInfo<PointsRule> {
|
||||||
|
|
||||||
|
@Schema(title = "健康分类")
|
||||||
|
private Integer ruleCategory;
|
||||||
|
|
||||||
|
@Schema(title = "健康行为")
|
||||||
|
private String ruleDesc;
|
||||||
|
|
||||||
|
@Schema(title = "状态1-启用,2停用")
|
||||||
|
private Integer status;
|
||||||
|
}
|
||||||
+40
@@ -0,0 +1,40 @@
|
|||||||
|
package com.renkang.bank.model.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author pj
|
||||||
|
* @version 1.0
|
||||||
|
* @description: 更新用户积分DTO
|
||||||
|
* @date 2026/2/6 9:00
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class UpdUserPointsDTO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 积分标识(积分打卡:survey,礼品兑换:use,违规扣除:violation,过期清除:expired)
|
||||||
|
*/
|
||||||
|
private String sourceType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 业务ID(积分任务id,兑换商品id等)
|
||||||
|
*/
|
||||||
|
private Long businessId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作积分(扣减)
|
||||||
|
*/
|
||||||
|
private BigDecimal points;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作备注(扣减积分的说明等)
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户id(扣减的目标用户id)
|
||||||
|
*/
|
||||||
|
private String userId;
|
||||||
|
}
|
||||||
+42
@@ -0,0 +1,42 @@
|
|||||||
|
package com.renkang.bank.model.dto;
|
||||||
|
|
||||||
|
import com.renkang.bank.model.po.PointsRule;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.jeecg.base.PageInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author pj
|
||||||
|
* @version 1.0
|
||||||
|
* @description: 积分规则分页dto
|
||||||
|
* @date 2026/2/5 18:11
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class UserPointsPageDTO extends PageInfo<PointsRule> {
|
||||||
|
|
||||||
|
@Schema(title = "姓名")
|
||||||
|
private String realName;
|
||||||
|
|
||||||
|
@Schema(title = "员工编号")
|
||||||
|
private String workNo;
|
||||||
|
|
||||||
|
@Schema(title = "所属单位")
|
||||||
|
private String orgCode;
|
||||||
|
|
||||||
|
@Schema(title = "所属部门")
|
||||||
|
private String deptCode;
|
||||||
|
|
||||||
|
@Schema(title = "1收入,2支出")
|
||||||
|
private Integer changeType;
|
||||||
|
|
||||||
|
@Schema(title = "健康行为")
|
||||||
|
private String ruleDesc;
|
||||||
|
|
||||||
|
@Schema(title = "打卡日期(开始)")
|
||||||
|
private String startDate;
|
||||||
|
|
||||||
|
@Schema(title = "打卡日期(结束)")
|
||||||
|
private String endDate;
|
||||||
|
|
||||||
|
private String userId;
|
||||||
|
}
|
||||||
+45
@@ -0,0 +1,45 @@
|
|||||||
|
package com.renkang.bank.model.dto;
|
||||||
|
|
||||||
|
import com.renkang.bank.model.po.PointsRule;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import org.jeecg.base.PageInfo;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author pj
|
||||||
|
* @version 1.0
|
||||||
|
* @description: 积分规则分页dto
|
||||||
|
* @date 2026/2/5 18:11
|
||||||
|
*/
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Data
|
||||||
|
public class UserPointsRankingDTO extends PageInfo<PointsRule> {
|
||||||
|
|
||||||
|
@Schema(title = "榜单类型,0日榜,1周榜,2月榜,3季榜,4年榜,5选时排名,10总榜")
|
||||||
|
private String rankType;
|
||||||
|
|
||||||
|
@Schema(title = "开始时间")
|
||||||
|
private Date startTime;
|
||||||
|
|
||||||
|
@Schema(title = "截止时间")
|
||||||
|
private Date endTime;
|
||||||
|
|
||||||
|
@Schema(title = "所属单位")
|
||||||
|
private String orgCode;
|
||||||
|
|
||||||
|
@Schema(title = "所属部门")
|
||||||
|
private String deptCode;
|
||||||
|
|
||||||
|
@Schema(title = "姓名")
|
||||||
|
private String realName;
|
||||||
|
|
||||||
|
@Schema(title = "员工编号")
|
||||||
|
private String workNo;
|
||||||
|
|
||||||
|
private List<String> userIds;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
package com.renkang.bank.model.po;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 礼品表 -礼品基本信息
|
||||||
|
*
|
||||||
|
* @author feng
|
||||||
|
* @date 2026-02-05
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@TableName("bank_gift_info")
|
||||||
|
@Schema(title = "礼品基本信息", description = "礼品基本信息")
|
||||||
|
public class GiftInfo implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@Schema(title = "id")
|
||||||
|
@JsonFormat(shape = JsonFormat.Shape.STRING)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(title = "礼品名称")
|
||||||
|
private String giftName;
|
||||||
|
|
||||||
|
@Schema(title = "礼品主图(多个使用逗号分隔)")
|
||||||
|
private String giftImage;
|
||||||
|
|
||||||
|
@Schema(title = "礼品库存")
|
||||||
|
private Integer inventory;
|
||||||
|
|
||||||
|
@Schema(title = "礼品分类(1-实物礼品,2-虚拟礼品)")
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
@Schema(title = "礼品价格")
|
||||||
|
private BigDecimal price;
|
||||||
|
|
||||||
|
@Schema(title = "用户限购数量")
|
||||||
|
private Integer purchaseLimit;
|
||||||
|
|
||||||
|
@Schema(title = "礼品详情(富文本内容描述)")
|
||||||
|
private String giftInfo;
|
||||||
|
|
||||||
|
@Schema(title = "状态(0-启用,1-停用)")
|
||||||
|
private Integer status = 0;
|
||||||
|
|
||||||
|
@Schema(title = "删除标记")
|
||||||
|
@TableLogic
|
||||||
|
private Integer delFlag;
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
@Schema(title = "创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(title = "修改时间")
|
||||||
|
private Date lastModifyDate;
|
||||||
|
}
|
||||||
+58
@@ -0,0 +1,58 @@
|
|||||||
|
package com.renkang.bank.model.po;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 礼品库存变更记录表 -礼品库存变更记录表
|
||||||
|
*
|
||||||
|
* @author feng
|
||||||
|
* @date 2026-02-05
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@TableName("bank_gift_inventory_log")
|
||||||
|
@Schema(title = "礼品库存变更记录表", description = "礼品库存变更记录表")
|
||||||
|
public class GiftInventoryLog implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@Schema(title = "id")
|
||||||
|
@JsonFormat(shape = JsonFormat.Shape.STRING)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(title = "礼品ID")
|
||||||
|
@JsonFormat(shape = JsonFormat.Shape.STRING)
|
||||||
|
private Long giftId;
|
||||||
|
|
||||||
|
@Schema(title = "本次库存变化")
|
||||||
|
private Integer inventory;
|
||||||
|
|
||||||
|
@Schema(title = "1-加库存,2-减库存")
|
||||||
|
private Integer changeType;
|
||||||
|
|
||||||
|
@Schema(title = "本次变动前库存")
|
||||||
|
private Integer beforeInventory;
|
||||||
|
|
||||||
|
@Schema(title = "本次变动后库存")
|
||||||
|
private Integer afterInventory;
|
||||||
|
|
||||||
|
@Schema(title = "操作人ID")
|
||||||
|
private String operatorId;
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
@Schema(title = "创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
}
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
package com.renkang.bank.model.po;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 礼品价格变更记录表 -礼品价格变更记录表
|
||||||
|
*
|
||||||
|
* @author feng
|
||||||
|
* @date 2026-02-05
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@TableName("bank_gift_price_log")
|
||||||
|
@Schema(title = "礼品价格变更记录表", description = "礼品价格变更记录表")
|
||||||
|
public class GiftPriceLog implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@Schema(title = "id")
|
||||||
|
@JsonFormat(shape = JsonFormat.Shape.STRING)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(title = "礼品ID")
|
||||||
|
@JsonFormat(shape = JsonFormat.Shape.STRING)
|
||||||
|
private Long giftId;
|
||||||
|
|
||||||
|
@Schema(title = "本次设定的价格")
|
||||||
|
private BigDecimal price;
|
||||||
|
|
||||||
|
@Schema(title = "本次变动前价格")
|
||||||
|
private BigDecimal beforePrice;
|
||||||
|
|
||||||
|
@Schema(title = "本次变动后价格")
|
||||||
|
private BigDecimal afterPrice;
|
||||||
|
|
||||||
|
@Schema(title = "操作人ID")
|
||||||
|
private String operatorId;
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
@Schema(title = "创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
}
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
package com.renkang.bank.model.po;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.github.yulichang.annotation.EntityMapping;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.FieldNameConstants;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单表 -积分兑换记录表
|
||||||
|
*
|
||||||
|
* @author feng
|
||||||
|
* @date 2026-02-05
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@FieldNameConstants
|
||||||
|
@TableName("bank_order_form")
|
||||||
|
@Schema(title = "订单表(积分兑换记录表)", description = "订单表(积分兑换记录表)")
|
||||||
|
public class OrderForm implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@Schema(title = "id")
|
||||||
|
@JsonFormat(shape = JsonFormat.Shape.STRING)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(title = "用户ID")
|
||||||
|
private String userId;
|
||||||
|
|
||||||
|
@Schema(title = "订单总额")
|
||||||
|
private BigDecimal orderPrice;
|
||||||
|
|
||||||
|
@Schema(title = "订单商品集合")
|
||||||
|
@TableField(exist = false)
|
||||||
|
@EntityMapping(thisField = OrderForm.Fields.id, joinField = OrderFormItem.Fields.orderId)
|
||||||
|
private List<OrderFormItem> orderFormItems;
|
||||||
|
|
||||||
|
@Schema(title = "删除标记")
|
||||||
|
@TableLogic
|
||||||
|
private Integer delFlag;
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
@Schema(title = "下单时间")
|
||||||
|
private Date createTime;
|
||||||
|
}
|
||||||
+38
@@ -0,0 +1,38 @@
|
|||||||
|
package com.renkang.bank.model.po;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.FieldNameConstants;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单子表 -订单明细表
|
||||||
|
*
|
||||||
|
* @author feng
|
||||||
|
* @date 2026-02-05
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@FieldNameConstants
|
||||||
|
@TableName("bank_order_form_item")
|
||||||
|
@Schema(title = "订单明细表", description = "订单明细表")
|
||||||
|
public class OrderFormItem implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@Schema(title = "id")
|
||||||
|
@JsonFormat(shape = JsonFormat.Shape.STRING)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(title = "订单ID")
|
||||||
|
@JsonFormat(shape = JsonFormat.Shape.STRING)
|
||||||
|
private Long orderId;
|
||||||
|
}
|
||||||
@@ -0,0 +1,96 @@
|
|||||||
|
package com.renkang.bank.model.po;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.FieldNameConstants;
|
||||||
|
import org.jeecg.common.aspect.annotation.Dict;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 积分规则表
|
||||||
|
* @Author: feng
|
||||||
|
* @Date: 2026-02-05
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@FieldNameConstants
|
||||||
|
@TableName("bank_points_rule")
|
||||||
|
@Schema(title = "积分规则表", description = "积分规则表")
|
||||||
|
public class PointsRule implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@Schema(title = "ID")
|
||||||
|
@JsonFormat(shape = JsonFormat.Shape.STRING)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Excel(name = "行为周期", width = 15, replace = {"次_1", "日_2", "周_3", "月_4", "季度_5", "年_6"}, orderNum = "3")
|
||||||
|
@Schema(title = "问答频次(1-单次,2-日/次,3-周/次,4-月/次,5-季度/次,6-年/次)")
|
||||||
|
private Integer frequency;
|
||||||
|
|
||||||
|
@Excel(name = "健康分类", width = 15, dicCode = "points_rule_category", orderNum = "1")
|
||||||
|
@Dict(dicCode = "points_rule_category")
|
||||||
|
@Schema(title = "规则类别")
|
||||||
|
private Integer ruleCategory;
|
||||||
|
|
||||||
|
@Excel(name = "健康行为", width = 15, orderNum = "2")
|
||||||
|
@Schema(title = "规则描述")
|
||||||
|
private String ruleDesc;
|
||||||
|
|
||||||
|
@Schema(title = "图标")
|
||||||
|
private String icon;
|
||||||
|
|
||||||
|
@Excel(name = "奖励积分", width = 15, orderNum = "4")
|
||||||
|
@Schema(title = "奖励积分")
|
||||||
|
private BigDecimal points;
|
||||||
|
|
||||||
|
@Schema(title = "状态1-启用,2停用")
|
||||||
|
private Integer status = 1;
|
||||||
|
|
||||||
|
@Schema(title = "删除标识0-正常,1已删除")
|
||||||
|
@TableLogic
|
||||||
|
private Integer delFlag;
|
||||||
|
|
||||||
|
@Schema(title = "创建人ID")
|
||||||
|
private String createUser;
|
||||||
|
|
||||||
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(title = "创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(title = "最后修改时间")
|
||||||
|
private Date lastModifyDate;
|
||||||
|
|
||||||
|
@Schema(title = "周期内打卡次数上限")
|
||||||
|
private Integer checkInUpper;
|
||||||
|
|
||||||
|
@Schema(title = "年额外积分上限")
|
||||||
|
private BigDecimal yearExtraPointUpper;
|
||||||
|
|
||||||
|
@Schema(title = "是否支持打卡叠加得分,0不支持,1支持")
|
||||||
|
private Integer supportCum;
|
||||||
|
|
||||||
|
@Schema(title = "是否需要填写补充信息,0不需要,1需要")
|
||||||
|
private Integer needRemark;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,102 @@
|
|||||||
|
package com.renkang.bank.model.po;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户积分汇总表 -产生过积分的用户每人一条数据
|
||||||
|
*
|
||||||
|
* @author feng
|
||||||
|
* @date 2026-02-05
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@TableName("bank_user_points")
|
||||||
|
@Schema(title = "用户积分汇总表", description = "用户积分汇总表")
|
||||||
|
public class UserPoints implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@Schema(title = "id")
|
||||||
|
@JsonFormat(shape = JsonFormat.Shape.STRING)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(title = "用户ID")
|
||||||
|
private String userId;
|
||||||
|
|
||||||
|
@Schema(title = "用户部门")
|
||||||
|
private String orgCode;
|
||||||
|
|
||||||
|
@Excel(name = "当前可用积分", width = 15, orderNum = "7")
|
||||||
|
@Schema(title = "当前可用积分")
|
||||||
|
private BigDecimal points;
|
||||||
|
|
||||||
|
@Excel(name = "累计获得积分", width = 15, orderNum = "8")
|
||||||
|
@Schema(title = "历史获得的积分总和")
|
||||||
|
private BigDecimal addPointsSum;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 记录所有扣除积分的总和,包含兑换消耗、手动扣除的积分
|
||||||
|
*/
|
||||||
|
@Schema(title = "历史扣除积分总和")
|
||||||
|
private BigDecimal deductPointsSum;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 积分兑换记录总和,只记录积分兑换
|
||||||
|
*/
|
||||||
|
@Excel(name = "累计兑换积分", width = 15, orderNum = "9")
|
||||||
|
@Schema(title = "历史兑换积分总和")
|
||||||
|
private BigDecimal exchangePointsSum;
|
||||||
|
|
||||||
|
@Schema(title = "状态(1-正常,2-冻结)")
|
||||||
|
private Integer status = 1;
|
||||||
|
/**
|
||||||
|
* 注意:该字段记录最后一次获得积分当天收获的积分总和,该归档字段的更新会减少后期对积分明细表的查询次数
|
||||||
|
*/
|
||||||
|
@Schema(title = "最新一天获取积分的总和")
|
||||||
|
private BigDecimal latestAddDaySum;
|
||||||
|
/**
|
||||||
|
* 注意:该字段记录最后一次消费积分当天收获的积分总和,该归档字段的更新会减少后期对积分明细表的查询次数
|
||||||
|
*/
|
||||||
|
@Schema(title = "最新一天消耗积分的总和")
|
||||||
|
private BigDecimal latestDeductDaySum;
|
||||||
|
|
||||||
|
@Excel(name = "最近一次打卡时间", width = 25, format = "yyyy-MM-dd HH:mm:ss", orderNum = "10")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
@Schema(title = "最新获得积分的日期")
|
||||||
|
private Date lastAddDate;
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||||
|
@Schema(title = "最新消费积分的日期")
|
||||||
|
private Date lastDeductDate;
|
||||||
|
|
||||||
|
@Schema(title = "删除标记")
|
||||||
|
@TableLogic
|
||||||
|
private Integer delFlag;
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
@Schema(title = "首次获得积分时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(title = "积分最后变更时间")
|
||||||
|
private Date lastVaryDate;
|
||||||
|
}
|
||||||
+80
@@ -0,0 +1,80 @@
|
|||||||
|
package com.renkang.bank.model.po;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.renkang.bank.enums.PointsSourceEnum;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户积分详情表 -记录每次的积分变更
|
||||||
|
*
|
||||||
|
* @author feng
|
||||||
|
* @date 2026-02-05
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@TableName("bank_user_points_details")
|
||||||
|
@Schema(title = "用户积分详情表", description = "用户积分详情表")
|
||||||
|
public class UserPointsDetails implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@Schema(title = "id")
|
||||||
|
@JsonFormat(shape = JsonFormat.Shape.STRING)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(title = "用户ID")
|
||||||
|
private String userId;
|
||||||
|
|
||||||
|
@Schema(title = "本次积分变化")
|
||||||
|
private BigDecimal points;
|
||||||
|
|
||||||
|
@Schema(title = "本次变动前积分")
|
||||||
|
private BigDecimal beforePoints;
|
||||||
|
|
||||||
|
@Schema(title = "本次变动后积分")
|
||||||
|
private BigDecimal afterPoints;
|
||||||
|
|
||||||
|
@Schema(title = "1-获得积分,2-扣减积分")
|
||||||
|
private Integer changeType;
|
||||||
|
|
||||||
|
@Schema(title = "补充信息")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see PointsSourceEnum 来源详见枚举类
|
||||||
|
*/
|
||||||
|
@Schema(title = "来源(survey-积分打卡,use-礼品兑换,violation-违规扣除,expired-过期清除)")
|
||||||
|
private String source;
|
||||||
|
|
||||||
|
@Schema(title = "关联业务ID(规则ID,礼品兑换订单Id等)")
|
||||||
|
@JsonFormat(shape = JsonFormat.Shape.STRING)
|
||||||
|
private Long businessId;
|
||||||
|
|
||||||
|
@Schema(title = "关联业务详情(可选择性的冗余业务详情:待定)")
|
||||||
|
private String businessInfo;
|
||||||
|
|
||||||
|
@Schema(title = "操作人ID")
|
||||||
|
private String operatorId;
|
||||||
|
|
||||||
|
@Schema(title = "删除标记")
|
||||||
|
@TableLogic
|
||||||
|
private Integer delFlag;
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
@Schema(title = "创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
}
|
||||||
+58
@@ -0,0 +1,58 @@
|
|||||||
|
package com.renkang.bank.model.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author pj
|
||||||
|
* @version 1.0
|
||||||
|
* @description: 用户积分榜单VO
|
||||||
|
* @date 2026/2/6 10:41
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class UserPointRankingVO {
|
||||||
|
|
||||||
|
@Excel(name = "排名", width = 15, orderNum = "8")
|
||||||
|
@Schema(title = "排名")
|
||||||
|
private Integer ranking;
|
||||||
|
|
||||||
|
@Schema(title = "用户id")
|
||||||
|
private String userId;
|
||||||
|
|
||||||
|
@Excel(name = "姓名", width = 15, orderNum = "3")
|
||||||
|
@Schema(title = "姓名")
|
||||||
|
private String realName;
|
||||||
|
|
||||||
|
@Excel(name = "员工编号", width = 15, orderNum = "4")
|
||||||
|
@Schema(title = "员工编号")
|
||||||
|
private String workNo;
|
||||||
|
|
||||||
|
@Excel(name = "年龄", width = 15, orderNum = "6")
|
||||||
|
@Schema(title = "年龄")
|
||||||
|
private Integer age;
|
||||||
|
|
||||||
|
@Schema(title = "头像")
|
||||||
|
private String avatar;
|
||||||
|
|
||||||
|
@Excel(name = "所属单位", width = 15, orderNum = "1")
|
||||||
|
@Schema(title = "单位名称")
|
||||||
|
private String orgName;
|
||||||
|
|
||||||
|
@Excel(name = "所属部门", width = 15, orderNum = "2")
|
||||||
|
@Schema(title = "部门名称")
|
||||||
|
private String deptName;
|
||||||
|
|
||||||
|
@Schema(title = "性别")
|
||||||
|
private Integer sex;
|
||||||
|
|
||||||
|
@Excel(name = "性别", width = 15, orderNum = "5")
|
||||||
|
@Schema(title = "性别")
|
||||||
|
private String sexName;
|
||||||
|
|
||||||
|
@Excel(name = "日累计积分", width = 15, orderNum = "7")
|
||||||
|
@Schema(title = "积分")
|
||||||
|
private BigDecimal pointSum;
|
||||||
|
}
|
||||||
+44
@@ -0,0 +1,44 @@
|
|||||||
|
package com.renkang.bank.model.vo;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author pj
|
||||||
|
* @version 1.0
|
||||||
|
* @description: 用户积分明细VO
|
||||||
|
* @date 2026/2/6 10:41
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class UserPointRecordVO {
|
||||||
|
|
||||||
|
@Schema(title = "记录id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(title = "得分说明")
|
||||||
|
private String businessInfo;
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
@Schema(title = "创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@Schema(title = "本次积分变化")
|
||||||
|
private BigDecimal points;
|
||||||
|
|
||||||
|
@Schema(title = "补充信息")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
public String getCreateMonthStr() {
|
||||||
|
if (createTime != null) {
|
||||||
|
return DateUtil.format(createTime, "yyyy年-MM月");
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
+48
@@ -0,0 +1,48 @@
|
|||||||
|
package com.renkang.bank.model.vo;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户积分详情VO
|
||||||
|
*
|
||||||
|
* @author feng
|
||||||
|
* @date 2026-02-05
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Schema(title = "用户积分详情VO", description = "用户积分详情VO")
|
||||||
|
public class UserPointsDeductDetailsVO {
|
||||||
|
|
||||||
|
@Schema(title = "id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(title = "用户ID")
|
||||||
|
private String userId;
|
||||||
|
|
||||||
|
@Excel(name = "积分变化", width = 15, orderNum = "2")
|
||||||
|
@Schema(title = "本次积分变化")
|
||||||
|
private BigDecimal points;
|
||||||
|
|
||||||
|
@Excel(name = "支出信息", width = 25, orderNum = "1")
|
||||||
|
@Schema(title = "补充信息")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@Schema(title = "关联业务ID(规则ID,礼品兑换订单Id等)")
|
||||||
|
private Long businessId;
|
||||||
|
|
||||||
|
@Excel(name = "支出时间", width = 25, format = "yyyy-MM-dd HH:mm:ss", orderNum = "3")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
@Schema(title = "创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
}
|
||||||
+56
@@ -0,0 +1,56 @@
|
|||||||
|
package com.renkang.bank.model.vo;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户积分详情VO
|
||||||
|
*
|
||||||
|
* @author feng
|
||||||
|
* @date 2026-02-05
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Schema(title = "用户积分详情VO", description = "用户积分详情VO")
|
||||||
|
public class UserPointsDetailsVO {
|
||||||
|
|
||||||
|
@Schema(title = "id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(title = "用户ID")
|
||||||
|
private String userId;
|
||||||
|
|
||||||
|
@Excel(name = "积分变化", width = 15, orderNum = "4")
|
||||||
|
@Schema(title = "本次积分变化")
|
||||||
|
private BigDecimal points;
|
||||||
|
|
||||||
|
@Excel(name = "补充信息", width = 15, orderNum = "2")
|
||||||
|
@Schema(title = "补充信息")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@Schema(title = "关联业务ID(规则ID,礼品兑换订单Id等)")
|
||||||
|
private Long businessId;
|
||||||
|
|
||||||
|
@Excel(name = "健康行为", width = 25, orderNum = "1")
|
||||||
|
@Schema(title = "关联业务详情(可选择性的冗余业务详情:待定)")
|
||||||
|
private String businessInfo;
|
||||||
|
|
||||||
|
@Excel(name = "打卡时间", width = 25, format = "yyyy-MM-dd HH:mm:ss", orderNum = "5")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
@Schema(title = "创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@Excel(name = "行为周期", width = 15, replace = {"次_1", "日_2", "周_3", "月_4", "季度_5", "年_6"}, orderNum = "3")
|
||||||
|
@Schema(title = "问答频次(1-单次,2-日/次,3-周/次,4-月/次,5-季度/次,6-年/次)")
|
||||||
|
private Integer frequency;
|
||||||
|
}
|
||||||
+42
@@ -0,0 +1,42 @@
|
|||||||
|
package com.renkang.bank.model.vo;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonSetter;
|
||||||
|
import com.fasterxml.jackson.annotation.Nulls;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author pj
|
||||||
|
* @version 1.0
|
||||||
|
* @description: 用户积分信息vo
|
||||||
|
* @date 2026/2/6 9:31
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class UserPointsInfoVO {
|
||||||
|
|
||||||
|
@Schema(title = "可用积分")
|
||||||
|
@JsonSetter(nulls = Nulls.SKIP)
|
||||||
|
private BigDecimal points = BigDecimal.ZERO;
|
||||||
|
|
||||||
|
@Schema(title = "累计积分")
|
||||||
|
@JsonSetter(nulls = Nulls.SKIP)
|
||||||
|
private BigDecimal addPointsSum = BigDecimal.ZERO;
|
||||||
|
|
||||||
|
@Schema(title = "累计兑换")
|
||||||
|
@JsonSetter(nulls = Nulls.SKIP)
|
||||||
|
private BigDecimal exchangePointsSum = BigDecimal.ZERO;
|
||||||
|
|
||||||
|
public BigDecimal getPoints() {
|
||||||
|
return points == null ? BigDecimal.ZERO : points;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getAddPointsSum() {
|
||||||
|
return addPointsSum == null ? BigDecimal.ZERO : addPointsSum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getExchangePointsSum() {
|
||||||
|
return exchangePointsSum == null ? BigDecimal.ZERO : exchangePointsSum;
|
||||||
|
}
|
||||||
|
}
|
||||||
+42
@@ -0,0 +1,42 @@
|
|||||||
|
package com.renkang.bank.model.vo;
|
||||||
|
|
||||||
|
import com.renkang.bank.model.po.UserPoints;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author pj
|
||||||
|
* @version 1.0
|
||||||
|
* @description: 用户积分信息列表VO
|
||||||
|
* @date 2026/2/5 18:51
|
||||||
|
*/
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Data
|
||||||
|
public class UserPointsListVO extends UserPoints {
|
||||||
|
|
||||||
|
@Excel(name = "姓名", width = 15, orderNum = "3")
|
||||||
|
@Schema(title = "姓名")
|
||||||
|
private String realName;
|
||||||
|
|
||||||
|
@Excel(name = "员工编号", width = 15, orderNum = "4")
|
||||||
|
@Schema(title = "员工编号")
|
||||||
|
private String workNo;
|
||||||
|
|
||||||
|
@Excel(name = "所属单位", width = 15, orderNum = "1")
|
||||||
|
@Schema(title = "所属单位名称")
|
||||||
|
private String orgName;
|
||||||
|
|
||||||
|
@Excel(name = "所属部门", width = 15, orderNum = "2")
|
||||||
|
@Schema(title = "所属部门名称")
|
||||||
|
private String deptName;
|
||||||
|
|
||||||
|
@Excel(name = "性别", width = 15, orderNum = "5")
|
||||||
|
@Schema(title = "性别")
|
||||||
|
private String sexName;
|
||||||
|
|
||||||
|
@Excel(name = "年龄", width = 15, orderNum = "6")
|
||||||
|
@Schema(title = "年龄")
|
||||||
|
private Integer age;
|
||||||
|
}
|
||||||
+53
@@ -0,0 +1,53 @@
|
|||||||
|
package com.renkang.bank.model.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author pj
|
||||||
|
* @version 1.0
|
||||||
|
* @description: 员工打卡监测VO
|
||||||
|
* @date 2026/2/5 18:51
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class UserPointsMonitorVO {
|
||||||
|
|
||||||
|
@Schema(title = "用户id")
|
||||||
|
private String userId;
|
||||||
|
|
||||||
|
@Schema(title = "姓名")
|
||||||
|
private String realName;
|
||||||
|
|
||||||
|
@Schema(title = "员工编号")
|
||||||
|
private String workNo;
|
||||||
|
|
||||||
|
@Schema(title = "所属单位名称")
|
||||||
|
private String orgName;
|
||||||
|
|
||||||
|
@Schema(title = "所属部门名称")
|
||||||
|
private String deptName;
|
||||||
|
|
||||||
|
@Schema(title = "性别")
|
||||||
|
private String sexName;
|
||||||
|
|
||||||
|
@Schema(title = "年龄")
|
||||||
|
private Integer age;
|
||||||
|
|
||||||
|
@Schema(title = "健康行为")
|
||||||
|
private String businessInfo;
|
||||||
|
|
||||||
|
@Schema(title = "补充信息")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@Schema(title = "周期")
|
||||||
|
private Integer frequency;
|
||||||
|
|
||||||
|
@Schema(title = "获取积分")
|
||||||
|
private BigDecimal points;
|
||||||
|
|
||||||
|
@Schema(title = "打卡时间")
|
||||||
|
private Date createTime;
|
||||||
|
}
|
||||||
+39
@@ -0,0 +1,39 @@
|
|||||||
|
package com.renkang.bank.model.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.jeecg.common.aspect.annotation.Dict;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author pj
|
||||||
|
* @version 1.0
|
||||||
|
* @description: 用户积分任务VO
|
||||||
|
* @date 2026/2/6 9:54
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class UserPointsTaskVO {
|
||||||
|
|
||||||
|
@Schema(title = "规则id")
|
||||||
|
private Long ruleId;
|
||||||
|
|
||||||
|
@Schema(title = "问答频次(1-单次,2-日/次,3-周/次,4-月/次,5-季度/次,6-年/次)")
|
||||||
|
private Integer frequency;
|
||||||
|
|
||||||
|
@Dict(dicCode = "points_rule_category")
|
||||||
|
@Schema(title = "规则类别")
|
||||||
|
private Integer ruleCategory;
|
||||||
|
|
||||||
|
@Schema(title = "规则描述")
|
||||||
|
private String ruleDesc;
|
||||||
|
|
||||||
|
@Schema(title = "图标")
|
||||||
|
private String icon;
|
||||||
|
|
||||||
|
@Schema(title = "奖励积分")
|
||||||
|
private BigDecimal points;
|
||||||
|
|
||||||
|
@Schema(title = "打卡状态,0未打卡,1已打卡")
|
||||||
|
private Integer clockInStatus;
|
||||||
|
}
|
||||||
@@ -0,0 +1,65 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<artifactId>health-bank</artifactId>
|
||||||
|
<groupId>com.renkang</groupId>
|
||||||
|
<version>2.0.0</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>health-bank-biz</artifactId>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.renkang</groupId>
|
||||||
|
<artifactId>health-bank-api</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<!-- 引入分布式锁依赖 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.jeecgframework.boot</groupId>
|
||||||
|
<artifactId>jeecg-boot-starter-lock</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<!-- 中文拼音转换依赖 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.belerweb</groupId>
|
||||||
|
<artifactId>pinyin4j</artifactId>
|
||||||
|
<version>2.5.1</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.jeecgframework.boot</groupId>
|
||||||
|
<artifactId>jeecg-boot-starter-job</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.renkang</groupId>
|
||||||
|
<artifactId>renkang-starter-aspose-word</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.renkang</groupId>
|
||||||
|
<artifactId>font-resources</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.jeecgframework.boot</groupId>
|
||||||
|
<artifactId>jeecg-system-cloud-api</artifactId>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-source-plugin</artifactId>
|
||||||
|
<version>${maven-source-plugin.version}</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>attach-sources</id>
|
||||||
|
<goals>
|
||||||
|
<goal>jar</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
</project>
|
||||||
+97
@@ -0,0 +1,97 @@
|
|||||||
|
package com.renkang.bank.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.renkang.bank.model.dto.PointsRulePageDTO;
|
||||||
|
import com.renkang.bank.model.po.PointsRule;
|
||||||
|
import com.renkang.bank.service.IPointsRuleService;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.jeecg.common.system.base.controller.JeecgController;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author pj
|
||||||
|
* @version 1.0
|
||||||
|
* @description: 积分规则
|
||||||
|
* @date 2026/2/5 17:53
|
||||||
|
*/
|
||||||
|
@Tag(name = "积分规则")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/bank/pointsRule")
|
||||||
|
public class PointsRuleController extends JeecgController<PointsRule, IPointsRuleService> {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IPointsRuleService iPointsRuleService;
|
||||||
|
|
||||||
|
@Operation(summary = "积分规则-分页列表", description = "积分规则-分页列表")
|
||||||
|
// @RequiresPermissions("bank:points_rule:add")
|
||||||
|
@PostMapping(value = "/pageList")
|
||||||
|
public Result<IPage<PointsRule>> pageList(@RequestBody PointsRulePageDTO dto) {
|
||||||
|
return Result.OK(iPointsRuleService.pageList(dto));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "积分规则-添加", description = "积分规则-添加")
|
||||||
|
// @RequiresPermissions("bank:points_rule:add")
|
||||||
|
@PostMapping(value = "/add")
|
||||||
|
public Result<Integer> add(@RequestBody PointsRule pointsRule) {
|
||||||
|
return Result.OK("添加成功", iPointsRuleService.add(pointsRule));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "积分规则-修改", description = "积分规则-修改")
|
||||||
|
// @RequiresPermissions("bank:points_rule:edit")
|
||||||
|
@PostMapping(value = "/edit")
|
||||||
|
public Result<Integer> edit(@RequestBody PointsRule pointsRule) {
|
||||||
|
return Result.OK("修改成功", iPointsRuleService.edit(pointsRule));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "积分规则-修改状态", description = "积分规则-修改状态")
|
||||||
|
// @RequiresPermissions("bank:points_rule:edit")
|
||||||
|
@GetMapping(value = "/editStatus")
|
||||||
|
public Result<Integer> editStatus(@RequestParam(name = "id") Long id, @RequestParam(name = "status") Integer status) {
|
||||||
|
return Result.OK("修改成功", iPointsRuleService.editStatus(id, status));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "积分规则-详情", description = "积分规则-详情")
|
||||||
|
// @RequiresPermissions("bank:points_rule:byId")
|
||||||
|
@GetMapping(value = "/byId")
|
||||||
|
public Result<PointsRule> byId(@RequestParam(name = "id") String id) {
|
||||||
|
return Result.OK(iPointsRuleService.byId(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "积分规则-删除", description = "积分规则-删除")
|
||||||
|
// @RequiresPermissions("bank:points_rule:del")
|
||||||
|
@GetMapping(value = "/delete")
|
||||||
|
public Result<Integer> delete(@RequestParam(name = "id") String id) {
|
||||||
|
return Result.OK("删除成功", iPointsRuleService.delete(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "积分规则-批量删除", description = "积分规则-批量删除")
|
||||||
|
// @RequiresPermissions("bank:points_rule:del")
|
||||||
|
@GetMapping(value = "/deleteBatch")
|
||||||
|
public Result<Integer> deleteBatch(@RequestParam(name = "ids") String ids) {
|
||||||
|
if (StringUtils.isBlank(ids)) {
|
||||||
|
return Result.error("请选择需要删除的积分规则");
|
||||||
|
}
|
||||||
|
return Result.OK("删除成功", iPointsRuleService.deleteBatch(ids));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出excel
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param conHealthInfo
|
||||||
|
*/
|
||||||
|
@Operation(summary = "积分规则-导出", description = "积分规则-导出")
|
||||||
|
// @RequiresPermissions("bank:points_rule:exportXls")
|
||||||
|
@RequestMapping(value = "/exportXls")
|
||||||
|
public ModelAndView exportXls(HttpServletRequest request, PointsRule conHealthInfo) {
|
||||||
|
return super.exportXls(request, conHealthInfo, PointsRule.class, "积分规则");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+124
@@ -0,0 +1,124 @@
|
|||||||
|
package com.renkang.bank.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.renkang.bank.model.dto.UpdUserPointsDTO;
|
||||||
|
import com.renkang.bank.model.dto.UserPointsPageDTO;
|
||||||
|
import com.renkang.bank.model.dto.UserPointsRankingDTO;
|
||||||
|
import com.renkang.bank.model.vo.*;
|
||||||
|
import com.renkang.bank.service.IUserPointsService;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author pj
|
||||||
|
* @version 1.0
|
||||||
|
* @description: 用户积分汇总表
|
||||||
|
* @date 2026/2/5 16:42
|
||||||
|
*/
|
||||||
|
@Tag(name = "用户积分信息")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/bank/userPoints")
|
||||||
|
public class UserPointsController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IUserPointsService iUserPointsService;
|
||||||
|
|
||||||
|
@Operation(summary = "测试积分变更", description = "测试积分变更")
|
||||||
|
@PostMapping(value = "/testUpdateUserPoints")
|
||||||
|
public Result<Boolean> testUpdateUserPoints(@RequestBody UpdUserPointsDTO dto) {
|
||||||
|
return Result.OK(iUserPointsService.testUpdateUserPoints(dto));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "用户积分信息-分页列表", description = "用户积分信息-分页列表")
|
||||||
|
@PostMapping(value = "/pageList")
|
||||||
|
public Result<IPage<UserPointsListVO>> pageList(@RequestBody UserPointsPageDTO dto) {
|
||||||
|
return Result.OK(iUserPointsService.pageList(dto));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "用户积分信息-分页列表(导出)", description = "用户积分信息-分页列表(导出)")
|
||||||
|
@PostMapping(value = "/exportUserPoints")
|
||||||
|
public Result<String> exportUserPoints(@RequestBody UserPointsPageDTO dto) {
|
||||||
|
iUserPointsService.exportUserPoints(dto);
|
||||||
|
return Result.OK("导出成功,请在导出记录查看");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "用户积分信息-积分明细", description = "用户积分信息-积分明细")
|
||||||
|
@PostMapping(value = "/detailPageList")
|
||||||
|
public Result<IPage<UserPointsDetailsVO>> detailPageList(@RequestBody UserPointsPageDTO dto) {
|
||||||
|
return Result.OK(iUserPointsService.detailPageList(dto));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "用户积分信息-积分明细(导出)", description = "用户积分信息-积分明细(导出)")
|
||||||
|
@PostMapping(value = "/exportPointsDetail")
|
||||||
|
public Result<String> exportPointsDetail(@RequestBody UserPointsPageDTO dto) {
|
||||||
|
iUserPointsService.exportPointsDetail(dto);
|
||||||
|
return Result.OK("导出成功,请在导出记录查看");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "用户积分信息-扣除积分", description = "用户积分信息-扣除积分")
|
||||||
|
@PostMapping(value = "/deductPoint")
|
||||||
|
public Result<Boolean> deductPoint(@RequestBody UpdUserPointsDTO dto) {
|
||||||
|
return Result.OK(iUserPointsService.deductPoint(dto));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "用户积分信息-员工打卡监测", description = "用户积分信息-员工打卡监测")
|
||||||
|
@PostMapping(value = "/clockInMonitor")
|
||||||
|
public Result<IPage<UserPointsMonitorVO>> clockInMonitor(@RequestBody UserPointsPageDTO dto) {
|
||||||
|
return Result.OK(iUserPointsService.clockInMonitor(dto));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "用户积分信息-员工打卡监测(导出)", description = "用户积分信息-员工打卡监测(导出)")
|
||||||
|
@PostMapping(value = "/exportClockInMonitor")
|
||||||
|
public Result<String> exportClockInMonitor(@RequestBody UserPointsPageDTO dto) {
|
||||||
|
iUserPointsService.exportClockInMonitor(dto);
|
||||||
|
return Result.OK("导出成功,请在导出记录查看");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "用户积分信息-员工积分排名", description = "用户积分信息-员工积分排名")
|
||||||
|
@PostMapping(value = "/userRanking")
|
||||||
|
public Result<IPage<UserPointRankingVO>> userRanking(@RequestBody UserPointsRankingDTO dto) {
|
||||||
|
return Result.OK(iUserPointsService.userRanking(dto));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "用户积分信息-员工积分排名(导出)", description = "用户积分信息-员工积分排名(导出)")
|
||||||
|
@PostMapping(value = "/exportUserRanking")
|
||||||
|
public Result<String> exportUserRanking(@RequestBody UserPointsRankingDTO dto) {
|
||||||
|
iUserPointsService.exportUserRanking(dto);
|
||||||
|
return Result.OK("导出成功,请在导出记录查看");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "用户积分信息-app我的积分", description = "用户积分信息-app我的积分")
|
||||||
|
@GetMapping(value = "/app/myPoints")
|
||||||
|
public Result<UserPointsInfoVO> myPoints() {
|
||||||
|
return Result.OK(iUserPointsService.myPoints());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "用户积分信息-app积分任务", description = "用户积分信息-app积分任务")
|
||||||
|
@GetMapping(value = "/app/pointsTaskList")
|
||||||
|
public Result<List<UserPointsTaskVO>> pointsTaskList() {
|
||||||
|
return Result.OK(iUserPointsService.pointsTaskList());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "用户积分信息-app积分打卡", description = "用户积分信息-app积分打卡")
|
||||||
|
@PostMapping(value = "/app/pointCheckIn")
|
||||||
|
public Result<Boolean> pointCheckIn(@RequestBody UpdUserPointsDTO dto) {
|
||||||
|
return Result.OK(iUserPointsService.pointCheckIn(dto));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "用户积分信息-app积分明细", description = "用户积分信息-app积分明细")
|
||||||
|
@PostMapping(value = "/app/pointRecord")
|
||||||
|
public Result<IPage<UserPointRecordVO>> pointRecord(@RequestBody UserPointsPageDTO dto) {
|
||||||
|
return Result.OK(iUserPointsService.pointRecord(dto));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "用户积分信息-app积分榜单", description = "用户积分信息-app积分榜单")
|
||||||
|
@PostMapping(value = "/app/pointRanking")
|
||||||
|
public Result<IPage<UserPointRankingVO>> pointRanking(@RequestBody UserPointsRankingDTO dto) {
|
||||||
|
return Result.OK(iUserPointsService.pointRanking(dto));
|
||||||
|
}
|
||||||
|
}
|
||||||
+16
@@ -0,0 +1,16 @@
|
|||||||
|
package com.renkang.bank.mapper;
|
||||||
|
|
||||||
|
import com.github.yulichang.base.MPJBaseMapper;
|
||||||
|
import com.renkang.bank.model.po.PointsRule;
|
||||||
|
import com.renkang.bank.model.vo.UserPointsTaskVO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface PointsRuleMapper extends MPJBaseMapper<PointsRule> {
|
||||||
|
|
||||||
|
List<UserPointsTaskVO> pointsTaskList(@Param("userId") String userId);
|
||||||
|
|
||||||
|
}
|
||||||
+19
@@ -0,0 +1,19 @@
|
|||||||
|
package com.renkang.bank.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.github.yulichang.base.MPJBaseMapper;
|
||||||
|
import com.renkang.bank.model.dto.UserPointsRankingDTO;
|
||||||
|
import com.renkang.bank.model.po.UserPointsDetails;
|
||||||
|
import com.renkang.bank.model.vo.UserPointRankingVO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface UserPointsDetailsMapper extends MPJBaseMapper<UserPointsDetails> {
|
||||||
|
|
||||||
|
IPage<UserPointRankingVO> userRanking(IPage<UserPointRankingVO> page, Date startTime, Date endTime, UserPointsRankingDTO dto);
|
||||||
|
|
||||||
|
IPage<UserPointRankingVO> pointRanking(IPage<UserPointRankingVO> page, Date startTime, Date endTime, String secondOrgCode);
|
||||||
|
|
||||||
|
}
|
||||||
+14
@@ -0,0 +1,14 @@
|
|||||||
|
package com.renkang.bank.mapper;
|
||||||
|
|
||||||
|
import com.github.yulichang.base.MPJBaseMapper;
|
||||||
|
import com.renkang.bank.model.po.UserPoints;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author: pj
|
||||||
|
* @description: 用户积分
|
||||||
|
* @date 2026/2/5 16:47
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface UserPointsMapper extends MPJBaseMapper<UserPoints> {
|
||||||
|
}
|
||||||
+39
@@ -0,0 +1,39 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.renkang.bank.mapper.PointsRuleMapper">
|
||||||
|
|
||||||
|
<select id="pointsTaskList" resultType="com.renkang.bank.model.vo.UserPointsTaskVO">
|
||||||
|
SELECT
|
||||||
|
a.id as ruleId,
|
||||||
|
a.frequency,
|
||||||
|
a.rule_category,
|
||||||
|
a.rule_desc,
|
||||||
|
a.icon,
|
||||||
|
a.points,
|
||||||
|
CASE
|
||||||
|
WHEN a.frequency = 1 THEN -- 单次
|
||||||
|
IF(COUNT(b.id) > 0, 1, 0)
|
||||||
|
WHEN a.frequency = 2 THEN -- 日/次
|
||||||
|
IF(COUNT(CASE WHEN DATE(b.create_time) = CURDATE() THEN 1 END) > 0, 1, 0)
|
||||||
|
WHEN a.frequency = 3 THEN -- 周/次
|
||||||
|
IF(COUNT(CASE WHEN YEARWEEK(b.create_time, 1) = YEARWEEK(CURDATE(), 1) THEN 1 END) > 0, 1, 0)
|
||||||
|
WHEN a.frequency = 4 THEN -- 月/次
|
||||||
|
IF(COUNT(CASE WHEN DATE_FORMAT(b.create_time, '%Y-%m') = DATE_FORMAT(CURDATE(), '%Y-%m') THEN 1 END) > 0, 1, 0)
|
||||||
|
WHEN a.frequency = 5 THEN -- 季度/次
|
||||||
|
IF(COUNT(CASE WHEN QUARTER(b.create_time) = QUARTER(CURDATE()) AND YEAR(b.create_time) = YEAR(CURDATE()) THEN 1
|
||||||
|
END) > 0, 1, 0)
|
||||||
|
WHEN a.frequency = 6 THEN -- 年/次
|
||||||
|
IF(COUNT(CASE WHEN YEAR(b.create_time) = YEAR(CURDATE()) THEN 1 END) > 0, 1, 0)
|
||||||
|
ELSE 0
|
||||||
|
END AS clockInStatus
|
||||||
|
FROM
|
||||||
|
bank_points_rule a
|
||||||
|
LEFT JOIN bank_user_points_details b ON b.user_id = #{userId}
|
||||||
|
AND b.change_type = 1
|
||||||
|
AND b.business_id = a.id
|
||||||
|
GROUP BY
|
||||||
|
a.id,a.frequency
|
||||||
|
order by a.frequency
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
+82
@@ -0,0 +1,82 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.renkang.bank.mapper.UserPointsDetailsMapper">
|
||||||
|
|
||||||
|
<select id="userRanking" resultType="com.renkang.bank.model.vo.UserPointRankingVO">
|
||||||
|
<!--定义公共表表达式用于计算每个用户的总积分-->
|
||||||
|
WITH UserPointsSummary AS (
|
||||||
|
SELECT
|
||||||
|
a.user_id,
|
||||||
|
SUM(CASE WHEN a.change_type = 1 THEN a.points ELSE 0 END) -
|
||||||
|
SUM(CASE WHEN a.change_type = 2 THEN a.points ELSE 0 END) AS pointSum
|
||||||
|
FROM
|
||||||
|
bank_user_points_details a
|
||||||
|
INNER JOIN bank_user_points b ON a.user_id = b.user_id
|
||||||
|
<if test="null != dto.orgCode and '' != dto.orgCode">
|
||||||
|
AND b.org_code like concat(#{dto.orgCode},'%')
|
||||||
|
</if>
|
||||||
|
<if test="null != dto.deptCode and '' != dto.deptCode">
|
||||||
|
AND b.org_code like concat(#{dto.deptCode},'%')
|
||||||
|
</if>
|
||||||
|
GROUP BY
|
||||||
|
a.user_id
|
||||||
|
),
|
||||||
|
<!--计算所有用户的排名-->
|
||||||
|
RankedUsers AS (
|
||||||
|
SELECT
|
||||||
|
user_id,
|
||||||
|
pointSum,
|
||||||
|
ROW_NUMBER() OVER (ORDER BY pointSum DESC, user_id ASC) AS ranking
|
||||||
|
FROM
|
||||||
|
UserPointsSummary
|
||||||
|
)
|
||||||
|
<!--主查询:根据是否传入用户 ID 返回结果-->
|
||||||
|
SELECT
|
||||||
|
ranking,
|
||||||
|
user_id,
|
||||||
|
pointSum
|
||||||
|
FROM
|
||||||
|
RankedUsers
|
||||||
|
<where>
|
||||||
|
<if test="dto.userIds != null and dto.userIds.size() > 0">
|
||||||
|
AND user_id in
|
||||||
|
<foreach collection="dto.userIds" item="userId" open="(" separator="," close=")">
|
||||||
|
#{userId}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
ORDER BY
|
||||||
|
pointSum DESC, user_id ASC
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="pointRanking" resultType="com.renkang.bank.model.vo.UserPointRankingVO">
|
||||||
|
WITH UserPointsSummary AS (
|
||||||
|
SELECT
|
||||||
|
a.user_id,
|
||||||
|
SUM( CASE WHEN a.change_type = 1 THEN a.points ELSE 0 END ) - SUM( CASE WHEN a.change_type = 2 THEN a.points
|
||||||
|
ELSE 0 END ) AS pointSum
|
||||||
|
FROM
|
||||||
|
bank_user_points_details a
|
||||||
|
INNER JOIN bank_user_points b ON a.user_id = b.user_id
|
||||||
|
<if test="null != secondOrgCode and '' != secondOrgCode">
|
||||||
|
AND b.org_code like concat(#{secondOrgCode},'%')
|
||||||
|
</if>
|
||||||
|
<where>
|
||||||
|
<if test="startTime != null and endTime != null">
|
||||||
|
AND a.create_time BETWEEN #{startTime} AND #{endTime}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
GROUP BY
|
||||||
|
a.user_id
|
||||||
|
) SELECT
|
||||||
|
ROW_NUMBER() OVER ( ORDER BY pointSum DESC ) AS ranking,
|
||||||
|
user_id,
|
||||||
|
pointSum
|
||||||
|
FROM
|
||||||
|
UserPointsSummary
|
||||||
|
ORDER BY
|
||||||
|
pointSum DESC
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
+90
@@ -0,0 +1,90 @@
|
|||||||
|
package com.renkang.bank.redis.config;
|
||||||
|
|
||||||
|
import com.renkang.bank.redis.listener.BankAsyncListener;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.jeecg.common.system.vo.SysUserModel;
|
||||||
|
import org.jeecg.enums.ServerEnum;
|
||||||
|
import org.jeecg.redis.RedisStreamKeyEnum;
|
||||||
|
import org.jeecg.util.IPUtil;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.core.task.TaskExecutor;
|
||||||
|
import org.springframework.data.redis.connection.RedisConnectionFactory;
|
||||||
|
import org.springframework.data.redis.connection.stream.Consumer;
|
||||||
|
import org.springframework.data.redis.connection.stream.ObjectRecord;
|
||||||
|
import org.springframework.data.redis.connection.stream.ReadOffset;
|
||||||
|
import org.springframework.data.redis.connection.stream.StreamOffset;
|
||||||
|
import org.springframework.data.redis.hash.Jackson2HashMapper;
|
||||||
|
import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer;
|
||||||
|
import org.springframework.data.redis.serializer.StringRedisSerializer;
|
||||||
|
import org.springframework.data.redis.stream.StreamMessageListenerContainer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Shunzhi Jiang
|
||||||
|
* @since 2023/6/13
|
||||||
|
*/
|
||||||
|
@Configuration
|
||||||
|
@Slf4j
|
||||||
|
public class BankRedisStreamConfig {
|
||||||
|
|
||||||
|
private final Consumer consumer = Consumer.from(ServerEnum.BANK.getCustomGroup(), IPUtil.getCurrentServiceIp());
|
||||||
|
|
||||||
|
private final ReadOffset readOffset = ReadOffset.lastConsumed();
|
||||||
|
|
||||||
|
private BankAsyncListener bankAsyncListener;
|
||||||
|
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public void setDepartAsyncListener(BankAsyncListener bankAsyncListener) {
|
||||||
|
this.bankAsyncListener = bankAsyncListener;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public StreamMessageListenerContainer.StreamMessageListenerContainerOptions<String, ObjectRecord<String, SysUserModel>> sysUserModelInterveneStreamOptions(
|
||||||
|
@Qualifier("asyncTaskExecutor") TaskExecutor taskExecutor,
|
||||||
|
StringRedisSerializer stringSerializer,
|
||||||
|
GenericJackson2JsonRedisSerializer jsonSerializer
|
||||||
|
) {
|
||||||
|
return StreamMessageListenerContainer.StreamMessageListenerContainerOptions
|
||||||
|
.builder()
|
||||||
|
// 一次最多获取多少条消息
|
||||||
|
.batchSize(10)
|
||||||
|
// 运行 Stream 的 poll task
|
||||||
|
.executor(taskExecutor)
|
||||||
|
// 可以理解为 Stream Key 的序列化方式
|
||||||
|
.keySerializer(stringSerializer)
|
||||||
|
// 可以理解为 Stream 后方的字段的 key 的序列化方式
|
||||||
|
.hashKeySerializer(stringSerializer)
|
||||||
|
// 可以理解为 Stream 后方的字段的 value 的序列化方式
|
||||||
|
.hashValueSerializer(jsonSerializer)
|
||||||
|
// ObjectRecord 时,将 对象的 filed 和 value 转换成一个 Map 比如:将Book对象转换成map
|
||||||
|
.objectMapper(new Jackson2HashMapper(true))
|
||||||
|
// 将发送到Stream中的Record转换成ObjectRecord,转换成具体的类型是这个地方指定的类型
|
||||||
|
.targetType(SysUserModel.class)
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean(initMethod = "start", destroyMethod = "stop")
|
||||||
|
public StreamMessageListenerContainer<String, ObjectRecord<String, SysUserModel>> sysUserModelInterveneStreamMessageListenerContainer(
|
||||||
|
RedisConnectionFactory redisConnectionFactory,
|
||||||
|
StreamMessageListenerContainer.StreamMessageListenerContainerOptions<String, ObjectRecord<String, SysUserModel>> options
|
||||||
|
) {
|
||||||
|
StreamMessageListenerContainer<String, ObjectRecord<String, SysUserModel>> container =
|
||||||
|
StreamMessageListenerContainer.create(redisConnectionFactory, options);
|
||||||
|
// 修改用户
|
||||||
|
container.receive(
|
||||||
|
consumer,
|
||||||
|
createStreamOffset(RedisStreamKeyEnum.CHANGE_USER_DEPART),
|
||||||
|
bankAsyncListener
|
||||||
|
);
|
||||||
|
log.info("redisStream配置完成");
|
||||||
|
return container;
|
||||||
|
}
|
||||||
|
|
||||||
|
private StreamOffset<String> createStreamOffset(RedisStreamKeyEnum streamKeyEnum) {
|
||||||
|
return StreamOffset.create(streamKeyEnum.getKey(), readOffset);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+63
@@ -0,0 +1,63 @@
|
|||||||
|
package com.renkang.bank.redis.listener;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
|
import com.renkang.bank.mapper.UserPointsMapper;
|
||||||
|
import com.renkang.bank.model.po.UserPoints;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.jeecg.common.system.vo.SysUserModel;
|
||||||
|
import org.jeecg.enums.ServerEnum;
|
||||||
|
import org.jeecg.redis.RedisStreamKeyEnum;
|
||||||
|
import org.jeecg.redis.RedisStreamUtil;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.data.redis.connection.stream.ObjectRecord;
|
||||||
|
import org.springframework.data.redis.connection.stream.RecordId;
|
||||||
|
import org.springframework.data.redis.stream.StreamListener;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Shunzhi Jiang
|
||||||
|
* @since 2023/6/13
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
@Slf4j
|
||||||
|
public class BankAsyncListener implements StreamListener<String, ObjectRecord<String, SysUserModel>> {
|
||||||
|
@Autowired
|
||||||
|
private RedisStreamUtil redisStreamUtil;
|
||||||
|
@Autowired
|
||||||
|
private UserPointsMapper userPointsMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onMessage(ObjectRecord<String, SysUserModel> message) {
|
||||||
|
String streamKey = message.getStream();
|
||||||
|
SysUserModel model = message.getValue();
|
||||||
|
log.info("收到Redis Stream Key:{}", streamKey);
|
||||||
|
RecordId recordId = message.getId();
|
||||||
|
log.info("ID:{}, DATA: {}", recordId, JSON.toJSONString(model));
|
||||||
|
try {
|
||||||
|
if (RedisStreamKeyEnum.CHANGE_USER_DEPART.getKey().equals(streamKey)) {
|
||||||
|
if (StrUtil.isBlank(model.getId()) || StrUtil.isBlank(model.getOrgCode())) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 修改用户积分主表单位信息
|
||||||
|
updateUserPointsInfo(model);
|
||||||
|
}
|
||||||
|
ack(message);
|
||||||
|
log.info("Redis Stream消费成功:Key: {}, ID: {}", streamKey, recordId);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("Redis Stream消费异常:Key: {}, ID: {}", streamKey, recordId, e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void updateUserPointsInfo(SysUserModel model) {
|
||||||
|
userPointsMapper.update(new LambdaUpdateWrapper<UserPoints>()
|
||||||
|
.eq(UserPoints::getUserId, model.getId())
|
||||||
|
.set(UserPoints::getOrgCode, model.getOrgCode())
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ack(ObjectRecord<String, SysUserModel> message) {
|
||||||
|
redisStreamUtil.ack(ServerEnum.BANK.getCustomGroup(), message);
|
||||||
|
}
|
||||||
|
}
|
||||||
+23
@@ -0,0 +1,23 @@
|
|||||||
|
package com.renkang.bank.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.renkang.bank.model.dto.PointsRulePageDTO;
|
||||||
|
import com.renkang.bank.model.po.PointsRule;
|
||||||
|
|
||||||
|
public interface IPointsRuleService extends IService<PointsRule> {
|
||||||
|
|
||||||
|
IPage<PointsRule> pageList(PointsRulePageDTO dto);
|
||||||
|
|
||||||
|
int add(PointsRule pointsRule);
|
||||||
|
|
||||||
|
int edit(PointsRule pointsRule);
|
||||||
|
|
||||||
|
PointsRule byId(String id);
|
||||||
|
|
||||||
|
int delete(String id);
|
||||||
|
|
||||||
|
int editStatus(Long id, Integer status);
|
||||||
|
|
||||||
|
int deleteBatch(String ids);
|
||||||
|
}
|
||||||
+42
@@ -0,0 +1,42 @@
|
|||||||
|
package com.renkang.bank.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.renkang.bank.model.dto.UpdUserPointsDTO;
|
||||||
|
import com.renkang.bank.model.dto.UserPointsPageDTO;
|
||||||
|
import com.renkang.bank.model.dto.UserPointsRankingDTO;
|
||||||
|
import com.renkang.bank.model.vo.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface IUserPointsService {
|
||||||
|
|
||||||
|
boolean testUpdateUserPoints(UpdUserPointsDTO dto);
|
||||||
|
|
||||||
|
IPage<UserPointsListVO> pageList(UserPointsPageDTO dto);
|
||||||
|
|
||||||
|
void exportUserPoints(UserPointsPageDTO dto);
|
||||||
|
|
||||||
|
IPage<UserPointsDetailsVO> detailPageList(UserPointsPageDTO dto);
|
||||||
|
|
||||||
|
void exportPointsDetail(UserPointsPageDTO dto);
|
||||||
|
|
||||||
|
boolean deductPoint(UpdUserPointsDTO dto);
|
||||||
|
|
||||||
|
IPage<UserPointsMonitorVO> clockInMonitor(UserPointsPageDTO dto);
|
||||||
|
|
||||||
|
void exportClockInMonitor(UserPointsPageDTO dto);
|
||||||
|
|
||||||
|
IPage<UserPointRankingVO> userRanking(UserPointsRankingDTO dto);
|
||||||
|
|
||||||
|
void exportUserRanking(UserPointsRankingDTO dto);
|
||||||
|
|
||||||
|
UserPointsInfoVO myPoints();
|
||||||
|
|
||||||
|
List<UserPointsTaskVO> pointsTaskList();
|
||||||
|
|
||||||
|
boolean pointCheckIn(UpdUserPointsDTO dto);
|
||||||
|
|
||||||
|
IPage<UserPointRecordVO> pointRecord(UserPointsPageDTO dto);
|
||||||
|
|
||||||
|
IPage<UserPointRankingVO> pointRanking(UserPointsRankingDTO dto);
|
||||||
|
}
|
||||||
+80
@@ -0,0 +1,80 @@
|
|||||||
|
package com.renkang.bank.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.renkang.bank.mapper.PointsRuleMapper;
|
||||||
|
import com.renkang.bank.model.dto.PointsRulePageDTO;
|
||||||
|
import com.renkang.bank.model.po.PointsRule;
|
||||||
|
import com.renkang.bank.service.IPointsRuleService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
|
import org.jeecg.global.GlobalUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author pj
|
||||||
|
* @version 1.0
|
||||||
|
* @description: 积分规则
|
||||||
|
* @date 2026/2/5 18:01
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class PointsRuleServiceImpl extends ServiceImpl<PointsRuleMapper, PointsRule> implements IPointsRuleService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IPage<PointsRule> pageList(PointsRulePageDTO dto) {
|
||||||
|
Page<PointsRule> page = new Page<>(dto.getPageNo(), dto.getPageSize());
|
||||||
|
LambdaQueryWrapper<PointsRule> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.like(StringUtils.isNotBlank(dto.getRuleDesc()), PointsRule::getRuleDesc, dto.getRuleDesc());
|
||||||
|
queryWrapper.eq(ObjectUtil.isNotNull(dto.getRuleCategory()), PointsRule::getRuleDesc, dto.getRuleCategory());
|
||||||
|
queryWrapper.eq(ObjectUtil.isNotNull(dto.getStatus()), PointsRule::getRuleDesc, dto.getStatus());
|
||||||
|
queryWrapper.orderByDesc(PointsRule::getCreateTime);
|
||||||
|
return baseMapper.selectPage(page, queryWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int add(PointsRule pointsRule) {
|
||||||
|
String userId = GlobalUtils.getLoginUser().getId();
|
||||||
|
Date date = new Date();
|
||||||
|
pointsRule.setCreateUser(userId);
|
||||||
|
pointsRule.setLastModifyDate(date);
|
||||||
|
pointsRule.setCreateTime(date);
|
||||||
|
return baseMapper.insert(pointsRule);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int edit(PointsRule pointsRule) {
|
||||||
|
pointsRule.setLastModifyDate(new Date());
|
||||||
|
return baseMapper.updateById(pointsRule);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PointsRule byId(String id) {
|
||||||
|
return baseMapper.selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int delete(String id) {
|
||||||
|
return baseMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int editStatus(Long id, Integer status) {
|
||||||
|
return baseMapper.update(new LambdaUpdateWrapper<PointsRule>()
|
||||||
|
.eq(PointsRule::getId, id)
|
||||||
|
.set(PointsRule::getStatus, status)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int deleteBatch(String ids) {
|
||||||
|
return baseMapper.deleteBatchIds(Arrays.asList(ids.split(",")));
|
||||||
|
}
|
||||||
|
}
|
||||||
+688
@@ -0,0 +1,688 @@
|
|||||||
|
package com.renkang.bank.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import cn.hutool.core.date.DateTime;
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.hutool.core.text.CharSequenceUtil;
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||||
|
import com.renkang.bank.constant.HealthBankConstants;
|
||||||
|
import com.renkang.bank.enums.PointsSourceEnum;
|
||||||
|
import com.renkang.bank.mapper.PointsRuleMapper;
|
||||||
|
import com.renkang.bank.mapper.UserPointsDetailsMapper;
|
||||||
|
import com.renkang.bank.mapper.UserPointsMapper;
|
||||||
|
import com.renkang.bank.model.dto.UpdUserPointsDTO;
|
||||||
|
import com.renkang.bank.model.dto.UserPointsPageDTO;
|
||||||
|
import com.renkang.bank.model.dto.UserPointsRankingDTO;
|
||||||
|
import com.renkang.bank.model.po.PointsRule;
|
||||||
|
import com.renkang.bank.model.po.UserPoints;
|
||||||
|
import com.renkang.bank.model.po.UserPointsDetails;
|
||||||
|
import com.renkang.bank.model.vo.*;
|
||||||
|
import com.renkang.bank.service.IUserPointsService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.jeecg.common.exception.ExceptionAssertsUtil;
|
||||||
|
import org.jeecg.common.export.GenericExportHandler;
|
||||||
|
import org.jeecg.common.system.api.ISysBaseAPI;
|
||||||
|
import org.jeecg.common.system.vo.LoginUser;
|
||||||
|
import org.jeecg.enums.ExportExcelEnum;
|
||||||
|
import org.jeecg.global.GlobalUtils;
|
||||||
|
import org.jeecg.modules.manager.ISysCache;
|
||||||
|
import org.jeecg.modules.system.entity.SysDepart;
|
||||||
|
import org.jeecg.modules.system.entity.SysUser;
|
||||||
|
import org.springframework.core.task.AsyncTaskExecutor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author pj
|
||||||
|
* @version 1.0
|
||||||
|
* @description: 用户积分
|
||||||
|
* @date 2026/2/5 16:49
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class UserPointsServiceImpl extends ServiceImpl<UserPointsMapper, UserPoints> implements IUserPointsService {
|
||||||
|
|
||||||
|
private final PointsRuleMapper pointsRuleMapper;
|
||||||
|
private final UserPointsDetailsMapper userPointsDetailsMapper;
|
||||||
|
private final ISysBaseAPI iSysBaseAPI;
|
||||||
|
private final ISysCache sysCache;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IPage<UserPointsListVO> pageList(UserPointsPageDTO dto) {
|
||||||
|
Page<UserPointsListVO> page = new Page<>(dto.getPageNo(), dto.getPageSize());
|
||||||
|
MPJLambdaWrapper<UserPoints> queryWrapper = new MPJLambdaWrapper<>();
|
||||||
|
if (StringUtils.isNotBlank(dto.getRealName()) || StringUtils.isNotBlank(dto.getWorkNo())) {
|
||||||
|
//根据姓名和工号查询用户
|
||||||
|
List<String> userIdList = iSysBaseAPI.getUserIdsByDepartAndUsername(null, dto.getRealName(), null, dto.getWorkNo());
|
||||||
|
queryWrapper.in(!userIdList.isEmpty(), UserPoints::getUserId, userIdList);
|
||||||
|
}
|
||||||
|
// 动态排序
|
||||||
|
if (StringUtils.isNotBlank(dto.getColumn())) {
|
||||||
|
// 驼峰转下划线
|
||||||
|
String column = CharSequenceUtil.toUnderlineCase(dto.getColumn());
|
||||||
|
if ("asc".equalsIgnoreCase(dto.getOrder())) {
|
||||||
|
queryWrapper.orderByAsc(column);
|
||||||
|
} else {
|
||||||
|
queryWrapper.orderByDesc(column);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 默认排序
|
||||||
|
queryWrapper.orderByDesc(UserPoints::getLastAddDate);
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotBlank(dto.getOrgCode())) {
|
||||||
|
queryWrapper.likeRight(UserPoints::getOrgCode, dto.getOrgCode());
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotBlank(dto.getDeptCode())) {
|
||||||
|
queryWrapper.likeRight(UserPoints::getOrgCode, dto.getDeptCode());
|
||||||
|
}
|
||||||
|
Page<UserPointsListVO> voPage = baseMapper.selectJoinPage(page, UserPointsListVO.class, queryWrapper);
|
||||||
|
List<String> userIds = voPage.getRecords().stream().map(UserPoints::getUserId).collect(Collectors.toList());
|
||||||
|
if (!userIds.isEmpty()) {
|
||||||
|
List<LoginUser> loginUsers = iSysBaseAPI.listUserByIdsNew(userIds);
|
||||||
|
voPage.getRecords().forEach(vo -> {
|
||||||
|
LoginUser loginUser = loginUsers.stream().filter(user -> user.getId().equals(vo.getUserId())).findFirst().orElse(null);
|
||||||
|
if (loginUser != null) {
|
||||||
|
vo.setRealName(loginUser.getRealname());
|
||||||
|
vo.setWorkNo(loginUser.getWorkNo());
|
||||||
|
vo.setSexName(ObjectUtil.isNotNull(loginUser.getSex()) && loginUser.getSex().equals(1) ? "女" : "男");
|
||||||
|
vo.setAge(ObjectUtil.isNotNull(loginUser.getAge()) && loginUser.getAge() > 0 ? loginUser.getAge() : null);
|
||||||
|
SysDepart secondDepart = sysCache.getDepartByOrgCode(GlobalUtils.getSecondDepartOrgCode(vo.getOrgCode()));
|
||||||
|
if (ObjectUtil.isNotEmpty(secondDepart)) {
|
||||||
|
vo.setDeptName(secondDepart.getDepartName());
|
||||||
|
}
|
||||||
|
SysDepart thirdDepart = sysCache.getDepartByOrgCode(GlobalUtils.getThirdDepartOrgCode(vo.getOrgCode()));
|
||||||
|
if (ObjectUtil.isNotEmpty(thirdDepart)) {
|
||||||
|
vo.setOrgName(thirdDepart.getDepartName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return voPage;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private AsyncTaskExecutor asyncTaskExecutor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 导出数据(设备数据)
|
||||||
|
* @author PengJ
|
||||||
|
* @date 2025/11/18 14:57
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void exportUserPoints(UserPointsPageDTO dto) {
|
||||||
|
GenericExportHandler<UserPointsListVO, UserPointsPageDTO> handler =
|
||||||
|
new GenericExportHandler<>(
|
||||||
|
UserPointsListVO.class,
|
||||||
|
ExportExcelEnum.BANK_USER_POINTS,
|
||||||
|
asyncTaskExecutor,
|
||||||
|
log,
|
||||||
|
filter -> {
|
||||||
|
filter.setPageNo(1);
|
||||||
|
filter.setPageSize(-1);
|
||||||
|
List<UserPointsListVO> records = pageList(filter).getRecords();
|
||||||
|
return GenericExportHandler.handleData(records, UserPointsListVO.class);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
handler.exportAsync(dto);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IPage<UserPointsDetailsVO> detailPageList(UserPointsPageDTO dto) {
|
||||||
|
if (StringUtils.isBlank(dto.getUserId())) {
|
||||||
|
ExceptionAssertsUtil.fail("用户id不能为空");
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isNull(dto.getChangeType())) {
|
||||||
|
ExceptionAssertsUtil.fail("收支类型不能为空");
|
||||||
|
}
|
||||||
|
Page<UserPointsDetailsVO> page = new Page<>(dto.getPageNo(), dto.getPageSize());
|
||||||
|
MPJLambdaWrapper<UserPointsDetails> queryWrapper = new MPJLambdaWrapper<>();
|
||||||
|
queryWrapper.select(UserPointsDetails::getId, UserPointsDetails::getBusinessInfo,
|
||||||
|
UserPointsDetails::getPoints, UserPointsDetails::getCreateTime, UserPointsDetails::getChangeType,
|
||||||
|
UserPointsDetails::getRemark, UserPointsDetails::getBusinessId, UserPointsDetails::getUserId);
|
||||||
|
queryWrapper.select(PointsRule::getFrequency);
|
||||||
|
queryWrapper.leftJoin(PointsRule.class, PointsRule::getId, UserPointsDetails::getBusinessId);
|
||||||
|
queryWrapper.eq(UserPointsDetails::getUserId, dto.getUserId());
|
||||||
|
queryWrapper.eq(UserPointsDetails::getChangeType, dto.getChangeType());
|
||||||
|
queryWrapper.orderByDesc(UserPointsDetails::getCreateTime);
|
||||||
|
Page<UserPointsDetailsVO> voPage = userPointsDetailsMapper.selectJoinPage(page, UserPointsDetailsVO.class, queryWrapper);
|
||||||
|
if (dto.getChangeType().equals(HealthBankConstants.CHANGE_TYPE_DEDUCT)) {
|
||||||
|
voPage.getRecords().forEach(vo -> {
|
||||||
|
vo.setPoints(vo.getPoints().multiply(new BigDecimal(-1)));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return voPage;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void exportPointsDetail(UserPointsPageDTO dto) {
|
||||||
|
if (StringUtils.isBlank(dto.getUserId())) {
|
||||||
|
ExceptionAssertsUtil.fail("用户id不能为空");
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isNull(dto.getChangeType())) {
|
||||||
|
ExceptionAssertsUtil.fail("收支类型不能为空");
|
||||||
|
}
|
||||||
|
if (dto.getChangeType().equals(HealthBankConstants.CHANGE_TYPE_ADD)) {
|
||||||
|
GenericExportHandler<UserPointsDetailsVO, UserPointsPageDTO> handler =
|
||||||
|
new GenericExportHandler<>(
|
||||||
|
UserPointsDetailsVO.class,
|
||||||
|
ExportExcelEnum.BANK_POINTS_DETAIL,
|
||||||
|
asyncTaskExecutor,
|
||||||
|
log,
|
||||||
|
filter -> {
|
||||||
|
filter.setPageNo(1);
|
||||||
|
filter.setPageSize(-1);
|
||||||
|
List<UserPointsDetailsVO> records = detailPageList(filter).getRecords();
|
||||||
|
return GenericExportHandler.handleData(records, UserPointsDetailsVO.class);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
handler.exportAsync(dto);
|
||||||
|
} else if (dto.getChangeType().equals(HealthBankConstants.CHANGE_TYPE_DEDUCT)) {
|
||||||
|
GenericExportHandler<UserPointsDeductDetailsVO, UserPointsPageDTO> handler =
|
||||||
|
new GenericExportHandler<>(
|
||||||
|
UserPointsDeductDetailsVO.class,
|
||||||
|
ExportExcelEnum.BANK_POINTS_DETAIL,
|
||||||
|
asyncTaskExecutor,
|
||||||
|
log,
|
||||||
|
filter -> {
|
||||||
|
filter.setPageNo(1);
|
||||||
|
filter.setPageSize(-1);
|
||||||
|
List<UserPointsDetailsVO> records = detailPageList(filter).getRecords();
|
||||||
|
List<UserPointsDeductDetailsVO> voList = BeanUtil.copyToList(records, UserPointsDeductDetailsVO.class);
|
||||||
|
return GenericExportHandler.handleData(voList, UserPointsDeductDetailsVO.class);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
handler.exportAsync(dto);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean deductPoint(UpdUserPointsDTO dto) {
|
||||||
|
dto.setSourceType(PointsSourceEnum.TYPE_2_VIOLATION.getSource());
|
||||||
|
LoginUser loginUser = GlobalUtils.getLoginUser();
|
||||||
|
return updateUserPoints(dto, loginUser);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IPage<UserPointsMonitorVO> clockInMonitor(UserPointsPageDTO dto) {
|
||||||
|
Page<UserPointsMonitorVO> page = new Page<>(dto.getPageNo(), dto.getPageSize());
|
||||||
|
MPJLambdaWrapper<UserPointsDetails> queryWrapper = new MPJLambdaWrapper<>();
|
||||||
|
queryWrapper.selectAll(UserPointsDetails.class);
|
||||||
|
queryWrapper.select(PointsRule::getFrequency);
|
||||||
|
queryWrapper.eq(UserPointsDetails::getSource, PointsSourceEnum.TYPE_1_SURVEY.getSource());
|
||||||
|
if (StringUtils.isNotBlank(dto.getRealName()) || StringUtils.isNotBlank(dto.getWorkNo())) {
|
||||||
|
//根据姓名和工号查询用户
|
||||||
|
List<String> userIdList = iSysBaseAPI.getUserIdsByDepartAndUsername(null, dto.getRealName(), null, dto.getWorkNo());
|
||||||
|
queryWrapper.in(!userIdList.isEmpty(), UserPoints::getUserId, userIdList);
|
||||||
|
}
|
||||||
|
queryWrapper.orderByDesc(UserPointsDetails::getCreateTime);
|
||||||
|
if (StringUtils.isNotBlank(dto.getOrgCode())) {
|
||||||
|
queryWrapper.likeRight(UserPoints::getOrgCode, dto.getOrgCode());
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotBlank(dto.getDeptCode())) {
|
||||||
|
queryWrapper.likeRight(UserPoints::getOrgCode, dto.getDeptCode());
|
||||||
|
}
|
||||||
|
queryWrapper.leftJoin(PointsRule.class, PointsRule::getId, UserPointsDetails::getBusinessId);
|
||||||
|
queryWrapper.orderByDesc(UserPointsDetails::getCreateTime);
|
||||||
|
Page<UserPointsMonitorVO> voPage = userPointsDetailsMapper.selectJoinPage(page, UserPointsMonitorVO.class, queryWrapper);
|
||||||
|
List<String> userIds = voPage.getRecords().stream().map(UserPointsMonitorVO::getUserId).collect(Collectors.toList());
|
||||||
|
if (!userIds.isEmpty()) {
|
||||||
|
List<LoginUser> loginUsers = iSysBaseAPI.listUserByIdsNew(userIds);
|
||||||
|
voPage.getRecords().forEach(vo -> {
|
||||||
|
LoginUser loginUser = loginUsers.stream().filter(user -> user.getId().equals(vo.getUserId())).findFirst().orElse(null);
|
||||||
|
if (loginUser != null) {
|
||||||
|
vo.setRealName(loginUser.getRealname());
|
||||||
|
vo.setWorkNo(loginUser.getWorkNo());
|
||||||
|
vo.setSexName(ObjectUtil.isNotNull(loginUser.getSex()) && loginUser.getSex().equals(1) ? "女" : "男");
|
||||||
|
vo.setAge(ObjectUtil.isNotNull(loginUser.getAge()) && loginUser.getAge() > 0 ? loginUser.getAge() : null);
|
||||||
|
SysDepart secondDepart = sysCache.getDepartByOrgCode(GlobalUtils.getSecondDepartOrgCode(loginUser.getOrgCode()));
|
||||||
|
if (ObjectUtil.isNotEmpty(secondDepart)) {
|
||||||
|
vo.setDeptName(secondDepart.getDepartName());
|
||||||
|
}
|
||||||
|
SysDepart thirdDepart = sysCache.getDepartByOrgCode(GlobalUtils.getThirdDepartOrgCode(loginUser.getOrgCode()));
|
||||||
|
if (ObjectUtil.isNotEmpty(thirdDepart)) {
|
||||||
|
vo.setOrgName(thirdDepart.getDepartName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return voPage;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void exportClockInMonitor(UserPointsPageDTO dto) {
|
||||||
|
GenericExportHandler<UserPointsMonitorVO, UserPointsPageDTO> handler =
|
||||||
|
new GenericExportHandler<>(
|
||||||
|
UserPointsMonitorVO.class,
|
||||||
|
ExportExcelEnum.BANK_CLOCK_IN_RECORD,
|
||||||
|
asyncTaskExecutor,
|
||||||
|
log,
|
||||||
|
filter -> {
|
||||||
|
filter.setPageNo(1);
|
||||||
|
filter.setPageSize(-1);
|
||||||
|
List<UserPointsMonitorVO> records = clockInMonitor(filter).getRecords();
|
||||||
|
return GenericExportHandler.handleData(records, UserPointsMonitorVO.class);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
handler.exportAsync(dto);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IPage<UserPointRankingVO> userRanking(UserPointsRankingDTO dto) {
|
||||||
|
Page<UserPointRankingVO> page = new Page<>(dto.getPageNo(), dto.getPageSize());
|
||||||
|
Date startTime = null;
|
||||||
|
Date endTime = null;
|
||||||
|
Date now = new Date();
|
||||||
|
if (StringUtils.isNotBlank(dto.getRankType())) {
|
||||||
|
if ("0".equals(dto.getRankType())) {
|
||||||
|
// 获取当天的开始时间
|
||||||
|
startTime = DateUtil.beginOfDay(now);
|
||||||
|
// 获取当天的结束时间
|
||||||
|
endTime = DateUtil.endOfDay(now);
|
||||||
|
} else if ("1".equals(dto.getRankType())) {
|
||||||
|
// 获取本周的开始时间(周一)
|
||||||
|
startTime = DateUtil.beginOfWeek(now, true);
|
||||||
|
// 获取本周的结束时间(周日)
|
||||||
|
endTime = DateUtil.endOfWeek(now, true);
|
||||||
|
} else if ("2".equals(dto.getRankType())) {
|
||||||
|
// 获取本月的开始时间
|
||||||
|
startTime = DateUtil.beginOfMonth(now);
|
||||||
|
// 获取本月的结束时间
|
||||||
|
endTime = DateUtil.endOfMonth(now);
|
||||||
|
} else if ("3".equals(dto.getRankType())) {
|
||||||
|
// 获取本季度的开始时间
|
||||||
|
startTime = DateUtil.beginOfQuarter(now);
|
||||||
|
// 获取本季度的结束时间
|
||||||
|
endTime = DateUtil.endOfQuarter(now);
|
||||||
|
} else if ("4".equals(dto.getRankType())) {
|
||||||
|
// 获取本年度的开始时间
|
||||||
|
startTime = DateUtil.beginOfYear(now);
|
||||||
|
// 获取本年度的结束时间
|
||||||
|
endTime = DateUtil.endOfYear(now);
|
||||||
|
} else if ("5".equals(dto.getRankType())) {
|
||||||
|
// 获取指定时间的开始时间
|
||||||
|
startTime = DateUtil.beginOfDay(dto.getStartTime());
|
||||||
|
// 获取指定时间的结束时间
|
||||||
|
endTime = DateUtil.endOfDay(dto.getEndTime());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotBlank(dto.getRealName()) || StringUtils.isNotBlank(dto.getWorkNo())) {
|
||||||
|
List<String> sysUserIds = iSysBaseAPI.getUserIdsByDepartAndUsername(
|
||||||
|
StringUtils.isNotBlank(dto.getDeptCode()) ? dto.getDeptCode() : dto.getOrgCode(),
|
||||||
|
dto.getRealName(),
|
||||||
|
null,
|
||||||
|
dto.getWorkNo()
|
||||||
|
);
|
||||||
|
if (!sysUserIds.isEmpty()) {
|
||||||
|
dto.setUserIds(sysUserIds);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
IPage<UserPointRankingVO> voiPage = userPointsDetailsMapper.userRanking(page, startTime, endTime, dto);
|
||||||
|
List<String> userIds = voiPage.getRecords().stream().map(UserPointRankingVO::getUserId).collect(Collectors.toList());
|
||||||
|
List<LoginUser> loginUsers = iSysBaseAPI.listUserByIdsNew(userIds);
|
||||||
|
voiPage.getRecords().forEach(vo -> {
|
||||||
|
loginUsers.forEach(loginUser -> {
|
||||||
|
if (vo.getUserId().equals(loginUser.getId())) {
|
||||||
|
vo.setRealName(loginUser.getRealname());
|
||||||
|
vo.setAvatar(loginUser.getAvatar());
|
||||||
|
vo.setSex(loginUser.getSex());
|
||||||
|
vo.setSexName(ObjectUtil.isNotNull(loginUser.getSex()) && loginUser.getSex().equals(1) ? "女" : "男");
|
||||||
|
vo.setWorkNo(loginUser.getWorkNo());
|
||||||
|
vo.setAge(ObjectUtil.isNotNull(loginUser.getAge()) && loginUser.getAge() > 0 ? loginUser.getAge() : null);
|
||||||
|
SysDepart secondDepart = sysCache.getDepartByOrgCode(GlobalUtils.getSecondDepartOrgCode(loginUser.getOrgCode()));
|
||||||
|
if (ObjectUtil.isNotEmpty(secondDepart)) {
|
||||||
|
vo.setDeptName(secondDepart.getDepartName());
|
||||||
|
}
|
||||||
|
SysDepart thirdDepart = sysCache.getDepartByOrgCode(GlobalUtils.getThirdDepartOrgCode(loginUser.getOrgCode()));
|
||||||
|
if (ObjectUtil.isNotEmpty(thirdDepart)) {
|
||||||
|
vo.setOrgName(thirdDepart.getDepartName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
return voiPage;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void exportUserRanking(UserPointsRankingDTO dto) {
|
||||||
|
GenericExportHandler<UserPointRankingVO, UserPointsRankingDTO> handler =
|
||||||
|
new GenericExportHandler<>(
|
||||||
|
UserPointRankingVO.class,
|
||||||
|
ExportExcelEnum.BANK_USER_RANKING,
|
||||||
|
asyncTaskExecutor,
|
||||||
|
log,
|
||||||
|
filter -> {
|
||||||
|
filter.setPageNo(1);
|
||||||
|
filter.setPageSize(-1);
|
||||||
|
List<UserPointRankingVO> records = userRanking(filter).getRecords();
|
||||||
|
return GenericExportHandler.handleData(records, UserPointRankingVO.class);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
handler.exportAsync(dto);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean testUpdateUserPoints(UpdUserPointsDTO dto) {
|
||||||
|
List<String> sysUserIds = iSysBaseAPI.findSysUserIds(new SysUser());
|
||||||
|
List<LoginUser> loginUsers = iSysBaseAPI.listUserByIdsNew(sysUserIds);
|
||||||
|
loginUsers.forEach(user -> {
|
||||||
|
try {
|
||||||
|
updateUserPoints(dto, user);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("用户:{}({})更新积分异常,入参:{}", user.getRealname(), user.getUsername(), dto, e);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新用户积分
|
||||||
|
*
|
||||||
|
* @param dto
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public boolean updateUserPoints(UpdUserPointsDTO dto, LoginUser loginUser) {
|
||||||
|
log.info("------用户:{}({})开始更新积分,入参:{}------", loginUser.getRealname(), loginUser.getUsername(), dto);
|
||||||
|
PointsSourceEnum sourceEnum = PointsSourceEnum.getBySource(dto.getSourceType());
|
||||||
|
if (sourceEnum == null) {
|
||||||
|
log.error("积分类型不存在");
|
||||||
|
ExceptionAssertsUtil.fail("积分类型不存在");
|
||||||
|
}
|
||||||
|
String userId;
|
||||||
|
if (dto.getSourceType().equals(PointsSourceEnum.TYPE_2_VIOLATION.getSource())) {
|
||||||
|
if (StringUtils.isBlank(dto.getUserId())) {
|
||||||
|
log.error("扣减用户id不能为空");
|
||||||
|
ExceptionAssertsUtil.fail("扣减用户id不能为空");
|
||||||
|
}
|
||||||
|
//违规扣除
|
||||||
|
userId = dto.getUserId();
|
||||||
|
} else {
|
||||||
|
userId = loginUser.getId();
|
||||||
|
}
|
||||||
|
UserPoints userPoints = baseMapper.selectOne(new LambdaQueryWrapper<UserPoints>()
|
||||||
|
.eq(UserPoints::getUserId, userId)
|
||||||
|
);
|
||||||
|
boolean isAdd = false;
|
||||||
|
Date date = new Date();
|
||||||
|
UserPointsDetails userPointsDetails = new UserPointsDetails();
|
||||||
|
if (userPoints == null) {
|
||||||
|
isAdd = true;
|
||||||
|
userPoints = new UserPoints();
|
||||||
|
userPoints.setUserId(userId);
|
||||||
|
userPoints.setOrgCode(loginUser.getOrgCode());
|
||||||
|
userPoints.setCreateTime(date);
|
||||||
|
userPointsDetails.setBeforePoints(new BigDecimal(0));
|
||||||
|
} else {
|
||||||
|
userPointsDetails.setBeforePoints(userPoints.getPoints());
|
||||||
|
}
|
||||||
|
userPointsDetails.setUserId(userId);
|
||||||
|
switch (sourceEnum) {
|
||||||
|
case TYPE_1_SURVEY:
|
||||||
|
// 积分打卡
|
||||||
|
PointsRule pointsRule = pointsRuleMapper.selectById(dto.getBusinessId());
|
||||||
|
if (pointsRule == null) {
|
||||||
|
log.error("积分规则不存在");
|
||||||
|
ExceptionAssertsUtil.fail("积分规则不存在");
|
||||||
|
}
|
||||||
|
checkUserPoints(pointsRule, userId);
|
||||||
|
userPointsDetails.setPoints(pointsRule.getPoints());
|
||||||
|
userPointsDetails.setChangeType(HealthBankConstants.CHANGE_TYPE_ADD);
|
||||||
|
userPointsDetails.setSource(sourceEnum.getSource());
|
||||||
|
userPointsDetails.setBusinessId(dto.getBusinessId());
|
||||||
|
userPointsDetails.setBusinessInfo(pointsRule.getRuleDesc());
|
||||||
|
userPointsDetails.setOperatorId(userId);
|
||||||
|
if (StringUtils.isNotBlank(dto.getRemark())) {
|
||||||
|
userPointsDetails.setRemark(dto.getRemark());
|
||||||
|
}
|
||||||
|
if (isAdd) {
|
||||||
|
userPoints.setPoints(pointsRule.getPoints());
|
||||||
|
userPoints.setAddPointsSum(userPoints.getPoints());
|
||||||
|
userPoints.setDeductPointsSum(BigDecimal.valueOf(0));
|
||||||
|
userPoints.setLatestAddDaySum(userPoints.getPoints());
|
||||||
|
userPoints.setLatestDeductDaySum(BigDecimal.valueOf(0));
|
||||||
|
userPoints.setLastAddDate(date);
|
||||||
|
} else {
|
||||||
|
userPoints.setPoints(userPoints.getPoints().add(pointsRule.getPoints()));
|
||||||
|
userPoints.setAddPointsSum(userPoints.getAddPointsSum().add(pointsRule.getPoints()));
|
||||||
|
List<UserPointsDetails> details = userPointsDetailsMapper.selectList(new LambdaQueryWrapper<UserPointsDetails>()
|
||||||
|
.eq(UserPointsDetails::getUserId, userId)
|
||||||
|
.eq(UserPointsDetails::getChangeType, HealthBankConstants.CHANGE_TYPE_ADD)
|
||||||
|
.apply("DATE_FORMAT(create_time, '%Y-%m-%d') = {0}", DateUtil.today())
|
||||||
|
);
|
||||||
|
double sum = details.stream().map(UserPointsDetails::getPoints).mapToDouble(BigDecimal::doubleValue).sum();
|
||||||
|
userPoints.setLatestAddDaySum(BigDecimal.valueOf(sum).add(pointsRule.getPoints()));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case TYPE_2_USE:
|
||||||
|
// 礼品兑换
|
||||||
|
userPoints.setLastDeductDate(date);
|
||||||
|
break;
|
||||||
|
case TYPE_2_VIOLATION:
|
||||||
|
// 违规扣除
|
||||||
|
if (isAdd) {
|
||||||
|
ExceptionAssertsUtil.fail("用户积分不存在");
|
||||||
|
}
|
||||||
|
userPoints.setDeductPointsSum(userPoints.getDeductPointsSum().add(dto.getPoints()));
|
||||||
|
BigDecimal subtract = userPoints.getPoints().subtract(dto.getPoints());
|
||||||
|
userPoints.setPoints(subtract.compareTo(BigDecimal.valueOf(0)) < 0 ? BigDecimal.valueOf(0) : subtract);
|
||||||
|
userPointsDetails.setPoints(dto.getPoints());
|
||||||
|
userPointsDetails.setRemark(dto.getRemark());
|
||||||
|
userPointsDetails.setSource(sourceEnum.getSource());
|
||||||
|
userPointsDetails.setChangeType(HealthBankConstants.CHANGE_TYPE_DEDUCT);
|
||||||
|
userPointsDetails.setOperatorId(GlobalUtils.getLoginUser().getId());
|
||||||
|
break;
|
||||||
|
case TYPE_2_EXPIRED:
|
||||||
|
// 过期清除
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
userPointsDetails.setCreateTime(date);
|
||||||
|
userPointsDetails.setAfterPoints(userPoints.getPoints());
|
||||||
|
userPoints.setLastVaryDate(date);
|
||||||
|
boolean b = this.saveOrUpdate(userPoints);
|
||||||
|
if (b) {
|
||||||
|
b = userPointsDetailsMapper.insert(userPointsDetails) > 0;
|
||||||
|
}
|
||||||
|
log.info("======用户:{}({})更新积分结果:{}======", loginUser.getRealname(), loginUser.getUsername(), b);
|
||||||
|
return b;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检查用户积分
|
||||||
|
*
|
||||||
|
* @param pointsRule 积分规则
|
||||||
|
* @param userId 用户ID
|
||||||
|
*/
|
||||||
|
public void checkUserPoints(PointsRule pointsRule, String userId) {
|
||||||
|
LambdaQueryWrapper<UserPointsDetails> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
wrapper.eq(UserPointsDetails::getUserId, userId);
|
||||||
|
wrapper.eq(UserPointsDetails::getBusinessId, pointsRule.getId());
|
||||||
|
Long c;
|
||||||
|
Date date = new Date();
|
||||||
|
switch (pointsRule.getFrequency()) {
|
||||||
|
// 单次:检查用户是否已经获得过该积分
|
||||||
|
case 1:
|
||||||
|
break;
|
||||||
|
// 日/次:检查用户当天是否已经获得过该积分
|
||||||
|
case 2:
|
||||||
|
DateTime startOfDay = DateUtil.beginOfDay(date);
|
||||||
|
DateTime endOfDay = DateUtil.endOfDay(date);
|
||||||
|
wrapper.between(UserPointsDetails::getCreateTime, startOfDay, endOfDay);
|
||||||
|
c = userPointsDetailsMapper.selectCount(wrapper);
|
||||||
|
if (c > 0) {
|
||||||
|
ExceptionAssertsUtil.fail("今日已获得该积分");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
// 周/次:检查用户本周是否已经获得过该积分
|
||||||
|
case 3:
|
||||||
|
DateTime startOfWeek = DateUtil.beginOfWeek(date);
|
||||||
|
DateTime endOfWeek = DateUtil.endOfWeek(date);
|
||||||
|
wrapper.between(UserPointsDetails::getCreateTime, startOfWeek, endOfWeek);
|
||||||
|
c = userPointsDetailsMapper.selectCount(wrapper);
|
||||||
|
if (c > 0) {
|
||||||
|
ExceptionAssertsUtil.fail("本周已获得该积分");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
// 月/次:检查用户本月是否已经获得过该积分
|
||||||
|
case 4:
|
||||||
|
DateTime startOfMonth = DateUtil.beginOfMonth(date);
|
||||||
|
DateTime endOfMonth = DateUtil.endOfMonth(date);
|
||||||
|
wrapper.between(UserPointsDetails::getCreateTime, startOfMonth, endOfMonth);
|
||||||
|
c = userPointsDetailsMapper.selectCount(wrapper);
|
||||||
|
if (c > 0) {
|
||||||
|
ExceptionAssertsUtil.fail("本月已获得该积分");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
// 季度/次:检查用户本季度是否已经获得过该积分
|
||||||
|
case 5:
|
||||||
|
DateTime startOfQuarter = DateUtil.beginOfQuarter(date);
|
||||||
|
DateTime endOfQuarter = DateUtil.endOfQuarter(date);
|
||||||
|
wrapper.between(UserPointsDetails::getCreateTime, startOfQuarter, endOfQuarter);
|
||||||
|
c = userPointsDetailsMapper.selectCount(wrapper);
|
||||||
|
if (c > 0) {
|
||||||
|
ExceptionAssertsUtil.fail("本季度已获得该积分");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
// 年/次:检查用户本年度是否已经获得过该积分
|
||||||
|
case 6:
|
||||||
|
DateTime startOfYear = DateUtil.beginOfYear(date);
|
||||||
|
DateTime endOfYear = DateUtil.endOfYear(date);
|
||||||
|
wrapper.between(UserPointsDetails::getCreateTime, startOfYear, endOfYear);
|
||||||
|
c = userPointsDetailsMapper.selectCount(wrapper);
|
||||||
|
if (c > 0) {
|
||||||
|
ExceptionAssertsUtil.fail("本年已获得该积分");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
// 未知规则类型,默认不处理
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* app我的积分
|
||||||
|
*
|
||||||
|
* @return 积分信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public UserPointsInfoVO myPoints() {
|
||||||
|
String userId = GlobalUtils.getLoginUser().getId();
|
||||||
|
UserPoints userPoints = baseMapper.selectOne(new LambdaQueryWrapper<UserPoints>()
|
||||||
|
.eq(UserPoints::getUserId, userId)
|
||||||
|
);
|
||||||
|
UserPointsInfoVO vo = new UserPointsInfoVO();
|
||||||
|
if (userPoints != null) {
|
||||||
|
vo.setPoints(userPoints.getPoints());
|
||||||
|
vo.setAddPointsSum(userPoints.getAddPointsSum());
|
||||||
|
vo.setExchangePointsSum(userPoints.getExchangePointsSum());
|
||||||
|
}
|
||||||
|
return vo;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* app积分任务
|
||||||
|
*
|
||||||
|
* @return 列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<UserPointsTaskVO> pointsTaskList() {
|
||||||
|
String userId = GlobalUtils.getLoginUser().getId();
|
||||||
|
return pointsRuleMapper.pointsTaskList(userId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* app积分打卡
|
||||||
|
*
|
||||||
|
* @param dto 参数
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean pointCheckIn(UpdUserPointsDTO dto) {
|
||||||
|
dto.setSourceType(PointsSourceEnum.TYPE_1_SURVEY.getSource());
|
||||||
|
LoginUser loginUser = GlobalUtils.getLoginUser();
|
||||||
|
return updateUserPoints(dto, loginUser);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* app积分明细
|
||||||
|
*
|
||||||
|
* @param dto 参数
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public IPage<UserPointRecordVO> pointRecord(UserPointsPageDTO dto) {
|
||||||
|
if (ObjectUtil.isNull(dto.getChangeType())) {
|
||||||
|
ExceptionAssertsUtil.fail("收支类型不能为空");
|
||||||
|
}
|
||||||
|
String userId = GlobalUtils.getLoginUser().getId();
|
||||||
|
Page<UserPointRecordVO> page = new Page<>(dto.getPageNo(), dto.getPageSize());
|
||||||
|
MPJLambdaWrapper<UserPointsDetails> wrapper = new MPJLambdaWrapper<>();
|
||||||
|
wrapper.eq(UserPointsDetails::getUserId, userId);
|
||||||
|
wrapper.eq(UserPointsDetails::getChangeType, dto.getChangeType());
|
||||||
|
wrapper.orderByDesc(UserPointsDetails::getCreateTime);
|
||||||
|
return userPointsDetailsMapper.selectJoinPage(page, UserPointRecordVO.class, wrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* app积分榜单
|
||||||
|
*
|
||||||
|
* @param dto 参数
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public IPage<UserPointRankingVO> pointRanking(UserPointsRankingDTO dto) {
|
||||||
|
String orgCode = GlobalUtils.getLoginUser().getOrgCode();
|
||||||
|
String secondOrgCode = GlobalUtils.getSecondDepartOrgCode(orgCode);
|
||||||
|
Page<UserPointRankingVO> page = new Page<>(dto.getPageNo(), dto.getPageSize());
|
||||||
|
Date startTime = null;
|
||||||
|
Date endTime = null;
|
||||||
|
Date now = new Date();
|
||||||
|
if (StringUtils.isNotBlank(dto.getRankType())) {
|
||||||
|
if ("1".equals(dto.getRankType())) {
|
||||||
|
// 获取本周的开始时间(周一)
|
||||||
|
startTime = DateUtil.beginOfWeek(now, true);
|
||||||
|
// 获取本周的结束时间(周日)
|
||||||
|
endTime = DateUtil.endOfWeek(now, true);
|
||||||
|
} else if ("2".equals(dto.getRankType())) {
|
||||||
|
// 获取本月的开始时间
|
||||||
|
startTime = DateUtil.beginOfMonth(now);
|
||||||
|
// 获取本月的结束时间
|
||||||
|
endTime = DateUtil.endOfMonth(now);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
IPage<UserPointRankingVO> voiPage = userPointsDetailsMapper.pointRanking(page, startTime, endTime, secondOrgCode);
|
||||||
|
List<String> userIds = voiPage.getRecords().stream().map(UserPointRankingVO::getUserId).collect(Collectors.toList());
|
||||||
|
List<LoginUser> loginUsers = iSysBaseAPI.listUserByIdsNew(userIds);
|
||||||
|
voiPage.getRecords().forEach(vo -> {
|
||||||
|
loginUsers.forEach(loginUser -> {
|
||||||
|
if (vo.getUserId().equals(loginUser.getId())) {
|
||||||
|
vo.setRealName(loginUser.getRealname());
|
||||||
|
vo.setAvatar(loginUser.getAvatar());
|
||||||
|
vo.setSex(loginUser.getSex());
|
||||||
|
SysDepart secondDepart = sysCache.getDepartByOrgCode(GlobalUtils.getSecondDepartOrgCode(loginUser.getOrgCode()));
|
||||||
|
if (ObjectUtil.isNotEmpty(secondDepart)) {
|
||||||
|
vo.setDeptName(secondDepart.getDepartName());
|
||||||
|
}
|
||||||
|
SysDepart thirdDepart = sysCache.getDepartByOrgCode(GlobalUtils.getThirdDepartOrgCode(loginUser.getOrgCode()));
|
||||||
|
if (ObjectUtil.isNotEmpty(thirdDepart)) {
|
||||||
|
vo.setOrgName(thirdDepart.getDepartName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
return voiPage;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,77 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<artifactId>health-bank</artifactId>
|
||||||
|
<groupId>com.renkang</groupId>
|
||||||
|
<version>2.0.0</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>health-bank-start</artifactId>
|
||||||
|
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<!--微服务启动 starter-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.jeecgframework.boot</groupId>
|
||||||
|
<artifactId>jeecg-boot-starter-cloud</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.renkang</groupId>
|
||||||
|
<artifactId>health-bank-biz</artifactId>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<!-- 打包名称 -->
|
||||||
|
<finalName>${project.artifactId}</finalName>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-deploy-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<skip>true</skip>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
<profiles>
|
||||||
|
<profile>
|
||||||
|
<id>default</id>
|
||||||
|
<activation>
|
||||||
|
<activeByDefault>true</activeByDefault>
|
||||||
|
</activation>
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
</profile>
|
||||||
|
<profile>
|
||||||
|
<id>divide-package</id>
|
||||||
|
<activation>
|
||||||
|
<activeByDefault>false</activeByDefault>
|
||||||
|
</activation>
|
||||||
|
<properties>
|
||||||
|
<start-class>org.jeecg.JeecgHealthBankApplication</start-class>
|
||||||
|
</properties>
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-jar-plugin</artifactId>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-dependency-plugin</artifactId>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
</profile>
|
||||||
|
</profiles>
|
||||||
|
</project>
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package org.jeecg;
|
||||||
|
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||||
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||||
|
|
||||||
|
@SpringBootApplication(scanBasePackages = {"com.renkang", "org.jeecg"})
|
||||||
|
@EnableFeignClients(basePackages = {"org.jeecg", "com.renkang"})
|
||||||
|
@EnableScheduling
|
||||||
|
public class JeecgHealthBankApplication {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
SpringApplication.run(JeecgHealthBankApplication.class, args);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
PROFILE_NAME=dev
|
||||||
|
SERVER_PORT=7024
|
||||||
|
NACOS_SERVER_ADDR=localhost:8848
|
||||||
|
#NACOS_SERVER_ADDR=localhost:8848
|
||||||
|
NACOS_USERNAME=nacos
|
||||||
|
NACOS_PASSWORD=nacos
|
||||||
|
NACOS_NAMESPACE=f3f65fb2-303b-4bf7-bccb-4755886503c1
|
||||||
|
NACOS_GROUP=dev
|
||||||
|
#DB_NAME=cqyt_system
|
||||||
|
#REDIS_DB=10
|
||||||
|
FILE_SERVER_URL=http://fileserver.yg.dt.io
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
server:
|
||||||
|
port: ${SERVER_PORT:7024}
|
||||||
|
spring:
|
||||||
|
application:
|
||||||
|
name: health-bank
|
||||||
|
config:
|
||||||
|
import:
|
||||||
|
- optional:nacos:jeecg.yaml
|
||||||
|
- optional:nacos:${spring.application.name}-${PROFILE_NAME}.yaml
|
||||||
|
cloud:
|
||||||
|
nacos:
|
||||||
|
server-addr: ${NACOS_SERVER_ADDR}
|
||||||
|
username: ${NACOS_USERNAME:nacos}
|
||||||
|
password: ${NACOS_PASSWORD:nacos}
|
||||||
|
config:
|
||||||
|
enabled: true
|
||||||
|
namespace: ${NACOS_NAMESPACE:}
|
||||||
|
group: ${NACOS_GROUP:DEFAULT_GROUP}
|
||||||
|
server-addr: ${spring.cloud.nacos.server-addr}
|
||||||
|
username: ${spring.cloud.nacos.username}
|
||||||
|
password: ${spring.cloud.nacos.password}
|
||||||
|
discovery:
|
||||||
|
enabled: true
|
||||||
|
namespace: ${NACOS_NAMESPACE:}
|
||||||
|
group: ${NACOS_GROUP:DEFAULT_GROUP}
|
||||||
|
server-addr: ${spring.cloud.nacos.server-addr}
|
||||||
|
username: ${spring.cloud.nacos.username}
|
||||||
|
password: ${spring.cloud.nacos.password}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user