Explorar el Código

Merge branch 'master' of https://gitee.com/antai-wuliu/ANTAI-API

Redeem hace 1 año
padre
commit
82878a4622

+ 1 - 0
.gitignore

@@ -6,6 +6,7 @@ rebel.xml
 out/artifacts/
 dil-api.iml
 src/test
+src/main/resources/application-dev2.yml
 # Compiled class file
 *.class
 

+ 7 - 0
src/main/java/com/steerinfo/DilApplicationMain.java

@@ -1,11 +1,13 @@
 package com.steerinfo;
 
+import feign.Retryer;
 import org.mybatis.spring.annotation.MapperScan;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.boot.web.servlet.ServletComponentScan;
 import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
 import org.springframework.cloud.openfeign.EnableFeignClients;
+import org.springframework.context.annotation.Bean;
 import org.springframework.scheduling.annotation.EnableScheduling;
 
 /**
@@ -23,4 +25,9 @@ public class DilApplicationMain {
     public static void main(String[] args) {
         SpringApplication.run(DilApplicationMain.class,args);
     }
+    @Bean
+    public Retryer feignRetryer() {
+        // 这里使用一个永不重试的Retryer
+        return Retryer.NEVER_RETRY;
+    }
 }

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

@@ -100,8 +100,8 @@ public class RequestFilter implements Filter {
                params.put("rootCompanyMap",rootCompanyMapObject);
                params.put("accessToken",accessToken);
                params.put("urlFlag",urlFlag);
-               log.info("url:"+url);
-               log.info("params:"+params.toJSONString());
+               log.debug("url:"+url);
+               log.debug("params:"+params.toJSONString());
                //将新的RequestBody写入新的请求对象保存
                ServletRequest requestWrapper = new RequestWrapper(httpRequest, params.toJSONString());
                chain.doFilter(requestWrapper, response);

+ 7 - 0
src/main/java/com/steerinfo/dil/controller/UniversalController.java

@@ -117,6 +117,13 @@ public class UniversalController extends BaseRESTfulController {
         return success(list);
     }
 
+    @ApiModelProperty(value = "边输边查车牌号生产")
+    @PostMapping("/getCapacityByLikeSc")
+    public RESTfulResult getCapacityByLikeSc(@RequestBody(required = false) Map<String,Object> map) {
+        List<Map<String, Object>> list = universalMapper.getCapacityByLikeSc(map);
+        return success(list);
+    }
+
     @ApiModelProperty(value = "边输边查快捷需求code")
     @PostMapping("/getCategoryCodeByLike")
     public RESTfulResult getCategoryCodeByLike(@RequestBody(required = false) Map<String,Object> map) {

+ 1 - 0
src/main/java/com/steerinfo/dil/mapper/UniversalMapper.java

@@ -34,6 +34,7 @@ public interface UniversalMapper {
     List<Map<String, Object>> getPersonnelByLike(Map<String, Object> map);
 
     List<Map<String, Object>> getCapacityByLike(Map<String, Object> map);
+    List<Map<String, Object>> getCapacityByLikeSc(Map<String, Object> map);
 
     List<Map<String, Object>> getTransRangeByLike(Map<String, Object> map);
     List<Map<String, Object>> getLineByLike(Map<String, Object> map);

+ 1 - 1
src/main/resources/bootstrap.yml

@@ -1,7 +1,7 @@
 api.version: api/v1
 spring:
   profiles:
-    include: ${SPRING_PROFILES:dev}
+    include: ${SPRING_PROFILES:dev2}
   jackson:
     date-format: yyyy-MM-dd HH:mm:ss
     time-zone: GMT+8

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

@@ -411,6 +411,148 @@
     </select>
 
     <select id="getCapacityByLike" resultType="java.util.Map">
+        select * from (
+        select * from (
+        SELECT DISTINCT
+        RCA .CAPACITY_ID "capacityId",
+        RCA .CAPACITY_ID "id",
+        RCA .CAPACITY_ID "value",
+        CASE WHEN RCA.REMARK1 is null
+        then RCA.CAPACITY_NUMBER
+        else RCA.REMARK1
+        end "label",
+        CASE WHEN RCA.REMARK1 is null
+        then RCA.CAPACITY_NUMBER
+        else RCA.REMARK1
+        end "text",
+        CASE WHEN RCA.REMARK1 is null
+        then RCA.CAPACITY_NUMBER
+        else RCA.REMARK1
+        end "remark1",
+        CASE WHEN RCA.REMARK1 is null
+        then RCA.CAPACITY_NUMBER
+        else RCA.REMARK1
+        end "capacityNumber",
+        (case
+        when oto.capacity_id is null then '空闲'
+        when oto.deleted != '2' and oto.capacity_id is not null then '已派'
+        end) "status",
+        'capacityNumber' "prop"
+        <if test="(driverId!=null and driverId!='') or (driverId2!=null and driverId2!='')">
+            ,NVL(T ."countNumber",0) "countNumber"
+        </if>
+        FROM
+        RMS_CAPACITY RCA
+        LEFT JOIN RMS_CAPACITY_CARRIER RCC ON RCA .CAPACITY_ID = RCC .CAPACITY_ID
+        LEFT JOIN RMS_COMPANY RC ON RC .COMPANY_ID = RCC .COMPANY_ID
+        LEFT JOIN RMS_CAPACITY_TYPE RCT ON RCA.CAPACITY_TYPE_ID = RCT.CAPACITY_TYPE_ID
+        left join oms_trans_order oto
+        on RCA.capacity_id = oto.capacity_id
+        and oto.deleted != 2
+        <if test="(driverId!=null and driverId!='') or (driverId2!=null and driverId2!='')">
+            LEFT JOIN (
+                SELECT CAPACITY_ID "capacityId",
+                COUNT( CAPACITY_ID ) "countNumber"
+                FROM OMS_TRANS_ORDER
+                <where>
+                    <if test="driverId!=null and driverId!=''">
+                       AND (DRIVER_ID = #{driverId}  OR DRIVER_ID2 = #{driverId})
+                    </if>
+                    <if test="driverId2!=null and driverId2!=''">
+                       AND DRIVER_ID = #{driverId2}  OR DRIVER_ID2 = #{driverId2}
+                    </if>
+                </where>
+                GROUP BY CAPACITY_ID
+            ) T ON T."capacityId" = RCA .CAPACITY_ID
+        </if>
+        WHERE RCA .DELETED = 0
+        <if test="orgCode!=null and orgCode !='' and roleCodes.contains('chengYunShang')">
+                AND RC.SSO_CODE = #{orgCode}
+            </if>
+            <if test="capacityType != null and capacityType != '' ">
+                AND RCT.CAPACITY_TYPE_NAME = #{capacityType}
+            </if>
+            <if test="capacityType == null">
+                AND RCT.CAPACITY_TYPE_NAME != '火车'
+            </if>
+            <if test="index!=null and index!=''">
+                AND REGEXP_LIKE(
+                    CASE WHEN RCA.REMARK1 is null
+                    then RCA.CAPACITY_NUMBER
+                    else RCA.REMARK1
+                    end, #{index}
+                )
+            </if>
+            <if test="capacityId!=null and capacityId!=''">
+                AND RCA .CAPACITY_ID = #{capacityId}
+            </if>
+            <if test="(driverId!=null and driverId!='') or (driverId2!=null and driverId2!='')">
+                ORDER BY "countNumber" DESC
+            </if>
+            FETCH NEXT 10 ROWS ONLY
+        )
+        <if test="id!=null and id.size>0">
+            UNION
+            SELECT DISTINCT
+            RCA .CAPACITY_ID "capacityId",
+            RCA .CAPACITY_ID "id",
+            RCA .CAPACITY_ID "value",
+            CASE WHEN RCA.REMARK1 is null
+            then RCA.CAPACITY_NUMBER
+            else RCA.REMARK1
+            end "label",
+            CASE WHEN RCA.REMARK1 is null
+            then RCA.CAPACITY_NUMBER
+            else RCA.REMARK1
+            end "text",
+            CASE WHEN RCA.REMARK1 is null
+            then RCA.CAPACITY_NUMBER
+            else RCA.REMARK1
+            end "remark1",
+            RCA.CAPACITY_NUMBER "capacityNumber",
+            (case
+            when oto.capacity_id is null then '空闲'
+            when oto.deleted != '2' and oto.capacity_id is not null then '已派'
+            end) "status",
+            'capacityNumber' "prop"
+            <if test="(driverId!=null and driverId!='') or (driverId2!=null and driverId2!='')">
+                ,NVL(T ."countNumber",0) "countNumber"
+            </if>
+            FROM RMS_CAPACITY RCA
+            LEFT JOIN RMS_CAPACITY_CARRIER RCC ON RCA .CAPACITY_ID = RCC .CAPACITY_ID
+            LEFT JOIN RMS_COMPANY RC ON RC .COMPANY_ID = RCC .COMPANY_ID
+            LEFT JOIN RMS_CAPACITY_TYPE RCT ON RCA.CAPACITY_TYPE_ID = RCT.CAPACITY_TYPE_ID
+            left join oms_trans_order oto
+            on RCA.capacity_id = oto.capacity_id
+            and oto.deleted != 2
+            <if test="(driverId!=null and driverId!='') or (driverId2!=null and driverId2!='')">
+                LEFT JOIN (
+                SELECT CAPACITY_ID "capacityId",
+                COUNT( CAPACITY_ID ) "countNumber"
+                FROM OMS_TRANS_ORDER
+                <where>
+                    <if test="driverId!=null and driverId!=''">
+                        AND (DRIVER_ID = #{driverId}  OR DRIVER_ID2 = #{driverId})
+                    </if>
+                    <if test="driverId2!=null and driverId2!=''">
+                        AND DRIVER_ID = #{driverId2}  OR DRIVER_ID2 = #{driverId2}
+                    </if>
+                </where>
+                GROUP BY CAPACITY_ID
+                ) T ON T."capacityId" = RCA .CAPACITY_ID
+            </if>
+            WHERE RCA .CAPACITY_ID in
+            <foreach collection="id" item="item" open="(" close=")" separator="," >
+                #{item}
+            </foreach>
+        </if>
+    )
+    <if test="(driverId!=null and driverId!='') or (driverId2!=null and driverId2!='')">
+        ORDER BY "countNumber" DESC
+    </if>
+    </select>
+
+    <select id="getCapacityByLikeSc" resultType="java.util.Map">
         select * from (
         select * from (
         SELECT DISTINCT
@@ -419,7 +561,13 @@
         RCA .CAPACITY_ID "value",
         RCA .CAPACITY_NUMBER "label",
         RCA .CAPACITY_NUMBER "text",
+        RCA .REMARK1 "remark1",
         RCA.CAPACITY_NUMBER "capacityNumber",
+        (case
+        when oto.capacity_id is null then '空闲'
+        when oto.deleted != '2' and oto.capacity_id is not null then '已派'
+        when oto.deleted = '2' and oto.capacity_id is not null then '空闲'
+        end) "status",
         'capacityNumber' "prop"
         <if test="(driverId!=null and driverId!='') or (driverId2!=null and driverId2!='')">
             ,NVL(T ."countNumber",0) "countNumber"
@@ -429,6 +577,8 @@
         LEFT JOIN RMS_CAPACITY_CARRIER RCC ON RCA .CAPACITY_ID = RCC .CAPACITY_ID
         LEFT JOIN RMS_COMPANY RC ON RC .COMPANY_ID = RCC .COMPANY_ID
         LEFT JOIN RMS_CAPACITY_TYPE RCT ON RCA.CAPACITY_TYPE_ID = RCT.CAPACITY_TYPE_ID
+        left join oms_trans_order oto
+        on RCA.capacity_id = oto.capacity_id
         <if test="(driverId!=null and driverId!='') or (driverId2!=null and driverId2!='')">
             LEFT JOIN (
                 SELECT CAPACITY_ID "capacityId",
@@ -456,7 +606,12 @@
                 AND RCT.CAPACITY_TYPE_NAME != '火车'
             </if>
             <if test="index!=null and index!=''">
-                AND REGEXP_LIKE(RCA .CAPACITY_NUMBER, #{index})
+                AND REGEXP_LIKE(
+                CASE WHEN RCA.REMARK1 is null
+                then RCA .CAPACITY_NUMBER
+                else RCA.REMARK1
+                end, #{index}
+                )
             </if>
             <if test="capacityId!=null and capacityId!=''">
                 AND RCA .CAPACITY_ID = #{capacityId}
@@ -472,9 +627,15 @@
             RCA .CAPACITY_ID "capacityId",
             RCA .CAPACITY_ID "id",
             RCA .CAPACITY_ID "value",
-            RCA .CAPACITY_NUMBER "label",
-            RCA .CAPACITY_NUMBER "text",
+            RCA .REMARK1 "label",
+            RCA .REMARK1 "text",
+            RCA .REMARK1 "remark1",
             RCA.CAPACITY_NUMBER "capacityNumber",
+            (case
+            when oto.capacity_id is null then '空闲'
+            when oto.deleted != '2' and oto.capacity_id is not null then '已派'
+            when oto.deleted = '2' and oto.capacity_id is not null then '空闲'
+            end) "status",
             'capacityNumber' "prop"
             <if test="(driverId!=null and driverId!='') or (driverId2!=null and driverId2!='')">
                 ,NVL(T ."countNumber",0) "countNumber"
@@ -483,6 +644,8 @@
             LEFT JOIN RMS_CAPACITY_CARRIER RCC ON RCA .CAPACITY_ID = RCC .CAPACITY_ID
             LEFT JOIN RMS_COMPANY RC ON RC .COMPANY_ID = RCC .COMPANY_ID
             LEFT JOIN RMS_CAPACITY_TYPE RCT ON RCA.CAPACITY_TYPE_ID = RCT.CAPACITY_TYPE_ID
+            left join oms_trans_order oto
+            on RCA.capacity_id = oto.capacity_id
             <if test="(driverId!=null and driverId!='') or (driverId2!=null and driverId2!='')">
                 LEFT JOIN (
                 SELECT CAPACITY_ID "capacityId",