using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using SlnMesnac.RfidUpload.Business;
using SlnMesnac.RfidUpload.Common;
using SlnMesnac.RfidUpload.Model;
using SlnMesnac.RfidUpload.Model.apiParam;
using SlnMesnac.RfidUpload.Model.config;
using SlnMesnac.RfidUpload.TouchSocket;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.ServiceModel.Channels;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
#region << 版 本 注 释 >>
/*--------------------------------------------------------------------
* 版权所有 (c) 2024 WenJY 保留所有权利。
* CLR版本:4.0.30319.42000
* 机器名称:T14-GEN3-7895
* 命名空间:SlnMesnac.RfidUpload.UI.viewModel
* 唯一标识:81e29764-73f1-4de5-bd78-56b96ca165ba
*
* 创建者:WenJY
* 电子邮箱:
* 创建时间:2024-12-06 9:50:16
* 版本:V1.0.0
* 描述:
*
*--------------------------------------------------------------------
* 修改人:
* 时间:
* 修改说明:
*
* 版本:V1.0.0
*--------------------------------------------------------------------*/
#endregion << 版 本 注 释 >>
namespace SlnMesnac.RfidUpload.UI.viewModel
{
public partial class ContainerTransferOrderViewModel : ObservableObject
{
#region 委托事件
///
/// model-新容器入库-调拨单号验证状态成功1,失败-1
/// model-容器封发-验证封发计划接口,状态成功2,失败-1
/// dbdh-调拨单号
/// status- 1-正常
///
///
///
public delegate void RefreshSubmitVerifyDelegate(int model, string msg, string dbdh);
public static event RefreshSubmitVerifyDelegate RefreshSubmitVerifyEvent;
#endregion
public delegate void Success();
public event Success SuccessEvent;
private CsbHandleBusiness csbHandleBusiness = CsbHandleBusiness.Instance;
public string _FFPlan = string.Empty;
public string FFPlan
{
get => _FFPlan;
set => SetProperty(ref _FFPlan, value);
}
public string _drj = string.Empty;
public string DRJ
{
get => _drj;
set => SetProperty(ref _drj, value);
}
private DateTime? _startDate;
public DateTime? StartDate
{
get => _startDate;
set
{
_startDate = value;
OnPropertyChanged(nameof(StartDate));
}
}
private DateTime? _endDate;
public DateTime? EndDate
{
get => _endDate;
set
{
_endDate = value;
OnPropertyChanged(nameof(EndDate));
}
}
private ObservableCollection _transferOrderInfoItems = new ObservableCollection();
public ObservableCollection TransferOrderInfoItems
{
get => _transferOrderInfoItems;
set => SetProperty(ref _transferOrderInfoItems, value);
}
[RelayCommand]
private void Query()
{
var info = _FFPlan;
var info2 = _drj;
var info3 = _startDate;
var info4 = _endDate;
}
private AppConfig appConfig = AppConfig.Instance;
private WebApiClientApp webApiClientApp = WebApiClientApp.Instance;
private static INIFile iNIFile = new INIFile(System.Environment.CurrentDirectory + "/App.InI");
[RelayCommand]
private void GetTransferOrder()
{
if (_startDate == null || _endDate == null)
{
MessageBox.Show("请选择开始日期或者结束日期");
return;
}
else if (_startDate > _endDate)
{
MessageBox.Show("开始日期不能大于结束日期");
return;
}
#region 正式启用
CsbResult res = csbHandleBusiness.transferOrderFfjhByCsb("", _startDate.Value.ToString(), _endDate.Value.ToString());
MessageBox.Show(res.message);
if (res.code == "200")
{
if (res.IsSuccess)
{
List institutionList = res.ToObjectList();
TransferOrderInfoItems = new ObservableCollection(institutionList);
}
}
#endregion
}
///
/// 执行分发
///
///
[RelayCommand]
private void Execute(TransferOrderInfo transferOrderInfo)
{
SelectRouterWindow selectRouterWindow = new SelectRouterWindow(transferOrderInfo);
selectRouterWindow.ShowDialog();
}
}
}
class result1
{
public string status { get; set; }
public string msg { get; set; }
public List @object { get; set; }
}