Browse Source

1

AddValidOverTime
506583276@qq.com 2 years ago
parent
commit
6fb5017582
  1. 18
      BBWY.Client/APIServices/QiKu/QualityTaskService.cs
  2. 33
      BBWY.Client/Models/APIModel/Response/QualityTask/SearchProductAttrsBySkuIdResponse.cs
  3. 55
      BBWY.Client/Models/PackTask/PackTaskModel.cs
  4. 182
      BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs
  5. 3
      BBWY.Client/Views/QualityTask/QualityControl.xaml
  6. 3
      BBWY.Client/Views/QualityTask/WaitQualityControl.xaml
  7. 2
      BBWY.Client/Views/QualityTipWindows/QualityProductWindow.xaml
  8. 9
      BBWY.Client/Views/QualityTipWindows/QualityProductWindow.xaml.cs

18
BBWY.Client/APIServices/QiKu/QualityTaskService.cs

@ -52,7 +52,7 @@ namespace BBWY.Client.APIServices.QiKu
public ApiResponse<object> QualityTaskException(long TaskId, TaskExceptionType TaskExceptionType, string RemarkMsg)
{
return SendRequest<object>(globalContext.QKApiHost, $"api/QualityTask/QualityTaskException?TaskId={TaskId}",
return SendRequest<object>(globalContext.QKApiHost, $"api/QualityTask/QualityTaskException",
new {
TaskId,
TaskExceptionType,
@ -61,5 +61,21 @@ namespace BBWY.Client.APIServices.QiKu
}
, null, HttpMethod.Post);
}
public ApiResponse<SearchProductAttrsBySkuIdResponse> SearchProductAttrsBySkuId(string SkuId, string AppKey, string AppSecret, string AppToken, Platform platform)
{
return SendRequest<SearchProductAttrsBySkuIdResponse>(globalContext.QKApiHost, $"api/Product/SearchProductAttrsBySkuId",
new
{
SkuId,
AppKey,
AppSecret,
AppToken,
platform
}
, null, HttpMethod.Post);
}
}
}

33
BBWY.Client/Models/APIModel/Response/QualityTask/SearchProductAttrsBySkuIdResponse.cs

@ -0,0 +1,33 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace BBWY.Client.Models.APIModel
{
/// <summary>
///
/// </summary>
public class SearchProductAttrsBySkuIdResponse
{
/// <summary>
/// 品牌
/// </summary>
public string Brand { get; set; }
/// <summary>
/// 是否在集团品牌列表
/// </summary>
public bool IsTeamBrand { get; set; }
/// <summary>
/// 适用年龄
/// </summary>
public string ApplyAge { get; set; }
/// <summary>
/// 适用年龄是否大于14
/// </summary>
public bool? IsApplyAgeOver14 { get; set; }
}
}

55
BBWY.Client/Models/PackTask/PackTaskModel.cs

