liyg 2 年 前
コミット
a920a6e345

+ 4 - 4
src/main/java/com/steerinfo/dil/aspect/LogAspect.java

@@ -108,7 +108,7 @@ public class LogAspect {
                 //记录正常日志
                 log.info("方法返回:" + JSON.toJSONString(result));
                 log.info("执行时间(ms):"+exeCost);
-                log.info("执行===" + methodName + "===结束");
+                log.info("执行===" + methodName + "===成功");
                 //记录到数据库
                 List<LogResult> logResults=new ArrayList<>();
                 for(int i=0 ; i<foreignKeys.length ; i++){
@@ -129,9 +129,9 @@ public class LogAspect {
                 logResultMapper.batchInsert(logResults);
             }else{
                 //记录失败日志
-                log.error("方法返回:" + JSON.toJSONString(result));
-                log.error("执行时间(ms):"+exeCost);
-                log.error("执行===" + methodName + "===结束");
+                log.info("方法返回:" + JSON.toJSONString(result));
+                log.info("执行时间(ms):"+exeCost);
+                log.info("执行===" + methodName + "===失败");
             }
         }catch (Exception e){
             //记录错误日志

+ 5 - 5
src/main/java/com/steerinfo/dil/config/RequestFilter.java

@@ -29,15 +29,15 @@ public class RequestFilter implements Filter {
             HttpServletRequest httpRequest = (HttpServletRequest)request;
             //获取参数,并校验
             Cookie[] cookies = httpRequest.getCookies();
-            String userId = null;
-            String userName = null;
+            String userId = httpRequest.getHeader("userId");
+            String userName = httpRequest.getHeader("userName");
             //获取cookie用户数据
             for (Cookie cookie : cookies) {
-                if (userId==null && cookie.getName().equals("userId")) {
+                if (cookie.getName().equals("userId") && (userId==null || userId.equals(""))) {
                     userId = cookie.getValue();
-                }else if(userName==null && cookie.getName().equals("userName")){
+                }else if(cookie.getName().equals("userName")  && (userName==null || userName.equals(""))){
                     userName = URLDecoder.decode(cookie.getValue(),"utf-8");
-                }else if(userId!=null && userName!=null){
+                }else if((userId==null || userId.equals("")) && (userName==null || userName.equals(""))){
                     //都查到了,退出
                     break;
                 }

+ 7 - 7
src/main/resources/com/steerinfo/dil/mapper/UniversalMapper.xml

@@ -107,7 +107,7 @@
         RC.SSO_CODE "ssoCode",
         RC.COMPANY_ID "id",
         RC.COMPANY_ID "value",
-        RC.COMPANY_NAME "label"
+        RC.COMPANY_TYPE || '-' || RC.COMPANY_NAME "label"
         from RMS_COMPANY RC
         where DELETED = 0        )
         <where>
@@ -117,7 +117,7 @@
             <if test="index!=null and index!=''">
                 AND REGEXP_LIKE("label", #{index})
             </if>
-           <if test="id!=null and !(index!=null and index!='')">
+           <if test="id!=null and id.size>0">
                 AND "id" in
                 <foreach collection="id" item="item"  open="(" close=")" separator="," >
                     #{item}
@@ -141,7 +141,7 @@
             <if test="index!=null and index!=''">
                 AND REGEXP_LIKE("label", #{index})
             </if>
-           <if test="id!=null and !(index!=null and index!='')">
+           <if test="id!=null and id.size>0">
                 AND "id" in
                 <foreach collection="id" item="item"  open="(" close=")" separator="," >
                     #{item}
@@ -165,7 +165,7 @@
             <if test="index!=null and index!=''">
                 AND REGEXP_LIKE("label", #{index})
             </if>
-           <if test="id!=null and !(index!=null and index!='')">
+           <if test="id!=null and id.size>0">
                 AND "id" in
                 <foreach collection="id" item="item"  open="(" close=")" separator="," >
                     #{item}
@@ -193,7 +193,7 @@
             <if test="index!=null and index!=''">
                 AND REGEXP_LIKE("label", #{index})
             </if>
-            <if test="id!=null and !(index!=null and index!='')">
+            <if test="id!=null and id.size>0">
                 AND "id" in
                 <foreach collection="id" item="item"  open="(" close=")" separator="," >
                     #{item}
@@ -217,7 +217,7 @@
             <if test="index!=null and index!=''">
                 AND REGEXP_LIKE("label", #{index})
             </if>
-           <if test="id!=null and !(index!=null and index!='')">
+           <if test="id!=null and id.size>0">
                 AND "id" in
                 <foreach collection="id" item="item"  open="(" close=")" separator="," >
                     #{item}
@@ -241,7 +241,7 @@
             <if test="index!=null and index!=''">
                 AND REGEXP_LIKE("label", #{index})
             </if>
-           <if test="id!=null and !(index!=null and index!='')">
+           <if test="id!=null and id.size>0">
                 AND "id" in
                 <foreach collection="id" item="item"  open="(" close=")" separator="," >
                     #{item}