Initial commit

This commit is contained in:
2026-01-08 16:22:26 +08:00
commit e4c94ade27
994 changed files with 62967 additions and 0 deletions

31
smart-position-watch/.gitignore vendored Normal file
View File

@@ -0,0 +1,31 @@
HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**
!**/src/test/**
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
### VS Code ###
.vscode/

View File

@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>smartlive</artifactId>
<groupId>com.smartlive</groupId>
<version>3.8.8</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>smart-position-watch</artifactId>
<dependencies>
<dependency>
<groupId>com.smartlive</groupId>
<artifactId>smartlive-system</artifactId>
<version>3.8.8</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
</dependency>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>5.8.11</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>

View File

@@ -0,0 +1,51 @@
package com.smartlive.bswatch.TO;
import lombok.Data;
/**
* @author:lilj
* @date:2025/6/10
*/
@Data
public class Casts {
/**
* 日期 yyyy-MM-dd格式
*/
private String date;
/**
* 周几,1-7 周一至周日
*/
private String week;
/**
* 白天天气
*/
private String dayweather;
/**
* 夜间天气
*/
private String nightweather;
/**
* 白天温度,最高气温
*/
private String daytemp;
/**
* 夜间天气
*/
private String nighttemp;
/**
* 白天风向
*/
private String daywind;
/**
* 夜间风向
*/
private String nightwind;
/**
* 白天风力
*/
private String daypower;
/**
* 晚上风力
*/
private String nightpower;
}

View File

@@ -0,0 +1,17 @@
package com.smartlive.bswatch.TO;
import lombok.Data;
@Data
public class HeathReportTO {
private Long reportId;
private String empNo;
private String watchName;
private String reportTitle;
private String createTime;
}

View File

@@ -0,0 +1,97 @@
package com.smartlive.bswatch.TO;
import lombok.Data;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Date;
import java.util.Objects;
/**
* @author:lilj
* @date:2025/2/6
*/
@Data
public class LocationTO {
/**
* 经度
*/
private BigDecimal longitude;
/**
* 纬度
*/
private BigDecimal latitude;
/**
* 地址信息
*/
private String address;
/**
* 定位时间
*/
private Date createTime;
/**
* 地址区划信息:
*/
private String areaCode;
/**
* 高德智能定位返回的是7位小数,系统存储的是6位小数,进行处理
* @param longitude
*/
public void setLongitude(BigDecimal longitude) {
int scale = 6; // 指定小数位数
RoundingMode roundingMode = RoundingMode.HALF_UP; // 四舍五入模式
this.longitude = longitude.setScale(scale, roundingMode);
}
public void setLatitude(BigDecimal latitude) {
int scale = 6; // 指定小数位数
RoundingMode roundingMode = RoundingMode.HALF_UP; // 四舍五入模式
this.latitude = latitude.setScale(scale, roundingMode);
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
LocationTO that = (LocationTO) o;
//使用compareTo进行比较
return this.compareBigDecimal(longitude, that.longitude) && this.compareBigDecimal(latitude, that.latitude);
}
@Override
public int hashCode() {
return Objects.hash(longitude, latitude);
}
private boolean compareBigDecimal(BigDecimal a, BigDecimal b){
if(a == b) {
return true;
}
if(a == null || b == null) {
return false;
}
return a.compareTo(b) == 0;
}
public static void main(String[] args) {
// LocationTO locationTO = new LocationTO();
// locationTO.setLongitude(new BigDecimal("0.000000"));
// locationTO.setLatitude(new BigDecimal("0.000000"));
//
// LocationTO locationTO1 = new LocationTO();
// // locationTO1.setLongitude(new BigDecimal("0.000000"));
// // locationTO1.setLatitude(new BigDecimal("1.000000"));
// System.out.println(locationTO.equals(locationTO1));
BigDecimal longitude = new BigDecimal("123.4");
int scale = 4; // 指定小数位数
RoundingMode roundingMode = RoundingMode.HALF_UP; // 四舍五入模式
BigDecimal roundedLongitude = longitude.setScale(scale, roundingMode);
System.out.println(roundedLongitude);
}
}

View File

@@ -0,0 +1,34 @@
package com.smartlive.bswatch.TO;
import lombok.Data;
import org.apache.poi.hpsf.Decimal;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
/**
* 订单请求参数
*/
@Data
public class PayRequestTO{
@NotNull(message = "用户ID不能为空")
private Long userId;
@NotNull(message = "支付类型不能为空")
private Integer payType;
@Min(value = 1, message = "商品数量不能小于1")
private Integer num;
@DecimalMin(value = "0.00", message = "金额不能小于0")
private BigDecimal money;
@NotNull(message = "商品不能为空")
private Integer watchId;
@NotNull(message = "地址不能为空")
private Long addressId;
}

View File

@@ -0,0 +1,40 @@
package com.smartlive.bswatch.TO;
import lombok.Data;
import java.math.BigDecimal;
/**
* 规则匹配上下文
*/
@Data
public class RuleMatchContext {
//"指标类型"
private String indicatorType;
//"总测量次数"
private Integer totalCount;
//"异常次数"
private Integer abnormalCount;
//"过缓次数"
private Integer bradycardiaCount;
//"过速次数"
private Integer tachycardiaCount;
//"偏低次数"
private Integer lowCount;
//"偏高次数"
private Integer highCount;
//"异常比例"
private BigDecimal abnormalRatio;
public RuleMatchContext(String indicatorType) {
this.indicatorType = indicatorType;
}
}

View File

@@ -0,0 +1,20 @@
package com.smartlive.bswatch.TO;
import lombok.Data;
/**
* @author:lilj
* @date:2025/2/5
*/
@Data
public class StepTO {
/**
* 步数对应的哪一天
*/
private String date;
/**
* 步数
*/
private Integer stepCount;
}

View File

@@ -0,0 +1,67 @@
package com.smartlive.bswatch.TO;
import com.smartlive.bswatch.enmus.WatchApiEnum;
import com.smartlive.bswatch.entity.WatchDevice;
import com.smartlive.bswatch.netty.watchvo.MessageHeaderVO;
import com.smartlive.bswatch.netty.watchvo.MessageVO;
import com.smartlive.bswatch.netty.watchvo.req.deviceReq.LoginReq;
import lombok.Data;
import java.util.Objects;
/**
* @author:lilj
* @date:2025/2/5
*/
@Data
public class WatchDeviceTO {
//watch_sign(查询用),protocol_version,rfid,iccid
private String watchSign;
private String iccid;
private String protocolVersion;
private String rfid;
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
WatchDeviceTO that = (WatchDeviceTO) o;
return Objects.equals(watchSign, that.watchSign) && Objects.equals(iccid, that.iccid) && Objects.equals(protocolVersion, that.protocolVersion) && Objects.equals(rfid, that.rfid);
}
@Override
public int hashCode() {
return Objects.hash(watchSign, iccid, protocolVersion, rfid);
}
public static WatchDeviceTO messageToWatchDeviceTO(MessageVO messageVO){
if(messageVO==null || messageVO.getMessageHeader()==null || messageVO.getMessageBody()==null ){
return null;
}
MessageHeaderVO messageHeaderVO=messageVO.getMessageHeader();
if(!WatchApiEnum.LOGIN.getApiName().equals(messageVO.getMessageHeader().getApiName())){
return null;
}
LoginReq loginReq= (LoginReq) messageVO.getMessageBody();
WatchDeviceTO watchDeviceTO=new WatchDeviceTO();
watchDeviceTO.setWatchSign(messageHeaderVO.getWatchSign());
watchDeviceTO.setIccid(messageHeaderVO.getIccid());
watchDeviceTO.setProtocolVersion(loginReq.getProtocolVersion());
watchDeviceTO.setRfid(loginReq.getRfid());
return watchDeviceTO;
}
public static WatchDeviceTO watchDeviceToWatchDeviceTO(WatchDevice watchDevice){
if(watchDevice==null){
return null;
}
WatchDeviceTO watchDeviceTO=new WatchDeviceTO();
watchDeviceTO.setWatchSign(watchDevice.getWatchSign());
watchDeviceTO.setIccid(watchDevice.getIccid());
watchDeviceTO.setProtocolVersion(watchDevice.getProtocolVersion());
watchDeviceTO.setRfid(watchDevice.getRfid());
return watchDeviceTO;
}
}

View File

@@ -0,0 +1,34 @@
package com.smartlive.bswatch.TO;
import lombok.Data;
import java.util.List;
/**
* @author:lilj
* @date:2025/6/10
*/
@Data
public class WeatherForecast {
/**
* 市
*/
private String city;
/**
* 区划编码
*/
private String adcode;
/**
* 省
*/
private String province;
/**
* 发布时间
*/
private String reporttime;
/**
* 天气预报
*/
private List<Casts> casts;
}

View File

@@ -0,0 +1,47 @@
package com.smartlive.bswatch.TO;
import lombok.Data;
/**
* @author:lilj
* @date:2025/6/10
*/
@Data
public class WeatherLive {
/**
* 省
*/
private String province;
/**
* 市
*/
private String city;
/**
* 区划编码
*/
private String adcode;
/**
* 天气:汉字描述
*/
private String weather;
/**
* 温度
*/
private String temperature;
/**
* 风向
*/
private String winddirection;
/**
* 风力
*/
private String windpower;
/**
* 湿度
*/
private String humidity;
/**
* 数据发布时间:yyyy-MM-dd HH:mm:ss格式
*/
private String reporttime;
}

View File

@@ -0,0 +1,23 @@
package com.smartlive.bswatch.TO;
import lombok.Data;
import java.util.List;
/**
* @author:lilj
* @date:2025/6/10
*/
@Data
public class WeatherTO {
//"status": "1",
// "count": "1",
// "info": "OK",
// "infocode": "10000",
private String status;
private String count;
private String info;
private String infocode;
private List<WeatherForecast> forecasts;
private List<WeatherLive> lives;
}

View File

