Browse Source

Merge branch 'master' of https://git.steerinfo.com/DAL-DAZHOU1/DAL-TMS-TRUCK-API

luobang 3 năm trước cách đây
mục cha
commit
1dfb2a33b4

+ 13 - 0
src/main/java/com/steerinfo/dil/controller/OffSiteTransportationController.java

@@ -15,6 +15,7 @@ import com.steerinfo.route.threeRequest.ZhongJiaoXingLu;
 import com.steerinfo.route.util.DataConversionTool;
 import com.steerinfo.route.util.HTTPRequestUtils;
 import com.steerinfo.route.vo.FullPathVisualizationTo.ViewVisualization;
+import com.steerinfo.route.vo.Map.RouteVo;
 import com.steerinfo.route.vo.ResultWarn;
 import com.steerinfo.route.vo.resultJson.SearchPoint;
 import io.swagger.annotations.Api;
@@ -430,4 +431,16 @@ public class OffSiteTransportationController extends BaseRESTfulController {
         PageListAdd pageList = columnDataUtil.tableColumnData(apiId,transportAbnormalInfo,transportAbnormalInfo1);
         return success(pageList);
     }
+    @ApiOperation(value="查询路径")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "mapValue", value = "查询条件", required = false, dataType = "HashMap")
+    })
+    @PostMapping("/fullPathVisualizationByCarNumber")
+    public RouteVo fullPathVisualizationByCarNumber(@RequestBody HashMap mapValue) throws Exception {
+
+        CompletableFuture<RouteVo> createOrder =routeService.fullPathVisualizationByCarNumber(mapValue);
+
+        return createOrder.get();
+    }
+
 }

+ 5 - 2
src/main/java/com/steerinfo/dil/controller/StatisticalReportController.java

@@ -80,14 +80,17 @@ public class StatisticalReportController extends BaseRESTfulController {
                                        Integer pageSize,
                                        String startTime,
                                        String endTime,
-                                       String carrierSsoId
+                                       String carrierSsoId,
+                                          Integer orderType,
+                                          Integer shipperId
     ){
         if(carrierSsoId != null){
             if(!"null".equals(carrierSsoId)){
                 mapValue.put("carrierSsoId", carrierSsoId);
             }
         }
-
+        mapValue.put("orderType",orderType);
+        mapValue.put("shipperId",shipperId);
         DataChange.queryDataByDateTime(startTime, endTime, mapValue, sdfDateTime);//根据时间段查询数据
         List<Map<String, Object>> allReport =  statisticalReportService.getAllSaleReportNum(mapValue);
         PageHelper.startPage(pageNum, pageSize);

+ 10 - 0
src/main/java/com/steerinfo/dil/controller/TestController.java

@@ -4,6 +4,7 @@ import com.steerinfo.dil.service.ITmstruckLeaveFactoryResultService;
 import com.steerinfo.dil.service.impl.TmstruckMeasureCommissionServiceImpl;
 import com.steerinfo.dil.util.BaseRESTfulController;
 import com.steerinfo.route.service.impl.RouteServiceImpl;
+import com.steerinfo.route.vo.Map.RouteVo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -13,6 +14,7 @@ import org.springframework.web.bind.annotation.RestController;
 
 import java.util.HashMap;
 import java.util.Map;
+import java.util.concurrent.CompletableFuture;
 
 @RestController
 public class TestController extends BaseRESTfulController {
@@ -57,4 +59,12 @@ public class TestController extends BaseRESTfulController {
         return tmstruckMeasureCommissionService.addMaoMeasureCommission(map);
     }
 
+    @PostMapping("/fullPathVisualizationByCarNumber")
+    public RouteVo fullPathVisualizationByCarNumber(@RequestBody HashMap mapValue) throws Exception {
+
+        CompletableFuture<RouteVo> createOrder =routeService.fullPathVisualizationByCarNumber(mapValue);
+
+        return createOrder.get();
+    }
+
 }

+ 11 - 0
src/main/java/com/steerinfo/dil/controller/TmstruckReceiptResultController.java

@@ -233,5 +233,16 @@ public class TmstruckReceiptResultController extends BaseRESTfulController {
 
         return success(mapList.get(0));
     }
+    @ApiOperation(value = "获取收货作业照片")
+    @PostMapping("/getReceivingPhotoByUrl")
+    public Map<String,Object> getReceivingPhotoByUrl(@RequestParam String orderNumber) throws Exception {
+        List<Map<String,Object>> mapList = tmstruckReceiptResultService.getReceivingPhoto(orderNumber);
+        Map<String,Object> mapvalue = null;
+        if (mapList!=null){
+            mapvalue=mapList.get(0);
+        }
+        
+        return mapvalue;
+    }
 
 }

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

