From 16aec3d48071ea87b50e9ae69952385eb636fc01 Mon Sep 17 00:00:00 2001 From: liuxiaoxu <1793812695@qq.com> Date: Mon, 27 May 2024 09:14:38 +0800 Subject: [PATCH] =?UTF-8?q?[fix]=E5=93=81=E8=B4=A8=E7=AE=A1=E7=90=86:=20?= =?UTF-8?q?=E9=80=80=E6=8D=A2=E8=B4=A7=20=E6=96=B0=E5=A2=9E=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=93=81=E8=B4=A8=E6=8A=A5=E5=91=8A=E5=89=8D=E7=AB=AF?= =?UTF-8?q?=E6=8C=89=E9=92=AE=20=E6=96=B0=E5=A2=9E=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=93=81=E8=B4=A8=E6=8A=A5=E5=91=8A=E5=90=8E=E7=AB=AF=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=20=E6=96=B0=E5=A2=9E=E5=93=81=E8=B4=A8=E6=8A=A5?= =?UTF-8?q?=E5=91=8A=E9=A1=B5=E9=9D=A2qualityOrderReport.html=20=E9=80=80?= =?UTF-8?q?=E6=8D=A2=E8=B4=A7=E8=AF=A6=E6=83=85=E6=96=B0=E5=A2=9E=E5=A4=87?= =?UTF-8?q?=E6=B3=A8=E5=92=8C=E6=A3=80=E9=AA=8C=E5=AE=8C=E6=88=90=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../QualityRefundsExchangesController.java | 16 ++++++----- .../domain/QualityRefundsExchangesDetail.java | 28 +++++++++++++++++++ ...lityRefundsExchangesDetailServiceImpl.java | 25 +++++++++++++++++ .../QualityRefundsExchangesDetailMapper.xml | 6 +++- .../quality/refundsExchanges/add.html | 6 ++-- .../refundsExchanges/qualityOrderReport.html | 25 +++++++++++------ 6 files changed, 87 insertions(+), 19 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/quality/controller/QualityRefundsExchangesController.java b/ruoyi-admin/src/main/java/com/ruoyi/quality/controller/QualityRefundsExchangesController.java index 35a8adef..2f12d859 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/quality/controller/QualityRefundsExchangesController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/quality/controller/QualityRefundsExchangesController.java @@ -6,8 +6,10 @@ import com.ruoyi.common.utils.StringUtils; import com.ruoyi.erp.domain.ErpMaterialVo; import com.ruoyi.erp.service.IErpMaterialService; import com.ruoyi.quality.domain.QualityOrderReport; +import com.ruoyi.quality.domain.QualityRefundsExchangesDetail; import com.ruoyi.quality.domain.QualityRefundsExchangesUnqualified; import com.ruoyi.quality.domain.VO.CheckoutMaterialVO; +import com.ruoyi.quality.service.IQualityRefundsExchangesDetailService; import com.ruoyi.quality.service.IQualityRefundsExchangesUnqualifiedService; import lombok.extern.slf4j.Slf4j; import org.apache.poi.ss.formula.functions.T; @@ -47,6 +49,9 @@ public class QualityRefundsExchangesController extends BaseController @Autowired private IQualityRefundsExchangesUnqualifiedService refundsExchangesUnqualifiedService; + @Autowired + private IQualityRefundsExchangesDetailService refundsExchangesDetailService; + @RequiresPermissions("quality:refundsExchanges:view") @GetMapping() public String refundsExchanges() @@ -188,11 +193,8 @@ public class QualityRefundsExchangesController extends BaseController if (StringUtils.isEmpty(refundsExchangesCode)){ log.warn("退换货号为空:{}",refundsExchangesCode); } - QualityRefundsExchangesUnqualified tempRefundsExchangesUnqualified = new QualityRefundsExchangesUnqualified(); - tempRefundsExchangesUnqualified.setRefundsExchangesCode(refundsExchangesCode); - tempRefundsExchangesUnqualified.setMaterialNo(materialNo); - QualityRefundsExchangesUnqualified refundsExchangesUnqualified=refundsExchangesUnqualifiedService.selectRefundsExchangesUnqualifiedByNoAndCode(tempRefundsExchangesUnqualified); - mmap.put("refundsExchangesUnqualified", refundsExchangesUnqualified); + mmap.put("materialNo",materialNo); + mmap.put("refundsExchangesCode",refundsExchangesCode); return prefix + "/qualityOrderReport"; } @@ -203,9 +205,9 @@ public class QualityRefundsExchangesController extends BaseController @Log(title = "品质管理品质单", businessType = BusinessType.INSERT) @PostMapping("/qualityReport") @ResponseBody - public AjaxResult qualityReportSave(@RequestBody QualityRefundsExchangesUnqualified refundsExchangesUnqualified) + public AjaxResult qualityReportSave(@RequestBody QualityRefundsExchangesDetail refundsExchangesDetail) { - return toAjax(refundsExchangesUnqualifiedService.addRefundsExchangesUnqualified(refundsExchangesUnqualified)); + return toAjax(refundsExchangesDetailService.insertQualityRefundsExchangesDetail(refundsExchangesDetail)); } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/quality/domain/QualityRefundsExchangesDetail.java b/ruoyi-admin/src/main/java/com/ruoyi/quality/domain/QualityRefundsExchangesDetail.java index 0f75ed65..92f059f9 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/quality/domain/QualityRefundsExchangesDetail.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/quality/domain/QualityRefundsExchangesDetail.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; @@ -97,10 +99,18 @@ public class QualityRefundsExchangesDetail extends BaseEntity @Excel(name = "交付质检时间", width = 30, dateFormat = "yyyy-MM-dd") private Date deliveryInspectionTime; + /** 检验完成时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "检验完成时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date inspectionTime; + /** 品质备注 */ @Excel(name = "品质备注") private String qualityRemark; + /*不合格分类列表*/ + private List refundsExchangesUnqualifieds; + public void setRefundsExchangesDetailId(Long refundsExchangesDetailId) { this.refundsExchangesDetailId = refundsExchangesDetailId; @@ -291,6 +301,22 @@ public class QualityRefundsExchangesDetail extends BaseEntity return qualityRemark; } + public Date getInspectionTime() { + return inspectionTime; + } + + public void setInspectionTime(Date inspectionTime) { + this.inspectionTime = inspectionTime; + } + + public List getRefundsExchangesUnqualifieds() { + return refundsExchangesUnqualifieds; + } + + public void setRefundsExchangesUnqualifieds(List refundsExchangesUnqualifieds) { + this.refundsExchangesUnqualifieds = refundsExchangesUnqualifieds; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) @@ -314,12 +340,14 @@ public class QualityRefundsExchangesDetail extends BaseEntity .append("materialProcessMethod", getMaterialProcessMethod()) .append("refundsExchangesNum", getRefundsExchangesNum()) .append("deliveryInspectionTime", getDeliveryInspectionTime()) + .append("inspectionTime", getInspectionTime()) .append("qualityRemark", getQualityRemark()) .append("remark", getRemark()) .append("createBy", getCreateBy()) .append("createTime", getCreateTime()) .append("updateBy", getUpdateBy()) .append("updateTime", getUpdateTime()) + .append("refundsExchangesUnqualifieds",getRefundsExchangesUnqualifieds()) .toString(); } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityRefundsExchangesDetailServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityRefundsExchangesDetailServiceImpl.java index e008cf5c..8c4304d9 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityRefundsExchangesDetailServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityRefundsExchangesDetailServiceImpl.java @@ -1,14 +1,19 @@ package com.ruoyi.quality.service.impl; +import java.util.Date; import java.util.List; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.ShiroUtils; +import com.ruoyi.quality.domain.QualityRefundsExchangesUnqualified; +import com.ruoyi.quality.mapper.QualityOrderReportUnqualifiedMapper; +import com.ruoyi.quality.mapper.QualityRefundsExchangesUnqualifiedMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.ruoyi.quality.mapper.QualityRefundsExchangesDetailMapper; import com.ruoyi.quality.domain.QualityRefundsExchangesDetail; import com.ruoyi.quality.service.IQualityRefundsExchangesDetailService; import com.ruoyi.common.core.text.Convert; +import org.springframework.transaction.annotation.Transactional; /** * 品质管理退换货单详情Service业务层处理 @@ -22,6 +27,9 @@ public class QualityRefundsExchangesDetailServiceImpl implements IQualityRefunds @Autowired private QualityRefundsExchangesDetailMapper qualityRefundsExchangesDetailMapper; + @Autowired + private QualityRefundsExchangesUnqualifiedMapper unqualifiedMapper; + /** * 查询品质管理退换货单详情 * @@ -52,12 +60,29 @@ public class QualityRefundsExchangesDetailServiceImpl implements IQualityRefunds * @param qualityRefundsExchangesDetail 品质管理退换货单详情 * @return 结果 */ + @Transactional @Override public int insertQualityRefundsExchangesDetail(QualityRefundsExchangesDetail qualityRefundsExchangesDetail) { String loginName = ShiroUtils.getLoginName(); qualityRefundsExchangesDetail.setCreateBy(loginName); qualityRefundsExchangesDetail.setCreateTime(DateUtils.getNowDate()); + + //获取前端不合格分类列表 + List refundsExchangesUnqualifieds = qualityRefundsExchangesDetail.getRefundsExchangesUnqualifieds(); + for (QualityRefundsExchangesUnqualified temp : refundsExchangesUnqualifieds) { + QualityRefundsExchangesUnqualified refundsExchangesUnqualified = new QualityRefundsExchangesUnqualified(); + refundsExchangesUnqualified.setRefundsExchangesCode(qualityRefundsExchangesDetail.getRefundsExchangesCode()); + refundsExchangesUnqualified.setMaterialNo(qualityRefundsExchangesDetail.getMaterialNo()); + refundsExchangesUnqualified.setInspectionTime(qualityRefundsExchangesDetail.getInspectionTime()); + refundsExchangesUnqualified.setProcessBadClassification(temp.getProcessBadClassification()); + refundsExchangesUnqualified.setProcessBadGrade(temp.getProcessBadGrade()); + refundsExchangesUnqualified.setProcessBadNum(temp.getProcessBadNum()); + refundsExchangesUnqualified.setRemark(temp.getRemark()); + refundsExchangesUnqualified.setCreateBy(loginName); + refundsExchangesUnqualified.setCreateTime(new Date()); + unqualifiedMapper.insertQualityRefundsExchangesUnqualified(refundsExchangesUnqualified); + } return qualityRefundsExchangesDetailMapper.insertQualityRefundsExchangesDetail(qualityRefundsExchangesDetail); } diff --git a/ruoyi-admin/src/main/resources/mapper/quality/QualityRefundsExchangesDetailMapper.xml b/ruoyi-admin/src/main/resources/mapper/quality/QualityRefundsExchangesDetailMapper.xml index 0ed8e0eb..04917711 100644 --- a/ruoyi-admin/src/main/resources/mapper/quality/QualityRefundsExchangesDetailMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/quality/QualityRefundsExchangesDetailMapper.xml @@ -25,6 +25,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -34,7 +35,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select refunds_exchanges_detail_id, refunds_exchanges_code, refunds_exchanges_status, quality_warehouse_status, quality_purchase_status, related_order_code, in_storage_code, quality_return_node, material_total, num_total, material_no, material_name, material_type, material_photoUrl, material_brand, material_unit, material_describe, material_process_method, refunds_exchanges_num, delivery_inspection_time, quality_remark, remark, create_by, create_time, update_by, update_time from quality_refunds_exchanges_detail + select refunds_exchanges_detail_id, refunds_exchanges_code, refunds_exchanges_status, quality_warehouse_status, quality_purchase_status, related_order_code, in_storage_code, quality_return_node, material_total, num_total, material_no, material_name, material_type, material_photoUrl, material_brand, material_unit, material_describe, material_process_method, refunds_exchanges_num, delivery_inspection_time, inspection_time ,quality_remark, remark, create_by, create_time, update_by, update_time from quality_refunds_exchanges_detail @@ -17,7 +17,7 @@
- +
@@ -163,7 +163,7 @@ formatter: function(value, row, index) { // 这里直接使用row对象获取refundsExchangesCode,假设它是存在的 var actions = []; - actions.push('报告 '); + actions.push('报告 '); return actions.join(''); } }, diff --git a/ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/qualityOrderReport.html b/ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/qualityOrderReport.html index 495c8ae3..b789d32e 100644 --- a/ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/qualityOrderReport.html +++ b/ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/qualityOrderReport.html @@ -6,7 +6,7 @@
-
+
@@ -30,10 +30,10 @@
- +
- +
@@ -41,7 +41,7 @@
- +
@@ -50,18 +50,23 @@