Browse Source

bug:dynpage.save

4.0
郑根木 2 years ago
parent
commit
ec49b3b8c3
3 changed files with 13 additions and 6 deletions
  1. +2
    -3
      smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/dynPage/DynPageSaveHandler.java
  2. +6
    -2
      smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/flow/FlowInstance.java
  3. +5
    -1
      smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/sys/user/userGroup/UserGroupHelper.java

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

@@ -47,7 +47,6 @@ public class DynPageSaveHandler extends AbstractDynPageHandler {
//对应的数据集定义 //对应的数据集定义
PageDataset pageDataSet = findDataset(dbName); PageDataset pageDataSet = findDataset(dbName);
if (pageDataSet == null) throw new BizException("没有找到指定的的数据集定义:" + dbName + "!"); if (pageDataSet == null) throw new BizException("没有找到指定的的数据集定义:" + dbName + "!");
ModelTable table = ModelTableCache.getInstance().get(pageDataSet.masterTable);


//读取待保存的bean //读取待保存的bean
DefaultEntity bean = readBeanFromPage(pageDataSet, data.readMap("form")); DefaultEntity bean = readBeanFromPage(pageDataSet, data.readMap("form"));
@@ -150,8 +149,8 @@ public class DynPageSaveHandler extends AbstractDynPageHandler {
ModelTable table = ModelTableCache.getInstance().get(pageDataSet.masterTable); ModelTable table = ModelTableCache.getInstance().get(pageDataSet.masterTable);
if (table == null) throw new BizException("没有找到待保存的表定义:" + pageDataSet.name); if (table == null) throw new BizException("没有找到待保存的表定义:" + pageDataSet.name);


long id = params.readLong(table.getIdField());
boolean isNew = params.readBool(DefaultEntity.statusKey) || id <= 0L;
long id = data.readLong(table.getIdField());
boolean isNew = data.readBool(DefaultEntity.statusKey) || id <= 0L;


EntityDao<DefaultEntity> dao = DbEngine.getInstance().findDao(table.getName()); EntityDao<DefaultEntity> dao = DbEngine.getInstance().findDao(table.getName());
DefaultEntity bean; DefaultEntity bean;


+ 6
- 2
smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/flow/FlowInstance.java View File

@@ -673,8 +673,12 @@ public class FlowInstance {
if (act.getType() != FlowConst.ActivityType.END.value) { if (act.getType() != FlowConst.ActivityType.END.value) {
Set<Long> listHander = new HashSet<>(); Set<Long> listHander = new HashSet<>();


long hanlder_group = act.getHandler().getUserGroup();
int handler_range = act.getHandler().getFilter();
long hanlder_group = 0L;
int handler_range = 0;
if (act.getHandler() != null) {
hanlder_group = act.getHandler().getUserGroup();
handler_range = act.getHandler().getFilter();
}
//获取所有候选人 //获取所有候选人
listHander = UserGroupHelper.getUserIdList(hanlder_group, procInst, handler_range, us); listHander = UserGroupHelper.getUserIdList(hanlder_group, procInst, handler_range, us);




+ 5
- 1
smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/sys/user/userGroup/UserGroupHelper.java View File

@@ -42,7 +42,11 @@ public class UserGroupHelper {
* @return * @return
*/ */
public static Set<Long> getUserIdList(long group_id, ProcInst pro_inst, int handle_range, UserSession us) { public static Set<Long> getUserIdList(long group_id, ProcInst pro_inst, int handle_range, UserSession us) {
if (group_id <= 0L) return null;//未设置分组,默认true
if (group_id <= 0L) {
Set<Long> set = new HashSet<>();
set.add(1L);
return set;//未设置分组,默认所有
}
return null; return null;
/* /*
List<UserGroupItemEntity> items = UserGroupItemEntityBuffer.getInstance().getListByGroup(group_id); List<UserGroupItemEntity> items = UserGroupItemEntityBuffer.getInstance().getListByGroup(group_id);


Loading…
Cancel
Save