public static InTrackingLogInfo GenerateInTrackingLogInfoFUB(WayBillEventLogExt wayBillEventLogExt) { wayBillEventLogExt.LastUpdatedOn = DateTime.Now; wayBillEventLogExt.TrackingLogCreated = true; InTrackingLogInfo inTrackingLogInfo = new InTrackingLogInfo() { WayBillNumber = wayBillEventLogExt.WayBillNumber, ProcessDate = wayBillEventLogExt.EventDate, CreatedOn = DateTime.Now, LastUpdatedOn = DateTime.Now, CreatedBy = wayBillEventLogExt.Operator, LastUpdatedBy = wayBillEventLogExt.Operator, Remarks = wayBillEventLogExt.Remarks, }; if (wayBillEventLogExt.EventCode == (int)WayBillEvent.EventCodeEnum.Submit) { inTrackingLogInfo.ProcessContent = "运单已生成"; inTrackingLogInfo.ProcessLocation = "深圳 - 中国"; } else if (wayBillEventLogExt.EventCode == (int)WayBillEvent.EventCodeEnum.InStorage) { inTrackingLogInfo.ProcessContent = "货物入库扫描 "; inTrackingLogInfo.ProcessLocation = "深圳 - 中国"; } else if (wayBillEventLogExt.EventCode == (int)WayBillEvent.EventCodeEnum.OutStorage) { inTrackingLogInfo.ProcessContent = "货物出库扫描"; inTrackingLogInfo.ProcessLocation = "深圳 - 中国"; } else if (wayBillEventLogExt.EventCode == (int)WayBillEvent.EventCodeEnum.ReturnGood) { inTrackingLogInfo.ProcessContent = "已退货"; inTrackingLogInfo.ProcessLocation = "深圳 - 中国"; } else if (wayBillEventLogExt.EventCode == 610 || wayBillEventLogExt.EventCode == 620 || wayBillEventLogExt.EventCode == 630 || wayBillEventLogExt.EventCode == 635 || wayBillEventLogExt.EventCode == 636) { inTrackingLogInfo.ProcessContent = wayBillEventLogExt.Description; inTrackingLogInfo.ProcessLocation = "福州 - 中国"; } else if (wayBillEventLogExt.EventCode == 640 || wayBillEventLogExt.EventCode == 650) { inTrackingLogInfo.ProcessContent = wayBillEventLogExt.Description; inTrackingLogInfo.ProcessLocation = "台湾"; } else if (wayBillEventLogExt.EventCode == 660) { inTrackingLogInfo.ProcessContent = wayBillEventLogExt.Description; inTrackingLogInfo.ProcessLocation = Regex.Match(wayBillEventLogExt.Description, "((.*?))").Groups[1].Value; } else { inTrackingLogInfo = null; } return(inTrackingLogInfo); }
public static InTrackingLogInfo GenerateInTrackingLogInfoCommon(WayBillEventLogExt wayBillEventLogExt) { wayBillEventLogExt.LastUpdatedOn = DateTime.Now; wayBillEventLogExt.TrackingLogCreated = true; InTrackingLogInfo inTrackingLogInfo = new InTrackingLogInfo() { WayBillNumber = wayBillEventLogExt.WayBillNumber, ProcessDate = wayBillEventLogExt.EventDate, CreatedOn = DateTime.Now, LastUpdatedOn = DateTime.Now, CreatedBy = wayBillEventLogExt.Operator, LastUpdatedBy = wayBillEventLogExt.Operator, }; if (wayBillEventLogExt.EventCode == (int)WayBillEvent.EventCodeEnum.Submit) { inTrackingLogInfo.ProcessContent = "Order Processing"; inTrackingLogInfo.ProcessLocation = "SHENZHEN - CHINA"; } else if (wayBillEventLogExt.EventCode == (int)WayBillEvent.EventCodeEnum.InStorage) { inTrackingLogInfo.ProcessContent = "Shipment picked up"; inTrackingLogInfo.ProcessLocation = "SHENZHEN - CHINA"; } else if (wayBillEventLogExt.EventCode == (int)WayBillEvent.EventCodeEnum.OutStorage) { inTrackingLogInfo.ProcessContent = "OutStorage Scan"; inTrackingLogInfo.ProcessLocation = "SHENZHEN - CHINA"; } else if (wayBillEventLogExt.EventCode == (int)WayBillEvent.EventCodeEnum.ReturnGood) { inTrackingLogInfo.ProcessContent = "Returned to Sender"; inTrackingLogInfo.ProcessLocation = "SHENZHEN - CHINA"; } else { inTrackingLogInfo = null; } return(inTrackingLogInfo); }
public static InTrackingLogInfo GenerateInTrackingLogInfoGdm(WayBillEventLogExt wayBillEventLogExt) { wayBillEventLogExt.LastUpdatedOn = DateTime.Now; InTrackingLogInfo inTrackingLogInfo = new InTrackingLogInfo() { WayBillNumber = wayBillEventLogExt.WayBillNumber, ProcessDate = wayBillEventLogExt.EventDate, CreatedOn = DateTime.Now, LastUpdatedOn = DateTime.Now, CreatedBy = wayBillEventLogExt.Operator, LastUpdatedBy = wayBillEventLogExt.Operator, }; if (wayBillEventLogExt.EventCode == (int)WayBillEvent.EventCodeEnum.Submit) { inTrackingLogInfo.ProcessContent = "Shipment information received"; inTrackingLogInfo.ProcessLocation = "SHENZHEN - CHINA"; wayBillEventLogExt.TrackingLogCreated = true; } else if (wayBillEventLogExt.EventCode == (int)WayBillEvent.EventCodeEnum.InStorage) { inTrackingLogInfo.ProcessContent = "Arrived at Sort Facility"; inTrackingLogInfo.ProcessLocation = "SHENZHEN - CHINA"; wayBillEventLogExt.TrackingLogCreated = true; } else if (wayBillEventLogExt.EventCode == (int)WayBillEvent.EventCodeEnum.OutStorage) { if (!wayBillEventLogExt.TrackingLogProgress.HasValue) { inTrackingLogInfo.ProcessContent = "Shipment had sent to HONG KONG"; inTrackingLogInfo.ProcessLocation = "SHENZHEN - CHINA"; wayBillEventLogExt.TrackingLogProgress = 1; } else if ((wayBillEventLogExt.Status == (int)WayBill.StatusEnum.Send || wayBillEventLogExt.Status == (int)WayBill.StatusEnum.WaitOrder || wayBillEventLogExt.Status == (int)WayBill.StatusEnum.Delivered) && wayBillEventLogExt.TrackingLogProgress.Value == 1 && (DateTime.Now - wayBillEventLogExt.EventDate).TotalDays > 1) { inTrackingLogInfo.ProcessContent = "Processed at HONG KONG"; inTrackingLogInfo.ProcessLocation = "HONGKONG - HONGKONG"; inTrackingLogInfo.ProcessDate = wayBillEventLogExt.EventDate.AddDays(1).AddMilliseconds(new Random().Next(-2 * 60 * 60 * 1000, 2 * 60 * 60 * 1000)); wayBillEventLogExt.TrackingLogProgress = 2; } else if ((wayBillEventLogExt.Status == (int)WayBill.StatusEnum.Send || wayBillEventLogExt.Status == (int)WayBill.StatusEnum.WaitOrder || wayBillEventLogExt.Status == (int)WayBill.StatusEnum.Delivered) && wayBillEventLogExt.TrackingLogProgress.Value == 2 && (DateTime.Now - wayBillEventLogExt.EventDate).TotalDays > 2) { inTrackingLogInfo.ProcessContent = "Ready for boarding"; inTrackingLogInfo.ProcessLocation = "HONGKONG - HONGKONG"; inTrackingLogInfo.ProcessDate = wayBillEventLogExt.EventDate.AddDays(2).AddMilliseconds(new Random().Next(-2 * 60 * 60 * 1000, 2 * 60 * 60 * 1000)); wayBillEventLogExt.TrackingLogProgress = 3; } else if ((wayBillEventLogExt.Status == (int)WayBill.StatusEnum.Send || wayBillEventLogExt.Status == (int)WayBill.StatusEnum.WaitOrder || wayBillEventLogExt.Status == (int)WayBill.StatusEnum.Delivered) && wayBillEventLogExt.TrackingLogProgress.Value == 3 && (DateTime.Now - wayBillEventLogExt.EventDate).TotalDays > 3) { inTrackingLogInfo.ProcessContent = "Arrived at US waiting customs clearance"; inTrackingLogInfo.ProcessLocation = "CVG - USA"; inTrackingLogInfo.ProcessDate = wayBillEventLogExt.EventDate.AddDays(3).AddMilliseconds(new Random().Next(-2 * 60 * 60 * 1000, 2 * 60 * 60 * 1000)).AddHours(-13);//返回CVG当地时间,-5,+8 wayBillEventLogExt.TrackingLogCreated = true; } else { inTrackingLogInfo = null; } } else { inTrackingLogInfo = null; } return(inTrackingLogInfo); }
public static InTrackingLogInfo GenerateInTrackingLogInfoEUD(WayBillEventLogExt wayBillEventLogExt, TotalPackageOutStorageRelationalInfoRepository totalPackageOutStorageRelational) { wayBillEventLogExt.LastUpdatedOn = DateTime.Now; InTrackingLogInfo inTrackingLogInfo = new InTrackingLogInfo() { WayBillNumber = wayBillEventLogExt.WayBillNumber, ProcessDate = wayBillEventLogExt.EventDate, CreatedOn = DateTime.Now, LastUpdatedOn = DateTime.Now, CreatedBy = wayBillEventLogExt.Operator, LastUpdatedBy = wayBillEventLogExt.Operator, }; if (wayBillEventLogExt.EventCode == (int)WayBillEvent.EventCodeEnum.Submit) { inTrackingLogInfo.ProcessContent = "Shipping information received"; inTrackingLogInfo.ProcessLocation = "SHENZHEN - CHINA"; wayBillEventLogExt.TrackingLogCreated = true; } else if (wayBillEventLogExt.EventCode == (int)WayBillEvent.EventCodeEnum.InStorage) { inTrackingLogInfo.ProcessContent = "Arrived at Sort Facility in SHENZHEN"; inTrackingLogInfo.ProcessLocation = "SHENZHEN - CHINA"; wayBillEventLogExt.TrackingLogCreated = true; } else if (wayBillEventLogExt.EventCode == (int)WayBillEvent.EventCodeEnum.OutStorage) { if (!wayBillEventLogExt.TrackingLogProgress.HasValue) { inTrackingLogInfo.ProcessContent = "Departed Facility in SHENZHEN"; inTrackingLogInfo.ProcessLocation = "SHENZHEN - CHINA"; if (totalPackageOutStorageRelational.Exists(r => r.OutStorageID == wayBillEventLogExt.OutStorageID)) { wayBillEventLogExt.TrackingLogCreated = true; } else { wayBillEventLogExt.TrackingLogProgress = 1; } } else if (wayBillEventLogExt.TrackingLogProgress.Value == 1 && (DateTime.Now - wayBillEventLogExt.EventDate).TotalDays > 1) { inTrackingLogInfo.ProcessContent = "Processed at HONG KONG"; inTrackingLogInfo.ProcessLocation = "HONGKONG - HONGKONG"; inTrackingLogInfo.ProcessDate = DateTime.Now.AddMilliseconds(new Random().Next(-2 * 60 * 60 * 1000, 2 * 60 * 60 * 1000)); wayBillEventLogExt.TrackingLogProgress = 2; } else if (wayBillEventLogExt.TrackingLogProgress.Value == 2 && (DateTime.Now - wayBillEventLogExt.EventDate).TotalDays > 2) { inTrackingLogInfo.ProcessContent = "Ready for boarding"; inTrackingLogInfo.ProcessLocation = "HONGKONG - HONGKONG"; inTrackingLogInfo.ProcessDate = DateTime.Now.AddMilliseconds(new Random().Next(-2 * 60 * 60 * 1000, 2 * 60 * 60 * 1000)); wayBillEventLogExt.TrackingLogProgress = 3; } else if (wayBillEventLogExt.TrackingLogProgress.Value == 3 && (DateTime.Now - wayBillEventLogExt.EventDate).TotalDays > 3) { inTrackingLogInfo.ProcessContent = "Arrived at Sort Facility AM, Clearance processing"; inTrackingLogInfo.ProcessLocation = "Amsterdam - Netherlands"; inTrackingLogInfo.ProcessDate = DateTime.Now.AddMilliseconds(new Random().Next(-2 * 60 * 60 * 1000, 2 * 60 * 60 * 1000)); wayBillEventLogExt.TrackingLogProgress = 4; } else if (wayBillEventLogExt.TrackingLogProgress.Value == 4 && (DateTime.Now - wayBillEventLogExt.EventDate).TotalDays > 4 && LocalTimeToEud(DateTime.Now).DayOfWeek != DayOfWeek.Sunday && LocalTimeToEud(DateTime.Now).DayOfWeek != DayOfWeek.Saturday) { if (wayBillEventLogExt.CountryCode == "DE") { inTrackingLogInfo.ProcessContent = "Processed for clearance, To DPWN with delivery courier "; inTrackingLogInfo.ProcessLocation = "Amsterdam - Netherlands"; } else { inTrackingLogInfo.ProcessContent = "Processed for clearance, To PostNL with delivery courier"; inTrackingLogInfo.ProcessLocation = "Amsterdam - Netherlands"; } inTrackingLogInfo.ProcessDate = DateTime.Now.AddMilliseconds(new Random().Next(-2 * 60 * 60 * 1000, 2 * 60 * 60 * 1000)); wayBillEventLogExt.TrackingLogCreated = true; } else { inTrackingLogInfo = null; } } else { inTrackingLogInfo = null; } return(inTrackingLogInfo); }