Commit c8145030 by liuyang

文档浏览没有发布附件不显示文件夹

parent ac2163ba
......@@ -223,12 +223,13 @@ public class ServiceHGWD001D extends TreeService {
String node = MapUtils.getString(queryMap, CommonConstant.Field.NODE);
String ename = MapUtils.getString(queryMap, CommonConstant.Field.ENAME);
String projCode = MapUtils.getString(queryMap, HGWD001.FIELD_PROJ_CODE);
String pageCode = MapUtils.getString(queryMap, "pageCode");
if (CommonConstant.Field.ROOT.equals(node) || CommonConstant.Field.ROOT2.equals(node)) {
inInfo.addBlock(node).setRows(queryTopNode(node));
} else if (ProjectSourceEnum.contains(node)) {
inInfo.addBlock(node).setRows(queryFirstNode(node, ename));
} else {
inInfo.addBlock(node).setRows(queryChildNode(projCode, node, ename));
inInfo.addBlock(node).setRows(queryChildNode(projCode, node, ename, pageCode));
}
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "查询节点失败");
......@@ -312,7 +313,7 @@ public class ServiceHGWD001D extends TreeService {
String text = dbSc001.getProjName() + "(" + dbSc001.getProjCode() + ")";
Map leafMap = buildLeaf(parentId, dbSc001.getProjCode(), text, HgWdConstant.LeafType.P);
int count = getChildCount(dbSc001.getProjCode(), isManager, isSourceAuth);
int count = getChildCount(dbSc001.getProjCode(), isManager, isSourceAuth, null);
//Long count = hgwd003s.stream().filter(hgwd003 -> hgwd003.getFileId().equals(dbSc001.getProjCode())).count();
leafMap.put("projCode", dbSc001.getProjCode());
......@@ -338,7 +339,7 @@ public class ServiceHGWD001D extends TreeService {
* @param ename
* @return
*/
public List queryChildNode(String projCode, String parentId, String ename) {
public List queryChildNode(String projCode, String parentId, String ename, String pageCode) {
List<Map> results = new ArrayList();
String userId = UserSessionUtils.getLoginName();
// 查询项目来源
......@@ -364,7 +365,7 @@ public class ServiceHGWD001D extends TreeService {
for (HGWD001 dbWd001 : dbWd001s) {
Map leafMap = buildLeaf(parentId, dbWd001.getFileId(), dbWd001.getFileName(), HgWdConstant.LeafType.C);
int count = getChildCount(dbWd001.getFileId(), isManager, isSourceAuth);
int count = getChildCount(dbWd001.getFileId(), isManager, isSourceAuth, pageCode);
leafMap.put("projCode", dbWd001.getProjCode());
leafMap.put("projName", dbWd001.getProjName());
leafMap.put("ename", dbWd001.getProjCode());
......@@ -372,6 +373,9 @@ public class ServiceHGWD001D extends TreeService {
leafMap.put("leafLevel", dbWd001.getLeafLevel());
leafMap.put("count", count);
leafMap.put("filePath",dbWd001.getFilePath());
if ("HGWD002".equals(pageCode)&& count == 0){
continue;
}
if (!isManager && isSourceAuth) {
leafMap.put("isAuth", "1");
// 从已授权的信息中查找出自己
......@@ -433,16 +437,18 @@ public class ServiceHGWD001D extends TreeService {
* @param fileId 目录ID
* @return 节点数量
*/
public int getChildCount(String fileId, boolean isManager, boolean isSourceAuth) {
public int getChildCount(String fileId, boolean isManager, boolean isSourceAuth,String pageCode) {
List<HGWD001> hgwd001List = HgWdUtils.HgWd001.queryChildren(fileId, isManager, isSourceAuth); //查询子级目录
List<String> childIds = Optional.ofNullable(hgwd001List).orElse(new ArrayList<>()).stream()
.map(HGWD001::getFileId).collect(Collectors.toList());
// 已授权人员信息
List<HGWD003> dbWd003List = HGWDTools.HgWd003.list(childIds);
List<HGWD099> fWd099s = HGWDTools.HgWd099.queryByBiz("WD",childIds);
List<HGWD099> fWd099s = HGWDTools.HgWd099.queryByBiz("WD", childIds, pageCode);
int dbWd099s = fWd099s == null ? 0 : fWd099s.size();
int count = 0;
if (dbWd003List!=null && dbWd003List.size() > 0 && dbWd099s > 0){
if ("HGWD002".equals(pageCode) && dbWd099s == 0){
return 0;
} else if (dbWd003List!=null && dbWd003List.size() > 0 && dbWd099s > 0){
count = 3;
}else if (dbWd003List!=null && dbWd003List.size() > 0){
count = 2;
......
......@@ -489,6 +489,20 @@ public class HGWDTools {
return results;
}
public static List<HGWD099> queryByBiz(String bizType, List<String> bizIds,String pageCode) {
if (CollectionUtils.isEmpty(bizIds)){
return null;
}
List<HGWD099> results = DaoBase.getInstance().query(HGWD099.QUERY,
new HashMap<String, Object>() {{
put("bizType", bizType==null?"WD":bizType);
put("status", "HGWD002".equals(pageCode)?1:0);
put("bizIds", bizIds);
}}
);
return results;
}
/**
* @param fileIds
* @return
......
......@@ -98,6 +98,7 @@ $(function () {
// 设置选中节点
treeSelectClick(model);
inInfo.set("inqu_status-0-projCode", $("#inqu_status-0-projCode").val());
inInfo.set("inqu_status-0-pageCode","HGWD002");
return inInfo;
},
select: function (e) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment