首炬大屏

master
lzq 2025-11-12 17:06:33 +08:00
parent 0b85492cdb
commit 393d55e78e
8 changed files with 28 additions and 46 deletions

View File

@ -1,8 +1,8 @@
package com.njzscloud.common.mp.support.handler.j; package com.njzscloud.common.mp.support.handler.j;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import lombok.extern.slf4j.Slf4j;
import com.njzscloud.common.core.fastjson.Fastjson; import com.njzscloud.common.core.fastjson.Fastjson;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.type.JdbcType; import org.apache.ibatis.type.JdbcType;
import org.apache.ibatis.type.MappedJdbcTypes; import org.apache.ibatis.type.MappedJdbcTypes;
import org.apache.ibatis.type.MappedTypes; import org.apache.ibatis.type.MappedTypes;
@ -28,21 +28,30 @@ public class JsonTypeHandler implements TypeHandler<Object> {
} }
private static Object getResult(String result) {
if (StrUtil.isBlank(result)) return null;
try {
return Fastjson.toBean(result, Object.class);
} catch (Exception e) {
return result;
}
}
@Override @Override
public Object getResult(ResultSet rs, String columnName) throws SQLException { public Object getResult(ResultSet rs, String columnName) throws SQLException {
String result = rs.getString(columnName); String result = rs.getString(columnName);
return StrUtil.isBlank(result) ? null : Fastjson.toBean(result, Object.class); return getResult(result);
} }
@Override @Override
public Object getResult(ResultSet rs, int columnIndex) throws SQLException { public Object getResult(ResultSet rs, int columnIndex) throws SQLException {
String result = rs.getString(columnIndex); String result = rs.getString(columnIndex);
return StrUtil.isBlank(result) ? null : Fastjson.toBean(result, Object.class); return getResult(result);
} }
@Override @Override
public Object getResult(CallableStatement cs, int columnIndex) throws SQLException { public Object getResult(CallableStatement cs, int columnIndex) throws SQLException {
String result = cs.getString(columnIndex); String result = cs.getString(columnIndex);
return StrUtil.isBlank(result) ? null : Fastjson.toBean(result, Object.class); return getResult(result);
} }
} }

View File

@ -1,30 +1,23 @@
package com.njzscloud.supervisory.statistics.controller; package com.njzscloud.supervisory.statistics.controller;
import com.njzscloud.common.core.utils.R;
import com.njzscloud.supervisory.statistics.service.SupervisionStatisticsService; import com.njzscloud.supervisory.statistics.service.SupervisionStatisticsService;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
@Slf4j @Slf4j
@CrossOrigin // @CrossOrigin
@RestController // @RestController
@RequiredArgsConstructor @RequiredArgsConstructor
@RequestMapping("/statistics/supervision") // @RequestMapping("/statistics/supervision")
public class SupervisionStatisticsController { public class SupervisionStatisticsController {
private final SupervisionStatisticsService supervisionStatisticsService; private final SupervisionStatisticsService supervisionStatisticsService;
/*
@GetMapping("/obtain_data") @GetMapping("/obtain_data")
public R<?> obtainData() { public R<?> obtainData() {
long l = System.currentTimeMillis(); long l = System.currentTimeMillis();
Map<String, Object> data = supervisionStatisticsService.obtainData(); Map<String, Object> data = supervisionStatisticsService.obtainData();
System.out.println("耗时: " + (System.currentTimeMillis() - l)); System.out.println("耗时: " + (System.currentTimeMillis() - l));
return R.success(data); return R.success(data);
} } */
} }

View File

