逻辑删除文件时,同时删除文件关系
This commit is contained in:
parent
731b920547
commit
4faab3d89b
|
|
@ -26,6 +26,7 @@ import com.electromagnetic.industry.software.common.util.*;
|
||||||
import com.electromagnetic.industry.software.manage.mapper.EdFileInfoMapper;
|
import com.electromagnetic.industry.software.manage.mapper.EdFileInfoMapper;
|
||||||
import com.electromagnetic.industry.software.manage.mapper.UserMapper;
|
import com.electromagnetic.industry.software.manage.mapper.UserMapper;
|
||||||
import com.electromagnetic.industry.software.manage.pojo.models.EdFileInfo;
|
import com.electromagnetic.industry.software.manage.pojo.models.EdFileInfo;
|
||||||
|
import com.electromagnetic.industry.software.manage.pojo.models.EdFileRelation;
|
||||||
import com.electromagnetic.industry.software.manage.pojo.models.User;
|
import com.electromagnetic.industry.software.manage.pojo.models.User;
|
||||||
import com.electromagnetic.industry.software.manage.pojo.other.FileInfoVO;
|
import com.electromagnetic.industry.software.manage.pojo.other.FileInfoVO;
|
||||||
import com.electromagnetic.industry.software.manage.pojo.other.UploadRecordDTO;
|
import com.electromagnetic.industry.software.manage.pojo.other.UploadRecordDTO;
|
||||||
|
|
@ -71,7 +72,8 @@ public class EdFileInfoServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileI
|
||||||
private PermissionService permissionService;
|
private PermissionService permissionService;
|
||||||
@Resource
|
@Resource
|
||||||
private UserMapper userMapper;
|
private UserMapper userMapper;
|
||||||
|
@Resource
|
||||||
|
private EdFileRelationServiceImpl edFileRelationService;
|
||||||
|
|
||||||
private String downloadDataDir = "";
|
private String downloadDataDir = "";
|
||||||
private String uploadDataDir = "";
|
private String uploadDataDir = "";
|
||||||
|
|
@ -211,6 +213,12 @@ public class EdFileInfoServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileI
|
||||||
.set(EdFileInfo::getEffectFlag, false)
|
.set(EdFileInfo::getEffectFlag, false)
|
||||||
.set(EdFileInfo::getAllDeleted, true)
|
.set(EdFileInfo::getAllDeleted, true)
|
||||||
.eq(EdFileInfo::getFileId, fileInfo.getFileId()));
|
.eq(EdFileInfo::getFileId, fileInfo.getFileId()));
|
||||||
|
|
||||||
|
// 删除文件时,同时删除其关联关系
|
||||||
|
edFileRelationService.remove(Wrappers.lambdaQuery(EdFileRelation.class)
|
||||||
|
.eq(EdFileRelation::getId1, id)
|
||||||
|
.or()
|
||||||
|
.eq(EdFileRelation::getId2, id));
|
||||||
return ElectromagneticResultUtil.success(true);
|
return ElectromagneticResultUtil.success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
#required
|
#required
|
||||||
spring.application.name=electromagnetic-data
|
spring.application.name=electromagnetic-data
|
||||||
spring.datasource.typd=com.alibaba.druid.pool.DruidDataSource
|
spring.datasource.typd=com.alibaba.druid.pool.DruidDataSource
|
||||||
spring.datasource.url=jdbc:mysql://139.224.43.89:3306/em_data?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8&useSSL=true&serverTimezone=GMT%2B8&allowMultiQueries=true&rewriteBatchedStatements=true
|
spring.datasource.url=jdbc:mysql://139.196.179.195:3306/em_user_test?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8&useSSL=true&serverTimezone=GMT%2B8&allowMultiQueries=true&rewriteBatchedStatements=true
|
||||||
spring.datasource.username=comac
|
spring.datasource.username=em_user_test
|
||||||
spring.datasource.password=2024*Comac
|
spring.datasource.password=Szsd#2O25$test
|
||||||
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
|
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
|
||||||
spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
|
spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
|
||||||
mybatis-plus.mapper-locations=classpath:sqlmapper/*.xml
|
mybatis-plus.mapper-locations=classpath:sqlmapper/*.xml
|
||||||
|
|
@ -14,7 +14,7 @@ pagehelper.helperDialect=mysql
|
||||||
pagehelper.reasonable=false
|
pagehelper.reasonable=false
|
||||||
server.port=12395
|
server.port=12395
|
||||||
file.security.passwd=adknfhkj87654knd
|
file.security.passwd=adknfhkj87654knd
|
||||||
#windows文件存储目录,用于测试
|
#windowsæä»¶åå¨ç®å½ï¼ç¨äºæµè¯
|
||||||
data.windows.path=D:/tmp/eleData/project/
|
data.windows.path=D:/tmp/eleData/project/
|
||||||
data.linux.path=/szsd/data/eleData/project/
|
data.linux.path=/szsd/data/eleData/project/
|
||||||
data.upload.windows.tmp.path=D:/tmp/eleData/upload/
|
data.upload.windows.tmp.path=D:/tmp/eleData/upload/
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue