This commit is contained in:
2026-04-30 15:26:05 +08:00
parent 5559ee0673
commit b42bee48ea
63 changed files with 6735 additions and 0 deletions

View File

View File

@@ -0,0 +1,2 @@
16:03:49.133 [restartedMain] DEBUG c.m.MiddlePlatformApplication - [logStarting,56] - Running with Spring Boot v2.5.14, Spring v5.3.20
16:03:49.155 [restartedMain] DEBUG c.m.MiddlePlatformApplication - [logStarting,56] - Running with Spring Boot v2.5.14, Spring v5.3.20

View File

@@ -0,0 +1,135 @@
13:32:39.329 [restartedMain] DEBUG c.m.MiddlePlatformApplication - [logStarting,56] - Running with Spring Boot v2.5.14, Spring v5.3.20
13:32:39.337 [restartedMain] DEBUG c.m.MiddlePlatformApplication - [logStarting,56] - Running with Spring Boot v2.5.14, Spring v5.3.20
13:32:39.732 [restartedMain] DEBUG c.m.MiddlePlatformApplication - [logStarting,56] - Running with Spring Boot v2.5.14, Spring v5.3.20
13:32:39.738 [restartedMain] DEBUG c.m.MiddlePlatformApplication - [logStarting,56] - Running with Spring Boot v2.5.14, Spring v5.3.20
13:32:41.994 [restartedMain] DEBUG c.m.m.S.selectConfigList - [debug,137] - ==> Preparing: select config_id, config_name, config_key, config_value, config_type, create_by, create_time, update_by, update_time, remark from sys_config
13:32:41.995 [restartedMain] DEBUG c.m.m.S.selectConfigList - [debug,137] - ==> Parameters:
13:32:42.007 [restartedMain] DEBUG c.m.m.S.selectConfigList - [debug,137] - <== Total: 0
13:32:42.021 [restartedMain] DEBUG c.m.m.S.selectConfigList - [debug,137] - ==> Preparing: select config_id, config_name, config_key, config_value, config_type, create_by, create_time, update_by, update_time, remark from sys_config
13:32:42.023 [restartedMain] DEBUG c.m.m.S.selectConfigList - [debug,137] - ==> Parameters:
13:32:42.032 [restartedMain] DEBUG c.m.m.S.selectConfigList - [debug,137] - <== Total: 0
13:32:42.194 [restartedMain] DEBUG c.m.s.f.JwtAuthenticationTokenFilter - [init,242] - Filter 'jwtAuthenticationTokenFilter' configured for use
13:32:42.311 [restartedMain] DEBUG c.m.s.f.JwtAuthenticationTokenFilter - [init,242] - Filter 'jwtAuthenticationTokenFilter' configured for use
13:32:42.526 [restartedMain] DEBUG c.m.m.S.selectDictDataListAll - [debug,137] - ==> Preparing: select d.dict_code, d.dict_sort, d.dict_label, t.zh_cn as dict_label_zh_cn, t.en_us as dict_label_en_us, d.dict_value, d.dict_type, d.css_class, d.list_class, d.is_default, d.status, d.create_by, d.create_time, d.remark from sys_dict_data d left join sys_dict_data_translate t on d.dict_code = t.id WHERE d.status = ? order by d.dict_sort asc
13:32:42.531 [restartedMain] DEBUG c.m.m.S.selectDictDataListAll - [debug,137] - ==> Parameters: 0(String)
13:32:42.535 [restartedMain] DEBUG c.m.m.S.selectDictDataListAll - [debug,137] - <== Total: 0
13:32:42.642 [restartedMain] DEBUG c.m.m.S.selectConfigList - [debug,137] - ==> Preparing: select config_id, config_name, config_key, config_value, config_type, create_by, create_time, update_by, update_time, remark from sys_config
13:32:42.642 [restartedMain] DEBUG c.m.m.S.selectConfigList - [debug,137] - ==> Parameters:
13:32:42.664 [restartedMain] DEBUG c.m.m.S.selectConfigList - [debug,137] - <== Total: 0
13:32:42.672 [restartedMain] DEBUG c.m.m.S.selectDictDataListAll - [debug,137] - ==> Preparing: select d.dict_code, d.dict_sort, d.dict_label, t.zh_cn as dict_label_zh_cn, t.en_us as dict_label_en_us, d.dict_value, d.dict_type, d.css_class, d.list_class, d.is_default, d.status, d.create_by, d.create_time, d.remark from sys_dict_data d left join sys_dict_data_translate t on d.dict_code = t.id WHERE d.status = ? order by d.dict_sort asc
13:32:42.676 [restartedMain] DEBUG c.m.m.S.selectDictDataListAll - [debug,137] - ==> Parameters: 0(String)
13:32:42.677 [restartedMain] DEBUG c.m.m.S.selectDictDataListAll - [debug,137] - <== Total: 0
13:32:42.835 [restartedMain] DEBUG c.m.m.S.selectConfigList - [debug,137] - ==> Preparing: select config_id, config_name, config_key, config_value, config_type, create_by, create_time, update_by, update_time, remark from sys_config
13:32:42.836 [restartedMain] DEBUG c.m.m.S.selectConfigList - [debug,137] - ==> Parameters:
13:32:42.850 [restartedMain] DEBUG c.m.m.S.selectConfigList - [debug,137] - <== Total: 0
13:32:42.928 [restartedMain] DEBUG c.m.s.f.JwtAuthenticationTokenFilter - [init,242] - Filter 'jwtAuthenticationTokenFilter' configured for use
13:32:43.140 [restartedMain] DEBUG c.m.s.f.JwtAuthenticationTokenFilter - [init,242] - Filter 'jwtAuthenticationTokenFilter' configured for use
13:32:43.429 [restartedMain] DEBUG c.m.m.S.selectDictDataListAll - [debug,137] - ==> Preparing: select d.dict_code, d.dict_sort, d.dict_label, t.zh_cn as dict_label_zh_cn, t.en_us as dict_label_en_us, d.dict_value, d.dict_type, d.css_class, d.list_class, d.is_default, d.status, d.create_by, d.create_time, d.remark from sys_dict_data d left join sys_dict_data_translate t on d.dict_code = t.id WHERE d.status = ? order by d.dict_sort asc
13:32:43.434 [restartedMain] DEBUG c.m.m.S.selectDictDataListAll - [debug,137] - ==> Parameters: 0(String)
13:32:43.438 [restartedMain] DEBUG c.m.m.S.selectDictDataListAll - [debug,137] - <== Total: 0
13:32:43.611 [restartedMain] DEBUG c.m.m.S.selectDictDataListAll - [debug,137] - ==> Preparing: select d.dict_code, d.dict_sort, d.dict_label, t.zh_cn as dict_label_zh_cn, t.en_us as dict_label_en_us, d.dict_value, d.dict_type, d.css_class, d.list_class, d.is_default, d.status, d.create_by, d.create_time, d.remark from sys_dict_data d left join sys_dict_data_translate t on d.dict_code = t.id WHERE d.status = ? order by d.dict_sort asc
13:32:43.612 [restartedMain] DEBUG c.m.m.S.selectDictDataListAll - [debug,137] - ==> Parameters: 0(String)
13:32:43.613 [restartedMain] DEBUG c.m.m.S.selectDictDataListAll - [debug,137] - <== Total: 0
13:32:46.939 [restartedMain] DEBUG c.m.m.D.selectList - [debug,137] - ==> Preparing: SELECT id,device_id,plan_name,task_staus,route_id,user_id,device_task_plan_rules,create_time,create_by,update_time,update_by,finish_time,start_time,del_flag FROM iot_device_plan WHERE (task_staus IN (?,?,?))
13:32:46.940 [restartedMain] DEBUG c.m.m.D.selectList - [debug,137] - ==> Parameters: NEW(String), EXECUTING(String), PAUSE(String)
13:32:46.941 [restartedMain] DEBUG c.m.m.D.selectList - [debug,137] - <== Total: 0
13:32:46.945 [deviceErrorMonitor1] DEBUG c.m.m.E.selectList - [debug,137] - ==> Preparing: SELECT id,field,compare_values,compare_type,error_description,error_name FROM error_identification
13:32:46.946 [deviceErrorMonitor1] DEBUG c.m.m.E.selectList - [debug,137] - ==> Parameters:
13:32:46.948 [deviceErrorMonitor1] DEBUG c.m.m.E.selectList - [debug,137] - <== Total: 0
13:32:47.193 [restartedMain] DEBUG c.m.m.I.selectList - [debug,137] - ==> Preparing: SELECT id,device_id,secret_id FROM iotda_device_secret WHERE (device_id = ?)
13:32:47.194 [restartedMain] DEBUG c.m.m.I.selectList - [debug,137] - ==> Parameters: 698551ef7f2e6c302f519144_MC700AIR-CN-JS-1776666493435-0000000A-ED(String)
13:32:47.196 [restartedMain] DEBUG c.m.m.I.selectList - [debug,137] - <== Total: 0
13:50:53.705 [restartedMain] DEBUG c.m.MiddlePlatformApplication - [logStarting,56] - Running with Spring Boot v2.5.14, Spring v5.3.20
13:50:53.713 [restartedMain] DEBUG c.m.MiddlePlatformApplication - [logStarting,56] - Running with Spring Boot v2.5.14, Spring v5.3.20
13:50:53.753 [restartedMain] DEBUG c.m.MiddlePlatformApplication - [logStarting,56] - Running with Spring Boot v2.5.14, Spring v5.3.20
13:50:53.762 [restartedMain] DEBUG c.m.MiddlePlatformApplication - [logStarting,56] - Running with Spring Boot v2.5.14, Spring v5.3.20
13:50:53.844 [restartedMain] DEBUG c.m.MiddlePlatformApplication - [logStarting,56] - Running with Spring Boot v2.5.14, Spring v5.3.20
13:51:04.352 [restartedMain] DEBUG c.m.m.S.selectConfigList - [debug,137] - ==> Preparing: select config_id, config_name, config_key, config_value, config_type, create_by, create_time, update_by, update_time, remark from sys_config
13:51:04.353 [restartedMain] DEBUG c.m.m.S.selectConfigList - [debug,137] - ==> Parameters:
13:51:04.358 [restartedMain] DEBUG c.m.m.S.selectConfigList - [debug,137] - <== Total: 0
13:51:04.773 [restartedMain] DEBUG c.m.s.f.JwtAuthenticationTokenFilter - [init,242] - Filter 'jwtAuthenticationTokenFilter' configured for use
13:51:05.078 [restartedMain] DEBUG c.m.m.S.selectDictDataListAll - [debug,137] - ==> Preparing: select d.dict_code, d.dict_sort, d.dict_label, t.zh_cn as dict_label_zh_cn, t.en_us as dict_label_en_us, d.dict_value, d.dict_type, d.css_class, d.list_class, d.is_default, d.status, d.create_by, d.create_time, d.remark from sys_dict_data d left join sys_dict_data_translate t on d.dict_code = t.id WHERE d.status = ? order by d.dict_sort asc
13:51:05.079 [restartedMain] DEBUG c.m.m.S.selectDictDataListAll - [debug,137] - ==> Parameters: 0(String)
13:51:05.086 [restartedMain] DEBUG c.m.m.S.selectDictDataListAll - [debug,137] - <== Total: 0
13:51:08.446 [restartedMain] DEBUG c.m.m.S.selectConfigList - [debug,137] - ==> Preparing: select config_id, config_name, config_key, config_value, config_type, create_by, create_time, update_by, update_time, remark from sys_config
13:51:08.447 [restartedMain] DEBUG c.m.m.S.selectConfigList - [debug,137] - ==> Parameters:
13:51:08.455 [restartedMain] DEBUG c.m.m.S.selectConfigList - [debug,137] - <== Total: 0
13:51:08.850 [restartedMain] DEBUG c.m.s.f.JwtAuthenticationTokenFilter - [init,242] - Filter 'jwtAuthenticationTokenFilter' configured for use
13:51:09.793 [restartedMain] DEBUG c.m.m.S.selectConfigList - [debug,137] - ==> Preparing: select config_id, config_name, config_key, config_value, config_type, create_by, create_time, update_by, update_time, remark from sys_config
13:51:09.795 [restartedMain] DEBUG c.m.m.S.selectConfigList - [debug,137] - ==> Parameters:
13:51:09.813 [restartedMain] DEBUG c.m.m.S.selectConfigList - [debug,137] - <== Total: 0
13:51:09.829 [restartedMain] DEBUG c.m.m.S.selectDictDataListAll - [debug,137] - ==> Preparing: select d.dict_code, d.dict_sort, d.dict_label, t.zh_cn as dict_label_zh_cn, t.en_us as dict_label_en_us, d.dict_value, d.dict_type, d.css_class, d.list_class, d.is_default, d.status, d.create_by, d.create_time, d.remark from sys_dict_data d left join sys_dict_data_translate t on d.dict_code = t.id WHERE d.status = ? order by d.dict_sort asc
13:51:09.830 [restartedMain] DEBUG c.m.m.S.selectDictDataListAll - [debug,137] - ==> Parameters: 0(String)
13:51:09.834 [restartedMain] DEBUG c.m.m.S.selectDictDataListAll - [debug,137] - <== Total: 0
13:51:10.189 [restartedMain] DEBUG c.m.m.S.selectConfigList - [debug,137] - ==> Preparing: select config_id, config_name, config_key, config_value, config_type, create_by, create_time, update_by, update_time, remark from sys_config
13:51:10.190 [restartedMain] DEBUG c.m.m.S.selectConfigList - [debug,137] - ==> Parameters:
13:51:10.199 [restartedMain] DEBUG c.m.m.S.selectConfigList - [debug,137] - <== Total: 0
13:51:10.255 [restartedMain] DEBUG c.m.m.S.selectConfigList - [debug,137] - ==> Preparing: select config_id, config_name, config_key, config_value, config_type, create_by, create_time, update_by, update_time, remark from sys_config
13:51:10.256 [restartedMain] DEBUG c.m.m.S.selectConfigList - [debug,137] - ==> Parameters:
13:51:10.262 [restartedMain] DEBUG c.m.m.S.selectConfigList - [debug,137] - <== Total: 0
13:51:10.395 [restartedMain] DEBUG c.m.m.S.selectConfigList - [debug,137] - ==> Preparing: select config_id, config_name, config_key, config_value, config_type, create_by, create_time, update_by, update_time, remark from sys_config
13:51:10.399 [restartedMain] DEBUG c.m.m.S.selectConfigList - [debug,137] - ==> Parameters:
13:51:10.409 [restartedMain] DEBUG c.m.m.S.selectConfigList - [debug,137] - <== Total: 0
13:51:10.492 [restartedMain] DEBUG c.m.m.S.selectConfigList - [debug,137] - ==> Preparing: select config_id, config_name, config_key, config_value, config_type, create_by, create_time, update_by, update_time, remark from sys_config
13:51:10.493 [restartedMain] DEBUG c.m.m.S.selectConfigList - [debug,137] - ==> Parameters:
13:51:10.501 [restartedMain] DEBUG c.m.m.S.selectConfigList - [debug,137] - <== Total: 0
13:51:10.628 [restartedMain] DEBUG c.m.s.f.JwtAuthenticationTokenFilter - [init,242] - Filter 'jwtAuthenticationTokenFilter' configured for use
13:51:10.702 [restartedMain] DEBUG c.m.m.S.selectConfigList - [debug,137] - ==> Preparing: select config_id, config_name, config_key, config_value, config_type, create_by, create_time, update_by, update_time, remark from sys_config
13:51:10.703 [restartedMain] DEBUG c.m.m.S.selectConfigList - [debug,137] - ==> Parameters:
13:51:10.709 [restartedMain] DEBUG c.m.m.S.selectConfigList - [debug,137] - <== Total: 0
13:51:10.750 [restartedMain] DEBUG c.m.m.S.selectConfigList - [debug,137] - ==> Preparing: select config_id, config_name, config_key, config_value, config_type, create_by, create_time, update_by, update_time, remark from sys_config
13:51:10.750 [restartedMain] DEBUG c.m.m.S.selectConfigList - [debug,137] - ==> Parameters:
13:51:10.756 [restartedMain] DEBUG c.m.m.S.selectConfigList - [debug,137] - <== Total: 0
13:51:10.783 [restartedMain] DEBUG c.m.m.S.selectConfigList - [debug,137] - ==> Preparing: select config_id, config_name, config_key, config_value, config_type, create_by, create_time, update_by, update_time, remark from sys_config
13:51:10.783 [restartedMain] DEBUG c.m.s.f.JwtAuthenticationTokenFilter - [init,242] - Filter 'jwtAuthenticationTokenFilter' configured for use
13:51:10.783 [restartedMain] DEBUG c.m.m.S.selectConfigList - [debug,137] - ==> Parameters:
13:51:10.791 [restartedMain] DEBUG c.m.m.S.selectConfigList - [debug,137] - <== Total: 0
13:51:10.897 [restartedMain] DEBUG c.m.s.f.JwtAuthenticationTokenFilter - [init,242] - Filter 'jwtAuthenticationTokenFilter' configured for use
13:51:11.003 [restartedMain] DEBUG c.m.s.f.JwtAuthenticationTokenFilter - [init,242] - Filter 'jwtAuthenticationTokenFilter' configured for use
13:51:11.015 [restartedMain] DEBUG c.m.s.f.JwtAuthenticationTokenFilter - [init,242] - Filter 'jwtAuthenticationTokenFilter' configured for use
13:51:11.271 [restartedMain] DEBUG c.m.m.S.selectConfigList - [debug,137] - ==> Preparing: select config_id, config_name, config_key, config_value, config_type, create_by, create_time, update_by, update_time, remark from sys_config
13:51:11.272 [restartedMain] DEBUG c.m.m.S.selectConfigList - [debug,137] - ==> Parameters:
13:51:11.284 [restartedMain] DEBUG c.m.m.S.selectConfigList - [debug,137] - <== Total: 0
13:51:11.287 [restartedMain] DEBUG c.m.s.f.JwtAuthenticationTokenFilter - [init,242] - Filter 'jwtAuthenticationTokenFilter' configured for use
13:51:11.412 [restartedMain] DEBUG c.m.s.f.JwtAuthenticationTokenFilter - [init,242] - Filter 'jwtAuthenticationTokenFilter' configured for use
13:51:11.485 [restartedMain] DEBUG c.m.s.f.JwtAuthenticationTokenFilter - [init,242] - Filter 'jwtAuthenticationTokenFilter' configured for use
13:51:11.546 [restartedMain] DEBUG c.m.m.S.selectDictDataListAll - [debug,137] - ==> Preparing: select d.dict_code, d.dict_sort, d.dict_label, t.zh_cn as dict_label_zh_cn, t.en_us as dict_label_en_us, d.dict_value, d.dict_type, d.css_class, d.list_class, d.is_default, d.status, d.create_by, d.create_time, d.remark from sys_dict_data d left join sys_dict_data_translate t on d.dict_code = t.id WHERE d.status = ? order by d.dict_sort asc
13:51:11.547 [restartedMain] DEBUG c.m.m.S.selectDictDataListAll - [debug,137] - ==> Parameters: 0(String)
13:51:11.550 [restartedMain] DEBUG c.m.m.S.selectDictDataListAll - [debug,137] - <== Total: 0
13:51:11.701 [restartedMain] DEBUG c.m.m.S.selectDictDataListAll - [debug,137] - ==> Preparing: select d.dict_code, d.dict_sort, d.dict_label, t.zh_cn as dict_label_zh_cn, t.en_us as dict_label_en_us, d.dict_value, d.dict_type, d.css_class, d.list_class, d.is_default, d.status, d.create_by, d.create_time, d.remark from sys_dict_data d left join sys_dict_data_translate t on d.dict_code = t.id WHERE d.status = ? order by d.dict_sort asc
13:51:11.702 [restartedMain] DEBUG c.m.m.S.selectDictDataListAll - [debug,137] - ==> Parameters: 0(String)
13:51:11.703 [restartedMain] DEBUG c.m.m.S.selectDictDataListAll - [debug,137] - <== Total: 0
13:51:11.786 [restartedMain] DEBUG c.m.s.f.JwtAuthenticationTokenFilter - [init,242] - Filter 'jwtAuthenticationTokenFilter' configured for use
13:51:11.813 [restartedMain] DEBUG c.m.m.S.selectDictDataListAll - [debug,137] - ==> Preparing: select d.dict_code, d.dict_sort, d.dict_label, t.zh_cn as dict_label_zh_cn, t.en_us as dict_label_en_us, d.dict_value, d.dict_type, d.css_class, d.list_class, d.is_default, d.status, d.create_by, d.create_time, d.remark from sys_dict_data d left join sys_dict_data_translate t on d.dict_code = t.id WHERE d.status = ? order by d.dict_sort asc
13:51:11.814 [restartedMain] DEBUG c.m.m.S.selectDictDataListAll - [debug,137] - ==> Parameters: 0(String)
13:51:11.815 [restartedMain] DEBUG c.m.m.S.selectDictDataListAll - [debug,137] - <== Total: 0
13:51:11.974 [restartedMain] DEBUG c.m.m.S.selectDictDataListAll - [debug,137] - ==> Preparing: select d.dict_code, d.dict_sort, d.dict_label, t.zh_cn as dict_label_zh_cn, t.en_us as dict_label_en_us, d.dict_value, d.dict_type, d.css_class, d.list_class, d.is_default, d.status, d.create_by, d.create_time, d.remark from sys_dict_data d left join sys_dict_data_translate t on d.dict_code = t.id WHERE d.status = ? order by d.dict_sort asc
13:51:11.975 [restartedMain] DEBUG c.m.m.S.selectDictDataListAll - [debug,137] - ==> Parameters: 0(String)
13:51:11.976 [restartedMain] DEBUG c.m.m.S.selectDictDataListAll - [debug,137] - <== Total: 0
13:51:11.978 [restartedMain] DEBUG c.m.m.S.selectDictDataListAll - [debug,137] - ==> Preparing: select d.dict_code, d.dict_sort, d.dict_label, t.zh_cn as dict_label_zh_cn, t.en_us as dict_label_en_us, d.dict_value, d.dict_type, d.css_class, d.list_class, d.is_default, d.status, d.create_by, d.create_time, d.remark from sys_dict_data d left join sys_dict_data_translate t on d.dict_code = t.id WHERE d.status = ? order by d.dict_sort asc
13:51:11.981 [restartedMain] DEBUG c.m.m.S.selectDictDataListAll - [debug,137] - ==> Parameters: 0(String)
13:51:11.983 [restartedMain] DEBUG c.m.m.S.selectDictDataListAll - [debug,137] - <== Total: 0
13:51:12.175 [restartedMain] DEBUG c.m.m.S.selectDictDataListAll - [debug,137] - ==> Preparing: select d.dict_code, d.dict_sort, d.dict_label, t.zh_cn as dict_label_zh_cn, t.en_us as dict_label_en_us, d.dict_value, d.dict_type, d.css_class, d.list_class, d.is_default, d.status, d.create_by, d.create_time, d.remark from sys_dict_data d left join sys_dict_data_translate t on d.dict_code = t.id WHERE d.status = ? order by d.dict_sort asc
13:51:12.176 [restartedMain] DEBUG c.m.m.S.selectDictDataListAll - [debug,137] - ==> Parameters: 0(String)
13:51:12.179 [restartedMain] DEBUG c.m.m.S.selectDictDataListAll - [debug,137] - <== Total: 0
13:51:12.270 [restartedMain] DEBUG c.m.m.S.selectDictDataListAll - [debug,137] - ==> Preparing: select d.dict_code, d.dict_sort, d.dict_label, t.zh_cn as dict_label_zh_cn, t.en_us as dict_label_en_us, d.dict_value, d.dict_type, d.css_class, d.list_class, d.is_default, d.status, d.create_by, d.create_time, d.remark from sys_dict_data d left join sys_dict_data_translate t on d.dict_code = t.id WHERE d.status = ? order by d.dict_sort asc
13:51:12.271 [restartedMain] DEBUG c.m.m.S.selectDictDataListAll - [debug,137] - ==> Parameters: 0(String)
13:51:12.275 [restartedMain] DEBUG c.m.m.S.selectDictDataListAll - [debug,137] - <== Total: 0
13:51:12.302 [restartedMain] DEBUG c.m.m.S.selectDictDataListAll - [debug,137] - ==> Preparing: select d.dict_code, d.dict_sort, d.dict_label, t.zh_cn as dict_label_zh_cn, t.en_us as dict_label_en_us, d.dict_value, d.dict_type, d.css_class, d.list_class, d.is_default, d.status, d.create_by, d.create_time, d.remark from sys_dict_data d left join sys_dict_data_translate t on d.dict_code = t.id WHERE d.status = ? order by d.dict_sort asc
13:51:12.303 [restartedMain] DEBUG c.m.m.S.selectDictDataListAll - [debug,137] - ==> Parameters: 0(String)
13:51:12.304 [restartedMain] DEBUG c.m.m.S.selectDictDataListAll - [debug,137] - <== Total: 0
13:51:12.559 [restartedMain] DEBUG c.m.m.S.selectDictDataListAll - [debug,137] - ==> Preparing: select d.dict_code, d.dict_sort, d.dict_label, t.zh_cn as dict_label_zh_cn, t.en_us as dict_label_en_us, d.dict_value, d.dict_type, d.css_class, d.list_class, d.is_default, d.status, d.create_by, d.create_time, d.remark from sys_dict_data d left join sys_dict_data_translate t on d.dict_code = t.id WHERE d.status = ? order by d.dict_sort asc
13:51:12.560 [restartedMain] DEBUG c.m.m.S.selectDictDataListAll - [debug,137] - ==> Parameters: 0(String)
13:51:12.562 [restartedMain] DEBUG c.m.m.S.selectDictDataListAll - [debug,137] - <== Total: 0
13:51:15.925 [restartedMain] DEBUG c.m.m.D.selectList - [debug,137] - ==> Preparing: SELECT id,device_id,plan_name,task_staus,route_id,user_id,device_task_plan_rules,create_time,create_by,update_time,update_by,finish_time,start_time,del_flag FROM iot_device_plan WHERE (task_staus IN (?,?,?))
13:51:15.986 [restartedMain] DEBUG c.m.m.D.selectList - [debug,137] - ==> Parameters: NEW(String), EXECUTING(String), PAUSE(String)
13:51:15.987 [restartedMain] DEBUG c.m.m.D.selectList - [debug,137] - <== Total: 0
13:51:16.011 [deviceErrorMonitor1] DEBUG c.m.m.E.selectList - [debug,137] - ==> Preparing: SELECT id,field,compare_values,compare_type,error_description,error_name FROM error_identification
13:51:16.011 [deviceErrorMonitor1] DEBUG c.m.m.E.selectList - [debug,137] - ==> Parameters:
13:51:16.048 [deviceErrorMonitor1] DEBUG c.m.m.E.selectList - [debug,137] - <== Total: 0
13:51:20.616 [restartedMain] DEBUG c.m.m.D.selectList - [debug,137] - ==> Preparing: SELECT id,device_id,plan_name,task_staus,route_id,user_id,device_task_plan_rules,create_time,create_by,update_time,update_by,finish_time,start_time,del_flag FROM iot_device_plan WHERE (task_staus IN (?,?,?))
13:51:20.619 [restartedMain] DEBUG c.m.m.D.selectList - [debug,137] - ==> Parameters: NEW(String), EXECUTING(String), PAUSE(String)
13:51:20.624 [restartedMain] DEBUG c.m.m.D.selectList - [debug,137] - <== Total: 0
13:51:20.654 [deviceErrorMonitor1] DEBUG c.m.m.E.selectList - [debug,137] - ==> Preparing: SELECT id,field,compare_values,compare_type,error_description,error_name FROM error_identification
13:51:20.657 [deviceErrorMonitor1] DEBUG c.m.m.E.selectList - [debug,137] - ==> Parameters:
13:51:20.663 [deviceErrorMonitor1] DEBUG c.m.m.E.selectList - [debug,137] - <== Total: 0

