Commit d9c57158 authored by maoying's avatar maoying

修改视频导入功能

parent 48968f59
...@@ -13,10 +13,10 @@ import java.io.Serializable; ...@@ -13,10 +13,10 @@ import java.io.Serializable;
*/ */
@Data @Data
public class VideoDownloadVO implements Serializable { public class VideoDownloadVO implements Serializable {
@ExcelProperty(value = "名称", index = 0) @ExcelProperty(value = "名称(必填)", index = 0)
private String name; private String name;
@ExcelProperty(value = "编号", index = 1) @ExcelProperty(value = "编号(必填)", index = 1)
private String code; private String code;
@ExcelProperty(value = "视频地址", index = 2) @ExcelProperty(value = "视频地址", index = 2)
...@@ -31,7 +31,7 @@ public class VideoDownloadVO implements Serializable { ...@@ -31,7 +31,7 @@ public class VideoDownloadVO implements Serializable {
@ExcelProperty(value = "关联消防设备编码(多个分号分隔)", index = 5) @ExcelProperty(value = "关联消防设备编码(多个分号分隔)", index = 5)
private String equipmentSpecificCodes; private String equipmentSpecificCodes;
@ExcelProperty(value = "详细地址", index = 6) @ExcelProperty(value = "详细地址(必填)", index = 6)
private String address; private String address;
@ExcelProperty(value = "备注", index = 7) @ExcelProperty(value = "备注", index = 7)
...@@ -40,7 +40,7 @@ public class VideoDownloadVO implements Serializable { ...@@ -40,7 +40,7 @@ public class VideoDownloadVO implements Serializable {
@ExcelProperty(value = "关联电力设备编码(多个分号分隔)", index = 8) @ExcelProperty(value = "关联电力设备编码(多个分号分隔)", index = 8)
private String importantEquipmentCodes; private String importantEquipmentCodes;
@ExcelProperty(value = "视频类型(枪机/球机)", index = 9) @ExcelProperty(value = "视频类型(枪机/球机)(必填)", index = 9)
private String type; private String type;
@ExcelProperty(value = "图片地址", index = 10) @ExcelProperty(value = "图片地址", index = 10)
......
...@@ -404,7 +404,7 @@ public class VideoServiceImpl extends ServiceImpl<VideoMapper, Video> implements ...@@ -404,7 +404,7 @@ public class VideoServiceImpl extends ServiceImpl<VideoMapper, Video> implements
VideoDownloadVO x = videoDownloadVOS.get(i); VideoDownloadVO x = videoDownloadVOS.get(i);
// 数据校验 // 数据校验
if (ValidationUtil.isEmpty(x.getName()) || ValidationUtil.isEmpty(x.getCode()) if (ValidationUtil.isEmpty(x.getName()) || ValidationUtil.isEmpty(x.getCode())
|| ValidationUtil.isEmpty(x.getUrl()) || ValidationUtil.isEmpty(x.getToken()) // || ValidationUtil.isEmpty(x.getUrl()) || ValidationUtil.isEmpty(x.getToken())
|| ValidationUtil.isEmpty(x.getAddress())) { || ValidationUtil.isEmpty(x.getAddress())) {
throw new RuntimeException("错误行" + rowNum + ":请检查非空字段"); throw new RuntimeException("错误行" + rowNum + ":请检查非空字段");
} }
...@@ -428,7 +428,7 @@ public class VideoServiceImpl extends ServiceImpl<VideoMapper, Video> implements ...@@ -428,7 +428,7 @@ public class VideoServiceImpl extends ServiceImpl<VideoMapper, Video> implements
video.setAddress(x.getAddress()); video.setAddress(x.getAddress());
video.setImg(x.getImg()); video.setImg(x.getImg());
video.setType(x.getType()); video.setType(x.getType());
video.setTypeCode(ObjectUtils.isEmpty(VideoTypeEnum.getCode(x.getType()))?VideoTypeEnum.getCode(x.getType()):""); video.setTypeCode(!ObjectUtils.isEmpty(VideoTypeEnum.getCode(x.getType()))?VideoTypeEnum.getCode(x.getType()):"");
videos.add(video); videos.add(video);
this.baseMapper.insert(video); this.baseMapper.insert(video);
// 处理监控和建筑关系 // 处理监控和建筑关系
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment