Quellcode durchsuchen

Merge branch 'dev'

txf vor 3 Jahren
Ursprung
Commit
f0e93d93e0
20 geänderte Dateien mit 730 neuen und 40 gelöschten Zeilen
  1. 1 1
      pom.xml
  2. 60 0
      src/main/java/com/steerinfo/dil/controller/StatisticalReportController.java
  3. 3 0
      src/main/java/com/steerinfo/dil/mapper/TmstruckEnfactoryResultMapper.java
  4. 2 0
      src/main/java/com/steerinfo/dil/mapper/TmstruckLeaveFactoryResultMapper.java
  5. 3 0
      src/main/java/com/steerinfo/dil/mapper/TmstruckUnloadResultMapper.java
  6. 5 0
      src/main/java/com/steerinfo/dil/mapper/TmstruckWeightResultMapper.java
  7. 8 0
      src/main/java/com/steerinfo/dil/service/IStatisticalReportService.java
  8. 39 0
      src/main/java/com/steerinfo/dil/service/impl/StatisticalReportImpl.java
  9. 2 1
      src/main/java/com/steerinfo/dil/service/impl/TmstruckEnfactoryResultServiceImpl.java
  10. 2 0
      src/main/java/com/steerinfo/dil/service/impl/TmstruckLeaveFactoryResultServiceImpl.java
  11. 5 7
      src/main/java/com/steerinfo/dil/service/impl/TmstruckMeasureCommissionServiceImpl.java
  12. 2 0
      src/main/java/com/steerinfo/dil/service/impl/TmstruckUnloadResultServiceImpl.java
  13. 5 0
      src/main/java/com/steerinfo/dil/service/impl/TmstruckWeightResultServiceImpl.java
  14. 32 11
      src/main/resources/bootstrap.yml
  15. 101 8
      src/main/resources/com/steerinfo/dil/mapper/StatisticalReportMapper.xml
  16. 89 0
      src/main/resources/com/steerinfo/dil/mapper/TmstruckEnfactoryResultMapper.xml
  17. 64 0
      src/main/resources/com/steerinfo/dil/mapper/TmstruckLeaveFactoryResultMapper.xml
  18. 22 12
      src/main/resources/com/steerinfo/dil/mapper/TmstruckMeasureCommissionMapper.xml
  19. 81 0
      src/main/resources/com/steerinfo/dil/mapper/TmstruckUnloadResultMapper.xml
  20. 204 0
      src/main/resources/com/steerinfo/dil/mapper/TmstruckWeightResultMapper.xml

+ 1 - 1
pom.xml

@@ -147,7 +147,7 @@
                     <!--包名-->
                     <targetPackage>com.steerinfo.dil</targetPackage>
                     <tables>
-<!--                        <param>TMSTRUCK_MEASURE_COMMISSION</param>-->
+                        <param>DIL_VERSION</param>
 <!--                        <param>TMSTRUCK_LOAD_RESULT</param>-->
 <!--                        <param>TMSTRUCK_LEAVE_FACTORY_RESULT</param>-->
 <!--                        <param>TMSTRUCK_UNLOAD_RESULT</param>-->

+ 60 - 0
src/main/java/com/steerinfo/dil/controller/StatisticalReportController.java

@@ -0,0 +1,60 @@
+package com.steerinfo.dil.controller;
+
+import com.steerinfo.dil.service.impl.StatisticalReportImpl;
+import com.steerinfo.dil.util.BaseRESTfulController;
+import com.steerinfo.dil.util.ColumnDataUtil;
+import com.steerinfo.dil.util.PageListAdd;
+import com.steerinfo.framework.controller.RESTfulResult;
+import com.steerinfo.framework.service.pagehelper.PageHelper;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ author    :TXF
+ * @ time      :2021/12/14 18:05
+ */
+
+@RestController
+@RequestMapping("/${api.version}/statisticalReport")
+public class StatisticalReportController extends BaseRESTfulController {
+
+    @Autowired
+    StatisticalReportImpl statisticalReportService;
+
+    @Autowired
+    ColumnDataUtil columnDataUtil;
+
+    @ApiOperation(value="查询辅料燃料统计报表")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
+            @ApiImplicitParam(name = "apiId(220)", value = "动态表头", required = false, dataType = "Integer"),
+            @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
+            @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
+            @ApiImplicitParam(name = "status", value = "状态码", required = false, dataType = "Integer"),
+    })
+    @PostMapping("/getRLFLReport")
+    public RESTfulResult getRLFLReport(@RequestBody(required=false) Map<String,Object> mapValue,
+                                               Integer apiId,
+                                               Integer pageNum,
+                                               Integer pageSize,
+                                               Integer orderType
+    ){
+        mapValue.put("orderTypee", orderType);
+        List<Map<String, Object>> allReport =  statisticalReportService.getAllPurchaseFLRLReport(mapValue);
+        PageHelper.startPage(pageNum, pageSize);
+        //分页数据
+        List<Map<String, Object>> report = statisticalReportService.getRLFLReport(mapValue);
+        PageListAdd pageList = columnDataUtil.tableColumnData(apiId, allReport,report);
+        return success(pageList);
+    }
+}

+ 3 - 0
src/main/java/com/steerinfo/dil/mapper/TmstruckEnfactoryResultMapper.java

@@ -57,4 +57,7 @@ public interface TmstruckEnfactoryResultMapper extends IBaseMapper<TmstruckEnfac
     Map<String, Object> getBillOrder(String orderNumber);
 
     List<Map<String, Object>> getBillOrderMaterial(String orderNumber);
