盘点模块修改

This commit is contained in:
2025-09-16 15:23:04 +08:00
parent 29226c104f
commit 2e32af8fbe
9 changed files with 105 additions and 32 deletions

View File

@@ -196,10 +196,10 @@
parameterType="InventoryMatchScan"
resultType="com.zg.project.Inventory.domain.vo.RkInfoMatchVO">
SELECT
r.pcode AS rkPcode,
COALESCE(SUM(r.real_qty), 0) AS realQty
r.pcode AS rkPcode,
COALESCE(SUM(r.real_qty), 0) AS realQty
FROM rk_info r
WHERE r.pcode_id IN (
WHERE r.pcode IN (
SELECT DISTINCT i.pcode
FROM inventory_match_scan i
<where>

View File

@@ -85,6 +85,13 @@
where id = #{taskId}
</select>
<select id="getSceneByTaskId"
resultType="java.lang.String" parameterType="java.lang.String">
SELECT scene_id
FROM inventory_task
WHERE id = #{taskId}
</select>
<select id="selectSceneIdById" parameterType="string" resultType="java.lang.String">
SELECT scene_id
FROM inventory_task

View File

@@ -76,6 +76,13 @@
AND is_delete = '0'
</select>
<select id="selectEncodedIdByPcode" resultType="java.lang.String" parameterType="java.lang.String">
select encoded_id
from pcde_detail
where pcode = #{pcode}
AND is_delete = '0'
</select>
<insert id="insertPcdeDetail" parameterType="PcdeDetail" useGeneratedKeys="true" keyProperty="id">
insert into pcde_detail
<trim prefix="(" suffix=")" suffixOverrides=",">
@@ -134,4 +141,5 @@
#{id}
</foreach>
</delete>
</mapper>

View File

@@ -653,19 +653,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND is_chuku = '0'
</select>
<select id="getUnscannedPcodeByWh" resultType="com.zg.project.Inventory.domain.vo.RkInfoMatchVO">
<select id="getUnscannedPcodeByScene"
resultType="com.zg.project.Inventory.domain.vo.RkInfoMatchVO">
SELECT
r.pcode AS rkPcode,
r.real_qty AS realQty
FROM rk_info r
WHERE r.cangku = #{wh}
AND r.pcode_id NOT IN (
SELECT i.pcode
FROM inventory_match_scan i
WHERE i.task_id = #{taskId}
AND i.status = '0' <!-- 过滤掉扫描成功的 -->
)
ORDER BY r.create_time DESC
r.pcode AS rkPcode,
COALESCE(SUM(r.real_qty), 0) AS realQty
FROM pcde_detail d
JOIN rk_info r
ON r.pcode = d.pcode
LEFT JOIN (
SELECT DISTINCT pcode
FROM inventory_match_scan
WHERE task_id = #{taskId}
AND status = '0'
) s
ON s.pcode = r.pcode
WHERE (d.is_delete IS NULL OR d.is_delete = '0')
AND d.scene = #{sceneId}
AND r.is_chuku = '0'
AND s.pcode IS NULL
GROUP BY r.pcode
ORDER BY MAX(r.create_time) DESC
</select>
<select id="selectPcdeCntFromRkInfo" resultType="com.zg.project.Inventory.domain.vo.PcdeCntVO">