@ -16,6 +16,7 @@ public class Order {
private String mobile; private String mobile;
private String goodsCategoryName; private String goodsCategoryName;
private String createTime; private String createTime;
private String outTime;
private String orderStatus; private String orderStatus;
private String carNumber; private String carNumber;
private String driverName; private String driverName;

View File

@ -174,8 +174,8 @@ public class ShouJuStatisticsService implements StatisticsService {
.thenApply(list -> { .thenApply(list -> {
if (list.size() < 6) { if (list.size() < 6) {
List<String> goodsNames = statisticsMapper.getGoodsNames(Wrappers.query().eq("depot_type", 2) List<String> goodsNames = statisticsMapper.getGoodsNames(Wrappers.query().eq("depot_type", 2)
.notLike("name", "青石") // .notLike("name", "青石")
.notLike("name", "矿石") // .notLike("name", "矿石")
, 6 - list.size()); , 6 - list.size());
for (String goodsName : goodsNames) { for (String goodsName : goodsNames) {
list.add(new GarbageDisposeSummary() list.add(new GarbageDisposeSummary()
@ -443,7 +443,7 @@ public class ShouJuStatisticsService implements StatisticsService {
.put("days", monthAmount_.get_2()) .put("days", monthAmount_.get_2())
.put("yearAmountIn", yearAmount_.get_0()) .put("yearAmountIn", yearAmount_.get_0())
.put("yearAmountOut", yearAmount_.get_1()) .put("yearAmountOut", yearAmount_.get_1())
.put("chuzhi", chuzhi) .put("chuzhi", map2)
.build(); .build();
} }

View File

@ -16,7 +16,7 @@ mybatis-plus:
host: 121.43.155.83 host: 121.43.155.83
port: 22 port: 22
user: root user: root
credentials: D:/我的/再昇云/客户信息归档/达州首炬/dzsj.pem credentials: D:/W/首炬/dzsj.pem
localPort: 33061 localPort: 33061
db: db:
host: rm-bp1w3397b718u1882.mysql.rds.aliyuncs.com host: rm-bp1w3397b718u1882.mysql.rds.aliyuncs.com

View File

@ -10,7 +10,7 @@ spring:
file-size-threshold: 1MB file-size-threshold: 1MB
resolve-lazily: true resolve-lazily: true
profiles: profiles:
active: ${APP_PROFILE:dev} active: ${APP_PROFILE:dev_shou_ju}
web: web:
resources: resources:
add-mappings: false add-mappings: false

View File

@ -15,8 +15,6 @@
WHERE a.station_id = 1 WHERE a.station_id = 1
AND a.status IN (0, 1, 2, 3) AND a.status IN (0, 1, 2, 3)
AND a.type != 4 AND a.type != 4
AND b.name NOT LIKE '%青石%'
AND b.name NOT LIKE '%矿石%'
ORDER BY a.create_time DESC ORDER BY a.create_time DESC
LIMIT 5) t1 LIMIT 5) t1
UNION ALL UNION ALL
@ -29,8 +27,6 @@
INNER JOIN ba_goods b ON b.id = a.goods_id AND b.id NOT IN (287, 286, 279, 278, 293, 273, 271, 270, 262, 2) INNER JOIN ba_goods b ON b.id = a.goods_id AND b.id NOT IN (287, 286, 279, 278, 293, 273, 271, 270, 262, 2)
WHERE a.station_id = 2 WHERE a.station_id = 2
AND a.type != 4 AND a.type != 4
AND b.name NOT LIKE '%青石%'
AND b.name NOT LIKE '%矿石%'
AND a.status IN (0, 1, 2, 3) AND a.status IN (0, 1, 2, 3)
ORDER BY a.create_time DESC ORDER BY a.create_time DESC
LIMIT 5) t2) a LIMIT 5) t2) a
@ -53,10 +49,8 @@
FROM ba_order a FROM ba_order a
INNER JOIN ba_goods b ON b.id = a.goods_id AND b.depot_type = 1 AND b.id NOT IN (287, 286, 279, 278, 293, 273, 271, 270, 262, 2) INNER JOIN ba_goods b ON b.id = a.goods_id AND b.depot_type = 1 AND b.id NOT IN (287, 286, 279, 278, 293, 273, 271, 270, 262, 2)
INNER JOIN ba_goods_category c ON c.id = b.category_id INNER JOIN ba_goods_category c ON c.id = b.category_id
WHERE b.name NOT LIKE '%青石%' WHERE b.name NOT LIKE '%拆除垃圾(派车清运零星客户专用)%'
AND b.name NOT LIKE '%拆除垃圾(派车清运零星客户专用)%'
AND b.name NOT LIKE '%拆除垃圾(活动优惠)%' AND b.name NOT LIKE '%拆除垃圾(活动优惠)%'
AND b.name NOT LIKE '%矿石%'
AND a.type != 4 AND a.type != 4
GROUP BY b.name) t GROUP BY b.name) t
ORDER BY weight DESC ORDER BY weight DESC
@ -68,8 +62,6 @@
FROM ba_order a FROM ba_order a
INNER JOIN ba_goods b ON b.id = a.goods_id AND b.depot_type = 2 AND b.id NOT IN (287, 286, 279, 278, 293, 273, 271, 270, 262, 2) INNER JOIN ba_goods b ON b.id = a.goods_id AND b.depot_type = 2 AND b.id NOT IN (287, 286, 279, 278, 293, 273, 271, 270, 262, 2)
INNER JOIN ba_goods_category c ON c.id = b.category_id INNER JOIN ba_goods_category c ON c.id = b.category_id
WHERE b.name NOT LIKE '%青石%'
AND b.name NOT LIKE '%矿石%'
AND b.name NOT LIKE '%一期项目%' AND b.name NOT LIKE '%一期项目%'
AND a.type != 4 AND a.type != 4
GROUP BY b.name) t GROUP BY b.name) t
@ -85,8 +77,6 @@
INNER JOIN ba_goods b ON b.id = a.goods_id AND b.depot_type = 2 AND b.id NOT IN (287, 286, 279, 278, 293, 273, 271, 270, 262, 2) INNER JOIN ba_goods b ON b.id = a.goods_id AND b.depot_type = 2 AND b.id NOT IN (287, 286, 279, 278, 293, 273, 271, 270, 262, 2)
WHERE a.out_time >= UNIX_TIMESTAMP(DATE_FORMAT(CURDATE(), '%Y-%m-01 00:00:00')) WHERE a.out_time >= UNIX_TIMESTAMP(DATE_FORMAT(CURDATE(), '%Y-%m-01 00:00:00'))
AND a.type != 4 AND a.type != 4
AND b.name NOT LIKE '%青石%'
AND b.name NOT LIKE '%矿石%'
AND a.out_time <![CDATA[ < ]]> UNIX_TIMESTAMP(DATE_ADD(DATE_FORMAT(CURDATE(), '%Y-%m-01'), INTERVAL 1 MONTH)) AND a.out_time <![CDATA[ < ]]> UNIX_TIMESTAMP(DATE_ADD(DATE_FORMAT(CURDATE(), '%Y-%m-01'), INTERVAL 1 MONTH))
GROUP BY a.goods_name) t GROUP BY a.goods_name) t
ORDER BY weight DESC ORDER BY weight DESC
@ -103,8 +93,6 @@
INNER JOIN ba_goods c ON c.id = a.goods_id AND c.id NOT IN (287, 286, 279, 278, 293, 273, 271, 270, 262, 2) INNER JOIN ba_goods c ON c.id = a.goods_id AND c.id NOT IN (287, 286, 279, 278, 293, 273, 271, 270, 262, 2)
WHERE a.status IN (0, 1, 2, 3) WHERE a.status IN (0, 1, 2, 3)
AND a.type != 4 AND a.type != 4
AND c.name NOT LIKE '%青石%'
AND c.name NOT LIKE '%矿石%'
GROUP BY b.id, IF(a.status = 1, 1, 0)) t1 GROUP BY b.id, IF(a.status = 1, 1, 0)) t1
INNER JOIN ba_user t2 ON t2.id = t1.id INNER JOIN ba_user t2 ON t2.id = t1.id
ORDER BY c DESC ORDER BY c DESC
@ -120,8 +108,6 @@
INNER JOIN ba_goods c ON c.id = a.goods_id AND c.id NOT IN (287, 286, 279, 278, 293, 273, 271, 270, 262, 2) INNER JOIN ba_goods c ON c.id = a.goods_id AND c.id NOT IN (287, 286, 279, 278, 293, 273, 271, 270, 262, 2)
WHERE a.status IN (0, 1, 2, 3) WHERE a.status IN (0, 1, 2, 3)
AND a.type != 4 AND a.type != 4
AND c.name NOT LIKE '%青石%'
AND c.name NOT LIKE '%矿石%'
GROUP BY b.id, IF(a.status = 1, 1, 0)) t1 GROUP BY b.id, IF(a.status = 1, 1, 0)) t1
INNER JOIN ba_user t2 ON t2.id = t1.id INNER JOIN ba_user t2 ON t2.id = t1.id
ORDER BY c DESC)tt2 ORDER BY c DESC)tt2
@ -137,8 +123,6 @@
INNER JOIN ba_goods b ON b.id = a.goods_id AND b.id NOT IN (287, 286, 279, 278, 293, 273, 271, 270, 262, 2) INNER JOIN ba_goods b ON b.id = a.goods_id AND b.id NOT IN (287, 286, 279, 278, 293, 273, 271, 270, 262, 2)
WHERE a.vip_user = #{userId} WHERE a.vip_user = #{userId}
AND a.type != 4 AND a.type != 4
AND b.name NOT LIKE '%青石%'
AND b.name NOT LIKE '%矿石%'
ORDER BY a.create_time DESC ORDER BY a.create_time DESC
LIMIT 10 LIMIT 10
</select> </select>
@ -148,8 +132,6 @@
INNER JOIN ba_goods b ON b.id = a.goods_id AND b.depot_type = 1 AND b.id NOT IN (287, 286, 279, 278, 293, 273, 271, 270, 262, 2) INNER JOIN ba_goods b ON b.id = a.goods_id AND b.depot_type = 1 AND b.id NOT IN (287, 286, 279, 278, 293, 273, 271, 270, 262, 2)
WHERE a.out_time >= #{startTime} WHERE a.out_time >= #{startTime}
AND a.out_time <![CDATA[ <= ]]> #{endTime} AND a.out_time <![CDATA[ <= ]]> #{endTime}
AND b.name NOT LIKE '%青石%'
AND b.name NOT LIKE '%矿石%'
AND a.type != 4 AND a.type != 4
</select> </select>
<select id="getTodayOrderSummary" resultType="com.njzscloud.supervisory.statistics.pojo.TodayOrderSummary"> <select id="getTodayOrderSummary" resultType="com.njzscloud.supervisory.statistics.pojo.TodayOrderSummary">
@ -163,8 +145,6 @@
INNER JOIN ba_goods b ON b.id = a.goods_id AND b.id NOT IN (287, 286, 279, 278, 293, 273, 271, 270, 262, 2) INNER JOIN ba_goods b ON b.id = a.goods_id AND b.id NOT IN (287, 286, 279, 278, 293, 273, 271, 270, 262, 2)
WHERE a.create_time >= UNIX_TIMESTAMP(CURDATE()) WHERE a.create_time >= UNIX_TIMESTAMP(CURDATE())
AND a.type != 4 AND a.type != 4
AND b.name NOT LIKE '%青石%'
AND b.name NOT LIKE '%矿石%'
AND a.create_time <![CDATA[ < ]]> UNIX_TIMESTAMP(DATE_ADD(CURDATE(), INTERVAL 24 HOUR))) t AND a.create_time <![CDATA[ < ]]> UNIX_TIMESTAMP(DATE_ADD(CURDATE(), INTERVAL 24 HOUR))) t
GROUP BY order_status) tt GROUP BY order_status) tt
</select> </select>
@ -177,8 +157,6 @@
AND a.out_time >= #{startTime} AND a.out_time >= #{startTime}
AND a.out_time <![CDATA[ <= ]]> #{endTime} AND a.out_time <![CDATA[ <= ]]> #{endTime}
AND a.type != 4 AND a.type != 4
AND b.name NOT LIKE '%青石%'
AND b.name NOT LIKE '%矿石%'
</select> </select>
<select id="getGoodsNames" resultType="java.lang.String"> <select id="getGoodsNames" resultType="java.lang.String">
@ -194,6 +172,6 @@
FROM ba_order a FROM ba_order a
INNER JOIN ba_goods b ON b.id = a.goods_id INNER JOIN ba_goods b ON b.id = a.goods_id
WHERE a.status = '1' WHERE a.status = '1'
AND YEAR (a.create_time) = YEAR (CURDATE()) AND YEAR (FROM_UNIXTIME(a.create_time)) = YEAR (CURDATE())
</select> </select>
</mapper> </mapper>

