Browse Source

master
郑根木 2 years ago
parent
commit
d52ea874fc
6 changed files with 12 additions and 8 deletions
  1. +0
    -1
      smtweb-framework/sw-framework-core/src/main/java/cc/smtweb/framework/core/mvc/service/SqlNamedPara.java
  2. +1
    -0
      smtweb-system/sw-system-bpm/src/main/java/cc/smtweb/system/bpm/web/engine/dynPage/DynPageHelper.java
  3. +2
    -2
      smtweb-system/sw-system-bpm/src/main/java/cc/smtweb/system/bpm/web/engine/dynPage/DynPageListHandler.java
  4. +5
    -3
      smtweb-system/sw-system-bpm/src/main/java/cc/smtweb/system/bpm/web/engine/dynPage/DynPageLoadHandler.java
  5. +2
    -2
      smtweb-system/sw-system-bpm/src/main/java/cc/smtweb/system/bpm/web/engine/dynPage/DynPageSaveHandler.java
  6. +2
    -0
      smtweb-system/sw-system-bpm/src/main/java/cc/smtweb/system/bpm/web/engine/dynPage/DynRetBean.java

+ 0
- 1
smtweb-framework/sw-framework-core/src/main/java/cc/smtweb/framework/core/mvc/service/SqlNamedPara.java View File

@@ -7,7 +7,6 @@ import java.util.Map;


