wenjy 1 year ago
commit 26db77b7dd

@ -27,6 +27,6 @@ namespace Admin.Core.IService
/// <param name="startTime">开始时间</param>
/// <param name="endTime">结束时间</param>
/// <returns>入库记录集合</returns>
Task<List<EnterLibView>> SaveRecordToDb(string storeCode,DateTime startTime, DateTime endTime);
Task<List<RecordInStore>> queryRecordToDb(string storeCode,DateTime startTime, DateTime endTime);
}
}

@ -12,36 +12,54 @@ namespace Admin.Core.Model.ViewModels
public class EnterLibView
{
/// <summary>
/// 序号
/// 序号
/// </summary>
public int No { get; set; }
/// <summary>
/// 计划名称
/// 货道号
/// </summary>
public string PlanCode { get; set; }
public string SpaceCode { get; set; }
/// <summary>
/// 物料编码
/// </summary>
public string MaterialCode { get; set; }
/// <summary>
/// 物料型号
/// </summary>
public string MaterialName { get; set; }
/// <summary>
/// 物料条码
/// 产品条码
/// </summary>
public string MaterialBarCode { get; set; }
/// <summary>
/// 入库货道
/// 产品型号
/// </summary>
public string EnterSpace { get; set; }
public string MaterialType { get; set; }
/// <summary>
/// 执行时间
/// 入库时间
/// </summary>
public DateTime ExecDateTime { get; set; }
/// <summary>
/// 状态
/// </summary>
public string Status { get; set; }
public DateTime InstoreTime { get; set; }
///// <summary>
///// 计划名称
///// </summary>
//public string PlanCode { get; set; }
///// <summary>
///// 物料编码
///// </summary>
//public string MaterialCode { get; set; }
///// <summary>
///// 物料型号
///// </summary>
//public string MaterialName { get; set; }
///// <summary>
///// 物料条码
///// </summary>
//public string MaterialBarCode { get; set; }
///// <summary>
///// 入库货道
///// </summary>
//public string EnterSpace { get; set; }
///// <summary>
///// 执行时间
///// </summary>
//public DateTime ExecDateTime { get; set; }
///// <summary>
///// 状态
///// </summary>
//public string Status { get; set; }
}
}

