diff --git a/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/DeviceDataMeasureController.java b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/DeviceDataMeasureController.java index 5e8e20f..2e34f8d 100644 --- a/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/DeviceDataMeasureController.java +++ b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/DeviceDataMeasureController.java @@ -115,6 +115,7 @@ public class DeviceDataMeasureController { @Operation(summary = "获取7日趋势数据") @RequestMapping(value = "/getLineData",method = RequestMethod.POST) public SimpleDataResponse> getLineData( + @Parameter(name = "searchType", description = "1-按小时,2-全部数据", required = true) Integer searchType, @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required=true) String LoginName, @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required=true) String AccessToken, @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long UserId, @@ -122,7 +123,7 @@ public class DeviceDataMeasureController { @Parameter(name = "LanguageType", description = "Language type (0: Chinese, 1: English, 2: Japanese)", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required=true) Integer LanguageType, @RequestBody LineDataSearchParams lineDataSearchParams ) throws BusinessException { - return deviceDataMeasureService.getLineData(lineDataSearchParams, CompanyId, UserId, LanguageType); + return deviceDataMeasureService.getLineData(searchType, lineDataSearchParams, CompanyId, UserId, LanguageType); } } diff --git a/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/DeviceGroupController.java b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/DeviceGroupController.java index e4f385f..92d1f08 100644 --- a/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/DeviceGroupController.java +++ b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/DeviceGroupController.java @@ -40,7 +40,6 @@ public class DeviceGroupController { @Autowired private DeviceGroupService deviceGroupService; - @Hidden @OperationLog(operation = "addDeviceGroup", remark = "") @Operation(summary = "Add deviceGroup") @RequestMapping(value = "/add", method = RequestMethod.POST) @@ -54,7 +53,6 @@ public class DeviceGroupController { return deviceGroupService.add(optDeviceGroupParams, UserId, CompanyId, LanguageType); } - @Hidden @OperationLog(operation = "editDeviceGroup", remark = "") @Operation(summary = "Edit deviceGroup") @RequestMapping(value = "/edit", method = RequestMethod.POST) @@ -68,7 +66,6 @@ public class DeviceGroupController { return deviceGroupService.edit(optDeviceGroupParams, UserId, CompanyId, LanguageType); } - @Hidden @OperationLog(operation = "deleteDeviceGroup", remark = "") @Operation(summary = "Delete deviceGroup") @RequestMapping(value = "/batchDelete", method = RequestMethod.POST) diff --git a/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/OverviewController.java b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/OverviewController.java index d15bd59..86818d4 100644 --- a/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/OverviewController.java +++ b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/OverviewController.java @@ -3,6 +3,7 @@ package com.dongjian.dashboard.back.controller; import com.dongjian.dashboard.back.common.response.SimpleDataResponse; import com.dongjian.dashboard.back.configurator.interceptor.AccessRequired; import com.dongjian.dashboard.back.service.OverviewService; +import com.dongjian.dashboard.back.vo.dashboardnotification.DashboardNotificationPageVO; import com.dongjian.dashboard.back.vo.data.OverviewVO; import com.dongjian.dashboard.back.weather.JpMeshHourlyForecasts; import com.dongjian.dashboard.back.weather.QueryWeather; @@ -53,4 +54,16 @@ public class OverviewController { @Parameter(name = "UTCOffset", description = "Time zone offset in minutes from GMT, e.g., +480 for UTC+8", required = true, schema = @Schema(defaultValue = "-480")) @RequestHeader(required = true) Integer UTCOffset) { return overviewService.getWeatherInfo(queryWeather, UserId, CompanyId, LanguageType, UTCOffset); } + + @Operation(summary = "Get notification") + @RequestMapping(value = "/getNotification", method = RequestMethod.GET) + public SimpleDataResponse getNotification( + @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required = true) String LoginName, + @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required = true) String AccessToken, + @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required = true) Long UserId, + @Parameter(name = "CompanyId", description = "User's company ID", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required = false) Long CompanyId, + @Parameter(name = "LanguageType", description = "Language type: 0 - Chinese, 1 - English, 2 - Japanese", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required = true) Integer LanguageType, + @Parameter(name = "UTCOffset", description = "Time zone offset in minutes from GMT, e.g., +480 for UTC+8", required = true, schema = @Schema(defaultValue = "-480")) @RequestHeader(required = true) Integer UTCOffset) { + return overviewService.getNotification(UserId, CompanyId, LanguageType, UTCOffset); + } } diff --git a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/DashboardNotificationMapper.java b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/DashboardNotificationMapper.java new file mode 100644 index 0000000..fcbd442 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/DashboardNotificationMapper.java @@ -0,0 +1,120 @@ +package com.dongjian.dashboard.back.dao.auto; + +import com.dongjian.dashboard.back.model.DashboardNotification; +import com.dongjian.dashboard.back.model.DashboardNotificationExample; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface DashboardNotificationMapper { + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_notification + * + * @mbg.generated + */ + long countByExample(DashboardNotificationExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_notification + * + * @mbg.generated + */ + int deleteByExample(DashboardNotificationExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_notification + * + * @mbg.generated + */ + int deleteByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_notification + * + * @mbg.generated + */ + int insert(DashboardNotification record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_notification + * + * @mbg.generated + */ + int insertSelective(DashboardNotification record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_notification + * + * @mbg.generated + */ + List selectByExampleWithBLOBs(DashboardNotificationExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_notification + * + * @mbg.generated + */ + List selectByExample(DashboardNotificationExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_notification + * + * @mbg.generated + */ + DashboardNotification selectByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_notification + * + * @mbg.generated + */ + int updateByExampleSelective(@Param("record") DashboardNotification record, @Param("example") DashboardNotificationExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_notification + * + * @mbg.generated + */ + int updateByExampleWithBLOBs(@Param("record") DashboardNotification record, @Param("example") DashboardNotificationExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_notification + * + * @mbg.generated + */ + int updateByExample(@Param("record") DashboardNotification record, @Param("example") DashboardNotificationExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_notification + * + * @mbg.generated + */ + int updateByPrimaryKeySelective(DashboardNotification record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_notification + * + * @mbg.generated + */ + int updateByPrimaryKeyWithBLOBs(DashboardNotification record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_notification + * + * @mbg.generated + */ + int updateByPrimaryKey(DashboardNotification record); +} \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/DashboardNotificationMapperExt.java b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/DashboardNotificationMapperExt.java new file mode 100644 index 0000000..7de86e8 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/DashboardNotificationMapperExt.java @@ -0,0 +1,17 @@ +package com.dongjian.dashboard.back.dao.ex; + +import java.util.List; + +import com.dongjian.dashboard.back.dao.auto.DashboardNotificationMapper; +import com.dongjian.dashboard.back.dao.auto.UserBuildingRelationMapper; +import com.dongjian.dashboard.back.model.UserBuildingRelation; +import com.dongjian.dashboard.back.vo.building.BindedBuildingVO; +import com.dongjian.dashboard.back.vo.dashboardnotification.DashboardNotificationPageVO; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface DashboardNotificationMapperExt extends DashboardNotificationMapper { + + DashboardNotificationPageVO getNotification(Long companyId); + +} diff --git a/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/DashboardNotificationMapper.xml b/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/DashboardNotificationMapper.xml new file mode 100644 index 0000000..4ba4c67 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/DashboardNotificationMapper.xml @@ -0,0 +1,423 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + id, company_id, demand_time, category, flag, created_at, created_by, updated_at, + updated_by + + + + content + + + + + + + delete from dashboard_notification + where id = #{id,jdbcType=BIGINT} + + + + delete from dashboard_notification + + + + + + + + SELECT LAST_INSERT_ID() + + insert into dashboard_notification (company_id, demand_time, category, + flag, created_at, created_by, + updated_at, updated_by, content + ) + values (#{companyId,jdbcType=BIGINT}, #{demandTime,jdbcType=VARCHAR}, #{category,jdbcType=VARCHAR}, + #{flag,jdbcType=INTEGER}, #{createdAt,jdbcType=BIGINT}, #{createdBy,jdbcType=BIGINT}, + #{updatedAt,jdbcType=BIGINT}, #{updatedBy,jdbcType=BIGINT}, #{content,jdbcType=LONGVARCHAR} + ) + + + + + SELECT LAST_INSERT_ID() + + insert into dashboard_notification + + + company_id, + + + demand_time, + + + category, + + + flag, + + + created_at, + + + created_by, + + + updated_at, + + + updated_by, + + + content, + + + + + #{companyId,jdbcType=BIGINT}, + + + #{demandTime,jdbcType=VARCHAR}, + + + #{category,jdbcType=VARCHAR}, + + + #{flag,jdbcType=INTEGER}, + + + #{createdAt,jdbcType=BIGINT}, + + + #{createdBy,jdbcType=BIGINT}, + + + #{updatedAt,jdbcType=BIGINT}, + + + #{updatedBy,jdbcType=BIGINT}, + + + #{content,jdbcType=LONGVARCHAR}, + + + + + + + update dashboard_notification + + + id = #{record.id,jdbcType=BIGINT}, + + + company_id = #{record.companyId,jdbcType=BIGINT}, + + + demand_time = #{record.demandTime,jdbcType=VARCHAR}, + + + category = #{record.category,jdbcType=VARCHAR}, + + + flag = #{record.flag,jdbcType=INTEGER}, + + + created_at = #{record.createdAt,jdbcType=BIGINT}, + + + created_by = #{record.createdBy,jdbcType=BIGINT}, + + + updated_at = #{record.updatedAt,jdbcType=BIGINT}, + + + updated_by = #{record.updatedBy,jdbcType=BIGINT}, + + + content = #{record.content,jdbcType=LONGVARCHAR}, + + + + + + + + + update dashboard_notification + set id = #{record.id,jdbcType=BIGINT}, + company_id = #{record.companyId,jdbcType=BIGINT}, + demand_time = #{record.demandTime,jdbcType=VARCHAR}, + category = #{record.category,jdbcType=VARCHAR}, + flag = #{record.flag,jdbcType=INTEGER}, + created_at = #{record.createdAt,jdbcType=BIGINT}, + created_by = #{record.createdBy,jdbcType=BIGINT}, + updated_at = #{record.updatedAt,jdbcType=BIGINT}, + updated_by = #{record.updatedBy,jdbcType=BIGINT}, + content = #{record.content,jdbcType=LONGVARCHAR} + + + + + + + update dashboard_notification + set id = #{record.id,jdbcType=BIGINT}, + company_id = #{record.companyId,jdbcType=BIGINT}, + demand_time = #{record.demandTime,jdbcType=VARCHAR}, + category = #{record.category,jdbcType=VARCHAR}, + flag = #{record.flag,jdbcType=INTEGER}, + created_at = #{record.createdAt,jdbcType=BIGINT}, + created_by = #{record.createdBy,jdbcType=BIGINT}, + updated_at = #{record.updatedAt,jdbcType=BIGINT}, + updated_by = #{record.updatedBy,jdbcType=BIGINT} + + + + + + + update dashboard_notification + + + company_id = #{companyId,jdbcType=BIGINT}, + + + demand_time = #{demandTime,jdbcType=VARCHAR}, + + + category = #{category,jdbcType=VARCHAR}, + + + flag = #{flag,jdbcType=INTEGER}, + + + created_at = #{createdAt,jdbcType=BIGINT}, + + + created_by = #{createdBy,jdbcType=BIGINT}, + + + updated_at = #{updatedAt,jdbcType=BIGINT}, + + + updated_by = #{updatedBy,jdbcType=BIGINT}, + + + content = #{content,jdbcType=LONGVARCHAR}, + + + where id = #{id,jdbcType=BIGINT} + + + + update dashboard_notification + set company_id = #{companyId,jdbcType=BIGINT}, + demand_time = #{demandTime,jdbcType=VARCHAR}, + category = #{category,jdbcType=VARCHAR}, + flag = #{flag,jdbcType=INTEGER}, + created_at = #{createdAt,jdbcType=BIGINT}, + created_by = #{createdBy,jdbcType=BIGINT}, + updated_at = #{updatedAt,jdbcType=BIGINT}, + updated_by = #{updatedBy,jdbcType=BIGINT}, + content = #{content,jdbcType=LONGVARCHAR} + where id = #{id,jdbcType=BIGINT} + + + + update dashboard_notification + set company_id = #{companyId,jdbcType=BIGINT}, + demand_time = #{demandTime,jdbcType=VARCHAR}, + category = #{category,jdbcType=VARCHAR}, + flag = #{flag,jdbcType=INTEGER}, + created_at = #{createdAt,jdbcType=BIGINT}, + created_by = #{createdBy,jdbcType=BIGINT}, + updated_at = #{updatedAt,jdbcType=BIGINT}, + updated_by = #{updatedBy,jdbcType=BIGINT} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/DeviceGroupMapper.xml b/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/DeviceGroupMapper.xml index c39d116..1bb8a40 100644 --- a/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/DeviceGroupMapper.xml +++ b/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/DeviceGroupMapper.xml @@ -9,6 +9,7 @@ + @@ -86,7 +87,7 @@ WARNING - @mbg.generated This element is automatically generated by MyBatis Generator, do not modify. --> - id, company_id, building_id, `name`, remark, flag, created_by, created_at + id, company_id, building_id, class_id, `name`, remark, flag, created_by, created_at