Browse Source

Merge branch 'master' of http://code.qiyue666.com/pengcong001/bbwy

AddValidOverTime
shanji 2 years ago
parent
commit
2aa0fc91e4
  1. 4
      BBWY.Client/BBWYAppSettings.json
  2. 2
      BBWY.Client/GlobalContext.cs
  3. 21
      BBWY.Client/Views/PackTask/WaitPackageControl.xaml
  4. 3
      BBWY.Client/Views/SealBox/SealBoxPolicyDetailsWindow.xaml
  5. 6
      BBWY.Client/Views/SealBox/SealBoxPolicyDetailsWindow.xaml.cs
  6. 3
      BBWY.Client/Views/SealBox/SealBoxPrintDetailsWindow.xaml.cs
  7. 4
      BBWY.JDSDK/Request/SkuWriteUpdateSkusRequest.cs
  8. 127
      BBWY.Server.Business/PlatformSDK/JDBusiness.cs
  9. 3
      BBWY.Server.Business/PlatformSDK/PlatformSDKBusiness.cs
  10. 16
      BBWY.Server.Model/Dto/Request/JD/GetStockNumBySkuRequest.cs
  11. 2
      BBWY.Server.Model/Dto/Request/Product/SearchProductSkuRequest.cs
  12. 3
      JD.API/Controllers/PlatformSDKController.cs

4
BBWY.Client/BBWYAppSettings.json

@ -4,6 +4,6 @@
"MDSApiHost": "http://mdsapi.qiyue666.com", "MDSApiHost": "http://mdsapi.qiyue666.com",
"JOSApiHost": "", "JOSApiHost": "",
"1688ApiHost": "", "1688ApiHost": "",
//"QKApiHost": "http://localhost:8080" "QKApiHost": "http://localhost:8080"
"QKApiHost": "http://qiku.qiyue666.com" // "QKApiHost": "http://qiku.qiyue666.com"
} }

2
BBWY.Client/GlobalContext.cs

@ -13,7 +13,7 @@ namespace BBWY.Client
{ {
ShopServiceGroupList = new List<string>(); ShopServiceGroupList = new List<string>();
ShopServiceGroupLowerList = new List<string>(); ShopServiceGroupLowerList = new List<string>();
ClientVersion = "10187"; ClientVersion = "10188";
} }
private User user; private User user;

21
BBWY.Client/Views/PackTask/WaitPackageControl.xaml

@ -249,7 +249,7 @@
Command="{Binding DataContext.CopyTextCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type UserControl}}}" Command="{Binding DataContext.CopyTextCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type UserControl}}}"
CommandParameter="{Binding ShopName}" CommandParameter="{Binding ShopName}"
Margin=" 5,0,0,0"/> Margin=" 5,0,0,0"/>
<StackPanel Orientation="Horizontal" Visibility="{Binding OrderId, Converter={StaticResource objConverter},ConverterParameter=#null:Visible:Collapsed}"> <StackPanel Orientation="Horizontal" >
<TextBlock VerticalAlignment="Center" Text="对接人:" Margin="16,0,0,0" /> <TextBlock VerticalAlignment="Center" Text="对接人:" Margin="16,0,0,0" />
<TextBlock VerticalAlignment="Center" Text="{Binding AcceptName}" Margin="5,0,0,0" /> <TextBlock VerticalAlignment="Center" Text="{Binding AcceptName}" Margin="5,0,0,0" />
</StackPanel> </StackPanel>
@ -480,7 +480,7 @@
</Grid>--> </Grid>-->
<Grid Grid.Column="8"> <Grid Grid.Column="8">
<Grid> <StackPanel Orientation="Vertical" VerticalAlignment="Center" >
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center" <StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center"
Visibility="{Binding FeesItemResponse,Converter={StaticResource objConverter},ConverterParameter=#null:Collapsed:Visible }" Visibility="{Binding FeesItemResponse,Converter={StaticResource objConverter},ConverterParameter=#null:Collapsed:Visible }"
@ -510,7 +510,22 @@
</Path.ToolTip> </Path.ToolTip>
</Path> </Path>
</StackPanel> </StackPanel>
</Grid>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0 10 0 0 ">
<TextBlock Foreground="{StaticResource Text.Gray}" TextTrimming="CharacterEllipsis">
<TextBlock.ToolTip>
<ToolTip Style="{StaticResource OrderCouponToolipStyle}">
<TextBlock Text="{Binding PackUser}"/>
</ToolTip>
</TextBlock.ToolTip>
<Run Text="包装员:"/>
<Run Text="{Binding PackUser}"/>
</TextBlock>
</StackPanel>
</StackPanel>
</Grid> </Grid>
<Grid Grid.Column="9"> <Grid Grid.Column="9">

3
BBWY.Client/Views/SealBox/SealBoxPolicyDetailsWindow.xaml

@ -40,6 +40,9 @@
<TextBlock Text="仓库:" Margin="50 0 0 0"/> <TextBlock Text="仓库:" Margin="50 0 0 0"/>
<TextBlock Text="{Binding WareName}"/> <TextBlock Text="{Binding WareName}"/>
<TextBlock Text="对接人:" Margin="50 0 0 0"/>
<TextBlock Text="{Binding AcceptUserName}"/>
</StackPanel> </StackPanel>
<Grid Grid.Row="2" > <Grid Grid.Row="2" >

6
BBWY.Client/Views/SealBox/SealBoxPolicyDetailsWindow.xaml.cs

@ -24,13 +24,14 @@ namespace BBWY.Client.Views.SealBox
/// </summary> /// </summary>
public partial class SealBoxPolicyDetailsWindow : BWindow public partial class SealBoxPolicyDetailsWindow : BWindow
{ {
public SealBoxPolicyDetailsWindow(List<WareSealBoxSku> sealBoxSkus, string shopName, string wareName, long sealBoxId) public SealBoxPolicyDetailsWindow(List<WareSealBoxSku> sealBoxSkus, string shopName, string wareName, long sealBoxId,string acceptUserName)
{ {
InitializeComponent(); InitializeComponent();
this.DataContext = this; this.DataContext = this;
SealBoxSkus = sealBoxSkus; SealBoxSkus = sealBoxSkus;
ShopName = shopName; ShopName = shopName;
WareName = wareName; WareName = wareName;
AcceptUserName = acceptUserName;
SealBoxId = sealBoxId; SealBoxId = sealBoxId;
this.UpdateLayout(); this.UpdateLayout();
} }
@ -43,6 +44,9 @@ namespace BBWY.Client.Views.SealBox
public string ShopName { get; set; } public string ShopName { get; set; }
public string WareName { get; set; } public string WareName { get; set; }
public string AcceptUserName { get; set; }
public long SealBoxId { get; set; } public long SealBoxId { get; set; }
public void PrintBox(string printName) public void PrintBox(string printName)

3
BBWY.Client/Views/SealBox/SealBoxPrintDetailsWindow.xaml.cs

@ -149,7 +149,8 @@ namespace BBWY.Client.Views.SealBox
{ {
App.Current.Dispatcher.Invoke(new Action(() => App.Current.Dispatcher.Invoke(new Action(() =>
{ {
SealBoxPolicyDetailsWindow policyDetailsWindow = new SealBoxPolicyDetailsWindow(sealBoxSkus, SealBoxModel.ShopName, SealBoxModel.WareName, SealBoxModel.SealBoxId); SealBoxPolicyDetailsWindow policyDetailsWindow = new SealBoxPolicyDetailsWindow(sealBoxSkus, SealBoxModel.ShopName, SealBoxModel.WareName, SealBoxModel.SealBoxId, SealBoxModel.AcceptUserName);
//policyDetailsWindow.Show();
policyDetailsWindow.PrintBox(PrintName); policyDetailsWindow.PrintBox(PrintName);
})); }));

4
BBWY.JDSDK/Request/SkuWriteUpdateSkusRequest.cs

@ -43,6 +43,8 @@ namespace Jd.Api.Request
public List<SkuWriteUpdateSkusItemSaleAttrs> multiCateProps { get; set; } public List<SkuWriteUpdateSkusItemSaleAttrs> multiCateProps { get; set; }
public int? promiseId { get; set; } public int? promiseId { get; set; }
public string saleAttrTemplateId { get; set; }
} }
public class SkuWriteUpdateSkusItemSaleAttrs public class SkuWriteUpdateSkusItemSaleAttrs
@ -57,5 +59,7 @@ namespace Jd.Api.Request
public List<string> attrValueAlias { get; set; } public List<string> attrValueAlias { get; set; }
public int index { get; set; } public int index { get; set; }
public List<int?> attrValuesSeqNo { get; set; }
} }
} }

127
BBWY.Server.Business/PlatformSDK/JDBusiness.cs

@ -3,6 +3,7 @@ using BBWY.Common.Models;
using BBWY.JDSDK.Request; using BBWY.JDSDK.Request;
using BBWY.Server.Model; using BBWY.Server.Model;
using BBWY.Server.Model.Dto; using BBWY.Server.Model.Dto;
using BBWY.Server.Model.Dto.Request.JD;
using Jd.ACES; using Jd.ACES;
using Jd.ACES.Common; using Jd.ACES.Common;
using Jd.Api; using Jd.Api;
@ -725,12 +726,12 @@ namespace BBWY.Server.Business
return (JArray)res.Json["jingdong_eclp_master_queryWarehouse_responce"]["querywarehouse_result"]; return (JArray)res.Json["jingdong_eclp_master_queryWarehouse_responce"]["querywarehouse_result"];
} }
public override JArray GetStockNumBySku(SearchProductSkuRequest request) public override JArray GetStockNumBySku(GetStockNumBySkuRequest request)
{ {
var jdClient = GetJdClient(request.AppKey, request.AppSecret); var jdClient = GetJdClient(request.AppKey, request.AppSecret);
var req = new StockReadFindSkuStockRequest(); var req = new StockReadFindSkuStockRequest();
req.field = string.Join(",", request.Field);
req.skuId = long.Parse(request.Sku); // 10036238533172; //京仓sku req.skuId = long.Parse(request.Sku); // 10036238533172; //京仓sku
var res = jdClient.Execute(req, request.AppToken, DateTime.Now.ToLocalTime()); var res = jdClient.Execute(req, request.AppToken, DateTime.Now.ToLocalTime());
@ -999,7 +1000,7 @@ namespace BBWY.Server.Business
for (var i = 0; i < request.GiftTemplateSkuList.Count(); i++) for (var i = 0; i < request.GiftTemplateSkuList.Count(); i++)
{ {
var giftSku = request.GiftTemplateSkuList[i]; var giftSku = request.GiftTemplateSkuList[i];
var colorProperty = colorSaleAttrs[takeColorIndex]; var colorPropertyValue = colorSaleAttrs[takeColorIndex];
var p = new SkuWriteUpdateSkusItem() var p = new SkuWriteUpdateSkusItem()
{ {
@ -1012,14 +1013,26 @@ namespace BBWY.Server.Business
outerId = $"{request.OuterId}{(i + 1).ToString().PadLeft(3, '0')}", outerId = $"{request.OuterId}{(i + 1).ToString().PadLeft(3, '0')}",
saleAttrs = new List<SkuWriteUpdateSkusItemSaleAttrs>() saleAttrs = new List<SkuWriteUpdateSkusItemSaleAttrs>()
{ {
new SkuWriteUpdateSkusItemSaleAttrs() //new SkuWriteUpdateSkusItemSaleAttrs()
//{
// type = "com.jd.pop.ware.ic.api.domain.Prop",
// attrId = colorProperty.Value<string>("attId"),
// attrValues = new List<string>() { colorProperty.Value<string>("id") },
// index = takeColorIndex,
// attrValuesSeqNo = new List<int?>(){ takeColorIndex }
//}
new SkuWriteUpdateSkusItemSaleAttrs()
{ {
type = "com.jd.pop.ware.ic.api.domain.Prop", type = "com.jd.pop.ware.ic.api.domain.Prop",
attrId = colorProperty.Value<string>("attId"), attrId = colorPropertyValue.Value<string>("attId"),
attrValues = new List<string>() { colorProperty.Value<string>("id") }, //attrValues = new List<string>() { colorPropertyValue.Value<string>("id") },
index = takeColorIndex attrValueAlias = new List<string>(){ giftSku.Title }, // colorPropertyValue.Value<string>("name")
index = takeColorIndex,
attrValuesSeqNo = new List<int?>(){ takeColorIndex }
} }
} },
saleAttrTemplateId = "POP_MODEL"
//promiseId = 30603710 //固定时效模板Id 48小时发货 //promiseId = 30603710 //固定时效模板Id 48小时发货
}; };
@ -1036,26 +1049,26 @@ namespace BBWY.Server.Business
} }
} }
//修改标题参数 ////修改标题参数
updateSkuTitleParamList.Add(new WareWriteUpdateWareSaleAttrvalueAliasRequestItem() //updateSkuTitleParamList.Add(new WareWriteUpdateWareSaleAttrvalueAliasRequestItem()
{ //{
attrId = p.saleAttrs[0].attrId, // attrId = p.saleAttrs[0].attrId,
attrValues = p.saleAttrs[0].attrValues, // attrValues = p.saleAttrs[0].attrValues,
attrValueAlias = new List<string>() { giftSku.Title } // attrValueAlias = new List<string>() { giftSku.Title }
}); //});
//修改商品细节图参数 ////修改商品细节图参数
var imgUrlBuilder = new StringBuilder(); //var imgUrlBuilder = new StringBuilder();
var imgIndexBuilder = new StringBuilder(); //var imgIndexBuilder = new StringBuilder();
imgUrlBuilder.Append($"{giftSku.Logo.Substring(giftSku.Logo.IndexOf("jfs"))},"); //imgUrlBuilder.Append($"{giftSku.Logo.Substring(giftSku.Logo.IndexOf("jfs"))},");
imgIndexBuilder.Append("1,"); //imgIndexBuilder.Append("1,");
imageWriteUpdateRequestList.Add(new ImageWriteUpdateRequest() //imageWriteUpdateRequestList.Add(new ImageWriteUpdateRequest()
{ //{
wareId = wareId, // wareId = wareId,
colorId = colorProperty.Value<string>("id"), // colorId = colorProperty.Value<string>("id"),
imgUrl = imgUrlBuilder.ToString().Trim(','), // imgUrl = imgUrlBuilder.ToString().Trim(','),
imgIndex = imgIndexBuilder.ToString().Trim(',') // imgIndex = imgIndexBuilder.ToString().Trim(',')
}); //});
takeColorIndex--; takeColorIndex--;
skusParamList.Add(p); skusParamList.Add(p);
@ -1126,27 +1139,55 @@ namespace BBWY.Server.Business
} }
} }
var newSkuList = res.Json["jingdong_sku_write_updateSkus_responce"]["skuList"].ToList().Select(x => x.Value<string>("skuId")).ToList(); var newSkuIdList = res.Json["jingdong_sku_write_updateSkus_responce"]["skuList"].ToList().Select(x => x.Value<string>("skuId")).ToList();
giftSkuIdList.AddRange(newSkuList); giftSkuIdList.AddRange(newSkuIdList);
}
#endregion
#region sku改名
{ var newSkuList = res.Json["jingdong_sku_write_updateSkus_responce"]["skuList"].ToList();
stepText = "sku改名"; var imgIndex = 1;
var req = new WareWriteUpdateWareSaleAttrvalueAliasRequest() StringBuilder colorBuilder = new StringBuilder();
StringBuilder imgUrlBuilder = new StringBuilder();
StringBuilder imgIndexBuilder = new StringBuilder();
foreach (var skuJToken in newSkuList)
{
var skuTitle = skuJToken["saleAttrs"][0]["attrValueAlias"][0].ToString();
var colorId = skuJToken["saleAttrs"][0]["attrValues"][0].ToString();
var currentImgIndex = imgIndex;
imgIndex++;
var giftSku = request.GiftTemplateSkuList.FirstOrDefault(x => x.Title == skuTitle);
var imgUrl = giftSku.Logo.Substring(giftSku.Logo.IndexOf("jfs"));
colorBuilder.Append($"{colorId},");
imgUrlBuilder.Append($"{imgUrl},");
imgIndexBuilder.Append($"{currentImgIndex},");
}
imageWriteUpdateRequestList.Add(new ImageWriteUpdateRequest()
{ {
wareId = wareId, wareId = wareId,
props = updateSkuTitleParamList colorId = colorBuilder.ToString().TrimEnd(','),
}; imgUrl = imgUrlBuilder.ToString().TrimEnd(','),
var res = jdClient.Execute(req, request.AppToken, DateTime.Now.ToLocalTime()); imgIndex = imgIndexBuilder.ToString().TrimEnd(',')
if (res.Json == null) });
res.Json = JObject.Parse(res.Body);
if (res.IsError)
throw new BusinessException($"sku改名失败-{(string.IsNullOrEmpty(res.ErrorMsg) ? res.ErrMsg : res.ErrorMsg)}");
} }
#endregion #endregion
//#region sku改名
//{
// stepText = "sku改名";
// var req = new WareWriteUpdateWareSaleAttrvalueAliasRequest()
// {
// wareId = wareId,
// props = updateSkuTitleParamList
// };
// var res = jdClient.Execute(req, request.AppToken, DateTime.Now.ToLocalTime());
// if (res.Json == null)
// res.Json = JObject.Parse(res.Body);
// if (res.IsError)
// throw new BusinessException($"sku改名失败-{(string.IsNullOrEmpty(res.ErrorMsg) ? res.ErrMsg : res.ErrorMsg)}");
//}
//#endregion
#region sku修改细节图 #region sku修改细节图
stepText = "sku修改细节图"; stepText = "sku修改细节图";
foreach (var imageWriteUpdateRequest in imageWriteUpdateRequestList) foreach (var imageWriteUpdateRequest in imageWriteUpdateRequestList)

