Merge branch 'main' of https://git.jsspisoft.com/ry-das
This commit is contained in:
commit
68ccaa5f1b
@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
@ -17,6 +19,7 @@ import java.util.Date;
|
||||
@AllArgsConstructor
|
||||
public class SysEquipmentDocs {
|
||||
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
|
@ -444,8 +444,8 @@ public class SysEquipmentServiceImpl implements SysEquipmentService {
|
||||
List<SysEquipmentDocs> collectDelete = sysEquipmentDocs.stream().filter(item -> !collect.contains(item.getId())).collect(Collectors.toList());
|
||||
//删除minio文件和数据库记录
|
||||
for (SysEquipmentDocs item : collectDelete){
|
||||
sysEquipmentDocsMapper.deleteById(item.getId());
|
||||
deleteFile(item);
|
||||
sysEquipmentDocsMapper.deleteById(item.getId());
|
||||
|
||||
}
|
||||
|
||||
@ -455,6 +455,16 @@ public class SysEquipmentServiceImpl implements SysEquipmentService {
|
||||
item.setDeviceId(sysGenExtPropsDto.getId());
|
||||
sysEquipmentDocsMapper.insert(item);
|
||||
}
|
||||
}else {
|
||||
QueryWrapper<SysEquipmentDocs> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("deviceid",sysGenExtPropsDto.getId());
|
||||
List<SysEquipmentDocs> sysEquipmentDocs = sysEquipmentDocsMapper.selectList(queryWrapper);
|
||||
if (CollectionUtils.isNotEmpty(sysEquipmentDocs)){
|
||||
for (SysEquipmentDocs item : sysEquipmentDocs){
|
||||
deleteFile(item);
|
||||
sysEquipmentDocsMapper.deleteById(item.getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
QueryWrapper<SysEquipmentDocs> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("deviceid",sysGenExtPropsDto.getId());
|
||||
@ -550,7 +560,6 @@ public class SysEquipmentServiceImpl implements SysEquipmentService {
|
||||
|
||||
public void deleteFile(SysEquipmentDocs sysEquipmentDocs) {
|
||||
try {
|
||||
sysEquipmentDocsMapper.deleteById(sysEquipmentDocs.getId());
|
||||
minioViewsServcie.removeFile(minioAutoProperties.getPublicBucket(), sysEquipmentDocs.getUrl(),false);
|
||||
}catch (Exception e){
|
||||
log.error("文件删除失败");
|
||||
|
@ -41,21 +41,16 @@ public class MinioViewsServcie {
|
||||
* @param objectName 文件名称
|
||||
*/
|
||||
public void removeFile(String bucketName, String objectName, Boolean recursive) throws Exception {
|
||||
Iterable<Result<Item>> results = minioClient.listObjects(
|
||||
ListObjectsArgs.builder().bucket(bucketName).prefix(objectName).recursive(true).build());
|
||||
List<Result<Item>> list = StreamSupport.stream(results.spliterator(), false)
|
||||
.collect(Collectors.toList());
|
||||
if (list.size() >= 2 && !recursive) {
|
||||
throw new IOException("请清空文件后再删除目录");
|
||||
}
|
||||
for (Result<Item> result : results) {
|
||||
Item item = result.get();
|
||||
try {
|
||||
minioClient.removeObject(
|
||||
RemoveObjectArgs.builder()
|
||||
.bucket(bucketName)
|
||||
.object(item.objectName())
|
||||
.object(objectName)
|
||||
.build());
|
||||
} catch (Exception e) {
|
||||
log.error("minio删除文件失败{}", e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 369 B After Width: | Height: | Size: 374 B |
@ -143,7 +143,7 @@ const getAnimationStyle = (item) => {
|
||||
let animationDuration;
|
||||
animationDuration = 60 / irotorspeed / 3
|
||||
const processedoperationmode = item.attributeMap?.processedoperationmode ?? 0
|
||||
if(processedoperationmode==33){
|
||||
if(processedoperationmode==33||processedoperationmode==0){
|
||||
return {
|
||||
'animation-duration': `0s`,
|
||||
'animation-timing-function': 'linear',
|
||||
@ -610,6 +610,9 @@ const getSafeImagePath = (item, type) => {
|
||||
}
|
||||
}
|
||||
}
|
||||
.grid-content{
|
||||
width: 170px;
|
||||
}
|
||||
.modelOperate{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
@ -145,7 +145,7 @@ const getAnimationStyle = (item) => {
|
||||
let animationDuration;
|
||||
animationDuration = 60 / irotorspeed / 3
|
||||
const processedoperationmode = item.attributeMap?.processedoperationmode ?? 0
|
||||
if(processedoperationmode==33){
|
||||
if(processedoperationmode==33||processedoperationmode==0){
|
||||
return {
|
||||
'animation-duration': `0s`,
|
||||
'animation-timing-function': 'linear',
|
||||
@ -622,7 +622,9 @@ const getSafeImagePath = (item, type) => {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.grid-content{
|
||||
width: 170px;
|
||||
}
|
||||
.modelOperate{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
Loading…
Reference in New Issue
Block a user