#update
This commit is contained in:
257
.idea/workspace.xml
generated
257
.idea/workspace.xml
generated
@@ -5,31 +5,175 @@
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="84ac1b15-3cfa-4375-9957-45b7b581d04e" name="Changes" comment="#update">
|
||||
<change afterPath="$PROJECT_DIR$/maibu-admin/src/main/java/com/maibu/web/controller/system/SysOrgController.java" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/maibu-admin/src/main/java/com/maibu/web/controller/system/SysSiteController.java" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/controller/DeviceController.java" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/maibu-service/maibu-system-service/src/main/java/com/maibu/mapper/SysOrgMapper.java" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/maibu-service/maibu-system-service/src/main/java/com/maibu/mapper/SysSiteMapper.java" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/maibu-service/maibu-system-service/src/main/java/com/maibu/service/SysOrgService.java" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/maibu-service/maibu-system-service/src/main/java/com/maibu/service/SysSiteService.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.gitignore" beforeDir="false" afterPath="$PROJECT_DIR$/.gitignore" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-admin/pom.xml" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-admin/pom.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-admin/src/main/java/com/maibu/MiddlePlatformApplication.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-admin/src/main/java/com/maibu/MiddlePlatformApplication.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-admin/src/main/java/com/maibu/web/controller/system/SysDeptController.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-admin/src/main/java/com/maibu/web/controller/system/SysDeptController.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-admin/src/main/java/com/maibu/web/controller/system/SysLoginController.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-admin/src/main/java/com/maibu/web/controller/system/SysLoginController.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-admin/src/main/java/com/maibu/web/controller/system/SysMenuController.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-admin/src/main/java/com/maibu/web/controller/system/SysMenuController.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-admin/src/main/java/com/maibu/web/controller/system/SysOrgController.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-admin/src/main/java/com/maibu/web/controller/system/SysOrgController.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-admin/src/main/java/com/maibu/web/controller/system/SysPostController.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-admin/src/main/java/com/maibu/web/controller/system/SysProfileController.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-admin/src/main/java/com/maibu/web/controller/system/SysProfileController.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-admin/src/main/java/com/maibu/web/controller/system/SysRoleController.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-admin/src/main/java/com/maibu/web/controller/system/SysRoleController.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-admin/src/main/java/com/maibu/web/controller/system/SysSiteController.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-admin/src/main/java/com/maibu/web/controller/system/SysSiteController.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-admin/src/main/java/com/maibu/web/controller/system/SysUserController.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-admin/src/main/java/com/maibu/web/controller/system/SysUserController.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-admin/src/main/resources/application-dev.yml" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-admin/src/main/resources/application-dev.yml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-admin/src/main/resources/application.yml" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-admin/src/main/resources/application.yml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-common/src/main/java/com/maibu/core/device/DeviceAndProtocol.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-common/pom.xml" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-common/pom.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-common/src/main/java/com/maibu/core/domain/BaseDO.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-common/src/main/java/com/maibu/core/domain/BaseDO.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-common/src/main/java/com/maibu/core/domain/entity/SysMenu.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-common/src/main/java/com/maibu/core/domain/entity/SysMenu.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-common/src/main/java/com/maibu/core/domain/entity/SysOrg.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-common/src/main/java/com/maibu/core/domain/entity/SysOrg.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-common/src/main/java/com/maibu/core/domain/entity/SysRole.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-common/src/main/java/com/maibu/core/domain/entity/SysRole.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-common/src/main/java/com/maibu/core/domain/entity/SysUser.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-common/src/main/java/com/maibu/core/domain/entity/SysUser.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-framework/src/main/java/com/maibu/config/SecurityConfig.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-framework/src/main/java/com/maibu/config/SecurityConfig.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-netty-server/src/main/java/com/maibu/dto/DeviceBindDTO.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-netty-server/src/main/java/com/maibu/dto/DeviceBindDTO.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-common/src/main/java/com/maibu/core/domain/model/LoginUser.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-common/src/main/java/com/maibu/core/domain/model/LoginUser.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-common/src/main/java/com/maibu/enums/CommonStatusEnum.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-common/src/main/java/com/maibu/enums/DataEnum.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-common/src/main/java/com/maibu/enums/DeviceDistributeTypeEnum.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-common/src/main/java/com/maibu/enums/DeviceLogTypeEnum.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-common/src/main/java/com/maibu/enums/DeviceRecordTypeEnum.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-common/src/main/java/com/maibu/enums/JobType.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-common/src/main/java/com/maibu/enums/PushType.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-common/src/main/java/com/maibu/enums/ResultCode.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-common/src/main/java/com/maibu/enums/StatusEnum.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-common/src/main/java/com/maibu/exception/iot/MqttAuthorizationException.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-common/src/main/java/com/maibu/exception/iot/MqttClientUserNameOrPassException.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-common/src/main/java/com/maibu/exception/job/TaskException.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-common/src/main/java/com/maibu/utils/SecurityUtils.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-common/src/main/java/com/maibu/utils/SecurityUtils.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-external/src/main/java/com/maibu/own/controller/CommonDeviceController.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-external/src/main/java/com/maibu/own/controller/CommonDeviceController.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-external/src/main/java/com/maibu/own/service/CommonDeviceService.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-external/src/main/java/com/maibu/own/service/CommonDeviceService.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-framework/pom.xml" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-framework/pom.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-framework/src/main/java/com/maibu/mybatis/LambdaQueryWrapperX.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-framework/src/main/java/com/maibu/mybatis/QueryWrapperX.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-framework/src/main/java/com/maibu/mybatis/mapper/BaseMapperX.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-framework/src/main/java/com/maibu/mybatis/utils/MyBatisUtils.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-framework/src/main/java/com/maibu/web/service/SysLoginService.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-framework/src/main/java/com/maibu/web/service/SysLoginService.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-framework/src/main/java/com/maibu/web/service/UserDetailsServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-framework/src/main/java/com/maibu/web/service/UserDetailsServiceImpl.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-iotDA/src/main/java/com/maibu/utils/IoTDAMqttClient.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-iotDA/src/main/java/com/maibu/utils/IoTDAMqttClient.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-netty-server/src/main/java/com/maibu/common/Constant.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-netty-server/src/main/java/com/maibu/common/Constant.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-netty-server/src/main/java/com/maibu/controller/DeviceExternalApiController.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-netty-server/src/main/java/com/maibu/controller/DeviceExternalApiController.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-netty-server/src/main/java/com/maibu/controller/DeviceTaskController.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-netty-server/src/main/java/com/maibu/controller/DeviceTaskController.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-netty-server/src/main/java/com/maibu/controller/NettyDeviceController.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-netty-server/src/main/java/com/maibu/controller/NettyDeviceController.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-netty-server/src/main/java/com/maibu/dto/Connector.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-common/src/main/java/com/maibu/core/business/device/Connector.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-netty-server/src/main/java/com/maibu/dto/DeviceErrorPushDTO.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-netty-server/src/main/java/com/maibu/dto/DeviceErrorPushDTO.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-netty-server/src/main/java/com/maibu/dto/DeviceLoginResponseDTO.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-netty-server/src/main/java/com/maibu/dto/DeviceLoginResponseDTO.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-netty-server/src/main/java/com/maibu/dto/DeviceRequestDTO.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-netty-server/src/main/java/com/maibu/dto/DeviceRequestDTO.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-netty-server/src/main/java/com/maibu/dto/DeviceStatusChangeDTO.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-netty-server/src/main/java/com/maibu/dto/DeviceStatusChangeDTO.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-netty-server/src/main/java/com/maibu/dto/DeviceTaskQueryDTO.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-netty-server/src/main/java/com/maibu/dto/DeviceTaskQueryDTO.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-netty-server/src/main/java/com/maibu/dto/NettyDevice.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-common/src/main/java/com/maibu/core/business/device/NettyDevice.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-netty-server/src/main/java/com/maibu/entity/ErrorIdentificationStandard.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-common/src/main/java/com/maibu/core/business/ErrorIdentificationStandard.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-netty-server/src/main/java/com/maibu/entity/path/LatAndLngEntity.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-common/src/main/java/com/maibu/core/business/path/LatAndLngEntity.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-netty-server/src/main/java/com/maibu/entity/path/MowingPathGenerator.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-common/src/main/java/com/maibu/core/business/path/MowingPathGenerator.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-netty-server/src/main/java/com/maibu/entity/path/RPPathData.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-common/src/main/java/com/maibu/core/business/path/RPPathData.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-netty-server/src/main/java/com/maibu/entity/path/RoutePlanRecEntity.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-common/src/main/java/com/maibu/core/business/path/RoutePlanRecEntity.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-netty-server/src/main/java/com/maibu/entity/path/RoutePlanSendEntity.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-common/src/main/java/com/maibu/core/business/path/RoutePlanSendEntity.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-netty-server/src/main/java/com/maibu/enums/CommandRequestType.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-netty-server/src/main/java/com/maibu/enums/CompareEnum.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-netty-server/src/main/java/com/maibu/enums/ConnectionCloseReason.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-netty-server/src/main/java/com/maibu/enums/ConnectorStatus.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-netty-server/src/main/java/com/maibu/enums/ConnectorType.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-netty-server/src/main/java/com/maibu/enums/DeviceStatus.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-netty-server/src/main/java/com/maibu/enums/RespondCode.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-netty-server/src/main/java/com/maibu/init/InitThread.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-netty-server/src/main/java/com/maibu/init/InitThread.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-netty-server/src/main/java/com/maibu/manager/DeviceSessionManager.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-netty-server/src/main/java/com/maibu/manager/DeviceSessionManager.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-netty-server/src/main/java/com/maibu/mapper/ErrorIdentificationStandardMapper.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-netty-server/src/main/java/com/maibu/mapper/ErrorIdentificationStandardMapper.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-netty-server/src/main/java/com/maibu/memory/GlobalMemory.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-netty-server/src/main/java/com/maibu/netty/handler/CommandForwardHandler.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-netty-server/src/main/java/com/maibu/netty/handler/CommandForwardHandler.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-netty-server/src/main/java/com/maibu/netty/handler/DataToDataBaseHandler.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-netty-server/src/main/java/com/maibu/netty/handler/DataToDataBaseHandler.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-netty-server/src/main/java/com/maibu/netty/handler/DeviceConnectHandler.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-netty-server/src/main/java/com/maibu/netty/handler/DeviceConnectHandler.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-netty-server/src/main/java/com/maibu/scheduled/ScheduledTask.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-netty-server/src/main/java/com/maibu/scheduled/ScheduledTask.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-netty-server/src/main/java/com/maibu/service/DevicePlanTaskMonitorService.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-netty-server/src/main/java/com/maibu/service/DevicePlanTaskMonitorService.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-netty-server/src/main/java/com/maibu/service/DeviceTaskService.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-netty-server/src/main/java/com/maibu/service/DeviceTaskService.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-netty-server/src/main/java/com/maibu/service/DeviceThreadService.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-netty-server/src/main/java/com/maibu/service/DeviceThreadService.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-netty-server/src/main/java/com/maibu/service/NettyDeviceService.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-netty-server/src/main/java/com/maibu/service/NettyDeviceService.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-netty-server/src/main/java/com/maibu/service/TransferDeviceService.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-netty-server/src/main/java/com/maibu/service/TransferDeviceService.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/domain/Bridge.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/domain/Device.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/domain/Device.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-netty-server/src/main/java/com/maibu/utils/CompareUtils.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-netty-server/src/main/java/com/maibu/utils/CompareUtils.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/controller/DeviceController.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/controller/DeviceController.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/domain/Category.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/domain/Device.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/domain/DevicePlan.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/domain/DevicePlanTask.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/domain/DeviceRunStatistics.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/domain/DeviceRunningStatusHistory.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/domain/DeviceStatusRecordDTO.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/domain/DeviceTaskPlanRule.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/domain/EventLog.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/domain/IoTCommonDevice.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-common/src/main/java/com/maibu/core/business/IoTCommonDevice.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/domain/IoTCommonDeviceAction.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-common/src/main/java/com/maibu/core/business/IoTCommonDeviceAction.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/domain/IoTCommonProduct.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-common/src/main/java/com/maibu/core/business/IoTCommonProduct.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/domain/IoTCommonThingsModel.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-common/src/main/java/com/maibu/core/business/IoTCommonThingsModel.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/enums/ConnectType.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/enums/DeviceTaskPlanRepeatType.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/enums/DeviceTaskStaus.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/enums/DeviceType.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/mapper/CategoryMapper.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/mapper/DeviceMapper.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/mapper/DeviceMapper.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/mapper/DevicePlanMapper.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/mapper/DevicePlanMapper.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/mapper/DevicePlanTaskMapper.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/mapper/DevicePlanTaskMapper.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/mapper/DeviceRunStatisticsMapper.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/mapper/DeviceRunStatisticsMapper.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/mapper/DeviceStatusHistoryMapper.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/mapper/DeviceStatusHistoryMapper.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/mapper/EventLogMapper.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/mapper/EventLogMapper.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/mapper/IoTCommonDevicesMapper.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/mapper/IoTCommonDevicesMapper.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/mapper/MqttClientMapper.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/mapper/WorkRecordMapper.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/mapper/WorkRecordMapper.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/memory/CommonMemory.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/model/AuthenticateInputModel.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/model/DeviceAlertCount.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/model/DeviceAllShortOutput.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/model/DeviceMqttVO.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/model/DeviceNumberStatus.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/model/DeviceRelateAlertLogVO.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/model/DeviceRunningStatus.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/model/DeviceStatistic.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/model/DeviceStatusVO.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/model/HistoryModel.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/model/IdAndName.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/model/MonitorModel.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/model/ProductAuthenticateModel.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/model/ProductCode.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/model/RegisterUserInput.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/model/RegisterUserOutput.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/model/UserIdDeviceIdModel.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/model/UserSocialProfile.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/model/WorkRecord.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/model/gateWay/ProductSubGatewayVO.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/model/param/DataCenterParam.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/service/ICategoryService.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/service/IDeviceService.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/service/IDeviceService.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/service/IEventLogService.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/service/IEventLogService.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/service/IToolService.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/service/IToolService.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/service/IUserSocialProfileService.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/service/IWorkRecordService.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/service/IWorkRecordService.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/service/impl/CategoryServiceImpl.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/service/impl/DeviceServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/service/impl/DeviceServiceImpl.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/service/impl/EventLogServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/service/impl/EventLogServiceImpl.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/service/impl/ToolServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/service/impl/ToolServiceImpl.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/service/impl/WorkRecordServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/service/impl/WorkRecordServiceImpl.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/resources/mapper/iot/DeviceMapper.xml" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/resources/mapper/iot/DeviceMapper.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/resources/mapper/iot/EventLogMapper.xml" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/resources/mapper/iot/EventLogMapper.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/resources/mapper/iot/WorkRecordMapper.xml" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/resources/mapper/iot/WorkRecordMapper.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-system-service/pom.xml" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-service/maibu-system-service/pom.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-system-service/src/main/java/com/maibu/domain/SysPost.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-system-service/src/main/java/com/maibu/domain/SysUserPost.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-system-service/src/main/java/com/maibu/enums/Language.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-system-service/src/main/java/com/maibu/mapper/SysPostMapper.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-system-service/src/main/java/com/maibu/mapper/SysRoleMenuMapper.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-service/maibu-system-service/src/main/java/com/maibu/mapper/SysRoleMenuMapper.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-system-service/src/main/java/com/maibu/mapper/SysUserMapper.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-service/maibu-system-service/src/main/java/com/maibu/mapper/SysUserMapper.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-system-service/src/main/java/com/maibu/mapper/SysUserPostMapper.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-system-service/src/main/java/com/maibu/service/ISysMenuService.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-service/maibu-system-service/src/main/java/com/maibu/service/ISysMenuService.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-system-service/src/main/java/com/maibu/service/ISysPostService.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-system-service/src/main/java/com/maibu/service/ISysRoleService.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-service/maibu-system-service/src/main/java/com/maibu/service/ISysRoleService.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-system-service/src/main/java/com/maibu/service/ISysUserService.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-service/maibu-system-service/src/main/java/com/maibu/service/ISysUserService.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-system-service/src/main/java/com/maibu/service/SysOrgService.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-service/maibu-system-service/src/main/java/com/maibu/service/SysOrgService.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-system-service/src/main/java/com/maibu/service/SysSiteService.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-service/maibu-system-service/src/main/java/com/maibu/service/SysSiteService.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-system-service/src/main/java/com/maibu/service/impl/SysMenuServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-service/maibu-system-service/src/main/java/com/maibu/service/impl/SysMenuServiceImpl.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-system-service/src/main/java/com/maibu/service/impl/SysPostServiceImpl.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-system-service/src/main/java/com/maibu/service/impl/SysRoleServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-service/maibu-system-service/src/main/java/com/maibu/service/impl/SysRoleServiceImpl.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-system-service/src/main/java/com/maibu/service/impl/SysUserOnlineServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-service/maibu-system-service/src/main/java/com/maibu/service/impl/SysUserOnlineServiceImpl.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-system-service/src/main/java/com/maibu/service/impl/SysUserServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-service/maibu-system-service/src/main/java/com/maibu/service/impl/SysUserServiceImpl.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-system-service/src/main/resources/system/SysPostMapper.xml" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-system-service/src/main/resources/system/SysRoleMapper.xml" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-service/maibu-system-service/src/main/resources/system/SysRoleMapper.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-system-service/src/main/resources/system/SysRoleMenuMapper.xml" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-service/maibu-system-service/src/main/resources/system/SysRoleMenuMapper.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-system-service/src/main/resources/system/SysUserMapper.xml" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-service/maibu-system-service/src/main/resources/system/SysUserMapper.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-service/maibu-system-service/src/main/resources/system/SysUserPostMapper.xml" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/maibu-web-middleware/src/main/java/com/maibu/websocket/WebsocketHandler.java" beforeDir="false" afterPath="$PROJECT_DIR$/maibu-web-middleware/src/main/java/com/maibu/websocket/WebsocketHandler.java" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
@@ -61,6 +205,7 @@
|
||||
<component name="PropertiesComponent">{
|
||||
"keyToString": {
|
||||
"ASKED_SHARE_PROJECT_CONFIGURATION_FILES": "true",
|
||||
"Application.test.executor": "Debug",
|
||||
"Maven.MiddlePlatform [clean].executor": "Run",
|
||||
"Maven.MiddlePlatform [install].executor": "Run",
|
||||
"Maven.maibu-netty-server [clean].executor": "Run",
|
||||
@@ -77,7 +222,7 @@
|
||||
"Spring Boot.MiddlePlatformApplication.executor": "Debug",
|
||||
"git-widget-placeholder": "main",
|
||||
"kotlin-language-version-configured": "true",
|
||||
"last_opened_file_path": "/home/maibu/Test/MiddlePlatform/maibu-service/maibu-iot-service/src/main/java/com/maibu/controller",
|
||||
"last_opened_file_path": "/home/maibu/Test/MiddlePlatform/maibu-common/src/main/java/com/maibu/core/business",
|
||||
"node.js.detected.package.eslint": "true",
|
||||
"node.js.detected.package.tslint": "true",
|
||||
"node.js.selected.package.eslint": "(autodetect)",
|
||||
@@ -96,8 +241,8 @@
|
||||
<window_info id="Commit_Guest" show_stripe_button="false" />
|
||||
<window_info id="Pull Requests" />
|
||||
<window_info id="Learn" show_stripe_button="false" />
|
||||
<window_info content_ui="combo" id="Project" order="0" weight="0.28090215" />
|
||||
<window_info active="true" id="Commit" order="1" visible="true" weight="0.28090215" />
|
||||
<window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.30316347" />
|
||||
<window_info id="Commit" order="1" weight="0.28090215" />
|
||||
<window_info id="Structure" order="2" side_tool="true" weight="0.25" />
|
||||
<window_info anchor="bottom" id="Database Changes" />
|
||||
<window_info anchor="bottom" id="TypeScript" />
|
||||
@@ -110,9 +255,9 @@
|
||||
<window_info anchor="bottom" id="Terminal" order="3" />
|
||||
<window_info anchor="bottom" id="Services" order="4" />
|
||||
<window_info anchor="bottom" id="Build" order="5" weight="0.3302257" />
|
||||
<window_info anchor="bottom" id="Run" order="6" weight="0.30961728" />
|
||||
<window_info anchor="bottom" id="Run" order="6" weight="0.3302257" />
|
||||
<window_info anchor="bottom" id="Find" order="7" weight="0.3302257" />
|
||||
<window_info anchor="bottom" id="Debug" order="8" weight="0.5019627" />
|
||||
<window_info anchor="bottom" id="Debug" order="8" visible="true" weight="0.3370952" />
|
||||
<window_info anchor="right" id="Endpoints" />
|
||||
<window_info anchor="right" id="documentation.v2" show_stripe_button="false" side_tool="true" />
|
||||
<window_info anchor="right" id="Coverage" side_tool="true" />
|
||||
@@ -121,26 +266,39 @@
|
||||
<window_info anchor="right" id="AIAssistant" order="1" weight="0.25" />
|
||||
<window_info anchor="right" id="Database" order="2" weight="0.25" />
|
||||
<window_info anchor="right" id="Gradle" order="3" weight="0.25" />
|
||||
<window_info active="true" anchor="right" id="Maven" order="4" visible="true" weight="0.12214411" />
|
||||
<window_info anchor="right" id="Maven" order="4" weight="0.20415935" />
|
||||
</layout>
|
||||
</component>
|
||||
<component name="RecentsManager">
|
||||
<key name="CopyFile.RECENT_KEYS">
|
||||
<recent name="$PROJECT_DIR$/maibu-common/src/main/java/com/maibu/core/business" />
|
||||
<recent name="$PROJECT_DIR$/maibu-common/src/main/java/com/maibu/core/enums" />
|
||||
<recent name="$PROJECT_DIR$/maibu-common/src/main/java/com/maibu" />
|
||||
<recent name="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/controller" />
|
||||
<recent name="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/service/impl" />
|
||||
<recent name="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/service" />
|
||||
<recent name="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/mapper" />
|
||||
<recent name="$PROJECT_DIR$/maibu-service/maibu-iot-service/src/main/java/com/maibu/model" />
|
||||
</key>
|
||||
<key name="CopyClassDialog.RECENTS_KEY">
|
||||
<recent name="com.maibu.core.business" />
|
||||
<recent name="com.maibu.memory" />
|
||||
<recent name="com.maibu.service" />
|
||||
<recent name="com.maibu.web.controller.system" />
|
||||
<recent name="com.maibu.mapper" />
|
||||
<recent name="com.maibu.core.domain.entity" />
|
||||
<recent name="com.maibu.service.impl" />
|
||||
<recent name="com.maibu.web.controller.system" />
|
||||
</key>
|
||||
</component>
|
||||
<component name="RunManager">
|
||||
<component name="RunManager" selected="Spring Boot.MiddlePlatformApplication">
|
||||
<configuration name="test" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
|
||||
<option name="MAIN_CLASS_NAME" value="com.maibu.influxdb.test" />
|
||||
<module name="maibu-netty-server" />
|
||||
<extension name="coverage">
|
||||
<pattern>
|
||||
<option name="PATTERN" value="com.maibu.utils.inter.*" />
|
||||
<option name="ENABLED" value="true" />
|
||||
</pattern>
|
||||
</extension>
|
||||
<method v="2">
|
||||
<option name="Make" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
<configuration default="true" type="JetRunConfigurationType">
|
||||
<module name="maibu-iot-service" />
|
||||
<method v="2">
|
||||
@@ -176,6 +334,7 @@
|
||||
<recent_temporary>
|
||||
<list>
|
||||
<item itemvalue="Spring Boot.MiddlePlatformApplication" />
|
||||
<item itemvalue="Application.test" />
|
||||
</list>
|
||||
</recent_temporary>
|
||||
</component>
|
||||
@@ -205,7 +364,16 @@
|
||||
<workItem from="1776818751852" duration="9107000" />
|
||||
<workItem from="1776832672297" duration="8049000" />
|
||||
<workItem from="1776904775197" duration="11165000" />
|
||||
<workItem from="1776991172322" duration="5635000" />
|
||||
<workItem from="1776991172322" duration="17194000" />
|
||||
<workItem from="1777249981569" duration="10136000" />
|
||||
<workItem from="1777265527819" duration="43499000" />
|
||||
<workItem from="1777423535761" duration="4627000" />
|
||||
<workItem from="1777428666766" duration="4786000" />
|
||||
<workItem from="1777437225486" duration="5747000" />
|
||||
<workItem from="1777443053830" duration="11329000" />
|
||||
<workItem from="1777508899679" duration="10803000" />
|
||||
<workItem from="1777523683395" duration="1929000" />
|
||||
<workItem from="1777526446322" duration="7174000" />
|
||||
</task>
|
||||
<task id="LOCAL-00001" summary="#update">
|
||||
<option name="closed" value="true" />
|
||||
@@ -231,7 +399,15 @@
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1776736541601</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="4" />
|
||||
<task id="LOCAL-00004" summary="#update">
|
||||
<option name="closed" value="true" />
|
||||
<created>1776997902015</created>
|
||||
<option name="number" value="00004" />
|
||||
<option name="presentableId" value="LOCAL-00004" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1776997902016</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="5" />
|
||||
<servers />
|
||||
</component>
|
||||
<component name="TypeScriptGeneratedFilesManager">
|
||||
@@ -264,9 +440,24 @@
|
||||
<option name="timeStamp" value="11" />
|
||||
</line-breakpoint>
|
||||
<line-breakpoint enabled="true" type="java-line">
|
||||
<url>file://$PROJECT_DIR$/maibu-admin/src/main/java/com/maibu/web/controller/system/SysLoginController.java</url>
|
||||
<line>76</line>
|
||||
<option name="timeStamp" value="12" />
|
||||
<url>file://$PROJECT_DIR$/maibu-netty-server/src/main/java/com/maibu/utils/test.java</url>
|
||||
<line>52</line>
|
||||
<option name="timeStamp" value="17" />
|
||||
</line-breakpoint>
|
||||
<line-breakpoint enabled="true" type="java-line">
|
||||
<url>file://$PROJECT_DIR$/maibu-service/maibu-system-service/src/main/java/com/maibu/service/impl/SysMenuServiceImpl.java</url>
|
||||
<line>166</line>
|
||||
<option name="timeStamp" value="18" />
|
||||
</line-breakpoint>
|
||||
<line-breakpoint enabled="true" type="java-line">
|
||||
<url>file://$PROJECT_DIR$/maibu-framework/src/main/java/com/maibu/web/exception/GlobalExceptionHandler.java</url>
|
||||
<line>34</line>
|
||||
<option name="timeStamp" value="19" />
|
||||
</line-breakpoint>
|
||||
<line-breakpoint enabled="true" type="java-line">
|
||||
<url>file://$PROJECT_DIR$/maibu-admin/src/main/java/com/maibu/web/controller/system/SysMenuController.java</url>
|
||||
<line>127</line>
|
||||
<option name="timeStamp" value="25" />
|
||||
</line-breakpoint>
|
||||
</breakpoints>
|
||||
</breakpoint-manager>
|
||||
|
||||
@@ -3,6 +3,8 @@ package com.maibu.web.controller.system;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.maibu.annotation.Log;
|
||||
import com.maibu.constant.UserConstants;
|
||||
import com.maibu.core.business.RegisterUserInput;
|
||||
import com.maibu.core.business.RegisterUserOutput;
|
||||
import com.maibu.core.controller.BaseController;
|
||||
import com.maibu.core.domain.AjaxResult;
|
||||
import com.maibu.core.domain.entity.*;
|
||||
@@ -11,8 +13,6 @@ import com.maibu.enums.BusinessType;
|
||||
import com.maibu.exception.ServiceException;
|
||||
import com.maibu.mapper.DeviceMapper;
|
||||
import com.maibu.mapper.SysRoleDeptMapper;
|
||||
import com.maibu.model.RegisterUserInput;
|
||||
import com.maibu.model.RegisterUserOutput;
|
||||
import com.maibu.service.*;
|
||||
import com.maibu.utils.MessageUtils;
|
||||
import com.maibu.utils.StringUtils;
|
||||
|
||||
@@ -6,10 +6,10 @@ import com.maibu.core.domain.AjaxResult;
|
||||
import com.maibu.core.domain.entity.SysMenu;
|
||||
import com.maibu.core.domain.entity.SysUser;
|
||||
import com.maibu.core.domain.model.LoginBody;
|
||||
import com.maibu.core.enums.ConnectorStatus;
|
||||
import com.maibu.domain.AppPreferences;
|
||||
import com.maibu.dto.NettyDevice;
|
||||
import com.maibu.core.business.device.NettyDevice;
|
||||
import com.maibu.enums.BusinessType;
|
||||
import com.maibu.enums.ConnectorStatus;
|
||||
import com.maibu.enums.SourceType;
|
||||
import com.maibu.manager.DeviceSessionManager;
|
||||
import com.maibu.service.IAppPreferencesService;
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.maibu.constant.UserConstants;
|
||||
import com.maibu.core.controller.BaseController;
|
||||
import com.maibu.core.domain.AjaxResult;
|
||||
import com.maibu.core.domain.entity.SysMenu;
|
||||
import com.maibu.core.page.TableDataInfo;
|
||||
import com.maibu.enums.BusinessType;
|
||||
import com.maibu.service.ISysMenuService;
|
||||
import com.maibu.utils.MessageUtils;
|
||||
@@ -26,8 +27,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
@Api(tags = "菜单管理")
|
||||
@RestController
|
||||
@RequestMapping("/system/menu")
|
||||
public class SysMenuController extends BaseController
|
||||
{
|
||||
public class SysMenuController extends BaseController {
|
||||
@Autowired
|
||||
private ISysMenuService menuService;
|
||||
|
||||
@@ -35,22 +35,25 @@ public class SysMenuController extends BaseController
|
||||
* 获取菜单列表
|
||||
*/
|
||||
@ApiOperation("获取菜单列表")
|
||||
@PreAuthorize("@ss.hasPermi('system:menu:list')")
|
||||
// @PreAuthorize("@ss.hasPermi('system:menu:list')")
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list(SysMenu menu)
|
||||
{
|
||||
List<SysMenu> menus = menuService.selectMenuList(menu, getUserId());
|
||||
return success(menus);
|
||||
public TableDataInfo list(SysMenu menu) {
|
||||
try {
|
||||
startPage();
|
||||
List<SysMenu> menus = menuService.selectMenuList(menu, getUserId());
|
||||
return getDataTable(menus);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据菜单编号获取详细信息
|
||||
*/
|
||||
@ApiOperation("根据菜单编号获取详细信息")
|
||||
@PreAuthorize("@ss.hasPermi('system:menu:query')")
|
||||
// @PreAuthorize("@ss.hasPermi('system:menu:query')")
|
||||
@GetMapping(value = "/{menuId}")
|
||||
public AjaxResult getInfo(@PathVariable Long menuId)
|
||||
{
|
||||
public AjaxResult getInfo(@PathVariable Long menuId) {
|
||||
return success(menuService.selectMenuById(menuId));
|
||||
}
|
||||
|
||||
@@ -59,8 +62,7 @@ public class SysMenuController extends BaseController
|
||||
*/
|
||||
@ApiOperation("获取菜单下拉树列表")
|
||||
@GetMapping("/treeselect")
|
||||
public AjaxResult treeselect(SysMenu menu)
|
||||
{
|
||||
public AjaxResult treeselect(SysMenu menu) {
|
||||
List<SysMenu> menus = menuService.selectMenuList(menu, getUserId());
|
||||
return success(menuService.buildMenuTreeSelect(menus));
|
||||
}
|
||||
@@ -70,8 +72,7 @@ public class SysMenuController extends BaseController
|
||||
*/
|
||||
@ApiOperation("加载对应角色菜单列表树")
|
||||
@GetMapping(value = "/roleMenuTreeselect")
|
||||
public AjaxResult roleMenuTreeselect(@RequestParam Long roleId, @RequestParam Long deptId)
|
||||
{
|
||||
public AjaxResult roleMenuTreeselect(@RequestParam Long roleId, @RequestParam Long deptId) {
|
||||
List<SysMenu> menus = menuService.deptRoleMenuTreeselect(deptId, roleId);
|
||||
// List<SysMenu> menus = menuService.selectMenuList(getUserId(), request.getHeader(LANGUAGE));
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
@@ -84,17 +85,13 @@ public class SysMenuController extends BaseController
|
||||
* 新增菜单
|
||||
*/
|
||||
@ApiOperation("新增菜单")
|
||||
@PreAuthorize("@ss.hasPermi('system:menu:add')")
|
||||
// @PreAuthorize("@ss.hasPermi('system:menu:add')")
|
||||
@Log(title = "菜单管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@Validated @RequestBody SysMenu menu)
|
||||
{
|
||||
if (UserConstants.NOT_UNIQUE.equals(menuService.checkMenuNameUnique(menu)))
|
||||
{
|
||||
public AjaxResult add(@Validated @RequestBody SysMenu menu) {
|
||||
if (UserConstants.NOT_UNIQUE.equals(menuService.checkMenuNameUnique(menu))) {
|
||||
return error(StringUtils.format(MessageUtils.message("menu.add.failed.name.exists"), menu.getMenuName()));
|
||||
}
|
||||
else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) && !StringUtils.ishttp(menu.getPath()))
|
||||
{
|
||||
} else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) && !StringUtils.ishttp(menu.getPath())) {
|
||||
return error(StringUtils.format(MessageUtils.message("menu.add.failed.path.not.valid"), menu.getMenuName()));
|
||||
}
|
||||
menu.setCreateBy(getUsername());
|
||||
@@ -105,21 +102,15 @@ public class SysMenuController extends BaseController
|
||||
* 修改菜单
|
||||
*/
|
||||
@ApiOperation("修改菜单")
|
||||
@PreAuthorize("@ss.hasPermi('system:menu:edit')")
|
||||
// @PreAuthorize("@ss.hasPermi('system:menu:edit')")
|
||||
@Log(title = "菜单管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@Validated @RequestBody SysMenu menu)
|
||||
{
|
||||
if (UserConstants.NOT_UNIQUE.equals(menuService.checkMenuNameUnique(menu)))
|
||||
{
|
||||
public AjaxResult edit(@Validated @RequestBody SysMenu menu) {
|
||||
if (UserConstants.NOT_UNIQUE.equals(menuService.checkMenuNameUnique(menu))) {
|
||||
return error(StringUtils.format(MessageUtils.message("menu.update.failed.name.exists"), menu.getMenuName()));
|
||||
}
|
||||
else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) && !StringUtils.ishttp(menu.getPath()))
|
||||
{
|
||||
} else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) && !StringUtils.ishttp(menu.getPath())) {
|
||||
return error(StringUtils.format(MessageUtils.message("menu.update.failed.path.not.valid"), menu.getMenuName()));
|
||||
}
|
||||
else if (menu.getMenuId().equals(menu.getParentId()))
|
||||
{
|
||||
} else if (menu.getMenuId().equals(menu.getParentId())) {
|
||||
return error(StringUtils.format(MessageUtils.message("menu.update.failed.parent.not.valid"), menu.getMenuName()));
|
||||
}
|
||||
menu.setUpdateBy(getUsername());
|
||||
@@ -130,17 +121,14 @@ public class SysMenuController extends BaseController
|
||||
* 删除菜单
|
||||
*/
|
||||
@ApiOperation("删除菜单")
|
||||
@PreAuthorize("@ss.hasPermi('system:menu:remove')")
|
||||
// @PreAuthorize("@ss.hasPermi('system:menu:remove')")
|
||||
@Log(title = "菜单管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{menuId}")
|
||||
public AjaxResult remove(@PathVariable("menuId") Long menuId)
|
||||
{
|
||||
if (menuService.hasChildByMenuId(menuId))
|
||||
{
|
||||
public AjaxResult remove(@PathVariable("menuId") Long menuId) {
|
||||
if (menuService.hasChildByMenuId(menuId)) {
|
||||
return warn(MessageUtils.message("menu.delete.failed.child.exists"));
|
||||
}
|
||||
if (menuService.checkMenuExistRole(menuId))
|
||||
{
|
||||
if (menuService.checkMenuExistRole(menuId)) {
|
||||
return warn(MessageUtils.message("menu.delete.failed.role.exists"));
|
||||
}
|
||||
return toAjax(menuService.deleteMenuById(menuId));
|
||||
@@ -151,9 +139,10 @@ public class SysMenuController extends BaseController
|
||||
*/
|
||||
@ApiOperation("加载对应部门菜单列表树")
|
||||
@GetMapping(value = "/deptMenuTreeselect/{deptId}")
|
||||
public AjaxResult deptMenuTreeselect(@PathVariable("deptId") Long deptId)
|
||||
{
|
||||
public AjaxResult deptMenuTreeselect(@PathVariable("deptId") Long deptId) {
|
||||
List<SysMenu> menus = menuService.deptMenuTreeselect(deptId);
|
||||
return success(menuService.buildMenuTreeSelect(menus));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -4,12 +4,9 @@ import com.maibu.core.controller.BaseController;
|
||||
import com.maibu.core.domain.AjaxResult;
|
||||
import com.maibu.core.domain.entity.SysOrg;
|
||||
import com.maibu.core.page.TableDataInfo;
|
||||
import com.maibu.domain.Device;
|
||||
import com.maibu.service.SysOrgService;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
|
||||
@@ -58,7 +55,7 @@ public class SysOrgController extends BaseController {
|
||||
@GetMapping("/delete")
|
||||
public AjaxResult delete(@RequestParam Long id) {
|
||||
try {
|
||||
return AjaxResult.success(sysOrgService.delete(id));
|
||||
return sysOrgService.delete(id);
|
||||
} catch (Exception e) {
|
||||
return AjaxResult.error("保存组织出错", e.getMessage());
|
||||
}
|
||||
|
||||
@@ -1,143 +0,0 @@
|
||||
package com.maibu.web.controller.system;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.maibu.annotation.Log;
|
||||
import com.maibu.constant.UserConstants;
|
||||
import com.maibu.core.controller.BaseController;
|
||||
import com.maibu.core.domain.AjaxResult;
|
||||
import com.maibu.core.page.TableDataInfo;
|
||||
import com.maibu.domain.SysPost;
|
||||
import com.maibu.enums.BusinessType;
|
||||
import com.maibu.service.ISysPostService;
|
||||
import com.maibu.utils.MessageUtils;
|
||||
import com.maibu.utils.StringUtils;
|
||||
import com.maibu.utils.poi.ExcelUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 岗位信息操作处理
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Api(tags = "岗位管理")
|
||||
@RestController
|
||||
@RequestMapping("/system/post")
|
||||
public class SysPostController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ISysPostService postService;
|
||||
|
||||
/**
|
||||
* 获取岗位列表
|
||||
*/
|
||||
@ApiOperation("获取岗位列表")
|
||||
@PreAuthorize("@ss.hasPermi('system:post:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SysPost post)
|
||||
{
|
||||
startPage();
|
||||
List<SysPost> list = postService.selectPostList(post);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@ApiOperation("导出岗位列表")
|
||||
@Log(title = "岗位管理", businessType = BusinessType.EXPORT)
|
||||
@PreAuthorize("@ss.hasPermi('system:post:export')")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SysPost post)
|
||||
{
|
||||
List<SysPost> list = postService.selectPostList(post);
|
||||
ExcelUtil<SysPost> util = new ExcelUtil<SysPost>(SysPost.class);
|
||||
util.exportExcel(response, list, "岗位数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据岗位编号获取详细信息
|
||||
*/
|
||||
@ApiOperation("根据岗位编号获取详细信息")
|
||||
@PreAuthorize("@ss.hasPermi('system:post:query')")
|
||||
@GetMapping(value = "/{postId}")
|
||||
public AjaxResult getInfo(@PathVariable Long postId)
|
||||
{
|
||||
return success(postService.selectPostById(postId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增岗位
|
||||
*/
|
||||
@ApiOperation("新增岗位")
|
||||
@PreAuthorize("@ss.hasPermi('system:post:add')")
|
||||
@Log(title = "岗位管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@Validated @RequestBody SysPost post)
|
||||
{
|
||||
if (UserConstants.NOT_UNIQUE.equals(postService.checkPostNameUnique(post)))
|
||||
{
|
||||
return error(StringUtils.format(MessageUtils.message("post.add.failed.name.exists"), post.getPostName()));
|
||||
}
|
||||
else if (UserConstants.NOT_UNIQUE.equals(postService.checkPostCodeUnique(post)))
|
||||
{
|
||||
return error(StringUtils.format(MessageUtils.message("post.add.failed.code.exists"), post.getPostName()));
|
||||
}
|
||||
post.setCreateBy(getUsername());
|
||||
return toAjax(postService.insertPost(post));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改岗位
|
||||
*/
|
||||
@ApiOperation("修改岗位")
|
||||
@PreAuthorize("@ss.hasPermi('system:post:edit')")
|
||||
@Log(title = "岗位管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@Validated @RequestBody SysPost post)
|
||||
{
|
||||
if (UserConstants.NOT_UNIQUE.equals(postService.checkPostNameUnique(post)))
|
||||
{
|
||||
return error(StringUtils.format(MessageUtils.message("post.update.failed.name.exists"), post.getPostName()));
|
||||
}
|
||||
else if (UserConstants.NOT_UNIQUE.equals(postService.checkPostCodeUnique(post)))
|
||||
{
|
||||
return error(StringUtils.format(MessageUtils.message("post.update.failed.code.exists"), post.getPostName()));
|
||||
}
|
||||
post.setUpdateBy(getUsername());
|
||||
return toAjax(postService.updatePost(post));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除岗位
|
||||
*/
|
||||
@ApiOperation("删除岗位")
|
||||
@PreAuthorize("@ss.hasPermi('system:post:remove')")
|
||||
@Log(title = "岗位管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{postIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] postIds)
|
||||
{
|
||||
return toAjax(postService.deletePostByIds(postIds));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取岗位选择框列表
|
||||
*/
|
||||
@ApiOperation("获取岗位选择框列表")
|
||||
@GetMapping("/optionselect")
|
||||
public AjaxResult optionselect()
|
||||
{
|
||||
List<SysPost> posts = postService.selectPostAll();
|
||||
return success(posts);
|
||||
}
|
||||
}
|
||||
@@ -52,7 +52,7 @@ public class SysProfileController extends BaseController
|
||||
SysUser user = loginUser.getUser();
|
||||
AjaxResult ajax = AjaxResult.success(user);
|
||||
ajax.put("roleGroup", userService.selectUserRoleGroup(loginUser.getUsername()));
|
||||
ajax.put("postGroup", userService.selectUserPostGroup(loginUser.getUsername()));
|
||||
// ajax.put("postGroup", userService.selectUserPostGroup(loginUser.getUsername()));
|
||||
// List<UserSocialProfile> socialProfileList = iUserSocialProfileService.selectUserSocialProfile(loginUser.getUserId());
|
||||
// UserSocialProfile userSocialProfile = socialProfileList.stream().filter(s -> SocialPlatformType.listWechatPlatform.contains(s.getSourceClient()) && "1".equals(s.getStatus())).findFirst().orElse(null);
|
||||
// ajax.put("socialGroup", socialProfileList);
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
package com.maibu.web.controller.system;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.maibu.annotation.Log;
|
||||
import com.maibu.constant.HttpStatus;
|
||||
@@ -29,14 +26,10 @@ import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 角色信息
|
||||
@@ -46,8 +39,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
@Api(tags = "角色管理")
|
||||
@RestController
|
||||
@RequestMapping("/system/role")
|
||||
public class SysRoleController extends BaseController
|
||||
{
|
||||
public class SysRoleController extends BaseController {
|
||||
@Autowired
|
||||
private ISysRoleService roleService;
|
||||
|
||||
@@ -64,10 +56,9 @@ public class SysRoleController extends BaseController
|
||||
private ISysDeptService deptService;
|
||||
|
||||
@ApiOperation("获取角色分页列表")
|
||||
@PreAuthorize("@ss.hasPermi('system:role:list')")
|
||||
// @PreAuthorize("@ss.hasPermi('system:role:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SysRole role, Integer pageNum, Integer pageSize)
|
||||
{
|
||||
public TableDataInfo list(SysRole role, Integer pageNum, Integer pageSize) {
|
||||
// startPage();
|
||||
List<SysRole> list = roleService.selectRoleList(role);
|
||||
TableDataInfo tableDataInfo = new TableDataInfo();
|
||||
@@ -86,10 +77,9 @@ public class SysRoleController extends BaseController
|
||||
|
||||
@ApiOperation("导出角色列表")
|
||||
@Log(title = "角色管理", businessType = BusinessType.EXPORT)
|
||||
@PreAuthorize("@ss.hasPermi('system:role:export')")
|
||||
// @PreAuthorize("@ss.hasPermi('system:role:export')")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SysRole role)
|
||||
{
|
||||
public void export(HttpServletResponse response, SysRole role) {
|
||||
List<SysRole> list = roleService.selectRoleList(role);
|
||||
ExcelUtil<SysRole> util = new ExcelUtil<SysRole>(SysRole.class);
|
||||
util.exportExcel(response, list, "角色数据");
|
||||
@@ -99,11 +89,10 @@ public class SysRoleController extends BaseController
|
||||
* 根据角色编号获取详细信息
|
||||
*/
|
||||
@ApiOperation("根据角色编号获取详细信息")
|
||||
@PreAuthorize("@ss.hasPermi('system:role:query')")
|
||||
// @PreAuthorize("@ss.hasPermi('system:role:query')")
|
||||
@GetMapping(value = "/{roleId}")
|
||||
public AjaxResult getInfo(@PathVariable Long roleId)
|
||||
{
|
||||
roleService.checkRoleDataScope(roleId);
|
||||
public AjaxResult getInfo(@PathVariable Long roleId) {
|
||||
// roleService.checkRoleDataScope(roleId);
|
||||
return success(roleService.selectRoleById(roleId));
|
||||
}
|
||||
|
||||
@@ -111,20 +100,14 @@ public class SysRoleController extends BaseController
|
||||
* 新增角色
|
||||
*/
|
||||
@ApiOperation("新增角色")
|
||||
@PreAuthorize("@ss.hasPermi('system:role:add')")
|
||||
// @PreAuthorize("@ss.hasPermi('system:role:add')")
|
||||
@Log(title = "角色管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@Validated @RequestBody SysRole role)
|
||||
{
|
||||
// if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleNameUnique(role)))
|
||||
// {
|
||||
// return error(StringUtils.format(MessageUtils.message("role.add.failed.name.exists"), role.getRoleName()));
|
||||
public AjaxResult add(@Validated @RequestBody SysRole role) {
|
||||
// if ("manager".equals(role.getRoleKey())) {
|
||||
// return error(MessageUtils.message("role.add.manager.failed"));
|
||||
// }
|
||||
// else if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleKeyUnique(role)))
|
||||
// {
|
||||
// return error(StringUtils.format(MessageUtils.message("role.add.failed.key.exists"), role.getRoleName()));
|
||||
// }
|
||||
if ("manager".equals(role.getRoleKey())) {
|
||||
if ("admin".equals(role.getRoleKey())) {
|
||||
return error(MessageUtils.message("role.add.manager.failed"));
|
||||
}
|
||||
role.setCreateBy(getUsername());
|
||||
@@ -136,29 +119,18 @@ public class SysRoleController extends BaseController
|
||||
* 修改保存角色
|
||||
*/
|
||||
@ApiOperation("修改角色")
|
||||
@PreAuthorize("@ss.hasPermi('system:role:edit')")
|
||||
// @PreAuthorize("@ss.hasPermi('system:role:edit')")
|
||||
@Log(title = "角色管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@Validated @RequestBody SysRole role)
|
||||
{
|
||||
public AjaxResult edit(@Validated @RequestBody SysRole role) {
|
||||
roleService.checkRoleAllowed(role);
|
||||
roleService.checkRoleDataScope(role.getRoleId());
|
||||
// if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleNameUnique(role)))
|
||||
// {
|
||||
// return error(StringUtils.format(MessageUtils.message("role.update.failed.name.exists"), role.getRoleName()));
|
||||
// }
|
||||
// else if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleKeyUnique(role)))
|
||||
// {
|
||||
// return error(StringUtils.format(MessageUtils.message("role.update.failed.key.exists"), role.getRoleName()));
|
||||
// }
|
||||
role.setUpdateBy(getUsername());
|
||||
|
||||
if (roleService.updateRole(role) > 0)
|
||||
{
|
||||
if (roleService.updateRole(role) > 0) {
|
||||
// 更新缓存用户权限
|
||||
LoginUser loginUser = getLoginUser();
|
||||
if (StringUtils.isNotNull(loginUser.getUser()) && !loginUser.getUser().isAdmin())
|
||||
{
|
||||
if (StringUtils.isNotNull(loginUser.getUser()) && !loginUser.getUser().isAdmin()) {
|
||||
loginUser.setPermissions(permissionService.getMenuPermission(loginUser.getUser()));
|
||||
loginUser.setUser(userService.selectUserByUserName(loginUser.getUser().getUserName()));
|
||||
tokenService.setLoginUser(loginUser);
|
||||
@@ -172,11 +144,10 @@ public class SysRoleController extends BaseController
|
||||
* 修改保存数据权限
|
||||
*/
|
||||
@ApiOperation("修改保存数据权限")
|
||||
@PreAuthorize("@ss.hasPermi('system:role:edit')")
|
||||
// @PreAuthorize("@ss.hasPermi('system:role:edit')")
|
||||
@Log(title = "角色管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/dataScope")
|
||||
public AjaxResult dataScope(@RequestBody SysRole role)
|
||||
{
|
||||
public AjaxResult dataScope(@RequestBody SysRole role) {
|
||||
roleService.checkRoleAllowed(role);
|
||||
roleService.checkRoleDataScope(role.getRoleId());
|
||||
return toAjax(roleService.authDataScope(role));
|
||||
@@ -186,11 +157,10 @@ public class SysRoleController extends BaseController
|
||||
* 状态修改
|
||||
*/
|
||||
@ApiOperation("修改角色状态")
|
||||
@PreAuthorize("@ss.hasPermi('system:role:edit')")
|
||||
// @PreAuthorize("@ss.hasPermi('system:role:edit')")
|
||||
@Log(title = "角色管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/changeStatus")
|
||||
public AjaxResult changeStatus(@RequestBody SysRole role)
|
||||
{
|
||||
public AjaxResult changeStatus(@RequestBody SysRole role) {
|
||||
roleService.checkRoleAllowed(role);
|
||||
roleService.checkRoleDataScope(role.getRoleId());
|
||||
role.setUpdateBy(getUsername());
|
||||
@@ -201,11 +171,10 @@ public class SysRoleController extends BaseController
|
||||
* 删除角色
|
||||
*/
|
||||
@ApiOperation("删除角色")
|
||||
@PreAuthorize("@ss.hasPermi('system:role:remove')")
|
||||
// @PreAuthorize("@ss.hasPermi('system:role:remove')")
|
||||
@Log(title = "角色管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{roleIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] roleIds)
|
||||
{
|
||||
public AjaxResult remove(@PathVariable Long[] roleIds) {
|
||||
return toAjax(roleService.deleteRoleByIds(roleIds));
|
||||
}
|
||||
|
||||
@@ -213,10 +182,8 @@ public class SysRoleController extends BaseController
|
||||
* 获取角色选择框列表
|
||||
*/
|
||||
@ApiOperation("获取角色选择框列表")
|
||||
@PreAuthorize("@ss.hasPermi('system:role:query')")
|
||||
@GetMapping("/optionselect")
|
||||
public AjaxResult optionselect()
|
||||
{
|
||||
@GetMapping("/selectRoleAll")
|
||||
public AjaxResult selectRoleAll() {
|
||||
return success(roleService.selectRoleAll());
|
||||
}
|
||||
|
||||
@@ -224,10 +191,9 @@ public class SysRoleController extends BaseController
|
||||
* 查询已分配用户角色列表
|
||||
*/
|
||||
@ApiOperation("查询已分配用户角色列表")
|
||||
@PreAuthorize("@ss.hasPermi('system:role:list')")
|
||||
// @PreAuthorize("@ss.hasPermi('system:role:list')")
|
||||
@GetMapping("/authUser/allocatedList")
|
||||
public TableDataInfo allocatedList(SysUser user)
|
||||
{
|
||||
public TableDataInfo allocatedList(SysUser user) {
|
||||
startPage();
|
||||
List<SysUser> list = userService.selectAllocatedList(user);
|
||||
return getDataTable(list);
|
||||
@@ -237,10 +203,9 @@ public class SysRoleController extends BaseController
|
||||
* 查询未分配用户角色列表
|
||||
*/
|
||||
@ApiOperation("查询未分配用户角色列表")
|
||||
@PreAuthorize("@ss.hasPermi('system:role:list')")
|
||||
// @PreAuthorize("@ss.hasPermi('system:role:list')")
|
||||
@GetMapping("/authUser/unallocatedList")
|
||||
public TableDataInfo unallocatedList(SysUser user)
|
||||
{
|
||||
public TableDataInfo unallocatedList(SysUser user) {
|
||||
startPage();
|
||||
List<SysUser> list = userService.selectUnallocatedList(user);
|
||||
return getDataTable(list);
|
||||
@@ -250,11 +215,10 @@ public class SysRoleController extends BaseController
|
||||
* 取消授权用户
|
||||
*/
|
||||
@ApiOperation("取消授权用户")
|
||||
@PreAuthorize("@ss.hasPermi('system:role:edit')")
|
||||
// @PreAuthorize("@ss.hasPermi('system:role:edit')")
|
||||
@Log(title = "角色管理", businessType = BusinessType.GRANT)
|
||||
@PutMapping("/authUser/cancel")
|
||||
public AjaxResult cancelAuthUser(@RequestBody SysUserRole userRole)
|
||||
{
|
||||
public AjaxResult cancelAuthUser(@RequestBody SysUserRole userRole) {
|
||||
return toAjax(roleService.deleteAuthUser(userRole));
|
||||
}
|
||||
|
||||
@@ -262,11 +226,10 @@ public class SysRoleController extends BaseController
|
||||
* 批量取消授权用户
|
||||
*/
|
||||
@ApiOperation("批量取消授权用户")
|
||||
@PreAuthorize("@ss.hasPermi('system:role:edit')")
|
||||
// @PreAuthorize("@ss.hasPermi('system:role:edit')")
|
||||
@Log(title = "角色管理", businessType = BusinessType.GRANT)
|
||||
@PutMapping("/authUser/cancelAll")
|
||||
public AjaxResult cancelAuthUserAll(Long roleId, Long[] userIds)
|
||||
{
|
||||
public AjaxResult cancelAuthUserAll(Long roleId, Long[] userIds) {
|
||||
return toAjax(roleService.deleteAuthUsers(roleId, userIds));
|
||||
}
|
||||
|
||||
@@ -274,11 +237,10 @@ public class SysRoleController extends BaseController
|
||||
* 批量选择用户授权
|
||||
*/
|
||||
@ApiOperation("批量选择用户授权")
|
||||
@PreAuthorize("@ss.hasPermi('system:role:edit')")
|
||||
// @PreAuthorize("@ss.hasPermi('system:role:edit')")
|
||||
@Log(title = "角色管理", businessType = BusinessType.GRANT)
|
||||
@PutMapping("/authUser/selectAll")
|
||||
public AjaxResult selectAuthUserAll(Long roleId, Long[] userIds)
|
||||
{
|
||||
public AjaxResult selectAuthUserAll(Long roleId, Long[] userIds) {
|
||||
roleService.checkRoleDataScope(roleId);
|
||||
return toAjax(roleService.insertAuthUsers(roleId, userIds));
|
||||
}
|
||||
@@ -287,10 +249,9 @@ public class SysRoleController extends BaseController
|
||||
* 获取对应角色部门树列表
|
||||
*/
|
||||
@ApiOperation("获取对应角色部门树列表")
|
||||
@PreAuthorize("@ss.hasPermi('system:role:query')")
|
||||
// @PreAuthorize("@ss.hasPermi('system:role:query')")
|
||||
@GetMapping(value = "/deptTree/{roleId}")
|
||||
public AjaxResult deptTree(@PathVariable("roleId") Long roleId)
|
||||
{
|
||||
public AjaxResult deptTree(@PathVariable("roleId") Long roleId) {
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
ajax.put("checkedKeys", deptService.selectDeptListByRoleId(roleId));
|
||||
ajax.put("depts", deptService.selectDeptTreeList(new SysDept()));
|
||||
|
||||
@@ -1,39 +1,15 @@
|
||||
package com.maibu.web.controller.system;
|
||||
|
||||
import com.maibu.annotation.Log;
|
||||
import com.maibu.constant.Constants;
|
||||
import com.maibu.core.controller.BaseController;
|
||||
import com.maibu.core.domain.AjaxResult;
|
||||
import com.maibu.core.domain.entity.SysMenu;
|
||||
import com.maibu.core.domain.entity.SysOrg;
|
||||
import com.maibu.core.domain.entity.SysSite;
|
||||
import com.maibu.core.domain.entity.SysUser;
|
||||
import com.maibu.core.domain.model.LoginBody;
|
||||
import com.maibu.core.page.TableDataInfo;
|
||||
import com.maibu.domain.AppPreferences;
|
||||
import com.maibu.dto.NettyDevice;
|
||||
import com.maibu.enums.BusinessType;
|
||||
import com.maibu.enums.ConnectorStatus;
|
||||
import com.maibu.enums.SourceType;
|
||||
import com.maibu.manager.DeviceSessionManager;
|
||||
import com.maibu.service.*;
|
||||
import com.maibu.utils.SecurityUtils;
|
||||
import com.maibu.web.domain.dto.LoginResultDto;
|
||||
import com.maibu.web.service.SysLoginService;
|
||||
import com.maibu.web.service.SysPermissionService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import com.maibu.service.SysSiteService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import static com.maibu.constant.Constants.LANGUAGE;
|
||||
|
||||
|
||||
/**
|
||||
@@ -42,6 +18,7 @@ import static com.maibu.constant.Constants.LANGUAGE;
|
||||
* @author ruoyi
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/site")
|
||||
public class SysSiteController extends BaseController {
|
||||
@Autowired
|
||||
private SysSiteService sysSiteService;
|
||||
@@ -77,17 +54,21 @@ public class SysSiteController extends BaseController {
|
||||
* 删除组织
|
||||
*/
|
||||
|
||||
@GetMapping("/delete")
|
||||
public AjaxResult delete(@RequestParam Long id) {
|
||||
@PostMapping("/delete")
|
||||
public AjaxResult delete(@RequestBody List<Long> ids) {
|
||||
try {
|
||||
return AjaxResult.success(sysSiteService.delete(id));
|
||||
if (CollectionUtils.isEmpty(ids)) {
|
||||
// return error(StringUtils.format(MessageUtils.message("menu.add.failed.name.exists"), menu.getMenuName()));
|
||||
return error("删除id为空");
|
||||
}
|
||||
return AjaxResult.success(sysSiteService.delete(ids));
|
||||
} catch (Exception e) {
|
||||
return AjaxResult.error("保存组织出错", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询组织详情
|
||||
* 查询场站详情
|
||||
*/
|
||||
|
||||
@GetMapping("/selectById")
|
||||
@@ -98,4 +79,17 @@ public class SysSiteController extends BaseController {
|
||||
return AjaxResult.error("保存组织出错", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询组织下所有的区域场站
|
||||
*/
|
||||
|
||||
@GetMapping("/selectByOrgId")
|
||||
public AjaxResult selectByOrgId(@RequestParam Long id) {
|
||||
try {
|
||||
return AjaxResult.success(sysSiteService.selectByOrgId(id));
|
||||
} catch (Exception e) {
|
||||
return AjaxResult.error("保存组织出错", e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,6 @@ import com.maibu.core.domain.entity.SysUser;
|
||||
import com.maibu.core.page.TableDataInfo;
|
||||
import com.maibu.enums.BusinessType;
|
||||
import com.maibu.service.ISysDeptService;
|
||||
import com.maibu.service.ISysPostService;
|
||||
import com.maibu.service.ISysRoleService;
|
||||
import com.maibu.service.ISysUserService;
|
||||
import com.maibu.utils.MessageUtils;
|
||||
@@ -27,14 +26,7 @@ import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
/**
|
||||
@@ -56,28 +48,25 @@ public class SysUserController extends BaseController
|
||||
@Autowired
|
||||
private ISysDeptService deptService;
|
||||
|
||||
@Autowired
|
||||
private ISysPostService postService;
|
||||
|
||||
/**
|
||||
* 获取用户列表
|
||||
*/
|
||||
@ApiOperation("获取用户分页列表")
|
||||
@PreAuthorize("@ss.hasPermi('system:user:list')")
|
||||
// @PreAuthorize("@ss.hasPermi('system:user:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SysUser user)
|
||||
{
|
||||
startPage();
|
||||
if (null == user.getDeptId()) {
|
||||
user.setDeptId(getLoginUser().getDeptId());
|
||||
}
|
||||
// if (null == user.getDeptId()) {
|
||||
// user.setDeptId(getLoginUser().getDeptId());
|
||||
// }
|
||||
List<SysUser> list = userService.selectUserList(user);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@ApiOperation("导出用户列表")
|
||||
@Log(title = "用户管理", businessType = BusinessType.EXPORT)
|
||||
@PreAuthorize("@ss.hasPermi('system:user:export')")
|
||||
// @PreAuthorize("@ss.hasPermi('system:user:export')")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SysUser user)
|
||||
{
|
||||
@@ -91,7 +80,7 @@ public class SysUserController extends BaseController
|
||||
|
||||
@ApiOperation("批量导入用户")
|
||||
@Log(title = "用户管理", businessType = BusinessType.IMPORT)
|
||||
@PreAuthorize("@ss.hasPermi('system:user:import')")
|
||||
// @PreAuthorize("@ss.hasPermi('system:user:import')")
|
||||
@PostMapping("/importData")
|
||||
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception
|
||||
{
|
||||
@@ -115,7 +104,7 @@ public class SysUserController extends BaseController
|
||||
* 根据用户编号获取详细信息
|
||||
*/
|
||||
@ApiOperation("根据用户编号获取详细信息")
|
||||
@PreAuthorize("@ss.hasPermi('system:user:query')")
|
||||
// @PreAuthorize("@ss.hasPermi('system:user:query')")
|
||||
@GetMapping(value = { "/", "/{userId}" })
|
||||
public AjaxResult getInfo(@PathVariable(value = "userId", required = false) Long userId)
|
||||
{
|
||||
@@ -123,12 +112,12 @@ public class SysUserController extends BaseController
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
// List<SysRole> roles = roleService.selectRoleAll();
|
||||
// ajax.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList()));
|
||||
ajax.put("posts", postService.selectPostAll());
|
||||
// ajax.put("posts", postService.selectPostAll());
|
||||
if (StringUtils.isNotNull(userId))
|
||||
{
|
||||
SysUser sysUser = userService.selectUserById(userId);
|
||||
ajax.put(AjaxResult.DATA_TAG, sysUser);
|
||||
ajax.put("postIds", postService.selectPostListByUserId(userId));
|
||||
// ajax.put("postIds", postService.selectPostListByUserId(userId));
|
||||
SysRole sysRole = new SysRole();
|
||||
sysRole.setDeptId(sysUser.getDeptId());
|
||||
sysRole.setShowChild(false);
|
||||
@@ -143,7 +132,7 @@ public class SysUserController extends BaseController
|
||||
* 新增用户
|
||||
*/
|
||||
@ApiOperation("新增用户")
|
||||
@PreAuthorize("@ss.hasPermi('system:user:add')")
|
||||
// @PreAuthorize("@ss.hasPermi('system:user:add')")
|
||||
@Log(title = "用户管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@Validated @RequestBody SysUser user)
|
||||
@@ -173,7 +162,7 @@ public class SysUserController extends BaseController
|
||||
* 修改用户
|
||||
*/
|
||||
@ApiOperation("修改用户")
|
||||
@PreAuthorize("@ss.hasPermi('system:user:edit')")
|
||||
// @PreAuthorize("@ss.hasPermi('system:user:edit')")
|
||||
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@Validated @RequestBody SysUser user)
|
||||
@@ -195,6 +184,8 @@ public class SysUserController extends BaseController
|
||||
return error(StringUtils.format(MessageUtils.message("user.update.failed.email.exists"), user.getUserName()));
|
||||
}
|
||||
user.setUpdateBy(getUsername());
|
||||
user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
|
||||
user.setDisplayPassword(user.getPassword());
|
||||
return toAjax(userService.updateUser(user));
|
||||
}
|
||||
|
||||
@@ -202,7 +193,7 @@ public class SysUserController extends BaseController
|
||||
* 删除用户
|
||||
*/
|
||||
@ApiOperation("删除用户")
|
||||
@PreAuthorize("@ss.hasPermi('system:user:remove')")
|
||||
// @PreAuthorize("@ss.hasPermi('system:user:remove')")
|
||||
@Log(title = "用户管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{userIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] userIds)
|
||||
@@ -218,7 +209,7 @@ public class SysUserController extends BaseController
|
||||
* 重置密码
|
||||
*/
|
||||
@ApiOperation("重置用户密码")
|
||||
@PreAuthorize("@ss.hasPermi('system:user:resetPwd')")
|
||||
// @PreAuthorize("@ss.hasPermi('system:user:resetPwd')")
|
||||
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/resetPwd")
|
||||
public AjaxResult resetPwd(@RequestBody SysUser user)
|
||||
@@ -235,7 +226,7 @@ public class SysUserController extends BaseController
|
||||
* 状态修改
|
||||
*/
|
||||
@ApiOperation("修改用户状态")
|
||||
@PreAuthorize("@ss.hasPermi('system:user:edit')")
|
||||
// @PreAuthorize("@ss.hasPermi('system:user:edit')")
|
||||
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/changeStatus")
|
||||
public AjaxResult changeStatus(@RequestBody SysUser user)
|
||||
@@ -250,7 +241,7 @@ public class SysUserController extends BaseController
|
||||
* 根据用户编号获取授权角色
|
||||
*/
|
||||
@ApiOperation("根据用户编号获取授权角色")
|
||||
@PreAuthorize("@ss.hasPermi('system:user:query')")
|
||||
// @PreAuthorize("@ss.hasPermi('system:user:query')")
|
||||
@GetMapping("/authRole/{userId}")
|
||||
public AjaxResult authRole(@PathVariable("userId") Long userId)
|
||||
{
|
||||
@@ -266,7 +257,7 @@ public class SysUserController extends BaseController
|
||||
* 用户授权角色
|
||||
*/
|
||||
@ApiOperation("为用户授权角色")
|
||||
@PreAuthorize("@ss.hasPermi('system:user:edit')")
|
||||
// @PreAuthorize("@ss.hasPermi('system:user:edit')")
|
||||
@Log(title = "用户管理", businessType = BusinessType.GRANT)
|
||||
@PutMapping("/authRole")
|
||||
public AjaxResult insertAuthRole(Long userId, Long[] roleIds)
|
||||
@@ -280,7 +271,7 @@ public class SysUserController extends BaseController
|
||||
* 获取部门树列表
|
||||
*/
|
||||
@ApiOperation("获取部门树列表")
|
||||
@PreAuthorize("@ss.hasPermi('system:user:list')")
|
||||
// @PreAuthorize("@ss.hasPermi('system:user:list')")
|
||||
@GetMapping("/deptTree")
|
||||
public AjaxResult deptTree(SysDept dept)
|
||||
{
|
||||
@@ -293,7 +284,7 @@ public class SysUserController extends BaseController
|
||||
* @return com.fastbee.common.core.page.TableDataInfo
|
||||
*/
|
||||
@ApiOperation("获取用户分页列表")
|
||||
@PreAuthorize("@ss.hasPermi('system:user:list')")
|
||||
// @PreAuthorize("@ss.hasPermi('system:user:list')")
|
||||
@GetMapping("/listTerminal")
|
||||
public TableDataInfo listTerminal(SysUser user)
|
||||
{
|
||||
@@ -307,7 +298,7 @@ public class SysUserController extends BaseController
|
||||
* 根据机构id获取当前用户列表
|
||||
*/
|
||||
@ApiOperation("根据机构id获取当前用户列表")
|
||||
@PreAuthorize("@ss.hasPermi('system:user:list')")
|
||||
// @PreAuthorize("@ss.hasPermi('system:user:list')")
|
||||
@GetMapping("/getByDeptId")
|
||||
public TableDataInfo getByDeptId()
|
||||
{
|
||||
@@ -316,4 +307,14 @@ public class SysUserController extends BaseController
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据机构id获取当前用户列表
|
||||
*/
|
||||
@GetMapping("/getByRoleId")
|
||||
public TableDataInfo getByRoleId(@RequestParam Long id)
|
||||
{
|
||||
startPage();
|
||||
List<SysUser> list = userService.selectByRoleId(id);
|
||||
return getDataTable(list);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,4 +73,11 @@ ioTDA:
|
||||
ak: HPUAQHOL0WPXJ1BX3SDV
|
||||
sk: 06B2ex4JkeGjE7PfWLsYt7PdXN2xvBxEjotPbkaQ
|
||||
projectId: df32e2f94c15428a9763f01f4f0d337c
|
||||
productId: 698551ef7f2e6c302f519144
|
||||
productId: 698551ef7f2e6c302f519144
|
||||
|
||||
influxdb:
|
||||
username: admin
|
||||
password: admin123
|
||||
bucket: device_data
|
||||
org: maibu
|
||||
token: maibu-token
|
||||
|
||||
@@ -11,7 +11,7 @@ maibu:
|
||||
|
||||
# 开发环境配置
|
||||
server:
|
||||
port: 8082 # 服务器的HTTP端口,默认为8080
|
||||
port: 8081 # 服务器的HTTP端口,默认为8080
|
||||
servlet:
|
||||
context-path: / # 应用的访问路径
|
||||
tomcat:
|
||||
@@ -117,6 +117,8 @@ mybatis-plus:
|
||||
id-type: AUTO # 自增 ID
|
||||
logic-delete-value: 1 # 逻辑已删除值(默认为 1)
|
||||
logic-not-delete-value: 0 # 逻辑未删除值(默认为 0)
|
||||
configuration:
|
||||
map-underscore-to-camel-case: true
|
||||
|
||||
# PageHelper分页插件
|
||||
pagehelper:
|
||||
|
||||
@@ -208,6 +208,12 @@
|
||||
<version>8.5.7</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.influxdb</groupId>
|
||||
<artifactId>influxdb-client-java</artifactId>
|
||||
<version>6.10.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<properties>
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
package com.maibu.entity;
|
||||
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.maibu.enums.CompareEnum;
|
||||
import lombok.Data;
|
||||
import org.springframework.data.annotation.Id;
|
||||
|
||||
import java.util.List;
|
||||
import com.maibu.core.enums.CompareEnum;import lombok.Data;
|
||||
|
||||
|
||||
@Data
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.maibu.domain;
|
||||
package com.maibu.core.business;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
@@ -6,13 +6,13 @@ import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.maibu.core.domain.BaseDO;
|
||||
import com.maibu.enums.ConnectType;
|
||||
import com.maibu.core.enums.ConnectType;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.springframework.data.annotation.Id;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@@ -30,7 +30,6 @@ public class IoTCommonDevice extends BaseDO {
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
private String siteId; //场地id
|
||||
/**
|
||||
* 设备ID
|
||||
*/
|
||||
@@ -41,18 +40,6 @@ public class IoTCommonDevice extends BaseDO {
|
||||
*/
|
||||
private String deviceName;
|
||||
|
||||
/**
|
||||
* 产品ID
|
||||
*/
|
||||
private Long productId;
|
||||
|
||||
private String productName;
|
||||
|
||||
/**
|
||||
* 设备编号
|
||||
*/
|
||||
private String serialNumber;
|
||||
|
||||
/**
|
||||
* 固件版本
|
||||
*/
|
||||
@@ -124,4 +111,23 @@ public class IoTCommonDevice extends BaseDO {
|
||||
|
||||
@TableField(exist = false)
|
||||
private Boolean hasRegister;
|
||||
|
||||
private Long orgId; //组织id
|
||||
|
||||
private Long siteId; //场站id
|
||||
|
||||
private Long modelId; //属于某个设备模型
|
||||
|
||||
|
||||
/**
|
||||
* 产品ID
|
||||
*/
|
||||
private Long productId;
|
||||
|
||||
private String productName;
|
||||
|
||||
@TableField(exist = false)
|
||||
private List<DeviceModelProperty> propertyList;
|
||||
|
||||
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.maibu.domain;
|
||||
package com.maibu.core.business;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.maibu.domain;
|
||||
package com.maibu.core.business;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.maibu.domain;
|
||||
package com.maibu.core.business;
|
||||
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.maibu.dto;
|
||||
package com.maibu.core.business.device;
|
||||
|
||||
import com.maibu.enums.ConnectorStatus;
|
||||
import com.maibu.core.enums.ConnectorStatus;
|
||||
import io.netty.channel.Channel;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package com.maibu.dto;
|
||||
package com.maibu.core.business.device;
|
||||
|
||||
|
||||
import com.maibu.domain.DeviceRunStatistics;
|
||||
import com.maibu.entity.path.LatAndLngEntity;
|
||||
import com.maibu.enums.ConnectorType;
|
||||
import com.maibu.core.business.DeviceRunStatistics;
|
||||
import com.maibu.core.enums.ConnectorType;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import com.maibu.core.business.path.LatAndLngEntity;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.Queue;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.maibu.entity.path;
|
||||
package com.maibu.core.business.path;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.maibu.entity.path;
|
||||
package com.maibu.core.business.path;
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.maibu.entity.path;
|
||||
package com.maibu.core.business.path;
|
||||
|
||||
import java.util.List;
|
||||
import com.maibu.entity.path.MowingPathGenerator.*;
|
||||
import com.maibu.core.business.path.MowingPathGenerator.*;
|
||||
|
||||
public class RPPathData {
|
||||
public ScanLine scanLine;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.maibu.entity.path;
|
||||
package com.maibu.core.business.path;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.maibu.entity.path;
|
||||
package com.maibu.core.business.path;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -1,12 +1,16 @@
|
||||
package com.maibu.core.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 基类,时间类型改为LocalDateTime
|
||||
@@ -40,4 +44,15 @@ public class BaseDO implements Serializable {
|
||||
@TableLogic
|
||||
private Boolean delFlag;
|
||||
|
||||
/** 请求参数 */
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty("请求参数")
|
||||
@JsonInclude(JsonInclude.Include.NON_EMPTY)
|
||||
private Map<String, Object> params = new HashMap<>();
|
||||
|
||||
/** 备注 */
|
||||
@ApiModelProperty("备注")
|
||||
@TableField(exist = false)
|
||||
private String remark;
|
||||
|
||||
}
|
||||
|
||||
@@ -4,17 +4,11 @@ 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 com.maibu.core.domain.BaseEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -25,7 +19,7 @@ import java.util.List;
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel(value = "SysMenu", description = "菜单权限表 sys_menu")
|
||||
@TableName(value = "sys_site")
|
||||
@TableName(value = "sys_menu")
|
||||
@Data
|
||||
public class SysMenu extends BaseDO {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.maibu.core.domain.entity;
|
||||
|
||||
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.domain.BaseDO;
|
||||
@@ -48,4 +49,7 @@ public class SysOrg extends BaseDO {
|
||||
*/
|
||||
private String manager;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Long userId;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.maibu.core.domain.entity;
|
||||
|
||||
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.annotation.Excel;
|
||||
@@ -9,7 +10,9 @@ import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.springframework.data.annotation.Transient;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
@@ -63,15 +66,13 @@ public class SysRole extends BaseDO {
|
||||
@Excel(name = "角色状态", readConverterExp = "0=正常,1=停用")
|
||||
private String status;
|
||||
|
||||
/** 删除标志(0代表存在 2代表删除) */
|
||||
@ApiModelProperty("删除标志")
|
||||
private String delFlag;
|
||||
|
||||
/** 用户是否存在此角色标识 默认不存在 */
|
||||
private boolean flag = false;
|
||||
|
||||
/** 菜单组 */
|
||||
@ApiModelProperty("菜单组")
|
||||
@TableField(exist = false)
|
||||
private String menuList;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Long[] menuIds;
|
||||
|
||||
/** 部门组(数据权限) */
|
||||
@@ -107,6 +108,11 @@ public class SysRole extends BaseDO {
|
||||
*/
|
||||
private Boolean manager;
|
||||
|
||||
/**
|
||||
* 是否有场站设置的权限
|
||||
*/
|
||||
private Boolean siteAccess = false;
|
||||
|
||||
|
||||
public SysRole() {
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@ 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.annotation.Excel;
|
||||
import com.maibu.annotation.Excels;
|
||||
import com.maibu.core.domain.BaseEntity;
|
||||
import com.maibu.core.domain.BaseDO;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
@@ -21,9 +21,10 @@ import java.util.List;
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel(value = "SysUser", description = "用户对象 sys_user")
|
||||
@TableName(value = "sys_user")
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class SysUser extends BaseEntity {
|
||||
public class SysUser extends BaseDO {
|
||||
private static final long serialVersionUID = 1L;
|
||||
/**
|
||||
* 用户ID
|
||||
@@ -40,6 +41,11 @@ public class SysUser extends BaseEntity {
|
||||
@Excel(name = "部门编号", type = Excel.Type.IMPORT)
|
||||
private Long deptId;
|
||||
|
||||
|
||||
private Long orgId;
|
||||
|
||||
private Long siteId;
|
||||
|
||||
/**
|
||||
* 用户账号
|
||||
*/
|
||||
@@ -97,12 +103,6 @@ public class SysUser extends BaseEntity {
|
||||
@Excel(name = "帐号状态", readConverterExp = "0=正常,1=停用")
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 2代表删除)
|
||||
*/
|
||||
@ApiModelProperty("删除标志")
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 最后登录IP
|
||||
*/
|
||||
@@ -117,66 +117,11 @@ public class SysUser extends BaseEntity {
|
||||
@Excel(name = "最后登录时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", type = Excel.Type.EXPORT)
|
||||
private Date loginDate;
|
||||
|
||||
/**
|
||||
* 部门对象
|
||||
*/
|
||||
@ApiModelProperty("部门对象")
|
||||
@Excels({
|
||||
@Excel(name = "部门名称", targetAttr = "deptName", type = Excel.Type.EXPORT),
|
||||
@Excel(name = "部门负责人", targetAttr = "leader", type = Excel.Type.EXPORT)
|
||||
})
|
||||
private SysDept dept;
|
||||
|
||||
/**
|
||||
* 角色对象
|
||||
*/
|
||||
@ApiModelProperty("角色对象")
|
||||
private List<SysRole> roles;
|
||||
|
||||
/**
|
||||
* 角色组
|
||||
*/
|
||||
@ApiModelProperty("角色组")
|
||||
private Long[] roleIds;
|
||||
|
||||
/**
|
||||
* 岗位组
|
||||
*/
|
||||
@ApiModelProperty("岗位组")
|
||||
private Long[] postIds;
|
||||
|
||||
/**
|
||||
* 角色ID
|
||||
*/
|
||||
@ApiModelProperty("角色ID")
|
||||
private Long roleId;
|
||||
|
||||
/**
|
||||
* 用,拼接的角色名称
|
||||
*/
|
||||
@ApiModelProperty("用,拼接的角色名称")
|
||||
private String roleNames;
|
||||
|
||||
/**
|
||||
* 用,拼接的角色名称
|
||||
*/
|
||||
@ApiModelProperty("sessionId")
|
||||
private String sessionId;
|
||||
|
||||
/**
|
||||
* 微信openid
|
||||
*/
|
||||
private String openId;
|
||||
|
||||
/**
|
||||
* 是否显示下级机构数据
|
||||
*/
|
||||
private Boolean showChild;
|
||||
|
||||
/**
|
||||
* 是否是机构管理员
|
||||
*/
|
||||
private Boolean manager;
|
||||
/**
|
||||
* 语言
|
||||
*/
|
||||
@@ -186,6 +131,40 @@ public class SysUser extends BaseEntity {
|
||||
*/
|
||||
private String timeZone;
|
||||
|
||||
/**
|
||||
* 角色对象
|
||||
*/
|
||||
@ApiModelProperty("角色对象")
|
||||
private List<SysRole> roles;
|
||||
|
||||
/**
|
||||
* 用,拼接的角色名称
|
||||
*/
|
||||
@ApiModelProperty("用,拼接的角色名称")
|
||||
private String roleNames;
|
||||
|
||||
/**
|
||||
* 角色组
|
||||
*/
|
||||
@ApiModelProperty("角色组")
|
||||
private Long[] roleIds;
|
||||
//
|
||||
// /**
|
||||
// * 岗位组
|
||||
// */
|
||||
// @ApiModelProperty("岗位组")
|
||||
// private Long[] postIds;
|
||||
|
||||
/**
|
||||
* 角色ID
|
||||
*/
|
||||
@ApiModelProperty("角色ID")
|
||||
private Long roleId;
|
||||
|
||||
|
||||
@ApiModelProperty("sessionId")
|
||||
private String sessionId;
|
||||
|
||||
/**
|
||||
* ai助手问答使用条数
|
||||
*/
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.maibu.core.domain.model;
|
||||
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import com.maibu.core.domain.entity.SysUser;
|
||||
import lombok.Data;
|
||||
import org.springframework.security.core.GrantedAuthority;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
|
||||
@@ -13,6 +14,7 @@ import java.util.Set;
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Data
|
||||
public class LoginUser implements UserDetails {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@@ -26,6 +28,21 @@ public class LoginUser implements UserDetails {
|
||||
*/
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 组织id
|
||||
*/
|
||||
private Long orgId;
|
||||
|
||||
/**
|
||||
* 区域id
|
||||
*/
|
||||
private Long siteId;
|
||||
|
||||
/**
|
||||
* 组织id
|
||||
*/
|
||||
private Long roleId;
|
||||
|
||||
/**
|
||||
* 用户唯一标识
|
||||
*/
|
||||
@@ -82,61 +99,6 @@ public class LoginUser implements UserDetails {
|
||||
*/
|
||||
private Integer sourceType;
|
||||
|
||||
public Integer getSourceType() {
|
||||
return sourceType;
|
||||
}
|
||||
|
||||
public void setSourceType(Integer s) {
|
||||
this.sourceType = s;
|
||||
}
|
||||
|
||||
public Boolean getNeverExpire() {
|
||||
return neverExpire;
|
||||
}
|
||||
|
||||
public void setNeverExpire(Boolean neverExpire) {
|
||||
this.neverExpire = neverExpire;
|
||||
}
|
||||
|
||||
public String getLanguage() {
|
||||
return language;
|
||||
}
|
||||
|
||||
public Long getDeptUserId() {
|
||||
return deptUserId;
|
||||
}
|
||||
|
||||
public void setDeptUserId(Long deptUserId) {
|
||||
this.deptUserId = deptUserId;
|
||||
}
|
||||
|
||||
public void setLanguage(String language) {
|
||||
this.language = language;
|
||||
}
|
||||
|
||||
public Long getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(Long userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public Long getDeptId() {
|
||||
return deptId;
|
||||
}
|
||||
|
||||
public void setDeptId(Long deptId) {
|
||||
this.deptId = deptId;
|
||||
}
|
||||
|
||||
public String getToken() {
|
||||
return token;
|
||||
}
|
||||
|
||||
public void setToken(String token) {
|
||||
this.token = token;
|
||||
}
|
||||
|
||||
public LoginUser() {
|
||||
}
|
||||
@@ -146,9 +108,11 @@ public class LoginUser implements UserDetails {
|
||||
this.permissions = permissions;
|
||||
}
|
||||
|
||||
public LoginUser(Long userId, Long deptId, String language, SysUser user, Set<String> permissions) {
|
||||
public LoginUser(Long userId, Long deptId, Long orgId, Long siteId, String language, SysUser user, Set<String> permissions) {
|
||||
this.userId = userId;
|
||||
this.deptId = deptId;
|
||||
this.orgId = orgId;
|
||||
this.siteId = siteId;
|
||||
this.user = user;
|
||||
this.language = language;
|
||||
this.permissions = permissions;
|
||||
@@ -207,70 +171,6 @@ public class LoginUser implements UserDetails {
|
||||
return true;
|
||||
}
|
||||
|
||||
public Long getLoginTime() {
|
||||
return loginTime;
|
||||
}
|
||||
|
||||
public void setLoginTime(Long loginTime) {
|
||||
this.loginTime = loginTime;
|
||||
}
|
||||
|
||||
public String getIpaddr() {
|
||||
return ipaddr;
|
||||
}
|
||||
|
||||
public void setIpaddr(String ipaddr) {
|
||||
this.ipaddr = ipaddr;
|
||||
}
|
||||
|
||||
public String getLoginLocation() {
|
||||
return loginLocation;
|
||||
}
|
||||
|
||||
public void setLoginLocation(String loginLocation) {
|
||||
this.loginLocation = loginLocation;
|
||||
}
|
||||
|
||||
public String getBrowser() {
|
||||
return browser;
|
||||
}
|
||||
|
||||
public void setBrowser(String browser) {
|
||||
this.browser = browser;
|
||||
}
|
||||
|
||||
public String getOs() {
|
||||
return os;
|
||||
}
|
||||
|
||||
public void setOs(String os) {
|
||||
this.os = os;
|
||||
}
|
||||
|
||||
public Long getExpireTime() {
|
||||
return expireTime;
|
||||
}
|
||||
|
||||
public void setExpireTime(Long expireTime) {
|
||||
this.expireTime = expireTime;
|
||||
}
|
||||
|
||||
public Set<String> getPermissions() {
|
||||
return permissions;
|
||||
}
|
||||
|
||||
public void setPermissions(Set<String> permissions) {
|
||||
this.permissions = permissions;
|
||||
}
|
||||
|
||||
public SysUser getUser() {
|
||||
return user;
|
||||
}
|
||||
|
||||
public void setUser(SysUser user) {
|
||||
this.user = user;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<? extends GrantedAuthority> getAuthorities() {
|
||||
return null;
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
package com.maibu.enums;
|
||||
|
||||
import com.maibu.core.text.IntArrayValuable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 通用状态枚举
|
||||
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum CommonStatusEnum implements IntArrayValuable {
|
||||
|
||||
ENABLE(0, "开启"),
|
||||
DISABLE(1, "关闭");
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(CommonStatusEnum::getStatus).toArray();
|
||||
|
||||
/**
|
||||
* 状态值
|
||||
*/
|
||||
private final Integer status;
|
||||
/**
|
||||
* 状态名
|
||||
*/
|
||||
private final String name;
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
package com.maibu.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author gsb
|
||||
* @date 2023/6/3 14:09
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum DataEnum {
|
||||
|
||||
DECIMAL("decimal", "十进制"),
|
||||
DOUBLE("double", "双精度"),
|
||||
ENUM("enum","枚举"),
|
||||
BOOLEAN("bool","布尔类型"),
|
||||
INTEGER("integer","整形"),
|
||||
OBJECT("object", "对象"),
|
||||
STRING("string","字符串"),
|
||||
ARRAY("array","数组");
|
||||
|
||||
String type;
|
||||
String msg;
|
||||
|
||||
public static DataEnum convert(String type){
|
||||
for (DataEnum value : DataEnum.values()) {
|
||||
if (Objects.equals(value.type, type)){
|
||||
return value;
|
||||
}
|
||||
}
|
||||
return DataEnum.STRING;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
package com.maibu.enums;
|
||||
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* @description:
|
||||
* @author admin
|
||||
* @date 2024-07-18 14:52
|
||||
* @version 1.0
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum DeviceDistributeTypeEnum {
|
||||
|
||||
/**
|
||||
* 确保唯一,不能重复
|
||||
*/
|
||||
SELECT(1, "选择分配"),
|
||||
IMPORT(2,"导入分配");
|
||||
|
||||
/**
|
||||
* 渠道类型
|
||||
*/
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String desc;
|
||||
|
||||
public static String getDesc(Integer type) {
|
||||
for (DeviceDistributeTypeEnum item : DeviceDistributeTypeEnum.values()) {
|
||||
if (item.getType().equals(type)) {
|
||||
return item.getDesc();
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
package com.maibu.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 场景管理物模型、变量类型枚举
|
||||
* 注意:以下4张表下的variable_type相关字段统一用该枚举,保持一致
|
||||
* scene_model_tag表、scene_tag_points表、scene_model_device表、scene_model_data表
|
||||
* @author fastb
|
||||
* @date 2024-05-22 10:01
|
||||
* @version 1.0
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum DeviceLogTypeEnum {
|
||||
|
||||
ATTRIBUTE_REPORT(1, "属性上报"),
|
||||
INVOKE_FUNCTION(2, "调用功能"),
|
||||
EVENT_REPORT(3, "事件上报"),
|
||||
DEVICE_UPDATE(4, "设备升级"),
|
||||
DEVICE_ONLINE(5, "设备上线"),
|
||||
DEVICE_OFFLINE(6, "设备离线"),
|
||||
SCENE_VARIABLE_REPORT(7, "场景录入、运算变量上报下发");
|
||||
|
||||
private final Integer type;
|
||||
|
||||
private final String desc;
|
||||
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
package com.maibu.enums;
|
||||
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* @description:
|
||||
* @author admin
|
||||
* @date 2024-07-18 14:52
|
||||
* @version 1.0
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum DeviceRecordTypeEnum {
|
||||
|
||||
/**
|
||||
* 确保唯一,不能重复
|
||||
*/
|
||||
IMPORT(1, "导入记录"),
|
||||
RECOVERY(2,"回收记录"),
|
||||
ASSIGNMENT(3,"分配记录"),
|
||||
ASSIGNMENT_DETAIL(4,"分配详细记录");
|
||||
|
||||
|
||||
/**
|
||||
* 渠道类型
|
||||
*/
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String desc;
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
package com.maibu.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum JobType {
|
||||
//1==设备定时,2=设备告警,3=场景联动 4=规则引擎
|
||||
Device(1),
|
||||
DeviceAlert(2),
|
||||
Scene(3),
|
||||
RuleEngine(4);
|
||||
private final Integer value;
|
||||
|
||||
public static JobType fromValue(Integer value) {
|
||||
for (JobType type : JobType.values()) {
|
||||
if (Objects.equals(type.getValue(), value)) {
|
||||
return type;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String getName(Integer value) {
|
||||
for (JobType type : JobType.values()) {
|
||||
if (Objects.equals(type.getValue(), value)) {
|
||||
return type.name();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
package com.maibu.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 推送类型
|
||||
* @author bill
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum PushType {
|
||||
|
||||
WECHAT_SERVER_PUSH("wechat_server_push","微信小程序服务号推送");
|
||||
|
||||
|
||||
/**
|
||||
* 业务编号
|
||||
*/
|
||||
private String serviceCode;
|
||||
|
||||
private String desc;
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
package com.maibu.enums;
|
||||
|
||||
import com.maibu.constant.HttpStatus;
|
||||
import lombok.AllArgsConstructor;
|
||||
|
||||
/**
|
||||
* API返回对象
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
public enum ResultCode implements IErrorCode {
|
||||
|
||||
SUCCESS(HttpStatus.SUCCESS,"请求成功"),
|
||||
FAILED(HttpStatus.ERROR,"系统内部错误"),
|
||||
ACCEPTED(HttpStatus.ACCEPTED,"请求已接收"),
|
||||
REDIRECT(HttpStatus.SEE_OTHER,"重定向"),
|
||||
UNAUTHORIZED(HttpStatus.UNAUTHORIZED,"暂未登录或token过期"),
|
||||
FORBIDDEN(HttpStatus.FORBIDDEN,"没有相关权限或授权过期"),
|
||||
NOT_FOUND(HttpStatus.NOT_FOUND,"资源未找到"),
|
||||
PARSE_MSG_EXCEPTION(4018, "解析协议异常"),
|
||||
TIMEOUT(502, "响应超时!"),
|
||||
FIRMWARE_VERSION_UNIQUE_ERROR(4022, "产品下已存在该版本固件"),
|
||||
FIRMWARE_SEQ_UNIQUE_ERROR(4023, "产品下已存在该升级序列号"),
|
||||
FIRMWARE_TASK_UNIQUE_ERROR(4024, "任务名已存在"),
|
||||
REPLY_TIMEOUT(4001, "超时未回执"),
|
||||
INVALID_USER_APP(4002, "用户信息不存在"),
|
||||
INVALID_MQTT_USER(1003, "内部mqtt服务用户异常"),
|
||||
DECODE_PROTOCOL_EXCEPTION(1000, "解析协议异常"),
|
||||
MQTT_TOPIC_INVALID(1001, "MQTT订阅topic格式非法");
|
||||
|
||||
private int code;
|
||||
private String message;
|
||||
|
||||
public int getCode(){return code;}
|
||||
|
||||
public String getMessage(){return message;}
|
||||
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
package com.maibu.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 通用状态枚举
|
||||
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum StatusEnum {
|
||||
|
||||
SUCCESS(1, "成功"),
|
||||
FAIL(0, "失败");
|
||||
|
||||
|
||||
/**
|
||||
* 状态值
|
||||
*/
|
||||
private final Integer status;
|
||||
/**
|
||||
* 状态名
|
||||
*/
|
||||
private final String name;
|
||||
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package com.maibu.exception.iot;
|
||||
|
||||
import com.maibu.exception.GlobalException;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* mqtt客户端权限校验异常
|
||||
* @author gsb
|
||||
* @date 2022/10/8 14:11
|
||||
*/
|
||||
@NoArgsConstructor
|
||||
public class MqttAuthorizationException extends GlobalException {
|
||||
|
||||
public MqttAuthorizationException(String messageId){
|
||||
super(messageId);
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package com.maibu.exception.iot;
|
||||
|
||||
import com.maibu.exception.GlobalException;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* mqtt客户端校验 用户名或密码错误
|
||||
* @author gsb
|
||||
* @date 2022/10/8 14:15
|
||||
*/
|
||||
@NoArgsConstructor
|
||||
public class MqttClientUserNameOrPassException extends GlobalException {
|
||||
|
||||
public MqttClientUserNameOrPassException(String message){
|
||||
super(message);
|
||||
}
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
package com.maibu.exception.job;
|
||||
|
||||
/**
|
||||
* 计划策略异常
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class TaskException extends Exception
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Code code;
|
||||
|
||||
public TaskException(String msg, Code code)
|
||||
{
|
||||
this(msg, code, null);
|
||||
}
|
||||
|
||||
public TaskException(String msg, Code code, Exception nestedEx)
|
||||
{
|
||||
super(msg, nestedEx);
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public Code getCode()
|
||||
{
|
||||
return code;
|
||||
}
|
||||
|
||||
public enum Code
|
||||
{
|
||||
TASK_EXISTS, NO_TASK_EXISTS, TASK_ALREADY_STARTED, UNKNOWN, CONFIG_ERROR, TASK_NODE_NOT_AVAILABLE
|
||||
}
|
||||
}
|
||||
@@ -127,13 +127,13 @@ public class SecurityUtils
|
||||
{
|
||||
String language = getLoginUser().getLanguage();
|
||||
if (StringUtils.isEmpty(language)){
|
||||
return "en-US";
|
||||
return "zh-CN";
|
||||
}
|
||||
return language;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return "en-US";
|
||||
return "zh-CN";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.maibu.own.controller;
|
||||
import com.maibu.core.controller.BaseController;
|
||||
import com.maibu.core.domain.AjaxResult;
|
||||
import com.maibu.core.page.TableDataInfo;
|
||||
import com.maibu.domain.IoTCommonDevice;
|
||||
import com.maibu.core.business.IoTCommonDevice;
|
||||
import com.maibu.own.service.CommonDeviceService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package com.maibu.own.service;
|
||||
|
||||
import com.maibu.domain.IoTCommonDevice;
|
||||
import com.maibu.core.business.IoTCommonDevice;
|
||||
import com.maibu.mapper.IoTCommonDevicesMapper;
|
||||
import com.maibu.memory.CommonMemory;
|
||||
import com.maibu.memory.GlobalMemory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -17,11 +17,11 @@ public class CommonDeviceService {
|
||||
|
||||
|
||||
public List<IoTCommonDevice> unRegisterList() {
|
||||
return (List<IoTCommonDevice>) CommonMemory.unRegisterCommonDeviceMap.values();
|
||||
return (List<IoTCommonDevice>) GlobalMemory.unRegisterCommonDeviceMap.values();
|
||||
}
|
||||
|
||||
public List<IoTCommonDevice> register() {
|
||||
return (List<IoTCommonDevice>) CommonMemory.unRegisterCommonDeviceMap.values();
|
||||
return (List<IoTCommonDevice>) GlobalMemory.unRegisterCommonDeviceMap.values();
|
||||
}
|
||||
|
||||
public void save(IoTCommonDevice commonDevice) {
|
||||
|
||||
@@ -25,13 +25,19 @@
|
||||
<artifactId>spring-boot-starter-aop</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 系统模块-->
|
||||
<!-- 系统模块-->
|
||||
<dependency>
|
||||
<groupId>com.maibu</groupId>
|
||||
<artifactId>maibu-system-service</artifactId>
|
||||
<version>${maibu.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.maibu</groupId>-->
|
||||
<!-- <artifactId>maibu-common</artifactId>-->
|
||||
<!-- <version>${maibu.version}</version>-->
|
||||
<!-- </dependency>-->
|
||||
|
||||
<!-- 验证码 -->
|
||||
<dependency>
|
||||
<groupId>pro.fessional</groupId>
|
||||
|
||||
@@ -1,136 +0,0 @@
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,140 +0,0 @@
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,131 +0,0 @@
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,88 +0,0 @@
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -34,6 +34,7 @@ import org.springframework.security.core.userdetails.UserDetails;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
@@ -171,61 +172,7 @@ public class SysLoginService {
|
||||
return tokenService.createToken(loginUser);
|
||||
}
|
||||
|
||||
/**
|
||||
* 三方跳转登录认证方法
|
||||
*
|
||||
* @param username 系统用户名
|
||||
* @param encodePwd 系统用户密码
|
||||
* @return
|
||||
*/
|
||||
public String redirectLogin(String username, String encodePwd, String language) {
|
||||
// UserDetails userDetails=userDetailsServiceImpl.loadUserByUsername(username);
|
||||
SysUser user = userService.selectUserByUserName(username);
|
||||
if (StringUtils.isNull(user)) {
|
||||
throw new ServiceException("登录用户:" + username + " 不存在");
|
||||
} else if (UserStatus.DELETED.getCode().equals(user.getDelFlag())) {
|
||||
throw new ServiceException("对不起,您的账号:" + username + " 已被删除");
|
||||
} else if (UserStatus.DISABLE.getCode().equals(user.getStatus())) {
|
||||
throw new ServiceException("对不起,您的账号:" + username + " 已停用");
|
||||
}
|
||||
// 重写验证方法
|
||||
passwordService.socialValidate(user, encodePwd);
|
||||
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_SUCCESS, MessageUtils.message("user.login.success")));
|
||||
UserDetails userDetails = userDetailsServiceImpl.createLoginUser(user);
|
||||
LoginUser loginUser = (LoginUser) userDetails;
|
||||
recordLoginInfo(loginUser.getUserId());
|
||||
loginUser.setLanguage(language);
|
||||
// 生成token
|
||||
return tokenService.createToken(loginUser);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 组态分享页面生成token
|
||||
*
|
||||
* @param username 系统用户名
|
||||
* @return
|
||||
*/
|
||||
public String shareUserLogin(String username, String language) {
|
||||
SysUser user = userService.selectUserByUserName(username);
|
||||
if (StringUtils.isNull(user)) {
|
||||
throw new ServiceException("分享用户:" + username + " 不存在");
|
||||
} else if (UserStatus.DELETED.getCode().equals(user.getDelFlag())) {
|
||||
throw new ServiceException("对不起,您的分享账号:" + username + " 已被删除");
|
||||
} else if (UserStatus.DISABLE.getCode().equals(user.getStatus())) {
|
||||
throw new ServiceException("对不起,您的分享账号:" + username + " 已停用");
|
||||
}
|
||||
// 重写验证方法
|
||||
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_SUCCESS, MessageUtils.message("user.login.success")));
|
||||
UserDetails userDetails = userDetailsServiceImpl.createLoginUser(user);
|
||||
LoginUser loginUser = (LoginUser) userDetails;
|
||||
recordLoginInfo(loginUser.getUserId());
|
||||
loginUser.setLanguage(language);
|
||||
loginUser.setNeverExpire(Boolean.TRUE);
|
||||
// 生成token
|
||||
return tokenService.createToken(loginUser);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验验证码
|
||||
@@ -387,7 +334,7 @@ public class SysLoginService {
|
||||
sysUser = userMapper.selectUserByOpenId(openId);
|
||||
if (sysUser != null) {
|
||||
sysUser.setAiChatNum(-1);
|
||||
sysUser.setUpdateTime(new Date());
|
||||
sysUser.setUpdateTime(LocalDateTime.now());
|
||||
sysUser.setPhonenumber(phoneParam);
|
||||
userMapper.updateUser(sysUser);
|
||||
} else {
|
||||
@@ -405,7 +352,7 @@ public class SysLoginService {
|
||||
sysUser = userMapper.selectUserById(userId);
|
||||
if (sysUser != null) {
|
||||
sysUser.setAiChatNum(-1);
|
||||
sysUser.setUpdateTime(new Date());
|
||||
sysUser.setUpdateTime(LocalDateTime.now());
|
||||
sysUser.setPhonenumber(phoneParam);
|
||||
userMapper.updateUser(sysUser);
|
||||
} else {
|
||||
@@ -444,7 +391,7 @@ public class SysLoginService {
|
||||
}
|
||||
if (sysUser.getAiChatNum() != -1) {
|
||||
sysUser.setAiChatNum(-1);
|
||||
sysUser.setUpdateTime(new Date());
|
||||
sysUser.setUpdateTime(LocalDateTime.now());
|
||||
userMapper.updateUser(sysUser);
|
||||
}
|
||||
dto.setSuccess(true);
|
||||
|
||||
@@ -60,6 +60,6 @@ public class UserDetailsServiceImpl implements UserDetailsService
|
||||
|
||||
public UserDetails createLoginUser(SysUser user)
|
||||
{
|
||||
return new LoginUser(user.getUserId(), user.getDeptId(), user.getLanguage(), user, permissionService.getMenuPermission(user));
|
||||
return new LoginUser(user.getUserId(), user.getDeptId(), user.getOrgId(),user.getSiteId(),user.getLanguage(), user, permissionService.getMenuPermission(user));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,10 +7,10 @@ import com.huaweicloud.sdk.iot.device.client.requests.DeviceMessage;
|
||||
import com.huaweicloud.sdk.iot.device.client.requests.ServiceProperty;
|
||||
import com.huaweicloud.sdk.iot.device.transport.ActionListener;
|
||||
import com.maibu.common.NettyCacheKey;
|
||||
import com.maibu.core.business.DeviceRunningStatusHistory;
|
||||
import com.maibu.core.business.DeviceStatusRecordDTO;
|
||||
import com.maibu.core.redis.RedisCache;
|
||||
import com.maibu.domain.DeviceRunningStatusHistory;
|
||||
import com.maibu.domain.DeviceStatusRecordDTO;
|
||||
import com.maibu.dto.NettyDevice;
|
||||
import com.maibu.core.business.device.NettyDevice;
|
||||
import com.maibu.manager.DeviceSessionManager;
|
||||
import com.maibu.utils.spring.SpringUtils;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.maibu.common;
|
||||
|
||||
import com.maibu.core.enums.ConnectionCloseReason;
|
||||
import io.netty.util.AttributeKey;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -8,4 +9,9 @@ public class Constant {
|
||||
|
||||
public static final AttributeKey<String> ATT_DEVICE_ID = AttributeKey.valueOf("deviceId");
|
||||
|
||||
public static final AttributeKey<ConnectionCloseReason> ATT_CLOSE_REASON = AttributeKey.valueOf("closeReason");
|
||||
|
||||
public static final AttributeKey<String> ATT_ORG_ID = AttributeKey.valueOf("orgId");
|
||||
|
||||
public static final AttributeKey<String> ATT_SITE_ID = AttributeKey.valueOf("siteId");
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.maibu.controller;
|
||||
import com.maibu.common.CommandConstant;
|
||||
import com.maibu.core.controller.BaseController;
|
||||
import com.maibu.core.domain.AjaxResult;
|
||||
import com.maibu.dto.NettyDevice;
|
||||
import com.maibu.core.business.device.NettyDevice;
|
||||
import com.maibu.dto.ObstacleData;
|
||||
import com.maibu.manager.DeviceSessionManager;
|
||||
import com.maibu.utils.CommandUtils;
|
||||
@@ -11,7 +11,6 @@ import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.Unpooled;
|
||||
import io.netty.util.CharsetUtil;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.java_websocket.WebSocket;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package com.maibu.controller;
|
||||
|
||||
import com.maibu.core.business.DevicePlan;
|
||||
import com.maibu.core.controller.BaseController;
|
||||
import com.maibu.core.domain.AjaxResult;
|
||||
import com.maibu.core.domain.model.LoginUser;
|
||||
import com.maibu.domain.DevicePlan;
|
||||
import com.maibu.dto.DeviceTaskQueryDTO;
|
||||
import com.maibu.service.DeviceTaskService;
|
||||
import com.maibu.utils.SecurityUtils;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package com.maibu.controller;
|
||||
|
||||
import com.maibu.core.business.DeviceRunningStatusHistory;
|
||||
import com.maibu.core.controller.BaseController;
|
||||
import com.maibu.core.domain.AjaxResult;
|
||||
import com.maibu.core.page.TableDataInfo;
|
||||
import com.maibu.domain.DeviceRunningStatusHistory;
|
||||
import com.maibu.entity.ErrorIdentificationStandard;
|
||||
import com.maibu.core.business.ErrorIdentificationStandard;
|
||||
import com.maibu.service.NettyDeviceService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.maibu.dto;
|
||||
|
||||
import com.maibu.enums.RespondCode;
|
||||
import com.maibu.core.enums.RespondCode;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.maibu.dto;
|
||||
|
||||
import com.maibu.enums.RespondCode;
|
||||
import com.maibu.core.enums.RespondCode;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.maibu.dto;
|
||||
|
||||
import com.maibu.enums.CommandRequestType;
|
||||
import com.maibu.core.enums.CommandRequestType;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.maibu.dto;
|
||||
|
||||
import com.maibu.enums.RespondCode;
|
||||
import com.maibu.core.enums.RespondCode;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.maibu.dto;
|
||||
|
||||
import com.maibu.enums.DeviceTaskStaus;
|
||||
import com.maibu.core.enums.DeviceTaskStaus;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
package com.maibu.enums;
|
||||
|
||||
public enum CommandRequestType {
|
||||
switch_control
|
||||
}
|
||||
@@ -1,94 +0,0 @@
|
||||
package com.maibu.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();
|
||||
}
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
package com.maibu.enums;
|
||||
|
||||
public enum ConnectionCloseReason {
|
||||
NROMAL,
|
||||
TIMEOUT,
|
||||
REPEAT
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
package com.maibu.enums;
|
||||
|
||||
public enum ConnectorStatus {
|
||||
ACTIVE, // 完全可用
|
||||
RECEIVER, // 禁言(不可发送但可以接收)
|
||||
DISABLED // 完全不可用
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
package com.maibu.enums;
|
||||
|
||||
public enum ConnectorType {
|
||||
MASTER, // 上位机(主动绑定别人)
|
||||
SLAVE, // 下位机(只能被动绑定)
|
||||
GENERAL // 不区分角色(将来扩展用)
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
package com.maibu.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;
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package com.maibu.enums;
|
||||
|
||||
public enum RespondCode {
|
||||
/**
|
||||
* 账号已登录
|
||||
*/
|
||||
have_logged_in,
|
||||
|
||||
/**
|
||||
* 设备状态改变
|
||||
*/
|
||||
device_status_changed,
|
||||
/**
|
||||
* 设备错误推送
|
||||
*/
|
||||
device_error_push
|
||||
}
|
||||
@@ -1,11 +1,11 @@
|
||||
package com.maibu.init;
|
||||
|
||||
import com.maibu.constant.FastBeeConstant;
|
||||
import com.maibu.domain.DevicePlan;
|
||||
import com.maibu.enums.DeviceTaskStaus;
|
||||
import com.maibu.core.business.DevicePlan;
|
||||
import com.maibu.core.enums.DeviceTaskStaus;
|
||||
import com.maibu.mapper.DevicePlanMapper;
|
||||
import com.maibu.mapper.SysUserClientMapper;
|
||||
import com.maibu.memory.GlobalMemory;
|
||||
import com.maibu.memory.SiteMemory;
|
||||
import com.maibu.mybatis.LambdaQueryWrapperX;
|
||||
import com.maibu.service.DevicePlanTaskMonitorService;
|
||||
import com.maibu.service.DeviceThreadService;
|
||||
@@ -92,7 +92,7 @@ public class InitThread implements ApplicationRunner {
|
||||
query.in(DevicePlan::getTaskStaus, list);
|
||||
List<DevicePlan> devicePlanList = devicePlanMapper.selectList(query);
|
||||
if(!CollectionUtils.isEmpty(devicePlanList)){
|
||||
devicePlanList.forEach(GlobalMemory::addDevicePlan);
|
||||
devicePlanList.forEach(SiteMemory::addDevicePlan);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,10 +2,10 @@ package com.maibu.manager;
|
||||
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.maibu.dto.Connector;
|
||||
import com.maibu.dto.NettyDevice;
|
||||
import com.maibu.enums.ConnectorStatus;
|
||||
import com.maibu.enums.ConnectorType;
|
||||
import com.maibu.core.enums.ConnectorStatus;
|
||||
import com.maibu.core.enums.ConnectorType;
|
||||
import com.maibu.core.business.device.Connector;
|
||||
import com.maibu.core.business.device.NettyDevice;
|
||||
import io.netty.channel.Channel;
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.maibu.mapper;
|
||||
|
||||
import com.maibu.entity.ErrorIdentificationStandard;
|
||||
import com.maibu.core.business.ErrorIdentificationStandard;
|
||||
import com.maibu.mybatis.mapper.BaseMapperX;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
|
||||
@@ -1,96 +0,0 @@
|
||||
package com.maibu.memory;
|
||||
|
||||
import com.maibu.domain.DevicePlan;
|
||||
import com.maibu.domain.DevicePlanTask;
|
||||
import com.maibu.entity.ErrorIdentificationStandard;
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
@Component
|
||||
@Data
|
||||
public class GlobalMemory {
|
||||
|
||||
public List<ErrorIdentificationStandard> standard = null;
|
||||
|
||||
//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<>();
|
||||
|
||||
// 设备当前控制权在哪里key->deviceId value:userName:app/web/pc:token
|
||||
// public static final ConcurrentHashMap<String, String> controlLockMap = new ConcurrentHashMap<>();
|
||||
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,10 +1,11 @@
|
||||
package com.maibu.netty.handler;
|
||||
|
||||
import com.maibu.common.CommandConstant;
|
||||
import com.maibu.dto.Connector;
|
||||
import com.maibu.dto.NettyDevice;
|
||||
import com.maibu.enums.ConnectorType;
|
||||
import com.maibu.core.enums.ConnectorType;
|
||||
import com.maibu.core.business.device.Connector;
|
||||
import com.maibu.core.business.device.NettyDevice;
|
||||
import com.maibu.manager.DeviceSessionManager;
|
||||
import com.maibu.memory.GlobalMemory;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.channel.Channel;
|
||||
import io.netty.channel.ChannelHandler;
|
||||
@@ -35,6 +36,7 @@ public class CommandForwardHandler extends SimpleChannelInboundHandler<String> {
|
||||
Channel currentChannel = ctx.channel();
|
||||
byte[] bytes = Hex.decodeHex(msg.toCharArray());
|
||||
if (bytes.length > 3 && (bytes[2] == CommandConstant.remoteControl || bytes[2] == CommandConstant.path || bytes[2] == CommandConstant.status)) {
|
||||
|
||||
String senderDeviceId = deviceSessionManager.getDeviceIdByChannel(currentChannel);
|
||||
NettyDevice senderNettyDevice =
|
||||
senderDeviceId != null ? deviceSessionManager.getDevice(senderDeviceId) : null;
|
||||
|
||||
@@ -2,11 +2,11 @@ package com.maibu.netty.handler;
|
||||
|
||||
import com.maibu.common.CommandConstant;
|
||||
import com.maibu.common.NettyCacheKey;
|
||||
import com.maibu.core.business.DeviceRunStatistics;
|
||||
import com.maibu.core.business.DeviceRunningStatusHistory;
|
||||
import com.maibu.core.business.DeviceStatusRecordDTO;
|
||||
import com.maibu.core.redis.RedisCache;
|
||||
import com.maibu.domain.DeviceRunStatistics;
|
||||
import com.maibu.domain.DeviceRunningStatusHistory;
|
||||
import com.maibu.domain.DeviceStatusRecordDTO;
|
||||
import com.maibu.dto.NettyDevice;
|
||||
import com.maibu.core.business.device.NettyDevice;
|
||||
import com.maibu.manager.DeviceSessionManager;
|
||||
import io.netty.channel.Channel;
|
||||
import io.netty.channel.ChannelHandler;
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
package com.maibu.netty.handler;
|
||||
|
||||
import com.maibu.common.CommandConstant;
|
||||
import com.maibu.common.Constant;
|
||||
import com.maibu.core.business.Device;
|
||||
import com.maibu.core.business.device.NettyDevice;
|
||||
import com.maibu.core.domain.entity.SysUser;
|
||||
import com.maibu.core.domain.entity.UserClient;
|
||||
import com.maibu.domain.Device;
|
||||
import com.maibu.core.enums.*;
|
||||
import com.maibu.core.enums.DeviceStatus;
|
||||
import com.maibu.dto.*;
|
||||
import com.maibu.enums.*;
|
||||
import com.maibu.manager.DeviceSessionManager;
|
||||
import com.maibu.mapper.DeviceRunStatisticsMapper;
|
||||
import com.maibu.service.IDeviceService;
|
||||
@@ -32,9 +35,7 @@ import org.springframework.util.CollectionUtils;
|
||||
import java.math.BigDecimal;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Queue;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
@Component
|
||||
@@ -43,9 +44,6 @@ public class DeviceConnectHandler extends SimpleChannelInboundHandler<String> {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(DeviceConnectHandler.class);
|
||||
|
||||
public static final AttributeKey<String> ATT_DEVICE_ID = AttributeKey.valueOf("deviceId");
|
||||
public static final AttributeKey<ConnectionCloseReason> ATT_CLOSE_REASON = AttributeKey.valueOf("closeReason");
|
||||
|
||||
//记录切换控制权请求来源 key 是请求的masterId,value是控制当前设备的主机
|
||||
private final ConcurrentHashMap<String, String> controlRequestMap = new ConcurrentHashMap<>();
|
||||
|
||||
@@ -80,8 +78,8 @@ public class DeviceConnectHandler extends SimpleChannelInboundHandler<String> {
|
||||
@Override
|
||||
public void channelInactive(ChannelHandlerContext ctx) {
|
||||
Channel channel = ctx.channel();
|
||||
ConnectionCloseReason reason = channel.attr(ATT_CLOSE_REASON).get();
|
||||
String deviceId = channel.attr(ATT_DEVICE_ID).get();
|
||||
ConnectionCloseReason reason = channel.attr(Constant.ATT_CLOSE_REASON).get();
|
||||
String deviceId = channel.attr(Constant.ATT_DEVICE_ID).get();
|
||||
|
||||
if (reason == ConnectionCloseReason.REPEAT) {
|
||||
logger.warn("重复连接断开: {}", channel.remoteAddress());
|
||||
@@ -120,7 +118,7 @@ public class DeviceConnectHandler extends SimpleChannelInboundHandler<String> {
|
||||
Device device = deviceService.selectDeviceBySerialNumber(deviceId);
|
||||
if (device != null) {
|
||||
device.setOnlineStatus(DeviceStatus.offline.getType());
|
||||
device.setUpdateTime(new Date());
|
||||
device.setUpdateTime(LocalDateTime.now());
|
||||
deviceService.updateDeviceBySelf(device);
|
||||
//todo 更新历史作业消息
|
||||
}
|
||||
@@ -253,13 +251,13 @@ public class DeviceConnectHandler extends SimpleChannelInboundHandler<String> {
|
||||
device.setTenantId(-1L);
|
||||
device.setFirmwareVersion(BigDecimal.valueOf(1.0));
|
||||
device.setProductName("割草机产品MC700");
|
||||
device.setCreateTime(new Date());
|
||||
device.setUpdateTime(new Date());
|
||||
device.setCreateTime(LocalDateTime.now());
|
||||
device.setUpdateTime(LocalDateTime.now());
|
||||
deviceService.insertDeviceBySelf(device);
|
||||
} else {
|
||||
device.setStatus(3);
|
||||
device.setOnlineStatus(DeviceStatus.online.getType());
|
||||
device.setUpdateTime(new Date());
|
||||
device.setUpdateTime(LocalDateTime.now());
|
||||
deviceService.updateDeviceBySelf(device);
|
||||
}
|
||||
NettyDevice slaveDevice = sessionManager.getDevice(data);
|
||||
@@ -444,12 +442,12 @@ public class DeviceConnectHandler extends SimpleChannelInboundHandler<String> {
|
||||
}
|
||||
|
||||
private void handleSlaveConnect(ChannelHandlerContext ctx, String slaveId) {
|
||||
ctx.channel().attr(ATT_DEVICE_ID).set(slaveId);
|
||||
ctx.channel().attr(Constant.ATT_DEVICE_ID).set(slaveId);
|
||||
sessionManager.registerDevice(slaveId, ctx.channel(), ConnectorType.SLAVE, ConnectorStatus.ACTIVE, null);
|
||||
}
|
||||
|
||||
private void handleMasterConnect(ChannelHandlerContext ctx, String masterId, String slaveId, ConnectorStatus status) {
|
||||
ctx.channel().attr(ATT_DEVICE_ID).set(masterId);
|
||||
ctx.channel().attr(Constant.ATT_DEVICE_ID).set(masterId);
|
||||
sessionManager.registerDevice(masterId, ctx.channel(), ConnectorType.MASTER, status, slaveId);
|
||||
// sessionManager.bindConnector(masterId, slaveId);
|
||||
}
|
||||
@@ -457,7 +455,7 @@ public class DeviceConnectHandler extends SimpleChannelInboundHandler<String> {
|
||||
|
||||
@Override
|
||||
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
|
||||
String deviceId = ctx.channel().attr(ATT_DEVICE_ID).get();
|
||||
String deviceId = ctx.channel().attr(Constant.ATT_DEVICE_ID).get();
|
||||
logger.error("异常设备 {} 出现错误: {}", deviceId, cause.getMessage(), cause);
|
||||
ctx.close();
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package com.maibu.scheduled;
|
||||
|
||||
import com.maibu.common.NettyCacheKey;
|
||||
import com.maibu.core.business.DevicePlan;
|
||||
import com.maibu.core.business.DeviceStatusRecordDTO;
|
||||
import com.maibu.core.redis.RedisCache;
|
||||
import com.maibu.domain.DevicePlan;
|
||||
import com.maibu.domain.DeviceStatusRecordDTO;
|
||||
import com.maibu.mapper.DeviceStatusHistoryMapper;
|
||||
import com.maibu.memory.GlobalMemory;
|
||||
import com.maibu.memory.SiteMemory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -57,7 +57,7 @@ public class ScheduledTask {
|
||||
@Scheduled(cron = "0 0 0 * * ?")
|
||||
public void refreshDevicePlanTask() {
|
||||
System.out.println("0点定时刷新状态");
|
||||
Map<String, List<DevicePlan>> map = GlobalMemory.devicePlanMap;
|
||||
Map<String, List<DevicePlan>> map = SiteMemory.devicePlanMap;
|
||||
if (!CollectionUtils.isEmpty(map.keySet())) {
|
||||
map.values().forEach(x -> {
|
||||
if (!CollectionUtils.isEmpty(x)) {
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
package com.maibu.service;
|
||||
|
||||
|
||||
import com.maibu.domain.DevicePlan;
|
||||
import com.maibu.domain.DevicePlanTask;
|
||||
import com.maibu.domain.DeviceTaskPlanRule;
|
||||
import com.maibu.dto.NettyDevice;
|
||||
import com.maibu.enums.DeviceTaskPlanRepeatType;
|
||||
import com.maibu.enums.DeviceTaskStaus;
|
||||
import com.maibu.core.business.DevicePlan;
|
||||
import com.maibu.core.business.DevicePlanTask;
|
||||
import com.maibu.core.business.DeviceTaskPlanRule;
|
||||
import com.maibu.core.business.WorkRecord;
|
||||
import com.maibu.core.enums.DeviceTaskPlanRepeatType;
|
||||
import com.maibu.core.enums.DeviceTaskStaus;
|
||||
import com.maibu.core.business.device.NettyDevice;
|
||||
import com.maibu.manager.DeviceSessionManager;
|
||||
import com.maibu.mapper.DevicePlanMapper;
|
||||
import com.maibu.mapper.DevicePlanTaskMapper;
|
||||
import com.maibu.mapper.WorkRecordMapper;
|
||||
import com.maibu.memory.GlobalMemory;
|
||||
import com.maibu.model.WorkRecord;
|
||||
import com.maibu.memory.SiteMemory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -34,7 +34,7 @@ public class DevicePlanTaskMonitorService {
|
||||
|
||||
|
||||
@Autowired
|
||||
private GlobalMemory globalMemory;
|
||||
private SiteMemory siteMemory;
|
||||
|
||||
@Autowired
|
||||
private DevicePlanTaskMapper devicePlanTaskMapper;
|
||||
@@ -57,7 +57,7 @@ public class DevicePlanTaskMonitorService {
|
||||
ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor();
|
||||
executor.scheduleWithFixedDelay(() -> {
|
||||
try {
|
||||
Map<String, List<DevicePlan>> planMap = GlobalMemory.devicePlanMap;
|
||||
Map<String, List<DevicePlan>> planMap = SiteMemory.devicePlanMap;
|
||||
if (!CollectionUtils.isEmpty(planMap.values())) {
|
||||
Iterator<String> iterator = planMap.keySet().iterator();
|
||||
while (iterator.hasNext()) {
|
||||
@@ -109,7 +109,7 @@ public class DevicePlanTaskMonitorService {
|
||||
devicePlanTask.setCreateTime(LocalDateTime.now());
|
||||
devicePlanTask.setTaskType("");//待拓展任务类型
|
||||
devicePlanTaskMapper.insert(devicePlanTask);
|
||||
globalMemory.addDevicePlanPrepare(devicePlanTask);
|
||||
siteMemory.addDevicePlanPrepare(devicePlanTask);
|
||||
//啥时候重置?每日0点?
|
||||
devicePlan.setDayTriggerFlag(true);
|
||||
devicePlan.setUpdateTime(LocalDateTime.now());
|
||||
@@ -120,7 +120,7 @@ public class DevicePlanTaskMonitorService {
|
||||
if (endTime != null && endTime.isEqual(today)) {
|
||||
devicePlan.setFinishTime(LocalDateTime.now());
|
||||
devicePlan.setTaskStaus(DeviceTaskStaus.FINISH);
|
||||
GlobalMemory.removeDevicePlan(devicePlan);
|
||||
SiteMemory.removeDevicePlan(devicePlan);
|
||||
}
|
||||
devicePlanMapper.updateById(devicePlan);
|
||||
}
|
||||
@@ -143,7 +143,7 @@ public class DevicePlanTaskMonitorService {
|
||||
devicePlanTask.setCreateTime(LocalDateTime.now());
|
||||
devicePlanTask.setTaskType("");//待拓展任务类型
|
||||
devicePlanTaskMapper.insert(devicePlanTask);
|
||||
globalMemory.addDevicePlanPrepare(devicePlanTask);
|
||||
siteMemory.addDevicePlanPrepare(devicePlanTask);
|
||||
//啥时候重置?每日0点?
|
||||
devicePlan.setDayTriggerFlag(true);
|
||||
devicePlan.setUpdateTime(LocalDateTime.now());
|
||||
@@ -153,7 +153,7 @@ public class DevicePlanTaskMonitorService {
|
||||
if (endTime != null && endTime.isEqual(today)) {
|
||||
devicePlan.setFinishTime(LocalDateTime.now());
|
||||
devicePlan.setTaskStaus(DeviceTaskStaus.FINISH);
|
||||
GlobalMemory.removeDevicePlan(devicePlan);
|
||||
SiteMemory.removeDevicePlan(devicePlan);
|
||||
}
|
||||
devicePlanMapper.updateById(devicePlan);
|
||||
}
|
||||
@@ -175,7 +175,7 @@ public class DevicePlanTaskMonitorService {
|
||||
devicePlanTask.setCreateTime(LocalDateTime.now());
|
||||
devicePlanTask.setTaskType("");//待拓展任务类型
|
||||
devicePlanTaskMapper.insert(devicePlanTask);
|
||||
globalMemory.addDevicePlanPrepare(devicePlanTask);
|
||||
siteMemory.addDevicePlanPrepare(devicePlanTask);
|
||||
//啥时候重置?每日0点?
|
||||
devicePlan.setDayTriggerFlag(true);
|
||||
devicePlan.setUpdateTime(LocalDateTime.now());
|
||||
@@ -185,7 +185,7 @@ public class DevicePlanTaskMonitorService {
|
||||
if (endTime != null && endTime.isEqual(today)) {
|
||||
devicePlan.setFinishTime(LocalDateTime.now());
|
||||
devicePlan.setTaskStaus(DeviceTaskStaus.FINISH);
|
||||
GlobalMemory.removeDevicePlan(devicePlan);
|
||||
SiteMemory.removeDevicePlan(devicePlan);
|
||||
}
|
||||
devicePlanMapper.updateById(devicePlan);
|
||||
}
|
||||
@@ -202,7 +202,7 @@ public class DevicePlanTaskMonitorService {
|
||||
ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor();
|
||||
executor.scheduleWithFixedDelay(() -> {
|
||||
try {
|
||||
Map<String, List<DevicePlanTask>> planMap = GlobalMemory.devicePlanTaskPrepareMap;
|
||||
Map<String, List<DevicePlanTask>> planMap = SiteMemory.devicePlanTaskPrepareMap;
|
||||
if (!CollectionUtils.isEmpty(planMap.keySet())) {
|
||||
planMap.keySet().forEach(key -> {
|
||||
NettyDevice device = deviceSessionManager.getDevice(key);
|
||||
@@ -221,9 +221,9 @@ public class DevicePlanTaskMonitorService {
|
||||
DevicePlanTask devicePlanTask = list.get(0);
|
||||
String deviceId = devicePlanTask.getDeviceId();
|
||||
if (!StringUtils.isEmpty(deviceId) && deviceId.equals(key)) {
|
||||
GlobalMemory.addDevicePlanExecute(devicePlanTask);
|
||||
SiteMemory.addDevicePlanExecute(devicePlanTask);
|
||||
device.setCurrentTaskId(devicePlanTask.getId());
|
||||
GlobalMemory.removeDevicePlanPrepare(devicePlanTask);
|
||||
SiteMemory.removeDevicePlanPrepare(devicePlanTask);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -241,7 +241,7 @@ public class DevicePlanTaskMonitorService {
|
||||
ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor();
|
||||
executor.scheduleWithFixedDelay(() -> {
|
||||
try {
|
||||
Map<String, DevicePlanTask> planMap = GlobalMemory.devicePlanTaskExecuteMap;
|
||||
Map<String, DevicePlanTask> planMap = SiteMemory.devicePlanTaskExecuteMap;
|
||||
if (!CollectionUtils.isEmpty(planMap.keySet())) {
|
||||
planMap.keySet().forEach(key -> {
|
||||
NettyDevice device = deviceSessionManager.getDevice(key);
|
||||
|
||||
@@ -1,22 +1,18 @@
|
||||
package com.maibu.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.maibu.core.business.*;
|
||||
import com.maibu.core.domain.model.LoginUser;
|
||||
import com.maibu.domain.Device;
|
||||
import com.maibu.domain.DevicePlan;
|
||||
import com.maibu.domain.DevicePlanTask;
|
||||
import com.maibu.domain.DeviceTaskPlanRule;
|
||||
import com.maibu.core.enums.DeviceTaskStaus;
|
||||
import com.maibu.dto.DevicePlanStatisticsDTO;
|
||||
import com.maibu.dto.DevicePlanTaskStatisticsDTO;
|
||||
import com.maibu.dto.DeviceTaskQueryDTO;
|
||||
import com.maibu.dto.DeviceWorkStatisticsDTO;
|
||||
import com.maibu.enums.DeviceTaskStaus;
|
||||
import com.maibu.mapper.DeviceMapper;
|
||||
import com.maibu.mapper.DevicePlanMapper;
|
||||
import com.maibu.mapper.DevicePlanTaskMapper;
|
||||
import com.maibu.mapper.WorkRecordMapper;
|
||||
import com.maibu.memory.GlobalMemory;
|
||||
import com.maibu.model.WorkRecord;
|
||||
import com.maibu.memory.SiteMemory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -55,7 +51,7 @@ public class DeviceTaskService {
|
||||
devicePlan.setUpdateTime(LocalDateTime.now());
|
||||
transferDays(devicePlan);
|
||||
int i = devicePlanMapper.updateById(devicePlan);
|
||||
GlobalMemory.addDevicePlan(devicePlan);
|
||||
SiteMemory.addDevicePlan(devicePlan);
|
||||
return i;
|
||||
} else {
|
||||
devicePlan.setTaskStaus(DeviceTaskStaus.NEW);
|
||||
@@ -63,7 +59,7 @@ public class DeviceTaskService {
|
||||
devicePlan.setCreateBy(loginUser.getUsername());
|
||||
transferDays(devicePlan);
|
||||
int i = devicePlanMapper.insert(devicePlan);
|
||||
GlobalMemory.addDevicePlan(devicePlan);
|
||||
SiteMemory.addDevicePlan(devicePlan);
|
||||
return i;
|
||||
}
|
||||
}
|
||||
@@ -148,7 +144,7 @@ public class DeviceTaskService {
|
||||
DevicePlan planTask = devicePlanMapper.selectById(id);
|
||||
if (planTask != null) {
|
||||
planTask.setDelFlag(1);
|
||||
GlobalMemory.removeDevicePlan(planTask);
|
||||
SiteMemory.removeDevicePlan(planTask);
|
||||
return devicePlanMapper.updateById(planTask);
|
||||
}
|
||||
return 0;
|
||||
@@ -308,8 +304,8 @@ public class DeviceTaskService {
|
||||
|
||||
public List<DevicePlanTask> deviceTaskPool(DeviceTaskQueryDTO dto) {
|
||||
List<DevicePlanTask> list = new ArrayList<>();
|
||||
GlobalMemory.devicePlanTaskPrepareMap.values().forEach(list::addAll);
|
||||
list.addAll(GlobalMemory.devicePlanTaskExecuteMap.values());
|
||||
SiteMemory.devicePlanTaskPrepareMap.values().forEach(list::addAll);
|
||||
list.addAll(SiteMemory.devicePlanTaskExecuteMap.values());
|
||||
if (dto != null) {
|
||||
if (dto.getTaskStaus() != null) {
|
||||
list = list.stream().filter(x -> x.getTaskStaus().equals(dto.getTaskStaus())).collect(Collectors.toList());
|
||||
|
||||
@@ -5,18 +5,18 @@ import cn.hutool.core.io.IoUtil;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.maibu.common.CommandConstant;
|
||||
import com.maibu.common.NettyCacheKey;
|
||||
import com.maibu.core.business.DeviceRunningStatusHistory;
|
||||
import com.maibu.core.business.DeviceStatusRecordDTO;
|
||||
import com.maibu.core.enums.CompareEnum;
|
||||
import com.maibu.core.enums.RespondCode;
|
||||
import com.maibu.core.redis.RedisCache;
|
||||
import com.maibu.domain.DeviceRunningStatusHistory;
|
||||
import com.maibu.domain.DeviceStatusRecordDTO;
|
||||
import com.maibu.dto.DeviceErrorPushDTO;
|
||||
import com.maibu.dto.DeviceErrorPushDetail;
|
||||
import com.maibu.dto.NettyDevice;
|
||||
import com.maibu.entity.ErrorIdentificationStandard;
|
||||
import com.maibu.enums.CompareEnum;
|
||||
import com.maibu.enums.RespondCode;
|
||||
import com.maibu.core.business.device.NettyDevice;
|
||||
import com.maibu.core.business.ErrorIdentificationStandard;
|
||||
import com.maibu.manager.DeviceSessionManager;
|
||||
import com.maibu.mapper.ErrorIdentificationStandardMapper;
|
||||
import com.maibu.memory.GlobalMemory;
|
||||
import com.maibu.memory.SiteMemory;
|
||||
import com.maibu.utils.CommandUtils;
|
||||
import com.maibu.utils.CompareUtils;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
@@ -47,7 +47,7 @@ public class DeviceThreadService {
|
||||
private ResourceLoader resourceLoader;
|
||||
|
||||
@Autowired
|
||||
private GlobalMemory globalMemory;
|
||||
private SiteMemory siteMemory;
|
||||
|
||||
@Autowired
|
||||
private RedisCache redisCache;
|
||||
@@ -73,7 +73,7 @@ public class DeviceThreadService {
|
||||
if (recordDTO != null && !CollectionUtils.isEmpty(recordDTO.getHistories())) {
|
||||
recordDTO.getHistories().sort(Comparator.comparing(DeviceRunningStatusHistory::getCreateTime).reversed());
|
||||
DeviceRunningStatusHistory history = recordDTO.getHistories().get(0);
|
||||
List<DeviceErrorPushDetail> compared = compareErrorStandard(history, globalMemory.standard);
|
||||
List<DeviceErrorPushDetail> compared = compareErrorStandard(history, siteMemory.standard);
|
||||
|
||||
String[] parts = k.split(":");
|
||||
String deviceId = parts[1];
|
||||
@@ -95,16 +95,16 @@ public class DeviceThreadService {
|
||||
}
|
||||
|
||||
public void initStandard() throws IOException {
|
||||
if (globalMemory.standard == null) {
|
||||
if (siteMemory.standard == null) {
|
||||
List<ErrorIdentificationStandard> standards = standardMapper.selectList();
|
||||
if (CollectionUtils.isEmpty(standards)) {
|
||||
// 读取resource目录下的device-config.json文件
|
||||
Resource resource = resourceLoader.getResource("classpath:errorStandard.json");
|
||||
// 使用fastjson2转换为DeviceConfig对象
|
||||
String jsonContent = IoUtil.readUtf8(resource.getInputStream());
|
||||
globalMemory.standard = JSON.parseArray(jsonContent, ErrorIdentificationStandard.class);
|
||||
siteMemory.standard = JSON.parseArray(jsonContent, ErrorIdentificationStandard.class);
|
||||
} else {
|
||||
globalMemory.standard = standards;
|
||||
siteMemory.standard = standards;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package com.maibu.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.maibu.domain.DeviceRunningStatusHistory;
|
||||
import com.maibu.entity.ErrorIdentificationStandard;
|
||||
import com.maibu.core.business.DeviceRunningStatusHistory;
|
||||
import com.maibu.core.business.ErrorIdentificationStandard;
|
||||
import com.maibu.mapper.DeviceStatusHistoryMapper;
|
||||
import com.maibu.mapper.ErrorIdentificationStandardMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@@ -1,21 +1,22 @@
|
||||
package com.maibu.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.maibu.core.business.Device;
|
||||
import com.maibu.core.business.device.NettyDevice;
|
||||
import com.maibu.core.domain.AjaxResult;
|
||||
import com.maibu.core.domain.entity.UserClient;
|
||||
import com.maibu.core.domain.model.LoginUser;
|
||||
import com.maibu.domain.Device;
|
||||
import com.maibu.dto.*;
|
||||
import com.maibu.enums.ConnectorStatus;
|
||||
import com.maibu.core.enums.ConnectorStatus;
|
||||
import com.maibu.manager.DeviceSessionManager;
|
||||
import com.maibu.mapper.DeviceMapper;
|
||||
import com.maibu.mapper.SysUserClientMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import com.maibu.dto.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
@@ -57,7 +58,7 @@ public class TransferDeviceService {
|
||||
}
|
||||
device.setTenantId(user.getUserId());
|
||||
device.setTenantName(user.getUsername());
|
||||
device.setUpdateTime(new Date());
|
||||
device.setUpdateTime(LocalDateTime.now());
|
||||
device.setDeviceAlias(deviceAlias);
|
||||
device.setActiveTime(new Date());
|
||||
iDeviceService.updateDeviceBySelf(device);
|
||||
@@ -87,7 +88,7 @@ public class TransferDeviceService {
|
||||
}
|
||||
device.setTenantId(-1L);
|
||||
device.setTenantName("");
|
||||
device.setUpdateTime(new Date());
|
||||
device.setUpdateTime(LocalDateTime.now());
|
||||
device.setDeviceAlias("");
|
||||
// deviceMapper.updateById(device);
|
||||
iDeviceService.updateDeviceBySelf(device);
|
||||
@@ -109,7 +110,7 @@ public class TransferDeviceService {
|
||||
//删除从的连接关系
|
||||
NettyDevice oldSlaveDevice = sessionManager.getDevice(oldSlave);
|
||||
if (oldSlaveDevice != null && !CollectionUtils.isEmpty(oldSlaveDevice.getConnectedConnectors())) {
|
||||
Set<Connector> connectedDevices = oldSlaveDevice.getConnectedConnectors();
|
||||
Set<com.maibu.core.business.device.Connector> connectedDevices = oldSlaveDevice.getConnectedConnectors();
|
||||
connectedDevices.removeIf(x -> x.getConnectorId().equals(masterId));
|
||||
}
|
||||
}
|
||||
@@ -143,7 +144,7 @@ public class TransferDeviceService {
|
||||
return AjaxResult.error("无操作权限");
|
||||
}
|
||||
device.setDeviceAlias(bindDTO.getDeviceAlias());
|
||||
device.setUpdateTime(new Date());
|
||||
device.setUpdateTime(LocalDateTime.now());
|
||||
device.setCreateBy(user.getUsername());
|
||||
iDeviceService.updateDeviceBySelf(device);
|
||||
return AjaxResult.success(true);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.maibu.utils;
|
||||
|
||||
import com.maibu.enums.CompareEnum;
|
||||
import com.maibu.core.enums.CompareEnum;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package com.maibu.controller;
|
||||
|
||||
import com.maibu.annotation.Log;
|
||||
import com.maibu.core.business.Device;
|
||||
import com.maibu.core.business.DeviceRunStatistics;
|
||||
import com.maibu.core.controller.BaseController;
|
||||
import com.maibu.core.domain.AjaxResult;
|
||||
import com.maibu.core.page.TableDataInfo;
|
||||
import com.maibu.domain.Device;
|
||||
import com.maibu.domain.DeviceRunStatistics;
|
||||
import com.maibu.enums.BusinessType;
|
||||
import com.maibu.mapper.DeviceRunStatisticsMapper;
|
||||
import com.maibu.mybatis.LambdaQueryWrapperX;
|
||||
@@ -59,19 +59,12 @@ public class DeviceController extends BaseController {
|
||||
@ApiOperation("设备分页列表")
|
||||
public TableDataInfo list(Device device) {
|
||||
startPage();
|
||||
// 限制当前用户机构
|
||||
if (null == device.getDeptId()) {
|
||||
device.setDeptId(getLoginUser().getDeptId());
|
||||
}
|
||||
return getDataTable(deviceService.selectDeviceList(device));
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/userDevice")
|
||||
public AjaxResult userDevice(Device device) {
|
||||
if (null == device.getDeptId()) {
|
||||
device.setDeptId(100L);
|
||||
}
|
||||
return AjaxResult.success(deviceService.selectDeviceList(device));
|
||||
}
|
||||
|
||||
|
||||
@@ -1,167 +0,0 @@
|
||||
package com.maibu.domain;
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
@@ -1,267 +0,0 @@
|
||||
package com.maibu.domain;
|
||||
|
||||
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 com.maibu.core.domain.BaseEntity;
|
||||
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 id;
|
||||
|
||||
/**
|
||||
* 设备编号
|
||||
*/
|
||||
@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;
|
||||
/**
|
||||
* 删除标志(0代表存在 2代表删除)
|
||||
*/
|
||||
@ApiModelProperty("删除标志")
|
||||
private String delFlag;
|
||||
|
||||
@Transient
|
||||
@ApiModelProperty("用户id")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 协议
|
||||
*/
|
||||
private String protocolCode;
|
||||
|
||||
@TableField(exist = false)
|
||||
private DeviceRunningStatusHistory lastRunningStatus;
|
||||
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
package com.maibu.domain;
|
||||
|
||||
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.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; //当天的任务是否已经生成
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
package com.maibu.domain;
|
||||
|
||||
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.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; //任务类型分类
|
||||
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
package com.maibu.domain;
|
||||
|
||||
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;
|
||||
|
||||
}
|
||||
@@ -1,69 +0,0 @@
|
||||
package com.maibu.domain;
|
||||
|
||||
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;
|
||||
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
package com.maibu.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class DeviceStatusRecordDTO {
|
||||
private List<DeviceRunningStatusHistory> histories;
|
||||
private long lastRecordTime;
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
package com.maibu.domain;
|
||||
|
||||
import com.maibu.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; //星期翻译
|
||||
|
||||
}
|
||||
@@ -1,171 +0,0 @@
|
||||
package com.maibu.domain;
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.maibu.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum ConnectType {
|
||||
|
||||
TCP,
|
||||
|
||||
MQTT,
|
||||
|
||||
HTTP;
|
||||
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package com.maibu.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;
|
||||
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package com.maibu.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;
|
||||
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
package com.maibu.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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,81 +0,0 @@
|
||||
package com.maibu.mapper;
|
||||
|
||||
import com.maibu.domain.Category;
|
||||
import com.maibu.model.IdAndName;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 产品分类Mapper接口
|
||||
*
|
||||
* @author kerwincui
|
||||
* @date 2021-12-16
|
||||
*/
|
||||
@Repository
|
||||
public interface CategoryMapper
|
||||
{
|
||||
/**
|
||||
* 查询产品分类
|
||||
*
|
||||
* @param categoryId 产品分类主键
|
||||
* @return 产品分类
|
||||
*/
|
||||
public Category selectCategoryByCategoryId(Long categoryId);
|
||||
|
||||
/**
|
||||
* 查询产品分类列表
|
||||
*
|
||||
* @param category 产品分类
|
||||
* @return 产品分类集合
|
||||
*/
|
||||
public List<Category> selectCategoryList(Category category);
|
||||
|
||||
/**
|
||||
* 查询产品简短分类列表
|
||||
*
|
||||
* @return 产品分类集合
|
||||
*/
|
||||
public List<IdAndName> selectCategoryShortList(Category category);
|
||||
|
||||
/**
|
||||
* 新增产品分类
|
||||
*
|
||||
* @param category 产品分类
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertCategory(Category category);
|
||||
|
||||
/**
|
||||
* 修改产品分类
|
||||
*
|
||||
* @param category 产品分类
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateCategory(Category category);
|
||||
|
||||
/**
|
||||
* 删除产品分类
|
||||
*
|
||||
* @param categoryId 产品分类主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCategoryByCategoryId(Long categoryId);
|
||||
|
||||
/**
|
||||
* 批量删除产品分类
|
||||
*
|
||||
* @param categoryIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCategoryByCategoryIds(Long[] categoryIds);
|
||||
|
||||
/**
|
||||
* 分类下的产品数量
|
||||
*
|
||||
* @param categoryIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int productCountInCategorys(Long[] categoryIds);
|
||||
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.maibu.mapper;
|
||||
|
||||
import com.maibu.domain.Device;
|
||||
import com.maibu.core.business.Device;
|
||||
import com.maibu.mybatis.mapper.BaseMapperX;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user