diff options
author | guochuyicmri <guochuyi@chinamobile.com> | 2019-04-29 12:11:08 +0800 |
---|---|---|
committer | shentao999 <shentao@chinamobile.com> | 2019-04-29 12:15:55 +0800 |
commit | c0a6b04ff93ff4e45a443a932feeaadf7ca24c7f (patch) | |
tree | 53dd053da9069bcce53f2afe6b39037c66fdd830 /ecomp-portal-BE-common/src/main/java/org | |
parent | b04f71de6f585687eb81333ab1fd909df0d8b71f (diff) |
Fix no reaction bug about changing language option
Change-Id: Ie1f75224d0cc70a87e77f5c357ed6e34b0cb3220
Issue-ID: PORTAL-565
Signed-off-by: shentao999 <shentao@chinamobile.com>
Diffstat (limited to 'ecomp-portal-BE-common/src/main/java/org')
2 files changed, 11 insertions, 16 deletions
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<String,String> 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<EPUser> list = null; - list = dataAccessService.executeNamedQuery("getEPUserByLoginId",params,new HashMap()); - for (EPUser user : list) { - int languageId = user.getLanguageId(); - HashMap<String,String> params1 = new HashMap(); - params1.put("language_id", String.valueOf(languageId)); - List<Language> 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; } } |