fix: mes对接
This commit is contained in:
@@ -1,2 +1,532 @@
|
||||
# nladmin
|
||||
|
||||
## ACS文件下的目录结构
|
||||
```java
|
||||
acs
|
||||
├── AcsConfig.java
|
||||
├── agv
|
||||
│ ├── AgvUtil.java
|
||||
│ ├── agv说明
|
||||
│ ├── rest
|
||||
│ │ ├── MagicAgvController.java
|
||||
│ │ ├── NDCAgvController.java
|
||||
│ │ ├── XianGongAgvController.java
|
||||
│ │ └── ZheDaAgvController.java
|
||||
│ └── server
|
||||
│ ├── AgvService.java
|
||||
│ ├── dto
|
||||
│ │ └── AgvDto.java
|
||||
│ ├── impl
|
||||
│ │ ├── AgvServiceImpl.java
|
||||
│ │ ├── MagicAgvServiceImpl.java
|
||||
│ │ ├── NDCAgvServiceImpl.java
|
||||
│ │ └── XianGongAgvServiceImpl.java
|
||||
│ ├── MagicAgvService.java
|
||||
│ ├── NDCAgvService.java
|
||||
│ └── XianGongAgvService.java
|
||||
├── auto
|
||||
│ ├── AcsInit.java
|
||||
│ ├── AutoRunController.java
|
||||
│ ├── initial
|
||||
│ │ ├── ApplicationAutoInitial.java
|
||||
│ │ ├── ApplicationAutoInitialExecuter.java
|
||||
│ │ ├── WebAutoInitial.java
|
||||
│ │ └── WebAutoInitialExecuter.java
|
||||
│ └── run
|
||||
│ ├── AbstractAutoRunnable.java
|
||||
│ ├── AutoRunService.java
|
||||
│ ├── AutoRunServiceImpl.java
|
||||
│ ├── DevelopConfig.java
|
||||
│ ├── SystemConfig.java
|
||||
│ ├── ThreadDto.java
|
||||
│ ├── ThreadStatusEnum.java
|
||||
│ └── ThreadUsedStatusEnum.java
|
||||
├── autotask
|
||||
│ └── CleanLog.java
|
||||
├── common
|
||||
│ ├── AbstractDriverService.java
|
||||
│ ├── IDriverService.java
|
||||
│ ├── StandardCoveyorControlWithPlcScannerDevice.java
|
||||
│ ├── StandardInspectSiteDevice.java
|
||||
│ └── StandardOrdinarySiteDevice.java
|
||||
├── config
|
||||
│ ├── AcsConfig.java
|
||||
│ ├── dto
|
||||
│ │ └── AcsConfigDto.java
|
||||
│ ├── rest
|
||||
│ │ └── AcsConfigController.java
|
||||
│ ├── server
|
||||
│ │ ├── AcsConfigService.java
|
||||
│ │ └── impl
|
||||
│ │ └── AcsConfigServiceImpl.java
|
||||
│ └── wql
|
||||
│ └── sys_config.xls
|
||||
├── device
|
||||
│ ├── address
|
||||
│ │ ├── rest
|
||||
│ │ │ └── AddressController.java
|
||||
│ │ ├── service
|
||||
│ │ │ ├── AddressService.java
|
||||
│ │ │ ├── dto
|
||||
│ │ │ │ └── AddressDto.java
|
||||
│ │ │ └── impl
|
||||
│ │ │ └── AddressServiceImpl.java
|
||||
│ │ └── wql
|
||||
│ │ └── sys_config.xls
|
||||
│ ├── device_driver
|
||||
│ │ ├── DeviceDriverConfigController.java
|
||||
│ │ ├── DeviceDriverConfigDto.java
|
||||
│ │ ├── DeviceDriverConfigService.java
|
||||
│ │ ├── DeviceDriverConfigServiceImpl.java
|
||||
│ │ ├── DriverTypeEnum.java
|
||||
│ │ └── standard_inspect
|
||||
│ │ ├── BaseDeviceDriver.java
|
||||
│ │ ├── ItemDto.java
|
||||
│ │ ├── ItemProtocol.java
|
||||
│ │ ├── OpcPlcDto.java
|
||||
│ │ └── ReadUtil.java
|
||||
│ ├── rest
|
||||
│ │ ├── AcsDeviceErpmappingController.java
|
||||
│ │ ├── DeviceAssignedController.java
|
||||
│ │ ├── DeviceController.java
|
||||
│ │ ├── DeviceDbitemController.java
|
||||
│ │ ├── DeviceExtraController.java
|
||||
│ │ ├── OpcController.java
|
||||
│ │ ├── OpcPlcController.java
|
||||
│ │ └── StorageCellController.java
|
||||
│ ├── service
|
||||
│ │ ├── AcsDeviceErpmappingService.java
|
||||
│ │ ├── DeviceAssignedService.java
|
||||
│ │ ├── DeviceDbitemService.java
|
||||
│ │ ├── DeviceDriverDefinationAppService.java
|
||||
│ │ ├── DeviceExtraService.java
|
||||
│ │ ├── DeviceService.java
|
||||
│ │ ├── dto
|
||||
│ │ │ ├── AcsDeviceErpmappingDto.java
|
||||
│ │ │ ├── DeviceAssignedDto.java
|
||||
│ │ │ ├── DeviceDbitemDto.java
|
||||
│ │ │ ├── DeviceDriverDto.java
|
||||
│ │ │ ├── DeviceDto.java
|
||||
│ │ │ ├── DeviceExtraDto.java
|
||||
│ │ │ ├── DeviceRunpointDto.java
|
||||
│ │ │ ├── OpcDto.java
|
||||
│ │ │ ├── OpcPlcDto.java
|
||||
│ │ │ └── StorageCellDto.java
|
||||
│ │ ├── impl
|
||||
│ │ │ ├── AcsDeviceErpmappingServiceImpl.java
|
||||
│ │ │ ├── ConveyorDevice.java
|
||||
│ │ │ ├── DeviceAssignedServiceImpl.java
|
||||
│ │ │ ├── DeviceDbitemServiceImpl.java
|
||||
│ │ │ ├── DeviceExtraServiceImpl.java
|
||||
│ │ │ ├── DeviceServiceImpl.java
|
||||
│ │ │ ├── ExportCSVUtil.java
|
||||
│ │ │ ├── OpcPlcServiceImpl.java
|
||||
│ │ │ ├── OpcServiceImpl.java
|
||||
│ │ │ ├── StorageCellServiceImpl.java
|
||||
│ │ │ └── Test.java
|
||||
│ │ ├── OpcPlcService.java
|
||||
│ │ ├── OpcService.java
|
||||
│ │ └── StorageCellService.java
|
||||
│ └── wql
|
||||
│ ├── Qdevice_query_002.wql
|
||||
│ ├── QStage_01.wql
|
||||
│ ├── route.xls
|
||||
│ └── task_inst.xls
|
||||
├── device.xls
|
||||
├── device_driver
|
||||
│ ├── basedriver
|
||||
│ │ ├── agv
|
||||
│ │ │ ├── magic_agv
|
||||
│ │ │ │ ├── MagicAgvDefination.java
|
||||
│ │ │ │ └── MagicAgvDeviceDriver.java
|
||||
│ │ │ ├── ndcone
|
||||
│ │ │ │ ├── AgvNdcOneDefination.java
|
||||
│ │ │ │ └── AgvNdcOneDeviceDriver.java
|
||||
│ │ │ └── utils
|
||||
│ │ │ ├── IAgv.java
|
||||
│ │ │ ├── OneAgvPhase.java
|
||||
│ │ │ └── TwoAgvPhase.java
|
||||
│ │ ├── cargo_lift_conveyor
|
||||
│ │ │ ├── CargoLiftConveyorDefination.java
|
||||
│ │ │ ├── CargoLiftConveyorDeviceDriver.java
|
||||
│ │ │ └── ItemProtocol.java
|
||||
│ │ ├── empty_vehicle_stacking_position
|
||||
│ │ │ ├── EmptyVehicleStackingPositionDefination.java
|
||||
│ │ │ ├── EmptyVehicleStackingPositionDeviceDriver.java
|
||||
│ │ │ └── ItemProtocol.java
|
||||
│ │ ├── standard_conveyor_control
|
||||
│ │ │ ├── ItemProtocol.java
|
||||
│ │ │ ├── StandardConveyorControlDefination.java
|
||||
│ │ │ └── StandardCoveyorControlDeviceDriver.java
|
||||
│ │ ├── standard_conveyor_control_with_plcscanner
|
||||
│ │ │ ├── ItemProtocol.java
|
||||
│ │ │ ├── StandardConveyorControlWithPlcScannerDefination.java
|
||||
│ │ │ ├── StandardConveyorWithPlcScannerConfig.java
|
||||
│ │ │ └── StandardCoveyorControlWithPlcScannerDeviceDriver.java
|
||||
│ │ ├── standard_inspect_site
|
||||
│ │ │ ├── ItemProtocol.java
|
||||
│ │ │ ├── StandardInspectSiteDefination.java
|
||||
│ │ │ └── StandardInspectSiteDeviceDriver.java
|
||||
│ │ ├── standard_ordinary_site
|
||||
│ │ │ ├── StandardOrdinarySiteDefination.java
|
||||
│ │ │ └── StandardOrdinarySiteDeviceDriver.java
|
||||
│ │ ├── standard_scanner
|
||||
│ │ │ ├── StandardScannerDefination.java
|
||||
│ │ │ └── StandardScannerDeviceDriver.java
|
||||
│ │ └── standard_storage
|
||||
│ │ ├── StandardStorageDefination.java
|
||||
│ │ └── StandardStorageDeviceDriver.java
|
||||
│ ├── defination
|
||||
│ │ └── OpcDeviceDriverDefination.java
|
||||
│ ├── DeviceDriver.java
|
||||
│ ├── DeviceDriverDefination.java
|
||||
│ ├── driver
|
||||
│ │ ├── AbstractDeviceDriver.java
|
||||
│ │ ├── AbstractOpcDeviceDriver.java
|
||||
│ │ ├── ExecutableDeviceDriver.java
|
||||
│ │ └── OpcDeviceDriver.java
|
||||
│ ├── lamp_three_color
|
||||
│ │ ├── ItemProtocol.java
|
||||
│ │ ├── LampThreecolorDefination.java
|
||||
│ │ └── LampThreecolorDeviceDriver.java
|
||||
│ ├── LinewayDeviceDriver.java
|
||||
│ ├── lnsh
|
||||
│ │ ├── converor_barcode
|
||||
│ │ │ ├── ConveyorBarcodeDefination.java
|
||||
│ │ │ ├── ConveyorBarcodeDeviceDriver.java
|
||||
│ │ │ └── ItemProtocol.java
|
||||
│ │ ├── conveyor_press_station
|
||||
│ │ │ ├── ConveyorPressStationDefination.java
|
||||
│ │ │ ├── ConveyorPressStationDeviceDriver.java
|
||||
│ │ │ └── ItemProtocol.java
|
||||
│ │ ├── lnsh_crusher
|
||||
│ │ │ ├── ItemProtocol.java
|
||||
│ │ │ ├── LnshCrusherDefination.java
|
||||
│ │ │ └── LnshCrusherDeviceDriver.java
|
||||
│ │ ├── lnsh_fold_disc_site
|
||||
│ │ │ ├── ItemProtocol.java
|
||||
│ │ │ ├── LnshFoldDiscSiteDefination.java
|
||||
│ │ │ └── LnshFoldDiscSiteDeviceDriver.java
|
||||
│ │ ├── lnsh_kiln_lane
|
||||
│ │ │ ├── ItemProtocol.java
|
||||
│ │ │ ├── LnshKilnLaneDefination.java
|
||||
│ │ │ └── LnshKilnLaneDeviceDriver.java
|
||||
│ │ ├── lnsh_kiln_truss
|
||||
│ │ │ ├── ItemProtocol.java
|
||||
│ │ │ ├── LnshKilnTrussDefination.java
|
||||
│ │ │ └── LnshKilnTrussDeviceDriver.java
|
||||
│ │ ├── lnsh_labeling_machine
|
||||
│ │ │ ├── ItemProtocol.java
|
||||
│ │ │ ├── LnshLabelingMachineDefination.java
|
||||
│ │ │ └── LnshLabelingMachineDeviceDriver.java
|
||||
│ │ ├── lnsh_Laminating_machine
|
||||
│ │ │ ├── ItemProtocol.java
|
||||
│ │ │ ├── LnshLaminatingMachineDefination.java
|
||||
│ │ │ └── LnshLaminatingMachineDeviceDriver.java
|
||||
│ │ ├── lnsh_mixing_mill
|
||||
│ │ │ ├── ItemProtocol.java
|
||||
│ │ │ ├── LnshMixingMillDefination.java
|
||||
│ │ │ └── LnshMixingMillDeviceDriver.java
|
||||
│ │ ├── lnsh_out_kiln_truss
|
||||
│ │ │ ├── ItemProtocol.java
|
||||
│ │ │ ├── LnshOutKilnTrussDefination.java
|
||||
│ │ │ └── LnshOutKilnTrussDeviceDriver.java
|
||||
│ │ ├── lnsh_package_line
|
||||
│ │ │ ├── ItemProtocol.java
|
||||
│ │ │ ├── LnshPackageLineDefination.java
|
||||
│ │ │ └── LnshPackageLineDeviceDriver.java
|
||||
│ │ ├── lnsh_package_pallet_manipulator
|
||||
│ │ │ ├── ItemProtocol.java
|
||||
│ │ │ ├── LnshPackagePalletManipulatorDefination.java
|
||||
│ │ │ └── LnshPackagePalletManipulatorDeviceDriver.java
|
||||
│ │ ├── lnsh_package_site
|
||||
│ │ │ ├── ItemProtocol.java
|
||||
│ │ │ ├── LnshPackageSiteDefination.java
|
||||
│ │ │ └── LnshPackageSiteDeviceDriver.java
|
||||
│ │ ├── lnsh_palletizing_manipulator
|
||||
│ │ │ ├── ItemProtocol.java
|
||||
│ │ │ ├── LnshPalletizingManipulatorDefination.java
|
||||
│ │ │ └── LnshPalletizingManipulatorDeviceDriver.java
|
||||
│ │ ├── lnsh_palletizing_manipulator_site
|
||||
│ │ │ ├── ItemProtocol.java
|
||||
│ │ │ ├── LnshPalletizingManipulatorSiteDefination.java
|
||||
│ │ │ └── LnshPalletizingManipulatorSiteDeviceDriver.java
|
||||
│ │ ├── lnsh_pallet_storage
|
||||
│ │ │ ├── ItemProtocol.java
|
||||
│ │ │ ├── LnshPalletStorageDefination.java
|
||||
│ │ │ └── LnshPalletStorageDeviceDriver.java
|
||||
│ │ ├── lnsh_press
|
||||
│ │ │ ├── ItemProtocol.java
|
||||
│ │ │ ├── LnshPressDefination.java
|
||||
│ │ │ └── LnshPressDeviceDriver.java
|
||||
│ │ ├── lnsh_rgv
|
||||
│ │ │ ├── ItemProtocol.java
|
||||
│ │ │ ├── LnshRGVDefination.java
|
||||
│ │ │ └── LnshRGVDeviceDriver.java
|
||||
│ │ ├── lnsh_split_manipulator
|
||||
│ │ │ ├── ItemProtocol.java
|
||||
│ │ │ ├── LnshSplitManipulatorDefination.java
|
||||
│ │ │ └── LnshSplitManipulatorDeviceDriver.java
|
||||
│ │ ├── lnsh_station
|
||||
│ │ │ ├── ItemProtocol.java
|
||||
│ │ │ ├── LnshStationDefination.java
|
||||
│ │ │ └── LnshStationDeviceDriver.java
|
||||
│ │ └── package_site
|
||||
│ │ ├── ItemProtocol.java
|
||||
│ │ ├── PackageSiteDefination.java
|
||||
│ │ └── PackageSiteDeviceDriver.java
|
||||
│ ├── RequestMethodEnum.java
|
||||
│ ├── RouteableDeviceDriver.java
|
||||
│ ├── ScannerDeviceDriver.java
|
||||
│ ├── StandardRequestMethod.java
|
||||
│ ├── standard_autodoor
|
||||
│ │ ├── ItemProtocol.java
|
||||
│ │ ├── StandardAutodoorDefination.java
|
||||
│ │ └── StandardAutodoorDeviceDriver.java
|
||||
│ ├── standard_emptypallet_site
|
||||
│ │ ├── ItemProtocol.java
|
||||
│ │ ├── StandardEmptyPalletSiteDefination.java
|
||||
│ │ └── StandardEmptyPalletSiteDeviceDriver.java
|
||||
│ └── StorageDeviceDriver.java
|
||||
├── ext
|
||||
│ └── wms
|
||||
│ ├── data
|
||||
│ │ ├── AcsToWmsData
|
||||
│ │ │ ├── applySignalStaus
|
||||
│ │ │ │ ├── ApplySignalStatusRequest.java
|
||||
│ │ │ │ └── ApplySignalStatusResponse.java
|
||||
│ │ │ ├── applyTask
|
||||
│ │ │ │ ├── ApplyDeviceDto.java
|
||||
│ │ │ │ ├── ApplyTaskRequest.java
|
||||
│ │ │ │ └── ApplyTaskResponse.java
|
||||
│ │ │ ├── feedBackSplitPalletStation
|
||||
│ │ │ │ ├── feedBackSplitPalletStationRequest.java
|
||||
│ │ │ │ └── feedBackSplitPalletStationResponse.java
|
||||
│ │ │ ├── feedBackTaskStatus
|
||||
│ │ │ │ ├── FeedBackTaskStatusRequest.java
|
||||
│ │ │ │ └── FeedBackTaskStatusResponse.java
|
||||
│ │ │ ├── getVehicle
|
||||
│ │ │ │ ├── GetPalletizeRequest.java
|
||||
│ │ │ │ └── GetPalletizeResponse.java
|
||||
│ │ │ ├── grab
|
||||
│ │ │ │ ├── GrabRequest.java
|
||||
│ │ │ │ └── GrabResponse.java
|
||||
│ │ │ └── grab_place_station
|
||||
│ │ │ ├── GrabPlaceStationRequest.java
|
||||
│ │ │ └── GrabPlaceStationResponse.java
|
||||
│ │ ├── BaseRequest.java
|
||||
│ │ ├── BaseResponse.java
|
||||
│ │ ├── PalletizeDto.java
|
||||
│ │ ├── Resp.java
|
||||
│ │ └── WmstoAcsData
|
||||
│ │ ├── cancelTask
|
||||
│ │ │ ├── CancelTaskRequest.java
|
||||
│ │ │ └── CancelTaskResponse.java
|
||||
│ │ ├── createOrder
|
||||
│ │ │ ├── CreateOrderRequest.java
|
||||
│ │ │ ├── CreateOrderResponse.java
|
||||
│ │ │ └── OrderDto.java
|
||||
│ │ ├── createTask
|
||||
│ │ │ ├── CreateTaskRequest.java
|
||||
│ │ │ └── CreateTaskResponse.java
|
||||
│ │ └── putAction
|
||||
│ │ ├── PutActionRequest.java
|
||||
│ │ ├── PutActionResponse.java
|
||||
│ │ └── SignalData.java
|
||||
│ ├── LmsUtil.java
|
||||
│ ├── RespUtil.java
|
||||
│ ├── rest
|
||||
│ │ ├── AcsToWmsController.java
|
||||
│ │ └── WmsToAcsController.java
|
||||
│ └── service
|
||||
│ ├── AcsToWmsService.java
|
||||
│ ├── impl
|
||||
│ │ ├── AcsToWmsServiceImpl.java
|
||||
│ │ └── WmsToAcsServiceImpl.java
|
||||
│ └── WmsToAcsService.java
|
||||
├── heartbeat
|
||||
│ ├── CompareOrder.java
|
||||
│ ├── domain
|
||||
│ │ ├── Domain.java
|
||||
│ │ ├── HeartbeatDomain.java
|
||||
│ │ └── SqlUtilFactory.java
|
||||
│ ├── dto
|
||||
│ │ ├── Dto.java
|
||||
│ │ └── HeartbeatManageDto.java
|
||||
│ ├── enums
|
||||
│ │ ├── HeartbeatType.java
|
||||
│ │ └── OptionType.java
|
||||
│ ├── event
|
||||
│ │ ├── HeartbeatChangeEvent.java
|
||||
│ │ └── HeartbeatOfflineEvent.java
|
||||
│ ├── EventObject.java
|
||||
│ ├── HeartbeatEvent.java
|
||||
│ ├── OrderType.java
|
||||
│ ├── service
|
||||
│ │ ├── HeartbeatManageService.java
|
||||
│ │ └── HeartbeatUnifiedService.java
|
||||
│ └── service_impl
|
||||
│ ├── HeartbeatManageServiceimpl.java
|
||||
│ └── HeartbeatUnifiedServiceimpl.java
|
||||
├── instruction
|
||||
│ ├── common
|
||||
│ │ ├── InstructFinishTypeEnum.java
|
||||
│ │ ├── InstructStatusEnum.java
|
||||
│ │ └── InstructTypeEnum.java
|
||||
│ ├── enums
|
||||
│ │ ├── InstCreateEnum.java
|
||||
│ │ ├── InstErrorEnum.java
|
||||
│ │ ├── InstFinishEnum.java
|
||||
│ │ ├── InstStatusEnum.java
|
||||
│ │ └── InstTypeEnum.java
|
||||
│ ├── rest
|
||||
│ │ └── InstructionController.java
|
||||
│ ├── service
|
||||
│ │ ├── dto
|
||||
│ │ │ ├── Instruction.java
|
||||
│ │ │ └── InstructionDto.java
|
||||
│ │ ├── impl
|
||||
│ │ │ └── InstructionServiceImpl.java
|
||||
│ │ ├── InstructionService.java
|
||||
│ │ └── wql
|
||||
│ │ └── QINST_QUERY.wql
|
||||
│ └── TestToAgv.java
|
||||
├── log
|
||||
│ ├── LokiLog.java
|
||||
│ ├── LokiLogAspect.java
|
||||
│ ├── LokiLogType.java
|
||||
│ └── service
|
||||
│ ├── DeviceExecuteLogService.java
|
||||
│ ├── dto
|
||||
│ │ ├── DeviceLogDto.java
|
||||
│ │ └── LogDto.java
|
||||
│ └── impl
|
||||
│ └── DeviceExecuteLogServiceImpl.java
|
||||
├── monitor
|
||||
│ ├── DeviceStageMonitor.java
|
||||
│ ├── rest
|
||||
│ │ └── DeviceStageMonitorController.java
|
||||
│ ├── service
|
||||
│ │ ├── DeviceStageMonitorService.java
|
||||
│ │ └── impl
|
||||
│ │ └── DeviceStageMonitorServiceImpl.java
|
||||
│ └── test.txt
|
||||
├── opc
|
||||
│ ├── BlockedRunable.java
|
||||
│ ├── Device.java
|
||||
│ ├── DeviceAppService.java
|
||||
│ ├── DeviceAppServiceImpl.java
|
||||
│ ├── DeviceDriverDefinationAppServiceImpl.java
|
||||
│ ├── DeviceExecuteAutoRun.java
|
||||
│ ├── DeviceExtraManageDto.java
|
||||
│ ├── DeviceManageDto.java
|
||||
│ ├── DeviceManageService.java
|
||||
│ ├── DeviceManageServiceImpl.java
|
||||
│ ├── DeviceOpcProtocolRunable.java
|
||||
│ ├── DeviceOpcSynchronizeAutoRun.java
|
||||
│ ├── DeviceType.java
|
||||
│ ├── enums
|
||||
│ │ └── HeartbeatTypeEnum.java
|
||||
│ ├── ItemValue.java
|
||||
│ ├── JsonUtl.java
|
||||
│ ├── ObjectUtl.java
|
||||
│ ├── OpcConfig.java
|
||||
│ ├── OpcEntity.java
|
||||
│ ├── OpcItemDto.java
|
||||
│ ├── OpcServerManageDto.java
|
||||
│ ├── OpcServerManageService.java
|
||||
│ ├── opcServerManageServiceImpl.java
|
||||
│ ├── OpcServerService.java
|
||||
│ ├── OpcServerServiceImpl.java
|
||||
│ ├── OpcServerUtl.java
|
||||
│ ├── OpcStartTag.java
|
||||
│ ├── OpcUtl.java
|
||||
│ ├── QualityTypeValue.java
|
||||
│ ├── ThreadUtl.java
|
||||
│ ├── UtgardTutorial1.java
|
||||
│ └── WcsConfig.java
|
||||
├── order
|
||||
│ ├── rest
|
||||
│ │ └── ProduceshiftorderController.java
|
||||
│ └── service
|
||||
│ ├── dto
|
||||
│ │ └── ProduceshiftorderDto.java
|
||||
│ ├── impl
|
||||
│ │ └── ProduceshiftorderServiceImpl.java
|
||||
│ ├── ProduceshiftorderService.java
|
||||
│ └── wql
|
||||
│ ├── order.xls
|
||||
│ └── QPRODUCESHIFTORDER.wql
|
||||
├── route
|
||||
│ ├── rest
|
||||
│ │ ├── RouteLineController.java
|
||||
│ │ ├── RouteLocController.java
|
||||
│ │ └── RoutePlanController.java
|
||||
│ ├── service
|
||||
│ │ ├── dto
|
||||
│ │ │ ├── RouteLineDto.java
|
||||
│ │ │ ├── RouteLocDto.java
|
||||
│ │ │ ├── RoutePlanDto.java
|
||||
│ │ │ └── RouteWeightDto.java
|
||||
│ │ ├── impl
|
||||
│ │ │ ├── RouteLineServiceImpl.java
|
||||
│ │ │ ├── RouteLocServiceImpl.java
|
||||
│ │ │ └── RoutePlanServiceImpl.java
|
||||
│ │ ├── RouteLineService.java
|
||||
│ │ ├── RouteLocService.java
|
||||
│ │ └── RoutePlanService.java
|
||||
│ └── wql
|
||||
│ └── QROUTE.wql
|
||||
├── socket
|
||||
│ ├── ClientUDWReceive.java
|
||||
│ ├── SocketConfig.java
|
||||
│ ├── SocketListenerAutoRun.java
|
||||
│ ├── SocketProperties.java
|
||||
│ └── SocketService.java
|
||||
├── task
|
||||
│ ├── enums
|
||||
│ │ ├── TaskCreateEnum.java
|
||||
│ │ ├── TaskErrorEnum.java
|
||||
│ │ ├── TaskFinishEnum.java
|
||||
│ │ ├── TaskStatusEnum.java
|
||||
│ │ └── TaskTypeEnum.java
|
||||
│ ├── rest
|
||||
│ │ ├── TaskController.java
|
||||
│ │ └── TaskFeedbackController.java
|
||||
│ └── service
|
||||
│ ├── dto
|
||||
│ │ ├── TaskDto.java
|
||||
│ │ └── TaskFeedbackDto.java
|
||||
│ ├── impl
|
||||
│ │ ├── TaskFeedbackServiceImpl.java
|
||||
│ │ └── TaskServiceImpl.java
|
||||
│ ├── TaskFeedbackService.java
|
||||
│ ├── TaskService.java
|
||||
│ └── wql
|
||||
│ └── QTASK_QUERY.wql
|
||||
├── test
|
||||
│ ├── rest
|
||||
│ │ └── TestController.java
|
||||
│ └── service
|
||||
│ ├── impl
|
||||
│ │ └── TestServiceImpl.java
|
||||
│ └── TestService.java
|
||||
├── udw
|
||||
│ ├── dto
|
||||
│ │ └── UdwDto.java
|
||||
│ ├── rest
|
||||
│ │ └── UdwManagerController.java
|
||||
│ ├── service
|
||||
│ │ ├── impl
|
||||
│ │ │ ├── UdwManagerServiceImpl.java
|
||||
│ │ │ ├── UnifiedDataAccessorImpl.java
|
||||
│ │ │ ├── UnifiedDataAppServiceImpl.java
|
||||
│ │ │ └── UnifiedDataUnit.java
|
||||
│ │ └── UdwManageService.java
|
||||
│ ├── UdwConfig.java
|
||||
│ ├── UnifiedData.java
|
||||
│ ├── UnifiedDataAccessor.java
|
||||
│ ├── UnifiedDataAccessorFactory.java
|
||||
│ └── UnifiedDataAppService.java
|
||||
└── util
|
||||
└── DateUtil.java
|
||||
|
||||
@@ -4,6 +4,9 @@ import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 线程父类:抽象类
|
||||
*/
|
||||
@Slf4j
|
||||
public abstract class AbstractAutoRunnable implements Runnable {
|
||||
private ThreadStatusEnum status;
|
||||
|
||||
@@ -4,15 +4,40 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface AutoRunService {
|
||||
/** 启动线程 */
|
||||
void startThread(String arg0);
|
||||
|
||||
/**
|
||||
* 停止线程
|
||||
* @param arg0
|
||||
*/
|
||||
void stopThread(String arg0);
|
||||
|
||||
/**
|
||||
* 获取线程
|
||||
* @param arg0:线程编码
|
||||
* @param arg1:线程ID
|
||||
* @return
|
||||
*/
|
||||
ThreadDto findByCode(String arg0, String arg1);
|
||||
|
||||
/**
|
||||
* 获取所有线程
|
||||
* @return
|
||||
*/
|
||||
List<ThreadDto> findAll();
|
||||
|
||||
/**
|
||||
* 根据条件获取线程
|
||||
* @param whereJson
|
||||
* @return
|
||||
*/
|
||||
List<ThreadDto> findByCondition(Map whereJson);
|
||||
|
||||
/**
|
||||
* 通过线程编码获取线程
|
||||
* @param code:线程key
|
||||
* @return
|
||||
*/
|
||||
Thread getThreadByCode(String code);
|
||||
}
|
||||
|
||||
@@ -15,11 +15,26 @@ import java.util.*;
|
||||
@Service
|
||||
@Slf4j
|
||||
public class AutoRunServiceImpl implements AutoRunService, ApplicationAutoInitial {
|
||||
/**
|
||||
* 获取所有继承次抽象类->AbstractAutoRunnable的bean对象
|
||||
*/
|
||||
@Autowired(required = false)
|
||||
private List<AbstractAutoRunnable> abstractAutoRunnableList;
|
||||
/**
|
||||
* 线程索引(类名)
|
||||
*/
|
||||
private List<String> autoRun_code_index = new ArrayList();
|
||||
/**
|
||||
* 存放线程
|
||||
*/
|
||||
private List<Thread> threads = new ArrayList();
|
||||
/**
|
||||
* 存放AbstractAutoRunnable的子类
|
||||
*/
|
||||
private List<AbstractAutoRunnable> thread_autoRun = new ArrayList();
|
||||
/**
|
||||
* 存储运行中线程下标(类名)
|
||||
*/
|
||||
private List<String> thread_code_index = new ArrayList();
|
||||
|
||||
@Override
|
||||
@@ -166,6 +181,7 @@ public class AutoRunServiceImpl implements AutoRunService, ApplicationAutoInitia
|
||||
|
||||
|
||||
private List<AbstractAutoRunnable> getAllAutoThread() {
|
||||
// 如果此bean存在就直接返回
|
||||
return ObjectUtil.isNotEmpty(abstractAutoRunnableList)
|
||||
? this.abstractAutoRunnableList
|
||||
: new LinkedList();
|
||||
@@ -173,6 +189,7 @@ public class AutoRunServiceImpl implements AutoRunService, ApplicationAutoInitia
|
||||
|
||||
@Override
|
||||
public void autoInitial() throws Exception {
|
||||
// 获取自动线程
|
||||
List<AbstractAutoRunnable> list = this.getAllAutoThread();
|
||||
Iterator it = list.iterator();
|
||||
|
||||
@@ -185,11 +202,13 @@ public class AutoRunServiceImpl implements AutoRunService, ApplicationAutoInitia
|
||||
a = "code 因为空而未加载";
|
||||
log.warn(a);
|
||||
t.setStopMessage(a);
|
||||
// todo: 编码为空,此时应该不能插入
|
||||
this.autoRun_code_index.add(t.getCode());
|
||||
} else if (this.autoRun_code_index.contains(t.getCode())) {
|
||||
a = String.format("code:%s 因为重复而未加载", new Object[]{t.getCode()});
|
||||
log.warn(a);
|
||||
t.setStopMessage(a);
|
||||
// todo: 既然已经包含,再次添加会构成重复
|
||||
this.autoRun_code_index.add(t.getCode());
|
||||
} else {
|
||||
t.setUsedStatus(ThreadUsedStatusEnum.used);
|
||||
|
||||
@@ -1597,6 +1597,7 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial
|
||||
|
||||
@Override
|
||||
public void reload() {
|
||||
// 将货位信息存到内存中
|
||||
this.storageCells = queryAllStorageCell();
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,9 @@ import org.nl.acs.opc.DeviceType;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备驱动定义
|
||||
*/
|
||||
public interface DeviceDriverDefination {
|
||||
String getDriverCode();
|
||||
|
||||
|
||||
@@ -323,7 +323,7 @@ public class DeviceAppServiceImpl implements DeviceAppService, ApplicationAutoIn
|
||||
this.code_indexs = new ArrayList();
|
||||
Collections.synchronizedList(this.code_indexs);
|
||||
int i = 0;
|
||||
|
||||
// 将设备与opc对应的数据装入内存变量之中
|
||||
for (int size = deviceManageDtos.size(); i < size; ++i) {
|
||||
DeviceManageDto deviceManage = (DeviceManageDto) deviceManageDtos.get(i);
|
||||
Device device = new Device();
|
||||
@@ -347,7 +347,7 @@ public class DeviceAppServiceImpl implements DeviceAppService, ApplicationAutoIn
|
||||
|
||||
@Override
|
||||
public void removeDevice(String deviceCode) {
|
||||
|
||||
// 移除内存变量的设备实体
|
||||
Iterator<Device> iterator = devices.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
Device device = iterator.next();
|
||||
@@ -355,6 +355,7 @@ public class DeviceAppServiceImpl implements DeviceAppService, ApplicationAutoIn
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
// 移除设备的内存key
|
||||
Iterator<String> iterator2 = code_indexs.iterator();
|
||||
while (iterator2.hasNext()) {
|
||||
String str = iterator2.next();
|
||||
|
||||
@@ -28,167 +28,169 @@ import java.util.Map;
|
||||
@Service
|
||||
public class OpcServerServiceImpl implements OpcServerService, ApplicationAutoInitial {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(OpcServerServiceImpl.class);
|
||||
@Autowired OpcServerManageService opcServerManageService;
|
||||
Map<String, OpcServerManageDto> opcServerManageDtos = new HashMap();
|
||||
Map<String, Server> servers = Collections.synchronizedMap(new HashMap());
|
||||
Map<String, Group> groups = Collections.synchronizedMap(new HashMap());
|
||||
private static final Logger log = LoggerFactory.getLogger(OpcServerServiceImpl.class);
|
||||
@Autowired
|
||||
OpcServerManageService opcServerManageService;
|
||||
Map<String, OpcServerManageDto> opcServerManageDtos = new HashMap();
|
||||
Map<String, Server> servers = Collections.synchronizedMap(new HashMap());
|
||||
Map<String, Group> groups = Collections.synchronizedMap(new HashMap());
|
||||
|
||||
public OpcServerServiceImpl() {}
|
||||
public OpcServerServiceImpl() {
|
||||
}
|
||||
|
||||
public void autoInitial() throws Exception {
|
||||
this.reload();
|
||||
if (OpcConfig.auto_start_opc) {
|
||||
Thread t =
|
||||
new Thread() {
|
||||
public void run() {
|
||||
Iterator var1 = OpcServerServiceImpl.this.opcServerManageDtos.values().iterator();
|
||||
public void autoInitial() throws Exception {
|
||||
this.reload();
|
||||
if (OpcConfig.auto_start_opc) {
|
||||
Thread t = new Thread(() -> {
|
||||
Iterator var1 = OpcServerServiceImpl.this.opcServerManageDtos.values().iterator();
|
||||
|
||||
while (var1.hasNext()) {
|
||||
OpcServerManageDto dto = (OpcServerManageDto) var1.next();
|
||||
while (var1.hasNext()) {
|
||||
OpcServerManageDto dto = (OpcServerManageDto) var1.next();
|
||||
|
||||
try {
|
||||
OpcServerServiceImpl.this.getServer(dto.getOpc_code());
|
||||
OpcServerServiceImpl.log.info("加载opc server {}", dto.getOpc_code());
|
||||
} catch (Exception var4) {
|
||||
OpcServerServiceImpl.log.warn("启动无法载入servers", var4);
|
||||
try {
|
||||
OpcServerServiceImpl.this.getServer(dto.getOpc_code());
|
||||
OpcServerServiceImpl.log.info("加载opc server {}", dto.getOpc_code());
|
||||
} catch (Exception var4) {
|
||||
OpcServerServiceImpl.log.warn("启动无法载入servers", var4);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
t.start();
|
||||
}
|
||||
}
|
||||
|
||||
public synchronized void reload() {
|
||||
this.opcServerManageDtos = this.opcServerManageService.queryAllServerMap();
|
||||
this.opcServerManageDtos = Collections.synchronizedMap(this.opcServerManageDtos);
|
||||
}
|
||||
|
||||
public void cleanGroups(String opcCode) {
|
||||
Group group = (Group)this.groups.get(opcCode);
|
||||
if (group != null) {
|
||||
Server server = group.getServer();
|
||||
|
||||
try {
|
||||
group.remove();
|
||||
} catch (JIException var5) {
|
||||
var5.printStackTrace();
|
||||
}
|
||||
|
||||
this.groups.remove(opcCode);
|
||||
server.disconnect();
|
||||
this.servers.remove(opcCode);
|
||||
});
|
||||
t.start();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
public synchronized void reload() {
|
||||
this.opcServerManageDtos = this.opcServerManageService.queryAllServerMap();
|
||||
this.opcServerManageDtos = Collections.synchronizedMap(this.opcServerManageDtos);
|
||||
}
|
||||
|
||||
public Group getServer(String code) throws Exception {
|
||||
synchronized(this.buildLock(code)) {
|
||||
Group group = null;
|
||||
group = (Group)this.groups.get(code);
|
||||
if (group != null) {
|
||||
label68: {
|
||||
Group var10000;
|
||||
try {
|
||||
if (!group.isActive()) {
|
||||
break label68;
|
||||
public void cleanGroups(String opcCode) {
|
||||
Group group = (Group) this.groups.get(opcCode);
|
||||
if (group != null) {
|
||||
Server server = group.getServer();
|
||||
|
||||
try {
|
||||
group.remove();
|
||||
} catch (JIException var5) {
|
||||
var5.printStackTrace();
|
||||
}
|
||||
|
||||
var10000 = group;
|
||||
} catch (JIException var14) {
|
||||
log.error(code, var14);
|
||||
break label68;
|
||||
}
|
||||
|
||||
return var10000;
|
||||
this.groups.remove(opcCode);
|
||||
server.disconnect();
|
||||
this.servers.remove(opcCode);
|
||||
}
|
||||
}
|
||||
|
||||
Server server = (Server)this.servers.get(code);
|
||||
boolean needcreate = false;
|
||||
String groupName = code;
|
||||
if (server == null) {
|
||||
needcreate = true;
|
||||
} else {
|
||||
try {
|
||||
group = server.findGroup(groupName);
|
||||
} catch (UnknownHostException | JIException | UnknownGroupException | NotConnectedException | IllegalArgumentException var13) {
|
||||
log.error(code, var13);
|
||||
needcreate = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (needcreate) {
|
||||
OpcServerManageDto dto = (OpcServerManageDto)this.opcServerManageDtos.get(code);
|
||||
if (dto == null) {
|
||||
throw new RuntimeException(code+"不存在");
|
||||
}
|
||||
public Group getServer(String code) throws Exception {
|
||||
synchronized (this.buildLock(code)) {
|
||||
Group group = null;
|
||||
group = (Group) this.groups.get(code);
|
||||
if (group != null) {
|
||||
label68:
|
||||
{
|
||||
Group var10000;
|
||||
try {
|
||||
if (!group.isActive()) {
|
||||
break label68;
|
||||
}
|
||||
|
||||
var10000 = group;
|
||||
} catch (JIException var14) {
|
||||
log.error(code, var14);
|
||||
break label68;
|
||||
}
|
||||
|
||||
return var10000;
|
||||
}
|
||||
}
|
||||
|
||||
Server server = (Server) this.servers.get(code);
|
||||
boolean needcreate = false;
|
||||
String groupName = code;
|
||||
if (server == null) {
|
||||
needcreate = true;
|
||||
} else {
|
||||
try {
|
||||
group = server.findGroup(groupName);
|
||||
} catch (UnknownHostException | JIException | UnknownGroupException | NotConnectedException |
|
||||
IllegalArgumentException var13) {
|
||||
log.error(code, var13);
|
||||
needcreate = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (needcreate) {
|
||||
OpcServerManageDto dto = (OpcServerManageDto) this.opcServerManageDtos.get(code);
|
||||
if (dto == null) {
|
||||
throw new RuntimeException(code + "不存在");
|
||||
}
|
||||
|
||||
// if (server!=null){
|
||||
// server.disconnect();
|
||||
// server=null;
|
||||
// }
|
||||
|
||||
if (server == null) {
|
||||
server = OpcServerUtl.getServerWithOutException(dto.getOpc_host(), StrUtil.trim(dto.getCls_id()), dto.getUser(), dto.getPassword(), StrUtil.trim(dto.getDomain())); }
|
||||
if (server == null) {
|
||||
server = OpcServerUtl.getServerWithOutException(dto.getOpc_host(), StrUtil.trim(dto.getCls_id()), dto.getUser(), dto.getPassword(), StrUtil.trim(dto.getDomain()));
|
||||
}
|
||||
|
||||
try {
|
||||
group = server.addGroup(groupName);
|
||||
} catch (Exception var12) {
|
||||
this.clearServer(code);
|
||||
ThreadUtl.sleep(5000L);
|
||||
log.warn("获取opc出错重新获取", code, var12);
|
||||
server = OpcServerUtl.getServerWithOutException(dto.getOpc_host(), StrUtil.trim(dto.getCls_id()), dto.getUser(), dto.getPassword(), StrUtil.trim(dto.getDomain()));
|
||||
try {
|
||||
group = server.addGroup(groupName);
|
||||
} catch (Exception var11) {
|
||||
throw new RuntimeException(var12);
|
||||
}
|
||||
try {
|
||||
group = server.addGroup(groupName);
|
||||
} catch (Exception var12) {
|
||||
this.clearServer(code);
|
||||
ThreadUtl.sleep(5000L);
|
||||
log.warn("获取opc出错重新获取", code, var12);
|
||||
server = OpcServerUtl.getServerWithOutException(dto.getOpc_host(), StrUtil.trim(dto.getCls_id()), dto.getUser(), dto.getPassword(), StrUtil.trim(dto.getDomain()));
|
||||
try {
|
||||
group = server.addGroup(groupName);
|
||||
} catch (Exception var11) {
|
||||
throw new RuntimeException(var12);
|
||||
}
|
||||
}
|
||||
|
||||
this.servers.put(code, server);
|
||||
this.groups.put(code, group);
|
||||
}
|
||||
|
||||
return group;
|
||||
}
|
||||
|
||||
this.servers.put(code, server);
|
||||
this.groups.put(code, group);
|
||||
}
|
||||
|
||||
return group;
|
||||
}
|
||||
}
|
||||
|
||||
public void clearServer(String code) {
|
||||
synchronized(this.buildLock(code)) {
|
||||
try {
|
||||
Server server = (Server)this.servers.get(code);
|
||||
server.disconnect();
|
||||
} catch (Exception var5) {
|
||||
}
|
||||
public void clearServer(String code) {
|
||||
synchronized (this.buildLock(code)) {
|
||||
try {
|
||||
Server server = (Server) this.servers.get(code);
|
||||
server.disconnect();
|
||||
} catch (Exception var5) {
|
||||
}
|
||||
|
||||
this.servers.remove(code);
|
||||
this.groups.remove(code);
|
||||
this.servers.remove(code);
|
||||
this.groups.remove(code);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void writeInteger(String code, ItemValue... values) {
|
||||
try {
|
||||
Group group = this.getServer(code);
|
||||
OpcUtl.writeValue(group, values);
|
||||
} catch (Exception var4) {
|
||||
this.clearServer(code);
|
||||
log.warn("写入出错opc server {} 重新加载", code, var4);
|
||||
ThreadUtl.sleep(5000L);
|
||||
public void writeInteger(String code, ItemValue... values) {
|
||||
try {
|
||||
Group group = this.getServer(code);
|
||||
OpcUtl.writeValue(group, values);
|
||||
} catch (Exception var4) {
|
||||
this.clearServer(code);
|
||||
log.warn("写入出错opc server {} 重新加载", code, var4);
|
||||
ThreadUtl.sleep(5000L);
|
||||
// throw var4;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private String buildLock(String key) {
|
||||
if (StrUtil.isEmpty(key)) {
|
||||
key = "";
|
||||
private String buildLock(String key) {
|
||||
if (StrUtil.isEmpty(key)) {
|
||||
key = "";
|
||||
}
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.append("OpcServerService.");
|
||||
builder.append(key);
|
||||
String lock = builder.toString().intern();
|
||||
return lock;
|
||||
}
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.append("OpcServerService.");
|
||||
builder.append(key);
|
||||
String lock = builder.toString().intern();
|
||||
return lock;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,4 +78,7 @@ public class MdBaseBrickInfo implements Serializable {
|
||||
@ApiModelProperty(value = "是否组盘")
|
||||
private Boolean is_group;
|
||||
|
||||
@ApiModelProperty(value = "工单号")
|
||||
private String workorder_code;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package org.nl.wms.database.brick.service.impl;
|
||||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
@@ -12,6 +13,8 @@ import org.nl.wms.database.brick.service.IMdBaseBrickInfoService;
|
||||
import org.nl.wms.database.brick.service.dao.MdBaseBrickInfo;
|
||||
import org.nl.wms.database.brick.service.dao.mapper.MdBaseBrickInfoMapper;
|
||||
import org.nl.wms.ext.acs.service.dto.BrickInfoDto;
|
||||
import org.nl.wms.pdm.workorder.service.IPdmBdWorkorderService;
|
||||
import org.nl.wms.pdm.workorder.service.dao.PdmBdWorkorder;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -19,19 +22,21 @@ import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @description 服务实现
|
||||
* @author lyd
|
||||
* @date 2023-07-19
|
||||
**/
|
||||
* @author lyd
|
||||
* @description 服务实现
|
||||
* @date 2023-07-19
|
||||
**/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class MdBaseBrickInfoServiceImpl extends ServiceImpl<MdBaseBrickInfoMapper, MdBaseBrickInfo> implements IMdBaseBrickInfoService {
|
||||
|
||||
@Autowired
|
||||
private MdBaseBrickInfoMapper mdBaseBrickInfoMapper;
|
||||
@Autowired
|
||||
private IPdmBdWorkorderService workorderService;
|
||||
|
||||
@Override
|
||||
public IPage<MdBaseBrickInfo> queryAll(Map whereJson, PageQuery page){
|
||||
public IPage<MdBaseBrickInfo> queryAll(Map whereJson, PageQuery page) {
|
||||
LambdaQueryWrapper<MdBaseBrickInfo> lam = new LambdaQueryWrapper<>();
|
||||
IPage<MdBaseBrickInfo> pages = new Page<>(page.getPage() + 1, page.getSize());
|
||||
mdBaseBrickInfoMapper.selectPage(pages, lam);
|
||||
@@ -74,8 +79,11 @@ public class MdBaseBrickInfoServiceImpl extends ServiceImpl<MdBaseBrickInfoMappe
|
||||
}
|
||||
|
||||
private MdBaseBrickInfo toBrickInfoMapper(BrickInfoDto dto) {
|
||||
// 获取压机工单
|
||||
PdmBdWorkorder productionTask = workorderService.getDeviceProductionTask(dto.getGet_station());
|
||||
MdBaseBrickInfo brickInfo = new MdBaseBrickInfo();
|
||||
brickInfo.setBrick_id(IdUtil.getSnowflake(1,1).nextIdStr());
|
||||
brickInfo.setWorkorder_code(ObjectUtil.isNotEmpty(productionTask) ? productionTask.getWorkorder_code() : null);
|
||||
brickInfo.setBrick_id(IdUtil.getSnowflake(1, 1).nextIdStr());
|
||||
brickInfo.setGet_station(dto.getGet_station());
|
||||
brickInfo.setPut_station(dto.getPut_station());
|
||||
brickInfo.setIs_qualified(dto.getIs_qualified().equals("1"));
|
||||
|
||||
@@ -492,11 +492,12 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
if (bdWorkorder == null) {
|
||||
return BaseResponse.responseError(requestNo, "未找到工单号[" + workorderCode + "]的记录!");
|
||||
}
|
||||
// todo: 统计当前设备的不合格位置的数量作为不合格数,并标记是否组盘为true
|
||||
bdWorkorder.setWorkorder_status(WorkOrderStatusEnum.COMPLETE.getCode());
|
||||
bdWorkorder.setRealproduceend_date(DateUtil.now());
|
||||
TaskUtils.setWorkOrderUpdateByAcs(bdWorkorder);
|
||||
workorderService.updateById(bdWorkorder);
|
||||
// todo: 统计当前设备的不合格位置的数量作为不合格数,并上报给mes
|
||||
wmsToMesService.reportPressUnusedMaterial(bdWorkorder);
|
||||
return BaseResponse.responseOk(requestNo);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
package org.nl.wms.ext.mes.autotask;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.system.service.notice.ISysNoticeService;
|
||||
import org.nl.wms.ext.mes.service.WmsToMesService;
|
||||
import org.nl.wms.ext.mes.service.dao.mapper.MesRequestMapper;
|
||||
import org.nl.wms.ext.mes.service.dto.MesGdyInfoDto;
|
||||
import org.nl.wms.sch.task_manage.GeneralDefinition;
|
||||
import org.nl.wms.sch.task_manage.enums.NoticeTypeEnum;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.core.annotation.Order;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: 定时插入窑内的数据到mes数据库
|
||||
* @Date: 2023/9/19
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
@Order(value = 1)
|
||||
public class AutoSaveGdyInfo {
|
||||
@Autowired
|
||||
private WmsToMesService wmsToMesService;
|
||||
@Autowired
|
||||
private MesRequestMapper mesRequestMapper;
|
||||
@Autowired
|
||||
private ISysNoticeService noticeService;
|
||||
@SneakyThrows
|
||||
public void run() {
|
||||
// 获取当前窑内信息
|
||||
List<MesGdyInfoDto> list = wmsToMesService.getAllMesGdyInfos();
|
||||
AtomicInteger successNum = new AtomicInteger();
|
||||
long startTime = System.currentTimeMillis();
|
||||
// 插入数据
|
||||
list.forEach(mesGdyInfoDto -> {
|
||||
mesGdyInfoDto.setMSGID(IdUtil.getSnowflake(1,1).nextIdStr());
|
||||
mesGdyInfoDto.setSEND_TM(DateUtil.now());
|
||||
mesGdyInfoDto.setPRO_SUBUNIT("块");
|
||||
mesGdyInfoDto.setDEVICE("1");
|
||||
mesGdyInfoDto.setCREATE_TM(DateUtil.now());
|
||||
mesGdyInfoDto.setOP_FLAG(GeneralDefinition.NO);
|
||||
try {
|
||||
mesRequestMapper.insertGdyMaterial(mesGdyInfoDto);
|
||||
successNum.incrementAndGet();
|
||||
} catch (Exception e) {
|
||||
log.error("插入窑内失败的数据: {}", mesGdyInfoDto);
|
||||
log.error("插入窑内失败的信息:{}", e.getMessage());
|
||||
// notice通知
|
||||
noticeService.createNotice(e.getMessage(), "窑内数据同步失败" + mesGdyInfoDto.getMSGID(), NoticeTypeEnum.NOTIFICATION.getCode());
|
||||
}
|
||||
});
|
||||
long endTime = System.currentTimeMillis();
|
||||
log.info("干燥窑数据有" + list.size() + "条,成功" + successNum.get() + "条, 消耗时长:" + (endTime - startTime) + "ms");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package org.nl.wms.ext.mes.autotask;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.system.service.notice.ISysNoticeService;
|
||||
import org.nl.wms.ext.mes.service.WmsToMesService;
|
||||
import org.nl.wms.ext.mes.service.dto.MesSemiProductionInfo;
|
||||
import org.nl.wms.sch.task_manage.GeneralDefinition;
|
||||
import org.nl.wms.sch.task_manage.enums.NoticeTypeEnum;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.core.annotation.Order;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: 定时插入滚筒线内的数据到mes数据库
|
||||
* @Date: 2023/9/19
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
@Order(value = 1)
|
||||
public class AutoSaveProductionInfo {
|
||||
@Autowired
|
||||
private WmsToMesService wmsToMesService;
|
||||
@Autowired
|
||||
private ISysNoticeService noticeService;
|
||||
@SneakyThrows
|
||||
public void run() {
|
||||
// 1、获取所有滚筒线内数据
|
||||
List<MesSemiProductionInfo> list = wmsToMesService.getAllMesSemiProductionInfos();
|
||||
AtomicInteger successNum = new AtomicInteger();
|
||||
long startTime = System.currentTimeMillis();
|
||||
// 2、设置唯一标识
|
||||
list.forEach(mi -> {
|
||||
mi.setMSGID(IdUtil.getSnowflake(1,1).nextIdStr());
|
||||
mi.setSEND_TM(DateUtil.now());
|
||||
mi.setSTOCK_UNIT("块");
|
||||
mi.setCREATE_TM(DateUtil.now());
|
||||
mi.setOP_FLAG(GeneralDefinition.NO);
|
||||
// 3、批量插入MES数据库
|
||||
try {
|
||||
wmsToMesService.saveSemiProductionBatchToMes(mi);
|
||||
successNum.getAndIncrement();
|
||||
} catch (Exception e) {
|
||||
log.error("插入滚筒线内失败的数据: {}", mi);
|
||||
log.error("插入滚筒线内失败的信息:{}", e.getMessage());
|
||||
// notice通知
|
||||
noticeService.createNotice(e.getMessage(), "滚筒线内数据同步失败" + mi.getMSGID(), NoticeTypeEnum.NOTIFICATION.getCode());
|
||||
}
|
||||
});
|
||||
long endTime = System.currentTimeMillis();
|
||||
log.info("滚筒线数据有" + list.size() + "条,成功" + successNum.get() + "条, 消耗时长:" + (endTime - startTime) + "ms");
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,11 @@
|
||||
package org.nl.wms.ext.mes.service;
|
||||
|
||||
import org.nl.wms.ext.mes.service.dto.MesGdyInfoDto;
|
||||
import org.nl.wms.ext.mes.service.dto.MesMudConsumptionDto;
|
||||
import org.nl.wms.ext.mes.service.dto.MesSemiProductionInfo;
|
||||
import org.nl.wms.pdm.workorder.service.dao.PdmBdWorkorder;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
@@ -50,4 +55,16 @@ public interface WmsToMesService {
|
||||
* @param groupId
|
||||
*/
|
||||
void reportGdyMaterialInfoOut(String groupId);
|
||||
|
||||
List<MesSemiProductionInfo> getAllMesSemiProductionInfos();
|
||||
|
||||
void saveSemiProductionBatchToMes(MesSemiProductionInfo obj);
|
||||
|
||||
List<MesGdyInfoDto> getAllMesGdyInfos();
|
||||
|
||||
/**
|
||||
* 上报压机判废信息
|
||||
* @param workorderCode
|
||||
*/
|
||||
void reportPressUnusedMaterial(PdmBdWorkorder workorderCode);
|
||||
}
|
||||
|
||||
@@ -36,4 +36,16 @@ public interface MesRequestMapper {
|
||||
void insertGdyMaterialIn(MesGdyMaterialInDto gdyMaterialInDto);
|
||||
@DS("oracle")
|
||||
void insertGdyMaterialOut(MesGdyMaterialOutDto gdyMaterialOutDto);
|
||||
@DS("mysql")
|
||||
List<MesSemiProductionInfo> getAllMesSemiProductionInfos();
|
||||
@DS("oracle")
|
||||
void saveSemiProductionBatchToMes(MesSemiProductionInfo obj);
|
||||
@DS("mysql")
|
||||
List<MesGdyInfoDto> getAllMesGdyInfos();
|
||||
@DS("oracle")
|
||||
void insertGdyMaterial(MesGdyInfoDto mesGdyInfoDto);
|
||||
@DS("mysql")
|
||||
int countFPNumber(String workorderCode, String pointCode);
|
||||
@DS("oracle")
|
||||
void insertMesUnusedInfo(MesUnusedDto mesUnusedDto);
|
||||
}
|
||||
|
||||
@@ -15,9 +15,9 @@
|
||||
</insert>
|
||||
<insert id="insertSemiProductInfo" parameterType="org.nl.wms.ext.mes.service.dto.MesSemiProductionInfoInDto">
|
||||
INSERT INTO "LMSTELCOM"."RECEIVE_CS_SEMIPROINFO_IN"(MSGID, FORDER_NO, PRESSUNIT, FSCHEDULE_ID, FPRODUCT_MATERIAL_ID
|
||||
, FPRODUCT_MATERIAL_NAME, FMATSPEC, FMATMODEL, BATCHNO, PRESSUNIT, FTEAM, TRAY_NO, PRO_SUBNUM, PRO_SUBUNIT
|
||||
, FPRODUCT_MATERIAL_NAME, FMATSPEC, FMATMODEL, BATCHNO, FTEAM, TRAY_NO, PRO_SUBNUM, PRO_SUBUNIT
|
||||
, CHECKERIN_TIM, PRODATE, CREATE_TM, OP_FLAG) VALUES (#{MSGID}, #{FORDER_NO}, #{PRESSUNIT}, #{FSCHEDULE_ID}, #{FPRODUCT_MATERIAL_ID}
|
||||
, #{FPRODUCT_MATERIAL_NAME}, #{FMATSPEC}, #{FMATMODEL}, #{BATCHNO}, #{PRESSUNIT}, #{FTEAM}, #{TRAY_NO}, #{PRO_SUBNUM}
|
||||
, #{FPRODUCT_MATERIAL_NAME}, #{FMATSPEC}, #{FMATMODEL}, #{BATCHNO}, #{FTEAM}, #{TRAY_NO}, #{PRO_SUBNUM}
|
||||
, #{PRO_SUBUNIT}, #{CHECKERIN_TIM}, #{PRODATE}, #{CREATE_TM}, #{OP_FLAG})
|
||||
</insert>
|
||||
<insert id="insertSemiProductOutInfo" parameterType="org.nl.wms.ext.mes.service.dto.MesSemiProductionInfoOutDto">
|
||||
@@ -41,6 +41,29 @@
|
||||
, #{FMATSPEC}, #{FMATMODE}, #{BATCHNO}, #{PRESSUNIT}, #{PRO_SUBNUM}, #{PRO_SUBUNIT}, #{FCONVERTRATE}
|
||||
, #{STOCK}, #{DEVICE}, #{OUT_DATE}, #{CREATE_TM}, #{OP_FLAG})
|
||||
</insert>
|
||||
<insert id="saveSemiProductionBatchToMes" parameterType="org.nl.wms.ext.mes.service.dto.MesSemiProductionInfo">
|
||||
INSERT INTO "LMSTELCOM"."RECEIVE_CS_SEMIPRODUCTIONINFO"(MSGID, SEND_TM, BATCHNO, ORDER_NO, STOCK_NUM
|
||||
, STOCK_UNIT, MATERIAL_ID, MATERIAL_NAME, PROSPEC, PROMODEL, PRODATE, PRESSUNIT, CREATE_TM, OP_FLAG)
|
||||
VALUES
|
||||
(#{MSGID}, #{SEND_TM}, #{BATCHNO}, #{ORDER_NO}, #{STOCK_NUM}
|
||||
, #{STOCK_UNIT}, #{MATERIAL_ID}, #{MATERIAL_NAME}, #{PROSPEC}, #{PROMODEL}
|
||||
, #{PRODATE}, #{PRESSUNIT}, #{CREATE_TM}, #{OP_FLAG})
|
||||
</insert>
|
||||
<insert id="insertGdyMaterial" parameterType="org.nl.wms.ext.mes.service.dto.MesGdyInfoDto">
|
||||
INSERT INTO "LMSTELCOM"."RECEIVE_GDY_MAT"(MSGID, SEND_TM, TRAY_NO, FPRODUCT_MATERIAL_ID, FPRODUCT_MATERIAL_NAME
|
||||
, FMATSPEC, FMATMODEL, BATCHNO, PRESSUNIT, PRO_SUBNUM, PRO_SUBUNIT, DEVICE, DEVICEUNITPOST, IN_DATE, CREATE_TM
|
||||
, OP_FLAG)
|
||||
VALUES (#{MSGID}, #{SEND_TM}, #{TRAY_NO}, #{FPRODUCT_MATERIAL_ID}, #{FPRODUCT_MATERIAL_NAME}
|
||||
, #{FMATSPEC}, #{FMATMODEL}, #{BATCHNO}, #{PRESSUNIT}, #{PRO_SUBNUM}, #{PRO_SUBUNIT}, #{DEVICE}, #{DEVICEUNITPOST}
|
||||
, #{IN_DATE}, #{CREATE_TM}, #{OP_FLAG})
|
||||
</insert>
|
||||
<insert id="insertMesUnusedInfo" parameterType="org.nl.wms.ext.mes.service.dto.MesUnusedDto">
|
||||
INSERT INTO "LMSTELCOM"."RECEIVE_R_SEMIPRODUCT_JKPF"(MSGID, FORDER_NO, PWORKSCHE_ID, FPRODUCT_MATERIAL_ID
|
||||
, FPRODUCT_MATERIAL_NAME, FMATSPEC, FMATMODEL, BATCHNO, PRESSUNIT, FTEAM, FPSUBNUM, FP_SUBUNIT, PRODATE
|
||||
, CREATE_TM, OP_FLAG)
|
||||
VALUES (#{MSGID}, #{FORDER_NO}, #{PWORKSCHE_ID}, #{FPRODUCT_MATERIAL_ID}, #{FPRODUCT_MATERIAL_NAME}, #{FMATSPEC}
|
||||
, #{FMATMODEL}, #{BATCHNO}, #{PRESSUNIT}, #{FTEAM}, #{FPSUBNUM}, #{FP_SUBUNIT}, #{PRODATE}, #{CREATE_TM}, #{OP_FLAG})
|
||||
</insert>
|
||||
<update id="updateWorkOrderRead" parameterType="java.util.List">
|
||||
UPDATE "LMSTELCOM"."SEND_POP_SCHEDULE_PRESS"
|
||||
SET OP_FLAG = '1'
|
||||
@@ -105,4 +128,53 @@
|
||||
"LMSTELCOM"."SEND_POP_SCHEDULE_PRESS"
|
||||
WHERE OP_FLAG = '0'
|
||||
</select>
|
||||
<select id="getAllMesSemiProductionInfos" resultType="org.nl.wms.ext.mes.service.dto.MesSemiProductionInfo">
|
||||
SELECT
|
||||
pw.batch_no AS BATCHNO,
|
||||
pw.produce_order AS ORDER_NO,
|
||||
pw.produce_date AS PRODATE,
|
||||
vg.material_qty AS STOCK_NUM,
|
||||
mm.material_code AS MATERIAL_ID,
|
||||
mm.material_name AS MATERIAL_NAME,
|
||||
mm.material_spec AS PROSPEC,
|
||||
mm.material_model AS PROMODEL,
|
||||
p2.ext_point_code AS PRESSUNIT
|
||||
FROM
|
||||
`sch_base_vehiclematerialgroup` vg
|
||||
LEFT JOIN pdm_bd_workorder pw ON pw.workorder_code = vg.workorder_code
|
||||
LEFT JOIN md_base_material mm ON mm.material_id = vg.material_id
|
||||
LEFT JOIN sch_base_point p ON p.point_code = vg.source_vehicle_code
|
||||
LEFT JOIN sch_base_point p2 ON p.parent_point_code = p2.point_code
|
||||
WHERE
|
||||
vg.point_code IN ('HCSSX01','HCSSX63') AND pw.workorder_code IS NOT NULL
|
||||
</select>
|
||||
<select id="getAllMesGdyInfos" resultType="org.nl.wms.ext.mes.service.dto.MesGdyInfoDto">
|
||||
SELECT
|
||||
ROW_NUMBER() OVER (ORDER BY vg.into_kiln_time DESC) AS DEVICEUNITPOST,
|
||||
vg.into_kiln_time AS IN_DATE,
|
||||
vg.vehicle_code AS TRAY_NO,
|
||||
m.material_id AS FPRODUCT_MATERIAL_ID,
|
||||
m.material_name AS FPRODUCT_MATERIAL_NAME,
|
||||
m.material_spec AS FMATSPEC,
|
||||
m.material_model AS FMATMODEL,
|
||||
pw.batch_no AS BATCHNO,
|
||||
p2.ext_point_code AS PRESSUNIT,
|
||||
vg.material_qty AS PRO_SUBNUM
|
||||
FROM
|
||||
`sch_base_vehiclematerialgroup` vg
|
||||
LEFT JOIN md_base_material m ON m.material_id = vg.material_id
|
||||
LEFT JOIN pdm_bd_workorder pw ON pw.workorder_code = vg.workorder_code
|
||||
LEFT JOIN sch_base_point p ON p.point_code = vg.source_vehicle_code
|
||||
LEFT JOIN sch_base_point p2 ON p.parent_point_code = p2.point_code
|
||||
WHERE
|
||||
vg.into_kiln_time IS NOT NULL
|
||||
AND vg.out_kiln_time IS NULL
|
||||
</select>
|
||||
<select id="countFPNumber" resultType="java.lang.Integer">
|
||||
SELECT
|
||||
COUNT(*) AS number
|
||||
FROM
|
||||
`md_base_brick_info` mi
|
||||
WHERE mi.workorder_code = #{workorderCode} AND mi.get_station = #{pointCode} AND mi.put_station LIKE 'YZBHGW%'
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
package org.nl.wms.ext.mes.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: 窑内信息
|
||||
* @Date: 2023/9/19
|
||||
*/
|
||||
@Data
|
||||
public class MesGdyInfoDto {
|
||||
private String MSGID;
|
||||
private String SEND_TM;
|
||||
private String TRAY_NO;
|
||||
private String FPRODUCT_MATERIAL_ID;
|
||||
private String FPRODUCT_MATERIAL_NAME;
|
||||
private String FMATSPEC;
|
||||
private String FMATMODEL;
|
||||
private String BATCHNO;
|
||||
private String PRESSUNIT;
|
||||
private String PRO_NUM;
|
||||
private String PRO_UNIT;
|
||||
private String PRO_SUBNUM;
|
||||
private String PRO_SUBUNIT;
|
||||
private String FCONVERTRATE;
|
||||
private String STOCK;
|
||||
private String DEVICE;
|
||||
private String DEVICEUNITPOST;
|
||||
private String IN_DATE;
|
||||
private String PREOUT_DATE;
|
||||
private String CREATE_TM;
|
||||
private String OP_FLAG;
|
||||
private String OP_TM;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package org.nl.wms.ext.mes.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: 滚筒线内
|
||||
* @Date: 2023/9/19
|
||||
*/
|
||||
@Data
|
||||
public class MesSemiProductionInfo {
|
||||
private String MSGID;
|
||||
private String SEND_TM;
|
||||
private String BATCHNO;
|
||||
private String ORDER_NO;
|
||||
private String STOCK_NUM;
|
||||
private String STOCK_UNIT;
|
||||
private String STOCK_SUBNUM;
|
||||
private String STOCK_SUBUNIT;
|
||||
private String MATERIAL_ID;
|
||||
private String MATERIAL_NAME;
|
||||
private String PROSPEC;
|
||||
private String PROMODEL;
|
||||
private String PRODATE;
|
||||
private String STOCK;
|
||||
private String STOCK_NAME;
|
||||
private String PRESSUNIT;
|
||||
private String CREATE_TM;
|
||||
private String OP_FLAG;
|
||||
private String OP_TM;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package org.nl.wms.ext.mes.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: 机口判废
|
||||
* @Date: 2023/9/20
|
||||
* 唯一标识
|
||||
* 订单号
|
||||
* 压机计划号
|
||||
* 日计划号
|
||||
* 物料编码
|
||||
* 物料名称
|
||||
* 规格
|
||||
* 型号
|
||||
* 批次号
|
||||
* 压机号
|
||||
* 班组
|
||||
* 废品重量
|
||||
* 重量单位
|
||||
* 废品数量
|
||||
* 数量单位
|
||||
* 判废人
|
||||
* 判废日期
|
||||
* 生产日期
|
||||
* 写入时间
|
||||
* 读取标志,0未读取,1已读取
|
||||
* 读取时间
|
||||
*/
|
||||
@Data
|
||||
public class MesUnusedDto {
|
||||
private String MSGID;
|
||||
private String FORDER_NO;
|
||||
private String PWORKSCHE_ID;
|
||||
private String FSCHEDULE_ID;
|
||||
private String FPRODUCT_MATERIAL_ID;
|
||||
private String FPRODUCT_MATERIAL_NAME;
|
||||
private String FMATSPEC;
|
||||
private String FMATMODEL;
|
||||
private String BATCHNO;
|
||||
private String PRESSUNIT;
|
||||
private String FTEAM;
|
||||
private String FP_NUM;
|
||||
private String FP_UNIT;
|
||||
private String FPSUBNUM;
|
||||
private String FP_SUBUNIT;
|
||||
private String CHECKERIN;
|
||||
private String CHECKERIN_TIM;
|
||||
private String PRODATE;
|
||||
private String CREATE_TM;
|
||||
private String OP_FLAG;
|
||||
private String OP_TM;
|
||||
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package org.nl.wms.ext.mes.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
@@ -129,7 +130,7 @@ public class WmsToMesServiceImpl implements WmsToMesService {
|
||||
mesProductDataDto.setPRO_SUBNUM(BigDecimal.valueOf(vehiclematerialgroup.getMaterial_qty()));// 数量
|
||||
mesProductDataDto.setPRO_SUBUNIT("块");
|
||||
mesProductDataDto.setCHECKERIN_TIM(DateUtil.now());
|
||||
mesProductDataDto.setPRODATE(workorder.getProduce_date());
|
||||
mesProductDataDto.setPRODATE(ObjectUtil.isNotEmpty(workorder.getProduce_date())?workorder.getProduce_date():DateUtil.now());
|
||||
mesProductDataDto.setCREATE_TM(DateUtil.now());
|
||||
mesProductDataDto.setOP_FLAG(GeneralDefinition.NO);
|
||||
log.info("压机产出返给MES的数据:{}", mesProductDataDto);
|
||||
@@ -305,6 +306,54 @@ public class WmsToMesServiceImpl implements WmsToMesService {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MesSemiProductionInfo> getAllMesSemiProductionInfos() {
|
||||
return mesRequestMapper.getAllMesSemiProductionInfos();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveSemiProductionBatchToMes(MesSemiProductionInfo obj) {
|
||||
mesRequestMapper.saveSemiProductionBatchToMes(obj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MesGdyInfoDto> getAllMesGdyInfos() {
|
||||
return mesRequestMapper.getAllMesGdyInfos();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reportPressUnusedMaterial(PdmBdWorkorder orderObj) {
|
||||
// 获取统计数量
|
||||
int number = mesRequestMapper.countFPNumber(orderObj.getWorkorder_code(), orderObj.getPoint_code());
|
||||
MdBaseMaterial material = mdBaseMaterialService.getById(orderObj.getMaterial_id());
|
||||
SchBasePoint basePoint = pointService.getById(orderObj.getPoint_code());
|
||||
log.info("统计到设备:{} 不合格砖数:{}", orderObj.getPoint_name(), number);
|
||||
// 设置字段值
|
||||
MesUnusedDto mesUnusedDto = new MesUnusedDto();
|
||||
mesUnusedDto.setMSGID(IdUtil.getSnowflake(1,1).nextIdStr());
|
||||
mesUnusedDto.setFORDER_NO(orderObj.getProduction_order());
|
||||
mesUnusedDto.setPWORKSCHE_ID(orderObj.getWorkshop_code());
|
||||
mesUnusedDto.setFPRODUCT_MATERIAL_ID(orderObj.getMaterial_code());
|
||||
mesUnusedDto.setFPRODUCT_MATERIAL_NAME(orderObj.getMaterial_name());
|
||||
mesUnusedDto.setFMATSPEC(material.getMaterial_spec());
|
||||
mesUnusedDto.setFMATMODEL(material.getMaterial_model());
|
||||
mesUnusedDto.setBATCHNO(orderObj.getBatch_no());
|
||||
mesUnusedDto.setPRESSUNIT(basePoint.getExt_point_code());
|
||||
mesUnusedDto.setFTEAM(orderObj.getTeam());
|
||||
mesUnusedDto.setFPSUBNUM(String.valueOf(number));
|
||||
mesUnusedDto.setFP_SUBUNIT("块");
|
||||
mesUnusedDto.setPRODATE(orderObj.getProduce_date());
|
||||
mesUnusedDto.setCREATE_TM(DateUtil.now());
|
||||
mesUnusedDto.setOP_FLAG(GeneralDefinition.NO);
|
||||
log.info("插入mes机口判废数据库的数据:{}", mesUnusedDto);
|
||||
// 存入mes数据库
|
||||
try {
|
||||
mesRequestMapper.insertMesUnusedInfo(mesUnusedDto);
|
||||
} catch (Exception e) {
|
||||
log.error("插入机口判废失败:{}", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public List<PdmBdWorkorder> toWorkOrderList(List<MesWorkOrderDto> mesWorkOrderInfos) {
|
||||
List<PdmBdWorkorder> list = new CopyOnWriteArrayList<>();
|
||||
mesWorkOrderInfos.forEach(mesWorkOrderDto -> {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.nl.wms.pda.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -9,6 +10,10 @@ import org.nl.wms.das.device.check.service.dao.DasDeviceCheckRecord;
|
||||
import org.nl.wms.das.device.operation.service.IDasDeviceOperationRecordService;
|
||||
import org.nl.wms.das.device.operation.service.dao.DasDeviceOperationRecord;
|
||||
import org.nl.wms.pda.service.PdaService;
|
||||
import org.nl.wms.pda.service.dao.dto.ManualGroupDto;
|
||||
import org.nl.wms.pda.service.dao.vo.PdaResponseVo;
|
||||
import org.nl.wms.pdm.workorder.service.IPdmBdWorkorderService;
|
||||
import org.nl.wms.sch.group.service.ISchBaseVehiclematerialgroupService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
@@ -34,6 +39,10 @@ public class PdaController {
|
||||
private IDasDeviceOperationRecordService deviceOperationRecordService;
|
||||
@Autowired
|
||||
private PdaService pdaService;
|
||||
@Autowired
|
||||
private ISchBaseVehiclematerialgroupService vehiclematerialgroupService;
|
||||
@Autowired
|
||||
private IPdmBdWorkorderService workorderService;
|
||||
@PostMapping("/deviceCheck/verify")
|
||||
@Log("设备点检")
|
||||
@ApiOperation("设备点检")
|
||||
@@ -68,4 +77,25 @@ public class PdaController {
|
||||
public ResponseEntity<Object> deviceSwitchover(@Validated @RequestBody DasDeviceOperationRecord entity){
|
||||
return new ResponseEntity<>(deviceOperationRecordService.create(entity), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/group/getPressCode")
|
||||
@Log("获取压机编码")
|
||||
@ApiOperation("获取压机编码")
|
||||
public ResponseEntity<Object> getPressCode(){
|
||||
return new ResponseEntity<>(pdaService.getDeviceInfo(), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/group/getPressWorkOrder")
|
||||
@Log("获取压机编码")
|
||||
@ApiOperation("获取压机编码")
|
||||
public ResponseEntity<Object> getPressWorkOrder(JSONObject param){
|
||||
return new ResponseEntity<>(workorderService.getDeviceProductionTask(param.getString("point_code")), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/group/manual")
|
||||
@Log("人工组盘")
|
||||
@ApiOperation("人工组盘")
|
||||
public ResponseEntity<PdaResponseVo> manualDiskAssembly(@Validated @RequestBody ManualGroupDto entity){
|
||||
return new ResponseEntity<>(vehiclematerialgroupService.manualCreateByPda(entity), HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
package org.nl.wms.pda.service.dao.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: 人工组盘
|
||||
* @Date: 2023/9/18
|
||||
*/
|
||||
@Data
|
||||
public class ManualGroupDto {
|
||||
private String vehicle_code;
|
||||
private String vehicle_type;
|
||||
private String point_code;
|
||||
private String order_code;
|
||||
private BigDecimal material_weight;
|
||||
}
|
||||
@@ -98,6 +98,9 @@ public class PdmBdWorkorderServiceImpl extends ServiceImpl<PdmBdWorkorderMapper,
|
||||
|
||||
@Override
|
||||
public PdmBdWorkorder getDeviceProductionTask(String deviceCode) {
|
||||
if (ObjectUtil.isEmpty(deviceCode)) {
|
||||
throw new BadRequestException("根据设备查询工单,设备编码不能为空");
|
||||
}
|
||||
// 只能有一个生产中
|
||||
LambdaQueryWrapper<PdmBdWorkorder> lam = new QueryWrapper<PdmBdWorkorder>().lambda();
|
||||
lam.eq(PdmBdWorkorder::getPoint_code, deviceCode)
|
||||
|
||||
@@ -4,6 +4,8 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.wms.pda.service.dao.dto.ManualGroupDto;
|
||||
import org.nl.wms.pda.service.dao.vo.PdaResponseVo;
|
||||
import org.nl.wms.sch.group.service.dao.SchBaseVehiclematerialgroup;
|
||||
import org.nl.wms.sch.group.service.dto.SchBaseVehiclematerialgroupQuery;
|
||||
import org.nl.wms.sch.task_manage.enums.GroupBindMaterialStatusEnum;
|
||||
@@ -77,4 +79,6 @@ public interface ISchBaseVehiclematerialgroupService extends IService<SchBaseVeh
|
||||
* @return
|
||||
*/
|
||||
SchBaseVehiclematerialgroup getGroupInfo(String vehicleCode, String value);
|
||||
|
||||
PdaResponseVo manualCreateByPda(ManualGroupDto entity);
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package org.nl.wms.sch.group.service.impl;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
@@ -13,10 +14,19 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.wms.database.material.service.IMdBaseMaterialService;
|
||||
import org.nl.wms.database.material.service.dao.MdBaseMaterial;
|
||||
import org.nl.wms.pda.service.dao.dto.ManualGroupDto;
|
||||
import org.nl.wms.pda.service.dao.vo.PdaResponseVo;
|
||||
import org.nl.wms.pdm.workorder.service.IPdmBdWorkorderService;
|
||||
import org.nl.wms.pdm.workorder.service.dao.PdmBdWorkorder;
|
||||
import org.nl.wms.sch.group.service.ISchBaseVehiclematerialgroupService;
|
||||
import org.nl.wms.sch.group.service.dao.mapper.SchBaseVehiclematerialgroupMapper;
|
||||
import org.nl.wms.sch.group.service.dao.SchBaseVehiclematerialgroup;
|
||||
import org.nl.wms.sch.group.service.dto.SchBaseVehiclematerialgroupQuery;
|
||||
import org.nl.wms.sch.point.service.ISchBasePointService;
|
||||
import org.nl.wms.sch.point.service.dao.SchBasePoint;
|
||||
import org.nl.wms.sch.task_manage.enums.GroupStatusEnum;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -34,6 +44,12 @@ public class SchBaseVehiclematerialgroupServiceImpl extends ServiceImpl<SchBaseV
|
||||
|
||||
@Autowired
|
||||
private SchBaseVehiclematerialgroupMapper vehiclematerialgroupMapper;
|
||||
@Autowired
|
||||
private IPdmBdWorkorderService workorderService;
|
||||
@Autowired
|
||||
private ISchBasePointService pointService;
|
||||
@Autowired
|
||||
private IMdBaseMaterialService materialService;
|
||||
|
||||
@Override
|
||||
public IPage<SchBaseVehiclematerialgroup> queryAll(SchBaseVehiclematerialgroupQuery whereJson, PageQuery page){
|
||||
@@ -113,4 +129,38 @@ public class SchBaseVehiclematerialgroupServiceImpl extends ServiceImpl<SchBaseV
|
||||
return selectOne;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PdaResponseVo manualCreateByPda(ManualGroupDto entity) {
|
||||
if (ObjectUtil.isEmpty(entity)) {
|
||||
throw new BadRequestException("组盘不能为空");
|
||||
}
|
||||
// 获取压机工单
|
||||
PdmBdWorkorder bdWorkorder = workorderService.getByCode(entity.getOrder_code());
|
||||
// 获取点位
|
||||
SchBasePoint basePoint = pointService.getById(entity.getPoint_code());
|
||||
// 获取物料
|
||||
MdBaseMaterial material = materialService.getById(bdWorkorder.getWorkorder_id());
|
||||
SchBaseVehiclematerialgroup group = new SchBaseVehiclematerialgroup();
|
||||
group.setGroup_id(IdUtil.getSnowflake(1,1).nextIdStr());
|
||||
group.setVehicle_type(entity.getVehicle_type());
|
||||
group.setVehicle_code(entity.getVehicle_code());
|
||||
group.setMaterial_id(bdWorkorder.getMaterial_id());
|
||||
group.setRedundance_material_code(bdWorkorder.getRaw_material_code());
|
||||
group.setSource_vehicle_code(entity.getPoint_code());
|
||||
group.setPoint_code(entity.getPoint_code());
|
||||
group.setPoint_name(basePoint.getPoint_name());
|
||||
group.setInstorage_time(DateUtil.now());
|
||||
group.setStanding_time(material.getStanding_time());
|
||||
group.setMaterial_weight(entity.getMaterial_weight());
|
||||
group.setWorkorder_code(bdWorkorder.getWorkorder_code());
|
||||
group.setGroup_status(GroupStatusEnum.IN_STORAGE.getType());
|
||||
group.setMove_way(basePoint.getPoint_code());
|
||||
group.setBuss_move_id(IdUtil.getSnowflake(1,1).nextIdStr());
|
||||
group.setCreate_id(SecurityUtils.getCurrentUserId());
|
||||
group.setCreate_name(SecurityUtils.getCurrentNickName());
|
||||
group.setCreate_time(DateUtil.now());
|
||||
vehiclematerialgroupMapper.insert(group);
|
||||
return PdaResponseVo.pdaResultOk("组盘成功");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ public class AutoCreateTask {
|
||||
|
||||
@SneakyThrows
|
||||
public void run() {
|
||||
log.info("定时任务AutoCreateTask开始执行:");
|
||||
log.debug("定时任务AutoCreateTask开始执行:");
|
||||
this.doExecute();
|
||||
}
|
||||
|
||||
|
||||
@@ -97,7 +97,7 @@ public class CTQKTask extends AbstractTask {
|
||||
SchBasePoint point = findStartPoint(startRegionStr);
|
||||
if (ObjectUtil.isEmpty(point)) {
|
||||
// 消息通知
|
||||
noticeService.createNotice("拆盘机暂无托盘!", TASK_CONFIG_CODE + task.getTask_code(),
|
||||
noticeService.createNotice("拆盘机暂无托盘!", TASK_CONFIG_CODE + task.getPoint_code2(),
|
||||
NoticeTypeEnum.WARN.getCode());
|
||||
throw new BadRequestException("拆盘机暂无托盘!");
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ public class DTSKTask extends AbstractTask {
|
||||
SchBasePoint point = findNextPoint(nextRegionStr);
|
||||
if (ObjectUtil.isEmpty(point)) {
|
||||
// 消息通知
|
||||
noticeService.createNotice("货架暂无货位存放空托盘!", TASK_CONFIG_CODE + task.getTask_code(),
|
||||
noticeService.createNotice("货架暂无货位存放空托盘!", TASK_CONFIG_CODE + task.getPoint_code1(),
|
||||
NoticeTypeEnum.WARN.getCode());
|
||||
throw new BadRequestException("货架暂无货位存放空托盘!");
|
||||
}
|
||||
|
||||
@@ -178,7 +178,7 @@ public class FJMKTask extends AbstractTask {
|
||||
SchBasePoint packagePoint = findNextPoint(nextRegionStr, jsonObject);
|
||||
if (ObjectUtil.isEmpty(packagePoint)) {
|
||||
// 消息通知
|
||||
noticeService.createNotice("包装线不可用!", TASK_CONFIG_CODE + task.getTask_code(),
|
||||
noticeService.createNotice("包装线不可用!", TASK_CONFIG_CODE + task.getPoint_code1(),
|
||||
NoticeTypeEnum.WARN.getCode());
|
||||
throw new BadRequestException("包装线不可用!");
|
||||
}
|
||||
@@ -212,7 +212,7 @@ public class FJMKTask extends AbstractTask {
|
||||
/** 覆膜机木托盘位 */
|
||||
SchBasePoint LaminatePoint = findStartPoint(startRegionStr, jsonObject);
|
||||
if (ObjectUtil.isEmpty(LaminatePoint)) {
|
||||
noticeService.createNotice("覆膜区不可用!", TASK_CONFIG_CODE + task.getTask_code(),
|
||||
noticeService.createNotice("覆膜区不可用!", TASK_CONFIG_CODE + task.getPoint_code1(),
|
||||
NoticeTypeEnum.WARN.getCode());
|
||||
// 消息通知
|
||||
throw new BadRequestException("覆膜区不可用!");
|
||||
|
||||
@@ -84,7 +84,7 @@ public class FJQKTask extends AbstractTask {
|
||||
task.setRemark("覆膜机不可用!");
|
||||
taskService.updateById(task);
|
||||
// 消息通知
|
||||
noticeService.createNotice(task.getRemark(), TASK_CONFIG_CODE + task.getTask_code(),
|
||||
noticeService.createNotice(task.getRemark(), TASK_CONFIG_CODE + task.getPoint_code2(),
|
||||
NoticeTypeEnum.WARN.getCode());
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -124,7 +124,7 @@ public class FJQLTask extends AbstractTask {
|
||||
SchBasePoint point = findStartPoint(startRegionStr, extGroupData);
|
||||
if (ObjectUtil.isEmpty(point)) {
|
||||
// 消息通知
|
||||
noticeService.createNotice("钢托盘缓存货架没有所需物料!", TASK_CONFIG_CODE + task.getTask_code(),
|
||||
noticeService.createNotice("钢托盘缓存货架没有所需物料!", TASK_CONFIG_CODE + task.getPoint_code2(),
|
||||
NoticeTypeEnum.WARN.getCode());
|
||||
throw new BadRequestException("钢托盘缓存货架没有所需物料!");
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ public class FJRKTask extends AbstractTask {
|
||||
SchBasePoint point = findNextPoint(nextRegionStr);
|
||||
if (ObjectUtil.isEmpty(point)) {
|
||||
// 消息通知
|
||||
noticeService.createNotice("找不到可用的包装位!", TASK_CONFIG_CODE + task.getTask_code(),
|
||||
noticeService.createNotice("找不到可用的包装位!", TASK_CONFIG_CODE + task.getPoint_code1(),
|
||||
NoticeTypeEnum.WARN.getCode());
|
||||
throw new BadRequestException("找不到可用的包装位!");
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@ public class FJSKTask extends AbstractTask {
|
||||
SchBasePoint point = findNextPoint(nextRegionStr);
|
||||
if (ObjectUtil.isEmpty(point)) {
|
||||
// 消息通知
|
||||
noticeService.createNotice("叠盘架位置不可用!", TASK_CONFIG_CODE + task.getTask_code(),
|
||||
noticeService.createNotice("叠盘架位置不可用!", TASK_CONFIG_CODE + task.getPoint_code1(),
|
||||
NoticeTypeEnum.WARN.getCode());
|
||||
throw new BadRequestException("叠盘架位置不可用!");
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ public class FJSLTask extends AbstractTask {
|
||||
SchBasePoint point = findNextPoint(nextRegionStr, jsonObject);
|
||||
if (ObjectUtil.isEmpty(point)) {
|
||||
// 消息通知
|
||||
noticeService.createNotice("分拣机械手[" + task.getPoint_code1() + "]未找到所需点位!", TASK_CONFIG_CODE + task.getTask_code(),
|
||||
noticeService.createNotice("分拣机械手[" + task.getPoint_code1() + "]未找到所需点位!", TASK_CONFIG_CODE + task.getPoint_code1(),
|
||||
NoticeTypeEnum.WARN.getCode());
|
||||
throw new BadRequestException("分拣机械手[" + task.getPoint_code1() + "]未找到所需点位!");
|
||||
}
|
||||
|
||||
@@ -154,7 +154,7 @@ public class HNMLTask extends AbstractTask {
|
||||
SchBasePoint point = findNextPoint(nextRegionStr, jsonObject);
|
||||
if (ObjectUtil.isEmpty(point)) {
|
||||
// 消息通知
|
||||
noticeService.createNotice(task.getRemark(), TASK_CONFIG_CODE + task.getTask_code(),
|
||||
noticeService.createNotice("未存在生产该料的压机!", TASK_CONFIG_CODE + task.getPoint_code1(),
|
||||
NoticeTypeEnum.WARN.getCode());
|
||||
throw new BadRequestException("未存在生产该料的压机!");
|
||||
}
|
||||
@@ -354,7 +354,7 @@ public class HNMLTask extends AbstractTask {
|
||||
groupEntity.setMaterial_weight(ObjectUtil.isNotEmpty(weight)// 重量
|
||||
? weight
|
||||
: BigDecimal.valueOf(0));
|
||||
groupEntity.setGroup_bind_material_status(GroupBindMaterialStatusEnum.BOUND.getValue()); // 待绑定
|
||||
groupEntity.setGroup_bind_material_status(GroupBindMaterialStatusEnum.BOUND.getValue()); // 绑定
|
||||
groupEntity.setGroup_status(GroupStatusEnum.IN_STORAGE.getType()); // 暂时不维护。
|
||||
groupEntity.setIs_delete(false);
|
||||
// groupEntity.setExt_data(packNo);// todo: 对于混碾的组盘 暂时存吨袋号
|
||||
|
||||
@@ -115,7 +115,7 @@ public class CYZCTask extends AbstractTask {
|
||||
SchBasePoint point = findNextPoint(nextRegionStr, jsonObject);
|
||||
if (ObjectUtil.isEmpty(point)) {
|
||||
// 消息通知
|
||||
noticeService.createNotice("未找到钢托盘缓存区域空位!", TASK_CONFIG_CODE + task.getTask_code(),
|
||||
noticeService.createNotice("未找到钢托盘缓存区域空位!", TASK_CONFIG_CODE + task.getPoint_code1(),
|
||||
NoticeTypeEnum.WARN.getCode());
|
||||
throw new BadRequestException("未找到钢托盘缓存区域空位!");
|
||||
}
|
||||
|
||||
@@ -107,9 +107,9 @@ public class GZYQLTask extends AbstractTask {
|
||||
SchBasePoint point = findStartPoint(startRegionStr, jsonObject);
|
||||
if (ObjectUtil.isEmpty(point)) {
|
||||
// 消息通知
|
||||
noticeService.createNotice("入窑口[" + task.getPoint_code1() + "]未找到所需点位!", TASK_CONFIG_CODE + task.getTask_code(),
|
||||
noticeService.createNotice("入窑口[" + task.getPoint_code2() + "]未找到所需点位!", TASK_CONFIG_CODE + task.getPoint_code2(),
|
||||
NoticeTypeEnum.WARN.getCode());
|
||||
throw new BadRequestException("入窑口[" + task.getPoint_code1() + "]未找到所需点位!");
|
||||
throw new BadRequestException("入窑口[" + task.getPoint_code2() + "]未找到所需点位!");
|
||||
}
|
||||
// 设置终点并修改创建成功状态
|
||||
task.setPoint_code1(point.getPoint_code());
|
||||
|
||||
@@ -63,7 +63,7 @@ public class YZQKTask extends AbstractTask {
|
||||
SchBasePoint point = findStartPoint(startRegionStr, jsonObject);
|
||||
if (ObjectUtil.isEmpty(point)) {
|
||||
// 消息通知
|
||||
noticeService.createNotice("未找到所需点位!", TASK_CONFIG_CODE + task.getTask_code(),
|
||||
noticeService.createNotice("未找到所需点位!", TASK_CONFIG_CODE + task.getPoint_code2(),
|
||||
NoticeTypeEnum.WARN.getCode());
|
||||
throw new BadRequestException("未找到所需点位!");
|
||||
}
|
||||
|
||||
@@ -52,8 +52,6 @@ import java.util.stream.Collectors;
|
||||
@TaskType("YZMLTask")
|
||||
public class YZSLTask extends AbstractTask {
|
||||
private static String TASK_CONFIG_CODE = "YZMLTask";
|
||||
private static AtomicInteger countUp = new AtomicInteger(0); // 上层数量
|
||||
private static AtomicInteger countLower = new AtomicInteger(0); // 下层数量
|
||||
@Autowired
|
||||
private ISchBasePointService pointService;
|
||||
@Autowired
|
||||
@@ -66,7 +64,6 @@ public class YZSLTask extends AbstractTask {
|
||||
private ISchBaseVehiclematerialgroupService vehiclematerialgroupService;
|
||||
@Autowired
|
||||
private YZMapper yzMapper;
|
||||
|
||||
@Autowired
|
||||
private ISysNoticeService noticeService;
|
||||
@Autowired
|
||||
@@ -99,19 +96,6 @@ public class YZSLTask extends AbstractTask {
|
||||
NoticeTypeEnum.WARN.getCode());
|
||||
continue;
|
||||
}
|
||||
int up = countUp.get();
|
||||
int lower = countLower.get();
|
||||
if (lower == 0 || lower != 5) {
|
||||
countLower.incrementAndGet();
|
||||
} else {
|
||||
countUp.incrementAndGet();
|
||||
}
|
||||
if (up == 4) {
|
||||
countLower = new AtomicInteger(0);
|
||||
}
|
||||
if (lower == 4 && up == 4) {
|
||||
countUp = new AtomicInteger(0);
|
||||
}
|
||||
// 设置终点并修改创建成功状态
|
||||
task.setPoint_code2(point.getPoint_code());
|
||||
task.setTask_status(TaskStatus.CREATED.getCode());
|
||||
@@ -143,23 +127,10 @@ public class YZSLTask extends AbstractTask {
|
||||
SchBasePoint point = findNextPoint(nextRegionStr, jsonObject);
|
||||
if (ObjectUtil.isEmpty(point)) {
|
||||
// 消息通知
|
||||
noticeService.createNotice("压机[" + task.getPoint_code1() + "]未找到所需点位!", TASK_CONFIG_CODE + task.getTask_code(),
|
||||
noticeService.createNotice("压机[" + task.getPoint_code1() + "]未找到所需点位!", TASK_CONFIG_CODE + task.getPoint_code1(),
|
||||
NoticeTypeEnum.WARN.getCode());
|
||||
throw new BadRequestException("压机[" + task.getPoint_code1() + "]未找到所需点位!");
|
||||
}
|
||||
int up = countUp.get();
|
||||
int lower = countLower.get();
|
||||
if (lower == 0 || lower != 5) {
|
||||
countLower.incrementAndGet();
|
||||
} else {
|
||||
countUp.incrementAndGet();
|
||||
}
|
||||
if (up == 4) {
|
||||
countLower = new AtomicInteger(0);
|
||||
}
|
||||
if (lower == 4 && up == 4) {
|
||||
countUp = new AtomicInteger(0);
|
||||
}
|
||||
// 设置终点并修改创建成功状态
|
||||
task.setPoint_code2(point.getPoint_code());
|
||||
task.setTask_status(TaskStatus.CREATED.getCode());
|
||||
@@ -208,13 +179,6 @@ public class YZSLTask extends AbstractTask {
|
||||
}
|
||||
}
|
||||
// 双层缓存货架的一上一下的区分 -> 上五下五区分
|
||||
// 计算缓存上和缓存下的空位数量决定是使用desc还是asc
|
||||
int up = countUp.get();
|
||||
int lower = countLower.get();
|
||||
boolean isASC = false;
|
||||
if (lower == 0 || lower != 5) {
|
||||
isASC = true;
|
||||
}
|
||||
LambdaQueryWrapper<SchBasePoint> lam = new QueryWrapper<SchBasePoint>().lambda();
|
||||
lam.eq(SchBasePoint::getRegion_code, regionCode)
|
||||
.eq(SchBasePoint::getPoint_status, PointStatusEnum.EMPTY_POINT.getCode())
|
||||
@@ -223,7 +187,8 @@ public class YZSLTask extends AbstractTask {
|
||||
.or()
|
||||
.eq(SchBasePoint::getIng_task_code, ""))
|
||||
.eq(SchBasePoint::getIs_used, true)
|
||||
.orderBy(true, isASC, SchBasePoint::getPoint_code);
|
||||
.ne(SchBasePoint::getVehicle_qty, 5) // 载具数量不能等于5
|
||||
.orderByDesc(SchBasePoint::getVehicle_qty);
|
||||
List<SchBasePoint> schBasePoints = pointService.list(lam);
|
||||
return ObjectUtil.isNotEmpty(schBasePoints) ? schBasePoints.get(0) : null;
|
||||
}
|
||||
@@ -307,7 +272,10 @@ public class YZSLTask extends AbstractTask {
|
||||
groupEntity.setPoint_name(basePoint.getPoint_name());
|
||||
groupEntity.setSource_vehicle_code(basePoint.getPoint_code());
|
||||
groupEntity.setMove_way(basePoint.getPoint_code());
|
||||
groupEntity.setPcsn(DateUtil.format(DateUtil.date(), "yyyyMMdd")); // todo: ???
|
||||
// groupEntity.setPcsn(DateUtil.format(DateUtil.date(), "yyyyMMdd")); // 批次号使用自己定义的、暂时没用压机工单
|
||||
groupEntity.setPcsn(ObjectUtil.isNotEmpty(workorderObject)
|
||||
? workorderObject.getBatch_no()
|
||||
: DateUtil.format(DateUtil.date(), "yyyyMMdd"));
|
||||
groupEntity.setInstorage_time(DateUtil.now());
|
||||
groupEntity.setGroup_bind_material_status(GroupBindMaterialStatusEnum.WAIT_BIND.getValue()); // 待绑定
|
||||
groupEntity.setGroup_status(GroupStatusEnum.IN_STORAGE.getType()); // 暂时不维护。
|
||||
@@ -376,7 +344,7 @@ public class YZSLTask extends AbstractTask {
|
||||
}
|
||||
// 起点清空
|
||||
PointUtils.setUpdateByType(startPointObj, taskFinishedType);
|
||||
PointUtils.clearPoint(startPointObj);
|
||||
PointUtils.clearPointAndRetainNum(startPointObj);
|
||||
// 任务完成
|
||||
taskObj.setTask_status(TaskStatus.FINISHED.getCode());
|
||||
taskObj.setRemark(GeneralDefinition.TASK_FINISH);
|
||||
|
||||
@@ -54,6 +54,32 @@ public class PointUtils {
|
||||
pointService.updateById(point);
|
||||
}
|
||||
|
||||
/**
|
||||
* 清空点位
|
||||
* 双层输送线特殊功能:上五下五
|
||||
* @param point
|
||||
*/
|
||||
public static void clearPointAndRetainNum(SchBasePoint point) {
|
||||
if (ObjectUtil.isEmpty(point)) {
|
||||
return; // 空直接退出
|
||||
}
|
||||
SchBasePointServiceImpl pointService = SpringContextHolder.getBean(SchBasePointServiceImpl.class);
|
||||
// 获取父点位
|
||||
String parentPointCode = point.getParent_point_code();
|
||||
SchBasePoint basePoint = pointService.getById(parentPointCode);
|
||||
point.setPoint_status(PointStatusEnum.EMPTY_POINT.getCode());
|
||||
point.setVehicle_type("");
|
||||
point.setVehicle_code("");
|
||||
point.setIng_task_code("");
|
||||
point.setVehicle_qty(point.getVehicle_qty() + 1);
|
||||
if (basePoint.getVehicle_qty() == 5) { // 等到新的点执行第一托的时候,才判断另一个点满足5个托盘的时候就清空
|
||||
basePoint.setVehicle_qty(0);
|
||||
pointService.updateById(basePoint);
|
||||
}
|
||||
point.setUpdate_time(DateUtil.now());
|
||||
pointService.updateById(point);
|
||||
}
|
||||
|
||||
/** 点位修改更新信息 **/
|
||||
public static void setUpdateByAcs(SchBasePoint pointObj) {
|
||||
pointObj.setUpdate_id(GeneralDefinition.ACS_ID);
|
||||
|
||||
@@ -35,9 +35,9 @@ https://juejin.cn/post/6844903775631572999
|
||||
<!--日志文件输出的文件名-->
|
||||
<FileNamePattern>${LOG_HOME}/%d{yyyy-MM-dd}.%i.log</FileNamePattern>
|
||||
<!--日志文件保留天数-->
|
||||
<maxHistory>15</maxHistory>
|
||||
<maxHistory>30</maxHistory>
|
||||
<!--单个日志最大容量 至少10MB才能看得出来-->
|
||||
<maxFileSize>200MB</maxFileSize>
|
||||
<maxFileSize>120MB</maxFileSize>
|
||||
<!--所有日志最多占多大容量-->
|
||||
<totalSizeCap>20GB</totalSizeCap>
|
||||
</rollingPolicy>
|
||||
@@ -62,7 +62,7 @@ https://juejin.cn/post/6844903775631572999
|
||||
</appender>
|
||||
<!--开发环境:打印控制台-->
|
||||
<springProfile name="dev">
|
||||
<root level="DEBUG">
|
||||
<root level="INFO">
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
<appender-ref ref="asyncLuceneAppender"/>
|
||||
</root>
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
package org.nl.ext;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description:
|
||||
* @Date: 2023/9/18
|
||||
*/
|
||||
public class StorageManager {
|
||||
private int requestCount = 0;
|
||||
|
||||
public String allocateStorage() {
|
||||
requestCount++;
|
||||
if (requestCount >= 1 && requestCount <= 5) {
|
||||
return "上货位";
|
||||
} else if (requestCount >= 6 && requestCount <= 10) {
|
||||
return "下货位";
|
||||
} else {
|
||||
// 如果请求次数大于10,循环上下
|
||||
requestCount = 1;
|
||||
return "上货位";
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
StorageManager manager = new StorageManager();
|
||||
|
||||
// 模拟外部系统的请求
|
||||
for (int i = 1; i <= 23; i++) {
|
||||
new Thread(() -> {
|
||||
String storage = manager.allocateStorage();
|
||||
System.out.println("第 " + Thread.currentThread().getName() + " 次请求,分配到:" + storage);
|
||||
}).start();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,20 +29,25 @@ public class TestDemo {
|
||||
@Test
|
||||
public void test01() {
|
||||
for (int i = 0; i < 13; i++) {
|
||||
toAdd();
|
||||
int up = countUp.get();
|
||||
int lower = countLower.get();
|
||||
if (lower == 0 || lower != 5) {
|
||||
countLower.incrementAndGet();
|
||||
} else {
|
||||
countUp.incrementAndGet();
|
||||
}
|
||||
if (up == 4) {
|
||||
countLower = new AtomicInteger(0);
|
||||
}
|
||||
if (lower == 4 && up == 4) {
|
||||
countUp = new AtomicInteger(0);
|
||||
}
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
toAdd();
|
||||
int up = countUp.get();
|
||||
int lower = countLower.get();
|
||||
if (lower == 0 || lower != 5) {
|
||||
countLower.incrementAndGet();
|
||||
} else {
|
||||
countUp.incrementAndGet();
|
||||
}
|
||||
if (up == 4) {
|
||||
countLower = new AtomicInteger(0);
|
||||
}
|
||||
if (lower == 4 && up == 4) {
|
||||
countUp = new AtomicInteger(0);
|
||||
}
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,7 +55,7 @@ public class TestDemo {
|
||||
int up = countUp.get();
|
||||
int lower = countLower.get();
|
||||
boolean isASC = false;
|
||||
if (lower == 0 || lower != 5) {
|
||||
if (lower < 5) {
|
||||
isASC = true;
|
||||
}
|
||||
if (isASC) {
|
||||
|
||||
@@ -257,9 +257,9 @@ export default {
|
||||
param.have_read = '2'
|
||||
crudNotice.changeRead(param).then(() => {
|
||||
this.$bus.emit(NOTICE_MESSAGE_UPDATE)
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
})
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user