liyg 2 years ago
parent
commit
baa1df81f5

+ 21 - 7
src/main/java/com/steerinfo/dil/controller/StatisticalReportController.java

@@ -114,7 +114,9 @@ public class StatisticalReportController extends BaseRESTfulController {
             mapValue.put("orderField","materialCode");
             mapValue.put("orderType","desc");
         }
-        PageHelper.startPage(pageNum, pageSize);
+        if(mapValue.get("isExcel")==null){
+            PageHelper.startPage(pageNum, pageSize);
+        }
         //分页数据
         List<Map<String, Object>> report = statisticalReportService.getAllSaleReport(mapValue);
         PageListAdd pageList = columnDataUtil.tableColumnData5(apiId, null, report);
@@ -239,7 +241,9 @@ public class StatisticalReportController extends BaseRESTfulController {
         if (con!=null&&!"null".equals(con)){
             mapValue.put("con","%"+con+"%");
         }
-        PageHelper.startPage(pageNum, pageSize);
+        if(mapValue.get("isExcel")==null){
+            PageHelper.startPage(pageNum, pageSize);
+        }
         //分页数据
         List<Map<String, Object>> report = statisticalReportService.getSporadicSuppliesReport1(mapValue);
         PageListAdd pageList = columnDataUtil.tableColumnData4(apiId, null, report);
@@ -285,7 +289,9 @@ public class StatisticalReportController extends BaseRESTfulController {
         if (userIds!=null){
             mapValue.put("userIds",userIds);
         }
-        PageHelper.startPage(pageNum, pageSize);
+        if(mapValue.get("isExcel")==null){
+            PageHelper.startPage(pageNum, pageSize);
+        }
         //分页数据
         List<Map<String, Object>> report = statisticalReportService.getSporadicSuppliesReport2(mapValue);
         PageListAdd pageList = columnDataUtil.tableColumnData4(apiId, null, report);
@@ -337,7 +343,9 @@ public class StatisticalReportController extends BaseRESTfulController {
         if(con != null && !"null".equals(con)){
             mapValue.put("con","%" + con + "%");
         }
-        PageHelper.startPage(pageNum, pageSize);
+        if(mapValue.get("isExcel")==null){
+            PageHelper.startPage(pageNum, pageSize);
+        }
         //分页数据
         List<Map<String, Object>> report = statisticalReportService.getLXInwardReport(mapValue);
         PageListAdd pageList = columnDataUtil.tableColumnData(apiId, null, report);
@@ -630,7 +638,9 @@ public class StatisticalReportController extends BaseRESTfulController {
                                     String startTime,
                                     String endTime){
         DataChange.queryDataByDateTime(startTime, endTime, mapValue, sdfDateTime);//根据时间段查询数据
-        PageHelper.startPage(pageNum, pageSize);
+        if(mapValue.get("isExcel")==null){
+            PageHelper.startPage(pageNum, pageSize);
+        }
         //分页数据
         List<Map<String, Object>> report = statisticalReportService.getLoading(mapValue);
         PageListAdd pageList = columnDataUtil.tableColumnData(apiId, null, report);
@@ -647,7 +657,9 @@ public class StatisticalReportController extends BaseRESTfulController {
                                     String startTime,
                                     String endTime){
         DataChange.queryDataByDateTime(startTime, endTime, mapValue, sdfDateTime);//根据时间段查询数据
-        PageHelper.startPage(pageNum, pageSize);
+        if(mapValue.get("isExcel")==null){
+            PageHelper.startPage(pageNum, pageSize);
+        }
         //分页数据
         List<Map<String, Object>> report = statisticalReportService.getLoaderResult(mapValue);
         PageListAdd pageList = columnDataUtil.tableColumnData(apiId, null, report);
@@ -663,7 +675,9 @@ public class StatisticalReportController extends BaseRESTfulController {
                                     String startTime,
                                     String endTime){
         DataChange.queryDataByDateTime(startTime, endTime, mapValue, sdfDateTime);//根据时间段查询数据
-        PageHelper.startPage(pageNum, pageSize);
+        if(mapValue.get("isExcel")==null){
+            PageHelper.startPage(pageNum, pageSize);
+        }
         //分页数据
         List<Map<String, Object>> report = statisticalReportService.getUnLoading(mapValue);
         PageListAdd pageList = columnDataUtil.tableColumnData(apiId, null, report);

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

@@ -34,6 +34,9 @@ public interface TmstruckTimeTaskResultMapper extends IBaseMapper<TmstruckTimeTa
     //查询计时(计次)作业
     List<Map<String, Object>> getAllTimeTaskResult(Map<String, Object> map);
 
+    //删除错误计时实绩
+    int deleteErrorTimeTaskResult();
+
     //根据运输订单号查找需要用车时长
     Map<String,Object>  selectInwardDueTimeByOrderId(BigDecimal orderId);
 

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

@@ -281,7 +281,18 @@ public class TmstruckTimeTaskResultServiceImpl implements ITmstruckTimeTaskResul
      */
     @Override
     public List<Map<String, Object>> getAllTimeTaskResult(Map<String, Object> map) {
-        return tmstruckTimeTaskResultMapper.getAllTimeTaskResult(map);
+        List<Map<String, Object>> result=null;
+        try{
+            System.out.println(result.toString());
+            result = tmstruckTimeTaskResultMapper.getAllTimeTaskResult(map);
+        }catch (Exception e){
+            int i=3;
+            while (i-->0 && tmstruckTimeTaskResultMapper.deleteErrorTimeTaskResult() > 0){
+                //查询错误则删除错误计时数据,返回0或者执行3次后结束
+            }
+            result = tmstruckTimeTaskResultMapper.getAllTimeTaskResult(map);
+        }
+        return result;
     }
 
     /**

+ 16 - 2
src/main/resources/com/steerinfo/dil/mapper/TmstruckTimeTaskResultMapper.xml

@@ -653,7 +653,7 @@
     </foreach>
   </delete>
 
-  <!-- 友情提示!!!-->
+    <!-- 友情提示!!!-->
   <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
   <!--  通过运输订单号查询总实绩ID -->
   <select id="getResultTotalIdByOrderNum" resultType="java.util.Map">
@@ -961,5 +961,19 @@
     ORDER BY TTTR.RESULT_TIME DESC
     FETCH NEXT 1 ROWS ONLY
   </select>
-
+  <delete id="deleteErrorTimeTaskResult">
+    DELETE FROM TMSTRUCK_TIME_TASK_RESULT
+    WHERE TIME_TASK_RESULT_ID IN
+    (
+      SELECT MIN(TIME_TASK_RESULT_ID)
+      FROM TMSTRUCK_TIME_TASK_RESULT
+      WHERE RESULT_TOTAL_ID IN
+          (
+            SELECT RESULT_TOTAL_ID
+            FROM TMSTRUCK_TIME_TASK_RESULT WHERE RESULT_TIME_TYPE = 3
+            GROUP BY RESULT_TOTAL_ID HAVING COUNT(TIME_TASK_RESULT_ID) > 1
+          )
+      GROUP BY RESULT_TOTAL_ID
+    )
+  </delete>
 </mapper>