forked from dyf/fys-Multi-tenant
Compare commits
19 Commits
75756eb8ab
...
fys-prod
Author | SHA1 | Date | |
---|---|---|---|
c34a39a308 | |||
b08d23eef4 | |||
add0738b28 | |||
b61c9c7a06 | |||
8106d09e67 | |||
425ea306e3 | |||
fd7768acc9 | |||
bb11bc4dfa | |||
7f65ebedc2 | |||
285abaedfb | |||
0b0cc84eea | |||
f2c7549d6e | |||
17ed75f54a | |||
80b944cbf0 | |||
537cc0b2d7 | |||
6dde6c3a3b | |||
38724dbfad | |||
73e1df4232 | |||
e35955f156 |
@ -94,10 +94,10 @@
|
|||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- demo模块 -->
|
<!-- demo模块 -->
|
||||||
<!--<dependency>
|
<!-- <dependency> -->
|
||||||
<groupId>com.fuyuanshen</groupId>
|
<!-- <groupId>com.fuyuanshen</groupId> -->
|
||||||
<artifactId>fys-demo</artifactId>
|
<!-- <artifactId>fys-demo</artifactId> -->
|
||||||
</dependency>-->
|
<!-- </dependency> -->
|
||||||
|
|
||||||
<!-- 工作流模块 -->
|
<!-- 工作流模块 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@ -38,6 +38,7 @@ public class WEBDeviceController extends BaseController {
|
|||||||
private final WEBDeviceService deviceService;
|
private final WEBDeviceService deviceService;
|
||||||
private final DeviceBizService appDeviceService;
|
private final DeviceBizService appDeviceService;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param id
|
* @param id
|
||||||
* @return
|
* @return
|
||||||
@ -52,8 +53,6 @@ public class WEBDeviceController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询设备列表
|
* 查询设备列表
|
||||||
*/
|
*/
|
||||||
@ -90,6 +89,7 @@ public class WEBDeviceController extends BaseController {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 重命名设备
|
* 重命名设备
|
||||||
|
*
|
||||||
* @param reNameDTO
|
* @param reNameDTO
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
@ -1,8 +1,13 @@
|
|||||||
package com.fuyuanshen.web.service.impl;
|
package com.fuyuanshen.web.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.fuyuanshen.app.domain.AppDeviceBindRecord;
|
||||||
|
import com.fuyuanshen.app.mapper.AppDeviceBindRecordMapper;
|
||||||
import com.fuyuanshen.equipment.domain.Device;
|
import com.fuyuanshen.equipment.domain.Device;
|
||||||
import com.fuyuanshen.equipment.domain.DeviceAssignments;
|
import com.fuyuanshen.equipment.domain.DeviceAssignments;
|
||||||
|
import com.fuyuanshen.equipment.enums.BindingStatusEnum;
|
||||||
import com.fuyuanshen.equipment.mapper.DeviceAssignmentsMapper;
|
import com.fuyuanshen.equipment.mapper.DeviceAssignmentsMapper;
|
||||||
import com.fuyuanshen.equipment.mapper.DeviceMapper;
|
import com.fuyuanshen.equipment.mapper.DeviceMapper;
|
||||||
import com.fuyuanshen.web.service.WEBDeviceService;
|
import com.fuyuanshen.web.service.WEBDeviceService;
|
||||||
@ -10,6 +15,7 @@ import com.fuyuanshen.web.service.device.DeviceBizService;
|
|||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description:
|
* @Description:
|
||||||
@ -25,6 +31,10 @@ public class WEBDeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impl
|
|||||||
|
|
||||||
private final DeviceAssignmentsMapper deviceAssignmentsMapper;
|
private final DeviceAssignmentsMapper deviceAssignmentsMapper;
|
||||||
|
|
||||||
|
private final AppDeviceBindRecordMapper appDeviceBindRecordMapper;
|
||||||
|
|
||||||
|
private final DeviceMapper deviceMapper;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* WEB端解绑设备
|
* WEB端解绑设备
|
||||||
@ -33,6 +43,7 @@ public class WEBDeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impl
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional
|
||||||
public int webUnBindDevice(Long id, Long userId) {
|
public int webUnBindDevice(Long id, Long userId) {
|
||||||
// 设备端解绑 0:设备端解绑 1:web端解绑
|
// 设备端解绑 0:设备端解绑 1:web端解绑
|
||||||
int type = 1;
|
int type = 1;
|
||||||
@ -44,7 +55,18 @@ public class WEBDeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impl
|
|||||||
id = deviceAssignments.getDeviceId();
|
id = deviceAssignments.getDeviceId();
|
||||||
type = 0;
|
type = 0;
|
||||||
}
|
}
|
||||||
return appDeviceService.unBindDevice(id, userId, type);
|
|
||||||
|
QueryWrapper<AppDeviceBindRecord> deviceId = new QueryWrapper<AppDeviceBindRecord>().eq("device_id", id);
|
||||||
|
|
||||||
|
// appDeviceService.unBindDevice(id, userId, type);
|
||||||
|
UpdateWrapper<Device> deviceUpdateWrapper = new UpdateWrapper<>();
|
||||||
|
deviceUpdateWrapper.eq("id", id)
|
||||||
|
.set("binding_user_id", null)
|
||||||
|
.set("binding_status", BindingStatusEnum.UNBOUND.getCode())
|
||||||
|
.set("binding_time", null);
|
||||||
|
deviceMapper.update(null, deviceUpdateWrapper);
|
||||||
|
|
||||||
|
return appDeviceBindRecordMapper.delete(deviceId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -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://47.120.79.150:3306/fys-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
|
url: jdbc:mysql://47.107.152.87: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: Jq_123456#
|
password: Jz_5623_cl1
|
||||||
# # 从库数据源
|
# # 从库数据源
|
||||||
# slave:
|
# slave:
|
||||||
# lazy: true
|
# lazy: true
|
||||||
@ -101,13 +101,13 @@ spring:
|
|||||||
spring.data:
|
spring.data:
|
||||||
redis:
|
redis:
|
||||||
# 地址
|
# 地址
|
||||||
host: 47.120.79.150
|
host: 47.107.152.87
|
||||||
# 端口,默认为6379
|
# 端口,默认为6379
|
||||||
port: 6379
|
port: 6379
|
||||||
# 数据库索引
|
# 数据库索引
|
||||||
database: 1
|
database: 1
|
||||||
# redis 密码必须配置
|
# redis 密码必须配置
|
||||||
password: xhYc_djkl382^#780!
|
password: re_fs_11520631
|
||||||
# 连接超时时间
|
# 连接超时时间
|
||||||
timeout: 10s
|
timeout: 10s
|
||||||
# 是否开启ssl
|
# 是否开启ssl
|
||||||
@ -177,14 +177,14 @@ sms:
|
|||||||
# 框架定义的厂商名称标识,标定此配置是哪个厂商,详细请看厂商标识介绍部分
|
# 框架定义的厂商名称标识,标定此配置是哪个厂商,详细请看厂商标识介绍部分
|
||||||
supplier: alibaba
|
supplier: alibaba
|
||||||
# 有些称为accessKey有些称之为apiKey,也有称为sdkKey或者appId。
|
# 有些称为accessKey有些称之为apiKey,也有称为sdkKey或者appId。
|
||||||
access-key-id: LTAI5tJdDNpZootsPQ5hdELx
|
access-key-id: LTAI5tDGfJd4kMvrGtvyzCHz
|
||||||
# 称为accessSecret有些称之为apiSecret
|
# 称为accessSecret有些称之为apiSecret
|
||||||
access-key-secret: mU4WtffcCXpHPz5tLwQpaGtLsJXONt
|
access-key-secret: a4ZlVHVSYeMQHn0p1R18thA6xCdHQh
|
||||||
#模板ID 非必须配置,如果使用sendMessage的快速发送需此配置
|
#模板ID 非必须配置,如果使用sendMessage的快速发送需此配置
|
||||||
template-id: SMS_322180518
|
template-id: SMS_324526343
|
||||||
#模板变量 上述模板的变量
|
#模板变量 上述模板的变量
|
||||||
templateName: code
|
templateName: code
|
||||||
signature: 湖北星汉研创科技
|
signature: 深圳市富源晟科技
|
||||||
config2:
|
config2:
|
||||||
# 厂商标识,标定此配置是哪个厂商,详细请看厂商标识介绍部分
|
# 厂商标识,标定此配置是哪个厂商,详细请看厂商标识介绍部分
|
||||||
supplier: tencent
|
supplier: tencent
|
||||||
@ -280,12 +280,13 @@ justauth:
|
|||||||
# MQTT配置
|
# MQTT配置
|
||||||
mqtt:
|
mqtt:
|
||||||
username: admin
|
username: admin
|
||||||
password: #YtvpSfCNG
|
password: fys123456
|
||||||
url: tcp://47.120.79.150:2883
|
url: tcp://47.107.152.87:1883
|
||||||
subClientId: fys_subClient
|
subClientId: fys_subClient
|
||||||
subTopic: A/#,B/#,worker/location/#
|
subTopic: A/#,worker/location/#
|
||||||
pubTopic: B/#
|
pubTopic: B/#
|
||||||
pubClientId: fys_pubClient
|
pubClientId: fys_pubClient
|
||||||
|
enabled: false
|
||||||
|
|
||||||
|
|
||||||
# 文件存储路径
|
# 文件存储路径
|
||||||
|
@ -24,7 +24,7 @@ import com.fuyuanshen.app.service.IAppUserService;
|
|||||||
import com.fuyuanshen.common.mybatis.core.page.TableDataInfo;
|
import com.fuyuanshen.common.mybatis.core.page.TableDataInfo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* APP用户信息
|
* WebApp用户信息
|
||||||
*
|
*
|
||||||
* @author Lion Li
|
* @author Lion Li
|
||||||
* @date 2025-06-27
|
* @date 2025-06-27
|
||||||
@ -32,8 +32,8 @@ import com.fuyuanshen.common.mybatis.core.page.TableDataInfo;
|
|||||||
@Validated
|
@Validated
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/app/user")
|
@RequestMapping("/WebApp/user")
|
||||||
public class AppUserController extends BaseController {
|
public class WebAppUserController extends BaseController {
|
||||||
|
|
||||||
private final IAppUserService appUserService;
|
private final IAppUserService appUserService;
|
||||||
|
|
||||||
@ -105,4 +105,5 @@ public class AppUserController extends BaseController {
|
|||||||
@PathVariable Long[] userIds) {
|
@PathVariable Long[] userIds) {
|
||||||
return toAjax(appUserService.deleteWithValidByIds(List.of(userIds), true));
|
return toAjax(appUserService.deleteWithValidByIds(List.of(userIds), true));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -2,6 +2,7 @@ package com.fuyuanshen.system.controller.system;
|
|||||||
|
|
||||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import com.fuyuanshen.common.core.constant.CacheNames;
|
||||||
import com.fuyuanshen.common.log.annotation.Log;
|
import com.fuyuanshen.common.log.annotation.Log;
|
||||||
import com.fuyuanshen.common.web.core.BaseController;
|
import com.fuyuanshen.common.web.core.BaseController;
|
||||||
import com.fuyuanshen.common.mybatis.core.page.PageQuery;
|
import com.fuyuanshen.common.mybatis.core.page.PageQuery;
|
||||||
@ -14,10 +15,12 @@ import com.fuyuanshen.system.domain.vo.SysDictDataVo;
|
|||||||
import com.fuyuanshen.system.service.ISysDictDataService;
|
import com.fuyuanshen.system.service.ISysDictDataService;
|
||||||
import com.fuyuanshen.system.service.ISysDictTypeService;
|
import com.fuyuanshen.system.service.ISysDictTypeService;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.cache.annotation.CacheEvict;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -73,6 +76,8 @@ public class SysDictDataController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@GetMapping(value = "/type/{dictType}")
|
@GetMapping(value = "/type/{dictType}")
|
||||||
public R<List<SysDictDataVo>> dictType(@PathVariable String dictType) {
|
public R<List<SysDictDataVo>> dictType(@PathVariable String dictType) {
|
||||||
|
// 使用时先清除缓存再查询
|
||||||
|
dictTypeService.clearDictTypeCache(dictType);
|
||||||
List<SysDictDataVo> data = dictTypeService.selectDictDataByType(dictType);
|
List<SysDictDataVo> data = dictTypeService.selectDictDataByType(dictType);
|
||||||
if (ObjectUtil.isNull(data)) {
|
if (ObjectUtil.isNull(data)) {
|
||||||
data = new ArrayList<>();
|
data = new ArrayList<>();
|
||||||
@ -94,6 +99,7 @@ public class SysDictDataController extends BaseController {
|
|||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改保存字典类型
|
* 修改保存字典类型
|
||||||
*/
|
*/
|
||||||
@ -105,6 +111,7 @@ public class SysDictDataController extends BaseController {
|
|||||||
return R.fail("修改字典数据'" + dict.getDictValue() + "'失败,字典键值已存在");
|
return R.fail("修改字典数据'" + dict.getDictValue() + "'失败,字典键值已存在");
|
||||||
}
|
}
|
||||||
dictDataService.updateDictData(dict);
|
dictDataService.updateDictData(dict);
|
||||||
|
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -73,4 +73,9 @@ public interface ISysDictDataService {
|
|||||||
*/
|
*/
|
||||||
boolean checkDictDataUnique(SysDictDataBo dict);
|
boolean checkDictDataUnique(SysDictDataBo dict);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 清空字典缓存
|
||||||
|
*/
|
||||||
|
void clearDictTypeCache(String dictType);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -92,4 +92,9 @@ public interface ISysDictTypeService {
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
boolean checkDictTypeUnique(SysDictTypeBo dictType);
|
boolean checkDictTypeUnique(SysDictTypeBo dictType);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 清空字典缓存
|
||||||
|
*/
|
||||||
|
void clearDictTypeCache(String dictType);
|
||||||
}
|
}
|
||||||
|
@ -18,6 +18,7 @@ import com.fuyuanshen.system.domain.vo.SysDictDataVo;
|
|||||||
import com.fuyuanshen.system.mapper.SysDictDataMapper;
|
import com.fuyuanshen.system.mapper.SysDictDataMapper;
|
||||||
import com.fuyuanshen.system.service.ISysDictDataService;
|
import com.fuyuanshen.system.service.ISysDictDataService;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.cache.annotation.CacheEvict;
|
||||||
import org.springframework.cache.annotation.CachePut;
|
import org.springframework.cache.annotation.CachePut;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@ -154,4 +155,12 @@ public class SysDictDataServiceImpl implements ISysDictDataService {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 清除指定dictType的缓存
|
||||||
|
@CacheEvict(cacheNames = CacheNames.SYS_DICT, key = "#dictType")
|
||||||
|
public void clearDictTypeCache(String dictType) {
|
||||||
|
// 仅用于清除缓存
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -28,6 +28,7 @@ import com.fuyuanshen.system.domain.vo.SysDictTypeVo;
|
|||||||
import com.fuyuanshen.system.mapper.SysDictDataMapper;
|
import com.fuyuanshen.system.mapper.SysDictDataMapper;
|
||||||
import com.fuyuanshen.system.mapper.SysDictTypeMapper;
|
import com.fuyuanshen.system.mapper.SysDictTypeMapper;
|
||||||
import com.fuyuanshen.system.service.ISysDictTypeService;
|
import com.fuyuanshen.system.service.ISysDictTypeService;
|
||||||
|
import org.springframework.cache.annotation.CacheEvict;
|
||||||
import org.springframework.cache.annotation.CachePut;
|
import org.springframework.cache.annotation.CachePut;
|
||||||
import org.springframework.cache.annotation.Cacheable;
|
import org.springframework.cache.annotation.Cacheable;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@ -294,4 +295,11 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService, DictService
|
|||||||
return BeanUtil.copyToList(list, DictDataDTO.class);
|
return BeanUtil.copyToList(list, DictDataDTO.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 清除指定dictType的缓存
|
||||||
|
@CacheEvict(cacheNames = CacheNames.SYS_DICT, key = "#dictType")
|
||||||
|
public void clearDictTypeCache(String dictType) {
|
||||||
|
// 仅用于清除缓存
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
9
pom.xml
9
pom.xml
@ -83,7 +83,10 @@
|
|||||||
<monitor.username>fys</monitor.username>
|
<monitor.username>fys</monitor.username>
|
||||||
<monitor.password>123456</monitor.password>
|
<monitor.password>123456</monitor.password>
|
||||||
</properties>
|
</properties>
|
||||||
|
<!-- <activation> -->
|
||||||
|
<!-- <!– 默认环境 –> -->
|
||||||
|
<!-- <activeByDefault>true</activeByDefault> -->
|
||||||
|
<!-- </activation> -->
|
||||||
</profile>
|
</profile>
|
||||||
<profile>
|
<profile>
|
||||||
<id>prod</id>
|
<id>prod</id>
|
||||||
@ -97,10 +100,6 @@
|
|||||||
<!-- 默认环境 -->
|
<!-- 默认环境 -->
|
||||||
<activeByDefault>true</activeByDefault>
|
<activeByDefault>true</activeByDefault>
|
||||||
</activation>
|
</activation>
|
||||||
<!-- <activation> -->
|
|
||||||
<!-- <!– 默认环境 –> -->
|
|
||||||
<!-- <activeByDefault>true</activeByDefault> -->
|
|
||||||
<!-- </activation> -->
|
|
||||||
</profile>
|
</profile>
|
||||||
<profile>
|
<profile>
|
||||||
<id>jingquan</id>
|
<id>jingquan</id>
|
||||||
|
Reference in New Issue
Block a user