Commit 1e915792 by 宋祥

1.数据集支持初始化参数

parent e3d7c1fd
package com.baosight.hggp.common;
import com.baosight.hggp.core.enums.OrgTypeEnum;
import java.util.HashMap;
import java.util.Map;
/**
* @Author wwl
* @Date 2024/1/9 19:35
......@@ -63,14 +68,16 @@ public enum DdynamicEnum {
* 编写:yk
*/
USER_BLOCK_ID("user_block_id","loginName","userName","HGXSUser.queryComboBox"),
/**
* 模块:系统管理
* 用途:部门
* 编写:ly
*/
DEPT_CODE_BLOCK_ID("dept_code_block_id", "orgId", "orgCname", "factoryCode", "factoryName", "companyCode",
"companyName", "HGXSOrg.queryAll"),
/**
* 模块:系统管理
* 用途:部门
* 编写:ly
*/
DEPT_CODE_BLOCK_ID("dept_code_block_id", "orgId", "orgCname", "factoryCode", "factoryName", "companyCode",
"companyName", "HGXSOrg.queryAll", new HashMap() {{
put("orgType", OrgTypeEnum.DEPT.getCode());
}}),
/**
* 模块:系统管理
......@@ -78,14 +85,20 @@ public enum DdynamicEnum {
* 编写:ly
*/
FACTORY_CODE_BLOCK_ID("factory_code_block_id", "orgId", "orgCname", "companyCode",
"companyName", "HGXSOrg.queryAll"),
"companyName", "HGXSOrg.queryAll", new HashMap() {{
put("orgType", OrgTypeEnum.FACTORY.getCode());
}}),
/**
* 模块:系统管理
* 用途:公司查询
* 编写:ly
*/
COMPANY_CODE_BLOCK_ID("company_code_block_id", "orgId", "orgCname", "HGXSOrg.queryAll"),
COMPANY_CODE_BLOCK_ID("company_code_block_id", "orgId", "orgCname", "HGXSOrg.queryAll",
new HashMap() {{
put("orgType", OrgTypeEnum.COMPANY.getCode());
}}
),
/**
* 模块:公司名称
......@@ -132,6 +145,8 @@ public enum DdynamicEnum {
/** 数据源 */
private final String dbSource;
private Map paramMap;
DdynamicEnum(String blockId, String value, String text, String param1, String dbSource) {
this.blockId = blockId;
this.value = value;
......@@ -148,8 +163,19 @@ public enum DdynamicEnum {
this.param2 = param2;
this.dbSource = dbSource;
}
DdynamicEnum(String blockId, String value, String text, String param1, String param2, String param3, String dbSource) {
DdynamicEnum(String blockId, String value, String text, String param1, String param2, String dbSource,
Map paramMap) {
this.blockId = blockId;
this.value = value;
this.text = text;
this.param1 = param1;
this.param2 = param2;
this.dbSource = dbSource;
this.paramMap = paramMap;
}
DdynamicEnum(String blockId, String value, String text, String param1, String param2, String param3, String dbSource) {
this.blockId = blockId;
this.value = value;
this.text = text;
......@@ -169,8 +195,21 @@ public enum DdynamicEnum {
this.param4 = param4;
this.dbSource = dbSource;
}
DdynamicEnum(String blockId, String value, String text, String param1, String param2, String param3, String param4, String param5, String dbSource) {
DdynamicEnum(String blockId, String value, String text, String param1, String param2, String param3,
String param4, String dbSource, Map paramMap) {
this.blockId = blockId;
this.value = value;
this.text = text;
this.param1 = param1;
this.param2 = param2;
this.param3 = param3;
this.param4 = param4;
this.dbSource = dbSource;
this.paramMap = paramMap;
}
DdynamicEnum(String blockId, String value, String text, String param1, String param2, String param3, String param4, String param5, String dbSource) {
this.blockId = blockId;
this.value = value;
this.text = text;
......@@ -212,17 +251,42 @@ public enum DdynamicEnum {
this.param9 = param9;
this.dbSource = dbSource;
}
DdynamicEnum(String blockId, String value, String text, String dbSource){
DdynamicEnum(String blockId, String value, String text, String param1, String param2, String param3,
String param4, String param5, String param6, String param7, String param8, String param9,
String dbSource, Map paramMap) {
this.blockId = blockId;
this.value = value;
this.text = text;
this.param1 = param1;
this.param2 = param2;
this.param3 = param3;
this.param4 = param4;
this.param5 = param5;
this.param6 = param6;
this.param7 = param7;
this.param8 = param8;
this.param9 = param9;
this.dbSource = dbSource;
this.paramMap = paramMap;
}
DdynamicEnum(String blockId, String value, String text, String dbSource){
this.blockId = blockId;
this.value = value;
this.text = text;
this.dbSource = dbSource;
}
public String getDbSource() {
DdynamicEnum(String blockId, String value, String text, String dbSource, Map paramMap) {
this.blockId = blockId;
this.value = value;
this.text = text;
this.dbSource = dbSource;
this.paramMap = paramMap;
}
public String getDbSource() {
return dbSource;
}
......@@ -309,4 +373,9 @@ public enum DdynamicEnum {
public void setParam9(String param9) {
this.param9 = param9;
}
public Map getParamMap() {
return paramMap;
}
}
......@@ -30,7 +30,16 @@ import java.util.Map;
public class CommonMethod {
protected static Dao dao = (Dao) PlatApplicationContext.getBean( "dao" );
/**
* @param inInfo 前后台交互对象
* @param tableParams 表信息
* 公用下拉方法
*/
public static void initBlock(EiInfo inInfo, List<DdynamicEnum> tableParams){
initBlock(inInfo, tableParams, null,false);
}
/**
* @param inInfo 前后台交互对象
* @param tableParams 表信息
......@@ -69,6 +78,11 @@ public class CommonMethod {
for (DdynamicEnum tableParam : tableParams) {
/* 编辑块名称 */
eiBlock = new EiBlock(tableParam.getBlockId());
// 合并参数
Map paramMap = tableParam.getParamMap();
if (MapUtils.isNotEmpty(paramMap)) {
selectParams.putAll(paramMap);
}
/* 将所有查询到的结果放到暂存变量中 */
results = dao.query(tableParam.getDbSource(), selectParams, EiConstant.defaultOffset, -999999);
List<LinkedHashMap> resultRows = new ArrayList<>();
......
package com.baosight.xservices.xs.service;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.enums.OrgTypeEnum;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.pz.domain.HGPZ009;
import com.baosight.hggp.hg.pz.tools.HGPZTools;
......@@ -27,7 +26,6 @@ import com.baosight.xservices.xs.util.UserSession;
import org.apache.commons.lang.StringUtils;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
......@@ -50,15 +48,9 @@ public class ServiceXS3002 extends ServiceEPBase {
*/
public EiInfo initLoad(EiInfo inInfo) {
try {
Map queryMap = new HashMap();
queryMap.put("orgType", OrgTypeEnum.DEPT.getCode());
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.DEPT_CODE_BLOCK_ID), queryMap);
queryMap = new HashMap();
queryMap.put("orgType", OrgTypeEnum.FACTORY.getCode());
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.FACTORY_CODE_BLOCK_ID), queryMap);
queryMap = new HashMap();
queryMap.put("orgType", OrgTypeEnum.COMPANY.getCode());
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.COMPANY_CODE_BLOCK_ID), queryMap);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.DEPT_CODE_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.FACTORY_CODE_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.COMPANY_CODE_BLOCK_ID));
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, 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