//一个sql及其参数,具名参数 //一个sql及其参数,具名参数
public class SqlNamedPara extends SqlPara { public class SqlNamedPara extends SqlPara {
public String sql = "";
public SwMap mapParas = new SwMap(); public SwMap mapParas = new SwMap();
//字段别名 //字段别名
public Map<String, String> mapFieldAlias = new HashMap<>(); public Map<String, String> mapFieldAlias = new HashMap<>();


+ 1
- 0
smtweb-system/sw-system-bpm/src/main/java/cc/smtweb/system/bpm/web/engine/dynPage/DynPageHelper.java View File

@@ -159,6 +159,7 @@ public class DynPageHelper {
*/ */
private static String buildDynCondSql(PageDataset dataSet, PageDatasetDynCond dynCond, Map<String, Object> params, SwMap args, Set<String> setFixedFilter) { private static String buildDynCondSql(PageDataset dataSet, PageDatasetDynCond dynCond, Map<String, Object> params, SwMap args, Set<String> setFixedFilter) {
if (dynCond.isCondOpt()) {//是and/or if (dynCond.isCondOpt()) {//是and/or
if (dynCond.children == null || dynCond.children.isEmpty()) return "";
StringBuilder sql = new StringBuilder(256); StringBuilder sql = new StringBuilder(256);
boolean b = false; boolean b = false;
//递归调用 //递归调用


+ 2
- 2
smtweb-system/sw-system-bpm/src/main/java/cc/smtweb/system/bpm/web/engine/dynPage/DynPageListHandler.java View File

@@ -52,9 +52,9 @@ public class DynPageListHandler extends AbstractListHandler {
List<SwMap> list; List<SwMap> list;
SqlNamedPara sp = (SqlNamedPara)sqlPara; SqlNamedPara sp = (SqlNamedPara)sqlPara;
if (sqlPara.page > 0 && sqlPara.rows > 0) { if (sqlPara.page > 0 && sqlPara.rows > 0) {
list = DbEngine.getInstance().pagedQueryN(sqlPara.sql, SwMap.class, (sqlPara.page - 1) * sqlPara.rows, sqlPara.rows, sp.mapParas);
list = DbEngine.getInstance().pagedQueryN(sql, SwMap.class, (sqlPara.page - 1) * sqlPara.rows, sqlPara.rows, sp.mapParas);
} else { } else {
list = DbEngine.getInstance().queryN(sqlPara.sql, sp.mapParas, SwMap.class);
list = DbEngine.getInstance().queryN(sql, sp.mapParas, SwMap.class);
} }
ModelTable masterTable = ModelTableCache.getInstance().get(pageDataSet.masterTable); ModelTable masterTable = ModelTableCache.getInstance().get(pageDataSet.masterTable);
EntityHelper.loadBeanLink(masterTable.getName(), list, sp.mapFieldAlias); EntityHelper.loadBeanLink(masterTable.getName(), list, sp.mapFieldAlias);


+ 5
- 3
smtweb-system/sw-system-bpm/src/main/java/cc/smtweb/system/bpm/web/engine/dynPage/DynPageLoadHandler.java View File

@@ -30,7 +30,9 @@ public class DynPageLoadHandler extends AbstractDynPageHandler {


//列表工具类 //列表工具类
public DynPageListHandler getListWorker(SwMap filter, PageDataset pageDataSet) { public DynPageListHandler getListWorker(SwMap filter, PageDataset pageDataSet) {
return new DynPageListHandler(pageId, filter, pageDataSet);
DynPageListHandler listHandler = new DynPageListHandler(pageId, filter, pageDataSet);
listHandler.init(params, us);
return listHandler;
} }


//新增操作,初始化定义的数据集 //新增操作,初始化定义的数据集
@@ -71,7 +73,7 @@ public class DynPageLoadHandler extends AbstractDynPageHandler {


public R loadOne() { public R loadOne() {
//过滤条件 //过滤条件
SwMap filter = (SwMap) params.get("filter");
SwMap filter = params.readMap("filter");
//对应的数据集定义 //对应的数据集定义
PageDataset pageDataSet = readParamDs(); PageDataset pageDataSet = readParamDs();


@@ -96,7 +98,7 @@ public class DynPageLoadHandler extends AbstractDynPageHandler {
//数据集 //数据集
PageDataset pageDataSet = readParamDs(); PageDataset pageDataSet = readParamDs();
//过滤条件 //过滤条件
SwMap filter = (SwMap) params.get("filter");
SwMap filter = params.readMap("filter");


return getListWorker(filter, pageDataSet).getTotal(); return getListWorker(filter, pageDataSet).getTotal();
} }


+ 2
- 2
smtweb-system/sw-system-bpm/src/main/java/cc/smtweb/system/bpm/web/engine/dynPage/DynPageSaveHandler.java View File

@@ -36,7 +36,7 @@ public class DynPageSaveHandler extends AbstractDynPageHandler {
public R saveOne() { public R saveOne() {
//数据集 //数据集
String dbName = params.readString("dataset"); String dbName = params.readString("dataset");
SwMap filter = (SwMap) params.get("filter");
SwMap filter = params.readMap("filter");
//待保存数据 //待保存数据
SwMap data = params.readMap("data"); SwMap data = params.readMap("data");
if (data == null) throw new SwException("没有收到待保存的的数据:" + dbName + "!"); if (data == null) throw new SwException("没有收到待保存的的数据:" + dbName + "!");
@@ -77,7 +77,7 @@ public class DynPageSaveHandler extends AbstractDynPageHandler {
public R saveAll() { public R saveAll() {
SwMap data = params.readMap("data"); SwMap data = params.readMap("data");
if (data == null) throw new SwException("没有收到待保存的的数据!"); if (data == null) throw new SwException("没有收到待保存的的数据!");
SwMap filter = (SwMap) params.get("filter");
SwMap filter = params.readMap("filter");


Map<String, DefaultEntity> map = new LinkedHashMap<>(); Map<String, DefaultEntity> map = new LinkedHashMap<>();
for (PageDataset pageDataSet : datasets.list) { for (PageDataset pageDataSet : datasets.list) {


+ 2
- 0
smtweb-system/sw-system-bpm/src/main/java/cc/smtweb/system/bpm/web/engine/dynPage/DynRetBean.java View File

@@ -2,11 +2,13 @@ package cc.smtweb.system.bpm.web.engine.dynPage;


import cc.smtweb.framework.core.common.SwMap; import cc.smtweb.framework.core.common.SwMap;
import cc.smtweb.framework.core.mvc.service.SwListData; import cc.smtweb.framework.core.mvc.service.SwListData;
import lombok.Data;


/** /**
* Created by Akmm at 2022/4/21 19:26 * Created by Akmm at 2022/4/21 19:26
* 动态页面加载 * 动态页面加载
*/ */
@Data
public class DynRetBean { public class DynRetBean {
//单个表单 //单个表单
private SwMap form = null; private SwMap form = null;


Loading…
Cancel
Save