From 43cbb6841034e4118a94beb634e87e23158c8fe5 Mon Sep 17 00:00:00 2001 From: liuxiaoxu <1793812695@qq.com> Date: Mon, 13 May 2024 19:33:24 +0800 Subject: [PATCH] =?UTF-8?q?[feat]=E5=93=81=E8=B4=A8=E7=AE=A1=E7=90=86:=20?= =?UTF-8?q?=E5=88=B6=E7=A8=8B=E6=A3=80=E9=AA=8C=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E5=9B=9E=E6=98=BE=E5=88=B0=E5=89=8D=E7=AB=AF=E7=9A=84=E7=89=A9?= =?UTF-8?q?=E6=96=99=E4=BF=A1=E6=81=AFCheckoutMaterialVO=E7=B1=BB=20?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E4=B8=8E=E7=94=9F=E4=BA=A7=E5=8D=95=E5=8F=B7?= =?UTF-8?q?=E6=9C=89=E5=85=B3=E7=9A=84=E6=9F=A5=E8=AF=A2=E7=89=A9=E6=96=99?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AftersalesComplaintNoticeServiceImpl.java | 1 - ...ualityManufacturingCheckoutController.java | 39 +++++----- .../quality/domain/VO/CheckoutMaterialVO.java | 43 +++++++++++ .../IQualityManufacturingCheckoutService.java | 6 ++ ...alityManufacturingCheckoutServiceImpl.java | 39 ++++++++++ .../manufacturingCheckout/materialSelect.html | 77 +++++++++++++++++++ 6 files changed, 183 insertions(+), 22 deletions(-) create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/quality/domain/VO/CheckoutMaterialVO.java create mode 100644 ruoyi-admin/src/main/resources/templates/quality/manufacturingCheckout/materialSelect.html diff --git a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesComplaintNoticeServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesComplaintNoticeServiceImpl.java index ba965045..47584848 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesComplaintNoticeServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesComplaintNoticeServiceImpl.java @@ -189,7 +189,6 @@ public class AftersalesComplaintNoticeServiceImpl implements IAftersalesComplain if (StringUtils.isEmpty(sysMakeorderBoms)){ // 记录日志 log.warn("未查找到与生产订单关联的物料相关数据, 生产订单号: {}", makeNo); - throw new RuntimeException("未查找到物料相关数据"); } for (SysMakeorderBom sysMakeorderBom : sysMakeorderBoms) { AftersalesMaterialVO aftersalesMaterialVO = new AftersalesMaterialVO(); diff --git a/ruoyi-admin/src/main/java/com/ruoyi/quality/controller/QualityManufacturingCheckoutController.java b/ruoyi-admin/src/main/java/com/ruoyi/quality/controller/QualityManufacturingCheckoutController.java index ff2da59f..e707d501 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/quality/controller/QualityManufacturingCheckoutController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/quality/controller/QualityManufacturingCheckoutController.java @@ -1,15 +1,14 @@ package com.ruoyi.quality.controller; import java.util.List; + +import com.ruoyi.aftersales.domain.vo.AftersalesMaterialVO; +import com.ruoyi.quality.domain.VO.CheckoutMaterialVO; 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.QualityManufacturingCheckout; @@ -124,28 +123,26 @@ public class QualityManufacturingCheckoutController extends BaseController return toAjax(qualityManufacturingCheckoutService.deleteQualityManufacturingCheckoutByIds(ids)); } + /** - * 作废品质管理制程检验 + * 查找与客户生产单号有关的物料信息 */ - @RequiresPermissions("quality:manufacturingCheckout:cancel") - @Log(title = "品质管理制程检验", businessType = BusinessType.CANCEL) - @GetMapping( "/cancel/{id}") - @ResponseBody - public AjaxResult cancel(@PathVariable("id") Long id){ - return toAjax(qualityManufacturingCheckoutService.cancelQualityManufacturingCheckoutById(id)); + @GetMapping("/materialSelect") + public String materialSelect(@RequestParam String makeNo, ModelMap modelMap) + { + modelMap.put("makeNo",makeNo); + return prefix + "/materialSelect"; } /** - * 恢复品质管理制程检验 - */ - @RequiresPermissions("quality:manufacturingCheckout:restore") - @Log(title = "品质管理制程检验", businessType = BusinessType.RESTORE) - @GetMapping( "/restore/{id}") + * 查找与客户生产单号有关的物料信息 + * */ @ResponseBody - public AjaxResult restore(@PathVariable("id")Long id) - { - return toAjax(qualityManufacturingCheckoutService.restoreQualityManufacturingCheckoutById(id)); + @PostMapping("/getMaterialInfoByMakeNo") + public TableDataInfo getMaterialInfoByMakeNo(@RequestParam String makeNo){ + startPage(); + List list = qualityManufacturingCheckoutService.selectMaterialInfoByMakeNo(makeNo); + return getDataTable(list); } - } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/quality/domain/VO/CheckoutMaterialVO.java b/ruoyi-admin/src/main/java/com/ruoyi/quality/domain/VO/CheckoutMaterialVO.java new file mode 100644 index 00000000..0198c4e0 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/quality/domain/VO/CheckoutMaterialVO.java @@ -0,0 +1,43 @@ +package com.ruoyi.quality.domain.VO; + +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import lombok.Data; + +@Data +public class CheckoutMaterialVO extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** 料号 */ + @Excel(name = "料号") + private String materialNo; + + /** 物料名称 */ + @Excel(name = "物料名称") + private String materialName; + + /** 物料类型 */ + @Excel(name = "物料类型") + private String materialType; + + /** 物料图片地址 */ + @Excel(name = "物料图片地址") + private String materialPhotourl; + + /** 物料品牌 */ + @Excel(name = "物料品牌") + private String materialBrand; + + /** 物料单位 */ + @Excel(name = "物料单位") + private String materialUnit; + + /** 物料描述 */ + @Excel(name = "物料描述") + private String materialDescribe; + + /** 物料加工方式 */ + @Excel(name = "物料加工方式") + private String materialProcessMethod; + +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/quality/service/IQualityManufacturingCheckoutService.java b/ruoyi-admin/src/main/java/com/ruoyi/quality/service/IQualityManufacturingCheckoutService.java index ce42b5b3..11d84354 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/quality/service/IQualityManufacturingCheckoutService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/quality/service/IQualityManufacturingCheckoutService.java @@ -2,6 +2,7 @@ package com.ruoyi.quality.service; import java.util.List; import com.ruoyi.quality.domain.QualityManufacturingCheckout; +import com.ruoyi.quality.domain.VO.CheckoutMaterialVO; /** * 品质管理制程检验Service接口 @@ -72,4 +73,9 @@ public interface IQualityManufacturingCheckoutService * @return */ int restoreQualityManufacturingCheckoutById(Long manufacturingCheckoutId); + + /* + * 查找与制程检验有关的物料信息 + * */ + List selectMaterialInfoByMakeNo(String makeNo); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityManufacturingCheckoutServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityManufacturingCheckoutServiceImpl.java index 38ca14e7..fff69d59 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityManufacturingCheckoutServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityManufacturingCheckoutServiceImpl.java @@ -2,13 +2,19 @@ package com.ruoyi.quality.service.impl; import java.text.DecimalFormat; import java.text.SimpleDateFormat; +import java.util.ArrayList; import java.util.Date; import java.util.List; +import com.ruoyi.aftersales.domain.vo.AftersalesMaterialVO; import com.ruoyi.common.exception.BusinessException; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.ShiroUtils; import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.quality.domain.VO.CheckoutMaterialVO; +import com.ruoyi.system.domain.SysMakeorderBom; +import com.ruoyi.system.mapper.SysMakeorderBomMapper; +import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.ruoyi.quality.mapper.QualityManufacturingCheckoutMapper; @@ -23,12 +29,16 @@ import org.springframework.transaction.annotation.Transactional; * @author 刘晓旭 * @date 2024-05-13 */ +@Slf4j @Service public class QualityManufacturingCheckoutServiceImpl implements IQualityManufacturingCheckoutService { @Autowired private QualityManufacturingCheckoutMapper qualityManufacturingCheckoutMapper; + @Autowired + private SysMakeorderBomMapper sysMakeorderBomMapper; + /** * 查询品质管理制程检验 * @@ -164,4 +174,33 @@ public class QualityManufacturingCheckoutServiceImpl implements IQualityManufact { return qualityManufacturingCheckoutMapper.restoreQualityManufacturingCheckoutById(manufacturingCheckoutId); } + + /* + * 查找与制程检验有关的物料信息 + * */ + @Override + public List selectMaterialInfoByMakeNo(String makeNo) { + + ArrayList checkoutMaterialVOS = new ArrayList<>(); + + List sysMakeorderBoms = sysMakeorderBomMapper.selectSysMakeorderBomByMakeNo(makeNo); + if (StringUtils.isEmpty(sysMakeorderBoms)){ + // 记录日志 + log.warn("未查找到与生产订单关联的物料相关数据, 生产订单号: {}", makeNo); + } + + for (SysMakeorderBom sysMakeorderBom : sysMakeorderBoms) { + CheckoutMaterialVO checkoutMaterialVO = new CheckoutMaterialVO(); + checkoutMaterialVO.setMaterialNo(sysMakeorderBom.getMaterialNo()); + checkoutMaterialVO.setMaterialBrand(sysMakeorderBom.getBrand()); + checkoutMaterialVO.setMaterialDescribe(sysMakeorderBom.getDescribe()); + checkoutMaterialVO.setMaterialName(sysMakeorderBom.getMaterialName()); + checkoutMaterialVO.setMaterialProcessMethod(sysMakeorderBom.getProcessMethod()); + checkoutMaterialVO.setMaterialPhotourl(sysMakeorderBom.getPhotoUrl()); + checkoutMaterialVO.setMaterialUnit(sysMakeorderBom.getUnit()); + checkoutMaterialVO.setMaterialType(sysMakeorderBom.getMaterialType()); + checkoutMaterialVOS.add(checkoutMaterialVO); + } + return checkoutMaterialVOS; + } } diff --git a/ruoyi-admin/src/main/resources/templates/quality/manufacturingCheckout/materialSelect.html b/ruoyi-admin/src/main/resources/templates/quality/manufacturingCheckout/materialSelect.html new file mode 100644 index 00000000..289567ca --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/quality/manufacturingCheckout/materialSelect.html @@ -0,0 +1,77 @@ + + + + + + +
+
+
+
+
+
+
+ + + + \ No newline at end of file