@@ -174,7 +174,17 @@ public class CodeBuildHandler extends AbstractHandler { | |||||
private void buildJavaService(long pageId) { | private void buildJavaService(long pageId) { | ||||
ModelForm form = ModelFormCache.getInstance().get(pageId); | ModelForm form = ModelFormCache.getInstance().get(pageId); | ||||
String sName = form.getService(); | 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); | sName = CodeGenUtil.toUpperHump(sName); | ||||
SwMap model = new SwMap(); | SwMap model = new SwMap(); | ||||
@@ -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); | |||||
} | |||||
} | |||||
} |
@@ -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); | |||||
} | |||||
} |