Commit 6ba30236 by 宋祥

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

parents 6e345392 208978a2
...@@ -49,6 +49,7 @@ public class HGWD002 extends DaoEPBase { ...@@ -49,6 +49,7 @@ public class HGWD002 extends DaoEPBase {
public static final String FIELD_DOWNLOAD_NUM = "downloadNum"; /* 下载次数*/ public static final String FIELD_DOWNLOAD_NUM = "downloadNum"; /* 下载次数*/
public static final String FIELD_DOC_TYPE = "docType"; /* 文件类型*/ public static final String FIELD_DOC_TYPE = "docType"; /* 文件类型*/
public static final String FIELD_CHANGE_CONTENT = "changeContent"; /* 变更内容*/ public static final String FIELD_CHANGE_CONTENT = "changeContent"; /* 变更内容*/
public static final String FIELD_FILE_PATH = "filePath"; /* 文件路径*/
public static final String COL_ID = "ID"; public static final String COL_ID = "ID";
public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码*/ public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码*/
...@@ -75,6 +76,7 @@ public class HGWD002 extends DaoEPBase { ...@@ -75,6 +76,7 @@ public class HGWD002 extends DaoEPBase {
public static final String COL_RELEASE_DATE = "RELEASE_DATE"; /* 发布时间*/ public static final String COL_RELEASE_DATE = "RELEASE_DATE"; /* 发布时间*/
public static final String COL_PREVIEW_NUM = "PREVIEW_NUM"; /* 预览次数*/ public static final String COL_PREVIEW_NUM = "PREVIEW_NUM"; /* 预览次数*/
public static final String COL_DOWNLOAD_NUM = "DOWNLOAD_NUM"; /* 下载次数*/ public static final String COL_DOWNLOAD_NUM = "DOWNLOAD_NUM"; /* 下载次数*/
public static final String COL_FILE_PATH = "FILE_PATH"; /* 文件路径*/
public static final String QUERY = "HGWD002.query"; public static final String QUERY = "HGWD002.query";
public static final String COUNT = "HGWD002.count"; public static final String COUNT = "HGWD002.count";
...@@ -109,6 +111,7 @@ public class HGWD002 extends DaoEPBase { ...@@ -109,6 +111,7 @@ public class HGWD002 extends DaoEPBase {
private Integer downloadNum = new Integer(0); /* 下载次数*/ private Integer downloadNum = new Integer(0); /* 下载次数*/
private String docType = " "; /* 文件类型*/ private String docType = " "; /* 文件类型*/
private String changeContent = " "; /* 变更内容*/ private String changeContent = " "; /* 变更内容*/
private String filePath = " "; /* 文件路径*/
/** /**
* initialize the metadata. * initialize the metadata.
...@@ -224,6 +227,10 @@ public class HGWD002 extends DaoEPBase { ...@@ -224,6 +227,10 @@ public class HGWD002 extends DaoEPBase {
eiColumn = new EiColumn(FIELD_CHANGE_CONTENT); eiColumn = new EiColumn(FIELD_CHANGE_CONTENT);
eiColumn.setDescName("变更内容"); eiColumn.setDescName("变更内容");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_FILE_PATH);
eiColumn.setDescName("文件路径");
eiMetadata.addMeta(eiColumn);
} }
/** /**
...@@ -658,6 +665,15 @@ public class HGWD002 extends DaoEPBase { ...@@ -658,6 +665,15 @@ public class HGWD002 extends DaoEPBase {
public void setChangeContent(String changeContent) { public void setChangeContent(String changeContent) {
this.changeContent = changeContent; this.changeContent = changeContent;
} }
public String getFilePath() {
return filePath;
}
public void setFilePath(String filePath) {
this.filePath = filePath;
}
/** /**
* get the value from Map. * get the value from Map.
* *
...@@ -693,6 +709,7 @@ public class HGWD002 extends DaoEPBase { ...@@ -693,6 +709,7 @@ public class HGWD002 extends DaoEPBase {
setDownloadNum(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DOWNLOAD_NUM)), downloadNum)); setDownloadNum(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DOWNLOAD_NUM)), downloadNum));
setDocType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DOC_TYPE)), docType)); setDocType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DOC_TYPE)), docType));
setChangeContent(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CHANGE_CONTENT)), changeContent)); setChangeContent(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CHANGE_CONTENT)), changeContent));
setFilePath(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FILE_PATH)), filePath));
} }
/** /**
...@@ -729,6 +746,7 @@ public class HGWD002 extends DaoEPBase { ...@@ -729,6 +746,7 @@ public class HGWD002 extends DaoEPBase {
map.put(FIELD_DOWNLOAD_NUM, StringUtils.toString(downloadNum, eiMetadata.getMeta(FIELD_DOWNLOAD_NUM))); map.put(FIELD_DOWNLOAD_NUM, StringUtils.toString(downloadNum, eiMetadata.getMeta(FIELD_DOWNLOAD_NUM)));
map.put(FIELD_DOC_TYPE, StringUtils.toString(docType, eiMetadata.getMeta(FIELD_DOC_TYPE))); map.put(FIELD_DOC_TYPE, StringUtils.toString(docType, eiMetadata.getMeta(FIELD_DOC_TYPE)));
map.put(FIELD_CHANGE_CONTENT, StringUtils.toString(changeContent, eiMetadata.getMeta(FIELD_CHANGE_CONTENT))); map.put(FIELD_CHANGE_CONTENT, StringUtils.toString(changeContent, eiMetadata.getMeta(FIELD_CHANGE_CONTENT)));
map.put(FIELD_FILE_PATH, StringUtils.toString(filePath, eiMetadata.getMeta(FIELD_FILE_PATH)));
return map; return map;
} }
......
...@@ -7,7 +7,6 @@ import com.baosight.hggp.core.tools.CodeValueTools; ...@@ -7,7 +7,6 @@ import com.baosight.hggp.core.tools.CodeValueTools;
import com.baosight.hggp.hg.constant.HGConstant; import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.sc.domain.HGSC001; import com.baosight.hggp.hg.sc.domain.HGSC001;
import com.baosight.hggp.hg.sc.enums.ProjectSourceEnum; import com.baosight.hggp.hg.sc.enums.ProjectSourceEnum;
import com.baosight.hggp.hg.sc.tools.HGSCTools;
import com.baosight.hggp.hg.wd.constant.HgWdConstant; import com.baosight.hggp.hg.wd.constant.HgWdConstant;
import com.baosight.hggp.hg.wd.constant.HgWdSqlConstant; import com.baosight.hggp.hg.wd.constant.HgWdSqlConstant;
import com.baosight.hggp.hg.wd.domain.HGWD001; import com.baosight.hggp.hg.wd.domain.HGWD001;
...@@ -36,7 +35,6 @@ import java.util.HashMap; ...@@ -36,7 +35,6 @@ import java.util.HashMap;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Optional;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -227,7 +225,7 @@ public class ServiceHGWD001D extends TreeService { ...@@ -227,7 +225,7 @@ public class ServiceHGWD001D extends TreeService {
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, pageCode));
} else { } else {
inInfo.addBlock(node).setRows(queryChildNode(projCode, node, ename, pageCode)); inInfo.addBlock(node).setRows(queryChildNode(projCode, node, ename, pageCode));
} }
...@@ -288,42 +286,41 @@ public class ServiceHGWD001D extends TreeService { ...@@ -288,42 +286,41 @@ public class ServiceHGWD001D extends TreeService {
* *
* @param parentId * @param parentId
* @param ename * @param ename
* @param pageCode 页码
* @return * @return
*/ */
public List queryFirstNode(String parentId, String ename) { public List queryFirstNode(String parentId, String ename, String pageCode) {
// SPARE:备件制造图不限制;非管理员仅查询自己有权限的项目 // SPARE:备件制造图不限制;非管理员仅查询自己有权限的项目
String userId = UserSessionUtils.getLoginName(); String userId = UserSessionUtils.getLoginName();
boolean isManager = HgWdUtils.HgWd009.isManager(userId); boolean isManager = HgWdUtils.HgWd009.isManager(userId);
boolean isSourceAuth = !ProjectSourceEnum.SPARE.getCode().equals(parentId); boolean isSpare = HgWdUtils.HgWd001.isSpare(parentId);
List<Map> results = new ArrayList(); List<Map> results = new ArrayList();
Map queryMap = new HashMap<>(); Map queryMap = new HashMap<>();
queryMap.put("ename", ename); queryMap.put("ename", ename);
queryMap.put(HGSC001.FIELD_project_source, parentId); queryMap.put(HGSC001.FIELD_project_source, parentId);
queryMap.put(HGSC001.FIELD_approval_status, HGConstant.ApprovalStatus.YS); queryMap.put(HGSC001.FIELD_approval_status, HGConstant.ApprovalStatus.YS);
if (isSourceAuth && !isManager) { if (!isSpare && !isManager) {
queryMap.put("userId", userId); queryMap.put("userId", userId);
} }
List<HGSC001> dbSc001s = dao.query("HGSC101.query", queryMap); List<HGSC001> dbSc001s = dao.query("HGSC101.query", queryMap);
if (CollectionUtils.isEmpty(dbSc001s)) { if (CollectionUtils.isEmpty(dbSc001s)) {
return results; return results;
} }
//List<String> projCodes = dbSc001s.stream().map(HGSC001::getProjCode).distinct().collect(Collectors.toList());
//List<HGWD003> hgwd003s = HGWDTools.HgWd003.list(projCodes);
for (HGSC001 dbSc001 : dbSc001s) { for (HGSC001 dbSc001 : dbSc001s) {
int count = getChildCount(dbSc001.getProjCode(), isManager, isSpare, pageCode);
if ("HGWD002".equals(pageCode) && count == 0) {
continue;
}
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, null);
//Long count = hgwd003s.stream().filter(hgwd003 -> hgwd003.getFileId().equals(dbSc001.getProjCode())).count();
leafMap.put("projCode", dbSc001.getProjCode()); leafMap.put("projCode", dbSc001.getProjCode());
leafMap.put("projName", dbSc001.getProjName()); leafMap.put("projName", dbSc001.getProjName());
leafMap.put("ename", dbSc001.getProjCode()); leafMap.put("ename", dbSc001.getProjCode());
leafMap.put("type", "1"); leafMap.put("type", "1");
leafMap.put("leafLevel", "0"); leafMap.put("leafLevel", "0");
leafMap.put("count", count); leafMap.put("count", count);
leafMap.put("isAuth", isSourceAuth ? "1" : "0"); leafMap.put("isAuth", isSpare ? "0" : "1");
leafMap.put("filePath", ProjectSourceEnum.getByCode(parentId).getName()+"/"+text); leafMap.put("filePath", ProjectSourceEnum.getByCode(parentId).getName() + "/" + text);
results.add(leafMap); results.add(leafMap);
} }
// 设置叶子节点 // 设置叶子节点
...@@ -342,17 +339,15 @@ public class ServiceHGWD001D extends TreeService { ...@@ -342,17 +339,15 @@ public class ServiceHGWD001D extends TreeService {
public List queryChildNode(String projCode, String parentId, String ename, String pageCode) { 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();
// 查询项目来源 // 查询项目来源,备件制造图不需要授权
HGSC001 dbSc001 = HGSCTools.Hgsc001.getByCode(projCode); boolean isSpare = HgWdUtils.HgWd001.isSpare(parentId, projCode);
// 备件制造图不需要授权,true:需要权限
boolean isSourceAuth = !ProjectSourceEnum.SPARE.getCode().equals(dbSc001.getProjectSource());
// 是否文档管理员 // 是否文档管理员
boolean isManager = HgWdUtils.HgWd009.isManager(); boolean isManager = HgWdUtils.HgWd009.isManager();
Map queryMap = new HashMap(); Map queryMap = new HashMap();
queryMap.put("parentId", parentId); queryMap.put("parentId", parentId);
queryMap.put("ename", ename); queryMap.put("ename", ename);
// 递归查询有权限的文件夹,管理员和备件制造图不限制 // 递归查询有权限的文件夹,管理员和备件制造图不限制
if (!isManager && isSourceAuth) { if (!isManager && !isSpare) {
queryMap.put("treeUserId", userId); queryMap.put("treeUserId", userId);
} }
List<HGWD001> dbWd001s = dao.query(HGWD001.QUERY, queryMap); List<HGWD001> dbWd001s = dao.query(HGWD001.QUERY, queryMap);
...@@ -363,8 +358,11 @@ public class ServiceHGWD001D extends TreeService { ...@@ -363,8 +358,11 @@ public class ServiceHGWD001D extends TreeService {
// 查询目录授权人数 // 查询目录授权人数
List<HGWD003> dbWd003s = HGWDTools.HgWd003.list(fileIds); List<HGWD003> dbWd003s = HGWDTools.HgWd003.list(fileIds);
for (HGWD001 dbWd001 : dbWd001s) { for (HGWD001 dbWd001 : dbWd001s) {
int count = getChildCount(dbWd001.getFileId(), isManager, isSpare, pageCode);
if ("HGWD002".equals(pageCode) && count == 0) {
continue;
}
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, 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,10 +370,7 @@ public class ServiceHGWD001D extends TreeService { ...@@ -372,10 +370,7 @@ 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) { if (!isManager && !isSpare) {
continue;
}
if (!isManager && isSourceAuth) {
leafMap.put("isAuth", "1"); leafMap.put("isAuth", "1");
// 从已授权的信息中查找出自己 // 从已授权的信息中查找出自己
HGWD003 dbWd003 = dbWd003s == null ? null : dbWd003s.stream().filter(item HGWD003 dbWd003 = dbWd003s == null ? null : dbWd003s.stream().filter(item
...@@ -434,25 +429,23 @@ public class ServiceHGWD001D extends TreeService { ...@@ -434,25 +429,23 @@ public class ServiceHGWD001D extends TreeService {
/** /**
* 获取子级节点数量 * 获取子级节点数量
* @param fileId 目录ID * @param fileId 目录ID
* @param isSourceAuth true:需要权限 * @param isSpare true:备件制造图
* @return 节点数量 * @return 节点数量
*/ */
public int getChildCount(String fileId, boolean isManager, boolean isSourceAuth, String pageCode) { public int getChildCount(String fileId, boolean isManager, boolean isSpare, String pageCode) {
List<HGWD001> hgwd001List = HgWdUtils.HgWd001.queryChildren(fileId, isManager, isSourceAuth); //查询子级目录 List<String> childIds = HgWdUtils.HgWd001.queryChildrenId(fileId, isManager, isSpare); //查询子级目录
List<String> childIds = Optional.ofNullable(hgwd001List).orElse(new ArrayList<>()).stream()
.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, pageCode); 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 ("HGWD002".equals(pageCode) && dbWd099s == 0){ if ("HGWD002".equals(pageCode) && dbWd099s == 0) {
return 0; return 0;
} else if (dbWd003List!=null && dbWd003List.size() > 0 && dbWd099s > 0){ } else if (dbWd003List != null && !dbWd003List.isEmpty() && dbWd099s > 0) {
count = 3; count = 3;
}else if (dbWd003List!=null && dbWd003List.size() > 0){ } else if (dbWd003List != null && !dbWd003List.isEmpty()) {
count = 2; count = 2;
}else if (dbWd099s > 0){ } else if (dbWd099s > 0) {
count = 1; count = 1;
} }
return count; return count;
......
...@@ -16,8 +16,10 @@ import com.baosight.hggp.util.StringUtils; ...@@ -16,8 +16,10 @@ import com.baosight.hggp.util.StringUtils;
import com.baosight.iplat4j.core.ei.EiConstant; import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo; import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceBase; import com.baosight.iplat4j.core.service.impl.ServiceBase;
import org.apache.commons.collections.CollectionUtils;
import java.util.Arrays; import java.util.Arrays;
import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
...@@ -60,17 +62,22 @@ public class ServiceHGWD002 extends ServiceBase { ...@@ -60,17 +62,22 @@ public class ServiceHGWD002 extends ServiceBase {
if (StringUtils.isBlank(fileId)) { if (StringUtils.isBlank(fileId)) {
return inInfo; return inInfo;
} }
String parentId = MapUtils.getString(queryRow, HGWD001.FIELD_PARENT_ID);
String projCode = MapUtils.getString(queryRow, HGWD001.FIELD_PROJ_CODE); String projCode = MapUtils.getString(queryRow, HGWD001.FIELD_PROJ_CODE);
// 判断是否备件制造图 // 判断是否备件制造图
boolean isSpare = HgWdUtils.HgWd001.isSpare(parentId, projCode); boolean isSpare = HgWdUtils.HgWd001.isSpare(fileId, projCode);
boolean isManager = HgWdUtils.HgWd009.isManager();
// 仅查询已发布的文件 // 仅查询已发布的文件
queryRow.put(HGWD001.FIELD_STATUS, HgWdConstant.FileStatus.S_1); queryRow.put(HGWD001.FIELD_STATUS, HgWdConstant.FileStatus.S_1);
// 管理员、无权限的目录不做权限验证 // 管理员、无权限的目录不做权限验证
if (!(isSpare || HgWdUtils.HgWd009.isManager())) { if (!isSpare && !isManager) {
queryRow.put(User.FIELD_USER_ID, UserSessionUtils.getUserId()); queryRow.put(User.FIELD_USER_ID, UserSessionUtils.getUserId());
} }
builder(inInfo); // 查询有权限的子集目录
List<String> childrenIds = HgWdUtils.HgWd001.queryChildrenId(fileId, isManager, isSpare);
if (CollectionUtils.isEmpty(childrenIds)) {
return inInfo;
}
queryRow.put("fileIds", childrenIds);
inInfo = super.query(inInfo, HGWD002.QUERY, new HGWD002()); inInfo = super.query(inInfo, HGWD002.QUERY, new HGWD002());
} catch (Exception e) { } catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败"); LogUtils.setDetailMsg(inInfo, e, "查询失败");
...@@ -78,79 +85,4 @@ public class ServiceHGWD002 extends ServiceBase { ...@@ -78,79 +85,4 @@ public class ServiceHGWD002 extends ServiceBase {
return inInfo; return inInfo;
} }
public void builder(EiInfo eiInfo) {
String[] orderBy = eiInfo.getBlock(EiConstant.resultBlock).getString("orderBy").split(",");
if (orderBy.length > 0) {
StringBuilder orderByStr = new StringBuilder();
for (int i = 0; i < orderBy.length; i++) {
if (i != 0 && i != orderByStr.length() - 1) {
orderByStr.append(",");
}
switch (orderBy[i]) {
case "fileType asc":
orderByStr.append(orderBy[i].replace("fileType asc", "a.fileType asc"));
break;
case "docId asc":
orderByStr.append(orderBy[i].replace("docId asc", "b.docId asc"));
break;
case "docName asc":
orderByStr.append(orderBy[i].replace("docName asc", "b.docName asc"));
break;
case "docVersion asc":
orderByStr.append(orderBy[i].replace("docVersion asc", "b.docVersion asc"));
break;
case "createdTime asc":
orderByStr.append(orderBy[i].replace("createdTime asc", "b.createdTime asc"));
break;
case "updatedTime asc":
orderByStr.append(orderBy[i].replace("updatedTime asc", "b.updatedTime asc"));
break;
case "previewNum asc":
orderByStr.append(orderBy[i].replace("previewNum asc", "b.previewNum asc"));
break;
case "downloadNum asc":
orderByStr.append(orderBy[i].replace("downloadNum asc", "b.downloadNum asc"));
break;
case "fileType desc":
orderByStr.append(orderBy[i].replace("fileType desc", "a.fileType desc"));
break;
case "docId desc":
orderByStr.append(orderBy[i].replace("docId desc", "b.docId desc"));
break;
case "docName desc":
orderByStr.append(orderBy[i].replace("docName desc", "b.docName desc"));
break;
case "docVersion desc":
orderByStr.append(orderBy[i].replace("docVersion desc", "b.docVersion desc"));
break;
case "createdTime desc":
orderByStr.append(orderBy[i].replace("createdTime desc", "b.createdTime desc"));
break;
case "previewNum desc":
orderByStr.append(orderBy[i].replace("previewNum desc", "b.previewNum desc"));
break;
case "downloadNum desc":
orderByStr.append(orderBy[i].replace("downloadNum desc", "b.downloadNum desc"));
break;
case "updatedTime desc":
orderByStr.append(orderBy[i].replace("updatedTime desc", "b.updatedTime desc"));
break;
case "changeContent asc":
orderByStr.append(orderBy[i].replace("downloadNum desc", "b.changeContent asc"));
break;
case "changeContent desc":
orderByStr.append(orderBy[i].replace("updatedTime desc", "b.changeContent desc"));
break;
default:
if (!orderBy[i].isEmpty()) {
orderByStr.append(orderBy[i]);
} else {
orderByStr.append(orderBy[i]);
}
break;
}
}
eiInfo.getBlock(EiConstant.resultBlock).set("orderBy", orderByStr);
}
}
} }
...@@ -26,7 +26,8 @@ ...@@ -26,7 +26,8 @@
B.CREATED_TIME as "createdTime", <!-- 创建时间 --> B.CREATED_TIME as "createdTime", <!-- 创建时间 -->
B.UPDATED_BY as "updatedBy", <!-- 记录修改者 --> B.UPDATED_BY as "updatedBy", <!-- 记录修改者 -->
B.UPDATED_NAME as "updatedName", <!-- 记录修改名称 --> B.UPDATED_NAME as "updatedName", <!-- 记录修改名称 -->
B.UPDATED_TIME as "updatedTime" <!-- 记录修改时间 --> B.UPDATED_TIME as "updatedTime", <!-- 记录修改时间 -->
B.FILE_PATH as "filePath" <!-- 文件路径 -->
</sql> </sql>
<sql id="condition"> <sql id="condition">
...@@ -37,21 +38,15 @@ ...@@ -37,21 +38,15 @@
<isNotEmpty prepend=" AND " property="id"> <isNotEmpty prepend=" AND " property="id">
A.ID = #id# A.ID = #id#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
A.COMPANY_NAME LIKE CONCAT('%', #companyName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName"> <isNotEmpty prepend=" AND " property="projName">
A.PROJ_NAME LIKE CONCAT('%', #projName#, '%') A.PROJ_NAME LIKE CONCAT('%', #projName#, '%')
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="fileId"> <isNotEmpty prepend=" AND " property="fileIds">
A.FILE_ID = #fileId# A.FILE_ID IN <iterate open="(" conjunction="," close=")" property="fileIds">#fileIds[]#</iterate>
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="fileType"> <isNotEmpty prepend=" AND " property="fileType">
A.FILE_TYPE = #fileType# A.FILE_TYPE = #fileType#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="fileName">
A.FILE_NAME LIKE CONCAT('%', #fileName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status"> <isNotEmpty prepend=" AND " property="status">
B.STATUS = #status# B.STATUS = #status#
</isNotEmpty> </isNotEmpty>
...@@ -73,6 +68,9 @@ ...@@ -73,6 +68,9 @@
<isNotEmpty prepend=" AND " property="docType"> <isNotEmpty prepend=" AND " property="docType">
B.DOC_TYPE = #docType# B.DOC_TYPE = #docType#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="filePath">
B.FILE_PATH LIKE CONCAT('%', #filePath#, '%')
</isNotEmpty>
</sql> </sql>
<sql id="orderBy"> <sql id="orderBy">
......
...@@ -9,7 +9,10 @@ import com.baosight.hggp.hg.wd.domain.HGWD003; ...@@ -9,7 +9,10 @@ import com.baosight.hggp.hg.wd.domain.HGWD003;
import com.baosight.hggp.hg.wd.tools.HGWDTools; import com.baosight.hggp.hg.wd.tools.HGWDTools;
import com.baosight.hggp.util.StringUtils; import com.baosight.hggp.util.StringUtils;
import org.apache.commons.collections.CollectionUtils;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
/** /**
* @author:songx * @author:songx
...@@ -92,14 +95,31 @@ public class HgWdUtils { ...@@ -92,14 +95,31 @@ public class HgWdUtils {
/** /**
* 查询子节点 * 查询子节点
* *
* @param parentId 父级节点
* @param isManager true:管理员
* @param isSpare true:备件制造图
* @return
*/
public static List<String> queryChildrenId(String parentId, boolean isManager, boolean isSpare) {
// 管理员或者备件制造图查询所有子节点;其余查询当前节点有权限的子节点
List<HGWD001> dbWd001s = queryChildren(parentId, isManager, isSpare);
if (CollectionUtils.isEmpty(dbWd001s)) {
return null;
}
return dbWd001s.stream().map(HGWD001::getFileId).collect(Collectors.toList());
}
/**
* 查询子节点
*
* @param parentId * @param parentId
* @param isManager true:管理员 * @param isManager true:管理员
* @param isSourceAuth true:需要权限 * @param isSpare true:备件制造图
* @return * @return
*/ */
public static List<HGWD001> queryChildren(String parentId, boolean isManager, boolean isSourceAuth) { public static List<HGWD001> queryChildren(String parentId, boolean isManager, boolean isSpare) {
// 管理员或者备件制造图查询所有子节点;其余查询当前节点有权限的子节点 // 管理员或者备件制造图查询所有子节点;其余查询当前节点有权限的子节点
if (isManager || !isSourceAuth) { if (isManager || isSpare) {
return HGWDTools.HgWd001.queryChildren(parentId); return HGWDTools.HgWd001.queryChildren(parentId);
} else { } else {
return HGWDTools.HgWd001.queryChildrenByUser(parentId); return HGWDTools.HgWd001.queryChildrenByUser(parentId);
...@@ -107,7 +127,6 @@ public class HgWdUtils { ...@@ -107,7 +127,6 @@ public class HgWdUtils {
} }
} }
/** /**
* @author:songx * @author:songx
* @date:2024/8/19,14:57 * @date:2024/8/19,14:57
......
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
<EF:EFColumn ename="fieldCode" cname="字段英文名" enable="false" width="180" align="left" <EF:EFColumn ename="fieldCode" cname="字段英文名" enable="false" width="180" align="left"
alias="a.fieldCode"/> alias="a.fieldCode"/>
<EF:EFColumn ename="fieldName" cname="字段中文名" enable="false" width="180" align="left" sort="false"/> <EF:EFColumn ename="fieldName" cname="字段中文名" enable="false" width="180" align="left" sort="false"/>
<EF:EFColumn ename="viewSql" cname="视图语句" enable="false" width="200" align="left" sort="false"/>
<EF:EFColumn ename="aliasName" cname="字段别名" enable="false" width="160" align="left" sort="false"/> <EF:EFColumn ename="aliasName" cname="字段别名" enable="false" width="160" align="left" sort="false"/>
<EF:EFColumn ename="sortNum" cname="排序" width="100" align="center" required="true" alias="a.sortNum"/> <EF:EFColumn ename="sortNum" cname="排序" width="100" align="center" required="true" alias="a.sortNum"/>
<EF:EFColumn ename="createdName" cname="创建人" enable="false" align="center" sort="false"/> <EF:EFColumn ename="createdName" cname="创建人" enable="false" align="center" sort="false"/>
......
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
<EF:EFColumn ename="tableName" cname="页面中文名" enable="false" width="140" align="left"/> <EF:EFColumn ename="tableName" cname="页面中文名" enable="false" width="140" align="left"/>
<EF:EFColumn ename="fieldCode" cname="字段英文名" enable="false" width="160" align="left"/> <EF:EFColumn ename="fieldCode" cname="字段英文名" enable="false" width="160" align="left"/>
<EF:EFColumn ename="fieldName" cname="字段中文名" enable="false" width="180" align="left"/> <EF:EFColumn ename="fieldName" cname="字段中文名" enable="false" width="180" align="left"/>
<EF:EFColumn ename="viewSql" cname="视图语句" enable="false" width="200" align="left"/>
<EF:EFColumn ename="aliasName" cname="字段别名" enable="false" width="160" align="left"/> <EF:EFColumn ename="aliasName" cname="字段别名" enable="false" width="160" align="left"/>
<EF:EFColumn ename="sortNum" cname="排序" enable="false" width="80" align="center"/> <EF:EFColumn ename="sortNum" cname="排序" enable="false" width="80" align="center"/>
</EF:EFGrid> </EF:EFGrid>
......
...@@ -26,9 +26,8 @@ ...@@ -26,9 +26,8 @@
<EF:EFColumn ename="tableName" cname="页面中文名" enable="false" width="140" align="left" sort="false"/> <EF:EFColumn ename="tableName" cname="页面中文名" enable="false" width="140" align="left" sort="false"/>
<EF:EFColumn ename="fieldCode" cname="字段英文名" enable="false" width="180" align="left"/> <EF:EFColumn ename="fieldCode" cname="字段英文名" enable="false" width="180" align="left"/>
<EF:EFColumn ename="fieldName" cname="字段中文名" enable="false" width="180" align="left" sort="false"/> <EF:EFColumn ename="fieldName" cname="字段中文名" enable="false" width="180" align="left" sort="false"/>
<EF:EFColumn ename="viewSql" cname="视图SQL" enable="false" width="200" align="left" sort="false"/>
<EF:EFColumn ename="aliasName" cname="字段别名" enable="false" width="160" align="left" sort="false"/> <EF:EFColumn ename="aliasName" cname="字段别名" enable="false" width="160" align="left" sort="false"/>
<EF:EFColumn ename="sortNum" cname="排序" width="80" align="center" required="true"/> <EF:EFColumn ename="sortNum" cname="排序" width="100" align="center" required="true"/>
<EF:EFComboColumn ename="isDefault" cname="是否默认" width="100" align="center" copy="true" required="true" <EF:EFComboColumn ename="isDefault" cname="是否默认" width="100" align="center" copy="true" required="true"
sort="false"> sort="false">
<EF:EFCodeOption codeName="hggp.common.yesNo"/> <EF:EFCodeOption codeName="hggp.common.yesNo"/>
......
...@@ -24,9 +24,6 @@ ...@@ -24,9 +24,6 @@
required="true"/> required="true"/>
</div> </div>
<div class="row"> <div class="row">
<EF:EFInput ename="viewSql" cname="视图语句" blockId="result" row="0" colWidth="6" ratio="2:10"/>
</div>
<div class="row">
<EF:EFInput ename="aliasName" cname="别名" blockId="result" row="0" colWidth="6" ratio="2:10" <EF:EFInput ename="aliasName" cname="别名" blockId="result" row="0" colWidth="6" ratio="2:10"
required="true"/> required="true"/>
</div> </div>
......
...@@ -98,7 +98,7 @@ $(function () { ...@@ -98,7 +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"); inInfo.set("inqu_status-0-pageCode", "HGWD002");
return inInfo; return inInfo;
}, },
select: function (e) { select: function (e) {
...@@ -128,11 +128,8 @@ $(function () { ...@@ -128,11 +128,8 @@ $(function () {
}, },
selectTreeNode: { selectTreeNode: {
fileId: '', fileId: '',
parentId: '',
projCode: '', projCode: '',
companyCode: '', leafType: '',
leafLevel: '',
type: '',
downloadFlag: '0' downloadFlag: '0'
}, },
// expandLevel:1, // expandLevel:1,
...@@ -296,21 +293,14 @@ let treeSelectClick = function (nodeData) { ...@@ -296,21 +293,14 @@ let treeSelectClick = function (nodeData) {
* @param nodeData * @param nodeData
*/ */
let setTreeNodeValue = function (nodeData) { let setTreeNodeValue = function (nodeData) {
let leafLevel = nodeData.leafLevel == null ? 0 : nodeData.leafLevel; IPLATUI.EFTree.docTree.selectTreeNode.fileId = nodeData.id;
IPLATUI.EFTree.docTree.selectTreeNode.fileId = nodeData.label;
IPLATUI.EFTree.docTree.selectTreeNode.parentId = nodeData.parentId;
IPLATUI.EFTree.docTree.selectTreeNode.fileName = nodeData.text;
IPLATUI.EFTree.docTree.selectTreeNode.companyCode = nodeData.companyCode;
IPLATUI.EFTree.docTree.selectTreeNode.projCode = nodeData.projCode; IPLATUI.EFTree.docTree.selectTreeNode.projCode = nodeData.projCode;
IPLATUI.EFTree.docTree.selectTreeNode.leafLevel = leafLevel; IPLATUI.EFTree.docTree.selectTreeNode.leafType = nodeData.leafType;
IPLATUI.EFTree.docTree.selectTreeNode.downloadFlag = nodeData.downloadFlag == null ? 0 IPLATUI.EFTree.docTree.selectTreeNode.downloadFlag = nodeData.downloadFlag == null ? 0
: nodeData.downloadFlag; : nodeData.downloadFlag;
$("[name = 'inqu_status-0-parentId']").val(nodeData.label); $("[name = 'inqu_status-0-parentId']").val(nodeData.id);
$("[name = 'inqu_status-0-fileId']").val(nodeData.id); $("[name = 'inqu_status-0-fileId']").val(nodeData.id);
$("[name = 'inqu_status-0-projCode']").val(nodeData.projCode); $("[name = 'inqu_status-0-projCode']").val(nodeData.projCode);
$("[name = 'inqu_status-0-leafLevel']").val(leafLevel);
$("[name = 'inqu_status-0-type']").val(nodeData.type);
$("[name = 'inqu_status-0-fileName']").val(nodeData.text);
} }
/** /**
...@@ -318,8 +308,8 @@ let setTreeNodeValue = function (nodeData) { ...@@ -318,8 +308,8 @@ let setTreeNodeValue = function (nodeData) {
*/ */
let showAuthButton = function () { let showAuthButton = function () {
// C:目录 // C:目录
let leafType = IPLATUI.EFTree.docTree.selectTreeNode.leafLevel; let leafType = IPLATUI.EFTree.docTree.selectTreeNode.leafType;
if (leafType && leafType > 0) { if (leafType === 'C') {
CommonUtils.showButton("PREVIEW"); CommonUtils.showButton("PREVIEW");
} else { } else {
CommonUtils.hideButton("PREVIEW"); CommonUtils.hideButton("PREVIEW");
......
...@@ -19,14 +19,9 @@ ...@@ -19,14 +19,9 @@
</div> </div>
<div id="right-pane" class="i-fit-height"> <div id="right-pane" class="i-fit-height">
<EF:EFRegion id="inqu" title="查询条件"> <EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFInput cname="项目代码" ename="projCode" blockId="inqu_status" row="0" type="hidden"/> <EF:EFInput cname="项目代码" ename="projCode" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="文档库id" ename="parentId" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="文档库id" ename="fileId" blockId="inqu_status" row="0" type="hidden"/> <EF:EFInput cname="文档库id" ename="fileId" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="类型" ename="type" blockId="inqu_status" row="0" type="hidden"/> <div class="row">
<EF:EFInput cname="层级" ename="leafLevel" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="文档库名称" ename="fileName" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="业务类型" ename="bizType" blockId="inqu_status" row="0" type="hidden" value="WD"/>
<EF:EFSelect blockId="inqu_status" row="0" ename="fileType" cname="附件分类" colWidth="3" <EF:EFSelect blockId="inqu_status" row="0" ename="fileType" cname="附件分类" colWidth="3"
filter="contains"> filter="contains">
<EF:EFOption label="全部" value=""/> <EF:EFOption label="全部" value=""/>
...@@ -38,28 +33,32 @@ ...@@ -38,28 +33,32 @@
format="yyyy-MM-dd" ratio="3:3" satrtRatio="4:8" endRatio="4:8" readonly="false"> format="yyyy-MM-dd" ratio="3:3" satrtRatio="4:8" endRatio="4:8" readonly="false">
</EF:EFDateSpan> </EF:EFDateSpan>
</div> </div>
<div class="row">
<EF:EFInput cname="文件路径" ename="filePath" blockId="inqu_status" row="0" colWidth="3"/>
</div>
</EF:EFRegion> </EF:EFRegion>
<EF:EFRegion id="result" title="明细信息" fitHeight="true"> <EF:EFRegion id="result" title="明细信息" fitHeight="true">
<EF:EFGrid blockId="result" autoDraw="override" showCount="true" height="73vh" sort="setted" <EF:EFGrid blockId="result" autoDraw="override" showCount="true" height="73vh" sort="single"
checkMode="row"> checkMode="row">
<EF:EFColumn ename="id" cname="ID" hidden="true"/> <EF:EFColumn ename="id" cname="ID" hidden="true"/>
<EF:EFColumn ename="fileId" cname="ID" hidden="true"/> <EF:EFColumn ename="fileId" cname="ID" hidden="true"/>
<EF:EFColumn ename="docId" cname="附件ID" enable="false" width="120" align="center" sort="false" <EF:EFColumn ename="docId" cname="附件ID" hidden="true"/>
hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" enable="false" width="80" align="center" sort="false"/> <EF:EFColumn ename="operator" cname="操作" enable="false" width="80" align="center" sort="false"/>
<EF:EFComboColumn ename="fileType" cname="附件分类" enable="false" width="90" align="center"> <EF:EFColumn ename="docName" cname="附件名称" enable="false" width="220" alias="b.docName"/>
<EF:EFColumn ename="changeContent" cname="变更内容" enable="false" width="200" sort="false"/>
<EF:EFColumn ename="filePath" cname="文件路径" enable="false" width="200" alias="b.filePath"/>
<EF:EFComboColumn ename="fileType" cname="附件分类" enable="false" width="100" align="center"
alias="a.fileType">
<EF:EFCodeOption codeName="hggp.hgwd.fileType"/> <EF:EFCodeOption codeName="hggp.hgwd.fileType"/>
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="docName" cname="附件名称" enable="false" width="220" sort="true"/> <EF:EFColumn ename="docType" cname="附件后缀" enable="false" width="110" align="center"
<EF:EFColumn ename="docType" cname="附件后缀" enable="false" width="110" align="center" sort="true"/> alias="b.docType"/>
<EF:EFColumn ename="docVersion" cname="版本号" enable="false" width="90" align="center" sort="true"/> <EF:EFColumn ename="docVersion" cname="版本号" enable="false" width="100" align="center"
<EF:EFColumn ename="changeContent" cname="变更内容" enable="false" width="200" align="center" sort="true"/> alias="b.docVersion"/>
<EF:EFColumn ename="updatedTime" cname="上传时间" parseFormats="['yyyyMMddHHmmss']" editType="datetime" <EF:EFColumn ename="updatedTime" cname="上传时间" parseFormats="['yyyyMMddHHmmss']"
dateFormat="yyyy-MM-dd HH:mm:ss" align="center" width="140" readonly="true" editType="datetime" dateFormat="yyyy-MM-dd HH:mm:ss" align="center" width="140"
required="false" enable="false" sort="true"/> enable="false" alias="b.updatedTime"/>
<%-- <EF:EFColumn ename="previewNum" cname="预览次数" enable="false" width="100" align="right" sort="true"/>--%>
<%-- <EF:EFColumn ename="downloadNum" cname="下载次数" enable="false" width="100" align="right" sort="true"/>--%>
</EF:EFGrid> </EF:EFGrid>
</EF:EFRegion> </EF:EFRegion>
</div> </div>
......
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