From b6837f097e9cdb2645368aed4ddb03f580c331e4 Mon Sep 17 00:00:00 2001 From: z8018 <1282578289@qq.com> Date: 星期一, 05 五月 2025 17:29:07 +0800 Subject: [PATCH] 1 --- 项目代码/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/BasicInfo/ContainerController.cs | 34 ++++++++++++++++++++++++++++++---- 1 files changed, 30 insertions(+), 4 deletions(-) diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/BasicInfo/ContainerController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/BasicInfo/ContainerController.cs" index 05f6e55..b238470 100644 --- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/BasicInfo/ContainerController.cs" +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/BasicInfo/ContainerController.cs" @@ -4,9 +4,12 @@ using Microsoft.AspNetCore.Mvc; using SqlSugar.Extensions; using WIDESEAWCS_BasicInfoRepository; +using WIDESEAWCS_BasicInfoService; using WIDESEAWCS_Common; using WIDESEAWCS_Core; using WIDESEAWCS_Core.BaseController; +using WIDESEAWCS_DTO.PlacedBlockDTO; +using WIDESEAWCS_DTO.TaskInfo; using WIDESEAWCS_IBasicInfoRepository; using WIDESEAWCS_IBasicInfoService; using WIDESEAWCS_Model.Models; @@ -21,12 +24,21 @@ private readonly IOrderContainerRepository _orderContainerRepository; private readonly IOrderDetailsRepository _orderDetailsRepository; private readonly IOrderrowsRepository _orderrowsRepository; - public ContainerController(IContainerService service, IContainerRepository containerRepository, IOrderContainerRepository orderContainerRepository, IOrderDetailsRepository orderDetailsRepository, IOrderrowsRepository orderrowsRepository) : base(service) + private readonly IContainerItemRepository _containerItemRepository; + public ContainerController(IContainerService service, IContainerRepository containerRepository, IOrderContainerRepository orderContainerRepository, IOrderDetailsRepository orderDetailsRepository, IOrderrowsRepository orderrowsRepository, IContainerItemRepository containerItemRepository) : base(service) { _containerRepository = containerRepository; _orderContainerRepository = orderContainerRepository; _orderDetailsRepository = orderDetailsRepository; _orderrowsRepository = orderrowsRepository; + _containerItemRepository = containerItemRepository; + } + + [HttpPost, HttpGet, Route("GetTaskPosition"), AllowAnonymous] + public TaskPosition GetTaskPosition([FromBody] Point3D point3D, int length, int width, int height, int edge) + { + PlaceBlockService placeBlockService = new PlaceBlockService(new ContainerSize(), null); + return placeBlockService.GetTaskPosition(point3D, length, width, height, edge); } [HttpPost, HttpGet, Route("GetPutStations"), AllowAnonymous] @@ -38,6 +50,8 @@ List<object> list = new List<object>(); foreach (var container in containers) { + List<string> containerItemCodes = _containerItemRepository.QueryData(x => x.ContainerId == container.Id).Select(x => x.ItemCode).ToList(); + Dt_OrderContainer orderContainer = _orderContainerRepository.QueryFirst(x => x.ContainerId == container.Id && x.ContainerCode == container.ContainerCode); if (orderContainer != null) { @@ -45,7 +59,10 @@ if (orderrows != null) { List<OrderDetails> totalDetails = _orderDetailsRepository.QueryData(x => x.Orderrowsid == orderrows.id); - List<OrderDetails> details = totalDetails.Where(x => x.Orderrowsid == orderrows.id && x.Orderdetails_status == PalletingStatusEnmu.PalletingSuccess.ObjToInt()).ToList(); + List<OrderDetails> details = totalDetails.Where(x => x.Orderrowsid == orderrows.id && x.Orderdetails_status == PalletingStatusEnmu.PalletingSuccess.ObjToInt() && containerItemCodes.Contains(x.Orderdetails_outid)).ToList(); + + int sortedNum = totalDetails.Where(x => x.Orderrowsid == orderrows.id && x.Orderdetails_status == PalletingStatusEnmu.PalletingSuccess.ObjToInt()).Count(); + List<object> orderData = new List<object>(); foreach (var item in details) { @@ -63,8 +80,9 @@ { stationCode = container.ContainerCode, orderTotalNum = totalDetails.Count, - sortedNum = details.Count, - unsortedNum = totalDetails.Count - details.Count, + sortedNum = sortedNum, + unsortedNum = totalDetails.Count - sortedNum, + stationSortedNum = details.Count, orderData = orderData }; list.Add(data); @@ -73,6 +91,7 @@ { object data = new { + stationSortedNum = 0, stationCode = container.ContainerCode, orderTotalNum = 0, sortedNum = 0, @@ -90,6 +109,7 @@ orderTotalNum = 0, sortedNum = 0, unsortedNum = 0, + stationSortedNum = 0, orderData = new List<object>() }; list.Add(data); @@ -107,5 +127,11 @@ }; } } + + [HttpPost, HttpGet, Route("ReleaseContainer"), AllowAnonymous] + public WebResponseContent ReleaseContainer([FromBody] int[] keys) + { + return Service.ReleaseContainer(keys); + } } } -- Gitblit v1.9.3