From 8641de0a3fd1ab4de7661bd8695e7407a6b137db Mon Sep 17 00:00:00 2001 From: Stang <32996823@qq.com> Date: Fri, 22 Nov 2024 14:12:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=8B=E5=8A=A8=E7=BB=84=E8=A3=85=E6=97=B6?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E7=89=A9=E6=96=99=E5=BA=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/ktg/mes/md/domain/MbbProduBom.java | 12 ++++++++++++ .../ktg/mes/md/service/impl/BomRouteServiceImpl.java | 10 +++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/ktg-mes/src/main/java/com/ktg/mes/md/domain/MbbProduBom.java b/ktg-mes/src/main/java/com/ktg/mes/md/domain/MbbProduBom.java index 43ec6c7..52a623a 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/md/domain/MbbProduBom.java +++ b/ktg-mes/src/main/java/com/ktg/mes/md/domain/MbbProduBom.java @@ -42,6 +42,10 @@ public class MbbProduBom extends BaseEntity @Excel(name = "标准用量") private Integer standardDosage; + /** 标准用量 */ + @Excel(name = "当期库存") + private Long currentInventory; + /** 预留字段1 */ private String attr1; @@ -154,6 +158,14 @@ public class MbbProduBom extends BaseEntity return attr4; } + public Long getCurrentInventory() { + return currentInventory; + } + + public void setCurrentInventory(Long currentInventory) { + this.currentInventory = currentInventory; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) diff --git a/ktg-mes/src/main/java/com/ktg/mes/md/service/impl/BomRouteServiceImpl.java b/ktg-mes/src/main/java/com/ktg/mes/md/service/impl/BomRouteServiceImpl.java index 762ecb7..41bbafd 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/md/service/impl/BomRouteServiceImpl.java +++ b/ktg-mes/src/main/java/com/ktg/mes/md/service/impl/BomRouteServiceImpl.java @@ -2,6 +2,7 @@ package com.ktg.mes.md.service.impl; import java.util.List; import com.ktg.common.utils.DateUtils; +import com.ktg.mes.md.mapper.BaseKnifeMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.ArrayList; @@ -24,6 +25,9 @@ public class BomRouteServiceImpl implements IBomRouteService @Autowired private BomRouteMapper bomRouteMapper; + @Autowired + private BaseKnifeMapper baseKnifeMapper; + /** * 查询BOM头 * @@ -33,7 +37,11 @@ public class BomRouteServiceImpl implements IBomRouteService @Override public BomRoute selectBomRouteByBomRouteId(Long bomRouteId) { - return bomRouteMapper.selectBomRouteByBomRouteId(bomRouteId); + BomRoute bomRoute = bomRouteMapper.selectBomRouteByBomRouteId(bomRouteId); + bomRoute.getMbbProduBomList().forEach(item -> { + item.setCurrentInventory(this.baseKnifeMapper.countBaseKnife(item.getMdItemId())); + }); + return bomRoute; } /**