|
|
@ -16,10 +16,33 @@ namespace BBWYB.Server.Business |
|
|
|
|
|
|
|
public void RepairPurchaseExpressOrder() |
|
|
|
{ |
|
|
|
|
|
|
|
var purchaseExpressOrderList = fsql.Select<PurchaseExpressOrder>().Where(peo => !string.IsNullOrEmpty(peo.PurchaseOrderId)).ToList(); |
|
|
|
var wayBillNos = purchaseExpressOrderList.Select(peo => peo.WaybillNo).ToList(); |
|
|
|
var relationList = fsql.Select<ExpressOrderRelationInfo>().Where(eori => wayBillNos.Contains(eori.WayBillNo)).ToList(); |
|
|
|
|
|
|
|
List<ExpressOrderRelationInfo> insertExpressOrderRelationInfoList = new List<ExpressOrderRelationInfo>(); |
|
|
|
foreach (var peo in purchaseExpressOrderList) |
|
|
|
{ |
|
|
|
var relation = relationList.FirstOrDefault(r => r.WayBillNo == peo.WaybillNo && r.PurchaseOrderId == peo.PurchaseOrderId); |
|
|
|
if (relation != null) |
|
|
|
continue; |
|
|
|
insertExpressOrderRelationInfoList.Add(new ExpressOrderRelationInfo() |
|
|
|
{ |
|
|
|
Id = idGenerator.NewLong(), |
|
|
|
CreateTime = DateTime.Now, |
|
|
|
OrderId = peo.OrderId, |
|
|
|
PurchaseOrderId = peo.PurchaseOrderId, |
|
|
|
ShopId = peo.ShopId, |
|
|
|
WayBillNo = peo.WaybillNo |
|
|
|
}); |
|
|
|
} |
|
|
|
fsql.Transaction(() => |
|
|
|
{ |
|
|
|
fsql.Insert(insertExpressOrderRelationInfoList).ExecuteAffrows(); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
public void SubscribeKD100(string waybillNo,string targetCompanyCode) |
|
|
|
public void SubscribeKD100(string waybillNo, string targetCompanyCode) |
|
|
|
{ |
|
|
|
kuaiDi100Manager.SubscribeKuaiDi100(waybillNo, targetCompanyCode, "http://bbwyb.qiyue666.com/api/purchaseorder/kuaidi100publish"); |
|
|
|
} |
|
|
|