tanghp vor 2 Jahren
Ursprung
Commit
f2eb204867
4 geänderte Dateien mit 14 neuen und 5 gelöschten Zeilen
  1. +8
    -0
      smtweb-framework/sw-framework-core/src/main/java/cc/smtweb/framework/core/db/vo/ModelCatalog.java
  2. +2
    -1
      smtweb-framework/sw-framework-core/src/main/java/cc/smtweb/framework/core/mvc/service/TreeHelper.java
  3. +1
    -1
      smtweb-framework/sw-framework-core/src/main/java/cc/smtweb/framework/core/util/jackson/LongSerializer.java
  4. +3
    -3
      smtweb-system/sw-system-bpm/src/main/java/cc/smtweb/system/bpm/web/design/table/ModelCatalogTreeHandler.java

+ 8
- 0
smtweb-framework/sw-framework-core/src/main/java/cc/smtweb/framework/core/db/vo/ModelCatalog.java Datei anzeigen

@@ -30,6 +30,14 @@ public class ModelCatalog extends DefaultEntity {
put("mc_parent_id", mcParentId);
}

public String getLevelCode() {
return getStr("mc_level_code");
}

public void setLevelCode(String mcLevelCode) {
put("mc_level_code", mcLevelCode);
}

public String getCode() {
return getStr("mc_code");
}


+ 2
- 1
smtweb-framework/sw-framework-core/src/main/java/cc/smtweb/framework/core/mvc/service/TreeHelper.java Datei anzeigen

@@ -66,7 +66,8 @@ public class TreeHelper<T extends DefaultEntity> {

public List<T> getChildren(long id, Comparator<T> comparator) {
Collection<T> set = cache.getListByKey(SwConsts.KEY_PARENT_ID, String.valueOf(id));
List<T> list = new ArrayList<>(set);

List<T> list = set == null ? new ArrayList<>(): new ArrayList<>(set);
if (comparator != null)
list.sort(comparator);
return list;


+ 1
- 1
smtweb-framework/sw-framework-core/src/main/java/cc/smtweb/framework/core/util/jackson/LongSerializer.java Datei anzeigen

@@ -13,7 +13,7 @@ public class LongSerializer extends JsonSerializer<Long> {
if (value == null) {
gen.writeNull();
} else {
gen.writeNumber(value);
gen.writeString(String.valueOf(value));
}
}
}

+ 3
- 3
smtweb-system/sw-system-bpm/src/main/java/cc/smtweb/system/bpm/web/design/table/ModelCatalogTreeHandler.java Datei anzeigen

@@ -50,13 +50,13 @@ public class ModelCatalogTreeHandler extends AbstractTreeHandler<Object> {

EntityDao<ModelCatalog> dao = DbEngine.getInstance().findDao(ModelCatalog.ENTITY_NAME);
String text = "%" + params.readString("text") + "%";
List<ModelCatalog> list = dao.queryWhere(" where mc_prj_id=? and (mc_name like ? or mc_code like ?) order by mc_name", prj_id, text, text);
List<ModelCatalog> list = dao.queryWhere(" mc_prj_id=? and (mc_name like ? or mc_code like ?) order by mc_name", prj_id, text, text);
listRet.addAll(list);

switch (type) {
case TYPE_TABLE:
EntityDao<ModelTable> tabledao = DbEngine.getInstance().findDao(ModelTable.class);
List<ModelTable> l = tabledao.queryWhere(" where tb_prj_id=? and (tb_name like ? or tb_title like ?) order by tb_name", prj_id, text, text);
List<ModelTable> l = tabledao.queryWhere(" tb_prj_id=? and (tb_name like ? or tb_title like ?) order by tb_name", prj_id, text, text);
listRet.addAll(l);
break;
case TYPE_PAGE:
@@ -72,7 +72,7 @@ public class ModelCatalogTreeHandler extends AbstractTreeHandler<Object> {
if (id > 0) {
list = mcTreeHelper.getChildren(id, (o1, o2) -> CommUtil.chineseCompare(o1.getName(), o2.getName()));
} else {
list = mcTreeHelper.getChildren(prj_id, (o1, o2) -> CommUtil.chineseCompare(o1.getName(), o2.getName()));
list = mcTreeHelper.getChildren(-1, (o1, o2) -> CommUtil.chineseCompare(o1.getName(), o2.getName()));
}

listRet.addAll(list);


Laden…
Abbrechen
Speichern