diff --git a/src/main/java/neatlogic/framework/process/constvalue/UserProfile.java b/src/main/java/neatlogic/framework/process/constvalue/UserProfile.java index 28c19e6c896d0938e9ab5730099a6c0fe16c3371..2187d74c3c2557c7d75dc8b4f290e963e21733c9 100755 --- a/src/main/java/neatlogic/framework/process/constvalue/UserProfile.java +++ b/src/main/java/neatlogic/framework/process/constvalue/UserProfile.java @@ -1,23 +1,20 @@ package neatlogic.framework.process.constvalue; import neatlogic.framework.common.constvalue.IUserProfile; -import neatlogic.framework.common.util.ModuleUtil; -import neatlogic.framework.dto.UserProfileVo; -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import neatlogic.framework.util.I18n; +import neatlogic.framework.common.constvalue.IUserProfileOperate; +import neatlogic.framework.util.$; import java.util.Arrays; import java.util.List; public enum UserProfile implements IUserProfile { - PROCESSTASK_SUCCESS("processtasksuccess", new I18n("服务上报成功"), Arrays.asList(UserProfileOperate.KEEP_ON_CREATE_TASK, UserProfileOperate.VIEW_PROCESSTASK_DETAIL, UserProfileOperate.BACK_CATALOG_LIST)); + PROCESSTASK_SUCCESS("processtasksuccess", "nfpc.userprofile.processtasksuccess", Arrays.asList(UserProfileOperate.KEEP_ON_CREATE_TASK, UserProfileOperate.VIEW_PROCESSTASK_DETAIL, UserProfileOperate.BACK_CATALOG_LIST)); private final String value; - private final I18n text; - private final List userProfileOperateList; + private final String text; + private final List userProfileOperateList; - private UserProfile(String _value, I18n _text, List _userProfileOperateList) { + private UserProfile(String _value, String _text, List _userProfileOperateList) { this.value = _value; this.text = _text; this.userProfileOperateList = _userProfileOperateList; @@ -28,18 +25,12 @@ public enum UserProfile implements IUserProfile { } public String getText() { - return text.toString(); + return $.t(text); } - public JSONArray getUserProfileOperateList() { - JSONArray userProfileOperateArray = new JSONArray(); - for (UserProfileOperate userProfileOperate : userProfileOperateList) { - JSONObject json = new JSONObject(); - json.put("value", userProfileOperate.getValue()); - json.put("text", userProfileOperate.getText()); - userProfileOperateArray.add(json); - } - return userProfileOperateArray; + @Override + public List getProfileOperateList() { + return userProfileOperateList; } public static String getText(String value) { @@ -56,21 +47,4 @@ public enum UserProfile implements IUserProfile { return "process"; } - @Override - public UserProfileVo getUserProfile() { - UserProfileVo userProfileVo = new UserProfileVo(); - userProfileVo.setModuleId(getModuleId()); - userProfileVo.setModuleName(ModuleUtil.getModuleById(getModuleId()).getName()); - JSONArray userProfileArray = new JSONArray(); - for (UserProfile f : UserProfile.values()) { - JSONObject configJson = new JSONObject(); - configJson.put("value", f.getValue()); - configJson.put("text", f.getText()); - configJson.put("userProfileOperateList", f.getUserProfileOperateList()); - userProfileArray.add(configJson); - } - userProfileVo.setConfig(userProfileArray.toJSONString()); - return userProfileVo; - } - } diff --git a/src/main/java/neatlogic/framework/process/constvalue/UserProfileOperate.java b/src/main/java/neatlogic/framework/process/constvalue/UserProfileOperate.java index a7ff374f08066eba89df55e6ef50b80073b596ed..d706b9a2052f97f03fcca17b36c462cfa645b547 100755 --- a/src/main/java/neatlogic/framework/process/constvalue/UserProfileOperate.java +++ b/src/main/java/neatlogic/framework/process/constvalue/UserProfileOperate.java @@ -1,16 +1,17 @@ package neatlogic.framework.process.constvalue; -import neatlogic.framework.util.I18n; +import neatlogic.framework.common.constvalue.IUserProfileOperate; +import neatlogic.framework.util.$; -public enum UserProfileOperate { - KEEP_ON_CREATE_TASK("keeponcreatetask", new I18n("继续上报")), - VIEW_PROCESSTASK_DETAIL("viewprocesstaskdetail", new I18n("查看工单详情")), - BACK_CATALOG_LIST("backcataloglist", new I18n("返回服务目录列表")); +public enum UserProfileOperate implements IUserProfileOperate { + KEEP_ON_CREATE_TASK("keeponcreatetask", "nfpc.userprofileoperate.keeponcreatetask"), + VIEW_PROCESSTASK_DETAIL("viewprocesstaskdetail", "nfpc.userprofileoperate.viewprocesstaskdetail"), + BACK_CATALOG_LIST("backcataloglist", "nfpc.userprofileoperate.backcataloglist"); private String value; - private I18n text; + private String text; - private UserProfileOperate(String _value, I18n _text) { + UserProfileOperate(String _value, String _text) { this.value = _value; this.text = _text; } @@ -20,7 +21,7 @@ public enum UserProfileOperate { } public String getText() { - return text.toString(); + return $.t(text); } }