View File

@@ -0,0 +1,128 @@
16:03:49.151 [restartedMain] ERROR o.s.b.SpringApplication - [reportFailure,870] - Application run failed
java.lang.IllegalStateException: java.lang.IllegalStateException: Logback configuration error detected:
ERROR in ch.qos.logback.core.FileAppender[FILE] - 'File' option has the same value "logs/init.log" as that given for appender [FILE] defined earlier.
ERROR in ch.qos.logback.core.FileAppender[FILE] - Collisions detected with FileAppender/RollingAppender instances defined earlier. Aborting.
ERROR in ch.qos.logback.core.FileAppender[FILE] - For more information, please visit http://logback.qos.ch/codes.html#earlier_fa_collision
ERROR in ch.qos.logback.core.rolling.RollingFileAppender[file_debug] - 'FileNamePattern' option has the same value "logs/sys-debug.%d{yyyy-MM-dd}.log" as that given for appender [file_debug] defined earlier.
ERROR in ch.qos.logback.core.rolling.RollingFileAppender[file_debug] - Collisions detected with FileAppender/RollingAppender instances defined earlier. Aborting.
ERROR in ch.qos.logback.core.rolling.RollingFileAppender[file_debug] - For more information, please visit http://logback.qos.ch/codes.html#earlier_fa_collision
ERROR in ch.qos.logback.core.rolling.RollingFileAppender[file_info] - 'FileNamePattern' option has the same value "logs/sys-info.%d{yyyy-MM-dd}.log" as that given for appender [file_info] defined earlier.
ERROR in ch.qos.logback.core.rolling.RollingFileAppender[file_info] - Collisions detected with FileAppender/RollingAppender instances defined earlier. Aborting.
ERROR in ch.qos.logback.core.rolling.RollingFileAppender[file_info] - For more information, please visit http://logback.qos.ch/codes.html#earlier_fa_collision
ERROR in ch.qos.logback.core.rolling.RollingFileAppender[file_error] - 'FileNamePattern' option has the same value "logs/sys-error.%d{yyyy-MM-dd}.log" as that given for appender [file_error] defined earlier.
ERROR in ch.qos.logback.core.rolling.RollingFileAppender[file_error] - Collisions detected with FileAppender/RollingAppender instances defined earlier. Aborting.
ERROR in ch.qos.logback.core.rolling.RollingFileAppender[file_error] - For more information, please visit http://logback.qos.ch/codes.html#earlier_fa_collision
ERROR in ch.qos.logback.core.rolling.RollingFileAppender[sys-user] - 'FileNamePattern' option has the same value "logs/sys-user.%d{yyyy-MM-dd}.log" as that given for appender [sys-user] defined earlier.
ERROR in ch.qos.logback.core.rolling.RollingFileAppender[sys-user] - Collisions detected with FileAppender/RollingAppender instances defined earlier. Aborting.
ERROR in ch.qos.logback.core.rolling.RollingFileAppender[sys-user] - For more information, please visit http://logback.qos.ch/codes.html#earlier_fa_collision
at org.springframework.boot.context.logging.LoggingApplicationListener.initializeSystem(LoggingApplicationListener.java:328)
at org.springframework.boot.context.logging.LoggingApplicationListener.initialize(LoggingApplicationListener.java:282)
at org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationEnvironmentPreparedEvent(LoggingApplicationListener.java:240)
at org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationEvent(LoggingApplicationListener.java:216)
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:131)
at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:82)
at org.springframework.boot.SpringApplicationRunListeners.lambda$environmentPrepared$2(SpringApplicationRunListeners.java:63)
at java.util.ArrayList.forEach(ArrayList.java:1259)
at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:117)
at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:111)
at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:62)
at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:379)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:337)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1370)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1359)
at com.maibu.MiddlePlatformApplication.main(MiddlePlatformApplication.java:23)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)
Caused by: java.lang.IllegalStateException: Logback configuration error detected:
ERROR in ch.qos.logback.core.FileAppender[FILE] - 'File' option has the same value "logs/init.log" as that given for appender [FILE] defined earlier.
ERROR in ch.qos.logback.core.FileAppender[FILE] - Collisions detected with FileAppender/RollingAppender instances defined earlier. Aborting.
ERROR in ch.qos.logback.core.FileAppender[FILE] - For more information, please visit http://logback.qos.ch/codes.html#earlier_fa_collision
ERROR in ch.qos.logback.core.rolling.RollingFileAppender[file_debug] - 'FileNamePattern' option has the same value "logs/sys-debug.%d{yyyy-MM-dd}.log" as that given for appender [file_debug] defined earlier.
ERROR in ch.qos.logback.core.rolling.RollingFileAppender[file_debug] - Collisions detected with FileAppender/RollingAppender instances defined earlier. Aborting.
ERROR in ch.qos.logback.core.rolling.RollingFileAppender[file_debug] - For more information, please visit http://logback.qos.ch/codes.html#earlier_fa_collision
ERROR in ch.qos.logback.core.rolling.RollingFileAppender[file_info] - 'FileNamePattern' option has the same value "logs/sys-info.%d{yyyy-MM-dd}.log" as that given for appender [file_info] defined earlier.
ERROR in ch.qos.logback.core.rolling.RollingFileAppender[file_info] - Collisions detected with FileAppender/RollingAppender instances defined earlier. Aborting.
ERROR in ch.qos.logback.core.rolling.RollingFileAppender[file_info] - For more information, please visit http://logback.qos.ch/codes.html#earlier_fa_collision
ERROR in ch.qos.logback.core.rolling.RollingFileAppender[file_error] - 'FileNamePattern' option has the same value "logs/sys-error.%d{yyyy-MM-dd}.log" as that given for appender [file_error] defined earlier.
ERROR in ch.qos.logback.core.rolling.RollingFileAppender[file_error] - Collisions detected with FileAppender/RollingAppender instances defined earlier. Aborting.
ERROR in ch.qos.logback.core.rolling.RollingFileAppender[file_error] - For more information, please visit http://logback.qos.ch/codes.html#earlier_fa_collision
ERROR in ch.qos.logback.core.rolling.RollingFileAppender[sys-user] - 'FileNamePattern' option has the same value "logs/sys-user.%d{yyyy-MM-dd}.log" as that given for appender [sys-user] defined earlier.
ERROR in ch.qos.logback.core.rolling.RollingFileAppender[sys-user] - Collisions detected with FileAppender/RollingAppender instances defined earlier. Aborting.
ERROR in ch.qos.logback.core.rolling.RollingFileAppender[sys-user] - For more information, please visit http://logback.qos.ch/codes.html#earlier_fa_collision
at org.springframework.boot.logging.logback.LogbackLoggingSystem.loadConfiguration(LogbackLoggingSystem.java:179)
at org.springframework.boot.logging.logback.LogbackLoggingSystem.reinitialize(LogbackLoggingSystem.java:232)
at org.springframework.boot.logging.AbstractLoggingSystem.initializeWithConventions(AbstractLoggingSystem.java:73)
at org.springframework.boot.logging.AbstractLoggingSystem.initialize(AbstractLoggingSystem.java:60)
at org.springframework.boot.logging.logback.LogbackLoggingSystem.initialize(LogbackLoggingSystem.java:132)
at org.springframework.boot.context.logging.LoggingApplicationListener.initializeSystem(LoggingApplicationListener.java:313)
... 23 common frames omitted
16:03:49.162 [restartedMain] ERROR o.s.b.SpringApplication - [reportFailure,870] - Application run failed
java.lang.IllegalStateException: java.lang.IllegalStateException: Logback configuration error detected:
ERROR in ch.qos.logback.core.FileAppender[FILE] - 'File' option has the same value "logs/init.log" as that given for appender [FILE] defined earlier.
ERROR in ch.qos.logback.core.FileAppender[FILE] - Collisions detected with FileAppender/RollingAppender instances defined earlier. Aborting.
ERROR in ch.qos.logback.core.FileAppender[FILE] - For more information, please visit http://logback.qos.ch/codes.html#earlier_fa_collision
ERROR in ch.qos.logback.core.rolling.RollingFileAppender[file_debug] - 'FileNamePattern' option has the same value "logs/sys-debug.%d{yyyy-MM-dd}.log" as that given for appender [file_debug] defined earlier.
ERROR in ch.qos.logback.core.rolling.RollingFileAppender[file_debug] - Collisions detected with FileAppender/RollingAppender instances defined earlier. Aborting.
ERROR in ch.qos.logback.core.rolling.RollingFileAppender[file_debug] - For more information, please visit http://logback.qos.ch/codes.html#earlier_fa_collision
ERROR in ch.qos.logback.core.rolling.RollingFileAppender[file_info] - 'FileNamePattern' option has the same value "logs/sys-info.%d{yyyy-MM-dd}.log" as that given for appender [file_info] defined earlier.
ERROR in ch.qos.logback.core.rolling.RollingFileAppender[file_info] - Collisions detected with FileAppender/RollingAppender instances defined earlier. Aborting.
ERROR in ch.qos.logback.core.rolling.RollingFileAppender[file_info] - For more information, please visit http://logback.qos.ch/codes.html#earlier_fa_collision
ERROR in ch.qos.logback.core.rolling.RollingFileAppender[file_error] - 'FileNamePattern' option has the same value "logs/sys-error.%d{yyyy-MM-dd}.log" as that given for appender [file_error] defined earlier.
ERROR in ch.qos.logback.core.rolling.RollingFileAppender[file_error] - Collisions detected with FileAppender/RollingAppender instances defined earlier. Aborting.
ERROR in ch.qos.logback.core.rolling.RollingFileAppender[file_error] - For more information, please visit http://logback.qos.ch/codes.html#earlier_fa_collision
ERROR in ch.qos.logback.core.rolling.RollingFileAppender[sys-user] - 'FileNamePattern' option has the same value "logs/sys-user.%d{yyyy-MM-dd}.log" as that given for appender [sys-user] defined earlier.
ERROR in ch.qos.logback.core.rolling.RollingFileAppender[sys-user] - Collisions detected with FileAppender/RollingAppender instances defined earlier. Aborting.
ERROR in ch.qos.logback.core.rolling.RollingFileAppender[sys-user] - For more information, please visit http://logback.qos.ch/codes.html#earlier_fa_collision
at org.springframework.boot.context.logging.LoggingApplicationListener.initializeSystem(LoggingApplicationListener.java:328)
at org.springframework.boot.context.logging.LoggingApplicationListener.initialize(LoggingApplicationListener.java:282)
at org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationEnvironmentPreparedEvent(LoggingApplicationListener.java:240)
at org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationEvent(LoggingApplicationListener.java:216)
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:131)
at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:82)
at org.springframework.boot.SpringApplicationRunListeners.lambda$environmentPrepared$2(SpringApplicationRunListeners.java:63)
at java.util.ArrayList.forEach(ArrayList.java:1259)
at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:117)
at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:111)
at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:62)
at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:379)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:337)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1370)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1359)
at com.maibu.MiddlePlatformApplication.main(MiddlePlatformApplication.java:23)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)
Caused by: java.lang.IllegalStateException: Logback configuration error detected:
ERROR in ch.qos.logback.core.FileAppender[FILE] - 'File' option has the same value "logs/init.log" as that given for appender [FILE] defined earlier.
ERROR in ch.qos.logback.core.FileAppender[FILE] - Collisions detected with FileAppender/RollingAppender instances defined earlier. Aborting.
ERROR in ch.qos.logback.core.FileAppender[FILE] - For more information, please visit http://logback.qos.ch/codes.html#earlier_fa_collision
ERROR in ch.qos.logback.core.rolling.RollingFileAppender[file_debug] - 'FileNamePattern' option has the same value "logs/sys-debug.%d{yyyy-MM-dd}.log" as that given for appender [file_debug] defined earlier.
ERROR in ch.qos.logback.core.rolling.RollingFileAppender[file_debug] - Collisions detected with FileAppender/RollingAppender instances defined earlier. Aborting.
ERROR in ch.qos.logback.core.rolling.RollingFileAppender[file_debug] - For more information, please visit http://logback.qos.ch/codes.html#earlier_fa_collision
ERROR in ch.qos.logback.core.rolling.RollingFileAppender[file_info] - 'FileNamePattern' option has the same value "logs/sys-info.%d{yyyy-MM-dd}.log" as that given for appender [file_info] defined earlier.
ERROR in ch.qos.logback.core.rolling.RollingFileAppender[file_info] - Collisions detected with FileAppender/RollingAppender instances defined earlier. Aborting.
ERROR in ch.qos.logback.core.rolling.RollingFileAppender[file_info] - For more information, please visit http://logback.qos.ch/codes.html#earlier_fa_collision
ERROR in ch.qos.logback.core.rolling.RollingFileAppender[file_error] - 'FileNamePattern' option has the same value "logs/sys-error.%d{yyyy-MM-dd}.log" as that given for appender [file_error] defined earlier.
ERROR in ch.qos.logback.core.rolling.RollingFileAppender[file_error] - Collisions detected with FileAppender/RollingAppender instances defined earlier. Aborting.
ERROR in ch.qos.logback.core.rolling.RollingFileAppender[file_error] - For more information, please visit http://logback.qos.ch/codes.html#earlier_fa_collision
ERROR in ch.qos.logback.core.rolling.RollingFileAppender[sys-user] - 'FileNamePattern' option has the same value "logs/sys-user.%d{yyyy-MM-dd}.log" as that given for appender [sys-user] defined earlier.
ERROR in ch.qos.logback.core.rolling.RollingFileAppender[sys-user] - Collisions detected with FileAppender/RollingAppender instances defined earlier. Aborting.
ERROR in ch.qos.logback.core.rolling.RollingFileAppender[sys-user] - For more information, please visit http://logback.qos.ch/codes.html#earlier_fa_collision
at org.springframework.boot.logging.logback.LogbackLoggingSystem.loadConfiguration(LogbackLoggingSystem.java:179)
at org.springframework.boot.logging.logback.LogbackLoggingSystem.reinitialize(LogbackLoggingSystem.java:232)
at org.springframework.boot.logging.AbstractLoggingSystem.initializeWithConventions(AbstractLoggingSystem.java:73)
at org.springframework.boot.logging.AbstractLoggingSystem.initialize(AbstractLoggingSystem.java:60)
at org.springframework.boot.logging.logback.LogbackLoggingSystem.initialize(LogbackLoggingSystem.java:132)
at org.springframework.boot.context.logging.LoggingApplicationListener.initializeSystem(LoggingApplicationListener.java:313)
... 23 common frames omitted

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,4 @@
16:03:49.132 [restartedMain] INFO c.m.MiddlePlatformApplication - [logStarting,55] - Starting MiddlePlatformApplication using Java 1.8.0_482 on ubuntu with PID 579837 (/home/maibu/Test/MiddlePlatform/maibu-admin/target/classes started by maibu in /home/maibu/Test/MiddlePlatform)
16:03:49.134 [restartedMain] INFO c.m.MiddlePlatformApplication - [logStartupProfileInfo,686] - The following 1 profile is active: "dev"
16:03:49.140 [restartedMain] INFO c.m.MiddlePlatformApplication - [logStarting,55] - Starting MiddlePlatformApplication using Java 1.8.0_482 on ubuntu with PID 579837 (/home/maibu/Test/MiddlePlatform/maibu-admin/target/classes started by maibu in /home/maibu/Test/MiddlePlatform)
16:03:49.156 [restartedMain] INFO c.m.MiddlePlatformApplication - [logStartupProfileInfo,686] - The following 1 profile is active: "dev"

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,3 @@
10:56:54.091 [restartedMain] INFO sys-user - [shutdownAsyncManager,31] - ====关闭后台任务任务线程池====
10:56:54.522 [restartedMain] INFO sys-user - [shutdownAsyncManager,31] - ====关闭后台任务任务线程池====
10:56:54.563 [restartedMain] INFO sys-user - [shutdownAsyncManager,31] - ====关闭后台任务任务线程池====

