HUJIANGUO %!s(int64=3) %!d(string=hai) anos
pai
achega
2d6bc98bb9

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

@@ -83,7 +83,8 @@ public class StatisticalReportController extends BaseRESTfulController {
                                        String carrierSsoId,
                                           Integer orderType,
                                           Integer shipperId,
-                                          String receiveName
+                                          String receiveName,
+                                          String materialName
     ){
         if(carrierSsoId != null){
             if(!"null".equals(carrierSsoId)){
@@ -93,6 +94,9 @@ public class StatisticalReportController extends BaseRESTfulController {
         if (receiveName != null && !"null".equals(receiveName)) {
             mapValue.put("receivName","%" + receiveName + "%");
         }
+        if (materialName != null && !"".equals(materialName) && !"null".equals(materialName)) {
+            mapValue.put("remark","%" + materialName + "%");
+        }
         mapValue.put("orderType",orderType);
         mapValue.put("shipperId",shipperId);
         DataChange.queryDataByDateTime(startTime, endTime, mapValue, sdfDateTime);//根据时间段查询数据

+ 20 - 19
src/main/java/com/steerinfo/dil/service/impl/StatisticalReportImpl.java

@@ -77,6 +77,26 @@ public class StatisticalReportImpl implements IStatisticalReportService {
     @Override
     public List<Map<String, Object>> getAllSaleReport(Map<String, Object> map) {
         List<Map<String, Object>> mapList = statisticalReportMapper.getAllSaleReport(map);
+        for(Map<String, Object> map1 : mapList) {
+            if ( map1.get("resultEntryGateTime") == null) {
+                map1.put("transportStatus", "未进厂");
+                continue;
+            }
+            if (map1.get("resultOutGateTime") == null) {
+                map1.put("transportStatus", "已进厂");
+                continue;
+            }
+            if (map1.get("arrivalAddress") == null) {
+                map1.put("transportStatus", "已出厂");
+                continue;
+            }
+            if (map1.get("receiptAddress") == null) {
+                map1.put("transportStatus", "已抵达");
+                continue;
+            }
+            else
+                map1.put("transportStatus", "已签收");
+        }
         for (Map<String, Object> mesMap : mapList) {
             calculateDifferenceTime(mesMap);
         }
@@ -86,25 +106,6 @@ public class StatisticalReportImpl implements IStatisticalReportService {
     @Override
     public List<Map<String, Object>> getAllSaleReportNum(Map<String, Object> map) {
          List<Map<String, Object>> listMap = statisticalReportMapper.getAllSaleReport(map);
-         for(Map<String, Object> map1 : listMap) {
-             if ( map1.get("resultEntryGateTime") == null) {
-                 map1.put("transportStatus", "未进厂");
-                 continue;
-             }
-             if (map1.get("resultOutGateTime") == null) {
-                 map1.put("transportStatus", "已进厂");
-                 continue;
-             }
-             if (map1.get("arrivaladdress") == null) {
-                 map1.put("transportStatus", "运输中");
-                 continue;
-             }
-             if (map1.get("receiveTime") == null) {
-                 map1.put("transportStatus", "已抵达");
-                 continue;
-             } else
-                 map1.put("transportStatus", "已签收");
-         }
          return listMap;
     }
 

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

@@ -318,6 +318,7 @@
 <!--  查询销售统计报表  -->
     <!--  查询销售统计报表  -->
     <select id="getAllSaleReport" parameterType="java.util.Map" resultType="java.util.Map">
+        select * from (
         select
         *
         from (
@@ -343,6 +344,8 @@
         ASO.SALE_NUMBER "saleNumber",
         TLR.CASE_NUMBER "caseNumber",
         RC2.CARRIER_NAME "carrierName",
+        TAR.RESULT_ARRIVAL_ADDRESS "arrivalAddress",
+        TRR.RESULT_ARRIVAL_ADDRESS "receiptAddress",
         CONCAT(CONCAT(RM.MATERIAL_SPECIFICATION, '('), CONCAT(RM.MATERIAL_MODEL, ')')) "materialCode"
         from TMSTRUCK_WEIGHT_RESULT TWR
         left join TMSTRUCK_TOTAL_RESULT TTR
@@ -382,6 +385,10 @@
         on RC.CAPACITY_ID = OO.CAPACITY_ID
         join RMS_MATERIAL RM
         on RM.MATERIAL_ID = TWR.MATERIAL_ID
+        left join TMSTRUCK_ARRIVAL_RESULT TAR
+        on TAR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
+        left join TMStRUCK_RECEIPT_RESULT TRR
+        on TTR.RESULT_TOTAL_ID = TRR.RESULT_TOTAL_ID
         WHERE OO.ORDER_TYPE = #{orderType}
         AND ASO.SHIPPER_ID = #{shipperId}
         <if test="carrierSsoId != null">
@@ -397,6 +404,12 @@
             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>
+        ) RRR
+            <where>
+                <if test="remark != null" >
+                    and RRR."materialName" LIKE #{remark} or RRR."materialRemark" LIKE #{remark}
+                </if>
+            </where>
         )
         <where>
             <if test="orderNumber != null">