1
huangxiaoqiang
8 小时以前 a1f7a7a68d23f7b9de7c4237bf167fa4808fb20d
项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Stock/StockInfoService.cs
@@ -14,6 +14,7 @@
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;
@@ -24,6 +25,7 @@
using WIDESEA_Model.Models.Order;
using WIDESEA_OrderRepository;
using WIDESEA_StorageTaskRepository;
using JsonSerializer = System.Text.Json.JsonSerializer;
namespace WIDESEA_StorageBasicService;
@@ -57,7 +59,7 @@
        _taskRepository = taskRepository;
        _outDetailsRepository = outDetailsRepository;
    }
    #region 鏂规硶閲嶅啓
    /// <summary>
    /// 鍒嗛〉
    /// </summary>
@@ -130,6 +132,41 @@
        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>();
@@ -182,6 +219,8 @@
        return locationsNew;
    }
    #endregion
    #region 搴撳瓨瑙嗗浘
    public List<StockSelectViewDTO> GetStockSelectViews(GetStockSelectViewDto viewDto)
    {