[後端] 修改水電表列表 新增欄位
This commit is contained in:
		
							parent
							
								
									9058055e15
								
							
						
					
					
						commit
						1c88b3182e
					
				@ -71,6 +71,8 @@ namespace FrontendWebApi.ApiControllers
 | 
			
		||||
                    l.rawData.AddRange(
 | 
			
		||||
                        rawData.Where(x => x.device_number.Split("_")[0] == l.building_tag && x.device_number.Split("_")[2] == l.floor_tag && x.device_number.Split("_")[4] == l.device_serial_tag)
 | 
			
		||||
                    );
 | 
			
		||||
                    l.building_name = await backendRepository.GetOneAsync<string>("select full_name from building where building_tag = @building_tag and deleted = 0",
 | 
			
		||||
                                        new { building_tag = l.building_tag });
 | 
			
		||||
                    l.total = l.rawData.Count.ToString();
 | 
			
		||||
                    l.price = (await backendRepository.GetOneAsync<int>("select system_value from variable where system_type = 'MeterPrice' and deleted = 0")).ToString();
 | 
			
		||||
                    l.total_price = (l.rawData.Count * Int32.Parse(l.price)).ToString();
 | 
			
		||||
@ -139,6 +141,8 @@ namespace FrontendWebApi.ApiControllers
 | 
			
		||||
                    l.rawData.AddRange(
 | 
			
		||||
                        rawData.Where(x => x.device_number.Split("_")[0] == l.building_tag && x.device_number.Split("_")[2] == l.floor_tag && x.device_number.Split("_")[4] == l.device_serial_tag)
 | 
			
		||||
                    );
 | 
			
		||||
                    l.building_name = await backendRepository.GetOneAsync<string>("select full_name from building where building_tag = @building_tag and deleted = 0",
 | 
			
		||||
                                        new { building_tag = l.building_tag });
 | 
			
		||||
                    l.total = l.rawData.Count.ToString();
 | 
			
		||||
                    l.price = (await backendRepository.GetOneAsync<int>("select system_value from variable where system_type = 'WaterPrice' and deleted = 0")).ToString();
 | 
			
		||||
                    l.total_price = (l.rawData.Count * Int32.Parse(l.price)).ToString();
 | 
			
		||||
 | 
			
		||||
@ -19,6 +19,7 @@ namespace FrontendWebApi.Models
 | 
			
		||||
 | 
			
		||||
    public class HydroMeterOutput
 | 
			
		||||
    {
 | 
			
		||||
        public string building_name { get; set; }
 | 
			
		||||
        public string building_tag { get; set; }
 | 
			
		||||
        public string floor_tag { get; set; }
 | 
			
		||||
        public string device_serial_tag { get; set; }
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user