change-泡后库plc心跳及重连

foamRearStore
liuwf 8 months ago
parent 6095b45802
commit 3022b935fb

Binary file not shown.

@ -62,7 +62,7 @@ namespace Aucma.Scada.Business
#endregion
#region 私有变量
private Dictionary<string, IPlc> _plcDictionary = new Dictionary<string, IPlc>();
private static Dictionary<string, IPlc> _plcDictionary = new Dictionary<string, IPlc>();
private Dictionary<string, int> foamRearKeyValuePairs = new Dictionary<string, int>();
/// <summary>
/// 泡后任务编号,PLC反馈后进行赋值
@ -72,7 +72,7 @@ namespace Aucma.Scada.Business
#endregion
#region 委托事件
/// <summary>
/// 实时库存刷新
@ -134,6 +134,7 @@ namespace Aucma.Scada.Business
Thread.Sleep(2000);
while (true)
{
List<BaseSpaceInfo> spaceList = _spaceInfoService.GetSpaceInfosByStoreCode(appConfig.foamStoreCode);
if (spaceList != null && spaceList.Count > 0)
{
@ -199,19 +200,25 @@ namespace Aucma.Scada.Business
try
{
Thread.Sleep(3000);
IPlc _plc = _plcDictionary[appConfig.foamStoreCode];
if (_plc != null)
while (true)
{
while (true)
Console.Write(_plcDictionary.Count);
_plcDictionary = _pool.GetAll();
if (_plcDictionary.Count == 0)
{
_plc.writeInt32ByAddress("D7020", 1);
Thread.Sleep(1000);
_plc.writeInt32ByAddress("D7020", 0);
Thread.Sleep(1000);
Thread.Sleep(5000);
continue;
}
}
IPlc _plc = _plcDictionary[appConfig.foamStoreCode];
if (_plc != null)
{
_plc.writeInt32ByAddress("D7020", 1);
Thread.Sleep(1000);
_plc.writeInt32ByAddress("D7020", 0);
Thread.Sleep(1000);
}
}
}
catch (Exception ex)
{
@ -480,17 +487,22 @@ namespace Aucma.Scada.Business
public BaseSpaceInfo ReadSpaceInfoByPlc(BaseSpaceInfo spaceInfo)
{
var spaceAddress = spaceConfig.GetSpaceAddress(spaceInfo.storeCode, spaceInfo.spaceCode);
IPlc _plc = _plcDictionary[spaceInfo.storeCode];
if (_plc != null)
_plcDictionary = _pool.GetAll();
if (_plcDictionary.Count > 0)
{
spaceInfo.spaceStock = _plc.readInt32ByAddress(spaceAddress.onStore);
spaceInfo.onRouteAmount = _plc.readInt32ByAddress(spaceAddress.onRoute);
// spaceInfo.spaceStatus = _plc.readInt32ByAddress(spaceAddress.spaceStatus);
IPlc _plc = _plcDictionary[spaceInfo.storeCode];
}
if (_plc != null)
{
spaceInfo.spaceStock = _plc.readInt32ByAddress(spaceAddress.onStore);
spaceInfo.onRouteAmount = _plc.readInt32ByAddress(spaceAddress.onRoute);
// spaceInfo.spaceStatus = _plc.readInt32ByAddress(spaceAddress.spaceStatus);
}
}
return spaceInfo;
}

@ -43,6 +43,7 @@ namespace Aucma.Scada.Business
{
//初始化Plc
plcPool.InitPlc("MelsecBinaryPlc", plcConfig.foam_Plc_Ip, plcConfig.foam_Plc_Port, appConfig.foamStoreCode);
plcPool.StartMelsecPlcAsync();
}
/// <summary>

@ -60,7 +60,7 @@ namespace Aucma.Scada.Business
/// <summary>
/// 字典存放PLC连接
/// </summary>
private Dictionary<string, IPlc> _plcDictionary = new Dictionary<string, IPlc>();
private static Dictionary<string, IPlc> _plcDictionary = new Dictionary<string, IPlc>();
@ -99,6 +99,7 @@ namespace Aucma.Scada.Business
RealTaskInfo task = GetTaskInfoByTaskStatus(appConfig.foamStoreCode).OrderBy(x => x.createTime).FirstOrDefault();
if(task != null)
{
_plcDictionary = _pool.GetAll();
if (_plcDictionary.Count > 0)
{
IPlc _plc = _plcDictionary[appConfig.foamStoreCode];
@ -156,6 +157,7 @@ namespace Aucma.Scada.Business
int result = 0;
try
{
_plcDictionary = _pool.GetAll();
IPlc _plc = _plcDictionary[taskInfo.storeCode];
if (_plc != null)
@ -202,6 +204,7 @@ namespace Aucma.Scada.Business
lock (string.Empty)
{
bool isFlag = true;
_plcDictionary = _pool.GetAll();
IPlc _plc = _plcDictionary[appConfig.foamStoreCode];
try
{
@ -257,6 +260,7 @@ namespace Aucma.Scada.Business
public BaseSpaceInfo ReadSpaceInfoByPlc(BaseSpaceInfo spaceInfo)
{
var spaceAddress = spaceConfig.GetSpaceAddress(spaceInfo.storeCode, spaceInfo.spaceCode);
_plcDictionary = _pool.GetAll();
IPlc _plc = _plcDictionary[spaceInfo.storeCode];
if (_plc != null)

@ -8,7 +8,7 @@ namespace Aucma.Scada.Business
/// <summary>
/// 注册服务
/// </summary>
internal sealed class RegisterServices
public sealed class RegisterServices
{
#region 单例实现
private static readonly Lazy<RegisterServices> lazy = new Lazy<RegisterServices>(() => new RegisterServices());

@ -57,6 +57,7 @@
<Compile Include="domain\RecordOutstore.cs" />
<Compile Include="domain\RecordProductfinish.cs" />
<Compile Include="domain\SysUserInfo.cs" />
<Compile Include="domain\WorkTime.cs" />
<Compile Include="dto\FoamStoreStockDto.cs" />
<Compile Include="dto\OperationType.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />

@ -5,7 +5,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Aucma.Scada.UI.Model
namespace Aucma.Scada.Model.domain
{
/// <summary>
///

@ -1 +1 @@
0950971ed41497fad7d277ed90ba33c6b3992ef2
c1df4a405465ec99296e7191ac19178349a56569

@ -100,7 +100,6 @@
<Compile Include="Converter\TaskInfo\TaskStatusConverter.cs" />
<Compile Include="Converter\TaskInfo\TaskTypeConverter.cs" />
<Compile Include="Model\typeGridModel.cs" />
<Compile Include="Model\WorkTime.cs" />
<Compile Include="Page\AssemblyPlan\AssemblyPlanControl.xaml.cs">
<DependentUpon>AssemblyPlanControl.xaml</DependentUpon>
</Compile>

@ -0,0 +1,14 @@
[plcSystem]
泡后PLCIP=127.0.0.1
泡后PLC端口=6000
[foam_inStore_address]
入库货道号=D7000
入库应答字=D7010
[foam_outStore_address]
出库货道号=D7100
出库数量=D7110
出库应答字=D7130
出库完成=D7120

@ -1 +1 @@
03944b5825fa0e59c458aa58e375ee42c7ce2f0f
f0687ef2739d6b9de0b1c9bfa00adaa2c57e1d99

@ -12,7 +12,7 @@ DEBUG;TRACE
E:\c#\AUCMA\最新代码整合\泡后库\foam\Aucma.Scada.UI\App.xaml
19-2058867325
1-1257182505
46975812225
451801671048
138-632958852
Page\AssemblyPlan\AssemblyPlanControl.xaml;Page\AssemblyPlan\PlanInfoEditWindow.xaml;Page\AssemblyPlan\QuantityIssuedWindow.xaml;Page\AssemblyPlan\SearchCriteriaWindow.xaml;Page\InStoreInfo\InStoreInfoControl.xaml;LogInfoControl.xaml;MainWindow.xaml;Page\InventoryInfo\BomFoamRearInventory.xaml;Page\InventoryInfo\InventoryInfoControl.xaml;Page\InventoryInfo\SelectType.xaml;Page\InventoryInfo\LinerInventory.xaml;Page\InventoryInfo\MaterialStatisticsWindow.xaml;Page\InventoryInfo\ShellInventory.xaml;Page\InventoryInfo\SpaceDetailWindow.xaml;Page\InventoryInfo\SpaceInfoControl.xaml;Page\OutStoreInfo\OutStoreInfoControl.xaml;Page\TaskInfo\TaskInfoControl.xaml;RecordControl.xaml;templates\style\resourceStyle.xaml;

@ -12,7 +12,7 @@ DEBUG;TRACE
E:\c#\AUCMA\最新代码整合\泡后库\foam\Aucma.Scada.UI\App.xaml
19-2058867325
1-1257182505
47-1397376950
46-571518127
138-632958852
Page\AssemblyPlan\AssemblyPlanControl.xaml;Page\AssemblyPlan\PlanInfoEditWindow.xaml;Page\AssemblyPlan\QuantityIssuedWindow.xaml;Page\AssemblyPlan\SearchCriteriaWindow.xaml;Page\InStoreInfo\InStoreInfoControl.xaml;LogInfoControl.xaml;MainWindow.xaml;Page\InventoryInfo\BomFoamRearInventory.xaml;Page\InventoryInfo\InventoryInfoControl.xaml;Page\InventoryInfo\SelectType.xaml;Page\InventoryInfo\LinerInventory.xaml;Page\InventoryInfo\MaterialStatisticsWindow.xaml;Page\InventoryInfo\ShellInventory.xaml;Page\InventoryInfo\SpaceDetailWindow.xaml;Page\InventoryInfo\SpaceInfoControl.xaml;Page\OutStoreInfo\OutStoreInfoControl.xaml;Page\TaskInfo\TaskInfoControl.xaml;RecordControl.xaml;templates\style\resourceStyle.xaml;

@ -32,14 +32,21 @@ namespace Aucma.Scada.UI.viewModel.AssemblyPlan
private StringChange stringChange = StringChange.Instance;
private RegisterServices registerServices = RegisterServices.Instance;
private OutStoreBusiness outStoreBusiness = OutStoreBusiness.Instance;
private readonly IBaseBomInfoService _baseBomInfoServices = null;
// 系统设定当班时间
public List<WorkTime> listTime = null;
public AssemblyPlanViewModel()
{
MoveUpCommand = new RelayCommand<object>(obj => MoveUp(obj));
MoveDownCommand = new RelayCommand<object>(obj => MoveDown(obj));
DeletePlanCommand = new RelayCommand<object>(obj => DeletePlan(obj));
NextPassCommand = new RelayCommand<object>(obj => NextPass(obj));
_baseBomInfoServices = registerServices.GetService<IBaseBomInfoService>();
listTime = _baseBomInfoServices.getWorkTime().Result;
PlanInfoEditCommand = new RelayCommand(PlanInfoEdit);
MaterialStatisticsCommand = new RelayCommand(MaterialStatistics);
@ -498,48 +505,57 @@ namespace Aucma.Scada.UI.viewModel.AssemblyPlan
/// <summary>
/// 刷新小时产量统计
/// </summary>
private void RefreshHourAmount()
private async Task RefreshHourAmount()
{
//获取小时产量
List<dynamic> hourAmount = assemblyPlanBusiness.GetHourAmount();
App.Current.Dispatcher.Invoke((Action)(() =>
{
await Task.Run(() =>
{
if (listTime == null)
{
listTime = _baseBomInfoServices.getWorkTime().Result;
if (listTime == null) return;
}
//获取小时产量
List<dynamic> hourAmount = assemblyPlanBusiness.GetHourAmount();
if (hourAmount != null)
{
Achievement.Clear();
ProductionHourList.Clear();
ProductionHourList.Clear();
ChartValues<ObservablePoint> hourAchievement = new ChartValues<ObservablePoint>();
int i = 0;
foreach (var item in hourAmount)
App.Current.Dispatcher.Invoke((Action)(() =>
{
if(DateTime.Now.Hour>=8 && DateTime.Now.Hour <= 20)//白班
ProductionHourList.Clear();
Achievement.Clear();
ChartValues<ObservablePoint> achievement = new ChartValues<ObservablePoint>();
// x轴
foreach (WorkTime workTime in listTime)
{
if (int.Parse(item.PRODUCT_HOUR) >= 8 && int.Parse(item.PRODUCT_HOUR) < 20)
{
ProductionHourList.Add(item.PRODUCT_HOUR);
hourAchievement.Add(new ObservablePoint(i++, Convert.ToDouble(item.PRODUCT_AMOUNT)));
}
ProductionHourList.Add(workTime.startTime.Hour.ToString());
}
else
// y轴
int i = 0;
foreach (string item in ProductionHourList)
{
if (int.Parse(item.PRODUCT_HOUR) < 8 || int.Parse(item.PRODUCT_HOUR) >= 20) //夜班
// achievement.Add(new ObservablePoint(i, 2));
var target = hourAmount.Where(x => int.Parse(x.PRODUCT_HOUR) == int.Parse(item)).FirstOrDefault();
if (target != null)
{
achievement.Add(new ObservablePoint(i, Convert.ToDouble(target.PRODUCT_AMOUNT)));
}
else
{
ProductionHourList.Add(item.PRODUCT_HOUR);
hourAchievement.Add(new ObservablePoint(i++, Convert.ToDouble(item.PRODUCT_AMOUNT)));
achievement.Add(new ObservablePoint(i, 0));
}
i++;
}
}
var houeColumn = new ColumnSeries();
houeColumn.DataLabels = true;
houeColumn.Title = "小时产量";
houeColumn.Values = hourAchievement;
houeColumn.Foreground = Brushes.White;
Achievement.Add(houeColumn);
var houeColumn = new ColumnSeries();
houeColumn.DataLabels = true;
houeColumn.Title = "小时产量";
houeColumn.Values = achievement;
houeColumn.Foreground = Brushes.White;
Achievement.Add(houeColumn);
}));
}
}));
});
}
}

@ -203,6 +203,8 @@ namespace Aucma.Scada.UI.viewModel.InStoreInfo
public RelayCommand ResetCommand { get; set; }
#endregion
private string lastMessage = "";
/// <summary>
/// listBox绑定日志
/// </summary>
@ -212,12 +214,18 @@ namespace Aucma.Scada.UI.viewModel.InStoreInfo
try
{
listItems.Add($"{DateTime.Now.ToString("HH:mm:ss.ss")}==>{message}");
while (listItems.Count > 120)
if (lastMessage != message)
{
listItems.RemoveAt(0);
listItems.Add($"{DateTime.Now.ToString("HH:mm:ss.ss")}==>{message}");
lastMessage = message;
while (listItems.Count > 120)
{
listItems.RemoveAt(0);
}
LogInfoListBox = listItems.OrderByDescending(x => x);
}
LogInfoListBox = listItems.OrderByDescending(x => x);
}
catch (Exception ex)
{

@ -299,7 +299,7 @@ namespace Aucma.Scada.UI.viewModel
/// <param name="e"></param>
public void RefreshPlc()
{
_plcDictionary = _pool.GetAll();
_plcDictionary = _pool.keyValuePairs;
// 箱壳状态
_plcDictionary.TryGetValue(appConfig.foamStoreCode, out IPlc _plc);
if (_plc != null)

@ -181,6 +181,8 @@ namespace Aucma.Scada.UI.viewModel.OutStoreInfo
public RelayCommand<object> DeleteTaskInfoCommand { get; set; }
#endregion
private string lastMessage = "";
/// <summary>
/// listBox绑定日志
/// </summary>
@ -190,14 +192,19 @@ namespace Aucma.Scada.UI.viewModel.OutStoreInfo
try
{
listItems.Add($"{DateTime.Now.ToString("HH:mm:ss.ss")}==>{message}");
if (lastMessage != message)
{
listItems.Add($"{DateTime.Now.ToString("HH:mm:ss.ss")}==>{message}");
lastMessage = message;
LogInfoListBox = listItems.OrderByDescending(x => x);
LogInfoListBox = listItems.OrderByDescending(x => x);
while (listItems.Count > 120)
{
listItems.RemoveAt(0);
}
while (listItems.Count > 120)
{
listItems.RemoveAt(0);
}
}
catch (Exception ex)
{

@ -58,6 +58,10 @@
<Project>{89a1edd9-d79e-468d-b6d3-7d07b8843562}</Project>
<Name>HighWayIot.Common</Name>
</ProjectReference>
<ProjectReference Include="..\HighWayIot.Config\HighWayIot.Config.csproj">
<Project>{75180EE5-13AE-499B-B0F6-C7BFEE1140CC}</Project>
<Name>HighWayIot.Config</Name>
</ProjectReference>
<ProjectReference Include="..\HighWayIot.Log4net\HighWayIot.Log4net.csproj">
<Project>{deabc30c-ec6f-472e-bd67-d65702fdaf74}</Project>
<Name>HighWayIot.Log4net</Name>

@ -1,9 +1,14 @@
namespace HighWayIot.Plc
using System.Threading.Tasks;
namespace HighWayIot.Plc
{
public interface IPlc
{
bool IsConnected { get; set; }
bool DisConnect();
/// <summary>
/// 建立连接
/// </summary>
@ -13,10 +18,10 @@
bool Connect(string IP, int port);
/// <summary>
/// 断开连接
/// 读取心跳
/// </summary>
/// <returns></returns>
bool DisConnect();
Task<bool> ReadHeart(string address);
/// <summary>
/// 通过地址和长度读取PLC数据

@ -3,6 +3,7 @@ using HighWayIot.Log4net;
using HslCommunication;
using HslCommunication.Profinet.Inovance;
using System;
using System.Threading.Tasks;
namespace HighWayIot.Plc.Impl
{
@ -483,5 +484,10 @@ namespace HighWayIot.Plc.Impl
return false;
}
}
public Task<bool> ReadHeart(string address)
{
throw new NotImplementedException();
}
}
}

@ -3,6 +3,7 @@ using HighWayIot.Log4net;
using HslCommunication;
using HslCommunication.Profinet.Melsec;
using System;
using System.Threading.Tasks;
namespace HighWayIot.Plc.Impl
{
@ -31,6 +32,48 @@ namespace HighWayIot.Plc.Impl
public bool IsConnected { get; set; }
/// <summary>
/// 读取心跳
/// </summary>
/// <returns></returns>
public async Task<bool> ReadHeart(string address)
{
try
{
melsec_net.ReceiveTimeOut = 2000;
OperateResult<bool> read = melsec_net.ReadBool(address);
if (read.IsSuccess)
{
IsConnected = true;
return true;
}
else
{
var k = read.ErrorCode < 0 ? false : true;
if (k)
{
IsConnected = true;
return await Task.FromResult(IsConnected);
}
else
{
IsConnected = false;
return await Task.FromResult(IsConnected);
}
}
}
catch (Exception ex)
{
log.Error("读取心跳方法异常" + ex.ToString());
}
return false;
}
/// <summary>
/// 建立连接
/// </summary>

@ -3,6 +3,7 @@ using HighWayIot.Log4net;
using HslCommunication;
using HslCommunication.Profinet.Omron;
using System;
using System.Threading.Tasks;
namespace HighWayIot.Plc.Impl
{
@ -440,5 +441,10 @@ namespace HighWayIot.Plc.Impl
return false;
}
}
public Task<bool> ReadHeart(string address)
{
throw new NotImplementedException();
}
}
}

@ -3,6 +3,7 @@ using HighWayIot.Log4net;
using HslCommunication;
using HslCommunication.Profinet.Siemens;
using System;
using System.Threading.Tasks;
namespace HighWayIot.Plc.Impl
{
@ -407,5 +408,10 @@ namespace HighWayIot.Plc.Impl
{
throw new NotImplementedException();
}
public Task<bool> ReadHeart(string address)
{
throw new NotImplementedException();
}
}
}

@ -1,12 +1,20 @@
using HighWayIot.Log4net;
using HighWayIot.Config;
using HighWayIot.Log4net;
using HighWayIot.Plc.Impl;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Timers;
namespace HighWayIot.Plc
{
public sealed class PlcPool
{
private AppConfig appConfig = AppConfig.Instance;
private PlcConfig plcConfig = PlcConfig.Instance;
private static readonly Lazy<PlcPool> lazy = new Lazy<PlcPool>(() => new PlcPool());
public static PlcPool Instance
{
@ -18,7 +26,7 @@ namespace HighWayIot.Plc
private LogHelper logHelper = LogHelper.Instance;
private Dictionary<string, IPlc> keyValuePairs = new Dictionary<string, IPlc>();
public Dictionary<string, IPlc> keyValuePairs = new Dictionary<string, IPlc>();
private PlcPool() { }
@ -29,32 +37,77 @@ namespace HighWayIot.Plc
/// <param name="ip"></param>
/// <param name="port"></param>
/// <param name="key"></param>
public void InitPlc(string plcType, string ip, int port, string key)
public async void InitPlc(string plcType, string ip, int port, string key)
{
IPlc _plc = null;
switch (plcType)
if (!keyValuePairs.ContainsKey(key))
{
case "InovancePlc":
_plc = new InovancePlc();
break;
case "MelsecBinaryPlc":
_plc = new MelsecBinaryPlc();
break;
case "OmronNJPlc":
_plc = new OmronNJPlc();
break;
case "SiemensPlc":
_plc = new SiemensPlc();
break;
default:
break;
IPlc _plc = null;
switch (plcType)
{
case "InovancePlc":
_plc = new InovancePlc();
break;
case "MelsecBinaryPlc":
_plc = new MelsecBinaryPlc();
break;
case "OmronNJPlc":
_plc = new OmronNJPlc();
break;
case "SiemensPlc":
_plc = new SiemensPlc();
break;
default:
break;
}
var connectResult = _plc.Connect(ip, port);
if (connectResult)
{
keyValuePairs.Add(key, _plc);
}
}
var connectResult = _plc.Connect(ip, port);
if (connectResult)
}
#region 心跳
public async Task StartMelsecPlcAsync()
{
System.Timers.Timer timer = new System.Timers.Timer(3000);
timer.Elapsed += new System.Timers.ElapsedEventHandler(ExecMelsecMcHeartTask); //到达时间的时候执行事件;
timer.AutoReset = true;//设置是执行一次false还是一直执行(true)
timer.Enabled = true;//需要调用 timer.Start()或者timer.Enabled = true来启动它
timer.Start();//timer.Start()的内部原理还是设置timer.Enabled = true;
await Task.CompletedTask;
}
private async void ExecMelsecMcHeartTask(object sender, ElapsedEventArgs e)
{
if (keyValuePairs.Count == 0)
{
keyValuePairs.Add(key, _plc);
this.InitPlc("MelsecBinaryPlc", plcConfig.foam_Plc_Ip, plcConfig.foam_Plc_Port, appConfig.foamStoreCode);
}
else
{
IPlc _plc = keyValuePairs[appConfig.foamStoreCode];
if (_plc != null)
{
var result = _plc.ReadHeart("M100").Result;
if (result)
{
logHelper.Info("PLC连接成功");
}
else
{
logHelper.Info("PLC连接失败");
keyValuePairs.Clear();
}
}
}
}
#endregion
/// <summary>
/// 获取PLC

@ -1 +1 @@
8183a0a9755b329030b4405e31ff3cdff26d35b0
6e3ce38cf36e2a7877b852157f0b0e1b49337179

@ -118,3 +118,5 @@ E:\c#\AUCMA\最新代码整合\泡后库\foam\HighWayIot.Plc\obj\Debug\HighWayIo
E:\c#\AUCMA\最新代码整合\泡后库\foam\HighWayIot.Plc\obj\Debug\HighWayIot.Plc.csproj.CopyComplete
E:\c#\AUCMA\最新代码整合\泡后库\foam\HighWayIot.Plc\obj\Debug\HighWayIot.Plc.dll
E:\c#\AUCMA\最新代码整合\泡后库\foam\HighWayIot.Plc\obj\Debug\HighWayIot.Plc.pdb
E:\c#\AUCMA\最新代码整合\泡后库\foam\HighWayIot.Plc\bin\Debug\HighWayIot.Config.dll
E:\c#\AUCMA\最新代码整合\泡后库\foam\HighWayIot.Plc\bin\Debug\HighWayIot.Config.pdb

@ -11,6 +11,13 @@ namespace HighWayIot.Repository.service
List<BaseBomInfo> GetBomInfos();
/// <summary>
/// 获取系统班组时间
/// </summary>
Task<List<WorkTime>> getWorkTime();
/// <summary>
/// 根据成品物料码获取自己BOM信息
/// </summary>

@ -3,6 +3,7 @@ using HighWayIot.Log4net;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace HighWayIot.Repository.service.Impl
{
@ -12,6 +13,27 @@ namespace HighWayIot.Repository.service.Impl
private LogHelper logHelper = LogHelper.Instance;
/// <summary>
/// 获取系统班组时间
/// </summary>
public async Task<List<WorkTime>> getWorkTime()
{
try
{
List<WorkTime> list = null;
var _db = _bomInfoRepository.Context;
list = await _db.SqlQueryable<WorkTime>("SELECT * FROM VIEW_CURRENT_TEAM_TIME ORDER BY START_TIME").ToListAsync();
return list;
}
catch (Exception)
{
return null;
}
}
public List<BaseBomInfo> GetBomInfos()
{
try

Loading…
Cancel
Save