From 843ebc1498874d28a30c2edb7f385a3aa60da7bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=99=93=E8=BF=AA?= <2596750866@qq.com> Date: Fri, 20 Sep 2024 17:26:30 +0800 Subject: [PATCH] =?UTF-8?q?[fix]=20=E7=94=9F=E4=BA=A7=E7=AE=A1=E7=90=86=20?= =?UTF-8?q?=E7=94=9F=E4=BA=A7=E8=AE=A2=E5=8D=95=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E7=94=9F=E4=BA=A7=E8=AE=A2=E5=8D=95=E5=88=97=E8=A1=A8=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=EF=BC=8C=E6=96=B0=E5=A2=9E=E5=88=9B=E5=BB=BA=E5=A7=94?= =?UTF-8?q?=E5=A4=96=E8=AE=A1=E5=88=92=E6=8C=89=E9=92=AE=E5=8F=8A=E5=85=B6?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E9=80=BB=E8=BE=91=EF=BC=9B=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E7=94=9F=E4=BA=A7=E8=AE=A2=E5=8D=95bom=E5=AE=9E?= =?UTF-8?q?=E4=BD=93=E7=B1=BB=EF=BC=8C=E6=96=B0=E5=A2=9E=E5=A7=94=E5=A4=96?= =?UTF-8?q?=E5=B7=A5=E5=BA=8F=E6=95=B0=E5=92=8C=E5=B7=B2=E5=A7=94=E5=A4=96?= =?UTF-8?q?=E6=95=B0=E9=87=8F=E5=AD=97=E6=AE=B5=EF=BC=9B=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E7=94=9F=E4=BA=A7=E8=AE=A2=E5=8D=95bom=E7=9A=84mapper?= =?UTF-8?q?=EF=BC=8C=E6=96=B0=E5=A2=9E=E5=AD=97=E6=AE=B5=EF=BC=8C=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E6=8C=89=E7=94=9F=E4=BA=A7=E5=8D=95=E5=8F=B7=E5=92=8C?= =?UTF-8?q?=E6=96=99=E5=8F=B7=E6=9F=A5=E8=AF=A2=E6=96=B9=E6=B3=95=EF=BC=9B?= =?UTF-8?q?=20=E4=BF=AE=E6=94=B9=E7=94=9F=E4=BA=A7=E8=AE=A2=E5=8D=95bom?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E5=88=97=E8=A1=A8service=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=EF=BC=8C=E5=A7=94=E5=A4=96=E7=B1=BB=E5=9E=8B=E7=89=A9=E6=96=99?= =?UTF-8?q?=E5=85=B3=E8=81=94=E6=9F=A5=E8=AF=A2=E5=B7=A5=E5=BA=8F=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E9=99=84=E5=8A=A0=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ruoyi/system/domain/SysMakeorderBom.java | 22 +++++++++++++++++++ .../system/mapper/SysMakeorderBomMapper.java | 3 +++ .../system/service/ISysMakeOrderService.java | 4 ++++ .../impl/SysMakeorderBomServiceImpl.java | 20 ++++++++++++++++- .../mapper/system/SysMakeorderBomMapper.xml | 13 ++++++++++- .../templates/system/makeorder/makeorder.html | 6 +++++ 6 files changed, 66 insertions(+), 2 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysMakeorderBom.java b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysMakeorderBom.java index 0adc747f..a18d5396 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysMakeorderBom.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysMakeorderBom.java @@ -88,6 +88,12 @@ public class SysMakeorderBom extends BaseEntity @Excel(name = "排序") private Long sortNo; +// 委外工序数 + private int processNum; + +// 已委外数量 + private int hasOutNum; + public void setId(Long id) { this.id = id; @@ -259,6 +265,22 @@ public class SysMakeorderBom extends BaseEntity this.warehouseDept = warehouseDept; } + public int getProcessNum() { + return processNum; + } + + public void setProcessNum(int processNum) { + this.processNum = processNum; + } + + public int getHasOutNum() { + return hasOutNum; + } + + public void setHasOutNum(int hasOutNum) { + this.hasOutNum = hasOutNum; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysMakeorderBomMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysMakeorderBomMapper.java index ac177e24..442c85f8 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysMakeorderBomMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysMakeorderBomMapper.java @@ -82,4 +82,7 @@ public interface SysMakeorderBomMapper * @return 生产订单BOM信息 */ public List selectSysMakeorderBomByMakeNo(String makeNo); + +// 按生产订单编号和料号查询生产订单bom信息 + public SysMakeorderBom selectSysMakeorderBomByNo(SysMakeorderBom makeorderBom); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysMakeOrderService.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysMakeOrderService.java index e48f18ac..03feeb0d 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysMakeOrderService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysMakeOrderService.java @@ -1,6 +1,7 @@ package com.ruoyi.system.service; import com.ruoyi.erp.domain.ErpInboundOrder; +import com.ruoyi.system.domain.OutsourcePlan; import com.ruoyi.system.domain.SysMakeOrder; import com.ruoyi.system.dto.SysEquipMaterialDto; import com.ruoyi.system.dto.SysMakeorderMaterialDto; @@ -124,4 +125,7 @@ public interface ISysMakeOrderService * 添加保存创建生产入库和设备履历设置 */ int addProduceInboundSave(ErpInboundOrder erpInboundOrder); + +// 添加保存委外计划单 + int addOutsourcePlan(OutsourcePlan outsourcePlan); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysMakeorderBomServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysMakeorderBomServiceImpl.java index e42f40f4..559df62c 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysMakeorderBomServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysMakeorderBomServiceImpl.java @@ -3,6 +3,10 @@ package com.ruoyi.system.service.impl; import java.util.List; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.ShiroUtils; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.system.domain.OutsourceMaterial; +import com.ruoyi.system.mapper.OutsourceMaterialMapper; +import org.apache.poi.util.StringUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.ruoyi.system.mapper.SysMakeorderBomMapper; @@ -22,6 +26,9 @@ public class SysMakeorderBomServiceImpl implements ISysMakeorderBomService @Autowired private SysMakeorderBomMapper sysMakeorderBomMapper; + @Autowired + private OutsourceMaterialMapper outsourceMaterialMapper; + /** * 查询生产订单BOM信息 * @@ -43,7 +50,18 @@ public class SysMakeorderBomServiceImpl implements ISysMakeorderBomService @Override public List selectSysMakeorderBomList(SysMakeorderBom sysMakeorderBom) { - return sysMakeorderBomMapper.selectSysMakeorderBomList(sysMakeorderBom); + List makeorderBoms = sysMakeorderBomMapper.selectSysMakeorderBomList(sysMakeorderBom); + for (SysMakeorderBom bom:makeorderBoms) { + if(bom.getProcessMethod().equals("2")){ + List materials = outsourceMaterialMapper.selectProcessNoByNo(bom.getMaterialNo()); + if(StringUtils.isEmpty(materials)){ + bom.setProcessNum(0); + }else { + bom.setProcessNum(materials.size()); + } + } + } + return makeorderBoms; } /** diff --git a/ruoyi-admin/src/main/resources/mapper/system/SysMakeorderBomMapper.xml b/ruoyi-admin/src/main/resources/mapper/system/SysMakeorderBomMapper.xml index ae3e3faa..7649e70e 100644 --- a/ruoyi-admin/src/main/resources/mapper/system/SysMakeorderBomMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/system/SysMakeorderBomMapper.xml @@ -29,13 +29,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + select id, del_flag, create_by, create_time, update_by, update_time, remark, make_no, sales_order_code, sales_order_material_no, bom_no, material_no, photoUrl, material_name, material_type, process_method, unit, brand, `describe`, - warehouseDept, use_num, loss_rate, level, sort_no from sys_makeorder_bom + warehouseDept, use_num, loss_rate, level, sort_no, has_out_num from sys_makeorder_bom + + + and make_no = #{makeNo} + and material_no = #{materialNo} + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/makeorder/makeorder.html b/ruoyi-admin/src/main/resources/templates/system/makeorder/makeorder.html index 4efafa2c..837db243 100644 --- a/ruoyi-admin/src/main/resources/templates/system/makeorder/makeorder.html +++ b/ruoyi-admin/src/main/resources/templates/system/makeorder/makeorder.html @@ -265,6 +265,12 @@ (row.eceiptStatus == '7' || row.eceiptStatus == '8')){ actions.push('领料 '); } + // 委外计划 + if((row.makeStatus == '3' || row.makeStatus == '4' || row.makeStatus == '5') && + (row.eceiptStatus == '3' || row.eceiptStatus == '4'|| row.eceiptStatus == '5'|| row.eceiptStatus == '6'|| row.eceiptStatus == '7' + || row.eceiptStatus == '8')){ + actions.push('委外计划 '); + } // 委内入库 对应生产中 if(row.makeStatus == '4' || row.makeStatus == '5'){ actions.push('委内入库 ');