1
huanghongfeng
2 天以前 a34059e688e947a2ea079a0646872f1a21089940
ÏîÄ¿´úÂë/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Partial/Dt_TaskService.cs
@@ -1,6 +1,7 @@
using log4net.Core;
using Masuit.Tools;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using WIDESEA_Common;
using WIDESEA_Core.Const;
@@ -230,6 +231,13 @@
                return content.Error($"未知条码{input.PalletCode}任务");
            }
            List<Dt_Task> taskcl =  BaseDal.QueryData(x => x.TaskState == (int)TaskOutStatusEnum.Lien_Check);
            if (taskcl.Count > 0)
            {
                return content.Error($"已有在测量中的车轮,请查看是否申请正确");
            }
            task.TaskState = (int)TaskOutStatusEnum.Lien_Check;
            task.CurrentAddress = input.Position;
            task.NextAddress = "2021";
@@ -266,12 +274,19 @@
            if(cacheinfo.Towhereabouts =="" && cacheinfo.Towhereabouts == null) throw new Exception($"{input.PalletCode}运输目标地址为空");
            return content.OK(data: cacheinfo.Towhereabouts);*/
            var task = await BaseDal.QueryFirstAsync(x => x.PalletCode == input.PalletCode);
            if (task == null) throw new Exception($"未找到{input.PalletCode}托盘信息");
            if (task.Towhereabouts == "" && task.Towhereabouts == null) throw new Exception($"{input.PalletCode}运输目标地址为空");
            return content.OK(data: task.Towhereabouts);
            var task = await BaseDal.QueryFirstAsync(x => input.PalletCode.Contains(x.PalletCode));
            if (task != null)
            {
                if (task.Towhereabouts == "" && task.Towhereabouts == null) return content.Error($"{input.PalletCode}运输目标地址为空");
                return content.OK(data: task.Towhereabouts);
            }
            else
            {
                Dt_Task_Hty dt_Task_Hty = _task_HtyRepository.QueryFirst(x => input.PalletCode.Contains(x.PalletCode) && x.CreateDate >= DateTime.Now.AddHours(-2));
                if (dt_Task_Hty == null) return content.Error($"未找到{input.PalletCode}托盘历史信息");
                if (dt_Task_Hty.Towhereabouts == null && dt_Task_Hty.Towhereabouts == "") return content.Error($"{input.PalletCode}托盘历史信息没有记录目标地址");
                return content.OK(data: dt_Task_Hty.Towhereabouts);
            }
        }
        catch (Exception err)
        {
@@ -288,7 +303,7 @@
        try
        {
            string CZTM = saveModel.MainData["CZTM"].ToString();
            string TargetAddress = saveModel.MainData["TargetAddress"].ToString();
            string TargetAddress = saveModel.MainData["TargetAddress"].ToString();
            List<Dt_Task> taskt = BaseDal.QueryData(x => x.task_CZInfo == CZTM).ToList();
            if (taskt.Count() == 0)
                return webResponse.Error($"未找到对应车轴:{CZTM}的车轮出库信息");