Compare commits
No commits in common. "175bd4d7bf9a0d53470a0154b24a6154fc0e31a4" and "2ad627983b589af7bbb2d9c4e23edaa7b238b1b8" have entirely different histories.
175bd4d7bf
...
2ad627983b
|
|
@ -65,12 +65,6 @@ public interface SupervisionStatisticsMapper {
|
||||||
@SuppressWarnings("MybatisXMapperMethodInspection")
|
@SuppressWarnings("MybatisXMapperMethodInspection")
|
||||||
List<Map<String, Object>> dataTable();
|
List<Map<String, Object>> dataTable();
|
||||||
|
|
||||||
@SuppressWarnings("MybatisXMapperMethodInspection")
|
|
||||||
Map<String, Object> todayAuditPassStatistics();
|
|
||||||
|
|
||||||
@SuppressWarnings("MybatisXMapperMethodInspection")
|
|
||||||
List<Map<String, Object>> stationStatistics();
|
|
||||||
|
|
||||||
Integer getTotalCarCount();
|
Integer getTotalCarCount();
|
||||||
|
|
||||||
@SuppressWarnings("MybatisXMapperMethodInspection")
|
@SuppressWarnings("MybatisXMapperMethodInspection")
|
||||||
|
|
|
||||||
|
|
@ -254,16 +254,6 @@ public class SupervisionStatisticsService {
|
||||||
log.error("数据获取失败", ex);
|
log.error("数据获取失败", ex);
|
||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
});
|
});
|
||||||
CompletableFuture<Map<String, Object>> todayAuditPassStatisticsFuture = CompletableFuture.supplyAsync(supervisionStatisticsMapper::todayAuditPassStatistics, threadPoolExecutor)
|
|
||||||
.exceptionally(ex -> {
|
|
||||||
log.error("数据获取失败", ex);
|
|
||||||
return Collections.emptyMap();
|
|
||||||
});
|
|
||||||
CompletableFuture<List<Map<String, Object>>> stationStatisticsFuture = CompletableFuture.supplyAsync(supervisionStatisticsMapper::stationStatistics, threadPoolExecutor)
|
|
||||||
.exceptionally(ex -> {
|
|
||||||
log.error("数据获取失败", ex);
|
|
||||||
return Collections.emptyList();
|
|
||||||
});
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Map<String, Object> dataStatistics = dataStatisticsFuture.get();
|
Map<String, Object> dataStatistics = dataStatisticsFuture.get();
|
||||||
|
|
@ -278,8 +268,6 @@ public class SupervisionStatisticsService {
|
||||||
Map<String, Object> transStatistics = transStatisticsFuture.get();
|
Map<String, Object> transStatistics = transStatisticsFuture.get();
|
||||||
Map<String, Object> weightStatistics = weightStatisticsFuture.get();
|
Map<String, Object> weightStatistics = weightStatisticsFuture.get();
|
||||||
List<Map<String, Object>> dataTable = dataTableFuture.get();
|
List<Map<String, Object>> dataTable = dataTableFuture.get();
|
||||||
Map<String, Object> todayAuditPassStatistics = todayAuditPassStatisticsFuture.get();
|
|
||||||
List<Map<String, Object>> stationStatistics = stationStatisticsFuture.get();
|
|
||||||
return MapUtil.<String, Object>builder()
|
return MapUtil.<String, Object>builder()
|
||||||
.put("dataStatistics", dataStatistics)
|
.put("dataStatistics", dataStatistics)
|
||||||
.put("warnTruck", warnTruck)
|
.put("warnTruck", warnTruck)
|
||||||
|
|
@ -293,8 +281,6 @@ public class SupervisionStatisticsService {
|
||||||
.put("userStatistics", userStatistics)
|
.put("userStatistics", userStatistics)
|
||||||
.put("weightStatistics", weightStatistics)
|
.put("weightStatistics", weightStatistics)
|
||||||
.put("dataTable", dataTable)
|
.put("dataTable", dataTable)
|
||||||
.put("todayAuditPassStatistics", todayAuditPassStatistics)
|
|
||||||
.put("stationStatistics", stationStatistics)
|
|
||||||
.build();
|
.build();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw Exceptions.exception(e, "数据获取失败");
|
throw Exceptions.exception(e, "数据获取失败");
|
||||||
|
|
|
||||||
|
|
@ -469,85 +469,4 @@
|
||||||
WHERE a.biz_obj IN ('WuYe', 'ShiGongDanWei', 'ChaiQian', 'SheQu')
|
WHERE a.biz_obj IN ('WuYe', 'ShiGongDanWei', 'ChaiQian', 'SheQu')
|
||||||
AND a.deleted = 0
|
AND a.deleted = 0
|
||||||
</select>
|
</select>
|
||||||
<select id="todayAuditPassStatistics" resultType="java.util.Map">
|
|
||||||
SELECT MAX(IF(t_ = 1, c_, 0)) todayCfPassCount,
|
|
||||||
MAX(IF(t_ = 2, c_, 0)) todayTransPassCount,
|
|
||||||
MAX(IF(t_ = 3, c_, 0)) todayDriverPassCount,
|
|
||||||
MAX(IF(t_ = 4, c_, 0)) todayTruckPassCount
|
|
||||||
FROM (SELECT COUNT(*) c_, 1 t_
|
|
||||||
FROM biz_company bc
|
|
||||||
LEFT JOIN sys_user su ON su.id = bc.user_id
|
|
||||||
WHERE bc.deleted = 0
|
|
||||||
AND bc.audit_status = 'TongGuo'
|
|
||||||
AND su.biz_obj IN ('GeRen', 'WuYe', 'ShiGongDanWei', 'ChaiQian', 'SheQu')
|
|
||||||
AND bc.create_time >= CURDATE()
|
|
||||||
AND bc.create_time < DATE_ADD(CURDATE(), INTERVAL 1 DAY)
|
|
||||||
UNION ALL
|
|
||||||
SELECT COUNT(*) c_, 2 t_
|
|
||||||
FROM biz_company bc
|
|
||||||
LEFT JOIN sys_user su ON su.id = bc.user_id
|
|
||||||
WHERE bc.deleted = 0
|
|
||||||
AND bc.audit_status = 'TongGuo'
|
|
||||||
AND su.biz_obj IN ('QiYe', 'GeTi')
|
|
||||||
AND bc.create_time >= CURDATE()
|
|
||||||
AND bc.create_time < DATE_ADD(CURDATE(), INTERVAL 1 DAY)
|
|
||||||
UNION ALL
|
|
||||||
SELECT COUNT(*) c_, 3 t_
|
|
||||||
FROM biz_driver bd
|
|
||||||
WHERE bd.deleted = 0
|
|
||||||
AND bd.audit_status = 'TongGuo'
|
|
||||||
AND bd.create_time >= CURDATE()
|
|
||||||
AND bd.create_time < DATE_ADD(CURDATE(), INTERVAL 1 DAY)
|
|
||||||
UNION ALL
|
|
||||||
SELECT COUNT(*) c_, 4 t_
|
|
||||||
FROM biz_truck bt
|
|
||||||
WHERE bt.deleted = 0
|
|
||||||
AND bt.audit_status = 'TongGuo'
|
|
||||||
AND bt.create_time >= CURDATE()
|
|
||||||
AND bt.create_time < DATE_ADD(CURDATE(), INTERVAL 1 DAY)) t
|
|
||||||
</select>
|
|
||||||
<select id="stationStatistics" resultType="java.util.Map">
|
|
||||||
SELECT bc.id stationId,
|
|
||||||
IFNULL(bc.station_name, bc.company_name) stationName,
|
|
||||||
IFNULL(t1.todayCarCount, 0) todayCarCount,
|
|
||||||
IFNULL(t2.monthCarCount, 0) monthCarCount,
|
|
||||||
IFNULL(t1.todayWeight, 0) todayWeight,
|
|
||||||
IFNULL(t2.monthWeight, 0) monthWeight,
|
|
||||||
IFNULL(t1.todayMonthIncome, 0) todayMonthIncome,
|
|
||||||
IFNULL( t1.todayBalanceIncome, 0) todayBalanceIncome,
|
|
||||||
IFNULL(t1.todayCashIncome, 0) todayCashIncome
|
|
||||||
FROM biz_company bc
|
|
||||||
LEFT JOIN (SELECT station_id,
|
|
||||||
COUNT(*) todayCarCount,
|
|
||||||
ROUND(IFNULL(SUM(oci.settle_weight) / 1000, 0), 2) todayWeight,
|
|
||||||
IFNULL(SUM(CASE
|
|
||||||
WHEN settlement_way = 'month' THEN IFNULL(oi.settle_money, 0)
|
|
||||||
ELSE 0 END), 0) todayMonthIncome,
|
|
||||||
IFNULL( SUM( CASE WHEN settlement_way = 'balance' THEN IFNULL( oi.settle_money, 0)
|
|
||||||
ELSE 0 END), 0) todayBalanceIncome,
|
|
||||||
IFNULL(SUM(CASE
|
|
||||||
WHEN settlement_way = 'cash' THEN IFNULL(oi.settle_money, 0)
|
|
||||||
ELSE 0 END), 0) todayCashIncome
|
|
||||||
FROM order_info oi
|
|
||||||
INNER JOIN order_car_in_out oci ON oci.id = oi.car_in_out_id
|
|
||||||
WHERE oi.deleted = 0
|
|
||||||
AND oi.order_status = 'YiWanCheng'
|
|
||||||
AND oi.station_id IS NOT NULL
|
|
||||||
AND oci.out_time >= CURDATE()
|
|
||||||
AND oci.out_time < DATE_ADD(CURDATE(), INTERVAL 1 DAY)
|
|
||||||
GROUP BY station_id) t1 ON t1.station_id = bc.id
|
|
||||||
LEFT JOIN (SELECT station_id,
|
|
||||||
COUNT(*) monthCarCount,
|
|
||||||
ROUND(IFNULL(SUM(oci.settle_weight) / 1000, 0), 2) monthWeight
|
|
||||||
FROM order_info oi
|
|
||||||
INNER JOIN order_car_in_out oci ON oci.id = oi.car_in_out_id
|
|
||||||
WHERE oi.deleted = 0
|
|
||||||
AND oi.order_status = 'YiWanCheng'
|
|
||||||
AND oi.station_id IS NOT NULL
|
|
||||||
AND oci.out_time >= DATE_FORMAT(NOW(), '%Y-%m-01 00:00:00')
|
|
||||||
AND oci.out_time < DATE_ADD(DATE_FORMAT(NOW(), '%Y-%m-01'), INTERVAL 1 MONTH)
|
|
||||||
GROUP BY station_id) t2 ON t2.station_id = bc.id
|
|
||||||
WHERE bc.station = 1
|
|
||||||
AND bc.deleted = 0
|
|
||||||
</select>
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue