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