ningshuxia
2024-06-06 760fa87c2f6fb9e638bba889928bdc145394a534
IStation.Application/01-ch/03-schedule-config/ScheduleConfig_Controller.cs
@@ -10,7 +10,6 @@
    {
        private readonly Service.ScheduleConfig _service_schedule_config = new();
        /// <summary>
        /// 获取陈行调度配置
        /// </summary>
@@ -32,12 +31,11 @@
        [Route("Save")]
        [HttpPost]
        [NonUnify]
        public bool Save([Required] ChScheduleConfigInput input)
        public SaveChScheduleConfigOutput Save([Required] ChScheduleConfigInput input)
        {
            if (input == null)
            {
                Yw.Dto.YOops.Oh(Yw.Dto.eResultCode.Error, Yw.Dto.InternalErrorCodes.A001, "入参不能为空!");
                return false;
                return new SaveChScheduleConfigOutput() { Result = false, Msg = "入参不能为空!" };
            }
            var receipt_time = DateTime.Now;
@@ -49,8 +47,49 @@
            var model = input.Adapt<ChScheduleConfigInput, Model.ChScheduleConfig>();
            var bol = _service_schedule_config.Save(model);
            Log.Info(request_id, log_title, bol.ToString());  
            return bol;
            return new SaveChScheduleConfigOutput() { Result = true, Msg = "保存成功!" };
        }
        /// <summary>
        /// Test
        /// </summary>
        [Route("Test")]
        [HttpGet]
        [NonUnify]
        public ChScheduleConfigDto Test()
        {
            var model = _service_schedule_config.Get();
            model.Station1.MustOpenFlagList = new List<int>() { 11, 12 };
            model.Station1.MustCloseFlagList = new List<int>() { 13 };
            model.Station1.AssociativeFlagCombineList = new List<List<int>>()
            {
                new List<int>(){14,15}
            };
            model.Station1.WaterSupplyLimitList = new List<IStation.Model.WaterSupplyLimit>()
            {
                new Model.WaterSupplyLimit()
                {
                    Min=10500,
                    Max=15000,
                    PumpCount=3
                },
                new Model.WaterSupplyLimit()
                {
                    Min=15500,
                    Max=20000,
                    PumpCount=4
                },
                new Model.WaterSupplyLimit()
                {
                    Min=20000,
                    Max=27000,
                    PumpCount=5
                },
            };
            var dto = model.Adapt<Model.ChScheduleConfig, ChScheduleConfigDto>();
            return dto;
        }
    }
}