文档库--详情和查看已上传的文件
This commit is contained in:
+3
-1
@@ -20,7 +20,9 @@ public interface IOSSFileService extends IService<OSSFile> {
|
||||
public OSSFile uploadLocal(MultipartFile mf, String bizPath);
|
||||
|
||||
|
||||
public List<OSSFile> getFileInfos(String connectId);
|
||||
public List<OSSFile> getFileInfos(String id);
|
||||
|
||||
public List<OSSFile> getFileInfosByConnectId(String connectId);
|
||||
|
||||
boolean delete(OSSFile ossFile);
|
||||
|
||||
|
||||
+9
-1
@@ -121,7 +121,15 @@ public class OSSFileServiceImpl extends ServiceImpl<OSSFileMapper, OSSFile> impl
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OSSFile> getFileInfos(String connectId) {
|
||||
public List<OSSFile> getFileInfos(String id) {
|
||||
LambdaQueryWrapper<OSSFile> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.in(OSSFile::getId,id.split(","));
|
||||
List<OSSFile> list = this.list(wrapper);
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OSSFile> getFileInfosByConnectId(String connectId) {
|
||||
LambdaQueryWrapper<OSSFile> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(OSSFile::getConnectId,connectId);
|
||||
List<OSSFile> list = this.list(wrapper);
|
||||
|
||||
+3
-3
@@ -162,13 +162,13 @@ public class CommonController {
|
||||
|
||||
/**
|
||||
* 查看已上传的文件
|
||||
* @param connectId
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value="查看已上传的文件", notes="查看已上传的文件")
|
||||
@GetMapping(value = "/getFileInfos")
|
||||
public Result<?> getFileInfos(String connectId) {
|
||||
List<OSSFile> fileInfos = ossFileService.getFileInfos(connectId);
|
||||
public Result<?> getFileInfos(String id) {
|
||||
List<OSSFile> fileInfos = ossFileService.getFileInfos(id);
|
||||
return Result.OK(fileInfos);
|
||||
}
|
||||
|
||||
|
||||
+12
@@ -211,6 +211,18 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
|
||||
List<Map<String, Object>> list = bussDocumentLibraryEOService.getDocumentInfoById(id);
|
||||
return Result.OK(list);
|
||||
}
|
||||
/**
|
||||
* 详情数据查询
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "详情,编辑数据查询")
|
||||
@ApiOperation(value="详情,编辑数据查询", notes="详情,编辑数据查询")
|
||||
@GetMapping(value = "/getInfoById")
|
||||
public Result<List<Map<String,Object>>> getInfoById(@RequestParam(name="id",required=true) String id) {
|
||||
List<Map<String, Object>> list = bussDocumentLibraryEOService.getInfoById(id);
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
|
||||
+7
@@ -74,6 +74,13 @@ public interface IBussDocumentLibraryEOService extends IService<BussDocumentLibr
|
||||
*/
|
||||
List<Map<String,Object>> getDocumentInfoById(String id);
|
||||
|
||||
/**
|
||||
* 详情数据查询
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
List<Map<String,Object>> getInfoById(String id);
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
* @param map
|
||||
|
||||
+52
-1
@@ -223,8 +223,21 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
//通过id查询数据
|
||||
List<Map<String, Object>> dataList = bussDocumentLibraryEOMapper.selectMaps(queryWrapper);
|
||||
return dataList;
|
||||
}
|
||||
|
||||
//一下代码为查看已上传的文件(此处已经单独提出一个接口-->/sys/common/getFileInfos)
|
||||
/**
|
||||
* 详情数据查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<Map<String, Object>> getInfoById(String id) {
|
||||
LambdaQueryWrapper<BussDocumentLibraryEO> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(BussDocumentLibraryEO::getId, id);
|
||||
//通过id查询数据
|
||||
List<Map<String, Object>> dataList = bussDocumentLibraryEOMapper.selectMaps(queryWrapper);
|
||||
// //一下代码为查看已上传的文件(此处已经单独提出一个接口-->/sys/common/getFileInfos)
|
||||
// //字段属性
|
||||
// List<OnlCgformField> fieldList = onlCgformFieldService.getFieldList(ModuleEnum.DOCUMENT_LIBRARY.getValue());
|
||||
// //文件类型字段
|
||||
@@ -240,6 +253,44 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// //区域管理
|
||||
List<OnlCgformArea> areaList = onlCgformAreaServiceImpl.queryList(new OnlCgformArea());
|
||||
//字段属性
|
||||
List<OnlCgformField> fieldList = onlCgformFieldService.getFieldList("1");
|
||||
|
||||
if(fieldList.size() != 0){
|
||||
//过滤出表单字段(is_show_form-->表单是否显示0否 1是)
|
||||
fieldList = fieldList.stream().filter(e-> YesOrNoEnum.YES.getValue().equals(String.valueOf(e.getIsShowForm()))).collect(Collectors.toList());
|
||||
}
|
||||
List<Map<String,Object>> result = new ArrayList<>();
|
||||
for (OnlCgformArea onlCgformAreaTemp : areaList) {
|
||||
Map<String,Object> mapTemp = new HashMap<>();
|
||||
List<Map<String,Object>> resultTemp = new ArrayList<>();
|
||||
List<OnlCgformField> fieldListTemp = fieldList.stream().filter(e->onlCgformAreaTemp.getId().equals(e.getShowArea())).collect(Collectors.toList());
|
||||
for (OnlCgformField onlCgformField : fieldListTemp) {
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
if(dataList.size() != 0){
|
||||
dataList.get(0).entrySet().forEach(entry->{
|
||||
if(onlCgformField.getDbFieldName().equals(entry.getKey())){
|
||||
map.put("value",entry.getValue());
|
||||
}
|
||||
});
|
||||
}
|
||||
map.put("field_show_type",onlCgformField.getFieldShowType());//类型(判断是下拉还是输入框,等等)
|
||||
map.put("dict_field",onlCgformField.getDictField());
|
||||
map.put("db_field_name",onlCgformField.getDbFieldName());//字段
|
||||
map.put("db_field_txt",onlCgformField.getDbFieldTxt());//字段中文名
|
||||
map.put("db_field_en_name",onlCgformField.getDbFieldEnName());//字段英文名
|
||||
map.put("area",onlCgformAreaTemp.getShowArea());//区域
|
||||
resultTemp.add(map);
|
||||
}
|
||||
mapTemp.put(onlCgformAreaTemp.getShowArea(),resultTemp);
|
||||
result.add(mapTemp);
|
||||
}
|
||||
return dataList;
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user