bgService: 開啟停車場服務更新功能
This commit is contained in:
		
							parent
							
								
									a539c8148c
								
							
						
					
					
						commit
						9e5bdb2ea5
					
				@ -122,10 +122,10 @@ namespace BackendWorkerService
 | 
			
		||||
                    //#endregion
 | 
			
		||||
 | 
			
		||||
                    //#region 停車場管理(設定每 5秒 執行一次)
 | 
			
		||||
                    //services.AddSingleton<ParkingJob>();
 | 
			
		||||
                    //services.AddSingleton(
 | 
			
		||||
                    //new JobSchedule(jobType: typeof(ParkingJob), cronExpression: configuration.GetValue<string>("BackgroundServiceCron:ParkingJob"))
 | 
			
		||||
                    //);
 | 
			
		||||
                    services.AddSingleton<ParkingJob>();
 | 
			
		||||
                    services.AddSingleton(
 | 
			
		||||
                    new JobSchedule(jobType: typeof(ParkingJob), cronExpression: configuration.GetValue<string>("BackgroundServiceCron:ParkingJob"))
 | 
			
		||||
                    );
 | 
			
		||||
                    //#endregion
 | 
			
		||||
 | 
			
		||||
                    //#region 電錶歸檔(設定每 小時 執行一次)
 | 
			
		||||
 | 
			
		||||
@ -82,7 +82,7 @@ namespace BackendWorkerService.Quartz.Jobs
 | 
			
		||||
                            var spaceResponseResult = JsonConvert.DeserializeObject<SpaceResponse>(spaceResponseContent);
 | 
			
		||||
 | 
			
		||||
                            //取得停車場車位對應表
 | 
			
		||||
                            var sqlSapceMapping = $@"SELECT * FROM variable WHERE deleted = 0 AND system_type = 'parkingSapceMapping'";
 | 
			
		||||
                            var sqlSapceMapping = $@" SELECT * FROM variable WHERE deleted = 0 AND system_type = 'parkingSapceMapping'";
 | 
			
		||||
                            var parkingSapceMapping = await backgroundServiceRepository.GetAllAsync<VariableInfo>(sqlSapceMapping);
 | 
			
		||||
 | 
			
		||||
                            if (spaceResponseResult != null && spaceResponseResult.Code == "20000")
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user