localizer
parent
9febbb1874
commit
80c60840f1
|
|
@ -56,6 +56,12 @@ public interface SupervisionStatisticsMapper {
|
||||||
@SuppressWarnings("MybatisXMapperMethodInspection")
|
@SuppressWarnings("MybatisXMapperMethodInspection")
|
||||||
Map<String, Object> userStatistics();
|
Map<String, Object> userStatistics();
|
||||||
|
|
||||||
|
@SuppressWarnings("MybatisXMapperMethodInspection")
|
||||||
|
Map<String, Object> activeProjectStatistics();
|
||||||
|
|
||||||
|
@SuppressWarnings("MybatisXMapperMethodInspection")
|
||||||
|
Map<String, Object> transStatistics();
|
||||||
|
|
||||||
@SuppressWarnings("MybatisXMapperMethodInspection")
|
@SuppressWarnings("MybatisXMapperMethodInspection")
|
||||||
List<Map<String, Object>> dataTable();
|
List<Map<String, Object>> dataTable();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -183,7 +183,7 @@ public class SupervisionStatisticsService {
|
||||||
});
|
});
|
||||||
|
|
||||||
for (long l = 0; l < days; l++) {
|
for (long l = 0; l < days; l++) {
|
||||||
LocalDateTime localDateTime = startTime.plusYears(l);
|
LocalDateTime localDateTime = startTime.plusDays(l);
|
||||||
String day = localDateTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
String day = localDateTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
||||||
List<Map<String, Object>> dayData = timepointMap.getOrDefault(day, Collections.emptyList());
|
List<Map<String, Object>> dayData = timepointMap.getOrDefault(day, Collections.emptyList());
|
||||||
Optional<Integer> weight = dayData.stream()
|
Optional<Integer> weight = dayData.stream()
|
||||||
|
|
@ -216,6 +216,16 @@ public class SupervisionStatisticsService {
|
||||||
log.error("数据获取失败", ex);
|
log.error("数据获取失败", ex);
|
||||||
return Collections.emptyMap();
|
return Collections.emptyMap();
|
||||||
});
|
});
|
||||||
|
CompletableFuture<Map<String, Object>> activeProjectStatisticsFuture = CompletableFuture.supplyAsync(supervisionStatisticsMapper::activeProjectStatistics, threadPoolExecutor)
|
||||||
|
.exceptionally(ex -> {
|
||||||
|
log.error("数据获取失败", ex);
|
||||||
|
return Collections.emptyMap();
|
||||||
|
});
|
||||||
|
CompletableFuture<Map<String, Object>> transStatisticsFuture = CompletableFuture.supplyAsync(supervisionStatisticsMapper::transStatistics, threadPoolExecutor)
|
||||||
|
.exceptionally(ex -> {
|
||||||
|
log.error("数据获取失败", ex);
|
||||||
|
return Collections.emptyMap();
|
||||||
|
});
|
||||||
CompletableFuture<Map<String, Object>> userStatisticsFuture = CompletableFuture.supplyAsync(supervisionStatisticsMapper::userStatistics, threadPoolExecutor)
|
CompletableFuture<Map<String, Object>> userStatisticsFuture = CompletableFuture.supplyAsync(supervisionStatisticsMapper::userStatistics, threadPoolExecutor)
|
||||||
.exceptionally(ex -> {
|
.exceptionally(ex -> {
|
||||||
log.error("数据获取失败", ex);
|
log.error("数据获取失败", ex);
|
||||||
|
|
@ -235,7 +245,9 @@ public class SupervisionStatisticsService {
|
||||||
Map<String, Double> trendStatistics = trendStatisticsFuture.get();
|
Map<String, Double> trendStatistics = trendStatisticsFuture.get();
|
||||||
List<Map<String, Object>> categoryStatistics = categoryStatisticsFuture.get();
|
List<Map<String, Object>> categoryStatistics = categoryStatisticsFuture.get();
|
||||||
Map<String, Object> orderStatistics = orderStatisticsFuture.get();
|
Map<String, Object> orderStatistics = orderStatisticsFuture.get();
|
||||||
|
Map<String, Object> activeProjectStatistics = activeProjectStatisticsFuture.get();
|
||||||
Map<String, Object> userStatistics = userStatisticsFuture.get();
|
Map<String, Object> userStatistics = userStatisticsFuture.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();
|
||||||
return MapUtil.<String, Object>builder()
|
return MapUtil.<String, Object>builder()
|
||||||
|
|
@ -246,6 +258,8 @@ public class SupervisionStatisticsService {
|
||||||
.put("trendStatistics", trendStatistics)
|
.put("trendStatistics", trendStatistics)
|
||||||
.put("categoryStatistics", categoryStatistics)
|
.put("categoryStatistics", categoryStatistics)
|
||||||
.put("orderStatistics", orderStatistics)
|
.put("orderStatistics", orderStatistics)
|
||||||
|
.put("activeProjectStatistics", activeProjectStatistics)
|
||||||
|
.put("transStatistics", transStatistics)
|
||||||
.put("userStatistics", userStatistics)
|
.put("userStatistics", userStatistics)
|
||||||
.put("weightStatistics", weightStatistics)
|
.put("weightStatistics", weightStatistics)
|
||||||
.put("dataTable", dataTable)
|
.put("dataTable", dataTable)
|
||||||
|
|
|
||||||
|
|
@ -306,14 +306,14 @@
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="categoryStatistics" resultType="java.util.Map">
|
<select id="categoryStatistics" resultType="java.util.Map">
|
||||||
SELECT d.category_name categoryName, ROUND(SUM(b.settle_weight) / 1000, 2) weight
|
SELECT c.goods_name categoryName, ROUND(SUM(b.settle_weight) / 1000, 2) weight
|
||||||
FROM order_info a
|
FROM order_info a
|
||||||
INNER JOIN order_car_in_out b ON b.id = a.car_in_out_id
|
INNER JOIN order_car_in_out b ON b.id = a.car_in_out_id
|
||||||
INNER JOIN order_goods c ON c.id = a.goods_id
|
INNER JOIN order_goods c ON c.id = a.goods_id
|
||||||
INNER JOIN goods_category d ON d.id = c.goods_category_id
|
INNER JOIN goods_category d ON d.id = c.goods_category_id
|
||||||
WHERE a.deleted = 0
|
WHERE a.deleted = 0
|
||||||
AND a.order_status = 'YiWanCheng'
|
AND a.order_status = 'YiWanCheng'
|
||||||
GROUP BY d.category_name
|
GROUP BY c.goods_name
|
||||||
</select>
|
</select>
|
||||||
<select id="orderStatistics" resultType="java.util.Map">
|
<select id="orderStatistics" resultType="java.util.Map">
|
||||||
SELECT MAX(IF(t_ = 1, c_, 0)) totalCount,
|
SELECT MAX(IF(t_ = 1, c_, 0)) totalCount,
|
||||||
|
|
@ -363,15 +363,53 @@
|
||||||
AND create_time <![CDATA[ < ]]> DATE_ADD(CURDATE(), INTERVAL 1 DAY)) t
|
AND create_time <![CDATA[ < ]]> DATE_ADD(CURDATE(), INTERVAL 1 DAY)) t
|
||||||
</select>
|
</select>
|
||||||
<select id="dataTable" resultType="java.util.Map">
|
<select id="dataTable" resultType="java.util.Map">
|
||||||
SELECT ROUND(SUM(b.settle_weight) / 1000, 2) totalWeight, COUNT(*) totalCount
|
select areaName,
|
||||||
FROM order_info a
|
goodsName,
|
||||||
INNER JOIN order_car_in_out b ON b.id = a.car_in_out_id
|
weight,
|
||||||
INNER JOIN order_cargo_place c ON c.id = a.cargo_place_id
|
complateCount,
|
||||||
INNER JOIN order_goods d ON c.id = a.goods_id
|
totalCount,
|
||||||
WHERE a.deleted = 0
|
ROUND((complateCount / totalCount) * 100, 2) complateRate
|
||||||
AND a.order_status = 'YiWanCheng'
|
from (SELECT c.area_name areaName,
|
||||||
AND b.out_time >= CURDATE()
|
d.goods_name goodsName,
|
||||||
AND b.out_time <![CDATA[ < ]]> DATE_ADD(CURDATE(), INTERVAL 1 DAY)
|
ROUND(SUM(if(a.order_status = 'YiWanCheng', b.settle_weight, 0)) / 1000, 2) weight,
|
||||||
GROUP BY c.area, d.goods_name
|
count(if(a.order_status = 'YiWanCheng', 1, null)) complateCount,
|
||||||
|
count(*) totalCount
|
||||||
|
FROM order_info a
|
||||||
|
INNER JOIN order_car_in_out b ON b.id = a.car_in_out_id
|
||||||
|
INNER JOIN order_cargo_place c ON c.id = a.cargo_place_id
|
||||||
|
INNER JOIN order_goods d ON d.id = a.goods_id
|
||||||
|
WHERE a.deleted = 0
|
||||||
|
AND a.order_status = 'YiWanCheng'
|
||||||
|
AND b.out_time >= DATE_SUB(CURDATE(), INTERVAL 30 DAY)
|
||||||
|
AND b.out_time < DATE_ADD(CURDATE(), INTERVAL 1 DAY)
|
||||||
|
GROUP BY c.area_name, d.goods_name) t
|
||||||
|
|
||||||
|
</select>
|
||||||
|
<select id="activeProjectStatistics" resultType="java.util.Map">
|
||||||
|
SELECT MAX(IF(t_ = 1, c_, 0)) totalCount,
|
||||||
|
MAX(IF(t_ = 2, c_, 0)) incCount
|
||||||
|
FROM (SELECT count(*) c_, 1 t_
|
||||||
|
FROM biz_project a
|
||||||
|
WHERE a.deleted = 0
|
||||||
|
UNION ALL
|
||||||
|
SELECT count(*) c_, 2 t_
|
||||||
|
FROM biz_project a
|
||||||
|
WHERE a.deleted = 0
|
||||||
|
AND a.create_time >= CURDATE()
|
||||||
|
AND a.create_time <![CDATA[ < ]]> DATE_ADD(CURDATE(), INTERVAL 1 DAY)) t
|
||||||
|
</select>
|
||||||
|
<select id="transStatistics" resultType="java.util.Map">
|
||||||
|
|
||||||
|
SELECT MAX(IF(t_ = 1, c_, 0)) totalCount,
|
||||||
|
MAX(IF(t_ = 2, c_, 0)) incCount
|
||||||
|
FROM (SELECT COUNT(*) c_, 1 t_
|
||||||
|
FROM sys_user
|
||||||
|
WHERE biz_obj IN ('QiYe', 'GeTi')
|
||||||
|
UNION ALL
|
||||||
|
SELECT COUNT(*) c_, 2 t_
|
||||||
|
FROM sys_user
|
||||||
|
WHERE biz_obj IN ('QiYe', 'GeTi')
|
||||||
|
AND create_time >= CURDATE()
|
||||||
|
AND create_time <![CDATA[ < ]]> DATE_ADD(CURDATE(), INTERVAL 1 DAY)) t
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue