Kaynağa Gözat

数据字典

master
yaoq 2 yıl önce
ebeveyn
işleme
a98cd3b39d
3 değiştirilmiş dosya ile 67 ekleme ve 1 silme
  1. +11
    -1
      smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/CodeBuildHandler.java
  2. +32
    -0
      smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/sys/base/dict/DictHandler.java
  3. +24
    -0
      smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/sys/base/dict/DictService.java

+ 11
- 1
smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/CodeBuildHandler.java Dosyayı Görüntüle

@@ -174,7 +174,17 @@ public class CodeBuildHandler extends AbstractHandler {
private void buildJavaService(long pageId) {
ModelForm form = ModelFormCache.getInstance().get(pageId);
String sName = form.getService();
if (StringUtils.isEmpty(sName)) throw new BizException("页面设置未定义服务名!" + form.getTitle());
if (StringUtils.isEmpty(sName)) {
//模块名称
form = ModelFormCache.getInstance().get(form.getParent());
if(form == null){
throw new BizException("页面设置未定义服务名!" + form.getTitle());
}
sName = form.getService();
if(StringUtils.isEmpty(sName)){
throw new BizException("模块设置未定义服务名!" + form.getTitle());
}
}
sName = CodeGenUtil.toUpperHump(sName);

SwMap model = new SwMap();


+ 32
- 0
smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/sys/base/dict/DictHandler.java Dosyayı Görüntüle

@@ -0,0 +1,32 @@
package cc.smtweb.system.bpm.web.sys.base.dict;

import cc.smtweb.framework.core.db.impl.DefaultEntity;
import cc.smtweb.framework.core.util.NumberUtil;
import cc.smtweb.system.bpm.web.engine.dynPage.DynPageSaveHandler;

/**
* Created by Akmm at 2022/7/1 15:47
* 区划保存
*/
public class DictHandler {

static class DictSaveHandler extends DynPageSaveHandler {

@Override
protected void setNewId(DefaultEntity bean) {
//字典 id用 类型id+编码
if (bean instanceof Dict) {
Dict dict = (Dict) bean;
dict.setEntityId(NumberUtil.getLongIgnoreErr(dict.getType() + dict.getCode()));
return;
}
//字典类型 id用编码
if (bean instanceof DictType) {
DictType dictType = (DictType) bean;
dictType.setEntityId(NumberUtil.getLongIgnoreErr(dictType.getCode()));
return;
}
super.setNewId(bean);
}
}
}

+ 24
- 0
smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/sys/base/dict/DictService.java Dosyayı Görüntüle

@@ -0,0 +1,24 @@
package cc.smtweb.system.bpm.web.sys.base.dict;

import cc.smtweb.framework.core.annotation.SwService;
import cc.smtweb.framework.core.mvc.service.AbstractHandler;
import cc.smtweb.system.bpm.web.engine.dynPage.DynPageService;
import cc.smtweb.system.bpm.web.sys.user.area.AreaHandler;

/**
* Created by 1 at 2022-07-28 09:23:54
* 页面【[数据字典]的服务类
*/
@SwService
public class DictService extends DynPageService {

@Override
protected AbstractHandler createHandler(String type) {
switch (type) {
case TYPE_SAVE:
return new DictHandler.DictSaveHandler();
}
return super.createHandler(type);
}

}

Yükleniyor…
İptal
Kaydet