From bf918f68d03f512cade569d551dfe0d76b930fd3 Mon Sep 17 00:00:00 2001 From: liuxiaoxu <1793812695@qq.com> Date: Mon, 20 May 2024 18:47:42 +0800 Subject: [PATCH] =?UTF-8?q?[feat]=E5=93=81=E8=B4=A8=E7=AE=A1=E7=90=86:=20?= =?UTF-8?q?=E5=93=81=E8=B4=A8=E5=8D=95=20=E6=96=B0=E5=A2=9E=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E5=93=81=E8=B4=A8=E5=8D=95=E8=AF=A6=E6=83=85=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=20=E5=93=81=E8=B4=A8=E5=8D=95=E5=AE=9E=E4=BD=93?= =?UTF-8?q?=E7=B1=BB=E6=96=B0=E5=A2=9E=E4=BB=93=E5=BA=93id=E5=92=8C?= =?UTF-8?q?=E4=BB=93=E5=BA=93=E5=90=8D=E7=A7=B0=E5=AD=97=E6=AE=B5=20qualit?= =?UTF-8?q?yOrder.html=E6=96=B0=E5=A2=9E=E5=93=81=E8=B4=A8=E6=8A=A5?= =?UTF-8?q?=E5=91=8A=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/QualityOrderController.java | 56 ++++++++++--------- .../ruoyi/quality/domain/QualityOrder.java | 40 +++++++++++++ .../QualityManufacturingProcessMapper.xml | 2 +- .../mapper/quality/QualityOrderMapper.xml | 10 +++- .../quality/qualityOrder/qualityOrder.html | 17 +++--- .../quality/qualityOrder/startingQuality.html | 5 ++ 6 files changed, 92 insertions(+), 38 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 05283f2b..42a0732c 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 @@ -1,15 +1,16 @@ package com.ruoyi.quality.controller; import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +import com.ruoyi.quality.domain.QualityOrderDetail; +import com.ruoyi.quality.service.IQualityOrderDetailService; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.*; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.enums.BusinessType; import com.ruoyi.quality.domain.QualityOrder; @@ -34,6 +35,9 @@ public class QualityOrderController extends BaseController @Autowired private IQualityOrderService qualityOrderService; + @Autowired + private IQualityOrderDetailService detailService; + @RequiresPermissions("quality:qualityOrder:view") @GetMapping() public String qualityOrder() @@ -113,39 +117,37 @@ public class QualityOrderController extends BaseController } /** - * 删除品质管理品质单 + * 品质单开始品质 */ - @RequiresPermissions("quality:qualityOrder:remove") - @Log(title = "品质管理品质单", businessType = BusinessType.DELETE) - @PostMapping( "/remove") - @ResponseBody - public AjaxResult remove(String ids) + @GetMapping("/startingQuality/{qualityOrderId}") + public String startingQuality(@PathVariable("qualityOrderId") Long qualityOrderId, ModelMap mmap) { - return toAjax(qualityOrderService.deleteQualityOrderByIds(ids)); + QualityOrder qualityOrder = qualityOrderService.selectQualityOrderById(qualityOrderId); + mmap.put("qualityOrder", qualityOrder); + return prefix + "/startingQuality"; } /** - * 作废品质管理品质单 + * 修改保存品质单开始品质 */ - @RequiresPermissions("quality:qualityOrder:cancel") - @Log(title = "品质管理品质单", businessType = BusinessType.CANCEL) - @GetMapping( "/cancel/{id}") + @RequiresPermissions("quality:qualityOrder:startingQuality") + @Log(title = "品质管理品质单", businessType = BusinessType.UPDATE) + @PostMapping("/startingQuality") @ResponseBody - public AjaxResult cancel(@PathVariable("id") Long id){ - return toAjax(qualityOrderService.cancelQualityOrderById(id)); + public AjaxResult startingQualitySave(QualityOrder qualityOrder) + { + return toAjax(qualityOrderService.updateQualityOrder(qualityOrder)); } /** - * 恢复品质管理品质单 + * 品质单详情列表 */ - @RequiresPermissions("quality:qualityOrder:restore") - @Log(title = "品质管理品质单", businessType = BusinessType.RESTORE) - @GetMapping( "/restore/{id}") @ResponseBody - public AjaxResult restore(@PathVariable("id")Long id) - { - return toAjax(qualityOrderService.restoreQualityOrderById(id)); + @RequestMapping("/detailListGroupedBySupplier") + public Map> detailListGroupedBySupplier(String qualityOrderCode) { + List allDetails = detailService.selectQualityOrderDetailListByCode(qualityOrderCode); + Map> groupedDetails = allDetails.stream() + .collect(Collectors.groupingBy(QualityOrderDetail::getSupplierCode)); + return groupedDetails; } - - } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/quality/domain/QualityOrder.java b/ruoyi-admin/src/main/java/com/ruoyi/quality/domain/QualityOrder.java index 387e220c..14d68db3 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/quality/domain/QualityOrder.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/quality/domain/QualityOrder.java @@ -1,6 +1,8 @@ package com.ruoyi.quality.domain; import java.util.Date; +import java.util.List; + import com.fasterxml.jackson.annotation.JsonFormat; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; @@ -56,6 +58,14 @@ public class QualityOrder extends BaseEntity @Excel(name = "品质不合格数") private Integer qualityUnqualifiedNum; + /** 仓库Id */ + @Excel(name = "仓库Id") + private String warehouseCode; + + /** 仓库名称 */ + @Excel(name = "仓库名称") + private String warehouseName; + /** 交付质检时间 */ @JsonFormat(pattern = "yyyy-MM-dd") @Excel(name = "交付质检时间", width = 30, dateFormat = "yyyy-MM-dd") @@ -65,6 +75,9 @@ public class QualityOrder extends BaseEntity @Excel(name = "品质员工") private String qualityEmployee; + /** 品质单详情*/ + private List qualityOrderDetailList; + public void setQualityOrderId(Long qualityOrderId) { this.qualityOrderId = qualityOrderId; @@ -174,6 +187,30 @@ public class QualityOrder extends BaseEntity return qualityEmployee; } + public String getWarehouseCode() { + return warehouseCode; + } + + public void setWarehouseCode(String warehouseCode) { + this.warehouseCode = warehouseCode; + } + + public String getWarehouseName() { + return warehouseName; + } + + public void setWarehouseName(String warehouseName) { + this.warehouseName = warehouseName; + } + + public List getQualityOrderDetailList() { + return qualityOrderDetailList; + } + + public void setQualityOrderDetailList(List qualityOrderDetailList) { + this.qualityOrderDetailList = qualityOrderDetailList; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) @@ -189,6 +226,9 @@ public class QualityOrder extends BaseEntity .append("qualityUnqualifiedNum", getQualityUnqualifiedNum()) .append("deliveryInspectionTime", getDeliveryInspectionTime()) .append("qualityEmployee", getQualityEmployee()) + .append("warehouseCode", getWarehouseCode()) + .append("warehouseName", getWarehouseName()) + .append("qualityOrderDetailList",getQualityOrderDetailList()) .append("remark", getRemark()) .append("createBy", getCreateBy()) .append("createTime", getCreateTime()) diff --git a/ruoyi-admin/src/main/resources/mapper/quality/QualityManufacturingProcessMapper.xml b/ruoyi-admin/src/main/resources/mapper/quality/QualityManufacturingProcessMapper.xml index 76547a12..e39ff019 100644 --- a/ruoyi-admin/src/main/resources/mapper/quality/QualityManufacturingProcessMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/quality/QualityManufacturingProcessMapper.xml @@ -49,7 +49,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where manufacturing_process_autoid = #{manufacturingProcessAutoid} - where manufacturing_process_code = #{manufacturingProcessCode} diff --git a/ruoyi-admin/src/main/resources/mapper/quality/QualityOrderMapper.xml b/ruoyi-admin/src/main/resources/mapper/quality/QualityOrderMapper.xml index ca193dc5..9134ee05 100644 --- a/ruoyi-admin/src/main/resources/mapper/quality/QualityOrderMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/quality/QualityOrderMapper.xml @@ -17,6 +17,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + @@ -25,7 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select quality_order_id, quality_order_code, in_storage_code, related_order_code, quality_status, quality_order_type, quality_storage_status, this_arrived_num, quality_qualified_num, quality_unqualified_num, delivery_inspection_time, quality_employee, remark, create_by, create_time, update_by, update_time from quality_order + select quality_order_id, quality_order_code, in_storage_code, related_order_code, quality_status, quality_order_type, quality_storage_status, this_arrived_num, quality_qualified_num, quality_unqualified_num, warehouse_code, warehouse_name,delivery_inspection_time, quality_employee, remark, create_by, create_time, update_by, update_time from quality_order