|
|
@@ -1,6 +1,7 @@ |
|
|
|
package cc.smtweb.system.bpm.web.design.form; |
|
|
|
|
|
|
|
import cc.smtweb.framework.core.cache.AbstractCache; |
|
|
|
import cc.smtweb.framework.core.common.SwConsts; |
|
|
|
import cc.smtweb.framework.core.common.SwEnum; |
|
|
|
import cc.smtweb.framework.core.exception.BizException; |
|
|
|
import cc.smtweb.framework.core.exception.SwException; |
|
|
@@ -13,7 +14,10 @@ import cc.smtweb.framework.core.session.UserSession; |
|
|
|
import cc.smtweb.framework.core.util.CommUtil; |
|
|
|
import cc.smtweb.framework.core.util.JsonUtil; |
|
|
|
import cc.smtweb.framework.core.util.MapUtil; |
|
|
|
import cc.smtweb.framework.core.util.SpringUtil; |
|
|
|
import cc.smtweb.system.bpm.spring.BpmConfigBean; |
|
|
|
import cc.smtweb.system.bpm.util.CodeGenerator; |
|
|
|
import cc.smtweb.system.bpm.util.IdeaUtil; |
|
|
|
import cc.smtweb.system.bpm.web.design.db.ModelCatalogCache; |
|
|
|
import cc.smtweb.system.bpm.web.design.db.ModelProjectCache; |
|
|
|
import cc.smtweb.system.bpm.web.design.form.define.*; |
|
|
@@ -472,4 +476,24 @@ public class ModelFormHelper { |
|
|
|
ModelForm form = set.iterator().next(); |
|
|
|
return (form != null) ? form.getEntityId() : 0L; |
|
|
|
} |
|
|
|
|
|
|
|
//js文件的路径 |
|
|
|
public String getJsPath(ModelForm form) { |
|
|
|
if (form == null) throw new BizException("页面定义对象不能为空!"); |
|
|
|
String moduleName = ModelProjectCache.getInstance().getModule(form.getPrjId()); |
|
|
|
BpmConfigBean bpmConfigBean = SpringUtil.getBean(BpmConfigBean.class); |
|
|
|
Map<String, String> mapIdeaModules = IdeaUtil.getModules(bpmConfigBean.getCodeJavaPath()); |
|
|
|
if (mapIdeaModules == null || mapIdeaModules.isEmpty()) throw new BizException("没有定义idea项目的路径(smtweb.bpm.codeJavaPath)!"); |
|
|
|
String codeJavaPath = mapIdeaModules.get(moduleName); |
|
|
|
if (StringUtils.isEmpty(codeJavaPath)) { |
|
|
|
throw new BizException("没有找到对应项目在idea中Module的路径(" + moduleName + ")!"); |
|
|
|
} |
|
|
|
codeJavaPath += "/src/main/resources/static/event/" + moduleName + "/"; |
|
|
|
//加上目录 |
|
|
|
String cn = ModelCatalogCache.getInstance().getFullName(form.getMcId()); |
|
|
|
if (StringUtils.isNotEmpty(cn)) { |
|
|
|
codeJavaPath += cn.replaceAll("\\.", "/"); |
|
|
|
} |
|
|
|
return codeJavaPath; |
|
|
|
} |
|
|
|
} |