Browse Source

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

txf 3 years ago
parent
commit
11bf0e279a

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

@@ -82,13 +82,17 @@ public class StatisticalReportController extends BaseRESTfulController {
                                        String endTime,
                                        String carrierSsoId,
                                           Integer orderType,
-                                          Integer shipperId
+                                          Integer shipperId,
+                                          String receiveName
     ){
         if(carrierSsoId != null){
             if(!"null".equals(carrierSsoId)){
                 mapValue.put("carrierSsoId", carrierSsoId);
             }
         }
+        if (receiveName != null && !"null".equals(receiveName)) {
+            mapValue.put("receivName","%" + receiveName + "%");
+        }
         mapValue.put("orderType",orderType);
         mapValue.put("shipperId",shipperId);
         DataChange.queryDataByDateTime(startTime, endTime, mapValue, sdfDateTime);//根据时间段查询数据
@@ -351,8 +355,13 @@ public class StatisticalReportController extends BaseRESTfulController {
                                              Integer apiId,
                                              Integer pageNum,
                                              Integer pageSize,
+                                             String startTime,
+                                             String endTime,
                                              String con){
-        map.put("con",con);
+        if (con != null && !"undefined".equals(con)) {
+            map.put("con",con);
+        }
+        DataChange.queryDataByDateTime(startTime ,endTime, map, sdfDateTime);//根据时间段查询数据
         PageHelper.startPage(pageNum, pageSize);
         List<Map<String, Object>> report = statisticalReportService.getCapacityByDefend(map);
         PageListAdd pageList = columnDataUtil.tableColumnData(apiId, null, report);

+ 1 - 1
src/main/java/com/steerinfo/dil/mapper/StatisticalReportMapper.java

@@ -46,5 +46,5 @@ public interface StatisticalReportMapper {
     //获取装机统计报表
     List<Map<String,Object>> getLoaderResult(Map<String,Object> map);
     //保卫部随机抽查车牌号
-    List<Map<String, Object>> getCapacityByDefend(Map<String, Object> map);
+    List<Map<String, Object>>   getCapacityByDefend(Map<String, Object> map);
 }

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

@@ -3,6 +3,7 @@ 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 oracle.sql.DATE;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -84,7 +85,27 @@ public class StatisticalReportImpl implements IStatisticalReportService {
 
     @Override
     public List<Map<String, Object>> getAllSaleReportNum(Map<String, Object> map) {
-        return statisticalReportMapper.getAllSaleReport(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;
     }
 
     /**

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

@@ -175,7 +175,7 @@ public class TmstruckLeaveFactoryResultServiceImpl implements ITmstruckLeaveFact
         Map<String, Object> mesMap = utilsMapper.getOrderTypeByOrderNumber(orderNumber);
         int orderType = DataChange.dataToBigDecimal(mesMap.get("orderType")).intValue();
         String capacityNumber = (String) mesMap.get("capacityNumber");
-        if(orderType == 11){
+        if(orderType == 11 || orderType == 15 || orderType == 16){
            return orderType11Use(map, mesMap,capacityNumber);
         }else if(orderType == 21){
             return tmstruckEnfactoryResultService.orderType21Use(map, orderNumber, DataChange.dataToBigDecimal(mesMap.get("orderId")));

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

@@ -174,7 +174,7 @@ public class UtilsServiceImpl implements IUtilsService {
 
         //添加消息实体
         HashMap<Object, Object> mesMap = new HashMap<>();
-        mesMap.put("messageType", 5); //用于进厂后 刷新消息
+        mesMap.put("messageType", 4); //用于进厂后 刷新消息
         mesMap.put("sendPerson", "system");
         mesMap.put("receivePerson", capacityNumber);
         mesMap.put("messageContent", pushMes + new Date());

+ 1 - 1
src/main/resources/application-dev.yml

@@ -46,6 +46,6 @@ openfeign:
   AmsFeign:
     url: ${AMSFEIGN_URL:172.16.33.162:8015}
   OTMSFeign:
-    url: ${OTMSFEIGN_URL:172.16.33.166:8087}
+    url: ${OTMSFEIGN_URL:172.16.33.166:8038}
 server:
   port: 8008

+ 1 - 1
src/main/resources/application-prod.yml

@@ -46,6 +46,6 @@ openfeign:
   AmsFeign:
     url: ${AMSFEIGN_URL:172.16.33.166:8079}
   OTMSFeign:
-    url: ${OTMSFEIGN_URL:172.16.33.166:8087}
+    url: ${OTMSFEIGN_URL:172.16.33.166:8038}
 server:
   port: 8088

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

@@ -387,6 +387,9 @@
         <if test="carrierSsoId != null">
             and RC2.CARRIER_SSO_ID = #{carrierSsoId}
         </if>
+        <if test="receivName != null">
+            and RCON.CONSIGNEE_COMPANY_NAME like #{receivName}
+        </if>
         <if test="oneDate != null">
             and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TWR.RESULT_GROSS_WEIGHT_TIME
         </if>
@@ -1487,24 +1490,14 @@
 
 
     <select id="getCapacityByDefend" resultType="java.util.Map" parameterType="java.util.Map">
-        select * from(
+        select distinct * from(
         select rc.CAPACITY_NUMBER "capacityNumber",
-               oo.ORDER_NUMBER "orderNumber",
-               twr.RESULT_GROSS_WEIGHT "resultGrossWeight",
-               twr.RESULT_GROSS_WEIGHT_TIME "resultGrossWeightTime",
-               rtc1.TRUCK_CALCULATE_NUMBER "truckCalculateNumber1",
-               twr.RESULT_TARE_WEIGHT "resultTareWeight",
-               twr.RESULT_TARE_WEIGHT_TIME "resultTareWeightTime",
-               rtc2.TRUCK_CALCULATE_NUMBER "truckCalculateNumber2",
-               twr.RESULT_NET_WEIGHT "resultNetWeight",
-               ter.RESULT_ENTRY_GATE_TIME "resultEntryGateTime",
-               rg1.GATEPOST_NAME "gatepostName1",
-               tlfr.RESULT_OUT_GATE_TIME "resultOutGateTime",
-               rg2.GATEPOST_NAME "gatepostName2",
-               tlr.RESULT_LOAD_END_TIME "resultLoadEndTime",
-               rw1.WAREHOUSE_NAME "warehouseName1",
-               tur.RESULT_END_TIME "resultEndTime",
-               rw2.WAREHOUSE_NAME "warehouseName2"
+        oo.ORDER_NUMBER "orderNumber",
+        ter.RESULT_ENTRY_GATE_TIME "resultEntryGateTime",
+        rg1.GATEPOST_NAME "gatepostName1",
+        tlfr.RESULT_OUT_GATE_TIME "resultOutGateTime",
+        rg2.GATEPOST_NAME "gatepostName2",
+        rm.material_name "materialName"
         from OMSTRUCK_ORDER oo
         left join OMSTRUCK_ORDER_MATERIAL oom
         on oom.ORDER_ID = oo.ORDER_ID
@@ -1514,32 +1507,28 @@
         on rc.CAPACITY_ID = oo.CAPACITY_ID
         left join TMSTRUCK_TOTAL_RESULT ttr
         on ttr.ORDER_ID = oo.ORDER_ID
-        left join TMSTRUCK_WEIGHT_RESULT twr
-        on twr.RESULT_TOTAL_ID = ttr.RESULT_TOTAL_ID
-        left join RMS_TRUCK_CALCULATE rtc1
-        on twr.RESULT_GROSS_PLACE_ID = rtc1.TRUCK_CALCULATE_ID
-        left join RMS_TRUCK_CALCULATE rtc2
-        on twr.RESULT_GROSS_PLACE_ID = rtc2.TRUCK_CALCULATE_ID
         left join TMSTRUCK_ENFACTORY_RESULT ter
         on ter.RESULT_TOTAL_ID = ttr.RESULT_TOTAL_ID
         left join RMS_GATEPOST rg1
         on rg1.GATEPOST_ID = ter.GATEPOST_ID
         left join TMSTRUCK_LEAVE_FACTORY_RESULT tlfr
         on tlfr.RESULT_TOTAL_ID = ttr.RESULT_TOTAL_ID
-        left join  RMS_GATEPOST rg2
+        left join RMS_GATEPOST rg2
         on rg2.GATEPOST_ID = tlfr.GATEPOST_ID
-        left join TMSTRUCK_LOAD_RESULT tlr
-        on tlr.RESULT_TOTAL_ID = ttr.RESULT_TOTAL_ID
-        left join RMS_WAREHOUSE rw1
-        on tlr.LOADING_ID = rw1.WAREHOUSE_ID
-        left join TMSTRUCK_UNLOAD_RESULT tur
-        on tur.RESULT_TOTAL_ID = ttr.RESULT_TOTAL_ID
-        left join RMS_WAREHOUSE rw2
-        on tur.RESULT_UNLOAD_PLACE_ID = rw2.WAREHOUSE_ID
-		where trunc(ter.RESULT_ENTRY_GATE_TIME) =  trunc(sysdate)
-		<if test="con!=null">
-           and instr(rc.CAPACITY_NUMBER , #{con})>0
+        <where>
+        <if test="oneDate != null">
+           and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt; = tlfr.RESULT_OUT_GATE_TIME
+        </if>
+        <if test="startDate != null" >
+           and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt; = tlfr.RESULT_OUT_GATE_TIME
         </if>
+        <if test="endDate != null" >
+            and to_date(#{endDate},'yyyy-mm-dd hh24:mi:ss') >= tlfr.RESULT_OUT_GATE_TIME
+        </if>
+        <if test="con != null">
+            and (instr(rc.CAPACITY_NUMBER, #{con}) > 0 or instr(rg1.GATEPOST_NAME, #{con}) > 0 or instr(rg2.GATEPOST_NAME, #{con}) > 0 )
+        </if>
+        </where>
 		order by ter.RESULT_ENTRY_GATE_TIME desc
 		)
 		<where>

+ 3 - 0
src/main/resources/com/steerinfo/dil/mapper/TmstruckTimeTaskResultMapper.xml

@@ -673,6 +673,7 @@
     CONCAT(TTTR.RESULT_VALUE,RUOM.UNIT_OF_MEASURE_NAME) AS "resultTime",
     RCT.CAPACITY_TYPE_NAME "capacityTypeName",
     TTTR.INSERT_TIME "insertTime",
+    RP.PERSONNEL_NAME  "personName",
     (
     SELECT TTTR2.RESULT_TIME
     FROM TMSTRUCK_TIME_TASK_RESULT TTTR2
@@ -716,6 +717,8 @@
     ON TTR.ORDER_ID=OO.ORDER_ID
     LEFT JOIN TMSTRUCK_TIME_TASK_RESULT TTTR
     ON TTR.RESULT_TOTAL_ID=TTTR.RESULT_TOTAL_ID
+    LEFT JOIN RMS_PERSONNEL RP
+    ON RP.PERSONNEL_SSO_ID=TTTR.INSERT_USERNAME
     LEFT JOIN RMS_UNIT_OF_MEASURE RUOM
     ON TTTR.RESULT_UOM_ID=RUOM.UNIT_OF_MEASURE_ID
     LEFT JOIN RMS_CAPACITY RC