View File

@@ -0,0 +1,35 @@
13:03:23.590 [restartedMain] INFO sys-user - [shutdownAsyncManager,31] - ====关闭后台任务任务线程池====
13:03:23.860 [restartedMain] INFO sys-user - [shutdownAsyncManager,31] - ====关闭后台任务任务线程池====
13:03:23.892 [restartedMain] INFO sys-user - [shutdownAsyncManager,31] - ====关闭后台任务任务线程池====
13:03:23.985 [restartedMain] INFO sys-user - [shutdownAsyncManager,31] - ====关闭后台任务任务线程池====
13:03:24.370 [Thread-183] INFO sys-user - [shutdownAsyncManager,31] - ====关闭后台任务任务线程池====
13:32:46.232 [restartedMain] INFO sys-user - [shutdownAsyncManager,31] - ====关闭后台任务任务线程池====
13:32:46.612 [restartedMain] INFO sys-user - [shutdownAsyncManager,31] - ====关闭后台任务任务线程池====
13:32:46.689 [restartedMain] INFO sys-user - [shutdownAsyncManager,31] - ====关闭后台任务任务线程池====
13:51:16.231 [Thread-486] INFO sys-user - [shutdownAsyncManager,31] - ====关闭后台任务任务线程池====
13:51:19.337 [restartedMain] INFO sys-user - [shutdownAsyncManager,31] - ====关闭后台任务任务线程池====
13:51:19.591 [restartedMain] INFO sys-user - [shutdownAsyncManager,31] - ====关闭后台任务任务线程池====
13:51:19.787 [restartedMain] INFO sys-user - [shutdownAsyncManager,31] - ====关闭后台任务任务线程池====
13:51:19.926 [restartedMain] INFO sys-user - [shutdownAsyncManager,31] - ====关闭后台任务任务线程池====
13:51:20.003 [restartedMain] INFO sys-user - [shutdownAsyncManager,31] - ====关闭后台任务任务线程池====
13:51:20.029 [restartedMain] INFO sys-user - [shutdownAsyncManager,31] - ====关闭后台任务任务线程池====
13:51:20.124 [restartedMain] INFO sys-user - [shutdownAsyncManager,31] - ====关闭后台任务任务线程池====
13:51:20.137 [restartedMain] INFO sys-user - [shutdownAsyncManager,31] - ====关闭后台任务任务线程池====
13:51:20.352 [restartedMain] INFO sys-user - [shutdownAsyncManager,31] - ====关闭后台任务任务线程池====
13:51:20.848 [Thread-486] INFO sys-user - [shutdownAsyncManager,31] - ====关闭后台任务任务线程池====
13:59:45.396 [Thread-716] INFO sys-user - [shutdownAsyncManager,31] - ====关闭后台任务任务线程池====
14:03:07.346 [restartedMain] INFO sys-user - [shutdownAsyncManager,31] - ====关闭后台任务任务线程池====
14:03:07.587 [restartedMain] INFO sys-user - [shutdownAsyncManager,31] - ====关闭后台任务任务线程池====
14:03:07.709 [restartedMain] INFO sys-user - [shutdownAsyncManager,31] - ====关闭后台任务任务线程池====
14:03:09.963 [restartedMain] INFO sys-user - [shutdownAsyncManager,31] - ====关闭后台任务任务线程池====
14:03:10.012 [restartedMain] INFO sys-user - [shutdownAsyncManager,31] - ====关闭后台任务任务线程池====
14:03:10.096 [restartedMain] INFO sys-user - [shutdownAsyncManager,31] - ====关闭后台任务任务线程池====
14:03:12.573 [restartedMain] INFO sys-user - [shutdownAsyncManager,31] - ====关闭后台任务任务线程池====
14:03:12.606 [restartedMain] INFO sys-user - [shutdownAsyncManager,31] - ====关闭后台任务任务线程池====
14:03:12.652 [restartedMain] INFO sys-user - [shutdownAsyncManager,31] - ====关闭后台任务任务线程池====
14:03:12.687 [restartedMain] INFO sys-user - [shutdownAsyncManager,31] - ====关闭后台任务任务线程池====
14:03:12.718 [restartedMain] INFO sys-user - [shutdownAsyncManager,31] - ====关闭后台任务任务线程池====
14:03:12.745 [restartedMain] INFO sys-user - [shutdownAsyncManager,31] - ====关闭后台任务任务线程池====
14:03:12.825 [restartedMain] INFO sys-user - [shutdownAsyncManager,31] - ====关闭后台任务任务线程池====
14:03:12.953 [restartedMain] INFO sys-user - [shutdownAsyncManager,31] - ====关闭后台任务任务线程池====
14:03:16.572 [schedule-pool-2] INFO sys-user - [run,56] - [192.168.2.14]内网IP[admin][Success][登录成功]

