廖井涛
2025-09-12 fc28d01cfa022d0f91ec719490342d726db2e105
north-glass-erp/src/main/resources/mapper/pp/ReportingWork.xml
@@ -448,17 +448,17 @@
                   a.completed_quantity,
                (a.completed_quantity+ a.breakage_quantity),
                   (f.completed_quantity
                       -ifnull(g.completed_quantity,0))
                       -ifnull(g.completed_quantity,0) + a.breakage_quantity)
                    )  as minQuantity -- 修改最小数
            </if>
            <if test="nextProcess == null or nextProcess == ''">  -- 最后一道工序
#               c.received_quantity, -- 已入库数量
#               c.inventory_quantity, --   库存数量
               c.received_quantity, -- 已入库数量
               c.inventory_quantity, --   库存数量
              if(ifnull(inventory_quantity,0)
                 -ifnull(c.received_quantity,0)
                 &gt;= a.completed_quantity,0,
                (a.completed_quantity-(ifnull(c.inventory_quantity,0)
                    -ifnull(c.received_quantity,0)))
                 &gt;= a.completed_quantity,a.completed_quantity,
                (ifnull(c.inventory_quantity,0)
                -ifnull(c.received_quantity,0))
                )
                as minQuantity -- 修改最小数
            </if>