@@ -0,0 +1,35 @@
package com.smartlive.bswatch.annotation;
/**
* @author:lilj
* @date:2025/2/12
*/
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* 设备绑定校验注解
*/
@Target(java.lang.annotation.ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface BindValidateAno {
/**
* 方法名
* @return
*/
String methodName() default "";
/**
* 服务名
* @return
*/
String serviceName() default "";
/**
* 业务名称
* @return
*/
String bizName() default "";
}

View File

@@ -0,0 +1,99 @@
package com.smartlive.bswatch.aop;
import com.smartlive.bswatch.annotation.BindValidateAno;
import com.smartlive.common.enums.WatchReturnMessage;
import com.smartlive.bswatch.entity.WatchDevice;
import com.smartlive.bswatch.service.CommonService;
import com.smartlive.bswatch.vo.controllerVO.CommonVO;
import com.smartlive.common.exception.ServiceException;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.aspectj.lang.reflect.MethodSignature;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* @author:lilj
* @date:2025/2/12
*/
@Slf4j
@Aspect
@Component
public class BindValidAop {
@Autowired
private CommonService commonService;
/**
* 切入点表达式:表示匹配带有注解BindValidateAno的方法
*/
@Pointcut("@annotation(com.smartlive.bswatch.annotation.BindValidateAno)")
public void pointcut() {
}
/**
* 环绕通知
* @param joinPoint
* @return
* @throws Throwable
*/
@Around("pointcut()")
public Object around(ProceedingJoinPoint joinPoint) throws Throwable {
// 获取注解携带参数
long startTime = System.currentTimeMillis();
MethodSignature methodSignature = (MethodSignature) joinPoint.getSignature();
BindValidateAno bindValidateAno = methodSignature.getMethod().getAnnotation(BindValidateAno.class);
Object result= null;
if(bindValidateAno==null){
log.info("方法:{}没有注解BindValidateAno,直接放行",methodSignature.getName());
result= joinPoint.proceed();
long endTime = System.currentTimeMillis();
log.info("方法:{}执行时间:{}ms",methodSignature.getName(),endTime-startTime);
return result;
}
// 解析注解参数
String serviceName = bindValidateAno.serviceName();
String methodName = bindValidateAno.methodName();
String bizName = bindValidateAno.bizName();
log.info("服务类:{} 方法:{} 注解参数:serviceName:{},methodName:{},bizName:{}",methodSignature.getName(),serviceName,methodName,bizName);
// 获取方法参数
Object[] args = joinPoint.getArgs();
if(args==null || args.length==0){
log.info("方法:{}没有参数,直接放行",methodSignature.getName());
result= joinPoint.proceed();
long endTime = System.currentTimeMillis();
log.info("方法:{}执行时间:{}ms",methodSignature.getName(),endTime-startTime);
return result;
}
Object param = args[0];
if(param==null){
log.info("方法:{}参数为空,直接放行",methodSignature.getName());
result= joinPoint.proceed();
long endTime = System.currentTimeMillis();
log.info("方法:{}执行时间:{}ms",methodSignature.getName(),endTime-startTime);
}
if(param instanceof CommonVO){
CommonVO commonVO = (CommonVO) param;
// 执行逻辑
// 查询数据库检验有无绑定设备
String empNo = commonVO.getEmpNo();
WatchDevice watchDevice = commonService.getWatchDeviceByEmpNo(empNo,commonVO.getWatchSign());
if(watchDevice==null || watchDevice.getWatchSign()==null){
log.info("员工编号:{}未绑定设备,抛出EMPLOYEE_UNBIND_DEVICE异常,不执行后续操作",empNo);
throw new ServiceException(WatchReturnMessage.EMPLOYEE_UNBIND_DEVICE);
}
}
result = joinPoint.proceed();
long endTime = System.currentTimeMillis();
log.info("方法:{}执行时间:{}ms",methodSignature.getName(),endTime-startTime);
return result;
}
}

View File

@@ -0,0 +1,192 @@
package com.smartlive.bswatch.component;
import com.alibaba.fastjson2.JSON;
import com.alipay.api.AlipayApiException;
import com.alipay.api.AlipayClient;
import com.alipay.api.DefaultAlipayClient;
import com.alipay.api.domain.AlipayTradeAppPayModel;
import com.alipay.api.internal.util.AlipaySignature;
import com.alipay.api.request.AlipayTradeAppPayRequest;
import com.alipay.api.request.AlipayTradePagePayRequest;
import com.alipay.api.request.AlipayTradeQueryRequest;
import com.alipay.api.request.AlipayTradeRefundRequest;
import com.alipay.api.response.AlipayTradeAppPayResponse;
import com.alipay.api.response.AlipayTradePagePayResponse;
import com.alipay.api.response.AlipayTradeQueryResponse;
import com.alipay.api.response.AlipayTradeRefundResponse;
import com.smartlive.bswatch.config.AlipayConfig;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
@Slf4j
@Component
public class AlipayUtil {
@Autowired
private AlipayConfig alipayConfig;
private AlipayClient alipayClient;
/**
* 获取支付宝客户端
*/
private AlipayClient getAlipayClient() {
if (alipayClient == null) {
alipayClient = new DefaultAlipayClient(
alipayConfig.getGateway(),
alipayConfig.getAppId(),
alipayConfig.getPrivateKey(),
alipayConfig.getFormat(),
alipayConfig.getCharset(),
alipayConfig.getPublicKey(),
alipayConfig.getSignType()
);
}
return alipayClient;
}
/**
* 创建支付宝支付订单
*/
public String createOrder(String outTradeNo, String subject,
BigDecimal totalAmount, String body) throws AlipayApiException {
AlipayTradeAppPayRequest request = new AlipayTradeAppPayRequest();
// 设置异步回调地址
request.setNotifyUrl(alipayConfig.getNotifyUrl());
// 设置业务参数
// 设置业务参数
AlipayTradeAppPayModel model = new AlipayTradeAppPayModel();
model.setOutTradeNo(outTradeNo);
model.setSubject(subject);
model.setBody(body);
model.setTotalAmount(totalAmount.toString());
model.setProductCode(alipayConfig.getProductCode());
model.setTimeoutExpress(alipayConfig.getTimeoutExpress());
request.setBizModel(model);
// 生成支付订单信息
AlipayTradeAppPayResponse response = getAlipayClient().sdkExecute(request);
if (response.isSuccess()) {
log.info("支付宝APP支付订单创建成功,订单号:{}", outTradeNo);
return response.getBody();
} else {
log.error("支付宝支付订单创建失败: {}", response.getSubMsg());
throw new AlipayApiException(response.getSubMsg());
}
}
/**
* 查询支付宝订单
*/
public Map<String, String> queryOrder(String outTradeNo) throws AlipayApiException {
AlipayTradeQueryRequest request = new AlipayTradeQueryRequest();
Map<String, Object> bizContent = new HashMap<>();
bizContent.put("out_trade_no", outTradeNo);
request.setBizContent(JSON.toJSONString(bizContent));
AlipayTradeQueryResponse response = getAlipayClient().execute(request);
Map<String, String> result = new HashMap<>();
if (response.isSuccess()) {
result.put("tradeStatus", response.getTradeStatus());
result.put("tradeNo", response.getTradeNo());
result.put("totalAmount", response.getTotalAmount());
result.put("buyerUserId", response.getBuyerUserId());
result.put("buyerLogonId", response.getBuyerLogonId());
} else {
result.put("errorMsg", response.getSubMsg());
}
return result;
}
/**
* 支付宝退款
*/
public boolean refund(String outTradeNo, String refundAmount,
String refundReason) throws AlipayApiException {
AlipayTradeRefundRequest request = new AlipayTradeRefundRequest();
Map<String, Object> bizContent = new HashMap<>();
bizContent.put("out_trade_no", outTradeNo);
bizContent.put("refund_amount", refundAmount);
bizContent.put("refund_reason", refundReason);
request.setBizContent(JSON.toJSONString(bizContent));
AlipayTradeRefundResponse response = getAlipayClient().execute(request);
return response.isSuccess();
}
/**
* 验证支付宝回调签名
*/
public boolean verifyCallback(HttpServletRequest request) {
try {
// 获取支付宝POST过来的反馈信息
Map<String, String> params = new HashMap<>();
Map<String, String[]> requestParams = request.getParameterMap();
for (Iterator<String> iter = requestParams.keySet().iterator(); iter.hasNext();) {
String name = iter.next();
String[] values = requestParams.get(name);
String valueStr = "";
for (int i = 0; i < values.length; i++) {
valueStr = (i == values.length - 1) ? valueStr + values[i] : valueStr + values[i] + ",";
}
params.put(name, valueStr);
}
// 验证签名
boolean signVerified = AlipaySignature.rsaCheckV1(
params,
alipayConfig.getPublicKey(),
alipayConfig.getCharset(),
alipayConfig.getSignType()
);
return signVerified;
} catch (AlipayApiException e) {
log.error("支付宝回调签名验证失败", e);
return false;
}
}
/**
* 处理支付宝回调参数
*/
public Map<String, String> processCallbackParams(HttpServletRequest request) {
Map<String, String> params = new HashMap<>();
// 获取所有参数
Map<String, String[]> requestParams = request.getParameterMap();
for (String key : requestParams.keySet()) {
String[] values = requestParams.get(key);
String valueStr = "";
for (int i = 0; i < values.length; i++) {
valueStr = (i == values.length - 1) ? valueStr + values[i] : valueStr + values[i] + ",";
}
params.put(key, valueStr);
}
return params;
}
}

View File

@@ -0,0 +1,225 @@
package com.smartlive.bswatch.component;
import com.smartlive.bswatch.config.WechatPayConfig;
import com.wechat.pay.java.core.Config;
import com.wechat.pay.java.core.RSAAutoCertificateConfig;
import com.wechat.pay.java.service.payments.app.AppService;
import com.wechat.pay.java.service.payments.app.model.Amount;
import com.wechat.pay.java.service.payments.app.model.PrepayRequest;
import com.wechat.pay.java.service.payments.app.model.PrepayResponse;
import com.wechat.pay.java.service.payments.model.Transaction;
import com.wechat.pay.java.core.notification.NotificationConfig;
import com.wechat.pay.java.core.notification.NotificationParser;
import com.wechat.pay.java.core.notification.RequestParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.servlet.http.HttpServletRequest;
import java.io.BufferedReader;
import java.math.BigDecimal;
import java.util.*;
@Slf4j
@Component
public class WechatPayUtil {
@Autowired
private WechatPayConfig wechatAppConfig;
private AppService appService;
private NotificationParser notificationParser;
/**
* 获取微信APP支付服务
*/
private AppService getAppService() {
if (appService == null) {
Config config = new RSAAutoCertificateConfig.Builder()
.merchantId(wechatAppConfig.getMchId())
.privateKey(wechatAppConfig.getPrivateKey())
.merchantSerialNumber(wechatAppConfig.getMchSerialNo())
.apiV3Key(wechatAppConfig.getApiV3Key())
.build();
appService = new AppService.Builder().config(config).build();
}
return appService;
}
/**
* 获取通知解析器
*/
private NotificationParser getNotificationParser() {
if (notificationParser == null) {
NotificationConfig config = new RSAAutoCertificateConfig.Builder()
.merchantId(wechatAppConfig.getMchId())
.privateKey(wechatAppConfig.getPrivateKey())
.merchantSerialNumber(wechatAppConfig.getMchSerialNo())
.apiV3Key(wechatAppConfig.getApiV3Key())
.build();
notificationParser = new NotificationParser(config);
}
return notificationParser;
}
/**
* 创建微信APP支付订单
*/
public Map<String, String> createAppOrder(String outTradeNo, String description,
BigDecimal totalAmount) throws Exception {
AppService service = getAppService();
PrepayRequest request = new PrepayRequest();
request.setAppid(wechatAppConfig.getAppId());
request.setMchid(wechatAppConfig.getMchId());
request.setDescription(description);
request.setOutTradeNo(outTradeNo);
request.setNotifyUrl(wechatAppConfig.getNotifyUrl());
// 设置金额(单位:分)
Amount amount = new Amount();
amount.setTotal(totalAmount.multiply(new BigDecimal("100")).intValue());
request.setAmount(amount);
// 调用预支付API
PrepayResponse response = service.prepay(request);
// 生成调起微信APP的参数
return generateAppPayParams(response.getPrepayId());
}
/**
* 生成调起微信APP支付的参数
*/
private Map<String, String> generateAppPayParams(String prepayId) {
Map<String, String> params = new HashMap<>();
String appId = wechatAppConfig.getAppId();
String partnerId = wechatAppConfig.getMchId();
String nonceStr = generateNonceStr();
String timeStamp = String.valueOf(System.currentTimeMillis() / 1000);
String packageValue = "Sign=WXPay";
// 构造签名参数
params.put("appid", appId);
params.put("partnerid", partnerId);
params.put("prepayid", prepayId);
params.put("package", packageValue);
params.put("noncestr", nonceStr);
params.put("timestamp", timeStamp);
// 生成签名
String sign = generateSign(params);
params.put("sign", sign);
return params;
}
/**
* 生成签名(V3版本使用RSA签名)
*/
private String generateSign(Map<String, String> params) {
try {
// 构造签名字符串
List<String> keys = new ArrayList<>(params.keySet());
Collections.sort(keys);
StringBuilder signStr = new StringBuilder();
for (String key : keys) {
if ("sign".equals(key)) {
continue;
}
String value = params.get(key);
if (value != null && !value.trim().isEmpty()) {
signStr.append(key).append("=").append(value).append("&");
}
}
if (signStr.length() > 0) {
signStr.setLength(signStr.length() - 1);
}
log.debug("微信APP支付签名字符串:{}", signStr.toString());
// 使用RSA签名
java.security.PrivateKey privateKey = loadPrivateKey(wechatAppConfig.getPrivateKey());
java.security.Signature signature = java.security.Signature.getInstance("SHA256withRSA");
signature.initSign(privateKey);
signature.update(signStr.toString().getBytes("UTF-8"));
byte[] signBytes = signature.sign();
return Base64.getEncoder().encodeToString(signBytes);
} catch (Exception e) {
log.error("生成微信APP支付签名失败", e);
throw new RuntimeException("生成签名失败");
}
}
/**
* 加载私钥
*/
private java.security.PrivateKey loadPrivateKey(String privateKeyContent) throws Exception {
String privateKeyPEM = privateKeyContent
.replace("-----BEGIN PRIVATE KEY-----", "")
.replace("-----END PRIVATE KEY-----", "")
.replaceAll("\\s+", "");
byte[] keyBytes = Base64.getDecoder().decode(privateKeyPEM);
java.security.spec.PKCS8EncodedKeySpec keySpec =
new java.security.spec.PKCS8EncodedKeySpec(keyBytes);
java.security.KeyFactory keyFactory = java.security.KeyFactory.getInstance("RSA");
return keyFactory.generatePrivate(keySpec);
}
/**
* 生成随机字符串
*/
private String generateNonceStr() {
return UUID.randomUUID().toString().replaceAll("-", "").substring(0, 32);
}
/**
* 处理微信支付回调
*/
public Transaction handleNotify(HttpServletRequest httpRequest) {
try {
// 构建请求参数
RequestParam requestParam = new RequestParam.Builder()
.serialNumber(httpRequest.getHeader("Wechatpay-Serial"))
.nonce(httpRequest.getHeader("Wechatpay-Nonce"))
.signature(httpRequest.getHeader("Wechatpay-Signature"))
.timestamp(httpRequest.getHeader("Wechatpay-Timestamp"))
.signType(httpRequest.getHeader("Wechatpay-Signature-Type"))
.body(getRequestBody(httpRequest))
.build();
// 验证签名并解析通知
NotificationParser parser = getNotificationParser();
return parser.parse(requestParam, Transaction.class);
} catch (Exception e) {
log.error("处理微信支付回调失败", e);
throw new RuntimeException("处理微信支付回调失败:" + e.getMessage());
}
}
/**
* 获取请求体
*/
private String getRequestBody(HttpServletRequest request) {
StringBuilder stringBuilder = new StringBuilder();
try (BufferedReader reader = request.getReader()) {
String line;
while ((line = reader.readLine()) != null) {
stringBuilder.append(line);
}
} catch (Exception e) {
log.error("读取请求体失败", e);
}
return stringBuilder.toString();
}
}

View File

@@ -0,0 +1,45 @@
package com.smartlive.bswatch.config;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
@Data
@Component
@ConfigurationProperties(prefix = "alipay")
public class AlipayConfig {
// 应用ID
private String appId;
// 商户私钥
private String privateKey;
// 支付宝公钥
private String publicKey;
// 支付宝网关
private String gateway = "https://openapi.alipay.com/gateway.do";
// 编码格式
private String charset = "UTF-8";
// 签名算法类型
private String signType = "RSA2";
// 异步通知地址
private String notifyUrl;
// 格式
private String format = "json";
// 超时时间(分钟)
private String timeoutExpress = "30m";
/**
* 获取产品码
*/
public String getProductCode() {
return "QUICK_MSECURITY_PAY"; // APP支付产品码
}
}

View File

@@ -0,0 +1,32 @@
package com.smartlive.bswatch.config;
/**
* @author:lilj
* @date:2025/1/21
*/
import com.smartlive.bswatch.enmus.WatchApiEnum;
import com.smartlive.bswatch.netty.watchvo.resp.commonResp.ErrorResp;
import com.smartlive.bswatch.netty.watchvo.resp.deviceResp.*;
import java.util.HashMap;
import java.util.Map;
/**
* Api名称与实体类class对象映射关系
*/
public class ApiEntityMap {
public static Map<String,Class> map = new HashMap<>();
static {
map.put(WatchApiEnum.LOGIN.getApiName(), LoginResp.class);
map.put(WatchApiEnum.GET_BUTTON.getApiName(), NormalButtonResp.class);
map.put(WatchApiEnum.GET_INCOME_CALL.getApiName(), IncomeCallResp.class);
map.put(WatchApiEnum.GET_CLASS_MODEL.getApiName(), ClassModelResp.class);
map.put(WatchApiEnum.GET_STUDENT_INFO.getApiName(), StudentInfoResp.class);
map.put(WatchApiEnum.ERROR_RESP.getApiName(), ErrorResp.class);
map.put(WatchApiEnum.SET_REDAY_MODE.getApiName(), SetRedayModeResp.class);
map.put(WatchApiEnum.SET_LOCATION_MODE.getApiName(), SetLocationModelResp.class);
}
}

View File

@@ -0,0 +1,17 @@
package com.smartlive.bswatch.config;
import com.alibaba.fastjson2.JSONObject;
import lombok.Data;
import org.springframework.stereotype.Component;
/**
* @author:lilj
* @date:2025/1/20
*/
public class TestConfig {
// 通过接口控制实际响应数据
public static boolean realResp = true;
public static Object paramObject;
public static String bizType;
}

View File

@@ -0,0 +1,72 @@
package com.smartlive.bswatch.config;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
@Data
@Component
@ConfigurationProperties(prefix = "wechat.app")
public class WechatPayConfig {
// 应用ID(APP)
private String appId;
// 商户号
private String mchId;
// API v3密钥(32位)
private String apiV3Key;
// 商户证书序列号
private String mchSerialNo;
// 商户私钥文件路径(PKCS8格式)
private String privateKeyPath;
// 私钥内容(二选一)
private String privateKeyContent;
// 异步通知地址
private String notifyUrl;
// 交易类型
private String tradeType = "APP"; // APP支付固定为APP
// 签名类型
private String signType = "RSA";
// 是否使用沙箱环境
private boolean sandbox = false;
// 沙箱API密钥
private String sandboxApiKey;
/**
* 获取商户私钥
*/
public String getPrivateKey() {
if (privateKeyContent != null && !privateKeyContent.trim().isEmpty()) {
return privateKeyContent.trim();
}
if (privateKeyPath != null && !privateKeyPath.trim().isEmpty()) {
try {
java.nio.file.Path path = java.nio.file.Paths.get(privateKeyPath);
if (!java.nio.file.Files.exists(path)) {
// 尝试从classpath加载
path = java.nio.file.Paths.get(
Thread.currentThread().getContextClassLoader()
.getResource(privateKeyPath).toURI()
);
}
return new String(java.nio.file.Files.readAllBytes(path)).trim();
} catch (Exception e) {
throw new RuntimeException("读取微信支付私钥文件失败", e);
}
}
throw new RuntimeException("微信支付私钥未配置");
}
}

View File

@@ -0,0 +1,85 @@
package com.smartlive.bswatch.controller.common;
import com.smartlive.bswatch.entity.Address;
import com.smartlive.bswatch.service.AddressService;
import com.smartlive.common.core.controller.BaseController;
import com.smartlive.common.core.domain.AjaxResult;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.List;
@RestController
@RequestMapping("/address")
public class AddressController extends BaseController {
@Resource
private AddressService addressService;
/**
* 添加地址
*/
@PostMapping("/add")
public AjaxResult addAddress(@Valid @RequestBody Address address) {
boolean result = addressService.addAddress(address);
if (result) {
return success("地址添加成功");
}
return error("地址添加失败");
}
/**
* 修改地址
*/
@PostMapping("/update")
public AjaxResult updateAddress(@Valid @RequestBody Address address) {
boolean result = addressService.updateAddress(address);
if (result) {
return success("地址修改成功");
}
return error("地址修改失败");
}
/**
* 删除地址
*/
@RequestMapping("/delete")
public AjaxResult deleteAddress(@RequestParam Long addressId) {
boolean result = addressService.deleteAddress(addressId);
if (result) {
return success("地址删除成功");
}
return error("地址删除失败");
}
/**
* 获取用户地址列表
*/
@GetMapping("/list")
public AjaxResult getAddressList(@RequestParam Long userId) {
List<Address> addressList = addressService.getAddressList(userId);
return success(addressList);
}
/**
* 设置默认地址
*/
@GetMapping("/setDefault")
public AjaxResult setDefaultAddress(@RequestParam Long addressId, @RequestParam Long userId) {
boolean result = addressService.setDefaultAddress(addressId, userId);
if (result) {
return success("默认地址设置成功");
}
return error("默认地址设置失败");
}
/**
* 获取用户默认地址
*/
@GetMapping("/default")
public AjaxResult getDefaultAddress(@RequestParam Long userId) {
Address defaultAddress = addressService.getDefaultAddress(userId);
return success(defaultAddress);
}
}

View File

@@ -0,0 +1,159 @@
package com.smartlive.bswatch.controller.common;
import com.smartlive.bswatch.TO.PayRequestTO;
import com.smartlive.bswatch.service.AlipayService;
import com.smartlive.bswatch.service.WechatService;
import com.smartlive.common.core.domain.AjaxResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;
import java.util.Map;
@Slf4j
@RestController
@RequestMapping("/pay")
public class AppPaymentController {
@Resource
private AlipayService alipayService;
@Resource
private WechatService wechatService;
/**
* APP支付统一下单接口
*/
@PostMapping("/create")
public AjaxResult createPayOrder(@Validated @RequestBody PayRequestTO request) {
log.info("收到APP支付请求:{}", request);
try {
Map<String, Object> result;
// 根据支付类型调用不同服务
if (1==request.getPayType()) {
// 支付宝APP支付
result = alipayService.createAlipayAppOrder(
request.getUserId(),
request.getWatchId(),
request.getMoney(),
request.getNum(),
request.getAddressId()
);
if (Boolean.TRUE.equals(result.get("success"))) {
String message = (String) result.get("message");
String orderInfo = (String) result.get("alipayOrderInfo");
return AjaxResult.success(message, orderInfo);
} else {
String message = (String) result.get("message");
return AjaxResult.error(message);
}
} else if (2==request.getPayType()) {
// 微信APP支付
result = wechatService.createWechatAppOrder(
request.getUserId(),
request.getWatchId(),
request.getMoney(),
request.getNum(),
request.getAddressId()
);
if (Boolean.TRUE.equals(result.get("success"))) {
@SuppressWarnings("unchecked")
Map<String, String> payParams = (Map<String, String>) result.get("payParams");
String message = (String) result.get("message");
return AjaxResult.success(message, payParams);
} else {
String message = (String) result.get("message");
return AjaxResult.error(message);
}
} else {
return AjaxResult.error("不支持的支付类型");
}
} catch (Exception e) {
log.error("创建APP支付订单失败", e);
return AjaxResult.error("创建APP支付订单失败");
}
}
/**
* 支付宝APP支付回调通知
*/
@PostMapping("/notify/alipay")
public String alipayNotify(HttpServletRequest request, HttpServletResponse httpResponse) {
log.info("接收支付宝APP支付异步通知");
try {
String result = alipayService.handleAlipayNotify(request);
// 设置响应
if ("success".equals(result)) {
httpResponse.setStatus(200);
} else {
httpResponse.setStatus(500);
}
return result;
} catch (Exception e) {
log.error("处理支付宝回调异常", e);
httpResponse.setStatus(500);
return "failure";
}
}
/**
* 微信APP支付回调通知
*/
@PostMapping("/notify/wechat")
public String wechatNotify(HttpServletRequest request, HttpServletResponse httpResponse) {
log.info("接收微信APP支付异步通知");
try {
String result = wechatService.handleWechatNotify(request);
// 设置响应
if (result.contains("SUCCESS")) {
httpResponse.setStatus(200);
} else {
httpResponse.setStatus(500);
}
return result;
} catch (Exception e) {
log.error("处理微信支付回调异常", e);
httpResponse.setStatus(500);
return "{\"code\": \"FAIL\", \"message\": \"处理异常\"}";
}
}
/**
* APP支付退款
*/
@PostMapping("/refund")
public Map<String, Object> refund(@RequestParam String orderNo,
@RequestParam BigDecimal refundAmount,
@RequestParam String refundReason) {
log.info("APP支付退款,订单号:{},退款金额:{}", orderNo, refundAmount);
// 这里需要根据订单号判断支付渠道
// 简化处理,先调用支付宝退款
return alipayService.refund(orderNo, refundAmount, refundReason);
}
}

View File

@@ -0,0 +1,43 @@
package com.smartlive.bswatch.controller.common;
import com.smartlive.bswatch.entity.WatchHealthReport;
import com.smartlive.bswatch.service.IWatchHealthReportService;
import com.smartlive.common.core.domain.AjaxResult;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
@RestController
@RequestMapping("/watch/report")
public class HealthReportController {
@Resource
private IWatchHealthReportService watchHealthReportService;
@RequestMapping("generate")
public AjaxResult generate(String empNo,String watchSign,String watchName, String startDate, String endDate) {
watchHealthReportService.generateWeeklyReport(empNo,watchName,watchSign, startDate, endDate);
return AjaxResult.success();
}
@RequestMapping("getReport")
public AjaxResult getReport(Long reportId) {
WatchHealthReport watchHealthReport = watchHealthReportService.getWeeklyReport(reportId);
return AjaxResult.success(watchHealthReport);
}
@RequestMapping("getReportHistory")
public AjaxResult getReportHistory(String watchSign, String time) {
return AjaxResult.success(watchHealthReportService.getReportHistory(watchSign, time));
}
@RequestMapping("batchGenerate")
public AjaxResult batchGenerate(String reportDate) {
watchHealthReportService.batchGenerateWeeklyReports(reportDate);
return AjaxResult.success();
}
}

View File

@@ -0,0 +1,62 @@
package com.smartlive.bswatch.controller.common;
import com.smartlive.bswatch.service.IWatchLocationService;
import com.smartlive.common.validator.group.QueryValidate;
import com.smartlive.bswatch.vo.controllerVO.LocationQueryVO;
import com.smartlive.common.core.domain.AjaxResult;
import com.smartlive.common.enums.WatchReturnMessage;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @author:lilj
* @date:2025/2/13
*/
/**
* 实现功能:
* 1. 获取实时定位: 发送实时定位命令; 查询实时定位信息.
* 2. 获取历史轨迹: 发送历史轨迹命令; 查询历史轨迹信息.
*/
@RequestMapping("/watch/location")
@RestController
public class LocationController {
@Autowired
private IWatchLocationService locationService;
@RequestMapping("/sendLocationCommond")
public AjaxResult sendLocationCommond(@Validated(QueryValidate.class) LocationQueryVO locationQueryVO) {
return locationService.sendLocationCommond(locationQueryVO);
}
/**
* 获取实时定位信息
*/
@RequestMapping("/getCurrentLocationInfo")
public AjaxResult getCurrentLocationInfo(@Validated(QueryValidate.class) LocationQueryVO locationQueryVO) {
if(locationQueryVO == null|| StringUtils.isBlank(locationQueryVO.getEmpNo())){
return AjaxResult.error(WatchReturnMessage.EMPNO_NOT_NULL);
}
return locationService.getCurrentLocationInfo(locationQueryVO);
}
/**
* 获取历史轨迹信息
*/
@GetMapping("locationTrack")
public AjaxResult locationTrack(@Validated(QueryValidate.class) LocationQueryVO locationQueryVO) {
if(locationQueryVO == null|| StringUtils.isBlank(locationQueryVO.getEmpNo())){
return AjaxResult.error(WatchReturnMessage.EMPNO_NOT_NULL);
}
return locationService.lcoationTrack(locationQueryVO);
}
}

View File

@@ -0,0 +1,85 @@
package com.smartlive.bswatch.controller.common;
import com.smartlive.bswatch.service.IWatchSosService;
import com.smartlive.common.validator.group.InsertValidate;
import com.smartlive.common.validator.group.UpdateValidate;
import com.smartlive.bswatch.vo.controllerVO.SosPhoneVO;
import com.smartlive.common.core.domain.AjaxResult;
import com.smartlive.common.utils.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
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:lilj
* @date:2025/2/10
*/
/**
* sos与白名单电话
*/
@RequestMapping("/watch/sosPhone")
@RestController
public class SosPhoneController {
@Autowired
private IWatchSosService watchSosService;
@GetMapping("/list")
public AjaxResult list(SosPhoneVO sosPhoneVo) {
if(sosPhoneVo==null){
return AjaxResult.error("请指定查询条件");
}
if(StringUtils.isBlank(sosPhoneVo.getEmpNo())){
return AjaxResult.error("人员id不能为空");
}
if(StringUtils.isBlank(sosPhoneVo.getWatchSign())){
return AjaxResult.error("腕表唯一标识不能为空");
}
return watchSosService.qeuryByVO(sosPhoneVo);
}
// 生成sos的增删改查方法
@GetMapping("/add")
public AjaxResult add(@Validated(InsertValidate.class) SosPhoneVO sosPhoneVo) {
return watchSosService.saveSosPhone(sosPhoneVo) ? AjaxResult.success() : AjaxResult.error();
}
// SOS更新方法
@GetMapping("/update")
public AjaxResult update(@Validated(UpdateValidate.class) SosPhoneVO sosPhoneVo) {
return watchSosService.updateSosPhone(sosPhoneVo) ? AjaxResult.success() : AjaxResult.error();
}
// sos删除方法
/**
* 删除sos号码
* @param id
* @return
*/
@GetMapping("/delete")
public AjaxResult delete(Integer id) {
if(id==null){
return AjaxResult.error("请指定要删除的sos号码");
}
List<Integer> idList = java.util.Arrays.asList(id);
return watchSosService.deleteByIds(idList) ? AjaxResult.success() : AjaxResult.error();
}
// sos删除方法
@GetMapping("/deleteBatch")
public AjaxResult deleteBatch(Integer[] ids) {
if(ids==null || ids.length==0){
return AjaxResult.error("请指定要删除的sos号码");
}
List<Integer> idList = java.util.Arrays.asList(ids);
return watchSosService.deleteByIds(idList) ? AjaxResult.success() : AjaxResult.error();
}
}

View File

@@ -0,0 +1,72 @@
package com.smartlive.bswatch.controller.common;
import com.smartlive.bswatch.service.IWatchEmpPhoneService;
import com.smartlive.common.validator.group.InsertValidate;
import com.smartlive.common.validator.group.UpdateValidate;
import com.smartlive.bswatch.vo.controllerVO.WatchEmpPhoneVO;
import com.smartlive.common.core.domain.AjaxResult;
import com.smartlive.common.utils.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @author:lilj
* @date:2025/2/10
*/
@RequestMapping("watch/empPhone")
@RestController
public class WatchEmpPhoneController {
@Autowired
private IWatchEmpPhoneService empPhoneService;
/**
* 查询亲情电话话信息
*
* @param empPhoneVO
* @return
*/
@RequestMapping("selectEmpPhone")
public AjaxResult selectEmpPhone(WatchEmpPhoneVO empPhoneVO) {
if(empPhoneVO==null){
return AjaxResult.error("请指定查询条件");
}
if(StringUtils.isBlank(empPhoneVO.getEmpNo())){
return AjaxResult.error("人员id不能为空");
}
if(StringUtils.isBlank(empPhoneVO.getWatchSign())){
return AjaxResult.error("腕表唯一标识不能为空");
}
return empPhoneService.selectEmpPhone(empPhoneVO);
}
/**
* 设置为亲情电话
*/
@GetMapping("updateEmpPhone")
public AjaxResult updateEmphone(@Validated(UpdateValidate.class) WatchEmpPhoneVO empPhoneVO){
return empPhoneService.updateEmphone(empPhoneVO);
}
/**
* 新增亲情电话
*/
@GetMapping("addEmpPhone")
public AjaxResult addEmpPhone(@Validated(InsertValidate.class) WatchEmpPhoneVO empPhoneVO){
return empPhoneService.addEmpPhone(empPhoneVO);
}
/**
* 删除亲情电话
*/
@GetMapping("delete")
public AjaxResult delete(Integer id){
return empPhoneService.deleteById(id);
}
}

View File

@@ -0,0 +1,88 @@
package com.smartlive.bswatch.controller.common;
import com.smartlive.bswatch.service.IWatchFenceService;
import com.smartlive.common.validator.group.InsertValidate;
import com.smartlive.common.validator.group.UpdateValidate;
import com.smartlive.bswatch.vo.controllerVO.WatchFenceVO;
import com.smartlive.common.core.domain.AjaxResult;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Arrays;
import java.util.List;
/**
* @author:lilj
* @date:2025/2/13
*/
/**
* 腕表电子围栏
*/
@RequestMapping("/watch/fence")
@RestController
public class WatchFenceController {
@Autowired
private IWatchFenceService watchFenceService;
/**
* 查询电子围栏
*/
@GetMapping("/list")
public AjaxResult fenceList(WatchFenceVO fenceVO) {
if(fenceVO==null){
return AjaxResult.error("请指定查询的参数");
}
if(StringUtils.isBlank(fenceVO.getEmpNo())){
return AjaxResult.error("人员id不能为空");
}
if(StringUtils.isBlank(fenceVO.getWatchSign())){
return AjaxResult.error("腕表唯一标识不能为空");
}
return watchFenceService.listVO(fenceVO);
}
/**
* 增删改查
*/
@GetMapping("/add")
public AjaxResult addFence(@Validated(InsertValidate.class) WatchFenceVO fenceVO) {
return watchFenceService.saveVO(fenceVO);
}
/**
* 更新电子围栏
*/
@GetMapping("/update")
public AjaxResult updateFence(@Validated(UpdateValidate.class) WatchFenceVO fenceVO) {
return watchFenceService.updateVO(fenceVO);
}
/**
* 删除电子围栏
*/
@GetMapping("/delete")
public AjaxResult deleteFence(Long id) {
if(id==null){
return AjaxResult.error("请指定要删除的电子围栏");
}
return watchFenceService.delete(id);
}
/**
* 批量删除电子围栏
*/
@GetMapping("/deleteBatch")
public AjaxResult deleteFence(Long[] ids) {
if(ids==null || ids.length==0){
return AjaxResult.error("请指定要删除的电子围栏");
}
List<Long> idList = Arrays.asList(ids);
return watchFenceService.deleteBatch(idList);
}
}

View File

@@ -0,0 +1,58 @@
package com.smartlive.bswatch.controller.common;
import com.smartlive.bswatch.service.IWatchHealthService;
import com.smartlive.bswatch.vo.controllerVO.HealthQueryVO;
import com.smartlive.common.core.domain.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @author:lilj
* @date:2025/2/14
*/
/**
* 腕表健康数据查询
*/
@RequestMapping("/watch/health")
@RestController
public class WatchHealthController {
@Autowired
private IWatchHealthService watchHealthService;
@GetMapping("/heart")
public AjaxResult heartRate(@Validated HealthQueryVO healthQueryVO){
return watchHealthService.queryHeartBeat(healthQueryVO);
}
@GetMapping("/temperature")
public AjaxResult temperature(@Validated HealthQueryVO healthQueryVO){
return watchHealthService.queryTemperature(healthQueryVO);
}
@GetMapping("/bloodOxy")
public AjaxResult bloodOxy(@Validated HealthQueryVO healthQueryVO){
return watchHealthService.queryBloodOxy(healthQueryVO);
}
@GetMapping("/step")
public AjaxResult selectStep(@Validated HealthQueryVO healthQueryVO) {
return watchHealthService.queryStep(healthQueryVO);
}
@GetMapping("/pressure")
public AjaxResult selectPressure(@Validated HealthQueryVO healthQueryVO) {
return watchHealthService.queryPressure(healthQueryVO);
}
@GetMapping("/sleep")
public AjaxResult selectSleep(@Validated HealthQueryVO healthQueryVO) {
return watchHealthService.querySleep(healthQueryVO);
}
}

View File

@@ -0,0 +1,125 @@
package com.smartlive.bswatch.controller.common;
/**
* @author:lilj
* @date:2025/2/14
*/
import com.smartlive.bswatch.costant.WatchConstant;
import com.smartlive.bswatch.service.IWatchSkipService;
import com.smartlive.bswatch.service.IWatchDeviceService;
import com.smartlive.bswatch.vo.controllerVO.WatchDeviceVO;
import com.smartlive.bswatch.vo.controllerVO.WatchSkipVO;
import com.smartlive.common.core.domain.AjaxResult;
import com.smartlive.common.validator.group.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.validation.constraints.NotBlank;
/**
* 腕表模式设置:
*/
@RequestMapping("/watch/set")
@RestController
public class WatchSetController {
/**
* 查询当前腕表的模式信息
*/
@Autowired
private IWatchDeviceService watchDeviceService;
@Autowired
private IWatchSkipService watchSkipService;
/**
* 设备当前信息
* @param watchSign
* @return
*/
@RequestMapping("/watchInfo")
public AjaxResult queryWatchMode(@NotBlank String watchSign){
return watchDeviceService.queryWatchInfo(watchSign);
}
/**
* 设备绑定信息修改:
* 1.设备唯一标识
* 2. empNo
* 3. 手机号信息修改
*/
@RequestMapping("/bindDevice")
public AjaxResult bindDevice(@Validated(WatchBindGroup.class) WatchDeviceVO watchDeviceVO){
return watchDeviceService.bindDevice(watchDeviceVO);
}
/**
* 腕表解绑
*/
@GetMapping("/unbindDevice")
public AjaxResult unbindDevice(@NotBlank String empNo,@NotBlank String watchSign){
return watchDeviceService.unbindDevice(empNo,watchSign);
}
/**
* 腕表模式切换
*/
@GetMapping("/modeChange")
public AjaxResult modeChange(@Validated(WatchModeChangeGroup.class) WatchDeviceVO watchDeviceVO){
return watchDeviceService.modeChange(watchDeviceVO);
}
/**
* 腕表待机模式时间段设置
*/
@GetMapping("/setRedayTime")
public AjaxResult setRedayTime(@Validated(RedayModeGroup.class) WatchDeviceVO watchDeviceVO){
watchDeviceVO.setWatchMode(WatchConstant.WATCH_MODE_REDAY);
// 参数处理:
String start = watchDeviceVO.getStartTime().replaceAll(":", "");
String end = watchDeviceVO.getEndTime().replaceAll(":", "");
watchDeviceVO.setRedayTime(start + "-" + end);
return watchDeviceService.modeChange(watchDeviceVO);
}
/**
* 腕表定位信息上传频率设置
*/
@GetMapping("/setLocationFreq")
public AjaxResult setLocationFreq(@Validated(LocationFreqGroup.class) WatchDeviceVO watchDeviceVO){
return watchDeviceService.setLocationFreq(watchDeviceVO);
}
/**
* 查询蓝牙跳绳信息
*/
@GetMapping("/querySkip")
public AjaxResult querySkip(@NotBlank(message = "人员编号不能为空") String empNo,@NotBlank(message = "设备唯一标识不能为空") String watchSign){
return watchSkipService.querySkip(empNo,watchSign);
}
/**
* 绑定跳绳
*/
@PostMapping("/bindSkip")
public AjaxResult bindSkip(@Validated(InsertValidate.class) @RequestBody WatchSkipVO watchSkipVO){
return watchSkipService.bindSkip(watchSkipVO);
}
/**
* 解绑跳绳
*/
@GetMapping("/unbindSkip")
public AjaxResult unbindSkip(@NotBlank(message = "人员编号不能为空") String empNo,@NotBlank(message = "设备唯一标识不能为空") String watchSign){
return watchSkipService.unbindSkip(empNo,watchSign);
}
}

View File

@@ -0,0 +1,26 @@
package com.smartlive.bswatch.controller.common;
import com.smartlive.bswatch.service.IWatchWarnService;
import com.smartlive.bswatch.vo.controllerVO.WatchWarnVO;
import com.smartlive.common.core.domain.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @author:lilj
* @date:2025/2/13
*/
@RequestMapping("/watch/warn")
@RestController
public class WatchWarnController {
@Autowired
private IWatchWarnService watchWarnService;
@GetMapping("/list")
public AjaxResult warnList(@Validated WatchWarnVO watchWarnVO) {
return watchWarnService.queryVO(watchWarnVO);
}
}

View File

@@ -0,0 +1,79 @@
package com.smartlive.bswatch.controller.common;
import com.smartlive.bswatch.service.IWatchWhiteService;
import com.smartlive.common.validator.group.InsertValidate;
import com.smartlive.common.validator.group.UpdateValidate;
import com.smartlive.bswatch.vo.controllerVO.WatchWhiteVO;
import com.smartlive.common.core.domain.AjaxResult;
import com.smartlive.common.utils.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* @author:lilj
* @date:2025/2/11
*/
@RequestMapping("watch/white")
@RestController
public class WatchWhiteController {
@Autowired
private IWatchWhiteService watchWhiteService;
// 增删改查
// 白名单查询
@RequestMapping("list")
public AjaxResult list(WatchWhiteVO watchWhiteVO) {
if(watchWhiteVO==null){
return AjaxResult.error("请指定查询条件");
}
if(StringUtils.isBlank(watchWhiteVO.getEmpNo())){
return AjaxResult.error("人员id不能为空");
}
if(StringUtils.isBlank(watchWhiteVO.getWatchSign())){
return AjaxResult.error("腕表唯一标识不能为空");
}
return watchWhiteService.queryByVO(watchWhiteVO);
}
// // 白名单添加
// @PostMapping("add")
// public AjaxResult add(@Validated(InsertValidate.class) @RequestBody WatchWhitePhoneAddVO watchWhitePhoneAddVO) {
// return watchWhiteService.add(watchWhitePhoneAddVO);
// }
// 白名单添加
@PostMapping("addWhitePhone")
public AjaxResult addWhitePhone(@Validated(InsertValidate.class) @RequestBody WatchWhiteVO watchWhiteVO) {
return watchWhiteService.addWhitePhone(watchWhiteVO);
}
// 白名单修改
@GetMapping("update")
public AjaxResult update(@Validated(UpdateValidate.class) WatchWhiteVO watchWhiteVO) {
return watchWhiteService.updateWithVO(watchWhiteVO);
}
// 白名单删除
@GetMapping("delete")
public AjaxResult delete(Integer id) {
if(id==null){
return AjaxResult.error("请指定要删除的白名单限制电话");
}
List<Integer> idList = java.util.Arrays.asList(id);
return watchWhiteService.removeWithIds(idList);
}
// 白名单删除
@GetMapping("deleteBatch")
public AjaxResult deleteBatch(Integer[] ids) {
if(ids==null || ids.length==0){
return AjaxResult.error("请指定要删除的白名单电话");
}
List<Integer> idList = java.util.Arrays.asList(ids);
return watchWhiteService.removeWithIds(idList);
}
}

View File

@@ -0,0 +1,239 @@
package com.smartlive.bswatch.controller.utilController;
import com.alibaba.fastjson2.JSONObject;
import com.smartlive.bswatch.enmus.WatchApiEnum;
import com.smartlive.bswatch.utils.WatchMsgSendUtil;
import com.smartlive.bswatch.netty.watchvo.MessageVO;
import com.smartlive.bswatch.vo.commandVO.*;
import com.smartlive.common.core.domain.AjaxResult;
import com.smartlive.common.enums.WatchReturnMessage;
import org.apache.commons.lang3.StringUtils;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @author:lilj
* @date:2025/1/22
*/
@RequestMapping("watch/command")
@RestController
public class CommandController {
/**
* 设置可呼入号码:
* 默认一周七天,限制白名单以外号码呼入;时间段建表,学校自己设置从学校中取出
* 删除与添加号码拆分成两个功能.
* 白名单20个号码.
* @param
* @return
* @throws Exception
*/
@RequestMapping("addPhone")
public AjaxResult addPhone(@RequestBody WhitePhoneVO addPhoneVO) throws Exception {
//删除号码@添加号码和时段@呼入限制@周期
addPhoneVO.setApiName(WatchApiEnum.SET_INCOMING_CALL.getApiName());
// 构建vo:
MessageVO messageVO =WatchMsgSendUtil.buildMsgVO(addPhoneVO);
//向腕表发送指令
WatchMsgSendUtil.sendCommand(messageVO);
// 接收腕表响应
String result = WatchMsgSendUtil.getCommandResult(addPhoneVO.getWatchSign(),addPhoneVO.getApiName());
if ("0".equals(result)){
return AjaxResult.successMsg("设置成功");
}
return AjaxResult.error(WatchReturnMessage.SET_WHITE_PHONE_ERROR.getCode(), WatchReturnMessage.SET_WHITE_PHONE_ERROR.getInfo());
}
@RequestMapping("delPhones")
public AjaxResult delPhones(@RequestBody WhitePhoneVO delPhoneVO) throws Exception {
delPhoneVO.setApiName(WatchApiEnum.SET_INCOMING_CALL.getApiName());
// 构建vo:
MessageVO messageVO = WatchMsgSendUtil.buildMsgVO(delPhoneVO);
//向腕表发送指令
WatchMsgSendUtil.sendCommand(messageVO);
// 接收腕表响应
String result = WatchMsgSendUtil.getCommandResult(delPhoneVO.getWatchSign(), delPhoneVO.getApiName());
if ("0".equals(result)){
return AjaxResult.successMsg("设置成功");
}
return AjaxResult.error(WatchReturnMessage.SET_WHITE_PHONE_ERROR.getCode(), WatchReturnMessage.SET_WHITE_PHONE_ERROR.getInfo());
}
@RequestMapping("/setButton")
public AjaxResult setButton(@RequestBody NormalButtonVO normalButtonVO) throws Exception {
normalButtonVO.setApiName(WatchApiEnum.SET_NORMAL_BUTTON.getApiName());
// 构建vo:
MessageVO messageVO =WatchMsgSendUtil.buildMsgVO(normalButtonVO);
WatchMsgSendUtil.sendCommand(messageVO);
String result = WatchMsgSendUtil.getCommandResult(normalButtonVO.getWatchSign(),normalButtonVO.getApiName());
if ("0".equals(result)){
return AjaxResult.successMsg("设置成功");
}
return AjaxResult.error(WatchReturnMessage.SET_BUTTON_ERROR.getCode(), WatchReturnMessage.SET_BUTTON_ERROR.getInfo());
}
/**
* 实时位置获取
* @param currentPositionVO
* @return
* @throws Exception
*/
@RequestMapping("getCurrentPosition")
public AjaxResult getCurrentPosition(@RequestBody CommonNoParamVO currentPositionVO) throws Exception {
currentPositionVO.setApiName(WatchApiEnum.LOCATION_INFO_GET.getApiName());
// 构建vo:
MessageVO messageVO =WatchMsgSendUtil.buildMsgVO(currentPositionVO);
WatchMsgSendUtil.sendCommand(messageVO);
String result = WatchMsgSendUtil.getCommandResult(currentPositionVO.getWatchSign(),currentPositionVO.getApiName());
try{
CurrentPositionRespVO currentPositionRespVO = JSONObject.parseObject(result, CurrentPositionRespVO.class);
if(currentPositionRespVO==null){
return AjaxResult.error(WatchReturnMessage.GET_POSITION_ERROR.getCode(), WatchReturnMessage.GET_POSITION_ERROR.getInfo());
}
return AjaxResult.success("获取成功",currentPositionRespVO);
}catch (Exception e){
return AjaxResult.error(WatchReturnMessage.GET_POSITION_ERROR.getCode(), WatchReturnMessage.GET_POSITION_ERROR.getInfo());
}
}
/**
* 安全防护
* @param callVO
* @return
* @throws Exception
*/
@RequestMapping("requestCall")
public AjaxResult requestCall(@RequestBody RequestCallVO callVO) throws Exception {
callVO.setApiName(WatchApiEnum.REQUEST_CALL.getApiName());
callVO.setConrent("1");
// 构建vo:
MessageVO messageVO =WatchMsgSendUtil.buildMsgVO(callVO);
WatchMsgSendUtil.sendCommand(messageVO);
String result = WatchMsgSendUtil.getCommandResult(callVO.getWatchSign(),callVO.getApiName());
if("0".equals(result)){
return AjaxResult.successMsg("请求成功");
}
return AjaxResult.error(WatchReturnMessage.REQUEST_CALL_ERROR.getCode(), WatchReturnMessage.REQUEST_CALL_ERROR.getInfo());
}
@RequestMapping("frequencyLocationSet")
public AjaxResult frequencyLocationSet(@RequestBody FrequencyLocationVO frequencyLocationVO) throws Exception {
frequencyLocationVO.setApiName(WatchApiEnum.FREQUENCY_LOCATION_SET.getApiName());
// 构建vo:
MessageVO messageVO =WatchMsgSendUtil.buildMsgVO(frequencyLocationVO);
WatchMsgSendUtil.sendCommand(messageVO);
String result = WatchMsgSendUtil.getCommandResult(frequencyLocationVO.getWatchSign(),frequencyLocationVO.getApiName());
if("0".equals(result)){
return AjaxResult.successMsg("设置成功");
}
return AjaxResult.error(WatchReturnMessage.FREQUENCY_LOCATION_SET_ERROR.getCode(), WatchReturnMessage.FREQUENCY_LOCATION_SET_ERROR.getInfo());
}
@RequestMapping("setHeartBeat")
public AjaxResult setHeartBeat(@RequestBody HeartBeatVO heartBeatVO) throws Exception {
heartBeatVO.setApiName(WatchApiEnum.SET_HEARTBEAT.getApiName());
// 构建vo:
MessageVO messageVO =WatchMsgSendUtil.buildMsgVO(heartBeatVO);
WatchMsgSendUtil.sendCommand(messageVO);
String result = WatchMsgSendUtil.getCommandResult(heartBeatVO.getWatchSign(),heartBeatVO.getApiName());
if("0".equals(result)){
return AjaxResult.successMsg("设置成功");
}
return AjaxResult.error(WatchReturnMessage.SET_HEARTBEAT_ERROR.getCode(), WatchReturnMessage.SET_HEARTBEAT_ERROR.getInfo());
}
@RequestMapping("setClassModel")
public AjaxResult setClassModel(@RequestBody ClassModelVO classModelVO) throws Exception {
classModelVO.setApiName(WatchApiEnum.SET_CLASS_MODEL.getApiName());
// 构建vo:
MessageVO messageVO =WatchMsgSendUtil.buildMsgVO(classModelVO);
WatchMsgSendUtil.sendCommand(messageVO);
String result = WatchMsgSendUtil.getCommandResult(classModelVO.getWatchSign(),classModelVO.getApiName());
if("0".equals(result)){
return AjaxResult.successMsg("设置成功");
}
return AjaxResult.error(WatchReturnMessage.SET_CLASS_MODEL_ERROR.getCode(), WatchReturnMessage.SET_CLASS_MODEL_ERROR.getInfo());
}
@RequestMapping("sendSms")
public AjaxResult sendSms(@RequestBody SendSmsVO sendSmsVO) throws Exception {
sendSmsVO.setApiName(WatchApiEnum.SEND_SMS.getApiName());
// 构建vo:
MessageVO messageVO =WatchMsgSendUtil.buildMsgVO(sendSmsVO);
WatchMsgSendUtil.sendCommand(messageVO);
String result = WatchMsgSendUtil.getCommandResult(sendSmsVO.getWatchSign(),sendSmsVO.getApiName());
if("0".equals(result)){
return AjaxResult.successMsg("发送成功");
}
return AjaxResult.error(WatchReturnMessage.SEND_SMS_ERROR.getCode(), WatchReturnMessage.SEND_SMS_ERROR.getInfo());
}
@RequestMapping("setStudentInfo")
public AjaxResult setStudentInfo(@RequestBody StudentInfoVO studentInfoVO) throws Exception {
studentInfoVO.setApiName(WatchApiEnum.SET_STUDENT_INFO.getApiName());
// 构建vo:
MessageVO messageVO =WatchMsgSendUtil.buildMsgVO(studentInfoVO);
WatchMsgSendUtil.sendCommand(messageVO);
String result = WatchMsgSendUtil.getCommandResult(studentInfoVO.getWatchSign(),studentInfoVO.getApiName());
if("0".equals(result)){
return AjaxResult.successMsg("设置成功");
}
return AjaxResult.error(WatchReturnMessage.SET_STUDENT_INFO_ERROR);
}
@RequestMapping("sendTestCommand")
public AjaxResult sendTestCommand(String apiName,String command,String watchSign) throws Exception {
command=command.replaceAll(" ","+");
if(StringUtils.isBlank(watchSign)){
return AjaxResult.error("设备IMEI为空");
}
MessageVO messageVO = WatchMsgSendUtil.buildMsgVO(watchSign,"89860120801609197568",apiName,command);
WatchMsgSendUtil.sendCommand(messageVO);
// 接收腕表响应
String result = WatchMsgSendUtil.getCommandResult("865593070205859", apiName);
if ("0".equals(result)){
return AjaxResult.successMsg("设置成功");
}
return AjaxResult.error("设置失败,请稍后再试");
}
/**
* 设置待机模式
*/
@RequestMapping("setRedayMode")
public AjaxResult setRedayMode(@RequestBody SetRedayModeVO setRedayModeVO) throws Exception {
setRedayModeVO.setApiName(WatchApiEnum.SET_REDAY_MODE.getApiName());
MessageVO messageVO =WatchMsgSendUtil.buildMsgVO(setRedayModeVO);
WatchMsgSendUtil.sendCommand(messageVO);
String result = WatchMsgSendUtil.getCommandResult(setRedayModeVO.getWatchSign(),setRedayModeVO.getApiName());
if("0".equals(result)){
return AjaxResult.successMsg("设置成功");
}
return AjaxResult.error(WatchReturnMessage.SET_REDAY_MODE_ERROR);
}
/**
* 设置待机模式
*/
@RequestMapping("setLoactionMode")
public AjaxResult setLoactionMode(@RequestBody SetLocationModelVO setLocationModelVO) throws Exception {
setLocationModelVO.setApiName(WatchApiEnum.SET_LOCATION_MODE.getApiName());
MessageVO messageVO =WatchMsgSendUtil.buildMsgVO(setLocationModelVO);
WatchMsgSendUtil.sendCommand(messageVO);
String result = WatchMsgSendUtil.getCommandResult(setLocationModelVO.getWatchSign(),setLocationModelVO.getApiName());
if("0".equals(result)){
return AjaxResult.successMsg("设置成功");
}
return AjaxResult.error(WatchReturnMessage.SET_LOCATION_MODEL_ERROR);
}
}

View File

@@ -0,0 +1,164 @@
package com.smartlive.bswatch.controller.utilController;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject;
import com.smartlive.bswatch.config.ApiEntityMap;
import com.smartlive.bswatch.config.TestConfig;
import com.smartlive.bswatch.entity.WatchDevice;
import com.smartlive.bswatch.netty.event.TestEvent;
import com.smartlive.bswatch.netty.publisher.TestPublisher;
import com.smartlive.bswatch.service.CommonService;
import com.smartlive.bswatch.service.IDeviceUploadService;
import com.smartlive.bswatch.utils.CardAesUtil;
import com.smartlive.bswatch.utils.WatchMsgParseUtil;
import com.smartlive.bswatch.netty.watchvo.MessageVO;
import com.smartlive.common.core.domain.AjaxResult;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Map;
/**
* @author:lilj
* @date:2025/1/20
*/
@RequestMapping("watch/util")
@RestController
public class UtilController {
@Autowired
private IDeviceUploadService deviceUploadService;
@Autowired
private TestPublisher testPublisher;
@Autowired
private CommonService commonService;
// 加解密
@RequestMapping("enAndDe")
public AjaxResult enAndDe(@RequestBody String content) throws Exception {
JSONObject jsonObject = JSON.parseObject(content);
String msg = jsonObject.getString("msg");
String type = jsonObject.getString("type");
if (StringUtils.isBlank(msg)) {
return AjaxResult.error("参数为空");
}
if ("en".equals(type)) {
String enStr = new String(CardAesUtil.encryptBsj(msg.getBytes()));
return AjaxResult.success("加密成功", enStr);
}
if ("de".equals(type)) {
String deStr = CardAesUtil.decryptBsj(msg);
return AjaxResult.success("解密成功", deStr);
}
return AjaxResult.error("参数错误");
}
@RequestMapping("/toMsgVO")
public AjaxResult toMsgVO(@RequestBody String msg) throws Exception {
if (StringUtils.isBlank(msg)) {
return AjaxResult.error("参数为空");
}
JSONObject jsonObject = JSON.parseObject(msg);
msg = jsonObject.getString("msg");
return AjaxResult.success("转换成功", WatchMsgParseUtil.getMsg(msg));
}
@RequestMapping("/modifyParam")
public AjaxResult modifyParam(Map<String, Object> map) throws Exception {
return AjaxResult.success();
}
@RequestMapping("/setConfig")
public AjaxResult setConfig(@RequestBody Map<String, Object> cfg) throws Exception {
TestConfig.realResp = (Boolean) cfg.get("realResp");
Object paramObject = cfg.get("paramObject");
TestConfig.bizType = (String) cfg.get("bizType");
TestConfig.paramObject = JSON.to(ApiEntityMap.map.get(TestConfig.bizType), paramObject);
return AjaxResult.success(cfg);
}
@RequestMapping("/getSysTime")
public AjaxResult getSysTime() throws Exception {
Date now = new Date();
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
return AjaxResult.success(format.format(now));
}
@RequestMapping("/saveDevice")
public AjaxResult saveDevice(String msg) throws Exception {
String message = "issnCSpq6oIfYo4ig+AFWJuKlhZW8Gi03TCBb/aodbZzCUE9vwwYw/QT30ZhAyRtucs+Zq+gH4/mng30KWqDK0fiz2rU+5s2d70BzLujhAhzdgn/fA6esMT7IiEeNzWfsY/5DpVsx1WSAxG2gL8jeeTEXen0HxCt2rCOZhOLxxw=#kdsjafjalsdjg#170";
MessageVO messageVO = WatchMsgParseUtil.getMsg(message);
deviceUploadService.login(messageVO);
return AjaxResult.success();
}
@RequestMapping("/saveStep")
public AjaxResult saveStep(String msg) throws Exception {
String message = "issnCSpq6oIfYo4ig+AFWJuKlhZW8Gi03TCBb/aodbZjRd/3xafcZnyG75kc4qQdtW2atrrQug/TlLOLWL4aom1WKdkMdzsgpvJ3k6ScA3zwf+z6ky6Qy92HOM69tNs4JTBfzAVL6WnvTgGdeAJDBg==#kdsjafjalsdjg#170";
MessageVO messageVO = WatchMsgParseUtil.getMsg(message);
deviceUploadService.recordStep(messageVO);
return AjaxResult.success();
}
@RequestMapping("/saveHealth")
public AjaxResult saveHealth(String msg) throws Exception {
String message = "issnCSpq6oIfYo4ig+AFWJuKlhZW8Gi03TCBb/aodbZilxhnxd39gWWphBLQVGDsalFYrg22LlGXzYcXAQmFNxhs9A7WuBdh7Jw0057zrNZ32V/52RxyuLbXH4cSDUOsS/Zs2xsiFXuRtcYOGQpvwg==#kdsjafjalsdjg#170";
MessageVO messageVO = WatchMsgParseUtil.getMsg(message);
deviceUploadService.recordHealth(messageVO);
return AjaxResult.success();
}
/**
* 测试springBoot事件
*/
@RequestMapping("/testEvent")
public AjaxResult testEvent(String msg) throws Exception {
TestEvent testEvent = new TestEvent(this, msg);
System.out.println("当前线程:" + Thread.currentThread().getName());
testPublisher.publish(msg);
return AjaxResult.success("事件发布成功");
}
/**
* 测试缓存功能
*/
@RequestMapping("/testCache")
public AjaxResult testCache(String type, String watchSign, String empNo) throws Exception {
watchSign = StringUtils.isBlank(watchSign) ? "865593070205859" : watchSign;
empNo = StringUtils.isBlank(empNo) ? "TC1336019032" : empNo;
// 清除缓存
if ("0".equals(type)) {
commonService.cacheEvictDeviceByWatchSign(watchSign);
return AjaxResult.success("根据empNo ---> 清除缓存成功");
}
// 查询设备信息
if ("1".equals(type)) {
WatchDevice watchDeviceByWatchSign = commonService.getWatchDeviceByWatchSign(watchSign);
return AjaxResult.success(watchDeviceByWatchSign);
}
if ("2".equals(type)) {
commonService.cacheEvictDeviceByEmpNo(empNo,watchSign);
return AjaxResult.success("根据empNo ---> 清除缓存成功");
}
if ("3".equals(type)) {
WatchDevice watchDevice = commonService.getWatchDeviceByEmpNo(empNo,watchSign);
return AjaxResult.success(watchDevice);
}
return AjaxResult.error("未知类型的消息");
}
}

View File

@@ -0,0 +1,54 @@
package com.smartlive.bswatch.controller.web;
import com.smartlive.bswatch.service.IWatchClassModelService;
import com.smartlive.common.validator.group.InsertValidate;
import com.smartlive.common.validator.group.UpdateValidate;
import com.smartlive.bswatch.vo.controllerVO.WatchClassModelVO;
import com.smartlive.common.core.domain.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
/**
* @author:lilj
* @date:2025/2/14
*/
@RequestMapping("/watch/classMode")
@RestController
public class WatchClassModeController {
@Autowired
private IWatchClassModelService watchClassModelService;
/**
* 查询
* @param classModelVO
* @return
*/
@RequestMapping("/list")
public AjaxResult list(WatchClassModelVO classModelVO) {
return watchClassModelService.queryVO(classModelVO);
}
/**
* 增加数据
*/
@PostMapping("/add")
public AjaxResult add(@Validated(InsertValidate.class) @RequestBody WatchClassModelVO classModelVO) {
return watchClassModelService.saveVO(classModelVO);
}
/**
* 修改数据
*/
@PostMapping("/update")
public AjaxResult update(@Validated(UpdateValidate.class) @RequestBody WatchClassModelVO classModelVO) {
return watchClassModelService.updateVO(classModelVO);
}
/**
* 删除数据
*/
@RequestMapping("/delete")
public AjaxResult delete(Integer id) {
return watchClassModelService.delete(id);
}
}

View File

@@ -0,0 +1,59 @@
package com.smartlive.bswatch.controller.web;
import com.smartlive.bswatch.service.IWatchDeviceService;
import com.smartlive.bswatch.vo.controllerVO.WatchOperationAddVO;
import com.smartlive.bswatch.vo.controllerVO.WatchOperationVO;
import com.smartlive.common.core.domain.AjaxResult;
import com.smartlive.common.utils.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.validation.constraints.NotBlank;
/**
* @author:lilj
* @date:2025/3/19
*/
/**
* 设备管理接口:
* 查询
* 修改
* 新增
* 删除
*/
@RestController
@RequestMapping("/watch/operation")
public class WatchOperationController {
/**
* 查询腕表设备信息
* @return
*/
@Autowired
private IWatchDeviceService watchDeviceService;
// 查询
@RequestMapping("/query")
public AjaxResult query(WatchOperationVO watchOperationVO) {
if(StringUtils.isNotBlank(watchOperationVO.getEmpName())){
watchOperationVO.setEmpName(watchOperationVO.getEmpName());
}
return watchDeviceService.queryWatches(watchOperationVO);
}
// 新增
@PostMapping("/add")
public AjaxResult add(@RequestBody @Validated WatchOperationAddVO watchOperationAddVO) {
return watchDeviceService.addWatch(watchOperationAddVO);
}
// 删除
@GetMapping("/delete")
public AjaxResult delete(@NotBlank(message = "腕表id不能为空") Long deviceId) {
return watchDeviceService.deleteWatch(deviceId);
}
}

View File

@@ -0,0 +1,56 @@
package com.smartlive.bswatch.controller.web;
import com.smartlive.bswatch.service.IWatchWhitePeriodService;
import com.smartlive.common.validator.group.InsertValidate;
import com.smartlive.common.validator.group.UpdateValidate;
import com.smartlive.bswatch.vo.controllerVO.WatchWhitePeriodVO;
import com.smartlive.common.core.domain.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
/**
* @author:lilj
* @date:2025/2/11
*/
@RequestMapping("watch/whitePeriod")
@RestController
public class WatchWhitePeriodController {
@Autowired
private IWatchWhitePeriodService watchWhitePeriodService;
// 增删改查
/**
* 查询
*/
@RequestMapping("list")
public AjaxResult list(WatchWhitePeriodVO watchWhitePeriodVO) {
return watchWhitePeriodService.queryByVO(watchWhitePeriodVO);
}
@PostMapping("add")
public AjaxResult add(@Validated(InsertValidate.class) @RequestBody WatchWhitePeriodVO watchWhitePeriodVO) {
return watchWhitePeriodService.saveWithVO(watchWhitePeriodVO);
}
@PostMapping("update")
public AjaxResult update(@Validated(UpdateValidate.class) @RequestBody WatchWhitePeriodVO watchWhitePeriodVO) {
return watchWhitePeriodService.updateWithVO(watchWhitePeriodVO);
}
@GetMapping("delete")
public AjaxResult delete(Integer id){
if(id==null){
return AjaxResult.error("请指定要删除的白名单限制周期");
}
return watchWhitePeriodService.removeWithIds(java.util.Arrays.asList(id));
}
@GetMapping("deleteBatch")
public AjaxResult deleteBatch(Integer[] ids){
if(ids==null || ids.length==0){
return AjaxResult.error("请指定要删除的白名单限制周期");
}
return watchWhitePeriodService.removeWithIds(java.util.Arrays.asList(ids));
}
}

View File

@@ -0,0 +1,35 @@
package com.smartlive.bswatch.costant;
import com.smartlive.bswatch.enmus.WatchApiEnum;
import java.util.concurrent.TimeUnit;
/**
* @author:lilj
* @date:2025/2/5
*/
// 分隔符
public interface CacheConstant {
String CACHE_SEPARATOR="_";
String WATCH_DEVICE_INFO_KEY= WatchApiEnum.LOGIN.getApiName();
String STEP_KEY= WatchApiEnum.REPORT_HEARTBEAT.getApiName();
String DEVICE_STATUS_KEY = WatchApiEnum.DEVICE_STATUS.getApiName();
String REPORT_LOCATION_INFO_KEY=WatchApiEnum.REPORT_LOCATION_INFO.getApiName();
/**
* 普通命令缓存60s
*/
Integer COMMON_CACHE_TTL=60;
TimeUnit COMMON_CACHE_TTL_UNIT=TimeUnit.SECONDS;
/**
* 缓存有效时间:命令key缓存时间
*/
int LOCATION_CACHE_TIME = 20;
/**
* 缓存时间单位:命令key缓存时间单位
*/
TimeUnit LOCATION_CACHE_TIME_UNIT = TimeUnit.MINUTES;
String WATCH_WARN_KEY = "watchWarn";
}

View File

@@ -0,0 +1,117 @@
package com.smartlive.bswatch.costant;
import java.util.HashSet;
import java.util.Set;
import java.util.concurrent.TimeUnit;
/**
* @author:lilj
* @date:2025/1/21
*/
public interface WatchConstant {
/**
* 全周
*/
String ALL_PERIOD = "0+1+2+3+4+5+6";
/**
* 全天
*/
String ALL_TIME = "0000-2359";
/**
* =默认待机时间段
*/
String REDAY_TIME = "2300-0600";
/**
* 获取命令执行结果的循环次数
*/
// TODO: 演示用降低循环次数以及休眠时间
// int LOOP_COUNT = 20;
/**
* 每次循环休眠的时间数:单位毫秒
*/
// int LOOP_SLEEP_TIME = 500;
// 演示设置为命令等待时间最长为2s
int LOOP_COUNT = 20;
int LOOP_SLEEP_TIME = 100;
// 1.下发请求
// 2.下发响应
// 3.上报请求
// 4.上报响应
String MSG_TYPE_DOWN_REQ = "1";
String MSG_TYPE_DOWN_RESP = "2";
String MSG_TYPE_UP_REQ = "3";
String MSG_TYPE_UP_RESP = "4";
/**
* 课堂模式sos是否可以呼入: 0 否 1是
*/
String SOS_CALL_IN = "0";
/**
* 课堂模式sos是否可以呼出: 0 否 1 是
*/
String SOS_CALL_ON = "0";
/**
* 学生性别
*/
String STUDENT_MALE = "1";
String STUDENT_FEMALE = "2";
String STUDENT_UNKNOWN = "3";
/**
* 图片url
*/
String STUDENT_MALE_AVATAR = "http://download.zhengfankeji.com/upload/technology/stuImg/male.png";
String STUDENT_FEMALE_AVATAR = "http://download.zhengfankeji.com/upload/technology/stuImg/female.png";
String STUDENT_DEFAULT_AVATAR = "http://download.zhengfankeji.com/upload/technology/stuImg/default.png";
/**
* 腕表模式设置
* 0: 待机模式: 待机模式下,设备不连接平台,只可使用拨打电话,接听电话和收发短信;待机模式结束,自动切换为之前模式,如设备处于实时模式则延时至实时
* 模式结束进入待机模式
* 1: 省电模式: 主动定位,保持正常心跳,设备不主动上报位置
* 2: 平衡模式: 平衡模式下设备可主动定位,保持正常心跳,设备每 20 分钟为基准,上报一次当前位置
* 3: 实时模式: 设备与平台保持正常心跳,每 3 分钟上报一次位置信息。
* 每次切换模式后立即上报一次当前位置。
*/
Integer WATCH_MODE_REDAY = 0;
Integer WATCH_MODE_POWER_SAVE = 1;
Integer WATCH_MODE_BALANCE = 2;
Integer WATCH_MODE_IMMEDIATE = 3;
/**
* 白名单电话最大数量
*/
int WATCH_WHITE_MAX_COUNT = 20;
/**
* 定时定位频率设置
*/
int WATCH_LOCATION_FREQUENCY_MIN = 5;
int WATCH_LOCATION_FREQUENCY_MIDDLE = 10;
int WATCH_LOCATION_FREQUENCY_MAX = 20;
int WATCH_LOCATION_FREQUENCY_DEFAULT =20;
String LOGIN_PREFIX = "watch_login:";
// 禁用电话的学校id
final Set<Integer> DISABLE_PHONE_ORGI_IDS = new HashSet<Integer>(){
{
// add(20230);
// 建安区三高 吧
// add(56861);
}
};
}

View File

@@ -0,0 +1,30 @@
package com.smartlive.bswatch.enmus;
import lombok.Getter;
/**
* @author:lilj
* @date:2025/1/21
*/
@Getter
public enum PowerEnum {
// 上报类型(1=缺电报警; 2=关机报警 ; 3=自
// 动关机报警 ; 4=开机报警,5=设备充电,6=电
// 源已断开 7=设备电量已充满)
POOR_ALARM("1", "缺电报警"),
CLOSE_ALARM("2", "关机报警"),
AUTO_CLOSE_ALARM("3", "自动关机报警"),
OPEN_ALARM("4", "开机报警"),
CHARGE_ALARM("5", "设备充电"),
DIS_POWER_ALARM("6", "电源已断开"),
FULL_POWER_ALARM("7", "设备电量已充满");
private String powerType;
private String desc;
PowerEnum(String powerType, String desc) {
this.powerType = powerType;
this.desc = desc;
}
}

View File

@@ -0,0 +1,69 @@
package com.smartlive.bswatch.enmus;
import lombok.Getter;
import java.util.HashMap;
/**
* @author:lilj
* @date:2025/1/18
*/
@Getter
public enum WatchApiEnum {
// 设备请求平台,拉取配置数据
LOGIN("DEVICE_LOGIN","设备登录"),
GET_BUTTON("GET_NORMAL_BUTTON","按键获取"),
GET_INCOME_CALL("GET_INCOMING_CALL","呼入电话获取"),
GET_CLASS_MODEL("GET_CLASS_MODEL","课堂模式获取"),
ERROR_RESP("ERROR_RESP","错误响应"),
GET_SMS_PORT("GET_SMS_PORT","短信端口获取"),
GET_WEATHER_NOW("GET_WEATHER_NOW","获取实时天气"),
GET_WEATHER_FORCAST("GET_WEATHER_FORCAST","获取未来天气"),
GET_WEATHER_INFO("GET_WEATHER_INFO","获取天气信息"),
GET_STUDENT_INFO("GET_STUDENT_INFO","学生信息获取"),
DEVICE_STATUS("DEVICE_STATUS","设备状态上报"),
GET_BALANCE_INFO("GET_BALANCE_INFO", "获取设备绑定人员余额信息"),
// 设备上传数据到平台
ALARM_POWER("ALARM_POWER","电量上报"),
REPORT_HEARTBEAT("REPORT_HEARTBEAT","心跳请求,携带电量与步数"),
REPORT_LOCATION_INFO("REPORT_LOCATION_INFO","位置数据上传"),
REPORT_CALL_LOG("REPORT_CALL_LOG","通话记录上传"),
GET_SKIP_MAC("GET_SKIP_MAC","获取跳绳蓝牙MAC"),
REPORT_HEART_HEALTH("REPORT_HEART_HEALTH","心率健康上报"),
REPORT_SMS_READ("REPORT_SMS_READ","短信读取上报"),
REPORT_SOS("REPORT_SOS","sos上报"),
REPORT_SLEEP_DATA("REPORT_SLEEP_DATA","睡眠数据上报"),
// 平台下发,设备响应接口
SET_INCOMING_CALL("SET_INCOMING_CALL","设置呼入电话"),
SET_NORMAL_BUTTON("SET_NORMAL_BUTTON","设置按键"),
LOCATION_INFO_GET("LOCATION_INFO_GET","实时位置获取"),
REQUEST_CALL("REQUEST_CALL","安全防护"),
FREQUENCY_LOCATION_SET("FREQUENCY_LOCATION_SET","定时上报位置频率设置"),
SET_HEARTBEAT("SET_HEARTBEAT","设备心跳频率设置"),
SET_CLASS_MODEL("SET_CLASS_MODEL","设置课堂模式"),
SEND_SMS("SEND_SMS","发送短信"),
SET_STUDENT_INFO("SET_STUDENT_INFO","设置学生信息"),
SET_REDAY_MODE("SET_REDAY_MODE","设置待机模式"),
SET_LOCATION_MODE("SET_LOCATION_MODE","设置定位模式"),
;
private static HashMap<String,WatchApiEnum> map = new HashMap<>();
private String apiName;
private String desc;
private WatchApiEnum (String apiName,String desc){
this.apiName = apiName;
this.desc = desc;
}
public static WatchApiEnum getByApiName(String apiName){
if(map.size() == 0){
for (WatchApiEnum watachApiEnum : values()) {
map.put(watachApiEnum.apiName,watachApiEnum);
}
}
return map.get(apiName);
}
}

View File

@@ -0,0 +1,46 @@
package com.smartlive.bswatch.entity;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.util.Date;
@Data
@TableName("order_address")
public class Address {
@TableId(value = "address_id")
private Long addressId;
@NotNull(message = "用户ID不能为空")
private Long userId;
@NotBlank(message = "收货人姓名不能为空")
private String consignee;
@NotBlank(message = "联系电话不能为空")
@Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式不正确")
private String phone;
@NotBlank(message = "地区信息不能为空")
private String region;
@NotBlank(message = "详细地址不能为空")
private String detailedAddress;
@TableField(fill = FieldFill.INSERT)
private Date createTime;
@TableField(fill = FieldFill.INSERT_UPDATE)
private Date updateTime;
//状态 1默认,0非默认
private Integer status;
//删除标志 0正常,1删除
private Integer delFlag;
}

View File

@@ -0,0 +1,158 @@
package com.smartlive.bswatch.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* <p>
* 员工表
* </p>
*
* @author lilj
* @since 2025-02-06
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class Employee implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 学号
*/
private String empNo;
/**
* 姓名
*/
private String name;
/**
* 组织id
*/
private Integer organiId;
/**
* 部门id
*/
private Integer deptId;
/**
* 是否有权限 1:表示有 0:表示没有
*/
private Boolean isAccess;
/**
* 删除标识
*/
private Boolean delFlag;
/**
* 创建时间
*/
@TableField(fill = FieldFill.INSERT)
private Date createTime;
/**
* 更新时间
*/
@TableField(fill = FieldFill.INSERT_UPDATE)
private Date updateTime;
/**
* 物理卡号
*/
private String telId;
/**
* 视频公话是否授权:1、表示有 0、表示没有
*/
private String status;
/**
* 0 -正常 1-挂失卡
*/
private Integer icCardStatus;
/**
* 0 -正常 1-挂失卡
*/
private String simCardStatus;
/**
* 性别3:未知
*/
private String sex;
/**
* 人员编号
*/
private Integer personNo;
/**
* SIM卡ICCID, 插卡式使用
*/
private Integer phoneCardNo;
/**
* 人脸url
*/
private String facePhoto;
/**
* 人脸特征
*/
private String feature;
/**
* 过期时间
*/
private Date expireDate;
/**
* 年级id
*/
private Integer gradeId;
/**
* 班级id
*/
private Integer classId;
/**
* 年级名称
*/
private String gradeName;
/**
* 班级名称
*/
private String className;
/**
* 校名
*/
private String deptName;
/**
* 授权版本号
*/
private String authVer;
}