@@ -1,10 +1,12 @@
 package com.steerinfo.dil.service;
 
 import com.steerinfo.framework.controller.RESTfulResult;
+import com.steerinfo.route.vo.Map.RouteVo;
 
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.concurrent.CompletableFuture;
 
 public interface OffSiteTransportationService {
     List<Map<String, Object>> getInTransitTransportation(Map<String, Object> mapValue);
@@ -29,4 +31,5 @@ public interface OffSiteTransportationService {
     List<Map<String, Object>> getHaveAbnormalTruckOrderInfo(Map<String, Object> mapValue);
 
     List<Map<String, Object>> getTransportAbnormalInfo(Map<String, Object> mapValue);
+
 }

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

@@ -13,6 +13,7 @@ import com.steerinfo.route.mapper.TmstruckArrivalResultMapper;
 import com.steerinfo.route.model.TmstruckReceiptResultChild;
 import com.steerinfo.route.service.ITmstruckReceiptResultChildService;
 import com.steerinfo.route.service.impl.RouteServiceImpl;
+import com.steerinfo.route.vo.Map.RouteVo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -23,6 +24,8 @@ import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.concurrent.CompletableFuture;
+
 @Service
 public class OffSiteTransportationServiceImpl implements OffSiteTransportationService {
     @Autowired
@@ -153,6 +156,7 @@ public class OffSiteTransportationServiceImpl implements OffSiteTransportationSe
         return offSiteTransportationMapper.getTransportAbnormalInfo(mapValue);
     }
 
+
     public synchronized int addTransportationAlarm(TmstruckAbnormalResult tmstruckAbnormalResult,String tripId) {
         long id;
         if(tmstruckAbnormalResultMapper.selectMaxId()==null){

+ 2 - 0
src/main/java/com/steerinfo/route/service/RouteService.java

@@ -13,4 +13,6 @@ public interface RouteService {
 
     public CompletableFuture<String> saveRequstionDate(Map mapValue) throws Exception;
 
+    public CompletableFuture<RouteVo> fullPathVisualizationByCarNumber(HashMap mapValue) throws Exception;
+
 }

+ 83 - 4
src/main/java/com/steerinfo/route/service/impl/RouteServiceImpl.java

@@ -94,7 +94,7 @@ public class RouteServiceImpl implements RouteService {
                 String searchPointJson2 = HTTPRequestUtils.sendGet("https://apis.map.qq.com/ws/geocoder/v1/", "address="+URLEncoder.encode(mapValue.get("receiveAddress").toString()==null?"长沙市":mapValue.get("receiveAddress").toString(),"utf-8")+"&key=WDTBZ-A5VKJ-UDLFI-KYJY6-WTP2S-A6B4Y");
                 SearchPoint searchPoint2= (SearchPoint) DataConversionTool.jsonToBean(searchPointJson2, SearchPoint.class);
                 if (searchPoint2.getStatus()==0&&searchPoint2.getResult()!=null){
-                    System.out.println(searchPoint2);
+
                     if (searchPoint2.getResult().getAddress_components()!=null){
                         materieldesMap.put("addressProvince",searchPoint2.getResult().getAddress_components().getProvince()==null?"湖南省":searchPoint2.getResult().getAddress_components().getProvince());
                         materieldesMap.put("addressDistrict",searchPoint2.getResult().getAddress_components().getDistrict()==null?"开福区":searchPoint2.getResult().getAddress_components().getDistrict());
@@ -500,10 +500,8 @@ public class RouteServiceImpl implements RouteService {
                         calendar2.add(Calendar.MONTH,2);
                         long late= calendar2.getTime().getTime();
                         long save=(lateTime-agoTime)/1000;
-                        System.out.println(redisMap);
-                        System.out.println("置60天后过期");
+
                         json = zhongJiaoXingLu.visualRoute(redisMap);
-                        System.out.println(json.length()>100?json.substring(0,100):json);
                         if (json!=null){
                             redisTemplate.opsForValue().set(prefixLine+":"+mapValue.get("orderNumber").toString(), json, save>0?save:3184000, TimeUnit.SECONDS);
                         }
@@ -765,6 +763,87 @@ public class RouteServiceImpl implements RouteService {
         }
 
     }
+    @Override
+    public CompletableFuture<RouteVo> fullPathVisualizationByCarNumber(HashMap mapValue) throws Exception {
+
+        String searchPointJson = HTTPRequestUtils.sendGet("https://apis.map.qq.com/ws/geocoder/v1/", "address="+URLEncoder.encode("四川省达州钢铁集团有限责任公司","utf-8")+"&key=WDTBZ-A5VKJ-UDLFI-KYJY6-WTP2S-A6B4Y");
+        SearchPoint searchPoint= (SearchPoint) DataConversionTool.jsonToBean(searchPointJson, SearchPoint.class);
+        String searchPointJson2 = HTTPRequestUtils.sendGet("https://apis.map.qq.com/ws/geocoder/v1/", "address="+URLEncoder.encode("四川省达川区","utf-8")+"&key=WDTBZ-A5VKJ-UDLFI-KYJY6-WTP2S-A6B4Y");
+        SearchPoint searchPoint2= (SearchPoint) DataConversionTool.jsonToBean(searchPointJson2, SearchPoint.class);
+        //运单生成之后保存
+        HashMap<String,String> redisMap=new HashMap<>();
+        String startLon=searchPoint.getResult().getLocation().getLng().toString().length()>9?searchPoint.getResult().getLocation().getLng().toString().substring(0,9):searchPoint.getResult().getLocation().getLng().toString();
+        String startLat=searchPoint.getResult().getLocation().getLat().toString().length()>9?searchPoint.getResult().getLocation().getLat().toString().substring(0,8):searchPoint.getResult().getLocation().getLat().toString();
+        redisMap.put("startLonlat", startLon+","+startLat);
+        String endLon= searchPoint2.getResult().getLocation().getLng().toString().length()>9?searchPoint2.getResult().getLocation().getLng().toString().substring(0,9):searchPoint2.getResult().getLocation().getLng().toString();
+        String endLat= searchPoint2.getResult().getLocation().getLat().toString().length()>9?searchPoint2.getResult().getLocation().getLat().toString().substring(0,8):searchPoint2.getResult().getLocation().getLat().toString();
+        redisMap.put("endLonlat",endLon+","+endLat);
+        redisMap.put("vclN", mapValue.get("capacityNumber").toString());
+        redisMap.put("vco","2");
+        redisMap.put("qryBtm", mapValue.get("startTime").toString());
+        redisMap.put("qryEtm",mapValue.get("endTime").toString());
+        String json = zhongJiaoXingLu.visualRoute2(redisMap);
+
+        JSONObject jsonObject = JSONObject.parseObject(json);
+        if (json!=null&&jsonObject.get("status").toString().equals(1001+"")){
+            //初始开始链路和结束线路、开始点、结束点、当前点的集合
+            List<StartAndEndRoute> startAndEndRouteList=new ArrayList<>();
+            //一条路线,开始链路和结束线路、开始点、结束点、当前点
+            StartAndEndRoute startAndEndRoute=new StartAndEndRoute();
+
+            ViewVisualization to= (ViewVisualization) DataConversionTool.jsonToBean(json,ViewVisualization.class);
+            //初始化vo对象
+            RouteVo vo=new RouteVo();
+            //当前所在的点
+            //当前所在的点
+            if ((!StringUtils.isEmpty(to.getResult().getLat()))&& (!StringUtils.isEmpty(to.getResult().getLon()))){
+                Double[] centerpoint = LngLonUtil.gps84_To_Gcj02((Double.valueOf(to.getResult().getLat()) / 600000), (Double.valueOf(to.getResult().getLon()) / 600000));
+                //当前所在的点
+                Point currentPoint=new Point();
+                currentPoint.setLat(centerpoint[0]+"");
+                currentPoint.setLon(centerpoint[1]+"");
+                startAndEndRoute.setCurrentPoint(currentPoint);
+            }
+            //当前所在地名称
+            startAndEndRoute.setCurrentPointName(to.getResult().getAdr());
+            //初始已行驶轨迹集合
+            if (to.getResult().getRunRoute()!=null){
+                List<RunRoutePoint> routes =new ArrayList();
+                List<Double[]> routesPath =new ArrayList();
+                for(RunRoutePoint item : to.getResult().getRunRoute()){
+                    RunRoutePoint runRoutePoint=item;
+                    //将已行驶轨迹转义数据格式
+                    Double[] points = LngLonUtil.gps84_To_Gcj02((Double.valueOf(item.getLat()) / 600000), (Double.valueOf(item.getLon()) / 600000));
+                    routesPath.add(new Double[]{points[1],points[0]});
+                    //经纬度
+                    runRoutePoint.setLat(points[0]+"");
+                    runRoutePoint.setLon(points[1]+"");
+                    //坐标点
+                    routes.add(runRoutePoint);
+                }
+                //初始化起始点,已经经过路段的第一个点
+                Point startPoint=new Point();
+                startPoint.setLat(routes.get(0).getLat());
+                startPoint.setLon(routes.get(0).getLon());
+                startAndEndRoute.setStartPoint(startPoint);
+                //点集合
+                startAndEndRoute.setRunPath(routesPath);
+                //已经完成路线点集合
+                startAndEndRoute.setRunRoute(routes);
+            }
+            //当前所行驶历程数
+            String mil=to.getResult().getRunDistance()+"km";
+            startAndEndRoute.setMiled(mil);
+            startAndEndRouteList.add(startAndEndRoute);
+            vo.setStartAndEndRoutes(startAndEndRouteList);
+            //
+            //设置返回值对象
+            return CompletableFuture.completedFuture(vo) ;
+        }else {
+            return  CompletableFuture.completedFuture(new RouteVo());
+        }
+
+    }
 
 
 }

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

@@ -100,13 +100,10 @@ public class ZhongJiaoXingLu {
             map.put("vclN", routeMap.get("vclN").toString());
             map.put("vco",routeMap.get("vco").toString());
             map.put("qryBtm", routeMap.get("qryBtm").toString());
-            //2021-12-22 12:45:07
-            SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy-MM-dd 23:59:59");
-            map.put("qryEtm", simpleDateFormat.format(new Date()));
+            map.put("qryEtm", routeMap.get("qryEtm").toString());
 
             //routeMap.get("qryEtm").toString()
             map.put("timeNearby", "30");
-            System.out.println(map);
             String url = "https://openapi.sinoiov.cn/save/apis/visualRoute";
             DataExchangeService des = new DataExchangeService(5000, 8000);
 

+ 76 - 76
src/main/resources/com/steerinfo/dil/mapper/StatisticalReportMapper.xml

@@ -319,82 +319,82 @@
     <!--  查询销售统计报表  -->
     <select id="getAllSaleReport" parameterType="java.util.Map" resultType="java.util.Map">
         select
-               *
+        *
         from (
-                 select DISTINCT OO.ORDER_NUMBER              "orderNumber",
-                        RC.CAPACITY_NUMBER           "capacityNumber",
-                        TER.RESULT_ENTRY_GATE_TIME   "resultEntryGateTime",
-                        TWR.RESULT_TARE_WEIGHT_TIME  "resultTareWeightTime",
-                        TWR.RESULT_TARE_WEIGHT       "resultTareWeight",
-                        TLR.RESULT_LOAD_END_TIME     "resultLoadEndTime",
-                        RW.WAREHOUSE_NAME            "warehouseName",
-                        TWR.RESULT_GROSS_WEIGHT_TIME "resultGrossWeightTime",
-                        TWR.RESULT_GROSS_WEIGHT      "resultGrossWeight",
-                        TWR.RESULT_NET_WEIGHT        "resultNetWeight",
-                        TLFR.RESULT_OUT_GATE_TIME    "resultOutGateTime",
-                        RTCMAO.TRUCK_CALCULATE_NUMBER       "maoCalculate",
-                        RTCPI.TRUCK_CALCULATE_NUMBER        "piCalculate",
-                        RGEN.GATEPOST_NAME                  "enGatepostName",
-                        RGOUT.GATEPOST_NAME                 "outGatepostName",
-                        RCON.CONSIGNEE_COMPANY_NAME         "receiveName",
-                        RS.SUPPLIER_NAME                    "sendName",
-                        RM.MATERIAL_NAME                     "materialName",
-                        TLR.INSERT_UPDATE_REMARK             "materialRemark",
-                        ASO.SALE_NUMBER                      "saleNumber",
-                        TLR.CASE_NUMBER                      "caseNumber",
-                        RC2.CARRIER_NAME                     "carrierName",
-                        CONCAT(CONCAT(RM.MATERIAL_SPECIFICATION, '('), CONCAT(RM.MATERIAL_MODEL, ')')) "materialCode"
-                 from OMSTRUCK_ORDER OO
-                          left join AMS_SALE_ORDER_MATERIAL ASOM
-                               on ASOM.SALE_ORDER_MATERIAL_ID = OO.ORDER_PLAN_ID
-                          left join AMS_DISPATCH_SALE_ORDER ADSO
-                               on ADSO.SALE_ORDER_MATERIAL_ID = ASOM.SALE_ORDER_MATERIAL_ID
-                          left join RMS_CARRIER RC2
-                               on RC2.CARRIER_ID = ADSO.CARRIER_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 RMS_SUPPLIER RS
-                               on RS.SUPPLIER_ID = ASO.SHIPPER_ID
-                          join TMSTRUCK_TOTAL_RESULT TTR
-                               on TTR.ORDER_ID = OO.ORDER_ID
-                          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
-                          join TMSTRUCK_WEIGHT_RESULT TWR
-                               on TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
-                          left join RMS_TRUCK_CALCULATE RTCMAO
-                               on TWR.RESULT_GROSS_PLACE_ID = RTCMAO.TRUCK_CALCULATE_ID
-                          left join RMS_TRUCK_CALCULATE RTCPI
-                               on TWR.RESULT_TARE_PLACE_ID = RTCPI.TRUCK_CALCULATE_ID
-                          join TMSTRUCK_ENFACTORY_RESULT TER
-                               on TER.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
-                          left join RMS_GATEPOST RGEN
-                               on RGEN.GATEPOST_ID = TER.GATEPOST_ID
-                          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
-                          join RMS_CAPACITY RC
-                               on RC.CAPACITY_ID = OO.CAPACITY_ID
-                          join OMSTRUCK_ORDER_MATERIAL OOM
-                               on OOM.ORDER_ID = OO.ORDER_ID
-                          join RMS_MATERIAL RM
-                               on RM.MATERIAL_ID = OOM.MATERIAL_ID
-                 where OO.ORDER_TYPE in (1, 2)
-                          <if test="carrierSsoId != null">
-                              and RC2.CARRIER_SSO_ID = #{carrierSsoId}
-                          </if>
-                          <if test="oneDate != null">
-                              and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TWR.RESULT_GROSS_WEIGHT_TIME
-                          </if>
-                          <if test="startDate != null">
-                              and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TWR.RESULT_GROSS_WEIGHT_TIME
-                              and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TWR.RESULT_GROSS_WEIGHT_TIME
-                          </if>
-             )
+        select DISTINCT OO.ORDER_NUMBER "orderNumber",
+        RC.CAPACITY_NUMBER "capacityNumber",
+        TER.RESULT_ENTRY_GATE_TIME "resultEntryGateTime",
+        TWR.RESULT_TARE_WEIGHT_TIME "resultTareWeightTime",
+        TWR.RESULT_TARE_WEIGHT "resultTareWeight",
+        TLR.RESULT_LOAD_END_TIME "resultLoadEndTime",
+        RW.WAREHOUSE_NAME "warehouseName",
+        TWR.RESULT_GROSS_WEIGHT_TIME "resultGrossWeightTime",
+        TWR.RESULT_GROSS_WEIGHT "resultGrossWeight",
+        TWR.RESULT_NET_WEIGHT "resultNetWeight",
+        TLFR.RESULT_OUT_GATE_TIME "resultOutGateTime",
+        RTCMAO.TRUCK_CALCULATE_NUMBER "maoCalculate",
+        RTCPI.TRUCK_CALCULATE_NUMBER "piCalculate",
+        RGEN.GATEPOST_NAME "enGatepostName",
+        RGOUT.GATEPOST_NAME "outGatepostName",
+        RCON.CONSIGNEE_COMPANY_NAME "receiveName",
+        RS.SUPPLIER_NAME "sendName",
+        RM.MATERIAL_NAME "materialName",
+        TLR.INSERT_UPDATE_REMARK "materialRemark",
+        ASO.SALE_NUMBER "saleNumber",
+        TLR.CASE_NUMBER "caseNumber",
+        RC2.CARRIER_NAME "carrierName",
+        CONCAT(CONCAT(RM.MATERIAL_SPECIFICATION, '('), CONCAT(RM.MATERIAL_MODEL, ')')) "materialCode"
+        from TMSTRUCK_WEIGHT_RESULT TWR
+        left join TMSTRUCK_TOTAL_RESULT TTR
+        on TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
+        left join OMSTRUCK_ORDER OO
+        on TTR.ORDER_ID = OO.ORDER_ID
+        left join AMS_SALE_ORDER_MATERIAL ASOM
+        on ASOM.SALE_ORDER_MATERIAL_ID = OO.ORDER_PLAN_ID
+        left join AMS_DISPATCH_SALE_ORDER ADSO
+        on ADSO.SALE_ORDER_MATERIAL_ID = ASOM.SALE_ORDER_MATERIAL_ID
+        left join RMS_CARRIER RC2
+        on RC2.CARRIER_ID = ADSO.CARRIER_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 RMS_SUPPLIER RS
+        on RS.SUPPLIER_ID = ASO.SHIPPER_ID
+        join TMSTRUCK_LOAD_RESULT TLR
+        on TLR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
+        and TLR.MATERIAL_ID = TWR.MATERIAL_ID
+        left join RMS_WAREHOUSE RW
+        on RW.WAREHOUSE_ID = TLR.LOADING_ID
+        left join RMS_TRUCK_CALCULATE RTCMAO
+        on TWR.RESULT_GROSS_PLACE_ID = RTCMAO.TRUCK_CALCULATE_ID
+        left join RMS_TRUCK_CALCULATE RTCPI
+        on TWR.RESULT_TARE_PLACE_ID = RTCPI.TRUCK_CALCULATE_ID
+        join TMSTRUCK_ENFACTORY_RESULT TER
+        on TER.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
+        left join RMS_GATEPOST RGEN
+        on RGEN.GATEPOST_ID = TER.GATEPOST_ID
+        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
+        join RMS_CAPACITY RC
+        on RC.CAPACITY_ID = OO.CAPACITY_ID
+        join RMS_MATERIAL RM
+        on RM.MATERIAL_ID = TWR.MATERIAL_ID
+        WHERE OO.ORDER_TYPE = #{orderType}
+        AND ASO.SHIPPER_ID = #{shipperId}
+        <if test="carrierSsoId != null">
+            and RC2.CARRIER_SSO_ID = #{carrierSsoId}
+        </if>
+        <if test="oneDate != null">
+            and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TWR.RESULT_GROSS_WEIGHT_TIME
+        </if>
+        <if test="startDate != null">
+            and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TWR.RESULT_GROSS_WEIGHT_TIME
+            and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TWR.RESULT_GROSS_WEIGHT_TIME
+        </if>
+        )
         <where>
             <if test="orderNumber != null">
                 <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
@@ -478,7 +478,7 @@
             <if test="resultGrossWeightTime != null">
                 and
                 <foreach collection="resultGrossWeightTime" item="item" open="(" separator="or" close=")">
-                        "resultGrossWeightTime" like '%${item}%'
+                    "resultGrossWeightTime" like '%${item}%'
                 </foreach>
             </if>
             <if test="resultGrossWeight != null">