fix(文档拆分): 查看问题修复
This commit is contained in:
+12
@@ -303,4 +303,16 @@ public class DocumentSplitController {
|
|||||||
public void downloadImportTemplate(HttpServletRequest request, HttpServletResponse response) {
|
public void downloadImportTemplate(HttpServletRequest request, HttpServletResponse response) {
|
||||||
documentSplitService.downloadImportTemplate(request, response);
|
documentSplitService.downloadImportTemplate(request, response);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文档拆分详情-导出
|
||||||
|
* @param request
|
||||||
|
* @param response
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "文档拆分详情-导出")
|
||||||
|
@ApiOperation(value = "文档拆分详情-导出")
|
||||||
|
@GetMapping("/exportDocumentSplitDetail")
|
||||||
|
public void exportDocumentSplitDetail(@RequestBody Map<String, Object> parameter, HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
documentSplitService.exportDocumentSplitDetail(parameter, request, response);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -24,8 +24,8 @@
|
|||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<insert id="insertDocumentSplitInfo">
|
<insert id="insertDocumentSplitInfo">
|
||||||
insert into sar_file_split_info(id, create_by, create_time, update_by, update_time, sys_org_code, serial_number, title, file_type, file_name, split_result, file_id, connect_id, title_en, author, split_status, standard_id, del_flag)
|
insert into sar_file_split_info(id, create_by, create_time, update_by, update_time, sys_org_code, serial_number, title, file_type, file_name, split_result, file_id, connect_id, title_en, author, split_status, standard_id, del_flag, publish_before_id)
|
||||||
values (#{id}, #{createBy}, #{createTime}, #{updateBy}, #{updateTime}, #{sysOrgCode}, #{serialNumber}, #{title}, #{fileType}, #{fileName}, #{splitResult}, #{fileId}, #{connectId}, #{titleEn}, #{author}, #{splitStatus}, #{standardId}, #{delFlag})
|
values (#{id}, #{createBy}, #{createTime}, #{updateBy}, #{updateTime}, #{sysOrgCode}, #{serialNumber}, #{title}, #{fileType}, #{fileName}, #{splitResult}, #{fileId}, #{connectId}, #{titleEn}, #{author}, #{splitStatus}, #{standardId}, #{delFlag}, #{publishBeforeId})
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<insert id="insertBatchSarFileSplitMenuByInfoId">
|
<insert id="insertBatchSarFileSplitMenuByInfoId">
|
||||||
|
|||||||
+7
@@ -149,4 +149,11 @@ public interface IDocumentSplitService {
|
|||||||
* @param parameter
|
* @param parameter
|
||||||
*/
|
*/
|
||||||
void revocation(Map<String, Object> parameter);
|
void revocation(Map<String, Object> parameter);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文档拆分详情-导出
|
||||||
|
* @param request
|
||||||
|
* @param response
|
||||||
|
*/
|
||||||
|
void exportDocumentSplitDetail(Map<String, Object> parameter, HttpServletRequest request, HttpServletResponse response);
|
||||||
}
|
}
|
||||||
|
|||||||
+50
-3
@@ -696,7 +696,8 @@ public class DocumentSplitServiceImpl implements IDocumentSplitService {
|
|||||||
splitMenuEOPage.setOrderBy("display_seq");
|
splitMenuEOPage.setOrderBy("display_seq");
|
||||||
splitMenuEOPage.setInfoId(id);
|
splitMenuEOPage.setInfoId(id);
|
||||||
List<SarFileSplitMenuEO> sarFileSplitMenuEOS = sarFileSplitMenuEOService.queryByList(splitMenuEOPage);
|
List<SarFileSplitMenuEO> sarFileSplitMenuEOS = sarFileSplitMenuEOService.queryByList(splitMenuEOPage);
|
||||||
lawsDocumentSplitView.setSarFileSplitMenuEO(sarFileSplitMenuEOS);
|
// 不需要总目录层级
|
||||||
|
lawsDocumentSplitView.setSarFileSplitMenuEO(sarFileSplitMenuEOS.get(0).getChildren());
|
||||||
|
|
||||||
// 文档拆分详情
|
// 文档拆分详情
|
||||||
parameter.remove(ID);
|
parameter.remove(ID);
|
||||||
@@ -711,6 +712,15 @@ public class DocumentSplitServiceImpl implements IDocumentSplitService {
|
|||||||
String id = (String) parameter.get(ID);
|
String id = (String) parameter.get(ID);
|
||||||
// 文档拆分信息(旧)
|
// 文档拆分信息(旧)
|
||||||
DocumentSplitInfo oldInfo = documentSplitMapper.queryDocumentSplitInfoById(id);
|
DocumentSplitInfo oldInfo = documentSplitMapper.queryDocumentSplitInfoById(id);
|
||||||
|
// 判断是否发布过
|
||||||
|
SarFileSplitInfoEO sarFileSplitInfoEO = sarFileSplitInfoService.getOne(
|
||||||
|
new QueryWrapper<SarFileSplitInfoEO>().lambda()
|
||||||
|
.eq(SarFileSplitInfoEO::getPublishBeforeId, id));
|
||||||
|
if (!Objects.isNull(sarFileSplitInfoEO)){
|
||||||
|
// 删除旧发布数据
|
||||||
|
sarFileSplitInfoService.deleteById(sarFileSplitInfoEO.getId());
|
||||||
|
}
|
||||||
|
|
||||||
// 修改发布状态
|
// 修改发布状态
|
||||||
LambdaUpdateWrapper<SarFileSplitInfoEO> updateWrapper = new LambdaUpdateWrapper<>();
|
LambdaUpdateWrapper<SarFileSplitInfoEO> updateWrapper = new LambdaUpdateWrapper<>();
|
||||||
updateWrapper.eq(SarFileSplitInfoEO::getId, oldInfo.getId());
|
updateWrapper.eq(SarFileSplitInfoEO::getId, oldInfo.getId());
|
||||||
@@ -734,8 +744,6 @@ public class DocumentSplitServiceImpl implements IDocumentSplitService {
|
|||||||
oldMenuIdList.add(sarFileSplitMenu.getId());
|
oldMenuIdList.add(sarFileSplitMenu.getId());
|
||||||
String newId = UUID.randomUUID().toString().replace("-", "");
|
String newId = UUID.randomUUID().toString().replace("-", "");
|
||||||
newMenuIdList.add(newId);
|
newMenuIdList.add(newId);
|
||||||
sarFileSplitMenu.setId(newId);
|
|
||||||
sarFileSplitMenu.setInfoId(newInfo.getId());
|
|
||||||
|
|
||||||
// 父子级关系处理
|
// 父子级关系处理
|
||||||
oldMenuList.stream()
|
oldMenuList.stream()
|
||||||
@@ -745,6 +753,9 @@ public class DocumentSplitServiceImpl implements IDocumentSplitService {
|
|||||||
return v;
|
return v;
|
||||||
})
|
})
|
||||||
.forEach(v -> log.info(v.getParentId()));
|
.forEach(v -> log.info(v.getParentId()));
|
||||||
|
|
||||||
|
sarFileSplitMenu.setId(newId);
|
||||||
|
sarFileSplitMenu.setInfoId(newInfo.getId());
|
||||||
}
|
}
|
||||||
// 新增数据
|
// 新增数据
|
||||||
documentSplitMapper.insertBatchSarFileSplitMenuByInfoId(oldMenuList);
|
documentSplitMapper.insertBatchSarFileSplitMenuByInfoId(oldMenuList);
|
||||||
@@ -806,6 +817,42 @@ public class DocumentSplitServiceImpl implements IDocumentSplitService {
|
|||||||
sarFileSplitInfoService.update(updateWrapper);
|
sarFileSplitInfoService.update(updateWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void exportDocumentSplitDetail(Map<String, Object> parameter, HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
// 文档拆分详情数据
|
||||||
|
List<Map<String, Object>> mapList = queryDocumentSplitDetailByList(parameter);
|
||||||
|
// 创建工作簿
|
||||||
|
Workbook workbook = new XSSFWorkbook();
|
||||||
|
// 创建sheet页
|
||||||
|
Sheet sheet = workbook.createSheet("条款内容");
|
||||||
|
// 字段名
|
||||||
|
List<String> keyList = new ArrayList<>();
|
||||||
|
if(!Objects.isNull(mapList) && !mapList.isEmpty()){
|
||||||
|
Map<String, Object> map = mapList.get(0);
|
||||||
|
keyList = map.entrySet().stream().map(Map.Entry::getKey).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
// 样式1
|
||||||
|
CellStyle cellStyleOne = workbook.createCellStyle();
|
||||||
|
cellStyleOne.setWrapText(true);
|
||||||
|
cellStyleOne.setVerticalAlignment(VerticalAlignment.CENTER);
|
||||||
|
// 样式2
|
||||||
|
CellStyle cellStyleTwo = workbook.createCellStyle();
|
||||||
|
cellStyleTwo.setWrapText(true);
|
||||||
|
cellStyleTwo.setAlignment(HorizontalAlignment.CENTER);
|
||||||
|
// 样式3
|
||||||
|
CellStyle cellStyleThree = workbook.createCellStyle();
|
||||||
|
Font font = workbook.createFont();
|
||||||
|
font.setColor(IndexedColors.LIGHT_BLUE.getIndex());
|
||||||
|
cellStyleThree.setWrapText(true);
|
||||||
|
cellStyleThree.setVerticalAlignment(VerticalAlignment.CENTER);
|
||||||
|
|
||||||
|
// 设置表头
|
||||||
|
for (String key : keyList) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void manageData(Map<String, Object> resultMap, StringBuilder fieldsBuilder, StringBuilder valuesBuilder) {
|
private void manageData(Map<String, Object> resultMap, StringBuilder fieldsBuilder, StringBuilder valuesBuilder) {
|
||||||
// 所有key(字段名)
|
// 所有key(字段名)
|
||||||
resultMap.forEach((k, v) -> {
|
resultMap.forEach((k, v) -> {
|
||||||
|
|||||||
Reference in New Issue
Block a user