|
@@ -169,6 +169,18 @@ public class ProjectServiceImpl implements ProjectService {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public Page<Project> page2(Page<Project> page, ProjectDto projectDto) {
|
|
|
+ if(StringUtils.isNotBlank(projectDto.getDeptId())) {
|
|
|
+ Set<String> deptIds = commonService.getDeptCondition(projectDto.getDeptId());
|
|
|
+ projectDto.setDeptId(null);
|
|
|
+ projectDto.setDeptIds(deptIds);
|
|
|
+ }
|
|
|
+ Page<Project> result = projectMapper.page(page, projectDto);
|
|
|
+ return result;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public Page<Project> deptPage(Page<Project> page, ProjectDto projectDto) {
|
|
|
DeptDataPermissionRespDTO respDTO = permissionApi.getDeptDataPermission(SecurityFrameworkUtils.getLoginUserId()).getCheckedData();
|
|
@@ -709,28 +721,21 @@ public class ProjectServiceImpl implements ProjectService {
|
|
|
|
|
|
@Override
|
|
|
public void materialUploadToFlow(String flowInstanceId,String projectId) throws Exception {
|
|
|
- FileRequest fileRequest = new FileRequest();
|
|
|
List<FileResponse> listFile = projectMapper.getProjectFile(projectId);
|
|
|
+ List<IFlowMaterialsFile> materialsFileList = workflowClient.getListByInstanceId(flowInstanceId).getCheckedData();
|
|
|
+ Map<String, List<IFlowMaterialsFile>> map = materialsFileList.stream().collect(Collectors.groupingBy(IFlowMaterialsFile::getFlowMaterialsId));
|
|
|
for(FileResponse entity:listFile){
|
|
|
- MultipartFile file = UrlToFile.urlToMultipartFile(entity.getUrl(),"test");
|
|
|
- fileRequest.setFile(file);
|
|
|
- fileRequest.setProjectId(projectId);
|
|
|
- fileRequest.setClientId(Long.valueOf(fileClientId));
|
|
|
- String path =entity.getPath().split("_")[0];
|
|
|
- fileRequest.setPath(path);
|
|
|
- CommonResult<FileResponse> res = fileClient.uploadFile(fileRequest);
|
|
|
- FileResponse fileResponse = res.getCheckedData();
|
|
|
IFlowMaterialsFile item = new IFlowMaterialsFile();
|
|
|
- item.setFileId(String.valueOf(fileResponse.getId()));
|
|
|
- item.setFlowMaterialsId(path);
|
|
|
- int dotIndex = fileResponse.getName().lastIndexOf(".");
|
|
|
+ item.setFileId(String.valueOf(entity.getId()));
|
|
|
+ item.setFlowMaterialsId(map.get(entity.getFlowMaterialsId()).get(0).getId());
|
|
|
+ int dotIndex = entity.getName().lastIndexOf(".");
|
|
|
if(dotIndex == -1){
|
|
|
- item.setName(fileResponse.getName());
|
|
|
+ item.setName(entity.getName());
|
|
|
} else {
|
|
|
- item.setName(fileResponse.getName().substring(0,dotIndex));
|
|
|
- item.setSuffix(fileResponse.getName().substring((dotIndex)));
|
|
|
+ item.setName(entity.getName().substring(0,dotIndex));
|
|
|
+ item.setSuffix(entity.getName().substring((dotIndex)));
|
|
|
}
|
|
|
- item.setFileUrl(fileResponse.getUrl());
|
|
|
+ item.setFileUrl(entity.getUrl());
|
|
|
workflowClient.addList(item).getCheckedData();
|
|
|
}
|
|
|
}
|