Bläddra i källkod

区划

master
郑根木 2 år sedan
förälder
incheckning
28283bb5a3
4 ändrade filer med 41 tillägg och 11 borttagningar
  1. +5
    -2
      smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/dynPage/DynPageSaveHandler.java
  2. +2
    -1
      smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/sys/user/area/AreaHandler.java
  3. +30
    -0
      smtweb-framework/bpm/src/main/resources/static/event/bpm/sys/user/area/area_list.js
  4. +4
    -8
      smtweb-framework/bpm/src/test/java/cc/smtweb/system/bpm/test/TestMain.java

+ 5
- 2
smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/dynPage/DynPageSaveHandler.java Visa fil

@@ -156,15 +156,18 @@ public class DynPageSaveHandler extends AbstractDynPageHandler {
if (id <= 0) {
bean = dao.createBean();
bean.setIsNew(true);
//暂时不考虑list保存的情况
bean.getData().putAll(data);
setNewId(bean);
} else {
bean = dao.queryEntity(id);
if (bean == null) {
throw new BizException("没有找到待保存的记录:" + table.getName() + "." + id);
}
//暂时不考虑list保存的情况
bean.getData().putAll(data);
}
//暂时不考虑list保存的情况
bean.getData().putAll(data);

return bean;
}



+ 2
- 1
smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/sys/user/area/AreaHandler.java Visa fil

@@ -2,6 +2,7 @@ package cc.smtweb.system.bpm.web.sys.user.area;

import cc.smtweb.framework.core.common.SwMap;
import cc.smtweb.framework.core.db.impl.DefaultEntity;
import cc.smtweb.framework.core.util.NumberUtil;
import cc.smtweb.system.bpm.web.design.form.define.PageDataset;
import cc.smtweb.system.bpm.web.engine.dynPage.DynPageLoadHandler;
import cc.smtweb.system.bpm.web.engine.dynPage.DynPageSaveHandler;
@@ -16,7 +17,7 @@ public class AreaHandler {
protected void setNewId(DefaultEntity bean) {
if (bean instanceof Area) {
Area area = (Area) bean;
area.setEntityId(Long.parseLong(area.getCode()));
area.setEntityId(NumberUtil.getLongIgnoreErr(area.getCode()));
} else {
super.setNewId(bean);
}


+ 30
- 0
smtweb-framework/bpm/src/main/resources/static/event/bpm/sys/user/area/area_list.js Visa fil

@@ -0,0 +1,30 @@
/**
* Created by 1 at 2022-07-26 17:18:17
* 注册事件类【行政区划管理】,参看event.defaultEvent.js
*/
window.$swEvent.setup("bpm.sys.user.area.area_list", {
setup(page){
const { $params,$refs, $widgets, $model, $utils, $tabRouter, $api } = page || {};
const { $$message, $$http } = $utils || {};
const custom = {};
//
const focusName = () => {
custom.name = $model.areacard.getFormVal("ar_name");
};
const changeName = (value) => {
if ($model.areacard.getFormVal("ar_full_name") === custom.name)
$model.areacard.setFormVal("ar_full_name", value);
};

const focusCode = () => {
custom.code = $model.areacard.getFormVal("ar_code");
};
const changeCode = (value) => {
if ($model.areacard.getFormVal("ar_seq") === custom.code)
$model.areacard.setFormVal("ar_seq", value);
};
return {
focusName, changeName, focusCode, changeCode
}
}
});

+ 4
- 8
smtweb-framework/bpm/src/test/java/cc/smtweb/system/bpm/test/TestMain.java Visa fil

@@ -1,11 +1,13 @@
package cc.smtweb.system.bpm.test;

import cc.smtweb.framework.core.util.FileUtil;
import cc.smtweb.system.bpm.util.IdeaUtil;
import cc.smtweb.system.bpm.web.design.form.ModelFormHelper;
import cc.smtweb.system.bpm.web.design.form.define.PageDatasetDynCond;


import java.util.Collections;
import java.util.Map;

/**
* Created by Akmm at 2021/12/25 22:21
@@ -13,13 +15,7 @@ import java.util.Collections;
public class TestMain {

public static void main(String[] args) throws Exception {
String js = FileUtil.readFileStr("e:\\jujia\\git\\6.0\\smtweb2\\smtweb-framework\\bpm\\src\\main\\resources\\static\\event\\defaultEvent.js");
int index = js.lastIndexOf("return ");
if (index < 0) {
return;
}
index = js.indexOf("{", index);
js = js.substring(index + 1, js.indexOf("}", index)).trim();
System.out.println(js.split(","));
Map<String, String> map = IdeaUtil.getModules("d:/work/smtweb2/smtweb-framework");

}
}

Laddar…
Avbryt
Spara