View File

@@ -0,0 +1,107 @@
package com.smartlive.bswatch.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.Date;
/**
* <p>
*
* </p>
*
* @author lilj
* @since 2025-04-01
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class Meal implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
/**
* 物理编号
*/
@TableField("phyId")
private String phyId;
/**
* 逻辑卡号
*/
@TableField("cardId")
private Integer cardId;
/**
* 开始时间
*/
@TableField("begTime")
private Date begTime;
/**
* 结束时间
*/
@TableField("endTime")
private Date endTime;
/**
* 余额
*/
@TableField("balance")
private Double balance;
/**
* 补贴
*/
@TableField("subsidy")
private Double subsidy;
/**
* 状态
*/
@TableField("status")
private Integer status;
/**
* 缁鐎?
*/
@TableField("type")
private Integer type;
/**
* 创建时间
*/
@TableField("createTime")
private Date createTime;
/**
* 创建人
*/
@TableField("operator")
private String operator;
/**
* 机构
*/
@TableField("school")
private String school;
/**
* 用户id
*/
@TableField("empId")
private Integer empId;
}

View File

@@ -0,0 +1,52 @@
package com.smartlive.bswatch.entity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
@Data
@TableName("order_watch")
public class OrderWatch {
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
private Long userId;
private String tradeNo;
private Integer payType;
private BigDecimal credit;
private Integer isPass;
private Integer status;
private String payNo;
private Integer watchId;
private String watchName;
private BigDecimal watchPrice;
private Integer watchNum;
private String watchImage;
private String adress;
private String trackNum;
private Date orderTime;
@TableField(fill = FieldFill.INSERT)
private Date createdTime;
@TableField(fill = FieldFill.INSERT_UPDATE)
private Date updatedTime;
}

