Merge branch 'master' of https://gitea.mjm-staging.developers-homelab.net/BIMS/BIMS
This commit is contained in:
		
						commit
						bbc58e189f
					
				@ -182,12 +182,15 @@ namespace FrontendWebApi.ApiControllers
 | 
			
		||||
                foreach (var f in fl)
 | 
			
		||||
                {
 | 
			
		||||
                    List<DeviceLists> dl = new List<DeviceLists>();
 | 
			
		||||
                    sqlString = $@"select d.device_guid, d.full_name, d.device_coordinate, dk.device_image, d.device_number, dk.device_normal_flashing, dk.device_close_flashing, dk.device_error_flashing
 | 
			
		||||
                    sqlString = $@"select d.device_guid, d.full_name, d.device_coordinate, dk.device_image, d.device_number, 
 | 
			
		||||
				                                   dk.device_normal_point_id, dk.device_normal_point_guid, dk.device_normal_point_col, dk.device_normal_point_value, dk.device_normal_flashing, 
 | 
			
		||||
				                                   dk.device_close_point_id, dk.device_close_point_guid, dk.device_close_point_col, dk.device_close_point_value, dk.device_close_flashing, 
 | 
			
		||||
				                                   dk.device_error_point_id, dk.device_error_point_guid, dk.device_error_point_col, dk.device_error_point_value, dk.device_error_flashing
 | 
			
		||||
                                   from device d
 | 
			
		||||
                                   left join device_kind dk on d.device_building_tag = dk.device_building_tag and d.device_system_tag = dk.device_system_tag
 | 
			
		||||
					                                   and d.device_name_tag = dk.device_name_tag
 | 
			
		||||
                                   where d.deleted = 0 and d.device_system_tag = @sub_system_tag and d.device_building_tag = @building_tag and d.device_floor_tag = ifnull(@floor_tag, d.device_floor_tag)";
 | 
			
		||||
                    var dlParam = new { @main_system_tag = fd.main_system_tag, @building_tag = fd.building_tag, @floor_tag = fd.floor_tag };
 | 
			
		||||
			                                   and d.device_name_tag = dk.device_name_tag
 | 
			
		||||
                                   where d.deleted = 0 and d.device_name_tag = @sub_system_tag and d.device_building_tag = @building_tag and d.device_floor_tag = ifnull(@floor_tag, d.device_floor_tag)";
 | 
			
		||||
                    var dlParam = new { @sub_system_tag = fd.sub_system_tag, @building_tag = fd.building_tag, @floor_tag = fd.floor_tag };
 | 
			
		||||
                    dl = await backendRepository.GetAllAsync<DeviceLists>(sqlString, dlParam);
 | 
			
		||||
                    f.device_list = dl;
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
@ -7,6 +7,7 @@ namespace FrontendWebApi.Models
 | 
			
		||||
    public class FindDevice
 | 
			
		||||
    {
 | 
			
		||||
        public string main_system_tag { get; set; }
 | 
			
		||||
        public string sub_system_tag { get; set; }
 | 
			
		||||
        public string building_tag { get; set; }
 | 
			
		||||
        public string floor_tag { get; set; }
 | 
			
		||||
        public string device_guid { get; set; }
 | 
			
		||||
@ -35,22 +36,34 @@ namespace FrontendWebApi.Models
 | 
			
		||||
        public string device_coordinate { get; set; }
 | 
			
		||||
        public string device_coordinate_3d { get; set; }
 | 
			
		||||
        public string status { get; set; }
 | 
			
		||||
        public string device_status
 | 
			
		||||
        {
 | 
			
		||||
            get
 | 
			
		||||
            {
 | 
			
		||||
                Dictionary<string, string> name = new Dictionary<string, string>()
 | 
			
		||||
                {
 | 
			
		||||
                    { "0", "關閉"},
 | 
			
		||||
                    { "1", "正常"},
 | 
			
		||||
                    { "2", "異常"}
 | 
			
		||||
                };
 | 
			
		||||
                return name[status];
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        //public string device_status
 | 
			
		||||
        //{
 | 
			
		||||
        //    get
 | 
			
		||||
        //    {
 | 
			
		||||
        //        Dictionary<string, string> name = new Dictionary<string, string>()
 | 
			
		||||
        //        {
 | 
			
		||||
        //            { "0", "關閉"},
 | 
			
		||||
        //            { "1", "正常"},
 | 
			
		||||
        //            { "2", "異常"}
 | 
			
		||||
        //        };
 | 
			
		||||
        //        return name[status];
 | 
			
		||||
        //    }
 | 
			
		||||
        //}
 | 
			
		||||
        public string device_image { get; set; }
 | 
			
		||||
        public string device_normal_point_id { get; set; }
 | 
			
		||||
        public string device_normal_point_guid { get; set; }
 | 
			
		||||
        public string device_normal_point_col { get; set; }
 | 
			
		||||
        public string device_normal_point_value { get; set; }
 | 
			
		||||
        public string device_normal_flashing { get; set; }
 | 
			
		||||
        public string device_close_point_id { get; set; }
 | 
			
		||||
        public string device_close_point_guid { get; set; }
 | 
			
		||||
        public string device_close_point_col { get; set; }
 | 
			
		||||
        public string device_close_point_value { get; set; }
 | 
			
		||||
        public string device_close_flashing { get; set; }
 | 
			
		||||
        public string device_error_point_id { get; set; }
 | 
			
		||||
        public string device_error_point_guid { get; set; }
 | 
			
		||||
        public string device_error_point_col { get; set; }
 | 
			
		||||
        public string device_error_point_value { get; set; }
 | 
			
		||||
        public string device_error_flashing { get; set; }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user