wenjy 1 year ago
commit 26db77b7dd

@ -27,6 +27,6 @@ namespace Admin.Core.IService
/// <param name="startTime">开始时间</param> /// <param name="startTime">开始时间</param>
/// <param name="endTime">结束时间</param> /// <param name="endTime">结束时间</param>
/// <returns>入库记录集合</returns> /// <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 public class EnterLibView
{ {
/// <summary> /// <summary>
/// 序号 /// 序号
/// </summary> /// </summary>
public int No { get; set; } public int No { get; set; }
/// <summary> /// <summary>
/// 计划名称 /// 货道号
/// </summary> /// </summary>
public string PlanCode { get; set; } public string SpaceCode { get; set; }
/// <summary> /// <summary>
/// 物料编码 /// 产品条码
/// </summary>
public string MaterialCode { get; set; }
/// <summary>
/// 物料型号
/// </summary>
public string MaterialName { get; set; }
/// <summary>
/// 物料条码
/// </summary> /// </summary>
public string MaterialBarCode { get; set; } public string MaterialBarCode { get; set; }
/// <summary> /// <summary>
/// 入库货道 /// 产品型号
/// </summary> /// </summary>
public string EnterSpace { get; set; } public string MaterialType { get; set; }
/// <summary> /// <summary>
/// 执行时间 /// 入库时间
/// </summary> /// </summary>
public DateTime ExecDateTime { get; set; } public DateTime InstoreTime { get; set; }
/// <summary>
/// 状态 ///// <summary>
/// </summary> ///// 计划名称
public string Status { get; set; } ///// </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> /// <param name="storeCode"></param>
/// <returns></returns> /// <returns></returns>
/// <exception cref="System.NotImplementedException"></exception> /// <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 try
{ {
List<RecordInStore> preCordList = _recordInstoreRepository.QueryAsync(d =>d.StoreCode.Equals(storeCode) ).Result;//&& d.CreatedTime >= startTime&& d.CreatedTime <= endTime List<RecordInStore> preCordList = _recordInstoreRepository.QueryAsync(d =>d.StoreCode.Equals(storeCode) && d.InStoreTime >= startTime && d.InStoreTime <= endTime).Result;//
if (preCordList.Count() == 0) return null; if(preCordList == null && preCordList.Count == 0) return null;
var proList = _productPlanInfoRepository.Query(); return preCordList;
if (proList.Count() == 0) return null; //List<EnterLibView> list = new List<EnterLibView>();
var list = from d in proList //int count = 0;
join p in preCordList //foreach(RecordInStore item in preCordList)
on d.MaterialCode equals p.MaterialCode //{
select new EnterLibView
{ // list.Add(new EnterLibView
No = p.ObjId, // {
PlanCode = d.PlanCode, // No = ++count,
MaterialCode = d.MaterialCode, // SpaceCode = item.SpaceCode,
MaterialName = d.MaterialName, // MaterialBarCode = item.BarCodeCode,
MaterialBarCode = p.BarCodeCode, // MaterialType = item.MaterialType,
EnterSpace = p.SpaceCode, // InstoreTime = item.InStoreTime,
ExecDateTime = p.CreatedTime, // });
Status = p.EntryPattern==0?"正常":"异常" //}
};
return list.ToList(); //return list;
} }
catch (Exception ex) catch (Exception ex)
{ {

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

@ -155,14 +155,14 @@
ScrollViewer.VerticalScrollBarVisibility="Hidden" BorderThickness="0" CanUserAddRows="False" SelectionMode="Single" IsReadOnly="True" ScrollViewer.VerticalScrollBarVisibility="Hidden" BorderThickness="0" CanUserAddRows="False" SelectionMode="Single" IsReadOnly="True"
Foreground="White" > Foreground="White" >
<DataGrid.Columns> <DataGrid.Columns>
<DataGridTextColumn Binding="{Binding No}" Header="序号" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}" Visibility="Collapsed"/> <DataGridTextColumn Binding="{Binding No}" Header="序号" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}" />
<DataGridTextColumn Binding="{Binding PlanCode}" Header="计划编号" Width="1*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/> <DataGridTextColumn Binding="{Binding SpaceCode}" Header="货道编号" Width="2*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding MaterialBarCode}" Header="物料条码" Width="1*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/> <DataGridTextColumn Binding="{Binding MaterialBarCode}" Header="产品条码" Width="3*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding MaterialCode}" Header="物料编号" Width="1*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/> <DataGridTextColumn Binding="{Binding MaterialType}" Header="产品型号" Width="2*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding MaterialName}" 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 EnterSpace}" Header="货道" Width="*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding Status}" 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.Columns>
</DataGrid> </DataGrid>

Loading…
Cancel
Save