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