| | |
| | | public void testUpdateProductSalesLineWhenOqcFinish_pass() { |
| | | // 准备参数 |
| | | Long oqcId = randomLongId(); |
| | | Integer checkResult = MesQcCheckResultEnum.PASS.getType(); |
| | | Integer checkResult = MesQcCheckResultEnum.QUALIFIED.getType(); |
| | | |
| | | // mock 数据 |
| | | MesWmProductSalesLineDO lineDO = randomPojo(MesWmProductSalesLineDO.class, o -> { |
| | |
| | | public void testUpdateProductSalesLineWhenOqcFinish_fail() { |
| | | // 准备参数 |
| | | Long oqcId = randomLongId(); |
| | | Integer checkResult = MesQcCheckResultEnum.FAIL.getType(); |
| | | Integer checkResult = MesQcCheckResultEnum.QUALIFIED.getType(); |
| | | |
| | | // mock 数据 |
| | | MesWmProductSalesLineDO lineDO = randomPojo(MesWmProductSalesLineDO.class, o -> { |
| | |
| | | |
| | | // 调用:第 2 行质检不合格 |
| | | productSalesLineService.updateProductSalesLineWhenOqcFinish( |
| | | line2.getId(), randomLongId(), MesQcCheckResultEnum.FAIL.getType()); |
| | | line2.getId(), randomLongId(), MesQcCheckResultEnum.QUALIFIED.getType()); |
| | | |
| | | // 断言:应该调用 cancelProductSales |
| | | verify(productSalesService).cancelProductSales(eq(salesId)); |
| | |
| | | |
| | | // 调用:第 2 行质检合格 |
| | | productSalesLineService.updateProductSalesLineWhenOqcFinish( |
| | | line2.getId(), randomLongId(), MesQcCheckResultEnum.PASS.getType()); |
| | | line2.getId(), randomLongId(), MesQcCheckResultEnum.QUALIFIED.getType()); |
| | | |
| | | // 断言:不应该调用 cancelProductSales |
| | | verify(productSalesService, never()).cancelProductSales(anyLong()); |
| | |
| | | |
| | | // 调用:第 2 行质检不合格 |
| | | productSalesLineService.updateProductSalesLineWhenOqcFinish( |
| | | line2.getId(), randomLongId(), MesQcCheckResultEnum.FAIL.getType()); |
| | | line2.getId(), randomLongId(), MesQcCheckResultEnum.QUALIFIED.getType()); |
| | | |
| | | // 断言:第 2 行不合格 → 应该取消出库单 |
| | | verify(productSalesService).cancelProductSales(eq(salesId)); |