Compare commits
97
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 |
@@ -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='消息通知范围表';
|
||||
@@ -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");
|
||||
+6
-2
@@ -132,7 +132,7 @@ public interface AnYanClient {
|
||||
* @param token
|
||||
* @return
|
||||
*/
|
||||
AnYanUserInfoResult getAnYanUserInfo(String token);
|
||||
AnYanUserInfoResult getAnYanUserInfo(String token, String username);
|
||||
|
||||
/**
|
||||
* 批量拉取安眼平台AED信息 , 用于定时任务更新本地数据的AED数据
|
||||
@@ -155,7 +155,7 @@ public interface AnYanClient {
|
||||
* @param employeeNum 工号
|
||||
* @return
|
||||
*/
|
||||
CareUserListVo careUserDetails(String anYanUserId,String employeeNum);
|
||||
CareUserListVo careUserDetails(String anYanUserId, String employeeNum);
|
||||
|
||||
/**
|
||||
* 一人一案分页列表查询接口(用大屏首页重点关爱趋势预警弹窗列表)
|
||||
@@ -175,6 +175,7 @@ public interface AnYanClient {
|
||||
|
||||
/**
|
||||
* 批量更新员工关键信息接口
|
||||
*
|
||||
* @param employeeNumList
|
||||
* @return
|
||||
*/
|
||||
@@ -183,6 +184,7 @@ public interface AnYanClient {
|
||||
/**
|
||||
* 更新单个员工扩展信息
|
||||
* 是否是借调人员 这个判断是依据 数据中是否存在currentOfficeId来决定的,存在说明是借调人员,不存在说明不是借调人员
|
||||
*
|
||||
* @param employeeNum
|
||||
* @return
|
||||
*/
|
||||
@@ -190,6 +192,7 @@ public interface AnYanClient {
|
||||
|
||||
/**
|
||||
* 体检数据
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
@@ -197,6 +200,7 @@ public interface AnYanClient {
|
||||
|
||||
/**
|
||||
* 根据id查询体检数据
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
|
||||
+22
-11
@@ -103,6 +103,9 @@ public class AnYanClientExecutor implements AnYanClient {
|
||||
ResponseEntity<AuthResult> authResult = RestTemplateUtil.postExchangeForGetTokenByPassword(AnYanApiEnum.QUERY_AUTH_TOKEN, formData, headers, AuthResult.class);
|
||||
if (HttpStatus.OK.equals(authResult.getStatusCode())
|
||||
&& 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();
|
||||
} else {
|
||||
log.error("------安眼系统获取token失败(密码模式){}------", authResult.getBody());
|
||||
@@ -143,6 +146,7 @@ public class AnYanClientExecutor implements AnYanClient {
|
||||
if (ObjectUtil.isNotEmpty(authResult) && StrUtil.isNotEmpty(authResult.getAccess_token())) {
|
||||
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());
|
||||
log.info("---------刷新安眼token成功-------新的token:{},剩余过期时间:{}", authResult.getAccess_token(), authResult.getExpires_in());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -292,10 +296,14 @@ public class AnYanClientExecutor implements AnYanClient {
|
||||
*/
|
||||
@Override
|
||||
@Retryable(maxAttempts = 2)
|
||||
public AnYanUserInfoResult getAnYanUserInfo(String token) {
|
||||
public AnYanUserInfoResult getAnYanUserInfo(String token, String username) {
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
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);
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -307,9 +315,10 @@ public class AnYanClientExecutor implements AnYanClient {
|
||||
IPage<AnYanAedInfo> aedPage = new PageResultToBeanUtil<AnYanAedInfo>().transform(result, AnYanAedInfo.class);
|
||||
return aedPage.getRecords();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Retryable(maxAttempts = 2)
|
||||
public List<CarePersonList> homeCarePersonList(){
|
||||
public List<CarePersonList> homeCarePersonList() {
|
||||
AnYanResult<Object> result = RestTemplateUtil.postExchange(AnYanApiEnum.CARE_PERSON_BY_TIME, buildTokenHeader(), null);
|
||||
List<Object> listMaps = (List<Object>) result.getData();
|
||||
return listMaps.stream().map(lMap -> BeanUtil.toBean(lMap, CarePersonList.class)).collect(Collectors.toList());
|
||||
@@ -317,12 +326,12 @@ public class AnYanClientExecutor implements AnYanClient {
|
||||
|
||||
@Override
|
||||
@Retryable(maxAttempts = 2)
|
||||
public CareUserListVo careUserDetails(String anYanUserId,String employeeNum){
|
||||
public CareUserListVo careUserDetails(String anYanUserId, String employeeNum) {
|
||||
JSONObject param = new JSONObject();
|
||||
if(StrUtil.isNotEmpty(anYanUserId)){
|
||||
if (StrUtil.isNotEmpty(anYanUserId)) {
|
||||
param.put("id", anYanUserId);
|
||||
}
|
||||
if(StrUtil.isNotEmpty(employeeNum)){
|
||||
if (StrUtil.isNotEmpty(employeeNum)) {
|
||||
param.put("employeeNum", employeeNum);
|
||||
}
|
||||
AnYanResult<Object> result = RestTemplateUtil.postExchange(AnYanApiEnum.CARE_PERSON_Details, buildTokenHeader(), param);
|
||||
@@ -331,14 +340,14 @@ public class AnYanClientExecutor implements AnYanClient {
|
||||
|
||||
@Override
|
||||
@Retryable(maxAttempts = 2)
|
||||
public IPage<CareUserListVo> careUserDetailsPage(CareUserDetailsParam param){
|
||||
public IPage<CareUserListVo> careUserDetailsPage(CareUserDetailsParam param) {
|
||||
AnYanResult<Object> result = RestTemplateUtil.postExchange(AnYanApiEnum.CARE_PERSON_PAGE_LIST, buildTokenHeader(), param);
|
||||
return new PageResultToBeanUtil<CareUserListVo>().transform(result, CareUserListVo.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Retryable(maxAttempts = 2)
|
||||
public IPage<EmergencyContactVO> queryEmergencyContact(EmergencyContactParam param){
|
||||
public IPage<EmergencyContactVO> queryEmergencyContact(EmergencyContactParam param) {
|
||||
AnYanResult<Object> result = RestTemplateUtil.postExchange(AnYanApiEnum.QUERY_EMPLOYEE_CARE_PERSON, buildTokenHeader(), param);
|
||||
return new PageResultToBeanUtil<EmergencyContactVO>().transform(result, EmergencyContactVO.class);
|
||||
}
|
||||
@@ -346,8 +355,8 @@ public class AnYanClientExecutor implements AnYanClient {
|
||||
@Override
|
||||
@Retryable(maxAttempts = 2)
|
||||
public List<AnYanUpdateUserBatchInfo> updateUserBatch(List<String> employeeNumList) {
|
||||
Map<String,List<String>> map = new HashMap<>(1);
|
||||
map.put("employeeNumList",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());
|
||||
@@ -356,8 +365,8 @@ public class AnYanClientExecutor implements AnYanClient {
|
||||
@Override
|
||||
@Retryable(maxAttempts = 2)
|
||||
public AnYanUserEmployee updateEmployeeNum(String employeeNum) {
|
||||
Map<String,String> map = new HashMap<>(1);
|
||||
map.put("employeeNum",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);
|
||||
}
|
||||
@@ -370,12 +379,14 @@ public class AnYanClientExecutor implements AnYanClient {
|
||||
}
|
||||
|
||||
@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();
|
||||
|
||||
+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.config.AnYanProperties;
|
||||
@@ -22,7 +22,6 @@ import java.nio.charset.StandardCharsets;
|
||||
import java.time.Duration;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.Arrays;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
/**
|
||||
* @Description: AnYanClient xj安眼系统接口调用客户端
|
||||
@@ -55,27 +54,22 @@ public class AnYanRestTemplateConfig {
|
||||
* 自定义拦截器处理接口鉴权失败, 配合spring retry使用从而避免因token失效导致的接口调用失败
|
||||
*/
|
||||
public ClientHttpRequestInterceptor authInterceptor() {
|
||||
// 添加重试次数限制
|
||||
AtomicInteger retryCount = new AtomicInteger(0);
|
||||
int maxRetries = 5;
|
||||
return (httpRequest, bytes, clientHttpRequestExecution) -> {
|
||||
ClientHttpResponse execute;
|
||||
try {
|
||||
// 获取请求URL
|
||||
String url = httpRequest.getURI().toString();
|
||||
// 排除特定接口不执行拦截逻辑
|
||||
boolean shouldSkip = url.contains(AnYanApiEnum.QUERY_AUTH_TOKEN.getMethodPath());
|
||||
execute = clientHttpRequestExecution.execute(httpRequest, bytes);
|
||||
if (shouldSkip) {
|
||||
return execute;
|
||||
}
|
||||
HttpStatus httpStatus = execute.getStatusCode();
|
||||
if (Arrays.asList(HttpStatus.UNAUTHORIZED, HttpStatus.FORBIDDEN).contains(httpStatus)
|
||||
&& retryCount.getAndIncrement() < maxRetries) {
|
||||
SpringContextUtils.getBean("anYanClientExecutor", AnYanClient.class).refreshToken();
|
||||
if (Arrays.asList(HttpStatus.UNAUTHORIZED, HttpStatus.FORBIDDEN).contains(httpStatus)) {
|
||||
// 获取请求URL
|
||||
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) {
|
||||
log.error("---------安眼平台API调用异常-------e{}", e.getMessage(), e);
|
||||
log.error("---------安眼平台API调用异常-------e{},接口:{}", e.getMessage(), httpRequest.getURI(), e);
|
||||
ExceptionAssertsUtil.fail("安眼平台API调用失败");
|
||||
throw e;
|
||||
}
|
||||
|
||||
+5
-3
@@ -12,7 +12,6 @@ import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.util.MultiValueMap;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
@@ -64,8 +63,11 @@ public class RestTemplateUtil {
|
||||
String url = getProperties().getPublicHost() + api.getMethodPath();
|
||||
HttpEntity<MultiValueMap<String, String>> requestEntity = new HttpEntity<>(formData, headers);
|
||||
log.info("开始发送请求到: {},入参:{}", url, formData);
|
||||
long time1 = System.currentTimeMillis();
|
||||
ResponseEntity<T> response = getRestTemplate().exchange(url, api.getHttpMethod(), requestEntity, responseType);
|
||||
log.info("收到响应: {}", response);
|
||||
long time2 = System.currentTimeMillis();
|
||||
log.info("获取token(密码模式) 耗时:" + (time2 - time1) + "ms");
|
||||
return response;
|
||||
}
|
||||
|
||||
@@ -110,7 +112,7 @@ public class RestTemplateUtil {
|
||||
}
|
||||
|
||||
public static AnYanResult<Object> getExchange(AnYanApiEnum api, HttpHeaders headers, String id) {
|
||||
String url = getProperties().getHost() +api.getMethodPath()+ "/"+id;
|
||||
String url = getProperties().getHost() + api.getMethodPath() + "/" + id;
|
||||
HttpEntity<Object> requestEntity = new HttpEntity<>(headers);
|
||||
return responseHandler(getRestTemplate().exchange(url, api.getHttpMethod(), requestEntity, AnYanResult.class));
|
||||
}
|
||||
@@ -125,7 +127,7 @@ public class RestTemplateUtil {
|
||||
if (HttpStatus.OK.equals(entity.getStatusCode()) && ObjectUtils.isNotEmpty(entity.getBody())) {
|
||||
return entity.getBody();
|
||||
} 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:";
|
||||
|
||||
/**
|
||||
* 缓存安眼用户登录token
|
||||
*/
|
||||
String AN_YAN_API_USER_TOKEN_PREFIX = "exterior:anyan:api:access_token";
|
||||
|
||||
/**
|
||||
* 缓存安眼用户信息
|
||||
*/
|
||||
String AN_YAN_API_USERINFO_PREFIX = "exterior:anyan:api:userinfo";
|
||||
|
||||
/**
|
||||
* 部分业务接口需要代入的请求头参数Roles
|
||||
*/
|
||||
|
||||
+1
-1
@@ -99,7 +99,7 @@ public enum AnYanApiEnum {
|
||||
/**
|
||||
* 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.批量更新员工关键信息接口
|
||||
|
||||
+3
@@ -1,5 +1,6 @@
|
||||
package com.renkang.anyan.model.dto;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -34,4 +35,6 @@ public class CareUserDetailsParam {
|
||||
|
||||
@Schema(title = "pageType")
|
||||
private String pageType = "plus";
|
||||
|
||||
private int year = DateUtil.thisYear();
|
||||
}
|
||||
|
||||
@@ -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}
|
||||
@@ -0,0 +1,28 @@
|
||||
<?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">
|
||||
|
||||
<parent>
|
||||
<groupId>org.jeecgframework.boot</groupId>
|
||||
<artifactId>jeecg-boot-parent</artifactId>
|
||||
<version>4.0</version>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>health-bank</artifactId>
|
||||
<groupId>com.renkang</groupId>
|
||||
<version>2.0.0</version>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<modules>
|
||||
<module>health-bank-api</module>
|
||||
<module>health-bank-biz</module>
|
||||
<module>health-bank-start</module>
|
||||
</modules>
|
||||
|
||||
<properties>
|
||||
<maven.install.skip>true</maven.install.skip>
|
||||
</properties>
|
||||
|
||||
</project>
|
||||
+5
@@ -1,5 +1,6 @@
|
||||
package com.renkang.consultation.dto;
|
||||
|
||||
import cn.hutool.http.HtmlUtil;
|
||||
import com.renkang.consultation.entity.ConPage;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
@@ -11,6 +12,10 @@ public class AccountDTO extends ConPage {
|
||||
@Schema(title = "专家姓名")
|
||||
private String doctorName;
|
||||
|
||||
public void setDoctorName(String doctorName) {
|
||||
this.doctorName = doctorName != null ? HtmlUtil.unescape(doctorName) : null;
|
||||
}
|
||||
|
||||
@Schema(title = "医院选择")
|
||||
private String hospitalName;
|
||||
|
||||
|
||||
+5
@@ -1,5 +1,6 @@
|
||||
package com.renkang.consultation.dto;
|
||||
|
||||
import cn.hutool.http.HtmlUtil;
|
||||
import com.renkang.consultation.entity.ConPage;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
@@ -10,6 +11,10 @@ public class ConDoctorDTO extends ConPage {
|
||||
|
||||
@Schema(title = "专家姓名")
|
||||
private String doctorName;
|
||||
|
||||
public void setDoctorName(String doctorName) {
|
||||
this.doctorName = doctorName != null ? HtmlUtil.unescape(doctorName) : null;
|
||||
}
|
||||
@Schema(title = "专家编号")
|
||||
private String doctorNo;
|
||||
|
||||
|
||||
+8
@@ -1,5 +1,6 @@
|
||||
package com.renkang.consultation.dto;
|
||||
|
||||
import cn.hutool.http.HtmlUtil;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.renkang.consultation.entity.ConPage;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
@@ -17,6 +18,9 @@ public class ConEvaluateDTO extends ConPage {
|
||||
|
||||
@Schema(title = "咨询人")
|
||||
private String userName;
|
||||
public void setUserName(String userName) {
|
||||
this.userName = userName != null ? HtmlUtil.unescape(userName) : null;
|
||||
}
|
||||
|
||||
@Schema(title = "二级单位id")
|
||||
private String sysOrgSecondId;
|
||||
@@ -27,6 +31,10 @@ public class ConEvaluateDTO extends ConPage {
|
||||
@Schema(title = "咨询专家")
|
||||
private String expertName;
|
||||
|
||||
public void setExpertName(String expertName) {
|
||||
this.expertName = expertName != null ? HtmlUtil.unescape(expertName) : null;
|
||||
}
|
||||
|
||||
@Schema(title = "专家医院")
|
||||
private String expertHospital;
|
||||
|
||||
|
||||
+5
@@ -1,5 +1,6 @@
|
||||
package com.renkang.consultation.dto;
|
||||
|
||||
import cn.hutool.http.HtmlUtil;
|
||||
import com.renkang.consultation.entity.ConPage;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
@@ -10,6 +11,10 @@ public class ConHealthInfoAnswerDTO extends ConPage {
|
||||
@Schema(title = "员工姓名")
|
||||
private String fromName;
|
||||
|
||||
public void setFromName(String fromName) {
|
||||
this.fromName = fromName != null ? HtmlUtil.unescape(fromName) : null;
|
||||
}
|
||||
|
||||
@Schema(title = "手机号")
|
||||
private String phone;
|
||||
|
||||
|
||||
+5
@@ -1,5 +1,6 @@
|
||||
package com.renkang.consultation.dto;
|
||||
|
||||
import cn.hutool.http.HtmlUtil;
|
||||
import com.renkang.consultation.entity.ConPage;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
@@ -11,6 +12,10 @@ public class ConHelperDTO extends ConPage {
|
||||
@Schema(title = "全科医生姓名")
|
||||
private String userName;
|
||||
|
||||
public void setUserName(String userName) {
|
||||
this.userName = userName != null ? HtmlUtil.unescape(userName) : null;
|
||||
}
|
||||
|
||||
@Schema(title = "状态")
|
||||
private Integer status;
|
||||
|
||||
|
||||
+9
@@ -1,5 +1,6 @@
|
||||
package com.renkang.consultation.dto;
|
||||
|
||||
import cn.hutool.http.HtmlUtil;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.renkang.consultation.entity.ConPage;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
@@ -17,6 +18,10 @@ public class ConSessionDTO extends ConPage {
|
||||
@Schema(title = "员工姓名")
|
||||
private String fromName;
|
||||
|
||||
public void setFromName(String fromName) {
|
||||
this.fromName = fromName != null ? HtmlUtil.unescape(fromName) : null;
|
||||
}
|
||||
|
||||
@Schema(title = "员工id")
|
||||
private String fromAccount;
|
||||
|
||||
@@ -26,6 +31,10 @@ public class ConSessionDTO extends ConPage {
|
||||
@Schema(title = "专家姓名")
|
||||
private String doctorName;
|
||||
|
||||
public void setDoctorName(String doctorName) {
|
||||
this.doctorName = doctorName != null ? HtmlUtil.unescape(doctorName) : null;
|
||||
}
|
||||
|
||||
@Schema(title = "咨询状态(0待确认 1接收预约 2拒绝预约 3已过期 4已取消 5咨询中 6专家咨询结束 7员工咨询结束 8超时自动结束)")
|
||||
private String contentStatus;
|
||||
|
||||
|
||||
+15
-16
@@ -15,9 +15,11 @@ import com.renkang.consultation.vo.ConDoctorVO;
|
||||
import com.renkang.consultation.vo.ConHelperCustomUserVO;
|
||||
import com.renkang.emergency.entity.EmergencyCenterResource;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.constant.CommonConstant;
|
||||
import org.jeecg.common.system.api.ISysBaseAPI;
|
||||
import org.jeecg.modules.manager.SysCacheImpl;
|
||||
import org.jeecg.modules.system.entity.SysDepart;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -26,22 +28,17 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@RestController
|
||||
@RequestMapping(RequestPrefix.screen)
|
||||
@RequiredArgsConstructor
|
||||
public class ConScreenApiController {
|
||||
|
||||
|
||||
@Autowired
|
||||
private IConDoctorService conDoctorService;
|
||||
@Autowired
|
||||
private IConSessionService conSessionService;
|
||||
@Autowired
|
||||
private SysCacheImpl sysCache;
|
||||
private final IConDoctorService conDoctorService;
|
||||
private final IConSessionService conSessionService;
|
||||
private final SysCacheImpl sysCache;
|
||||
private final ISysBaseAPI sysBaseAPI;
|
||||
|
||||
@Operation(summary = "查询统计数", description = "查询统计数")
|
||||
@GetMapping("/queryStaticCount")
|
||||
@@ -108,16 +105,18 @@ public class ConScreenApiController {
|
||||
@GetMapping("/queryDeptCountStat")
|
||||
public Result<?> queryDeptCountStat() {
|
||||
List<Map<String, Object>> mapList = conDoctorService.getDeptCountStatList();
|
||||
//翻译部门名称之前循环查缓存20251225修改, 线上出现存在的部门未翻译成功的问题
|
||||
Set<String> orgCodes = mapList.stream().map(map -> map.get("orgCode").toString()).collect(Collectors.toSet());
|
||||
Map<String,String> orgCodeForName = sysBaseAPI.queryDepartNameByOrgCodes(orgCodes);
|
||||
if(!CollectionUtils.isEmpty(mapList)){
|
||||
for (Map<String, Object> map : mapList) {
|
||||
SysDepart depart = sysCache.getDepartByOrgCode(map.get("orgCode").toString());
|
||||
if(depart != null){
|
||||
map.put("departName", depart.getDepartName());
|
||||
}
|
||||
String orgName = orgCodeForName.get(map.get("orgCode").toString());
|
||||
map.put("departName", null != orgName ? orgName : "未知");
|
||||
}
|
||||
}
|
||||
return Result.OK(mapList);
|
||||
}
|
||||
|
||||
@Operation(summary = "科室咨询数量统计", description = "科室咨询数量统计")
|
||||
@GetMapping("/queryDepartmentCountStat")
|
||||
public Result<?> queryDepartmentCountStat() {
|
||||
|
||||
+6
@@ -480,4 +480,10 @@ public class ConSessionApiController {
|
||||
return conSessionApiService.insertUserAndHelperSessionNew();
|
||||
}
|
||||
|
||||
@Operation(summary = "超时关闭视频咨询", description = "超时关闭视频咨询")
|
||||
@GetMapping("/endVideoSession")
|
||||
public Result<String> endVideoSession() {
|
||||
return Result.ok(conSessionApiService.endVideoSession());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
@@ -115,4 +115,6 @@ public interface ConSessionApiService {
|
||||
|
||||
UserSessionCount countForUser();
|
||||
|
||||
String endVideoSession();
|
||||
|
||||
}
|
||||
|
||||
+4
@@ -2114,4 +2114,8 @@ public class ConSessionApiServiceImpl implements ConSessionApiService {
|
||||
return conSessionMapper.selectCount(wrapper).intValue();
|
||||
}
|
||||
|
||||
public String endVideoSession() {
|
||||
return conSessionMapper.endVideoSession();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+5
@@ -484,4 +484,9 @@ public class ConSessionController extends JeecgController<ConSession, IConSessio
|
||||
return conSessionService.exportXlsConSession(request, dto);
|
||||
}
|
||||
|
||||
@GetMapping("/getPicUrl")
|
||||
public Result<String> getPicUrl(){
|
||||
return Result.ok(conSessionService.getPicUrl());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+3
@@ -12,6 +12,7 @@ import org.apache.ibatis.annotations.Update;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @Description: con_doctor
|
||||
@@ -71,6 +72,8 @@ public interface ConDoctorMapper extends BaseMapper<ConDoctor> , MPJBaseMapper<C
|
||||
@Select("SELECT * FROM con_doctor WHERE status = '1' and del_flag = '0' and id = #{doctorId}")
|
||||
public ConDoctorDO selectDoctorInfoById(String doctorId);
|
||||
|
||||
public List<ConDoctorDO> selectDoctorInfoByIds(@Param("doctorIds") Set<String> doctorIds);
|
||||
|
||||
@Select("SELECT * FROM con_doctor WHERE status = '1' and del_flag = '0' and id = #{doctorId} and is_accept = '1'")
|
||||
public ConDoctorDO selectDoctorInfoByIdNew(String doctorId);
|
||||
|
||||
|
||||
+9
@@ -294,4 +294,13 @@ public interface ConSessionMapper extends BaseMapper<ConSession> , MPJBaseMapper
|
||||
@Param("doctorjob")String doctorjob,
|
||||
@Param("contentType")String contentType,
|
||||
@Param("toAccount")String toAccount);
|
||||
|
||||
/**
|
||||
* 音视频咨询过期处理:预约日期已过的视频咨询,有通话记录则改为待评价,无通话记录则改为取消
|
||||
* content_status: 4=待评价,6=取消
|
||||
*/
|
||||
@Update("UPDATE con_session SET content_status = CASE WHEN session_time IS NOT NULL THEN 4 ELSE 6 END " +
|
||||
"WHERE content_type = 2 AND CURDATE() > session_date " +
|
||||
"AND content_status NOT IN (4, 5, 6, 7, 8) AND del_flag = 0 AND status = 1")
|
||||
String endVideoSession();
|
||||
}
|
||||
|
||||
+14
@@ -532,4 +532,18 @@
|
||||
and id != #{doctorId}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectDoctorInfoByIds" resultType="com.renkang.consultation.entity.ConDoctorDO">
|
||||
SELECT * FROM con_doctor
|
||||
WHERE status = '1'
|
||||
AND del_flag = '0'
|
||||
<if test="doctorIds != null and doctorIds.size() > 0">
|
||||
AND id IN
|
||||
<foreach collection="doctorIds" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="doctorIds == null or doctorIds.size() == 0">
|
||||
AND 1=0
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
+2
@@ -85,5 +85,7 @@ public interface IConSessionService extends IService<ConSession> {
|
||||
Result<List<com.renkang.im.entity.ImMsgRecordAll>> selectImMessageList(String groupId);
|
||||
|
||||
Result<?> exportXlsConSession(HttpServletRequest request, ConSessionDTO dto);
|
||||
|
||||
String getPicUrl();
|
||||
}
|
||||
|
||||
|
||||
+24
-5
@@ -3,7 +3,6 @@ package com.renkang.consultation.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.http.HtmlUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
@@ -249,9 +248,6 @@ public class ConDoctorServiceImpl extends ServiceImpl<ConDoctorMapper, ConDoctor
|
||||
if (StringUtils.hasLength(dto.getHospitalName())) {
|
||||
conDoctor.setResourceId(dto.getHospitalName());
|
||||
}
|
||||
if (StrUtil.isNotEmpty(dto.getDoctorName())){
|
||||
conDoctor.setDoctorName(HtmlUtil.unescape(dto.getDoctorName()));
|
||||
}
|
||||
IPage<ConDoctor> conDoctorIPage = conDoctorMapper.queryPageList(page, conDoctor);
|
||||
List<ConDoctor> conDoctorList = conDoctorIPage.getRecords();
|
||||
if (CollectionUtils.isEmpty(conDoctorList)) {
|
||||
@@ -1108,6 +1104,29 @@ public class ConDoctorServiceImpl extends ServiceImpl<ConDoctorMapper, ConDoctor
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> getHospitalCountStatList() {
|
||||
return conDoctorMapper.getHospitalCountStatList();
|
||||
// 查询所有资源列表
|
||||
List<ConResource> resourceList = conResourceMapper.queryPageList(new Page<>(0, -1), new ConResource()).getRecords();
|
||||
|
||||
// 查询已有的医院统计数据列表
|
||||
List<Map<String, Object>> hospitalList = conDoctorMapper.getHospitalCountStatList();
|
||||
|
||||
// 提取医院名
|
||||
Set<String> existingHospitalNames = hospitalList.stream()
|
||||
.map(map -> (String) map.get("hospitalName"))
|
||||
.collect(Collectors.toSet());
|
||||
|
||||
// 补充数据
|
||||
for (ConResource resource : resourceList) {
|
||||
String resourceName = resource.getResourceName();
|
||||
if (!existingHospitalNames.contains(resourceName)) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("hospitalName", resourceName);
|
||||
map.put("consultImCount", 0);
|
||||
map.put("consultVedioCount", 0);
|
||||
hospitalList.add(map);
|
||||
}
|
||||
}
|
||||
|
||||
return hospitalList;
|
||||
}
|
||||
}
|
||||
|
||||
+106
-30
@@ -28,6 +28,7 @@ import com.renkang.im.entity.ImGroupMsgTextReqDO;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.jeecg.bean.request.ListUser;
|
||||
import org.jeecg.bean.response.BaseEmployeeInfo;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.constant.CommonConstant;
|
||||
import org.jeecg.common.system.api.ISysBaseAPI;
|
||||
@@ -51,6 +52,7 @@ import org.jeecgframework.poi.excel.entity.enmus.ExcelType;
|
||||
import org.jeecgframework.poi.exception.excel.enums.ExcelExportEnum;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.core.task.AsyncTaskExecutor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -767,44 +769,112 @@ public class ConSessionServiceImpl extends ServiceImpl<ConSessionMapper, ConSess
|
||||
}
|
||||
String imIds = String.join(",", list.getImIds());
|
||||
List<ConSession> conSessionDOList = conSessionMapper.companySessionList(imIds);
|
||||
if (CollUtil.isNotEmpty(conSessionDOList)) {
|
||||
Set<String> fromAccount = conSessionDOList.stream().map(ConSession::getFromAccount).collect(Collectors.toSet());
|
||||
Set<String> toAccount = conSessionDOList.stream().map(ConSession::getToAccount).collect(Collectors.toSet());
|
||||
Set<String> userIds = new HashSet<>(fromAccount);
|
||||
userIds.addAll(toAccount);
|
||||
List<BaseEmployeeInfo> baseUsers = sysBaseAPI.queryBaseEmployeeInfo(userIds);
|
||||
List<ConDoctorDO> doctors = conDoctorMapper.selectDoctorInfoByIds(userIds);
|
||||
List<DictModel> sexModels = dictUtil.queryDictItemListByCode("sex2");
|
||||
// 根据key转成map
|
||||
Map<String, DictModel> sexMap = sexModels.stream()
|
||||
.filter(model -> model != null && StrUtil.isNotBlank(model.getValue()))
|
||||
.collect(Collectors.toMap(DictModel::getValue, model -> model,
|
||||
(existing, replacement) -> existing));
|
||||
// 根据id转成map
|
||||
Map<String, BaseEmployeeInfo> userMap = baseUsers.stream()
|
||||
.filter(user -> user != null && StrUtil.isNotBlank(user.getUserId()))
|
||||
.collect(Collectors.toMap(BaseEmployeeInfo::getUserId, user -> user,
|
||||
(existing, replacement) -> existing));
|
||||
// 根据id转成map
|
||||
Map<String, ConDoctorDO> doctorMap = doctors.stream()
|
||||
.filter(doctor -> doctor != null && StrUtil.isNotBlank(doctor.getId()))
|
||||
.collect(Collectors.toMap(ConDoctorDO::getId, doctor -> doctor,
|
||||
(existing, replacement) -> existing));
|
||||
|
||||
for (ConSession conSessionDO : conSessionDOList) {
|
||||
LoginUser loginUser = sysBaseAPI.getUserById(conSessionDO.getFromAccount());
|
||||
if (loginUser != null) {
|
||||
conSessionDO.setToAccountName(loginUser.getRealname());
|
||||
conSessionDO.setToAccountHead(loginUser.getAvatar());
|
||||
String gen = dictUtil.queryDictItemListByCodeAndType("sex2", String.valueOf(loginUser.getSex()));
|
||||
conSessionDO.setMemberSex(gen);
|
||||
}
|
||||
|
||||
if (StrUtil.equals(conSessionDO.getSessionType(), "1")) {
|
||||
CompletableFuture<LoginUser> future = CompletableFuture.supplyAsync(() -> sysBaseAPI.getUserById(conSessionDO.getToAccount()));
|
||||
LoginUser toLoginUser = future.join();
|
||||
if(toLoginUser != null){
|
||||
conSessionDO.setFromAccountName(toLoginUser.getRealname());
|
||||
for (ConSession conSessionDO : conSessionDOList) {
|
||||
// 根据原接口取值默认fromAccount
|
||||
BaseEmployeeInfo user = userMap.get(conSessionDO.getFromAccount());
|
||||
if (null != user) {
|
||||
conSessionDO.setToAccountName(user.getRealName());
|
||||
conSessionDO.setToAccountHead(user.getAvatar());
|
||||
conSessionDO.setOrgCode(user.getSecondDeptName() + "-" + user.getThirdDeptName());
|
||||
if (null != user.getSex()){
|
||||
DictModel dictModel = sexMap.get(user.getSex().toString());
|
||||
if (null != dictModel) {
|
||||
conSessionDO.setMemberSex(dictModel.getText());
|
||||
}
|
||||
}
|
||||
}
|
||||
ConDoctorDO conDoctorDO = conDoctorMapper.selectDoctorInfoById(conSessionDO.getToAccount());
|
||||
conSessionDO.setDoctorInfo(conDoctorDO);
|
||||
}
|
||||
if (StrUtil.equals(conSessionDO.getSessionType(), "3")) {
|
||||
CompletableFuture<LoginUser> future = CompletableFuture.supplyAsync(() -> sysBaseAPI.getUserById(conSessionDO.getFromAccount()));
|
||||
LoginUser toLoginUser = future.join();
|
||||
if (toLoginUser != null) {
|
||||
conSessionDO.setFromAccountName(toLoginUser.getRealname());
|
||||
}
|
||||
ConDoctorDO conDoctorDO = conDoctorMapper.selectDoctorInfoById(conSessionDO.getFromAccount());
|
||||
conSessionDO.setDoctorInfo(conDoctorDO);
|
||||
}
|
||||
SysDepart secondDepartOrgCode = sysCache.getDepartByOrgCode(GlobalUtils.getSecondDepartOrgCode(conSessionDO.getOrgCode()));
|
||||
SysDepart thridDepartOrgCode = sysCache.getDepartByOrgCode(GlobalUtils.getThirdDepartOrgCode(conSessionDO.getOrgCode()));
|
||||
|
||||
if (secondDepartOrgCode != null && thridDepartOrgCode != null) {
|
||||
conSessionDO.setOrgCode(secondDepartOrgCode.getDepartName() + "-" + thridDepartOrgCode.getDepartName());
|
||||
if (StrUtil.equals(conSessionDO.getSessionType(), "1")) {
|
||||
BaseEmployeeInfo toUser = userMap.get(conSessionDO.getToAccount());
|
||||
if (toUser != null) {
|
||||
conSessionDO.setFromAccountName(toUser.getRealName());
|
||||
}
|
||||
ConDoctorDO conDoctorDO = doctorMap.get(conSessionDO.getToAccount());
|
||||
conSessionDO.setDoctorInfo(conDoctorDO);
|
||||
}
|
||||
|
||||
if (StrUtil.equals(conSessionDO.getSessionType(), "3")) {
|
||||
BaseEmployeeInfo formUser = userMap.get(conSessionDO.getFromAccount());
|
||||
if (formUser != null) {
|
||||
conSessionDO.setFromAccountName(formUser.getRealName());
|
||||
}
|
||||
ConDoctorDO conDoctorDO = doctorMap.get(conSessionDO.getFromAccount());
|
||||
conSessionDO.setDoctorInfo(conDoctorDO);
|
||||
}
|
||||
}
|
||||
}
|
||||
return conSessionDOList;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public List<ConSession> companySessionList(ListImIds list) {
|
||||
// if (ObjectUtil.isNull(list) || CollectionUtil.isEmpty(list.getImIds())) {
|
||||
// return Collections.emptyList();
|
||||
// }
|
||||
// String imIds = String.join(",", list.getImIds());
|
||||
// List<ConSession> conSessionDOList = conSessionMapper.companySessionList(imIds);
|
||||
//
|
||||
// for (ConSession conSessionDO : conSessionDOList) {
|
||||
// LoginUser loginUser = sysBaseAPI.getUserById(conSessionDO.getFromAccount());
|
||||
// if (loginUser != null) {
|
||||
// conSessionDO.setToAccountName(loginUser.getRealname());
|
||||
// conSessionDO.setToAccountHead(loginUser.getAvatar());
|
||||
// String gen = dictUtil.queryDictItemListByCodeAndType("sex2", String.valueOf(loginUser.getSex()));
|
||||
// conSessionDO.setMemberSex(gen);
|
||||
// }
|
||||
//
|
||||
// if (StrUtil.equals(conSessionDO.getSessionType(), "1")) {
|
||||
// CompletableFuture<LoginUser> future = CompletableFuture.supplyAsync(() -> sysBaseAPI.getUserById(conSessionDO.getToAccount()));
|
||||
// LoginUser toLoginUser = future.join();
|
||||
// if(toLoginUser != null){
|
||||
// conSessionDO.setFromAccountName(toLoginUser.getRealname());
|
||||
// }
|
||||
// ConDoctorDO conDoctorDO = conDoctorMapper.selectDoctorInfoById(conSessionDO.getToAccount());
|
||||
// conSessionDO.setDoctorInfo(conDoctorDO);
|
||||
// }
|
||||
// if (StrUtil.equals(conSessionDO.getSessionType(), "3")) {
|
||||
// CompletableFuture<LoginUser> future = CompletableFuture.supplyAsync(() -> sysBaseAPI.getUserById(conSessionDO.getFromAccount()));
|
||||
// LoginUser toLoginUser = future.join();
|
||||
// if (toLoginUser != null) {
|
||||
// conSessionDO.setFromAccountName(toLoginUser.getRealname());
|
||||
// }
|
||||
// ConDoctorDO conDoctorDO = conDoctorMapper.selectDoctorInfoById(conSessionDO.getFromAccount());
|
||||
// conSessionDO.setDoctorInfo(conDoctorDO);
|
||||
// }
|
||||
// SysDepart secondDepartOrgCode = sysCache.getDepartByOrgCode(GlobalUtils.getSecondDepartOrgCode(conSessionDO.getOrgCode()));
|
||||
// SysDepart thridDepartOrgCode = sysCache.getDepartByOrgCode(GlobalUtils.getThirdDepartOrgCode(conSessionDO.getOrgCode()));
|
||||
//
|
||||
// if (secondDepartOrgCode != null && thridDepartOrgCode != null) {
|
||||
// conSessionDO.setOrgCode(secondDepartOrgCode.getDepartName() + "-" + thridDepartOrgCode.getDepartName());
|
||||
// }
|
||||
// }
|
||||
// return conSessionDOList;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public List<ConSession> professorSessionList(ListImIds list) {
|
||||
if (ObjectUtil.isNull(list) || CollectionUtil.isEmpty(list.getImIds())) {
|
||||
@@ -1195,5 +1265,11 @@ public class ConSessionServiceImpl extends ServiceImpl<ConSessionMapper, ConSess
|
||||
return sendTime;
|
||||
}
|
||||
|
||||
@Value("${banner.picUrl:}")
|
||||
private String bannerPicUrl;
|
||||
public String getPicUrl(){
|
||||
// 读取配置文件的url
|
||||
return bannerPicUrl;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+11
-2
@@ -7,6 +7,7 @@ import com.xxl.job.core.biz.model.ReturnT;
|
||||
import com.xxl.job.core.context.XxlJobHelper;
|
||||
import com.xxl.job.core.handler.annotation.XxlJob;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.constant.CommonConstant;
|
||||
import org.jeecg.config.shiro.ClientSignThreadLocal;
|
||||
import org.parboiled.common.StringUtils;
|
||||
@@ -36,10 +37,10 @@ public class SyncScheduleJob {
|
||||
String expireHour = "168";
|
||||
|
||||
String param = XxlJobHelper.getJobParam();
|
||||
if(StringUtils.isNotEmpty(param)){
|
||||
if (StringUtils.isNotEmpty(param)) {
|
||||
JSONObject jsonObject = JSONObject.parseObject(param);
|
||||
String expireHourRequest = jsonObject.getString("expireHour");
|
||||
if(StringUtils.isNotEmpty(expireHourRequest)){
|
||||
if (StringUtils.isNotEmpty(expireHourRequest)) {
|
||||
expireHour = jsonObject.getString("expireHour");
|
||||
}
|
||||
}
|
||||
@@ -53,4 +54,12 @@ public class SyncScheduleJob {
|
||||
return ReturnT.SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
@XxlJob(value = "endVideoSession")
|
||||
public Result<String> endVideoSession() {
|
||||
// 20260327 新增 音视频咨询过期处理 规则为:超过预约时间,比如预约的是 12月9日和专家视频沟通,但超过时间一天,即为过期,需要关闭咨询
|
||||
conSessionApiController.endVideoSession();
|
||||
return Result.ok("success");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+5
@@ -88,6 +88,11 @@ public class Order implements Serializable {
|
||||
@Excel(name = "是否正在会话(0:否 1:是)", width = 15)
|
||||
@Schema(title = "是否正在会话(0:否 1:是)")
|
||||
private java.lang.Boolean sessionNow;
|
||||
/**
|
||||
* 是否解散群聊(0:否 1:是)
|
||||
*/
|
||||
@Schema(title = "是否解散群聊(0:否 1:是)")
|
||||
private java.lang.Boolean destroyGroup;
|
||||
/**
|
||||
* 发起人id
|
||||
*/
|
||||
|
||||
+72
@@ -0,0 +1,72 @@
|
||||
package com.renkang.emergency.entity;
|
||||
|
||||
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.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@TableName("emergency_screen_animation")
|
||||
@Schema(title = "应急大屏开屏动画", description = "应急大屏开屏动画")
|
||||
public class ScreenAnimation implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(title = "主键")
|
||||
private String id;
|
||||
/**
|
||||
* 动画名称
|
||||
*/
|
||||
@Schema(title = "动画名称")
|
||||
private String title;
|
||||
/**
|
||||
* 动画地址
|
||||
*/
|
||||
@Schema(title = "动画地址")
|
||||
private String videoUrl;
|
||||
/**
|
||||
* 简介 (目前没有启用该字段 20260105用此字段存储封面图)
|
||||
*/
|
||||
@Schema(title = "简介")
|
||||
private String description;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@Schema(title = "创建人")
|
||||
private String createBy;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Schema(title = "创建时间")
|
||||
private Date createTime;
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
@Schema(title = "更新人")
|
||||
private String updateBy;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Schema(title = "更新时间")
|
||||
private Date updateTime;
|
||||
/**
|
||||
* 删除状态(0-正常,1-已删除)
|
||||
*/
|
||||
@Schema(title = "删除状态(0-正常,1-已删除)")
|
||||
@TableLogic
|
||||
private Integer delFlag;
|
||||
}
|
||||
+15
@@ -36,6 +36,17 @@ public class TblBaseHospitalVo {
|
||||
private String expertNum;
|
||||
private String distance;
|
||||
|
||||
@Schema(title = "单位code")
|
||||
private String departCode;
|
||||
|
||||
@Schema(title = "单位名称")
|
||||
private String orgName;
|
||||
|
||||
//部门名称 ,目前仅aed数据是将单位名称和部门名称分开显示的
|
||||
@Schema(title = "部门名称")
|
||||
private String deptName;
|
||||
|
||||
|
||||
public TblBaseHospitalVo() {}
|
||||
|
||||
public TblBaseHospitalVo(Resource resource){
|
||||
@@ -45,6 +56,7 @@ public class TblBaseHospitalVo {
|
||||
this.lon = resource.getLongitude();
|
||||
this.type = resource.getType();
|
||||
this.address = resource.getAddress();
|
||||
this.managePhone = resource.getMobile();
|
||||
}
|
||||
|
||||
public TblBaseHospitalVo(AedEquipmentManger aed){
|
||||
@@ -53,6 +65,9 @@ public class TblBaseHospitalVo {
|
||||
this.lat = aed.getLatitude();
|
||||
this.lon = aed.getLongitude();
|
||||
this.type = "4";
|
||||
this.departCode = aed.getDepartCode();
|
||||
this.address = aed.getInstallAddress();
|
||||
this.manageName = aed.getManageUserName();
|
||||
this.managePhone = aed.getManageUserMobile();
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user