Bläddra i källkod

排队计量接口

txf 3 år sedan
förälder
incheckning
97613a153b

+ 9 - 4
pom.xml

@@ -94,7 +94,12 @@
             <artifactId>framework</artifactId>
             <version>1.0</version>
         </dependency>
-
+        <!--中交新路的包这个问杨-->
+        <dependency>
+            <groupId>com.ZhongJiaoXingLu</groupId>
+            <artifactId>openapi-sdk</artifactId>
+            <version>6.0</version>
+        </dependency>
 
     </dependencies>
     <build>
@@ -106,12 +111,12 @@
                 <version>3.0</version>
                 <configuration>
                     <connUrl>jdbc:oracle:thin:@172.16.33.163:1521:ilsdbpri</connUrl>
-                    <user>dil</user>
-                    <password>dil123789</password>
+                    <user>dagang</user>
+                    <password>root123</password>
                     <!--包名-->
                     <targetPackage>com.steerinfo.dil</targetPackage>
                     <tables>
-<!--                        <param>QMS_QUEUE_LIST</param>&lt;!&ndash;运力&ndash;&gt;-->
+                        <param>QMS_QUEUE_RESULT</param><!--运力-->
 <!--                        <param>TMSTRUCK_LOAD_RESULT</param>&lt;!&ndash;运力&ndash;&gt;-->
                     </tables>
                 </configuration>

+ 0 - 43
src/main/java/com/steerinfo/dil/config/WebSocketConfig.java

@@ -1,43 +0,0 @@
-package com.steerinfo.dil.config;
-
-import org.springframework.context.annotation.Configuration;
-import org.springframework.messaging.simp.config.ChannelRegistration;
-import org.springframework.messaging.simp.config.MessageBrokerRegistry;
-import org.springframework.web.socket.config.annotation.EnableWebSocketMessageBroker;
-import org.springframework.web.socket.config.annotation.StompEndpointRegistry;
-import org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurer;
-
-@Configuration
-@EnableWebSocketMessageBroker
-public class WebSocketConfig implements WebSocketMessageBrokerConfigurer {
-
-    @Override
-    public void registerStompEndpoints(StompEndpointRegistry stompEndpointRegistry) {
-        stompEndpointRegistry
-                .addEndpoint("/webSocket")
-                .setAllowedOrigins("*")
-                .withSockJS(); //使用sockJS
-
-    }
-
-    @Override
-    public void configureMessageBroker(MessageBrokerRegistry registry) {
-        //这里使用的是内存模式,生产环境可以使用rabbitmq或者其他mq。
-        //这里注册两个,主要是目的是将广播和队列分开。
-        //registry.enableStompBrokerRelay().setRelayHost().setRelayPort() 其他方式
-        registry.enableSimpleBroker("/topic");
-        //设置客户端前缀 即@MessageMapping
-        registry.setApplicationDestinationPrefixes("/app");
-        //点对点发送前缀
-        registry.setUserDestinationPrefix("/user");
-    }
-
-    /**
-     * 输入通道参数配置
-     *
-     * @param registration
-     */
-    @Override
-    public void configureClientInboundChannel(ChannelRegistration registration) {
-    }
-}

+ 13 - 10
src/main/java/com/steerinfo/dil/controller/QmsQueueGridController.java

@@ -1,24 +1,16 @@
 package com.steerinfo.dil.controller;
 
+import com.steerinfo.dil.service.impl.QueueInterfaceServiceImpl;
 import com.steerinfo.framework.controller.BaseRESTfulController;
 import com.steerinfo.framework.controller.RESTfulResult;
-import com.steerinfo.framework.service.pagehelper.PageList;
-import com.steerinfo.framework.utils.collection.ListUtils;
-import com.steerinfo.dil.model.QmsQueueGrid;
 import com.steerinfo.dil.service.IQmsQueueGridService;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.ArrayList;
