Compare commits
2 Commits
dyf-device
...
55cacbd322
Author | SHA1 | Date | |
---|---|---|---|
55cacbd322 | |||
99ec6eaff0 |
@ -100,7 +100,7 @@ public class AppAuthController {
|
|||||||
*/
|
*/
|
||||||
@PostMapping("/logout")
|
@PostMapping("/logout")
|
||||||
public R<Void> logout() {
|
public R<Void> logout() {
|
||||||
loginService.logout();
|
// loginService.logout();
|
||||||
return R.ok("退出成功");
|
return R.ok("退出成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,19 +1,16 @@
|
|||||||
package com.fuyuanshen.app.controller;
|
package com.fuyuanshen.app.controller;
|
||||||
|
|
||||||
import com.fuyuanshen.app.domain.bo.AppPersonnelInfoBo;
|
|
||||||
import com.fuyuanshen.app.domain.dto.APPReNameDTO;
|
import com.fuyuanshen.app.domain.dto.APPReNameDTO;
|
||||||
import com.fuyuanshen.app.domain.vo.APPDeviceTypeVo;
|
import com.fuyuanshen.app.domain.vo.APPDeviceTypeVo;
|
||||||
import com.fuyuanshen.app.domain.vo.AppDeviceDetailVo;
|
import com.fuyuanshen.app.service.equipment.APPDeviceService;
|
||||||
import com.fuyuanshen.app.service.AppDeviceBizService;
|
|
||||||
import com.fuyuanshen.common.core.domain.R;
|
import com.fuyuanshen.common.core.domain.R;
|
||||||
import com.fuyuanshen.common.core.validate.AddGroup;
|
|
||||||
import com.fuyuanshen.common.mybatis.core.page.PageQuery;
|
import com.fuyuanshen.common.mybatis.core.page.PageQuery;
|
||||||
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.common.web.core.BaseController;
|
||||||
import com.fuyuanshen.equipment.domain.dto.AppDeviceBo;
|
import com.fuyuanshen.equipment.domain.dto.AppDeviceBo;
|
||||||
import com.fuyuanshen.equipment.domain.query.DeviceQueryCriteria;
|
import com.fuyuanshen.equipment.domain.query.DeviceQueryCriteria;
|
||||||
import com.fuyuanshen.equipment.domain.vo.AppDeviceVo;
|
import com.fuyuanshen.equipment.domain.vo.AppDeviceVo;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import com.fuyuanshen.equipment.service.DeviceService;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
@ -21,7 +18,7 @@ import org.springframework.web.bind.annotation.*;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* APP设备信息管理
|
* APP 设备信息管理
|
||||||
*/
|
*/
|
||||||
@Validated
|
@Validated
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@ -29,16 +26,18 @@ import java.util.List;
|
|||||||
@RequestMapping("/app/device")
|
@RequestMapping("/app/device")
|
||||||
public class AppDeviceController extends BaseController {
|
public class AppDeviceController extends BaseController {
|
||||||
|
|
||||||
private final AppDeviceBizService appDeviceService;
|
private final DeviceService deviceService;
|
||||||
|
|
||||||
|
|
||||||
|
private final APPDeviceService appDeviceService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询设备列表
|
* 查询设备列表
|
||||||
*/
|
*/
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo<AppDeviceVo> list(DeviceQueryCriteria bo, PageQuery pageQuery) {
|
public TableDataInfo<AppDeviceVo> list(DeviceQueryCriteria bo, PageQuery pageQuery) {
|
||||||
|
|
||||||
return appDeviceService.queryAppDeviceList(bo,pageQuery);
|
return deviceService.queryAppDeviceList(bo,pageQuery);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -46,7 +45,7 @@ public class AppDeviceController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@PostMapping("/bind")
|
@PostMapping("/bind")
|
||||||
public R<Void> bind(@RequestBody AppDeviceBo bo) {
|
public R<Void> bind(@RequestBody AppDeviceBo bo) {
|
||||||
return toAjax(appDeviceService.bindDevice(bo));
|
return toAjax(deviceService.bindDevice(bo));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -55,7 +54,7 @@ public class AppDeviceController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@DeleteMapping("/unBind")
|
@DeleteMapping("/unBind")
|
||||||
public R<Void> unBind(Long id) {
|
public R<Void> unBind(Long id) {
|
||||||
return toAjax(appDeviceService.unBindDevice(id));
|
return toAjax(deviceService.unBindDevice(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -77,31 +76,4 @@ public class AppDeviceController extends BaseController {
|
|||||||
appDeviceService.reName(reNameDTO);
|
appDeviceService.reName(reNameDTO);
|
||||||
return R.ok("重命名成功!!!");
|
return R.ok("重命名成功!!!");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取设备详细信息
|
|
||||||
*
|
|
||||||
* @param id 主键
|
|
||||||
*/
|
|
||||||
@GetMapping("/{id}")
|
|
||||||
public R<AppDeviceDetailVo> getInfo(@NotNull(message = "主键不能为空")
|
|
||||||
@PathVariable Long id) {
|
|
||||||
return R.ok(appDeviceService.getInfo(id));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 人员信息登记
|
|
||||||
*/
|
|
||||||
@PostMapping(value = "/registerPersonInfo")
|
|
||||||
public R<Void> registerPersonInfo(@Validated(AddGroup.class) @RequestBody AppPersonnelInfoBo bo) {
|
|
||||||
return toAjax(appDeviceService.registerPersonInfo(bo));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 发送信息
|
|
||||||
*/
|
|
||||||
@PostMapping(value = "/sendMessage")
|
|
||||||
public R<Void> sendMessage(@RequestBody AppDeviceBo bo) {
|
|
||||||
return toAjax(appDeviceService.sendMessage(bo));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -1,110 +0,0 @@
|
|||||||
package com.fuyuanshen.app.controller;
|
|
||||||
|
|
||||||
import cn.dev33.satoken.annotation.SaIgnore;
|
|
||||||
import cn.hutool.core.util.RandomUtil;
|
|
||||||
import com.fuyuanshen.app.domain.bo.AppDeviceShareBo;
|
|
||||||
import com.fuyuanshen.app.domain.vo.AppDeviceShareDetailVo;
|
|
||||||
import com.fuyuanshen.app.domain.vo.AppDeviceShareVo;
|
|
||||||
import com.fuyuanshen.app.service.AppDeviceShareService;
|
|
||||||
import com.fuyuanshen.app.service.IAppDeviceShareService;
|
|
||||||
import com.fuyuanshen.common.core.constant.Constants;
|
|
||||||
import com.fuyuanshen.common.core.domain.R;
|
|
||||||
import com.fuyuanshen.common.core.validate.AddGroup;
|
|
||||||
import com.fuyuanshen.common.idempotent.annotation.RepeatSubmit;
|
|
||||||
import com.fuyuanshen.common.mybatis.core.page.PageQuery;
|
|
||||||
import com.fuyuanshen.common.mybatis.core.page.TableDataInfo;
|
|
||||||
import com.fuyuanshen.common.ratelimiter.annotation.RateLimiter;
|
|
||||||
import com.fuyuanshen.common.redis.utils.RedisUtils;
|
|
||||||
import com.fuyuanshen.common.web.core.BaseController;
|
|
||||||
import jakarta.validation.constraints.NotBlank;
|
|
||||||
import jakarta.validation.constraints.NotEmpty;
|
|
||||||
import jakarta.validation.constraints.NotNull;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import org.dromara.sms4j.api.SmsBlend;
|
|
||||||
import org.dromara.sms4j.api.entity.SmsResponse;
|
|
||||||
import org.dromara.sms4j.core.factory.SmsFactory;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import java.time.Duration;
|
|
||||||
import java.util.LinkedHashMap;
|
|
||||||
|
|
||||||
import static com.fuyuanshen.common.core.constant.GlobalConstants.DEVICE_SHARE_CODES_KEY;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* APP 设备分享
|
|
||||||
*
|
|
||||||
* @author Lion Li
|
|
||||||
* @date 2025-07-16
|
|
||||||
*/
|
|
||||||
@Validated
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/app/deviceShare")
|
|
||||||
public class AppDeviceShareController extends BaseController {
|
|
||||||
|
|
||||||
private final IAppDeviceShareService deviceShareService;
|
|
||||||
|
|
||||||
private final AppDeviceShareService appDeviceShareService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分享管理列表
|
|
||||||
*/
|
|
||||||
@GetMapping("/deviceShareList")
|
|
||||||
public TableDataInfo<AppDeviceShareVo> list(AppDeviceShareBo bo, PageQuery pageQuery) {
|
|
||||||
return deviceShareService.queryPageList(bo, pageQuery);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取设备分享详细信息
|
|
||||||
*
|
|
||||||
* @param id 主键
|
|
||||||
*/
|
|
||||||
@GetMapping("/{id}")
|
|
||||||
public R<AppDeviceShareDetailVo> getInfo(@NotNull(message = "主键不能为空")
|
|
||||||
@PathVariable Long id) {
|
|
||||||
return R.ok(appDeviceShareService.getInfo(id));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增设备分享
|
|
||||||
*/
|
|
||||||
@RepeatSubmit()
|
|
||||||
@PostMapping("/deviceShare")
|
|
||||||
public R<Void> deviceShare(@Validated(AddGroup.class) @RequestBody AppDeviceShareBo bo) {
|
|
||||||
return toAjax(appDeviceShareService.deviceShare(bo));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 移除分享用户
|
|
||||||
*
|
|
||||||
* @param ids 主键串
|
|
||||||
*/
|
|
||||||
@DeleteMapping("/{ids}")
|
|
||||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
|
||||||
@PathVariable Long[] ids) {
|
|
||||||
return toAjax(appDeviceShareService.remove(ids));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 短信验证码
|
|
||||||
*
|
|
||||||
* @param phonenumber 用户手机号
|
|
||||||
*/
|
|
||||||
@SaIgnore
|
|
||||||
@RateLimiter(key = "#phonenumber", time = 60, count = 1)
|
|
||||||
@GetMapping("/sms/code")
|
|
||||||
public R<Void> smsCode(@NotBlank(message = "{user.phonenumber.not.blank}") String phonenumber) {
|
|
||||||
String key = DEVICE_SHARE_CODES_KEY + phonenumber;
|
|
||||||
String code = RandomUtil.randomNumbers(4);
|
|
||||||
RedisUtils.setCacheObject(key, code, Duration.ofMinutes(Constants.CAPTCHA_EXPIRATION));
|
|
||||||
LinkedHashMap<String, String> map = new LinkedHashMap<>(1);
|
|
||||||
map.put("code", code);
|
|
||||||
SmsBlend smsBlend = SmsFactory.getSmsBlend("config1");
|
|
||||||
SmsResponse smsResponse = smsBlend.sendMessage(phonenumber, map);
|
|
||||||
if (!smsResponse.isSuccess()) {
|
|
||||||
return R.fail(smsResponse.getData().toString());
|
|
||||||
}
|
|
||||||
return R.ok();
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,167 +0,0 @@
|
|||||||
package com.fuyuanshen.app.service;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
||||||
import com.fuyuanshen.app.domain.AppPersonnelInfo;
|
|
||||||
import com.fuyuanshen.app.domain.bo.AppPersonnelInfoBo;
|
|
||||||
import com.fuyuanshen.app.domain.dto.APPReNameDTO;
|
|
||||||
import com.fuyuanshen.app.domain.vo.APPDeviceTypeVo;
|
|
||||||
import com.fuyuanshen.app.domain.vo.AppDeviceDetailVo;
|
|
||||||
import com.fuyuanshen.app.domain.vo.AppPersonnelInfoVo;
|
|
||||||
import com.fuyuanshen.app.mapper.AppPersonnelInfoMapper;
|
|
||||||
import com.fuyuanshen.app.mapper.equipment.APPDeviceMapper;
|
|
||||||
import com.fuyuanshen.common.core.utils.MapstructUtils;
|
|
||||||
import com.fuyuanshen.common.mybatis.core.page.PageQuery;
|
|
||||||
import com.fuyuanshen.common.mybatis.core.page.TableDataInfo;
|
|
||||||
import com.fuyuanshen.common.satoken.utils.AppLoginHelper;
|
|
||||||
import com.fuyuanshen.equipment.domain.Device;
|
|
||||||
import com.fuyuanshen.equipment.domain.DeviceType;
|
|
||||||
import com.fuyuanshen.equipment.domain.dto.AppDeviceBo;
|
|
||||||
import com.fuyuanshen.equipment.domain.query.DeviceQueryCriteria;
|
|
||||||
import com.fuyuanshen.equipment.domain.vo.AppDeviceVo;
|
|
||||||
import com.fuyuanshen.equipment.enums.BindingStatusEnum;
|
|
||||||
import com.fuyuanshen.equipment.enums.CommunicationModeEnum;
|
|
||||||
import com.fuyuanshen.equipment.mapper.DeviceMapper;
|
|
||||||
import com.fuyuanshen.equipment.mapper.DeviceTypeMapper;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
|
|
||||||
@Slf4j
|
|
||||||
@Service
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class AppDeviceBizService {
|
|
||||||
|
|
||||||
private final APPDeviceMapper appDeviceMapper;
|
|
||||||
private final DeviceMapper deviceMapper;
|
|
||||||
private final AppPersonnelInfoMapper appPersonnelInfoMapper;
|
|
||||||
private final DeviceTypeMapper deviceTypeMapper;
|
|
||||||
|
|
||||||
|
|
||||||
public List<APPDeviceTypeVo> getTypeList() {
|
|
||||||
Long userId = AppLoginHelper.getUserId();
|
|
||||||
return appDeviceMapper.getTypeList(userId);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void reName(APPReNameDTO reNameDTO) {
|
|
||||||
UpdateWrapper<Device> updateWrapper = new UpdateWrapper<>();
|
|
||||||
updateWrapper.eq("id", reNameDTO.getId())
|
|
||||||
.eq("binding_user_id", AppLoginHelper.getUserId())
|
|
||||||
.set("device_name", reNameDTO.getDeviceName());
|
|
||||||
deviceMapper.update(updateWrapper);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public int sendMessage(AppDeviceBo bo) {
|
|
||||||
UpdateWrapper<Device> updateWrapper = new UpdateWrapper<>();
|
|
||||||
updateWrapper.eq("id", bo.getDeviceId())
|
|
||||||
.eq("binding_user_id", AppLoginHelper.getUserId())
|
|
||||||
.set("send_msg", bo.getSendMsg());
|
|
||||||
return deviceMapper.update(updateWrapper);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public TableDataInfo<AppDeviceVo> queryAppDeviceList(DeviceQueryCriteria bo, PageQuery pageQuery) {
|
|
||||||
if (bo.getBindingUserId() == null) {
|
|
||||||
Long userId = AppLoginHelper.getUserId();
|
|
||||||
bo.setBindingUserId(userId);
|
|
||||||
}
|
|
||||||
Page<AppDeviceVo> result = deviceMapper.queryAppBindDeviceList(pageQuery.build(), bo);
|
|
||||||
return TableDataInfo.build(result);
|
|
||||||
}
|
|
||||||
|
|
||||||
public int bindDevice(AppDeviceBo bo) {
|
|
||||||
Integer mode = bo.getCommunicationMode();
|
|
||||||
Long userId = AppLoginHelper.getUserId();
|
|
||||||
if (mode == CommunicationModeEnum.FOUR_G.getValue()) {
|
|
||||||
|
|
||||||
String deviceImei = bo.getDeviceImei();
|
|
||||||
QueryWrapper<Device> qw = new QueryWrapper<Device>()
|
|
||||||
.eq("device_imei", deviceImei);
|
|
||||||
List<Device> devices = deviceMapper.selectList(qw);
|
|
||||||
if (devices.isEmpty()) {
|
|
||||||
throw new RuntimeException("请先将设备入库!!!");
|
|
||||||
}
|
|
||||||
Device device = devices.get(0);
|
|
||||||
if (device.getBindingStatus() != null && device.getBindingStatus() == BindingStatusEnum.BOUND.getCode()) {
|
|
||||||
throw new RuntimeException("设备已绑定");
|
|
||||||
}
|
|
||||||
UpdateWrapper<Device> deviceUpdateWrapper = new UpdateWrapper<>();
|
|
||||||
deviceUpdateWrapper.eq("id", device.getId())
|
|
||||||
.set("binding_status", BindingStatusEnum.BOUND.getCode())
|
|
||||||
.set("binding_user_id", userId)
|
|
||||||
.set("binding_time", new Date());
|
|
||||||
|
|
||||||
|
|
||||||
return deviceMapper.update(null, deviceUpdateWrapper);
|
|
||||||
} else if (mode == CommunicationModeEnum.BLUETOOTH.getValue()) {
|
|
||||||
String deviceMac = bo.getDeviceMac();
|
|
||||||
QueryWrapper<Device> qw = new QueryWrapper<Device>()
|
|
||||||
.eq("device_mac", deviceMac);
|
|
||||||
List<Device> devices = deviceMapper.selectList(qw);
|
|
||||||
if (devices.isEmpty()) {
|
|
||||||
throw new RuntimeException("请先将设备入库!!!");
|
|
||||||
}
|
|
||||||
Device device = devices.get(0);
|
|
||||||
if (device.getBindingStatus() != null && device.getBindingStatus() == BindingStatusEnum.BOUND.getCode()) {
|
|
||||||
throw new RuntimeException("设备已绑定");
|
|
||||||
}
|
|
||||||
UpdateWrapper<Device> deviceUpdateWrapper = new UpdateWrapper<>();
|
|
||||||
deviceUpdateWrapper.eq("id", device.getId())
|
|
||||||
.set("binding_status", BindingStatusEnum.BOUND.getCode())
|
|
||||||
.set("binding_user_id", userId)
|
|
||||||
.set("binding_time", new Date());
|
|
||||||
return deviceMapper.update(null, deviceUpdateWrapper);
|
|
||||||
} else {
|
|
||||||
throw new RuntimeException("通讯方式错误");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public int unBindDevice(Long id) {
|
|
||||||
Device device = deviceMapper.selectById(id);
|
|
||||||
if (device == null) {
|
|
||||||
throw new RuntimeException("请先将设备入库!!!");
|
|
||||||
}
|
|
||||||
UpdateWrapper<Device> deviceUpdateWrapper = new UpdateWrapper<>();
|
|
||||||
deviceUpdateWrapper.eq("id", device.getId())
|
|
||||||
.set("binding_status", BindingStatusEnum.UNBOUND.getCode())
|
|
||||||
.set("binding_user_id", null)
|
|
||||||
.set("binding_time", null);
|
|
||||||
return deviceMapper.update(null, deviceUpdateWrapper);
|
|
||||||
}
|
|
||||||
|
|
||||||
public AppDeviceDetailVo getInfo(Long id) {
|
|
||||||
Device device = deviceMapper.selectById(id);
|
|
||||||
AppDeviceDetailVo vo = new AppDeviceDetailVo();
|
|
||||||
vo.setDeviceId(device.getId());
|
|
||||||
vo.setDeviceName(device.getDeviceName());
|
|
||||||
vo.setDevicePic(device.getDevicePic());
|
|
||||||
vo.setDeviceImei(device.getDeviceImei());
|
|
||||||
vo.setDeviceMac(device.getDeviceMac());
|
|
||||||
vo.setDeviceStatus(device.getDeviceStatus());
|
|
||||||
DeviceType deviceType = deviceTypeMapper.selectById(device.getDeviceType());
|
|
||||||
if(deviceType!=null){
|
|
||||||
vo.setCommunicationMode(Integer.valueOf(deviceType.getCommunicationMode()));
|
|
||||||
vo.setTypeName(deviceType.getTypeName());
|
|
||||||
}
|
|
||||||
vo.setBluetoothName(device.getBluetoothName());
|
|
||||||
|
|
||||||
AppPersonnelInfo appPersonnelInfo = appPersonnelInfoMapper.selectById(device.getId());
|
|
||||||
if(appPersonnelInfo != null){
|
|
||||||
AppPersonnelInfoVo personnelInfoVo = MapstructUtils.convert(appPersonnelInfo, AppPersonnelInfoVo.class);
|
|
||||||
vo.setPersonnelInfo(personnelInfoVo);
|
|
||||||
}
|
|
||||||
return vo;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean registerPersonInfo(AppPersonnelInfoBo bo) {
|
|
||||||
AppPersonnelInfo appPersonnelInfo = MapstructUtils.convert(bo, AppPersonnelInfo.class);
|
|
||||||
return appPersonnelInfoMapper.insertOrUpdate(appPersonnelInfo);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,135 +0,0 @@
|
|||||||
package com.fuyuanshen.app.service;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
||||||
import com.fuyuanshen.app.domain.AppDeviceShare;
|
|
||||||
import com.fuyuanshen.app.domain.AppPersonnelInfo;
|
|
||||||
import com.fuyuanshen.app.domain.bo.AppDeviceShareBo;
|
|
||||||
import com.fuyuanshen.app.domain.vo.AppDeviceShareDetailVo;
|
|
||||||
import com.fuyuanshen.app.domain.vo.AppDeviceShareVo;
|
|
||||||
import com.fuyuanshen.app.domain.vo.AppPersonnelInfoVo;
|
|
||||||
import com.fuyuanshen.app.mapper.AppDeviceShareMapper;
|
|
||||||
import com.fuyuanshen.app.mapper.AppPersonnelInfoMapper;
|
|
||||||
import com.fuyuanshen.common.core.constant.Constants;
|
|
||||||
import com.fuyuanshen.common.core.constant.GlobalConstants;
|
|
||||||
import com.fuyuanshen.common.core.exception.ServiceException;
|
|
||||||
import com.fuyuanshen.common.core.exception.user.CaptchaExpireException;
|
|
||||||
import com.fuyuanshen.common.core.utils.MessageUtils;
|
|
||||||
import com.fuyuanshen.common.core.utils.StringUtils;
|
|
||||||
import com.fuyuanshen.common.redis.utils.RedisUtils;
|
|
||||||
import com.fuyuanshen.common.satoken.utils.AppLoginHelper;
|
|
||||||
import com.fuyuanshen.equipment.domain.Device;
|
|
||||||
import com.fuyuanshen.equipment.domain.DeviceType;
|
|
||||||
import com.fuyuanshen.equipment.mapper.DeviceMapper;
|
|
||||||
import com.fuyuanshen.equipment.mapper.DeviceTypeMapper;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
@Slf4j
|
|
||||||
@Service
|
|
||||||
public class AppDeviceShareService {
|
|
||||||
|
|
||||||
private final AppDeviceShareMapper appDeviceShareMapper;
|
|
||||||
|
|
||||||
private final DeviceMapper deviceMapper;
|
|
||||||
|
|
||||||
private final DeviceTypeMapper deviceTypeMapper;
|
|
||||||
|
|
||||||
private final AppPersonnelInfoMapper appPersonnelInfoMapper;
|
|
||||||
|
|
||||||
public AppDeviceShareDetailVo getInfo(Long id) {
|
|
||||||
|
|
||||||
LambdaQueryWrapper<AppDeviceShare> queryWrapper = new LambdaQueryWrapper<>();
|
|
||||||
queryWrapper.eq(AppDeviceShare::getDeviceId, id);
|
|
||||||
List<AppDeviceShareVo> appDeviceShareVos = appDeviceShareMapper.selectVoList(queryWrapper);
|
|
||||||
if(appDeviceShareVos==null || appDeviceShareVos.isEmpty()){
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
AppDeviceShareVo shareVo = appDeviceShareVos.get(0);
|
|
||||||
AppDeviceShareDetailVo shareDetailVo = new AppDeviceShareDetailVo();
|
|
||||||
shareDetailVo.setId(shareVo.getId());
|
|
||||||
shareDetailVo.setDeviceId(shareVo.getDeviceId());
|
|
||||||
shareDetailVo.setPhonenumber(shareVo.getPhonenumber());
|
|
||||||
shareDetailVo.setPermission(shareVo.getPermission());
|
|
||||||
|
|
||||||
Device device = deviceMapper.selectById(shareVo.getDeviceId());
|
|
||||||
shareDetailVo.setDeviceName(device.getDeviceName());
|
|
||||||
shareDetailVo.setDeviceImei(device.getDeviceImei());
|
|
||||||
shareDetailVo.setDeviceMac(device.getDeviceMac());
|
|
||||||
|
|
||||||
DeviceType deviceType = deviceTypeMapper.selectById(device.getDeviceType());
|
|
||||||
if(deviceType!=null){
|
|
||||||
shareDetailVo.setCommunicationMode(Integer.valueOf(deviceType.getCommunicationMode()));
|
|
||||||
}
|
|
||||||
shareDetailVo.setDevicePic(device.getDevicePic());
|
|
||||||
shareDetailVo.setTypeName(deviceType.getTypeName());
|
|
||||||
shareDetailVo.setBluetoothName(device.getBluetoothName());
|
|
||||||
shareDetailVo.setDeviceStatus(device.getDeviceStatus());
|
|
||||||
shareDetailVo.setSendMsg(device.getSendMsg());
|
|
||||||
|
|
||||||
LambdaQueryWrapper<AppPersonnelInfo> qw = new LambdaQueryWrapper<>();
|
|
||||||
qw.eq(AppPersonnelInfo::getDeviceId, device.getId());
|
|
||||||
List<AppPersonnelInfoVo> appPersonnelInfoVos = appPersonnelInfoMapper.selectVoList(qw);
|
|
||||||
if(appPersonnelInfoVos!=null && !appPersonnelInfoVos.isEmpty()){
|
|
||||||
shareDetailVo.setPersonnelInfo(appPersonnelInfoVos.get(0));
|
|
||||||
}
|
|
||||||
|
|
||||||
return shareDetailVo;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 校验短信验证码
|
|
||||||
*/
|
|
||||||
private boolean validateSmsCode(String tenantId, String phonenumber, String smsCode) {
|
|
||||||
String code = RedisUtils.getCacheObject(GlobalConstants.DEVICE_SHARE_CODES_KEY + phonenumber);
|
|
||||||
if (StringUtils.isBlank(code)) {
|
|
||||||
throw new ServiceException("验证码失效");
|
|
||||||
}
|
|
||||||
return code.equals(smsCode);
|
|
||||||
}
|
|
||||||
public int deviceShare(AppDeviceShareBo bo) {
|
|
||||||
boolean flag = validateSmsCode(AppLoginHelper.getTenantId(), bo.getPhonenumber(), bo.getSmsCode());
|
|
||||||
if(!flag){
|
|
||||||
throw new ServiceException("验证码错误");
|
|
||||||
}
|
|
||||||
|
|
||||||
Device device = deviceMapper.selectById(bo.getDeviceId());
|
|
||||||
if(device==null){
|
|
||||||
throw new ServiceException("设备不存在");
|
|
||||||
}
|
|
||||||
Long userId = AppLoginHelper.getUserId();
|
|
||||||
LambdaQueryWrapper<AppDeviceShare> lqw = new LambdaQueryWrapper<>();
|
|
||||||
lqw.eq(AppDeviceShare::getDeviceId, bo.getDeviceId());
|
|
||||||
lqw.eq(AppDeviceShare::getPhonenumber, bo.getPhonenumber());
|
|
||||||
Long count = appDeviceShareMapper.selectCount(lqw);
|
|
||||||
if(count>0){
|
|
||||||
|
|
||||||
UpdateWrapper<AppDeviceShare> uw = new UpdateWrapper<>();
|
|
||||||
uw.eq("device_id", bo.getDeviceId());
|
|
||||||
uw.eq("phonenumber", bo.getPhonenumber());
|
|
||||||
uw.set("permission", bo.getPermission());
|
|
||||||
uw.set("update_by", userId);
|
|
||||||
uw.set("update_time", new Date());
|
|
||||||
|
|
||||||
return appDeviceShareMapper.update(uw);
|
|
||||||
}else {
|
|
||||||
AppDeviceShare appDeviceShare = new AppDeviceShare();
|
|
||||||
appDeviceShare.setDeviceId(bo.getDeviceId());
|
|
||||||
appDeviceShare.setPhonenumber(bo.getPhonenumber());
|
|
||||||
appDeviceShare.setPermission(bo.getPermission());
|
|
||||||
appDeviceShare.setCreateBy(userId);
|
|
||||||
return appDeviceShareMapper.insert(appDeviceShare);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public int remove(Long[] ids) {
|
|
||||||
return appDeviceShareMapper.deleteByIds(Arrays.asList(ids));
|
|
||||||
}
|
|
||||||
}
|
|
@ -63,12 +63,11 @@ public class CaptchaController {
|
|||||||
String code = RandomUtil.randomNumbers(4);
|
String code = RandomUtil.randomNumbers(4);
|
||||||
RedisUtils.setCacheObject(key, code, Duration.ofMinutes(Constants.CAPTCHA_EXPIRATION));
|
RedisUtils.setCacheObject(key, code, Duration.ofMinutes(Constants.CAPTCHA_EXPIRATION));
|
||||||
// 验证码模板id 自行处理 (查数据库或写死均可)
|
// 验证码模板id 自行处理 (查数据库或写死均可)
|
||||||
String templateId = "SMS_322180518";
|
String templateId = "";
|
||||||
LinkedHashMap<String, String> map = new LinkedHashMap<>(1);
|
LinkedHashMap<String, String> map = new LinkedHashMap<>(1);
|
||||||
map.put("code", code);
|
map.put("code", code);
|
||||||
SmsBlend smsBlend = SmsFactory.getSmsBlend("config1");
|
SmsBlend smsBlend = SmsFactory.getSmsBlend("config1");
|
||||||
// SmsResponse smsResponse = smsBlend.sendMessage(phonenumber, templateId, map);
|
SmsResponse smsResponse = smsBlend.sendMessage(phonenumber, templateId, map);
|
||||||
SmsResponse smsResponse = smsBlend.sendMessage(phonenumber, map);
|
|
||||||
if (!smsResponse.isSuccess()) {
|
if (!smsResponse.isSuccess()) {
|
||||||
log.error("验证码短信发送异常 => {}", smsResponse);
|
log.error("验证码短信发送异常 => {}", smsResponse);
|
||||||
return R.fail(smsResponse.getData().toString());
|
return R.fail(smsResponse.getData().toString());
|
||||||
|
@ -17,11 +17,6 @@ public interface GlobalConstants {
|
|||||||
*/
|
*/
|
||||||
String CAPTCHA_CODE_KEY = GLOBAL_REDIS_KEY + "captcha_codes:";
|
String CAPTCHA_CODE_KEY = GLOBAL_REDIS_KEY + "captcha_codes:";
|
||||||
|
|
||||||
/**
|
|
||||||
* 设备分享验证码 redis key
|
|
||||||
*/
|
|
||||||
String DEVICE_SHARE_CODES_KEY = GLOBAL_REDIS_KEY + "device_share_codes:";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 防重提交 redis key
|
* 防重提交 redis key
|
||||||
*/
|
*/
|
||||||
|
@ -17,8 +17,8 @@ public class TestSMSController {
|
|||||||
public void testSend() {
|
public void testSend() {
|
||||||
// 在创建完SmsBlend实例后,再未手动调用注销的情况下框架会持有该实例,可以直接通过指定configId来获取想要的配置,如果你想使用
|
// 在创建完SmsBlend实例后,再未手动调用注销的情况下框架会持有该实例,可以直接通过指定configId来获取想要的配置,如果你想使用
|
||||||
// 负载均衡形式获取实例,只要使用getSmsBlend的无参重载方法即可,如果你仅有一个配置,也可以使用该方法
|
// 负载均衡形式获取实例,只要使用getSmsBlend的无参重载方法即可,如果你仅有一个配置,也可以使用该方法
|
||||||
SmsBlend smsBlend = SmsFactory.getSmsBlend("config1");
|
SmsBlend smsBlend = SmsFactory.getSmsBlend("alibaba");
|
||||||
SmsResponse smsResponse = smsBlend.sendMessage("18656573389", "1234");
|
SmsResponse smsResponse = smsBlend.sendMessage("18656573389", "123");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -1,105 +0,0 @@
|
|||||||
//package com.fuyuanshen.app.controller;
|
|
||||||
//
|
|
||||||
//import java.util.List;
|
|
||||||
//
|
|
||||||
//import lombok.RequiredArgsConstructor;
|
|
||||||
//import jakarta.servlet.http.HttpServletResponse;
|
|
||||||
//import jakarta.validation.constraints.*;
|
|
||||||
//import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
||||||
//import org.springframework.web.bind.annotation.*;
|
|
||||||
//import org.springframework.validation.annotation.Validated;
|
|
||||||
//import com.fuyuanshen.common.idempotent.annotation.RepeatSubmit;
|
|
||||||
//import com.fuyuanshen.common.log.annotation.Log;
|
|
||||||
//import com.fuyuanshen.common.web.core.BaseController;
|
|
||||||
//import com.fuyuanshen.common.mybatis.core.page.PageQuery;
|
|
||||||
//import com.fuyuanshen.common.core.domain.R;
|
|
||||||
//import com.fuyuanshen.common.core.validate.AddGroup;
|
|
||||||
//import com.fuyuanshen.common.core.validate.EditGroup;
|
|
||||||
//import com.fuyuanshen.common.log.enums.BusinessType;
|
|
||||||
//import com.fuyuanshen.common.excel.utils.ExcelUtil;
|
|
||||||
//import com.fuyuanshen.app.domain.vo.AppDeviceShareVo;
|
|
||||||
//import com.fuyuanshen.app.domain.bo.AppDeviceShareBo;
|
|
||||||
//import com.fuyuanshen.app.service.IAppDeviceShareService;
|
|
||||||
//import com.fuyuanshen.common.mybatis.core.page.TableDataInfo;
|
|
||||||
//
|
|
||||||
///**
|
|
||||||
// * 设备分享
|
|
||||||
// *
|
|
||||||
// * @author Lion Li
|
|
||||||
// * @date 2025-07-16
|
|
||||||
// */
|
|
||||||
//@Validated
|
|
||||||
//@RequiredArgsConstructor
|
|
||||||
//@RestController
|
|
||||||
//@RequestMapping("/app/deviceShare")
|
|
||||||
//public class AppDeviceShareController extends BaseController {
|
|
||||||
//
|
|
||||||
// private final IAppDeviceShareService appDeviceShareService;
|
|
||||||
//
|
|
||||||
// /**
|
|
||||||
// * 查询设备分享列表
|
|
||||||
// */
|
|
||||||
// @SaCheckPermission("app:deviceShare:list")
|
|
||||||
// @GetMapping("/list")
|
|
||||||
// public TableDataInfo<AppDeviceShareVo> list(AppDeviceShareBo bo, PageQuery pageQuery) {
|
|
||||||
// return appDeviceShareService.queryPageList(bo, pageQuery);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// /**
|
|
||||||
// * 导出设备分享列表
|
|
||||||
// */
|
|
||||||
// @SaCheckPermission("app:deviceShare:export")
|
|
||||||
// @Log(title = "设备分享", businessType = BusinessType.EXPORT)
|
|
||||||
// @PostMapping("/export")
|
|
||||||
// public void export(AppDeviceShareBo bo, HttpServletResponse response) {
|
|
||||||
// List<AppDeviceShareVo> list = appDeviceShareService.queryList(bo);
|
|
||||||
// ExcelUtil.exportExcel(list, "设备分享", AppDeviceShareVo.class, response);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// /**
|
|
||||||
// * 获取设备分享详细信息
|
|
||||||
// *
|
|
||||||
// * @param id 主键
|
|
||||||
// */
|
|
||||||
// @SaCheckPermission("app:deviceShare:query")
|
|
||||||
// @GetMapping("/{id}")
|
|
||||||
// public R<AppDeviceShareVo> getInfo(@NotNull(message = "主键不能为空")
|
|
||||||
// @PathVariable Long id) {
|
|
||||||
// return R.ok(appDeviceShareService.queryById(id));
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// /**
|
|
||||||
// * 新增设备分享
|
|
||||||
// */
|
|
||||||
// @SaCheckPermission("app:deviceShare:add")
|
|
||||||
// @Log(title = "设备分享", businessType = BusinessType.INSERT)
|
|
||||||
// @RepeatSubmit()
|
|
||||||
// @PostMapping()
|
|
||||||
// public R<Void> add(@Validated(AddGroup.class) @RequestBody AppDeviceShareBo bo) {
|
|
||||||
// return toAjax(appDeviceShareService.insertByBo(bo));
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// /**
|
|
||||||
// * 修改设备分享
|
|
||||||
// */
|
|
||||||
// @SaCheckPermission("app:deviceShare:edit")
|
|
||||||
// @Log(title = "设备分享", businessType = BusinessType.UPDATE)
|
|
||||||
// @RepeatSubmit()
|
|
||||||
// @PutMapping()
|
|
||||||
// public R<Void> edit(@Validated(EditGroup.class) @RequestBody AppDeviceShareBo bo) {
|
|
||||||
// return toAjax(appDeviceShareService.updateByBo(bo));
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// /**
|
|
||||||
// * 删除设备分享
|
|
||||||
// *
|
|
||||||
// * @param ids 主键串
|
|
||||||
// */
|
|
||||||
// @SaCheckPermission("app:deviceShare:remove")
|
|
||||||
// @Log(title = "设备分享", businessType = BusinessType.DELETE)
|
|
||||||
// @DeleteMapping("/{ids}")
|
|
||||||
// public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
|
||||||
// @PathVariable Long[] ids) {
|
|
||||||
// return toAjax(appDeviceShareService.deleteWithValidByIds(List.of(ids), true));
|
|
||||||
// }
|
|
||||||
//}
|
|
@ -3,6 +3,7 @@ package com.fuyuanshen.app.controller.equipment;
|
|||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.fuyuanshen.app.domain.APPDevice;
|
import com.fuyuanshen.app.domain.APPDevice;
|
||||||
import com.fuyuanshen.app.domain.APPDeviceType;
|
import com.fuyuanshen.app.domain.APPDeviceType;
|
||||||
|
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.R;
|
||||||
|
@ -1,51 +0,0 @@
|
|||||||
package com.fuyuanshen.app.domain;
|
|
||||||
|
|
||||||
import com.fuyuanshen.common.tenant.core.TenantEntity;
|
|
||||||
import com.baomidou.mybatisplus.annotation.*;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
|
|
||||||
import java.io.Serial;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 设备分享对象 app_device_share
|
|
||||||
*
|
|
||||||
* @author Lion Li
|
|
||||||
* @date 2025-07-16
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
|
||||||
@TableName("app_device_share")
|
|
||||||
public class AppDeviceShare extends TenantEntity {
|
|
||||||
|
|
||||||
@Serial
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 主键id
|
|
||||||
*/
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 设备ID
|
|
||||||
*/
|
|
||||||
private Long deviceId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 手机号
|
|
||||||
*/
|
|
||||||
private String phonenumber;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 功能权限(1:灯光模式;2:激光模式;3:开机画面;4:人员信息登记;5:发送信息;6:产品信息)
|
|
||||||
以逗号分隔
|
|
||||||
*/
|
|
||||||
private String permission;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 备注
|
|
||||||
*/
|
|
||||||
private String remark;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
@ -36,6 +36,11 @@ public class AppPersonnelInfo extends TenantEntity {
|
|||||||
*/
|
*/
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门名称
|
||||||
|
*/
|
||||||
|
private String deptName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 单位名称
|
* 单位名称
|
||||||
*/
|
*/
|
||||||
|
@ -1,49 +0,0 @@
|
|||||||
package com.fuyuanshen.app.domain.bo;
|
|
||||||
|
|
||||||
import com.fuyuanshen.app.domain.AppDeviceShare;
|
|
||||||
import com.fuyuanshen.common.mybatis.core.domain.BaseEntity;
|
|
||||||
import io.github.linpeilie.annotations.AutoMapper;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
import jakarta.validation.constraints.*;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 设备分享业务对象 app_device_share
|
|
||||||
*
|
|
||||||
* @author Lion Li
|
|
||||||
* @date 2025-07-16
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
|
||||||
@AutoMapper(target = AppDeviceShare.class, reverseConvertGenerate = false)
|
|
||||||
public class AppDeviceShareBo extends BaseEntity {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 主键id
|
|
||||||
*/
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 设备ID
|
|
||||||
*/
|
|
||||||
private Long deviceId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 手机号
|
|
||||||
*/
|
|
||||||
private String phonenumber;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 功能权限(1:灯光模式;2:激光模式;3:开机画面;4:人员信息登记;5:发送信息;6:产品信息)
|
|
||||||
以逗号分隔
|
|
||||||
*/
|
|
||||||
private String permission;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 备注
|
|
||||||
*/
|
|
||||||
private String remark;
|
|
||||||
|
|
||||||
|
|
||||||
private String smsCode;
|
|
||||||
}
|
|
@ -1,72 +0,0 @@
|
|||||||
package com.fuyuanshen.app.domain.vo;
|
|
||||||
|
|
||||||
import cn.idev.excel.annotation.ExcelProperty;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.io.Serial;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
public class AppDeviceDetailVo {
|
|
||||||
@Serial
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 设备ID
|
|
||||||
*/
|
|
||||||
@ExcelProperty(value = "设备ID")
|
|
||||||
private Long deviceId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 手机号
|
|
||||||
*/
|
|
||||||
@ExcelProperty(value = "手机号")
|
|
||||||
private String phonenumber;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 设备名称
|
|
||||||
*/
|
|
||||||
private String deviceName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 设备IMEI
|
|
||||||
*/
|
|
||||||
private String deviceImei;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 设备MAC
|
|
||||||
*/
|
|
||||||
private String deviceMac;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通讯方式 0:4G;1:蓝牙
|
|
||||||
*/
|
|
||||||
private Integer communicationMode;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 设备图片
|
|
||||||
*/
|
|
||||||
private String devicePic;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 设备类型
|
|
||||||
*/
|
|
||||||
private String typeName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 蓝牙名称
|
|
||||||
*/
|
|
||||||
private String bluetoothName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 设备状态
|
|
||||||
* 0 失效
|
|
||||||
* 1 正常
|
|
||||||
*/
|
|
||||||
private Integer deviceStatus;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 人员信息
|
|
||||||
*/
|
|
||||||
private AppPersonnelInfoVo personnelInfo;
|
|
||||||
}
|
|
@ -1,107 +0,0 @@
|
|||||||
package com.fuyuanshen.app.domain.vo;
|
|
||||||
|
|
||||||
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
|
||||||
import cn.idev.excel.annotation.ExcelProperty;
|
|
||||||
import com.fuyuanshen.app.domain.AppDeviceShare;
|
|
||||||
import com.fuyuanshen.common.excel.annotation.ExcelDictFormat;
|
|
||||||
import com.fuyuanshen.common.excel.convert.ExcelDictConvert;
|
|
||||||
import io.github.linpeilie.annotations.AutoMapper;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.io.Serial;
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 设备分享视图对象 app_device_share
|
|
||||||
*
|
|
||||||
* @author Lion Li
|
|
||||||
* @date 2025-07-16
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@ExcelIgnoreUnannotated
|
|
||||||
@AutoMapper(target = AppDeviceShare.class)
|
|
||||||
public class AppDeviceShareDetailVo implements Serializable {
|
|
||||||
|
|
||||||
@Serial
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 主键id
|
|
||||||
*/
|
|
||||||
@ExcelProperty(value = "主键id")
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 设备ID
|
|
||||||
*/
|
|
||||||
@ExcelProperty(value = "设备ID")
|
|
||||||
private Long deviceId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 手机号
|
|
||||||
*/
|
|
||||||
@ExcelProperty(value = "手机号")
|
|
||||||
private String phonenumber;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 功能权限(1:灯光模式;2:激光模式;3:开机画面;4:人员信息登记;5:发送信息;6:产品信息)
|
|
||||||
以逗号分隔
|
|
||||||
*/
|
|
||||||
@ExcelProperty(value = "功能权限", converter = ExcelDictConvert.class)
|
|
||||||
@ExcelDictFormat(readConverterExp = "1=:灯光模式;2:激光模式;3:开机画面;4:人员信息登记;5:发送信息;6:产品信息")
|
|
||||||
private String permission;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 设备名称
|
|
||||||
*/
|
|
||||||
private String deviceName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 设备IMEI
|
|
||||||
*/
|
|
||||||
private String deviceImei;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 设备MAC
|
|
||||||
*/
|
|
||||||
private String deviceMac;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通讯方式 0:4G;1:蓝牙
|
|
||||||
*/
|
|
||||||
private Integer communicationMode;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 设备图片
|
|
||||||
*/
|
|
||||||
private String devicePic;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 设备类型
|
|
||||||
*/
|
|
||||||
private String typeName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 蓝牙名称
|
|
||||||
*/
|
|
||||||
private String bluetoothName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 设备状态
|
|
||||||
* 0 失效
|
|
||||||
* 1 正常
|
|
||||||
*/
|
|
||||||
private Integer deviceStatus;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 人员信息
|
|
||||||
*/
|
|
||||||
private AppPersonnelInfoVo personnelInfo;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 发送信息
|
|
||||||
*/
|
|
||||||
private String sendMsg;
|
|
||||||
}
|
|
@ -1,72 +0,0 @@
|
|||||||
package com.fuyuanshen.app.domain.vo;
|
|
||||||
|
|
||||||
import com.fuyuanshen.app.domain.AppDeviceShare;
|
|
||||||
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 io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.io.Serial;
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 设备分享视图对象 app_device_share
|
|
||||||
*
|
|
||||||
* @author Lion Li
|
|
||||||
* @date 2025-07-16
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@ExcelIgnoreUnannotated
|
|
||||||
@AutoMapper(target = AppDeviceShare.class)
|
|
||||||
public class AppDeviceShareVo implements Serializable {
|
|
||||||
|
|
||||||
@Serial
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 主键id
|
|
||||||
*/
|
|
||||||
@ExcelProperty(value = "主键id")
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 设备ID
|
|
||||||
*/
|
|
||||||
@ExcelProperty(value = "设备ID")
|
|
||||||
private Long deviceId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 设备名称
|
|
||||||
*/
|
|
||||||
@ExcelProperty(value = "设备名称")
|
|
||||||
private String deviceName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 手机号
|
|
||||||
*/
|
|
||||||
@ExcelProperty(value = "手机号")
|
|
||||||
private String phonenumber;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 功能权限(1:灯光模式;2:激光模式;3:开机画面;4:人员信息登记;5:发送信息;6:产品信息)
|
|
||||||
以逗号分隔
|
|
||||||
*/
|
|
||||||
@ExcelProperty(value = "功能权限", converter = ExcelDictConvert.class)
|
|
||||||
@ExcelDictFormat(readConverterExp = "1=:灯光模式;2:激光模式;3:开机画面;4:人员信息登记;5:发送信息;6:产品信息")
|
|
||||||
private String permission;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 备注
|
|
||||||
*/
|
|
||||||
@ExcelProperty(value = "备注")
|
|
||||||
private String remark;
|
|
||||||
|
|
||||||
// 设备图片
|
|
||||||
private String devicePic;
|
|
||||||
}
|
|
@ -1,15 +0,0 @@
|
|||||||
package com.fuyuanshen.app.mapper;
|
|
||||||
|
|
||||||
import com.fuyuanshen.app.domain.AppDeviceShare;
|
|
||||||
import com.fuyuanshen.app.domain.vo.AppDeviceShareVo;
|
|
||||||
import com.fuyuanshen.common.mybatis.core.mapper.BaseMapperPlus;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 设备分享Mapper接口
|
|
||||||
*
|
|
||||||
* @author Lion Li
|
|
||||||
* @date 2025-07-16
|
|
||||||
*/
|
|
||||||
public interface AppDeviceShareMapper extends BaseMapperPlus<AppDeviceShare, AppDeviceShareVo> {
|
|
||||||
|
|
||||||
}
|
|
@ -1,68 +0,0 @@
|
|||||||
package com.fuyuanshen.app.service;
|
|
||||||
|
|
||||||
import com.fuyuanshen.app.domain.vo.AppDeviceShareVo;
|
|
||||||
import com.fuyuanshen.app.domain.bo.AppDeviceShareBo;
|
|
||||||
import com.fuyuanshen.common.mybatis.core.page.TableDataInfo;
|
|
||||||
import com.fuyuanshen.common.mybatis.core.page.PageQuery;
|
|
||||||
|
|
||||||
import java.util.Collection;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 设备分享Service接口
|
|
||||||
*
|
|
||||||
* @author Lion Li
|
|
||||||
* @date 2025-07-16
|
|
||||||
*/
|
|
||||||
public interface IAppDeviceShareService {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询设备分享
|
|
||||||
*
|
|
||||||
* @param id 主键
|
|
||||||
* @return 设备分享
|
|
||||||
*/
|
|
||||||
AppDeviceShareVo queryById(Long id);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询设备分享列表
|
|
||||||
*
|
|
||||||
* @param bo 查询条件
|
|
||||||
* @param pageQuery 分页参数
|
|
||||||
* @return 设备分享分页列表
|
|
||||||
*/
|
|
||||||
TableDataInfo<AppDeviceShareVo> queryPageList(AppDeviceShareBo bo, PageQuery pageQuery);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询符合条件的设备分享列表
|
|
||||||
*
|
|
||||||
* @param bo 查询条件
|
|
||||||
* @return 设备分享列表
|
|
||||||
*/
|
|
||||||
List<AppDeviceShareVo> queryList(AppDeviceShareBo bo);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增设备分享
|
|
||||||
*
|
|
||||||
* @param bo 设备分享
|
|
||||||
* @return 是否新增成功
|
|
||||||
*/
|
|
||||||
Boolean insertByBo(AppDeviceShareBo bo);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改设备分享
|
|
||||||
*
|
|
||||||
* @param bo 设备分享
|
|
||||||
* @return 是否修改成功
|
|
||||||
*/
|
|
||||||
Boolean updateByBo(AppDeviceShareBo bo);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 校验并批量删除设备分享信息
|
|
||||||
*
|
|
||||||
* @param ids 待删除的主键集合
|
|
||||||
* @param isValid 是否进行有效性校验
|
|
||||||
* @return 是否删除成功
|
|
||||||
*/
|
|
||||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
|
||||||
}
|
|
@ -4,7 +4,6 @@ import com.fuyuanshen.app.domain.vo.AppPersonnelInfoVo;
|
|||||||
import com.fuyuanshen.app.domain.bo.AppPersonnelInfoBo;
|
import com.fuyuanshen.app.domain.bo.AppPersonnelInfoBo;
|
||||||
import com.fuyuanshen.common.mybatis.core.page.TableDataInfo;
|
import com.fuyuanshen.common.mybatis.core.page.TableDataInfo;
|
||||||
import com.fuyuanshen.common.mybatis.core.page.PageQuery;
|
import com.fuyuanshen.common.mybatis.core.page.PageQuery;
|
||||||
import com.fuyuanshen.equipment.domain.dto.AppDeviceBo;
|
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -66,6 +65,4 @@ public interface IAppPersonnelInfoService {
|
|||||||
* @return 是否删除成功
|
* @return 是否删除成功
|
||||||
*/
|
*/
|
||||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||||
|
|
||||||
boolean registerPersonInfo(AppPersonnelInfoBo bo);
|
|
||||||
}
|
}
|
||||||
|
@ -8,9 +8,7 @@ import com.fuyuanshen.app.domain.dto.APPReNameDTO;
|
|||||||
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.domain.vo.APPDeviceTypeVo;
|
import com.fuyuanshen.app.domain.vo.APPDeviceTypeVo;
|
||||||
import com.fuyuanshen.app.domain.vo.AppDeviceDetailVo;
|
|
||||||
import com.fuyuanshen.common.mybatis.core.page.TableDataInfo;
|
import com.fuyuanshen.common.mybatis.core.page.TableDataInfo;
|
||||||
import com.fuyuanshen.equipment.domain.dto.AppDeviceBo;
|
|
||||||
import com.fuyuanshen.equipment.domain.query.DeviceQueryCriteria;
|
import com.fuyuanshen.equipment.domain.query.DeviceQueryCriteria;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -75,5 +73,4 @@ public interface APPDeviceService extends IService<APPDevice> {
|
|||||||
TableDataInfo<APPDevice> queryAppDeviceList(DeviceQueryCriteria criteria);
|
TableDataInfo<APPDevice> queryAppDeviceList(DeviceQueryCriteria criteria);
|
||||||
|
|
||||||
|
|
||||||
int sendMessage(AppDeviceBo bo);
|
|
||||||
}
|
}
|
||||||
|
@ -1,149 +0,0 @@
|
|||||||
package com.fuyuanshen.app.service.impl;
|
|
||||||
|
|
||||||
import com.fuyuanshen.common.core.utils.MapstructUtils;
|
|
||||||
import com.fuyuanshen.common.core.utils.StringUtils;
|
|
||||||
import com.fuyuanshen.common.mybatis.core.page.TableDataInfo;
|
|
||||||
import com.fuyuanshen.common.mybatis.core.page.PageQuery;
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
||||||
import com.fuyuanshen.common.satoken.utils.AppLoginHelper;
|
|
||||||
import com.fuyuanshen.equipment.domain.Device;
|
|
||||||
import com.fuyuanshen.equipment.mapper.DeviceMapper;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import com.fuyuanshen.app.domain.bo.AppDeviceShareBo;
|
|
||||||
import com.fuyuanshen.app.domain.vo.AppDeviceShareVo;
|
|
||||||
import com.fuyuanshen.app.domain.AppDeviceShare;
|
|
||||||
import com.fuyuanshen.app.mapper.AppDeviceShareMapper;
|
|
||||||
import com.fuyuanshen.app.service.IAppDeviceShareService;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Collection;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 设备分享Service业务层处理
|
|
||||||
*
|
|
||||||
* @author Lion Li
|
|
||||||
* @date 2025-07-16
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
@Service
|
|
||||||
public class AppDeviceShareServiceImpl implements IAppDeviceShareService {
|
|
||||||
|
|
||||||
private final AppDeviceShareMapper baseMapper;
|
|
||||||
|
|
||||||
private final DeviceMapper deviceMapper;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询设备分享
|
|
||||||
*
|
|
||||||
* @param id 主键
|
|
||||||
* @return 设备分享
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public AppDeviceShareVo queryById(Long id){
|
|
||||||
return baseMapper.selectVoById(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询设备分享列表
|
|
||||||
*
|
|
||||||
* @param bo 查询条件
|
|
||||||
* @param pageQuery 分页参数
|
|
||||||
* @return 设备分享分页列表
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public TableDataInfo<AppDeviceShareVo> queryPageList(AppDeviceShareBo bo, PageQuery pageQuery) {
|
|
||||||
Long userId = AppLoginHelper.getUserId();
|
|
||||||
bo.setCreateBy(userId);
|
|
||||||
LambdaQueryWrapper<AppDeviceShare> lqw = buildQueryWrapper(bo);
|
|
||||||
Page<AppDeviceShareVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
|
||||||
List<AppDeviceShareVo> records = result.getRecords();
|
|
||||||
records.forEach(r -> {
|
|
||||||
Device device = deviceMapper.selectById(r.getDeviceId());
|
|
||||||
if(device != null){
|
|
||||||
r.setDevicePic(device.getDevicePic());
|
|
||||||
r.setDeviceName(device.getDeviceName());
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return TableDataInfo.build(result);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询符合条件的设备分享列表
|
|
||||||
*
|
|
||||||
* @param bo 查询条件
|
|
||||||
* @return 设备分享列表
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public List<AppDeviceShareVo> queryList(AppDeviceShareBo bo) {
|
|
||||||
LambdaQueryWrapper<AppDeviceShare> lqw = buildQueryWrapper(bo);
|
|
||||||
return baseMapper.selectVoList(lqw);
|
|
||||||
}
|
|
||||||
|
|
||||||
private LambdaQueryWrapper<AppDeviceShare> buildQueryWrapper(AppDeviceShareBo bo) {
|
|
||||||
Map<String, Object> params = bo.getParams();
|
|
||||||
LambdaQueryWrapper<AppDeviceShare> lqw = Wrappers.lambdaQuery();
|
|
||||||
lqw.eq(bo.getDeviceId() != null, AppDeviceShare::getDeviceId, bo.getDeviceId());
|
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getPhonenumber()), AppDeviceShare::getPhonenumber, bo.getPhonenumber());
|
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getPermission()), AppDeviceShare::getPermission, bo.getPermission());
|
|
||||||
lqw.eq(bo.getCreateBy()!=null, AppDeviceShare::getCreateBy, bo.getCreateBy());
|
|
||||||
return lqw;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增设备分享
|
|
||||||
*
|
|
||||||
* @param bo 设备分享
|
|
||||||
* @return 是否新增成功
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public Boolean insertByBo(AppDeviceShareBo bo) {
|
|
||||||
AppDeviceShare add = MapstructUtils.convert(bo, AppDeviceShare.class);
|
|
||||||
validEntityBeforeSave(add);
|
|
||||||
boolean flag = baseMapper.insert(add) > 0;
|
|
||||||
if (flag) {
|
|
||||||
bo.setId(add.getId());
|
|
||||||
}
|
|
||||||
return flag;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改设备分享
|
|
||||||
*
|
|
||||||
* @param bo 设备分享
|
|
||||||
* @return 是否修改成功
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public Boolean updateByBo(AppDeviceShareBo bo) {
|
|
||||||
AppDeviceShare update = MapstructUtils.convert(bo, AppDeviceShare.class);
|
|
||||||
validEntityBeforeSave(update);
|
|
||||||
return baseMapper.updateById(update) > 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 保存前的数据校验
|
|
||||||
*/
|
|
||||||
private void validEntityBeforeSave(AppDeviceShare entity){
|
|
||||||
//TODO 做一些数据校验,如唯一约束
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 校验并批量删除设备分享信息
|
|
||||||
*
|
|
||||||
* @param ids 待删除的主键集合
|
|
||||||
* @param isValid 是否进行有效性校验
|
|
||||||
* @return 是否删除成功
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
|
||||||
if(isValid){
|
|
||||||
//TODO 做一些业务上的校验,判断是否需要校验
|
|
||||||
}
|
|
||||||
return baseMapper.deleteByIds(ids) > 0;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,6 +1,5 @@
|
|||||||
package com.fuyuanshen.app.service.impl;
|
package com.fuyuanshen.app.service.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
||||||
import com.fuyuanshen.common.core.utils.MapstructUtils;
|
import com.fuyuanshen.common.core.utils.MapstructUtils;
|
||||||
import com.fuyuanshen.common.core.utils.StringUtils;
|
import com.fuyuanshen.common.core.utils.StringUtils;
|
||||||
import com.fuyuanshen.common.mybatis.core.page.TableDataInfo;
|
import com.fuyuanshen.common.mybatis.core.page.TableDataInfo;
|
||||||
@ -8,8 +7,6 @@ import com.fuyuanshen.common.mybatis.core.page.PageQuery;
|
|||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import com.fuyuanshen.equipment.domain.Device;
|
|
||||||
import com.fuyuanshen.equipment.domain.dto.AppDeviceBo;
|
|
||||||
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;
|
||||||
@ -78,6 +75,7 @@ public class AppPersonnelInfoServiceImpl implements IAppPersonnelInfoService {
|
|||||||
LambdaQueryWrapper<AppPersonnelInfo> lqw = Wrappers.lambdaQuery();
|
LambdaQueryWrapper<AppPersonnelInfo> lqw = Wrappers.lambdaQuery();
|
||||||
lqw.eq(bo.getDeviceId() != null, AppPersonnelInfo::getDeviceId, bo.getDeviceId());
|
lqw.eq(bo.getDeviceId() != null, AppPersonnelInfo::getDeviceId, bo.getDeviceId());
|
||||||
lqw.like(StringUtils.isNotBlank(bo.getName()), AppPersonnelInfo::getName, bo.getName());
|
lqw.like(StringUtils.isNotBlank(bo.getName()), AppPersonnelInfo::getName, bo.getName());
|
||||||
|
lqw.like(StringUtils.isNotBlank(bo.getDeptName()), AppPersonnelInfo::getDeptName, bo.getDeptName());
|
||||||
lqw.like(StringUtils.isNotBlank(bo.getUnitName()), AppPersonnelInfo::getUnitName, bo.getUnitName());
|
lqw.like(StringUtils.isNotBlank(bo.getUnitName()), AppPersonnelInfo::getUnitName, bo.getUnitName());
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getSendMsg()), AppPersonnelInfo::getSendMsg, bo.getSendMsg());
|
lqw.eq(StringUtils.isNotBlank(bo.getSendMsg()), AppPersonnelInfo::getSendMsg, bo.getSendMsg());
|
||||||
return lqw;
|
return lqw;
|
||||||
@ -134,13 +132,4 @@ public class AppPersonnelInfoServiceImpl implements IAppPersonnelInfoService {
|
|||||||
}
|
}
|
||||||
return baseMapper.deleteByIds(ids) > 0;
|
return baseMapper.deleteByIds(ids) > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean registerPersonInfo(AppPersonnelInfoBo bo) {
|
|
||||||
|
|
||||||
AppPersonnelInfo appPersonnelInfo = MapstructUtils.convert(bo, AppPersonnelInfo.class);
|
|
||||||
|
|
||||||
return baseMapper.insertOrUpdate(appPersonnelInfo);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -23,8 +23,8 @@ import com.fuyuanshen.common.satoken.utils.AppLoginHelper;
|
|||||||
import com.fuyuanshen.common.satoken.utils.LoginHelper;
|
import com.fuyuanshen.common.satoken.utils.LoginHelper;
|
||||||
import com.fuyuanshen.equipment.domain.Device;
|
import com.fuyuanshen.equipment.domain.Device;
|
||||||
import com.fuyuanshen.equipment.domain.DeviceType;
|
import com.fuyuanshen.equipment.domain.DeviceType;
|
||||||
import com.fuyuanshen.equipment.domain.dto.AppDeviceBo;
|
|
||||||
import com.fuyuanshen.equipment.domain.query.DeviceQueryCriteria;
|
import com.fuyuanshen.equipment.domain.query.DeviceQueryCriteria;
|
||||||
|
import com.fuyuanshen.equipment.domain.vo.AppDeviceVo;
|
||||||
import com.fuyuanshen.equipment.enums.BindingStatusEnum;
|
import com.fuyuanshen.equipment.enums.BindingStatusEnum;
|
||||||
import com.fuyuanshen.equipment.enums.CommunicationModeEnum;
|
import com.fuyuanshen.equipment.enums.CommunicationModeEnum;
|
||||||
import com.fuyuanshen.equipment.mapper.DeviceMapper;
|
import com.fuyuanshen.equipment.mapper.DeviceMapper;
|
||||||
@ -227,14 +227,5 @@ public class APPDeviceServiceImpl extends ServiceImpl<APPDeviceMapper, APPDevice
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public int sendMessage(AppDeviceBo bo) {
|
|
||||||
UpdateWrapper<Device> updateWrapper = new UpdateWrapper<>();
|
|
||||||
updateWrapper.eq("id", bo.getDeviceId())
|
|
||||||
.eq("binding_user_id", AppLoginHelper.getUserId())
|
|
||||||
.set("send_msg", bo.getSendMsg());
|
|
||||||
return deviceMapper.update(updateWrapper);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,7 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
|
||||||
<!DOCTYPE mapper
|
|
||||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
||||||
<mapper namespace="com.fuyuanshen.app.mapper.AppDeviceShareMapper">
|
|
||||||
|
|
||||||
</mapper>
|
|
@ -3,7 +3,6 @@ package com.fuyuanshen.customer.controller;
|
|||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import cn.hutool.crypto.digest.BCrypt;
|
import cn.hutool.crypto.digest.BCrypt;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
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.utils.StringUtils;
|
import com.fuyuanshen.common.core.utils.StringUtils;
|
||||||
import com.fuyuanshen.common.mybatis.core.page.TableDataInfo;
|
import com.fuyuanshen.common.mybatis.core.page.TableDataInfo;
|
||||||
@ -52,43 +51,43 @@ public class CustomerController {
|
|||||||
|
|
||||||
@GetMapping(value = "/allCustomer")
|
@GetMapping(value = "/allCustomer")
|
||||||
@Operation(summary = "查询所有客户")
|
@Operation(summary = "查询所有客户")
|
||||||
public R<List<Customer>> queryAllCustomer(UserQueryCriteria criteria) {
|
public ResponseVO<List<Customer>> queryAllCustomer(UserQueryCriteria criteria) {
|
||||||
List<Customer> customers = customerService.queryAllCustomers(criteria);
|
List<Customer> customers = customerService.queryAllCustomers(criteria);
|
||||||
return R.ok(customers);
|
return ResponseVO.success(customers);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// @Log("新增客户")
|
// @Log("新增客户")
|
||||||
@Operation(summary = "新增客户")
|
@Operation(summary = "新增客户")
|
||||||
@PostMapping(value = "/addCustomer")
|
@PostMapping(value = "/addCustomer")
|
||||||
public R<Void> addCustomer(@Validated @RequestBody Customer customer) throws BadRequestException {
|
public ResponseVO<Object> addCustomer(@Validated @RequestBody Customer customer) throws BadRequestException {
|
||||||
if (StringUtils.isBlank(customer.getPassword())) {
|
if (StringUtils.isBlank(customer.getPassword())) {
|
||||||
throw new BadRequestException("账号密码不能为空");
|
throw new BadRequestException("账号密码不能为空");
|
||||||
}
|
}
|
||||||
customer.setPassword(BCrypt.hashpw(customer.getPassword()));
|
customer.setPassword(BCrypt.hashpw(customer.getPassword()));
|
||||||
customerService.addCustomer(customer);
|
customerService.addCustomer(customer);
|
||||||
return R.ok();
|
return ResponseVO.success("新增客户成功!!!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// @Log("修改客户")
|
// @Log("修改客户")
|
||||||
@Operation(summary = "修改客户")
|
@Operation(summary = "修改客户")
|
||||||
@PutMapping(value = "updateCustomer")
|
@PutMapping(value = "updateCustomer")
|
||||||
public R<Void> updateCustomer(@RequestBody Customer resources) throws Exception {
|
public ResponseVO<Object> updateCustomer(@RequestBody Customer resources) throws Exception {
|
||||||
customerService.updateCustomer(resources);
|
customerService.updateCustomer(resources);
|
||||||
return R.ok();
|
return ResponseVO.success(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// @Log("删除客户")
|
// @Log("删除客户")
|
||||||
@Operation(summary = "删除客户")
|
@Operation(summary = "删除客户")
|
||||||
@DeleteMapping(value = "/deleteCustomer")
|
@DeleteMapping(value = "/deleteCustomer")
|
||||||
public R<Void> deleteCustomer(@RequestBody Set<Long> ids) throws BadRequestException {
|
public ResponseVO<Object> deleteCustomer(@RequestBody Set<Long> ids) throws BadRequestException {
|
||||||
if (CollectionUtil.isEmpty(ids)) {
|
if (CollectionUtil.isEmpty(ids)) {
|
||||||
throw new BadRequestException("请选择要删除的客户");
|
throw new BadRequestException("请选择要删除的客户");
|
||||||
}
|
}
|
||||||
customerService.delete(ids);
|
customerService.delete(ids);
|
||||||
return R.ok();
|
return ResponseVO.success(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -50,12 +50,6 @@ public class UserQueryCriteria extends BaseEntity {
|
|||||||
@Schema(name = "是否启用")
|
@Schema(name = "是否启用")
|
||||||
private Boolean enabled;
|
private Boolean enabled;
|
||||||
|
|
||||||
/**
|
|
||||||
* 帐号状态(0正常 1停用)
|
|
||||||
*/
|
|
||||||
@Schema(name = "帐号状态(0正常 1停用)")
|
|
||||||
private String status;
|
|
||||||
|
|
||||||
@Schema(name = "部门ID")
|
@Schema(name = "部门ID")
|
||||||
private Long deptId;
|
private Long deptId;
|
||||||
|
|
||||||
|
@ -58,12 +58,6 @@ public class ConsumerVo extends TenantEntity {
|
|||||||
@Schema(name = "是否启用")
|
@Schema(name = "是否启用")
|
||||||
private Boolean enabled;
|
private Boolean enabled;
|
||||||
|
|
||||||
/**
|
|
||||||
* 帐号状态(0正常 1停用)
|
|
||||||
*/
|
|
||||||
@Schema(name = "帐号状态(0正常 1停用)")
|
|
||||||
private String status;
|
|
||||||
|
|
||||||
@Schema(name = "是否为admin账号", hidden = true)
|
@Schema(name = "是否为admin账号", hidden = true)
|
||||||
private Boolean isAdmin = false;
|
private Boolean isAdmin = false;
|
||||||
|
|
||||||
|
@ -112,11 +112,6 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> i
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void updateCustomer(Customer resources) throws Exception {
|
public void updateCustomer(Customer resources) throws Exception {
|
||||||
if (resources.getEnabled()) {
|
|
||||||
resources.setStatus("0");
|
|
||||||
} else {
|
|
||||||
resources.setStatus("1");
|
|
||||||
}
|
|
||||||
saveOrUpdate(resources);
|
saveOrUpdate(resources);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -68,8 +68,8 @@
|
|||||||
<if test="criteria.id != null">
|
<if test="criteria.id != null">
|
||||||
and u1.user_id = #{criteria.id}
|
and u1.user_id = #{criteria.id}
|
||||||
</if>
|
</if>
|
||||||
<if test="criteria.status != null">
|
<if test="criteria.enabled != null">
|
||||||
and u.status = #{criteria.status}
|
and u1.enabled = #{criteria.enabled}
|
||||||
</if>
|
</if>
|
||||||
<if test="criteria.deptIds != null and criteria.deptIds.size() != 0">
|
<if test="criteria.deptIds != null and criteria.deptIds.size() != 0">
|
||||||
and u1.dept_id in
|
and u1.dept_id in
|
||||||
@ -94,7 +94,7 @@
|
|||||||
<!-- 分页查询客户 -->
|
<!-- 分页查询客户 -->
|
||||||
<select id="findCustomers" resultType="com.fuyuanshen.customer.domain.Customer">
|
<select id="findCustomers" resultType="com.fuyuanshen.customer.domain.Customer">
|
||||||
select
|
select
|
||||||
u.user_id as customerId, u.nick_name , u.user_name, u.enabled, u.create_time,u.status
|
u.user_id as customerId, u.nick_name , u.user_name, u.enabled, u.create_time
|
||||||
from sys_user u
|
from sys_user u
|
||||||
<where>
|
<where>
|
||||||
<if test="criteria.ids != null and !criteria.ids.isEmpty()">
|
<if test="criteria.ids != null and !criteria.ids.isEmpty()">
|
||||||
@ -109,8 +109,8 @@
|
|||||||
<if test="criteria.blurry != null and criteria.blurry.trim() != ''">
|
<if test="criteria.blurry != null and criteria.blurry.trim() != ''">
|
||||||
and u.nick_name like concat('%', TRIM(#{criteria.blurry}), '%')
|
and u.nick_name like concat('%', TRIM(#{criteria.blurry}), '%')
|
||||||
</if>
|
</if>
|
||||||
<if test="criteria.status != null">
|
<if test="criteria.enabled != null">
|
||||||
and u.status = #{criteria.status}
|
and u.enabled = #{criteria.enabled}
|
||||||
</if>
|
</if>
|
||||||
<if test="criteria.params.beginTime != null and criteria.params.endTime != null">
|
<if test="criteria.params.beginTime != null and criteria.params.endTime != null">
|
||||||
and u.create_time between #{criteria.params.beginTime} and #{criteria.params.endTime}
|
and u.create_time between #{criteria.params.beginTime} and #{criteria.params.endTime}
|
||||||
@ -139,8 +139,8 @@
|
|||||||
<if test="criteria.blurry != null and criteria.blurry.trim() != ''">
|
<if test="criteria.blurry != null and criteria.blurry.trim() != ''">
|
||||||
and u.nick_name like concat('%', TRIM(#{criteria.blurry}), '%')
|
and u.nick_name like concat('%', TRIM(#{criteria.blurry}), '%')
|
||||||
</if>
|
</if>
|
||||||
<if test="criteria.status != null">
|
<if test="criteria.enabled != null">
|
||||||
and u.status = #{criteria.status}
|
and u.enabled = #{criteria.enabled}
|
||||||
</if>
|
</if>
|
||||||
<if test="criteria.params.beginTime != null and criteria.params.endTime != null">
|
<if test="criteria.params.beginTime != null and criteria.params.endTime != null">
|
||||||
and u.create_time between #{criteria.params.beginTime} and #{criteria.params.endTime}
|
and u.create_time between #{criteria.params.beginTime} and #{criteria.params.endTime}
|
||||||
|
@ -103,11 +103,6 @@
|
|||||||
<artifactId>fys-common-websocket</artifactId>
|
<artifactId>fys-common-websocket</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.bytedeco</groupId>
|
|
||||||
<artifactId>javacv-platform</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
@ -1,244 +0,0 @@
|
|||||||
package com.fuyuanshen.demo.controller;
|
|
||||||
|
|
||||||
import cn.dev33.satoken.annotation.SaIgnore;
|
|
||||||
import com.fuyuanshen.common.core.domain.R;
|
|
||||||
import org.springframework.http.MediaType;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
|
||||||
|
|
||||||
import javax.imageio.ImageIO;
|
|
||||||
import java.awt.image.BufferedImage;
|
|
||||||
import java.io.ByteArrayOutputStream;
|
|
||||||
import java.io.File;
|
|
||||||
import java.nio.file.Files;
|
|
||||||
import java.util.Base64;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.concurrent.TimeUnit;
|
|
||||||
|
|
||||||
import org.bytedeco.javacv.FFmpegFrameGrabber;
|
|
||||||
import org.bytedeco.javacv.Frame;
|
|
||||||
import org.bytedeco.javacv.Java2DFrameUtils;
|
|
||||||
import org.springframework.http.ResponseEntity;
|
|
||||||
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/video")
|
|
||||||
public class VideoUploadController {
|
|
||||||
|
|
||||||
// 可配置项:建议从 application.yml 中读取
|
|
||||||
private static final int MAX_VIDEO_SIZE = 10 * 1024 * 1024; // 10 MB
|
|
||||||
private static final int FRAME_RATE = 15; // 每秒抽15帧
|
|
||||||
private static final int DURATION = 2; // 抽2秒
|
|
||||||
private static final int TOTAL_FRAMES = FRAME_RATE * DURATION;
|
|
||||||
private static final int WIDTH = 160;
|
|
||||||
private static final int HEIGHT = 80;
|
|
||||||
private static final char[] HEX_ARRAY = "0123456789ABCDEF".toCharArray();
|
|
||||||
|
|
||||||
@PostMapping(value = "/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
|
|
||||||
@SaIgnore
|
|
||||||
public R<List<String>> upload(@RequestParam("file") MultipartFile file) {
|
|
||||||
if (file == null || file.isEmpty()) {
|
|
||||||
return R.fail("上传文件不能为空");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!isVideo(file.getOriginalFilename())) {
|
|
||||||
return R.fail("只允许上传视频文件");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (file.getSize() > MAX_VIDEO_SIZE) {
|
|
||||||
return R.fail("视频大小不能超过10MB");
|
|
||||||
}
|
|
||||||
|
|
||||||
File tempFile = null;
|
|
||||||
try {
|
|
||||||
// 创建临时文件保存上传的视频
|
|
||||||
tempFile = createTempVideoFile(file);
|
|
||||||
|
|
||||||
|
|
||||||
List<BufferedImage> frames = extractFramesFromVideo(tempFile);
|
|
||||||
if (frames.isEmpty()) {
|
|
||||||
return R.fail("无法提取任何帧");
|
|
||||||
}
|
|
||||||
|
|
||||||
// ✅ 新增:保存帧为图片
|
|
||||||
//saveFramesToLocal(frames, "extracted_frame");
|
|
||||||
|
|
||||||
byte[] binaryData = convertFramesToRGB565(frames);
|
|
||||||
// String base64Data = Base64.getEncoder().encodeToString(binaryData);
|
|
||||||
//
|
|
||||||
// return R.ok(base64Data);
|
|
||||||
// 构造响应头
|
|
||||||
// 将二进制数据转为 Hex 字符串
|
|
||||||
// 转换为 Hex 字符串列表
|
|
||||||
List<String> hexList = bytesToHexList(binaryData);
|
|
||||||
|
|
||||||
return R.ok(hexList);
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
return R.fail("视频处理失败:" + e.getMessage());
|
|
||||||
} finally {
|
|
||||||
deleteTempFile(tempFile);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* rgb565 转 hex
|
|
||||||
*/
|
|
||||||
private List<String> bytesToHexList(byte[] bytes) {
|
|
||||||
List<String> hexList = new ArrayList<>();
|
|
||||||
for (byte b : bytes) {
|
|
||||||
int value = b & 0xFF;
|
|
||||||
char high = HEX_ARRAY[value >>> 4];
|
|
||||||
char low = HEX_ARRAY[value & 0x0F];
|
|
||||||
hexList.add(String.valueOf(high) + low);
|
|
||||||
}
|
|
||||||
return hexList;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建临时文件并保存上传的视频
|
|
||||||
*/
|
|
||||||
private File createTempVideoFile(MultipartFile file) throws Exception {
|
|
||||||
File tempFile = Files.createTempFile("upload-", ".mp4").toFile();
|
|
||||||
file.transferTo(tempFile);
|
|
||||||
return tempFile;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 从视频中按时间均匀提取指定数量的帧
|
|
||||||
*/
|
|
||||||
private List<BufferedImage> extractFramesFromVideo(File videoFile) throws Exception {
|
|
||||||
List<BufferedImage> frames = new ArrayList<>();
|
|
||||||
|
|
||||||
try (FFmpegFrameGrabber grabber = FFmpegFrameGrabber.createDefault(videoFile)) {
|
|
||||||
grabber.start();
|
|
||||||
|
|
||||||
// 获取视频总帧数和帧率
|
|
||||||
long totalFramesInVideo = grabber.getLengthInFrames();
|
|
||||||
int fps = (int) Math.round(grabber.getFrameRate());
|
|
||||||
if (fps <= 0) fps = 30;
|
|
||||||
|
|
||||||
double durationSeconds = (double) totalFramesInVideo / fps;
|
|
||||||
|
|
||||||
if (durationSeconds < DURATION) {
|
|
||||||
throw new IllegalArgumentException("视频太短,至少需要 " + DURATION + " 秒");
|
|
||||||
}
|
|
||||||
|
|
||||||
// 计算每帧之间的间隔(浮点以实现更精确跳转)
|
|
||||||
double frameInterval = (double) totalFramesInVideo / TOTAL_FRAMES;
|
|
||||||
|
|
||||||
for (int i = 0; i < TOTAL_FRAMES; i++) {
|
|
||||||
int targetFrameNumber = (int) Math.round(i * frameInterval);
|
|
||||||
|
|
||||||
// 避免设置无效帧号
|
|
||||||
if (targetFrameNumber >= totalFramesInVideo) {
|
|
||||||
throw new IllegalArgumentException("目标帧超出范围: " + targetFrameNumber + " ");
|
|
||||||
}
|
|
||||||
|
|
||||||
grabber.setFrameNumber(targetFrameNumber);
|
|
||||||
Frame frame = grabber.grab();
|
|
||||||
|
|
||||||
if (frame != null && frame.image != null) {
|
|
||||||
BufferedImage bufferedImage = Java2DFrameUtils.toBufferedImage(frame);
|
|
||||||
frames.add(cropImage(bufferedImage, WIDTH, HEIGHT));
|
|
||||||
} else {
|
|
||||||
throw new IllegalArgumentException("无法获取第 " + targetFrameNumber + "帧 ");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
grabber.stop();
|
|
||||||
}
|
|
||||||
|
|
||||||
return frames;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 将抽取的帧保存到本地,用于调试
|
|
||||||
*/
|
|
||||||
private void saveFramesToLocal(List<BufferedImage> frames, String prefix) {
|
|
||||||
// 指定输出目录
|
|
||||||
File outputDir = new File("output_frames");
|
|
||||||
if (!outputDir.exists()) {
|
|
||||||
outputDir.mkdirs();
|
|
||||||
}
|
|
||||||
|
|
||||||
int index = 0;
|
|
||||||
for (BufferedImage frame : frames) {
|
|
||||||
try {
|
|
||||||
File outputImage = new File(outputDir, prefix + "_" + (index++) + ".png");
|
|
||||||
ImageIO.write(frame, "png", outputImage);
|
|
||||||
System.out.println("保存帧图片成功: " + outputImage.getAbsolutePath());
|
|
||||||
} catch (Exception e) {
|
|
||||||
throw new IllegalArgumentException("保存帧图片失败 " + e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 将所有帧转换为 RGB565 格式字节数组
|
|
||||||
*/
|
|
||||||
private byte[] convertFramesToRGB565(List<BufferedImage> frames) throws Exception {
|
|
||||||
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
|
|
||||||
|
|
||||||
for (BufferedImage image : frames) {
|
|
||||||
byte[] rgb565Bytes = convertToRGB565(image);
|
|
||||||
byteArrayOutputStream.write(rgb565Bytes);
|
|
||||||
}
|
|
||||||
|
|
||||||
return byteArrayOutputStream.toByteArray();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 判断是否是支持的视频格式
|
|
||||||
*/
|
|
||||||
private boolean isVideo(String filename) {
|
|
||||||
String ext = filename.substring(filename.lastIndexOf('.')).toLowerCase();
|
|
||||||
return Arrays.asList(".mp4", ".avi", ".mov", ".mkv").contains(ext);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 裁剪图像到目标尺寸
|
|
||||||
*/
|
|
||||||
private BufferedImage cropImage(BufferedImage img, int targetWidth, int targetHeight) {
|
|
||||||
int w = Math.min(img.getWidth(), targetWidth);
|
|
||||||
int h = Math.min(img.getHeight(), targetHeight);
|
|
||||||
return img.getSubimage(0, 0, w, h);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 将 BufferedImage 转换为 RGB565 格式的字节数组
|
|
||||||
*/
|
|
||||||
private byte[] convertToRGB565(BufferedImage image) {
|
|
||||||
int width = image.getWidth();
|
|
||||||
int height = image.getHeight();
|
|
||||||
byte[] result = new byte[width * height * 2]; // RGB565: 2 bytes per pixel
|
|
||||||
int index = 0;
|
|
||||||
|
|
||||||
for (int y = 0; y < height; y++) {
|
|
||||||
for (int x = 0; x < width; x++) {
|
|
||||||
int rgb = image.getRGB(x, y);
|
|
||||||
int r = ((rgb >> 16) & 0xFF) >> 3;
|
|
||||||
int g = ((rgb >> 8) & 0xFF) >> 2;
|
|
||||||
int b = (rgb & 0xFF) >> 3;
|
|
||||||
short pixel = (short) ((r << 11) | (g << 5) | b);
|
|
||||||
|
|
||||||
result[index++] = (byte) (pixel >> 8); // High byte first
|
|
||||||
result[index++] = (byte) pixel;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除临时文件
|
|
||||||
*/
|
|
||||||
private void deleteTempFile(File file) {
|
|
||||||
if (file != null && file.exists()) {
|
|
||||||
if (!file.delete()) {
|
|
||||||
throw new IllegalArgumentException("无法删除临时文件: " + file.getAbsolutePath());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -4,13 +4,11 @@ package com.fuyuanshen.equipment.controller;
|
|||||||
import com.alibaba.excel.EasyExcel;
|
import com.alibaba.excel.EasyExcel;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.fuyuanshen.common.core.constant.ResponseMessageConstants;
|
import com.fuyuanshen.common.core.constant.ResponseMessageConstants;
|
||||||
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.domain.model.LoginUser;
|
import com.fuyuanshen.common.core.domain.model.LoginUser;
|
||||||
import com.fuyuanshen.common.core.utils.file.FileUtil;
|
import com.fuyuanshen.common.core.utils.file.FileUtil;
|
||||||
import com.fuyuanshen.common.mybatis.core.page.TableDataInfo;
|
import com.fuyuanshen.common.mybatis.core.page.TableDataInfo;
|
||||||
import com.fuyuanshen.common.satoken.utils.LoginHelper;
|
import com.fuyuanshen.common.satoken.utils.LoginHelper;
|
||||||
import com.fuyuanshen.common.web.core.BaseController;
|
|
||||||
import com.fuyuanshen.customer.mapper.CustomerMapper;
|
import com.fuyuanshen.customer.mapper.CustomerMapper;
|
||||||
import com.fuyuanshen.equipment.domain.Device;
|
import com.fuyuanshen.equipment.domain.Device;
|
||||||
import com.fuyuanshen.equipment.domain.dto.DeviceExcelImportDTO;
|
import com.fuyuanshen.equipment.domain.dto.DeviceExcelImportDTO;
|
||||||
@ -51,7 +49,7 @@ import java.util.List;
|
|||||||
@RestController
|
@RestController
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@RequestMapping("/api/device")
|
@RequestMapping("/api/device")
|
||||||
public class DeviceController extends BaseController {
|
public class DeviceController {
|
||||||
|
|
||||||
private final ISysOssService ossService;
|
private final ISysOssService ossService;
|
||||||
private final DeviceService deviceService;
|
private final DeviceService deviceService;
|
||||||
@ -74,106 +72,106 @@ public class DeviceController extends BaseController {
|
|||||||
// @Log("新增设备")
|
// @Log("新增设备")
|
||||||
@Operation(summary = "新增设备")
|
@Operation(summary = "新增设备")
|
||||||
@PostMapping(value = "/add")
|
@PostMapping(value = "/add")
|
||||||
public R<Void> addDevice(@Validated @ModelAttribute DeviceForm deviceForm) {
|
public ResponseVO<Object> addDevice(@Validated @ModelAttribute DeviceForm deviceForm) {
|
||||||
try {
|
try {
|
||||||
deviceService.addDevice(deviceForm);
|
deviceService.addDevice(deviceForm);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("addDevice error: " + e.getMessage());
|
log.error("addDevice error: " + e.getMessage());
|
||||||
return R.fail(e.getMessage());
|
return ResponseVO.fail(e.getMessage());
|
||||||
}
|
}
|
||||||
return R.ok();
|
return ResponseVO.success(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// @Log("修改设备")
|
// @Log("修改设备")
|
||||||
@Operation(summary = "修改设备")
|
@Operation(summary = "修改设备")
|
||||||
@PutMapping(value = "/update")
|
@PutMapping(value = "/update")
|
||||||
public R<Void> updateDevice(@Validated @ModelAttribute DeviceForm deviceForm) {
|
public ResponseVO<Object> updateDevice(@Validated @ModelAttribute DeviceForm deviceForm) {
|
||||||
try {
|
try {
|
||||||
deviceService.update(deviceForm);
|
deviceService.update(deviceForm);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
log.error("updateDevice error: " + e.getMessage());
|
log.error("updateDevice error: " + e.getMessage());
|
||||||
return R.fail(e.getMessage());
|
return ResponseVO.fail("出错了");
|
||||||
}
|
}
|
||||||
return R.ok();
|
return ResponseVO.success(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Operation(summary = "设备详情")
|
@Operation(summary = "设备详情")
|
||||||
@GetMapping(value = "/detail/{id}")
|
@GetMapping(value = "/detail/{id}")
|
||||||
public R<Device> getDevice(@PathVariable Long id) {
|
public ResponseVO<Object> getDevice(@PathVariable Long id) {
|
||||||
Device device = deviceService.getById(id);
|
Device device = deviceService.getById(id);
|
||||||
return R.ok(device);
|
return ResponseVO.success(device);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// @Log("删除设备")
|
// @Log("删除设备")
|
||||||
@Operation(summary = "删除设备")
|
@Operation(summary = "删除设备")
|
||||||
@DeleteMapping(value = "/delete")
|
@DeleteMapping(value = "/delete")
|
||||||
public R<Void> deleteDevice(@Parameter(name = "传ID数组[]") @RequestBody List<Long> ids) {
|
public ResponseVO<Object> deleteDevice(@Parameter(name = "传ID数组[]") @RequestBody List<Long> ids) {
|
||||||
deviceService.deleteAll(ids);
|
deviceService.deleteAll(ids);
|
||||||
return R.ok();
|
return ResponseVO.success(ResponseMessageConstants.DELETE_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Operation(summary = "设备定位")
|
@Operation(summary = "设备定位")
|
||||||
@GetMapping(value = "/locateDevice")
|
@GetMapping(value = "/locateDevice")
|
||||||
public R<List<Device>> locateDevice(DeviceQueryCriteria criteria) throws IOException {
|
public ResponseVO<Object> locateDevice(DeviceQueryCriteria criteria) throws IOException {
|
||||||
List<Device> devices = deviceService.queryAllDevices(criteria);
|
List<Device> devices = deviceService.queryAllDevices(criteria);
|
||||||
return R.ok(devices);
|
return ResponseVO.success(devices);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// @Log("分配客户")
|
// @Log("分配客户")
|
||||||
@Operation(summary = "分配客户")
|
@Operation(summary = "分配客户")
|
||||||
@PutMapping(value = "/assignCustomer")
|
@PutMapping(value = "/assignCustomer")
|
||||||
public R<Void> assignCustomer(@Validated @RequestBody CustomerVo customerVo) {
|
public ResponseVO<Object> assignCustomer(@Validated @RequestBody CustomerVo customerVo) {
|
||||||
deviceService.assignCustomer(customerVo);
|
deviceService.assignCustomer(customerVo);
|
||||||
return R.ok();
|
return ResponseVO.success(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// @Log("撤回设备")
|
// @Log("撤回设备")
|
||||||
@Operation(summary = "撤回分配设备")
|
@Operation(summary = "撤回分配设备")
|
||||||
@PostMapping(value = "/withdraw")
|
@PostMapping(value = "/withdraw")
|
||||||
public R<Void> withdrawDevice(@RequestBody List<Long> ids) {
|
public ResponseVO<Object> withdrawDevice(@RequestBody List<Long> ids) {
|
||||||
try {
|
try {
|
||||||
deviceService.withdrawDevice(ids);
|
deviceService.withdrawDevice(ids);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("updateDevice error: " + e.getMessage());
|
log.error("updateDevice error: " + e.getMessage());
|
||||||
return R.fail(e.getMessage());
|
return ResponseVO.fail("出错了");
|
||||||
}
|
}
|
||||||
return R.ok();
|
return ResponseVO.success(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param id
|
* @param deviceForm
|
||||||
* @return
|
* @return
|
||||||
* @ModelAttribute 主要用于将请求参数绑定到 Java 对象上,它会从 HTTP 请求的查询参数(Query Parameters)
|
* @ModelAttribute 主要用于将请求参数绑定到 Java 对象上,它会从 HTTP 请求的查询参数(Query Parameters)
|
||||||
* 或表单数据(Form Data)中提取值,并自动填充到指定的对象属性中。
|
* 或表单数据(Form Data)中提取值,并自动填充到指定的对象属性中。
|
||||||
*/
|
*/
|
||||||
// @Log("解绑设备")
|
// @Log("解绑设备")
|
||||||
@Operation(summary = "WEB端解绑设备")
|
@Operation(summary = "解绑设备")
|
||||||
@GetMapping(value = "/unbind")
|
@PostMapping(value = "/unbind")
|
||||||
public R<Void> unbindDevice(@Validated Long id) {
|
public ResponseVO<Object> unbindDevice(@Validated @ModelAttribute DeviceForm deviceForm) {
|
||||||
return toAjax(deviceService.webUnBindDevice(id));
|
deviceService.unbindDevice(deviceForm);
|
||||||
|
return ResponseVO.success("解绑成功!!!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Operation(summary = "导出数据设备")
|
@Operation(summary = "导出数据设备")
|
||||||
@GetMapping(value = "/download")
|
@GetMapping(value = "/download")
|
||||||
public R<Void> exportDevice(HttpServletResponse response, DeviceQueryCriteria criteria) throws IOException {
|
public void exportDevice(HttpServletResponse response, DeviceQueryCriteria criteria) throws IOException {
|
||||||
List<Device> devices = deviceService.queryAll(criteria);
|
List<Device> devices = deviceService.queryAll(criteria);
|
||||||
exportService.export(devices, response);
|
exportService.export(devices, response);
|
||||||
return R.ok();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Operation(summary = "导入设备数据")
|
@Operation(summary = "导入设备数据")
|
||||||
@PostMapping(value = "/import", consumes = "multipart/form-data")
|
@PostMapping(value = "/import", consumes = "multipart/form-data")
|
||||||
public R<ImportResult> importData(@Parameter(name = "文件", required = true) @RequestPart("file") MultipartFile file) throws BadRequestException {
|
public ResponseVO<ImportResult> importData(@Parameter(name = "文件", required = true) @RequestPart("file") MultipartFile file) throws BadRequestException {
|
||||||
|
|
||||||
String suffix = FileUtil.getExtensionName(file.getOriginalFilename());
|
String suffix = FileUtil.getExtensionName(file.getOriginalFilename());
|
||||||
if (!("xlsx".equalsIgnoreCase(suffix))) {
|
if (!("xlsx".equalsIgnoreCase(suffix))) {
|
||||||
@ -197,13 +195,13 @@ public class DeviceController extends BaseController {
|
|||||||
// 设置响应消息
|
// 设置响应消息
|
||||||
String message = String.format("成功导入 %d 条数据,失败 %d 条", result.getSuccessCount(), result.getFailureCount());
|
String message = String.format("成功导入 %d 条数据,失败 %d 条", result.getSuccessCount(), result.getFailureCount());
|
||||||
// 返回带有正确泛型的响应
|
// 返回带有正确泛型的响应
|
||||||
return R.ok(message, result);
|
return ResponseVO.<ImportResult>success(message, result);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("导入设备数据出错: {}", e.getMessage(), e);
|
log.error("导入设备数据出错: {}", e.getMessage(), e);
|
||||||
// 在异常情况下,设置默认结果
|
// 在异常情况下,设置默认结果
|
||||||
String errorMessage = String.format("导入失败: %s。成功 %d 条,失败 %d 条", e.getMessage(), result.getSuccessCount(), result.getFailureCount());
|
String errorMessage = String.format("导入失败: %s。成功 %d 条,失败 %d 条", e.getMessage(), result.getSuccessCount(), result.getFailureCount());
|
||||||
// 使用新方法确保类型正确
|
// 使用新方法确保类型正确
|
||||||
return R.fail(errorMessage, result);
|
return ResponseVO.<ImportResult>fail(errorMessage, result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
package com.fuyuanshen.equipment.controller;
|
package com.fuyuanshen.equipment.controller;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
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.mybatis.core.page.TableDataInfo;
|
import com.fuyuanshen.common.mybatis.core.page.TableDataInfo;
|
||||||
import com.fuyuanshen.equipment.domain.DeviceType;
|
import com.fuyuanshen.equipment.domain.DeviceType;
|
||||||
@ -41,45 +40,43 @@ public class DeviceTypeController {
|
|||||||
|
|
||||||
@GetMapping(value = "/all")
|
@GetMapping(value = "/all")
|
||||||
@Operation(summary = "查询所有设备类型")
|
@Operation(summary = "查询所有设备类型")
|
||||||
public R<List<DeviceType>> queryDeviceTypes() {
|
public ResponseVO<Object> queryDeviceTypes() {
|
||||||
List<DeviceType> deviceTypes = deviceTypeService.queryDeviceTypes();
|
List<DeviceType> deviceTypes = deviceTypeService.queryDeviceTypes();
|
||||||
return R.ok(deviceTypes);
|
return ResponseVO.success(deviceTypes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// @Log("新增设备类型")
|
// @Log("新增设备类型")
|
||||||
@Operation(summary = "新增设备类型")
|
@Operation(summary = "新增设备类型")
|
||||||
@PostMapping(value = "/add")
|
@PostMapping(value = "/add")
|
||||||
public R<Void> createDeviceType(@Validated @RequestBody DeviceType resources) {
|
public ResponseVO<Object> createDeviceType(@Validated @RequestBody DeviceType resources) {
|
||||||
deviceTypeService.create(resources);
|
deviceTypeService.create(resources);
|
||||||
return R.ok();
|
return ResponseVO.success(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// @Log("修改设备类型")
|
// @Log("修改设备类型")
|
||||||
@Operation(summary = "修改设备类型")
|
@Operation(summary = "修改设备类型")
|
||||||
@PutMapping(value = "/update")
|
@PutMapping(value = "/update")
|
||||||
public R<Void> updateDeviceType(@Validated @RequestBody DeviceTypeForm resources) {
|
public ResponseVO<Object> updateDeviceType(@Validated @RequestBody DeviceTypeForm resources) {
|
||||||
deviceTypeService.update(resources);
|
deviceTypeService.update(resources);
|
||||||
return R.ok();
|
return ResponseVO.success(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// @Log("删除设备类型")
|
// @Log("删除设备类型")
|
||||||
@Operation(summary = "删除设备类型")
|
@Operation(summary = "删除设备类型")
|
||||||
@DeleteMapping(value = "/delete")
|
@DeleteMapping(value = "/delete")
|
||||||
public R<Void> deleteDeviceType(@Parameter(name = "传ID数组[]") @RequestBody List<Long> ids) {
|
public ResponseVO<Object> deleteDeviceType(@Parameter(name = "传ID数组[]") @RequestBody List<Long> ids) {
|
||||||
deviceTypeService.deleteAll(ids);
|
deviceTypeService.deleteAll(ids);
|
||||||
return R.ok();
|
return ResponseVO.success("删除成功!!!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@GetMapping(value = "/communicationMode")
|
@GetMapping(value = "/communicationMode")
|
||||||
@Operation(summary = "获取设备类型通讯方式")
|
@Operation(summary = "获取设备类型通讯方式")
|
||||||
public R<DeviceType> getCommunicationMode(@Parameter(name = "设备类型ID", required = true) Long id) {
|
public ResponseVO<DeviceType> getCommunicationMode(@Parameter(name = "设备类型ID", required = true) Long id) {
|
||||||
DeviceType communicationMode = deviceTypeService.getCommunicationMode(id);
|
return ResponseVO.success(deviceTypeService.getCommunicationMode(id));
|
||||||
return R.ok(communicationMode);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -21,9 +21,6 @@ import java.util.Date;
|
|||||||
@JsonInclude(JsonInclude.Include.ALWAYS) // 关键注解
|
@JsonInclude(JsonInclude.Include.ALWAYS) // 关键注解
|
||||||
public class Device extends TenantEntity {
|
public class Device extends TenantEntity {
|
||||||
|
|
||||||
/**
|
|
||||||
* id
|
|
||||||
*/
|
|
||||||
@TableId(value = "id", type = IdType.AUTO)
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
@Schema(name = "ID")
|
@Schema(name = "ID")
|
||||||
private Long id;
|
private Long id;
|
||||||
@ -32,9 +29,6 @@ public class Device extends TenantEntity {
|
|||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private Long assignId;
|
private Long assignId;
|
||||||
|
|
||||||
/**
|
|
||||||
* device_type
|
|
||||||
*/
|
|
||||||
@Schema(name = "设备类型")
|
@Schema(name = "设备类型")
|
||||||
private Long deviceType;
|
private Long deviceType;
|
||||||
|
|
||||||
@ -106,6 +100,8 @@ public class Device extends TenantEntity {
|
|||||||
private Integer deviceStatus;
|
private Integer deviceStatus;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 绑定状态
|
* 绑定状态
|
||||||
* 0 未绑定
|
* 0 未绑定
|
||||||
@ -121,10 +117,5 @@ public class Device extends TenantEntity {
|
|||||||
|
|
||||||
private Long bindingUserId;
|
private Long bindingUserId;
|
||||||
|
|
||||||
/**
|
|
||||||
* 绑定时间
|
|
||||||
*/
|
|
||||||
private Date bindingTime;
|
private Date bindingTime;
|
||||||
|
|
||||||
private String sendMsg;
|
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,6 @@ public class DeviceAssignments extends TenantEntity {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 设备id
|
* 设备id
|
||||||
* device_id
|
|
||||||
*/
|
*/
|
||||||
private Long deviceId;
|
private Long deviceId;
|
||||||
|
|
||||||
@ -35,7 +34,7 @@ public class DeviceAssignments extends TenantEntity {
|
|||||||
private Long fromCustomerId;
|
private Long fromCustomerId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 接收方(当前设备所处位置)
|
* 接收方
|
||||||
*/
|
*/
|
||||||
private Long toCustomerId;
|
private Long toCustomerId;
|
||||||
|
|
||||||
|
@ -28,7 +28,4 @@ public class AppDeviceBo {
|
|||||||
@NotNull(message = "通讯方式不能为空", groups = { EditGroup.class })
|
@NotNull(message = "通讯方式不能为空", groups = { EditGroup.class })
|
||||||
private Integer communicationMode;
|
private Integer communicationMode;
|
||||||
|
|
||||||
private String sendMsg;
|
|
||||||
|
|
||||||
private String deviceId;
|
|
||||||
}
|
}
|
||||||
|
@ -58,9 +58,7 @@ public class DeviceExcelImportDTO {
|
|||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
@ExcelProperty("设备类型名称")
|
@ExcelProperty("设备类型名称")
|
||||||
|
@ColumnWidth(20)
|
||||||
private String typeName;
|
private String typeName;
|
||||||
|
|
||||||
@ExcelProperty("蓝牙名称")
|
|
||||||
private String bluetoothName;
|
|
||||||
|
|
||||||
}
|
}
|
@ -1,12 +1,10 @@
|
|||||||
package com.fuyuanshen.equipment.domain.vo;
|
package com.fuyuanshen.equipment.domain.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class AppDeviceVo implements Serializable {
|
public class AppDeviceVo {
|
||||||
|
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
@ -41,7 +39,7 @@ public class AppDeviceVo implements Serializable {
|
|||||||
private String typeName;
|
private String typeName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 蓝牙名称
|
* 蓝牙名称
|
||||||
*/
|
*/
|
||||||
private String bluetoothName;
|
private String bluetoothName;
|
||||||
|
|
||||||
@ -51,10 +49,4 @@ public class AppDeviceVo implements Serializable {
|
|||||||
* 1 正常
|
* 1 正常
|
||||||
*/
|
*/
|
||||||
private Integer deviceStatus;
|
private Integer deviceStatus;
|
||||||
|
|
||||||
/**
|
|
||||||
* 绑定时间
|
|
||||||
*/
|
|
||||||
private Date bindingTime;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -85,14 +85,6 @@ public interface DeviceService extends IService<Device> {
|
|||||||
*/
|
*/
|
||||||
void unbindDevice(DeviceForm deviceForm);
|
void unbindDevice(DeviceForm deviceForm);
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* WEB端查看APP客户设备绑定
|
|
||||||
*
|
|
||||||
* @param bo
|
|
||||||
* @param pageQuery
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
TableDataInfo<AppDeviceVo> queryAppDeviceList(DeviceQueryCriteria bo, PageQuery pageQuery);
|
TableDataInfo<AppDeviceVo> queryAppDeviceList(DeviceQueryCriteria bo, PageQuery pageQuery);
|
||||||
|
|
||||||
int bindDevice(AppDeviceBo bo);
|
int bindDevice(AppDeviceBo bo);
|
||||||
@ -106,12 +98,4 @@ public interface DeviceService extends IService<Device> {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
Boolean queryDevice(String mac);
|
Boolean queryDevice(String mac);
|
||||||
|
|
||||||
/**
|
|
||||||
* WEB端解绑设备
|
|
||||||
*
|
|
||||||
* @param id
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
int webUnBindDevice(Long id);
|
|
||||||
}
|
}
|
||||||
|
@ -44,6 +44,7 @@ import com.fuyuanshen.system.domain.vo.SysOssVo;
|
|||||||
import com.fuyuanshen.system.service.ISysOssService;
|
import com.fuyuanshen.system.service.ISysOssService;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.poi.ss.formula.functions.T;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
@ -100,12 +101,6 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme
|
|||||||
public TableDataInfo<Device> queryAll(DeviceQueryCriteria criteria, Page<Device> page) throws IOException {
|
public TableDataInfo<Device> queryAll(DeviceQueryCriteria criteria, Page<Device> page) throws IOException {
|
||||||
|
|
||||||
criteria.setCurrentOwnerId(LoginHelper.getUserId());
|
criteria.setCurrentOwnerId(LoginHelper.getUserId());
|
||||||
if (criteria.getDeviceType() != null) {
|
|
||||||
DeviceTypeGrants deviceTypeGrant = deviceTypeGrantsMapper.selectById(criteria.getDeviceType());
|
|
||||||
if (deviceTypeGrant != null) {
|
|
||||||
criteria.setDeviceType(deviceTypeGrant.getDeviceTypeId());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
IPage<Device> devices = deviceMapper.findAll(criteria, page);
|
IPage<Device> devices = deviceMapper.findAll(criteria, page);
|
||||||
|
|
||||||
List<Device> records = devices.getRecords();
|
List<Device> records = devices.getRecords();
|
||||||
@ -147,16 +142,6 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void addDevice(DeviceForm deviceForm) throws Exception {
|
public void addDevice(DeviceForm deviceForm) throws Exception {
|
||||||
|
|
||||||
Device device1 = deviceMapper.selectOne(new QueryWrapper<Device>().eq("device_mac", deviceForm.getDeviceMac()));
|
|
||||||
if (device1 != null) {
|
|
||||||
throw new BadRequestException("设备MAC已存在!!!");
|
|
||||||
}
|
|
||||||
Device device2 = deviceMapper.selectOne(new QueryWrapper<Device>().eq("device_imei", deviceForm.getDeviceImei()));
|
|
||||||
if (device2 != null) {
|
|
||||||
throw new BadRequestException("设备IMEI已存在!!!");
|
|
||||||
}
|
|
||||||
|
|
||||||
DeviceTypeQueryCriteria queryCriteria = new DeviceTypeQueryCriteria();
|
DeviceTypeQueryCriteria queryCriteria = new DeviceTypeQueryCriteria();
|
||||||
queryCriteria.setDeviceTypeId(deviceForm.getDeviceType());
|
queryCriteria.setDeviceTypeId(deviceForm.getDeviceType());
|
||||||
queryCriteria.setCustomerId(LoginHelper.getUserId());
|
queryCriteria.setCustomerId(LoginHelper.getUserId());
|
||||||
@ -335,9 +320,9 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme
|
|||||||
List<DeviceTypeGrants> deviceTypeGrants = new ArrayList<>();
|
List<DeviceTypeGrants> deviceTypeGrants = new ArrayList<>();
|
||||||
for (DeviceAssignments assignment : assignments) {
|
for (DeviceAssignments assignment : assignments) {
|
||||||
|
|
||||||
if (assignment.getToCustomerId() != null && assignment.getToCustomerId() != 0L) {
|
if (assignment.getToCustomerId() != null) {
|
||||||
log.info("设备已经分配客户!!!");
|
log.info("设备已经分配客户!!!");
|
||||||
throw new RuntimeException("设备已经分配客户!!!");
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
Device device = deviceMapper.selectById(assignment.getDeviceId());
|
Device device = deviceMapper.selectById(assignment.getDeviceId());
|
||||||
@ -428,6 +413,54 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 撤回设备
|
||||||
|
*
|
||||||
|
* @param ids
|
||||||
|
*/
|
||||||
|
// @Override
|
||||||
|
// public void withdrawDevice(List<Long> ids) {
|
||||||
|
// ids.forEach((id) -> {
|
||||||
|
// List<Device> deviceChain = getDeviceChain(id);
|
||||||
|
// deviceChain.forEach((device) -> {
|
||||||
|
// device.setDeviceStatus(DeviceStatusEnum.INVALID.getCode());
|
||||||
|
// deviceMapper.updateById(device);
|
||||||
|
// });
|
||||||
|
// });
|
||||||
|
//
|
||||||
|
// ids.forEach((id) -> {
|
||||||
|
// Device device = new Device();
|
||||||
|
// device.setId(id);
|
||||||
|
// device.setCustomerId(null);
|
||||||
|
// device.setCustomerName("");
|
||||||
|
// deviceMapper.updateById(device);
|
||||||
|
// });
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// public List<Device> getDeviceChain(Long originalDeviceId) {
|
||||||
|
// List<Device> chain = new ArrayList<>();
|
||||||
|
// Set<Long> visited = new HashSet<>(); // 防止循环引用
|
||||||
|
// findNext(chain, visited, originalDeviceId);
|
||||||
|
// return chain;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// private void findNext(List<Device> chain, Set<Long> visited, Long currentOriginalDeviceId) {
|
||||||
|
// if (visited.contains(currentOriginalDeviceId)) {
|
||||||
|
// log.info("检测到循环引用,终止递归");
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
// visited.add(currentOriginalDeviceId);
|
||||||
|
//
|
||||||
|
// List<Device> devices = deviceMapper.findByOriginalDeviceId(currentOriginalDeviceId);
|
||||||
|
// for (Device device : devices) {
|
||||||
|
// chain.add(device);
|
||||||
|
// findNext(chain, visited, device.getId());
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 撤回设备
|
* 撤回设备
|
||||||
*
|
*
|
||||||
@ -442,7 +475,7 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme
|
|||||||
Device device = deviceMapper.selectById(assignment.getDeviceId());
|
Device device = deviceMapper.selectById(assignment.getDeviceId());
|
||||||
// 接收者
|
// 接收者
|
||||||
assignment.setAssigneeName("");
|
assignment.setAssigneeName("");
|
||||||
assignment.setToCustomerId(0L);
|
assignment.setToCustomerId(null);
|
||||||
deviceAssignmentsMapper.updateById(assignment);
|
deviceAssignmentsMapper.updateById(assignment);
|
||||||
|
|
||||||
// 获取所有已分配的设备
|
// 获取所有已分配的设备
|
||||||
@ -470,13 +503,7 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* WEB端查看APP客户设备绑定
|
|
||||||
*
|
|
||||||
* @param bo
|
|
||||||
* @param pageQuery
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public TableDataInfo<AppDeviceVo> queryAppDeviceList(DeviceQueryCriteria bo, PageQuery pageQuery) {
|
public TableDataInfo<AppDeviceVo> queryAppDeviceList(DeviceQueryCriteria bo, PageQuery pageQuery) {
|
||||||
if (bo.getBindingUserId() == null) {
|
if (bo.getBindingUserId() == null) {
|
||||||
@ -553,22 +580,6 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* WEB端解绑设备
|
|
||||||
*
|
|
||||||
* @param id
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int webUnBindDevice(Long id) {
|
|
||||||
DeviceAssignments deviceAssignment = deviceAssignmentsMapper.selectById(id);
|
|
||||||
if (deviceAssignment == null) {
|
|
||||||
throw new RuntimeException("请先将设备入库!!!");
|
|
||||||
}
|
|
||||||
return unBindDevice(deviceAssignment.getDeviceId());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询设备MAC号
|
* 查询设备MAC号
|
||||||
*
|
*
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
package com.fuyuanshen.equipment.service.impl;
|
package com.fuyuanshen.equipment.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
@ -12,13 +10,11 @@ import com.fuyuanshen.common.core.utils.PageUtil;
|
|||||||
import com.fuyuanshen.common.mybatis.core.page.TableDataInfo;
|
import com.fuyuanshen.common.mybatis.core.page.TableDataInfo;
|
||||||
import com.fuyuanshen.common.satoken.utils.LoginHelper;
|
import com.fuyuanshen.common.satoken.utils.LoginHelper;
|
||||||
import com.fuyuanshen.equipment.domain.Device;
|
import com.fuyuanshen.equipment.domain.Device;
|
||||||
import com.fuyuanshen.equipment.domain.DeviceAssignments;
|
|
||||||
import com.fuyuanshen.equipment.domain.DeviceType;
|
import com.fuyuanshen.equipment.domain.DeviceType;
|
||||||
import com.fuyuanshen.equipment.domain.DeviceTypeGrants;
|
import com.fuyuanshen.equipment.domain.DeviceTypeGrants;
|
||||||
import com.fuyuanshen.equipment.domain.form.DeviceTypeForm;
|
import com.fuyuanshen.equipment.domain.form.DeviceTypeForm;
|
||||||
import com.fuyuanshen.equipment.domain.query.DeviceQueryCriteria;
|
import com.fuyuanshen.equipment.domain.query.DeviceQueryCriteria;
|
||||||
import com.fuyuanshen.equipment.domain.query.DeviceTypeQueryCriteria;
|
import com.fuyuanshen.equipment.domain.query.DeviceTypeQueryCriteria;
|
||||||
import com.fuyuanshen.equipment.mapper.DeviceAssignmentsMapper;
|
|
||||||
import com.fuyuanshen.equipment.mapper.DeviceMapper;
|
import com.fuyuanshen.equipment.mapper.DeviceMapper;
|
||||||
import com.fuyuanshen.equipment.mapper.DeviceTypeGrantsMapper;
|
import com.fuyuanshen.equipment.mapper.DeviceTypeGrantsMapper;
|
||||||
import com.fuyuanshen.equipment.mapper.DeviceTypeMapper;
|
import com.fuyuanshen.equipment.mapper.DeviceTypeMapper;
|
||||||
@ -45,7 +41,6 @@ public class DeviceTypeServiceImpl extends ServiceImpl<DeviceTypeMapper, DeviceT
|
|||||||
private final DeviceMapper deviceMapper;
|
private final DeviceMapper deviceMapper;
|
||||||
|
|
||||||
private final DeviceTypeGrantsMapper deviceTypeGrantsMapper;
|
private final DeviceTypeGrantsMapper deviceTypeGrantsMapper;
|
||||||
private final DeviceAssignmentsMapper deviceAssignmentsMapper;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -160,33 +155,30 @@ public class DeviceTypeServiceImpl extends ServiceImpl<DeviceTypeMapper, DeviceT
|
|||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void deleteAll(List<Long> ids) {
|
public void deleteAll(List<Long> ids) {
|
||||||
|
|
||||||
List<Long> deviceTypeId = new ArrayList<>();
|
|
||||||
|
|
||||||
for (Long id : ids) {
|
|
||||||
DeviceTypeGrants deviceTypeGrant = deviceTypeGrantsMapper.selectById(id);
|
|
||||||
|
|
||||||
// List<DeviceTypeGrants> deviceTypeGrants = deviceTypeGrantsMapper.selectList(new QueryWrapper<DeviceTypeGrants>()
|
|
||||||
// .eq("device_type_id", deviceTypeGrant.getDeviceTypeId()));
|
|
||||||
|
|
||||||
// List<DeviceTypeGrants> deviceAssignments = deviceTypeGrantsMapper.selectList(new QueryWrapper<DeviceTypeGrants>()
|
|
||||||
// .eq("device_id", deviceTypeGrant.getDeviceTypeId()));
|
|
||||||
|
|
||||||
// if (CollectionUtil.isNotEmpty(deviceAssignments)) {
|
|
||||||
// throw new RuntimeException("该设备类型已绑定设备,无法删除");
|
|
||||||
// }
|
|
||||||
// Device device = deviceMapper.selectById(deviceTypeGrant.getDeviceTypeId());
|
|
||||||
|
|
||||||
List<Device> devices = deviceMapper.selectList(new QueryWrapper<Device>()
|
|
||||||
.eq("device_type", deviceTypeGrant.getDeviceTypeId()));
|
|
||||||
if (CollectionUtil.isNotEmpty(devices)) {
|
|
||||||
throw new RuntimeException("该设备类型已绑定设备,无法删除!!!");
|
|
||||||
}
|
|
||||||
deviceTypeId.add(deviceTypeGrant.getDeviceTypeId());
|
|
||||||
}
|
|
||||||
|
|
||||||
deviceTypeGrantsMapper.deleteByIds(ids);
|
deviceTypeGrantsMapper.deleteByIds(ids);
|
||||||
deviceTypeMapper.deleteByIds(deviceTypeId);
|
//
|
||||||
|
// List<Long> invalidIds = new ArrayList<>();
|
||||||
|
// List<Long> invalidId2 = new ArrayList<>();
|
||||||
|
// for (Long id : ids) {
|
||||||
|
// DeviceType deviceType = deviceTypeMapper.selectById(id);
|
||||||
|
// if (deviceType == null || !Objects.equals(deviceType.getOwnerCustomerId(), LoginHelper.getUserId())) {
|
||||||
|
// invalidIds.add(id);
|
||||||
|
// }
|
||||||
|
// DeviceQueryCriteria deviceQueryCriteria = new DeviceQueryCriteria();
|
||||||
|
// deviceQueryCriteria.setDeviceType(id);
|
||||||
|
// List<Device> devices = deviceMapper.findAll(deviceQueryCriteria);
|
||||||
|
// if (!devices.isEmpty()) {
|
||||||
|
// invalidId2.add(id);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// if (!invalidIds.isEmpty()) {
|
||||||
|
// throw new RuntimeException("以下设备类型无法删除(ID 不存在或无权限): " + invalidIds);
|
||||||
|
// }
|
||||||
|
// if (!invalidId2.isEmpty()) {
|
||||||
|
// throw new RuntimeException("以下设备类型无法删除(已绑定设备): " + invalidId2);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// deviceTypeMapper.deleteByIds(ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -138,8 +138,7 @@
|
|||||||
d.device_pic,
|
d.device_pic,
|
||||||
dt.type_name,
|
dt.type_name,
|
||||||
dt.communication_mode,
|
dt.communication_mode,
|
||||||
d.bluetooth_name,
|
d.bluetooth_name
|
||||||
d.binding_time
|
|
||||||
from device d
|
from device d
|
||||||
inner join device_type dt on d.device_type = dt.id
|
inner join device_type dt on d.device_type = dt.id
|
||||||
where d.binding_user_id = #{criteria.bindingUserId}
|
where d.binding_user_id = #{criteria.bindingUserId}
|
||||||
|
24
pom.xml
24
pom.xml
@ -37,8 +37,6 @@
|
|||||||
<lombok.version>1.18.36</lombok.version>
|
<lombok.version>1.18.36</lombok.version>
|
||||||
<bouncycastle.version>1.80</bouncycastle.version>
|
<bouncycastle.version>1.80</bouncycastle.version>
|
||||||
<justauth.version>1.16.7</justauth.version>
|
<justauth.version>1.16.7</justauth.version>
|
||||||
|
|
||||||
<javacv-platform.version>1.5.7</javacv-platform.version>
|
|
||||||
<!-- 离线IP地址定位库 -->
|
<!-- 离线IP地址定位库 -->
|
||||||
<ip2region.version>2.7.0</ip2region.version>
|
<ip2region.version>2.7.0</ip2region.version>
|
||||||
|
|
||||||
@ -83,10 +81,10 @@
|
|||||||
<monitor.username>fys</monitor.username>
|
<monitor.username>fys</monitor.username>
|
||||||
<monitor.password>123456</monitor.password>
|
<monitor.password>123456</monitor.password>
|
||||||
</properties>
|
</properties>
|
||||||
<activation>
|
<!-- <activation> -->
|
||||||
<!-- 默认环境 -->
|
<!-- <!– 默认环境 –> -->
|
||||||
<activeByDefault>true</activeByDefault>
|
<!-- <activeByDefault>true</activeByDefault> -->
|
||||||
</activation>
|
<!-- </activation> -->
|
||||||
</profile>
|
</profile>
|
||||||
<profile>
|
<profile>
|
||||||
<id>prod</id>
|
<id>prod</id>
|
||||||
@ -96,10 +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> -->
|
<activation>
|
||||||
<!-- <!– 默认环境 –> -->
|
<!-- 默认环境 -->
|
||||||
<!-- <activeByDefault>true</activeByDefault> -->
|
<activeByDefault>true</activeByDefault>
|
||||||
<!-- </activation> -->
|
</activation>
|
||||||
</profile>
|
</profile>
|
||||||
</profiles>
|
</profiles>
|
||||||
|
|
||||||
@ -144,12 +142,6 @@
|
|||||||
<version>${justauth.version}</version>
|
<version>${justauth.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.bytedeco</groupId>
|
|
||||||
<artifactId>javacv-platform</artifactId>
|
|
||||||
<version>${javacv-platform.version}</version> <!-- 使用合适的版本号 -->
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- common 的依赖配置-->
|
<!-- common 的依赖配置-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.fuyuanshen</groupId>
|
<groupId>com.fuyuanshen</groupId>
|
||||||
|
Reference in New Issue
Block a user