From a6d631dfbc6b2f267701f2993364db789ebab52e Mon Sep 17 00:00:00 2001 From: zhangdaihao Date: Sat, 7 Sep 2019 19:23:45 +0800 Subject: [PATCH] =?UTF-8?q?--=20author:scott=20---=20date:20180907----=20f?= =?UTF-8?q?or:=20=E8=A7=A3=E5=86=B3=E8=BF=9E=E6=8E=A5=E8=BF=9C=E7=A8=8B?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=BA=93=E5=BE=88=E6=85=A2=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98=20----=20org/jeecgframework/web/cgform/controller/aut?= =?UTF-8?q?olist/CgAutoListController.java=20org/jeecgframework/easypoi/se?= =?UTF-8?q?rvice/EasypoiDictService.java=20org/jeecgframework/core/aop/Ehc?= =?UTF-8?q?acheAspect.java=20org/jeecgframework/web/system/controller/core?= =?UTF-8?q?/IconController.java=20com/jeecg/demo/controller/JeecgListDemoC?= =?UTF-8?q?ontroller.java=20org/jeecgframework/web/system/controller/core/?= =?UTF-8?q?LoginController.java=20org/jeecgframework/web/system/controller?= =?UTF-8?q?/core/MutiLangController.java=20org/jeecgframework/web/system/s?= =?UTF-8?q?ervice/MutiLangServiceI.java=20org/jeecgframework/web/system/se?= =?UTF-8?q?rvice/impl/MutiLangServiceImpl.java=20org/jeecgframework/tag/co?= =?UTF-8?q?re/easyui/MutiLangTag.java=20org/jeecgframework/web/cgform/engi?= =?UTF-8?q?ne/tag/MutiLangTag.java=20org/jeecgframework/web/superquery/con?= =?UTF-8?q?troller/SuperQueryMainController.java=20org/jeecgframework/web/?= =?UTF-8?q?system/controller/core/SystemController.java=20org/jeecgframewo?= =?UTF-8?q?rk/tag/core/easyui/TabTag.java=20org/jeecgframework/web/system/?= =?UTF-8?q?service/impl/UserServiceImpl.java=20--=20author:scott=20---=20d?= =?UTF-8?q?ate:20180907----=20for:=20=E8=A7=A3=E5=86=B3=E8=BF=9E=E6=8E=A5?= =?UTF-8?q?=E8=BF=9C=E7=A8=8B=E6=95=B0=E6=8D=AE=E5=BA=93=E5=BE=88=E6=85=A2?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98=20----?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/JeecgListDemoController.java | 64 ++++-------- .../core/aop/EhcacheAspect.java | 2 +- .../easypoi/service/EasypoiDictService.java | 14 ++- .../tag/core/easyui/MutiLangTag.java | 14 +-- .../tag/core/easyui/TabTag.java | 11 +-- .../autolist/CgAutoListController.java | 36 ++----- .../web/cgform/engine/tag/MutiLangTag.java | 23 ++--- .../controller/SuperQueryMainController.java | 44 +++------ .../controller/core/IconController.java | 1 - .../controller/core/LoginController.java | 66 ++++--------- .../controller/core/MutiLangController.java | 14 +-- .../controller/core/SystemController.java | 99 +++++-------------- .../web/system/service/MutiLangServiceI.java | 5 +- .../service/impl/MutiLangServiceImpl.java | 51 +--------- .../system/service/impl/UserServiceImpl.java | 18 +--- 15 files changed, 123 insertions(+), 339 deletions(-) diff --git a/src/main/java/com/jeecg/demo/controller/JeecgListDemoController.java b/src/main/java/com/jeecg/demo/controller/JeecgListDemoController.java index 7e14db08..7db44d62 100644 --- a/src/main/java/com/jeecg/demo/controller/JeecgListDemoController.java +++ b/src/main/java/com/jeecg/demo/controller/JeecgListDemoController.java @@ -1,26 +1,15 @@ package com.jeecg.demo.controller; + +import com.alibaba.fastjson.JSONArray; +import com.jeecg.demo.dao.JeecgMinidaoDao; +import com.jeecg.demo.entity.JeecgDemoEntity; +import com.jeecg.demo.entity.JeecgDemoPage; +import com.jeecg.demo.entity.JeecgLogReport; +import com.jeecg.demo.service.JeecgDemoServiceI; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import net.sf.json.JSONObject; - -import java.io.IOException; -import java.io.OutputStreamWriter; -import java.io.StringReader; -import java.text.ParseException; -import java.util.ArrayList; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import javax.servlet.ServletOutputStream; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.validation.ConstraintViolation; -import javax.validation.Validator; - import org.apache.batik.transcoder.Transcoder; import org.apache.batik.transcoder.TranscoderException; import org.apache.batik.transcoder.TranscoderInput; @@ -39,14 +28,7 @@ import org.jeecgframework.core.common.model.json.AjaxJson; import org.jeecgframework.core.common.model.json.DataGrid; import org.jeecgframework.core.common.model.json.Highchart; import org.jeecgframework.core.constant.Globals; -import org.jeecgframework.core.util.DBTypeUtil; -import org.jeecgframework.core.util.DateUtils; -import org.jeecgframework.core.util.ExceptionUtil; -import org.jeecgframework.core.util.JeecgDataAutorUtils; -import org.jeecgframework.core.util.MyBeanUtils; -import org.jeecgframework.core.util.ResourceUtil; -import org.jeecgframework.core.util.StringUtil; -import org.jeecgframework.core.util.oConvertUtils; +import org.jeecgframework.core.util.*; import org.jeecgframework.jwt.util.GsonUtil; import org.jeecgframework.jwt.util.ResponseMessage; import org.jeecgframework.jwt.util.Result; @@ -57,12 +39,10 @@ import org.jeecgframework.poi.excel.entity.ImportParams; import org.jeecgframework.poi.excel.entity.vo.NormalExcelConstants; import org.jeecgframework.tag.core.easyui.TagUtil; import org.jeecgframework.tag.vo.datatable.SortDirection; -import org.jeecgframework.web.system.controller.core.LoginController; import org.jeecgframework.web.system.enums.InterfaceEnum; import org.jeecgframework.web.system.pojo.base.InterfaceRuleDto; import org.jeecgframework.web.system.pojo.base.TSDepart; import org.jeecgframework.web.system.pojo.base.TSLog; -import org.jeecgframework.web.system.service.MutiLangServiceI; import org.jeecgframework.web.system.service.SystemService; import org.jeecgframework.web.system.util.InterfaceUtil; import org.slf4j.Logger; @@ -71,23 +51,22 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.MediaType; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartHttpServletRequest; import org.springframework.web.servlet.ModelAndView; import org.springframework.web.util.UriComponentsBuilder; -import com.alibaba.fastjson.JSONArray; -import com.jeecg.demo.dao.JeecgMinidaoDao; -import com.jeecg.demo.entity.JeecgDemoEntity; -import com.jeecg.demo.entity.JeecgDemoPage; -import com.jeecg.demo.entity.JeecgLogReport; -import com.jeecg.demo.service.JeecgDemoServiceI; +import javax.servlet.ServletOutputStream; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.validation.ConstraintViolation; +import javax.validation.Validator; +import java.io.IOException; +import java.io.OutputStreamWriter; +import java.io.StringReader; +import java.text.ParseException; +import java.util.*; /** * @Title: Controller @@ -116,9 +95,6 @@ public class JeecgListDemoController extends BaseController { @Autowired private JeecgMinidaoDao jeecgMinidaoDao; - @Autowired - private MutiLangServiceI mutiLangService; - /** * 采用minidao查询数据 * @param request @@ -521,7 +497,7 @@ public class JeecgListDemoController extends BaseController { Long count = systemService.getCountForJdbc("SELECT COUNT(1) FROM T_S_Log WHERE 1=1"); List lt = new ArrayList(); hc = new Highchart(); - hc.setName(mutiLangService.getLang(BROSWER_COUNT_ANALYSIS)); + hc.setName(MutiLangUtil.getLang(BROSWER_COUNT_ANALYSIS)); hc.setType(reportType); Map map; if (userBroswerList.size() > 0) { diff --git a/src/main/java/org/jeecgframework/core/aop/EhcacheAspect.java b/src/main/java/org/jeecgframework/core/aop/EhcacheAspect.java index af7482ed..9e1c6ea5 100644 --- a/src/main/java/org/jeecgframework/core/aop/EhcacheAspect.java +++ b/src/main/java/org/jeecgframework/core/aop/EhcacheAspect.java @@ -20,7 +20,7 @@ import org.springframework.stereotype.Component; /** * * @author 张代浩 - * @TODO 【暂时注释掉,减少内存占用 - 实际项目可根据需求放开注释,提高平台性能】 + * @TODO 【暂时注释掉,MutiLangTag减少内存占用 - 实际项目可根据需求放开注释,提高平台性能】 * 用途:注解式Ehcache缓存类 */ //@Component diff --git a/src/main/java/org/jeecgframework/easypoi/service/EasypoiDictService.java b/src/main/java/org/jeecgframework/easypoi/service/EasypoiDictService.java index c59d17f4..7b11b62d 100644 --- a/src/main/java/org/jeecgframework/easypoi/service/EasypoiDictService.java +++ b/src/main/java/org/jeecgframework/easypoi/service/EasypoiDictService.java @@ -1,16 +1,16 @@ package org.jeecgframework.easypoi.service; -import java.util.ArrayList; -import java.util.List; - import org.apache.log4j.Logger; +import org.jeecgframework.core.util.MutiLangUtil; import org.jeecgframework.core.util.StringUtil; import org.jeecgframework.web.system.dao.JeecgDictDao; import org.jeecgframework.web.system.pojo.base.DictEntity; -import org.jeecgframework.web.system.service.MutiLangServiceI; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.ArrayList; +import java.util.List; + /** * 描述: * @author:scott @@ -23,9 +23,7 @@ public class EasypoiDictService implements EasypoiDictServiceI { @Autowired private JeecgDictDao jeecgDictDao; - @Autowired - private MutiLangServiceI mutiLangService; - + /** * 通过字典查询easypoi,所需字典文本 * @param @@ -48,7 +46,7 @@ public class EasypoiDictService implements EasypoiDictServiceI { } } for(DictEntity t:dictList){ - dictReplace.add(mutiLangService.getLang(t.getTypename())+"_"+t.getTypecode()); + dictReplace.add(MutiLangUtil.getLang(t.getTypename())+"_"+t.getTypecode()); } if(dictReplace!=null && dictReplace.size()!=0){ return dictReplace.toArray(new String[dictReplace.size()]); diff --git a/src/main/java/org/jeecgframework/tag/core/easyui/MutiLangTag.java b/src/main/java/org/jeecgframework/tag/core/easyui/MutiLangTag.java index d869a629..3048681b 100644 --- a/src/main/java/org/jeecgframework/tag/core/easyui/MutiLangTag.java +++ b/src/main/java/org/jeecgframework/tag/core/easyui/MutiLangTag.java @@ -1,14 +1,12 @@ package org.jeecgframework.tag.core.easyui; -import java.io.IOException; +import org.jeecgframework.core.util.MutiLangUtil; + import javax.servlet.jsp.JspTagException; import javax.servlet.jsp.JspWriter; import javax.servlet.jsp.tagext.TagSupport; -import org.jeecgframework.core.util.ApplicationContextUtil; -import org.jeecgframework.web.system.service.MutiLangServiceI; -import org.springframework.beans.factory.annotation.Autowired; -import org.jeecgframework.core.util.StringUtil; +import java.io.IOException; /** @@ -46,11 +44,7 @@ public class MutiLangTag extends TagSupport { } public String end() { - - MutiLangServiceI mutiLangService = ApplicationContextUtil.getContext().getBean(MutiLangServiceI.class); - - String lang_context = mutiLangService.getLang(langKey, langArg); - return lang_context; + return MutiLangUtil.getLang(langKey, langArg); } public void setLangKey(String langKey) { diff --git a/src/main/java/org/jeecgframework/tag/core/easyui/TabTag.java b/src/main/java/org/jeecgframework/tag/core/easyui/TabTag.java index 108d7335..5b659a52 100644 --- a/src/main/java/org/jeecgframework/tag/core/easyui/TabTag.java +++ b/src/main/java/org/jeecgframework/tag/core/easyui/TabTag.java @@ -1,13 +1,11 @@ package org.jeecgframework.tag.core.easyui; +import org.jeecgframework.core.util.MutiLangUtil; + import javax.servlet.jsp.JspTagException; import javax.servlet.jsp.tagext.Tag; import javax.servlet.jsp.tagext.TagSupport; -import org.jeecgframework.core.util.ApplicationContextUtil; -import org.jeecgframework.web.system.service.MutiLangServiceI; -import org.springframework.beans.factory.annotation.Autowired; - /** * * 类描述:选项卡选项标签 @@ -45,10 +43,7 @@ public class TabTag extends TagSupport { this.id = id; } public void setTitle(String title) { - - MutiLangServiceI mutiLangService = ApplicationContextUtil.getContext().getBean(MutiLangServiceI.class); - - String lang_context = mutiLangService.getLang(title, langArg); + String lang_context = MutiLangUtil.getLang(title, langArg); this.title = lang_context; } diff --git a/src/main/java/org/jeecgframework/web/cgform/controller/autolist/CgAutoListController.java b/src/main/java/org/jeecgframework/web/cgform/controller/autolist/CgAutoListController.java index 7b1b3045..49ca0075 100644 --- a/src/main/java/org/jeecgframework/web/cgform/controller/autolist/CgAutoListController.java +++ b/src/main/java/org/jeecgframework/web/cgform/controller/autolist/CgAutoListController.java @@ -1,18 +1,5 @@ package org.jeecgframework.web.cgform.controller.autolist; -import java.io.IOException; -import java.io.PrintWriter; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; - import org.apache.commons.lang.StringUtils; import org.jeecgframework.core.common.controller.BaseController; import org.jeecgframework.core.common.model.json.AjaxJson; @@ -20,15 +7,7 @@ import org.jeecgframework.core.common.model.json.DataGrid; import org.jeecgframework.core.constant.Globals; import org.jeecgframework.core.enums.SysThemesEnum; import org.jeecgframework.core.online.util.FreemarkerHelper; -import org.jeecgframework.core.util.ContextHolderUtils; -import org.jeecgframework.core.util.IpUtil; -import org.jeecgframework.core.util.JeecgDataAutorUtils; -import org.jeecgframework.core.util.MutiLangUtil; -import org.jeecgframework.core.util.ResourceUtil; -import org.jeecgframework.core.util.SqlInjectionUtil; -import org.jeecgframework.core.util.StringUtil; -import org.jeecgframework.core.util.SysThemesUtil; -import org.jeecgframework.core.util.oConvertUtils; +import org.jeecgframework.core.util.*; import org.jeecgframework.tag.core.easyui.TagUtil; import org.jeecgframework.web.cgform.common.CgAutoListConstant; import org.jeecgframework.web.cgform.entity.config.CgFormFieldEntity; @@ -42,11 +21,9 @@ import org.jeecgframework.web.cgform.service.template.CgformTemplateServiceI; import org.jeecgframework.web.cgform.util.PublicUtil; import org.jeecgframework.web.cgform.util.QueryParamUtil; import org.jeecgframework.web.cgform.util.TemplateUtil; -import org.jeecgframework.web.system.controller.core.LoginController; import org.jeecgframework.web.system.pojo.base.DictEntity; import org.jeecgframework.web.system.pojo.base.TSOperation; import org.jeecgframework.web.system.pojo.base.TSType; -import org.jeecgframework.web.system.service.MutiLangServiceI; import org.jeecgframework.web.system.service.SystemService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -55,6 +32,13 @@ import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; +import java.io.IOException; +import java.io.PrintWriter; +import java.util.*; + /** * * @Title:CgAutoListController @@ -78,8 +62,6 @@ public class CgAutoListController extends BaseController{ private CgFormFieldServiceI cgFormFieldService; @Autowired private CgformTemplateServiceI cgformTemplateService; - @Autowired - private MutiLangServiceI mutiLangService; /** * 动态列表展现入口 * @param id 动态配置ID @@ -720,7 +702,7 @@ public class CgAutoListController extends BaseController{ DictEntity d = new DictEntity(); d.setTypecode(tsType.getTypecode()); - d.setTypename(mutiLangService.getLang(tsType.getTypename())); + d.setTypename(MutiLangUtil.getLang(tsType.getTypename())); li.add(d); } diff --git a/src/main/java/org/jeecgframework/web/cgform/engine/tag/MutiLangTag.java b/src/main/java/org/jeecgframework/web/cgform/engine/tag/MutiLangTag.java index 102006f7..16919b94 100644 --- a/src/main/java/org/jeecgframework/web/cgform/engine/tag/MutiLangTag.java +++ b/src/main/java/org/jeecgframework/web/cgform/engine/tag/MutiLangTag.java @@ -1,22 +1,15 @@ package org.jeecgframework.web.cgform.engine.tag; -import java.io.IOException; -import java.io.Writer; -import java.util.Map; - -import org.jeecgframework.core.util.ApplicationContextUtil; -import org.jeecgframework.web.system.service.MutiLangServiceI; +import freemarker.core.Environment; +import freemarker.template.*; +import org.jeecgframework.core.util.MutiLangUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Component; -import freemarker.core.Environment; -import freemarker.template.TemplateDirectiveBody; -import freemarker.template.TemplateDirectiveModel; -import freemarker.template.TemplateException; -import freemarker.template.TemplateModel; -import freemarker.template.TemplateModelException; -import freemarker.template.TemplateScalarModel; +import java.io.IOException; +import java.io.Writer; +import java.util.Map; /** * 自定义多语言标签 @@ -41,9 +34,7 @@ public class MutiLangTag implements TemplateDirectiveModel { String langArg = getAttribute(params, "langArg"); - MutiLangServiceI mutiLangService = ApplicationContextUtil.getContext().getBean(MutiLangServiceI.class); - - String lang_context = mutiLangService.getLang(langKey, langArg); + String lang_context = MutiLangUtil.getLang(langKey, langArg); Writer out = env.getOut(); diff --git a/src/main/java/org/jeecgframework/web/superquery/controller/SuperQueryMainController.java b/src/main/java/org/jeecgframework/web/superquery/controller/SuperQueryMainController.java index 0b636833..39f7aefd 100644 --- a/src/main/java/org/jeecgframework/web/superquery/controller/SuperQueryMainController.java +++ b/src/main/java/org/jeecgframework/web/superquery/controller/SuperQueryMainController.java @@ -1,20 +1,7 @@ package org.jeecgframework.web.superquery.controller; + +import com.alibaba.fastjson.JSONArray; import io.swagger.annotations.ApiParam; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.Map.Entry; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.validation.ConstraintViolation; -import javax.validation.Validator; - import org.apache.commons.lang3.StringUtils; import org.hibernate.criterion.Restrictions; import org.jeecgframework.core.beanvalidator.BeanValidators; @@ -24,12 +11,7 @@ import org.jeecgframework.core.common.hibernate.qbc.CriteriaQuery; import org.jeecgframework.core.common.model.json.AjaxJson; import org.jeecgframework.core.common.model.json.DataGrid; import org.jeecgframework.core.constant.Globals; -import org.jeecgframework.core.util.ApplicationContextUtil; -import org.jeecgframework.core.util.ExceptionUtil; -import org.jeecgframework.core.util.MyBeanUtils; -import org.jeecgframework.core.util.ResourceUtil; -import org.jeecgframework.core.util.StringUtil; -import org.jeecgframework.core.util.oConvertUtils; +import org.jeecgframework.core.util.*; import org.jeecgframework.jwt.util.ResponseMessage; import org.jeecgframework.jwt.util.Result; import org.jeecgframework.poi.excel.ExcelImportUtil; @@ -44,7 +26,6 @@ import org.jeecgframework.web.superquery.entity.SuperQueryTableEntity; import org.jeecgframework.web.superquery.page.SuperQueryMainPage; import org.jeecgframework.web.superquery.service.SuperQueryMainServiceI; import org.jeecgframework.web.superquery.util.SuperQueryUtil; -import org.jeecgframework.web.system.service.MutiLangServiceI; import org.jeecgframework.web.system.service.SystemService; import org.jeecgframework.web.system.service.UserService; import org.slf4j.Logger; @@ -54,19 +35,19 @@ import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartHttpServletRequest; import org.springframework.web.servlet.ModelAndView; import org.springframework.web.util.UriComponentsBuilder; -import com.alibaba.fastjson.JSONArray; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.validation.ConstraintViolation; +import javax.validation.Validator; +import java.io.IOException; +import java.util.*; +import java.util.Map.Entry; /** * @Title: Controller @@ -868,12 +849,11 @@ public class SuperQueryMainController extends BaseController { List> selectType = systemService.findForJdbc(sql,typegroup); //step.2 根据查询的结果判断是否是国际化语言,是的话转换 List> listMap = new ArrayList>(); - MutiLangServiceI mutiLangService = ApplicationContextUtil.getContext().getBean(MutiLangServiceI.class); if(selectType.size()>0) { for (Map map : selectType) { Map mutiMap = new HashMap(); mutiMap.put("typecode", map.get("typecode")); - mutiMap.put("typename", mutiLangService.getLang(map.get("typename").toString())); + mutiMap.put("typename", MutiLangUtil.getLang(map.get("typename").toString())); listMap.add(mutiMap); } json.setObj(listMap); diff --git a/src/main/java/org/jeecgframework/web/system/controller/core/IconController.java b/src/main/java/org/jeecgframework/web/system/controller/core/IconController.java index 380e6c09..9d87d80d 100644 --- a/src/main/java/org/jeecgframework/web/system/controller/core/IconController.java +++ b/src/main/java/org/jeecgframework/web/system/controller/core/IconController.java @@ -17,7 +17,6 @@ import org.jeecgframework.core.util.MutiLangUtil; import org.jeecgframework.web.system.pojo.base.TSFunction; import org.jeecgframework.web.system.pojo.base.TSIcon; import org.jeecgframework.web.system.pojo.base.TSOperation; -import org.jeecgframework.web.system.service.MutiLangServiceI; import org.jeecgframework.web.system.service.SystemService; import org.jeecgframework.web.system.util.IconImageUtil; diff --git a/src/main/java/org/jeecgframework/web/system/controller/core/LoginController.java b/src/main/java/org/jeecgframework/web/system/controller/core/LoginController.java index f3975564..df483bb7 100644 --- a/src/main/java/org/jeecgframework/web/system/controller/core/LoginController.java +++ b/src/main/java/org/jeecgframework/web/system/controller/core/LoginController.java @@ -1,45 +1,19 @@ package org.jeecgframework.web.system.controller.core; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.UUID; - -import javax.annotation.Resource; -import javax.servlet.http.Cookie; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; - +import com.alibaba.fastjson.JSONObject; +import com.baomidou.kisso.SSOHelper; +import com.baomidou.kisso.SSOToken; +import com.baomidou.kisso.common.util.HttpUtil; import net.sf.json.JSONArray; - import org.apache.commons.lang.StringUtils; import org.jeecgframework.core.common.controller.BaseController; import org.jeecgframework.core.common.model.json.AjaxJson; import org.jeecgframework.core.constant.Globals; import org.jeecgframework.core.enums.SysThemesEnum; import org.jeecgframework.core.online.util.FreemarkerHelper; -import org.jeecgframework.core.util.ContextHolderUtils; -import org.jeecgframework.core.util.IpUtil; -import org.jeecgframework.core.util.JSONHelper; -import org.jeecgframework.core.util.ListtoMenu; -import org.jeecgframework.core.util.LogUtil; -import org.jeecgframework.core.util.MutiLangUtil; -import org.jeecgframework.core.util.PasswordUtil; -import org.jeecgframework.core.util.ResourceUtil; -import org.jeecgframework.core.util.SysThemesUtil; -import org.jeecgframework.core.util.oConvertUtils; +import org.jeecgframework.core.util.*; import org.jeecgframework.web.system.manager.ClientManager; -import org.jeecgframework.web.system.pojo.base.Client; -import org.jeecgframework.web.system.pojo.base.TSFunction; -import org.jeecgframework.web.system.pojo.base.TSPasswordResetkey; -import org.jeecgframework.web.system.pojo.base.TSRole; -import org.jeecgframework.web.system.pojo.base.TSRoleUser; -import org.jeecgframework.web.system.pojo.base.TSUser; -import org.jeecgframework.web.system.service.MutiLangServiceI; +import org.jeecgframework.web.system.pojo.base.*; import org.jeecgframework.web.system.service.SystemService; import org.jeecgframework.web.system.service.UserService; import org.jeecgframework.web.system.sms.util.MailUtil; @@ -54,10 +28,13 @@ import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.view.RedirectView; -import com.alibaba.fastjson.JSONObject; -import com.baomidou.kisso.SSOHelper; -import com.baomidou.kisso.SSOToken; -import com.baomidou.kisso.common.util.HttpUtil; +import javax.annotation.Resource; +import javax.servlet.http.Cookie; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; +import java.io.IOException; +import java.util.*; @@ -75,9 +52,6 @@ public class LoginController extends BaseController{ @Resource private ClientManager clientManager; - @Autowired - private MutiLangServiceI mutiLangService; - @Autowired public void setSystemService(SystemService systemService) { this.systemService = systemService; @@ -115,16 +89,16 @@ public class LoginController extends BaseController{ //验证码 String randCode = req.getParameter("randCode"); if (StringUtils.isEmpty(randCode)) { - j.setMsg(mutiLangService.getLang("common.enter.verifycode")); + j.setMsg(MutiLangUtil.getLang("common.enter.verifycode")); j.setSuccess(false); } else if (!randCode.equalsIgnoreCase(String.valueOf(session.getAttribute("randCode")))) { - j.setMsg(mutiLangService.getLang("common.verifycode.error")); + j.setMsg(MutiLangUtil.getLang("common.verifycode.error")); log.info("Username:{} ,验证码: {} 错误!", user.getUserName(), randCode); j.setSuccess(false); //IP黑名单 check } else if (userService.isInBlackList(IpUtil.getIpAddr(req))){ log.info("Username:{} ,IP: {} 进入黑名单!", user.getUserName(), IpUtil.getIpAddr(req)); - j.setMsg(mutiLangService.getLang("common.blacklist.error")); + j.setMsg(MutiLangUtil.getLang("common.blacklist.error")); j.setSuccess(false); } else { @@ -135,7 +109,7 @@ public class LoginController extends BaseController{ if(u == null || !u.getPassword().equals(PasswordUtil.encrypt(u.getUserName(),user.getPassword(), PasswordUtil.getStaticSalt()))){ - j.setMsg(mutiLangService.getLang("common.username.or.password.error")); + j.setMsg(MutiLangUtil.getLang("common.username.or.password.error")); j.setSuccess(false); return j; } @@ -143,13 +117,13 @@ public class LoginController extends BaseController{ if (u != null && u.getStatus() != 0) { if(u.getDeleteFlag()==1){ - j.setMsg(mutiLangService.getLang("common.username.or.password.error")); + j.setMsg(MutiLangUtil.getLang("common.username.or.password.error")); j.setSuccess(false); return j; } if("2".equals(u.getUserType())){ - j.setMsg(mutiLangService.getLang("common.user.interfaceUser")); + j.setMsg(MutiLangUtil.getLang("common.user.interfaceUser")); j.setSuccess(false); return j; } @@ -176,7 +150,7 @@ public class LoginController extends BaseController{ } } else { //用户锁定提醒 - j.setMsg(mutiLangService.getLang("common.lock.user")); + j.setMsg(MutiLangUtil.getLang("common.lock.user")); j.setSuccess(false); } } diff --git a/src/main/java/org/jeecgframework/web/system/controller/core/MutiLangController.java b/src/main/java/org/jeecgframework/web/system/controller/core/MutiLangController.java index 39e92f67..166f97fd 100644 --- a/src/main/java/org/jeecgframework/web/system/controller/core/MutiLangController.java +++ b/src/main/java/org/jeecgframework/web/system/controller/core/MutiLangController.java @@ -1,8 +1,5 @@ package org.jeecgframework.web.system.controller.core; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - import org.apache.log4j.Logger; import org.jeecgframework.core.common.controller.BaseController; import org.jeecgframework.core.common.hibernate.qbc.CriteriaQuery; @@ -23,13 +20,16 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.servlet.ModelAndView; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + /** * @Title: Controller * @Description: 多语言 * @author Rocky * @date 2014-06-28 00:09:31 * @version V1.0 - * + * */ //@Scope("prototype") @Controller @@ -118,7 +118,7 @@ public class MutiLangController extends BaseController { if(MutiLangUtil.existLangKey( mutiLang.getLangKey(),mutiLang.getLangCode())) { - message = mutiLangService.getLang("common.langkey.exist"); + message = MutiLangUtil.getLang("common.langkey.exist"); } if(StringUtil.isEmpty(message)) @@ -163,9 +163,9 @@ public class MutiLangController extends BaseController { try { mutiLangService.refleshMutiLangCach(); cacheService.clean(); - message = mutiLangService.getLang("common.refresh.success"); + message = MutiLangUtil.getLang("common.refresh.success"); } catch (Exception e) { - message = mutiLangService.getLang("common.refresh.fail"); + message = MutiLangUtil.getLang("common.refresh.fail"); } j.setMsg(message); return j; diff --git a/src/main/java/org/jeecgframework/web/system/controller/core/SystemController.java b/src/main/java/org/jeecgframework/web/system/controller/core/SystemController.java index 012b1aa6..6b80405a 100644 --- a/src/main/java/org/jeecgframework/web/system/controller/core/SystemController.java +++ b/src/main/java/org/jeecgframework/web/system/controller/core/SystemController.java @@ -1,29 +1,7 @@ package org.jeecgframework.web.system.controller.core; -import java.io.BufferedInputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.net.SocketException; -import java.net.URLEncoder; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Date; -import java.util.HashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Properties; -import java.util.Set; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; import org.apache.commons.net.ftp.FTP; import org.apache.commons.net.ftp.FTPClient; import org.apache.commons.net.ftp.FTPReply; @@ -31,29 +9,14 @@ import org.apache.log4j.Logger; import org.jeecgframework.core.common.controller.BaseController; import org.jeecgframework.core.common.dao.jdbc.JdbcDao; import org.jeecgframework.core.common.hibernate.qbc.CriteriaQuery; -import org.jeecgframework.core.common.model.json.AjaxJson; -import org.jeecgframework.core.common.model.json.ComboTree; -import org.jeecgframework.core.common.model.json.DataGrid; -import org.jeecgframework.core.common.model.json.TreeGrid; -import org.jeecgframework.core.common.model.json.ValidForm; +import org.jeecgframework.core.common.model.json.*; import org.jeecgframework.core.constant.Globals; import org.jeecgframework.core.enums.StoreUploadFilePathEnum; import org.jeecgframework.core.extend.hqlsearch.parse.ObjectParseUtil; import org.jeecgframework.core.extend.hqlsearch.parse.PageValueConvertRuleEnum; import org.jeecgframework.core.extend.hqlsearch.parse.vo.HqlRuleEnum; import org.jeecgframework.core.extend.swftools.SwfToolsUtil; -import org.jeecgframework.core.util.FileUtils; -import org.jeecgframework.core.util.JSONHelper; -import org.jeecgframework.core.util.ListUtils; -import org.jeecgframework.core.util.MutiLangSqlCriteriaUtil; -import org.jeecgframework.core.util.MutiLangUtil; -import org.jeecgframework.core.util.PropertiesUtil; -import org.jeecgframework.core.util.ResourceUtil; -import org.jeecgframework.core.util.SetListSort; -import org.jeecgframework.core.util.StringUtil; -import org.jeecgframework.core.util.UrlCheckUtil; -import org.jeecgframework.core.util.YouBianCodeUtil; -import org.jeecgframework.core.util.oConvertUtils; +import org.jeecgframework.core.util.*; import org.jeecgframework.tag.core.easyui.TagUtil; import org.jeecgframework.tag.vo.datatable.SortDirection; import org.jeecgframework.tag.vo.easyui.ComboTreeModel; @@ -61,17 +24,7 @@ import org.jeecgframework.tag.vo.easyui.TreeGridModel; import org.jeecgframework.web.cgform.exception.BusinessException; import org.jeecgframework.web.system.manager.ClientManager; import org.jeecgframework.web.system.manager.ClientSort; -import org.jeecgframework.web.system.pojo.base.Client; -import org.jeecgframework.web.system.pojo.base.DataLogDiff; -import org.jeecgframework.web.system.pojo.base.DictEntity; -import org.jeecgframework.web.system.pojo.base.TSDatalogEntity; -import org.jeecgframework.web.system.pojo.base.TSDepart; -import org.jeecgframework.web.system.pojo.base.TSFunction; -import org.jeecgframework.web.system.pojo.base.TSRole; -import org.jeecgframework.web.system.pojo.base.TSRoleFunction; -import org.jeecgframework.web.system.pojo.base.TSType; -import org.jeecgframework.web.system.pojo.base.TSTypegroup; -import org.jeecgframework.web.system.service.MutiLangServiceI; +import org.jeecgframework.web.system.pojo.base.*; import org.jeecgframework.web.system.service.SystemService; import org.jeecgframework.web.system.service.UserService; import org.springframework.beans.factory.annotation.Autowired; @@ -87,8 +40,15 @@ import org.springframework.web.multipart.MultipartHttpServletRequest; import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.view.RedirectView; -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.*; +import java.net.SocketException; +import java.net.URLEncoder; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.*; /** * 系统控制器 @@ -101,7 +61,6 @@ public class SystemController extends BaseController { private static final Logger logger = Logger.getLogger(SystemController.class); private UserService userService; private SystemService systemService; - private MutiLangServiceI mutiLangService; @Resource private ClientManager clientManager; @@ -111,10 +70,6 @@ public class SystemController extends BaseController { this.systemService = systemService; } - @Autowired - public void setMutiLangService(MutiLangServiceI mutiLangService) { - this.mutiLangService = mutiLangService; - } public UserService getUserService() { return userService; @@ -401,7 +356,7 @@ public class SystemController extends BaseController { // private void assembleConditionForMutilLang(CriteriaQuery cq, String typegroupname, List typegroupnameKeyList) { // Map typegroupnameMap = new HashMap(); // for (String nameKey : typegroupnameKeyList) { -// String name = mutiLangService.getLang(nameKey); +// String name = MutiLangUtil.getLang(nameKey); // typegroupnameMap.put(nameKey, name); // } // List tepegroupnameParamList = new ArrayList(); @@ -445,11 +400,11 @@ public class SystemController extends BaseController { AjaxJson j = new AjaxJson(); if (id.startsWith("G")) {//分组 TSTypegroup typegroup = systemService.getEntity(TSTypegroup.class, id.substring(1)); - message = "数据字典分组: " + mutiLangService.getLang(typegroup.getTypegroupname()) + "被删除 成功"; + message = "数据字典分组: " + MutiLangUtil.getLang(typegroup.getTypegroupname()) + "被删除 成功"; systemService.delete(typegroup); } else { TSType type = systemService.getEntity(TSType.class, id.substring(1)); - message = "数据字典类型: " + mutiLangService.getLang(type.getTypename()) + "被删除 成功"; + message = "数据字典类型: " + MutiLangUtil.getLang(type.getTypename()) + "被删除 成功"; systemService.delete(type); } systemService.addLog(message, Globals.Log_Type_DEL, Globals.Log_Leavel_INFO); @@ -471,14 +426,14 @@ public class SystemController extends BaseController { AjaxJson j = new AjaxJson(); typegroup = systemService.getEntity(TSTypegroup.class, typegroup.getId()); - message = "类型分组: " + mutiLangService.getLang(typegroup.getTypegroupname()) + " 被删除 成功"; + message = "类型分组: " + MutiLangUtil.getLang(typegroup.getTypegroupname()) + " 被删除 成功"; if (ListUtils.isNullOrEmpty(typegroup.getTSTypes())) { systemService.delete(typegroup); systemService.addLog(message, Globals.Log_Type_DEL, Globals.Log_Leavel_INFO); //刷新缓存 systemService.refleshTypeGroupCach(); } else { - message = "类型分组: " + mutiLangService.getLang(typegroup.getTypegroupname()) + " 下有类型信息,不能删除!"; + message = "类型分组: " + MutiLangUtil.getLang(typegroup.getTypegroupname()) + " 下有类型信息,不能删除!"; } j.setMsg(message); @@ -496,7 +451,7 @@ public class SystemController extends BaseController { String message = null; AjaxJson j = new AjaxJson(); type = systemService.getEntity(TSType.class, type.getId()); - message = "类型: " + mutiLangService.getLang(type.getTypename()) + "被删除 成功"; + message = "类型: " + MutiLangUtil.getLang(type.getTypename()) + "被删除 成功"; systemService.delete(type); //刷新缓存 systemService.refleshTypesCach(type); @@ -539,9 +494,9 @@ public class SystemController extends BaseController { AjaxJson j = new AjaxJson(); try{ systemService.refreshTypeGroupAndTypes(); - message = mutiLangService.getLang("common.refresh.success"); + message = MutiLangUtil.getLang("common.refresh.success"); } catch (Exception e) { - message = mutiLangService.getLang("common.refresh.fail"); + message = MutiLangUtil.getLang("common.refresh.fail"); } j.setMsg(message); return j; @@ -560,11 +515,11 @@ public class SystemController extends BaseController { String message = null; AjaxJson j = new AjaxJson(); if (StringUtil.isNotEmpty(typegroup.getId())) { - message = "类型分组: " + mutiLangService.getLang(typegroup.getTypegroupname()) + "被更新成功"; + message = "类型分组: " + MutiLangUtil.getLang(typegroup.getTypegroupname()) + "被更新成功"; userService.saveOrUpdate(typegroup); systemService.addLog(message, Globals.Log_Type_UPDATE, Globals.Log_Leavel_INFO); } else { - message = "类型分组: " + mutiLangService.getLang(typegroup.getTypegroupname()) + "被添加成功"; + message = "类型分组: " + MutiLangUtil.getLang(typegroup.getTypegroupname()) + "被添加成功"; userService.save(typegroup); systemService.addLog(message, Globals.Log_Type_INSERT, Globals.Log_Leavel_INFO); } @@ -613,11 +568,11 @@ public class SystemController extends BaseController { String message = null; AjaxJson j = new AjaxJson(); if (StringUtil.isNotEmpty(type.getId())) { - message = "类型: " + mutiLangService.getLang(type.getTypename()) + "被更新成功"; + message = "类型: " + MutiLangUtil.getLang(type.getTypename()) + "被更新成功"; userService.saveOrUpdate(type); systemService.addLog(message, Globals.Log_Type_UPDATE, Globals.Log_Leavel_INFO); } else { - message = "类型: " + mutiLangService.getLang(type.getTypename()) + "被添加成功"; + message = "类型: " + MutiLangUtil.getLang(type.getTypename()) + "被添加成功"; userService.save(type); systemService.addLog(message, Globals.Log_Type_INSERT, Globals.Log_Leavel_INFO); } @@ -657,7 +612,7 @@ public class SystemController extends BaseController { req.setAttribute("typegroup", typegroup); - req.setAttribute("typegroupname", mutiLangService.getLang(typegroupname)); + req.setAttribute("typegroupname", MutiLangUtil.getLang(typegroupname)); if (StringUtil.isNotEmpty(type.getId())) { type = systemService.getEntity(TSType.class, type.getId()); req.setAttribute("type", type); diff --git a/src/main/java/org/jeecgframework/web/system/service/MutiLangServiceI.java b/src/main/java/org/jeecgframework/web/system/service/MutiLangServiceI.java index bd063b4a..d726f4c8 100644 --- a/src/main/java/org/jeecgframework/web/system/service/MutiLangServiceI.java +++ b/src/main/java/org/jeecgframework/web/system/service/MutiLangServiceI.java @@ -6,10 +6,7 @@ public interface MutiLangServiceI{ public void initAllMutiLang(); - public String getLang(String lang_key); - - public String getLang(String lang_key, String args); - + public void refleshMutiLangCach(); /** diff --git a/src/main/java/org/jeecgframework/web/system/service/impl/MutiLangServiceImpl.java b/src/main/java/org/jeecgframework/web/system/service/impl/MutiLangServiceImpl.java index a64313d3..ced818d2 100644 --- a/src/main/java/org/jeecgframework/web/system/service/impl/MutiLangServiceImpl.java +++ b/src/main/java/org/jeecgframework/web/system/service/impl/MutiLangServiceImpl.java @@ -7,6 +7,7 @@ import java.util.Map; import javax.servlet.http.HttpServletRequest; import org.jeecgframework.core.common.dao.ICommonDao; +import org.jeecgframework.core.common.service.impl.CommonServiceImpl; import org.jeecgframework.core.util.BrowserUtils; import org.jeecgframework.core.util.ContextHolderUtils; import org.jeecgframework.core.util.ResourceUtil; @@ -22,17 +23,13 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @Service("mutiLangService") - -public class MutiLangServiceImpl implements MutiLangServiceI { +public class MutiLangServiceImpl extends CommonServiceImpl implements MutiLangServiceI { private static final Logger logger = LoggerFactory.getLogger(MutiLangServiceImpl.class); @Autowired - public ICommonDao commonDao; - @Autowired private CacheServiceI cacheService; /**初始化语言信息,TOMCAT启动时直接加入到内存中**/ - @Transactional(readOnly = true) public void initAllMutiLang() { Map ls = new HashMap(); List mutiLang = this.commonDao.loadAll(MutiLangEntity.class); @@ -75,50 +72,6 @@ public class MutiLangServiceImpl implements MutiLangServiceI { } - /**取 o_muti_lang.lang_key 的值返回当前语言的值**/ - public String getLang(String langKey) - { - //如果为空,返回空串,防止返回null - if(langKey==null){ - return ""; - } - HttpServletRequest request = ContextHolderUtils.getRequest(); - String language = oConvertUtils.getString(request.getSession().getAttribute("lang")); - if(oConvertUtils.isEmpty(language)){ - language = BrowserUtils.getBrowserLanguage(request); - } - - String langContext = ResourceUtil.getMutiLan(langKey + "_" + language); - if(StringUtil.isEmpty(langContext)) - { - langContext = ResourceUtil.getMutiLan("common.notfind.langkey" + "_" + language); - if("null".equals(langContext)||langContext==null ||langKey.startsWith("?")){ - langContext = ""; - } - langContext = langContext + langKey; - } - return langContext; - } - - public String getLang(String lanKey, String langArg) { - String langContext = ""; - if(StringUtil.isEmpty(langArg)) - { - langContext = getLang(lanKey); - } else - { - String[] argArray = langArg.split(","); - langContext = getLang(lanKey); - - for(int i=0; i< argArray.length; i++) - { - String langKeyArg = argArray[i].trim(); - String langKeyContext = getLang(langKeyArg); - langContext = StringUtil.replace(langContext, "{" + i + "}", langKeyContext); - } - } - return langContext; - } /** 刷新多语言cach **/ public void refleshMutiLangCach() { diff --git a/src/main/java/org/jeecgframework/web/system/service/impl/UserServiceImpl.java b/src/main/java/org/jeecgframework/web/system/service/impl/UserServiceImpl.java index 707bd1a6..6179fcc5 100644 --- a/src/main/java/org/jeecgframework/web/system/service/impl/UserServiceImpl.java +++ b/src/main/java/org/jeecgframework/web/system/service/impl/UserServiceImpl.java @@ -20,14 +20,7 @@ import org.hibernate.criterion.Projections; import org.hibernate.criterion.Restrictions; import org.jeecgframework.core.common.service.impl.CommonServiceImpl; import org.jeecgframework.core.constant.Globals; -import org.jeecgframework.core.util.BrowserUtils; -import org.jeecgframework.core.util.ContextHolderUtils; -import org.jeecgframework.core.util.DateUtils; -import org.jeecgframework.core.util.IpUtil; -import org.jeecgframework.core.util.NumberComparator; -import org.jeecgframework.core.util.ResourceUtil; -import org.jeecgframework.core.util.StringUtil; -import org.jeecgframework.core.util.oConvertUtils; +import org.jeecgframework.core.util.*; import org.jeecgframework.web.system.manager.ClientManager; import org.jeecgframework.web.system.pojo.base.Client; import org.jeecgframework.web.system.pojo.base.TSDepart; @@ -37,7 +30,6 @@ import org.jeecgframework.web.system.pojo.base.TSRole; import org.jeecgframework.web.system.pojo.base.TSRoleUser; import org.jeecgframework.web.system.pojo.base.TSUser; import org.jeecgframework.web.system.pojo.base.TSUserOrg; -import org.jeecgframework.web.system.service.MutiLangServiceI; import org.jeecgframework.web.system.service.UserService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -51,8 +43,6 @@ import org.springframework.transaction.annotation.Transactional; @Service("userService") public class UserServiceImpl extends CommonServiceImpl implements UserService { private Logger log = Logger.getLogger(UserServiceImpl.class); - @Autowired - private MutiLangServiceI mutiLangService; @Resource private ClientManager clientManager; @@ -290,7 +280,7 @@ public class UserServiceImpl extends CommonServiceImpl implements UserService { HttpSession session = ContextHolderUtils.getSession(); user.setDepartid(orgId); session.setAttribute(ResourceUtil.LOCAL_CLINET_USER, user); - message = mutiLangService.getLang("common.user") + ": " + user.getUserName() + "["+ currentDepart.getDepartname() + "]" + mutiLangService.getLang("common.login.success"); + message = MutiLangUtil.getLang("common.user") + ": " + user.getUserName() + "["+ currentDepart.getDepartname() + "]" + MutiLangUtil.getLang("common.login.success"); //IE列表操作按钮的样式 String browserType = ""; @@ -345,7 +335,7 @@ public class UserServiceImpl extends CommonServiceImpl implements UserService { for (TSFunction function : primaryMenu) { if (function.getFunctionLevel() == 0) { String lang_key = function.getFunctionName(); - String lang_context = mutiLangService.getLang(lang_key); + String lang_context = MutiLangUtil.getLang(lang_key); lang_context = lang_context.trim(); if ("业务申请".equals(lang_context)) { @@ -420,7 +410,7 @@ public class UserServiceImpl extends CommonServiceImpl implements UserService { if (function.getFunctionLevel() == 1) { String lang_key = function.getFunctionName(); - String lang_context = mutiLangService.getLang(lang_key); + String lang_context = MutiLangUtil.getLang(lang_key); if ("申请".equals(lang_key)) { lang_context = "申请"; String s = "";