From 54978a01b0da561576ab594b611c96c30a930fcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=99=93=E8=BF=AA?= <2596750866@qq.com> Date: Fri, 22 Nov 2024 16:09:40 +0800 Subject: [PATCH] =?UTF-8?q?[feat]=20=E5=93=81=E8=B4=A8=E7=AE=A1=E7=90=86?= =?UTF-8?q?=20=E5=93=81=E8=B4=A8=E5=8D=95=20=E6=96=B0=E5=A2=9E=E5=93=81?= =?UTF-8?q?=E8=B4=A8=E5=8D=95mapper=E5=88=97=E8=A1=A8=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E6=96=99=E5=8F=B7=E3=80=81=E7=89=A9=E6=96=99=E5=90=8D=E7=A7=B0?= =?UTF-8?q?=E6=A8=A1=E7=B3=8A=E6=90=9C=E7=B4=A2=EF=BC=9B=20=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E5=93=81=E8=B4=A8=E5=8D=95=E6=9F=A5=E8=AF=A2=E6=9D=A5?= =?UTF-8?q?=E6=96=99=E5=93=81=E8=B4=A8=E5=8D=95controller=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=EF=BC=9B=20=E6=96=B0=E5=A2=9E=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E5=93=81=E8=B4=A8=E6=8A=A5=E5=91=8A=E5=8D=95=E5=88=97=E8=A1=A8?= =?UTF-8?q?=EF=BC=88=E4=B8=8D=E5=88=86=E9=A1=B5=EF=BC=89service=E5=92=8Cco?= =?UTF-8?q?ntroller=E6=96=B9=E6=B3=95=EF=BC=9B=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=93=81=E8=B4=A8=E6=8A=A5=E5=91=8A=E5=8D=95=E5=90=AF=E5=8A=A8?= =?UTF-8?q?=E6=B5=81=E7=A8=8Bservice=E6=96=B9=E6=B3=95=EF=BC=8C=E6=8F=90?= =?UTF-8?q?=E4=BA=A4=E5=8D=B3=E7=BB=93=E6=9D=9F=E6=97=B6=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E5=AE=A1=E6=A0=B8=E9=80=9A=E8=BF=87=E6=95=B0=E6=8D=AE=EF=BC=8C?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AE=A1=E6=89=B9=E9=80=9A=E8=BF=87=E3=80=81?= =?UTF-8?q?=E6=8B=92=E7=BB=9Dservice=E6=96=B9=E6=B3=95=EF=BC=8C=E6=A0=B9?= =?UTF-8?q?=E6=8D=AE=E6=95=B0=E9=87=8F=E6=9B=B4=E6=96=B0=E5=93=81=E8=B4=A8?= =?UTF-8?q?=E5=8D=95=E5=93=81=E8=B4=A8=E7=8A=B6=E6=80=81=EF=BC=8C=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E7=94=9F=E6=88=90=E5=85=A5=E5=BA=93=E5=8D=95service?= =?UTF-8?q?=E6=96=B9=E6=B3=95=EF=BC=8C=E6=B7=BB=E5=8A=A0=E5=93=81=E8=B4=A8?= =?UTF-8?q?=E5=8D=95=E5=8F=B7=E8=B5=8B=E5=80=BC=E8=AF=AD=E5=8F=A5=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/QualityOrderController.java | 29 ++++++++++++++ .../QualityOrderReportController.java | 19 ++++++---- .../service/IQualityOrderReportService.java | 4 ++ .../impl/QualityOrderReportServiceImpl.java | 38 +++++++++++++------ .../mapper/quality/QualityOrderMapper.xml | 2 + 5 files changed, 73 insertions(+), 19 deletions(-) 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}