| | |
| | | PURCHASE_STOCK_IN("7", "采购-入库"), |
| | | QUALITYINSPECT_STOCK_IN("6", "质检-合格入库"), |
| | | DEFECTIVE_PASS("11", "不合格-让步放行"), |
| | | SALE_STOCK_IN("15", "销售订单-合格入库"), |
| | | SALE_STOCK_IN("15", "质检-合格入库"), |
| | | SALE_SCAN_STOCK_IN("17", "销售订单扫码-合格入库"), |
| | | PURCHASE_SCAN_STOCK_IN("18", "采购订单扫码-合格入库"), |
| | | PURCHASE_SCAN_QUALITY_STOCK_IN("19", "扫码入库质检-合格入库"), |
| | |
| | | allStocked = false; |
| | | } |
| | | } |
| | | |
| | | long pendingInspectCount = qualityInspectMapper.selectCount(Wrappers.<QualityInspect>lambdaQuery() |
| | | .eq(QualityInspect::getSalesLedgerId, salesLedgerId) |
| | | .eq(QualityInspect::getInspectState, 0)); |
| | | boolean allInspectFinished = pendingInspectCount == 0; |
| | | |
| | | SalesLedger ledger = salesLedgerMapper.selectById(salesLedgerId); |
| | | if (ledger != null) { |
| | | ledger.setStockStatus(allStocked ? 2 : (hasStocked ? 1 : 0)); |
| | | int newStatus = ledger.getStockStatus() != null ? ledger.getStockStatus() : 0; |
| | | if (allInspectFinished) { |
| | | newStatus = allStocked ? 2 : 5; // 2: 已入库(质检完成), 5: 部分质检完成 |
| | | } else { |
| | | newStatus = 4; // 4: 质检中 |
| | | } |
| | | ledger.setStockStatus(newStatus); |
| | | salesLedgerMapper.updateById(ledger); |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | } |
| | | // 更新主单状态为未完全入库(待质检完成后更新) |
| | | ledger.setStockStatus(0); |
| | | // 更新主单状态为质检中(4) |
| | | ledger.setStockStatus(4); |
| | | baseMapper.updateById(ledger); |
| | | } |
| | | |
| | |
| | | <if test="req.approveType != null "> |
| | | and approve_type = #{req.approveType} |
| | | </if> |
| | | order by approve_time desc |
| | | order by approve_id desc |
| | | </select> |
| | | </mapper> |
| | |
| | | <if test="qualityInspect.approveUserIds != null and qualityInspect.approveUserIds != '' "> |
| | | AND qi.approve_user_ids like concat('%',#{qualityInspect.approveUserIds},'%') |
| | | </if> |
| | | ORDER BY qi.check_time DESC |
| | | ORDER BY qi.create_time DESC |
| | | </select> |
| | | |
| | | <select id="qualityInspectExport" resultType="com.ruoyi.quality.pojo.QualityInspect"> |