View File

@@ -0,0 +1,91 @@
package com.maibu.web.controller.system;
import com.maibu.core.controller.BaseController;
import com.maibu.core.domain.AjaxResult;
import com.maibu.core.domain.entity.SysRegion;
import com.maibu.core.domain.entity.SysSite;
import com.maibu.core.page.TableDataInfo;
import com.maibu.service.SysRegionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 区域/场站
*
* @author ruoyi
*/
@RestController
@RequestMapping("/system/region")
public class SysRegionController extends BaseController {
@Autowired
private SysRegionService sysRegionService;
/**
* 查询组织列表
*/
@GetMapping("/list")
public TableDataInfo list(SysRegion region) {
try {
startPage();
return getDataTable(sysRegionService.list(region));
} catch (Exception e) {
throw new RuntimeException(e);
}
}
/**
* 新增或者修改组织
*/
@PostMapping("/save")
public AjaxResult save(@RequestBody SysRegion region) {
try {
return AjaxResult.success(sysRegionService.save(region));
} catch (Exception e) {
return AjaxResult.error("保存组织出错", e.getMessage());
}
}
/**
* 删除组织
*/
@PostMapping("/delete")
public AjaxResult delete(@RequestBody List<Long> ids) {
try {
return AjaxResult.success(sysRegionService.delete(ids));
} catch (Exception e) {
return AjaxResult.error("保存组织出错", e.getMessage());
}
}
/**
* 查询场站详情
*/
@GetMapping("/selectById")
public AjaxResult selectById(@RequestParam Long id) {
try {
return AjaxResult.success(sysRegionService.selectById(id));
} catch (Exception e) {
return AjaxResult.error("保存组织出错", e.getMessage());
}
}
/**
* 查询组织下所有的区域场站
*/
@GetMapping("/selectBySiteId")
public AjaxResult selectBySiteId(@RequestParam Long id) {
try {
return AjaxResult.success(sysRegionService.selectBySiteId(id));
} catch (Exception e) {
return AjaxResult.error("保存组织出错", e.getMessage());
}
}
}

View File

@@ -0,0 +1,167 @@
package com.maibu.core.business;
import com.maibu.annotation.Excel;
import com.maibu.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* 产品分类对象 iot_category
*
* @author kerwincui
* @date 2021-12-16
*/
@ApiModel(value = "Category", description = "产品分类对象 iot_category")
public class Category extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 产品分类ID */
@ApiModelProperty("产品分类ID")
private Long categoryId;
/** 产品分类名称 */
@ApiModelProperty("产品分类名称")
@Excel(name = "产品分类名称")
private String categoryName;
/** 租户ID */
@ApiModelProperty("租户ID")
@Excel(name = "租户ID")
private Long tenantId;
/** 租户名称 */
@ApiModelProperty("租户名称")
@Excel(name = "租户名称")
private String tenantName;
/** 是否系统通用(0-否,1-是) */
@ApiModelProperty("是否系统通用(0-否,1-是)")
@Excel(name = "是否系统通用", readConverterExp = "0=-否,1-是")
private Integer isSys;
/** 显示顺序 */
@ApiModelProperty("显示顺序")
@Excel(name = "显示顺序")
private Integer orderNum;
/** 删除标志(0代表存在 2代表删除) */
@ApiModelProperty("删除标志(0代表存在 2代表删除)")
private String delFlag;
@ApiModelProperty("是否显示上级品类")
private Boolean showSenior;
@ApiModelProperty("是否是总账号")
private Boolean isAdmin;
@ApiModelProperty("机构ID")
private Long deptId;
public Boolean getShowSenior() {
return showSenior;
}
public void setShowSenior(Boolean showSenior) {
this.showSenior = showSenior;
}
public Long getDeptId() {
return deptId;
}
public void setDeptId(Long deptId) {
this.deptId = deptId;
}
public Boolean getAdmin() {
return isAdmin;
}
public void setAdmin(Boolean admin) {
isAdmin = admin;
}
public void setCategoryId(Long categoryId)
{
this.categoryId = categoryId;
}
public Long getCategoryId()
{
return categoryId;
}
public void setCategoryName(String categoryName)
{
this.categoryName = categoryName;
}
public String getCategoryName()
{
return categoryName;
}
public void setTenantId(Long tenantId)
{
this.tenantId = tenantId;
}
public Long getTenantId()
{
return tenantId;
}
public void setTenantName(String tenantName)
{
this.tenantName = tenantName;
}
public String getTenantName()
{
return tenantName;
}
public void setIsSys(Integer isSys)
{
this.isSys = isSys;
}
public Integer getIsSys()
{
return isSys;
}
public void setOrderNum(Integer orderNum)
{
this.orderNum = orderNum;
}
public Integer getOrderNum()
{
return orderNum;
}
public void setDelFlag(String delFlag)
{
this.delFlag = delFlag;
}
public String getDelFlag()
{
return delFlag;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("categoryId", getCategoryId())
.append("categoryName", getCategoryName())
.append("tenantId", getTenantId())
.append("tenantName", getTenantName())
.append("isSys", getIsSys())
.append("orderNum", getOrderNum())
.append("delFlag", getDelFlag())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
}
}

View File

