summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorguochuyicmri <guochuyi@chinamobile.com>2019-04-29 12:11:08 +0800
committershentao999 <shentao@chinamobile.com>2019-04-29 12:15:55 +0800
commitc0a6b04ff93ff4e45a443a932feeaadf7ca24c7f (patch)
tree53dd053da9069bcce53f2afe6b39037c66fdd830
parentb04f71de6f585687eb81333ab1fd909df0d8b71f (diff)
Fix no reaction bug about changing language option
Change-Id: Ie1f75224d0cc70a87e77f5c357ed6e34b0cb3220 Issue-ID: PORTAL-565 Signed-off-by: shentao999 <shentao@chinamobile.com>
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/LanguageController.java2
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/LanguageServiceImpl.java25
-rw-r--r--ecomp-portal-BE-common/src/main/webapp/WEB-INF/fusion/orm/EP.hbm.xml6
-rw-r--r--ecomp-portal-BE-os/src/main/webapp/WEB-INF/jsp/login.jsp3
4 files changed, 19 insertions, 17 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;
}
}
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
]]>
</sql-query>
+
+ <sql-query name="updateFnUser">
+ <![CDATA[
+ UPDATE fn_user fu SET fu.language_id=:language_id WHERE fu.login_id=:login_id
+ ]]>
+ </sql-query>
</hibernate-mapping>
diff --git a/ecomp-portal-BE-os/src/main/webapp/WEB-INF/jsp/login.jsp b/ecomp-portal-BE-os/src/main/webapp/WEB-INF/jsp/login.jsp
index 8d80d334..99c5af4f 100644
--- a/ecomp-portal-BE-os/src/main/webapp/WEB-INF/jsp/login.jsp
+++ b/ecomp-portal-BE-os/src/main/webapp/WEB-INF/jsp/login.jsp
@@ -174,7 +174,8 @@ app.controller("externalLoginController", function ($scope) {
success:function (response){
if(response.success=="success"){
//window.location.href = 'applicationsHome';
- window.location.href= "<%=frontUrl%>"
+ window.location.href= "<%=frontUrl%>",
+ sessionStorage.setItem('userId',$scope.loginId)
}else{
$("#errorInfo span").text(response);
//$("#errorInfo").text = response;