@@ -2,18 +2,19 @@ package cc.smtweb.system.bpm.web.engine.dynPage; | |||||
import cc.smtweb.framework.core.common.SwConsts; | import cc.smtweb.framework.core.common.SwConsts; | ||||
import cc.smtweb.framework.core.common.SwEnum; | import cc.smtweb.framework.core.common.SwEnum; | ||||
import cc.smtweb.framework.core.db.vo.ModelField; | |||||
import cc.smtweb.framework.core.exception.BizException; | |||||
import cc.smtweb.framework.core.common.SwMap; | import cc.smtweb.framework.core.common.SwMap; | ||||
import cc.smtweb.framework.core.db.DbEngine; | import cc.smtweb.framework.core.db.DbEngine; | ||||
import cc.smtweb.framework.core.db.EntityDao; | import cc.smtweb.framework.core.db.EntityDao; | ||||
import cc.smtweb.framework.core.db.cache.ModelTableCache; | import cc.smtweb.framework.core.db.cache.ModelTableCache; | ||||
import cc.smtweb.framework.core.db.impl.DefaultEntity; | import cc.smtweb.framework.core.db.impl.DefaultEntity; | ||||
import cc.smtweb.framework.core.db.vo.ModelField; | |||||
import cc.smtweb.framework.core.db.vo.ModelTable; | import cc.smtweb.framework.core.db.vo.ModelTable; | ||||
import cc.smtweb.framework.core.exception.BizException; | |||||
import cc.smtweb.framework.core.exception.SwException; | import cc.smtweb.framework.core.exception.SwException; | ||||
import cc.smtweb.framework.core.mvc.service.SqlNamedPara; | import cc.smtweb.framework.core.mvc.service.SqlNamedPara; | ||||
import cc.smtweb.framework.core.util.MapUtil; | import cc.smtweb.framework.core.util.MapUtil; | ||||
import cc.smtweb.framework.core.util.NumberUtil; | import cc.smtweb.framework.core.util.NumberUtil; | ||||
import cc.smtweb.framework.core.util.PubUtil; | |||||
import cc.smtweb.system.bpm.web.design.form.define.*; | import cc.smtweb.system.bpm.web.design.form.define.*; | ||||
import org.apache.commons.lang3.StringUtils; | import org.apache.commons.lang3.StringUtils; | ||||
@@ -36,7 +37,7 @@ public class DynPageHelper { | |||||
* @return | * @return | ||||
*/ | */ | ||||
public static SwMap createBean(PageDataset dataSet) { | public static SwMap createBean(PageDataset dataSet) { | ||||
if(dataSet.masterTable<=0){ | |||||
if (dataSet.masterTable <= 0) { | |||||
return new SwMap(); | return new SwMap(); | ||||
} | } | ||||
//主表 | //主表 | ||||
@@ -306,6 +307,18 @@ public class DynPageHelper { | |||||
args.put(name + "_2", ss[1]); | args.put(name + "_2", ss[1]); | ||||
return "(" + field + ">=:" + name + "_1 and " + field + "<=:" + name + "_2)"; | return "(" + field + ">=:" + name + "_1 and " + field + "<=:" + name + "_2)"; | ||||
}); | }); | ||||
mapBuilder.put(SwEnum.OptType.IN.value, (opt, field, name, value, args) -> { | |||||
if (PubUtil.isEmpty(value.toString())) return ""; | |||||
args.put(name, value); | |||||
return field + " in (:" + name + ") "; | |||||
}); | |||||
mapBuilder.put(SwEnum.OptType.NOT_IN.value, (opt, field, name, value, args) -> { | |||||
if (PubUtil.isEmpty(value.toString())) return ""; | |||||
args.put(name, value); | |||||
return field + " not in (:" + name + ") "; | |||||
}); | |||||
} | } | ||||
private static IBuilderExpr getBuilder(String opt) { | private static IBuilderExpr getBuilder(String opt) { | ||||
@@ -3,6 +3,7 @@ package cc.smtweb.system.bpm.web.sys.dev; | |||||
import cc.smtweb.framework.core.common.AbstractEnum; | import cc.smtweb.framework.core.common.AbstractEnum; | ||||
import cc.smtweb.framework.core.common.R; | import cc.smtweb.framework.core.common.R; | ||||
import cc.smtweb.framework.core.common.SwMap; | import cc.smtweb.framework.core.common.SwMap; | ||||
import cc.smtweb.framework.core.mvc.service.SqlPara; | |||||
import cc.smtweb.framework.core.mvc.service.SwListData; | import cc.smtweb.framework.core.mvc.service.SwListData; | ||||
import cc.smtweb.framework.core.util.PubUtil; | import cc.smtweb.framework.core.util.PubUtil; | ||||
import cc.smtweb.system.bpm.web.design.db.ModelProjectCache; | import cc.smtweb.system.bpm.web.design.db.ModelProjectCache; | ||||
@@ -10,6 +11,7 @@ import cc.smtweb.system.bpm.web.design.form.ModelForm; | |||||
import cc.smtweb.system.bpm.web.design.form.ModelFormCache; | import cc.smtweb.system.bpm.web.design.form.ModelFormCache; | ||||
import cc.smtweb.system.bpm.web.design.form.define.PageDataset; | import cc.smtweb.system.bpm.web.design.form.define.PageDataset; | ||||
import cc.smtweb.system.bpm.web.design.form.define.PageDatasets; | import cc.smtweb.system.bpm.web.design.form.define.PageDatasets; | ||||
import cc.smtweb.system.bpm.web.engine.dynPage.DynPageHelper; | |||||
import cc.smtweb.system.bpm.web.engine.dynPage.DynPageListHandler; | import cc.smtweb.system.bpm.web.engine.dynPage.DynPageListHandler; | ||||
import cc.smtweb.system.bpm.web.engine.dynPage.DynPageLoadHandler; | import cc.smtweb.system.bpm.web.engine.dynPage.DynPageLoadHandler; | ||||
@@ -134,6 +136,13 @@ public class ComboHandler { | |||||
} | } | ||||
@Override | @Override | ||||
protected SqlPara buildSqlPara() { | |||||
SwMap swMap = (SwMap) filter.clone(); | |||||
swMap.remove("mf_right"); | |||||
return DynPageHelper.buildSelectSql(pageDataSet, swMap); | |||||
} | |||||
@Override | |||||
protected void afterQuery(List<SwMap> listData) { | protected void afterQuery(List<SwMap> listData) { | ||||
super.afterQuery(listData); | super.afterQuery(listData); | ||||
listData.forEach(row -> { | listData.forEach(row -> { | ||||
@@ -0,0 +1,73 @@ | |||||
package cc.smtweb.system.bpm.web.sys.user.dataRightGroup; | |||||
import cc.smtweb.framework.core.annotation.SwTable; | |||||
import cc.smtweb.framework.core.common.SwMap; | |||||
import cc.smtweb.framework.core.db.impl.DefaultEntity; | |||||
/** | |||||
* Created by 1 at 2022-08-04 17:45:35 | |||||
* 实体【[数据权限组](SYS_DATA_RIGHT_GROUP)】的Entity类 | |||||
*/ | |||||
@SwTable("SYS_DATA_RIGHT_GROUP") | |||||
public class DataRightGroup extends DefaultEntity { | |||||
public static final String ENTITY_NAME = "SYS_DATA_RIGHT_GROUP"; | |||||
public DataRightGroup() { | |||||
super(ENTITY_NAME); | |||||
} | |||||
/** 主键 */ | |||||
public long getId() { | |||||
return getLong("sdrg_id"); | |||||
} | |||||
/** 主键 */ | |||||
public void setId(long sdrg_id) { | |||||
put("sdrg_id", sdrg_id); | |||||
} | |||||
/** 编码 */ | |||||
public String getCode() { | |||||
return getStr("sdrg_code"); | |||||
} | |||||
/** 编码 */ | |||||
public void setCode(String sdrg_code) { | |||||
put("sdrg_code", sdrg_code); | |||||
} | |||||
/** 名称 */ | |||||
public String getName() { | |||||
return getStr("sdrg_name"); | |||||
} | |||||
/** 名称 */ | |||||
public void setName(String sdrg_name) { | |||||
put("sdrg_name", sdrg_name); | |||||
} | |||||
/** 备注 */ | |||||
public String getRemark() { | |||||
return getStr("sdrg_remark"); | |||||
} | |||||
/** 备注 */ | |||||
public void setRemark(String sdrg_remark) { | |||||
put("sdrg_remark", sdrg_remark); | |||||
} | |||||
/** 数据权限详细 */ | |||||
public String getContent() { | |||||
return getStr("sdrg_content"); | |||||
} | |||||
/** 数据权限详细 */ | |||||
public void setContent(String sdrg_content) { | |||||
put("sdrg_content", sdrg_content); | |||||
} | |||||
/** 数据权限定义 */ | |||||
public long getSdrdId() { | |||||
return getLong("sdrg_sdrd_id"); | |||||
} | |||||
/** 数据权限定义 */ | |||||
public void setSdrdId(long sdrg_sdrd_id) { | |||||
put("sdrg_sdrd_id", sdrg_sdrd_id); | |||||
} | |||||
} |
@@ -0,0 +1,34 @@ | |||||
package cc.smtweb.system.bpm.web.sys.user.dataRightGroup; | |||||
import cc.smtweb.framework.core.annotation.SwCache; | |||||
import cc.smtweb.framework.core.cache.AbstractEntityCache; | |||||
import cc.smtweb.framework.core.cache.CacheManager; | |||||
import java.util.ArrayList; | |||||
import java.util.Comparator; | |||||
import java.util.List; | |||||
import java.util.Set; | |||||
/** | |||||
* Created by 1 at 2022-08-04 17:45:35 | |||||
* 实体【[数据权限组](SYS_DATA_RIGHT_GROUP)】的缓存类 | |||||
*/ | |||||
@SwCache(ident = "SYS_DATA_RIGHT_GROUP", title = "数据权限组") | |||||
public class DataRightGroupCache extends AbstractEntityCache<DataRightGroup> { | |||||
//缓存key:按编码 | |||||
public final static String mk_code = "code"; | |||||
public static DataRightGroupCache getInstance() { | |||||
return CacheManager.getIntance().getCache(DataRightGroupCache.class); | |||||
} | |||||
public DataRightGroupCache() { | |||||
//缓存key:按编码 | |||||
regMap(mk_code, "sdrg_code"); | |||||
} | |||||
//缓存key:按编码 | |||||
public final DataRightGroup getByCode(String key) { | |||||
return getByKey(mk_code, key); | |||||
} | |||||
} |
@@ -0,0 +1,30 @@ | |||||
package cc.smtweb.system.bpm.web.sys.user.dataRightGroup; | |||||
import cc.smtweb.framework.core.annotation.SwBody; | |||||
import cc.smtweb.framework.core.annotation.SwService; | |||||
import cc.smtweb.framework.core.common.R; | |||||
import cc.smtweb.framework.core.common.SwMap; | |||||
import cc.smtweb.system.bpm.web.engine.dynPage.DynPageService; | |||||
import cc.smtweb.framework.core.mvc.service.AbstractHandler; | |||||
import cc.smtweb.framework.core.session.UserSession; | |||||
/** | |||||
* Created by 1 at 2022-08-04 17:45:35 | |||||
* 页面【[数据权限组]的服务类 | |||||
*/ | |||||
@SwService | |||||
public class DataRightGroupService extends DynPageService { | |||||
//public final static String TYPE_DEMO = "demo"; | |||||
@Override | |||||
protected AbstractHandler createHandler(String type) { | |||||
return super.createHandler(type); | |||||
} | |||||
/* demo | |||||
//自定义 | |||||
public R demo(@SwBody SwMap params, UserSession us) { | |||||
return pageHandler(params, us, TYPE_DEMO, handler -> ((DemoHandler)handler).demo()); | |||||
} | |||||
*/ | |||||
} |
@@ -87,7 +87,9 @@ | |||||
"preAction": "", | "preAction": "", | ||||
"link": false, | "link": false, | ||||
"text": true, | "text": true, | ||||
"confirm": "" | |||||
"confirm": "", | |||||
"nextAction": "button:search", | |||||
"dataset": "${param.queryDs}" | |||||
} | } | ||||
} | } | ||||
] | ] | ||||
@@ -279,7 +279,9 @@ | |||||
"props": { | "props": { | ||||
"label": "关闭", | "label": "关闭", | ||||
"leftIcon": "close", | "leftIcon": "close", | ||||
"action": "button:closeDialog" | |||||
"action": "button:closeDialog", | |||||
"dataset": "${param.queryDs}", | |||||
"nextAction": "button:search" | |||||
}, | }, | ||||
"id": "id${newId()}" | "id": "id${newId()}" | ||||
} | } | ||||
@@ -283,6 +283,8 @@ public interface SwEnum { | |||||
public static StrEnumBean BT = instance.addEnum("bt", "介于"); | public static StrEnumBean BT = instance.addEnum("bt", "介于"); | ||||
public static StrEnumBean PLIKE = instance.addEnum("plike", "开始以"); | public static StrEnumBean PLIKE = instance.addEnum("plike", "开始以"); | ||||
public static StrEnumBean LIKE = instance.addEnum("like", "包含"); | public static StrEnumBean LIKE = instance.addEnum("like", "包含"); | ||||
public static StrEnumBean IN = instance.addEnum("in", "在列表"); | |||||
public static StrEnumBean NOT_IN = instance.addEnum("not in", "不在列表"); | |||||
} | } | ||||
//合计栏类型 "summary": "COUNT/SUM/AVG/MAX/MIN/其他为文本" | //合计栏类型 "summary": "COUNT/SUM/AVG/MAX/MIN/其他为文本" | ||||