Compare commits
7 Commits
dev_bl_new
...
dev
| Author | SHA1 | Date |
|---|---|---|
|
|
4fd5c674b5 | 3 weeks ago |
|
|
1871e06353 | 2 months ago |
|
|
fc98e3bd6d | 7 months ago |
|
|
c83403c4cd | 9 months ago |
|
|
5210bcdd58 | 9 months ago |
|
|
ebabe3d17a | 9 months ago |
|
|
c4eaa3b97b | 9 months ago |
236 changed files with 692 additions and 19533 deletions
Binary file not shown.
@ -1,84 +0,0 @@
|
||||
package com.mh.web.controller.ai; |
||||
|
||||
import com.mh.common.config.MHConfig; |
||||
import com.mh.common.core.controller.BaseController; |
||||
import org.springframework.core.io.FileSystemResource; |
||||
import org.springframework.core.io.Resource; |
||||
import org.springframework.http.HttpHeaders; |
||||
import org.springframework.http.MediaType; |
||||
import org.springframework.http.ResponseEntity; |
||||
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.RequestMapping; |
||||
import org.springframework.web.bind.annotation.RestController; |
||||
|
||||
import java.io.File; |
||||
import java.net.URLEncoder; |
||||
import java.nio.charset.StandardCharsets; |
||||
|
||||
/** |
||||
* AI文件下载控制器 |
||||
* 处理AI生成的报表文件下载请求 |
||||
* |
||||
* @author mh |
||||
*/ |
||||
@RestController |
||||
@RequestMapping("/ai/files") |
||||
public class AiFileController extends BaseController { |
||||
|
||||
/** |
||||
* 下载AI生成的文件 |
||||
* |
||||
* @param filename 文件名 |
||||
* @return 文件响应 |
||||
*/ |
||||
@GetMapping("/{filename:.+}") |
||||
public ResponseEntity<Resource> downloadFile(@PathVariable String filename) { |
||||
return getResourceResponseEntity(filename); |
||||
} |
||||
|
||||
private ResponseEntity<Resource> getResourceResponseEntity(@PathVariable String filename) { |
||||
try { |
||||
// 构建文件路径
|
||||
String storageDir = MHConfig.getProfile(); |
||||
File file = new File(storageDir, filename); |
||||
|
||||
// 检查文件是否存在
|
||||
if (!file.exists()) { |
||||
return ResponseEntity.notFound().build(); |
||||
} |
||||
|
||||
// 创建资源
|
||||
Resource resource = new FileSystemResource(file); |
||||
|
||||
// 使用RFC 5987标准格式,支持UTF-8编码
|
||||
String encodedFileName = URLEncoder.encode(filename, StandardCharsets.UTF_8); |
||||
String disposition = String.format("attachment; filename*=UTF-8''%s", encodedFileName); |
||||
|
||||
HttpHeaders headers = new HttpHeaders(); |
||||
headers.add(HttpHeaders.CONTENT_DISPOSITION, disposition); |
||||
headers.add(HttpHeaders.ACCESS_CONTROL_EXPOSE_HEADERS, HttpHeaders.CONTENT_DISPOSITION); |
||||
|
||||
return ResponseEntity.ok() |
||||
.headers(headers) |
||||
.contentLength(file.length()) |
||||
.contentType(MediaType.APPLICATION_OCTET_STREAM) |
||||
.body(resource); |
||||
|
||||
} catch (Exception e) { |
||||
return ResponseEntity.internalServerError().build(); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* 设备分析导出 |
||||
* |
||||
* @param filename 文件名 |
||||
* @return 文件响应 |
||||
*/ |
||||
@PostMapping("/{filename:.+}") |
||||
public ResponseEntity<Resource> deviceAnalyzeExport(@PathVariable String filename) { |
||||
return getResourceResponseEntity(filename); |
||||
} |
||||
} |
||||
@ -1,48 +0,0 @@
|
||||
package com.mh.web.controller.ai; |
||||
|
||||
import com.mh.common.core.controller.BaseController; |
||||
import com.mh.common.core.domain.dto.AsyncTaskDTO; |
||||
import com.mh.system.service.ai.impl.AsyncReportServiceImpl; |
||||
import com.mh.system.service.ai.impl.TaskStoreService; |
||||
import org.springframework.http.MediaType; |
||||
import org.springframework.http.ResponseEntity; |
||||
import org.springframework.web.bind.annotation.*; |
||||
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter; |
||||
|
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project EEMCS |
||||
* @description 一步报表controller |
||||
* @date 2026-02-27 11:36:57 |
||||
*/ |
||||
@RestController |
||||
@RequestMapping("/ai/reports/async") |
||||
public class AsyncReportController extends BaseController { |
||||
private final AsyncReportServiceImpl asyncReportService; |
||||
private final TaskStoreService taskStore; |
||||
|
||||
public AsyncReportController(AsyncReportServiceImpl asyncReportService, TaskStoreService taskStore) { |
||||
this.asyncReportService = asyncReportService; |
||||
this.taskStore = taskStore; |
||||
} |
||||
|
||||
@PostMapping |
||||
public ResponseEntity<Map<String, String>> submitTask(@RequestBody String userMessage) { |
||||
String taskId = asyncReportService.createAsyncTask(userMessage); |
||||
return ResponseEntity.accepted().body(Map.of("taskId", taskId)); |
||||
} |
||||
|
||||
@GetMapping(value = "/{taskId}/subscribe", produces = MediaType.TEXT_EVENT_STREAM_VALUE) |
||||
public SseEmitter subscribe(@PathVariable String taskId) { |
||||
return asyncReportService.registerEmitter(taskId); |
||||
} |
||||
|
||||
@GetMapping("/{taskId}") |
||||
public ResponseEntity<AsyncTaskDTO> getTask(@PathVariable String taskId) { |
||||
AsyncTaskDTO task = taskStore.get(taskId); |
||||
return task != null ? ResponseEntity.ok(task) : ResponseEntity.notFound().build(); |
||||
} |
||||
} |
||||
@ -1,55 +0,0 @@
|
||||
package com.mh.web.controller.comprehensive; |
||||
|
||||
import com.mh.common.core.controller.BaseController; |
||||
import com.mh.common.core.domain.vo.EnergyQueryVO; |
||||
import com.mh.common.core.page.TableDataInfo; |
||||
import com.mh.system.service.report.IComprehensiveReportService; |
||||
import org.springframework.web.bind.annotation.*; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @Classname CompreReportController |
||||
* Todo: 综合报表 |
||||
* @Date 2025-10-05 13:59 |
||||
* @Created by LJF |
||||
*/ |
||||
@RestController |
||||
@RequestMapping("/compre") |
||||
public class CompreReportController extends BaseController { |
||||
|
||||
private final IComprehensiveReportService proOverviewService; |
||||
|
||||
public CompreReportController(IComprehensiveReportService proOverviewService) { |
||||
this.proOverviewService = proOverviewService; |
||||
} |
||||
|
||||
@PostMapping("/report") |
||||
public TableDataInfo report(@RequestBody EnergyQueryVO vo) { |
||||
TableDataInfo dataTable = getDataTable(proOverviewService.report(vo)); |
||||
// 优化分页逻辑,防止出现数组越界异常
|
||||
List<?> rows = dataTable.getRows(); |
||||
int total = rows.size(); |
||||
// 如果 pageNum 小于等于0,则返回全部
|
||||
if (vo.getPageNum() <= 0) { |
||||
return dataTable; |
||||
} |
||||
int pageNum = vo.getPageNum() <= 0 ? 1 : vo.getPageNum(); |
||||
int pageSize = vo.getPageSize() <= 0 ? 10 : vo.getPageSize(); |
||||
|
||||
// 计算起始索引和结束索引
|
||||
int startIndex = (pageNum - 1) * pageSize; |
||||
int endIndex = Math.min(startIndex + pageSize, total); |
||||
|
||||
// 边界检查
|
||||
if (startIndex >= total || startIndex < 0) { |
||||
dataTable.setRows(List.of()); // 返回空列表而不是抛出异常
|
||||
} else { |
||||
dataTable.setRows(rows.subList(startIndex, endIndex)); |
||||
} |
||||
|
||||
return dataTable; |
||||
} |
||||
|
||||
|
||||
} |
||||
@ -1,109 +0,0 @@
|
||||
package com.mh.web.controller.energy; |
||||
|
||||
import com.mh.common.core.controller.BaseController; |
||||
import com.mh.common.core.domain.entity.WaterLevel; |
||||
import com.mh.common.core.domain.entity.WaterTemp; |
||||
import com.mh.common.core.page.TableDataInfo; |
||||
import com.mh.system.service.energy.IEnergyQueryService; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.web.bind.annotation.*; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project EEMCS |
||||
* @description 生活热水能耗分析 |
||||
* @date 2025-06-18 17:49:49 |
||||
*/ |
||||
@RestController |
||||
@RequestMapping("/hot_energy") |
||||
public class HotWaterEnergyController extends BaseController { |
||||
|
||||
private final IEnergyQueryService energyQueryService; |
||||
|
||||
public HotWaterEnergyController(IEnergyQueryService iEnergyQueryService) { |
||||
this.energyQueryService = iEnergyQueryService; |
||||
} |
||||
|
||||
@GetMapping("/query") |
||||
public TableDataInfo queryEnergy(@RequestParam(value = "buildingId", required = false) String buildingId, |
||||
@RequestParam(value = "startDate", required = false) String startDate, |
||||
@RequestParam(value = "endDate", required = false) String endDate, |
||||
@RequestParam(value = "type") int type) { |
||||
startPage(); |
||||
List<?> result = energyQueryService.queryEnergyDataList(buildingId, startDate, endDate, type); |
||||
return getDataTable(result); |
||||
} |
||||
|
||||
//查询日月年用量汇总
|
||||
@GetMapping(value = "/energySum") |
||||
public TableDataInfo queryEnergySum(@RequestParam(value = "buildingId", required = false) String buildingId, |
||||
@RequestParam(value = "curDate", required = false) String curDate, |
||||
@RequestParam(value = "type", required = true) Integer type) { |
||||
startPage(); |
||||
List<?> result = energyQueryService.queryEnergyDataSumList(buildingId, curDate, type); |
||||
return getDataTable(result); |
||||
} |
||||
|
||||
/** |
||||
* 温度变化表 |
||||
* |
||||
* @param buildingId |
||||
* @param curDate |
||||
* @return |
||||
*/ |
||||
@GetMapping("/waterTemp") |
||||
public TableDataInfo queryWaterTemp(@RequestParam(value = "buildingId", required = false) String buildingId, |
||||
@RequestParam(value = "curDate", required = false) String curDate) { |
||||
startPage(); |
||||
List<WaterTemp> result = energyQueryService.queryWaterTemp(buildingId, curDate); |
||||
return getDataTable(result); |
||||
} |
||||
|
||||
/** |
||||
* 水位变化表 |
||||
* |
||||
* @param buildingId |
||||
* @param curDate |
||||
* @return |
||||
*/ |
||||
@GetMapping("/waterLevel") |
||||
public TableDataInfo queryWaterLevel(@RequestParam(value = "buildingId", required = false) String buildingId, |
||||
@RequestParam(value = "curDate", required = false) String curDate) { |
||||
startPage(); |
||||
List<WaterLevel> result = energyQueryService.queryWaterLevel(buildingId, curDate); |
||||
return getDataTable(result); |
||||
} |
||||
|
||||
@GetMapping("/queryDeviceDatas") |
||||
public TableDataInfo queryDeviceDatas(@RequestParam(value = "buildingId", required = false) String buildingId, |
||||
@RequestParam(value = "startDate", required = false) String startDate, |
||||
@RequestParam(value = "endDate", required = false) String endDate, |
||||
@RequestParam(value = "deviceType", required = false) String deviceType) { |
||||
startPage(); |
||||
List<?> result = energyQueryService.queryDeviceDatas(buildingId, startDate, endDate, deviceType); |
||||
return getDataTable(result); |
||||
} |
||||
|
||||
@GetMapping("/analysis/queryYear") //type=1(水),2(电),3(能耗),4(维保)
|
||||
public TableDataInfo queryAnalysisYear(@RequestParam(value = "curDate",required = true) String curDate, |
||||
@RequestParam(value = "buildingId",required = true) String buildingId, |
||||
@RequestParam(value = "type",defaultValue = "3") int type) { |
||||
startPage(); |
||||
List<?> result = energyQueryService.queryAnalysisYear(curDate, buildingId, type); |
||||
return getDataTable(result); |
||||
|
||||
} |
||||
|
||||
@GetMapping("/analysis/queryMonth") //type=1(水),2(电),3(能耗),4(维保),5(使用时间)
|
||||
public TableDataInfo queryAnalysisMonth(@RequestParam(value = "curDate",required = true) String curDate, |
||||
@RequestParam(value = "buildingId",required = true) String buildingId, |
||||
@RequestParam(value = "type",defaultValue = "3") int type) { |
||||
startPage(); |
||||
List<?> result = energyQueryService.queryAnalysisMonth(curDate, buildingId, type); |
||||
return getDataTable(result); |
||||
} |
||||
|
||||
} |
||||
@ -1,45 +0,0 @@
|
||||
package com.mh.web.controller.monitor; |
||||
|
||||
import com.mh.common.core.controller.BaseController; |
||||
import com.mh.common.core.domain.dto.DeviceMonitorDTO; |
||||
import com.mh.common.core.page.TableDataInfo; |
||||
import com.mh.system.service.device.ICollectionParamsManageService; |
||||
import jakarta.annotation.Resource; |
||||
import org.springframework.security.access.prepost.PreAuthorize; |
||||
import org.springframework.web.bind.annotation.GetMapping; |
||||
import org.springframework.web.bind.annotation.RequestMapping; |
||||
import org.springframework.web.bind.annotation.RequestParam; |
||||
import org.springframework.web.bind.annotation.RestController; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project EEMCS |
||||
* @description 热回收系统工业流程图 |
||||
* @date 2026-01-28 13:48:13 |
||||
*/ |
||||
@RestController |
||||
@RequestMapping("/device/ers") |
||||
public class ERSMonitorController extends BaseController { |
||||
|
||||
@Resource |
||||
private ICollectionParamsManageService iCollectionParamsManageService; |
||||
|
||||
@PreAuthorize("@ss.hasPermi('device:cpm:list')") |
||||
@GetMapping("/monitor/list") |
||||
public TableDataInfo list(@RequestParam(name = "systemType") String systemType) |
||||
{ |
||||
List<DeviceMonitorDTO> list = iCollectionParamsManageService.selectMonitorListBySystemType(systemType); |
||||
return getDataTable(list); |
||||
} |
||||
|
||||
@GetMapping("/monitor/totalDatas") |
||||
public TableDataInfo totalERSDatas(@RequestParam(name = "systemType") String systemType) |
||||
{ |
||||
List<?> list = iCollectionParamsManageService.totalERSDatas(systemType); |
||||
return getDataTable(list); |
||||
} |
||||
|
||||
} |
||||
@ -1,70 +0,0 @@
|
||||
package com.mh.web.controller.monitor; |
||||
|
||||
import com.mh.common.core.controller.BaseController; |
||||
import com.mh.common.core.domain.dto.DeviceMonitorDTO; |
||||
import com.mh.common.core.domain.entity.CollectionParamsManage; |
||||
import com.mh.common.core.page.TableDataInfo; |
||||
import com.mh.system.service.device.ICollectionParamsManageService; |
||||
import org.springframework.web.bind.annotation.RequestMapping; |
||||
import org.springframework.web.bind.annotation.RequestParam; |
||||
import org.springframework.web.bind.annotation.RestController; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project EEMCS |
||||
* @description 三台采暖泵的监测 |
||||
* @date 2025-09-12 09:36:33 |
||||
*/ |
||||
@RestController |
||||
@RequestMapping("/device") |
||||
public class HeatingPumpMonitorController extends BaseController { |
||||
|
||||
private final ICollectionParamsManageService collectionParamsManageService; |
||||
|
||||
public HeatingPumpMonitorController(ICollectionParamsManageService collectionParamsManageService) { |
||||
this.collectionParamsManageService = collectionParamsManageService; |
||||
} |
||||
|
||||
/** |
||||
* 获取 alarmList 列表 |
||||
* @param systemType 3 |
||||
* @param type 0:代表查询报警 |
||||
* @return |
||||
*/ |
||||
@RequestMapping("/heatPump/alarmList") |
||||
public TableDataInfo list(@RequestParam(name = "systemType") String systemType, |
||||
@RequestParam(name = "type", required = false, defaultValue = "0") String type) { |
||||
List<?> list = collectionParamsManageService.selectHeatPumpAlarmListByParams(systemType, type, "14", "5"); |
||||
return getDataTable(list); |
||||
} |
||||
|
||||
/** |
||||
* 获取 运行热泵统计 列表 |
||||
* @param systemType 3 |
||||
* @param type 0:代表查询报警 |
||||
* @return |
||||
*/ |
||||
@RequestMapping("/heatPump/online") |
||||
public TableDataInfo online(@RequestParam(name = "systemType") String systemType, |
||||
@RequestParam(name = "type", required = false, defaultValue = "0") String type) { |
||||
List<?> list = collectionParamsManageService.selectHeatPumpOnlineByParams(systemType, type); |
||||
return getDataTable(list); |
||||
} |
||||
|
||||
/** |
||||
* 获取 采暖泵 列表 |
||||
* @param systemType 3 |
||||
* @param type 0:代表查询动画界面数据 |
||||
* @return |
||||
*/ |
||||
@RequestMapping("/heatPump/list") |
||||
public TableDataInfo heatPumpList(@RequestParam(name = "systemType") String systemType, |
||||
@RequestParam(name = "type", required = false, defaultValue = "0") String type) { |
||||
List<DeviceMonitorDTO> list = collectionParamsManageService.selectHotWaterBoilerListByParams(systemType, type, "14"); |
||||
return getDataTable(list); |
||||
} |
||||
|
||||
} |
||||
@ -1,57 +0,0 @@
|
||||
package com.mh.web.controller.monitor; |
||||
|
||||
import com.mh.common.core.controller.BaseController; |
||||
import com.mh.common.core.domain.dto.DeviceMonitorDTO; |
||||
import com.mh.common.core.domain.entity.CollectionParamsManage; |
||||
import com.mh.common.core.page.TableDataInfo; |
||||
import com.mh.system.service.device.ICollectionParamsManageService; |
||||
import org.springframework.web.bind.annotation.RequestMapping; |
||||
import org.springframework.web.bind.annotation.RequestParam; |
||||
import org.springframework.web.bind.annotation.RestController; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project EEMCS |
||||
* @description 蒸汽热水锅炉监测 |
||||
* @date 2025-09-12 09:36:33 |
||||
*/ |
||||
@RestController |
||||
@RequestMapping("/device") |
||||
public class SteamBoilerMonitorController extends BaseController { |
||||
|
||||
private final ICollectionParamsManageService collectionParamsManageService; |
||||
|
||||
public SteamBoilerMonitorController(ICollectionParamsManageService collectionParamsManageService) { |
||||
this.collectionParamsManageService = collectionParamsManageService; |
||||
} |
||||
|
||||
/** |
||||
* 获取 steamBoiler 列表 |
||||
* @param systemType 3 |
||||
* @param type 0:代表查询动画界面数据,1:代表查询模拟量监测数据,2:代表查询继电器数据,3:查询端口输入数据,4:代表查询报警数据 |
||||
* @return |
||||
*/ |
||||
@RequestMapping("/steamBoiler/list") |
||||
public TableDataInfo list(@RequestParam(name = "systemType") String systemType, |
||||
@RequestParam(name = "type") String type) { |
||||
List<CollectionParamsManage> list = collectionParamsManageService.selectSteamBoilerListByParams(systemType, type); |
||||
return getDataTable(list); |
||||
} |
||||
|
||||
/** |
||||
* 获取 热水锅炉 列表 |
||||
* @param systemType 3 |
||||
* @param type 0:代表查询动画界面数据 |
||||
* @return |
||||
*/ |
||||
@RequestMapping("/hotWaterBoiler/list") |
||||
public TableDataInfo hotWaterBoilerList(@RequestParam(name = "systemType") String systemType, |
||||
@RequestParam(name = "type", required = false, defaultValue = "0") String type) { |
||||
List<DeviceMonitorDTO> list = collectionParamsManageService.selectHotWaterBoilerListByParams(systemType, type, "13"); |
||||
return getDataTable(list); |
||||
} |
||||
|
||||
} |
||||
@ -1,96 +0,0 @@
|
||||
package com.mh.web.controller.report; |
||||
|
||||
import com.alibaba.excel.EasyExcel; |
||||
import com.github.pagehelper.PageHelper; |
||||
import com.mh.common.core.controller.BaseController; |
||||
import com.mh.common.core.domain.AjaxResult; |
||||
import com.mh.common.core.domain.dto.ReportHeatingRunParamDTO; |
||||
import com.mh.common.core.domain.dto.ReportSteamRunParamDTO; |
||||
import com.mh.common.core.domain.entity.ReportHeatingRunParamHis; |
||||
import com.mh.common.core.domain.entity.ReportSteamRunParamHis; |
||||
import com.mh.common.core.page.PageDomain; |
||||
import com.mh.common.core.page.TableDataInfo; |
||||
import com.mh.common.core.page.TableSupport; |
||||
import com.mh.common.utils.file.handle.ExcelFillCellMergeHandler; |
||||
import com.mh.common.utils.file.handle.ReportSysParamHandler; |
||||
import com.mh.common.utils.file.handle.RowHeightStyleHandler; |
||||
import com.mh.common.utils.sql.SqlUtil; |
||||
import com.mh.system.service.report.IReportHeatingService; |
||||
import com.mh.system.service.report.IReportSteamService; |
||||
import jakarta.servlet.http.HttpServletResponse; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
import org.springframework.beans.BeanUtils; |
||||
import org.springframework.web.bind.annotation.*; |
||||
|
||||
import java.io.IOException; |
||||
import java.net.URLEncoder; |
||||
import java.nio.charset.StandardCharsets; |
||||
import java.util.List; |
||||
import java.util.stream.Collectors; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project eemcs |
||||
* @description 采暖系统运行参数报表 |
||||
* @date 2024-05-30 08:45:57 |
||||
*/ |
||||
@RestController |
||||
@RequestMapping("/reportHeating") |
||||
@Slf4j |
||||
public class ReportHeatingController extends BaseController { |
||||
|
||||
private final IReportHeatingService reportHeatingService; |
||||
|
||||
private ReportHeatingController(IReportHeatingService reportHeatingService) { |
||||
this.reportHeatingService = reportHeatingService; |
||||
} |
||||
|
||||
@PostMapping("/list") |
||||
public TableDataInfo list(@RequestBody ReportHeatingRunParamHis reportHeatingRunParamHis) { |
||||
if (reportHeatingRunParamHis.getPageNum() != 0) { |
||||
PageHelper.startPage(reportHeatingRunParamHis.getPageNum(), reportHeatingRunParamHis.getPageSize()); |
||||
} |
||||
List<ReportHeatingRunParamHis> list = reportHeatingService.selectHeatingList(reportHeatingRunParamHis); |
||||
return getDataTable(list); |
||||
} |
||||
|
||||
@PutMapping("/edit") |
||||
public AjaxResult edit(@RequestBody ReportHeatingRunParamHis reportHeatingRunParamHis) { |
||||
return toAjax(reportHeatingService.updateRunParams(reportHeatingRunParamHis)); |
||||
} |
||||
|
||||
@PostMapping("/export") |
||||
public void exportExcel(@RequestBody ReportHeatingRunParamHis reportSteamRunParamHis, HttpServletResponse response) { |
||||
// 文件名
|
||||
try { |
||||
String fileName = "采暖系统运行记录表.xlsx"; |
||||
String headTitle = "采暖系统运行记录表"; |
||||
// 从数据库获取数据
|
||||
List<ReportHeatingRunParamHis> list = reportHeatingService.selectHeatingList(reportSteamRunParamHis); |
||||
if (list != null) { |
||||
// 设置响应格式
|
||||
response.setContentType("application/vdn.ms-excel;charset=utf-8"); |
||||
response.setHeader("Content-Disposition", "attachment; filename=\"" + URLEncoder.encode(fileName, StandardCharsets.UTF_8) + "\""); |
||||
response.setCharacterEncoding(String.valueOf(StandardCharsets.UTF_8)); |
||||
ExcelFillCellMergeHandler mergePrevCol = new ExcelFillCellMergeHandler(); |
||||
List<ReportHeatingRunParamDTO> infoDTOS = list.stream().map(info -> { |
||||
ReportHeatingRunParamDTO deviceInfoDTO = new ReportHeatingRunParamDTO(); |
||||
BeanUtils.copyProperties(info, deviceInfoDTO); |
||||
return deviceInfoDTO; |
||||
}).collect(Collectors.toList()); |
||||
|
||||
// 内容格式
|
||||
EasyExcel.write(response.getOutputStream(), ReportHeatingRunParamDTO.class) |
||||
.registerWriteHandler(new ReportSysParamHandler(headTitle)) |
||||
.registerWriteHandler(mergePrevCol) |
||||
.registerWriteHandler(new RowHeightStyleHandler()) |
||||
.sheet(fileName.replace(".xlsx", "")) |
||||
.doWrite(infoDTOS); |
||||
} |
||||
} catch (IOException e) { |
||||
throw new RuntimeException("下载报表异常"); |
||||
} |
||||
} |
||||
|
||||
} |
||||
@ -1,144 +0,0 @@
|
||||
package com.mh.web.controller.report; |
||||
|
||||
import com.alibaba.excel.EasyExcel; |
||||
import com.github.pagehelper.PageHelper; |
||||
import com.mh.common.core.controller.BaseController; |
||||
import com.mh.common.core.domain.AjaxResult; |
||||
import com.mh.common.core.domain.dto.BFloorReportHotWaterDTO; |
||||
import com.mh.common.core.domain.dto.ThreeFloorReportHotWaterDTO; |
||||
import com.mh.common.core.domain.entity.ReportHotWaterParamHis; |
||||
import com.mh.common.core.domain.entity.ReportSysRunParamHis; |
||||
import com.mh.common.core.page.TableDataInfo; |
||||
import com.mh.common.utils.StringUtils; |
||||
import com.mh.common.utils.file.handle.ExcelFillCellMergeHandler; |
||||
import com.mh.common.utils.file.handle.ReportSysParamHandler; |
||||
import com.mh.common.utils.file.handle.RowHeightStyleHandler; |
||||
import com.mh.system.service.report.IReportHotWaterService; |
||||
import jakarta.servlet.http.HttpServletResponse; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
import org.springframework.beans.BeanUtils; |
||||
import org.springframework.web.bind.annotation.*; |
||||
|
||||
import java.io.IOException; |
||||
import java.net.URLEncoder; |
||||
import java.util.List; |
||||
import java.util.stream.Collectors; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project NewZhujiang_Server |
||||
* @description 热泵系统运行参数报表 |
||||
* @date 2024-05-30 08:45:57 |
||||
*/ |
||||
@RestController |
||||
@RequestMapping("/reportHotWater") |
||||
@Slf4j |
||||
public class ReportHotWaterController extends BaseController { |
||||
|
||||
private final IReportHotWaterService reportHotWaterService; |
||||
|
||||
private ReportHotWaterController(IReportHotWaterService reportHotWaterService) { |
||||
this.reportHotWaterService = reportHotWaterService; |
||||
} |
||||
|
||||
@PostMapping("/list") |
||||
public TableDataInfo list(@RequestBody ReportHotWaterParamHis reportHotWaterParamHis) |
||||
{ |
||||
if (reportHotWaterParamHis.getPageNum() != 0) { |
||||
PageHelper.startPage(reportHotWaterParamHis.getPageNum(), reportHotWaterParamHis.getPageSize()); |
||||
} |
||||
List<ReportHotWaterParamHis> list = reportHotWaterService.selectList(reportHotWaterParamHis); |
||||
return getDataTable(list); |
||||
} |
||||
|
||||
@PutMapping("/edit") |
||||
public AjaxResult edit(@RequestBody ReportHotWaterParamHis reportHotWaterParamHis) |
||||
{ |
||||
return toAjax(reportHotWaterService.updateRunParams(reportHotWaterParamHis)); |
||||
} |
||||
|
||||
@PostMapping("/export") |
||||
public void exportExcel(@RequestBody ReportHotWaterParamHis reportHotWaterParamHis, HttpServletResponse response) { |
||||
// 文件名
|
||||
try { |
||||
String fileName = "热水热泵运行记录表.xlsx"; |
||||
String floorId = reportHotWaterParamHis.getFloorId(); |
||||
String headTitle = "热水热泵运行记录表"; |
||||
if (!StringUtils.isBlank(floorId)) { |
||||
if (floorId.contains("-1楼")) { |
||||
fileName = "-1楼热水热泵运行记录表.xlsx"; |
||||
headTitle = "-1楼热水热泵运行记录表"; |
||||
} else { |
||||
fileName = "3楼热水热泵运行记录表.xlsx"; |
||||
headTitle = "3楼热水热泵运行记录表"; |
||||
} |
||||
} |
||||
// 从数据库获取数据
|
||||
List<ReportHotWaterParamHis> list = reportHotWaterService.selectList(reportHotWaterParamHis); |
||||
if (list != null) { |
||||
// 设置响应格式
|
||||
response.setContentType("application/vdn.ms-excel;charset=utf-8"); |
||||
response.setHeader("Content-Disposition", "attachment; filename=\"" + URLEncoder.encode(fileName, "UTF-8") + "\""); |
||||
response.setCharacterEncoding("UTF-8"); |
||||
ExcelFillCellMergeHandler mergePrevCol = new ExcelFillCellMergeHandler(); |
||||
int headSize = 3; |
||||
if (floorId.contains("-1楼")) { |
||||
List<BFloorReportHotWaterDTO> infoDTOS = list.stream().map(info -> { |
||||
BFloorReportHotWaterDTO deviceInfoDTO = new BFloorReportHotWaterDTO(); |
||||
BeanUtils.copyProperties(info, deviceInfoDTO); |
||||
// 单独处理启停和运行状态
|
||||
deviceInfoDTO.setStatusRunHotPumpOneStr(info.getStatusRunHotPumpOne() == 1 ? "运行" : "不运行"); |
||||
deviceInfoDTO.setStatusSwitchHotPumpOneStr(info.getStatusSwitchHotPumpOne() == 1 ? "开机" : "关机"); |
||||
deviceInfoDTO.setStatusRunHotPumpTwoStr(info.getStatusRunHotPumpTwo() == 1 ? "运行" : "不运行"); |
||||
deviceInfoDTO.setStatusSwitchHotPumpTwoStr(info.getStatusSwitchHotPumpTwo() == 1 ? "开机" : "关机"); |
||||
deviceInfoDTO.setStatusRunSupplyPumpOneStr(info.getStatusRunSupplyPumpOne() == 1 ? "运行" : "不运行"); |
||||
deviceInfoDTO.setStatusRunSupplyPumpTwoStr(info.getStatusRunSupplyPumpTwo() == 1 ? "运行" : "不运行"); |
||||
deviceInfoDTO.setStatusRunSupplyPumpThreeStr(info.getStatusRunSupplyPumpThree() == 1 ? "运行" : "不运行"); |
||||
deviceInfoDTO.setStatusRunSupplyPumpFourStr(info.getStatusRunSupplyPumpFour() == 1 ? "运行" : "不运行"); |
||||
return deviceInfoDTO; |
||||
}).collect(Collectors.toList()); |
||||
|
||||
// 内容格式
|
||||
EasyExcel.write(response.getOutputStream(), BFloorReportHotWaterDTO.class) |
||||
.registerWriteHandler(new ReportSysParamHandler(headTitle)) |
||||
.registerWriteHandler(mergePrevCol) |
||||
.registerWriteHandler(new RowHeightStyleHandler()) |
||||
.sheet(fileName.replace(".xlsx", "")) |
||||
.doWrite(infoDTOS); |
||||
} else { |
||||
List<ThreeFloorReportHotWaterDTO> infoDTOS = list.stream().map(info -> { |
||||
ThreeFloorReportHotWaterDTO deviceInfoDTO = new ThreeFloorReportHotWaterDTO(); |
||||
BeanUtils.copyProperties(info, deviceInfoDTO); |
||||
// 单独处理启停和运行状态
|
||||
deviceInfoDTO.setStatusRunHotPumpOneStr(info.getStatusRunHotPumpOne() == 1 ? "运行" : "不运行"); |
||||
deviceInfoDTO.setStatusSwitchHotPumpOneStr(info.getStatusSwitchHotPumpOne() == 1 ? "开机" : "关机"); |
||||
deviceInfoDTO.setStatusRunHotPumpTwoStr(info.getStatusRunHotPumpTwo() == 1 ? "运行" : "不运行"); |
||||
deviceInfoDTO.setStatusSwitchHotPumpTwoStr(info.getStatusSwitchHotPumpTwo() == 1 ? "开机" : "关机"); |
||||
deviceInfoDTO.setStatusRunHotPumpThreeStr(info.getStatusRunHotPumpThree() == 1 ? "运行" : "不运行"); |
||||
deviceInfoDTO.setStatusSwitchHotPumpThreeStr(info.getStatusSwitchHotPumpThree() == 1 ? "开机" : "关机"); |
||||
deviceInfoDTO.setStatusRunHotPumpFourStr(info.getStatusRunHotPumpFour() == 1 ? "运行" : "不运行"); |
||||
deviceInfoDTO.setStatusSwitchHotPumpFourStr(info.getStatusSwitchHotPumpFour() == 1 ? "开机" : "关机"); |
||||
deviceInfoDTO.setStatusRunSupplyPumpOneStr(info.getStatusRunSupplyPumpOne() == 1 ? "运行" : "不运行"); |
||||
deviceInfoDTO.setStatusRunSupplyPumpTwoStr(info.getStatusRunSupplyPumpTwo() == 1 ? "运行" : "不运行"); |
||||
deviceInfoDTO.setStatusRunSupplyPumpThreeStr(info.getStatusRunSupplyPumpThree() == 1 ? "运行" : "不运行"); |
||||
deviceInfoDTO.setStatusRunSupplyPumpFourStr(info.getStatusRunSupplyPumpFour() == 1 ? "运行" : "不运行"); |
||||
return deviceInfoDTO; |
||||
}).collect(Collectors.toList()); |
||||
|
||||
// 内容格式
|
||||
EasyExcel.write(response.getOutputStream(), ThreeFloorReportHotWaterDTO.class) |
||||
.registerWriteHandler(new ReportSysParamHandler(headTitle)) |
||||
.registerWriteHandler(mergePrevCol) |
||||
.registerWriteHandler(new RowHeightStyleHandler()) |
||||
.sheet(fileName.replace(".xlsx", "")) |
||||
.doWrite(infoDTOS); |
||||
} |
||||
|
||||
} |
||||
} catch (IOException e) { |
||||
throw new RuntimeException("下载报表异常"); |
||||
} |
||||
} |
||||
|
||||
} |
||||
@ -1,131 +0,0 @@
|
||||
package com.mh.web.controller.report; |
||||
|
||||
import com.alibaba.excel.EasyExcel; |
||||
import com.alibaba.excel.ExcelWriter; |
||||
import com.alibaba.excel.write.metadata.WriteSheet; |
||||
import com.alibaba.excel.write.metadata.fill.FillWrapper; |
||||
import com.mh.common.core.controller.BaseController; |
||||
import com.mh.common.core.domain.dto.WeatherDataDTO; |
||||
import com.mh.common.core.domain.entity.ReportMeterReadingsHis; |
||||
import com.mh.common.core.page.TableDataInfo; |
||||
import com.mh.common.utils.DateUtils; |
||||
import com.mh.system.service.device.ICoolingSystemMonitorService; |
||||
import com.mh.system.service.report.IMeterReadingsHisService; |
||||
import jakarta.servlet.http.HttpServletResponse; |
||||
import org.apache.poi.ss.usermodel.*; |
||||
import org.springframework.core.io.ClassPathResource; |
||||
import org.springframework.web.bind.annotation.*; |
||||
|
||||
import java.io.ByteArrayOutputStream; |
||||
import java.io.File; |
||||
import java.io.IOException; |
||||
import java.io.InputStream; |
||||
import java.net.URLEncoder; |
||||
import java.util.Date; |
||||
import java.util.HashMap; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project EEMCS |
||||
* @description 每日抄表记录查询 |
||||
* @date 2025-10-21 16:04:09 |
||||
*/ |
||||
@RestController |
||||
@RequestMapping("/reportMeterReadings") |
||||
public class ReportMeterReadingsController extends BaseController { |
||||
|
||||
private final IMeterReadingsHisService meterReadingsHisService; |
||||
|
||||
private final ICoolingSystemMonitorService coolingSystemMonitorService; |
||||
|
||||
public ReportMeterReadingsController(IMeterReadingsHisService meterReadingsHisService, ICoolingSystemMonitorService coolingSystemMonitorService) { |
||||
this.meterReadingsHisService = meterReadingsHisService; |
||||
this.coolingSystemMonitorService = coolingSystemMonitorService; |
||||
} |
||||
|
||||
@PostMapping("/list") |
||||
public TableDataInfo list(@RequestBody ReportMeterReadingsHis todayTimestamp) |
||||
{ |
||||
List<ReportMeterReadingsHis> list = meterReadingsHisService.selectList(todayTimestamp); |
||||
return getDataTable(list); |
||||
} |
||||
|
||||
@PostMapping("/export") |
||||
public void exportExcel(@RequestBody ReportMeterReadingsHis reportMeterReadingsHis, HttpServletResponse response) { |
||||
// 文件名
|
||||
try { |
||||
String fileName = "节能岛改造每日能耗统计表"+ DateUtils.dateToString(reportMeterReadingsHis.getTodayTimestamp(), "yyyyMMdd")+".xlsx"; |
||||
// 读取资源文件
|
||||
ClassPathResource classPathResource = new ClassPathResource(File.separator + "节能岛改造每日能耗统计表.xlsx"); |
||||
// 获取数据
|
||||
List<ReportMeterReadingsHis> list = meterReadingsHisService.selectList(reportMeterReadingsHis); |
||||
// 组织并填充模板数据
|
||||
ByteArrayOutputStream byteArrayOutputStream = compositeFill(classPathResource.getInputStream(), reportMeterReadingsHis.getTodayTimestamp(), list); |
||||
|
||||
// 设置响应格式
|
||||
response.setContentType("application/vdn.ms-excel;charset=utf-8"); |
||||
response.setHeader("Content-Disposition", "attachment; filename=\"" + URLEncoder.encode(fileName, "UTF-8") + "\""); |
||||
response.setCharacterEncoding("UTF-8"); |
||||
|
||||
// 将文件内容写入响应输出流,浏览器可以直接触发下载
|
||||
response.getOutputStream().write(byteArrayOutputStream.toByteArray()); |
||||
response.getOutputStream().flush(); |
||||
} catch (IOException e) { |
||||
throw new RuntimeException("下载报表异常"); |
||||
} |
||||
} |
||||
|
||||
private ByteArrayOutputStream compositeFill(InputStream templateInputStream, Date todayTimestamp, List<ReportMeterReadingsHis> list) throws IOException { |
||||
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); |
||||
// 使用EasyExcel的模板填充功能,在这里指定合并单元格,这里应该是easyExcel的bug,第一列无法合并,其他列都可以,所以第一列单独用原生poi进行合并
|
||||
try (ExcelWriter excelWriter = EasyExcel.write(byteArrayOutputStream).withTemplate(templateInputStream) |
||||
.build()) { |
||||
WriteSheet writeSheet = EasyExcel.writerSheet().build(); |
||||
// 防止上面两个表格覆盖下面两个表格,每一行都采用新增一行的方式
|
||||
// FillConfig fillConfig = FillConfig.builder().forceNewRow(Boolean.TRUE).build();
|
||||
// 使用模板填充,必须使用FillWrapper,这是官方要求,并且每行两个表格只能有一个表格设置增行,否则会存在一个表格有空行,这里是造的测试数据
|
||||
for (int i = 0; i < list.size(); i++) { |
||||
excelWriter.fill(new FillWrapper("data"+(i+1), List.of(list.get(i))), writeSheet); |
||||
} |
||||
|
||||
// 设置表格外的填充数据,例如总计、日期等数据
|
||||
HashMap<String, Object> map = new HashMap<>(); |
||||
|
||||
List<WeatherDataDTO> weatherTemp = (List<WeatherDataDTO>) coolingSystemMonitorService.getWeatherTemp(DateUtils.dateToString(todayTimestamp, "yyyy-MM-dd"), DateUtils.dateToString(todayTimestamp, "yyyy-MM-dd")); |
||||
if (!weatherTemp.isEmpty()) { |
||||
String maxTemp = weatherTemp.getFirst().getMaxTemp(); |
||||
map.put("maxTemp", maxTemp); |
||||
String minTemp = weatherTemp.getFirst().getMinTemp(); |
||||
map.put("minTemp", minTemp); |
||||
} |
||||
|
||||
map.put("date", DateUtils.dateToString(todayTimestamp, "yyyy年MM月dd日")); |
||||
excelWriter.fill(map, writeSheet); |
||||
|
||||
// 2. 获取 Workbook 并计算公式
|
||||
Workbook workbook = excelWriter.writeContext() |
||||
.writeWorkbookHolder() |
||||
.getWorkbook(); |
||||
FormulaEvaluator evaluator = workbook.getCreationHelper().createFormulaEvaluator(); |
||||
for (Row row : workbook.getSheetAt(0)) { |
||||
for (Cell cell : row) { |
||||
if (cell.getCellType() == CellType.FORMULA) { |
||||
evaluator.evaluateFormulaCell(cell); // 单元格级计算
|
||||
// evaluator.evaluateAll(); // 全工作簿计算(推荐)
|
||||
} |
||||
} |
||||
} |
||||
|
||||
// 3. 强制刷新计算结果
|
||||
workbook.setForceFormulaRecalculation(true); |
||||
excelWriter.finish(); |
||||
|
||||
} |
||||
|
||||
// 合并单元格,由于easyExcel自带的OnceAbsoluteMergeStrategy合并策略bug,这里需要用poi合并一下
|
||||
return byteArrayOutputStream; |
||||
} |
||||
|
||||
} |
||||
@ -1,156 +0,0 @@
|
||||
package com.mh.web.controller.report; |
||||
|
||||
import com.alibaba.excel.EasyExcel; |
||||
import com.github.pagehelper.PageHelper; |
||||
import com.mh.common.core.controller.BaseController; |
||||
import com.mh.common.core.domain.AjaxResult; |
||||
import com.mh.common.core.domain.dto.ReportSteamRunParamDTO; |
||||
import com.mh.common.core.domain.dto.ThreeFloorReportHotWaterDTO; |
||||
import com.mh.common.core.domain.entity.ReportSteamRunParamHis; |
||||
import com.mh.common.core.page.TableDataInfo; |
||||
import com.mh.common.utils.file.handle.ExcelFillCellMergeHandler; |
||||
import com.mh.common.utils.file.handle.ReportSysParamHandler; |
||||
import com.mh.common.utils.file.handle.RowHeightStyleHandler; |
||||
import com.mh.system.service.report.IReportSteamService; |
||||
import jakarta.servlet.http.HttpServletResponse; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
import org.springframework.beans.BeanUtils; |
||||
import org.springframework.web.bind.annotation.*; |
||||
|
||||
import java.io.IOException; |
||||
import java.net.URLEncoder; |
||||
import java.util.List; |
||||
import java.util.stream.Collectors; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project eemcs |
||||
* @description 蒸汽系统运行参数报表 |
||||
* @date 2024-05-30 08:45:57 |
||||
*/ |
||||
@RestController |
||||
@RequestMapping("/reportSteam") |
||||
@Slf4j |
||||
public class ReportSteamController extends BaseController { |
||||
|
||||
private final IReportSteamService reportSteamService; |
||||
|
||||
private ReportSteamController(IReportSteamService reportSteamService) { |
||||
this.reportSteamService = reportSteamService; |
||||
} |
||||
|
||||
@PostMapping("/list") |
||||
public TableDataInfo list(@RequestBody ReportSteamRunParamHis reportSteamRunParamHis) { |
||||
if (reportSteamRunParamHis.getPageNum() != 0) { |
||||
PageHelper.startPage(reportSteamRunParamHis.getPageNum(), reportSteamRunParamHis.getPageSize()); |
||||
} |
||||
List<ReportSteamRunParamHis> list = reportSteamService.selectList(reportSteamRunParamHis); |
||||
return getDataTable(list); |
||||
} |
||||
|
||||
@PutMapping("/edit") |
||||
public AjaxResult edit(@RequestBody ReportSteamRunParamHis reportSteamRunParamHis) { |
||||
return toAjax(reportSteamService.updateRunParams(reportSteamRunParamHis)); |
||||
} |
||||
|
||||
@PostMapping("/export") |
||||
public void exportExcel(@RequestBody ReportSteamRunParamHis reportSteamRunParamHis, HttpServletResponse response) { |
||||
// 文件名
|
||||
try { |
||||
String fileName = "蒸汽机运行记录表.xlsx"; |
||||
String headTitle = "蒸汽机运行记录表"; |
||||
// 从数据库获取数据
|
||||
List<ReportSteamRunParamHis> list = reportSteamService.selectList(reportSteamRunParamHis); |
||||
if (list != null) { |
||||
// 设置响应格式
|
||||
response.setContentType("application/vdn.ms-excel;charset=utf-8"); |
||||
response.setHeader("Content-Disposition", "attachment; filename=\"" + URLEncoder.encode(fileName, "UTF-8") + "\""); |
||||
response.setCharacterEncoding("UTF-8"); |
||||
ExcelFillCellMergeHandler mergePrevCol = new ExcelFillCellMergeHandler(); |
||||
List<ReportSteamRunParamDTO> infoDTOS = list.stream().map(info -> { |
||||
ReportSteamRunParamDTO deviceInfoDTO = new ReportSteamRunParamDTO(); |
||||
BeanUtils.copyProperties(info, deviceInfoDTO); |
||||
// 单独处理运行状态
|
||||
// 0:上电延时
|
||||
// 1:关机
|
||||
// 2:待机
|
||||
// 3:前清扫
|
||||
// 4:预点火
|
||||
// 5:点火
|
||||
// 6:传火
|
||||
// 7:工作
|
||||
// 8:后清扫
|
||||
// 9:故障
|
||||
// 10:小火保持
|
||||
// 11:自检
|
||||
// 12:检漏
|
||||
// 13:开点火器
|
||||
// 14:启动等待中
|
||||
switch (info.getCurStatus()) { |
||||
case 0: |
||||
deviceInfoDTO.setCurStatus("上电延时"); |
||||
break; |
||||
case 1: |
||||
deviceInfoDTO.setCurStatus("关机"); |
||||
break; |
||||
case 2: |
||||
deviceInfoDTO.setCurStatus("待机"); |
||||
break; |
||||
case 3: |
||||
deviceInfoDTO.setCurStatus("前清扫"); |
||||
break; |
||||
case 4: |
||||
deviceInfoDTO.setCurStatus("预点火"); |
||||
break; |
||||
case 5: |
||||
deviceInfoDTO.setCurStatus("点火"); |
||||
break; |
||||
case 6: |
||||
deviceInfoDTO.setCurStatus("传火"); |
||||
break; |
||||
case 7: |
||||
deviceInfoDTO.setCurStatus("工作"); |
||||
break; |
||||
case 8: |
||||
deviceInfoDTO.setCurStatus("后清扫"); |
||||
break; |
||||
case 9: |
||||
deviceInfoDTO.setCurStatus("故障"); |
||||
break; |
||||
case 10: |
||||
deviceInfoDTO.setCurStatus("小火保持"); |
||||
break; |
||||
case 11: |
||||
deviceInfoDTO.setCurStatus("自检"); |
||||
break; |
||||
case 12: |
||||
deviceInfoDTO.setCurStatus("检漏"); |
||||
break; |
||||
case 13: |
||||
deviceInfoDTO.setCurStatus("开点火器"); |
||||
break; |
||||
case 14: |
||||
deviceInfoDTO.setCurStatus("启动等待中"); |
||||
break; |
||||
default: |
||||
deviceInfoDTO.setCurStatus("未知"); |
||||
break; |
||||
} |
||||
return deviceInfoDTO; |
||||
}).collect(Collectors.toList()); |
||||
|
||||
// 内容格式
|
||||
EasyExcel.write(response.getOutputStream(), ReportSteamRunParamDTO.class) |
||||
.registerWriteHandler(new ReportSysParamHandler(headTitle)) |
||||
.registerWriteHandler(mergePrevCol) |
||||
.registerWriteHandler(new RowHeightStyleHandler()) |
||||
.sheet(fileName.replace(".xlsx", "")) |
||||
.doWrite(infoDTOS); |
||||
} |
||||
} catch (IOException e) { |
||||
throw new RuntimeException("下载报表异常"); |
||||
} |
||||
} |
||||
|
||||
} |
||||
@ -1,100 +0,0 @@
|
||||
package com.mh.web.controller.report; |
||||
|
||||
import com.alibaba.excel.EasyExcel; |
||||
import com.github.pagehelper.PageHelper; |
||||
import com.mh.common.core.controller.BaseController; |
||||
import com.mh.common.core.domain.AjaxResult; |
||||
import com.mh.common.core.domain.dto.MaglevReportSysParamDTO; |
||||
import com.mh.common.core.domain.entity.ReportSysRunParamHis; |
||||
import com.mh.common.core.page.TableDataInfo; |
||||
import com.mh.common.utils.StringUtils; |
||||
import com.mh.common.utils.file.handle.ExcelFillCellMergeHandler; |
||||
import com.mh.common.utils.file.handle.ReportSysParamHandler; |
||||
import com.mh.common.utils.file.handle.RowHeightStyleHandler; |
||||
import com.mh.system.service.report.IReportSysService; |
||||
import jakarta.servlet.http.HttpServletResponse; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
import org.springframework.beans.BeanUtils; |
||||
import org.springframework.web.bind.annotation.*; |
||||
|
||||
import java.io.IOException; |
||||
import java.net.URLEncoder; |
||||
import java.util.List; |
||||
import java.util.stream.Collectors; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project NewZhujiang_Server |
||||
* @description 系统参数报表 |
||||
* @date 2024-05-30 08:45:57 |
||||
*/ |
||||
@RestController |
||||
@RequestMapping("/reportSys") |
||||
@Slf4j |
||||
public class ReportSysController extends BaseController { |
||||
|
||||
private final IReportSysService reportSysService; |
||||
|
||||
private ReportSysController(IReportSysService reportSysService) { |
||||
this.reportSysService = reportSysService; |
||||
} |
||||
|
||||
@PostMapping("/list") |
||||
public TableDataInfo list(@RequestBody ReportSysRunParamHis reportSysRunParamHis) |
||||
{ |
||||
if (reportSysRunParamHis.getPageNum() != 0) { |
||||
PageHelper.startPage(reportSysRunParamHis.getPageNum(), reportSysRunParamHis.getPageSize()); |
||||
} |
||||
List<ReportSysRunParamHis> list = reportSysService.selectList(reportSysRunParamHis); |
||||
return getDataTable(list); |
||||
} |
||||
|
||||
@PutMapping("/edit") |
||||
public AjaxResult edit(@RequestBody ReportSysRunParamHis reportSysRunParamHis) |
||||
{ |
||||
return toAjax(reportSysService.updateSysRunParams(reportSysRunParamHis)); |
||||
} |
||||
|
||||
@PostMapping("/export") |
||||
public void exportExcel(@RequestBody ReportSysRunParamHis reportSysRunParamHis, HttpServletResponse response) { |
||||
// 文件名
|
||||
try { |
||||
String fileName = "系统参数运行日志报表.xlsx"; |
||||
String deviceNum = (String) reportSysRunParamHis.getParams().get("deviceNum"); |
||||
if (!StringUtils.isBlank(deviceNum)) { |
||||
if ("2".equals(deviceNum)) { |
||||
fileName = "变频螺杆主机系统参数报表.xlsx"; |
||||
} else { |
||||
fileName = "磁悬浮主机系统参数报表.xlsx"; |
||||
} |
||||
} |
||||
// 从数据库获取数据
|
||||
List<ReportSysRunParamHis> list = reportSysService.selectList(reportSysRunParamHis); |
||||
if (list != null) { |
||||
// 设置响应格式
|
||||
response.setContentType("application/vdn.ms-excel;charset=utf-8"); |
||||
response.setHeader("Content-Disposition", "attachment; filename=\"" + URLEncoder.encode(fileName, "UTF-8") + "\""); |
||||
response.setCharacterEncoding("UTF-8"); |
||||
ExcelFillCellMergeHandler mergePrevCol = new ExcelFillCellMergeHandler(); |
||||
int headSize = 3; |
||||
List<MaglevReportSysParamDTO> infoDTOS = list.stream().map(info -> { |
||||
MaglevReportSysParamDTO deviceInfoDTO = new MaglevReportSysParamDTO(); |
||||
BeanUtils.copyProperties(info, deviceInfoDTO); |
||||
return deviceInfoDTO; |
||||
}).collect(Collectors.toList()); |
||||
|
||||
// 内容格式
|
||||
EasyExcel.write(response.getOutputStream(), MaglevReportSysParamDTO.class) |
||||
.registerWriteHandler(new ReportSysParamHandler("磁悬浮水冷冷水机组数据运行记录表")) |
||||
.registerWriteHandler(mergePrevCol) |
||||
.registerWriteHandler(new RowHeightStyleHandler()) |
||||
.sheet(fileName.replace(".xlsx", "")) |
||||
.doWrite(infoDTOS); |
||||
} |
||||
} catch (IOException e) { |
||||
throw new RuntimeException("下载报表异常"); |
||||
} |
||||
} |
||||
|
||||
} |
||||
Binary file not shown.
@ -1,35 +0,0 @@
|
||||
package com.mh.common.config; |
||||
|
||||
import org.springframework.beans.factory.annotation.Value; |
||||
import org.springframework.stereotype.Component; |
||||
import org.springframework.web.servlet.support.ServletUriComponentsBuilder; |
||||
|
||||
import java.io.IOException; |
||||
import java.nio.file.Files; |
||||
import java.nio.file.Path; |
||||
import java.nio.file.Paths; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project EEMCS |
||||
* @description 文件服务类 |
||||
* @date 2026-02-27 11:32:04 |
||||
*/ |
||||
@Component |
||||
public class FileStorageUtil { |
||||
@Value("${mh.profile:/}") |
||||
private String storageDir; |
||||
|
||||
public String saveFile(String filename, byte[] content) throws IOException { |
||||
Path dir = Paths.get(storageDir); |
||||
if (!Files.exists(dir)) Files.createDirectories(dir); |
||||
Path filePath = dir.resolve(filename); |
||||
Files.write(filePath, content); |
||||
// 生成可下载的URL(假设当前应用提供静态资源访问或下载接口)
|
||||
return ServletUriComponentsBuilder.fromCurrentContextPath() |
||||
.path("/ai/files/") |
||||
.path(filename) |
||||
.toUriString(); |
||||
} |
||||
} |
||||
@ -1,25 +0,0 @@
|
||||
package com.mh.common.constant; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project EEMCS |
||||
* @description |
||||
* @date 2025-06-18 16:32:56 |
||||
*/ |
||||
public enum EnergyType { |
||||
HOUR("hour"), |
||||
DAY("day"), |
||||
MONTH("month"), |
||||
YEAR("year"); |
||||
|
||||
private final String code; |
||||
|
||||
EnergyType(String code) { |
||||
this.code = code; |
||||
} |
||||
|
||||
public String getCode() { |
||||
return code; |
||||
} |
||||
} |
||||
@ -1,24 +0,0 @@
|
||||
package com.mh.common.core.domain.dto; |
||||
|
||||
import lombok.Data; |
||||
|
||||
import java.time.LocalDateTime; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project EEMCS |
||||
* @description 任务状态dto |
||||
* @date 2026-02-27 10:22:40 |
||||
*/ |
||||
@Data |
||||
public class AsyncTaskDTO { |
||||
|
||||
private String taskId; |
||||
private String status; // PROCESSING, COMPLETED, FAILED
|
||||
private String message; // 成功时的消息或失败原因
|
||||
private String downloadUrl; // 生成文件的下载URL(成功后填充)
|
||||
private LocalDateTime createTime; |
||||
private LocalDateTime completeTime; |
||||
|
||||
} |
||||
@ -1,22 +0,0 @@
|
||||
package com.mh.common.core.domain.dto; |
||||
|
||||
import lombok.AllArgsConstructor; |
||||
import lombok.Data; |
||||
import lombok.NoArgsConstructor; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project EEMCS |
||||
* @description 异步任务事件dto |
||||
* @date 2026-02-28 |
||||
*/ |
||||
@Data |
||||
@NoArgsConstructor |
||||
@AllArgsConstructor |
||||
public class AsyncTaskEvent { |
||||
|
||||
private String event; // 事件类型:reasoning, COMPLETED, FAILED
|
||||
private Object data; // 事件数据
|
||||
|
||||
} |
||||
@ -1,170 +0,0 @@
|
||||
package com.mh.common.core.domain.dto; |
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty; |
||||
import com.alibaba.excel.annotation.write.style.*; |
||||
import com.alibaba.excel.enums.poi.BorderStyleEnum; |
||||
import com.alibaba.excel.enums.poi.HorizontalAlignmentEnum; |
||||
import lombok.Data; |
||||
import lombok.NoArgsConstructor; |
||||
import lombok.experimental.Accessors; |
||||
|
||||
import java.math.BigDecimal; |
||||
|
||||
//import java.math.String;
|
||||
|
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project NewZhujiang_Server |
||||
* @description 三楼热水系统参数报表 |
||||
* @date 2024-05-30 11:00:12 |
||||
*/ |
||||
@Data |
||||
@NoArgsConstructor |
||||
@Accessors(chain = true) |
||||
@HeadRowHeight(25) |
||||
@HeadFontStyle(fontHeightInPoints = 14) |
||||
@ContentFontStyle(fontHeightInPoints = 13) |
||||
@ContentRowHeight(25) |
||||
@ContentStyle( |
||||
horizontalAlignment = HorizontalAlignmentEnum.CENTER, |
||||
borderBottom = BorderStyleEnum.THIN, |
||||
borderLeft = BorderStyleEnum.THIN, |
||||
borderRight = BorderStyleEnum.THIN, |
||||
borderTop = BorderStyleEnum.THIN |
||||
) |
||||
@ColumnWidth(10) |
||||
public class BFloorReportHotWaterDTO { |
||||
|
||||
/** |
||||
* 当前时间 |
||||
*/ |
||||
@ColumnWidth(17) |
||||
@ExcelProperty(value = {"${deviceType}", "时间", "时间"}, index = 0) |
||||
private String curTime; |
||||
|
||||
// /**
|
||||
// * 班次
|
||||
// */
|
||||
// @ColumnWidth(10)
|
||||
// @ExcelProperty(value = {"${deviceType}", "班次", "班次"}, index = 1)
|
||||
// private String classes;
|
||||
|
||||
/** |
||||
* 设定温度℃ |
||||
*/ |
||||
@ColumnWidth(10) |
||||
@ExcelProperty(value = {"${deviceType}", "1号热泵", "设定温度℃"}, index = 1) |
||||
private BigDecimal tempSetHotPumpOne; |
||||
|
||||
/** |
||||
* 实际温度℃ |
||||
*/ |
||||
@ExcelProperty(value = {"${deviceType}", "1号热泵", "实际温度℃"}, index = 2) |
||||
@ColumnWidth(10) |
||||
private BigDecimal tempRealHotPumpOne; |
||||
|
||||
/** |
||||
* 设备开关机 |
||||
*/ |
||||
@ExcelProperty(value = {"${deviceType}", "1号热泵", "设备开关机"}, index = 3) |
||||
@ColumnWidth(10) |
||||
private String statusSwitchHotPumpOneStr; |
||||
|
||||
/** |
||||
* 设备运行状态 |
||||
*/ |
||||
@ExcelProperty(value = {"${deviceType}", "1号热泵", "设备运行状态"}, index = 4) |
||||
@ColumnWidth(10) |
||||
private String statusRunHotPumpOneStr; |
||||
|
||||
/** |
||||
* 设定温度℃ |
||||
*/ |
||||
@ColumnWidth(10) |
||||
@ExcelProperty(value = {"${deviceType}", "2号热泵", "设定温度℃"}, index = 5) |
||||
private BigDecimal tempSetHotPumpTwo; |
||||
|
||||
/** |
||||
* 实际温度℃ |
||||
*/ |
||||
@ExcelProperty(value = {"${deviceType}", "2号热泵", "实际温度℃"}, index = 6) |
||||
@ColumnWidth(10) |
||||
private BigDecimal tempRealHotPumpTwo; |
||||
|
||||
/** |
||||
* 设备开关机 |
||||
*/ |
||||
@ExcelProperty(value = {"${deviceType}", "2号热泵", "设备开关机"}, index = 7) |
||||
@ColumnWidth(10) |
||||
private String statusSwitchHotPumpTwoStr; |
||||
|
||||
/** |
||||
* 设备运行状态 |
||||
*/ |
||||
@ExcelProperty(value = {"${deviceType}", "2号热泵", "设备运行状态"}, index = 8) |
||||
@ColumnWidth(10) |
||||
private String statusRunHotPumpTwoStr; |
||||
|
||||
// 高区/裙楼设定压力(bar)
|
||||
@ExcelProperty(value = {"${deviceType}", "裙楼变频泵", "设定压力bar"}, index = 9) |
||||
@ColumnWidth(10) |
||||
private BigDecimal presSetSupplyPumpAreaOne; |
||||
|
||||
// 高区/裙楼实际压力(bar)
|
||||
@ExcelProperty(value = {"${deviceType}", "裙楼变频泵", "实际压力bar"}, index = 10) |
||||
@ColumnWidth(10) |
||||
private BigDecimal presRealSupplyPumpAreaOne; |
||||
|
||||
// 高区/裙楼1号泵运行状态
|
||||
@ExcelProperty(value = {"${deviceType}", "裙楼变频泵", "1号泵运行状态"}, index = 11) |
||||
@ColumnWidth(10) |
||||
private String statusRunSupplyPumpOneStr; |
||||
|
||||
// 高区/裙楼2号泵运行状态
|
||||
@ExcelProperty(value = {"${deviceType}", "裙楼变频泵", "2号泵运行状态"}, index = 12) |
||||
@ColumnWidth(10) |
||||
private String statusRunSupplyPumpTwoStr; |
||||
|
||||
// 中区/中厨设定压力(bar)
|
||||
@ExcelProperty(value = {"${deviceType}", "中厨变频泵", "设定压力bar"}, index = 13) |
||||
@ColumnWidth(10) |
||||
private BigDecimal presSetSupplyPumpAreaTwo; |
||||
|
||||
// 中区/中厨实际压力(bar)
|
||||
@ExcelProperty(value = {"${deviceType}", "中厨变频泵", "实际压力bar"}, index = 14) |
||||
@ColumnWidth(10) |
||||
private BigDecimal presRealSupplyPumpAreaTwo; |
||||
|
||||
// 中区/中厨1号泵运行状态
|
||||
@ExcelProperty(value = {"${deviceType}", "中厨变频泵", "1号泵运行状态"}, index = 15) |
||||
@ColumnWidth(10) |
||||
private String statusRunSupplyPumpThreeStr; |
||||
|
||||
// 中区/中厨2号泵运行状态
|
||||
@ExcelProperty(value = {"${deviceType}", "中厨变频泵", "2号泵运行状态"}, index = 16) |
||||
@ColumnWidth(10) |
||||
private String statusRunSupplyPumpFourStr; |
||||
|
||||
// 高区/裙楼液位(米)
|
||||
@ExcelProperty(value = {"${deviceType}", "水箱液位", "裙楼液位%"}, index = 17) |
||||
@ColumnWidth(10) |
||||
private BigDecimal levelWaterTankOne; |
||||
|
||||
// 中区/中厨液位(米)
|
||||
@ExcelProperty(value = {"${deviceType}", "水箱液位", "中厨液位%"}, index = 18) |
||||
@ColumnWidth(10) |
||||
private BigDecimal levelWaterTankTwo; |
||||
|
||||
// 巡查记录人
|
||||
@ExcelProperty(value = {"${deviceType}", "巡查记录人", "巡查记录人"}, index = 19) |
||||
@ColumnWidth(20) |
||||
private String recorder; |
||||
|
||||
// 备注信息
|
||||
@ExcelProperty(value = {"${deviceType}", "备注", "备注"}, index = 20) |
||||
@ColumnWidth(20) |
||||
private String remark; |
||||
|
||||
} |
||||
@ -1,74 +0,0 @@
|
||||
package com.mh.common.core.domain.dto; |
||||
|
||||
import java.util.StringJoiner; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project EEMCS |
||||
* @description 综合系统能耗查询DTO |
||||
* @date 2025-10-09 10:17:26 |
||||
*/ |
||||
public class CompreReportDTO { |
||||
|
||||
private String time; |
||||
|
||||
private String electValue; |
||||
|
||||
private String coldValue; |
||||
|
||||
private String hotValue; |
||||
|
||||
private String steamValue; |
||||
|
||||
public String getTime() { |
||||
return time; |
||||
} |
||||
|
||||
public void setTime(String time) { |
||||
this.time = time; |
||||
} |
||||
|
||||
public String getElectValue() { |
||||
return electValue; |
||||
} |
||||
|
||||
public void setElectValue(String electValue) { |
||||
this.electValue = electValue; |
||||
} |
||||
|
||||
public String getColdValue() { |
||||
return coldValue; |
||||
} |
||||
|
||||
public void setColdValue(String coldValue) { |
||||
this.coldValue = coldValue; |
||||
} |
||||
|
||||
public String getHotValue() { |
||||
return hotValue; |
||||
} |
||||
|
||||
public void setHotValue(String hotValue) { |
||||
this.hotValue = hotValue; |
||||
} |
||||
|
||||
public String getSteamValue() { |
||||
return steamValue; |
||||
} |
||||
|
||||
public void setSteamValue(String steamValue) { |
||||
this.steamValue = steamValue; |
||||
} |
||||
|
||||
@Override |
||||
public String toString() { |
||||
return new StringJoiner(", ", CompreReportDTO.class.getSimpleName() + "[", "]") |
||||
.add("time='" + time + "'") |
||||
.add("electValue='" + electValue + "'") |
||||
.add("coldValue='" + coldValue + "'") |
||||
.add("hotValue='" + hotValue + "'") |
||||
.add("steamValue='" + steamValue + "'") |
||||
.toString(); |
||||
} |
||||
} |
||||
@ -1,68 +0,0 @@
|
||||
package com.mh.common.core.domain.dto; |
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
import lombok.Data; |
||||
import org.apache.commons.lang3.builder.ToStringBuilder; |
||||
|
||||
import java.math.BigDecimal; |
||||
import java.util.Date; |
||||
|
||||
@Data |
||||
public class DataResultDTO { |
||||
|
||||
private Long id; |
||||
|
||||
private String buildingId; |
||||
|
||||
private String buildingName; |
||||
|
||||
private String deviceNum; |
||||
|
||||
private String deviceName; |
||||
|
||||
private String deviceCode; |
||||
|
||||
private String deviceType; |
||||
|
||||
private BigDecimal lastValue; |
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
private Date lastTime; |
||||
|
||||
private double curValue; |
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
private Date curTime; |
||||
|
||||
private BigDecimal usedValue; |
||||
|
||||
private int ratio; |
||||
|
||||
private BigDecimal calcValue; |
||||
|
||||
private int grade; |
||||
|
||||
private String registerAddr; |
||||
|
||||
@Override |
||||
public String toString() { |
||||
return new ToStringBuilder(this) |
||||
.append("id", id) |
||||
.append("buildingId", buildingId) |
||||
.append("buildingName", buildingName) |
||||
.append("deviceNum", deviceNum) |
||||
.append("deviceName", deviceName) |
||||
.append("deviceCode", deviceCode) |
||||
.append("deviceType", deviceType) |
||||
.append("lastValue", lastValue) |
||||
.append("lastTime", lastTime) |
||||
.append("curValue", curValue) |
||||
.append("curTime", curTime) |
||||
.append("usedValue", usedValue) |
||||
.append("ratio", ratio) |
||||
.append("calcValue", calcValue) |
||||
.append("grade", grade) |
||||
.append("registerAddr", registerAddr) |
||||
.toString(); |
||||
} |
||||
} |
||||
@ -1,99 +0,0 @@
|
||||
package com.mh.common.core.domain.dto; |
||||
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyDescription; |
||||
import lombok.Builder; |
||||
import lombok.Data; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project EEMCS |
||||
* @description ai机房能效报表 |
||||
* @date 2026-02-27 10:11:57 |
||||
*/ |
||||
@Data |
||||
@Builder |
||||
public class EnergyReportDTO { |
||||
|
||||
@JsonPropertyDescription("报表生成日期") |
||||
private String reportDate; |
||||
|
||||
@JsonPropertyDescription("整体能效评分 (0-100)") |
||||
private Integer overallScore; |
||||
|
||||
@JsonPropertyDescription("系统综合能效比") |
||||
private Double systemEER; |
||||
|
||||
@JsonPropertyDescription("总能耗 (kWh)") |
||||
private Double totalEnergyConsumption; |
||||
|
||||
@JsonPropertyDescription("各设备能耗明细") |
||||
private List<DeviceEnergy> deviceDetails; |
||||
|
||||
@JsonPropertyDescription("异常情况列表") |
||||
private List<Anomaly> anomalies; |
||||
|
||||
@JsonPropertyDescription("优化建议") |
||||
private List<Suggestion> suggestions; |
||||
|
||||
@Data |
||||
@Builder |
||||
public static class DeviceEnergy { |
||||
@JsonPropertyDescription("设备名称") |
||||
private String deviceName; |
||||
|
||||
@JsonPropertyDescription("设备类型 (冷机/冷冻泵/冷却泵/冷却塔)") |
||||
private String deviceType; |
||||
|
||||
@JsonPropertyDescription("能耗 (kWh)") |
||||
private Double energyConsumption; |
||||
|
||||
@JsonPropertyDescription("运行效率 (%)") |
||||
private Double efficiency; |
||||
|
||||
@JsonPropertyDescription("对比基准的偏差率") |
||||
private Double deviationRate; |
||||
} |
||||
|
||||
@Data |
||||
@Builder |
||||
public static class Anomaly { |
||||
@JsonPropertyDescription("异常设备") |
||||
private String deviceName; |
||||
|
||||
@JsonPropertyDescription("异常类型") |
||||
private String anomalyType; |
||||
|
||||
@JsonPropertyDescription("异常描述") |
||||
private String description; |
||||
|
||||
@JsonPropertyDescription("严重程度 (高/中/低)") |
||||
private String severity; |
||||
|
||||
@JsonPropertyDescription("预估能耗损失 (kWh)") |
||||
private Double estimatedLoss; |
||||
} |
||||
|
||||
@Data |
||||
@Builder |
||||
public static class Suggestion { |
||||
@JsonPropertyDescription("建议标题") |
||||
private String title; |
||||
|
||||
@JsonPropertyDescription("建议详细内容") |
||||
private String description; |
||||
|
||||
@JsonPropertyDescription("预期节能效果 (kWh)") |
||||
private Double expectedSaving; |
||||
|
||||
@JsonPropertyDescription("优先级 (高/中/低)") |
||||
private String priority; |
||||
|
||||
@JsonPropertyDescription("建议执行的操作 (如:检查/维修/调整参数)") |
||||
private String action; |
||||
} |
||||
|
||||
|
||||
} |
||||
@ -1,284 +0,0 @@
|
||||
package com.mh.common.core.domain.dto; |
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnore; |
||||
import com.alibaba.excel.annotation.ExcelProperty; |
||||
import com.alibaba.excel.annotation.write.style.*; |
||||
import com.alibaba.excel.enums.poi.BorderStyleEnum; |
||||
import com.alibaba.excel.enums.poi.HorizontalAlignmentEnum; |
||||
import lombok.Data; |
||||
import lombok.NoArgsConstructor; |
||||
import lombok.experimental.Accessors; |
||||
|
||||
import java.math.BigDecimal; |
||||
|
||||
//import java.math.String;
|
||||
|
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project NewZhujiang_Server |
||||
* @description 磁悬浮主机系统参数报表 |
||||
* @date 2024-05-30 11:00:12 |
||||
*/ |
||||
@Data |
||||
@NoArgsConstructor |
||||
@Accessors(chain = true) |
||||
@HeadRowHeight(25) |
||||
@HeadFontStyle(fontHeightInPoints = 14) |
||||
@ContentFontStyle(fontHeightInPoints = 13) |
||||
@ContentRowHeight(25) |
||||
@ContentStyle( |
||||
horizontalAlignment = HorizontalAlignmentEnum.CENTER, |
||||
borderBottom = BorderStyleEnum.THIN, |
||||
borderLeft = BorderStyleEnum.THIN, |
||||
borderRight = BorderStyleEnum.THIN, |
||||
borderTop = BorderStyleEnum.THIN |
||||
) |
||||
@ColumnWidth(10) |
||||
public class MaglevReportSysParamDTO { |
||||
|
||||
/** |
||||
* 当前时间 |
||||
*/ |
||||
@ColumnWidth(17) |
||||
@ExcelProperty(value = {"${deviceType}", "时间", "时间"}, index = 0) |
||||
private String curTime; |
||||
|
||||
// /**
|
||||
// * 班次
|
||||
// */
|
||||
// @ColumnWidth(10)
|
||||
// @ExcelProperty(value = {"${deviceType}", "班次", "班次"}, index = 1)
|
||||
// private String classes;
|
||||
|
||||
/** |
||||
* 冷冻水进水温度℃ |
||||
*/ |
||||
@ColumnWidth(10) |
||||
@ExcelProperty(value = {"${deviceType}", "蒸发器", "冷冻水进水温度℃"}, index = 1) |
||||
private BigDecimal tempInChillerWater; |
||||
|
||||
/** |
||||
* 冷冻水出水温度℃ |
||||
*/ |
||||
@ExcelProperty(value = {"${deviceType}", "蒸发器", "冷冻水出水温度℃"}, index = 2) |
||||
@ColumnWidth(10) |
||||
private BigDecimal tempOutChillerWater; |
||||
|
||||
/** |
||||
* 设计流量% |
||||
*/ |
||||
@ExcelProperty(value = {"${deviceType}", "蒸发器", "设计流量%"}, index = 3) |
||||
@ColumnWidth(10) |
||||
private BigDecimal designFlow; |
||||
|
||||
/** |
||||
* 蒸发器压力kpa |
||||
*/ |
||||
@ExcelProperty(value = {"${deviceType}", "蒸发器", "蒸发器压力kpa"}, index = 4) |
||||
@ColumnWidth(10) |
||||
private BigDecimal pressEvapSaturation; |
||||
|
||||
/** |
||||
* 蒸发器饱和温度℃ |
||||
*/ |
||||
@ExcelProperty(value = {"${deviceType}", "蒸发器", "蒸发器饱和温度℃"}, index = 5) |
||||
@ColumnWidth(10) |
||||
private BigDecimal tempEvapSaturation; |
||||
|
||||
/** |
||||
* 趋近温度℃ |
||||
*/ |
||||
@ExcelProperty(value = {"${deviceType}", "蒸发器", "趋近温度℃"}, index = 6) |
||||
@ColumnWidth(10) |
||||
private BigDecimal tempEvapApproaching; |
||||
|
||||
/** |
||||
* 冷却水进水温度℃ |
||||
*/ |
||||
@ExcelProperty(value = {"${deviceType}", "冷凝器", "冷却水进水温度℃"}, index = 7) |
||||
@ColumnWidth(10) |
||||
private BigDecimal tempInCoolingWater; |
||||
|
||||
/** |
||||
* 冷却水出水温度℃ |
||||
*/ |
||||
@ExcelProperty(value = {"${deviceType}", "冷凝器", "冷却水出水温度℃"}, index = 8) |
||||
@ColumnWidth(10) |
||||
private BigDecimal tempOutCoolingWater; |
||||
|
||||
/** |
||||
* 冷凝器压力kpa |
||||
*/ |
||||
@ExcelProperty(value = {"${deviceType}", "冷凝器", "冷凝器压力kpa"}, index = 9) |
||||
@ColumnWidth(10) |
||||
private BigDecimal pressCondenserSaturation; |
||||
|
||||
/** |
||||
* 冷凝器饱和温度℃ |
||||
*/ |
||||
@ExcelProperty(value = {"${deviceType}", "冷凝器", "冷凝器饱和温度℃"}, index = 10) |
||||
@ColumnWidth(10) |
||||
private BigDecimal tempCondenserSaturation; |
||||
|
||||
/** |
||||
* 冷凝器趋近温度℃ |
||||
*/ |
||||
@ExcelProperty(value = {"${deviceType}", "冷凝器", "趋近温度℃"}, index = 11) |
||||
@ColumnWidth(10) |
||||
private BigDecimal tempCondenserApproaching; |
||||
|
||||
/** |
||||
* 冷冻水设定值 |
||||
*/ |
||||
@ExcelProperty(value = {"${deviceType}", "系统", "冷冻水设定值℃"}, index = 12) |
||||
@ColumnWidth(10) |
||||
private BigDecimal setChillerWater; |
||||
|
||||
/** |
||||
* 冷水机需求% |
||||
*/ |
||||
@ExcelProperty(value = {"${deviceType}", "系统", "冷水机需求%"}, index = 13) |
||||
@ColumnWidth(10) |
||||
private BigDecimal setLoad; |
||||
|
||||
/** |
||||
* 总电流A |
||||
*/ |
||||
@ExcelProperty(value = {"${deviceType}", "系统", "总电流A"}, index = 14) |
||||
@ColumnWidth(10) |
||||
private BigDecimal currentTotal; |
||||
|
||||
/** |
||||
* 总输入功率kw |
||||
*/ |
||||
@ExcelProperty(value = {"${deviceType}", "系统", "总输入功率kw"}, index = 15) |
||||
@ColumnWidth(10) |
||||
private BigDecimal inputPowerTotal; |
||||
|
||||
/** |
||||
* 压缩比 |
||||
*/ |
||||
// @ExcelProperty(value = {"${deviceType}", "系统", "压缩比"}, index = 16)
|
||||
// @ColumnWidth(10)
|
||||
// private BigDecimal ratioComp;
|
||||
|
||||
/** |
||||
* 压缩比1 |
||||
*/ |
||||
@ExcelProperty(value = {"${deviceType}", "系统", "1#压缩机压缩比"}, index = 16) |
||||
@ColumnWidth(10) |
||||
private BigDecimal ratioCompOne; |
||||
|
||||
/** |
||||
* 压缩比2 |
||||
*/ |
||||
@ExcelProperty(value = {"${deviceType}", "系统", "2#压缩机压缩比"}, index = 17) |
||||
@ColumnWidth(10) |
||||
private BigDecimal ratioCompTwo; |
||||
|
||||
/** |
||||
* 压缩比3 |
||||
*/ |
||||
@ExcelProperty(value = {"${deviceType}", "系统", "3#压缩机压缩比"}, index = 18) |
||||
@ColumnWidth(10) |
||||
private BigDecimal ratioCompThree; |
||||
|
||||
/** |
||||
* 膨胀阀开度% |
||||
*/ |
||||
@ExcelProperty(value = {"${deviceType}", "系统", "膨胀阀开度%"}, index = 19) |
||||
@ColumnWidth(10) |
||||
private BigDecimal openExv; |
||||
|
||||
/** |
||||
* 运行中的压缩机数量 |
||||
*/ |
||||
@ExcelProperty(value = {"${deviceType}", "系统", "运行中的压缩机数量"}, index = 20) |
||||
@ColumnWidth(10) |
||||
private Integer runCompNum; |
||||
|
||||
/** |
||||
* 冷冻水泵频率hz |
||||
*/ |
||||
@ExcelProperty(value = {"${deviceType}", "冷冻泵", "冷冻水泵频率hz"}, index = 21) |
||||
@ColumnWidth(10) |
||||
private BigDecimal frequencyChiller; |
||||
|
||||
/** |
||||
* 冷冻水进水压力kpa |
||||
*/ |
||||
@ExcelProperty(value = {"${deviceType}", "冷冻泵", "冷冻水进水压力kpa"}, index = 22) |
||||
@ColumnWidth(10) |
||||
private BigDecimal pressInChillerWater; |
||||
|
||||
/** |
||||
* 冷冻水出水压力kpa |
||||
*/ |
||||
@ExcelProperty(value = {"${deviceType}", "冷冻泵", "冷冻水出水压力kpa"}, index = 23) |
||||
@ColumnWidth(10) |
||||
private BigDecimal pressOutChillerWater; |
||||
|
||||
/** |
||||
* 冷却水泵频率hz |
||||
*/ |
||||
@ExcelProperty(value = {"${deviceType}", "冷却泵", "冷却水泵频率hz"}, index = 24) |
||||
@ColumnWidth(10) |
||||
private BigDecimal frequencyCooling; |
||||
|
||||
/** |
||||
* 冷却水进水压力kpa |
||||
*/ |
||||
@ExcelProperty(value = {"${deviceType}", "冷却泵", "冷却水进水压力kpa"}, index = 25) |
||||
@ColumnWidth(10) |
||||
private BigDecimal pressInCoolingWater; |
||||
|
||||
/** |
||||
* 冷却水出水压力kpa |
||||
*/ |
||||
@ExcelProperty(value = {"${deviceType}", "冷却泵", "冷却水出水压力kpa"}, index = 26) |
||||
@ColumnWidth(10) |
||||
private BigDecimal pressOutCoolingWater; |
||||
|
||||
/** |
||||
* 冷却塔频率hz |
||||
*/ |
||||
@ExcelProperty(value = {"${deviceType}", "冷却塔", "冷却塔频率hz"}, index = 27) |
||||
private BigDecimal frequencyCoolingTower; |
||||
|
||||
/** |
||||
* 冷却塔运行数量(原注释可能有误,根据列名调整) |
||||
*/ |
||||
@ExcelProperty(value = {"${deviceType}", "冷却塔", "冷却塔运行数量"}, index = 28) |
||||
private Integer runCoolingTower; |
||||
|
||||
/** |
||||
* 室外温度℃ |
||||
*/ |
||||
@ExcelProperty(value = {"${deviceType}", "室外温度℃", "室外温度℃"}, index = 29) |
||||
@ColumnWidth(10) |
||||
private BigDecimal tempOutdoor; |
||||
|
||||
/** |
||||
* 室外湿度% |
||||
*/ |
||||
@ExcelProperty(value = {"${deviceType}", "室外湿度%", "室外湿度%"}, index = 30) |
||||
@ColumnWidth(10) |
||||
private BigDecimal humidityOutdoor; |
||||
|
||||
/** |
||||
* 恒压补水罐压力 |
||||
*/ |
||||
@ExcelProperty(value = {"${deviceType}", "恒压补水罐压力MPa", "恒压补水罐压力MPa"}, index = 31) |
||||
@ColumnWidth(10) |
||||
private BigDecimal pressConstantWaterTank; |
||||
|
||||
/** |
||||
* 巡查记录人 |
||||
*/ |
||||
@ExcelProperty(value = {"${deviceType}", "巡查记录人", "巡查记录人"}, index = 32) |
||||
@ColumnWidth(20) |
||||
private String recorder; |
||||
|
||||
} |
||||
@ -1,179 +0,0 @@
|
||||
package com.mh.common.core.domain.dto; |
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty; |
||||
import com.alibaba.excel.annotation.write.style.*; |
||||
import com.alibaba.excel.enums.poi.BorderStyleEnum; |
||||
import com.alibaba.excel.enums.poi.HorizontalAlignmentEnum; |
||||
import lombok.Data; |
||||
import lombok.NoArgsConstructor; |
||||
import lombok.experimental.Accessors; |
||||
|
||||
import java.math.BigDecimal; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project NewZhujiang_Server |
||||
* @description 采暖系统参数报表 |
||||
* @date 2024-05-30 11:00:12 |
||||
*/ |
||||
@Data |
||||
@NoArgsConstructor |
||||
@Accessors(chain = true) |
||||
@HeadRowHeight(25) |
||||
@HeadFontStyle(fontHeightInPoints = 14) |
||||
@ContentFontStyle(fontHeightInPoints = 13) |
||||
@ContentRowHeight(20) |
||||
@ContentStyle( |
||||
horizontalAlignment = HorizontalAlignmentEnum.CENTER, |
||||
borderBottom = BorderStyleEnum.THIN, |
||||
borderLeft = BorderStyleEnum.THIN, |
||||
borderRight = BorderStyleEnum.THIN, |
||||
borderTop = BorderStyleEnum.THIN |
||||
) |
||||
@ColumnWidth(10) |
||||
public class ReportHeatingRunParamDTO { |
||||
|
||||
/** |
||||
* 当前时间 |
||||
*/ |
||||
@ColumnWidth(17) |
||||
@ExcelProperty(value = {"${deviceType}", "时间"}, index = 0) |
||||
private String curTime; |
||||
|
||||
/** |
||||
* 当前状态 |
||||
*/ |
||||
@ColumnWidth(10) |
||||
@ExcelProperty(value = {"${deviceType}", "1号采暖设备", "运行状态"}, index = 1) |
||||
private String runStatusBoilerOne; |
||||
|
||||
/** |
||||
* 设定温度 |
||||
*/ |
||||
@ExcelProperty(value = {"${deviceType}", "1号采暖设备", "设定温度(℃)"}, index = 2) |
||||
@ColumnWidth(10) |
||||
private BigDecimal tempSetBoilerOne; |
||||
/** |
||||
* 出水温度 |
||||
*/ |
||||
@ExcelProperty(value = {"${deviceType}", "1号采暖设备", "出水温度(℃)"}, index = 3) |
||||
@ColumnWidth(10) |
||||
private BigDecimal tempOutBoilerOne; |
||||
|
||||
/** |
||||
* 回水温度 |
||||
*/ |
||||
@ExcelProperty(value = {"${deviceType}", "1号采暖设备", "回水温度(℃)"}, index = 4) |
||||
@ColumnWidth(10) |
||||
private BigDecimal tempInBoilerOne; |
||||
|
||||
/** |
||||
* 炉水温度 |
||||
*/ |
||||
@ExcelProperty(value = {"${deviceType}", "1号采暖设备", "炉水温度(℃)"}, index = 5) |
||||
@ColumnWidth(10) |
||||
private BigDecimal tempWaterBoilerOne; |
||||
|
||||
/** |
||||
* 烟道温度(℃) |
||||
*/ |
||||
@ExcelProperty(value = {"${deviceType}", "1号采暖设备", "烟道温度(℃)"}, index = 6) |
||||
@ColumnWidth(10) |
||||
private BigDecimal tempFlueGasBoilerOne; |
||||
|
||||
/** |
||||
* 当前状态 |
||||
*/ |
||||
@ColumnWidth(10) |
||||
@ExcelProperty(value = {"${deviceType}", "2号采暖设备", "运行状态"}, index = 7) |
||||
private String runStatusBoilerTwo; |
||||
|
||||
/** |
||||
* 设定温度 |
||||
*/ |
||||
@ExcelProperty(value = {"${deviceType}", "2号采暖设备", "设定温度(℃)"}, index = 8) |
||||
@ColumnWidth(10) |
||||
private BigDecimal tempSetBoilerTwo; |
||||
|
||||
/** |
||||
* 出水温度 |
||||
*/ |
||||
@ExcelProperty(value = {"${deviceType}", "2号采暖设备", "出水温度(℃)"}, index = 9) |
||||
@ColumnWidth(10) |
||||
private BigDecimal tempOutBoilerTwo; |
||||
|
||||
/** |
||||
* 回水温度 |
||||
*/ |
||||
@ExcelProperty(value = {"${deviceType}", "2号采暖设备", "回水温度(℃)"}, index = 10) |
||||
@ColumnWidth(10) |
||||
private BigDecimal tempInBoilerTwo; |
||||
|
||||
/** |
||||
* 炉水温度 |
||||
*/ |
||||
@ExcelProperty(value = {"${deviceType}", "2号采暖设备", "炉水温度(℃)"}, index = 11) |
||||
@ColumnWidth(10) |
||||
private BigDecimal tempWaterBoilerTwo; |
||||
|
||||
/** |
||||
* 烟道温度(℃) |
||||
*/ |
||||
@ExcelProperty(value = {"${deviceType}", "2号采暖设备", "烟道温度(℃)"}, index = 12) |
||||
@ColumnWidth(10) |
||||
private BigDecimal tempFlueGasBoilerTwo; |
||||
|
||||
/** |
||||
* 当前状态 |
||||
*/ |
||||
@ColumnWidth(10) |
||||
@ExcelProperty(value = {"${deviceType}", "1号采暖泵", "运行状态"}, index = 13) |
||||
private String runStatusPumpOne; |
||||
|
||||
/** |
||||
* 频率 |
||||
*/ |
||||
@ColumnWidth(10) |
||||
@ExcelProperty(value = {"${deviceType}", "1号采暖泵", "频率(Hz)"}, index = 14) |
||||
private BigDecimal frequencyPumpOne; |
||||
|
||||
/** |
||||
* 当前状态 |
||||
*/ |
||||
@ColumnWidth(10) |
||||
@ExcelProperty(value = {"${deviceType}", "2号采暖泵", "运行状态"}, index = 15) |
||||
private String runStatusPumpTwo; |
||||
|
||||
/** |
||||
* 频率 |
||||
*/ |
||||
@ColumnWidth(10) |
||||
@ExcelProperty(value = {"${deviceType}", "2号采暖泵", "频率(Hz)"}, index = 16) |
||||
private BigDecimal frequencyPumpTwo; |
||||
|
||||
/** |
||||
* 当前状态 |
||||
*/ |
||||
@ColumnWidth(10) |
||||
@ExcelProperty(value = {"${deviceType}", "3号采暖泵", "运行状态"}, index = 17) |
||||
private String runStatusPumpThree; |
||||
|
||||
/** |
||||
* 频率 |
||||
*/ |
||||
@ColumnWidth(10) |
||||
@ExcelProperty(value = {"${deviceType}", "3号采暖泵", "频率(Hz)"}, index = 18) |
||||
private BigDecimal frequencyPumpThree; |
||||
|
||||
// 巡查记录人
|
||||
@ExcelProperty(value = {"${deviceType}", "巡查记录人", "巡查记录人"}, index = 19) |
||||
@ColumnWidth(20) |
||||
private String recorder; |
||||
|
||||
// 备注信息
|
||||
@ExcelProperty(value = {"${deviceType}", "备注", "备注"}, index = 20) |
||||
@ColumnWidth(20) |
||||
private String remark; |
||||
|
||||
} |
||||
@ -1,21 +0,0 @@
|
||||
package com.mh.common.core.domain.dto; |
||||
|
||||
import lombok.Data; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project EEMCS |
||||
* @description 接收前端经过deepseek结构化后的请求 |
||||
* @date 2026-02-27 10:18:04 |
||||
*/ |
||||
@Data |
||||
public class ReportRequestDTO { |
||||
|
||||
private String reportType; // 报表类型,如 "能效报表"
|
||||
private String timeRange; // 时间范围,如 "昨天"、"2026-02-01至2026-02-07"
|
||||
private String format; // 输出格式: word, excel, pdf
|
||||
private Boolean watermark; // 是否需要水印 (默认true)
|
||||
private String watermarkText; // 自定义水印文字,若为空则使用默认
|
||||
|
||||
} |
||||
@ -1,135 +0,0 @@
|
||||
package com.mh.common.core.domain.dto; |
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty; |
||||
import com.alibaba.excel.annotation.write.style.*; |
||||
import com.alibaba.excel.enums.poi.BorderStyleEnum; |
||||
import com.alibaba.excel.enums.poi.HorizontalAlignmentEnum; |
||||
import lombok.Data; |
||||
import lombok.NoArgsConstructor; |
||||
import lombok.experimental.Accessors; |
||||
|
||||
import java.math.BigDecimal; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project NewZhujiang_Server |
||||
* @description 蒸汽机系统参数报表 |
||||
* @date 2024-05-30 11:00:12 |
||||
*/ |
||||
@Data |
||||
@NoArgsConstructor |
||||
@Accessors(chain = true) |
||||
@HeadRowHeight(25) |
||||
@HeadFontStyle(fontHeightInPoints = 14) |
||||
@ContentFontStyle(fontHeightInPoints = 13) |
||||
@ContentRowHeight(20) |
||||
@ContentStyle( |
||||
horizontalAlignment = HorizontalAlignmentEnum.CENTER, |
||||
borderBottom = BorderStyleEnum.THIN, |
||||
borderLeft = BorderStyleEnum.THIN, |
||||
borderRight = BorderStyleEnum.THIN, |
||||
borderTop = BorderStyleEnum.THIN |
||||
) |
||||
@ColumnWidth(10) |
||||
public class ReportSteamRunParamDTO { |
||||
|
||||
/** |
||||
* 当前时间 |
||||
*/ |
||||
@ColumnWidth(17) |
||||
@ExcelProperty(value = {"${deviceType}", "时间"}, index = 0) |
||||
private String curTime; |
||||
|
||||
/** |
||||
* 当前状态 |
||||
*/ |
||||
@ColumnWidth(10) |
||||
@ExcelProperty(value = {"${deviceType}", "当前状态", "当前状态"}, index = 1) |
||||
private String curStatus; |
||||
|
||||
/** |
||||
* 火焰强度 |
||||
*/ |
||||
@ExcelProperty(value = {"${deviceType}", "火焰强度", "火焰强度"}, index = 2) |
||||
@ColumnWidth(10) |
||||
private BigDecimal flameIntensity; |
||||
|
||||
/** |
||||
* 烟气温度(℃) |
||||
*/ |
||||
@ExcelProperty(value = {"${deviceType}", "烟气温度(℃)", "烟气温度(℃)"}, index = 3) |
||||
@ColumnWidth(10) |
||||
private BigDecimal tempFlueGas; |
||||
|
||||
/** |
||||
* 火焰百分比(%) |
||||
*/ |
||||
@ExcelProperty(value = {"${deviceType}", "火焰百分比(%)", "火焰百分比(%)"}, index = 4) |
||||
@ColumnWidth(10) |
||||
private BigDecimal percentFlameIntensity; |
||||
|
||||
/** |
||||
* 液位(%) |
||||
*/ |
||||
@ColumnWidth(10) |
||||
@ExcelProperty(value = {"${deviceType}", "液位(%)", "液位(%)"}, index = 5) |
||||
private BigDecimal waterLevel; |
||||
|
||||
/** |
||||
* 蒸汽温度(℃) |
||||
*/ |
||||
@ExcelProperty(value = {"${deviceType}", "蒸汽温度(℃)", "蒸汽温度(℃)"}, index = 6) |
||||
@ColumnWidth(10) |
||||
private BigDecimal tempCur; |
||||
|
||||
/** |
||||
* 当前压力(Mpa) |
||||
*/ |
||||
@ExcelProperty(value = {"${deviceType}", "当前压力(Mpa)", "当前压力(Mpa)"}, index = 7) |
||||
@ColumnWidth(10) |
||||
private BigDecimal pressCur; |
||||
|
||||
/** |
||||
* 压力设定值(Mpa) |
||||
*/ |
||||
@ExcelProperty(value = {"${deviceType}", "压力设定值(Mpa)", "压力设定值(Mpa)"}, index = 8) |
||||
@ColumnWidth(10) |
||||
private BigDecimal pressSet; |
||||
|
||||
// 启动压差(Mpa)
|
||||
@ExcelProperty(value = {"${deviceType}", "启动压差(Mpa)", "启动压差(Mpa)"}, index = 9) |
||||
@ColumnWidth(10) |
||||
private BigDecimal pressStartDiff; |
||||
|
||||
// 停止压差(Mpa)
|
||||
@ExcelProperty(value = {"${deviceType}", "停止压差(Mpa)", "停止压差(Mpa)"}, index = 10) |
||||
@ColumnWidth(10) |
||||
private BigDecimal pressShutdownDiff; |
||||
|
||||
// 瞬时压力(Mpa)
|
||||
@ExcelProperty(value = {"${deviceType}", "瞬时压力(Mpa)", "瞬时压力(Mpa)"}, index = 11) |
||||
@ColumnWidth(10) |
||||
private BigDecimal pressInstance; |
||||
|
||||
// 瞬时流量(t/h)
|
||||
@ExcelProperty(value = {"${deviceType}", "瞬时流量(t/h)", "瞬时流量(t/h)"}, index = 12) |
||||
@ColumnWidth(10) |
||||
private BigDecimal flowInstance; |
||||
|
||||
// 累积流量(t)
|
||||
@ExcelProperty(value = {"${deviceType}", "累积流量(t)", "累积流量(t)"}, index = 13) |
||||
@ColumnWidth(10) |
||||
private BigDecimal flowTotal; |
||||
|
||||
// 巡查记录人
|
||||
@ExcelProperty(value = {"${deviceType}", "巡查记录人", "巡查记录人"}, index = 14) |
||||
@ColumnWidth(20) |
||||
private String recorder; |
||||
|
||||
// 备注信息
|
||||
@ExcelProperty(value = {"${deviceType}", "备注", "备注"}, index = 15) |
||||
@ColumnWidth(20) |
||||
private String remark; |
||||
|
||||
} |
||||
@ -1,210 +0,0 @@
|
||||
package com.mh.common.core.domain.dto; |
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty; |
||||
import com.alibaba.excel.annotation.write.style.*; |
||||
import com.alibaba.excel.enums.poi.BorderStyleEnum; |
||||
import com.alibaba.excel.enums.poi.HorizontalAlignmentEnum; |
||||
import lombok.Data; |
||||
import lombok.NoArgsConstructor; |
||||
import lombok.experimental.Accessors; |
||||
|
||||
import java.math.BigDecimal; |
||||
|
||||
//import java.math.String;
|
||||
|
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project NewZhujiang_Server |
||||
* @description 三楼热水系统参数报表 |
||||
* @date 2024-05-30 11:00:12 |
||||
*/ |
||||
@Data |
||||
@NoArgsConstructor |
||||
@Accessors(chain = true) |
||||
@HeadRowHeight(25) |
||||
@HeadFontStyle(fontHeightInPoints = 14) |
||||
@ContentFontStyle(fontHeightInPoints = 13) |
||||
@ContentRowHeight(25) |
||||
@ContentStyle( |
||||
horizontalAlignment = HorizontalAlignmentEnum.CENTER, |
||||
borderBottom = BorderStyleEnum.THIN, |
||||
borderLeft = BorderStyleEnum.THIN, |
||||
borderRight = BorderStyleEnum.THIN, |
||||
borderTop = BorderStyleEnum.THIN |
||||
) |
||||
@ColumnWidth(10) |
||||
public class ThreeFloorReportHotWaterDTO { |
||||
|
||||
/** |
||||
* 当前时间 |
||||
*/ |
||||
@ColumnWidth(17) |
||||
@ExcelProperty(value = {"${deviceType}", "时间", "时间"}, index = 0) |
||||
private String curTime; |
||||
|
||||
// /**
|
||||
// * 班次
|
||||
// */
|
||||
// @ColumnWidth(10)
|
||||
// @ExcelProperty(value = {"${deviceType}", "班次", "班次"}, index = 1)
|
||||
// private String classes;
|
||||
|
||||
/** |
||||
* 设定温度℃ |
||||
*/ |
||||
@ColumnWidth(10) |
||||
@ExcelProperty(value = {"${deviceType}", "1号热泵", "设定温度℃"}, index = 1) |
||||
private BigDecimal tempSetHotPumpOne; |
||||
|
||||
/** |
||||
* 实际温度℃ |
||||
*/ |
||||
@ExcelProperty(value = {"${deviceType}", "1号热泵", "实际温度℃"}, index = 2) |
||||
@ColumnWidth(10) |
||||
private BigDecimal tempRealHotPumpOne; |
||||
|
||||
/** |
||||
* 设备开关机 |
||||
*/ |
||||
@ExcelProperty(value = {"${deviceType}", "1号热泵", "设备开关机"}, index = 3) |
||||
@ColumnWidth(10) |
||||
private String statusSwitchHotPumpOneStr; |
||||
|
||||
/** |
||||
* 设备运行状态 |
||||
*/ |
||||
@ExcelProperty(value = {"${deviceType}", "1号热泵", "设备运行状态"}, index = 4) |
||||
@ColumnWidth(10) |
||||
private String statusRunHotPumpOneStr; |
||||
|
||||
/** |
||||
* 设定温度℃ |
||||
*/ |
||||
@ColumnWidth(10) |
||||
@ExcelProperty(value = {"${deviceType}", "2号热泵", "设定温度℃"}, index = 5) |
||||
private BigDecimal tempSetHotPumpTwo; |
||||
|
||||
/** |
||||
* 实际温度℃ |
||||
*/ |
||||
@ExcelProperty(value = {"${deviceType}", "2号热泵", "实际温度℃"}, index = 6) |
||||
@ColumnWidth(10) |
||||
private BigDecimal tempRealHotPumpTwo; |
||||
|
||||
/** |
||||
* 设备开关机 |
||||
*/ |
||||
@ExcelProperty(value = {"${deviceType}", "2号热泵", "设备开关机"}, index = 7) |
||||
@ColumnWidth(10) |
||||
private String statusSwitchHotPumpTwoStr; |
||||
|
||||
/** |
||||
* 设备运行状态 |
||||
*/ |
||||
@ExcelProperty(value = {"${deviceType}", "2号热泵", "设备运行状态"}, index = 8) |
||||
@ColumnWidth(10) |
||||
private String statusRunHotPumpTwoStr; |
||||
|
||||
// 3号热泵设定温度(℃)
|
||||
@ColumnWidth(10) |
||||
@ExcelProperty(value = {"${deviceType}", "3号热泵", "设定温度℃"}, index = 9) |
||||
private BigDecimal tempSetHotPumpThree; |
||||
|
||||
// 3号热泵实际温度(℃)
|
||||
@ExcelProperty(value = {"${deviceType}", "3号热泵", "实际温度℃"}, index = 10) |
||||
@ColumnWidth(10) |
||||
private BigDecimal tempRealHotPumpThree; |
||||
|
||||
// 3号热泵启停状态
|
||||
@ExcelProperty(value = {"${deviceType}", "3号热泵", "设备开关机"}, index = 11) |
||||
@ColumnWidth(10) |
||||
private String statusSwitchHotPumpThreeStr; |
||||
|
||||
// 3号热泵运行状态
|
||||
@ExcelProperty(value = {"${deviceType}", "3号热泵", "设备运行状态"}, index = 12) |
||||
@ColumnWidth(10) |
||||
private String statusRunHotPumpThreeStr; |
||||
|
||||
// 4号热泵设定温度(℃)
|
||||
@ColumnWidth(10) |
||||
@ExcelProperty(value = {"${deviceType}", "4号热泵", "设定温度℃"}, index = 13) |
||||
private BigDecimal tempSetHotPumpFour; |
||||
|
||||
// 4号热泵实际温度(℃)
|
||||
@ExcelProperty(value = {"${deviceType}", "4号热泵", "实际温度℃"}, index = 14) |
||||
@ColumnWidth(10) |
||||
private BigDecimal tempRealHotPumpFour; |
||||
|
||||
// 4号热泵启停状态
|
||||
@ExcelProperty(value = {"${deviceType}", "4号热泵", "设备开关机"}, index = 15) |
||||
@ColumnWidth(10) |
||||
private String statusSwitchHotPumpFourStr; |
||||
|
||||
// 4号热泵运行状态
|
||||
@ExcelProperty(value = {"${deviceType}", "4号热泵", "设备运行状态"}, index = 16) |
||||
@ColumnWidth(10) |
||||
private String statusRunHotPumpFourStr; |
||||
|
||||
// 高区/高区设定压力(bar)
|
||||
@ExcelProperty(value = {"${deviceType}", "高区变频泵", "设定压力bar"}, index = 17) |
||||
@ColumnWidth(10) |
||||
private BigDecimal presSetSupplyPumpAreaOne; |
||||
|
||||
// 高区/高区实际压力(bar)
|
||||
@ExcelProperty(value = {"${deviceType}", "高区变频泵", "实际压力bar"}, index = 18) |
||||
@ColumnWidth(10) |
||||
private BigDecimal presRealSupplyPumpAreaOne; |
||||
|
||||
// 高区/高区1号泵运行状态
|
||||
@ExcelProperty(value = {"${deviceType}", "高区变频泵", "1号泵运行状态"}, index = 19) |
||||
@ColumnWidth(10) |
||||
private String statusRunSupplyPumpOneStr; |
||||
|
||||
// 高区/高区2号泵运行状态
|
||||
@ExcelProperty(value = {"${deviceType}", "高区变频泵", "2号泵运行状态"}, index = 20) |
||||
@ColumnWidth(10) |
||||
private String statusRunSupplyPumpTwoStr; |
||||
|
||||
// 中区/中区设定压力(bar)
|
||||
@ExcelProperty(value = {"${deviceType}", "中区变频泵", "设定压力bar"}, index = 21) |
||||
@ColumnWidth(10) |
||||
private BigDecimal presSetSupplyPumpAreaTwo; |
||||
|
||||
// 中区/中区实际压力(bar)
|
||||
@ExcelProperty(value = {"${deviceType}", "中区变频泵", "实际压力bar"}, index = 22) |
||||
@ColumnWidth(10) |
||||
private BigDecimal presRealSupplyPumpAreaTwo; |
||||
|
||||
// 中区/中区1号泵运行状态
|
||||
@ExcelProperty(value = {"${deviceType}", "中区变频泵", "1号泵运行状态"}, index = 23) |
||||
@ColumnWidth(10) |
||||
private String statusRunSupplyPumpThreeStr; |
||||
|
||||
// 中区/中区2号泵运行状态
|
||||
@ExcelProperty(value = {"${deviceType}", "中区变频泵", "2号泵运行状态"}, index = 24) |
||||
@ColumnWidth(10) |
||||
private String statusRunSupplyPumpFourStr; |
||||
|
||||
// 高区/高区液位(米)
|
||||
@ExcelProperty(value = {"${deviceType}", "水箱液位", "高区液位%"}, index = 25) |
||||
@ColumnWidth(10) |
||||
private BigDecimal levelWaterTankOne; |
||||
|
||||
// 中区/中区液位(米)
|
||||
@ExcelProperty(value = {"${deviceType}", "水箱液位", "中区液位%"}, index = 26) |
||||
@ColumnWidth(10) |
||||
private BigDecimal levelWaterTankTwo; |
||||
|
||||
// 巡查记录人
|
||||
@ExcelProperty(value = {"${deviceType}", "巡查记录人", "巡查记录人"}, index = 27) |
||||
@ColumnWidth(20) |
||||
private String recorder; |
||||
|
||||
// 备注信息
|
||||
@ExcelProperty(value = {"${deviceType}", "备注", "备注"}, index = 28) |
||||
@ColumnWidth(20) |
||||
private String remark; |
||||
|
||||
} |
||||
@ -1,63 +0,0 @@
|
||||
package com.mh.common.core.domain.dto; |
||||
|
||||
import lombok.Data; |
||||
import org.apache.commons.lang3.builder.ToStringBuilder; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project EEMCS |
||||
* @description 天气温度历史记录查询 |
||||
* @date 2025-06-16 11:21:48 |
||||
*/ |
||||
@Data |
||||
public class WeatherDataDTO { |
||||
|
||||
/** |
||||
* 时间 |
||||
*/ |
||||
private String weatherDate; |
||||
|
||||
/** |
||||
* 日期和星期 |
||||
*/ |
||||
private String dateAndWeek; |
||||
|
||||
/** |
||||
* 最高温度 |
||||
*/ |
||||
private String maxTemp; |
||||
|
||||
/** |
||||
* 最低温度 |
||||
*/ |
||||
private String minTemp; |
||||
|
||||
/** |
||||
* 天气 |
||||
*/ |
||||
private String weatherConditions; |
||||
|
||||
/** |
||||
* 风向 |
||||
*/ |
||||
private String windDirection; |
||||
|
||||
/** |
||||
* 风速 |
||||
*/ |
||||
private String windPower; |
||||
|
||||
@Override |
||||
public String toString() { |
||||
return new ToStringBuilder(this) |
||||
.append("weatherDate", weatherDate) |
||||
.append("dateAndWeek", dateAndWeek) |
||||
.append("maxTemp", maxTemp) |
||||
.append("minTemp", minTemp) |
||||
.append("weatherConditions", weatherConditions) |
||||
.append("windDirection", windDirection) |
||||
.append("windPower", windPower) |
||||
.toString(); |
||||
} |
||||
} |
||||
@ -1,46 +0,0 @@
|
||||
package com.mh.common.core.domain.entity; |
||||
|
||||
import lombok.Data; |
||||
|
||||
@Data |
||||
public class AnalysisMonth { |
||||
|
||||
private Long id; |
||||
private String curDate; |
||||
private String itemType; |
||||
private String day01; |
||||
private String day02; |
||||
private String day03; |
||||
private String day04; |
||||
private String day05; |
||||
private String day06; |
||||
private String day07; |
||||
private String day08; |
||||
private String day09; |
||||
private String day10; |
||||
private String day11; |
||||
private String day12; |
||||
private String day13; |
||||
private String day14; |
||||
private String day15; |
||||
private String day16; |
||||
private String day17; |
||||
private String day18; |
||||
private String day19; |
||||
private String day20; |
||||
private String day21; |
||||
private String day22; |
||||
private String day23; |
||||
private String day24; |
||||
private String day25; |
||||
private String day26; |
||||
private String day27; |
||||
private String day28; |
||||
private String day29; |
||||
private String day30; |
||||
private String day31; |
||||
private String day32; |
||||
private String totalValue; |
||||
private String buildingId; |
||||
private String buildingName; |
||||
} |
||||
@ -1,27 +0,0 @@
|
||||
package com.mh.common.core.domain.entity; |
||||
|
||||
import lombok.Data; |
||||
|
||||
@Data |
||||
public class AnalysisYear { |
||||
|
||||
private Long id; |
||||
private String curDate; |
||||
private String itemType; |
||||
private String month01; |
||||
private String month02; |
||||
private String month03; |
||||
private String month04; |
||||
private String month05; |
||||
private String month06; |
||||
private String month07; |
||||
private String month08; |
||||
private String month09; |
||||
private String month10; |
||||
private String month11; |
||||
private String month12; |
||||
private String totalValue; |
||||
private String buildingId; |
||||
private String buildingName; |
||||
|
||||
} |
||||
@ -1,84 +0,0 @@
|
||||
package com.mh.common.core.domain.entity; |
||||
|
||||
import com.alibaba.fastjson2.annotation.JSONField; |
||||
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
import lombok.Data; |
||||
|
||||
import java.util.Date; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @date 2025-02-14 09:30:47 |
||||
* @description 设备统计状态表 |
||||
*/ |
||||
@Data |
||||
public class DeviceState { |
||||
|
||||
/** |
||||
* 当前时间 |
||||
*/ |
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
private Date curDate; |
||||
|
||||
/** |
||||
* 设备数目 |
||||
*/ |
||||
private int deviceNum; |
||||
|
||||
/** |
||||
* 电表数目 |
||||
*/ |
||||
private int electNum; |
||||
|
||||
/** |
||||
* 水表数目 |
||||
*/ |
||||
private int waterNum; |
||||
|
||||
/** |
||||
* 泵数目 |
||||
*/ |
||||
private int pumpNum; |
||||
|
||||
/** |
||||
* 压力表数目 |
||||
*/ |
||||
private int pressureNum; |
||||
|
||||
/** |
||||
* 在线设备数目 |
||||
*/ |
||||
private int onlineNum; |
||||
|
||||
/** |
||||
* 离线设备数目 |
||||
*/ |
||||
private int offlineNum; |
||||
|
||||
/** |
||||
* 故障设备数目 |
||||
*/ |
||||
private int faultNum; |
||||
|
||||
/** |
||||
* 上次故障数目 |
||||
*/ |
||||
private int lastFaultNum; |
||||
|
||||
/** |
||||
* 故障环比 |
||||
*/ |
||||
private String faultP; |
||||
|
||||
/** |
||||
* 热泵正在运行的数目 |
||||
*/ |
||||
private int pumpOnline; |
||||
|
||||
/** |
||||
* 其他设备数目 |
||||
*/ |
||||
private int otherNum; |
||||
|
||||
} |
||||
@ -1,89 +0,0 @@
|
||||
package com.mh.common.core.domain.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType; |
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import lombok.Data; |
||||
|
||||
import java.math.BigDecimal; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project EEMCS |
||||
* @description 热水时间能耗实体类 |
||||
* @date 2025-06-18 14:28:30 |
||||
*/ |
||||
@Data |
||||
@TableName("energy_day") |
||||
public class EnergyDay { |
||||
|
||||
@TableId(value = "id", type = IdType.ASSIGN_UUID) |
||||
private String id; |
||||
|
||||
/** |
||||
* 时间 |
||||
*/ |
||||
private String curDate; |
||||
|
||||
/** |
||||
* 建筑id |
||||
*/ |
||||
private String buildingId; |
||||
|
||||
/** |
||||
* 产热量 |
||||
*/ |
||||
private BigDecimal hotWaterValue; |
||||
|
||||
/** |
||||
* 使用用量 |
||||
*/ |
||||
private BigDecimal useHotWater; |
||||
|
||||
/** |
||||
* 用电量 |
||||
*/ |
||||
private BigDecimal electValue; |
||||
|
||||
/** |
||||
* 单耗 |
||||
*/ |
||||
private BigDecimal electWater; |
||||
|
||||
/** |
||||
* 入住人数 |
||||
*/ |
||||
private int checkInCount; |
||||
|
||||
/** |
||||
* 人均用电 |
||||
*/ |
||||
private BigDecimal perElect; |
||||
|
||||
/** |
||||
* 人均用水 |
||||
*/ |
||||
private BigDecimal perWater; |
||||
|
||||
/** |
||||
* 更新标志 |
||||
*/ |
||||
private String updateFlag; |
||||
|
||||
/** |
||||
* 建筑名称 |
||||
*/ |
||||
private String buildingName; |
||||
|
||||
/** |
||||
* 当前电表读数 |
||||
*/ |
||||
private BigDecimal electCurValue; |
||||
|
||||
/** |
||||
* 当前水表读数 |
||||
*/ |
||||
private BigDecimal wtCurValue; |
||||
|
||||
} |
||||
@ -1,74 +0,0 @@
|
||||
package com.mh.common.core.domain.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType; |
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import lombok.Data; |
||||
|
||||
import java.math.BigDecimal; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project EEMCS |
||||
* @description 热水时间能耗实体类 |
||||
* @date 2025-06-18 14:28:30 |
||||
*/ |
||||
@Data |
||||
@TableName("energy_day_sum") |
||||
public class EnergyDaySum { |
||||
|
||||
@TableId(value = "id", type = IdType.ASSIGN_UUID) |
||||
private String id; |
||||
|
||||
/** |
||||
* 时间 |
||||
*/ |
||||
private String curDate; |
||||
|
||||
/** |
||||
* 建筑id |
||||
*/ |
||||
private String buildingId; |
||||
|
||||
/** |
||||
* 补水 |
||||
*/ |
||||
private BigDecimal fillWater; |
||||
|
||||
/** |
||||
* 补水与昨日比 |
||||
*/ |
||||
private String fillWaterP; |
||||
|
||||
/** |
||||
* 用水 |
||||
*/ |
||||
private BigDecimal waterValue; |
||||
|
||||
/** |
||||
* 用水与昨日比 |
||||
*/ |
||||
private String waterP; |
||||
|
||||
/** |
||||
* 用电量 |
||||
*/ |
||||
private BigDecimal electValue; |
||||
|
||||
/** |
||||
* 用电与昨日比 |
||||
*/ |
||||
private String electP; |
||||
|
||||
/** |
||||
* 单耗 |
||||
*/ |
||||
private BigDecimal electWater; |
||||
|
||||
/** |
||||
* 单耗与昨日比 |
||||
*/ |
||||
private String electWaterP; |
||||
|
||||
} |
||||
@ -1,220 +0,0 @@
|
||||
package com.mh.common.core.domain.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType; |
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import lombok.Data; |
||||
import org.apache.commons.lang3.builder.ToStringBuilder; |
||||
|
||||
import java.math.BigDecimal; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project EEMCS |
||||
* @description 热水时间能耗实体类 |
||||
* @date 2025-06-18 14:28:30 |
||||
*/ |
||||
@TableName("energy_hour") |
||||
public class EnergyHour { |
||||
|
||||
@TableId(value = "id", type = IdType.ASSIGN_UUID) |
||||
private String id; |
||||
|
||||
/** |
||||
* 时间 |
||||
*/ |
||||
private String curDate; |
||||
|
||||
/** |
||||
* 建筑id |
||||
*/ |
||||
private String buildingId; |
||||
|
||||
/** |
||||
* 产热量 |
||||
*/ |
||||
private BigDecimal hotWaterValue; |
||||
|
||||
/** |
||||
* 使用用量 |
||||
*/ |
||||
private BigDecimal useHotWater; |
||||
|
||||
/** |
||||
* 用电量 |
||||
*/ |
||||
private BigDecimal electValue; |
||||
|
||||
/** |
||||
* 单耗 |
||||
*/ |
||||
private BigDecimal electWater; |
||||
|
||||
/** |
||||
* 入住人数 |
||||
*/ |
||||
private int checkInCount; |
||||
|
||||
/** |
||||
* 人均用电 |
||||
*/ |
||||
private BigDecimal perElect; |
||||
|
||||
/** |
||||
* 人均用水 |
||||
*/ |
||||
private BigDecimal perWater; |
||||
|
||||
/** |
||||
* 更新标志 |
||||
*/ |
||||
private String updateFlag; |
||||
|
||||
/** |
||||
* 建筑名称 |
||||
*/ |
||||
private String buildingName; |
||||
|
||||
/** |
||||
* 当前电表读数 |
||||
*/ |
||||
private BigDecimal electCurValue; |
||||
|
||||
/** |
||||
* 当前水表读数 |
||||
*/ |
||||
private BigDecimal wtCurValue; |
||||
|
||||
public String getId() { |
||||
return id; |
||||
} |
||||
|
||||
public void setId(String id) { |
||||
this.id = id; |
||||
} |
||||
|
||||
public String getCurDate() { |
||||
return curDate; |
||||
} |
||||
|
||||
public void setCurDate(String curDate) { |
||||
this.curDate = curDate; |
||||
} |
||||
|
||||
public String getBuildingId() { |
||||
return buildingId; |
||||
} |
||||
|
||||
public void setBuildingId(String buildingId) { |
||||
this.buildingId = buildingId; |
||||
} |
||||
|
||||
public BigDecimal getHotWaterValue() { |
||||
return hotWaterValue; |
||||
} |
||||
|
||||
public void setHotWaterValue(BigDecimal hotWaterValue) { |
||||
this.hotWaterValue = hotWaterValue; |
||||
} |
||||
|
||||
public BigDecimal getUseHotWater() { |
||||
return useHotWater; |
||||
} |
||||
|
||||
public void setUseHotWater(BigDecimal useHotWater) { |
||||
this.useHotWater = useHotWater; |
||||
} |
||||
|
||||
public BigDecimal getElectValue() { |
||||
return electValue; |
||||
} |
||||
|
||||
public void setElectValue(BigDecimal electValue) { |
||||
this.electValue = electValue; |
||||
} |
||||
|
||||
public BigDecimal getElectWater() { |
||||
return electWater; |
||||
} |
||||
|
||||
public void setElectWater(BigDecimal electWater) { |
||||
this.electWater = electWater; |
||||
} |
||||
|
||||
public int getCheckInCount() { |
||||
return checkInCount; |
||||
} |
||||
|
||||
public void setCheckInCount(int checkInCount) { |
||||
this.checkInCount = checkInCount; |
||||
} |
||||
|
||||
public BigDecimal getPerElect() { |
||||
return perElect; |
||||
} |
||||
|
||||
public void setPerElect(BigDecimal perElect) { |
||||
this.perElect = perElect; |
||||
} |
||||
|
||||
public BigDecimal getPerWater() { |
||||
return perWater; |
||||
} |
||||
|
||||
public void setPerWater(BigDecimal perWater) { |
||||
this.perWater = perWater; |
||||
} |
||||
|
||||
public String getUpdateFlag() { |
||||
return updateFlag; |
||||
} |
||||
|
||||
public void setUpdateFlag(String updateFlag) { |
||||
this.updateFlag = updateFlag; |
||||
} |
||||
|
||||
public String getBuildingName() { |
||||
return buildingName; |
||||
} |
||||
|
||||
public void setBuildingName(String buildingName) { |
||||
this.buildingName = buildingName; |
||||
} |
||||
|
||||
public BigDecimal getElectCurValue() { |
||||
return electCurValue; |
||||
} |
||||
|
||||
public void setElectCurValue(BigDecimal electCurValue) { |
||||
this.electCurValue = electCurValue; |
||||
} |
||||
|
||||
public BigDecimal getWtCurValue() { |
||||
return wtCurValue; |
||||
} |
||||
|
||||
public void setWtCurValue(BigDecimal wtCurValue) { |
||||
this.wtCurValue = wtCurValue; |
||||
} |
||||
|
||||
@Override |
||||
public String toString() { |
||||
return new ToStringBuilder(this) |
||||
.append("id", id) |
||||
.append("curDate", curDate) |
||||
.append("buildingId", buildingId) |
||||
.append("hotWaterValue", hotWaterValue) |
||||
.append("useHotWater", useHotWater) |
||||
.append("electValue", electValue) |
||||
.append("electWater", electWater) |
||||
.append("checkInCount", checkInCount) |
||||
.append("perElect", perElect) |
||||
.append("perWater", perWater) |
||||
.append("updateFlag", updateFlag) |
||||
.append("buildingName", buildingName) |
||||
.append("electCurValue", electCurValue) |
||||
.append("wtCurValue", wtCurValue) |
||||
.toString(); |
||||
} |
||||
} |
||||
@ -1,89 +0,0 @@
|
||||
package com.mh.common.core.domain.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType; |
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import lombok.Data; |
||||
|
||||
import java.math.BigDecimal; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project EEMCS |
||||
* @description 热水时间能耗实体类 |
||||
* @date 2025-06-18 14:28:30 |
||||
*/ |
||||
@Data |
||||
@TableName("energy_month") |
||||
public class EnergyMonth { |
||||
|
||||
@TableId(value = "id", type = IdType.ASSIGN_UUID) |
||||
private String id; |
||||
|
||||
/** |
||||
* 时间 |
||||
*/ |
||||
private String curDate; |
||||
|
||||
/** |
||||
* 建筑id |
||||
*/ |
||||
private String buildingId; |
||||
|
||||
/** |
||||
* 产热量 |
||||
*/ |
||||
private BigDecimal hotWaterValue; |
||||
|
||||
/** |
||||
* 使用用量 |
||||
*/ |
||||
private BigDecimal useHotWater; |
||||
|
||||
/** |
||||
* 用电量 |
||||
*/ |
||||
private BigDecimal electValue; |
||||
|
||||
/** |
||||
* 单耗 |
||||
*/ |
||||
private BigDecimal electWater; |
||||
|
||||
/** |
||||
* 入住人数 |
||||
*/ |
||||
private int checkInCount; |
||||
|
||||
/** |
||||
* 人均用电 |
||||
*/ |
||||
private BigDecimal perElect; |
||||
|
||||
/** |
||||
* 人均用水 |
||||
*/ |
||||
private BigDecimal perWater; |
||||
|
||||
/** |
||||
* 更新标志 |
||||
*/ |
||||
private String updateFlag; |
||||
|
||||
/** |
||||
* 建筑名称 |
||||
*/ |
||||
private String buildingName; |
||||
|
||||
/** |
||||
* 当前电表读数 |
||||
*/ |
||||
private BigDecimal electCurValue; |
||||
|
||||
/** |
||||
* 当前水表读数 |
||||
*/ |
||||
private BigDecimal wtCurValue; |
||||
|
||||
} |
||||
@ -1,74 +0,0 @@
|
||||
package com.mh.common.core.domain.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType; |
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import lombok.Data; |
||||
|
||||
import java.math.BigDecimal; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project EEMCS |
||||
* @description 热水时间能耗实体类 |
||||
* @date 2025-06-18 14:28:30 |
||||
*/ |
||||
@Data |
||||
@TableName("energy_month_sum") |
||||
public class EnergyMonthSum { |
||||
|
||||
@TableId(value = "id", type = IdType.ASSIGN_UUID) |
||||
private String id; |
||||
|
||||
/** |
||||
* 时间 |
||||
*/ |
||||
private String curDate; |
||||
|
||||
/** |
||||
* 建筑id |
||||
*/ |
||||
private String buildingId; |
||||
|
||||
/** |
||||
* 补水 |
||||
*/ |
||||
private BigDecimal fillWater; |
||||
|
||||
/** |
||||
* 补水与昨日比 |
||||
*/ |
||||
private String fillWaterP; |
||||
|
||||
/** |
||||
* 用水 |
||||
*/ |
||||
private BigDecimal waterValue; |
||||
|
||||
/** |
||||
* 用水与昨日比 |
||||
*/ |
||||
private String waterP; |
||||
|
||||
/** |
||||
* 用电量 |
||||
*/ |
||||
private BigDecimal electValue; |
||||
|
||||
/** |
||||
* 用电与昨日比 |
||||
*/ |
||||
private String electP; |
||||
|
||||
/** |
||||
* 单耗 |
||||
*/ |
||||
private BigDecimal electWater; |
||||
|
||||
/** |
||||
* 单耗与昨日比 |
||||
*/ |
||||
private String electWaterP; |
||||
|
||||
} |
||||
@ -1,89 +0,0 @@
|
||||
package com.mh.common.core.domain.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType; |
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import lombok.Data; |
||||
|
||||
import java.math.BigDecimal; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project EEMCS |
||||
* @description 热水时间能耗实体类 |
||||
* @date 2025-06-18 14:28:30 |
||||
*/ |
||||
@Data |
||||
@TableName("energy_year") |
||||
public class EnergyYear { |
||||
|
||||
@TableId(value = "id", type = IdType.ASSIGN_UUID) |
||||
private String id; |
||||
|
||||
/** |
||||
* 时间 |
||||
*/ |
||||
private String curDate; |
||||
|
||||
/** |
||||
* 建筑id |
||||
*/ |
||||
private String buildingId; |
||||
|
||||
/** |
||||
* 产热量 |
||||
*/ |
||||
private BigDecimal hotWaterValue; |
||||
|
||||
/** |
||||
* 使用用量 |
||||
*/ |
||||
private BigDecimal useHotWater; |
||||
|
||||
/** |
||||
* 用电量 |
||||
*/ |
||||
private BigDecimal electValue; |
||||
|
||||
/** |
||||
* 单耗 |
||||
*/ |
||||
private BigDecimal electWater; |
||||
|
||||
/** |
||||
* 入住人数 |
||||
*/ |
||||
private int checkInCount; |
||||
|
||||
/** |
||||
* 人均用电 |
||||
*/ |
||||
private BigDecimal perElect; |
||||
|
||||
/** |
||||
* 人均用水 |
||||
*/ |
||||
private BigDecimal perWater; |
||||
|
||||
/** |
||||
* 更新标志 |
||||
*/ |
||||
private String updateFlag; |
||||
|
||||
/** |
||||
* 建筑名称 |
||||
*/ |
||||
private String buildingName; |
||||
|
||||
/** |
||||
* 当前电表读数 |
||||
*/ |
||||
private BigDecimal electCurValue; |
||||
|
||||
/** |
||||
* 当前水表读数 |
||||
*/ |
||||
private BigDecimal wtCurValue; |
||||
|
||||
} |
||||
@ -1,74 +0,0 @@
|
||||
package com.mh.common.core.domain.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType; |
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import lombok.Data; |
||||
|
||||
import java.math.BigDecimal; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project EEMCS |
||||
* @description 热水时间能耗实体类 |
||||
* @date 2025-06-18 14:28:30 |
||||
*/ |
||||
@Data |
||||
@TableName("energy_month_sum") |
||||
public class EnergyYearSum { |
||||
|
||||
@TableId(value = "id", type = IdType.ASSIGN_UUID) |
||||
private String id; |
||||
|
||||
/** |
||||
* 时间 |
||||
*/ |
||||
private String curDate; |
||||
|
||||
/** |
||||
* 建筑id |
||||
*/ |
||||
private String buildingId; |
||||
|
||||
/** |
||||
* 补水 |
||||
*/ |
||||
private BigDecimal fillWater; |
||||
|
||||
/** |
||||
* 补水与昨日比 |
||||
*/ |
||||
private String fillWaterP; |
||||
|
||||
/** |
||||
* 用水 |
||||
*/ |
||||
private BigDecimal waterValue; |
||||
|
||||
/** |
||||
* 用水与昨日比 |
||||
*/ |
||||
private String waterP; |
||||
|
||||
/** |
||||
* 用电量 |
||||
*/ |
||||
private BigDecimal electValue; |
||||
|
||||
/** |
||||
* 用电与昨日比 |
||||
*/ |
||||
private String electP; |
||||
|
||||
/** |
||||
* 单耗 |
||||
*/ |
||||
private BigDecimal electWater; |
||||
|
||||
/** |
||||
* 单耗与昨日比 |
||||
*/ |
||||
private String electWaterP; |
||||
|
||||
} |
||||
@ -1,217 +0,0 @@
|
||||
package com.mh.common.core.domain.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.*; |
||||
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
import com.fasterxml.jackson.annotation.JsonIgnore; |
||||
import com.fasterxml.jackson.annotation.JsonInclude; |
||||
import com.mh.common.core.domain.BaseEntity; |
||||
import lombok.Data; |
||||
import lombok.Getter; |
||||
import lombok.Setter; |
||||
|
||||
import java.math.BigDecimal; |
||||
import java.time.LocalDate; |
||||
import java.time.LocalDateTime; |
||||
import java.util.Date; |
||||
import java.util.Map; |
||||
import java.util.StringJoiner; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project EEMCS |
||||
* @description 采暖系统运行记录表 |
||||
* @date 2025-10-21 10:26:12 |
||||
*/ |
||||
@Data |
||||
@TableName("report_heating_run_param_his") // 指定数据库表名
|
||||
public class ReportHeatingRunParamHis extends BaseEntity { |
||||
|
||||
@TableId(value = "id", type = IdType.ASSIGN_UUID) |
||||
private String id; |
||||
|
||||
// 日期
|
||||
@TableField("cur_date") // 字段映射(可选,若字段名与属性名不一致时需指定)
|
||||
private LocalDate curDate; |
||||
|
||||
// 时间
|
||||
@TableField("cur_time") |
||||
private String curTime; // 字符串类型直接映射
|
||||
|
||||
// 班次
|
||||
@TableField("classes") |
||||
private String classes; |
||||
|
||||
// 锅炉1状态
|
||||
@TableField("cur_status_boiler_one") |
||||
private Integer curStatusBoilerOne; |
||||
|
||||
// 锅炉1状态
|
||||
@TableField(exist = false) |
||||
private String runStatusBoilerOne; |
||||
|
||||
// 锅炉1出水温度(℃)
|
||||
@TableField("temp_out_boiler_one") |
||||
private BigDecimal tempOutBoilerOne; // 精度要求高时使用BigDecimal
|
||||
|
||||
// 锅炉1设定温度(℃)
|
||||
@TableField("temp_set_boiler_one") |
||||
private BigDecimal tempSetBoilerOne; // 精度要求高时使用BigDecimal
|
||||
|
||||
// 锅炉1回水温度(℃)
|
||||
@TableField("temp_in_boiler_one") |
||||
private BigDecimal tempInBoilerOne; |
||||
|
||||
// 锅炉1炉水温度(℃)
|
||||
@TableField("temp_water_boiler_one") |
||||
private BigDecimal tempWaterBoilerOne; |
||||
|
||||
// 锅炉1烟道温度(℃)
|
||||
@TableField("temp_flue_gas_boiler_one") |
||||
private BigDecimal tempFlueGasBoilerOne; |
||||
|
||||
// 锅炉2状态
|
||||
@TableField("cur_status_boiler_two") |
||||
private Integer curStatusBoilerTwo; |
||||
|
||||
// 锅炉2状态
|
||||
@TableField(exist = false) |
||||
private String runStatusBoilerTwo; |
||||
|
||||
// 锅炉2设定温度(℃)
|
||||
@TableField("temp_set_boiler_two") |
||||
private BigDecimal tempSetBoilerTwo; // 精度要求高时使用BigDecimal
|
||||
|
||||
// 锅炉2出水温度(℃)
|
||||
@TableField("temp_out_boiler_two") |
||||
private BigDecimal tempOutBoilerTwo; |
||||
|
||||
// 锅炉2回水温度(℃)
|
||||
@TableField("temp_in_boiler_two") |
||||
private BigDecimal tempInBoilerTwo; |
||||
|
||||
// 锅炉2炉水温度(℃)
|
||||
@TableField("temp_water_boiler_two") |
||||
private BigDecimal tempWaterBoilerTwo; |
||||
|
||||
// 锅炉2烟道温度(℃)
|
||||
@TableField("temp_flue_gas_boiler_two") |
||||
private BigDecimal tempFlueGasBoilerTwo; |
||||
|
||||
// 采暖泵1状态
|
||||
@TableField("cur_status_pump_one") |
||||
private Integer curStatusPumpOne; |
||||
|
||||
// 采暖泵1状态
|
||||
@TableField(exist = false) |
||||
private String runStatusPumpOne; |
||||
|
||||
// 采暖泵1频率(Hz)
|
||||
@TableField("frequency_pump_one") |
||||
private BigDecimal frequencyPumpOne; |
||||
|
||||
// 采暖泵2状态
|
||||
@TableField("cur_status_pump_two") |
||||
private Integer curStatusPumpTwo; |
||||
|
||||
// 采暖泵2状态
|
||||
@TableField(exist = false) |
||||
private String runStatusPumpTwo; |
||||
|
||||
// 采暖泵2频率(Hz)
|
||||
@TableField("frequency_pump_two") |
||||
private BigDecimal frequencyPumpTwo; |
||||
|
||||
// 采暖泵3状态
|
||||
@TableField("cur_status_pump_three") |
||||
private Integer curStatusPumpThree; |
||||
|
||||
// 采暖泵3状态
|
||||
@TableField(exist = false) |
||||
private String runStatusPumpThree; |
||||
|
||||
// 采暖泵3频率(Hz)
|
||||
@TableField("frequency_pump_three") |
||||
private BigDecimal frequencyPumpThree; |
||||
|
||||
// 巡查记录人
|
||||
@TableField("recorder") |
||||
private String recorder; |
||||
|
||||
// 备注
|
||||
@TableField("remark") |
||||
private String remark; |
||||
|
||||
// 创建时间(自动填充)
|
||||
@TableField(value = "create_date", fill = FieldFill.INSERT) // 插入时自动填充
|
||||
private LocalDateTime createDate; |
||||
|
||||
@JsonIgnore |
||||
@TableField(exist = false) |
||||
private String searchValue; |
||||
|
||||
/** |
||||
* 请求参数 |
||||
*/ |
||||
@TableField(exist = false) |
||||
@JsonInclude(JsonInclude.Include.NON_EMPTY) |
||||
private Map<String, Object> params; |
||||
|
||||
/** 创建者 */ |
||||
@JsonIgnore |
||||
@TableField(exist = false) |
||||
private String createBy; |
||||
|
||||
/** 创建时间 */ |
||||
@TableField(exist = false) |
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
private Date createTime; |
||||
|
||||
/** 更新者 */ |
||||
@JsonIgnore |
||||
@TableField(exist = false) |
||||
private String updateBy; |
||||
|
||||
/** 更新时间 */ |
||||
@JsonIgnore |
||||
@TableField(exist = false) |
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
private Date updateTime; |
||||
|
||||
/** 更新者 */ |
||||
@TableField(exist = false) |
||||
private int pageNum; |
||||
|
||||
/** 更新者 */ |
||||
@TableField(exist = false) |
||||
private int pageSize; |
||||
|
||||
@Override |
||||
public String toString() { |
||||
return new StringJoiner(", ", ReportHeatingRunParamHis.class.getSimpleName() + "[", "]") |
||||
.add("id='" + id + "'") |
||||
.add("curDate=" + curDate) |
||||
.add("curTime='" + curTime + "'") |
||||
.add("classes='" + classes + "'") |
||||
.add("curStatusBoilerOne=" + curStatusBoilerOne) |
||||
.add("tempOutBoilerOne=" + tempOutBoilerOne) |
||||
.add("tempInBoilerOne=" + tempInBoilerOne) |
||||
.add("tempWaterBoilerOne=" + tempWaterBoilerOne) |
||||
.add("tempFlueGasBoilerOne=" + tempFlueGasBoilerOne) |
||||
.add("curStatusBoilerTwo=" + curStatusBoilerTwo) |
||||
.add("tempOutBoilerTwo=" + tempOutBoilerTwo) |
||||
.add("tempInBoilerTwo=" + tempInBoilerTwo) |
||||
.add("tempWaterBoilerTwo=" + tempWaterBoilerTwo) |
||||
.add("tempFlueGasBoilerTwo=" + tempFlueGasBoilerTwo) |
||||
.add("curStatusPumpOne=" + curStatusPumpOne) |
||||
.add("frequencyPumpOne=" + frequencyPumpOne) |
||||
.add("curStatusPumpTwo=" + curStatusPumpTwo) |
||||
.add("frequencyPumpTwo=" + frequencyPumpTwo) |
||||
.add("curStatusPumpThree=" + curStatusPumpThree) |
||||
.add("frequencyPumpThree=" + frequencyPumpThree) |
||||
.add("recorder='" + recorder + "'") |
||||
.add("remark='" + remark + "'") |
||||
.add("createDate=" + createDate) |
||||
.toString(); |
||||
} |
||||
} |
||||
@ -1,232 +0,0 @@
|
||||
package com.mh.common.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.fasterxml.jackson.annotation.JsonFormat; |
||||
import com.fasterxml.jackson.annotation.JsonIgnore; |
||||
import com.fasterxml.jackson.annotation.JsonInclude; |
||||
import com.mh.common.core.domain.BaseEntity; |
||||
import lombok.Getter; |
||||
import lombok.Setter; |
||||
|
||||
import java.io.Serial; |
||||
import java.io.Serializable; |
||||
import java.math.BigDecimal; |
||||
import java.time.LocalDate; |
||||
import java.time.LocalDateTime; |
||||
import java.util.Date; |
||||
import java.util.Map; |
||||
import java.util.StringJoiner; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project EEMCS |
||||
* @description 生活热水供水热泵运行情况 |
||||
* @date 2025-10-22 17:40:03 |
||||
*/ |
||||
@Setter |
||||
@Getter |
||||
@TableName("report_hot_water_param_his") |
||||
public class ReportHotWaterParamHis extends BaseEntity implements Serializable { |
||||
|
||||
// 主键
|
||||
@Serial |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
@TableId(value = "id", type = IdType.ASSIGN_UUID) |
||||
private String id; |
||||
|
||||
// 楼层ID
|
||||
private String floorId; |
||||
|
||||
// 记录日期
|
||||
private LocalDate curDate; |
||||
|
||||
// 记录时间(varchar格式)
|
||||
private String curTime; |
||||
|
||||
// 班次
|
||||
private String classes; |
||||
|
||||
// 1号热泵设定温度(℃)
|
||||
private BigDecimal tempSetHotPumpOne; |
||||
|
||||
// 1号热泵实际温度(℃)
|
||||
private BigDecimal tempRealHotPumpOne; |
||||
|
||||
// 1号热泵启停状态(0-关闭,1-开启)
|
||||
private Integer statusSwitchHotPumpOne; |
||||
|
||||
// 1号热泵运行状态(0-故障,1-正常)
|
||||
private Integer statusRunHotPumpOne; |
||||
|
||||
// 2号热泵设定温度(℃)
|
||||
private BigDecimal tempSetHotPumpTwo; |
||||
|
||||
// 2号热泵实际温度(℃)
|
||||
private BigDecimal tempRealHotPumpTwo; |
||||
|
||||
// 2号热泵启停状态
|
||||
private Integer statusSwitchHotPumpTwo; |
||||
|
||||
// 2号热泵运行状态
|
||||
private Integer statusRunHotPumpTwo; |
||||
|
||||
// 3号热泵设定温度(℃)
|
||||
private BigDecimal tempSetHotPumpThree; |
||||
|
||||
// 3号热泵实际温度(℃)
|
||||
private BigDecimal tempRealHotPumpThree; |
||||
|
||||
// 3号热泵启停状态
|
||||
private Integer statusSwitchHotPumpThree; |
||||
|
||||
// 3号热泵运行状态
|
||||
private Integer statusRunHotPumpThree; |
||||
|
||||
// 4号热泵设定温度(℃)
|
||||
private BigDecimal tempSetHotPumpFour; |
||||
|
||||
// 4号热泵实际温度(℃)
|
||||
private BigDecimal tempRealHotPumpFour; |
||||
|
||||
// 4号热泵启停状态
|
||||
private Integer statusSwitchHotPumpFour; |
||||
|
||||
// 4号热泵运行状态
|
||||
private Integer statusRunHotPumpFour; |
||||
|
||||
// 高区/裙楼设定压力(MPa)
|
||||
private BigDecimal presSetSupplyPumpAreaOne; |
||||
|
||||
// 高区/裙楼实际压力(MPa)
|
||||
private BigDecimal presRealSupplyPumpAreaOne; |
||||
|
||||
// 高区/裙楼1号泵运行状态
|
||||
private Integer statusRunSupplyPumpOne; |
||||
|
||||
// 高区/裙楼2号泵运行状态
|
||||
private Integer statusRunSupplyPumpTwo; |
||||
|
||||
// 中区/中厨设定压力(MPa)
|
||||
private BigDecimal presSetSupplyPumpAreaTwo; |
||||
|
||||
// 中区/中厨实际压力(MPa)
|
||||
private BigDecimal presRealSupplyPumpAreaTwo; |
||||
|
||||
// 中区/中厨1号泵运行状态
|
||||
private Integer statusRunSupplyPumpThree; |
||||
|
||||
// 中区/中厨2号泵运行状态
|
||||
private Integer statusRunSupplyPumpFour; |
||||
|
||||
// 高区/裙楼液位(米)
|
||||
private BigDecimal levelWaterTankOne; |
||||
|
||||
// 中区/中厨液位(米)
|
||||
private BigDecimal levelWaterTankTwo; |
||||
|
||||
// 巡查记录人
|
||||
private String recorder; |
||||
|
||||
// 备注信息
|
||||
private String remark; |
||||
|
||||
@JsonIgnore |
||||
@TableField(exist = false) |
||||
private String searchValue; |
||||
|
||||
/** |
||||
* 请求参数 |
||||
*/ |
||||
@TableField(exist = false) |
||||
@JsonInclude(JsonInclude.Include.NON_EMPTY) |
||||
private Map<String, Object> params; |
||||
|
||||
/** 创建者 */ |
||||
@JsonIgnore |
||||
@TableField(exist = false) |
||||
private String createBy; |
||||
|
||||
/** 创建时间 */ |
||||
@TableField(exist = false) |
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
private Date createTime; |
||||
|
||||
/** 更新者 */ |
||||
@JsonIgnore |
||||
@TableField(exist = false) |
||||
private String updateBy; |
||||
|
||||
/** 更新时间 */ |
||||
@JsonIgnore |
||||
@TableField(exist = false) |
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
private Date updateTime; |
||||
|
||||
/** 更新者 */ |
||||
@TableField(exist = false) |
||||
private int pageNum; |
||||
|
||||
/** 更新者 */ |
||||
@TableField(exist = false) |
||||
private int pageSize; |
||||
|
||||
// 无参构造
|
||||
public ReportHotWaterParamHis() { |
||||
} |
||||
|
||||
// Getter/Setter 方法(此处省略,实际开发中建议使用 Lombok @Data)
|
||||
|
||||
// 业务方法示例:判断热泵1是否正常运行
|
||||
public boolean isHotPump1Normal() { |
||||
return statusRunHotPumpOne != null && statusRunHotPumpOne == 1; |
||||
} |
||||
|
||||
// 业务方法示例:获取当前压力差值(高区)
|
||||
public BigDecimal getHighAreaPressureDiff() { |
||||
return presRealSupplyPumpAreaOne.subtract(presSetSupplyPumpAreaOne); |
||||
} |
||||
|
||||
@Override |
||||
public String toString() { |
||||
return new StringJoiner(", ", ReportHotWaterParamHis.class.getSimpleName() + "[", "]") |
||||
.add("id='" + id + "'") |
||||
.add("floorId='" + floorId + "'") |
||||
.add("curDate=" + curDate) |
||||
.add("curTime='" + curTime + "'") |
||||
.add("classes='" + classes + "'") |
||||
.add("tempSetHotPumpOne=" + tempSetHotPumpOne) |
||||
.add("tempRealHotPumpOne=" + tempRealHotPumpOne) |
||||
.add("statusSwitchHotPumpOne=" + statusSwitchHotPumpOne) |
||||
.add("statusRunHotPumpOne=" + statusRunHotPumpOne) |
||||
.add("tempSetHotPumpTwo=" + tempSetHotPumpTwo) |
||||
.add("tempRealHotPumpTwo=" + tempRealHotPumpTwo) |
||||
.add("statusSwitchHotPumpTwo=" + statusSwitchHotPumpTwo) |
||||
.add("statusRunHotPumpTwo=" + statusRunHotPumpTwo) |
||||
.add("tempSetHotPumpThree=" + tempSetHotPumpThree) |
||||
.add("tempRealHotPumpThree=" + tempRealHotPumpThree) |
||||
.add("statusSwitchHotPumpThree=" + statusSwitchHotPumpThree) |
||||
.add("statusRunHotPumpThree=" + statusRunHotPumpThree) |
||||
.add("tempSetHotPumpFour=" + tempSetHotPumpFour) |
||||
.add("tempRealHotPumpFour=" + tempRealHotPumpFour) |
||||
.add("statusSwitchHotPumpFour=" + statusSwitchHotPumpFour) |
||||
.add("statusRunHotPumpFour=" + statusRunHotPumpFour) |
||||
.add("presSetSupplyPumpAreaOne=" + presSetSupplyPumpAreaOne) |
||||
.add("presRealSupplyPumpAreaOne=" + presRealSupplyPumpAreaOne) |
||||
.add("statusRunSupplyPumpOne=" + statusRunSupplyPumpOne) |
||||
.add("statusRunSupplyPumpTwo=" + statusRunSupplyPumpTwo) |
||||
.add("presSetSupplyPumpAreaTwo=" + presSetSupplyPumpAreaTwo) |
||||
.add("presRealSupplyPumpAreaTwo=" + presRealSupplyPumpAreaTwo) |
||||
.add("statusRunSupplyPumpThree=" + statusRunSupplyPumpThree) |
||||
.add("statusRunSupplyPumpFour=" + statusRunSupplyPumpFour) |
||||
.add("levelWaterTankOne=" + levelWaterTankOne) |
||||
.add("levelWaterTankTwo=" + levelWaterTankTwo) |
||||
.add("recorder='" + recorder + "'") |
||||
.add("remark='" + remark + "'") |
||||
.toString(); |
||||
} |
||||
} |
||||
@ -1,114 +0,0 @@
|
||||
package com.mh.common.core.domain.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType; |
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
import lombok.Getter; |
||||
import lombok.Setter; |
||||
|
||||
import java.math.BigDecimal; |
||||
import java.util.Date; |
||||
import java.util.StringJoiner; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project EEMCS |
||||
* @description 设备抄表记录表 |
||||
* @date 2025-10-21 10:26:12 |
||||
*/ |
||||
@Setter |
||||
@Getter |
||||
public class ReportMeterReadingsHis { |
||||
|
||||
@TableId(value = "id", type = IdType.ASSIGN_UUID) |
||||
private String id; |
||||
|
||||
/** |
||||
* 设备类型 |
||||
*/ |
||||
private String mtType; |
||||
|
||||
/** |
||||
* 设备位置 |
||||
*/ |
||||
private String location; |
||||
|
||||
/** |
||||
* 设备编号 |
||||
*/ |
||||
private String mtNum; |
||||
|
||||
/** |
||||
* 昨日抄表读数 |
||||
*/ |
||||
private BigDecimal yesterdayReading; |
||||
|
||||
/** |
||||
* 昨日抄表时间 |
||||
*/ |
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
private Date yesterdayTimestamp; |
||||
|
||||
/** |
||||
* 当日抄表读数 |
||||
*/ |
||||
private BigDecimal todayReading; |
||||
|
||||
/** |
||||
* 当日抄表时间 |
||||
*/ |
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
private Date todayTimestamp; |
||||
|
||||
/** |
||||
* 设备倍率 |
||||
*/ |
||||
private int mtRatio; |
||||
|
||||
/** |
||||
* 当日总读数*设备倍率 |
||||
*/ |
||||
private BigDecimal total; |
||||
|
||||
/** |
||||
* 当日单价 |
||||
*/ |
||||
private BigDecimal unitPrice; |
||||
|
||||
/** |
||||
* 当日金额 |
||||
*/ |
||||
private BigDecimal cost; |
||||
|
||||
/** |
||||
* 记录创建时间 |
||||
*/ |
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
private Date createTime; |
||||
|
||||
/** |
||||
* 排序序号 |
||||
*/ |
||||
private int sortOrder; |
||||
|
||||
@Override |
||||
public String toString() { |
||||
return new StringJoiner(", ", ReportMeterReadingsHis.class.getSimpleName() + "[", "]") |
||||
.add("id='" + id + "'") |
||||
.add("mtType='" + mtType + "'") |
||||
.add("location='" + location + "'") |
||||
.add("mtNum='" + mtNum + "'") |
||||
.add("yesterdayReading=" + yesterdayReading) |
||||
.add("yesterdayTimestamp=" + yesterdayTimestamp) |
||||
.add("todayReading=" + todayReading) |
||||
.add("todayTimestamp=" + todayTimestamp) |
||||
.add("mtRatio=" + mtRatio) |
||||
.add("total=" + total) |
||||
.add("unitPrice=" + unitPrice) |
||||
.add("cost=" + cost) |
||||
.add("createTime=" + createTime) |
||||
.add("sortOrder=" + sortOrder) |
||||
.toString(); |
||||
} |
||||
} |
||||
@ -1,170 +0,0 @@
|
||||
package com.mh.common.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.fasterxml.jackson.annotation.JsonFormat; |
||||
import com.fasterxml.jackson.annotation.JsonIgnore; |
||||
import com.fasterxml.jackson.annotation.JsonInclude; |
||||
import com.mh.common.core.domain.BaseEntity; |
||||
import lombok.Getter; |
||||
import lombok.Setter; |
||||
|
||||
import java.io.Serial; |
||||
import java.io.Serializable; |
||||
import java.math.BigDecimal; |
||||
import java.time.LocalDate; |
||||
import java.util.Date; |
||||
import java.util.Map; |
||||
import java.util.StringJoiner; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project EEMCS |
||||
* @description 生活热水供水热泵运行情况 |
||||
* @date 2025-10-22 17:40:03 |
||||
*/ |
||||
@Setter |
||||
@Getter |
||||
@TableName("report_steam_run_param_his") |
||||
public class ReportSteamRunParamHis extends BaseEntity implements Serializable { |
||||
|
||||
// 主键
|
||||
@Serial |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
@TableId(value = "id", type = IdType.AUTO) |
||||
private Long id; |
||||
|
||||
// 记录日期
|
||||
private LocalDate curDate; |
||||
|
||||
// 记录时间(varchar格式)
|
||||
private String curTime; |
||||
|
||||
// 班次
|
||||
private String classes; |
||||
|
||||
// 蒸汽机状态字
|
||||
private Integer curStatus; |
||||
|
||||
// 运行状态
|
||||
// @JsonIgnore
|
||||
@TableField(exist = false) |
||||
private String runStatus; |
||||
|
||||
// 火焰强度
|
||||
private BigDecimal flameIntensity; |
||||
|
||||
// 烟气温度(℃)
|
||||
private BigDecimal tempFlueGas; |
||||
|
||||
// 火焰百分比(%)
|
||||
private BigDecimal percentFlameIntensity; |
||||
|
||||
// 液位(%)
|
||||
private BigDecimal waterLevel; |
||||
|
||||
// 蒸汽温度(℃)
|
||||
private BigDecimal tempCur; |
||||
|
||||
// 当前压力(Mpa)
|
||||
private BigDecimal pressCur; |
||||
|
||||
// 压力设定值(Mpa)
|
||||
private BigDecimal pressSet; |
||||
|
||||
// 启动压差(Mpa)
|
||||
private BigDecimal pressStartDiff; |
||||
|
||||
// 停止压差(Mpa)
|
||||
private BigDecimal pressShutdownDiff; |
||||
|
||||
// 瞬时压力(Mpa)
|
||||
private BigDecimal pressInstance; |
||||
|
||||
// 瞬时流量(t/h)
|
||||
private BigDecimal flowInstance; |
||||
|
||||
// 累积流量(t)
|
||||
private BigDecimal flowTotal; |
||||
|
||||
// 巡查记录人
|
||||
private String recorder; |
||||
|
||||
// 备注信息
|
||||
private String remark; |
||||
|
||||
@JsonIgnore |
||||
@TableField(exist = false) |
||||
private String searchValue; |
||||
|
||||
/** |
||||
* 请求参数 |
||||
*/ |
||||
@TableField(exist = false) |
||||
@JsonInclude(JsonInclude.Include.NON_EMPTY) |
||||
private Map<String, Object> params; |
||||
|
||||
/** 创建者 */ |
||||
@JsonIgnore |
||||
@TableField(exist = false) |
||||
private String createBy; |
||||
|
||||
/** 创建时间 */ |
||||
@TableField(exist = false) |
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
private Date createTime; |
||||
|
||||
/** 更新者 */ |
||||
@JsonIgnore |
||||
@TableField(exist = false) |
||||
private String updateBy; |
||||
|
||||
/** 更新时间 */ |
||||
@JsonIgnore |
||||
@TableField(exist = false) |
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
private Date updateTime; |
||||
|
||||
/** 更新者 */ |
||||
@TableField(exist = false) |
||||
private int pageNum; |
||||
|
||||
/** 更新者 */ |
||||
@TableField(exist = false) |
||||
private int pageSize; |
||||
|
||||
@Override |
||||
public String toString() { |
||||
return new StringJoiner(", ", ReportSteamRunParamHis.class.getSimpleName() + "[", "]") |
||||
.add("id='" + id + "'") |
||||
.add("curDate=" + curDate) |
||||
.add("curTime='" + curTime + "'") |
||||
.add("classes='" + classes + "'") |
||||
.add("curStatus=" + curStatus) |
||||
.add("flameIntensity=" + flameIntensity) |
||||
.add("tempFlueGas=" + tempFlueGas) |
||||
.add("percentFlameIntensity=" + percentFlameIntensity) |
||||
.add("waterLevel=" + waterLevel) |
||||
.add("tempCur=" + tempCur) |
||||
.add("pressCur=" + pressCur) |
||||
.add("pressSet=" + pressSet) |
||||
.add("pressStartDiff=" + pressStartDiff) |
||||
.add("pressShutdownDiff=" + pressShutdownDiff) |
||||
.add("pressInstance=" + pressInstance) |
||||
.add("flowInstance=" + flowInstance) |
||||
.add("flowTotal=" + flowTotal) |
||||
.add("recorder='" + recorder + "'") |
||||
.add("remark='" + remark + "'") |
||||
.add("searchValue='" + searchValue + "'") |
||||
.add("params=" + params) |
||||
.add("createBy='" + createBy + "'") |
||||
.add("createTime=" + createTime) |
||||
.add("updateBy='" + updateBy + "'") |
||||
.add("updateTime=" + updateTime) |
||||
.toString(); |
||||
} |
||||
} |
||||
@ -1,310 +0,0 @@
|
||||
package com.mh.common.core.domain.entity; |
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty; |
||||
import com.alibaba.excel.annotation.write.style.ColumnWidth; |
||||
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.JsonIgnore; |
||||
import com.fasterxml.jackson.annotation.JsonInclude; |
||||
import com.mh.common.core.domain.BaseEntity; |
||||
import lombok.*; |
||||
import org.apache.commons.lang3.builder.ToStringBuilder; |
||||
import org.springframework.data.annotation.Id; |
||||
|
||||
import java.math.BigDecimal; |
||||
import java.time.LocalDate; |
||||
import java.util.Date; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project EEMCS |
||||
* @description 系统参数设备运行历史记录 |
||||
* @date 2025-08-12 10:44:36 |
||||
*/ |
||||
@Data |
||||
@TableName("report_sys_run_param_his") |
||||
public class ReportSysRunParamHis extends BaseEntity { |
||||
|
||||
/** |
||||
* 自增主键 |
||||
*/ |
||||
@Id |
||||
@TableId(value = "id", type = IdType.AUTO) |
||||
private Long id; |
||||
|
||||
/** |
||||
* 主机id |
||||
*/ |
||||
private String deviceNum; |
||||
|
||||
/** |
||||
* 日期 |
||||
*/ |
||||
private LocalDate curDate; |
||||
|
||||
/** |
||||
* 时间(格式建议与数据库存储一致,如 "HH:mm:ss" 或 "yyyy-MM-dd HH:mm:ss") |
||||
*/ |
||||
private String curTime; |
||||
|
||||
// /**
|
||||
// * 班次
|
||||
// */
|
||||
// private String classes;
|
||||
|
||||
/** |
||||
* 冷冻水进水温度℃ |
||||
*/ |
||||
private BigDecimal tempInChillerWater; |
||||
|
||||
/** |
||||
* 冷冻水出水温度℃ |
||||
*/ |
||||
private BigDecimal tempOutChillerWater; |
||||
|
||||
/** |
||||
* 设计流量%(修正列名,原 "design flow" 含空格) |
||||
*/ |
||||
private BigDecimal designFlow; |
||||
|
||||
/** |
||||
* 蒸发器压力kpa--磁悬浮 |
||||
*/ |
||||
private BigDecimal pressEvapSaturation; |
||||
|
||||
/** |
||||
* 蒸发器饱和温度℃ |
||||
*/ |
||||
private BigDecimal tempEvapSaturation; |
||||
|
||||
/** |
||||
* 蒸发器趋近温度℃ |
||||
*/ |
||||
private BigDecimal tempEvapApproaching; |
||||
|
||||
/** |
||||
* 冷却水进水温度℃ |
||||
*/ |
||||
private BigDecimal tempInCoolingWater; |
||||
|
||||
/** |
||||
* 冷却水出水温度℃ |
||||
*/ |
||||
private BigDecimal tempOutCoolingWater; |
||||
|
||||
/** |
||||
* 冷凝器压力kpa--磁悬浮 |
||||
*/ |
||||
private BigDecimal pressCondenserSaturation; |
||||
|
||||
/** |
||||
* 冷凝器饱和温度℃ |
||||
*/ |
||||
private BigDecimal tempCondenserSaturation; |
||||
|
||||
/** |
||||
* 冷凝器趋近温度℃ |
||||
*/ |
||||
private BigDecimal tempCondenserApproaching; |
||||
|
||||
/** |
||||
* 冷冻水设定值℃ |
||||
*/ |
||||
private BigDecimal setChillerWater; |
||||
|
||||
/** |
||||
* 冷水机需求% |
||||
*/ |
||||
private BigDecimal setLoad; |
||||
|
||||
/** |
||||
* 总电流% |
||||
*/ |
||||
private BigDecimal currentTotal; |
||||
|
||||
/** |
||||
* 总输入功率kw |
||||
*/ |
||||
private BigDecimal inputPowerTotal; |
||||
|
||||
/** |
||||
* 压缩比1 |
||||
*/ |
||||
private BigDecimal ratioCompOne; |
||||
|
||||
/** |
||||
* 压缩比1 |
||||
*/ |
||||
private BigDecimal ratioCompTwo; |
||||
|
||||
/** |
||||
* 压缩比1 |
||||
*/ |
||||
private BigDecimal ratioCompThree; |
||||
|
||||
/** |
||||
* 膨胀阀开度% |
||||
*/ |
||||
private BigDecimal openExv; |
||||
|
||||
/** |
||||
* 运行中的压缩机数量 |
||||
*/ |
||||
private Integer runCompNum; |
||||
|
||||
/** |
||||
* 冷冻水泵频率hz |
||||
*/ |
||||
private BigDecimal frequencyChiller; |
||||
|
||||
/** |
||||
* 冷冻水出水压力kpa |
||||
*/ |
||||
private BigDecimal pressOutChillerWater; |
||||
|
||||
/** |
||||
* 冷冻水进水压力kpa |
||||
*/ |
||||
private BigDecimal pressInChillerWater; |
||||
|
||||
/** |
||||
* 冷却水泵频率hz |
||||
*/ |
||||
private BigDecimal frequencyCooling; |
||||
|
||||
/** |
||||
* 冷却水出水压力kpa |
||||
*/ |
||||
private BigDecimal pressOutCoolingWater; |
||||
|
||||
/** |
||||
* 冷却水进水压力kpa |
||||
*/ |
||||
private BigDecimal pressInCoolingWater; |
||||
|
||||
/** |
||||
* 冷却塔水泵频率hz |
||||
*/ |
||||
private BigDecimal frequencyCoolingTower; |
||||
|
||||
/** |
||||
* 冷却塔运行数量(原注释可能有误,根据列名调整) |
||||
*/ |
||||
private Integer runCoolingTower; |
||||
|
||||
/** |
||||
* 恒压补水罐压力 |
||||
*/ |
||||
private BigDecimal pressConstantWaterTank; |
||||
|
||||
/** |
||||
* 室外温度℃ |
||||
*/ |
||||
private BigDecimal tempOutdoor; |
||||
|
||||
/** |
||||
* 室外湿度% |
||||
*/ |
||||
private BigDecimal humidityOutdoor; |
||||
|
||||
/** |
||||
* 巡查记录人 |
||||
*/ |
||||
private String recorder; |
||||
|
||||
/** |
||||
* 备注 |
||||
*/ |
||||
private String remark; |
||||
|
||||
@JsonIgnore |
||||
@TableField(exist = false) |
||||
private String searchValue; |
||||
|
||||
/** |
||||
* 请求参数 |
||||
*/ |
||||
@TableField(exist = false) |
||||
@JsonInclude(JsonInclude.Include.NON_EMPTY) |
||||
private Map<String, Object> params; |
||||
|
||||
/** 创建者 */ |
||||
@TableField(exist = false) |
||||
private String createBy; |
||||
|
||||
/** 创建时间 */ |
||||
@TableField(exist = false) |
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
private Date createTime; |
||||
|
||||
/** 更新者 */ |
||||
@TableField(exist = false) |
||||
private String updateBy; |
||||
|
||||
/** 更新时间 */ |
||||
@TableField(exist = false) |
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
private Date updateTime; |
||||
|
||||
/** 更新者 */ |
||||
@TableField(exist = false) |
||||
private int pageNum; |
||||
|
||||
/** 更新者 */ |
||||
@TableField(exist = false) |
||||
private int pageSize; |
||||
|
||||
@Override |
||||
public String toString() { |
||||
return new ToStringBuilder(this) |
||||
.append("id", id) |
||||
.append("deviceNum", deviceNum) |
||||
.append("curDate", curDate) |
||||
.append("curTime", curTime) |
||||
.append("tempInChillerWater", tempInChillerWater) |
||||
.append("tempOutChillerWater", tempOutChillerWater) |
||||
.append("designFlow", designFlow) |
||||
.append("pressEvapSaturation", pressEvapSaturation) |
||||
.append("tempEvapSaturation", tempEvapSaturation) |
||||
.append("tempEvapApproaching", tempEvapApproaching) |
||||
.append("tempInCoolingWater", tempInCoolingWater) |
||||
.append("tempOutCoolingWater", tempOutCoolingWater) |
||||
.append("pressCondenserSaturation", pressCondenserSaturation) |
||||
.append("tempCondenserSaturation", tempCondenserSaturation) |
||||
.append("tempCondenserApproaching", tempCondenserApproaching) |
||||
.append("setChillerWater", setChillerWater) |
||||
.append("setLoad", setLoad) |
||||
.append("currentTotal", currentTotal) |
||||
.append("inputPowerTotal", inputPowerTotal) |
||||
.append("ratioCompOne", ratioCompOne) |
||||
.append("ratioCompTwo", ratioCompTwo) |
||||
.append("ratioCompThree", ratioCompThree) |
||||
.append("openExv", openExv) |
||||
.append("runCompNum", runCompNum) |
||||
.append("frequencyChiller", frequencyChiller) |
||||
.append("pressOutChillerWater", pressOutChillerWater) |
||||
.append("pressInChillerWater", pressInChillerWater) |
||||
.append("frequencyCooling", frequencyCooling) |
||||
.append("pressOutCoolingWater", pressOutCoolingWater) |
||||
.append("pressInCoolingWater", pressInCoolingWater) |
||||
.append("frequencyCoolingTower", frequencyCoolingTower) |
||||
.append("runCoolingTower", runCoolingTower) |
||||
.append("pressConstantWaterTank", pressConstantWaterTank) |
||||
.append("tempOutdoor", tempOutdoor) |
||||
.append("humidityOutdoor", humidityOutdoor) |
||||
.append("recorder", recorder) |
||||
.append("remark", remark) |
||||
.append("searchValue", searchValue) |
||||
.append("params", params) |
||||
.append("createBy", createBy) |
||||
.append("createTime", createTime) |
||||
.append("updateBy", updateBy) |
||||
.append("updateTime", updateTime) |
||||
.toString(); |
||||
} |
||||
} |
||||
@ -1,117 +0,0 @@
|
||||
package com.mh.common.core.domain.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
import lombok.Data; |
||||
import org.apache.commons.lang3.builder.ToStringBuilder; |
||||
|
||||
import java.util.Date; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project EEMCS |
||||
* @description 热水液位 |
||||
* @date 2025-06-19 16:18:12 |
||||
*/ |
||||
@Data |
||||
@TableName("water_level") |
||||
public class WaterLevel { |
||||
|
||||
private String id; |
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
private Date curDate; |
||||
|
||||
private String buildingId; |
||||
|
||||
private String buildingName; |
||||
|
||||
private String deviceNum; |
||||
|
||||
private String deviceName; |
||||
|
||||
private String temp00; |
||||
|
||||
private String temp01; |
||||
|
||||
private String temp02; |
||||
|
||||
private String temp03; |
||||
|
||||
private String temp04; |
||||
|
||||
private String temp05; |
||||
|
||||
private String temp06; |
||||
|
||||
private String temp07; |
||||
|
||||
private String temp08; |
||||
|
||||
private String temp09; |
||||
|
||||
private String temp10; |
||||
|
||||
private String temp11; |
||||
|
||||
private String temp12; |
||||
|
||||
private String temp13; |
||||
|
||||
private String temp14; |
||||
|
||||
private String temp15; |
||||
|
||||
private String temp16; |
||||
|
||||
private String temp17; |
||||
|
||||
private String temp18; |
||||
|
||||
private String temp19; |
||||
|
||||
private String temp20; |
||||
|
||||
private String temp21; |
||||
|
||||
private String temp22; |
||||
|
||||
private String temp23; |
||||
|
||||
@Override |
||||
public String toString() { |
||||
return new ToStringBuilder(this) |
||||
.append("id", id) |
||||
.append("curDate", curDate) |
||||
.append("buildingId", buildingId) |
||||
.append("buildingName", buildingName) |
||||
.append("deviceNum", deviceNum) |
||||
.append("deviceName", deviceName) |
||||
.append("temp00", temp00) |
||||
.append("temp01", temp01) |
||||
.append("temp02", temp02) |
||||
.append("temp03", temp03) |
||||
.append("temp04", temp04) |
||||
.append("temp05", temp05) |
||||
.append("temp06", temp06) |
||||
.append("temp07", temp07) |
||||
.append("temp08", temp08) |
||||
.append("temp09", temp09) |
||||
.append("temp10", temp10) |
||||
.append("temp11", temp11) |
||||
.append("temp12", temp12) |
||||
.append("temp13", temp13) |
||||
.append("temp14", temp14) |
||||
.append("temp15", temp15) |
||||
.append("temp16", temp16) |
||||
.append("temp17", temp17) |
||||
.append("temp18", temp18) |
||||
.append("temp19", temp19) |
||||
.append("temp20", temp20) |
||||
.append("temp21", temp21) |
||||
.append("temp22", temp22) |
||||
.append("temp23", temp23) |
||||
.toString(); |
||||
} |
||||
} |
||||
@ -1,117 +0,0 @@
|
||||
package com.mh.common.core.domain.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
import lombok.Data; |
||||
import org.apache.commons.lang3.builder.ToStringBuilder; |
||||
|
||||
import java.util.Date; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project EEMCS |
||||
* @description 热水温度 |
||||
* @date 2025-06-19 16:18:12 |
||||
*/ |
||||
@Data |
||||
@TableName("water_temp") |
||||
public class WaterTemp { |
||||
|
||||
private String id; |
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
private Date curDate; |
||||
|
||||
private String buildingId; |
||||
|
||||
private String buildingName; |
||||
|
||||
private String deviceNum; |
||||
|
||||
private String deviceName; |
||||
|
||||
private String temp00; |
||||
|
||||
private String temp01; |
||||
|
||||
private String temp02; |
||||
|
||||
private String temp03; |
||||
|
||||
private String temp04; |
||||
|
||||
private String temp05; |
||||
|
||||
private String temp06; |
||||
|
||||
private String temp07; |
||||
|
||||
private String temp08; |
||||
|
||||
private String temp09; |
||||
|
||||
private String temp10; |
||||
|
||||
private String temp11; |
||||
|
||||
private String temp12; |
||||
|
||||
private String temp13; |
||||
|
||||
private String temp14; |
||||
|
||||
private String temp15; |
||||
|
||||
private String temp16; |
||||
|
||||
private String temp17; |
||||
|
||||
private String temp18; |
||||
|
||||
private String temp19; |
||||
|
||||
private String temp20; |
||||
|
||||
private String temp21; |
||||
|
||||
private String temp22; |
||||
|
||||
private String temp23; |
||||
|
||||
@Override |
||||
public String toString() { |
||||
return new ToStringBuilder(this) |
||||
.append("id", id) |
||||
.append("curDate", curDate) |
||||
.append("buildingId", buildingId) |
||||
.append("buildingName", buildingName) |
||||
.append("deviceNum", deviceNum) |
||||
.append("deviceName", deviceName) |
||||
.append("temp00", temp00) |
||||
.append("temp01", temp01) |
||||
.append("temp02", temp02) |
||||
.append("temp03", temp03) |
||||
.append("temp04", temp04) |
||||
.append("temp05", temp05) |
||||
.append("temp06", temp06) |
||||
.append("temp07", temp07) |
||||
.append("temp08", temp08) |
||||
.append("temp09", temp09) |
||||
.append("temp10", temp10) |
||||
.append("temp11", temp11) |
||||
.append("temp12", temp12) |
||||
.append("temp13", temp13) |
||||
.append("temp14", temp14) |
||||
.append("temp15", temp15) |
||||
.append("temp16", temp16) |
||||
.append("temp17", temp17) |
||||
.append("temp18", temp18) |
||||
.append("temp19", temp19) |
||||
.append("temp20", temp20) |
||||
.append("temp21", temp21) |
||||
.append("temp22", temp22) |
||||
.append("temp23", temp23) |
||||
.toString(); |
||||
} |
||||
} |
||||
@ -1,53 +0,0 @@
|
||||
package com.mh.common.core.domain.vo; |
||||
|
||||
import lombok.Data; |
||||
|
||||
import java.math.BigDecimal; |
||||
import java.util.Date; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project EEMCS |
||||
* @description 辅助计算类 |
||||
* @date 2026-01-28 14:27:20 |
||||
*/ |
||||
@Data |
||||
public class CollectionParamsManageDataVO { |
||||
|
||||
// getter方法
|
||||
private String deviceName; |
||||
private String mtNum; |
||||
private Integer orderNum; |
||||
private String systemType; |
||||
private String deviceType; |
||||
private String otherName; |
||||
private String paramType; |
||||
private BigDecimal curValue; |
||||
private Date curTime; |
||||
private Integer grade; |
||||
private Integer status; |
||||
|
||||
// 构造函数
|
||||
public CollectionParamsManageDataVO(Map<String, Object> map) { |
||||
this.deviceName = (String) map.get("device_name"); |
||||
this.mtNum = (String) map.get("mt_num"); |
||||
this.orderNum = map.get("order_num") instanceof Integer ? |
||||
(Integer) map.get("order_num") : |
||||
(map.get("order_num") != null ? Integer.valueOf(map.get("order_num").toString()) : null); |
||||
this.systemType = (String) map.get("system_type"); |
||||
this.deviceType = (String) map.get("device_type"); |
||||
this.otherName = (String) map.get("other_name"); |
||||
this.paramType = (String) map.get("param_type"); |
||||
this.curValue = map.get("cur_value") instanceof BigDecimal ? |
||||
(BigDecimal) map.get("cur_value") : |
||||
(map.get("cur_value") != null ? new BigDecimal(map.get("cur_value").toString()) : BigDecimal.ZERO); |
||||
this.curTime = (Date) map.get("cur_time"); |
||||
this.grade = map.get("grade") instanceof Integer ? |
||||
(Integer) map.get("grade") : |
||||
(map.get("grade") != null ? Integer.valueOf(map.get("grade").toString()) : null); |
||||
this.status = (Integer) map.get("status"); |
||||
} |
||||
|
||||
} |
||||
@ -1,63 +0,0 @@
|
||||
package com.mh.common.core.redis; |
||||
|
||||
import lombok.extern.slf4j.Slf4j; |
||||
import org.springframework.data.redis.core.StringRedisTemplate; |
||||
import org.springframework.data.redis.core.script.RedisScript; |
||||
import org.springframework.stereotype.Component; |
||||
|
||||
import java.util.Collections; |
||||
import java.util.concurrent.TimeUnit; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project EEMCS |
||||
* @description 锁 |
||||
* @date 2025-06-06 16:08:13 |
||||
*/ |
||||
@Slf4j |
||||
@Component |
||||
public class RedisLock { |
||||
|
||||
private final StringRedisTemplate redisTemplate; |
||||
|
||||
public RedisLock(StringRedisTemplate redisTemplate) { |
||||
this.redisTemplate = redisTemplate; |
||||
} |
||||
|
||||
/** |
||||
* 获取锁 |
||||
*/ |
||||
public boolean lock(String key, String requestId, long expireTimeInSeconds) { |
||||
Boolean success = redisTemplate.opsForValue().setIfAbsent(key, requestId, expireTimeInSeconds, TimeUnit.SECONDS); |
||||
return Boolean.TRUE.equals(success); |
||||
} |
||||
|
||||
/** |
||||
* 尝试获取锁(带超时) |
||||
*/ |
||||
public boolean tryLock(String key, String requestId, long expireTime, long timeoutMs) throws InterruptedException { |
||||
long startTime = System.currentTimeMillis(); |
||||
while (System.currentTimeMillis() - startTime < timeoutMs) { |
||||
if (lock(key, requestId, expireTime)) { |
||||
return true; |
||||
} |
||||
Thread.sleep(50); |
||||
} |
||||
return false; |
||||
} |
||||
|
||||
/** |
||||
* 释放锁(使用 Lua 脚本保证原子性) |
||||
*/ |
||||
public void unlock(String key, String requestId) { |
||||
String script = "if redis.call('get', KEYS[1]) == ARGV[1] then return redis.call('del', KEYS[1]) else return 0 end"; |
||||
RedisScript<Long> redisScript = RedisScript.of(script, Long.class); |
||||
|
||||
Long result = redisTemplate.execute(redisScript, Collections.singletonList(key), requestId); |
||||
|
||||
if (result == null || result == 0) { |
||||
log.warn("释放锁失败,可能已被其他线程释放 key={}", key); |
||||
} |
||||
} |
||||
} |
||||
@ -1,74 +0,0 @@
|
||||
package com.mh.common.model.request; |
||||
|
||||
import com.alibaba.fastjson2.JSON; |
||||
import com.alibaba.fastjson2.JSONArray; |
||||
import com.alibaba.fastjson2.JSONObject; |
||||
|
||||
import java.util.ArrayList; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project EEMCS |
||||
* @description 昆仑通态触摸屏数据转换 |
||||
* @date 2026-02-02 15:29:47 |
||||
*/ |
||||
public class AdvantechJsonParser { |
||||
|
||||
/** |
||||
* 将JSON字符串解析为 AdvantechReceiver<AdvantechDatas<Number>> |
||||
* @param json 原始MQTT JSON |
||||
* @param defaultQuality quality默认值(如192表示Good),传null则不设置 |
||||
* @return 解析后的接收对象 |
||||
*/ |
||||
public static AdvantechReceiver<AdvantechDatas<Number>> parse( |
||||
String json, |
||||
Number defaultQuality) { |
||||
|
||||
JSONObject root = JSON.parseObject(json); |
||||
AdvantechReceiver<AdvantechDatas<Number>> receiver = new AdvantechReceiver<>(); |
||||
|
||||
// 1. 提取ts(保留原始字符串格式)
|
||||
// "2026-02-02T18:33:57.712049"时间格式是这个,转成yyyy-MM-dd HH:mm:ss
|
||||
root.put("ts", root.getString("ts").replace("T", " ").substring(0, 19)); |
||||
receiver.setTs(root.getString("ts")); |
||||
|
||||
// 2. 解析d数组:展开所有键值对 → AdvantechDatas
|
||||
List<AdvantechDatas<Number>> dataList = new ArrayList<>(); |
||||
JSONArray dArray = root.getJSONArray("d"); |
||||
|
||||
if (dArray != null) { |
||||
for (int i = 0; i < dArray.size(); i++) { |
||||
JSONObject item = dArray.getJSONObject(i); |
||||
if (item == null || item.isEmpty()) continue; |
||||
|
||||
for (Map.Entry<String, Object> entry : item.entrySet()) { |
||||
String tag = entry.getKey(); |
||||
Object val = entry.getValue(); |
||||
|
||||
if (val instanceof Number) { |
||||
AdvantechDatas<Number> data = new AdvantechDatas<>(); |
||||
data.setTag(tag); |
||||
data.setValue((Number) val); |
||||
if (defaultQuality != null) { |
||||
data.setQuality(defaultQuality); |
||||
} |
||||
dataList.add(data); |
||||
} |
||||
// 非数值字段自动跳过(可扩展日志)
|
||||
} |
||||
} |
||||
} |
||||
|
||||
receiver.setD(dataList); |
||||
return receiver; |
||||
} |
||||
|
||||
// 便捷重载:不设置quality
|
||||
public static AdvantechReceiver<AdvantechDatas<Number>> parse(String json) { |
||||
return parse(json, 0); |
||||
} |
||||
|
||||
} |
||||
@ -1,336 +0,0 @@
|
||||
package com.mh.common.utils; |
||||
|
||||
import com.mh.common.core.domain.entity.CollectionParamsManage; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
|
||||
import java.math.BigDecimal; |
||||
import java.math.RoundingMode; |
||||
import java.text.DecimalFormat; |
||||
import java.text.ParseException; |
||||
import java.text.SimpleDateFormat; |
||||
import java.util.*; |
||||
|
||||
/** |
||||
* @author ljf |
||||
* @title : |
||||
* @description : 解析485接收的数据 |
||||
* @updateTime 2020-04-23 |
||||
* @throws : |
||||
*/ |
||||
@Slf4j |
||||
public class AnalysisReceiveOrder485 { |
||||
|
||||
// 调用service
|
||||
// private final SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
// private final DecimalFormat df = new DecimalFormat("#.##");
|
||||
|
||||
//解析冷量表
|
||||
public void analysisCloudOrder485(final String dataStr1, final CollectionParamsManage deviceCodeParam) { |
||||
// 去掉空格
|
||||
String dataStr = dataStr1.replace(" ", "").toUpperCase(); |
||||
// 检验报文
|
||||
String checkStr = dataStr.substring(0, dataStr.length() - 4); |
||||
byte[] strOrder = ExchangeStringUtil.hexStrToBinaryStr(checkStr); |
||||
int checkNum = CRC16.CRC16_MODBUS(strOrder); |
||||
String checkWord = ExchangeStringUtil.decToHex(String.valueOf(checkNum)); |
||||
checkWord = checkWord.substring(2, 4) + checkWord.substring(0, 2); |
||||
|
||||
if (checkWord.equalsIgnoreCase(dataStr.substring(dataStr.length() - 4))) { |
||||
//创建SimpleDateFormat对象,指定样式 2019-05-13 22:39:30
|
||||
// Date date = new Date();
|
||||
// String dateStr = sdf1.format(date);
|
||||
//保留两位小数处理
|
||||
DecimalFormat decimalFormat = new DecimalFormat("0.00"); |
||||
// 表号
|
||||
String cloudId = ExchangeStringUtil.hexToDec(dataStr.substring(0, 2)); |
||||
// 读数
|
||||
String data = ""; |
||||
data = dataStr.substring(dataStr.length() - 8, dataStr.length() - 6) |
||||
+ dataStr.substring(dataStr.length() - 6, dataStr.length() - 4) |
||||
+ dataStr.substring(dataStr.length() - 12, dataStr.length() - 10) |
||||
+ dataStr.substring(dataStr.length() - 10, dataStr.length() - 8); |
||||
|
||||
String registerAddr = deviceCodeParam.getRegisterAddr(); |
||||
// if (ExchangeStringUtil.isInDate(date, "00:00:00", "00:00:30")) {
|
||||
// dateStr = dateStr.substring(0, 17) + "00";
|
||||
// } else if (ExchangeStringUtil.isInDate(date, "00:00:30", "00:00:59")) {
|
||||
// dateStr = dateStr.substring(0, 17) + "30";
|
||||
// }
|
||||
try { |
||||
if (registerAddr.equals("32") || registerAddr.equals("33") || registerAddr.equals("35") || registerAddr.equals("36")) { |
||||
data = decimalFormat.format(Math.abs(ExchangeStringUtil.hexToSingle(data)));//十六进制字符串转IEEE754浮点型
|
||||
log.info("冷量计==>{},寄存器地址==>{},读数==>{}", cloudId, registerAddr, data); |
||||
} else if (registerAddr.equals("31") || registerAddr.equals("34")) { |
||||
long lData = Long.parseLong(ExchangeStringUtil.hexToDec(data)); |
||||
log.info("冷量计==>{},寄存器地址==>{},累计读数==>{}", cloudId, registerAddr, lData); |
||||
} |
||||
} catch (Exception e) { |
||||
log.error("保存冷量计数据失败!", e); |
||||
} |
||||
} else { |
||||
log.info("冷量计校验失败===>{}", dataStr); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* 解析水表返回的数据 |
||||
* |
||||
* @param dataStr1 |
||||
*/ |
||||
public String analysisWaterOrder485(final String dataStr1, final CollectionParamsManage deviceCodeParam) { |
||||
// 去掉空格
|
||||
String dataStr = dataStr1.replace(" ", "").toUpperCase(); |
||||
// 检验报文
|
||||
String checkStr = dataStr.substring(0, dataStr.length() - 4); |
||||
byte[] strOrder = ExchangeStringUtil.hexStrToBinaryStr(checkStr); |
||||
int checkNum = CRC16.CRC16_MODBUS(strOrder); |
||||
String checkWord = ExchangeStringUtil.decToHex(String.valueOf(checkNum)); |
||||
checkWord = checkWord.substring(2, 4) + checkWord.substring(0, 2); |
||||
|
||||
if (checkWord.equalsIgnoreCase(dataStr.substring(dataStr.length() - 4))) { |
||||
//创建SimpleDateFormat对象,指定样式 2019-05-13 22:39:30
|
||||
// Date date = new Date();
|
||||
// String dateStr = sdf1.format(date);
|
||||
//保留两位小数处理
|
||||
DecimalFormat decimalFormat = new DecimalFormat("0.00"); |
||||
// 表号
|
||||
String cloudId = ExchangeStringUtil.hexToDec(dataStr.substring(0, 2)); |
||||
// 读数
|
||||
String data = ""; |
||||
data = dataStr.substring(dataStr.length() - 8, dataStr.length() - 6) |
||||
+ dataStr.substring(dataStr.length() - 6, dataStr.length() - 4) |
||||
+ dataStr.substring(dataStr.length() - 12, dataStr.length() - 10) |
||||
+ dataStr.substring(dataStr.length() - 10, dataStr.length() - 8); |
||||
|
||||
int dataType = deviceCodeParam.getDataType(); |
||||
// if (ExchangeStringUtil.isInDate(date, "00:00:00", "00:00:30")) {
|
||||
// dateStr = dateStr.substring(0, 17) + "00";
|
||||
// // System.out.println("插入时间00" + dateStr);
|
||||
// } else if (ExchangeStringUtil.isInDate(date, "00:00:30", "00:00:59")) {
|
||||
// dateStr = dateStr.substring(0, 17) + "30";
|
||||
// // System.out.println("插入时间30" + dateStr);
|
||||
// }
|
||||
try { |
||||
if (dataType == 3) { |
||||
data = decimalFormat.format(Math.abs(ExchangeStringUtil.hexToSingle(data)));//十六进制字符串转IEEE754浮点型
|
||||
log.info("水表==>{},寄存器地址==>{},读数==>{}", cloudId, deviceCodeParam.getRegisterAddr(), data); |
||||
} else if (dataType == 2) { |
||||
data = dataStr.substring(dataStr.length() - 12, dataStr.length() - 10) |
||||
+ dataStr.substring(dataStr.length() - 10, dataStr.length() - 8) |
||||
+ dataStr.substring(dataStr.length() - 8, dataStr.length() - 6) |
||||
+ dataStr.substring(dataStr.length() - 6, dataStr.length() - 4); |
||||
data = ExchangeStringUtil.hexToDec(data); |
||||
BigDecimal bigDecimal = new BigDecimal(data); |
||||
bigDecimal = bigDecimal.divide(new BigDecimal((int) Math.pow(10, deviceCodeParam.getDigits()))).setScale(2, RoundingMode.HALF_UP); // 除以1000并保留整数
|
||||
data = bigDecimal.toString(); |
||||
log.info("水表==>{},寄存器地址==>{},累计读数==>{}", cloudId, deviceCodeParam.getRegisterAddr(), data); |
||||
} |
||||
// 判断data大于99999999,就返回空
|
||||
if (new BigDecimal(data).intValue() > 99999999) { |
||||
return ""; |
||||
} |
||||
return data; |
||||
} catch (Exception e) { |
||||
log.error("保存水表数据失败!", e); |
||||
} |
||||
} else { |
||||
log.info("水表===>{}", dataStr); |
||||
return ""; |
||||
} |
||||
return ""; |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 解析电表返回的数据 |
||||
* |
||||
* @param dataStr1 |
||||
*/ |
||||
public String analysisMeterOrder485(final String dataStr1, final CollectionParamsManage deviceCodeParam) { |
||||
// 去掉空格
|
||||
String dataStr = dataStr1.replace(" ", "").toUpperCase(); |
||||
// 检验报文
|
||||
String checkStr = dataStr.substring(0, dataStr.length() - 4); |
||||
byte[] strOrder = ExchangeStringUtil.hexStrToBinaryStr(checkStr); |
||||
int checkNum = CRC16.CRC16_MODBUS(strOrder); |
||||
String checkWord = ExchangeStringUtil.decToHex(String.valueOf(checkNum)); |
||||
checkWord = checkWord.substring(2, 4) + checkWord.substring(0, 2); |
||||
|
||||
if (checkWord.equalsIgnoreCase(dataStr.substring(dataStr.length() - 4))) { |
||||
//创建SimpleDateFormat对象,指定样式 2019-05-13 22:39:30
|
||||
// Date date = new Date();
|
||||
// String dateStr = sdf1.format(date);
|
||||
; |
||||
//保留两位小数处理
|
||||
DecimalFormat decimalFormat = new DecimalFormat("0.00"); |
||||
// 表号
|
||||
String cloudId = ExchangeStringUtil.hexToDec(dataStr.substring(0, 2)); |
||||
// 读数
|
||||
String data = ""; |
||||
data = dataStr.substring(dataStr.length() - 8, dataStr.length() - 6) |
||||
+ dataStr.substring(dataStr.length() - 6, dataStr.length() - 4) |
||||
+ dataStr.substring(dataStr.length() - 12, dataStr.length() - 10) |
||||
+ dataStr.substring(dataStr.length() - 10, dataStr.length() - 8); |
||||
|
||||
int dataType = deviceCodeParam.getDataType(); |
||||
// if (ExchangeStringUtil.isInDate(date, "00:00:00", "00:00:30")) {
|
||||
// dateStr = dateStr.substring(0, 17) + "00";
|
||||
// // System.out.println("插入时间00" + dateStr);
|
||||
// } else if (ExchangeStringUtil.isInDate(date, "00:00:30", "00:00:59")) {
|
||||
// dateStr = dateStr.substring(0, 17) + "30";
|
||||
// // System.out.println("插入时间30" + dateStr);
|
||||
// }
|
||||
try { |
||||
if (dataType == 3) { |
||||
data = decimalFormat.format(Math.abs(ExchangeStringUtil.hexToSingle(data)));//十六进制字符串转IEEE754浮点型
|
||||
log.info("电表==>{},寄存器地址==>{},读数==>{}", cloudId, deviceCodeParam.getRegisterAddr(), data); |
||||
} else if (dataType == 2) { |
||||
data = ExchangeStringUtil.hexToDec(data); |
||||
log.info("电表==>{},寄存器地址==>{},累计读数==>{}", cloudId, deviceCodeParam.getRegisterAddr(), data); |
||||
} |
||||
// 判断data大于99999999,就返回空
|
||||
if (new BigDecimal(data).intValue() > 99999999) { |
||||
return ""; |
||||
} |
||||
return data; |
||||
} catch (Exception e) { |
||||
log.error("保存电表数据失败!", e); |
||||
} |
||||
} else { |
||||
log.info("电表===>{}", dataStr); |
||||
return ""; |
||||
} |
||||
return ""; |
||||
} |
||||
|
||||
public static int dValue(String lastDate) throws ParseException { |
||||
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
||||
Date lastTime = format.parse(lastDate); |
||||
long min = lastTime.getTime(); |
||||
Calendar calendar = Calendar.getInstance(); |
||||
long min1 = calendar.getTimeInMillis(); |
||||
long subtract = min1 - min; |
||||
// // System.out.println("相减值: " + subtract/(1000*60));
|
||||
return (int) subtract / (1000 * 60); |
||||
} |
||||
|
||||
|
||||
// 判断是否存在寄存器地址
|
||||
public Boolean queryRegisterAddr(List<String> stringList, String registerAddr) { |
||||
boolean flag = false; |
||||
for (int i = 0; i < stringList.size(); i++) { |
||||
if (stringList.get(i).equalsIgnoreCase(registerAddr)) { |
||||
flag = true; |
||||
break; |
||||
} |
||||
} |
||||
return flag; |
||||
} |
||||
|
||||
public String analysisHeatPumpOrder485(String receiveStr, CollectionParamsManage deviceCodeParam) { |
||||
// 去掉空格
|
||||
String dataStr = receiveStr.replace(" ", "").toUpperCase(); |
||||
// 检验报文
|
||||
String checkStr = dataStr.substring(0, dataStr.length() - 4); |
||||
byte[] strOrder = ExchangeStringUtil.hexStrToBinaryStr(checkStr); |
||||
int checkNum = CRC16.CRC16_MODBUS(strOrder); |
||||
String checkWord = ExchangeStringUtil.decToHex(String.valueOf(checkNum)); |
||||
checkWord = checkWord.substring(2, 4) + checkWord.substring(0, 2); |
||||
|
||||
if (checkWord.equalsIgnoreCase(dataStr.substring(dataStr.length() - 4))) { |
||||
//创建SimpleDateFormat对象,指定样式 2019-05-13 22:39:30
|
||||
// Date date = new Date();
|
||||
// String dateStr = sdf1.format(date);
|
||||
|
||||
//保留两位小数处理
|
||||
DecimalFormat decimalFormat = new DecimalFormat("0.00"); |
||||
// 表号
|
||||
String cloudId = ExchangeStringUtil.hexToDec(dataStr.substring(0, 2)); |
||||
// 读数
|
||||
String data = ""; |
||||
data = dataStr.substring(dataStr.length() - 8, dataStr.length() - 6) |
||||
+ dataStr.substring(dataStr.length() - 6, dataStr.length() - 4); |
||||
|
||||
int dataType = deviceCodeParam.getDataType(); |
||||
// if (ExchangeStringUtil.isInDate(date, "00:00:00", "00:00:30")) {
|
||||
// dateStr = dateStr.substring(0, 17) + "00";
|
||||
// // System.out.println("插入时间00" + dateStr);
|
||||
// } else if (ExchangeStringUtil.isInDate(date, "00:00:30", "00:00:59")) {
|
||||
// dateStr = dateStr.substring(0, 17) + "30";
|
||||
// // System.out.println("插入时间30" + dateStr);
|
||||
// }
|
||||
try { |
||||
if (dataType == 3) { |
||||
data = decimalFormat.format(Math.abs(ExchangeStringUtil.hexToSingle(data)));//十六进制字符串转IEEE754浮点型
|
||||
} else if (dataType == 2 && (deviceCodeParam.getParamType().equals("5") |
||||
|| deviceCodeParam.getParamType().equals("2") |
||||
|| deviceCodeParam.getParamType().equals("12") |
||||
|| deviceCodeParam.getParamType().equals("14") |
||||
|| deviceCodeParam.getParamType().equals("48") |
||||
)) { |
||||
data = ExchangeStringUtil.hexToDec(data); |
||||
} |
||||
log.info("热泵==>{},寄存器地址==>{},读数==>{}", cloudId, deviceCodeParam.getRegisterAddr(), data); |
||||
return data; |
||||
} catch (Exception e) { |
||||
log.error("保存热泵数据失败!", e); |
||||
} |
||||
} else { |
||||
log.info("热泵===>{}", dataStr); |
||||
return ""; |
||||
} |
||||
return ""; |
||||
} |
||||
|
||||
public String analysisLiquidOrder485(String receiveStr, CollectionParamsManage deviceCodeParam) { |
||||
// 去掉空格
|
||||
String dataStr = receiveStr.replace(" ", "").toUpperCase(); |
||||
// 检验报文
|
||||
String checkStr = dataStr.substring(0, dataStr.length() - 4); |
||||
byte[] strOrder = ExchangeStringUtil.hexStrToBinaryStr(checkStr); |
||||
int checkNum = CRC16.CRC16_MODBUS(strOrder); |
||||
String checkWord = ExchangeStringUtil.decToHex(String.valueOf(checkNum)); |
||||
checkWord = checkWord.substring(2, 4) + checkWord.substring(0, 2); |
||||
|
||||
if (checkWord.equalsIgnoreCase(dataStr.substring(dataStr.length() - 4))) { |
||||
//创建SimpleDateFormat对象,指定样式 2019-05-13 22:39:30
|
||||
// Date date = new Date();
|
||||
// String dateStr = sdf1.format(date);
|
||||
|
||||
// 表号
|
||||
String cloudId = ExchangeStringUtil.hexToDec(dataStr.substring(0, 2)); |
||||
// 读数
|
||||
String data = ""; |
||||
data = dataStr.substring(dataStr.length() - 8, dataStr.length() - 4); |
||||
|
||||
int dataType = deviceCodeParam.getDataType(); |
||||
// if (ExchangeStringUtil.isInDate(date, "00:00:00", "00:00:30")) {
|
||||
// dateStr = dateStr.substring(0, 17) + "00";
|
||||
// //// System.out.println("插入时间00" + dateStr);
|
||||
// } else if (ExchangeStringUtil.isInDate(date, "00:00:30", "00:00:59")) {
|
||||
// dateStr = dateStr.substring(0, 17) + "30";
|
||||
// //.out.println("插入时间30" + dateStr);
|
||||
// }
|
||||
try { |
||||
if (dataType == 2 && (deviceCodeParam.getParamType().equals("11"))) { |
||||
data = ExchangeStringUtil.hexToDec(data); |
||||
BigDecimal bigDecimal = new BigDecimal(data); |
||||
bigDecimal = bigDecimal.divide(new BigDecimal((int) Math.pow(10, deviceCodeParam.getDigits()))).setScale(3, RoundingMode.HALF_UP); // 除以1000并保留整数
|
||||
data = bigDecimal.toString(); |
||||
log.info("液位==>{},寄存器地址==>{},实时读数==>{}", cloudId, deviceCodeParam.getRegisterAddr(), data); |
||||
} |
||||
// 判断data大于99999999,就返回空
|
||||
if (new BigDecimal(data).intValue() > 100) { |
||||
return ""; |
||||
} |
||||
return data; |
||||
} catch (Exception e) { |
||||
log.error("保存液位数据失败!", e); |
||||
} |
||||
} else { |
||||
log.info("液位===>{}", dataStr); |
||||
return ""; |
||||
} |
||||
return ""; |
||||
} |
||||
} |
||||
@ -1,253 +0,0 @@
|
||||
package com.mh.common.utils; |
||||
|
||||
/** |
||||
* CRC16_CCITT:多项式x16+x12+x5+1(0x1021),初始值0x0000,低位在前,高位在后,结果与0x0000异或 |
||||
* CRC16_CCITT_FALSE:多项式x16+x12+x5+1(0x1021),初始值0xFFFF,低位在后,高位在前,结果与0x0000异或 |
||||
* CRC16_XMODEM:多项式x16+x12+x5+1(0x1021),初始值0x0000,低位在后,高位在前,结果与0x0000异或 |
||||
* CRC16_X25:多项式x16+x12+x5+1(0x1021),初始值0xffff,低位在前,高位在后,结果与0xFFFF异或 |
||||
* CRC16_MODBUS:多项式x16+x15+x2+1(0x8005),初始值0xFFFF,低位在前,高位在后,结果与0x0000异或 |
||||
* CRC16_IBM:多项式x16+x15+x2+1(0x8005),初始值0x0000,低位在前,高位在后,结果与0x0000异或 |
||||
* CRC16_MAXIM:多项式x16+x15+x2+1(0x8005),初始值0x0000,低位在前,高位在后,结果与0xFFFF异或 |
||||
* CRC16_USB:多项式x16+x15+x2+1(0x8005),初始值0xFFFF,低位在前,高位在后,结果与0xFFFF异或 |
||||
* CRC16_DNP:多项式x16+x13+x12+x11+x10+x8+x6+x5+x2+1(0x3D65),初始值0x0000,低位在前,高位在后,结果与0xFFFF异或 |
||||
* <p> |
||||
* (1)、预置1个16位的寄存器为十六进制FFFF(即全为1),称此寄存器为CRC寄存器; |
||||
* (2)、把第一个8位二进制数据(既通讯信息帧的第一个字节)与16位的CRC寄存器的低8位相异或,把结果放于CRC寄存器,高八位数据不变; |
||||
* (3)、把CRC寄存器的内容右移一位(朝低位)用0填补最高位,并检查右移后的移出位; |
||||
* (4)、如果移出位为0:重复第3步(再次右移一位);如果移出位为1,CRC寄存器与多项式A001(1010 0000 0000 0001)进行异或; |
||||
* (5)、重复步骤3和4,直到右移8次,这样整个8位数据全部进行了处理; |
||||
* (6)、重复步骤2到步骤5,进行通讯信息帧下一个字节的处理; |
||||
* (7)、将该通讯信息帧所有字节按上述步骤计算完成后,得到的16位CRC寄存器的高、低字节进行交换; |
||||
* (8)、最后得到的CRC寄存器内容即为:CRC码。 |
||||
* <p> |
||||
* 以上计算步骤中的多项式0xA001是0x8005按位颠倒后的结果。 |
||||
* 0x8408是0x1021按位颠倒后的结果。 |
||||
* 在线校验工具 |
||||
* http://www.ip33.com/crc.html
|
||||
* https://blog.csdn.net/htmlxx/article/details/17369105
|
||||
* <p> |
||||
* Author:Water |
||||
* Time:2018/11/19 0019 15:03 |
||||
*/ |
||||
public class CRC16 { |
||||
|
||||
/** |
||||
* CRC16_CCITT:多项式x16+x12+x5+1(0x1021),初始值0x0000,低位在前,高位在后,结果与0x0000异或 |
||||
* 0x8408是0x1021按位颠倒后的结果。 |
||||
* |
||||
* @param buffer |
||||
* @return |
||||
*/ |
||||
public static int CRC16_CCITT(byte[] buffer) { |
||||
int wCRCin = 0x0000; |
||||
int wCPoly = 0x8408; |
||||
for (byte b : buffer) { |
||||
wCRCin ^= ((int) b & 0x00ff); |
||||
for (int j = 0; j < 8; j++) { |
||||
if ((wCRCin & 0x0001) != 0) { |
||||
wCRCin >>= 1; |
||||
wCRCin ^= wCPoly; |
||||
} else { |
||||
wCRCin >>= 1; |
||||
} |
||||
} |
||||
} |
||||
// wCRCin=(wCRCin<<8)|(wCRCin>>8);
|
||||
// wCRCin &= 0xffff;
|
||||
return wCRCin ^= 0x0000; |
||||
|
||||
} |
||||
|
||||
/** |
||||
* CRC-CCITT (0xFFFF) |
||||
* CRC16_CCITT_FALSE:多项式x16+x12+x5+1(0x1021),初始值0xFFFF,低位在后,高位在前,结果与0x0000异或 |
||||
* |
||||
* @param buffer |
||||
* @return |
||||
*/ |
||||
public static int CRC16_CCITT_FALSE(byte[] buffer) { |
||||
int wCRCin = 0xffff; |
||||
int wCPoly = 0x1021; |
||||
for (byte b : buffer) { |
||||
for (int i = 0; i < 8; i++) { |
||||
boolean bit = ((b >> (7 - i) & 1) == 1); |
||||
boolean c15 = ((wCRCin >> 15 & 1) == 1); |
||||
wCRCin <<= 1; |
||||
if (c15 ^ bit) |
||||
wCRCin ^= wCPoly; |
||||
} |
||||
} |
||||
wCRCin &= 0xffff; |
||||
return wCRCin ^= 0x0000; |
||||
} |
||||
|
||||
/** |
||||
* CRC-CCITT (XModem) |
||||
* CRC16_XMODEM:多项式x16+x12+x5+1(0x1021),初始值0x0000,低位在后,高位在前,结果与0x0000异或 |
||||
* |
||||
* @param buffer |
||||
* @return |
||||
*/ |
||||
public static int CRC16_XMODEM(byte[] buffer) { |
||||
int wCRCin = 0x0000; // initial value 65535
|
||||
int wCPoly = 0x1021; // 0001 0000 0010 0001 (0, 5, 12)
|
||||
for (byte b : buffer) { |
||||
for (int i = 0; i < 8; i++) { |
||||
boolean bit = ((b >> (7 - i) & 1) == 1); |
||||
boolean c15 = ((wCRCin >> 15 & 1) == 1); |
||||
wCRCin <<= 1; |
||||
if (c15 ^ bit) |
||||
wCRCin ^= wCPoly; |
||||
} |
||||
} |
||||
wCRCin &= 0xffff; |
||||
return wCRCin ^= 0x0000; |
||||
} |
||||
|
||||
|
||||
/** |
||||
* CRC16_X25:多项式x16+x12+x5+1(0x1021),初始值0xffff,低位在前,高位在后,结果与0xFFFF异或 |
||||
* 0x8408是0x1021按位颠倒后的结果。 |
||||
* |
||||
* @param buffer |
||||
* @return |
||||
*/ |
||||
public static int CRC16_X25(byte[] buffer) { |
||||
int wCRCin = 0xffff; |
||||
int wCPoly = 0x8408; |
||||
for (byte b : buffer) { |
||||
wCRCin ^= ((int) b & 0x00ff); |
||||
for (int j = 0; j < 8; j++) { |
||||
if ((wCRCin & 0x0001) != 0) { |
||||
wCRCin >>= 1; |
||||
wCRCin ^= wCPoly; |
||||
} else { |
||||
wCRCin >>= 1; |
||||
} |
||||
} |
||||
} |
||||
return wCRCin ^= 0xffff; |
||||
} |
||||
|
||||
/** |
||||
* CRC-16 (Modbus) |
||||
* CRC16_MODBUS:多项式x16+x15+x2+1(0x8005),初始值0xFFFF,低位在前,高位在后,结果与0x0000异或 |
||||
* 0xA001是0x8005按位颠倒后的结果 |
||||
* |
||||
* @param buffer |
||||
* @return |
||||
*/ |
||||
public static int CRC16_MODBUS(byte[] buffer) { |
||||
int wCRCin = 0xffff; |
||||
int POLYNOMIAL = 0xa001; |
||||
for (byte b : buffer) { |
||||
wCRCin ^= ((int) b & 0x00ff); |
||||
for (int j = 0; j < 8; j++) { |
||||
if ((wCRCin & 0x0001) != 0) { |
||||
wCRCin >>= 1; |
||||
wCRCin ^= POLYNOMIAL; |
||||
} else { |
||||
wCRCin >>= 1; |
||||
} |
||||
} |
||||
} |
||||
return wCRCin ^= 0x0000; |
||||
} |
||||
|
||||
/** |
||||
* CRC-16 |
||||
* CRC16_IBM:多项式x16+x15+x2+1(0x8005),初始值0x0000,低位在前,高位在后,结果与0x0000异或 |
||||
* 0xA001是0x8005按位颠倒后的结果 |
||||
* |
||||
* @param buffer |
||||
* @return |
||||
*/ |
||||
public static int CRC16_IBM(byte[] buffer) { |
||||
int wCRCin = 0x0000; |
||||
int wCPoly = 0xa001; |
||||
for (byte b : buffer) { |
||||
wCRCin ^= ((int) b & 0x00ff); |
||||
for (int j = 0; j < 8; j++) { |
||||
if ((wCRCin & 0x0001) != 0) { |
||||
wCRCin >>= 1; |
||||
wCRCin ^= wCPoly; |
||||
} else { |
||||
wCRCin >>= 1; |
||||
} |
||||
} |
||||
} |
||||
return wCRCin ^= 0x0000; |
||||
} |
||||
|
||||
/** |
||||
* CRC16_MAXIM:多项式x16+x15+x2+1(0x8005),初始值0x0000,低位在前,高位在后,结果与0xFFFF异或 |
||||
* 0xA001是0x8005按位颠倒后的结果 |
||||
* |
||||
* @param buffer |
||||
* @return |
||||
*/ |
||||
public static int CRC16_MAXIM(byte[] buffer) { |
||||
int wCRCin = 0x0000; |
||||
int wCPoly = 0xa001; |
||||
for (byte b : buffer) { |
||||
wCRCin ^= ((int) b & 0x00ff); |
||||
for (int j = 0; j < 8; j++) { |
||||
if ((wCRCin & 0x0001) != 0) { |
||||
wCRCin >>= 1; |
||||
wCRCin ^= wCPoly; |
||||
} else { |
||||
wCRCin >>= 1; |
||||
} |
||||
} |
||||
} |
||||
return wCRCin ^= 0xffff; |
||||
} |
||||
|
||||
/** |
||||
* CRC16_USB:多项式x16+x15+x2+1(0x8005),初始值0xFFFF,低位在前,高位在后,结果与0xFFFF异或 |
||||
* 0xA001是0x8005按位颠倒后的结果 |
||||
* |
||||
* @param buffer |
||||
* @return |
||||
*/ |
||||
public static int CRC16_USB(byte[] buffer) { |
||||
int wCRCin = 0xFFFF; |
||||
int wCPoly = 0xa001; |
||||
for (byte b : buffer) { |
||||
wCRCin ^= ((int) b & 0x00ff); |
||||
for (int j = 0; j < 8; j++) { |
||||
if ((wCRCin & 0x0001) != 0) { |
||||
wCRCin >>= 1; |
||||
wCRCin ^= wCPoly; |
||||
} else { |
||||
wCRCin >>= 1; |
||||
} |
||||
} |
||||
} |
||||
return wCRCin ^= 0xffff; |
||||
} |
||||
|
||||
/** |
||||
* CRC16_DNP:多项式x16+x13+x12+x11+x10+x8+x6+x5+x2+1(0x3D65),初始值0x0000,低位在前,高位在后,结果与0xFFFF异或 |
||||
* 0xA6BC是0x3D65按位颠倒后的结果 |
||||
* |
||||
* @param buffer |
||||
* @return |
||||
*/ |
||||
public static int CRC16_DNP(byte[] buffer) { |
||||
int wCRCin = 0x0000; |
||||
int wCPoly = 0xA6BC; |
||||
for (byte b : buffer) { |
||||
wCRCin ^= ((int) b & 0x00ff); |
||||
for (int j = 0; j < 8; j++) { |
||||
if ((wCRCin & 0x0001) != 0) { |
||||
wCRCin >>= 1; |
||||
wCRCin ^= wCPoly; |
||||
} else { |
||||
wCRCin >>= 1; |
||||
} |
||||
} |
||||
} |
||||
return wCRCin ^= 0xffff; |
||||
} |
||||
} |
||||
File diff suppressed because it is too large
Load Diff
@ -1,67 +0,0 @@
|
||||
package com.mh.common.utils; |
||||
|
||||
import io.netty.buffer.ByteBuf; |
||||
import io.netty.buffer.Unpooled; |
||||
import io.netty.channel.ChannelHandlerContext; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project EEMCS |
||||
* @description Modbus协议工具类 |
||||
* @date 2025-06-06 14:40:24 |
||||
*/ |
||||
@Slf4j |
||||
public class ModbusUtils { |
||||
|
||||
public static String createReadOrder(String mtCode, String funCode, String registerAddr, String registerNum) { |
||||
// 开始创建指令
|
||||
// 拼接指令
|
||||
String sendOrderStr = ExchangeStringUtil.addZeroForNum(mtCode, 2) |
||||
+ ExchangeStringUtil.addZeroForNum(funCode, 2) |
||||
+ ExchangeStringUtil.addZeroForNum(registerAddr, 4) |
||||
+ ExchangeStringUtil.addZeroForNum(registerNum, 4); |
||||
byte[] strOrder = ExchangeStringUtil.hexStrToBinaryStr(sendOrderStr); |
||||
int checkNum = CRC16.CRC16_MODBUS(strOrder); |
||||
String checkWord = ExchangeStringUtil.decToHex(String.valueOf(checkNum)); |
||||
checkWord = checkWord.substring(2, 4) + checkWord.substring(0, 2); |
||||
sendOrderStr = sendOrderStr + checkWord; |
||||
return sendOrderStr; |
||||
} |
||||
|
||||
public static String createControlCode(String mtCode, Integer type, String registerAddr, String param) { |
||||
String orderStr; |
||||
mtCode = ExchangeStringUtil.addZeroForNum(mtCode, 2); |
||||
registerAddr = ExchangeStringUtil.addZeroForNum(registerAddr, 4); |
||||
param = ExchangeStringUtil.addZeroForNum(ExchangeStringUtil.decToHex(param), 4); |
||||
orderStr = mtCode + "06" + registerAddr + param; |
||||
byte[] strOrder = ExchangeStringUtil.hexStrToBinaryStr(orderStr); |
||||
int checkNum = CRC16.CRC16_MODBUS(strOrder); |
||||
String checkWord = ExchangeStringUtil.decToHex(String.valueOf(checkNum)); |
||||
checkWord = checkWord.substring(2, 4) + checkWord.substring(0, 2); |
||||
// 发送的指令
|
||||
log.info("发送指令:{}", orderStr+checkWord); |
||||
return orderStr + checkWord; |
||||
} |
||||
|
||||
public static ByteBuf getByteBuf(ChannelHandlerContext ctx, String sendStr) { |
||||
// byte类型的数据
|
||||
// String sendStr = "5803004900021914"; // 冷量计
|
||||
// 申请一个数据结构存储信息
|
||||
ByteBuf buffer = ctx.alloc().buffer(); |
||||
// 将信息放入数据结构中
|
||||
buffer.writeBytes(ExchangeStringUtil.hexStrToBinaryStr(sendStr));//对接需要16进制
|
||||
return buffer; |
||||
} |
||||
|
||||
public static ByteBuf createByteBuf(String sendStr) { |
||||
// byte类型的数据
|
||||
// String sendStr = "5803004900021914"; // 冷量计
|
||||
// 申请一个数据结构存储信息
|
||||
ByteBuf buffer = Unpooled.buffer(); |
||||
// 将信息放入数据结构中
|
||||
buffer.writeBytes(ExchangeStringUtil.hexStrToBinaryStr(sendStr));//对接需要16进制
|
||||
return buffer; |
||||
} |
||||
} |
||||
@ -1,77 +0,0 @@
|
||||
package com.mh.common.utils; |
||||
|
||||
|
||||
import com.google.common.cache.Cache; |
||||
import com.google.common.cache.CacheBuilder; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
import org.apache.commons.lang3.StringUtils; |
||||
|
||||
import java.util.Objects; |
||||
import java.util.concurrent.BlockingQueue; |
||||
import java.util.concurrent.LinkedBlockingQueue; |
||||
import java.util.concurrent.TimeUnit; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project TAD_Server |
||||
* @description 缓存等待数据 |
||||
* @date 2023/7/4 08:45:16 |
||||
*/ |
||||
@Slf4j |
||||
public class NettyTools { |
||||
|
||||
/** |
||||
* 响应消息缓存 |
||||
*/ |
||||
private static final Cache<String, BlockingQueue<String>> responseMsgCache = CacheBuilder.newBuilder() |
||||
.maximumSize(500) |
||||
.expireAfterWrite(1000, TimeUnit.SECONDS) |
||||
.build(); |
||||
|
||||
|
||||
/** |
||||
* 等待响应消息 |
||||
* @param key 消息唯一标识 |
||||
* @return ReceiveDdcMsgVo |
||||
*/ |
||||
public static boolean waitReceiveMsg(String key) { |
||||
|
||||
try { |
||||
//设置超时时间
|
||||
String vo = Objects.requireNonNull(responseMsgCache.getIfPresent(key)) |
||||
.poll(1000 * 10, TimeUnit.MILLISECONDS); |
||||
|
||||
//删除key
|
||||
responseMsgCache.invalidate(key); |
||||
return StringUtils.isNotBlank(vo); |
||||
} catch (Exception e) { |
||||
log.error("获取数据异常,sn={},msg=null",key); |
||||
return false; |
||||
} |
||||
|
||||
} |
||||
|
||||
/** |
||||
* 初始化响应消息的队列 |
||||
* @param key 消息唯一标识 |
||||
*/ |
||||
public static void initReceiveMsg(String key) { |
||||
responseMsgCache.put(key,new LinkedBlockingQueue<String>(1)); |
||||
} |
||||
|
||||
/** |
||||
* 设置响应消息 |
||||
* @param key 消息唯一标识 |
||||
*/ |
||||
public static void setReceiveMsg(String key, String msg) { |
||||
|
||||
if(responseMsgCache.getIfPresent(key) != null){ |
||||
Objects.requireNonNull(responseMsgCache.getIfPresent(key)).add(msg); |
||||
return; |
||||
} |
||||
|
||||
log.warn("sn {}不存在",key); |
||||
} |
||||
|
||||
} |
||||
@ -1,64 +0,0 @@
|
||||
package com.mh.common.utils; |
||||
|
||||
import com.mh.common.core.domain.entity.CollectionParamsManage; |
||||
import io.netty.buffer.ByteBuf; |
||||
import io.netty.channel.ChannelHandlerContext; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
|
||||
/** |
||||
* @author ljf |
||||
* @title : |
||||
* @description : 发送指令工具类 |
||||
* @updateTime 2021-01-26 |
||||
* @throws : |
||||
*/ |
||||
@Slf4j |
||||
public class SendOrderUtils { |
||||
|
||||
// 发送所有类型采集报文
|
||||
public static void sendAllOrder(CollectionParamsManage paramsManage, ChannelHandlerContext ctx, int num, int size) { |
||||
// 开始创建指令
|
||||
String mtCode = paramsManage.getMtCode(); // 采集编号
|
||||
String funCode = paramsManage.getFuncCode(); // 功能码
|
||||
String registerAddr = paramsManage.getRegisterAddr(); // 寄存器地址
|
||||
String registerNum = String.valueOf(paramsManage.getRegisterSize()); // 寄存器数量
|
||||
// 拼接指令
|
||||
String sendOrderStr = ExchangeStringUtil.addZeroForNum(ExchangeStringUtil.decToHex(mtCode), 2) |
||||
+ ExchangeStringUtil.addZeroForNum(funCode, 2) |
||||
+ ExchangeStringUtil.addZeroForNum(registerAddr, 4) |
||||
+ ExchangeStringUtil.addZeroForNum(registerNum, 4); |
||||
byte[] strOrder = ExchangeStringUtil.hexStrToBinaryStr(sendOrderStr); |
||||
int checkNum = CRC16.CRC16_MODBUS(strOrder); |
||||
String checkWord = ExchangeStringUtil.decToHex(String.valueOf(checkNum)); |
||||
checkWord = checkWord.substring(2, 4) + checkWord.substring(0, 2); |
||||
sendOrderStr = sendOrderStr + checkWord; |
||||
ByteBuf buffer = getByteBuf(ctx, sendOrderStr); |
||||
// 发送数据
|
||||
ctx.channel().writeAndFlush(buffer); |
||||
log.info("sends :" + sendOrderStr + ",num:" + num + ",records:" + size); |
||||
try { |
||||
Thread.sleep(500); |
||||
} catch (InterruptedException e) { |
||||
log.error("线程休眠异常", e); |
||||
} |
||||
} |
||||
|
||||
private static ByteBuf getByteBuf(ChannelHandlerContext ctx, String sendStr) { |
||||
// 申请一个数据结构存储信息
|
||||
ByteBuf buffer = ctx.alloc().buffer(); |
||||
// 将信息放入数据结构中
|
||||
buffer.writeBytes(ExchangeStringUtil.hexStrToBinaryStr(sendStr));//对接需要16进制
|
||||
return buffer; |
||||
} |
||||
|
||||
public static void sendOrderToDTU(ChannelHandlerContext ctx, String sendStr) { |
||||
ByteBuf buffer = getByteBuf(ctx, sendStr); |
||||
// 发送数据
|
||||
ctx.channel().writeAndFlush(buffer); |
||||
try { |
||||
Thread.sleep(500); |
||||
} catch (InterruptedException e) { |
||||
log.error("线程休眠异常", e); |
||||
} |
||||
} |
||||
} |
||||
@ -1,81 +0,0 @@
|
||||
package com.mh.common.utils.file.handle; |
||||
|
||||
import com.alibaba.excel.metadata.Head; |
||||
import com.alibaba.excel.metadata.data.WriteCellData; |
||||
import com.alibaba.excel.write.handler.CellWriteHandler; |
||||
import com.alibaba.excel.write.metadata.holder.WriteSheetHolder; |
||||
import com.alibaba.excel.write.metadata.holder.WriteTableHolder; |
||||
import org.apache.poi.ss.usermodel.Cell; |
||||
import org.apache.poi.ss.usermodel.Row; |
||||
import org.apache.poi.ss.usermodel.Sheet; |
||||
import org.apache.poi.ss.util.CellRangeAddress; |
||||
|
||||
import java.util.HashMap; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project NewZhujiang_Server |
||||
* @description 列合并 |
||||
* @date 2024-06-03 10:01:07 |
||||
*/ |
||||
public class ExcelFillCellMergeHandler implements CellWriteHandler { |
||||
private static final String KEY ="%s-%s"; |
||||
//所有的合并信息都存在了这个map里面
|
||||
Map<String, Integer> mergeInfo = new HashMap<>(); |
||||
|
||||
public ExcelFillCellMergeHandler() { |
||||
} |
||||
public ExcelFillCellMergeHandler(Map<String, Integer> mergeInfo) { |
||||
this.mergeInfo = mergeInfo; |
||||
} |
||||
|
||||
@Override |
||||
public void beforeCellCreate(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder, Row row, Head head, Integer integer, Integer integer1, Boolean aBoolean) { |
||||
|
||||
} |
||||
|
||||
@Override |
||||
public void afterCellCreate(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder, Cell cell, Head head, Integer integer, Boolean aBoolean) { |
||||
|
||||
} |
||||
|
||||
@Override |
||||
public void afterCellDataConverted(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder, WriteCellData<?> cellData, Cell cell, Head head, Integer relativeRowIndex, Boolean isHead) { |
||||
} |
||||
|
||||
@Override |
||||
public void afterCellDispose(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder, List<WriteCellData<?>> cellDataList, Cell cell, Head head, Integer relativeRowIndex, Boolean isHead) { |
||||
|
||||
//当前行
|
||||
int curRowIndex = cell.getRowIndex(); |
||||
//当前列
|
||||
int curColIndex = cell.getColumnIndex(); |
||||
|
||||
Integer num = mergeInfo.get(String.format(KEY, curRowIndex, curColIndex)); |
||||
if(null != num){ |
||||
// 合并最后一行 ,列
|
||||
mergeWithPrevCol(writeSheetHolder, cell, curRowIndex, curColIndex,num); |
||||
} |
||||
} |
||||
|
||||
public void mergeWithPrevCol(WriteSheetHolder writeSheetHolder, Cell cell, int curRowIndex, int curColIndex, int num) { |
||||
Sheet sheet = writeSheetHolder.getSheet(); |
||||
CellRangeAddress cellRangeAddress = new CellRangeAddress(curRowIndex, curRowIndex, curColIndex, curColIndex + num); |
||||
sheet.addMergedRegion(cellRangeAddress); |
||||
} |
||||
|
||||
//num从第几列开始增加多少列
|
||||
// curRowIndex 在第几行进行行合并
|
||||
// curColIndex 在第几列进行合并
|
||||
// num 合并多少格
|
||||
// 比如我上图中中心需要在第三行 从0列开始合并三列 所以我可以传入 (3,0,2)
|
||||
public void add (int curRowIndex, int curColIndex , int num){ |
||||
mergeInfo.put(String.format(KEY, curRowIndex, curColIndex),num); |
||||
} |
||||
|
||||
|
||||
|
||||
} |
||||
@ -1,49 +0,0 @@
|
||||
package com.mh.common.utils.file.handle; |
||||
|
||||
import com.alibaba.excel.metadata.Head; |
||||
import com.alibaba.excel.write.handler.CellWriteHandler; |
||||
import com.alibaba.excel.write.metadata.holder.WriteSheetHolder; |
||||
import com.alibaba.excel.write.metadata.holder.WriteTableHolder; |
||||
import org.apache.commons.collections4.CollectionUtils; |
||||
import org.apache.poi.ss.usermodel.Row; |
||||
import org.springframework.util.PropertyPlaceholderHelper; |
||||
|
||||
import java.util.List; |
||||
import java.util.Properties; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project NewZhujiang_Server |
||||
* @description 报表handle |
||||
* @date 2024-05-31 17:36:38 |
||||
*/ |
||||
public class ReportDayAndMonthParamHandler implements CellWriteHandler { |
||||
|
||||
private final String title; |
||||
|
||||
private final String value; |
||||
|
||||
PropertyPlaceholderHelper placeholderHelper = new PropertyPlaceholderHelper("${", "}"); |
||||
|
||||
public ReportDayAndMonthParamHandler(String value, String title) { |
||||
this.title = title; |
||||
this.value = value; |
||||
} |
||||
|
||||
@Override |
||||
public void beforeCellCreate(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder, |
||||
Row row, Head head, Integer integer, Integer integer1, Boolean aBoolean) { |
||||
if (head != null) { |
||||
List<String> headNameList = head.getHeadNameList(); |
||||
if (CollectionUtils.isNotEmpty(headNameList)) { |
||||
Properties properties = new Properties(); |
||||
properties.setProperty(title, value); |
||||
for (int i = 0; i < headNameList.size(); i++) { |
||||
headNameList.set(i, placeholderHelper.replacePlaceholders(headNameList.get(i), properties)); |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
||||
} |
||||
@ -1,46 +0,0 @@
|
||||
package com.mh.common.utils.file.handle; |
||||
|
||||
import com.alibaba.excel.metadata.Head; |
||||
import com.alibaba.excel.write.handler.CellWriteHandler; |
||||
import com.alibaba.excel.write.metadata.holder.WriteSheetHolder; |
||||
import com.alibaba.excel.write.metadata.holder.WriteTableHolder; |
||||
import org.apache.commons.collections4.CollectionUtils; |
||||
import org.apache.poi.ss.usermodel.Row; |
||||
import org.springframework.util.PropertyPlaceholderHelper; |
||||
|
||||
import java.util.List; |
||||
import java.util.Properties; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project NewZhujiang_Server |
||||
* @description 报表handle |
||||
* @date 2024-05-31 17:36:38 |
||||
*/ |
||||
public class ReportSysParamHandler implements CellWriteHandler { |
||||
|
||||
private final String title; |
||||
|
||||
PropertyPlaceholderHelper placeholderHelper = new PropertyPlaceholderHelper("${", "}"); |
||||
|
||||
public ReportSysParamHandler(String title) { |
||||
this.title = title; |
||||
} |
||||
|
||||
@Override |
||||
public void beforeCellCreate(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder, |
||||
Row row, Head head, Integer integer, Integer integer1, Boolean aBoolean) { |
||||
if (head != null) { |
||||
List<String> headNameList = head.getHeadNameList(); |
||||
if (CollectionUtils.isNotEmpty(headNameList)) { |
||||
Properties properties = new Properties(); |
||||
properties.setProperty("deviceType", title); |
||||
for (int i = 0; i < headNameList.size(); i++) { |
||||
headNameList.set(i, placeholderHelper.replacePlaceholders(headNameList.get(i), properties)); |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
||||
} |
||||
@ -1,25 +0,0 @@
|
||||
package com.mh.common.utils.file.handle; |
||||
|
||||
import com.alibaba.excel.write.style.row.AbstractRowHeightStyleStrategy; |
||||
import org.apache.poi.ss.usermodel.Row; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project NewZhujiang_Server |
||||
* @description 处理行高 |
||||
* @date 2024-08-09 15:03:37 |
||||
*/ |
||||
public class RowHeightStyleHandler extends AbstractRowHeightStyleStrategy { |
||||
@Override |
||||
protected void setHeadColumnHeight(Row row, int i) { |
||||
if (i == 2) { |
||||
row.setHeightInPoints(70); |
||||
} |
||||
} |
||||
|
||||
@Override |
||||
protected void setContentColumnHeight(Row row, int i) { |
||||
|
||||
} |
||||
} |
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue