Commit fc93070f by liuyang

2024-08-29 文档库

parent 2ed3b447
...@@ -35,6 +35,8 @@ public class HGWD001 extends DaoEPBase { ...@@ -35,6 +35,8 @@ public class HGWD001 extends DaoEPBase {
public static final String FIELD_COMPANY_NAME = "companyName"; /* 公司名称*/ public static final String FIELD_COMPANY_NAME = "companyName"; /* 公司名称*/
public static final String FIELD_PROJ_CODE = "projCode"; /* 项目编码*/ public static final String FIELD_PROJ_CODE = "projCode"; /* 项目编码*/
public static final String FIELD_PROJ_NAME = "projName"; /* 项目名称*/ public static final String FIELD_PROJ_NAME = "projName"; /* 项目名称*/
public static final String FIELD_LEAF_LEVEL = "leafLevel"; /* 节点层级*/
public static final String FIELD_PARENT_ID = "parentId"; /* 父级ID*/
public static final String FIELD_FILE_ID = "fileId"; /* 文件ID*/ public static final String FIELD_FILE_ID = "fileId"; /* 文件ID*/
public static final String FIELD_FILE_TYPE = "fileType"; /* 文件类型*/ public static final String FIELD_FILE_TYPE = "fileType"; /* 文件类型*/
public static final String FIELD_FILE_NAME = "fileName"; /* 文件名称*/ public static final String FIELD_FILE_NAME = "fileName"; /* 文件名称*/
...@@ -86,6 +88,8 @@ public class HGWD001 extends DaoEPBase { ...@@ -86,6 +88,8 @@ public class HGWD001 extends DaoEPBase {
private String companyName = " "; /* 公司名称*/ private String companyName = " "; /* 公司名称*/
private String projCode = " "; /* 项目编码*/ private String projCode = " "; /* 项目编码*/
private String projName = " "; /* 项目名称*/ private String projName = " "; /* 项目名称*/
private Integer leafLevel = new Integer(0);
private String parentId = " ";
private String fileId = " "; /* 文件ID*/ private String fileId = " "; /* 文件ID*/
private String fileType = " "; /* 文件类型*/ private String fileType = " "; /* 文件类型*/
private String fileName = " "; /* 文件名称*/ private String fileName = " "; /* 文件名称*/
...@@ -157,6 +161,14 @@ public class HGWD001 extends DaoEPBase { ...@@ -157,6 +161,14 @@ public class HGWD001 extends DaoEPBase {
eiColumn.setDescName("项目名称"); eiColumn.setDescName("项目名称");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_LEAF_LEVEL);
eiColumn.setDescName("节点层级");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PARENT_ID);
eiColumn.setDescName("父级ID");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_FILE_ID); eiColumn = new EiColumn(FIELD_FILE_ID);
eiColumn.setDescName("文件ID"); eiColumn.setDescName("文件ID");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
...@@ -419,6 +431,37 @@ public class HGWD001 extends DaoEPBase { ...@@ -419,6 +431,37 @@ public class HGWD001 extends DaoEPBase {
public void setProjName(String projName) { public void setProjName(String projName) {
this.projName = projName; this.projName = projName;
} }
/**
* get the leafLevel - 层级
* @return 层级
*/
public Integer getLeafLevel() {
return leafLevel;
}
/**
* set the leafLevel - 层级
* @param leafLevel - 层级
*/
public void setLeafLevel(Integer leafLevel) {
this.leafLevel = leafLevel;
}
/**
* get the parentId - 父级
* @return 父级
*/
public String getParentId() {
return parentId;
}
/**
* set the parentId - 层级
* @param parentId - 层级
*/
public void setParentId(String parentId) {
this.parentId = parentId;
}
/** /**
* get the fileId - 文件ID. * get the fileId - 文件ID.
* @return the fileId * @return the fileId
...@@ -553,6 +596,8 @@ public class HGWD001 extends DaoEPBase { ...@@ -553,6 +596,8 @@ public class HGWD001 extends DaoEPBase {
setCompanyName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_COMPANY_NAME)), companyName)); setCompanyName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_COMPANY_NAME)), companyName));
setProjCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROJ_CODE)), projCode)); setProjCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROJ_CODE)), projCode));
setProjName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROJ_NAME)), projName)); setProjName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROJ_NAME)), projName));
setLeafLevel(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_LEAF_LEVEL)), leafLevel));
setParentId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PARENT_ID)), parentId));
setFileId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FILE_ID)), fileId)); setFileId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FILE_ID)), fileId));
setFileType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FILE_TYPE)), fileType)); setFileType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FILE_TYPE)), fileType));
setFileName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FILE_NAME)), fileName)); setFileName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FILE_NAME)), fileName));
...@@ -583,6 +628,8 @@ public class HGWD001 extends DaoEPBase { ...@@ -583,6 +628,8 @@ public class HGWD001 extends DaoEPBase {
map.put(FIELD_COMPANY_NAME, StringUtils.toString(companyName, eiMetadata.getMeta(FIELD_COMPANY_NAME))); map.put(FIELD_COMPANY_NAME, StringUtils.toString(companyName, eiMetadata.getMeta(FIELD_COMPANY_NAME)));
map.put(FIELD_PROJ_CODE, StringUtils.toString(projCode, eiMetadata.getMeta(FIELD_PROJ_CODE))); map.put(FIELD_PROJ_CODE, StringUtils.toString(projCode, eiMetadata.getMeta(FIELD_PROJ_CODE)));
map.put(FIELD_PROJ_NAME, StringUtils.toString(projName, eiMetadata.getMeta(FIELD_PROJ_NAME))); map.put(FIELD_PROJ_NAME, StringUtils.toString(projName, eiMetadata.getMeta(FIELD_PROJ_NAME)));
map.put(FIELD_LEAF_LEVEL, StringUtils.toString(leafLevel, eiMetadata.getMeta(FIELD_LEAF_LEVEL)));
map.put(FIELD_PARENT_ID, StringUtils.toString(parentId, eiMetadata.getMeta(FIELD_PARENT_ID)));
map.put(FIELD_FILE_ID, StringUtils.toString(fileId, eiMetadata.getMeta(FIELD_FILE_ID))); map.put(FIELD_FILE_ID, StringUtils.toString(fileId, eiMetadata.getMeta(FIELD_FILE_ID)));
map.put(FIELD_FILE_TYPE, StringUtils.toString(fileType, eiMetadata.getMeta(FIELD_FILE_TYPE))); map.put(FIELD_FILE_TYPE, StringUtils.toString(fileType, eiMetadata.getMeta(FIELD_FILE_TYPE)));
map.put(FIELD_FILE_NAME, StringUtils.toString(fileName, eiMetadata.getMeta(FIELD_FILE_NAME))); map.put(FIELD_FILE_NAME, StringUtils.toString(fileName, eiMetadata.getMeta(FIELD_FILE_NAME)));
......
...@@ -212,5 +212,26 @@ public class ServiceHGWD001 extends ServiceEPBase { ...@@ -212,5 +212,26 @@ public class ServiceHGWD001 extends ServiceEPBase {
return inInfo; return inInfo;
} }
//树查询服务
public EiInfo queryTreeNode(EiInfo inInfo) {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
String node = MapUtils.getString(queryRow, "fileId");
//获取物料详情数据
String projCode = inInfo.getString("projCode");
String companyCode = inInfo.getString("companyCode");
String parentId = inInfo.getString("parentId");
Map queryMap = new HashMap();
queryMap.put("companyCode", StringUtils.isNotBlank(companyCode) ? companyCode : "null");
queryMap.put("projCode", StringUtils.isNotBlank(projCode) ? projCode : "null");
queryMap.put("parentId", StringUtils.isNotBlank(parentId) ? parentId : "null");
queryMap.put("pEname", "$".equals(node) ? "root" : node);
//2 查询节点
List rows = dao.query("HGWD001.queryTree", queryMap);
//3 增加节点block块
EiInfo outInfo = new EiInfo();
EiBlock outBlock = outInfo.addBlock(node);
outBlock.addRows(rows);
return outInfo;
}
} }
...@@ -17,6 +17,8 @@ ...@@ -17,6 +17,8 @@
COMPANY_NAME as "companyName", <!-- 公司名称 --> COMPANY_NAME as "companyName", <!-- 公司名称 -->
PROJ_CODE as "projCode", <!-- 项目编码 --> PROJ_CODE as "projCode", <!-- 项目编码 -->
PROJ_NAME as "projName", <!-- 项目名称 --> PROJ_NAME as "projName", <!-- 项目名称 -->
LEAF_LEVEL as "leafLevel", <!--节点层级-->
PARENT_ID as "parentId", <!--父级ID-->
FILE_ID as "fileId", <!-- 文件ID --> FILE_ID as "fileId", <!-- 文件ID -->
FILE_TYPE as "fileType", <!-- 文件类型 --> FILE_TYPE as "fileType", <!-- 文件类型 -->
FILE_NAME as "fileName", <!-- 文件名称 --> FILE_NAME as "fileName", <!-- 文件名称 -->
...@@ -69,6 +71,12 @@ ...@@ -69,6 +71,12 @@
<isNotEmpty prepend=" AND " property="projName"> <isNotEmpty prepend=" AND " property="projName">
PROJ_NAME LIKE CONCAT('%', #projName#, '%') PROJ_NAME LIKE CONCAT('%', #projName#, '%')
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="leafLevel">
LEAF_LEVEL = #leafLevel#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="parentId">
PARENT_ID = #parentId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="fileId"> <isNotEmpty prepend=" AND " property="fileId">
FILE_ID = #fileId# FILE_ID = #fileId#
</isNotEmpty> </isNotEmpty>
...@@ -130,6 +138,8 @@ ...@@ -130,6 +138,8 @@
COMPANY_NAME, <!-- 公司名称 --> COMPANY_NAME, <!-- 公司名称 -->
PROJ_CODE, <!-- 项目编码 --> PROJ_CODE, <!-- 项目编码 -->
PROJ_NAME, <!-- 项目名称 --> PROJ_NAME, <!-- 项目名称 -->
LEAF_LEVEL, <!--节点层级-->
PARENT_ID, <!--父级ID-->
FILE_ID, <!-- 文件ID --> FILE_ID, <!-- 文件ID -->
FILE_TYPE, <!-- 文件类型 --> FILE_TYPE, <!-- 文件类型 -->
FILE_NAME, <!-- 文件名称 --> FILE_NAME, <!-- 文件名称 -->
...@@ -139,7 +149,7 @@ ...@@ -139,7 +149,7 @@
RELEASE_DATE RELEASE_DATE
) VALUES ( ) VALUES (
#accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#,
#deleteFlag#, #companyCode#, #companyName#, #projCode#, #projName#, #deleteFlag#, #companyCode#, #companyName#, #projCode#, #projName#,#leafLevel#,#parentId#
#fileId#, #fileType#, #fileName#, #fileId#, #fileType#, #fileName#,
#docVersion#, #status#, #remark#, #releaseDate# #docVersion#, #status#, #remark#, #releaseDate#
<selectKey resultClass="long" keyProperty="id"> <selectKey resultClass="long" keyProperty="id">
...@@ -185,4 +195,68 @@ ...@@ -185,4 +195,68 @@
WHERE ID = #id# WHERE ID = #id#
</update> </update>
<select id="queryTree" resultClass="java.util.HashMap">
SELECT
COMPANY_CODE as "companyCode", <!-- 公司编码 -->
COMPANY_NAME as "companyName", <!-- 公司名称 -->
PROJ_CODE as "projCode", <!-- 项目编码 -->
PROJ_NAME as "projName", <!-- 项目名称 -->
LEAF_LEVEL as "leafLevel", <!--节点层级-->
PARENT_ID as "pId", <!--父级ID-->
FILE_ID as "fileId", <!-- 文件ID -->
FILE_TYPE as "fileType", <!-- 文件类型 -->
FILE_NAME as "fileName" <!-- 文件名称 -->
FROM ${hggpSchema}.HGWD001
WHERE 1=1
<isNotEmpty prepend=" AND " property="pEname">
PARENT_ID = #pEname#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
PROJ_CODE = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="parentId">
PARENT_ID = #parentId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="fileId">
FILE_ID = #fileId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="leafLevel">
LEAF_LEVEL = #leafLevel#
</isNotEmpty>
ORDER BY CREATED_TIME DESC
</select>
<!-- 组织机构子节点树查询 -->
<select id="queryOrganiation" resultClass="java.util.HashMap">
SELECT
A.FILE_ID as "label",
A.FILE_ID as "ename",
A.FILE_NAME as "text",
A.FILE_TYPE as "leaf",
A.FILE_TYPE as "type",
A.PARENT_ID as "parentId",
A.DELETE_FLAG as "isDeleted"
FROM ${hggpSchema}.HGWD001 A INNER JOIN ${hggpSchema}.HGWD003 B ON A.FILE_ID = B.FILE_ID
WHERE 1=1
<isEmpty prepend=" AND " property="deletedQuery">
A.DELETE_FLAG = '0'
</isEmpty>
<isNotEmpty prepend=" AND " property="node">
A.PARENT_ID = #node#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
A.ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="userId">
B.USER_ID = #userId#
</isNotEmpty>
order by A.CREATED_TIME asc
</select>
</sqlMap> </sqlMap>
...@@ -30,9 +30,12 @@ public class HGWDTools { ...@@ -30,9 +30,12 @@ public class HGWDTools {
* @return * @return
*/ */
public static HGWD001 get(String fileId) { public static HGWD001 get(String fileId) {
AssertUtils.isEmpty(fileId, "文件ID不能为空"); //AssertUtils.isEmpty(fileId, "文件ID不能为空");
Map queryMap = new HashMap(); Map queryMap = new HashMap();
if (fileId != null) {
queryMap.put(HGWD001.FIELD_FILE_ID, fileId); queryMap.put(HGWD001.FIELD_FILE_ID, fileId);
}
List<HGWD001> results = DaoBase.getInstance().query(HGWD001.QUERY, queryMap); List<HGWD001> results = DaoBase.getInstance().query(HGWD001.QUERY, queryMap);
return CollectionUtils.isEmpty(results) ? null : results.get(0); return CollectionUtils.isEmpty(results) ? null : results.get(0);
} }
......
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