فهرست منبع

零星报表增加

hujh 3 سال پیش
والد
کامیت
cb3395ce71

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

@@ -74,7 +74,7 @@ public class StatisticalReportController extends BaseRESTfulController {
                                        String carrierSsoId
     ){
         if(carrierSsoId != null){
-            if("null".equals(carrierSsoId)){
+            if(!"null".equals(carrierSsoId)){
                 mapValue.put("carrierSsoId", carrierSsoId);
             }
         }
@@ -85,4 +85,60 @@ public class StatisticalReportController extends BaseRESTfulController {
         PageListAdd pageList = columnDataUtil.tableColumnData(apiId, allReport, report);
         return success(pageList);
     }
+
+    @ApiOperation(value="查询零星物资进厂统计报表")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
+            @ApiImplicitParam(name = "apiId(424)", 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("/getSporadicSuppliesReport1")
+    public RESTfulResult getSporadicSuppliesReport1(@RequestBody(required=false) Map<String,Object> mapValue,
+                                          Integer apiId,
+                                          Integer pageNum,
+                                          Integer pageSize,
+                                          String carrierSsoId
+    ){
+        if(carrierSsoId != null){
+            if(!"null".equals(carrierSsoId)){
+                mapValue.put("carrierSsoId", carrierSsoId);
+            }
+        }
+        List<Map<String, Object>> allReport =  statisticalReportService.getSporadicSuppliesReportNum1(mapValue);
+        PageHelper.startPage(pageNum, pageSize);
+        //分页数据
+        List<Map<String, Object>> report = statisticalReportService.getSporadicSuppliesReport1(mapValue);
+        PageListAdd pageList = columnDataUtil.tableColumnData(apiId, allReport, report);
+        return success(pageList);
+    }
+
+    @ApiOperation(value="查询零星物资出厂统计报表")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
+            @ApiImplicitParam(name = "apiId(425)", 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("/getSporadicSuppliesReport2")
+    public RESTfulResult getSporadicSuppliesReport2(@RequestBody(required=false) Map<String,Object> mapValue,
+                                                   Integer apiId,
+                                                   Integer pageNum,
+                                                   Integer pageSize,
+                                                   String carrierSsoId
+    ){
+        if(carrierSsoId != null){
+            if("null".equals(carrierSsoId)){
+                mapValue.put("carrierSsoId", carrierSsoId);
+            }
+        }
+        List<Map<String, Object>> allReport =  statisticalReportService.getSporadicSuppliesReportNum2(mapValue);
+        PageHelper.startPage(pageNum, pageSize);
+        //分页数据
+        List<Map<String, Object>> report = statisticalReportService.getSporadicSuppliesReport2(mapValue);
+        PageListAdd pageList = columnDataUtil.tableColumnData(apiId, allReport, report);
+        return success(pageList);
+    }
 }

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

@@ -17,4 +17,10 @@ public interface StatisticalReportMapper {
 
     //查询销售统计报表
     List<Map<String, Object>> getAllSaleReport(Map<String, Object> map);
+
+//    查询零星物资进厂统计报表
+    List<Map<String, Object>> getSporadicSuppliesReport1(Map<String, Object> mapValue);
+
+    //    查询零星物资进厂统计报表
+    List<Map<String, Object>> getSporadicSuppliesReport2(Map<String, Object> mapValue);
 }

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

@@ -22,4 +22,15 @@ public interface IStatisticalReportService {
 
     //查询销售统计报表
     List<Map<String, Object>> getAllSaleReportNum(Map<String, Object> map);
+
+//    查询零星物资统计报表
+    List<Map<String, Object>> getSporadicSuppliesReportNum1(Map<String, Object> mapValue);
+//    查询零星物资统计报表
+    List<Map<String, Object>> getSporadicSuppliesReport1(Map<String, Object> mapValue);
+
+    //    查询零星物资统计报表
+    List<Map<String, Object>> getSporadicSuppliesReportNum2(Map<String, Object> mapValue);
+    //    查询零星物资统计报表
+    List<Map<String, Object>> getSporadicSuppliesReport2(Map<String, Object> mapValue);
 }
+

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

@@ -64,6 +64,7 @@ public class StatisticalReportImpl implements IStatisticalReportService {
      */
     @Override
     public List<Map<String, Object>> getAllSaleReport(Map<String, Object> map) {
+        System.out.println(statisticalReportMapper.getAllSaleReport(map));
         List<Map<String, Object>> mapList = statisticalReportMapper.getAllSaleReport(map);
         for (Map<String, Object> mesMap : mapList) {
             calculateDifferenceTime(mesMap);
@@ -76,4 +77,37 @@ public class StatisticalReportImpl implements IStatisticalReportService {
         return statisticalReportMapper.getAllSaleReport(map);
     }
 
+    /**
+     * 查询零星物资进厂统计报表
+     */
+    @Override
+    public List<Map<String, Object>> getSporadicSuppliesReportNum1(Map<String, Object> mapValue) {
+        return statisticalReportMapper.getSporadicSuppliesReport1(mapValue);
+    }
+
+    @Override
+    public List<Map<String, Object>> getSporadicSuppliesReport1(Map<String, Object> mapValue) {
+        List<Map<String, Object>> mapList = statisticalReportMapper.getSporadicSuppliesReport1(mapValue);
+        for (Map<String, Object> mesMap : mapList) {
+            calculateDifferenceTime(mesMap);
+        }
+        return mapList;
+    }
+
+    /**
+     * 查询零星物资出厂统计报表
+     */
+    @Override
+    public List<Map<String, Object>> getSporadicSuppliesReportNum2(Map<String, Object> mapValue) {
+        return statisticalReportMapper.getSporadicSuppliesReport1(mapValue);
+    }
+
+    @Override
+    public List<Map<String, Object>> getSporadicSuppliesReport2(Map<String, Object> mapValue) {
+        List<Map<String, Object>> mapList = statisticalReportMapper.getSporadicSuppliesReport2(mapValue);
+        for (Map<String, Object> mesMap : mapList) {
+            calculateDifferenceTime(mesMap);
+        }
+        return mapList;
+    }
 }

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

@@ -219,4 +219,262 @@
             order by "resultOutGateTime" desc, "resultEntryGateTime" desc
         </if>
     </select>
+<!--    查询零星进厂物资统计报表-->
+    <select id="getSporadicSuppliesReport1" resultType="java.util.Map">
+        select
+        *
+        from (
+        select 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",
+        TUR.RESULT_END_TIME     "resultEndTime",
+        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",
+--         查询进厂门岗
+        RG2.GATEPOST_NAME "gatepostEntryName",
+--         出厂门岗
+        RG.GATEPOST_NAME "gatepostOutName",
+--         计皮汽车衡
+        RTC1.TRUCK_CALCULATE_NUMBER "truckTareCalculate",
+--         计毛汽车衡
+        RTC2.TRUCK_CALCULATE_NUMBER "truckCrossCalculate"
+        from OMSTRUCK_ORDER OO
+        join TMSTRUCK_TOTAL_RESULT TTR
+        on TTR.ORDER_ID = OO.ORDER_ID
+        join TMSTRUCK_UNLOAD_RESULT TUR
+        on TUR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
+        join RMS_WAREHOUSE RW
+        on RW.WAREHOUSE_ID = TUR.RESULT_UNLOAD_PLACE_ID
+        join TMSTRUCK_WEIGHT_RESULT TWR
+        on TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
+            join RMS_TRUCK_CALCULATE RTC2
+            on RTC2.TRUCK_CALCULATE_ID = TWR.GROSS_SEGMENT_SQE
+            join RMS_TRUCK_CALCULATE RTC1
+            on RTC1.TRUCK_CALCULATE_ID = TWR.TARE_SEGMENT_SQE
+        join TMSTRUCK_ENFACTORY_RESULT TER
+        on TER.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
+            join RMS_GATEPOST RG2
+            on RG2.GATEPOST_ID =TER.GATEPOST_ID
+        join TMSTRUCK_LEAVE_FACTORY_RESULT TLFR
+        on TLFR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
+        join RMS_GATEPOST RG
+            on TLFR.GATEPOST_ID =RG.GATEPOST_ID
+        join RMS_CAPACITY RC
+        on RC.CAPACITY_ID = OO.CAPACITY_ID
+        <if test="carrierSsoId != null">
+            join RMS_CARRIER RCA
+            on RCA.CARRIER_ID = RC.CARRIER_ID
+        </if>
+        where OO.ORDER_TYPE = 12
+        <if test="carrierSsoId != null">
+            and RCA.CARRIER_SSO_ID = #{carrierSsoId}
+        </if>
+        and TO_CHAR(TLFR.RESULT_OUT_GATE_TIME, 'YYYY-MM-DD') = TO_CHAR(SYSDATE, 'YYYY-MM-DD')
+        )
+        <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="resultTareWeightTime != null">
+                and
+                <foreach collection="resultTareWeightTime" item="item" open="(" separator="or" close=")">
+                    "resultTareWeightTime" 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="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="resultGrossWeightTime != null">
+                and
+                <foreach collection="resultGrossWeightTime" item="item" open="(" separator="or" close=")">
+                    "resultGrossWeightTime" 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="resultNetWeight != null">
+                and
+                <foreach collection="resultNetWeight" item="item" open="(" separator="or" close=")">
+                    "resultNetWeight" 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 "resultOutGateTime" desc, "resultEntryGateTime" desc
+        </if>
+    </select>
+<!--    查询零星出厂物资统计报表-->
+    <select id="getSporadicSuppliesReport2" resultType="java.util.Map">
+        select
+        *
+        from (
+        select 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",
+--         查询进厂门岗
+        RG2.GATEPOST_NAME "gatepostEntryName",
+        --         出厂门岗
+        RG.GATEPOST_NAME "gatepostOutName",
+        --         计皮汽车衡
+        RTC1.TRUCK_CALCULATE_NUMBER "truckTareCalculate",
+        --         计毛汽车衡
+        RTC2.TRUCK_CALCULATE_NUMBER "truckCrossCalculate"
+        from OMSTRUCK_ORDER OO
+        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
+        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
+        join RMS_TRUCK_CALCULATE RTC2
+        on RTC2.TRUCK_CALCULATE_ID = TWR.GROSS_SEGMENT_SQE
+        join RMS_TRUCK_CALCULATE RTC1
+        on RTC1.TRUCK_CALCULATE_ID = TWR.TARE_SEGMENT_SQE
+        join TMSTRUCK_ENFACTORY_RESULT TER
+        on TER.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
+        join RMS_GATEPOST RG2
+        on RG2.GATEPOST_ID =TER.GATEPOST_ID
+        join TMSTRUCK_LEAVE_FACTORY_RESULT TLFR
+        on TLFR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
+        join RMS_GATEPOST RG
+        on TLFR.GATEPOST_ID =RG.GATEPOST_ID
+        join RMS_CAPACITY RC
+        on RC.CAPACITY_ID = OO.CAPACITY_ID
+        <if test="carrierSsoId != null">
+            join RMS_CARRIER RCA
+            on RCA.CARRIER_ID = RC.CARRIER_ID
+        </if>
+        where OO.ORDER_TYPE = 13
+        <if test="carrierSsoId != null">
+            and RCA.CARRIER_SSO_ID = #{carrierSsoId}
+        </if>
+        and TO_CHAR(TLFR.RESULT_OUT_GATE_TIME, 'YYYY-MM-DD') = TO_CHAR(SYSDATE, 'YYYY-MM-DD')
+        )
+        <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="resultTareWeightTime != null">
+                and
+                <foreach collection="resultTareWeightTime" item="item" open="(" separator="or" close=")">
+                    "resultTareWeightTime" 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="resultLoadEndTime != null">
+                and
+                <foreach collection="resultLoadEndTime" item="item" open="(" separator="or" close=")">
+                    "resultLoadEndTime" 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="resultGrossWeightTime != null">
+                and
+                <foreach collection="resultGrossWeightTime" item="item" open="(" separator="or" close=")">
+                    "resultGrossWeightTime" 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="resultNetWeight != null">
+                and
+                <foreach collection="resultNetWeight" item="item" open="(" separator="or" close=")">
+                    "resultNetWeight" 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 "resultOutGateTime" desc, "resultEntryGateTime" desc
+        </if>
+    </select>
 </mapper>