+
+//    通过运输订单获取零星物资进厂实绩
+    List<Map<String, Object>> getSporadicSuppliesEnFactoryResult(Map<String, Object> map);
 }

+ 2 - 0
src/main/java/com/steerinfo/dil/mapper/TmstruckLeaveFactoryResultMapper.java

@@ -51,4 +51,6 @@ public interface TmstruckLeaveFactoryResultMapper extends IBaseMapper<TmstruckLe
     Map<String, Object> getDeliveryOrder(String orderNumber);
 
     List<Map<String,Object>> getDeliveryOrderMaterial(String orderNumber);
+//    根据订单id获取零星物资出厂实绩
+    List<Map<String, Object>> getSporadicSuppliesOutFactoryResult(Map<String, Object> map);
 }

+ 3 - 0
src/main/java/com/steerinfo/dil/mapper/TmstruckUnloadResultMapper.java

@@ -41,4 +41,7 @@ public interface TmstruckUnloadResultMapper extends IBaseMapper<TmstruckUnloadRe
 
     //通过总实绩ID查询卸货点
     BigDecimal getUnloadPointId(Map<String, Object> map);
+//    通过总实绩ID查询卸货点
+    List<Map<String, Object>> getSporadicSuppliesUnloadResult(Map<String, Object> map);
+
 }

+ 5 - 0
src/main/java/com/steerinfo/dil/mapper/TmstruckWeightResultMapper.java

@@ -72,4 +72,9 @@ public interface TmstruckWeightResultMapper extends IBaseMapper<TmstruckWeightRe
     //通过运输订单id获取路段顺序号、物资类型、计量实绩主键、line_id
     Map<String, BigDecimal> selectByOrderId(BigDecimal orderId);
 
+//    根据运输订单Id获取计皮实绩
+    List<Map<String, Object>> getSporadicSuppliesJiPiResult(Map<String, Object> map);
+
+//    根据运输订单Id获取计毛实绩
+    List<Map<String, Object>> getSporadicSuppliesJiMiaoResult(Map<String, Object> map);
 }

+ 8 - 0
src/main/java/com/steerinfo/dil/service/IStatisticalReportService.java

@@ -1,5 +1,8 @@
 package com.steerinfo.dil.service;
 
+import java.util.List;
+import java.util.Map;
+
 /**
  * 查询汽运统计报表
  * @ author    :TXF
@@ -8,4 +11,9 @@ package com.steerinfo.dil.service;
 
 public interface IStatisticalReportService {
 
+    //查询辅料燃料统计报表
+    List<Map<String, Object>> getRLFLReport(Map<String, Object> map);
+
+    //查询采购统计报表 (辅料、燃料、内转)
+    List<Map<String, Object>> getAllPurchaseFLRLReport(Map<String, Object> map);
 }

+ 39 - 0
src/main/java/com/steerinfo/dil/service/impl/StatisticalReportImpl.java

@@ -1,8 +1,15 @@
 package com.steerinfo.dil.service.impl;
 
+import com.steerinfo.dil.mapper.StatisticalReportMapper;
 import com.steerinfo.dil.service.IStatisticalReportService;
+import com.steerinfo.dil.util.DataChange;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
 /**
  * @ author    :TXF
  * @ time      :2021/12/14 15:26
@@ -10,4 +17,36 @@ import org.springframework.stereotype.Service;
 @Service
 public class StatisticalReportImpl implements IStatisticalReportService {
 
+    @Autowired
+    StatisticalReportMapper statisticalReportMapper;
+
+    //查询辅料燃料统计报表
+    public List<Map<String, Object>> getRLFLReport(Map<String, Object> map){
+        List<Map<String, Object>> mapList = statisticalReportMapper.getAllPurchaseFLRLReport(map);
+        for (Map<String, Object> mesMap : mapList) {
+            Object resultEntryGateTime = mesMap.get("resultEntryGateTime");
+            Object resultOutGateTime = mesMap.get("resultOutGateTime");
+            if(resultEntryGateTime != null && resultOutGateTime != null){
+                Date enterDate = (Date) resultEntryGateTime;
+                Date outDate = (Date) resultOutGateTime;
+                //计算相差时间
+                long dTime = outDate.getTime() - enterDate.getTime();
+                mesMap.put("inPlantDwellTime", dTime / 60000 + "分钟");
+            }
+            if(resultEntryGateTime != null && resultOutGateTime == null){
+                //如果没有出厂时间则以当前时间减去进厂时间
+                Date enterDate = (Date) resultEntryGateTime;
+                long dTime = new Date().getTime() - enterDate.getTime();
+                mesMap.put("inPlantDwellTime", dTime / 60000 + "分钟");
+            }
+        }
+        return mapList;
+    }
+
+    @Override
+    public List<Map<String, Object>> getAllPurchaseFLRLReport(Map<String, Object> map) {
+        return statisticalReportMapper.getAllPurchaseFLRLReport(map);
+    }
+
+
 }

+ 2 - 1
src/main/java/com/steerinfo/dil/service/impl/TmstruckEnfactoryResultServiceImpl.java

@@ -115,7 +115,8 @@ public class TmstruckEnfactoryResultServiceImpl implements ITmstruckEnfactoryRes
                 break;
             case 11:
                 return tmstruckEnfactoryResultMapper.getInFactoryMaterialEnFactoryResult(map); //apiId:357
-
+            case 12:
+                return  tmstruckEnfactoryResultMapper.getSporadicSuppliesEnFactoryResult(map); //apiId:387
         }
         return null;
     }

+ 2 - 0
src/main/java/com/steerinfo/dil/service/impl/TmstruckLeaveFactoryResultServiceImpl.java

@@ -129,6 +129,8 @@ public class TmstruckLeaveFactoryResultServiceImpl implements ITmstruckLeaveFact
                 break;
             case 11:
                 return tmstruckLeaveFactoryResultMapper.getInFactoryOutFactoryResult(map); //apiId:361
+            case 12:
+                return tmstruckLeaveFactoryResultMapper.getSporadicSuppliesOutFactoryResult(map); //apiId:388
         }
         return null;
     }

+ 5 - 7
src/main/java/com/steerinfo/dil/service/impl/TmstruckMeasureCommissionServiceImpl.java

@@ -203,10 +203,9 @@ public class TmstruckMeasureCommissionServiceImpl implements ITmstruckMeasureCom
                 measureCommission =  tmstruckMeasureCommissionMapper.purchaseFLDXMeasure(map);
                 measureCommission.put("deliveryType", "计重");
                 measureCommission.put("billType", "0");
-                measureCommission.put("planQuantity", 0);
                 measureCommission.put("crname", "admin");
-                measureCommission.put("orderSource", 1);
-                measureCommission.put("ended", 0);
+                measureCommission.put("orderSource", "0");
+                measureCommission.put("ended", "0");
         }
         /*访问接口发送数据*/
         return sendMesToDXMeasure(measureCommission);
