Commit 00bb5a8c by 宋祥

Merge branch 'dev-sx' of http://git.pseer.com:8800/platform/hg-smart into dev

parents e33fad0b 5a7f90cb
package com.baosight.hggp.hg.sc.constant;
/**
* @author:songx
* @date:2024/8/22,10:09
*/
public class HgScConst {
/**
* 项目管理
*
* @author:songx
* @date:2024/5/7,16:36
*/
public static class HgSc001 {
}
}
package com.baosight.hggp.hg.sc.enums;
/**
* @author:songx
* @date:2024/3/1,17:29
*/
public enum ProjectTypeEnum {
ENGINEERING("engineering", "工程设计图"),
FOREIGN("foreign", "外来制造图"),
OTHER("other", "其他"),
;
/**
* 编码
*/
private String code;
/**
* 名称
*/
private String name;
/**
* code 是否存在
*
* @param code
* @return
*/
public static boolean contains(String code) {
for (ProjectTypeEnum value : values()) {
if (value.getCode().equals(code)) {
return true;
}
}
return false;
}
ProjectTypeEnum(String code, String name) {
this.code = code;
this.name = name;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
...@@ -7,8 +7,10 @@ import com.baosight.hggp.core.model.Pager; ...@@ -7,8 +7,10 @@ import com.baosight.hggp.core.model.Pager;
import com.baosight.hggp.core.utils.ThreadUtils; import com.baosight.hggp.core.utils.ThreadUtils;
import com.baosight.hggp.hg.pz.domain.HGPZ009; import com.baosight.hggp.hg.pz.domain.HGPZ009;
import com.baosight.hggp.hg.pz.tools.HGPZTools; import com.baosight.hggp.hg.pz.tools.HGPZTools;
import com.baosight.hggp.hg.sc.constant.HgScConst;
import com.baosight.hggp.hg.sc.constant.HgScSqlConstant; import com.baosight.hggp.hg.sc.constant.HgScSqlConstant;
import com.baosight.hggp.hg.sc.domain.HGSC001; import com.baosight.hggp.hg.sc.domain.HGSC001;
import com.baosight.hggp.hg.sc.enums.ProjectTypeEnum;
import com.baosight.hggp.hg.sc.tools.HGSCTools; import com.baosight.hggp.hg.sc.tools.HGSCTools;
import com.baosight.hggp.util.AssertUtils; import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.EiInfoUtils; import com.baosight.hggp.util.EiInfoUtils;
...@@ -157,6 +159,8 @@ public class ServiceHGSC101 extends ServiceEPBase { ...@@ -157,6 +159,8 @@ public class ServiceHGSC101 extends ServiceEPBase {
dbSc001.setDepName(dbPz009.getAccountName()); dbSc001.setDepName(dbPz009.getAccountName());
dbSc001.setProjCode(projCode); dbSc001.setProjCode(projCode);
dbSc001.setProjName(dcContractList.getTitle()); dbSc001.setProjName(dcContractList.getTitle());
// TODO 默认其他,需要根据智邦的接口返回值确定
dbSc001.setProjType(ProjectTypeEnum.OTHER.getCode());
dbSc001.setContractNo(dcContractList.getHtid()); dbSc001.setContractNo(dcContractList.getHtid());
DaoUtils.insert(HGSC001.INSERT, dbSc001); DaoUtils.insert(HGSC001.INSERT, dbSc001);
} else { } else {
......
...@@ -78,6 +78,7 @@ public class ServiceHGSC101A extends ServiceEPBase { ...@@ -78,6 +78,7 @@ public class ServiceHGSC101A extends ServiceEPBase {
*/ */
private void checkData(HGSC001 fSc001) { private void checkData(HGSC001 fSc001) {
AssertUtils.isEmpty(fSc001.getProjName(), "项目名称不能为空!"); AssertUtils.isEmpty(fSc001.getProjName(), "项目名称不能为空!");
AssertUtils.isEmpty(fSc001.getProjType(), "项目类型不能为空!");
} }
/** /**
......
...@@ -324,6 +324,7 @@ ...@@ -324,6 +324,7 @@
COMPANY_CODE = #companyCode#, COMPANY_CODE = #companyCode#,
COMPANY_NAME = #companyName#, COMPANY_NAME = #companyName#,
PROJ_NAME = #projName#, PROJ_NAME = #projName#,
PROJ_TYPE = #projType#,
<include refid="SqlBase.updateRevise"/> <include refid="SqlBase.updateRevise"/>
WHERE PROJ_CODE = #projCode# WHERE PROJ_CODE = #projCode#
</update> </update>
......
...@@ -50,6 +50,9 @@ ...@@ -50,6 +50,9 @@
<isNotEmpty prepend=" AND " property="depName"> <isNotEmpty prepend=" AND " property="depName">
dep_name = #depName# dep_name = #depName#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="contractNo">
contract_no like concat('%', #contractNo#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode"> <isNotEmpty prepend=" AND " property="projCode">
proj_code = #projCode# proj_code = #projCode#
</isNotEmpty> </isNotEmpty>
......
...@@ -16,6 +16,8 @@ public class HgWdSqlConstant { ...@@ -16,6 +16,8 @@ public class HgWdSqlConstant {
// 根据父节点统计 // 根据父节点统计
public static final String COUNT_BY_PARENT = "HGWD001.countByParent"; public static final String COUNT_BY_PARENT = "HGWD001.countByParent";
// 根据类型统计
public static final String COUNT_BY_TYPE = "HGWD001.countByType";
// 搜索树节点 // 搜索树节点
public static final String SEARCH_TREE_NODE = "HGWD001.searchTreeNode"; public static final String SEARCH_TREE_NODE = "HGWD001.searchTreeNode";
} }
......
...@@ -35,6 +35,7 @@ public class HGWD001 extends DaoEPBase { ...@@ -35,6 +35,7 @@ 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_PROJ_TYPE = "projType"; /* 项目类型*/
public static final String FIELD_LEAF_LEVEL = "leafLevel"; /* 节点层级*/ public static final String FIELD_LEAF_LEVEL = "leafLevel"; /* 节点层级*/
public static final String FIELD_PARENT_ID = "parentId"; /* 父级ID*/ 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*/
...@@ -59,6 +60,7 @@ public class HGWD001 extends DaoEPBase { ...@@ -59,6 +60,7 @@ public class HGWD001 extends DaoEPBase {
public static final String COL_COMPANY_NAME = "COMPANY_NAME"; /* 公司名称*/ public static final String COL_COMPANY_NAME = "COMPANY_NAME"; /* 公司名称*/
public static final String COL_PROJ_CODE = "PROJ_CODE"; /* 项目编码*/ public static final String COL_PROJ_CODE = "PROJ_CODE"; /* 项目编码*/
public static final String COL_PROJ_NAME = "PROJ_NAME"; /* 项目名称*/ public static final String COL_PROJ_NAME = "PROJ_NAME"; /* 项目名称*/
public static final String COL_PROJ_TYPE = "PROJ_TYPE"; /* 项目类型*/
public static final String COL_PARENT_ID = "PARENT_ID"; /* 节点层级*/ public static final String COL_PARENT_ID = "PARENT_ID"; /* 节点层级*/
public static final String COL_LEAF_LEVEL = "LEAF_LEVEL"; /* 父级ID*/ public static final String COL_LEAF_LEVEL = "LEAF_LEVEL"; /* 父级ID*/
public static final String COL_FILE_ID = "FILE_ID"; /* 文件ID*/ public static final String COL_FILE_ID = "FILE_ID"; /* 文件ID*/
...@@ -90,6 +92,7 @@ public class HGWD001 extends DaoEPBase { ...@@ -90,6 +92,7 @@ public class HGWD001 extends DaoEPBase {
private String companyName = " "; /* 公司名称*/ private String companyName = " "; /* 公司名称*/
private String projCode = " "; /* 项目编码*/ private String projCode = " "; /* 项目编码*/
private String projName = " "; /* 项目名称*/ private String projName = " "; /* 项目名称*/
private String projType = " "; /* 项目类型*/
private Integer leafLevel = new Integer(0); private Integer leafLevel = new Integer(0);
private String parentId = " "; private String parentId = " ";
private String fileId = " "; /* 文件ID*/ private String fileId = " "; /* 文件ID*/
...@@ -163,6 +166,10 @@ public class HGWD001 extends DaoEPBase { ...@@ -163,6 +166,10 @@ public class HGWD001 extends DaoEPBase {
eiColumn.setDescName("项目名称"); eiColumn.setDescName("项目名称");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PROJ_TYPE);
eiColumn.setDescName("项目类型");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_LEAF_LEVEL); eiColumn = new EiColumn(FIELD_LEAF_LEVEL);
eiColumn.setDescName("节点层级"); eiColumn.setDescName("节点层级");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
...@@ -434,6 +441,14 @@ public class HGWD001 extends DaoEPBase { ...@@ -434,6 +441,14 @@ public class HGWD001 extends DaoEPBase {
this.projName = projName; this.projName = projName;
} }
public String getProjType() {
return projType;
}
public void setProjType(String projType) {
this.projType = projType;
}
/** /**
* get the leafLevel - 层级 * get the leafLevel - 层级
* @return 层级 * @return 层级
...@@ -598,6 +613,7 @@ public class HGWD001 extends DaoEPBase { ...@@ -598,6 +613,7 @@ 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));
setProjType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROJ_TYPE)), projType));
setLeafLevel(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_LEAF_LEVEL)), leafLevel)); setLeafLevel(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_LEAF_LEVEL)), leafLevel));
setParentId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PARENT_ID)), parentId)); 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));
...@@ -630,6 +646,7 @@ public class HGWD001 extends DaoEPBase { ...@@ -630,6 +646,7 @@ 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_PROJ_TYPE, StringUtils.toString(projType, eiMetadata.getMeta(FIELD_PROJ_TYPE)));
map.put(FIELD_LEAF_LEVEL, StringUtils.toString(leafLevel, eiMetadata.getMeta(FIELD_LEAF_LEVEL))); 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_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)));
......
...@@ -3,7 +3,9 @@ package com.baosight.hggp.hg.wd.service; ...@@ -3,7 +3,9 @@ package com.baosight.hggp.hg.wd.service;
import com.baosight.hggp.core.constant.CommonConstant; import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoBase; import com.baosight.hggp.core.dao.DaoBase;
import com.baosight.hggp.core.security.UserSessionUtils; import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.core.tools.CodeValueTools;
import com.baosight.hggp.hg.sc.domain.HGSC001; import com.baosight.hggp.hg.sc.domain.HGSC001;
import com.baosight.hggp.hg.sc.enums.ProjectTypeEnum;
import com.baosight.hggp.hg.wd.constant.HgWdConstant; import com.baosight.hggp.hg.wd.constant.HgWdConstant;
import com.baosight.hggp.hg.wd.domain.HGWD001; import com.baosight.hggp.hg.wd.domain.HGWD001;
import com.baosight.hggp.hg.wd.tools.HGWDTools; import com.baosight.hggp.hg.wd.tools.HGWDTools;
...@@ -214,9 +216,11 @@ public class ServiceHGWD001D extends TreeService { ...@@ -214,9 +216,11 @@ 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);
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, ename)); inInfo.addBlock(node).setRows(queryTopNode(node));
} else if (ProjectTypeEnum.contains(node)) {
inInfo.addBlock(node).setRows(queryFirstNode(node, ename));
} else { } else {
inInfo.addBlock(node).setRows(queryChildNode(node,ename)); inInfo.addBlock(node).setRows(queryChildNode(node, ename));
} }
} catch (Exception e) { } catch (Exception e) {
LogUtils.setMsg(inInfo, e, "查询节点失败"); LogUtils.setMsg(inInfo, e, "查询节点失败");
...@@ -229,10 +233,37 @@ public class ServiceHGWD001D extends TreeService { ...@@ -229,10 +233,37 @@ public class ServiceHGWD001D extends TreeService {
* *
* @return * @return
*/ */
public List queryTopNode(String parentId,String ename) { public List queryTopNode(String parentId) {
List<Map> results = new ArrayList();
List<Map> codesetMaps = CodeValueTools.getCodeValues("app.sc.projType");
if (CollectionUtils.isEmpty(codesetMaps)) {
return results;
}
for (Map codesetMap : codesetMaps) {
String label = MapUtils.getString(codesetMap, "value");
String text = MapUtils.getString(codesetMap, "label");
Map leafMap = buildLeaf(parentId, label, text, HgWdConstant.LeafType.P);
leafMap.put("type", "-1");
leafMap.put("leafLevel", "-1");
results.add(leafMap);
}
// 设置叶子节点
setTreeNodeLeaf(results, true);
return results;
}
/**
* 查询一级节点
*
* @param parentId
* @param ename
* @return
*/
public List queryFirstNode(String parentId, String ename) {
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("projType", parentId);
// 非管理员仅查询自己有权限的项目 // 非管理员仅查询自己有权限的项目
String userId = UserSessionUtils.getLoginName(); String userId = UserSessionUtils.getLoginName();
if (!HgWdUtils.HgWd009.isManager(userId)) { if (!HgWdUtils.HgWd009.isManager(userId)) {
...@@ -253,7 +284,7 @@ public class ServiceHGWD001D extends TreeService { ...@@ -253,7 +284,7 @@ public class ServiceHGWD001D extends TreeService {
results.add(leafMap); results.add(leafMap);
} }
// 设置叶子节点 // 设置叶子节点
setTreeNodeLeaf(results); setTreeNodeLeaf(results, false);
return results; return results;
} }
...@@ -263,7 +294,7 @@ public class ServiceHGWD001D extends TreeService { ...@@ -263,7 +294,7 @@ public class ServiceHGWD001D extends TreeService {
* @param parentId * @param parentId
* @return * @return
*/ */
public List queryChildNode(String parentId,String ename) { public List queryChildNode(String parentId, String ename) {
List<Map> results = new ArrayList(); List<Map> results = new ArrayList();
Map queryMap = new HashMap(); Map queryMap = new HashMap();
queryMap.put("parentId", parentId); queryMap.put("parentId", parentId);
...@@ -282,7 +313,7 @@ public class ServiceHGWD001D extends TreeService { ...@@ -282,7 +313,7 @@ public class ServiceHGWD001D extends TreeService {
results.add(leafMap); results.add(leafMap);
} }
// 设置叶子节点 // 设置叶子节点
setTreeNodeLeaf(results); setTreeNodeLeaf(results, false);
return results; return results;
} }
...@@ -290,13 +321,19 @@ public class ServiceHGWD001D extends TreeService { ...@@ -290,13 +321,19 @@ public class ServiceHGWD001D extends TreeService {
* 设置叶子节点是否可以展开 * 设置叶子节点是否可以展开
* *
* @param nodes * @param nodes
* @param isType
*/ */
private void setTreeNodeLeaf(List<Map> nodes) { private void setTreeNodeLeaf(List<Map> nodes, boolean isType) {
if (CollectionUtils.isEmpty(nodes)) { if (CollectionUtils.isEmpty(nodes)) {
return; return;
} }
List<String> labels = ObjectUtils.listKey(nodes, "label"); List<String> labels = ObjectUtils.listKey(nodes, "label");
Map<String, Integer> resultMap = HGWDTools.HgWd001.countByParent(labels); Map<String, Integer> resultMap = null;
if (isType) {
resultMap = HGWDTools.HgWd001.countByType(labels);
} else {
resultMap = HGWDTools.HgWd001.countByParent(labels);
}
for (Map node : nodes) { for (Map node : nodes) {
Integer cnt = resultMap == null ? null : resultMap.get(node.get("label")); Integer cnt = resultMap == null ? null : resultMap.get(node.get("label"));
node.put("leaf", cnt == null || cnt == 0 ? 1 : 0); node.put("leaf", cnt == null || cnt == 0 ? 1 : 0);
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
COMPANY_NAME as "companyName", <!-- 公司名称 --> COMPANY_NAME as "companyName", <!-- 公司名称 -->
PROJ_CODE as "projCode", <!-- 项目编码 --> PROJ_CODE as "projCode", <!-- 项目编码 -->
PROJ_NAME as "projName", <!-- 项目名称 --> PROJ_NAME as "projName", <!-- 项目名称 -->
PROJ_TYPE as "projType", <!-- 项目类型 -->
LEAF_LEVEL as "leafLevel", <!--节点层级--> LEAF_LEVEL as "leafLevel", <!--节点层级-->
PARENT_ID as "parentId", <!--父级ID--> PARENT_ID as "parentId", <!--父级ID-->
FILE_ID as "fileId", <!-- 文件ID --> FILE_ID as "fileId", <!-- 文件ID -->
...@@ -156,6 +157,16 @@ ...@@ -156,6 +157,16 @@
GROUP BY PARENT_ID GROUP BY PARENT_ID
</select> </select>
<!-- 更具父级节点统计 -->
<select id="countByType" resultClass="java.util.HashMap">
SELECT PROJ_TYPE, COUNT(1) AS CNT
FROM ${hggpSchema}.HGWD001
WHERE 1=1
AND DELETE_FLAG = 0
AND PROJ_TYPE IN <iterate close=")" open="(" conjunction="," property="projTypes">#projTypes[]#</iterate>
GROUP BY PROJ_TYPE
</select>
<!-- 搜索树节点 --> <!-- 搜索树节点 -->
<select id="searchTreeNode" resultClass="com.baosight.hggp.hg.wd.domain.HGWD001"> <select id="searchTreeNode" resultClass="com.baosight.hggp.hg.wd.domain.HGWD001">
SELECT DISTINCT SELECT DISTINCT
...@@ -194,6 +205,7 @@ ...@@ -194,6 +205,7 @@
COMPANY_NAME, <!-- 公司名称 --> COMPANY_NAME, <!-- 公司名称 -->
PROJ_CODE, <!-- 项目编码 --> PROJ_CODE, <!-- 项目编码 -->
PROJ_NAME, <!-- 项目名称 --> PROJ_NAME, <!-- 项目名称 -->
PROJ_TYPE, <!-- 项目类型 -->
LEAF_LEVEL, <!--节点层级--> LEAF_LEVEL, <!--节点层级-->
PARENT_ID, <!--父级ID--> PARENT_ID, <!--父级ID-->
FILE_ID, <!-- 文件ID --> FILE_ID, <!-- 文件ID -->
...@@ -205,8 +217,8 @@ ...@@ -205,8 +217,8 @@
RELEASE_DATE RELEASE_DATE
) VALUES ( ) VALUES (
#accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#,
#deleteFlag#, #companyCode#, #companyName#, #projCode#, #projName#,#leafLevel#,#parentId#, #deleteFlag#, #companyCode#, #companyName#, #projCode#, #projName#, #projType#,
#fileId#, #fileType#, #fileName#, #leafLevel#, #parentId#, #fileId#, #fileType#, #fileName#,
#docVersion#, #status#, #remark#, #releaseDate# #docVersion#, #status#, #remark#, #releaseDate#
<selectKey resultClass="long" keyProperty="id"> <selectKey resultClass="long" keyProperty="id">
SELECT MAX(ID) AS "id" FROM ${hggpSchema}.HGWD001 SELECT MAX(ID) AS "id" FROM ${hggpSchema}.HGWD001
...@@ -258,6 +270,7 @@ ...@@ -258,6 +270,7 @@
COMPANY_NAME as "companyName", <!-- 公司名称 --> COMPANY_NAME as "companyName", <!-- 公司名称 -->
PROJ_CODE as "projCode", <!-- 项目编码 --> PROJ_CODE as "projCode", <!-- 项目编码 -->
PROJ_NAME as "projName", <!-- 项目名称 --> PROJ_NAME as "projName", <!-- 项目名称 -->
PROJ_TYPE as "projType", <!-- 项目类型 -->
LEAF_LEVEL as "leafLevel", <!--节点层级--> LEAF_LEVEL as "leafLevel", <!--节点层级-->
PARENT_ID as "pId", <!--父级ID--> PARENT_ID as "pId", <!--父级ID-->
FILE_ID as "fileId", <!-- 文件ID --> FILE_ID as "fileId", <!-- 文件ID -->
......
...@@ -121,6 +121,24 @@ public class HGWDTools { ...@@ -121,6 +121,24 @@ public class HGWDTools {
} }
/** /**
* 根据类型统计
*
* @param projTypes
* @return
*/
public static Map<String, Integer> countByType(List<String> projTypes) {
AssertUtils.isEmpty(projTypes, "项目类型不能为空");
Map queryMap = new HashMap();
queryMap.put("projTypes", projTypes);
List<Map> results = DaoBase.getInstance().query(HgWdSqlConstant.HgWd001.COUNT_BY_TYPE, queryMap);
if (CollectionUtils.isEmpty(results)) {
return null;
}
return results.stream().collect(Collectors.toMap(item -> MapUtils.getString(item, HGWD001.COL_PROJ_TYPE),
item -> MapUtils.getInteger(item, "CNT")));
}
/**
* 搜索树节点 * 搜索树节点
* *
* @param fileName * @param fileName
......
$(function () { $(function () {
IPLATUI.EFGrid.result = { IPLATUI.EFGrid = {
"result": {
exportGrid: false, // 隐藏右侧自定义导出按钮
pageable: { pageable: {
pageSize: 20, pageSize: 20,
pageSizes: [10, 20, 50, 70, 100], pageSizes: [20, 100, 250, 500],
}, },
columns: [{ columns: [{
field: "operator", field: "operator",
...@@ -18,13 +20,6 @@ $(function () { ...@@ -18,13 +20,6 @@ $(function () {
$("#ADD").on("click", add); $("#ADD").on("click", add);
//删除 //删除
$("#REMOVE").on("click", remove); $("#REMOVE").on("click", remove);
},
onAdd: function (e) {
e.preventDefault();
},
onSuccess: function (e) {
if (e.eiInfo.extAttr.methodName == 'save' || e.eiInfo.extAttr.methodName == 'delete') {
query();
} }
} }
} }
......
...@@ -6,18 +6,22 @@ ...@@ -6,18 +6,22 @@
<EF:EFPage title="项目管理"> <EF:EFPage title="项目管理">
<EF:EFRegion id="inqu" title="查询条件"> <EF:EFRegion id="inqu" title="查询条件">
<div class="row"> <div class="row">
<EF:EFInput ename="inqu_status-0-companyName" cname="公司名称" placeholder="模糊查询" colWidth="3"/> <EF:EFInput ename="inqu_status-0-contractNo" cname="合同号" placeholder="模糊查询" colWidth="3"/>
<EF:EFInput ename="inqu_status-0-projName" cname="项目名称" placeholder="模糊查询" colWidth="3"/> <EF:EFInput ename="inqu_status-0-projName" cname="项目名称" placeholder="模糊查询" colWidth="3"/>
</div> </div>
</EF:EFRegion> </EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="no" isFloat="true" copyToAdd="false"> <EF:EFRegion id="result" title="记录集" fitHeight="true">
<EF:EFGrid blockId="result" autoDraw="override" showCount="true" height="74vh">
<EF:EFColumn ename="id" cname="主键" hidden="true"/> <EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="100" align="center"/> <EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="100" align="center"/>
<EF:EFColumn ename="companyName" cname="公司名称" enable="false" width="120" align="left"/> <EF:EFColumn ename="companyName" cname="公司名称" enable="false" width="120" align="left" hidden="true"/>
<EF:EFColumn ename="projCode" cname="项目编码" enable="false" width="120" align="left"/> <EF:EFColumn ename="projCode" cname="项目编码" enable="false" width="120" align="left"/>
<EF:EFColumn ename="contractNo" cname="合同号" enable="false" width="120" align="left"/> <EF:EFColumn ename="contractNo" cname="合同号" enable="false" width="120" align="left"/>
<EF:EFColumn ename="projName" cname="项目名称" enable="false" width="220" align="left"/> <EF:EFColumn ename="projName" cname="项目名称" enable="false" width="220" align="left"/>
<EF:EFComboColumn ename="projType" cname="项目类型" enable="false" width="100" align="center">
<EF:EFCodeOption codeName="app.sc.projType"/>
</EF:EFComboColumn>
<EF:EFColumn ename="createdBy" cname="创建人" enable="false" width="100" align="center"/> <EF:EFColumn ename="createdBy" cname="创建人" enable="false" width="100" align="center"/>
<EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="140" align="center" <EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="140" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss','yyyy-MM-dd HH:mm:ss']"/> editType="datetime" parseFormats="['yyyyMMddHHmmss','yyyy-MM-dd HH:mm:ss']"/>
......
...@@ -39,8 +39,6 @@ let save = function () { ...@@ -39,8 +39,6 @@ let save = function () {
message(msg); message(msg);
return; return;
} }
JSUtils.confirm("确定\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("", "HGSC101A", "save", true, JSUtils.submitGridsData("", "HGSC101A", "save", true,
function (e) { function (e) {
if (e.getStatus() !== -1) { if (e.getStatus() !== -1) {
...@@ -48,8 +46,6 @@ let save = function () { ...@@ -48,8 +46,6 @@ let save = function () {
} }
} }
); );
}
});
} }
/** /**
...@@ -60,9 +56,13 @@ let checkParams = function () { ...@@ -60,9 +56,13 @@ let checkParams = function () {
if (isBlank(projName)) { if (isBlank(projName)) {
return "项目名称不能为空"; return "项目名称不能为空";
} }
let companyCode = $("#result-0-companyCode").val(); let projType = $("#result-0-projType").val();
if (isBlank(projType)) {
return "项目类型不能为空";
}
/*let companyCode = $("#result-0-companyCode").val();
if (isBlank(companyCode)) { if (isBlank(companyCode)) {
return "请选择公司"; return "请选择公司";
} }*/
return null; return null;
} }
...@@ -11,10 +11,9 @@ ...@@ -11,10 +11,9 @@
<EF:EFInput cname="项目号" blockId="result" ename="projCode" row="0" colWidth="6" ratio="2:10" required="true" <EF:EFInput cname="项目号" blockId="result" ename="projCode" row="0" colWidth="6" ratio="2:10" required="true"
readonly="true"/> readonly="true"/>
</div> </div>
<div class="row"> <div class="row" style="display: none">
<EF:EFSelect cname="公司" blockId="result" ename="companyCode" row="0" colWidth="6" ratio="2:10" <EF:EFSelect cname="公司" blockId="result" ename="companyCode" row="0" colWidth="6" ratio="2:10"
filter="contains"> filter="contains">
<EF:EFOption label="请选择" value=""/>
<EF:EFOptions blockId="company_code_block_id" textField="textField" valueField="valueField"/> <EF:EFOptions blockId="company_code_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect> </EF:EFSelect>
<EF:EFInput cname="公司名称" blockId="result" ename="companyName" row="0" colWidth="6" ratio="2:10" <EF:EFInput cname="公司名称" blockId="result" ename="companyName" row="0" colWidth="6" ratio="2:10"
...@@ -24,6 +23,13 @@ ...@@ -24,6 +23,13 @@
<EF:EFInput cname="项目名称" blockId="result" ename="projName" row="0" colWidth="6" required="true" <EF:EFInput cname="项目名称" blockId="result" ename="projName" row="0" colWidth="6" required="true"
ratio="2:10" maxLength="200"/> ratio="2:10" maxLength="200"/>
</div> </div>
<div class="row">
<EF:EFSelect cname="项目类型" blockId="result" ename="projType" row="0" colWidth="6" ratio="2:10"
filter="contains">
<EF:EFOption label="请选择" value=""/>
<EF:EFCodeOption codeName="app.sc.projType"/>
</EF:EFSelect>
</div>
<br/> <br/>
<span style="color: red; ">说明:项目号由系统自动生成</span><br> <span style="color: red; ">说明:项目号由系统自动生成</span><br>
</EF:EFRegion> </EF:EFRegion>
......
...@@ -243,7 +243,7 @@ let showAuthButton = function () { ...@@ -243,7 +243,7 @@ let showAuthButton = function () {
let label = IPLATUI.EFTree.docTree.selectNode.treeId; let label = IPLATUI.EFTree.docTree.selectNode.treeId;
let leafType = IPLATUI.EFTree.docTree.selectNode.leafType; let leafType = IPLATUI.EFTree.docTree.selectNode.leafType;
// C:目录 // C:目录
if (!leafType && leafType != 'C') { if (isBlank(leafType) || leafType != 'C') {
$("#AUTH").hide(); $("#AUTH").hide();
$("#REMOVE_USER").hide(); $("#REMOVE_USER").hide();
$("#COPY_USER").hide(); $("#COPY_USER").hide();
......
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