@@ -0,0 +1,263 @@
package com.maibu.core.business;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.maibu.annotation.Excel;
import com.maibu.core.domain.BaseDO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.data.annotation.Transient;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* 设备对象 iot_device
*
* @author kerwincui
* @date 2021-12-16
*/
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "Device", description = "设备对象 iot_device")
@JsonInclude(JsonInclude.Include.NON_NULL)
@Data
@TableName("iot_device")
public class Device extends BaseDO {
private static final long serialVersionUID = 1L;
@TableId(type = IdType.AUTO)
private Long deviceId;
/**
* 设备编号
*/
@ApiModelProperty("设备编号")
@Excel(name = "设备编号")
private String serialNumber;
/**
* 设备名称
*/
@ApiModelProperty("设备名称")
@Excel(name = "设备名称")
private String deviceName;
/**
* 设备别名
*/
@ApiModelProperty("设备别名")
@Excel(name = "设备别名")
private String deviceAlias;
/**
* 产品ID
*/
@ApiModelProperty("产品ID")
@Excel(name = "产品ID")
private Long productId;
/**
* 产品名称
*/
@ApiModelProperty("产品名称")
@Excel(name = "产品名称")
private String productName;
/**
* 租户ID
*/
@ApiModelProperty("租户ID")
@Excel(name = "租户ID")
private Long tenantId;
/**
* 租户名称
*/
@ApiModelProperty("租户名称")
@Excel(name = "租户名称")
private String tenantName;
/**
* 固件版本
*/
@ApiModelProperty("固件版本")
@Excel(name = "固件版本")
private BigDecimal firmwareVersion;
/**
* WIFI固件版本
*/
@ApiModelProperty("HTTP推送固件版本")
@Excel(name = "HTTP推送固件版本")
private BigDecimal wirelessVersion;
/**
* 设备类型(1-直连设备、2-网关设备、3-监控设备)
*/
@ApiModelProperty("设备类型(1-直连设备、2-网关设备、3-监控设备 4-网关子设备)")
private Integer deviceType;
/**
* 设备状态(1-未激活,2-禁用,3-在线,4-离线)
*/
@ApiModelProperty("设备状态(1-未激活,2-禁用,3-在线,4-离线)")
@Excel(name = "设备状态")
private Integer status;
/**
* 设备在线状态(1-在线,2-离线)
*/
@ApiModelProperty("设备状态(1-在线,2-离线)")
@Excel(name = "设备在线状态")
private Integer onlineStatus;
@TableField(exist = false)
private Integer feStatus; //前端大屏显示 1任务中/2空闲/3离线
/**
* wifi信号强度(信号极好4格[-55— 0],信号好3格[-70— -55],信号一般2格[-85— -70],信号差1格[-100— -85])
*/
@ApiModelProperty("wifi信号强度(信号极好4格[-55— 0],信号好3格[-70— -55],信号一般2格[-85— -70],信号差1格[-100— -85])")
@Excel(name = "wifi信号强度")
private Integer rssi;
/**
* 设备影子
*/
@ApiModelProperty("是否启用设备影子(0=禁用,1=启用)")
private Integer isShadow;
/**
* 设备所在地址
*/
@ApiModelProperty("设备所在地址")
@Excel(name = "设备所在地址")
private String networkAddress;
/**
* 设备入网IP
*/
@ApiModelProperty("设备入网IP")
@Excel(name = "设备入网IP")
private String networkIp;
/**
* 设备经度
*/
@ApiModelProperty("设备经度")
@Excel(name = "设备经度")
private BigDecimal longitude;
/**
* 设备纬度
*/
@ApiModelProperty("设备纬度")
@Excel(name = "设备纬度")
private BigDecimal latitude;
/**
* 激活时间
*/
@ApiModelProperty("激活时间")
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "激活时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date activeTime;
/**
* 子设备网关编号
*/
@ApiModelProperty("子设备网关编号")
@Excel(name = "网关设备编号(子设备使用)")
private String gwDevCode;
/**
* 物模型值
*/
@ApiModelProperty("物模型值")
@Excel(name = "物模型")
private String thingsModelValue;
/**
* 图片地址
*/
@ApiModelProperty("图片地址")
private String imgUrl;
/**
* 是否自定义位置
**/
@ApiModelProperty("定位方式(1=ip自动定位,2=设备定位,3=自定义)")
private Integer locationWay;
/**
* 设备摘要
**/
@ApiModelProperty("设备摘要")
private String summary;
/**
* 分组ID,用于分组查询
**/
@ApiModelProperty("分组ID,用于分组查询")
private Long groupId;
/**
* 是否设备所有者,用于查询
**/
@ApiModelProperty("是否设备所有者,用于查询")
private Integer isOwner;
/**
* 子设备数量
*/
@ApiModelProperty("子设备数量")
private Integer subDeviceCount;
/**
* 是否是模拟设备
*/
@ApiModelProperty("是否是模拟设备")
private Integer isSimulate;
/**
* 子设备地址
*/
@ApiModelProperty("子设备地址")
private Integer slaveId;
/**
* 设备传输协议
*/
@ApiModelProperty("设备传输协议")
private String transport;
//
// @Transient
// @ApiModelProperty("机构id")
// private Long deptId;
@Transient
@ApiModelProperty("是否显示下级")
private Boolean showChild;
private List<Device> subDeviceList;
private Long orgId; //组织id
private Long siteId; //场站id
/**
* 协议
*/
private String protocolCode;
@TableField(exist = false)
private DeviceRunningStatusHistory lastRunningStatus;
}

View File

@@ -0,0 +1,30 @@
package com.maibu.core.business;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.maibu.core.domain.BaseDO;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Map;
@EqualsAndHashCode(callSuper = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
@Data
@TableName("iot_device_action")
public class DeviceAction extends BaseDO {
@TableId(type = IdType.AUTO)
private Long id;
private Long modelId;
private String actionId;
private String actionName;
private Map<String,Object> params;
}

View File

@@ -0,0 +1,50 @@
package com.maibu.core.business;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.maibu.annotation.Excel;
import com.maibu.core.domain.BaseDO;
import com.maibu.core.enums.ConnectType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.data.annotation.Transient;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "DeviceModel", description = "设备类型 iot_device_model")
@JsonInclude(JsonInclude.Include.NON_NULL)
@Data
@TableName("iot_device_model")
public class DeviceModel extends BaseDO {
private static final long serialVersionUID = 1L;
@TableId(type = IdType.AUTO)
private Long id;
private String name;
private ConnectType connectType;
@TableField(exist = false)
private List<DeviceModelProperty> supportProperties; //支持的属性
private String version;
private Integer deviceType;
@TableField(exist = false)
private List<DeviceAction> supportActions; //支持可执行命令
}

View File