@@ -251,9 +250,8 @@ public class TmstruckMeasureCommissionServiceImpl implements ITmstruckMeasureCom
      */
     public int sendMesToDXMeasure(Map<String, Object> map){
         JSONObject jsonObject = new JSONObject();
-        jsonObject.put("data", map);
-
-        String url = "http://223.85.163.87:8121/daXingWeight/orderBusiness.do?addOrder";
+        jsonObject.putAll(map);
+        String url = "http://172.16.59.251:8121/daXingWeight/OrderBusiness/addOrder.do";
         String jsonData = null;
         try {
             jsonData = HTTPRequestUtils.send(url, jsonObject, "utf-8");
@@ -263,7 +261,7 @@ public class TmstruckMeasureCommissionServiceImpl implements ITmstruckMeasureCom
         if(!"null".equals(jsonData)){
             System.out.println(jsonData);
             HashMap hashMap = JSON.parseObject(jsonData, HashMap.class);
-            String code =(String) map.get("code");
+            String code = (String) map.get("code");
             System.out.println(hashMap.get("msg"));
             if("0".equals(code)){
                 return 1;

+ 2 - 0
src/main/java/com/steerinfo/dil/service/impl/TmstruckUnloadResultServiceImpl.java

@@ -109,6 +109,8 @@ public class TmstruckUnloadResultServiceImpl implements ITmstruckUnloadResultSer
                 return tmstruckUnloadResultMapper.getImportedDomesticNzUnload2Result(map); //apiId:356
             case 11:
                 return tmstruckUnloadResultMapper.getInFactoryUnloadResult(map); //apiId:360
+            case 12:
+                return tmstruckUnloadResultMapper.getSporadicSuppliesUnloadResult(map);//apiId:389
         }
         return null;
     }

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

@@ -97,6 +97,8 @@ public class TmstruckWeightResultServiceImpl implements ITmstruckWeightResultSer
                 return tmstruckWeightResultMapper.getImportedDomesticNzJiMao2Result(map); // apiID:354
             case 11:
                 return tmstruckWeightResultMapper.getInFactoryJiLiangResult(map);       //apiId: 358
+            case 12:
+                return tmstruckWeightResultMapper.getSporadicSuppliesJiMiaoResult(map);//apiId:390
         }
         return null;
     }
@@ -129,6 +131,9 @@ public class TmstruckWeightResultServiceImpl implements ITmstruckWeightResultSer
             case 10:
                 return tmstruckWeightResultMapper.getImportedDomesticNzJiPi2Result(map);// apiId: 104
             case 11:
+
+            case 12:
+                return tmstruckWeightResultMapper.getSporadicSuppliesJiPiResult(map);//apiId:392
         }
         return null;
     }

+ 32 - 11
src/main/resources/bootstrap.yml

@@ -15,25 +15,45 @@ spring:
 
 #feign设置
 openfeign:
+  #正式环境
+#  ColumnDataFeign:
+#    url: ${COLUMNDATAFEIGN_URL:172.16.33.162:8083}
+#  BmsShipFeign:
+#    url: ${BMSSHIPFEIGN_URL:172.16.33.162:8021}
+#  BmsTruckFeign:
+#    url: ${BMSTRUCKFEIGN_URL:172.16.33.162:8076}
+#  WmshBoundFeign:
+#    url: ${WMSHBOUNDFEIGN_URL:172.16.33.162:8070}
+#  WMSFeign:
+#    url: ${WMSFEIGN_URL:172.16.33.162:8093}
+#  OmsFeign:
+#    url: ${OMSFEIGN_URL:172.16.33.162:8095}
+#  JoinFeign:
+#    url: ${JOINFEIGN_URL:172.16.33.162:8066}
+#  QmsFeign:
+#    url: ${QMSFEIGN_URL:172.16.33.162:8047}
+#  ImFeign:
+#    url: ${IMFEIGN_URL:172.16.33.162:8055}
+
+#    测试环境
   ColumnDataFeign:
-    url: ${COLUMNDATAFEIGN_URL:172.16.33.162:8083}
+    url: ${COLUMNDATAFEIGN_URL:172.16.33.162:8001}
   BmsShipFeign:
-    url: ${BMSSHIPFEIGN_URL:172.16.33.166:8078}
+    url: ${BMSSHIPFEIGN_URL:172.16.33.162:8007}
   BmsTruckFeign:
-    url: ${BMSTRUCKFEIGN_URL:172.16.33.166:8076}
+    url: ${BMSTRUCKFEIGN_URL:172.16.33.162:8009}
   WmshBoundFeign:
-    url: ${WMSHBOUNDFEIGN_URL:172.16.33.162:8070}
+    url: ${WMSHBOUNDFEIGN_URL:172.16.33.162:8013}
   WMSFeign:
-    url: ${WMSFEIGN_URL:172.16.33.162:8093}
+    url: ${WMSFEIGN_URL:172.16.33.162:8012}
   OmsFeign:
-    url: ${OMSFEIGN_URL:172.16.33.166:8095}
+    url: ${OMSFEIGN_URL:172.16.33.162:8016}
   JoinFeign:
-    url: ${JOINFEIGN_URL:172.16.33.162:8066}
+    url: ${JOINFEIGN_URL:172.16.33.162:8006}
   QmsFeign:
-    url: ${QMSFEIGN_URL:172.16.33.166:8017}
+    url: ${QMSFEIGN_URL:172.16.33.162:8017}
   ImFeign:
-    url: ${IMFEIGN_URL:172.16.33.162:8055}
-
+    url: ${IMFEIGN_URL:172.16.33.162:8018}
 
 #eureka设置
 eureka:
@@ -102,7 +122,8 @@ mybatis:
     call-setters-on-nulls: true
 
 server:
-  port: 8008
+#  port: 8008
+  port: 8088
 
 
 

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

@@ -1,16 +1,109 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.steerinfo.dil.mapper.StatisticalReportMapper">
-
+    <sql id="orderBy">
+        <if test="orderField != null and orderField != ''">
+            order by "${orderField}"
+            <if test="orderType != null and orderType != ''">
+                ${orderType}
+            </if>
+        </if>
+    </sql>
 <!--查询采购统计报表-->
     <select id="getAllPurchaseFLRLReport" parameterType="map" resultType="java.util.Map">
         select *
-        from OMSTRUCK_ORDER OO
-        left join TMSTRUCK_TOTAL_RESULT TTR
-            on TTR.ORDER_ID = OO.ORDER_ID
-
-        left join TMSTRUCK_ENFACTORY_RESULT TER
-            on TTR.RESULT_TOTAL_ID = TER.RESULT_TOTAL_ID
-
+        from (select OO.ORDER_NUMBER            "orderNumber",
+                     RC.CAPACITY_NUMBER         "capacityNumber",
+                     TER.RESULT_ENTRY_GATE_TIME "resultEntryGateTime",
+                     TWR.RESULT_NET_WEIGHT      "resultNetWeight",
+                     TQR.RESULT_DEDUCTION       "resultDeduction",
+                     TUR.RESULT_END_TIME        "resultEndTime",
+                     RW.WAREHOUSE_NAME          "warehouseName",
+                     TRR.INSERT_TIME            "insertTime",
+                     TLFR.RESULT_OUT_GATE_TIME  "resultOutGateTime",
+                     OO.INSERT_TIME             "insertTimee"
+              from OMSTRUCK_ORDER OO
+                       left join TMSTRUCK_TOTAL_RESULT TTR
+                                 on TTR.ORDER_ID = OO.ORDER_ID
+                       left join RMS_CAPACITY RC
+                                 on RC.CAPACITY_ID = OO.CAPACITY_ID
+                       left join TMSTRUCK_ENFACTORY_RESULT TER
+                                 on TTR.RESULT_TOTAL_ID = TER.RESULT_TOTAL_ID
+                       left join OMSTRUCK_ORDER_MATERIAL OOM
+                                 on OOM.ORDER_ID = OO.ORDER_ID
+                       left join TMSTRUCK_WEIGHT_RESULT TWR
+                                 on TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
+                       left join TMSTRUCK_UNLOAD_RESULT TUR
+                                 on TUR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
+                       left join RMS_WAREHOUSE RW
+                                 on RW.WAREHOUSE_ID = TUR.RESULT_UNLOAD_PLACE_ID
+                       left join TMSTRUCK_LEAVE_FACTORY_RESULT TLFR
+                                 on TLFR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
+                       left join TMSTRUCK_RECEIPT_RESULT TRR
+                                 on TRR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
+                       left join TMSTRUCK_QUALITY_RESULT TQR
+                                 on TQR.TOTAL_RESULT_ID = TTR.RESULT_TOTAL_ID
+              where OO.ORDER_STATUS in (5, 8, 9, 1, 2)
+                and OO.ORDER_TYPE = #{orderTypee}
+             )
+        <where>
+            <if test="orderNumber != null">
+                <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
+                    "orderNumber" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="capacityNumber != null">
+                and
+                <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
+                    "capacityNumber" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="resultEntryGateTime != null">
+                and
+                <foreach collection="resultEntryGateTime" item="item" open="(" separator="or" close=")">
+                    "resultEntryGateTime" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="resultNetWeight != null">
+                and
+                <foreach collection="resultNetWeight" item="item" open="(" separator="or" close=")">
+                    "resultNetWeight" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="resultDeduction != null">
+                and
+                <foreach collection="resultDeduction" item="item" open="(" separator="or" close=")">
+                    "resultDeduction" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="resultEndTime != null">
+                and
+                <foreach collection="resultEndTime" item="item" open="(" separator="or" close=")">
+                    "resultEndTime" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="warehouseName != null">
+                and
+                <foreach collection="warehouseName" item="item" open="(" separator="or" close=")">
+                    "warehouseName" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="insertTime != null">
+                and
+                <foreach collection="insertTime" item="item" open="(" separator="or" close=")">
+                    "insertTime" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="resultOutGateTime != null">
+                and
+                <foreach collection="resultOutGateTime" item="item" open="(" separator="or" close=")">
+                    "resultOutGateTime" like '%${item}%'
+                </foreach>
+            </if>
+        </where>
+        <include refid="orderBy"></include>
+        <if test="orderField == null  ">
+            order by "insertTimee" desc
+        </if>
     </select>
 </mapper>