-import java.math.BigDecimal;
+import java.util.*;
 
 /**
  * QmsQueueGrid RESTful接口:
@@ -40,6 +32,17 @@ public class QmsQueueGridController extends BaseRESTfulController {
     @Autowired
     IQmsQueueGridService qmsQueueGridService;
 
+    @Autowired
+    QueueInterfaceServiceImpl qmsQueueInterfaceService;
 
+    @ApiOperation(value="修改排队取消实绩:时间、原因")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "qmsQueueResult", value = "排队取消实体类", required = false, dataType = "QmsQueueResult"),
+    })
+    @PostMapping("/subsCapacity")
+    public RESTfulResult subsCapacity(@RequestBody Map<String, Object> map){
+        String subsCapacity = qmsQueueInterfaceService.subsCapacity(map);
+        return success(subsCapacity);
+    }
 
 }

+ 4 - 26
src/main/java/com/steerinfo/dil/controller/QmsQueueListController.java

@@ -108,35 +108,13 @@ public class QmsQueueListController extends BaseRESTfulController {
                                            Integer pageSize,
                                            String con
     ){
-        if(con != null){
-            if(!"undefined".equals(con)){
-                //设置要查询的索引名称
-                String index="get_list_monitor";
-                //获取查询结果
-                return success(esFeign.getConResult(mapValue,index,apiId,pageNum,pageSize,con));
-            }
-        }
-        List<Map<String, Object>> allListMonitor = null;
-        //如果有条件查询则跳过初始化,和创建索引
-        if(mapValue.size() == 0){
-            //将查询结果存入索引中
-            allListMonitor = qmsQueueListService.listMonitor(mapValue);
-            Map<String, Object> map = new HashMap<>();
-            //添加索引
-            map.put("index","get_list_monitor");
-            //添加id
-            map.put("indexId","listId");
-            allListMonitor.add(map);
-            //新建索引
-            esFeign.insertIndex(allListMonitor);
-            //删除
-            allListMonitor.remove(allListMonitor.size()-1);
+        if(con != null && !"".equals(con) && !"null".equals(con)){
+            mapValue.put("index", con);
         }
-        if(allListMonitor == null)
-            allListMonitor = qmsQueueListService.listMonitor(mapValue);
         PageHelper.startPage(pageNum,pageSize);
         //分页数据
-        List<Map<String, Object>> listMonitor = qmsQueueListService.listMonitor(mapValue);
+        List<Map<String, Object>> allListMonitor = qmsQueueListService.listMonitor(mapValue);
+        List<Map<String, Object>> listMonitor = new ArrayList<>(allListMonitor);
         PageListAdd pageList = columnDataUtil.tableColumnData(apiId, allListMonitor,listMonitor);
         return success(pageList);
     }

+ 52 - 253
src/main/java/com/steerinfo/dil/controller/QmsQueueResultController.java

@@ -13,8 +13,11 @@ import com.steerinfo.framework.service.pagehelper.PageHelper;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
+import org.apache.xmlbeans.impl.xb.xsdschema.All;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
+
+import java.text.SimpleDateFormat;
 import java.util.*;
 
 /**
@@ -43,14 +46,20 @@ public class QmsQueueResultController extends BaseRESTfulController {
     @Autowired
     ESFeign esFeign;
 
+    private final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+
     @ApiOperation(value="触发电子围栏-->新增排队实绩")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "mapValue", value = "", required = false, dataType = "Map"),
     })
     @PostMapping("/addQueueResult")
-    public RESTfulResult addQueueResult(@RequestBody(required = false) Map<String, Object> map){
+    public String addQueueResult(@RequestBody(required = false) Map<String, Object> map){
         int i = qmsQueueResultService.addQueueResult(map);
-        return success(i);
+        if(i > 0){
+            return "success";
+        }else {
+            return "field";
+        }
     }
 
     @ApiOperation(value="查询排队申请")
@@ -67,36 +76,13 @@ public class QmsQueueResultController extends BaseRESTfulController {
                                                Integer pageSize,
                                                String con
     ){
-
-        if(con != null){
-            if(!"undefined".equals(con)){
-                //设置要查询的索引名称
-                String index="get_queue_apply";
-                //获取查询结果
-                return success(esFeign.getConResult(mapValue,index,apiId,pageNum,pageSize,con));
-            }
-        }
-        List<Map<String, Object>> allQueueApply = null;
-        //如果有条件查询则跳过初始化,和创建索引
-        if(mapValue.size() == 0){
-            //将查询结果存入索引中
-            allQueueApply = qmsQueueResultService.getQueueApply(mapValue);
-            Map<String, Object> map = new HashMap<>();
-            //添加索引
-            map.put("index","get_queue_apply");
-            //添加id
-            map.put("indexId","queueId");
-            allQueueApply.add(map);
-            //新建索引
-            esFeign.insertIndex(allQueueApply);
-            //删除
-            allQueueApply.remove(allQueueApply.size()-1);
+        if(con != null && !"".equals(con) && !"null".equals(con)){
+            mapValue.put("index", con);
         }
-        if(allQueueApply == null)
-            allQueueApply = qmsQueueResultService.getQueueApply(mapValue);
         PageHelper.startPage(pageNum,pageSize);
+        List<Map<String, Object>> allQueueApply = qmsQueueResultService.getQueueApply(mapValue);
         //分页数据
-        List<Map<String, Object>> listMonitor = qmsQueueResultService.getQueueApply(mapValue);
+        List<Map<String, Object>> listMonitor = new ArrayList<>(allQueueApply);
         PageListAdd pageList = columnDataUtil.tableColumnData(apiId, allQueueApply,listMonitor);
         return success(pageList);
     }
@@ -173,36 +159,14 @@ public class QmsQueueResultController extends BaseRESTfulController {
                                        Integer queueType,
                                        String con
     ){
-        mapValue.put("queueType", queueType);
-        if(con != null){
-            if(!"undefined".equals(con)){
-                //设置要查询的索引名称
-                String index="get_order_receive";
-                //获取查询结果
-                return success(esFeign.getConResult(mapValue,index,apiId,pageNum,pageSize,con));
-            }
+        if(con != null && !"".equals(con) && !"null".equals(con)){
+            mapValue.put("index", con);
         }
-        List<Map<String, Object>> AllOrderReceive = null;
-        //如果有条件查询则跳过初始化,和创建索引
-        if(mapValue.size() == 1){
-            //将查询结果存入索引中
-            AllOrderReceive = qmsQueueResultService.orderReceive(mapValue);
-            Map<String, Object> map = new HashMap<>();
-            //添加索引
-            map.put("index","get_order_receive");
-            //添加id
-            map.put("indexId","receiveId");
-            AllOrderReceive.add(map);
-            //新建索引
-            esFeign.insertIndex(AllOrderReceive);
-            //删除
-            AllOrderReceive.remove(AllOrderReceive.size()-1);
-        }
-        if(AllOrderReceive == null)
-            AllOrderReceive = qmsQueueResultService.orderReceive(mapValue);
-        PageHelper.startPage(pageNum,pageSize);
+        mapValue.put("queueType", queueType);
         //分页数据
-        List<Map<String, Object>> executionOrder = qmsQueueResultService.orderReceive(mapValue);
+        PageHelper.startPage(pageNum,pageSize);
+        List<Map<String, Object>> AllOrderReceive = qmsQueueResultService.orderReceive(mapValue);
+        List<Map<String, Object>> executionOrder = new ArrayList<>(AllOrderReceive);
         PageListAdd pageList = columnDataUtil.tableColumnData(apiId, AllOrderReceive,executionOrder);
         return success(pageList);
 
@@ -225,42 +189,16 @@ public class QmsQueueResultController extends BaseRESTfulController {
                                        Integer gridId,
                                        String con
     ){
-        int count = 0;
         if(gridId != null){
             mapValue.put("gridId", gridId);
-            count++;
         }
-        if(con != null){
-            if(!"undefined".equals(con)){
-                //设置要查询的索引名称
-                String index="get_queue_list";
-                //获取查询结果
-                return success(esFeign.getConResult(mapValue,index,apiId,pageNum,pageSize,con));
-            }
-        }
-        List<Map<String, Object>> AllQueueList = null;
-        //如果有条件查询则跳过初始化,和创建索引
-        if(mapValue.size() == count){
-            //将查询结果存入索引中
-            AllQueueList = qmsQueueResultService.getQueueListByQueueUp(null);
-            Map<String, Object> map = new HashMap<>();
-            //添加索引
-            map.put("index","get_queue_list");
-            //添加id
-            map.put("indexId","queueListId");
-            AllQueueList.add(map);
-            //新建索引
-            String s = JSON.toJSONString(AllQueueList);;
-            //新建索引
-            esFeign.insertIndex(AllQueueList);
-            //删除
-            AllQueueList.remove(AllQueueList.size()-1);
+        if(con != null && !"".equals(con) && !"null".equals(con)){
+            mapValue.put("index", con);
         }
-        if(AllQueueList == null)
-            AllQueueList = qmsQueueResultService.getQueueListByQueueUp(mapValue);
         PageHelper.startPage(pageNum,pageSize);
         //分页数据
-        List<Map<String, Object>> queueListByQueueUp = qmsQueueResultService.getQueueListByQueueUp(mapValue);
+        List<Map<String, Object>> AllQueueList = qmsQueueResultService.getQueueListByQueueUp(mapValue);
+        List<Map<String, Object>> queueListByQueueUp = new ArrayList<>(AllQueueList);
         PageListAdd pageList = columnDataUtil.tableColumnData(apiId, AllQueueList,queueListByQueueUp);
         return success(pageList);
     }
@@ -279,40 +217,16 @@ public class QmsQueueResultController extends BaseRESTfulController {
                                                  Integer pageSize,
                                                  Integer gatepostId,
                                                  String con
-    ){   int count = 0;
+    ){
         if(gatepostId != null){
             mapValue.put("gatepostId", gatepostId);
-            count++;
         }
-
-        if(con != null){
-            if(!"undefined".equals(con)){
-                //设置要查询的索引名称
-                String index="get_queue_mes";
-                //获取查询结果
-                return success(esFeign.getConResult(mapValue,index,apiId,pageNum,pageSize,con));
-            }
+        if(con != null && !"".equals(con) && !"null".equals(con)){
+            mapValue.put("index", con);
         }
-        List<Map<String, Object>> AllQueueMes = null;
-        //如果有条件查询则跳过初始化,和创建索引
-        if(mapValue.size() == count){
-            //将查询结果存入索引中
-            AllQueueMes = qmsQueueResultService.getQueueMes(mapValue);
-            Map<String, Object> map = new HashMap<>();
-            //添加索引
-            map.put("index","get_queue_mes");
-            //添加id
-            map.put("indexId","queueMesId");
-            AllQueueMes.add(map);
-            //新建索引
-            esFeign.insertIndex(AllQueueMes);
-            //删除
-            AllQueueMes.remove(AllQueueMes.size()-1);
-        }
-        if(AllQueueMes == null)
-            AllQueueMes = qmsQueueResultService.getQueueMes(mapValue);
         PageHelper.startPage(pageNum,pageSize);
         //分页数据
+        List<Map<String, Object>> AllQueueMes = qmsQueueResultService.getQueueMes(mapValue);
         List<Map<String, Object>> queueMes = qmsQueueResultService.getQueueMes(mapValue);
         PageListAdd pageList = columnDataUtil.tableColumnData(apiId, AllQueueMes,queueMes);
         return success(pageList);
@@ -340,35 +254,13 @@ public class QmsQueueResultController extends BaseRESTfulController {
                                                String con
     ){
 
-        if(con != null){
-            if(!"undefined".equals(con)){
-                //设置要查询的索引名称
-                String index="get_change_queue";
-                //获取查询结果
-                return success(esFeign.getConResult(mapValue,index,apiId,pageNum,pageSize,con));
-            }
-        }
-        List<Map<String, Object>> AllChangeQueue = null;
-        //如果有条件查询则跳过初始化,和创建索引
-        if(mapValue.size() == 0){
-            //将查询结果存入索引中
-            AllChangeQueue = qmsQueueResultService.getChangeQueueMes(mapValue);
-            Map<String, Object> map = new HashMap<>();
-            //添加索引
-            map.put("index","get_change_queue");
-            //添加id
-            map.put("indexId","changeQueueId");
-            AllChangeQueue.add(map);
-            //新建索引
-            esFeign.insertIndex(AllChangeQueue);
-            //删除
-            AllChangeQueue.remove(AllChangeQueue.size()-1);
+        if(con != null && !"".equals(con) && !"null".equals(con)){
+            mapValue.put("index", con);
         }
-        if(AllChangeQueue == null)
-            AllChangeQueue = qmsQueueResultService.getChangeQueueMes(mapValue);
         PageHelper.startPage(pageNum,pageSize);
         //分页数据
-        List<Map<String, Object>> changeQueueMes1 = qmsQueueResultService.getChangeQueueMes(mapValue);
+        List<Map<String, Object>> AllChangeQueue = qmsQueueResultService.getChangeQueueMes(mapValue);
+        List<Map<String, Object>> changeQueueMes1 = new ArrayList<>(AllChangeQueue);
         PageListAdd pageList = columnDataUtil.tableColumnData(apiId, AllChangeQueue,changeQueueMes1);
         return success(pageList);
     }
@@ -387,41 +279,17 @@ public class QmsQueueResultController extends BaseRESTfulController {
                                                Integer pageSize,
                                                Integer gatepostId,
                                                String con
-    ){   int count=0;
-         if(gatepostId != null){
+    ){
+        if(gatepostId != null){
             mapValue.put("gatepostId", gatepostId);
-            count++;
         }
-
-        if(con != null){
-            if(!"undefined".equals(con)){
-                //设置要查询的索引名称
-                String index="get_queue_cancel";
-                //获取查询结果
-                return success(esFeign.getConResult(mapValue,index,apiId,pageNum,pageSize,con));
-            }
+        if(con != null && !"".equals(con) && !"null".equals(con)){
+            mapValue.put("index", con);
         }
-        List<Map<String, Object>> AllQueueCancel = null;
-        //如果有条件查询则跳过初始化,和创建索引
-        if(mapValue.size() == count){
-            //将查询结果存入索引中
-            AllQueueCancel = qmsQueueResultService.getQueueCancel(mapValue);
-            Map<String, Object> map = new HashMap<>();
-            //添加索引
-            map.put("index","get_queue_cancel");
-            //添加id
-            map.put("indexId","queueCancelId");
-            AllQueueCancel.add(map);
-            //新建索引
-            esFeign.insertIndex(AllQueueCancel);
-            //删除
-            AllQueueCancel.remove(AllQueueCancel.size()-1);
-        }
-        if(AllQueueCancel == null)
-            AllQueueCancel = qmsQueueResultService.getQueueCancel(mapValue);
         PageHelper.startPage(pageNum,pageSize);
         //分页数据
-        List<Map<String, Object>> queueCancel1 = qmsQueueResultService.getQueueCancel(mapValue);
+        List<Map<String, Object>> AllQueueCancel = qmsQueueResultService.getQueueCancel(mapValue);
+        List<Map<String, Object>> queueCancel1 = new ArrayList<>(AllQueueCancel);
         PageListAdd pageList = columnDataUtil.tableColumnData(apiId, AllQueueCancel,queueCancel1);
         return success(pageList);
     }
@@ -461,35 +329,13 @@ public class QmsQueueResultController extends BaseRESTfulController {
                                         String con
     ){
 
-        if(con != null){
-            if(!"undefined".equals(con)){
-                //设置要查询的索引名称
-                String index="get_queue_insert";
-                //获取查询结果
-                return success(esFeign.getConResult(mapValue,index,apiId,pageNum,pageSize,con));
-            }
-        }
-        List<Map<String, Object>> AllQueueInsert = null;
-        //如果有条件查询则跳过初始化,和创建索引
-        if(mapValue.size() == 0){
-            //将查询结果存入索引中
-            AllQueueInsert = qmsQueueResultService.getQueueInsert(mapValue);
-            Map<String, Object> map = new HashMap<>();
-            //添加索引
-            map.put("index","get_queue_insert");
-            //添加id
-            map.put("indexId","queueInsertId");
-            AllQueueInsert.add(map);
-            //新建索引
-            esFeign.insertIndex(AllQueueInsert);
-            //删除
-            AllQueueInsert.remove(AllQueueInsert.size()-1);
+        if(con != null && !"".equals(con) && !"null".equals(con)){
+            mapValue.put("index", con);
         }
-        if(AllQueueInsert == null)
-            AllQueueInsert = qmsQueueResultService.getQueueInsert(mapValue);
         PageHelper.startPage(pageNum,pageSize);
         //分页数据
-        List<Map<String, Object>> queueInsert = qmsQueueResultService.getQueueInsert(mapValue);
+        List<Map<String, Object>> AllQueueInsert = qmsQueueResultService.getQueueInsert(mapValue);
+        List<Map<String, Object>> queueInsert = new ArrayList<>(AllQueueInsert);
         PageListAdd pageList = columnDataUtil.tableColumnData(apiId, AllQueueInsert,queueInsert);
         return success(pageList);
 
@@ -509,36 +355,13 @@ public class QmsQueueResultController extends BaseRESTfulController {
                                               Integer pageSize,
                                               String con
     ){
-
-        if(con != null){
-            if(!"undefined".equals(con)){
-                //设置要查询的索引名称
-                String index="get_queue_endresult";
-                //获取查询结果
-                return success(esFeign.getConResult(mapValue,index,apiId,pageNum,pageSize,con));
-            }
+        if(con != null && !"".equals(con) && !"null".equals(con)){
+            mapValue.put("index", con);
         }
-        List<Map<String, Object>> AllQueueEndInsert = null;
-        //如果有条件查询则跳过初始化,和创建索引
-        if(mapValue.size() == 0){
-            //将查询结果存入索引中
-            AllQueueEndInsert = qmsQueueResultService.getQueueEndResult(mapValue);
-            Map<String, Object> map = new HashMap<>();
-            //添加索引
-            map.put("index","get_queue_endresult");
-            //添加id
-            map.put("indexId","queueEndResultId");
-            AllQueueEndInsert.add(map);
-            //新建索引
-            esFeign.insertIndex(AllQueueEndInsert);
-            //删除
-            AllQueueEndInsert.remove(AllQueueEndInsert.size()-1);
-        }
-        if(AllQueueEndInsert == null)
-            AllQueueEndInsert = qmsQueueResultService.getQueueEndResult(mapValue);
         PageHelper.startPage(pageNum,pageSize);
         //分页数据
-        List<Map<String, Object>> queueEndInsert = qmsQueueResultService.getQueueEndResult(mapValue);
+        List<Map<String, Object>> AllQueueEndInsert = qmsQueueResultService.getQueueEndResult(mapValue);
+        List<Map<String, Object>> queueEndInsert = new ArrayList<>(AllQueueEndInsert);
         PageListAdd pageList = columnDataUtil.tableColumnData(apiId, AllQueueEndInsert,queueEndInsert);
         return success(pageList);
     }
@@ -559,37 +382,13 @@ public class QmsQueueResultController extends BaseRESTfulController {
                                            String con
     ){
         mapValue.put("gridType", gridType);
-
-
-        if(con != null){
-            if(!"undefined".equals(con)){
-                //设置要查询的索引名称
-                String index="get_capacity_monitor";
-                //获取查询结果
-                return success(esFeign.getConResult(mapValue,index,apiId,pageNum,pageSize,con));
-            }
+        if(con != null && !"".equals(con) && !"null".equals(con)){
+            mapValue.put("index", con);
         }
-        List<Map<String, Object>> AllCapacityMonitor = null;
-        //如果有条件查询则跳过初始化,和创建索引
-        if(mapValue.size() == 1){
-            //将查询结果存入索引中
-            AllCapacityMonitor = qmsQueueResultService.capacityMonitor(mapValue);
-            Map<String, Object> map = new HashMap<>();
-            //添加索引
-            map.put("index","get_capacity_monitor");
-            //添加id
-            map.put("indexId","capacityMonitorId");
-            AllCapacityMonitor.add(map);
-            //新建索引
-            esFeign.insertIndex(AllCapacityMonitor);
-            //删除
-            AllCapacityMonitor.remove(AllCapacityMonitor.size()-1);
-        }
-        if(AllCapacityMonitor == null)
-            AllCapacityMonitor = qmsQueueResultService.capacityMonitor(mapValue);
-        PageHelper.startPage(pageNum,pageSize);
         //分页数据
-        List<Map<String, Object>> capacityMonitor = qmsQueueResultService.capacityMonitor(mapValue);
+        PageHelper.startPage(pageNum,pageSize);
+        List<Map<String, Object>> AllCapacityMonitor = qmsQueueResultService.capacityMonitor(mapValue);
+        List<Map<String, Object>> capacityMonitor = new ArrayList<>(AllCapacityMonitor);
         PageListAdd pageList = columnDataUtil.tableColumnData(apiId, AllCapacityMonitor,capacityMonitor);
         return success(pageList);
 

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

@@ -16,7 +16,7 @@ public interface QmsQueueResultMapper extends IBaseMapper<QmsQueueResult, BigDec
     BigDecimal selectMaxId();
 
     //车辆进入电子围栏后触发排队申请 发送数据:运输订单号 返回 运力Id、实绩总表Id、订单ID
-    List<Map<String, Object>>   queryCIdAndTIdByOrderNumber(String orderNumber);
+    Map<String, Object> queryCIdAndTIdByOrderNumber(String orderNumber);
 
     //通过运输订单Id查询推送给司机进厂的数据
     Map<String, Object> sendEnFactoryMesToWebSocket(Integer orderId);

+ 23 - 0
src/main/java/com/steerinfo/dil/mapper/QueueInterfaceMapper.java

@@ -0,0 +1,23 @@
+package com.steerinfo.dil.mapper;
+
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+import org.apache.ibatis.annotations.Update;
+
+/**
+ * @ author    :TXF
+ * @ time      :2022/1/12 20:26
+ */
+
+@Mapper
+public interface QueueInterfaceMapper {
+
+    //获取区域Id
+    @Select("select DV.VERSION_VALUE from DIL_VERSION DV where DV.VERSION_TYPE = 2")
+    String getAreaId();
+
+    //更新区域ID
+    @Update("update DIL_VERSION DV set DV.VERSION_VALUE = #{areaId} where DV.VERSION_TYPE = 2")
+    int updateAreaId(@Param("areaId") String areaId);
+}

