fix(企标稽查流程): 80928
This commit is contained in:
+14
-8
@@ -37,7 +37,8 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.concurrent.atomic.AtomicReference;
|
import java.util.Optional;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -217,7 +218,6 @@ public class ProcessEsInspectServiceImpl extends ServiceImpl<ProcessEsInspectMap
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public OSSFile queryFileByInspectId(String inspectId) {
|
public OSSFile queryFileByInspectId(String inspectId) {
|
||||||
AtomicReference<OSSFile> ossFile = new AtomicReference<>(new OSSFile());
|
|
||||||
EnterpriseStandardInspect enterpriseStandardInspect = enterpriseStandardInspectService.getById(inspectId);
|
EnterpriseStandardInspect enterpriseStandardInspect = enterpriseStandardInspectService.getById(inspectId);
|
||||||
LawsEnterpriseStandard lawsEnterpriseStandard = lawsEnterpriseStandardService.getOne(
|
LawsEnterpriseStandard lawsEnterpriseStandard = lawsEnterpriseStandardService.getOne(
|
||||||
new LambdaQueryWrapper<LawsEnterpriseStandard>()
|
new LambdaQueryWrapper<LawsEnterpriseStandard>()
|
||||||
@@ -227,17 +227,23 @@ public class ProcessEsInspectServiceImpl extends ServiceImpl<ProcessEsInspectMap
|
|||||||
new LambdaQueryWrapper<OSSFile>()
|
new LambdaQueryWrapper<OSSFile>()
|
||||||
.eq(OSSFile::getStandardId, lawsEnterpriseStandard.getId())
|
.eq(OSSFile::getStandardId, lawsEnterpriseStandard.getId())
|
||||||
.orderByDesc(OSSFile::getCreateTime));
|
.orderByDesc(OSSFile::getCreateTime));
|
||||||
// 发布稿>修改单>报批稿>送审稿>征求意见稿>草稿
|
|
||||||
if (!list.isEmpty()){
|
if (!list.isEmpty()){
|
||||||
|
// pdf、word
|
||||||
|
list = list.stream()
|
||||||
|
.filter(v -> v.getFileName().endsWith(".pdf")
|
||||||
|
|| v.getFileName().endsWith(".docx")
|
||||||
|
|| v.getFileName().endsWith(".doc")).collect(Collectors.toList());
|
||||||
|
|
||||||
|
// 发布稿>修改单>报批稿>送审稿>征求意见稿>草稿
|
||||||
String[] fileTypeArr = {FieldCommon.FILE_PUBLISH_OF_ORIGINAL, FieldCommon.FILE_MODIFICATION_LIST,
|
String[] fileTypeArr = {FieldCommon.FILE_PUBLISH_OF_ORIGINAL, FieldCommon.FILE_MODIFICATION_LIST,
|
||||||
FieldCommon.FILE_DRAFT_FOR_REVIEW, FieldCommon.FILE_DRAFT_FOR_APPROVAL,
|
FieldCommon.FILE_DRAFT_FOR_REVIEW, FieldCommon.FILE_DRAFT_FOR_APPROVAL,
|
||||||
FieldCommon.FILE_DRAFT_FOR_COMMENT, FieldCommon.FILE_DRAFT};
|
FieldCommon.FILE_DRAFT_FOR_COMMENT, FieldCommon.FILE_DRAFT};
|
||||||
for (String fileType : fileTypeArr) {
|
for (String fileType : fileTypeArr) {
|
||||||
list.stream().filter(v ->
|
Optional<OSSFile> optional = list.stream().filter(v ->
|
||||||
fileType.equals(v.getStandardFileType())).findFirst()
|
fileType.equals(v.getStandardFileType())).findFirst();
|
||||||
.ifPresent(ossFile::set);
|
|
||||||
if (!Objects.isNull(ossFile.get()) && StringUtils.isNotBlank(ossFile.get().getId())){
|
if (optional.isPresent()){
|
||||||
return ossFile.get();
|
return optional.get();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user