| | |
| | | using WIDESEA_Common; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.Enums; |
| | | using WIDESEA_Core.Helper; |
| | | using WIDESEA_DTO; |
| | | using WIDESEA_DTO.Basic; |
| | | using WIDESEA_DTO.Order; |
| | |
| | | using WIDESEA_Model.Models.Order; |
| | | using WIDESEA_OrderRepository; |
| | | using WIDESEA_StorageTaskRepository; |
| | | using JsonSerializer = System.Text.Json.JsonSerializer; |
| | | |
| | | namespace WIDESEA_StorageBasicService; |
| | | |
| | |
| | | _taskRepository = taskRepository; |
| | | _outDetailsRepository = outDetailsRepository; |
| | | } |
| | | |
| | | #region 鏂规硶閲嶅啓 |
| | | /// <summary> |
| | | /// 鍒嗛〉 |
| | | /// </summary> |
| | |
| | | return new PageGridData<DtStockInfo>(totalCount, data); |
| | | } |
| | | |
| | | public override WebResponseContent UpdateData(SaveModel saveModel) |
| | | { |
| | | var remark = saveModel.MainData["remark"].ToString(); |
| | | var palletCode = saveModel.MainData["palletCode"].ToString(); |
| | | List<DtStockInfoDetail> details = DeserializeList<DtStockInfoDetail>(saveModel.DetailData); |
| | | if (remark == "璋冩嫧鍑哄簱") |
| | | { |
| | | return _taskService.HandAllocateOutBoundTaskAsync(details).Result; |
| | | } |
| | | else if (remark == "鍏朵粬鍑哄簱") |
| | | { |
| | | return _taskService.OtherOutBoundTaskAsync(details).Result; |
| | | } |
| | | else |
| | | { |
| | | return WebResponseContent.Instance.Error("绯荤粺寮傚父"); |
| | | } |
| | | } |
| | | public List<T> DeserializeList<T>(List<Dictionary<string, object>> rawData) |
| | | { |
| | | if (rawData == null) return new List<T>(); |
| | | var processedData = rawData.Select(dict => |
| | | { |
| | | var newDict = new Dictionary<string, object>(); |
| | | foreach (var kvp in dict) |
| | | { |
| | | var newKey = char.ToUpper(kvp.Key[0]) + kvp.Key.Substring(1); |
| | | newDict[newKey] = kvp.Value; |
| | | } |
| | | return newDict; |
| | | }).ToList(); |
| | | var json = JsonSerializer.Serialize(processedData); |
| | | return JsonSerializer.Deserialize<List<T>>(json); |
| | | } |
| | | |
| | | public List<DtLocationInfo> GetStockLocations(List<DtLocationInfo>? locations) |
| | | { |
| | | List<DtLocationInfo> locationsNew = new List<DtLocationInfo>(); |
| | |
| | | return locationsNew; |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region 搴撳瓨瑙嗗浘 |
| | | public List<StockSelectViewDTO> GetStockSelectViews(GetStockSelectViewDto viewDto) |
| | | { |