21 Commits

Author SHA1 Message Date
3d1c2f4e56 Merge branch 'dyf-device' into prod 2025-12-19 14:08:03 +08:00
ccadcb8d4e Merge branch '6170' into prod 2025-12-12 14:59:50 +08:00
b8cb663bbf Merge branch 'jingquan' into prod 2025-12-03 16:56:49 +08:00
56e86b070d Merge branch 'dyf-device' into prod 2025-12-01 13:33:59 +08:00
0898855108 Merge branch '6170' into prod 2025-11-28 10:18:54 +08:00
92b65ce6df Merge branch 'dyf-device' into prod 2025-11-27 11:01:58 +08:00
82399cffed Merge branch 'dyf-device' into prod 2025-08-25 14:33:52 +08:00
5538ac96e5 晶全日志配置 2025-08-06 09:48:00 +08:00
b703f80355 晶全日志配置 2025-08-06 09:44:52 +08:00
b3b249ea07 日志配置 2025-08-06 09:20:41 +08:00
aff424e73b Merge branch 'main' into prod 2025-08-06 09:18:43 +08:00
dc513a858a Merge branch 'main' into prod 2025-08-04 09:08:34 +08:00
df5ce7ddd9 Merge branch 'main' into prod 2025-07-31 09:21:10 +08:00
2174dfdb4d Merge branch 'main' into prod 2025-07-23 19:24:27 +08:00
2800b89e06 Merge branch 'main' into prod 2025-07-23 10:55:30 +08:00
637e46c510 Merge branch 'main' into prod 2025-07-21 08:40:34 +08:00
31c2158c8e Merge branch 'main' into prod 2025-07-19 10:22:33 +08:00
c7c21dc358 Merge branch 'main' into prod 2025-07-18 15:17:54 +08:00
a7e0803b00 Merge branch 'main' into prod 2025-07-17 16:42:14 +08:00
55cacbd322 Merge branch 'main' into prod 2025-07-17 09:24:45 +08:00
99ec6eaff0 prod 2025-07-15 08:40:20 +08:00
32 changed files with 100 additions and 159 deletions

View File

