Merge branch 'main' of github.com:KJD2025/29WxOrder

This commit is contained in:
wule committed 2026-09-16 20:38:08 +08:00
commit 394f5cbf54
15 files changed
+580 -63

No files matched your search

+1
View File
@@ -11,6 +11,7 @@
<converters:HasTextToVisibilityConverter x:Key="HasTextVisibility" />
<converters:TextEllipsisConverter x:Key="TextEllipsisConverter" />
<converters:TextEllipsisConverter26 x:Key="TextEllipsisConverter26" />
<converters:TextEllipsisConverter8 x:Key="TextEllipsisConverter8" />
<converters:NotHasTextToVisibilityConverter x:Key="NotHasTextVisibility" />
<converters:VisibleToVisibilityConverter x:Key="visibleToVisibilityConverter" />
<converters:ImageUrlToBitmapImageConverter x:Key="ImageUrlToBitmapImage" />
@@ -53,20 +53,36 @@ namespace _29WxOrderWpf.Converters
}
}
/// <summary>
/// 超出26个字的文本显示省略号
/// </summary>
public class TextEllipsisConverter26 : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value.ParseToString().Length > 26)
return string.Join("", value.ParseToString().Take(26)) + "…";
return value.ParseToString();
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException(); // 单向绑定可不实现
}
}
/// <summary>
/// 超出26个字的文本显示省略号
/// </summary>
public class TextEllipsisConverter26 : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value.ParseToString().Length > 26)
return string.Join("", value.ParseToString().Take(26)) + "…";
return value.ParseToString();
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException(); // 单向绑定可不实现
}
}
/// <summary>
/// 超出10个字的文本显示省略号
/// </summary>
public class TextEllipsisConverter8 : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value.ParseToString().Length > 8)
return string.Join("", value.ParseToString().Take(8)) + "…";
return value.ParseToString();
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException(); // 单向绑定可不实现
}
}
}
@@ -1081,7 +1081,7 @@
<ComboBoxItem Content="请选择" />
<ComboBoxItem Content="未拦截" />
<ComboBoxItem Content="拦截中" />
<!--<ComboBoxItem Content="拦截失败" />-->
<ComboBoxItem Content="拦截失败" />
<ComboBoxItem Content="拦截成功" />
</ComboBox>
</wpf:TitleContent>
@@ -1261,7 +1261,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
if (tabItem != null)
{
var filteLstTmp = userOrderLst.Where(o => !GetOrderIsFilter(o, "异常需重拍"));
Dispatcher.Invoke(new Action(() => { tabItem.Header = "异常需重拍(" + userOrderLst.Where(r => r.isAbnormal).Count() + "|" + filteLstTmp.Count() + ")"; }));
Dispatcher.Invoke(new Action(() => { tabItem.Header = "异常需重拍(" + userOrderLst.Where(r => r.IsAbnormal).Count() + "|" + filteLstTmp.Count() + ")"; }));
}
Dispatcher.Invoke(new Action(() => { tabItem = tabItems.FirstOrDefault(t => t.Header.ParseToString().StartsWith("全部订单")); }));
if (tabItem != null)
@@ -1636,7 +1636,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
return true;
}
}
if (filterHeadStr.StartsWith("异常需重拍") && !order.isAbnormal)
if (filterHeadStr.StartsWith("异常需重拍") && !order.IsAbnormal)
{
return true;
}
@@ -1022,7 +1022,7 @@
IsReadOnly="True"
Text="{Binding ItemOrder.shop_remark}"
TextWrapping="Wrap"
Visibility="Visible"
Visibility="{Binding ItemOrder.shop_remark, Converter={StaticResource HasTextVisibility}}"
WaterMark="店铺备注" />
<Button
x:Name="btnEditShopRemark"
@@ -1051,6 +1051,7 @@
IsReadOnly="True"
Text="{Binding ItemOrder.soft_remark}"
TextWrapping="Wrap"
Visibility="{Binding ItemOrder.soft_remark, Converter={StaticResource HasTextVisibility}}"
WaterMark="软件备注" />
<Button
x:Name="btnEditAppRemark"
@@ -1079,6 +1080,7 @@
IsReadOnly="True"
Text="{Binding TransitWarehouseRejectSuccessTimeStr}"
TextWrapping="Wrap"
Visibility="{Binding TransitWarehouseRejectSuccessTimeStr, Converter={StaticResource HasTextVisibility}}"
WaterMark="中转仓拒收" />
<Button
x:Name="btnAddEditTransitWarehouseReject"
@@ -1108,6 +1110,7 @@
IsReadOnly="True"
Text="{Binding TransitWarehouseAfterSaleWayBillStr}"
TextWrapping="Wrap"
Visibility="{Binding TransitWarehouseAfterSaleWayBillStr, Converter={StaticResource HasTextVisibility}}"
WaterMark="拦截退回总店" />
<Button
x:Name="btnAddEditTransitWarehouseAfterSale"
@@ -1115,6 +1118,17 @@
Click="btnAddEditTransitWarehouseAfterSale_Click"
Content="{Binding AddEditTransitWarehouseAfterSaleStr}"
Style="{StaticResource LinkButton}" />
<uc:UcWaterMarkTextBox1
x:Name="txtInterceptReturnInfoStr"
Margin="0,1,0,1"
VerticalAlignment="Top"
Background="Transparent"
BorderThickness="1"
IsReadOnly="True"
Text="{Binding InterceptReturnInfoStr, Converter={StaticResource TextEllipsisConverter8}}"
TextWrapping="Wrap"
ToolTip="{Binding InterceptReturnInfoStr}"
Visibility="{Binding InterceptReturnInfoStr, Converter={StaticResource HasTextVisibility}}" />
</WrapPanel>
</wpf:TitleContent>
@@ -1130,6 +1144,7 @@
IsReadOnly="True"
Text="{Binding AddEditTransitWarehouseReturnOrderWaybillStr}"
TextWrapping="Wrap"
Visibility="{Binding AddEditTransitWarehouseReturnOrderWaybillStr, Converter={StaticResource HasTextVisibility}}"
WaterMark="云仓退货" />
<Button
x:Name="btnRetrunOrder"
@@ -1217,7 +1232,7 @@
<wpf:TitleContent>
<Button
x:Name="btnMapSkus"
Height="24"
Height="22"
MinWidth="38"
Margin="4,0,0,0"
HorizontalAlignment="Center"
@@ -1233,7 +1248,7 @@
<Button
x:Name="btnBuyOrder"
Height="24"
Height="22"
MinWidth="38"
Margin="4,0,0,0"
HorizontalAlignment="Center"
@@ -1253,7 +1268,7 @@
<Button
x:Name="btnVoidTransitOrder"
Height="24"
Height="22"
MinWidth="38"
Margin="4,0,0,0"
HorizontalAlignment="Center"
@@ -1265,7 +1280,7 @@
<Button
x:Name="btnAbnormalOrderRebuy"
Height="24"
Height="22"
MinWidth="38"
Margin="4,0,0,0"
HorizontalAlignment="Center"
@@ -1281,7 +1296,7 @@
<wpf:TitleContent>
<Button
x:Name="btnDirectBuyOrder"
Height="24"
Height="22"
MinWidth="38"
Margin="4,0,0,0"
HorizontalAlignment="Center"
@@ -1295,7 +1310,7 @@
<wpf:TitleContent>
<Button
x:Name="btnShipGift"
Height="24"
Height="22"
MinWidth="38"
Margin="4,0,0,0"
HorizontalAlignment="Center"
@@ -1305,7 +1320,19 @@
Style="{StaticResource BasePageButtonLightStyle}"
Visibility="{Binding ItemOrder.IsWaitSend, Converter={StaticResource VisibleToVisibilityConverter}}" />
</wpf:TitleContent>
<wpf:TitleContent>
<Button
x:Name="btnChangeWaybill"
Height="22"
MinWidth="38"
Margin="4,0,0,0"
HorizontalAlignment="Center"
d:Visibility="Visible"
Click="btnChangeWaybill_Click"
Content="修改物流"
Style="{StaticResource BasePageButtonLightStyle}"
Visibility="{Binding ItemOrder.IsShowChangeWaybillBtn, Converter={StaticResource VisibleToVisibilityConverter}}" />
</wpf:TitleContent>
</wpf:SpacingStackPanel>
</Grid>
</Grid>
@@ -3,6 +3,8 @@ using _29WxOrderWpf.Common;
using _29WxOrderWpf.Converters;
using _29WxOrderWpf.Ctrls.BuyerCtrls;
using _29WxOrderWpf.UserControls;
using _29WxOrderWpf.ViewModels;
using _29WxOrderWpf.Views;
using _29WxOrderWpf.Windows.OrderWindows;
using AllBase;
using AllBase.Helper;
@@ -30,7 +32,6 @@ using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Threading;
using _29WxOrderWpf.ViewModels;
using TemuKJD.ToolForms;
using Work;
using Work._29Tools.BLL;
@@ -669,7 +670,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
static bool GetIsAbnormalOrderRebuy(oms_wei_order_item_info order_item)
{
// 不是异常单的不可异常重拍
if (order_item?.ItemOrder?.isAbnormal != true)
if (order_item?.ItemOrder?.IsAbnormal != true)
return false;
// 买手未退款的,中转正式取号以后的,不可异常重拍
if (order_item.ItemTransitOrder?.refund_status != "买手退款成功" ||
@@ -1564,7 +1565,18 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
}
}
private void btnChangeWaybill_Click(object sender, RoutedEventArgs e)
{
if (DataContext is oms_wei_order_item_info orderItem && orderItem.ItemOrder != null)
{
ChangeWaybillView changeWaybillView = new ChangeWaybillView(orderItem.ItemOrder);
new DialogWindow()
{
Title = "修改订单物流",
Content = changeWaybillView,
}.ShowDialog();
}
}
}
}
@@ -0,0 +1,218 @@
using _29WxOrderWpf.BaseWindows;
using _29WxOrderWpf.Commands;
using AllBase;
using AllBase.Model.DBModel;
using AllBase.Model.MvvmBaseClasses;
using AllBase.Model.Result;
using NaiBa.Util.Extension;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Input;
using System.Windows.Threading;
using Work;
using Work._29Tools.BLL;
using Work._29Tools.Forms.ShopForms;
namespace _29WxOrderWpf.ViewModels
{
/// <summary>
/// 更改运单号ViewModel
/// </summary>
public class ChangeWaybillViewModel : PropertyNotifyObject
{
public oms_wei_order_info Order
{
get { return this.GetValue(x => x.Order); }
set { this.SetValue(x => x.Order, value); }
}
public string WaybillId
{
get { return this.GetValue(x => x.WaybillId); }
set { this.SetValue(x => x.WaybillId, value); }
}
public bool IsChangeingWaybill
{
get { return this.GetValue(x => x.IsChangeingWaybill); }
set { this.SetValue(x => x.IsChangeingWaybill, value); }
}
public bool ChangeWaybillSuccess
{
get { return this.GetValue(x => x.ChangeWaybillSuccess); }
set { this.SetValue(x => x.ChangeWaybillSuccess, value); }
}
/// <summary>
/// 请求关闭窗口
/// </summary>
public event Action RequestClose;
#region 命令
public ICommand ChangeWaybillCommand { get; }
#endregion
private volatile bool _isWindowLoaded = false;
public ChangeWaybillViewModel(oms_wei_order_info _order)
{
Order = _order;
//IsChangeingWaybill = true;
ChangeWaybillCommand = new DelegateCommand(ChangeWaybill);
}
/// <summary>
/// 窗口加载完成时调用
/// </summary>
public void Start()
{
_isWindowLoaded = true;
}
/// <summary>
/// 窗口关闭时调用,停止后台任务
/// </summary>
public void Stop()
{
_isWindowLoaded = false;
}
public void ChangeWaybill()
{
ChangeWaybillSuccess = false;
string orderId = Order.order_id;
ShopLoginInfo shop = Order.Shop;
Task.Run(async () =>
{
// 查询订单是否在代发货中,如果代发需要取消代发
var apiSearchDropship = new WxApiBLL().WxApiDropshipSearch(shop, orderId, 100);
if (!apiSearchDropship.Contains("\"errcode\":0"))
{
BaseMsgWindow.ShowError("代发查询失败," + BaseRegex.GetStringJsonByRegs(ref apiSearchDropship, apiSearchDropship, "errmsg"));
return;
}
if (apiSearchDropship.Contains("ds_order_id_list") && !apiSearchDropship.Contains("\"ds_order_id_list\":[]"))
{
var dsOrderId = JsonHelper.JObjectParse(apiSearchDropship)["ds_order_id_list"].FirstOrDefault().ParseToString();
var apiCancelDropship = await new WxApiBLL().WxApiDropshipCancel(shop, Order, dsOrderId);
if (!apiCancelDropship.Contains("\"errcode\":0"))
{
IsChangeingWaybill = false;
BaseMsgWindow.ShowError("取消代发失败!请确商品未加入代发!" + BaseRegex.GetStringJsonByRegs(ref apiSearchDropship, apiSearchDropship, "errmsg"));
return;
}
}
IsChangeingWaybill = true;
var rst = WxSimOrderSendBLL.initDeliveryInfo(shop, orderId);
// {"code":0,"orderDetail":{"commonInfo":{"orderId":"3736582386601580032","orderType":0,"statusStr":"待发货","status":20,"originalStatus":11,"openid":"ow5ty7Kyik_dSqtrivr5hY2t4cwY","createTime":1779540820,"createTimeStr":"2026-05-23 20:53","isPayScoreOrder":false,"isPayDone":true,"isVirtualOrder":false,"isAuthorizedAccount":false,"giftOrderType":"","isInspectOrder":false,"isCommissionOrderDone":false,"isRechargeOrder":false,"isExpediteOrder":false,"isOverTimeOrder":2,"isMultiPackage":false,"inspectType":0,"isGiftOrder":false,"isBuyTogetherOrder":false,"isLotteryOrder":false,"isEducationOrder":false,"hideGiftOrderAddressInfo":false,"cosignmentFlag":1,"isNationalSubsidy":0,"isSameCityOrder":false,"isNationalSubsidyMerchant":false,"isSupplyOrder":false},"orderProducts":{"orderProductInfo":[{"productId":"10000863142394","thumbImg":"https://wst.wxapp.tc.qq.com/161/20304/snscosdownload/SH/reserved/6a092e3a000107862152a36aa881bc1e000000a100004f50","title":"脂砚斋评石头记(全三册) 烫金珍藏版 彩绘绣像 双色印刷","skuId":"15274875174","saleParam":["默认"],"productType":1,"productCnt":1,"salePrice":"3400","spuCode":"9787555418979","skuCode":"BSEC12302592708637555055A","isPreSale":false,"isIflashbuy":false,"isFreeGift":false,"canAfterSale":true,"realPrice":3350,"perRealPrice":3350,"tags":[{"class":"black","desc":"7天无理由","iconUrl":"","mainUrl":"","tagType":4},{"class":"black","desc":"运费险","iconUrl":"","mainUrl":"","tagType":5}],"icons":[],"perExchangeScore":"","productSource":{"show":false},"afterSaleInfo":{"afterId":"","canAfterSale":true,"canNotAfterSaleReason":"","jumpUrl":"","title":"","content":"","afterSaleDoneStr":"","afterSaleDoneAmountStr":"","afterSaleDoneAmount":0,"afterSaleDoneProductCnt":0,"afterSaleIngProductCnt":0,"isGuaranteeIng":false,"hasFakeOnePayFourDoneGuarantee":false},"changeProduct":0,"afterSaleDoneProductCnt":0,"afterSaleIngProductCnt":0,"supplyProductId":"","supplyNickName":"","supplyOrderId":"","supplyAppid":""}],"priceInfo":{"productPrice":"3400","orderPrice":"3350","freight":0,"originalOrderPrice":"3400","estimateProductPrice":"3350","handingFee":"0","maxUnsplitAmount":"3350","totalDiscountedPrice":"50","merchantReceievePrice":"3350","platformActivityMerchantDiscountedPrice":"50"},"activityInfo":{},"presentFee":{}},"acceptInfo":{"decodeSensitiveTime":0,"editAddrInfo":{"applyEditAddrStatus":0,"applyEditAddrAuditStaff":"","applyEditAddrAuditTimeText":"","negotiationEditTextForB":"","negotiationEditTextForA":"","negotiationEditStatus":0,"negotiationEditHistory":[],"canNegotiation":true,"hasUnResolvedRequest":0,"hasHistoryMerchantEditAddr":0,"editHistory":[]},"customerNotes":"","merchantNotes":"","presentNotes":"","addressInfo":{"cityName":"宝鸡市","countyName":"眉县","provinceName":"陕西省","userName":"刘**","telNumber":"187****9569","detailInfo":"****","virtualOrderTelNumber":""},"virtualNumberInfo":{},"quota":{"code":0,"limit":10,"used":10,"hideSensitiveInfo":true},"rechargeData":{"label":"","content":"","deliverMethod":0},"addressErrType":0},"expressInfo":{"phone":"9569","deliveryProductInfo":[],"orderProductCnt":1,"deliveryCnt":0,"isIntracityOrder":false,"intracityTracking":null,"formatUnshippedProductList":[{"productId":"10000863142394","thumbImg":"https://wst.wxapp.tc.qq.com/161/20304/snscosdownload/SH/reserved/6a092e3a000107862152a36aa881bc1e000000a100004f50","title":"脂砚斋评石头记(全三册) 烫金珍藏版 彩绘绣像 双色印刷","skuId":"15274875174","saleParam":["默认"],"productType":1,"productCnt":1,"salePrice":"3400","spuCode":"9787555418979","skuCode":"BSEC12302592708637555055A","isPreSale":false,"isIflashbuy":false,"isFreeGift":false,"canAfterSale":true,"realPrice":3350,"perRealPrice":3350,"tags":[{"class":"black","desc":"7天无理由","iconUrl":"","mainUrl":"","tagType":4},{"class":"black","desc":"运费险","iconUrl":"","mainUrl":"","tagType":5}],"icons":[],"perExchangeScore":"","productSource":1,"afterSaleInfo":{"afterId":"","canAfterSale":true,"canNotAfterSaleReason":"","jumpUrl":"","title":"","content":"","afterSaleDoneStr":"","afterSaleDoneAmountStr":"","afterSaleDoneAmount":0,"afterSaleDoneProductCnt":0,"afterSaleIngProductCnt":0,"isGuaranteeIng":false,"hasFakeOnePayFourDoneGuarantee":false},"changeProduct":0,"afterSaleDoneProductCnt":0,"afterSaleIngProductCnt":0,"supplyProductId":"","supplyNickName":"","supplyOrderId":"","supplyAppid":""}],"product2Img":{"15274875174":"https://wst.wxapp.tc.qq.com/161/20304/snscosdownload/SH/reserved/6a092e3a000107862152a36aa881bc1e000000a100004f50"}},"ewaybillInfo":{"isAllPrintOne":false,"isOpen":false,"deliveryId":"","deliveryName":"","waybillId":""}},"sendAddressInfo":{"userName":"陈图书","postalCode":"","provinceName":"安徽省","cityName":"合肥市","countyName":"肥西县","detailInfo":"上派镇中盟电子产业园8栋一单元(东电梯3楼快递指定存放点)","telNumber":"13023098035","lat":0,"lng":0},"deliveryCompanyOptions":[{"label":"极兔Line truncated
if (!rst.Contains("\"code\":0"))
{
var error = BaseRegex.GetStringJsonByRegs(ref rst, rst, "err_msg", "error_msg", "errMsg", "errorMsg", "msg");
IsChangeingWaybill = false;
BaseMsgWindow.ShowInfo("修改订单物流失败 " + error);
return;
}
var statusStr = BaseRegex.GetStringJson(ref rst, "statusStr");
if (statusStr == "待发货")
{
// 待发货暂不处理
//{"orderId":"3736580679658008320","deliveryProduct":{"deliveryId":"YUNDA","waybillId":"313023381086999","isAllProduct":true,"deliverType":1}}
//{"code":0,"errcode":0,"errmsg":"ok"}
rst = WxSimOrderSendBLL.orderSendOut(shop, orderId, WaybillId);
if (!rst.Contains("\"code\":0"))
{
var error = BaseRegex.GetStringJsonByRegs(ref rst, rst, "err_msg", "error_msg", "errMsg", "errorMsg", "msg");
IsChangeingWaybill = false;
BaseMsgWindow.ShowInfo("修改订单物流失败 " + error);
return;
}
var url = BaseClass.Build29WxObjString("order/wx_update_erp_soft_remark");
var data = UserLogin.GetSignaturex();
if (!Order.soft_remark.ParseToString().Contains("已修改物流"))
Order.soft_remark = ("已修改物流 " + Order.soft_remark).Trim();
data += "&order_id=" + Order.order_id;
data += "&soft_remark=" + Order.soft_remark;
var html = GetHtml.PostUtf8(url, data);
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
html = GetHtml.PostUtf8(url, data);
Application.Current?.Dispatcher.Invoke(new Action(() =>
{
ChangeWaybillSuccess = true;
IsChangeingWaybill = false;
BaseMsgWindow.ShowInfo("修改订单物流成功");
RequestClose?.Invoke();
}));
}
else
{
//{"orderId":"3736580679658008320","changeInfo":[{"old":{"deliveryId":"YUNDA","waybillId":"313023381086999","productInfos":[{"productId":"10000875072190","skuId":"15516018429","productCnt":1}]},"new":{"deliveryId":"OTHER","waybillId":"772064082455686","productInfos":[{"productId":"10000875072190","skuId":"15516018429","productCnt":1}]}}]}
//{"code":0,"errcode":0,"errmsg":""}
var orderExpressInfoObj = JsonHelper.JObjectParse(rst)["orderDetail"]["expressInfo"];
var orderExpressInfo = JsonHelper.DeserializeJsonToObject<WxOrderExpressInfo>(JsonHelper.SerializeObject(orderExpressInfoObj));
UpdateDeliverInfoParam param = new UpdateDeliverInfoParam();
param.orderId = orderId;
param.changeInfo = new List<Dictionary<string, UpdateDeliverChangeInfo>>();
foreach (var deliveryProductInfo in orderExpressInfo.deliveryProductInfo)
{
Dictionary<string, UpdateDeliverChangeInfo> dicChange = new Dictionary<string, UpdateDeliverChangeInfo>();
dicChange["old"] = new UpdateDeliverChangeInfo
{
deliveryId = deliveryProductInfo.deliveryId,
waybillId = deliveryProductInfo.waybillId,
productInfos = new List<UpdateDeliverProductInfo>()
};
dicChange["new"] = new UpdateDeliverChangeInfo
{
deliveryId = "OTHER",
waybillId = WaybillId,
productInfos = new List<UpdateDeliverProductInfo>()
};
foreach (var prod in deliveryProductInfo.productInfos)
{
dicChange["old"].productInfos.Add(new UpdateDeliverProductInfo() { productCnt = prod.productCnt, productId = prod.productId, skuId = prod.skuId });
dicChange["new"].productInfos.Add(new UpdateDeliverProductInfo() { productCnt = prod.productCnt, productId = prod.productId, skuId = prod.skuId });
}
param.changeInfo.Add(dicChange);
}
rst = WxSimOrderSendBLL.updateDeliveryInfo(shop, param);
var str = JsonHelper.SerializeObject(param);
if (!rst.Contains("\"code\":0"))
{
var error = BaseRegex.GetStringJsonByRegs(ref rst, rst, "err_msg", "error_msg", "errMsg", "errorMsg", "msg");
IsChangeingWaybill = false;
BaseMsgWindow.ShowInfo("修改订单物流失败 " + error);
return;
}
var url = BaseClass.Build29WxObjString("order/wx_update_erp_soft_remark");
var data = UserLogin.GetSignaturex();
if (!Order.soft_remark.ParseToString().Contains("已修改物流"))
Order.soft_remark = ("已修改物流 " + Order.soft_remark).Trim();
data += "&order_id=" + Order.order_id;
data += "&soft_remark=" + Order.soft_remark;
var html = GetHtml.PostUtf8(url, data);
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
html = GetHtml.PostUtf8(url, data);
Application.Current?.Dispatcher.Invoke(new Action(() =>
{
ChangeWaybillSuccess = true;
IsChangeingWaybill = false;
BaseMsgWindow.ShowInfo("修改订单物流成功");
RequestClose?.Invoke();
}));
}
});
}
}
}
+83
View File
@@ -0,0 +1,83 @@
<UserControl
x:Class="_29WxOrderWpf.Views.ChangeWaybillView"
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:local="clr-namespace:_29WxOrderWpf.Views"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
x:Name="ChangeWaybillCtrl"
Width="450"
Height="300"
d:DesignHeight="300"
d:DesignWidth="450"
Loaded="ChangeWaybillView_Loaded"
mc:Ignorable="d">
<Grid Background="White">
<StackPanel Margin="24,24,24,0">
<TextBlock
Margin="0,0,0,20"
HorizontalAlignment="Center"
FontSize="15"
Foreground="#333333"
Text="更改订单运单号" />
<StackPanel>
<TextBlock
Margin="0,0,0,8"
Foreground="#555555"
Text="填写运单号:" />
<TextBox
x:Name="txtWaybillId"
Height="38"
VerticalContentAlignment="Center"
d:Text="1111"
BorderBrush="#D0D0D0"
BorderThickness="1"
FontSize="18"
Text="{Binding WaybillId, UpdateSourceTrigger=PropertyChanged}"
VerticalScrollBarVisibility="Auto" />
<WrapPanel Margin="0,10,0,0" FlowDirection="RightToLeft">
<Button
Width="64"
Height="26"
Margin="0,0,10,0"
HorizontalAlignment="Right"
Command="{Binding ChangeWaybillCommand}"
Content="确定更改"
Style="{StaticResource BasePageButtonStyle}" />
<Image
x:Name="imgLoading"
Width="20"
Height="20"
IsEnabled="False"
Source="{StaticResource imgLoadingPic}"
Visibility="{Binding IsChangeingWaybill, Converter={StaticResource visibleToVisibilityConverter}}">
<Image.RenderTransform>
<RotateTransform Angle="45" CenterX="10" CenterY="10" />
</Image.RenderTransform>
<Image.Triggers>
<EventTrigger RoutedEvent="Image.Loaded">
<BeginStoryboard>
<Storyboard>
<DoubleAnimation
RepeatBehavior="Forever"
Storyboard.TargetName="imgLoading"
Storyboard.TargetProperty="(UIElement.RenderTransform).(RotateTransform.Angle)"
From="360"
To="0"
Duration="0:0:3" />
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Image.Triggers>
</Image>
</WrapPanel>
<TextBlock
d:Text="textBlock"
Text=""
TextWrapping="Wrap" />
</StackPanel>
</StackPanel>
</Grid>
</UserControl>
@@ -0,0 +1,63 @@
using _29WxOrderWpf.ViewModels;
using AllBase.Helper;
using AllBase.Model.DBModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
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.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace _29WxOrderWpf.Views;
/// <summary>
/// ChangeWaybillView.xaml 的交互逻辑
/// </summary>
public partial class ChangeWaybillView : UserControl
{
/// <summary>
/// 视图模型
/// </summary>
public ChangeWaybillViewModel ViewModel { get; }
public ChangeWaybillView(oms_wei_order_info _order)
{
InitializeComponent();
ViewModel = new ChangeWaybillViewModel(_order);
ViewModel.RequestClose += ViewModel_RequestClose;
DataContext = ViewModel;
}
private void ChangeWaybillView_Loaded(object sender, RoutedEventArgs e)
{
ViewModel.Start();
}
private void ChangeWaybillView_Closed(object sender, RoutedEventArgs e)
{
ViewModel.Stop();
}
private void ViewModel_RequestClose()
{
Window parentWindow = Window.GetWindow(this);
if (this.IsLoaded && parentWindow != null)
parentWindow.Close();
MainWindow.Instance.orderListCtrl.FilterOneOrder(ViewModel.Order);
}
private void Button_Click(object sender, RoutedEventArgs e)
{
}
}
@@ -255,7 +255,7 @@ namespace _29WxOrderWpf.Windows.OrderWindows
if (wxExpressName.IsNullOrEmpty() || OrderItem.ItemRefund.return_waybill_id.IsNullOrEmpty() || receiver.receiver_name.IsNullOrEmpty() || receiver.receiver_phone.IsNullOrEmpty() ||
receiver.receiver_province.IsNullOrEmpty() || receiver.receiver_city.IsNullOrEmpty() || receiver.receiver_area.IsNullOrEmpty() || receiver.receiver_address.IsNullOrEmpty())
{
if (!string.IsNullOrWhiteSpace(aftersaleAddress) || receiver.receiver_name.Length > 15)
if (!string.IsNullOrWhiteSpace(aftersaleAddress) || receiver.receiver_name?.Length > 15)
{
// todo 提示地址解析失败请手动提交
OrderItem.AddEditTransitWarehouseReturnOrderStr = "解析失败请手动添加";
@@ -1,4 +1,5 @@
using System;
using AllBase.Model.MvvmBaseClasses;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -6,8 +7,8 @@ using System.Threading.Tasks;
namespace AllBase.Model.DBModel
{
public class oms_wei_external_procurement_log_info
{
public class oms_wei_external_procurement_log_info : PropertyNotifyObject
{
public string OutOrderNumStr
{
get { return out_order_no; }
+15 -4
View File
@@ -143,10 +143,16 @@ namespace AllBase.Model.DBModel
/// <summary>
/// 异常单(买手异常退货)异常需重拍
/// </summary>
public bool isAbnormal
public bool IsAbnormal
{
get { return this.GetValue(x => x.isAbnormal); }
set { this.SetValue(x => x.isAbnormal, value); }
get { return this.GetValue(x => x.IsAbnormal); }
set { this.SetValue(x => x.IsAbnormal, value); }
}
public bool IsShowChangeWaybillBtn
{
get { return this.GetValue(x => x.IsShowChangeWaybillBtn); }
set { this.SetValue(x => x.IsShowChangeWaybillBtn, value); }
}
public string orderStatusStr
@@ -708,7 +714,12 @@ namespace AllBase.Model.DBModel
{
}
isAbnormal = GetIsAbnormal();
IsAbnormal = GetIsAbnormal();
if (IsWaitBuy || IsWaitSend)
IsShowChangeWaybillBtn = false;
else
IsShowChangeWaybillBtn = true;
}
public bool GetIsWaitBuy()
@@ -291,10 +291,10 @@ namespace AllBase.Model.DBModel
if (this.ItemTransitOrderWithVoid?.has_reject == 5)
AddEditTransitWarehouseRejectStr = "已取消拒收";
if (this.ItemTransitOrderWithVoid == null || (this.ItemRefund?.type != "REFUND" && !this.ItemOrder.isAbnormal) || // 仅退款
if (this.ItemTransitOrderWithVoid == null || (this.ItemRefund?.type != "REFUND" && !this.ItemOrder.IsAbnormal) || // 仅退款
TransitRefundStatusStr.Contains("退款成功") ||
!(this.ItemRefund?.return_waybill_id).IsNullOrEmpty() || !(this.ItemRefund?.return_detail).IsNullOrEmpty() ||
(!this.ItemOrder.IsEmergency && !this.ItemOrder.isAbnormal && !this.ItemOrder.IsRefund) ||
(!this.ItemOrder.IsEmergency && !this.ItemOrder.IsAbnormal && !this.ItemOrder.IsRefund) ||
(this.ItemTransitOrderWithVoid.warehouse_status != 0 && this.ItemTransitOrderWithVoid.warehouse_status != 1) ||
string.IsNullOrEmpty(PddBuyerOrder?.order_sn))
{
@@ -304,23 +304,28 @@ namespace AllBase.Model.DBModel
// AddEditTransitWarehouseRejectStr = "申请拒收失败*";
}
if (order_id == "3738917560440771584")
if (order_id == "3739154342108377600")
{
}
// 拦截退回操作信息
InterceptReturnInfoStr = "";
if (this.ItemTransitOrderWithVoid != null)
InterceptReturnInfoStr = this.ItemTransitOrderWithVoid.intercept_return_info;
// 仓库物流售后拦截包裹按钮上的文字,仓库作废单不存在仓库物流,所以此处必须是有效的仓库单(含作废失败)
AddEditTransitWarehouseAfterSaleStr = "添加";
if (this.ItemTransitOrderAfterSale != null)
AddEditTransitWarehouseAfterSaleStr = "已添加";
if (this.ItemTransitOrderAfterSale != null && (ItemTransitOrderWithVoid.intercept_return_status == 1 || !string.IsNullOrEmpty(ItemTransitOrderAfterSale.downstream_waybill)))
AddEditTransitWarehouseAfterSaleStr = "拦截成功";
//if (this.ItemTransitOrderAfterSale != null && ItemTransitOrderWithVoid.intercept_return_status == 2)
// AddEditTransitWarehouseAfterSaleStr = "拦截失败";
if (this.ItemTransitOrderWithVoid == null || (this.ItemRefund?.type != "REFUND" && !this.ItemOrder.isAbnormal) ||
if (this.ItemTransitOrderAfterSale != null && (ItemTransitOrderWithVoid.intercept_return_status == 2 || ItemTransitOrderWithVoid.intercept_return_status == 3))
AddEditTransitWarehouseAfterSaleStr = "拦截失败";
if (this.ItemTransitOrderWithVoid == null || (this.ItemRefund?.type != "REFUND" && !this.ItemOrder.IsAbnormal) ||
TransitRefundStatusStr.Contains("退款成功") ||
!(this.ItemRefund?.return_waybill_id).IsNullOrEmpty() || !(this.ItemRefund?.return_detail).IsNullOrEmpty() ||
(!this.ItemOrder.IsEmergency && !this.ItemOrder.isAbnormal && !this.ItemOrder.IsRefund) ||
(!this.ItemOrder.IsEmergency && !this.ItemOrder.IsAbnormal && !this.ItemOrder.IsRefund) ||
this.ItemTransitOrderWithVoid.warehouse_status == 0 ||
(this.ItemTransitOrderWithVoid.warehouse_status == 1 && !AddEditTransitWarehouseRejectStr.IsNullOrEmpty() && !AddEditTransitWarehouseRejectStr.StartsWith("申请拒收失败")))
{
@@ -328,7 +333,7 @@ namespace AllBase.Model.DBModel
AddEditTransitWarehouseAfterSaleStr = "";
}
// 退货退款的,不能拦截退回总店。如果是退到退货仓,则退货仓流程,否则店家自行收货退回总店。
if (!RefundAddressStr.ParseToString().Trim().IsNullOrEmpty() || (this.ItemRefund?.type != "REFUND" && !this.ItemOrder.isAbnormal))
if (!RefundAddressStr.ParseToString().Trim().IsNullOrEmpty() || (this.ItemRefund?.type != "REFUND" && !this.ItemOrder.IsAbnormal))
{
if (AddEditTransitWarehouseAfterSaleStr == "添加")
AddEditTransitWarehouseAfterSaleStr = "";
@@ -336,6 +341,7 @@ namespace AllBase.Model.DBModel
if (this.ItemTransitOrderAfterSale != null)
TransitWarehouseAfterSaleWayBillStr = (this.ItemTransitOrderAfterSale?.downstream_express_code + "-" + this.ItemTransitOrderAfterSale?.downstream_waybill).Trim('-');
AddEditTransitWarehouseReturnOrderStr = "";
if (ItemRefund?.return_detail.StartsWith(GlobalConfig.TransitReturnOrderReturnAddress) == true)
{
@@ -344,22 +350,6 @@ namespace AllBase.Model.DBModel
}
// 关闭中转包裹退回,改为中转分销退货
//if (AddEditTransitWarehouseAfterSaleStr == "添加")
// AddEditTransitWarehouseAfterSaleStr = "";
//AddEditTransitWarehouseReturnOrderStr = DistribReturnOrderInfo == null ? "添加" : "已添加";
//if (DistribReturnOrderInfo?.warehouse_status == 1)
// AddEditTransitWarehouseReturnOrderStr = "已创建";
//if (DistribReturnOrderInfo?.warehouse_status == 2)
// AddEditTransitWarehouseReturnOrderStr = "创建异常";
//if (DistribReturnOrderInfo?.warehouse_status == 3)
// AddEditTransitWarehouseReturnOrderStr = "处理中";
//if (TransitRefundStatusStr.Contains("退款成功"))
//{
// if (AddEditTransitWarehouseReturnOrderStr == "添加")
// AddEditTransitWarehouseReturnOrderStr = "";
//}
if (AddEditTransitWarehouseAfterSaleStr == "添加")
AddEditTransitWarehouseAfterSaleStr = "";
AddEditTransitWarehouseReturnOrderStr = DistribReturnOrderInfo == null ? "未创建" : "已添加";
@@ -404,6 +394,14 @@ namespace AllBase.Model.DBModel
set { this.SetValue(x => x.AddEditTransitWarehouseAfterSaleStr, value); }
}
/// <summary>
/// 拦截退回操作信息/回调信息 文本
/// </summary>
public string InterceptReturnInfoStr
{
get { return this.GetValue(x => x.InterceptReturnInfoStr); }
set { this.SetValue(x => x.InterceptReturnInfoStr, value); }
}
/// <summary>
/// 仓库分销退货按钮显示文本参数
/// </summary>
public string AddEditTransitWarehouseReturnOrderStr
@@ -1163,7 +1161,7 @@ namespace AllBase.Model.DBModel
// 买手秒退异常重拍
BtnAbnormalBtnVisibility = Visibility.Visible;
// 不是异常单的不可异常重拍
if (this.ItemOrder?.isAbnormal != true)
if (this.ItemOrder?.IsAbnormal != true)
BtnAbnormalBtnVisibility = Visibility.Collapsed;
// 买手未退款的,中转正式取号以后的,不可异常重拍
else if (this.ItemTransitOrder?.refund_status != "买手退款成功" ||
@@ -0,0 +1,43 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AllBase.Model.Result
{
public class WxOrderExpressInfo
{
public int? deliverType { get; set; } // 5,
public string phone { get; set; } // "3859",
public List<WxDeliveryProductInfo> deliveryProductInfo { get; set; } //
public int? orderProductCnt { get; set; } // 1,
public int? deliveryCnt { get; set; } // 1,
public bool? isIntracityOrder { get; set; } // false,
public object intracityTracking { get; set; } // null,
public List<object> formatUnshippedProductList { get; set; } // [ ],
public Dictionary<string, string> product2Img { get; set; } // "15197350020": "https://wst.wxapp.tc.qq.com/161/20304/snscosdownload/SH/reserved/6a080c080007548c0abba40bffc31715000000a100004f50"
}
public class WxDeliveryProductInfo
{
public string waybillId { get; set; } // "772064086780390",
public string deliveryId { get; set; } // "STO",
public List<WxDeliveryProductInfoInfo> productInfos { get; set; }
public string deliveryName { get; set; } // "申通快递",
public string deliveryTime { get; set; } // "1779537701",
public int? deliverType { get; set; } // 5,
public int? waybillStatus { get; set; } // 0
}
public class WxDeliveryProductInfoInfo
{
public string productId { get; set; } // "10000859462312",
public string skuId { get; set; } // "15197350020",
public int? productCnt { get; set; } // 1,
public string supplyProductId { get; set; } // "0",
public string supplySkuId { get; set; } // "0"
}
}
+44
View File
@@ -0,0 +1,44 @@
using AllBase;
using AllBase.Model.DBModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Work._29Tools.Forms.ShopForms;
namespace Work._29Tools.BLL
{
public class WxSimOrderSendBLL
{
public static string initDeliveryInfo(ShopLoginInfo shop, string orderId)
{
string url = "https://store.weixin.qq.com/shop-faas/mmchannelstradeorder/ship/cgi/initShipData?token=&lang=zh_CN";
string body = @"{""id"":""" + orderId + @"""}";
string refere = "https://store.weixin.qq.com/shop/order/list";
var result = HttpResponseWXBLL.WeiXinPostResponse(shop, url, body, refere);
return result;
}
public static string orderSendOut(ShopLoginInfo shop, string orderId, string waybillId)
{
string url = "https://store.weixin.qq.com/shop-faas/mmchannelstradeorder/ship/cgi/orderSendOut?token=&lang=zh_CN";
string body = @"{""orderId"":""" + orderId + @""",""deliveryProduct"":{""deliveryId"":""OTHER"",""waybillId"":""" + waybillId + @""",""isAllProduct"":true,""deliverType"":1}}";
string refere = "https://store.weixin.qq.com/shop/order/list?type=3";
var result = HttpResponseWXBLL.WeiXinPostResponse(shop, url, body, refere);
return result;
}
public static string updateDeliveryInfo(ShopLoginInfo shop, UpdateDeliverInfoParam param)
{
string url = "https://store.weixin.qq.com/shop-faas/mmchannelstradeorder/ship/cgi/updateDeliveryInfo?token=&lang=zh_CN";
string body = JsonHelper.SerializeObject(param);
string refere = "https://store.weixin.qq.com/shop/order/list?type=3";
var result = HttpResponseWXBLL.WeiXinPostResponse(shop, url, body, refere);
return result;
}
}
}