View File

@@ -0,0 +1,163 @@
package com.smartlive.bswatch.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* <p>
* 组织表
* </p>
*
* @author lilj
* @since 2025-02-07
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class SysOrgani implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 组织id
*/
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
/**
* 组织名称
*/
private String name;
/**
* 组织简称,至多8个字符.
*/
private String simpleName;
/**
* 组织类型1幼教,2小学,3初中,4高中,5企业,6教育局,7完全学校,8完全中校,9九年义务教育学校,10培训机构
*/
private String type;
/**
* 省code
*/
private String province;
/**
* 市code
*/
private String city;
/**
* 区code
*/
private String district;
/**
* 详细地址
*/
private String detaild;
/**
* 状态(正常0,停用1)
*/
private Integer status;
/**
* 补卡金额
*/
private Double rmoney;
/**
* 补卡事项
*/
private String rmoneyNote;
/**
* 家校沟通服务:0:未开通,1:开通
*/
private Integer jxPass;
/**
* 亲情电话服务:0:未开通,1:开通
*/
private Integer qqPass;
/**
* 学费缴纳服务,0:未开通,1:开通,默认0
*/
private Integer xfPass;
/**
* 监控服务:0:关闭,1:开通
*/
private Integer jkPass;
/**
* 电子学生证服务:0:关闭,1:开通
*/
private Integer postPass;
/**
* 餐卡服务:0:未开通,1:开通
*/
private Integer ckPass;
/**
* 补卡服务:0:未开通,1:开通
*/
private Integer bkPass;
/**
* 水卡服务:0:未开通,1:开通
*/
private Integer skPass;
/**
* 餐卡微信充值服务:0:未开通,1:开通
*/
private Integer ckWxPass;
/**
* 餐卡支付宝充值服务:0:未开通,1:开通
*/
private Integer ckZfbPass;
/**
* 水卡微信充值服务:0:未开通,1:开通
*/
private Integer skWxPass;
/**
* 水卡支付宝充值服务:0:未开通,1:开通
*/
private Integer skZfbPass;
/**
* 删除标志(0:正常,1:已删除)
*/
private Integer delFlag;
/**
* 创建时间
*/
@TableField(fill = FieldFill.INSERT)
private Date createTime;
/**
* 更新时间
*/
@TableField(fill = FieldFill.INSERT_UPDATE)
private Date updateTime;
}