+ 89 - 0
src/main/resources/com/steerinfo/dil/mapper/TmstruckEnfactoryResultMapper.xml

@@ -1228,4 +1228,93 @@
                  rm.material_id = oom.order_material_id
         where oo.order_number = #{orderNumber}
     </select>
+<!--    通过id获取零星物资id-->
+    <select id="getSporadicSuppliesEnFactoryResult" parameterType="java.util.Map" resultType="java.util.Map">
+        select *
+        from (
+        select TER.RESULT_ID "resultId",
+               OO.ORDER_ID      "orderId",
+                OO.ORDER_NUMBER "orderNumber",
+                RS1.SUPPLIER_NAME "sendCompany",
+                RS2.SUPPLIER_NAME "receiveCompany",
+                RC.CARRIER_NAME "carrierName",
+                RG.GATEPOST_NAME "gatepostName",
+                TER.RESULT_ENTRY_MODE "resultEntryMode",
+                TER.RESULT_ENTRY_GATE_TIME "resultEntryGateTime"
+        from TMSTRUCK_ENFACTORY_RESULT TER
+        left join TMSTRUCK_TOTAL_RESULT TTR
+            on TER.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
+        left join OMSTRUCK_ORDER OO
+            on TTR.ORDER_ID = OO.ORDER_ID
+        left join AMSTRUCK_SPORADIC_ORDER ASO
+            on OO.ORDER_PLAN_ID = ASO.SPORADIC_ORDER_ID
+        LEFT JOIN RMS_SUPPLIER RS1
+        ON RS1.SUPPLIER_ID = ASO.SEND_UNIT_ID
+        LEFT JOIN RMS_SUPPLIER RS2
+        ON RS2.SUPPLIER_ID = ASO.RECEIVE_UNIT_ID
+        left join RMS_CARRIER RC
+        on RC.CARRIER_ID = ASO.CARRIER_ID
+        left join RMS_GATEPOST RG
+        on RG.GATEPOST_ID = TER.GATEPOST_ID
+        where TER.RESULT_ENTRY_GATE_TIME is not null
+        and OO.ORDER_TYPE in (12, 13)
+        )
+        <where>
+            <if test="materialName != null">
+                <foreach collection="materialName" item="item" open="(" separator="or" close=")">
+                    "materialName" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="supplierName != null">
+                and
+                <foreach collection="supplierName" item="item" open="(" separator="or" close=")">
+                    "supplierName" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="orderNumber != null">
+                and
+                <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
+                    "orderNumber" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="carrierName != null">
+                and
+                <foreach collection="carrierName" item="item" open="(" separator="or" close=")">
+                    "carrierName" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="shipperName != null">
+                and
+                <foreach collection="shipperName" item="item" open="(" separator="or" close=")">
+                    "shipperName" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="resultEntryMode != null">
+                and
+                <foreach collection="resultEntryMode" item="item" open="(" separator="or" close=")">
+                    "resultEntryMode" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="orderMaterialWeight != null">
+                and
+                <foreach collection="orderMaterialWeight" item="item" open="(" separator="or" close=")">
+                    "orderMaterialWeight" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="loadingName != null">
+                and
+                <foreach collection="loadingName" item="item" open="(" separator="or" close=")">
+                    "loadingName" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="resultEntryGateTime != null">
+                and
+                <foreach collection="resultEntryGateTime" item="item" open="(" separator="or" close=")">
+                    "resultEntryGateTime" like '%${item}%'
+                </foreach>
+            </if>
+        </where>
+        <include refid="orderByEnterTime"></include>
+    </select>
+
 </mapper>

+ 64 - 0
src/main/resources/com/steerinfo/dil/mapper/TmstruckLeaveFactoryResultMapper.xml

@@ -1151,4 +1151,68 @@
             and twr.MATERIAL_ID = oom.MATERIAL_ID
         where oo.order_number = #{orderNumber}
     </select>
