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