| | |
| | | import com.google.common.collect.Sets; |
| | | import java.lang.invoke.SerializedLambda; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | import com.qianwen.smartman.modules.cps.entity.CommonGroupOfItem; |
| | | import com.qianwen.smartman.modules.cps.entity.ToolAppendix; |
| | | import com.qianwen.smartman.modules.cps.entity.Tray; |
| | | import com.qianwen.smartman.modules.cps.entity.TrayFixture; |
| | | import com.qianwen.smartman.modules.cps.entity.TrayStorage; |
| | | import com.qianwen.smartman.modules.cps.entity.TraySurface; |
| | | import com.qianwen.smartman.modules.cps.enums.CommonGroupEnum; |
| | | import com.qianwen.smartman.modules.cps.enums.TrayEnum; |
| | |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | @Service |
| | | /* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/cps/service/impl/TrayServiceImpl.class */ |
| | | public class TrayServiceImpl extends BladeServiceImpl<TrayMapper, Tray> implements ITrayService { |
| | | private static final Logger log = LoggerFactory.getLogger(TrayServiceImpl.class); |
| | | private final ITraySurfaceService surfaceService; |
| | |
| | | private final ICommonGroupOfItemService commonGroupOfItemService; |
| | | private final OssBuilder ossBuilder; |
| | | private final ICodeGeneratorService codeGeneratorService; |
| | | |
| | | private static /* synthetic */ Object $deserializeLambda$(SerializedLambda lambda) { |
| | | String implMethodName = lambda.getImplMethodName(); |
| | | boolean z = true; |
| | | switch (implMethodName.hashCode()) { |
| | | case -1492577373: |
| | | if (implMethodName.equals("getGroupType")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case -1041904421: |
| | | if (implMethodName.equals("getParentId")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case -75622813: |
| | | if (implMethodName.equals("getCode")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case -75308287: |
| | | if (implMethodName.equals("getName")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case 98245393: |
| | | if (implMethodName.equals("getId")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case 517353092: |
| | | if (implMethodName.equals("getItemId")) { |
| | | z = false; |
| | | break; |
| | | } |
| | | break; |
| | | case 830319079: |
| | | if (implMethodName.equals("getTrayId")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case 985326823: |
| | | if (implMethodName.equals("getGroupCategory")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case 1071464927: |
| | | if (implMethodName.equals("getCreateTime")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case 1330288580: |
| | | if (implMethodName.equals("getGroupId")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | } |
| | | switch (z) { |
| | | case false: |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/cps/entity/CommonGroupOfItem") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) { |
| | | return (v0) -> { |
| | | return v0.getItemId(); |
| | | }; |
| | | } |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/cps/entity/CommonGroupOfItem") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) { |
| | | return (v0) -> { |
| | | return v0.getItemId(); |
| | | }; |
| | | } |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/cps/entity/CommonGroupOfItem") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) { |
| | | return (v0) -> { |
| | | return v0.getItemId(); |
| | | }; |
| | | } |
| | | break; |
| | | case true: |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/core/mp/base/BaseEntity") && lambda.getImplMethodSignature().equals("()Ljava/util/Date;")) { |
| | | return (v0) -> { |
| | | return v0.getCreateTime(); |
| | | }; |
| | | } |
| | | break; |
| | | case true: |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/cps/entity/CommonGroup") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getName(); |
| | | }; |
| | | } |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/cps/entity/Tray") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getName(); |
| | | }; |
| | | } |
| | | break; |
| | | case true: |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/cps/entity/TraySurface") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) { |
| | | return (v0) -> { |
| | | return v0.getTrayId(); |
| | | }; |
| | | } |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/cps/entity/TrayStorage") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) { |
| | | return (v0) -> { |
| | | return v0.getTrayId(); |
| | | }; |
| | | } |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/cps/entity/TraySurface") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) { |
| | | return (v0) -> { |
| | | return v0.getTrayId(); |
| | | }; |
| | | } |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/cps/entity/TrayFixture") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) { |
| | | return (v0) -> { |
| | | return v0.getTrayId(); |
| | | }; |
| | | } |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/cps/entity/TrayStorage") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) { |
| | | return (v0) -> { |
| | | return v0.getTrayId(); |
| | | }; |
| | | } |
| | | break; |
| | | case true: |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/cps/entity/CommonGroup") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getGroupType(); |
| | | }; |
| | | } |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/cps/entity/CommonGroup") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getGroupType(); |
| | | }; |
| | | } |
| | | break; |
| | | case RegionCache.VILLAGE_LEVEL /* 5 */: |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/core/mp/base/BaseEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) { |
| | | return (v0) -> { |
| | | return v0.getId(); |
| | | }; |
| | | } |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/cps/entity/CommonGroup") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) { |
| | | return (v0) -> { |
| | | return v0.getId(); |
| | | }; |
| | | } |
| | | break; |
| | | case true: |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/cps/entity/CommonGroup") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) { |
| | | return (v0) -> { |
| | | return v0.getGroupCategory(); |
| | | }; |
| | | } |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/cps/entity/CommonGroup") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) { |
| | | return (v0) -> { |
| | | return v0.getGroupCategory(); |
| | | }; |
| | | } |
| | | break; |
| | | case true: |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/cps/entity/Tray") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getCode(); |
| | | }; |
| | | } |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/cps/entity/Tray") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getCode(); |
| | | }; |
| | | } |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/cps/entity/Tray") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getCode(); |
| | | }; |
| | | } |
| | | break; |
| | | case true: |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/cps/entity/CommonGroupOfItem") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) { |
| | | return (v0) -> { |
| | | return v0.getGroupId(); |
| | | }; |
| | | } |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/cps/entity/CommonGroupOfItem") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) { |
| | | return (v0) -> { |
| | | return v0.getGroupId(); |
| | | }; |
| | | } |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/cps/entity/CommonGroupOfItem") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) { |
| | | return (v0) -> { |
| | | return v0.getGroupId(); |
| | | }; |
| | | } |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/cps/entity/CommonGroupOfItem") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) { |
| | | return (v0) -> { |
| | | return v0.getGroupId(); |
| | | }; |
| | | } |
| | | break; |
| | | case true: |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/cps/entity/ToolAppendix") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) { |
| | | return (v0) -> { |
| | | return v0.getParentId(); |
| | | }; |
| | | } |
| | | break; |
| | | } |
| | | throw new IllegalArgumentException("Invalid lambda deserialization"); |
| | | } |
| | | |
| | | public TrayServiceImpl(final ITraySurfaceService surfaceService, final ICommonGroupService commonGroupService, final IToolAppendixService toolAppendixService, final ITrayFixtureService fixtureService, final ITrayStorageService storageService, final ICommonGroupOfItemService commonGroupOfItemService, final OssBuilder ossBuilder, final ICodeGeneratorService codeGeneratorService) { |
| | | this.surfaceService = surfaceService; |
| | |
| | | List<TrayFaceDTO> faceList = vo.getFaceList(); |
| | | if (Func.isNotEmpty(faceList)) { |
| | | Set<String> codeSet = Sets.newHashSet(); |
| | | List<TraySurface> surfaces = (List) faceList.stream().map(f -> { |
| | | List<TraySurface> surfaces = faceList.stream().map(f -> { |
| | | String faceCode = f.getFaceCode(); |
| | | String faceName = f.getFaceName(); |
| | | codeSet.add(faceCode); |
| | |
| | | @Override // org.springblade.modules.cps.service.ITrayService |
| | | public TrayVO getDetail(Long id) { |
| | | Tray tray = (Tray) getById(id); |
| | | CommonGroupOfItem item = (CommonGroupOfItem) this.commonGroupOfItemService.getOne((Wrapper) Wrappers.lambdaQuery().eq((v0) -> { |
| | | return v0.getItemId(); |
| | | }, id)); |
| | | CommonGroupOfItem item = (CommonGroupOfItem) this.commonGroupOfItemService.getOne(Wrappers.<CommonGroupOfItem>lambdaQuery().eq(CommonGroupOfItem::getItemId, id)); |
| | | Long groupId = item.getGroupId(); |
| | | CommonGroup group = (CommonGroup) this.commonGroupService.getById(groupId); |
| | | long count = this.surfaceService.count(Lambda.eq((v0) -> { |
| | |
| | | public Boolean updateTray(TrayUpdateVO vo) { |
| | | Tray tray = TrayConvert.INSTANCE.convert(vo); |
| | | boolean update = updateById(tray); |
| | | |
| | | this.commonGroupOfItemService.update(Wrappers.<CommonGroupOfItem>lambdaUpdate() |
| | | .set(CommonGroupOfItem::getGroupId, vo.getGroupId()) |
| | | .eq(CommonGroupOfItem::getItemId, vo.getId())); |
| | | /* |
| | | this.commonGroupOfItemService.update((Wrapper) ((LambdaUpdateWrapper) Wrappers.lambdaUpdate().set((v0) -> { |
| | | return v0.getGroupId(); |
| | | }, vo.getGroupId())).eq((v0) -> { |
| | | return v0.getItemId(); |
| | | }, vo.getId())); |
| | | }, vo.getId()));*/ |
| | | Integer availability = vo.getAvailability(); |
| | | boolean flag = Func.isNotEmpty(availability); |
| | | if (flag) { |
| | |
| | | List<Long> ids = Func.toLongList(vo.getIds()); |
| | | int count = removeFaceFixture(ids); |
| | | ThrowFun.isTrue(count > 0).throwMessage(MessageUtils.message("cps.tray.face.banding.fixture", new Object[0])); |
| | | long countTrayStorage = this.storageService.count((Wrapper) Wrappers.lambdaQuery().in((v0) -> { |
| | | return v0.getTrayId(); |
| | | }, ids)); |
| | | long countTrayStorage = this.storageService.count(Wrappers.<TrayStorage>lambdaQuery().in(TrayStorage::getTrayId, ids)); |
| | | ThrowFun.isTrue(countTrayStorage > 0).throwMessage(MessageUtils.message("cps.tray.ware.station.fixture", new Object[0])); |
| | | boolean remove = removeByIds(ids); |
| | | boolean removeFace = this.surfaceService.remove((Wrapper) Wrappers.lambdaQuery().in((v0) -> { |
| | | return v0.getTrayId(); |
| | | }, ids)); |
| | | boolean removeFixture = this.fixtureService.remove((Wrapper) Wrappers.lambdaQuery().in((v0) -> { |
| | | return v0.getTrayId(); |
| | | }, ids)); |
| | | boolean removeFace = this.surfaceService.remove(Wrappers.<TraySurface>lambdaQuery().in(TraySurface::getTrayId, ids)); |
| | | boolean removeFixture = this.fixtureService.remove(Wrappers.<TrayFixture>lambdaQuery().in(TrayFixture::getTrayId, ids)); |
| | | this.fixtureService.updateFixtureStatusByTray(ids); |
| | | this.storageService.remove((Wrapper) Wrappers.lambdaQuery().in((v0) -> { |
| | | return v0.getTrayId(); |
| | | }, ids)); |
| | | this.storageService.remove(Wrappers.<TrayStorage>lambdaQuery().in(TrayStorage::getTrayId, ids)); |
| | | return Boolean.valueOf(remove && removeFace && removeFixture); |
| | | } |
| | | |
| | |
| | | @Transactional(rollbackFor = {Exception.class}) |
| | | public Boolean removeTree(Long id) { |
| | | CommonGroup group = (CommonGroup) this.commonGroupService.getById(id); |
| | | CommonGroup rootGroup = (CommonGroup) this.commonGroupService.getOne((Wrapper) ((LambdaQueryWrapper) ((LambdaQueryWrapper) Wrappers.lambdaQuery().eq((v0) -> { |
| | | return v0.getGroupCategory(); |
| | | }, group.getGroupCategory())).eq((v0) -> { |
| | | return v0.getGroupType(); |
| | | }, group.getGroupType())).eq((v0) -> { |
| | | return v0.getName(); |
| | | }, CommonGroupConstant.DEFAULT_GROUP_NAME)); |
| | | |
| | | CommonGroup rootGroup = this.commonGroupService.getOne(Wrappers.<CommonGroup>lambdaQuery() |
| | | .eq(CommonGroup::getGroupCategory, group.getGroupCategory()) |
| | | .eq(CommonGroup::getGroupType, group.getGroupType()) |
| | | .eq(CommonGroup::getName, CommonGroupConstant.DEFAULT_GROUP_NAME)); |
| | | |
| | | List<CommonGroup> allSubGroup = this.commonGroupService.getAllSubGroup(Long.valueOf(Func.toLong(id)), group.getGroupType(), group.getGroupCategory()); |
| | | List<Long> groupId = (List) allSubGroup.stream().map((v0) -> { |
| | | List<Long> groupId = allSubGroup.stream().map((v0) -> { |
| | | return v0.getId(); |
| | | }).collect(Collectors.toList()); |
| | | |
| | | boolean update = this.commonGroupOfItemService.update(Wrappers.<CommonGroupOfItem>lambdaUpdate() |
| | | .set(CommonGroupOfItem::getGroupId, rootGroup.getId()) |
| | | .in(CommonGroupOfItem::getGroupId, groupId)); |
| | | |
| | | /* |
| | | boolean update = this.commonGroupOfItemService.update((Wrapper) ((LambdaUpdateWrapper) Wrappers.lambdaUpdate().set((v0) -> { |
| | | return v0.getGroupId(); |
| | | }, rootGroup.getId())).in((v0) -> { |
| | | return v0.getGroupId(); |
| | | }, groupId)); |
| | | }, groupId));*/ |
| | | boolean remove = this.commonGroupService.removeById(id); |
| | | return Boolean.valueOf(update && remove); |
| | | } |
| | |
| | | |
| | | @Override // org.springblade.modules.cps.service.ITrayService |
| | | public List<ToolAppendixVO> listToolAppendix(String id) { |
| | | List<ToolAppendix> appendixList = this.toolAppendixService.list(Wrappers.<ToolAppendix>lambdaQuery() |
| | | .eq(ToolAppendix::getParentId, id)); |
| | | /* |
| | | List<ToolAppendix> appendixList = this.toolAppendixService.list((Wrapper) Wrappers.lambdaQuery().eq((v0) -> { |
| | | return v0.getParentId(); |
| | | }, id)); |
| | | }, id));*/ |
| | | return ToolAppendixConvert.INSTANCE.convert(appendixList); |
| | | } |
| | | |
| | |
| | | |
| | | @Override // org.springblade.modules.cps.service.ITrayService |
| | | public List<TrayEasyVO> listTray() { |
| | | List<Tray> list = list(Wrappers.<Tray>lambdaQuery() |
| | | .orderByDesc(Arrays.asList(Tray::getCreateTime, Tray::getId) )); |
| | | /* |
| | | List<Tray> list = list((Wrapper) Wrappers.lambdaQuery().orderByDesc((v0) -> { |
| | | return v0.getCreateTime(); |
| | | }, new SFunction[]{(v0) -> { |
| | | return v0.getId(); |
| | | }})); |
| | | }}));*/ |
| | | return TrayConvert.INSTANCE.convertVO(list); |
| | | } |
| | | |
| | |
| | | if (trayData.size() > 200) { |
| | | throw new ServiceException(MessageUtils.message("excel.import.size.failed", new Object[0])); |
| | | } |
| | | Set<String> trayCodeSet = (Set) list().stream().map((v0) -> { |
| | | Set<String> trayCodeSet = list().stream().map((v0) -> { |
| | | return v0.getCode(); |
| | | }).collect(Collectors.toSet()); |
| | | Map<String, List<TrayImport>> map = (Map) trayData.stream().filter(c -> { |
| | | Map<String, List<TrayImport>> map = trayData.stream().filter(c -> { |
| | | return Func.isNotEmpty(c.getTrayCode()); |
| | | }).collect(Collectors.groupingBy((v0) -> { |
| | | return v0.getTrayCode(); |
| | | })); |
| | | HashMap<String, Long> commonGroupNameMap = this.commonGroupService.getCommonGroupNameMap(CommonGroupTypeEnum.TRAY.getName(), CommonGroupConstant.DEFAULT_CATEGORY); |
| | | checkTrayImport(trayData, commonGroupNameMap, map, trayCodeSet); |
| | | List<TrayImport> fails = (List) trayData.stream().filter(w -> { |
| | | List<TrayImport> fails = trayData.stream().filter(w -> { |
| | | return StrUtil.isNotEmpty(w.getFailReason()); |
| | | }).collect(Collectors.toList()); |
| | | if (fails.size() > 0) { |
| | | MultipartFile template = ExcelUtil.exportFillTemplateToMultipartFile(ExcelConstant.DIRECTORY + "trayImportErrorTemplate" + ExcelConstant.SUFFIX, MessageUtils.message("excel.import.failed.report.name", new Object[0]) + ExcelConstant.SUFFIX, "托盘信息表", (List) trayData.stream().filter(x -> { |
| | | MultipartFile template = ExcelUtil.exportFillTemplateToMultipartFile(ExcelConstant.DIRECTORY + "trayImportErrorTemplate" + ExcelConstant.SUFFIX, MessageUtils.message("excel.import.failed.report.name", new Object[0]) + ExcelConstant.SUFFIX, "托盘信息表", trayData.stream().filter(x -> { |
| | | return Func.isNotEmpty(x.getFailReason()); |
| | | }).collect(Collectors.toList()), (Object) null, (AbstractMergeStrategy) null); |
| | | return this.ossBuilder.tempTemplate().putFile(template.getOriginalFilename(), template); |
| | |
| | | trayImport.setTrayGroupName(CommonGroupEnum.UNASSORTED.getCode()); |
| | | } |
| | | if (trayCodeSet.contains(trayImport.getTrayCode())) { |
| | | update(Wrappers.<Tray>update().lambda().eq(Tray::getCode, trayImport.getTrayCode()).set(Tray::getName, trayImport.getName())); |
| | | /* |
| | | update((Wrapper) ((LambdaUpdateWrapper) Wrappers.update().lambda().eq((v0) -> { |
| | | return v0.getCode(); |
| | | }, trayImport.getTrayCode())).set((v0) -> { |
| | | return v0.getName(); |
| | | }, trayImport.getName())); |
| | | Tray tray = (Tray) getOne((Wrapper) Wrappers.query().lambda().eq((v0) -> { |
| | | return v0.getCode(); |
| | | }, trayImport.getTrayCode())); |
| | | }, trayImport.getName()));*/ |
| | | Tray tray = getOne(Wrappers.<Tray>query().lambda().eq(Tray::getCode, trayImport.getTrayCode())); |
| | | this.commonGroupOfItemService.update(Wrappers.<CommonGroupOfItem>update().lambda() |
| | | .eq(CommonGroupOfItem::getItemId, tray.getId()) |
| | | .set(CommonGroupOfItem::getGroupId, commonGroupNameMap.get(trayImport.getTrayGroupName()))); |
| | | /* |
| | | this.commonGroupOfItemService.update((Wrapper) ((LambdaUpdateWrapper) Wrappers.update().lambda().eq((v0) -> { |
| | | return v0.getItemId(); |
| | | }, tray.getId())).set((v0) -> { |
| | | return v0.getGroupId(); |
| | | }, commonGroupNameMap.get(trayImport.getTrayGroupName()))); |
| | | */ |
| | | return; |
| | | } |
| | | TraySaveVO traySaveVO = new TraySaveVO(); |
| | |
| | | traySaveVO.setName(Func.isEmpty(trayImport.getName()) ? trayImport.getTrayCode() : trayImport.getName()); |
| | | traySaveVO.setAvailability(TrayEnum.StatusEnum.ACTIVATING.getStatus()); |
| | | traySaveVO.setGroupId((Long) commonGroupNameMap.get(trayImport.getTrayGroupName())); |
| | | traySaveVO.setFaceList(new ArrayList()); |
| | | traySaveVO.setFaceList(new ArrayList<>()); |
| | | saveTray(traySaveVO); |
| | | }); |
| | | return null; |
| | |
| | | if (Func.isEmpty(vo)) { |
| | | return Lists.newArrayList(); |
| | | } |
| | | List<Long> groupIds = (List) vo.stream().map((v0) -> { |
| | | List<Long> groupIds = vo.stream().map((v0) -> { |
| | | return v0.getParentId(); |
| | | }).collect(Collectors.toList()); |
| | | |
| | | List<CommonGroup> commonGroups = this.commonGroupService.list(Wrappers.<CommonGroup>lambdaQuery().in(CommonGroup::getId, groupIds)); |
| | | /* |
| | | List<CommonGroup> commonGroups = this.commonGroupService.list((Wrapper) Wrappers.lambdaQuery().in((v0) -> { |
| | | return v0.getId(); |
| | | }, groupIds)); |
| | | List<TrayTreeVO> groups = (List) commonGroups.stream().map(this::convert).collect(Collectors.toList()); |
| | | */ |
| | | List<TrayTreeVO> groups = commonGroups.stream().map(this::convert).collect(Collectors.toList()); |
| | | vo.addAll(groups); |
| | | return ForestNodeMerger.merge(vo); |
| | | } |
| | | |
| | | private List<TrayTreeVO> getTrayTree(List<TrayTreeVO> vo, CommonGroupTypeVO groupTypeVO) { |
| | | List<CommonGroup> commonGroups = this.commonGroupService.list(Wrappers.<CommonGroup>lambdaQuery() |
| | | .eq(CommonGroup::getGroupType, groupTypeVO.getGroupType()) |
| | | .eq(CommonGroup::getGroupCategory, groupTypeVO.getGroupCategory())); |
| | | /* |
| | | List<CommonGroup> commonGroups = this.commonGroupService.list((Wrapper) ((LambdaQueryWrapper) Wrappers.lambdaQuery().eq((v0) -> { |
| | | return v0.getGroupType(); |
| | | }, groupTypeVO.getGroupType())).eq((v0) -> { |
| | | return v0.getGroupCategory(); |
| | | }, groupTypeVO.getGroupCategory())); |
| | | List<TrayTreeVO> groups = (List) commonGroups.stream().map(this::convert).collect(Collectors.toList()); |
| | | }, groupTypeVO.getGroupCategory()));*/ |
| | | List<TrayTreeVO> groups = commonGroups.stream().map(this::convert).collect(Collectors.toList()); |
| | | vo.addAll(groups); |
| | | return ForestNodeMerger.merge(vo); |
| | | } |