首炬大屏

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;
import cn.hutool.core.util.StrUtil;
import lombok.extern.slf4j.Slf4j;
import com.njzscloud.common.core.fastjson.Fastjson;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.type.JdbcType;
import org.apache.ibatis.type.MappedJdbcTypes;
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
public Object getResult(ResultSet rs, String columnName) throws SQLException {
String result = rs.getString(columnName);
return StrUtil.isBlank(result) ? null : Fastjson.toBean(result, Object.class);
return getResult(result);
}
@Override
public Object getResult(ResultSet rs, int columnIndex) throws SQLException {
String result = rs.getString(columnIndex);
return StrUtil.isBlank(result) ? null : Fastjson.toBean(result, Object.class);
return getResult(result);
}
@Override
public Object getResult(CallableStatement cs, int columnIndex) throws SQLException {
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;
import com.njzscloud.common.core.utils.R;
import com.njzscloud.supervisory.statistics.service.SupervisionStatisticsService;
import lombok.RequiredArgsConstructor;
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
@CrossOrigin
@RestController
// @CrossOrigin
// @RestController
@RequiredArgsConstructor
@RequestMapping("/statistics/supervision")
// @RequestMapping("/statistics/supervision")
public class SupervisionStatisticsController {
private final SupervisionStatisticsService supervisionStatisticsService;
/*
@GetMapping("/obtain_data")
public R<?> obtainData() {
long l = System.currentTimeMillis();
Map<String, Object> data = supervisionStatisticsService.obtainData();
System.out.println("耗时: " + (System.currentTimeMillis() - l));
return R.success(data);
}
} */
}

View File

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

View File

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

View File

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

View File

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

View File

@ -15,8 +15,6 @@
WHERE a.station_id = 1
AND a.status IN (0, 1, 2, 3)
AND a.type != 4
AND b.name NOT LIKE '%青石%'
AND b.name NOT LIKE '%矿石%'
ORDER BY a.create_time DESC
LIMIT 5) t1
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)
WHERE a.station_id = 2
AND a.type != 4
AND b.name NOT LIKE '%青石%'
AND b.name NOT LIKE '%矿石%'
AND a.status IN (0, 1, 2, 3)
ORDER BY a.create_time DESC
LIMIT 5) t2) a
@ -53,10 +49,8 @@
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_category c ON c.id = b.category_id
WHERE b.name NOT LIKE '%青石%'
AND b.name NOT LIKE '%拆除垃圾(派车清运零星客户专用)%'
WHERE b.name NOT LIKE '%拆除垃圾(派车清运零星客户专用)%'
AND b.name NOT LIKE '%拆除垃圾(活动优惠)%'
AND b.name NOT LIKE '%矿石%'
AND a.type != 4
GROUP BY b.name) t
ORDER BY weight DESC
@ -68,8 +62,6 @@
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_category c ON c.id = b.category_id
WHERE b.name NOT LIKE '%青石%'
AND b.name NOT LIKE '%矿石%'
AND b.name NOT LIKE '%一期项目%'
AND a.type != 4
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)
WHERE a.out_time >= UNIX_TIMESTAMP(DATE_FORMAT(CURDATE(), '%Y-%m-01 00:00:00'))
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))
GROUP BY a.goods_name) t
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)
WHERE a.status IN (0, 1, 2, 3)
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
INNER JOIN ba_user t2 ON t2.id = t1.id
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)
WHERE a.status IN (0, 1, 2, 3)
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
INNER JOIN ba_user t2 ON t2.id = t1.id
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)
WHERE a.vip_user = #{userId}
AND a.type != 4
AND b.name NOT LIKE '%青石%'
AND b.name NOT LIKE '%矿石%'
ORDER BY a.create_time DESC
LIMIT 10
</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)
WHERE a.out_time >= #{startTime}
AND a.out_time <![CDATA[ <= ]]> #{endTime}
AND b.name NOT LIKE '%青石%'
AND b.name NOT LIKE '%矿石%'
AND a.type != 4
</select>
<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)
WHERE a.create_time >= UNIX_TIMESTAMP(CURDATE())
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
GROUP BY order_status) tt
</select>
@ -177,8 +157,6 @@
AND a.out_time >= #{startTime}
AND a.out_time <![CDATA[ <= ]]> #{endTime}
AND a.type != 4
AND b.name NOT LIKE '%青石%'
AND b.name NOT LIKE '%矿石%'
</select>
<select id="getGoodsNames" resultType="java.lang.String">
@ -194,6 +172,6 @@
FROM ba_order a
INNER JOIN ba_goods b ON b.id = a.goods_id
WHERE a.status = '1'
AND YEAR (a.create_time) = YEAR (CURDATE())
AND YEAR (FROM_UNIXTIME(a.create_time)) = YEAR (CURDATE())
</select>
</mapper>

View File

@ -105,10 +105,11 @@
SELECT a.order_no,
d.realname,
d.mobile,
FROM_UNIXTIME(a.out_time, '%Y-%m-%d %H:%i:%s') out_time,
e.name goods_category_name,
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(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
WHEN '0' THEN '待授权'
WHEN '1' THEN '已完成'