廖井涛
2025-08-21 bf90cf8568301edb38920e8b0a0ce7e137a668ef
north-glass-erp/src/main/resources/mapper/pp/ReportingWork.xml
@@ -452,13 +452,13 @@
                    )  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>