Browse Source

合并最新

updatebug
506583276@qq.com 2 years ago
parent
commit
0bc0d8b75a
  1. 12
      BBWYB.Server.API/Controllers/PurchaseSchemeController.cs
  2. 35
      BBWYB.Server.Business/PurchaseOrder/PurchaseOrderBusiness.cs
  3. 8
      BBWYB.Server.Business/PurchaseScheme/PurchaseProductAPIService.cs
  4. 35
      BBWYB.Server.Business/PurchaseScheme/PurchaseSchemeBusiness.cs
  5. 7
      BBWYB.Server.Model/Db/Order/OrderPurchaseRelationinfo.cs
  6. 24
      BBWYB.Server.Model/Dto/Request/PurchaseScheme/PurcasheSkuBasicInfoRequest.cs
  7. 4
      BBWYB.Server.Model/Dto/Response/PurchaseScheme/PurchaseProductBasicInfoResponse.cs
  8. 125
      doc/.back_bbwyB端库/bbwyB端库-backup-2023517230151.pdma.json
  9. 87
      doc/bbwyB端库.pdma.json

12
BBWYB.Server.API/Controllers/PurchaseSchemeController.cs

@ -79,5 +79,17 @@ namespace BBWYB.Server.API.Controllers
{
return purchaseSchemeBusiness.GetPurchaseSkuBasicInfo(request);
}
/// <summary>
/// 批量查询采购方案中采购Sku的基本信息
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[HttpPost]
public IList<PurchaseSkuBasicInfoResponse> BatchGetPurchaseSkuBasicInfo([FromBody] BatchPurchaseSkuBasicInfoRequest request)
{
return purchaseSchemeBusiness.BatchGetPurchaseSkuBasicInfo(request);
}
}
}

35
BBWYB.Server.Business/PurchaseOrder/PurchaseOrderBusiness.cs

@ -167,7 +167,6 @@ namespace BBWYB.Server.Business
var deleteOrderCostDetail = fsql.Delete<OrderCostDetail>().Where(ocd => ocd.OrderId == dbOrder.Id);
var isRepurchase = fsql.Select<OrderCost>(dbOrder.Id).Any();
var orderSkus = fsql.Select<OrderSku>().Where(osku => osku.Price != 0 && osku.OrderId == request.OrderId).ToList();
var orderSkuIds = orderSkus.Select(osku => osku.Id).ToList();
var extJArray = JsonConvert.DeserializeObject<JArray>(request.Extensions);
@ -228,6 +227,7 @@ namespace BBWYB.Server.Business
foreach (var cargoParam in cargoParamGroup.CargoParamList)
{
var orderSku = orderSkus.FirstOrDefault(osku => osku.SkuId == cargoParam.BelongSkuId);
insertOrderPurchaseRelationInfoList.Add(new OrderPurchaseRelationInfo()
{
Id = idGenerator.NewLong(),
@ -240,8 +240,7 @@ namespace BBWYB.Server.Business
PurchaseSpecId = cargoParam.SpecId,
Quantity = cargoParam.Quantity,
SchemeId = cargoParam.SchemeId,
SourceSkuId = orderSku?.BelongSkuId
});
}
@ -574,6 +573,11 @@ namespace BBWYB.Server.Business
.WhereIf(purchaseOrderIds.Count() == 1, ops => ops.PurchaseOrderId == purchaseOrderIds[0])
.ToList();
var dbOrderPurchaseRelationInfoList = fsql.Select<OrderPurchaseRelationInfo>()
.WhereIf(purchaseOrderIds.Count() > 1, opr => purchaseOrderIds.Contains(opr.PurchaseOrderId))
.WhereIf(purchaseOrderIds.Count() == 1, opr => opr.PurchaseOrderId == purchaseOrderIds[0])
.ToList();
foreach (var orderEntryId in orderEntryIds)
{
var dbOrderPurchaseSkuInfo = dbOrderPurchaseSkuInfoList.FirstOrDefault(x => x.Id == orderEntryId);
@ -593,7 +597,30 @@ namespace BBWYB.Server.Business
{
var isSignAll = group.Count() == group.Where(x => x.ExpressState == "SIGN").Count();
//通知齐库
#region 通知齐库
var relationList = dbOrderPurchaseRelationInfoList.Where(x => x.PurchaseOrderId == group.Key).ToList();
foreach (var relation in relationList)
{
//通知C端
try
{
restApiService.SendRequest("http://qiku.qiyue666.com",
"/Api/PackPurchaseTask/UpdateAvailabilityState",
new
{
availability = isSignAll ? 0 : 1,
orderId = relation.OrderId,
skuId = relation.SourceSkuId
},
null,
HttpMethod.Post);
}
catch (Exception ex)
{
}
}
#endregion
}
var groupsByOrderIds = dbOrderPurchaseSkuInfoList.GroupBy(x => x.OrderId);

8
BBWYB.Server.Business/PurchaseScheme/PurchaseProductAPIService.cs

@ -126,7 +126,9 @@ namespace BBWYB.Server.Business
Name = purchaserName,
Platform = request.Platform
},
ItemList = list
ItemList = list,
PurchasePlatform = request.Platform,
PurchaseProductId = request.PurchaseProductId
};
}
}
@ -243,7 +245,9 @@ namespace BBWYB.Server.Business
return new PurchaseSkuBasicInfoResponse()
{
ItemList = list,
Purchaser = purchaser
Purchaser = purchaser,
PurchaseProductId = request.PurchaseProductId,
PurchasePlatform = Enums.Platform.
};
}
catch

35
BBWYB.Server.Business/PurchaseScheme/PurchaseSchemeBusiness.cs

@ -259,5 +259,40 @@ namespace BBWYB.Server.Business
{
return purchaseProductAPIService.GetProductInfo(request);
}
public IList<PurchaseSkuBasicInfoResponse> BatchGetPurchaseSkuBasicInfo(BatchPurchaseSkuBasicInfoRequest request)
{
var list = new List<PurchaseSkuBasicInfoResponse>();
foreach (var param in request.Params)
{
foreach (var purchaseId in param.PurchaseProductIds)
{
var response = GetPurchaseSkuBasicInfo(new PurchaseSkuBasicInfoRequest()
{
FirstApiMode = request.FirstApiMode,
PriceMode = request.PriceMode,
Platform = param.Platform,
PurchaseProductId = purchaseId
});
if (response != null)
{
if (param.PurchaseSkuIds != null && param.PurchaseSkuIds.Count() > 0)
{
for (var i = 0; i < response.ItemList.Count(); i++)
{
var skuInfo = response.ItemList[i];
if (!param.PurchaseSkuIds.Any(s => s == skuInfo.PurchaseSkuId))
{
response.ItemList.RemoveAt(i);
i--;
}
}
}
list.Add(response);
}
}
}
return list;
}
}
}

7
BBWYB.Server.Model/Db/Order/OrderPurchaseRelationinfo.cs

@ -64,7 +64,12 @@ namespace BBWYB.Server.Model.Db
/// </summary>
public long? SchemeId { get; set; }
/// <summary>
/// 来源SkuId (JD)
/// </summary>
[Column(StringLength = 100)]
public string SourceSkuId { get; set; }
}
}
}

24
BBWYB.Server.Model/Dto/Request/PurchaseScheme/PurcasheSkuBasicInfoRequest.cs

@ -13,4 +13,28 @@
public Enums.PurchaseProductAPIMode FirstApiMode { get; set; }
}
public class BatchPurchaseSkuBasicInfoRequest
{
public IList<BatchPurchaseSkuBasicInfoParamRequest> Params { get; set; }
public Enums.PurchaseOrderMode PriceMode { get; set; }
public Enums.PurchaseProductAPIMode FirstApiMode { get; set; }
}
public class BatchPurchaseSkuBasicInfoParamRequest
{
public Enums.Platform Platform { get; set; }
/// <summary>
/// 采购商品Id(采购spu)
/// </summary>
public string[] PurchaseProductIds { get; set; }
/// <summary>
/// 需要保留的采购SkuId,如果传递了该数组,将过滤不在该数组的采购sku
/// </summary>
public string[] PurchaseSkuIds { get; set; }
}
}

4
BBWYB.Server.Model/Dto/Response/PurchaseScheme/PurchaseProductBasicInfoResponse.cs

@ -7,6 +7,10 @@ namespace BBWYB.Server.Model.Dto
/// </summary>
public class PurchaseSkuBasicInfoResponse
{
public Enums.Platform PurchasePlatform { get; set; }
public string PurchaseProductId { get; set; }
/// <summary>
/// 采购SKU基础信息列表
/// </summary>

125
doc/.back_bbwyB端库/bbwyB端库-backup-2023517184403.pdma.json → doc/.back_bbwyB端库/bbwyB端库-backup-2023517230151.pdma.json

@ -4,7 +4,7 @@
"avatar": "",
"version": "4.5.1",
"createdTime": "2023-5-12 20:56:05",
"updatedTime": "2023-5-17 18:43:55",
"updatedTime": "2023-5-17 21:50:51",
"dbConns": [],
"profile": {
"default": {
@ -1780,7 +1780,16 @@
"hideInGraph": true
}
],
"correlations": []
"correlations": [
{
"myField": "144B14DF-B01B-4EF7-9163-24A3124BB808",
"refEntity": "3A48F81A-49D5-423B-8A92-228615DCEA6F",
"refField": "31AF4355-53ED-42E2-AB7F-A8AC17D17DBB",
"myRows": "1",
"refRows": "n",
"innerType": ""
}
]
},
{
"id": "C52E23C2-6CC5-4404-92A5-7CCE77E8AB1E",
@ -2134,7 +2143,16 @@
"hideInGraph": true
}
],
"correlations": []
"correlations": [
{
"myField": "E9728883-C797-4973-82A6-58F0DD7306F7",
"refEntity": "3A48F81A-49D5-423B-8A92-228615DCEA6F",
"refField": "31AF4355-53ED-42E2-AB7F-A8AC17D17DBB",
"myRows": "1",
"refRows": "n",
"innerType": ""
}
]
},
{
"id": "93074B87-BE55-41BF-8358-B0E84C4E249A",
@ -2820,7 +2838,16 @@
"hideInGraph": true
}
],
"correlations": [],
"correlations": [
{
"myField": "C972C40D-0C81-455D-8598-37DC80F7A538",
"refEntity": "3A48F81A-49D5-423B-8A92-228615DCEA6F",
"refField": "31AF4355-53ED-42E2-AB7F-A8AC17D17DBB",
"myRows": "1",
"refRows": "n",
"innerType": ""
}
],
"notes": {}
},
{
@ -3331,7 +3358,16 @@
"hideInGraph": true
}
],
"correlations": [],
"correlations": [
{
"myField": "DD093BC7-0374-421D-A4B5-7D471C5444B2",
"refEntity": "3A48F81A-49D5-423B-8A92-228615DCEA6F",
"refField": "31AF4355-53ED-42E2-AB7F-A8AC17D17DBB",
"myRows": "1",
"refRows": "n",
"innerType": ""
}
],
"notes": {}
},
{
@ -3848,7 +3884,16 @@
"hideInGraph": true
}
],
"correlations": [],
"correlations": [
{
"myField": "2CE3E553-81E6-40B3-A711-98A8EBF41716",
"refEntity": "3A48F81A-49D5-423B-8A92-228615DCEA6F",
"refField": "31AF4355-53ED-42E2-AB7F-A8AC17D17DBB",
"myRows": "1",
"refRows": "n",
"innerType": ""
}
],
"notes": {}
},
{
@ -5283,7 +5328,16 @@
"id": "FB279AC5-DB2B-498B-9DC9-5EE05BCED570"
}
],
"correlations": [],
"correlations": [
{
"myField": "1AC7EBFF-8FCC-40C9-A17B-2BACE1030CAB",
"refEntity": "7DC43BAC-F8BC-4423-96C5-4C770CCD6214",
"refField": "36136AA8-299D-4616-8F98-7172BFB06DDB",
"myRows": "1",
"refRows": "n",
"innerType": ""
}
],
"indexes": []
},
{
@ -5612,23 +5666,6 @@
"extProps": {},
"domain": "7CFFA0D3-6A93-4DDC-BC10-DF21211064DC",
"id": "C76F8758-9EEC-4108-9F30-ECE489720FC8"
},
{
"defKey": "PruchaseOrderEntryId",
"defName": "采购Sku订单Id(来自采购平台)",
"comment": "",
"type": "VARCHAR",
"len": 100,
"scale": "",
"primaryKey": false,
"notNull": false,
"autoIncrement": false,
"defaultValue": "",
"hideInGraph": false,
"refDict": "",
"extProps": {},
"domain": "",
"id": "8B25DD45-6396-4F51-969D-EE6FA1CA8719"
}
],
"correlations": [],
@ -6060,16 +6097,6 @@
}
}
},
{
"id": "6593da18-d55c-47e3-bb4c-cf75fc56702a",
"shape": "table",
"position": {
"x": 1690,
"y": 83
},
"count": 0,
"originKey": "03EA3614-C1F5-4909-96A0-0687EDEABD4B"
},
{
"id": "53bec785-6ee3-497e-bfa6-0318b99147db",
"shape": "table",
@ -6091,34 +6118,34 @@
"originKey": "93074B87-BE55-41BF-8358-B0E84C4E249A"
},
{
"id": "2c258cf1-71de-432b-835a-7fe52c849443",
"id": "414ef58f-57e8-4362-971a-85af3ea9a44f",
"shape": "table",
"position": {
"x": 1100,
"x": 390,
"y": -90
},
"count": 0,
"originKey": "7DC43BAC-F8BC-4423-96C5-4C770CCD6214"
"originKey": "3A48F81A-49D5-423B-8A92-228615DCEA6F"
},
{
"id": "471ac35d-30de-48a3-8743-eec20f919eba",
"id": "6593da18-d55c-47e3-bb4c-cf75fc56702a",
"shape": "table",
"position": {
"x": 1100,
"y": 614
"x": 1690,
"y": 83
},
"count": 0,
"originKey": "1ED24FEC-604E-4B36-9E51-17D572021F0C"
"originKey": "03EA3614-C1F5-4909-96A0-0687EDEABD4B"
},
{
"id": "414ef58f-57e8-4362-971a-85af3ea9a44f",
"id": "2c258cf1-71de-432b-835a-7fe52c849443",
"shape": "table",
"position": {
"x": 390,
"x": 1100,
"y": -90
},
"count": 0,
"originKey": "3A48F81A-49D5-423B-8A92-228615DCEA6F"
"originKey": "7DC43BAC-F8BC-4423-96C5-4C770CCD6214"
},
{
"id": "ff369484-e2eb-4af8-9b98-6fd2d9f202f9",
@ -6139,6 +6166,16 @@
},
"count": 0,
"originKey": "EE319D46-61D9-47DB-80AD-AD97D460ACB4"
},
{
"id": "471ac35d-30de-48a3-8743-eec20f919eba",
"shape": "table",
"position": {
"x": 1100,
"y": 614
},
"count": 0,
"originKey": "1ED24FEC-604E-4B36-9E51-17D572021F0C"
}
]
},

87
doc/bbwyB端库.pdma.json

@ -4,7 +4,7 @@
"avatar": "",
"version": "4.5.1",
"createdTime": "2023-5-12 20:56:05",
"updatedTime": "2023-5-17 21:50:51",
"updatedTime": "2023-5-17 23:01:51",
"dbConns": [],
"profile": {
"default": {
@ -1780,16 +1780,7 @@
"hideInGraph": true
}
],
"correlations": [
{
"myField": "144B14DF-B01B-4EF7-9163-24A3124BB808",
"refEntity": "3A48F81A-49D5-423B-8A92-228615DCEA6F",
"refField": "31AF4355-53ED-42E2-AB7F-A8AC17D17DBB",
"myRows": "1",
"refRows": "n",
"innerType": ""
}
]
"correlations": []
},
{
"id": "C52E23C2-6CC5-4404-92A5-7CCE77E8AB1E",
@ -2143,16 +2134,7 @@
"hideInGraph": true
}
],
"correlations": [
{
"myField": "E9728883-C797-4973-82A6-58F0DD7306F7",
"refEntity": "3A48F81A-49D5-423B-8A92-228615DCEA6F",
"refField": "31AF4355-53ED-42E2-AB7F-A8AC17D17DBB",
"myRows": "1",
"refRows": "n",
"innerType": ""
}
]
"correlations": []
},
{
"id": "93074B87-BE55-41BF-8358-B0E84C4E249A",
@ -2838,16 +2820,7 @@
"hideInGraph": true
}
],
"correlations": [
{
"myField": "C972C40D-0C81-455D-8598-37DC80F7A538",
"refEntity": "3A48F81A-49D5-423B-8A92-228615DCEA6F",
"refField": "31AF4355-53ED-42E2-AB7F-A8AC17D17DBB",
"myRows": "1",
"refRows": "n",
"innerType": ""
}
],
"correlations": [],
"notes": {}
},
{
@ -3358,16 +3331,7 @@
"hideInGraph": true
}
],
"correlations": [
{
"myField": "DD093BC7-0374-421D-A4B5-7D471C5444B2",
"refEntity": "3A48F81A-49D5-423B-8A92-228615DCEA6F",
"refField": "31AF4355-53ED-42E2-AB7F-A8AC17D17DBB",
"myRows": "1",
"refRows": "n",
"innerType": ""
}
],
"correlations": [],
"notes": {}
},
{
@ -3884,16 +3848,7 @@
"hideInGraph": true
}
],
"correlations": [
{
"myField": "2CE3E553-81E6-40B3-A711-98A8EBF41716",
"refEntity": "3A48F81A-49D5-423B-8A92-228615DCEA6F",
"refField": "31AF4355-53ED-42E2-AB7F-A8AC17D17DBB",
"myRows": "1",
"refRows": "n",
"innerType": ""
}
],
"correlations": [],
"notes": {}
},
{
@ -5328,16 +5283,7 @@
"id": "FB279AC5-DB2B-498B-9DC9-5EE05BCED570"
}
],
"correlations": [
{
"myField": "1AC7EBFF-8FCC-40C9-A17B-2BACE1030CAB",
"refEntity": "7DC43BAC-F8BC-4423-96C5-4C770CCD6214",
"refField": "36136AA8-299D-4616-8F98-7172BFB06DDB",
"myRows": "1",
"refRows": "n",
"innerType": ""
}
],
"correlations": [],
"indexes": []
},
{
@ -5567,7 +5513,7 @@
},
{
"defKey": "PurchaseSkuId",
"defName": "采购Sku",
"defName": "采购Sku(1688)",
"comment": "",
"type": "VARCHAR",
"len": 100,
@ -5666,6 +5612,23 @@
"extProps": {},
"domain": "7CFFA0D3-6A93-4DDC-BC10-DF21211064DC",
"id": "C76F8758-9EEC-4108-9F30-ECE489720FC8"
},
{
"defKey": "SourceSkuId",
"defName": "来源SkuId(JD)",
"comment": "",
"type": "VARCHAR",
"len": 100,
"scale": "",
"primaryKey": false,
"notNull": false,
"autoIncrement": false,
"defaultValue": "",
"hideInGraph": false,
"refDict": "",
"extProps": {},
"domain": "",
"id": "96780760-1F86-404C-A2A7-94119182FBF5"
}
],
"correlations": [],

Loading…
Cancel
Save