liyg 1 rok temu
rodzic
commit
147ba19a58

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

@@ -36,6 +36,7 @@ public class RequestFilter implements Filter {
            String dilCompanyList = httpRequest.getHeader("dilCompanyList");
            String rootCompanyMap = httpRequest.getHeader("rootCompanyMap");
            String accessToken = httpRequest.getHeader("accessToken");
+           String urlFlag = httpRequest.getHeader("urlFlag");
            //获取cookie用户数据
            if (cookies != null && cookies.length > 0) {
                for (Cookie cookie : cookies) {
@@ -53,8 +54,10 @@ public class RequestFilter implements Filter {
                        rootCompanyMap = URLDecoder.decode(cookie.getValue(),"utf-8");
                    } else if (cookie.getName().equals("accessToken") && accessToken == null) {
                        accessToken = URLDecoder.decode(cookie.getValue(), "utf-8");
+                   }else if (cookie.getName().equals("urlFlag") && urlFlag == null) {
+                       urlFlag = URLDecoder.decode(cookie.getValue(), "utf-8");
                    }
-                   else if (userId != null && userName != null && orgCode != null && roleCodes != null && dilCompanyList != null && rootCompanyMap != null) {
+                   else if (userId != null && userName != null && orgCode != null && roleCodes != null && dilCompanyList != null && rootCompanyMap != null && urlFlag != null) {
                        //都查到了,退出
                        break;
                    }
@@ -66,6 +69,7 @@ public class RequestFilter implements Filter {
                roleCodes = URLDecoder.decode(roleCodes, "utf-8");
                dilCompanyList = URLDecoder.decode(dilCompanyList,"UTF-8");
                rootCompanyMap = URLDecoder.decode(rootCompanyMap,"utf-8");
+               urlFlag = URLDecoder.decode(urlFlag,"utf-8");
                //System.out.println(dilCompanyList.getClass().toString());
            }catch (Exception e){}
            httpRequest.setAttribute("userId", userId);
@@ -77,6 +81,7 @@ public class RequestFilter implements Filter {
            httpRequest.setAttribute("dilCompanyList",dilCompanyListObject);
            Object rootCompanyMapObject = JSONObject.parse(rootCompanyMap);
            httpRequest.setAttribute("rootCompanyMap",rootCompanyMapObject);
+           httpRequest.setAttribute("urlFlag",urlFlag);
            //获取RequestBody数据
            BufferedReader streamReader = new BufferedReader(new InputStreamReader(request.getInputStream(), "UTF-8"));
            StringBuilder strBuilder = new StringBuilder();
@@ -94,6 +99,7 @@ public class RequestFilter implements Filter {
                params.put("dilCompanyList",dilCompanyListObject);
                params.put("rootCompanyMap",rootCompanyMapObject);
                params.put("accessToken",accessToken);
+               params.put("urlFlag",urlFlag);
                log.debug("url:"+url);
                log.debug("params:"+params.toJSONString());
                //将新的RequestBody写入新的请求对象保存

+ 13 - 3
src/main/java/com/steerinfo/dil/controller/BackgroundProcessingController.java

@@ -40,7 +40,7 @@ public class BackgroundProcessingController extends BaseRESTfulController {
 
     @ApiOperation("登录接口")
     @PostMapping("bpLogin")
-    public Map<String,Object> bpLogin(@RequestParam String loginName, @RequestParam String password,  @RequestParam String app_code) {
+    public Map<String,Object> bpLogin(@RequestParam String loginName, @RequestParam String password,  @RequestParam String app_code,@RequestParam String urlFlag) {
         Map<String,Object> resMap = ssoUtil.individualLogin(loginName,password,app_code);
         if("succeed".equals(resMap.get("status"))) {
             Map<String, Object> dataMap = (Map<String, Object>) resMap.get("data");
@@ -48,9 +48,19 @@ public class BackgroundProcessingController extends BaseRESTfulController {
             // 根据用户名去查询该用户绑定的公司及下属公司
             List<Map<String, Object>> companyList = backgroundProcessingMapper.getCompanyList(loginName);
             Map<String,Object> rootCompanyMap = backgroundProcessingMapper.getCompanyRootMap(loginName);
-            //List<Map<String,Object>> currentCompanyList = backgroundProcessingMapper.getCurrentCompanyList(loginName);
             userInfo.put("dilCompanyList", companyList);
-            userInfo.put("rootCompanyMap",rootCompanyMap);
+            if (rootCompanyMap != null && rootCompanyMap.get("isListed") != null) {
+                userInfo.put("rootCompanyMap",rootCompanyMap);
+            }
+            if (urlFlag != null && urlFlag != "" && rootCompanyMap != null && !urlFlag.equals(rootCompanyMap.get("isListed"))) {
+                resMap.put("status","failed");
+                resMap.put("message","账号未在该平台注册,请检查账号");
+                resMap.put("resultMessage","账号未在该平台注册,请检查账号");
+                resMap.put("code","500");
+                return resMap;
+            }
+            //List<Map<String,Object>> currentCompanyList = backgroundProcessingMapper.getCurrentCompanyList(loginName);
+
             //userInfo.put("currentCompanyList",currentCompanyList);
             // 根据查询到的公司ID
             //System.out.println(userInfo);

+ 0 - 73
src/main/resources/application-dev2.yml

@@ -1,73 +0,0 @@
-#测试环境配置文件
-spring:
-  datasource:
-    url: jdbc:oracle:thin:@172.16.90.214:1521/gxmes
-    password: gxmestest
-    username: gxmestest
-    driver-class-name: oracle.jdbc.OracleDriver
-  application:
-    name: antai-api
-  mvc:
-    async:
-      request-timeout: 15000
-
-server:
-  port: 8080
-  tomcat:
-    max-threads: 1000
-    accept-count: 800
-    basedir: /tomcat/baseDir
-eureka:
-  client:
-    registerWithEureka: false
-    fetchRegistry: false
-
-openfeign:
-  ColumnDataFeign:
-    url: ${COLUMNDATAFEIGN_URL:172.16.90.214:8083}
-  AmsFeign:
-    url: ${AMSFEIGN_URL:localhost:8079}
-  BmsFeign:
-    url: ${BMSFEIGN_URL:localhost:8078}
-  TmsFeign:
-    url: ${TMSFEIGN_URL:localhost:8086}
-  WMSFeign:
-    url: ${WMSFEIGN_URL:localhost:8093}
-  OMSFeign:
-    url: ${OMSFEIGN_URL:localhost:8095}
-  RmsFeign:
-    url: ${RMSFEIGN_URL:localhost:8060}
-  IntegrationFeign:
-    url: ${INTEGRATIONFEIGN_URL:localhost:8066}
-  OTMSFeign:
-    url: ${OTMSFEIGN_URL:localhost:8038}
-  EmsFeign:
-    url: ${TMSFEIGN_URL:localhost:8096}
-  SSOFeign:
-    url: ${SSOFEIGN_URL:172.16.90.214:9001}
-  WebSocketFeign:
-    url: ${WEBSOCKETFEIGN_URL:localhost:8000}
-  REPORTFeign:
-    url: ${REPORTFEIGN_URL:localhost:8055}
-
-
-#远程调用
-feign:
-  hystrix:
-    enabled: false #开启熔断,熔断时间和feign超时时间必须一致,否则时间短的生效
-  client:
-    config:
-      default:  #默认配置,连接时间要短,读取时间要长
-        connectTimeout: 1000 #单位毫秒
-        readTimeout: 30000 #单位毫秒
-#熔断器
-hystrix:
-  command:
-    default:
-      execution:
-        isolation:
-          thread:
-            timeoutInMilliseconds: 15000 #设置熔断时间,单位毫秒
-          strategy: SEMAPHORE
-          semaphore:
-            maxConcurrentRequests: 1

+ 3 - 1
src/main/resources/com/steerinfo/dil/mapper/BackgroundProcessingMapper.xml

@@ -50,7 +50,8 @@
     <select id="getCompanyRootMap" resultType="java.util.Map">
         SELECT DISTINCT
             rc.company_id "rootCompanyId",
-            rc.COMPANY_NAME "rootCompanyName"
+            rc.COMPANY_NAME "rootCompanyName",
+            rc.IS_LISTED    "isListed"
         FROM
             RMS_COMPANY RC START WITH RC.COMPANY_ID IN (
             SELECT
@@ -61,6 +62,7 @@
             WHERE
                 RPC.DELETED = 0
               AND RP.PERSONNEL_JOB_NUMBER = #{userName}
+
         ) CONNECT BY PRIOR rc.PARENT_COMPANY_ID = RC.COMPANY_ID
         ORDER BY LEVEL DESC FETCH NEXT 1 ROW ONLY
     </select>

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

@@ -92,7 +92,6 @@
         RC.COMPANY_ID "id",
         RC.COMPANY_ID   "key",
         RC.COMPANY_ID "value",
-        RC.COMPANY_ID "carrierId",
         <if test="companyType==null">
             RC.COMPANY_TYPE || '-' ||
         </if>
@@ -151,6 +150,9 @@
             <if test="index!=null and index!=''">
                 AND REGEXP_LIKE(RC.COMPANY_NAME, #{index})
             </if>
+            <if test="isListed !=null and isListed!=''">
+                AND RC.is_Listed IS NOT NULL
+            </if>
         </where>
         <if test="noRow == null">
             order by LENGTH(company_name)
@@ -165,7 +167,6 @@
             RC.COMPANY_ID "id",
             RC.COMPANY_ID   "key",
             RC.COMPANY_ID "value",
-            RC.COMPANY_ID "carrierId",
             <if test="companyType==null">
                 RC.COMPANY_TYPE || '-' ||
             </if>