@@ -0,0 +1,43 @@
package com.maibu.core.business;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.maibu.core.domain.BaseDO;
import com.maibu.core.enums.ConnectType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.List;
import java.util.Map;
@EqualsAndHashCode(callSuper = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
@Data
@TableName("iot_device_property")
public class DeviceModelProperty extends BaseDO {
private static final long serialVersionUID = 1L;
@TableId(type = IdType.AUTO)
private Long id;
private Long modelId;
private String propertyKey; //属性key
private String propertyName; //属性名称
private String dataType; //数据类型
private String unit;
private Boolean required;
private Object defaultValue;
}

View File

@@ -0,0 +1,39 @@
package com.maibu.core.business;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.maibu.core.domain.BaseDO;
import com.maibu.core.enums.ConnectType;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.List;
@EqualsAndHashCode(callSuper = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
@Data
@TableName("iot_device_model_property_mapping")
public class DeviceModelPropertyMapping extends BaseDO {
private static final long serialVersionUID = 1L;
@TableId(type = IdType.AUTO)
private Long id;
private Long productId;
private Long modeId;
private String productInterfaceId; // 外部设备公司产品 对接提供的 对接方式 比如某个api接口 或者mqtt topic
private String standardKey;
private String sourceKey;
private String dataType;
}

View File

@@ -0,0 +1,55 @@
package com.maibu.core.business;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.maibu.core.enums.DeviceTaskStaus;
import lombok.Data;
import java.time.LocalDateTime;
@Data
@TableName(value = "iot_device_plan", autoResultMap = true)
public class DevicePlan {
@TableId(type = IdType.AUTO)
private Long id;
private String deviceId;
@TableField(exist = false)
private String deviceAlias;
@TableField(exist = false)
private String taskStausTranslate; //任务状态
private String planName;
private DeviceTaskStaus taskStaus; //任务状态
private Long routeId; // 线路id
private Long userId; // 用户id
@TableField(typeHandler = JacksonTypeHandler.class)
private DeviceTaskPlanRule deviceTaskPlanRules; //计划
private LocalDateTime createTime;
private String createBy;
private LocalDateTime updateTime;
private String updateBy;
private LocalDateTime finishTime;
private LocalDateTime startTime; //开始时间 时分秒
private int delFlag = 0; //删除状态 1删除
@TableField(exist = false)
private boolean dayTriggerFlag = false; //当天的任务是否已经生成
}

View File

@@ -0,0 +1,38 @@
package com.maibu.core.business;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.maibu.core.enums.DeviceTaskStaus;
import lombok.Data;
import java.time.LocalDateTime;
@Data
@TableName("iot_device_task")
public class DevicePlanTask {
@TableId(type = IdType.AUTO)
private Long id;
private Long planId; //归属于某个计划任务
private String deviceId;
private DeviceTaskStaus taskStaus; //任务状态
@TableField(exist = false)
private String taskStausTranslate; //任务状态
private Long routeId; // 线路id
private LocalDateTime finishTime;
private LocalDateTime startTime; //开始时间 时分秒
private LocalDateTime createTime; //创建时间
private String taskType; //任务类型分类
}

View File

@@ -0,0 +1,32 @@
package com.maibu.core.business;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalDateTime;
@Data
@TableName(" iot_device_run_statistics" )
public class DeviceRunStatistics implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(type = IdType.AUTO)
private Long id;
private LocalDateTime startTime;
private LocalDateTime endTime;
private Double workArea; //作业面积
private Double distance; //作业距离
private Long time; //时长 分钟
private String deviceId;
}

View File

@@ -0,0 +1,51 @@
package com.maibu.core.business;
import lombok.Data;
import java.io.Serializable;
@Data
public class DeviceRunningStatus implements Serializable {
private static final long serialVersionUID = 1L;
private Long id;
/** 产品分类ID */
private String deviceId;
private String voltage;
private String leftTargetSpeed;
private String rightTargetSpeed;
private String leftMeasureSpeed;
private String rightMeasureSpeed;
private String leftCurrent;
private String rightCurrent;
private String leftMotorTemp;
private String rightMotorTemp;
private String chipTemp;
private String yaw;
private String pitch;
private String roll;
private String satelliteCnt;
private String qual;
private String headingStatus;
private String latitude;
private String longitude;
}

View File

@@ -0,0 +1,69 @@
package com.maibu.core.business;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
@Data
@TableName("iot_device_running_status_history")
public class DeviceRunningStatusHistory implements Serializable {
@TableId(type = IdType.AUTO)
private Long id;
private String deviceId;
private String voltage; //电压
private String leftTargetSpeed; // 左轮目标速度
private String rightTargetSpeed;// 右轮目标速度
private String leftMeasureSpeed;// 左轮测量速度
private String rightMeasureSpeed;// 右轮测量速度
private String leftCurrent;// 左轮电流
private String rightCurrent;// 右轮电流
private String leftMotorTemp;// 左轮温度
private String rightMotorTemp;// 右轮温度
private String chipTemp;//芯片温度
private String yaw;//偏航角
private String pitch;//仰俯角
private String roll;//翻滚角
private String satelliteCnt;//跟踪的卫星数
private String qual;//定位质量
private String headingStatus;//航向角状态
private String latitude;//纬度
private String longitude;//经度
private Date time;
private String cuttingSpeed;//割刀速度
private String controlMode;//控制模式
private String battery;//电池电量
private String workingArea;//作业面积
private String obstacleSign;//障碍物标志位
private Date createTime;
}

View File

@@ -0,0 +1,11 @@
package com.maibu.core.business;
import lombok.Data;
import java.util.List;
@Data
public class DeviceStatusRecordDTO {
private List<DeviceRunningStatusHistory> histories;
private long lastRecordTime;
}

View File

@@ -0,0 +1,27 @@
package com.maibu.core.business;
import com.maibu.core.enums.DeviceTaskPlanRepeatType;
import lombok.Data;
import java.time.DayOfWeek;
import java.time.LocalDate;
import java.util.List;
@Data
public class DeviceTaskPlanRule {
private DeviceTaskPlanRepeatType type; //类型 天 周 月
private String startDate; //开始日期 年月
private String dayTime; //时分秒
private List<Integer> dayOfMonth; //月某天
private LocalDate endTime; //结束时间 时分秒
private List<DayOfWeek> days; //星期
private List<String> daysTranslate; //星期翻译
}

View File

@@ -0,0 +1,171 @@
package com.maibu.core.business;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 事件日志对象 iot_event_log
*
* @author kerwincui
* @date 2024-08-16
*/
@ApiModel(value = "EventLog" , description = "事件日志 iot_event_log" )
@Data
@TableName("iot_event_log" )
public class EventLog {
private static final long serialVersionUID = 1L;
/**
* 设备事件日志ID
*/
@TableId(value = "log_id" , type = IdType.AUTO)
private Long logId;
/**
* 标识符
*/
@ApiModelProperty("标识符" )
private String identity;
/**
* 物模型名称
*/
@ApiModelProperty("物模型名称" )
private String modelName;
/**
* 类型(3=事件上报,5=设备上线,6=设备离线)
*/
@ApiModelProperty("类型" )
private Integer logType;
/**
* 日志值
*/
@ApiModelProperty("日志值" )
private String logValue;
/**
* 设备ID
*/
@ApiModelProperty("设备ID" )
private Long deviceId;
/**
* 设备名称
*/
@ApiModelProperty("设备名称" )
private String deviceName;
/**
* 设备编号
*/
@ApiModelProperty("设备编号" )
private String serialNumber;
/**
* 是否监测数据(1=是,0=否)
*/
@ApiModelProperty("是否监测数据" )
private Integer isMonitor;
/**
* 模式(1=影子模式,2=在线模式,3=其他)
*/
@ApiModelProperty("模式(1=影子模式,2=在线模式,3=其他)" )
private Integer mode;
/**
* 用户ID
*/
@ApiModelProperty("用户ID" )
private Long userId;
/**
* 用户昵称
*/
@ApiModelProperty("用户昵称" )
private String userName;
/**
* 租户ID
*/
@ApiModelProperty("租户ID" )
private Long tenantId;
/**
* 租户名称
*/
@ApiModelProperty("租户名称" )
private String tenantName;
/**
* 创建者
*/
private String createBy;
/**
* 创建时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
/**
* 备注
*/
@ApiModelProperty("备注" )
private String remark;
@TableField(exist = false)
private List<String> identityList;
@TableField(exist = false)
@ApiModelProperty("请求参数")
@JsonInclude(JsonInclude.Include.NON_EMPTY)
private Map<String, Object> params;
public Map<String, Object> getParams()
{
if (params == null)
{
params = new HashMap<>();
}
return params;
}
public void setParams(Map<String, Object> params)
{
this.params = params;
}
}

View File

@@ -0,0 +1,22 @@
package com.maibu.core.business;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.util.Date;
/**
* @author bill
*/
@Data
public class HistoryModel {
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date time;
private String value;
private String identity;
private String moderName;
}

View File

@@ -0,0 +1,44 @@
package com.maibu.core.business;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* id和name
*
* @author kerwincui
* @date 2021-12-16
*/
public class IdAndName
{
private Long id;
private String name;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setName(String name)
{
this.name = name;
}
public String getName()
{
return name;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("categoryId", getId())
.append("categoryName", getName())
.toString();
}
}

View File

@@ -0,0 +1,30 @@
package com.maibu.core.business;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.maibu.core.domain.BaseDO;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
@EqualsAndHashCode(callSuper = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
@Data
@TableName("iot_device_product")
public class Product extends BaseDO {
private static final long serialVersionUID = 1L;
@TableId(type = IdType.AUTO)
private Long id;
private String name;
private String address;
private String remark;
}

View File

@@ -0,0 +1,40 @@
package com.maibu.core.business;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.maibu.core.domain.BaseDO;
import com.maibu.core.enums.ConnectType;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Map;
@EqualsAndHashCode(callSuper = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
@Data
@TableName("iot_device_product_inter")
public class ProductInterface extends BaseDO {
private static final long serialVersionUID = 1L;
@TableId(type = IdType.AUTO)
private Long id;
private String name;
private ConnectType type;
private String url;
private String method;
private String topic;
private Map<String,Object> params;
private String remark;
}

View File

@@ -0,0 +1,119 @@
package com.maibu.core.business;
public class RegisterUserInput {
/**
* 用户名
*/
private String username;
/**
* 用户密码
*/
private String password;
/**
* 验证码
*/
private String code;
private String phonenumber;
/**
* 唯一标识
*/
private String uuid = "";
private Long deptId = null;
private Long[] roleIds = null;
/**
* 登录平台 1-web端;2-移动端;3-小程序
*/
private Integer sourceType;
/**
* 验证码类型 1-系统验证码;2-短信验证码
*/
private Integer verifyType = 1;
public Integer getVerifyType() {
return verifyType;
}
public void setVerifyType(Integer verifyType) {
this.verifyType = verifyType;
}
public Integer getSourceType() {
return sourceType;
}
public void setSourceType(Integer sourceType) {
this.sourceType = sourceType;
}
public Long getDeptId() {
return deptId;
}
public void setDeptId(Long deptId) {
this.deptId = deptId;
}
public Long[] getRoleIds() {
return roleIds;
}
public void setRoleIds(Long[] roleIds) {
this.roleIds = roleIds;
}
public String getPhonenumber() {
return phonenumber;
}
public void setPhonenumber(String phonenumber) {
this.phonenumber = phonenumber;
}
public String getUsername()
{
return username;
}
public void setUsername(String username)
{
this.username = username;
}
public String getPassword()
{
return password;
}
public void setPassword(String password)
{
this.password = password;
}
public String getCode()
{
return code;
}
public void setCode(String code)
{
this.code = code;
}
public String getUuid()
{
return uuid;
}
public void setUuid(String uuid)
{
this.uuid = uuid;
}
}

View File

@@ -0,0 +1,26 @@
package com.maibu.core.business;
import lombok.Data;
/**
* @author fastb
* @date 2023-08-17 11:46
*/
@Data
public class RegisterUserOutput {
/**
* 错误信息
*/
private String msg;
/**
* 用户id
*/
private Long sysUserId;
/**
* 加密密码
*/
private String encryptPassword;
}

View File

@@ -0,0 +1,15 @@
package com.maibu.core.business;
import lombok.Data;
import java.io.Serializable;
@Data
public class WorkRecord implements Serializable {
private static final long serialVersionUID = 1L;
private Long id;
private String workName;
private Long userId;
private String jsonData;
private String imgUrl;
}

View File

@@ -0,0 +1,32 @@
package com.maibu.core.domain.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.maibu.core.domain.BaseDO;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
@EqualsAndHashCode(callSuper = true)
@Data
@TableName(value = "sys_region")
public class SysRegion extends BaseDO {
@TableId(type = IdType.AUTO)
private Long id;
private String regionName;
private String regionCode;
private String siteId;
private String type;
private String remark;
private Integer status;
}

View File

@@ -0,0 +1,5 @@
package com.maibu.core.enums;
public enum CommandRequestType {
switch_control
}

View File

@@ -0,0 +1,94 @@
package com.maibu.core.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
import java.util.Arrays;
import java.util.List;
/**
* 比较操作符枚举类
* 用于标准化管理比较类型,如>、<、between等
* 基于项目现有的使用模式实现
*/
@Getter
@AllArgsConstructor
public enum CompareEnum {
/** 等于 */
EQ("=", "等于", "=", true),
/** 不等于 */
NEQ("!=", "不等于", "!=", true),
/** 大于 */
GT(">", "大于", ">", true),
/** 小于 */
LT("<", "小于", "<", true),
/** 大于等于 */
GTE(">=", "大于等于", ">=", true),
/** 小于等于 */
LTE("<=", "小于等于", "<=", true),
/** 在之间 */
BETWEEN("between", "在之间", "between", false),
/** 不在之间 */
NOT_BETWEEN("notBetween", "不在之间", "notBetween", false),
/** 包含 */
CONTAIN("contain", "包含", "contain", true),
/** 不包含 */
NOT_CONTAIN("notContain", "不包含", "notContain", true);
/** 操作符值(存储在数据库中) */
private final String value;
/** 操作符名称(用于前端显示) */
private final String name;
/** 表达式符号(用于计算表达式) */
private final String symbol;
/** 是否为单值比较(true:单值, false:范围值) */
private final boolean singleValue;
/**
* 根据值获取比较操作符枚举
* @param value 操作符值
* @return 比较操作符枚举
*/
public static CompareEnum getByValue(String value) {
if (value == null) {
return null;
}
for (CompareEnum operator : CompareEnum.values()) {
if (operator.getValue().equals(value)) {
return operator;
}
}
return null;
}
/**
* 获取所有比较操作符列表
* @return 比较操作符列表
*/
public static List<CompareEnum> getAll() {
return Arrays.asList(CompareEnum.values());
}
/**
* 判断是否为范围比较操作符
* @param value 操作符值
* @return 是否为范围比较
*/
public static boolean isRangeOperator(String value) {
CompareEnum operator = getByValue(value);
return operator != null && !operator.isSingleValue();
}
}

View File

@@ -0,0 +1,16 @@
package com.maibu.core.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
@AllArgsConstructor
@Getter
public enum ConnectType {
TCP,
MQTT,
HTTP;
}

View File

@@ -0,0 +1,7 @@
package com.maibu.core.enums;
public enum ConnectionCloseReason {
NROMAL,
TIMEOUT,
REPEAT
}

View File

@@ -0,0 +1,7 @@
package com.maibu.core.enums;
public enum ConnectorStatus {
ACTIVE, // 完全可用
RECEIVER, // 禁言(不可发送但可以接收)
DISABLED // 完全不可用
}

View File

@@ -0,0 +1,7 @@
package com.maibu.core.enums;
public enum ConnectorType {
MASTER, // 上位机(主动绑定别人)
SLAVE, // 下位机(只能被动绑定)
GENERAL // 不区分角色(将来扩展用)
}

View File

@@ -0,0 +1,35 @@
package com.maibu.core.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
@Getter
@AllArgsConstructor
public enum DeviceStatus {
online(1, "online", "在线"),
offline(0, "offline", "离线");
private int type;
private String code;
private String description;
public static DeviceStatus convert(int type) {
for (DeviceStatus value : DeviceStatus.values()) {
if (value.type == type) {
return value;
}
}
return null;
}
public static DeviceStatus convert(String code) {
for (DeviceStatus value : DeviceStatus.values()) {
if (value.code.equals(code)) {
return value;
}
}
return null;
}
}

View File

@@ -0,0 +1,18 @@
package com.maibu.core.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
@Getter
@AllArgsConstructor
public enum DeviceTaskPlanRepeatType {
DAY("DAY","天"),
WEEK("WEEK","周"),
MONTH("MONTH","月");
// ONCE("ONCE","单次");
private final String code;
private final String description;
}

View File

@@ -0,0 +1,20 @@
package com.maibu.core.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
@Getter
@AllArgsConstructor
public enum DeviceTaskStaus {
NEW("NEW","新建"),
EXECUTING("EXECUTING","执行中"),
PAUSE("PAUSE","暂停中"),
FINISH("FINISH","执行成功"),
FAILED("FAILED","执行失败");
private final String code;
private final String description;
}

View File

@@ -0,0 +1,42 @@
package com.maibu.core.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
@AllArgsConstructor
@Getter
public enum DeviceType {
/**
* 未知
*/
UNKNOWN(0, "未知"),
/**
* 直连设备
*/
DIRECT_DEVICE(1, "直连设备"),
/**
* 网关设备
*/
GATEWAY(2, "网关设备"),
/**
* 监控设备
*/
CAMERA(3, "监控设备"),
/**
* 网关子设备
*/
SUB_GATEWAY(4,"网关子设备");
private int code;
private String desc;
public static DeviceType transfer(Integer code){
for (DeviceType value : DeviceType.values()) {
if (value.code == code){
return value;
}
}
return DeviceType.DIRECT_DEVICE;
}
}

View File

@@ -0,0 +1,17 @@
package com.maibu.core.enums;
public enum RespondCode {
/**
* 账号已登录
*/
have_logged_in,
/**
* 设备状态改变
*/
device_status_changed,
/**
* 设备错误推送
*/
device_error_push
}

View File

@@ -0,0 +1,29 @@
package com.maibu.influxdb;
import com.maibu.influxdb.inter.InfluxField;
import com.maibu.influxdb.inter.InfluxTag;
import com.maibu.influxdb.inter.InfluxTime;
import com.maibu.influxdb.inter.InfluxMeasurement;
import lombok.Data;
import java.time.Instant;
//@Measurement(name = "device_data")
@Data
@InfluxMeasurement("device_data")
public class DeviceData {
// @Column(tag = true)
@InfluxTag
private String deviceId;
@InfluxField
private Double temperature;
@InfluxField
private Double voltage;
@InfluxTime
private Instant time;
}

View File

@@ -0,0 +1,12 @@
package com.maibu.influxdb.inter;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
public @interface InfluxField {
}

View File

@@ -0,0 +1,9 @@
package com.maibu.influxdb.inter;
import java.lang.annotation.*;
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface InfluxMeasurement {
String value();
}

View File

@@ -0,0 +1,12 @@
package com.maibu.influxdb.inter;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
public @interface InfluxTag {
}

View File

@@ -0,0 +1,12 @@
package com.maibu.influxdb.inter;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
public @interface InfluxTime {
}

View File

@@ -0,0 +1,65 @@
package com.maibu.influxdb;
import com.influxdb.query.FluxRecord;
import com.influxdb.query.FluxTable;
import com.maibu.influxdb.util.InfluxDBUtil;
import com.maibu.influxdb.util.InfluxSqlBuilder;
import org.springframework.beans.factory.annotation.Value;
import java.time.Instant;
import java.util.List;
import java.util.Map;
public class test {
@Value("${ioTDA.serverIp}")
private String serverIp;
// @Value("${ioTDA.deviceId}")
// private String deviceId;
@Value("${ioTDA.secret}")
private String secret;
@Value("${ioTDA.serviceId}")
private String serviceId;
public static void main(String[] args) {
String url = "http://localhost:8086";
String token = "maibu-token";
String org = "maibu";
String bucket = "device_data";
//
// InfluxDBClient client = InfluxDBClientFactory.create(url, token.toCharArray(), org, bucket);
//
//
// WriteApiBlocking writeApi = client.getWriteApiBlocking();
InfluxDBUtil dbUtil = new InfluxDBUtil(url,token,org,bucket);
DeviceData data = new DeviceData();
data.setDeviceId("AGV_001");
data.setTemperature(36.522);
data.setVoltage(48.222);
data.setTime(Instant.now());
String line = InfluxSqlBuilder.buildLine(data);
dbUtil.write(line);
Map<String, String> map = InfluxSqlBuilder.buildTagMap(data,DeviceData::getDeviceId);
String flux = InfluxSqlBuilder.buildQuery(bucket,bucket,10,map,"temperature");
List<FluxTable> tables = dbUtil.query(flux);
for (FluxTable table : tables) {
for (FluxRecord record : table.getRecords()) {
System.out.println(record.getValue());
}
}
}
}

View File

@@ -0,0 +1,110 @@
package com.maibu.influxdb.util;
import com.influxdb.client.*;
import com.influxdb.client.write.events.WriteErrorEvent;
import com.influxdb.client.write.events.WriteSuccessEvent;
import com.influxdb.client.domain.WritePrecision;
import com.influxdb.query.FluxRecord;
import com.influxdb.query.FluxTable;
import java.util.ArrayList;
import java.util.List;
public class InfluxDBUtil {
private InfluxDBClient client;
private WriteApi writeApi;
private String bucket;
private String org;
public InfluxDBUtil(String url, String token, String org, String bucket) {
this.client = InfluxDBClientFactory.create(url, token.toCharArray(), org, bucket);
this.bucket = bucket;
this.org = org;
// ✅ 异步批量写入(核心)
this.writeApi = client.makeWriteApi(
WriteOptions.builder()
.batchSize(5000) // 每5000条写一次
.flushInterval(1000) // 1秒自动flush
.bufferLimit(10000) // 缓冲区
.retryInterval(2000) // 重试间隔
.build()
);
// ✅ 监听写入成功
this.writeApi.listenEvents(WriteSuccessEvent.class, event -> {
// 可关闭或打debug日志
// System.out.println("写入成功");
});
// ✅ 监听异常
this.writeApi.listenEvents(WriteErrorEvent.class, event -> {
System.err.println("InfluxDB写入失败: " + event.getThrowable().getMessage());
});
}
// =========================
// ✅ 批量写入(推荐 Line Protocol)
// =========================
public void writeBatch(List<String> lines) {
for (String line : lines) {
writeApi.writeRecord(bucket, org, WritePrecision.MS, line);
}
}
// =========================
// ✅ 单条写入
// =========================
public void write(String line) {
writeApi.writeRecord(bucket, org, WritePrecision.MS, line);
}
// =========================
// ✅ 查询(返回原始结果)
// =========================
public List<FluxTable> query(String flux) {
QueryApi queryApi = client.getQueryApi();
return queryApi.query(flux);
}
// =========================
// ✅ 查询(转List<Map>)
// =========================
public List<String> queryValues(String flux) {
List<String> resultList = new ArrayList<>();
List<FluxTable> tables = query(flux);
for (FluxTable table : tables) {
for (FluxRecord record : table.getRecords()) {
resultList.add(record.getValue().toString());
}
}
return resultList;
}
// =========================
// ✅ 手动flush(重要)
// =========================
public void flush() {
writeApi.flush();
}
// =========================
// ✅ 关闭资源(必须)
// =========================
public void close() {
try {
if (writeApi != null) {
writeApi.flush();
writeApi.close();
}
} finally {
if (client != null) {
client.close();
}
}
}
}

View File

@@ -0,0 +1,194 @@
package com.maibu.influxdb.util;
import com.maibu.influxdb.inter.InfluxField;
import com.maibu.influxdb.inter.InfluxTag;
import com.maibu.influxdb.inter.InfluxTime;
import com.maibu.influxdb.inter.InfluxMeasurement;
import java.lang.reflect.Field;
import java.util.HashMap;
import java.util.Map;
import java.util.StringJoiner;
public class InfluxSqlBuilder {
/**
* 插入语句拼接
* @param obj
* @return
*/
public static String buildLine(Object obj) {
try {
Class<?> clazz = obj.getClass();
// 1️⃣ measurement
if (!clazz.isAnnotationPresent(InfluxMeasurement.class)) {
throw new RuntimeException("缺少 @InfluxMeasurement");
}
String measurement = clazz.getAnnotation(InfluxMeasurement.class).value();
StringBuilder sb = new StringBuilder();
sb.append(escapeKey(measurement));
StringJoiner tagJoiner = new StringJoiner(",");
StringJoiner fieldJoiner = new StringJoiner(",");
Long timestamp = null;
Field[] fields = clazz.getDeclaredFields();
for (Field field : fields) {
field.setAccessible(true);
Object value = field.get(obj);
if (value == null) continue;
String key = escapeKey(field.getName());
// 2️⃣ tag
if (field.isAnnotationPresent(InfluxTag.class)) {
tagJoiner.add(key + "=" + escapeTagValue(value.toString()));
}
// 3️⃣ field
if (field.isAnnotationPresent(InfluxField.class)) {
fieldJoiner.add(key + "=" + formatFieldValue(value));
}
// 4️⃣ time
if (field.isAnnotationPresent(InfluxTime.class)) {
if (value instanceof Number) {
timestamp = ((Number) value).longValue();
} else if (value instanceof java.time.Instant) {
timestamp = ((java.time.Instant) value).toEpochMilli();
}
}
}
// 拼接 tag
if (tagJoiner.length() > 0) {
sb.append(",").append(tagJoiner.toString());
}
// 拼接 field
if (fieldJoiner.length() == 0) {
throw new RuntimeException("至少要有一个 field");
}
sb.append(" ").append(fieldJoiner.toString());
// 拼接时间
if (timestamp != null) {
sb.append(" ").append(timestamp);
}
return sb.toString();
} catch (Exception e) {
throw new RuntimeException("buildLine失败", e);
}
}
// =========================
// ✅ 构建 Flux 查询
// =========================
public static String buildQuery(
String bucket,
String measurement,
long startSecondsAgo,
Map<String, String> tagFilters,
String field
) {
StringBuilder flux = new StringBuilder();
flux.append("from(bucket:\"").append(bucket).append("\")")
.append(" |> range(start: -").append(startSecondsAgo).append("h)")
.append(" |> filter(fn: (r) => r._measurement == \"")
.append(measurement).append("\")");
// tag过滤
if (tagFilters != null && !tagFilters.isEmpty()) {
for (Map.Entry<String, String> entry : tagFilters.entrySet()) {
flux.append(" |> filter(fn: (r) => r.")
.append(entry.getKey())
.append(" == \"")
.append(entry.getValue())
.append("\")");
}
}
// field过滤
if (field != null) {
flux.append(" |> filter(fn: (r) => r._field == \"")
.append(field)
.append("\")");
}
return flux.toString();
}
/**
* 类的某些属性转换成map
* @param obj
* @param functions
* @return
* @param <T>
*/
public static <T> Map<String, String> buildTagMap(
T obj,
SFunction<T, ?>... functions
) {
Map<String, String> map = new HashMap<>();
try {
for (SFunction<T, ?> fn : functions) {
String fieldName = LambdaUtils.getFieldName(fn);
Field field = obj.getClass().getDeclaredField(fieldName);
field.setAccessible(true);
Object value = field.get(obj);
if (value != null) {
map.put(fieldName, value.toString());
}
}
} catch (Exception e) {
throw new RuntimeException("构建tagMap失败", e);
}
return map;
}
// =========================
// 🔧 转义方法(非常关键)
// =========================
private static String escapeKey(String key) {
return key.replace(" ", "\\ ")
.replace(",", "\\,")
.replace("=", "\\=");
}
private static String escapeTagValue(String value) {
return value.replace(" ", "\\ ")
.replace(",", "\\,")
.replace("=", "\\=");
}
private static String formatFieldValue(Object value) {
if (value instanceof String) {
return "\"" + value + "\"";
}
if (value instanceof Integer || value instanceof Long) {
return value + "i"; // Influx整数必须加 i
}
if (value instanceof Boolean) {
return value.toString();
}
return value.toString(); // double/float
}
}

View File

@@ -0,0 +1,29 @@
package com.maibu.influxdb.util;
import java.beans.Introspector;
import java.lang.invoke.SerializedLambda;
import java.lang.reflect.Method;
public class LambdaUtils {
public static <T> String getFieldName(SFunction<T, ?> fn) {
try {
Method method = fn.getClass().getDeclaredMethod("writeReplace");
method.setAccessible(true);
SerializedLambda lambda = (SerializedLambda) method.invoke(fn);
String methodName = lambda.getImplMethodName(); // getDeviceId
if (methodName.startsWith("get")) {
return Introspector.decapitalize(methodName.substring(3));
} else if (methodName.startsWith("is")) {
return Introspector.decapitalize(methodName.substring(2));
} else {
throw new RuntimeException("不是getter方法");
}
} catch (Exception e) {
throw new RuntimeException("解析字段失败", e);
}
}
}

View File

@@ -0,0 +1,6 @@
package com.maibu.influxdb.util;
@FunctionalInterface
public interface SFunction<T, R> extends java.io.Serializable {
R apply(T source);
}

View File

@@ -0,0 +1,73 @@
package com.maibu.memory;
import com.maibu.core.business.Device;
import com.maibu.core.business.IoTCommonDevice;
import com.maibu.core.business.IoTCommonProduct;
import lombok.Data;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
@Component
@Data
public class GlobalMemory {
// orgId - siteId - deviceId
public static ConcurrentHashMap<Long, IoTCommonDevice> unRegisterCommonDeviceMap = new ConcurrentHashMap<>();
public static ConcurrentHashMap<Long, Device> unRegisterDeviceMap = new ConcurrentHashMap<>();
// key:orgId - siteId
public static ConcurrentHashMap<Long, Map<Long, SiteMemory>> orgAttrs = new ConcurrentHashMap<>();
public static ConcurrentHashMap<Long, IoTCommonProduct> productMap = new ConcurrentHashMap<>();
public SiteMemory getSiteMemory(Long orgId, Long siteId) {
if (orgId != null && siteId != null) {
Map<Long, SiteMemory> siteMemories = orgAttrs.get(orgId);
if (!CollectionUtils.isEmpty(siteMemories)) {
return siteMemories.get(siteId);
}
}
return null;
}
/**
* 新增场站内存
* @param orgId
* @param siteId
* @param siteMemory
*/
public void addSiteMemory(Long orgId, Long siteId, SiteMemory siteMemory) {
if (orgId != null && siteId != null) {
Map<Long, SiteMemory> siteMemories = orgAttrs.get(orgId);
if (CollectionUtils.isEmpty(siteMemories)) {
siteMemories = new HashMap<>();
}
orgAttrs.put(orgId, siteMemories);
siteMemories.put(siteId, siteMemory);
}
}
/**
* 删除
* @param orgId
* @param siteId
*/
public void removeSiteMemory(Long orgId, Long siteId) {
if (orgId != null && siteId != null) {
Map<Long, SiteMemory> siteMemories = orgAttrs.get(orgId);
if (!CollectionUtils.isEmpty(siteMemories)) {
siteMemories.remove(siteId);
}
}
}
}

View File

@@ -0,0 +1,116 @@
package com.maibu.memory;
import cn.hutool.core.util.ObjectUtil;
import com.maibu.core.business.*;
import com.maibu.core.business.device.Connector;
import com.maibu.core.business.device.NettyDevice;
import com.maibu.core.enums.ConnectorStatus;
import com.maibu.core.enums.ConnectorType;
import io.netty.channel.Channel;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors;
@Component
@Data
@Slf4j
public class SiteMemory {
public List<ErrorIdentificationStandard> standard = null;
public Long siteId;
private static final ConcurrentHashMap<String, Device> deviceMap = new ConcurrentHashMap<>();
private static final ConcurrentHashMap<String, IoTCommonDevice> commonDeviceMap = new ConcurrentHashMap<>();
//key deviceId
public static ConcurrentHashMap<String, List<DevicePlan>> devicePlanMap = new ConcurrentHashMap<>();
//key deviceId prepare
public static ConcurrentHashMap<String, List<DevicePlanTask>> devicePlanTaskPrepareMap = new ConcurrentHashMap<>();
//key deviceId execute
public static ConcurrentHashMap<String, DevicePlanTask> devicePlanTaskExecuteMap = new ConcurrentHashMap<>();
public static void saveDevice(Device device) {
deviceMap.put(device.getSerialNumber(), device);
}
public static void removeDevice(String deviceId) {
if (!StringUtils.isEmpty(deviceId)) {
deviceMap.remove(deviceId);
}
}
public static void addDevicePlan(DevicePlan devicePlan) {
if (devicePlan != null && !StringUtils.isEmpty(devicePlan.getDeviceId())) {
String deviceId = devicePlan.getDeviceId();
List<DevicePlan> list = devicePlanMap.get(deviceId);
if (CollectionUtils.isEmpty(list)) {
list = new ArrayList<>();
}
boolean exists = list.stream()
.anyMatch(l -> Objects.equals(l.getId(), devicePlan.getId()));
if (!exists) {
list.add(devicePlan);
}
devicePlanMap.put(deviceId, list);
}
}
public static void removeDevicePlan(DevicePlan devicePlan) {
if (devicePlan != null && !StringUtils.isEmpty(devicePlan.getDeviceId())) {
String deviceId = devicePlan.getDeviceId();
List<DevicePlan> list = devicePlanMap.get(deviceId);
if (!CollectionUtils.isEmpty(list)) {
list.removeIf(x -> x.getId().equals(devicePlan.getId()));
}
}
}
public static void addDevicePlanPrepare(DevicePlanTask devicePlanTask) {
if (devicePlanTask != null && !StringUtils.isEmpty(devicePlanTask.getDeviceId())) {
String deviceId = devicePlanTask.getDeviceId();
List<DevicePlanTask> list = devicePlanTaskPrepareMap.get(deviceId);
if (CollectionUtils.isEmpty(list)) {
list = new ArrayList<>();
}
list.add(devicePlanTask);
devicePlanTaskPrepareMap.put(deviceId, list);
}
}
public static void removeDevicePlanPrepare(DevicePlanTask devicePlanTask) {
if (devicePlanTask != null && !StringUtils.isEmpty(devicePlanTask.getDeviceId())) {
String deviceId = devicePlanTask.getDeviceId();
List<DevicePlanTask> list = devicePlanTaskPrepareMap.get(deviceId);
if (!CollectionUtils.isEmpty(list)) {
list.removeIf(x -> x.getId().equals(devicePlanTask.getId()));
}
}
}
public static void addDevicePlanExecute(DevicePlanTask devicePlanTask) {
if (devicePlanTask != null && !StringUtils.isEmpty(devicePlanTask.getDeviceId())) {
String deviceId = devicePlanTask.getDeviceId();
devicePlanTaskExecuteMap.put(deviceId, devicePlanTask);
}
}
public static void removeDevicePlanExecute(String deviceId) {
if (!StringUtils.isEmpty(deviceId)) {
devicePlanTaskExecuteMap.remove(deviceId);
}
}
}

View File

@@ -0,0 +1,136 @@
package com.maibu.mybatis;
import cn.hutool.core.util.ArrayUtil;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
import org.apache.commons.lang3.ArrayUtils;
import org.springframework.util.StringUtils;
import java.util.Collection;
/**
* 拓展 MyBatis Plus QueryWrapper 类,主要增加如下功能:
* <p>
* 1. 拼接条件的方法,增加 xxxIfPresent 方法,用于判断值不存在的时候,不要拼接到条件中。
*
* @param <T> 数据类型
*/
public class LambdaQueryWrapperX<T> extends LambdaQueryWrapper<T> {
public LambdaQueryWrapperX<T> likeIfPresent(SFunction<T, ?> column, String val) {
if (StringUtils.hasText(val)) {
return (LambdaQueryWrapperX<T>) super.like(column, val);
}
return this;
}
public LambdaQueryWrapperX<T> inIfPresent(SFunction<T, ?> column, Collection<?> values) {
if (!CollectionUtils.isEmpty(values)) {
return (LambdaQueryWrapperX<T>) super.in(column, values);
}
return this;
}
public LambdaQueryWrapperX<T> inIfPresent(SFunction<T, ?> column, Object... values) {
if (!ArrayUtil.isEmpty(values)) {
return (LambdaQueryWrapperX<T>) super.in(column, values);
}
return this;
}
public LambdaQueryWrapperX<T> eqIfPresent(SFunction<T, ?> column, Object val) {
if (ObjectUtil.isNotEmpty(val)) {
return (LambdaQueryWrapperX<T>) super.eq(column, val);
}
return this;
}
public LambdaQueryWrapperX<T> neIfPresent(SFunction<T, ?> column, Object val) {
if (ObjectUtil.isNotEmpty(val)) {
return (LambdaQueryWrapperX<T>) super.ne(column, val);
}
return this;
}
public LambdaQueryWrapperX<T> gtIfPresent(SFunction<T, ?> column, Object val) {
if (val != null) {
return (LambdaQueryWrapperX<T>) super.gt(column, val);
}
return this;
}
public LambdaQueryWrapperX<T> geIfPresent(SFunction<T, ?> column, Object val) {
if (val != null) {
return (LambdaQueryWrapperX<T>) super.ge(column, val);
}
return this;
}
public LambdaQueryWrapperX<T> ltIfPresent(SFunction<T, ?> column, Object val) {
if (val != null) {
return (LambdaQueryWrapperX<T>) super.lt(column, val);
}
return this;
}
public LambdaQueryWrapperX<T> leIfPresent(SFunction<T, ?> column, Object val) {
if (val != null) {
return (LambdaQueryWrapperX<T>) super.le(column, val);
}
return this;
}
public LambdaQueryWrapperX<T> betweenIfPresent(SFunction<T, ?> column, Object val1, Object val2) {
if (val1 != null && val2 != null) {
return (LambdaQueryWrapperX<T>) super.between(column, val1, val2);
}
if (val1 != null) {
return (LambdaQueryWrapperX<T>) ge(column, val1);
}
if (val2 != null) {
return (LambdaQueryWrapperX<T>) le(column, val2);
}
return this;
}
public LambdaQueryWrapperX<T> betweenIfPresent(SFunction<T, ?> column, Object[] values) {
Object val1 = ArrayUtils.get(values, 0);
Object val2 = ArrayUtils.get(values, 1);
return betweenIfPresent(column, val1, val2);
}
// ========== 重写父类方法,方便链式调用 ==========
@Override
public LambdaQueryWrapperX<T> eq(boolean condition, SFunction<T, ?> column, Object val) {
super.eq(condition, column, val);
return this;
}
@Override
public LambdaQueryWrapperX<T> eq(SFunction<T, ?> column, Object val) {
super.eq(column, val);
return this;
}
@Override
public LambdaQueryWrapperX<T> orderByDesc(SFunction<T, ?> column) {
super.orderByDesc(true, column);
return this;
}
@Override
public LambdaQueryWrapperX<T> last(String lastSql) {
super.last(lastSql);
return this;
}
@Override
public LambdaQueryWrapperX<T> in(SFunction<T, ?> column, Collection<?> coll) {
super.in(column, coll);
return this;
}
}

View File

@@ -0,0 +1,140 @@
package com.maibu.mybatis;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.ArrayUtils;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import org.springframework.util.StringUtils;
import java.util.Collection;
/**
* 拓展 MyBatis Plus QueryWrapper 类,主要增加如下功能:
*
* 1. 拼接条件的方法,增加 xxxIfPresent 方法,用于判断值不存在的时候,不要拼接到条件中。
*
* @param <T> 数据类型
*/
public class QueryWrapperX<T> extends QueryWrapper<T> {
public QueryWrapperX<T> likeIfPresent(String column, String val) {
if (StringUtils.hasText(val)) {
return (QueryWrapperX<T>) super.like(column, val);
}
return this;
}
public QueryWrapperX<T> inIfPresent(String column, Collection<?> values) {
if (!CollectionUtils.isEmpty(values)) {
return (QueryWrapperX<T>) super.in(column, values);
}
return this;
}
public QueryWrapperX<T> inIfPresent(String column, Object... values) {
if (!ArrayUtils.isEmpty(values)) {
return (QueryWrapperX<T>) super.in(column, values);
}
return this;
}
public QueryWrapperX<T> eqIfPresent(String column, Object val) {
if (val != null) {
return (QueryWrapperX<T>) super.eq(column, val);
}
return this;
}
public QueryWrapperX<T> neIfPresent(String column, Object val) {
if (val != null) {
return (QueryWrapperX<T>) super.ne(column, val);
}
return this;
}
public QueryWrapperX<T> gtIfPresent(String column, Object val) {
if (val != null) {
return (QueryWrapperX<T>) super.gt(column, val);
}
return this;
}
public QueryWrapperX<T> geIfPresent(String column, Object val) {
if (val != null) {
return (QueryWrapperX<T>) super.ge(column, val);
}
return this;
}
public QueryWrapperX<T> ltIfPresent(String column, Object val) {
if (val != null) {
return (QueryWrapperX<T>) super.lt(column, val);
}
return this;
}
public QueryWrapperX<T> leIfPresent(String column, Object val) {
if (val != null) {
return (QueryWrapperX<T>) super.le(column, val);
}
return this;
}
public QueryWrapperX<T> betweenIfPresent(String column, Object val1, Object val2) {
if (val1 != null && val2 != null) {
return (QueryWrapperX<T>) super.between(column, val1, val2);
}
if (val1 != null) {
return (QueryWrapperX<T>) ge(column, val1);
}
if (val2 != null) {
return (QueryWrapperX<T>) le(column, val2);
}
return this;
}
public QueryWrapperX<T> betweenIfPresent(String column, Object[] values) {
if (values!= null && values.length != 0 && values[0] != null && values[1] != null) {
return (QueryWrapperX<T>) super.between(column, values[0], values[1]);
}
if (values!= null && values.length != 0 && values[0] != null) {
return (QueryWrapperX<T>) ge(column, values[0]);
}
if (values!= null && values.length != 0 && values[1] != null) {
return (QueryWrapperX<T>) le(column, values[1]);
}
return this;
}
// ========== 重写父类方法,方便链式调用 ==========
@Override
public QueryWrapperX<T> eq(boolean condition, String column, Object val) {
super.eq(condition, column, val);
return this;
}
@Override
public QueryWrapperX<T> eq(String column, Object val) {
super.eq(column, val);
return this;
}
@Override
public QueryWrapperX<T> orderByDesc(String column) {
super.orderByDesc(true, column);
return this;
}
@Override
public QueryWrapperX<T> last(String lastSql) {
super.last(lastSql);
return this;
}
@Override
public QueryWrapperX<T> in(String column, Collection<?> coll) {
super.in(column, coll);
return this;
}
}

View File

@@ -0,0 +1,131 @@
package com.maibu.mybatis.mapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
import com.baomidou.mybatisplus.extension.toolkit.Db;
import com.maibu.core.domain.PageParam;
import com.maibu.core.domain.PageResult;
import com.maibu.mybatis.utils.MyBatisUtils;
import org.apache.ibatis.annotations.Param;
import java.util.Collection;
import java.util.List;
/**
* 在 MyBatis Plus 的 BaseMapper 的基础上拓展,提供更多的能力
* <p>
* 为什么继承 MPJBaseMapper 接口?支持 MyBatis Plus 多表 Join 的能力。
*/
public interface BaseMapperX<T> extends BaseMapper<T> {
default PageResult<T> selectPage(PageParam pageParam, @Param("ew") Wrapper<T> queryWrapper) {
// MyBatis Plus 查询
IPage<T> mpPage = MyBatisUtils.buildPage(pageParam);
selectPage(mpPage, queryWrapper);
// 转换返回
return new PageResult<>(mpPage.getRecords(), mpPage.getTotal());
}
default T selectOne(String field, Object value) {
return selectOne(new QueryWrapper<T>().eq(field, value));
}
default T selectOne(SFunction<T, ?> field, Object value) {
return selectOne(new LambdaQueryWrapper<T>().eq(field, value));
}
default T selectOne(String field1, Object value1, String field2, Object value2) {
return selectOne(new QueryWrapper<T>().eq(field1, value1).eq(field2, value2));
}
default T selectOne(SFunction<T, ?> field1, Object value1, SFunction<T, ?> field2, Object value2) {
return selectOne(new LambdaQueryWrapper<T>().eq(field1, value1).eq(field2, value2));
}
default Long selectCount() {
return selectCount(new QueryWrapper<T>());
}
default Long selectCount(String field, Object value) {
return selectCount(new QueryWrapper<T>().eq(field, value));
}
default Long selectCount(SFunction<T, ?> field, Object value) {
return selectCount(new LambdaQueryWrapper<T>().eq(field, value));
}
default List<T> selectList() {
return selectList(new QueryWrapper<>());
}
default List<T> selectList(String field, Object value) {
return selectList(new QueryWrapper<T>().eq(field, value));
}
default List<T> selectList(SFunction<T, ?> field, Object value) {
return selectList(new LambdaQueryWrapper<T>().eq(field, value));
}
default List<T> selectList(String field, Collection<?> values) {
return selectList(new QueryWrapper<T>().in(field, values));
}
default List<T> selectList(SFunction<T, ?> field, Collection<?> values) {
return selectList(new LambdaQueryWrapper<T>().in(field, values));
}
default List<T> selectList(SFunction<T, ?> leField, SFunction<T, ?> geField, Object value) {
return selectList(new LambdaQueryWrapper<T>().le(leField, value).ge(geField, value));
}
/**
* 批量插入,适合大量数据插入
*
* @param entities 实体们
*/
default void insertBatch(Collection<T> entities) {
Db.saveBatch(entities);
}
/**
* 批量插入,适合大量数据插入
*
* @param entities 实体们
* @param size 插入数量 Db.saveBatch 默认为 1000
*/
default void insertBatch(Collection<T> entities, int size) {
Db.saveBatch(entities, size);
}
default void updateBatch(T update) {
update(update, new QueryWrapper<>());
}
default void updateBatch(Collection<T> entities, int size) {
Db.updateBatchById(entities, size);
}
/**
* 保存或更新
* @param entity 实体
* @return 是否成功
*/
default boolean saveOrUpdate(T entity) {
return Db.saveOrUpdate(entity);
}
/**
* 批量保存或更新
* @param entities 实体集合
* @return 是否成功
*/
default boolean saveOrUpdateBatch(Collection<T> entities) {
return Db.saveOrUpdateBatch(entities);
}
}

View File

@@ -0,0 +1,88 @@
package com.maibu.mybatis.utils;
import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.baomidou.mybatisplus.core.toolkit.StringPool;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.InnerInterceptor;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.maibu.core.domain.PageParam;
import com.maibu.core.domain.SortingField;
import net.sf.jsqlparser.expression.Alias;
import net.sf.jsqlparser.schema.Column;
import net.sf.jsqlparser.schema.Table;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.stream.Collectors;
/**
* MyBatis 工具类
*/
public class MyBatisUtils {
private static final String MYSQL_ESCAPE_CHARACTER = "`";
public static <T> Page<T> buildPage(PageParam pageParam) {
return buildPage(pageParam, null);
}
public static <T> Page<T> buildPage(PageParam pageParam, Collection<SortingField> sortingFields) {
// 页码 + 数量
Page<T> page = new Page<>(pageParam.getPageNo(), pageParam.getPageSize());
// 排序字段
if (!CollectionUtil.isEmpty(sortingFields)) {
page.addOrder(sortingFields.stream().map(sortingField -> SortingField.ORDER_ASC.equals(sortingField.getOrder()) ?
OrderItem.asc(sortingField.getField()) : OrderItem.desc(sortingField.getField()))
.collect(Collectors.toList()));
}
return page;
}
/**
* 将拦截器添加到链中
* 由于 MybatisPlusInterceptor 不支持添加拦截器,所以只能全量设置
*
* @param interceptor 链
* @param inner 拦截器
* @param index 位置
*/
public static void addInterceptor(MybatisPlusInterceptor interceptor, InnerInterceptor inner, int index) {
List<InnerInterceptor> inners = new ArrayList<>(interceptor.getInterceptors());
inners.add(index, inner);
interceptor.setInterceptors(inners);
}
/**
* 获得 Table 对应的表名
*
* 兼容 MySQL 转义表名 `t_xxx`
*
* @param table 表
* @return 去除转移字符后的表名
*/
public static String getTableName(Table table) {
String tableName = table.getName();
if (tableName.startsWith(MYSQL_ESCAPE_CHARACTER) && tableName.endsWith(MYSQL_ESCAPE_CHARACTER)) {
tableName = tableName.substring(1, tableName.length() - 1);
}
return tableName;
}
/**
* 构建 Column 对象
*
* @param tableName 表名
* @param tableAlias 别名
* @param column 字段名
* @return Column 对象
*/
public static Column buildColumn(String tableName, Alias tableAlias, String column) {
if (tableAlias != null) {
tableName = tableAlias.getName();
}
return new Column(tableName + StringPool.DOT + column);
}
}

View File

@@ -0,0 +1,25 @@
package com.maibu.enums;
public enum Language {
ZH_CN("zh-CN"),
EN("en-US"),
DEFAULT("default");
private String value;
Language(String value) {
this.value = value;
}
public String getValue() {
return value;
}
public static String matches(String language) {
if(language.equals("zh")){
return Language.ZH_CN.value;
}else {
return Language.EN.value;
}
}
}

View File

@@ -0,0 +1,13 @@
package com.maibu.mapper;
import com.maibu.core.domain.entity.SysRegion;
import com.maibu.mybatis.mapper.BaseMapperX;
import org.springframework.stereotype.Repository;
/**
* 设备历史状态
*/
@Repository
public interface SysRegionMapper extends BaseMapperX<SysRegion> {
}

View File

@@ -0,0 +1,67 @@
package com.maibu.service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.maibu.core.domain.entity.SysRegion;
import com.maibu.mapper.SysRegionMapper;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
@Service
public class SysRegionService {
@Autowired
private SysRegionMapper sysRegionMapper;
public List<SysRegion> list(SysRegion region) {
LambdaQueryWrapper<SysRegion> queryWrapper = new LambdaQueryWrapper<>();
if (region != null && !StringUtils.isEmpty(region.getRegionName())) {
queryWrapper.like(SysRegion::getRegionName, region.getRegionName());
}
return sysRegionMapper.selectList(queryWrapper);
}
public boolean save(SysRegion org) {
return sysRegionMapper.saveOrUpdate(org);
}
public int delete(List<Long> ids) {
return sysRegionMapper.deleteBatchIds(ids);
}
public void deleteAll(List<Long> ids) {
List<Long> regionIds = getIdsBySiteIds(ids);
if(!CollectionUtils.isEmpty(regionIds)){
delete(regionIds);
}
}
public List<Long> getIdsBySiteIds(List<Long> ids) {
LambdaQueryWrapper<SysRegion> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.in(SysRegion::getSiteId, ids);
List<SysRegion> list = sysRegionMapper.selectList(queryWrapper);
if(!CollectionUtils.isEmpty(list)){
return list.stream().map(SysRegion::getId).collect(Collectors.toList());
}else{
return new ArrayList<>();
}
}
public SysRegion selectById(Long id) {
return sysRegionMapper.selectById(id);
}
public List<SysRegion> selectBySiteId(Long id) {
LambdaQueryWrapper<SysRegion> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(SysRegion::getSiteId, id);
return sysRegionMapper.selectList(queryWrapper);
}
}