View File

@@ -0,0 +1,89 @@
package com.smartlive.bswatch.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* <p>
*
* </p>
*
* @author lilj
* @since 2025-02-05
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class WatchCallRecord implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 通话记录id
*/
@TableId(value = "record_id", type = IdType.AUTO)
private Long recordId;
/**
* 本机sim卡iccid
*/
private String iccid;
/**
* 本机号码
*/
private String selfPhone;
/**
* 通信电话
*/
private String phone;
/**
* 学号
*/
private String empNo;
/**
* 设备唯一标识
*/
private String watchSign;
/**
* 开始时间
*/
@TableField(value = "call_begin_time")
private Date startTime;
/**
* 结束时间
*/
@TableField(value = "call_end_time")
private Date endTime;
/**
* 通话时长(秒)
*/
private Integer duration;
/**
* 通话类型:0 呼入 1 呼出
*/
private Integer callType;
/**
* 通话记录上传时间
*/
private Date createTime;
}

View File

@@ -0,0 +1,66 @@
package com.smartlive.bswatch.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* <p>
* 腕表课堂模式表
* </p>
*
* @author lilj
* @since 2025-02-07
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class WatchClassModel implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 课堂模式id
*/
@TableId(value = "class_id", type = IdType.AUTO)
private Integer classId;
/**
* 时间段
*/
private String times;
/**
* 周几生效:0周末.1-6:周一到周六
*/
private String period;
/**
* 学校id
*/
private Long userId;
private String watchSign;
/**
* 创建时间
*/
@TableField(fill = FieldFill.INSERT)
private Date createTime;
/**
* 修改时间
*/
@TableField(fill = FieldFill.INSERT_UPDATE)
private Date updateTime;
private Integer effective;
}

