| | |
| | | import com.ruoyi.common.enums.StockInUnQualifiedRecordTypeEnum; |
| | | import com.ruoyi.common.enums.StockOutQualifiedRecordTypeEnum; |
| | | import com.ruoyi.common.exception.ServiceException; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.bean.BeanUtils; |
| | | import com.ruoyi.procurementrecord.utils.StockUtils; |
| | | import com.ruoyi.production.dto.ProductStructureDto; |
| | |
| | | } |
| | | String productNo = String.format("%s%03d", datePrefix, sequenceNumber); |
| | | productionProductMain.setProductNo(productNo); |
| | | productionProductMain.setUserId(dto.getUserId()); |
| | | productionProductMain.setUserName(dto.getUserName()); |
| | | Long userId = dto.getUserId(); |
| | | String userName = dto.getUserName(); |
| | | if (userId == null) { |
| | | userId = SecurityUtils.getLoginUser().getUserId(); |
| | | userName = SecurityUtils.getLoginUser().getNickName(); |
| | | } |
| | | productionProductMain.setUserId(userId); |
| | | productionProductMain.setUserName(userName); |
| | | productionProductMain.setProductProcessRouteItemId(dto.getProductProcessRouteItemId()); |
| | | productionProductMain.setWorkOrderId(dto.getWorkOrderId()); |
| | | productionProductMain.setStatus(0); |
| | |
| | | .map(ProductStructureDto::getParentId) |
| | | .filter(Objects::nonNull) |
| | | .collect(Collectors.toSet()); |
| | | Map<Long, ProductStructureDto> parentMap = |
| | | productStructureMapper.selectByIds(parentIds) |
| | | .stream() |
| | | .collect(Collectors.toMap( |
| | | ProductStructureDto::getId, |
| | | Function.identity() |
| | | )); |
| | | Map<Long, ProductStructureDto> parentMap = new HashMap<>(); |
| | | if (!parentIds.isEmpty()) { |
| | | parentMap = productStructureMapper.selectByIds(parentIds) |
| | | .stream() |
| | | .collect(Collectors.toMap( |
| | | ProductStructureDto::getId, |
| | | Function.identity() |
| | | )); |
| | | } |
| | | for (ProductStructureDto productStructureDto : productStructureDtos) { |
| | | ProductionProductInput productionProductInput = new ProductionProductInput(); |
| | | productionProductInput.setProductModelId(productStructureDto.getProductModelId()); |
| | |
| | | |
| | | return productionProductMainDtos; |
| | | } |
| | | } |
| | | } |