2024-04-09 08:17:44 +00:00
|
|
|
|
using InSituLaboratory.Entities;
|
|
|
|
|
|
using InSituLaboratory.IService;
|
|
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Linq;
|
2024-04-10 09:50:54 +00:00
|
|
|
|
using System.Reflection.Metadata.Ecma335;
|
2024-04-09 08:17:44 +00:00
|
|
|
|
using System.Text;
|
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
|
|
namespace InSituLaboratory.Service
|
|
|
|
|
|
{
|
|
|
|
|
|
public class DeviceService : BaseService, IDeviceSvice
|
|
|
|
|
|
{
|
|
|
|
|
|
public DeviceService(DbContext context) : base(context) { }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public IEnumerable<SysDevice> GetDevices()
|
|
|
|
|
|
{
|
|
|
|
|
|
return this.Set<SysDevice>();
|
|
|
|
|
|
}
|
2024-04-10 09:50:54 +00:00
|
|
|
|
|
2024-04-12 09:47:43 +00:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 根据设备名称查询预设工作时长
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="DeviceName"></param>
|
|
|
|
|
|
/// <returns></returns>
|
2024-04-10 09:50:54 +00:00
|
|
|
|
public string GetDeviceByDeviceName(string DeviceName)
|
|
|
|
|
|
{
|
|
|
|
|
|
var workTime = "";
|
|
|
|
|
|
var sysDevice = this.Query<SysDevice>(m=> m.DeviceName == DeviceName).ToList();
|
|
|
|
|
|
|
|
|
|
|
|
foreach (var item in sysDevice)
|
|
|
|
|
|
{
|
|
|
|
|
|
workTime = item.WorkTime;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return workTime;
|
|
|
|
|
|
}
|
2024-04-09 08:17:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|