Merge branch 'master' of https://gitea.mjm-staging.developers-homelab.net/BIMS/BIMS
This commit is contained in:
		
						commit
						92682051a4
					
				@ -67,7 +67,6 @@ namespace FrontendWebApi.ApiControllers
 | 
				
			|||||||
                    }
 | 
					                    }
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
                apiResult.Code = "0000";
 | 
					                apiResult.Code = "0000";
 | 
				
			||||||
                apiResult.Data = lightDevices;
 | 
					                apiResult.Data = lightDevices;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
@ -88,7 +87,7 @@ namespace FrontendWebApi.ApiControllers
 | 
				
			|||||||
            try
 | 
					            try
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                // Operation_log 輸入參數
 | 
					                // Operation_log 輸入參數
 | 
				
			||||||
                OperationInput opeInput = new OperationInput() { operation_type = 2 };
 | 
					                OperationLog opeInput = new OperationLog() { operation_type = 2 };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                // 取得對應樓層資料
 | 
					                // 取得對應樓層資料
 | 
				
			||||||
                var targetFloor = await backendRepository.GetOneAsync<Floor>($@"
 | 
					                var targetFloor = await backendRepository.GetOneAsync<Floor>($@"
 | 
				
			||||||
@ -138,8 +137,8 @@ namespace FrontendWebApi.ApiControllers
 | 
				
			|||||||
                        ScheduleDevices.Add(ScheduleDevice);
 | 
					                        ScheduleDevices.Add(ScheduleDevice);
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                    opeInput.parameter = JsonConvert.SerializeObject(saveSchedule);
 | 
					                    opeInput.parameter = JsonConvert.SerializeObject(saveSchedule);
 | 
				
			||||||
 | 
					 | 
				
			||||||
                    await backendRepository.AddMutiByCustomTable(ScheduleDevices, "schedule_device");
 | 
					                    await backendRepository.AddMutiByCustomTable(ScheduleDevices, "schedule_device");
 | 
				
			||||||
 | 
					                    saveSchedule.light_schedule_guid = newguid.ToString();
 | 
				
			||||||
                    await InsertOperation(opeInput);
 | 
					                    await InsertOperation(opeInput);
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                else
 | 
					                else
 | 
				
			||||||
@ -364,7 +363,7 @@ namespace FrontendWebApi.ApiControllers
 | 
				
			|||||||
            return Ok(apiResult);
 | 
					            return Ok(apiResult);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public async Task<bool> InsertOperation(OperationInput input)
 | 
					        public async Task<bool> InsertOperation(OperationLog input)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            try
 | 
					            try
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
@ -379,7 +378,7 @@ namespace FrontendWebApi.ApiControllers
 | 
				
			|||||||
                            { "@floor_tag", input.floor_tag },
 | 
					                            { "@floor_tag", input.floor_tag },
 | 
				
			||||||
                            { "@device_guid", input.device_guid },
 | 
					                            { "@device_guid", input.device_guid },
 | 
				
			||||||
                            { "@action_name", input.action_name  },
 | 
					                            { "@action_name", input.action_name  },
 | 
				
			||||||
                            { "@parameter", JsonConvert.SerializeObject(input.parameter) },
 | 
					                            { "@parameter", input.parameter },
 | 
				
			||||||
                        };
 | 
					                        };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                await backendRepository.AddOneByCustomTable(userOperatorLog, "operation_log");
 | 
					                await backendRepository.AddOneByCustomTable(userOperatorLog, "operation_log");
 | 
				
			||||||
 | 
				
			|||||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										1469
									
								
								FrontendWebApi/ApiControllers/OperationLogController.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1469
									
								
								FrontendWebApi/ApiControllers/OperationLogController.cs
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@ -139,7 +139,7 @@ namespace FrontendWebApi.Models
 | 
				
			|||||||
        public DateTime? enddate { get; set; }
 | 
					        public DateTime? enddate { get; set; }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public class OperationInput
 | 
					    public class OperationLog
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        public int id { get; set; }
 | 
					        public int id { get; set; }
 | 
				
			||||||
        public string user_guid { get; set;}
 | 
					        public string user_guid { get; set;}
 | 
				
			||||||
@ -156,5 +156,17 @@ namespace FrontendWebApi.Models
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public class OperationLogOutput : OperationLog { 
 | 
				
			||||||
 | 
					        public string user_name { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public string content { get; set; }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public class OperationLogInput { 
 | 
				
			||||||
 | 
					        public string start_time { get; set; }
 | 
				
			||||||
 | 
					        public string end_time { get; set; }
 | 
				
			||||||
 | 
					        public string building_tag{ get; set; }
 | 
				
			||||||
 | 
					        public short operation_type { get; set; }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
   
 | 
					   
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -283,4 +283,16 @@ namespace FrontendWebApi.Models
 | 
				
			|||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public class BasePageResult {
 | 
				
			||||||
 | 
					        public int? pageSize { get; set; } = 10;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public int? totalPage { get; set; } = 0;
 | 
				
			||||||
 | 
					        public int? currentPage { get; set; } = 0;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public class PageResult<T> : BasePageResult
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        public T data { get; set; }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user