浏览代码

Merge branch 'master' of https://git.steerinfo.com/DAL-DAZHOU2/DAL-DAZHOU-OTMS-API

liyg 3 年之前
父节点
当前提交
a3dcc8b684

+ 100 - 17
src/main/java/com/steerinfo/dil/controller/OffSiteTransportationController.java

@@ -96,12 +96,19 @@ public class OffSiteTransportationController extends BaseRESTfulController {
     }
     @ApiOperation("全路径查询")
     @PostMapping("/fullPath")
-    public Object fullPath(String orderNumber) throws Exception {
+    public RESTfulResult fullPath(String orderNumber) throws Exception {
         //运输订单号:orderNumber、车牌号:capacityNumber、出厂时间:resultOutGateTime、预警开关:turnOf、发货地址:shipperName、收货地址:receiveAddress
         //初始化请求参数
-        HashMap<String,Object> mapValue=new HashMap<>();
-        mapValue.put("orderNumber",orderNumber);
-        return routeService.fullPathVisualization(mapValue);
+        //判断是否自提
+        int count = offSiteTransportationService.isSelfMentionByOrderNumber(orderNumber);
+        if (count==0){
+            HashMap<String,Object> mapValue=new HashMap<>();
+            mapValue.put("orderNumber",orderNumber);
+            return success(routeService.fullPathVisualization(mapValue).get());
+        }else {
+            return failed("-1");
+        }
+
     }
 
     @ApiOperation("查询在途运输")
@@ -141,6 +148,8 @@ public class OffSiteTransportationController extends BaseRESTfulController {
             mapValue.put("startTime",startTime1);
             mapValue.put("endTime",endTime1);
         }
+        //执行中
+        mapValue.put("orderStatus",5);
         List<Map<String,Object>> filter= offSiteTransportationService.getInTransitTransportation(mapValue);
         PageHelper.startPage(pageNum, pageSize);
         List<Map<String,Object>> list= offSiteTransportationService.getInTransitTransportation(mapValue);
@@ -185,6 +194,26 @@ public class OffSiteTransportationController extends BaseRESTfulController {
             mapValue.put("startTime",startTime1);
             mapValue.put("endTime",endTime1);
         }
+        if (mapValue.containsKey("abnormalType")&&mapValue.get("abnormalType")!=null){
+            switch(mapValue.get("abnormalType").toString()){
+                case "其他":
+                    mapValue.put("abnormalType","0");
+                    break;
+                case "偏离":
+                    mapValue.put("abnormalType","1");
+                    break;
+                case "停车":
+                    mapValue.put("abnormalType","2");
+                    break;
+                case "离线":
+                    mapValue.put("abnormalType","3");
+                    break;
+                default:
+                    mapValue.remove("abnormalType");
+                    break;
+
+            }
+        }
         List<Map<String,Object>> filter= offSiteTransportationService.getHaveAbnormalTruckOrderInfo(mapValue);
         PageHelper.startPage(pageNum, pageSize);
         List<Map<String,Object>> list= offSiteTransportationService.getHaveAbnormalTruckOrderInfo(mapValue);
@@ -399,8 +428,7 @@ public class OffSiteTransportationController extends BaseRESTfulController {
 
     @PostMapping("/abnormalLineWarn")
     public String abnormalLineWarn(@RequestParam(value = "data") String data) throws Exception {
-        System.out.println("abnormalLineWarn");
-        System.out.println(data);
+
         ResultWarn resultWarn= (ResultWarn) DataConversionTool.jsonToBean(data, ResultWarn.class);
         Map<String, Object> map=  DataConversionTool.objectToMap(resultWarn);
         int i= offSiteTransportationService.addTransportationAlarm(map);
@@ -408,8 +436,7 @@ public class OffSiteTransportationController extends BaseRESTfulController {
     }
     @PostMapping("/parkWarn")
     public String parkWarn(@RequestParam(value = "data",required = false) String data) throws Exception {
-        System.out.println("parkWarn");
-        System.out.println(data);
+
         ResultWarn resultWarn= (ResultWarn) DataConversionTool.jsonToBean(data, ResultWarn.class);
         Map<String, Object> map=  DataConversionTool.objectToMap(resultWarn);
         int i=offSiteTransportationService.addTransportationAlarm(map);
@@ -418,8 +445,7 @@ public class OffSiteTransportationController extends BaseRESTfulController {
     }
     @PostMapping("/offLineWarn")
     public String offLineWarn(@RequestParam(value = "data") String data) throws Exception {
-        System.out.println("offLineWarn");
-        System.out.println(data);
+
         ResultWarn resultWarn= (ResultWarn) DataConversionTool.jsonToBean(data, ResultWarn.class);
         Map<String, Object> map=  DataConversionTool.objectToMap(resultWarn);
         int i=offSiteTransportationService.addTransportationAlarm(map);
@@ -446,11 +472,18 @@ public class OffSiteTransportationController extends BaseRESTfulController {
             @ApiImplicitParam(name = "mapValue", value = "查询条件", required = false, dataType = "HashMap")
     })
     @PostMapping("/fullPathVisualizationByCarNumber")
-    public RouteVo fullPathVisualizationByCarNumber(@RequestBody HashMap mapValue) throws Exception {
+    public RESTfulResult fullPathVisualizationByCarNumber(@RequestBody HashMap mapValue) throws Exception {
 
-        CompletableFuture<RouteVo> createOrder =routeService.fullPathVisualizationByCarNumber(mapValue);
+        //判断是否自提
+        int count = offSiteTransportationService.isSelfMention(mapValue.get("capacityNumber").toString());
+        if (count==0){
+            CompletableFuture<RouteVo> createOrder =routeService.fullPathVisualizationByCarNumber(mapValue);
+
+            return  success(createOrder.get());
+        }else {
+            return failed(-1);
+        }
 
-        return createOrder.get();
     }
 
     @ApiOperation(value="展示抵达实绩信息")
@@ -479,13 +512,63 @@ public class OffSiteTransportationController extends BaseRESTfulController {
     }
     @PostMapping("/createTotalResult")
     public RESTfulResult createTotalResult(@RequestBody(required=true) Map<String, Object> mapValue) throws Exception {
-        CompletableFuture<String> totalResult = routeService.createTotalResult(mapValue);
-        return success(totalResult);
+
+        //判断是否自提
+        int count = offSiteTransportationService.isSelfMention(mapValue.get("capacityNumber").toString());
+        if (count==0){
+            CompletableFuture<String> totalResult = routeService.createTotalResult(mapValue);
+            return success(totalResult);
+        }else {
+            return failed(-1);
+        }
     }
     @GetMapping("/getCurrentLocation")
     public RESTfulResult getCurrentLocation(@RequestParam("capcityNumber") String capcityNumber) throws Exception {
-        CurrentLocationResult currentLocationResult= routeService.getCurrentLocation(capcityNumber);
-        return success(currentLocationResult);
+        //判断是否自提
+        int count = offSiteTransportationService.isSelfMention(capcityNumber);
+        if (count==0){
+            CurrentLocationResult currentLocationResult= routeService.getCurrentLocation(capcityNumber);
+            return success(currentLocationResult);
+        }else {
+            return failed(-1);
+        }
+
 
     }
+    //在途订单列表
+    @PostMapping("/transportationPerformance")
+    public RESTfulResult transportationPerformance(@RequestBody Map<String,Object> mapValue,
+                                                   @RequestParam(required = true,defaultValue = "479",name = "apiId")Integer apiId,
+                                                   @RequestParam(required = false,name = "pageNum")Integer pageNum,
+                                                   @RequestParam(required = false,name = "pageSize")Integer pageSize){
+        if(mapValue.containsKey("startTime")&&mapValue.containsKey("endTime")){
+            Date  startDate=new Date(Long.parseLong(mapValue.get("startTime").toString())) ;
+            Date  endDate=new Date(Long.parseLong(mapValue.get("endTime").toString())) ;
+            Calendar ca = Calendar.getInstance();
+            ca.setTime(endDate);
+            ca.add(Calendar.DATE,1);
+            SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy-MM-dd");
+            String startTime1=simpleDateFormat.format(startDate);
+            String endTime1=simpleDateFormat.format(ca.getTime());
+            mapValue.replace("startTime",startTime1);
+            mapValue.replace("endTime",endTime1);
+        }else {
+            Date  startDate=new Date() ;
+            Date  endDate=new Date() ;
+            Calendar ca = Calendar.getInstance();
+            ca.setTime(endDate);
+            ca.add(Calendar.DATE,1);
+            SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy-MM-dd");
+            String startTime1=simpleDateFormat.format(startDate);
+            String endTime1=simpleDateFormat.format(ca.getTime());
+            mapValue.put("startTime",startTime1);
+            mapValue.put("endTime",endTime1);
+        }
+        //执行中
+        List<Map<String,Object>> filter= offSiteTransportationService.transportationPerformance(mapValue);
+        PageHelper.startPage(pageNum, pageSize);
+        List<Map<String,Object>> list= offSiteTransportationService.transportationPerformance(mapValue);
+        PageListAdd pageList = columnDataUtil.tableColumnData(apiId, filter,list);
+        return success(pageList);
+    }
 }

+ 6 - 0
src/main/java/com/steerinfo/dil/mapper/OffSiteTransportationMapper.java

@@ -38,4 +38,10 @@ public interface OffSiteTransportationMapper {
     List<Map<String, Object>> getHaveAbnormalTruckOrderInfo(Map<String, Object> mapValue);
 
     List<Map<String, Object>> getTransportAbnormalInfo(Map<String, Object> mapValue);
+
+    List<Map<String, Object>> transportationPerformance(Map<String, Object> mapValue);
+
+    int selectIsSelfMention(String capcityNumber);
+
+    int isSelfMentionByOrderNumber(String orderNumber);
 }

+ 5 - 0
src/main/java/com/steerinfo/dil/service/OffSiteTransportationService.java

@@ -32,4 +32,9 @@ public interface OffSiteTransportationService {
 
     List<Map<String, Object>> getTransportAbnormalInfo(Map<String, Object> mapValue);
 
+    List<Map<String, Object>> transportationPerformance(Map<String, Object> mapValue);
+
+    int isSelfMention(String capcityNumber);
+
+    int isSelfMentionByOrderNumber(String orderNumber);
 }

+ 15 - 0
src/main/java/com/steerinfo/dil/service/impl/OffSiteTransportationServiceImpl.java

@@ -153,6 +153,21 @@ public class OffSiteTransportationServiceImpl implements OffSiteTransportationSe
         return offSiteTransportationMapper.getTransportAbnormalInfo(mapValue);
     }
 
+    @Override
+    public List<Map<String, Object>> transportationPerformance(Map<String, Object> mapValue) {
+        return offSiteTransportationMapper.transportationPerformance(mapValue);
+    }
+
+    @Override
+    public int isSelfMention(String capcityNumber) {
+        return offSiteTransportationMapper.selectIsSelfMention(capcityNumber);
+    }
+
+    @Override
+    public int isSelfMentionByOrderNumber(String orderNumber) {
+        return offSiteTransportationMapper.isSelfMentionByOrderNumber(orderNumber);
+    }
+
 
     public synchronized int addTransportationAlarm(TmstruckAbnormalResult tmstruckAbnormalResult,String tripId) {
         long id;

+ 1 - 1
src/main/java/com/steerinfo/inPlantNavigation/service/impl/IPMMSVertexEdgeServiceImpl.java

@@ -263,7 +263,7 @@ public class IPMMSVertexEdgeServiceImpl implements IIPMMSVertexEdgeService {
 
         IPMMSVertexEdge ipmmsVertexList0Edge20=new IPMMSVertexEdge();
         ipmmsVertexList0Edge20.setVertexEdgeID(new BigDecimal(20));
-        ipmmsVertexList0Edge20.setWeigh(1);
+        ipmmsVertexList0Edge20.setWeigh(150);
         ipmmsVertexList0Edge20.setOutVertexID(new BigDecimal(13));
         ipmmsVertexList0Edge20.setInVertexID(new BigDecimal(0));
         arrayList13.add(ipmmsVertexList0Edge20);

+ 28 - 10
src/main/java/com/steerinfo/inPlantNavigation/service/impl/IPMMSVertexServiceImpl.java

@@ -19,11 +19,11 @@ public class IPMMSVertexServiceImpl implements IIPMMSVertexService {
     @Override
     public ArrayList<IPMMSVertex> getObtainTheOptimalPath(String startpoint,String endPoint,Map<String, List<IPMMSVertexEdge>> vertexEdgeList, Map<String, IPMMSVertex> vertexList) throws VertexAngEdgeException {
         //初始化数据
-        int[] startPoin=new int[]{0,-1};
+        int[] startPoin=new int[]{0,-1,0};
         //创建S战队(放入的是已经遍历过边的顶点)
         List<String> obtainTheOptimalPath=new ArrayList();
         //obtainTheOptimalPath.add(statpoint);
-        //创建 dist[]  (起点到集合点中的最短路径) key:指向的点 new int[]{0,-1}; {权重、中间点}
+        //创建 dist[]  (起点到集合点中的最短路径) key:指向的点 new int[]{0,-1}; {累计权重、中间点、自己权重}
         HashMap<String,int[]> currentBestDinstance=new HashMap<>();
         currentBestDinstance.put(startpoint,startPoin);
         while (obtainTheOptimalPath.size()!=vertexList.size()){
@@ -37,9 +37,6 @@ public class IPMMSVertexServiceImpl implements IIPMMSVertexService {
             if (island(currentBestDinstance,stringMinimumValue,vertexEdgeList)){
                 continue;
             }
-            if (stringMinimumValue.equals("0")||stringMinimumValue.equals("13")){
-                System.out.println();
-            }
 
             //借东风
             List<IPMMSVertexEdge> ipmmsVertexEdges = vertexEdgeList.get(stringMinimumValue);
@@ -67,17 +64,37 @@ public class IPMMSVertexServiceImpl implements IIPMMSVertexService {
                 if(historyBestPaht==null){
                     int distance=starBestPath[0]+ipmmsVertexEdge.getWeigh();
                     int outVertex=outVertexID.intValue();
-                    int[] bestPath=new int[]{distance,outVertex};
+                    int[] bestPath=new int[]{distance,outVertex,ipmmsVertexEdge.getWeigh()};
                     currentBestDinstance.put(inVertexID.toString(),bestPath);
                 }else if ((starBestPath[0]+ipmmsVertexEdge.getWeigh())<historyBestPaht[0]){
                     //更新和此顶点有关的数据
+                    int distance=starBestPath[0]+ipmmsVertexEdge.getWeigh();
+                    int outVertex=outVertexID.intValue();
+                    int[] bestPath=new int[]{distance,outVertex,ipmmsVertexEdge.getWeigh()};
+                    currentBestDinstance.put(inVertexID.toString(),bestPath);
+                    ArrayList<String> updateList = new ArrayList<>();
+                    updateRelactionVertex(updateList, stringMinimumValue, currentBestDinstance);
                 }
             }
         }
-
-
+        if (!currentBestDinstance.containsKey(endPoint)){
+            throw new VertexAngEdgeException("没有该条路径,请检查是否缺少边!");
+        }
         return startPointToEndPointPaht(endPoint,currentBestDinstance,vertexList);
     }
+    //更新相关的值
+    public void updateRelactionVertex(List<String> result,String currentVertex,HashMap<String,int[]> currentBestDinstance){
+        Set<String> keys = currentBestDinstance.keySet();
+        for (String  key:  keys){
+            int[] value=currentBestDinstance.get(key);
+            if (value[1]==Integer.valueOf(currentVertex).intValue()){
+                value[0]=value[2]+currentBestDinstance.get(currentVertex)[0];
+                currentBestDinstance.put(key,value);
+                updateRelactionVertex(result,key,currentBestDinstance);
+            }
+        }
+
+    }
     //判断是否有进入这个顶点的边,如果没有这个顶点就是一个孤岛
     public Boolean island(HashMap<String,int[]> currentBestDinstance,String stringMinimumValue,Map<String, List<IPMMSVertexEdge>> vertexEdgeList){
         if(!currentBestDinstance.containsKey(stringMinimumValue)){
@@ -92,10 +109,10 @@ public class IPMMSVertexServiceImpl implements IIPMMSVertexService {
         }
         return false;
     }
-    //通过所有最优解集合选择我们要的
+    //通过所有最优解集合选择我们要的路径
     public ArrayList<IPMMSVertex> startPointToEndPointPaht(String point,HashMap<String,int[]> currentBestDinstance,Map<String, IPMMSVertex> vertexList){
         ArrayList<IPMMSVertex> obtainOptimalPath=new ArrayList();
-        int beforeDistance=100;
+        int beforeDistance=0;
         do {
             int[] ints = currentBestDinstance.get(point);
             beforeDistance=ints[1];
@@ -106,6 +123,7 @@ public class IPMMSVertexServiceImpl implements IIPMMSVertexService {
         return obtainOptimalPath;
     }
 
+    //获得目前最短距离
     public String getStringMinimumValue(HashMap<String,int[]> currentBestDinstance,List<String> obtainTheOptimalPath){
 
         HashMap<String,int[]> bestDinstance = (HashMap<String, int[]>) SerializationUtils.clone(currentBestDinstance);

+ 0 - 1
src/main/java/com/steerinfo/route/service/impl/RouteServiceImpl.java

@@ -851,7 +851,6 @@ public class RouteServiceImpl implements RouteService {
     public CurrentLocationResult getCurrentLocation(String capcityNumber) throws Exception {
         String json = zhongJiaoXingLu.vLastLocationV3(capcityNumber);
         CurrentLocationResult currentLocationResult = (CurrentLocationResult) DataConversionTool.jsonToBean(json, CurrentLocationResult.class);
-
         if (currentLocationResult.equals(1006)) {
             return null;
         }

+ 1 - 1
src/main/java/com/steerinfo/route/threeRequest/ZhongJiaoXingLu.java

@@ -98,7 +98,7 @@ public class ZhongJiaoXingLu {
             map.put("token", token);
             map.put("cid", cid);
             map.put("srt", srt);
-            map.put("timeNearby", "0.1");
+            map.put("timeNearby", "10");
             map.put("vclN", capcityNumber);
             String url = "https://openapi.sinoiov.cn/save/apis/vLastLocationV3";
             DataExchangeService des = new DataExchangeService(5000, 8000);

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

@@ -18,8 +18,6 @@ spring:
       time-to-live: 300000
       cache-null-values: true
 piction:
-  # path: /usr/share/nginx/html/image
-  #  path: /test/data/nginx/html/image
   #path: C:\Users\24390\Desktop\work\a
   path: /shared
 #feign设置

+ 243 - 1
src/main/resources/com/steerinfo/dil/mapper/OffSiteTransportationMapper.xml

@@ -380,11 +380,18 @@
         on ASM1.MATERIAL_ID=RM.MATERIAL_ID
         left join(
         select max(RESULT_TOTAL_ID) coun,RESULT_TOTAL_ID RESULT_TOTAL_ID from  TMSTRUCK_ABNORMAL_RESULT
+        
+        <if test="abnormalType!=null">
+            where
+            ABNORMAL_TYPE=#{abnormalType}
+        </if>
         group by RESULT_TOTAL_ID
         ) TAR
         on TTR.RESULT_TOTAL_ID=TAR.RESULT_TOTAL_ID
         where TAR.coun is not null and OO.ORDER_TYPE in (1) and TLFR.RESULT_OUT_GATE_TIME IS NOT NULL
+        
         )
+        
         <where>
             <if test="orderStatus !=null">
                 and "orderStatus" ='${orderStatus}'
@@ -511,7 +518,11 @@
         select r_capacity.CAPACITY_NUMBER "capacityNumber",
         o_torder.ORDER_NUMBER "orderNumber",
         a_s_order.SALE_NUMBER "saleNumber",
-        t_abnormal.ABNORMAL_TYPE "abnormalType",
+        case t_abnormal.ABNORMAL_TYPE
+        when '1' then '偏离'
+        when '2' then '停车'
+        when '3' then '离线'
+        else '其他' end "abnormalType",
         t_abnormal.ABNORMAL_TIME "abnormalTime",
         t_abnormal.ABNORMAL_ADDRESS "abnormalAddress",
         t_abnormal.ABNORMAL_DURATION "abnormalDuration"
@@ -574,6 +585,237 @@
             <include refid="orderBy"></include>
         </where>
     </select>
+    <select id="transportationPerformance" resultType="java.util.Map">
+        select
+        *
+        from (
+        select  distinct
+        OO.ORDER_STATUS               "orderStatus",
+        OO.ORDER_NUMBER              "orderNumber", --运单订单号
+        RC.CAPACITY_NUMBER           "capacityNumber",--车牌号
+        TWR.RESULT_GROSS_WEIGHT_TIME "resultGrossWeightTime",--计毛时间
+        TWR.RESULT_NET_WEIGHT        "resultNetWeight",--净重
+    
+        RGOUT.GATEPOST_NAME          "outGatepostName",--出厂门禁
+        RCR.CARRIER_NAME             "carrierName" , --承运商名称
+        CONCAT( CONCAT( CONCAT(RRA.ADDRESS_PROVINCE,RRA.ADDRESS_DISTRICT),RRA.Address_Town),RRP.ADDRESS_DELIVERY_ADDRESS) "deliveryAddress",  --详细收货地址
+        RM.MATERIAL_NAME             "materialName" , --"物质名称"
+        RM.MATERIAL_SPECIFICATION    "materialSpecification", -- "物质规格"
+        RM.MATERIAL_MODEL            "materialModel", --"物质型号"
+        RCON.CONSIGNEE_COMPANY_NAME   "receiveName" ,--客户名称
+    
+        TAR.RESULT_ARRIVAL_ADDRESS "resultReceiveAddress",--签收收货点的地址
+    
+        TRR.ORDER_MILEAGE "orderMileage", --运输距离
+    
+        TAR.RESULT_ARRIVAL_ADDRESS "resultArrivalAddress",--抵达收货点的地址
+        TLFR.RESULT_OUT_GATE_TIME    "resultOutGateTime",--出厂时间
+        TAR.INSERT_TIME "arrivalTime",--抵达作业时间
+        TRR.INSERT_TIME "recepitTime",--签收作业时间
+    
+        to_char(to_timestamp(to_char(TRR.INSERT_TIME,'yyyy-MM-dd HH24:mi:ss'),'yyyy-mm-dd hh24:mi:ss')-to_timestamp(to_char(TAR.INSERT_TIME,'yyyy-MM-dd HH24:mi:ss'),'yyyy-mm-dd hh24:mi:ss')) "unloadingWaitingTime",
+    
+        to_char(to_timestamp(to_char(TAR.INSERT_TIME,'yyyy-MM-dd HH24:mi:ss'),'yyyy-mm-dd hh24:mi:ss')-to_timestamp(to_char(TLFR.RESULT_OUT_GATE_TIME,'yyyy-MM-dd HH24:mi:ss'),'yyyy-mm-dd hh24:mi:ss')) "transportationTime"
+
+    
+        from OMSTRUCK_ORDER OO --运输订单
+        left join AMS_SALE_ORDER_MATERIAL ASOM --销售订单物质表
+        on ASOM.SALE_ORDER_MATERIAL_ID = OO.ORDER_PLAN_ID
+        left join AMS_SALE_ORDER ASO --销售订单
+        on ASO.SALE_ORDER_ID = ASOM.SALE_ORDER_ID
+        left join RMS_CONSIGNEE RCON --收货客户
+        on RCON.CONSIGNEE_ID = ASO.RECEIVE_ID
+        left join TMSTRUCK_TOTAL_RESULT TTR --运输总实绩
+        on TTR.ORDER_ID = OO.ORDER_ID
+        left join TMSTRUCK_LOAD_RESULT TLR --汽车运输实绩表
+        on TLR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
+        left join RMS_WAREHOUSE RW --装卸货仓库
+        on RW.WAREHOUSE_ID = TLR.LOADING_ID
+    
+        left join TMSTRUCK_LEAVE_FACTORY_RESULT TLFR --离厂实绩
+        on TLFR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
+        left join RMS_GATEPOST RGOUT --门岗
+        on RGOUT.GATEPOST_ID = TLFR.GATEPOST_ID
+        left join RMS_CAPACITY RC --运力
+        on RC.CAPACITY_ID = OO.CAPACITY_ID
+    
+    
+        left join AMS_DISPATCH_SALE_ORDER  ADSO
+        on ASOM.SALE_ORDER_MATERIAL_ID=ADSO.SALE_ORDER_MATERIAL_ID
+        left join RMS_CARRIER RCR --承运单位
+        on ADSO.CARRIER_ID=RCR.CARRIER_ID
+    
+    
+        left join RMS_RECEIVE_PLACE RRP  --收货地址
+        on ASOM.SALE_SHIPPING_ADDRESS_ID=RRP.PLACE_ID
+        left join RMS_RECEIVE_ADDRESS RRA
+        on RRP.ADDRESS_ID=RRA.ADDRESS_ID
+    
+        left join AMS_SALE_TRUCKNO_MATERIAL ASTM
+        on ASOM.SALE_ORDER_MATERIAL_ID=ASTM.SALE_ORDER_MATERIAL_ID
+    
+        left join AMS_SALE_MATERIAL ASM1
+        on ASTM.MATERIAL_ID =ASM1.SALE_MATERIAL_ID
+    
+        left join TMSTRUCK_WEIGHT_RESULT TWR --运输实绩计重
+        on TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID  and  ASM1.MATERIAL_ID =TWR.MATERIAL_ID
+    
+        left join RMS_MATERIAL RM
+        on ASM1.MATERIAL_ID=RM.MATERIAL_ID
+    
+        left join TMSTRUCK_RECEIPT_RESULT TRR
+        on TRR.RESULT_TOTAL_ID=TTR.RESULT_TOTAL_ID
+    
+        left join TMSTRUCK_ARRIVAL_RESULT TAR
+        on TAR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
+        
+        where OO.ORDER_TYPE in (1) and TLFR.RESULT_OUT_GATE_TIME IS NOT NULL
+        )
+        <where>
+            <if test="orderStatus !=null">
+                and "orderStatus" ='${orderStatus}'
+            </if>
+            <if test="orderNumbers !=null and orderNumbers !=''">
+                and "orderNumber" like '%${orderNumbers}%'
+            </if>
+            <if test="capacityNumbers !=null and capacityNumbers !=''">
+                and "capacityNumber" like '%${capacityNumbers}%'
+            </if>
+            <if test="resultGrossWeightTimes !=null and resultGrossWeightTimes !=''">
+                and "resultGrossWeightTime" like '%${resultGrossWeightTimes}%'
+            </if>
+            <if test="resultGrossWeightTimes !=null and resultGrossWeightTimes !=''">
+                and "resultGrossWeightTime" like '%${resultGrossWeightTimes}%'
+            </if>
+            <if test="resultOutGateTimes !=null and resultOutGateTimes !=''">
+                and "resultOutGateTime" like '%${resultOutGateTimes}%'
+            </if>
+            <if test="resultNetWeights !=null and resultNetWeights !=''">
+                and "resultNetWeight" like '%${resultNetWeights}%'
+            </if>
+            <if test="resultOutGateTimes !=null and resultOutGateTimes !=''">
+                and "resultOutGateTime" like '%${resultOutGateTimes}%'
+            </if>
+            <if test="outGatepostNames !=null and outGatepostNames !=''">
+                and "outGatepostName" like '%${outGatepostNames}%'
+            </if>
+            <if test="carrierNames !=null and carrierNames !=''">
+                and "carrierName" like '%${carrierNames}%'
+            </if>
+            <if test="deliveryAddresss !=null and deliveryAddresss !=''">
+                and "deliveryAddress" like '%${deliveryAddresss}%'
+            </if>
+            <if test="materialNames !=null and materialNames !=''">
+                and "materialName" like '%${materialNames}%'
+            </if>
+            <if test="materialSpecifications !=null and materialSpecifications !=''">
+                and "materialSpecification" like '%${materialSpecifications}%'
+            </if>
+            <if test="materialModels !=null and materialModels !=''">
+                and "materialModel" like '%${materialModels}%'
+            </if>
+            <if test="receiveNames !=null and receiveNames!=''">
+                and "receiveName" like '%${receiveNames}%'
+            </if>
+            <if test="startTime != null">
+                and "resultOutGateTime" &gt;= to_date('${startTime}','yyyy-mm-dd')
+            </if>
+            <if test="endTime != null">
+                and "resultOutGateTime" &lt;= to_date('${endTime}','yyyy-mm-dd')
+            </if>
+            <if test="orderNumber !=null">
+                and  "orderNumber" in
+                <foreach collection="orderNumber" separator="," open="(" close=")" item="item" >
+                    #{item}
+                </foreach>
+            </if>
+            <if test="capacityNumber !=null">
+                and  "capacityNumber" in
+                <foreach collection="capacityNumber" separator="," open="(" close=")" item="item" >
+                    #{item}
+                </foreach>
+            </if>
+            <if test="resultGrossWeightTime !=null">
+                and  "resultGrossWeightTime" in
+                <foreach collection="resultGrossWeightTime" separator="," open="(" close=")" item="item" >
+                    #{item}
+                </foreach>
+            </if>
+            <if test="resultNetWeight !=null">
+                and  "resultNetWeight" in
+                <foreach collection="resultNetWeight" separator="," open="(" close=")" item="item" >
+                    #{item}
+                </foreach>
+            </if>
+            <if test="resultOutGateTime !=null">
+                and  "resultOutGateTime" in
+                <foreach collection="resultOutGateTime" separator="," open="(" close=")" item="item" >
+                    #{item}
+                </foreach>
+            </if>
+            <if test="outGatepostName !=null">
+                and  "outGatepostName" in
+                <foreach collection="outGatepostName" separator="," open="(" close=")" item="item" >
+                    #{item}
+                </foreach>
+            </if>
+            <if test="carrierName !=null">
+                and  "carrierName" in
+                <foreach collection="carrierName" separator="," open="(" close=")" item="item" >
+                    #{item}
+                </foreach>
+            </if>
+            <if test="deliveryAddress !=null">
+                and  "deliveryAddress" in
+                <foreach collection="deliveryAddress" separator="," open="(" close=")" item="item" >
+                    #{item}
+                </foreach>
+            </if>
+            <if test="materialSpecification !=null">
+                and  "materialSpecification" in
+                <foreach collection="materialSpecification" separator="," open="(" close=")" item="item" >
+                    #{item}
+                </foreach>
+            </if>
+            <if test="materialModel !=null">
+                and  "materialModel" in
+                <foreach collection="materialModel" separator="," open="(" close=")" item="item" >
+                    #{item}
+                </foreach>
+            </if>
+            <if test="receiveName !=null">
+                and  "receiveName" in
+                <foreach collection="receiveName" separator="," open="(" close=")" item="item" >
+                    #{item}
+                </foreach>
+            </if>
+            <if test="orderMileage !=null">
+                and  "orderMileage" in
+                <foreach collection="orderMileage" separator="," open="(" close=")" item="item" >
+                    #{item}
+                </foreach>
+            </if>
+        </where>
+        <include refid="orderBy"></include>
+    </select>
+    <select id="selectIsSelfMention" resultType="java.lang.Integer">
+        select count(*) from RMS_CAPACITY RC
+        left join OMSTRUCK_ORDER OO
+        on  RC.CAPACITY_ID=OO.CAPACITY_ID
+        left join AMS_SALE_ORDER_MATERIAL ASOM
+        on OO.ORDER_PLAN_ID = ASOM.SALE_ORDER_MATERIAL_ID
+        left join AMS_SALE_ORDER ASO
+        on ASOM.SALE_ORDER_ID = ASO.SALE_ORDER_ID
+        where OO.ORDER_TYPE in (1) and ASO.Sale_Order_Isself_Mention='是' and  RC.CAPACITY_NUMBER = #{capcityNumber}
+    </select>
+    <select id="isSelfMentionByOrderNumber" resultType="java.lang.Integer">
+        select count(*) from OMSTRUCK_ORDER OO
+        left join AMS_SALE_ORDER_MATERIAL ASOM
+        on OO.ORDER_PLAN_ID = ASOM.SALE_ORDER_MATERIAL_ID
+        left join AMS_SALE_ORDER ASO
+        on ASOM.SALE_ORDER_ID = ASO.SALE_ORDER_ID
+        where OO.ORDER_TYPE in (1) and ASO.Sale_Order_Isself_Mention='是' and  OO.ORDER_NUMBER =#{orderNumber}
+    </select>
     <sql id="orderBy">
         <if test="orderField != null and orderField != ''">
             order by  "${orderField}"

+ 14 - 14
src/main/resources/com/steerinfo/dil/mapper/TmstruckReceiptResultMapper.xml

@@ -860,46 +860,46 @@
     )
     <where>
       <if test="orderNumbers !=null">
-        and "orderNumber" like '${orderNumbers}'
+        and "orderNumber" like '%${orderNumbers}%'
       </if>
       <if test="capacityNumbers !=null">
-        and "capacityNumber" like '${capacityNumbers}'
+        and "capacityNumber" like '%${capacityNumbers}%'
       </if>
       <if test="resultGrossWeightTimes !=null">
-        and "resultGrossWeightTime" like '${resultGrossWeightTimes}'
+        and "resultGrossWeightTime" like '%${resultGrossWeightTimes}%'
       </if>
       <if test="resultGrossWeightTimes !=null">
-        and "resultGrossWeightTime" like '${resultGrossWeightTimes}'
+        and "resultGrossWeightTime" like '%${resultGrossWeightTimes}%'
       </if>
       <if test="resultOutGateTimes !=null">
-        and "resultOutGateTime" like '${resultOutGateTimes}'
+        and "resultOutGateTime" like '%${resultOutGateTimes}%'
       </if>
       <if test="resultNetWeights !=null">
-        and "resultNetWeight" like '${resultNetWeights}'
+        and "resultNetWeight" like '%${resultNetWeights}%'
       </if>
       <if test="resultOutGateTimes !=null">
-        and "resultOutGateTime" like '${resultOutGateTimes}'
+        and "resultOutGateTime" like '%${resultOutGateTimes}%'
       </if>
       <if test="outGatepostNames !=null">
-        and "outGatepostName" like '${outGatepostNames}'
+        and "outGatepostName" like '%${outGatepostNames}%'
       </if>
       <if test="carrierNames !=null">
-        and "carrierName" like '${carrierNames}'
+        and "carrierName" like '%${carrierNames}%'
       </if>
       <if test="deliveryAddresss !=null">
-        and "deliveryAddress" like '${deliveryAddresss}'
+        and "deliveryAddress" like '%${deliveryAddresss}%'
       </if>
       <if test="materialNames !=null">
-        and "materialName" like '${materialNames}'
+        and "materialName" like '%${materialNames}%'
       </if>
       <if test="materialSpecifications !=null">
-        and "materialSpecification" like '${materialSpecifications}'
+        and "materialSpecification" like '%${materialSpecifications}%'
       </if>
       <if test="materialModels !=null">
-        and "materialModel" like '${materialModels}'
+        and "materialModel" like '%${materialModels}%'
       </if>
       <if test="receiveNames !=null">
-        and "receiveName" like '${receiveNames}'
+        and "receiveName" like '%${receiveNames}%'
       </if>
       <if test="orderNumber !=null">
         and  "orderNumber" in