From a2b370ae5df06f7f8a5cf31b9f73d91f73dec59c Mon Sep 17 00:00:00 2001 From: "506583276@qq.com" <506583276@qq.com> Date: Fri, 7 Jul 2023 16:27:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=89=93=E5=8D=B0=E7=AE=B1?= =?UTF-8?q?=E5=94=9B,=E6=89=93=E5=8D=B0=E5=B0=81=E7=AE=B1=E7=AD=96?= =?UTF-8?q?=E7=95=A5,=E6=89=93=E5=8D=B0=E6=8F=BD=E6=94=B6=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../APIServices/QiKu/PackTaskService.cs | 43 ++- .../APIServices/QiKu/SealBoxService.cs | 21 +- BBWY.Client/BBWY.Client.csproj | 21 +- .../BatchUpdateSealBoxConfiguredRequest.cs | 5 + .../PackTask/SearchTaskListResponse.cs | 14 +- .../PackTask/SearchWaitFallWareResponse.cs | 5 + .../GetJDSupplierNameAndStoreNameResponse.cs | 2 + .../SealBox/GetWareLSAcceptOrderResponse.cs | 39 +++ .../SealBox/GetWareLSOrderPurchaseResponse.cs | 79 +++++ .../SealBox/GetWareSealBoxResponse.cs | 5 + .../SealBox/GetWareWaitTransportResponse.cs | 5 + .../FallWare/FallWareConfiguredModel.cs | 11 +- BBWY.Client/Models/PackTask/PackTaskModel.cs | 13 + BBWY.Client/Models/PackTask/SealBoxModel.cs | 8 + .../Models/SealBox/SealBoxConfigureModel.cs | 5 + BBWY.Client/Resources/Images/jdwl.png | Bin 0 -> 8192 bytes .../ViewModels/PackTask/TaskListViewModel.cs | 20 +- .../PackTask/WareHouseListViewModel.cs | 325 +++++++++++++----- .../SealBox/SealBoxConfigureViewModel.cs | 1 + .../FallWareWaitConfigureControl.xaml | 26 +- .../Views/FallWare/PrintBoxWindow.xaml | 8 +- .../Views/FallWare/PrintBoxWindow.xaml.cs | 85 ++++- .../Views/FallWare/PrintLSOrderWindow.xaml | 68 ++++ .../Views/FallWare/PrintLSOrderWindow.xaml.cs | 149 ++++++++ .../Views/FallWare/SetCloudWareBoxWindow.xaml | 25 +- .../FallWare/SetCloudWareBoxWindow.xaml.cs | 35 +- .../Views/FallWare/SetJDWareBoxWindow.xaml | 4 +- .../Views/FallWare/SetJDWareBoxWindow.xaml.cs | 35 +- .../Views/FallWare/SetJDWareBoxWindow2.xaml | 22 +- .../FallWare/SetJDWareBoxWindow2.xaml.cs | 48 ++- .../Views/FallWare/WaitFallWareControl.xaml | 55 ++- .../FallWare/WareLSAcceptOrderWindow.xaml | 317 +++++++++++++++++ .../FallWare/WareLSAcceptOrderWindow.xaml.cs | 92 +++++ .../Views/PackTask/FeesExcelControl.xaml | 2 + BBWY.Client/Views/PackTask/ServiceWindow.xaml | 3 + .../Views/PackTask/WaitPackageControl.xaml | 28 +- .../Views/QualityTask/WaitQualityControl.xaml | 25 +- .../SealBox/SealBoxPolicyDetailsWindow.xaml | 120 +++++++ .../SealBoxPolicyDetailsWindow.xaml.cs | 76 ++++ .../SealBox/SealBoxPrintDetailsWindow.xaml | 70 ++++ .../SealBox/SealBoxPrintDetailsWindow.xaml.cs | 141 ++++++++ .../Views/SealBox/SetSealBoxWindow.xaml | 11 +- .../Views/SealBox/SetSealBoxWindow.xaml.cs | 135 +------- .../Views/SealBox/WaitSealBoxControl.xaml | 69 ++-- .../SubmitOverTimeMarkMsgWindow.xaml | 57 +++ .../SubmitOverTimeMarkMsgWindow.xaml.cs | 74 ++++ .../WareWaitTransportControl.xaml | 25 +- 47 files changed, 2048 insertions(+), 379 deletions(-) create mode 100644 BBWY.Client/Models/APIModel/Response/SealBox/GetWareLSAcceptOrderResponse.cs create mode 100644 BBWY.Client/Models/APIModel/Response/SealBox/GetWareLSOrderPurchaseResponse.cs create mode 100644 BBWY.Client/Resources/Images/jdwl.png create mode 100644 BBWY.Client/Views/FallWare/PrintLSOrderWindow.xaml create mode 100644 BBWY.Client/Views/FallWare/PrintLSOrderWindow.xaml.cs create mode 100644 BBWY.Client/Views/FallWare/WareLSAcceptOrderWindow.xaml create mode 100644 BBWY.Client/Views/FallWare/WareLSAcceptOrderWindow.xaml.cs create mode 100644 BBWY.Client/Views/SealBox/SealBoxPolicyDetailsWindow.xaml create mode 100644 BBWY.Client/Views/SealBox/SealBoxPolicyDetailsWindow.xaml.cs create mode 100644 BBWY.Client/Views/SealBox/SealBoxPrintDetailsWindow.xaml create mode 100644 BBWY.Client/Views/SealBox/SealBoxPrintDetailsWindow.xaml.cs create mode 100644 BBWY.Client/Views/TaskOverTime/SubmitOverTimeMarkMsgWindow.xaml create mode 100644 BBWY.Client/Views/TaskOverTime/SubmitOverTimeMarkMsgWindow.xaml.cs diff --git a/BBWY.Client/APIServices/QiKu/PackTaskService.cs b/BBWY.Client/APIServices/QiKu/PackTaskService.cs index 4a4fedb1..ab5511d9 100644 --- a/BBWY.Client/APIServices/QiKu/PackTaskService.cs +++ b/BBWY.Client/APIServices/QiKu/PackTaskService.cs @@ -25,10 +25,10 @@ namespace BBWY.Client.APIServices { } - + public ApiResponse GetTaskList(string skuId = null, string taskId = null, - + TaskState? TaskState = null, int pageIndex = 1, int pageSize = 10 @@ -56,7 +56,7 @@ namespace BBWY.Client.APIServices ShopId = globalContext.User.Shop.ShopId.ToString() }, null, HttpMethod.Post); } - public ApiResponse GetWareHouseList(string WayBillNo = null, string SourceExpressName = null, string departmentName = null, string skuId = null, string taskId = null, + public ApiResponse GetWareHouseList(string WayBillNo = null, string SourceExpressName = null, string departmentName = null, string skuId = null, string taskId = null, TaskState? TaskState = null, string ShopName = null, @@ -161,7 +161,7 @@ namespace BBWY.Client.APIServices , null, HttpMethod.Post); } - + public ApiResponse SaveBarCode(BarCodeRequest barCodeModel) { @@ -279,23 +279,39 @@ namespace BBWY.Client.APIServices /// /// /// - public ApiResponse> GetPurchaseExpressOrderList(string orderId,string sourceSkuId) + public ApiResponse> GetPurchaseExpressOrderList(string orderId, string sourceSkuId) { - return SendRequest>("http://bbwyb.qiyue666.com", $"Api/Order/GetPurchaseExpressOrderList", new { + return SendRequest>("http://bbwyb.qiyue666.com", $"Api/Order/GetPurchaseExpressOrderList", new + { orderId, sourceSkuId }, null, HttpMethod.Post); } + /// + /// 批量手动发货 + /// + /// + /// + /// + public ApiResponse> BatchManualSign(string[] wayBillNoList) + { + return SendRequest>("http://bbwyb.qiyue666.com", $"Api​/PurchaseOrder​/BatchManualSign", new + { + wayBillNoList + }, null, HttpMethod.Post); + } + /// /// 查询超时任务列表 /// /// /// - public ApiResponse SearchOverTimeTaskList(string ShopId, DateTime? StartTime, DateTime? EndTime,OverTimeTaskState overTimeTaskState, OverTimeTaskType? OverTimeTaskType, int? PageIndex, int? PageSize=20) + public ApiResponse SearchOverTimeTaskList(string ShopId, DateTime? StartTime, DateTime? EndTime, OverTimeTaskState overTimeTaskState, OverTimeTaskType? OverTimeTaskType, int? PageIndex, int? PageSize = 20) { - return SendRequest(globalContext.QKApiHost, $"api/PackTask/SearchOverTimeTaskList", new { + return SendRequest(globalContext.QKApiHost, $"api/PackTask/SearchOverTimeTaskList", new + { ShopId, StartTime, EndTime, @@ -306,6 +322,17 @@ namespace BBWY.Client.APIServices }, null, HttpMethod.Post); } + public ApiResponse SubmitOverTimeMarkMsg(OverTimeTaskType OverTimeTaskType, long Id, string MarkMsg) + { + return SendRequest(globalContext.QKApiHost, $"api/PackTask/SubmitOverTimeMarkMsg", new + { + OverTimeTaskType, + Id, + MarkMsg, + }, null, HttpMethod.Post); + } + + } public class CompeteSealBox diff --git a/BBWY.Client/APIServices/QiKu/SealBoxService.cs b/BBWY.Client/APIServices/QiKu/SealBoxService.cs index c66b54c0..2d93496c 100644 --- a/BBWY.Client/APIServices/QiKu/SealBoxService.cs +++ b/BBWY.Client/APIServices/QiKu/SealBoxService.cs @@ -171,7 +171,7 @@ namespace BBWY.Client.APIServices - public ApiResponse SetFallWareConfigure(long SealBoxId, string ProductTitle, string PurchaseOrder, string PrewOrder, string WaybillNo, string providerName = "", string wareName = "",string WareCity="") + public ApiResponse SetFallWareConfigure(long SealBoxId, string ProductTitle, string PurchaseOrder, string PrewOrder, string WaybillNo, string providerName = "", string wareName = "",string WareCity="",DateTime? TransportOverTime=null) { return SendRequest(globalContext.QKApiHost, $"api/SealBox/SetFallWareConfigure", new @@ -183,7 +183,8 @@ namespace BBWY.Client.APIServices WaybillNo, providerName, wareName, - WareCity + WareCity, + TransportOverTime } , null, HttpMethod.Post); } @@ -287,5 +288,21 @@ namespace BBWY.Client.APIServices return SendRequest(globalContext.QKApiHost, $"api/SealBox/WareCompetedWaitCompleted?sealBoxId={sealBoxId}", null, null, HttpMethod.Post); } + + /// + /// 获取揽收单信息 + /// + /// + public ApiResponse GetWareLSAcceptOrder() + { + return SendRequest(globalContext.QKApiHost, $"api/WareLSAcceptOrder/GetWareLSAcceptOrder", + null, null, HttpMethod.Get); + } + + public ApiResponse GetWareLSOrderPurchaseList(string PrewOrder) + { + return SendRequest(globalContext.QKApiHost, $"api/WareLSAcceptOrder/GetWareLSOrderPurchaseList?PrewOrder={PrewOrder}", + null, null, HttpMethod.Get); + } } } diff --git a/BBWY.Client/BBWY.Client.csproj b/BBWY.Client/BBWY.Client.csproj index 36e0e5dc..e6f8759e 100644 --- a/BBWY.Client/BBWY.Client.csproj +++ b/BBWY.Client/BBWY.Client.csproj @@ -17,10 +17,18 @@ x64 + + + + + + + + @@ -62,6 +70,7 @@ Never + @@ -84,18 +93,6 @@ - - - - - - - - - - - - diff --git a/BBWY.Client/Models/APIModel/Request/BatchUpdateSealBoxConfiguredRequest.cs b/BBWY.Client/Models/APIModel/Request/BatchUpdateSealBoxConfiguredRequest.cs index 642e94b4..f96493f6 100644 --- a/BBWY.Client/Models/APIModel/Request/BatchUpdateSealBoxConfiguredRequest.cs +++ b/BBWY.Client/Models/APIModel/Request/BatchUpdateSealBoxConfiguredRequest.cs @@ -30,6 +30,11 @@ namespace BBWY.Client.Models.APIModel public class SealBoxConfiguredWareHourseRequest : WareHourseData { + + /// + ///封箱id + /// + public long? SealBoxId { get; set; } /// ///待封箱 = 0, 待落仓 = 1, 待完结 = 2 /// diff --git a/BBWY.Client/Models/APIModel/Response/PackTask/SearchTaskListResponse.cs b/BBWY.Client/Models/APIModel/Response/PackTask/SearchTaskListResponse.cs index b669a320..9484ab38 100644 --- a/BBWY.Client/Models/APIModel/Response/PackTask/SearchTaskListResponse.cs +++ b/BBWY.Client/Models/APIModel/Response/PackTask/SearchTaskListResponse.cs @@ -178,10 +178,16 @@ namespace BBWY.Client.Models.APIModel public DateTime? PackCompletionOverTime { get; set; } - ///// - ///// 物流信息 - ///// - //public List ExpressOrderList { get; set; } + + /// + /// 质检超时备注信息 + /// + public string QualityOverTimeMarkMsg { get; set; } + + /// + /// 打包超时备注信息 + /// + public string PackOverTimeMarkMsg { get; set; } } public class ExpressOrderResponse { diff --git a/BBWY.Client/Models/APIModel/Response/PackTask/SearchWaitFallWareResponse.cs b/BBWY.Client/Models/APIModel/Response/PackTask/SearchWaitFallWareResponse.cs index 3e9f1bb6..19e76826 100644 --- a/BBWY.Client/Models/APIModel/Response/PackTask/SearchWaitFallWareResponse.cs +++ b/BBWY.Client/Models/APIModel/Response/PackTask/SearchWaitFallWareResponse.cs @@ -173,6 +173,11 @@ namespace BBWY.Client.Models.APIModel /// public string ProviderName { get; set; } + /// + /// 仓库所在的城市 + /// + public string WareCity { get; set; } + } } diff --git a/BBWY.Client/Models/APIModel/Response/SealBox/GetJDSupplierNameAndStoreNameResponse.cs b/BBWY.Client/Models/APIModel/Response/SealBox/GetJDSupplierNameAndStoreNameResponse.cs index 53ec68e1..0958605d 100644 --- a/BBWY.Client/Models/APIModel/Response/SealBox/GetJDSupplierNameAndStoreNameResponse.cs +++ b/BBWY.Client/Models/APIModel/Response/SealBox/GetJDSupplierNameAndStoreNameResponse.cs @@ -7,5 +7,7 @@ public string StoreId { get; set; } public string StoreName { get; set; } + + public string City { get; set; } } } diff --git a/BBWY.Client/Models/APIModel/Response/SealBox/GetWareLSAcceptOrderResponse.cs b/BBWY.Client/Models/APIModel/Response/SealBox/GetWareLSAcceptOrderResponse.cs new file mode 100644 index 00000000..bff8ee99 --- /dev/null +++ b/BBWY.Client/Models/APIModel/Response/SealBox/GetWareLSAcceptOrderResponse.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace BBWY.Client.Models.APIModel +{ + public class GetWareLSAcceptOrderResponse + { + /// + /// 客户名称 + /// + public string CustomerName { get; set; } + /// + /// 提货地址 + /// + public string AcceptAdress { get; set; } + /// + /// 客户联系人 + /// + public string CustomerUserName { get; set; } + /// + /// 客户电话 + /// + public string CustomerPhoneNumber { get; set; } + /// + /// 揽收任务号 + /// + public string LSTaskNumber { get; set; } + /// + /// 始发TC + /// + public string StartTC { get; set; } + + /// + /// JD运输联系人 + /// + public string JDTransportUserName { get; set; } + } +} diff --git a/BBWY.Client/Models/APIModel/Response/SealBox/GetWareLSOrderPurchaseResponse.cs b/BBWY.Client/Models/APIModel/Response/SealBox/GetWareLSOrderPurchaseResponse.cs new file mode 100644 index 00000000..31af4963 --- /dev/null +++ b/BBWY.Client/Models/APIModel/Response/SealBox/GetWareLSOrderPurchaseResponse.cs @@ -0,0 +1,79 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace BBWY.Client.Models.APIModel +{ + public class GetWareLSOrderPurchaseResponse + { + /// + /// 总封箱数 + /// + public int TotalSealBoxCount { get; set; } + + /// + /// TC收货总箱数 + /// + public int TotalTCAcceptBoxCount { get; set; } + + /// + /// 采购单列表 + /// + public IList GetWareLSOrderPurchases { get; set; } + } + + public class GetWareLSOrderPurchase + { + /// + /// 序号(1-10) + /// + public int Index { get; set; } + + /// + /// 采购订单号 + /// + public string PurchaseOrder { get; set; } + + /// + /// 封箱数 + /// + public int? SealBoxCount { get; set; } + + /// + /// 目的城市 + /// + public string WareCity { get; set; } + + /// + /// TC收货箱数 + /// + public int? TCAcceptBoxCount { get; set; } + + + /// + /// 供应商 + /// + public string ProviderName { get; set; } + + /// + /// 预约单号 + /// + public string PrewOrder { get; set; } + + /// + /// 目的城市-仓库 + /// + public string WareName { get; set; } + + /// + /// 商品数量 + /// + public int ProductCount { get; set; } + + /// + /// 商品名称 + /// + public string ProductTitle { get; set; } + + } +} diff --git a/BBWY.Client/Models/APIModel/Response/SealBox/GetWareSealBoxResponse.cs b/BBWY.Client/Models/APIModel/Response/SealBox/GetWareSealBoxResponse.cs index 092cb437..a42d459d 100644 --- a/BBWY.Client/Models/APIModel/Response/SealBox/GetWareSealBoxResponse.cs +++ b/BBWY.Client/Models/APIModel/Response/SealBox/GetWareSealBoxResponse.cs @@ -57,6 +57,11 @@ namespace BBWY.Client.Models.APIModel /// public List SealBoxSkus { get; set; } + /// + /// 封箱超时备注 + /// + public string SealBoxPackOverTimeMarkMsg { get; set; } + } public class WareSealBoxSku diff --git a/BBWY.Client/Models/APIModel/Response/SealBox/GetWareWaitTransportResponse.cs b/BBWY.Client/Models/APIModel/Response/SealBox/GetWareWaitTransportResponse.cs index b521b9e4..3577158a 100644 --- a/BBWY.Client/Models/APIModel/Response/SealBox/GetWareWaitTransportResponse.cs +++ b/BBWY.Client/Models/APIModel/Response/SealBox/GetWareWaitTransportResponse.cs @@ -15,6 +15,11 @@ namespace BBWY.Client.Models.APIModel } public class WareWaitTransport:NotifyObject { + + private string transportOverTimeMarkMsg; + public string TransportOverTimeMarkMsg { get => transportOverTimeMarkMsg; set { Set(ref transportOverTimeMarkMsg, value); } } + + private string waitTransportRemainTime; public string WaitTransportRemainTime { get => waitTransportRemainTime; set { Set(ref waitTransportRemainTime, value); } } diff --git a/BBWY.Client/Models/FallWare/FallWareConfiguredModel.cs b/BBWY.Client/Models/FallWare/FallWareConfiguredModel.cs index 27948b13..039788c2 100644 --- a/BBWY.Client/Models/FallWare/FallWareConfiguredModel.cs +++ b/BBWY.Client/Models/FallWare/FallWareConfiguredModel.cs @@ -56,15 +56,20 @@ namespace BBWY.Client.Models.FallWare /// 仓库任务列表 /// public IList SealBoxConfigureTasks { get; set; } + private string setPurchaseOrderOverTimeMarkMsg; + public string SetPurchaseOrderOverTimeMarkMsg { get => setPurchaseOrderOverTimeMarkMsg; set { Set(ref setPurchaseOrderOverTimeMarkMsg, value); } } - - - + private string fallWareRemainTime; public string FallWareRemainTime { get => fallWareRemainTime; set { Set(ref fallWareRemainTime, value); } } private bool isFallWareOverTime; public bool IsFallWareOverTime { get => isFallWareOverTime; set { Set(ref isFallWareOverTime, value); } } + + /// + /// 预约时间 + /// + public DateTime? TransportOverTime { get; set; } } public class FallWareConfigureTask : SealBoxConfigureTask { diff --git a/BBWY.Client/Models/PackTask/PackTaskModel.cs b/BBWY.Client/Models/PackTask/PackTaskModel.cs index 63bb718d..239593f7 100644 --- a/BBWY.Client/Models/PackTask/PackTaskModel.cs +++ b/BBWY.Client/Models/PackTask/PackTaskModel.cs @@ -420,6 +420,19 @@ namespace BBWY.Client.Models public string ShopName { get => shopName; set { Set(ref shopName, value); } } + private string qualityOverTimeMarkMsg; + /// + /// 质检超时备注信息 + /// + public string QualityOverTimeMarkMsg { get => qualityOverTimeMarkMsg; set { Set(ref qualityOverTimeMarkMsg, value); } } + + private string packOverTimeMarkMsg; + /// + /// 打包超时备注信息 + /// + public string PackOverTimeMarkMsg { get => packOverTimeMarkMsg; set { Set(ref packOverTimeMarkMsg, value); } } + + } public class SkuMessage : NotifyObject diff --git a/BBWY.Client/Models/PackTask/SealBoxModel.cs b/BBWY.Client/Models/PackTask/SealBoxModel.cs index 075d2c6e..27915440 100644 --- a/BBWY.Client/Models/PackTask/SealBoxModel.cs +++ b/BBWY.Client/Models/PackTask/SealBoxModel.cs @@ -60,5 +60,13 @@ namespace BBWY.Client.Models.PackTask private bool isSealBoxOverTime; public bool IsSealBoxOverTime { get => isSealBoxOverTime; set { Set(ref isSealBoxOverTime, value); } } + + + private string sealBoxPackOverTimeMarkMsg; + + /// + /// 封箱超时备注 + /// + public string SealBoxPackOverTimeMarkMsg { get => sealBoxPackOverTimeMarkMsg; set { Set(ref sealBoxPackOverTimeMarkMsg, value); } } } } diff --git a/BBWY.Client/Models/SealBox/SealBoxConfigureModel.cs b/BBWY.Client/Models/SealBox/SealBoxConfigureModel.cs index eb384976..bf1b757a 100644 --- a/BBWY.Client/Models/SealBox/SealBoxConfigureModel.cs +++ b/BBWY.Client/Models/SealBox/SealBoxConfigureModel.cs @@ -72,6 +72,11 @@ namespace BBWY.Client.Models.SealBox /// public PositionState? WareState { get; set; } + /// + ///封箱id + /// + public long? SealBoxId { get; set; } + } diff --git a/BBWY.Client/Resources/Images/jdwl.png b/BBWY.Client/Resources/Images/jdwl.png new file mode 100644 index 0000000000000000000000000000000000000000..c1c96239f8eb0892f46ae00d74daf50e97dffe63 GIT binary patch literal 8192 zcmV+bAphTqP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>DAC*Z&K~#8N?VSaf zT-DjfQ=_j%rDcIVo;=e+;(>NzvY6{$!?n(wFx+#(feKBOXWi&Uif zkcz-9Qjz9EDgw7iMVb$(2;3qSX+ESPaEnx=`H+SWxP5)D`#&GK_WSN}9S=VselU|C zyw7z$^-mXXs24Z7u4kTh?GM}=er`T~=ziDn=)(0_WF&HzV*RyT#Rh9< z@>&yJ)lS>H9s#`PlmEJ!-FJ57lO}|pn~!Vhtu}L2+imTtr|j$+jz89Q+dKZ`+?6f6L?$o3hykPfy??vz58rncn{Vt&7hNd)+(LQj#a!uB*YMk^(zx>=aQpksEl4nv zQ#|e;oI@m6DCL=A+A)&UuXjv&e)>D79k+9a+D7_X*4vQonci;o-k8) z{lzcUt6b}i*SXdk#JAk+dOrKi zKRWz`uo1gxx#mjOdeimx%&upj^@MN)Df;?ruI0+hy!XEDYO~w`vq$}|^U23u%T<>r z`X&0>E3Uu0+dn=y!Uc@J_=5lL*SVIfFLxbJJvm#kkJuNVyS7{Ysy1EgTCcy>wcq^@ z*H>HP9~~TxEO3`!+Es44LBdq7+-CDR1KecRWI>xMHd)`b-*KC@wXeQz-T-ben|DWj z?#|0lrv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xN4Z?oUp_$Cc39E)ES1()d|&v9n8g+JdG> z0};tajuL@GO@O!p2F&;X`1zlH^S&P_)ZjaS$~$DuBSUHrKBo7}0%Go!&37WAXyS1C=>6&bPGK!9;s>G7?zQBbFa55w80f!w=W{MyL z8uF3^B?6i);0~5~7vHzWBA_rJ-qmS>pYtb3hREit=yN!MTcjc-(+(SetFallWareConfigured); + + SubmitOverTimeMarkMsgCommand = new RelayCommand(SubmitOverTimeMarkMsg); + } + + private void SubmitOverTimeMarkMsg(object param) + { + var paramList = (object[])param; + var id = (long)paramList[0]; + var markMsg = paramList[1].ToString(); + SubmitOverTimeMarkMsgWindow submitOverTimeMarkMsgWindow = new SubmitOverTimeMarkMsgWindow(OverTimeTaskType.待落仓, id, markMsg, packTaskService, ReflashTask) ; + submitOverTimeMarkMsgWindow.Show(); } private void SetFallWareConfigured(object obj) @@ -274,13 +286,14 @@ namespace BBWY.Client.ViewModels.PackTask ProductTitle = fallware.ProductTitle, PurchaseOrder = fallware.PurchaseOrder, WaybillNo = fallware.WaybillNo + }; //if (fallware.WareType== WareType.京仓) //{ //SetJDWareBoxWindow window = new SetJDWareBoxWindow(model,sealBoxService,fallware.WareType.Value,ReflashTask); //window.Show(); - var w = new SetJDWareBoxWindow2(model, sealBoxService, fallware.WareType.Value, ReflashTask); + var w = new SetJDWareBoxWindow2(model, sealBoxService, fallware.WareType.Value, ReflashTask,fallware.TransportOverTime); w.ShowDialog(); //} //if (fallware.WareType == WareType.云仓) @@ -399,6 +412,11 @@ namespace BBWY.Client.ViewModels.PackTask #region 事件绑定 + + /// + /// 提交过期时间数据 + /// + public ICommand SubmitOverTimeMarkMsgCommand { get; set; } /// /// 设置落仓配置信息(上传材料) /// diff --git a/BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs b/BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs index 06b1adba..48fcd228 100644 --- a/BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs +++ b/BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs @@ -28,6 +28,7 @@ using WebSocketSharp; using System.Threading; using BBWY.Client.Helpers; using System.Diagnostics.Eventing.Reader; +using BBWY.Client.Views.TaskOverTime; namespace BBWY.Client.ViewModels.PackTask { @@ -45,7 +46,7 @@ namespace BBWY.Client.ViewModels.PackTask private DateTime endTime; public DateTime EndTime { get => endTime; set { Set(ref endTime, value); } } - + public IList OverTimeTaskResponses { get; set; } @@ -72,7 +73,7 @@ namespace BBWY.Client.ViewModels.PackTask /// public ObservableCollection OverTimeTaskStateList { get => overTimeTaskStateList; set { Set(ref overTimeTaskStateList, value); } } - + private OverTimeTaskType overTimeTaskType = OverTimeTaskType.全部; /// @@ -80,7 +81,7 @@ namespace BBWY.Client.ViewModels.PackTask /// public OverTimeTaskType OverTimeTaskType { get => overTimeTaskType; set { Set(ref overTimeTaskType, value); } } - private OverTimeTaskState overTimeTaskState = OverTimeTaskState.全部; + private OverTimeTaskState overTimeTaskState = OverTimeTaskState.全部; /// /// 任务类型(超时) /// @@ -342,7 +343,7 @@ namespace BBWY.Client.ViewModels.PackTask SearchTaskCommand = new RelayCommand(() => { - SearchTaskList(); //手动点击查询订单 + SearchTaskList(); //手动点击查询订单 }); TaskPageIndexChangedCommand = new RelayCommand(p => { @@ -369,7 +370,7 @@ namespace BBWY.Client.ViewModels.PackTask PositionState = PositionState.待落仓; SetSealBoxConfigureTypeCommand = new RelayCommand(s => { - + SealBoxConfigureType = s; PositionState = s == SealBoxConfigureType.已配置 ? PositionState.已配置待落仓 : PositionState.待落仓; SearchTaskList(); @@ -389,7 +390,7 @@ namespace BBWY.Client.ViewModels.PackTask SetWareTypeCommand = new RelayCommand(s => { - + SelectWareType = s; SearchTaskList(); }); @@ -397,7 +398,143 @@ namespace BBWY.Client.ViewModels.PackTask CompeteWaitTransportCommand = new RelayCommand(CompeteWaitTransport); CompeteWaitCompletedCommand = new RelayCommand(CompeteWaitCompleted); + PrintSealBoxDetailsCommand = new RelayCommand(PrintSealBoxDetails); + + PrintLSOrderConfigureCommand = new RelayCommand(PrintLSOrderConfigure); + + LookLSOrderConfigureCommand = new RelayCommand(LookLSOrderConfigure); + SubmitOverTimeMarkMsgCommand = new RelayCommand(SubmitOverTimeMarkMsg); + } + + private void SubmitOverTimeMarkMsg(object param) + { + + var paramList = (object[])param; + var id = (long)paramList[0]; + var markMsg = paramList[1]?.ToString(); + + + OverTimeTaskType overTimeTaskType= OverTimeTaskType.待验收; + switch (TaskState.Value) + { + case Models.TaskState.待验收: + overTimeTaskType = Models.OverTimeTaskType.待验收; + break; + case Models.TaskState.待打包: + overTimeTaskType = Models.OverTimeTaskType.待打包; + break; + case Models.TaskState.待封箱: + overTimeTaskType = Models.OverTimeTaskType.待封箱; + break; + case Models.TaskState.待落仓: + overTimeTaskType = Models.OverTimeTaskType.待落仓; + break; + case Models.TaskState.待转运: + overTimeTaskType = Models.OverTimeTaskType.待转运; + break; + } + + SubmitOverTimeMarkMsgWindow submitOverTimeMarkMsgWindow = new SubmitOverTimeMarkMsgWindow(overTimeTaskType, id, markMsg, packTaskService, ReflashTask); + submitOverTimeMarkMsgWindow.Show(); + } + + private void LookLSOrderConfigure(object obj) + { + var model = obj as WaitFallWareModel; + + if (model.WareType != WareType.京仓) + { + System.Windows.MessageBox.Show($"{model.WareType}没有揽收单,只有京仓才有揽收单."); + return; + } + + if (model.BoxConfigureData == null || model.BoxConfigureData.PrewOrder.IsNullOrEmpty()) + { + System.Windows.MessageBox.Show($"预约单号为空,无法查看"); + return; + } + + var lsdTaskMsgRes = sealBoxService.GetWareLSAcceptOrder(); + if (!lsdTaskMsgRes.Success) + { + System.Windows.MessageBox.Show($"获取任务信息失败,原因:{lsdTaskMsgRes.Msg}"); + return; + + } + var lsdTaskMsg = lsdTaskMsgRes.Data; + + var LSOrderPurchaseListRes = sealBoxService.GetWareLSOrderPurchaseList(model.BoxConfigureData.PrewOrder); + if (!LSOrderPurchaseListRes.Success) + { + System.Windows.MessageBox.Show($"获取货物信息失败,原因:{LSOrderPurchaseListRes.Msg}"); + return; + + } + + var data = LSOrderPurchaseListRes.Data; + + + List lookData = null; + if (data.GetWareLSOrderPurchases.Count > 10) + { + lookData = data.GetWareLSOrderPurchases.ToList().GetRange(0, 10); + } + else + { + lookData = data.GetWareLSOrderPurchases.ToList(); + } + + var totalPageIndex = data.GetWareLSOrderPurchases.Count() % 10 == 0 ? data.GetWareLSOrderPurchases.Count() / 10 : data.GetWareLSOrderPurchases.Count() / 10 + 1; + + WareLSAcceptOrderWindow wareLSAcceptOrderWindow = new WareLSAcceptOrderWindow(lsdTaskMsg, lookData, 1, totalPageIndex, model.BoxConfigureData.PrewOrder); + wareLSAcceptOrderWindow.Show(); + } + + private void PrintLSOrderConfigure(object obj) + { + var model = obj as WaitFallWareModel; + + if (model.WareType != WareType.京仓) + { + System.Windows.MessageBox.Show($"{model.WareType}没有揽收单,只有京仓才有揽收单."); + return; + } + + if (model.BoxConfigureData == null || model.BoxConfigureData.PrewOrder.IsNullOrEmpty()) + { + System.Windows.MessageBox.Show($"预约单号为空,无法查看"); + return; + } + var lsdTaskMsgRes = sealBoxService.GetWareLSAcceptOrder(); + if (!lsdTaskMsgRes.Success) + { + System.Windows.MessageBox.Show($"获取任务信息失败,原因:{lsdTaskMsgRes.Msg}"); + return; + + } + var lsdTaskMsg = lsdTaskMsgRes.Data; + + var LSOrderPurchaseListRes = sealBoxService.GetWareLSOrderPurchaseList(model.BoxConfigureData.PrewOrder); + if (!LSOrderPurchaseListRes.Success) + { + System.Windows.MessageBox.Show($"获取货物信息失败,原因:{LSOrderPurchaseListRes.Msg}"); + return; + + } + + var data = LSOrderPurchaseListRes.Data; + + PrintLSOrderWindow printLS = new PrintLSOrderWindow(data.GetWareLSOrderPurchases.ToList(), model.BoxConfigureData.PrewOrder, lsdTaskMsg); + printLS.ShowDialog(); + } + + private void PrintSealBoxDetails(object obj) + { + var model = (SealBoxModel)obj; + + SealBoxPrintDetailsWindow printDetailsWindow = new SealBoxPrintDetailsWindow(model); + printDetailsWindow.ShowDialog(); } private void CompeteWaitCompleted(object obj) @@ -527,11 +664,11 @@ namespace BBWY.Client.ViewModels.PackTask WaybillNo = fallware.BoxConfigureData.WaybillNo, ProviderName = fallware.BoxConfigureData.ProviderName }; - - PrintBoxWindow printBox = new PrintBoxWindow(model, fallware.WareType); - printBox.ShowDialog(); - //加载模板数据 - + + PrintBoxWindow printBox = new PrintBoxWindow(model, fallware.WareType, sealBoxService); + printBox.ShowDialog(); + //加载模板数据 + //打印 } @@ -560,7 +697,7 @@ namespace BBWY.Client.ViewModels.PackTask } if (fallware.WareType == WareType.云仓 || fallware.WareType == WareType.聚水潭齐越仓) { - SetCloudWareBoxWindow window = new SetCloudWareBoxWindow(model, fallware.WareType); + SetCloudWareBoxWindow window = new SetCloudWareBoxWindow(model, fallware.WareType); window.Show(); } @@ -569,7 +706,7 @@ namespace BBWY.Client.ViewModels.PackTask public PositionState PositionState { get; set; } /// - /// 完成落仓(todo:) + /// 完成落仓 /// /// private void CompeteFallWare(object obj) @@ -604,7 +741,7 @@ namespace BBWY.Client.ViewModels.PackTask return; } - SetSealBoxWindow setSealBoxWindow = new SetSealBoxWindow(model); + SetSealBoxWindow setSealBoxWindow = new SetSealBoxWindow(); setSealBoxWindow.SendBoxCount = boxCount => { model.SealBoxCount = boxCount; @@ -614,6 +751,23 @@ namespace BBWY.Client.ViewModels.PackTask #region 事件绑定 + + /// + /// 提交超时原因 + /// + public ICommand SubmitOverTimeMarkMsgCommand { get; set; } + /// + /// 查看揽收单 + /// + public ICommand LookLSOrderConfigureCommand { get; set; } + /// + /// 打印揽收单 + /// + public ICommand PrintLSOrderConfigureCommand { get; set; } + /// + /// 打印封箱明细 + /// + public ICommand PrintSealBoxDetailsCommand { get; set; } /// /// 待完结 完成事件 /// @@ -743,11 +897,20 @@ namespace BBWY.Client.ViewModels.PackTask if (!model.OrderId.IsNullOrEmpty()) { - if (model.ExpressOrderList==null||model.ExpressOrderList.Count<=0) + if (model.ExpressOrderList == null || model.ExpressOrderList.Count <= 0) { System.Windows.MessageBox.Show("该任务采购单未进行发货,请联系业务进行发货后在确认收货", "提示"); return; } + var manualSigns = packTaskService.BatchManualSign(model.ExpressOrderList.Select(e => e.WaybillNo).ToArray()); + if (manualSigns == null || !manualSigns.Success) + { + if (!manualSigns.Success) + { + System.Windows.MessageBox.Show($"B端确认收货失败,{manualSigns.Msg}"); + return; + } + } } if (System.Windows.MessageBox.Show("是否确认收货?", "提示", MessageBoxButton.YesNo, @@ -755,11 +918,6 @@ namespace BBWY.Client.ViewModels.PackTask return; res = packTaskService.SetPackTaskState(taskId, Models.TaskState.待验收); - if (res != null && res.Success) - { - - //todo:手动发货上传B端数据 - } break; case Models.TaskState.待验收: break; @@ -795,11 +953,11 @@ namespace BBWY.Client.ViewModels.PackTask } - + public void SetTaskState(TaskState? taskState) { - - + + TaskState = taskState; if (PageIndex == 1) SearchTaskList(); @@ -828,7 +986,7 @@ namespace BBWY.Client.ViewModels.PackTask if (SearchTaskId != null && !string.IsNullOrEmpty(SearchTaskId.Trim())) taskId = Convert.ToInt64(SearchTaskId); - var istrue = long.TryParse(SearchSealBoxId, out long sealboxid); + var istrue = long.TryParse(SearchSealBoxId, out long sealboxid); if (istrue) { sealBoxId = sealboxid; @@ -841,7 +999,7 @@ namespace BBWY.Client.ViewModels.PackTask } IsLoading = true; - + if (TaskState == Models.TaskState.待出库) { Task.Factory.StartNew(() => @@ -869,13 +1027,13 @@ namespace BBWY.Client.ViewModels.PackTask IsLoading = false; }); } - else if (TaskState == Models.TaskState.已超时) + else if (TaskState == Models.TaskState.已超时) { PageSize = 20; Task.Factory.StartNew(() => { OverTimeTaskList = new ObservableCollection(); - var datas = packTaskService.SearchOverTimeTaskList(null, StartTime, EndTime, OverTimeTaskState,OverTimeTaskType, PageIndex, PageSize); + var datas = packTaskService.SearchOverTimeTaskList(null, StartTime, EndTime, OverTimeTaskState, OverTimeTaskType, PageIndex, PageSize); if (datas != null && datas.Data != null && datas.Success) { var dataModel = datas.Data; @@ -934,12 +1092,12 @@ namespace BBWY.Client.ViewModels.PackTask if (datetime.TotalMilliseconds > 0) { item.IsWaitTransportOverTime = false; - item.WaitTransportRemainTime = $"{datetime.Hours}小时{datetime.Minutes}分"; + item.WaitTransportRemainTime = OverTimeHelper.GetTimeString(datetime); } else { item.IsWaitTransportOverTime = true; - item.WaitTransportRemainTime = datetime.Days == 0 ? $"{-datetime.Hours}小时{-datetime.Minutes}分" : $"{-datetime.Days}天{-datetime.Hours}小时{-datetime.Minutes}分"; + item.WaitTransportRemainTime = OverTimeHelper.GetTimeString(datetime); } } @@ -970,7 +1128,7 @@ namespace BBWY.Client.ViewModels.PackTask WaitFallWareList = new ObservableCollection(); - var datas = sealBoxService.SearchWareFallWareConfigureList(PositionState, SearchShopName, taskId, SearchSkuId,sealBoxId, PageIndex, PageSize); + var datas = sealBoxService.SearchWareFallWareConfigureList(PositionState, SearchShopName, taskId, SearchSkuId, sealBoxId, PageIndex, PageSize); if (datas != null && datas.Data != null && datas.Success) { var dataModel = datas.Data; @@ -993,54 +1151,54 @@ namespace BBWY.Client.ViewModels.PackTask BoxConfigureData = item.BoxConfigureData, ProductCount = item.ProductCount, WareType = item.WareType, - SetPurchaseOrderOverTime=item.SetPurchaseOrderOverTime + SetPurchaseOrderOverTime = item.SetPurchaseOrderOverTime }); })); } - var fallWareTasks = WaitFallWareList.Where(p => p.SetPurchaseOrderOverTime != null).ToList(); - if (fallWareTasks.Count() > 0 && TaskState == Models.TaskState.待落仓 && SealBoxConfigureType == SealBoxConfigureType.待配置) - { - //if (packOverTimeThread!=null) - //{ - // packOverTimeThread.Abort(); - //} - - fallwareOverTimeThread = new Thread(() => - { - IsStartThread = true; - while (IsStartThread) - { - App.Current.Dispatcher.BeginInvoke(new Action(() => - { - foreach (var item in fallWareTasks) - { - var datetime = item.SetPurchaseOrderOverTime.Value.Subtract(DateTime.Now); - if (datetime.TotalMilliseconds > 0) - { - item.IsFallWareOverTime = false; - item.FallWareRemainTime = $"{datetime.Hours}小时{datetime.Minutes}分"; - } - else - { - item.IsFallWareOverTime = true; - item.FallWareRemainTime = datetime.Days == 0 ? $"{-datetime.Hours}小时{-datetime.Minutes}分" : $"{-datetime.Days}天{-datetime.Hours}小时{-datetime.Minutes}分"; - } - - } - })); - Thread.Sleep(1000); - } - - }); - //任务倒计时数据 - fallwareOverTimeThread.IsBackground = true; - fallwareOverTimeThread.Start(); - - - } + //var fallWareTasks = WaitFallWareList.Where(p => p.SetPurchaseOrderOverTime != null).ToList(); + //if (fallWareTasks.Count() > 0 && TaskState == Models.TaskState.待落仓 && SealBoxConfigureType == SealBoxConfigureType.待配置) + //{ + // //if (packOverTimeThread!=null) + // //{ + // // packOverTimeThread.Abort(); + // //} + + // fallwareOverTimeThread = new Thread(() => + // { + // IsStartThread = true; + // while (IsStartThread) + // { + // App.Current.Dispatcher.BeginInvoke(new Action(() => + // { + // foreach (var item in fallWareTasks) + // { + // var datetime = item.SetPurchaseOrderOverTime.Value.Subtract(DateTime.Now); + // if (datetime.TotalMilliseconds > 0) + // { + // item.IsFallWareOverTime = false; + // item.FallWareRemainTime = $"{datetime.Hours}小时{datetime.Minutes}分"; + // } + // else + // { + // item.IsFallWareOverTime = true; + // item.FallWareRemainTime = datetime.Days == 0 ? $"{-datetime.Hours}小时{-datetime.Minutes}分" : $"{-datetime.Days}天{-datetime.Hours}小时{-datetime.Minutes}分"; + // } + + // } + // })); + // Thread.Sleep(1000); + // } + + // }); + // //任务倒计时数据 + // fallwareOverTimeThread.IsBackground = true; + // fallwareOverTimeThread.Start(); + + + //} } else { @@ -1061,7 +1219,7 @@ namespace BBWY.Client.ViewModels.PackTask { WaitSealBoxModels = new ObservableCollection(); - var datas = sealBoxService.GetWareSealBoxList(SearchShopName, taskId, SearchSkuId, sealBoxId, PageIndex, PageSize); + var datas = sealBoxService.GetWareSealBoxList(SearchShopName, taskId, SearchSkuId, sealBoxId, PageIndex, PageSize); if (datas != null && datas.Data != null && datas.Success) { var dataModel = datas.Data; @@ -1086,12 +1244,13 @@ namespace BBWY.Client.ViewModels.PackTask WareId = item.WareId, WareName = item.WareName, SealBoxId = item.SealBoxId, - SealBoxPackOverTime = item.SealBoxPackOverTime + SealBoxPackOverTime = item.SealBoxPackOverTime, + SealBoxPackOverTimeMarkMsg = item.SealBoxPackOverTimeMarkMsg }); })); } - + var sealboxTasks = WaitSealBoxModels.Where(p => p.SealBoxPackOverTime != null).ToList(); if (sealboxTasks.Count() > 0 && TaskState == Models.TaskState.待封箱) { @@ -1110,12 +1269,12 @@ namespace BBWY.Client.ViewModels.PackTask if (datetime.TotalMilliseconds > 0) { item.IsSealBoxOverTime = false; - item.SealBoxRemainTime = $"{datetime.Hours}小时{datetime.Minutes}分"; + item.SealBoxRemainTime = OverTimeHelper.GetTimeString(datetime); } else { item.IsSealBoxOverTime = true; - item.SealBoxRemainTime = datetime.Days == 0 ? $"{-datetime.Hours}小时{-datetime.Minutes}分" : $"{-datetime.Days}天{-datetime.Hours}小时{-datetime.Minutes}分"; + item.SealBoxRemainTime = OverTimeHelper.GetTimeString(datetime) ; } } @@ -1223,6 +1382,8 @@ namespace BBWY.Client.ViewModels.PackTask QualityCompletionOverTime = item.QualityCompletionOverTime, PackCompletionOverTime = item.PackCompletionOverTime, ShopName = item.ShopName, + QualityOverTimeMarkMsg = item.QualityOverTimeMarkMsg, + PackOverTimeMarkMsg = item.PackOverTimeMarkMsg //ExpressOrderList = item.ExpressOrderList, }; @@ -1290,7 +1451,7 @@ namespace BBWY.Client.ViewModels.PackTask { qualityOverTimeThread = new Thread(() => { - + var packtasks = PackTaskList.Where(p => p.TaskState == Models.TaskState.待验收 && p.QualityCompletionOverTime != null).ToList(); if (packtasks.Count() > 0) { @@ -1329,7 +1490,7 @@ namespace BBWY.Client.ViewModels.PackTask qualityOverTimeThread.IsBackground = true; qualityOverTimeThread.Start(); //任务状态为待验收 - + } if (TaskState == Models.TaskState.待打包) { @@ -1354,12 +1515,12 @@ namespace BBWY.Client.ViewModels.PackTask if (datetime.TotalMilliseconds > 0) { item.IsPackOverTime = false; - item.PackRemainTime = datetime.Days == 0 ? $"{datetime.Hours}小时{datetime.Minutes}分" : $"{datetime.Days}天{datetime.Hours}小时{datetime.Minutes}分"; + item.PackRemainTime = OverTimeHelper.GetTimeString(datetime); } else { item.IsPackOverTime = true; - item.PackRemainTime = datetime.Days == 0 ? $"{-datetime.Hours}小时{-datetime.Minutes}分" : $"{-datetime.Days}天{-datetime.Hours}小时{-datetime.Minutes}分"; + item.PackRemainTime = OverTimeHelper.GetTimeString(datetime); } } @@ -1375,7 +1536,7 @@ namespace BBWY.Client.ViewModels.PackTask } } - + //任务状态为待打包 diff --git a/BBWY.Client/ViewModels/SealBox/SealBoxConfigureViewModel.cs b/BBWY.Client/ViewModels/SealBox/SealBoxConfigureViewModel.cs index 7d6554fe..651e4c8d 100644 --- a/BBWY.Client/ViewModels/SealBox/SealBoxConfigureViewModel.cs +++ b/BBWY.Client/ViewModels/SealBox/SealBoxConfigureViewModel.cs @@ -289,6 +289,7 @@ namespace BBWY.Client.ViewModels.SealBox WareName = x.WareName, WareType = x.WareType.Value, WareState = x.WareState, + SealBoxId=x.SealBoxId }).ToList(), }); diff --git a/BBWY.Client/Views/FallWare/FallWareWaitConfigureControl.xaml b/BBWY.Client/Views/FallWare/FallWareWaitConfigureControl.xaml index 65f655e6..5e702f09 100644 --- a/BBWY.Client/Views/FallWare/FallWareWaitConfigureControl.xaml +++ b/BBWY.Client/Views/FallWare/FallWareWaitConfigureControl.xaml @@ -223,11 +223,33 @@ - - + + + + + + + + + + + + + + + + + + + + + diff --git a/BBWY.Client/Views/FallWare/PrintBoxWindow.xaml b/BBWY.Client/Views/FallWare/PrintBoxWindow.xaml index 0dbcf4ce..6099f87b 100644 --- a/BBWY.Client/Views/FallWare/PrintBoxWindow.xaml +++ b/BBWY.Client/Views/FallWare/PrintBoxWindow.xaml @@ -42,12 +42,16 @@ - + - + diff --git a/BBWY.Client/Views/FallWare/PrintBoxWindow.xaml.cs b/BBWY.Client/Views/FallWare/PrintBoxWindow.xaml.cs index 9d55e9a1..8c001a1f 100644 --- a/BBWY.Client/Views/FallWare/PrintBoxWindow.xaml.cs +++ b/BBWY.Client/Views/FallWare/PrintBoxWindow.xaml.cs @@ -10,6 +10,7 @@ using System.Drawing.Printing; using System.IO; using System.Reflection; using System.Text; +using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; @@ -26,12 +27,13 @@ namespace BBWY.Client.Views.FallWare /// public partial class PrintBoxWindow : BWindow { - public PrintBoxWindow(JDWareBoxModel model, WareType WareType) + public PrintBoxWindow(JDWareBoxModel model, WareType WareType, SealBoxService sealBoxService) { - JDWareBoxModel =model ; this.WareType = WareType; + JDWareBoxModel = model; this.WareType = WareType; this.sealBoxService = sealBoxService; InitializeComponent(); this.DataContext = this; InitPrintList(); + } public void InitPrintList() { @@ -83,10 +85,10 @@ namespace BBWY.Client.Views.FallWare public string PrintName { get; set; } public int PrintCount { get; set; } = 1; + public SealBoxService sealBoxService { get; set; } - - public JDWareBoxModel JDWareBoxModel { get; set; } + public JDWareBoxModel JDWareBoxModel { get; set; } /// /// 箱唛类型 @@ -99,22 +101,71 @@ namespace BBWY.Client.Views.FallWare private void BButton_Click(object sender, RoutedEventArgs e) { - if (WareType== WareType.京仓) + bool isNeedPrintAllBox = false; + if (cbx_allsomebox.IsChecked != null && cbx_allsomebox.IsChecked.Value)//选择打印预约单的所有箱唛 + isNeedPrintAllBox = true; + Task.Factory.StartNew(() => { - SetJDWareBoxWindow jdWindow = new SetJDWareBoxWindow(JDWareBoxModel); - jdWindow.Show(); - //jdWindow.WindowState = WindowState.Maximized; - jdWindow.PrintBox(PrintName); - } + if (WareType == WareType.京仓) + { - if (WareType== WareType.云仓|| WareType== WareType.聚水潭齐越仓) - { - SetCloudWareBoxWindow cloudWareWindow = new SetCloudWareBoxWindow(JDWareBoxModel, WareType); - cloudWareWindow.Visibility = Visibility.Hidden; - cloudWareWindow.Show(); + if (isNeedPrintAllBox)//选择打印预约单的所有箱唛 + { + var datas = sealBoxService.GetWareLSOrderPurchaseList(JDWareBoxModel.PrewOrder); - cloudWareWindow.PrintBox(PrintName); - } + foreach (var item in datas.Data.GetWareLSOrderPurchases) + { + + App.Current.Dispatcher.Invoke(new Action(() => + { + + SetJDWareBoxWindow jdWindow = new SetJDWareBoxWindow(new JDWareBoxModel + { + BoxCount = item.SealBoxCount.Value, + PrewOrder = item.PrewOrder, + ProductCount = item.ProductCount, + ProductTitle = item.ProductTitle, + ProviderName = item.ProviderName, + PurchaseOrder = item.PurchaseOrder, + WareName = item.WareName, + }); + jdWindow.PrintBox(PrintName); + })); + + + } + } + else + { + App.Current.Dispatcher.Invoke(new Action(() => + { + + SetJDWareBoxWindow jdWindow = new SetJDWareBoxWindow(JDWareBoxModel); + jdWindow.PrintBox(PrintName); + })); + } + + + + + } + + if (WareType == WareType.云仓 || WareType == WareType.聚水潭齐越仓) + { + App.Current.Dispatcher.Invoke(new Action(() => + { + SetCloudWareBoxWindow cloudWareWindow = new SetCloudWareBoxWindow(JDWareBoxModel, WareType); + cloudWareWindow.PrintBox(PrintName); + })); + } + + App.Current.Dispatcher.Invoke(new Action(() => + { + + this.Close(); + })); + + }); } } } diff --git a/BBWY.Client/Views/FallWare/PrintLSOrderWindow.xaml b/BBWY.Client/Views/FallWare/PrintLSOrderWindow.xaml new file mode 100644 index 00000000..2fb63cd0 --- /dev/null +++ b/BBWY.Client/Views/FallWare/PrintLSOrderWindow.xaml @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/BBWY.Client/Views/FallWare/PrintLSOrderWindow.xaml.cs b/BBWY.Client/Views/FallWare/PrintLSOrderWindow.xaml.cs new file mode 100644 index 00000000..04077ab6 --- /dev/null +++ b/BBWY.Client/Views/FallWare/PrintLSOrderWindow.xaml.cs @@ -0,0 +1,149 @@ +using BBWY.Client.Models.APIModel; +using BBWY.Client.Models.PackTask; +using BBWY.Client.Views.SealBox; +using BBWY.Controls; +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Drawing.Printing; +using System.IO; +using System.Reflection; +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.Shapes; + +namespace BBWY.Client.Views.FallWare +{ + /// + /// PrintLSOrderWindow.xaml 的交互逻辑 + /// + public partial class PrintLSOrderWindow : BWindow + { + public PrintLSOrderWindow(List getWareLSOrderPurchases, string prewOrder, GetWareLSAcceptOrderResponse getWareLSAcceptOrderResponse) + { + InitializeComponent(); + InitPrintList(); + + this.DataContext = this; + GetWareLSOrderPurchases = getWareLSOrderPurchases; + PrewOrder = prewOrder; + GetWareLSAcceptOrderResponse = getWareLSAcceptOrderResponse; + } + /// + /// 打印机列表 + /// + public ObservableCollection PrintList { get; set; } + public string PrintName { get; set; } + public int PrintCount { get; set; } = 1; + public void InitPrintList() + { + //TaskImage = MyPrintHelper.GetBarcodeImage(TaskId.ToString(), 300, 60); + + //BarcodeImage = MyPrintHelper.GetBarcodeImage(SkuId, 300, 60); + + + PrintList = new ObservableCollection(); + var printingNames = PrinterSettings.InstalledPrinters;//获取本机的打印机数据 + int index = -1; + int selectIndex = 0; + foreach (string name in printingNames) + { + if (name == "Microsoft XPS Document Writer" || name == "Microsoft Print to PDF" || name == "Fax") + { + continue; + } + index++; + if (name.Contains("Deli")) + { + selectIndex = index; + } + PrintList.Add(name); + } + try + { + var applicationPath = System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + string printNames = System.IO.Path.Combine(applicationPath, "printName.init"); + if (File.Exists(printNames)) + { + PrintName = File.ReadAllText(printNames); + } + else + { + if (PrintList.Count > 0) + { + PrintName = PrintList[0].ToString(); + } + } + } + catch (Exception) + { + + + } + + } + + /// + /// 采购单列表 + /// + public List GetWareLSOrderPurchases { get; set; } + public string PrewOrder { get; set; } + public GetWareLSAcceptOrderResponse GetWareLSAcceptOrderResponse { get; set; } + + + + private void BButton_Click(object sender, RoutedEventArgs e) + { + int limitIndex = 10;//单页限制数量 + + int totalPageIndex = GetWareLSOrderPurchases.Count % 10 == 0 ? GetWareLSOrderPurchases.Count / 10 : GetWareLSOrderPurchases.Count / 10 + 1; + + + Task.Factory.StartNew(() => + { + + for (int i = 0; i < PrintCount; i++)//打印份数 + { + int nowPageIndex = 0; + again: + nowPageIndex++; + if (GetWareLSOrderPurchases.Count > limitIndex) + { + PrintBox(GetWareLSOrderPurchases.GetRange(0, limitIndex), nowPageIndex, totalPageIndex); + + GetWareLSOrderPurchases.RemoveRange(0, limitIndex); + goto again; + } + else + { + PrintBox(GetWareLSOrderPurchases, nowPageIndex, totalPageIndex); + } + } + App.Current.Dispatcher.Invoke(() => { + this.Close(); + }); + }); + } + + public void PrintBox(List GetWareLSOrderPurchases, int nowPageIndex, int totalPageIndex) + { + + App.Current.Dispatcher.Invoke(() => { + + WareLSAcceptOrderWindow lSAcceptOrderWindow = new WareLSAcceptOrderWindow(GetWareLSAcceptOrderResponse, GetWareLSOrderPurchases, nowPageIndex, totalPageIndex, PrewOrder); + //lSAcceptOrderWindow.Show(); + lSAcceptOrderWindow.PrintLSOrder(PrintName); + }); + + //SealBoxPolicyDetailsWindow policyDetailsWindow = new SealBoxPolicyDetailsWindow(sealBoxSkus, SealBoxModel.ShopName, SealBoxModel.WareName, SealBoxModel.SealBoxId); + //policyDetailsWindow.PrintBox(PrintName); + } + } +} diff --git a/BBWY.Client/Views/FallWare/SetCloudWareBoxWindow.xaml b/BBWY.Client/Views/FallWare/SetCloudWareBoxWindow.xaml index 7e472bd0..004b7825 100644 --- a/BBWY.Client/Views/FallWare/SetCloudWareBoxWindow.xaml +++ b/BBWY.Client/Views/FallWare/SetCloudWareBoxWindow.xaml @@ -5,7 +5,7 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:BBWY.Client.Views.FallWare" mc:Ignorable="d" - xmlns:c="clr-namespace:BBWY.Controls;assembly=BBWY.Controls" + xmlns:c="clr-namespace:BBWY.Controls;assembly=BBWY.Controls" xmlns:b="http://schemas.microsoft.com/xaml/behaviors" xmlns:ctr="clr-namespace:BBWY.Client.Converters" xmlns:cmodel="clr-namespace:BBWY.Client.Models" @@ -16,24 +16,11 @@ CloseButtonColor="{StaticResource WindowButtonColor}" MinButtonVisibility="Collapsed" MaxButtonVisibility="Collapsed" + RightButtonGroupMargin="0,5,5,0" Width="450" Height="380" - RightButtonGroupMargin="0,5,5,0"> + > - - - - - - - + @@ -46,7 +33,7 @@ - + @@ -92,7 +79,7 @@ - + diff --git a/BBWY.Client/Views/FallWare/SetCloudWareBoxWindow.xaml.cs b/BBWY.Client/Views/FallWare/SetCloudWareBoxWindow.xaml.cs index 4db8ee84..db57a044 100644 --- a/BBWY.Client/Views/FallWare/SetCloudWareBoxWindow.xaml.cs +++ b/BBWY.Client/Views/FallWare/SetCloudWareBoxWindow.xaml.cs @@ -18,6 +18,7 @@ using BBWY.Client.Helpers; using System.Printing; using System.Reflection; using System.IO; +using System.Threading; namespace BBWY.Client.Views.FallWare { @@ -34,6 +35,10 @@ namespace BBWY.Client.Views.FallWare InitializeComponent(); PurchaseOrderImage = MyPrintHelper.GetBarcodeImageV2(model.PurchaseOrder, 420, 50); this.DataContext = this; + this.Dispatcher.Invoke(() => { + tb_printcount.Text = "1"; + }); + this.UpdateLayout(); } public JDWareBoxModel JDWareBoxModel { get; set; } @@ -42,11 +47,9 @@ namespace BBWY.Client.Views.FallWare /// public BitmapImage PurchaseOrderImage { get; set; } public WareType WareType { get; set; } - public int PrintCount { get; set; } = 1; public void PrintBox(string printName) { - var localPrintServer = new LocalPrintServer(); if (string.IsNullOrEmpty(printName)) { @@ -60,22 +63,28 @@ namespace BBWY.Client.Views.FallWare } MyPrintHelper.SetDefaultPrint(printName);//设置默认打印机 PrintDialog printDialog = new PrintDialog(); - printDialog.PrintTicket.PageOrientation = PageOrientation.Landscape;//设置为横向打印 PageOrientation.Landscape Portrait为纵向 + var pageWidth = (int)Math.Ceiling(printDialog.PrintableAreaWidth); + var pageHeight = (int)Math.Ceiling(printDialog.PrintableAreaHeight); + printDialog.PrintTicket.PageMediaSize = new PageMediaSize(pageWidth, pageHeight); + + this.Height = pageHeight + 39; + this.Width = pageWidth; + this.FontSize = 30; + box_margin.Margin = new Thickness(50, 50, 50, 50); + this.jd_box.Arrange(new Rect(new Point(0, 0), new Size(pageWidth, pageHeight))); for (int i = 1; i <= JDWareBoxModel.BoxCount; i++) { - PrintCount = i; - //设置纸张大小 - var pageWidth = (int)Math.Ceiling(printDialog.PrintableAreaWidth); - var pageHeight = (int)Math.Ceiling(printDialog.PrintableAreaHeight); - printDialog.PrintTicket.PageMediaSize = new PageMediaSize(pageWidth, pageHeight); - + this.Dispatcher.Invoke(() => { + tb_printcount.Text =i.ToString(); + }); + this.Dispatcher.Invoke(() => { + this.UpdateLayout(); + }); + + - this.Height = pageHeight + 39; - this.Width = pageWidth; - this.FontSize = 30; - this.jd_box.Arrange(new Rect(new Point(0, 0), new Size(pageWidth, pageHeight))); printDialog.PrintVisual(this.jd_box, "打印任务"); } var applicationPath = System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); diff --git a/BBWY.Client/Views/FallWare/SetJDWareBoxWindow.xaml b/BBWY.Client/Views/FallWare/SetJDWareBoxWindow.xaml index e28f58f3..df819c59 100644 --- a/BBWY.Client/Views/FallWare/SetJDWareBoxWindow.xaml +++ b/BBWY.Client/Views/FallWare/SetJDWareBoxWindow.xaml @@ -43,7 +43,7 @@ - + @@ -103,7 +103,7 @@ - + diff --git a/BBWY.Client/Views/FallWare/SetJDWareBoxWindow.xaml.cs b/BBWY.Client/Views/FallWare/SetJDWareBoxWindow.xaml.cs index 048c89a0..7104a0e7 100644 --- a/BBWY.Client/Views/FallWare/SetJDWareBoxWindow.xaml.cs +++ b/BBWY.Client/Views/FallWare/SetJDWareBoxWindow.xaml.cs @@ -37,6 +37,10 @@ namespace BBWY.Client.Views.FallWare PurchaseOrderImage= MyPrintHelper.GetBarcodeImageV2(model.PurchaseOrder, 420, 50); PrewOrderImage = MyPrintHelper.GetBarcodeImageV2(model.PrewOrder, 350, 50); this.DataContext =this; + this.Dispatcher.Invoke(() => { + tb_printcount.Text = "1"; + }); + this.UpdateLayout(); } public JDWareBoxModel JDWareBoxModel { get; set; } @@ -53,7 +57,6 @@ namespace BBWY.Client.Views.FallWare public BitmapImage PrewOrderImage { get; set; } - public int PrintCount { get; set; } = 1; @@ -77,26 +80,22 @@ namespace BBWY.Client.Views.FallWare PrintDialog printDialog = new PrintDialog(); printDialog.PrintTicket.PageOrientation = PageOrientation.Landscape;//设置为横向打印 PageOrientation.Landscape Portrait为纵向 - + //设置纸张大小 + var pageWidth = (int)Math.Ceiling(printDialog.PrintableAreaWidth); + var pageHeight = (int)Math.Ceiling(printDialog.PrintableAreaHeight); + printDialog.PrintTicket.PageMediaSize = new PageMediaSize(pageWidth, pageHeight); + this.Height = pageHeight + 39;//833 + this.Width = pageWidth;//1123 + this.FontSize = 30; + box_margin.Margin = new Thickness(50, 50, 50, 50); + this.jd_box.Arrange(new Rect(new Point(0, 0), new Size(pageWidth, pageHeight))); for (int i = 1; i <= JDWareBoxModel.BoxCount; i++) { - PrintCount = i; - //设置纸张大小 - var pageWidth = (int)Math.Ceiling(printDialog.PrintableAreaWidth); - var pageHeight = (int)Math.Ceiling(printDialog.PrintableAreaHeight); - printDialog.PrintTicket.PageMediaSize = new PageMediaSize(pageWidth, pageHeight); - - - this.Height = pageHeight + 39;//833 - this.Width = pageWidth;//1123 - this.FontSize = 30; - this.jd_box.Arrange(new Rect(new Point(0, 0), new Size(pageWidth, pageHeight))); - //794 429 Width="478" Height="440" - //this.jd_box.Arrange(new Rect(new Point((pageWidth - jd_box.DesiredSize.Width) / 2, (pageHeight - jd_box.DesiredSize.Height) / 2), new Size(jd_box.DesiredSize.Width, jd_box.DesiredSize.Height))); - + this.Dispatcher.Invoke(() => { + tb_printcount.Text =i.ToString(); + }); + this.UpdateLayout(); //刷新界面 printDialog.PrintVisual(this.jd_box, "打印任务"); - - } var applicationPath = System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); string printNames = System.IO.Path.Combine(applicationPath, "printName.init"); diff --git a/BBWY.Client/Views/FallWare/SetJDWareBoxWindow2.xaml b/BBWY.Client/Views/FallWare/SetJDWareBoxWindow2.xaml index ccf7177f..dc9755aa 100644 --- a/BBWY.Client/Views/FallWare/SetJDWareBoxWindow2.xaml +++ b/BBWY.Client/Views/FallWare/SetJDWareBoxWindow2.xaml @@ -7,7 +7,8 @@ mc:Ignorable="d" xmlns:cmodel="clr-namespace:BBWY.Client.Models" xmlns:c="clr-namespace:BBWY.Controls;assembly=BBWY.Controls" - Title="SetJDWareBoxWindow2" Height="250" Width="300" + Title="SetJDWareBoxWindow2" + Height="280" Width="300" MinButtonVisibility="Collapsed" MaxButtonVisibility="Collapsed" CloseButtonVisibility="Visible" @@ -75,7 +76,7 @@ /> - + @@ -105,8 +106,23 @@ + + + + + + + + + + + + + + - + diff --git a/BBWY.Client/Views/FallWare/SetJDWareBoxWindow2.xaml.cs b/BBWY.Client/Views/FallWare/SetJDWareBoxWindow2.xaml.cs index 54587bf6..3eca7928 100644 --- a/BBWY.Client/Views/FallWare/SetJDWareBoxWindow2.xaml.cs +++ b/BBWY.Client/Views/FallWare/SetJDWareBoxWindow2.xaml.cs @@ -23,12 +23,22 @@ namespace BBWY.Client.Views.FallWare public WareType wareType { get; set; } + /// + /// 预约时间(日期) + /// + public DateTime PrewDate { get; set; } + + /// + /// 预约时间(小时:分钟) + /// + public string PrewTime { get; set; } + public bool IsEnabled { get; set; } public bool IsLoading { get => isLoading; set { Set(ref isLoading, value); } } private bool isLoading; - public SetJDWareBoxWindow2(JDWareBoxModel model, SealBoxService sealBoxService, WareType wareType, Action reflashWindow, bool isEnabled = true) + public SetJDWareBoxWindow2(JDWareBoxModel model, SealBoxService sealBoxService, WareType wareType, Action reflashWindow,DateTime? TransportOverTime=null) { InitializeComponent(); @@ -36,7 +46,7 @@ namespace BBWY.Client.Views.FallWare this.wareType = wareType; this.reflashWindow = reflashWindow; JDWareBoxModel = model; - this.IsEnabled = isEnabled; + this.DataContext = this; switch (wareType) @@ -47,6 +57,14 @@ namespace BBWY.Client.Views.FallWare panel_jingcang.Visibility= Visibility.Visible; panel_yuncang.Visibility= Visibility.Collapsed; panel_jst.Visibility= Visibility.Collapsed; + + PrewDate = DateTime.Now; + PrewTime = "17:30"; + if (TransportOverTime != null) + { + PrewDate = TransportOverTime.Value.Date; + PrewTime = TransportOverTime?.ToString("HH:mm"); + } break; case WareType.云仓: btn_jingcang.IsEnabled = false; @@ -84,6 +102,23 @@ namespace BBWY.Client.Views.FallWare MessageBox.Show("信息不完整", "提示"); return; } + + DateTime? PrewDateTime = null; + + try + { + PrewDateTime = DateTime.Parse((PrewDate.ToString("yyyy-MM-dd ") + PrewTime)); + + + } + catch + { + MessageBox.Show("输入的时间有误", "提示"); + return; + } + + + IsLoading = true; Task.Factory.StartNew(() => { @@ -95,7 +130,14 @@ namespace BBWY.Client.Views.FallWare return; } - var res = sealBoxService.SetFallWareConfigure(JDWareBoxModel.SealBoxId, JDWareBoxModel.ProductTitle, JDWareBoxModel.PurchaseOrder, JDWareBoxModel.PrewOrder, JDWareBoxModel.WaybillNo, getDetailResponse.Data.SupplierName, getDetailResponse.Data.StoreName); + if (getDetailResponse.Data.StoreName!= JDWareBoxModel.WareName) + { + IsLoading = false; + this.Dispatcher.Invoke(() => MessageBox.Show($"采购单对应的仓库名:{getDetailResponse.Data.StoreName}与当前仓库:{JDWareBoxModel.WareName}不符", "提示")); + return; + } + + var res = sealBoxService.SetFallWareConfigure(JDWareBoxModel.SealBoxId, JDWareBoxModel.ProductTitle, JDWareBoxModel.PurchaseOrder, JDWareBoxModel.PrewOrder, JDWareBoxModel.WaybillNo, getDetailResponse.Data.SupplierName, getDetailResponse.Data.StoreName, getDetailResponse.Data.City, PrewDateTime); if (!res.Success) { IsLoading = false; diff --git a/BBWY.Client/Views/FallWare/WaitFallWareControl.xaml b/BBWY.Client/Views/FallWare/WaitFallWareControl.xaml index fda3766c..c657bbbc 100644 --- a/BBWY.Client/Views/FallWare/WaitFallWareControl.xaml +++ b/BBWY.Client/Views/FallWare/WaitFallWareControl.xaml @@ -36,7 +36,8 @@ - + + @@ -124,7 +125,8 @@ - + + @@ -242,31 +244,60 @@ - + - + - - - + + + - + + + + + + + + + - + diff --git a/BBWY.Client/Views/FallWare/WareLSAcceptOrderWindow.xaml b/BBWY.Client/Views/FallWare/WareLSAcceptOrderWindow.xaml new file mode 100644 index 00000000..5b747000 --- /dev/null +++ b/BBWY.Client/Views/FallWare/WareLSAcceptOrderWindow.xaml @@ -0,0 +1,317 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/BBWY.Client/Views/FallWare/WareLSAcceptOrderWindow.xaml.cs b/BBWY.Client/Views/FallWare/WareLSAcceptOrderWindow.xaml.cs new file mode 100644 index 00000000..f1bf3e3d --- /dev/null +++ b/BBWY.Client/Views/FallWare/WareLSAcceptOrderWindow.xaml.cs @@ -0,0 +1,92 @@ +using BBWY.Client.Helpers; +using BBWY.Client.Models.APIModel; +using BBWY.Client.Models.APIModel.Response; +using BBWY.Client.Models.FallWare; +using BBWY.Controls; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Printing; +using System.Reflection; +using System.Text; +using System.Threading; +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.Shapes; + +namespace BBWY.Client.Views.FallWare +{ + /// + /// WareLSAcceptOrderWindow.xaml 的交互逻辑 + /// + public partial class WareLSAcceptOrderWindow : BWindow + { + public WareLSAcceptOrderWindow(GetWareLSAcceptOrderResponse GetWareLSAcceptOrderResponse, List GetWareLSOrderPurchases, int nowPageIndex, int totalPageIndex, string prewOrder + + ) + { + InitializeComponent(); + this.GetWareLSAcceptOrderResponse = GetWareLSAcceptOrderResponse; + this.GetWareLSOrderPurchases = GetWareLSOrderPurchases; + this.NowPageIndex = nowPageIndex; + this.TotalPageIndex = totalPageIndex; + this.DataContext = this; + PrewOrder = prewOrder; + TotalSealBoxCount = GetWareLSOrderPurchases.Select(w=>w.SealBoxCount).Sum().Value; + this.UpdateLayout(); + } + + public GetWareLSAcceptOrderResponse GetWareLSAcceptOrderResponse { get; set; } + public List GetWareLSOrderPurchases { get; set; } + public int NowPageIndex { get; set; } + public int TotalPageIndex { get; set; } + public string PrewOrder { get; set; } + + /// + /// 总封箱数 + /// + public int TotalSealBoxCount { get; set; } + + ///// + ///// TC收货总箱数 + ///// + //public int TotalTCAcceptBoxCount { get; set; } + + + public void PrintLSOrder(string printName) + { + var localPrintServer = new LocalPrintServer(); + if (string.IsNullOrEmpty(printName)) + { + return; + } + var printQueue = localPrintServer.GetPrintQueue(printName); + if (printQueue.IsInError) + { + System.Windows.MessageBox.Show("打印机处于错误状态"); + return; + } + MyPrintHelper.SetDefaultPrint(printName);//设置默认打印机 + PrintDialog printDialog = new PrintDialog(); + printDialog.PrintTicket.PageOrientation = PageOrientation.Portrait;//设置为横向打印 PageOrientation.Landscape Portrait为纵向 + var pageWidth = (int)Math.Ceiling(printDialog.PrintableAreaWidth); + var pageHeight = (int)Math.Ceiling(printDialog.PrintableAreaHeight); + // printDialog.PrintTicket.PageMediaSize = new PageMediaSize(pageWidth, pageHeight); + + //835 1166 + this.Height = pageHeight+39; + this.Width = pageWidth; + this.print_lsOrder.Arrange(new Rect(new Point(0, 0), new Size(pageWidth, pageHeight))); + this.UpdateLayout(); + printDialog.PrintVisual(this.print_lsOrder, "打印任务"); + this.Close(); + } + } + + +} diff --git a/BBWY.Client/Views/PackTask/FeesExcelControl.xaml b/BBWY.Client/Views/PackTask/FeesExcelControl.xaml index 49edbf0c..dfa33e31 100644 --- a/BBWY.Client/Views/PackTask/FeesExcelControl.xaml +++ b/BBWY.Client/Views/PackTask/FeesExcelControl.xaml @@ -8,6 +8,8 @@ d:DesignHeight="150" d:DesignWidth="1800"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/BBWY.Client/Views/SealBox/SealBoxPolicyDetailsWindow.xaml.cs b/BBWY.Client/Views/SealBox/SealBoxPolicyDetailsWindow.xaml.cs new file mode 100644 index 00000000..9b068701 --- /dev/null +++ b/BBWY.Client/Views/SealBox/SealBoxPolicyDetailsWindow.xaml.cs @@ -0,0 +1,76 @@ +using BBWY.Client.Helpers; +using BBWY.Client.Models.APIModel; +using BBWY.Client.Models.FallWare; +using BBWY.Controls; +using System; +using System.Collections.Generic; +using System.Printing; +using System.Reflection; +using System.Text; +using System.Threading; +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.Shapes; + +namespace BBWY.Client.Views.SealBox +{ + /// + /// SealBoxPolicyDetailsWindow.xaml 的交互逻辑 + /// + public partial class SealBoxPolicyDetailsWindow : BWindow + { + public SealBoxPolicyDetailsWindow(List sealBoxSkus, string shopName, string wareName, long sealBoxId) + { + InitializeComponent(); + this.DataContext = this; + SealBoxSkus = sealBoxSkus; + ShopName = shopName; + WareName = wareName; + SealBoxId = sealBoxId; + this.UpdateLayout(); + } + + /// + /// 封箱sku列表 + /// + public List SealBoxSkus { get; set; } + + public string ShopName { get; set; } + public string WareName { get; set; } + + public long SealBoxId { get; set; } + + public void PrintBox(string printName) + { + var localPrintServer = new LocalPrintServer(); + if (string.IsNullOrEmpty(printName)) + { + return; + } + var printQueue = localPrintServer.GetPrintQueue(printName); + if (printQueue.IsInError) + { + System.Windows.MessageBox.Show("打印机处于错误状态"); + return; + } + MyPrintHelper.SetDefaultPrint(printName);//设置默认打印机 + PrintDialog printDialog = new PrintDialog(); + printDialog.PrintTicket.PageOrientation = PageOrientation.Portrait;//设置为横向打印 PageOrientation.Landscape Portrait为纵向 + var pageWidth = (int)Math.Ceiling(printDialog.PrintableAreaWidth); + var pageHeight = (int)Math.Ceiling(printDialog.PrintableAreaHeight); + printDialog.PrintTicket.PageMediaSize = new PageMediaSize(pageWidth, pageHeight); + this.Height = pageHeight; + this.Width = pageWidth; + // this.FontSize = 30; + this.print_sealbox.Arrange(new Rect(new Point(0, 0), new Size(pageWidth, pageHeight))); + this.UpdateLayout(); + printDialog.PrintVisual(this.print_sealbox, "打印任务"); + this.Close(); + } + } +} diff --git a/BBWY.Client/Views/SealBox/SealBoxPrintDetailsWindow.xaml b/BBWY.Client/Views/SealBox/SealBoxPrintDetailsWindow.xaml new file mode 100644 index 00000000..711ef15a --- /dev/null +++ b/BBWY.Client/Views/SealBox/SealBoxPrintDetailsWindow.xaml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/BBWY.Client/Views/SealBox/SealBoxPrintDetailsWindow.xaml.cs b/BBWY.Client/Views/SealBox/SealBoxPrintDetailsWindow.xaml.cs new file mode 100644 index 00000000..f7c09356 --- /dev/null +++ b/BBWY.Client/Views/SealBox/SealBoxPrintDetailsWindow.xaml.cs @@ -0,0 +1,141 @@ +using BBWY.Client.Models.APIModel; +using BBWY.Client.Models.PackTask; +using BBWY.Controls; +using NPOI.Util; +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Drawing.Printing; +using System.IO; +using System.Reflection; +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.Shapes; + +namespace BBWY.Client.Views.SealBox +{ + /// + /// SealBoxPrintDetailsWindow.xaml 的交互逻辑 + /// + public partial class SealBoxPrintDetailsWindow : BWindow + { + public SealBoxPrintDetailsWindow(SealBoxModel sealBox) + { + InitializeComponent(); + InitPrintList(); + SealBoxModel = sealBox.Copy(); + this.DataContext = this; + } + /// + /// 打印机列表 + /// + public ObservableCollection PrintList { get; set; } + public void InitPrintList() + { + //TaskImage = MyPrintHelper.GetBarcodeImage(TaskId.ToString(), 300, 60); + + //BarcodeImage = MyPrintHelper.GetBarcodeImage(SkuId, 300, 60); + + + PrintList = new ObservableCollection(); + var printingNames = PrinterSettings.InstalledPrinters;//获取本机的打印机数据 + int index = -1; + int selectIndex = 0; + foreach (string name in printingNames) + { + if (name == "Microsoft XPS Document Writer" || name == "Microsoft Print to PDF" || name == "Fax") + { + continue; + } + index++; + if (name.Contains("Deli")) + { + selectIndex = index; + } + PrintList.Add(name); + } + try + { + var applicationPath = System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + string printNames = System.IO.Path.Combine(applicationPath, "printName.init"); + if (File.Exists(printNames)) + { + PrintName = File.ReadAllText(printNames); + } + else + { + if (PrintList.Count > 0) + { + PrintName = PrintList[0].ToString(); + } + } + } + catch (Exception) + { + + + } + + } + + public string PrintName { get; set; } + public int PrintCount { get; set; } = 1; + + + /// + /// 封箱sku列表 + /// + public SealBoxModel SealBoxModel { get; set; } + + public string ShopName { get; set; } + public string WareName { get; set; } + + public long SealBoxId { get; set; } + private void BButton_Click(object sender, RoutedEventArgs e) + { + + + int limitIndex = 15;//单页限制数量 + + Task.Factory.StartNew(() => + { + for (int i = 0; i < PrintCount; i++)//打印份数 + { + again: + if (SealBoxModel.SealBoxSkus.Count > limitIndex) + { + PrintBox(SealBoxModel.SealBoxSkus.GetRange(0, limitIndex)); + + SealBoxModel.SealBoxSkus.RemoveRange(0, limitIndex); + goto again; + } + else + { + PrintBox(SealBoxModel.SealBoxSkus); + } + } + App.Current.Dispatcher.Invoke(new Action(() => + { + this.Close(); + })); + }); + } + + public void PrintBox(List sealBoxSkus) + { + App.Current.Dispatcher.Invoke(new Action(() => + { + SealBoxPolicyDetailsWindow policyDetailsWindow = new SealBoxPolicyDetailsWindow(sealBoxSkus, SealBoxModel.ShopName, SealBoxModel.WareName, SealBoxModel.SealBoxId); + policyDetailsWindow.PrintBox(PrintName); + })); + + } + } +} diff --git a/BBWY.Client/Views/SealBox/SetSealBoxWindow.xaml b/BBWY.Client/Views/SealBox/SetSealBoxWindow.xaml index cfc870c4..7ceb3a19 100644 --- a/BBWY.Client/Views/SealBox/SetSealBoxWindow.xaml +++ b/BBWY.Client/Views/SealBox/SetSealBoxWindow.xaml @@ -31,22 +31,17 @@ - - + + - - - - - - + diff --git a/BBWY.Client/Views/SealBox/SetSealBoxWindow.xaml.cs b/BBWY.Client/Views/SealBox/SetSealBoxWindow.xaml.cs index f3a04100..5aab0828 100644 --- a/BBWY.Client/Views/SealBox/SetSealBoxWindow.xaml.cs +++ b/BBWY.Client/Views/SealBox/SetSealBoxWindow.xaml.cs @@ -28,49 +28,11 @@ namespace BBWY.Client.Views.SealBox /// public partial class SetSealBoxWindow : BWindow { - public SetSealBoxWindow(SealBoxModel sealBoxModel) + public SetSealBoxWindow() { - SealBoxModel = sealBoxModel; - InitializeComponent(); - LoadPrints(); - } - - SealBoxModel SealBoxModel { get; set; } - /// - /// 获取打印机名称 - /// - private void LoadPrints() - { - var printingNames = PrinterSettings.InstalledPrinters;//获取本机的打印机数据 - int index = -1; - int selectIndex = 0; - foreach (string name in printingNames) - { - if (name == "Microsoft XPS Document Writer" || name == "Microsoft Print to PDF" || name == "Fax") - { - continue; - } - //index++; - //if (name.Contains("Deli")) - //{ - // selectIndex = index; - //} - cbPrint.Items.Add(name); - } - //if (cbPrint.Items.Count > selectIndex) - //{ - // cbPrint.SelectedIndex = selectIndex; - //} - var applicationPath = System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - string printNamePath = $"{applicationPath}/printSealName.init"; - if (File.Exists(printNamePath)) - { - cbPrint.Text = File.ReadAllText(printNamePath); - } + InitializeComponent(); } - - public Action SendBoxCount { get; set; } private void BButton_Click(object sender, RoutedEventArgs e) { @@ -84,103 +46,10 @@ namespace BBWY.Client.Views.SealBox MessageBox.Show("请输入数字!"); return; } - //string printName = cbPrint.Text; - //var localPrintServer = new LocalPrintServer(); - //var printQueue = localPrintServer.GetPrintQueue(printName); - //if (printQueue.IsInError) - //{ - // MessageBox.Show("打印机处于错误状态"); - // return; - //} - - ////PrintSealboxModel(printName, boxCount); - - //MyPrintHelper.PrintSealBoxData(SealBoxModel, printName, boxCount, 1); - ////todo: 打印单子 if (SendBoxCount != null) SendBoxCount(boxCount); this.Close(); } - - private void PrintSealboxModel(string printName, int boxCount, int printCount = 1) - { - - - // - - } - private void PrintSealboxModel1(string printName, int boxCount) - { - var applicationPath = System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - string printNamePath = $"{applicationPath}/printSealName.init"; - if (File.Exists(printNamePath)) - { - File.Delete(printNamePath); - } - File.WriteAllText(printNamePath, printName); - - var excel = $"{applicationPath}/Resources/ExccelModel/sealbox.xlsx"; - - var newExccel = $"{applicationPath}/Resources/ExccelModel/newsealbox.xlsx"; - if (File.Exists(newExccel)) - { - File.Delete(newExccel); - } - FileStream fs = new FileStream(excel, FileMode.Open, FileAccess.Read); - XSSFWorkbook wb = new XSSFWorkbook(fs); - var sheet = wb.GetSheetAt(0); // 得到第一个sheet - - var nameCell = sheet.GetRow(0).GetCell(0); // name列,第2行 - var ageCell = sheet.GetRow(3).GetCell(0); // age列,第2行 - - - XSSFWorkbook wb2 = new XSSFWorkbook(); - //wb2.CreateSheet("Sheet1"); - sheet.CopyTo(wb2, "Sheet1", true, false); - var sheet2 = wb2.GetSheet("Sheet1"); - - - var nameCell2 = sheet2.GetRow(0).GetCell(1); - nameCell2.SetCellValue(SealBoxModel.ShopName); - - sheet2.GetRow(3).GetCell(1).SetCellValue(SealBoxModel.WareName); - - StringBuilder sb = new StringBuilder(); - int totalCount = 0; - for (int i = 0; i < SealBoxModel.SealBoxSkus.Count; i++) - { - var title = SealBoxModel.SealBoxSkus[i].SkuTitle; - //if (title.Length>5) - //{ - // title = title.Substring(0,5); - //} - totalCount += SealBoxModel.SealBoxSkus[i].WareHourseSkuCount; - sheet2.GetRow(i + 6).GetCell(1).SetCellValue($"名称:{title}"); - sheet2.GetRow(i + 6).GetCell(2).SetCellValue($"SKU:{SealBoxModel.SealBoxSkus[i].SkuId}"); - sheet2.GetRow(i + 6).GetCell(3).SetCellValue($"数量:{SealBoxModel.SealBoxSkus[i].WareHourseSkuCount}"); - - } - sheet2.GetRow(25).GetCell(1).SetCellValue(totalCount); - sheet2.GetRow(28).GetCell(1).SetCellValue(boxCount); - FileStream fs1 = new FileStream(newExccel, FileMode.OpenOrCreate, FileAccess.ReadWrite); - wb2.Write(fs1); - fs1.Close(); - fs1.Dispose(); - //Workbook workbook = new Workbook(); - //workbook.loa - //workbook.LoadFromFile(newExccel); - //var print = workbook.PrintDocument; - //print.PrinterSettings.PrinterName = printName; - //print.Print(); - - // - - } - - void SpirePrint() - { - - } } diff --git a/BBWY.Client/Views/SealBox/WaitSealBoxControl.xaml b/BBWY.Client/Views/SealBox/WaitSealBoxControl.xaml index 5be54b0c..f0efdf81 100644 --- a/BBWY.Client/Views/SealBox/WaitSealBoxControl.xaml +++ b/BBWY.Client/Views/SealBox/WaitSealBoxControl.xaml @@ -38,7 +38,7 @@ - + @@ -92,14 +92,14 @@ - - - + - + - + - + @@ -214,9 +214,9 @@ - + - + @@ -240,7 +240,7 @@ - + @@ -266,18 +266,39 @@ Visibility="{Binding IsSealBoxOverTime,Converter={StaticResource objConverter},ConverterParameter=false:Visible:Collapsed}" > - + - + - - + + + + + + + + + + + + + + + + + + + - + @@ -285,18 +306,20 @@ Content="{Binding SealBoxCount,Converter={StaticResource objConverter},ConverterParameter=#null:设置:修改}" Command="{Binding DataContext.SetSealBoxCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type UserControl}}}" CommandParameter="{Binding}" - > + /> + - + + - - - - + /> diff --git a/BBWY.Client/Views/TaskOverTime/SubmitOverTimeMarkMsgWindow.xaml b/BBWY.Client/Views/TaskOverTime/SubmitOverTimeMarkMsgWindow.xaml new file mode 100644 index 00000000..283f1ea1 --- /dev/null +++ b/BBWY.Client/Views/TaskOverTime/SubmitOverTimeMarkMsgWindow.xaml @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/BBWY.Client/Views/TaskOverTime/SubmitOverTimeMarkMsgWindow.xaml.cs b/BBWY.Client/Views/TaskOverTime/SubmitOverTimeMarkMsgWindow.xaml.cs new file mode 100644 index 00000000..fffc7131 --- /dev/null +++ b/BBWY.Client/Views/TaskOverTime/SubmitOverTimeMarkMsgWindow.xaml.cs @@ -0,0 +1,74 @@ +using BBWY.Client.APIServices; +using BBWY.Client.Models; +using BBWY.Controls; +using System; +using System.Collections.Generic; +using System.Text; +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 WebSocketSharp; + +namespace BBWY.Client.Views.TaskOverTime +{ + /// + /// SubmitOverTimeMarkMsgWindow.xaml 的交互逻辑 + /// + public partial class SubmitOverTimeMarkMsgWindow : BWindow + { + public SubmitOverTimeMarkMsgWindow(OverTimeTaskType overTimeTaskType, long id, string msg, PackTaskService packTaskService, Action reflashWindow) + { + InitializeComponent(); + this.OverTimeTaskType = overTimeTaskType; + this.Id = id; + MarkMsg = msg; + this.reflashWindow = reflashWindow; + this.packTaskService = packTaskService; + this.DataContext = this; + } + Action reflashWindow; + PackTaskService packTaskService { get; set; } + /// + /// 超时任务类型(待验收 = 2,待打包 = 3,待封箱 = 4, 待落仓 = 8,待转运 = 11,) + /// + public OverTimeTaskType OverTimeTaskType { get; set; } + + /// + /// 任务id 或者 封箱id + /// + public long Id { get; set; } + /// + /// 备注信息 + /// + public string MarkMsg { get; set; } + + private void BButton_Click(object sender, RoutedEventArgs e) + { + if (MarkMsg.IsNullOrEmpty()) + { + MessageBox.Show("请输入超时原因"); + return; + } + + var res = packTaskService.SubmitOverTimeMarkMsg(OverTimeTaskType, Id, MarkMsg); + if (res == null) + { + MessageBox.Show("网络异常"); + return; + } + if (!res.Success) + { + MessageBox.Show(res.Msg); + return; + } + if (reflashWindow != null) reflashWindow(); + this.Close(); + } + } +} diff --git a/BBWY.Client/Views/WaitTransport/WareWaitTransportControl.xaml b/BBWY.Client/Views/WaitTransport/WareWaitTransportControl.xaml index 65d04de0..c426eabe 100644 --- a/BBWY.Client/Views/WaitTransport/WareWaitTransportControl.xaml +++ b/BBWY.Client/Views/WaitTransport/WareWaitTransportControl.xaml @@ -268,11 +268,28 @@ - + - - + + + + + + + + + + + + + + + + +