3
BBWY.Server.Business/PlatformSDK/PlatformSDKBusiness.cs

@ -1,5 +1,6 @@
using BBWY.Server.Model; using BBWY.Server.Model;
using BBWY.Server.Model.Dto; using BBWY.Server.Model.Dto;
using BBWY.Server.Model.Dto.Request.JD;
using Microsoft.Extensions.Caching.Memory; using Microsoft.Extensions.Caching.Memory;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using NLog; using NLog;
@ -163,7 +164,7 @@ namespace BBWY.Server.Business
throw new NotImplementedException(); throw new NotImplementedException();
} }
public virtual JArray GetStockNumBySku(SearchProductSkuRequest request) public virtual JArray GetStockNumBySku(GetStockNumBySkuRequest request)
{ {
throw new NotImplementedException(); throw new NotImplementedException();
} }

16
BBWY.Server.Model/Dto/Request/JD/GetStockNumBySkuRequest.cs

@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace BBWY.Server.Model.Dto.Request.JD
{
public class GetStockNumBySkuRequest : PlatformRequest
{
/// <summary>
/// 多个Sku逗号间隔
/// </summary>
public string Sku { get; set; }
public string[] Field { get; set; }
}
}

2
BBWY.Server.Model/Dto/Request/Product/SearchProductSkuRequest.cs

