bug修复

This commit is contained in:
2025-12-03 16:29:00 +08:00
parent ffa312542b
commit 19d7d42342
4 changed files with 73 additions and 23 deletions

View File

@@ -108,7 +108,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
SUM(t.daily_cost_amount) AS totalDailyCost
FROM (
SELECT
m.coil_id,
IFNULL(m.net_weight, 0) AS net_weight_ton,
IFNULL(m.gross_weight, 0) AS gross_weight_ton,
(DATEDIFF(CURDATE(), IFNULL(m.create_time, CURDATE())) + 1) AS storage_days,
@@ -116,8 +115,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
WHEN cs.unit_cost IS NULL THEN 0
ELSE (
CASE
WHEN IFNULL(m.gross_weight, 0) > 0 THEN m.gross_weight
ELSE IFNULL(m.net_weight, 0)
WHEN IFNULL(m.net_weight, 0) > 0 THEN m.net_weight
ELSE IFNULL(m.gross_weight, 0)
END
) * cs.unit_cost
END AS daily_cost_amount,
@@ -125,8 +124,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
WHEN cs.unit_cost IS NULL THEN 0
ELSE (
CASE
WHEN IFNULL(m.gross_weight, 0) > 0 THEN m.gross_weight
ELSE IFNULL(m.net_weight, 0)
WHEN IFNULL(m.net_weight, 0) = 0 AND IFNULL(m.gross_weight, 0) > 0 THEN m.gross_weight
ELSE IFNULL(m.net_weight, 0)
END
) * cs.unit_cost * (DATEDIFF(CURDATE(), IFNULL(m.create_time, CURDATE())) + 1)
END AS total_cost_amount
@@ -137,6 +136,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND (cs.expire_date IS NULL OR DATE(m.create_time) <= cs.expire_date)
WHERE m.data_type = 1
AND m.del_flag = 0
and m.status = 0
AND m.export_time IS NULL
<if test="warehouseId != null">
AND m.warehouse_id = #{warehouseId}
@@ -171,7 +171,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
WHEN cs.unit_cost IS NULL THEN 0
ELSE (
CASE
WHEN IFNULL(m.gross_weight, 0) > 0 THEN m.gross_weight
WHEN IFNULL(m.net_weight, 0) = 0 AND IFNULL(m.gross_weight, 0) > 0 THEN m.gross_weight
ELSE IFNULL(m.net_weight, 0)
END
) * cs.unit_cost * (DATEDIFF(CURDATE(), IFNULL(m.create_time, CURDATE())) + 1)
@@ -210,7 +210,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
WHEN cs.unit_cost IS NULL THEN 0
ELSE (
CASE
WHEN IFNULL(m.gross_weight, 0) > 0 THEN m.gross_weight
WHEN IFNULL(m.net_weight, 0) = 0 AND IFNULL(m.gross_weight, 0) > 0 THEN m.gross_weight
ELSE IFNULL(m.net_weight, 0)
END
) * cs.unit_cost * (DATEDIFF(CURDATE(), IFNULL(m.create_time, CURDATE())) + 1)
@@ -310,6 +310,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
FROM wms_material_coil m
WHERE m.data_type = 1
AND m.del_flag = 0
and m.status = 0
AND m.export_time IS NULL
<if test="enterCoilNo != null and enterCoilNo != ''">
AND m.enter_coil_no LIKE CONCAT(#{enterCoilNo}, '%')
@@ -324,7 +325,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
SUM(t.net_weight_ton) AS totalNetWeight,
SUM(t.gross_weight_ton) AS totalGrossWeight,
SUM(t.cost_amount) AS totalCost,
AVG(t.storage_days) AS avgStorageDays
AVG(t.storage_days) AS avgStorageDays,
SUM(t.today_cost_amount) AS todayCost
FROM (
SELECT
IFNULL(m.net_weight, 0) AS net_weight_ton,
@@ -333,11 +335,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
WHEN cs.unit_cost IS NULL THEN 0
ELSE (
CASE
WHEN IFNULL(m.gross_weight, 0) > 0 THEN m.gross_weight
ELSE IFNULL(m.net_weight, 0)
WHEN IFNULL(m.net_weight, 0) > 0 THEN m.net_weight
ELSE IFNULL(m.gross_weight, 0)
END
) * cs.unit_cost * (DATEDIFF(CURDATE(), IFNULL(m.create_time, CURDATE())) + 1)
END AS cost_amount,
CASE
WHEN m.status = 0 THEN (
CASE
WHEN cs.unit_cost IS NULL THEN 0
ELSE (
CASE
WHEN IFNULL(m.net_weight, 0) > 0 THEN m.net_weight
ELSE IFNULL(m.gross_weight, 0)
END
) * cs.unit_cost
END
)
ELSE 0
END AS today_cost_amount,
(DATEDIFF(CURDATE(), IFNULL(m.create_time, CURDATE())) + 1) AS storage_days
FROM wms_material_coil m
LEFT JOIN wms_cost_standard_config cs
@@ -346,6 +362,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND (cs.expire_date IS NULL OR DATE(m.create_time) &lt;= cs.expire_date)
WHERE m.data_type = 1
AND m.del_flag = 0
and m.status = 0
AND m.export_time IS NULL
<if test="enterCoilNo != null and enterCoilNo != ''">
AND m.enter_coil_no LIKE CONCAT(#{enterCoilNo}, '%')
@@ -359,7 +376,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
SUM(t.net_weight_ton) AS totalNetWeight,
SUM(t.gross_weight_ton) AS totalGrossWeight,
AVG(t.storage_days) AS avgStorageDays,
SUM(t.cost_amount) AS totalCost
SUM(t.cost_amount) AS totalCost,
SUM(t.today_cost_amount) AS todayCost
FROM (
SELECT
IFNULL(m.net_weight, 0) AS net_weight_ton,
@@ -369,11 +387,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
WHEN cs.unit_cost IS NULL THEN 0
ELSE (
CASE
WHEN IFNULL(m.gross_weight, 0) > 0 THEN m.gross_weight
ELSE IFNULL(m.net_weight, 0)
WHEN IFNULL(m.net_weight, 0) > 0 THEN m.gross_weight
ELSE IFNULL(m.gross_weight, 0)
END
) * cs.unit_cost * (DATEDIFF(CURDATE(), IFNULL(m.create_time, CURDATE())) + 1)
END AS cost_amount
END AS cost_amount,
CASE
WHEN m.status = 0 THEN (
CASE
WHEN cs.unit_cost IS NULL THEN 0
ELSE (
CASE
WHEN IFNULL(m.net_weight, 0) > 0 THEN m.net_weight
ELSE IFNULL(m.gross_weight, 0)
END
) * cs.unit_cost
END
)
ELSE 0
END AS today_cost_amount
FROM wms_material_coil m
LEFT JOIN wms_cost_standard_config cs
ON cs.status = 1
@@ -381,6 +413,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND (cs.expire_date IS NULL OR DATE(m.create_time) &lt;= cs.expire_date)
WHERE m.data_type = 1
AND m.del_flag = 0
AND m.status = 0
AND m.export_time IS NULL
) t
</select>
@@ -418,7 +451,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
ELSE 'net'
END AS weight_basis,
CASE
WHEN IFNULL(m.gross_weight, 0) > 0 THEN IFNULL(m.gross_weight, 0)
WHEN IFNULL(m.net_weight, 0) = 0 AND IFNULL(m.gross_weight, 0) > 0 THEN m.gross_weight
ELSE IFNULL(m.net_weight, 0)
END AS charge_weight_ton,
DATE(m.create_time) AS start_date,