feat(文档拆分): 查看
This commit is contained in:
+14
-1
@@ -5,6 +5,7 @@ import com.jero.common.api.vo.Result;
|
|||||||
import com.jero.common.aspect.annotation.AutoLog;
|
import com.jero.common.aspect.annotation.AutoLog;
|
||||||
import com.jero.modules.laws.documenttool.common.DocumentSplitCommon;
|
import com.jero.modules.laws.documenttool.common.DocumentSplitCommon;
|
||||||
import com.jero.modules.laws.documenttool.entity.DocumentSplitInfo;
|
import com.jero.modules.laws.documenttool.entity.DocumentSplitInfo;
|
||||||
|
import com.jero.modules.laws.documenttool.entity.LawsDocumentSplitView;
|
||||||
import com.jero.modules.laws.documenttool.service.IDocumentSplitService;
|
import com.jero.modules.laws.documenttool.service.IDocumentSplitService;
|
||||||
import com.jero.modules.split.entity.SarFileSplitInfoEO;
|
import com.jero.modules.split.entity.SarFileSplitInfoEO;
|
||||||
import com.jero.modules.split.entity.SarFileSplitItemsValEO;
|
import com.jero.modules.split.entity.SarFileSplitItemsValEO;
|
||||||
@@ -45,7 +46,7 @@ public class DocumentSplitController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页列表查询
|
* 文档拆分-分页列表查询
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@@ -58,6 +59,18 @@ public class DocumentSplitController {
|
|||||||
return Result.OK(documentSplitService.queryByPage(documentSplitInfo, pageNo, pageSize));
|
return Result.OK(documentSplitService.queryByPage(documentSplitInfo, pageNo, pageSize));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文档拆分-查看
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "文档拆分-查看")
|
||||||
|
@ApiOperation(value="文档拆分-查看", notes="文档拆分-查看")
|
||||||
|
@PostMapping(value = "/queryView")
|
||||||
|
public Result<LawsDocumentSplitView> queryView(@RequestBody Map<String, Object> parameter) {
|
||||||
|
return Result.OK(documentSplitService.queryView(parameter));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更改权限
|
* 更改权限
|
||||||
*
|
*
|
||||||
|
|||||||
+15
@@ -2,6 +2,7 @@ package com.jero.modules.laws.documenttool.service;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.jero.modules.laws.documenttool.entity.DocumentSplitInfo;
|
import com.jero.modules.laws.documenttool.entity.DocumentSplitInfo;
|
||||||
|
import com.jero.modules.laws.documenttool.entity.LawsDocumentSplitView;
|
||||||
import com.jero.modules.split.entity.SarFileSplitInfoEO;
|
import com.jero.modules.split.entity.SarFileSplitInfoEO;
|
||||||
import com.jero.modules.split.entity.SarFileSplitItemsValEO;
|
import com.jero.modules.split.entity.SarFileSplitItemsValEO;
|
||||||
|
|
||||||
@@ -46,6 +47,13 @@ public interface IDocumentSplitService {
|
|||||||
*/
|
*/
|
||||||
IPage<Map<String, Object>> queryDocumentSplitDetail(Map<String, Object> parameter);
|
IPage<Map<String, Object>> queryDocumentSplitDetail(Map<String, Object> parameter);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文档拆分详情-列表查询
|
||||||
|
* @param parameter
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<Map<String, Object>> queryDocumentSplitDetailByList(Map<String, Object> parameter);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 文档拆分-拆分
|
* 文档拆分-拆分
|
||||||
* @param sarFileSplitInfoEO
|
* @param sarFileSplitInfoEO
|
||||||
@@ -121,4 +129,11 @@ public interface IDocumentSplitService {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<SarFileSplitItemsValEO> queryInterpretationArticlesList(String itemId);
|
List<SarFileSplitItemsValEO> queryInterpretationArticlesList(String itemId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文档拆分-查看
|
||||||
|
* @param parameter
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
LawsDocumentSplitView queryView(Map<String, Object> parameter);
|
||||||
}
|
}
|
||||||
|
|||||||
+47
-11
@@ -16,6 +16,7 @@ import com.jero.modules.laws.common.constant.FieldCommon;
|
|||||||
import com.jero.modules.laws.common.mapper.LawsCommonMapper;
|
import com.jero.modules.laws.common.mapper.LawsCommonMapper;
|
||||||
import com.jero.modules.laws.documenttool.common.DocumentSplitCommon;
|
import com.jero.modules.laws.documenttool.common.DocumentSplitCommon;
|
||||||
import com.jero.modules.laws.documenttool.entity.DocumentSplitInfo;
|
import com.jero.modules.laws.documenttool.entity.DocumentSplitInfo;
|
||||||
|
import com.jero.modules.laws.documenttool.entity.LawsDocumentSplitView;
|
||||||
import com.jero.modules.laws.documenttool.factory.ConditionMapFactory;
|
import com.jero.modules.laws.documenttool.factory.ConditionMapFactory;
|
||||||
import com.jero.modules.laws.documenttool.handler.impl.DateManyConditionImpl;
|
import com.jero.modules.laws.documenttool.handler.impl.DateManyConditionImpl;
|
||||||
import com.jero.modules.laws.documenttool.handler.impl.UniversalImpl;
|
import com.jero.modules.laws.documenttool.handler.impl.UniversalImpl;
|
||||||
@@ -164,9 +165,30 @@ public class DocumentSplitServiceImpl implements IDocumentSplitService {
|
|||||||
return mapIPage;
|
return mapIPage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Map<String, Object>> queryDocumentSplitDetailByList(Map<String, Object> parameter) {
|
||||||
|
// 查询全部字段列表
|
||||||
|
List<LawsTag> fieldList = lawsCommonMapper.getFieldList(TableNameEnum.DOCUMENT_SPLIT.getTableName());
|
||||||
|
// 列表展示字段
|
||||||
|
List<LawsTag> fieldListSelect = fieldList.stream().filter(v -> YesOrNoEnum.YES.getValue()
|
||||||
|
.equals(String.valueOf(v.getIsShowList()))).collect(Collectors.toList());
|
||||||
|
// 搜索条件展示字段
|
||||||
|
List<LawsTag> fieldListCondition = fieldList.stream().filter(v -> YesOrNoEnum.YES.getValue()
|
||||||
|
.equals(String.valueOf(v.getIsQuery()))).collect(Collectors.toList());
|
||||||
|
|
||||||
|
// sql查询列字段拼接
|
||||||
|
String selectColumn = getSelectColumn(fieldListSelect);
|
||||||
|
// sql where条件拼接
|
||||||
|
String selectCondition = getSelectCondition(parameter, fieldListCondition);
|
||||||
|
|
||||||
|
// 查询数据
|
||||||
|
List<Map<String, Object>> list = documentSplitMapper.queryDocumentSplitDetail(selectColumn, selectCondition);
|
||||||
|
// 翻译
|
||||||
|
dicTranslate(list, fieldListSelect);
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
private void dicTranslate(List<Map<String, Object>> records, List<LawsTag> fieldListSelect) {
|
private void dicTranslate(List<Map<String, Object>> records, List<LawsTag> fieldListSelect) {
|
||||||
// 单选树结构、多选树结构
|
|
||||||
List<String> treeTypeList = Arrays.asList(LawsFieldTypeEnum.TREE_BOX.getValue(), LawsFieldTypeEnum.TREE_BOX_SINGLE.getValue());
|
|
||||||
List<LawsTag> lawsTags = fieldListSelect.stream()
|
List<LawsTag> lawsTags = fieldListSelect.stream()
|
||||||
.filter(j -> FieldCommon.TYPE_DICT.contains(j.getFieldShowType())).collect(Collectors.toList());
|
.filter(j -> FieldCommon.TYPE_DICT.contains(j.getFieldShowType())).collect(Collectors.toList());
|
||||||
for (Map<String, Object> map : records) {
|
for (Map<String, Object> map : records) {
|
||||||
@@ -176,22 +198,17 @@ public class DocumentSplitServiceImpl implements IDocumentSplitService {
|
|||||||
// 字典查找
|
// 字典查找
|
||||||
SysDict sysDict = sysDictService.getById(lawsTag.getDictId());
|
SysDict sysDict = sysDictService.getById(lawsTag.getDictId());
|
||||||
if (!Objects.isNull(sysDict)){
|
if (!Objects.isNull(sysDict)){
|
||||||
setDicText(treeTypeList, map, lawsTag, dbFieldName, sysDict);
|
setDicText(map, dbFieldName, sysDict);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setDicText(List<String> treeTypeList, Map<String, Object> map, LawsTag lawsTag, String dbFieldName, SysDict sysDict) {
|
private void setDicText(Map<String, Object> map, String dbFieldName, SysDict sysDict) {
|
||||||
LambdaQueryWrapper<SysDictItem> queryWrapper = new LambdaQueryWrapper<SysDictItem>()
|
LambdaQueryWrapper<SysDictItem> queryWrapper = new LambdaQueryWrapper<SysDictItem>()
|
||||||
.eq(SysDictItem::getDictId, sysDict.getId());
|
.eq(SysDictItem::getDictId, sysDict.getId())
|
||||||
// 树结构查询dic_id
|
.in(SysDictItem::getItemValue, Arrays.asList(map.get(dbFieldName).toString().split(",")));
|
||||||
if (treeTypeList.contains(lawsTag.getFieldShowType())){
|
|
||||||
queryWrapper.in(SysDictItem::getId, Arrays.asList(map.get(dbFieldName).toString().split(",")));
|
|
||||||
}else {
|
|
||||||
queryWrapper.in(SysDictItem::getItemValue, Arrays.asList(map.get(dbFieldName).toString().split(",")));
|
|
||||||
}
|
|
||||||
// 字典值查询
|
// 字典值查询
|
||||||
List<SysDictItem> list = sysDictItemService.list(queryWrapper);
|
List<SysDictItem> list = sysDictItemService.list(queryWrapper);
|
||||||
if(!list.isEmpty()){
|
if(!list.isEmpty()){
|
||||||
@@ -599,6 +616,24 @@ public class DocumentSplitServiceImpl implements IDocumentSplitService {
|
|||||||
return documentSplitMapper.queryItemsValByItemId(itemId, DocumentSplitCommon.INTERPRETATION);
|
return documentSplitMapper.queryItemsValByItemId(itemId, DocumentSplitCommon.INTERPRETATION);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public LawsDocumentSplitView queryView(Map<String, Object> parameter) {
|
||||||
|
LawsDocumentSplitView lawsDocumentSplitView = new LawsDocumentSplitView();
|
||||||
|
String id = (String) parameter.get(ID);
|
||||||
|
// 文档拆分信息
|
||||||
|
DocumentSplitInfo documentSplitInfo = new DocumentSplitInfo();
|
||||||
|
documentSplitInfo.setId(id);
|
||||||
|
List<DocumentSplitInfo> documentSplitInfos = queryByList(documentSplitInfo);
|
||||||
|
lawsDocumentSplitView.setDocumentSplitInfo(documentSplitInfos.get(0));
|
||||||
|
|
||||||
|
// 文档拆分详情
|
||||||
|
parameter.remove(ID);
|
||||||
|
parameter.put(INFO_ID, id);
|
||||||
|
List<Map<String, Object>> documentSplitDetailByList = queryDocumentSplitDetailByList(parameter);
|
||||||
|
lawsDocumentSplitView.setDocumentSplitDetail(documentSplitDetailByList);
|
||||||
|
return lawsDocumentSplitView;
|
||||||
|
}
|
||||||
|
|
||||||
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) -> {
|
||||||
@@ -751,6 +786,7 @@ public class DocumentSplitServiceImpl implements IDocumentSplitService {
|
|||||||
@NotNull
|
@NotNull
|
||||||
private static QueryWrapper<SarFileSplitInfoEO> getSarFileSplitInfoEOQueryWrapper(DocumentSplitInfo documentSplitInfo) {
|
private static QueryWrapper<SarFileSplitInfoEO> getSarFileSplitInfoEOQueryWrapper(DocumentSplitInfo documentSplitInfo) {
|
||||||
QueryWrapper<SarFileSplitInfoEO> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<SarFileSplitInfoEO> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq(StringUtils.isNotBlank(documentSplitInfo.getId()), "id", documentSplitInfo.getId());
|
||||||
// 标准编号/标准名称
|
// 标准编号/标准名称
|
||||||
if (StringUtils.isNotBlank(documentSplitInfo.getSerialNumberOrName())){
|
if (StringUtils.isNotBlank(documentSplitInfo.getSerialNumberOrName())){
|
||||||
queryWrapper.and(qw -> qw
|
queryWrapper.and(qw -> qw
|
||||||
|
|||||||
Reference in New Issue
Block a user