Fixiaobai
2023-10-30 10e199f950f5c74b25e446433ceb51cffe675be4
mes-technology/src/main/java/com/chinaztt/mes/technology/service/impl/RoutingServiceImpl.java
@@ -46,6 +46,7 @@
import com.chinaztt.mes.technology.excel.RoutingExcelData;
import com.chinaztt.mes.technology.mapper.*;
import com.chinaztt.mes.technology.service.RoutingService;
import com.chinaztt.mes.technology.state.bom.constant.BomStateStringValues;
import com.chinaztt.mes.technology.state.routing.RoutingStateMachineConfig;
import com.chinaztt.mes.technology.state.routing.constant.RoutingEvents;
import com.chinaztt.mes.technology.state.routing.constant.RoutingStateStringValues;
@@ -168,6 +169,10 @@
      if (noCount > 0) {
         throw new RuntimeException("编号重复");
      }
      Bom bom = bomMapper.selectById(routingDTO.getBomId());
      if(Objects.equals(BomStateStringValues.DRAFT,bom.getState())){
         throw new RuntimeException("BOM状态未通过!");
      }
      //主表中【零件号】、【工艺版本】、【替代】值的组合须唯一。
      noCount = baseMapper.selectCount(Wrappers.<Routing>lambdaQuery().eq(Routing::getPartId, routingDTO.getPartId())
            .eq(Routing::getBomTypeDb, routingDTO.getBomTypeDb())