From aba082b5ad8df6347fc81f1d80c8ed7ef0a8f347 Mon Sep 17 00:00:00 2001 From: yinq Date: Sun, 18 Feb 2024 17:58:41 +0800 Subject: [PATCH] =?UTF-8?q?change=20-=20=E7=94=9F=E4=BA=A7BOM=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E3=80=81=E5=B7=A5=E4=BD=8D=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/hw/mes/domain/MesBaseStationInfo.java | 18 +- .../impl/MesMaterialBomServiceImpl.java | 16 + .../mapper/mes/MesBaseStationInfoMapper.xml | 29 +- hw-ui/src/views/mes/baseStationInfo/index.vue | 3 +- hw-ui/src/views/mes/materialBom/addBom.vue | 293 ++++++++++++++++++ hw-ui/src/views/mes/materialBom/index.vue | 88 ++++-- 6 files changed, 403 insertions(+), 44 deletions(-) create mode 100644 hw-ui/src/views/mes/materialBom/addBom.vue diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesBaseStationInfo.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesBaseStationInfo.java index 79399a8..1633116 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesBaseStationInfo.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesBaseStationInfo.java @@ -32,11 +32,17 @@ public class MesBaseStationInfo extends BaseEntity { private String stationName; /** - * 所属工序 + * 所属工序编号 */ - @Excel(name = "所属工序") + @Excel(name = "所属工序编号") private Long processId; + /** + * 所属工序名称 + */ + @Excel(name = "所属工序名称") + private String processName; + /** * 楼层 */ @@ -55,6 +61,14 @@ public class MesBaseStationInfo extends BaseEntity { @Excel(name = "激活标识") private String activeFlag; + public String getProcessName() { + return processName; + } + + public void setProcessName(String processName) { + this.processName = processName; + } + public void setStationId(Long stationId) { this.stationId = stationId; } diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesMaterialBomServiceImpl.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesMaterialBomServiceImpl.java index b4f0f95..aa75369 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesMaterialBomServiceImpl.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesMaterialBomServiceImpl.java @@ -2,6 +2,7 @@ package com.hw.mes.service.impl; import java.util.List; import com.hw.common.core.utils.DateUtils; +import com.hw.common.core.utils.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.hw.mes.mapper.MesMaterialBomMapper; @@ -53,6 +54,7 @@ public class MesMaterialBomServiceImpl implements IMesMaterialBomService @Override public int insertMesMaterialBom(MesMaterialBom mesMaterialBom) { + isTopFlag(mesMaterialBom); mesMaterialBom.setCreateTime(DateUtils.getNowDate()); return mesMaterialBomMapper.insertMesMaterialBom(mesMaterialBom); } @@ -66,6 +68,7 @@ public class MesMaterialBomServiceImpl implements IMesMaterialBomService @Override public int updateMesMaterialBom(MesMaterialBom mesMaterialBom) { + isTopFlag(mesMaterialBom); mesMaterialBom.setUpdateTime(DateUtils.getNowDate()); return mesMaterialBomMapper.updateMesMaterialBom(mesMaterialBom); } @@ -109,4 +112,17 @@ public class MesMaterialBomServiceImpl implements IMesMaterialBomService return mesMaterialBomMapper.selectMesMaterialBomJoinList(mesMaterialBom); } + /** + * 判断是否顶级BOM + * @param mesMaterialBom + */ + private void isTopFlag(MesMaterialBom mesMaterialBom){ + // 顶级标识1=是,0=否 + if (StringUtils.isNull(mesMaterialBom.getParentId()) || mesMaterialBom.getParentId() == 0L){ + mesMaterialBom.setTopFlag(1L); + }else { + mesMaterialBom.setTopFlag(0L); + } + } + } diff --git a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesBaseStationInfoMapper.xml b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesBaseStationInfoMapper.xml index c907eec..8917326 100644 --- a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesBaseStationInfoMapper.xml +++ b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesBaseStationInfoMapper.xml @@ -9,6 +9,7 @@ + @@ -20,19 +21,21 @@ - select station_id, - station_code, - station_name, - process_id, - floor, - production_time, - active_flag, - remark, - create_by, - create_time, - update_by, - update_time - from mes_base_station_info + select mbsi.station_id, + mbsi.station_code, + mbsi.station_name, + mbsi.process_id, + mbpi.process_name, + mbsi.floor, + mbsi.production_time, + mbsi.active_flag, + mbsi.remark, + mbsi.create_by, + mbsi.create_time, + mbsi.update_by, + mbsi.update_time + from mes_base_station_info mbsi + left join mes_base_process_info mbpi on mbpi.process_id = mbsi.process_id