修改对外报告删除同时删除cos文件
This commit is contained in:
+6
@@ -8,6 +8,7 @@ import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.common.constant.enums.CutEnum;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.common.util.oss.CosBootUtil;
|
||||
import com.jero.modules.extRepo.entity.ExtRepoData;
|
||||
import com.jero.modules.extRepo.entity.ExtRepoDataPage;
|
||||
import com.jero.modules.extRepo.service.IExtRepoDataService;
|
||||
@@ -178,6 +179,7 @@ public class ExtRepoDataController extends JeroController<ExtRepoData, IExtRepoD
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
if (extRepoFolderService.isManager() || sysUser.getUsername().equals(erd.getCreateBy())) {
|
||||
extRepoDataService.deleteById(id);
|
||||
CosBootUtil.delete(erd.getFileKey());
|
||||
if (CutEnum.CN.getValue().equals(cut)) {
|
||||
return Result.OK("删除成功!");
|
||||
} else {
|
||||
@@ -219,6 +221,10 @@ public class ExtRepoDataController extends JeroController<ExtRepoData, IExtRepoD
|
||||
}
|
||||
}
|
||||
this.extRepoDataService.deleteByIds(idsList);
|
||||
for (String id : idsList) {
|
||||
ExtRepoData erd = extRepoDataService.queryById(id);
|
||||
CosBootUtil.delete(erd.getFileKey());
|
||||
}
|
||||
if (CutEnum.CN.getValue().equals(cut)) {
|
||||
return Result.OK("删除成功!");
|
||||
} else {
|
||||
|
||||
+9
@@ -5,7 +5,9 @@ import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.common.constant.enums.CutEnum;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import com.jero.modules.extRepo.entity.ERFTreeData;
|
||||
import com.jero.modules.extRepo.entity.ExtRepoData;
|
||||
import com.jero.modules.extRepo.entity.ExtRepoFolder;
|
||||
import com.jero.modules.extRepo.service.IExtRepoDataService;
|
||||
import com.jero.modules.extRepo.service.IExtRepoFolderService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@@ -31,6 +33,9 @@ public class ExtRepoFolderController extends JeroController<ExtRepoFolder, IExtR
|
||||
@Autowired
|
||||
private IExtRepoFolderService extRepoFolderService;
|
||||
|
||||
@Autowired
|
||||
private IExtRepoDataService extRepoDataService;
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
@@ -110,6 +115,10 @@ public class ExtRepoFolderController extends JeroController<ExtRepoFolder, IExtR
|
||||
if (extRepoFolderService.haveManageAuth(id)) {
|
||||
List<ExtRepoFolder> resList = extRepoFolderService.getListBySupFolder(id);
|
||||
if (resList.isEmpty()) {
|
||||
List<ExtRepoData> erdList = extRepoDataService.queryByFolder(id);
|
||||
for (ExtRepoData erd:erdList){
|
||||
extRepoDataService.deleteById(erd.getId());
|
||||
}
|
||||
extRepoFolderService.deleteById(id);
|
||||
} else {
|
||||
if (CutEnum.CN.getValue().equals(cut)) {
|
||||
|
||||
+8
@@ -59,4 +59,12 @@ public interface IExtRepoDataService extends IService<ExtRepoData> {
|
||||
* @return
|
||||
*/
|
||||
List<ExtRepoData> queryList();
|
||||
|
||||
/**
|
||||
* 根据文件夹查询
|
||||
*
|
||||
* @param folserId
|
||||
* @return
|
||||
*/
|
||||
List<ExtRepoData> queryByFolder(String folserId);
|
||||
}
|
||||
|
||||
+14
@@ -1,6 +1,7 @@
|
||||
package com.jero.modules.extRepo.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.modules.extRepo.entity.ExtRepoData;
|
||||
import com.jero.modules.extRepo.mapper.ExtRepoDataMapper;
|
||||
@@ -125,4 +126,17 @@ public class ExtRepoDataServiceImpl extends ServiceImpl<ExtRepoDataMapper, ExtRe
|
||||
public List<ExtRepoData> queryList() {
|
||||
return list();
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @param folserId
|
||||
* @return
|
||||
*/
|
||||
public List<ExtRepoData> queryByFolder(String folserId) {
|
||||
LambdaQueryWrapper<ExtRepoData> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(ExtRepoData::getSupFolder, folserId);
|
||||
List<ExtRepoData> list = this.list(queryWrapper);
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user