| | |
| | | package com.qianwen.smartman.modules.fms.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.google.common.collect.Lists; |
| | | import java.lang.invoke.SerializedLambda; |
| | | import java.util.HashSet; |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.google.common.collect.Lists; |
| | | import com.qianwen.core.log.exception.ServiceException; |
| | | import com.qianwen.core.tool.utils.Func; |
| | | import com.qianwen.smartman.common.cache.ParamCache; |
| | | import com.qianwen.smartman.common.cache.RegionCache; |
| | | import com.qianwen.smartman.common.constant.CommonConstant; |
| | | import com.qianwen.smartman.common.constant.FmsConstant; |
| | | import com.qianwen.smartman.common.utils.MessageUtils; |
| | | import com.qianwen.core.log.exception.ServiceException; |
| | | import com.qianwen.core.tool.utils.Func; |
| | | import com.qianwen.smartman.modules.cps.entity.Tray; |
| | | import com.qianwen.smartman.modules.cps.entity.Workstation; |
| | | import com.qianwen.smartman.modules.cps.entity.WorkstationWorkbench; |
| | | import com.qianwen.smartman.modules.cps.enums.TrayEnum; |
| | | import com.qianwen.smartman.modules.cps.enums.WorkTypeEnum; |
| | | import com.qianwen.smartman.modules.cps.service.ITrayService; |
| | |
| | | import com.qianwen.smartman.modules.fms.service.IFmsScheduleService; |
| | | import com.qianwen.smartman.modules.fms.util.FmsForestUtil; |
| | | import com.qianwen.smartman.modules.fms.vo.ManualTrayVO; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service |
| | | /* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/fms/service/impl/FmsScheduleServiceImpl.class */ |
| | |
| | | private final IFmsOrderService fmsOrderService; |
| | | private final FmsForestClient fmsForestClient; |
| | | |
| | | private static /* synthetic */ Object $deserializeLambda$(SerializedLambda lambda) { |
| | | String implMethodName = lambda.getImplMethodName(); |
| | | boolean z = true; |
| | | switch (implMethodName.hashCode()) { |
| | | case -1757019252: |
| | | if (implMethodName.equals("getCurrentPosition")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case -1028820157: |
| | | if (implMethodName.equals("getPartType")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case -927447111: |
| | | if (implMethodName.equals("getTrayCode")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case -557259320: |
| | | if (implMethodName.equals("getWorkstationId")) { |
| | | z = false; |
| | | break; |
| | | } |
| | | break; |
| | | case -75622813: |
| | | if (implMethodName.equals("getCode")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case -39017699: |
| | | if (implMethodName.equals("getCurrentType")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case 515915377: |
| | | if (implMethodName.equals("getCurrentStation")) { |
| | | 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/WorkstationWorkbench") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) { |
| | | return (v0) -> { |
| | | return v0.getWorkstationId(); |
| | | }; |
| | | } |
| | | 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/fms/entity/FmsRealTimeTray") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getTrayCode(); |
| | | }; |
| | | } |
| | | 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/fms/entity/FmsRealTimeTray") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getCurrentStation(); |
| | | }; |
| | | } |
| | | 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/fms/entity/FmsRealTimeTray") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) { |
| | | return (v0) -> { |
| | | return v0.getCurrentType(); |
| | | }; |
| | | } |
| | | 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/fms/entity/FmsRealTimeTray") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) { |
| | | return (v0) -> { |
| | | return v0.getCurrentType(); |
| | | }; |
| | | } |
| | | 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/fms/entity/FmsRealTimeTray") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getCurrentPosition(); |
| | | }; |
| | | } |
| | | 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/fms/entity/FmsRealTimeTray") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getCurrentPosition(); |
| | | }; |
| | | } |
| | | 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/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/Workstation") && 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/fms/entity/FmsRealTimeTray") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) { |
| | | return (v0) -> { |
| | | return v0.getPartType(); |
| | | }; |
| | | } |
| | | break; |
| | | } |
| | | throw new IllegalArgumentException("Invalid lambda deserialization"); |
| | | } |
| | | |
| | | |
| | | public FmsScheduleServiceImpl(final ITrayService trayService, final IFmsRealTimeTrayService fmsRealTimeTrayService, final IWorkstationWorkbenchService workstationWorkbenchService, final IWorkstationService workstationService, final IFmsOrderService fmsOrderService, final FmsForestClient fmsForestClient) { |
| | | this.trayService = trayService; |
| | |
| | | public Boolean check(ManualTrayVO manualTrayVO) { |
| | | checkManual(); |
| | | checkTrayStatus(manualTrayVO.getTrayCode()); |
| | | FmsRealTimeTray fmsRealTimeTray = this.fmsRealTimeTrayService.getOne(Wrappers.<FmsRealTimeTray>lambdaQuery().eq(FmsRealTimeTray::getTrayCode, manualTrayVO.getTrayCode())); |
| | | /* |
| | | FmsRealTimeTray fmsRealTimeTray = (FmsRealTimeTray) this.fmsRealTimeTrayService.getOne((Wrapper) Wrappers.lambdaQuery().eq((v0) -> { |
| | | return v0.getTrayCode(); |
| | | }, manualTrayVO.getTrayCode())); |
| | | }, manualTrayVO.getTrayCode()));*/ |
| | | checkScheState(fmsRealTimeTray.getScheState()); |
| | | checkTargetHasTray(manualTrayVO); |
| | | if (PositionTypeEnum.DEVICE.getType().equals(manualTrayVO.getEndType())) { |
| | |
| | | } |
| | | |
| | | private void checkTrayStatus(String trayCode) { |
| | | Tray tray = (Tray) this.trayService.getOne((Wrapper) Wrappers.lambdaQuery().eq((v0) -> { |
| | | return v0.getCode(); |
| | | }, trayCode)); |
| | | Tray tray = this.trayService.getOne(Wrappers.<Tray>lambdaQuery().eq(Tray::getCode, trayCode)); |
| | | |
| | | if (TrayEnum.StatusEnum.FREEZE.getStatus().equals(tray.getAvailability())) { |
| | | throw new ServiceException(MessageUtils.message("fms.schedule.tray.is.freeze", new Object[0])); |
| | | } |
| | |
| | | List<Long> strings = Func.toLongList(workstationIds); |
| | | workstationIdSet.addAll(strings); |
| | | }); |
| | | |
| | | List<String> workstationCodeList = this.workstationService.listByIds(workstationIdSet).stream().map(Workstation::getCode).collect(Collectors.toList()); |
| | | /* |
| | | List<String> workstationCodeList = (List) this.workstationService.listByIds(workstationIdSet).stream().map((v0) -> { |
| | | return v0.getCode(); |
| | | }).collect(Collectors.toList()); |
| | | }).collect(Collectors.toList());*/ |
| | | if (!workstationCodeList.contains(manualTrayVO.getEndPosition())) { |
| | | throw new ServiceException(MessageUtils.message("fms.schedule.order.not.assign.to.this.position", new Object[0])); |
| | | } |
| | |
| | | } |
| | | |
| | | private void checkTargetHasTray(ManualTrayVO manualTrayVO) { |
| | | long count = this.fmsRealTimeTrayService.count(Wrappers.<FmsRealTimeTray>lambdaQuery() |
| | | .eq(PositionTypeEnum.DEVICE.getType().equals(manualTrayVO.getEndType()), FmsRealTimeTray::getCurrentPosition, manualTrayVO.getEndPosition()) |
| | | .eq(FmsRealTimeTray::getCurrentStation, manualTrayVO.getEndStation()) |
| | | .eq(FmsRealTimeTray::getCurrentType, manualTrayVO.getEndType())); |
| | | |
| | | /* |
| | | long count = this.fmsRealTimeTrayService.count((Wrapper) ((LambdaQueryWrapper) Wrappers.lambdaQuery().eq(PositionTypeEnum.DEVICE.getType().equals(manualTrayVO.getEndType()), (v0) -> { |
| | | return v0.getCurrentPosition(); |
| | | }, manualTrayVO.getEndPosition()).eq((v0) -> { |
| | | return v0.getCurrentStation(); |
| | | }, manualTrayVO.getEndStation())).eq((v0) -> { |
| | | return v0.getCurrentType(); |
| | | }, manualTrayVO.getEndType())); |
| | | }, manualTrayVO.getEndType()));*/ |
| | | if (count > CommonConstant.ZERO.intValue()) { |
| | | throw new ServiceException(MessageUtils.message("fms.schedule.target.position.has.already.exists.tray", new Object[0])); |
| | | } |
| | |
| | | } |
| | | |
| | | private Workstation getWorkstation(String workstationCode) { |
| | | return (Workstation) this.workstationService.getOne((Wrapper) Wrappers.lambdaQuery().eq((v0) -> { |
| | | return v0.getCode(); |
| | | }, workstationCode)); |
| | | return this.workstationService.getOne(Wrappers.<Workstation>lambdaQuery().eq(Workstation::getCode, workstationCode)); |
| | | } |
| | | |
| | | private Boolean isSingleWorkBench(Long workstationId) { |
| | | long count = this.workstationWorkbenchService.count(Wrappers.<WorkstationWorkbench>lambdaQuery().eq(WorkstationWorkbench::getWorkstationId, workstationId)); |
| | | /* |
| | | long count = this.workstationWorkbenchService.count((Wrapper) Wrappers.lambdaQuery().eq((v0) -> { |
| | | return v0.getWorkstationId(); |
| | | }, workstationId)); |
| | | }, workstationId));*/ |
| | | return Boolean.valueOf(count <= ((long) CommonConstant.ONE.intValue())); |
| | | } |
| | | |
| | | private void deviceIsInProcess(String position) { |
| | | long count = this.fmsRealTimeTrayService.count(Wrappers.<FmsRealTimeTray>lambdaQuery() |
| | | .eq(FmsRealTimeTray::getCurrentPosition, position) |
| | | .eq(FmsRealTimeTray::getCurrentType, PositionTypeEnum.DEVICE.getType()) |
| | | .eq(FmsRealTimeTray::getPartType, Integer.valueOf(RealTimePartTypeEnum.IN_PROCESS.getType()))); |
| | | /* |
| | | long count = this.fmsRealTimeTrayService.count((Wrapper) ((LambdaQueryWrapper) ((LambdaQueryWrapper) Wrappers.lambdaQuery().eq((v0) -> { |
| | | return v0.getCurrentPosition(); |
| | | }, position)).eq((v0) -> { |
| | |
| | | }, PositionTypeEnum.DEVICE.getType())).eq((v0) -> { |
| | | return v0.getPartType(); |
| | | }, Integer.valueOf(RealTimePartTypeEnum.IN_PROCESS.getType()))); |
| | | */ |
| | | if (count > CommonConstant.ZERO.intValue()) { |
| | | throw new ServiceException(MessageUtils.message("fms.schedule.device.status.is.in.process.can.not.drag.in.or.out", new Object[0])); |
| | | } |