雷神教育集团
2026-03-06 f2392d984123a1402d6c9bab9e5452c7becc8d22
ÏîÄ¿´úÂë/WMS/WMSServices/WIDESEA_TaskInfoService/TaskService_Completed.cs
@@ -108,19 +108,22 @@
                    wmsTask.Dispatchertime = task.Dispatchertime;
                    wmsTask.TaskType = task.TaskType;
                    wmsTask.TargetAddress = task.TargetAddress;
                    ////成品入库更新托盘条码
                    //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);
                    //}
                    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);
                        }
                        aGVStationInfo = _basicRepository.AGVStationInfoRepository.QueryFirst(x=>x.AGVStationCode==wmsTask.CurrentAddress || x.MESPointCode == wmsTask.CurrentAddress);
                        MESRecepNoticeModel mESRecepNoticeModel = new MESRecepNoticeModel()
                        {
                            WorkCentreEmptyPalletNotice = new List<RecepNotice>()
@@ -132,33 +135,28 @@
                                }
                            }
                        };
                        //推送MES接驳
                        //_invokeMESService.MESRecepNotice(mESRecepNoticeModel);
                    }
                    //推送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);
                        string request = _invokeERPService.ERPSemiProInUp(
                            new ERPProInUpModel()
                            {
                                PB_INV_PRODUCT_IN = new List<PB_INV_PRODUCT_INItem>()
                                {
                                    new PB_INV_PRODUCT_INItem()
                                    {
                                        WP_ID = 0,
                                        INV_BARCODE = wmsTask.PalletCode,
                                        REMARK = "半成品入库",
                                        QTY=(int)stockInfo.StockLength
                                    }
                                }
                            }) ?? 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);
                    }
                    //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);
                    //    string request = _invokeERPService.ERPSemiProInUp(
                    //        new ERPProInUpModel()
                    //        {
                    //            PB_INV_PRODUCT_IN = new List<PB_INV_PRODUCT_INItem>()
                    //            {
                    //                new PB_INV_PRODUCT_INItem()
                    //                {
                    //                    WP_ID = 0,
                    //                    INV_BARCODE = wmsTask.PalletCode,
                    //                    REMARK = "半成品入库",
                    //                    QTY=(int)stockInfo.StockLength
                    //                }
                    //            }
                    //        }) ?? throw new Exception("半成品入库接口请求失败");
                    //}
                }
                return WebResponseContent.Instance.OK();
            }