feat(项目管理知识库优化): 知识库直接创建的文档需要能下载
Signed-off-by: OTTO <731554297@qq.com>
This commit is contained in:
parent
94061dc01c
commit
992a07f154
|
@ -20,7 +20,7 @@ import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 项目管理-文档库Controller
|
* 项目管理-文档库Controller
|
||||||
*
|
*
|
||||||
* @author wanjia
|
* @author wanjia
|
||||||
* @date 2024-01-08
|
* @date 2024-01-08
|
||||||
*/
|
*/
|
||||||
|
@ -30,8 +30,7 @@ import java.util.List;
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({
|
||||||
@ApiImplicitParam(name = "enterpriseIdentifier", value = "企业标识", paramType = "path", dataType = "String")
|
@ApiImplicitParam(name = "enterpriseIdentifier", value = "企业标识", paramType = "path", dataType = "String")
|
||||||
})
|
})
|
||||||
public class PmsDocumentController extends BaseController
|
public class PmsDocumentController extends BaseController {
|
||||||
{
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IPmsDocumentService pmsDocumentService;
|
private IPmsDocumentService pmsDocumentService;
|
||||||
|
|
||||||
|
@ -46,8 +45,7 @@ public class PmsDocumentController extends BaseController
|
||||||
@ApiImplicitParam(name = "orderByColumn", value = "排序列(更新时间:updateTime,创建时间:createTime)", paramType = "query", dataType = "String"),
|
@ApiImplicitParam(name = "orderByColumn", value = "排序列(更新时间:updateTime,创建时间:createTime)", paramType = "query", dataType = "String"),
|
||||||
@ApiImplicitParam(name = "isAsc", value = "排序的方向desc或者asc,默认asc", paramType = "query", dataType = "String")
|
@ApiImplicitParam(name = "isAsc", value = "排序的方向desc或者asc,默认asc", paramType = "query", dataType = "String")
|
||||||
})
|
})
|
||||||
public GenericsTableDataInfo<PmsDocumentVo> list( @Validated PmsDocumentSearchVo pmsDocumentSearchVo)
|
public GenericsTableDataInfo<PmsDocumentVo> list(@Validated PmsDocumentSearchVo pmsDocumentSearchVo) {
|
||||||
{
|
|
||||||
return pmsDocumentService.selectPmsDocumentVoList(pmsDocumentSearchVo);
|
return pmsDocumentService.selectPmsDocumentVoList(pmsDocumentSearchVo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,8 +56,7 @@ public class PmsDocumentController extends BaseController
|
||||||
@Log(title = "项目管理-文档库", businessType = BusinessType.EXPORT)
|
@Log(title = "项目管理-文档库", businessType = BusinessType.EXPORT)
|
||||||
@PostMapping("/export")
|
@PostMapping("/export")
|
||||||
@ApiOperation(value = "导出项目管理-文档库列表", hidden = true)
|
@ApiOperation(value = "导出项目管理-文档库列表", hidden = true)
|
||||||
public void export(HttpServletResponse response, PmsDocument pmsDocument)
|
public void export(HttpServletResponse response, PmsDocument pmsDocument) {
|
||||||
{
|
|
||||||
List<PmsDocument> list = pmsDocumentService.selectPmsDocumentList(pmsDocument);
|
List<PmsDocument> list = pmsDocumentService.selectPmsDocumentList(pmsDocument);
|
||||||
ExcelUtil<PmsDocument> util = new ExcelUtil<PmsDocument>(PmsDocument.class);
|
ExcelUtil<PmsDocument> util = new ExcelUtil<PmsDocument>(PmsDocument.class);
|
||||||
util.exportExcel(response, list, "项目管理-文档库数据");
|
util.exportExcel(response, list, "项目管理-文档库数据");
|
||||||
|
@ -71,8 +68,7 @@ public class PmsDocumentController extends BaseController
|
||||||
// @RequiresPermissions("pms:document:query")
|
// @RequiresPermissions("pms:document:query")
|
||||||
@GetMapping(value = "/{id}")
|
@GetMapping(value = "/{id}")
|
||||||
@ApiOperation(value = "获取项目管理-文档库详细信息")
|
@ApiOperation(value = "获取项目管理-文档库详细信息")
|
||||||
public AjaxResult getInfo(@PathVariable("id") Long id, @ApiParam("企业id") @RequestParam(name = "enterpriseId") Long enterpriseId)
|
public AjaxResult getInfo(@PathVariable("id") Long id, @ApiParam("企业id") @RequestParam(name = "enterpriseId") Long enterpriseId) {
|
||||||
{
|
|
||||||
return success(pmsDocumentService.selectPmsDocumentDetailVoByIdAndEnterpriseId(id, enterpriseId));
|
return success(pmsDocumentService.selectPmsDocumentDetailVoByIdAndEnterpriseId(id, enterpriseId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,8 +79,7 @@ public class PmsDocumentController extends BaseController
|
||||||
@Log(title = "项目管理-文档库", businessType = BusinessType.INSERT)
|
@Log(title = "项目管理-文档库", businessType = BusinessType.INSERT)
|
||||||
@PostMapping
|
@PostMapping
|
||||||
@ApiOperation(value = "新增项目管理-文档库")
|
@ApiOperation(value = "新增项目管理-文档库")
|
||||||
public AjaxResult add(@RequestBody @Validated PmsDocumentInputVo pmsDocumentInputVo)
|
public AjaxResult add(@RequestBody @Validated PmsDocumentInputVo pmsDocumentInputVo) {
|
||||||
{
|
|
||||||
return toAjax(pmsDocumentService.insertPmsDocument(pmsDocumentInputVo.toPmsDocument()));
|
return toAjax(pmsDocumentService.insertPmsDocument(pmsDocumentInputVo.toPmsDocument()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -95,8 +90,7 @@ public class PmsDocumentController extends BaseController
|
||||||
@Log(title = "新增附件类型文档", businessType = BusinessType.INSERT)
|
@Log(title = "新增附件类型文档", businessType = BusinessType.INSERT)
|
||||||
@PostMapping("/fileType")
|
@PostMapping("/fileType")
|
||||||
@ApiOperation(value = "新增附件类型文档")
|
@ApiOperation(value = "新增附件类型文档")
|
||||||
public AjaxResult addFileTypeDoc(@RequestBody @Validated PmsFileTypeDocumentInputVo pmsFileTypeDocumentInputVo)
|
public AjaxResult addFileTypeDoc(@RequestBody @Validated PmsFileTypeDocumentInputVo pmsFileTypeDocumentInputVo) {
|
||||||
{
|
|
||||||
return toAjax(pmsDocumentService.insertPmsFileTypeDocument(pmsFileTypeDocumentInputVo));
|
return toAjax(pmsDocumentService.insertPmsFileTypeDocument(pmsFileTypeDocumentInputVo));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -107,8 +101,7 @@ public class PmsDocumentController extends BaseController
|
||||||
@Log(title = "项目管理-文档库", businessType = BusinessType.UPDATE)
|
@Log(title = "项目管理-文档库", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping
|
@PutMapping
|
||||||
@ApiOperation(value = "修改项目管理-文档库")
|
@ApiOperation(value = "修改项目管理-文档库")
|
||||||
public AjaxResult edit(@RequestBody PmsDocumentUpdateVo pmsDocumentUpdateVo)
|
public AjaxResult edit(@RequestBody PmsDocumentUpdateVo pmsDocumentUpdateVo) {
|
||||||
{
|
|
||||||
return toAjax(pmsDocumentService.updatePmsDocument(pmsDocumentUpdateVo.toPmsDocument()));
|
return toAjax(pmsDocumentService.updatePmsDocument(pmsDocumentUpdateVo.toPmsDocument()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -117,12 +110,11 @@ public class PmsDocumentController extends BaseController
|
||||||
*/
|
*/
|
||||||
// @RequiresPermissions("pms:document:remove")
|
// @RequiresPermissions("pms:document:remove")
|
||||||
@Log(title = "项目管理-文档库", businessType = BusinessType.DELETE)
|
@Log(title = "项目管理-文档库", businessType = BusinessType.DELETE)
|
||||||
@DeleteMapping("/{ids}")
|
@DeleteMapping("/{ids}")
|
||||||
@ApiOperation(value = "删除项目管理-文档库")
|
@ApiOperation(value = "删除项目管理-文档库")
|
||||||
public AjaxResult remove(@PathVariable Long[] ids,
|
public AjaxResult remove(@PathVariable Long[] ids,
|
||||||
@ApiParam("企业id") @RequestParam(name = "enterpriseId") Long enterpriseId,
|
@ApiParam("企业id") @RequestParam(name = "enterpriseId") Long enterpriseId,
|
||||||
@ApiParam("项目id") @RequestParam(name = "pmsProjectId", defaultValue = "0") Long pmsProjectId)
|
@ApiParam("项目id") @RequestParam(name = "pmsProjectId", defaultValue = "0") Long pmsProjectId) {
|
||||||
{
|
|
||||||
return toAjax(pmsDocumentService.deletePmsDocumentByIds(ids, enterpriseId, pmsProjectId));
|
return toAjax(pmsDocumentService.deletePmsDocumentByIds(ids, enterpriseId, pmsProjectId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -131,8 +123,16 @@ public class PmsDocumentController extends BaseController
|
||||||
*/
|
*/
|
||||||
@GetMapping(value = "/optionalWikiRepoList")
|
@GetMapping(value = "/optionalWikiRepoList")
|
||||||
@ApiOperation(value = "导入wiki时可选的仓库列表")
|
@ApiOperation(value = "导入wiki时可选的仓库列表")
|
||||||
public AjaxResult getOptionalWikiRepoList(@Validated OptionalWikiReposSearchVo optionalWikiReposSearchVo)
|
public AjaxResult getOptionalWikiRepoList(@Validated OptionalWikiReposSearchVo optionalWikiReposSearchVo) {
|
||||||
{
|
|
||||||
return success(pmsDocumentService.getOptionalWikiRepoList(optionalWikiReposSearchVo));
|
return success(pmsDocumentService.getOptionalWikiRepoList(optionalWikiReposSearchVo));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下载文档类型文件
|
||||||
|
*/
|
||||||
|
@GetMapping(value = "/downloadDoc/{docId}")
|
||||||
|
@ApiOperation(value = "下载文档类型文件")
|
||||||
|
public void downloadDoc(@PathVariable String enterpriseIdentifier, @PathVariable Long docId, HttpServletResponse response) {
|
||||||
|
pmsDocumentService.downloadDoc(response, enterpriseIdentifier, docId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@ import com.microservices.common.core.web.page.GenericsTableDataInfo;
|
||||||
import com.microservices.pms.document.domain.PmsDocument;
|
import com.microservices.pms.document.domain.PmsDocument;
|
||||||
import com.microservices.pms.document.domain.vo.*;
|
import com.microservices.pms.document.domain.vo.*;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -93,4 +94,6 @@ public interface IPmsDocumentService
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
JSONObject getOptionalWikiRepoList(OptionalWikiReposSearchVo optionalWikiReposSearchVo);
|
JSONObject getOptionalWikiRepoList(OptionalWikiReposSearchVo optionalWikiReposSearchVo);
|
||||||
|
|
||||||
|
void downloadDoc(HttpServletResponse response, String enterpriseIdentifier, Long docId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@ import com.microservices.common.core.constant.HttpStatus;
|
||||||
import com.microservices.common.core.exception.ServiceException;
|
import com.microservices.common.core.exception.ServiceException;
|
||||||
import com.microservices.common.core.utils.DateUtils;
|
import com.microservices.common.core.utils.DateUtils;
|
||||||
import com.microservices.common.core.utils.StringUtils;
|
import com.microservices.common.core.utils.StringUtils;
|
||||||
|
import com.microservices.common.core.utils.file.FileUtils;
|
||||||
import com.microservices.common.core.web.page.Breadcrumb;
|
import com.microservices.common.core.web.page.Breadcrumb;
|
||||||
import com.microservices.common.core.web.page.GenericsTableDataInfo;
|
import com.microservices.common.core.web.page.GenericsTableDataInfo;
|
||||||
import com.microservices.common.httpClient.util.GitLinkRequestHelper;
|
import com.microservices.common.httpClient.util.GitLinkRequestHelper;
|
||||||
|
@ -21,6 +22,7 @@ import com.microservices.pms.enums.PmsDocumentType;
|
||||||
import com.microservices.pms.project.mapper.PmsProjectRepositoryMapper;
|
import com.microservices.pms.project.mapper.PmsProjectRepositoryMapper;
|
||||||
import com.microservices.pms.project.service.IPmsProjectService;
|
import com.microservices.pms.project.service.IPmsProjectService;
|
||||||
import com.microservices.pms.utils.PmsGitLinkRequestUrl;
|
import com.microservices.pms.utils.PmsGitLinkRequestUrl;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
|
@ -28,7 +30,12 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.io.IOException;
|
||||||
import java.net.URISyntaxException;
|
import java.net.URISyntaxException;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
import java.nio.file.Files;
|
||||||
|
import java.nio.file.Path;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
@ -38,13 +45,13 @@ import static com.microservices.common.httpClient.constant.GitLinkConstants.DATA
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 项目管理-文档库Service业务层处理
|
* 项目管理-文档库Service业务层处理
|
||||||
*
|
*
|
||||||
* @author wanjia
|
* @author wanjia
|
||||||
* @date 2024-01-08
|
* @date 2024-01-08
|
||||||
*/
|
*/
|
||||||
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
public class PmsDocumentServiceImpl implements IPmsDocumentService
|
public class PmsDocumentServiceImpl implements IPmsDocumentService {
|
||||||
{
|
|
||||||
private static final Logger logger = LoggerFactory.getLogger(PmsDocumentServiceImpl.class);
|
private static final Logger logger = LoggerFactory.getLogger(PmsDocumentServiceImpl.class);
|
||||||
@Resource
|
@Resource
|
||||||
private PmsDocumentMapper pmsDocumentMapper;
|
private PmsDocumentMapper pmsDocumentMapper;
|
||||||
|
@ -69,13 +76,12 @@ public class PmsDocumentServiceImpl implements IPmsDocumentService
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询项目管理-文档库
|
* 查询项目管理-文档库
|
||||||
*
|
*
|
||||||
* @param id 项目管理-文档库主键
|
* @param id 项目管理-文档库主键
|
||||||
* @return 项目管理-文档库
|
* @return 项目管理-文档库
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public PmsDocument selectPmsDocumentByIdAndEnterpriseId(Long id, Long enterpriseId)
|
public PmsDocument selectPmsDocumentByIdAndEnterpriseId(Long id, Long enterpriseId) {
|
||||||
{
|
|
||||||
boolean isEnterpriseAdmin = pmsCommonService.hasDocsManageRole(enterpriseId);
|
boolean isEnterpriseAdmin = pmsCommonService.hasDocsManageRole(enterpriseId);
|
||||||
return pmsDocumentMapper.selectPmsDocumentByIdAndEnterpriseId(id, enterpriseId, isEnterpriseAdmin, SecurityUtils.getUsername());
|
return pmsDocumentMapper.selectPmsDocumentByIdAndEnterpriseId(id, enterpriseId, isEnterpriseAdmin, SecurityUtils.getUsername());
|
||||||
}
|
}
|
||||||
|
@ -97,13 +103,12 @@ public class PmsDocumentServiceImpl implements IPmsDocumentService
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询项目管理-文档库列表
|
* 查询项目管理-文档库列表
|
||||||
*
|
*
|
||||||
* @param pmsDocument 项目管理-文档库
|
* @param pmsDocument 项目管理-文档库
|
||||||
* @return 项目管理-文档库
|
* @return 项目管理-文档库
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<PmsDocument> selectPmsDocumentList(PmsDocument pmsDocument)
|
public List<PmsDocument> selectPmsDocumentList(PmsDocument pmsDocument) {
|
||||||
{
|
|
||||||
checkAuthAndReturnAdminStatus(pmsDocument.getPmsEnterpriseId());
|
checkAuthAndReturnAdminStatus(pmsDocument.getPmsEnterpriseId());
|
||||||
return pmsDocumentMapper.selectPmsDocumentList(pmsDocument);
|
return pmsDocumentMapper.selectPmsDocumentList(pmsDocument);
|
||||||
}
|
}
|
||||||
|
@ -116,7 +121,7 @@ public class PmsDocumentServiceImpl implements IPmsDocumentService
|
||||||
pmsDocumentSearchVo.setCurrentUserName(currentUserName);
|
pmsDocumentSearchVo.setCurrentUserName(currentUserName);
|
||||||
startPage();
|
startPage();
|
||||||
List<PmsDocument> pmsDocumentList = pmsDocumentMapper.selectPmsDocumentListBySearchInput(pmsDocumentSearchVo);
|
List<PmsDocument> pmsDocumentList = pmsDocumentMapper.selectPmsDocumentListBySearchInput(pmsDocumentSearchVo);
|
||||||
GenericsTableDataInfo<PmsDocumentVo> page = toPage(pmsDocumentList,this::buildPmsDocumentVo);
|
GenericsTableDataInfo<PmsDocumentVo> page = toPage(pmsDocumentList, this::buildPmsDocumentVo);
|
||||||
//构建面包屑列表
|
//构建面包屑列表
|
||||||
if (pmsDocumentSearchVo.getParentId() != 0) {
|
if (pmsDocumentSearchVo.getParentId() != 0) {
|
||||||
List<Breadcrumb> breadcrumbs = buildBreadcrumbs(pmsDocumentSearchVo.getParentId());
|
List<Breadcrumb> breadcrumbs = buildBreadcrumbs(pmsDocumentSearchVo.getParentId());
|
||||||
|
@ -132,21 +137,53 @@ public class PmsDocumentServiceImpl implements IPmsDocumentService
|
||||||
PmsEnterprise pmsEnterprise = pmsEnterpriseService.selectPmsEnterpriseById(enterpriseId);
|
PmsEnterprise pmsEnterprise = pmsEnterpriseService.selectPmsEnterpriseById(enterpriseId);
|
||||||
Map<String, String> queryParams = buildRepoListQueryParams(optionalWikiReposSearchVo);
|
Map<String, String> queryParams = buildRepoListQueryParams(optionalWikiReposSearchVo);
|
||||||
try {
|
try {
|
||||||
return gitLinkRequestHelper.doGet(PmsGitLinkRequestUrl.GET_ORGANIZATION_REPO_LIST(pmsEnterprise.getEnterpriseIdentifier(), queryParams));
|
return gitLinkRequestHelper.doGet(PmsGitLinkRequestUrl.GET_ORGANIZATION_REPO_LIST(pmsEnterprise.getEnterpriseIdentifier(), queryParams));
|
||||||
} catch (URISyntaxException e) {
|
} catch (URISyntaxException e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void downloadDoc(HttpServletResponse response, String enterpriseIdentifier, Long docId) {
|
||||||
|
PmsEnterprise enterprise = pmsEnterpriseService.selectPmsEnterpriseByIdentifier(enterpriseIdentifier);
|
||||||
|
PmsDocument pmsDocument = selectPmsDocumentByIdAndEnterpriseId(docId, enterprise.getId());
|
||||||
|
if (!pmsDocument.getDocType().equals(PmsDocumentType.DOCUMENT.getKey())) {
|
||||||
|
throw new ServiceException("当前接口仅允许下载文档类型");
|
||||||
|
}
|
||||||
|
Path tempFilePath = null;
|
||||||
|
try {
|
||||||
|
String docFileName = pmsDocument.getName() + ".md";
|
||||||
|
FileUtils.setAttachmentResponseHeader(response, docFileName);
|
||||||
|
// 创建临时文件
|
||||||
|
tempFilePath = Files.createTempFile(pmsDocument.getName(), ".md");
|
||||||
|
String content = "";
|
||||||
|
if (pmsDocument.getContent() != null) {
|
||||||
|
content = pmsDocument.getContent();
|
||||||
|
}
|
||||||
|
Files.write(tempFilePath, content.getBytes(StandardCharsets.UTF_8));
|
||||||
|
FileUtils.writeBytes(tempFilePath.toString(), response.getOutputStream());
|
||||||
|
} catch (IOException e) {
|
||||||
|
log.error("文档下载失败:{}", e.getMessage());
|
||||||
|
throw new ServiceException("文档下载失败");
|
||||||
|
} finally {
|
||||||
|
if (tempFilePath != null) {
|
||||||
|
try {
|
||||||
|
Files.deleteIfExists(tempFilePath);
|
||||||
|
} catch (IOException e) {
|
||||||
|
log.error("删除临时文件失败:{}", e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增项目管理-文档库
|
* 新增项目管理-文档库
|
||||||
*
|
*
|
||||||
* @param pmsDocument 项目管理-文档库
|
* @param pmsDocument 项目管理-文档库
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int insertPmsDocument(PmsDocument pmsDocument)
|
public int insertPmsDocument(PmsDocument pmsDocument) {
|
||||||
{
|
|
||||||
checkPmsProjectById(pmsDocument.getPmsProjectId());
|
checkPmsProjectById(pmsDocument.getPmsProjectId());
|
||||||
checkAuthAndReturnAdminStatus(pmsDocument.getPmsEnterpriseId());
|
checkAuthAndReturnAdminStatus(pmsDocument.getPmsEnterpriseId());
|
||||||
String currentUserName = SecurityUtils.getUsername();
|
String currentUserName = SecurityUtils.getUsername();
|
||||||
|
@ -169,13 +206,12 @@ public class PmsDocumentServiceImpl implements IPmsDocumentService
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改项目管理-文档库
|
* 修改项目管理-文档库
|
||||||
*
|
*
|
||||||
* @param pmsDocument 项目管理-文档库
|
* @param pmsDocument 项目管理-文档库
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int updatePmsDocument(PmsDocument pmsDocument)
|
public int updatePmsDocument(PmsDocument pmsDocument) {
|
||||||
{
|
|
||||||
checkPmsProjectById(pmsDocument.getPmsProjectId());
|
checkPmsProjectById(pmsDocument.getPmsProjectId());
|
||||||
String currentUserName = SecurityUtils.getUsername();
|
String currentUserName = SecurityUtils.getUsername();
|
||||||
boolean isEnterpriseAdmin = checkAuthAndReturnAdminStatus(pmsDocument.getPmsEnterpriseId());
|
boolean isEnterpriseAdmin = checkAuthAndReturnAdminStatus(pmsDocument.getPmsEnterpriseId());
|
||||||
|
@ -195,8 +231,7 @@ public class PmsDocumentServiceImpl implements IPmsDocumentService
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int deletePmsDocumentByIds(Long[] ids, Long enterpriseId, Long projectId)
|
public int deletePmsDocumentByIds(Long[] ids, Long enterpriseId, Long projectId) {
|
||||||
{
|
|
||||||
checkPmsProjectById(projectId);
|
checkPmsProjectById(projectId);
|
||||||
String currentUserName = SecurityUtils.getUsername();
|
String currentUserName = SecurityUtils.getUsername();
|
||||||
boolean isEnterpriseAdmin = checkAuthAndReturnAdminStatus(enterpriseId);
|
boolean isEnterpriseAdmin = checkAuthAndReturnAdminStatus(enterpriseId);
|
||||||
|
@ -207,13 +242,12 @@ public class PmsDocumentServiceImpl implements IPmsDocumentService
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除项目管理-文档库信息
|
* 删除项目管理-文档库信息
|
||||||
*
|
*
|
||||||
* @param id 项目管理-文档库主键
|
* @param id 项目管理-文档库主键
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int deletePmsDocumentById(Long id, Long enterpriseId, Long projectId)
|
public int deletePmsDocumentById(Long id, Long enterpriseId, Long projectId) {
|
||||||
{
|
|
||||||
checkPmsProjectById(projectId);
|
checkPmsProjectById(projectId);
|
||||||
String currentUserName = SecurityUtils.getUsername();
|
String currentUserName = SecurityUtils.getUsername();
|
||||||
boolean isEnterpriseAdmin = checkAuthAndReturnAdminStatus(enterpriseId);
|
boolean isEnterpriseAdmin = checkAuthAndReturnAdminStatus(enterpriseId);
|
||||||
|
@ -303,7 +337,7 @@ public class PmsDocumentServiceImpl implements IPmsDocumentService
|
||||||
throw new ServiceException("文件类型的文档名称个数与文件标识个数不匹配");
|
throw new ServiceException("文件类型的文档名称个数与文件标识个数不匹配");
|
||||||
}
|
}
|
||||||
List<PmsDocument> pmsDocumentList = new ArrayList<>();
|
List<PmsDocument> pmsDocumentList = new ArrayList<>();
|
||||||
for (int i=0; i < names.length; i++) {
|
for (int i = 0; i < names.length; i++) {
|
||||||
PmsDocument pmsDocument = new PmsDocument();
|
PmsDocument pmsDocument = new PmsDocument();
|
||||||
BeanUtils.copyProperties(pmsFileTypeDocumentInputVo, pmsDocument);
|
BeanUtils.copyProperties(pmsFileTypeDocumentInputVo, pmsDocument);
|
||||||
pmsDocument.setName(names[i]);
|
pmsDocument.setName(names[i]);
|
||||||
|
@ -373,7 +407,7 @@ public class PmsDocumentServiceImpl implements IPmsDocumentService
|
||||||
queryParams.put("pm_project_repository_ids", unlinkedRepoIdsString);
|
queryParams.put("pm_project_repository_ids", unlinkedRepoIdsString);
|
||||||
}
|
}
|
||||||
queryParams.put("search", optionalWikiReposSearchVo.getSearch());
|
queryParams.put("search", optionalWikiReposSearchVo.getSearch());
|
||||||
queryParams.put("page" , String.valueOf(optionalWikiReposSearchVo.getPage()));
|
queryParams.put("page", String.valueOf(optionalWikiReposSearchVo.getPage()));
|
||||||
queryParams.put("limit", String.valueOf(optionalWikiReposSearchVo.getLimit()));
|
queryParams.put("limit", String.valueOf(optionalWikiReposSearchVo.getLimit()));
|
||||||
queryParams.put("sort_by", optionalWikiReposSearchVo.getSortBy());
|
queryParams.put("sort_by", optionalWikiReposSearchVo.getSortBy());
|
||||||
queryParams.put("sort_direction", "desc");
|
queryParams.put("sort_direction", "desc");
|
||||||
|
|
Loading…
Reference in New Issue