|
@@ -11,6 +11,7 @@ import cc.smtweb.framework.core.session.UserSession; |
|
|
import cc.smtweb.framework.core.util.PubUtil; |
|
|
import cc.smtweb.framework.core.util.PubUtil; |
|
|
import cc.smtweb.system.bpm.web.engine.dynPage.DynPageService; |
|
|
import cc.smtweb.system.bpm.web.engine.dynPage.DynPageService; |
|
|
import cc.smtweb.system.bpm.web.engine.dynPage.DynRetBean; |
|
|
import cc.smtweb.system.bpm.web.engine.dynPage.DynRetBean; |
|
|
|
|
|
import org.springframework.util.Assert; |
|
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
import java.util.ArrayList; |
|
|
import java.util.List; |
|
|
import java.util.List; |
|
@@ -39,11 +40,34 @@ public class EnumComboService extends DynPageService { |
|
|
if (PubUtil.isEmpty(cls)) return SwListData.create(new ArrayList(), 0); |
|
|
if (PubUtil.isEmpty(cls)) return SwListData.create(new ArrayList(), 0); |
|
|
List<SwMap> list = new ArrayList<>(); |
|
|
List<SwMap> list = new ArrayList<>(); |
|
|
try { |
|
|
try { |
|
|
AbstractEnum e; |
|
|
|
|
|
|
|
|
Class tempClass ; |
|
|
|
|
|
Class wantClass = null; |
|
|
try { |
|
|
try { |
|
|
e = (AbstractEnum) Class.forName(cls).getDeclaredField("inst").get(null); |
|
|
|
|
|
|
|
|
tempClass = Class.forName(cls); |
|
|
|
|
|
wantClass = tempClass; |
|
|
|
|
|
}catch (Exception e){ |
|
|
|
|
|
e.printStackTrace(); |
|
|
|
|
|
// |
|
|
|
|
|
int lIndex = cls.lastIndexOf("."); |
|
|
|
|
|
if (lIndex > 0) { |
|
|
|
|
|
String outClass = cls.substring(0, lIndex); |
|
|
|
|
|
String innerClass = outClass + "$" + cls.substring(lIndex+1); |
|
|
|
|
|
tempClass = Class.forName(outClass); |
|
|
|
|
|
Class[] declaredClasses = tempClass.getDeclaredClasses(); |
|
|
|
|
|
for (Class declaredClass : declaredClasses) { |
|
|
|
|
|
if (declaredClass.getName().equals(innerClass)) { |
|
|
|
|
|
wantClass = declaredClass; |
|
|
|
|
|
break; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
Assert.notNull(wantClass,"classNotFound"); |
|
|
|
|
|
AbstractEnum e ; |
|
|
|
|
|
try { |
|
|
|
|
|
e = (AbstractEnum) wantClass.getDeclaredField("inst").get(null); |
|
|
} catch (Exception e1) { |
|
|
} catch (Exception e1) { |
|
|
e = (AbstractEnum) Class.forName(cls).getDeclaredField("instance").get(null); |
|
|
|
|
|
|
|
|
e = (AbstractEnum) wantClass.getDeclaredField("instance").get(null); |
|
|
} |
|
|
} |
|
|
for (Object v : e.mapAll.values()) { |
|
|
for (Object v : e.mapAll.values()) { |
|
|
AbstractEnum.EnumBean bean = (AbstractEnum.EnumBean) v; |
|
|
AbstractEnum.EnumBean bean = (AbstractEnum.EnumBean) v; |
|
|