1
wankeda
2025-03-22 867aba2636e34a1050b1c4c84bbe78cc9c39b553
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Emptybound.cs
@@ -27,18 +27,18 @@
                try
                {
                    string stationcode = saveModel.MainData["stationcode"].ToString();
                    string PalletCode = saveModel.MainData["PalletCode"].ToString();
                    //string PalletCode = saveModel.MainData["PalletCode"].ToString();
                    //string toaddress = saveModel.MainData["toaddress"].ToString();
                    if (stationcode == "" || PalletCode == "")//异常返回。。。。。。
                    if (stationcode == "")//异常返回。。。。。。
                    {
                        return content = WebResponseContent.Instance.Error($"添加任务异常,错误信息:{"扫码数据不能为空"}");
                    }
                    Dt_CachePoint endCachePoint = _basicService.CachePointService.Repository.QueryFirst(x => x.PointCode.Contains("KTRHCK") && x.Materialtype == PalletCode && x.PointStatus == LocationStatusEnum.Free.ObjToInt());
                    Dt_CachePoint endCachePoint = _basicService.CachePointService.Repository.QueryFirst(x => x.PointCode.Contains("空托库HCK") && x.PointStatus == LocationStatusEnum.Free.ObjToInt());
                    if (endCachePoint == null)
                    {
                        return content = WebResponseContent.Instance.Error($"添加任务异常,错误信息:{"未找到空托库出库位可用缓存架"}");
                    }
                    Dt_CachePoint point = _basicService.CachePointService.Repository.QueryFirst(x => x.PointCode == stationcode && x.Materialtype == PalletCode);
                    Dt_CachePoint point = _basicService.CachePointService.Repository.QueryFirst(x => x.PointCode == stationcode);
                    if (point == null)
                    {
                        return content = WebResponseContent.Instance.Error($"添加任务异常,错误信息:{"扫码数据异常,未找到此缓存架或物料类型不匹配"}");
@@ -66,7 +66,7 @@
                        TaskStatus = AGVTaskStatusEnum.AGV_New.ObjToInt(),
                        TaskType = TaskTypeEnum.AGVCarry.ObjToInt(),
                        Depth = 1,
                        Materialtype = PalletCode,
                        Materialtype = "",
                        TaskNum = BaseDal.GetTaskNum(nameof(SequenceEnum.SeqTaskNum)),
                        Creater = App.User.UserId > 0 ? App.User.UserName : "System",
                    };
@@ -97,18 +97,18 @@
                try
                {
                    string stationcode = saveModel.MainData["stationcode"].ToString();
                    string PalletCode = saveModel.MainData["PalletCode"].ToString();
                    //string PalletCode = saveModel.MainData["PalletCode"].ToString();
                    //string toaddress = saveModel.MainData["toaddress"].ToString();
                    if (stationcode == "" || PalletCode == "")//异常返回。。。。。。
                    if (stationcode == "")//异常返回。。。。。。
                    {
                        return content = WebResponseContent.Instance.Error($"添加任务异常,错误信息:{"扫码数据不能为空"}");
                    }
                    Dt_CachePoint endCachePoint = _basicService.CachePointService.Repository.QueryFirst(x => x.PointCode.Contains("KTRHCK") && x.Materialtype == PalletCode && x.PointStatus == LocationStatusEnum.Free.ObjToInt());
                    Dt_CachePoint endCachePoint = _basicService.CachePointService.Repository.QueryFirst(x => x.PointCode.Contains("空托库HCK") && x.PointStatus == LocationStatusEnum.Free.ObjToInt());
                    if (endCachePoint == null)
                    {
                        return content = WebResponseContent.Instance.Error($"添加任务异常,错误信息:{"未找到空托库入库位可用缓存架"}");
                    }
                    Dt_CachePoint point = _basicService.CachePointService.Repository.QueryFirst(x => x.PointCode == stationcode && x.Materialtype == PalletCode);
                    Dt_CachePoint point = _basicService.CachePointService.Repository.QueryFirst(x => x.PointCode == stationcode);
                    if (point == null)
                    {
                        return content = WebResponseContent.Instance.Error($"添加任务异常,错误信息:{"扫码数据异常,未找到此缓存架或物料类型不匹配"}");
@@ -136,7 +136,7 @@
                        TaskStatus = AGVTaskStatusEnum.AGV_New.ObjToInt(),
                        TaskType = TaskTypeEnum.AGVCarry.ObjToInt(),
                        Depth = 1,
                        Materialtype = PalletCode,
                        Materialtype = "",
                        TaskNum = BaseDal.GetTaskNum(nameof(SequenceEnum.SeqTaskNum)),
                        Creater = App.User.UserId > 0 ? App.User.UserName : "System",
                    };
@@ -177,7 +177,7 @@
                    {
                        return content = WebResponseContent.Instance.Error($"添加任务异常,错误信息:{"未找到终点区域可用缓存架"}");
                    }
                    Dt_CachePoint point = _basicService.CachePointService.Repository.QueryFirst(x => x.PointCode == stationcode && x.Materialtype == PalletCode);
                    Dt_CachePoint point = _basicService.CachePointService.Repository.QueryFirst(x => x.PointCode == stationcode);// && x.Materialtype == PalletCode
                    if (point == null)
                    {
                        return content = WebResponseContent.Instance.Error($"添加任务异常,错误信息:{"扫码数据异常,未找到此缓存架或物料类型不匹配"}");
@@ -233,22 +233,22 @@
            try
            {
                string stationcode = saveModel.MainData["stationcode"].ToString();
                string PalletCode = saveModel.MainData["PalletCode"].ToString();
                if (stationcode == "" || PalletCode == "")//异常返回。。。。。。
                //string PalletCode = saveModel.MainData["PalletCode"].ToString();
                if (stationcode == "")//异常返回。。。。。。|| PalletCode == ""
                {
                    return content = WebResponseContent.Instance.Error($"收货异常,错误信息:{"扫码数据不能为空"}");
                }
                Dt_CachePoint cachePoint = _basicService.CachePointService.Repository.QueryFirst(x => x.PointCode == stationcode && x.Materialtype == PalletCode && (x.PointStatus == LocationStatusEnum.Lock.ObjToInt() || x.PointStatus == LocationStatusEnum.InStock.ObjToInt()));
                Dt_CachePoint cachePoint = _basicService.CachePointService.Repository.QueryFirst(x => x.PointCode == stationcode && (x.PointStatus == LocationStatusEnum.Lock.ObjToInt() || x.PointStatus == LocationStatusEnum.InStock.ObjToInt()));//&& x.Materialtype == PalletCode
                if (cachePoint == null)
                {
                    return content = WebResponseContent.Instance.Error($"收货异常,错误信息:{"缓存位不是锁定状态"}");
                }
                Dt_CachePoint point = _basicService.CachePointService.Repository.QueryFirst(x => x.PointCode == stationcode && x.Materialtype == PalletCode);
                Dt_CachePoint point = _basicService.CachePointService.Repository.QueryFirst(x => x.PointCode == stationcode);// && x.Materialtype == PalletCode
                if (point == null)
                {
                    return content = WebResponseContent.Instance.Error($"收货异常,错误信息:{"扫码数据异常,未找到此缓存架或物料类型不匹配"}");
                }
                Dt_Task taskcode = BaseDal.QueryFirst(x => x.SourceAddress == stationcode || x.TargetAddress == stationcode);
                Dt_Task taskcode = BaseDal.QueryFirst(x => (x.SourceAddress == stationcode || x.TargetAddress == stationcode));
                if (taskcode != null)
                {
                    return content = WebResponseContent.Instance.Error($"收货异常,错误信息:该站点已存在任务");