Commit f99d5dff by 宋祥

Merge branch 'dev' of http://129.211.46.84:8800/platform/hg-smart into master-dc

parents 8f9de4e0 c8145030
...@@ -223,12 +223,13 @@ public class ServiceHGWD001D extends TreeService { ...@@ -223,12 +223,13 @@ public class ServiceHGWD001D extends TreeService {
String node = MapUtils.getString(queryMap, CommonConstant.Field.NODE); String node = MapUtils.getString(queryMap, CommonConstant.Field.NODE);
String ename = MapUtils.getString(queryMap, CommonConstant.Field.ENAME); String ename = MapUtils.getString(queryMap, CommonConstant.Field.ENAME);
String projCode = MapUtils.getString(queryMap, HGWD001.FIELD_PROJ_CODE); 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)) { if (CommonConstant.Field.ROOT.equals(node) || CommonConstant.Field.ROOT2.equals(node)) {
inInfo.addBlock(node).setRows(queryTopNode(node)); inInfo.addBlock(node).setRows(queryTopNode(node));
} else if (ProjectSourceEnum.contains(node)) { } else if (ProjectSourceEnum.contains(node)) {
inInfo.addBlock(node).setRows(queryFirstNode(node, ename)); inInfo.addBlock(node).setRows(queryFirstNode(node, ename));
} else { } else {
inInfo.addBlock(node).setRows(queryChildNode(projCode, node, ename)); inInfo.addBlock(node).setRows(queryChildNode(projCode, node, ename, pageCode));
} }
} catch (Exception e) { } catch (Exception e) {
LogUtils.setMsg(inInfo, e, "查询节点失败"); LogUtils.setMsg(inInfo, e, "查询节点失败");
...@@ -312,7 +313,7 @@ public class ServiceHGWD001D extends TreeService { ...@@ -312,7 +313,7 @@ public class ServiceHGWD001D extends TreeService {
String text = dbSc001.getProjName() + "(" + dbSc001.getProjCode() + ")"; String text = dbSc001.getProjName() + "(" + dbSc001.getProjCode() + ")";
Map leafMap = buildLeaf(parentId, dbSc001.getProjCode(), text, HgWdConstant.LeafType.P); 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(); //Long count = hgwd003s.stream().filter(hgwd003 -> hgwd003.getFileId().equals(dbSc001.getProjCode())).count();
leafMap.put("projCode", dbSc001.getProjCode()); leafMap.put("projCode", dbSc001.getProjCode());
...@@ -338,7 +339,7 @@ public class ServiceHGWD001D extends TreeService { ...@@ -338,7 +339,7 @@ public class ServiceHGWD001D extends TreeService {
* @param ename * @param ename
* @return * @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(); List<Map> results = new ArrayList();
String userId = UserSessionUtils.getLoginName(); String userId = UserSessionUtils.getLoginName();
// 查询项目来源 // 查询项目来源
...@@ -364,7 +365,7 @@ public class ServiceHGWD001D extends TreeService { ...@@ -364,7 +365,7 @@ public class ServiceHGWD001D extends TreeService {
for (HGWD001 dbWd001 : dbWd001s) { for (HGWD001 dbWd001 : dbWd001s) {
Map leafMap = buildLeaf(parentId, dbWd001.getFileId(), dbWd001.getFileName(), HgWdConstant.LeafType.C); 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("projCode", dbWd001.getProjCode());
leafMap.put("projName", dbWd001.getProjName()); leafMap.put("projName", dbWd001.getProjName());
leafMap.put("ename", dbWd001.getProjCode()); leafMap.put("ename", dbWd001.getProjCode());
...@@ -372,6 +373,9 @@ public class ServiceHGWD001D extends TreeService { ...@@ -372,6 +373,9 @@ public class ServiceHGWD001D extends TreeService {
leafMap.put("leafLevel", dbWd001.getLeafLevel()); leafMap.put("leafLevel", dbWd001.getLeafLevel());
leafMap.put("count", count); leafMap.put("count", count);
leafMap.put("filePath",dbWd001.getFilePath()); leafMap.put("filePath",dbWd001.getFilePath());
if ("HGWD002".equals(pageCode)&& count == 0){
continue;
}
if (!isManager && isSourceAuth) { if (!isManager && isSourceAuth) {
leafMap.put("isAuth", "1"); leafMap.put("isAuth", "1");
// 从已授权的信息中查找出自己 // 从已授权的信息中查找出自己
...@@ -433,16 +437,18 @@ public class ServiceHGWD001D extends TreeService { ...@@ -433,16 +437,18 @@ public class ServiceHGWD001D extends TreeService {
* @param fileId 目录ID * @param fileId 目录ID
* @return 节点数量 * @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<HGWD001> hgwd001List = HgWdUtils.HgWd001.queryChildren(fileId, isManager, isSourceAuth); //查询子级目录
List<String> childIds = Optional.ofNullable(hgwd001List).orElse(new ArrayList<>()).stream() List<String> childIds = Optional.ofNullable(hgwd001List).orElse(new ArrayList<>()).stream()
.map(HGWD001::getFileId).collect(Collectors.toList()); .map(HGWD001::getFileId).collect(Collectors.toList());
// 已授权人员信息 // 已授权人员信息
List<HGWD003> dbWd003List = HGWDTools.HgWd003.list(childIds); 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 dbWd099s = fWd099s == null ? 0 : fWd099s.size();
int count = 0; 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; count = 3;
}else if (dbWd003List!=null && dbWd003List.size() > 0){ }else if (dbWd003List!=null && dbWd003List.size() > 0){
count = 2; count = 2;
......
...@@ -3,6 +3,8 @@ package com.baosight.hggp.hg.wd.service; ...@@ -3,6 +3,8 @@ package com.baosight.hggp.hg.wd.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation; import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.core.dao.DaoBase; import com.baosight.hggp.core.dao.DaoBase;
import com.baosight.hggp.core.dao.DaoUtils; import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.sc.domain.HGSC001;
import com.baosight.hggp.hg.sc.tools.HGSCTools;
import com.baosight.hggp.hg.wd.domain.HGWD001; import com.baosight.hggp.hg.wd.domain.HGWD001;
import com.baosight.hggp.hg.wd.domain.HGWD003; import com.baosight.hggp.hg.wd.domain.HGWD003;
import com.baosight.hggp.hg.wd.tools.HGWDTools; import com.baosight.hggp.hg.wd.tools.HGWDTools;
...@@ -73,9 +75,18 @@ public class ServiceHGWD003A extends ServiceEPBase { ...@@ -73,9 +75,18 @@ public class ServiceHGWD003A extends ServiceEPBase {
// 获取FILE_ID // 获取FILE_ID
String fileId = MapUtils.getString(queryMap, HGWD003.FIELD_FILE_ID); String fileId = MapUtils.getString(queryMap, HGWD003.FIELD_FILE_ID);
AssertUtils.isEmpty(fileId, "请选择目录"); AssertUtils.isEmpty(fileId, "请选择目录");
// 确认是否是项目文件
HGSC001 sc001 = HGSCTools.Hgsc001.queryByCode(fileId);
List<Map> mapList =DaoBase.getInstance().query("HGWD001.queryFileChild",new HashMap<String,String>(){{ List<Map> mapList =DaoBase.getInstance().query("HGWD001.queryFileChild",new HashMap<String,String>(){{
put("parentId",fileId); put("parentId",fileId);
}}); }});
if (sc001 !=null){
//给项目文件添加授权用户
Map<String,String> map = new HashMap<>();
map.put(HGWD001.FIELD_FILE_ID,sc001.getProjCode());
map.put(HGWD001.FIELD_FILE_NAME,sc001.getProjName());
mapList.add(map);
}
List<String> fileIds = mapList.stream().map(map -> MapUtils.getString(map, HGWD001.FIELD_FILE_ID)).collect(Collectors.toList()); List<String> fileIds = mapList.stream().map(map -> MapUtils.getString(map, HGWD001.FIELD_FILE_ID)).collect(Collectors.toList());
List<HGWD003> hgwd003s = HGWDTools.HgWd003.list(fileIds); List<HGWD003> hgwd003s = HGWDTools.HgWd003.list(fileIds);
// 判断是否是管理员或项目经理 // 判断是否是管理员或项目经理
......
...@@ -489,6 +489,20 @@ public class HGWDTools { ...@@ -489,6 +489,20 @@ public class HGWDTools {
return results; 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 * @param fileIds
* @return * @return
......
...@@ -98,6 +98,7 @@ $(function () { ...@@ -98,6 +98,7 @@ $(function () {
// 设置选中节点 // 设置选中节点
treeSelectClick(model); treeSelectClick(model);
inInfo.set("inqu_status-0-projCode", $("#inqu_status-0-projCode").val()); inInfo.set("inqu_status-0-projCode", $("#inqu_status-0-projCode").val());
inInfo.set("inqu_status-0-pageCode","HGWD002");
return inInfo; return inInfo;
}, },
select: function (e) { 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