From a8ce7e13133e7428da45079b30376543c8b5faca Mon Sep 17 00:00:00 2001 From: liuxiaoxu <1793812695@qq.com> Date: Sat, 25 May 2024 10:54:42 +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=E9=80=80=E8=B4=A7=E5=8D=95=E6=8E=A5=E5=8F=A3=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=89=8D=E7=AB=AF=E9=A1=B5=E9=9D=A2=E8=A7=A6?= =?UTF-8?q?=E5=8F=91=E6=B7=BB=E5=8A=A0=E9=80=80=E8=B4=A7=E5=8D=95=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E7=9A=84=E6=9D=A1=E4=BB=B6=EF=BC=8C=E5=8F=AA=E6=9C=89?= =?UTF-8?q?=E9=80=80=E8=B4=A7=E8=8A=82=E7=82=B9=E4=B8=BA=E5=85=A5=E5=BA=93?= =?UTF-8?q?=E5=90=8E=E9=80=80=E8=B4=A7=E6=89=8D=E5=8F=AF=E4=BB=A5=E5=90=AF?= =?UTF-8?q?=E7=94=A8=E6=B7=BB=E5=8A=A0=E9=80=80=E8=B4=A7=E5=8D=95=E6=8C=89?= =?UTF-8?q?=E9=92=AE=20=E6=96=B0=E5=A2=9E=E6=9F=A5=E8=AF=A2=E5=93=81?= =?UTF-8?q?=E8=B4=A8=E7=AE=A1=E7=90=86=E9=80=80=E6=8D=A2=E8=B4=A7=E4=B8=8D?= =?UTF-8?q?=E5=90=88=E6=A0=BC=E5=88=86=E7=B1=BB=E6=8E=A5=E5=8F=A3=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=96=B0=E5=A2=9E=E5=93=81=E8=B4=A8=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E9=80=80=E6=8D=A2=E8=B4=A7=E5=8D=95=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../QualityRefundsExchangesController.java | 49 ++++++++++++++++++- ...lityRefundsExchangesUnqualifiedMapper.java | 8 +++ ...ityRefundsExchangesUnqualifiedService.java | 14 ++++++ .../QualityRefundsExchangesServiceImpl.java | 11 +++-- ...efundsExchangesUnqualifiedServiceImpl.java | 25 ++++++++++ ...alityRefundsExchangesUnqualifiedMapper.xml | 10 +++- .../quality/refundsExchanges/add.html | 24 +++++++-- .../refundsExchanges/qualityOrderReport.html | 2 +- .../refundsExchanges/refundsExchanges.html | 25 +++++++++- 9 files changed, 154 insertions(+), 14 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 44c236a9..35a8adef 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 @@ -2,10 +2,14 @@ package com.ruoyi.quality.controller; import java.util.List; +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.QualityRefundsExchangesUnqualified; import com.ruoyi.quality.domain.VO.CheckoutMaterialVO; +import com.ruoyi.quality.service.IQualityRefundsExchangesUnqualifiedService; +import lombok.extern.slf4j.Slf4j; import org.apache.poi.ss.formula.functions.T; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; @@ -27,6 +31,7 @@ import com.ruoyi.common.core.page.TableDataInfo; * @author 刘晓旭 * @date 2024-05-23 */ +@Slf4j @Controller @RequestMapping("/quality/refundsExchanges") public class QualityRefundsExchangesController extends BaseController @@ -39,6 +44,9 @@ public class QualityRefundsExchangesController extends BaseController @Autowired private IErpMaterialService erpMaterialService; + @Autowired + private IQualityRefundsExchangesUnqualifiedService refundsExchangesUnqualifiedService; + @RequiresPermissions("quality:refundsExchanges:view") @GetMapping() public String refundsExchanges() @@ -76,9 +84,10 @@ public class QualityRefundsExchangesController extends BaseController /** * 新增品质管理退换货单 */ - @GetMapping("/add") - public String add() + @GetMapping("/add/{refundsExchangesCode}") + public String add(@PathVariable("refundsExchangesCode") String refundsExchangesCode,ModelMap mmap) { + mmap.put("refundsExchangesCode", refundsExchangesCode); return prefix + "/add"; } @@ -163,4 +172,40 @@ public class QualityRefundsExchangesController extends BaseController return toAjax(qualityRefundsExchangesService.updateRefundsExchangesStatus(qualityRefundsExchanges)); } + + + + /** + * 修改品质单报告不良分类 + */ + @GetMapping("/qualityReport") + public String qualityReport( @RequestParam("materialNo") String materialNo, + @RequestParam("refundsExchangesCode") String refundsExchangesCode, ModelMap mmap) + { + if (StringUtils.isEmpty(materialNo)){ + log.warn("物料号为空:{}",materialNo); + } + 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); + return prefix + "/qualityOrderReport"; + } + + /** + * 新增保存品质单报告不良分类 + */ + @RequiresPermissions("quality:qualityOrder:qualityReport") + @Log(title = "品质管理品质单", businessType = BusinessType.INSERT) + @PostMapping("/qualityReport") + @ResponseBody + public AjaxResult qualityReportSave(@RequestBody QualityRefundsExchangesUnqualified refundsExchangesUnqualified) + { + return toAjax(refundsExchangesUnqualifiedService.addRefundsExchangesUnqualified(refundsExchangesUnqualified)); + } + } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/quality/mapper/QualityRefundsExchangesUnqualifiedMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/quality/mapper/QualityRefundsExchangesUnqualifiedMapper.java index fb1f8d1d..17f2de56 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/quality/mapper/QualityRefundsExchangesUnqualifiedMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/quality/mapper/QualityRefundsExchangesUnqualifiedMapper.java @@ -74,4 +74,12 @@ public interface QualityRefundsExchangesUnqualifiedMapper * @return 结果 */ public int restoreQualityRefundsExchangesUnqualifiedById(Long refundsExchangesUnqualifiedId); + + /** + * 查询品质管理退换货不合格分类 + * + * @param refundsExchangesUnqualified 品质管理退换货不合格分类 + * @return 品质管理退换货不合格分类 + */ + QualityRefundsExchangesUnqualified selectRefundsExchangesUnqualifiedByNoAndCode(QualityRefundsExchangesUnqualified refundsExchangesUnqualified); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/quality/service/IQualityRefundsExchangesUnqualifiedService.java b/ruoyi-admin/src/main/java/com/ruoyi/quality/service/IQualityRefundsExchangesUnqualifiedService.java index 765ffe15..799f11e5 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/quality/service/IQualityRefundsExchangesUnqualifiedService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/quality/service/IQualityRefundsExchangesUnqualifiedService.java @@ -72,4 +72,18 @@ public interface IQualityRefundsExchangesUnqualifiedService * @return */ int restoreQualityRefundsExchangesUnqualifiedById(Long refundsExchangesUnqualifiedId); + + + /** + * 查询品质管理退换货不合格分类 + * + * @param refundsExchangesUnqualified 品质管理退换货不合格分类 + * @return 品质管理退换货不合格分类 + */ + public QualityRefundsExchangesUnqualified selectRefundsExchangesUnqualifiedByNoAndCode(QualityRefundsExchangesUnqualified refundsExchangesUnqualified); + + /** + * 新增保存品质单报告不良分类 + */ + int addRefundsExchangesUnqualified(QualityRefundsExchangesUnqualified refundsExchangesUnqualified); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityRefundsExchangesServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityRefundsExchangesServiceImpl.java index 17573b23..03349b95 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityRefundsExchangesServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityRefundsExchangesServiceImpl.java @@ -69,6 +69,11 @@ public class QualityRefundsExchangesServiceImpl implements IQualityRefundsExchan public int insertQualityRefundsExchanges(QualityRefundsExchanges qualityRefundsExchanges) { + String refundsExchangesCode = qualityRefundsExchanges.getRefundsExchangesCode(); + + if (StringUtils.isEmpty(refundsExchangesCode)){ + log.warn("退换货单号为空:{}",refundsExchangesCode); + } String loginName = ShiroUtils.getLoginName(); List refundsExchangesDetails = qualityRefundsExchanges.getRefundsExchangesDetails(); if (StringUtils.isEmpty(refundsExchangesDetails)){ @@ -76,9 +81,9 @@ public class QualityRefundsExchangesServiceImpl implements IQualityRefundsExchan } for (QualityRefundsExchangesDetail tempDetail : refundsExchangesDetails) { QualityRefundsExchangesDetail refundsExchangesDetail = new QualityRefundsExchangesDetail(); - refundsExchangesDetail.setRefundsExchangesCode(tempDetail.getRefundsExchangesCode()); - refundsExchangesDetail.setDeliveryInspectionTime(tempDetail.getDeliveryInspectionTime()); - refundsExchangesDetail.setQualityRemark(tempDetail.getQualityRemark()); + refundsExchangesDetail.setRefundsExchangesCode(refundsExchangesCode); + refundsExchangesDetail.setDeliveryInspectionTime(qualityRefundsExchanges.getDeliveryInspectionTime()); + refundsExchangesDetail.setQualityRemark(qualityRefundsExchanges.getQualityRemark()); refundsExchangesDetail.setMaterialNo(tempDetail.getMaterialNo()); refundsExchangesDetail.setMaterialName(tempDetail.getMaterialName()); refundsExchangesDetail.setMaterialBrand(tempDetail.getMaterialBrand()); diff --git a/ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityRefundsExchangesUnqualifiedServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityRefundsExchangesUnqualifiedServiceImpl.java index 93a7c26e..8c54e285 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityRefundsExchangesUnqualifiedServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityRefundsExchangesUnqualifiedServiceImpl.java @@ -123,4 +123,29 @@ public class QualityRefundsExchangesUnqualifiedServiceImpl implements IQualityRe { return qualityRefundsExchangesUnqualifiedMapper.restoreQualityRefundsExchangesUnqualifiedById(refundsExchangesUnqualifiedId); } + + + /** + * 查询品质管理退换货不合格分类 + * + * @param refundsExchangesUnqualified 品质管理退换货不合格分类 + * @return 品质管理退换货不合格分类 + */ + @Override + public QualityRefundsExchangesUnqualified selectRefundsExchangesUnqualifiedByNoAndCode(QualityRefundsExchangesUnqualified refundsExchangesUnqualified) { + + return qualityRefundsExchangesUnqualifiedMapper.selectRefundsExchangesUnqualifiedByNoAndCode(refundsExchangesUnqualified); + } + + /** + * 新增保存品质单报告不良分类 + */ + @Override + public int addRefundsExchangesUnqualified(QualityRefundsExchangesUnqualified refundsExchangesUnqualified) { + + String loginName = ShiroUtils.getLoginName(); + refundsExchangesUnqualified.setUpdateBy(loginName); + refundsExchangesUnqualified.setUpdateTime(DateUtils.getNowDate()); + return qualityRefundsExchangesUnqualifiedMapper.insertQualityRefundsExchangesUnqualified(refundsExchangesUnqualified); + } } diff --git a/ruoyi-admin/src/main/resources/mapper/quality/QualityRefundsExchangesUnqualifiedMapper.xml b/ruoyi-admin/src/main/resources/mapper/quality/QualityRefundsExchangesUnqualifiedMapper.xml index f0588810..bed5552f 100644 --- a/ruoyi-admin/src/main/resources/mapper/quality/QualityRefundsExchangesUnqualifiedMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/quality/QualityRefundsExchangesUnqualifiedMapper.xml @@ -35,7 +35,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where refunds_exchanges_unqualified_id = #{refundsExchangesUnqualifiedId} - + + + + + insert into quality_refunds_exchanges_unqualified diff --git a/ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/add.html b/ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/add.html index c152022e..11fe92c4 100644 --- a/ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/add.html +++ b/ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/add.html @@ -45,6 +45,9 @@ \ No newline at end of file