新疆后端项目

This commit is contained in:
DESKTOP-BLB5287\FP
2025-06-30 14:31:09 +08:00
commit 0e52aff1f1
2596 changed files with 261030 additions and 0 deletions
+78
View File
@@ -0,0 +1,78 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
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>
<groupId>com.renkang</groupId>
<artifactId>health-watch</artifactId>
<version>2.0.0</version>
</parent>
<artifactId>health-watch-biz</artifactId>
<dependencies>
<dependency>
<groupId>com.renkang</groupId>
<artifactId>health-watch-api</artifactId>
</dependency>
<dependency>
<groupId>com.renkang</groupId>
<artifactId>health-emergency-api</artifactId>
</dependency>
<dependency>
<groupId>org.jeecgframework.boot</groupId>
<artifactId>jeecg-system-cloud-api</artifactId>
</dependency>
<dependency>
<groupId>com.renkang</groupId>
<artifactId>renkang-starter-batch</artifactId>
</dependency>
<dependency>
<groupId>com.renkang</groupId>
<artifactId>data-center-api</artifactId>
</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.alibaba</groupId>
<artifactId>easyexcel</artifactId>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
</dependency>
<dependency>
<groupId>com.renkang</groupId>
<artifactId>font-resources</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>
@@ -0,0 +1,16 @@
package com.renkang.watch.api;
/**
* @author Junqiang Zhu
* @date 2023-05-25 09:06
*/
public interface RequestPrefix {
String BASE = "/api/watch";
String SCREEN = BASE + "/screen";
String TASK = BASE + "/task";
String WATCH_DATA = "/api/watchData";
}
@@ -0,0 +1,32 @@
package com.renkang.watch.api.bean.request;
import io.swagger.v3.oas.annotations.Hidden;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.util.Date;
import java.util.List;
/**
* @author Jiang Shunzhi
*/
@Data
@Schema(title = "按月日统计参数对象")
public class MonitorMonthStatsRequest {
@Schema(title = "年份", requiredMode = Schema.RequiredMode.REQUIRED)
private Integer year;
@Schema(title = "月份", requiredMode = Schema.RequiredMode.REQUIRED)
private Integer month;
@Schema(title = "组织机构数组", requiredMode = Schema.RequiredMode.REQUIRED)
private String orgCodeList;
@Hidden
private List<String> orgCodes;
@Hidden
private Date monthDate;
}
@@ -0,0 +1,27 @@
package com.renkang.watch.api.bean.response;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
/**
* @author Jiang Shunzhi
*/
@Data
public class MonitorDayStats {
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date date;
private Integer year;
private Integer month;
private Integer day;
private Integer count;
}
@@ -0,0 +1,17 @@
package com.renkang.watch.api.bean.response;
import lombok.Data;
/**
* @author Jiang Shunzhi
*/
@Data
public class MonitorTotalStats {
private Integer dayCount;
private Integer weekCount;
private Integer monthCount;
}
@@ -0,0 +1,32 @@
package com.renkang.watch.api.bean.response;
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.util.Date;
@Data
@Schema(title = "用户手表信息",description = "用户手表信息")
public class UserWatchInfo {
@Schema(title = "是否拥有手表")
private boolean hasWatch;
@Schema(title = "手表编码")
private String watchNo;
@Schema(title = "手表型号")
private String watchModel = "HUAWEI H7-546";
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@Schema(title = "绑定日期")
private Date bindDate;
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@Schema(title = "最后上传数据的日期")
private Date lastUploadDate;
}
@@ -0,0 +1,44 @@
package com.renkang.watch.api.controller;
import cn.hutool.core.util.StrUtil;
import com.renkang.watch.api.RequestPrefix;
import com.renkang.watch.api.bean.request.MonitorMonthStatsRequest;
import com.renkang.watch.api.bean.response.MonitorDayStats;
import com.renkang.watch.api.bean.response.MonitorTotalStats;
import com.renkang.watch.api.service.MonitorApiService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import org.jeecg.common.api.vo.Result;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* @author Jiang Shunzhi
*/
@RestController
@AllArgsConstructor
@RequestMapping(RequestPrefix.SCREEN)
@Tag(name = "手表/大屏")
public class ScreenDataController {
private final MonitorApiService monitorApiService;
@Operation(summary = "日周月统计", description = "日周月统计")
@GetMapping("/monitor/stats/total")
public Result<MonitorTotalStats> monitorTotalStats(@Parameter(name = "组织机构数组", description = "组织机构数组,英文逗号隔开", required = true) String orgCodeList) {
List<String> orgCodes = StrUtil.split(orgCodeList, ",", true, true);
return Result.ok(monitorApiService.screenTotalStats(orgCodes));
}
@Operation(summary = "按月日统计", description = "按月日统计")
@GetMapping("/monitor/stats/month")
public Result<List<MonitorDayStats>> totalStats(MonitorMonthStatsRequest request) {
return Result.ok(monitorApiService.screenMonthStats(request));
}
}
@@ -0,0 +1,31 @@
package com.renkang.watch.api.controller;
import com.renkang.watch.api.RequestPrefix;
import com.renkang.watch.task.DepartSyncTask;
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.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @author Jiang Shunzhi
*/
@RestController
@RequestMapping(RequestPrefix.TASK)
@Tag(name = "手表/任务")
public class TaskController {
@Autowired
private DepartSyncTask departSyncTask;
@Operation(summary = "同步手表库用户部门数据")
@PostMapping("/sync/data/depart")
public Result<Boolean> syncDepartData() {
departSyncTask.execute();
return Result.ok(true);
}
}
@@ -0,0 +1,201 @@
package com.renkang.watch.api.controller;
import com.renkang.watch.api.RequestPrefix;
import com.renkang.watch.api.bean.response.UserWatchInfo;
import com.renkang.watch.api.service.WatchDataApiService;
import com.renkang.watch.dto.WatchDataWorkoutDTO;
import com.renkang.watch.entity.WatchDataUnion;
import com.renkang.watch.vo.UserData.res.UserStat;
import com.renkang.watch.vo.UserData.res.bloodOxygen.BloodOxygenStat;
import com.renkang.watch.vo.UserData.res.bodyTemperature.BodyTempStat;
import com.renkang.watch.vo.UserData.res.heartRate.WatchDataHeartRateRes;
import com.renkang.watch.vo.UserData.res.sleep.WatchDataSleepRes;
import io.swagger.v3.oas.annotations.Operation;
import org.jeecg.common.api.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.Date;
import java.util.Map;
@RestController
@RequestMapping(RequestPrefix.WATCH_DATA)
public class WatchDataApiController {
@Autowired
private WatchDataApiService watchDataApiService;
/**
* 用户手表数据
*
* @param type 0:心率 1:血氧 2:压力 3:体温 4:睡眠
* @return data
*/
@GetMapping("userWatchData")
public Result<UserStat> userStatResult(@RequestParam String type) {
return Result.ok(watchDataApiService.userStatResult(type));
}
/**
* 用户此刻是否拥有手表
*
* @return data
*/
@GetMapping("haveWatch")
public Result<Boolean> haveWatch(@RequestParam(required = false) String userId) {
return Result.ok(watchDataApiService.userHaveWatch(userId));
}
/**
* 查询用户手表信息
*
* @return data
*/
@GetMapping("findWatchInfo")
@Operation(summary = "查询用户手表信息", description = "查询用户手表信息")
public Result<UserWatchInfo> findWatchInfo(@RequestParam(required = false) String userId) {
return Result.ok(watchDataApiService.findWatchInfo(userId));
}
/**
* 实时运动 首页
* @return
*/
@Operation(summary = "实时运动", description = "实时运动")
@GetMapping(value = "/selectSportTimingApi")
public Result<Map<String,Object>> selectSportTimingApi(){
return watchDataApiService.selectSportCostListApi();
}
/**
* 分时运动 首页
* @param startTime
* @param endTime
* @return
*/
@GetMapping(value = "/selectSportCostTotalApi")
public Result<WatchDataWorkoutDTO> selectSportCostTotalApi(@RequestParam(required = false) @DateTimeFormat(pattern = "yyyy-MM-dd") Date startTime,
@RequestParam(required = false) @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime){
return watchDataApiService.selectSportCostTotalApi(startTime,endTime);
}
/**
* 分时运动新的
* @param startTime
* @param endTime
* @return
*/
@GetMapping(value = "/selectSportCostTotalApiNew")
public Result<Map<String,Object>> selectSportCostTotalApiNew(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date startTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime){
return watchDataApiService.selectSportCostTotalApiNew(startTime,endTime);
}
/**
* 心率
* @return
*/
@GetMapping(value = "/queryHeartRateStatisticsDataApi")
public Result<WatchDataHeartRateRes> queryHeartRateStatisticsDataApi() {
return watchDataApiService.queryHeartRateStatisticsDataApi();
}
/**
* 血氧
* @return
*/
@GetMapping(value = "/queryBloodOxygenStatisticsDataApi")
public Result<BloodOxygenStat> queryBloodOxygenStatisticsDataApi() {
return watchDataApiService.queryBloodOxygenStatisticsDataApi();
}
/**
* 睡眠
* @return
*/
@GetMapping(value = "/querySleepStatisticsDataApi")
public Result<WatchDataSleepRes> querySleepStatisticsDataApi() {
return watchDataApiService.querySleepStatisticsDataApi();
}
/**
* 温度
* @return
*/
@GetMapping(value = "/queryBodyTemperatureStatDataApi")
public Result<BodyTempStat> queryBodyTemperatureStatDataApi() {
return watchDataApiService.queryBodyTemperatureStatDataApi();
}
@GetMapping(value = "/selectMyocardialInfarction")
public WatchDataUnion selectMyocardialInfarction(@RequestParam(name = "userId") String userId,
@RequestParam(name = "dateTime") @DateTimeFormat(pattern = "yyyy-MM-dd") Date dateTime){
return watchDataApiService.selectMyocardialInfarction(userId,dateTime);
}
/**
* 心率 新的
* @return
*/
@GetMapping(value = "/queryHeartRateStatisticsDataApiNew")
public Result<WatchDataHeartRateRes> queryHeartRateStatisticsDataApiNew() {
return watchDataApiService.queryHeartRateStatisticsDataApiNew();
}
/**
* 血氧 新的
* @return
*/
@GetMapping(value = "/queryBloodOxygenStatisticsDataApiNew")
public Result<BloodOxygenStat> queryBloodOxygenStatisticsDataApiNew() {
return watchDataApiService.queryBloodOxygenStatisticsDataApiNew();
}
/**
* 睡眠 新的
* @return
*/
@GetMapping(value = "/querySleepStatisticsDataApiNew")
public Result<WatchDataSleepRes> querySleepStatisticsDataApiNew() {
return watchDataApiService.querySleepStatisticsDataApiNew();
}
/**
* 体温 新的
* @return
*/
@GetMapping(value = "/queryBodyTemperatureStatDataApiNew")
public Result<BodyTempStat> queryBodyTemperatureStatDataApiNew() {
return watchDataApiService.queryBodyTemperatureStatDataApiNew();
}
@Operation(summary = "实时运动", description = "实时运动")
@GetMapping(value = "/selectSportTimingApiNew")
public Result<Map<String,Object>> selectSportTimingApiNew(){
return watchDataApiService.selectSportTimingApiNew();
}
}
@@ -0,0 +1,18 @@
package com.renkang.watch.api.service;
import com.renkang.watch.api.bean.request.MonitorMonthStatsRequest;
import com.renkang.watch.api.bean.response.MonitorDayStats;
import com.renkang.watch.api.bean.response.MonitorTotalStats;
import java.util.List;
/**
* @author Jiang Shunzhi
*/
public interface MonitorApiService {
MonitorTotalStats screenTotalStats(List<String> orgCodes);
List<MonitorDayStats> screenMonthStats(MonitorMonthStatsRequest request);
}
@@ -0,0 +1,49 @@
package com.renkang.watch.api.service;
import com.renkang.watch.api.bean.response.UserWatchInfo;
import com.renkang.watch.dto.WatchDataWorkoutDTO;
import com.renkang.watch.entity.WatchDataUnion;
import com.renkang.watch.vo.UserData.res.UserStat;
import com.renkang.watch.vo.UserData.res.bloodOxygen.BloodOxygenStat;
import com.renkang.watch.vo.UserData.res.bodyTemperature.BodyTempStat;
import com.renkang.watch.vo.UserData.res.heartRate.WatchDataHeartRateRes;
import com.renkang.watch.vo.UserData.res.sleep.WatchDataSleepRes;
import org.jeecg.common.api.vo.Result;
import java.util.Date;
import java.util.Map;
public interface WatchDataApiService {
Result<Map<String,Object>> selectSportCostListApi();
Result<WatchDataWorkoutDTO> selectSportCostTotalApi(Date startTime,Date endTime);
Result<WatchDataHeartRateRes> queryHeartRateStatisticsDataApi();
Result<BloodOxygenStat> queryBloodOxygenStatisticsDataApi();
Result<WatchDataSleepRes> querySleepStatisticsDataApi();
Result<BodyTempStat> queryBodyTemperatureStatDataApi();
Result<Map<String, Object>> selectSportCostTotalApiNew(Date startTime, Date endTime);
WatchDataUnion selectMyocardialInfarction(String userId, Date dateTime);
Result<WatchDataHeartRateRes> queryHeartRateStatisticsDataApiNew();
Result<BloodOxygenStat> queryBloodOxygenStatisticsDataApiNew();
Result<WatchDataSleepRes> querySleepStatisticsDataApiNew();
Result<BodyTempStat> queryBodyTemperatureStatDataApiNew();
Result<Map<String, Object>> selectSportTimingApiNew();
UserStat userStatResult(String type);
Boolean userHaveWatch(String userId);
UserWatchInfo findWatchInfo(String userId);
}
@@ -0,0 +1,74 @@
package com.renkang.watch.api.service.impl;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjUtil;
import cn.hutool.core.util.StrUtil;
import com.renkang.watch.api.bean.request.MonitorMonthStatsRequest;
import com.renkang.watch.api.bean.response.MonitorDayStats;
import com.renkang.watch.api.bean.response.MonitorTotalStats;
import com.renkang.watch.api.service.MonitorApiService;
import com.renkang.watch.mapper.WatchMonitorDataMapper;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
* @author Jiang Shunzhi
*/
@Service
@AllArgsConstructor
public class MonitorApiServiceImpl implements MonitorApiService {
private final WatchMonitorDataMapper monitorDataMapper;
@Override
public MonitorTotalStats screenTotalStats(List<String> orgCodes) {
return monitorDataMapper.monitorTotalStats(orgCodes);
}
@Override
public List<MonitorDayStats> screenMonthStats(MonitorMonthStatsRequest request) {
Map<Integer, Date> dayMap = getDays(request);
List<String> orgCodes = StrUtil.split(request.getOrgCodeList(), ",", true, true);
request.setOrgCodes(orgCodes);
request.setMonthDate(dayMap.get(1));
List<MonitorDayStats> monitorDayStats = monitorDataMapper.monitorDayStats(request);
Map<Integer, MonitorDayStats> dataMap = monitorDayStats.stream().collect(Collectors.toMap(MonitorDayStats::getDay, Function.identity()));
return dayMap.entrySet()
.stream()
.map(entry -> {
MonitorDayStats dayData = dataMap.getOrDefault(entry.getKey(), new MonitorDayStats());
if (ObjUtil.isNull(dayData.getCount())) {
Date date = entry.getValue();
dayData.setDate(date);
dayData.setYear(DateUtil.year(date));
dayData.setMonth(DateUtil.month(date) + 1);
dayData.setDay(DateUtil.dayOfMonth(date));
dayData.setCount(0);
}
return dayData;
})
.collect(Collectors.toList());
}
private Map<Integer, Date> getDays(MonitorMonthStatsRequest request) {
Map<Integer, Date> days = new HashMap<>(32);
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.YEAR, request.getYear());
calendar.set(Calendar.MONTH, request.getMonth() - 1);
calendar.set(Calendar.DAY_OF_MONTH, 1);
for (int i = 1; i < 32; i++) {
if (request.getMonth() - 1 != calendar.get(Calendar.MONTH)) {
break;
}
days.put(i, DateUtil.date(calendar));
calendar.add(Calendar.DAY_OF_YEAR, 1);
}
return days;
}
}
@@ -0,0 +1,53 @@
package com.renkang.watch.archives.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.renkang.watch.dto.ArchivesBodyTypeAnalysisDTO;
import com.renkang.watch.entity.ArchivesBodyType;
import com.renkang.watch.service.IArchivesBodyTypeService;
import com.renkang.watch.vo.ArchivesBodyTypeVO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.jeecg.bean.enums.UserDataSourceEnum;
import org.jeecg.common.api.vo.Result;
import org.jeecg.global.GlobalUtils;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.*;
import java.util.Date;
import java.util.List;
@Tag(name = "档案/基本体格")
@RestController
@RequestMapping("/archives/bodyType")
@RequiredArgsConstructor
public class ArchivesBodyTypeController {
private final IArchivesBodyTypeService archivesBodyTypeService;
@GetMapping("select")
@Operation(summary = "查询心率体温数据", description = "查询心率体温数据")
public Result<List<ArchivesBodyType>> selectData(String userId) {
return Result.OK(archivesBodyTypeService.selectData(userId));
}
@PostMapping("add")
@Operation(summary = "新增心率体温数据", description = "新增心率体温数据")
public Result<Boolean> addData(ArchivesBodyType archivesBodyType) {
archivesBodyType.setDataSource(Integer.valueOf(UserDataSourceEnum.ADMIN_MANUAL.source));
return Result.OK(archivesBodyTypeService.save(archivesBodyType));
}
@PostMapping("analysis/list")
@Operation(summary = "分析心率体温列表数据", description = "分析心率体温列表数据")
public Result<IPage<ArchivesBodyType>> analysisListData(ArchivesBodyTypeAnalysisDTO dto) {
return Result.OK(archivesBodyTypeService.analysisListData(dto));
}
@PostMapping("analysis/line")
@Operation(summary = "分析心率体温折线图数据", description = "分析心率体温折线图数据")
public Result<ArchivesBodyTypeVO> analysisLineData(ArchivesBodyTypeAnalysisDTO dto) {
return Result.OK(archivesBodyTypeService.analysisLineData(dto));
}
}
@@ -0,0 +1,42 @@
package com.renkang.watch.archives.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.renkang.watch.archives.model.dto.ArchivesExercisePageParam;
import com.renkang.watch.archives.model.dto.DevicePageParam;
import com.renkang.watch.archives.model.dto.DeviceResult;
import com.renkang.watch.archives.model.vo.DeviceDataMap;
import com.renkang.watch.archives.service.ArchivesExerciseService;
import com.renkang.watch.archives.service.ArchivesWatchService;
import com.renkang.watch.entity.WatchDataWorkout;
import com.renkang.watch.entity.WatchStatUserInfoDaySdc;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.jeecg.common.api.vo.Result;
import org.jeecg.config.mybatis.bean.BeanDictInfo;
import org.jeecg.config.mybatis.bean.TableInfo;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@Tag(name = "档案/档案维护/运动情况")
@RestController
@RequestMapping("/archives/exercise")
@RequiredArgsConstructor
public class ArchivesExerciseController {
private final ArchivesExerciseService exerciseService;
@GetMapping("sdc/page")
@Operation(summary = "步数列表数据", description = "步数列表数据")
public Result<IPage<WatchStatUserInfoDaySdc>> exerciseSdcDataPage(ArchivesExercisePageParam pageParam) {
return Result.OK(exerciseService.exerciseSdcDataPage(pageParam));
}
@GetMapping("workout/page")
@Operation(summary = "锻炼列表数据", description = "锻炼列表数据")
public Result<IPage<WatchDataWorkout>> exerciseWorkoutDataPage(ArchivesExercisePageParam pageParam) {
return Result.OK(exerciseService.exerciseWorkoutDataPage(pageParam));
}
}
@@ -0,0 +1,30 @@
package com.renkang.watch.archives.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.renkang.watch.archives.model.dto.ArchivesExercisePageParam;
import com.renkang.watch.archives.model.dto.ArchivesSleepPageParam;
import com.renkang.watch.archives.service.ArchivesExerciseService;
import com.renkang.watch.archives.service.ArchivesSleepService;
import com.renkang.watch.entity.WatchDataWorkout;
import com.renkang.watch.entity.WatchStatUserInfoDaySdc;
import com.renkang.watch.vo.UserData.res.sleep.WatchDataSleepPageRes;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.jeecg.common.api.vo.Result;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@Tag(name = "档案/档案维护/睡眠情况")
@RestController
@RequestMapping("/archives/sleep")
@RequiredArgsConstructor
public class ArchivesSleepController {
private final ArchivesSleepService sleepService;
@GetMapping("watch/page")
@Operation(summary = "手表睡眠列表数据", description = "手表睡眠列表数据")
public Result<IPage<WatchDataSleepPageRes>> watchDataPage(ArchivesSleepPageParam pageParam) {
return Result.OK(sleepService.watchDataPage(pageParam));
}
}
@@ -0,0 +1,54 @@
package com.renkang.watch.archives.controller;
import com.renkang.watch.archives.model.dto.DevicePageParam;
import com.renkang.watch.archives.model.dto.DeviceResult;
import com.renkang.watch.archives.model.vo.DeviceDataMap;
import com.renkang.watch.archives.service.ArchivesWatchService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.jeecg.common.api.vo.Result;
import org.jeecg.config.mybatis.bean.BeanDictInfo;
import org.jeecg.config.mybatis.bean.TableInfo;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@Tag(name = "档案/穿戴数据")
@RestController
@RequestMapping("/archives/watch")
@RequiredArgsConstructor
public class ArchivesWatchController {
private final ArchivesWatchService archivesWatchService;
@GetMapping("device/page")
@Operation(summary = "设备列表数据", description = "设备列表数据")
public DeviceResult<List<DeviceDataMap>> deviceDataPage(DevicePageParam pageParam) {
return archivesWatchService.deviceDataPage(pageParam);
}
/**
* 库结构
*
* @return 结构体
*/
@Operation(summary = "库结构数据", description = "库结构数据")
@GetMapping("tableStructure")
public Result<TableInfo> tableStructure() {
return Result.ok(archivesWatchService.tableStructure());
}
/**
* 列表字典数据
*
* @return map
*/
@GetMapping("dict")
@Operation(summary = "数据字典数据", description = "数据字典数据")
public Result<BeanDictInfo> dict() {
return Result.ok(archivesWatchService.dict());
}
}
@@ -0,0 +1,29 @@
package com.renkang.watch.archives.model.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.renkang.watch.entity.WatchDataWorkout;
import com.renkang.watch.entity.WatchStatUserInfoDaySdc;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.jeecg.base.PageInfo;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
import java.util.List;
@Data
@EqualsAndHashCode(callSuper = true)
public class ArchivesExercisePageParam extends PageInfo<WatchStatUserInfoDaySdc> {
private String userId;
@Schema(description = "开始时间")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date startTime;
@Schema(description = "结束时间")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date endTime;
}
@@ -0,0 +1,28 @@
package com.renkang.watch.archives.model.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.renkang.watch.entity.WatchStatUserInfoDaySdc;
import com.renkang.watch.vo.UserData.res.sleep.WatchDataSleepPageRes;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.jeecg.base.PageInfo;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
@Data
@EqualsAndHashCode(callSuper = true)
public class ArchivesSleepPageParam extends PageInfo<WatchDataSleepPageRes> {
private String userId;
@Schema(description = "开始时间")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date startTime;
@Schema(description = "结束时间")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date endTime;
}
@@ -0,0 +1,37 @@
package com.renkang.watch.archives.model.dto;
import com.renkang.watch.entity.WatchStatUserInfoDaySpo2;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.jeecg.base.PageInfo;
import java.util.List;
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(title = "血氧列表参数", description = "血氧列表参数")
public class BloodOxygenPageParam extends PageInfo<WatchStatUserInfoDaySpo2> {
@Schema(description = "单位 or 部门")
private String orgCode;
@Schema(description = "姓名")
private String realName;
@Schema(description = "员工编号")
private String workNo;
@Schema(description = "性别")
private Integer sex;
@Schema(description = "年龄")
private Integer age;
@Schema(description = "年龄范围参数b (当选择范围时使用)")
private Integer ageB;
@Schema(description = "年龄范围条件:'>', '<', '>=', '<=', '<>', '=', '!='")
private String ageCondition;
private List<String> bindUserIds;
}
@@ -0,0 +1,29 @@
package com.renkang.watch.archives.model.dto;
import com.renkang.watch.entity.WatchDevice;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.jeecg.base.PageInfo;
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(title = "设备列表参数", description = "设备列表参数")
public class DevicePageParam extends PageInfo<WatchDevice> {
@Schema(description = "单位 or 部门")
private String orgCode;
@Schema(description = "工具编码")
private String watchNo;
@Schema(description = "姓名")
private String realName;
@Schema(description = "绑定状态")
private String bindStatus;
@Schema(description = "员工编号")
private String workNo;
}
@@ -0,0 +1,60 @@
package com.renkang.watch.archives.model.dto;
import com.renkang.watch.archives.model.vo.DeviceDataInfo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.constant.CommonConstant;
import java.util.List;
@Data
public class DeviceResult<T> {
/**
* 成功标志
*/
@Schema(title = "成功标志")
private boolean success = true;
/**
* 返回处理消息
*/
@Schema(title = "返回处理消息")
private String message = "";
/**
* 返回代码
*/
@Schema(title = "返回代码")
private Integer code = 0;
/**
* 返回数据对象 data
*/
@Schema(title = "返回数据对象")
private T result;
@Schema(description = "穿戴设备总数")
private Long total;
@Schema(description = "穿戴设备配发数")
private Long distribution;
@Schema(description = "佩戴人数")
private Long wear;
@Schema(description = "运行正常设备数")
private Long normal;
public static <T> DeviceResult<T> ok(T data, long total, long distribution, long wear, long normal) {
DeviceResult<T> r = new DeviceResult<T>();
r.setSuccess(true);
r.setCode(CommonConstant.SC_OK_200);
r.setResult(data);
r.setTotal(total);
r.setDistribution(distribution);
r.setWear(wear);
r.setNormal(normal);
return r;
}
}
@@ -0,0 +1,70 @@
package com.renkang.watch.archives.model.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.renkang.watch.entity.WatchMonitorData;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.jeecg.base.PageInfo;
import org.jeecg.common.aspect.annotation.Dict;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
import java.util.List;
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(title = "压力列表参数", description = "压力列表参数")
public class ErrorPageParam extends PageInfo<WatchMonitorData> {
@Schema(description = "单位 or 部门")
private String orgCode;
@Schema(description = "姓名")
private String realName;
@Schema(description = "员工编号")
private String workNo;
@Schema(description = "性别")
private Integer sex;
@Schema(description = "年龄")
private Integer age;
@Schema(description = "年龄范围参数b (当选择范围时使用)")
private Integer ageB;
@Schema(description = "年龄范围条件:'>', '<', '>=', '<=', '<>', '=', '!='")
private String ageCondition;
@Schema(description = "工具编码")
private String watchNo;
@Schema(title = "事件类型")
@Dict(dicCode = "watch_event_type")
private String eventType;
@Schema(description = "异常值")
private Integer errValue;
@Schema(description = "异常值范围参数b (当选择范围时使用)")
private Integer errValueB;
@Schema(description = "异常值范围条件:'>', '<', '>=', '<=', '<>', '=', '!='")
private String errValueCondition;
@Schema(description = "开始时间")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date startTime;
@Schema(description = "结束时间")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date endTime;
private List<String> bindUserIds;
}
@@ -0,0 +1,37 @@
package com.renkang.watch.archives.model.dto;
import com.renkang.watch.entity.WatchDataWorkout;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.jeecg.base.PageInfo;
import java.util.List;
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(title = "运动列表参数", description = "运动列表参数")
public class ExercisePageParam extends PageInfo<WatchDataWorkout> {
@Schema(description = "单位 or 部门")
private String orgCode;
@Schema(description = "姓名")
private String realName;
@Schema(description = "员工编号")
private String workNo;
@Schema(description = "性别")
private Integer sex;
@Schema(description = "年龄")
private Integer age;
@Schema(description = "年龄范围参数b (当选择范围时使用)")
private Integer ageB;
@Schema(description = "年龄范围条件:'>', '<', '>=', '<=', '<>', '=', '!='")
private String ageCondition;
private List<String> bindUserIds;
}
@@ -0,0 +1,59 @@
package com.renkang.watch.archives.model.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.renkang.watch.entity.WatchMonitorData;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.jeecg.base.PageInfo;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
import java.util.List;
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(title = "跌倒列表参数", description = "跌倒列表参数")
public class FallPageParam extends PageInfo<WatchMonitorData> {
@Schema(description = "单位 or 部门")
private String orgCode;
@Schema(description = "姓名")
private String realName;
@Schema(description = "员工编号")
private String workNo;
@Schema(description = "性别")
private Integer sex;
@Schema(description = "年龄")
private Integer age;
@Schema(description = "年龄范围参数b (当选择范围时使用)")
private Integer ageB;
@Schema(description = "年龄范围条件:'>', '<', '>=', '<=', '<>', '=', '!='")
private String ageCondition;
@Schema(description = "异常值")
private Integer errValue;
@Schema(description = "异常值范围参数b (当选择范围时使用)")
private Integer errValueB;
@Schema(description = "异常值范围条件:'>', '<', '>=', '<=', '<>', '=', '!='")
private String errValueCondition;
@Schema(description = "开始时间")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date startTime;
@Schema(description = "结束时间")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date endTime;
private List<String> bindUserIds;
}
@@ -0,0 +1,37 @@
package com.renkang.watch.archives.model.dto;
import com.renkang.watch.entity.WatchStatUserInfoDayHeartRate;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.jeecg.base.PageInfo;
import java.util.List;
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(title = "心率列表参数", description = "心率列表参数")
public class HeartRatePageParam extends PageInfo<WatchStatUserInfoDayHeartRate> {
@Schema(description = "单位 or 部门")
private String orgCode;
@Schema(description = "姓名")
private String realName;
@Schema(description = "员工编号")
private String workNo;
@Schema(description = "性别")
private Integer sex;
@Schema(description = "年龄")
private Integer age;
@Schema(description = "年龄范围参数b (当选择范围时使用)")
private Integer ageB;
@Schema(description = "年龄范围条件:'>', '<', '>=', '<=', '<>', '=', '!='")
private String ageCondition;
private List<String> bindUserIds;
}
@@ -0,0 +1,37 @@
package com.renkang.watch.archives.model.dto;
import com.renkang.watch.entity.WatchStatUserInfoDaySleep;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.jeecg.base.PageInfo;
import java.util.List;
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(title = "睡眠列表参数", description = "睡眠列表参数")
public class SleepPageParam extends PageInfo<WatchStatUserInfoDaySleep> {
@Schema(description = "单位 or 部门")
private String orgCode;
@Schema(description = "姓名")
private String realName;
@Schema(description = "员工编号")
private String workNo;
@Schema(description = "性别")
private Integer sex;
@Schema(description = "年龄")
private Integer age;
@Schema(description = "年龄范围参数b (当选择范围时使用)")
private Integer ageB;
@Schema(description = "年龄范围条件:'>', '<', '>=', '<=', '<>', '=', '!='")
private String ageCondition;
private List<String> bindUserIds;
}
@@ -0,0 +1,37 @@
package com.renkang.watch.archives.model.dto;
import com.renkang.watch.entity.WatchStatUserInfoDayStress;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.jeecg.base.PageInfo;
import java.util.List;
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(title = "压力列表参数", description = "压力列表参数")
public class StressPageParam extends PageInfo<WatchStatUserInfoDayStress> {
@Schema(description = "单位 or 部门")
private String orgCode;
@Schema(description = "姓名")
private String realName;
@Schema(description = "员工编号")
private String workNo;
@Schema(description = "性别")
private Integer sex;
@Schema(description = "年龄")
private Integer age;
@Schema(description = "年龄范围参数b (当选择范围时使用)")
private Integer ageB;
@Schema(description = "年龄范围条件:'>', '<', '>=', '<=', '<>', '=', '!='")
private String ageCondition;
private List<String> bindUserIds;
}
@@ -0,0 +1,37 @@
package com.renkang.watch.archives.model.dto;
import com.renkang.watch.entity.WatchStatUserInfoDayTemp;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.jeecg.base.PageInfo;
import java.util.List;
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(title = "体温列表参数", description = "体温列表参数")
public class TempPageParam extends PageInfo<WatchStatUserInfoDayTemp> {
@Schema(description = "单位 or 部门")
private String orgCode;
@Schema(description = "姓名")
private String realName;
@Schema(description = "员工编号")
private String workNo;
@Schema(description = "性别")
private Integer sex;
@Schema(description = "年龄")
private Integer age;
@Schema(description = "年龄范围参数b (当选择范围时使用)")
private Integer ageB;
@Schema(description = "年龄范围条件:'>', '<', '>=', '<=', '<>', '=', '!='")
private String ageCondition;
private List<String> bindUserIds;
}
@@ -0,0 +1,83 @@
package com.renkang.watch.archives.model.vo;
import cn.hutool.core.date.DateField;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjUtil;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.jeecg.common.aspect.annotation.Dict;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
import java.util.List;
@Data
public class AloneReq {
@Schema(description = "单位编码列表")
private List<String> orgCodes;
private List<String> params;
@Schema(title = "事件类型")
@Dict(dicCode = "watch_event_type")
private String eventType;
@Schema(description = "性别")
@Dict(dicCode = "sex2")
private String sex;
@Schema(description = "民族")
@Dict(dicCode = "nation")
private String nation;
@Schema(description = "年龄段")
@Dict(dicCode = "data_age_analysis")
private String dataAgeAnalysis;
@Schema(description = "政治面貌")
@Dict(dicCode = "emp_political")
private String empPolitical;
@Schema(description = "岗位层级")
@Dict(dicCode = "emp_level")
private String jobLevel;
@Schema(description = "婚姻状况")
@Dict(dicCode = "mr_state")
private String mrState;
@Schema(description = "健康现状")
@Dict(dicCode = "user_group_desc")
private String userGroupDesc;
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@Schema(description = "开始时间")
private Date startTime;
public Date getStartTime(){
if (ObjUtil.isEmpty(startTime)){
// 获取当周开始时间
startTime = DateUtil.beginOfWeek(new Date());
}else {
startTime = DateUtil.beginOfDay(startTime);
}
return startTime;
}
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@Schema(description = "结束时间")
private Date endTime;
public Date getEndTime(){
if (ObjUtil.isEmpty(endTime)){
// 获取当周结束时间
endTime = DateUtil.endOfWeek(new Date());
}else {
endTime = DateUtil.endOfDay(endTime).offset(DateField.SECOND,0);
}
return endTime;
}
}
@@ -0,0 +1,80 @@
package com.renkang.watch.archives.model.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.renkang.watch.entity.WatchStatUserInfoDaySpo2;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.jeecg.bean.response.BaseUser;
import org.jeecg.common.aspect.annotation.Dict;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.util.Date;
@Data
@AllArgsConstructor
@NoArgsConstructor
@Schema(title = "数据穿戴血氧列表数据模型", description = "数据穿戴血氧列表数据模型")
public class BloodOxygenDataInfo {
@Schema(description = "userId")
private String userId;
@Schema(description = "员工编号")
private String workNo;
@Schema(description = "姓名")
private String realName;
@Schema(description = "单位")
private String departCode;
@Schema(description = "单位")
private String departName;
@Schema(description = "部门")
private String orgCode;
@Schema(description = "部门")
private String orgName;
@Schema(description = "性别")
@Dict(dicCode = "sex2")
private String sex;
@Schema(description = "年龄")
private String age;
@Schema(description = "日期")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date dataDate;
@Schema(description = "最大值")
private BigDecimal max;
@Schema(description = "最小值")
private BigDecimal min;
@Schema(description = "平均值")
private BigDecimal avg;
public BloodOxygenDataInfo(WatchStatUserInfoDaySpo2 heartRate){
this.userId = heartRate.getUserId();
this.dataDate = heartRate.getDataDate();
this.max = heartRate.getMaxValue();
this.min = heartRate.getMinValue();
this.avg = heartRate.getAvgValue();
}
public BloodOxygenDataInfo(BaseUser user){
this.userId = user.getUserId();
this.workNo = user.getWorkNo();
this.realName = user.getRealName();
this.departCode = user.getDepartCode();
this.departName = user.getDepartName();
this.orgCode = user.getOrgCode();
this.orgName = user.getOrgName();
}
}
@@ -0,0 +1,7 @@
package com.renkang.watch.archives.model.vo;
import lombok.Data;
@Data
public class DataWatch {
}
@@ -0,0 +1,125 @@
package com.renkang.watch.archives.model.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
@Data
public class DeviceData {
/**
* 手表编码
*/
@Excel(name = "手表编码", width = 15)
@Schema(title = "手表编码")
private String watchNo;
/**
* 手表型号
*/
@Excel(name = "手表型号", width = 15)
@Schema(title = "手表型号")
private String watchModel;
/**
* 穿戴状态
*/
@Excel(name = "穿戴状态", width = 15)
@Schema(title = "穿戴状态")
private String wearStatus;
/**
* 穿戴状态
*/
@Excel(name = "绑定状态", width = 15)
@TableField(exist = false)
@Schema(title = "绑定状态")
private String watchStatus;
/**
* 在线状态
*/
@Excel(name = "在线状态", width = 15)
@Schema(title = "在线状态")
private String watchOnline;
/**
* 绑定用户
*/
@Excel(name = "绑定用户", width = 15)
@Schema(title = "绑定用户")
private String bindUserId;
@Excel(name = "绑定用户名称", width = 15)
@Schema(title = "绑定用户名称")
@TableField(exist = false)
private String bindRealName;
@Excel(name = "员工编号", width = 15)
@Schema(title = "员工编号")
@TableField(exist = false)
private String workNo;
/**
* 绑定日期
*/
@Excel(name = "绑定日期", width = 15, format = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@Schema(title = "绑定日期")
private Date bindDate;
/**
* 创建人登录名称
*/
@Schema(title = "创建人登录名称")
private String createBy;
/**
* 创建日期
*/
@Excel(name = "创建日期", width = 15, format = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@Schema(title = "创建日期")
private Date createDate;
/**
* 更新人登录名称
*/
@Schema(title = "更新人登录名称")
private String updateBy;
/**
* 更新日期
*/
@Excel(name = "更新日期", width = 15, format = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@Schema(title = "更新日期")
private Date updateDate;
/**
* IMEI编码
*/
@Excel(name = "IMEI编码", width = 15)
@Schema(title = "IMEI编码")
private String imeiNo;
/**
* EID编码
*/
@Excel(name = "EID编码", width = 15)
@Schema(title = "EID编码")
private String eid;
/**
* 最后一次数据更新时间
*/
@Excel(name = "最后一次数据更新时间", width = 15, format = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@Schema(title = "最后一次数据更新时间")
private Date lastUpdateTime;
/**
* 归属部门
*/
@Excel(name = "归属部门", width = 15)
@Schema(title = "归属部门")
private String deptId;
@Schema(title = "部门编码")
private String orgCode;
}
@@ -0,0 +1,89 @@
package com.renkang.watch.archives.model.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.renkang.watch.entity.WatchDevice;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.jeecg.bean.response.BaseUser;
import org.jeecg.common.aspect.annotation.Dict;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
@Data
@AllArgsConstructor
@NoArgsConstructor
@Schema(title = "数据穿戴设备列表数据模型", description = "数据穿戴设备列表数据模型")
public class DeviceDataInfo {
@Schema(description = "userId")
private String bindUserId;
@Schema(description = "员工编号")
private String workNo;
@Schema(description = "姓名")
private String realName;
@Schema(description = "单位")
private String departCode;
@Schema(description = "单位")
private String departName;
@Schema(description = "部门")
private String orgCode;
@Schema(description = "部门")
private String orgName;
@Schema(description = "性别")
@Dict(dicCode = "sex2")
private String sex;
@Schema(description = "年龄")
private String age;
@Schema(description = "入库日期")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date createDate;
@Schema(title = "工具编码")
private String watchNo;
@Schema(title = "归属单位")
private String deviceDepartCode;
@Schema(title = "归属单位")
private String deviceDepartName;
@Schema(title = "绑定状态")
private String watchStatus;
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@Schema(title = "绑定日期")
private Date bindDate;
public DeviceDataInfo(WatchDevice heartRate){
this.createDate = heartRate.getCreateDate();
this.watchNo = heartRate.getWatchNo();
this.deviceDepartCode = heartRate.getOrgCode();
this.deviceDepartName = heartRate.getOrgName();
this.watchStatus = heartRate.getWatchStatus();
this.bindDate = heartRate.getBindDate();
}
public DeviceDataInfo(BaseUser user){
this.bindUserId = user.getUserId();
this.workNo = user.getWorkNo();
this.realName = user.getRealName();
this.departCode = user.getDepartCode();
this.departName = user.getDepartName();
this.orgCode = user.getOrgCode();
this.orgName = user.getOrgName();
}
}
@@ -0,0 +1,49 @@
package com.renkang.watch.archives.model.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.renkang.watch.entity.WatchDevice;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.jeecg.bean.response.BaseUser;
import org.jeecg.common.aspect.annotation.Dict;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.util.Date;
@Data
@AllArgsConstructor
@NoArgsConstructor
@Schema(title = "档案穿戴服务数据模型", description = "档案穿戴服务数据模型")
public class DeviceDataMap {
@Schema(description = "单位")
private String departCode;
@Schema(description = "单位")
private String departName;
@Schema(description = "设备ID")
private String deptId;
@Schema(description = "穿戴设备总数")
private Long total=0L;
@Schema(description = "穿戴设备配发数")
private Long distribution=0L;
@Schema(description = "佩戴人数")
private Long wear=0L;
@Schema(description = "运行正常设备数")
private Long normal=0L;
@Schema(description = "经度")
private BigDecimal longitude;
@Schema(description = "纬度")
private BigDecimal latitude;
}
@@ -0,0 +1,83 @@
package com.renkang.watch.archives.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.jeecg.common.aspect.annotation.Dict;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
@Data
@AllArgsConstructor
@NoArgsConstructor
@Schema(title = "数据穿戴异常列表数据模型", description = "数据穿戴异常列表数据模型")
public class ErrorDataInfo {
@Schema(description = "userId")
private String userId;
@Schema(description = "员工编号")
private String workNo;
@Schema(description = "姓名")
private String realName;
@Schema(description = "手机号")
private String phone;
@Schema(description = "单位")
private String departCode;
@Schema(description = "单位")
private String departName;
@Schema(description = "部门")
private String orgCode;
@Schema(description = "部门")
private String orgName;
@Schema(description = "性别")
@Dict(dicCode = "sex2")
private String sex;
@Schema(description = "年龄")
private String age;
@Schema(title = "事件类型")
@Dict(dicCode = "watch_event_type")
private String eventType;
@Schema(description = "工具编码")
private String watchNo;
@Schema(description = "异常值")
private String dataValue;
/**
* 详细地址
*/
@Excel(name = "详细地址", width = 15)
@Schema(title = "详细地址")
private String address;
/**
* 经度
*/
@Excel(name = "经度", width = 15)
@Schema(title = "经度")
private Double lon;
/**
* 纬度
*/
@Excel(name = "纬度", width = 15)
@Schema(title = "纬度")
private Double lat;
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@Schema(title = "报警时间")
private Date warnTime;
}
@@ -0,0 +1,84 @@
package com.renkang.watch.archives.model.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.renkang.watch.entity.WatchDataWorkout;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.jeecg.bean.response.BaseUser;
import org.jeecg.common.aspect.annotation.Dict;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
@Data
@AllArgsConstructor
@NoArgsConstructor
@Schema(title = "数据穿戴运动列表数据模型", description = "数据穿戴运动列表数据模型")
public class ExerciseDataInfo {
@Schema(description = "userId")
private String userId;
@Schema(description = "员工编号")
private String workNo;
@Schema(description = "姓名")
private String realName;
@Schema(description = "单位")
private String departCode;
@Schema(description = "单位")
private String departName;
@Schema(description = "部门")
private String orgCode;
@Schema(description = "部门")
private String orgName;
@Schema(description = "性别")
@Dict(dicCode = "sex2")
private String sex;
@Schema(description = "年龄")
private String age;
@Schema(description = "日期")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date dataDate;
@Schema(title = "锻炼类型")
@Dict(dicCode = "watch_exercise_type")
private String workoutType;
@Schema(title = "距离")
private Integer distance;
@Schema(title = "消耗")
private Integer calorie;
@Schema(title = "运动总时长")
private String totalTime;
public ExerciseDataInfo(WatchDataWorkout heartRate){
this.dataDate = heartRate.getDataDate();
this.workoutType = heartRate.getWorkoutType();
this.distance = heartRate.getDistance();
this.calorie = heartRate.getCalorie();
this.totalTime = heartRate.getTotalTime();
}
public ExerciseDataInfo(BaseUser user){
this.userId = user.getUserId();
this.workNo = user.getWorkNo();
this.realName = user.getRealName();
this.departCode = user.getDepartCode();
this.departName = user.getDepartName();
this.orgCode = user.getOrgCode();
this.orgName = user.getOrgName();
}
}
@@ -0,0 +1,114 @@
package com.renkang.watch.archives.model.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.jeecg.common.aspect.annotation.Dict;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.util.Date;
@Data
public class FallData {
/**
* 手表编码
*/
@Excel(name = "手表编码", width = 15)
@Schema(title = "手表编码")
private String watchNo;
/**
* 事件类型
*/
@Schema(title = "事件类型")
@Dict(dicCode = "watch_event_type")
private String eventType;
/**
* 绑定用户
*/
@Schema(title = "绑定用户")
private String bindUserId;
/**
* 创建人登录名称
*/
@Schema(title = "创建人登录名称")
private String createBy;
/**
* 创建日期
*/
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@Schema(title = "创建日期")
private Date createDate;
/**
* 数据值
*/
@Schema(title = "数据值")
private String dataValue;
/**
* 详细地址
*/
@Schema(title = "详细地址")
private String address;
/**
* 经度
*/
@Schema(title = "经度")
private Double lon;
/**
* 纬度
*/
@Schema(title = "纬度")
private Double lat;
/**
* 数据日期
*/
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@Schema(title = "数据日期")
private Date dataDate;
/**
* 报警时间
*/
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@Schema(title = "报警时间")
private Date warnTime;
/**
* GPS错误信息
*/
@Schema(title = "GPS错误信息")
private String gpsErrorMsg;
/**
* 高德经度
*/
@Schema(title = "高德经度")
private BigDecimal lonGd;
/**
* 高德纬度
*/
@Schema(title = "高德纬度")
private BigDecimal latGd;
/**
* 高德地址
*/
@Schema(title = "高德地址")
private String addressGd;
/**
* 是否已短信通知
*/
@Schema(title = "是否已短信通知")
private String sendFlag;
/**
* 是否大屏通知
*/
@Schema(title = "是否大屏通知")
private String largeScreenFlag;
/**
* 部门编码
*/
@Schema(title = "部门编码")
private String orgCode;
}
@@ -0,0 +1,79 @@
package com.renkang.watch.archives.model.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.renkang.watch.entity.WatchMonitorData;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.jeecg.bean.response.BaseUser;
import org.jeecg.common.aspect.annotation.Dict;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
@Data
@AllArgsConstructor
@NoArgsConstructor
@Schema(title = "数据穿戴跌倒列表数据模型", description = "数据穿戴跌倒列表数据模型")
public class FallDataInfo {
@Schema(description = "userId")
private String userId;
@Schema(description = "员工编号")
private String workNo;
@Schema(description = "姓名")
private String realName;
@Schema(description = "单位")
private String departCode;
@Schema(description = "单位")
private String departName;
@Schema(description = "部门")
private String orgCode;
@Schema(description = "部门")
private String orgName;
@Schema(description = "性别")
@Dict(dicCode = "sex2")
private String sex;
@Schema(description = "年龄")
private String age;
@Schema(description = "日期")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date dataDate;
@Schema(title = "详细地址")
private String address;
@Schema(title = "经度")
private Double lon;
@Schema(title = "纬度")
private Double lat;
public FallDataInfo(WatchMonitorData heartRate){
this.dataDate = heartRate.getDataDate();
this.address = heartRate.getAddress();
this.lon = heartRate.getLon();
this.lat = heartRate.getLat();
}
public FallDataInfo(BaseUser user){
this.userId = user.getUserId();
this.workNo = user.getWorkNo();
this.realName = user.getRealName();
this.departCode = user.getDepartCode();
this.departName = user.getDepartName();
this.orgCode = user.getOrgCode();
this.orgName = user.getOrgName();
}
}
@@ -0,0 +1,69 @@
package com.renkang.watch.archives.model.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
@Data
public class HeartRateData {
/**
* 用户id
*/
@Excel(name = "用户id", width = 15)
@Schema(title = "用户id")
private String userId;
/**
* 最大值
*/
@Excel(name = "最大值", width = 15)
@Schema(title = "最大值")
private Integer maxValue;
/**
* 最小值
*/
@Excel(name = "最小值", width = 15)
@Schema(title = "最小值")
private Integer minValue;
/**
* 平均值
*/
@Excel(name = "平均值", width = 15)
@Schema(title = "平均值")
private Integer avgValue;
/**
* 静息心率最大值
*/
@Excel(name = "静息心率最大值", width = 15)
@Schema(title = "静息心率最大值")
private Integer silenceMaxValue;
/**
* 静息心率最小值
*/
@Excel(name = "静息心率最小值", width = 15)
@Schema(title = "静息心率最小值")
private Integer silenceMinValue;
/**
* 静息心率平均值
*/
@Excel(name = "静息心率平均值", width = 15)
@Schema(title = "静息心率平均值")
private Integer silenceAvgValue;
/**
* 数据时间
*/
@Excel(name = "数据时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Schema(title = "数据时间")
private Date dataDate;
/**
* 部门编码
*/
@Excel(name = "部门编码", width = 15)
@Schema(title = "部门编码")
private String orgCode;
}
@@ -0,0 +1,79 @@
package com.renkang.watch.archives.model.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.renkang.watch.entity.WatchStatUserInfoDayHeartRate;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.jeecg.bean.response.BaseUser;
import org.jeecg.common.aspect.annotation.Dict;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
@Data
@AllArgsConstructor
@NoArgsConstructor
@Schema(title = "数据穿戴心率列表数据模型", description = "数据穿戴心率列表数据模型")
public class HeartRateDataInfo {
@Schema(description = "userId")
private String userId;
@Schema(description = "员工编号")
private String workNo;
@Schema(description = "姓名")
private String realName;
@Schema(description = "单位")
private String departCode;
@Schema(description = "单位")
private String departName;
@Schema(description = "部门")
private String orgCode;
@Schema(description = "部门")
private String orgName;
@Schema(description = "性别")
@Dict(dicCode = "sex2")
private String sex;
@Schema(description = "年龄")
private String age;
@Schema(description = "日期")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date dataDate;
@Schema(description = "最大值")
private Integer max;
@Schema(description = "最小值")
private Integer min;
@Schema(description = "平均值")
private Integer avg;
public HeartRateDataInfo(WatchStatUserInfoDayHeartRate heartRate){
this.userId = heartRate.getUserId();
this.dataDate = heartRate.getDataDate();
this.max = heartRate.getMaxValue();
this.min = heartRate.getMinValue();
this.avg = heartRate.getAvgValue();
}
public HeartRateDataInfo(BaseUser user){
this.userId = user.getUserId();
this.workNo = user.getWorkNo();
this.realName = user.getRealName();
this.departCode = user.getDepartCode();
this.departName = user.getDepartName();
this.orgCode = user.getOrgCode();
this.orgName = user.getOrgName();
}
}
@@ -0,0 +1,149 @@
package com.renkang.watch.archives.model.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
@Data
public class SleepData {
/**
* 用户id
*/
@Excel(name = "用户id", width = 15)
@Schema(title = "用户id")
private String userId;
/**
* 平均睡眠时长
*/
@Excel(name = "平均睡眠时长", width = 15)
@Schema(title = "用户id")
private Integer sleepAvg;
/**
* 平均睡眠时长
*/
@Excel(name = "平均长睡睡眠时长", width = 15)
@Schema(title = "用户id")
private Integer longDurationAvg;
/**
* 平均睡眠时长
*/
@Excel(name = "平均短睡睡眠时长", width = 15)
@Schema(title = "用户id")
private Integer shortDurationAvg;
/**
* 长睡数量
*/
@Excel(name = "长睡数量", width = 15)
@Schema(title = "长睡数量")
private Integer longCount;
/**
* 长睡最长时长
*/
@Excel(name = "长睡最长时长", width = 15)
@Schema(title = "长睡最长时长")
private Integer longDurationMax;
/**
* 长睡最短时长
*/
@Excel(name = "长睡最短时长", width = 15)
@Schema(title = "长睡最短时长")
private Integer longDurationMin;
/**
* 长睡睡眠总时长
*/
@Excel(name = "长睡睡眠总时长", width = 15)
@Schema(title = "长睡睡眠总时长")
private Integer longDurationTotal;
/**
* 长睡最早入睡时间
*/
@Excel(name = "长睡最早入睡时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Schema(title = "长睡最早入睡时间")
private Date longStartMin;
/**
* 长睡最晚醒来时间
*/
@Excel(name = "长睡最晚醒来时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Schema(title = "长睡最晚醒来时间")
private Date longEndMax;
/**
* 短睡数量
*/
@Excel(name = "短睡数量", width = 15)
@Schema(title = "短睡数量")
private Integer shortCount;
/**
* 短睡最长时长
*/
@Excel(name = "短睡最长时长", width = 15)
@Schema(title = "短睡最长时长")
private Integer shortDurationMax;
/**
* 短睡最短时长
*/
@Excel(name = "短睡最短时长", width = 15)
@Schema(title = "短睡最短时长")
private Integer shortDurationMin;
/**
* 短睡睡眠总时长
*/
@Excel(name = "短睡睡眠总时长", width = 15)
@Schema(title = "短睡睡眠总时长")
private Integer shortDurationTotal;
/**
* 短睡最早入睡时间
*/
@Excel(name = "短睡最早入睡时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Schema(title = "短睡最早入睡时间")
private Date shortStartMin;
/**
* 短睡最晚醒来时间
*/
@Excel(name = "短睡最晚醒来时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Schema(title = "短睡最晚醒来时间")
private Date shortEndMax;
/**
* 更新时间
*/
@Excel(name = "更新时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Schema(title = "更新时间")
private Date dataDate;
/**
* 部门编码
*/
@Excel(name = "部门编码", width = 15)
@Schema(title = "部门编码")
private String orgCode;
/**
* 深睡睡眠时长
*/
private Integer deepSleepTimes;
/**
* 浅睡睡眠时长
*/
private Integer lightSleepTimes;
/**
* 睡眠总时长(light_sleep_times+deep_sleep_times
*/
private Integer deepLightTimes;
}
@@ -0,0 +1,81 @@
package com.renkang.watch.archives.model.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.renkang.watch.entity.WatchStatUserInfoDaySleep;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.jeecg.bean.response.BaseUser;
import org.jeecg.common.aspect.annotation.Dict;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
@Data
@AllArgsConstructor
@NoArgsConstructor
@Schema(title = "数据穿戴睡眠列表数据模型", description = "数据穿戴睡眠列表数据模型")
public class SleepDataInfo {
@Schema(description = "userId")
private String userId;
@Schema(description = "员工编号")
private String workNo;
@Schema(description = "姓名")
private String realName;
@Schema(description = "单位")
private String departCode;
@Schema(description = "单位")
private String departName;
@Schema(description = "部门")
private String orgCode;
@Schema(description = "部门")
private String orgName;
@Schema(description = "性别")
@Dict(dicCode = "sex2")
private String sex;
@Schema(description = "年龄")
private String age;
@Schema(description = "日期")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date dataDate;
@Schema(description = "深睡睡眠时长")
private Integer deepSleepTimes;
@Schema(description = "浅睡睡眠时长")
private Integer lightSleepTimes;
@Schema(description = "睡眠总时长")
private Integer deepLightTimes;
public SleepDataInfo(WatchStatUserInfoDaySleep heartRate){
this.userId = heartRate.getUserId();
this.dataDate = heartRate.getDataDate();
this.deepSleepTimes = heartRate.getDeepSleepTimes();
this.lightSleepTimes = heartRate.getLightSleepTimes();
this.deepLightTimes = heartRate.getDeepLightTimes();
}
public SleepDataInfo(BaseUser user){
this.userId = user.getUserId();
this.workNo = user.getWorkNo();
this.realName = user.getRealName();
this.departCode = user.getDepartCode();
this.departName = user.getDepartName();
this.orgCode = user.getOrgCode();
this.orgName = user.getOrgName();
}
}
@@ -0,0 +1,40 @@
package com.renkang.watch.archives.model.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.util.Date;
@Data
public class Spo2Data {
/**用户id*/
@Excel(name = "用户id", width = 15)
@Schema(title = "用户id")
private String userId;
/**最大值*/
@Excel(name = "最大值", width = 15)
@Schema(title = "最大值")
private BigDecimal maxValue;
/**最小值*/
@Excel(name = "最小值", width = 15)
@Schema(title = "最小值")
private BigDecimal minValue;
/**平均值*/
@Excel(name = "平均值", width = 15)
@Schema(title = "平均值")
private BigDecimal avgValue;
/**数据日期*/
@Excel(name = "数据日期", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@Schema(title = "数据日期")
private Date dataDate;
/**用户id*/
@Excel(name = "部门编码", width = 15)
@Schema(title = "部门编码")
private String orgCode;
}
@@ -0,0 +1,51 @@
package com.renkang.watch.archives.model.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
@Data
public class StressData {
/**
* 用户ID
*/
@Excel(name = "用户ID", width = 15)
@Schema(title = "用户ID")
private String userId;
/**
* 最大值
*/
@Excel(name = "最大值", width = 15)
@Schema(title = "最大值")
private Integer maxValue;
/**
* 最小值
*/
@Excel(name = "最小值", width = 15)
@Schema(title = "最小值")
private Integer minValue;
/**
* 平均值
*/
@Excel(name = "平均值", width = 15)
@Schema(title = "平均值")
private Integer avgValue;
/**
* 更新时间
*/
@Excel(name = "更新时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Schema(title = "更新时间")
private Date dataDate;
/**
* 部门编码
*/
@Excel(name = "部门编码", width = 15)
@Schema(title = "部门编码")
private String orgCode;
}
@@ -0,0 +1,79 @@
package com.renkang.watch.archives.model.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.renkang.watch.entity.WatchStatUserInfoDayStress;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.jeecg.bean.response.BaseUser;
import org.jeecg.common.aspect.annotation.Dict;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
@Data
@AllArgsConstructor
@NoArgsConstructor
@Schema(title = "数据穿戴压力列表数据模型", description = "数据穿戴压力列表数据模型")
public class StressDataInfo {
@Schema(description = "userId")
private String userId;
@Schema(description = "员工编号")
private String workNo;
@Schema(description = "姓名")
private String realName;
@Schema(description = "单位")
private String departCode;
@Schema(description = "单位")
private String departName;
@Schema(description = "部门")
private String orgCode;
@Schema(description = "部门")
private String orgName;
@Schema(description = "性别")
@Dict(dicCode = "sex2")
private String sex;
@Schema(description = "年龄")
private String age;
@Schema(description = "日期")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date dataDate;
@Schema(description = "最大值")
private Integer max;
@Schema(description = "最小值")
private Integer min;
@Schema(description = "平均值")
private Integer avg;
public StressDataInfo(WatchStatUserInfoDayStress heartRate){
this.userId = heartRate.getUserId();
this.dataDate = heartRate.getDataDate();
this.max = heartRate.getMaxValue();
this.min = heartRate.getMinValue();
this.avg = heartRate.getAvgValue();
}
public StressDataInfo(BaseUser user){
this.userId = user.getUserId();
this.workNo = user.getWorkNo();
this.realName = user.getRealName();
this.departCode = user.getDepartCode();
this.departName = user.getDepartName();
this.orgCode = user.getOrgCode();
this.orgName = user.getOrgName();
}
}
@@ -0,0 +1,54 @@
package com.renkang.watch.archives.model.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.util.Date;
@Data
public class TempData {
/**用户id*/
@Excel(name = "用户id", width = 15)
@Schema(title = "用户id")
private String userId;
/**最大值*/
@Excel(name = "最大值", width = 15)
@Schema(title = "最大值")
private BigDecimal maxValue;
/**最小值*/
@Excel(name = "最小值", width = 15)
@Schema(title = "最小值")
private BigDecimal minValue;
/**平均值*/
@Excel(name = "平均值", width = 15)
@Schema(title = "平均值")
private BigDecimal avgValue;
/**体表温度最大值*/
@Excel(name = "体表温度最大值", width = 15)
@Schema(title = "体表温度最大值")
private BigDecimal skinMaxValue;
/**体表温度最小值*/
@Excel(name = "体表温度最小值", width = 15)
@Schema(title = "体表温度最小值")
private BigDecimal skinMinValue;
/**体表温度平均值*/
@Excel(name = "体表温度平均值", width = 15)
@Schema(title = "体表温度平均值")
private BigDecimal skinAvgValue;
/**更新时间*/
@Excel(name = "更新时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@Schema(title = "更新时间")
private Date dataDate;
/**
* 部门编码
*/
@Excel(name = "部门编码", width = 15)
@Schema(title = "部门编码")
private String orgCode;
}
@@ -0,0 +1,80 @@
package com.renkang.watch.archives.model.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.renkang.watch.entity.WatchStatUserInfoDayTemp;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.jeecg.bean.response.BaseUser;
import org.jeecg.common.aspect.annotation.Dict;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.util.Date;
@Data
@AllArgsConstructor
@NoArgsConstructor
@Schema(title = "数据穿戴体温列表数据模型", description = "数据穿戴体温列表数据模型")
public class TempDataInfo {
@Schema(description = "userId")
private String userId;
@Schema(description = "员工编号")
private String workNo;
@Schema(description = "姓名")
private String realName;
@Schema(description = "单位")
private String departCode;
@Schema(description = "单位")
private String departName;
@Schema(description = "部门")
private String orgCode;
@Schema(description = "部门")
private String orgName;
@Schema(description = "性别")
@Dict(dicCode = "sex2")
private String sex;
@Schema(description = "年龄")
private String age;
@Schema(description = "日期")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date dataDate;
@Schema(description = "最大值")
private BigDecimal max;
@Schema(description = "最小值")
private BigDecimal min;
@Schema(description = "平均值")
private BigDecimal avg;
public TempDataInfo(WatchStatUserInfoDayTemp heartRate){
this.userId = heartRate.getUserId();
this.dataDate = heartRate.getDataDate();
this.max = heartRate.getMaxValue();
this.min = heartRate.getMinValue();
this.avg = heartRate.getAvgValue();
}
public TempDataInfo(BaseUser user){
this.userId = user.getUserId();
this.workNo = user.getWorkNo();
this.realName = user.getRealName();
this.departCode = user.getDepartCode();
this.departName = user.getDepartName();
this.orgCode = user.getOrgCode();
this.orgName = user.getOrgName();
}
}
@@ -0,0 +1,20 @@
package com.renkang.watch.archives.model.vo;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
/**
* @author stan
* @since 2024-11-15 14:31
*/
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class WatchGroupInfo {
private String columnInfo;
private String columnDesc;
private Integer count;
}
@@ -0,0 +1,102 @@
package com.renkang.watch.archives.model.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.jeecg.common.aspect.annotation.Dict;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
@Data
public class WorkoutData {
/**
* 手表编码
*/
@Excel(name = "手表编码", width = 15)
@Schema(title = "手表编码")
private String watchNo;
/**
* 开始时间
*/
@Excel(name = "开始时间", width = 15, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Schema(title = "开始时间")
private Date startTimeStamp;
/**
* 结束时间
*/
@Excel(name = "结束时间", width = 15, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Schema(title = "结束时间")
private Date endTimeStamp;
/**
* 卡路里
*/
@Excel(name = "卡路里", width = 15)
@Schema(title = "卡路里")
private Integer calorie;
/**
* 距离
*/
@Excel(name = "距离", width = 15)
@Schema(title = "距离")
private Integer distance;
/**
* 锻炼类型
*/
@Excel(name = "锻炼类型", width = 15)
@Schema(title = "锻炼类型")
@Dict(dicCode = "watch_exercise_type")
private String workoutType;
/**
* 绑定用户
*/
@Excel(name = "绑定用户", width = 15)
@Schema(title = "绑定用户")
private String bindUserId;
/**
* 绑定日期
*/
@Excel(name = "绑定日期", width = 15, format = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@Schema(title = "绑定日期")
private Date dataDate;
/**
* 数据中心最大ID
*/
@Excel(name = "数据中心最大ID", width = 15)
@Schema(title = "数据中心最大ID")
private String maxId;
@TableField(exist = false)
@Schema(title = "")
private Integer fatCalories;
@TableField(exist = false)
@Schema(title = "")
private Integer sugarCalories;
@TableField(exist = false)
@Schema(title = "运动总时长")
private String totalTime;
@TableField(exist = false)
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@Schema(title = "开始时间")
private Date startTime;
/**
* 结束时间
*/
@TableField(exist = false)
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@Schema(title = "结束时间")
private Date endTime;
}
@@ -0,0 +1,27 @@
package com.renkang.watch.archives.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.renkang.watch.archives.model.dto.ArchivesExercisePageParam;
import com.renkang.watch.archives.model.dto.DevicePageParam;
import com.renkang.watch.archives.model.dto.DeviceResult;
import com.renkang.watch.archives.model.vo.DeviceDataMap;
import com.renkang.watch.entity.WatchDataWorkout;
import com.renkang.watch.entity.WatchStatUserInfoDaySdc;
import org.jeecg.common.api.vo.Result;
import org.jeecg.config.mybatis.bean.BeanDictInfo;
import org.jeecg.config.mybatis.bean.TableInfo;
import java.util.List;
/**
* @Description: 数据模块-档案维护-service
* @Author: feng
* @Date: 2024-11-20
* @Version: V1.0
*/
public interface ArchivesExerciseService {
IPage<WatchStatUserInfoDaySdc> exerciseSdcDataPage(ArchivesExercisePageParam pageParam);
IPage<WatchDataWorkout> exerciseWorkoutDataPage(ArchivesExercisePageParam pageParam);
}
@@ -0,0 +1,19 @@
package com.renkang.watch.archives.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.renkang.watch.archives.model.dto.ArchivesExercisePageParam;
import com.renkang.watch.archives.model.dto.ArchivesSleepPageParam;
import com.renkang.watch.entity.WatchDataWorkout;
import com.renkang.watch.entity.WatchStatUserInfoDaySdc;
import com.renkang.watch.vo.UserData.res.sleep.WatchDataSleepPageRes;
/**
* @Description: 数据模块-档案维护-service
* @Author: feng
* @Date: 2024-11-20
* @Version: V1.0
*/
public interface ArchivesSleepService {
IPage<WatchDataSleepPageRes> watchDataPage(ArchivesSleepPageParam pageParam);
}
@@ -0,0 +1,26 @@
package com.renkang.watch.archives.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.renkang.watch.archives.model.dto.*;
import com.renkang.watch.archives.model.vo.*;
import org.jeecg.common.bean.response.TotalPieChart;
import org.jeecg.config.mybatis.bean.BeanDictInfo;
import org.jeecg.config.mybatis.bean.TableInfo;
import java.util.List;
/**
* @Description: 数据模块-穿戴数据-service
* @Author: feng
* @Date: 2024-11-20
* @Version: V1.0
*/
public interface ArchivesWatchService {
DeviceResult<List<DeviceDataMap>> deviceDataPage(DevicePageParam pageParam);
TableInfo tableStructure();
BeanDictInfo dict();
}
@@ -0,0 +1,78 @@
package com.renkang.watch.archives.service.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DateField;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.renkang.watch.archives.model.dto.ArchivesExercisePageParam;
import com.renkang.watch.archives.model.dto.DevicePageParam;
import com.renkang.watch.archives.model.dto.DeviceResult;
import com.renkang.watch.archives.model.vo.DeviceData;
import com.renkang.watch.archives.model.vo.DeviceDataMap;
import com.renkang.watch.archives.service.ArchivesExerciseService;
import com.renkang.watch.archives.service.ArchivesWatchService;
import com.renkang.watch.entity.WatchDataWorkout;
import com.renkang.watch.entity.WatchDevice;
import com.renkang.watch.entity.WatchStatUserInfoDaySdc;
import com.renkang.watch.entity.WatchUserData;
import com.renkang.watch.mapper.WatchDataWorkoutMapper;
import com.renkang.watch.mapper.WatchDeviceMapper;
import com.renkang.watch.mapper.WatchStatUserInfoDaySdcMapper;
import com.renkang.watch.mapper.WatchUserDataMapper;
import com.renkang.watch.service.IDeptStatisticDataService;
import com.renkang.watch.vo.dept.DeptAssignedUserNumsRes;
import lombok.RequiredArgsConstructor;
import org.jeecg.common.system.util.DictUtil;
import org.jeecg.config.mybatis.AnalyzeTableManager;
import org.jeecg.config.mybatis.bean.*;
import org.jeecg.enums.TableInfoEnum;
import org.jeecg.global.GlobalUtils;
import org.jeecg.modules.manager.ISysCache;
import org.jeecg.modules.system.entity.SysDepart;
import org.jeecg.util.ColumnUtil;
import org.jeecg.util.WrapperUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import java.util.*;
import java.util.stream.Collectors;
/**
* @Description: 数据模块-档案维护-serviceImpl
*/
@Service
@RequiredArgsConstructor
public class ArchivesExerciseServiceImpl implements ArchivesExerciseService {
private static final Logger log = LoggerFactory.getLogger(ArchivesExerciseServiceImpl.class);
private final WatchStatUserInfoDaySdcMapper sdcMapper;
private final WatchDataWorkoutMapper workoutMapper;
@Override
public IPage<WatchStatUserInfoDaySdc> exerciseSdcDataPage(ArchivesExercisePageParam pageParam) {
LambdaQueryWrapper<WatchStatUserInfoDaySdc> queryWrapper = Wrappers.lambdaQuery();
queryWrapper.eq(WatchStatUserInfoDaySdc::getUserId, pageParam.getUserId());
if (ObjUtil.isNotEmpty(pageParam.getStartTime()) && ObjUtil.isNotEmpty(pageParam.getEndTime())) {
queryWrapper.between(WatchStatUserInfoDaySdc::getDataDate, pageParam.getStartTime(), pageParam.getEndTime());
}
queryWrapper.orderByDesc(WatchStatUserInfoDaySdc::getDataDate);
Page<WatchStatUserInfoDaySdc> page = new Page<>(pageParam.getPageNo(), pageParam.getPageSize());
return sdcMapper.selectPage(page, queryWrapper);
}
@Override
public IPage<WatchDataWorkout> exerciseWorkoutDataPage(ArchivesExercisePageParam pageParam) {
LambdaQueryWrapper<WatchDataWorkout> queryWrapper = Wrappers.lambdaQuery();
queryWrapper.eq(WatchDataWorkout::getBindUserId, pageParam.getUserId());
if (ObjUtil.isNotEmpty(pageParam.getStartTime()) && ObjUtil.isNotEmpty(pageParam.getEndTime())) {
queryWrapper.between(WatchDataWorkout::getDataDate, pageParam.getStartTime(), pageParam.getEndTime());
}
queryWrapper.orderByDesc(WatchDataWorkout::getDataDate);
Page<WatchDataWorkout> page = new Page<>(pageParam.getPageNo(), pageParam.getPageSize());
return workoutMapper.selectPage(page, queryWrapper);
}
}
@@ -0,0 +1,36 @@
package com.renkang.watch.archives.service.impl;
import cn.hutool.core.util.ObjUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.renkang.watch.archives.model.dto.ArchivesExercisePageParam;
import com.renkang.watch.archives.model.dto.ArchivesSleepPageParam;
import com.renkang.watch.archives.service.ArchivesExerciseService;
import com.renkang.watch.archives.service.ArchivesSleepService;
import com.renkang.watch.entity.WatchDataWorkout;
import com.renkang.watch.entity.WatchStatUserInfoDaySdc;
import com.renkang.watch.mapper.WatchDataSleepNewMapper;
import com.renkang.watch.mapper.WatchDataWorkoutMapper;
import com.renkang.watch.mapper.WatchStatUserInfoDaySdcMapper;
import com.renkang.watch.vo.UserData.res.sleep.WatchDataSleepPageRes;
import lombok.RequiredArgsConstructor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
/**
* @Description: 数据模块-档案维护-serviceImpl
*/
@Service
@RequiredArgsConstructor
public class ArchivesSleepServiceImpl implements ArchivesSleepService {
private static final Logger log = LoggerFactory.getLogger(ArchivesSleepServiceImpl.class);
private final WatchDataSleepNewMapper watchDataSleepNewMapper;
@Override
public IPage<WatchDataSleepPageRes> watchDataPage(ArchivesSleepPageParam pageParam) {
return watchDataSleepNewMapper.selectSleepPageNew(new Page<>(pageParam.getPageNo(),pageParam.getPageSize()), pageParam.getStartTime(), pageParam.getEndTime(), pageParam.getUserId());
}
}
@@ -0,0 +1,177 @@
package com.renkang.watch.archives.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DateField;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.renkang.watch.archives.model.dto.*;
import com.renkang.watch.archives.model.vo.*;
import com.renkang.watch.archives.service.ArchivesWatchService;
import com.renkang.watch.constant.WatchConstants;
import com.renkang.watch.entity.*;
import com.renkang.watch.mapper.*;
import com.renkang.watch.service.IDeptStatisticDataService;
import com.renkang.watch.vo.dept.DeptAssignedUserNumsRes;
import lombok.RequiredArgsConstructor;
import org.jeecg.bean.request.HealthMealsWeightQueryVO;
import org.jeecg.bean.response.BaseEmployeeInfo;
import org.jeecg.bean.response.BaseUser;
import org.jeecg.common.bean.response.PieChart;
import org.jeecg.common.bean.response.TotalPieChart;
import org.jeecg.common.system.api.ISysBaseAPI;
import org.jeecg.common.system.util.DictUtil;
import org.jeecg.common.system.vo.DictModel;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.common.util.RedisUtil;
import org.jeecg.config.mybatis.AnalyzeTableManager;
import org.jeecg.config.mybatis.bean.*;
import org.jeecg.enums.TableInfoEnum;
import org.jeecg.global.GlobalUtils;
import org.jeecg.modules.manager.ISysCache;
import org.jeecg.modules.system.entity.HealthUserEmployeeEx;
import org.jeecg.modules.system.entity.SysDepart;
import org.jeecg.util.ColumnUtil;
import org.jeecg.util.WrapperUtils;
import org.jetbrains.annotations.NotNull;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.core.task.AsyncTaskExecutor;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.*;
import java.util.stream.Collectors;
/**
* @Description: 数据模块-穿戴数据-serviceImpl
*/
@Service
@RequiredArgsConstructor
public class ArchivesWatchServiceImpl implements ArchivesWatchService {
private static final Logger log = LoggerFactory.getLogger(ArchivesWatchServiceImpl.class);
private final WatchDeviceMapper deviceMapper;
private final WatchUserDataMapper watchUserDataMapper;
private final AnalyzeTableManager analyzeTableManager;
private final IDeptStatisticDataService statisticService;
private final ISysCache sysCache;
private final DictUtil dictUtil;
// 穿戴数据导出code
private final String exportCode = "dataWatchExportCode";
@Override
public DeviceResult<List<DeviceDataMap>> deviceDataPage(DevicePageParam pageParam) {
LambdaQueryWrapper<WatchDevice> wrapper = buildWatchDeviceWrapper(pageParam);
List<WatchDevice> watchDevices = deviceMapper.selectList(wrapper);
List<String> bindUserIdList = watchDevices.stream().map(WatchDevice::getBindUserId).distinct().collect(Collectors.toList());
Date beforeYesterday = DateUtil.beginOfDay(DateUtil.offsetDay(new Date(), -2));
Date yesterday = DateUtil.endOfDay(DateUtil.offsetDay(new Date(), -1)).offset(DateField.MILLISECOND, -999);
List<WatchUserData> watchUserData = watchUserDataMapper.selectList(Wrappers.<WatchUserData>lambdaQuery()
.in(WatchUserData::getBindUserId, bindUserIdList)
.ge(WatchUserData::getDataDate, beforeYesterday)
.le(WatchUserData::getDataDate, yesterday));
// 根据orgCode分组
Map<String, List<WatchDevice>> orgCodeMap = watchDevices.stream().collect(Collectors.groupingBy(WatchDevice::getOrgCode));
// 取出所有的orgCode
List<SysDepart> departs = new ArrayList<>();
for (String orgCode : new ArrayList<>(orgCodeMap.keySet())) {
departs.add(sysCache.getDepartByOrgCode(orgCode));
}
Map<String, DeptAssignedUserNumsRes> numsResMap = statisticService.setAssignedUserNumsNew(new ArrayList<>(orgCodeMap.keySet()), new Date(0), new Date());
// 将depart转换为map
Map<String, SysDepart> departMap = departs.stream().collect(Collectors.toMap(SysDepart::getOrgCode, a -> a));
List<DeviceDataMap> mapList = new ArrayList<>();
orgCodeMap.forEach((k, v) -> {
DeviceDataMap deviceDataMap = new DeviceDataMap();
SysDepart secondDepart = departMap.get(k);
if (secondDepart != null) {
deviceDataMap.setDepartCode(secondDepart.getOrgCode());
deviceDataMap.setDepartName(secondDepart.getDepartName());
deviceDataMap.setDeptId(secondDepart.getId());
deviceDataMap.setLatitude(secondDepart.getLat());
deviceDataMap.setLongitude(secondDepart.getLng());
}
// 查询该单位下的设备总数
deviceDataMap.setTotal((long) v.size());
// 查询该单位下的绑定设备总数
long distribution = v.stream().filter(a -> StrUtil.isNotEmpty(a.getBindUserId())).count();
deviceDataMap.setDistribution(distribution);
// 查询该单位下的佩戴人数
DeptAssignedUserNumsRes numRes = numsResMap.get(k);
if (numRes != null) {
deviceDataMap.setWear(Long.valueOf(numRes.getAssignedUserNums()));
}
// 查询该单位下的运行正常设备数
long normal = watchUserData.stream().filter(a -> v.stream().map(WatchDevice::getBindUserId).collect(Collectors.toList()).contains(a.getBindUserId())).count();
deviceDataMap.setNormal(normal);
mapList.add(deviceDataMap);
});
// 所有设备总数
long total = mapList.stream().mapToLong(DeviceDataMap::getTotal).sum();
// 所有设备配发数
long distribution = mapList.stream().mapToLong(DeviceDataMap::getDistribution).sum();
// 所有佩戴人数
long wear = mapList.stream().mapToLong(DeviceDataMap::getWear).sum();
// 所有运行正常设备数
long normal = mapList.stream().mapToLong(DeviceDataMap::getNormal).sum();
return DeviceResult.ok(mapList, total, distribution, wear, normal);
}
private LambdaQueryWrapper<WatchDevice> buildWatchDeviceWrapper(DevicePageParam pageParam) {
// 数据库表中不存在create_time字段 会报错 使用data_date覆盖掉create_time
if (pageParam.getColumn().equals("createTime")) {
pageParam.setColumn("create_date");
}
LambdaQueryWrapper<WatchDevice> queryWrapper = WrapperUtils.initLambdaWrapper(pageParam);
if (ObjUtil.isNotEmpty(pageParam.getOrgCode())){
queryWrapper.like(WatchDevice::getOrgCode, pageParam.getOrgCode());
}else {
queryWrapper.like(WatchDevice::getOrgCode, GlobalUtils.getSecondDepartOrgCode(GlobalUtils.getLoginUser().getOrgCode()));
}
return queryWrapper;
}
@Override
public TableInfo tableStructure() {
List<String> tableNames = Collections.singletonList("watch_device");
Map<String, ColumnMetaData> columnInfo = analyzeTableManager.columnInfo(tableNames, DeviceData.class);
TableCreateInfo createInfo = getTableCreateInfo();
TableInfo tableInfo = new TableInfo();
tableInfo.setColumnInfo(columnInfo);
tableInfo.setCreateInfo(createInfo);
return tableInfo;
}
@Override
public BeanDictInfo dict() {
Map<String, ColumnDictData> dataMap = ColumnUtil.convertDict(DeviceData.class, dictUtil::queryDictItemListByCode);
TableCreateInfo createInfo = getTableCreateInfo();
BeanDictInfo beanDictInfo = new BeanDictInfo();
beanDictInfo.setDictDataMap(dataMap);
beanDictInfo.setCreateInfo(createInfo);
return beanDictInfo;
}
private TableCreateInfo getTableCreateInfo() {
TableInfoEnum user = TableInfoEnum.DEFAULT;
TableCreateInfo info = new TableCreateInfo();
info.setTime(user.getTime());
info.setDesign(new ContactInfo(user.getDesign().getName(), user.getDesign().getCall()));
info.setCharge(new ContactInfo(user.getCharge().getName(), user.getCharge().getCall()));
info.setCompleted(new ContactInfo(user.getCompleted().getName(), user.getCompleted().getCall()));
return info;
}
}
@@ -0,0 +1,439 @@
package com.renkang.watch.async;
import cn.hutool.core.util.StrUtil;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.read.listener.PageReadListener;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.renkang.watch.dto.WatchDeviceExcel;
import com.renkang.watch.entity.WatchBindHis;
import com.renkang.watch.entity.WatchDevice;
import com.renkang.watch.entity.WatchDeviceSwitch;
import com.renkang.watch.service.IWatchBindHisService;
import com.renkang.watch.service.IWatchDeviceService;
import com.renkang.watch.service.IWatchDeviceSwitchService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.shiro.SecurityUtils;
import org.jeecg.bean.request.ListUser;
import org.jeecg.common.exception.JeecgBootException;
import org.jeecg.common.system.api.ISysBaseAPI;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.common.util.DateUtils;
import org.jeecg.common.util.MyUploadUtil;
import org.jeecg.global.GlobalUtils;
import org.jeecg.modules.exports.entity.CommonExportsInfo;
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.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @author TianZi
* @date 2023/11/20 16:09
*/
@Service
@Slf4j
public class AsyncImportService {
@Resource
private ISysBaseAPI sysBaseAPI;
@Resource
private AsyncTaskExecutor taskExecutor;
@Resource
private ISysCache sysCache;
@Resource
private IWatchDeviceService watchDeviceService;
@Resource
private IWatchBindHisService watchBindHisService;
@Resource
private IWatchDeviceSwitchService watchDeviceSwitchService;
/**
* 验证并填充开关列表switchList
*/
private void validateAndPopulateSwitchList(List<WatchDevice> watchDevices, List<WatchDeviceSwitch> switchList) {
List<String> watchNo = watchDevices.stream().map(WatchDevice::getWatchNo).distinct().collect(Collectors.toList());
LambdaQueryWrapper<WatchDeviceSwitch> wrapper = new LambdaQueryWrapper<>();
wrapper.in(WatchDeviceSwitch::getWatchNo, watchNo);
List<WatchDeviceSwitch> list = watchDeviceSwitchService.list(wrapper);
List<String> collect = list.stream().map(WatchDeviceSwitch::getId).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(collect)) {
watchDeviceSwitchService.removeByIds(collect);
}
// 这里假设WatchDeviceSwitch的类型有固定的几种,可以list根据需要来调整
String[] types = {"heart_rate", "spo2", "stress", "temperature"};
for (WatchDevice watchDevice : watchDevices) {
for (String type : types) {
WatchDeviceSwitch watchDeviceSwitch = new WatchDeviceSwitch();
watchDeviceSwitch.setWatchNo(watchDevice.getWatchNo());
watchDeviceSwitch.setWdType(type);
watchDeviceSwitch.setSwitchFlag("1");
switchList.add(watchDeviceSwitch);
}
}
}
/**
* 处理导入错误
*/
private void handleImportError(CommonExportsInfo info1, String errCode, String message) {
info1.setExportStatus(errCode);
info1.setHandleEndTime(new Date());
GlobalUtils.setFeignToken();
info1.setExportMsg(message);
sysBaseAPI.updateExportsInfo(info1);
}
@Async
@Transactional(rollbackFor = Exception.class)
public void asyncImport(ByteArrayInputStream in, String deptId, CommonExportsInfo info1, String empFinish, String errCode, String sheetName, String fileName) {
List<WatchDevice> watchDevices = new ArrayList<>();
List<WatchDevice> list = new ArrayList<>();
try {
// 获取orgCode
// 去除逗号
String deptIdNew = deptId.replace(",", "");
SysDepart departById = sysCache.getDepartById(deptIdNew);
EasyExcel.read(in, WatchDeviceExcel.class, new PageReadListener<WatchDeviceExcel>(dataList -> {
for (WatchDeviceExcel deviceExcel : dataList) {
WatchDevice watchDevice = new WatchDevice();
watchDevice.setWatchNo(deviceExcel.getWatchNo());
watchDevice.setCreateDate(new Date());
watchDevice.setDeptId(deptIdNew);
watchDevice.setOrgCode(departById.getOrgCode());
// 去除逗号
watchDevice.setDeptId(watchDevice.getDeptId().replace(",", ""));
watchDevices.add(watchDevice);
}
})).sheet().headRowNumber(3).doRead();
} catch (Exception e) {
handleImportError(info1, errCode, "模板解析错误,请检查模板后重试");
throw new JeecgBootException("模板解析错误,请检查模板后重试");
}
if (CollectionUtils.isNotEmpty(watchDevices)) {
// 过滤空数据
list = watchDevices.stream()
.filter(medicine -> medicine.getDeptId() != null && !medicine.getDeptId().isEmpty())
.filter(medicine -> medicine.getWatchNo() != null && !medicine.getWatchNo().isEmpty())
.collect(Collectors.toList());
}
// 查询 编号是否重复 24.1.8 如果手表编号已经存在,就忽略,不再提示设备编码已存在,导入失败,只把增量的加上
// LambdaQueryWrapper<WatchDevice> queryWrapper = new LambdaQueryWrapper<>();
// queryWrapper.in(WatchDevice::getWatchNo, list.stream().map(WatchDevice::getWatchNo).collect(Collectors.toList()));
// List<WatchDevice> list1 = watchDeviceService.list(queryWrapper);
// if (CollectionUtils.isNotEmpty(list1)) {
// handleImportError(info1, errCode, "设备编码已存在,请检查后重试");
// throw new BusinessException("设备编码已存在,请检查后重试");
// }
// 生成默认开关数据
List<WatchDeviceSwitch> switchList = new ArrayList<>();
validateAndPopulateSwitchList(list, switchList);
int count = list.size();
int index = 0;
for (WatchDevice device : list) {
if (index % 100 == 0) {
info1.setHandleMsg(index + "/" + count);
GlobalUtils.setFeignToken();
sysBaseAPI.updateExportsInfo(info1);
}
index++;
}
// 单条保存数据
for (WatchDevice watchDevice : list) {
try {
boolean save = watchDeviceService.save(watchDevice);
// 保存成功后,保存开关数据
if (save) {
List<WatchDeviceSwitch> collect = switchList.stream().filter(item -> item.getWatchNo().equals(watchDevice.getWatchNo())).collect(Collectors.toList());
watchDeviceSwitchService.saveOrUpdateBatch(collect);
}
} catch (Exception e) {
// 保存失败 设备已存在 跳过
// handleImportError(info1, errCode, "设备导入失败,与服务器连接超时");
// throw new BusinessException("设备导入失败,与服务器连接超时");
}
}
try {
//上传ftp
String suffixName = ".xlsx";
// 重置指针
in.reset();
String url = MyUploadUtil.upload(in, MyUploadUtil.IMPORT_BIZ, fileName + suffixName);
info1.setExportUrl(url);
in.close();
} catch (Exception e) {
e.printStackTrace();
} finally {
//数据导入完成
info1.setExportStatus(empFinish);
info1.setHandleMsg(count + "/" + count);
info1.setHandleEndTime(new Date());
GlobalUtils.setFeignToken();
sysBaseAPI.updateExportsInfo(info1);
}
}
@Async
@Transactional(rollbackFor = Exception.class)
public void asyncImportData(ByteArrayInputStream in, CommonExportsInfo info1, String empFinish, String errCode){
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); // 获取当前登录用户
List<WatchDevice> excelWatchDevice = new ArrayList<>();
// 解析Excel文件到watchDevices列表
if (!parseExcelToWatchDevices(in, excelWatchDevice, info1, errCode)) {
return;
}
// 过滤有效的设备数据
List<WatchDevice> filteredDevices = filterValidDevices(excelWatchDevice);
// 取出编号数据
List<String> watchNoList = excelWatchDevice.stream().map(WatchDevice::getWatchNo).collect(Collectors.toList());
// 取出身份证
List<String> idCardList = excelWatchDevice.stream().map(WatchDevice::getBindUserId).collect(Collectors.toList());
GlobalUtils.setHttpFeignToken();
// 用户数据
List<SysUser> userList = sysBaseAPI.getUserByIdCardList(new ListUser(idCardList));
// 查询设备
List<WatchDevice> watchDeviceList = watchDeviceService.list(new QueryWrapper<WatchDevice>().in("watch_no", watchNoList));
int count = excelWatchDevice.size();
int index = 0;
if (CollectionUtils.isEmpty(watchDeviceList)) {
//数据导入失败
logErrorAndUpdateExportInfo(info1, errCode, "设备编号不存在,请检查后重试", index, count);
return;
}
try {
// 更新数据
updateDevices(filteredDevices, userList, sysUser, info1, index, count);
info1.setExportMsg("设备导入完成");
// 更新设备绑定历史数据
logErrorAndUpdateExportInfo(info1, empFinish,info1.getExportMsg(), count, count);
String sheetName = "设备绑定导入";
String fileName = sheetName + "_" + DateUtils.getDate("yyyyMMddHHmmss");
//上传ftp
String suffixName = ".xlsx";
// 重置指针
in.reset();
String url = MyUploadUtil.upload(in, MyUploadUtil.IMPORT_BIZ, fileName + suffixName);
info1.setExportUrl(url);
logErrorAndUpdateExportInfo(info1, empFinish,info1.getExportMsg(), count, count);
in.close();
} catch (Exception e) {
logErrorAndUpdateExportInfo(info1, errCode, "设备绑定导入失败,原因: " + e.getMessage(), index, count);
log.error("设备绑定导入失败,原因: {}", e.getMessage(), e);
} finally {
try {
in.close(); // 确保输入流被关闭
} catch (IOException e) {
// 日志记录关闭资源失败
log.error("日志记录关闭资源失败,原因: {}", e.getMessage(), e);
}
}
}
/**
* 获取excel内的数据
*
* @param in
* @param watchDevices
* @param info1
* @param errCode
* @return
*/
private boolean parseExcelToWatchDevices(ByteArrayInputStream in, List<WatchDevice> watchDevices, CommonExportsInfo info1, String errCode) {
try {
EasyExcel.read(in, WatchDeviceExcel.class, new PageReadListener<WatchDeviceExcel>(dataList -> {
for (WatchDeviceExcel deviceExcel : dataList) {
WatchDevice watchDevice = convertExcelToDevice(deviceExcel);
watchDevices.add(watchDevice);
}
})).sheet().headRowNumber(3).doRead();
return true;
} catch (Exception e) {
handleImportError(info1, errCode, "模板解析错误,请检查模板后重试");
// 记录详细异常信息
return false;
}
}
/**
* 过滤有效数据
*
* @param watchDevices
* @return
*/
private List<WatchDevice> filterValidDevices(List<WatchDevice> watchDevices) {
return watchDevices.stream()
.filter(device -> device.getWatchNo() != null && !device.getWatchNo().isEmpty())
.filter(device -> device.getBindUserId() != null && !device.getBindUserId().isEmpty())
.collect(Collectors.toList());
}
/**
* 更新设备数据
*
* @param list
* @param userList
* @param sysUser
* @param info1
* @param index
* @param count
*/
public void updateDevices(List<WatchDevice> list, List<SysUser> userList, LoginUser sysUser, CommonExportsInfo info1,
int index, int count) {
// 找出现有数据
List<WatchDevice> watchDeviceList = watchDeviceService.list(new QueryWrapper<WatchDevice>().in("watch_no", list.stream().map(WatchDevice::getWatchNo).collect(Collectors.toList())));
// 构造需要更新的工具数据
List<WatchDevice> updateList = new ArrayList<>();
for (WatchDevice watchDevice : list) {
WatchDevice device =
watchDeviceList.stream().filter(item -> item.getWatchNo().equals(watchDevice.getWatchNo())).findFirst().orElse(null);
if (device != null) {
WatchDevice updatedWatchDevice = new WatchDevice();
SysUser user =
userList.stream().filter(sysuser -> cleanIdCard(sysuser.getIdCard()).equals(cleanIdCard(watchDevice.getBindUserId()))).findFirst().orElse(null);
if (user == null){
// 未找到该用户 跳过
continue;
}
updatedWatchDevice.setId(device.getId());
updatedWatchDevice.setWatchNo(watchDevice.getWatchNo());
updatedWatchDevice.setBindUserId(user.getId());
updatedWatchDevice.setBindDate(watchDevice.getBindDate()==null?new Date():watchDevice.getBindDate());
updatedWatchDevice.setUpdateDate(new Date());
updatedWatchDevice.setUpdateBy(sysUser.getId());
updatedWatchDevice.setDeptId(device.getDeptId());
updatedWatchDevice.setOrgCode(device.getOrgCode());
updateList.add(updatedWatchDevice);
}
info1.setHandleMsg(index + "/" + count);
GlobalUtils.setFeignToken();
sysBaseAPI.updateExportsInfo(info1);
index++;
}
// 构造需要更新的历史数据
List<WatchBindHis> watchBindHisList = updateBindHis(list, userList, sysUser, info1);
// 根据工具编号分组
Map<String, List<WatchBindHis>> watchBindHisMap = watchBindHisList.stream().collect(Collectors.groupingBy(WatchBindHis::getWatchNo));
for (WatchDevice watchDevice : updateList) {
watchDeviceService.saveOrUpdate(watchDevice);
List<WatchBindHis> watchBindHis = watchBindHisMap.get(watchDevice.getWatchNo());
if (CollectionUtils.isNotEmpty(watchBindHis)) {
watchBindHisService.saveOrUpdateBatch(watchBindHis);
}
}
}
/**
* 构造需要更新的历史数据
* @param list
* @param userList
* @param sysUser
* @param info1
*/
private List<WatchBindHis> updateBindHis(List<WatchDevice> list, List<SysUser> userList, LoginUser sysUser,
CommonExportsInfo info1) {
// 先查询未解绑的数据
LambdaQueryWrapper<WatchBindHis> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.in(WatchBindHis::getWatchNo,
list.stream().map(WatchDevice::getWatchNo).collect(Collectors.toList()))
.and(wrapper -> wrapper.isNull(WatchBindHis::getBindEndDate));
List<WatchBindHis> noHisList = watchBindHisService.list(queryWrapper);
List<WatchBindHis> dataList = new ArrayList<>();
List<String> noImportList = new ArrayList<>();
for (WatchDevice watchDevice : list) {
WatchBindHis watchBindHis = noHisList.stream().filter(noHis -> noHis.getWatchNo().equals(watchDevice.getWatchNo())).findFirst().orElse(null);
SysUser user =
userList.stream().filter(sysuser -> sysuser.getIdCard().equals(watchDevice.getBindUserId())).findFirst().orElse(null);
if (user == null){
// 未找到该用户 跳过
noImportList.add(watchDevice.getBindUserId());
continue;
}
if (watchBindHis != null) {
if (!watchBindHis.getBindUserId().equals(user.getId())) {
// 不等于 代表换人了 需要解绑旧用户 插入新用户
watchBindHis.setBindEndDate(new Date());
dataList.add(watchBindHis);
addDataOne(watchDevice,dataList,sysUser,user);
}else {
// 等于 给出提示
info1.setExportMsg(info1.getExportMsg()+",用户:" + watchDevice.getBindRealName() + "已绑定该工具");
}
} else {
// 没匹配到 代表没有绑定数据 新增一条
addDataOne(watchDevice,dataList,sysUser,user);
}
}
if (CollectionUtils.isNotEmpty(noImportList)){
for (String s : noImportList) {
info1.setExportMsg(info1.getExportMsg()+",未找到身份证号码为:" + s + "的用户");
}
}
return dataList;
}
/**
* 添加数据
* @param watchDevice
* @param dataList
* @param sysUser
* @param user
*/
private void addDataOne(WatchDevice watchDevice,List<WatchBindHis> dataList,LoginUser sysUser,SysUser user){
WatchBindHis addHis = new WatchBindHis();
addHis.setWatchNo(watchDevice.getWatchNo());
addHis.setBindDate(watchDevice.getBindDate()==null?new Date():watchDevice.getBindDate());
addHis.setCreateDate(new Date());
addHis.setCreateBy(sysUser.getId());
addHis.setBindUserId(user.getId());
if (user.getDepart()!=null && StrUtil.isNotBlank(user.getDepart().getOrgCode())){
addHis.setDeptId(user.getDepart().getId());
addHis.setOrgCode(user.getDepart().getOrgCode());
}
dataList.add(addHis);
}
private String cleanIdCard(String idCard) {
return idCard.toUpperCase().replaceAll("[^A-Z0-9]", "");
}
// 用于记录错误和更新导出信息的方法
private void logErrorAndUpdateExportInfo(CommonExportsInfo info1, String errCode, String errorMessage, int index, int count) {
// 记录错误信息到日志系统
info1.setExportStatus(errCode);
info1.setHandleMsg(index + "/" + count);
info1.setHandleEndTime(new Date());
info1.setExportMsg(errorMessage);
GlobalUtils.setFeignToken();
sysBaseAPI.updateExportsInfo(info1);
}
private WatchDevice convertExcelToDevice(WatchDeviceExcel deviceExcel) {
WatchDevice watchDevice = new WatchDevice();
watchDevice.setWatchNo(deviceExcel.getWatchNo());
watchDevice.setBindUserId(deviceExcel.getIdCard());
watchDevice.setBindRealName(deviceExcel.getRealName());
watchDevice.setBindDate(deviceExcel.getBindDate());
return watchDevice;
}
}
@@ -0,0 +1,454 @@
package com.renkang.watch.controller;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.renkang.watch.bean.request.DepartStatsFilter;
import com.renkang.watch.entity.DeptStatisticData;
import com.renkang.watch.entity.WatchBindHis;
import com.renkang.watch.manager.WatchCloudManager;
import com.renkang.watch.mapper.WatchUserDataMapper;
import com.renkang.watch.service.IDeptStatisticDataService;
import com.renkang.watch.service.IWatchBindHisService;
import com.renkang.watch.service.IWatchDataService;
import com.renkang.watch.service.IWatchDeviceService;
import com.renkang.watch.vo.dept.DeptData;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.common.util.RedisUtil;
import org.jeecg.global.GlobalUtils;
import org.jeecg.modules.manager.ISysCache;
import org.jeecg.modules.system.entity.SysDepart;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
import java.util.Date;
import java.util.Optional;
/**
* @Description: dept_statistic_data
* @Author: jeecg-boot
* @Date: 2023-11-09
* @Version: V1.0
*/
@Tag(name = "dept_statistic_data")
@RestController
@RequestMapping("/watch/deptStatisticData")
@Slf4j
public class DeptStatisticDataController extends JeecgController<DeptStatisticData, IDeptStatisticDataService> {
@Autowired
private IDeptStatisticDataService deptStatisticDataService;
@Autowired
private ISysCache sysCache;
@Autowired
private RedisUtil redisUtil;
@Autowired
private WatchCloudManager watchCloudManager;
@Autowired
private WatchUserDataMapper watchUserDataMapper;
@Autowired
private IWatchDeviceService watchDeviceService;
@Autowired
private IWatchBindHisService watchBindHisService;
@Autowired
private IWatchDataService watchDataService;
/**
* 分页列表查询
*
* @param deptStatisticData
* @param pageNo
* @param pageSize
* @return
*/
//@AutoLog(value = "dept_statistic_data-分页列表查询")
@Operation(summary = "dept_statistic_data-分页列表查询", description = "dept_statistic_data-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<DeptStatisticData>> queryPageList(DeptStatisticData deptStatisticData,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
// QueryWrapper<DeptStatisticData> queryWrapper = QueryGenerator.initQueryWrapper(deptStatisticData, req.getParameterMap());
LambdaQueryWrapper<DeptStatisticData> wrapper = Wrappers.lambdaQuery();
LoginUser loginUser = GlobalUtils.getLoginUser();
if (StrUtil.isNotBlank(loginUser.getDepartCodes())) {//如果不为空,就以管理部门为准
deptStatisticData.setOrgCode(loginUser.getDepartCodes());//组装权限,先这么着,后面再改
}
if (StrUtil.isNotBlank(deptStatisticData.getOrgCode())) {
wrapper.eq(DeptStatisticData::getOrgCode, deptStatisticData.getOrgCode());
}
if (StrUtil.isNotBlank(deptStatisticData.getOrgCodeLeaf())) {
wrapper.eq(DeptStatisticData::getOrgCodeLeaf, deptStatisticData.getOrgCodeLeaf());
}
if (ObjectUtil.isNotNull(deptStatisticData.getDataDate())) {
wrapper.eq(DeptStatisticData::getDataDate, deptStatisticData.getDataDate());
}
wrapper.orderByDesc(DeptStatisticData::getDataDate);
Page<DeptStatisticData> page = new Page<DeptStatisticData>(pageNo, pageSize);
IPage<DeptStatisticData> pageList = deptStatisticDataService.page(page, wrapper);
if (CollectionUtil.isNotEmpty(pageList.getRecords())) {
pageList.getRecords().stream().forEach(r -> {
r.setSpoErrorNum(Optional.ofNullable(r.getSpoErrorNum()).orElse(0));
r.setTempErrorNum(Optional.ofNullable(r.getTempErrorNum()).orElse(0));
r.setStressErrorNum(Optional.ofNullable(r.getStressErrorNum()).orElse(0));
r.setHeartRateErrorNum(Optional.ofNullable(r.getHeartRateErrorNum()).orElse(0));
if (StrUtil.isNotBlank(r.getOrgCode())) {
SysDepart unitName = sysCache.getDepartByOrgCode(r.getOrgCode());
if (ObjectUtil.isNotNull(unitName)) {
r.setOrgName(unitName.getDepartName());
}
}
if (StrUtil.isNotBlank(r.getOrgCodeLeaf())) {
SysDepart deptName = sysCache.getDepartByOrgCode(r.getOrgCodeLeaf());
if (ObjectUtil.isNotNull(deptName)) {
r.setDeptName(deptName.getDepartName());
}
}
});
}
return Result.OK(pageList);
}
/**
* 应急大屏副屏根据单位查数据
*
* @param deptStatisticData
* @return
*/
//@AutoLog(value = "dept_statistic_data-分页列表查询")
@Operation(summary = "应急大屏副屏根据单位查数据", description = "应急大屏副屏根据单位查数据")
@GetMapping(value = "/listByorgCode")
public Result<DeptStatisticData> listByorgCode(DeptStatisticData deptStatisticData) {
String key = "departUserNum:";
if (StrUtil.isNotEmpty(deptStatisticData.getOrgCode())) {
key = key + deptStatisticData.getOrgCode();
}
if (StrUtil.isNotEmpty(deptStatisticData.getOrgCodeLeaf())) {
key = key + deptStatisticData.getOrgCodeLeaf();
}
String userNum = "0";
if (redisUtil.hasKey(key)) {
userNum = (String) redisUtil.get(key);
}
DeptStatisticData statisticData = new DeptStatisticData();
statisticData.setUserCount(Integer.valueOf(userNum));
String allUserNum = "0";
if (StrUtil.isNotEmpty(deptStatisticData.getOrgCode())) {
allUserNum = watchDeviceService.selectWatchDeviceUserNum(deptStatisticData.getOrgCode());
}
if (StrUtil.isNotEmpty(deptStatisticData.getOrgCodeLeaf())) {
allUserNum = watchBindHisService.selectDepartWatchDeviceUserNum(deptStatisticData.getOrgCodeLeaf());
}
statisticData.setAllotDeviceNum(Integer.valueOf(allUserNum));
if (StrUtil.isNotEmpty(deptStatisticData.getOrgCode())) {
SysDepart unitName = sysCache.getDepartByOrgCode(deptStatisticData.getOrgCode());
statisticData.setOrgName(unitName.getDepartName());
statisticData.setDeptId(unitName.getId());
}
if (StrUtil.isNotEmpty(deptStatisticData.getOrgCodeLeaf())) {
SysDepart secondDepartOrgCode = sysCache.getDepartByOrgCode(GlobalUtils.getSecondDepartOrgCode(deptStatisticData.getOrgCodeLeaf()));
statisticData.setOrgName(secondDepartOrgCode.getDepartName());
SysDepart thridDepartOrgCode = sysCache.getDepartByOrgCode(GlobalUtils.getThirdDepartOrgCode(deptStatisticData.getOrgCodeLeaf()));
statisticData.setDeptName(thridDepartOrgCode.getDepartName());
statisticData.setDeptId(thridDepartOrgCode.getId());
}
int sevenNum = watchDataService.selectSevenActive(StrUtil.isNotEmpty(deptStatisticData.getOrgCode()) ? deptStatisticData.getOrgCode() : deptStatisticData.getOrgCodeLeaf());
int thirtyNum = watchDataService.selectThirtyActive(StrUtil.isNotEmpty(deptStatisticData.getOrgCode()) ? deptStatisticData.getOrgCode() : deptStatisticData.getOrgCodeLeaf());
statisticData.setSevenDayNum(sevenNum);
statisticData.setThirtyDayNum(thirtyNum);
return Result.OK(statisticData);
}
/**
* 添加
*
* @param deptStatisticData
* @return
*/
@AutoLog(value = "dept_statistic_data-添加")
@Operation(summary = "dept_statistic_data-添加", description = "dept_statistic_data-添加")
@RequiresPermissions("watch:dept_statistic_data:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody DeptStatisticData deptStatisticData) {
deptStatisticDataService.save(deptStatisticData);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param deptStatisticData
* @return
*/
@AutoLog(value = "dept_statistic_data-编辑")
@Operation(summary = "dept_statistic_data-编辑", description = "dept_statistic_data-编辑")
@RequiresPermissions("watch:dept_statistic_data:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
public Result<String> edit(@RequestBody DeptStatisticData deptStatisticData) {
deptStatisticDataService.updateById(deptStatisticData);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "dept_statistic_data-通过id删除")
@Operation(summary = "dept_statistic_data-通过id删除", description = "dept_statistic_data-通过id删除")
@RequiresPermissions("watch:dept_statistic_data:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
deptStatisticDataService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "dept_statistic_data-批量删除")
@Operation(summary = "dept_statistic_data-批量删除", description = "dept_statistic_data-批量删除")
@RequiresPermissions("watch:dept_statistic_data:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
this.deptStatisticDataService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "dept_statistic_data-通过id查询")
@Operation(summary = "dept_statistic_data-通过id查询", description = "dept_statistic_data-通过id查询")
@GetMapping(value = "/queryById")
public Result<DeptStatisticData> queryById(@RequestParam(name = "id", required = true) String id) {
DeptStatisticData deptStatisticData = deptStatisticDataService.getById(id);
if (deptStatisticData == null) {
return Result.error("未找到对应数据");
}
return Result.OK(deptStatisticData);
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequiresPermissions("watch:dept_statistic_data:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, DeptStatisticData.class);
}
/**
* 部门数据详情
* @param orgCode
* @param start
* @param end
* @param pageNo
* @param pageSize
* @return
*/
@RequestMapping(value = "/getDeptDetail", method = RequestMethod.GET)
public Result<IPage<DeptData>> getDeptDetail(DepartStatsFilter filter) {
return Result.OK(deptStatisticDataService.getDeptDetail(filter));
}
/**
* 部门统计数据
* @param orgCode
* @param start
* @param end
* @param pageNo
* @param pageSize
* @return
*/
@RequestMapping(value = "/getDeptData", method = RequestMethod.GET)
public Result<?> getDeptData(DepartStatsFilter filter) {
return Result.OK(deptStatisticDataService.getDeptData(filter));
}
/**
* 部门数据导出
* @param request
* @param response
* @param orgCode
* @param start
* @param end
* @return
*/
// @RequestMapping(value = "/exportDeptStatData", method = RequestMethod.GET)
public ModelAndView exportDeptStatData(HttpServletRequest request, HttpServletResponse response,
String orgCode,
String orgCodeLeaf,
@RequestParam("start") @DateTimeFormat(pattern="yyyy-MM-dd") Date start,
@RequestParam("end") @DateTimeFormat(pattern="yyyy-MM-dd") Date end) {
ModelAndView modelAndView = deptStatisticDataService.exportXls(response, request, orgCode,orgCodeLeaf, start, end);
return modelAndView;
}
/**
* 部门数据异步导出
* @param orgCode
* @param orgCodeLeaf
* @param start
* @param end
* @return
*/
@GetMapping(value = "/exportDeptStatData")
public Result<String> exportDeptStatDataAsync(DepartStatsFilter filter) {
deptStatisticDataService.exportDeptStatDataAsync(filter);
return Result.OK("导出结果请在个导出记录查看");
}
/**
* 明细数据导出
* @param request
* @param response
* @param orgCode
* @param start
* @param end
* @return
*/
// @RequestMapping(value = "/exportDeptDetail", method = RequestMethod.GET)
public Result<?> exportDeptDetail(HttpServletRequest request, HttpServletResponse response,String orgCode,
@RequestParam("start") @DateTimeFormat(pattern="yyyy-MM-dd") Date start,
@RequestParam("end") @DateTimeFormat(pattern="yyyy-MM-dd") Date end){
deptStatisticDataService.exportDeptDetail(response, request, orgCode, start, end);
return null;
}
/**
* 明细数据异步导出
* @param orgCodeLeaf
* @param start
* @param end
* @return
*/
@RequestMapping(value = "/exportDeptDetail", method = RequestMethod.GET)
public Result<?> exportDeptDetailAsync(DepartStatsFilter filter) {
deptStatisticDataService.exportDeptDetailAsync(filter);
return Result.OK("导出结果请在个用户明细导出记录查看");
}
@RequestMapping(value = "/getDeptDataNew", method = RequestMethod.GET)
public Result<IPage<WatchBindHis>> getDeptDataNew(String orgCode,
String orgCodeLeaf,
@RequestParam("start") @DateTimeFormat(pattern="yyyy-MM-dd") Date start,
@RequestParam("end") @DateTimeFormat(pattern="yyyy-MM-dd") Date end,
Integer pageNo, Integer pageSize) {
IPage<WatchBindHis> dataList = deptStatisticDataService.getDeptDataNew(orgCode, orgCodeLeaf, start, end, pageNo, pageSize);
return Result.OK(dataList);
}
@RequestMapping(value = "/getDeptDetailNew", method = RequestMethod.GET)
public Result<IPage<WatchBindHis>> getDeptDetailNew(String orgCode,
@RequestParam("start") @DateTimeFormat(pattern="yyyy-MM-dd") Date start,
@RequestParam("end") @DateTimeFormat(pattern="yyyy-MM-dd") Date end,
Integer pageNo, Integer pageSize) {
IPage<WatchBindHis> deptDetail = deptStatisticDataService.getDeptDetailNew(orgCode, start, end, pageNo, pageSize);
return Result.OK(deptDetail);
}
@GetMapping(value = "/exportDeptStatDataSyncNew")
public Result<String> exportDeptStatDataSyncNew(String orgCode,
String orgCodeLeaf,
@RequestParam("start") @DateTimeFormat(pattern="yyyy-MM-dd") Date start,
@RequestParam("end") @DateTimeFormat(pattern="yyyy-MM-dd") Date end) {
try {
deptStatisticDataService.exportDeptStatDataSyncNew(orgCode,orgCodeLeaf,start,end);
return Result.OK("导出结果请在个用户导出记录查看");
} catch (Exception e) {
return Result.error(e.getMessage());
}
}
@RequestMapping(value = "/exportDeptDetailAsyncNew", method = RequestMethod.GET)
public Result<?> exportDeptDetailAsyncNew(String orgCodeLeaf,
@RequestParam("start") @DateTimeFormat(pattern="yyyy-MM-dd") Date start,
@RequestParam("end") @DateTimeFormat(pattern="yyyy-MM-dd") Date end){
deptStatisticDataService.exportDeptDetailAsyncNew(orgCodeLeaf, start, end);
return Result.OK("导出结果请在个用户明细导出记录查看");
}
/**
* 根据二级单位code获取周报数据
* 样例:本周,给公司机关健康中、高风险员工发放智能健康监测终端1台,共计发放733台,近2周终端数据不活跃的有214人。
* 本周,终端预警30人次,无心脑血管疾病突发状况出现;
* 本周,心率平均值为73次/分,血氧平均值为98%,压力平均值为52,运动步数平均值为9876步/天,体温平均值为36.5℃。
* 2024.06.04
* @param orgCode
* @return
*/
@Operation(summary = "部门周报", description = "部门周报")
@GetMapping("/getWeeklyNewspaper")
public Result<String> getWeeklyNewspaper(@RequestParam(value = "orgCode") String orgCode){
return Result.OK("操作成功!",deptStatisticDataService.getWeeklyNewspaper(orgCode));
}
}
@@ -0,0 +1,96 @@
package com.renkang.watch.controller;
import com.renkang.watch.task.*;
import com.renkang.watch.vo.UserData.SyncDataReq;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.springframework.batch.core.JobParametersInvalidException;
import org.springframework.batch.core.repository.JobExecutionAlreadyRunningException;
import org.springframework.batch.core.repository.JobInstanceAlreadyCompleteException;
import org.springframework.batch.core.repository.JobRestartException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
/**
*增量数据同步
*/
@RequestMapping("/sync/")
@Slf4j
@RestController
public class SyncUserStatController {
@Autowired
private SyncUserStatJob syncUserStatJob;
@Autowired
private SyncDeptData syncDeptStatData;
@Autowired
private SynWatchDataJob synWatchDataJob;
@Autowired
private WatchDataHandler watchDataHandler;
/**
* 用户数据导入
* @param req
* @return
*/
@PostMapping("syncUserStatData")
public Result<String> syncUserStatData(@RequestBody SyncDataReq req){
return syncUserStatJob.syncUserStatData(req);
}
/**
* 部门增量数据
* @param req
* @return
*/
@PostMapping("syncDeptStatData")
public Result<String> syncDeptStatData(@RequestBody SyncDataReq req){
return syncDeptStatData.syncDeptStatData(req);
}
/**
* 用户数据初始化
* @param
* @return
*/
@PostMapping("initStatData")
public Result<String> initStatData(){
return syncUserStatJob.initStatData();
}
/**
* 部门数据初始化
* @param req
* @return
*/
@PostMapping("initDeptStatData")
public Result<Map<Object, Object>> initDeptStatData(){
return syncDeptStatData.initDeptStatDataNew();
}
/**
* 增量测试
* @param req
* @return
*/
@PostMapping("test")
public void test() throws JobInstanceAlreadyCompleteException, JobExecutionAlreadyRunningException, JobParametersInvalidException, JobRestartException {
synWatchDataJob.syncWatchData();
}
@PostMapping("recoverData")
public Result<Void> recoverData(@RequestBody RecoverData recoverData) {
watchDataHandler.recoverData(recoverData);
return Result.OK();
}
}
@@ -0,0 +1,115 @@
package com.renkang.watch.controller;
import com.renkang.watch.data.model.dto.UserRecordSportsDTO;
import com.renkang.watch.entity.UserRecordSportsInfo;
import com.renkang.watch.vo.PlayDataDetailVO;
import com.renkang.watch.dto.QueryUserPlaySignParam;
import com.renkang.watch.entity.UserRecordSportsVO;
import com.renkang.watch.service.UserRecordSportsService;
import com.renkang.watch.vo.PlayDataDayStatisticVO;
import com.renkang.watch.vo.UserPlaySignVO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.jeecg.common.api.vo.Result;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.List;
import java.util.concurrent.ExecutionException;
/**
* @Description: 用户自主记录运动
* @Author: feng
* @Date: 2025-2-19
* @Version: V1.0
*/
@Tag(name = "运动/用户自主记录运动")
@RestController
@RequestMapping("/sports/record/")
@RequiredArgsConstructor
public class UserRecordSportsController {
private final UserRecordSportsService userRecordSportsService;
@GetMapping("/today")
@Operation(summary = "查询用户当日自记运动记录", description = "查询用户当日自记运动记录")
public Result<List<UserRecordSportsVO>> queryUserTodaySportsList(@RequestParam(name = "dateStr",required = false) @Parameter(description = "日期(yyyy-MM-dd不传默认查当天)") String dateStr) {
return Result.OK(userRecordSportsService.queryUserTodaySportsList(dateStr));
}
@PostMapping("/add")
@Operation(summary = "新增自记运动记录", description = "新增自记运动记录")
public Result<String> addSportsRecord(@RequestBody @Valid UserRecordSportsDTO userRecordSportsDTO) throws ExecutionException, InterruptedException {
return Result.OK(userRecordSportsService.addSportsRecord(userRecordSportsDTO));
}
@GetMapping("/todayDetail")
@Operation(summary = "查询某天某种运动的运动记录", description = "查询某天某种运动的运动记录")
public Result<List<UserRecordSportsInfo>> todayDetail(@RequestParam(name = "code") @Parameter(description = "运动类型编码") Integer code,
@RequestParam(name = "dateStr",required = false) @Parameter(description = "日期(不传默认查今天)") String dateStr) {
return Result.OK(userRecordSportsService.todayDetail(code,dateStr));
}
@PutMapping("/update")
@Operation(summary = "修改自记运动记录", description = "修改自记运动记录")
public Result<String> updateSportsRecord(@RequestBody @Valid UserRecordSportsDTO userRecordSportsDTO) {
userRecordSportsService.updateSportsRecord(userRecordSportsDTO);
return Result.OK("操作成功!");
}
@DeleteMapping("/delete")
@Operation(summary = "删除自记运动记录", description = "删除自记运动记录")
public Result<String> deleteSportsRecord(@RequestParam(name = "id") @Parameter(description = "记录ID") Long id) {
userRecordSportsService.deleteSportsRecord(id);
return Result.OK("操作成功!");
}
@GetMapping("/suggest")
@Operation(summary = "根据需要消耗的热量查询建议运动时长", description = "根据需要消耗的热量查询建议运动时长")
public Result<List<UserRecordSportsVO>> querySuggestSports(@RequestParam(name = "energy") @Parameter(description = "消耗热量值") Double energy) {
return Result.OK(userRecordSportsService.querySuggestSports(energy));
}
@PostMapping("/playSign")
@Operation(summary = "查询用户当日运动打卡数据(目前供干预中体重管理功能使用)", description = "查询用户当日运动打卡数据(目前供干预中体重管理功能使用)")
public Result<List<UserPlaySignVO>> queryPlaySignUser(@RequestBody QueryUserPlaySignParam signUserParam){
return Result.OK(userRecordSportsService.queryPlaySignUser(signUserParam));
}
/**
* 该接口目前只有干预体重管理数据归档的定时任务中使用
*/
@PostMapping("/playInfo")
@Operation(summary = "查询用户历史某日运动数据明细(目前供干预中体重管理功能使用)", description = "查询用户历史某日运动数据明细(目前供干预中体重管理功能使用)")
public Result<List<PlayDataDetailVO>> queryUserHistoryPlayInfo(@RequestParam(name = "date") @Parameter(description = "日期(yyyy-mm-dd)") String date){
return Result.OK(userRecordSportsService.queryUserHistoryPlayInfo(date));
}
/**
* 接口废弃, 现从干预服务中获取用户运动日历数据
*/
@Operation(summary = "获取用户运动日历数据(目前供干预中体重管理功能使用)", description = "获取用户运动日历数据(目前供干预中体重管理功能使用)")
@GetMapping(value = "/playData")
@Deprecated
public Result<List<PlayDataDayStatisticVO>> playDataDayStatistic(@RequestParam(name = "startDate") @Parameter(description = "起始日期(yyyy-mm-dd)") String startDate,
@RequestParam(name = "endDate") @Parameter(description = "起始日期(yyyy-mm-dd)") String endDate,
@RequestParam(name = "userId",required = false) @Parameter(description = "默认从token中获取") String userId,
@RequestParam(name = "cardNo",required = false) @Parameter(description = "默认从token中获取") String cardNo){
return Result.OK(userRecordSportsService.playDataDayStatistic(startDate,endDate,userId,cardNo));
}
@Operation(summary = "获取用户当天运动详情(目前供干预中体重管理功能使用)", description = "获取用户当天运动详情(目前供干预中体重管理功能使用)")
@GetMapping(value = "/playDataDetail")
public Result<List<PlayDataDetailVO>> playDataDayDetail(@RequestParam(name = "date") @Parameter(description = "日期(yyyy-mm-dd)") String date){
return Result.OK(userRecordSportsService.playDataDayDetail(date));
}
@Operation(summary = "获取指定用户当天运动详情(目前供干预中体重管理功能使用)", description = "获取指定用户当天运动详情(目前供干预中体重管理功能使用)")
@GetMapping(value = "/playDataDayDetailByUserId")
public Result<List<PlayDataDetailVO>> playDataDayDetailByUserId(@RequestParam(name = "date") @Parameter(description = "日期(yyyy-mm-dd)") String date,
@RequestParam(name = "userId",required = false) @Parameter(description = "用户ID") String userId,
@RequestParam(name = "idCard",required = false) @Parameter(description = "身份证号") String idCard){
return Result.OK(userRecordSportsService.playDataDayDetailByUserId(date, userId,idCard));
}
}
@@ -0,0 +1,48 @@
package com.renkang.watch.controller;
import com.renkang.watch.dto.QueryWeChatSportParam;
import com.renkang.watch.entity.UserWeChatSportsDay;
import com.renkang.watch.service.UserWeChatSportsDayService;
import com.renkang.watch.vo.WeChatStepVO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.jeecg.common.api.vo.Result;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.validation.Valid;
import java.util.List;
/**
* @Description: 用户微信数据控制器
* @Author: feng
* @Date: 2025-3-09
* @Version: V1.0
*/
@Tag(name = "运动/用户微信步数")
@RestController
@RequestMapping("/sports/weChat/")
@RequiredArgsConstructor
public class UserWeChatSportsDayController {
private final UserWeChatSportsDayService weChatSportsDayService;
/**
* 上传微信步数 (目前由system服务中的一个接口远程调用)
* @param dataList 近一月的步数数据
*/
@PostMapping("/upload")
@Operation(summary = "同步微信步数", description = "同步微信步数")
public Result<?> uploadUserWeChatStep(@RequestBody List<WeChatStepVO> dataList ) {
weChatSportsDayService.uploadUserWeChatStep(dataList);
return Result.OK();
}
@PostMapping("/findByScope")
@Operation(summary = "查询用户微信运动步数", description = "查询用户微信运动步数")
public Result<List<UserWeChatSportsDay>> findUserWeChatSportsScope(@Valid @RequestBody QueryWeChatSportParam param){
return Result.OK(weChatSportsDayService.findUserWeChatSportsScope(param));
}
}
@@ -0,0 +1,68 @@
package com.renkang.watch.controller;
import com.alibaba.fastjson.JSONObject;
import com.renkang.watch.service.IWatchDeviceService;
import com.renkang.watch.service.IWatchMonitorDataService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.api.ISysBaseAPI;
import org.jeecg.util.AjaxJson;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;
/**
* @author TianZi
* @date 2023/12/6 18:40
*/
@Tag(name = "手表/后台/手表事件")
@RestController
@RequestMapping("/watchApi")
@Slf4j
public class WatchApiController {
@Autowired
private IWatchMonitorDataService watchMonitorDataService;
@Autowired
private IWatchDeviceService watchDeviceService;
@PostMapping("/notice")
public AjaxJson notice(@RequestBody JSONObject json) {
return watchMonitorDataService.notice(json);
}
@GetMapping("/setData")
public AjaxJson setData() {
AjaxJson ajaxJson = new AjaxJson();
// 处理历史数据
watchMonitorDataService.setData();
ajaxJson.setSuccess(true);
return ajaxJson;
}
@PostMapping("/pushnotice")
@Operation(summary = "接收手表推送完成事件")
public AjaxJson pushnotice(@RequestBody JSONObject json) {
AjaxJson ajaxJson = new AjaxJson();
// watchUserDataService.synDcDataByWdTypeAll();
ajaxJson.setSuccess(true);
return ajaxJson;
}
@GetMapping(value = "getIdcardByWatchNo")
@Operation(summary = "根据手表编码获取最新的身份证号")
@ResponseBody
public Result<?> getIdcardByWatchNo(@RequestParam("watchNo") String watchNo) {
String idcard = watchDeviceService.getIdcardByWatchNo(watchNo);
Map<String ,String> map = new HashMap<>();
map.put("idcard",idcard);
return Result.ok(map);
}
}
@@ -0,0 +1,251 @@
package com.renkang.watch.controller;
import cn.hutool.core.util.StrUtil;
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.renkang.watch.bean.response.UserDataStat;
import com.renkang.watch.dto.WatchBindHisDTO;
import com.renkang.watch.entity.WatchBindHis;
import com.renkang.watch.service.IWatchBindHisService;
import com.renkang.watch.vo.WatchBindHisVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.aspect.annotation.PermissionData;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.modules.manager.ISysCache;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Arrays;
/**
* @Description: watch_bind_his
* @Author: jeecg-boot
* @Date: 2023-08-08
* @Version: V1.0
*/
@Tag(name = "手表/后台/工具管理/手表绑定历史")
@RestController
@RequestMapping("/watch/watchBindHis")
@Slf4j
public class WatchBindHisController extends JeecgController<WatchBindHis, IWatchBindHisService> {
@Autowired
private IWatchBindHisService watchBindHisService;
@Autowired
private ISysCache sysCache;
/**
* 拥有手表的用户列表
* @param user 条件
* @param pageNo 页码
* @param pageSize 条数
* @return bean
*/
@GetMapping(value = "/listUserHaveWatch")
public Result<IPage<UserDataStat>> listUserHaveWatch(UserDataStat user,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
IPage<UserDataStat> pageList = watchBindHisService.listUserHaveWatch(pageNo, pageSize, user);
return Result.OK(pageList);
}
/**
* 绑定信息
* @param userId 用户id
* @return bean
*/
@GetMapping(value = "bindInfoByUser")
public Result<WatchBindHis> bindInfoByUser(@RequestParam String userId) {
if (StrUtil.isBlank(userId)) {
return Result.error("参数为空");
}
LambdaQueryWrapper<WatchBindHis> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(WatchBindHis::getBindUserId, userId)
.orderByDesc(WatchBindHis::getBindDate)
.last(" limit 1");
return Result.ok(watchBindHisService.getOne(queryWrapper));
}
/**
* 分页列表查询
* @param dto
* @return
*/
//@AutoLog(value = "watch_bind_his-分页列表查询")
@Operation(summary = "watch_bind_his-分页列表查询", description = "watch_bind_his-分页列表查询")
@GetMapping(value = "/list")
@PermissionData(pageComponent = "healthMonitor/healMonitorManage/monitorToll/bindRecords/bindRecords")
public Result<IPage<WatchBindHisVo>> queryPageList(WatchBindHisDTO dto) {
Page<WatchBindHisVo> page = new Page<>(dto.getPageNo(), dto.getPageSize());
IPage<WatchBindHisVo> pageList = watchBindHisService.queryPageList(page, dto);
return Result.OK(pageList);
}
/**
* 添加
*
* @param watchBindHis
* @return
*/
@AutoLog(value = "watch_bind_his-添加")
@Operation(summary = "watch_bind_his-添加", description = "watch_bind_his-添加")
@RequiresPermissions("watch:watch_bind_his:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody WatchBindHis watchBindHis) {
watchBindHisService.save(watchBindHis);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param watchBindHis
* @return
*/
@AutoLog(value = "watch_bind_his-编辑")
@Operation(summary = "watch_bind_his-编辑", description = "watch_bind_his-编辑")
@RequiresPermissions("watch:watch_bind_his:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
public Result<String> edit(@RequestBody WatchBindHis watchBindHis) {
watchBindHisService.updateById(watchBindHis);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "watch_bind_his-通过id删除")
@Operation(summary = "watch_bind_his-通过id删除", description = "watch_bind_his-通过id删除")
@RequiresPermissions("watch:watch_bind_his:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
watchBindHisService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "watch_bind_his-批量删除")
@Operation(summary = "watch_bind_his-批量删除", description = "watch_bind_his-批量删除")
@RequiresPermissions("watch:watch_bind_his:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
this.watchBindHisService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "watch_bind_his-通过id查询")
@Operation(summary = "watch_bind_his-通过id查询", description = "watch_bind_his-通过id查询")
@GetMapping(value = "/queryById")
public Result<WatchBindHis> queryById(@RequestParam(name = "id", required = true) String id) {
WatchBindHis watchBindHis = watchBindHisService.getById(id);
if (watchBindHis == null) {
return Result.error("未找到对应数据");
}
return Result.OK(watchBindHis);
}
/**
* 导出excel
* @param response
* @param request
* @param dto
* @return
* @throws IOException
*/
@RequiresPermissions("watch:watch_bind_his:exportXls")
@RequestMapping(value = "/exportXls")
@PermissionData(pageComponent = "healthMonitor/healMonitorManage/monitorToll/bindRecords/bindRecords")
public ModelAndView exportXls(HttpServletResponse response, HttpServletRequest request, WatchBindHisDTO dto) throws IOException {
return watchBindHisService.exportXls(response,request,dto,"绑定记录");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequiresPermissions("watch:watch_bind_his:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, WatchBindHis.class);
}
/**
* 更新orgCode
*/
@GetMapping(value = "/updateOrgCodeByDeptId")
public Result<Boolean> updateOrgCodeByDeptId(){
boolean b = watchBindHisService.updateOrgCodeByDeptId();
if(b){
return Result.OK("测试ok");
}
// if(CollectionUtil.isNotEmpty(list)){
// list.stream().forEach(r->{
// if(StrUtil.isNotBlank(r.getDeptId())){
// String deptId = r.getDeptId();
// SysDepart departById = sysCache.getDepartById(deptId);
// if(ObjectUtil.isNotNull(departById)){
// r.setOrgCode(departById.getOrgCode());
// }
// }
// });
// }
// System.out.println(list);
// watchBindHisService.updateBatchById(list);
return Result.error("测试异常");
}
/**
* 数据传输 运动数据
* @param user
* @param pageNo
* @param pageSize
* @return
*/
@GetMapping(value = "/selectWatchSportData")
public Result<IPage<WatchBindHisDTO>> selectWatchSportData(WatchBindHisDTO dto,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
IPage<WatchBindHisDTO> pageList = watchBindHisService.selectWatchSportData(pageNo, pageSize, dto);
return Result.OK(pageList);
}
@GetMapping(value = "/selectWatchSportDataUser")
public Result<WatchBindHisDTO> selectWatchSportDataUser(@RequestParam(name = "userId") String userId) {
return watchBindHisService.selectWatchSportDataUser(userId);
}
}
@@ -0,0 +1,324 @@
package com.renkang.watch.controller;
import cn.hutool.core.util.ObjUtil;
import com.renkang.watch.dto.WatchWarnDTO;
import com.renkang.watch.service.IWatchService;
import com.renkang.watch.vo.*;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.Date;
import java.util.List;
@Tag(name = "手表接口")
@RestController
@RequestMapping("/watchH5Api")
@Slf4j
public class WatchController {
@Autowired
private IWatchService watchService;
@Operation(summary = "首页信息", description = "首页信息")
@GetMapping(value = "/indexDataNew")
public Result<WatchIndexVo> getIndexData(@RequestParam("userId") String userId) {
WatchIndexVo vo = watchService.getIndex(userId);
return Result.OK("成功", vo);
}
//-------------------------------------bustiw---------------------------------------------------\\
@Operation(summary = "获取日睡眠列表(新)", description = "获取日睡眠列表(新)")
@GetMapping(value = "/sleepNewDayData")
public Result<WatchH5SleepNewDayVo> getSleepNewAveDayVo(@RequestParam("userId") String userId,
@RequestParam("queryDate") @DateTimeFormat(pattern = "yyyy-MM-dd") Date queryDate) {
WatchH5SleepNewDayVo dayVo = watchService.getSleepNewDayVo(userId, queryDate, null);
return Result.OK("成功", dayVo);
}
@Operation(summary = "获取周睡眠列表(新)", description = "获取周睡眠列表(新)")
@GetMapping(value = "/sleepNewWeekData")
public Result<WatchH5SleepNewAveWeekVo> getSleepNewWeekData(@RequestParam("userId") String userId,
@RequestParam("queryDate") @DateTimeFormat(pattern = "yyyy-MM-dd") Date queryDate) {
WatchH5SleepNewAveWeekVo dayVo = watchService.getSleepNewWeekDayList(userId, queryDate);
return Result.OK("成功", dayVo);
}
@Operation(summary = "获取月睡眠列表(新)", description = "获取月睡眠列表(新)")
@GetMapping(value = "/sleepNewMonthData")
public Result<List<WatchH5SleepNewDayVo>> getSleepNewMonthData(@RequestParam("userId") String userId,
@RequestParam("queryDate") @DateTimeFormat(pattern = "yyyy-MM-dd") Date queryDate) {
List<WatchH5SleepNewDayVo> dayVo = watchService.getSleepNewMonthDayList(userId, queryDate);
return Result.OK("成功", dayVo);
}
@Operation(summary = "获取年睡眠列表(新)", description = "获取年睡眠列表(新)")
@GetMapping(value = "/sleepNewYearData")
public Result<List<WatchH5SleepNewMonthVo>> getSleepNewYearData(@RequestParam("userId") String userId,
@RequestParam("queryDate") @DateTimeFormat(pattern = "yyyy-MM-dd") Date queryDate
) {
List<WatchH5SleepNewMonthVo> dayVo = watchService.getSleepNewYearMonthList(userId, queryDate);
return Result.OK("成功", dayVo);
}
@Operation(summary = "获取日锻炼列表及运动列表", description = "获取日步数列表及运动列表")
@GetMapping(value = "/workoutDayDataAndExercise")
public Result<WatchH5WorkoutDayAndExerciseVo> stepsDayDataAndExercise(@RequestParam(value = "userId",required = false) String userId,
@RequestParam(value = "queryDate", required = false) @DateTimeFormat(pattern = "yyyy-MM-dd") Date queryDate) {
queryDate = ObjUtil.isEmpty(queryDate) ? new Date() : queryDate;
WatchH5WorkoutDayAndExerciseVo dayVo = watchService.workoutDayDataAndExercise(userId, queryDate);
return Result.OK("成功", dayVo);
}
@Operation(summary = "获取周锻炼列表及运动列表", description = "获取周锻炼列表及运动列表")
@GetMapping(value = "/workoutWeekDataAndExercise")
public Result<WatchH5WorkoutWeekAndExerciseVo> workoutWeekDataAndExercise(@RequestParam(value = "userId",required = false) String userId,
@RequestParam(value = "queryDate", required = false) @DateTimeFormat(pattern = "yyyy-MM-dd") Date queryDate) {
queryDate = ObjUtil.isEmpty(queryDate) ? new Date() : queryDate;
WatchH5WorkoutWeekAndExerciseVo weekVo = watchService.workoutWeekDataAndExercise(userId, queryDate);
return Result.OK("成功", weekVo);
}
//-------------------------------------步数---------------------------------------------------\\
@Operation(summary = "获取日步数列表及运动列表", description = "获取日步数列表及运动列表")
@GetMapping(value = "/stepsDayDataAndExercise")
public Result<WatchH5StepsDayAndExerciseVo> stepsDayDataAndExercise(@RequestParam(value = "userId",required = false) String userId,
@RequestParam(value = "wdType",required = false) String wdType,
@RequestParam(value = "queryDate", required = false) @DateTimeFormat(pattern = "yyyy-MM-dd") Date queryDate) {
queryDate = ObjUtil.isEmpty(queryDate) ? new Date() : queryDate;
WatchH5StepsDayAndExerciseVo dayVo = watchService.stepsDayDataAndExercise(userId, wdType, queryDate);
return Result.OK("成功", dayVo);
}
@Operation(summary = "获取周步数列表及运动列表", description = "获取周步数列表及运动列表")
@GetMapping(value = "/stepsWeekDataAndExercise")
public Result<WatchH5StepsWeekAndExerciseVo> stepsWeekDataAndExercise(@RequestParam(value = "userId",required = false) String userId,
@RequestParam(value = "queryDate", required = false) @DateTimeFormat(pattern = "yyyy-MM-dd") Date queryDate) {
queryDate = ObjUtil.isEmpty(queryDate) ? new Date() : queryDate;
WatchH5StepsWeekAndExerciseVo weekVo = watchService.stepsWeekDataAndExercise(userId, queryDate);
return Result.OK("成功", weekVo);
}
@Operation(summary = "获取日步数列表", description = "获取日步数列表")
@GetMapping(value = "/stepsDayData")
public Result<WatchH5StepsDayVo> stepsDayData(@RequestParam("userId") String userId,
@RequestParam("queryDate") @DateTimeFormat(pattern = "yyyy-MM-dd") Date queryDate) {
WatchH5StepsDayVo dayVo = watchService.getStepsDayVo(userId, queryDate, null);
return Result.OK("成功", dayVo);
}
@Operation(summary = "获取周步数列表", description = "获取周步数列表")
@GetMapping(value = "/stepsWeekData")
public Result<WatchH5StepsResultVO> getStepsWeekData(@RequestParam("userId") String userId,
@RequestParam("queryDate") @DateTimeFormat(pattern = "yyyy-MM-dd") Date queryDate) {
//查询本周列表
WatchH5StepsResultVO vo = watchService.getStepsWeekDayList(userId, queryDate);
return Result.OK("成功", vo);
}
@Operation(summary = "获取月步数列表", description = "获取月步数列表")
@GetMapping(value = "/stepsMonthData")
public Result<WatchH5StepsResultVO> stepsMonthData(@RequestParam("userId") String userId,
@RequestParam("queryDate") @DateTimeFormat(pattern = "yyyy-MM-dd") Date queryDate) {
//查询本月列表
WatchH5StepsResultVO vo = watchService.getStepsMonthDayList(userId, queryDate);
return Result.OK("成功", vo);
}
@Operation(summary = "获取年步数列表", description = "获取月步数列表")
@GetMapping(value = "/stepsYearData")
public Result<WatchH5StepsResultVO> stepsYearData(@RequestParam("userId") String userId,
@RequestParam("queryDate") @DateTimeFormat(pattern = "yyyy-MM-dd") Date queryDate) {
//查询本年列表
WatchH5StepsResultVO vo = watchService.getStepsYearDayList(userId, queryDate);
return Result.OK("成功", vo);
}
//-------------------------------------体温---------------------------------------------------\\
@Operation(summary = "获取日体温列表", description = "获取日体温列表")
@GetMapping(value = "/tempDayData")
public Result<WatchH5TempDayVo> getTempDayData(@RequestParam("userId") String userId,
@RequestParam("queryDate") @DateTimeFormat(pattern = "yyyy-MM-dd") Date queryDate) {
WatchH5TempDayVo dayVo = watchService.getTempDayVo(userId, queryDate, true);
return Result.OK("成功", dayVo);
}
@Operation(summary = "获取周体温列表")
@GetMapping(value = "/tempWeekData")
public Result<WatchH5TempWeekVo> getTempWeekData(@RequestParam("userId") String userId,
@RequestParam("queryDate") @DateTimeFormat(pattern = "yyyy-MM-dd") Date queryDate) {
//查询本周列表
WatchH5TempWeekVo weekList = watchService.getTempWeekDayList(userId, queryDate);
return Result.OK("成功", weekList);
}
@Operation(summary = "获取月体温列表", description = "获取月体温列表")
@GetMapping(value = "/tempMonthData")
public Result<WatchH5TempWeekVo> tempMonthData(@RequestParam("userId") String userId,
@RequestParam("queryDate") @DateTimeFormat(pattern = "yyyy-MM-dd") Date queryDate) {
//查询本月列表
WatchH5TempWeekVo list = watchService.getTempMonthDayList(userId, queryDate);
return Result.OK("成功", list);
}
@Operation(summary = "获取年体温列表", description = "获取年体温列表")
@GetMapping(value = "/tempYearData")
public Result<WatchH5TempWeekVo> tempYearData(@RequestParam("userId") String userId,
@RequestParam("queryDate") @DateTimeFormat(pattern = "yyyy-MM-dd") Date queryDate) {
//查询本年列表
WatchH5TempWeekVo list = watchService.getTempYearDayList(userId, queryDate);
return Result.OK("成功", list);
}
//-------------------------------------心率---------------------------------------------------\\
@Operation(summary = "获取日心率列表", description = "获取日心率列表")
@GetMapping(value = "/heartRateDayData")
public Result<WatchH5HeartRateDayVo> getheartRateDayData(@RequestParam("userId") String userId,
@RequestParam("queryDate") @DateTimeFormat(pattern = "yyyy-MM-dd") Date queryDate) {
WatchH5HeartRateDayVo dayVo = watchService.getHeartRateDayVo(userId, queryDate, true);
return Result.OK("成功", dayVo);
}
@Operation(summary = "获取周心率列表", description = "获取周心率列表")
@GetMapping(value = "/heartRateWeekData")
public Result<WatchH5HeartRateWeekVo> getheartRateWeekData(@RequestParam("userId") String userId,
@RequestParam("queryDate") @DateTimeFormat(pattern = "yyyy-MM-dd") Date queryDate) {
//查询本周列表
WatchH5HeartRateWeekVo dayVo = watchService.getHeartRateWeekDayList(userId, queryDate);
return Result.OK("成功", dayVo);
}
@Operation(summary = "获取月心率列表", description = "获取月心率列表")
@GetMapping(value = "/heartRateMonthData")
public Result<WatchH5HeartRateWeekVo> heartRateMonthData(@RequestParam("userId") String userId,
@RequestParam("queryDate") @DateTimeFormat(pattern = "yyyy-MM-dd") Date queryDate) {
//查询本月列表
WatchH5HeartRateWeekVo vo = watchService.getHeartRateMonthDayList(userId, queryDate);
return Result.OK("成功", vo);
}
@Operation(summary = "获取年心率列表", description = "获取年心率列表")
@GetMapping(value = "/heartRateYearData")
public Result<WatchH5HeartRateWeekVo> heartRateYearData(@RequestParam("userId") String userId,
@RequestParam("queryDate") @DateTimeFormat(pattern = "yyyy-MM-dd") Date queryDate) {
//查询本年列表
WatchH5HeartRateWeekVo vo = watchService.getHeartRateYearDayList(userId, queryDate);
return Result.OK("成功", vo);
}
//-------------------------------------压力---------------------------------------------------\\
@Operation(summary = "获取日压力列表", description = "获取日压力列表")
@GetMapping(value = "/stressDayData")
public Result<WatchH5StressDayVo> getStressDayData(@RequestParam("userId") String userId,
@RequestParam("queryDate") @DateTimeFormat(pattern = "yyyy-MM-dd") Date queryDate) {
WatchH5StressDayVo dayVo = watchService.getStressDayVo(userId, queryDate, true);
return Result.OK("成功", dayVo);
}
@Operation(summary = "获取周压力列表", description = "获取周压力列表")
@GetMapping(value = "/stressWeekData")
public Result<WatchH5StressWeekVo> getStressWeekData(@RequestParam("userId") String userId,
@RequestParam("queryDate") @DateTimeFormat(pattern = "yyyy-MM-dd") Date queryDate) {
//查询本周列表
WatchH5StressWeekVo weekList = watchService.getStressWeekDayList(userId, queryDate);
return Result.OK("成功", weekList);
}
@Operation(summary = "获取月压力列表", description = "获取月压力列表")
@GetMapping(value = "/stressMonthData")
public Result<WatchH5StressWeekVo> stressMonthData(@RequestParam("userId") String userId,
@RequestParam("queryDate") @DateTimeFormat(pattern = "yyyy-MM-dd") Date queryDate) {
//查询本月列表
WatchH5StressWeekVo vo = watchService.getStressMonthDayList(userId, queryDate);
return Result.OK("成功", vo);
}
@Operation(summary = "获取年压力列表", description = "获取年压力列表")
@GetMapping(value = "/stressYearData")
public Result<WatchH5StressWeekVo> stressYearData(@RequestParam("userId") String userId,
@RequestParam("queryDate") @DateTimeFormat(pattern = "yyyy-MM-dd") Date queryDate) {
//查询本年列表
WatchH5StressWeekVo vo = watchService.getStressYearDayList(userId, queryDate);
return Result.OK("成功", vo);
}
//-------------------------------------血氧--------------------------------------------------\\
@Operation(summary = "获取日血氧列表", description = "获取日血氧列表")
@GetMapping(value = "/spo2DayData")
public Result<WatchH5Spo2DayVo> getSpo2DayData(@RequestParam("userId") String userId,
@RequestParam("queryDate") @DateTimeFormat(pattern = "yyyy-MM-dd") Date queryDate) {
WatchH5Spo2DayVo dayVo = watchService.getSpo2DayVo(userId, queryDate, true);
return Result.OK("成功", dayVo);
}
@Operation(summary = "获取周血氧列表", description = "获取周血氧列表")
@GetMapping(value = "/spo2WeekData")
public Result<WatchH5Spo2WeekVo> getSpo2WeekData(@RequestParam("userId") String userId,
@RequestParam("queryDate") @DateTimeFormat(pattern = "yyyy-MM-dd") Date queryDate) {
//查询本周列表
WatchH5Spo2WeekVo weekList = watchService.getSpo2WeekDayList(userId, queryDate);
return Result.OK("成功", weekList);
}
@Operation(summary = "获取月血氧列表", description = "获取月血氧列表")
@GetMapping(value = "/spo2MonthData")
public Result<WatchH5Spo2WeekVo> spo2MonthData(@RequestParam("userId") String userId,
@RequestParam("queryDate") @DateTimeFormat(pattern = "yyyy-MM-dd") Date queryDate) {
//查询本月列表
WatchH5Spo2WeekVo vo = watchService.getSpo2MonthDayList(userId, queryDate);
return Result.OK("成功", vo);
}
@Operation(summary = "获取年血氧列表", description = "获取年血氧列表")
@GetMapping(value = "/spo2YearData")
public Result<WatchH5Spo2WeekVo> spo2YearData(@RequestParam("userId") String userId,
@RequestParam("queryDate") @DateTimeFormat(pattern = "yyyy-MM-dd") Date queryDate) {
//查询本年列表
WatchH5Spo2WeekVo vo = watchService.getSpo2YearDayList(userId, queryDate);
return Result.OK("成功", vo);
}
/**
* 预警历史信息查询接口
*
* @param userId
* @param eventType
* @return
*/
@Operation(summary = "预警历史信息查询", description = "预警历史信息查询")
@GetMapping(value = "/historicalWarn")
public Result<List<WatchWarnDTO>> historicalWarn(
@Parameter(description = "用户Id", name = "userId", required = true) @RequestParam("userId") String userId,
@Parameter(description = "事件类型", name = "eventType", required = true) @RequestParam("eventType") String eventType,
@Parameter(description = "查询日期", name = "queryDate", required = true) @RequestParam("queryDate")
@DateTimeFormat(pattern = "yyyy-MM-dd") Date queryDate,
@Parameter(description = "页码", name = "pageNo", required = true) @RequestParam("pageNo") Integer pageNo,
@Parameter(description = "页长", name = "pageSize", required = true) @RequestParam("pageSize") Integer pageSize) {
List<WatchWarnDTO> list = watchService.historicalWarn(userId, eventType, queryDate, pageNo, pageSize);
return Result.OK("成功", list);
}
@Operation(summary = "阈值设置", description = "阈值设置")
@GetMapping(value = "/thresholdSetting")
public Result<?> thresholdSetting(
@Parameter(description = "手表编码", name = "uerId", required = true) @RequestParam("uerId") String uerId,
@Parameter(description = "事件类型", name = "eventType", required = true) @RequestParam("eventType") String eventType,
@Parameter(description = "阈值上限", name = "warnMax", required = true) @RequestParam("warnMax") Double warnMax,
@Parameter(description = "阈值下限", name = "warnMin", required = true) @RequestParam("warnMin") Double warnMin) {
Result<?> result = watchService.thresholdSetting(uerId, eventType, warnMax, warnMin);
// if (!result.isSuccess()) {
// return Result.error("失败");
// }
return result;
}
}
@@ -0,0 +1,162 @@
package com.renkang.watch.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.renkang.watch.entity.WatchDataCalorie;
import com.renkang.watch.service.IWatchDataCalorieService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
/**
* @Description: watch_data_calorie
* @Author: jeecg-boot
* @Date: 2023-08-08
* @Version: V1.0
*/
@Tag(name = "watch_data_calorie")
@RestController
@RequestMapping("/watch/watchDataCalorie")
@Slf4j
public class WatchDataCalorieController extends JeecgController<WatchDataCalorie, IWatchDataCalorieService> {
@Autowired
private IWatchDataCalorieService watchDataCalorieService;
/**
* 分页列表查询
*
* @param watchDataCalorie
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "watch_data_calorie-分页列表查询")
@Operation(summary = "watch_data_calorie-分页列表查询", description = "watch_data_calorie-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<WatchDataCalorie>> queryPageList(WatchDataCalorie watchDataCalorie,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<WatchDataCalorie> queryWrapper = QueryGenerator.initQueryWrapper(watchDataCalorie, req.getParameterMap());
Page<WatchDataCalorie> page = new Page<WatchDataCalorie>(pageNo, pageSize);
IPage<WatchDataCalorie> pageList = watchDataCalorieService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param watchDataCalorie
* @return
*/
@AutoLog(value = "watch_data_calorie-添加")
@Operation(summary = "watch_data_calorie-添加", description = "watch_data_calorie-添加")
@RequiresPermissions("watch:watch_data_calorie:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody WatchDataCalorie watchDataCalorie) {
watchDataCalorieService.save(watchDataCalorie);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param watchDataCalorie
* @return
*/
@AutoLog(value = "watch_data_calorie-编辑")
@Operation(summary = "watch_data_calorie-编辑", description = "watch_data_calorie-编辑")
@RequiresPermissions("watch:watch_data_calorie:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
public Result<String> edit(@RequestBody WatchDataCalorie watchDataCalorie) {
watchDataCalorieService.updateById(watchDataCalorie);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "watch_data_calorie-通过id删除")
@Operation(summary = "watch_data_calorie-通过id删除", description = "watch_data_calorie-通过id删除")
@RequiresPermissions("watch:watch_data_calorie:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
watchDataCalorieService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "watch_data_calorie-批量删除")
@Operation(summary = "watch_data_calorie-批量删除", description = "watch_data_calorie-批量删除")
@RequiresPermissions("watch:watch_data_calorie:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
this.watchDataCalorieService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "watch_data_calorie-通过id查询")
@Operation(summary = "watch_data_calorie-通过id查询", description = "watch_data_calorie-通过id查询")
@GetMapping(value = "/queryById")
public Result<WatchDataCalorie> queryById(@RequestParam(name = "id", required = true) String id) {
WatchDataCalorie watchDataCalorie = watchDataCalorieService.getById(id);
if (watchDataCalorie == null) {
return Result.error("未找到对应数据");
}
return Result.OK(watchDataCalorie);
}
/**
* 导出excel
*
* @param request
* @param watchDataCalorie
*/
@RequiresPermissions("watch:watch_data_calorie:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, WatchDataCalorie watchDataCalorie) {
return super.exportXls(request, watchDataCalorie, WatchDataCalorie.class, "watch_data_calorie");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequiresPermissions("watch:watch_data_calorie:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, WatchDataCalorie.class);
}
}
@@ -0,0 +1,524 @@
package com.renkang.watch.controller;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.renkang.watch.bean.request.WorkoutFilter;
import com.renkang.watch.bean.response.DataMonth;
import com.renkang.watch.bean.response.UserDataDetail;
import com.renkang.watch.bean.response.WatchWorkoutPageCustom;
import com.renkang.watch.dto.BigScreenDTO;
import com.renkang.watch.entity.*;
import com.renkang.watch.service.*;
import com.renkang.watch.vo.BigScreenSdcVo;
import com.renkang.watch.vo.BigScreenSleepVo;
import com.renkang.watch.vo.BigScreenVo;
import com.renkang.watch.vo.UserData.StatisticsReq;
import com.renkang.watch.vo.UserData.res.Stress.WatchDataStressRes;
import com.renkang.watch.vo.UserData.res.bloodOxygen.BloodOxygenStat;
import com.renkang.watch.vo.UserData.res.bodyTemperature.BodyTempStat;
import com.renkang.watch.vo.UserData.res.heartRate.WatchDataHeartRateRes;
import com.renkang.watch.vo.UserData.res.sleep.WatchDataSleepPageRes;
import com.renkang.watch.vo.UserData.res.sleep.WatchDataSleepRes;
import com.renkang.watch.vo.UserData.res.step.WatchDataStepRes;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.PermissionData;
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;
import java.util.List;
/**
* 统计数据
* @Description: watch_data
* @Author: jeecg-boot
* @Date: 2023-11-03
* @Version: V1.0
*/
@Tag(name = "应急大屏/副屏")
@RestController
@RequestMapping("/watch/watchData")
@Slf4j
public class WatchDataController extends JeecgController<WatchData, IWatchDataService> {
@Autowired
private IWatchDataService watchDataService;
@Autowired
private IWatchStatUserInfoDayHeartRateService watchStatUserInfoDayHeartRateService;
@Autowired
private IWatchStatUserInfoDaySpo2Service watchStatUserInfoDaySpo2Service;
@Autowired
private IWatchStatUserInfoDayStressService watchStatUserInfoDayStressService;
@Autowired
private IWatchStatUserInfoDayTempService watchStatUserInfoDayTempService;
@Autowired
private IWatchStatUserInfoDaySleepService watchStatUserInfoDaySleepService;
@Autowired
private IWatchDataWorkoutService watchDataWorkoutService;
@Autowired
private IWatchStatUserInfoDaySdcService watchStatUserInfoDaySdcService;
@Autowired
private IWatchDeviceService watchDeviceService;
/**
* 分页列表查询
*
* @param watchData
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "watch_data-分页列表查询")
@Operation(summary = "watch_data-分页列表查询", description = "watch_data-分页列表查询")
@GetMapping(value = "/list")
@PermissionData(pageComponent = "healthMonitor/healMonitorManage/monitorToll/userInfo/userInfoList")
public Result<IPage<WatchData>> queryPageList(WatchData watchData,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
Page<WatchData> page = new Page<WatchData>(pageNo, pageSize);
IPage<WatchData> pageList = watchDataService.pageCustom(page, watchData);
return Result.OK(pageList);
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "watch_data-通过id查询")
@Operation(summary = "watch_data-通过id查询", description = "watch_data-通过id查询")
@GetMapping(value = "/queryById")
public Result<WatchData> queryById(@RequestParam(name="id",required=true) long id) {
WatchData watchData = watchDataService.queryById(id);
if(watchData==null) {
return Result.error("未找到对应数据");
}
return Result.OK(watchData);
}
/**
* 运动分页列表
* @param filter 参数
* @return page
*/
@PostMapping(value = "/queryExercisePage")
public Result<WatchWorkoutPageCustom> queryExercisePage(@RequestBody WorkoutFilter filter) {
return Result.OK(watchDataWorkoutService.pageCustom(filter));
}
/**
* 用户数据总览
* @param type 类型(0:今日 1:近七日 2:近14日)
* @param userId 用户id
* @return 总览数据
*/
@GetMapping(value = "/queryAllStatistics")
public Result<UserDataDetail> queryAllStatistics(@RequestParam(required = false,defaultValue = "0") String type,@RequestParam String userId) {
return Result.OK(watchDataService.queryAllStatistics(type,userId,null));
}
/**
* 用户存在数据的日期
* @param year 年份
* @return bean
*/
@GetMapping(value = "/userDataDayByYear")
public Result<DataMonth> userDataDayByYear(@RequestParam String type,
@RequestParam String userId,
@RequestParam(required = false) Integer year) {
if (StrUtil.isBlank(userId) || StrUtil.isBlank(type)) {
return Result.error("参数缺失");
}
return Result.OK(watchDataService.userDataDayByYear(type,userId,year));
}
/**
* 用户存在数据的日期
* @param year 年份
* @return bean
*/
@GetMapping(value = "/userDataDayByMonth")
public Result<?> userDataDayByMonth(@RequestParam String userId,
@RequestParam Integer year) {
if (StrUtil.isBlank(userId) || ObjectUtil.isNull(year)) {
return Result.error("参数缺失");
}
return Result.OK(watchDataService.userDataDayByMonth(userId,year));
}
/**
* 获取体温统计
* @param req 参数
* @return result
*/
@PostMapping(value = "/queryBodyTemperatureStat")
public Result<BodyTempStat> queryBodyTemperatureStat(@RequestBody StatisticsReq req) {
return Result.OK(watchStatUserInfoDayTempService.queryBodyTemperatureStat(req));
}
/**
* 获取体温分页列表
* @param req 参数
* @return page
*/
@PostMapping(value = "/queryBodyTemperatureStatPage")
public Result<IPage<WatchDataTemperature>> queryBodyTemperatureStatPage(@RequestBody StatisticsReq req) {
IPage<WatchDataTemperature> page = new Page<>(req.getPageNo(), req.getPageSize());
IPage<WatchDataTemperature> pageList = watchStatUserInfoDayTempService.queryBodyTemperatureStatPage(page, req);
return Result.OK(pageList);
}
/**
* 获取心率统计
*
* @param req
*/
@PostMapping(value = "/queryHeartRateStatistics")
public Result<WatchDataHeartRateRes> queryHeartRateStatistics(@RequestBody StatisticsReq req) {
WatchDataHeartRateRes watchDataHeartRateRes = watchStatUserInfoDayHeartRateService.queryHeartRateStatistics(req);
return Result.OK(watchDataHeartRateRes);
}
/**
* 获取血氧统计
* @param req 参数
*/
@PostMapping(value = "/queryBloodOxygenStatistics")
public Result<BloodOxygenStat> queryBloodOxygenStatistics(@RequestBody StatisticsReq req) {
return Result.OK(watchStatUserInfoDaySpo2Service.queryBloodOxygenStatistics(req));
}
/**
* 获取血氧分页列表
*
* @param req
*/
@PostMapping(value = "/queryBloodOxygenStatisticsPage")
public Result<IPage<WatchDataSpo2>> queryBloodOxygenStatisticsPage(@RequestBody StatisticsReq req) {
IPage<WatchDataSpo2> page = new Page<>(req.getPageNo(), req.getPageSize());
IPage<WatchDataSpo2> pageList = watchStatUserInfoDaySpo2Service.queryBloodOxygenStatisticsPage(page, req);
return Result.OK(pageList);
}
/**
* 获取心率分页列表
*
* @param req
*/
@PostMapping(value = "/queryHeartRateStatisticsPage")
public Result<IPage<WatchDataHeartRate>> queryHeartRateStatisticsPage(@RequestBody StatisticsReq req) {
IPage<WatchDataHeartRate> page = new Page<>(req.getPageNo(), req.getPageSize());
IPage<WatchDataHeartRate> pageList = watchStatUserInfoDayHeartRateService.queryHeartRateStatisticsPage(page, req);
return Result.OK(pageList);
}
/**
* 获取压力统计
*
* @param req
*/
@PostMapping(value = "/queryStressStatistics")
public Result<WatchDataStressRes> queryStressStatistics(@RequestBody StatisticsReq req) {
WatchDataStressRes res = watchStatUserInfoDayStressService.queryStressStatistics(req);
return Result.OK(res);
}
/**
* 获取压力分页列表
*
* @param req
*/
@PostMapping(value = "/queryStressStatisticsPage")
public Result<IPage<WatchDataStress>> queryStressStatisticsPage(@RequestBody StatisticsReq req) {
IPage<WatchDataStress> page = new Page<>(req.getPageNo(), req.getPageSize());
IPage<WatchDataStress> pageList = watchStatUserInfoDayStressService.queryStressStatisticsPage(page, req);
return Result.OK(pageList);
}
/**
* 获取睡眠统计
*
* @param req
*/
@PostMapping(value = "/querySleepStatistics")
public Result<WatchDataSleepRes> querySleepStatistics(@RequestBody StatisticsReq req) {
WatchDataSleepRes res = watchStatUserInfoDaySleepService.querySleepStatistics(req);
return Result.OK(res);
}
/**
* 获取睡眠分页列表
*
* @param req
*/
@PostMapping(value = "/querySleepStatisticsPage")
public Result<IPage<WatchDataSleepPageRes>> querySleepStatisticsPage(@RequestBody StatisticsReq req) {
IPage<WatchDataSleepPageRes> page = new Page<>(req.getPageNo(), req.getPageSize());
IPage<WatchDataSleepPageRes> pageList = watchStatUserInfoDaySleepService.querySleepStatisticsPage(page, req);
return Result.OK(pageList);
}
/**
* 获取步数统计
*
* @param req
*/
@PostMapping(value = "/queryStepStatistics")
public Result<WatchDataStepRes> queryStepStatistics(@RequestBody StatisticsReq req) {
WatchDataStepRes res = watchStatUserInfoDaySdcService.queryStepStatistics(req);
return Result.OK(res);
}
/**
* 获取步数分页列表
*
* @param req
*/
@PostMapping(value = "/queryStepStatisticsPage")
public Result<IPage<WatchStatUserInfoDaySdc>> queryStepStatisticsPage(@RequestBody StatisticsReq req) {
IPage<WatchStatUserInfoDaySdc> page = new Page<>(req.getPageNo(), req.getPageSize());
IPage<WatchStatUserInfoDaySdc> pageList = watchStatUserInfoDaySdcService.querySleepStatisticsPage(page, req);
return Result.OK(pageList);
}
/**
* 导出excel
*
* @param request
* @param watchData
*/
@RequiresPermissions("watch:watch_data:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, WatchData watchData) {
return super.exportXls(request, watchData, WatchData.class, "watch_data");
}
@PostMapping(value = "/getWatchDataByOrgCode")
@Operation(summary = "大屏副屏(左侧)", description = "大屏副屏(左侧)")
public Result<List<BigScreenVo>> getWatchDataByOrgCode(@RequestBody BigScreenDTO dto) {
if (!StrUtil.isNotBlank(dto.getType())) {
return Result.error("时间不能为空");
}
List<BigScreenVo> list = watchDataService.getWatchDataByOrgCode(dto);
return Result.OK(list);
}
@PostMapping(value = "/getSdc")
@Operation(summary = "大屏副屏(步数)", description = "大屏副屏(步数)")
public Result<BigScreenSdcVo> getSdc(@RequestBody BigScreenDTO dto) {
if (!StrUtil.isNotBlank(dto.getType())) {
return Result.error("时间不能为空");
}
BigScreenSdcVo vo = watchDataService.getSdc(dto);
return Result.OK(vo);
}
@PostMapping(value = "/getWatchDataByOrgCode/v2")
@Operation(summary = "大屏副屏肌体监测数据(蚁熊V2版本)", description = "大屏副屏肌体监测数据(蚁熊V2版本)")
public Result<List<BigScreenVo>> getWatchDataByOrgCodeV2(@RequestBody BigScreenDTO dto) {
if (!StrUtil.isNotBlank(dto.getType())) {
return Result.error("时间不能为空");
}
return Result.OK(watchDataService.getWatchDataByOrgCodeV2(dto));
}
@PostMapping(value = "/getSdc/v2")
@Operation(summary = "大屏副屏步数(蚁熊V2版本)", description = "大屏副屏步数(蚁熊V2版本)")
public Result<BigScreenSdcVo> getSdcV2(@RequestBody BigScreenDTO dto) {
if (!StrUtil.isNotBlank(dto.getType())) {
return Result.error("时间不能为空");
}
return Result.OK(watchDataService.getSdcV2(dto));
}
@PostMapping(value = "/getSleep")
@Operation(summary = "大屏副屏(睡眠)", description = "大屏副屏(睡眠)")
public Result<List<BigScreenSleepVo>> getSleep(@RequestBody BigScreenDTO dto) {
if (!StrUtil.isNotBlank(dto.getType())) {
return Result.error("时间不能为空");
}
List<BigScreenSleepVo> vo = watchDataService.getSleep(dto);
return Result.OK(vo);
}
/**
* 七天 活跃 跑数据
* @return
*/
@GetMapping(value = "/testSevenActive")
public Result<String> testSevenActive(){
return watchDataService.testSevenActive();
}
/**
* 30天活跃 跑数据
* @return
*/
@GetMapping(value = "/testThirtyActive")
public Result<String> testThirtyActive(){
return watchDataService.testThirtyActive();
}
/**
* 心率统计
* @param req
* @return
*/
@PostMapping(value = "/queryHeartRateStatisticsData")
public Result<WatchDataHeartRateRes> queryHeartRateStatisticsData(@RequestBody StatisticsReq req) {
WatchDataHeartRateRes watchDataHeartRateRes = watchStatUserInfoDayHeartRateService.queryHeartRateStatisticsData(req);
return Result.OK(watchDataHeartRateRes);
}
/**
* 血氧统计
* @param req
* @return
*/
@PostMapping(value = "/queryBloodOxygenStatisticsData")
public Result<BloodOxygenStat> queryBloodOxygenStatisticsData(@RequestBody StatisticsReq req) {
return Result.OK(watchStatUserInfoDaySpo2Service.queryBloodOxygenStatisticsData(req));
}
/**
* 睡眠统计
* @param req
* @return
*/
@PostMapping(value = "/querySleepStatisticsData")
public Result<WatchDataSleepRes> querySleepStatisticsData(@RequestBody StatisticsReq req) {
WatchDataSleepRes res = watchStatUserInfoDaySleepService.querySleepStatisticsData(req);
return Result.OK(res);
}
/**
* 体温统计
* @param req
* @return
*/
@PostMapping(value = "/queryBodyTemperatureStatData")
public Result<BodyTempStat> queryBodyTemperatureStatData(@RequestBody StatisticsReq req) {
return Result.OK(watchStatUserInfoDayTempService.queryBodyTemperatureStatData(req));
}
/**
* 分时运动列表
* @param watchDataWorkout
* @param pageNo
* @param pageSize
* @return
*/
@GetMapping(value = "/selectSportCostList")
public Result<IPage<WatchDataWorkout>> selectSportCostList(WatchDataWorkout watchDataWorkout,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize){
return Result.ok(watchDataWorkoutService.selectSportCostList(watchDataWorkout,pageNo,pageSize));
}
/**
* 分时运动总消耗
* @return
*/
@GetMapping(value = "/selectSportCostTotal")
public Result<WatchDataWorkout> selectSportCostTotal(WatchDataWorkout watchDataWorkout){
if (StrUtil.isEmpty(watchDataWorkout.getBindUserId())) {
return Result.error("用户不存在");
}
return Result.ok(watchDataWorkoutService.selectSportCostTotal(watchDataWorkout));
}
/**
* 实时运动
* @param bindUserId
* @return
*/
@GetMapping(value = "/selectSportTiming")
public Result<List<WatchDataWorkout>> selectSportTiming(@RequestParam(name = "bindUserId")String bindUserId){
if (StrUtil.isEmpty(bindUserId)) {
return Result.error("用户不存在");
}
return Result.ok(watchDataWorkoutService.selectSportTiming(bindUserId));
}
/**
* 实时运动总消耗
* @param bindUserId
* @return
*/
@GetMapping(value = "/selectSportTimingTotal")
public Result<WatchDataWorkout> selectSportTimingTotal(@RequestParam(name = "bindUserId")String bindUserId){
if (StrUtil.isEmpty(bindUserId)) {
return Result.error("用户不存在");
}
return Result.ok(watchDataWorkoutService.selectSportTimingTotal(bindUserId));
}
/**
* 新的实时运动
* @param watchDataWorkout
* @param pageNo
* @param pageSize
* @return
*/
@GetMapping(value = "/selectSportCostListNew")
public Result<List<WatchDataWorkout>> selectSportCostListNew(WatchDataWorkout watchDataWorkout,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize){
return watchDataWorkoutService.selectSportCostListNew(watchDataWorkout,pageNo,pageSize);
}
/**
* 新的实时运动 (PS: 同上接口,只是返回分页参数, 因为不确定上述接口APP有没有调用新加的)
* @param watchDataWorkout
* @param pageNo
* @param pageSize
* @return
*/
@GetMapping(value = "/selectSportCostListNews")
public Result<IPage<WatchDataWorkout>> selectSportCostListNews(WatchDataWorkout watchDataWorkout,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize){
return watchDataWorkoutService.selectSportCostListNews(watchDataWorkout,pageNo,pageSize);
}
}
@@ -0,0 +1,162 @@
package com.renkang.watch.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.renkang.watch.entity.WatchDataDistance;
import com.renkang.watch.service.IWatchDataDistanceService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
/**
* @Description: watch_data_distance
* @Author: jeecg-boot
* @Date: 2023-08-08
* @Version: V1.0
*/
@Tag(name = "watch_data_distance")
@RestController
@RequestMapping("/watch/watchDataDistance")
@Slf4j
public class WatchDataDistanceController extends JeecgController<WatchDataDistance, IWatchDataDistanceService> {
@Autowired
private IWatchDataDistanceService watchDataDistanceService;
/**
* 分页列表查询
*
* @param watchDataDistance
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "watch_data_distance-分页列表查询")
@Operation(summary = "watch_data_distance-分页列表查询", description = "watch_data_distance-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<WatchDataDistance>> queryPageList(WatchDataDistance watchDataDistance,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<WatchDataDistance> queryWrapper = QueryGenerator.initQueryWrapper(watchDataDistance, req.getParameterMap());
Page<WatchDataDistance> page = new Page<WatchDataDistance>(pageNo, pageSize);
IPage<WatchDataDistance> pageList = watchDataDistanceService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param watchDataDistance
* @return
*/
@AutoLog(value = "watch_data_distance-添加")
@Operation(summary = "watch_data_distance-添加", description = "watch_data_distance-添加")
@RequiresPermissions("watch:watch_data_distance:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody WatchDataDistance watchDataDistance) {
watchDataDistanceService.save(watchDataDistance);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param watchDataDistance
* @return
*/
@AutoLog(value = "watch_data_distance-编辑")
@Operation(summary = "watch_data_distance-编辑", description = "watch_data_distance-编辑")
@RequiresPermissions("watch:watch_data_distance:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
public Result<String> edit(@RequestBody WatchDataDistance watchDataDistance) {
watchDataDistanceService.updateById(watchDataDistance);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "watch_data_distance-通过id删除")
@Operation(summary = "watch_data_distance-通过id删除", description = "watch_data_distance-通过id删除")
@RequiresPermissions("watch:watch_data_distance:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
watchDataDistanceService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "watch_data_distance-批量删除")
@Operation(summary = "watch_data_distance-批量删除", description = "watch_data_distance-批量删除")
@RequiresPermissions("watch:watch_data_distance:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
this.watchDataDistanceService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "watch_data_distance-通过id查询")
@Operation(summary = "watch_data_distance-通过id查询", description = "watch_data_distance-通过id查询")
@GetMapping(value = "/queryById")
public Result<WatchDataDistance> queryById(@RequestParam(name = "id", required = true) String id) {
WatchDataDistance watchDataDistance = watchDataDistanceService.getById(id);
if (watchDataDistance == null) {
return Result.error("未找到对应数据");
}
return Result.OK(watchDataDistance);
}
/**
* 导出excel
*
* @param request
* @param watchDataDistance
*/
@RequiresPermissions("watch:watch_data_distance:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, WatchDataDistance watchDataDistance) {
return super.exportXls(request, watchDataDistance, WatchDataDistance.class, "watch_data_distance");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequiresPermissions("watch:watch_data_distance:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, WatchDataDistance.class);
}
}
@@ -0,0 +1,162 @@
package com.renkang.watch.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.renkang.watch.entity.WatchDataExercise;
import com.renkang.watch.service.IWatchDataExerciseService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
/**
* @Description: watch_data_exercise
* @Author: jeecg-boot
* @Date: 2023-08-08
* @Version: V1.0
*/
@Tag(name = "watch_data_exercise")
@RestController
@RequestMapping("/watch/watchDataExercise")
@Slf4j
public class WatchDataExerciseController extends JeecgController<WatchDataExercise, IWatchDataExerciseService> {
@Autowired
private IWatchDataExerciseService watchDataExerciseService;
/**
* 分页列表查询
*
* @param watchDataExercise
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "watch_data_exercise-分页列表查询")
@Operation(summary = "watch_data_exercise-分页列表查询", description = "watch_data_exercise-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<WatchDataExercise>> queryPageList(WatchDataExercise watchDataExercise,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<WatchDataExercise> queryWrapper = QueryGenerator.initQueryWrapper(watchDataExercise, req.getParameterMap());
Page<WatchDataExercise> page = new Page<WatchDataExercise>(pageNo, pageSize);
IPage<WatchDataExercise> pageList = watchDataExerciseService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param watchDataExercise
* @return
*/
@AutoLog(value = "watch_data_exercise-添加")
@Operation(summary = "watch_data_exercise-添加", description = "watch_data_exercise-添加")
@RequiresPermissions("watch:watch_data_exercise:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody WatchDataExercise watchDataExercise) {
watchDataExerciseService.save(watchDataExercise);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param watchDataExercise
* @return
*/
@AutoLog(value = "watch_data_exercise-编辑")
@Operation(summary = "watch_data_exercise-编辑", description = "watch_data_exercise-编辑")
@RequiresPermissions("watch:watch_data_exercise:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
public Result<String> edit(@RequestBody WatchDataExercise watchDataExercise) {
watchDataExerciseService.updateById(watchDataExercise);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "watch_data_exercise-通过id删除")
@Operation(summary = "watch_data_exercise-通过id删除", description = "watch_data_exercise-通过id删除")
@RequiresPermissions("watch:watch_data_exercise:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
watchDataExerciseService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "watch_data_exercise-批量删除")
@Operation(summary = "watch_data_exercise-批量删除", description = "watch_data_exercise-批量删除")
@RequiresPermissions("watch:watch_data_exercise:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
this.watchDataExerciseService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "watch_data_exercise-通过id查询")
@Operation(summary = "watch_data_exercise-通过id查询", description = "watch_data_exercise-通过id查询")
@GetMapping(value = "/queryById")
public Result<WatchDataExercise> queryById(@RequestParam(name = "id", required = true) String id) {
WatchDataExercise watchDataExercise = watchDataExerciseService.getById(id);
if (watchDataExercise == null) {
return Result.error("未找到对应数据");
}
return Result.OK(watchDataExercise);
}
/**
* 导出excel
*
* @param request
* @param watchDataExercise
*/
@RequiresPermissions("watch:watch_data_exercise:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, WatchDataExercise watchDataExercise) {
return super.exportXls(request, watchDataExercise, WatchDataExercise.class, "watch_data_exercise");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequiresPermissions("watch:watch_data_exercise:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, WatchDataExercise.class);
}
}
@@ -0,0 +1,162 @@
package com.renkang.watch.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.renkang.watch.entity.WatchDataGps;
import com.renkang.watch.service.IWatchDataGpsService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
/**
* @Description: watch_data_gps
* @Author: jeecg-boot
* @Date: 2023-08-08
* @Version: V1.0
*/
@Tag(name = "watch_data_gps")
@RestController
@RequestMapping("/watch/watchDataGps")
@Slf4j
public class WatchDataGpsController extends JeecgController<WatchDataGps, IWatchDataGpsService> {
@Autowired
private IWatchDataGpsService watchDataGpsService;
/**
* 分页列表查询
*
* @param watchDataGps
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "watch_data_gps-分页列表查询")
@Operation(summary = "watch_data_gps-分页列表查询", description = "watch_data_gps-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<WatchDataGps>> queryPageList(WatchDataGps watchDataGps,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<WatchDataGps> queryWrapper = QueryGenerator.initQueryWrapper(watchDataGps, req.getParameterMap());
Page<WatchDataGps> page = new Page<WatchDataGps>(pageNo, pageSize);
IPage<WatchDataGps> pageList = watchDataGpsService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param watchDataGps
* @return
*/
@AutoLog(value = "watch_data_gps-添加")
@Operation(summary = "watch_data_gps-添加", description = "watch_data_gps-添加")
@RequiresPermissions("watch:watch_data_gps:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody WatchDataGps watchDataGps) {
watchDataGpsService.save(watchDataGps);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param watchDataGps
* @return
*/
@AutoLog(value = "watch_data_gps-编辑")
@Operation(summary = "watch_data_gps-编辑", description = "watch_data_gps-编辑")
@RequiresPermissions("watch:watch_data_gps:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
public Result<String> edit(@RequestBody WatchDataGps watchDataGps) {
watchDataGpsService.updateById(watchDataGps);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "watch_data_gps-通过id删除")
@Operation(summary = "watch_data_gps-通过id删除", description = "watch_data_gps-通过id删除")
@RequiresPermissions("watch:watch_data_gps:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
watchDataGpsService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "watch_data_gps-批量删除")
@Operation(summary = "watch_data_gps-批量删除", description = "watch_data_gps-批量删除")
@RequiresPermissions("watch:watch_data_gps:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
this.watchDataGpsService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "watch_data_gps-通过id查询")
@Operation(summary = "watch_data_gps-通过id查询", description = "watch_data_gps-通过id查询")
@GetMapping(value = "/queryById")
public Result<WatchDataGps> queryById(@RequestParam(name = "id", required = true) String id) {
WatchDataGps watchDataGps = watchDataGpsService.getById(id);
if (watchDataGps == null) {
return Result.error("未找到对应数据");
}
return Result.OK(watchDataGps);
}
/**
* 导出excel
*
* @param request
* @param watchDataGps
*/
@RequiresPermissions("watch:watch_data_gps:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, WatchDataGps watchDataGps) {
return super.exportXls(request, watchDataGps, WatchDataGps.class, "watch_data_gps");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequiresPermissions("watch:watch_data_gps:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, WatchDataGps.class);
}
}
@@ -0,0 +1,163 @@
package com.renkang.watch.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.renkang.watch.entity.WatchDataHeartRate;
import com.renkang.watch.service.IWatchDataHeartRateService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
/**
* @Description: watch_data_heart_rate
* @Author: jeecg-boot
* @Date: 2023-08-08
* @Version: V1.0
*/
@Tag(name = "watch_data_heart_rate")
@RestController
@RequestMapping("/watch/watchDataHeartRate")
@Slf4j
public class WatchDataHeartRateController extends JeecgController<WatchDataHeartRate, IWatchDataHeartRateService> {
@Autowired
private IWatchDataHeartRateService watchDataHeartRateService;
/**
* 分页列表查询
*
* @param watchDataHeartRate
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "watch_data_heart_rate-分页列表查询")
@Operation(summary = "watch_data_heart_rate-分页列表查询", description = "watch_data_heart_rate-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<WatchDataHeartRate>> queryPageList(WatchDataHeartRate watchDataHeartRate,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<WatchDataHeartRate> queryWrapper = QueryGenerator.initQueryWrapper(watchDataHeartRate, req.getParameterMap());
Page<WatchDataHeartRate> page = new Page<WatchDataHeartRate>(pageNo, pageSize);
IPage<WatchDataHeartRate> pageList = watchDataHeartRateService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param watchDataHeartRate
* @return
*/
@AutoLog(value = "watch_data_heart_rate-添加")
@Operation(summary = "watch_data_heart_rate-添加", description = "watch_data_heart_rate-添加")
@RequiresPermissions("watch:watch_data_heart_rate:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody WatchDataHeartRate watchDataHeartRate) {
watchDataHeartRateService.save(watchDataHeartRate);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param watchDataHeartRate
* @return
*/
@AutoLog(value = "watch_data_heart_rate-编辑")
@Operation(summary = "watch_data_heart_rate-编辑", description = "watch_data_heart_rate-编辑")
@RequiresPermissions("watch:watch_data_heart_rate:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
public Result<String> edit(@RequestBody WatchDataHeartRate watchDataHeartRate) {
watchDataHeartRateService.updateById(watchDataHeartRate);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "watch_data_heart_rate-通过id删除")
@Operation(summary = "watch_data_heart_rate-通过id删除", description = "watch_data_heart_rate-通过id删除")
@RequiresPermissions("watch:watch_data_heart_rate:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
watchDataHeartRateService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "watch_data_heart_rate-批量删除")
@Operation(summary = "watch_data_heart_rate-批量删除", description = "watch_data_heart_rate-批量删除")
@RequiresPermissions("watch:watch_data_heart_rate:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
this.watchDataHeartRateService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "watch_data_heart_rate-通过id查询")
@Operation(summary = "watch_data_heart_rate-通过id查询", description = "watch_data_heart_rate-通过id查询")
@GetMapping(value = "/queryById")
public Result<WatchDataHeartRate> queryById(@RequestParam(name = "id", required = true) String id) {
WatchDataHeartRate watchDataHeartRate = watchDataHeartRateService.getById(id);
if (watchDataHeartRate == null) {
return Result.error("未找到对应数据");
}
return Result.OK(watchDataHeartRate);
}
/**
* 导出excel
*
* @param request
* @param watchDataHeartRate
*/
@RequiresPermissions("watch:watch_data_heart_rate:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, WatchDataHeartRate watchDataHeartRate) {
return super.exportXls(request, watchDataHeartRate, WatchDataHeartRate.class, "watch_data_heart_rate");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequiresPermissions("watch:watch_data_heart_rate:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, WatchDataHeartRate.class);
}
}
@@ -0,0 +1,162 @@
package com.renkang.watch.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.renkang.watch.entity.WatchDataSleep;
import com.renkang.watch.service.IWatchDataSleepService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
/**
* @Description: watch_data_sleep
* @Author: jeecg-boot
* @Date: 2023-08-08
* @Version: V1.0
*/
@Tag(name = "watch_data_sleep")
@RestController
@RequestMapping("/watch/watchDataSleep")
@Slf4j
public class WatchDataSleepController extends JeecgController<WatchDataSleep, IWatchDataSleepService> {
@Autowired
private IWatchDataSleepService watchDataSleepService;
/**
* 分页列表查询
*
* @param watchDataSleep
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "watch_data_sleep-分页列表查询")
@Operation(summary = "watch_data_sleep-分页列表查询", description = "watch_data_sleep-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<WatchDataSleep>> queryPageList(WatchDataSleep watchDataSleep,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<WatchDataSleep> queryWrapper = QueryGenerator.initQueryWrapper(watchDataSleep, req.getParameterMap());
Page<WatchDataSleep> page = new Page<WatchDataSleep>(pageNo, pageSize);
IPage<WatchDataSleep> pageList = watchDataSleepService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param watchDataSleep
* @return
*/
@AutoLog(value = "watch_data_sleep-添加")
@Operation(summary = "watch_data_sleep-添加", description = "watch_data_sleep-添加")
@RequiresPermissions("watch:watch_data_sleep:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody WatchDataSleep watchDataSleep) {
watchDataSleepService.save(watchDataSleep);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param watchDataSleep
* @return
*/
@AutoLog(value = "watch_data_sleep-编辑")
@Operation(summary = "watch_data_sleep-编辑", description = "watch_data_sleep-编辑")
@RequiresPermissions("watch:watch_data_sleep:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
public Result<String> edit(@RequestBody WatchDataSleep watchDataSleep) {
watchDataSleepService.updateById(watchDataSleep);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "watch_data_sleep-通过id删除")
@Operation(summary = "watch_data_sleep-通过id删除", description = "watch_data_sleep-通过id删除")
@RequiresPermissions("watch:watch_data_sleep:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
watchDataSleepService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "watch_data_sleep-批量删除")
@Operation(summary = "watch_data_sleep-批量删除", description = "watch_data_sleep-批量删除")
@RequiresPermissions("watch:watch_data_sleep:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
this.watchDataSleepService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "watch_data_sleep-通过id查询")
@Operation(summary = "watch_data_sleep-通过id查询", description = "watch_data_sleep-通过id查询")
@GetMapping(value = "/queryById")
public Result<WatchDataSleep> queryById(@RequestParam(name = "id", required = true) String id) {
WatchDataSleep watchDataSleep = watchDataSleepService.getById(id);
if (watchDataSleep == null) {
return Result.error("未找到对应数据");
}
return Result.OK(watchDataSleep);
}
/**
* 导出excel
*
* @param request
* @param watchDataSleep
*/
@RequiresPermissions("watch:watch_data_sleep:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, WatchDataSleep watchDataSleep) {
return super.exportXls(request, watchDataSleep, WatchDataSleep.class, "watch_data_sleep");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequiresPermissions("watch:watch_data_sleep:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, WatchDataSleep.class);
}
}
@@ -0,0 +1,162 @@
package com.renkang.watch.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.renkang.watch.entity.WatchDataSleepNew;
import com.renkang.watch.service.IWatchDataSleepNewService;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
/**
* @Description: watch_data_sleep_new
* @Author: jeecg-boot
* @Date: 2023-08-08
* @Version: V1.0
*/
@Tag(name = "watch_data_sleep_new")
@RestController
@RequestMapping("/watch/watchDataSleepNew")
@Slf4j
public class WatchDataSleepNewController extends JeecgController<WatchDataSleepNew, IWatchDataSleepNewService> {
@Autowired
private IWatchDataSleepNewService watchDataSleepNewService;
/**
* 分页列表查询
*
* @param watchDataSleepNew
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "watch_data_sleep_new-分页列表查询")
@Operation(summary = "watch_data_sleep_new-分页列表查询", description = "watch_data_sleep_new-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<WatchDataSleepNew>> queryPageList(WatchDataSleepNew watchDataSleepNew,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<WatchDataSleepNew> queryWrapper = QueryGenerator.initQueryWrapper(watchDataSleepNew, req.getParameterMap());
Page<WatchDataSleepNew> page = new Page<WatchDataSleepNew>(pageNo, pageSize);
IPage<WatchDataSleepNew> pageList = watchDataSleepNewService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param watchDataSleepNew
* @return
*/
@AutoLog(value = "watch_data_sleep_new-添加")
@Operation(summary = "watch_data_sleep_new-添加", description = "watch_data_sleep_new-添加")
@RequiresPermissions("watch:watch_data_sleep_new:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody WatchDataSleepNew watchDataSleepNew) {
watchDataSleepNewService.save(watchDataSleepNew);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param watchDataSleepNew
* @return
*/
@AutoLog(value = "watch_data_sleep_new-编辑")
@Operation(summary = "watch_data_sleep_new-编辑", description = "watch_data_sleep_new-编辑")
@RequiresPermissions("watch:watch_data_sleep_new:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
public Result<String> edit(@RequestBody WatchDataSleepNew watchDataSleepNew) {
watchDataSleepNewService.updateById(watchDataSleepNew);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "watch_data_sleep_new-通过id删除")
@Operation(summary = "watch_data_sleep_new-通过id删除", description = "watch_data_sleep_new-通过id删除")
@RequiresPermissions("watch:watch_data_sleep_new:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
watchDataSleepNewService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "watch_data_sleep_new-批量删除")
@Operation(summary = "watch_data_sleep_new-批量删除", description = "watch_data_sleep_new-批量删除")
@RequiresPermissions("watch:watch_data_sleep_new:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
this.watchDataSleepNewService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "watch_data_sleep_new-通过id查询")
@Operation(summary = "watch_data_sleep_new-通过id查询", description = "watch_data_sleep_new-通过id查询")
@GetMapping(value = "/queryById")
public Result<WatchDataSleepNew> queryById(@RequestParam(name = "id", required = true) String id) {
WatchDataSleepNew watchDataSleepNew = watchDataSleepNewService.getById(id);
if (watchDataSleepNew == null) {
return Result.error("未找到对应数据");
}
return Result.OK(watchDataSleepNew);
}
/**
* 导出excel
*
* @param request
* @param watchDataSleepNew
*/
@RequiresPermissions("watch:watch_data_sleep_new:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, WatchDataSleepNew watchDataSleepNew) {
return super.exportXls(request, watchDataSleepNew, WatchDataSleepNew.class, "watch_data_sleep_new");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequiresPermissions("watch:watch_data_sleep_new:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, WatchDataSleepNew.class);
}
}
@@ -0,0 +1,162 @@
package com.renkang.watch.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.renkang.watch.entity.WatchDataSleepNewDay;
import com.renkang.watch.service.IWatchDataSleepNewDayService;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
/**
* @Description: watch_data_sleep_new_day
* @Author: jeecg-boot
* @Date: 2023-08-11
* @Version: V1.0
*/
@Tag(name = "watch_data_sleep_new_day")
@RestController
@RequestMapping("/watch/watchDataSleepNewDay")
@Slf4j
public class WatchDataSleepNewDayController extends JeecgController<WatchDataSleepNewDay, IWatchDataSleepNewDayService> {
@Autowired
private IWatchDataSleepNewDayService watchDataSleepNewDayService;
/**
* 分页列表查询
*
* @param watchDataSleepNewDay
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "watch_data_sleep_new_day-分页列表查询")
@Operation(summary = "watch_data_sleep_new_day-分页列表查询", description = "watch_data_sleep_new_day-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<WatchDataSleepNewDay>> queryPageList(WatchDataSleepNewDay watchDataSleepNewDay,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<WatchDataSleepNewDay> queryWrapper = QueryGenerator.initQueryWrapper(watchDataSleepNewDay, req.getParameterMap());
Page<WatchDataSleepNewDay> page = new Page<WatchDataSleepNewDay>(pageNo, pageSize);
IPage<WatchDataSleepNewDay> pageList = watchDataSleepNewDayService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param watchDataSleepNewDay
* @return
*/
@AutoLog(value = "watch_data_sleep_new_day-添加")
@Operation(summary = "watch_data_sleep_new_day-添加", description = "watch_data_sleep_new_day-添加")
@RequiresPermissions("watch:watch_data_sleep_new_day:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody WatchDataSleepNewDay watchDataSleepNewDay) {
watchDataSleepNewDayService.save(watchDataSleepNewDay);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param watchDataSleepNewDay
* @return
*/
@AutoLog(value = "watch_data_sleep_new_day-编辑")
@Operation(summary = "watch_data_sleep_new_day-编辑", description = "watch_data_sleep_new_day-编辑")
@RequiresPermissions("watch:watch_data_sleep_new_day:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
public Result<String> edit(@RequestBody WatchDataSleepNewDay watchDataSleepNewDay) {
watchDataSleepNewDayService.updateById(watchDataSleepNewDay);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "watch_data_sleep_new_day-通过id删除")
@Operation(summary = "watch_data_sleep_new_day-通过id删除", description = "watch_data_sleep_new_day-通过id删除")
@RequiresPermissions("watch:watch_data_sleep_new_day:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
watchDataSleepNewDayService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "watch_data_sleep_new_day-批量删除")
@Operation(summary = "watch_data_sleep_new_day-批量删除", description = "watch_data_sleep_new_day-批量删除")
@RequiresPermissions("watch:watch_data_sleep_new_day:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
this.watchDataSleepNewDayService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "watch_data_sleep_new_day-通过id查询")
@Operation(summary = "watch_data_sleep_new_day-通过id查询", description = "watch_data_sleep_new_day-通过id查询")
@GetMapping(value = "/queryById")
public Result<WatchDataSleepNewDay> queryById(@RequestParam(name = "id", required = true) String id) {
WatchDataSleepNewDay watchDataSleepNewDay = watchDataSleepNewDayService.getById(id);
if (watchDataSleepNewDay == null) {
return Result.error("未找到对应数据");
}
return Result.OK(watchDataSleepNewDay);
}
/**
* 导出excel
*
* @param request
* @param watchDataSleepNewDay
*/
@RequiresPermissions("watch:watch_data_sleep_new_day:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, WatchDataSleepNewDay watchDataSleepNewDay) {
return super.exportXls(request, watchDataSleepNewDay, WatchDataSleepNewDay.class, "watch_data_sleep_new_day");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequiresPermissions("watch:watch_data_sleep_new_day:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, WatchDataSleepNewDay.class);
}
}
@@ -0,0 +1,162 @@
package com.renkang.watch.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.renkang.watch.entity.WatchDataSleepNewErr;
import com.renkang.watch.service.IWatchDataSleepNewErrService;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
/**
* @Description: watch_data_sleep_new_err
* @Author: jeecg-boot
* @Date: 2023-08-08
* @Version: V1.0
*/
@Tag(name = "watch_data_sleep_new_err")
@RestController
@RequestMapping("/watch/watchDataSleepNewErr")
@Slf4j
public class WatchDataSleepNewErrController extends JeecgController<WatchDataSleepNewErr, IWatchDataSleepNewErrService> {
@Autowired
private IWatchDataSleepNewErrService watchDataSleepNewErrService;
/**
* 分页列表查询
*
* @param watchDataSleepNewErr
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "watch_data_sleep_new_err-分页列表查询")
@Operation(summary = "watch_data_sleep_new_err-分页列表查询", description = "watch_data_sleep_new_err-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<WatchDataSleepNewErr>> queryPageList(WatchDataSleepNewErr watchDataSleepNewErr,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<WatchDataSleepNewErr> queryWrapper = QueryGenerator.initQueryWrapper(watchDataSleepNewErr, req.getParameterMap());
Page<WatchDataSleepNewErr> page = new Page<WatchDataSleepNewErr>(pageNo, pageSize);
IPage<WatchDataSleepNewErr> pageList = watchDataSleepNewErrService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param watchDataSleepNewErr
* @return
*/
@AutoLog(value = "watch_data_sleep_new_err-添加")
@Operation(summary = "watch_data_sleep_new_err-添加", description = "watch_data_sleep_new_err-添加")
@RequiresPermissions("watch:watch_data_sleep_new_err:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody WatchDataSleepNewErr watchDataSleepNewErr) {
watchDataSleepNewErrService.save(watchDataSleepNewErr);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param watchDataSleepNewErr
* @return
*/
@AutoLog(value = "watch_data_sleep_new_err-编辑")
@Operation(summary = "watch_data_sleep_new_err-编辑", description = "watch_data_sleep_new_err-编辑")
@RequiresPermissions("watch:watch_data_sleep_new_err:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
public Result<String> edit(@RequestBody WatchDataSleepNewErr watchDataSleepNewErr) {
watchDataSleepNewErrService.updateById(watchDataSleepNewErr);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "watch_data_sleep_new_err-通过id删除")
@Operation(summary = "watch_data_sleep_new_err-通过id删除", description = "watch_data_sleep_new_err-通过id删除")
@RequiresPermissions("watch:watch_data_sleep_new_err:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
watchDataSleepNewErrService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "watch_data_sleep_new_err-批量删除")
@Operation(summary = "watch_data_sleep_new_err-批量删除", description = "watch_data_sleep_new_err-批量删除")
@RequiresPermissions("watch:watch_data_sleep_new_err:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
this.watchDataSleepNewErrService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "watch_data_sleep_new_err-通过id查询")
@Operation(summary = "watch_data_sleep_new_err-通过id查询", description = "watch_data_sleep_new_err-通过id查询")
@GetMapping(value = "/queryById")
public Result<WatchDataSleepNewErr> queryById(@RequestParam(name = "id", required = true) String id) {
WatchDataSleepNewErr watchDataSleepNewErr = watchDataSleepNewErrService.getById(id);
if (watchDataSleepNewErr == null) {
return Result.error("未找到对应数据");
}
return Result.OK(watchDataSleepNewErr);
}
/**
* 导出excel
*
* @param request
* @param watchDataSleepNewErr
*/
@RequiresPermissions("watch:watch_data_sleep_new_err:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, WatchDataSleepNewErr watchDataSleepNewErr) {
return super.exportXls(request, watchDataSleepNewErr, WatchDataSleepNewErr.class, "watch_data_sleep_new_err");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequiresPermissions("watch:watch_data_sleep_new_err:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, WatchDataSleepNewErr.class);
}
}
@@ -0,0 +1,162 @@
package com.renkang.watch.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.renkang.watch.entity.WatchDataSleepNewMinute;
import com.renkang.watch.service.IWatchDataSleepNewMinuteService;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
/**
* @Description: watch_data_sleep_new_minute
* @Author: jeecg-boot
* @Date: 2023-08-08
* @Version: V1.0
*/
@Tag(name = "watch_data_sleep_new_minute")
@RestController
@RequestMapping("/watch/watchDataSleepNewMinute")
@Slf4j
public class WatchDataSleepNewMinuteController extends JeecgController<WatchDataSleepNewMinute, IWatchDataSleepNewMinuteService> {
@Autowired
private IWatchDataSleepNewMinuteService watchDataSleepNewMinuteService;
/**
* 分页列表查询
*
* @param watchDataSleepNewMinute
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "watch_data_sleep_new_minute-分页列表查询")
@Operation(summary = "watch_data_sleep_new_minute-分页列表查询", description = "watch_data_sleep_new_minute-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<WatchDataSleepNewMinute>> queryPageList(WatchDataSleepNewMinute watchDataSleepNewMinute,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<WatchDataSleepNewMinute> queryWrapper = QueryGenerator.initQueryWrapper(watchDataSleepNewMinute, req.getParameterMap());
Page<WatchDataSleepNewMinute> page = new Page<WatchDataSleepNewMinute>(pageNo, pageSize);
IPage<WatchDataSleepNewMinute> pageList = watchDataSleepNewMinuteService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param watchDataSleepNewMinute
* @return
*/
@AutoLog(value = "watch_data_sleep_new_minute-添加")
@Operation(summary = "watch_data_sleep_new_minute-添加", description = "watch_data_sleep_new_minute-添加")
@RequiresPermissions("watch:watch_data_sleep_new_minute:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody WatchDataSleepNewMinute watchDataSleepNewMinute) {
watchDataSleepNewMinuteService.save(watchDataSleepNewMinute);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param watchDataSleepNewMinute
* @return
*/
@AutoLog(value = "watch_data_sleep_new_minute-编辑")
@Operation(summary = "watch_data_sleep_new_minute-编辑", description = "watch_data_sleep_new_minute-编辑")
@RequiresPermissions("watch:watch_data_sleep_new_minute:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
public Result<String> edit(@RequestBody WatchDataSleepNewMinute watchDataSleepNewMinute) {
watchDataSleepNewMinuteService.updateById(watchDataSleepNewMinute);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "watch_data_sleep_new_minute-通过id删除")
@Operation(summary = "watch_data_sleep_new_minute-通过id删除", description = "watch_data_sleep_new_minute-通过id删除")
@RequiresPermissions("watch:watch_data_sleep_new_minute:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
watchDataSleepNewMinuteService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "watch_data_sleep_new_minute-批量删除")
@Operation(summary = "watch_data_sleep_new_minute-批量删除", description = "watch_data_sleep_new_minute-批量删除")
@RequiresPermissions("watch:watch_data_sleep_new_minute:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
this.watchDataSleepNewMinuteService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "watch_data_sleep_new_minute-通过id查询")
@Operation(summary = "watch_data_sleep_new_minute-通过id查询", description = "watch_data_sleep_new_minute-通过id查询")
@GetMapping(value = "/queryById")
public Result<WatchDataSleepNewMinute> queryById(@RequestParam(name = "id", required = true) String id) {
WatchDataSleepNewMinute watchDataSleepNewMinute = watchDataSleepNewMinuteService.getById(id);
if (watchDataSleepNewMinute == null) {
return Result.error("未找到对应数据");
}
return Result.OK(watchDataSleepNewMinute);
}
/**
* 导出excel
*
* @param request
* @param watchDataSleepNewMinute
*/
@RequiresPermissions("watch:watch_data_sleep_new_minute:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, WatchDataSleepNewMinute watchDataSleepNewMinute) {
return super.exportXls(request, watchDataSleepNewMinute, WatchDataSleepNewMinute.class, "watch_data_sleep_new_minute");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequiresPermissions("watch:watch_data_sleep_new_minute:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, WatchDataSleepNewMinute.class);
}
}
@@ -0,0 +1,162 @@
package com.renkang.watch.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.renkang.watch.entity.WatchDataSpo2;
import com.renkang.watch.service.IWatchDataSpo2Service;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
/**
* @Description: watch_data_spo2
* @Author: jeecg-boot
* @Date: 2023-08-08
* @Version: V1.0
*/
@Tag(name = "watch_data_spo2")
@RestController
@RequestMapping("/watch/watchDataSpo2")
@Slf4j
public class WatchDataSpo2Controller extends JeecgController<WatchDataSpo2, IWatchDataSpo2Service> {
@Autowired
private IWatchDataSpo2Service watchDataSpo2Service;
/**
* 分页列表查询
*
* @param watchDataSpo2
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "watch_data_spo2-分页列表查询")
@Operation(summary = "watch_data_spo2-分页列表查询", description = "watch_data_spo2-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<WatchDataSpo2>> queryPageList(WatchDataSpo2 watchDataSpo2,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<WatchDataSpo2> queryWrapper = QueryGenerator.initQueryWrapper(watchDataSpo2, req.getParameterMap());
Page<WatchDataSpo2> page = new Page<WatchDataSpo2>(pageNo, pageSize);
IPage<WatchDataSpo2> pageList = watchDataSpo2Service.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param watchDataSpo2
* @return
*/
@AutoLog(value = "watch_data_spo2-添加")
@Operation(summary = "watch_data_spo2-添加", description = "watch_data_spo2-添加")
@RequiresPermissions("watch:watch_data_spo2:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody WatchDataSpo2 watchDataSpo2) {
watchDataSpo2Service.save(watchDataSpo2);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param watchDataSpo2
* @return
*/
@AutoLog(value = "watch_data_spo2-编辑")
@Operation(summary = "watch_data_spo2-编辑", description = "watch_data_spo2-编辑")
@RequiresPermissions("watch:watch_data_spo2:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
public Result<String> edit(@RequestBody WatchDataSpo2 watchDataSpo2) {
watchDataSpo2Service.updateById(watchDataSpo2);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "watch_data_spo2-通过id删除")
@Operation(summary = "watch_data_spo2-通过id删除", description = "watch_data_spo2-通过id删除")
@RequiresPermissions("watch:watch_data_spo2:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
watchDataSpo2Service.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "watch_data_spo2-批量删除")
@Operation(summary = "watch_data_spo2-批量删除", description = "watch_data_spo2-批量删除")
@RequiresPermissions("watch:watch_data_spo2:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
this.watchDataSpo2Service.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "watch_data_spo2-通过id查询")
@Operation(summary = "watch_data_spo2-通过id查询", description = "watch_data_spo2-通过id查询")
@GetMapping(value = "/queryById")
public Result<WatchDataSpo2> queryById(@RequestParam(name = "id", required = true) String id) {
WatchDataSpo2 watchDataSpo2 = watchDataSpo2Service.getById(id);
if (watchDataSpo2 == null) {
return Result.error("未找到对应数据");
}
return Result.OK(watchDataSpo2);
}
/**
* 导出excel
*
* @param request
* @param watchDataSpo2
*/
@RequiresPermissions("watch:watch_data_spo2:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, WatchDataSpo2 watchDataSpo2) {
return super.exportXls(request, watchDataSpo2, WatchDataSpo2.class, "watch_data_spo2");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequiresPermissions("watch:watch_data_spo2:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, WatchDataSpo2.class);
}
}
@@ -0,0 +1,162 @@
package com.renkang.watch.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.renkang.watch.entity.WatchDataSteps;
import com.renkang.watch.service.IWatchDataStepsService;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
/**
* @Description: watch_data_steps
* @Author: jeecg-boot
* @Date: 2023-08-08
* @Version: V1.0
*/
@Tag(name = "watch_data_steps")
@RestController
@RequestMapping("/watch/watchDataSteps")
@Slf4j
public class WatchDataStepsController extends JeecgController<WatchDataSteps, IWatchDataStepsService> {
@Autowired
private IWatchDataStepsService watchDataStepsService;
/**
* 分页列表查询
*
* @param watchDataSteps
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "watch_data_steps-分页列表查询")
@Operation(summary = "watch_data_steps-分页列表查询", description = "watch_data_steps-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<WatchDataSteps>> queryPageList(WatchDataSteps watchDataSteps,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<WatchDataSteps> queryWrapper = QueryGenerator.initQueryWrapper(watchDataSteps, req.getParameterMap());
Page<WatchDataSteps> page = new Page<WatchDataSteps>(pageNo, pageSize);
IPage<WatchDataSteps> pageList = watchDataStepsService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param watchDataSteps
* @return
*/
@AutoLog(value = "watch_data_steps-添加")
@Operation(summary = "watch_data_steps-添加", description = "watch_data_steps-添加")
@RequiresPermissions("watch:watch_data_steps:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody WatchDataSteps watchDataSteps) {
watchDataStepsService.save(watchDataSteps);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param watchDataSteps
* @return
*/
@AutoLog(value = "watch_data_steps-编辑")
@Operation(summary = "watch_data_steps-编辑", description = "watch_data_steps-编辑")
@RequiresPermissions("watch:watch_data_steps:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
public Result<String> edit(@RequestBody WatchDataSteps watchDataSteps) {
watchDataStepsService.updateById(watchDataSteps);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "watch_data_steps-通过id删除")
@Operation(summary = "watch_data_steps-通过id删除", description = "watch_data_steps-通过id删除")
@RequiresPermissions("watch:watch_data_steps:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
watchDataStepsService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "watch_data_steps-批量删除")
@Operation(summary = "watch_data_steps-批量删除", description = "watch_data_steps-批量删除")
@RequiresPermissions("watch:watch_data_steps:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
this.watchDataStepsService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "watch_data_steps-通过id查询")
@Operation(summary = "watch_data_steps-通过id查询", description = "watch_data_steps-通过id查询")
@GetMapping(value = "/queryById")
public Result<WatchDataSteps> queryById(@RequestParam(name = "id", required = true) String id) {
WatchDataSteps watchDataSteps = watchDataStepsService.getById(id);
if (watchDataSteps == null) {
return Result.error("未找到对应数据");
}
return Result.OK(watchDataSteps);
}
/**
* 导出excel
*
* @param request
* @param watchDataSteps
*/
@RequiresPermissions("watch:watch_data_steps:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, WatchDataSteps watchDataSteps) {
return super.exportXls(request, watchDataSteps, WatchDataSteps.class, "watch_data_steps");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequiresPermissions("watch:watch_data_steps:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, WatchDataSteps.class);
}
}
@@ -0,0 +1,162 @@
package com.renkang.watch.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.renkang.watch.entity.WatchDataStress;
import com.renkang.watch.service.IWatchDataStressService;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
/**
* @Description: watch_data_stress
* @Author: jeecg-boot
* @Date: 2023-08-08
* @Version: V1.0
*/
@Tag(name = "watch_data_stress")
@RestController
@RequestMapping("/watch/watchDataStress")
@Slf4j
public class WatchDataStressController extends JeecgController<WatchDataStress, IWatchDataStressService> {
@Autowired
private IWatchDataStressService watchDataStressService;
/**
* 分页列表查询
*
* @param watchDataStress
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "watch_data_stress-分页列表查询")
@Operation(summary = "watch_data_stress-分页列表查询", description = "watch_data_stress-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<WatchDataStress>> queryPageList(WatchDataStress watchDataStress,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<WatchDataStress> queryWrapper = QueryGenerator.initQueryWrapper(watchDataStress, req.getParameterMap());
Page<WatchDataStress> page = new Page<WatchDataStress>(pageNo, pageSize);
IPage<WatchDataStress> pageList = watchDataStressService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param watchDataStress
* @return
*/
@AutoLog(value = "watch_data_stress-添加")
@Operation(summary = "watch_data_stress-添加", description = "watch_data_stress-添加")
@RequiresPermissions("watch:watch_data_stress:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody WatchDataStress watchDataStress) {
watchDataStressService.save(watchDataStress);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param watchDataStress
* @return
*/
@AutoLog(value = "watch_data_stress-编辑")
@Operation(summary = "watch_data_stress-编辑", description = "watch_data_stress-编辑")
@RequiresPermissions("watch:watch_data_stress:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
public Result<String> edit(@RequestBody WatchDataStress watchDataStress) {
watchDataStressService.updateById(watchDataStress);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "watch_data_stress-通过id删除")
@Operation(summary = "watch_data_stress-通过id删除", description = "watch_data_stress-通过id删除")
@RequiresPermissions("watch:watch_data_stress:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
watchDataStressService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "watch_data_stress-批量删除")
@Operation(summary = "watch_data_stress-批量删除", description = "watch_data_stress-批量删除")
@RequiresPermissions("watch:watch_data_stress:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
this.watchDataStressService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "watch_data_stress-通过id查询")
@Operation(summary = "watch_data_stress-通过id查询", description = "watch_data_stress-通过id查询")
@GetMapping(value = "/queryById")
public Result<WatchDataStress> queryById(@RequestParam(name = "id", required = true) String id) {
WatchDataStress watchDataStress = watchDataStressService.getById(id);
if (watchDataStress == null) {
return Result.error("未找到对应数据");
}
return Result.OK(watchDataStress);
}
/**
* 导出excel
*
* @param request
* @param watchDataStress
*/
@RequiresPermissions("watch:watch_data_stress:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, WatchDataStress watchDataStress) {
return super.exportXls(request, watchDataStress, WatchDataStress.class, "watch_data_stress");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequiresPermissions("watch:watch_data_stress:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, WatchDataStress.class);
}
}
@@ -0,0 +1,162 @@
package com.renkang.watch.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.renkang.watch.entity.WatchDataTemperature;
import com.renkang.watch.service.IWatchDataTemperatureService;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
/**
* @Description: watch_data_temperature
* @Author: jeecg-boot
* @Date: 2023-08-08
* @Version: V1.0
*/
@Tag(name = "watch_data_temperature")
@RestController
@RequestMapping("/watch/watchDataTemperature")
@Slf4j
public class WatchDataTemperatureController extends JeecgController<WatchDataTemperature, IWatchDataTemperatureService> {
@Autowired
private IWatchDataTemperatureService watchDataTemperatureService;
/**
* 分页列表查询
*
* @param watchDataTemperature
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "watch_data_temperature-分页列表查询")
@Operation(summary = "watch_data_temperature-分页列表查询", description = "watch_data_temperature-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<WatchDataTemperature>> queryPageList(WatchDataTemperature watchDataTemperature,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<WatchDataTemperature> queryWrapper = QueryGenerator.initQueryWrapper(watchDataTemperature, req.getParameterMap());
Page<WatchDataTemperature> page = new Page<WatchDataTemperature>(pageNo, pageSize);
IPage<WatchDataTemperature> pageList = watchDataTemperatureService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param watchDataTemperature
* @return
*/
@AutoLog(value = "watch_data_temperature-添加")
@Operation(summary = "watch_data_temperature-添加", description = "watch_data_temperature-添加")
@RequiresPermissions("watch:watch_data_temperature:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody WatchDataTemperature watchDataTemperature) {
watchDataTemperatureService.save(watchDataTemperature);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param watchDataTemperature
* @return
*/
@AutoLog(value = "watch_data_temperature-编辑")
@Operation(summary = "watch_data_temperature-编辑", description = "watch_data_temperature-编辑")
@RequiresPermissions("watch:watch_data_temperature:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
public Result<String> edit(@RequestBody WatchDataTemperature watchDataTemperature) {
watchDataTemperatureService.updateById(watchDataTemperature);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "watch_data_temperature-通过id删除")
@Operation(summary = "watch_data_temperature-通过id删除", description = "watch_data_temperature-通过id删除")
@RequiresPermissions("watch:watch_data_temperature:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
watchDataTemperatureService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "watch_data_temperature-批量删除")
@Operation(summary = "watch_data_temperature-批量删除", description = "watch_data_temperature-批量删除")
@RequiresPermissions("watch:watch_data_temperature:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
this.watchDataTemperatureService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "watch_data_temperature-通过id查询")
@Operation(summary = "watch_data_temperature-通过id查询", description = "watch_data_temperature-通过id查询")
@GetMapping(value = "/queryById")
public Result<WatchDataTemperature> queryById(@RequestParam(name = "id", required = true) String id) {
WatchDataTemperature watchDataTemperature = watchDataTemperatureService.getById(id);
if (watchDataTemperature == null) {
return Result.error("未找到对应数据");
}
return Result.OK(watchDataTemperature);
}
/**
* 导出excel
*
* @param request
* @param watchDataTemperature
*/
@RequiresPermissions("watch:watch_data_temperature:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, WatchDataTemperature watchDataTemperature) {
return super.exportXls(request, watchDataTemperature, WatchDataTemperature.class, "watch_data_temperature");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequiresPermissions("watch:watch_data_temperature:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, WatchDataTemperature.class);
}
}
@@ -0,0 +1,162 @@
package com.renkang.watch.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.renkang.watch.entity.WatchDataWorkout;
import com.renkang.watch.service.IWatchDataWorkoutService;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
/**
* @Description: watch_data_workout
* @Author: jeecg-boot
* @Date: 2023-08-08
* @Version: V1.0
*/
@Tag(name = "watch_data_workout")
@RestController
@RequestMapping("/watch/watchDataWorkout")
@Slf4j
public class WatchDataWorkoutController extends JeecgController<WatchDataWorkout, IWatchDataWorkoutService> {
@Autowired
private IWatchDataWorkoutService watchDataWorkoutService;
/**
* 分页列表查询
*
* @param watchDataWorkout
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "watch_data_workout-分页列表查询")
@Operation(summary = "watch_data_workout-分页列表查询", description = "watch_data_workout-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<WatchDataWorkout>> queryPageList(WatchDataWorkout watchDataWorkout,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<WatchDataWorkout> queryWrapper = QueryGenerator.initQueryWrapper(watchDataWorkout, req.getParameterMap());
Page<WatchDataWorkout> page = new Page<WatchDataWorkout>(pageNo, pageSize);
IPage<WatchDataWorkout> pageList = watchDataWorkoutService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param watchDataWorkout
* @return
*/
@AutoLog(value = "watch_data_workout-添加")
@Operation(summary = "watch_data_workout-添加", description = "watch_data_workout-添加")
@RequiresPermissions("watch:watch_data_workout:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody WatchDataWorkout watchDataWorkout) {
watchDataWorkoutService.save(watchDataWorkout);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param watchDataWorkout
* @return
*/
@AutoLog(value = "watch_data_workout-编辑")
@Operation(summary = "watch_data_workout-编辑", description = "watch_data_workout-编辑")
@RequiresPermissions("watch:watch_data_workout:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
public Result<String> edit(@RequestBody WatchDataWorkout watchDataWorkout) {
watchDataWorkoutService.updateById(watchDataWorkout);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "watch_data_workout-通过id删除")
@Operation(summary = "watch_data_workout-通过id删除", description = "watch_data_workout-通过id删除")
@RequiresPermissions("watch:watch_data_workout:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
watchDataWorkoutService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "watch_data_workout-批量删除")
@Operation(summary = "watch_data_workout-批量删除", description = "watch_data_workout-批量删除")
@RequiresPermissions("watch:watch_data_workout:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
this.watchDataWorkoutService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "watch_data_workout-通过id查询")
@Operation(summary = "watch_data_workout-通过id查询", description = "watch_data_workout-通过id查询")
@GetMapping(value = "/queryById")
public Result<WatchDataWorkout> queryById(@RequestParam(name = "id", required = true) String id) {
WatchDataWorkout watchDataWorkout = watchDataWorkoutService.getById(id);
if (watchDataWorkout == null) {
return Result.error("未找到对应数据");
}
return Result.OK(watchDataWorkout);
}
/**
* 导出excel
*
* @param request
* @param watchDataWorkout
*/
@RequiresPermissions("watch:watch_data_workout:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, WatchDataWorkout watchDataWorkout) {
return super.exportXls(request, watchDataWorkout, WatchDataWorkout.class, "watch_data_workout");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequiresPermissions("watch:watch_data_workout:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, WatchDataWorkout.class);
}
}
@@ -0,0 +1,162 @@
package com.renkang.watch.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.renkang.watch.entity.WatchDataWorkoutTrace;
import com.renkang.watch.service.IWatchDataWorkoutTraceService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
/**
* @Description: watch_data_workout_trace
* @Author: jeecg-boot
* @Date: 2023-08-08
* @Version: V1.0
*/
@Tag(name = "watch_data_workout_trace")
@RestController
@RequestMapping("/watch/watchDataWorkoutTrace")
@Slf4j
public class WatchDataWorkoutTraceController extends JeecgController<WatchDataWorkoutTrace, IWatchDataWorkoutTraceService> {
@Autowired
private IWatchDataWorkoutTraceService watchDataWorkoutTraceService;
/**
* 分页列表查询
*
* @param watchDataWorkoutTrace
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "watch_data_workout_trace-分页列表查询")
@Operation(summary = "watch_data_workout_trace-分页列表查询", description = "watch_data_workout_trace-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<WatchDataWorkoutTrace>> queryPageList(WatchDataWorkoutTrace watchDataWorkoutTrace,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<WatchDataWorkoutTrace> queryWrapper = QueryGenerator.initQueryWrapper(watchDataWorkoutTrace, req.getParameterMap());
Page<WatchDataWorkoutTrace> page = new Page<WatchDataWorkoutTrace>(pageNo, pageSize);
IPage<WatchDataWorkoutTrace> pageList = watchDataWorkoutTraceService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param watchDataWorkoutTrace
* @return
*/
@AutoLog(value = "watch_data_workout_trace-添加")
@Operation(summary = "watch_data_workout_trace-添加", description = "watch_data_workout_trace-添加")
@RequiresPermissions("watch:watch_data_workout_trace:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody WatchDataWorkoutTrace watchDataWorkoutTrace) {
watchDataWorkoutTraceService.save(watchDataWorkoutTrace);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param watchDataWorkoutTrace
* @return
*/
@AutoLog(value = "watch_data_workout_trace-编辑")
@Operation(summary = "watch_data_workout_trace-编辑", description = "watch_data_workout_trace-编辑")
@RequiresPermissions("watch:watch_data_workout_trace:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
public Result<String> edit(@RequestBody WatchDataWorkoutTrace watchDataWorkoutTrace) {
watchDataWorkoutTraceService.updateById(watchDataWorkoutTrace);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "watch_data_workout_trace-通过id删除")
@Operation(summary = "watch_data_workout_trace-通过id删除", description = "watch_data_workout_trace-通过id删除")
@RequiresPermissions("watch:watch_data_workout_trace:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
watchDataWorkoutTraceService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "watch_data_workout_trace-批量删除")
@Operation(summary = "watch_data_workout_trace-批量删除", description = "watch_data_workout_trace-批量删除")
@RequiresPermissions("watch:watch_data_workout_trace:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
this.watchDataWorkoutTraceService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "watch_data_workout_trace-通过id查询")
@Operation(summary = "watch_data_workout_trace-通过id查询", description = "watch_data_workout_trace-通过id查询")
@GetMapping(value = "/queryById")
public Result<WatchDataWorkoutTrace> queryById(@RequestParam(name = "id", required = true) String id) {
WatchDataWorkoutTrace watchDataWorkoutTrace = watchDataWorkoutTraceService.getById(id);
if (watchDataWorkoutTrace == null) {
return Result.error("未找到对应数据");
}
return Result.OK(watchDataWorkoutTrace);
}
/**
* 导出excel
*
* @param request
* @param watchDataWorkoutTrace
*/
@RequiresPermissions("watch:watch_data_workout_trace:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, WatchDataWorkoutTrace watchDataWorkoutTrace) {
return super.exportXls(request, watchDataWorkoutTrace, WatchDataWorkoutTrace.class, "watch_data_workout_trace");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequiresPermissions("watch:watch_data_workout_trace:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, WatchDataWorkoutTrace.class);
}
}
@@ -0,0 +1,83 @@
package com.renkang.watch.controller;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.lang.Validator;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.renkang.watch.entity.WatchDepartReport;
import com.renkang.watch.service.IWatchDepartReportService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
* @author Shunzhi Jiang
* @since 2024/3/25
*/
@Tag(name = "watch_depart_report")
@RestController
@RequestMapping("/watch/watchDepartReport")
@Slf4j
public class WatchDepartReportController extends JeecgController<WatchDepartReport, IWatchDepartReportService> {
@Autowired
private IWatchDepartReportService watchDepartReportService;
private static final List<Integer> MONTHS = CollectionUtil.toList(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12);
@Operation(summary = "watch_depart_report-分页列表查询", description = "watch_depart_report-分页列表查询")
@GetMapping("/list")
public Result<List<WatchDepartReport>> queryPageList(WatchDepartReport departReport, HttpServletRequest req) {
checkParams(departReport, true);
if (Objects.isNull(departReport.getReportYear())) {
departReport.setReportYear(DateUtil.year(DateUtil.date()));
}
QueryWrapper<WatchDepartReport> queryWrapper = QueryGenerator.initQueryWrapper(departReport, req.getParameterMap());
Map<Integer, WatchDepartReport> reportMap = watchDepartReportService.list(queryWrapper)
.stream()
.collect(Collectors.toMap(WatchDepartReport::getReportMonth, Function.identity()));
return Result.OK(fillMonths(reportMap));
}
private List<WatchDepartReport> fillMonths(Map<Integer, WatchDepartReport> reportMap) {
return MONTHS.stream()
.map(month -> reportMap.getOrDefault(month, emptyReport(month)))
.collect(Collectors.toList());
}
private WatchDepartReport emptyReport(Integer month) {
return WatchDepartReport.builder().reportMonth(month).genFlag(WatchDepartReport.GEN_FLAG_NONE).build();
}
@PostMapping("/generate")
public Result<Boolean> generate(@RequestBody WatchDepartReport watchDepartReport) {
checkParams(watchDepartReport, false);
return Result.OK("报告生成中,请耐心等待", watchDepartReportService.generate(watchDepartReport));
}
@PostMapping("/forceCancel/{id}")
public Result<Boolean> forceCancel(@PathVariable String id) {
return Result.OK(watchDepartReportService.forceCancel(id));
}
private void checkParams(WatchDepartReport watchDepartReport, boolean onlyDepart) {
Validator.validateNotEmpty(watchDepartReport.getOrgCode(), "请选择部门");
if (!onlyDepart) {
Validator.validateNotNull(watchDepartReport.getReportYear(), "请选择年份");
Validator.validateNotNull(watchDepartReport.getReportMonth(), "请选择月份");
}
}
}
@@ -0,0 +1,792 @@
package com.renkang.watch.controller;
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.fasterxml.jackson.annotation.JsonFormat;
import com.renkang.watch.async.AsyncImportService;
import com.renkang.watch.bean.request.AbnormalEventFilter;
import com.renkang.watch.bean.response.UserDataStat;
import com.renkang.watch.dto.*;
import com.renkang.watch.entity.*;
import com.renkang.watch.service.IWatchBindHisService;
import com.renkang.watch.service.IWatchDataWorkoutService;
import com.renkang.watch.service.IWatchDeviceService;
import com.renkang.watch.service.IWatchDeviceSwitchService;
import com.renkang.watch.vo.*;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.aspect.annotation.PermissionData;
import org.jeecg.common.exception.JeecgBootException;
import org.jeecg.common.system.api.ISysBaseAPI;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.common.util.DateUtils;
import org.jeecg.global.GlobalUtils;
import org.jeecg.modules.exports.entity.CommonExportsInfo;
import org.jeecg.modules.manager.ISysCache;
import org.jeecg.modules.system.entity.SysDepart;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.util.StreamUtils;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.ModelAndView;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.io.ByteArrayInputStream;
import java.text.ParseException;
import java.util.*;
/**
* @Description: watch_device
* @Author: jeecg-boot
* @Date: 2023-08-08
* @Version: V1.0
*/
@Tag(name = "手表/后台/工具管理")
@RestController
@RequestMapping("/watch/watchDevice")
@Slf4j
public class WatchDeviceController extends JeecgController<WatchDevice, IWatchDeviceService> {
@Autowired
private IWatchDeviceService watchDeviceService;
@Resource
private IWatchDataWorkoutService workoutService;
@Autowired
private IWatchBindHisService watchBindHisService;
@Autowired
private IWatchDeviceSwitchService switchService;
@Resource
private ISysBaseAPI sysBaseAPI;
@Autowired
private ISysCache sysCache;
@Resource
private AsyncImportService asyncImportService;
/**
* 已绑定用户的设备列表
*
* @param filter 条件
* @param pageNo 页码
* @param pageSize 条数
* @return bean
*/
@GetMapping(value = "boundUsersDevices")
public Result<IPage<UserDataStat>> boundUsersDevices(AbnormalEventFilter filter,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
return Result.OK(watchDeviceService.boundUsersDevices(filter, pageNo, pageSize));
}
/**
* 分页列表查询
*
* @param dto
* @return
*/
//@AutoLog(value = "watch_device-分页列表查询")
@Operation(summary = "watch_device-分页列表查询", description = "watch_device-分页列表查询")
@GetMapping(value = "/list")
@PermissionData(pageComponent = "healthMonitor/healMonitorManage/monitorToll/toolManagement/toolManagementList")
public Result<IPage<WatchDeviceVo>> queryPageList(WatchDeviceDTO dto) {
Page<WatchDeviceVo> page = new Page<>(dto.getPageNo(), dto.getPageSize());
return Result.OK(watchDeviceService.queryPageList(page, dto));
}
/**
* 工具管理导出
*
* @param dto filter
* @return str
*/
@GetMapping(value = "export")
public Result<String> export(WatchDeviceDTO dto) {
watchDeviceService.export(dto);
return Result.OK("导出成功,请在导出记录查看");
}
/**
* 注:只为干预急救联动穿戴信息使用
*
* @param name
* @param workNo
* @param orgCode
* @param deptCode
* @param pageNo
* @param pageSize
* @return
*/
@Operation(summary = "只为急救联动提供的手表方法 - 查询单位下的所有手表分页", description = "只为急救联动提供的手表方法 - 查询单位下的所有手表分页")
@GetMapping(value = "/pageByOrgCode")
public Result<Page<WatchDeviceListVO>> getWatchPage(
@RequestParam(name = "name", required = false) @Parameter(description = "员工姓名") String name,
@RequestParam(name = "workNo", required = false) @Parameter(description = "员工工号") String workNo,
@RequestParam(name = "orgCode", required = true) @Parameter(description = "单位编码") String orgCode,
@RequestParam(name = "deptCode", required = false) @Parameter(description = "部门编码") String deptCode,
@RequestParam(name = "watchNo", required = false) @Parameter(description = "设备编号") String watchNo,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
return Result.OK(watchDeviceService.getWatchPage(name, workNo, orgCode, deptCode, watchNo, pageNo, pageSize));
}
/**
* 注:只为急救联动提供的分页查询手表总数方法
* 查询医疗点数量方法
*/
@GetMapping(value = "/watch/sum")
@Operation(summary = "只为急救联动提供的手表方法 - 根据单位查询手表数量", description = "只为急救联动提供的手表方法 - 根据单位查询手表数量")
public Map<String, Long> getWatchSum() {
return watchDeviceService.getWatchSum();
}
/**
* 工具开关
*
* @param dtoList
* @return
*/
@Operation(summary = "工具开关", description = "工具开关")
@PostMapping(value = "/switch")
@RequiresPermissions("watch:watch_device:switch")
public Result<Boolean> switchTool(@RequestBody List<WatchSwitchDTO> dtoList) {
if (watchDeviceService.switchTool(dtoList)) {
return Result.OK("操作成功", true);
}
return Result.error("操作失败", false);
}
/**
* 绑定用户
*
* @param dto
* @return
*/
@Operation(summary = "绑定用户", description = "绑定用户")
@PostMapping(value = "/bindUser")
@RequiresPermissions("watch:watch_device:bindUser")
public Result bindUser(@RequestBody() BindUserDTO dto) throws ParseException {
return watchDeviceService.bindUser(dto);
}
/**
* 解绑用户
*
* @param dto
* @return
*/
@Operation(summary = "解绑用户", description = "解绑用户")
@PostMapping(value = "/unbundleUser")
@RequiresPermissions("watch:watch_device:unbindUser")
public Result unbundleUser(@RequestBody() BindUserDTO dto) throws ParseException {
return watchDeviceService.unbundleUser(dto);
}
/**
* 设置上传频次
*
* @param rateVo
* @return
*/
@Operation(summary = "上传频次", description = "上传频次")
@PostMapping(value = "/setRate")
@RequiresPermissions("watch:watch_device:setRate")
public Result<Boolean> setRate(@RequestBody WatchRateVo rateVo) {
return Result.OK("操作成功", watchDeviceService.setRate(rateVo));
}
/**
* 查询上传频次
*
* @param watchNo
* @return
*/
@Operation(summary = "查询上传频次", description = "查询上传频次")
@GetMapping(value = "/selectRateByWatchNo")
public Result<Object> selectRateByWatchNo(@RequestParam(name = "watchNo") String watchNo) {
return watchDeviceService.selectRateByWatchNo(watchNo);
}
/**
* 设置阈值
*
* @param periodVo
* @return
*/
@Operation(summary = "设置阈值", description = "设置阈值")
@PostMapping(value = "/setPeriod")
@RequiresPermissions("watch:watch_device:setPeriod")
public Result<Boolean> setPeriod(@RequestBody WatchPeriodVo periodVo) {
return Result.OK("操作成功", watchDeviceService.setPeriod(periodVo));
}
/**
* 查询阈值
*
* @param watchNo
* @return
*/
@Operation(summary = "查询阈值", description = "查询阈值")
@GetMapping(value = "/selectPeriodByWatchNo")
public Result<Object> selectPeriodByWatchNo(@RequestParam(name = "watchNo") String watchNo) {
return watchDeviceService.selectPeriodByWatchNo(watchNo);
}
// /**
// * 设置报警开关
// * @param warnSwitchVo
// * @return
// */
// @Operation(summary = "设置报警开关", description = "设置报警开关")
// @PostMapping(value = "/setWarnSwitch")
// public Result<Boolean> setWarnSwitch(@RequestBody WatchWarnSwitchVo warnSwitchVo) {
// return Result.OK("操作成功",watchDeviceService.setWarnSwitch(warnSwitchVo));
// }
//
// /**
// * 查询报警开关
// * @param watchNo
// * @return
// */
// @Operation(summary = "查询报警开关", description = "查询报警开关")
// @GetMapping(value = "/selectWarnSwitchByWatchNo")
// public Result<Object> selectWarnSwitchByWatchNo(@RequestParam(name = "watchNo") String watchNo) {
// return watchDeviceService.selectWarnSwitchByWatchNo(watchNo);
// }
/**
* 添加
*
* @param watchDevice
* @return
*/
@AutoLog(value = "watch_device-添加")
@Operation(summary = "watch_device-添加", description = "watch_device-添加")
@RequiresPermissions("watch:watch_device:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody WatchDevice watchDevice) {
// 删除开关
LambdaUpdateWrapper<WatchDeviceSwitch> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(WatchDeviceSwitch::getWatchNo, watchDevice.getWatchNo());
updateWrapper.set(WatchDeviceSwitch::getSwitchFlag, "0");
boolean update = switchService.update(updateWrapper);
if (!update) {
// 没有开关 插入开关
List<WatchDeviceSwitch> list = new ArrayList<>();
WatchDeviceSwitch deviceSwitch1 = new WatchDeviceSwitch();
deviceSwitch1.setSwitchFlag("1");
deviceSwitch1.setWatchNo(watchDevice.getWatchNo());
deviceSwitch1.setWdType("heart_rate");
list.add(deviceSwitch1);
WatchDeviceSwitch deviceSwitch2 = new WatchDeviceSwitch();
deviceSwitch2.setSwitchFlag("1");
deviceSwitch2.setWatchNo(watchDevice.getWatchNo());
deviceSwitch2.setWdType("spo2");
list.add(deviceSwitch2);
WatchDeviceSwitch deviceSwitch3 = new WatchDeviceSwitch();
deviceSwitch3.setSwitchFlag("1");
deviceSwitch3.setWatchNo(watchDevice.getWatchNo());
deviceSwitch3.setWdType("stress");
list.add(deviceSwitch3);
WatchDeviceSwitch deviceSwitch4 = new WatchDeviceSwitch();
deviceSwitch4.setSwitchFlag("1");
deviceSwitch4.setWatchNo(watchDevice.getWatchNo());
deviceSwitch4.setWdType("temperature");
list.add(deviceSwitch4);
switchService.saveOrUpdateBatch(list);
}
watchDevice.setOrgCode(sysCache.getDepartById(watchDevice.getDeptId()).getOrgCode());
watchDeviceService.save(watchDevice);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param watchDevice
* @return
*/
@AutoLog(value = "watch_device-编辑")
@Operation(summary = "watch_device-编辑", description = "watch_device-编辑")
@RequiresPermissions("watch:watch_device:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
public Result<String> edit(@RequestBody WatchDevice watchDevice) {
watchDeviceService.updateById(watchDevice);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "watch_device-通过id删除")
@Operation(summary = "watch_device-通过id删除", description = "watch_device-通过id删除")
@RequiresPermissions("watch:watch_device:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
WatchDevice watchDevice = watchDeviceService.getById(id);
watchDeviceService.removeById(id);
// 删除开关
LambdaQueryWrapper<WatchDeviceSwitch> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(WatchDeviceSwitch::getWatchNo, watchDevice.getWatchNo());
switchService.remove(queryWrapper);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "watch_device-批量删除")
@Operation(summary = "watch_device-批量删除", description = "watch_device-批量删除")
@RequiresPermissions("watch:watch_device:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
this.watchDeviceService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "watch_device-通过id查询")
@Operation(summary = "watch_device-通过id查询", description = "watch_device-通过id查询")
@GetMapping(value = "/queryById")
public Result<WatchDevice> queryById(@RequestParam(name = "id", required = true) String id) {
WatchDevice watchDevice = watchDeviceService.getById(id);
if (watchDevice == null) {
return Result.error("未找到对应数据");
}
return Result.OK(watchDevice);
}
/**
* 导出excel
*
* @param request
* @param watchDevice
*/
@RequiresPermissions("watch:watch_device:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, WatchDevice watchDevice) {
return super.exportXls(request, watchDevice, WatchDevice.class, "watch_device");
}
// 导入设备code
private final String WATCH_IMPORT_CODE = "importWatchCode";
// 导入设备中
private final String WATCH_IMPORT_DOING = "9";
// 导入设备完成
private final String WATCH_IMPORT_FINISH = "10";
// 导入设备失败
private final String WATCH_IMPORT_ERRCODE = "11";
/**
* 通过excel导入数据
*
* @param file
* @param deptId
* @param orgId
* @return
* @throws Exception
*/
@RequiresPermissions("watch:watch_device:importExcel")
@RequestMapping(value = "/importExcel", consumes = "multipart/*", method = RequestMethod.POST, headers = "content-type=multipart/form-data")
public Result<?> importExcel(@Parameter(description = "文件", required = true) MultipartFile file, String deptId, String orgId) throws Exception {
Boolean flag = sysBaseAPI.getFinishFlagByCode(WATCH_IMPORT_CODE, WATCH_IMPORT_DOING);
if (!flag) {
return Result.error("已存在执行中的导入任务,请稍后导入或点击【查看导入任务】查看任务导出进度!");
}
if (!StringUtils.hasLength(deptId) || "undefined".equals(deptId)) {
throw new JeecgBootException("部门不能为空");
}
String sheetName = "设备导入";
String fileName = sheetName + "_" + DateUtils.getDate("yyyyMMddHHmmss");
CommonExportsInfo info = new CommonExportsInfo();
info.setBatchNo(String.valueOf(System.currentTimeMillis()));
LoginUser loginUser = GlobalUtils.getLoginUser();
final String userId = loginUser.getId();
info.setHandleMsg("0/0");
info.setCreateBy(userId);
info.setCreateDate(new Date());
info.setExportMsg("设备导入");
info.setTaskCode(WATCH_IMPORT_CODE);
//数据导出中
info.setExportStatus(WATCH_IMPORT_DOING);
info.setHandleStartTime(new Date());
CommonExportsInfo commonExportsInfo = sysBaseAPI.updateExportsInfo(info);
String id = commonExportsInfo.getId();
CommonExportsInfo info1 = sysBaseAPI.getExportsInfoById(id);
byte[] bytes = StreamUtils.copyToByteArray(file.getInputStream());
ByteArrayInputStream in = new ByteArrayInputStream(bytes);
// 使用异步方法执行导入逻辑
asyncImportService.asyncImport(in, deptId, info1, WATCH_IMPORT_FINISH, WATCH_IMPORT_ERRCODE, sheetName, fileName);
return watchDeviceService.importExcel();
}
// 导入设备code
private final String WATCH_IMPORT_BIND_CODE = "importWatchBindCode";
// 导入设备中
private final String WATCH_IMPORT_BIND_DOING = "9";
// 导入设备完成
private final String WATCH_IMPORT_BIND_FINISH = "10";
// 导入设备失败
private final String WATCH_IMPORT_BIND_ERRCODE = "11";
/**
* 通过excel导入绑定数据
*
* @param file
* @return
* @throws Exception
*/
// @RequiresPermissions("watch:watch_device:importExcel")
@Operation(summary = "导入绑定数据", description = "导入绑定数据")
@RequestMapping(value = "/importExcelBindData", consumes = "multipart/*", method = RequestMethod.POST, headers = "content-type=multipart/form-data")
public Result importExcelBindData(@Parameter(description = "文件", required = true) MultipartFile file) throws Exception {
Boolean flag = sysBaseAPI.getFinishFlagByCode(WATCH_IMPORT_BIND_CODE, WATCH_IMPORT_BIND_DOING);
if (!flag) {
return Result.error("已存在执行中的导入任务,请稍后导入或点击【查看导入任务】查看任务导出进度!");
}
CommonExportsInfo info = new CommonExportsInfo();
info.setBatchNo(String.valueOf(System.currentTimeMillis()));
LoginUser loginUser = GlobalUtils.getLoginUser();
final String userId = loginUser.getId();
info.setHandleMsg("0/0");
info.setCreateBy(userId);
info.setCreateDate(new Date());
info.setExportMsg("设备绑定导入");
info.setTaskCode(WATCH_IMPORT_BIND_CODE);
//数据导入中
info.setExportStatus(WATCH_IMPORT_BIND_DOING);
info.setHandleStartTime(new Date());
CommonExportsInfo commonExportsInfo = sysBaseAPI.updateExportsInfo(info);
String id = commonExportsInfo.getId();
CommonExportsInfo info1 = sysBaseAPI.getExportsInfoById(id);
byte[] bytes = StreamUtils.copyToByteArray(file.getInputStream());
ByteArrayInputStream in = new ByteArrayInputStream(bytes);
// 使用异步方法执行导入逻辑
asyncImportService.asyncImportData(in, info1, WATCH_IMPORT_BIND_FINISH, WATCH_IMPORT_BIND_ERRCODE);
return watchDeviceService.importExcelBindData();
}
/**
* 获取已绑定员工id
*
* @return
*/
@GetMapping("/getBindUserIdList")
public List<String> getBindUserIdList() {
return watchDeviceService.getBindUserIdList();
}
/**
* 根据UserId查询是否有手表2
*
* @return
*/
@GetMapping("/getWatchDeviceByUserId")
public Result<Boolean> getWatchDeviceByUserId(@RequestParam(name = "userId", required = true) String userId) {
WatchDevice watchDevice = watchDeviceService.getWatchDeviceByUserId(userId);
if (watchDevice == null) {
return Result.ok(false);
}
return Result.ok(true);
}
/**
* 修改手表部门
*
* @param dto
* @return
*/
@PostMapping("/updateWatchDeptId")
public Boolean updateWatchDeptId(@RequestBody WatchDeviceDTO dto) {
return watchDeviceService.updateWatchDeptId(dto);
}
@Operation(summary = "应急大屏-副屏地图", description = "应急大屏-副屏地图")
@GetMapping(value = "/getMapList")
public Result<List<SysDepart>> getMapList(@RequestParam String orgCode) {
return Result.OK(watchDeviceService.getMapList(orgCode));
}
/**
* 应急大屏-副屏地图 新的
*
* @return
*/
@Operation(summary = "应急大屏-副屏地图 新的", description = "应急大屏-副屏地图 新的")
@GetMapping(value = "/selectDeptMapList")
public Result<List<SysDepart>> selectDeptMapList() {
return watchDeviceService.selectDeptMapList();
}
@Operation(summary = "应急大屏-副屏根据部门id查询该部门人数列表", description = "应急大屏-副屏根据部门id查询该部门人数列表")
@GetMapping(value = "/getUserListByDeptId")
public Result<IPage<UserDetailVo>> getUserListByDeptId(@RequestParam String orgId,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
Page<WatchDevice> page = new Page<>(pageNo, pageSize);
return Result.OK(watchDeviceService.getUserListByDeptId(page, orgId));
}
/**
* 手表列表查询
*
* @return
*/
@GetMapping(value = "/getUnitList")
public Result<List<Object>> getUnitList() {
List<Object> list = watchDeviceService.getUnitList();
return Result.OK(list);
}
/**
* 手表定时器
*
* @return
*/
@GetMapping(value = "/unitListJob")
public Result<String> unitListJob() {
watchDeviceService.unitListJob();
return Result.OK();
}
/**
* 增加要排除的手表
*
* @param watchNo
* @return
*/
@GetMapping(value = "/addUnitListEx")
public Result<String> addUnitListEx(@RequestParam(name = "watchNo") String watchNo) {
return watchDeviceService.addUnitListEx(watchNo);
}
/**
* 移除要排除的手表
*
* @param watchNo
* @return
*/
@GetMapping(value = "/removeUnitListEx")
public Result<String> removeUnitListEx(@RequestParam(name = "watchNo", required = false) String watchNo) {
return watchDeviceService.removeUnitListEx(watchNo);
}
/**
* 更新orgCode
*/
@GetMapping(value = "/updateOrgCodeByDeptId")
public Result<Boolean> updateOrgCodeByDeptId() {
boolean b = watchDeviceService.updateOrgCodeByDeptId();
if (b) {
return Result.ok("ok");
}
// if(CollectionUtil.isNotEmpty(list)){
// list.stream().forEach(r->{
// if(StrUtil.isNotBlank(r.getDeptId())){
// String deptId = r.getDeptId();
// SysDepart departById = sysCache.getDepartById(deptId);
// r.setOrgCode(departById.getOrgCode());
// }
// });
// }
// watchDeviceService.updateBatchById(list);
return Result.error("异常");
}
/**
* 修改目前所有开关为开启状态
*
* @return
*/
@Operation(summary = "修改目前所有开关为开启状态", description = "修改目前所有开关为开启状态")
@GetMapping(value = "/initSwitchAll")
public Result<Boolean> initSwitchAll() {
watchDeviceService.initSwitchAll();
return Result.ok("ok");
}
@PostMapping("/isHaveWatchByUserId")
public Boolean isHaveWatchByUserId(@RequestBody LoginUser sysUser) {
List<WatchBindHis> list = watchBindHisService.list(
new LambdaQueryWrapper<WatchBindHis>()
.eq(WatchBindHis::getBindUserId, sysUser.getId())
.isNull(WatchBindHis::getBindEndDate));
return CollectionUtils.isNotEmpty(list) && !list.isEmpty();
}
@PostMapping("/getWorkoutDataByUserIds")
public List<WatchWorkoutVO> getWorkoutDataByUserIds(@RequestBody List<WatchWorkoutDTO> dtoList) {
List<WatchWorkoutVO> voList = new ArrayList<>();
for (WatchWorkoutDTO dto : dtoList) {
WatchWorkoutVO vo = new WatchWorkoutVO();
vo.setPlanId(dto.getPlanId());
LambdaQueryWrapper<WatchDataWorkout> workoutWrapper = new LambdaQueryWrapper<>();
workoutWrapper.in(WatchDataWorkout::getWorkoutType, dto.getExerciseType());
workoutWrapper.in(WatchDataWorkout::getBindUserId, dto.getUserIds());
workoutWrapper.ge(WatchDataWorkout::getDataDate, dto.getStartTime());
workoutWrapper.le(WatchDataWorkout::getDataDate, dto.getEndTime());
List<WatchDataWorkout> list = workoutService.list(workoutWrapper);
vo.setWorkoutList(list);
voList.add(vo);
}
return voList;
}
@Operation(summary = "获取时间范围的走跑数据", description = "获取时间范围的走跑数据")
@PostMapping("getSdcDataByUserIds")
public List<UserDaySdcInfoVo> getSdcDataByUserIds(@RequestBody List<String> userIds,
@RequestParam(name = "startTime")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd") Date startTime,
@RequestParam(name = "endTime")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
return watchDeviceService.getSdcDataByUserIds(userIds, startTime, endTime);
}
@Operation(summary = "获取时间范围的走跑数据", description = "获取时间范围的走跑数据")
@PostMapping("getSdcDataMapByUserIds")
public Map<String,List<WatchStatUserInfoDaySdc>> getSdcDataMapByUserIds(@RequestBody List<String> userIds,
@RequestParam(name = "startTime")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd") Date startTime,
@RequestParam(name = "endTime")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
return watchDeviceService.getSdcDataMapByUserIds(userIds, startTime, endTime);
}
@Operation(summary = "获取时间范围的消耗数据", description = "获取时间范围的消耗数据")
@PostMapping("getCalorieDataByUserIds")
public Page<UserDayCalorieInfoVo> getCalorieDataByUserIds(@RequestBody CalorieDataByUserDTO dto) {
return watchDeviceService.getCalorieDataByUserIds(dto);
}
@Operation(summary = "移动端干预首页获取消耗数据", description = "移动端干预首页获取消耗数据")
@PostMapping("getCalorieDataHome")
public Page<UserDayCalorieInfoVo> getCalorieDataHome(@RequestBody CalorieDataByUserDTO dto) {
return watchDeviceService.getCalorieDataHome(dto);
}
@Operation(summary = "获取时间范围的消耗数据New", description = "获取时间范围的消耗数据New")
@PostMapping("getCalorieDataByUserIdsNew")
public List<UserDayCalorieInfoVo> getCalorieDataByUserIdsNew(@RequestBody CalorieDataByUserDTO dto) {
return watchDeviceService.getCalorieDataByUserIdsNew(dto);
}
@Operation(summary = "获取指定两天的消耗数据", description = "获取指定两天的消耗数据")
@PostMapping("getTwoDaysCalorieDataByUserIds")
public List<UserDayCalorieInfoVo> getTwoDaysCalorieDataByUserIds(@RequestBody List<String> userIds,
@RequestParam(name = "startTime")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd") Date startTime,
@RequestParam(name = "endTime")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
return watchDeviceService.getTwoDaysCalorieDataByUserIds(userIds, startTime, endTime);
}
@Operation(summary = "获取当前登录人指定时间的消耗数据", description = "获取当前登录人指定时间的消耗数据")
@PostMapping("getCalorieByUserId")
public List<UserDayCalorieInfoVo> getCalorieByUserId(@RequestBody List<CalorieDataByUserDataDTO> dtoList) {
return watchDeviceService.getCalorieByUserId(dtoList);
}
/**
* 获取当前登录用户周月报数据
*
* @param startTime 开始时间
* @param endTime 结束时间
* @return 周月报数据
*/
@Operation(summary = "获取当前登录人指定时间的周月数据", description = "获取当前登录人指定时间的周月数据")
@PostMapping("/getWeekMonthCalorieData")
public AppCalorieDataVo getWeekMonthCalorieData(@RequestParam(name = "startTime")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd") Date startTime,
@RequestParam(name = "endTime")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
return watchDeviceService.getWeekMonthCalorieData(startTime, endTime);
}
@PostMapping(value = "/watchList")
public Result<Page<WatchDeviceDO>> watchList(@RequestBody WatchDeviceDTO dto) {
Page<WatchDeviceVo> page = new Page<>(dto.getPageNo(), dto.getPageSize());
Page<WatchDeviceDO> pageList = watchDeviceService.watchList(page, dto);
return Result.OK(pageList);
}
/**
* 首页通过userId(非必填 不填查当前登录人) 查询家庭成员健康数据列表
* @param userId
* @return
*/
@GetMapping("/app/healthFamily")
public Result<List<HealthFamilyVO>> getHealthFamily(@RequestParam(name = "userId", required = false) String userId) {
List<HealthFamilyVO> list = watchDeviceService.getHealthFamily(userId);
return Result.OK(list);
}
/**
* 通过家庭成员的Id 查询健康数据详情
* @param userId
* @return
*/
@GetMapping("/app/healthFamilyDetail")
public Result<HealthFamilyVO> getHealthFamilyDetail(@RequestParam(name = "userId") String userId) {
HealthFamilyVO list = watchDeviceService.getHealthFamilyDetail(userId);
return Result.OK(list);
}
@PostMapping("/settingKeyUser")
public Result<String> settingKeyUser(@RequestBody List<WatchKeyUser> watchKeyUserList) {
watchDeviceService.settingKeyUser(watchKeyUserList);
return Result.OK("操作成功!");
}
@DeleteMapping("/deleteKeyUser")
public Result<String> deleteKeyUser(@RequestParam(name = "userId") String userId,@RequestParam(name = "errorType",required = false) String errorType) {
watchDeviceService.deleteKeyUser(userId,errorType);
return Result.OK("操作成功!");
}
}
@@ -0,0 +1,162 @@
package com.renkang.watch.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.renkang.watch.entity.WatchDeviceSwitch;
import com.renkang.watch.service.IWatchDeviceSwitchService;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
/**
* @Description: watch_device_switch
* @Author: jeecg-boot
* @Date: 2023-08-08
* @Version: V1.0
*/
@Tag(name = "watch_device_switch")
@RestController
@RequestMapping("/watch/watchDeviceSwitch")
@Slf4j
public class WatchDeviceSwitchController extends JeecgController<WatchDeviceSwitch, IWatchDeviceSwitchService> {
@Autowired
private IWatchDeviceSwitchService watchDeviceSwitchService;
/**
* 分页列表查询
*
* @param watchDeviceSwitch
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "watch_device_switch-分页列表查询")
@Operation(summary = "watch_device_switch-分页列表查询", description = "watch_device_switch-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<WatchDeviceSwitch>> queryPageList(WatchDeviceSwitch watchDeviceSwitch,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<WatchDeviceSwitch> queryWrapper = QueryGenerator.initQueryWrapper(watchDeviceSwitch, req.getParameterMap());
Page<WatchDeviceSwitch> page = new Page<WatchDeviceSwitch>(pageNo, pageSize);
IPage<WatchDeviceSwitch> pageList = watchDeviceSwitchService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param watchDeviceSwitch
* @return
*/
@AutoLog(value = "watch_device_switch-添加")
@Operation(summary = "watch_device_switch-添加", description = "watch_device_switch-添加")
@RequiresPermissions("watch:watch_device_switch:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody WatchDeviceSwitch watchDeviceSwitch) {
watchDeviceSwitchService.save(watchDeviceSwitch);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param watchDeviceSwitch
* @return
*/
@AutoLog(value = "watch_device_switch-编辑")
@Operation(summary = "watch_device_switch-编辑", description = "watch_device_switch-编辑")
@RequiresPermissions("watch:watch_device_switch:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
public Result<String> edit(@RequestBody WatchDeviceSwitch watchDeviceSwitch) {
watchDeviceSwitchService.updateById(watchDeviceSwitch);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "watch_device_switch-通过id删除")
@Operation(summary = "watch_device_switch-通过id删除", description = "watch_device_switch-通过id删除")
@RequiresPermissions("watch:watch_device_switch:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
watchDeviceSwitchService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "watch_device_switch-批量删除")
@Operation(summary = "watch_device_switch-批量删除", description = "watch_device_switch-批量删除")
@RequiresPermissions("watch:watch_device_switch:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
this.watchDeviceSwitchService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "watch_device_switch-通过id查询")
@Operation(summary = "watch_device_switch-通过id查询", description = "watch_device_switch-通过id查询")
@GetMapping(value = "/queryById")
public Result<WatchDeviceSwitch> queryById(@RequestParam(name = "id", required = true) String id) {
WatchDeviceSwitch watchDeviceSwitch = watchDeviceSwitchService.getById(id);
if (watchDeviceSwitch == null) {
return Result.error("未找到对应数据");
}
return Result.OK(watchDeviceSwitch);
}
/**
* 导出excel
*
* @param request
* @param watchDeviceSwitch
*/
@RequiresPermissions("watch:watch_device_switch:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, WatchDeviceSwitch watchDeviceSwitch) {
return super.exportXls(request, watchDeviceSwitch, WatchDeviceSwitch.class, "watch_device_switch");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequiresPermissions("watch:watch_device_switch:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, WatchDeviceSwitch.class);
}
}
@@ -0,0 +1,225 @@
package com.renkang.watch.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.renkang.watch.bean.request.AbnormalEventFilter;
import com.renkang.watch.bean.response.AbnormalEvent;
import com.renkang.watch.entity.WatchMonitorData;
import com.renkang.watch.manager.WatchCloudManager;
import com.renkang.watch.service.IWatchMonitorDataService;
import com.renkang.watch.vo.WatchMonitorDataVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.aspect.annotation.PermissionData;
import org.jeecg.common.system.api.ISysBaseAPI;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
import java.util.List;
/**
* @Description: watch_monitor_data
* @Author: jeecg-boot
* @Date: 2023-08-08
* @Version: V1.0
*/
@Tag(name = "watch_monitor_data")
@RestController
@RequestMapping("/watch/watchMonitorData")
@Slf4j
public class WatchMonitorDataController extends JeecgController<WatchMonitorData, IWatchMonitorDataService> {
@Autowired
private IWatchMonitorDataService watchMonitorDataService;
@Resource
private WatchCloudManager watchCloudManager;
@Resource
private ISysBaseAPI sysBaseAPI;
/**
* 分页列表查询
*
* @param watchMonitorData
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "watch_monitor_data-分页列表查询")
@Operation(summary = "watch_monitor_data-分页列表查询", description = "watch_monitor_data-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<WatchMonitorData>> queryPageList(WatchMonitorData watchMonitorData,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<WatchMonitorData> queryWrapper = QueryGenerator.initQueryWrapper(watchMonitorData, req.getParameterMap());
Page<WatchMonitorData> page = new Page<WatchMonitorData>(pageNo, pageSize);
IPage<WatchMonitorData> pageList = watchMonitorDataService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 应急大屏-健康终端报警列表-24.09.19 新增orgCodeList非必填字段 新版大屏使用 通过应急中心服务单位List查询数据
*/
@Operation(summary = "应急大屏-健康终端报警列表", description = "应急大屏-健康终端报警列表")
@GetMapping(value = "/getMonitorList")
public Result<IPage<WatchMonitorDataVo>> getMonitorList(@RequestParam(name = "orgCode",required = false) String orgCode,
@RequestParam(name = "orgCodeList", required = false) String orgCodeList,
@RequestParam(name = "startDate", required = false) String startDate,
@RequestParam(name = "endDate", required = false) String endDate,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
Page<WatchMonitorData> page = new Page<WatchMonitorData>(pageNo, pageSize);
IPage<WatchMonitorDataVo> pageList = watchMonitorDataService.getMonitorList(page,orgCode,orgCodeList,startDate,endDate);
return Result.OK(pageList);
}
/**
* 自定义异常数据列表
*
* @param filter 筛选条件
* @param pageNo 页码
* @param pageSize 条数
* @return pageData
*/
@GetMapping(value = "/listCustom")
@PermissionData(pageComponent = "healthMonitor/healMonitorManage/monitorToll/abnormalEvents/abnormalEventsList")
public Result<IPage<AbnormalEvent>> listCustom(AbnormalEventFilter filter,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
IPage<AbnormalEvent> pageList = watchMonitorDataService.pageCustom(pageNo, pageSize, filter);
return Result.OK(pageList);
}
/**
* 蚁熊新血管监测大屏 预警人员数据 查询条件同同类中 /listCustom 接口,不同之处是返回的信息按人员去重,取每人最新一次有定位的告警数据
* @param filter
* @return
*/
@GetMapping(value = "/listCustomForMap")
@PermissionData(pageComponent = "healthMonitor/healMonitorManage/monitorToll/abnormalEvents/abnormalEventsList")
public Result<List<AbnormalEvent>> listCustomForMap(AbnormalEventFilter filter) {
return Result.OK(watchMonitorDataService.listCustomForMap(filter));
}
/**
* 添加
*
* @param watchMonitorData
* @return
*/
@AutoLog(value = "watch_monitor_data-添加")
@Operation(summary = "watch_monitor_data-添加", description = "watch_monitor_data-添加")
@RequiresPermissions("watch:watch_monitor_data:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody WatchMonitorData watchMonitorData) {
watchMonitorDataService.save(watchMonitorData);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param watchMonitorData
* @return
*/
@AutoLog(value = "watch_monitor_data-编辑")
@Operation(summary = "watch_monitor_data-编辑", description = "watch_monitor_data-编辑")
@RequiresPermissions("watch:watch_monitor_data:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
public Result<String> edit(@RequestBody WatchMonitorData watchMonitorData) {
watchMonitorDataService.updateById(watchMonitorData);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "watch_monitor_data-通过id删除")
@Operation(summary = "watch_monitor_data-通过id删除", description = "watch_monitor_data-通过id删除")
@RequiresPermissions("watch:watch_monitor_data:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
watchMonitorDataService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "watch_monitor_data-批量删除")
@Operation(summary = "watch_monitor_data-批量删除", description = "watch_monitor_data-批量删除")
@RequiresPermissions("watch:watch_monitor_data:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
this.watchMonitorDataService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "watch_monitor_data-通过id查询")
@Operation(summary = "watch_monitor_data-通过id查询", description = "watch_monitor_data-通过id查询")
@GetMapping(value = "/queryById")
public Result<WatchMonitorData> queryById(@RequestParam(name = "id", required = true) String id) {
WatchMonitorData watchMonitorData = watchMonitorDataService.getById(id);
if (watchMonitorData == null) {
return Result.error("未找到对应数据");
}
return Result.OK(watchMonitorData);
}
/**
* 导出excel
*
* @param request
* @param watchMonitorData
*/
@RequiresPermissions("watch:watch_monitor_data:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, WatchMonitorData watchMonitorData) {
return super.exportXls(request, watchMonitorData, WatchMonitorData.class, "watch_monitor_data");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequiresPermissions("watch:watch_monitor_data:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, WatchMonitorData.class);
}
@GetMapping(value = "/exportXlsCustom")
public Result<?> exportXls(AbnormalEventFilter filter) {
watchMonitorDataService.exportXlsAsync(filter);
return Result.ok("导出任务启动成功,请点击【导出记录】查看导出详情!");
}
}
@@ -0,0 +1,162 @@
package com.renkang.watch.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.renkang.watch.entity.WatchMonitorMobile;
import com.renkang.watch.service.IWatchMonitorMobileService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
/**
* @Description: watch_monitor_mobile
* @Author: jeecg-boot
* @Date: 2023-08-08
* @Version: V1.0
*/
@Tag(name = "watch_monitor_mobile")
@RestController
@RequestMapping("/watch/watchMonitorMobile")
@Slf4j
public class WatchMonitorMobileController extends JeecgController<WatchMonitorMobile, IWatchMonitorMobileService> {
@Autowired
private IWatchMonitorMobileService watchMonitorMobileService;
/**
* 分页列表查询
*
* @param watchMonitorMobile
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "watch_monitor_mobile-分页列表查询")
@Operation(summary = "watch_monitor_mobile-分页列表查询", description = "watch_monitor_mobile-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<WatchMonitorMobile>> queryPageList(WatchMonitorMobile watchMonitorMobile,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<WatchMonitorMobile> queryWrapper = QueryGenerator.initQueryWrapper(watchMonitorMobile, req.getParameterMap());
Page<WatchMonitorMobile> page = new Page<WatchMonitorMobile>(pageNo, pageSize);
IPage<WatchMonitorMobile> pageList = watchMonitorMobileService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param watchMonitorMobile
* @return
*/
@AutoLog(value = "watch_monitor_mobile-添加")
@Operation(summary = "watch_monitor_mobile-添加", description = "watch_monitor_mobile-添加")
@RequiresPermissions("watch:watch_monitor_mobile:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody WatchMonitorMobile watchMonitorMobile) {
watchMonitorMobileService.save(watchMonitorMobile);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param watchMonitorMobile
* @return
*/
@AutoLog(value = "watch_monitor_mobile-编辑")
@Operation(summary = "watch_monitor_mobile-编辑", description = "watch_monitor_mobile-编辑")
@RequiresPermissions("watch:watch_monitor_mobile:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
public Result<String> edit(@RequestBody WatchMonitorMobile watchMonitorMobile) {
watchMonitorMobileService.updateById(watchMonitorMobile);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "watch_monitor_mobile-通过id删除")
@Operation(summary = "watch_monitor_mobile-通过id删除", description = "watch_monitor_mobile-通过id删除")
@RequiresPermissions("watch:watch_monitor_mobile:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
watchMonitorMobileService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "watch_monitor_mobile-批量删除")
@Operation(summary = "watch_monitor_mobile-批量删除", description = "watch_monitor_mobile-批量删除")
@RequiresPermissions("watch:watch_monitor_mobile:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
this.watchMonitorMobileService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "watch_monitor_mobile-通过id查询")
@Operation(summary = "watch_monitor_mobile-通过id查询", description = "watch_monitor_mobile-通过id查询")
@GetMapping(value = "/queryById")
public Result<WatchMonitorMobile> queryById(@RequestParam(name = "id", required = true) String id) {
WatchMonitorMobile watchMonitorMobile = watchMonitorMobileService.getById(id);
if (watchMonitorMobile == null) {
return Result.error("未找到对应数据");
}
return Result.OK(watchMonitorMobile);
}
/**
* 导出excel
*
* @param request
* @param watchMonitorMobile
*/
@RequiresPermissions("watch:watch_monitor_mobile:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, WatchMonitorMobile watchMonitorMobile) {
return super.exportXls(request, watchMonitorMobile, WatchMonitorMobile.class, "watch_monitor_mobile");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequiresPermissions("watch:watch_monitor_mobile:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, WatchMonitorMobile.class);
}
}
@@ -0,0 +1,265 @@
package com.renkang.watch.controller;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.renkang.watch.constant.WatchConstants;
import com.renkang.watch.entity.WatchMqttNotice;
import com.renkang.watch.manager.WatchCloudManager;
import com.renkang.watch.service.IWatchMqttNoticeService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.aspect.annotation.PermissionData;
import org.jeecg.common.system.api.ISysBaseAPI;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.common.system.vo.LoginUserNew;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
/**
* @Description: watch_mqtt_notice
* @Author: jeecg-boot
* @Date: 2023-08-08
* @Version: V1.0
*/
@Tag(name = "watch_mqtt_notice")
@RestController
@RequestMapping("/watch/watchMqttNotice")
@Slf4j
public class WatchMqttNoticeController extends JeecgController<WatchMqttNotice, IWatchMqttNoticeService> {
@Autowired
private IWatchMqttNoticeService watchMqttNoticeService;
@Autowired
private WatchCloudManager manager;
@Autowired
private ISysBaseAPI sysBaseAPI;
@Autowired
private WatchCloudManager watchCloudManager;
/**
* 分页列表查询
*
* @param watchMqttNotice
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "watch_mqtt_notice-分页列表查询")
@Operation(summary = "watch_mqtt_notice-分页列表查询", description = "watch_mqtt_notice-分页列表查询")
@GetMapping(value = "/list")
@PermissionData(pageComponent = "healthMonitor/healMonitorManage/monitorToll/notificationNews/notificationNewsList")
public Result<IPage<WatchMqttNotice>> queryPageList(WatchMqttNotice watchMqttNotice,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<WatchMqttNotice> queryWrapper = QueryGenerator.initQueryWrapper(watchMqttNotice, req.getParameterMap());
Page<WatchMqttNotice> page = new Page<WatchMqttNotice>(pageNo, pageSize);
IPage<WatchMqttNotice> pageList = watchMqttNoticeService.page(page, queryWrapper);
if(CollectionUtil.isNotEmpty(pageList.getRecords())){
for(WatchMqttNotice mn:pageList.getRecords()){
LoginUser loginUser = sysBaseAPI.getUserById(mn.getCreateBy());
if(loginUser!=null){
mn.setCreateByName(loginUser.getRealname());
}
}
}
return Result.OK(pageList);
}
/**
* 添加
*
* @param watchMqttNotice
* @return
*/
@AutoLog(value = "watch_mqtt_notice-添加")
@Operation(summary = "watch_mqtt_notice-添加", description = "watch_mqtt_notice-添加")
@RequiresPermissions("watch:watch_mqtt_notice:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody WatchMqttNotice watchMqttNotice) {
//createBy保存为当前登录用户id
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
watchMqttNotice.setCreateBy(loginUser.getId());
watchMqttNoticeService.save(watchMqttNotice);
return Result.OK("添加成功!");
}
/**
* 保存消息
*
* @param watchMqttNotice 消息
* @return result
*/
@PostMapping(value = "/addMatchMsg")
@RequiresPermissions("watch:watch_mqtt_notice:add")
public Result<String> addMatchMsg(@RequestBody WatchMqttNotice watchMqttNotice) {
try {
watchMqttNotice.setNoticeStatus(WatchConstants.MSG_SEND_NO_0);
//createBy保存为当前登录用户id
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
watchMqttNotice.setCreateBy(loginUser.getId());
watchMqttNoticeService.addMatchMsg(watchMqttNotice);
return Result.OK("保存成功");
} catch (Exception e) {
return Result.OK(e.getMessage());
}
}
/**
* 发送手表消息
*
* @param watchMqttNotice 消息
* @return result
*/
@PostMapping(value = "/sendMatchMsg")
public Result<String> sendMatchMsg(@RequestBody WatchMqttNotice watchMqttNotice) {
try {
watchMqttNoticeService.sendMatchMsg(watchMqttNotice);
return Result.OK("发送成功");
} catch (Exception e) {
return Result.OK(e.getMessage());
}
}
/**
* 重新发送消息
*
* @param notice 消息id
* @return result
*/
@PostMapping(value = "/sendMatchMsgAgain")
@RequiresPermissions("watch:watch_mqtt_notice:send")
public Result<Object> sendMatchMsgAgain(@RequestBody WatchMqttNotice notice) {
if (StrUtil.isBlank(notice.getId())) {
return Result.error("参数缺失");
}
try {
return watchMqttNoticeService.sendMatchMsgAgain(notice.getId());
} catch (Exception e) {
return Result.error(e.getMessage());
}
}
/**
* 编辑
*
* @param watchMqttNotice
* @return
*/
@AutoLog(value = "watch_mqtt_notice-编辑")
@Operation(summary = "watch_mqtt_notice-编辑", description = "watch_mqtt_notice-编辑")
@RequiresPermissions("watch:watch_mqtt_notice:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
public Result<String> edit(@RequestBody WatchMqttNotice watchMqttNotice) {
watchMqttNoticeService.updateById(watchMqttNotice);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "watch_mqtt_notice-通过id删除")
@Operation(summary = "watch_mqtt_notice-通过id删除", description = "watch_mqtt_notice-通过id删除")
@RequiresPermissions("watch:watch_mqtt_notice:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
watchMqttNoticeService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "watch_mqtt_notice-批量删除")
@Operation(summary = "watch_mqtt_notice-批量删除", description = "watch_mqtt_notice-批量删除")
@RequiresPermissions("watch:watch_mqtt_notice:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
this.watchMqttNoticeService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "watch_mqtt_notice-通过id查询")
@Operation(summary = "watch_mqtt_notice-通过id查询", description = "watch_mqtt_notice-通过id查询")
@GetMapping(value = "/queryById")
public Result<WatchMqttNotice> queryById(@RequestParam(name = "id", required = true) String id) {
WatchMqttNotice watchMqttNotice = watchMqttNoticeService.getById(id);
if (watchMqttNotice == null) {
return Result.error("未找到对应数据");
}
if (WatchConstants.NOTICE_LEVEL_ASSIGN_0.equals(watchMqttNotice.getNoticeLevel())
&& StrUtil.isNotBlank(watchMqttNotice.getUserId())) {
String[] stringArray = watchMqttNotice.getUserId().split(",");
List<String> stringList = Arrays.asList(stringArray);
List<LoginUserNew> list = manager.userList(stringList);
if (CollectionUtil.isNotEmpty(list)) {
String nameList = list.stream()
.map(LoginUserNew::getRealname)
.collect(Collectors.joining(","));
watchMqttNotice.setUserName(nameList);
}
}
return Result.OK(watchMqttNotice);
}
/**
* 导出excel
*
* @param request
* @param watchMqttNotice
*/
@RequiresPermissions("watch:watch_mqtt_notice:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, WatchMqttNotice watchMqttNotice) {
return super.exportXls(request, watchMqttNotice, WatchMqttNotice.class, "watch_mqtt_notice");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequiresPermissions("watch:watch_mqtt_notice:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, WatchMqttNotice.class);
}
}
@@ -0,0 +1,162 @@
package com.renkang.watch.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.renkang.watch.entity.WatchStatUserInfoDayHeartRate;
import com.renkang.watch.service.IWatchStatUserInfoDayHeartRateService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
/**
* @Description: watch_stat_user_info_day_heart_rate
* @Author: jeecg-boot
* @Date: 2023-11-06
* @Version: V1.0
*/
@Tag(name = "watch_stat_user_info_day_heart_rate")
@RestController
@RequestMapping("/watch/watchStatUserInfoDayHeartRate")
@Slf4j
public class WatchStatUserInfoDayHeartRateController extends JeecgController<WatchStatUserInfoDayHeartRate, IWatchStatUserInfoDayHeartRateService> {
@Autowired
private IWatchStatUserInfoDayHeartRateService watchStatUserInfoDayHeartRateService;
/**
* 分页列表查询
*
* @param watchStatUserInfoDayHeartRate
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "watch_stat_user_info_day_heart_rate-分页列表查询")
@Operation(summary = "watch_stat_user_info_day_heart_rate-分页列表查询", description = "watch_stat_user_info_day_heart_rate-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<WatchStatUserInfoDayHeartRate>> queryPageList(WatchStatUserInfoDayHeartRate watchStatUserInfoDayHeartRate,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<WatchStatUserInfoDayHeartRate> queryWrapper = QueryGenerator.initQueryWrapper(watchStatUserInfoDayHeartRate, req.getParameterMap());
Page<WatchStatUserInfoDayHeartRate> page = new Page<WatchStatUserInfoDayHeartRate>(pageNo, pageSize);
IPage<WatchStatUserInfoDayHeartRate> pageList = watchStatUserInfoDayHeartRateService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param watchStatUserInfoDayHeartRate
* @return
*/
@AutoLog(value = "watch_stat_user_info_day_heart_rate-添加")
@Operation(summary = "watch_stat_user_info_day_heart_rate-添加", description = "watch_stat_user_info_day_heart_rate-添加")
@RequiresPermissions("watch:watch_stat_user_info_day_heart_rate:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody WatchStatUserInfoDayHeartRate watchStatUserInfoDayHeartRate) {
watchStatUserInfoDayHeartRateService.save(watchStatUserInfoDayHeartRate);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param watchStatUserInfoDayHeartRate
* @return
*/
@AutoLog(value = "watch_stat_user_info_day_heart_rate-编辑")
@Operation(summary = "watch_stat_user_info_day_heart_rate-编辑", description = "watch_stat_user_info_day_heart_rate-编辑")
@RequiresPermissions("watch:watch_stat_user_info_day_heart_rate:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody WatchStatUserInfoDayHeartRate watchStatUserInfoDayHeartRate) {
watchStatUserInfoDayHeartRateService.updateById(watchStatUserInfoDayHeartRate);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "watch_stat_user_info_day_heart_rate-通过id删除")
@Operation(summary = "watch_stat_user_info_day_heart_rate-通过id删除", description = "watch_stat_user_info_day_heart_rate-通过id删除")
@RequiresPermissions("watch:watch_stat_user_info_day_heart_rate:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
watchStatUserInfoDayHeartRateService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "watch_stat_user_info_day_heart_rate-批量删除")
@Operation(summary = "watch_stat_user_info_day_heart_rate-批量删除", description = "watch_stat_user_info_day_heart_rate-批量删除")
@RequiresPermissions("watch:watch_stat_user_info_day_heart_rate:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.watchStatUserInfoDayHeartRateService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "watch_stat_user_info_day_heart_rate-通过id查询")
@Operation(summary = "watch_stat_user_info_day_heart_rate-通过id查询", description = "watch_stat_user_info_day_heart_rate-通过id查询")
@GetMapping(value = "/queryById")
public Result<WatchStatUserInfoDayHeartRate> queryById(@RequestParam(name="id",required=true) String id) {
WatchStatUserInfoDayHeartRate watchStatUserInfoDayHeartRate = watchStatUserInfoDayHeartRateService.getById(id);
if(watchStatUserInfoDayHeartRate==null) {
return Result.error("未找到对应数据");
}
return Result.OK(watchStatUserInfoDayHeartRate);
}
/**
* 导出excel
*
* @param request
* @param watchStatUserInfoDayHeartRate
*/
@RequiresPermissions("watch:watch_stat_user_info_day_heart_rate:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, WatchStatUserInfoDayHeartRate watchStatUserInfoDayHeartRate) {
return super.exportXls(request, watchStatUserInfoDayHeartRate, WatchStatUserInfoDayHeartRate.class, "watch_stat_user_info_day_heart_rate");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequiresPermissions("watch:watch_stat_user_info_day_heart_rate:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, WatchStatUserInfoDayHeartRate.class);
}
}
@@ -0,0 +1,175 @@
package com.renkang.watch.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.renkang.watch.entity.WatchStatUserInfoDaySdc;
import com.renkang.watch.service.IWatchStatUserInfoDaySdcService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
/**
* @Description: watch_stat_user_info_day_sdc
* @Author: jeecg-boot
* @Date: 2023-11-06
* @Version: V1.0
*/
@Tag(name = "watch_stat_user_info_day_sdc")
@RestController
@RequestMapping("/watch/watchStatUserInfoDaySdc")
@Slf4j
public class WatchStatUserInfoDaySdcController extends JeecgController<WatchStatUserInfoDaySdc, IWatchStatUserInfoDaySdcService> {
@Autowired
private IWatchStatUserInfoDaySdcService watchStatUserInfoDaySdcService;
/**
* 分页列表查询
*
* @param watchStatUserInfoDaySdc
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "watch_stat_user_info_day_sdc-分页列表查询")
@Operation(summary = "watch_stat_user_info_day_sdc-分页列表查询", description = "watch_stat_user_info_day_sdc-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<WatchStatUserInfoDaySdc>> queryPageList(WatchStatUserInfoDaySdc watchStatUserInfoDaySdc,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<WatchStatUserInfoDaySdc> queryWrapper = QueryGenerator.initQueryWrapper(watchStatUserInfoDaySdc, req.getParameterMap());
Page<WatchStatUserInfoDaySdc> page = new Page<WatchStatUserInfoDaySdc>(pageNo, pageSize);
IPage<WatchStatUserInfoDaySdc> pageList = watchStatUserInfoDaySdcService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param watchStatUserInfoDaySdc
* @return
*/
@AutoLog(value = "watch_stat_user_info_day_sdc-添加")
@Operation(summary = "watch_stat_user_info_day_sdc-添加", description = "watch_stat_user_info_day_sdc-添加")
@RequiresPermissions("watch:watch_stat_user_info_day_sdc:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody WatchStatUserInfoDaySdc watchStatUserInfoDaySdc) {
watchStatUserInfoDaySdcService.save(watchStatUserInfoDaySdc);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param watchStatUserInfoDaySdc
* @return
*/
@AutoLog(value = "watch_stat_user_info_day_sdc-编辑")
@Operation(summary = "watch_stat_user_info_day_sdc-编辑", description = "watch_stat_user_info_day_sdc-编辑")
@RequiresPermissions("watch:watch_stat_user_info_day_sdc:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody WatchStatUserInfoDaySdc watchStatUserInfoDaySdc) {
watchStatUserInfoDaySdcService.updateById(watchStatUserInfoDaySdc);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "watch_stat_user_info_day_sdc-通过id删除")
@Operation(summary = "watch_stat_user_info_day_sdc-通过id删除", description = "watch_stat_user_info_day_sdc-通过id删除")
@RequiresPermissions("watch:watch_stat_user_info_day_sdc:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
watchStatUserInfoDaySdcService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "watch_stat_user_info_day_sdc-批量删除")
@Operation(summary = "watch_stat_user_info_day_sdc-批量删除", description = "watch_stat_user_info_day_sdc-批量删除")
@RequiresPermissions("watch:watch_stat_user_info_day_sdc:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.watchStatUserInfoDaySdcService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "watch_stat_user_info_day_sdc-通过id查询")
@Operation(summary = "watch_stat_user_info_day_sdc-通过id查询", description = "watch_stat_user_info_day_sdc-通过id查询")
@GetMapping(value = "/queryById")
public Result<WatchStatUserInfoDaySdc> queryById(@RequestParam(name="id",required=true) String id) {
WatchStatUserInfoDaySdc watchStatUserInfoDaySdc = watchStatUserInfoDaySdcService.getById(id);
if(watchStatUserInfoDaySdc==null) {
return Result.error("未找到对应数据");
}
return Result.OK(watchStatUserInfoDaySdc);
}
/**
* 导出excel
*
* @param request
* @param watchStatUserInfoDaySdc
*/
@RequiresPermissions("watch:watch_stat_user_info_day_sdc:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, WatchStatUserInfoDaySdc watchStatUserInfoDaySdc) {
return super.exportXls(request, watchStatUserInfoDaySdc, WatchStatUserInfoDaySdc.class, "watch_stat_user_info_day_sdc");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequiresPermissions("watch:watch_stat_user_info_day_sdc:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, WatchStatUserInfoDaySdc.class);
}
@GetMapping("/getStatUserInfoDay")
public Integer getStatUserInfoDay(@RequestParam("userId") String userId, @RequestParam("date") String date){
return watchStatUserInfoDaySdcService.getStatUserInfoDay(userId,date);
}
@GetMapping("/getUserDayCalorieTotalValue")
public Integer getUserDayCalorieTotalValue(@RequestParam("userId") String userId, @RequestParam("date") String date){
return watchStatUserInfoDaySdcService.getUserDayCalorieTotalValue(userId,date);
}
}
@@ -0,0 +1,162 @@
package com.renkang.watch.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.renkang.watch.entity.WatchStatUserInfoDaySleep;
import com.renkang.watch.service.IWatchStatUserInfoDaySleepService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
/**
* @Description: watch_stat_user_info_day_sleep
* @Author: jeecg-boot
* @Date: 2023-11-06
* @Version: V1.0
*/
@Tag(name = "watch_stat_user_info_day_sleep")
@RestController
@RequestMapping("/watch/watchStatUserInfoDaySleep")
@Slf4j
public class WatchStatUserInfoDaySleepController extends JeecgController<WatchStatUserInfoDaySleep, IWatchStatUserInfoDaySleepService> {
@Autowired
private IWatchStatUserInfoDaySleepService watchStatUserInfoDaySleepService;
/**
* 分页列表查询
*
* @param watchStatUserInfoDaySleep
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "watch_stat_user_info_day_sleep-分页列表查询")
@Operation(summary = "watch_stat_user_info_day_sleep-分页列表查询", description = "watch_stat_user_info_day_sleep-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<WatchStatUserInfoDaySleep>> queryPageList(WatchStatUserInfoDaySleep watchStatUserInfoDaySleep,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<WatchStatUserInfoDaySleep> queryWrapper = QueryGenerator.initQueryWrapper(watchStatUserInfoDaySleep, req.getParameterMap());
Page<WatchStatUserInfoDaySleep> page = new Page<WatchStatUserInfoDaySleep>(pageNo, pageSize);
IPage<WatchStatUserInfoDaySleep> pageList = watchStatUserInfoDaySleepService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param watchStatUserInfoDaySleep
* @return
*/
@AutoLog(value = "watch_stat_user_info_day_sleep-添加")
@Operation(summary = "watch_stat_user_info_day_sleep-添加", description = "watch_stat_user_info_day_sleep-添加")
@RequiresPermissions("watch:watch_stat_user_info_day_sleep:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody WatchStatUserInfoDaySleep watchStatUserInfoDaySleep) {
watchStatUserInfoDaySleepService.save(watchStatUserInfoDaySleep);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param watchStatUserInfoDaySleep
* @return
*/
@AutoLog(value = "watch_stat_user_info_day_sleep-编辑")
@Operation(summary = "watch_stat_user_info_day_sleep-编辑", description = "watch_stat_user_info_day_sleep-编辑")
@RequiresPermissions("watch:watch_stat_user_info_day_sleep:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody WatchStatUserInfoDaySleep watchStatUserInfoDaySleep) {
watchStatUserInfoDaySleepService.updateById(watchStatUserInfoDaySleep);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "watch_stat_user_info_day_sleep-通过id删除")
@Operation(summary = "watch_stat_user_info_day_sleep-通过id删除", description = "watch_stat_user_info_day_sleep-通过id删除")
@RequiresPermissions("watch:watch_stat_user_info_day_sleep:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
watchStatUserInfoDaySleepService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "watch_stat_user_info_day_sleep-批量删除")
@Operation(summary = "watch_stat_user_info_day_sleep-批量删除", description = "watch_stat_user_info_day_sleep-批量删除")
@RequiresPermissions("watch:watch_stat_user_info_day_sleep:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.watchStatUserInfoDaySleepService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "watch_stat_user_info_day_sleep-通过id查询")
@Operation(summary = "watch_stat_user_info_day_sleep-通过id查询", description = "watch_stat_user_info_day_sleep-通过id查询")
@GetMapping(value = "/queryById")
public Result<WatchStatUserInfoDaySleep> queryById(@RequestParam(name="id",required=true) String id) {
WatchStatUserInfoDaySleep watchStatUserInfoDaySleep = watchStatUserInfoDaySleepService.getById(id);
if(watchStatUserInfoDaySleep==null) {
return Result.error("未找到对应数据");
}
return Result.OK(watchStatUserInfoDaySleep);
}
/**
* 导出excel
*
* @param request
* @param watchStatUserInfoDaySleep
*/
@RequiresPermissions("watch:watch_stat_user_info_day_sleep:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, WatchStatUserInfoDaySleep watchStatUserInfoDaySleep) {
return super.exportXls(request, watchStatUserInfoDaySleep, WatchStatUserInfoDaySleep.class, "watch_stat_user_info_day_sleep");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequiresPermissions("watch:watch_stat_user_info_day_sleep:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, WatchStatUserInfoDaySleep.class);
}
}
@@ -0,0 +1,162 @@
package com.renkang.watch.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.renkang.watch.entity.WatchStatUserInfoDaySpo2;
import com.renkang.watch.service.IWatchStatUserInfoDaySpo2Service;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
/**
* @Description: watch_stat_user_info_day_spo2
* @Author: jeecg-boot
* @Date: 2023-11-06
* @Version: V1.0
*/
@Tag(name = "watch_stat_user_info_day_spo2")
@RestController
@RequestMapping("/watch/watchStatUserInfoDaySpo2")
@Slf4j
public class WatchStatUserInfoDaySpo2Controller extends JeecgController<WatchStatUserInfoDaySpo2, IWatchStatUserInfoDaySpo2Service> {
@Autowired
private IWatchStatUserInfoDaySpo2Service watchStatUserInfoDaySpo2Service;
/**
* 分页列表查询
*
* @param watchStatUserInfoDaySpo2
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "watch_stat_user_info_day_spo2-分页列表查询")
@Operation(summary = "watch_stat_user_info_day_spo2-分页列表查询", description = "watch_stat_user_info_day_spo2-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<WatchStatUserInfoDaySpo2>> queryPageList(WatchStatUserInfoDaySpo2 watchStatUserInfoDaySpo2,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<WatchStatUserInfoDaySpo2> queryWrapper = QueryGenerator.initQueryWrapper(watchStatUserInfoDaySpo2, req.getParameterMap());
Page<WatchStatUserInfoDaySpo2> page = new Page<WatchStatUserInfoDaySpo2>(pageNo, pageSize);
IPage<WatchStatUserInfoDaySpo2> pageList = watchStatUserInfoDaySpo2Service.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param watchStatUserInfoDaySpo2
* @return
*/
@AutoLog(value = "watch_stat_user_info_day_spo2-添加")
@Operation(summary = "watch_stat_user_info_day_spo2-添加", description = "watch_stat_user_info_day_spo2-添加")
@RequiresPermissions("watch:watch_stat_user_info_day_spo2:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody WatchStatUserInfoDaySpo2 watchStatUserInfoDaySpo2) {
watchStatUserInfoDaySpo2Service.save(watchStatUserInfoDaySpo2);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param watchStatUserInfoDaySpo2
* @return
*/
@AutoLog(value = "watch_stat_user_info_day_spo2-编辑")
@Operation(summary = "watch_stat_user_info_day_spo2-编辑", description = "watch_stat_user_info_day_spo2-编辑")
@RequiresPermissions("watch:watch_stat_user_info_day_spo2:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody WatchStatUserInfoDaySpo2 watchStatUserInfoDaySpo2) {
watchStatUserInfoDaySpo2Service.updateById(watchStatUserInfoDaySpo2);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "watch_stat_user_info_day_spo2-通过id删除")
@Operation(summary = "watch_stat_user_info_day_spo2-通过id删除", description = "watch_stat_user_info_day_spo2-通过id删除")
@RequiresPermissions("watch:watch_stat_user_info_day_spo2:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
watchStatUserInfoDaySpo2Service.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "watch_stat_user_info_day_spo2-批量删除")
@Operation(summary = "watch_stat_user_info_day_spo2-批量删除", description = "watch_stat_user_info_day_spo2-批量删除")
@RequiresPermissions("watch:watch_stat_user_info_day_spo2:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.watchStatUserInfoDaySpo2Service.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "watch_stat_user_info_day_spo2-通过id查询")
@Operation(summary = "watch_stat_user_info_day_spo2-通过id查询", description = "watch_stat_user_info_day_spo2-通过id查询")
@GetMapping(value = "/queryById")
public Result<WatchStatUserInfoDaySpo2> queryById(@RequestParam(name="id",required=true) String id) {
WatchStatUserInfoDaySpo2 watchStatUserInfoDaySpo2 = watchStatUserInfoDaySpo2Service.getById(id);
if(watchStatUserInfoDaySpo2==null) {
return Result.error("未找到对应数据");
}
return Result.OK(watchStatUserInfoDaySpo2);
}
/**
* 导出excel
*
* @param request
* @param watchStatUserInfoDaySpo2
*/
@RequiresPermissions("watch:watch_stat_user_info_day_spo2:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, WatchStatUserInfoDaySpo2 watchStatUserInfoDaySpo2) {
return super.exportXls(request, watchStatUserInfoDaySpo2, WatchStatUserInfoDaySpo2.class, "watch_stat_user_info_day_spo2");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequiresPermissions("watch:watch_stat_user_info_day_spo2:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, WatchStatUserInfoDaySpo2.class);
}
}
@@ -0,0 +1,162 @@
package com.renkang.watch.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.renkang.watch.entity.WatchStatUserInfoDayStress;
import com.renkang.watch.service.IWatchStatUserInfoDayStressService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
/**
* @Description: watch_stat_user_info_day_stress
* @Author: jeecg-boot
* @Date: 2023-11-06
* @Version: V1.0
*/
@Tag(name = "watch_stat_user_info_day_stress")
@RestController
@RequestMapping("/watch/watchStatUserInfoDayStress")
@Slf4j
public class WatchStatUserInfoDayStressController extends JeecgController<WatchStatUserInfoDayStress, IWatchStatUserInfoDayStressService> {
@Autowired
private IWatchStatUserInfoDayStressService watchStatUserInfoDayStressService;
/**
* 分页列表查询
*
* @param watchStatUserInfoDayStress
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "watch_stat_user_info_day_stress-分页列表查询")
@Operation(summary = "watch_stat_user_info_day_stress-分页列表查询", description = "watch_stat_user_info_day_stress-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<WatchStatUserInfoDayStress>> queryPageList(WatchStatUserInfoDayStress watchStatUserInfoDayStress,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<WatchStatUserInfoDayStress> queryWrapper = QueryGenerator.initQueryWrapper(watchStatUserInfoDayStress, req.getParameterMap());
Page<WatchStatUserInfoDayStress> page = new Page<WatchStatUserInfoDayStress>(pageNo, pageSize);
IPage<WatchStatUserInfoDayStress> pageList = watchStatUserInfoDayStressService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param watchStatUserInfoDayStress
* @return
*/
@AutoLog(value = "watch_stat_user_info_day_stress-添加")
@Operation(summary = "watch_stat_user_info_day_stress-添加", description = "watch_stat_user_info_day_stress-添加")
@RequiresPermissions("watch:watch_stat_user_info_day_stress:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody WatchStatUserInfoDayStress watchStatUserInfoDayStress) {
watchStatUserInfoDayStressService.save(watchStatUserInfoDayStress);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param watchStatUserInfoDayStress
* @return
*/
@AutoLog(value = "watch_stat_user_info_day_stress-编辑")
@Operation(summary = "watch_stat_user_info_day_stress-编辑", description = "watch_stat_user_info_day_stress-编辑")
@RequiresPermissions("watch:watch_stat_user_info_day_stress:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody WatchStatUserInfoDayStress watchStatUserInfoDayStress) {
watchStatUserInfoDayStressService.updateById(watchStatUserInfoDayStress);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "watch_stat_user_info_day_stress-通过id删除")
@Operation(summary = "watch_stat_user_info_day_stress-通过id删除", description = "watch_stat_user_info_day_stress-通过id删除")
@RequiresPermissions("watch:watch_stat_user_info_day_stress:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
watchStatUserInfoDayStressService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "watch_stat_user_info_day_stress-批量删除")
@Operation(summary = "watch_stat_user_info_day_stress-批量删除", description = "watch_stat_user_info_day_stress-批量删除")
@RequiresPermissions("watch:watch_stat_user_info_day_stress:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.watchStatUserInfoDayStressService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "watch_stat_user_info_day_stress-通过id查询")
@Operation(summary = "watch_stat_user_info_day_stress-通过id查询", description = "watch_stat_user_info_day_stress-通过id查询")
@GetMapping(value = "/queryById")
public Result<WatchStatUserInfoDayStress> queryById(@RequestParam(name="id",required=true) String id) {
WatchStatUserInfoDayStress watchStatUserInfoDayStress = watchStatUserInfoDayStressService.getById(id);
if(watchStatUserInfoDayStress==null) {
return Result.error("未找到对应数据");
}
return Result.OK(watchStatUserInfoDayStress);
}
/**
* 导出excel
*
* @param request
* @param watchStatUserInfoDayStress
*/
@RequiresPermissions("watch:watch_stat_user_info_day_stress:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, WatchStatUserInfoDayStress watchStatUserInfoDayStress) {
return super.exportXls(request, watchStatUserInfoDayStress, WatchStatUserInfoDayStress.class, "watch_stat_user_info_day_stress");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequiresPermissions("watch:watch_stat_user_info_day_stress:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, WatchStatUserInfoDayStress.class);
}
}
@@ -0,0 +1,162 @@
package com.renkang.watch.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.renkang.watch.entity.WatchStatUserInfoDayTemp;
import com.renkang.watch.service.IWatchStatUserInfoDayTempService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
/**
* @Description: watch_stat_user_info_day_temp
* @Author: jeecg-boot
* @Date: 2023-11-06
* @Version: V1.0
*/
@Tag(name = "watch_stat_user_info_day_temp")
@RestController
@RequestMapping("/watch/watchStatUserInfoDayTemp")
@Slf4j
public class WatchStatUserInfoDayTempController extends JeecgController<WatchStatUserInfoDayTemp, IWatchStatUserInfoDayTempService> {
@Autowired
private IWatchStatUserInfoDayTempService watchStatUserInfoDayTempService;
/**
* 分页列表查询
*
* @param watchStatUserInfoDayTemp
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "watch_stat_user_info_day_temp-分页列表查询")
@Operation(summary = "watch_stat_user_info_day_temp-分页列表查询", description = "watch_stat_user_info_day_temp-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<WatchStatUserInfoDayTemp>> queryPageList(WatchStatUserInfoDayTemp watchStatUserInfoDayTemp,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<WatchStatUserInfoDayTemp> queryWrapper = QueryGenerator.initQueryWrapper(watchStatUserInfoDayTemp, req.getParameterMap());
Page<WatchStatUserInfoDayTemp> page = new Page<WatchStatUserInfoDayTemp>(pageNo, pageSize);
IPage<WatchStatUserInfoDayTemp> pageList = watchStatUserInfoDayTempService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param watchStatUserInfoDayTemp
* @return
*/
@AutoLog(value = "watch_stat_user_info_day_temp-添加")
@Operation(summary = "watch_stat_user_info_day_temp-添加", description = "watch_stat_user_info_day_temp-添加")
@RequiresPermissions("watch:watch_stat_user_info_day_temp:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody WatchStatUserInfoDayTemp watchStatUserInfoDayTemp) {
watchStatUserInfoDayTempService.save(watchStatUserInfoDayTemp);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param watchStatUserInfoDayTemp
* @return
*/
@AutoLog(value = "watch_stat_user_info_day_temp-编辑")
@Operation(summary = "watch_stat_user_info_day_temp-编辑", description = "watch_stat_user_info_day_temp-编辑")
@RequiresPermissions("watch:watch_stat_user_info_day_temp:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody WatchStatUserInfoDayTemp watchStatUserInfoDayTemp) {
watchStatUserInfoDayTempService.updateById(watchStatUserInfoDayTemp);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "watch_stat_user_info_day_temp-通过id删除")
@Operation(summary = "watch_stat_user_info_day_temp-通过id删除", description = "watch_stat_user_info_day_temp-通过id删除")
@RequiresPermissions("watch:watch_stat_user_info_day_temp:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
watchStatUserInfoDayTempService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "watch_stat_user_info_day_temp-批量删除")
@Operation(summary = "watch_stat_user_info_day_temp-批量删除", description = "watch_stat_user_info_day_temp-批量删除")
@RequiresPermissions("watch:watch_stat_user_info_day_temp:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.watchStatUserInfoDayTempService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "watch_stat_user_info_day_temp-通过id查询")
@Operation(summary = "watch_stat_user_info_day_temp-通过id查询", description = "watch_stat_user_info_day_temp-通过id查询")
@GetMapping(value = "/queryById")
public Result<WatchStatUserInfoDayTemp> queryById(@RequestParam(name="id",required=true) String id) {
WatchStatUserInfoDayTemp watchStatUserInfoDayTemp = watchStatUserInfoDayTempService.getById(id);
if(watchStatUserInfoDayTemp==null) {
return Result.error("未找到对应数据");
}
return Result.OK(watchStatUserInfoDayTemp);
}
/**
* 导出excel
*
* @param request
* @param watchStatUserInfoDayTemp
*/
@RequiresPermissions("watch:watch_stat_user_info_day_temp:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, WatchStatUserInfoDayTemp watchStatUserInfoDayTemp) {
return super.exportXls(request, watchStatUserInfoDayTemp, WatchStatUserInfoDayTemp.class, "watch_stat_user_info_day_temp");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequiresPermissions("watch:watch_stat_user_info_day_temp:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, WatchStatUserInfoDayTemp.class);
}
}
@@ -0,0 +1,162 @@
package com.renkang.watch.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.renkang.watch.entity.WatchStatUserInfoDayWorkout;
import com.renkang.watch.service.IWatchStatUserInfoDayWorkoutService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
/**
* @Description: watch_stat_user_info_day_workout
* @Author: jeecg-boot
* @Date: 2023-11-06
* @Version: V1.0
*/
@Tag(name = "watch_stat_user_info_day_workout")
@RestController
@RequestMapping("/watch/watchStatUserInfoDayWorkout")
@Slf4j
public class WatchStatUserInfoDayWorkoutController extends JeecgController<WatchStatUserInfoDayWorkout, IWatchStatUserInfoDayWorkoutService> {
@Autowired
private IWatchStatUserInfoDayWorkoutService watchStatUserInfoDayWorkoutService;
/**
* 分页列表查询
*
* @param watchStatUserInfoDayWorkout
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "watch_stat_user_info_day_workout-分页列表查询")
@Operation(summary = "watch_stat_user_info_day_workout-分页列表查询", description = "watch_stat_user_info_day_workout-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<WatchStatUserInfoDayWorkout>> queryPageList(WatchStatUserInfoDayWorkout watchStatUserInfoDayWorkout,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<WatchStatUserInfoDayWorkout> queryWrapper = QueryGenerator.initQueryWrapper(watchStatUserInfoDayWorkout, req.getParameterMap());
Page<WatchStatUserInfoDayWorkout> page = new Page<WatchStatUserInfoDayWorkout>(pageNo, pageSize);
IPage<WatchStatUserInfoDayWorkout> pageList = watchStatUserInfoDayWorkoutService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param watchStatUserInfoDayWorkout
* @return
*/
@AutoLog(value = "watch_stat_user_info_day_workout-添加")
@Operation(summary = "watch_stat_user_info_day_workout-添加", description = "watch_stat_user_info_day_workout-添加")
@RequiresPermissions("watch:watch_stat_user_info_day_workout:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody WatchStatUserInfoDayWorkout watchStatUserInfoDayWorkout) {
watchStatUserInfoDayWorkoutService.save(watchStatUserInfoDayWorkout);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param watchStatUserInfoDayWorkout
* @return
*/
@AutoLog(value = "watch_stat_user_info_day_workout-编辑")
@Operation(summary = "watch_stat_user_info_day_workout-编辑", description = "watch_stat_user_info_day_workout-编辑")
@RequiresPermissions("watch:watch_stat_user_info_day_workout:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody WatchStatUserInfoDayWorkout watchStatUserInfoDayWorkout) {
watchStatUserInfoDayWorkoutService.updateById(watchStatUserInfoDayWorkout);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "watch_stat_user_info_day_workout-通过id删除")
@Operation(summary = "watch_stat_user_info_day_workout-通过id删除", description = "watch_stat_user_info_day_workout-通过id删除")
@RequiresPermissions("watch:watch_stat_user_info_day_workout:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
watchStatUserInfoDayWorkoutService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "watch_stat_user_info_day_workout-批量删除")
@Operation(summary = "watch_stat_user_info_day_workout-批量删除", description = "watch_stat_user_info_day_workout-批量删除")
@RequiresPermissions("watch:watch_stat_user_info_day_workout:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.watchStatUserInfoDayWorkoutService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "watch_stat_user_info_day_workout-通过id查询")
@Operation(summary = "watch_stat_user_info_day_workout-通过id查询", description = "watch_stat_user_info_day_workout-通过id查询")
@GetMapping(value = "/queryById")
public Result<WatchStatUserInfoDayWorkout> queryById(@RequestParam(name="id",required=true) String id) {
WatchStatUserInfoDayWorkout watchStatUserInfoDayWorkout = watchStatUserInfoDayWorkoutService.getById(id);
if(watchStatUserInfoDayWorkout==null) {
return Result.error("未找到对应数据");
}
return Result.OK(watchStatUserInfoDayWorkout);
}
/**
* 导出excel
*
* @param request
* @param watchStatUserInfoDayWorkout
*/
@RequiresPermissions("watch:watch_stat_user_info_day_workout:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, WatchStatUserInfoDayWorkout watchStatUserInfoDayWorkout) {
return super.exportXls(request, watchStatUserInfoDayWorkout, WatchStatUserInfoDayWorkout.class, "watch_stat_user_info_day_workout");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequiresPermissions("watch:watch_stat_user_info_day_workout:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, WatchStatUserInfoDayWorkout.class);
}
}
@@ -0,0 +1,162 @@
package com.renkang.watch.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.renkang.watch.entity.WatchSynMaxId;
import com.renkang.watch.service.IWatchSynMaxIdService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
/**
* @Description: watch_syn_max_id
* @Author: jeecg-boot
* @Date: 2023-08-08
* @Version: V1.0
*/
@Tag(name = "watch_syn_max_id")
@RestController
@RequestMapping("/watch/watchSynMaxId")
@Slf4j
public class WatchSynMaxIdController extends JeecgController<WatchSynMaxId, IWatchSynMaxIdService> {
@Autowired
private IWatchSynMaxIdService watchSynMaxIdService;
/**
* 分页列表查询
*
* @param watchSynMaxId
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "watch_syn_max_id-分页列表查询")
@Operation(summary = "watch_syn_max_id-分页列表查询", description = "watch_syn_max_id-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<WatchSynMaxId>> queryPageList(WatchSynMaxId watchSynMaxId,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<WatchSynMaxId> queryWrapper = QueryGenerator.initQueryWrapper(watchSynMaxId, req.getParameterMap());
Page<WatchSynMaxId> page = new Page<WatchSynMaxId>(pageNo, pageSize);
IPage<WatchSynMaxId> pageList = watchSynMaxIdService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param watchSynMaxId
* @return
*/
@AutoLog(value = "watch_syn_max_id-添加")
@Operation(summary = "watch_syn_max_id-添加", description = "watch_syn_max_id-添加")
@RequiresPermissions("watch:watch_syn_max_id:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody WatchSynMaxId watchSynMaxId) {
watchSynMaxIdService.save(watchSynMaxId);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param watchSynMaxId
* @return
*/
@AutoLog(value = "watch_syn_max_id-编辑")
@Operation(summary = "watch_syn_max_id-编辑", description = "watch_syn_max_id-编辑")
@RequiresPermissions("watch:watch_syn_max_id:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
public Result<String> edit(@RequestBody WatchSynMaxId watchSynMaxId) {
watchSynMaxIdService.updateById(watchSynMaxId);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "watch_syn_max_id-通过id删除")
@Operation(summary = "watch_syn_max_id-通过id删除", description = "watch_syn_max_id-通过id删除")
@RequiresPermissions("watch:watch_syn_max_id:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
watchSynMaxIdService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "watch_syn_max_id-批量删除")
@Operation(summary = "watch_syn_max_id-批量删除", description = "watch_syn_max_id-批量删除")
@RequiresPermissions("watch:watch_syn_max_id:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
this.watchSynMaxIdService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "watch_syn_max_id-通过id查询")
@Operation(summary = "watch_syn_max_id-通过id查询", description = "watch_syn_max_id-通过id查询")
@GetMapping(value = "/queryById")
public Result<WatchSynMaxId> queryById(@RequestParam(name = "id", required = true) String id) {
WatchSynMaxId watchSynMaxId = watchSynMaxIdService.getById(id);
if (watchSynMaxId == null) {
return Result.error("未找到对应数据");
}
return Result.OK(watchSynMaxId);
}
/**
* 导出excel
*
* @param request
* @param watchSynMaxId
*/
@RequiresPermissions("watch:watch_syn_max_id:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, WatchSynMaxId watchSynMaxId) {
return super.exportXls(request, watchSynMaxId, WatchSynMaxId.class, "watch_syn_max_id");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequiresPermissions("watch:watch_syn_max_id:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, WatchSynMaxId.class);
}
}
@@ -0,0 +1,284 @@
package com.renkang.watch.controller;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.renkang.watch.bean.request.UserDataStatFilter;
import com.renkang.watch.bean.response.UserDataDetail;
import com.renkang.watch.bean.response.UserDataStat;
import com.renkang.watch.bean.response.fouinone.FourInOneWatchDataVo;
import com.renkang.watch.entity.WatchUserData;
import com.renkang.watch.service.IWatchDataService;
import com.renkang.watch.service.IWatchUserDataService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.jeecg.annotation.TimeStat;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
import java.util.Date;
/**
* @Description: watch_user_data
* @Author: jeecg-boot
* @Date: 2023-08-08
* @Version: V1.0
*/
@Tag(name = "watch_user_data")
@RestController
@RequestMapping("/watch/watchUserData")
@Slf4j
public class WatchUserDataController extends JeecgController<WatchUserData, IWatchUserDataService> {
@Autowired
private IWatchUserDataService watchUserDataService;
@Autowired
private IWatchDataService watchDataService;
/**
* 小屋大屏获取手表数据
*
* @param dateStr 时间字符串
* @return bean
*/
@GetMapping(value = "/healthCenterScreenWatchDataInfo")
public Result<FourInOneWatchDataVo> healthCenterScreenWatchDataInfo(@RequestParam String dateStr) {
return Result.OK(watchUserDataService.healthCenterScreenWatchDataInfo(dateStr));
}
/**
* 小屋大屏获取手表数据 支持假数据
*
* @param dateStr 时间字符串
* @return bean
*/
@GetMapping(value = "/healthCenterScreenWatchDataInfoFaker")
public Result<FourInOneWatchDataVo> healthCenterScreenWatchDataInfoFaker(@RequestParam String dateStr) {
return Result.OK(watchUserDataService.healthCenterScreenWatchDataInfoFaker(dateStr));
}
/**
* 分页列表查询
*
* @param watchUserData
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "watch_user_data-分页列表查询")
@Operation(summary = "watch_user_data-分页列表查询", description = "watch_user_data-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<WatchUserData>> queryPageList(WatchUserData watchUserData,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<WatchUserData> queryWrapper = QueryGenerator.initQueryWrapper(watchUserData, req.getParameterMap());
Page<WatchUserData> page = new Page<WatchUserData>(pageNo, pageSize);
IPage<WatchUserData> pageList = watchUserDataService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 用户个人统计分页新
*
* @param filter 条件
* @param pageNo 页码
* @param pageSize 条数
* @return bean
*/
@GetMapping(value = "/listCustomByUser")
public Result<IPage<UserDataStat>> listCustomByUser(UserDataStatFilter filter,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
IPage<UserDataStat> pageList = watchUserDataService.pageCustomByUser(pageNo, pageSize, filter);
return Result.OK(pageList);
}
/**
* 用户数据自定义分页
*
* @param filter 条件
* @param pageNo 页码
* @param pageSize 条数
* @return bean
*/
@GetMapping(value = "/listCustom")
public Result<IPage<UserDataStat>> listCustom(UserDataStatFilter filter,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
IPage<UserDataStat> pageList = watchUserDataService.pageCustom(pageNo, pageSize, filter);
return Result.OK(pageList);
}
/**
* 个人数据导出
*/
@GetMapping(value = "/exportCustom")
@TimeStat
public Result<String> exportCustom(UserDataStatFilter filter) {
try {
watchUserDataService.exportCustom(filter);
return Result.OK("导出结果请在个人数据导出记录查看");
} catch (Exception e) {
return Result.error(e.getMessage());
}
}
/**
* 查看详情
*
* @param userId 用户id
* @param dataDate 数据日期
* @return bean
*/
@GetMapping(value = "/userDataDetail")
public Result<UserDataDetail> userDataDetail(@RequestParam String userId,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date dataDate) {
if (StrUtil.isBlank(userId) || ObjectUtil.isNull(dataDate)) {
return Result.error("参数缺失");
}
return Result.OK(watchDataService.queryAllStatistics("0", userId, dataDate));
}
/**
* 添加
*
* @param watchUserData
* @return
*/
@AutoLog(value = "watch_user_data-添加")
@Operation(summary = "watch_user_data-添加", description = "watch_user_data-添加")
@RequiresPermissions("watch:watch_user_data:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody WatchUserData watchUserData) {
// watchUserDataService.save111();
watchUserDataService.save(watchUserData);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param watchUserData
* @return
*/
@AutoLog(value = "watch_user_data-编辑")
@Operation(summary = "watch_user_data-编辑", description = "watch_user_data-编辑")
@RequiresPermissions("watch:watch_user_data:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
public Result<String> edit(@RequestBody WatchUserData watchUserData) {
watchUserDataService.updateById(watchUserData);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "watch_user_data-通过id删除")
@Operation(summary = "watch_user_data-通过id删除", description = "watch_user_data-通过id删除")
@RequiresPermissions("watch:watch_user_data:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
watchUserDataService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "watch_user_data-批量删除")
@Operation(summary = "watch_user_data-批量删除", description = "watch_user_data-批量删除")
@RequiresPermissions("watch:watch_user_data:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
this.watchUserDataService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "watch_user_data-通过id查询")
@Operation(summary = "watch_user_data-通过id查询", description = "watch_user_data-通过id查询")
@GetMapping(value = "/queryById")
public Result<WatchUserData> queryById(@RequestParam(name = "id", required = true) String id) {
WatchUserData watchUserData = watchUserDataService.getById(id);
if (watchUserData == null) {
return Result.error("未找到对应数据");
}
return Result.OK(watchUserData);
}
/**
* 导出excel
*
* @param request
* @param watchUserData
*/
@RequiresPermissions("watch:watch_user_data:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, WatchUserData watchUserData) {
return super.exportXls(request, watchUserData, WatchUserData.class, "watch_user_data");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequiresPermissions("watch:watch_user_data:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, WatchUserData.class);
}
/**
* 七天 活跃 跑数据 新的
* @return
*/
@GetMapping(value = "/testSevenActiveNew")
public Result<String> testSevenActiveNew(){
return watchUserDataService.testSevenActive();
}
/**
* 30天活跃 跑数据 新的
* @return
*/
@GetMapping(value = "/testThirtyActiveNew")
public Result<String> testThirtyActiveNew(){
return watchUserDataService.testThirtyActive();
}
}
@@ -0,0 +1,205 @@
package com.renkang.watch.data.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.renkang.watch.data.model.dto.*;
import com.renkang.watch.data.model.vo.*;
import com.renkang.watch.data.service.DataWatchService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.bean.request.StatReq;
import org.jeecg.common.bean.response.TotalPieChart;
import org.jeecg.config.mybatis.bean.BeanDictInfo;
import org.jeecg.config.mybatis.bean.TableInfo;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* @Description: 数据模块-穿戴数据-控制器
*/
@Tag(name = "数据/穿戴数据")
@RestController
@RequestMapping("/data/watch")
@RequiredArgsConstructor
public class DataWatchController {
private final DataWatchService dataWatchService;
@GetMapping("heartRate/page")
@Operation(summary = "心率列表数据", description = "心率列表数据")
public Result<IPage<HeartRateDataInfo>> heartRateDataPage(HeartRatePageParam pageParam) {
return Result.OK(dataWatchService.heartRateDataPage(pageParam));
}
@GetMapping("bloodOxygen/page")
@Operation(summary = "血氧列表数据", description = "血氧列表数据")
public Result<IPage<BloodOxygenDataInfo>> bloodOxygenDataPage(BloodOxygenPageParam pageParam) {
return Result.OK(dataWatchService.bloodOxygenDataPage(pageParam));
}
@GetMapping("temp/page")
@Operation(summary = "体温列表数据", description = "体温列表数据")
public Result<IPage<TempDataInfo>> tempDataPage(TempPageParam pageParam) {
return Result.OK(dataWatchService.tempDataPage(pageParam));
}
@GetMapping("stress/page")
@Operation(summary = "压力列表数据", description = "压力列表数据")
public Result<IPage<StressDataInfo>> stressDataPage(StressPageParam pageParam) {
return Result.OK(dataWatchService.stressDataPage(pageParam));
}
@GetMapping("exercise/page")
@Operation(summary = "运动列表数据", description = "运动列表数据")
public Result<IPage<ExerciseDataInfo>> exerciseDataPage(ExercisePageParam pageParam) {
return Result.OK(dataWatchService.exerciseDataPage(pageParam));
}
@GetMapping("sleep/page")
@Operation(summary = "睡眠列表数据", description = "睡眠列表数据")
public Result<IPage<SleepDataInfo>> sleepDataPage(SleepPageParam pageParam) {
return Result.OK(dataWatchService.sleepDataPage(pageParam));
}
@GetMapping("fall/page")
@Operation(summary = "跌倒列表数据", description = "跌倒列表数据")
public Result<IPage<FallDataInfo>> fallDataPage(FallPageParam pageParam) {
return Result.OK(dataWatchService.fallDataPage(pageParam));
}
@GetMapping("device/page")
@Operation(summary = "设备列表数据", description = "设备列表数据")
public Result<IPage<DeviceDataInfo>> deviceDataPage(DevicePageParam pageParam) {
return Result.OK(dataWatchService.deviceDataPage(pageParam));
}
/**
* 库结构
*
* @return 结构体
*/
@Operation(summary = "库结构数据", description = "库结构数据")
@GetMapping("tableStructure")
public Result<TableInfo> tableStructure(Integer type) {
return Result.ok(dataWatchService.tableStructure(type));
}
/**
* 列表字典数据
*
* @return map
*/
@GetMapping("dict")
@Operation(summary = "数据字典数据", description = "数据字典数据")
public Result<BeanDictInfo> dict(Integer type) {
return Result.ok(dataWatchService.dict(type));
}
@GetMapping("error/page")
@Operation(summary = "异常列表数据", description = "异常列表数据")
public Result<IPage<ErrorDataInfo>> errorDataPage(ErrorPageParam pageParam) {
return Result.OK(dataWatchService.errorDataPage(pageParam));
}
/**
* 部门统计
* @param req 查询条件
* @return chart
*/
@PostMapping("alone/depart")
public Result<ErrorPieChart> aloneDepart(@RequestBody AloneReq req) {
return Result.ok(dataWatchService.aloneDepart(req));
}
/**
* 性别统计
* @param req 查询条件
* @return chart
*/
@PostMapping("alone/sex")
public Result<ErrorPieChart> aloneSex(@RequestBody AloneReq req) {
return Result.ok(dataWatchService.aloneSex(req));
}
/**
* 民族统计
* @param req 条件
* @return data
*/
@PostMapping("alone/nation")
public Result<ErrorPieChart> aloneNation(@RequestBody AloneReq req) {
return Result.ok(dataWatchService.aloneNation(req));
}
/**
* 年龄段统计
* @param req 条件 params 0: 35以下 1: 35-45 2: 45以上
* @return data
*/
@PostMapping("alone/age")
public Result<ErrorPieChart> aloneAge(@RequestBody AloneReq req) {
return Result.ok(dataWatchService.aloneAge(req));
}
/**
* 政治面貌统计
* @return data
*/
@PostMapping("alone/political")
public Result<ErrorPieChart> alonePolitical(@RequestBody AloneReq req) {
return Result.ok(dataWatchService.alonePolitical(req));
}
/**
* 岗位层级统计
* @return data
*/
@PostMapping("alone/jobLevel")
public Result<ErrorPieChart> aloneJobLevel(@RequestBody AloneReq req) {
return Result.ok(dataWatchService.aloneJobLevel(req));
}
/**
* 结婚统计
* @return data
*/
@PostMapping("alone/married")
public Result<ErrorPieChart> aloneMarried(@RequestBody AloneReq req) {
return Result.ok(dataWatchService.aloneMarried(req));
}
/**
* 健康现状统计
* @return data
*/
@PostMapping("alone/ill")
public Result<ErrorPieChart> aloneIll(@RequestBody AloneReq req) {
return Result.ok(dataWatchService.aloneIll(req));
}
/**
* 穿戴统计
* @return data
*/
@PostMapping("alone/wear")
public Result<ErrorPieChart> aloneWear(@RequestBody AloneReq req) {
return Result.ok(dataWatchService.aloneWear(req));
}
/**
* 不活跃统计
* @return data
*/
@PostMapping("alone/active")
public Result<ErrorPieChart> aloneActive(@RequestBody AloneReq req) {
return Result.ok(dataWatchService.aloneActive(req));
}
}
@@ -0,0 +1,38 @@
package com.renkang.watch.data.model.dto;
import com.renkang.watch.entity.WatchStatUserInfoDayHeartRate;
import com.renkang.watch.entity.WatchStatUserInfoDaySpo2;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.jeecg.base.PageInfo;
import java.util.List;
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(title = "血氧列表参数", description = "血氧列表参数")
public class BloodOxygenPageParam extends PageInfo<WatchStatUserInfoDaySpo2> {
@Schema(description = "单位 or 部门")
private String orgCode;
@Schema(description = "姓名")
private String realName;
@Schema(description = "员工编号")
private String workNo;
@Schema(description = "性别")
private Integer sex;
@Schema(description = "年龄")
private Integer age;
@Schema(description = "年龄范围参数b (当选择范围时使用)")
private Integer ageB;
@Schema(description = "年龄范围条件:'>', '<', '>=', '<=', '<>', '=', '!='")
private String ageCondition;
private List<String> bindUserIds;
}
@@ -0,0 +1,32 @@
package com.renkang.watch.data.model.dto;
import com.renkang.watch.entity.WatchDevice;
import com.renkang.watch.entity.WatchMonitorData;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.jeecg.base.PageInfo;
import java.util.List;
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(title = "设备列表参数", description = "设备列表参数")
public class DevicePageParam extends PageInfo<WatchDevice> {
@Schema(description = "单位 or 部门")
private String orgCode;
@Schema(description = "工具编码")
private String watchNo;
@Schema(description = "姓名")
private String realName;
@Schema(description = "绑定状态")
private String bindStatus;
@Schema(description = "员工编号")
private String workNo;
}
@@ -0,0 +1,87 @@
package com.renkang.watch.data.model.dto;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjUtil;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.renkang.watch.entity.WatchMonitorData;
import com.renkang.watch.entity.WatchStatUserInfoDayStress;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.jeecg.base.PageInfo;
import org.jeecg.common.aspect.annotation.Dict;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
import java.util.List;
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(title = "压力列表参数", description = "压力列表参数")
public class ErrorPageParam extends PageInfo<WatchMonitorData> {
@Schema(description = "单位 or 部门")
private String orgCode;
@Schema(description = "姓名")
private String realName;
@Schema(description = "员工编号")
private String workNo;
@Schema(description = "性别")
private Integer sex;
@Schema(description = "年龄")
private Integer age;
@Schema(description = "年龄范围参数b (当选择范围时使用)")
private Integer ageB;
@Schema(description = "年龄范围条件:'>', '<', '>=', '<=', '<>', '=', '!='")
private String ageCondition;
@Schema(description = "工具编码")
private String watchNo;
@Schema(title = "事件类型")
@Dict(dicCode = "watch_event_type")
private java.lang.String eventType;
@Schema(description = "异常值")
private Integer errValue;
@Schema(description = "异常值范围参数b (当选择范围时使用)")
private Integer errValueB;
@Schema(description = "异常值范围条件:'>', '<', '>=', '<=', '<>', '=', '!='")
private String errValueCondition;
public Date getStartTime() {
if (ObjUtil.isNotEmpty(startTime)){
startTime = DateUtil.beginOfDay(startTime);
}
return startTime;
}
public Date getEndTime() {
if (ObjUtil.isNotEmpty(endTime)){
endTime = DateUtil.endOfDay(endTime);
}
return endTime;
}
@Schema(description = "开始时间")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date startTime;
@Schema(description = "结束时间")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date endTime;
private List<String> bindUserIds;
}

Some files were not shown because too many files have changed in this diff Show More