forked from dyf/fys-Multi-tenant
设备语音
This commit is contained in:
@ -0,0 +1,155 @@
|
||||
package com.fuyuanshen.app.controller.device.bjq;
|
||||
|
||||
import com.fuyuanshen.app.domain.bo.AppPersonnelInfoBo;
|
||||
import com.fuyuanshen.app.domain.dto.AppDeviceLogoUploadDto;
|
||||
import com.fuyuanshen.app.domain.dto.DeviceInstructDto;
|
||||
import com.fuyuanshen.app.domain.vo.AppDevice6075DetailVo;
|
||||
import com.fuyuanshen.common.core.domain.R;
|
||||
import com.fuyuanshen.common.core.validate.AddGroup;
|
||||
import com.fuyuanshen.common.ratelimiter.annotation.FunctionAccessAnnotation;
|
||||
import com.fuyuanshen.common.ratelimiter.annotation.FunctionAccessBatcAnnotation;
|
||||
import com.fuyuanshen.common.web.core.BaseController;
|
||||
import com.fuyuanshen.equipment.domain.dto.AppDeviceSendMsgBo;
|
||||
import com.fuyuanshen.web.service.device.DeviceBJQ6075BizService;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
/**
|
||||
* BJQ6331便携式工作灯
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/app/BJQ6331/device")
|
||||
public class AppDeviceBJQ6331Controller extends BaseController {
|
||||
|
||||
private final DeviceBJQ6075BizService appDeviceService6075;
|
||||
|
||||
|
||||
/**
|
||||
* 获取设备详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@GetMapping("/{id}")
|
||||
public R<AppDevice6075DetailVo> getInfo(@NotNull(message = "主键不能为空") @PathVariable Long id) {
|
||||
return R.ok(appDeviceService6075.getInfo(id));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 人员信息登记 1
|
||||
*/
|
||||
@PostMapping(value = "/registerPersonInfo")
|
||||
public R<Void> registerPersonInfo(@Validated(AddGroup.class) @RequestBody AppPersonnelInfoBo bo) {
|
||||
return toAjax(appDeviceService6075.registerPersonInfo(bo));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 发送信息 2
|
||||
*/
|
||||
@PostMapping(value = "/sendMessage")
|
||||
@FunctionAccessBatcAnnotation(value = "sendMessage", timeOut = 30, batchMaxTimeOut = 40)
|
||||
public R<Void> sendMessage(@RequestBody AppDeviceSendMsgBo bo) {
|
||||
return toAjax(appDeviceService6075.sendMessage(bo));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 发送报警信息 3
|
||||
*/
|
||||
@PostMapping(value = "/sendAlarmMessage")
|
||||
@FunctionAccessBatcAnnotation(value = "sendAlarmMessage", timeOut = 5, batchMaxTimeOut = 10)
|
||||
public R<Void> sendAlarmMessage(@RequestBody AppDeviceSendMsgBo bo) {
|
||||
return toAjax(appDeviceService6075.sendAlarmMessage(bo));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 上传设备logo图片 4
|
||||
*/
|
||||
@PostMapping("/uploadLogo")
|
||||
@FunctionAccessAnnotation("uploadLogo")
|
||||
public R<Void> upload(@Validated @ModelAttribute AppDeviceLogoUploadDto bo) {
|
||||
|
||||
MultipartFile file = bo.getFile();
|
||||
if (file.getSize() > 1024 * 1024 * 2) {
|
||||
return R.warn("图片不能大于2M");
|
||||
}
|
||||
appDeviceService6075.uploadDeviceLogo(bo);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 灯光模式 5
|
||||
* (主光模式)
|
||||
* 0(关闭灯光),1(强光),2(超强光), 3(工作光), 4(节能光),5(爆闪),6(SOS)
|
||||
*/
|
||||
@PostMapping("/lightModeSettings")
|
||||
public R<Void> lightModeSettings(@RequestBody DeviceInstructDto params) {
|
||||
appDeviceService6075.lightModeSettings(params);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 灯光模式 6
|
||||
* (辅光模式)
|
||||
* 0(关闭灯光),1(泛光),2(泛光爆闪), 3(警示灯), 4(警示灯/泛光)
|
||||
*/
|
||||
@PostMapping("/auxiliaryLightModeSettings")
|
||||
public R<Void> auxiliaryLightModeSettings(@RequestBody DeviceInstructDto params) {
|
||||
appDeviceService6075.lightModeSettings(params);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 灯光亮度设置 7
|
||||
*/
|
||||
@PostMapping("/lightBrightnessSettings")
|
||||
public R<Void> lightBrightnessSettings(@RequestBody DeviceInstructDto params) {
|
||||
appDeviceService6075.lightBrightnessSettings(params);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 激光模式设置 8
|
||||
*/
|
||||
@PostMapping("/laserModeSettings")
|
||||
public R<Void> laserModeSettings(@RequestBody DeviceInstructDto params) {
|
||||
appDeviceService6075.laserModeSettings(params);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 声光报警模式设置 9
|
||||
* Sound and light alarm
|
||||
*/
|
||||
@PostMapping("/salaModeSettings")
|
||||
public R<Void> salaModeSettings(@RequestBody DeviceInstructDto params) {
|
||||
appDeviceService6075.laserModeSettings(params);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取设备分享详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@GetMapping("/getShareInfo/{id}")
|
||||
public R<AppDevice6075DetailVo> getShareInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(appDeviceService6075.getInfo(id));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,156 @@
|
||||
package com.fuyuanshen.app.controller.device.bjq;
|
||||
|
||||
import com.fuyuanshen.app.domain.bo.AppPersonnelInfoBo;
|
||||
import com.fuyuanshen.app.domain.dto.AppDeviceLogoUploadDto;
|
||||
import com.fuyuanshen.app.domain.dto.DeviceInstructDto;
|
||||
import com.fuyuanshen.app.domain.vo.AppDevice6075DetailVo;
|
||||
import com.fuyuanshen.common.core.domain.R;
|
||||
import com.fuyuanshen.common.core.validate.AddGroup;
|
||||
import com.fuyuanshen.common.ratelimiter.annotation.FunctionAccessAnnotation;
|
||||
import com.fuyuanshen.common.ratelimiter.annotation.FunctionAccessBatcAnnotation;
|
||||
import com.fuyuanshen.common.web.core.BaseController;
|
||||
import com.fuyuanshen.equipment.domain.dto.AppDeviceSendMsgBo;
|
||||
import com.fuyuanshen.web.service.device.DeviceBJQ6075BizService;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
/**
|
||||
* HBY335(LED救生照明线)
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/app/HBY335/device")
|
||||
public class AppDeviceHBY335Controller extends BaseController {
|
||||
|
||||
private final DeviceBJQ6075BizService appDeviceService6075;
|
||||
|
||||
|
||||
/**
|
||||
* 获取设备详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@GetMapping("/{id}")
|
||||
public R<AppDevice6075DetailVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(appDeviceService6075.getInfo(id));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 人员信息登记 1
|
||||
*/
|
||||
@PostMapping(value = "/registerPersonInfo")
|
||||
public R<Void> registerPersonInfo(@Validated(AddGroup.class) @RequestBody AppPersonnelInfoBo bo) {
|
||||
return toAjax(appDeviceService6075.registerPersonInfo(bo));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 发送信息 2
|
||||
*/
|
||||
@PostMapping(value = "/sendMessage")
|
||||
@FunctionAccessBatcAnnotation(value = "sendMessage", timeOut = 30, batchMaxTimeOut = 40)
|
||||
public R<Void> sendMessage(@RequestBody AppDeviceSendMsgBo bo) {
|
||||
return toAjax(appDeviceService6075.sendMessage(bo));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 发送报警信息 3
|
||||
*/
|
||||
@PostMapping(value = "/sendAlarmMessage")
|
||||
@FunctionAccessBatcAnnotation(value = "sendAlarmMessage", timeOut = 5, batchMaxTimeOut = 10)
|
||||
public R<Void> sendAlarmMessage(@RequestBody AppDeviceSendMsgBo bo) {
|
||||
return toAjax(appDeviceService6075.sendAlarmMessage(bo));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 上传设备logo图片 4
|
||||
*/
|
||||
@PostMapping("/uploadLogo")
|
||||
@FunctionAccessAnnotation("uploadLogo")
|
||||
public R<Void> upload(@Validated @ModelAttribute AppDeviceLogoUploadDto bo) {
|
||||
|
||||
MultipartFile file = bo.getFile();
|
||||
if (file.getSize() > 1024 * 1024 * 2) {
|
||||
return R.warn("图片不能大于2M");
|
||||
}
|
||||
appDeviceService6075.uploadDeviceLogo(bo);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 灯光模式 5
|
||||
* (主光模式)
|
||||
* 0(关闭灯光),1(强光),2(超强光), 3(工作光), 4(节能光),5(爆闪),6(SOS)
|
||||
*/
|
||||
@PostMapping("/lightModeSettings")
|
||||
public R<Void> lightModeSettings(@RequestBody DeviceInstructDto params) {
|
||||
appDeviceService6075.lightModeSettings(params);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 灯光模式 6
|
||||
* (辅光模式)
|
||||
* 0(关闭灯光),1(泛光),2(泛光爆闪), 3(警示灯), 4(警示灯/泛光)
|
||||
*/
|
||||
@PostMapping("/auxiliaryLightModeSettings")
|
||||
public R<Void> auxiliaryLightModeSettings(@RequestBody DeviceInstructDto params) {
|
||||
appDeviceService6075.lightModeSettings(params);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 灯光亮度设置 7
|
||||
*/
|
||||
@PostMapping("/lightBrightnessSettings")
|
||||
public R<Void> lightBrightnessSettings(@RequestBody DeviceInstructDto params) {
|
||||
appDeviceService6075.lightBrightnessSettings(params);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 激光模式设置 8
|
||||
*/
|
||||
@PostMapping("/laserModeSettings")
|
||||
public R<Void> laserModeSettings(@RequestBody DeviceInstructDto params) {
|
||||
appDeviceService6075.laserModeSettings(params);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 声光报警模式设置 9
|
||||
* Sound and light alarm
|
||||
*/
|
||||
@PostMapping("/salaModeSettings")
|
||||
public R<Void> salaModeSettings(@RequestBody DeviceInstructDto params) {
|
||||
appDeviceService6075.laserModeSettings(params);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取设备分享详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@GetMapping("/getShareInfo/{id}")
|
||||
public R<AppDevice6075DetailVo> getShareInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(appDeviceService6075.getInfo(id));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -69,7 +69,6 @@ public interface DeviceBJQ6075BizService {
|
||||
*/
|
||||
public void recordDeviceLog(Long deviceId, String deviceName, String deviceAction, String content, Long operator);
|
||||
|
||||
|
||||
public boolean registerPersonInfo(AppPersonnelInfoBo bo);
|
||||
|
||||
public void uploadDeviceLogo2(AppDeviceLogoUploadDto bo);
|
||||
|
||||
@ -0,0 +1,78 @@
|
||||
package com.fuyuanshen.app.controller;
|
||||
|
||||
import com.fuyuanshen.app.domain.AppDeviceVoice;
|
||||
import com.fuyuanshen.app.domain.bo.AppDeviceVoiceBo;
|
||||
import com.fuyuanshen.app.service.IAppDeviceVoiceService;
|
||||
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.core.validate.QueryGroup;
|
||||
import com.fuyuanshen.common.web.core.BaseController;
|
||||
import com.fuyuanshen.common.mybatis.core.page.TableDataInfo;
|
||||
import com.fuyuanshen.common.mybatis.core.page.PageQuery;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 设备语音Controller
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-07-02
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/app/device/voice")
|
||||
public class AppDeviceVoiceController extends BaseController {
|
||||
|
||||
private final IAppDeviceVoiceService appDeviceVoiceService;
|
||||
|
||||
/**
|
||||
* 查询设备语音列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<AppDeviceVoice> list(AppDeviceVoiceBo bo, PageQuery pageQuery) {
|
||||
return appDeviceVoiceService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取设备语音详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@GetMapping("/{id}")
|
||||
public R<AppDeviceVoice> getInfo(@NotNull(message = "主键不能为空") @PathVariable Long id) {
|
||||
return R.ok(appDeviceVoiceService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增设备语音
|
||||
*/
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody AppDeviceVoiceBo bo) {
|
||||
return toAjax(appDeviceVoiceService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设备语音
|
||||
*/
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody AppDeviceVoiceBo bo) {
|
||||
return toAjax(appDeviceVoiceService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除设备语音
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotNull(message = "主键不能为空") @PathVariable Long[] ids) {
|
||||
return toAjax(appDeviceVoiceService.deleteWithValidByIds(Arrays.asList(ids), true));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,72 @@
|
||||
package com.fuyuanshen.app.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fuyuanshen.common.tenant.core.TenantEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 设备语音
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-07-02
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("app_device_voice")
|
||||
public class AppDeviceVoice extends TenantEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 视频名称
|
||||
*/
|
||||
private String videoName;
|
||||
|
||||
/**
|
||||
* 视频链接
|
||||
*/
|
||||
private String videoUrl;
|
||||
|
||||
/**
|
||||
* 设备di
|
||||
*/
|
||||
private Long deviceId;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 文件类型
|
||||
* audio/mp3, audio/wav 等
|
||||
*/
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 时长(秒)
|
||||
*/
|
||||
private Integer duration;
|
||||
|
||||
/**
|
||||
* 文件大小(字节)
|
||||
*/
|
||||
private Long size;
|
||||
|
||||
/**
|
||||
* 封面图URL
|
||||
*/
|
||||
private String cover;
|
||||
|
||||
}
|
||||
@ -0,0 +1,71 @@
|
||||
package com.fuyuanshen.app.domain.bo;
|
||||
|
||||
import com.fuyuanshen.common.core.validate.AddGroup;
|
||||
import com.fuyuanshen.common.core.validate.EditGroup;
|
||||
import com.fuyuanshen.common.mybatis.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* 设备语音业务对象 app_device_voice
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-07-02
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class AppDeviceVoiceBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@NotNull(message = "主键id不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 视频名称
|
||||
*/
|
||||
@NotBlank(message = "视频名称不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String videoName;
|
||||
|
||||
/**
|
||||
* 视频链接
|
||||
*/
|
||||
@NotBlank(message = "视频链接不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String videoUrl;
|
||||
|
||||
/**
|
||||
* 设备di
|
||||
*/
|
||||
@NotNull(message = "设备di不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long deviceId;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 文件类型
|
||||
* audio/mp3, audio/wav 等
|
||||
*/
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 时长(秒)
|
||||
*/
|
||||
private Integer duration;
|
||||
|
||||
/**
|
||||
* 文件大小(字节)
|
||||
*/
|
||||
private Long size;
|
||||
|
||||
/**
|
||||
* 封面图URL
|
||||
*/
|
||||
private String cover;
|
||||
|
||||
}
|
||||
@ -0,0 +1,32 @@
|
||||
package com.fuyuanshen.app.mapper;
|
||||
|
||||
import com.fuyuanshen.app.domain.AppDeviceVoice;
|
||||
import com.fuyuanshen.app.domain.bo.AppDeviceVoiceBo;
|
||||
import com.fuyuanshen.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
import com.fuyuanshen.common.mybatis.core.page.PageQuery;
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备语音Mapper接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-07-02
|
||||
*/
|
||||
public interface AppDeviceVoiceMapper extends BaseMapperPlus<AppDeviceVoice, AppDeviceVoice> {
|
||||
|
||||
/**
|
||||
* 分页查询设备语音列表
|
||||
*/
|
||||
Page<AppDeviceVoice> selectPage(AppDeviceVoiceBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询设备语音列表
|
||||
*/
|
||||
List<AppDeviceVoice> selectList(AppDeviceVoiceBo bo);
|
||||
|
||||
}
|
||||
@ -0,0 +1,48 @@
|
||||
package com.fuyuanshen.app.service;
|
||||
|
||||
import com.fuyuanshen.app.domain.AppDeviceVoice;
|
||||
import com.fuyuanshen.app.domain.bo.AppDeviceVoiceBo;
|
||||
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-02
|
||||
*/
|
||||
public interface IAppDeviceVoiceService {
|
||||
|
||||
/**
|
||||
* 查询设备语音
|
||||
*/
|
||||
AppDeviceVoice queryById(Long id);
|
||||
|
||||
/**
|
||||
* 查询设备语音列表
|
||||
*/
|
||||
TableDataInfo<AppDeviceVoice> queryPageList(AppDeviceVoiceBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询设备语音列表
|
||||
*/
|
||||
List<AppDeviceVoice> queryList(AppDeviceVoiceBo bo);
|
||||
|
||||
/**
|
||||
* 根据新增业务对象插入设备语音
|
||||
*/
|
||||
Boolean insertByBo(AppDeviceVoiceBo bo);
|
||||
|
||||
/**
|
||||
* 根据编辑业务对象更新设备语音
|
||||
*/
|
||||
Boolean updateByBo(AppDeviceVoiceBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除设备语音信息
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
@ -0,0 +1,101 @@
|
||||
package com.fuyuanshen.app.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fuyuanshen.app.domain.AppDeviceVoice;
|
||||
import com.fuyuanshen.app.domain.bo.AppDeviceVoiceBo;
|
||||
import com.fuyuanshen.app.mapper.AppDeviceVoiceMapper;
|
||||
import com.fuyuanshen.app.service.IAppDeviceVoiceService;
|
||||
import com.fuyuanshen.common.mybatis.core.page.TableDataInfo;
|
||||
import com.fuyuanshen.common.mybatis.core.page.PageQuery;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 设备语音Service业务层处理
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-07-02
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class AppDeviceVoiceServiceImpl implements IAppDeviceVoiceService {
|
||||
|
||||
private final AppDeviceVoiceMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询设备语音
|
||||
*/
|
||||
@Override
|
||||
public AppDeviceVoice queryById(Long id) {
|
||||
return baseMapper.selectById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询设备语音列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<AppDeviceVoice> queryPageList(AppDeviceVoiceBo bo, PageQuery pageQuery) {
|
||||
Page<AppDeviceVoice> page = baseMapper.selectPage(bo, pageQuery);
|
||||
return TableDataInfo.build(page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询设备语音列表
|
||||
*/
|
||||
@Override
|
||||
public List<AppDeviceVoice> queryList(AppDeviceVoiceBo bo) {
|
||||
return baseMapper.selectList(bo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据新增业务对象插入设备语音
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(AppDeviceVoiceBo bo) {
|
||||
AppDeviceVoice add = new AppDeviceVoice();
|
||||
add.setVideoName(bo.getVideoName());
|
||||
add.setVideoUrl(bo.getVideoUrl());
|
||||
add.setDeviceId(bo.getDeviceId());
|
||||
add.setRemark(bo.getRemark());
|
||||
add.setType(bo.getType());
|
||||
add.setDuration(bo.getDuration());
|
||||
add.setSize(bo.getSize());
|
||||
add.setCover(bo.getCover());
|
||||
return baseMapper.insert(add) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据编辑业务对象更新设备语音
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(AppDeviceVoiceBo bo) {
|
||||
AppDeviceVoice update = new AppDeviceVoice();
|
||||
update.setId(bo.getId());
|
||||
update.setVideoName(bo.getVideoName());
|
||||
update.setVideoUrl(bo.getVideoUrl());
|
||||
update.setDeviceId(bo.getDeviceId());
|
||||
update.setRemark(bo.getRemark());
|
||||
update.setType(bo.getType());
|
||||
update.setDuration(bo.getDuration());
|
||||
update.setSize(bo.getSize());
|
||||
update.setCover(bo.getCover());
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除设备语音信息
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if (ids == null || ids.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,57 @@
|
||||
<?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.AppDeviceVoiceMapper">
|
||||
|
||||
<resultMap type="com.fuyuanshen.app.domain.AppDeviceVoice" id="AppDeviceVoiceResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="videoName" column="video_name"/>
|
||||
<result property="videoUrl" column="video_url"/>
|
||||
<result property="deviceId" column="device_id"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="type" column="type"/>
|
||||
<result property="duration" column="duration"/>
|
||||
<result property="size" column="size"/>
|
||||
<result property="cover" column="cover"/>
|
||||
<result property="tenantId" column="tenant_id"/>
|
||||
<result property="createDept" column="create_dept"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectAppDeviceVoiceVo">
|
||||
select id, video_name, video_url, device_id, remark, type, duration, size, cover, tenant_id, create_dept, create_by, create_time, update_by, update_time from app_device_voice
|
||||
</sql>
|
||||
|
||||
<select id="selectPage" parameterType="com.fuyuanshen.app.domain.bo.AppDeviceVoiceBo" resultMap="AppDeviceVoiceResult">
|
||||
<include refid="selectAppDeviceVoiceVo"/>
|
||||
<where>
|
||||
<if test="videoName != null and videoName != ''"> and video_name like concat('%', #{videoName}, '%')</if>
|
||||
<if test="videoUrl != null and videoUrl != ''"> and video_url = #{videoUrl}</if>
|
||||
<if test="deviceId != null "> and device_id = #{deviceId}</if>
|
||||
<if test="type != null and type != ''"> and type = #{type}</if>
|
||||
<if test="duration != null "> and duration = #{duration}</if>
|
||||
<if test="size != null "> and size = #{size}</if>
|
||||
<if test="cover != null and cover != ''"> and cover = #{cover}</if>
|
||||
</where>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectList" parameterType="com.fuyuanshen.app.domain.bo.AppDeviceVoiceBo" resultMap="AppDeviceVoiceResult">
|
||||
<include refid="selectAppDeviceVoiceVo"/>
|
||||
<where>
|
||||
<if test="videoName != null and videoName != ''"> and video_name like concat('%', #{videoName}, '%')</if>
|
||||
<if test="videoUrl != null and videoUrl != ''"> and video_url = #{videoUrl}</if>
|
||||
<if test="deviceId != null "> and device_id = #{deviceId}</if>
|
||||
<if test="type != null and type != ''"> and type = #{type}</if>
|
||||
<if test="duration != null "> and duration = #{duration}</if>
|
||||
<if test="size != null "> and size = #{size}</if>
|
||||
<if test="cover != null and cover != ''"> and cover = #{cover}</if>
|
||||
</where>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user