| | |
| | | return Boolean.valueOf(updateBatchById(list)); |
| | | } |
| | | |
| | | @Override // org.springblade.modules.cps.service.IProductionCraftProcessService |
| | | @Override |
| | | public ProductionCraftProcessDetailVO detailProcess(Long id) { |
| | | ProductionCraftProcess process = (ProductionCraftProcess) getById(id); |
| | | ProductionCraftProcessDetailVO vo = ProductionCraftProcessConvert.INSTANCE.convertDetailVO(process); |
| | |
| | | } |
| | | Long versionProcessId = vo.getVersionProcessId(); |
| | | removeById(versionProcessId); |
| | | remove(Lambda.eq((v0) -> { |
| | | return v0.getMainSequenceId(); |
| | | }, versionProcessId)); |
| | | remove(Lambda.eq(ProductionCraftProcess::getMainSequenceId, versionProcessId)); |
| | | removeProcessAssociation(Lists.newArrayList(new Long[]{versionProcessId})); |
| | | List<ProductionCraftProcessDeleteVO> voList = vo.getProductionCraftProcessDeleteVOList(); |
| | | if (Func.isNotEmpty(voList)) { |
| | |
| | | return true; |
| | | } |
| | | |
| | | @Override // org.springblade.modules.cps.service.IProductionCraftProcessService |
| | | @Override |
| | | @Transactional(rollbackFor = {Exception.class}) |
| | | public Boolean updateVersionProcess(VersionProcessUpdateVO vo) { |
| | | Long versionId = vo.getVersionId(); |
| | |
| | | List<ProductionCraftProcess> list = list(Lambda.eq(ProductionCraftProcess::getSort, sort) |
| | | .ne(ProductionCraftProcess::getId, vo.getId()) |
| | | .eq(ProductionCraftProcess::getVersionId, versionId)); |
| | | /* |
| | | List<ProductionCraftProcess> list = list((Wrapper) ((ExtraLambdaQueryWrapper) Lambda.eq((v0) -> { |
| | | return v0.getSort(); |
| | | }, sort).ne((v0) -> { |
| | | return v0.getId(); |
| | | }, vo.getId())).eq((v0) -> { |
| | | return v0.getVersionId(); |
| | | }, versionId));*/ |
| | | |
| | | if (Func.isNotEmpty(list)) { |
| | | throw new ServiceException(MessageUtils.message("cps.production.craft.process.same.sort", new Object[0])); |
| | | } |
| | |
| | | return true; |
| | | } |
| | | |
| | | @Override // org.springblade.modules.cps.service.IProductionCraftProcessService |
| | | @Override |
| | | public List<ProductionCraftProcessVO> listProcess(Long versionId) { |
| | | List<ProductionCraftProcess> list = list(Wrappers.lambdaQuery(ProductionCraftProcess.class).eq((v0) -> { |
| | | return v0.getVersionId(); |
| | |
| | | return ProductionCraftProcessConvert.INSTANCE.convert(list); |
| | | } |
| | | |
| | | @Override // org.springblade.modules.cps.service.IProductionCraftProcessService |
| | | @Override |
| | | @Transactional(rollbackFor = {Exception.class}) |
| | | public Boolean saveParallel(VersionProcessParallelVO vo) { |
| | | Long versionId = vo.getVersionId(); |
| | |
| | | return updateChildProcess(craftProcess, childProcess); |
| | | } |
| | | |
| | | @Override // org.springblade.modules.cps.service.IProductionCraftProcessService |
| | | @Override |
| | | public List<VersionProcessTreeVO> treeProcess(String versionId) { |
| | | List<ProductionCraftProcess> list = list(Lambda.eq((v0) -> { |
| | | return v0.getVersionId(); |
| | | }, versionId)); |
| | | List<ProductionCraftProcess> list = list(Lambda.eq(ProductionCraftProcess::getVersionId, versionId)); |
| | | List<VersionProcessTreeVO> vos = list.stream().map(this::convert).collect(Collectors.toList()); |
| | | List<VersionProcessTreeVO> result = ForestNodeMerger.merge(vos); |
| | | result.sort(Comparator.comparing((v0) -> { |
| | |
| | | return result; |
| | | } |
| | | |
| | | @Override // org.springblade.modules.cps.service.IProductionCraftProcessService |
| | | @Override |
| | | public Boolean updateParallelProcess(UpdateParallelProcessVO vo) { |
| | | ProductionCraftProcess process = new ProductionCraftProcess(); |
| | | process.setId(vo.getId()); |
| | |
| | | .eq(ProductionCraftProcess::getMainSequenceId, vo.getId())).update()); |
| | | } |
| | | |
| | | @Override // org.springblade.modules.cps.service.IProductionCraftProcessService |
| | | @Override |
| | | @Transactional(rollbackFor = {Exception.class}) |
| | | public List<ProductionCraftProcessVO> parallelSave(ProcessParallelSaveVO vo) { |
| | | Long versionId = vo.getVersionId(); |
| | |
| | | return res; |
| | | } |
| | | |
| | | @Override // org.springblade.modules.cps.service.IProductionCraftProcessService |
| | | @Override |
| | | public List<ProductionCraftProcess> childProcessSave(ChildProcessVO vo) { |
| | | List<VersionProcessAddVO> childProcess = vo.getChildProcess(); |
| | | Map<Integer, List<VersionProcessAddVO>> typeMap = childProcess.stream().collect(Collectors.groupingBy((v0) -> { |
| | |
| | | return saveAll(versionId, mainId, vo.getSort(), childProcess); |
| | | } |
| | | |
| | | @Override // org.springblade.modules.cps.service.IProductionCraftProcessService |
| | | @Override |
| | | public Boolean childProcessRemove(String mainId, String childId) { |
| | | return Boolean.valueOf(remove(Lambda.eq(ProductionCraftProcess::getMainSequenceId, mainId) |
| | | .eq(ProductionCraftProcess::getId, childId))); |
| | | /* |
| | | return Boolean.valueOf(remove((Wrapper) Lambda.eq((v0) -> { |
| | | return v0.getMainSequenceId(); |
| | | }, mainId).eq((v0) -> { |
| | | return v0.getId(); |
| | | }, childId)));*/ |
| | | |
| | | } |
| | | |
| | | @Override // org.springblade.modules.cps.service.IProductionCraftProcessService |
| | | @Override |
| | | @Transactional(rollbackFor = {Exception.class}) |
| | | public Boolean childProcessUpdate(ProcessParallelUpdateVO vo) { |
| | | Long versionId = vo.getVersionId(); |