1中转仓订单退货功能 2中转仓订单运费根据oem或管理员设定调整 3其他一些问题修复

This commit is contained in:
wule committed 2026-07-18 18:31:29 +08:00
1 parent d6f81f9ef4
commit 2e20cbdf68
24 files changed
+834 -292

No files matched your search

+10 -2
View File
@@ -168,7 +168,7 @@
<Compile Include="Ctrls\ShopCtrls\ShopListCtrl.xaml.cs">
<DependentUpon>ShopListCtrl.xaml</DependentUpon>
</Compile>
<Compile Include="LoginWindows\LoginWindow.xaml.cs">
<Compile Include="Windows\LoginWindows\LoginWindow.xaml.cs">
<DependentUpon>LoginWindow.xaml</DependentUpon>
</Compile>
<Compile Include="Ctrls\OrderCtrls\OrderListCtrl.xaml.cs">
@@ -184,6 +184,9 @@
<DependentUpon>UcWindowBoxes.xaml</DependentUpon>
</Compile>
<Compile Include="Utils\UiCtrlUtils.cs" />
<Compile Include="Windows\OrderWindows\TransitAfterSaleWindow.xaml.cs">
<DependentUpon>TransitAfterSaleWindow.xaml</DependentUpon>
</Compile>
<Page Include="BaseWindows\BaseMsgWindow.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@@ -216,7 +219,7 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="LoginWindows\LoginWindow.xaml">
<Page Include="Windows\LoginWindows\LoginWindow.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
@@ -284,6 +287,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Windows\OrderWindows\TransitAfterSaleWindow.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs">
@@ -379,6 +386,7 @@
<ItemGroup>
<Resource Include="29_common_icon.ico" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
@@ -185,6 +185,8 @@
<CheckBox Content="过滤多件商品订单" x:Name="chkNoMultiOrder" BorderBrush="{StaticResource mainColorBrush}" FontSize="12" HorizontalAlignment="Left"
Margin="8,0,0,0" VerticalAlignment="Top" Checked="chkSubFilterSonditions_Checked" Unchecked="chkSubFilterSonditions_Checked" IsChecked="true"/>
</WrapPanel>
<TextBlock Margin="10,6" FontSize="12" VerticalAlignment="Top" HorizontalAlignment="Right" Text="注:需中转仓订单,店铺后台勿自行发货,发货后中转仓将无法打单"
Foreground="{StaticResource PageWarningBrushCC}"></TextBlock>
</Grid>
<Grid x:Name="lstTitle" Grid.Row="2" Margin="8,0,8,0" Background="{StaticResource ListHeadBackColorBrush}">
<Border BorderThickness="0,0,1,0" BorderBrush="{StaticResource ListHeadBorderColorBrush}">
@@ -266,10 +266,10 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
}));
break;
}
List<oms_wei_external_procurement_after_sale_info> pddTransitAfterSales = new List<oms_wei_external_procurement_after_sale_info>();
List<oms_wei_external_procurement_after_sale_info> transitAfterSaleList = new List<oms_wei_external_procurement_after_sale_info>();
try
{
pddTransitAfterSales = JsonHelper.DeserializeJsonToList<oms_wei_external_procurement_after_sale_info>(JObject.Parse(html5)["data"].ParseToString())
transitAfterSaleList = JsonHelper.DeserializeJsonToList<oms_wei_external_procurement_after_sale_info>(JObject.Parse(html5)["data"].ParseToString())
.OrderByDescending(p => p.created_time).ToList();
}
catch { }
@@ -310,6 +310,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
}
}));
//装载订单商品详情
order.orderItems = new ObservableCollection<oms_wei_order_item_info>();
foreach (var item in orderItems.Where(oi => oi.order_id == order.order_id))
@@ -318,6 +319,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
item.ItemOrder = order;
order.orderItems.Add(item);
// 更新店铺是否加入代发情况
item.Shop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ErpShopId == item.order_id);
Dispatcher.Invoke(new Action(() => { item.UpdateOrderItemBuyButton(); }));
@@ -338,16 +340,23 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
item.ItemTransitOrders.AddRange(transitOrderList.Where(t => t.order_no == item.order_id && t.order_sku_id == item.sku_id));
else
item.ItemTransitOrders.AddRange(transitOrderList.Where(t => t.order_no == item.order_id));
item.ItemTransitOrderAfterSales = transitAfterSaleList.Where(a => item.ItemTransitOrders.Any(t => t.out_order_no == a.order_code)).ToList();
// 中转仓买手订单
item.PddBuyerOrders = pddBuyerOrders.Where(po => po.wx_order_id == item.order_id && po.wx_sku_id == item.sku_id).ToList();
}
//装载订单售后详情
// 装载订单售后详情
order.refundItems = new ObservableCollection<oms_wei_refund_info>(refunds.Where(of => of.order_id == order.order_id));
// 读取订单后立即赋值,防止滚动时实时赋值造成卡顿
foreach (var orderItem in order.orderItems)
{
orderItem.SetItemRefund(order.refundItems.ToList());
orderItem.SetTransitOrder();
orderItem.SetItemRefund();
}
// 删除再添加,触发更新。 todo: 如果已存在相同订单,则直接修改更新
var orderExist = GlobalConfig.lstOrder.FirstOrDefault(o => o.order_id == order.order_id);
if (orderExist != null)
GlobalConfig.lstOrder.Remove(orderExist);
@@ -361,9 +370,6 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
{
GlobalConfig.lstOrder.Add(order);
}
if (order.orderItems.Count > 1)
{
}
Dispatcher.Invoke(new Action(() =>
{
@@ -518,12 +524,13 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
{
return true;
}
// 过滤多件商品
if (chkNoMultiOrder.IsChecked.ParseToBool() && order.orderItems.Sum(o => o.sku_cnt) > 1)
// 过滤多子单订单
if (chkNoMultiOrder.IsChecked.ParseToBool() && order.orderItems.Count() > 1)
{
return true;
}
if (chkOnlyWarehouseOrder.IsChecked.ParseToBool() && order.status >= 30 && order.orderItems.All(oi => oi.ItemTransitOrderWithVoid == null))
// 过滤非中转仓订单
if (chkOnlyWarehouseOrder.IsChecked.ParseToBool() && !order.IsWaitBuy && order.orderItems.All(oi => oi.ItemTransitOrderWithVoid == null))
{
return true;
}
@@ -39,28 +39,21 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
this.DataContextChanged += OrderListRowCtrl_DataContextChanged;
}
private void OrderListRowCtrl_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
private async void OrderListRowCtrl_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
{
if (this.DataContext is oms_wei_order_info order)
{
//Task.Run(() =>
//{
{
int index = 0;
foreach (var orderItem in order.orderItems)
{
gridChildOrder.RowDefinitions.Insert(gridChildOrder.RowDefinitions.Count - 1, new RowDefinition() { Height = GridLength.Auto });
//Thread.Sleep(5);
index++;
//Dispatcher.Invoke(new Action(() =>
//{
var rowItem = new OrderListRowItemCtrl() { DataContext = orderItem, Name = "rowItem" + index };
Grid.SetRow(rowItem, index);
this.gridChildOrder.Children.Add(rowItem);
//}));
if (index >= 5)
break;
}
//});
}
}
@@ -46,6 +46,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
ShopBLL.CheckShopLogin(shop);
if (shop.LoginStatus == "登录成功")
{
// 在线直接进店
shopLoginForm.openType = EnumOpenType.manage;
shopLoginForm.WindowState = System.Windows.Forms.FormWindowState.Maximized;
shopLoginForm.InitUrl = "https://store.weixin.qq.com/shop/home";
@@ -53,6 +54,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
}
else
{
// 掉线登录
shopLoginForm.openType = EnumOpenType.login;
shopLoginForm.ShowDialog();
@@ -96,11 +96,10 @@
Visibility="{Binding ItemOrder.ship_done_time_visibility}"/>
<uc:UcWaterMarkTextBox WaterMark="发货时间" Text="{Binding ItemOrder.ship_done_time_str}" Grid.Column="1" Grid.Row="2" Margin="60,2,4,2" VerticalAlignment="Top"
Background="Transparent" IsReadOnly="True" BorderThickness="0" TextWrapping="Wrap" Visibility="{Binding ItemOrder.ship_done_time_visibility}"/>
<!--refund_time_str-->
<TextBox Text="退款时间:" Grid.Column="1" Grid.Row="3" Margin="0,2,4,2" VerticalAlignment="Top" Background="Transparent" IsReadOnly="True" BorderThickness="0"
Visibility="{Binding refund_time_visibility}"/>
<uc:UcWaterMarkTextBox WaterMark="退款时间" Text="{Binding refund_time_str}" Grid.Column="1" Grid.Row="3" Margin="60,2,4,2" VerticalAlignment="Top"
Background="Transparent" IsReadOnly="True" BorderThickness="0" TextWrapping="Wrap" Visibility="{Binding refund_time_visibility}"/>
Visibility="{Binding RefundTimeVisibility}"/>
<uc:UcWaterMarkTextBox WaterMark="退款时间" Text="{Binding RefundTimeStr}" Grid.Column="1" Grid.Row="3" Margin="60,2,4,2" VerticalAlignment="Top"
Background="Transparent" IsReadOnly="True" BorderThickness="0" TextWrapping="Wrap" Visibility="{Binding RefundTimeVisibility}"/>
</Grid>
<!--订单利润-->
<Grid Grid.Column="4" Background="Transparent" VerticalAlignment="Center">
@@ -173,7 +172,7 @@
<TextBox Text="{Binding ItemRefund.reasonTextStr}" Grid.Column="1" Grid.Row="3" Margin="0,2,0,2" VerticalAlignment="Top" Background="Transparent" IsReadOnly="True"
x:Name="txtRefundReasonTextStr" BorderThickness="0" Foreground="#f56c6c" HorizontalAlignment="Center"
Visibility="{Binding ElementName=txtRefundReasonTextStr,Path=Text,Converter={StaticResource HasTextVisibility}}"/>
<TextBox Text="{Binding refundResultStr}" Grid.Column="1" Grid.Row="4" Margin="0,2,0,2" VerticalAlignment="Top" Background="Transparent" IsReadOnly="True"
<TextBox Text="{Binding RefundResultStr}" Grid.Column="1" Grid.Row="4" Margin="0,2,0,2" VerticalAlignment="Top" Background="Transparent" IsReadOnly="True"
x:Name="txtRefundResult" BorderThickness="0" Foreground="#f56c6c" HorizontalAlignment="Center"
Visibility="{Binding ElementName=txtRefundResult,Path=Text,Converter={StaticResource HasTextVisibility}}"/>
@@ -364,6 +363,14 @@
<Button Grid.Column="1" Grid.Row="2" x:Name="btnCancelEditAppRemark" Background="Transparent" HorizontalAlignment="Center" Foreground="{StaticResource PageLinkBrush}" BorderBrush="Transparent"
Margin="0,0,0,0" Content="取消" Click="btnCancelEditAppRemark_Click" Visibility="Collapsed"></Button>
</WrapPanel>
<WrapPanel Orientation="Horizontal" Grid.Column="1" Grid.Row="4" Visibility="{Binding AddEditTransitWarehouseAfterSaleStr,Converter={StaticResource HasTextVisibility}}">
<TextBox Text="中转售后:" Grid.Column="1" Grid.Row="2" Margin="0,1,-8,1" VerticalAlignment="Top" Background="Transparent" IsReadOnly="True" BorderBrush="Transparent" BorderThickness="1"/>
<uc:UcWaterMarkTextBox x:Name="txtTransitWarehouseAfterSale" WaterMark="订单售后" Text="{Binding ItemOrder.soft_remark}" Grid.Column="1" Grid.Row="2" Margin="0,1,0,1"
VerticalAlignment="Top" Background="Transparent" IsReadOnly="True" BorderThickness="1" TextWrapping="Wrap"/>
<Button Grid.Column="1" Grid.Row="2" x:Name="btnAddEditTransitWarehouseAfterSale" Background="Transparent" HorizontalAlignment="Center" Foreground="{StaticResource PageLinkBrush}" BorderBrush="Transparent"
Margin="2,0,0,0" Content="{Binding AddEditTransitWarehouseAfterSaleStr}" Click="btnAddEditTransitWarehouseAfterSale_Click"></Button>
</WrapPanel>
</Grid>
<!--操作-->
<Grid Grid.Column="8" Background="Transparent" VerticalAlignment="Center">
@@ -2,6 +2,7 @@
using _29WxOrderWpf.Converters;
using _29WxOrderWpf.Ctrls.BuyerCtrls;
using _29WxOrderWpf.UserControls;
using _29WxOrderWpf.Windows.OrderWindows;
using AllBase;
using AllBase.Helper;
using AllBase.Model;
@@ -204,9 +205,10 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
BaseMsgWindow.ShowError("请选择买手号");
return;
}
if (orderItem.sku_cnt > 1 || orderItem.ItemOrder.orderItems.Count > 1)
if (/*orderItem.sku_cnt > 1 ||*/ orderItem.ItemOrder.orderItems.Count > 1)
{
BaseMsgWindow.ShowError("多单或多件商品订单中转仓暂不支持");
//BaseMsgWindow.ShowError("多子单或多件商品订单中转仓暂不支持");
BaseMsgWindow.ShowError("多子单订单中转仓暂不支持");
return;
}
@@ -230,6 +232,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
orderItem = newOrder?.orderItems?.FirstOrDefault(oi => oi.sku_id == skuId);
if (orderItem == null)
return;
// 如果是退款单,弹出退款窗口
if (/*orderItem?.ItemRefund?.count > 0 &&*/ orderItem.refund_status > 1)
{
@@ -252,7 +255,6 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
return;
}
// 拍单前检测买手号是否在线
if (GlobalConfig.CurrentPddBuyer.status == "在线")
{
@@ -268,29 +270,6 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
return;
}
//if (!GlobalConfig.BuyConfig.IsUseAppBalance)
//{
// var url = BaseClass.Build29WxObjString("shop/get_shop_erp_merchant");
// var data = UserLogin.GetSignaturex();
// data += "&corporate_account_user_id=" + orderItem.Shop.ErpCorporateAccountUserId;
// data += "&manage_user_id=" + orderItem.Shop.ErpManageUserId;
// data += "&shop_id=" + orderItem.Shop.ErpShopId;
// var html = GetHtml.PostUtf8(url, data);
// if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
// html = GetHtml.PostUtf8(url, data);
// if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
// {
// Dispatcher.Invoke(new Action(() =>
// {
// //BaseMsgWindow.ShowError("未找到店铺账户!" + BaseRegex.GetStringJson(ref html, "msg"));
// //btnBuyOrder.Cursor = Cursors.Hand;
// GlobalConfig.BuyConfig.IsUseAppBalance = true;
// }));
// //return;
// }
//}
orderRetry:
// 拍单前查询账户余额
if (GlobalConfig.BuyConfig.IsUseAppBalance)
@@ -318,17 +297,12 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
{
Dispatcher.Invoke(new Action(() =>
{
//BaseMsgWindow.ShowError("未找到店铺账户!" + BaseRegex.GetStringJson(ref html, "msg"));
btnBuyOrder.Cursor = Cursors.Hand;
}));
if (orderItem.Shop.ErpCorporateAccountUserId == null && orderItem.Shop.ErpManageUserId == null)
{
GlobalConfig.BuyConfig.IsUseAppBalance = true;
StartUp.SaveBuyConfig();
BaseMsgWindow.ShowError("未找到店铺账户!" + BaseRegex.GetStringJson(ref html, "msg") + ",自动切换为快递余额拍单。");
goto orderRetry;
}
//return;
GlobalConfig.BuyConfig.IsUseAppBalance = true;
StartUp.SaveBuyConfig();
BaseMsgWindow.ShowError("未找到店铺账户!" + BaseRegex.GetStringJson(ref html, "msg") + ",自动切换为快递余额拍单。");
goto orderRetry;
}
if (!string.IsNullOrEmpty(html) && html.Contains("\"code\":200"))
{
@@ -340,14 +314,12 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
{
Dispatcher.Invoke(new Action(() =>
{
//BaseMsgWindow.ShowError("未找到店铺账户!");
btnBuyOrder.Cursor = Cursors.Hand;
}));
GlobalConfig.BuyConfig.IsUseAppBalance = true;
StartUp.SaveBuyConfig();
BaseMsgWindow.ShowError("未找到店铺账户!自动切换为快递余额拍单。");
goto orderRetry;
//return;
}
var balance = erpM.balance.ParseToDecimal();
@@ -355,10 +327,12 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
{
Dispatcher.Invoke(new Action(() =>
{
BaseMsgWindow.ShowError("ERP账户余额不足(剩余" + balance.ToString("0.00") + "元,拍单至少需保留10元),无法中转拍单,请先充值!");
btnBuyOrder.Cursor = Cursors.Hand;
}));
return;
GlobalConfig.BuyConfig.IsUseAppBalance = true;
StartUp.SaveBuyConfig();
BaseMsgWindow.ShowError("ERP账户余额不足(剩余" + balance.ToString("0.00") + "元,拍单至少需保留10元),无法中转拍单,自动切换为快递余额拍单。");
goto orderRetry;
}
}
catch
@@ -411,6 +385,32 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
return;
}
// 检测是否加入代发
if (orderItem.Shop?.LoginStatus == "登录成功")
{
var is29SupplierRst = WxOrderSupplierBLL.GetWxSupplierOrderList(orderItem.Shop, orderItem.order_id);
if (!is29SupplierRst.Contains("\"code\":0"))
is29SupplierRst = WxOrderSupplierBLL.GetWxSupplierOrderList(orderItem.Shop, orderItem.order_id);
if (is29SupplierRst.Contains("\"code\":0") && is29SupplierRst.Contains("\"supplierName\":\"29供货商\"")) // "supplierName":"29供货商"
{
orderItem.Shop.Is29Supplier = true;
}
else
{
ShopBLL.CheckShopLogin(orderItem.Shop);
if (orderItem.Shop?.LoginStatus == "登录成功")
{
Dispatcher.Invoke(new Action(() =>
{
BaseMsgWindow.ShowError("店铺后台未查询到该代发单,请确认店铺在线且商品加入代发");
btnBuyOrder.Cursor = Cursors.Hand;
}));
return;
}
}
}
// 掉线提示重登
if (orderItem.Shop?.LoginStatus != "登录成功")
{
foreach (var ord in GlobalConfig.lstFilterOrder.Where(o => o.shop_id.ParseToString() == orderItem.Shop.ErpShopId).ToList())
@@ -426,43 +426,8 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
}));
return;
}
// 检测是否加入代发
if (orderItem.Shop?.LoginStatus == "登录成功")
{
var is29SupplierRst = WxOrderSupplierBLL.GetWxSupplierOrderList(orderItem.Shop, orderItem.order_id);
if (!is29SupplierRst.Contains("\"code\":0"))
is29SupplierRst = WxOrderSupplierBLL.GetWxSupplierOrderList(orderItem.Shop, orderItem.order_id);
if (is29SupplierRst.Contains("\"code\":0") && is29SupplierRst.Contains("\"supplierName\":\"29供货商\"")) // "supplierName":"29供货商"
{
orderItem.Shop.Is29Supplier = true;
}
else
{
ShopBLL.CheckShopLogin(orderItem.Shop);
if (orderItem.Shop?.LoginStatus != "登录成功")
{
foreach (var ord in GlobalConfig.lstFilterOrder.Where(o => o.shop_id.ParseToString() == orderItem.Shop.ErpShopId).ToList())
{
// 更新代发管理情况
foreach (var oi in ord.orderItems)
Dispatcher.Invoke(new Action(() => { oi.UpdateOrderItemBuyButton(); }));
}
Dispatcher.Invoke(new Action(() =>
{
BaseMsgWindow.ShowError("请登录店铺");
btnBuyOrder.Cursor = Cursors.Hand;
}));
return;
}
Dispatcher.Invoke(new Action(() =>
{
BaseMsgWindow.ShowError("店铺后台未查询到该代发单,请确认店铺在线且商品加入代发");
btnBuyOrder.Cursor = Cursors.Hand;
}));
return;
}
}
// 打开拍单窗口
Dispatcher.Invoke(new Action(() =>
{
btnBuyOrder.Cursor = Cursors.Hand;
@@ -483,6 +448,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
// "&order_extra_type=1&refer_page_element=open_btn&source_channel=0&refer_page_name=goods_detail" +
// "&refer_page_id=10014_" + BaseClass.DateTimeToTimestampSeconds(DateTime.Now) + Randomx.GetNumber(3) + "_tny5ifswls&refer_page_sn=10014";
buyOrderForm.ShowBuyMask = true;
buyOrderForm.InitUrl = "https://mobile.yangkeduo.com/order_checkout.html?sku_id=" + orderItem.BuyMap.map_sku_id +
"&group_id=1" + Randomx.GetNumber(11) + "&goods_id=" + orderItem.BuyMap.map_goods_id + "&goods_number=" + orderItem.sku_cnt +
"&page_from=101";
@@ -496,6 +462,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
buyOrderForm.pnlMap.Visible = false;
}
buyOrderForm.ShowDialog();
// 窗口关闭后更新运费信息
MainWindow.Instance.Balance = BaseClass.Balance.ToString("0.00");
}));
});
@@ -511,12 +478,6 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
//if (order_item.BuyMap == null && order_item.ItemOrder.out_amount == 0)
// txtProfitForecast.Visibility = Visibility.Visible;
btnDeleteTransitOrder.Visibility = Visibility.Collapsed;
//if (BaseClass.SaLevel == 1 && order_item.ItemTransitOrder != null)
//{
// btnDeleteTransitOrder.Visibility = Visibility.Visible;
//}
order_item.UpdateOrderItemBuyButton();
Task.Run(() =>
@@ -531,11 +492,16 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
}));
});
// 作废重拍
if (order_item.ItemOrder.status == 20 /*&& order_item.refund_status <= 1*/ && order_item.ItemTransitOrder != null)
{
btnDeleteTransitOrder.Visibility = Visibility.Visible;
}
//待采购不显示所有采购信息状态(否则会显示作废订单状态)
else
{
btnDeleteTransitOrder.Visibility = Visibility.Collapsed;
}
// 待采购不显示所有采购信息状态(否则会显示作废订单状态)
if (GlobalConfig.OrderTabHeaderStr.StartsWith("待采购"))
{
wpBuyAccount.Visibility = Visibility.Collapsed;
@@ -545,10 +511,6 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
wpTransitBuyerRefundStatus.Visibility = Visibility.Collapsed;
}
}
else
{
//imgOrderItem.Source = null;
}
}
private void txtOutOrderNumStr_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
@@ -681,7 +643,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
if (orderItem.ItemTransitOrder == null)
{
BaseMsgWindow.ShowError("订单状态已修改,请确认后重试");
BaseMsgWindow.ShowError("要作废的中转订单不存在,请确认后重试");
return;
}
});
@@ -733,16 +695,28 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
//}' 成功返回code:0 失败返回code:1
string url2 = "https://po.e57.cn/prod-api/api/oms-api/external_procurement/discardOrder";
var data = new JObject();
data["orderNo"] = orderItem.order_id;
data["outOrderNo"] = orderItem.ItemTransitOrder.out_order_no;
var dataStr2 = JsonHelper.SerializeObject(data);
var data2 = new JObject();
data2["orderNo"] = orderItem.order_id;
data2["outOrderNo"] = orderItem.ItemTransitOrder.out_order_no;
var dataStr2 = JsonHelper.SerializeObject(data2);
var discardRst = HttpResponseWXBLL.e57PostResponse(url2, dataStr2, "");
if (discardRst.Contains("<code>0</code>") || discardRst.Contains("<code>200</code>"))
{
MainWindow.Instance.orderListCtrl.GetOrder(orderId);
MainWindow.Instance.orderListCtrl.FilterOrders();
BaseMsgWindow.ShowInfo("订单作废成功,请重新拍单");
var url3 = BaseClass.Build29WxObjString("user/get_all_user");
var data3 = UserLogin.GetSignaturex();
data3 += "&search_user_name=" + BaseClass.UserName;
var html = GetHtml.PostUtf8(url3, data3);
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
html = GetHtml.PostUtf8(url3, data3);
if (html.Contains("\"code\":200"))
{
BaseClass.Balance = BaseRegex.GetDecimalJson(ref html, "balance");
MainWindow.Instance.Balance = BaseClass.Balance.ToString("0.00");
}
}
else
{
@@ -763,5 +737,20 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
}
}
}
private void btnAddEditTransitWarehouseAfterSale_Click(object sender, RoutedEventArgs e)
{
if (this.DataContext is oms_wei_order_item_info orderItem)
{
var transitAfterSale = orderItem.ItemTransitOrderAfterSale;
if (orderItem.ItemTransitOrder?.warehouse_status == 2 && orderItem.AddEditTransitWarehouseAfterSaleStr == "添加")
{
BaseMsgWindow.ShowError("商品已出库,请联系卖家直接退回总店!");
return;
}
TransitAfterSaleWindow transitAfterSaleWindow = new TransitAfterSaleWindow(orderItem);
transitAfterSaleWindow.ShowDialog();
}
}
}
}
+2 -1
View File
@@ -1,6 +1,7 @@
using _29WxOrderWpf.BaseWindows;
using _29WxOrderWpf.Ctrls.BuyerCtrls;
using _29WxOrderWpf.Ctrls.OrderCtrls;
using _29WxOrderWpf.Windows.LoginWindows;
using AllBase;
using AllBase.DouYinModel.Result;
using AllBase.Extension;
@@ -69,7 +70,7 @@ namespace _29WxOrderWpf
new Thread(AutoAntiGrabbingMechanism).Start(); // 反抓包
#region 弹出登录窗口
LoginWindows.LoginWindow loginWindow = new LoginWindows.LoginWindow(App.args);
LoginWindow loginWindow = new LoginWindow(App.args);
loginWindow.Owner = this;
loginWindow.ShowDialog();
#endregion
@@ -1,9 +1,9 @@
<basewindows:BaseWindow x:Class="_29WxOrderWpf.LoginWindows.LoginWindow" xmlns:basewindows="clr-namespace:_29WxOrderWpf.BaseWindows"
<basewindows:BaseWindow x:Class="_29WxOrderWpf.Windows.LoginWindows.LoginWindow" xmlns:basewindows="clr-namespace:_29WxOrderWpf.BaseWindows"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:_29WxOrderWpf.LoginWindows"
xmlns:local="clr-namespace:_29WxOrderWpf.Windows.LoginWindows"
xmlns:userctrls="clr-namespace:_29WxOrderWpf.UserControls"
mc:Ignorable="d" Style="{StaticResource BaseNoneBorderWindowStyle}"
x:Name="loginWindow" Title="登录" Height="300" Width="400" ResizeMode="NoResize" Loaded="loginWindow_Loaded" Closing="BaseWindow_Closing">
@@ -23,7 +23,7 @@ using System.Windows.Shapes;
using Work;
using Work.BaseForms;
namespace _29WxOrderWpf.LoginWindows
namespace _29WxOrderWpf.Windows.LoginWindows
{
/// <summary>
/// LoginWindow.xaml 的交互逻辑
@@ -0,0 +1,99 @@
<basewindows:BaseWindow x:Class="_29WxOrderWpf.Windows.OrderWindows.TransitAfterSaleWindow" xmlns:basewindows="clr-namespace:_29WxOrderWpf.BaseWindows"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:_29WxOrderWpf.Windows.OrderWindows"
xmlns:userctrls="clr-namespace:_29WxOrderWpf.UserControls" xmlns:buyerctrls="clr-namespace:_29WxOrderWpf.Ctrls.BuyerCtrls"
mc:Ignorable="d" Style="{StaticResource BaseNoneBorderWindowStyle}"
Title="TransitAfterSaleWindow" Height="650" Width="600" ResizeMode="NoResize" Loaded="TransitAfterSaleWindow_Loaded">
<Grid Background="Transparent" x:Name="mainGrid" Margin="2">
<Grid.RowDefinitions>
<RowDefinition Height="50"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<Grid x:Name="gridTitle">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto"></ColumnDefinition>
<ColumnDefinition Width="auto"></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
</Grid.ColumnDefinitions>
<Image Source="{StaticResource main29WeixinIcon}" Height="50" Width="50" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="4"></Image>
<Label x:Name="lblAppName" FontSize="20" Margin="0,0,0,0" Foreground="{StaticResource mainColorLightBrush}" HorizontalAlignment="Center"
VerticalAlignment="Center" VerticalContentAlignment="Center" Content="中转单售后" Grid.Column="1"></Label>
</Grid>
<Border Background="White" Grid.Row="1" Padding="40, 20">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="Auto" MinHeight="20"></RowDefinition>
<RowDefinition Height="Auto" MinHeight="20"></RowDefinition>
<RowDefinition Height="Auto" MinHeight="20"></RowDefinition>
<RowDefinition Height="Auto" MinHeight="20"></RowDefinition>
<RowDefinition Height="Auto" MinHeight="20"></RowDefinition>
<RowDefinition Height="Auto" MinHeight="20"></RowDefinition>
<RowDefinition Height="Auto" MinHeight="20"></RowDefinition>
<RowDefinition Height="Auto" MinHeight="20"></RowDefinition>
<RowDefinition Height="Auto" MinHeight="20"></RowDefinition>
<RowDefinition Height="Auto" MinHeight="20"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100"></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
</Grid.ColumnDefinitions>
<Label VerticalAlignment="Top" HorizontalAlignment="Right" FontSize="14" Grid.Row="1">仓库:</Label>
<ComboBox x:Name="cmbWareHouse" Grid.Row="1" Grid.Column="1" VerticalContentAlignment="Center" VerticalAlignment="Top" IsReadOnly="True" IsEnabled="False"
Style="{StaticResource RoundedComboBox}" Height="28" SelectedIndex="0" Margin="0,0,0,25">
</ComboBox>
<Label VerticalAlignment="Top" HorizontalAlignment="Right" FontSize="14" Grid.Row="2">物流公司:</Label>
<TextBox x:Name="txtExpressName" Grid.Row="2" Grid.Column="1" BorderBrush="{StaticResource pageColorBrush}" BorderThickness="1" IsReadOnly="True"
Height="28" VerticalContentAlignment="Center" VerticalAlignment="Top" Style="{StaticResource BaseRoundCornerTextBoxStyle}" Margin="0,0,0,25"/>
<Label VerticalAlignment="Top" HorizontalAlignment="Right" FontSize="14" Grid.Row="3">物流单号:</Label>
<TextBox x:Name="txtWarehouseWaybill" Grid.Row="3" Grid.Column="1" BorderBrush="{StaticResource pageColorBrush}" BorderThickness="1" IsReadOnly="True"
Height="28" VerticalContentAlignment="Center" VerticalAlignment="Top" Style="{StaticResource BaseRoundCornerTextBoxStyle}" Margin="0,0,0,25"/>
<Label VerticalAlignment="Top" HorizontalAlignment="Right" FontSize="14" Grid.Row="4">地址解析:</Label>
<TextBox x:Name="txtAddressAnalysis" Grid.Row="4" Grid.Column="1" BorderBrush="{StaticResource pageColorBrush}" Height="80" BorderThickness="1" Padding="0,4"
VerticalContentAlignment="Top" VerticalAlignment="Top" Style="{StaticResource BaseRoundCornerTextBoxStyle}" TextWrapping="Wrap" Margin="0,0,0,25"/>
<Button Grid.Row="4" Grid.Column="1" x:Name="btnAddressAnalysis" Style="{StaticResource BasePageButtonStyle}" Click="btnAddressAnalysis_Click"
Margin="4, 29" Content="解 析" MinWidth="48" Height="28" HorizontalAlignment="Right" VerticalAlignment="Bottom" Padding="4"/>
<Label VerticalAlignment="Top" HorizontalAlignment="Right" FontSize="14" Grid.Row="5">收件人:</Label>
<TextBox x:Name="txtUser" Grid.Row="5" Grid.Column="1" BorderBrush="{StaticResource pageColorBrush}" BorderThickness="1"
Height="28" VerticalContentAlignment="Center" VerticalAlignment="Top" Style="{StaticResource BaseRoundCornerTextBoxStyle}" Margin="0,0,0,25"/>
<Label VerticalAlignment="Top" HorizontalAlignment="Right" FontSize="14" Grid.Row="6">联系电话:</Label>
<TextBox x:Name="txtMobile" Grid.Row="6" Grid.Column="1" BorderBrush="{StaticResource pageColorBrush}" BorderThickness="1"
Height="28" VerticalContentAlignment="Center" VerticalAlignment="Top" Style="{StaticResource BaseRoundCornerTextBoxStyle}" Margin="0,0,0,25"/>
<Label VerticalAlignment="Top" HorizontalAlignment="Right" FontSize="14" Grid.Row="7">省/市/区:</Label>
<Grid Grid.Row="7" Grid.Column="1">
<Grid.ColumnDefinitions>
<ColumnDefinition></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBox x:Name="txtProvince" Grid.Row="0" Grid.Column="0" BorderBrush="{StaticResource pageColorBrush}" BorderThickness="1"
Height="28" VerticalContentAlignment="Center" VerticalAlignment="Top" Style="{StaticResource BaseRoundCornerTextBoxStyle}" Margin="0,0,0,25"/>
<TextBox x:Name="txtCity" Grid.Row="0" Grid.Column="1" BorderBrush="{StaticResource pageColorBrush}" BorderThickness="1"
Height="28" VerticalContentAlignment="Center" VerticalAlignment="Top" Style="{StaticResource BaseRoundCornerTextBoxStyle}" Margin="2,0,2,25"/>
<TextBox x:Name="txtCounty" Grid.Row="0" Grid.Column="2" BorderBrush="{StaticResource pageColorBrush}" BorderThickness="1"
Height="28" VerticalContentAlignment="Center" VerticalAlignment="Top" Style="{StaticResource BaseRoundCornerTextBoxStyle}" Margin="0,0,0,25"/>
</Grid>
<Label VerticalAlignment="Top" HorizontalAlignment="Right" FontSize="14" Grid.Row="8">详细地址:</Label>
<TextBox x:Name="txtDetailAddress" Grid.Row="8" Grid.Column="1" BorderBrush="{StaticResource pageColorBrush}" BorderThickness="1"
Height="28" VerticalContentAlignment="Center" VerticalAlignment="Top" Style="{StaticResource BaseRoundCornerTextBoxStyle}" Margin="0,0,0,25"/>
<Button Grid.Row="9" Grid.Column="1" x:Name="btnAdd" Style="{StaticResource BasePageButtonStyle}" Click="btnAdd_Click"
Margin="0,0,0,0" Content="添 加" MinWidth="48" Height="28" HorizontalAlignment="left" VerticalAlignment="Top" Padding="4"/>
<Label x:Name="lblMsg" Foreground="{StaticResource PageWarningBrushCC}"></Label>
</Grid>
</Border>
<userctrls:UcWindowBoxes x:Name="ucWindowBox" VerticalAlignment="Top" HorizontalAlignment="Right" Margin="4" MaxBoxVisibility="Visible"/>
</Grid>
</basewindows:BaseWindow>
@@ -0,0 +1,185 @@
using _29WxOrderWpf.BaseWindows;
using AllBase;
using AllBase.Helper;
using AllBase.Model.DBModel;
using NaiBa.Util.Extension;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Interop;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using Work._29Tools.BLL;
namespace _29WxOrderWpf.Windows.OrderWindows
{
/// <summary>
/// TransitAfterSaleWindow.xaml 的交互逻辑
/// </summary>
public partial class TransitAfterSaleWindow : BaseWindow
{
public oms_wei_order_item_info OrderItem { get; set; }
public TransitAfterSaleWindow(oms_wei_order_item_info orderItem)
{
InitializeComponent();
if (orderItem != null)
OrderItem = orderItem;
}
private void mainGrid_Loaded(object sender, RoutedEventArgs e)
{
}
private void TransitAfterSaleWindow_Loaded(object sender, RoutedEventArgs e)
{
foreach (var warehouse in TransitWarehouseData.TransitWarehouseList)
{
this.cmbWareHouse.Items.Add(warehouse.TransName);
}
if (OrderItem != null)
{
this.cmbWareHouse.Text = TransitWarehouseData.TransitWarehouseList.FirstOrDefault(t => t.TransId == OrderItem.ItemTransitOrder?.platform)?.TransName;
this.txtExpressName.Text = OrderItem.ItemTransitOrder?.express_2_company;
this.txtWarehouseWaybill.Text = OrderItem.ItemTransitOrder?.express_2_waybill;
if (OrderItem.ItemTransitOrderAfterSale != null)
{
btnAdd.IsEnabled = false;
this.txtUser.Text = OrderItem.ItemTransitOrderAfterSale.recipient_name;
this.txtMobile.Text = OrderItem.ItemTransitOrderAfterSale.recipient_phone;
this.txtDetailAddress.Text = OrderItem.ItemTransitOrderAfterSale.refund_detail_address;
//this.txtAddress.Text = OrderItem.ItemTransitOrderAfterSale.refund_province + "/" + OrderItem.ItemTransitOrderAfterSale.refund_city + "/" + OrderItem.ItemTransitOrderAfterSale.refund_county;
this.txtProvince.Text = OrderItem.ItemTransitOrderAfterSale.refund_province;
this.txtCity.Text = OrderItem.ItemTransitOrderAfterSale.refund_city;
this.txtCounty.Text = OrderItem.ItemTransitOrderAfterSale.refund_county;
}
}
if (OrderItem?.ItemTransitOrder?.warehouse_status != 0 && OrderItem?.ItemTransitOrder?.warehouse_status != 1)
{
btnAdd.IsEnabled = false;
//BaseMsgWindow.ShowError("当前订单仓库状态不支持售后,请联系买家直接退回总店!");
lblMsg.Content = "当前订单仓库状态不支持售后,请联系买家直接退回总店!";
return;
}
}
private void btnAdd_Click(object sender, RoutedEventArgs e)
{
if (OrderItem?.ItemTransitOrder?.warehouse_status != 0 && OrderItem?.ItemTransitOrder?.warehouse_status != 1)
{
BaseMsgWindow.ShowError("当前订单仓库状态不支持售后,请联系买家直接退回总店!");
return;
}
//http://localhost:8088/oms-api/external_procurement/createReturnPackage
//{
// "orderNo": "3737011320735026432",
// "orderCode": "4600000167202606117621000767",
// "refundProvince": "安徽省",
// "refundCity": "合肥市",
// "refundCounty": "瑶海区",
// "refundDetailAddress": "某街道 1”,
// "recipientName": "张三",
// "recipientPhone": "13800138000"
//} post(json)请求方式,如果使用客户端账户扣款增加一个参数account_user
JObject data = new JObject();
data["orderNo"] = OrderItem.order_id;
data["orderCode"] = OrderItem.ItemTransitOrder?.order_code;
data["refundProvince"] = txtProvince.Text.Trim();
data["refundCity"] = txtCity.Text.Trim();
data["refundCounty"] = txtCounty.Text.Trim();
data["refundDetailAddress"] = txtDetailAddress.Text.Trim();
data["recipientName"] = txtUser.Text.Trim();
data["recipientPhone"] = txtMobile.Text.Trim();
data["account_user"] = BaseClass.UserName;
data["accountUser"] = BaseClass.UserName;
//data["platform"] = "WEISHOP";
var getTransitAfterSaleUrl = "https://po.e57.cn/prod-api/api/oms-api/external_procurement/createReturnPackage";
var getTransitAfterSaleStr = JsonHelper.SerializeObject(data);
var getTransitAfterSaleRst = HttpResponseWXBLL.e57PostResponse(getTransitAfterSaleUrl, getTransitAfterSaleStr, "");
if (!getTransitAfterSaleRst.ParseToString().Contains("<code>200</code>") && !getTransitAfterSaleRst.ParseToString().Contains("<code>0</code>"))
{
string msg = BaseRegex.GetStringXml(ref getTransitAfterSaleRst, "msg");
if (msg.IsNullOrEmpty())
msg = getTransitAfterSaleRst;
BaseMsgWindow.ShowError("中转售后添加失败,服务端返回 " + msg, "", this);
}
else
{
//<AjaxResult><msg>创建退货包裹成功</msg><code>0</code></AjaxResult>
MainWindow.Instance.orderListCtrl.GetOrder(OrderItem.order_id);
MainWindow.Instance.orderListCtrl.FilterOrders();
BaseMsgWindow.ShowInfo("添加退货包裹成功", "", this);
this.Close();
}
}
private void btnAddressAnalysis_Click(object sender, RoutedEventArgs e)
{
var txt = txtAddressAnalysis.Text.Trim();
txt = txt.Replace("\r", "").Replace("\n", "");
// 定义座机号的正则表达式
string landlinePattern = @"\d{3}-\d{8}|\d{4}-\d{7}";
// 定义手机号的正则表达式
string mobilePattern = @"1[3-9]\d{9}";
// 使用正则表达式匹配座机号和手机号
Match landlineMatch = Regex.Match(txt, landlinePattern);
Match mobileMatch = Regex.Match(txt, mobilePattern);
var phone = "";
if (landlineMatch.Success)
{
phone = landlineMatch.Value;
txt = txt.Replace(phone, " ");
}
if (mobileMatch.Success)
{
phone = mobileMatch.Value;
txt = txt.Replace(phone, " ");
}
if (!string.IsNullOrEmpty(phone))
{
txtMobile.Text = phone;
}
var province = GlobalConfig.Divisions.FirstOrDefault(d => txt.Contains(d.name));
if (province == null)
return;
txtProvince.Text = province.name;
var city = province.children.FirstOrDefault(c => txt.Contains(c.name));
if (city == null)
return;
txtCity.Text = city.name;
var county = city.children.FirstOrDefault(c => txt.Contains(c.name));
if (county == null)
return;
txtCounty.Text = county.name;
txt = txt.Replace(county.name, " ").Replace(city.name, " ").Replace(province.name, " ");
var tArr = txt.Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries);
tArr = tArr.OrderBy(t => t.Length).ToArray();
this.txtUser.Text = tArr.FirstOrDefault();
this.txtDetailAddress.Text = string.Join("", tArr).Replace(this.txtUser.Text, "");
}
}
}
+1
View File
@@ -173,6 +173,7 @@
<Compile Include="Model\DBModel\order_pdd_buyer_order.cs" />
<Compile Include="Model\DBModel\TransitWarehouseParam.cs" />
<Compile Include="Model\DBModel\WaybillHelper.cs" />
<Compile Include="Model\Division\Division.cs" />
<Compile Include="Model\Result\PddBuyerAfterSaleLiteInfo.cs" />
<Compile Include="Model\Result\PddBuyerOrderLiteInfo.cs" />
<Compile Include="Model\DBModel\ShopLoginInfo.cs" />
+18 -5
View File
@@ -18,11 +18,21 @@ namespace AllBase
{
public static class BaseClass
{
#region oem贴牌参数
public static string OemId { get; set; } = "";
public static string OemName { get; set; } = "";
public static bool IsOemOwner { get; set; } = false;
public static string AgentName { get; set; } = "";
public static string AgentCode { get; set; } = "";
public static bool IsShowRegister { get; set; } = true;
public static bool IsShowOpenAccount { get; set; } = true;
#endregion
/// <summary>
/// 版本ID
/// </summary>
public static int VersionCount = 160;
public static int VersionCount = 167;
public static string ServerUrl { get; set; } = "http://1.13.195.131:9000";
public static string DebugUrl { get; set; } = "http://localhost:9000";
@@ -61,7 +71,6 @@ namespace AllBase
public static string ProgromLogo = "";
public static string ProgromLogoIco = "";
public static string ToolName = "29供应链-微信小店订单管理工具";
public static string AgentName = "";
//public static string MainPath = "douyin";
public static string MainPath = "29wx";
public static string ServiceQQ = "569588500";
@@ -182,7 +191,13 @@ namespace AllBase
public static int MinSales = 0;
public static int MinPercent = 0;
public static int MinLevel = 0;
public static decimal Balance = 0;
public static int Points { get; set; }
/// <summary>
/// 店铺充值月费
/// </summary>
public static int ShopPointsPerMonth { get; set; } = 30;
public static decimal Balance { get; set; } = 0;
public static decimal PostagePerOrder { get; set; } = 2.2m;
public static int AlimamaPageCount = 0;
public static bool CloudTitle = false;
public static bool CloudBrand = false;
@@ -569,8 +584,6 @@ namespace AllBase
public static int DataUpdateThread = 0;
public static string PassWordBak { get; set; }
public static int Points { get; set; }
public static int ShopPointsPerMonth { get; set; }
public static string Mobile { get; set; }
public static string ParentAuthority { get; set; }
public static string ForbiddenPage { get; set; }
+10 -6
View File
@@ -1169,6 +1169,9 @@ Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrom
request.ReadWriteTimeout = timeOut * 1000;
}
request.Proxy = null;
request.Headers.Set(HttpRequestHeader.AcceptEncoding, "gzip, deflate");
request.ContentType = "application/x-www-form-urlencoded; charset=" + codeType;
if (!string.IsNullOrEmpty(contentType))
{
@@ -1186,12 +1189,13 @@ Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrom
Stream receiveStream = response.GetResponseStream();
StreamReader readStream = new StreamReader(receiveStream, Encoding.GetEncoding(codeType));
string data = readStream.ReadToEnd().Trim();
if (string.IsNullOrEmpty(data))
{
return "{\"code\": 400,\"data\": []}";
}
return data;
//string data = readStream.ReadToEnd().Trim();
//if (string.IsNullOrEmpty(data))
//{
// return "{\"code\": 400,\"data\": []}";
//}
//return data;
return ReadResponse(response);
}
catch (Exception e)
{
+3
View File
@@ -2,6 +2,7 @@
using AllBase.Model;
using AllBase.Model.Config;
using AllBase.Model.DBModel;
using AllBase.Model.Division;
using AllBase.Model.Result;
using NaiBa.Util;
using System;
@@ -40,6 +41,8 @@ namespace AllBase.Helper
/// </summary>
public static string OrderTabHeaderStr { get; set; } = "";
public static ConcurrentList<Division> Divisions { get; set; } = new ConcurrentList<Division>();
public static SystemSettings SystemSettings { get; set; }
public static System.Dynamic.ExpandoObject dicLocalStorage { get; set; }
@@ -81,6 +81,11 @@ namespace AllBase.Model.DBModel
get { return refundItems?.Count > 0 && refundItems.Any(r => r.status != "USER_CANCELD"); }
set { }
}
public bool IsRefundWithCancel
{
get { return refundItems?.Count > 0; }
set { }
}
/// <summary>
/// 紧急订单
/// </summary>
@@ -88,6 +93,10 @@ namespace AllBase.Model.DBModel
{
get
{
if (orderItems.Any(oi => oi.id == 3737775520624572928))
{
}
if (orderItems.Any(oi => oi.refund_status > 0 && oi.ItemTransitOrders.Count > 0 &&
oi.ItemTransitOrders.Any(t => !string.IsNullOrEmpty(t.refund_status) &&
!t.refund_status.Contains("退款成功") &&
+103 -73
View File
@@ -22,22 +22,106 @@ namespace AllBase.Model.DBModel
get { return this.GetValue(x => x.Shop); }
set { this.SetValue(x => x.Shop, value); }
}
public oms_wei_order_info ItemOrder
{
get { return this.GetValue(x => x.ItemOrder); }
set { this.SetValue(x => x.ItemOrder, value); }
}
public oms_wei_refund_info ItemRefund
{
get { return this.GetValue(x => x.ItemRefund); }
set { this.SetValue(x => x.ItemRefund, value); }
}
public void SetItemRefund(List<oms_wei_refund_info> itemRefunds)
public void SetItemRefund()
{
if (itemRefunds?.Count == 1)
if (ItemOrder?.refundItems?.Count == 1)
ItemRefund = ItemOrder?.refundItems?.FirstOrDefault();
else
ItemRefund = ItemOrder?.refundItems?.FirstOrDefault(r => r.sku_id == this.sku_id);
if (ItemRefund?.status != "MERCHANT_REFUND_SUCCESS" && ItemRefund?.status != "MERCHANT_RETURN_SUCCESS")
this.RefundResultStr = "";
else
this.RefundResultStr = "商品退款数量:" + ItemRefund.count + ",订单状态:" + ItemOrder.orderStatusStr;
this.ReturnWaybillId = ItemRefund?.return_waybill_id;
this.RefundTimeStr = BaseClass.StampToDateTime((ItemRefund?.create_time).ParseToInt()).ToString("yyyy-MM-dd HH:mm:ss");
this.RefundTimeVisibility = ItemRefund?.create_time > 0 ? Visibility.Visible : Visibility.Collapsed;
}
public List<oms_wei_external_procurement_log_info> ItemTransitOrders { get; set; } = new List<oms_wei_external_procurement_log_info>();
/// <summary>
/// 当前仓库订单(不可以是作废单)
/// </summary>
public oms_wei_external_procurement_log_info ItemTransitOrder
{
get { return this.GetValue(x => x.ItemTransitOrder); }
set { this.SetValue(x => x.ItemTransitOrder, value); }
}
/// <summary>
/// 当前仓库订单(可以是作废单)
/// </summary>
public oms_wei_external_procurement_log_info ItemTransitOrderWithVoid
{
get { return this.GetValue(x => x.ItemTransitOrderWithVoid); }
set { this.SetValue(x => x.ItemTransitOrderWithVoid, value); }
}
public List<oms_wei_external_procurement_after_sale_info> ItemTransitOrderAfterSales { get; set; } = new List<oms_wei_external_procurement_after_sale_info>();
public oms_wei_external_procurement_after_sale_info ItemTransitOrderAfterSale
{
get { return this.GetValue(x => x.ItemTransitOrderAfterSale); }
set { this.SetValue(x => x.ItemTransitOrderAfterSale, value); }
}
public List<order_pdd_buyer_order> PddBuyerOrders { get; set; } = new List<order_pdd_buyer_order>();
public order_pdd_buyer_order PddBuyerOrder
{
get { return this.GetValue(x => x.PddBuyerOrder); }
set { this.SetValue(x => x.PddBuyerOrder, value); }
}
public void SetTransitOrder()
{
this.ItemTransitOrder = ItemTransitOrders.FirstOrDefault(t => t.order_void_status != 1);
this.ItemTransitOrderWithVoid = ItemTransitOrders.FirstOrDefault();
this.PddBuyerOrder = PddBuyerOrders?.FirstOrDefault();
this.ItemTransitOrderAfterSale = ItemTransitOrderAfterSales.FirstOrDefault();
// 直接取号和更正取号显示的买手到仓库物流
if (ItemTransitOrder?.pre_allocated_order_no != 1 && ItemTransitOrder?.pre_allocated_order_no != 3)
this.TransitOrderWaybillToWareHouseStr = null;
else
this.TransitOrderWaybillToWareHouseStr = "买手物流:" + ItemTransitOrder.express_1_company + "-" + ItemTransitOrder.express_1_waybill;
// 提前取号物流
if (ItemTransitOrder?.pre_allocated_order_no != 2)
this.TransitOrderWaybillFakeStr = null;
else
this.TransitOrderWaybillFakeStr = "取号物流:" + ItemTransitOrder.express_1_company + "-" + ItemTransitOrder.express_1_waybill;
// 仓库下游物流
if (ItemTransitOrder == null || ItemTransitOrder.express_2_company.IsNullOrEmpty() || ItemTransitOrder.express_2_waybill.IsNullOrEmpty())
TransitOrderWaybillFromWareHouseStr = null;
else
TransitOrderWaybillFromWareHouseStr = "仓库物流:" + ItemTransitOrder.express_2_company + "-" + ItemTransitOrder.express_2_waybill;
if (this.order_id == "3737713100455836416")
{
}
// 仓库物流售后按钮上的文字,仓库作废单不存在仓库物流,所以此处必须是有效的仓库单(含作废失败)
if (this.ItemTransitOrder == null || !this.ItemOrder.IsRefundWithCancel)
AddEditTransitWarehouseAfterSaleStr = "";
else
AddEditTransitWarehouseAfterSaleStr = this.ItemTransitOrderAfterSale == null ? "添加" : "查看";
}
public string AddEditTransitWarehouseAfterSaleStr
{
get { return this.GetValue(x => x.AddEditTransitWarehouseAfterSaleStr); }
set { this.SetValue(x => x.AddEditTransitWarehouseAfterSaleStr, value); }
}
/// <summary>
@@ -79,72 +163,29 @@ namespace AllBase.Model.DBModel
set { this.SetValue(x => x.IsBuyGoodsBtnEnabled, value); }
}
public List<oms_wei_external_procurement_log_info> ItemTransitOrders { get; set; } = new List<oms_wei_external_procurement_log_info>();
/// <summary>
/// 当前仓库订单(不可以是作废单)
/// </summary>
public oms_wei_external_procurement_log_info ItemTransitOrder
{
get { return ItemTransitOrders.FirstOrDefault(t => t.order_void_status != 1); }
set { }
}
/// <summary>
/// 当前仓库订单(可以是作废单)
/// </summary>
public oms_wei_external_procurement_log_info ItemTransitOrderWithVoid
{
get { return ItemTransitOrders.FirstOrDefault(); }
set { }
}
public List<order_pdd_buyer_order> PddBuyerOrders { get; set; } = new List<order_pdd_buyer_order>();
public order_pdd_buyer_order PddBuyerOrder
{
get { return PddBuyerOrders.FirstOrDefault(); }
set { }
}
/// <summary>
/// 拍单物流
/// </summary>
public string TransitOrderWaybillToWareHouseStr
{
get
{
// 直接取号和更正取号
if (ItemTransitOrder?.pre_allocated_order_no != 1 && ItemTransitOrder?.pre_allocated_order_no != 3)
return null;
return "买手物流:" + ItemTransitOrder.express_1_company + "-" + ItemTransitOrder.express_1_waybill;
}
set { }
get { return this.GetValue(x => x.TransitOrderWaybillToWareHouseStr); }
set { this.SetValue(x => x.TransitOrderWaybillToWareHouseStr, value); }
}
/// <summary>
/// 提前取号物流
/// </summary>
public string TransitOrderWaybillFakeStr
{
get
{
// 提前取号
if (ItemTransitOrder?.pre_allocated_order_no != 2)
return null;
return "取号物流:" + ItemTransitOrder.express_1_company + "-" + ItemTransitOrder.express_1_waybill;
}
set { }
get { return this.GetValue(x => x.TransitOrderWaybillFakeStr); }
set { this.SetValue(x => x.TransitOrderWaybillFakeStr, value); }
}
/// <summary>
/// 仓库物流
/// </summary>
public string TransitOrderWaybillFromWareHouseStr
{
get
{
// 仓库下游物流
if (ItemTransitOrder == null || ItemTransitOrder.express_2_company.IsNullOrEmpty() || ItemTransitOrder.express_2_waybill.IsNullOrEmpty())
return null;
return "仓库物流:" + ItemTransitOrder.express_2_company + "-" + ItemTransitOrder.express_2_waybill;
}
set { }
get { return this.GetValue(x => x.TransitOrderWaybillFromWareHouseStr); }
set { this.SetValue(x => x.TransitOrderWaybillFromWareHouseStr, value); }
}
public string BuyerTransitWaybillStatusStr
{
@@ -483,44 +524,33 @@ namespace AllBase.Model.DBModel
/// <summary>
/// 退款状态文本
/// </summary>
public string refundResultStr
public string RefundResultStr
{
get
{
if (ItemRefund == null)
return "";
if (ItemRefund.status != "MERCHANT_REFUND_SUCCESS" && ItemRefund.status != "MERCHANT_RETURN_SUCCESS")
return "";
return "商品退款数量:" + ItemRefund.count + ",订单状态:" + ItemOrder.orderStatusStr;
}
set { }
get { return this.GetValue(x => x.RefundResultStr); }
set { this.SetValue(x => x.RefundResultStr, value); }
}
public string ReturnWaybillId
{
get { return ItemRefund?.return_waybill_id; }
set { }
get { return this.GetValue(x => x.ReturnWaybillId); }
set { this.SetValue(x => x.ReturnWaybillId, value); }
}
/// <summary>
/// 订单退款时间
/// </summary>
public string refund_time_str
public string RefundTimeStr
{
get { return BaseClass.StampToDateTime((ItemRefund?.create_time).ParseToInt()).ToString("yyyy-MM-dd HH:mm:ss"); }
set { }
get { return this.GetValue(x => x.RefundTimeStr); }
set { this.SetValue(x => x.RefundTimeStr, value); }
}
/// <summary>
/// 订单退款时间可见
/// </summary>
public Visibility refund_time_visibility
public Visibility RefundTimeVisibility
{
get
{
return (this.ItemRefund?.create_time) > 0 ? Visibility.Visible : Visibility.Collapsed;
}
set { }
get { return this.GetValue(x => x.RefundTimeVisibility); }
set { this.SetValue(x => x.RefundTimeVisibility, value); }
}
/// <summary>
+16
View File
@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AllBase.Model.Division
{
public class Division
{
public string code { get; set; } // "110000",
public string name { get; set; } // "北京市",
public string level { get; set; } // "province",
public List<Division> children { get; set; }
}
}
+1
View File
@@ -117,6 +117,7 @@
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.IO.Compression.FileSystem" />
<Reference Include="System.Management" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml.Linq" />
+83 -49
View File
@@ -1,4 +1,7 @@
using AllBase;
using AllBase.Helper;
using AllBase.Model.Division;
using NaiBa.Util;
using NaiBa.Util.Extension;
using System;
using System.Collections.Generic;
@@ -6,6 +9,7 @@ using System.Diagnostics;
using System.Drawing;
using System.Drawing.Text;
using System.IO;
using System.IO.Compression;
using System.Management;
using System.Runtime.InteropServices;
using System.Text;
@@ -14,6 +18,7 @@ using System.Threading.Tasks;
using System.Windows.Forms;
using System.Xml;
using Work.Api;
using Work.BaseForms;
namespace Work
{
@@ -39,7 +44,7 @@ namespace Work
//new Thread(Update).Start();//--------检查更新
//new Thread(GetAuthConfig).Start();
//new Thread(new JumpUpProductNew().Ini).Start();
//new Thread(CheckFiles).Start();
new Thread(CheckFiles).Start();
//new Thread(UpdateTime).Start();
//new Thread(GetMacCode).Start();
@@ -371,58 +376,87 @@ namespace Work
/// </summary>
private void CheckFiles()
{
FileBase.DirectoryCreate("cefSharp");
List<KeyValueBase> files = new List<KeyValueBase>();
files.Add(new KeyValueBase("taobao_address.tjm", "taobao_address.js"));
files.Add(new KeyValueBase("1688_address.tjm", "1688address.js"));
files.Add(new KeyValueBase("CClib.dll", "CClib.ico"));
//files.Add(new KeyValueBase("pdd.dat", "pdd.ico"));
//files.Add(new KeyValueBase("WmCode.dll", "WmCode.ico"));
files.Add(new KeyValueBase("crawlerInfoInterface.js", "crawlerInfoInterface.js"));
files.Add(new KeyValueBase("crawlerInfo.js", "crawlerInfo.js"));
files.Add(new KeyValueBase("Interop.MSScriptControl.dll", "Interop.MSScriptControl.ico"));
//files.Add(new KeyValueBase("XGCode.dll", "XGCode.ico"));
files.Add(new KeyValueBase("Newtonsoft.Json.dll", "Newtonsoft.Json.dll"));
files.Add(new KeyValueBase("Newtonsoft.Json.xml", "Newtonsoft.Json.xml"));
//FileBase.DirectoryCreate("cefSharp");
//List<KeyValueBase> files = new List<KeyValueBase>();
//files.Add(new KeyValueBase("taobao_address.tjm", "taobao_address.js"));
//files.Add(new KeyValueBase("1688_address.tjm", "1688address.js"));
//files.Add(new KeyValueBase("CClib.dll", "CClib.ico"));
////files.Add(new KeyValueBase("pdd.dat", "pdd.ico"));
////files.Add(new KeyValueBase("WmCode.dll", "WmCode.ico"));
//files.Add(new KeyValueBase("crawlerInfoInterface.js", "crawlerInfoInterface.js"));
//files.Add(new KeyValueBase("crawlerInfo.js", "crawlerInfo.js"));
//files.Add(new KeyValueBase("Interop.MSScriptControl.dll", "Interop.MSScriptControl.ico"));
////files.Add(new KeyValueBase("XGCode.dll", "XGCode.ico"));
//files.Add(new KeyValueBase("Newtonsoft.Json.dll", "Newtonsoft.Json.dll"));
//files.Add(new KeyValueBase("Newtonsoft.Json.xml", "Newtonsoft.Json.xml"));
files.Add(new KeyValueBase("zxing.dll", "zxing.dll"));
//files.Add(new KeyValueBase("NPOI.dll", "NPOI.dll"));
//files.Add(new KeyValueBase("NPOI.OOXML.dll", "NPOI.OOXML.dll"));
//files.Add(new KeyValueBase("NPOI.OpenXml4Net.dll", "NPOI.OpenXml4Net.dll"));
//files.Add(new KeyValueBase("NPOI.OpenXmlFormats.dll", "NPOI.OpenXmlFormats.dll"));
files.Add(new KeyValueBase("OrderComing.ico", "temp/OrderComing.wav"));
files.Add(new KeyValueBase("AfterSale.ico", "temp/AfterSale.wav"));
//files.Add(new KeyValueBase("9527.ico", "temp/9527.wav"));
//files.Add(new KeyValueBase("本墨绪圆.dll", "本墨绪圆.dll"));
//if(!File.Exists("cefSharp/CefSharp.dll"))
// files.Add(new KeyValueBase("cefSharp.zip", "cefSharp.zip"));
//files.Add(new KeyValueBase("icoz.ico", "icoz.ico"));
foreach (KeyValueBase k in files)
{
if (FileBase.Exists(k.Key))
continue;
//if (k.Key.Contains("OrderComing.ico") || k.Key.Contains("AfterSale.ico"))
//{
// if (GetHtml.DownloadFile("http://dl.qixiaoke.com/files/" + k.Key, k.Value))
// FileBase.Move(k.Key + ".bak", k.Value);
//}
//else
//{
// if (GetHtml.DownloadFile("http://dl.qixiaoke.com/files/" + k.Value, k.Key + ".bak"))
// FileBase.Move(k.Key + ".bak", k.Key);
//}
}
//if (FileBase.Exists("cefSharp.zip"))
//files.Add(new KeyValueBase("zxing.dll", "zxing.dll"));
////files.Add(new KeyValueBase("NPOI.dll", "NPOI.dll"));
////files.Add(new KeyValueBase("NPOI.OOXML.dll", "NPOI.OOXML.dll"));
////files.Add(new KeyValueBase("NPOI.OpenXml4Net.dll", "NPOI.OpenXml4Net.dll"));
////files.Add(new KeyValueBase("NPOI.OpenXmlFormats.dll", "NPOI.OpenXmlFormats.dll"));
//files.Add(new KeyValueBase("OrderComing.ico", "temp/OrderComing.wav"));
//files.Add(new KeyValueBase("AfterSale.ico", "temp/AfterSale.wav"));
////files.Add(new KeyValueBase("9527.ico", "temp/9527.wav"));
////files.Add(new KeyValueBase("本墨绪圆.dll", "本墨绪圆.dll"));
////if(!File.Exists("cefSharp/CefSharp.dll"))
//// files.Add(new KeyValueBase("cefSharp.zip", "cefSharp.zip"));
////files.Add(new KeyValueBase("icoz.ico", "icoz.ico"));
//foreach (KeyValueBase k in files)
//{
// ZipHelper.DecomparessFile(Application.StartupPath + @"\cefSharp.zip",
// Application.StartupPath + @"\cefSharp\");
// FileBase.Delete("cefSharp.zip");
// if (FileBase.Exists(k.Key))
// continue;
// //if (k.Key.Contains("OrderComing.ico") || k.Key.Contains("AfterSale.ico"))
// //{
// // if (GetHtml.DownloadFile("http://dl.qixiaoke.com/files/" + k.Key, k.Value))
// // FileBase.Move(k.Key + ".bak", k.Value);
// //}
// //else
// //{
// // if (GetHtml.DownloadFile("http://dl.qixiaoke.com/files/" + k.Value, k.Key + ".bak"))
// // FileBase.Move(k.Key + ".bak", k.Key);
// //}
//}
//new Thread(new MulitServicerSet("拼多多商家").Login).Start();
////if (FileBase.Exists("cefSharp.zip"))
////{
//// ZipHelper.DecomparessFile(Application.StartupPath + @"\cefSharp.zip",
//// Application.StartupPath + @"\cefSharp\");
//// FileBase.Delete("cefSharp.zip");
////}
////new Thread(new MulitServicerSet("拼多多商家").Login).Start();
// 取地址信息
//new AddressSetIni().Ini();
//new AddressSetIni().getAddress1688();
//// 取地址信息
////new AddressSetIni().Ini();
////new AddressSetIni().getAddress1688();
// 区划
if (!FileBase.Exists("temp\\Division60715"))
{
if (GetHtml.DownloadFile(BaseClass.ServerUrl + "/Download/" + "Division60715.zip", "temp\\Division60715.dll" + ".bak"))
{
FileBase.Move("temp\\Division60715.dll" + ".bak", "temp\\Division60715.zip");
ZipFile.ExtractToDirectory(Path.Combine(Environment.CurrentDirectory, "temp\\Division60715.zip"), Path.Combine(Environment.CurrentDirectory, "temp"));
File.Delete(Path.Combine(Environment.CurrentDirectory, "temp\\Division60715.zip"));
}
}
if (1 == 1)
{
string filePath = Path.Combine(Environment.CurrentDirectory, "temp\\Division60715");
using (StreamReader sr = new StreamReader(filePath, System.Text.Encoding.UTF8))
{
try
{
string cateStr = sr.ReadToEnd().Trim();
GlobalConfig.Divisions.AddRange(JsonHelper.DeserializeJsonToList<Division>(cateStr));
}
catch (Exception ex)
{
BaseMsgForm.ShowError("区划获取失败:" + ex.Message);
if (GlobalConfig.Divisions == null)
GlobalConfig.Divisions = new ConcurrentList<Division>();
}
}
}
}
/// <summary>
/// 执行CMD命令
+5 -1
View File
@@ -132,8 +132,12 @@ namespace Work
BaseClass.GroupId = BaseRegex.GetStringJson(ref html, "group_id").ParseToInt();
//BaseClass.AuthorizedAmount = BaseRegex.GetNullableDecimalJson(ref html, "authorized_amount");
BaseClass.Points = BaseRegex.GetStringJson(ref html, "points").ParseToInt();
BaseClass.Balance = BaseRegex.GetDecimalJson(ref html, "balance");
BaseClass.ShopPointsPerMonth = BaseRegex.GetStringJson(ref html, "shop_points_per_month").ParseToInt();
BaseClass.Balance = BaseRegex.GetDecimalJson(ref html, "balance");
BaseClass.PostagePerOrder = Math.Max(2.2m, BaseRegex.GetDecimalJson(ref html, "postage_per_order"));
BaseClass.OemId = BaseRegex.GetStringJson(ref html, "oem_id");
BaseClass.OemName = BaseRegex.GetStringJson(ref html, "oem_name");
BaseClass.IsOemOwner = BaseRegex.GetBoolJson(ref html, "is_oem_owner");
if (BaseClass.GroupId != 3 && BaseClass.GroupId != 4 && BaseClass.GroupId != 9 && BaseClass.GroupId != 10 && BaseClass.GroupId != 11)
{
+117 -29
View File
@@ -23,6 +23,7 @@ using System.Data;
using System.Drawing;
using System.Linq;
using System.Runtime.InteropServices.ComTypes;
using System.Security.Policy;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
@@ -40,6 +41,7 @@ namespace TemuKJD.ToolForms
{
public bool IsAutoBuy { get; set; } = true;
public bool IsFormLoad { get; set; } = false;
public bool ShowBuyMask { get; set; } = false;
public int CloseAfterSecond { get; set; }
public string InitUrl = "";
@@ -98,6 +100,27 @@ namespace TemuKJD.ToolForms
});
}
if (this.ShowBuyMask == true)
{
Task.Run(() =>
{
for (int i = 3; i > 0; i--)
{
Invoke(new Action(() =>
{
this.pnlMask.Visible = true;
this.pnlMask.Text = "自动拍单倒计时\r\n" + i;
}));
Thread.Sleep(1000);
}
Invoke(new Action(() =>
{
this.pnlMask.Visible = false;
}));
});
}
if (buyMap != null)
{
@@ -173,6 +196,7 @@ namespace TemuKJD.ToolForms
cefWebBrowser.AddressChanged += CefWebBrowser_AddressChanged;
cefWebBrowser.LoadError += CefWebBrowser_LoadError;
cefWebBrowser.Dock = DockStyle.Fill;
cefWebBrowser.SendToBack();
//js绑定C#对象
//PDDShopBrowserObject shopObj = new PDDShopBrowserObject();
@@ -283,7 +307,11 @@ namespace TemuKJD.ToolForms
//static int GetAntiContentsTimes = 40;
private void RequestHandler_ResourceLoadComplete(object sender, string url, string postData, string responseData, IRequest request)
{
Task.Run(() => { DoResourceLoadComplete(url, postData, responseData); });
}
public void DoResourceLoadComplete(string url, string postData, string responseData)
{
if (url.StartsWith("https://mobile.yangkeduo.com/order_checkout.html") && responseData.Contains("该商品已下架"))
{
IsSoldOut = true;
@@ -348,12 +376,12 @@ namespace TemuKJD.ToolForms
this.cmbTransitWarehouse.Text = "";
// 自动填写拍单信息界面
this.txtBuyGoodsId.Text = goodsId.ParseToString();
this.txtBuySkuId.Text = skuId.ParseToString();
this.txtBuyGoodsName.Text = goodsName;
this.txtBuySkuName.Text = spec;
this.txtBuyCnt.Text = buyCnt.ParseToString();
this.txtBuyPrice.Text = (buyPrice * 0.01m).ParseToString();
if (!goodsId.IsNullOrZero()) this.txtBuyGoodsId.Text = goodsId.ParseToString();
if (!skuId.IsNullOrZero()) this.txtBuySkuId.Text = skuId.ParseToString();
if (!goodsName.IsNullOrEmpty()) this.txtBuyGoodsName.Text = goodsName;
if (!spec.IsNullOrEmpty()) this.txtBuySkuName.Text = spec;
if (!buyCnt.IsNullOrZero()) this.txtBuyCnt.Text = buyCnt.ParseToString();
if (!buyPrice.IsNullOrZero()) this.txtBuyPrice.Text = (buyPrice * 0.01m).ParseToString();
}));
});
}
@@ -392,12 +420,12 @@ namespace TemuKJD.ToolForms
var buyPrice = BaseRegex.GetIntJson(ref data, "pay_price");
Invoke(new Action(() =>
{
this.txtBuyGoodsId.Text = goodsId.ParseToString();
this.txtBuySkuId.Text = skuId.ParseToString();
this.txtBuyGoodsName.Text = goodsName;
this.txtBuySkuName.Text = spec;
this.txtBuyCnt.Text = buyCnt.ParseToString();
this.txtBuyPrice.Text = (buyPrice * 0.01m).ParseToString();
if (!goodsId.IsNullOrZero()) this.txtBuyGoodsId.Text = goodsId.ParseToString();
if (!skuId.IsNullOrZero()) this.txtBuySkuId.Text = skuId.ParseToString();
if (!goodsName.IsNullOrEmpty()) this.txtBuyGoodsName.Text = goodsName;
if (!spec.IsNullOrEmpty()) this.txtBuySkuName.Text = spec;
if (!buyCnt.IsNullOrZero()) this.txtBuyCnt.Text = buyCnt.ParseToString();
if (!buyPrice.IsNullOrZero()) this.txtBuyPrice.Text = (buyPrice * 0.01m).ParseToString();
}));
Invoke(new Action(() =>
@@ -406,12 +434,12 @@ namespace TemuKJD.ToolForms
var transit = TransitWarehouseData.TransitWarehouseList.FirstOrDefault(t => t.TransDetailAddress == txtBuyTransitWarehouse.Text.Trim());
if (transit != null && IsChangeAddress == false && HasChangeAddress == false)
{
if(!IsSoldOut)
if (!IsSoldOut)
{
Task.Run(() =>
{
IsChangeAddress = true;
Thread.Sleep(1000);
Thread.Sleep(100);
var sourceCodeRst = GetSourceCode(transit);
if (sourceCodeRst.Contains("失败"))
{
@@ -445,14 +473,16 @@ namespace TemuKJD.ToolForms
}
// 订单提交接口
//https://mobile.yangkeduo.com/proxy/api/order/prepay?pdduid=8161628055192
if (url.StartsWith("https://mobile.yangkeduo.com/proxy/api/order/prepay?pdduid="))
{
var data = postData;
Task.Run(() =>
{
var data = postData;
Invoke(new Action(() =>
Invoke(new Action(() =>
{
txtBuyOrderId.Text = BaseRegex.GetStringJson(ref data, "order_sn");
//txtBuyOrderId.Text = BaseRegex.GetStringJson(ref data, "order_sn");
txtBuyOrderId.Text = BaseRegex.GetStringJsonByRegs(ref data, "", "order_sn", "orderSn");
}));
});
}
@@ -508,9 +538,19 @@ namespace TemuKJD.ToolForms
/// <returns></returns>
public string ChangeAddress(TransitWarehouseParam transit)
{
Thread.Sleep(1000);
Thread.Sleep(200);
var host = cefWebBrowser.GetBrowser().GetHost();
var client = cefWebBrowser.GetDevToolsClient();
for (int i = 0; i < 20; i++)
{
Thread.Sleep(50);
if (host == null || client == null)
{
host = cefWebBrowser.GetBrowser().GetHost();
client = cefWebBrowser.GetDevToolsClient();
continue;
}
}
if (host == null || client == null)
{
return "页面未加载";
@@ -521,53 +561,99 @@ namespace TemuKJD.ToolForms
//for (i=0; i< elements.length;i++){
// var element = elements[i];
// if (element.outerHTML.indexOf('当前收货地址为') >= 0) {
element.click();
element.click();
return 'success';
// break;
// }
//}
})();";
var ts1 = client.Runtime.EvaluateAsync(jsStr1, null, true, null, null, true, null, true);
ts1.Wait(5000);
Thread.Sleep(Randomx.GetId(1500, 2500));
for (int i = 0; i < 20; i++)
{
if (ts1.Result.Result.Value is string rstStr)
{
if (rstStr == "success")
break;
}
Thread.Sleep (100);
ts1 = client.Runtime.EvaluateAsync(jsStr1, null, true, null, null, true, null, true);
ts1.Wait(5000);
}
//Thread.Sleep(Randomx.GetId(1500, 2500));
Thread.Sleep(Randomx.GetId(300, 500));
jsStr1 = @"(function() { var elements = document.getElementsByTagName('span');
for (i=0; i< elements.length;i++){
var element = elements[i];
if (element.innerHTML.indexOf('修改') == 0) {
element.click();
break;
return 'success';
}
}
})();";
ts1 = client.Runtime.EvaluateAsync(jsStr1, null, true, null, null, true, null, true);
ts1.Wait(5000);
Thread.Sleep(Randomx.GetId(1500, 2500));
for (int i = 0; i < 20; i++)
{
if (ts1.Result.Result.Value is string rstStr)
{
if (rstStr == "success")
break;
}
Thread.Sleep(100);
ts1 = client.Runtime.EvaluateAsync(jsStr1, null, true, null, null, true, null, true);
ts1.Wait(5000);
}
//Thread.Sleep(Randomx.GetId(1500, 2500));
Thread.Sleep(Randomx.GetId(300, 500));
jsStr1 = @"(function() { var elements = document.getElementsByTagName('span');
for (i=0; i< elements.length;i++){
var element = elements[i];
if (element.innerHTML.indexOf('保存') == 0) {
element.click();
break;
return 'success';
}
}
})();";
ts1 = client.Runtime.EvaluateAsync(jsStr1, null, true, null, null, true, null, true);
ts1.Wait(5000);
Thread.Sleep(Randomx.GetId(1500, 2500));
for (int i = 0; i < 20; i++)
{
if (ts1.Result.Result.Value is string rstStr)
{
if (rstStr == "success")
break;
}
Thread.Sleep(100);
ts1 = client.Runtime.EvaluateAsync(jsStr1, null, true, null, null, true, null, true);
ts1.Wait(5000);
}
//Thread.Sleep(Randomx.GetId(1500, 2500));
Thread.Sleep(Randomx.GetId(300, 500));
jsStr1 = @"(function() { var elements = document.getElementsByTagName('div');
for (i = elements.length - 1; i >= 0; i--){
var element = elements[i];
if (element.innerHTML.indexOf('" + txtBuyTransitWarehouse.Text.Trim() + @"') >= 0) {
element.click();
break;
return 'success';
}
}
})();";
ts1 = client.Runtime.EvaluateAsync(jsStr1, null, true, null, null, true, null, true);
ts1.Wait(5000);
Thread.Sleep(Randomx.GetId(1500, 2500));
for (int i = 0; i < 20; i++)
{
if (ts1.Result.Result.Value is string rstStr)
{
if (rstStr == "success")
break;
}
Thread.Sleep(100);
ts1 = client.Runtime.EvaluateAsync(jsStr1, null, true, null, null, true, null, true);
ts1.Wait(5000);
}
//Thread.Sleep(Randomx.GetId(1500, 2500));
Thread.Sleep(Randomx.GetId(300, 500));
return "";
}
@@ -808,6 +894,7 @@ namespace TemuKJD.ToolForms
{
body["userName"] = BaseClass.UserName; // 软件端用户名
body["purchaserNote"] = BaseClass.UserName + "-" + BaseClass.NickName; // 购买软件账户备注
body["postage"] = (BaseClass.PostagePerOrder * 100).ParseToInt() + "";
}
var url = "https://po.e57.cn/prod-api/api/oms-api/externalProcurement/saveOrUpdate";
var dataStr = JsonHelper.SerializeObject(body);
@@ -855,6 +942,7 @@ namespace TemuKJD.ToolForms
out_order_no = txtBuyOrderId.Text.Trim(),
purchaser_note = body["purchaserNote"].ParseToString(),
});
orderItem.SetTransitOrder();
// 利润计算重置为最小值,控件Resource更新时将计算利润
orderItem.ProfitCount = decimal.MinValue;
var order = orderItem.ItemOrder;
+54 -8
View File
@@ -31,6 +31,7 @@
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PddMobileBuyOrderForm));
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.pnlMask = new DevComponents.DotNetBar.PanelEx();
this.btnJumpOrderList = new DevComponents.DotNetBar.PanelEx();
this.txtBuySkuName = new System.Windows.Forms.TextBox();
this.label21 = new System.Windows.Forms.Label();
@@ -94,11 +95,13 @@
this.btnReMap = new DevComponents.DotNetBar.PanelEx();
this.label25 = new System.Windows.Forms.Label();
this.txtBuyTransitWarehouse = new System.Windows.Forms.TextBox();
this.label29 = new System.Windows.Forms.Label();
this.pnlMap = new System.Windows.Forms.Panel();
this.chkAutoChangeWarehouseAddress = new Work.UserComponents.UcCheckBox(this.components);
this.pictureBox1 = new System.Windows.Forms.PictureBox();
((System.ComponentModel.ISupportInitialize)(this.pbCloseBase)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).BeginInit();
@@ -127,6 +130,10 @@
this.splitContainer1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.splitContainer1.Name = "splitContainer1";
this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add(this.pnlMask);
this.splitContainer1.Panel1MinSize = 0;
//
// splitContainer1.Panel2
@@ -139,6 +146,31 @@
this.splitContainer1.SplitterWidth = 3;
this.splitContainer1.TabIndex = 4;
//
// pnlMask
//
this.pnlMask.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.pnlMask.Cursor = System.Windows.Forms.Cursors.Hand;
this.pnlMask.DisabledBackColor = System.Drawing.Color.Empty;
this.pnlMask.Dock = System.Windows.Forms.DockStyle.Fill;
this.pnlMask.Font = new System.Drawing.Font("微软雅黑", 50F);
this.pnlMask.Location = new System.Drawing.Point(0, 0);
this.pnlMask.Name = "pnlMask";
this.pnlMask.Size = new System.Drawing.Size(864, 700);
this.pnlMask.Style.Alignment = System.Drawing.StringAlignment.Center;
this.pnlMask.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(245)))), ((int)(((byte)(235)))), ((int)(((byte)(255)))));
this.pnlMask.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(245)))), ((int)(((byte)(235)))), ((int)(((byte)(255)))));
this.pnlMask.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine;
this.pnlMask.Style.BorderColor.Color = System.Drawing.Color.FromArgb(((int)(((byte)(152)))), ((int)(((byte)(99)))), ((int)(((byte)(143)))));
this.pnlMask.Style.ForeColor.Color = System.Drawing.Color.FromArgb(((int)(((byte)(152)))), ((int)(((byte)(99)))), ((int)(((byte)(143)))));
this.pnlMask.Style.GradientAngle = 90;
this.pnlMask.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
this.pnlMask.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(107)))), ((int)(((byte)(83)))), ((int)(((byte)(147)))));
this.pnlMask.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(107)))), ((int)(((byte)(83)))), ((int)(((byte)(147)))));
this.pnlMask.StyleMouseOver.ForeColor.Color = System.Drawing.Color.White;
this.pnlMask.TabIndex = 881;
this.pnlMask.Text = "自动拍单倒计时\r\n8";
this.pnlMask.Visible = false;
//
// btnJumpOrderList
//
this.btnJumpOrderList.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
@@ -367,9 +399,9 @@
this.btnManualUpdateTransitWarehouse.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnManualUpdateTransitWarehouse.DisabledBackColor = System.Drawing.Color.Empty;
this.btnManualUpdateTransitWarehouse.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnManualUpdateTransitWarehouse.Location = new System.Drawing.Point(348, 175);
this.btnManualUpdateTransitWarehouse.Location = new System.Drawing.Point(368, 175);
this.btnManualUpdateTransitWarehouse.Name = "btnManualUpdateTransitWarehouse";
this.btnManualUpdateTransitWarehouse.Size = new System.Drawing.Size(114, 23);
this.btnManualUpdateTransitWarehouse.Size = new System.Drawing.Size(94, 23);
this.btnManualUpdateTransitWarehouse.Style.Alignment = System.Drawing.StringAlignment.Center;
this.btnManualUpdateTransitWarehouse.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(152)))), ((int)(((byte)(99)))), ((int)(((byte)(143)))));
this.btnManualUpdateTransitWarehouse.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(152)))), ((int)(((byte)(99)))), ((int)(((byte)(143)))));
@@ -523,9 +555,9 @@
this.btnManualUpdateBuyOrder.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnManualUpdateBuyOrder.DisabledBackColor = System.Drawing.Color.Empty;
this.btnManualUpdateBuyOrder.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnManualUpdateBuyOrder.Location = new System.Drawing.Point(348, 198);
this.btnManualUpdateBuyOrder.Location = new System.Drawing.Point(368, 198);
this.btnManualUpdateBuyOrder.Name = "btnManualUpdateBuyOrder";
this.btnManualUpdateBuyOrder.Size = new System.Drawing.Size(114, 23);
this.btnManualUpdateBuyOrder.Size = new System.Drawing.Size(94, 23);
this.btnManualUpdateBuyOrder.Style.Alignment = System.Drawing.StringAlignment.Center;
this.btnManualUpdateBuyOrder.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(152)))), ((int)(((byte)(99)))), ((int)(((byte)(143)))));
this.btnManualUpdateBuyOrder.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(152)))), ((int)(((byte)(99)))), ((int)(((byte)(143)))));
@@ -568,9 +600,9 @@
this.btnManualUpdateSendProvince.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnManualUpdateSendProvince.DisabledBackColor = System.Drawing.Color.Empty;
this.btnManualUpdateSendProvince.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnManualUpdateSendProvince.Location = new System.Drawing.Point(348, 115);
this.btnManualUpdateSendProvince.Location = new System.Drawing.Point(368, 115);
this.btnManualUpdateSendProvince.Name = "btnManualUpdateSendProvince";
this.btnManualUpdateSendProvince.Size = new System.Drawing.Size(114, 23);
this.btnManualUpdateSendProvince.Size = new System.Drawing.Size(94, 23);
this.btnManualUpdateSendProvince.Style.Alignment = System.Drawing.StringAlignment.Center;
this.btnManualUpdateSendProvince.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(152)))), ((int)(((byte)(99)))), ((int)(((byte)(143)))));
this.btnManualUpdateSendProvince.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(152)))), ((int)(((byte)(99)))), ((int)(((byte)(143)))));
@@ -662,7 +694,7 @@
this.txtSendProvince.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtSendProvince.Location = new System.Drawing.Point(74, 115);
this.txtSendProvince.Name = "txtSendProvince";
this.txtSendProvince.Size = new System.Drawing.Size(268, 23);
this.txtSendProvince.Size = new System.Drawing.Size(288, 23);
this.txtSendProvince.TabIndex = 467;
//
// splitContainer2
@@ -811,6 +843,7 @@
this.pnlBuy.Controls.Add(this.txtBuyGoodsName);
this.pnlBuy.Controls.Add(this.txtBuyPrice);
this.pnlBuy.Controls.Add(this.label24);
this.pnlBuy.Controls.Add(this.label29);
this.pnlBuy.Location = new System.Drawing.Point(12, 291);
this.pnlBuy.Name = "pnlBuy";
this.pnlBuy.Size = new System.Drawing.Size(468, 226);
@@ -844,7 +877,7 @@
this.btnReMap.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnReMap.Location = new System.Drawing.Point(9, 198);
this.btnReMap.Name = "btnReMap";
this.btnReMap.Size = new System.Drawing.Size(114, 23);
this.btnReMap.Size = new System.Drawing.Size(94, 23);
this.btnReMap.Style.Alignment = System.Drawing.StringAlignment.Center;
this.btnReMap.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(245)))), ((int)(((byte)(235)))), ((int)(((byte)(255)))));
this.btnReMap.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(245)))), ((int)(((byte)(235)))), ((int)(((byte)(255)))));
@@ -879,6 +912,16 @@
this.txtBuyTransitWarehouse.Size = new System.Drawing.Size(388, 23);
this.txtBuyTransitWarehouse.TabIndex = 870;
//
// label29
//
this.label29.AutoSize = true;
this.label29.ForeColor = System.Drawing.Color.SandyBrown;
this.label29.Location = new System.Drawing.Point(121, 201);
this.label29.Name = "label29";
this.label29.Size = new System.Drawing.Size(248, 17);
this.label29.TabIndex = 892;
this.label29.Text = "如自动识别失败,请填写后点击手动确认拍单";
//
// pnlMap
//
this.pnlMap.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
@@ -943,6 +986,7 @@
this.Load += new System.EventHandler(this.PddBuyOrderForm_Load);
this.Controls.SetChildIndex(this.splitContainer2, 0);
((System.ComponentModel.ISupportInitialize)(this.pbCloseBase)).EndInit();
this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
this.splitContainer1.ResumeLayout(false);
@@ -1031,5 +1075,7 @@
private Work.UserComponents.UcCheckBox chkUseAppBalance;
private System.Windows.Forms.Label label28;
private System.Windows.Forms.TextBox txtSourceCode;
private System.Windows.Forms.Label label29;
public DevComponents.DotNetBar.PanelEx pnlMask;
}
}