文档库-导出、带文件导出接口修改,导出分阶段实施详情信息开发。。
This commit is contained in:
+71
-2
@@ -31,11 +31,13 @@ import com.jero.modules.collection.entity.OnlCgformCollection;
|
|||||||
import com.jero.modules.collection.service.IOnlCgformCollectionService;
|
import com.jero.modules.collection.service.IOnlCgformCollectionService;
|
||||||
import com.jero.modules.document.entity.BussDocumentLibraryEO;
|
import com.jero.modules.document.entity.BussDocumentLibraryEO;
|
||||||
import com.jero.modules.document.entity.OSSFileForDocumentLibrary;
|
import com.jero.modules.document.entity.OSSFileForDocumentLibrary;
|
||||||
|
import com.jero.modules.document.entity.PhasedImplementationDetailsEO;
|
||||||
import com.jero.modules.document.enums.FieldTypeEnum;
|
import com.jero.modules.document.enums.FieldTypeEnum;
|
||||||
import com.jero.modules.document.enums.LawsStateEnum;
|
import com.jero.modules.document.enums.LawsStateEnum;
|
||||||
import com.jero.modules.document.enums.SearchEnum;
|
import com.jero.modules.document.enums.SearchEnum;
|
||||||
import com.jero.modules.document.mapper.BussDocumentLibraryEOMapper;
|
import com.jero.modules.document.mapper.BussDocumentLibraryEOMapper;
|
||||||
import com.jero.modules.document.service.IBussDocumentLibraryEOService;
|
import com.jero.modules.document.service.IBussDocumentLibraryEOService;
|
||||||
|
import com.jero.modules.document.service.IPhasedImplementationDetailsEOService;
|
||||||
import com.jero.modules.document.utils.ReadPdfUtil;
|
import com.jero.modules.document.utils.ReadPdfUtil;
|
||||||
import com.jero.modules.document.utils.ReadWordUtil;
|
import com.jero.modules.document.utils.ReadWordUtil;
|
||||||
import com.jero.modules.document.vo.QueryConditionVO;
|
import com.jero.modules.document.vo.QueryConditionVO;
|
||||||
@@ -188,6 +190,8 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
|||||||
private DomainManageServiceImpl domainManageService;
|
private DomainManageServiceImpl domainManageService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private OnlCgformSubscribeMapper onlCgformSubscribeMapper;
|
private OnlCgformSubscribeMapper onlCgformSubscribeMapper;
|
||||||
|
@Autowired
|
||||||
|
private IPhasedImplementationDetailsEOService phasedImplementationDetailsEOService;
|
||||||
|
|
||||||
@Value(value = "${jero.path.upload}")
|
@Value(value = "${jero.path.upload}")
|
||||||
private String uploadpath;
|
private String uploadpath;
|
||||||
@@ -4583,6 +4587,14 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
|||||||
&& !"sys_org_code".equals(e.getDbFieldName())
|
&& !"sys_org_code".equals(e.getDbFieldName())
|
||||||
&& YesOrNoEnum.YES.getValue().equals(StringUtils.valueOf(e.getIsShowForm()))
|
&& YesOrNoEnum.YES.getValue().equals(StringUtils.valueOf(e.getIsShowForm()))
|
||||||
&& StringUtils.isNotBlank(e.getShowArea())).collect(Collectors.toList());
|
&& StringUtils.isNotBlank(e.getShowArea())).collect(Collectors.toList());
|
||||||
|
|
||||||
|
OnlCgformField phasedOnlCgformField = new OnlCgformField();
|
||||||
|
phasedOnlCgformField.setId(UUID.randomUUID().toString().replace("-", ""));
|
||||||
|
phasedOnlCgformField.setDbFieldTxt("分阶段实施详情");
|
||||||
|
phasedOnlCgformField.setDbFieldEnName("Details of the phased implementation");
|
||||||
|
phasedOnlCgformField.setDbFieldName("phasedImplDetails");
|
||||||
|
fieldListTemp.add(phasedOnlCgformField);
|
||||||
|
|
||||||
//只导出数据时,过滤掉文件类型
|
//只导出数据时,过滤掉文件类型
|
||||||
if (!"file".equals(flag)) {
|
if (!"file".equals(flag)) {
|
||||||
fieldListTemp = fieldListTemp.stream().filter(e -> !FieldTypeEnum.FILE.getValue().equals(e.getFieldShowType())).collect(Collectors.toList());
|
fieldListTemp = fieldListTemp.stream().filter(e -> !FieldTypeEnum.FILE.getValue().equals(e.getFieldShowType())).collect(Collectors.toList());
|
||||||
@@ -4790,6 +4802,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
|||||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
CellStyle cellStyle = workbook.createCellStyle();//初始化单元格格式对象
|
CellStyle cellStyle = workbook.createCellStyle();//初始化单元格格式对象
|
||||||
cellStyle.setAlignment(HorizontalAlignment.CENTER);
|
cellStyle.setAlignment(HorizontalAlignment.CENTER);
|
||||||
|
cellStyle.setWrapText(true);//自动换行
|
||||||
//数据字典
|
//数据字典
|
||||||
List<SysDictItem> sysDictItems = sysDictItemServiceImpl.selectItemsAll();
|
List<SysDictItem> sysDictItems = sysDictItemServiceImpl.selectItemsAll();
|
||||||
//文件字段
|
//文件字段
|
||||||
@@ -4800,13 +4813,60 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
|||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
//过滤出所有文件字段对应的connect_id
|
//过滤出所有文件字段对应的connect_id
|
||||||
List<String> connectIdList = new ArrayList<>();
|
List<String> connectIdList = new ArrayList<>();
|
||||||
|
List<String> idList = datas.stream().map(data -> (String) data.get("id")).distinct().collect(Collectors.toList());
|
||||||
|
|
||||||
|
List<PhasedImplementationDetailsEO> phasedImplDetailsEOList = null;
|
||||||
|
if(CollectionUtils.isNotEmpty(idList)){
|
||||||
|
QueryWrapper<PhasedImplementationDetailsEO> phasedImplDetailsQueryWrap = new QueryWrapper<>();
|
||||||
|
phasedImplDetailsQueryWrap.lambda().in(PhasedImplementationDetailsEO::getBussDocumentLibraryId,idList);
|
||||||
|
phasedImplDetailsEOList = this.phasedImplementationDetailsEOService.list(phasedImplDetailsQueryWrap);
|
||||||
|
}
|
||||||
|
|
||||||
for (Map<String, Object> data : datas) {
|
for (Map<String, Object> data : datas) {
|
||||||
|
StringBuilder phasedImplDetailsSb = new StringBuilder();
|
||||||
|
String id = (String) data.get("id");
|
||||||
|
|
||||||
for (OnlCgformField onlCgformField : fileFieldList) {
|
for (OnlCgformField onlCgformField : fileFieldList) {
|
||||||
String value = StringUtils.valueOf(data.get(onlCgformField.getDbFieldName()));
|
String value = StringUtils.valueOf(data.get(onlCgformField.getDbFieldName()));
|
||||||
if (StringUtils.isNotBlank(value)) {
|
if (StringUtils.isNotBlank(value)) {
|
||||||
connectIdList.add(value);
|
connectIdList.add(value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(CollectionUtils.isNotEmpty(phasedImplDetailsEOList)){
|
||||||
|
List<PhasedImplementationDetailsEO> phasedImplDetailsEOListTemp = phasedImplDetailsEOList.stream().filter(phased -> {
|
||||||
|
boolean flag = false;
|
||||||
|
if(StringUtils.equals(id,phased.getBussDocumentLibraryId())){
|
||||||
|
flag = true;
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
|
||||||
|
if(CollectionUtils.isNotEmpty(phasedImplDetailsEOListTemp)){
|
||||||
|
for (PhasedImplementationDetailsEO detailsEO : phasedImplDetailsEOListTemp) {
|
||||||
|
StringBuilder phasedImplDetailsSbTemp = new StringBuilder();
|
||||||
|
if(StringUtils.isNotEmpty(phasedImplDetailsSb.toString())){
|
||||||
|
phasedImplDetailsSb.append("#");
|
||||||
|
}
|
||||||
|
if(StringUtils.isNotEmpty(detailsEO.getStandNumberOrClause())){
|
||||||
|
phasedImplDetailsSbTemp.append(detailsEO.getStandNumberOrClause()).append("<n>");
|
||||||
|
}
|
||||||
|
if(StringUtils.isNotEmpty(detailsEO.getImplementationType())){
|
||||||
|
phasedImplDetailsSbTemp.append(detailsEO.getImplementationType()).append("<n>");
|
||||||
|
}
|
||||||
|
if(detailsEO.getImplementationDate()!=null){
|
||||||
|
phasedImplDetailsSbTemp.append(DateUtils.formatTime(detailsEO.getImplementationDate())).append("<n>");
|
||||||
|
}
|
||||||
|
if(StringUtils.isNotEmpty(detailsEO.getRemarks())){
|
||||||
|
phasedImplDetailsSbTemp.append(detailsEO.getRemarks()).append("<n>");
|
||||||
|
}
|
||||||
|
if(StringUtils.isNotEmpty(phasedImplDetailsSbTemp.toString())){
|
||||||
|
phasedImplDetailsSb.append(phasedImplDetailsSbTemp.toString().substring(0,phasedImplDetailsSbTemp.toString().length()-3));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
data.put("phasedImplDetails",phasedImplDetailsSb.toString());
|
||||||
}
|
}
|
||||||
//所有的文件信息
|
//所有的文件信息
|
||||||
List<OSSFile> fileInfos = new ArrayList<>();
|
List<OSSFile> fileInfos = new ArrayList<>();
|
||||||
@@ -4856,7 +4916,9 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
|||||||
if("null".equals(value)){
|
if("null".equals(value)){
|
||||||
value = "";
|
value = "";
|
||||||
}
|
}
|
||||||
row.createCell(sheetNum).setCellValue(value);
|
Cell cell = row.createCell(sheetNum);
|
||||||
|
// cell.setCellStyle(cellStyle);
|
||||||
|
cell.setCellValue(value);
|
||||||
sheetNum++;
|
sheetNum++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4876,7 +4938,14 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
|||||||
if (StringUtils.isNotBlank(header)) {
|
if (StringUtils.isNotBlank(header)) {
|
||||||
String[] headerArr = header.split(",");
|
String[] headerArr = header.split(",");
|
||||||
for (int i = 0; i < headerArr.length; i++) {
|
for (int i = 0; i < headerArr.length; i++) {
|
||||||
rowHeader.createCell(i).setCellValue(headerArr[i]);
|
Cell cellHeader = rowHeader.createCell(i);
|
||||||
|
/*if(StringUtils.equals(headerArr[i],"被代替标准") || StringUtils.equals(headerArr[i],"replaced_standard") ){
|
||||||
|
sheet.setColumnWidth(i,5000);
|
||||||
|
}
|
||||||
|
if(StringUtils.equals(headerArr[i],"分阶段实施详情") || StringUtils.equals(headerArr[i],"phasedImplDetails") ){
|
||||||
|
sheet.setColumnWidth(i,5000);
|
||||||
|
}*/
|
||||||
|
cellHeader.setCellValue(headerArr[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user