刘磊
10 天以前 2de09bec5cc05bf875543fa8956167ca7db73021
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
51
52
using WIDESEAWCS_BasicInfoRepository;
using WIDESEAWCS_Core;
using WIDESEAWCS_Core.BaseServices;
using WIDESEAWCS_ISystemServices;
using WIDESEAWCS_Model.Models;
 
namespace WIDESEAWCS_BasicInfoService
{
    public partial class Dt_StationManagerService : ServiceBase<Dt_StationManager, IDt_StationManagerRepository>, IDt_StationManagerService
    {
        private readonly ISys_ConfigService _sys_ConfigService;
 
        public Dt_StationManagerService(IDt_StationManagerRepository BaseDal, ISys_ConfigService sys_ConfigService) : base(BaseDal)
        {
            _sys_ConfigService = sys_ConfigService;
        }
 
        public WebResponseContent GetStation()
        {
            return WebResponseContent.Instance.OK(data: BaseDal.QueryData(x => x.stationRemark == "AGV放货站台").ToList());
        }
 
        public WebResponseContent UpdateStation(SaveModel saveModel)
        {
            WebResponseContent content = new WebResponseContent();
 
            try
            {
                string stationid = saveModel.MainData["stationid"].ToString();
 
                string stationLoc = stationid == "1" ? "2033" : "2043";
                Dt_StationManager dt_Station = BaseDal.QueryFirst(x => x.stationLocation == stationLoc);
 
                if (dt_Station.stationStatus == "0")
                {
                    dt_Station.stationStatus = "1";
                }
                else
                {
                    dt_Station.stationStatus = "0";
                }
                BaseDal.UpdateData(dt_Station);
                return content.OK();
            }
            catch (Exception ex)
            {
                return content.Error("错误信息:" + ex);
                throw;
            }
        }
    }
}