+ 6 - 1
src/main/java/com/steerinfo/dil/mapper/QueuingRulesMapper.java

@@ -20,7 +20,7 @@ public interface QueuingRulesMapper {
     Map<String, Object> getStartTimeAndEndTime(Integer gatepostId);
 
     //通过门岗ID 和 网格类型 匹配 网格主键
-    BigDecimal getGridIdByGatepostIdAndGridType(Map<String, Object> map);
+        BigDecimal getGridIdByGatepostIdAndGridType(Map<String, Object> map);
 
     //查询订单跟订单物资中间表 查询是否有多个物资Id
     List<Integer> getAllMaterialId(Map<String, Object> map);
@@ -34,4 +34,9 @@ public interface QueuingRulesMapper {
     //通过月台Id 查询月台当前排队车辆数
     BigDecimal queueCountByPlatformId(BigDecimal platformId);
 
+    //通过订单ID查询门岗ID(可能会有多个门岗)
+    List<BigDecimal> queryGatepostIdByOrderId(BigDecimal orderId);
+
+    //通过车牌号查询已接收的订单
+    String getOrderNumberByCapacityNumber(String capacityNumber);
 }

+ 9 - 0
src/main/java/com/steerinfo/dil/service/IQueueInterfaceService.java

@@ -0,0 +1,9 @@
+package com.steerinfo.dil.service;
+
+/**
+ * @ author    :TXF
+ * @ time      :2022/1/11 15:27
+ */
+
+public interface IQueueInterfaceService {
+}

+ 1 - 4
src/main/java/com/steerinfo/dil/service/impl/QmsQueueListServiceImpl.java

@@ -47,7 +47,7 @@ public class QmsQueueListServiceImpl implements IQmsQueueListService {
 
     /**
      * 开始排队  添加 链表排序
-     * @param map 运输订单
+     * @param map 运输订单ID
      * @return
      */
     @Transactional
@@ -263,9 +263,6 @@ public class QmsQueueListServiceImpl implements IQmsQueueListService {
 
         qmsQueueResult.setResultEndTime(new Date());
         int i1 = qmsQueueResultMapper.updateByPrimaryKeySelective(qmsQueueResult);
-        // 排队结束添加进厂作业
-        tmsTruckFeign.enFactoryResultByPDA(map);
-
         return i + i1;
     }
 

+ 26 - 16
src/main/java/com/steerinfo/dil/service/impl/QmsQueueResultServiceImpl.java

@@ -3,6 +3,7 @@ package com.steerinfo.dil.service.impl;
 import com.steerinfo.dil.feign.IMFeign;
 import com.steerinfo.dil.feign.TmsTruckFeign;
 import com.steerinfo.dil.mapper.QmsQueueListMapper;
+import com.steerinfo.dil.mapper.QueuingRulesMapper;
 import com.steerinfo.dil.model.QmsQueueList;
 import com.steerinfo.dil.util.DataChange;
 import com.steerinfo.dil.model.QmsQueueResult;
@@ -40,12 +41,15 @@ public class QmsQueueResultServiceImpl implements IQmsQueueResultService {
     @Autowired
     private QueuingRulesServiceImpl queuingRulesService;
 
+    @Autowired
+    private QueuingRulesMapper queuingRulesMapper;
+
     @Autowired
     private IMFeign imFeign;
 
     /**
      * 新增进厂排队实绩
-     * @param map {orderNumber}运输订单号
+     * @param map vno 车牌号  plateColor 车牌颜色 areaId 区域Id  areaName 区域名称  type 进区域  utc 时间
      * @return
      */
     @Override
@@ -53,13 +57,17 @@ public class QmsQueueResultServiceImpl implements IQmsQueueResultService {
         QmsQueueResult qmsQueueResult = new QmsQueueResult();
         //生成主键
         qmsQueueResult.setId(qmsQueueResultMapper.selectMaxId());
-        //获取传入运输订单号
-        String orderNumber = (String) map.get("orderNumber");
-        //查询实绩总表ID 运力Id  物资Id (OO-->OOM 一对多)  只有钢材会有多条数据 但都属于钢材类型 取第一个获取物资ID匹配
-        map.putAll(qmsQueueResultMapper.queryCIdAndTIdByOrderNumber(orderNumber).get(0)); //使用传进来的map将数据一路带到尾
-        //获取网格Id
-        BigDecimal gridId = queuingRulesService.calculateGridId(DataChange.dataToBigDecimal(map.get("materialId")));
-        map.put("gridId", gridId);
+        //获取传入的车牌号查找最近的运输订单号
+        String capacityNumber = (String) map.get("vno");
+        String orderNumber = queuingRulesMapper.getOrderNumberByCapacityNumber(capacityNumber.substring(0, capacityNumber.length()-2));
+        //查询实绩总表ID 运力Id
+        map.putAll(qmsQueueResultMapper.queryCIdAndTIdByOrderNumber(orderNumber));
+        //查询门岗ID
+        List<BigDecimal> gatepostIdList = queuingRulesMapper.queryGatepostIdByOrderId(DataChange.dataToBigDecimal(map.get("orderId")));
+        Map<String, Object> queryMap = new HashMap<>();
+        queryMap.put("gridType", 3); //3为门岗类型
+        queryMap.put("queueLocationId", gatepostIdList.get(0));
+        BigDecimal gridId = queuingRulesMapper.getGridIdByGatepostIdAndGridType(queryMap);
         //新增进厂排队实绩 添加申请时间
         qmsQueueResult.setGridId(gridId);
         qmsQueueResult.setResultApplyforTime(new Date());
@@ -71,10 +79,7 @@ public class QmsQueueResultServiceImpl implements IQmsQueueResultService {
 
         qmsQueueResult.setInsertTime(new Date());
         qmsQueueResult.setInsertUsername("admin");
-        int i = qmsQueueResultMapper.insertSelective(qmsQueueResult);
-        //推送数据 给司机
-        pushCGMesToWebsocket(DataChange.dataToBigDecimal(map.get("orderId")).intValue(), gridId.intValue());
-        return i;
+        return qmsQueueResultMapper.insertSelective(qmsQueueResult);
     }
 
 
@@ -112,7 +117,7 @@ public class QmsQueueResultServiceImpl implements IQmsQueueResultService {
         BigDecimal gridId = queuingRulesService.getGridIdByGatepostIdAndGridType(map);
         qmsQueueResult.setGridId(gridId);
         //通过运输订单号查询实绩ID 等数据
-        map.putAll(qmsQueueResultMapper.queryCIdAndTIdByOrderNumber((String) map.get("orderNumber")).get(0));
+        map.putAll(qmsQueueResultMapper.queryCIdAndTIdByOrderNumber((String) map.get("orderNumber")));
         qmsQueueResult.setResultApplyforTime(new Date());
         //系统自动下发 添加下发时间
         qmsQueueResult.setResultDownTime(new Date());
@@ -287,13 +292,18 @@ public class QmsQueueResultServiceImpl implements IQmsQueueResultService {
         for (Map<String, Object> capacityMap : list) {
             //如果结束时间为空 排队总时长为
             if(capacityMap.get("resultEndTime") == null){
-                Date date1 = (Date) capacityMap.get("resultApplyforTime");
-                Date date2 = new Date();
+                Date date1 = (Date) capacityMap.get("resultStartTime");
+                Date date2;
+                if(capacityMap.get("resultCancelTime") != null){ //如果取消排队了则以取消排队时间为结束时间
+                    date2 = (Date) capacityMap.get("resultCancelTime");
+                }else {
+                    date2 = new Date();
+                }
                 String differenceTime = DataChange.calculatedTimeDifference(date1, date2);
                 capacityMap.put("resultQueueAllTime",differenceTime);
             }else {
                 //否则排队时长为结束时长 - 申请时长
-                Date date1 = (Date)capacityMap.get("resultApplyforTime");
+                Date date1 = (Date)capacityMap.get("resultStartTime");
                 Date date2 = (Date)capacityMap.get("resultEndTime");
                 String differenceTime = DataChange.calculatedTimeDifference(date1, date2);
                 capacityMap.put("resultQueueAllTime",differenceTime);

+ 187 - 0
src/main/java/com/steerinfo/dil/service/impl/QueueInterfaceServiceImpl.java

@@ -0,0 +1,187 @@
+package com.steerinfo.dil.service.impl;
+
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.openapi.sdk.service.DataExchangeService;
+import com.steerinfo.dil.mapper.QueueInterfaceMapper;
+import org.apache.ibatis.annotations.Mapper;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @ author    :TXF
+ * @ time      :2022/1/11 15:27
+ */
+
+@Service
+public class QueueInterfaceServiceImpl {
+
+    @Autowired
+    private QueueInterfaceMapper queueInterfaceMapper;
+
+    @Value("${str.ZhongJiaoXingLu.cid}")
+    private  String cid;
+    @Value("${str.ZhongJiaoXingLu.srt}")
+    private  String srt;
+    @Value("${str.ZhongJiaoXingLu.user}")
+    private  String user;
+    @Value("${str.ZhongJiaoXingLu.pwd}")
+    private  String pwd;
+
+    private  String token = "2d1d0e76-78ba-480e-8b48-15e3ae50eb94"; //令牌
+
+    private String userflag = "DaZhouGangTie";  //标识
+
+    private String lonlat = "107.45692443166813,31.19098781884856"; //中心点坐标
+
+    private String radius = "3000"; //半径
+    /**
+     * 车辆订阅接口
+     * @Author TXF
+     * @Date 2022/1/12 14:18
+     * @param map
+     * @return
+     **/
+    public String subsCapacity(Map<String, Object> map){
+        Map<String, String> mesMap = new HashMap<>();
+        mesMap.put("token", token);
+        mesMap.put("cid", cid);
+        mesMap.put("srt", srt);
+        mesMap.put("userflag", userflag);
+        mesMap.put("areaid", queueInterfaceMapper.getAreaId());
+        mesMap.put("vnos", (String) map.get("capacityNumber"));
+        String url = "https://openapi-test.sinoiov.cn/save/apis/vnoReg";
+        try {
+            DataExchangeService des = new DataExchangeService(5000, 8000);
+            // 通过 https 方式调用,此方法内部会使用私钥生成签名参数 sign,私钥不会发送
+            String res = des.postHttps(url, mesMap);
+            Map<String, Object> jsonMap = JSON.parseObject(res);
+            Object status = jsonMap.get("status");
+            if("1016".equals(status.toString())){
+                if(login() == 1){
+                    subsCapacity(map); //递归订阅
+                }else {
+                    return "订阅失败";
+                }
+            }
+            if("1001".equals(status.toString())){
+                if("2".equals(jsonMap.get("result").toString())){
+                    //如果是自定义区域不存在则重新注册自定义区域
+                    if(registerAreaReg() == 1){
+                        subsCapacity(map);
+                    }
+                }else {
+                    return "订阅成功";
+                }
+            }
+        } catch (Exception e) {
+            System.out.println("错误信息:" + e.getMessage());
+        }
+        return "订阅失败";
+    }
+
+    /**
+     * 自定义区域注册接口
+     * @Author TXF
+     * @Date 2022/1/12 14:36
+     * @param
+     * @return 1 成功  0 失败
+     **/
+    public int registerAreaReg(){
+        Map<String, String> mesMap = new HashMap<>(9);
+        mesMap.put("token", token);
+        mesMap.put("cid", cid);
+        mesMap.put("srt", srt);
+        mesMap.put("userflag", userflag);
+        mesMap.put("areaname", "达州钢铁老厂区");
+        mesMap.put("lonlat", lonlat);
+        mesMap.put("radius", radius);
+        mesMap.put("type", "1");
+        mesMap.put("actiontype", "1");
+        String url = "https://openapi-test.sinoiov.cn/save/apis/areaReg";
+        try {
+            DataExchangeService des = new DataExchangeService(5000, 8000);
+            // 通过 https 方式调用,此方法内部会使用私钥生成签名参数 sign,私钥不会发送
+            String res = des.postHttps(url, mesMap);
+            Map<String, Object> jsonMap = JSON.parseObject(res);
+            if("1001".equals(jsonMap.get("status").toString())){
+                // 更新注册区域ID
+                Map<String, Object> areaIdMap = (Map<String, Object>) jsonMap.get("result");
+                if("1".equals(areaIdMap.get("state").toString())){
+                    String areaid = String.valueOf(areaIdMap.get("areaid"));
+                    queueInterfaceMapper.updateAreaId(areaid);
+                    System.out.println("new areaid: " + areaid);
+                    return 1;
+                }else {
+                    return 0;
+                }
+            }
+        } catch (Exception e) {
+            System.out.println("错误信息:" + e.getMessage());
+        }
+        return 0;
+    }
+
+
+    /**
+     * 登录接口
+     * @Author TXF
+     * @Date 2022/1/12 15:23
+     * @param
+     * @return 1 成功 0 失败
+     **/
+    public int login() {
+        try {
+            Map<String, String> map = new HashMap<>(4);
+            map.put("user", user);
+            map.put("pwd", pwd);
+            map.put("cid", cid);
+            map.put("srt", srt);
+            String url = "https://openapi-test.sinoiov.cn/save/apis/login/";
+            DataExchangeService des = new DataExchangeService(5000, 8000);
+            // 通过 https 方式调用,此方法内部会使用私钥生成签名参数 sign,私钥不会发送
+            String res = des.postHttps(url, map);
+            JSONObject jsonObject = JSONObject.parseObject(res);
+            this.token = jsonObject.get("result").toString();
+            System.out.println("token: " + this.token);
+            return 0;
+        } catch (Exception e) {
+            System.out.println("e:" + e.getMessage());
+        }
+        return 1;
+    }
+
+    /**
+     * 删除车辆订阅接口
+     * @Author TXF
+     * @Date 2022/1/12 17:11
+     * @param map
+     * @return
+     **/
+    public void cancelSubsCapacity(Map<String, Object> map){
+        Map<String, String> mesMap = new HashMap<>(4);
+        mesMap.put("cid", cid);
+        mesMap.put("srt", srt);
+        mesMap.put("token", token);
+        mesMap.put("userflag", userflag);
+        mesMap.put("vons", (String) map.get("capacityNumber"));
+        mesMap.put("areaid", queueInterfaceMapper.getAreaId());
+        String url = "https://openapi-test.sinoiov.cn/save/apis/vnoDel";
+        try {
+            DataExchangeService des = new DataExchangeService(5000, 8000);
+            String res = des.postHttps(url, mesMap);
+            JSONObject jsonObject = JSONObject.parseObject(res);
+            if("1".equals(jsonObject.get("result"))){
+                System.out.println(map.get("capacityNumber") + "取消订阅成功");
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+    }
+}

+ 68 - 16
src/main/java/com/steerinfo/dil/util/DataChange.java

@@ -42,20 +42,20 @@ public class DataChange {
      */
     public static BigDecimal dataToBigDecimal(Object data){
         if (data != null){
-            if(data instanceof String){
-                String data1 = (String) data;
-                return new BigDecimal(data1);
-            }
-            if(data instanceof Integer){
-                Integer data2 = (Integer) data;
-                return new BigDecimal(data2);
-            }
-            if(data instanceof Double){
-                Double data3 = (Double) data;
-                return new BigDecimal(data3);
-            }
             if(data instanceof BigDecimal){
                 return (BigDecimal) data;
+            }else{
+                String str = String.valueOf(data);
+                BigDecimal decimal = null;
+                if(!"".equals(str)){
+                    try {
+                        decimal = new BigDecimal(str);
+                    } catch (Exception e) {
+                        System.out.println(data + ":数据解析失败!返回0");
+                        return new BigDecimal(0);
+                    }
+                }
+                return decimal;
             }
         }
         return new BigDecimal(0);
@@ -69,6 +69,8 @@ public class DataChange {
     public static String dateToDayDate(Object date){
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
         Date changeDate = null;
+        if(date == null)
+            return null;
         try{
              changeDate = (Date) date;
         }catch (Exception e){
@@ -108,10 +110,15 @@ public class DataChange {
         for (Map<String, Object> map : list) {
             for (String s : key) {
                 //修改数据为带两位小数
-                BigDecimal oldDate = (BigDecimal) map.get(s);
-                DecimalFormat df =  new DecimalFormat("0.00");
-                String resultDeduction = df.format(oldDate.doubleValue());
-                map.put(s, resultDeduction);
+                try {
+                    BigDecimal oldDate = (BigDecimal) map.get(s);
+                    DecimalFormat df =  new DecimalFormat("0.00");
+                    String resultDeduction = df.format(oldDate.doubleValue());
+                    map.put(s, resultDeduction);
+                } catch (Exception e) {
+                    System.out.println("原料扣减量数据有误");
+                }
+
             }
         }
     }
@@ -136,4 +143,49 @@ public class DataChange {
         long s = (between / 1000 - day * 24 * 60 * 60 - hour * 60 * 60 - min * 60);
         return day + "天"+  + hour+ "时" + min + "分"  + s + "秒";
     }
+
+    /**
+     * 生成带时间的八位数顺序号
+     * @param start 前缀
+     * @param id 顺序号  主键Id
+     * @return
+     */
+    public static String generateEightDigitsNumber(String start, Integer id){
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
+        StringBuilder sb = new StringBuilder(start + sdf.format(new Date()));
+        sb.append(
+                id < 10
+                        ? "0000000" + id : id < 100
+                        ? "000000" + id : id < 1000
+                        ? "00000" + id : id < 10000
+                        ? "0000" + id : id < 100000
+                        ? "000" + id : id < 1000000
+                        ? "00" + id : id < 10000000
+                        ? "0" + id : id.toString()
+        );
+        return sb.toString();
+    }
+
+    /**
+     * 根据时间段查询数据
+     * @Author TXF
+     * @Date 2022/1/10 23:21
+     * @param startTime
+     * @param endTime
+     * @param map
+     * @param sdf
+     * @return
+     **/
+    public static void queryDataByDate(String startTime, String endTime, Map<String, Object> map, SimpleDateFormat sdf){
+        if (startTime != null && !"null".equals(startTime) && endTime != null && !"null".equals(endTime)) {
+            map.put("startDate", sdf.format(new Date(Long.parseLong(startTime))));
+            map.put("endDate", sdf.format(new Date(Long.parseLong(endTime) + 86400000)));
+        } else if (startTime != null && !"null".equals(startTime)) {
+            map.put("oneDate", sdf.format(new Date(Long.parseLong(startTime))));
+        } else if (endTime != null && !"null".equals(endTime)) {
+            map.put("oneDate", sdf.format(new Date(Long.parseLong(endTime))));
+        } else {
+            map.put("oneDate", sdf.format(new Date()));
+        }
+    }
 }

+ 0 - 37
src/main/java/com/steerinfo/dil/websocket/WebSocketController.java

@@ -1,37 +0,0 @@
-package com.steerinfo.dil.websocket;
-
-import com.steerinfo.framework.controller.BaseRESTfulController;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.messaging.simp.SimpMessagingTemplate;
-import org.springframework.scheduling.annotation.Scheduled;
-import org.springframework.stereotype.Component;
-import java.util.List;
-import java.util.Map;
-
-@Component()
-public class WebSocketController extends BaseRESTfulController {
-
-    @Autowired
-    private SimpMessagingTemplate simpMessagingTemplate; //消息(发送)推送模板
-
-//    @Autowired
-//    private QueueService queueService;
-//
-//    //定时器推送
-//    @Scheduled(fixedDelay = 2000)
-//    public void sendMessage() {
-//        //排队申请指令推送
-//        List<Map<String ,Object>> queuePush = queueService.getQueueApplyPush();
-//        for (Map<String ,Object> push : queuePush) {
-////            System.out.println(("/topic/getResponse/location/" + push.get("CAPACITY_ID")).trim());
-//            simpMessagingTemplate.convertAndSend(("/topic/getResponse/location/" + push.get("CAPACITY_ID")).trim(),
-//                    push.get("RAW_MATERIAL_NAME"));
-//        }
-//        //排队开始指令推送
-//        List<Map<String, Object>> queueStartPush = queueService.getQueueStartPush();
-//        for (Map<String ,Object> push : queueStartPush) {
-////            System.out.println(("/topic/getResponse/location" + push).trim());
-//            simpMessagingTemplate.convertAndSend(("/topic/getResponse/queue/" + push.get("CAPACITY_ID")).trim(), push);
-//        }
-//    }
-}

+ 14 - 0
src/main/resources/application-dev.yml

@@ -6,3 +6,17 @@ spring:
       driver-class-name: oracle.jdbc.OracleDriver
   application:
     name: dil-trick-queue-dev
+
+#feign设置
+openfeign:
+  ESFeign:
+    url: ${ESFEIGN_URL:172.16.33.166:8089}
+  ColumnDataFeign:
+    url: ${COLUMNDATAFEIGN_URL:172.16.33.166:8083}
+  TmsTruckFeign:
+    url: ${TMSTRUCKFEIGN_URL:172.16.33.162:8008}
+  Im:
+    url: ${IMFEIGN_URL:172.16.33.166:8055}
+
+server:
+  port: 8017

+ 16 - 2
src/main/resources/application-prod.yml

@@ -1,8 +1,22 @@
 spring:
   datasource:
       url: jdbc:oracle:thin:@172.16.33.163:1521:ilsdbpri
-      password: root123
-      username: dagang
+      password: Dil123789
+      username: dil
       driver-class-name: oracle.jdbc.OracleDriver
   application:
     name: dil-trick-queue-prod
+
+#feign设置
+openfeign:
+  ESFeign:
+    url: ${ESFEIGN_URL:172.16.33.166:8089}
+  ColumnDataFeign:
+    url: ${COLUMNDATAFEIGN_URL:172.16.33.166:8083}
+  TmsTruckFeign:
+    url: ${TMSTRUCKFEIGN_URL:172.16.33.166:8088}
+  Im:
+    url: ${IMFEIGN_URL:172.16.33.166:8055}
+
+server:
+  port: 8047

+ 8 - 15
src/main/resources/bootstrap.yml

@@ -46,19 +46,6 @@ eureka:
     status-page-url: http://${spring.cloud.client.ip-address}:${server.port}/swagger-ui.html#/
     instance-id: ${spring.cloud.client.ip-address}:${server.port}
 
-
-#feign设置
-openfeign:
-  ESFeign:
-    url: ${ESFEIGN_URL:172.16.33.162:8011}
-  ColumnDataFeign:
-    url: ${COLUMNDATAFEIGN_URL:172.16.33.162:8001}
-  TmsTruckFeign:
-    url: ${TMSTRUCKFEIGN_URL:172.16.33.162:8008}
-  Im:
-    url: ${IMFEIGN_URL:172.16.33.162:8018}
-
-
 mybatis:
   type-aliases-package: com.steerinfo.dil.model
   mapper-locations: classpath:com/steerinfo/dil/mapper/*.xml
@@ -67,5 +54,11 @@ mybatis:
     mapUnderscoreToCamelCase: true
     call-setters-on-nulls: true
 
-server:
-  port: 8017
+str:
+  tengxun:
+    key: WDTBZ-A5VKJ-UDLFI-KYJY6-WTP2S-A6B4Y
+  ZhongJiaoXingLu:
+    cid: 72c918a9-49d7-434e-ae24-e3b36a589800
+    srt: b6549e66-e3a2-44f2-a1a3-d1f77d6c96f2
+    user: f760f293-4234-4495-90c0-fa1bf5f29bf6
+    pwd: 5T91u0h5SVg132G41440MD1jj2B77I

+ 9 - 4
src/main/resources/com/steerinfo/dil/mapper/QmsQueueListMapper.xml

@@ -360,7 +360,7 @@
 <!--  通过运输订单号 或实绩Id 关联 实绩总表 查询 排队实绩 -->
   <select id="getQueueResultByOrderNumber" parameterType="java.util.Map" resultType="java.util.Map">
     select
-           RDC.CAPACITY_ID "capacityId",
+           OO.CAPACITY_ID "capacityId",
            QQR.GRID_ID "gridId",
            QQR.RESULT_ID "resultId",
            QQR.LIST_ID "listId"
@@ -369,9 +369,10 @@
                      on OO.ORDER_ID = TTR.ORDER_ID
            left join QMS_QUEUE_RESULT QQR
                      on QQR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
-           left join RMS_DRIVER_CAPACITY RDC
-                     on RDC.DRIVER_CAPACITY_ID = OO.DRIVER_CAPACITY_ID
     <where>
+      <if test="orderId != null">
+        OO.ORDER_ID = #{orderId}
+      </if>
       <if test="orderNumber != null">
         OO.ORDER_NUMBER = #{orderNumber}
       </if>
@@ -414,9 +415,13 @@
         LEFT JOIN QMS_QUEUE_LIST QQL
             on QQL.GRID_ID = QQG.GRID_ID and QQL.DELETED = 0
         group by RG.GATEPOST_ID
-        )
+        ) t
     <where>
+      <if test="index != null">
+        instr(t."gatepostName", #{index}) > 0
+      </if>
       <if test="gatepostName != null">
+        and
         <foreach collection="gatepostName" item="item" open="(" separator="or" close=")">
           "gatepostName" like '%${item}%'
         </foreach>

+ 16 - 21
src/main/resources/com/steerinfo/dil/mapper/QmsQueueResultMapper.xml

@@ -679,17 +679,12 @@
     <!-- 车辆进入电子围栏后触发排队申请 -->
     <select id="queryCIdAndTIdByOrderNumber" parameterType="string" resultType="java.util.Map">
         select OO.ORDER_ID         "orderId",
-               RDC.CAPACITY_ID      "capacityId",
-               OOM.MATERIAL_ID     "materialId",
+               OO.CAPACITY_ID      "capacityId",
                TTR.RESULT_TOTAL_ID "resultTotalId",
                OO.ORDER_TYPE       "orderType"
         from OMSTRUCK_ORDER OO
                  left join TMSTRUCK_TOTAL_RESULT TTR
                            on TTR.ORDER_ID = OO.ORDER_ID
-                 left join OMSTRUCK_ORDER_MATERIAL OOM
-                           on OOM.ORDER_ID = OO.ORDER_ID
-                 left join RMS_DRIVER_CAPACITY RDC
-                            on OO.DRIVER_CAPACITY_ID = RDC.DRIVER_CAPACITY_ID
         where OO.ORDER_NUMBER = #{orderNumber}
     </select>
 
@@ -917,10 +912,8 @@
         QQR.RESULT_START_TIME "resultStartTime"
 
         from OMSTRUCK_ORDER OO
-        left join RMS_DRIVER_CAPACITY RDC
-        on RDC.DRIVER_CAPACITY_ID = OO.DRIVER_CAPACITY_ID
         left join RMS_CAPACITY RC
-        on RC.CAPACITY_ID = RDC.CAPACITY_ID
+        on RC.CAPACITY_ID = OO.CAPACITY_ID
         left join TMSTRUCK_TOTAL_RESULT TTR
         on TTR.ORDER_ID = OO.ORDER_ID
         left join QMS_QUEUE_RESULT QQR
@@ -1001,7 +994,10 @@
         on QQG.GRID_ID = QQR.GRID_ID
         left join RMS_GATEPOST RG
         on RG.GATEPOST_ID = QQG.QUEUE_LOCATION_ID
-        where QQR.RESULT_ACCEPT_TIME is null
+        where 1 = 1
+            <if test="index != null">
+                and instr(RC.CAPACITY_NUMBER, #{index}) > 0
+            </if>
         )
         <where>
             <if test="capacityNumber != null">
@@ -1066,7 +1062,10 @@
         on QQG.GRID_ID = QQR.GRID_ID
         left join RMS_GATEPOST RG
         on RG.GATEPOST_ID = QQG.QUEUE_LOCATION_ID
-        where QQR.RESULT_END_TIME is null and QQG.GRID_TYPE = 3
+        where QQG.GRID_TYPE = 3
+            <if test="index != null">
+                and instr(RC.CAPACITY_NUMBER, #{index}) > 0
+            </if>
         )
         <where>
             <if test="capacityNumber != null">
@@ -1455,6 +1454,9 @@
             <if test="gridType != null">
                 QQG.GRID_TYPE = #{gridType}
             </if>
+            <if test="index != null">
+                and instr(RC.CAPACITY_NUMBER, #{index}) > 0
+            </if>
         </where>
         )
         <where>
@@ -2203,15 +2205,10 @@
         select
                OO.ORDER_ID      "orderId",
                OO.ORDER_NUMBER "orderNumber",
-               RCD.DRIVER_NAME "driverName",
                RC.CAPACITY_NUMBER "capacityNumber"
         from OMSTRUCK_ORDER OO
-        left join RMS_DRIVER_CAPACITY RDC
-        ON RDC.DRIVER_CAPACITY_ID = OO.DRIVER_CAPACITY_ID
         LEFT JOIN RMS_CAPACITY RC
-        ON RC.CAPACITY_ID = RDC.CAPACITY_ID
-        LEFT JOIN RMS_CAR_DRIVER RCD
-        ON RCD.DRIVER_ID = RDC.DRIVER_ID
+            ON RC.CAPACITY_ID = OO.CAPACITY_ID
         WHERE ORDER_ID = #{orderId}
     </select>
 
@@ -2232,12 +2229,10 @@
             RCD.DRIVER_NAME "driverName",
             RC.CAPACITY_NUMBER "capacityNumber"
         from OMSTRUCK_ORDER OO
-                 left join RMS_DRIVER_CAPACITY RDC
-                           ON RDC.DRIVER_CAPACITY_ID = OO.DRIVER_CAPACITY_ID
                  LEFT JOIN RMS_CAPACITY RC
-                           ON RC.CAPACITY_ID = RDC.CAPACITY_ID
+                           ON RC.CAPACITY_ID = OO.CAPACITY_ID
                  LEFT JOIN RMS_CAR_DRIVER RCD
-                           ON RCD.DRIVER_ID = RDC.DRIVER_ID
+                           ON RCD.DRIVER_ID = OO.DRIVER_ID
         WHERE ORDER_ID = #{orderId}
     </select>
 

+ 22 - 1
src/main/resources/com/steerinfo/dil/mapper/QueuingRulesMapper.xml

@@ -36,7 +36,7 @@
     </select>
 
 
-    <!-- 查询门岗 -->
+    <!-- 查询门岗或仓库 -->
     <select id="getGridIdByGatepostIdAndGridType" parameterType="java.util.Map" resultType="java.math.BigDecimal">
         select QQG.GRID_ID
         from QMS_QUEUE_GRID QQG
@@ -102,5 +102,26 @@
           and DELETED = 0
     </select>
 
+<!--  通过订单ID查询门岗ID(可能会有多个门岗)  -->
+    <select id="queryGatepostIdByOrderId" parameterType="java.math.BigDecimal" resultType="java.math.BigDecimal">
+        select RLGC.GATE_CAL_ID
+        from RMS_LINE_GATEPOST_CALCULATE RLGC
+        where RLGC.SEGMENT_ID = (select RLS.SEGMENT_ID
+                                 from OMSTRUCK_ORDER OO
+                                          left join RMS_LINE_SEGEMNT RLS
+                                                    on OO.LINE_ID = RLS.LINE_ID
+                                 where RLS.SEGMENT_SQE = 1
+                                   and OO.ORDER_ID = #{orderId})
+    </select>
+
+<!--   通过车牌号查询已接收的订单 -->
+    <select id="getOrderNumberByCapacityNumber" parameterType="string" resultType="java.lang.String">
+        select OO.ORDER_NUMBER
+        from OMSTRUCK_ORDER OO
+        left join RMS_CAPACITY RC
+            on RC.CAPACITY_ID = OO.CAPACITY_ID
+        where RC.CAPACITY_NUMBER = #{capacityNumber} and OO.ORDER_STATUS = 5
+    </select>
+
 
 </mapper>