feat(web): 新增设备联调中心功能
- 新增设备联调中心相关控制器、服务、DTO和VO - 实现设备列表查询、文件上传、操作视频添加、设备详情等功能 - 优化设备 logo 上传逻辑,支持批量上传 - 重构部分代码结构,提高可维护性
This commit is contained in:
@ -45,5 +45,10 @@ public class AppOperationVideoBo extends BaseEntity {
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 多设备id
|
||||
*/
|
||||
private Long[] deviceIds;
|
||||
|
||||
|
||||
}
|
||||
|
@ -19,6 +19,10 @@ public class AppFileVo {
|
||||
* 文件名称
|
||||
*/
|
||||
private String fileName;
|
||||
/**
|
||||
* 文件类型(1:操作说明,2:产品参数)
|
||||
*/
|
||||
private Long fileType;
|
||||
/**
|
||||
* 文件url
|
||||
*/
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.fuyuanshen.app.service;
|
||||
|
||||
import com.fuyuanshen.app.domain.AppBusinessFile;
|
||||
import com.fuyuanshen.app.domain.vo.AppBusinessFileVo;
|
||||
import com.fuyuanshen.app.domain.bo.AppBusinessFileBo;
|
||||
import com.fuyuanshen.app.domain.vo.AppFileVo;
|
||||
@ -50,6 +51,14 @@ public interface IAppBusinessFileService {
|
||||
*/
|
||||
Boolean insertByBo(AppBusinessFileBo bo);
|
||||
|
||||
/**
|
||||
* 批量新增app业务文件
|
||||
*
|
||||
* @param bo 批量新增app业务文件
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertBatch(Collection<AppBusinessFile> bo);
|
||||
|
||||
/**
|
||||
* 修改app业务文件
|
||||
*
|
||||
|
@ -1,5 +1,7 @@
|
||||
package com.fuyuanshen.app.service;
|
||||
|
||||
import com.fuyuanshen.app.domain.AppBusinessFile;
|
||||
import com.fuyuanshen.app.domain.AppOperationVideo;
|
||||
import com.fuyuanshen.app.domain.vo.AppOperationVideoVo;
|
||||
import com.fuyuanshen.app.domain.bo.AppOperationVideoBo;
|
||||
import com.fuyuanshen.common.mybatis.core.page.TableDataInfo;
|
||||
@ -49,6 +51,14 @@ public interface IAppOperationVideoService {
|
||||
*/
|
||||
Boolean insertByBo(AppOperationVideoBo bo);
|
||||
|
||||
/**
|
||||
* 批量新增操作视频
|
||||
*
|
||||
* @param bo 批量新增操作视频
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertBatch(Collection<AppOperationVideo> bo);
|
||||
|
||||
/**
|
||||
* 修改操作视频
|
||||
*
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.fuyuanshen.app.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.fuyuanshen.app.domain.vo.AppFileVo;
|
||||
import com.fuyuanshen.common.core.utils.MapstructUtils;
|
||||
import com.fuyuanshen.common.core.utils.StringUtils;
|
||||
@ -100,6 +101,20 @@ public class AppBusinessFileServiceImpl implements IAppBusinessFileService {
|
||||
return flag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean insertBatch(Collection<AppBusinessFile> bo) {
|
||||
// 1. 去重后的 businessId 集合
|
||||
List<Long> businessIds = bo.stream()
|
||||
.map(AppBusinessFile::getBusinessId)
|
||||
.distinct()
|
||||
.toList();
|
||||
QueryWrapper<AppBusinessFile> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.in("business_id", businessIds);
|
||||
queryWrapper.eq("file_type", bo.stream().findFirst().orElseThrow().getFileType());
|
||||
baseMapper.delete(queryWrapper);
|
||||
return baseMapper.insertBatch(bo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改app业务文件
|
||||
*
|
||||
|
@ -1,5 +1,7 @@
|
||||
package com.fuyuanshen.app.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.fuyuanshen.app.domain.AppBusinessFile;
|
||||
import com.fuyuanshen.common.core.utils.MapstructUtils;
|
||||
import com.fuyuanshen.common.core.utils.StringUtils;
|
||||
import com.fuyuanshen.common.mybatis.core.page.TableDataInfo;
|
||||
@ -97,6 +99,19 @@ public class AppOperationVideoServiceImpl implements IAppOperationVideoService {
|
||||
return flag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean insertBatch(Collection<AppOperationVideo> bo) {
|
||||
// 1. 去重后的 businessId 集合
|
||||
List<Long> deviceIds = bo.stream()
|
||||
.map(AppOperationVideo::getDeviceId)
|
||||
.distinct()
|
||||
.toList();
|
||||
QueryWrapper<AppOperationVideo> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.in("device_id", deviceIds);
|
||||
baseMapper.delete(queryWrapper);
|
||||
return baseMapper.insertBatch(bo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改操作视频
|
||||
*
|
||||
|
@ -5,7 +5,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<mapper namespace="com.fuyuanshen.app.mapper.AppBusinessFileMapper">
|
||||
|
||||
<select id="queryAppFileList" resultType="com.fuyuanshen.app.domain.vo.AppFileVo">
|
||||
select a.id,a.business_id,a.file_id,b.file_name,b.url fileUrl from app_business_file a left join sys_oss b on a.file_id = b.oss_id
|
||||
select a.id,a.business_id,a.file_id,a.file_type,b.file_name,b.url fileUrl from app_business_file a left join sys_oss b on a.file_id = b.oss_id
|
||||
where 1=1
|
||||
<if test="businessId != null">
|
||||
and a.business_id = #{businessId}
|
||||
|
Reference in New Issue
Block a user