| | |
| | | mpList = mphService.getListWithMaterialInfo(mpList); |
| | | List<String> newBomMaterialStrList = bomList.stream().map(bom -> bom.getSubCode() + "/" + bom.getSubModel()).collect(Collectors.toList()); |
| | | mpList = mpList.stream().filter(mp -> newBomMaterialStrList.contains(mp.getSubMaterial().getSubCode() + "/" + mp.getSubMaterial().getSubModel())).collect(Collectors.toList()); |
| | | if (latestProduct.getVersion().intValue() == enabledProduct.getVersion()) { |
| | | //最新版本生效,关联关系版本连着的 |
| | | mphService.updateVersionBatch(mpList); |
| | | } else { |
| | | //旧版本生效,关联关系版本不连着 |
| | | mpList.forEach(mp -> { |
| | | mp.setSVersion(nextVersion); |
| | | mp.setEVersion(nextVersion); |
| | | }); |
| | | mphService.insertBatch(mpList); |
| | | if(mpList.size()!=0) { |
| | | if (latestProduct.getVersion().intValue() == enabledProduct.getVersion()) { |
| | | //最新版本生效,关联关系版本连着的 |
| | | mphService.updateVersionBatch(mpList); |
| | | } else { |
| | | //旧版本生效,关联关系版本不连着 |
| | | mpList.forEach(mp -> { |
| | | mp.setSVersion(nextVersion); |
| | | mp.setEVersion(nextVersion); |
| | | }); |
| | | mphService.insertBatch(mpList); |
| | | } |
| | | } |
| | | } |
| | | } |