Compare commits

...

3 Commits

Author SHA1 Message Date
1dc00f0431 Merge remote-tracking branch 'origin/main' into dyf-device 2025-07-10 10:11:03 +08:00
f0bfc4aa35 app:查看APP客户设备绑定 2025-07-10 09:39:57 +08:00
87f2e3a8b5 web:prod 配置 2025-07-10 08:40:45 +08:00
9 changed files with 260 additions and 23 deletions

View File

@ -52,9 +52,9 @@ spring:
driverClassName: com.mysql.cj.jdbc.Driver driverClassName: com.mysql.cj.jdbc.Driver
# jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562 # jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562
# rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题) # rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题)
url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true url: jdbc:mysql://localhost:3306/fys_vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
username: root username: root
password: root password: Jz_5623_cl1
# # 从库数据源 # # 从库数据源
# slave: # slave:
# lazy: true # lazy: true
@ -105,9 +105,9 @@ spring.data:
# 端口默认为6379 # 端口默认为6379
port: 6379 port: 6379
# 数据库索引 # 数据库索引
database: 0 database: 1
# redis 密码必须配置 # redis 密码必须配置
password: fys123 password: re_fs_11520631
# 连接超时时间 # 连接超时时间
timeout: 10s timeout: 10s
# 是否开启ssl # 是否开启ssl
@ -272,3 +272,37 @@ justauth:
client-id: 10**********6 client-id: 10**********6
client-secret: 1f7d08**********5b7**********29e client-secret: 1f7d08**********5b7**********29e
redirect-uri: ${justauth.address}/social-callback?source=gitea redirect-uri: ${justauth.address}/social-callback?source=gitea
# MQTT配置
mqtt:
username: admin
password: #YtvpSfCNG
url: tcp://47.120.79.150:2883
subClientId: fys_subClient
subTopic: worker/alert/#,worker/location/#
pubTopic: worker/location
pubClientId: fys_pubClient
# 文件存储路径
file:
mac:
path: ~/file/
avatar: ~/avatar/
linux:
path: /home/eladmin/file/
avatar: /home/eladmin/avatar/
windows:
path: C:\eladmin\file\
avatar: C:\eladmin\avatar\
# 文件大小 /M
maxSize: 100
avatarMaxSize: 5
device:
pic: C:\eladmin\file\ #设备图片存储路径
ip: http://fuyuanshen.com:81/ #服务器地址
app_avatar:
pic: C:\eladmin\file\ #设备图片存储路径
#ip: http://fuyuanshen.com:81/ #服务器地址
ip: https://fuyuanshen.com/ #服务器地址

View File

@ -1,7 +1,7 @@
# 开发环境配置 # 开发环境配置
server: server:
# 服务器的HTTP端口默认为8080 # 服务器的HTTP端口默认为8080
port: 8001 port: 8000
servlet: servlet:
# 应用的访问路径 # 应用的访问路径
context-path: / context-path: /

View File

