wankeda
2025-06-24 1caea0fdc7ed1788d854a2aba8853984b4494e01
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Emptybound.cs
@@ -27,23 +27,23 @@
                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("空托库入") && x.PointStatus == LocationStatusEnum.Free.ObjToInt());
                    if (endCachePoint == null)
                    {
                        return content = WebResponseContent.Instance.Error($"添加任务异常,错误信息:{"未找到空托库出库位可用缓存架"}");
                        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.EnableStatus == EnableStatusEnum.Normal.ObjToInt().ObjToInt());
                    if (point == null)
                    {
                        return content = WebResponseContent.Instance.Error($"添加任务异常,错误信息:{"扫码数据异常,未找到此缓存架或物料类型不匹配"}");
                        return content = WebResponseContent.Instance.Error($"添加任务异常,错误信息:{"扫码数据异常,未找到此缓存架或已禁用"}");
                    }
                    Dt_CachePoint points = _basicService.CachePointService.Repository.QueryFirst(x => x.PointCode == stationcode && x.PointStatus == LocationStatusEnum.Free.ObjToInt());
                    Dt_CachePoint points = _basicService.CachePointService.Repository.QueryFirst(x => x.PointCode == stationcode && x.PointStatus == LocationStatusEnum.Free.ObjToInt() && x.EnableStatus == EnableStatusEnum.Normal.ObjToInt().ObjToInt());
                    if (points == 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,26 +97,26 @@
                try
                {
                    string stationcode = saveModel.MainData["stationcode"].ToString();
                    string PalletCode = saveModel.MainData["PalletCode"].ToString();
                    //string toaddress = saveModel.MainData["toaddress"].ToString();
                    if (stationcode == "" || PalletCode == "")//异常返回。。。。。。
                    //string PalletCode = saveModel.MainData["PalletCode"].ToString();
                    string toaddress = saveModel.MainData["toaddress"].ToString();
                    if (stationcode == "" || toaddress == "")//异常返回。。。。。。
                    {
                        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.PointName == toaddress && x.PointStatus == LocationStatusEnum.Free.ObjToInt() && x.EnableStatus == EnableStatusEnum.Normal.ObjToInt().ObjToInt());
                    if (endCachePoint == null)
                    {
                        return content = WebResponseContent.Instance.Error($"添加任务异常,错误信息:{"未找到空托库入库位可用缓存架"}");
                        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.EnableStatus == EnableStatusEnum.Normal.ObjToInt().ObjToInt());
                    if (point == null)
                    {
                        return content = WebResponseContent.Instance.Error($"添加任务异常,错误信息:{"扫码数据异常,未找到此缓存架或物料类型不匹配"}");
                        return content = WebResponseContent.Instance.Error($"添加任务异常,错误信息:{"扫码数据异常,未找到此缓存架或已禁用"}");
                    }
                    Dt_CachePoint points = _basicService.CachePointService.Repository.QueryFirst(x => x.PointCode == stationcode && x.PointStatus == LocationStatusEnum.Free.ObjToInt());
                    Dt_CachePoint points = _basicService.CachePointService.Repository.QueryFirst(x => x.PointCode == stationcode && x.PointStatus == LocationStatusEnum.InStock.ObjToInt());
                    if (points == null)
                    {
                        return content = WebResponseContent.Instance.Error($"添加任务异常,错误信息:{"扫码数据异常,此缓存点已被锁定"}");
                        return content = WebResponseContent.Instance.Error($"添加任务异常,错误信息:{"扫码数据异常,此缓存点状态不是有货状态"}");
                    }
                    Dt_Task taskcode = BaseDal.QueryFirst(x => x.SourceAddress == stationcode || x.TargetAddress == stationcode);
                    if (taskcode != null)
@@ -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",
                    };
@@ -172,15 +172,15 @@
                    {
                        return content = WebResponseContent.Instance.Error($"添加任务异常,错误信息:{"扫码数据不能为空"}");
                    }
                    Dt_CachePoint endCachePoint = _basicService.CachePointService.Repository.QueryFirst(x => x.Materialtype == PalletCode && x.PointName == toaddress && x.PointStatus == LocationStatusEnum.Free.ObjToInt());
                    Dt_CachePoint endCachePoint = _basicService.CachePointService.Repository.QueryFirst(x => x.PointName == toaddress && x.PointStatus == LocationStatusEnum.Free.ObjToInt() && x.EnableStatus == EnableStatusEnum.Normal.ObjToInt().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 && x.EnableStatus == EnableStatusEnum.Normal.ObjToInt().ObjToInt());// && x.Materialtype == PalletCode
                    if (point == null)
                    {
                        return content = WebResponseContent.Instance.Error($"添加任务异常,错误信息:{"扫码数据异常,未找到此缓存架或物料类型不匹配"}");
                        return content = WebResponseContent.Instance.Error($"添加任务异常,错误信息:{"扫码数据异常,未找到此缓存架或已禁用"}");
                    }
                    Dt_CachePoint points = _basicService.CachePointService.Repository.QueryFirst(x => x.PointCode == stationcode && x.PointStatus == LocationStatusEnum.Free.ObjToInt());
                    if (points == null)
@@ -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($"收货异常,错误信息:该站点已存在任务");