+<!--    根据订单id获取零星物资出厂实绩-->
+    <select id="getSporadicSuppliesOutFactoryResult" parameterType="java.util.Map" resultType="java.util.Map">
+    select *
+    from (
+    select
+    TLFR.RESULT_ID                     "resultId",
+    OO.ORDER_NUMBER                    "orderNumber",
+    RC.CARRIER_NAME                    "carrierName",
+    RG.GATEPOST_NAME                   "gatepostName",
+    TLFR.RESULT_OUT_MODE               "resultOutMode",
+    TLFR.RESULT_OUT_GATE_TIME          "resultOutGateTime",
+    TLFR.RESULT_TRUCK_SNAPSHOT_PICTURE "resultTruckSnapshotPicture"
+    from TMSTRUCK_LEAVE_FACTORY_RESULT TLFR
+    left join TMSTRUCK_TOTAL_RESULT TTR
+    on TTR.RESULT_TOTAL_ID = TLFR.RESULT_TOTAL_ID
+    left join OMSTRUCK_ORDER OO
+    on OO.ORDER_ID = TTR.ORDER_ID
+    left join RMS_CARRIER RC
+    on RC.CARRIER_ID = OO.CAPACITY_ID
+    left join RMS_GATEPOST RG
+    on RG.GATEPOST_ID = TLFR.GATEPOST_ID
+
+    where RESULT_OUT_GATE_TIME is not null
+    and OO.ORDER_TYPE = 12
+    )
+    <where>
+        <if test="orderNumber != null">
+            <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
+                "orderNumber" like '%${item}%'
+            </foreach>
+        </if>
+        <if test="carrierName != null">
+            and
+            <foreach collection="carrierName" item="item" open="(" separator="or" close=")">
+                "carrierName" like '%${item}%'
+            </foreach>
+        </if>
+        <if test="gatepostName != null">
+            and
+            <foreach collection="gatepostName" item="item" open="(" separator="or" close=")">
+                "gatepostName" like '%${item}%'
+            </foreach>
+        </if>
+        <if test="resultOutMode != null">
+            and
+            <foreach collection="resultOutMode" item="item" open="(" separator="or" close=")">
+                "resultOutMode" like '%${item}%'
+            </foreach>
+        </if>
+        <if test="resultOutGateTime != null">
+            and
+            <foreach collection="resultOutGateTime" item="item" open="(" separator="or" close=")">
+                "resultOutGateTime" like '%${item}%'
+            </foreach>
+        </if>
+        <if test="resultTruckSnapshotPicture != null">
+            and
+            <foreach collection="resultTruckSnapshotPicture" item="item" open="(" separator="or" close=")">
+                "resultTruckSnapshotPicture" like '%${item}%'
+            </foreach>
+        </if>
+    </where>
+    <include refid="orderByOutTime"></include>
+    </select>
 </mapper>

+ 22 - 12
src/main/resources/com/steerinfo/dil/mapper/TmstruckMeasureCommissionMapper.xml

@@ -787,18 +787,28 @@
 
 <!--   采购辅料查询计量委托(达兴) -->
     <select id="purchaseFLDXMeasure" parameterType="map" resultType="java.util.Map">
-        select
-            APO.PURCHASE_ORDER_NO   "purchaseOrder",
-            OO.ORDER_NUMBER         "orderId",
-            RC.CAPACITY_NUMBER      "carNumber",
-            RTC.TRUCK_CALCULATE_NUMBER "regionName",
-            RS.SUPPLIER_NAME            "sendUnit",
-            RS.SUPPLIER_DUTY_PARAGRAPH   "providerNo",
-            RSH.SHIPPER_NAME            "receiver",
-            RSH.SHIPPER_PARTITION_CODE  "receiverNo",
-            RM.MATERIAL_ID              "item",
-            RM.MATERIAL_CODE            "goodsNo",
-            CONCAT(RM.MATERIAL_NAME ,CONCAT(RM.MATERIAL_SPECIFICATION, RM.MATERIAL_MODEL)) "goodsName"
+        select APO.PURCHASE_ORDER_NO                                                          "purchaseOrder",
+               OO.ORDER_NUMBER                                                                "orderId",
+               RC.CAPACITY_NUMBER                                                             "carNumber",
+               RTC.TRUCK_CALCULATE_NUMBER                                                     "regionName",
+               RS.SUPPLIER_NAME                                                               "provider",
+               RS.SUPPLIER_DUTY_PARAGRAPH                                                     "providerNo",
+               RSH.SHIPPER_NAME                                                               "receiver",
+               (case
+                    when RSH.SHIPPER_PARTITION_CODE is null
+                        then ' '
+                    else RSH.SHIPPER_PARTITION_CODE
+                   end
+                   )                                                                          "receiverNo",
+               RM.MATERIAL_ID || ''                                                                "item",
+               RM.MATERIAL_CODE                                                               "goodsNo",
+               CONCAT(RM.MATERIAL_NAME, CONCAT(RM.MATERIAL_SPECIFICATION, RM.MATERIAL_MODEL)) "goodsName",
+               (case
+                   when OOM.ORDER_MATERIAL_WEIGHT  is null
+                    then 0
+                   else OOM.ORDER_MATERIAL_WEIGHT
+                   end
+                )             || ''                                                           "planQuantity"
         from OMSTRUCK_ORDER OO
                  left join TMSTRUCK_TOTAL_RESULT TTR
                            on TTR.ORDER_ID = OO.ORDER_ID

+ 81 - 0
src/main/resources/com/steerinfo/dil/mapper/TmstruckUnloadResultMapper.xml

@@ -886,5 +886,86 @@
         </where>
         <include refid="orderBy"></include>
     </select>
