优化拍档 优化订单读取功能

This commit is contained in:
wule_5900x committed 2026-06-28 21:06:29 +08:00
1 parent adde7e6fca
commit 6f7aa58ac1
11 files changed
+334 -85

No files matched your search

@@ -32,19 +32,19 @@
</WrapPanel>
<TextBox x:Name="txtFilter" Grid.Column="1" Margin="28,0,8,0" BorderBrush="{StaticResource pageColorBrush}" BorderThickness="1" Height="28"
VerticalContentAlignment="Center" Style="{StaticResource BaseRoundCornerTextBoxStyle}" />
VerticalContentAlignment="Center" Style="{StaticResource BaseRoundCornerTextBoxStyle}" TextChanged="txtFilter_TextChanged" />
<Button Grid.Column="2" x:Name="btnFilter" Style="{StaticResource BasePageButtonStyle}" Margin="4,0,8,0" Content="过滤" Width="50" Height="24" Click="btnFilter_Click"/>
</Grid>
<Grid Grid.Row="1" Background="LightGray" x:Name="GridCef">
</Grid>
<Grid Grid.Row="1" VerticalAlignment="Bottom" Visibility="Visible" Height="300" Margin="4" Background="White">
<Grid Grid.Row="1" VerticalAlignment="Bottom" Visibility="Visible" Height="330" Margin="4" Background="White">
<Grid.RowDefinitions>
<RowDefinition Height="40"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<Label Content="正在操作:" VerticalAlignment="Center" x:Name="lblMsg"></Label>
<DataGrid Grid.Row="1" RowHeight="50" AutoGenerateColumns = "False" HorizontalGridLinesBrush="{StaticResource HorizontalGridLinesBrush}" x:Name="dgBuyerOrder" RowHeaderWidth="0"
<DataGrid Grid.Row="1" RowHeight="50" AutoGenerateColumns = "False" HorizontalGridLinesBrush="{StaticResource HorizontalGridLinesBrush}" x:Name="dgBuyerOrder" RowHeaderWidth="0"
VerticalGridLinesBrush="{StaticResource VerticalGridLinesBrush}" CanUserDeleteRows="False" CanUserAddRows="False" ColumnHeaderHeight="30" LoadingRow="dgBuyerOrder_LoadingRow">
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding Header, RelativeSource={RelativeSource AncestorType={x:Type DataGridRow}, Mode=FindAncestor}}" CanUserSort="False" Header="序列" IsReadOnly="True" Width="40">
@@ -13,10 +13,13 @@ using NaiBa.Util;
using NaiBa.Util.Extension;
using Newtonsoft.Json.Linq;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Reflection;
using System.Security.Cryptography.X509Certificates;
using System.Security.Policy;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
@@ -51,11 +54,37 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
public BuyerOrderConfig buyerOrderConfig = new BuyerOrderConfig();
public DateTime nextGetOrderTime = DateTime.MinValue;
public DateTime lastCefReadOrderTime = DateTime.Now;
/// <summary>
/// 是否自动读买手单
/// </summary>
public bool IsAutoReadBuyerOrder = true;
/// <summary>
/// 是否正在读买手单
/// </summary>
bool isReadBuyerOrder = false;
/// <summary>
/// 是否已初始化已读的买手单
/// </summary>
bool isInitBuyerOrder = false;
/// <summary>
/// 是否已初始化已读的售后单
/// </summary>
bool isInitBuyerAfterSale = false;
/// <summary>
/// 当前正在读单的买手信息
/// </summary>
string currentReadBuyer = "";
/// <summary>
/// 过滤查询的订单文本信息;
/// </summary>
string filterTxt = "";
/// <summary>
/// 是否过滤无微信系统订单号的拼多多买手单
/// </summary>
bool isHideNoWxOrderNo = true;
/// <summary>
/// 软件是否完成加载
/// </summary>
bool isLoad = false;
int maxZIndex = 1;
@@ -66,26 +95,45 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
void filterBuyerOrder()
{
string filterTxt = txtFilter?.Text.ParseToString().Trim();
//string filterTxt = txtFilter?.Text.ParseToString().Trim();
//lstFilterPddBuyerOrderInfoLite = new ObservableCollection<PddBuyerOrderLiteInfo>(lstPddBuyerOrderInfoLite
// .Where(o => GlobalConfig.PDDBuyerLoginList.Any(u => u.buyer_name == o.buyerName)));
//lstFilterPddBuyerOrderInfoLite = new ObservableCollection<PddBuyerOrderLiteInfo>(lstFilterPddBuyerOrderInfoLite.Where(x =>
// x.order_time > BaseClass.DateTimeToTimestampSeconds(new DateTime(2026, 6, 25))
//));
//lstFilterPddBuyerOrderInfoLite = new ObservableCollection<PddBuyerOrderLiteInfo>(lstFilterPddBuyerOrderInfoLite.Where(x =>
// chkHideNoWxIdOrder.IsChecked != true || !x.ShopOrderIdStr.IsNullOrEmpty()
//));
//lstFilterPddBuyerOrderInfoLite = new ObservableCollection<PddBuyerOrderLiteInfo>(lstFilterPddBuyerOrderInfoLite.Where(x =>
// string.IsNullOrEmpty(filterTxt) || x.order_sn.Contains(filterTxt) || x.ShopOrderIdStr.Contains(filterTxt) || x.tracking_number.Contains(filterTxt)
//));
lstFilterPddBuyerOrderInfoLite = new ObservableCollection<PddBuyerOrderLiteInfo>(lstPddBuyerOrderInfoLite
.Where(o => GlobalConfig.PDDBuyerLoginList.Any(u => u.buyer_name == o.buyerName)));
lstFilterPddBuyerOrderInfoLite = new ObservableCollection<PddBuyerOrderLiteInfo>(lstFilterPddBuyerOrderInfoLite.Where(x =>
x.order_time > BaseClass.DateTimeToTimestampSeconds(new DateTime(2026, 6, 25))
));
lstFilterPddBuyerOrderInfoLite = new ObservableCollection<PddBuyerOrderLiteInfo>(lstFilterPddBuyerOrderInfoLite.Where(x =>
chkHideNoWxIdOrder.IsChecked != true || !x.ShopOrderIdStr.IsNullOrEmpty()
));
lstFilterPddBuyerOrderInfoLite = new ObservableCollection<PddBuyerOrderLiteInfo>(lstFilterPddBuyerOrderInfoLite.Where(x =>
string.IsNullOrEmpty(filterTxt) || (x.order_sn.Contains(filterTxt) || x.ShopOrderIdStr.Contains(filterTxt) || x.tracking_number.Contains(filterTxt))
));
.Where(o => filterOneBuyerOrder(o) == true));
if (dgBuyerOrder != null)
this.dgBuyerOrder.ItemsSource = lstFilterPddBuyerOrderInfoLite;
}
bool filterOneBuyerOrder(PddBuyerOrderLiteInfo order)
{
if (order == null)
return false;
if (!GlobalConfig.PDDBuyerLoginList.Any(u => u.buyer_name == order.buyerName))
return false;
if (order.order_time < BaseClass.DateTimeToTimestampSeconds(new DateTime(2026, 6, 25)))
return false;
if (isHideNoWxOrderNo && order.ShopOrderIdStr.IsNullOrEmpty())
return false;
if (!string.IsNullOrEmpty(filterTxt) && !order.order_sn.Contains(filterTxt) && !order.ShopOrderIdStr.Contains(filterTxt) && !order.tracking_number.Contains(filterTxt))
return false;
return true;
}
private void UserControl_Loaded(object sender, RoutedEventArgs e)
{
buyerOrderConfig = NaiBa.Util.Helper.ConfigHelper.LoadConfig<BuyerOrderConfig>("pdd_buyer_order_config");
@@ -432,6 +480,71 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
});
}
/// <summary>
/// 读取中转仓拍单订单
/// </summary>
/// <param name="out_order_nos"></param>
List<oms_wei_external_procurement_log> GetOrderTransitWarehouseInfo(string out_order_nos)
{
var url3 = BaseClass.Build29WxObjString("order/wx_get_transit_order");
var data3 = UserLogin.GetSignaturex();
data3 += "&out_order_no=" + out_order_nos;
var html3 = GetHtml.PostUtf8(url3, data3);
if (string.IsNullOrEmpty(html3) || !html3.Contains("\"code\":200"))
GetHtml.PostUtf8(url3, data3);
if (string.IsNullOrEmpty(html3) || !html3.Contains("\"code\":200"))
{
//Dispatcher.Invoke(new Action(() =>
//{
// BaseMsgWindow.ShowError(MainWindow.Instance, "订单读取失败 " + BaseRegex.GetStringJson(ref html, "msg"));
//}));
//break;
}
List<oms_wei_external_procurement_log> transitOrderList = new List<oms_wei_external_procurement_log>();
try { transitOrderList = JsonHelper.DeserializeJsonToList<oms_wei_external_procurement_log>(JObject.Parse(html3)["data"].ParseToString()); } catch { }
return transitOrderList;
}
/// <summary>
/// 读取售后单
/// </summary>
/// <param name="order_ids"></param>
/// <returns></returns>
List<oms_wei_refund_info> GetOrderRefundInfo(string order_ids)
{
Thread.Sleep(100);
var url2 = BaseClass.Build29WxObjString("order/get_refund_list");
var data2 = UserLogin.GetSignaturex();
data2 += "&erp_order_id_in=" + order_ids;
var html2 = GetHtml.PostUtf8(url2, data2);
if (string.IsNullOrEmpty(html2) || !html2.Contains("\"code\":200"))
html2 = GetHtml.PostUtf8(url2, data2);
if (string.IsNullOrEmpty(html2) || !html2.Contains("\"code\":200"))
{
//BaseMsgWindow.ShowError(MainWindow.Instance, "订单读取失败 " + BaseRegex.GetStringJson(ref html, "msg"));
//break;
}
List<oms_wei_refund_info> refunds = new List<oms_wei_refund_info>();
try { refunds = JsonHelper.DeserializeJsonToList<oms_wei_refund_info>(JObject.Parse(html2)["data"].ParseToString()); } catch { }
return refunds;
}
void UpdateOrderStatus(PddBuyerOrderLiteInfo o, oms_wei_order_item_info order_item, oms_wei_refund_info refund_item, oms_wei_external_procurement_log transitOrderList)
{
o.ShopOrderIdStr = order_item.order_id;
o.ShopOrderSkuIdStr = order_item.sku_id;
o.ShopOrderSkuNameStr = order_item.sku_attr_str;
o.ShopOrderRefundStr = refund_item?.count > 0 ? "店铺售后" : "";
o.TransitWarehouseIdStr = transitOrderList?.platform;
o.Express1WaybillStr = transitOrderList?.express_1_waybill;
o.Express1CompanyStr = transitOrderList?.express_1_company;
o.Express2WaybillStr = transitOrderList?.express_2_waybill;
o.Express2CompanyStr = transitOrderList?.express_2_company;
o.TransferWareHouseStatus = transitOrderList?.transfer_warehouse_status.ParseToString();
o.PreAllocatedOrderNoStr = transitOrderList?.pre_allocated_order_no.ParseToString();
// 更新订单中转取号状态
o.sendStatus = (o.TransitOrderStatus + " " + o.ShopOrderRefundStr).Trim();
}
void CefReadBuyerOrder(string url, string data)
{
@@ -469,59 +582,28 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
}));
var list = JsonHelper.DeserializeJsonToList<PddBuyerOrderLiteInfo>(JsonHelper.JObjectParse(data)["orders"].ParseToString());
var out_order_no_str = string.Join(",", list.Select(bo => bo.order_sn));
// 读取中转仓拍单订单
var url3 = BaseClass.Build29WxObjString("order/wx_get_transit_order");
var data3 = UserLogin.GetSignaturex();
data3 += "&out_order_no=" + out_order_no_str;
var html3 = GetHtml.PostUtf8(url3, data3);
if (string.IsNullOrEmpty(html3) || !html3.Contains("\"code\":200"))
GetHtml.PostUtf8(url3, data3);
if (string.IsNullOrEmpty(html3) || !html3.Contains("\"code\":200"))
var out_order_nos = string.Join(",", list.Select(bo => bo.order_sn));
var transitOrderList = GetOrderTransitWarehouseInfo(out_order_nos);
var order_ids = string.Join(",", transitOrderList.Select(ts => ts.order_no));
var refunds = GetOrderRefundInfo(order_ids);
foreach (PddBuyerOrderLiteInfo o in list)
{
//Dispatcher.Invoke(new Action(() =>
//{
// BaseMsgWindow.ShowError(MainWindow.Instance, "订单读取失败 " + BaseRegex.GetStringJson(ref html, "msg"));
//}));
//break;
}
List<oms_wei_external_procurement_log> transitOrderList = new List<oms_wei_external_procurement_log>();
try { transitOrderList = JsonHelper.DeserializeJsonToList<oms_wei_external_procurement_log>(JObject.Parse(html3)["data"].ParseToString()); } catch { }
foreach (var o in list)
{
if (o.order_sn == "260620-468346508912823")
{
}
o.buyerId = buyer.buyer_id;
o.buyerName = buyer.buyer_name;
o.outExpressCompanyMsg = o.extra_info.order_hint?.message; // todo 此处转换
o.outExpressCompanyMsg = o.extra_info.order_hint?.message;
// 查找店铺订单并更新店铺订单状态
var ShopOrder = GlobalConfig.lstOrder.FirstOrDefault(o1 => o1.order_items.Any(i1 => i1.item_transit_orders.Any(t1 => t1.out_order_no == o.order_sn)));
if (ShopOrder != null)
{
if (o.order_sn == "")
{
}
var order_item = ShopOrder.order_items.FirstOrDefault(oi => oi.item_transit_orders.Any(t1 => t1.out_order_no == o.order_sn));
if (order_item != null)
{
o.ShopOrderIdStr = order_item.order_id;
o.ShopOrderSkuIdStr = order_item.sku_id;
o.ShopOrderSkuNameStr = order_item.sku_attr_str;
o.TransitWarehouseIdStr = transitOrderList.FirstOrDefault(t1 => t1.out_order_no == o.order_sn).platform;
o.Express1WaybillStr = transitOrderList.FirstOrDefault(t1 => t1.out_order_no == o.order_sn).express_1_waybill;
o.Express1CompanyStr = transitOrderList.FirstOrDefault(t1 => t1.out_order_no == o.order_sn).express_1_company;
o.Express2WaybillStr = transitOrderList.FirstOrDefault(t1 => t1.out_order_no == o.order_sn).express_2_waybill;
o.Express2CompanyStr = transitOrderList.FirstOrDefault(t1 => t1.out_order_no == o.order_sn).express_2_company;
o.TransferWareHouseStatus = transitOrderList.FirstOrDefault(t1 => t1.out_order_no == o.order_sn).transfer_warehouse_status.ParseToString();
o.PreAllocatedOrderNoStr = transitOrderList.FirstOrDefault(t1 => t1.out_order_no == o.order_sn).pre_allocated_order_no.ParseToString();
// 更新订单中转取号状态
o.sendStatus = o.TransitOrderStatus;
}
var refund_item = refunds.FirstOrDefault(ri => ri.order_id == order_item.order_id) ?? order_item?.item_refund;
var transit_item = transitOrderList.FirstOrDefault(t1 => t1.out_order_no == o.order_sn);
UpdateOrderStatus(o, order_item, refund_item, transit_item);
}
PddBuyerOrderLiteInfo order = null;
@@ -582,6 +664,7 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
order.Express2CompanyStr = o.Express2CompanyStr;
order.TransferWareHouseStatus = o.TransferWareHouseStatus;
order.PreAllocatedOrderNoStr = o.PreAllocatedOrderNoStr;
order.ShopOrderRefundStr = o.ShopOrderRefundStr;
var index = lstPddBuyerOrderInfoLite.IndexOf(order);
Dispatcher.Invoke(new Action(() =>
@@ -592,6 +675,27 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
}
}
if (filterOneBuyerOrder(order))
{
var orderExist = lstFilterPddBuyerOrderInfoLite.FirstOrDefault(oe => oe.order_sn == order.order_sn);
if (orderExist == null)
{
Dispatcher.Invoke(new Action(() =>
{
lstFilterPddBuyerOrderInfoLite.Add(order);
}));
}
else
{
var index = lstPddBuyerOrderInfoLite.IndexOf(orderExist);
Dispatcher.Invoke(new Action(() =>
{
lstPddBuyerOrderInfoLite.Remove(orderExist);
lstPddBuyerOrderInfoLite.Insert(index, order);
}));
}
}
Task.Run(() =>
{
//SendOrderE57(order);
@@ -1035,6 +1139,23 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
btn.IsEnabled = false;
Task.Run(() =>
{
var out_order_nos = buyerOrder.order_sn;
var transitOrderList = GetOrderTransitWarehouseInfo(out_order_nos);
var order_ids = string.Join(",", transitOrderList.Select(ts => ts.order_no));
var refunds = GetOrderRefundInfo(order_ids);
// 查找店铺订单并更新店铺订单状态
var ShopOrder = GlobalConfig.lstOrder.FirstOrDefault(o1 => o1.order_items.Any(i1 => i1.item_transit_orders.Any(t1 => t1.out_order_no == buyerOrder.order_sn)));
if (ShopOrder != null)
{
var order_item = ShopOrder.order_items.FirstOrDefault(oi => oi.item_transit_orders.Any(t1 => t1.out_order_no == buyerOrder.order_sn));
var refund_item = refunds.FirstOrDefault(ri => ri.order_id == order_item.order_id) ?? order_item?.item_refund;
var transit_item = transitOrderList.FirstOrDefault(t1 => t1.out_order_no == buyerOrder.order_sn);
UpdateOrderStatus(buyerOrder, order_item, refund_item, transit_item);
}
//SendOrderE57(order);
SendTransitOrderE57(buyerOrder, true);
@@ -1053,7 +1174,9 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
//if (resetSendStatus)
// order.sendStatus = "";
if (order.sendStatus == "已取号" || order.sendStatus == "取号成功")
// 已取号 有售后 或者没有店铺订单号的订单,不发送
if (order.sendStatus == "已取号" || order.sendStatus.ParseToString().Contains("取号成功") ||
order.sendStatus.ParseToString().Contains("售后") || order.ShopOrderIdStr.IsNullOrEmpty())
{
return;
}
@@ -1067,11 +1190,10 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
return;
}
NaiBa.Util.Helper.ConfigHelper.SaveConfig("pdd_buyer_order_list", lstPddBuyerOrderInfoLite);
// 提交物流信息
if (order.sendStatus != "提前取号" && order.sendStatus != "已取号" && order.sendStatus != "取号成功" && order.sendStatus != "已提交")
if (order.sendStatus != "已提交" && order.sendStatus != "提前取号" && order.sendStatus != "已取号")
{
//JObject obj = new JObject();
//obj["orderNo"] = order.ShopOrderIdStr;
@@ -1110,9 +1232,13 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
var html3 = GetHtml.PostUtf8(url3, data3);
if (string.IsNullOrEmpty(html3) || !html3.Contains("\"code\":200"))
GetHtml.PostUtf8(url3, data3);
if (html3.Contains("\"code\":200"))
{
order.sendStatus = "已提交";
}
}
if (order.sendStatus != "提前取号")
if (order.sendStatus == "已提交" && order.sendStatus != "提前取号")
{
// 立即取号
string url2 = "https://po.e57.cn/prod-api/api/oms-api/external_procurement/transfer-warehouse/dispatch";
@@ -1162,13 +1288,13 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
data["outExpressCompany"] = order.outExpressCompanyCode; // 物流公司编号
data["outExpressNo"] = order.tracking_number;
data["platform"] = "WEISHOP";
data["orderCode"] = order.TransitWarehouseIdStr; // 中转仓ID
data["orderCode"] = order.order_sn; // 中转仓订单唯一标识码 = 外采定单号
var dataStr2 = JsonHelper.SerializeObject(data);
var dispatchRst = HttpResponseWXBLL.e57PostResponse(url2, dataStr2, "");
if (dispatchRst.Contains("<code>200</code>"))
if (dispatchRst.Contains("<code>0</code>"))
{
order.sendStatus = "取号成功";
order.sendStatus = "修改提前取号成功";
var shopOrder = GlobalConfig.lstOrder.FirstOrDefault(o => o.order_items.Any(oi => oi.item_transit_orders.Any(t => t.out_order_no == order.order_sn)));
if (shopOrder != null)
{
@@ -1500,6 +1626,7 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
private void chkHideNoWxIdOrder_CheckedChanged(object sender, RoutedEventArgs e)
{
isHideNoWxOrderNo = chkHideNoWxIdOrder.IsChecked == true;
filterBuyerOrder();
}
@@ -1511,7 +1638,12 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
private void dgBuyerOrder_LoadingRow(object sender, DataGridRowEventArgs e)
{
e.Row.Header = e.Row.GetIndex() + 1;
}
}
private void txtFilter_TextChanged(object sender, TextChangedEventArgs e)
{
filterTxt = txtFilter.Text.Trim();
}
}
public class YkdBuyerOrder
@@ -185,7 +185,8 @@
</DataGrid>
</Border>
</Grid>
<ListBox BorderThickness="0" ItemsSource="{Binding lstFilterOrder}" Grid.Row="3" HorizontalContentAlignment="Stretch" x:Name="lbxOrder" Margin="7,0,7,0"
<!--ItemsSource="{Binding lstFilterOrder}"-->
<ListBox BorderThickness="0" Grid.Row="3" HorizontalContentAlignment="Stretch" x:Name="lbxOrder" Margin="7,0,7,0"
ScrollViewer.CanContentScroll="True" VirtualizingPanel.ScrollUnit="Pixel">
<!--使用自定义属性模板去除ListBox高亮显示框-->
<ListBox.ItemContainerStyle>
@@ -222,17 +222,28 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
order.order_items = new ObservableCollection<oms_wei_order_item_info>();
foreach (var item in orderItems.Where(oi => oi.order_id == order.order_id))
{
// 订单商品
item.item_order = order;
order.order_items.Add(item);
item.buy_map = byuMapList.FirstOrDefault(b => b.sku_code == item.out_sku_id && b.spu_code == item.out_product_id);
if (item.buy_map == null)
item.buy_map = byuMapList.FirstOrDefault(b => b.sku_code == item.sku_attr_str && b.spu_code == item.out_product_id);
if (item.buy_map == null)
item.buy_map = byuMapList.FirstOrDefault(b => b.sku_code == item.out_sku_id && b.spu_code == item.product_id);
if (item.buy_map == null)
item.buy_map = byuMapList.FirstOrDefault(b => b.sku_code == item.sku_attr_str && b.spu_code == item.product_id);
// 关联拍单关系
if (PddMobileBuyOrderForm.lstDangerItemWord.Any(d => item.title.Contains(d)))
{
// 危险物品禁止拍单
}
else
{
item.buy_map = byuMapList.FirstOrDefault(b => b.sku_code == item.out_sku_id && b.spu_code == item.out_product_id);
if (item.buy_map == null)
item.buy_map = byuMapList.FirstOrDefault(b => b.sku_code == item.sku_attr_str && b.spu_code == item.out_product_id);
if (item.buy_map == null)
item.buy_map = byuMapList.FirstOrDefault(b => b.sku_code == item.out_sku_id && b.spu_code == item.product_id);
if (item.buy_map == null)
item.buy_map = byuMapList.FirstOrDefault(b => b.sku_code == item.sku_attr_str && b.spu_code == item.product_id);
}
// 中转仓订单
if (item.item_order.order_items.Count > 1)
item.item_transit_orders.AddRange(transitOrderList.Where(t => t.order_no == item.order_id && t.order_sku_id == item.sku_id));
else
@@ -282,7 +282,7 @@
Style="{StaticResource BasePageButtonLightStyle}" Margin="4,0,0,0" Content="关联拍单" Width="56" Height="24"/>-->
<Button Grid.Column="1" Grid.Row="1" Background="Transparent" x:Name="btnBuyOrder" Click="btnBuyOrder_Click"
Visibility="{Binding item_order.IsWaitBuy, Converter={StaticResource visibleToVisibilityConverter}}"
Style="{StaticResource BasePageButtonLightStyle}" Margin="4,0,0,0" Content="{Binding buy_map,Converter={StaticResource HasTextVisibility}}"
Style="{StaticResource BasePageButtonLightStyle}" Margin="4,0,0,0"
HorizontalAlignment="Center" MinWidth="38" Height="24"/>
</Grid>
</Grid>
@@ -112,7 +112,18 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
{
if (this.DataContext is oms_wei_order_item_info order_item)
{
btnBuyOrder.Content = order_item.buy_map == null ? "关联拍单" : "拍单";
if (PddMobileBuyOrderForm.lstDangerItemWord.Any(d => order_item.title.Contains(d)))
{
btnBuyOrder.SetValue(ForegroundProperty, new SolidColorBrush(Color.FromArgb(255, 250, 70, 51)));
btnBuyOrder.SetValue(BorderBrushProperty, new SolidColorBrush(Color.FromArgb(255, 250, 70, 51)));
btnBuyOrder.SetValue(BackgroundProperty, new SolidColorBrush(Color.FromArgb(50, 250, 70, 51)));
btnBuyOrder.IsEnabled = false;
btnBuyOrder.Content = "危险品不支持中转拍单";
}
else
{
btnBuyOrder.Content = order_item.buy_map == null ? "关联拍单" : "拍单";
}
}
else
{
+4 -2
View File
@@ -131,12 +131,14 @@
</Style>
<Style x:Key="BasePageButtonLightStyle" TargetType="Button">
<Setter Property="Foreground" Value="{DynamicResource pageColorBrush}"/>
<Setter Property="BorderBrush" Value="{DynamicResource pageColorBrush}"/>
<Setter Property="Background" Value="{DynamicResource pageColorLightBrush}"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border x:Name="buttonBorder" Background="{DynamicResource pageColorLightBrush}" Cursor="Hand"
BorderBrush="{DynamicResource pageColorBrush}" CornerRadius="4"
<Border x:Name="buttonBorder" Background="{TemplateBinding Background}" Cursor="Hand"
BorderBrush="{TemplateBinding BorderBrush}" CornerRadius="4"
BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}">
<ContentPresenter Content="{TemplateBinding Content}"
ContentStringFormat="{TemplateBinding ContentStringFormat}"
+1 -1
View File
@@ -22,7 +22,7 @@ namespace AllBase
/// 版本ID
/// </summary>
public static int VersionCount = 109;
public static int VersionCount = 113;
public static string ServerUrl { get; set; } = "http://1.13.195.131:9000";
public static string DebugUrl { get; set; } = "http://localhost:9000";
@@ -110,6 +110,11 @@ namespace AllBase.Model.Result
get { return this.GetValue(x => x.ShopOrderSkuNameStr); }
set { this.SetValue(x => x.ShopOrderSkuNameStr, value); }
}
public string ShopOrderRefundStr
{
get { return this.GetValue(x => x.ShopOrderRefundStr); }
set { this.SetValue(x => x.ShopOrderRefundStr, value); }
}
public string TransitWarehouseIdStr
{
get { return this.GetValue(x => x.TransitWarehouseIdStr); }
@@ -153,6 +158,9 @@ namespace AllBase.Model.Result
get { return this.GetValue(x => x.PreAllocatedOrderNoStr); }
set { this.SetValue(x => x.PreAllocatedOrderNoStr, value); }
}
/// <summary>
/// 已取号, 提前取号, 已提交, 取号失败
/// </summary>
public string TransitOrderStatus
{
get
+33 -1
View File
@@ -36,6 +36,14 @@ namespace TemuKJD.ToolForms
public partial class PddMobileBuyOrderForm : BaseGeneralForm
{
public static string dangerItemWords = "打火机,压力罐,刀具,铡刀,充电宝,罂粟,礼炮,煤气罐,仿制枪,暖手宝,灭火器,火炮,纸炮枪,手枪,毫安,喷漆,酒精,锂电,电池,火柴,气罐,燃气,气泡弹,喷雾";
public static List<string> lstDangerItemWord { get; set; } = dangerItemWords.Split(',').ToList();
//{
// //get { return dangerItemWords.Split(',').ToList(); }
// get { return dangerItemWords.Split(',').ToList(); }
// set { }
//}
private BuyerLoginInfo buyer = null;
private oms_wei_order_item_info orderItem = null;
private WXBuyMapInfo buyMap = null;
@@ -106,6 +114,10 @@ namespace TemuKJD.ToolForms
this.txtShopOrderItemCnt.Text = orderItem.sku_cnt.ParseToString();
this.txtShopOrderItemPrice.Text = (orderItem.real_price * 0.01m).ParseToString();
this.txtOrderId.Text = orderItem.order_id;
var shop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ErpShopId == orderItem.shop_id.ParseToString());
this.txtShopName.Text = shop?.ShopAccount;
foreach (var warehouse in TransitWarehouseData.TransitWarehouseList)
{
@@ -305,6 +317,8 @@ namespace TemuKJD.ToolForms
var oneGoodsPrice = BaseRegex.GetIntJson(ref data, "goodsPrice");
var buyCnt = BaseRegex.GetIntJson(ref data, "goodsNumber");
var buyPrice = BaseRegex.GetIntJson(ref data, "payAmount");
if (buyPrice.IsNullOrZero())
buyPrice = BaseRegex.GetIntJson(ref data, "orderAmount");
var orderSn = BaseRegex.GetIntJson(ref data, "orderSn");
Invoke(new Action(() =>
{
@@ -672,9 +686,11 @@ namespace TemuKJD.ToolForms
body["orderPlatformCode"] = "WEISHOP";
var url = "https://po.e57.cn/prod-api/api/oms-api/externalProcurement/saveOrUpdate";
var dataStr = JsonHelper.SerializeObject(body);
//dataStr = "{\"orderNo\":\"3737339733954942720\",\"outOrderNo\":\"2606846854564\",\"buyerAccount\":\"测试\",\"outAmount\":\"2000\",\"purchaserNote\":\"测试\",\"express1Company\":\"\"" +
// ",\"express1Waybill\":\"\",\"platform\":\"XDYSHC\",\"orderPlatformCode\":\"WEISHOP\"}";
var exportRst = HttpResponseWXBLL.e57PostResponse(url, dataStr, "");
//<AjaxResult><msg>保存成功</msg><code>200</code></AjaxResult>
//<AjaxResult><msg>订单不存在:373733973395494272</msg><code>500</code></AjaxResult>
if (exportRst != null && exportRst.Contains("<code>200</code>"))
{
BaseMsgForm.ShowInfo("保存成功");
@@ -698,6 +714,22 @@ namespace TemuKJD.ToolForms
this.Close();
}
else
{
string msg = "";
string code = "";
try
{
System.Xml.XmlDocument xmlDoc = new System.Xml.XmlDocument();
code = xmlDoc["AjaxResult"]["code"].InnerText;
msg = xmlDoc["AjaxResult"]["msg"].InnerText;
}
catch
{
msg = exportRst.ParseToString();
}
BaseMsgForm.ShowError(msg);
}
}
private void pictureBox1_Click(object sender, EventArgs e)
+52
View File
@@ -83,6 +83,8 @@
this.splitContainer2 = new System.Windows.Forms.SplitContainer();
this.txtAddress = new System.Windows.Forms.TextBox();
this.panel1 = new System.Windows.Forms.Panel();
this.label26 = new System.Windows.Forms.Label();
this.txtOrderId = new System.Windows.Forms.TextBox();
this.pnlBuy = new System.Windows.Forms.Panel();
this.btnReMap = new DevComponents.DotNetBar.PanelEx();
this.label25 = new System.Windows.Forms.Label();
@@ -90,6 +92,8 @@
this.pnlMap = new System.Windows.Forms.Panel();
this.chkChangeWarehouseAddress = new Work.UserComponents.UcCheckBox(this.components);
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.label27 = new System.Windows.Forms.Label();
this.txtShopName = new System.Windows.Forms.TextBox();
((System.ComponentModel.ISupportInitialize)(this.pbCloseBase)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel2.SuspendLayout();
@@ -694,6 +698,10 @@
//
this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Right)));
this.panel1.Controls.Add(this.txtShopName);
this.panel1.Controls.Add(this.label27);
this.panel1.Controls.Add(this.label26);
this.panel1.Controls.Add(this.txtOrderId);
this.panel1.Controls.Add(this.pnlBuy);
this.panel1.Controls.Add(this.pnlMap);
this.panel1.Controls.Add(this.chkChangeWarehouseAddress);
@@ -720,6 +728,26 @@
this.panel1.Size = new System.Drawing.Size(487, 730);
this.panel1.TabIndex = 0;
//
// label26
//
this.label26.AutoSize = true;
this.label26.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label26.Location = new System.Drawing.Point(253, 92);
this.label26.Name = "label26";
this.label26.Size = new System.Drawing.Size(68, 17);
this.label26.TabIndex = 874;
this.label26.Text = "订单编号:";
//
// txtOrderId
//
this.txtOrderId.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.txtOrderId.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtOrderId.Location = new System.Drawing.Point(321, 89);
this.txtOrderId.Name = "txtOrderId";
this.txtOrderId.Size = new System.Drawing.Size(152, 23);
this.txtOrderId.TabIndex = 873;
//
// pnlBuy
//
this.pnlBuy.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
@@ -839,6 +867,26 @@
this.pictureBox1.TabStop = false;
this.pictureBox1.Click += new System.EventHandler(this.pictureBox1_Click);
//
// label27
//
this.label27.AutoSize = true;
this.label27.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label27.Location = new System.Drawing.Point(253, 63);
this.label27.Name = "label27";
this.label27.Size = new System.Drawing.Size(68, 17);
this.label27.TabIndex = 875;
this.label27.Text = "店铺名称:";
//
// txtShopName
//
this.txtShopName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.txtShopName.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtShopName.Location = new System.Drawing.Point(321, 60);
this.txtShopName.Name = "txtShopName";
this.txtShopName.Size = new System.Drawing.Size(152, 23);
this.txtShopName.TabIndex = 876;
//
// PddMobileBuyOrderForm
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
@@ -936,5 +984,9 @@
public System.Windows.Forms.Panel pnlBuy;
public System.Windows.Forms.Panel pnlMap;
private DevComponents.DotNetBar.PanelEx btnReMap;
private System.Windows.Forms.Label label26;
private System.Windows.Forms.TextBox txtOrderId;
private System.Windows.Forms.TextBox txtShopName;
private System.Windows.Forms.Label label27;
}
}