修改文档库详情
This commit is contained in:
+8
@@ -288,6 +288,14 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
@ApiOperation(value="详情目录查询", notes="详情目录查询")
|
||||
@GetMapping(value = "/getMenuList")
|
||||
public Result<List<Map<String,Object>>> getMenuList(@RequestParam(name="id",required=true) String id,
|
||||
@RequestParam(name="cut",required=true) String cut) {
|
||||
List<Map<String, Object>> list = bussDocumentLibraryEOService.getMenuList(id,cut);
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
* @param map
|
||||
|
||||
+1
@@ -98,6 +98,7 @@ public interface IBussDocumentLibraryEOService extends IService<BussDocumentLibr
|
||||
*/
|
||||
List<Map<String, Object>> getInfoById(String id, String cut);
|
||||
|
||||
List<Map<String, Object>> getMenuList(String id, String cut);
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
|
||||
+70
-54
@@ -1030,6 +1030,53 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
// return dataList;
|
||||
// }
|
||||
|
||||
|
||||
public List<Map<String, Object>> getMenuList(String id, String cut) {
|
||||
//字段属性
|
||||
List<OnlCgformField> fieldList = onlCgformFieldService.getFieldList(ModuleEnum.DOCUMENT_LIBRARY.getValue());
|
||||
//标准选择字段
|
||||
List<OnlCgformField> standardOnlCgformFieldList = fieldList.stream()
|
||||
.filter(e -> FieldTypeEnum.STANDARD.getValue().equals(e.getFieldShowType())).collect(Collectors.toList());
|
||||
List<String> standFieldList = standardOnlCgformFieldList.stream().map(OnlCgformField::getDbFieldName).collect(Collectors.toList());
|
||||
List<Map<String, Object>> result = new ArrayList<>(); // 要返回的结果
|
||||
|
||||
//区域管理
|
||||
OnlCgformArea onlCgformArea = new OnlCgformArea();
|
||||
onlCgformArea.setIsModel(ModuleEnum.DOCUMENT_LIBRARY.getValue());
|
||||
List<OnlCgformArea> areaList = onlCgformAreaServiceImpl.queryList(onlCgformArea);
|
||||
|
||||
for (OnlCgformArea onlCgformAreaTemp : areaList) {
|
||||
String areaName = "";
|
||||
if (CutEnum.CN.getValue().equals(cut)) {
|
||||
areaName = onlCgformAreaTemp.getShowArea();
|
||||
} else {
|
||||
areaName = onlCgformAreaTemp.getEnName();
|
||||
}
|
||||
Map<String, Object> menuMap = new HashMap<>();
|
||||
menuMap.put("name",areaName);
|
||||
result.add(menuMap);
|
||||
List<OnlCgformField> fieldListTemp = fieldList.stream().filter(e -> onlCgformAreaTemp.getId().equals(e.getShowArea())).collect(Collectors.toList());
|
||||
for (OnlCgformField onlCgformField : fieldListTemp) {
|
||||
//字段
|
||||
String dbFieldName = onlCgformField.getDbFieldName();
|
||||
//字段类型
|
||||
String fieldShowType = onlCgformField.getFieldShowType();
|
||||
|
||||
if (FieldTypeEnum.FILE.getValue().equals(fieldShowType)) {
|
||||
Map<String, Object> menuMap1 = new HashMap<>();
|
||||
menuMap1.put("pname",areaName);
|
||||
if (CutEnum.CN.getValue().equals(cut)) {
|
||||
menuMap1.put("name",onlCgformField.getDbFieldTxt());
|
||||
} else {
|
||||
menuMap1.put("name",onlCgformField.getDbFieldEnName());
|
||||
}
|
||||
result.add(menuMap1);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情数据查询
|
||||
*
|
||||
@@ -1098,7 +1145,6 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
//过滤出表单字段(is_show_form-->表单是否显示0否 1是)
|
||||
fieldList = fieldList.stream().filter(e -> YesOrNoEnum.YES.getValue().equals(StringUtils.valueOf(e.getIsShowForm()))).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
for (OnlCgformArea onlCgformAreaTemp : areaList) {
|
||||
String areaName = "";
|
||||
if (CutEnum.CN.getValue().equals(cut)) {
|
||||
@@ -1161,61 +1207,31 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
mapNew.put("value",fileIdList);
|
||||
resultTemp.add(mapNew);
|
||||
}else{
|
||||
|
||||
if (StringUtils.isNotBlank(value)) {
|
||||
Map<String, Object> mapNew = new HashMap<>();
|
||||
List<Map<String, Object>> listVal = new ArrayList<>();
|
||||
List<OSSFile> fileInfos = iOSSFileService.getFileInfosByConnectId(value);
|
||||
//多文件处理
|
||||
if (fileInfos.size() > 1) {
|
||||
if (fileInfos.size() != 0) {
|
||||
int i = 0;
|
||||
for (OSSFile fileInfo : fileInfos) {
|
||||
if (i == 0) {
|
||||
Map<String, Object> mapNew = new HashMap<>();
|
||||
mapNew.put("value", fileInfo);
|
||||
mapPut(cut, mapNew, "field_show_type", onlCgformField.getFieldShowType(), "dict_field", onlCgformField.getDictField(), "db_field_name", onlCgformField.getDbFieldName(), "db_field_txt", onlCgformField.getDbFieldTxt(), "db_field_en_name", onlCgformField.getDbFieldEnName(), "area", areaName, null);
|
||||
mapNew.put("count", fileInfos.size());
|
||||
// 添加标准分解单跳转
|
||||
List<SarFileSplitInfoEO> infoEOList = sarFileSplitInfoService.queryByFileId(fileInfo.getId());
|
||||
if (CollectionUtil.isNotEmpty(infoEOList)) {
|
||||
mapNew.put("splitFlag", 1);
|
||||
mapNew.put("splitInfoId", infoEOList.get(0).getId());
|
||||
} else{
|
||||
mapNew.put("splitFlag", 0);
|
||||
}
|
||||
|
||||
resultTemp.add(mapNew);
|
||||
i++;
|
||||
} else {
|
||||
Map<String, Object> mapNew = new HashMap<>();
|
||||
mapNew.put("value", fileInfo);
|
||||
mapPut(cut, mapNew, "field_show_type", onlCgformField.getFieldShowType(), "dict_field", onlCgformField.getDictField(), "db_field_name", onlCgformField.getDbFieldName(), "db_field_txt", onlCgformField.getDbFieldTxt(), "db_field_en_name", onlCgformField.getDbFieldEnName(), "area", areaName, null);
|
||||
// 添加标准分解单跳转
|
||||
List<SarFileSplitInfoEO> infoEOList = sarFileSplitInfoService.queryByFileId(fileInfo.getId());
|
||||
if (CollectionUtil.isNotEmpty(infoEOList)) {
|
||||
mapNew.put("splitFlag", 1);
|
||||
mapNew.put("splitInfoId", infoEOList.get(0).getId());
|
||||
} else{
|
||||
mapNew.put("splitFlag", 0);
|
||||
}
|
||||
resultTemp.add(mapNew);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (fileInfos.size() == 1) {
|
||||
//单个文件处理
|
||||
Map<String, Object> mapNew = new HashMap<>();
|
||||
mapNew.put("count", fileInfos.size());
|
||||
mapNew.put("value", fileInfos.get(0));
|
||||
if(ObjectUtils.isNotEmpty(fileInfos)){
|
||||
mapPut(cut, mapNew, "field_show_type", onlCgformField.getFieldShowType(), "dict_field", onlCgformField.getDictField(), "db_field_name", onlCgformField.getDbFieldName(), "db_field_txt", onlCgformField.getDbFieldTxt(), "db_field_en_name", onlCgformField.getDbFieldEnName(), "area", areaName, null);
|
||||
// 添加标准分解单跳转
|
||||
List<SarFileSplitInfoEO> infoEOList = sarFileSplitInfoService.queryByFileId(fileInfos.get(0).getId());
|
||||
if (CollectionUtil.isNotEmpty(infoEOList)) {
|
||||
mapNew.put("splitFlag", 1);
|
||||
mapNew.put("splitInfoId", infoEOList.get(0).getId());
|
||||
} else{
|
||||
mapNew.put("splitFlag", 0);
|
||||
for (OSSFile fileInfo : fileInfos) {
|
||||
Map<String, Object> mapValue = new HashMap<>();
|
||||
mapValue.put("id",fileInfo.getId());
|
||||
mapValue.put("fileName",fileInfo.getFileName());
|
||||
List<SarFileSplitInfoEO> infoEOList = sarFileSplitInfoService.queryByFileId(fileInfo.getId());
|
||||
// 添加标准分解单跳转
|
||||
if (CollectionUtil.isNotEmpty(infoEOList)) {
|
||||
mapValue.put("splitFlag", 1);
|
||||
mapValue.put("splitInfoId", infoEOList.get(0).getId());
|
||||
} else{
|
||||
mapValue.put("splitFlag", 0);
|
||||
}
|
||||
listVal.add(mapValue);
|
||||
}
|
||||
resultTemp.add(mapNew);
|
||||
}
|
||||
mapNew.put("value", listVal);
|
||||
resultTemp.add(mapNew);
|
||||
} else {
|
||||
Map<String, Object> mapNew = new HashMap<>();
|
||||
mapNew.put("value", "");
|
||||
@@ -1973,11 +1989,11 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
if (null != bl) {
|
||||
String repStr = bl.getReplacedStandard();
|
||||
if (StringUtils.isNotBlank(repStr)) {
|
||||
if (!repStr.contains(idTemp)) {
|
||||
repStr = repStr + "," + idTemp;
|
||||
if (!repStr.contains(StringUtils.valueOf(map.get("serial_number")))) {
|
||||
repStr = repStr + "," + StringUtils.valueOf(map.get("serial_number"));
|
||||
}
|
||||
} else {
|
||||
repStr = idTemp;
|
||||
repStr = StringUtils.valueOf(map.get("serial_number"));
|
||||
}
|
||||
bl.setReplacedStandard(repStr);
|
||||
bussDocumentLibraryEOMapper.updateById(bl);
|
||||
@@ -2684,7 +2700,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
bussDocumentLibraryEOMapper.deleteById((String) map.get("id"));
|
||||
bussDocumentLibraryEOMapper.insertInfo(insertField, insertValue);
|
||||
//处理代替标准和被代替标准逻辑
|
||||
String docId = (String) map.get("id");
|
||||
String docId = StringUtils.valueOf(map.get("serial_number"));
|
||||
Object repObj = map.get("replace_standard_id");
|
||||
if(null != repObj){
|
||||
String[] replace_standard_list = repObj.toString().split(",");
|
||||
|
||||
Reference in New Issue
Block a user