+<!--    根据总实绩ID查询卸货地点-->
+    <select id="getSporadicSuppliesUnloadResult" resultType="java.util.Map">
+    SELECT *
+    FROM (
+    SELECT TUR.RESULT_ID             "resultId",
+            OO.ORDER_NUMBER           "orderNumber",
+            RC.CARRIER_NAME        "carrierName",
+            RM.MATERIAL_NAME          "materialName",
+            OOM.ORDER_MATERIAL_NUMBER "orderMaterialNumber",
+            TUR.RESULT_START_TIME     "resultStartTime",
+            TUR.RESULT_END_TIME       "resultEndTime",
+            TUR.RESULT_DURATION       "resultDuration",
+            RW.WAREHOUSE_NAME         "warehouseName"
+    FROM TMSTRUCK_UNLOAD_RESULT TUR
+    LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
+    ON TTR.RESULT_TOTAL_ID = TUR.RESULT_TOTAL_ID
+    LEFT JOIN OMSTRUCK_ORDER OO
+    ON OO.ORDER_ID = TTR.ORDER_ID
+    LEFT JOIN RMS_CARRIER RC
+    ON RC.CARRIER_ID = OO.CAPACITY_ID
+    LEFT JOIN OMSTRUCK_ORDER_MATERIAL OOM
+    ON OOM.ORDER_ID = OO.ORDER_ID
+    LEFT JOIN RMS_MATERIAL RM
+    ON RM.MATERIAL_ID = OOM.MATERIAL_ID
+    LEFT JOIN RMS_WAREHOUSE RW
+    ON RW.WAREHOUSE_ID = TUR.RESULT_UNLOAD_PLACE_ID
+    WHERE TUR.RESULT_START_TIME IS NOT NULL
+    AND OO.ORDER_TYPE = 12
+    )
+    <where>
+        <if test="orderNumber != null">
+            <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
+                "orderNumber" like '%${item}%'
+            </foreach>
+        </if>
+        <if test="carrierName != null">
+            and
+            <foreach collection="carrierName" item="item" open="(" separator="or" close=")">
+                "carrierName" like '%${item}%'
+            </foreach>
+        </if>
+        <if test="materialName != null">
+            and
+            <foreach collection="materialName" item="item" open="(" separator="or" close=")">
+                "materialName" like '%${item}%'
+            </foreach>
+        </if>
+        <if test="orderMaterialNumber != null">
+            and
+            <foreach collection="orderMaterialNumber" item="item" open="(" separator="or" close=")">
+                "orderMaterialNumber" like '%${item}%'
+            </foreach>
+        </if>
+        <if test="warehouseName != null">
+            and
+            <foreach collection="warehouseName" item="item" open="(" separator="or" close=")">
+                "warehouseName" like '%${item}%'
+            </foreach>
+        </if>
+        <if test="resultStartTime != null">
+            and
+            <foreach collection="resultStartTime" item="item" open="(" separator="or" close=")">
+                "resultStartTime" like '%${item}%'
+            </foreach>
+        </if>
+        <if test="resultEndTime != null">
+            and
+            <foreach collection="resultEndTime" item="item" open="(" separator="or" close=")">
+                "resultEndTime" like '%${item}%'
+            </foreach>
+        </if>
+        <if test="resultDuration != null">
+            and
+            <foreach collection="resultDuration" item="item" open="(" separator="or" close=")">
+                "resultDuration" like '%${item}%'
+            </foreach>
+        </if>
+    </where>
+    <include refid="orderBy"></include>
+    </select>
+
 
 </mapper>

+ 204 - 0
src/main/resources/com/steerinfo/dil/mapper/TmstruckWeightResultMapper.xml

@@ -2161,5 +2161,209 @@
             order by "resultTareWeightTime" desc
         </if>
     </select>
