拆分列表
This commit is contained in:
+71
-2
@@ -14,6 +14,11 @@ import com.jero.generater.modules.online.cgform.entity.OnlCgformField;
|
||||
import com.jero.generater.modules.online.cgform.service.impl.OnlCgformFieldServiceImpl;
|
||||
import com.jero.modules.document.enums.FieldTypeEnum;
|
||||
import com.jero.modules.document.service.IBussDocumentLibraryEOService;
|
||||
import com.jero.modules.laws.standard.entity.LawsDomesticStandard;
|
||||
import com.jero.modules.laws.standard.entity.LawsEnterpriseStandard;
|
||||
import com.jero.modules.laws.standard.service.ILawsDomesticStandardService;
|
||||
import com.jero.modules.laws.standard.service.ILawsEnterpriseStandardService;
|
||||
import com.jero.modules.laws.standard.service.ILawsOverseasStandardService;
|
||||
import com.jero.modules.ocr.util.LineHumpUtil;
|
||||
import com.jero.modules.oss.entity.OSSFile;
|
||||
import com.jero.modules.oss.service.IOSSFileService;
|
||||
@@ -27,6 +32,7 @@ import com.jero.modules.split.service.ISarFileSplitMenuEOService;
|
||||
import com.jero.modules.split.vo.SplitFilePageInfoParam;
|
||||
import com.jero.modules.system.entity.SysDictItem;
|
||||
import com.jero.modules.system.service.ISysDictItemService;
|
||||
import com.jero.modules.system.service.ISysDictService;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -65,6 +71,13 @@ public class SarFileSplitInfoServiceImpl extends ServiceImpl<SarFileSplitInfoMap
|
||||
@Autowired
|
||||
private IBussDocumentLibraryEOService bussDocumentLibraryEOService;
|
||||
|
||||
@Autowired
|
||||
private ILawsDomesticStandardService lawsDomesticStandardService; //国内标准
|
||||
@Autowired
|
||||
private ILawsEnterpriseStandardService ILawsEnterpriseStandardService; //企业标准
|
||||
@Autowired
|
||||
private ISysDictService sysDictService;
|
||||
|
||||
|
||||
/**
|
||||
* 保存
|
||||
@@ -332,9 +345,65 @@ public class SarFileSplitInfoServiceImpl extends ServiceImpl<SarFileSplitInfoMap
|
||||
|
||||
@Override
|
||||
public Page<OSSFile> splitFilePageInfoList(Page<OSSFile> page, HttpServletRequest request, SplitFilePageInfoParam param) {
|
||||
QueryWrapper<OSSFile> wrapper = new QueryWrapper<>();
|
||||
|
||||
List<LawsDomesticStandard> lawsDomesticStandards = lawsDomesticStandardService.list();
|
||||
List<LawsEnterpriseStandard> lawsEnterpriseStandards = ILawsEnterpriseStandardService.list();
|
||||
LambdaQueryWrapper<OSSFile> wrapper = new LambdaQueryWrapper<>();
|
||||
String origin = param.getOrigin();
|
||||
if (StringUtils.isNotBlank(origin)){
|
||||
if ("1".equals(origin)){
|
||||
List<String> collect = lawsDomesticStandards.stream().map(LawsDomesticStandard::getId).collect(Collectors.toList());
|
||||
wrapper.in(OSSFile::getStandardId, collect);
|
||||
}
|
||||
if ("3".equals(origin)){
|
||||
List<String> collect = lawsEnterpriseStandards.stream().map(LawsEnterpriseStandard::getId).collect(Collectors.toList());
|
||||
wrapper.in(OSSFile::getStandardId, collect);
|
||||
}
|
||||
if (!"1".equals(origin) && !"3".equals(origin)){
|
||||
return new Page<>();
|
||||
}
|
||||
}
|
||||
String standardNumber = param.getStandardNumber();
|
||||
if (StringUtils.isNotBlank(standardNumber)){
|
||||
List<String> collect1 = lawsDomesticStandards.stream().filter(LawsDomesticStandard -> LawsDomesticStandard.getStandardNumber().contains(standardNumber)).map(LawsDomesticStandard::getId).collect(Collectors.toList());
|
||||
wrapper.in(OSSFile::getStandardId, collect1);
|
||||
List<String> collect2 = lawsEnterpriseStandards.stream().filter(LawsEnterpriseStandard -> LawsEnterpriseStandard.getStandardNumber().contains(standardNumber)).map(LawsEnterpriseStandard::getId).collect(Collectors.toList());
|
||||
wrapper.in(OSSFile::getStandardId, collect2);
|
||||
}
|
||||
String standardName = param.getStandardName();
|
||||
if (StringUtils.isNotBlank(standardName)){
|
||||
List<String> collect1 = lawsDomesticStandards.stream().filter(LawsDomesticStandard -> LawsDomesticStandard.getStandardName().contains(standardName)).map(LawsDomesticStandard::getId).collect(Collectors.toList());
|
||||
wrapper.in(OSSFile::getStandardId, collect1);
|
||||
List<String> collect2 = lawsEnterpriseStandards.stream().filter(LawsEnterpriseStandard -> LawsEnterpriseStandard.getStandardName().contains(standardName)).map(LawsEnterpriseStandard::getId).collect(Collectors.toList());
|
||||
wrapper.in(OSSFile::getStandardId, collect2);
|
||||
}
|
||||
wrapper.eq(StringUtils.isNotBlank(param.getStandardFileType()), OSSFile::getStandardFileType, param.getStandardFileType());
|
||||
wrapper.orderByDesc(OSSFile::getCreateTime);
|
||||
Page<OSSFile> pageList = ossFileService.page(page, wrapper);
|
||||
//为来源、标准号、标准名称赋值
|
||||
Map<String, List<LawsDomesticStandard>> collect1 = lawsDomesticStandards.stream().collect(Collectors.groupingBy(LawsDomesticStandard::getId));
|
||||
Map<String, List<LawsEnterpriseStandard>> collect2 = lawsEnterpriseStandards.stream().collect(Collectors.groupingBy(LawsEnterpriseStandard::getId));
|
||||
for (OSSFile record : pageList.getRecords()) {
|
||||
String standardId = record.getStandardId();
|
||||
List<LawsDomesticStandard> standards = collect1.get(standardId);
|
||||
if (standards != null && !standards.isEmpty()){
|
||||
LawsDomesticStandard standard = standards.get(0);
|
||||
String origin_dictText = sysDictService.queryDictTextByKey("split_standard_source", "1");
|
||||
record.setOrigin_dictText(origin_dictText);
|
||||
record.setStandardNumber(standard.getStandardNumber());
|
||||
record.setStandardName(standard.getStandardName());
|
||||
}else {
|
||||
List<LawsEnterpriseStandard> domesticStandards = collect2.get(standardId);
|
||||
if (domesticStandards != null && !domesticStandards.isEmpty()){
|
||||
LawsEnterpriseStandard standard = domesticStandards.get(0);
|
||||
String origin_dictText = sysDictService.queryDictTextByKey("split_standard_source", "2");
|
||||
record.setOrigin_dictText(origin_dictText);
|
||||
record.setStandardNumber(standard.getStandardNumber());
|
||||
record.setStandardName(standard.getStandardName());
|
||||
}
|
||||
}
|
||||
}
|
||||
return pageList;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user