View File

@ -105,10 +105,11 @@
SELECT a.order_no, SELECT a.order_no,
d.realname, d.realname,
d.mobile, d.mobile,
FROM_UNIXTIME(a.out_time, '%Y-%m-%d %H:%i:%s') out_time,
e.name goods_category_name, e.name goods_category_name,
FROM_UNIXTIME(a.create_time, '%Y-%m-%d %H:%i:%s') create_time, FROM_UNIXTIME(a.create_time, '%Y-%m-%d %H:%i:%s') create_time,
IF(a.type = 5 AND a.finish = 0 AND a.car_number = '', '待派车', IF(a.type = 5 AND a.finish = 0 AND a.car_number = '', '待派车',
IF(b.status = 1 AND a.status NOT IN (1, 4, 5), '未接单', IF(b.status = 2 AND a.status NOT IN (1, 4, 5), '运输中', IF(b.status = 3, '已完成', IF(b.status = 1 AND a.status NOT IN (1, 4, 5), '已派单', IF(b.status = 2 AND a.status NOT IN (1, 4, 5), '运输中', IF(b.status = 3, '已完成',
CASE a.status CASE a.status
WHEN '0' THEN '待授权' WHEN '0' THEN '待授权'
WHEN '1' THEN '已完成' WHEN '1' THEN '已完成'