View File

@@ -0,0 +1,132 @@
package com.smartlive.bswatch.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* <p>
*
* </p>
*
* @author lilj
* @since 2025-02-05
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class WatchDevice implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 腕表id
*/
@TableId(value = "device_id", type = IdType.AUTO)
private Long deviceId;
/**
* 设备唯一标识
*/
private String watchSign;
/**
* 按键数量
*/
private Integer keyNums;
/**
* 有无SOS按键:0 无 1有
*/
private Integer hasSosKey;
/**
* 暂无明确含义
*/
private String terminalType;
/**
* 是否支持区域报警:0 否 1 是
*/
private Integer hasAreaAlarm;
/**
* 是否具备设备呼入功能
*/
private Integer hasCallIn;
/**
* 协议版本
*/
private String protocolVersion;
/**
* rfid:10位
*/
private String rfid;
/**
* 设备绑定电话号码
*/
private String bindPhone;
/**
* 学号
*/
private String empNo;
/**
* SIM卡iccid
*/
private String iccid;
/**
* 创建时间
*/
@TableField(fill = FieldFill.INSERT)
private Date createTime;
/**
* 更新时间
*/
@TableField(fill = FieldFill.INSERT_UPDATE)
private Date updateTime;
/**
* 设备模式:
* 0 待机模式
* 1 省电模式
* 2 平衡模式
* 3 实时模式
*/
private Integer watchMode;
/**
* 待机模式时间段: 默认23:00-0600
*/
private String redayTime;
@TableField(exist = false)
private String empName;
private Integer locationFreq;
private Integer workTime;
/**
* 0 表示刚录入系统 1 表示腕表已经有平台有交互了
*/
private Integer watchStatus;
/**
* 腕表备注信息
*/
private String remark;
}

View File

@@ -0,0 +1,66 @@
package com.smartlive.bswatch.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import javax.validation.constraints.NotNull;
/**
* <p>
* 员工亲情电话
* </p>
*
* @author lilj
* @since 2025-02-06
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class WatchEmpPhone implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 电话id
*/
@TableId(value = "watch_phone_id", type = IdType.AUTO)
@NotNull(message = "watchPhoneId不能为空")
private Integer watchPhoneId;
/**
* 手机号
*/
private String phone;
/**
* 持有人名称
*/
private String phoneName;
/**
* 员工号
*/
private String empNo;
/**
* 状态:0可用
*/
private Integer status;
private String watchSign;
@TableField(fill = FieldFill.INSERT)
private Date createTime;
@TableField(fill = FieldFill.INSERT_UPDATE)
private Date updateTime;
}

View File

@@ -0,0 +1,82 @@
package com.smartlive.bswatch.entity;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.*;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* <p>
* 腕表安全围栏表
* </p>
*
* @author lilj
* @since 2025-02-08
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class WatchFence implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 学生标识
*/
@TableField("emp_no")
private String empNo;
private String watchSign;
/**
* 围栏名称
*/
@TableField("fence_name")
private String fenceName;
/**
* 围栏地址
*/
@TableField("fence_address")
private String fenceAddress;
/**
* 经度
*/
@TableField("longitude")
private BigDecimal longitude;
/**
* 纬度
*/
@TableField("latitude")
private BigDecimal latitude;
/**
* 安全范围
*/
@TableField("size")
private Integer size;
@TableField(value = "create_time", fill = FieldFill.INSERT)
private Date createTime;
@TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
private Date updateTime;
/**
* 逻辑删除字段:0 正常数据;1删除数据
*/
@TableLogic(value = "0",delval = "1")
private Integer delFlag;
}

View File

@@ -0,0 +1,62 @@
package com.smartlive.bswatch.entity;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.Date;
/**
* <p>
* 腕表血压数据表
* </p>
*
* @author lilj
* @since 2025-03-17
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class WatchFloodPressure implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 心率数据id
*/
@TableId(value = "pressure_id", type = IdType.AUTO)
private Long pressureId;
/**
* 舒张压
*/
private String lowPressure;
/**
* 收缩压
*/
private String highPressure;
/**
* 数据上传时间
*/
@TableField(fill = FieldFill.INSERT)
private Date createTime;
/**
* 设备唯一标识
*/
private String watchSign;
/**
* 员工编号
*/
private String empNo;
}

View File

@@ -0,0 +1,38 @@
package com.smartlive.bswatch.entity;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.time.LocalDateTime;
@Data
@TableName("watch_goods")
public class WatchGoods {
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
@NotBlank(message = "腕表名称不能为空")
private String watchName;
@DecimalMin(value = "0.00", message = "价格不能小于0")
private BigDecimal price;
private String image;
private Integer stock;
private String description;
private Integer status;
@TableField(fill = FieldFill.INSERT)
private LocalDateTime createTime;
@TableField(fill = FieldFill.INSERT_UPDATE)
private LocalDateTime updateTime;
}

View File

@@ -0,0 +1,357 @@
package com.smartlive.bswatch.entity;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* <p>
* 健康周报告表
* </p>
*
* @author system
* @since 2025-11-17
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class WatchHealthReport implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 报告ID
*/
@TableId(value = "report_id", type = IdType.AUTO)
private Long reportId;
/**
* 员工编号
*/
@TableField("emp_no")
private String empNo;
/**
* 设备唯一标识
*/
@TableField("watch_sign")
private String watchSign;
/**
* 设备名称
*/
@TableField("watch_name")
private String watchName;
/**
* 报告标题
*/
@TableField("report_title")
private String reportTitle;
/**
* 报告年月
*/
@TableField("report_date")
private String reportDate;
/**
* 报告开始日期
*/
@TableField("start_date")
private String startDate;
/**
* 报告结束日期
*/
@TableField("end_date")
private String endDate;
/**
* 血压测量总次数
*/
@TableField("bp_total_count")
private Integer bpTotalCount;
/**
* 血压正常次数
*/
@TableField("bp_normal_count")
private Integer bpNormalCount;
/**
* 血压异常次数
*/
@TableField("bp_abnormal_count")
private Integer bpAbnormalCount;
/**
* 血压异常比例
*/
@TableField("bp_abnormal_ratio")
private BigDecimal bpAbnormalRatio;
/**
* 血压建议文案
*/
@TableField("bp_advice")
private String bpAdvice;
/**
* 血压状态
*/
@TableField("bp_status")
private Integer bpStatus;
/**
* 血压周数据
*/
/**
* 心率测量总次数
*/
@TableField("hr_total_count")
private Integer hrTotalCount;
/**
* 心率正常次数
*/
@TableField("hr_normal_count")
private Integer hrNormalCount;
/**
* 心率异常次数
*/
@TableField("hr_abnormal_count")
private Integer hrAbnormalCount;
/**
* 心率过缓次数
*/
@TableField("hr_bradycardia_count")
private Integer hrBradycardiaCount;
/**
* 心率过速次数
*/
@TableField("hr_tachycardia_count")
private Integer hrTachycardiaCount;
/**
* 心率异常比例
*/
@TableField("hr_abnormal_ratio")
private BigDecimal hrAbnormalRatio;
/**
* 心率建议文案
*/
@TableField("hr_advice")
private String hrAdvice;
/**
* 心率状态
*/
@TableField("hr_status")
private Integer hrStatus;
/**
* 体温测量总次数
*/
@TableField("temp_total_count")
private Integer tempTotalCount;
/**
* 体温正常次数
*/
@TableField("temp_normal_count")
private Integer tempNormalCount;
/**
* 体温异常次数
*/
@TableField("temp_abnormal_count")
private Integer tempAbnormalCount;
/**
* 体温偏低次数
*/
@TableField("temp_low_count")
private Integer tempLowCount;
/**
* 体温偏高次数
*/
@TableField("temp_high_count")
private Integer tempHighCount;
/**
* 体温异常比例
*/
@TableField("temp_abnormal_ratio")
private BigDecimal tempAbnormalRatio;
/**
* 体温建议文案
*/
@TableField("temp_advice")
private String tempAdvice;
/**
* 体温状态
*/
@TableField("temp_status")
private Integer tempStatus;
/**
* 血氧测量总次数
*/
@TableField("oxy_total_count")
private Integer oxyTotalCount;
/**
* 血氧正常次数
*/
@TableField("oxy_normal_count")
private Integer oxyNormalCount;
/**
* 血氧异常次数
*/
@TableField("oxy_abnormal_count")
private Integer oxyAbnormalCount;
/**
* 血氧异常比例
*/
@TableField("oxy_abnormal_ratio")
private BigDecimal oxyAbnormalRatio;
/**
* 血氧建议文案
*/
@TableField("oxy_advice")
private String oxyAdvice;
/**
* 血氧状态
*/
@TableField("oxy_status")
private Integer oxyStatus;
/**
* 睡眠记录总次数
*/
@TableField("sleep_total_count")
private Integer sleepTotalCount;
/**
* 睡眠正常次数
*/
@TableField("sleep_normal_count")
private Integer sleepNormalCount;
/**
* 睡眠异常次数
*/
@TableField("sleep_abnormal_count")
private Integer sleepAbnormalCount;
/**
* 睡眠异常比例
*/
@TableField("sleep_abnormal_ratio")
private BigDecimal sleepAbnormalRatio;
/**
* 睡眠建议文案
*/
@TableField("sleep_advice")
private String sleepAdvice;
/**
* 睡眠状态
*/
@TableField("sleep_status")
private Integer sleepStatus;
/**
* 整体异常次数
*/
@TableField("overall_score")
private Integer overallScore;
/**
* 整体状态
*/
@TableField("overall_status")
private String overallStatus;
/**
* 整体健康文案
*/
@TableField("overall_assessment")
private String overallAssessment;
/**
* 舒张压
*/
@TableField(exist = false)
private List<Integer> lowPressures;
/**
* 收缩压
*/
@TableField(exist = false)
private List<Integer> highPressures;
/**
* 心率数据
*/
@TableField(exist = false)
private List<Integer> heartBeats;
/**
* 血氧数据
*/
@TableField(exist = false)
private List<Integer> oxyDatas;
/**
* 体温数据
*/
@TableField(exist = false)
private List<Double> temperatureDatas;
/**
* 睡眠总时长(分钟)
*/
@TableField(exist = false)
private List<Double> sleepTotalTimes;
/**
* 时间
*/
@TableField(exist = false)
private List<String> times;
/**
* 报告生成时间
*/
@TableField(fill = FieldFill.INSERT)
private Date createTime;
/**
* 更新时间
*/
@TableField(fill = FieldFill.INSERT_UPDATE)
private Date updateTime;
}

View File

@@ -0,0 +1,104 @@
package com.smartlive.bswatch.entity;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* <p>
* 腕表健康规则表
* </p>
*
* @author system
* @since 2025-11-17
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class WatchHealthRules implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 规则ID
*/
@TableId(value = "rule_id", type = IdType.AUTO)
private Long ruleId;
/**
* 指标类型: BLOOD_PRESSURE(血压), HEART_RATE(心率), TEMPERATURE(体温), BLOOD_OXYGEN(血氧), SLEEP(睡眠)
*/
private String indicatorType;
/**
* 规则名称
*/
private String ruleName;
/**
* 条件表达式(JSON格式)
*/
private String conditionExpression;
/**
* 判断标准描述
*/
private String judgmentCriteria;
/**
* 建议文案模板
*/
private String adviceTemplate;
/**
* 优先级(数字越小优先级越高)
*/
private Integer priority;
/**
* 状态:1启用,0禁用
*/
private Integer status;
/**
* 最小值
*/
private BigDecimal minValue;
/**
* 最大值
*/
private BigDecimal maxValue;
/**
* 异常类型: NORMAL(正常), ABNORMAL(异常),OCCASIONAL(偶尔异常)
*/
private Integer abnormalType;
/**
* 阈值比例
*/
private BigDecimal thresholdRatio;
/**
* 创建时间
*/
@TableField(fill = FieldFill.INSERT)
private Date createTime;
/**
* 更新时间
*/
@TableField(fill = FieldFill.INSERT_UPDATE)
private Date updateTime;
}

View File

@@ -0,0 +1,57 @@
package com.smartlive.bswatch.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* <p>
*
* </p>
*
* @author lilj
* @since 2025-02-05
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class WatchHeart implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 心率数据id
*/
@TableId(value = "heart_id", type = IdType.AUTO)
private Long heartId;
/**
* 心率数据
*/
private Integer heartBeat;
/**
* 数据上传时间
*/
@TableField(fill = FieldFill.INSERT)
private Date createTime;
/**
* 设备唯一标识
*/
private String watchSign;
/**
* 员工号
*/
private String empNo;
}

View File

@@ -0,0 +1,73 @@
package com.smartlive.bswatch.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* <p>
*
* </p>
*
* @author lilj
* @since 2025-02-05
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class WatchLocation implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 位置信息id
*/
@TableId(value = "location_id", type = IdType.AUTO)
private Long locationId;
/**
* 设备唯一标识
*/
private String watchSign;
/**
* 定位模式:0:LBS+wifi 1:GPS
*/
private Integer locationType;
/**
* 经度
*/
private BigDecimal longitude;
/**
* 纬度
*/
private BigDecimal latitude;
/**
* 地址名称
*/
private String address;
/**
* 创建时间
*/
@TableField(fill = FieldFill.INSERT)
private Date createTime;
private String empNo;
private String areaCode;
}

View File

@@ -0,0 +1,69 @@
package com.smartlive.bswatch.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* <p>
*
* </p>
*
* @author lilj
* @since 2025-02-28
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class WatchModeLog implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 设备模式切换日志id
*/
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 腕表唯一标识
*/
private String watchSign;
private String empNo;
/**
* 切换前模式
*/
private Integer beforeMode;
/**
* 切换后模式
*/
private Integer afterMode;
/**
* 切换时间
*/
private Date changeTime;
/**
* 之前模式工作时间
*/
private Integer workTime;
/**
* 日志创建时间
*/
@TableField(fill = FieldFill.INSERT)
private Date createTime;
}

View File

@@ -0,0 +1,57 @@
package com.smartlive.bswatch.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* <p>
*
* </p>
*
* @author lilj
* @since 2025-02-05
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class WatchOxy implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 血氧数据id
*/
@TableId(value = "oxy_id", type = IdType.AUTO)
private Long oxyId;
/**
* 血氧数据
*/
private String oxyData;
/**
* 血氧数据上传时间
*/
@TableField(fill = FieldFill.INSERT)
private Date createTime;
/**
* 设备唯一标识
*/
private String watchSign;
/**
* 员工号
*/
private String empNo;
}

View File

@@ -0,0 +1,64 @@
package com.smartlive.bswatch.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* <p>
*
* </p>
*
* @author lilj
* @since 2025-02-28
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class WatchPower implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 电量id
*/
@TableId(value = "power_id", type = IdType.AUTO)
private Long powerId;
/**
* 电量
*/
private String power;
/**
* 腕表唯一标识
*/
private String watchSign;
/**
* 创建时间
*/
@TableField(fill = FieldFill.INSERT)
private Date createTime;
/**
* 更新时间
*/
@TableField(fill = FieldFill.INSERT_UPDATE)
private Date updateTime;
/**
* 上报类型(1=缺电报警; 2=关机报警 ; 3=自
* 动关机报警 ; 4=开机报警,5=设备充电,6=电
* 源已断开 7=设备电量已充满)
*/
private String powerType;
}

View File

@@ -0,0 +1,63 @@
package com.smartlive.bswatch.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* <p>
*
* </p>
*
* @author lilj
* @since 2025-04-02
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class WatchSkip implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 跳绳id
*/
@TableId(value = "skip_id", type = IdType.AUTO)
private Long skipId;
/**
* 跳绳mac地址
*/
private String skipMac;
/**
* 关联学号
*/
private String empNo;
/**
* 关联人员信息
*/
private String watchSign;
/**
* 创建时间
*/
@TableField(fill = FieldFill.INSERT)
private Date createTime;
/**
* 更新时间
*/
@TableField(fill = FieldFill.INSERT_UPDATE)
private Date updateTime;
}

View File

@@ -0,0 +1,83 @@
package com.smartlive.bswatch.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* <p>
* 腕表睡眠数据表
* </p>
*
* @author lilj
* @since 2025-03-18
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class WatchSleep implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 睡眠数据id
*/
@TableId(value = "sleep_id", type = IdType.AUTO)
private Long sleepId;
/**
* 睡眠时间段
*/
private String sleepPeriod;
/**
* 睡眠数据上传时间
*/
@TableField(fill = FieldFill.INSERT)
private Date createTime;
/**
* 设备唯一标识
*/
private String watchSign;
/**
* 员工编号
*/
private String empNo;
/**
* 睡眠总时长(分钟)
*/
private String sleepTotalTime;
/**
* 深度睡眠时长
*/
private String deepSleepTime;
/**
* 浅度睡眠时长
*/
private String lightSleepTime;
/**
* rem睡眠时长
*/
private String remSleepTime;
/**
* 清醒时长
*/
private String wakeTime;
}

View File

@@ -0,0 +1,68 @@
package com.smartlive.bswatch.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* <p>
*
* </p>
*
* @author lilj
* @since 2025-02-05
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class WatchSos implements Serializable {
private static final long serialVersionUID = 1L;
/**
* sos电话id
*/
@TableId(value = "sos_id", type = IdType.AUTO)
private Long sosId;
/**
* sos电话
*/
private String sosPhone;
/**
* 电话联系人
*/
private String phoneName;
/**
* 学生标识
*/
private String empNo;
/**
* 腕表唯一标识
*/
private String watchSign;
/**
* 创建时间
*/
@TableField(fill = FieldFill.INSERT)
private Date createTime;
/**
* 更新时间
*/
@TableField(fill = FieldFill.INSERT_UPDATE)
private Date updateTime;
}

View File

@@ -0,0 +1,58 @@
package com.smartlive.bswatch.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* <p>
* 腕表sos报警日志表
* </p>
*
* @author lilj
* @since 2025-03-18
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class WatchSosLog implements Serializable {
private static final long serialVersionUID = 1L;
/**
* sos上报记录id
*/
@TableId(value = "sos_log_id", type = IdType.AUTO)
private Long sosLogId;
/**
* sos上报时间
*/
private Date reportTime;
/**
* 系统保存时间
*/
@TableField(fill = FieldFill.INSERT)
private Date createTime;
/**
* 设备唯一标识
*/
private String watchSign;
/**
* 员工编号
*/
private String empNo;
}

View File

@@ -0,0 +1,60 @@
package com.smartlive.bswatch.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* <p>
*
* </p>
*
* @author lilj
* @since 2025-02-05
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class WatchStep implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 步数id
*/
@TableId(value = "step_id", type = IdType.AUTO)
private Long stepId;
/**
* 步数
*/
private Integer stepCount;
/**
* 每日日期,精确到日
*/
@TableField(fill = FieldFill.INSERT)
private Date createTime;
/**
* 更新时间
*/
@TableField(fill = FieldFill.INSERT_UPDATE)
private Date updateTime;
/**
* 设备唯一标识
*/
private String watchSign;
private String empNo;
}

View File

@@ -0,0 +1,72 @@
package com.smartlive.bswatch.entity;
import com.baomidou.mybatisplus.annotation.*;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* <p>
* 部门表
* </p>
*
* @author lilj
* @since 2025-02-07
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("sys_dept")
public class WatchSysDept implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
@TableId(value = "dept_id", type = IdType.AUTO)
private Integer deptId;
/**
* 部门名称
*/
private String deptName;
/**
* 父部门Id
*/
private Long parentId;
/**
* 组织id
*/
private Integer organiId;
/**
* 状态(0正常,1停用)
*/
private Integer status;
/**
* 删除标志(0正常,1删除)
*/
private Integer delFalg;
/**
* 创建时间
*/
@TableField(fill = FieldFill.INSERT)
private Date createTime;
/**
* 更新时间
*/
@TableField(fill = FieldFill.INSERT_UPDATE)
private Date updateTime;
}

View File

@@ -0,0 +1,56 @@
package com.smartlive.bswatch.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* <p>
*
* </p>
*
* @author lilj
* @since 2025-02-05
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class WatchTemperature implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 体温数据id
*/
@TableId(value = "temperature_id", type = IdType.AUTO)
private Long temperatureId;
/**
* 体温数据
*/
private String temperatureData;
/**
* 体温数据上传时间
*/
@TableField(fill = FieldFill.INSERT)
private Date createTime;
/**
* 设备唯一标识
*/
private String watchSign;
/**
* 员工编号
*/
private String empNo;
}

View File

@@ -0,0 +1,74 @@
package com.smartlive.bswatch.entity;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* <p>
* 腕表定位警报表
* </p>
*
* @author lilj
* @since 2025-02-08
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class WatchWarn implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 学号
*/
private String empNo;
/**
* 腕表唯一标识
*/
private String watchSign;
/**
* 报警名称
*/
private String warnName;
/**
* 经度
*/
private BigDecimal longitude;
/**
* 纬度
*/
private BigDecimal latitude;
/**
* 距离:4为小数
*/
private BigDecimal distance;
/**
* 报警地点
*/
private String warnAddress;
/**
* 报警时间
*/
private Date warnTime;
private Long fenceId;
}

View File

@@ -0,0 +1,79 @@
package com.smartlive.bswatch.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* <p>
*
* </p>
*
* @author lilj
* @since 2025-02-05
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class WatchWhite implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 白名单id
*/
@TableId(value = "white_id", type = IdType.AUTO)
private Long whiteId;
/**
* 白名单电话
*/
private String whitePhone;
/**
* 电话联系人
*/
private String phoneName;
/**
* 设备唯一标识
*/
private String watchSign;
/**
* 学生学号
*/
private String empNo;
/**
* 创建时间
*/
@TableField(fill = FieldFill.INSERT)
private Date createTime;
/**
* 更新时间
*/
@TableField(fill = FieldFill.INSERT_UPDATE)
private Date updateTime;
/**
* 时间段1
*/
private String time1;
/**
* 时间段2
*/
private String time2;
}

View File

@@ -0,0 +1,60 @@
package com.smartlive.bswatch.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* <p>
*
* </p>
*
* @author lilj
* @since 2025-02-05
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class WatchWhitePeriod implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 时间段id
*/
@TableId(value = "period_id", type = IdType.AUTO)
private Long periodId;
/**
* 用户id
*/
private String empNo;
/**
* 设备唯一标识
*/
private String watchSign;
/**
* 创建时间
*/
@TableField(fill = FieldFill.INSERT)
private Date createTime;
/**
* 修改时间
*/
@TableField(fill = FieldFill.INSERT_UPDATE)
private Date updateTime;
private String period;
}

View File

@@ -0,0 +1,107 @@
package com.smartlive.bswatch.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.Date;
/**
* <p>
*
* </p>
*
* @author lilj
* @since 2025-04-01
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class Water implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
/**
* 物理编号
*/
@TableField("phyId")
private String phyId;
/**
* 逻辑卡号
*/
@TableField("cardId")
private Integer cardId;
/**
* 开始时间
*/
@TableField("begTime")
private Date begTime;
/**
* 结束时间
*/
@TableField("endTime")
private Date endTime;
/**
* 余额
*/
@TableField("balance")
private Double balance;
/**
* 补贴
*/
@TableField("subsidy")
private Double subsidy;
/**
* 状态
*/
@TableField("status")
private Integer status;
/**
* 0直饮水,1淋浴,2吹风机
*/
@TableField("type")
private Integer type;
/**
* 创建时间
*/
@TableField("createTime")
private Date createTime;
/**
* 创建人
*/
@TableField("operator")
private String operator;
/**
* 机构
*/
@TableField("school")
private String school;
/**
* 用户id
*/
@TableField("empId")
private Integer empId;
}

View File

@@ -0,0 +1,8 @@
package com.smartlive.bswatch.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.smartlive.bswatch.entity.Address;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface AddressMapper extends BaseMapper<Address>{
}

View File

@@ -0,0 +1,8 @@
package com.smartlive.bswatch.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.smartlive.bswatch.entity.OrderWatch;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface OrderWatchMapper extends BaseMapper<OrderWatch> {
}

View File

@@ -0,0 +1,16 @@
package com.smartlive.bswatch.mapper;
import com.smartlive.bswatch.entity.WatchCallRecord;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* Mapper 接口
* </p>
*
* @author lilj
* @since 2025-02-05
*/
public interface WatchCallRecordMapper extends BaseMapper<WatchCallRecord> {
}

View File

@@ -0,0 +1,20 @@
package com.smartlive.bswatch.mapper;
import com.smartlive.bswatch.entity.WatchClassModel;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.smartlive.bswatch.vo.controllerVO.WatchClassModelVO;
import java.util.List;
/**
* <p>
* 腕表课堂模式表 Mapper 接口
* </p>
*
* @author lilj
* @since 2025-02-07
*/
public interface WatchClassModelMapper extends BaseMapper<WatchClassModel> {
List<WatchClassModelVO> queryVO(WatchClassModelVO classModelVO);
}

View File

@@ -0,0 +1,22 @@
package com.smartlive.bswatch.mapper;
import com.smartlive.bswatch.entity.WatchDevice;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.smartlive.bswatch.vo.controllerVO.WatchOperationVO;
import java.util.List;
/**
* <p>
* Mapper 接口
* </p>
*
* @author lilj
* @since 2025-02-05
*/
public interface WatchDeviceMapper extends BaseMapper<WatchDevice> {
List<WatchOperationVO> queryVO(WatchOperationVO watchOperationVO);
List<WatchDevice> getUsedWatchDeviceList();
}

View File

@@ -0,0 +1,20 @@
package com.smartlive.bswatch.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.smartlive.bswatch.entity.WatchEmpPhone;
import com.smartlive.bswatch.vo.controllerVO.WatchEmpPhoneVO;
import java.util.List;
/**
* <p>
* 员工亲情电话 Mapper 接口
* </p>
*
* @author lilj
* @since 2025-02-06
*/
public interface WatchEmpPhoneMapper extends BaseMapper<WatchEmpPhone> {
List<WatchEmpPhoneVO> selectEmpPhone(WatchEmpPhoneVO empPhoneVO);
}

View File

@@ -0,0 +1,16 @@
package com.smartlive.bswatch.mapper;
import com.smartlive.bswatch.entity.Employee;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* 员工表 Mapper 接口
* </p>
*
* @author lilj
* @since 2025-02-06
*/
public interface WatchEmployeeMapper extends BaseMapper<Employee> {
}

View File

@@ -0,0 +1,20 @@
package com.smartlive.bswatch.mapper;
import com.smartlive.bswatch.entity.WatchFence;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.smartlive.bswatch.vo.controllerVO.WatchFenceVO;
import java.util.List;
/**
* <p>
* 腕表安全围栏表 Mapper 接口
* </p>
*
* @author lilj
* @since 2025-02-08
*/
public interface WatchFenceMapper extends BaseMapper<WatchFence> {
List<WatchFenceVO> selectQueryVO(WatchFenceVO fenceVO);
}

View File

@@ -0,0 +1,28 @@
package com.smartlive.bswatch.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.smartlive.bswatch.entity.WatchFloodPressure;
import com.smartlive.bswatch.vo.commandVO.HeathReportVO;
import com.smartlive.bswatch.vo.controllerVO.HealthQueryVO;
import com.smartlive.bswatch.vo.controllerVO.PressureVO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* <p>
* 腕表血压数据表 Mapper 接口
* </p>
*
* @author lilj
* @since 2025-03-17
*/
public interface WatchFloodPressureMapper extends BaseMapper<WatchFloodPressure> {
List<PressureVO> queryVO(HealthQueryVO healthQueryVO);
List<WatchFloodPressure> selectByEmpAndTime(@Param("empNo") String empNo, @Param("startDate") String startDate, @Param("endDate") String endDate);
List<HeathReportVO> selectLatestPressureByDateRange(@Param("empNo") String empNo, @Param("startDate") String startDate, @Param("endDate") String endDate);
}

View File

@@ -0,0 +1,9 @@
package com.smartlive.bswatch.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.smartlive.bswatch.entity.WatchGoods;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface WatchGoodsMapper extends BaseMapper<WatchGoods> {
}

View File

@@ -0,0 +1,23 @@
package com.smartlive.bswatch.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.smartlive.bswatch.TO.HeathReportTO;
import com.smartlive.bswatch.entity.WatchHealthReport;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* <p>
* 健康周报告表 Mapper 接口
* </p>
*
* @author system
* @since 2025-11-17
*/
public interface WatchHealthReportMapper extends BaseMapper<WatchHealthReport> {
List<HeathReportTO> getReportByEmpNo(@Param("watchSign") String watchSign, @Param("time") String time);
}

View File

@@ -0,0 +1,16 @@
package com.smartlive.bswatch.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.smartlive.bswatch.entity.WatchHealthRules;
/**
* <p>
* 腕表健康规则表 Mapper 接口
* </p>
*
* @author system
* @since 2025-11-17
*/
public interface WatchHealthRulesMapper extends BaseMapper<WatchHealthRules> {
}

View File

@@ -0,0 +1,34 @@
package com.smartlive.bswatch.mapper;
import com.smartlive.bswatch.entity.WatchHeart;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.smartlive.bswatch.vo.commandVO.HeathReportVO;
import com.smartlive.bswatch.vo.controllerVO.HealthQueryVO;
import com.smartlive.bswatch.vo.controllerVO.HeartBeatVO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* <p>
* Mapper 接口
* </p>
*
* @author lilj
* @since 2025-02-05
*/
public interface WatchHeartMapper extends BaseMapper<WatchHeart> {
List<HeartBeatVO> queryVO(HealthQueryVO healthQueryVO);
List<WatchHeart> selectByEmpAndTime(@Param("empNo") String empNo, @Param("startDate") String startDate, @Param("endDate") String endDate);
/**
* 查询指定时间段内每天最新的心率记录
* @param startDate 开始时间
* @param endDate 结束时间
* @param empNo 员工编号
* @return 每天最新的心率记录列表
*/
List<HeathReportVO> selectLatestHeartByDateRange(@Param("empNo") String empNo, @Param("startDate") String startDate, @Param("endDate") String endDate);
}

View File

@@ -0,0 +1,22 @@
package com.smartlive.bswatch.mapper;
import com.smartlive.bswatch.entity.WatchLocation;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.smartlive.bswatch.vo.controllerVO.LocationQueryVO;
import java.util.List;
/**
* <p>
* Mapper 接口
* </p>
*
* @author lilj
* @since 2025-02-05
*/
public interface WatchLocationMapper extends BaseMapper<WatchLocation> {
List<WatchLocation> selectLoactionTrack(LocationQueryVO locationQueryVO);
List<WatchLocation> selectLoactionTrack2(LocationQueryVO locationQueryVO);
}

View File

@@ -0,0 +1,16 @@
package com.smartlive.bswatch.mapper;
import com.smartlive.bswatch.entity.WatchModeLog;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* Mapper 接口
* </p>
*
* @author lilj
* @since 2025-02-28
*/
public interface WatchModeLogMapper extends BaseMapper<WatchModeLog> {
}

View File

@@ -0,0 +1,34 @@
package com.smartlive.bswatch.mapper;
import com.smartlive.bswatch.entity.WatchOxy;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.smartlive.bswatch.vo.commandVO.HeathReportVO;
import com.smartlive.bswatch.vo.controllerVO.BloodOxyVO;
import com.smartlive.bswatch.vo.controllerVO.HealthQueryVO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* <p>
* Mapper 接口
* </p>
*
* @author lilj
* @since 2025-02-05
*/
public interface WatchOxyMapper extends BaseMapper<WatchOxy> {
List<BloodOxyVO> queryVO(HealthQueryVO healthQueryVO);
List<WatchOxy> selectByEmpAndTime(@Param("empNo") String empNo, @Param("startDate") String startDate, @Param("endDate") String endDate);
/**
* 查询指定时间段内每天最新的血氧记录
* @param startDate 开始时间
* @param endDate 结束时间
* @param empNo 员工编号
* @return 每天最新的血氧记录列表
*/
List<HeathReportVO> selectLatestOxyByDateRange(@Param("empNo") String empNo, @Param("startDate") String startDate, @Param("endDate") String endDate);
}

View File

@@ -0,0 +1,16 @@
package com.smartlive.bswatch.mapper;
import com.smartlive.bswatch.entity.WatchPower;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* Mapper 接口
* </p>
*
* @author lilj
* @since 2025-02-28
*/
public interface WatchPowerMapper extends BaseMapper<WatchPower> {
}

View File

@@ -0,0 +1,16 @@
package com.smartlive.bswatch.mapper;
import com.smartlive.bswatch.entity.WatchSkip;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* Mapper 接口
* </p>
*
* @author lilj
* @since 2025-04-02
*/
public interface WatchSkipMapper extends BaseMapper<WatchSkip> {
}

View File

@@ -0,0 +1,34 @@
package com.smartlive.bswatch.mapper;
import com.smartlive.bswatch.entity.WatchSleep;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.smartlive.bswatch.vo.commandVO.HeathReportVO;
import com.smartlive.bswatch.vo.controllerVO.HealthQueryVO;
import com.smartlive.bswatch.vo.controllerVO.SleepVO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* <p>
* 腕表睡眠数据表 Mapper 接口
* </p>
*
* @author lilj
* @since 2025-03-18
*/
public interface WatchSleepMapper extends BaseMapper<WatchSleep> {
SleepVO queryVO(HealthQueryVO healthQueryVO);
List<WatchSleep> selectByEmpAndTime(@Param("empNo") String empNo, @Param("startDate") String startDate, @Param("endDate") String endDate);
/**
* 查询指定时间段内每天最新的睡眠记录
* @param startDate 开始时间
* @param endDate 结束时间
* @param empNo 员工编号
* @return 每天最新的睡眠记录列表
*/
List<HeathReportVO> selectLatestSleepByDateRange(@Param("empNo") String empNo, @Param("startDate") String startDate, @Param("endDate") String endDate);
}

View File

@@ -0,0 +1,16 @@
package com.smartlive.bswatch.mapper;
import com.smartlive.bswatch.entity.WatchSosLog;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* 腕表sos报警日志表 Mapper 接口
* </p>
*
* @author lilj
* @since 2025-03-18
*/
public interface WatchSosLogMapper extends BaseMapper<WatchSosLog> {
}

View File

@@ -0,0 +1,20 @@
package com.smartlive.bswatch.mapper;
import com.smartlive.bswatch.entity.WatchSos;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.smartlive.bswatch.vo.controllerVO.SosPhoneVO;
import java.util.List;
/**
* <p>
* Mapper 接口
* </p>
*
* @author lilj
* @since 2025-02-05
*/
public interface WatchSosMapper extends BaseMapper<WatchSos> {
List<SosPhoneVO> selectQueryVO(SosPhoneVO sosPhoneVo);
}

View File

@@ -0,0 +1,19 @@
package com.smartlive.bswatch.mapper;
import com.smartlive.bswatch.entity.WatchStep;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.smartlive.bswatch.vo.controllerVO.HealthQueryVO;
import com.smartlive.bswatch.vo.controllerVO.WatchStepVO;
/**
* <p>
* Mapper 接口
* </p>
*
* @author lilj
* @since 2025-02-05
*/
public interface WatchStepMapper extends BaseMapper<WatchStep> {
WatchStepVO queryVO(HealthQueryVO healthQueryVO);
}

View File

@@ -0,0 +1,18 @@
package com.smartlive.bswatch.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.smartlive.bswatch.entity.WatchSysDept;
import com.smartlive.bswatch.vo.commandVO.SysDeptVO;
/**
* <p>
* 部门表 Mapper 接口
* </p>
*
* @author lilj
* @since 2025-02-07
*/
public interface WatchSysDeptMapper extends BaseMapper<WatchSysDept> {
SysDeptVO getSysDeptVO(Integer deptId);
}

View File

@@ -0,0 +1,16 @@
package com.smartlive.bswatch.mapper;
import com.smartlive.bswatch.entity.SysOrgani;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* 组织表 Mapper 接口
* </p>
*
* @author lilj
* @since 2025-02-07
*/
public interface WatchSysOrganiMapper extends BaseMapper<SysOrgani> {
}

View File

@@ -0,0 +1,34 @@
package com.smartlive.bswatch.mapper;
import com.smartlive.bswatch.entity.WatchTemperature;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.smartlive.bswatch.vo.commandVO.HeathReportVO;
import com.smartlive.bswatch.vo.controllerVO.HealthQueryVO;
import com.smartlive.bswatch.vo.controllerVO.TemperatureVO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* <p>
* Mapper 接口
* </p>
*
* @author lilj
* @since 2025-02-05
*/
public interface WatchTemperatureMapper extends BaseMapper<WatchTemperature> {
List<TemperatureVO> queryVO(HealthQueryVO healthQueryVO);
List<WatchTemperature> selectByEmpAndTime(@Param("empNo") String empNo, @Param("startDate") String startDate, @Param("endDate") String endDate);
/**
* 查询指定时间段内每天最新的体温记录
* @param startDate 开始时间
* @param endDate 结束时间
* @param empNo 员工编号
* @return 每天最新的体温记录列表
*/
List<HeathReportVO> selectLatestTemperatureByDateRange(@Param("empNo") String empNo, @Param("startDate") String startDate, @Param("endDate") String endDate);
}

View File

@@ -0,0 +1,20 @@
package com.smartlive.bswatch.mapper;
import com.smartlive.bswatch.entity.WatchWarn;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.smartlive.bswatch.vo.controllerVO.WatchWarnVO;
import java.util.List;
/**
* <p>
* 腕表定位警报表 Mapper 接口
* </p>
*
* @author lilj
* @since 2025-02-08
*/
public interface WatchWarnMapper extends BaseMapper<WatchWarn> {
List<WatchWarnVO> selectQueryVO(WatchWarnVO watchWarnVO);
}

View File

@@ -0,0 +1,17 @@
package com.smartlive.bswatch.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.smartlive.bswatch.entity.Water;
/**
* <p>
* Mapper 接口
* </p>
*
* @author lilj
* @since 2025-04-01
*/
public interface WatchWaterMapper extends BaseMapper<Water> {
Water queryWater();
}

View File

@@ -0,0 +1,20 @@
package com.smartlive.bswatch.mapper;
import com.smartlive.bswatch.entity.WatchWhite;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.smartlive.bswatch.vo.controllerVO.WatchWhiteVO;
import java.util.List;
/**
* <p>
* Mapper 接口
* </p>
*
* @author lilj
* @since 2025-02-05
*/
public interface WatchWhiteMapper extends BaseMapper<WatchWhite> {
List queryByVO(WatchWhiteVO watchWhiteVO);
}

View File

@@ -0,0 +1,20 @@
package com.smartlive.bswatch.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.smartlive.bswatch.entity.WatchWhitePeriod;
import com.smartlive.bswatch.vo.controllerVO.WatchWhitePeriodVO;
import java.util.List;
/**
* <p>
* Mapper 接口
* </p>
*
* @author lilj
* @since 2025-02-05
*/
public interface WatchWhitePeriodMapper extends BaseMapper<WatchWhitePeriod> {
List<WatchWhitePeriodVO> selectQueryVO(WatchWhitePeriodVO watchWhitePeriodVO);
}

View File

@@ -0,0 +1,42 @@
package com.smartlive.bswatch.netty.channel;
import io.netty.channel.Channel;
import lombok.extern.slf4j.Slf4j;
import java.util.concurrent.ConcurrentHashMap;
@Slf4j
public class WatchChannelMap {
private static ConcurrentHashMap<String, Channel> channelHashMap = new ConcurrentHashMap<>();
public static ConcurrentHashMap<String, Channel> getChannelHashMap() {
return channelHashMap;
}
public static void addChannel(String sign, Channel context) {
/* log.info("addChannel---待添加的channel,hashCode=" + context.hashCode());
Channel channel = getChannel(sign);
log.info("addChannel---当前channel有效,hashCode=" + (channel == null ? "null" : channel.hashCode()));*/
channelHashMap.put(sign, context);
log.info("addChannel---设置新的channel,hashCode=" + context.hashCode());
}
public static Channel getChannel(String sign) {
if (channelHashMap == null || channelHashMap.isEmpty()) {
log.error("channelmap异常");
return null;
}
// 通道有效性检测
Channel channel = channelHashMap.get(sign);
// 通道未激活,移除通道
if (channel != null && !channel.isActive()) {
log.error("channel无效,执行移除操作,hashCode=" + channel.hashCode());
channelHashMap.remove(sign);
return null;
}
return channel;
}
}

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