@ -6,8 +6,16 @@ import com.fuyuanshen.app.domain.APPDeviceType;
import com.fuyuanshen.app.domain.dto.APPUnbindDTO; import com.fuyuanshen.app.domain.dto.APPUnbindDTO;
import com.fuyuanshen.app.domain.query.APPDeviceQueryCriteria; import com.fuyuanshen.app.domain.query.APPDeviceQueryCriteria;
import com.fuyuanshen.app.service.equipment.APPDeviceService; import com.fuyuanshen.app.service.equipment.APPDeviceService;
import com.fuyuanshen.common.core.domain.R;
import com.fuyuanshen.common.core.domain.ResponseVO; import com.fuyuanshen.common.core.domain.ResponseVO;
import com.fuyuanshen.common.core.validate.EditGroup;
import com.fuyuanshen.common.idempotent.annotation.RepeatSubmit;
import com.fuyuanshen.common.log.annotation.Log;
import com.fuyuanshen.common.log.enums.BusinessType;
import com.fuyuanshen.common.mybatis.core.page.TableDataInfo; import com.fuyuanshen.common.mybatis.core.page.TableDataInfo;
import com.fuyuanshen.common.web.core.BaseController;
import com.fuyuanshen.equipment.domain.bo.UserAppBo;
import com.fuyuanshen.equipment.service.AppUserService;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
@ -27,9 +35,10 @@ import java.util.List;
@RestController @RestController
@RequiredArgsConstructor @RequiredArgsConstructor
@RequestMapping("/api/app/device") @RequestMapping("/api/app/device")
public class APPDeviceController { public class APPDeviceController extends BaseController {
private final APPDeviceService appDeviceService; private final APPDeviceService appDeviceService;
private final AppUserService appUserService;
@PostMapping(value = "/list") @PostMapping(value = "/list")
@ -76,4 +85,16 @@ public class APPDeviceController {
/**
* 修改APP用户信息
*/
// @SaCheckPermission("app:user:edit")
@Log(title = "APP用户信息", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
public R<Void> edit(@Validated(EditGroup.class) @RequestBody UserAppBo bo) {
return toAjax(appUserService.updateByBo(bo));
}
} }

View File

@ -79,17 +79,19 @@
<if test="criteria.createTime != null and criteria.createTime.size() != 0"> <if test="criteria.createTime != null and criteria.createTime.size() != 0">
and d.create_time between #{criteria.createTime[0]} and #{criteria.createTime[1]} and d.create_time between #{criteria.createTime[0]} and #{criteria.createTime[1]}
</if> </if>
<if test="criteria.tenantId != null">
AND tenant_id = #{criteria.tenantId}
</if>
and d.customer_id = #{criteria.customerId} and d.customer_id = #{criteria.customerId}
</where> </where>
order by d.create_time desc order by d.create_time desc
</select> </select>
<select id="getTypeList" resultType="com.fuyuanshen.app.domain.vo.APPDeviceTypeVo"> <select id="getTypeList" resultType="com.fuyuanshen.app.domain.vo.APPDeviceTypeVo">
SELECT dt.id, dt.type_name, dt.communication_mode FROM device_type dt SELECT dt.id, dt.type_name, dt.communication_mode
WHERE EXISTS(select 1 from device d where d.device_type = dt.id and d.binding_user_id = #{userId} AND d.binding_status = 1 ) FROM device_type dt
WHERE EXISTS(select 1
from device d
where d.device_type = dt.id
and d.binding_user_id = #{userId}
AND d.binding_status = 1)
</select> </select>

View File

@ -30,19 +30,21 @@ import org.springframework.web.bind.annotation.RestController;
@RequestMapping("/api/app/device") @RequestMapping("/api/app/device")
public class DeviceAPPController extends BaseController { public class DeviceAPPController extends BaseController {
private final AppUserService appUserService;
/**
* 修改APP用户信息
*/ //
// @SaCheckPermission("app:user:edit") //
@Log(title = "APP用户信息", businessType = BusinessType.UPDATE) // @GetMapping
@RepeatSubmit() // @Operation(summary = "WEB端查看APP客户设备绑定")
@PutMapping() // public TableDataInfo<APPDevice> queryAPPDevice(APPDeviceQueryCriteria criteria) {
public R<Void> edit(@Validated(EditGroup.class) @RequestBody UserAppBo bo) { // Page<APPDevice> page = new Page<>(criteria.getPage(), criteria.getSize());
return toAjax(appUserService.updateByBo(bo)); // TableDataInfo<APPDevice> devices = null;
} // devices = appDeviceService.queryAll(page, criteria);
// return devices;
// }
} }

View File

@ -0,0 +1,106 @@
package com.fuyuanshen.equipment.domain;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fuyuanshen.common.tenant.core.TenantEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
/**
* @Description: 设备表
* @Author: WY
* @Date: 2025/5/16
**/
@Data
@TableName("app_device")
public class APPDevice1 extends TenantEntity {
@TableId(value = "app_device_id", type = IdType.AUTO)
@Schema(name = "ID")
private Long id;
@Schema(name = "设备类型")
private Long deviceType;
@Schema(name = "设备类型名称")
private String deviceTypeName;
@Schema(name = "客户号")
private Long customerId;
@Schema(name = "所属客户")
private String customerName;
/*@Schema(name = "设备编号")
private String deviceNo;*/
@Schema(name = "设备名称")
private String deviceName;
@Schema(name = "设备图片")
private String devicePic;
@Schema(name = "设备MAC")
private String deviceMac;
@Schema(name = "设备IMEI")
private String deviceImei;
@Schema(name = "设备SN")
private String deviceSn;
@Schema(name = "经度")
private String longitude;
@Schema(name = "纬度")
private String latitude;
@Schema(name = "备注")
private String remark;
@TableField(exist = false)
@Schema(name = "设备类型名称")
private String typeName;
/**
* 租户ID
*/
@TableField(value = "tenant_id")
@Schema(hidden = true)
private String tenantId;
/**
* 设备状态
* 0 失效
* 1 正常
*/
@Schema(name = "设备状态")
private Integer deviceStatus;
/**
* 绑定状态
* 0 未绑定
* 1 已绑定
*/
@Schema(name = "绑定状态")
private Integer bindingStatus;
/**
* 绑定类型
* 0 APP
* 1 小程序
*/
@Schema(name = "绑定类型")
private Integer bindingType;
public void copy(APPDevice1 source) {
BeanUtil.copyProperties(source, this, CopyOptions.create().setIgnoreNullValue(true));
}
}

View File

@ -59,7 +59,7 @@ public class Device extends TenantEntity {
@Schema(name = "原始设备") @Schema(name = "原始设备")
private Long originalDeviceId; private Long originalDeviceId;
@Schema( name = "设备编号") @Schema(name = "设备编号")
private String deviceNo; private String deviceNo;
@Schema(name = "设备名称") @Schema(name = "设备名称")
@ -71,6 +71,9 @@ public class Device extends TenantEntity {
@Schema(name = "设备MAC") @Schema(name = "设备MAC")
private String deviceMac; private String deviceMac;
@Schema(name = "蓝牙名称")
private String bluetoothName;
@Schema(name = "设备IMEI") @Schema(name = "设备IMEI")
private String deviceImei; private String deviceImei;

View File

@ -0,0 +1,65 @@
package com.fuyuanshen.equipment.domain.query;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.sql.Timestamp;
import java.util.List;
import java.util.Set;
/**
* @Description:
* @Author: WY
* @Date: 2025/5/16
**/
@Data
public class APPDeviceQueryCriteria1 {
@Schema(name = "设备名称")
private String deviceName;
@Schema(name = "设备类型")
private Long deviceType;
@Schema(name = "设备MAC")
private String deviceMac;
@Schema(name = "设备IMEI")
private String deviceImei;
@Schema(name = "设备SN")
private String deviceSn;
/**
* 设备状态
* 0 失效
* 1 正常
*/
@Schema(name = "设备状态 0 失效 1 正常 ")
private Integer deviceStatus;
@JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss'Z'")
@Schema(name = "创建时间")
private List<Timestamp> createTime;
@Schema(name = "页码", example = "1")
private Integer page = 1;
@Schema(name = "每页数据量", example = "10")
private Integer size = 10;
@Schema(name = "客户id")
private Long customerId;
private Set<Long> customerIds;
@Schema(name = "当前所有者")
private Long currentOwnerId;
@Schema(name = "租户ID")
private Long tenantId;
@Schema(name = "通讯方式", example = "0:4G;1:蓝牙")
private Integer communicationMode;
}

View File

@ -94,6 +94,10 @@
<monitor.username>fys</monitor.username> <monitor.username>fys</monitor.username>
<monitor.password>123456</monitor.password> <monitor.password>123456</monitor.password>
</properties> </properties>
<!-- <activation> -->
<!-- &lt;!&ndash; 默认环境 &ndash;&gt; -->
<!-- <activeByDefault>true</activeByDefault> -->
<!-- </activation> -->
</profile> </profile>
</profiles> </profiles>