@ -15,14 +15,11 @@ import org.springframework.messaging.MessageHandler;
@Configuration
@Slf4j
public class MqttOutboundConfiguration {
@Autowired
private MqttPropertiesConfig mqttPropertiesConfig;
@Autowired
private MqttPahoClientFactory mqttPahoClientFactory;
// 消息通道
@Bean
public MessageChannel mqttOutboundChannel(){

View File

@ -1,7 +1,6 @@
package com.fuyuanshen.global.mqtt.constants;
public class DeviceRedisKeyConstants {
public static final String DEVICE_KEY_PREFIX = "device:";
// 设备上报状态
public static final String DEVICE_STATUS_KEY_PREFIX = ":status";
@ -53,5 +52,4 @@ public class DeviceRedisKeyConstants {
* 告警信息
*/
public static final String DEVICE_ALARM_MESSAGE_KEY_PREFIX = ":alarmMessage";
}

View File

@ -36,6 +36,7 @@ public class LightingCommandTypeConstants {
*/
public static final String SEND_MESSAGE = "Light_6";
/**
* 报警模式
*/

View File

@ -71,4 +71,5 @@ public class BjqLaserModeSettingsRule implements MqttMessageRule {
}
}

View File

@ -45,7 +45,6 @@ public class BjqModeRule implements MqttMessageRule {
return LightingCommandTypeConstants.LIGHT_MODE;
}
@Override
public void execute(MqttRuleContext context) {
String functionAccess = FUNCTION_ACCESS_KEY + context.getDeviceImei();

View File

@ -1,18 +1,32 @@
package com.fuyuanshen.global.mqtt.rule.bjq;
import com.alibaba.fastjson2.JSONObject;
import com.fuyuanshen.common.core.constant.GlobalConstants;
import com.fuyuanshen.common.core.utils.StringUtils;
import com.fuyuanshen.common.json.utils.JsonUtils;
import com.fuyuanshen.common.redis.utils.RedisUtils;
import com.fuyuanshen.equipment.utils.map.GetAddressFromLatUtil;
import com.fuyuanshen.equipment.utils.map.LngLonUtil;
import com.fuyuanshen.global.mqtt.base.MqttMessageRule;
import com.fuyuanshen.global.mqtt.base.MqttRuleContext;
import com.fuyuanshen.global.mqtt.config.MqttGateway;
import com.fuyuanshen.global.mqtt.constants.DeviceRedisKeyConstants;
import com.fuyuanshen.global.mqtt.constants.LightingCommandTypeConstants;
import com.fuyuanshen.global.mqtt.constants.MqttConstants;
import com.fuyuanshen.global.mqtt.listener.domain.FunctionAccessStatus;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import java.time.Duration;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
import static com.fuyuanshen.common.core.constant.GlobalConstants.FUNCTION_ACCESS_KEY;
import static com.fuyuanshen.global.mqtt.constants.DeviceRedisKeyConstants.*;
/**
* 定位数据命令处理
@ -41,5 +55,4 @@ public class BjqPersonnelInfoDataRule implements MqttMessageRule {
RedisUtils.setCacheObject(functionAccess, FunctionAccessStatus.FAILED.getCode(), Duration.ofSeconds(30));
}
}
}

View File

@ -32,7 +32,6 @@ public class MqttMessageConsumer {
private ExecutorService messageConsumerPool = Executors.newFixedThreadPool(3);
private ExecutorService messageProcessorPool = Executors.newFixedThreadPool(10);
// 初始化方法,启动消息监听
@PostConstruct
public void start() {
@ -131,5 +130,4 @@ public class MqttMessageConsumer {
log.error("业务处理线程 {} 处理消息时发生错误: {}", threadName, message, e);
}
}
}

View File

@ -22,8 +22,6 @@ public class OnlineStatusTask {
@Autowired
private DeviceMapper deviceMapper;
// 使用cron表达式每分钟的第0秒执行
@Scheduled(cron = "0 */3 * * * ?")
public void cronTask() {
@ -39,5 +37,4 @@ public class OnlineStatusTask {
}
});
}
}

View File

@ -98,7 +98,6 @@ public class DeviceControlCenterController extends BaseController {
return R.ok(appDeviceService.getDeviceInfo(deviceMac));
}
/**
* 指令下发记录
*/
@ -107,7 +106,6 @@ public class DeviceControlCenterController extends BaseController {
return appDeviceService.getInstructionRecord(dto, pageQuery);
}
/**
* 导出
*/

View File

@ -739,7 +739,6 @@ public class DeviceXinghanBizService {
device.setCreateByName(loginUser.getNickname());
device.setTypeName(deviceTypes.getTypeName());
device.setDeviceType(deviceTypes.getId());
device.setDevicePic(deviceTypes.getDevicePic());
if (device.getDeviceImei() != null) {
device.setPubTopic("A/" + device.getDeviceImei());
device.setSubTopic("B/" + device.getDeviceImei());

View File

@ -8,8 +8,8 @@ spring.boot.admin.client:
metadata:
username: ${spring.boot.admin.client.username}
userpassword: ${spring.boot.admin.client.password}
username: @monitor.username@
password: @monitor.password@
username: ${monitor.username}
password: ${monitor.password}
--- # snail-job 配置
snail-job:

View File

@ -11,8 +11,8 @@ spring.boot.admin.client:
metadata:
username: ${spring.boot.admin.client.username}
userpassword: ${spring.boot.admin.client.password}
username: @monitor.username@
password: @monitor.password@
username: ${monitor.username}
password: ${monitor.password}
--- # snail-job 配置
snail-job:

View File

@ -77,9 +77,4 @@ public interface SystemConstants {
*/
String ROOT_DEPT_ANCESTORS = "0";
/**
* 菜单ID
*/
public static final Long RESTRICTED_MENU_ID = 102L;
}

View File

@ -74,7 +74,6 @@ public class ExcelUtil {
return listener.getExcelResult();
}
/**
* 导出excel
*
@ -93,7 +92,6 @@ public class ExcelUtil {
}
}
/**
* 导出excel
*
@ -177,7 +175,6 @@ public class ExcelUtil {
exportExcel(list, sheetName, clazz, false, os, options);
}
/**
* 导出excel
*
@ -206,7 +203,6 @@ public class ExcelUtil {
builder.doWrite(list);
}
/**
* 单表多数据模板导出 模板格式为 {.属性}
*

View File

@ -41,7 +41,6 @@ public class DeviceRepairRecordsController extends BaseController {
private final IDeviceRepairRecordsService deviceRepairRecordsService;
/**
* 查询设备维修记录列表
*/
@ -53,7 +52,6 @@ public class DeviceRepairRecordsController extends BaseController {
return deviceRepairRecordsService.queryPageList(criteria, page);
}
/**
* 导出设备维修记录列表
*/
@ -65,7 +63,6 @@ public class DeviceRepairRecordsController extends BaseController {
ExcelUtil.exportExcel(list, "设备维修记录", DeviceRepairRecordsVo.class, response);
}
/**
* 获取设备维修记录详细信息
*
@ -78,7 +75,6 @@ public class DeviceRepairRecordsController extends BaseController {
return R.ok(deviceRepairRecordsService.queryById(recordId));
}
/**
* 新增设备维修记录
*/
@ -90,7 +86,6 @@ public class DeviceRepairRecordsController extends BaseController {
return toAjax(deviceRepairRecordsService.insertByBo(bo));
}
/**
* 修改设备维修记录
*/
@ -114,5 +109,4 @@ public class DeviceRepairRecordsController extends BaseController {
@PathVariable Long[] recordIds) {
return toAjax(deviceRepairRecordsService.deleteWithValidByIds(List.of(recordIds), true));
}
}

View File

@ -15,7 +15,6 @@ import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.io.IOException;
import java.util.List;
/**
@ -51,7 +50,7 @@ public class DeviceTypeController {
// @Log("新增设备类型")
@Operation(summary = "新增设备类型")
@PostMapping(value = "/add")
public R<Void> createDeviceType(@Validated @ModelAttribute DeviceTypeForm resources) throws IOException {
public R<Void> createDeviceType(@Validated @RequestBody DeviceType resources) {
deviceTypeService.create(resources);
return R.ok();
}
@ -60,7 +59,7 @@ public class DeviceTypeController {
// @Log("修改设备类型")
@Operation(summary = "修改设备类型")
@PutMapping(value = "/update")
public R<Void> updateDeviceType(@Validated @ModelAttribute DeviceTypeForm resources) throws IOException {
public R<Void> updateDeviceType(@Validated @RequestBody DeviceTypeForm resources) {
deviceTypeService.update(resources);
return R.ok();
}
@ -80,6 +79,7 @@ public class DeviceTypeController {
public R<DeviceType> getCommunicationMode(@Parameter(name = "设备类型ID", required = true) Long id) {
DeviceType communicationMode = deviceTypeService.getCommunicationMode(id);
return R.ok(communicationMode);
}
}

View File

@ -44,7 +44,7 @@ public class TrackServiceController extends BaseController {
/**
* 查询轨迹服务列表
*/
// @SaCheckPermission("equipment:trackService:list")
@SaCheckPermission("equipment:trackService:list")
@GetMapping("/list")
public TableDataInfo<TrackServiceVo> list(TrackServiceBo bo, PageQuery pageQuery) {
return trackServiceService.queryPageList(bo, pageQuery);
@ -53,7 +53,7 @@ public class TrackServiceController extends BaseController {
/**
* 轨迹服务列表
*/
// @SaCheckPermission("equipment:trackService:export")
@SaCheckPermission("equipment:trackService:export")
@Log(title = "轨迹服务", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(TrackServiceBo bo, HttpServletResponse response) {
@ -75,7 +75,7 @@ public class TrackServiceController extends BaseController {
/**
* 新增轨迹服务
*/
// @SaCheckPermission("equipment:trackService:add")
@SaCheckPermission("equipment:trackService:add")
@Log(title = "轨迹服务", businessType = BusinessType.INSERT)
@PostMapping(value = "/add")
public R<Void> add(@Validated(AddGroup.class) @RequestBody TrackServiceBo bo) {
@ -85,7 +85,7 @@ public class TrackServiceController extends BaseController {
/**
* 修改轨迹服务
*/
// @SaCheckPermission("equipment:trackService:edit")
@SaCheckPermission("equipment:trackService:edit")
@Log(title = "轨迹服务", businessType = BusinessType.UPDATE)
@PostMapping(value = "/update")
public R<Void> edit(@Validated(EditGroup.class) @RequestBody TrackServiceBo bo) {
@ -97,7 +97,7 @@ public class TrackServiceController extends BaseController {
*
* @param ids 主键串
*/
// @SaCheckPermission("equipment:trackService:remove")
@SaCheckPermission("equipment:trackService:remove")
@Log(title = "轨迹服务", businessType = BusinessType.DELETE)
@DeleteMapping(value = "/delete")
public R<Void> remove(@NotEmpty(message = "主键不能为空")

View File

@ -85,8 +85,5 @@ public class DeviceType extends TenantEntity {
@Schema(title = "型号字典用于PC页面跳转")
private String pcModelDictionary;
@Schema(title = "设备图片")
private String devicePic;
}

View File

@ -2,7 +2,6 @@ package com.fuyuanshen.equipment.domain.form;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.web.multipart.MultipartFile;
/**
* @Description: 设备类型
@ -49,10 +48,5 @@ public class DeviceTypeForm {
*/
@Schema(title = "型号字典用于PC页面跳转")
private String pcModelDictionary;
@Schema(title = "设备图片")
private String devicePic;
@Schema(title = "设备图片")
private MultipartFile file;
}

View File

@ -108,7 +108,7 @@ public class DeviceFenceAccessRecordVo implements Serializable {
/**
* 记录创建时间
*/
// @ExcelProperty(value = "记录创建时间")
@ExcelProperty(value = "记录创建时间")
private Date createTime;
}

View File

@ -1,11 +1,15 @@
package com.fuyuanshen.equipment.domain.vo;
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
import cn.idev.excel.annotation.ExcelProperty;
import cn.idev.excel.annotation.write.style.ColumnWidth;
import java.util.Date;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fuyuanshen.common.tenant.core.TenantEntity;
import com.fuyuanshen.equipment.domain.DeviceRepairRecords;
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
import cn.idev.excel.annotation.ExcelProperty;
import com.fuyuanshen.common.excel.annotation.ExcelDictFormat;
import com.fuyuanshen.common.excel.convert.ExcelDictConvert;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
@ -52,8 +56,8 @@ public class DeviceRepairRecordsVo extends TenantEntity implements Serializable
*/
@ExcelProperty(value = "维修时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ColumnWidth(value = 20)
private Date repairTime;
@ColumnWidth(20)
private String repairTime;
/**
* 损坏部位

View File

@ -12,7 +12,6 @@ import com.fuyuanshen.equipment.domain.DeviceType;
import com.fuyuanshen.equipment.domain.dto.DeviceExcelImportDTO;
import com.fuyuanshen.equipment.domain.dto.ImportResult;
import com.fuyuanshen.equipment.domain.form.DeviceForm;
import com.fuyuanshen.equipment.domain.form.DeviceTypeForm;
import com.fuyuanshen.equipment.handler.ImageWriteHandler;
import com.fuyuanshen.system.domain.vo.SysOssVo;
import lombok.extern.slf4j.Slf4j;
@ -438,10 +437,8 @@ public class UploadDeviceDataListener implements ReadListener<DeviceExcelImportD
newDeviceType.setAppModelDictionary(originalDto.getAppModelDictionary());
newDeviceType.setPcModelDictionary(originalDto.getPcModelDictionary());
DeviceTypeForm deviceTypeForm = new DeviceTypeForm();
BeanUtil.copyProperties(newDeviceType, deviceTypeForm, true);
// 创建新的设备类型
params.getDeviceTypeService().create(deviceTypeForm);
params.getDeviceTypeService().create(newDeviceType);
// 重新查询确保获取到正确的ID
deviceType = params.getDeviceTypeService().queryByName(device.getTypeName());

View File

@ -8,7 +8,6 @@ import com.fuyuanshen.equipment.domain.DeviceType;
import com.fuyuanshen.equipment.domain.form.DeviceTypeForm;
import com.fuyuanshen.equipment.domain.query.DeviceTypeQueryCriteria;
import java.io.IOException;
import java.util.List;
/**
@ -64,14 +63,14 @@ public interface DeviceTypeService extends IService<DeviceType> {
*
* @param resources /
*/
void create(DeviceTypeForm resources) throws IOException;
void create(DeviceType resources);
/**
* 修改设备类型
*
* @param resources /
*/
void update(DeviceTypeForm resources) throws IOException;
void update(DeviceTypeForm resources);
/**
* 多选删除

View File

@ -32,8 +32,8 @@ public interface IDeviceRepairRecordsService extends IService<DeviceRepairRecord
/**
* 分页查询设备维修记录列表
*
* @param criteria 查询条件
* @param page 分页参数
* @param bo 查询条件
* @param pageQuery 分页参数
* @return 设备维修记录分页列表
*/
TableDataInfo<DeviceRepairRecordsVo> queryPageList(DeviceRepairRecordsQueryCriteria criteria, Page<DeviceRepairRecords> page);
@ -41,7 +41,7 @@ public interface IDeviceRepairRecordsService extends IService<DeviceRepairRecord
/**
* 查询符合条件的设备维修记录列表
*
* @param criteria 查询条件
* @param bo 查询条件
* @return 设备维修记录列表
*/
List<DeviceRepairRecordsVo> queryList(DeviceRepairRecordsQueryCriteria criteria);
@ -70,5 +70,4 @@ public interface IDeviceRepairRecordsService extends IService<DeviceRepairRecord
* @return 是否删除成功
*/
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
}

View File

@ -52,7 +52,6 @@ public class DeviceRepairRecordsServiceImpl extends ServiceImpl<DeviceRepairReco
private final ISysOssService ossService;
private final FileHashUtil fileHashUtil;
/**
* 查询设备维修记录
*
@ -77,7 +76,6 @@ public class DeviceRepairRecordsServiceImpl extends ServiceImpl<DeviceRepairReco
return vo;
}
/**
* 分页查询设备维修记录列表
*
@ -100,7 +98,6 @@ public class DeviceRepairRecordsServiceImpl extends ServiceImpl<DeviceRepairReco
return new TableDataInfo<DeviceRepairRecordsVo>(deviceRepairRecordsIPage.getRecords(), deviceRepairRecordsIPage.getTotal());
}
/**
* 查询符合条件的设备维修记录列表
*

View File

@ -19,16 +19,12 @@ import com.fuyuanshen.equipment.mapper.DeviceMapper;
import com.fuyuanshen.equipment.mapper.DeviceTypeGrantsMapper;
import com.fuyuanshen.equipment.mapper.DeviceTypeMapper;
import com.fuyuanshen.equipment.service.DeviceTypeService;
import com.fuyuanshen.equipment.utils.FileHashUtil;
import com.fuyuanshen.system.domain.vo.SysOssVo;
import com.fuyuanshen.system.domain.vo.SysRoleVo;
import com.fuyuanshen.system.service.ISysOssService;
import com.fuyuanshen.system.service.ISysRoleService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@ -50,8 +46,6 @@ public class DeviceTypeServiceImpl extends ServiceImpl<DeviceTypeMapper, DeviceT
private final DeviceAssignmentsMapper deviceAssignmentsMapper;
private final ISysRoleService roleService;
private final ISysOssService ossService;
private final FileHashUtil fileHashUtil;
/**
@ -187,38 +181,24 @@ public class DeviceTypeServiceImpl extends ServiceImpl<DeviceTypeMapper, DeviceT
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void create(DeviceTypeForm resources) throws IOException {
public void create(DeviceType resources) {
// 校验设备类型名称
List<DeviceType> typeName = deviceTypeMapper.selectList(new QueryWrapper<DeviceType>().eq("type_name", resources.getTypeName()));
if (CollectionUtil.isNotEmpty(typeName)) {
throw new RuntimeException("设备类型名称已存在,无法新增!!!");
}
// 保存图片并获取URL
if (resources.getFile() != null) {
String fileHash = fileHashUtil.hash(resources.getFile());
SysOssVo upload = ossService.updateHash(resources.getFile(), fileHash);
// 强制将HTTP替换为HTTPS
if (upload.getUrl() != null && upload.getUrl().startsWith("http://")) {
upload.setUrl(upload.getUrl().replaceFirst("^http://", "https://"));
}
// 设置图片路径
resources.setDevicePic(upload.getUrl());
}
DeviceType deviceType = new DeviceType();
BeanUtil.copyProperties(resources, deviceType, true);
LoginUser loginUser = LoginHelper.getLoginUser();
deviceType.setCustomerId(loginUser.getUserId());
deviceType.setOwnerCustomerId(loginUser.getUserId());
deviceType.setOriginalOwnerId(loginUser.getUserId());
deviceType.setCreateByName(loginUser.getNickname());
deviceTypeMapper.insert(deviceType);
resources.setCustomerId(loginUser.getUserId());
resources.setOwnerCustomerId(loginUser.getUserId());
resources.setOriginalOwnerId(loginUser.getUserId());
resources.setCreateByName(loginUser.getNickname());
deviceTypeMapper.insert(resources);
// 自动授权给自己
DeviceTypeGrants deviceTypeGrants = new DeviceTypeGrants();
deviceTypeGrants.setDeviceTypeId(deviceType.getId());
deviceTypeGrants.setDeviceTypeId(resources.getId());
deviceTypeGrants.setCustomerId(loginUser.getUserId());
deviceTypeGrants.setGrantorCustomerId(loginUser.getUserId());
deviceTypeGrants.setGrantedAt(new Date());
@ -233,7 +213,7 @@ public class DeviceTypeServiceImpl extends ServiceImpl<DeviceTypeMapper, DeviceT
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void update(DeviceTypeForm resources) throws IOException {
public void update(DeviceTypeForm resources) {
DeviceTypeGrants deviceTypeGrants = deviceTypeGrantsMapper.selectById(resources.getId());
if (deviceTypeGrants == null) {
throw new RuntimeException("设备类型不存在");
@ -244,13 +224,22 @@ public class DeviceTypeServiceImpl extends ServiceImpl<DeviceTypeMapper, DeviceT
throw new RuntimeException("设备类型不存在");
}
if (!deviceType.getTypeName().equals(resources.getTypeName())) {
int count = deviceMapper.countByDeviceTypeId(deviceType.getId());
if (count > 0) {
throw new RuntimeException("该设备类型下已有设备,无法修改设备类型名称!!!");
throw new RuntimeException("该设备类型下已有绑定设备,无法修改设备类型名称!!!");
}
}
// List<Device> devices = deviceMapper.selectList(new QueryWrapper<Device>()
// .eq("device_type", deviceTypeGrants.getDeviceTypeId()));
// if (CollectionUtil.isNotEmpty(devices)) {
// throw new RuntimeException("该设备类型已绑定设备,无法修改!!!");
// }
// 校验设备类型名称
DeviceType dt = deviceTypeMapper.selectOne(new QueryWrapper<DeviceType>().eq("type_name", resources.getTypeName()));
if (dt != null && !dt.getId().equals(deviceType.getId())) {
@ -264,17 +253,6 @@ public class DeviceTypeServiceImpl extends ServiceImpl<DeviceTypeMapper, DeviceT
throw new RuntimeException("无权修改该设备类型");
}
}
// 保存图片并获取URL
if (resources.getFile() != null) {
String fileHash = fileHashUtil.hash(resources.getFile());
SysOssVo upload = ossService.updateHash(resources.getFile(), fileHash);
// 强制将HTTP替换为HTTPS
if (upload.getUrl() != null && upload.getUrl().startsWith("http://")) {
upload.setUrl(upload.getUrl().replaceFirst("^http://", "https://"));
}
// 设置图片路径
resources.setDevicePic(upload.getUrl());
}
BeanUtil.copyProperties(resources, deviceType);
deviceTypeMapper.updateById(deviceType);

View File

@ -13,8 +13,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
a.content,
a.create_time AS createTime
FROM
device_log a inner join device b on a.device_id = b.id
inner join device_type c on b.device_type = c.id
device_log a left join device b on a.device_id = b.id
left join device_type c on b.device_type = c.id
WHERE 1 = 1
<if test="bo.deviceType != null">
AND c.id = #{bo.deviceType}

View File

@ -36,7 +36,6 @@ public class SysMenuController extends BaseController {
private final ISysMenuService menuService;
/**
* 获取路由信息
*
@ -48,7 +47,6 @@ public class SysMenuController extends BaseController {
return R.ok(menuService.buildMenus(menus));
}
/**
* 获取菜单列表
*/

View File

@ -31,7 +31,6 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import java.util.stream.Collectors;
/**
* 菜单 业务层处理
@ -142,17 +141,10 @@ public class SysMenuServiceImpl implements ISysMenuService {
menus = baseMapper.selectMenuTreeAll();
} else {
menus = baseMapper.selectMenuTreeByUserId(userId);
// 如果不是超级管理员且不是租户管理员,则过滤掉受限制的菜单
// if (!LoginHelper.isAdmin()) {
menus = menus.stream()
.filter(menu -> !SystemConstants.RESTRICTED_MENU_ID.equals(menu.getMenuId()))
.collect(Collectors.toList());
// }
}
return getChildPerms(menus, 0);
}
/**
* 根据角色ID查询菜单树信息
*

16
pom.xml
View File

@ -85,10 +85,10 @@
<monitor.username>fys</monitor.username>
<monitor.password>123456</monitor.password>
</properties>
<activation>
<!-- 默认环境 -->
<activeByDefault>true</activeByDefault>
</activation>
<!-- <activation> -->
<!-- &lt;!&ndash; 默认环境 &ndash;&gt; -->
<!-- <activeByDefault>true</activeByDefault> -->
<!-- </activation> -->
</profile>
<profile>
<id>prod</id>
@ -98,10 +98,10 @@
<monitor.username>fys</monitor.username>
<monitor.password>123456</monitor.password>
</properties>
<!-- <activation> -->
<!-- &lt;!&ndash; 默认环境 &ndash;&gt; -->
<!-- <activeByDefault>true</activeByDefault> -->
<!-- </activation> -->
<activation>
<!-- 默认环境 -->
<activeByDefault>true</activeByDefault>
</activation>
</profile>
<profile>
<id>jingquan</id>