Преглед на файлове

修改内转统计报表和零星统计报表

zx преди 3 години
родител
ревизия
2f68ba08b6

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

@@ -65,6 +65,7 @@ public class StatisticalReportController extends BaseRESTfulController {
         return success(pageList);
     }
 
+
     @ApiOperation(value="查询销售统计报表")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
@@ -220,4 +221,33 @@ 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", 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("/getPurInwardReport")
+    public RESTfulResult getPurInwardReport(@RequestBody(required=false) Map<String,Object> mapValue,
+                                                    Integer apiId,
+                                                    Integer pageNum,
+                                                    Integer pageSize,
+                                                    String startTime,
+                                                    String endTime,
+                                                    String con
+    ){
+        DataChange.queryDataByDate(startTime, endTime, mapValue, sdfDate);//根据时间段查询数据
+        if (con!=null&&!con.equals("undefined")){
+            mapValue.put("con","%"+con+"%");
+        }
+        List<Map<String, Object>> allReport =  statisticalReportService.getPurInwardReport(mapValue);
+        PageHelper.startPage(pageNum, pageSize);
+        //分页数据
+        List<Map<String, Object>> report = statisticalReportService.getPurInwardReport(mapValue);
+        PageListAdd pageList = columnDataUtil.tableColumnData(apiId, allReport, report);
+        return success(pageList);
+    }
 }

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

@@ -23,4 +23,10 @@ public interface StatisticalReportMapper {
 
     //    查询零星物资出厂统计报表
     List<Map<String, Object>> getSporadicSuppliesReport2(Map<String, Object> mapValue);
+
+    // 查询采购内转统计报表
+    List<Map<String, Object>> getTotalResultList();
+
+    List<Map<String, Object>> getInwardReportResult(Map<String, Object> mapValue);
+
 }

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

@@ -32,5 +32,7 @@ public interface IStatisticalReportService {
     List<Map<String, Object>> getSporadicSuppliesReportNum2(Map<String, Object> mapValue);
     //    查询零星物资统计报表
     List<Map<String, Object>> getSporadicSuppliesReport2(Map<String, Object> mapValue);
+
+    List<Map<String, Object>> getPurInwardReport(Map<String, Object> mapValue);
 }
 

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

@@ -6,6 +6,7 @@ import com.steerinfo.dil.util.DataChange;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.math.BigDecimal;
 import java.util.Date;
 import java.util.List;
 import java.util.Map;
@@ -115,4 +116,23 @@ public class StatisticalReportImpl implements IStatisticalReportService {
         }
         return mapList;
     }
+
+    //采购内转统计报表
+    @Override
+    public List<Map<String, Object>> getPurInwardReport(Map<String, Object> mapValue) {
+        //查询出所有订单类型为10的采购内转订单总实绩id集合
+        List<Map<String,Object>> inwardReport=null;
+        List<Map<String,Object>> totalResultList = statisticalReportMapper.getTotalResultList();
+        for (Map<String,Object>maptotal:totalResultList
+        ) {
+            //遍历总实绩,根据总实绩id获取所有采购内转统计报表
+            mapValue.put("totalId",maptotal.get("totalId"));
+            List<Map<String, Object>> inwardReportResult = statisticalReportMapper.getInwardReportResult(mapValue);
+            for (Map<String,Object> map1:inwardReportResult) {
+                calculateDifferenceTime(map1);
+                inwardReport.add(map1);
+            }
+        }
+        return inwardReport;
+    }
 }

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

@@ -507,6 +507,18 @@
                     "resultOutGateTime" like '%${item}%'
                 </foreach>
             </if>
+            <if test="gatepostEntryName != null">
+                and
+                <foreach collection="gatepostEntryName" item="item" open="(" separator="or" close=")">
+                    "gatepostEntryName" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="gatepostOutName != null">
+                and
+                <foreach collection="gatepostOutName" item="item" open="(" separator="or" close=")">
+                    "gatepostOutName" like '%${item}%'
+                </foreach>
+            </if>
         </where>
         <include refid="orderBy"></include>
         <if test="orderField == null">
@@ -688,10 +700,31 @@
                     "resultOutGateTime" like '%${item}%'
                 </foreach>
             </if>
+            <if test="gatepostEntryName != null">
+                and
+                <foreach collection="gatepostEntryName" item="item" open="(" separator="or" close=")">
+                    "gatepostEntryName" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="gatepostOutName != null">
+                and
+                <foreach collection="gatepostOutName" item="item" open="(" separator="or" close=")">
+                    "gatepostOutName" like '%${item}%'
+                </foreach>
+            </if>
         </where>
         <include refid="orderBy"></include>
         <if test="orderField == null">
             order by "resultOutGateTime" desc, "resultEntryGateTime" desc
         </if>
     </select>
+    <select id="getTotalResultList" resultType="java.util.Map">
+        SELECT DISTINCT
+            TTR.RESULT_TOTAL_ID "totalId"
+        FROM
+            TMSTRUCK_TOTAL_RESULT TTR
+                LEFT JOIN OMSTRUCK_ORDER OO ON OO.ORDER_ID = TTR.ORDER_ID
+        WHERE
+            OO.ORDER_TYPE = 10
+    </select>
 </mapper>

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

@@ -1381,7 +1381,7 @@
    <if test="userId !=null">
       and AIR.INSERT_USERNAME = #{userId}
    </if>
-    order by tlfr.result_out_gate_time
+    order by tlfr.result_out_gate_time desc
         <where>
             <if test="capacityNumber != null">
                 <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">