diff --git a/ruoyi-admin/src/main/java/com/ruoyi/quality/controller/QualityOrderController.java b/ruoyi-admin/src/main/java/com/ruoyi/quality/controller/QualityOrderController.java index e9d1787d..ff011215 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/quality/controller/QualityOrderController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/quality/controller/QualityOrderController.java @@ -72,6 +72,35 @@ public class QualityOrderController extends BaseController return getDataTable(list); } + /** + * 查询来料品质管理品质单列表 + */ + @PostMapping("/iqcOrderList") + @ResponseBody + public TableDataInfo iqcOrderList(QualityOrder qualityOrder) + { + startPage(); + List list = qualityOrderService.selectQualityOrderList(qualityOrder); + List filterList = list.stream()//采购订单(入库)或委外订单(入库) + .filter(item ->(item.getQualityOrderType().equals("0")||item.getQualityOrderType().equals("2")) + &&(item.getQualityStorageStatus().equals("0")||item.getQualityStorageStatus().equals("2"))).collect(Collectors.toList()); + return getDataTable(filterList); + } + + /** + * 查询生产品质管理品质单列表 + */ + @PostMapping("/makeQualityList") + @ResponseBody + public TableDataInfo makeOrderList(QualityOrder qualityOrder) + { + startPage(); + List list = qualityOrderService.selectQualityOrderList(qualityOrder); + List filterList = list.stream()//生产订单(入库) + .filter(item ->item.getQualityOrderType().equals("1") &&item.getQualityStorageStatus().equals("4")).collect(Collectors.toList()); + return getDataTable(filterList); + } + /** * 导出品质管理品质单列表 */ diff --git a/ruoyi-admin/src/main/java/com/ruoyi/quality/controller/QualityOrderReportController.java b/ruoyi-admin/src/main/java/com/ruoyi/quality/controller/QualityOrderReportController.java index 73777456..232f2824 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/quality/controller/QualityOrderReportController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/quality/controller/QualityOrderReportController.java @@ -76,13 +76,6 @@ public class QualityOrderReportController extends BaseController } - @RequiresPermissions("quality:qualityReport:iqcView") - @GetMapping("/iqcQualityReport") - public String iqcQualityReport() - { - return prefix + "/iqcQualityReport"; - } - /** * 查询品质管理品质单报告列表 */ @@ -96,6 +89,18 @@ public class QualityOrderReportController extends BaseController return getDataTable(list); } + /** + * 查询品质管理品质单报告列表(不带分页) + */ + @PostMapping("/getReportList") + @ResponseBody + public TableDataInfo getReportList(QualityOrderReportVO qualityOrderReport) + { + startPage(); + List list = qualityOrderReportService.selectQualityOrderReportListByQualityCOde(qualityOrderReport); + return getDataTable(list); + } + /** * 导出品质管理品质单报告列表 */ diff --git a/ruoyi-admin/src/main/java/com/ruoyi/quality/service/IQualityOrderReportService.java b/ruoyi-admin/src/main/java/com/ruoyi/quality/service/IQualityOrderReportService.java index 3ac6fb1a..ad72465c 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/quality/service/IQualityOrderReportService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/quality/service/IQualityOrderReportService.java @@ -31,6 +31,10 @@ public interface IQualityOrderReportService */ public List selectQualityOrderReportList(QualityOrderReportVO qualityOrderReportVO); + /* + * 查询品质报告单列表*/ + List selectQualityOrderReportListByQualityCOde(QualityOrderReportVO qualityReportVO); + /** * 新增品质管理品质单报告 * diff --git a/ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityOrderReportServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityOrderReportServiceImpl.java index 6ec19bb7..6b7c5419 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityOrderReportServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityOrderReportServiceImpl.java @@ -192,6 +192,14 @@ public class QualityOrderReportServiceImpl implements IQualityOrderReportService return returnList; } + + /* + * 查询品质报告单列表*/ + @Override + public List selectQualityOrderReportListByQualityCOde(QualityOrderReportVO qualityReportVO){ + return qualityOrderReportMapper.selectQualityOrderReportList(qualityReportVO); + } + /** * 新增生产成品品质单报告 * @@ -404,11 +412,8 @@ public class QualityOrderReportServiceImpl implements IQualityOrderReportService if (processIsFinish) { // 审核状态-审核通过 qualityOrderReportVO.setAuditStatus("1"); - String materialNo = qualityOrderReportVO.getMaterialNo(); - //成品品质 - if(materialNo.startsWith("8")){ - updateApprovedInfo(qualityOrderReportVO); - } + //更新审核通过数据 + updateApprovedInfo(qualityOrderReportVO); } qualityOrderReportMapper.updateQualityOrderReportById(qualityOrderReportVO); return processInstance; @@ -488,11 +493,11 @@ public class QualityOrderReportServiceImpl implements IQualityOrderReportService qualityOrder.setUpdateTime(DateUtils.getNowDate()); int orderQualifiedNum = qualityOrder.getQualityQualifiedNum(); int orderUnqualifiedNum = qualityOrder.getQualityUnqualifiedNum(); - int orderCheckNum = qualityOrder.getThisArrivedNum(); - if(orderQualifiedNum + orderUnqualifiedNum + orderPendingReviewNum < orderCheckNum){ + int qualityNum = orderQualifiedNum + orderUnqualifiedNum + orderPendingReviewNum; + if(qualityNum < qualityOrder.getThisArrivedNum()){ qualityOrder.setQualityStatus("1");//部分品质 } - if(orderQualifiedNum + orderUnqualifiedNum + orderPendingReviewNum == orderCheckNum){ + if(qualityNum == qualityOrder.getThisArrivedNum()){ qualityOrder.setQualityStatus("2");//全部品质 } qualityOrderMapper.updateQualityOrder(qualityOrder); @@ -571,9 +576,6 @@ public class QualityOrderReportServiceImpl implements IQualityOrderReportService storageOrder.setWarehouseStorageType("5");//生产入库 storageOrder.setWarehouseOrderType("1");//生产订单 storageOrder.setWarehouseDeptType("0");//入库部门:仓库 - if(qualityOrderReportVO.getQualityOrderReportType().equals("0")){ - storageOrder.setQualityUnqualifiedNum(0); - } int storageResult = storageOrderMapper.insertWarehouseStorageOrder(storageOrder); if(storageResult<=0){ throw new BusinessException("新增入库单失败"); @@ -611,11 +613,22 @@ public class QualityOrderReportServiceImpl implements IQualityOrderReportService int orderPendingReviewNum = qualityOrder.getPendingReviewNum(); orderPendingReviewNum = orderPendingReviewNum - checkNum; qualityOrder.setPendingReviewNum(orderPendingReviewNum); + int orderQualifiedNum = qualityOrder.getQualityQualifiedNum(); + int orderUnqualifiedNum = qualityOrder.getQualityUnqualifiedNum(); + int qualityNum = orderQualifiedNum + orderUnqualifiedNum + orderPendingReviewNum; + if(qualityNum == 0){ + qualityOrder.setQualityStatus("0");//待品质 + } + if(qualityNum < qualityOrder.getThisArrivedNum()){ + qualityOrder.setQualityStatus("1");//部分品质 + } + if(qualityNum == qualityOrder.getThisArrivedNum()){ + qualityOrder.setQualityStatus("2");//全部品质 + } qualityOrder.setUpdateBy(loginName); qualityOrder.setUpdateTime(DateUtils.getNowDate()); qualityOrderMapper.updateQualityOrder(qualityOrder); - /* * 更新设备状态(成品品质时才存在)*/ List deviceIds = qualityOrderReportVO.getQualityReportDeviceIds(); @@ -643,6 +656,7 @@ public class QualityOrderReportServiceImpl implements IQualityOrderReportService WarehouseStorageOrder storageOrder = new WarehouseStorageOrder(); storageOrder.setWarehouseStorageCode(storageOrderCode); storageOrder.setRelatedOrderCode(qualityReportVO.getRelatedOrderCode()); + storageOrder.setQualityOrderCode(qualityReportVO.getQualityOrderCode()); storageOrder.setNotifyArrivedNum(qualityReportVO.getQualityHasqualifiedNum()); storageOrder.setQualityQualifiedNum(qualityReportVO.getQualityHasqualifiedNum()); storageOrder.setQualityUnqualifiedNum(qualityReportVO.getProcessBadNum()); diff --git a/ruoyi-admin/src/main/resources/mapper/quality/QualityOrderMapper.xml b/ruoyi-admin/src/main/resources/mapper/quality/QualityOrderMapper.xml index f8dbadc5..c969c566 100644 --- a/ruoyi-admin/src/main/resources/mapper/quality/QualityOrderMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/quality/QualityOrderMapper.xml @@ -62,6 +62,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and quality_order_code = #{qualityOrderCode} and in_storage_code = #{inStorageCode} + and material_no like concat('%', #{materialNo}, '%') + and material_name like concat('%', #{materialName}, '%') and related_order_code = #{relatedOrderCode} and quality_status = #{qualityStatus} and quality_order_type = #{qualityOrderType}