using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Text;
|
using System.Threading.Tasks;
|
using Newtonsoft.Json;
|
using OfficeOpenXml.FormulaParsing.Excel.Functions.Text;
|
using SqlSugar.Extensions;
|
using WIDESEAWCS_Core;
|
using WIDESEAWCS_Core.BaseServices;
|
using WIDESEAWCS_ISystemRepository;
|
using WIDESEAWCS_ISystemServices;
|
using WIDESEAWCS_Model.Models;
|
|
namespace WIDESEAWCS_SystemServices
|
{
|
|
public class Dt_StationinfoService : ServiceBase<Dt_Stationinfo, IDt_StationinfoRepository>, IDt_StationinfoService
|
{
|
public class Parm
|
{
|
public List<string> data { get; set; }
|
public bool type { get; set; }
|
}
|
public Dt_StationinfoService(IDt_StationinfoRepository BaseDal) : base(BaseDal)
|
{
|
}
|
|
public WebResponseContent SetStationEnable(object parm)
|
{
|
WebResponseContent content = new WebResponseContent();
|
try
|
{
|
var data = JsonConvert.DeserializeObject<Parm>(parm.ToString());
|
var res = BaseDal.QueryFirst(x => data.data.Contains(x.Id.ToString()));
|
res.Enable = data.type.ObjToBool();
|
var isTrue = BaseDal.UpdateData(res);
|
if (isTrue)
|
{
|
content.OK("缓存架状态更新成功");
|
}
|
}
|
catch (Exception ex)
|
{
|
content.Error(ex.Message);
|
}
|
return content;
|
}
|
}
|
}
|