forked from dyf/fys-Multi-tenant
feat(device): 新增设备类型查询与设备添加功能
- 在AppDeviceXinghanController中新增查询所有设备类型接口 - 实现新增设备功能,包含设备MAC和IMEI唯一性校验- 添加设备类型权限验证逻辑 - 完善设备绑定状态和主题设置 - 在DeviceXinghanBizService中实现设备分配记录保存 - 优化文件批量插入逻辑,支持是否批量删除历史数据- 增加文件删除功能,支持根据ID列表删除业务文件 - 缩短MQTT消息去重时间窗口至3秒 - 在设备维修记录查询条件中增加维修人员模糊查询- 调整设备消息发送数据顺序,单位名称移至首位
This commit is contained in:
@ -57,7 +57,7 @@ public interface IAppBusinessFileService {
|
||||
* @param bo 批量新增app业务文件
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertBatch(Collection<AppBusinessFile> bo);
|
||||
Boolean insertBatch(Collection<AppBusinessFile> bo,Boolean isBatch);
|
||||
|
||||
/**
|
||||
* 修改app业务文件
|
||||
|
||||
@ -102,16 +102,18 @@ public class AppBusinessFileServiceImpl implements IAppBusinessFileService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean insertBatch(Collection<AppBusinessFile> bo) {
|
||||
public Boolean insertBatch(Collection<AppBusinessFile> bo,Boolean isBatch) {
|
||||
// 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);
|
||||
if(isBatch){
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
@ -32,6 +32,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="criteria.repairPart != null">
|
||||
and dr.repair_part like concat('%', TRIM(#{criteria.repairPart}), '%')
|
||||
</if>
|
||||
<if test="criteria.repairPerson != null">
|
||||
and dr.repair_person like concat('%', TRIM(#{criteria.repairPerson}), '%')
|
||||
</if>
|
||||
<!-- 时间段条件 -->
|
||||
<if test="criteria.repairBeginTime != null">
|
||||
AND dr.repair_time <![CDATA[ >= ]]> #{criteria.repairBeginTime}
|
||||
|
||||
Reference in New Issue
Block a user