wangxinhui
2026-01-12 ded9c653b4bd5f45cb23124068687135c29e6915
ÏîÄ¿´úÂë/WMS/WMSServices/WIDESEA_TaskInfoService/TaskService_Completed.cs
@@ -97,6 +97,7 @@
            try
            {
                Dt_Task wmsTask = BaseDal.QueryFirst(x=>x.TaskNum == task.TaskNum);
                string oldPalletCode = wmsTask.PalletCode;
                if (wmsTask != null)
                {
                    wmsTask.PalletCode= task.PalletCode;
@@ -108,6 +109,31 @@
                    wmsTask.TaskType = task.TaskType;
                    wmsTask.TargetAddress = task.TargetAddress;
                    BaseDal.UpdateData(wmsTask);
                    //推送MES接驳成功接口
                    if (wmsTask.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup && !wmsTask.WorkCentreCode.IsNullOrEmpty() && wmsTask.TaskStatus == TaskStatusEnum.AGV_TakeFinish.ObjToInt())
                    {
                        Dt_AGVStationInfo? aGVStationInfo = null;
                        if (wmsTask.CurrentAddress== "603" || wmsTask.CurrentAddress == "613" || wmsTask.CurrentAddress == "102" || wmsTask.CurrentAddress == "614" || wmsTask.CurrentAddress == "615" || wmsTask.CurrentAddress == "604" || wmsTask.CurrentAddress == "605")
                        {
                            aGVStationInfo = _basicRepository.AGVStationInfoRepository.QueryFirst(x=>x.AGVStationCode==wmsTask.CurrentAddress);
                        }
                        else
                        {
                            aGVStationInfo= _basicRepository.AGVStationInfoRepository.QueryFirst(x => x.MESPointCode == wmsTask.CurrentAddress);
                        }
                        MESRecepNoticeModel mESRecepNoticeModel = new MESRecepNoticeModel()
                        {
                            WorkCentreEmptyPalletNotice = new List<RecepNotice>()
                            {
                                new RecepNotice()
                                {
                                    LocationCode = aGVStationInfo.MESPointCode,
                                    CompleteFlag=true
                                }
                            }
                        };
                    }
                    //推送ERP半成品入库
                    if (wmsTask.TaskType>=TaskTypeEnum.WFBYLInbound.ObjToInt() && wmsTask.TaskType <= TaskTypeEnum.PrintYLInbound.ObjToInt() && wmsTask.TaskStatus==TaskStatusEnum.AGV_TakeFinish.ObjToInt())
                    {
                        Dt_StockInfo stockInfo = _stockRepository.StockInfoRepository.QueryFirst(x=>x.PalletCode== wmsTask.PalletCode);
@@ -126,6 +152,13 @@
                                }
                            }) ?? throw new Exception("半成品入库接口请求失败");
                    }
                    //成品入库更新托盘条码
                    if (wmsTask.TaskType == TaskTypeEnum.InProduct.ObjToInt() && oldPalletCode!=task.PalletCode)
                    {
                        Dt_ProStockInfo stockInfo = _stockRepository.ProStockInfoRepository.QueryFirst(x => x.PalletCode == oldPalletCode);
                        stockInfo.PalletCode = task.PalletCode;
                        _stockRepository.ProStockInfoRepository.UpdateData(stockInfo);
                    }
                }
                return WebResponseContent.Instance.OK();
            }