From c0a6b04ff93ff4e45a443a932feeaadf7ca24c7f Mon Sep 17 00:00:00 2001 From: guochuyicmri Date: Mon, 29 Apr 2019 12:11:08 +0800 Subject: Fix no reaction bug about changing language option Change-Id: Ie1f75224d0cc70a87e77f5c357ed6e34b0cb3220 Issue-ID: PORTAL-565 Signed-off-by: shentao999 --- .../portal/controller/LanguageController.java | 2 +- .../portal/service/LanguageServiceImpl.java | 25 +++++++++------------- .../src/main/webapp/WEB-INF/fusion/orm/EP.hbm.xml | 6 ++++++ 3 files changed, 17 insertions(+), 16 deletions(-) (limited to 'ecomp-portal-BE-common') diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/LanguageController.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/LanguageController.java index f3a79285..383e4720 100644 --- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/LanguageController.java +++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/LanguageController.java @@ -32,7 +32,7 @@ public class LanguageController { @Autowired private LanguageService languageService; - @RequestMapping(value = "/language",method = RequestMethod.GET) + @RequestMapping(value = "/language",method = RequestMethod.GET, produces = "application/json;charset=UTF-8") public JSONObject getLanguageList() { return languageService.getLanguages(); } diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/LanguageServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/LanguageServiceImpl.java index b0d8c424..13d7097b 100644 --- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/LanguageServiceImpl.java +++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/LanguageServiceImpl.java @@ -55,21 +55,16 @@ public class LanguageServiceImpl implements LanguageService { JSONObject result = new com.alibaba.fastjson.JSONObject(); HashMap params = new HashMap(); params.put("login_id",loginId); + + EPUser user = (EPUser) dataAccessService.executeNamedQuery("getEPUserByLoginId",params,new HashMap()).get(0); + int languageId = user.getLanguageId(); + HashMap params1 = new HashMap(); + params1.put("language_id", String.valueOf(languageId)); + Language language = (Language) dataAccessService.executeNamedQuery("queryLanguageByLanguageId",params1,new HashMap()); + result.put("languageId",languageId); + result.put("languageName",language.getLanguageName()); + result.put("languageAlias",language.getLanguageAlias()); - List list = null; - list = dataAccessService.executeNamedQuery("getEPUserByLoginId",params,new HashMap()); - for (EPUser user : list) { - int languageId = user.getLanguageId(); - HashMap params1 = new HashMap(); - params1.put("language_id", String.valueOf(languageId)); - List languages = dataAccessService.executeNamedQuery("queryLanguageByLanguageId",params1,new HashMap()); - for (Language language : languages) { - result.put("languageId",languageId); - result.put("languageName",language.getLanguageName()); - result.put("languageAlias",language.getLanguageAlias()); - } - return result; - } - return null; + return result; } } diff --git a/ecomp-portal-BE-common/src/main/webapp/WEB-INF/fusion/orm/EP.hbm.xml b/ecomp-portal-BE-common/src/main/webapp/WEB-INF/fusion/orm/EP.hbm.xml index 4e8943ce..e38b398e 100644 --- a/ecomp-portal-BE-common/src/main/webapp/WEB-INF/fusion/orm/EP.hbm.xml +++ b/ecomp-portal-BE-common/src/main/webapp/WEB-INF/fusion/orm/EP.hbm.xml @@ -2548,4 +2548,10 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y ]]> + + + + -- cgit 1.2.3-korg