@ -43,30 +43,30 @@ namespace Admin.Core.Service
/// <param name="storeCode"></param>
/// <returns></returns>
/// <exception cref="System.NotImplementedException"></exception>
public async Task<List<EnterLibView>> SaveRecordToDb(string storeCode,DateTime startTime, DateTime endTime)
public async Task<List<RecordInStore>> queryRecordToDb(string storeCode,DateTime startTime, DateTime endTime)
{
try
{
List<RecordInStore> preCordList = _recordInstoreRepository.QueryAsync(d =>d.StoreCode.Equals(storeCode) ).Result;//&& d.CreatedTime >= startTime&& d.CreatedTime <= endTime
if (preCordList.Count() == 0) return null;
var proList = _productPlanInfoRepository.Query();
if (proList.Count() == 0) return null;
var list = from d in proList
join p in preCordList
on d.MaterialCode equals p.MaterialCode
select new EnterLibView
{
No = p.ObjId,
PlanCode = d.PlanCode,
MaterialCode = d.MaterialCode,
MaterialName = d.MaterialName,
MaterialBarCode = p.BarCodeCode,
EnterSpace = p.SpaceCode,
ExecDateTime = p.CreatedTime,
Status = p.EntryPattern==0?"正常":"异常"
};
return list.ToList();
List<RecordInStore> preCordList = _recordInstoreRepository.QueryAsync(d =>d.StoreCode.Equals(storeCode) && d.InStoreTime >= startTime && d.InStoreTime <= endTime).Result;//
if(preCordList == null && preCordList.Count == 0) return null;
return preCordList;
//List<EnterLibView> list = new List<EnterLibView>();
//int count = 0;
//foreach(RecordInStore item in preCordList)
//{
// list.Add(new EnterLibView
// {
// No = ++count,
// SpaceCode = item.SpaceCode,
// MaterialBarCode = item.BarCodeCode,
// MaterialType = item.MaterialType,
// InstoreTime = item.InStoreTime,
// });
//}
//return list;
}
catch (Exception ex)
{

@ -35,26 +35,25 @@ namespace Aucma.Core.BoxFoam.ViewModels
{
try
{
var storeCode = Appsettings.app("StoreInfo", "StoreCode");
MaterialDataGrid.Clear();
var storeCode = Appsettings.app("StoreInfo", "BeforeStoreCode");
DateTime startTime = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd 00:00:00"));
DateTime endTime = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd 23:59:59"));
var list = await _recordInstoreServices.SaveRecordToDb(storeCode, startTime, endTime);
foreach (var item in list.OrderByDescending(d => d.No))
var list = await _recordInstoreServices.queryRecordToDb(storeCode, startTime, endTime);
if (list == null) return;
int count = 0;
foreach (var item in list)
{
MaterialDataGrid.Add(new EnterLibView()
{
No = item.No,
PlanCode = item.PlanCode,
MaterialBarCode= item.MaterialBarCode,
MaterialCode = item.MaterialCode,
MaterialName = item.MaterialName,
EnterSpace = item.EnterSpace,
ExecDateTime = item.ExecDateTime,
Status = item.Status,
});
MaterialDataGrid.Add(new EnterLibView
{
No = ++count,
SpaceCode = item.SpaceCode,
MaterialBarCode = item.BarCodeCode,
MaterialType = item.MaterialType,
InstoreTime = item.InStoreTime,
});
};
}
catch (Exception ex)
{
@ -111,27 +110,24 @@ namespace Aucma.Core.BoxFoam.ViewModels
var storeCode = Appsettings.app("StoreInfo", "BeforeStoreCode");
DateTime startTime = Convert.ToDateTime(theBeginTime.ToString("yyyy-MM-dd 00:00:00"));
DateTime endTime = Convert.ToDateTime(theEndTime.ToString("yyyy-MM-dd 23:59:59"));
System.Windows.Application.Current.Dispatcher.Invoke((Action)(async () =>
{
if (!string.IsNullOrEmpty(result.BeginTime))
{
MaterialDataGrid.Clear();
var list = await _recordInstoreServices.SaveRecordToDb(storeCode, startTime, endTime);
if (list==null) return;
foreach (var item in list.OrderByDescending(d => d.No))
var list = await _recordInstoreServices.queryRecordToDb(storeCode, startTime, endTime);
if (list == null) return;
int count = 0;
foreach (var item in list)
{
MaterialDataGrid.Add(new EnterLibView()
MaterialDataGrid.Add(new EnterLibView
{
No = item.No,
PlanCode = item.PlanCode,
MaterialBarCode = item.MaterialBarCode,
MaterialCode = item.MaterialCode,
MaterialName = item.MaterialName,
EnterSpace = item.EnterSpace,
ExecDateTime = item.ExecDateTime,
Status = item.Status,
No = ++count,
SpaceCode = item.SpaceCode,
MaterialBarCode = item.BarCodeCode,
MaterialType = item.MaterialType,
InstoreTime = item.InStoreTime,
});
};
}

@ -155,14 +155,14 @@
ScrollViewer.VerticalScrollBarVisibility="Hidden" BorderThickness="0" CanUserAddRows="False" SelectionMode="Single" IsReadOnly="True"
Foreground="White" >
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding No}" Header="序号" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}" Visibility="Collapsed"/>
<DataGridTextColumn Binding="{Binding PlanCode}" Header="计划编号" Width="1*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding MaterialBarCode}" Header="物料条码" Width="1*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding MaterialCode}" Header="物料编号" Width="1*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding MaterialName}" Header="物料名称" Width="2*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding EnterSpace}" Header="货道" Width="*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding No}" Header="序号" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}" />
<DataGridTextColumn Binding="{Binding SpaceCode}" Header="货道编号" Width="2*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding MaterialBarCode}" Header="产品条码" Width="3*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding MaterialType}" Header="产品型号" Width="2*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding InstoreTime,StringFormat=\{0:yyyy-MM-dd HH:mm\}}" Header="入库时间" Width="2*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<!--<DataGridTextColumn Binding="{Binding EnterSpace}" Header="货道" Width="*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding Status}" Header="状态" Width="*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding ExecDateTime ,StringFormat=\{0:yyyy-MM-dd HH:mm\}}" Header="入库时间" Width="1.5*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding ExecDateTime ,StringFormat=\{0:yyyy-MM-dd HH:mm\}}" Header="入库时间" Width="1.5*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>-->
</DataGrid.Columns>
</DataGrid>

Loading…
Cancel
Save