From 14528063e03af888e61f4eec468f38d2816c1f65 Mon Sep 17 00:00:00 2001 From: liuxiaoxu <1793812695@qq.com> Date: Wed, 15 May 2024 10:31:31 +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=88=B6=E7=A8=8B=E6=A3=80=E9=AA=8C=E6=B7=BB=E5=8A=A0=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=20=E6=96=B0=E5=A2=9E=E5=88=B6=E7=A8=8B=E6=A3=80?= =?UTF-8?q?=E9=AA=8C=E6=A3=80=E6=9F=A5=E6=8A=A5=E5=91=8A=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=20=E6=96=B0=E5=A2=9E=E5=88=B6=E7=A8=8B=E6=A3=80=E9=AA=8C?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A1=B5=E9=9D=A2=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=88=B6=E7=A8=8B=E6=A3=80=E9=AA=8C=E7=89=A9=E6=96=99=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E7=9A=84=E5=AD=97=E6=AE=B5=E4=BF=A1=E6=81=AF=20?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=9F=A5=E6=89=BE=E5=88=B6=E7=A8=8B=E5=B7=A5?= =?UTF-8?q?=E5=BA=8F=E5=88=97=E8=A1=A8=E6=8E=A5=E5=8F=A3=20CheckoutMateria?= =?UTF-8?q?lVO=E6=96=B0=E5=A2=9E=E8=AE=A2=E5=8D=95=E6=95=B0=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ualityManufacturingCheckoutController.java | 51 +++- .../domain/QualityManufacturingCheckout.java | 14 + .../quality/domain/VO/CheckoutMaterialVO.java | 3 + .../QualityManufacturingProcessMapper.java | 4 + .../IQualityManufacturingCheckoutService.java | 13 + ...alityManufacturingCheckoutServiceImpl.java | 103 ++++++- .../QualityManufacturingProcessMapper.xml | 8 +- .../quality/manufacturingCheckout/add.html | 276 ++++++++++++++++++ .../manufacturingCheckout/checkoutReport.html | 229 +++++++++++++++ .../quality/manufacturingCheckout/edit.html | 91 ++++++ .../manufacturingCheckout/materialSelect.html | 4 + 11 files changed, 781 insertions(+), 15 deletions(-) create mode 100644 ruoyi-admin/src/main/resources/templates/quality/manufacturingCheckout/add.html create mode 100644 ruoyi-admin/src/main/resources/templates/quality/manufacturingCheckout/checkoutReport.html create mode 100644 ruoyi-admin/src/main/resources/templates/quality/manufacturingCheckout/edit.html 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 e707d501..450fa808 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 @@ -3,6 +3,8 @@ package com.ruoyi.quality.controller; import java.util.List; import com.ruoyi.aftersales.domain.vo.AftersalesMaterialVO; +import com.ruoyi.quality.domain.QualityManufacturingCheckoutMaterial; +import com.ruoyi.quality.domain.QualityManufacturingProcess; import com.ruoyi.quality.domain.VO.CheckoutMaterialVO; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; @@ -83,7 +85,7 @@ public class QualityManufacturingCheckoutController extends BaseController @Log(title = "品质管理制程检验", businessType = BusinessType.INSERT) @PostMapping("/add") @ResponseBody - public AjaxResult addSave(QualityManufacturingCheckout qualityManufacturingCheckout) + public AjaxResult addSave(@RequestBody QualityManufacturingCheckout qualityManufacturingCheckout) { return toAjax(qualityManufacturingCheckoutService.insertQualityManufacturingCheckout(qualityManufacturingCheckout)); } @@ -124,6 +126,32 @@ public class QualityManufacturingCheckoutController extends BaseController } + + + /** + * 制程检验报告 + */ + @GetMapping("/checkoutReport/{materialNo}/{makeNo}") + public String checkoutReport(@PathVariable("materialNo") String materialNo, @PathVariable("makeNo") String makeNo,ModelMap mmap) + { + QualityManufacturingCheckoutMaterial qualityManufacturingCheckoutMaterial = qualityManufacturingCheckoutService.selectManufacturingCheckoutMaterial(materialNo,makeNo); + mmap.put("qualityManufacturingCheckoutMaterial", qualityManufacturingCheckoutMaterial); + return prefix + "/checkoutReport"; + } + + /** + * 制程检验报告保存 + */ + @RequiresPermissions("quality:manufacturingCheckout:checkoutReport") + @Log(title = "品质管理制程检验", businessType = BusinessType.UPDATE) + @PostMapping("/checkoutReport") + @ResponseBody + public AjaxResult checkoutReportSave(QualityManufacturingCheckout qualityManufacturingCheckout) + { + return toAjax(qualityManufacturingCheckoutService.updateQualityManufacturingCheckout(qualityManufacturingCheckout)); + } + + /** * 查找与客户生产单号有关的物料信息 */ @@ -145,4 +173,25 @@ public class QualityManufacturingCheckoutController extends BaseController return getDataTable(list); } + + /** + * 查找制程工序列表 + */ + @GetMapping("/manufacturingProcessSelect") + public String manufacturingProcessSelect() + { + + return prefix + "/manufacturingProcessSelect"; + } + + /** + * 查找制程工序列表 + * */ + @ResponseBody + @PostMapping("/getAllProcess") + public TableDataInfo getAllProcess(){ + startPage(); + List list = qualityManufacturingCheckoutService.selectAllProcess(); + return getDataTable(list); + } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/quality/domain/QualityManufacturingCheckout.java b/ruoyi-admin/src/main/java/com/ruoyi/quality/domain/QualityManufacturingCheckout.java index 14431b18..6bd07bcd 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/quality/domain/QualityManufacturingCheckout.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/quality/domain/QualityManufacturingCheckout.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; @@ -63,6 +65,9 @@ public class QualityManufacturingCheckout extends BaseEntity /** 制程工序名称 */ private String manufacturingProcessName; + /**品质管理制程检验物料对象 */ + private List checkoutMaterialList; + public void setManufacturingCheckoutId(Long manufacturingCheckoutId) { this.manufacturingCheckoutId = manufacturingCheckoutId; @@ -172,6 +177,14 @@ public class QualityManufacturingCheckout extends BaseEntity return manufacturingProcessName; } + public List getCheckoutMaterialList() { + return checkoutMaterialList; + } + + public void setCheckoutMaterialList(List checkoutMaterialList) { + this.checkoutMaterialList = checkoutMaterialList; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) @@ -192,6 +205,7 @@ public class QualityManufacturingCheckout extends BaseEntity .append("createTime", getCreateTime()) .append("updateBy", getUpdateBy()) .append("updateTime", getUpdateTime()) + .append("checkoutMaterialList()",getCheckoutMaterialList()) .toString(); } } 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 index 0198c4e0..6e2585aa 100644 --- 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 @@ -40,4 +40,7 @@ public class CheckoutMaterialVO extends BaseEntity { @Excel(name = "物料加工方式") private String materialProcessMethod; + /** 订单数量*/ + private String makeTotal; + } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/quality/mapper/QualityManufacturingProcessMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/quality/mapper/QualityManufacturingProcessMapper.java index 03bfe8e1..bf24442e 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/quality/mapper/QualityManufacturingProcessMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/quality/mapper/QualityManufacturingProcessMapper.java @@ -92,4 +92,8 @@ public interface QualityManufacturingProcessMapper */ boolean existsByManufacturingProcessCode(QualityManufacturingProcess qualityManufacturingProcess); + /* + * 查找制程工序列表 + * */ + List selectAllProcess(); } 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 11d84354..c8327e70 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,8 @@ package com.ruoyi.quality.service; import java.util.List; import com.ruoyi.quality.domain.QualityManufacturingCheckout; +import com.ruoyi.quality.domain.QualityManufacturingCheckoutMaterial; +import com.ruoyi.quality.domain.QualityManufacturingProcess; import com.ruoyi.quality.domain.VO.CheckoutMaterialVO; /** @@ -78,4 +80,15 @@ public interface IQualityManufacturingCheckoutService * 查找与制程检验有关的物料信息 * */ List selectMaterialInfoByMakeNo(String makeNo); + + /* + * 查找制程工序列表 + * */ + List selectAllProcess(); + + + /* + * 查找制程工序列表 + * */ + QualityManufacturingCheckoutMaterial selectManufacturingCheckoutMaterial(String materialNo, 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 fff69d59..402e2a2c 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 @@ -5,15 +5,24 @@ import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; import java.util.List; +import java.util.stream.Collectors; 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.QualityManufacturingCheckoutMaterial; +import com.ruoyi.quality.domain.QualityManufacturingProcess; import com.ruoyi.quality.domain.VO.CheckoutMaterialVO; +import com.ruoyi.quality.mapper.QualityManufacturingCheckoutMaterialMapper; +import com.ruoyi.quality.mapper.QualityManufacturingProcessMapper; +import com.ruoyi.system.domain.SysMakeOrder; import com.ruoyi.system.domain.SysMakeorderBom; +import com.ruoyi.system.domain.SysSalesOrderChild; +import com.ruoyi.system.mapper.SysMakeOrderMapper; import com.ruoyi.system.mapper.SysMakeorderBomMapper; +import com.ruoyi.system.mapper.SysSalesOrderChildMapper; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -39,6 +48,17 @@ public class QualityManufacturingCheckoutServiceImpl implements IQualityManufact @Autowired private SysMakeorderBomMapper sysMakeorderBomMapper; + @Autowired + private SysMakeOrderMapper sysMakeOrderMapper; + + @Autowired + private QualityManufacturingCheckoutMaterialMapper checkoutMaterialMapper; + + @Autowired + private QualityManufacturingProcessMapper manufacturingProcessMapper; + + @Autowired + private SysSalesOrderChildMapper sysSalesOrderChildMapper; /** * 查询品质管理制程检验 * @@ -73,6 +93,7 @@ public class QualityManufacturingCheckoutServiceImpl implements IQualityManufact @Override public int insertQualityManufacturingCheckout(QualityManufacturingCheckout qualityManufacturingCheckout) { + String loginName = ShiroUtils.getLoginName(); //格式化日期格式 SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd"); String formatDate = df.format(new Date()); @@ -85,7 +106,18 @@ public class QualityManufacturingCheckoutServiceImpl implements IQualityManufact String newCode = generateNewCode(prefix, maxCode); qualityManufacturingCheckout.setManufacturingCheckoutCode(newCode); - String loginName = ShiroUtils.getLoginName(); + List checkoutMaterialList = qualityManufacturingCheckout.getCheckoutMaterialList(); + if (StringUtils.isEmpty(checkoutMaterialList)){ + log.warn("与生产订单号有关的物料数据为空:{}",qualityManufacturingCheckout.getCheckoutMaterialList()); + } + for (QualityManufacturingCheckoutMaterial qualityManufacturingCheckoutMaterial : checkoutMaterialList) { + qualityManufacturingCheckoutMaterial.setMakeNo(qualityManufacturingCheckout.getMakeNo()); + qualityManufacturingCheckoutMaterial.setManufacturingCheckoutCode(newCode); + qualityManufacturingCheckoutMaterial.setCreateBy(loginName); + qualityManufacturingCheckoutMaterial.setCreateTime(new Date()); + checkoutMaterialMapper.insertQualityManufacturingCheckoutMaterial(qualityManufacturingCheckoutMaterial); + } + qualityManufacturingCheckout.setCreateBy(loginName); qualityManufacturingCheckout.setCreateTime(DateUtils.getNowDate()); return qualityManufacturingCheckoutMapper.insertQualityManufacturingCheckout(qualityManufacturingCheckout); @@ -183,24 +215,69 @@ public class QualityManufacturingCheckoutServiceImpl implements IQualityManufact ArrayList checkoutMaterialVOS = new ArrayList<>(); - List sysMakeorderBoms = sysMakeorderBomMapper.selectSysMakeorderBomByMakeNo(makeNo); - if (StringUtils.isEmpty(sysMakeorderBoms)){ + SysMakeOrder sysMakeOrder = sysMakeOrderMapper.selectSaleNoByMakeNo(makeNo); + if (StringUtils.isEmpty(sysMakeOrder.getSaleNo())){ + log.warn("未查找到与生产订单关联的销售订单, 生产订单号: {}", makeNo); + } + List sysSalesOrderChildList = sysSalesOrderChildMapper.selectSysSalesOrderChildByQuoteId(sysMakeOrder.getSaleNo()); + + if (StringUtils.isEmpty(sysSalesOrderChildList)){ // 记录日志 - log.warn("未查找到与生产订单关联的物料相关数据, 生产订单号: {}", makeNo); + log.warn("未查找到与销售订单关联的物料相关数据, 销售订单号: {}", sysMakeOrder.getSaleNo()); } - for (SysMakeorderBom sysMakeorderBom : sysMakeorderBoms) { + for (SysSalesOrderChild sysSalesOrderChild : sysSalesOrderChildList) { 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()); + checkoutMaterialVO.setMaterialNo(sysSalesOrderChild.getMaterialCode()); + checkoutMaterialVO.setMaterialBrand(sysSalesOrderChild.getBrand()); + checkoutMaterialVO.setMaterialDescribe(sysSalesOrderChild.getDescribe()); + checkoutMaterialVO.setMaterialName(sysSalesOrderChild.getMaterialName()); + checkoutMaterialVO.setMaterialProcessMethod(sysSalesOrderChild.getProcessMethod()); + checkoutMaterialVO.setMaterialPhotourl(sysSalesOrderChild.getPhotoUrl()); + checkoutMaterialVO.setMaterialUnit(sysSalesOrderChild.getUnit()); + checkoutMaterialVO.setMaterialType(sysSalesOrderChild.getMaterialType()); + checkoutMaterialVO.setMakeTotal(sysSalesOrderChild.getMaterialNum().toString()); checkoutMaterialVOS.add(checkoutMaterialVO); } + + return checkoutMaterialVOS; } + + /* + * 查找制程工序列表 + * */ + @Override + public List selectAllProcess() { + + List list = manufacturingProcessMapper.selectAllProcess(); + if (StringUtils.isEmpty(list)){ + log.warn("未查找到制程工序相关数据: {}"); + } + return list; + } + + @Override + public QualityManufacturingCheckoutMaterial selectManufacturingCheckoutMaterial(String materialNo, String makeNo) { + + QualityManufacturingCheckoutMaterial checkoutMaterial = new QualityManufacturingCheckoutMaterial(); + + SysMakeOrder sysMakeOrder = sysMakeOrderMapper.selectSaleNoByMakeNo(makeNo); + if (StringUtils.isEmpty(sysMakeOrder.getSaleNo())){ + log.warn("未查找到与生产订单关联的销售订单, 生产订单号: {}", makeNo); + } + + SysSalesOrderChild sysSalesOrderChild = sysSalesOrderChildMapper.selectOneByQuoteIdAndMaterialCode(sysMakeOrder.getSaleNo(), materialNo); + + if (StringUtils.isEmpty(sysSalesOrderChild.getMaterialCode())){ + // 记录日志 + log.warn("未查找到与销售订单关联的物料相关数据, 销售订单号: {}", sysMakeOrder.getSaleNo()); + } + + checkoutMaterial.setMaterialNo(materialNo); + checkoutMaterial.setMaterialName(sysSalesOrderChild.getMaterialName()); + checkoutMaterial.setMakeTotal(sysSalesOrderChild.getMaterialNum().toString()); + + return checkoutMaterial; + } } diff --git a/ruoyi-admin/src/main/resources/mapper/quality/QualityManufacturingProcessMapper.xml b/ruoyi-admin/src/main/resources/mapper/quality/QualityManufacturingProcessMapper.xml index 3083d994..42371987 100644 --- a/ruoyi-admin/src/main/resources/mapper/quality/QualityManufacturingProcessMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/quality/QualityManufacturingProcessMapper.xml @@ -37,7 +37,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and create_time between #{params.beginCreateTime} and #{params.endCreateTime} - + + + + + + + + + +
+ +
+
+ + +
+
+
+ + +
+
+
+ 选择物料 + + 选择物料 + +
+
+
+
+
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/quality/manufacturingCheckout/checkoutReport.html b/ruoyi-admin/src/main/resources/templates/quality/manufacturingCheckout/checkoutReport.html new file mode 100644 index 00000000..1548ee36 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/quality/manufacturingCheckout/checkoutReport.html @@ -0,0 +1,229 @@ + + + + + + + +
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ + + + + + + + + + + + + + +
+ +
+
+ + +
+
+
+
+ +
+ +
+
+
+ + + +
+ + + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/quality/manufacturingCheckout/edit.html b/ruoyi-admin/src/main/resources/templates/quality/manufacturingCheckout/edit.html new file mode 100644 index 00000000..e705eaae --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/quality/manufacturingCheckout/edit.html @@ -0,0 +1,91 @@ + + + + + + + +
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+
+ + +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/quality/manufacturingCheckout/materialSelect.html b/ruoyi-admin/src/main/resources/templates/quality/manufacturingCheckout/materialSelect.html index 289567ca..9209a42f 100644 --- a/ruoyi-admin/src/main/resources/templates/quality/manufacturingCheckout/materialSelect.html +++ b/ruoyi-admin/src/main/resources/templates/quality/manufacturingCheckout/materialSelect.html @@ -59,6 +59,10 @@ title: '加工方式', field: 'materialProcessMethod', }, + { + title: '订单数', + field: 'makeTotal' + } ] }; $.table.init(options);