Redeem 1 anno fa
parent
commit
314332a746

+ 13 - 1
src/main/java/com/steerinfo/dil/service/impl/StatisticalReportImpl.java

@@ -959,7 +959,19 @@ public class StatisticalReportImpl implements IStatisticalReportService {
     }
 
     public List<Map<String, Object>> getOyeSteelReport(Map<String, Object> map) {
-        List<Map<String, Object>> saleSteelReport = statisticalReportMapper.getOyeSteelReport(map);
+        List<Map<String, Object>> saleSteelReport = new ArrayList<>();
+        List<Map<String, Object>> saleSteelReportNoOrder = new ArrayList<>();
+        if (DataChange.dataToBigDecimal(map.get("dateType")).intValue() != 2) {
+            Map<String, Object> noOrderMap = new HashMap<>();
+            noOrderMap.putAll(map);
+            noOrderMap.put("orderNoFlag",1);
+            saleSteelReportNoOrder = statisticalReportMapper.getOyeSteelReport(noOrderMap);
+        }
+        Map<String, Object> OrderMap = new HashMap<>();
+        OrderMap.putAll(map);
+        List<Map<String, Object>> saleSteelReportOrder = statisticalReportMapper.getOyeSteelReport(OrderMap);
+        saleSteelReport.addAll(saleSteelReportNoOrder);
+        saleSteelReport.addAll(saleSteelReportOrder);
         HashSet set = new HashSet<>();
         HashSet quxiaoSet = new HashSet();
         HashSet<Map<String,Object>> filterConsigneeList = new HashSet<>();

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

@@ -2017,13 +2017,13 @@
                     RRA.ADDRESS_TOWN "addressTown",
                     OO.ORDER_LINE_SEQUENCE "lineSqe",
                     OO.DRIVER_TEL "capacityTel",
-                    (CASE WHEN
-                        OO.ORDER_STATUS = 2 and TTR.ORDER_STATUS = '已出厂'
+                    (CASE
+                        WHEN OIR.SALE_MATERIAL_ID IS NOT NULL
+                        THEN '已入库'
+                        WHEN OO.ORDER_STATUS = 2
                         THEN '已完成'
                         WHEN TTR.ORDER_STATUS IS NULL
                         THEN '未派发'
-                        WHEN OIR.SALE_MATERIAL_ID IS NOT NULL
-                        THEN '已入库'
                         ELSE TTR.ORDER_STATUS
                         END) "orderStatusActually",
                     QQR.RESULT_START_TIME   "queueStartTime",
@@ -2347,9 +2347,9 @@
                         and <foreach collection="orderStatusList" item="item" open="(" separator="or" close=")">
                         (CASE
                         when OO.ORDER_STATUS =2
-                        then '作业已完成'
+                        then '已完成'
                         when OO.ORDER_STATUS=4
-                        then '物流公司已派单'
+                        then '已派单'
                         when nvl(OO.ORDER_STATUS,0)=0
                         then '未派发'
                         when OO.ORDER_STATUS=7
@@ -2365,7 +2365,7 @@
                         WHEN QQR.RESULT_START_TIME IS NOT NULL
                         THEN '排队中'
                         when OO.ORDER_STATUS=5
-                        then '司机已接单'
+                        then '已接单'
                         WHEN TER.INSERT_TIME IS NULL
                         THEN ' '
                         WHEN TLFR.INSERT_TIME IS NULL THEN ' '
@@ -2374,8 +2374,10 @@
                     </if>
                     <if test="orderStatusActuallyList != null and orderStatusActuallyList.size > 0">
                         and <foreach collection="orderStatusActuallyList" item="item" open="(" separator="or" close=")">
-                        (CASE WHEN
-                        OO.ORDER_STATUS = 2 and TTR.ORDER_STATUS = '已出厂'
+                        (CASE
+                        WHEN OIR.SALE_MATERIAL_ID IS NOT NULL
+                        THEN '已入库'
+                        WHEN OO.ORDER_STATUS = 2
                         THEN '已完成'
                         WHEN TTR.ORDER_STATUS IS NULL
                         THEN '未派发'
@@ -6529,6 +6531,10 @@
         THEN '已放行'
         ELSE TTR.ORDER_STATUS
         END)  "orderStatus",
+        CASE WHEN OOR.INVENTORY_ID IS NOT NULL
+        THEN '已出库'
+        ELSE '未出库'
+        END "outboundStatus",
         QQR.RESULT_START_TIME   "queueStartTime",
         QQR.UPDATE_TIME         "allowEnfactoryTime",
         TWB .WEIGHT_BATCH_ID "weightBatchId",
@@ -6762,6 +6768,14 @@
             END) like '%${item}%'
         </foreach>
         </if>
+        <if test="outboundStatusList != null and outboundStatusList.size > 0">
+            and <foreach collection="outboundStatusList" item="item" index="index" separator="or" close=")" open="(">
+            CASE WHEN OOR.INVENTORY_ID IS NOT NULL
+            THEN '已出库'
+            ELSE '未出库'
+            END like '%${item}%'
+        </foreach>
+        </if>
         <if test="addressPlaceList != null and addressPlaceList.size > 0">
             and <foreach collection="addressPlaceList" item="item" open="(" separator="or" close=")">
             RRA.ADDRESS_PROVINCE || RRA.ADDRESS_DISTRICT ||
@@ -6799,13 +6813,26 @@
         and ASO.DELETED = 0
         AND ASM.DELETED IS NULL
         and ASO.SALE_TYPE = 50
-        <if test="oneDate != null">
+        <if test="oneDate != null and orderNoFlag == null and dateType != 2">
             and to_date(#{oneDate}, 'yyyy-mm-dd') &lt; = to_date(to_char(ASOM.SALE_DATE_OF_RECEIPT,'yyyy-mm-dd'),'yyyy-mm-dd')
         </if>
-        <if test="startDate != null">
+        <if test="startDate != null and orderNoFlag == null and dateType != 2">
             and to_date(#{startDate}, 'yyyy-mm-dd') &lt;=  to_date(to_char(ASOM.SALE_DATE_OF_RECEIPT,'yyyy-mm-dd'),'yyyy-mm-dd')
             and to_date(#{endDate}, 'yyyy-mm-dd') >=  to_date(to_char(ASOM.SALE_DATE_OF_RECEIPT,'yyyy-mm-dd'),'yyyy-mm-dd')
         </if>
+        <if test="oneDate != null and orderNoFlag == null and dateType != null and dateType == 2">
+            and to_date(#{oneDate}, 'yyyy-mm-dd') &lt; = to_date(to_char(ASM.SALE_MAKE_DATE,'yyyy-mm-dd'),'yyyy-mm-dd')
+        </if>
+        <if test="startDate != null and orderNoFlag == null and dateType != null and dateType == 2">
+            and to_date(#{startDate}, 'yyyy-mm-dd') &lt;=  to_date(to_char(ASM.SALE_MAKE_DATE,'yyyy-mm-dd'),'yyyy-mm-dd')
+            and to_date(#{endDate}, 'yyyy-mm-dd') >=  to_date(to_char(ASM.SALE_MAKE_DATE,'yyyy-mm-dd'),'yyyy-mm-dd')
+        </if>
+        <if test="orderNoFlag == null">
+            and OO.ORDER_ID IS NOT NULL
+        </if>
+        <if test="orderNoFlag != null">
+            and OO.ORDER_ID IS NULL
+        </if>
         <if test="saleNo != null">
             and aso.sale_number like '%${saleNo}%'
         </if>