| | |
| | | import com.chinaztt.mes.technology.entity.*; |
| | | import com.chinaztt.mes.technology.excel.RoutingData; |
| | | import com.chinaztt.mes.technology.excel.RoutingExcelData; |
| | | import com.chinaztt.mes.technology.excel.StructureData; |
| | | 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; |
| | |
| | | int noCount = baseMapper.selectCount(Wrappers.<Routing>lambdaQuery().eq(Routing::getRoutingNo, routingDTO.getRoutingNo())); |
| | | 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()) |
| | |
| | | //结构类型 |
| | | batchinfoJsonObj.put("BOM_TYPE_DB", routingDTO.getBomTypeDb()); |
| | | //启用时间 |
| | | batchinfoJsonObj.put("PHASE_IN_DATE", DateTimeFormatter.ofPattern("yyyyMMdd").format(routingDTO.getPhaseInDate())); |
| | | if (routingDTO.getPhaseOutDate() != null) { |
| | | //弃用时间 |
| | | batchinfoJsonObj.put("PHASE_OUT_DATE", DateTimeFormatter.ofPattern("yyyyMMdd").format(routingDTO.getPhaseOutDate())); |
| | | } |
| | | //batchinfoJsonObj.put("PHASE_IN_DATE", DateTimeFormatter.ofPattern("yyyyMMdd").format(routingDTO.getPhaseInDate())); |
| | | //if (routingDTO.getPhaseOutDate() != null) { |
| | | // //弃用时间 |
| | | // batchinfoJsonObj.put("PHASE_OUT_DATE", DateTimeFormatter.ofPattern("yyyyMMdd").format(routingDTO.getPhaseOutDate())); |
| | | //} |
| | | JSONArray alternateInfo = new JSONArray(); |
| | | JSONObject alobj = new JSONObject() |
| | | .fluentPut("ALTERNATIVE_NO", routingDTO.getAlternativeNo()) |