|
@@ -1,7 +1,10 @@
|
|
|
package com.ghsc.partybuild.service.impl.workresourcelibrary;
|
|
|
|
|
|
import com.ghsc.partybuild.controller.jsonmodel.RequsetData;
|
|
|
-import com.ghsc.partybuild.mapper.*;
|
|
|
+import com.ghsc.partybuild.mapper.CfFileMapper;
|
|
|
+import com.ghsc.partybuild.mapper.DjWorkresourcelibraryCQuery;
|
|
|
+import com.ghsc.partybuild.mapper.DjWorkresourcelibraryMapper;
|
|
|
+import com.ghsc.partybuild.mapper.DjWorkresourcelibrarytypeMapper;
|
|
|
import com.ghsc.partybuild.model.*;
|
|
|
import com.ghsc.partybuild.service.DictionaryService;
|
|
|
import com.ghsc.partybuild.service.workresourcelibrary.WorkResourceLibraryService;
|
|
@@ -17,7 +20,6 @@ import org.springframework.stereotype.Service;
|
|
|
import java.util.*;
|
|
|
|
|
|
/**
|
|
|
- *
|
|
|
* @author wufs
|
|
|
* @date 2020/05/15
|
|
|
*/
|
|
@@ -67,70 +69,53 @@ public class WorkResourceLibraryServiceImpl implements WorkResourceLibraryServic
|
|
|
return pList;
|
|
|
}
|
|
|
|
|
|
- protected List<String> findFileTypeAndChildren(String fileTypeId){
|
|
|
+ protected List<String> findFileTypeAndChildren(String fileTypeId) {
|
|
|
|
|
|
- List<String> fileTypeids=new ArrayList<>();
|
|
|
+ List<String> fileTypeids = new ArrayList<>();
|
|
|
|
|
|
DjWorkresourcelibrarytype filetype = djWorkresourcelibrarytypeMapper.selectByPrimaryKey(fileTypeId);
|
|
|
|
|
|
- if(filetype!=null){
|
|
|
+ if (filetype != null) {
|
|
|
fileTypeids.add(filetype.getFiletypeid());
|
|
|
- getFileTypeChildren(filetype.getFiletypeid(),fileTypeids);
|
|
|
+ getFileTypeChildren(filetype.getFiletypeid(), fileTypeids);
|
|
|
}
|
|
|
|
|
|
return fileTypeids;
|
|
|
}
|
|
|
|
|
|
- protected void getFileTypeChildren(String parentfileTypeId,List<String> ids){
|
|
|
- DjWorkresourcelibrarytypeExample exp=new DjWorkresourcelibrarytypeExample();
|
|
|
+ protected void getFileTypeChildren(String parentfileTypeId, List<String> ids) {
|
|
|
+ DjWorkresourcelibrarytypeExample exp = new DjWorkresourcelibrarytypeExample();
|
|
|
exp.or().andParenttypeidEqualTo(parentfileTypeId);
|
|
|
- List<DjWorkresourcelibrarytype> typeChildren=djWorkresourcelibrarytypeMapper.selectByExample(exp);
|
|
|
+ List<DjWorkresourcelibrarytype> typeChildren = djWorkresourcelibrarytypeMapper.selectByExample(exp);
|
|
|
|
|
|
- typeChildren.forEach(it->{
|
|
|
+ typeChildren.forEach(it -> {
|
|
|
ids.add(it.getFiletypeid());
|
|
|
- this.getFileTypeChildren(it.getFiletypeid(),ids);
|
|
|
+ this.getFileTypeChildren(it.getFiletypeid(), ids);
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
- public List<DjWorkresourcelibrarytype> getFileTypeRoot() {
|
|
|
-
|
|
|
- DjWorkresourcelibrarytypeExample exp = new DjWorkresourcelibrarytypeExample();
|
|
|
- exp.or().andParenttypeidIsNull();
|
|
|
- exp.setOrderByClause("treelevel asc");
|
|
|
- List<DjWorkresourcelibrarytype> filesRoot = djWorkresourcelibrarytypeMapper.selectByExample(exp);
|
|
|
-
|
|
|
- return filesRoot;
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public List<DjWorkresourcelibrarytype> getFileTypeByParent(String parentId) {
|
|
|
- DjWorkresourcelibrarytypeExample exp = new DjWorkresourcelibrarytypeExample();
|
|
|
- exp.or().andParenttypeidEqualTo(parentId);
|
|
|
- exp.setOrderByClause("treelevel asc");
|
|
|
- List<DjWorkresourcelibrarytype> filetypes = djWorkresourcelibrarytypeMapper.selectByExample(exp);
|
|
|
- return filetypes;
|
|
|
- }
|
|
|
-
|
|
|
@Override
|
|
|
public List<DsjTreeFiletype> getFileTreeByParent(String parentId, List<String> typeIds, List<String> passTypeIds) {
|
|
|
|
|
|
return djWorkresourcelibraryCQuery.selectTreeFiles(parentId, null, typeIds, passTypeIds);
|
|
|
}
|
|
|
+
|
|
|
@Override
|
|
|
- public PageInfo<Map<String, Object>> selectFiletypeList(String typename,String parentId ,int pageIndex, int pageSize) {
|
|
|
+ public PageInfo<Map<String, Object>> selectFiletypeList(String typename, String parentId, int pageIndex, int pageSize) {
|
|
|
PageHelper.startPage(pageIndex, pageSize);
|
|
|
List<DsjTreeFiletype> list = djWorkresourcelibraryCQuery.selectTreeFiles(parentId, typename, null, null);
|
|
|
PageInfo<Map<String, Object>> pList = new PageInfo(list);
|
|
|
return pList;
|
|
|
}
|
|
|
+
|
|
|
@Override
|
|
|
public DjWorkresourcelibrarytype getFiletype(String typeid) {
|
|
|
|
|
|
- DjWorkresourcelibrarytype filetype= djWorkresourcelibrarytypeMapper.selectByPrimaryKey(typeid);
|
|
|
- return filetype;
|
|
|
+ DjWorkresourcelibrarytype filetype = djWorkresourcelibrarytypeMapper.selectByPrimaryKey(typeid);
|
|
|
+ return filetype;
|
|
|
}
|
|
|
+
|
|
|
@Override
|
|
|
public int deleteFiletype(String id) {
|
|
|
DjWorkresourcelibrarytypeExample exp = new DjWorkresourcelibrarytypeExample();
|
|
@@ -139,12 +124,13 @@ public class WorkResourceLibraryServiceImpl implements WorkResourceLibraryServic
|
|
|
djWorkresourcelibrarytypeMapper.deleteByExample(exp);
|
|
|
return djWorkresourcelibrarytypeMapper.deleteByPrimaryKey(id);
|
|
|
}
|
|
|
+
|
|
|
@Override
|
|
|
- public RequsetData<String> saveFiletype(DjWorkresourcelibrarytype model) {
|
|
|
+ public RequsetData<String> saveFiletype(DjWorkresourcelibrarytype model) {
|
|
|
RequsetData<String> res = new RequsetData<String>();
|
|
|
int result = 0;
|
|
|
DjWorkresourcelibrarytype item = djWorkresourcelibrarytypeMapper.selectByPrimaryKey(model.getFiletypeid());
|
|
|
- if (item==null) {
|
|
|
+ if (item == null) {
|
|
|
model.setFiletypeid(UUID.randomUUID().toString());
|
|
|
result = djWorkresourcelibrarytypeMapper.insert(model);
|
|
|
} else {
|
|
@@ -162,11 +148,13 @@ public class WorkResourceLibraryServiceImpl implements WorkResourceLibraryServic
|
|
|
}
|
|
|
return res;
|
|
|
}
|
|
|
+
|
|
|
@Override
|
|
|
public DjWorkresourcelibrary getFileInfo(String fileId) {
|
|
|
|
|
|
return djWorkresourcelibraryMapper.selectByPrimaryKey(fileId);
|
|
|
}
|
|
|
+
|
|
|
@Override
|
|
|
public int deleteFile(String id) {
|
|
|
return djWorkresourcelibraryMapper.deleteByPrimaryKey(id);
|
|
@@ -177,7 +165,7 @@ public class WorkResourceLibraryServiceImpl implements WorkResourceLibraryServic
|
|
|
RequsetData<String> res = new RequsetData<String>();
|
|
|
int result = 0;
|
|
|
DjWorkresourcelibrary item = djWorkresourcelibraryMapper.selectByPrimaryKey(model.getFileid());
|
|
|
- if (item==null) {
|
|
|
+ if (item == null) {
|
|
|
model.setCreatedatetime(new Date());
|
|
|
model.setCreateuserid(userId);
|
|
|
model.setUpdatedatetime(new Date());
|
|
@@ -191,7 +179,7 @@ public class WorkResourceLibraryServiceImpl implements WorkResourceLibraryServic
|
|
|
item.setSsfl(model.getSsfl());
|
|
|
model.setUpdatedatetime(new Date());
|
|
|
model.setUpdateuserid(userId);
|
|
|
- result= djWorkresourcelibraryMapper.updateByPrimaryKeySelective(item);
|
|
|
+ result = djWorkresourcelibraryMapper.updateByPrimaryKeySelective(item);
|
|
|
}
|
|
|
if (result > 0) {
|
|
|
res.setSuccess(true);
|
|
@@ -203,26 +191,6 @@ public class WorkResourceLibraryServiceImpl implements WorkResourceLibraryServic
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
- public PageInfo<Map<String, Object>> FindFilesApp(String fileName, String fileTypeId, int pageIndex, int pageSize) {
|
|
|
-
|
|
|
-
|
|
|
- List<String> typeIds=new ArrayList<>();
|
|
|
-
|
|
|
- if(!stringUtils.IsNullOrEmpty(fileTypeId)) {
|
|
|
- typeIds = findFileTypeAndChildren(fileTypeId);
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- PageHelper.startPage(pageIndex, pageSize);
|
|
|
- PageHelper.orderBy("TREELEVEL asc,cast(filecode2 as unsigned int) asc");
|
|
|
- List<Map<String,Object>> list= djWorkresourcelibraryCQuery.FindDSJ_File(fileName,typeIds);
|
|
|
-
|
|
|
- PageInfo<Map<String, Object>> pList = new PageInfo(list);
|
|
|
-
|
|
|
- return pList;
|
|
|
- }
|
|
|
-
|
|
|
@Override
|
|
|
public PageInfo<Map<String, Object>> getFileList(String fileRefID, Integer fileTypeId, int pageIndex, int pageSize) {
|
|
|
|