+<!--    根据运输订单Id获取零星物资计皮实绩-->
+    <select id="getSporadicSuppliesJiPiResult" resultType="java.util.Map">
+        select *
+        from (
+        select
+        TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
+        APO.SPORADIC_ORDER_NO "purchaseOrderNo",
+        RM.MATERIAL_NAME "materialName",
+        OO.ORDER_NUMBER "orderNumber",
+        RC.CARRIER_NAME "carrierName",
+        RTC.TRUCK_CALCULATE_NUMBER "truckCalculateNumber",
+        TWR.RESULT_GROSS_WEIGHT "resultGrossWeight",
+        TWR.RESULT_GROSS_WEIGHT_TIME "resultGrossWeightTime",
+        TWR.RESULT_TARE_WEIGHT "resultTareWeight",
+        TWR.RESULT_TARE_WEIGHT_TIME "resultTareWeightTime",
+        TWR.RESULT_NET_WEIGHT "resultNetWeight",
+        TWR.RESULT_POUND_NO "resultPoundNo"
+        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 AMSTRUCK_SPORADIC_ORDER APO
+        on APO.SPORADIC_ORDER_ID = OO.ORDER_PLAN_ID
+        left join RMS_CARRIER RC
+        on RC.CARRIER_ID = OO.CAPACITY_ID
+        left join RMS_TRUCK_CALCULATE RTC
+        on RTC.TRUCK_CALCULATE_ID = TWR.RESULT_TARE_PLACE_ID
+        left join OMSTRUCK_ORDER_MATERIAL OOM
+        on OOM.ORDER_ID = OO.ORDER_ID
+        left join RMS_MATERIAL RM
+        on RM.MATERIAL_ID = OOM.MATERIAL_ID
+        where RESULT_TARE_WEIGHT_TIME is not null and OO.ORDER_TYPE = #{orderTypee}
+        )
+        <where>
+            <if test="purchaseOrderNo != null">
+                <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
+                    "purchaseOrderNo" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="materialName != null">
+                and
+                <foreach collection="materialName" item="item" open="(" separator="or" close=")">
+                    "materialName" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="orderNumber != null">
+                and
+                <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
+                    "orderNumber" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="carrierName != null">
+                and
+                <foreach collection="carrierName" item="item" open="(" separator="or" close=")">
+                    "carrierName" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="truckCalculateNumber != null">
+                and
+                <foreach collection="truckCalculateNumber" item="item" open="(" separator="or" close=")">
+                    "truckCalculateNumber" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="resultGrossWeight != null">
+                and
+                <foreach collection="resultGrossWeight" item="item" open="(" separator="or" close=")">
+                    "resultGrossWeight" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="resultForeignShipName != null">
+                and
+                <foreach collection="resultForeignShipName" item="item" open="(" separator="or" close=")">
+                    "resultForeignShipName" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="resultGrossWeightTime != null">
+                and
+                <foreach collection="resultGrossWeightTime" item="item" open="(" separator="or" close=")">
+                    "resultGrossWeightTime" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="resultTareWeight != null">
+                and
+                <foreach collection="resultTareWeight" item="item" open="(" separator="or" close=")">
+                    "resultTareWeight" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="resultPoundNo != null">
+                and
+                <foreach collection="resultPoundNo" item="item" open="(" separator="or" close=")">
+                    "resultPoundNo" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="resultTareWeightTime != null">
+                and
+                <foreach collection="resultTareWeightTime" item="item" open="(" separator="or" close=")">
+                    "resultTareWeightTime" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="resultNetWeight != null">
+                and
+                <foreach collection="resultNetWeight" item="item" open="(" separator="or" close=")">
+                    "resultNetWeight" like '%${item}%'
+                </foreach>
+            </if>
+        </where>
+        <include refid="orderBy"></include>
+        <if test="orderField == null  ">
+            order by "resultTareWeightTime" desc
+        </if>
+    </select>
+<!--    根据运输订单Id获取计毛实绩-->
+    <select id="getSporadicSuppliesJiMiaoResult" resultType="java.util.Map">
+        select *
+        from (
+        select
+                TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
+                APO.SPORADIC_ORDER_NO "purchaseOrderNo",
+                RM.MATERIAL_NAME "materialName",
+                OO.ORDER_NUMBER "orderNumber",
+                RC.CARRIER_NAME "carrierName",
+                RTC.TRUCK_CALCULATE_NUMBER "truckCalculateNumber",
+                TWR.RESULT_GROSS_WEIGHT "resultGrossWeight",
+                TWR.RESULT_GROSS_WEIGHT_TIME "resultGrossWeightTime",
+                RS.SUPPLIER_NAME "supplierName",
+                RCON.SHIPPER_NAME "consigneeCompanyName",
+                OO.ORDER_ID "orderId",
+                OO.ORDER_STATUS "orderStatus"
+        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 AMSTRUCK_SPORADIC_ORDER APO
+        on APO.SPORADIC_ORDER_ID = OO.ORDER_PLAN_ID
+        left join RMS_CARRIER RC
+        on RC.CARRIER_ID = OO.CAPACITY_ID
+        left join RMS_TRUCK_CALCULATE RTC
+        on RTC.TRUCK_CALCULATE_ID = TWR.RESULT_GROSS_PLACE_ID
+        left join OMSTRUCK_ORDER_MATERIAL OOM
+        on OOM.ORDER_ID = OO.ORDER_ID
+        left join RMS_MATERIAL RM
+        on RM.MATERIAL_ID = OOM.MATERIAL_ID
+        left join RMS_SUPPLIER RS
+        on RS.SUPPLIER_ID = APO.SEND_UNIT_ID
+        left join RMS_SHIPPER RCON
+        on RCON.SHIPPER_ID = APO.RECEIVE_UNIT_ID
+        where RESULT_GROSS_WEIGHT_TIME is not null and OO.ORDER_TYPE = #{orderTypee}
+        )
+        <where>
+            <if test="purchaseOrderNo != null">
+                <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
+                    "purchaseOrderNo" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="materialName != null">
+                and
+                <foreach collection="materialName" item="item" open="(" separator="or" close=")">
+                    "materialName" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="orderNumber != null">
+                and
+                <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
+                    "orderNumber" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="carrierName != null">
+                and
+                <foreach collection="carrierName" item="item" open="(" separator="or" close=")">
+                    "carrierName" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="truckCalculateNumber != null">
+                and
+                <foreach collection="truckCalculateNumber" item="item" open="(" separator="or" close=")">
+                    "truckCalculateNumber" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="resultGrossWeight != null">
+                and
+                <foreach collection="resultGrossWeight" item="item" open="(" separator="or" close=")">
+                    "resultGrossWeight" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="supplierName != null">
+                and
+                <foreach collection="supplierName" item="item" open="(" separator="or" close=")">
+                    "supplierName" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="resultGrossWeightTime != null">
+                and
+                <foreach collection="resultGrossWeightTime" item="item" open="(" separator="or" close=")">
+                    "resultGrossWeightTime" like '%${item}%'
+                </foreach>
+            </if>
+        </where>
+        <include refid="orderBy"></include>
+        <if test="orderField == null  ">
+            order by "resultGrossWeightTime" desc
+        </if>
+    </select>
 
 </mapper>