fix(mapper): 发货审批不通过时,待发货数量应保持不变,只有发货审批通过时,待发货数量会对应减少,审核不通过库存预留的出库记录也要删掉
| | |
| | | //更改出库审核状态(待确认改成待审核) |
| | | stockUtils.shipmentStatus(StockOutQualifiedRecordTypeEnum.SALE_SHIP_STOCK_OUT.getCode(), shippingInfo.getId()); |
| | | } else if (status.equals(3)) { |
| | | //删除原本(待确认)的出库审核状态 |
| | | stockUtils.deleteStockOutRecord(shippingInfo.getId(), StockOutQualifiedRecordTypeEnum.SALE_SHIP_STOCK_OUT.getCode()); |
| | | shippingInfo.setStatus("审核拒绝"); |
| | | } else if (status.equals(1)) { |
| | | shippingInfo.setStatus("审核中"); |
| | |
| | | |
| | | } |
| | | |
| | | //删除出库记录 |
| | | public void deleteStockOutRecord(Long recordId, String recordType) { |
| | | StockOutRecord one = stockOutRecordService.getOne(new QueryWrapper<StockOutRecord>() |
| | | .lambda().eq(StockOutRecord::getRecordId, recordId) |
| | |
| | | SELECT sales_ledger_product_id, IFNULL(SUM(spd.quantity), 0) as shipped_quantity |
| | | FROM shipping_info si |
| | | LEFT JOIN shipping_product_detail spd ON si.id = spd.shipping_info_id |
| | | where si.status != '审核拒绝' |
| | | GROUP BY sales_ledger_product_id |
| | | ) t3 ON t3.sales_ledger_product_id = T1.id |
| | | left join product_model pm ON T1.product_model_id = pm.id |
| | |
| | | group by spd.stock_inventory_id |
| | | ) as sd on sd.stock_inventory_id = si.id |
| | | where si.product_model_id = #{productModelId} |
| | | and si.qualitity > IFNULL(sd.qualitity, 0) |
| | | </select> |
| | | |
| | | <select id="getBatchNoQty" resultType="com.ruoyi.stock.dto.StockInventoryDto"> |