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