优化订单读取与拍单逻辑

This commit is contained in:
wule committed 2026-10-21 20:01:53 +08:00
1 parent e02047ae57
commit 103b2a1a4a
9 files changed
+765 -703

No files matched your search

+7 -7
View File
@@ -108,7 +108,7 @@ namespace _29WxOrderWpf
string str = GetExceptionMsg(ex, string.Empty); string str = GetExceptionMsg(ex, string.Empty);
NaiBa.Util.Helper.LogHelper.WriteWithTime("SystemError:" + str); NaiBa.Util.Helper.LogHelper.WriteWithTime("SystemError:" + str);
//BaseMsgForm.ShowError(str, "系统错误"); //BaseMsgForm.ShowError(str, "系统错误");
BaseMsgWindow.ShowError(str, "系统错误"); BaseMsgWindow.ShowError(str, "系统错误", null, MsgWindowLevel.LARGE);
} }
#region 初始化cef #region 初始化cef
@@ -157,15 +157,15 @@ namespace _29WxOrderWpf
{ {
string str = GetExceptionMsg(e.Exception, e.ToString()); string str = GetExceptionMsg(e.Exception, e.ToString());
NaiBa.Util.Helper.LogHelper.WriteWithTime("SystemError:" + str); NaiBa.Util.Helper.LogHelper.WriteWithTime("SystemError:" + str);
BaseMsgWindow.ShowError(str, "系统错误"); BaseMsgWindow.ShowError(str, "系统错误", null, MsgWindowLevel.LARGE);
} }
static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
{ {
string str = GetExceptionMsg(e.ExceptionObject as Exception, e.ToString()); string str = GetExceptionMsg(e.ExceptionObject as Exception, e.ToString());
NaiBa.Util.Helper.LogHelper.WriteWithTime("SystemError:" + str); NaiBa.Util.Helper.LogHelper.WriteWithTime("SystemError:" + str);
BaseMsgWindow.ShowError(str, "系统错误"); BaseMsgWindow.ShowError(str, "系统错误", null, MsgWindowLevel.LARGE);
} }
/// <summary> /// <summary>
/// 生成自定义异常消息 /// 生成自定义异常消息
@@ -190,8 +190,8 @@ namespace _29WxOrderWpf
} }
sb.AppendLine("***************************************************************"); sb.AppendLine("***************************************************************");
NaiBa.Util.Helper.LogHelper.WriteWithTime("Error:" + sb); NaiBa.Util.Helper.LogHelper.WriteWithTime("Error:" + sb);
BaseMsgWindow.ShowError(sb.ToString(), "系统错误"); BaseMsgWindow.ShowError(sb.ToString(), "系统错误", null, MsgWindowLevel.LARGE);
return sb.ToString(); return sb.ToString();
} }
/// <summary> /// <summary>
@@ -1,6 +1,5 @@
using _29WxOrderWpf.BaseWindows; using _29WxOrderWpf.BaseWindows;
using WxOrder.Framework.Commons; using WxOrder.Framework.Commons;
using WxOrder.Framework.Commons;
using _29WxOrderWpf.Ctrls.PDDInvoice; using _29WxOrderWpf.Ctrls.PDDInvoice;
using _29WxOrderWpf.Ctrls.Statistics; using _29WxOrderWpf.Ctrls.Statistics;
using _29WxOrderWpf.Services; using _29WxOrderWpf.Services;
@@ -1,6 +1,5 @@
using _29WxOrderWpf.BaseWindows; using _29WxOrderWpf.BaseWindows;
using WxOrder.Framework.Commons; using WxOrder.Framework.Commons;
using WxOrder.Framework.Commons;
using _29WxOrderWpf.Ctrls.BuyerCtrls; using _29WxOrderWpf.Ctrls.BuyerCtrls;
using _29WxOrderWpf.Ctrls.Statistics; using _29WxOrderWpf.Ctrls.Statistics;
using _29WxOrderWpf.Services; using _29WxOrderWpf.Services;
@@ -167,6 +167,7 @@
Grid.Column="6" Grid.Column="6"
Margin="4,8,4,8" Margin="4,8,4,8"
VerticalAlignment="Center" VerticalAlignment="Center"
d:Text="店铺名称"
Background="Transparent" Background="Transparent"
BorderThickness="0" BorderThickness="0"
Cursor="Hand" Cursor="Hand"
@@ -95,7 +95,15 @@
Cursor="Hand" Cursor="Hand"
MouseDown="imgOrderItem_MouseDown" MouseDown="imgOrderItem_MouseDown"
MouseEnter="imgOrderItem_MouseEnter" MouseEnter="imgOrderItem_MouseEnter"
MouseLeave="imgOrderItem_MouseLeave" /> MouseLeave="imgOrderItem_MouseLeave">
<Image.Source>
<MultiBinding Converter="{StaticResource ImageUrlToBitmapImage}" Mode="OneWay">
<Binding IsAsync="True" Path="ThumbImgStr" />
<Binding IsAsync="True" Path="IsLoadThumbImg" />
<!--<Binding Path="DataContext.IsLoadImage" RelativeSource="{RelativeSource AncestorType=UserControl}" />-->
</MultiBinding>
</Image.Source>
</Image>
<wpf:SpacingStackPanel <wpf:SpacingStackPanel
Grid.Column="1" Grid.Column="1"
@@ -672,9 +672,9 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
if (isAbnormalOrder) if (isAbnormalOrder)
buyOrderForm.AbnormalTransitWarehouseOrderInfo = orderItem.ItemTransitOrder; buyOrderForm.AbnormalTransitWarehouseOrderInfo = orderItem.ItemTransitOrder;
buyOrderForm.ShowDialog(); buyOrderForm.ShowDialog();
OrderListCtrl.IsAutoBuy = buyOrderForm.IsAutoBuy; OrderListCtrl.IsAutoBuy = (buyOrderForm?.IsAutoBuy).ParseToBool();
if (buyOrderForm.IsBuySuccess) if (buyOrderForm?.IsBuySuccess == true)
{ {
Task.Run(async () => Task.Run(async () =>
{ {
@@ -799,11 +799,18 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
// })); // }));
//}); //});
//var bImg = await AllBase.ImageBuild.LoadBitmipImageFromUrlAsync(order_item.thumb_img + "?imageView2/1/w/100/format/webp|imageMogr2/auto-orient="); //var imgItem = imgOrderItem;
//var bImg = await AllBase.ImageBuild.LoadBitmipImageFromUrlAsync(order_item.thumb_img + "?imageView2/1/w/100/h/100/format/jpg/q/85|imageMogr2/auto-orient="); //Task.Run(() =>
var bImg = await AllBase.ImageBuild.LoadBitmipImageFromUrlAsync(order_item.thumb_img + "?imageView2/1/w/100/h/100/format/jpg/q/80"); //{
imgOrderItem.Source = bImg; // BitmapImage bImg = AllBase.ImageBuild.LoadBitmipImageFromUrl(order_item.thumb_img + "?imageView2/1/w/100/h/100/format/jpg/q/80");
// Thread.Sleep(Randomx.GetId(1000));
// Dispatcher.Invoke(new Action(() =>
// {
// imgItem.Source = bImg;
// }));
//});
//await UpdateImg(order_item, imgOrderItem);
// 待采购不显示所有采购信息状态(否则会显示作废订单状态) // 待采购不显示所有采购信息状态(否则会显示作废订单状态)
if (GlobalConfig.OrderTabHeaderStr.StartsWith("待采购")) if (GlobalConfig.OrderTabHeaderStr.StartsWith("待采购"))
@@ -821,6 +828,14 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
} }
} }
public async Task UpdateImg(oms_wei_order_item_info order_item, Image imageItem)
{
//var bImg = await AllBase.ImageBuild.LoadBitmipImageFromUrlAsync(order_item.thumb_img + "?imageView2/1/w/100/format/webp|imageMogr2/auto-orient=");
//var bImg = await AllBase.ImageBuild.LoadBitmipImageFromUrlAsync(order_item.thumb_img + "?imageView2/1/w/100/h/100/format/jpg/q/85|imageMogr2/auto-orient=");
var bImg = await AllBase.ImageBuild.LoadBitmipImageFromUrlAsync(order_item.thumb_img + "?imageView2/1/w/100/h/100/format/jpg/q/80");
Dispatcher.Invoke(new Action(() => { imageItem.Source = bImg; }));
}
private void TransitOrderBuy_Click(object sender, MouseButtonEventArgs e) private void TransitOrderBuy_Click(object sender, MouseButtonEventArgs e)
{ {
var orderItem = this.DataContext as oms_wei_order_item_info; var orderItem = this.DataContext as oms_wei_order_item_info;
@@ -1590,7 +1605,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
buyOrderForm.pnlMap.Visible = false; buyOrderForm.pnlMap.Visible = false;
} }
buyOrderForm.ShowDialog(); buyOrderForm.ShowDialog();
IsBuySuccess = buyOrderForm.IsBuySuccess; IsBuySuccess = (buyOrderForm?.IsBuySuccess).ParseToBool();
} }
else if (GlobalConfig.CurrentBuyPlatform == "tb") else if (GlobalConfig.CurrentBuyPlatform == "tb")
{ {
+11 -4
View File
@@ -28,7 +28,7 @@ namespace AllBase.Model.DBModel
public ShopLoginInfo Shop public ShopLoginInfo Shop
{ {
get { return this.GetValue(x => x.Shop); } get { return this.GetValue(x => x.Shop); }
set { this.SetValue(x => x.Shop, value); } set { this.SetValue(x => x.Shop, value); if (!Shop.ShopAccount.IsNullOrEmpty()) shop_name = Shop.ShopAccount; }
} }
public int Index public int Index
{ {
@@ -425,10 +425,17 @@ namespace AllBase.Model.DBModel
} }
//public bool is_visible { get; set; } = true; //public bool is_visible { get; set; } = true;
public long id { get; set; } public long id { get; set; }
public long shop_id { get; set; } public long shop_id
public string shop_name { get; set; } {
get { return this.GetValue(x => x.shop_id); }
set { this.SetValue(x => x.shop_id, value); }
}
public string shop_name
{
get { return this.GetValue(x => x.shop_name); }
set { this.SetValue(x => x.shop_name, value); }
}
/// <summary> /// <summary>
/// 商户ID /// 商户ID
/// </summary> /// </summary>
@@ -1194,6 +1194,17 @@ namespace AllBase.Model.DBModel
DirectOrderBuyTimeStr = DirectPddBuyerOrder != null ? DirectPddBuyerOrder.add_time.ToString("yyyy-MM-dd HH:mm:ss") : ""; DirectOrderBuyTimeStr = DirectPddBuyerOrder != null ? DirectPddBuyerOrder.add_time.ToString("yyyy-MM-dd HH:mm:ss") : "";
} }
public string ThumbImgStr
{
get { return this.GetValue(x => x.ThumbImgStr); }
set { this.SetValue(x => x.ThumbImgStr, value); }
}
public bool IsLoadThumbImg
{
get { return this.GetValue(x => x.IsLoadThumbImg); }
set { this.SetValue(x => x.IsLoadThumbImg, value); }
}
/// <summary> 直发最后一条物流信息 </summary> /// <summary> 直发最后一条物流信息 </summary>
public oms_wei_ewaybill_path LatestDirectEWaybill public oms_wei_ewaybill_path LatestDirectEWaybill
{ {
@@ -1521,7 +1532,11 @@ namespace AllBase.Model.DBModel
/// <summary> /// <summary>
/// sku小图 /// sku小图
/// </summary> /// </summary>
public string thumb_img { get; set; } public string thumb_img
{
get { return this.GetValue(x => x.thumb_img); }
set { this.SetValue(x => x.thumb_img, value); IsLoadThumbImg = !string.IsNullOrEmpty(value); ThumbImgStr = thumb_img + "?imageView2/1/w/100/h/100/format/jpg/q/80"; }
}
/// <summary> /// <summary>
/// sku数量 /// sku数量
/// </summary> /// </summary>
File diff suppressed because it is too large. Load diff