@ -60,7 +60,7 @@ namespace BBWY.Client.Models
/// 修改任务
/// </summary>
public ICommand UpdateTaskCommand { get; set; }
public ICommand QualityTaskCommand { get; set; }
public Action ReflashTask { get; set; }
private void UpdateTask()
{
@ -104,60 +104,11 @@ namespace BBWY.Client.Models
LookCerCommand = new RelayCommand(LookCer);
SetServiceCommand = new RelayCommand(SetService);
UpdateTaskCommand = new RelayCommand(UpdateTask);
QualityTaskCommand = new RelayCommand(QualityTask);
}
private void QualityTask()
{
//加载数据
QualityWindow service = new QualityWindow(this, ReflashTask);
service.Show();
QualityProductWindow qualityProduct = new QualityProductWindow("商品合格证情况", "商品包装有合格证信息", "商品包装无合格证信息", (isTrue) => {
if (isTrue)
{
QualityProductWindow qualityProduct = new QualityProductWindow("商品品牌情况", "商品包装有品牌信息", "商品包装无品牌信息", (isTrue) => {
if (isTrue)
{
}
else
{
}
});
qualityProduct.ShowDialog();
}
else
{
if (this.CertificateModel==null|| !this.CertificateModel.Any())//未配置
{
}
else
{
}
}
});
qualityProduct.ShowDialog();
}
private void SetService()
{

182
BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs

@ -30,6 +30,9 @@ using BBWY.Client.APIServices.QiKu;
using BBWY.Client.Views.PackerTask;
using BBWY.Client.Models.QualityTask;
using BBWY.Client.Views.QualityTask;
using BBWY.Client.Views.QualityTipWindows;
using System.Windows.Interop;
using NPOI.SS.Formula.Functions;
namespace BBWY.Client.ViewModels.PackTask
{
@ -753,6 +756,10 @@ namespace BBWY.Client.ViewModels.PackTask
public ICommand QualityTaskExceptionCommand { get; set; }
/// <summary>
/// 验收任务
/// </summary>
public ICommand QualityTaskCommand { get; set; }
public WareHouseListViewModel(PackTaskService packTaskService, GlobalContext globalContext, SealBoxService sealBoxService, PackUserService packUserService, MarkMessageService markMessageService, QualityTaskService qualityTaskService)
{
@ -859,6 +866,181 @@ namespace BBWY.Client.ViewModels.PackTask
this.qualityTaskService = qualityTaskService;
QualityTaskExceptionCommand = new RelayCommand<long>(QualityTaskException);
QualityTaskCommand = new RelayCommand<long>(QualityTask);
}
private void QualityTask(long taskId)
{
var model = PackTaskList?.SingleOrDefault(p => p.TaskId == taskId);
if (model == null) { MessageBox.Show($"任务不存在,任务id:{taskId}"); return; }
var shopList = globalContext.User.ShopList;
var shop = shopList.FirstOrDefault(s => s.ShopName == model.ShopName);
if (shop == null)
{
MessageBox.Show($"查找不到店铺信息, {model.ShopName}");
return;
}
var skuAttsDetailRes = qualityTaskService.SearchProductAttrsBySkuId(model.SkuId, shop.AppKey, shop.AppSecret, shop.AppToken, shop.Platform);
if (skuAttsDetailRes == null || !skuAttsDetailRes.Success)
{
MessageBox.Show(skuAttsDetailRes?.Msg);
return;
}
var skuAttsDetail = skuAttsDetailRes.Data;
bool isqualityCer = false; //验收合格证
new QualityProductWindow("商品合格证情况", "商品包装有合格证信息", "商品包装无合格证信息", (ishaveCer) =>
{
if (ishaveCer)//验收商品 有合格证
{
if (skuAttsDetail.ApplyAge.IsNullOrEmpty() || (skuAttsDetail.IsApplyAgeOver14 != null && skuAttsDetail.IsApplyAgeOver14.Value))//不存在使用年龄 或者适用年龄大于14
{
//todo: 判断是否首次验收 只支持供应链 有采购方案的
new QualityProductWindow("商品合格证情况", "商品合格证类型有3C标", "商品合格证类型无3C标", (ishave3c) =>
{
if (ishave3c)
{
//todo: 存配置 只支持供应链 有采购方案的
//验收有效性
new QualityProductWindow("商品合格证情况", "商品合格证类型有3C标", "商品合格证类型无3C标", (iscanuser) =>
{
if (iscanuser)
{
isqualityCer = true;//验收正常
return;
}
//当前合格证3c无效
//todo:
// 通知采购方问题 咨询是否可替款
MessageBox.Show("提示采购部门,当前任务详情页展示适用年龄为14岁以下, 实物商品配置的合格证当前合格证3c无效,任务已挂起");
}).ShowDialog();
return;
}
//todo:
// 通知采购方问题 咨询是否可替款
MessageBox.Show("提示采购部门,当前任务详情页展示适用年龄为14岁以下, 实物商品配置的合格证没有3C,咨询是否可替款,任务已挂起");
}).ShowDialog();
}
//验收商品合格证是否有品牌
new QualityProductWindow("商品合格证情况", "商品包装合格证上有品牌信息", "商品包装合格证上无品牌信息", (iscerhavebrand) =>
{
if (iscerhavebrand)
{
new QualityProductWindow("商品合格证情况", $"商品包装合格证上的品牌是{skuAttsDetail.Brand}", $"商品包装合格证上的品牌不是{skuAttsDetail.Brand}", (istruebrand) =>
{
if (!istruebrand)
{
//需要合格证
if (model.CertificateModel == null || !model.CertificateModel.Any())//未配置
{
//未配置 todo: 写接口通知采购方问题
MessageBox.Show("提示采购部门,当前任务未配置合格证,赶紧配置,任务已挂起");
return;
}
//打印合格证 完全遮盖包装合格证信息
}
isqualityCer = true;//验收合格证完毕
}).ShowDialog();
}
}).ShowDialog();
}
else
{
//需要合格证
if (model.CertificateModel == null || !model.CertificateModel.Any())//未配置
{
//未配置 todo: 写接口通知采购方问题
MessageBox.Show("提示采购部门,当前任务未配置合格证,赶紧配置,任务已挂起");
return;
}
if (skuAttsDetail.ApplyAge.IsNullOrEmpty() || (skuAttsDetail.IsApplyAgeOver14 != null && skuAttsDetail.IsApplyAgeOver14.Value))//不存在使用年龄 或者适用年龄大于14
{
isqualityCer = true;//验收正常
return;
}
//年龄低于14
if (!model.CertificateModel.Any(c => c.LabelModel != CertificateLabelModel.3c))//所有配置的合格证都是标准3c
{
isqualityCer = true;//验收正常
return;
}
//不存在 3c 通知采购方问题
MessageBox.Show("提示采购部门,当前任务配置的合格证没有3C,赶紧配置,任务已挂起");
return;
}
}).ShowDialog();
if (isqualityCer)//合格证验收完毕
{
new QualityProductWindow("商品品牌情况", "商品包装有品牌信息", "商品包装无品牌信息", (ishavebrand) =>
{
if (ishavebrand && !skuAttsDetail.IsTeamBrand)//有品牌且品牌不是集团的
{
new QualityProductWindow($"商品品牌情况", $"商品包装品牌是{skuAttsDetail.Brand}", $"商品包装品牌不是{skuAttsDetail.Brand}", (istruebrand) => {
if (istruebrand)
{
//无需贴商标
}
else
{
//需覆盖商标
}
}).ShowDialog();
}
else
{
//需贴商标
}
}).ShowDialog();
QualityWindow service = new QualityWindow(model, ReflashTask);
service.Show();
}
}
private void QualityTaskException(long taskId)

3
BBWY.Client/Views/QualityTask/QualityControl.xaml

@ -353,7 +353,8 @@
<Grid Grid.Column="6" >
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<c:BButton HorizontalAlignment="Center" Style="{StaticResource LinkButton}" Height="20" Margin="0 5 0 5 " VerticalAlignment="Center" Grid.Row="1" Content="商品验收"
Command="{Binding QualityTaskCommand}"
Command="{Binding DataContext.QualityTaskCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type UserControl}}}"
CommandParameter="{Binding TaskId}"
Visibility="{Binding TaskState,Converter={StaticResource objConverter},ConverterParameter=待验收:Visible:Collapsed}"
/>

3
BBWY.Client/Views/QualityTask/WaitQualityControl.xaml

@ -580,7 +580,8 @@
<Grid Grid.Column="12" >
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<c:BButton HorizontalAlignment="Center" Style="{StaticResource LinkButton}" Height="20" Margin="0 5 0 5 " VerticalAlignment="Center" Grid.Row="1" Content="商品验收"
Command="{Binding QualityTaskCommand}"
Command="{Binding DataContext.QualityTaskCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type UserControl}}}"
CommandParameter="{Binding TaskId}"
Visibility="{Binding TaskState,Converter={StaticResource objConverter},ConverterParameter=待验收:Visible:Collapsed}"
/>

2
BBWY.Client/Views/QualityTipWindows/QualityProductWindow.xaml

@ -23,7 +23,7 @@
</Grid.RowDefinitions>
<Border BorderThickness="0,0,0,1" BorderBrush="{StaticResource MainMenu.BorderBrush}"
Background="{StaticResource Border.Background}">
<TextBlock Text="{Binding Title}" HorizontalAlignment="Center" Margin="20 0 0 0" VerticalAlignment="Center"/>
<TextBlock Text="{Binding MsgTitle}" HorizontalAlignment="Center" Margin="20 0 0 0" VerticalAlignment="Center"/>
</Border>
<Grid Grid.Row="1" Margin="50 0 50 0">
<Grid.RowDefinitions>

9
BBWY.Client/Views/QualityTipWindows/QualityProductWindow.xaml.cs

@ -22,18 +22,19 @@ namespace BBWY.Client.Views.QualityTipWindows
public QualityProductWindow(string title, string isTrueMsg, string isFalseMsg, Action<bool> clickReturn)
{
InitializeComponent();
this.DataContext = this;
Title = title;
MsgTitle = title;
IsTrueMsg = isTrueMsg;
IsFalseMsg = isFalseMsg;
ClickReturn = clickReturn;
this.DataContext = this;
}
private string title;
private string msgTitle;
/// <summary>
/// 封箱配置状态
/// </summary>
public string Title { get => title; set { Set(ref title, value); } }
public string MsgTitle { get => msgTitle; set { Set(ref msgTitle, value); } }
private string isTrueMsg;

Loading…
Cancel
Save