| | |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Common.OrderEnum; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_Core.BaseServices; |
| | |
| | | { |
| | | return webResponse = WebResponseContent.Instance.Error($"æªæ¾å°å¯¹åºçåºåºåä¿¡æ¯"); |
| | | } |
| | | |
| | | if(outboundOrder.OrderType == InOrderTypeEnum.ReCheck.ObjToInt() || outboundOrder.CreateType == OrderCreateTypeEnum.CreateInSystem.ObjToInt()) |
| | | { |
| | | return webResponse = WebResponseContent.Instance.OK($"è¯¥åæ®æ éåä¼ MES"); |
| | | } |
| | | List<Dt_MesReturnRecord> returnRecords = BaseDal.QueryData(x => x.OrderNo == orderNo && x.OrderId == outboundOrder.Id && x.ReturnStatus == 2); |
| | | |
| | | foreach (var item in returnRecords) |
| | |
| | | |
| | | if (returnDTO.Details.Count <= 0) |
| | | { |
| | | return webResponse = WebResponseContent.Instance.Error($"è¯¥åæ®æ æç»å¯åä¼ "); |
| | | if (returnRecords.Count() == returnRecords.Count(x => x.ReturnStatus == 1)) |
| | | { |
| | | outboundOrder.ReturnToMESStatus = 1; |
| | | } |
| | | else if (returnRecords.Count(x => x.ReturnStatus == 2) > 0) |
| | | { |
| | | outboundOrder.ReturnToMESStatus = 4; |
| | | } |
| | | else if (returnRecords.Count() == returnRecords.Count(x => x.ReturnStatus == 2)) |
| | | { |
| | | outboundOrder.ReturnToMESStatus = 2; |
| | | } |
| | | _outboundOrderRepository.UpdateData(outboundOrder); |
| | | |
| | | |
| | | return webResponse = WebResponseContent.Instance.OK($"è¯¥åæ®æ²¡æéè¦åä¼ æç»ï¼å¤±è´¥æ°æ®åä¼ {returnRecords.Count()}æ¡ï¼åä¼ æå{returnRecords.Count(x=>x.ReturnStatus == 1)}æ¡ï¼åä¼ å¤±è´¥{returnRecords.Count(x => x.ReturnStatus == 2)}æ¡"); |
| | | |
| | | } |
| | | |
| | | string apiUrl = AppSettings.GetValue("MaterialOutboundFeedbackUrl"); |
| | |
| | | |
| | | if (returnDTO.Details.Count <= 0) |
| | | { |
| | | return webResponse = WebResponseContent.Instance.Error($"è¯¥åæ®æ æç»å¯åä¼ "); |
| | | if(returnRecords.Count() == returnRecords.Count(x => x.ReturnStatus == 1)) |
| | | { |
| | | outboundOrder.ReturnToMESStatus = 1; |
| | | } |
| | | else if(returnRecords.Count(x => x.ReturnStatus == 2)>0) |
| | | { |
| | | outboundOrder.ReturnToMESStatus = 4; |
| | | } |
| | | else if (returnRecords.Count() == returnRecords.Count(x => x.ReturnStatus == 2)) |
| | | { |
| | | outboundOrder.ReturnToMESStatus = 2; |
| | | } |
| | | _outboundOrderRepository.UpdateData(outboundOrder); |
| | | |
| | | |
| | | return webResponse = WebResponseContent.Instance.OK($"è¯¥åæ®æ²¡æéè¦åä¼ æç»ï¼å¤±è´¥æ°æ®åä¼ {returnRecords.Count()}æ¡ï¼åä¼ æå{returnRecords.Count(x => x.ReturnStatus == 1)}æ¡ï¼åä¼ å¤±è´¥{returnRecords.Count(x => x.ReturnStatus == 2)}æ¡"); |
| | | } |
| | | |
| | | string apiUrl = AppSettings.GetValue("AllocationFeedbackUrl"); ; |
| | | string apiUrl = AppSettings.GetValue("AllocationFeedbackUrl"); |
| | | returnDTO.ReqCode = reqCode; |
| | | returnDTO.ReqTime = reqTime; |
| | | JsonSerializerSettings settings = new JsonSerializerSettings |
| | |
| | | |
| | | _unitOfWorkManage.CommitTran(); |
| | | int successCount = returnRecords.Where(x => x.ReturnStatus == 1).Count() + (isSuccess ? 1 : 0); |
| | | int failCount = returnRecords.Where(x => x.ReturnStatus == 2).Count() + (isSuccess ? 1 : 0); |
| | | int failCount = returnRecords.Where(x => x.ReturnStatus == 2).Count() + (!isSuccess ? 1 : 0); |
| | | |
| | | webResponse.Status = true; |
| | | webResponse.Message = $"åè°æåæ¡æ°ï¼{successCount}ï¼åè°å¤±è´¥æ¡æ°ï¼{failCount}"; |