From 1033e373bd9849c4feeb58bd613a611f2d019aac Mon Sep 17 00:00:00 2001
From: shanj <18996038927@163.com>
Date: Sun, 4 Jun 2023 22:49:56 +0800
Subject: [PATCH 01/17] =?UTF-8?q?=E7=89=88=E6=9C=AC=E9=AA=8C=E8=AF=81?=
=?UTF-8?q?=E6=8F=90=E7=A4=BA=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Middlewares/ClientVersionValidationMiddleWare.cs | 6 +++---
PJZS/App.xaml.cs | 11 +++++------
2 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/BBWY.Server.API/Middlewares/ClientVersionValidationMiddleWare.cs b/BBWY.Server.API/Middlewares/ClientVersionValidationMiddleWare.cs
index 1d8d4fcd..0ebfc7cd 100644
--- a/BBWY.Server.API/Middlewares/ClientVersionValidationMiddleWare.cs
+++ b/BBWY.Server.API/Middlewares/ClientVersionValidationMiddleWare.cs
@@ -36,11 +36,11 @@ namespace BBWY.Server.API.Middlewares
if (apiRequirement != null)
{
if (!context.Request.Headers.TryGetValue("ClientVersion", out StringValues clientVersionStr))
- throw new BusinessException("未读取到ClientVersion");
+ throw new BusinessException("缺少版本信息,请更新步步为盈");
if (!int.TryParse(clientVersionStr, out int clientVersion))
- throw new BusinessException("非法ClientVersion");
+ throw new BusinessException("版本信息不正确,请更新步步为盈");
if (clientVersion < apiRequirement.MinimumVersion)
- throw new BusinessException("当前ClientVersion低于接口最低要求,请升级到最新版");
+ throw new BusinessException("当前请求需更新步步为盈~!");
}
await _next(context); //调用管道执行下一个中间件
}
diff --git a/PJZS/App.xaml.cs b/PJZS/App.xaml.cs
index bd92d274..473a4c82 100644
--- a/PJZS/App.xaml.cs
+++ b/PJZS/App.xaml.cs
@@ -1,17 +1,16 @@
-using BBWY.Common.Http;
+using BBWY.Common.Extensions;
+using BBWY.Common.Http;
using BBWY.Common.Models;
-using BBWY.Common.Extensions;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
+using PJZS.Models;
using System;
+using System.Diagnostics;
using System.IO;
+using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
using System.Windows;
-using PJZS.Models;
-using System.Linq;
-using System.IO.MemoryMappedFiles;
-using System.Diagnostics;
using Utils;
namespace PJZS
From 80917ac4378665100e57692ab78ac89e510d68eb Mon Sep 17 00:00:00 2001
From: "506583276@qq.com" <506583276@qq.com>
Date: Mon, 5 Jun 2023 14:11:25 +0800
Subject: [PATCH 02/17] 1
---
.../APIModel/Request/QualityTaskRequest.cs | 5 +
.../QualityTask/QualityViewModel.cs | 165 ++++++++++++++++--
.../Views/QualityTask/QualityWindow.xaml | 13 +-
3 files changed, 162 insertions(+), 21 deletions(-)
diff --git a/BBWY.Client/Models/APIModel/Request/QualityTaskRequest.cs b/BBWY.Client/Models/APIModel/Request/QualityTaskRequest.cs
index fb10e901..8bc501e2 100644
--- a/BBWY.Client/Models/APIModel/Request/QualityTaskRequest.cs
+++ b/BBWY.Client/Models/APIModel/Request/QualityTaskRequest.cs
@@ -93,5 +93,10 @@ namespace BBWY.Client.Models.APIModel.Request
///
public DateTime? PreCompeteTime { get; set; }
+ ///
+ /// 地拖摆放编号
+ ///
+ public int? FloorDragNumber { get; set; }
+
}
}
diff --git a/BBWY.Client/ViewModels/QualityTask/QualityViewModel.cs b/BBWY.Client/ViewModels/QualityTask/QualityViewModel.cs
index 4995c86d..5f484d09 100644
--- a/BBWY.Client/ViewModels/QualityTask/QualityViewModel.cs
+++ b/BBWY.Client/ViewModels/QualityTask/QualityViewModel.cs
@@ -95,6 +95,18 @@ namespace BBWY.Client.ViewModels
public ObservableCollection AvailabilityList { get => availabilityList; set { Set(ref availabilityList, value); } }
+ private int floorDragNumber;
+ public int FloorDragNumber { get => floorDragNumber; set { Set(ref floorDragNumber, value); } }
+
+ private ObservableCollection floorDragNumberList = new ObservableCollection
+ {
+
+ };
+ public ObservableCollection FloorDragNumberList { get => floorDragNumberList; set { Set(ref floorDragNumberList, value); } }
+
+
+
+
private ObservableCollection preCompeteTimeDayList = new ObservableCollection
{
@@ -394,6 +406,11 @@ namespace BBWY.Client.ViewModels
private void CompeteQualityTask(object obj)
{
+ if (FloorDragNumber <= 0)
+ {
+ MessageBox.Show($"请选择摆放地拖编号");
+ return;
+ }
if (GoodProductQuantity > ArrivalQuantity)
{
@@ -423,7 +440,8 @@ namespace BBWY.Client.ViewModels
SkuId = SkuId,
IsNeedBar = IsNeedBarCode == Need.需要,
IsNeedCer = IsNeedCertificateModel == Need.需要,
- TaskId = TaskId
+ TaskId = TaskId,
+ FloorDragNumber = FloorDragNumber
};
if (IsNeedBarCode == Need.需要)
{
@@ -441,11 +459,11 @@ namespace BBWY.Client.ViewModels
MessageBox.Show("无可用的合格证打印!");
return;
}
- //if (PurchaseSkuList.Where(p => p.IsSetCertificate).Count() > 0)
- //{
- // MessageBox.Show("存在未确认的合格证,请先完成确认!");
- // return;
- //}
+ if (PurchaseSkuList.Where(p => p.IsSetCertificate).Count() > 0)
+ {
+ MessageBox.Show("存在未确认的合格证,请先完成确认!");
+ return;
+ }
if (PurchaseSkuList.Where(p => p.IsNeedCer && p.CerDTO.Id > 0).Count() <= 0)
{
MessageBox.Show("无可选的合格证打印!");
@@ -457,9 +475,79 @@ namespace BBWY.Client.ViewModels
int hour = Convert.ToInt32(PreCompeteTimeHour.Replace("点前", ""));
- var date = Convert.ToDateTime(PreCompeteTimeDay);
- request.PreCompeteTime = date.AddHours(hour);
+ DateTime date = DateTime.Now;
+
+ switch (preCompeteTimeDay)
+ {
+ case "今天":
+ date = DateTime.Now;
+ break;
+ case "明天":
+ date = DateTime.Now.AddDays(1);
+ break;
+ case "后天":
+ date = DateTime.Now.AddDays(2);
+ break;
+ default:
+ break;
+ }
+
+ //date = Convert.ToDateTime(PreCompeteTimeDay);
+
+
+ var competeTime = date.Date.AddHours(hour);
+
+
+
+ if (competeTime now.AddDays(1).Date.AddHours(12))
+ {
+ MessageBox.Show($"预计完成时间不能超过明天12点,请重新选择预计完成时间");
+ return;
+ }
+
+
+ }
+ else if (now.Hour < 18)
+ {
+ if (competeTime > now.AddDays(1).Date.AddHours(18))
+ {
+ MessageBox.Show($"预计完成时间不能超过明天18点,请重新选择预计完成时间");
+ return;
+ }
+ }
+ else if (now.Hour < 22)
+ {
+ if (competeTime > now.AddDays(1).Date.AddHours(22))
+ {
+ MessageBox.Show($"预计完成时间不能超过明天22点,请重新选择预计完成时间");
+ return;
+ }
+ }
+ else
+ {
+ if (competeTime > now.AddDays(2).Date.AddHours(12))
+ {
+ MessageBox.Show($"预计完成时间不能超过后天12点,请重新选择预计完成时间");
+ return;
+ }
+ }
+
+
+
+
+
+ request.PreCompeteTime = competeTime;
var competeRes = packPurchaseTaskService.CompeteQualityTask(request);
@@ -487,7 +575,7 @@ namespace BBWY.Client.ViewModels
catch
{
-
+
}
@@ -606,6 +694,7 @@ namespace BBWY.Client.ViewModels
///
public void SearchSku(PackTaskModel model)
{
+
InitData();
TaskId = model.TaskId;
OrderId = model.OrderId;
@@ -688,7 +777,7 @@ namespace BBWY.Client.ViewModels
IsNeedCer = item.IsNeedCer,
PurchaseSkuId = item.PurchaseSkuId,
CerDTO = item.CerDTO,
- IsSetCertificate = item.IsSetCertificate,
+ IsSetCertificate = item.IsNeedCer,
});
}));
//PurchaseSkuList.Add(item);
@@ -706,17 +795,61 @@ namespace BBWY.Client.ViewModels
public Action ReflashWindow { get; set; }
public void InitData()
{
+ FloorDragNumber = 0;
PurchaseSkuList = new ObservableCollection();
WareHourseList = new ObservableCollection();
PreCompeteTimeDayList = new ObservableCollection();
+ FloorDragNumberList = new ObservableCollection();
- var date = DateTime.Now.Date;
- for (int i = 0; i < 7; i++)
+ for (int i = 0; i < 30; i++)
{
- PreCompeteTimeDayList.Add(date.AddDays(i).ToString("yyyy-MM-dd"));
+ App.Current.Dispatcher.Invoke((Action)(() =>
+ {
+
+ FloorDragNumberList.Add(i + 1);
+ }));
+
}
- PreCompeteTimeDay = date.ToString("yyyy-MM-dd");
+ var nowTime = DateTime.Now;
+ var hour = nowTime.Hour;
+
+
+
+ if (hour<12)
+ {
+ PreCompeteTimeDayList.Add("今天");
+ PreCompeteTimeDayList.Add("明天");
+
+ PreCompeteTimeDay = "今天";
+ PreCompeteTimeHour = "12点前";
+
+ }
+ else if (hour<18)
+ {
+ PreCompeteTimeDayList.Add("今天");
+ PreCompeteTimeDayList.Add("明天");
+ PreCompeteTimeDay = "今天";
+ PreCompeteTimeHour = "18点前";
+ }
+ else if (hour < 22)
+ {
+ PreCompeteTimeDayList.Add("今天");
+ PreCompeteTimeDayList.Add("明天");
+ PreCompeteTimeHour = "22点前";
+ }
+ else
+ {
+ PreCompeteTimeDayList.Add("今天");
+ PreCompeteTimeDayList.Add("明天");
+ PreCompeteTimeDayList.Add("后天");
+ PreCompeteTimeDay = "明天";
+ PreCompeteTimeHour = "12点前";
+ }
+
+
+
+
IsSetBarCode = true;
SkuTitle = "";
@@ -724,11 +857,7 @@ namespace BBWY.Client.ViewModels
GoodsNumber = 0;
PackType = PackType.单件;
BasicPack = BasicPack.快递袋;
- // Availability = (TaskState.)config.Availability;
- //MarkMessage = config.MarkMessage;
CertificatePosition = CertificatePosition.无;
- // Increment1 = config.Increment1;
-
IsNeedBarCode = Need.需要;
IsNeedCertificateModel = Need.不需要;
}
diff --git a/BBWY.Client/Views/QualityTask/QualityWindow.xaml b/BBWY.Client/Views/QualityTask/QualityWindow.xaml
index bbaff2f1..a307c095 100644
--- a/BBWY.Client/Views/QualityTask/QualityWindow.xaml
+++ b/BBWY.Client/Views/QualityTask/QualityWindow.xaml
@@ -112,7 +112,7 @@
-
+
@@ -136,7 +136,7 @@
-
+
@@ -149,7 +149,14 @@
+
+
+
+
+
+
+
@@ -268,7 +275,7 @@
Date: Mon, 5 Jun 2023 14:25:19 +0800
Subject: [PATCH 03/17] 10119
---
BBWY.Client/GlobalContext.cs | 2 +-
.../ViewModels/QualityTask/QualityViewModel.cs | 12 ------------
2 files changed, 1 insertion(+), 13 deletions(-)
diff --git a/BBWY.Client/GlobalContext.cs b/BBWY.Client/GlobalContext.cs
index 841e1f52..ccba4dc7 100644
--- a/BBWY.Client/GlobalContext.cs
+++ b/BBWY.Client/GlobalContext.cs
@@ -9,7 +9,7 @@ namespace BBWY.Client
{
ShopServiceGroupList = new List();
ShopServiceGroupLowerList = new List();
- ClientVersion = "10118";
+ ClientVersion = "10119";
}
private User user;
diff --git a/BBWY.Client/ViewModels/QualityTask/QualityViewModel.cs b/BBWY.Client/ViewModels/QualityTask/QualityViewModel.cs
index 5f484d09..506ce3c0 100644
--- a/BBWY.Client/ViewModels/QualityTask/QualityViewModel.cs
+++ b/BBWY.Client/ViewModels/QualityTask/QualityViewModel.cs
@@ -568,18 +568,6 @@ namespace BBWY.Client.ViewModels
, BarCodeModel);
batchPrint.ShowDialog();
- try
- {
-
- }
- catch
- {
-
-
- }
-
-
-
if (ReflashWindow != null) ReflashWindow();
var window = obj as BWindow;
From 0a3cf183a93e5b776dacb5d7d3a900ba421ab577 Mon Sep 17 00:00:00 2001
From: "506583276@qq.com" <506583276@qq.com>
Date: Mon, 5 Jun 2023 19:53:16 +0800
Subject: [PATCH 04/17] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=9C=B0=E6=89=98?=
=?UTF-8?q?=E6=89=93=E5=8D=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../PackTask/SearchTaskListResponse.cs | 4 ++
BBWY.Client/Models/PackTask/PackTaskModel.cs | 6 +-
.../PackTask/PackServiceViewModel.cs | 3 +
.../PackTask/WareHouseListViewModel.cs | 8 ++-
BBWY.Client/Views/PackTask/ServiceWindow.xaml | 5 +-
.../Views/PackTask/WareHouseListControl.xaml | 58 ++++++++++---------
6 files changed, 50 insertions(+), 34 deletions(-)
diff --git a/BBWY.Client/Models/APIModel/Response/PackTask/SearchTaskListResponse.cs b/BBWY.Client/Models/APIModel/Response/PackTask/SearchTaskListResponse.cs
index adaa3bc9..a7897d6f 100644
--- a/BBWY.Client/Models/APIModel/Response/PackTask/SearchTaskListResponse.cs
+++ b/BBWY.Client/Models/APIModel/Response/PackTask/SearchTaskListResponse.cs
@@ -165,5 +165,9 @@ namespace BBWY.Client.Models.APIModel
///分箱情况
///
public WareHourseDTO[] WareHourses { get; set; }
+ ///
+ /// 地托编号
+ ///
+ public int? FloorDragNumber { get; set; }
}
}
diff --git a/BBWY.Client/Models/PackTask/PackTaskModel.cs b/BBWY.Client/Models/PackTask/PackTaskModel.cs
index 97fb48ed..ce5db38a 100644
--- a/BBWY.Client/Models/PackTask/PackTaskModel.cs
+++ b/BBWY.Client/Models/PackTask/PackTaskModel.cs
@@ -124,7 +124,7 @@ namespace BBWY.Client.Models
serviceViewModel.PackTaskModel = this;
serviceViewModel.PackTaskList = new System.Collections.ObjectModel.ObservableCollection { this};
-
+ serviceViewModel.FloorDragNumber = this.FloorDragNumber;
serviceViewModel.TaskCount = SkuCount;
serviceViewModel.TaskId = TaskId;
serviceViewModel.OrderId= OrderId;
@@ -512,6 +512,8 @@ namespace BBWY.Client.Models
public IList ItemList { get; set; }
public string OrderId { get; set; }
+ private int? floorDragNumber;
+ public int? FloorDragNumber { get => floorDragNumber; set { Set(ref floorDragNumber, value); } }
}
public class SkuMessage : NotifyObject
@@ -565,5 +567,7 @@ namespace BBWY.Client.Models
/// 货号
///
public string GoodsNo { get => goodsNo; set { Set(ref goodsNo, value); } }
+
+
}
}
diff --git a/BBWY.Client/ViewModels/PackTask/PackServiceViewModel.cs b/BBWY.Client/ViewModels/PackTask/PackServiceViewModel.cs
index 0248f8d8..8f79d6a5 100644
--- a/BBWY.Client/ViewModels/PackTask/PackServiceViewModel.cs
+++ b/BBWY.Client/ViewModels/PackTask/PackServiceViewModel.cs
@@ -35,6 +35,9 @@ namespace BBWY.Client.ViewModels.PackTask
public class PackServiceViewModel : BaseVM, IDenpendency
{
+ private int? floorDragNumber;
+ public int? FloorDragNumber { get => floorDragNumber; set { Set(ref floorDragNumber, value); } }
+
private string packUserName;
///
/// 打包人
diff --git a/BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs b/BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs
index 14cc413c..722fc381 100644
--- a/BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs
+++ b/BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs
@@ -360,7 +360,10 @@ namespace BBWY.Client.ViewModels.PackTask
System.Windows.MessageBox.Show("请先设置打包费用!");
return;
}
-
+ if (System.Windows.MessageBox.Show("是否完成打包?", "提示",
+ MessageBoxButton.YesNo,
+ MessageBoxImage.Warning) != MessageBoxResult.Yes)
+ return;
res = packTaskService.SetPackTaskState(taskId, PackTaskState.待封箱);
break;
case PackTaskState.待封箱:
@@ -499,7 +502,6 @@ namespace BBWY.Client.ViewModels.PackTask
});
else
-
Task.Factory.StartNew(() =>
{
PackTaskList = new ObservableCollection();//初始化数据
@@ -540,6 +542,8 @@ namespace BBWY.Client.ViewModels.PackTask
OrderId = item.OrderId,
SkuId = item.SkuId,
SkuName = item.SkuName,
+ FloorDragNumber=item.FloorDragNumber,
+
};
if (item.BarCodeDTO != null && item.BarCodeDTO.Id > 0)
diff --git a/BBWY.Client/Views/PackTask/ServiceWindow.xaml b/BBWY.Client/Views/PackTask/ServiceWindow.xaml
index d036a2c1..7c00f11e 100644
--- a/BBWY.Client/Views/PackTask/ServiceWindow.xaml
+++ b/BBWY.Client/Views/PackTask/ServiceWindow.xaml
@@ -415,9 +415,6 @@
-
-
-
@@ -429,6 +426,8 @@
+
+
diff --git a/BBWY.Client/Views/PackTask/WareHouseListControl.xaml b/BBWY.Client/Views/PackTask/WareHouseListControl.xaml
index 8523915c..18dbd7a9 100644
--- a/BBWY.Client/Views/PackTask/WareHouseListControl.xaml
+++ b/BBWY.Client/Views/PackTask/WareHouseListControl.xaml
@@ -60,19 +60,20 @@
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
@@ -150,7 +151,7 @@
@@ -356,10 +357,11 @@
+
-
+
@@ -385,7 +387,7 @@
-
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
From bef322120c2c51ed43840f694e5091eee687e204 Mon Sep 17 00:00:00 2001
From: "506583276@qq.com" <506583276@qq.com>
Date: Mon, 5 Jun 2023 19:57:40 +0800
Subject: [PATCH 05/17] 10120
---
BBWY.Client/GlobalContext.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/BBWY.Client/GlobalContext.cs b/BBWY.Client/GlobalContext.cs
index ccba4dc7..2c8e5a47 100644
--- a/BBWY.Client/GlobalContext.cs
+++ b/BBWY.Client/GlobalContext.cs
@@ -9,7 +9,7 @@ namespace BBWY.Client
{
ShopServiceGroupList = new List();
ShopServiceGroupLowerList = new List();
- ClientVersion = "10119";
+ ClientVersion = "10120";
}
private User user;
From a2b539607f46a48d5b984b39ecc924d0f06c0a62 Mon Sep 17 00:00:00 2001
From: "506583276@qq.com" <506583276@qq.com>
Date: Mon, 5 Jun 2023 20:39:21 +0800
Subject: [PATCH 06/17] 10121
---
BBWY.Client/GlobalContext.cs | 2 +-
.../ViewModels/QualityTask/QualityViewModel.cs | 15 +++++++++------
2 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/BBWY.Client/GlobalContext.cs b/BBWY.Client/GlobalContext.cs
index 2c8e5a47..70ffd36f 100644
--- a/BBWY.Client/GlobalContext.cs
+++ b/BBWY.Client/GlobalContext.cs
@@ -9,7 +9,7 @@ namespace BBWY.Client
{
ShopServiceGroupList = new List();
ShopServiceGroupLowerList = new List();
- ClientVersion = "10120";
+ ClientVersion = "10121";
}
private User user;
diff --git a/BBWY.Client/ViewModels/QualityTask/QualityViewModel.cs b/BBWY.Client/ViewModels/QualityTask/QualityViewModel.cs
index 506ce3c0..d10dab7a 100644
--- a/BBWY.Client/ViewModels/QualityTask/QualityViewModel.cs
+++ b/BBWY.Client/ViewModels/QualityTask/QualityViewModel.cs
@@ -115,7 +115,7 @@ namespace BBWY.Client.ViewModels
private ObservableCollection preCompeteTimeHourList = new ObservableCollection {
- "12点前","18点前","21点前"
+ "12点前","18点前","22点前"
};
public ObservableCollection PreCompeteTimeHourList { get => preCompeteTimeHourList; set { Set(ref preCompeteTimeHourList, value); } }
@@ -445,7 +445,7 @@ namespace BBWY.Client.ViewModels
};
if (IsNeedBarCode == Need.需要)
{
- if (BarCodeModel.Id <= 0)
+ if (BarCodeModel==null|| BarCodeModel.Id <= 0)
{
MessageBox.Show("条形码不能为空");
return;
@@ -464,6 +464,12 @@ namespace BBWY.Client.ViewModels
MessageBox.Show("存在未确认的合格证,请先完成确认!");
return;
}
+
+ if (purchaseSkuList.Any(p => p.IsNeedCer && p.CerDTO == null))
+ {
+ MessageBox.Show("有未设置的合格证,请设置完所有的合格证再保存");
+ return;
+ }
if (PurchaseSkuList.Where(p => p.IsNeedCer && p.CerDTO.Id > 0).Count() <= 0)
{
MessageBox.Show("无可选的合格证打印!");
@@ -543,10 +549,6 @@ namespace BBWY.Client.ViewModels
}
}
-
-
-
-
request.PreCompeteTime = competeTime;
@@ -824,6 +826,7 @@ namespace BBWY.Client.ViewModels
{
PreCompeteTimeDayList.Add("今天");
PreCompeteTimeDayList.Add("明天");
+ PreCompeteTimeDay = "今天";
PreCompeteTimeHour = "22点前";
}
else
From 074504da80979854d0d16538e3ba07bba198b8da Mon Sep 17 00:00:00 2001
From: "506583276@qq.com" <506583276@qq.com>
Date: Mon, 5 Jun 2023 22:38:03 +0800
Subject: [PATCH 07/17] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=89=93=E5=8C=85?=
=?UTF-8?q?=E6=8E=A8=E8=8D=90=E4=BA=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
BBWY.Client/GlobalContext.cs | 2 +-
.../Response/PackTask/PackServiceResponse.cs | 5 +++
.../PackTask/PackServiceViewModel.cs | 33 ++++++++++++++-----
BBWY.Client/Views/PackTask/ServiceWindow.xaml | 19 +++++++----
4 files changed, 44 insertions(+), 15 deletions(-)
diff --git a/BBWY.Client/GlobalContext.cs b/BBWY.Client/GlobalContext.cs
index 70ffd36f..7cc3b287 100644
--- a/BBWY.Client/GlobalContext.cs
+++ b/BBWY.Client/GlobalContext.cs
@@ -9,7 +9,7 @@ namespace BBWY.Client
{
ShopServiceGroupList = new List();
ShopServiceGroupLowerList = new List();
- ClientVersion = "10121";
+ ClientVersion = "10122";
}
private User user;
diff --git a/BBWY.Client/Models/APIModel/Response/PackTask/PackServiceResponse.cs b/BBWY.Client/Models/APIModel/Response/PackTask/PackServiceResponse.cs
index 64f726e6..a2e87af8 100644
--- a/BBWY.Client/Models/APIModel/Response/PackTask/PackServiceResponse.cs
+++ b/BBWY.Client/Models/APIModel/Response/PackTask/PackServiceResponse.cs
@@ -57,6 +57,11 @@ namespace BBWY.Client.Models.APIModel.Response.PackTask
/// 增量配件数量
///
public int? IncrementPartCount { get; set; }
+
+ ///
+ /// 推荐打包人(skuid)
+ ///
+ public string SuggestPackUserName { get; set; }
}
public class PackServiceDTO
diff --git a/BBWY.Client/ViewModels/PackTask/PackServiceViewModel.cs b/BBWY.Client/ViewModels/PackTask/PackServiceViewModel.cs
index 8f79d6a5..a821ab98 100644
--- a/BBWY.Client/ViewModels/PackTask/PackServiceViewModel.cs
+++ b/BBWY.Client/ViewModels/PackTask/PackServiceViewModel.cs
@@ -35,6 +35,14 @@ namespace BBWY.Client.ViewModels.PackTask
public class PackServiceViewModel : BaseVM, IDenpendency
{
+
+
+ private string suggestPackUserName;
+ ///
+ /// 打包人
+ ///
+ public string SuggestPackUserName { get => suggestPackUserName; set { Set(ref suggestPackUserName, value); } }
+
private int? floorDragNumber;
public int? FloorDragNumber { get => floorDragNumber; set { Set(ref floorDragNumber, value); } }
@@ -182,9 +190,6 @@ namespace BBWY.Client.ViewModels.PackTask
public void InitPrintList()
{
-
-
-
TaskImage = MyPrintHelper.GetBarcodeImage(TaskId.ToString(), 300, 60);
BarcodeImage = MyPrintHelper.GetBarcodeImage(SkuId, 300, 60);
@@ -290,6 +295,7 @@ namespace BBWY.Client.ViewModels.PackTask
if (res.Success)
{
+ SuggestPackUserName = res.Data.SuggestPackUserName;
IncrementPartCount = res.Data.IncrementPartCount == null ? 0 : res.Data.IncrementPartCount.Value;
if (res.Data != null && res.Data.IncrementItemList.Count() > 0)
@@ -319,7 +325,7 @@ namespace BBWY.Client.ViewModels.PackTask
BasicPackServiceList.Add(packService);
if (packService.Name != "贴条码")
PackServiceList.Add(packService);//加载工序服务列表
-
+
});
}
}
@@ -589,8 +595,8 @@ namespace BBWY.Client.ViewModels.PackTask
if (disIncrementProcessList == null) return;
- if (disBasicPackProcessList.Select(d=>d.ItemName).Distinct().Count()==1&& disBasicPackProcessList.Select(d => d.ItemName).Contains("贴条码")
- && disIncrementProcessList.Count>0)
+ if (disBasicPackProcessList.Select(d => d.ItemName).Distinct().Count() == 1 && disBasicPackProcessList.Select(d => d.ItemName).Contains("贴条码")
+ && disIncrementProcessList.Count > 0)
{
System.Windows.MessageBox.Show("只有一道贴码工序,无法添加增值包装工序");
return;
@@ -609,14 +615,25 @@ namespace BBWY.Client.ViewModels.PackTask
packTaskDetail.ConsumableList = disConsumableServiceList;
var res = packDetailService.SetPackTaskDetail(packTaskDetail);
- if (res != null && res.Success)
+
+ if (res==null)
+ {
+ System.Windows.MessageBox.Show("网络异常!");
+ return;
+ }
+ if (!res.Success)
{
+ System.Windows.MessageBox.Show(res.Msg);
+ return;
+ }
+
+
// new TipsWindow("上传成功!").Show();
var win = obj as System.Windows.Window;
if (SetAllFees != null)
SetAllFees();
win.Close();
- }
+
}
///
/// 更新 打包员 和费用数据
diff --git a/BBWY.Client/Views/PackTask/ServiceWindow.xaml b/BBWY.Client/Views/PackTask/ServiceWindow.xaml
index 7c00f11e..d288ce9d 100644
--- a/BBWY.Client/Views/PackTask/ServiceWindow.xaml
+++ b/BBWY.Client/Views/PackTask/ServiceWindow.xaml
@@ -70,19 +70,26 @@
-
+
-
-
-
+
+
+
+
+
+
+
+
+
+
-
+
-
+
From bf7aad5ab33cee841bc5557d541f047877bde37f Mon Sep 17 00:00:00 2001
From: "506583276@qq.com" <506583276@qq.com>
Date: Fri, 9 Jun 2023 16:59:27 +0800
Subject: [PATCH 08/17] 1
---
BBWY.Client/ViewModels/QualityTask/QualityViewModel.cs | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/BBWY.Client/ViewModels/QualityTask/QualityViewModel.cs b/BBWY.Client/ViewModels/QualityTask/QualityViewModel.cs
index d10dab7a..f645f141 100644
--- a/BBWY.Client/ViewModels/QualityTask/QualityViewModel.cs
+++ b/BBWY.Client/ViewModels/QualityTask/QualityViewModel.cs
@@ -756,14 +756,16 @@ namespace BBWY.Client.ViewModels
{
PurchaseSkuList.Add(item); continue;
}
-
- var skuItem = list.Data.ItemList.FirstOrDefault(f => f.PurchaseSkuId == item.PurchaseSkuId);
+ PurchaseSkuItemBasicInfoResponse skuItem = null;
+ if (list.Data != null) skuItem = list.Data.ItemList.FirstOrDefault(f => f.PurchaseSkuId == item.PurchaseSkuId);
+
+
App.Current.Dispatcher.Invoke(new Action(() =>
{
PurchaseSkuList.Add(new PurchaseSku
{
- Logo = skuItem.Logo,
- Title = skuItem.Title,
+ Logo = skuItem?.Logo,
+ Title = skuItem?.Title,
IsNeedCer = item.IsNeedCer,
PurchaseSkuId = item.PurchaseSkuId,
CerDTO = item.CerDTO,
From 4dc5d5ecb1837ba03a97f7271adeb2604b5b86db Mon Sep 17 00:00:00 2001
From: "506583276@qq.com" <506583276@qq.com>
Date: Fri, 9 Jun 2023 19:00:33 +0800
Subject: [PATCH 09/17] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=AE=BE=E7=BD=AE?=
=?UTF-8?q?=E9=BB=98=E8=AE=A4=E6=89=93=E5=8D=B0=E6=9C=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
BBWY.Client/GlobalContext.cs | 2 +-
BBWY.Client/Helpers/MyPrintHelper.cs | 15 +++
BBWY.Client/Models/PackTask/PackTaskModel.cs | 11 +-
.../QualityTask/QualityViewModel.cs | 53 ++++++----
.../Views/PackTask/ServiceWindow.xaml.cs | 100 +-----------------
5 files changed, 64 insertions(+), 117 deletions(-)
diff --git a/BBWY.Client/GlobalContext.cs b/BBWY.Client/GlobalContext.cs
index 7cc3b287..6d76bbda 100644
--- a/BBWY.Client/GlobalContext.cs
+++ b/BBWY.Client/GlobalContext.cs
@@ -9,7 +9,7 @@ namespace BBWY.Client
{
ShopServiceGroupList = new List();
ShopServiceGroupLowerList = new List();
- ClientVersion = "10122";
+ ClientVersion = "10123";
}
private User user;
diff --git a/BBWY.Client/Helpers/MyPrintHelper.cs b/BBWY.Client/Helpers/MyPrintHelper.cs
index 12515e17..6296a880 100644
--- a/BBWY.Client/Helpers/MyPrintHelper.cs
+++ b/BBWY.Client/Helpers/MyPrintHelper.cs
@@ -9,6 +9,7 @@ using System.Drawing.Printing;
using System.IO;
using System.Linq;
using System.Reflection;
+using System.Runtime.InteropServices;
using System.Text;
using System.Windows.Media.Imaging;
using WebSocketSharp;
@@ -618,5 +619,19 @@ namespace BBWY.Client.Helpers
}
}
+
+ public static void SetDefaultPrint(string printName)
+ {
+ SetDefaultPrinter(printName);
+ }
+
+ ///
+ /// 调用win api将指定名称的打印机设置为默认打印机
+ ///
+ ///
+ ///
+ [DllImport("winspool.drv")]
+ public static extern bool SetDefaultPrinter(string Name);
+
}
}
diff --git a/BBWY.Client/Models/PackTask/PackTaskModel.cs b/BBWY.Client/Models/PackTask/PackTaskModel.cs
index ce5db38a..252775e4 100644
--- a/BBWY.Client/Models/PackTask/PackTaskModel.cs
+++ b/BBWY.Client/Models/PackTask/PackTaskModel.cs
@@ -103,7 +103,16 @@ namespace BBWY.Client.Models
// qualityViewModel.TaskId = TaskId;
qualityViewModel.OrderId = OrderId;
qualityViewModel.SkuId = SkuId;
- qualityViewModel.SearchSku(this);
+ try
+ {
+ qualityViewModel.SearchSku(this);
+ }
+ catch (Exception ex)
+ {
+ System.Windows.MessageBox.Show(ex.Message);
+
+ }
+
//qualityViewModel.LoadPackDatas();
//qualityViewModel.SetAllFees = new Action>((feesItem, packUsers) =>
//{
diff --git a/BBWY.Client/ViewModels/QualityTask/QualityViewModel.cs b/BBWY.Client/ViewModels/QualityTask/QualityViewModel.cs
index f645f141..452efd6a 100644
--- a/BBWY.Client/ViewModels/QualityTask/QualityViewModel.cs
+++ b/BBWY.Client/ViewModels/QualityTask/QualityViewModel.cs
@@ -552,28 +552,43 @@ namespace BBWY.Client.ViewModels
request.PreCompeteTime = competeTime;
- var competeRes = packPurchaseTaskService.CompeteQualityTask(request);
- if (competeRes == null)
- {
- MessageBox.Show("网络异常");
- return;
- }
- if (!competeRes.Success)
- {
- MessageBox.Show(competeRes.Msg);
- return;
- }
- BatchPrintWindow batchPrint = new BatchPrintWindow();
+ try
+ {
+ var competeRes = packPurchaseTaskService.CompeteQualityTask(request);
+ if (competeRes == null)
+ {
+ MessageBox.Show("网络异常");
+ return;
+ }
+ if (!competeRes.Success)
+ {
+ MessageBox.Show(competeRes.Msg);
+ return;
+ }
+ BatchPrintWindow batchPrint = new BatchPrintWindow();
+
+ batchPrint.SetData(GoodProductQuantity,
+ PurchaseSkuList.Where(p => p.IsNeedCer && p.CerDTO.Id > 0).Select(p => p.CerDTO).ToArray()
+ , BarCodeModel);
+ batchPrint.ShowDialog();
+
+ if (ReflashWindow != null) ReflashWindow();
+ var window = obj as BWindow;
+ App.Current.Dispatcher.Invoke(new Action(() => {
- batchPrint.SetData(GoodProductQuantity,
- PurchaseSkuList.Where(p => p.IsNeedCer && p.CerDTO.Id > 0).Select(p => p.CerDTO).ToArray()
- , BarCodeModel);
- batchPrint.ShowDialog();
+ window.Close();
+ }));
+
+ }
+ catch (Exception ex)
+ {
+
+ System.Windows.MessageBox.Show(ex.Message);
+ }
+
- if (ReflashWindow != null) ReflashWindow();
- var window = obj as BWindow;
- window.Close();
+
}
diff --git a/BBWY.Client/Views/PackTask/ServiceWindow.xaml.cs b/BBWY.Client/Views/PackTask/ServiceWindow.xaml.cs
index cd1668ac..f51f2957 100644
--- a/BBWY.Client/Views/PackTask/ServiceWindow.xaml.cs
+++ b/BBWY.Client/Views/PackTask/ServiceWindow.xaml.cs
@@ -1,5 +1,6 @@
using BarcodeLib;
using BBWY.Client.APIServices;
+using BBWY.Client.Helpers;
using BBWY.Client.ViewModels;
using BBWY.Client.ViewModels.PackTask;
using BBWY.Controls;
@@ -50,9 +51,8 @@ namespace BBWY.Client.Views.PackTask
MessageBox.Show("打印机处于错误状态");
return;
}
- //Print(this.printArea, cbPrintName.Text, "打印任务",1);
-
-
+
+ MyPrintHelper.SetDefaultPrint(printName);//设置默认打印机
this.printArea.Arrange(new Rect(new Point(0, 0), new Size(printArea.ActualWidth, printArea.ActualHeight)));
PrintDialog printDialog = new PrintDialog();
@@ -76,99 +76,7 @@ namespace BBWY.Client.Views.PackTask
- ///
- /// 打印
- ///
- /// 流文档
- /// 打印机名称
- /// 打印描述
- /// 打印个数
- public static void Print(Visual document, string printer, string description, int copyCount)
- {
- var localPrintServer = new LocalPrintServer();
- var printQueue = localPrintServer.GetPrintQueue(printer);
- if (printQueue.IsInError)
- {
- throw new Exception("打印机处于错误状态");
- }
-
- var printDialog = new PrintDialog
- {
- PrintQueue = printQueue, //打印队列
- PrintTicket = { CopyCount = copyCount } //打印个数
- };
-
- //设置纸张大小
- var pageWidth = (int)Math.Ceiling(printDialog.PrintableAreaWidth); //小标签:114
- var pageHeight = (int)Math.Ceiling(printDialog.PrintableAreaHeight); //小标签:227
- printDialog.PrintTicket.PageMediaSize = new PageMediaSize(pageWidth, pageHeight);
-
- //设置纸张边距
- var paperSize = GetPaperSize(printer); //小标签:118*246
- //var offsetX = (int)Math.Ceiling((paperSize.Width - pageWidth) / 2f);
- //var offsetY = (int)Math.Ceiling((paperSize.Height - pageHeight) / 2f);
- //document.PagePadding = new Thickness(offsetX, offsetY, offsetX, offsetY);
-
- //打印
- var paginator = ((IDocumentPaginatorSource)document).DocumentPaginator;
- printDialog.PrintDocument(paginator, description);
-
- var applicationPath = System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
- string printNames = System.IO.Path.Combine(applicationPath, "printName.init");
- File.WriteAllText(printNames, printer);
-
- }
-
- private static object GetPaperSize(string printer)
- {
- return null;
- }
-
- public interface IDocumentRenderer
- {
- void Render(FlowDocument doc, object data);
- }
-
- public class CommonDocumentRenderer : IDocumentRenderer
- {
- public void Render(FlowDocument doc, object data)
- {
- var model = data as PrintModel;
- if (model == null)
- {
- throw new ArgumentException("data is not PrintModel");
- }
-
- var type = typeof(PrintModel);
- var properties = type.GetProperties();
- foreach (var property in properties)
- {
- //文本赋值
- if (doc.FindName(property.Name) is TextBlock textBlock)
- {
- textBlock.Text = property.GetValue(model)?.ToString();
- }
- }
- }
- }
-
- public class PrintModel
- {
- ///
- /// 批号
- ///
- public string BatchNumber { get; set; }
-
- ///
- /// 订单号
- ///
- public string OrderNumber { get; set; }
-
- ///
- /// 物料代码
- ///
- public string MaterialNumber { get; set; }
- }
+
}
}
From 92f52e7fcd09c705f5b11ab1030c73d85c8ea3fe Mon Sep 17 00:00:00 2001
From: "506583276@qq.com" <506583276@qq.com>
Date: Sun, 11 Jun 2023 14:20:48 +0800
Subject: [PATCH 10/17] 1
---
BBWY.Client/Models/APIModel/Request/CerRequest.cs | 5 ++++-
BBWY.Client/Models/Enums.cs | 15 +++++++++++++++
2 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/BBWY.Client/Models/APIModel/Request/CerRequest.cs b/BBWY.Client/Models/APIModel/Request/CerRequest.cs
index 194e8bee..cc221097 100644
--- a/BBWY.Client/Models/APIModel/Request/CerRequest.cs
+++ b/BBWY.Client/Models/APIModel/Request/CerRequest.cs
@@ -68,11 +68,14 @@ namespace BBWY.Client.Models.APIModel.Request
///
public string ApplyAge { get; set; }
- public int GoodsNumber { get; set; }
+ public long GoodsNumber { get; set; }
public string ProduceDate { get; set; }
public string PurchaseSkuId { get; set; }
+
+ public SaveType? SaveType { get; set; }
+
}
}
diff --git a/BBWY.Client/Models/Enums.cs b/BBWY.Client/Models/Enums.cs
index b0da91f3..c79f546c 100644
--- a/BBWY.Client/Models/Enums.cs
+++ b/BBWY.Client/Models/Enums.cs
@@ -452,4 +452,19 @@
{
增值服务工序 = 0, 基础包装工序 = 1/*,其他=2//基础包装 增量配件*/
}
+
+ ///
+ /// 打包配置存放区分
+ ///
+ public enum SaveType
+ {
+ ///
+ /// c端
+ ///
+ C端 = 0,
+ ///
+ /// B端
+ ///
+ B端 = 1
+ }
}
From 61072fa45bf43d3325c41225349b84099a42d176 Mon Sep 17 00:00:00 2001
From: "506583276@qq.com" <506583276@qq.com>
Date: Sun, 11 Jun 2023 16:19:08 +0800
Subject: [PATCH 11/17] 1
---
BBWY.Client/Models/PackTask/CertificateModel.cs | 16 +++++++++++-----
.../ViewModels/QualityTask/QualityViewModel.cs | 6 ++++--
BBWY.Client/Views/PackTask/LookCerWindow.xaml | 2 +-
BBWY.Client/Views/PackTask/LookCerWindow.xaml.cs | 8 ++++++++
BBWY.Client/Views/PackTask/SetCerWindow.xaml.cs | 2 +-
BBWY.Client/Views/QualityTask/QualityWindow.xaml | 6 +++---
6 files changed, 28 insertions(+), 12 deletions(-)
diff --git a/BBWY.Client/Models/PackTask/CertificateModel.cs b/BBWY.Client/Models/PackTask/CertificateModel.cs
index 437d9a1a..91c03978 100644
--- a/BBWY.Client/Models/PackTask/CertificateModel.cs
+++ b/BBWY.Client/Models/PackTask/CertificateModel.cs
@@ -12,9 +12,6 @@ namespace BBWY.Client.Models
/// 合格证id
///
public long Id { get; set; }
-
-
-
///
/// skuid
///
@@ -142,11 +139,20 @@ namespace BBWY.Client.Models
- private int goodsNumber = 1;
+ private long goodsNumber = 1;
+ ///
+ /// 配件序号
+ ///
+ public long GoodsNumber { get => goodsNumber; set { Set(ref goodsNumber, value); } }
+
+
+
+ private int goodsNumberIndex = 1;
///
/// 配件序号
///
- public int GoodsNumber { get => goodsNumber; set { Set(ref goodsNumber, value); } }
+ public int GoodsNumberIndex { get => goodsNumberIndex; set { Set(ref goodsNumberIndex, value); } }
+
private string produceDate;
///
diff --git a/BBWY.Client/ViewModels/QualityTask/QualityViewModel.cs b/BBWY.Client/ViewModels/QualityTask/QualityViewModel.cs
index f645f141..e91ac724 100644
--- a/BBWY.Client/ViewModels/QualityTask/QualityViewModel.cs
+++ b/BBWY.Client/ViewModels/QualityTask/QualityViewModel.cs
@@ -731,7 +731,7 @@ namespace BBWY.Client.ViewModels
if (packTaskRes == null || !packTaskRes.Success) return;
BarCodeModel = packTaskRes.Data.BarCodeDTO;
IsNeedBarCode = packTaskRes.Data.IsNeedBar ? Need.需要 : Need.不需要;
- IsSetBarCode = packTaskRes.Data.IsNeedBar ? false : true;
+ IsSetBarCode = packTaskRes.Data.BarCodeDTO==null ? true:false;
IsNeedCertificateModel = packTaskRes.Data.IsNeedCer ? Need.需要 : Need.不需要;
if (packTaskRes.Data.WareHourses != null)
packTaskRes.Data.WareHourses.ToList().ForEach(w =>
@@ -742,9 +742,11 @@ namespace BBWY.Client.ViewModels
if (packTaskRes.Data.PurchaseSkus != null)
{
-
+ int goodsIndex = 0;
foreach (var item in packTaskRes.Data.PurchaseSkus)
{
+ goodsIndex++;
+ if (item.CerDTO != null) item.CerDTO.GoodsNumberIndex = goodsIndex;
item.IsSetCertificate = true;
if (string.IsNullOrEmpty(item.PurchaseProductId))
{
diff --git a/BBWY.Client/Views/PackTask/LookCerWindow.xaml b/BBWY.Client/Views/PackTask/LookCerWindow.xaml
index d7893ee0..d6d90724 100644
--- a/BBWY.Client/Views/PackTask/LookCerWindow.xaml
+++ b/BBWY.Client/Views/PackTask/LookCerWindow.xaml
@@ -44,7 +44,7 @@
-
+
diff --git a/BBWY.Client/Views/PackTask/LookCerWindow.xaml.cs b/BBWY.Client/Views/PackTask/LookCerWindow.xaml.cs
index f5ff0e73..37631eae 100644
--- a/BBWY.Client/Views/PackTask/LookCerWindow.xaml.cs
+++ b/BBWY.Client/Views/PackTask/LookCerWindow.xaml.cs
@@ -29,11 +29,19 @@ namespace BBWY.Client.Views.PackTask
InitializeComponent();
GoodsNumberCerList = new ObservableCollection();
+ int goodsNumberIndex = 0;
foreach (CertificateModel certificateModel in certificate)
+ {
+ goodsNumberIndex++;
+ certificateModel.GoodsNumberIndex = goodsNumberIndex;
GoodsNumberCerList.Add(new GoodsNumberCer
{
CertificateModel = certificateModel.Copy(),
+
+
});
+ }
+
this.DataContext = this;
}
diff --git a/BBWY.Client/Views/PackTask/SetCerWindow.xaml.cs b/BBWY.Client/Views/PackTask/SetCerWindow.xaml.cs
index 55073097..fb46342b 100644
--- a/BBWY.Client/Views/PackTask/SetCerWindow.xaml.cs
+++ b/BBWY.Client/Views/PackTask/SetCerWindow.xaml.cs
@@ -139,7 +139,7 @@ namespace BBWY.Client.Views.PackTask
setSpuCerWindow.Show();
}
- int selectCer = -1;//tabcontrol 选中事件
+ long selectCer = -1;//tabcontrol 选中事件
private void InseartCer_Click(object sender, RoutedEventArgs e)
{
if (IsSetSpuCertificate)
diff --git a/BBWY.Client/Views/QualityTask/QualityWindow.xaml b/BBWY.Client/Views/QualityTask/QualityWindow.xaml
index a307c095..4136005c 100644
--- a/BBWY.Client/Views/QualityTask/QualityWindow.xaml
+++ b/BBWY.Client/Views/QualityTask/QualityWindow.xaml
@@ -212,7 +212,7 @@
ItemContainerStyle="{StaticResource NoBgListBoxItemStyle}"
ItemsSource="{Binding PurchaseSkuList,Mode=TwoWay}"
BorderBrush="{StaticResource Border.Brush}"
- BorderThickness="0" Visibility="{Binding OrderId,Mode=TwoWay,Converter={StaticResource objConverter},ConverterParameter=#null:Collapsed:Visible}"
+ BorderThickness="0" Visibility="{Binding SkuPurchaseSchemeId,Mode=TwoWay,Converter={StaticResource objConverter},ConverterParameter=#null:Collapsed:Visible}"
Foreground="{StaticResource Text.Color}">
@@ -316,7 +316,7 @@
ItemContainerStyle="{StaticResource NoBgListBoxItemStyle}"
ItemsSource="{Binding PurchaseSkuList,Mode=TwoWay}"
BorderBrush="{StaticResource Border.Brush}"
- BorderThickness="0" Visibility="{Binding OrderId,Mode=TwoWay,Converter={StaticResource objConverter},ConverterParameter=#null:Visible:Collapsed}"
+ BorderThickness="0" Visibility="{Binding SkuPurchaseSchemeId,Mode=TwoWay,Converter={StaticResource objConverter},ConverterParameter=#null:Visible:Collapsed}"
Foreground="{StaticResource Text.Color}">
@@ -331,7 +331,7 @@
-
+
From 88541d6e4eed9f1172959d1b4e4caac0f474b6bb Mon Sep 17 00:00:00 2001
From: "506583276@qq.com" <506583276@qq.com>
Date: Sun, 11 Jun 2023 17:07:14 +0800
Subject: [PATCH 12/17] =?UTF-8?q?=E8=B4=A8=E6=A3=80=E5=8C=BA=E5=88=86B?=
=?UTF-8?q?=E7=AB=AFC=E7=AB=AF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
BBWY.Client/GlobalContext.cs | 2 +-
.../PackPurchaseTask/QualityTaskResponse.cs | 6 ++++++
.../ViewModels/QualityTask/QualityViewModel.cs | 17 ++++++++++++-----
.../QualityTask/QualitySetCerWindow.xaml.cs | 5 ++++-
4 files changed, 23 insertions(+), 7 deletions(-)
diff --git a/BBWY.Client/GlobalContext.cs b/BBWY.Client/GlobalContext.cs
index 6d76bbda..cbe0b1f3 100644
--- a/BBWY.Client/GlobalContext.cs
+++ b/BBWY.Client/GlobalContext.cs
@@ -9,7 +9,7 @@ namespace BBWY.Client
{
ShopServiceGroupList = new List();
ShopServiceGroupLowerList = new List();
- ClientVersion = "10123";
+ ClientVersion = "10124";
}
private User user;
diff --git a/BBWY.Client/Models/APIModel/Response/PackPurchaseTask/QualityTaskResponse.cs b/BBWY.Client/Models/APIModel/Response/PackPurchaseTask/QualityTaskResponse.cs
index f8f767c6..1a7c7571 100644
--- a/BBWY.Client/Models/APIModel/Response/PackPurchaseTask/QualityTaskResponse.cs
+++ b/BBWY.Client/Models/APIModel/Response/PackPurchaseTask/QualityTaskResponse.cs
@@ -93,6 +93,12 @@ namespace BBWY.Client.Models.APIModel.Response.PackPurchaseTask
/// 配件列表
///
public PurchaseSku[] PurchaseSkus { get; set; }
+
+
+ ///
+ ///
+ ///
+ public SaveType? SaveType { get; set; }
}
public class WareHourseDTO
{
diff --git a/BBWY.Client/ViewModels/QualityTask/QualityViewModel.cs b/BBWY.Client/ViewModels/QualityTask/QualityViewModel.cs
index 723289be..5276b081 100644
--- a/BBWY.Client/ViewModels/QualityTask/QualityViewModel.cs
+++ b/BBWY.Client/ViewModels/QualityTask/QualityViewModel.cs
@@ -20,6 +20,7 @@ using Org.BouncyCastle.Asn1.Crmf;
using System.Runtime.InteropServices.WindowsRuntime;
using NPOI.Util;
using BBWY.Controls;
+using WebSocketSharp;
namespace BBWY.Client.ViewModels
{
@@ -585,12 +586,8 @@ namespace BBWY.Client.ViewModels
System.Windows.MessageBox.Show(ex.Message);
}
-
-
-
-
}
@@ -653,7 +650,7 @@ namespace BBWY.Client.ViewModels
model.CerDTO.BrandName = BrandName;
QualitySetCerWindow setCerWindow = new QualitySetCerWindow();
- setCerWindow.LoadData(model.IsNeedCer, model.CerDTO, packPurchaseTaskService, spuCertificateModel, IsSetSpuCertificate);
+ setCerWindow.LoadData(model.IsNeedCer, model.CerDTO, packPurchaseTaskService, spuCertificateModel, IsSetSpuCertificate, saveType);
setCerWindow.SaveResult = (s, PackCerState) =>
{
if (string.IsNullOrEmpty(s.PurchaseSkuId))
@@ -694,6 +691,9 @@ namespace BBWY.Client.ViewModels
look.Show();
}
+
+
+ SaveType? saveType;
///
/// 搜索 skuId(todo:)
///
@@ -743,6 +743,13 @@ namespace BBWY.Client.ViewModels
var packTaskRes = packPurchaseTaskService.GetQualityTask(model.TaskId);
+
+
+ saveType = packTaskRes.Data.SaveType;
+ if (saveType==null)
+ {
+ saveType = OrderId.IsNullOrEmpty() ? SaveType.C端 : SaveType.B端;
+ }
if (packTaskRes == null || !packTaskRes.Success) return;
BarCodeModel = packTaskRes.Data.BarCodeDTO;
IsNeedBarCode = packTaskRes.Data.IsNeedBar ? Need.需要 : Need.不需要;
diff --git a/BBWY.Client/Views/QualityTask/QualitySetCerWindow.xaml.cs b/BBWY.Client/Views/QualityTask/QualitySetCerWindow.xaml.cs
index 477e0dbd..9ce656c1 100644
--- a/BBWY.Client/Views/QualityTask/QualitySetCerWindow.xaml.cs
+++ b/BBWY.Client/Views/QualityTask/QualitySetCerWindow.xaml.cs
@@ -35,14 +35,16 @@ namespace BBWY.Client.Views.QualityTask
PackCerState = obj;
}
- public void LoadData(bool isNeedCer, CertificateModel CertificateModel, PackPurchaseTaskService packTaskService, CertificateModel SpuCertificateModel, bool IsSetSpuCertificate)
+ public void LoadData(bool isNeedCer, CertificateModel CertificateModel, PackPurchaseTaskService packTaskService, CertificateModel SpuCertificateModel, bool IsSetSpuCertificate,SaveType? saveType)
{
this.CertificateModel = CertificateModel.Copy();
this.packTaskService = packTaskService;
PackCerState = isNeedCer ? PackCerState.合格证信息 : PackCerState.无需合格证;
+ SaveType = saveType;
this.DataContext = this;
}
+ public SaveType? SaveType { get; set; }
public ICommand SetPackCerStateCommand { get; set; }
@@ -123,6 +125,7 @@ namespace BBWY.Client.Views.QualityTask
GoodsNumber = CertificateModel.GoodsNumber,
ProduceDate = CertificateModel.ProduceDate,
PurchaseSkuId = CertificateModel.PurchaseSkuId,
+ SaveType = SaveType
});
if (resData == null || !resData.Success)
{
From aa2bef76651b71e49d99f7e4f769bebbc55b127b Mon Sep 17 00:00:00 2001
From: "506583276@qq.com" <506583276@qq.com>
Date: Mon, 12 Jun 2023 15:31:48 +0800
Subject: [PATCH 13/17] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E8=B4=A8=E6=A3=80?=
=?UTF-8?q?=E6=98=AF=E5=90=A6=E5=90=88=E6=A0=BC=E8=AF=81=E6=9D=A1=E4=BB=B6?=
=?UTF-8?q?=E5=88=A4=E6=96=AD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
BBWY.Client/GlobalContext.cs | 2 +-
.../QualityTask/QualityViewModel.cs | 103 ++++++++++--------
.../Views/PackTask/LookCerWindow.xaml.cs | 4 +
.../Views/QualityTask/QualityWindow.xaml | 2 +-
4 files changed, 65 insertions(+), 46 deletions(-)
diff --git a/BBWY.Client/GlobalContext.cs b/BBWY.Client/GlobalContext.cs
index cbe0b1f3..8d013252 100644
--- a/BBWY.Client/GlobalContext.cs
+++ b/BBWY.Client/GlobalContext.cs
@@ -9,7 +9,7 @@ namespace BBWY.Client
{
ShopServiceGroupList = new List();
ShopServiceGroupLowerList = new List();
- ClientVersion = "10124";
+ ClientVersion = "10125";
}
private User user;
diff --git a/BBWY.Client/ViewModels/QualityTask/QualityViewModel.cs b/BBWY.Client/ViewModels/QualityTask/QualityViewModel.cs
index 5276b081..aa95f675 100644
--- a/BBWY.Client/ViewModels/QualityTask/QualityViewModel.cs
+++ b/BBWY.Client/ViewModels/QualityTask/QualityViewModel.cs
@@ -446,20 +446,20 @@ namespace BBWY.Client.ViewModels
};
if (IsNeedBarCode == Need.需要)
{
- if (BarCodeModel==null|| BarCodeModel.Id <= 0)
+ if (BarCodeModel == null || BarCodeModel.Id <= 0)
{
MessageBox.Show("条形码不能为空");
return;
}
request.BarcodeId = BarCodeModel.Id;
}
- if (IsNeedCertificateModel == Need.需要)
+ if(PurchaseSkuList != null && PurchaseSkuList.Count > 0&&purchaseSkuList.Any(p=> p.IsNeedCer)) //(IsNeedCertificateModel == Need.需要)
{
- if (PurchaseSkuList == null && PurchaseSkuList.Count <= 0)
- {
- MessageBox.Show("无可用的合格证打印!");
- return;
- }
+ //if ()
+ //{
+ // MessageBox.Show("无可用的合格证打印!");
+ // return;
+ //}
if (PurchaseSkuList.Where(p => p.IsSetCertificate).Count() > 0)
{
MessageBox.Show("存在未确认的合格证,请先完成确认!");
@@ -507,7 +507,7 @@ namespace BBWY.Client.ViewModels
- if (competeTime now.AddDays(1).Date.AddHours(12))
+ if (competeTime > now.AddDays(1).Date.AddHours(12))
{
MessageBox.Show($"预计完成时间不能超过明天12点,请重新选择预计完成时间");
return;
@@ -553,40 +553,41 @@ namespace BBWY.Client.ViewModels
request.PreCompeteTime = competeTime;
- try
+ try
+ {
+ var competeRes = packPurchaseTaskService.CompeteQualityTask(request);
+ if (competeRes == null)
{
- var competeRes = packPurchaseTaskService.CompeteQualityTask(request);
- if (competeRes == null)
- {
- MessageBox.Show("网络异常");
- return;
- }
- if (!competeRes.Success)
- {
- MessageBox.Show(competeRes.Msg);
- return;
- }
- BatchPrintWindow batchPrint = new BatchPrintWindow();
-
- batchPrint.SetData(GoodProductQuantity,
- PurchaseSkuList.Where(p => p.IsNeedCer && p.CerDTO.Id > 0).Select(p => p.CerDTO).ToArray()
- , BarCodeModel);
- batchPrint.ShowDialog();
+ MessageBox.Show("网络异常");
+ return;
+ }
+ if (!competeRes.Success)
+ {
+ MessageBox.Show(competeRes.Msg);
+ return;
+ }
+ BatchPrintWindow batchPrint = new BatchPrintWindow();
- if (ReflashWindow != null) ReflashWindow();
- var window = obj as BWindow;
- App.Current.Dispatcher.Invoke(new Action(() => {
+ batchPrint.SetData(GoodProductQuantity,
+ PurchaseSkuList.Where(p => p.IsNeedCer && p.CerDTO.Id > 0).Select(p => p.CerDTO).ToArray()
+ , BarCodeModel);
+ batchPrint.ShowDialog();
- window.Close();
- }));
-
- }
- catch (Exception ex)
+ if (ReflashWindow != null) ReflashWindow();
+ var window = obj as BWindow;
+ App.Current.Dispatcher.Invoke(new Action(() =>
{
- System.Windows.MessageBox.Show(ex.Message);
- }
-
+ window.Close();
+ }));
+
+ }
+ catch (Exception ex)
+ {
+
+ System.Windows.MessageBox.Show(ex.Message);
+ }
+
}
@@ -717,6 +718,7 @@ namespace BBWY.Client.ViewModels
BasicPack = model.BasicPack;
CertificatePosition = model.CertificatePosition;
+
ArrivalQuantity = 0;
GoodProductQuantity = 0;
@@ -744,16 +746,29 @@ namespace BBWY.Client.ViewModels
var packTaskRes = packPurchaseTaskService.GetQualityTask(model.TaskId);
+ if (packTaskRes==null)
+ {
+ MessageBox.Show("网络异常!");
+ return;
+ }
+ if (!packTaskRes.Success || packTaskRes.Data==null)
+ {
+ MessageBox.Show(packTaskRes.Msg);
+ return;
+ }
+
+
+ SkuPurchaseSchemeId = packTaskRes.Data.SkuPurchaseSchemeId;
saveType = packTaskRes.Data.SaveType;
- if (saveType==null)
+ if (saveType == null)
{
saveType = OrderId.IsNullOrEmpty() ? SaveType.C端 : SaveType.B端;
}
if (packTaskRes == null || !packTaskRes.Success) return;
BarCodeModel = packTaskRes.Data.BarCodeDTO;
IsNeedBarCode = packTaskRes.Data.IsNeedBar ? Need.需要 : Need.不需要;
- IsSetBarCode = packTaskRes.Data.BarCodeDTO==null ? true:false;
+ IsSetBarCode = packTaskRes.Data.BarCodeDTO == null ? true : false;
IsNeedCertificateModel = packTaskRes.Data.IsNeedCer ? Need.需要 : Need.不需要;
if (packTaskRes.Data.WareHourses != null)
packTaskRes.Data.WareHourses.ToList().ForEach(w =>
@@ -782,8 +797,8 @@ namespace BBWY.Client.ViewModels
}
PurchaseSkuItemBasicInfoResponse skuItem = null;
if (list.Data != null) skuItem = list.Data.ItemList.FirstOrDefault(f => f.PurchaseSkuId == item.PurchaseSkuId);
-
-
+
+
App.Current.Dispatcher.Invoke(new Action(() =>
{
PurchaseSkuList.Add(new PurchaseSku
@@ -832,7 +847,7 @@ namespace BBWY.Client.ViewModels
- if (hour<12)
+ if (hour < 12)
{
PreCompeteTimeDayList.Add("今天");
PreCompeteTimeDayList.Add("明天");
@@ -841,7 +856,7 @@ namespace BBWY.Client.ViewModels
PreCompeteTimeHour = "12点前";
}
- else if (hour<18)
+ else if (hour < 18)
{
PreCompeteTimeDayList.Add("今天");
PreCompeteTimeDayList.Add("明天");
diff --git a/BBWY.Client/Views/PackTask/LookCerWindow.xaml.cs b/BBWY.Client/Views/PackTask/LookCerWindow.xaml.cs
index 37631eae..4ff41ffe 100644
--- a/BBWY.Client/Views/PackTask/LookCerWindow.xaml.cs
+++ b/BBWY.Client/Views/PackTask/LookCerWindow.xaml.cs
@@ -32,6 +32,10 @@ namespace BBWY.Client.Views.PackTask
int goodsNumberIndex = 0;
foreach (CertificateModel certificateModel in certificate)
{
+ if (certificateModel==null)
+ {
+ continue;
+ }
goodsNumberIndex++;
certificateModel.GoodsNumberIndex = goodsNumberIndex;
GoodsNumberCerList.Add(new GoodsNumberCer
diff --git a/BBWY.Client/Views/QualityTask/QualityWindow.xaml b/BBWY.Client/Views/QualityTask/QualityWindow.xaml
index 4136005c..98e8d707 100644
--- a/BBWY.Client/Views/QualityTask/QualityWindow.xaml
+++ b/BBWY.Client/Views/QualityTask/QualityWindow.xaml
@@ -395,7 +395,7 @@
-
+
From 23f0a55af49107e707e174e55de2af28785ab064 Mon Sep 17 00:00:00 2001
From: shanji <18996038927@163.com>
Date: Mon, 12 Jun 2023 16:47:54 +0800
Subject: [PATCH 14/17] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=B3=A8=E9=87=8A?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
BBWY.Server.Model/Enums.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/BBWY.Server.Model/Enums.cs b/BBWY.Server.Model/Enums.cs
index 917b567c..c5ecae56 100644
--- a/BBWY.Server.Model/Enums.cs
+++ b/BBWY.Server.Model/Enums.cs
@@ -3,7 +3,7 @@
public class Enums
{
///
- /// 电商平台
+ /// 电商平台 淘宝 = 0,京东 = 1,阿里巴巴 = 2, 拼多多 = 3,微信 = 4,拳探 = 10
///
public enum Platform
{
From 7d3027b14dbf30ba5cfde1a4176e5fb139bf7a1a Mon Sep 17 00:00:00 2001
From: shanji <18996038927@163.com>
Date: Wed, 14 Jun 2023 13:28:52 +0800
Subject: [PATCH 15/17] =?UTF-8?q?=E6=89=B9=E9=87=8F=E9=87=87=E8=B4=ADv2?=
=?UTF-8?q?=E6=8E=A5=E5=8F=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Controllers/BatchPurchaseController.cs | 22 ++
.../BatchPurchase/BatchPurchaseBusiness.cs | 351 +++++++++++++++++-
.../BatchPurchasePreviewOrderRequest.cs | 1 -
.../BatchPurchaseCargoParamRequestV2.cs | 90 +++++
.../BatchPurchaseCreateOrderRequestV2.cs | 25 ++
.../BatchPurchasePreviewOrderRequestV2.cs | 22 ++
6 files changed, 507 insertions(+), 4 deletions(-)
create mode 100644 BBWY.Server.Model/Dto/Request/PurchaseOrderV2/BatchPurchase2/BatchPurchaseCargoParamRequestV2.cs
create mode 100644 BBWY.Server.Model/Dto/Request/PurchaseOrderV2/BatchPurchase2/BatchPurchaseCreateOrderRequestV2.cs
create mode 100644 BBWY.Server.Model/Dto/Request/PurchaseOrderV2/BatchPurchase2/BatchPurchasePreviewOrderRequestV2.cs
diff --git a/BBWY.Server.API/Controllers/BatchPurchaseController.cs b/BBWY.Server.API/Controllers/BatchPurchaseController.cs
index 276dbfe2..81eb963d 100644
--- a/BBWY.Server.API/Controllers/BatchPurchaseController.cs
+++ b/BBWY.Server.API/Controllers/BatchPurchaseController.cs
@@ -48,6 +48,28 @@ namespace BBWY.Server.API.Controllers
return batchPurchaseBusiness.BatchCreateOrder(request);
}
+ ///
+ /// 预览订单价格V2
+ ///
+ ///
+ ///
+ [HttpPost]
+ public PreviewOrderResponse PreviewOrderV2([FromBody] BatchPurchasePreviewOrderRequestV2 request)
+ {
+ return batchPurchaseBusiness.PreviewOrderV2(request);
+ }
+
+ ///
+ /// 批量创建采购单V2
+ ///
+ ///
+ ///
+ [HttpPost]
+ public BatchCreareOrderResponse BatchCreateOrderV2(BatchPurchaseCreateOrderRequestV2 request)
+ {
+ return batchPurchaseBusiness.BatchCreateOrderV2(request);
+ }
+
///
/// 获取采购单列表
///
diff --git a/BBWY.Server.Business/PurchaseOrderV2/BatchPurchase/BatchPurchaseBusiness.cs b/BBWY.Server.Business/PurchaseOrderV2/BatchPurchase/BatchPurchaseBusiness.cs
index 9f5b44e1..3ab3a661 100644
--- a/BBWY.Server.Business/PurchaseOrderV2/BatchPurchase/BatchPurchaseBusiness.cs
+++ b/BBWY.Server.Business/PurchaseOrderV2/BatchPurchase/BatchPurchaseBusiness.cs
@@ -2,7 +2,7 @@
using BBWY.Common.Models;
using BBWY.Server.Model;
using BBWY.Server.Model.Db;
-using BBWY.Server.Model.Db.QK;
+using BBWY.Server.Model.Db.Mds;
using BBWY.Server.Model.Dto;
using FreeSql;
using Newtonsoft.Json;
@@ -11,7 +11,6 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
-using System.Net.Mail;
using System.Text;
using System.Threading.Tasks;
using Yitter.IdGenerator;
@@ -24,17 +23,20 @@ namespace BBWY.Server.Business
private IEnumerable platformSDKBusinessList;
//private TaskSchedulerManager taskSchedulerManager;
private RestApiService restApiService;
+ private FreeSqlMultiDBManager freeSqlMultiDBManager;
public BatchPurchaseBusiness(IFreeSql fsql,
NLogManager nLogManager,
IIdGenerator idGenerator,
ProductBusiness productBusiness,
IEnumerable platformSDKBusinessList,
- RestApiService restApiService) : base(fsql, nLogManager, idGenerator)
+ RestApiService restApiService,
+ FreeSqlMultiDBManager freeSqlMultiDBManager) : base(fsql, nLogManager, idGenerator)
{
this.productBusiness = productBusiness;
this.platformSDKBusinessList = platformSDKBusinessList;
this.restApiService = restApiService;
+ this.freeSqlMultiDBManager = freeSqlMultiDBManager;
}
///
@@ -200,6 +202,85 @@ namespace BBWY.Server.Business
};
}
+ ///
+ /// 预览订单V2
+ ///
+ ///
+ ///
+ ///
+ public PreviewOrderResponse PreviewOrderV2(BatchPurchasePreviewOrderRequestV2 request)
+ {
+
+ if (request.CargoParamGroupList == null || request.CargoParamGroupList.Count() == 0 ||
+ request.CargoParamGroupList.Any(g => g.CargoParamList == null || g.CargoParamList.Count() == 0 || string.IsNullOrEmpty(g.PurchaserId)))
+ throw new BusinessException("缺少商品参数");
+ if (request.Consignee == null ||
+ string.IsNullOrEmpty(request.Consignee.Address) ||
+ string.IsNullOrEmpty(request.Consignee.Mobile) ||
+ string.IsNullOrEmpty(request.Consignee.ContactName))
+ throw new BusinessException("缺少收货人信息");
+ if (request.PurchaseAccountList == null || request.PurchaseAccountList.Count() == 0)
+ throw new BusinessException("缺少采购账号");
+
+ var extJArray = new List
public long? SchemeId { get; set; }
+ ///
+ /// 采购方案Id集合
+ ///
+ public IList SchemeIdList { get; set; }
+
public long? ShopId { get; set; }
public IList SkuIdList { get; set; }
From 1c869fe13219c250a3256b73a145c7ba0c8d9b58 Mon Sep 17 00:00:00 2001
From: shanji <18996038927@163.com>
Date: Wed, 14 Jun 2023 16:13:08 +0800
Subject: [PATCH 17/17] 1
---
BBWY.Server.API/Controllers/PurchaseSchemeController.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/BBWY.Server.API/Controllers/PurchaseSchemeController.cs b/BBWY.Server.API/Controllers/PurchaseSchemeController.cs
index 50c4759e..b154512a 100644
--- a/BBWY.Server.API/Controllers/PurchaseSchemeController.cs
+++ b/BBWY.Server.API/Controllers/PurchaseSchemeController.cs
@@ -30,7 +30,7 @@ namespace BBWY.Server.API.Controllers
}
///
- /// 根据产品Id批量查询采购方案列表
+ /// 批量查询采购方案列表
///
///
///