| | |
| | | using WIDESEA_DTO.MES; |
| | | using WIDESEA_DTO.Outbound; |
| | | using Microsoft.IdentityModel.Tokens; |
| | | using OfficeOpenXml.FormulaParsing.Excel.Functions.RefAndLookup; |
| | | |
| | | namespace WIDESEA_TaskInfoService |
| | | { |
| | |
| | | x.Status=OutLockStockStatusEnum.åºåºå®æ.ObjToInt(); |
| | | }); |
| | | _outboundRepository.OutStockLockInfoRepository.UpdateData(outStockLockInfos); |
| | | _outboundService.OutLineViewService.SaveLineView(outStockLockInfos); |
| | | List<Dt_OutStockLockInfo> outStockLockInfosSG = outStockLockInfos.Where(x => x.OrderType == OutOrderTypeEnum.OutSGPick.ObjToInt()).ToList(); |
| | | List<Dt_OutStockLockInfo> outStockLockInfosMES = outStockLockInfos.Where(x => x.OrderType == OutOrderTypeEnum.OutMESPick.ObjToInt()).ToList(); |
| | | if (outStockLockInfosSG !=null && outStockLockInfosSG.Count()>0) |
| | | { |
| | | _outboundService.OutLineViewService.SaveLineView(outStockLockInfosSG); |
| | | } |
| | | if (outStockLockInfosMES != null && outStockLockInfosMES.Count() > 0) |
| | | { |
| | | Dt_AGVStationInfo aGVStationInfo = _basicRepository.AGVStationInfoRepository.QueryFirst(x=>x.AGVStationCode==task.TargetAddress); |
| | | MESDeliveryModel mESDeliveryModel = MESDeliveryUp(outStockLockInfosMES, aGVStationInfo.MESPointCode); |
| | | MESResponse response = _invokeMESService.MESDelivery(mESDeliveryModel).DeserializeObject<MESResponse>() ?? throw new Exception("æªè·åå°è¿åä¿¡æ¯"); |
| | | if (!response.Result) |
| | | { |
| | | throw new Exception($"MESé
éåºåæ¥å£è°ç¨æ¥é,MESè¿åä¿¡æ¯{DecodeUnicode(response.Msg)}"); |
| | | } |
| | | } |
| | | } |
| | | _basicService.LocationInfoService.UpdateLocationStatus(locationInfoStart, stockInfo.PalletType, LocationStatusEnum.Free, stockInfo.WarehouseId); |
| | | BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId > 0 ? OperateTypeEnum.äººå·¥å®æ : OperateTypeEnum.èªå¨å®æ); |
| | |
| | | _unitOfWorkManage.RollbackTran(); |
| | | return content.Error(ex.Message); |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// é
ééè¾¾ä¿¡æ¯ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public MESDeliveryModel MESDeliveryUp(List<Dt_OutStockLockInfo> outStockLockInfos,string address) |
| | | { |
| | | MESDeliveryModel mESDeliveryModel = new MESDeliveryModel() |
| | | { |
| | | PRO_DispatchPlanMaterialsInfoNew= new List<MESDeliveryInfo>() |
| | | }; |
| | | foreach (var item in outStockLockInfos) |
| | | { |
| | | MESDeliveryInfo mESDeliveryInfo = new MESDeliveryInfo() |
| | | { |
| | | InvItemCode=item.MaterielCode, |
| | | DispatchPlanMaterialId=item.OrderDetailId, |
| | | UnitCode=item.Unit, |
| | | GradeCode="001", |
| | | MainQuantity=item.AssignQuantity, |
| | | AssistUnitCode=item.AssistUnit, |
| | | LocationCode= address, |
| | | LotNumber=item.BatchNo, |
| | | MaterialBarCode=item.PalletCode |
| | | }; |
| | | mESDeliveryModel.PRO_DispatchPlanMaterialsInfoNew.Add(mESDeliveryInfo); |
| | | } |
| | | return mESDeliveryModel; |
| | | } |
| | | /// <summary> |
| | | /// åºåæ°æ®è½¬åºåºä»»å¡(åæ/åæå) |
| | |
| | | MaterielCode = stockInfo.MaterielCode, |
| | | RfidCode = stockInfo.RfidCode, |
| | | Quantity = stockInfo.StockLength, |
| | | OrderNo= outStockLockInfo.OrderNo |
| | | OrderNo= outStockLockInfo.OrderNo, |
| | | DispatchPlanId=outStockLockInfo.OrderDetailId, |
| | | WorkCentreCode=outStockLockInfo.MakeCode |
| | | }; |
| | | if (stockInfo.MaterielWide > 0) |
| | | { |
| | |
| | | Dt_MakeCenterInfo makeCenterInfo=makeCenterInfos.FirstOrDefault(x => x.MakeCode == item.MakeCode); |
| | | item.MakeArea = makeCenterInfo.MakeArea; |
| | | item.WarehouseId = materielInfo.WarehouseId; |
| | | item.MaterielUnit = materielInfo.MaterielUnit; |
| | | item.AssistUnitCode = materielInfo.AssistUnitCode; |
| | | } |
| | | |
| | | _unitOfWorkManage.BeginTran(); |