@ -28,5 +28,7 @@ namespace BBWY.Server.Model.Dto
/// 检查环节 /// 检查环节
/// </summary> /// </summary>
public string CheckStep { get; set; } public string CheckStep { get; set; }
public string[] Field { get; set; }
} }
} }

3
JD.API/Controllers/PlatformSDKController.cs

@ -1,6 +1,7 @@
using BBWY.Server.Business; using BBWY.Server.Business;
using BBWY.Server.Model; using BBWY.Server.Model;
using BBWY.Server.Model.Dto; using BBWY.Server.Model.Dto;
using BBWY.Server.Model.Dto.Request.JD;
using JD.API.Filters; using JD.API.Filters;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
@ -293,7 +294,7 @@ namespace JD.API.API.Controllers
/// <param name="request"></param> /// <param name="request"></param>
/// <returns></returns> /// <returns></returns>
[HttpPost] [HttpPost]
public JArray GetStockNumBySku([FromBody] SearchProductSkuRequest request) public JArray GetStockNumBySku([FromBody] GetStockNumBySkuRequest request)
{ {
return platformSDKBusinessList.FirstOrDefault(p => p.Platform == request.Platform).GetStockNumBySku(request); return platformSDKBusinessList.FirstOrDefault(p => p.Platform == request.Platform).GetStockNumBySku(request);
} }

Loading…
Cancel
Save