wankeda
昨天 6cc35000a6e138cfad96e7b02f8aeddcdb4ba6bf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
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;
        }
    }
}