Compare commits
127 Commits
prod
...
85b370ea4c
| Author | SHA1 | Date | |
|---|---|---|---|
| 85b370ea4c | |||
| c6fca8b939 | |||
| e73787ee8f | |||
| 0e1c7f52f1 | |||
| 73c668709a | |||
| 3488808786 | |||
| 497e5bb8ca | |||
| 678e814350 | |||
| 5f1e621da2 | |||
| b7aaf85a3f | |||
| 28dfb0c152 | |||
| fc5f56b3b0 | |||
| 3313c7f9cd | |||
| 70c990051b | |||
| b4b78e03b1 | |||
| 3605702209 | |||
| 62340387bb | |||
| a31b607872 | |||
| 8e631b7b30 | |||
| 3735c4f4d8 | |||
| c068e7d4ab | |||
| b38bc36ad6 | |||
| d9c0ff733a | |||
| e87abc2807 | |||
| a5e977c0d1 | |||
| 7298acc785 | |||
| 55d648d12c | |||
| 36f08e5f06 | |||
| 1cc7d53559 | |||
| 3753075b10 | |||
| aab2b1d94e | |||
| 3ee99fa8d4 | |||
| c62aa46fcb | |||
| bfbb0ae475 | |||
| 25e03ab028 | |||
| 38ade0c2ed | |||
| f1e819ba2b | |||
| be4da8c58d | |||
| fa280097eb | |||
| 1b5fcea5cd | |||
| 49a83fd420 | |||
| 5381cd597c | |||
| 43edc47aaa | |||
| 72c7c0c3e0 | |||
| c2682f38a8 | |||
| 3598cb2d66 | |||
| 82e63e28d3 | |||
| 614cca4297 | |||
| d83af112e7 | |||
| 75bd5f6bf2 | |||
| 0108b4f108 | |||
| 4a0075b606 | |||
| b776f6ff76 | |||
| 76b30c715c | |||
| e1fb6e30ac | |||
| a338c921d3 | |||
| 4ad2cafc5d | |||
| d0275e62e0 | |||
| 94e18c029c | |||
| 391ed354f8 | |||
| 6716852435 | |||
| 451b2f6766 | |||
| 250318ddef | |||
| d468ef9941 | |||
| 15b964b4ce | |||
| 3020f9f915 | |||
| 609803605d | |||
| aadf66d5ad | |||
| 049eaa84b7 | |||
| c438f50ae1 | |||
| eed6f839f6 | |||
| 6ebeb48b62 | |||
| 3454359f01 | |||
| 83f8f4e293 | |||
| b79f9caa2d | |||
| e33b26fc05 | |||
| 9075878e41 | |||
| 158bc1a51d | |||
| b861ad7593 | |||
| 636a2ab73b | |||
| d8d0a83c87 | |||
| 7121fdecfa | |||
| 2bbc0abc08 | |||
| e5a2ce4c8d | |||
| f2b2741b1c | |||
| 097709d403 | |||
| 33534cc500 | |||
| ee53ab137b | |||
| b2d5023122 | |||
| 553e30c6ef | |||
| 102ecbd41c | |||
| d47d9150e6 | |||
| 46135aa2ec | |||
| 9874d6b1ea | |||
| f7515b221b | |||
| f3b34e7fb5 | |||
| 2810f5e204 | |||
| 7cd5a9b131 | |||
| 2099b94e73 | |||
| 630f77a783 | |||
| 8e8c57cb64 | |||
| a5f1444984 | |||
| e93f9cc6b8 | |||
| 8954329ccc | |||
| b8d3643ba9 | |||
| 2451e00022 | |||
| cb39131871 | |||
| 2bb78dc020 | |||
| d807b9117d | |||
| 8a4cff0a6c | |||
| ecbe55cdbf | |||
| bfdbc4f42c | |||
| ab6771d33d | |||
| 2344cc458c | |||
| aa37e2a881 | |||
| 15e230babb | |||
| 7374d7708b | |||
| 26bbe6deee | |||
| 1a1558f8cd | |||
| d6276dc21f | |||
| 725ae14548 | |||
| b2527507e4 | |||
| ff058dceaf | |||
| 76d0634ae8 | |||
| eb72542b67 | |||
| 7927066058 | |||
| 08c83c1a37 |
@ -39,8 +39,9 @@
|
||||
|
||||
<!-- Mysql驱动包 -->
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<groupId>com.mysql</groupId>
|
||||
<artifactId>mysql-connector-j</artifactId>
|
||||
<version>8.0.33</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 核心模块-->
|
||||
|
||||
@ -0,0 +1,82 @@
|
||||
package com.xzzn.web.controller.ems;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.xzzn.ems.domain.vo.EnergyPriceVo;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.xzzn.common.annotation.Log;
|
||||
import com.xzzn.common.core.controller.BaseController;
|
||||
import com.xzzn.common.core.domain.AjaxResult;
|
||||
import com.xzzn.common.enums.BusinessType;
|
||||
import com.xzzn.ems.service.IEmsEnergyPriceConfigService;
|
||||
import com.xzzn.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 电价配置Controller
|
||||
*
|
||||
* @author xzzn
|
||||
* @date 2025-09-28
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/ems/energyPriceConfig")
|
||||
public class EmsEnergyPriceConfigController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IEmsEnergyPriceConfigService emsEnergyPriceConfigService;
|
||||
|
||||
/**
|
||||
* 查询电价配置列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:config:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(String siteId, String startTime,String endTime)
|
||||
{
|
||||
List<EnergyPriceVo> list = emsEnergyPriceConfigService.selectEmsEnergyPriceConfigList(siteId,startTime,endTime);
|
||||
return getDataTable2(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取电价配置详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:config:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(emsEnergyPriceConfigService.selectEmsEnergyPriceConfigById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增电价配置
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:config:add')")
|
||||
@Log(title = "电价配置", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody EnergyPriceVo priceVo)
|
||||
{
|
||||
return toAjax(emsEnergyPriceConfigService.insertEmsEnergyPriceConfig(priceVo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改电价配置
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:config:edit')")
|
||||
@Log(title = "电价配置", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody EnergyPriceVo priceVo)
|
||||
{
|
||||
return toAjax(emsEnergyPriceConfigService.updateEmsEnergyPriceConfig(priceVo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除电价配置
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:config:remove')")
|
||||
@Log(title = "电价配置", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(emsEnergyPriceConfigService.deleteEmsEnergyPriceConfigByIds(ids));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,107 @@
|
||||
package com.xzzn.web.controller.ems;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.xzzn.ems.service.IEmsFaultProtectionPlanService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.xzzn.common.annotation.Log;
|
||||
import com.xzzn.common.core.controller.BaseController;
|
||||
import com.xzzn.common.core.domain.AjaxResult;
|
||||
import com.xzzn.common.enums.BusinessType;
|
||||
import com.xzzn.ems.domain.EmsFaultProtectionPlan;
|
||||
import com.xzzn.common.utils.poi.ExcelUtil;
|
||||
import com.xzzn.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 故障告警保护方案Controller
|
||||
*
|
||||
* @author xzzn
|
||||
* @date 2025-10-22
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/ems/protectPlan")
|
||||
public class EmsFaultProtectionPlanController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IEmsFaultProtectionPlanService emsFaultProtectionPlanService;
|
||||
|
||||
/**
|
||||
* 查询故障告警保护方案列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:plan:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(EmsFaultProtectionPlan emsFaultProtectionPlan)
|
||||
{
|
||||
startPage();
|
||||
List<EmsFaultProtectionPlan> list = emsFaultProtectionPlanService.selectEmsFaultProtectionPlanList(emsFaultProtectionPlan);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出故障告警保护方案列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:plan:export')")
|
||||
@Log(title = "故障告警保护方案", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, EmsFaultProtectionPlan emsFaultProtectionPlan)
|
||||
{
|
||||
List<EmsFaultProtectionPlan> list = emsFaultProtectionPlanService.selectEmsFaultProtectionPlanList(emsFaultProtectionPlan);
|
||||
ExcelUtil<EmsFaultProtectionPlan> util = new ExcelUtil<EmsFaultProtectionPlan>(EmsFaultProtectionPlan.class);
|
||||
util.exportExcel(response, list, "故障告警保护方案数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取故障告警保护方案详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:plan:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(emsFaultProtectionPlanService.selectEmsFaultProtectionPlanById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增故障告警保护方案
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:plan:add')")
|
||||
@Log(title = "故障告警保护方案", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody EmsFaultProtectionPlan emsFaultProtectionPlan)
|
||||
{
|
||||
emsFaultProtectionPlan.setCreateBy(getUsername());
|
||||
return toAjax(emsFaultProtectionPlanService.insertEmsFaultProtectionPlan(emsFaultProtectionPlan));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改故障告警保护方案
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:plan:edit')")
|
||||
@Log(title = "故障告警保护方案", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody EmsFaultProtectionPlan emsFaultProtectionPlan)
|
||||
{
|
||||
emsFaultProtectionPlan.setUpdateBy(getUsername());
|
||||
return toAjax(emsFaultProtectionPlanService.updateEmsFaultProtectionPlan(emsFaultProtectionPlan));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除故障告警保护方案
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:plan:remove')")
|
||||
@Log(title = "故障告警保护方案", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(emsFaultProtectionPlanService.deleteEmsFaultProtectionPlanByIds(ids));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,78 @@
|
||||
package com.xzzn.web.controller.ems;
|
||||
|
||||
import com.xzzn.common.core.controller.BaseController;
|
||||
import com.xzzn.common.core.domain.AjaxResult;
|
||||
import com.xzzn.common.enums.DeviceCategory;
|
||||
import com.xzzn.ems.domain.vo.*;
|
||||
import com.xzzn.ems.service.IGeneralQueryService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
*
|
||||
* 综合查询
|
||||
*
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/ems/generalQuery")
|
||||
public class EmsGeneralQueryController extends BaseController{
|
||||
|
||||
@Autowired
|
||||
private IGeneralQueryService iGeneralQueryService;
|
||||
|
||||
/**
|
||||
* 获取设备枚举
|
||||
*/
|
||||
@GetMapping("/getAllDeviceCategory")
|
||||
public AjaxResult getDeviceCategory()
|
||||
{
|
||||
// 获取所有枚举的信息
|
||||
List<Map<String, String>> deviceCategoryList = new ArrayList<>();
|
||||
for (DeviceCategory category : DeviceCategory.values()) {
|
||||
Map<String, String> categoryMap = new HashMap<>();
|
||||
categoryMap.put("name", category.getInfo());
|
||||
categoryMap.put("code", category.getCode());
|
||||
deviceCategoryList.add(categoryMap);
|
||||
}
|
||||
return success(deviceCategoryList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 点位模糊查询
|
||||
*/
|
||||
@PostMapping("/pointFuzzyQuery")
|
||||
public AjaxResult pointFuzzyQuery(@RequestBody PointNameRequest request)
|
||||
{
|
||||
return success(iGeneralQueryService.getPointNameList(request));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据点位查询点位数据变化
|
||||
*/
|
||||
@PostMapping("/getPointValueList")
|
||||
public AjaxResult getPointValueList(@RequestBody PointNameRequest request)
|
||||
{
|
||||
List<GeneralQueryResponse> result = new ArrayList<>();
|
||||
try {
|
||||
result = iGeneralQueryService.getPointValueList(request);
|
||||
} catch (Exception e) {
|
||||
logger.error("<UNK>",e);
|
||||
return error("报错请重试!");
|
||||
}
|
||||
return success(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取设备枚举
|
||||
*/
|
||||
@GetMapping("/getAllBatteryIdsBySites/{siteIds}")
|
||||
public AjaxResult getAllBatteryIdsBySites(@PathVariable String[] siteIds)
|
||||
{
|
||||
return success(iGeneralQueryService.getAllBatteryIdsBySites(siteIds));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,106 @@
|
||||
package com.xzzn.web.controller.ems;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.xzzn.common.annotation.Log;
|
||||
import com.xzzn.common.core.controller.BaseController;
|
||||
import com.xzzn.common.core.domain.AjaxResult;
|
||||
import com.xzzn.common.enums.BusinessType;
|
||||
import com.xzzn.ems.domain.EmsMqttTopicConfig;
|
||||
import com.xzzn.ems.service.IEmsMqttTopicConfigService;
|
||||
import com.xzzn.common.utils.poi.ExcelUtil;
|
||||
import com.xzzn.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 站点topic配置Controller
|
||||
*
|
||||
* @author xzzn
|
||||
* @date 2025-11-06
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/ems/mqttConfig")
|
||||
public class EmsMqttTopicConfigController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IEmsMqttTopicConfigService emsMqttTopicConfigService;
|
||||
|
||||
/**
|
||||
* 查询站点topic配置列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:config:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(EmsMqttTopicConfig emsMqttTopicConfig)
|
||||
{
|
||||
startPage();
|
||||
List<EmsMqttTopicConfig> list = emsMqttTopicConfigService.selectEmsMqttTopicConfigList(emsMqttTopicConfig);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出站点topic配置列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:config:export')")
|
||||
@Log(title = "站点topic配置", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, EmsMqttTopicConfig emsMqttTopicConfig)
|
||||
{
|
||||
List<EmsMqttTopicConfig> list = emsMqttTopicConfigService.selectEmsMqttTopicConfigList(emsMqttTopicConfig);
|
||||
ExcelUtil<EmsMqttTopicConfig> util = new ExcelUtil<EmsMqttTopicConfig>(EmsMqttTopicConfig.class);
|
||||
util.exportExcel(response, list, "站点topic配置数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取站点topic配置详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:config:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(emsMqttTopicConfigService.selectEmsMqttTopicConfigById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增站点topic配置
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:config:add')")
|
||||
@Log(title = "站点topic配置", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody EmsMqttTopicConfig emsMqttTopicConfig)
|
||||
{
|
||||
emsMqttTopicConfig.setCreateBy(getUsername());
|
||||
return toAjax(emsMqttTopicConfigService.insertEmsMqttTopicConfig(emsMqttTopicConfig));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改站点topic配置
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:config:edit')")
|
||||
@Log(title = "站点topic配置", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody EmsMqttTopicConfig emsMqttTopicConfig)
|
||||
{
|
||||
emsMqttTopicConfig.setUpdateBy(getUsername());
|
||||
return toAjax(emsMqttTopicConfigService.updateEmsMqttTopicConfig(emsMqttTopicConfig));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除站点topic配置
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:config:remove')")
|
||||
@Log(title = "站点topic配置", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(emsMqttTopicConfigService.deleteEmsMqttTopicConfigByIds(ids));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,88 @@
|
||||
package com.xzzn.web.controller.ems;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.xzzn.common.annotation.Log;
|
||||
import com.xzzn.common.core.controller.BaseController;
|
||||
import com.xzzn.common.core.domain.AjaxResult;
|
||||
import com.xzzn.common.enums.BusinessType;
|
||||
import com.xzzn.ems.domain.EmsPointMatch;
|
||||
import com.xzzn.ems.domain.vo.DevicePointMatchExportVo;
|
||||
import com.xzzn.ems.domain.vo.DevicePointMatchVo;
|
||||
import com.xzzn.ems.domain.vo.ImportPointDataRequest;
|
||||
import com.xzzn.ems.service.IEmsPointMatchService;
|
||||
import com.xzzn.common.utils.poi.ExcelUtil;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
/**
|
||||
* 点位匹配Controller
|
||||
*
|
||||
* @author xzzn
|
||||
* @date 2025-11-04
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/ems/pointMatch")
|
||||
public class EmsPointMatchController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IEmsPointMatchService emsPointMatchService;
|
||||
|
||||
/**
|
||||
* 导出点位匹配列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:match:export')")
|
||||
@Log(title = "点位匹配", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, EmsPointMatch emsPointMatch)
|
||||
{
|
||||
List<DevicePointMatchExportVo> list = emsPointMatchService.selectEmsPointMatchList(emsPointMatch);
|
||||
ExcelUtil<DevicePointMatchExportVo> util = new ExcelUtil<>(DevicePointMatchExportVo.class);
|
||||
util.exportExcel(response, list, "点位匹配数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传点位清单
|
||||
* @param file
|
||||
* @param updateSupport
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:user:import')")
|
||||
@Log(title = "点位匹配", businessType = BusinessType.IMPORT)
|
||||
@PostMapping("/importData")
|
||||
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception
|
||||
{
|
||||
ExcelUtil<EmsPointMatch> util = new ExcelUtil<EmsPointMatch>(EmsPointMatch.class);
|
||||
List<EmsPointMatch> pointMatcheList = util.importExcel(file.getInputStream());
|
||||
String operName = getUsername();
|
||||
String message = emsPointMatchService.importPoint(pointMatcheList, updateSupport, operName);
|
||||
return success(message);
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传设备的点位清单
|
||||
* @param request
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:user:import')")
|
||||
@Log(title = "点位匹配", businessType = BusinessType.IMPORT)
|
||||
@PostMapping("/importDataByDevice")
|
||||
public void importDataByDevice(@Valid ImportPointDataRequest request, HttpServletResponse response) {
|
||||
List<DevicePointMatchVo> list = emsPointMatchService.importDataByDevice(request, getUsername());
|
||||
if (CollectionUtils.isNotEmpty(list)) {
|
||||
ExcelUtil<DevicePointMatchVo> util = new ExcelUtil<>(DevicePointMatchVo.class);
|
||||
util.exportExcel(response, list, "点位匹配数据");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -8,15 +8,22 @@ import com.xzzn.common.utils.file.FileUploadUtils;
|
||||
import com.xzzn.common.utils.file.MimeTypeUtils;
|
||||
import com.xzzn.ems.domain.EmsDevicesSetting;
|
||||
import com.xzzn.ems.domain.EmsSiteSetting;
|
||||
import com.xzzn.ems.domain.vo.DeviceUpdateRequest;
|
||||
import com.xzzn.ems.domain.vo.PointDataRequest;
|
||||
import com.xzzn.ems.domain.vo.PointQueryResponse;
|
||||
import com.xzzn.ems.domain.vo.SiteDeviceListVo;
|
||||
import com.xzzn.ems.mapper.EmsPointMatchMapper;
|
||||
import com.xzzn.ems.service.IEmsDeviceSettingService;
|
||||
import com.xzzn.ems.service.IEmsSiteService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
*
|
||||
* 站点配置
|
||||
@ -136,4 +143,50 @@ public class EmsSiteConfigController extends BaseController{
|
||||
{
|
||||
return toAjax(iEmsDeviceSettingService.deleteEmsDevicesSettingById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 单个站点单个设备点位查询-点位清单
|
||||
*/
|
||||
@GetMapping("/getDevicePointList")
|
||||
public TableDataInfo getDevicePointList(@Validated PointDataRequest request)
|
||||
{
|
||||
List<PointQueryResponse> result = iEmsDeviceSettingService.getSingleSiteDevicePoints(request);
|
||||
return getDataTable2(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取指定站点下的所有设备类别
|
||||
*/
|
||||
@GetMapping("/getSiteAllDeviceCategory")
|
||||
public AjaxResult getSiteAllDeviceCategory(String siteId)
|
||||
{
|
||||
return success(iEmsDeviceSettingService.getSiteAllDeviceCategory(siteId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据设备类别获取父类的设备id
|
||||
*/
|
||||
@GetMapping("/getParentDeviceId")
|
||||
public AjaxResult getParentDeviceId(@RequestParam String siteId, @RequestParam String deviceCategory)
|
||||
{
|
||||
return success(iEmsSiteService.getParentCategoryDeviceId(siteId, deviceCategory));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取指定站点下的指定设备类型的设备
|
||||
*/
|
||||
@GetMapping("/getDeviceListBySiteAndCategory")
|
||||
public AjaxResult getDeviceListBySiteAndCategory(String siteId,String deviceCategory)
|
||||
{
|
||||
return success(iEmsDeviceSettingService.getDeviceListBySiteAndCategory(siteId, deviceCategory));
|
||||
}
|
||||
|
||||
/**
|
||||
* PCS设备开关机
|
||||
*/
|
||||
@PostMapping("/updateDeviceStatus")
|
||||
public AjaxResult updateDeviceStatus(@Valid @RequestBody DeviceUpdateRequest request)
|
||||
{
|
||||
return success(iEmsDeviceSettingService.updateDeviceStatus(request));
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@ package com.xzzn.web.controller.ems;
|
||||
|
||||
import com.xzzn.common.core.controller.BaseController;
|
||||
import com.xzzn.common.core.domain.AjaxResult;
|
||||
import com.xzzn.ems.service.IEmsSiteService;
|
||||
import com.xzzn.ems.domain.vo.DateSearchRequest;
|
||||
import com.xzzn.ems.service.IHomePageService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@ -12,7 +12,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
*
|
||||
// * 站点地图
|
||||
* 站点地图
|
||||
*
|
||||
*/
|
||||
@RestController
|
||||
@ -31,4 +31,17 @@ public class EmsSiteMapController extends BaseController{
|
||||
return success(homePageService.getSingleSiteBaseInfo(siteId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取某个站点7天充放电数据
|
||||
*/
|
||||
@GetMapping("/getSevenChargeData")
|
||||
public AjaxResult getSevenChargeData(DateSearchRequest request)
|
||||
{
|
||||
String siteId = request.getSiteId();
|
||||
if(siteId == null || siteId.isEmpty()) {
|
||||
return error("站点必传");
|
||||
}
|
||||
return success(homePageService.getSevenChargeData(request));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -3,14 +3,19 @@ package com.xzzn.web.controller.ems;
|
||||
import com.xzzn.common.core.controller.BaseController;
|
||||
import com.xzzn.common.core.domain.AjaxResult;
|
||||
import com.xzzn.common.core.page.TableDataInfo;
|
||||
import com.xzzn.common.utils.StringUtils;
|
||||
import com.xzzn.ems.domain.vo.BMSBatteryDataList;
|
||||
import com.xzzn.ems.domain.vo.BatteryDataStatsListVo;
|
||||
import com.xzzn.ems.domain.vo.DateSearchRequest;
|
||||
import com.xzzn.ems.domain.vo.RunningGraphRequest;
|
||||
import com.xzzn.ems.domain.vo.SiteBatteryDataList;
|
||||
import com.xzzn.ems.service.IEmsSiteService;
|
||||
import com.xzzn.ems.service.IEmsStatsReportService;
|
||||
import com.xzzn.ems.service.ISingleSiteService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -51,27 +56,27 @@ public class EmsSiteMonitorController extends BaseController{
|
||||
* 单站监控-设备监控-实时运行曲线图数据
|
||||
*/
|
||||
@GetMapping("/runningGraph/storagePower")
|
||||
public AjaxResult getRunningGraphStorage(@RequestParam String siteId)
|
||||
public AjaxResult getRunningGraphStorage(RunningGraphRequest request)
|
||||
{
|
||||
return success(iSingleSiteService.getRunningGraphStorage(siteId));
|
||||
return success(iSingleSiteService.getRunningGraphStorage(request));
|
||||
}
|
||||
|
||||
@GetMapping("/runningGraph/stackAveTemp")
|
||||
public AjaxResult getRunningGraphStackTemp(@RequestParam String siteId)
|
||||
@GetMapping("/runningGraph/pcsMaxTemp")
|
||||
public AjaxResult getRunningGraphPcsMaxTemp(RunningGraphRequest request)
|
||||
{
|
||||
return success(iSingleSiteService.getRunningGraphStackTemp(siteId));
|
||||
return success(iSingleSiteService.getRunningGraphPcsMaxTemp(request));
|
||||
}
|
||||
|
||||
@GetMapping("/runningGraph/batteryAveSoc")
|
||||
public AjaxResult getRunningGraphBatterySoc(@RequestParam String siteId)
|
||||
public AjaxResult getRunningGraphBatterySoc(RunningGraphRequest request)
|
||||
{
|
||||
return success(iSingleSiteService.getRunningGraphBatterySoc(siteId));
|
||||
return success(iSingleSiteService.getRunningGraphBatterySoc(request));
|
||||
}
|
||||
|
||||
@GetMapping("/runningGraph/batteryAveTemp")
|
||||
public AjaxResult getRunningGraphBatteryTemp(@RequestParam String siteId)
|
||||
public AjaxResult getRunningGraphBatteryTemp(RunningGraphRequest request)
|
||||
{
|
||||
return success(iSingleSiteService.getRunningGraphBatteryTemp(siteId));
|
||||
return success(iSingleSiteService.getRunningGraphBatteryTemp(request));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -141,11 +146,27 @@ public class EmsSiteMonitorController extends BaseController{
|
||||
* 获取电池簇下面的单体电池数据
|
||||
*/
|
||||
@GetMapping("/getClusterDataInfoList")
|
||||
public TableDataInfo getClusterDataInfoList(@RequestParam String clusterDeviceId,@RequestParam String siteId)
|
||||
public TableDataInfo getClusterDataInfoList(@RequestParam String clusterDeviceId,@RequestParam String siteId,
|
||||
@RequestParam String stackDeviceId,@RequestParam String batteryId)
|
||||
{
|
||||
startPage();
|
||||
List<BatteryDataStatsListVo> list = iSingleSiteService.getClusterDataInfoList(clusterDeviceId,siteId);
|
||||
return getDataTable2(list);
|
||||
SiteBatteryDataList siteBatteryDataList = new SiteBatteryDataList();
|
||||
// 簇最大最小单体id数据
|
||||
List<BMSBatteryDataList> clusterBatteryDataList = iSingleSiteService.getClusterBatteryList(siteId,stackDeviceId,clusterDeviceId);
|
||||
siteBatteryDataList.setClusterList(clusterBatteryDataList);
|
||||
// 单体电池数据
|
||||
List<BatteryDataStatsListVo> List = iSingleSiteService.getClusterDataInfoList(clusterDeviceId,siteId,stackDeviceId,batteryId);
|
||||
// 对batteryList进行分页处理
|
||||
List<BatteryDataStatsListVo> batteryList = paginateList(List);
|
||||
siteBatteryDataList.setBatteryList(batteryList);
|
||||
|
||||
// 封装分页信息
|
||||
TableDataInfo pageInfo = new TableDataInfo();
|
||||
pageInfo.setTotal(List.size());
|
||||
pageInfo.setRows(Arrays.asList(siteBatteryDataList));
|
||||
pageInfo.setCode(0);
|
||||
pageInfo.setMsg("查询成功");
|
||||
return pageInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -165,4 +186,46 @@ public class EmsSiteMonitorController extends BaseController{
|
||||
{
|
||||
return success(iSingleSiteService.getAmmeterDataList(siteId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 动环数据
|
||||
*/
|
||||
@GetMapping("/getDhDataList")
|
||||
public AjaxResult getDhDataList(@RequestParam String siteId)
|
||||
{
|
||||
return success(iSingleSiteService.getDhDataList(siteId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 消防数据
|
||||
*/
|
||||
@GetMapping("/getXfDataList")
|
||||
public AjaxResult getXfDataList(@RequestParam String siteId)
|
||||
{
|
||||
return success(iSingleSiteService.getXfDataList(siteId));
|
||||
}
|
||||
|
||||
/**
|
||||
* EMS数据
|
||||
*/
|
||||
@GetMapping("/getEmsDataList")
|
||||
public AjaxResult getEmsDataList(@RequestParam String siteId)
|
||||
{
|
||||
return success(iSingleSiteService.getEmsDataList(siteId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 单站监控-首页-点位展示
|
||||
* 储能功率、电网功率、负荷功率、光伏功率
|
||||
* SOC、SOH、电池平均温度
|
||||
*/
|
||||
@GetMapping("/getPointData")
|
||||
public AjaxResult getPointData(DateSearchRequest requestVo)
|
||||
{
|
||||
if (!StringUtils.isEmpty(requestVo.getSiteId())) {
|
||||
return success(iSingleSiteService.getPointData(requestVo));
|
||||
} else {
|
||||
return error("缺少必传项");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -4,10 +4,7 @@ import com.xzzn.common.core.controller.BaseController;
|
||||
import com.xzzn.common.core.domain.AjaxResult;
|
||||
import com.xzzn.common.core.page.TableDataInfo;
|
||||
import com.xzzn.common.utils.StringUtils;
|
||||
import com.xzzn.ems.domain.vo.ClusterStatisListVo;
|
||||
import com.xzzn.ems.domain.vo.DateSearchRequest;
|
||||
import com.xzzn.ems.domain.vo.StatisAmmeterDateRequest;
|
||||
import com.xzzn.ems.domain.vo.StatisClusterDateRequest;
|
||||
import com.xzzn.ems.domain.vo.*;
|
||||
import com.xzzn.ems.service.IEmsStatsReportService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@ -58,8 +55,7 @@ public class EmsStatisticalReportController extends BaseController
|
||||
@GetMapping("/getPCSData")
|
||||
public AjaxResult getPCSData(DateSearchRequest requestVo)
|
||||
{
|
||||
if (!StringUtils.isEmpty(requestVo.getSiteId()) &&
|
||||
!StringUtils.isEmpty(requestVo.getDeviceId()) &&
|
||||
if (!StringUtils.isEmpty(requestVo.getSiteId())&&
|
||||
!StringUtils.isEmpty(requestVo.getDataType())) {
|
||||
return success(ieEmsStatsReportService.getPCSDataResult(requestVo));
|
||||
} else {
|
||||
@ -74,7 +70,6 @@ public class EmsStatisticalReportController extends BaseController
|
||||
public AjaxResult getStackData(DateSearchRequest requestVo)
|
||||
{
|
||||
if (!StringUtils.isEmpty(requestVo.getSiteId()) &&
|
||||
!StringUtils.isEmpty(requestVo.getDeviceId()) &&
|
||||
!StringUtils.isEmpty(requestVo.getDataType())) {
|
||||
return success(ieEmsStatsReportService.getStackDataResult(requestVo));
|
||||
} else {
|
||||
@ -100,7 +95,7 @@ public class EmsStatisticalReportController extends BaseController
|
||||
}
|
||||
|
||||
/**
|
||||
* 概率统计-获取总表
|
||||
* 概率统计-获取站点下所有电表
|
||||
*/
|
||||
@GetMapping("/getLoadNameList")
|
||||
public AjaxResult getLoadNameList(String siteId)
|
||||
@ -116,13 +111,22 @@ public class EmsStatisticalReportController extends BaseController
|
||||
* 概率统计-电表报表
|
||||
*/
|
||||
@GetMapping("/getAmmeterData")
|
||||
public AjaxResult getAmmeterData(StatisAmmeterDateRequest requestVo)
|
||||
public TableDataInfo getAmmeterData(StatisAmmeterDateRequest requestVo)
|
||||
{
|
||||
if (!StringUtils.isEmpty(requestVo.getDeviceId())) {
|
||||
return success(ieEmsStatsReportService.getAmmeterDataResult(requestVo));
|
||||
} else {
|
||||
return error("缺少必传项");
|
||||
}
|
||||
startPage();
|
||||
List<AmmeterStatisListVo> dataList = ieEmsStatsReportService.getAmmeterDataResult(requestVo);
|
||||
return getDataTable(dataList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 概率统计-电表收益报表
|
||||
*/
|
||||
@GetMapping("/getAmmeterRevenueData")
|
||||
public TableDataInfo getAmmeterRevenueData(StatisAmmeterDateRequest requestVo)
|
||||
{
|
||||
startPage();
|
||||
List<AmmeterRevenueStatisListVo> dataList = ieEmsStatsReportService.getAmmeterRevenueDataResult(requestVo);
|
||||
return getDataTable(dataList);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -131,9 +135,7 @@ public class EmsStatisticalReportController extends BaseController
|
||||
@GetMapping("/getPowerData")
|
||||
public AjaxResult getPowerData(DateSearchRequest requestVo)
|
||||
{
|
||||
if (!StringUtils.isEmpty(requestVo.getSiteId())
|
||||
&& !StringUtils.isEmpty(requestVo.getDeviceId())
|
||||
&& !StringUtils.isEmpty(requestVo.getDataType())) {
|
||||
if (!StringUtils.isEmpty(requestVo.getSiteId())) {
|
||||
return success(ieEmsStatsReportService.getPowerDataList(requestVo));
|
||||
} else {
|
||||
return error("缺少必传项");
|
||||
|
||||
@ -1,12 +1,18 @@
|
||||
package com.xzzn.web.controller.ems;
|
||||
|
||||
import com.xzzn.ems.domain.EmsMqttMessage;
|
||||
import com.xzzn.ems.service.IDDSDataProcessService;
|
||||
import com.xzzn.ems.service.IEmsMqttMessageService;
|
||||
import com.xzzn.ems.service.IFXXDataProcessService;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.xzzn.common.constant.RedisKeyConstants;
|
||||
import com.xzzn.common.core.redis.RedisCache;
|
||||
import com.xzzn.common.enums.TopicHandleType;
|
||||
import com.xzzn.common.utils.StringUtils;
|
||||
import com.xzzn.ems.domain.EmsMqttTopicConfig;
|
||||
import com.xzzn.ems.domain.MqttSyncLog;
|
||||
import com.xzzn.ems.mapper.EmsMqttTopicConfigMapper;
|
||||
import com.xzzn.ems.service.*;
|
||||
import com.xzzn.framework.manager.MqttLifecycleManager;
|
||||
import com.xzzn.framework.web.service.MqttPublisher;
|
||||
import com.xzzn.framework.web.service.MqttSubscriber;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.juli.logging.Log;
|
||||
import org.apache.juli.logging.LogFactory;
|
||||
import org.eclipse.paho.client.mqttv3.IMqttMessageListener;
|
||||
@ -16,6 +22,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class MqttMessageController implements MqttPublisher, MqttSubscriber {
|
||||
@ -34,6 +41,22 @@ public class MqttMessageController implements MqttPublisher, MqttSubscriber {
|
||||
|
||||
@Autowired
|
||||
private IDDSDataProcessService dDSDataProcessService;
|
||||
|
||||
@Autowired
|
||||
private IDeviceDataProcessService deviceDataProcessService;
|
||||
|
||||
@Autowired
|
||||
private IFXXAlarmDataProcessService fXXAlarmDataProcessService;
|
||||
@Autowired
|
||||
private EmsMqttTopicConfigMapper emsMqttTopicConfigMapper;
|
||||
@Autowired
|
||||
private IEmsStrategyService emsStrategyService;
|
||||
@Autowired
|
||||
private IMqttSyncLogService iMqttSyncLogService;
|
||||
|
||||
@Autowired
|
||||
private RedisCache redisCache;
|
||||
|
||||
@Autowired
|
||||
public MqttMessageController(MqttLifecycleManager mqttLifecycleManager) {
|
||||
this.mqttLifecycleManager = mqttLifecycleManager;
|
||||
@ -41,20 +64,69 @@ public class MqttMessageController implements MqttPublisher, MqttSubscriber {
|
||||
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
List<EmsMqttTopicConfig> topicConfigList = emsMqttTopicConfigMapper.selectEmsMqttTopicConfigList(null);
|
||||
|
||||
if (CollectionUtils.isEmpty (topicConfigList)) {
|
||||
log.info ("未查询到任何 MQTT 主题配置,跳过订阅");
|
||||
return;
|
||||
}
|
||||
|
||||
for (EmsMqttTopicConfig topicConfig : topicConfigList) {
|
||||
String topic = topicConfig.getMqttTopic();
|
||||
if (StringUtils.isEmpty(topic)) {
|
||||
log.info ("主题配置 ID:" +topicConfig.getId() +"的 mqttTopic 为空,跳过订阅");
|
||||
continue;
|
||||
}
|
||||
|
||||
int qos = topicConfig.getQos() == null ? 1 : topicConfig.getQos();
|
||||
if (qos < 0 || qos > 2) {
|
||||
log.info ("主题:" + topic +"的 QoS值"+ qos + "不合法,自动调整为1");
|
||||
qos = 1;
|
||||
}
|
||||
|
||||
IMqttMessageListener listener = getMqttListenerByTopic(topic, topicConfig.getHandleType());
|
||||
subscribe(topic, qos, listener);
|
||||
}
|
||||
// 订阅奉贤系统状态主题
|
||||
subscribe("021_FXX_01_UP", 1, this::handleDeviceData);
|
||||
/*subscribe("021_FXX_01_UP", 1, this::handleDeviceData);
|
||||
subscribe("021_FXX_01_RECALL", 1, this::handleDeviceData);
|
||||
subscribe("021_FXX_01_DOWN", 1, this::handleDeviceData);
|
||||
subscribe("021_FXX_01", 1, this::handleSystemStatus);
|
||||
subscribe("021_FXX_01_ALARM_UP", 1, this::handleAlarmData);
|
||||
|
||||
// 订阅电动所系统状态主题
|
||||
subscribe("021_DDS_01_UP", 1, this::handleDeviceData);
|
||||
subscribe("021_DDS_01_RECALL", 1, this::handleDeviceData);
|
||||
subscribe("021_DDS_01_DOWN", 1, this::handleDeviceData);
|
||||
subscribe("021_DDS_01", 1, this::handleSystemStatus);
|
||||
subscribe("021_DDS_01", 1, this::handleSystemStatus);*/
|
||||
|
||||
}
|
||||
|
||||
private IMqttMessageListener getMqttListenerByTopic(String topic, String handleType) {
|
||||
TopicHandleType topicHandleType = TopicHandleType.getEnumByCode(handleType);
|
||||
switch (topicHandleType) {
|
||||
case DEVICE:
|
||||
return this::handleDeviceData;
|
||||
case DEVICE_ALARM:
|
||||
return this::handleAlarmData;
|
||||
case STRATEGY:
|
||||
if (topic.equals("FAULT_PROTECTION_PLAN_UP")) {
|
||||
return this::handleFaultProtPlanData;
|
||||
} else if (topic.equals("FAULT_ALARM_RECORD_UP")) {
|
||||
return this::handleFaultAlarmData;
|
||||
} else if (topic.equals("FAULT_PLAN_ISSUE_UP")) {
|
||||
return this::handleFaultPlanIssueData;
|
||||
} else if (topic.equals("DEVICE_CHANGE_LOG_UP")) {
|
||||
return this::handleDeviceChangeLogData;
|
||||
} else {
|
||||
return this::handleStrategyData;
|
||||
}
|
||||
default:
|
||||
log.warn("Unknown handle type: " + handleType + ", using default handler");
|
||||
return this::handleSystemStatus;
|
||||
}
|
||||
}
|
||||
|
||||
// 处理系统状态消息
|
||||
private void handleSystemStatus(String topic, MqttMessage message) {
|
||||
String payload = new String(message.getPayload());
|
||||
@ -70,21 +142,121 @@ public class MqttMessageController implements MqttPublisher, MqttSubscriber {
|
||||
|
||||
// 处理设备数据
|
||||
private void handleDeviceData(String topic, MqttMessage message) {
|
||||
String payload = new String(message.getPayload());
|
||||
log.info("[DEVICE] data: " + payload);
|
||||
try {
|
||||
// 业务处理逻辑
|
||||
// if (topic.startsWith("021_DDS")) {
|
||||
// dDSDataProcessService.handleDdsData(payload);
|
||||
// } else if (topic.startsWith("021_FXX")) {
|
||||
// fXXDataProcessService.handleFxData(payload);
|
||||
// }
|
||||
deviceDataProcessService.handleDeviceData(payload, getSiteIdByTopic(topic));
|
||||
|
||||
emsMqttMessageService.insertMqttOriginalMessage(topic, payload);
|
||||
} catch (Exception e) {
|
||||
log.error("Failed to process device data message: " + e.getMessage(), e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// 处理告警数据
|
||||
private void handleAlarmData(String topic, MqttMessage message) {
|
||||
String payload = new String(message.getPayload());
|
||||
System.out.println("[DEVICE] data: " + payload);
|
||||
try {
|
||||
// 业务处理逻辑
|
||||
if (topic.startsWith("021_DDS")) {
|
||||
dDSDataProcessService.handleDdsData(payload);
|
||||
} else if (topic.startsWith("021_FXX")) {
|
||||
fXXDataProcessService.handleFxData(payload);
|
||||
}
|
||||
// if (topic.startsWith("021_FXX")) {
|
||||
// fXXAlarmDataProcessService.handleFxAlarmData(payload);
|
||||
// }
|
||||
deviceDataProcessService.handleAlarmData(payload, getSiteIdByTopic(topic));
|
||||
|
||||
emsMqttMessageService.insertMqttOriginalMessage(topic, payload);
|
||||
} catch (Exception e) {
|
||||
log.error("Failed to process device alarm data message: " + e.getMessage(), e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private String getSiteIdByTopic(String topic) {
|
||||
String siteId = redisCache.getCacheObject(RedisKeyConstants.SITE_ID + topic);
|
||||
if (StringUtils.isEmpty(siteId)) {
|
||||
EmsMqttTopicConfig topicConfig = emsMqttTopicConfigMapper.selectOneByTopic(topic);
|
||||
siteId = topicConfig.getSiteId();
|
||||
redisCache.setCacheObject(RedisKeyConstants.SITE_ID + topic, siteId);
|
||||
}
|
||||
log.info("当前处理数据站点:" + siteId + ",topic: " + topic);
|
||||
return siteId;
|
||||
}
|
||||
|
||||
// 处理运行策略数据:云端-本地
|
||||
private void handleStrategyData(String topic, MqttMessage message) {
|
||||
String payload = new String(message.getPayload());
|
||||
System.out.println("[处理运行策略数据] data: " + payload);
|
||||
try {
|
||||
// 业务处理逻辑
|
||||
iMqttSyncLogService.handleMqttStrategyData(payload);
|
||||
|
||||
emsMqttMessageService.insertMqttOriginalMessage(topic,payload);
|
||||
} catch (Exception e) {
|
||||
log.error("Failed to process system status message: " + e.getMessage(), e);
|
||||
log.error("Failed to process strategy data message: " + e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
// 处理设备保护告警策略数据:云端-本地
|
||||
private void handleFaultProtPlanData(String topic, MqttMessage message) {
|
||||
String payload = new String(message.getPayload());
|
||||
System.out.println("[处理设备保护告警策略数据] data: " + payload);
|
||||
try {
|
||||
// 业务处理逻辑
|
||||
iMqttSyncLogService.handleMqttPlanData(payload);
|
||||
|
||||
emsMqttMessageService.insertMqttOriginalMessage(topic,payload);
|
||||
} catch (Exception e) {
|
||||
log.error("Failed to process fault plan data message: " + e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
// 处理保护策略告警信息:本地-云端
|
||||
private void handleFaultAlarmData(String topic, MqttMessage message) {
|
||||
String payload = new String(message.getPayload());
|
||||
System.out.println("[处理本地保护策略告警信息到云端] data: " + payload);
|
||||
try {
|
||||
// 业务处理逻辑
|
||||
iMqttSyncLogService.handleFaultAlarmData(payload);
|
||||
|
||||
emsMqttMessageService.insertMqttOriginalMessage(topic,payload);
|
||||
} catch (Exception e) {
|
||||
log.error("Failed to process fault plan alarm data message: " + e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
// 处理保护策略下发日志:本地-云端
|
||||
private void handleFaultPlanIssueData(String topic, MqttMessage message) {
|
||||
String payload = new String(message.getPayload());
|
||||
System.out.println("[处理本地保护策略下发日志到云端] data: " + payload);
|
||||
try {
|
||||
// 业务处理逻辑
|
||||
iMqttSyncLogService.handleFaultPlanIssueData(payload);
|
||||
|
||||
emsMqttMessageService.insertMqttOriginalMessage(topic,payload);
|
||||
} catch (Exception e) {
|
||||
log.error("Failed to process fault plan issue log message: " + e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
// 处理设备状态变更日志:本地-云端
|
||||
private void handleDeviceChangeLogData(String topic, MqttMessage message) {
|
||||
String payload = new String(message.getPayload());
|
||||
System.out.println("[处理本地的保护策略告警信息到云端] data: " + payload);
|
||||
try {
|
||||
// 业务处理逻辑
|
||||
iMqttSyncLogService.handleDeviceChangeLogData(payload);
|
||||
|
||||
emsMqttMessageService.insertMqttOriginalMessage(topic,payload);
|
||||
} catch (Exception e) {
|
||||
log.error("Failed to process device change log message: " + e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -114,6 +286,4 @@ public class MqttMessageController implements MqttPublisher, MqttSubscriber {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -1,61 +1,61 @@
|
||||
# 数据源配置
|
||||
spring:
|
||||
datasource:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
druid:
|
||||
# 主库数据源
|
||||
master:
|
||||
url: jdbc:mysql://122.51.194.184:13306/setri_ems?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
username: ems
|
||||
password: 12345678
|
||||
# 从库数据源
|
||||
slave:
|
||||
# 从数据源开关/默认关闭
|
||||
enabled: false
|
||||
url:
|
||||
username:
|
||||
password:
|
||||
# 初始连接数
|
||||
initialSize: 5
|
||||
# 最小连接池数量
|
||||
minIdle: 10
|
||||
# 最大连接池数量
|
||||
maxActive: 20
|
||||
# 配置获取连接等待超时的时间
|
||||
maxWait: 60000
|
||||
# 配置连接超时时间
|
||||
connectTimeout: 30000
|
||||
# 配置网络超时时间
|
||||
socketTimeout: 60000
|
||||
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
|
||||
timeBetweenEvictionRunsMillis: 60000
|
||||
# 配置一个连接在池中最小生存的时间,单位是毫秒
|
||||
minEvictableIdleTimeMillis: 300000
|
||||
# 配置一个连接在池中最大生存的时间,单位是毫秒
|
||||
maxEvictableIdleTimeMillis: 900000
|
||||
# 配置检测连接是否有效
|
||||
validationQuery: SELECT 1 FROM DUAL
|
||||
testWhileIdle: true
|
||||
testOnBorrow: false
|
||||
testOnReturn: false
|
||||
webStatFilter:
|
||||
enabled: true
|
||||
statViewServlet:
|
||||
enabled: true
|
||||
# 设置白名单,不填则允许所有访问
|
||||
allow:
|
||||
url-pattern: /druid/*
|
||||
# 控制台管理用户名和密码
|
||||
login-username: xzzn
|
||||
login-password: 123456
|
||||
filter:
|
||||
stat:
|
||||
enabled: true
|
||||
# 慢SQL记录
|
||||
log-slow-sql: true
|
||||
slow-sql-millis: 1000
|
||||
merge-sql: true
|
||||
wall:
|
||||
config:
|
||||
multi-statement-allow: true
|
||||
## 数据源配置
|
||||
#spring:
|
||||
# datasource:
|
||||
# type: com.alibaba.druid.pool.DruidDataSource
|
||||
# driverClassName: com.mysql.cj.jdbc.Driver
|
||||
# druid:
|
||||
# # 主库数据源
|
||||
# master:
|
||||
# url: jdbc:mysql://122.51.194.184:13306/setri_ems?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
# username: ems
|
||||
# password: 12345678
|
||||
# # 从库数据源
|
||||
# slave:
|
||||
# # 从数据源开关/默认关闭
|
||||
# enabled: false
|
||||
# url:
|
||||
# username:
|
||||
# password:
|
||||
# # 初始连接数
|
||||
# initialSize: 5
|
||||
# # 最小连接池数量
|
||||
# minIdle: 10
|
||||
# # 最大连接池数量
|
||||
# maxActive: 20
|
||||
# # 配置获取连接等待超时的时间
|
||||
# maxWait: 60000
|
||||
# # 配置连接超时时间
|
||||
# connectTimeout: 30000
|
||||
# # 配置网络超时时间
|
||||
# socketTimeout: 60000
|
||||
# # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
|
||||
# timeBetweenEvictionRunsMillis: 60000
|
||||
# # 配置一个连接在池中最小生存的时间,单位是毫秒
|
||||
# minEvictableIdleTimeMillis: 300000
|
||||
# # 配置一个连接在池中最大生存的时间,单位是毫秒
|
||||
# maxEvictableIdleTimeMillis: 900000
|
||||
# # 配置检测连接是否有效
|
||||
# validationQuery: SELECT 1 FROM DUAL
|
||||
# testWhileIdle: true
|
||||
# testOnBorrow: false
|
||||
# testOnReturn: false
|
||||
# webStatFilter:
|
||||
# enabled: true
|
||||
# statViewServlet:
|
||||
# enabled: true
|
||||
# # 设置白名单,不填则允许所有访问
|
||||
# allow:
|
||||
# url-pattern: /druid/*
|
||||
# # 控制台管理用户名和密码
|
||||
# login-username: xzzn
|
||||
# login-password: 123456
|
||||
# filter:
|
||||
# stat:
|
||||
# enabled: true
|
||||
# # 慢SQL记录
|
||||
# log-slow-sql: true
|
||||
# slow-sql-millis: 1000
|
||||
# merge-sql: true
|
||||
# wall:
|
||||
# config:
|
||||
# multi-statement-allow: true
|
||||
205
ems-admin/src/main/resources/application-local.yml
Normal file
205
ems-admin/src/main/resources/application-local.yml
Normal file
@ -0,0 +1,205 @@
|
||||
# 项目相关配置
|
||||
xzzn:
|
||||
# 名称
|
||||
name: EMS
|
||||
# 版本
|
||||
version: 0.0.1
|
||||
# 版权年份
|
||||
copyrightYear: 2025
|
||||
# 文件路径 示例( Windows配置D:/xzzn/uploadPath,Linux配置 /home/xzzn/uploadPath)
|
||||
profile: ../uploadPath
|
||||
# 获取ip地址开关
|
||||
addressEnabled: false
|
||||
# 验证码类型 math 数字计算 char 字符验证
|
||||
captchaType: math
|
||||
|
||||
# 开发环境配置
|
||||
server:
|
||||
# 服务器的HTTP端口,默认为8080
|
||||
port: 8089
|
||||
servlet:
|
||||
# 应用的访问路径
|
||||
context-path: /
|
||||
tomcat:
|
||||
# tomcat的URI编码
|
||||
uri-encoding: UTF-8
|
||||
# 连接数满后的排队数,默认为100
|
||||
accept-count: 1000
|
||||
threads:
|
||||
# tomcat最大线程数,默认为200
|
||||
max: 800
|
||||
# Tomcat启动初始化的线程数,默认值10
|
||||
min-spare: 100
|
||||
|
||||
# 日志配置
|
||||
logging:
|
||||
level:
|
||||
com.xzzn: info
|
||||
org.springframework: warn
|
||||
|
||||
# 用户配置
|
||||
user:
|
||||
password:
|
||||
# 密码最大错误次数
|
||||
maxRetryCount: 5
|
||||
# 密码锁定时间(默认10分钟)
|
||||
lockTime: 10
|
||||
|
||||
# Spring配置
|
||||
spring:
|
||||
# 资源信息
|
||||
messages:
|
||||
# 国际化资源文件路径
|
||||
basename: i18n/messages
|
||||
# 文件上传
|
||||
servlet:
|
||||
multipart:
|
||||
# 单个文件大小
|
||||
max-file-size: 10MB
|
||||
# 设置总上传的文件大小
|
||||
max-request-size: 20MB
|
||||
# 服务模块
|
||||
devtools:
|
||||
restart:
|
||||
# 热部署开关
|
||||
enabled: true
|
||||
# redis 配置
|
||||
redis:
|
||||
# 地址
|
||||
host: 127.0.0.1
|
||||
# 端口,默认为6379
|
||||
port: 6379
|
||||
# 数据库索引
|
||||
database: 0
|
||||
# 密码
|
||||
password: 12345678
|
||||
# 连接超时时间
|
||||
timeout: 10s
|
||||
lettuce:
|
||||
pool:
|
||||
# 连接池中的最小空闲连接
|
||||
min-idle: 0
|
||||
# 连接池中的最大空闲连接
|
||||
max-idle: 8
|
||||
# 连接池的最大数据库连接数
|
||||
max-active: 8
|
||||
# #连接池最大阻塞等待时间(使用负值表示没有限制)
|
||||
max-wait: -1ms
|
||||
# 数据源配置
|
||||
datasource:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
druid:
|
||||
# 主库数据源
|
||||
master:
|
||||
url: jdbc:mysql://127.0.0.1:3306/setri_ems?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
username: ems
|
||||
password: Aa112211!
|
||||
# 从库数据源
|
||||
slave:
|
||||
# 从数据源开关/默认关闭
|
||||
enabled: false
|
||||
url:
|
||||
username:
|
||||
password:
|
||||
# 初始连接数
|
||||
initialSize: 5
|
||||
# 最小连接池数量
|
||||
minIdle: 10
|
||||
# 最大连接池数量
|
||||
maxActive: 20
|
||||
# 配置获取连接等待超时的时间
|
||||
maxWait: 60000
|
||||
# 配置连接超时时间
|
||||
connectTimeout: 30000
|
||||
# 配置网络超时时间
|
||||
socketTimeout: 60000
|
||||
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
|
||||
timeBetweenEvictionRunsMillis: 60000
|
||||
# 配置一个连接在池中最小生存的时间,单位是毫秒
|
||||
minEvictableIdleTimeMillis: 300000
|
||||
# 配置一个连接在池中最大生存的时间,单位是毫秒
|
||||
maxEvictableIdleTimeMillis: 900000
|
||||
# 配置检测连接是否有效
|
||||
validationQuery: SELECT 1 FROM DUAL
|
||||
testWhileIdle: true
|
||||
testOnBorrow: false
|
||||
testOnReturn: false
|
||||
webStatFilter:
|
||||
enabled: true
|
||||
statViewServlet:
|
||||
enabled: true
|
||||
# 设置白名单,不填则允许所有访问
|
||||
allow:
|
||||
url-pattern: /druid/*
|
||||
# 控制台管理用户名和密码
|
||||
login-username: xzzn
|
||||
login-password: 123456
|
||||
filter:
|
||||
stat:
|
||||
enabled: true
|
||||
# 慢SQL记录
|
||||
log-slow-sql: true
|
||||
slow-sql-millis: 1000
|
||||
merge-sql: true
|
||||
wall:
|
||||
config:
|
||||
multi-statement-allow: true
|
||||
|
||||
# token配置
|
||||
token:
|
||||
# 令牌自定义标识
|
||||
header: Authorization
|
||||
# 令牌密钥
|
||||
secret: abcdefghijklmnopqrstuvwxyz
|
||||
# 令牌有效期(默认30分钟)
|
||||
expireTime: 30
|
||||
|
||||
# MyBatis配置
|
||||
mybatis:
|
||||
# 搜索指定包别名
|
||||
typeAliasesPackage: com.xzzn.**.domain
|
||||
# 配置mapper的扫描,找到所有的mapper.xml映射文件
|
||||
mapperLocations: classpath*:mapper/**/*Mapper.xml
|
||||
# 加载全局的配置文件
|
||||
configLocation: classpath:mybatis/mybatis-config.xml
|
||||
|
||||
# PageHelper分页插件
|
||||
pagehelper:
|
||||
helperDialect: mysql
|
||||
supportMethodsArguments: true
|
||||
params: count=countSql
|
||||
|
||||
# Swagger配置
|
||||
swagger:
|
||||
# 是否开启swagger
|
||||
enabled: true
|
||||
# 请求前缀
|
||||
pathMapping: /dev-api
|
||||
|
||||
# 防止XSS攻击
|
||||
xss:
|
||||
# 过滤开关
|
||||
enabled: true
|
||||
# 排除链接(多个用逗号分隔)
|
||||
excludes: /system/notice
|
||||
# 匹配链接
|
||||
urlPatterns: /system/*,/monitor/*,/tool/*
|
||||
|
||||
mqtt:
|
||||
broker.url: tcp://121.5.164.6:1883
|
||||
client.id: ems-cloud
|
||||
username: dmbroker
|
||||
password: qwer1234
|
||||
connection-timeout: 15
|
||||
keep-alive-interval: 30
|
||||
automatic-reconnect: true
|
||||
|
||||
modbus:
|
||||
pool:
|
||||
max-total: 20
|
||||
max-idle: 10
|
||||
min-idle: 3
|
||||
poll:
|
||||
interval: "0 */5 * * * *" # 5分钟间隔
|
||||
timeout: 30000 # 30秒超时
|
||||
205
ems-admin/src/main/resources/application-prod.yml
Normal file
205
ems-admin/src/main/resources/application-prod.yml
Normal file
@ -0,0 +1,205 @@
|
||||
# 项目相关配置
|
||||
xzzn:
|
||||
# 名称
|
||||
name: EMS
|
||||
# 版本
|
||||
version: 0.0.1
|
||||
# 版权年份
|
||||
copyrightYear: 2025
|
||||
# 文件路径 示例( Windows配置D:/xzzn/uploadPath,Linux配置 /home/xzzn/uploadPath)
|
||||
profile: /home/xzzn/uploadPath
|
||||
# 获取ip地址开关
|
||||
addressEnabled: false
|
||||
# 验证码类型 math 数字计算 char 字符验证
|
||||
captchaType: math
|
||||
|
||||
# 开发环境配置
|
||||
server:
|
||||
# 服务器的HTTP端口,默认为8080
|
||||
port: 8089
|
||||
servlet:
|
||||
# 应用的访问路径
|
||||
context-path: /
|
||||
tomcat:
|
||||
# tomcat的URI编码
|
||||
uri-encoding: UTF-8
|
||||
# 连接数满后的排队数,默认为100
|
||||
accept-count: 1000
|
||||
threads:
|
||||
# tomcat最大线程数,默认为200
|
||||
max: 800
|
||||
# Tomcat启动初始化的线程数,默认值10
|
||||
min-spare: 100
|
||||
|
||||
# 日志配置
|
||||
logging:
|
||||
level:
|
||||
com.xzzn: info
|
||||
org.springframework: warn
|
||||
|
||||
# 用户配置
|
||||
user:
|
||||
password:
|
||||
# 密码最大错误次数
|
||||
maxRetryCount: 5
|
||||
# 密码锁定时间(默认10分钟)
|
||||
lockTime: 10
|
||||
|
||||
# Spring配置
|
||||
spring:
|
||||
# 资源信息
|
||||
messages:
|
||||
# 国际化资源文件路径
|
||||
basename: i18n/messages
|
||||
# 文件上传
|
||||
servlet:
|
||||
multipart:
|
||||
# 单个文件大小
|
||||
max-file-size: 10MB
|
||||
# 设置总上传的文件大小
|
||||
max-request-size: 20MB
|
||||
# 服务模块
|
||||
devtools:
|
||||
restart:
|
||||
# 热部署开关
|
||||
enabled: true
|
||||
# redis 配置
|
||||
redis:
|
||||
# 地址
|
||||
host: 172.17.0.9
|
||||
# 端口,默认为6379
|
||||
port: 6379
|
||||
# 数据库索引
|
||||
database: 0
|
||||
# 密码
|
||||
password: 12345678
|
||||
# 连接超时时间
|
||||
timeout: 10s
|
||||
lettuce:
|
||||
pool:
|
||||
# 连接池中的最小空闲连接
|
||||
min-idle: 0
|
||||
# 连接池中的最大空闲连接
|
||||
max-idle: 8
|
||||
# 连接池的最大数据库连接数
|
||||
max-active: 8
|
||||
# #连接池最大阻塞等待时间(使用负值表示没有限制)
|
||||
max-wait: -1ms
|
||||
# 数据源配置
|
||||
datasource:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
druid:
|
||||
# 主库数据源
|
||||
master:
|
||||
url: jdbc:mysql://172.17.0.13:3306/setri_ems?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
username: ems
|
||||
password: Aa112211!
|
||||
# 从库数据源
|
||||
slave:
|
||||
# 从数据源开关/默认关闭
|
||||
enabled: false
|
||||
url:
|
||||
username:
|
||||
password:
|
||||
# 初始连接数
|
||||
initialSize: 5
|
||||
# 最小连接池数量
|
||||
minIdle: 10
|
||||
# 最大连接池数量
|
||||
maxActive: 20
|
||||
# 配置获取连接等待超时的时间
|
||||
maxWait: 60000
|
||||
# 配置连接超时时间
|
||||
connectTimeout: 30000
|
||||
# 配置网络超时时间
|
||||
socketTimeout: 60000
|
||||
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
|
||||
timeBetweenEvictionRunsMillis: 60000
|
||||
# 配置一个连接在池中最小生存的时间,单位是毫秒
|
||||
minEvictableIdleTimeMillis: 300000
|
||||
# 配置一个连接在池中最大生存的时间,单位是毫秒
|
||||
maxEvictableIdleTimeMillis: 900000
|
||||
# 配置检测连接是否有效
|
||||
validationQuery: SELECT 1 FROM DUAL
|
||||
testWhileIdle: true
|
||||
testOnBorrow: false
|
||||
testOnReturn: false
|
||||
webStatFilter:
|
||||
enabled: true
|
||||
statViewServlet:
|
||||
enabled: true
|
||||
# 设置白名单,不填则允许所有访问
|
||||
allow:
|
||||
url-pattern: /druid/*
|
||||
# 控制台管理用户名和密码
|
||||
login-username: xzzn
|
||||
login-password: 123456
|
||||
filter:
|
||||
stat:
|
||||
enabled: true
|
||||
# 慢SQL记录
|
||||
log-slow-sql: true
|
||||
slow-sql-millis: 1000
|
||||
merge-sql: true
|
||||
wall:
|
||||
config:
|
||||
multi-statement-allow: true
|
||||
|
||||
# token配置
|
||||
token:
|
||||
# 令牌自定义标识
|
||||
header: Authorization
|
||||
# 令牌密钥
|
||||
secret: abcdefghijklmnopqrstuvwxyz
|
||||
# 令牌有效期(默认30分钟)
|
||||
expireTime: 30
|
||||
|
||||
# MyBatis配置
|
||||
mybatis:
|
||||
# 搜索指定包别名
|
||||
typeAliasesPackage: com.xzzn.**.domain
|
||||
# 配置mapper的扫描,找到所有的mapper.xml映射文件
|
||||
mapperLocations: classpath*:mapper/**/*Mapper.xml
|
||||
# 加载全局的配置文件
|
||||
configLocation: classpath:mybatis/mybatis-config.xml
|
||||
|
||||
# PageHelper分页插件
|
||||
pagehelper:
|
||||
helperDialect: mysql
|
||||
supportMethodsArguments: true
|
||||
params: count=countSql
|
||||
|
||||
# Swagger配置
|
||||
swagger:
|
||||
# 是否开启swagger
|
||||
enabled: true
|
||||
# 请求前缀
|
||||
pathMapping: /dev-api
|
||||
|
||||
# 防止XSS攻击
|
||||
xss:
|
||||
# 过滤开关
|
||||
enabled: true
|
||||
# 排除链接(多个用逗号分隔)
|
||||
excludes: /system/notice
|
||||
# 匹配链接
|
||||
urlPatterns: /system/*,/monitor/*,/tool/*
|
||||
|
||||
mqtt:
|
||||
broker.url: tcp://121.5.164.6:1883
|
||||
client.id: ems-cloud
|
||||
username: dmbroker
|
||||
password: qwer1234
|
||||
connection-timeout: 15
|
||||
keep-alive-interval: 30
|
||||
automatic-reconnect: true
|
||||
|
||||
modbus:
|
||||
pool:
|
||||
max-total: 20
|
||||
max-idle: 10
|
||||
min-idle: 3
|
||||
poll:
|
||||
interval: "0 */5 * * * *" # 5分钟间隔
|
||||
timeout: 30000 # 30秒超时
|
||||
@ -87,6 +87,66 @@ spring:
|
||||
max-active: 8
|
||||
# #连接池最大阻塞等待时间(使用负值表示没有限制)
|
||||
max-wait: -1ms
|
||||
# 数据源配置
|
||||
datasource:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
druid:
|
||||
# 主库数据源
|
||||
master:
|
||||
url: jdbc:mysql://122.51.194.184:13306/setri_ems?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
username: ems
|
||||
password: 12345678
|
||||
# 从库数据源
|
||||
slave:
|
||||
# 从数据源开关/默认关闭
|
||||
enabled: false
|
||||
url:
|
||||
username:
|
||||
password:
|
||||
# 初始连接数
|
||||
initialSize: 5
|
||||
# 最小连接池数量
|
||||
minIdle: 10
|
||||
# 最大连接池数量
|
||||
maxActive: 20
|
||||
# 配置获取连接等待超时的时间
|
||||
maxWait: 60000
|
||||
# 配置连接超时时间
|
||||
connectTimeout: 30000
|
||||
# 配置网络超时时间
|
||||
socketTimeout: 60000
|
||||
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
|
||||
timeBetweenEvictionRunsMillis: 60000
|
||||
# 配置一个连接在池中最小生存的时间,单位是毫秒
|
||||
minEvictableIdleTimeMillis: 300000
|
||||
# 配置一个连接在池中最大生存的时间,单位是毫秒
|
||||
maxEvictableIdleTimeMillis: 900000
|
||||
# 配置检测连接是否有效
|
||||
validationQuery: SELECT 1 FROM DUAL
|
||||
testWhileIdle: true
|
||||
testOnBorrow: false
|
||||
testOnReturn: false
|
||||
webStatFilter:
|
||||
enabled: true
|
||||
statViewServlet:
|
||||
enabled: true
|
||||
# 设置白名单,不填则允许所有访问
|
||||
allow:
|
||||
url-pattern: /druid/*
|
||||
# 控制台管理用户名和密码
|
||||
login-username: xzzn
|
||||
login-password: 123456
|
||||
filter:
|
||||
stat:
|
||||
enabled: true
|
||||
# 慢SQL记录
|
||||
log-slow-sql: true
|
||||
slow-sql-millis: 1000
|
||||
merge-sql: true
|
||||
wall:
|
||||
config:
|
||||
multi-statement-allow: true
|
||||
|
||||
# token配置
|
||||
token:
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration>
|
||||
<!-- 日志存放路径 -->
|
||||
<property name="log.path" value="/etc/xzzn/logs" />
|
||||
<property name="log.path" value="../logs" />
|
||||
<!-- 日志输出格式 -->
|
||||
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
|
||||
|
||||
|
||||
@ -0,0 +1,11 @@
|
||||
package com.xzzn.common.annotation;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
/**
|
||||
* 标记:调用insert后需要同步数据到其他服务器
|
||||
*/
|
||||
@Target(ElementType.METHOD)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface SyncAfterInsert {
|
||||
}
|
||||
@ -170,4 +170,9 @@ public class Constants
|
||||
*/
|
||||
public static final String[] JOB_ERROR_STR = { "java.net.URL", "javax.naming.InitialContext", "org.yaml.snakeyaml",
|
||||
"org.springframework", "org.apache", "com.xzzn.common.utils.file", "com.xzzn.common.config", "com.xzzn.generator" };
|
||||
|
||||
/**
|
||||
* 昨日充放电最晚数据有效期
|
||||
*/
|
||||
public static final Integer DATE_VALID_TIME = 1;
|
||||
}
|
||||
|
||||
@ -42,6 +42,11 @@ public class RedisKeyConstants
|
||||
*/
|
||||
public static final String DH = "DH_";
|
||||
|
||||
/**
|
||||
* 消防数据 redis key
|
||||
*/
|
||||
public static final String XF = "XF_";
|
||||
|
||||
/**
|
||||
* 电池组 redis key
|
||||
*/
|
||||
@ -51,4 +56,66 @@ public class RedisKeyConstants
|
||||
* BMSD原始数据 redis key
|
||||
*/
|
||||
public static final String ORIGINAL_BMSD = "BMSD_";
|
||||
|
||||
/**
|
||||
* 冷却数据 redis key
|
||||
*/
|
||||
public static final String COOLING = "COOLING_";
|
||||
|
||||
/**
|
||||
* EMS数据 redis key
|
||||
*/
|
||||
public static final String EMS = "EMS_";
|
||||
|
||||
/**
|
||||
* 点位匹配数据 redis key
|
||||
*/
|
||||
public static final String POINT_MATCH = "POINT_MATCH_";
|
||||
|
||||
/**
|
||||
* 点位枚举匹配数据 redis key
|
||||
*/
|
||||
public static final String POINT_ENUM_MATCH = "POINT_ENUM_MATCH_";
|
||||
|
||||
/**
|
||||
* topic对应站点ID redis key
|
||||
*/
|
||||
public static final String SITE_ID = "SITE_ID_";
|
||||
|
||||
/**
|
||||
* 存放单个设备同步过来的原始数据-最晚一次数据
|
||||
*/
|
||||
public static final String ORIGINAL_MQTT_DATA = "MQTT_";
|
||||
|
||||
/**
|
||||
* 存放单个设备同步过来的告警点位原始数据-最晚一次数据
|
||||
*/
|
||||
public static final String ORIGINAL_MQTT_DATA_ALARM = "MQTT_ALARM_";
|
||||
|
||||
/** 存放订阅失败告警信息 */
|
||||
public static final String TOPIC_FAILED_ALRAM_RECORD = "topic_failed_";
|
||||
/** topic 内没有数据设备维度告警 */
|
||||
public static final String TOPIC_EMPTY_ALARM_RECORD = "topic_empty_";
|
||||
|
||||
/** 设备信息初始化 */
|
||||
public static final String INIT_DEVICE_INFO = "init_device_info";
|
||||
/** 告警匹配信息 */
|
||||
public static final String ALARM_MATCH_INFO = "alarm_message_info";
|
||||
|
||||
/** 现有的告警数据 */
|
||||
public static final String LATEST_ALARM_RECORD = "LATEST_ALARM_RECORD";
|
||||
|
||||
/** 预存电价时间配置 */
|
||||
public static final String ENERGY_PRICE_TIME = "energy_price_time_";
|
||||
|
||||
/** dds昨日累计总收益 */
|
||||
public static final String DDS_TOTAL_REVENUE = "total_revenue_";
|
||||
/** fx实时总收益和当日实时收益 */
|
||||
public static final String FXX_REALTIME_REVENUE = "realtime_revenue_";
|
||||
|
||||
/** 每个设备最新数据-设置失效时间-判断是否正常同步数据 */
|
||||
public static final String SYNC_DATA= "SYNC_DATA_";
|
||||
|
||||
/** 每个设备最新数据-设置失效时间-判断是否正常同步数据 */
|
||||
public static final String SYNC_DATA_ALARM = "SYNC_DATA_ALARM_";
|
||||
}
|
||||
|
||||
@ -208,28 +208,69 @@ public class BaseController
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
protected TableDataInfo getDataTable2(List<?> list)
|
||||
{
|
||||
List<?> subList = new ArrayList<>();
|
||||
// 分页梳理
|
||||
// 1. 处理原列表为null的情况,避免空指针
|
||||
List<?> targetList = (list == null) ? Collections.emptyList() : list;
|
||||
List<?> subList;
|
||||
|
||||
// 2. 获取分页参数
|
||||
PageDomain pageDomain = TableSupport.buildPageRequest();
|
||||
int pageNum = pageDomain.getPageNum();
|
||||
int pageSize = pageDomain.getPageSize();
|
||||
|
||||
// 3. 判断分页参数是否有效(pageNum和pageSize均为正数时才分页)
|
||||
if (pageNum > 0 && pageSize > 0) {
|
||||
// 计算分页起始和结束索引
|
||||
int startIndex = (pageNum - 1) * pageSize;
|
||||
int endIndex = Math.min(startIndex + pageSize, list.size());
|
||||
// 防止越界
|
||||
if (startIndex >= list.size()) {
|
||||
subList = Collections.emptyList();
|
||||
// 计算起始索引(确保不小于0)
|
||||
int startIndex = Math.max((pageNum - 1) * pageSize, 0);
|
||||
|
||||
// 关键修复:若起始索引已超出列表大小,直接返回空列表
|
||||
if (startIndex >= targetList.size()) {
|
||||
subList = Collections.emptyList();
|
||||
} else {
|
||||
// 计算结束索引(不超过列表大小,且不小于起始索引)
|
||||
int endIndex = Math.min(startIndex + pageSize, targetList.size());
|
||||
endIndex = Math.max(endIndex, startIndex); // 防止endIndex < startIndex
|
||||
|
||||
// 截取子列表(转换为新ArrayList,避免视图依赖)
|
||||
subList = new ArrayList<>(targetList.subList(startIndex, endIndex));
|
||||
}
|
||||
// 截取当前页数据
|
||||
subList = list.subList(startIndex, endIndex);
|
||||
} else {
|
||||
// 分页参数无效时,返回全部数据
|
||||
subList = new ArrayList<>(targetList);
|
||||
}
|
||||
|
||||
// 4. 封装返回结果
|
||||
TableDataInfo rspData = new TableDataInfo();
|
||||
rspData.setCode(HttpStatus.SUCCESS);
|
||||
rspData.setMsg("查询成功");
|
||||
rspData.setRows(subList);
|
||||
rspData.setTotal(list.size());
|
||||
rspData.setTotal(targetList.size());
|
||||
return rspData;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通用分页工具方法
|
||||
*/
|
||||
protected <T> List<T> paginateList(List<T> sourceList) {
|
||||
if (sourceList == null || sourceList.isEmpty()) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
// 分页梳理
|
||||
PageDomain pageDomain = TableSupport.buildPageRequest();
|
||||
int pageNum = pageDomain.getPageNum();
|
||||
int pageSize = pageDomain.getPageSize();
|
||||
int startIndex = 0;
|
||||
int endIndex = sourceList.size();
|
||||
if (pageNum > 0 && pageSize > 0) {
|
||||
// 计算起始索引(处理页码小于1的情况)
|
||||
startIndex = Math.max((pageNum - 1) * pageSize, 0);
|
||||
// 计算结束索引(处理超出列表长度的情况)
|
||||
endIndex = Math.min(startIndex + pageSize, sourceList.size());
|
||||
}
|
||||
// 防止越界
|
||||
if (startIndex >= sourceList.size()) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
// 截取分页数据
|
||||
return sourceList.subList(startIndex, endIndex);
|
||||
}
|
||||
}
|
||||
|
||||
@ -7,10 +7,8 @@ import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.redis.core.BoundSetOperations;
|
||||
import org.springframework.data.redis.core.HashOperations;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.data.redis.core.ValueOperations;
|
||||
import org.springframework.dao.DataAccessException;
|
||||
import org.springframework.data.redis.core.*;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
@ -243,6 +241,18 @@ public class RedisCache
|
||||
return redisTemplate.opsForHash().multiGet(key, hKeys);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除Hash中的多条数据
|
||||
*
|
||||
* @param key Redis键
|
||||
* @param hKey Hash键
|
||||
* @return 是否成功
|
||||
*/
|
||||
public boolean deleteAllCacheMapValue(final String key, final Object[] hKey)
|
||||
{
|
||||
return redisTemplate.opsForHash().delete(key, hKey) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除Hash中的某条数据
|
||||
*
|
||||
@ -255,6 +265,18 @@ public class RedisCache
|
||||
return redisTemplate.opsForHash().delete(key, hKey) > 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 批量往Hash中存入数据
|
||||
*
|
||||
* @param key Redis键
|
||||
* @param value 值
|
||||
*/
|
||||
public <T> void setAllCacheMapValue(final String key, final Map<String, T> value)
|
||||
{
|
||||
redisTemplate.opsForHash().putAll(key, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得缓存的基本对象列表
|
||||
*
|
||||
@ -276,4 +298,78 @@ public class RedisCache
|
||||
{
|
||||
return redisTemplate.delete(key);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量缓存
|
||||
* @param cacheMap
|
||||
*/
|
||||
public <T> void multiSet(final Map<String, String> cacheMap)
|
||||
{
|
||||
|
||||
redisTemplate.opsForValue().multiSet(cacheMap);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量设置键值对,并为每个键设置相同的过期时间
|
||||
* @param keyValueMap 键值对集合
|
||||
* @param timeout 过期时间
|
||||
* @param unit 时间单位
|
||||
*/
|
||||
public void multiSetWithExpire(Map<String, String> keyValueMap, long timeout, TimeUnit unit) {
|
||||
if (keyValueMap.isEmpty()) {
|
||||
return; // 空集合直接返回
|
||||
}
|
||||
|
||||
// 使用Redis管道批量执行命令
|
||||
redisTemplate.executePipelined(new SessionCallback<Object>() {
|
||||
@Override
|
||||
public Object execute(RedisOperations operations) throws DataAccessException {
|
||||
// 循环处理每个键值对
|
||||
for (Map.Entry<String, String> entry : keyValueMap.entrySet()) {
|
||||
String key = entry.getKey();
|
||||
String value = entry.getValue();
|
||||
|
||||
// 1. 设置键值对
|
||||
operations.opsForValue().set(key, value);
|
||||
// 2. 设置过期时间
|
||||
operations.expire(key, timeout, unit);
|
||||
}
|
||||
return null; // 管道操作无需返回值
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除指定站点的所有历史测试数据缓存(最精准)
|
||||
* @param testSiteId 测试数据所属的站点ID(如"test-site-001")
|
||||
*/
|
||||
public void deleteTestCacheBySite(String testSiteId) {
|
||||
System.out.println("开删除缓存redis:" + testSiteId + "<UNK>");
|
||||
if (testSiteId == null || testSiteId.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 构造键前缀:测试站点ID开头的所有缓存键(无论粒度和时间)
|
||||
String pattern = testSiteId + "_*";
|
||||
deleteCacheByPattern(pattern);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据键前缀批量删除缓存(核心方法)
|
||||
* @param pattern 键匹配模式(支持Redis的通配符:*表示任意字符,?表示单个字符)
|
||||
*/
|
||||
public void deleteCacheByPattern(String pattern) {
|
||||
try {
|
||||
// 1. 查找所有匹配的键(注意:keys命令在大数据量时可能阻塞Redis,建议生产环境用scan)
|
||||
Set<String> keys = redisTemplate.keys(pattern);
|
||||
if (keys == null || keys.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 2. 批量删除匹配的键
|
||||
long deleteCount = redisTemplate.delete(keys);
|
||||
System.out.println("删除缓存数据:" + deleteCount + "<UNK>");
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -7,8 +7,10 @@ package com.xzzn.common.enums;
|
||||
*/
|
||||
public enum AmmeterCategory
|
||||
{
|
||||
CURRENT_COMB_ACTIVE("1", "当前组合有功电能"),
|
||||
CURRENT_COMB_REACTIVE("2", "当前组合无功电能"),
|
||||
CURRENT_FORWARD_ACTIVE("1", "当前正向有功电能"),
|
||||
CURRENT_FORWARD_REACTIVE("2", "当前正向无功电能"),
|
||||
CURRENT_REVERSE_ACTIVE("3", "当前反向有功电能"),
|
||||
CURRENT_REVERSE_REACTIVE("4", "当前反向无功电能"),
|
||||
A_POWER("3", "A相功率"),
|
||||
B_POWER("4", "B相功率"),
|
||||
C_POWER("5", "C相功率");
|
||||
|
||||
@ -7,7 +7,7 @@ package com.xzzn.common.enums;
|
||||
*/
|
||||
public enum CommunicationStatus
|
||||
{
|
||||
OK("0", "正常"), SUSPEND("1", "通信中断") ,EXCEPTION("1", "异常");
|
||||
OK("0", "正常"), SUSPEND("1", "通信中断") ,EXCEPTION("2", "异常");
|
||||
|
||||
private final String code;
|
||||
private final String info;
|
||||
|
||||
42
ems-common/src/main/java/com/xzzn/common/enums/CostType.java
Normal file
42
ems-common/src/main/java/com/xzzn/common/enums/CostType.java
Normal file
@ -0,0 +1,42 @@
|
||||
package com.xzzn.common.enums;
|
||||
|
||||
/**
|
||||
* 电量类型
|
||||
*/
|
||||
public enum CostType
|
||||
{
|
||||
PEAK("peak", "尖"),
|
||||
HIGH("high", "峰"),
|
||||
FLAT("flat", "平"),
|
||||
VALLEY("valley", "谷"),
|
||||
;
|
||||
|
||||
private final String code;
|
||||
private final String info;
|
||||
|
||||
CostType(String code, String info)
|
||||
{
|
||||
this.code = code;
|
||||
this.info = info;
|
||||
}
|
||||
|
||||
public String getCode()
|
||||
{
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getInfo()
|
||||
{
|
||||
return info;
|
||||
}
|
||||
|
||||
public static CostType getEnumByCode(String code)
|
||||
{
|
||||
for (CostType costType : CostType.values()) {
|
||||
if (costType.code.equals(code)) {
|
||||
return costType;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@ -1,5 +1,10 @@
|
||||
package com.xzzn.common.enums;
|
||||
|
||||
import org.apache.xmlbeans.impl.common.NameUtil;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* device-设备类别
|
||||
*
|
||||
@ -7,21 +12,27 @@ package com.xzzn.common.enums;
|
||||
*/
|
||||
public enum DeviceCategory
|
||||
{
|
||||
PCS("PCS", "PCS设备"),
|
||||
BRANCH("BRANCH", "PCS分支设备"),
|
||||
STACK("STACK", "电池堆"),
|
||||
CLUSTER("CLUSTER", "电池簇"),
|
||||
BATTERY("BATTERY", "单体电池"),
|
||||
AMMETER("AMMETER", "电表"),
|
||||
COOLING("COOLING", "冷液体");
|
||||
PCS("PCS", "PCS设备", null),
|
||||
BRANCH("BRANCH", "PCS分支设备", PCS),
|
||||
STACK("STACK", "电池堆", null),
|
||||
CLUSTER("CLUSTER", "电池簇", STACK),
|
||||
BATTERY("BATTERY", "单体电池", CLUSTER),
|
||||
AMMETER("AMMETER", "电表", null),
|
||||
COOLING("COOLING", "冷却", null),
|
||||
DH("DH", "动环", null),
|
||||
XF("XF", "消防", null),
|
||||
BATTERY_GROUP("BATTERY_GROUP", "电池组", null),
|
||||
EMS("EMS", "EMS设备", null),;
|
||||
|
||||
private final String code;
|
||||
private final String info;
|
||||
private final DeviceCategory parentCategory;
|
||||
|
||||
DeviceCategory(String code, String info)
|
||||
DeviceCategory(String code, String info, DeviceCategory parentCategory)
|
||||
{
|
||||
this.code = code;
|
||||
this.info = info;
|
||||
this.parentCategory = parentCategory;
|
||||
}
|
||||
|
||||
public String getCode()
|
||||
@ -33,4 +44,43 @@ public enum DeviceCategory
|
||||
{
|
||||
return info;
|
||||
}
|
||||
|
||||
public DeviceCategory getParentCategory()
|
||||
{
|
||||
return parentCategory;
|
||||
}
|
||||
// 缓存info与code的映射(优化查询效率)
|
||||
private static final Map<String, String> INFO_CODE_MAP = new HashMap<>();
|
||||
|
||||
// 静态块初始化缓存
|
||||
static {
|
||||
for (DeviceCategory category : DeviceCategory.values()) {
|
||||
INFO_CODE_MAP.put(category.info, category.code);
|
||||
}
|
||||
}
|
||||
|
||||
// 通过info获取code的方法
|
||||
public static String getCodeByInfo(String info) {
|
||||
return INFO_CODE_MAP.get(info); // 从缓存中直接获取,效率高
|
||||
}
|
||||
|
||||
// 通过code获取父类code
|
||||
// 根据字符串编码查找对应的枚举
|
||||
public static DeviceCategory fromCode(String code) {
|
||||
for (DeviceCategory category : values()) {
|
||||
if (category.code.equalsIgnoreCase(code)) { // 忽略大小写,增强兼容性
|
||||
return category;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String getInfoByCode(String code) {
|
||||
for (DeviceCategory category : DeviceCategory.values()) {
|
||||
if (category.code.equals(code)) {
|
||||
return category.info;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,49 @@
|
||||
package com.xzzn.common.enums;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* device-通信状态
|
||||
*
|
||||
* @author xzzn
|
||||
*/
|
||||
public enum DeviceRunningStatus
|
||||
{
|
||||
OFFLINE("0", "离线"),
|
||||
STANDBY("1", "待机") ,
|
||||
RUNNING("2", "运行"),
|
||||
FAULT("3", "故障"),
|
||||
SHUTDOWN("4", "停机");
|
||||
|
||||
private final String code;
|
||||
private final String info;
|
||||
|
||||
DeviceRunningStatus(String code, String info)
|
||||
{
|
||||
this.code = code;
|
||||
this.info = info;
|
||||
}
|
||||
|
||||
public String getCode()
|
||||
{
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getInfo()
|
||||
{
|
||||
return info;
|
||||
}
|
||||
|
||||
/** 停机状态 */
|
||||
public static List<String> getShutdownCodeList()
|
||||
{
|
||||
return Arrays.asList(SHUTDOWN.getCode());
|
||||
}
|
||||
|
||||
/** 运行状态 */
|
||||
public static List<String> getRunningCodeList()
|
||||
{
|
||||
return Arrays.asList(STANDBY.getCode(), RUNNING.getCode(), FAULT.getCode());
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,45 @@
|
||||
package com.xzzn.common.enums;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 设备点位类型
|
||||
*/
|
||||
public enum PointType
|
||||
{
|
||||
YES(1, "是"),
|
||||
NO(0, "否");
|
||||
|
||||
private final Integer code;
|
||||
private final String info;
|
||||
|
||||
private static final Map<Integer, String> CODE_NAME_MAP = new HashMap<>(PointType.values().length);
|
||||
|
||||
static {
|
||||
Arrays.stream(PointType.values()).forEach(record -> {
|
||||
CODE_NAME_MAP.put(record.code, record.info);
|
||||
});
|
||||
}
|
||||
|
||||
PointType(Integer code, String info)
|
||||
{
|
||||
this.code = code;
|
||||
this.info = info;
|
||||
}
|
||||
|
||||
public String getInfoByCode(Integer code) {
|
||||
return CODE_NAME_MAP.get(code);
|
||||
}
|
||||
|
||||
public Integer getCode()
|
||||
{
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getInfo()
|
||||
{
|
||||
return info;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,30 @@
|
||||
package com.xzzn.common.enums;
|
||||
|
||||
/**
|
||||
* 告警保护方案状态
|
||||
*
|
||||
* @author xzzn
|
||||
*/
|
||||
public enum ProtPlanStatus
|
||||
{
|
||||
STOP(0L, "未启用"), RUNNING(1L, "已启用");
|
||||
|
||||
private final Long code;
|
||||
private final String info;
|
||||
|
||||
ProtPlanStatus(Long code, String info)
|
||||
{
|
||||
this.code = code;
|
||||
this.info = info;
|
||||
}
|
||||
|
||||
public Long getCode()
|
||||
{
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getInfo()
|
||||
{
|
||||
return info;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,62 @@
|
||||
package com.xzzn.common.enums;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public enum SiteDevice
|
||||
{
|
||||
/**
|
||||
* 电池堆
|
||||
*/
|
||||
BMSD,
|
||||
|
||||
/**
|
||||
* 电池簇
|
||||
*/
|
||||
BMSC,
|
||||
|
||||
/**
|
||||
* PCS设备
|
||||
*/
|
||||
PCS,
|
||||
|
||||
/**
|
||||
* 电表-总表
|
||||
*/
|
||||
LOAD,
|
||||
|
||||
/**
|
||||
* 电表-光伏电表
|
||||
*/
|
||||
METEGF,
|
||||
|
||||
/**
|
||||
* 电表-储能电表
|
||||
*/
|
||||
METE,
|
||||
|
||||
/**
|
||||
* 电表-储能电表
|
||||
*/
|
||||
METE0,
|
||||
|
||||
/**
|
||||
* 动环
|
||||
*/
|
||||
donghuan,
|
||||
|
||||
/**
|
||||
* 动环
|
||||
*/
|
||||
DH,
|
||||
|
||||
/**
|
||||
* 中水冷却
|
||||
*/
|
||||
ZSLQ,
|
||||
|
||||
/**
|
||||
* EMS
|
||||
*/
|
||||
EMS
|
||||
}
|
||||
31
ems-common/src/main/java/com/xzzn/common/enums/SiteEnum.java
Normal file
31
ems-common/src/main/java/com/xzzn/common/enums/SiteEnum.java
Normal file
@ -0,0 +1,31 @@
|
||||
package com.xzzn.common.enums;
|
||||
|
||||
/**
|
||||
* device-设备类型
|
||||
*
|
||||
* @author xzzn
|
||||
*/
|
||||
|
||||
public enum SiteEnum
|
||||
{
|
||||
DDS("021_DDS_01", "电动所内部"), FX("021_FXX_01", "奉贤西部污水处理厂");
|
||||
|
||||
private final String code;
|
||||
private final String info;
|
||||
|
||||
SiteEnum(String code, String info)
|
||||
{
|
||||
this.code = code;
|
||||
this.info = info;
|
||||
}
|
||||
|
||||
public String getCode()
|
||||
{
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getInfo()
|
||||
{
|
||||
return info;
|
||||
}
|
||||
}
|
||||
@ -7,7 +7,7 @@ package com.xzzn.common.enums;
|
||||
*/
|
||||
public enum StrategyStatus
|
||||
{
|
||||
NOT_ENABLED("0", "未启用"), RUNNING("1", "已运行"),SUSPENDED("2", "已暂停"), DISABLE("1", "禁用"),DELETE("2", "删除");
|
||||
NOT_ENABLED("0", "未启用"), RUNNING("1", "已运行"),SUSPENDED("2", "已暂停"), DISABLE("3", "禁用"),DELETE("4", "删除");
|
||||
|
||||
private final String code;
|
||||
private final String info;
|
||||
|
||||
@ -1,18 +1,18 @@
|
||||
package com.xzzn.common.enums;
|
||||
|
||||
/**
|
||||
* pcs-设备状态
|
||||
* ticket - 工单状态
|
||||
*
|
||||
* @author xzzn
|
||||
*/
|
||||
public enum DeviceStatus
|
||||
public enum TicketStatus
|
||||
{
|
||||
ONLINE("0", "在线"), OFFLINE("1", "离线"), UNDER_REPAIR("2", "维修中");
|
||||
WAITING("1", "待处理"), PROCESSING("2", "处理中"),DONE("3", "已处理");
|
||||
|
||||
private final String code;
|
||||
private final String info;
|
||||
|
||||
DeviceStatus(String code, String info)
|
||||
TicketStatus(String code, String info)
|
||||
{
|
||||
this.code = code;
|
||||
this.info = info;
|
||||
@ -0,0 +1,39 @@
|
||||
package com.xzzn.common.enums;
|
||||
|
||||
/**
|
||||
* MQTT主题处理类型未知类型
|
||||
*/
|
||||
public enum TopicHandleType {
|
||||
DEVICE("DEVICE", "设备数据"),
|
||||
DEVICE_ALARM("DEVICE_ALARM", "设备告警数据"),
|
||||
STRATEGY("STRATEGY", "策略数据"),
|
||||
SYSTEM("SYSTEM", "系统数据"),
|
||||
;
|
||||
|
||||
private final String code;
|
||||
private final String info;
|
||||
|
||||
TopicHandleType(String code, String info) {
|
||||
this.code = code;
|
||||
this.info = info;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getInfo() {
|
||||
return info;
|
||||
}
|
||||
|
||||
// 根据名称查找枚举
|
||||
public static TopicHandleType getEnumByCode(String code) {
|
||||
for (TopicHandleType type : values()) {
|
||||
if (type.getName().equals(code)) {
|
||||
return type;
|
||||
}
|
||||
}
|
||||
// 默认返回SYSTEM
|
||||
return SYSTEM;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,39 @@
|
||||
package com.xzzn.common.utils;
|
||||
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
public class DataUtils {
|
||||
private static final Log log = LogFactory.getLog(DataUtils.class);
|
||||
|
||||
public static String getJSONFromFile(InputStream inputStream) {
|
||||
BufferedReader bufferReader = null;
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
try {
|
||||
InputStreamReader inputStreamReader = new InputStreamReader(inputStream, "utf-8");
|
||||
bufferReader = new BufferedReader(inputStreamReader);
|
||||
stringBuffer = new StringBuffer();
|
||||
String lineData = null;
|
||||
while ((lineData = bufferReader.readLine()) != null) {
|
||||
stringBuffer.append(lineData);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.warn("getJSONFromFile error", e);
|
||||
} finally {
|
||||
if (null != bufferReader) {
|
||||
try {
|
||||
bufferReader.close();
|
||||
inputStream.close();
|
||||
} catch (Exception e) {
|
||||
log.warn("getJSONFromFile error", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
return stringBuffer.toString();
|
||||
}
|
||||
}
|
||||
@ -1,5 +1,7 @@
|
||||
package com.xzzn.common.utils;
|
||||
|
||||
import com.xzzn.common.annotation.Log;
|
||||
|
||||
import java.lang.management.ManagementFactory;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
@ -8,9 +10,14 @@ import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
import java.time.ZoneId;
|
||||
import java.time.ZonedDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.time.format.DateTimeParseException;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.TimeZone;
|
||||
|
||||
import org.apache.commons.lang3.time.DateFormatUtils;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
/**
|
||||
* 时间工具类
|
||||
@ -19,6 +26,8 @@ import org.apache.commons.lang3.time.DateFormatUtils;
|
||||
*/
|
||||
public class DateUtils extends org.apache.commons.lang3.time.DateUtils
|
||||
{
|
||||
private static final org.apache.commons.logging.Log log = LogFactory.getLog(DateUtils.class);
|
||||
|
||||
public static String YYYY = "yyyy";
|
||||
|
||||
public static String YYYY_MM = "yyyy-MM";
|
||||
@ -29,6 +38,13 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
|
||||
|
||||
public static String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss";
|
||||
|
||||
public static String YYYYMMDD = "yyyyMMdd";
|
||||
|
||||
public static String YYYY_MM_DD_HH_MM_00 = "yyyy-MM-dd HH:mm:00";
|
||||
|
||||
private static final DateTimeFormatter DAY_INPUT_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
private static final DateTimeFormatter MIN_HOUR_INPUT_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
private static String[] parsePatterns = {
|
||||
"yyyy-MM-dd", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm", "yyyy-MM",
|
||||
"yyyy/MM/dd", "yyyy/MM/dd HH:mm:ss", "yyyy/MM/dd HH:mm", "yyyy/MM",
|
||||
@ -200,4 +216,247 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
|
||||
long date = calendar.get(Calendar.DAY_OF_MONTH); // 月份从0开始,所以要加1
|
||||
return date;
|
||||
}
|
||||
|
||||
// LocalDateTime 转 Date(带时区)
|
||||
public static Date convertToDate(LocalDateTime localDateTime) {
|
||||
ZonedDateTime zonedDateTime = localDateTime.atZone(ZoneId.systemDefault());
|
||||
return Date.from(zonedDateTime.toInstant());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取昨天的日期,格式为yyyy-MM-dd 23:59:59
|
||||
* @return 昨天的日期字符串
|
||||
*/
|
||||
public static String getYesterdayDate() {
|
||||
// 获取今天的日期
|
||||
LocalDate today = LocalDate.now();
|
||||
// 减去一天得到昨天
|
||||
LocalDate yesterday = today.minusDays(1);
|
||||
// 将日期转换为LocalDateTime,并设置时间为23:59:59
|
||||
LocalDateTime yesterdayEndTime = yesterday.atTime(23, 59, 59);
|
||||
// 定义日期格式化器
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(YYYY_MM_DD_HH_MM_SS);
|
||||
// 格式化并返回
|
||||
return yesterdayEndTime.format(formatter);
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验传入日期是否今天
|
||||
* @param dataDate
|
||||
* @return
|
||||
*/
|
||||
public static boolean checkIsToday(String dataDate) {
|
||||
boolean flag = false;
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
int todayMonth = calendar.get(Calendar.MONTH) + 1;
|
||||
int todayDay = calendar.get(Calendar.DAY_OF_MONTH);
|
||||
if (StringUtils.isNotEmpty(dataDate)){
|
||||
String[] pcsDateArray = dataDate.split("-");
|
||||
if (todayMonth == Integer.parseInt(pcsDateArray[1]) &&
|
||||
todayDay == Integer.parseInt(pcsDateArray[2])) {
|
||||
flag = true;
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 将时间转换为月份(YYYY-MM)
|
||||
*/
|
||||
public static String formatMonth(LocalDateTime time) {
|
||||
return time.format(DateTimeFormatter.ofPattern("yyyy-MM"));
|
||||
}
|
||||
|
||||
/**
|
||||
* 增加 LocalDateTime ==> String
|
||||
*/
|
||||
public static String convertToString(LocalDateTime time) {
|
||||
return time.format(DateTimeFormatter.ofPattern(YYYY_MM_DD_HH_MM_SS));
|
||||
}
|
||||
|
||||
/**
|
||||
* 将输入时间调整到下一分钟的整点(秒数强制为00)
|
||||
* 例如:2026-09-03 18:34:49 -> 2026-09-03 18:35:00
|
||||
* @param timeStr 输入时间字符串(支持yyyy-MM-dd HH:mm:ss格式)
|
||||
* @return 调整后的时间字符串(yyyy-MM-dd HH:mm:00)
|
||||
* @throws ParseException 时间格式错误时抛出
|
||||
*/
|
||||
public static String adjustToNextMinute(String timeStr) throws ParseException {
|
||||
// 1. 解析原始时间(使用包含秒数的格式)
|
||||
SimpleDateFormat fullFormat = new SimpleDateFormat(YYYY_MM_DD_HH_MM_SS);
|
||||
Date originalDate = fullFormat.parse(timeStr);
|
||||
|
||||
// 2. 使用Calendar调整时间
|
||||
Calendar cal = Calendar.getInstance();
|
||||
cal.setTime(originalDate);
|
||||
|
||||
// 3. 如果当前秒数大于0,自动进1分钟(否则保持当前分钟)
|
||||
if (cal.get(Calendar.SECOND) > 0) {
|
||||
cal.add(Calendar.MINUTE, 1); // 分钟+1
|
||||
}
|
||||
|
||||
// 4. 强制设置秒数和毫秒为0
|
||||
cal.set(Calendar.SECOND, 0);
|
||||
cal.set(Calendar.MILLISECOND, 0);
|
||||
|
||||
// 5. 格式化为目标字符串
|
||||
return new SimpleDateFormat(YYYY_MM_DD_HH_MM_00).format(cal.getTime());
|
||||
}
|
||||
|
||||
/**
|
||||
* 将"yyyy-MM-dd"字符串转换为Date类型的"yyyy-MM-dd 23:59:59"
|
||||
*/
|
||||
public static Date adjustToEndOfDay(String dateStr) {
|
||||
// 1. 解析字符串为LocalDate(仅日期)
|
||||
LocalDate localDate = LocalDate.parse(dateStr, DAY_INPUT_FORMATTER);
|
||||
|
||||
// 2. 补充时间为23:59:59,转换为LocalDateTime
|
||||
LocalDateTime localDateTime = localDate.atTime(23, 59, 59);
|
||||
|
||||
// 3. 转换为Date类型(兼容旧API)
|
||||
return Date.from(
|
||||
localDateTime.atZone(TimeZone.getDefault().toZoneId()) // 适配系统时区
|
||||
.toInstant()
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 将 "yyyy-MM-dd HH:mm:ss" 字符串转换为Date类型的"yyyy-MM-dd HH:00:00"
|
||||
*/
|
||||
public static Date adjustToStartOfHour(String inputTime) {
|
||||
// 1. 解析输入字符串为LocalDateTime(包含日期和小时、分钟)
|
||||
LocalDateTime inputLdt = LocalDateTime.parse(inputTime, MIN_HOUR_INPUT_FORMATTER);
|
||||
|
||||
// 2. 调整分钟为00,秒为00(保留日期和小时不变)
|
||||
LocalDateTime adjustedLdt = inputLdt
|
||||
.withMinute(00) // 强制设为00分
|
||||
.withSecond(00); // 强制设为00秒
|
||||
|
||||
// 3. 转换为Date类型(适配旧API)
|
||||
return Date.from(
|
||||
adjustedLdt.atZone(TimeZone.getDefault().toZoneId()) // 适配系统时区
|
||||
.toInstant()
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 将 "yyyy-MM-dd HH:mm:ss" 字符串转换为Date类型的"yyyy-MM-dd HH:mm:00"
|
||||
*/
|
||||
public static Date adjustToStartOfMinutes(String inputTime) {
|
||||
// 1. 解析输入字符串为LocalDateTime(包含日期和小时、分钟)
|
||||
LocalDateTime inputLdt = LocalDateTime.parse(inputTime, MIN_HOUR_INPUT_FORMATTER);
|
||||
|
||||
// 2. 调整分钟为00,秒为00(保留日期和小时不变)
|
||||
LocalDateTime adjustedLdt = inputLdt
|
||||
.withSecond(00); // 强制设为00秒
|
||||
|
||||
// 3. 转换为Date类型(适配旧API)
|
||||
return Date.from(
|
||||
adjustedLdt.atZone(TimeZone.getDefault().toZoneId()) // 适配系统时区
|
||||
.toInstant()
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 将时间转换为月份(YYYY-MM-DD HH:mm:00)
|
||||
*/
|
||||
public static Date timeConvertToDate(LocalDateTime time) {
|
||||
String dateStr = convertToString(time);
|
||||
return dateTime(YYYY_MM_DD_HH_MM_SS,dateStr);
|
||||
}
|
||||
|
||||
/**
|
||||
* 增加 Date ==> LocalDateTime
|
||||
*/
|
||||
public static LocalDateTime toLocalDateTime(Date date)
|
||||
{
|
||||
if (date == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// 1. Date → LocalDateTime(保留原始时间)
|
||||
LocalDateTime dateTime = date.toInstant()
|
||||
.atZone(TimeZone.getDefault().toZoneId()) // 关联时区
|
||||
.toLocalDateTime();
|
||||
return dateTime;
|
||||
}
|
||||
|
||||
// 时间戳转时间
|
||||
public static Date convertUpdateTime(Long updateTime) {
|
||||
if (updateTime == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// 兼容10位(秒级)和13位(毫秒级)
|
||||
int length = String.valueOf(updateTime).length();
|
||||
if (length == 10) { // 10位秒级 -> 转换为毫秒级
|
||||
updateTime *= 1000;
|
||||
} else if (length != 13) { // 既不是10位也不是13位,视为非法
|
||||
System.err.println("时间戳格式错误,必须是10位(秒)或13位(毫秒)");
|
||||
return null;
|
||||
}
|
||||
|
||||
// 3. 转换为Date
|
||||
return new Date(updateTime);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取昨天的日期,格式为yyyy-MM-dd
|
||||
* @return 昨天的日期字符串
|
||||
*/
|
||||
public static String getYesterdayDayString() {
|
||||
// 获取今天的日期
|
||||
LocalDate today = LocalDate.now();
|
||||
// 减去一天得到昨天
|
||||
LocalDate yesterday = today.minusDays(1);
|
||||
// 定义日期格式化器
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(YYYYMMDD);
|
||||
// 格式化并返回
|
||||
return yesterday.format(formatter);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取日期的开始时间
|
||||
* @param dateString 格式为yyyy-MM-dd的日期字符串
|
||||
* @return 日期的开始时间字符串
|
||||
*/
|
||||
public static String getDayBeginString(String dateString) {
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||
try {
|
||||
// 解析日期字符串
|
||||
LocalDate date = LocalDate.parse(dateString, formatter);
|
||||
|
||||
// 创建时间段的开始时间 00:00:00
|
||||
LocalDateTime startTime = date.atTime(LocalTime.MIN);
|
||||
|
||||
return convertToString(startTime);
|
||||
} catch (DateTimeParseException e) {
|
||||
log.info("Error parsing date: " + e.getMessage());
|
||||
}
|
||||
|
||||
return dateString + " 00:00:00";
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取日期的结束时间
|
||||
* @param dateString 格式为yyyy-MM-dd的日期字符串
|
||||
* @return 日期的结束时间字符串
|
||||
*/
|
||||
public static String getDayEndString(String dateString) {
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||
try {
|
||||
// 解析日期字符串
|
||||
LocalDate date = LocalDate.parse(dateString, formatter);
|
||||
|
||||
// 创建时间段的结束时间 23:59:59
|
||||
LocalDateTime endTime = date.atTime(LocalTime.MAX);
|
||||
|
||||
return convertToString(endTime);
|
||||
} catch (DateTimeParseException e) {
|
||||
log.info("Error parsing date: " + e.getMessage());
|
||||
}
|
||||
|
||||
return dateString + " 23:59:59";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
44
ems-common/src/main/java/com/xzzn/common/utils/MapUtils.java
Normal file
44
ems-common/src/main/java/com/xzzn/common/utils/MapUtils.java
Normal file
@ -0,0 +1,44 @@
|
||||
package com.xzzn.common.utils;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class MapUtils {
|
||||
/**
|
||||
* 从Map中获取值并转为Integer(适配tinyint字段)
|
||||
* @param map 数据源Map
|
||||
* @param key 字段名
|
||||
* @return 转换后的Integer,默认返回0(可根据业务调整默认值)
|
||||
*/
|
||||
public static Integer getInteger(Map<String, Object> map, String key) {
|
||||
// 1. 处理Map为null或key不存在的情况
|
||||
if (map == null || !map.containsKey(key)) {
|
||||
return 0;
|
||||
}
|
||||
// 2. 获取原始值
|
||||
Object value = map.get(key);
|
||||
if (value == null) {
|
||||
return 0;
|
||||
}
|
||||
// 3. 转换为Integer(处理常见类型)
|
||||
if (value instanceof Integer) {
|
||||
return (Integer) value;
|
||||
} else if (value instanceof Long) {
|
||||
// 若Map中存的是Long(如JSON解析时数字默认转为Long)
|
||||
return ((Long) value).intValue();
|
||||
} else if (value instanceof String) {
|
||||
// 若值是字符串类型(如"1")
|
||||
try {
|
||||
return Integer.parseInt((String) value);
|
||||
} catch (NumberFormatException e) {
|
||||
// 字符串无法转数字,返回默认值
|
||||
return 0;
|
||||
}
|
||||
} else if (value instanceof Boolean) {
|
||||
// 特殊情况:布尔值转整数(true→1,false→0)
|
||||
return (Boolean) value ? 1 : 0;
|
||||
} else {
|
||||
// 其他不支持的类型,返回默认值
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -751,4 +751,17 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
// 补全三位数字(返回字符串)
|
||||
public static String fillThreeDigits(String value) {
|
||||
if (value == null || value.trim().isEmpty()) {
|
||||
return "000";
|
||||
}
|
||||
try {
|
||||
int num = Integer.parseInt(value.trim());
|
||||
return String.format("%03d", num);
|
||||
} catch (NumberFormatException e) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,97 @@
|
||||
package com.xzzn.framework.aspectj;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.xzzn.common.utils.StringUtils;
|
||||
import com.xzzn.ems.domain.EmsDeviceChangeLog;
|
||||
import com.xzzn.ems.domain.MqttSyncLog;
|
||||
import com.xzzn.ems.mapper.EmsMqttTopicConfigMapper;
|
||||
import com.xzzn.ems.mapper.MqttSyncLogMapper;
|
||||
import com.xzzn.framework.web.service.MqttPublisher;
|
||||
import org.apache.juli.logging.Log;
|
||||
import org.apache.juli.logging.LogFactory;
|
||||
import org.aspectj.lang.JoinPoint;
|
||||
import org.aspectj.lang.annotation.AfterReturning;
|
||||
import org.aspectj.lang.annotation.Aspect;
|
||||
import org.aspectj.lang.annotation.Pointcut;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* 设备运行状态变更日志同步
|
||||
* 本地 - 云端
|
||||
*/
|
||||
@Aspect
|
||||
@Component
|
||||
public class DeviceChangeLogAspect {
|
||||
|
||||
private static final Log logger = LogFactory.getLog(DeviceChangeLogAspect.class);
|
||||
@Autowired
|
||||
private MqttPublisher mqttPublisher;
|
||||
|
||||
private static final ObjectMapper objectMapper = new ObjectMapper();
|
||||
private static final String MQTT_TOPIC = "DEVICE_CHANGE_LOG_UP";
|
||||
private static final String TABLE_NAME = "ems_device_change_log";
|
||||
@Autowired
|
||||
private MqttSyncLogMapper mqttSyncLogMapper;
|
||||
@Autowired
|
||||
private EmsMqttTopicConfigMapper emsMqttTopicConfigMapper;
|
||||
|
||||
// 定义切点:拦截策略相关表的Mapper方法
|
||||
@Pointcut("(execution(* com.xzzn.ems.mapper.EmsDeviceChangeLogMapper.insertEmsDeviceChangeLog(..)) && args(insertEntity)) ")
|
||||
public void insertPointCut(EmsDeviceChangeLog insertEntity) {
|
||||
logger.info("【新增设备运行状态变更日志】DeviceChangeLogAspect 实例化");
|
||||
}
|
||||
|
||||
// 方法执行成功后发布同步消息
|
||||
@AfterReturning(pointcut = "insertPointCut(insertEntity)", returning = "result")
|
||||
public void afterInsert(JoinPoint joinPoint, EmsDeviceChangeLog insertEntity, Integer result) {
|
||||
logger.info("【新增设备运行状态变更日志下发数据切面进入成功】");
|
||||
if (result == 0 || insertEntity == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 校验是否配置监听topic-监听则不发布
|
||||
String topic = emsMqttTopicConfigMapper.checkTopicIsExist(MQTT_TOPIC);
|
||||
if (!StringUtils.isEmpty(topic)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 解析方法名,获取操作类型(INSERT/UPDATE/DELETE)和表名
|
||||
String operateType = "INSERT";
|
||||
String siteId = insertEntity.getSiteId();
|
||||
|
||||
// 构建日志同步消息
|
||||
MqttSyncLog message = createMessageObject(operateType,siteId);
|
||||
|
||||
try {
|
||||
// 数据转换
|
||||
String content = objectMapper.writeValueAsString(insertEntity);
|
||||
message.setContent(content);
|
||||
|
||||
// mqtt同步到云端
|
||||
mqttPublisher.publish(MQTT_TOPIC, objectMapper.writeValueAsString(message), 1);
|
||||
} catch (Exception e) {
|
||||
message.setStatus("FAIL");
|
||||
message.setErrorMsg(e.getMessage());
|
||||
}
|
||||
// 存储同步信息
|
||||
mqttSyncLogMapper.insertMqttSyncLog(message);
|
||||
}
|
||||
|
||||
// 构建同步信息
|
||||
private MqttSyncLog createMessageObject(String operateType, String siteId) {
|
||||
MqttSyncLog message = new MqttSyncLog();
|
||||
message.setSyncId(UUID.randomUUID().toString());
|
||||
message.setOperateType(operateType);
|
||||
message.setTableName(TABLE_NAME);
|
||||
message.setCreateTime(new Date());
|
||||
message.setTopic(MQTT_TOPIC);
|
||||
message.setStatus("SUCCESS");
|
||||
message.setSyncObject(siteId);
|
||||
message.setTarget("CLOUD");
|
||||
return message;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,104 @@
|
||||
package com.xzzn.framework.aspectj;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.xzzn.common.utils.StringUtils;
|
||||
import com.xzzn.ems.domain.EmsAlarmRecords;
|
||||
import com.xzzn.ems.domain.MqttSyncLog;
|
||||
import com.xzzn.ems.mapper.EmsMqttTopicConfigMapper;
|
||||
import com.xzzn.ems.mapper.MqttSyncLogMapper;
|
||||
import com.xzzn.framework.web.service.MqttPublisher;
|
||||
import org.apache.juli.logging.Log;
|
||||
import org.apache.juli.logging.LogFactory;
|
||||
import org.aspectj.lang.JoinPoint;
|
||||
import org.aspectj.lang.annotation.AfterReturning;
|
||||
import org.aspectj.lang.annotation.Aspect;
|
||||
import org.aspectj.lang.annotation.Pointcut;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* 本地保护告警信息同步云端
|
||||
* 本地 - 云端
|
||||
* @author xzzn
|
||||
*/
|
||||
@Aspect
|
||||
@Component
|
||||
public class FaultPlanAlarmAspect
|
||||
{
|
||||
|
||||
private static final Log logger = LogFactory.getLog(FaultPlanAlarmAspect.class);
|
||||
|
||||
private static final ObjectMapper objectMapper = new ObjectMapper();
|
||||
@Autowired
|
||||
private MqttSyncLogMapper mqttSyncLogMapper;
|
||||
@Autowired
|
||||
private MqttPublisher mqttPublisher;
|
||||
@Autowired
|
||||
private EmsMqttTopicConfigMapper emsMqttTopicConfigMapper;
|
||||
|
||||
private static final String MQTT_TOPIC = "FAULT_ALARM_RECORD_UP";
|
||||
private static final String TABLE_NAME = "ems_alarm_records";
|
||||
// 切入点:拦截所有添加了@SyncAfterInsert注解的方法
|
||||
@Pointcut("@annotation(com.xzzn.common.annotation.SyncAfterInsert)")
|
||||
public void syncInsertPointcut() {}
|
||||
|
||||
// 方法执行成功后同步数据
|
||||
@AfterReturning(pointcut = "syncInsertPointcut()", returning = "result")
|
||||
public void afterInsert(JoinPoint joinPoint, Integer result) {
|
||||
logger.info("【新增保护策略告警数据切面进入成功】");
|
||||
if (result == 0) {
|
||||
return;
|
||||
}
|
||||
// 校验是否配置监听topic-监听则不发布
|
||||
String topic = emsMqttTopicConfigMapper.checkTopicIsExist(MQTT_TOPIC);
|
||||
if (!StringUtils.isEmpty(topic)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 获取参数中的EmsAlarmRecords对象
|
||||
Object[] args = joinPoint.getArgs();
|
||||
EmsAlarmRecords alarmRecords = null;
|
||||
for (Object arg : args) {
|
||||
if (arg instanceof EmsAlarmRecords) {
|
||||
alarmRecords = (EmsAlarmRecords) arg;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (alarmRecords == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 构建日志同步消息
|
||||
MqttSyncLog message = createMessageObject("INSERT", alarmRecords.getSiteId());
|
||||
try {
|
||||
// 同步内容
|
||||
String content = objectMapper.writeValueAsString(alarmRecords);
|
||||
message.setContent(content);
|
||||
|
||||
// 发布到MQTT主题-同步到云端
|
||||
mqttPublisher.publish(MQTT_TOPIC, objectMapper.writeValueAsString(message), 1);
|
||||
} catch (Exception e) {
|
||||
message.setStatus("FAIL");
|
||||
message.setErrorMsg(e.getMessage());
|
||||
}
|
||||
// 存储同步信息
|
||||
mqttSyncLogMapper.insertMqttSyncLog(message);
|
||||
}
|
||||
|
||||
// 构建同步信息
|
||||
private MqttSyncLog createMessageObject(String operateType, String siteId) {
|
||||
MqttSyncLog message = new MqttSyncLog();
|
||||
message.setSyncId(UUID.randomUUID().toString());
|
||||
message.setOperateType(operateType);
|
||||
message.setTableName(TABLE_NAME);
|
||||
message.setCreateTime(new Date());
|
||||
message.setTopic(MQTT_TOPIC);
|
||||
message.setStatus("SUCCESS");
|
||||
message.setSyncObject(siteId);
|
||||
message.setTarget("CLOUD");
|
||||
return message;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,98 @@
|
||||
package com.xzzn.framework.aspectj;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.xzzn.common.utils.StringUtils;
|
||||
import com.xzzn.ems.domain.EmsFaultIssueLog;
|
||||
import com.xzzn.ems.domain.MqttSyncLog;
|
||||
import com.xzzn.ems.mapper.EmsMqttTopicConfigMapper;
|
||||
import com.xzzn.ems.mapper.MqttSyncLogMapper;
|
||||
import com.xzzn.framework.web.service.MqttPublisher;
|
||||
import org.apache.juli.logging.Log;
|
||||
import org.apache.juli.logging.LogFactory;
|
||||
import org.aspectj.lang.JoinPoint;
|
||||
import org.aspectj.lang.annotation.AfterReturning;
|
||||
import org.aspectj.lang.annotation.Aspect;
|
||||
import org.aspectj.lang.annotation.Pointcut;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* 保护告警方案下发日志同步
|
||||
* 本地 - 云端
|
||||
*/
|
||||
@Aspect
|
||||
@Component
|
||||
public class FaultPlanIssueAspect {
|
||||
|
||||
private static final Log logger = LogFactory.getLog(FaultPlanIssueAspect.class);
|
||||
@Autowired
|
||||
private MqttPublisher mqttPublisher;
|
||||
|
||||
private static final ObjectMapper objectMapper = new ObjectMapper();
|
||||
private static final String MQTT_TOPIC = "FAULT_PLAN_ISSUE_UP";
|
||||
private static final String TABLE_NAME = "ems_fault_issue_log";
|
||||
@Autowired
|
||||
private EmsMqttTopicConfigMapper emsMqttTopicConfigMapper;
|
||||
@Autowired
|
||||
private MqttSyncLogMapper mqttSyncLogMapper;
|
||||
|
||||
// 定义切点:拦截策略相关表的Mapper方法
|
||||
@Pointcut("(execution(* com.xzzn.ems.mapper.EmsFaultIssueLogMapper.insertEmsFaultIssueLog(..)) && args(insertEntity)) ")
|
||||
public void insertPointCut(EmsFaultIssueLog insertEntity) {
|
||||
logger.info("【新增保护告警策略下发数据】FaultPlanIssueAspect 实例化");
|
||||
}
|
||||
|
||||
// 方法执行成功后发布同步消息
|
||||
@AfterReturning(pointcut = "insertPointCut(insertEntity)", returning = "result")
|
||||
public void afterInsert(JoinPoint joinPoint, EmsFaultIssueLog insertEntity, Integer result) {
|
||||
logger.info("【新增保护告警策略下发数据切面进入成功】");
|
||||
if (result == 0 || insertEntity == null) {
|
||||
return;
|
||||
}
|
||||
// 校验是否配置监听topic-监听则不发布
|
||||
String topic = emsMqttTopicConfigMapper.checkTopicIsExist(MQTT_TOPIC);
|
||||
if (!StringUtils.isEmpty(topic)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 解析方法名,获取操作类型(INSERT/UPDATE/DELETE)和表名
|
||||
String operateType = "INSERT";
|
||||
String siteId = insertEntity.getSiteId();
|
||||
|
||||
// 构建日志同步消息
|
||||
MqttSyncLog message = createMessageObject(operateType,siteId);
|
||||
|
||||
try {
|
||||
// 数据转换
|
||||
String content = objectMapper.writeValueAsString(insertEntity);
|
||||
message.setContent(content);
|
||||
|
||||
// mqtt同步到云端
|
||||
mqttPublisher.publish(MQTT_TOPIC, objectMapper.writeValueAsString(message), 1);
|
||||
} catch (Exception e) {
|
||||
message.setStatus("FAIL");
|
||||
message.setErrorMsg(e.getMessage());
|
||||
}
|
||||
// 存储同步信息
|
||||
mqttSyncLogMapper.insertMqttSyncLog(message);
|
||||
}
|
||||
|
||||
// 构建同步信息
|
||||
private MqttSyncLog createMessageObject(String operateType, String siteId) {
|
||||
MqttSyncLog message = new MqttSyncLog();
|
||||
message.setSyncId(UUID.randomUUID().toString());
|
||||
message.setOperateType(operateType);
|
||||
message.setTableName(TABLE_NAME);
|
||||
message.setCreateTime(new Date());
|
||||
message.setTopic(MQTT_TOPIC);
|
||||
message.setStatus("SUCCESS");
|
||||
message.setSyncObject(siteId);
|
||||
message.setTarget("CLOUD");
|
||||
return message;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,277 @@
|
||||
package com.xzzn.framework.aspectj;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.xzzn.common.utils.StringUtils;
|
||||
import com.xzzn.ems.domain.EmsFaultProtectionPlan;
|
||||
import com.xzzn.ems.domain.MqttSyncLog;
|
||||
import com.xzzn.ems.mapper.EmsFaultProtectionPlanMapper;
|
||||
import com.xzzn.ems.mapper.EmsMqttTopicConfigMapper;
|
||||
import com.xzzn.ems.mapper.MqttSyncLogMapper;
|
||||
import com.xzzn.framework.web.service.MqttPublisher;
|
||||
import org.apache.juli.logging.Log;
|
||||
import org.apache.juli.logging.LogFactory;
|
||||
import org.aspectj.lang.JoinPoint;
|
||||
import org.aspectj.lang.annotation.AfterReturning;
|
||||
import org.aspectj.lang.annotation.Aspect;
|
||||
import org.aspectj.lang.annotation.Before;
|
||||
import org.aspectj.lang.annotation.Pointcut;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.cglib.beans.BeanMap;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* 设备保护告警方案同步
|
||||
* 云端 - 本地
|
||||
*/
|
||||
@Aspect
|
||||
@Component
|
||||
public class FaultProtPlanAspect {
|
||||
private static final Log logger = LogFactory.getLog(FaultProtPlanAspect.class);
|
||||
@Autowired
|
||||
private MqttPublisher mqttPublisher;
|
||||
|
||||
private static final ObjectMapper objectMapper = new ObjectMapper();
|
||||
private static final String MQTT_TOPIC = "FAULT_PROTECTION_PLAN_UP";
|
||||
private static final String TABLE_NAME = "ems_fault_protection_plan";
|
||||
@Autowired
|
||||
private EmsMqttTopicConfigMapper emsMqttTopicConfigMapper;
|
||||
@Autowired
|
||||
private MqttSyncLogMapper mqttSyncLogMapper;
|
||||
@Autowired
|
||||
private EmsFaultProtectionPlanMapper emsFaultProtectionPlanMapper;
|
||||
|
||||
// 用ThreadLocal暂存删除前的对象
|
||||
private ThreadLocal<EmsFaultProtectionPlan> beforeDeleteThreadLocal = new ThreadLocal<>();
|
||||
@Before("execution(* com.xzzn.ems.mapper.EmsFaultProtectionPlanMapper.deleteEmsFaultProtectionPlanByIds(..)) && args(ids)")
|
||||
public void beforeDelete(JoinPoint joinPoint, Long[] ids) {
|
||||
// 获取删除的id
|
||||
Object[] args = joinPoint.getArgs();
|
||||
if (args == null || args.length == 0) {
|
||||
return;
|
||||
}
|
||||
Long[] id = (Long[]) args[0];
|
||||
|
||||
// 查询删除前的数据
|
||||
EmsFaultProtectionPlan faultInfo = emsFaultProtectionPlanMapper.selectEmsFaultProtectionPlanById(id[0]);
|
||||
beforeDeleteThreadLocal.set(faultInfo); // 暂存
|
||||
}
|
||||
|
||||
// 定义切点:拦截策略相关表的Mapper方法
|
||||
@Pointcut("(execution(* com.xzzn.ems.mapper.EmsFaultProtectionPlanMapper.insertEmsFaultProtectionPlan(..)) && args(insertEntity)) ")
|
||||
public void insertPointCut(EmsFaultProtectionPlan insertEntity) {
|
||||
logger.info("【新增设备保护告警】FaultProtPlanAspect 实例化");
|
||||
}
|
||||
@Pointcut("(execution(* com.xzzn.ems.mapper.EmsFaultProtectionPlanMapper.updateEmsFaultProtectionPlan(..)) && args(updateEntity)) ")
|
||||
public void updatePointCut(EmsFaultProtectionPlan updateEntity) {
|
||||
logger.info("【更新设备保护告警】FaultProtPlanAspect 实例化");
|
||||
}
|
||||
@Pointcut("(execution(* com.xzzn.ems.mapper.EmsFaultProtectionPlanMapper.deleteEmsFaultProtectionPlanByIds(..)) && args(ids)) ")
|
||||
public void deletePointCut(Long[] ids) {
|
||||
logger.info("【删除设备保护告警】FaultProtPlanAspect 实例化");
|
||||
}
|
||||
|
||||
// 方法执行成功后发布同步消息
|
||||
@AfterReturning(pointcut = "insertPointCut(insertEntity)", returning = "result")
|
||||
public void afterInsert(JoinPoint joinPoint, EmsFaultProtectionPlan insertEntity, Integer result) {
|
||||
logger.info("【新增设备保护告警切面进入成功】");
|
||||
if (result == 0 || insertEntity == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 校验是否配置监听topic-监听则不发布
|
||||
String topic = emsMqttTopicConfigMapper.checkTopicIsExist(MQTT_TOPIC);
|
||||
if (!StringUtils.isEmpty(topic)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 解析方法名,获取操作类型(INSERT/UPDATE/DELETE)和表名
|
||||
String methodName = joinPoint.getSignature().getName();
|
||||
String operateType = getOperateType(methodName);
|
||||
String siteId = insertEntity.getSiteId();
|
||||
|
||||
// 构建日志同步消息
|
||||
MqttSyncLog message = createMessageObject(operateType,siteId);
|
||||
|
||||
try {
|
||||
// 数据转换
|
||||
String content = convertEntityToJson(insertEntity);
|
||||
message.setContent(content);
|
||||
|
||||
// 发布到MQTT主题
|
||||
mqttPublisher.publish(MQTT_TOPIC, objectMapper.writeValueAsString(message), 1);
|
||||
} catch (Exception e) {
|
||||
message.setStatus("FAIL");
|
||||
message.setErrorMsg(e.getMessage());
|
||||
}
|
||||
// 存储同步信息
|
||||
mqttSyncLogMapper.insertMqttSyncLog(message);
|
||||
}
|
||||
@AfterReturning(pointcut = "updatePointCut(updateEntity)", returning = "result")
|
||||
public void afterUpdate(JoinPoint joinPoint, EmsFaultProtectionPlan updateEntity, Integer result) {
|
||||
logger.info("【更新设备保护告警切面进入成功】");
|
||||
if (result == 0 || updateEntity == null) {
|
||||
return;
|
||||
}
|
||||
// 校验是否配置监听topic-监听则不发布
|
||||
String topic = emsMqttTopicConfigMapper.checkTopicIsExist(MQTT_TOPIC);
|
||||
if (!StringUtils.isEmpty(topic)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 解析方法名,获取操作类型(INSERT/UPDATE/DELETE)和表名
|
||||
String methodName = joinPoint.getSignature().getName();
|
||||
String operateType = getOperateType(methodName);
|
||||
String siteId = updateEntity.getSiteId();
|
||||
|
||||
// 构建日志同步消息
|
||||
MqttSyncLog message = createMessageObject(operateType,siteId);
|
||||
|
||||
try {
|
||||
// 数据转换
|
||||
String content = convertEntityToJson(updateEntity);
|
||||
message.setContent(content);
|
||||
|
||||
// 发布到MQTT主题
|
||||
mqttPublisher.publish(MQTT_TOPIC, objectMapper.writeValueAsString(message), 1);
|
||||
} catch (Exception e) {
|
||||
message.setStatus("FAIL");
|
||||
message.setErrorMsg(e.getMessage());
|
||||
}
|
||||
// 存储同步信息
|
||||
mqttSyncLogMapper.insertMqttSyncLog(message);
|
||||
}
|
||||
@AfterReturning(pointcut = "deletePointCut(id)", returning = "result")
|
||||
public void afterDelete(JoinPoint joinPoint, Long[] id, Integer result) {
|
||||
logger.info("【删除设备保护告警切面进入成功】");
|
||||
if (result == 0 || id == null) {
|
||||
return;
|
||||
}
|
||||
// 校验是否配置监听topic-监听则不发布
|
||||
String topic = emsMqttTopicConfigMapper.checkTopicIsExist(MQTT_TOPIC);
|
||||
if (!StringUtils.isEmpty(topic)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 解析方法名,获取操作类型(INSERT/UPDATE/DELETE)和表名
|
||||
String methodName = joinPoint.getSignature().getName();
|
||||
String operateType = getOperateType(methodName);
|
||||
|
||||
// 从ThreadLocal中获取删除前的对象
|
||||
EmsFaultProtectionPlan faultInfo = beforeDeleteThreadLocal.get();
|
||||
if (faultInfo == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 构建日志同步消息
|
||||
MqttSyncLog message = createMessageObject(operateType,faultInfo.getSiteId());
|
||||
|
||||
try {
|
||||
// 数据转换
|
||||
String content = convertEntityToJson(faultInfo);
|
||||
message.setContent(content);
|
||||
|
||||
// 发布到MQTT主题
|
||||
mqttPublisher.publish(MQTT_TOPIC, objectMapper.writeValueAsString(message), 1);
|
||||
} catch (Exception e) {
|
||||
message.setStatus("FAIL");
|
||||
message.setErrorMsg(e.getMessage());
|
||||
}
|
||||
// 存储同步信息
|
||||
mqttSyncLogMapper.insertMqttSyncLog(message);
|
||||
}
|
||||
|
||||
// 构建同步信息
|
||||
private MqttSyncLog createMessageObject(String operateType, String siteId) {
|
||||
MqttSyncLog message = new MqttSyncLog();
|
||||
message.setSyncId(UUID.randomUUID().toString());
|
||||
message.setOperateType(operateType);
|
||||
message.setTableName(TABLE_NAME);
|
||||
message.setCreateTime(new Date());
|
||||
message.setTopic(MQTT_TOPIC);
|
||||
message.setStatus("SUCCESS");
|
||||
message.setSyncObject("CLOUD");
|
||||
message.setTarget(siteId);
|
||||
return message;
|
||||
}
|
||||
|
||||
// 从方法名判断操作类型(示例:insert→INSERT,update→UPDATE,delete→DELETE)
|
||||
private String getOperateType(String methodName) {
|
||||
if (methodName.startsWith("insert")) return "INSERT";
|
||||
if (methodName.startsWith("stop")) return "STOP";
|
||||
if (methodName.startsWith("update") || methodName.startsWith("stop")) return "UPDATE";
|
||||
if (methodName.startsWith("delete")) return "DELETE";
|
||||
return "UNKNOWN";
|
||||
}
|
||||
|
||||
// 从方法参数提取数据(示例:若参数是实体类,转成Map)
|
||||
private Map<String, Object> extractDataFromParams(Object[] args) {
|
||||
// 实际需反射获取实体类的字段和值(如id、name等)
|
||||
Map<String, Object> data = new HashMap<>();
|
||||
if (args == null || args.length == 0) {
|
||||
return data;
|
||||
}
|
||||
|
||||
for (int i = 0; i < args.length; i++) {
|
||||
Object arg = args[i];
|
||||
if (arg == null) {
|
||||
continue; // 跳过null参数
|
||||
}
|
||||
|
||||
// 处理基本类型/包装类/字符串(直接作为值存入,key为"param0"、"param1"等)
|
||||
if (isBasicType(arg.getClass())) {
|
||||
String key = "param" + i; // 基本类型参数用"param0"、"param1"作为key
|
||||
data.put(key, arg);
|
||||
} else {
|
||||
Map<String, Object> beanMap = beanToMap(arg);
|
||||
data.putAll(beanMap); // 合并实体类的字段到结果Map
|
||||
}
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否为基本类型或包装类或字符串
|
||||
*/
|
||||
private boolean isBasicType(Class<?> clazz) {
|
||||
return clazz.isPrimitive() // 基本类型(int、long、boolean等)
|
||||
|| clazz == String.class // 字符串
|
||||
|| Number.class.isAssignableFrom(clazz) // 数字包装类(Integer、Long等)
|
||||
|| clazz == Boolean.class; // 布尔包装类
|
||||
}
|
||||
|
||||
/**
|
||||
* 将实体类转换为Map(字段名为key,字段值为value)
|
||||
*/
|
||||
private Map<String, Object> beanToMap(Object bean) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
if (bean == null) {
|
||||
return map;
|
||||
}
|
||||
|
||||
// 方式1:使用BeanMap(简洁高效)
|
||||
BeanMap beanMap = BeanMap.create(bean);
|
||||
for (Object key : beanMap.keySet()) {
|
||||
map.put(key.toString(), beanMap.get(key));
|
||||
}
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
// 在方法中转换
|
||||
public String convertEntityToJson(EmsFaultProtectionPlan insertEntity) throws Exception {
|
||||
if (insertEntity == null) {
|
||||
return null; // 空对象返回空JSON
|
||||
}
|
||||
|
||||
// 将实体类转换为JSON字符串
|
||||
return objectMapper.writeValueAsString(insertEntity);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,267 @@
|
||||
package com.xzzn.framework.aspectj;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.xzzn.common.utils.StringUtils;
|
||||
import com.xzzn.ems.domain.EmsStrategyRunning;
|
||||
import com.xzzn.ems.domain.MqttSyncLog;
|
||||
import com.xzzn.ems.domain.vo.StrategyRunningVo;
|
||||
import com.xzzn.ems.mapper.EmsMqttTopicConfigMapper;
|
||||
import com.xzzn.ems.mapper.EmsStrategyRunningMapper;
|
||||
import com.xzzn.ems.mapper.MqttSyncLogMapper;
|
||||
import com.xzzn.framework.web.service.MqttPublisher;
|
||||
import org.apache.juli.logging.Log;
|
||||
import org.apache.juli.logging.LogFactory;
|
||||
import org.aspectj.lang.JoinPoint;
|
||||
import org.aspectj.lang.annotation.AfterReturning;
|
||||
import org.aspectj.lang.annotation.Aspect;
|
||||
import org.aspectj.lang.annotation.Pointcut;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.cglib.beans.BeanMap;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 策略运行切面同步
|
||||
* 云端 - 本地
|
||||
*/
|
||||
@Aspect
|
||||
@Component
|
||||
public class StrategyRunningSyncAspect {
|
||||
|
||||
private static final Log logger = LogFactory.getLog(StrategyRunningSyncAspect.class);
|
||||
@Autowired
|
||||
private MqttPublisher mqttPublisher;
|
||||
|
||||
private static final ObjectMapper objectMapper = new ObjectMapper();
|
||||
private static final String MQTT_TOPIC = "EMS_STRATEGY_UP";
|
||||
private static final String TABLE_NAME = "ems_strategy_running";
|
||||
@Autowired
|
||||
private EmsMqttTopicConfigMapper emsMqttTopicConfigMapper;
|
||||
@Autowired
|
||||
private MqttSyncLogMapper mqttSyncLogMapper;
|
||||
@Autowired
|
||||
private EmsStrategyRunningMapper emsStrategyRunningMapper;
|
||||
|
||||
@Pointcut("(execution(* com.xzzn.ems.mapper.EmsStrategyRunningMapper.stopEmsStrategyRunning(..)) && args(id)) ")
|
||||
public void stopPointCut(Long id) {
|
||||
logger.info("【停止策略切面】StrategyAspect 被实例化");
|
||||
}
|
||||
@Pointcut("(execution(* com.xzzn.ems.mapper.EmsStrategyRunningMapper.insertEmsStrategyRunning(..)) && args(insertEntity)) ")
|
||||
public void insertPointCut(EmsStrategyRunning insertEntity) {
|
||||
logger.info("【新增策略切面】StrategyAspect 被实例化");
|
||||
}
|
||||
@Pointcut("(execution(* com.xzzn.ems.mapper.EmsStrategyRunningMapper.updateEmsStrategyRunning(..)) && args(updateEntity)) ")
|
||||
public void updatePointCut(EmsStrategyRunning updateEntity) {
|
||||
logger.info("【更新策略切面】StrategyAspect 被实例化");
|
||||
}
|
||||
|
||||
// 方法执行成功后发布同步消息
|
||||
@AfterReturning(pointcut = "updatePointCut(updateEntity)", returning = "result")
|
||||
public void afterUpdate(JoinPoint joinPoint, EmsStrategyRunning updateEntity, Integer result) {
|
||||
logger.info("【更新策略切面进入成功】");
|
||||
if (result == 0 || updateEntity == null) {
|
||||
return;
|
||||
}
|
||||
// 校验是否配置监听topic-监听则不发布
|
||||
String topic = emsMqttTopicConfigMapper.checkTopicIsExist(MQTT_TOPIC);
|
||||
if (!StringUtils.isEmpty(topic)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 解析方法名,获取操作类型(INSERT/UPDATE/DELETE)和表名
|
||||
String methodName = joinPoint.getSignature().getName();
|
||||
String operateType = getOperateType(methodName);
|
||||
String siteId = updateEntity.getSiteId();
|
||||
|
||||
// 构建日志同步消息
|
||||
MqttSyncLog message = createMessageObject(operateType,siteId);
|
||||
|
||||
try {
|
||||
// 数据转换
|
||||
List<StrategyRunningVo> runningVos = emsStrategyRunningMapper.getRunningList(siteId);
|
||||
if (runningVos == null || runningVos.size() == 0) {
|
||||
return;
|
||||
}
|
||||
StrategyRunningVo runningVo = runningVos.get(0);
|
||||
String content = objectMapper.writeValueAsString(runningVo);
|
||||
message.setContent(content);
|
||||
|
||||
// 发布到MQTT主题
|
||||
mqttPublisher.publish(MQTT_TOPIC, objectMapper.writeValueAsString(message), 1);
|
||||
} catch (Exception e) {
|
||||
message.setStatus("FAIL");
|
||||
message.setErrorMsg(e.getMessage());
|
||||
}
|
||||
// 存储同步信息
|
||||
mqttSyncLogMapper.insertMqttSyncLog(message);
|
||||
}
|
||||
|
||||
@AfterReturning(pointcut = "insertPointCut(insertEntity)", returning = "result")
|
||||
public void afterInsert(JoinPoint joinPoint, EmsStrategyRunning insertEntity, Integer result) {
|
||||
logger.info("【新增策略切面进入成功】");
|
||||
if (result == 0 || insertEntity == null) {
|
||||
return;
|
||||
}
|
||||
// 校验是否配置监听topic-监听则不发布
|
||||
String topic = emsMqttTopicConfigMapper.checkTopicIsExist(MQTT_TOPIC);
|
||||
if (!StringUtils.isEmpty(topic)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 解析方法名,获取操作类型(INSERT/UPDATE/DELETE)和表名
|
||||
String methodName = joinPoint.getSignature().getName();
|
||||
String operateType = getOperateType(methodName);
|
||||
String siteId = insertEntity.getSiteId();
|
||||
|
||||
// 构建日志同步消息
|
||||
MqttSyncLog message = createMessageObject(operateType, siteId);
|
||||
|
||||
try {
|
||||
// 数据转换
|
||||
List<StrategyRunningVo> runningVos = emsStrategyRunningMapper.getRunningList(siteId);
|
||||
if (runningVos == null || runningVos.size() == 0) {
|
||||
return;
|
||||
}
|
||||
StrategyRunningVo runningVo = runningVos.get(0);
|
||||
String content = objectMapper.writeValueAsString(runningVo);
|
||||
message.setContent(content);
|
||||
|
||||
// 发布到MQTT主题
|
||||
mqttPublisher.publish(MQTT_TOPIC, objectMapper.writeValueAsString(message), 1);
|
||||
} catch (Exception e) {
|
||||
message.setStatus("FAIL");
|
||||
message.setErrorMsg(e.getMessage());
|
||||
}
|
||||
// 存储同步信息
|
||||
mqttSyncLogMapper.insertMqttSyncLog(message);
|
||||
}
|
||||
|
||||
@AfterReturning(pointcut = "stopPointCut(id)", returning = "result")
|
||||
public void afterStop(JoinPoint joinPoint, Long id, Integer result) {
|
||||
logger.info("【停止策略切面进入成功】");
|
||||
if (result == 0 || id == null) {
|
||||
return;
|
||||
}
|
||||
// 校验是否配置监听topic-监听则不发布
|
||||
String topic = emsMqttTopicConfigMapper.checkTopicIsExist(MQTT_TOPIC);
|
||||
if (!StringUtils.isEmpty(topic)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 解析方法名,获取操作类型(INSERT/UPDATE/DELETE)和表名
|
||||
String methodName = joinPoint.getSignature().getName();
|
||||
String operateType = getOperateType(methodName);
|
||||
EmsStrategyRunning emsStrategyRunning = emsStrategyRunningMapper.selectEmsStrategyRunningById(id);
|
||||
String siteId = emsStrategyRunning==null ? null : emsStrategyRunning.getSiteId();
|
||||
|
||||
// 构建日志同步消息
|
||||
MqttSyncLog message = createMessageObject(operateType, siteId);
|
||||
|
||||
try {
|
||||
// 数据转换
|
||||
Map<String, Object> idMap = new HashMap<>();
|
||||
idMap.put("id", id); // 手动将参数值映射到"id"字段
|
||||
String content = JSON.toJSONString(idMap);
|
||||
message.setContent(content);
|
||||
|
||||
// 发布到MQTT主题
|
||||
mqttPublisher.publish(MQTT_TOPIC, objectMapper.writeValueAsString(message), 1);
|
||||
} catch (Exception e) {
|
||||
message.setStatus("FAIL");
|
||||
message.setErrorMsg(e.getMessage());
|
||||
}
|
||||
// 存储同步信息
|
||||
mqttSyncLogMapper.insertMqttSyncLog(message);
|
||||
}
|
||||
|
||||
// 构建同步信息
|
||||
private MqttSyncLog createMessageObject(String operateType, String siteId) {
|
||||
MqttSyncLog message = new MqttSyncLog();
|
||||
message.setSyncId(UUID.randomUUID().toString());
|
||||
message.setOperateType(operateType);
|
||||
message.setTableName(TABLE_NAME);
|
||||
message.setCreateTime(new Date());
|
||||
message.setTopic(MQTT_TOPIC);
|
||||
message.setStatus("SUCCESS");
|
||||
message.setSyncObject("CLOUD");
|
||||
message.setTarget(siteId);
|
||||
return message;
|
||||
}
|
||||
// 从方法名判断操作类型(示例:insert→INSERT,update→UPDATE,delete→DELETE)
|
||||
private String getOperateType(String methodName) {
|
||||
if (methodName.startsWith("insert")) return "INSERT";
|
||||
if (methodName.startsWith("stop")) return "STOP";
|
||||
if (methodName.startsWith("update") || methodName.startsWith("stop")) return "UPDATE";
|
||||
if (methodName.startsWith("delete")) return "DELETE";
|
||||
return "UNKNOWN";
|
||||
}
|
||||
|
||||
// 从方法参数提取数据(示例:若参数是实体类,转成Map)
|
||||
private Map<String, Object> extractDataFromParams(Object[] args) {
|
||||
// 实际需反射获取实体类的字段和值(如id、name等)
|
||||
Map<String, Object> data = new HashMap<>();
|
||||
if (args == null || args.length == 0) {
|
||||
return data;
|
||||
}
|
||||
|
||||
for (int i = 0; i < args.length; i++) {
|
||||
Object arg = args[i];
|
||||
if (arg == null) {
|
||||
continue; // 跳过null参数
|
||||
}
|
||||
|
||||
// 处理基本类型/包装类/字符串(直接作为值存入,key为"param0"、"param1"等)
|
||||
if (isBasicType(arg.getClass())) {
|
||||
String key = "param" + i; // 基本类型参数用"param0"、"param1"作为key
|
||||
data.put(key, arg);
|
||||
} else {
|
||||
Map<String, Object> beanMap = beanToMap(arg);
|
||||
data.putAll(beanMap); // 合并实体类的字段到结果Map
|
||||
}
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否为基本类型或包装类或字符串
|
||||
*/
|
||||
private boolean isBasicType(Class<?> clazz) {
|
||||
return clazz.isPrimitive() // 基本类型(int、long、boolean等)
|
||||
|| clazz == String.class // 字符串
|
||||
|| Number.class.isAssignableFrom(clazz) // 数字包装类(Integer、Long等)
|
||||
|| clazz == Boolean.class; // 布尔包装类
|
||||
}
|
||||
|
||||
/**
|
||||
* 将实体类转换为Map(字段名为key,字段值为value)
|
||||
*/
|
||||
private Map<String, Object> beanToMap(Object bean) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
if (bean == null) {
|
||||
return map;
|
||||
}
|
||||
|
||||
// 方式1:使用BeanMap(简洁高效)
|
||||
BeanMap beanMap = BeanMap.create(bean);
|
||||
for (Object key : beanMap.keySet()) {
|
||||
map.put(key.toString(), beanMap.get(key));
|
||||
}
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
// 在方法中转换
|
||||
public String convertEntityToJson(EmsStrategyRunning insertEntity) throws Exception {
|
||||
if (insertEntity == null) {
|
||||
return null; // 空对象返回空JSON
|
||||
}
|
||||
|
||||
// 将实体类转换为JSON字符串
|
||||
return objectMapper.writeValueAsString(insertEntity);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,250 @@
|
||||
package com.xzzn.framework.aspectj;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.xzzn.common.utils.StringUtils;
|
||||
import com.xzzn.common.utils.bean.BeanUtils;
|
||||
import com.xzzn.ems.domain.*;
|
||||
import com.xzzn.ems.domain.vo.SyncStrategyTempVo;
|
||||
import com.xzzn.ems.mapper.*;
|
||||
import com.xzzn.framework.web.service.MqttPublisher;
|
||||
import org.apache.juli.logging.Log;
|
||||
import org.apache.juli.logging.LogFactory;
|
||||
import org.aspectj.lang.JoinPoint;
|
||||
import org.aspectj.lang.annotation.AfterReturning;
|
||||
import org.aspectj.lang.annotation.Aspect;
|
||||
import org.aspectj.lang.annotation.Before;
|
||||
import org.aspectj.lang.annotation.Pointcut;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.cglib.beans.BeanMap;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 策略模板数据同步
|
||||
* 云端 - 本地
|
||||
*/
|
||||
@Aspect
|
||||
@Component
|
||||
public class StrategyTempSyncAspect {
|
||||
|
||||
private static final Log logger = LogFactory.getLog(StrategyTempSyncAspect.class);
|
||||
@Autowired
|
||||
private MqttPublisher mqttPublisher;
|
||||
|
||||
private static final ObjectMapper objectMapper = new ObjectMapper();
|
||||
private static final String MQTT_TOPIC = "EMS_STRATEGY_UP";
|
||||
private static final String TABLE_NAME = "ems_strategy_temp";
|
||||
@Autowired
|
||||
private EmsMqttTopicConfigMapper emsMqttTopicConfigMapper;
|
||||
@Autowired
|
||||
private MqttSyncLogMapper mqttSyncLogMapper;
|
||||
@Autowired
|
||||
private EmsStrategyMapper emsStrategyMapper;
|
||||
@Autowired
|
||||
private EmsStrategyTempMapper emsStrategyTempMapper;
|
||||
|
||||
// 用ThreadLocal暂存删除前的对象
|
||||
private ThreadLocal<EmsStrategyTemp> beforeDeleteThreadLocal = new ThreadLocal<>();
|
||||
@Before("execution(* com.xzzn.ems.mapper.EmsStrategyTempMapper.deleteEmsStrategyTempById(..)) && args(templateId)")
|
||||
public void beforeDelete(JoinPoint joinPoint, String templateId) {
|
||||
// 查询删除前的数据-仅存一获取siteId
|
||||
List<EmsStrategyTemp> tempList = emsStrategyTempMapper.selectStrategyTempByTempId(templateId);
|
||||
if (tempList != null && tempList.size() > 0) {
|
||||
beforeDeleteThreadLocal.set(tempList.get(0)); // 暂存
|
||||
}
|
||||
}
|
||||
|
||||
@Pointcut("(execution(* com.xzzn.ems.mapper.EmsStrategyTempMapper.deleteEmsStrategyTempById(..)) && args(templateId)) ")
|
||||
public void deletePointCut(String templateId) {
|
||||
logger.info("【删除策略模版切面】StrategyTempSyncAspect 被实例化");
|
||||
}
|
||||
@Pointcut("(execution(* com.xzzn.ems.mapper.EmsStrategyTempMapper.insertEmsStrategyTemp(..)) && args(insertEntity)) ")
|
||||
public void insertPointCut(EmsStrategyTemp insertEntity) {
|
||||
logger.info("【新增策略模版切面】StrategyTempSyncAspect 被实例化");
|
||||
}
|
||||
|
||||
// 方法执行成功后发布同步消息
|
||||
@AfterReturning(pointcut = "insertPointCut(insertEntity)", returning = "result")
|
||||
public void afterInsert(JoinPoint joinPoint, EmsStrategyTemp insertEntity, Integer result) {
|
||||
logger.info("【新增策略切面进入成功】");
|
||||
if (result == 0 || insertEntity == null) {
|
||||
return;
|
||||
}
|
||||
// 校验是否配置监听topic-监听则不发布
|
||||
String topic = emsMqttTopicConfigMapper.checkTopicIsExist(MQTT_TOPIC);
|
||||
if (!StringUtils.isEmpty(topic)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 解析方法名,获取操作类型(INSERT/UPDATE/DELETE)和表名
|
||||
String methodName = joinPoint.getSignature().getName();
|
||||
String operateType = getOperateType(methodName);
|
||||
String siteId = insertEntity.getSiteId();
|
||||
|
||||
// 构建日志同步消息
|
||||
MqttSyncLog message = createMessageObject(operateType, siteId);
|
||||
|
||||
try {
|
||||
// 校验策略id是否存在
|
||||
Long strategyId = insertEntity.getStrategyId();
|
||||
if (strategyId == null) {
|
||||
return;
|
||||
}
|
||||
// 数据转换
|
||||
SyncStrategyTempVo tempVo = convertEntity(insertEntity);
|
||||
String content = objectMapper.writeValueAsString(tempVo);
|
||||
message.setContent(content);
|
||||
|
||||
// 发布到MQTT主题
|
||||
mqttPublisher.publish(MQTT_TOPIC, objectMapper.writeValueAsString(message), 1);
|
||||
} catch (Exception e) {
|
||||
message.setStatus("FAIL");
|
||||
message.setErrorMsg(e.getMessage());
|
||||
}
|
||||
// 存储同步信息
|
||||
mqttSyncLogMapper.insertMqttSyncLog(message);
|
||||
}
|
||||
private SyncStrategyTempVo convertEntity(EmsStrategyTemp insertEntity) {
|
||||
SyncStrategyTempVo tempVo = new SyncStrategyTempVo();
|
||||
BeanUtils.copyProperties(insertEntity, tempVo);
|
||||
EmsStrategy strategy = emsStrategyMapper.selectEmsStrategyById(insertEntity.getStrategyId());
|
||||
if (strategy != null) {
|
||||
tempVo.setStrategyName(strategy.getStrategyName());
|
||||
tempVo.setStrategyType(strategy.getStrategyType());
|
||||
}
|
||||
return tempVo;
|
||||
}
|
||||
|
||||
@AfterReturning(pointcut = "deletePointCut(templateId)", returning = "result")
|
||||
public void afterDelete(JoinPoint joinPoint, String templateId, Integer result) {
|
||||
logger.info("【删除策略模版切面进入成功】");
|
||||
if (result == 0 || StringUtils.isEmpty(templateId)) {
|
||||
return;
|
||||
}
|
||||
// 校验是否配置监听topic-监听则不发布
|
||||
String topic = emsMqttTopicConfigMapper.checkTopicIsExist(MQTT_TOPIC);
|
||||
if (!StringUtils.isEmpty(topic)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 解析方法名,获取操作类型(INSERT/UPDATE/DELETE)和表名
|
||||
String methodName = joinPoint.getSignature().getName();
|
||||
String operateType = getOperateType(methodName);
|
||||
// 从ThreadLocal中获取删除前的对象
|
||||
EmsStrategyTemp strategyTemp = beforeDeleteThreadLocal.get();
|
||||
String siteId = "";
|
||||
if (strategyTemp != null) {
|
||||
siteId = strategyTemp.getSiteId();
|
||||
}
|
||||
|
||||
// 构建日志同步消息
|
||||
MqttSyncLog message = createMessageObject(operateType, siteId);
|
||||
|
||||
try {
|
||||
// 数据转换
|
||||
Map<String, Object> idMap = new HashMap<>();
|
||||
idMap.put("templateId", templateId); // 手动将参数值映射到"id"字段
|
||||
String content = JSON.toJSONString(idMap);
|
||||
message.setContent(content);
|
||||
|
||||
// 发布到MQTT主题
|
||||
mqttPublisher.publish(MQTT_TOPIC, objectMapper.writeValueAsString(message), 1);
|
||||
} catch (Exception e) {
|
||||
message.setStatus("FAIL");
|
||||
message.setErrorMsg(e.getMessage());
|
||||
}
|
||||
// 存储同步信息
|
||||
mqttSyncLogMapper.insertMqttSyncLog(message);
|
||||
}
|
||||
|
||||
// 构建同步信息
|
||||
private MqttSyncLog createMessageObject(String operateType, String siteId) {
|
||||
MqttSyncLog message = new MqttSyncLog();
|
||||
message.setSyncId(UUID.randomUUID().toString());
|
||||
message.setOperateType(operateType);
|
||||
message.setTableName(TABLE_NAME);
|
||||
message.setCreateTime(new Date());
|
||||
message.setTopic(MQTT_TOPIC);
|
||||
message.setStatus("SUCCESS");
|
||||
message.setSyncObject("CLOUD");
|
||||
message.setTarget(siteId);
|
||||
return message;
|
||||
}
|
||||
// 从方法名判断操作类型(示例:insert→INSERT,update→UPDATE,delete→DELETE)
|
||||
private String getOperateType(String methodName) {
|
||||
if (methodName.startsWith("insert")) return "INSERT";
|
||||
if (methodName.startsWith("stop")) return "STOP";
|
||||
if (methodName.startsWith("update") || methodName.startsWith("stop")) return "UPDATE";
|
||||
if (methodName.startsWith("delete")) return "DELETE";
|
||||
return "UNKNOWN";
|
||||
}
|
||||
|
||||
// 从方法参数提取数据(示例:若参数是实体类,转成Map)
|
||||
private Map<String, Object> extractDataFromParams(Object[] args) {
|
||||
// 实际需反射获取实体类的字段和值(如id、name等)
|
||||
Map<String, Object> data = new HashMap<>();
|
||||
if (args == null || args.length == 0) {
|
||||
return data;
|
||||
}
|
||||
|
||||
for (int i = 0; i < args.length; i++) {
|
||||
Object arg = args[i];
|
||||
if (arg == null) {
|
||||
continue; // 跳过null参数
|
||||
}
|
||||
|
||||
// 处理基本类型/包装类/字符串(直接作为值存入,key为"param0"、"param1"等)
|
||||
if (isBasicType(arg.getClass())) {
|
||||
String key = "param" + i; // 基本类型参数用"param0"、"param1"作为key
|
||||
data.put(key, arg);
|
||||
} else {
|
||||
Map<String, Object> beanMap = beanToMap(arg);
|
||||
data.putAll(beanMap); // 合并实体类的字段到结果Map
|
||||
}
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否为基本类型或包装类或字符串
|
||||
*/
|
||||
private boolean isBasicType(Class<?> clazz) {
|
||||
return clazz.isPrimitive() // 基本类型(int、long、boolean等)
|
||||
|| clazz == String.class // 字符串
|
||||
|| Number.class.isAssignableFrom(clazz) // 数字包装类(Integer、Long等)
|
||||
|| clazz == Boolean.class; // 布尔包装类
|
||||
}
|
||||
|
||||
/**
|
||||
* 将实体类转换为Map(字段名为key,字段值为value)
|
||||
*/
|
||||
private Map<String, Object> beanToMap(Object bean) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
if (bean == null) {
|
||||
return map;
|
||||
}
|
||||
|
||||
// 方式1:使用BeanMap(简洁高效)
|
||||
BeanMap beanMap = BeanMap.create(bean);
|
||||
for (Object key : beanMap.keySet()) {
|
||||
map.put(key.toString(), beanMap.get(key));
|
||||
}
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
// 在方法中转换
|
||||
public String convertEntityToJson(EmsStrategyRunning insertEntity) throws Exception {
|
||||
if (insertEntity == null) {
|
||||
return null; // 空对象返回空JSON
|
||||
}
|
||||
|
||||
// 将实体类转换为JSON字符串
|
||||
return objectMapper.writeValueAsString(insertEntity);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,231 @@
|
||||
package com.xzzn.framework.aspectj;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.xzzn.common.utils.StringUtils;
|
||||
import com.xzzn.common.utils.bean.BeanUtils;
|
||||
import com.xzzn.ems.domain.*;
|
||||
import com.xzzn.ems.domain.vo.SyncStrategyTimeConfigVo;
|
||||
import com.xzzn.ems.mapper.*;
|
||||
import com.xzzn.framework.web.service.MqttPublisher;
|
||||
import org.apache.juli.logging.Log;
|
||||
import org.apache.juli.logging.LogFactory;
|
||||
import org.aspectj.lang.JoinPoint;
|
||||
import org.aspectj.lang.annotation.AfterReturning;
|
||||
import org.aspectj.lang.annotation.Aspect;
|
||||
import org.aspectj.lang.annotation.Pointcut;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.cglib.beans.BeanMap;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 策略时间配置同步
|
||||
* 云端 - 本地
|
||||
*/
|
||||
@Aspect
|
||||
@Component
|
||||
public class StrategyTimeConfigSyncAspect {
|
||||
|
||||
private static final Log logger = LogFactory.getLog(StrategyTimeConfigSyncAspect.class);
|
||||
@Autowired
|
||||
private MqttPublisher mqttPublisher;
|
||||
|
||||
private static final ObjectMapper objectMapper = new ObjectMapper();
|
||||
private static final String MQTT_TOPIC = "EMS_STRATEGY_UP";
|
||||
private static final String TABLE_NAME = "ems_strategy_temp";
|
||||
@Autowired
|
||||
private EmsMqttTopicConfigMapper emsMqttTopicConfigMapper;
|
||||
@Autowired
|
||||
private MqttSyncLogMapper mqttSyncLogMapper;
|
||||
@Autowired
|
||||
private EmsStrategyMapper emsStrategyMapper;
|
||||
@Autowired
|
||||
private EmsStrategyTempMapper emsStrategyTempMapper;
|
||||
|
||||
@Pointcut("(execution(* com.xzzn.ems.mapper.EmsStrategyTimeConfigMapper.insertEmsStrategyTimeConfig(..)) && args(insertEntity)) ")
|
||||
public void insertPointCut(EmsStrategyTimeConfig insertEntity) {
|
||||
logger.info("【新增策略模版时间配置切面】StrategyTimeConfigSyncAspect 被实例化");
|
||||
}
|
||||
@Pointcut("(execution(* com.xzzn.ems.mapper.EmsStrategyTimeConfigMapper.updateEmsStrategyTimeConfig(..)) && args(updateEntity)) ")
|
||||
public void updatePointCut(EmsStrategyTimeConfig updateEntity) {
|
||||
logger.info("【更新策略模版时间配置切面】StrategyTimeConfigSyncAspect 被实例化");
|
||||
}
|
||||
|
||||
// 方法执行成功后发布同步消息
|
||||
@AfterReturning(pointcut = "insertPointCut(insertEntity)", returning = "result")
|
||||
public void afterInsert(JoinPoint joinPoint, EmsStrategyTimeConfig insertEntity, Integer result) {
|
||||
logger.info("【新增策略模版时间切面进入成功】");
|
||||
if (result == 0 || insertEntity == null) {
|
||||
return;
|
||||
}
|
||||
// 校验是否配置监听topic-监听则不发布
|
||||
String topic = emsMqttTopicConfigMapper.checkTopicIsExist(MQTT_TOPIC);
|
||||
if (!StringUtils.isEmpty(topic)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 解析方法名,获取操作类型(INSERT/UPDATE/DELETE)和表名
|
||||
String methodName = joinPoint.getSignature().getName();
|
||||
String operateType = getOperateType(methodName);
|
||||
String siteId = insertEntity.getSiteId();
|
||||
|
||||
// 构建日志同步消息
|
||||
MqttSyncLog message = createMessageObject(operateType, siteId);
|
||||
|
||||
try {
|
||||
// 校验策略id是否存在
|
||||
Long strategyId = insertEntity.getStrategyId();
|
||||
if (strategyId == null) {
|
||||
return;
|
||||
}
|
||||
// 数据转换
|
||||
SyncStrategyTimeConfigVo timeConfigVo = convertEntity(insertEntity);
|
||||
String content = objectMapper.writeValueAsString(timeConfigVo);
|
||||
message.setContent(content);
|
||||
|
||||
// 发布到MQTT主题
|
||||
mqttPublisher.publish(MQTT_TOPIC, objectMapper.writeValueAsString(message), 1);
|
||||
} catch (Exception e) {
|
||||
message.setStatus("FAIL");
|
||||
message.setErrorMsg(e.getMessage());
|
||||
}
|
||||
// 存储同步信息
|
||||
mqttSyncLogMapper.insertMqttSyncLog(message);
|
||||
}
|
||||
private SyncStrategyTimeConfigVo convertEntity(EmsStrategyTimeConfig insertEntity) {
|
||||
SyncStrategyTimeConfigVo timeConfigVo = new SyncStrategyTimeConfigVo();
|
||||
BeanUtils.copyProperties(insertEntity, timeConfigVo);
|
||||
EmsStrategy strategy = emsStrategyMapper.selectEmsStrategyById(insertEntity.getStrategyId());
|
||||
if (strategy != null) {
|
||||
timeConfigVo.setStrategyName(strategy.getStrategyName());
|
||||
timeConfigVo.setStrategyType(strategy.getStrategyType());
|
||||
}
|
||||
return timeConfigVo;
|
||||
}
|
||||
|
||||
@AfterReturning(pointcut = "updatePointCut(updateEntity)", returning = "result")
|
||||
public void afterUpdate(JoinPoint joinPoint, EmsStrategyTimeConfig updateEntity, Integer result) {
|
||||
logger.info("【删除策略模版切面进入成功】");
|
||||
if (result == 0 || updateEntity == null) {
|
||||
return;
|
||||
}
|
||||
// 校验是否配置监听topic-监听则不发布
|
||||
String topic = emsMqttTopicConfigMapper.checkTopicIsExist(MQTT_TOPIC);
|
||||
if (!StringUtils.isEmpty(topic)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 解析方法名,获取操作类型(INSERT/UPDATE/DELETE)和表名
|
||||
String methodName = joinPoint.getSignature().getName();
|
||||
String operateType = getOperateType(methodName);
|
||||
String siteId = updateEntity.getSiteId();
|
||||
|
||||
// 构建日志同步消息
|
||||
MqttSyncLog message = createMessageObject(operateType, siteId);
|
||||
|
||||
try {
|
||||
// 数据转换
|
||||
SyncStrategyTimeConfigVo timeConfigVo = convertEntity(updateEntity);
|
||||
String content = objectMapper.writeValueAsString(timeConfigVo);
|
||||
message.setContent(content);
|
||||
|
||||
// 发布到MQTT主题
|
||||
mqttPublisher.publish(MQTT_TOPIC, objectMapper.writeValueAsString(message), 1);
|
||||
} catch (Exception e) {
|
||||
message.setStatus("FAIL");
|
||||
message.setErrorMsg(e.getMessage());
|
||||
}
|
||||
// 存储同步信息
|
||||
mqttSyncLogMapper.insertMqttSyncLog(message);
|
||||
}
|
||||
|
||||
// 构建同步信息
|
||||
private MqttSyncLog createMessageObject(String operateType, String siteId) {
|
||||
MqttSyncLog message = new MqttSyncLog();
|
||||
message.setSyncId(UUID.randomUUID().toString());
|
||||
message.setOperateType(operateType);
|
||||
message.setTableName(TABLE_NAME);
|
||||
message.setCreateTime(new Date());
|
||||
message.setTopic(MQTT_TOPIC);
|
||||
message.setStatus("SUCCESS");
|
||||
message.setSyncObject("CLOUD");
|
||||
message.setTarget(siteId);
|
||||
return message;
|
||||
}
|
||||
// 从方法名判断操作类型(示例:insert→INSERT,update→UPDATE,delete→DELETE)
|
||||
private String getOperateType(String methodName) {
|
||||
if (methodName.startsWith("insert")) return "INSERT";
|
||||
if (methodName.startsWith("stop")) return "STOP";
|
||||
if (methodName.startsWith("update") || methodName.startsWith("stop")) return "UPDATE";
|
||||
if (methodName.startsWith("delete")) return "DELETE";
|
||||
return "UNKNOWN";
|
||||
}
|
||||
|
||||
// 从方法参数提取数据(示例:若参数是实体类,转成Map)
|
||||
private Map<String, Object> extractDataFromParams(Object[] args) {
|
||||
// 实际需反射获取实体类的字段和值(如id、name等)
|
||||
Map<String, Object> data = new HashMap<>();
|
||||
if (args == null || args.length == 0) {
|
||||
return data;
|
||||
}
|
||||
|
||||
for (int i = 0; i < args.length; i++) {
|
||||
Object arg = args[i];
|
||||
if (arg == null) {
|
||||
continue; // 跳过null参数
|
||||
}
|
||||
|
||||
// 处理基本类型/包装类/字符串(直接作为值存入,key为"param0"、"param1"等)
|
||||
if (isBasicType(arg.getClass())) {
|
||||
String key = "param" + i; // 基本类型参数用"param0"、"param1"作为key
|
||||
data.put(key, arg);
|
||||
} else {
|
||||
Map<String, Object> beanMap = beanToMap(arg);
|
||||
data.putAll(beanMap); // 合并实体类的字段到结果Map
|
||||
}
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否为基本类型或包装类或字符串
|
||||
*/
|
||||
private boolean isBasicType(Class<?> clazz) {
|
||||
return clazz.isPrimitive() // 基本类型(int、long、boolean等)
|
||||
|| clazz == String.class // 字符串
|
||||
|| Number.class.isAssignableFrom(clazz) // 数字包装类(Integer、Long等)
|
||||
|| clazz == Boolean.class; // 布尔包装类
|
||||
}
|
||||
|
||||
/**
|
||||
* 将实体类转换为Map(字段名为key,字段值为value)
|
||||
*/
|
||||
private Map<String, Object> beanToMap(Object bean) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
if (bean == null) {
|
||||
return map;
|
||||
}
|
||||
|
||||
// 方式1:使用BeanMap(简洁高效)
|
||||
BeanMap beanMap = BeanMap.create(bean);
|
||||
for (Object key : beanMap.keySet()) {
|
||||
map.put(key.toString(), beanMap.get(key));
|
||||
}
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
// 在方法中转换
|
||||
public String convertEntityToJson(EmsStrategyRunning insertEntity) throws Exception {
|
||||
if (insertEntity == null) {
|
||||
return null; // 空对象返回空JSON
|
||||
}
|
||||
|
||||
// 将实体类转换为JSON字符串
|
||||
return objectMapper.writeValueAsString(insertEntity);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -3,6 +3,9 @@ package com.xzzn.framework.manager;
|
||||
import com.ghgande.j2mod.modbus.net.TCPMasterConnection;
|
||||
import com.xzzn.ems.domain.EmsDevicesSetting;
|
||||
import com.xzzn.ems.mapper.EmsDevicesSettingMapper;
|
||||
import com.xzzn.ems.service.IEmsAlarmRecordsService;
|
||||
import com.xzzn.ems.service.IEmsDeviceSettingService;
|
||||
import com.xzzn.ems.service.IEmsEnergyPriceConfigService;
|
||||
import org.apache.commons.pool2.impl.GenericObjectPool;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@ -35,6 +38,12 @@ public class ModbusConnectionManager implements ApplicationRunner {
|
||||
private ScheduledExecutorService scheduler;
|
||||
@Autowired
|
||||
private EmsDevicesSettingMapper deviceRepo;
|
||||
@Autowired
|
||||
private IEmsAlarmRecordsService iEmsAlarmRecordsService;
|
||||
@Autowired
|
||||
private IEmsEnergyPriceConfigService iEmsEnergyPriceConfigService;
|
||||
@Autowired
|
||||
private IEmsDeviceSettingService iEmsDeviceSettingService;
|
||||
|
||||
@Override
|
||||
public void run(ApplicationArguments args) throws Exception {
|
||||
@ -46,8 +55,19 @@ public class ModbusConnectionManager implements ApplicationRunner {
|
||||
scheduler = Executors.newSingleThreadScheduledExecutor();
|
||||
scheduler.scheduleAtFixedRate(this::heartbeatCheck, 1, 5, TimeUnit.MINUTES);
|
||||
logger.info("Modbus连接管理器已初始化");
|
||||
|
||||
// 初始数据工作
|
||||
initData();
|
||||
}
|
||||
|
||||
private void initData() {
|
||||
// 初始化-设备信息
|
||||
iEmsDeviceSettingService.initDeviceInfo();
|
||||
// 初始化-告警数据
|
||||
iEmsAlarmRecordsService.initAlarmMatchInfo();
|
||||
// 初始化当月电价
|
||||
iEmsEnergyPriceConfigService.initCurrentMonthPrice();
|
||||
}
|
||||
/**
|
||||
* 获取连接(带自动创建和缓存)
|
||||
*/
|
||||
@ -75,7 +95,7 @@ public class ModbusConnectionManager implements ApplicationRunner {
|
||||
*/
|
||||
private TCPMasterConnection createRawConnection(EmsDevicesSetting device) throws Exception {
|
||||
try {
|
||||
InetAddress addr = InetAddress.getByName("192.168.80.100");
|
||||
InetAddress addr = InetAddress.getByName("10.1.0.230");
|
||||
TCPMasterConnection connection = new TCPMasterConnection(addr);
|
||||
connection.setPort(502);
|
||||
connection.setTimeout(5000);
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.xzzn.framework.manager;
|
||||
|
||||
import com.xzzn.ems.service.IEmsAlarmRecordsService;
|
||||
import org.eclipse.paho.client.mqttv3.*;
|
||||
import org.eclipse.paho.client.mqttv3.persist.MemoryPersistence;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -16,6 +17,7 @@ import java.util.concurrent.ConcurrentHashMap;
|
||||
public class MqttLifecycleManager implements ApplicationRunner, SmartLifecycle, MqttCallback {
|
||||
|
||||
private final MqttConnectOptions connectOptions;
|
||||
private final IEmsAlarmRecordsService iEmsAlarmRecordsService;
|
||||
private MqttClient mqttClient;
|
||||
private volatile boolean running = false;
|
||||
|
||||
@ -23,8 +25,9 @@ public class MqttLifecycleManager implements ApplicationRunner, SmartLifecycle,
|
||||
private final ConcurrentHashMap<String, SubscriptionInfo> subscriptions = new ConcurrentHashMap<>();
|
||||
|
||||
@Autowired
|
||||
public MqttLifecycleManager(MqttConnectOptions connectOptions) {
|
||||
public MqttLifecycleManager(MqttConnectOptions connectOptions, IEmsAlarmRecordsService iEmsAlarmRecordsService) {
|
||||
this.connectOptions = connectOptions;
|
||||
this.iEmsAlarmRecordsService = iEmsAlarmRecordsService;
|
||||
}
|
||||
|
||||
// Spring Boot 启动完成后执行
|
||||
@ -107,7 +110,11 @@ public class MqttLifecycleManager implements ApplicationRunner, SmartLifecycle,
|
||||
subscriptions.put(topic, new SubscriptionInfo(listener, qos));
|
||||
} catch (MqttException e) {
|
||||
System.err.println("Subscribe failed: " + e.getMessage());
|
||||
// 订阅失败-增加告警
|
||||
iEmsAlarmRecordsService.addSubFailedAlarmRecord(topic);
|
||||
}
|
||||
// 订阅成功了-校验是否存在未处理或者处理中的订阅失败信息
|
||||
iEmsAlarmRecordsService.checkFailedRecord(topic);
|
||||
}
|
||||
|
||||
// 发布方法
|
||||
|
||||
@ -2,11 +2,16 @@ package com.xzzn.framework.web.service;
|
||||
|
||||
import com.ghgande.j2mod.modbus.ModbusException;
|
||||
import com.ghgande.j2mod.modbus.ModbusIOException;
|
||||
import com.ghgande.j2mod.modbus.io.ModbusSerialTransaction;
|
||||
import com.ghgande.j2mod.modbus.io.ModbusTCPTransaction;
|
||||
import com.ghgande.j2mod.modbus.msg.ReadInputRegistersRequest;
|
||||
import com.ghgande.j2mod.modbus.msg.ReadInputRegistersResponse;
|
||||
import com.ghgande.j2mod.modbus.msg.WriteMultipleRegistersRequest;
|
||||
import com.ghgande.j2mod.modbus.msg.WriteSingleRegisterRequest;
|
||||
import com.ghgande.j2mod.modbus.net.SerialConnection;
|
||||
import com.ghgande.j2mod.modbus.net.TCPMasterConnection;
|
||||
import com.ghgande.j2mod.modbus.procimg.Register;
|
||||
import com.ghgande.j2mod.modbus.procimg.SimpleRegister;
|
||||
import io.github.resilience4j.circuitbreaker.annotation.CircuitBreaker;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@ -42,8 +47,26 @@ public class ModbusService {
|
||||
}
|
||||
}
|
||||
|
||||
private int[] readRtuRegisters(SerialConnection connection, int startAddr, int count) {
|
||||
return null;
|
||||
private int[] readRtuRegisters(SerialConnection connection, int startAddr, int count) throws ModbusException {
|
||||
if (!connection.isOpen()) {
|
||||
throw new ModbusIOException("RTU连接未建立");
|
||||
}
|
||||
ReadInputRegistersRequest request = new ReadInputRegistersRequest(startAddr, count);
|
||||
ModbusSerialTransaction transaction = new ModbusSerialTransaction(connection);
|
||||
transaction.setRequest(request);
|
||||
transaction.setRetries(2);
|
||||
|
||||
try {
|
||||
transaction.execute();
|
||||
ReadInputRegistersResponse response = (ReadInputRegistersResponse) transaction.getResponse();
|
||||
if (response == null) {
|
||||
throw new ModbusException("RTU响应为空");
|
||||
}
|
||||
return parseRegisters(response);
|
||||
} catch (ModbusException e) {
|
||||
logger.error("读取RTU寄存器失败: {}", e.getMessage());
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
private int[] readTcpRegisters(TCPMasterConnection conn, int start, int count) throws ModbusException {
|
||||
@ -98,4 +121,159 @@ public class ModbusService {
|
||||
return new int[0];
|
||||
}
|
||||
|
||||
/**
|
||||
* 写入单个寄存器(支持TCP/RTU)
|
||||
* @param connection 连接对象(TCPMasterConnection 或 SerialConnection)
|
||||
* @param registerAddr 寄存器地址
|
||||
* @param value 要写入的值(16位整数)
|
||||
*/
|
||||
@Retryable(
|
||||
value = {ModbusException.class},
|
||||
maxAttempts = 3,
|
||||
backoff = @Backoff(delay = 1000, multiplier = 2)
|
||||
)
|
||||
@CircuitBreaker(name = "modbusOperation", fallbackMethod = "writeRegisterFallback")
|
||||
public boolean writeSingleRegister(Object connection, int registerAddr, int value) throws ModbusException {
|
||||
try {
|
||||
if (connection instanceof TCPMasterConnection) {
|
||||
return writeTcpSingleRegister((TCPMasterConnection) connection, registerAddr, value);
|
||||
} else if (connection instanceof SerialConnection) {
|
||||
return writeRtuSingleRegister((SerialConnection) connection, registerAddr, value);
|
||||
}
|
||||
throw new IllegalArgumentException("不支持的连接类型: " + connection.getClass().getName());
|
||||
} catch (ModbusIOException e) {
|
||||
throw new ModbusException("写入通信故障", e);
|
||||
} catch (Exception e) {
|
||||
throw new ModbusException("写入系统错误", e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 写入多个寄存器(支持TCP/RTU)
|
||||
* @param connection 连接对象
|
||||
* @param startAddr 起始寄存器地址
|
||||
* @param values 要写入的值数组(每个值为16位整数)
|
||||
*/
|
||||
@Retryable(
|
||||
value = {ModbusException.class},
|
||||
maxAttempts = 3,
|
||||
backoff = @Backoff(delay = 1000, multiplier = 2)
|
||||
)
|
||||
@CircuitBreaker(name = "modbusOperation", fallbackMethod = "writeRegisterFallback")
|
||||
public boolean writeMultipleRegisters(Object connection, int startAddr, int[] values) throws ModbusException {
|
||||
try {
|
||||
if (connection instanceof TCPMasterConnection) {
|
||||
return writeTcpMultipleRegisters((TCPMasterConnection) connection, startAddr, values);
|
||||
} else if (connection instanceof SerialConnection) {
|
||||
return writeRtuMultipleRegisters((SerialConnection) connection, startAddr, values);
|
||||
}
|
||||
throw new IllegalArgumentException("不支持的连接类型: " + connection.getClass().getName());
|
||||
} catch (ModbusIOException e) {
|
||||
throw new ModbusException("写入通信故障", e);
|
||||
} catch (Exception e) {
|
||||
throw new ModbusException("写入系统错误", e);
|
||||
}
|
||||
}
|
||||
|
||||
// ==================== TCP写入实现 ====================
|
||||
private boolean writeTcpSingleRegister(TCPMasterConnection conn, int registerAddr, int value) throws ModbusException {
|
||||
if (!conn.isConnected()) {
|
||||
throw new ModbusIOException("TCP连接未建立,无法写入");
|
||||
}
|
||||
// 创建写入单个寄存器的请求(功能码06)
|
||||
WriteSingleRegisterRequest request = new WriteSingleRegisterRequest(registerAddr, new SimpleRegister(value));
|
||||
ModbusTCPTransaction transaction = new ModbusTCPTransaction(conn);
|
||||
transaction.setRequest(request);
|
||||
transaction.setRetries(2);
|
||||
|
||||
try {
|
||||
transaction.execute();
|
||||
logger.info("TCP写入单个寄存器成功,地址:{},值:{}", registerAddr, value);
|
||||
return true;
|
||||
} catch (ModbusException e) {
|
||||
logger.error("TCP写入单个寄存器失败,地址:{},值:{}", registerAddr, value, e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
private boolean writeTcpMultipleRegisters(TCPMasterConnection conn, int startAddr, int[] values) throws ModbusException {
|
||||
if (!conn.isConnected()) {
|
||||
throw new ModbusIOException("TCP连接未建立,无法写入");
|
||||
}
|
||||
// 转换值数组为寄存器数组
|
||||
Register[] registers = new Register[values.length];
|
||||
for (int i = 0; i < values.length; i++) {
|
||||
registers[i] = new SimpleRegister(values[i]);
|
||||
}
|
||||
// 创建写入多个寄存器的请求(功能码16)
|
||||
WriteMultipleRegistersRequest request = new WriteMultipleRegistersRequest(startAddr, registers);
|
||||
ModbusTCPTransaction transaction = new ModbusTCPTransaction(conn);
|
||||
transaction.setRequest(request);
|
||||
transaction.setRetries(2);
|
||||
|
||||
try {
|
||||
transaction.execute();
|
||||
logger.info("TCP写入多个寄存器成功,起始地址:{},数量:{}", startAddr, values.length);
|
||||
return true;
|
||||
} catch (ModbusException e) {
|
||||
logger.error("TCP写入多个寄存器失败,起始地址:{}", startAddr, e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ==================== RTU写入实现 ====================
|
||||
private boolean writeRtuSingleRegister(SerialConnection connection, int registerAddr, int value) throws ModbusException {
|
||||
if (!connection.isOpen()) {
|
||||
throw new ModbusIOException("RTU串口未打开,请先建立连接");
|
||||
}
|
||||
WriteSingleRegisterRequest request = new WriteSingleRegisterRequest(registerAddr, new SimpleRegister(value));
|
||||
ModbusSerialTransaction transaction = new ModbusSerialTransaction(connection);
|
||||
transaction.setRequest(request);
|
||||
transaction.setRetries(2);
|
||||
|
||||
try {
|
||||
transaction.execute();
|
||||
logger.info("RTU写入单个寄存器成功,地址:{},值:{}", registerAddr, value);
|
||||
return true;
|
||||
} catch (ModbusException e) {
|
||||
logger.error("RTU写入单个寄存器失败,地址:{},值:{}", registerAddr, value, e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
private boolean writeRtuMultipleRegisters(SerialConnection connection, int startAddr, int[] values) throws ModbusException {
|
||||
if (!connection.isOpen()) {
|
||||
throw new ModbusIOException("RTU串口未打开,请先建立连接");
|
||||
}
|
||||
Register[] registers = new Register[values.length];
|
||||
for (int i = 0; i < values.length; i++) {
|
||||
registers[i] = new SimpleRegister(values[i]);
|
||||
}
|
||||
WriteMultipleRegistersRequest request = new WriteMultipleRegistersRequest(startAddr, registers);
|
||||
ModbusSerialTransaction transaction = new ModbusSerialTransaction(connection);
|
||||
transaction.setRequest(request);
|
||||
transaction.setRetries(2);
|
||||
|
||||
try {
|
||||
transaction.execute();
|
||||
logger.info("RTU写入多个寄存器成功,起始地址:{},数量:{}", startAddr, values.length);
|
||||
return true;
|
||||
} catch (ModbusException e) {
|
||||
logger.error("RTU写入多个寄存器失败,起始地址:{}", startAddr, e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ==================== 写入操作的降级方法 ====================
|
||||
public boolean writeRegisterFallback(Object connection, int addr, int value, Exception e) {
|
||||
logger.warn("写入单个寄存器降级(原因: {}),地址:{}", e.getMessage(), addr);
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean writeRegisterFallback(Object connection, int startAddr, int[] values, Exception e) {
|
||||
logger.warn("写入多个寄存器降级(原因: {}),起始地址:{}", e.getMessage(), startAddr);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -34,6 +34,10 @@
|
||||
<groupId>com.xzzn</groupId>
|
||||
<artifactId>ems-common</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.xzzn</groupId>
|
||||
<artifactId>ems-framework</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
||||
@ -1,8 +1,12 @@
|
||||
package com.xzzn.framework.scheduler;
|
||||
package com.xzzn.quartz.task;
|
||||
|
||||
import com.xzzn.common.enums.DeviceRunningStatus;
|
||||
import com.xzzn.ems.domain.EmsDeviceChangeLog;
|
||||
import com.xzzn.ems.domain.EmsDevicesSetting;
|
||||
import com.xzzn.ems.mapper.EmsDeviceChangeLogMapper;
|
||||
import com.xzzn.ems.mapper.EmsDevicesSettingMapper;
|
||||
import com.xzzn.ems.mapper.EmsMqttMessageMapper;
|
||||
import com.xzzn.ems.service.impl.EmsDeviceSettingServiceImpl;
|
||||
import com.xzzn.framework.manager.ModbusConnectionManager;
|
||||
import com.xzzn.framework.manager.ModbusConnectionWrapper;
|
||||
import com.xzzn.framework.manager.MqttLifecycleManager;
|
||||
@ -11,15 +15,16 @@ import org.eclipse.paho.client.mqttv3.MqttException;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
@Component
|
||||
@EnableScheduling
|
||||
/**
|
||||
* 轮询设备-通过modbus协议读取数据
|
||||
*/
|
||||
@Component("modbusPoller")
|
||||
public class ModbusPoller {
|
||||
private static final Logger logger = LoggerFactory.getLogger(ModbusPoller.class);
|
||||
|
||||
@ -33,31 +38,28 @@ public class ModbusPoller {
|
||||
private EmsDevicesSettingMapper deviceRepo;
|
||||
@Autowired
|
||||
private EmsMqttMessageMapper emsMqttMessageMapper;
|
||||
@Autowired
|
||||
private EmsDeviceSettingServiceImpl emsDeviceSettingServiceImpl;
|
||||
@Autowired
|
||||
private EmsDeviceChangeLogMapper emsDeviceChangeLogMapper;
|
||||
|
||||
@Autowired
|
||||
public ModbusPoller(MqttLifecycleManager mqttLifecycleManager) {
|
||||
this.mqttLifecycleManager = mqttLifecycleManager;
|
||||
}
|
||||
// 每5分钟触发(支持cron表达式动态配置)
|
||||
@Scheduled(cron = "${modbus.poll.interval}")
|
||||
@Async("modbusTaskExecutor")
|
||||
|
||||
public void pollAllDevices() {
|
||||
logger.info("开始执行Modbus设备轮询...");
|
||||
|
||||
List<EmsDevicesSetting> activeDevices = deviceRepo.selectEmsDevicesSettingList(null);
|
||||
EmsDevicesSetting selectEntity = new EmsDevicesSetting();
|
||||
selectEntity.setDeviceStatus(DeviceRunningStatus.RUNNING.getCode());
|
||||
List<EmsDevicesSetting> activeDevices = deviceRepo.selectEmsDevicesSettingList(selectEntity);
|
||||
|
||||
EmsDevicesSetting device = activeDevices.get(0);
|
||||
try {
|
||||
processData(device,null);
|
||||
//pollSingleDevice(device);
|
||||
} catch (Exception e) {
|
||||
logger.error("调度设备{}任务失败", device.getId(), e);
|
||||
}
|
||||
/*
|
||||
try {
|
||||
pollSingleDevice(device);
|
||||
} catch (Exception e) {
|
||||
logger.error("调度设备{}任务失败", device.getId(), e);
|
||||
}*/
|
||||
/*activeDevices.forEach(device -> {
|
||||
try {
|
||||
CompletableFuture.runAsync(() -> pollSingleDevice(device))
|
||||
@ -79,6 +81,10 @@ public class ModbusPoller {
|
||||
// 获取连接
|
||||
wrapper = connectionManager.getConnection(device);
|
||||
|
||||
if(wrapper == null || !wrapper.isActive()){
|
||||
logger.error("轮询设备{}连接失败: {}", device.getId());
|
||||
return;
|
||||
}
|
||||
// 读取保持寄存器
|
||||
int[] data = modbusService.readHoldingRegisters(
|
||||
wrapper.getConnection(),
|
||||
@ -95,24 +101,58 @@ public class ModbusPoller {
|
||||
wrapper.close();
|
||||
connectionManager.removeConnection(Integer.parseInt(device.getDeviceId()));
|
||||
}
|
||||
throw new RuntimeException("轮询设备失败", e);
|
||||
|
||||
// 设备轮询不到修改运行状态
|
||||
String beforeStatus = device.getDeviceStatus();
|
||||
device.setDeviceStatus(DeviceRunningStatus.SHUTDOWN.getCode());
|
||||
emsDeviceSettingServiceImpl.updateDevice(device);
|
||||
|
||||
// 轮询设备,设备状态变更日志
|
||||
EmsDeviceChangeLog log = createLogEntity(beforeStatus,device);
|
||||
emsDeviceChangeLogMapper.insertEmsDeviceChangeLog(log);
|
||||
|
||||
throw new RuntimeException("轮询设备失败", e);
|
||||
}
|
||||
}
|
||||
|
||||
// 处理获取到的数据,发到mqtt服务上
|
||||
// 处理获取到的数据
|
||||
private void processData(EmsDevicesSetting device, int[] data) throws MqttException {
|
||||
/*if (data == null || data.length == 0) {
|
||||
String beforeStatus = device.getDeviceStatus();
|
||||
Boolean error = true;
|
||||
if (data == null || data.length == 0) {
|
||||
logger.warn("设备{}返回空数据", device.getId());
|
||||
// 设备读取不到-设置设备故障
|
||||
device.setDeviceStatus(DeviceRunningStatus.FAULT.getCode());
|
||||
error = false;
|
||||
} else {
|
||||
// 恢复设备状态 - 运行
|
||||
device.setDeviceStatus(DeviceRunningStatus.RUNNING.getCode());
|
||||
}
|
||||
emsDeviceSettingServiceImpl.updateDevice(device);
|
||||
// 轮询设备,设备状态变更日志
|
||||
EmsDeviceChangeLog log = createLogEntity(beforeStatus,device);
|
||||
emsDeviceChangeLogMapper.insertEmsDeviceChangeLog(log);
|
||||
// 错误数据-不处理直接返回
|
||||
if (!error) {
|
||||
return;
|
||||
}*/
|
||||
}
|
||||
|
||||
/*// 数据处理逻辑
|
||||
// 数据处理逻辑
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("设备[").append(device.getDeviceName()).append("]数据: ");
|
||||
for (int i = 0; i < data.length; i++) {
|
||||
sb.append("R").append(i).append("=").append(data[i]).append(" ");
|
||||
}
|
||||
logger.info(sb.toString());*/
|
||||
|
||||
String message = sb.toString();
|
||||
logger.info(sb.toString());
|
||||
/*
|
||||
String siteId = device.getSiteId();
|
||||
if (siteId.startsWith("021_DDS")) {
|
||||
dDSDataProcessService.handleDdsData(message);
|
||||
} else if (siteId.startsWith("021_FXX")) {
|
||||
fXXDataProcessService.handleFxData(message);
|
||||
}*/
|
||||
|
||||
// 测试发送mqtt
|
||||
/* EmsMqttMessage msg = emsMqttMessageMapper.selectEmsMqttMessageById(1L);
|
||||
@ -123,4 +163,17 @@ public class ModbusPoller {
|
||||
// 将设备数据下发到mqtt服务器上
|
||||
mqttLifecycleManager.publish(topic, dataJson, 0);*/
|
||||
}
|
||||
|
||||
private EmsDeviceChangeLog createLogEntity(String beforeStatus, EmsDevicesSetting device) {
|
||||
EmsDeviceChangeLog log = new EmsDeviceChangeLog();
|
||||
log.setLogId(UUID.randomUUID().toString());
|
||||
log.setLogTime(new Date());
|
||||
log.setSiteId(device.getSiteId());
|
||||
log.setDeviceId(device.getDeviceId());
|
||||
log.setBeforeStatus(beforeStatus);
|
||||
log.setAfterStatus(device.getDeviceStatus());
|
||||
log.setCreateBy("sys");
|
||||
log.setCreateTime(new Date());
|
||||
return log;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,438 @@
|
||||
package com.xzzn.quartz.task;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.xzzn.common.annotation.SyncAfterInsert;
|
||||
import com.xzzn.common.constant.RedisKeyConstants;
|
||||
import com.xzzn.common.core.redis.RedisCache;
|
||||
import com.xzzn.common.enums.AlarmLevelStatus;
|
||||
import com.xzzn.common.enums.AlarmStatus;
|
||||
import com.xzzn.common.enums.ProtPlanStatus;
|
||||
import com.xzzn.common.enums.StrategyStatus;
|
||||
import com.xzzn.common.utils.StringUtils;
|
||||
import com.xzzn.ems.domain.*;
|
||||
import com.xzzn.ems.domain.vo.ProtectionPlanVo;
|
||||
import com.xzzn.ems.domain.vo.ProtectionSettingVo;
|
||||
import com.xzzn.ems.mapper.*;
|
||||
import com.xzzn.ems.service.IEmsFaultProtectionPlanService;
|
||||
import com.xzzn.framework.manager.ModbusConnectionManager;
|
||||
import com.xzzn.framework.manager.ModbusConnectionWrapper;
|
||||
import com.xzzn.framework.web.service.ModbusService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* 告警保护方案轮询
|
||||
*
|
||||
* @author xzzn
|
||||
*/
|
||||
@Component("protectionPlanTask")
|
||||
public class ProtectionPlanTask {
|
||||
private static final Logger logger = LoggerFactory.getLogger(ProtectionPlanTask.class);
|
||||
@Resource(name = "scheduledExecutorService")
|
||||
private ScheduledExecutorService scheduledExecutorService;
|
||||
@Autowired
|
||||
private IEmsFaultProtectionPlanService iEmsFaultProtectionPlanService;
|
||||
@Autowired
|
||||
private EmsAlarmRecordsMapper emsAlarmRecordsMapper;
|
||||
@Autowired
|
||||
private EmsStrategyRunningMapper emsStrategyRunningMapper;
|
||||
@Autowired
|
||||
private EmsFaultProtectionPlanMapper emsFaultProtectionPlanMapper;
|
||||
@Autowired
|
||||
private RedisCache redisCache;
|
||||
private static final ObjectMapper objectMapper = new ObjectMapper();
|
||||
@Autowired
|
||||
private EmsDevicesSettingMapper emsDevicesSettingMapper;
|
||||
@Autowired
|
||||
private ModbusConnectionManager connectionManager;
|
||||
@Autowired
|
||||
private ModbusService modbusService;
|
||||
@Autowired
|
||||
private EmsFaultIssueLogMapper emsFaultIssueLogMapper;
|
||||
|
||||
public ProtectionPlanTask(IEmsFaultProtectionPlanService iEmsFaultProtectionPlanService) {
|
||||
this.iEmsFaultProtectionPlanService = iEmsFaultProtectionPlanService;
|
||||
}
|
||||
|
||||
public void pollPlanList() {
|
||||
Long planId = 0L;
|
||||
try {
|
||||
// 获取所有方案,轮询
|
||||
List<EmsFaultProtectionPlan> planList = iEmsFaultProtectionPlanService.selectEmsFaultProtectionPlanList(null);
|
||||
|
||||
for (EmsFaultProtectionPlan plan : planList) {
|
||||
planId = plan.getId();
|
||||
String siteId = plan.getSiteId();
|
||||
if (StringUtils.isEmpty(siteId)) {
|
||||
return;
|
||||
}
|
||||
// 保护前提
|
||||
String protectionSettings = plan.getProtectionSettings();
|
||||
final List<ProtectionSettingVo> protSettings = objectMapper.readValue(
|
||||
protectionSettings,
|
||||
new TypeReference<List<ProtectionSettingVo>>() {}
|
||||
);
|
||||
if (protSettings == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 处理告警保护方案
|
||||
boolean isHighLevel = dealWithProtectionPlan(plan, protSettings);
|
||||
if (isHighLevel) {
|
||||
// 触发最高故障等级-结束循环
|
||||
return;
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("轮询失败,方案id为:{}", planId, e);
|
||||
}
|
||||
}
|
||||
|
||||
// 处理告警保护方案-返回触发下发方案时是否最高等级
|
||||
// 需要同步云端
|
||||
@SyncAfterInsert
|
||||
private boolean dealWithProtectionPlan(EmsFaultProtectionPlan plan, List<ProtectionSettingVo> protSettings) {
|
||||
boolean isHighLevel = false;
|
||||
|
||||
String siteId = plan.getSiteId();
|
||||
final Integer isAlertAlarm = plan.getIsAlert();
|
||||
final Long status = plan.getStatus();
|
||||
// 看方案是否启用,走不同判断
|
||||
if (status == ProtPlanStatus.STOP.getCode()) {
|
||||
// 未启用,获取方案的故障值与最新数据判断是否需要下发方案
|
||||
if(checkIsNeedIssuedPlan(protSettings, siteId)){
|
||||
if("3".equals(plan.getFaultLevel())){
|
||||
isHighLevel = true;//最高故障等级
|
||||
}
|
||||
// 延时
|
||||
final int faultDelay = plan.getFaultDelaySeconds().intValue();
|
||||
ScheduledFuture<?> delayTask = scheduledExecutorService.schedule(() -> {
|
||||
// 延时后再次确认是否仍满足触发条件(防止期间状态变化)
|
||||
if (checkIsNeedIssuedPlan(protSettings, siteId)) {
|
||||
// 判断是否需要生成告警
|
||||
if (isAlertAlarm == 1) {
|
||||
logger.info("<生成告警> 方案ID:{},站点:{}", plan.getId(), siteId);
|
||||
EmsAlarmRecords alarmRecords = addAlarmRecord(siteId,plan.getFaultName(),
|
||||
getAlarmLevel(plan.getFaultLevel()));
|
||||
emsAlarmRecordsMapper.insertEmsAlarmRecords(alarmRecords);
|
||||
}
|
||||
|
||||
// 是否有保护方案,有则通过modbus连接设备下发方案
|
||||
String protPlanJson = plan.getProtectionPlan();
|
||||
if (protPlanJson != null && !protPlanJson.isEmpty()) {
|
||||
logger.info("<下发保护方案> 方案内容:{}", protPlanJson);
|
||||
executeProtectionActions(protPlanJson,siteId,plan.getId(),plan.getFaultLevel()); // 执行Modbus指令
|
||||
}
|
||||
|
||||
// 更新方案状态为“已启用”
|
||||
logger.info("<方案已启用> 方案ID:{}", plan.getId());
|
||||
plan.setStatus(ProtPlanStatus.RUNNING.getCode());
|
||||
emsFaultProtectionPlanMapper.updateEmsFaultProtectionPlan(plan);
|
||||
}
|
||||
}, faultDelay, TimeUnit.SECONDS);
|
||||
}
|
||||
} else {
|
||||
// 已启用,则获取方案的释放值与最新数据判断是否需要取消方案
|
||||
if(checkIsNeedCancelPlan(protSettings, siteId)){
|
||||
// 延时,
|
||||
int releaseDelay = plan.getReleaseDelaySeconds().intValue();
|
||||
ScheduledFuture<?> delayTask = scheduledExecutorService.schedule(() -> {
|
||||
// 判断是否已存在未处理告警,有着取消
|
||||
if(isAlertAlarm == 1){
|
||||
logger.info("<取消告警>");
|
||||
EmsAlarmRecords emsAlarmRecords = emsAlarmRecordsMapper.getFailedRecord(siteId,
|
||||
plan.getFaultName(),getAlarmLevel(plan.getFaultLevel()));
|
||||
if(emsAlarmRecords != null){
|
||||
emsAlarmRecords.setStatus(AlarmStatus.DONE.getCode());
|
||||
emsAlarmRecordsMapper.updateEmsAlarmRecords(emsAlarmRecords);
|
||||
}
|
||||
}
|
||||
// 更新方案状态为“未启用”
|
||||
logger.info("<方案变更为未启用> 方案ID:{}", plan.getId());
|
||||
plan.setStatus(ProtPlanStatus.STOP.getCode());
|
||||
plan.setUpdateBy("system");
|
||||
emsFaultProtectionPlanMapper.updateEmsFaultProtectionPlan(plan);
|
||||
// 更新该站点策略为启用
|
||||
updateStrategyRunning(siteId);
|
||||
}, releaseDelay, TimeUnit.SECONDS);
|
||||
}
|
||||
}
|
||||
|
||||
return isHighLevel;
|
||||
}
|
||||
|
||||
// 下发保护方案
|
||||
private void executeProtectionActions(String protPlanJson, String siteId, Long planId, Integer faultLevel){
|
||||
final List<ProtectionPlanVo> protPlanList;
|
||||
try {
|
||||
protPlanList = objectMapper.readValue(
|
||||
protPlanJson,
|
||||
new TypeReference<List<ProtectionPlanVo>>() {}
|
||||
);
|
||||
if (protPlanList == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 遍历保护方案
|
||||
for (ProtectionPlanVo plan : protPlanList) {
|
||||
if (StringUtils.isEmpty(plan.getDeviceId()) || StringUtils.isEmpty(plan.getPoint())) {
|
||||
return;
|
||||
}
|
||||
// 给设备发送指令记录日志,并同步云端
|
||||
EmsFaultIssueLog faultIssueLog = createLogEntity(plan,siteId);
|
||||
faultIssueLog.setLogLevel(faultLevel);
|
||||
emsFaultIssueLogMapper.insertEmsFaultIssueLog(faultIssueLog);
|
||||
|
||||
// 通过modbus连接设备,发送数据
|
||||
executeSinglePlan(plan,siteId);
|
||||
}
|
||||
|
||||
|
||||
} catch (Exception e) {
|
||||
logger.error("下发保护方案失败,方案id为:", planId, e);
|
||||
}
|
||||
}
|
||||
|
||||
private EmsFaultIssueLog createLogEntity(ProtectionPlanVo plan,String siteId) {
|
||||
EmsFaultIssueLog faultIssueLog = new EmsFaultIssueLog();
|
||||
faultIssueLog.setLogId(UUID.randomUUID().toString());
|
||||
faultIssueLog.setLogTime(new Date());
|
||||
faultIssueLog.setSiteId(siteId);
|
||||
faultIssueLog.setDeviceId(plan.getDeviceId());
|
||||
faultIssueLog.setPoint(plan.getPoint());
|
||||
faultIssueLog.setValue(plan.getValue());
|
||||
faultIssueLog.setCreateBy("sys");
|
||||
faultIssueLog.setCreateTime(new Date());
|
||||
return faultIssueLog;
|
||||
}
|
||||
|
||||
private void executeSinglePlan(ProtectionPlanVo plan, String siteId) throws Exception {
|
||||
String deviceId = plan.getDeviceId();
|
||||
// 获取设备地址信息
|
||||
EmsDevicesSetting device = emsDevicesSettingMapper.getDeviceBySiteAndDeviceId(deviceId, siteId);
|
||||
if (device == null || StringUtils.isEmpty(device.getIpAddress()) || device.getIpPort()==null) {
|
||||
return;
|
||||
}
|
||||
// 获取设备连接
|
||||
ModbusConnectionWrapper wrapper = connectionManager.getConnection(device);
|
||||
if (wrapper == null || !wrapper.isActive()) {
|
||||
logger.info("<设备连接无效>");
|
||||
return;
|
||||
}
|
||||
|
||||
// 写入寄存器
|
||||
boolean success = modbusService.writeSingleRegister(
|
||||
wrapper.getConnection(),
|
||||
1,
|
||||
plan.getValue().intValue());
|
||||
|
||||
if (!success) {
|
||||
logger.error("写入失败,设备地址:{}", device.getIpAddress());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// 校验释放值是否取消方案
|
||||
private boolean checkIsNeedCancelPlan(List<ProtectionSettingVo> protSettings, String siteId) {
|
||||
BigDecimal releaseValue = BigDecimal.ZERO;
|
||||
|
||||
StringBuilder conditionSb = new StringBuilder();
|
||||
for (int i = 0; i < protSettings.size(); i++) {
|
||||
ProtectionSettingVo vo = protSettings.get(i);
|
||||
String deviceId = vo.getDeviceId();
|
||||
String point = vo.getPoint();
|
||||
releaseValue = vo.getFaultValue();
|
||||
if(StringUtils.isEmpty(deviceId) || StringUtils.isEmpty(point) || releaseValue == null
|
||||
|| StringUtils.isEmpty(vo.getReleaseOperator())){
|
||||
return false;
|
||||
}
|
||||
// 获取点位最新值
|
||||
BigDecimal lastPointValue = getPointLastValue(deviceId, point, siteId);
|
||||
if(lastPointValue == null){
|
||||
return false;
|
||||
}
|
||||
|
||||
// 拼接校验语句-最新值+比较方式+故障值+与下一点位关系(最后一个条件后不加关系)
|
||||
conditionSb.append(lastPointValue).append(vo.getReleaseOperator()).append(releaseValue);
|
||||
if (i < protSettings.size() - 1) {
|
||||
String relation = vo.getRelationNext();
|
||||
conditionSb.append(" ").append(relation).append(" ");
|
||||
}
|
||||
|
||||
// 执行比较语句
|
||||
return executeWithParser(conditionSb.toString());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// 校验故障值是否需要下发方案
|
||||
private boolean checkIsNeedIssuedPlan(List<ProtectionSettingVo> protSettings, String siteId) {
|
||||
BigDecimal faultValue = BigDecimal.ZERO;
|
||||
|
||||
StringBuilder conditionSb = new StringBuilder();
|
||||
for (int i = 0; i < protSettings.size(); i++) {
|
||||
ProtectionSettingVo vo = protSettings.get(i);
|
||||
String deviceId = vo.getDeviceId();
|
||||
String point = vo.getPoint();
|
||||
faultValue = vo.getFaultValue();
|
||||
if(StringUtils.isEmpty(deviceId) || StringUtils.isEmpty(point) || faultValue == null
|
||||
|| StringUtils.isEmpty(vo.getFaultOperator())){
|
||||
return false;
|
||||
}
|
||||
// 获取点位最新值
|
||||
BigDecimal lastPointValue = getPointLastValue(deviceId, point, siteId);
|
||||
if(lastPointValue == null){
|
||||
return false;
|
||||
}
|
||||
|
||||
// 拼接校验语句-最新值+比较方式+故障值+与下一点位关系(最后一个条件后不加关系)
|
||||
conditionSb.append(lastPointValue).append(vo.getFaultOperator()).append(faultValue);
|
||||
if (i < protSettings.size() - 1) {
|
||||
String relation = vo.getRelationNext();
|
||||
conditionSb.append(" ").append(relation).append(" ");
|
||||
}
|
||||
|
||||
// 执行比较语句
|
||||
return executeWithParser(conditionSb.toString());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private BigDecimal getPointLastValue(String deviceId, String point, String siteId) {
|
||||
JSONObject mqttJson = redisCache.getCacheObject(RedisKeyConstants.SYNC_DATA + siteId + "_" + deviceId);
|
||||
if(mqttJson == null){
|
||||
return null;
|
||||
}
|
||||
String jsonData = mqttJson.get("Data").toString();
|
||||
if(StringUtils.isEmpty(jsonData)){
|
||||
return null;
|
||||
}
|
||||
Map<String, Object> obj = JSON.parseObject(jsonData, new com.alibaba.fastjson2.TypeReference<Map<String, Object>>() {});
|
||||
return StringUtils.getBigDecimal(obj.get(point));
|
||||
}
|
||||
|
||||
// 更新站点策略为启用
|
||||
private void updateStrategyRunning(String siteId) {
|
||||
// 获取是否有正在运行的策略,如果有则不更改
|
||||
EmsStrategyRunning emsStrategyRunning = emsStrategyRunningMapper.getRunningStrategy(siteId);
|
||||
if (emsStrategyRunning == null) {
|
||||
// 获取已存在并且状态为:未启用和已暂停的最晚一条策略,更新为已启用
|
||||
emsStrategyRunning = emsStrategyRunningMapper.getPendingStrategy(siteId);
|
||||
emsStrategyRunning.setStatus(StrategyStatus.RUNNING.getCode());
|
||||
emsStrategyRunningMapper.updateEmsStrategyRunning(emsStrategyRunning);
|
||||
}
|
||||
}
|
||||
|
||||
private EmsAlarmRecords addAlarmRecord(String siteId, String content,String level) {
|
||||
EmsAlarmRecords emsAlarmRecords = new EmsAlarmRecords();
|
||||
emsAlarmRecords.setSiteId(siteId);
|
||||
emsAlarmRecords.setAlarmContent(content);
|
||||
emsAlarmRecords.setAlarmLevel(level);
|
||||
emsAlarmRecords.setAlarmStartTime(new Date());
|
||||
emsAlarmRecords.setStatus(AlarmStatus.WAITING.getCode());
|
||||
emsAlarmRecords.setDeviceType("TCP");
|
||||
emsAlarmRecords.setCreateBy("system");
|
||||
emsAlarmRecords.setCreateTime(new Date());
|
||||
return emsAlarmRecords;
|
||||
}
|
||||
|
||||
// 故障等级-告警等级匹配
|
||||
private String getAlarmLevel(Integer faultLevel) {
|
||||
if (ObjectUtils.isEmpty(faultLevel) || faultLevel < 1 || faultLevel > 3) {
|
||||
logger.warn("非法故障等级:{},默认返回普通告警", faultLevel);
|
||||
return AlarmLevelStatus.EMERGENCY.getCode();
|
||||
}
|
||||
switch (faultLevel) {
|
||||
case 1: return AlarmLevelStatus.GENERAL.getCode();
|
||||
case 2: return AlarmLevelStatus.SERIOUS.getCode();
|
||||
case 3: return AlarmLevelStatus.EMERGENCY.getCode();
|
||||
default:
|
||||
logger.error("未匹配的故障等级:{}", faultLevel);
|
||||
return AlarmLevelStatus.EMERGENCY.getCode();
|
||||
}
|
||||
}
|
||||
|
||||
// 自定义表达式解析器(仅支持简单运算符和逻辑关系)
|
||||
public boolean executeWithParser(String conditionStr) {
|
||||
if (conditionStr == null || conditionStr.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// 1. 拆分逻辑关系(提取 && 或 ||)
|
||||
List<String> logicRelations = new ArrayList<>();
|
||||
Pattern logicPattern = Pattern.compile("(&&|\\|\\|)");
|
||||
Matcher logicMatcher = logicPattern.matcher(conditionStr);
|
||||
while (logicMatcher.find()) {
|
||||
logicRelations.add(logicMatcher.group());
|
||||
}
|
||||
|
||||
// 2. 拆分原子条件(如 "3.55>3.52")
|
||||
String[] atomicConditions = logicPattern.split(conditionStr);
|
||||
|
||||
// 3. 解析每个原子条件并计算结果
|
||||
List<Boolean> atomicResults = new ArrayList<>();
|
||||
Pattern conditionPattern = Pattern.compile("(\\d+\\.?\\d*)\\s*([><]=?|==)\\s*(\\d+\\.?\\d*)");
|
||||
for (String atomic : atomicConditions) {
|
||||
Matcher matcher = conditionPattern.matcher(atomic.trim());
|
||||
if (!matcher.matches()) {
|
||||
logger.error("无效的原子条件:{}", atomic);
|
||||
return false;
|
||||
}
|
||||
double left = Double.parseDouble(matcher.group(1)); // 左值(最新值)
|
||||
String operator = matcher.group(2); // 运算符
|
||||
double right = Double.parseDouble(matcher.group(3)); // 右值(故障值)
|
||||
|
||||
// 执行比较
|
||||
boolean result;
|
||||
switch (operator) {
|
||||
case ">":
|
||||
result = left > right;
|
||||
break;
|
||||
case ">=":
|
||||
result = left >= right;
|
||||
break;
|
||||
case "<":
|
||||
result = left < right;
|
||||
break;
|
||||
case "<=":
|
||||
result = left <= right;
|
||||
break;
|
||||
case "==":
|
||||
result = left == right;
|
||||
break;
|
||||
default:
|
||||
result = false;
|
||||
break;
|
||||
}
|
||||
atomicResults.add(result);
|
||||
}
|
||||
|
||||
// 4. 组合原子结果(根据逻辑关系)
|
||||
boolean finalResult = atomicResults.get(0);
|
||||
for (int i = 0; i < logicRelations.size(); i++) {
|
||||
String relation = logicRelations.get(i);
|
||||
boolean nextResult = atomicResults.get(i + 1);
|
||||
if ("&&".equals(relation)) {
|
||||
finalResult = finalResult && nextResult;
|
||||
} else if ("||".equals(relation)) {
|
||||
finalResult = finalResult || nextResult;
|
||||
}
|
||||
}
|
||||
return finalResult;
|
||||
}
|
||||
}
|
||||
@ -1,4 +1,4 @@
|
||||
package com.xzzn.framework.scheduler;
|
||||
package com.xzzn.quartz.task;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.xzzn.common.utils.DateUtils;
|
||||
@ -15,9 +15,6 @@ import com.xzzn.framework.web.service.ModbusService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.time.LocalDate;
|
||||
@ -28,8 +25,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
@Component
|
||||
@EnableScheduling
|
||||
@Component("strategyPoller")
|
||||
public class StrategyPoller {
|
||||
private static final Logger logger = LoggerFactory.getLogger(StrategyPoller.class);
|
||||
|
||||
@ -56,12 +52,10 @@ public class StrategyPoller {
|
||||
public StrategyPoller(MqttLifecycleManager mqttLifecycleManager) {
|
||||
this.mqttLifecycleManager = mqttLifecycleManager;
|
||||
}
|
||||
// 每1分钟触发(支持cron表达式动态配置)
|
||||
@Scheduled(cron = "0 */1 * * * *")
|
||||
@Async("strategyTaskExecutor")
|
||||
|
||||
public void pollAllDevices() {
|
||||
logger.info("开始执行策略数据轮询...");
|
||||
List<StrategyRunningVo> strategyRunningVoList = emsStrategyRunningMapper.getRunningList(null);
|
||||
List<StrategyRunningVo> strategyRunningVoList = emsStrategyRunningMapper.getPendingPollerStrategy(null);
|
||||
strategyRunningVoList.forEach(strategyVo -> {
|
||||
try {
|
||||
CompletableFuture.runAsync(() -> {
|
||||
@ -93,7 +87,6 @@ public class StrategyPoller {
|
||||
}
|
||||
|
||||
// 策略数据下发-下方格式暂无
|
||||
|
||||
logger.info("策略下发结束");
|
||||
}
|
||||
|
||||
@ -0,0 +1,117 @@
|
||||
package com.xzzn.ems.domain;
|
||||
|
||||
import com.xzzn.common.core.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.xzzn.common.annotation.Excel;
|
||||
|
||||
/**
|
||||
* 告警点位匹配数据对象 ems_alarm_match_data
|
||||
*
|
||||
* @author xzzn
|
||||
* @date 2025-09-22
|
||||
*/
|
||||
public class EmsAlarmMatchData extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** $column.columnComment */
|
||||
private Long id;
|
||||
|
||||
/** 告警点位 */
|
||||
@Excel(name = "告警点位")
|
||||
private String point;
|
||||
|
||||
/** 告警值 */
|
||||
@Excel(name = "告警值")
|
||||
private Long alarmData;
|
||||
|
||||
/** 告警描述 */
|
||||
@Excel(name = "告警描述")
|
||||
private String alarmDescription;
|
||||
|
||||
/** 站点id */
|
||||
@Excel(name = "站点id")
|
||||
private String siteId;
|
||||
|
||||
/** 设备类型 */
|
||||
@Excel(name = "设备类型")
|
||||
private String deviceCategory;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setPoint(String point)
|
||||
{
|
||||
this.point = point;
|
||||
}
|
||||
|
||||
public String getPoint()
|
||||
{
|
||||
return point;
|
||||
}
|
||||
|
||||
public void setAlarmData(Long alarmData)
|
||||
{
|
||||
this.alarmData = alarmData;
|
||||
}
|
||||
|
||||
public Long getAlarmData()
|
||||
{
|
||||
return alarmData;
|
||||
}
|
||||
|
||||
public void setAlarmDescription(String alarmDescription)
|
||||
{
|
||||
this.alarmDescription = alarmDescription;
|
||||
}
|
||||
|
||||
public String getAlarmDescription()
|
||||
{
|
||||
return alarmDescription;
|
||||
}
|
||||
|
||||
public void setSiteId(String siteId)
|
||||
{
|
||||
this.siteId = siteId;
|
||||
}
|
||||
|
||||
public String getSiteId()
|
||||
{
|
||||
return siteId;
|
||||
}
|
||||
|
||||
public void setDeviceCategory(String deviceCategory)
|
||||
{
|
||||
this.deviceCategory = deviceCategory;
|
||||
}
|
||||
|
||||
public String getDeviceCategory()
|
||||
{
|
||||
return deviceCategory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("point", getPoint())
|
||||
.append("alarmData", getAlarmData())
|
||||
.append("alarmDescription", getAlarmDescription())
|
||||
.append("siteId", getSiteId())
|
||||
.append("deviceCategory", getDeviceCategory())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@ -24,8 +24,8 @@ public class EmsAlarmRecords extends BaseEntity
|
||||
@Excel(name = "设备类型")
|
||||
private String deviceType;
|
||||
|
||||
/** 告警等级 */
|
||||
@Excel(name = "告警等级")
|
||||
/** 告警等级:A-提示 B-一般 C-严重 D紧急 */
|
||||
@Excel(name = "告警等级:A-提示 B-一般 C-严重 D紧急")
|
||||
private String alarmLevel;
|
||||
|
||||
/** 告警内容 */
|
||||
@ -42,8 +42,12 @@ public class EmsAlarmRecords extends BaseEntity
|
||||
@Excel(name = "告警结束时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date alarmEndTime;
|
||||
|
||||
/** 状态 */
|
||||
@Excel(name = "状态")
|
||||
/** 告警点位 */
|
||||
@Excel(name = "告警点位")
|
||||
private String alarmPoint;
|
||||
|
||||
/** 状态:0-待处理 1-已处理 2-处理中 */
|
||||
@Excel(name = "状态:0-待处理 1-已处理 2-处理中")
|
||||
private String status;
|
||||
|
||||
/** 站点id */
|
||||
@ -54,10 +58,6 @@ public class EmsAlarmRecords extends BaseEntity
|
||||
@Excel(name = "设备唯一标识符")
|
||||
private String deviceId;
|
||||
|
||||
/** 设备名称,用于标识设备 */
|
||||
@Excel(name = "设备名称,用于标识设备")
|
||||
private String deviceName;
|
||||
|
||||
/** 工单号(规则:T+日期+6位随机) */
|
||||
@Excel(name = "工单号", readConverterExp = "规=则:T+日期+6位随机")
|
||||
private String ticketNo;
|
||||
@ -122,6 +122,16 @@ public class EmsAlarmRecords extends BaseEntity
|
||||
return alarmEndTime;
|
||||
}
|
||||
|
||||
public void setAlarmPoint(String alarmPoint)
|
||||
{
|
||||
this.alarmPoint = alarmPoint;
|
||||
}
|
||||
|
||||
public String getAlarmPoint()
|
||||
{
|
||||
return alarmPoint;
|
||||
}
|
||||
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
@ -152,24 +162,16 @@ public class EmsAlarmRecords extends BaseEntity
|
||||
return deviceId;
|
||||
}
|
||||
|
||||
public void setDeviceName(String deviceName)
|
||||
public void setTicketNo(String ticketNo)
|
||||
{
|
||||
this.deviceName = deviceName;
|
||||
}
|
||||
|
||||
public String getDeviceName()
|
||||
{
|
||||
return deviceName;
|
||||
}
|
||||
|
||||
public String getTicketNo() {
|
||||
return ticketNo;
|
||||
}
|
||||
|
||||
public void setTicketNo(String ticketNo) {
|
||||
this.ticketNo = ticketNo;
|
||||
}
|
||||
|
||||
public String getTicketNo()
|
||||
{
|
||||
return ticketNo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
@ -179,6 +181,7 @@ public class EmsAlarmRecords extends BaseEntity
|
||||
.append("alarmContent", getAlarmContent())
|
||||
.append("alarmStartTime", getAlarmStartTime())
|
||||
.append("alarmEndTime", getAlarmEndTime())
|
||||
.append("alarmPoint", getAlarmPoint())
|
||||
.append("status", getStatus())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
@ -187,8 +190,7 @@ public class EmsAlarmRecords extends BaseEntity
|
||||
.append("remark", getRemark())
|
||||
.append("siteId", getSiteId())
|
||||
.append("deviceId", getDeviceId())
|
||||
.append("deviceName", getDeviceName())
|
||||
.append("ticketNo", getTicketNo())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,8 +1,11 @@
|
||||
package com.xzzn.ems.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.xzzn.common.core.domain.BaseEntity;
|
||||
import com.xzzn.common.utils.StringUtils;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.xzzn.common.annotation.Excel;
|
||||
@ -20,6 +23,11 @@ public class EmsBatteryCluster extends BaseEntity
|
||||
/** */
|
||||
private Long id;
|
||||
|
||||
/** 数据更新时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "数据更新时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date dataUpdateTime;
|
||||
|
||||
/** 工作状态:0-正常 1-异常 2-停止 */
|
||||
@Excel(name = "工作状态:0-正常 1-异常 2-停止")
|
||||
private String workStatus;
|
||||
@ -146,7 +154,7 @@ public class EmsBatteryCluster extends BaseEntity
|
||||
|
||||
/** 最高单体电压对应点号 */
|
||||
@Excel(name = "最高单体电压对应点号")
|
||||
private Long maxCellVoltageId;
|
||||
private String maxCellVoltageId;
|
||||
|
||||
/** 最低单体电压 */
|
||||
@Excel(name = "最低单体电压")
|
||||
@ -154,7 +162,7 @@ public class EmsBatteryCluster extends BaseEntity
|
||||
|
||||
/** 最低单体电压对应点号 */
|
||||
@Excel(name = "最低单体电压对应点号")
|
||||
private Long minCellVoltageId;
|
||||
private String minCellVoltageId;
|
||||
|
||||
/** 最高单体温度 */
|
||||
@Excel(name = "最高单体温度")
|
||||
@ -162,7 +170,7 @@ public class EmsBatteryCluster extends BaseEntity
|
||||
|
||||
/** 最高单体温度对应点号 */
|
||||
@Excel(name = "最高单体温度对应点号")
|
||||
private Long maxCellTempId;
|
||||
private String maxCellTempId;
|
||||
|
||||
/** 最低单体温度 */
|
||||
@Excel(name = "最低单体温度")
|
||||
@ -170,7 +178,7 @@ public class EmsBatteryCluster extends BaseEntity
|
||||
|
||||
/** 最低单体温度对应点号 */
|
||||
@Excel(name = "最低单体温度对应点号")
|
||||
private Long minCellTempId;
|
||||
private String minCellTempId;
|
||||
|
||||
/** 最高单体SOC */
|
||||
@Excel(name = "最高单体SOC")
|
||||
@ -178,7 +186,7 @@ public class EmsBatteryCluster extends BaseEntity
|
||||
|
||||
/** 最高单体SOC对应点号 */
|
||||
@Excel(name = "最高单体SOC对应点号")
|
||||
private Long maxCellSocId;
|
||||
private String maxCellSocId;
|
||||
|
||||
/** 最低单体SOC */
|
||||
@Excel(name = "最低单体SOC")
|
||||
@ -186,7 +194,7 @@ public class EmsBatteryCluster extends BaseEntity
|
||||
|
||||
/** 最低单体SOC对应点号 */
|
||||
@Excel(name = "最低单体SOC对应点号")
|
||||
private Long minCellSocId;
|
||||
private String minCellSocId;
|
||||
|
||||
/** 最高单体SOH */
|
||||
@Excel(name = "最高单体SOH")
|
||||
@ -194,7 +202,7 @@ public class EmsBatteryCluster extends BaseEntity
|
||||
|
||||
/** 最高单体SOH对应点号 */
|
||||
@Excel(name = "最高单体SOH对应点号")
|
||||
private Long maxCellSohId;
|
||||
private String maxCellSohId;
|
||||
|
||||
/** 最低单体SOH */
|
||||
@Excel(name = "最低单体SOH")
|
||||
@ -202,7 +210,7 @@ public class EmsBatteryCluster extends BaseEntity
|
||||
|
||||
/** 最低单体SOH对应点号 */
|
||||
@Excel(name = "最低单体SOH对应点号")
|
||||
private Long minCellSohId;
|
||||
private String minCellSohId;
|
||||
|
||||
/** 单次累计充电电量 */
|
||||
@Excel(name = "单次累计充电电量")
|
||||
@ -222,6 +230,14 @@ public class EmsBatteryCluster extends BaseEntity
|
||||
return id;
|
||||
}
|
||||
|
||||
public Date getDataUpdateTime() {
|
||||
return dataUpdateTime;
|
||||
}
|
||||
|
||||
public void setDataUpdateTime(Date dataUpdateTime) {
|
||||
this.dataUpdateTime = dataUpdateTime;
|
||||
}
|
||||
|
||||
public void setWorkStatus(String workStatus)
|
||||
{
|
||||
this.workStatus = workStatus;
|
||||
@ -532,12 +548,12 @@ public class EmsBatteryCluster extends BaseEntity
|
||||
return maxCellVoltage;
|
||||
}
|
||||
|
||||
public void setMaxCellVoltageId(Long maxCellVoltageId)
|
||||
public void setMaxCellVoltageId(String maxCellVoltageId)
|
||||
{
|
||||
this.maxCellVoltageId = maxCellVoltageId;
|
||||
this.maxCellVoltageId = StringUtils.fillThreeDigits(maxCellVoltageId);
|
||||
}
|
||||
|
||||
public Long getMaxCellVoltageId()
|
||||
public String getMaxCellVoltageId()
|
||||
{
|
||||
return maxCellVoltageId;
|
||||
}
|
||||
@ -552,12 +568,12 @@ public class EmsBatteryCluster extends BaseEntity
|
||||
return minCellVoltage;
|
||||
}
|
||||
|
||||
public void setMinCellVoltageId(Long minCellVoltageId)
|
||||
public void setMinCellVoltageId(String minCellVoltageId)
|
||||
{
|
||||
this.minCellVoltageId = minCellVoltageId;
|
||||
this.minCellVoltageId = StringUtils.fillThreeDigits(minCellVoltageId);
|
||||
}
|
||||
|
||||
public Long getMinCellVoltageId()
|
||||
public String getMinCellVoltageId()
|
||||
{
|
||||
return minCellVoltageId;
|
||||
}
|
||||
@ -572,12 +588,12 @@ public class EmsBatteryCluster extends BaseEntity
|
||||
return maxCellTemp;
|
||||
}
|
||||
|
||||
public void setMaxCellTempId(Long maxCellTempId)
|
||||
public void setMaxCellTempId(String maxCellTempId)
|
||||
{
|
||||
this.maxCellTempId = maxCellTempId;
|
||||
this.maxCellTempId = StringUtils.fillThreeDigits(maxCellTempId);
|
||||
}
|
||||
|
||||
public Long getMaxCellTempId()
|
||||
public String getMaxCellTempId()
|
||||
{
|
||||
return maxCellTempId;
|
||||
}
|
||||
@ -592,12 +608,12 @@ public class EmsBatteryCluster extends BaseEntity
|
||||
return minCellTemp;
|
||||
}
|
||||
|
||||
public void setMinCellTempId(Long minCellTempId)
|
||||
public void setMinCellTempId(String minCellTempId)
|
||||
{
|
||||
this.minCellTempId = minCellTempId;
|
||||
this.minCellTempId = StringUtils.fillThreeDigits(minCellTempId);
|
||||
}
|
||||
|
||||
public Long getMinCellTempId()
|
||||
public String getMinCellTempId()
|
||||
{
|
||||
return minCellTempId;
|
||||
}
|
||||
@ -612,12 +628,12 @@ public class EmsBatteryCluster extends BaseEntity
|
||||
return maxCellSoc;
|
||||
}
|
||||
|
||||
public void setMaxCellSocId(Long maxCellSocId)
|
||||
public void setMaxCellSocId(String maxCellSocId)
|
||||
{
|
||||
this.maxCellSocId = maxCellSocId;
|
||||
this.maxCellSocId = StringUtils.fillThreeDigits(maxCellSocId);
|
||||
}
|
||||
|
||||
public Long getMaxCellSocId()
|
||||
public String getMaxCellSocId()
|
||||
{
|
||||
return maxCellSocId;
|
||||
}
|
||||
@ -632,12 +648,12 @@ public class EmsBatteryCluster extends BaseEntity
|
||||
return minCellSoc;
|
||||
}
|
||||
|
||||
public void setMinCellSocId(Long minCellSocId)
|
||||
public void setMinCellSocId(String minCellSocId)
|
||||
{
|
||||
this.minCellSocId = minCellSocId;
|
||||
this.minCellSocId = StringUtils.fillThreeDigits(minCellSocId);
|
||||
}
|
||||
|
||||
public Long getMinCellSocId()
|
||||
public String getMinCellSocId()
|
||||
{
|
||||
return minCellSocId;
|
||||
}
|
||||
@ -652,12 +668,12 @@ public class EmsBatteryCluster extends BaseEntity
|
||||
return maxCellSoh;
|
||||
}
|
||||
|
||||
public void setMaxCellSohId(Long maxCellSohId)
|
||||
public void setMaxCellSohId(String maxCellSohId)
|
||||
{
|
||||
this.maxCellSohId = maxCellSohId;
|
||||
this.maxCellSohId = StringUtils.fillThreeDigits(maxCellSohId);
|
||||
}
|
||||
|
||||
public Long getMaxCellSohId()
|
||||
public String getMaxCellSohId()
|
||||
{
|
||||
return maxCellSohId;
|
||||
}
|
||||
@ -672,12 +688,12 @@ public class EmsBatteryCluster extends BaseEntity
|
||||
return minCellSoh;
|
||||
}
|
||||
|
||||
public void setMinCellSohId(Long minCellSohId)
|
||||
public void setMinCellSohId(String minCellSohId)
|
||||
{
|
||||
this.minCellSohId = minCellSohId;
|
||||
this.minCellSohId = StringUtils.fillThreeDigits(minCellSohId);
|
||||
}
|
||||
|
||||
public Long getMinCellSohId()
|
||||
public String getMinCellSohId()
|
||||
{
|
||||
return minCellSohId;
|
||||
}
|
||||
|
||||
@ -0,0 +1,242 @@
|
||||
package com.xzzn.ems.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.xzzn.common.core.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.xzzn.common.annotation.Excel;
|
||||
|
||||
/**
|
||||
* 单体电池天级数据对象 ems_battery_data_day
|
||||
*
|
||||
* @author xzzn
|
||||
* @date 2025-08-20
|
||||
*/
|
||||
public class EmsBatteryDataDay extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** $column.columnComment */
|
||||
private Long id;
|
||||
|
||||
/** 电池堆 */
|
||||
@Excel(name = "电池堆")
|
||||
private String batteryPack;
|
||||
|
||||
/** 电池簇 */
|
||||
@Excel(name = "电池簇")
|
||||
private String batteryCluster;
|
||||
|
||||
/** 单体编号 */
|
||||
@Excel(name = "单体编号")
|
||||
private String batteryCellId;
|
||||
|
||||
/** 电压 (V) */
|
||||
@Excel(name = "电压 (V)")
|
||||
private BigDecimal voltage;
|
||||
|
||||
/** 温度 (℃) */
|
||||
@Excel(name = "温度 (℃)")
|
||||
private BigDecimal temperature;
|
||||
|
||||
/** SOC (%) */
|
||||
@Excel(name = "SOC (%)")
|
||||
private BigDecimal soc;
|
||||
|
||||
/** SOH (%) */
|
||||
@Excel(name = "SOH (%)")
|
||||
private BigDecimal soh;
|
||||
|
||||
/** 数据采集时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "数据采集时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date dataTimestamp;
|
||||
|
||||
/** 站点id */
|
||||
@Excel(name = "站点id")
|
||||
private String siteId;
|
||||
|
||||
/** 设备唯一标识符 */
|
||||
@Excel(name = "设备唯一标识符")
|
||||
private String deviceId;
|
||||
|
||||
/** 簇设备id */
|
||||
@Excel(name = "簇设备id")
|
||||
private String clusterDeviceId;
|
||||
|
||||
/** 单体电池内阻 */
|
||||
@Excel(name = "单体电池内阻")
|
||||
private BigDecimal interResistance;
|
||||
|
||||
/** 天级时间维度 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "天级时间维度", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date dayTime;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setBatteryPack(String batteryPack)
|
||||
{
|
||||
this.batteryPack = batteryPack;
|
||||
}
|
||||
|
||||
public String getBatteryPack()
|
||||
{
|
||||
return batteryPack;
|
||||
}
|
||||
|
||||
public void setBatteryCluster(String batteryCluster)
|
||||
{
|
||||
this.batteryCluster = batteryCluster;
|
||||
}
|
||||
|
||||
public String getBatteryCluster()
|
||||
{
|
||||
return batteryCluster;
|
||||
}
|
||||
|
||||
public void setBatteryCellId(String batteryCellId)
|
||||
{
|
||||
this.batteryCellId = batteryCellId;
|
||||
}
|
||||
|
||||
public String getBatteryCellId()
|
||||
{
|
||||
return batteryCellId;
|
||||
}
|
||||
|
||||
public void setVoltage(BigDecimal voltage)
|
||||
{
|
||||
this.voltage = voltage;
|
||||
}
|
||||
|
||||
public BigDecimal getVoltage()
|
||||
{
|
||||
return voltage;
|
||||
}
|
||||
|
||||
public void setTemperature(BigDecimal temperature)
|
||||
{
|
||||
this.temperature = temperature;
|
||||
}
|
||||
|
||||
public BigDecimal getTemperature()
|
||||
{
|
||||
return temperature;
|
||||
}
|
||||
|
||||
public void setSoc(BigDecimal soc)
|
||||
{
|
||||
this.soc = soc;
|
||||
}
|
||||
|
||||
public BigDecimal getSoc()
|
||||
{
|
||||
return soc;
|
||||
}
|
||||
|
||||
public void setSoh(BigDecimal soh)
|
||||
{
|
||||
this.soh = soh;
|
||||
}
|
||||
|
||||
public BigDecimal getSoh()
|
||||
{
|
||||
return soh;
|
||||
}
|
||||
|
||||
public void setDataTimestamp(Date dataTimestamp)
|
||||
{
|
||||
this.dataTimestamp = dataTimestamp;
|
||||
}
|
||||
|
||||
public Date getDataTimestamp()
|
||||
{
|
||||
return dataTimestamp;
|
||||
}
|
||||
|
||||
public void setSiteId(String siteId)
|
||||
{
|
||||
this.siteId = siteId;
|
||||
}
|
||||
|
||||
public String getSiteId()
|
||||
{
|
||||
return siteId;
|
||||
}
|
||||
|
||||
public void setDeviceId(String deviceId)
|
||||
{
|
||||
this.deviceId = deviceId;
|
||||
}
|
||||
|
||||
public String getDeviceId()
|
||||
{
|
||||
return deviceId;
|
||||
}
|
||||
|
||||
public void setClusterDeviceId(String clusterDeviceId)
|
||||
{
|
||||
this.clusterDeviceId = clusterDeviceId;
|
||||
}
|
||||
|
||||
public String getClusterDeviceId()
|
||||
{
|
||||
return clusterDeviceId;
|
||||
}
|
||||
|
||||
public void setInterResistance(BigDecimal interResistance)
|
||||
{
|
||||
this.interResistance = interResistance;
|
||||
}
|
||||
|
||||
public BigDecimal getInterResistance()
|
||||
{
|
||||
return interResistance;
|
||||
}
|
||||
|
||||
public void setDayTime(Date dayTime)
|
||||
{
|
||||
this.dayTime = dayTime;
|
||||
}
|
||||
|
||||
public Date getDayTime()
|
||||
{
|
||||
return dayTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("batteryPack", getBatteryPack())
|
||||
.append("batteryCluster", getBatteryCluster())
|
||||
.append("batteryCellId", getBatteryCellId())
|
||||
.append("voltage", getVoltage())
|
||||
.append("temperature", getTemperature())
|
||||
.append("soc", getSoc())
|
||||
.append("soh", getSoh())
|
||||
.append("dataTimestamp", getDataTimestamp())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.append("siteId", getSiteId())
|
||||
.append("deviceId", getDeviceId())
|
||||
.append("clusterDeviceId", getClusterDeviceId())
|
||||
.append("interResistance", getInterResistance())
|
||||
.append("dayTime", getDayTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,242 @@
|
||||
package com.xzzn.ems.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.xzzn.common.core.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.xzzn.common.annotation.Excel;
|
||||
|
||||
/**
|
||||
* 单体电池小时级数据对象 ems_battery_data_hour
|
||||
*
|
||||
* @author xzzn
|
||||
* @date 2025-08-19
|
||||
*/
|
||||
public class EmsBatteryDataHour extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** $column.columnComment */
|
||||
private Long id;
|
||||
|
||||
/** 电池堆 */
|
||||
@Excel(name = "电池堆")
|
||||
private String batteryPack;
|
||||
|
||||
/** 电池簇 */
|
||||
@Excel(name = "电池簇")
|
||||
private String batteryCluster;
|
||||
|
||||
/** 单体编号 */
|
||||
@Excel(name = "单体编号")
|
||||
private String batteryCellId;
|
||||
|
||||
/** 电压 (V) */
|
||||
@Excel(name = "电压 (V)")
|
||||
private BigDecimal voltage;
|
||||
|
||||
/** 温度 (℃) */
|
||||
@Excel(name = "温度 (℃)")
|
||||
private BigDecimal temperature;
|
||||
|
||||
/** SOC (%) */
|
||||
@Excel(name = "SOC (%)")
|
||||
private BigDecimal soc;
|
||||
|
||||
/** SOH (%) */
|
||||
@Excel(name = "SOH (%)")
|
||||
private BigDecimal soh;
|
||||
|
||||
/** 数据采集时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "数据采集时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date dataTimestamp;
|
||||
|
||||
/** 站点id */
|
||||
@Excel(name = "站点id")
|
||||
private String siteId;
|
||||
|
||||
/** 设备唯一标识符 */
|
||||
@Excel(name = "设备唯一标识符")
|
||||
private String deviceId;
|
||||
|
||||
/** 簇设备id */
|
||||
@Excel(name = "簇设备id")
|
||||
private String clusterDeviceId;
|
||||
|
||||
/** 单体电池内阻 */
|
||||
@Excel(name = "单体电池内阻")
|
||||
private BigDecimal interResistance;
|
||||
|
||||
/** 小时级时间维度 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "小时级时间维度", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date hourTime;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setBatteryPack(String batteryPack)
|
||||
{
|
||||
this.batteryPack = batteryPack;
|
||||
}
|
||||
|
||||
public String getBatteryPack()
|
||||
{
|
||||
return batteryPack;
|
||||
}
|
||||
|
||||
public void setBatteryCluster(String batteryCluster)
|
||||
{
|
||||
this.batteryCluster = batteryCluster;
|
||||
}
|
||||
|
||||
public String getBatteryCluster()
|
||||
{
|
||||
return batteryCluster;
|
||||
}
|
||||
|
||||
public void setBatteryCellId(String batteryCellId)
|
||||
{
|
||||
this.batteryCellId = batteryCellId;
|
||||
}
|
||||
|
||||
public String getBatteryCellId()
|
||||
{
|
||||
return batteryCellId;
|
||||
}
|
||||
|
||||
public void setVoltage(BigDecimal voltage)
|
||||
{
|
||||
this.voltage = voltage;
|
||||
}
|
||||
|
||||
public BigDecimal getVoltage()
|
||||
{
|
||||
return voltage;
|
||||
}
|
||||
|
||||
public void setTemperature(BigDecimal temperature)
|
||||
{
|
||||
this.temperature = temperature;
|
||||
}
|
||||
|
||||
public BigDecimal getTemperature()
|
||||
{
|
||||
return temperature;
|
||||
}
|
||||
|
||||
public void setSoc(BigDecimal soc)
|
||||
{
|
||||
this.soc = soc;
|
||||
}
|
||||
|
||||
public BigDecimal getSoc()
|
||||
{
|
||||
return soc;
|
||||
}
|
||||
|
||||
public void setSoh(BigDecimal soh)
|
||||
{
|
||||
this.soh = soh;
|
||||
}
|
||||
|
||||
public BigDecimal getSoh()
|
||||
{
|
||||
return soh;
|
||||
}
|
||||
|
||||
public void setDataTimestamp(Date dataTimestamp)
|
||||
{
|
||||
this.dataTimestamp = dataTimestamp;
|
||||
}
|
||||
|
||||
public Date getDataTimestamp()
|
||||
{
|
||||
return dataTimestamp;
|
||||
}
|
||||
|
||||
public void setSiteId(String siteId)
|
||||
{
|
||||
this.siteId = siteId;
|
||||
}
|
||||
|
||||
public String getSiteId()
|
||||
{
|
||||
return siteId;
|
||||
}
|
||||
|
||||
public void setDeviceId(String deviceId)
|
||||
{
|
||||
this.deviceId = deviceId;
|
||||
}
|
||||
|
||||
public String getDeviceId()
|
||||
{
|
||||
return deviceId;
|
||||
}
|
||||
|
||||
public void setClusterDeviceId(String clusterDeviceId)
|
||||
{
|
||||
this.clusterDeviceId = clusterDeviceId;
|
||||
}
|
||||
|
||||
public String getClusterDeviceId()
|
||||
{
|
||||
return clusterDeviceId;
|
||||
}
|
||||
|
||||
public void setInterResistance(BigDecimal interResistance)
|
||||
{
|
||||
this.interResistance = interResistance;
|
||||
}
|
||||
|
||||
public BigDecimal getInterResistance()
|
||||
{
|
||||
return interResistance;
|
||||
}
|
||||
|
||||
public void setHourTime(Date hourTime)
|
||||
{
|
||||
this.hourTime = hourTime;
|
||||
}
|
||||
|
||||
public Date getHourTime()
|
||||
{
|
||||
return hourTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("batteryPack", getBatteryPack())
|
||||
.append("batteryCluster", getBatteryCluster())
|
||||
.append("batteryCellId", getBatteryCellId())
|
||||
.append("voltage", getVoltage())
|
||||
.append("temperature", getTemperature())
|
||||
.append("soc", getSoc())
|
||||
.append("soh", getSoh())
|
||||
.append("dataTimestamp", getDataTimestamp())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.append("siteId", getSiteId())
|
||||
.append("deviceId", getDeviceId())
|
||||
.append("clusterDeviceId", getClusterDeviceId())
|
||||
.append("interResistance", getInterResistance())
|
||||
.append("hourTime", getHourTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,226 @@
|
||||
package com.xzzn.ems.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.xzzn.common.core.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.xzzn.common.annotation.Excel;
|
||||
|
||||
/**
|
||||
* 单体电池分钟级数据对象 ems_battery_data_minutes
|
||||
*
|
||||
* @author xzzn
|
||||
* @date 2025-08-18
|
||||
*/
|
||||
public class EmsBatteryDataMinutes extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** $column.columnComment */
|
||||
private Long id;
|
||||
|
||||
/** 电池堆 */
|
||||
@Excel(name = "电池堆")
|
||||
private String batteryPack;
|
||||
|
||||
/** 电池簇 */
|
||||
@Excel(name = "电池簇")
|
||||
private String batteryCluster;
|
||||
|
||||
/** 单体编号 */
|
||||
@Excel(name = "单体编号")
|
||||
private String batteryCellId;
|
||||
|
||||
/** 电压 (V) */
|
||||
@Excel(name = "电压 (V)")
|
||||
private BigDecimal voltage;
|
||||
|
||||
/** 温度 (℃) */
|
||||
@Excel(name = "温度 (℃)")
|
||||
private BigDecimal temperature;
|
||||
|
||||
/** SOC (%) */
|
||||
@Excel(name = "SOC (%)")
|
||||
private BigDecimal soc;
|
||||
|
||||
/** SOH (%) */
|
||||
@Excel(name = "SOH (%)")
|
||||
private BigDecimal soh;
|
||||
|
||||
/** 数据采集时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "数据采集时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date dataTimestamp;
|
||||
|
||||
/** 站点id */
|
||||
@Excel(name = "站点id")
|
||||
private String siteId;
|
||||
|
||||
/** 设备唯一标识符 */
|
||||
@Excel(name = "设备唯一标识符")
|
||||
private String deviceId;
|
||||
|
||||
/** 簇设备id */
|
||||
@Excel(name = "簇设备id")
|
||||
private String clusterDeviceId;
|
||||
|
||||
/** 单体电池内阻 */
|
||||
@Excel(name = "单体电池内阻")
|
||||
private BigDecimal interResistance;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setBatteryPack(String batteryPack)
|
||||
{
|
||||
this.batteryPack = batteryPack;
|
||||
}
|
||||
|
||||
public String getBatteryPack()
|
||||
{
|
||||
return batteryPack;
|
||||
}
|
||||
|
||||
public void setBatteryCluster(String batteryCluster)
|
||||
{
|
||||
this.batteryCluster = batteryCluster;
|
||||
}
|
||||
|
||||
public String getBatteryCluster()
|
||||
{
|
||||
return batteryCluster;
|
||||
}
|
||||
|
||||
public void setBatteryCellId(String batteryCellId)
|
||||
{
|
||||
this.batteryCellId = batteryCellId;
|
||||
}
|
||||
|
||||
public String getBatteryCellId()
|
||||
{
|
||||
return batteryCellId;
|
||||
}
|
||||
|
||||
public void setVoltage(BigDecimal voltage)
|
||||
{
|
||||
this.voltage = voltage;
|
||||
}
|
||||
|
||||
public BigDecimal getVoltage()
|
||||
{
|
||||
return voltage;
|
||||
}
|
||||
|
||||
public void setTemperature(BigDecimal temperature)
|
||||
{
|
||||
this.temperature = temperature;
|
||||
}
|
||||
|
||||
public BigDecimal getTemperature()
|
||||
{
|
||||
return temperature;
|
||||
}
|
||||
|
||||
public void setSoc(BigDecimal soc)
|
||||
{
|
||||
this.soc = soc;
|
||||
}
|
||||
|
||||
public BigDecimal getSoc()
|
||||
{
|
||||
return soc;
|
||||
}
|
||||
|
||||
public void setSoh(BigDecimal soh)
|
||||
{
|
||||
this.soh = soh;
|
||||
}
|
||||
|
||||
public BigDecimal getSoh()
|
||||
{
|
||||
return soh;
|
||||
}
|
||||
|
||||
public void setDataTimestamp(Date dataTimestamp)
|
||||
{
|
||||
this.dataTimestamp = dataTimestamp;
|
||||
}
|
||||
|
||||
public Date getDataTimestamp()
|
||||
{
|
||||
return dataTimestamp;
|
||||
}
|
||||
|
||||
public void setSiteId(String siteId)
|
||||
{
|
||||
this.siteId = siteId;
|
||||
}
|
||||
|
||||
public String getSiteId()
|
||||
{
|
||||
return siteId;
|
||||
}
|
||||
|
||||
public void setDeviceId(String deviceId)
|
||||
{
|
||||
this.deviceId = deviceId;
|
||||
}
|
||||
|
||||
public String getDeviceId()
|
||||
{
|
||||
return deviceId;
|
||||
}
|
||||
|
||||
public void setClusterDeviceId(String clusterDeviceId)
|
||||
{
|
||||
this.clusterDeviceId = clusterDeviceId;
|
||||
}
|
||||
|
||||
public String getClusterDeviceId()
|
||||
{
|
||||
return clusterDeviceId;
|
||||
}
|
||||
|
||||
public void setInterResistance(BigDecimal interResistance)
|
||||
{
|
||||
this.interResistance = interResistance;
|
||||
}
|
||||
|
||||
public BigDecimal getInterResistance()
|
||||
{
|
||||
return interResistance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("batteryPack", getBatteryPack())
|
||||
.append("batteryCluster", getBatteryCluster())
|
||||
.append("batteryCellId", getBatteryCellId())
|
||||
.append("voltage", getVoltage())
|
||||
.append("temperature", getTemperature())
|
||||
.append("soc", getSoc())
|
||||
.append("soh", getSoh())
|
||||
.append("dataTimestamp", getDataTimestamp())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.append("siteId", getSiteId())
|
||||
.append("deviceId", getDeviceId())
|
||||
.append("clusterDeviceId", getClusterDeviceId())
|
||||
.append("interResistance", getInterResistance())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,242 @@
|
||||
package com.xzzn.ems.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.xzzn.common.core.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.xzzn.common.annotation.Excel;
|
||||
|
||||
/**
|
||||
* 单体电池月级数据对象 ems_battery_data_month
|
||||
*
|
||||
* @author xzzn
|
||||
* @date 2025-08-22
|
||||
*/
|
||||
public class EmsBatteryDataMonth extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** $column.columnComment */
|
||||
private Long id;
|
||||
|
||||
/** 电池堆 */
|
||||
@Excel(name = "电池堆")
|
||||
private String batteryPack;
|
||||
|
||||
/** 电池簇 */
|
||||
@Excel(name = "电池簇")
|
||||
private String batteryCluster;
|
||||
|
||||
/** 单体编号 */
|
||||
@Excel(name = "单体编号")
|
||||
private String batteryCellId;
|
||||
|
||||
/** 电压 (V) */
|
||||
@Excel(name = "电压 (V)")
|
||||
private BigDecimal voltage;
|
||||
|
||||
/** 温度 (℃) */
|
||||
@Excel(name = "温度 (℃)")
|
||||
private BigDecimal temperature;
|
||||
|
||||
/** SOC (%) */
|
||||
@Excel(name = "SOC (%)")
|
||||
private BigDecimal soc;
|
||||
|
||||
/** SOH (%) */
|
||||
@Excel(name = "SOH (%)")
|
||||
private BigDecimal soh;
|
||||
|
||||
/** 数据采集时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "数据采集时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date dataTimestamp;
|
||||
|
||||
/** 站点id */
|
||||
@Excel(name = "站点id")
|
||||
private String siteId;
|
||||
|
||||
/** 设备唯一标识符 */
|
||||
@Excel(name = "设备唯一标识符")
|
||||
private String deviceId;
|
||||
|
||||
/** 簇设备id */
|
||||
@Excel(name = "簇设备id")
|
||||
private String clusterDeviceId;
|
||||
|
||||
/** 单体电池内阻 */
|
||||
@Excel(name = "单体电池内阻")
|
||||
private BigDecimal interResistance;
|
||||
|
||||
/** 月级时间维度 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "月级时间维度", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date monthTime;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setBatteryPack(String batteryPack)
|
||||
{
|
||||
this.batteryPack = batteryPack;
|
||||
}
|
||||
|
||||
public String getBatteryPack()
|
||||
{
|
||||
return batteryPack;
|
||||
}
|
||||
|
||||
public void setBatteryCluster(String batteryCluster)
|
||||
{
|
||||
this.batteryCluster = batteryCluster;
|
||||
}
|
||||
|
||||
public String getBatteryCluster()
|
||||
{
|
||||
return batteryCluster;
|
||||
}
|
||||
|
||||
public void setBatteryCellId(String batteryCellId)
|
||||
{
|
||||
this.batteryCellId = batteryCellId;
|
||||
}
|
||||
|
||||
public String getBatteryCellId()
|
||||
{
|
||||
return batteryCellId;
|
||||
}
|
||||
|
||||
public void setVoltage(BigDecimal voltage)
|
||||
{
|
||||
this.voltage = voltage;
|
||||
}
|
||||
|
||||
public BigDecimal getVoltage()
|
||||
{
|
||||
return voltage;
|
||||
}
|
||||
|
||||
public void setTemperature(BigDecimal temperature)
|
||||
{
|
||||
this.temperature = temperature;
|
||||
}
|
||||
|
||||
public BigDecimal getTemperature()
|
||||
{
|
||||
return temperature;
|
||||
}
|
||||
|
||||
public void setSoc(BigDecimal soc)
|
||||
{
|
||||
this.soc = soc;
|
||||
}
|
||||
|
||||
public BigDecimal getSoc()
|
||||
{
|
||||
return soc;
|
||||
}
|
||||
|
||||
public void setSoh(BigDecimal soh)
|
||||
{
|
||||
this.soh = soh;
|
||||
}
|
||||
|
||||
public BigDecimal getSoh()
|
||||
{
|
||||
return soh;
|
||||
}
|
||||
|
||||
public void setDataTimestamp(Date dataTimestamp)
|
||||
{
|
||||
this.dataTimestamp = dataTimestamp;
|
||||
}
|
||||
|
||||
public Date getDataTimestamp()
|
||||
{
|
||||
return dataTimestamp;
|
||||
}
|
||||
|
||||
public void setSiteId(String siteId)
|
||||
{
|
||||
this.siteId = siteId;
|
||||
}
|
||||
|
||||
public String getSiteId()
|
||||
{
|
||||
return siteId;
|
||||
}
|
||||
|
||||
public void setDeviceId(String deviceId)
|
||||
{
|
||||
this.deviceId = deviceId;
|
||||
}
|
||||
|
||||
public String getDeviceId()
|
||||
{
|
||||
return deviceId;
|
||||
}
|
||||
|
||||
public void setClusterDeviceId(String clusterDeviceId)
|
||||
{
|
||||
this.clusterDeviceId = clusterDeviceId;
|
||||
}
|
||||
|
||||
public String getClusterDeviceId()
|
||||
{
|
||||
return clusterDeviceId;
|
||||
}
|
||||
|
||||
public void setInterResistance(BigDecimal interResistance)
|
||||
{
|
||||
this.interResistance = interResistance;
|
||||
}
|
||||
|
||||
public BigDecimal getInterResistance()
|
||||
{
|
||||
return interResistance;
|
||||
}
|
||||
|
||||
public void setMonthTime(Date monthTime)
|
||||
{
|
||||
this.monthTime = monthTime;
|
||||
}
|
||||
|
||||
public Date getMonthTime()
|
||||
{
|
||||
return monthTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("batteryPack", getBatteryPack())
|
||||
.append("batteryCluster", getBatteryCluster())
|
||||
.append("batteryCellId", getBatteryCellId())
|
||||
.append("voltage", getVoltage())
|
||||
.append("temperature", getTemperature())
|
||||
.append("soc", getSoc())
|
||||
.append("soh", getSoh())
|
||||
.append("dataTimestamp", getDataTimestamp())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.append("siteId", getSiteId())
|
||||
.append("deviceId", getDeviceId())
|
||||
.append("clusterDeviceId", getClusterDeviceId())
|
||||
.append("interResistance", getInterResistance())
|
||||
.append("monthTime", getMonthTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@ -1,7 +1,9 @@
|
||||
package com.xzzn.ems.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.xzzn.common.core.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
@ -20,6 +22,11 @@ public class EmsBatteryStack extends BaseEntity
|
||||
/** */
|
||||
private Long id;
|
||||
|
||||
/** 数据更新时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "数据更新时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date dataUpdateTime;
|
||||
|
||||
/** 工作状态:0-正常 1-异常 2-停止 */
|
||||
@Excel(name = "工作状态:0-正常 1-异常 2-停止")
|
||||
private String workStatus;
|
||||
@ -254,6 +261,14 @@ public class EmsBatteryStack extends BaseEntity
|
||||
return id;
|
||||
}
|
||||
|
||||
public Date getDataUpdateTime() {
|
||||
return dataUpdateTime;
|
||||
}
|
||||
|
||||
public void setDataUpdateTime(Date dataUpdateTime) {
|
||||
this.dataUpdateTime = dataUpdateTime;
|
||||
}
|
||||
|
||||
public void setWorkStatus(String workStatus)
|
||||
{
|
||||
this.workStatus = workStatus;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,795 @@
|
||||
package com.xzzn.ems.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.xzzn.common.core.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.xzzn.common.annotation.Excel;
|
||||
|
||||
/**
|
||||
* ZSLQ告警故障数据对象 ems_cooling_alarm_data
|
||||
*
|
||||
* @author xzzn
|
||||
* @date 2025-10-22
|
||||
*/
|
||||
public class EmsCoolingAlarmData extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 记录唯一ID */
|
||||
private Long id;
|
||||
|
||||
/** 数据采集时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "数据采集时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date dataTimestamp;
|
||||
|
||||
/** 站点ID */
|
||||
@Excel(name = "站点ID")
|
||||
private String siteId;
|
||||
|
||||
/** 设备唯一标识符 */
|
||||
@Excel(name = "设备唯一标识符")
|
||||
private String deviceId;
|
||||
|
||||
/** */
|
||||
@Excel(name = "")
|
||||
private Integer lsjyx;
|
||||
|
||||
/** */
|
||||
@Excel(name = "")
|
||||
private Integer pqdcfyx;
|
||||
|
||||
/** */
|
||||
@Excel(name = "")
|
||||
private Integer djrq2yx;
|
||||
|
||||
/** */
|
||||
@Excel(name = "")
|
||||
private Integer djrq1yx;
|
||||
|
||||
/** */
|
||||
@Excel(name = "")
|
||||
private Integer bqbyx;
|
||||
|
||||
/** */
|
||||
@Excel(name = "")
|
||||
private Integer bsbyx;
|
||||
|
||||
/** */
|
||||
@Excel(name = "")
|
||||
private Integer zxhbyx;
|
||||
|
||||
/** */
|
||||
@Excel(name = "")
|
||||
private Integer sltzgz;
|
||||
|
||||
/** */
|
||||
@Excel(name = "")
|
||||
private Integer slzhyj;
|
||||
|
||||
/** */
|
||||
@Excel(name = "")
|
||||
private Integer slxtyctzxh;
|
||||
|
||||
/** */
|
||||
@Excel(name = "")
|
||||
private Integer slxtycqdxh;
|
||||
|
||||
/** */
|
||||
@Excel(name = "")
|
||||
private Integer slxtyckz;
|
||||
|
||||
/** */
|
||||
@Excel(name = "")
|
||||
private Integer slxtbdkz;
|
||||
|
||||
/** */
|
||||
@Excel(name = "")
|
||||
private Integer slxtzdms;
|
||||
|
||||
/** */
|
||||
@Excel(name = "")
|
||||
private Integer slxtsdms;
|
||||
|
||||
/** */
|
||||
@Excel(name = "")
|
||||
private Integer hsylcdyj;
|
||||
|
||||
/** */
|
||||
@Excel(name = "")
|
||||
private Integer hsyldyj;
|
||||
|
||||
/** */
|
||||
@Excel(name = "")
|
||||
private Integer gsylcgyj;
|
||||
|
||||
/** */
|
||||
@Excel(name = "")
|
||||
private Integer gsylgyj;
|
||||
|
||||
/** */
|
||||
@Excel(name = "")
|
||||
private Integer gsylcdyj;
|
||||
|
||||
/** */
|
||||
@Excel(name = "")
|
||||
private Integer gsyldyj;
|
||||
|
||||
/** */
|
||||
@Excel(name = "")
|
||||
private Integer hcgywg;
|
||||
|
||||
/** */
|
||||
@Excel(name = "")
|
||||
private Integer hcgywcdtz;
|
||||
|
||||
/** */
|
||||
@Excel(name = "")
|
||||
private Integer hcgywd;
|
||||
|
||||
/** */
|
||||
@Excel(name = "")
|
||||
private Integer hcgylg;
|
||||
|
||||
/** */
|
||||
@Excel(name = "")
|
||||
private Integer hcgyld;
|
||||
|
||||
/** */
|
||||
@Excel(name = "")
|
||||
private Integer lysylgyj;
|
||||
|
||||
/** $column.columnComment */
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private Integer lysyldyj;
|
||||
|
||||
/** */
|
||||
@Excel(name = "")
|
||||
private Integer hswdcgyj;
|
||||
|
||||
/** */
|
||||
@Excel(name = "")
|
||||
private Integer hswdgyj;
|
||||
|
||||
/** */
|
||||
@Excel(name = "")
|
||||
private Integer gswdcgtz;
|
||||
|
||||
/** */
|
||||
@Excel(name = "")
|
||||
private Integer gswdgyj;
|
||||
|
||||
/** */
|
||||
@Excel(name = "")
|
||||
private Integer gswddyj;
|
||||
|
||||
/** */
|
||||
@Excel(name = "")
|
||||
private Integer ddf2gz;
|
||||
|
||||
/** */
|
||||
@Excel(name = "")
|
||||
private Integer ddf1gz;
|
||||
|
||||
/** */
|
||||
@Excel(name = "")
|
||||
private Integer lyswdbsqyJ;
|
||||
|
||||
/** */
|
||||
@Excel(name = "")
|
||||
private Integer hsylbsqyJ;
|
||||
|
||||
/** */
|
||||
@Excel(name = "")
|
||||
private Integer gsylbsqyJ;
|
||||
|
||||
/** */
|
||||
@Excel(name = "")
|
||||
private Integer hswdbsqyJ;
|
||||
|
||||
/** */
|
||||
@Excel(name = "")
|
||||
private Integer gswdbsqgztz;
|
||||
|
||||
/** */
|
||||
@Excel(name = "")
|
||||
private Integer lsjgz;
|
||||
|
||||
/** */
|
||||
@Excel(name = "")
|
||||
private Integer djrq2gz;
|
||||
|
||||
/** */
|
||||
@Excel(name = "")
|
||||
private Integer djrq1gz;
|
||||
|
||||
/** */
|
||||
@Excel(name = "")
|
||||
private Integer bqbgz;
|
||||
|
||||
/** */
|
||||
@Excel(name = "")
|
||||
private Integer bsbgz;
|
||||
|
||||
/** */
|
||||
@Excel(name = "")
|
||||
private Integer xhbgz;
|
||||
|
||||
/** */
|
||||
@Excel(name = "")
|
||||
private Integer zdygz;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setDataTimestamp(Date dataTimestamp)
|
||||
{
|
||||
this.dataTimestamp = dataTimestamp;
|
||||
}
|
||||
|
||||
public Date getDataTimestamp()
|
||||
{
|
||||
return dataTimestamp;
|
||||
}
|
||||
|
||||
public void setSiteId(String siteId)
|
||||
{
|
||||
this.siteId = siteId;
|
||||
}
|
||||
|
||||
public String getSiteId()
|
||||
{
|
||||
return siteId;
|
||||
}
|
||||
|
||||
public void setDeviceId(String deviceId)
|
||||
{
|
||||
this.deviceId = deviceId;
|
||||
}
|
||||
|
||||
public String getDeviceId()
|
||||
{
|
||||
return deviceId;
|
||||
}
|
||||
|
||||
public void setLsjyx(Integer lsjyx)
|
||||
{
|
||||
this.lsjyx = lsjyx;
|
||||
}
|
||||
|
||||
public Integer getLsjyx()
|
||||
{
|
||||
return lsjyx;
|
||||
}
|
||||
|
||||
public void setPqdcfyx(Integer pqdcfyx)
|
||||
{
|
||||
this.pqdcfyx = pqdcfyx;
|
||||
}
|
||||
|
||||
public Integer getPqdcfyx()
|
||||
{
|
||||
return pqdcfyx;
|
||||
}
|
||||
|
||||
public void setDjrq2yx(Integer djrq2yx)
|
||||
{
|
||||
this.djrq2yx = djrq2yx;
|
||||
}
|
||||
|
||||
public Integer getDjrq2yx()
|
||||
{
|
||||
return djrq2yx;
|
||||
}
|
||||
|
||||
public void setDjrq1yx(Integer djrq1yx)
|
||||
{
|
||||
this.djrq1yx = djrq1yx;
|
||||
}
|
||||
|
||||
public Integer getDjrq1yx()
|
||||
{
|
||||
return djrq1yx;
|
||||
}
|
||||
|
||||
public void setBqbyx(Integer bqbyx)
|
||||
{
|
||||
this.bqbyx = bqbyx;
|
||||
}
|
||||
|
||||
public Integer getBqbyx()
|
||||
{
|
||||
return bqbyx;
|
||||
}
|
||||
|
||||
public void setBsbyx(Integer bsbyx)
|
||||
{
|
||||
this.bsbyx = bsbyx;
|
||||
}
|
||||
|
||||
public Integer getBsbyx()
|
||||
{
|
||||
return bsbyx;
|
||||
}
|
||||
|
||||
public void setZxhbyx(Integer zxhbyx)
|
||||
{
|
||||
this.zxhbyx = zxhbyx;
|
||||
}
|
||||
|
||||
public Integer getZxhbyx()
|
||||
{
|
||||
return zxhbyx;
|
||||
}
|
||||
|
||||
public void setSltzgz(Integer sltzgz)
|
||||
{
|
||||
this.sltzgz = sltzgz;
|
||||
}
|
||||
|
||||
public Integer getSltzgz()
|
||||
{
|
||||
return sltzgz;
|
||||
}
|
||||
|
||||
public void setSlzhyj(Integer slzhyj)
|
||||
{
|
||||
this.slzhyj = slzhyj;
|
||||
}
|
||||
|
||||
public Integer getSlzhyj()
|
||||
{
|
||||
return slzhyj;
|
||||
}
|
||||
|
||||
public void setSlxtyctzxh(Integer slxtyctzxh)
|
||||
{
|
||||
this.slxtyctzxh = slxtyctzxh;
|
||||
}
|
||||
|
||||
public Integer getSlxtyctzxh()
|
||||
{
|
||||
return slxtyctzxh;
|
||||
}
|
||||
|
||||
public void setSlxtycqdxh(Integer slxtycqdxh)
|
||||
{
|
||||
this.slxtycqdxh = slxtycqdxh;
|
||||
}
|
||||
|
||||
public Integer getSlxtycqdxh()
|
||||
{
|
||||
return slxtycqdxh;
|
||||
}
|
||||
|
||||
public void setSlxtyckz(Integer slxtyckz)
|
||||
{
|
||||
this.slxtyckz = slxtyckz;
|
||||
}
|
||||
|
||||
public Integer getSlxtyckz()
|
||||
{
|
||||
return slxtyckz;
|
||||
}
|
||||
|
||||
public void setSlxtbdkz(Integer slxtbdkz)
|
||||
{
|
||||
this.slxtbdkz = slxtbdkz;
|
||||
}
|
||||
|
||||
public Integer getSlxtbdkz()
|
||||
{
|
||||
return slxtbdkz;
|
||||
}
|
||||
|
||||
public void setSlxtzdms(Integer slxtzdms)
|
||||
{
|
||||
this.slxtzdms = slxtzdms;
|
||||
}
|
||||
|
||||
public Integer getSlxtzdms()
|
||||
{
|
||||
return slxtzdms;
|
||||
}
|
||||
|
||||
public void setSlxtsdms(Integer slxtsdms)
|
||||
{
|
||||
this.slxtsdms = slxtsdms;
|
||||
}
|
||||
|
||||
public Integer getSlxtsdms()
|
||||
{
|
||||
return slxtsdms;
|
||||
}
|
||||
|
||||
public void setHsylcdyj(Integer hsylcdyj)
|
||||
{
|
||||
this.hsylcdyj = hsylcdyj;
|
||||
}
|
||||
|
||||
public Integer getHsylcdyj()
|
||||
{
|
||||
return hsylcdyj;
|
||||
}
|
||||
|
||||
public void setHsyldyj(Integer hsyldyj)
|
||||
{
|
||||
this.hsyldyj = hsyldyj;
|
||||
}
|
||||
|
||||
public Integer getHsyldyj()
|
||||
{
|
||||
return hsyldyj;
|
||||
}
|
||||
|
||||
public void setGsylcgyj(Integer gsylcgyj)
|
||||
{
|
||||
this.gsylcgyj = gsylcgyj;
|
||||
}
|
||||
|
||||
public Integer getGsylcgyj()
|
||||
{
|
||||
return gsylcgyj;
|
||||
}
|
||||
|
||||
public void setGsylgyj(Integer gsylgyj)
|
||||
{
|
||||
this.gsylgyj = gsylgyj;
|
||||
}
|
||||
|
||||
public Integer getGsylgyj()
|
||||
{
|
||||
return gsylgyj;
|
||||
}
|
||||
|
||||
public void setGsylcdyj(Integer gsylcdyj)
|
||||
{
|
||||
this.gsylcdyj = gsylcdyj;
|
||||
}
|
||||
|
||||
public Integer getGsylcdyj()
|
||||
{
|
||||
return gsylcdyj;
|
||||
}
|
||||
|
||||
public void setGsyldyj(Integer gsyldyj)
|
||||
{
|
||||
this.gsyldyj = gsyldyj;
|
||||
}
|
||||
|
||||
public Integer getGsyldyj()
|
||||
{
|
||||
return gsyldyj;
|
||||
}
|
||||
|
||||
public void setHcgywg(Integer hcgywg)
|
||||
{
|
||||
this.hcgywg = hcgywg;
|
||||
}
|
||||
|
||||
public Integer getHcgywg()
|
||||
{
|
||||
return hcgywg;
|
||||
}
|
||||
|
||||
public void setHcgywcdtz(Integer hcgywcdtz)
|
||||
{
|
||||
this.hcgywcdtz = hcgywcdtz;
|
||||
}
|
||||
|
||||
public Integer getHcgywcdtz()
|
||||
{
|
||||
return hcgywcdtz;
|
||||
}
|
||||
|
||||
public void setHcgywd(Integer hcgywd)
|
||||
{
|
||||
this.hcgywd = hcgywd;
|
||||
}
|
||||
|
||||
public Integer getHcgywd()
|
||||
{
|
||||
return hcgywd;
|
||||
}
|
||||
|
||||
public void setHcgylg(Integer hcgylg)
|
||||
{
|
||||
this.hcgylg = hcgylg;
|
||||
}
|
||||
|
||||
public Integer getHcgylg()
|
||||
{
|
||||
return hcgylg;
|
||||
}
|
||||
|
||||
public void setHcgyld(Integer hcgyld)
|
||||
{
|
||||
this.hcgyld = hcgyld;
|
||||
}
|
||||
|
||||
public Integer getHcgyld()
|
||||
{
|
||||
return hcgyld;
|
||||
}
|
||||
|
||||
public void setLysylgyj(Integer lysylgyj)
|
||||
{
|
||||
this.lysylgyj = lysylgyj;
|
||||
}
|
||||
|
||||
public Integer getLysylgyj()
|
||||
{
|
||||
return lysylgyj;
|
||||
}
|
||||
|
||||
public void setLysyldyj(Integer lysyldyj)
|
||||
{
|
||||
this.lysyldyj = lysyldyj;
|
||||
}
|
||||
|
||||
public Integer getLysyldyj()
|
||||
{
|
||||
return lysyldyj;
|
||||
}
|
||||
|
||||
public void setHswdcgyj(Integer hswdcgyj)
|
||||
{
|
||||
this.hswdcgyj = hswdcgyj;
|
||||
}
|
||||
|
||||
public Integer getHswdcgyj()
|
||||
{
|
||||
return hswdcgyj;
|
||||
}
|
||||
|
||||
public void setHswdgyj(Integer hswdgyj)
|
||||
{
|
||||
this.hswdgyj = hswdgyj;
|
||||
}
|
||||
|
||||
public Integer getHswdgyj()
|
||||
{
|
||||
return hswdgyj;
|
||||
}
|
||||
|
||||
public void setGswdcgtz(Integer gswdcgtz)
|
||||
{
|
||||
this.gswdcgtz = gswdcgtz;
|
||||
}
|
||||
|
||||
public Integer getGswdcgtz()
|
||||
{
|
||||
return gswdcgtz;
|
||||
}
|
||||
|
||||
public void setGswdgyj(Integer gswdgyj)
|
||||
{
|
||||
this.gswdgyj = gswdgyj;
|
||||
}
|
||||
|
||||
public Integer getGswdgyj()
|
||||
{
|
||||
return gswdgyj;
|
||||
}
|
||||
|
||||
public void setGswddyj(Integer gswddyj)
|
||||
{
|
||||
this.gswddyj = gswddyj;
|
||||
}
|
||||
|
||||
public Integer getGswddyj()
|
||||
{
|
||||
return gswddyj;
|
||||
}
|
||||
|
||||
public void setDdf2gz(Integer ddf2gz)
|
||||
{
|
||||
this.ddf2gz = ddf2gz;
|
||||
}
|
||||
|
||||
public Integer getDdf2gz()
|
||||
{
|
||||
return ddf2gz;
|
||||
}
|
||||
|
||||
public void setDdf1gz(Integer ddf1gz)
|
||||
{
|
||||
this.ddf1gz = ddf1gz;
|
||||
}
|
||||
|
||||
public Integer getDdf1gz()
|
||||
{
|
||||
return ddf1gz;
|
||||
}
|
||||
|
||||
public void setLyswdbsqyJ(Integer lyswdbsqyJ)
|
||||
{
|
||||
this.lyswdbsqyJ = lyswdbsqyJ;
|
||||
}
|
||||
|
||||
public Integer getLyswdbsqyJ()
|
||||
{
|
||||
return lyswdbsqyJ;
|
||||
}
|
||||
|
||||
public void setHsylbsqyJ(Integer hsylbsqyJ)
|
||||
{
|
||||
this.hsylbsqyJ = hsylbsqyJ;
|
||||
}
|
||||
|
||||
public Integer getHsylbsqyJ()
|
||||
{
|
||||
return hsylbsqyJ;
|
||||
}
|
||||
|
||||
public void setGsylbsqyJ(Integer gsylbsqyJ)
|
||||
{
|
||||
this.gsylbsqyJ = gsylbsqyJ;
|
||||
}
|
||||
|
||||
public Integer getGsylbsqyJ()
|
||||
{
|
||||
return gsylbsqyJ;
|
||||
}
|
||||
|
||||
public void setHswdbsqyJ(Integer hswdbsqyJ)
|
||||
{
|
||||
this.hswdbsqyJ = hswdbsqyJ;
|
||||
}
|
||||
|
||||
public Integer getHswdbsqyJ()
|
||||
{
|
||||
return hswdbsqyJ;
|
||||
}
|
||||
|
||||
public void setGswdbsqgztz(Integer gswdbsqgztz)
|
||||
{
|
||||
this.gswdbsqgztz = gswdbsqgztz;
|
||||
}
|
||||
|
||||
public Integer getGswdbsqgztz()
|
||||
{
|
||||
return gswdbsqgztz;
|
||||
}
|
||||
|
||||
public void setLsjgz(Integer lsjgz)
|
||||
{
|
||||
this.lsjgz = lsjgz;
|
||||
}
|
||||
|
||||
public Integer getLsjgz()
|
||||
{
|
||||
return lsjgz;
|
||||
}
|
||||
|
||||
public void setDjrq2gz(Integer djrq2gz)
|
||||
{
|
||||
this.djrq2gz = djrq2gz;
|
||||
}
|
||||
|
||||
public Integer getDjrq2gz()
|
||||
{
|
||||
return djrq2gz;
|
||||
}
|
||||
|
||||
public void setDjrq1gz(Integer djrq1gz)
|
||||
{
|
||||
this.djrq1gz = djrq1gz;
|
||||
}
|
||||
|
||||
public Integer getDjrq1gz()
|
||||
{
|
||||
return djrq1gz;
|
||||
}
|
||||
|
||||
public void setBqbgz(Integer bqbgz)
|
||||
{
|
||||
this.bqbgz = bqbgz;
|
||||
}
|
||||
|
||||
public Integer getBqbgz()
|
||||
{
|
||||
return bqbgz;
|
||||
}
|
||||
|
||||
public void setBsbgz(Integer bsbgz)
|
||||
{
|
||||
this.bsbgz = bsbgz;
|
||||
}
|
||||
|
||||
public Integer getBsbgz()
|
||||
{
|
||||
return bsbgz;
|
||||
}
|
||||
|
||||
public void setXhbgz(Integer xhbgz)
|
||||
{
|
||||
this.xhbgz = xhbgz;
|
||||
}
|
||||
|
||||
public Integer getXhbgz()
|
||||
{
|
||||
return xhbgz;
|
||||
}
|
||||
|
||||
public void setZdygz(Integer zdygz)
|
||||
{
|
||||
this.zdygz = zdygz;
|
||||
}
|
||||
|
||||
public Integer getZdygz()
|
||||
{
|
||||
return zdygz;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("dataTimestamp", getDataTimestamp())
|
||||
.append("siteId", getSiteId())
|
||||
.append("deviceId", getDeviceId())
|
||||
.append("lsjyx", getLsjyx())
|
||||
.append("pqdcfyx", getPqdcfyx())
|
||||
.append("djrq2yx", getDjrq2yx())
|
||||
.append("djrq1yx", getDjrq1yx())
|
||||
.append("bqbyx", getBqbyx())
|
||||
.append("bsbyx", getBsbyx())
|
||||
.append("zxhbyx", getZxhbyx())
|
||||
.append("sltzgz", getSltzgz())
|
||||
.append("slzhyj", getSlzhyj())
|
||||
.append("slxtyctzxh", getSlxtyctzxh())
|
||||
.append("slxtycqdxh", getSlxtycqdxh())
|
||||
.append("slxtyckz", getSlxtyckz())
|
||||
.append("slxtbdkz", getSlxtbdkz())
|
||||
.append("slxtzdms", getSlxtzdms())
|
||||
.append("slxtsdms", getSlxtsdms())
|
||||
.append("hsylcdyj", getHsylcdyj())
|
||||
.append("hsyldyj", getHsyldyj())
|
||||
.append("gsylcgyj", getGsylcgyj())
|
||||
.append("gsylgyj", getGsylgyj())
|
||||
.append("gsylcdyj", getGsylcdyj())
|
||||
.append("gsyldyj", getGsyldyj())
|
||||
.append("hcgywg", getHcgywg())
|
||||
.append("hcgywcdtz", getHcgywcdtz())
|
||||
.append("hcgywd", getHcgywd())
|
||||
.append("hcgylg", getHcgylg())
|
||||
.append("hcgyld", getHcgyld())
|
||||
.append("lysylgyj", getLysylgyj())
|
||||
.append("lysyldyj", getLysyldyj())
|
||||
.append("hswdcgyj", getHswdcgyj())
|
||||
.append("hswdgyj", getHswdgyj())
|
||||
.append("gswdcgtz", getGswdcgtz())
|
||||
.append("gswdgyj", getGswdgyj())
|
||||
.append("gswddyj", getGswddyj())
|
||||
.append("ddf2gz", getDdf2gz())
|
||||
.append("ddf1gz", getDdf1gz())
|
||||
.append("lyswdbsqyJ", getLyswdbsqyJ())
|
||||
.append("hsylbsqyJ", getHsylbsqyJ())
|
||||
.append("gsylbsqyJ", getGsylbsqyJ())
|
||||
.append("hswdbsqyJ", getHswdbsqyJ())
|
||||
.append("gswdbsqgztz", getGswdbsqgztz())
|
||||
.append("lsjgz", getLsjgz())
|
||||
.append("djrq2gz", getDjrq2gz())
|
||||
.append("djrq1gz", getDjrq1gz())
|
||||
.append("bqbgz", getBqbgz())
|
||||
.append("bsbgz", getBsbgz())
|
||||
.append("xhbgz", getXhbgz())
|
||||
.append("zdygz", getZdygz())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@ -1,7 +1,9 @@
|
||||
package com.xzzn.ems.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.xzzn.common.core.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
@ -11,7 +13,7 @@ import com.xzzn.common.annotation.Excel;
|
||||
* 冷却系统参数对象 ems_cooling_data
|
||||
*
|
||||
* @author xzzn
|
||||
* @date 2025-06-29
|
||||
* @date 2025-09-26
|
||||
*/
|
||||
public class EmsCoolingData extends BaseEntity
|
||||
{
|
||||
@ -20,12 +22,17 @@ public class EmsCoolingData extends BaseEntity
|
||||
/** */
|
||||
private Long id;
|
||||
|
||||
/** 数据更新时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "数据更新时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date dataUpdateTime;
|
||||
|
||||
/** 系统名称,如1#液冷 */
|
||||
@Excel(name = "系统名称,如1#液冷")
|
||||
private String systemName;
|
||||
|
||||
/** 工作模式 */
|
||||
@Excel(name = "工作模式")
|
||||
/** 工作模式:0-正常 1-停止 */
|
||||
@Excel(name = "工作模式:0-正常 1-停止")
|
||||
private String workMode;
|
||||
|
||||
/** 当前温度 (℃) */
|
||||
@ -56,6 +63,34 @@ public class EmsCoolingData extends BaseEntity
|
||||
@Excel(name = "低温告警点 (℃)")
|
||||
private BigDecimal lowTempAlarmPoint;
|
||||
|
||||
/** 供水温度 */
|
||||
@Excel(name = "供水温度")
|
||||
private BigDecimal gsTemp;
|
||||
|
||||
/** 回水温度 */
|
||||
@Excel(name = "回水温度")
|
||||
private BigDecimal hsTemp;
|
||||
|
||||
/** 供水压力 */
|
||||
@Excel(name = "供水压力")
|
||||
private BigDecimal gsPressure;
|
||||
|
||||
/** 回水压力 */
|
||||
@Excel(name = "回水压力")
|
||||
private BigDecimal hsPressure;
|
||||
|
||||
/** 冷源水温度 */
|
||||
@Excel(name = "冷源水温度")
|
||||
private BigDecimal lysTemp;
|
||||
|
||||
/** VB01开度 */
|
||||
@Excel(name = "VB01开度")
|
||||
private BigDecimal vb01Kd;
|
||||
|
||||
/** VB02开度 */
|
||||
@Excel(name = "VB02开度")
|
||||
private BigDecimal vb02Kd;
|
||||
|
||||
/** 站点id */
|
||||
@Excel(name = "站点id")
|
||||
private String siteId;
|
||||
@ -74,6 +109,14 @@ public class EmsCoolingData extends BaseEntity
|
||||
return id;
|
||||
}
|
||||
|
||||
public Date getDataUpdateTime() {
|
||||
return dataUpdateTime;
|
||||
}
|
||||
|
||||
public void setDataUpdateTime(Date dataUpdateTime) {
|
||||
this.dataUpdateTime = dataUpdateTime;
|
||||
}
|
||||
|
||||
public void setSystemName(String systemName)
|
||||
{
|
||||
this.systemName = systemName;
|
||||
@ -164,6 +207,76 @@ public class EmsCoolingData extends BaseEntity
|
||||
return lowTempAlarmPoint;
|
||||
}
|
||||
|
||||
public void setGsTemp(BigDecimal gsTemp)
|
||||
{
|
||||
this.gsTemp = gsTemp;
|
||||
}
|
||||
|
||||
public BigDecimal getGsTemp()
|
||||
{
|
||||
return gsTemp;
|
||||
}
|
||||
|
||||
public void setHsTemp(BigDecimal hsTemp)
|
||||
{
|
||||
this.hsTemp = hsTemp;
|
||||
}
|
||||
|
||||
public BigDecimal getHsTemp()
|
||||
{
|
||||
return hsTemp;
|
||||
}
|
||||
|
||||
public void setGsPressure(BigDecimal gsPressure)
|
||||
{
|
||||
this.gsPressure = gsPressure;
|
||||
}
|
||||
|
||||
public BigDecimal getGsPressure()
|
||||
{
|
||||
return gsPressure;
|
||||
}
|
||||
|
||||
public void setHsPressure(BigDecimal hsPressure)
|
||||
{
|
||||
this.hsPressure = hsPressure;
|
||||
}
|
||||
|
||||
public BigDecimal getHsPressure()
|
||||
{
|
||||
return hsPressure;
|
||||
}
|
||||
|
||||
public void setLysTemp(BigDecimal lysTemp)
|
||||
{
|
||||
this.lysTemp = lysTemp;
|
||||
}
|
||||
|
||||
public BigDecimal getLysTemp()
|
||||
{
|
||||
return lysTemp;
|
||||
}
|
||||
|
||||
public void setVb01Kd(BigDecimal vb01Kd)
|
||||
{
|
||||
this.vb01Kd = vb01Kd;
|
||||
}
|
||||
|
||||
public BigDecimal getVb01Kd()
|
||||
{
|
||||
return vb01Kd;
|
||||
}
|
||||
|
||||
public void setVb02Kd(BigDecimal vb02Kd)
|
||||
{
|
||||
this.vb02Kd = vb02Kd;
|
||||
}
|
||||
|
||||
public BigDecimal getVb02Kd()
|
||||
{
|
||||
return vb02Kd;
|
||||
}
|
||||
|
||||
public void setSiteId(String siteId)
|
||||
{
|
||||
this.siteId = siteId;
|
||||
@ -197,6 +310,13 @@ public class EmsCoolingData extends BaseEntity
|
||||
.append("heatingStopPoint", getHeatingStopPoint())
|
||||
.append("coolingStopPoint", getCoolingStopPoint())
|
||||
.append("lowTempAlarmPoint", getLowTempAlarmPoint())
|
||||
.append("gsTemp", getGsTemp())
|
||||
.append("hsTemp", getHsTemp())
|
||||
.append("gsPressure", getGsPressure())
|
||||
.append("hsPressure", getHsPressure())
|
||||
.append("lysTemp", getLysTemp())
|
||||
.append("vb01Kd", getVb01Kd())
|
||||
.append("vb02Kd", getVb02Kd())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
|
||||
@ -0,0 +1,151 @@
|
||||
package com.xzzn.ems.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.xzzn.common.core.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.xzzn.common.annotation.Excel;
|
||||
|
||||
/**
|
||||
* 站点每日充放电数据对象 ems_daily_charge_data
|
||||
*
|
||||
* @author xzzn
|
||||
* @date 2025-08-27
|
||||
*/
|
||||
public class EmsDailyChargeData extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** $column.columnComment */
|
||||
private Long id;
|
||||
|
||||
/** 站点id */
|
||||
@Excel(name = "站点id")
|
||||
private String siteId;
|
||||
|
||||
/** 设备唯一标识符 */
|
||||
@Excel(name = "设备唯一标识符")
|
||||
private String deviceId;
|
||||
|
||||
/** 数据日期:yyyy-MM-dd */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "数据日期:yyyy-MM-dd", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date dateTime;
|
||||
|
||||
/** 总充电量 */
|
||||
@Excel(name = "总充电量")
|
||||
private BigDecimal totalChargeData;
|
||||
|
||||
/** 总放电量 */
|
||||
@Excel(name = "总放电量")
|
||||
private BigDecimal totalDischargeData;
|
||||
|
||||
/** 当日充电量 */
|
||||
@Excel(name = "当日充电量")
|
||||
private BigDecimal chargeData;
|
||||
|
||||
/** 当日放电量 */
|
||||
@Excel(name = "当日放电量")
|
||||
private BigDecimal dischargeData;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setSiteId(String siteId)
|
||||
{
|
||||
this.siteId = siteId;
|
||||
}
|
||||
|
||||
public String getSiteId()
|
||||
{
|
||||
return siteId;
|
||||
}
|
||||
|
||||
public void setDeviceId(String deviceId)
|
||||
{
|
||||
this.deviceId = deviceId;
|
||||
}
|
||||
|
||||
public String getDeviceId()
|
||||
{
|
||||
return deviceId;
|
||||
}
|
||||
|
||||
public void setDateTime(Date dateTime)
|
||||
{
|
||||
this.dateTime = dateTime;
|
||||
}
|
||||
|
||||
public Date getDateTime()
|
||||
{
|
||||
return dateTime;
|
||||
}
|
||||
|
||||
public void setTotalChargeData(BigDecimal totalChargeData)
|
||||
{
|
||||
this.totalChargeData = totalChargeData;
|
||||
}
|
||||
|
||||
public BigDecimal getTotalChargeData()
|
||||
{
|
||||
return totalChargeData;
|
||||
}
|
||||
|
||||
public void setTotalDischargeData(BigDecimal totalDischargeData)
|
||||
{
|
||||
this.totalDischargeData = totalDischargeData;
|
||||
}
|
||||
|
||||
public BigDecimal getTotalDischargeData()
|
||||
{
|
||||
return totalDischargeData;
|
||||
}
|
||||
|
||||
public void setChargeData(BigDecimal chargeData)
|
||||
{
|
||||
this.chargeData = chargeData;
|
||||
}
|
||||
|
||||
public BigDecimal getChargeData()
|
||||
{
|
||||
return chargeData;
|
||||
}
|
||||
|
||||
public void setDischargeData(BigDecimal dischargeData)
|
||||
{
|
||||
this.dischargeData = dischargeData;
|
||||
}
|
||||
|
||||
public BigDecimal getDischargeData()
|
||||
{
|
||||
return dischargeData;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("siteId", getSiteId())
|
||||
.append("deviceId", getDeviceId())
|
||||
.append("dateTime", getDateTime())
|
||||
.append("totalChargeData", getTotalChargeData())
|
||||
.append("totalDischargeData", getTotalDischargeData())
|
||||
.append("chargeData", getChargeData())
|
||||
.append("dischargeData", getDischargeData())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,241 @@
|
||||
package com.xzzn.ems.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.xzzn.common.core.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.xzzn.common.annotation.Excel;
|
||||
|
||||
/**
|
||||
* 站点电每日数据对象 ems_daily_energy_data
|
||||
*
|
||||
* @author xzzn
|
||||
* @date 2025-10-09
|
||||
*/
|
||||
public class EmsDailyEnergyData extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** */
|
||||
private Long id;
|
||||
|
||||
/** 站点id */
|
||||
@Excel(name = "站点id")
|
||||
private String siteId;
|
||||
|
||||
/** 数据日期:yyyy-MM-dd */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "数据日期:yyyy-MM-dd", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date dataDate;
|
||||
|
||||
/** 总收入 */
|
||||
@Excel(name = "总收入")
|
||||
private BigDecimal totalRevenue;
|
||||
|
||||
/** 当日实时收入 */
|
||||
@Excel(name = "当日实时收入")
|
||||
private BigDecimal dayRevenue;
|
||||
|
||||
/** 尖峰时段充电差值 */
|
||||
@Excel(name = "尖峰时段充电差值")
|
||||
private BigDecimal peakChargeDiff;
|
||||
|
||||
/** 尖峰时段放电差值 */
|
||||
@Excel(name = "尖峰时段放电差值")
|
||||
private BigDecimal peakDischargeDiff;
|
||||
|
||||
/** 峰时时段充电差值 */
|
||||
@Excel(name = "峰时时段充电差值")
|
||||
private BigDecimal highChargeDiff;
|
||||
|
||||
/** 峰时时段放电差值 */
|
||||
@Excel(name = "峰时时段放电差值")
|
||||
private BigDecimal highDischargeDiff;
|
||||
|
||||
/** 平时时段充电差值 */
|
||||
@Excel(name = "平时时段充电差值")
|
||||
private BigDecimal flatChargeDiff;
|
||||
|
||||
/** 平时时段放电差值 */
|
||||
@Excel(name = "平时时段放电差值")
|
||||
private BigDecimal flatDischargeDiff;
|
||||
|
||||
/** 谷时时段充电差值 */
|
||||
@Excel(name = "谷时时段充电差值")
|
||||
private BigDecimal valleyChargeDiff;
|
||||
|
||||
/** 谷时时段放电差值 */
|
||||
@Excel(name = "谷时时段放电差值")
|
||||
private BigDecimal valleyDischargeDiff;
|
||||
|
||||
/** 差值计算时间(如2025-10-10 23:59:00) */
|
||||
@Excel(name = "差值计算时间", readConverterExp = "如=2025-10-10,2=3:59:00")
|
||||
private Date calcTime;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setSiteId(String siteId)
|
||||
{
|
||||
this.siteId = siteId;
|
||||
}
|
||||
|
||||
public String getSiteId()
|
||||
{
|
||||
return siteId;
|
||||
}
|
||||
|
||||
public void setDataDate(Date dataDate)
|
||||
{
|
||||
this.dataDate = dataDate;
|
||||
}
|
||||
|
||||
public Date getDataDate()
|
||||
{
|
||||
return dataDate;
|
||||
}
|
||||
|
||||
public void setTotalRevenue(BigDecimal totalRevenue)
|
||||
{
|
||||
this.totalRevenue = totalRevenue;
|
||||
}
|
||||
|
||||
public BigDecimal getTotalRevenue()
|
||||
{
|
||||
return totalRevenue;
|
||||
}
|
||||
|
||||
public void setDayRevenue(BigDecimal dayRevenue)
|
||||
{
|
||||
this.dayRevenue = dayRevenue;
|
||||
}
|
||||
|
||||
public BigDecimal getDayRevenue()
|
||||
{
|
||||
return dayRevenue;
|
||||
}
|
||||
|
||||
public void setPeakChargeDiff(BigDecimal peakChargeDiff)
|
||||
{
|
||||
this.peakChargeDiff = peakChargeDiff;
|
||||
}
|
||||
|
||||
public BigDecimal getPeakChargeDiff()
|
||||
{
|
||||
return peakChargeDiff;
|
||||
}
|
||||
|
||||
public void setPeakDischargeDiff(BigDecimal peakDischargeDiff)
|
||||
{
|
||||
this.peakDischargeDiff = peakDischargeDiff;
|
||||
}
|
||||
|
||||
public BigDecimal getPeakDischargeDiff()
|
||||
{
|
||||
return peakDischargeDiff;
|
||||
}
|
||||
|
||||
public void setHighChargeDiff(BigDecimal highChargeDiff)
|
||||
{
|
||||
this.highChargeDiff = highChargeDiff;
|
||||
}
|
||||
|
||||
public BigDecimal getHighChargeDiff()
|
||||
{
|
||||
return highChargeDiff;
|
||||
}
|
||||
|
||||
public void setHighDischargeDiff(BigDecimal highDischargeDiff)
|
||||
{
|
||||
this.highDischargeDiff = highDischargeDiff;
|
||||
}
|
||||
|
||||
public BigDecimal getHighDischargeDiff()
|
||||
{
|
||||
return highDischargeDiff;
|
||||
}
|
||||
|
||||
public void setFlatChargeDiff(BigDecimal flatChargeDiff)
|
||||
{
|
||||
this.flatChargeDiff = flatChargeDiff;
|
||||
}
|
||||
|
||||
public BigDecimal getFlatChargeDiff()
|
||||
{
|
||||
return flatChargeDiff;
|
||||
}
|
||||
|
||||
public void setFlatDischargeDiff(BigDecimal flatDischargeDiff)
|
||||
{
|
||||
this.flatDischargeDiff = flatDischargeDiff;
|
||||
}
|
||||
|
||||
public BigDecimal getFlatDischargeDiff()
|
||||
{
|
||||
return flatDischargeDiff;
|
||||
}
|
||||
|
||||
public void setValleyChargeDiff(BigDecimal valleyChargeDiff)
|
||||
{
|
||||
this.valleyChargeDiff = valleyChargeDiff;
|
||||
}
|
||||
|
||||
public BigDecimal getValleyChargeDiff()
|
||||
{
|
||||
return valleyChargeDiff;
|
||||
}
|
||||
|
||||
public void setValleyDischargeDiff(BigDecimal valleyDischargeDiff)
|
||||
{
|
||||
this.valleyDischargeDiff = valleyDischargeDiff;
|
||||
}
|
||||
|
||||
public BigDecimal getValleyDischargeDiff()
|
||||
{
|
||||
return valleyDischargeDiff;
|
||||
}
|
||||
|
||||
public void setCalcTime(Date calcTime)
|
||||
{
|
||||
this.calcTime = calcTime;
|
||||
}
|
||||
|
||||
public Date getCalcTime()
|
||||
{
|
||||
return calcTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("siteId", getSiteId())
|
||||
.append("dataDate", getDataDate())
|
||||
.append("totalRevenue", getTotalRevenue())
|
||||
.append("dayRevenue", getDayRevenue())
|
||||
.append("peakChargeDiff", getPeakChargeDiff())
|
||||
.append("peakDischargeDiff", getPeakDischargeDiff())
|
||||
.append("highChargeDiff", getHighChargeDiff())
|
||||
.append("highDischargeDiff", getHighDischargeDiff())
|
||||
.append("flatChargeDiff", getFlatChargeDiff())
|
||||
.append("flatDischargeDiff", getFlatDischargeDiff())
|
||||
.append("valleyChargeDiff", getValleyChargeDiff())
|
||||
.append("valleyDischargeDiff", getValleyDischargeDiff())
|
||||
.append("calcTime", getCalcTime())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,134 @@
|
||||
package com.xzzn.ems.domain;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.xzzn.common.core.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.xzzn.common.annotation.Excel;
|
||||
|
||||
/**
|
||||
* 设备状态变更记录对象 ems_device_change_log
|
||||
*
|
||||
* @author xzzn
|
||||
* @date 2025-11-15
|
||||
*/
|
||||
public class EmsDeviceChangeLog extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** $column.columnComment */
|
||||
private Long id;
|
||||
|
||||
/** 日志ID(UUID) */
|
||||
@Excel(name = "日志ID", readConverterExp = "U=UID")
|
||||
private String logId;
|
||||
|
||||
/** 日志时间(精确到秒) */
|
||||
@Excel(name = "日志时间", readConverterExp = "精=确到秒")
|
||||
private Date logTime;
|
||||
|
||||
/** 站点id */
|
||||
@Excel(name = "站点id")
|
||||
private String siteId;
|
||||
|
||||
/** 设备id */
|
||||
@Excel(name = "设备id")
|
||||
private String deviceId;
|
||||
|
||||
/** 变更前状态:0-离线、1-待机、2-运行、3-故障、4-停机 */
|
||||
@Excel(name = "变更前状态:0-离线、1-待机、2-运行、3-故障、4-停机")
|
||||
private String beforeStatus;
|
||||
|
||||
/** 变更后状态:0-离线、1-待机、2-运行、3-故障、4-停机 */
|
||||
@Excel(name = "变更后状态:0-离线、1-待机、2-运行、3-故障、4-停机")
|
||||
private String afterStatus;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setLogId(String logId)
|
||||
{
|
||||
this.logId = logId;
|
||||
}
|
||||
|
||||
public String getLogId()
|
||||
{
|
||||
return logId;
|
||||
}
|
||||
|
||||
public void setLogTime(Date logTime)
|
||||
{
|
||||
this.logTime = logTime;
|
||||
}
|
||||
|
||||
public Date getLogTime()
|
||||
{
|
||||
return logTime;
|
||||
}
|
||||
|
||||
public void setSiteId(String siteId)
|
||||
{
|
||||
this.siteId = siteId;
|
||||
}
|
||||
|
||||
public String getSiteId()
|
||||
{
|
||||
return siteId;
|
||||
}
|
||||
|
||||
public void setDeviceId(String deviceId)
|
||||
{
|
||||
this.deviceId = deviceId;
|
||||
}
|
||||
|
||||
public String getDeviceId()
|
||||
{
|
||||
return deviceId;
|
||||
}
|
||||
|
||||
public void setBeforeStatus(String beforeStatus)
|
||||
{
|
||||
this.beforeStatus = beforeStatus;
|
||||
}
|
||||
|
||||
public String getBeforeStatus()
|
||||
{
|
||||
return beforeStatus;
|
||||
}
|
||||
|
||||
public void setAfterStatus(String afterStatus)
|
||||
{
|
||||
this.afterStatus = afterStatus;
|
||||
}
|
||||
|
||||
public String getAfterStatus()
|
||||
{
|
||||
return afterStatus;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("logId", getLogId())
|
||||
.append("logTime", getLogTime())
|
||||
.append("siteId", getSiteId())
|
||||
.append("deviceId", getDeviceId())
|
||||
.append("beforeStatus", getBeforeStatus())
|
||||
.append("afterStatus", getAfterStatus())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@ -102,6 +102,10 @@ public class EmsDevicesSetting extends BaseEntity
|
||||
@Excel(name = "设备类别,例如“STACK/CLUSTER/PCS等”")
|
||||
private String deviceCategory;
|
||||
|
||||
/** 设备运行状态:0-离线、1-待机、2-运行、3-故障、4-停机 */
|
||||
@Excel(name = "设备运行状态:0-离线、1-待机、2-运行、3-故障、4-停机")
|
||||
private String deviceStatus;
|
||||
|
||||
/** 设备图像地址 */
|
||||
@Excel(name = "设备图像地址")
|
||||
private String pictureUrl;
|
||||
@ -316,6 +320,14 @@ public class EmsDevicesSetting extends BaseEntity
|
||||
return deviceCategory;
|
||||
}
|
||||
|
||||
public String getDeviceStatus() {
|
||||
return deviceStatus;
|
||||
}
|
||||
|
||||
public void setDeviceStatus(String deviceStatus) {
|
||||
this.deviceStatus = deviceStatus;
|
||||
}
|
||||
|
||||
public void setPictureUrl(String pictureUrl)
|
||||
{
|
||||
this.pictureUrl = pictureUrl;
|
||||
@ -350,6 +362,7 @@ public class EmsDevicesSetting extends BaseEntity
|
||||
.append("deviceId", getDeviceId())
|
||||
.append("parentId", getParentId())
|
||||
.append("deviceCategory", getDeviceCategory())
|
||||
.append("deviceStatus", getDeviceStatus())
|
||||
.append("pictureUrl", getPictureUrl())
|
||||
.toString();
|
||||
}
|
||||
|
||||
@ -1,7 +1,9 @@
|
||||
package com.xzzn.ems.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.xzzn.common.core.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
@ -20,6 +22,11 @@ public class EmsDhData extends BaseEntity
|
||||
/** $column.columnComment */
|
||||
private Long id;
|
||||
|
||||
/** 数据更新时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "数据更新时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date dataUpdateTime;
|
||||
|
||||
/** 湿度 */
|
||||
@Excel(name = "湿度")
|
||||
private BigDecimal humidity;
|
||||
@ -46,6 +53,14 @@ public class EmsDhData extends BaseEntity
|
||||
return id;
|
||||
}
|
||||
|
||||
public Date getDataUpdateTime() {
|
||||
return dataUpdateTime;
|
||||
}
|
||||
|
||||
public void setDataUpdateTime(Date dataUpdateTime) {
|
||||
this.dataUpdateTime = dataUpdateTime;
|
||||
}
|
||||
|
||||
public void setHumidity(BigDecimal humidity)
|
||||
{
|
||||
this.humidity = humidity;
|
||||
|
||||
241
ems-system/src/main/java/com/xzzn/ems/domain/EmsEmsData.java
Normal file
241
ems-system/src/main/java/com/xzzn/ems/domain/EmsEmsData.java
Normal file
@ -0,0 +1,241 @@
|
||||
package com.xzzn.ems.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.xzzn.common.annotation.Excel;
|
||||
import com.xzzn.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 数据对象 ems_ems_data
|
||||
*
|
||||
* @author xzzn
|
||||
* @date 2025-12-09
|
||||
*/
|
||||
public class EmsEmsData extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** $column.columnComment */
|
||||
private Long id;
|
||||
|
||||
/** 数据采集时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "数据采集时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date dataUpdateTime;
|
||||
|
||||
/** EMS控制模式 */
|
||||
@Excel(name = "EMS控制模式")
|
||||
private BigDecimal emsStatus;
|
||||
|
||||
/** BMS1SOC */
|
||||
@Excel(name = "BMS1SOC")
|
||||
private BigDecimal bms1Soc;
|
||||
|
||||
/** BMS2SOC */
|
||||
@Excel(name = "BMS2SOC")
|
||||
private BigDecimal bms2Soc;
|
||||
|
||||
/** BMS3SOC */
|
||||
@Excel(name = "BMS3SOC")
|
||||
private BigDecimal bms3Soc;
|
||||
|
||||
/** BMS4SOC */
|
||||
@Excel(name = "BMS4SOC")
|
||||
private BigDecimal bms4Soc;
|
||||
|
||||
/** PCS-1有功功率 */
|
||||
@Excel(name = "PCS-1有功功率")
|
||||
private BigDecimal pcs1Yggl;
|
||||
|
||||
/** PCS-2有功功率 */
|
||||
@Excel(name = "PCS-2有功功率")
|
||||
private BigDecimal pcs2Yggl;
|
||||
|
||||
/** PCS-3有功功率 */
|
||||
@Excel(name = "PCS-3有功功率")
|
||||
private BigDecimal pcs3Yggl;
|
||||
|
||||
/** PCS-4有功功率 */
|
||||
@Excel(name = "PCS-4有功功率")
|
||||
private BigDecimal pcs4Yggl;
|
||||
|
||||
/** EMS有功功率 */
|
||||
@Excel(name = "EMS有功功率")
|
||||
private BigDecimal emsYggl;
|
||||
|
||||
/** 站点id */
|
||||
@Excel(name = "站点id")
|
||||
private String siteId;
|
||||
|
||||
/** 设备唯一标识符 */
|
||||
@Excel(name = "设备唯一标识符")
|
||||
private String deviceId;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setDataUpdateTime(Date dataUpdateTime)
|
||||
{
|
||||
this.dataUpdateTime = dataUpdateTime;
|
||||
}
|
||||
|
||||
public Date getDataUpdateTime()
|
||||
{
|
||||
return dataUpdateTime;
|
||||
}
|
||||
|
||||
public void setEmsStatus(BigDecimal emsStatus)
|
||||
{
|
||||
this.emsStatus = emsStatus;
|
||||
}
|
||||
|
||||
public BigDecimal getEmsStatus()
|
||||
{
|
||||
return emsStatus;
|
||||
}
|
||||
|
||||
public void setBms1Soc(BigDecimal bms1Soc)
|
||||
{
|
||||
this.bms1Soc = bms1Soc;
|
||||
}
|
||||
|
||||
public BigDecimal getBms1Soc()
|
||||
{
|
||||
return bms1Soc;
|
||||
}
|
||||
|
||||
public void setBms2Soc(BigDecimal bms2Soc)
|
||||
{
|
||||
this.bms2Soc = bms2Soc;
|
||||
}
|
||||
|
||||
public BigDecimal getBms2Soc()
|
||||
{
|
||||
return bms2Soc;
|
||||
}
|
||||
|
||||
public void setBms3Soc(BigDecimal bms3Soc)
|
||||
{
|
||||
this.bms3Soc = bms3Soc;
|
||||
}
|
||||
|
||||
public BigDecimal getBms3Soc()
|
||||
{
|
||||
return bms3Soc;
|
||||
}
|
||||
|
||||
public void setBms4Soc(BigDecimal bms4Soc)
|
||||
{
|
||||
this.bms4Soc = bms4Soc;
|
||||
}
|
||||
|
||||
public BigDecimal getBms4Soc()
|
||||
{
|
||||
return bms4Soc;
|
||||
}
|
||||
|
||||
public void setPcs1Yggl(BigDecimal pcs1Yggl)
|
||||
{
|
||||
this.pcs1Yggl = pcs1Yggl;
|
||||
}
|
||||
|
||||
public BigDecimal getPcs1Yggl()
|
||||
{
|
||||
return pcs1Yggl;
|
||||
}
|
||||
|
||||
public void setPcs2Yggl(BigDecimal pcs2Yggl)
|
||||
{
|
||||
this.pcs2Yggl = pcs2Yggl;
|
||||
}
|
||||
|
||||
public BigDecimal getPcs2Yggl()
|
||||
{
|
||||
return pcs2Yggl;
|
||||
}
|
||||
|
||||
public void setPcs3Yggl(BigDecimal pcs3Yggl)
|
||||
{
|
||||
this.pcs3Yggl = pcs3Yggl;
|
||||
}
|
||||
|
||||
public BigDecimal getPcs3Yggl()
|
||||
{
|
||||
return pcs3Yggl;
|
||||
}
|
||||
|
||||
public void setPcs4Yggl(BigDecimal pcs4Yggl)
|
||||
{
|
||||
this.pcs4Yggl = pcs4Yggl;
|
||||
}
|
||||
|
||||
public BigDecimal getPcs4Yggl()
|
||||
{
|
||||
return pcs4Yggl;
|
||||
}
|
||||
|
||||
public void setEmsYggl(BigDecimal emsYggl)
|
||||
{
|
||||
this.emsYggl = emsYggl;
|
||||
}
|
||||
|
||||
public BigDecimal getEmsYggl()
|
||||
{
|
||||
return emsYggl;
|
||||
}
|
||||
|
||||
public void setSiteId(String siteId)
|
||||
{
|
||||
this.siteId = siteId;
|
||||
}
|
||||
|
||||
public String getSiteId()
|
||||
{
|
||||
return siteId;
|
||||
}
|
||||
|
||||
public void setDeviceId(String deviceId)
|
||||
{
|
||||
this.deviceId = deviceId;
|
||||
}
|
||||
|
||||
public String getDeviceId()
|
||||
{
|
||||
return deviceId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("dataUpdateTime", getDataUpdateTime())
|
||||
.append("emsStatus", getEmsStatus())
|
||||
.append("bms1Soc", getBms1Soc())
|
||||
.append("bms2Soc", getBms2Soc())
|
||||
.append("bms3Soc", getBms3Soc())
|
||||
.append("bms4Soc", getBms4Soc())
|
||||
.append("pcs1Yggl", getPcs1Yggl())
|
||||
.append("pcs2Yggl", getPcs2Yggl())
|
||||
.append("pcs3Yggl", getPcs3Yggl())
|
||||
.append("pcs4Yggl", getPcs4Yggl())
|
||||
.append("emsYggl", getEmsYggl())
|
||||
.append("siteId", getSiteId())
|
||||
.append("deviceId", getDeviceId())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,149 @@
|
||||
package com.xzzn.ems.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.xzzn.common.core.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.xzzn.common.annotation.Excel;
|
||||
|
||||
/**
|
||||
* 电价配置对象 ems_energy_price_config
|
||||
*
|
||||
* @author xzzn
|
||||
* @date 2025-10-09
|
||||
*/
|
||||
public class EmsEnergyPriceConfig extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** */
|
||||
private Long id;
|
||||
|
||||
/** 站点id */
|
||||
@Excel(name = "站点id")
|
||||
private String siteId;
|
||||
|
||||
/** 年份,如2025 */
|
||||
@Excel(name = "年份,如2025")
|
||||
private String year;
|
||||
|
||||
/** 月份,如"9"表示9月 */
|
||||
@Excel(name = "月份,如\"9\"表示9月")
|
||||
private String month;
|
||||
|
||||
/** 尖-peak电价(元/kWh) */
|
||||
@Excel(name = "尖-peak电价(元/kWh)")
|
||||
private BigDecimal peak;
|
||||
|
||||
/** 峰-high电价(元/kWh) */
|
||||
@Excel(name = "峰-high电价(元/kWh)")
|
||||
private BigDecimal high;
|
||||
|
||||
/** 平-flat电价(元/kWh) */
|
||||
@Excel(name = "平-flat电价(元/kWh)")
|
||||
private BigDecimal flat;
|
||||
|
||||
/** 谷-valley电价(元/kWh) */
|
||||
@Excel(name = "谷-valley电价(元/kWh)")
|
||||
private BigDecimal valley;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setSiteId(String siteId)
|
||||
{
|
||||
this.siteId = siteId;
|
||||
}
|
||||
|
||||
public String getSiteId()
|
||||
{
|
||||
return siteId;
|
||||
}
|
||||
|
||||
public void setYear(String year)
|
||||
{
|
||||
this.year = year;
|
||||
}
|
||||
|
||||
public String getYear()
|
||||
{
|
||||
return year;
|
||||
}
|
||||
|
||||
public void setMonth(String month)
|
||||
{
|
||||
this.month = month;
|
||||
}
|
||||
|
||||
public String getMonth()
|
||||
{
|
||||
return month;
|
||||
}
|
||||
|
||||
public void setPeak(BigDecimal peak)
|
||||
{
|
||||
this.peak = peak;
|
||||
}
|
||||
|
||||
public BigDecimal getPeak()
|
||||
{
|
||||
return peak;
|
||||
}
|
||||
|
||||
public void setHigh(BigDecimal high)
|
||||
{
|
||||
this.high = high;
|
||||
}
|
||||
|
||||
public BigDecimal getHigh()
|
||||
{
|
||||
return high;
|
||||
}
|
||||
|
||||
public void setFlat(BigDecimal flat)
|
||||
{
|
||||
this.flat = flat;
|
||||
}
|
||||
|
||||
public BigDecimal getFlat()
|
||||
{
|
||||
return flat;
|
||||
}
|
||||
|
||||
public void setValley(BigDecimal valley)
|
||||
{
|
||||
this.valley = valley;
|
||||
}
|
||||
|
||||
public BigDecimal getValley()
|
||||
{
|
||||
return valley;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("siteId", getSiteId())
|
||||
.append("year", getYear())
|
||||
.append("month", getMonth())
|
||||
.append("peak", getPeak())
|
||||
.append("high", getHigh())
|
||||
.append("flat", getFlat())
|
||||
.append("valley", getValley())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,150 @@
|
||||
package com.xzzn.ems.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import com.xzzn.common.core.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.xzzn.common.annotation.Excel;
|
||||
|
||||
/**
|
||||
* 告警保护方案下发日志对象 ems_fault_issue_log
|
||||
*
|
||||
* @author xzzn
|
||||
* @date 2025-11-15
|
||||
*/
|
||||
public class EmsFaultIssueLog extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
private Long id;
|
||||
|
||||
/** 日志ID(UUID) */
|
||||
@Excel(name = "日志ID", readConverterExp = "U=UID")
|
||||
private String logId;
|
||||
|
||||
/** 日志时间(精确到秒) */
|
||||
@Excel(name = "日志时间", readConverterExp = "精=确到秒")
|
||||
private Date logTime;
|
||||
|
||||
/** 日志等级(同方案等级1/2/3等) */
|
||||
@Excel(name = "日志等级", readConverterExp = "同=方案等级1/2/3等")
|
||||
private Integer logLevel;
|
||||
|
||||
/** 站点名称/编号 */
|
||||
@Excel(name = "站点名称/编号")
|
||||
private String siteId;
|
||||
|
||||
/** 设备ID */
|
||||
@Excel(name = "设备ID")
|
||||
private String deviceId;
|
||||
|
||||
/** 操作点位 */
|
||||
@Excel(name = "操作点位")
|
||||
private String point;
|
||||
|
||||
/** 设置数据 */
|
||||
@Excel(name = "设置数据")
|
||||
private BigDecimal value;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setLogId(String logId)
|
||||
{
|
||||
this.logId = logId;
|
||||
}
|
||||
|
||||
public String getLogId()
|
||||
{
|
||||
return logId;
|
||||
}
|
||||
|
||||
public void setLogTime(Date logTime)
|
||||
{
|
||||
this.logTime = logTime;
|
||||
}
|
||||
|
||||
public Date getLogTime()
|
||||
{
|
||||
return logTime;
|
||||
}
|
||||
|
||||
public void setLogLevel(Integer logLevel)
|
||||
{
|
||||
this.logLevel = logLevel;
|
||||
}
|
||||
|
||||
public Integer getLogLevel()
|
||||
{
|
||||
return logLevel;
|
||||
}
|
||||
|
||||
public void setSiteId(String siteId)
|
||||
{
|
||||
this.siteId = siteId;
|
||||
}
|
||||
|
||||
public String getSiteId()
|
||||
{
|
||||
return siteId;
|
||||
}
|
||||
|
||||
public void setDeviceId(String deviceId)
|
||||
{
|
||||
this.deviceId = deviceId;
|
||||
}
|
||||
|
||||
public String getDeviceId()
|
||||
{
|
||||
return deviceId;
|
||||
}
|
||||
|
||||
public void setPoint(String point)
|
||||
{
|
||||
this.point = point;
|
||||
}
|
||||
|
||||
public String getPoint()
|
||||
{
|
||||
return point;
|
||||
}
|
||||
|
||||
public void setValue(BigDecimal value)
|
||||
{
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public BigDecimal getValue()
|
||||
{
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("logId", getLogId())
|
||||
.append("logTime", getLogTime())
|
||||
.append("logLevel", getLogLevel())
|
||||
.append("site", getSiteId())
|
||||
.append("deviceId", getDeviceId())
|
||||
.append("point", getPoint())
|
||||
.append("value", getValue())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,191 @@
|
||||
package com.xzzn.ems.domain;
|
||||
|
||||
import com.xzzn.common.core.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.xzzn.common.annotation.Excel;
|
||||
|
||||
/**
|
||||
* 故障告警保护方案对象 ems_fault_protection_plan
|
||||
*
|
||||
* @author xzzn
|
||||
* @date 2025-10-24
|
||||
*/
|
||||
public class EmsFaultProtectionPlan extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
private Long id;
|
||||
|
||||
/** 站点id */
|
||||
@Excel(name = "站点id")
|
||||
private String siteId;
|
||||
|
||||
/** 故障名称(如:总压高、放电总压过低) */
|
||||
@Excel(name = "故障名称", readConverterExp = "如=:总压高、放电总压过低")
|
||||
private String faultName;
|
||||
|
||||
/** 故障等级(1级/2级/3级) */
|
||||
@Excel(name = "故障等级", readConverterExp = "1=级/2级/3级")
|
||||
private Integer faultLevel;
|
||||
|
||||
/** 保护设置:点位/故障值/比较方式/释放值等 */
|
||||
@Excel(name = "保护设置:点位/故障值/比较方式/释放值等")
|
||||
private String protectionSettings;
|
||||
|
||||
/** 故障延时(秒,如:3S→3) */
|
||||
@Excel(name = "故障延时", readConverterExp = "秒=,如:3S→3")
|
||||
private Long faultDelaySeconds;
|
||||
|
||||
/** 保护方案:修改目标点位和值 */
|
||||
@Excel(name = "保护方案:修改目标点位和值")
|
||||
private String protectionPlan;
|
||||
|
||||
/** 释放延时(秒,如:5S→5,3级可能无) */
|
||||
@Excel(name = "释放延时", readConverterExp = "秒=,如:5S→5,3级可能无")
|
||||
private Long releaseDelaySeconds;
|
||||
|
||||
/** 处理方案描述(例如:报警,降功率50%运行) */
|
||||
@Excel(name = "处理方案描述", readConverterExp = "例=如:报警,降功率50%运行")
|
||||
private String description;
|
||||
|
||||
/** 是否触发告警(0 - 不告警;1 - 告警) */
|
||||
@Excel(name = "是否触发告警", readConverterExp = "0=不告警;1=告警")
|
||||
private Integer isAlert;
|
||||
|
||||
/** 方案是否启用 0-未启用 1-已启用 */
|
||||
@Excel(name = "方案是否启用 0-未启用 1-已启用")
|
||||
private Long status;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setSiteId(String siteId)
|
||||
{
|
||||
this.siteId = siteId;
|
||||
}
|
||||
|
||||
public String getSiteId()
|
||||
{
|
||||
return siteId;
|
||||
}
|
||||
|
||||
public void setFaultName(String faultName)
|
||||
{
|
||||
this.faultName = faultName;
|
||||
}
|
||||
|
||||
public String getFaultName()
|
||||
{
|
||||
return faultName;
|
||||
}
|
||||
|
||||
public void setFaultLevel(Integer faultLevel)
|
||||
{
|
||||
this.faultLevel = faultLevel;
|
||||
}
|
||||
|
||||
public Integer getFaultLevel()
|
||||
{
|
||||
return faultLevel;
|
||||
}
|
||||
|
||||
public void setProtectionSettings(String protectionSettings)
|
||||
{
|
||||
this.protectionSettings = protectionSettings;
|
||||
}
|
||||
|
||||
public String getProtectionSettings()
|
||||
{
|
||||
return protectionSettings;
|
||||
}
|
||||
|
||||
public void setFaultDelaySeconds(Long faultDelaySeconds)
|
||||
{
|
||||
this.faultDelaySeconds = faultDelaySeconds;
|
||||
}
|
||||
|
||||
public Long getFaultDelaySeconds()
|
||||
{
|
||||
return faultDelaySeconds;
|
||||
}
|
||||
|
||||
public void setProtectionPlan(String protectionPlan)
|
||||
{
|
||||
this.protectionPlan = protectionPlan;
|
||||
}
|
||||
|
||||
public String getProtectionPlan()
|
||||
{
|
||||
return protectionPlan;
|
||||
}
|
||||
|
||||
public void setReleaseDelaySeconds(Long releaseDelaySeconds)
|
||||
{
|
||||
this.releaseDelaySeconds = releaseDelaySeconds;
|
||||
}
|
||||
|
||||
public Long getReleaseDelaySeconds()
|
||||
{
|
||||
return releaseDelaySeconds;
|
||||
}
|
||||
|
||||
public void setDescription(String description)
|
||||
{
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public String getDescription()
|
||||
{
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setIsAlert(Integer isAlert)
|
||||
{
|
||||
this.isAlert = isAlert;
|
||||
}
|
||||
|
||||
public Integer getIsAlert()
|
||||
{
|
||||
return isAlert;
|
||||
}
|
||||
|
||||
public void setStatus(Long status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Long getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("siteId", getSiteId())
|
||||
.append("faultName", getFaultName())
|
||||
.append("faultLevel", getFaultLevel())
|
||||
.append("protectionSettings", getProtectionSettings())
|
||||
.append("faultDelaySeconds", getFaultDelaySeconds())
|
||||
.append("protectionPlan", getProtectionPlan())
|
||||
.append("releaseDelaySeconds", getReleaseDelaySeconds())
|
||||
.append("description", getDescription())
|
||||
.append("isAlert", getIsAlert())
|
||||
.append("status", getStatus())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,130 @@
|
||||
package com.xzzn.ems.domain;
|
||||
|
||||
import com.xzzn.common.core.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.xzzn.common.annotation.Excel;
|
||||
|
||||
/**
|
||||
* 站点topic配置对象 ems_mqtt_topic_config
|
||||
*
|
||||
* @author xzzn
|
||||
* @date 2025-11-06
|
||||
*/
|
||||
public class EmsMqttTopicConfig extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
/** 主键 */
|
||||
private Long id;
|
||||
|
||||
/** 订阅topic */
|
||||
@Excel(name = "订阅topic")
|
||||
private String mqttTopic;
|
||||
|
||||
/** QoS等级(0/1/2) */
|
||||
@Excel(name = "QoS等级", readConverterExp = "0=/1/2")
|
||||
private Integer qos;
|
||||
|
||||
/** topic描述 */
|
||||
@Excel(name = "topic描述")
|
||||
private String topicName;
|
||||
|
||||
/** 对应方法 */
|
||||
@Excel(name = "对应方法")
|
||||
private String handleMethod;
|
||||
|
||||
/** 处理器类型:(DEVICE=设备数据,SYSTEM=系统状态,ALARM=告警数据等) */
|
||||
@Excel(name = "处理器类型:(DEVICE=设备数据,SYSTEM=系统状态,ALARM=告警数据等)")
|
||||
private String handleType;
|
||||
|
||||
/** 站点id */
|
||||
@Excel(name = "站点id")
|
||||
private String siteId;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setMqttTopic(String mqttTopic)
|
||||
{
|
||||
this.mqttTopic = mqttTopic;
|
||||
}
|
||||
|
||||
public String getMqttTopic()
|
||||
{
|
||||
return mqttTopic;
|
||||
}
|
||||
|
||||
public void setQos(Integer qos)
|
||||
{
|
||||
this.qos = qos;
|
||||
}
|
||||
|
||||
public Integer getQos()
|
||||
{
|
||||
return qos;
|
||||
}
|
||||
|
||||
public void setTopicName(String topicName)
|
||||
{
|
||||
this.topicName = topicName;
|
||||
}
|
||||
|
||||
public String getTopicName()
|
||||
{
|
||||
return topicName;
|
||||
}
|
||||
|
||||
public void setHandleMethod(String handleMethod)
|
||||
{
|
||||
this.handleMethod = handleMethod;
|
||||
}
|
||||
|
||||
public String getHandleMethod()
|
||||
{
|
||||
return handleMethod;
|
||||
}
|
||||
|
||||
public void setHandleType(String handleType)
|
||||
{
|
||||
this.handleType = handleType;
|
||||
}
|
||||
|
||||
public String getHandleType()
|
||||
{
|
||||
return handleType;
|
||||
}
|
||||
|
||||
public void setSiteId(String siteId)
|
||||
{
|
||||
this.siteId = siteId;
|
||||
}
|
||||
|
||||
public String getSiteId()
|
||||
{
|
||||
return siteId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("mqttTopic", getMqttTopic())
|
||||
.append("qos", getQos())
|
||||
.append("topicName", getTopicName())
|
||||
.append("handleMethod", getHandleMethod())
|
||||
.append("handleType", getHandleType())
|
||||
.append("siteId", getSiteId())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
1545
ems-system/src/main/java/com/xzzn/ems/domain/EmsPcsAlarmData.java
Normal file
1545
ems-system/src/main/java/com/xzzn/ems/domain/EmsPcsAlarmData.java
Normal file
File diff suppressed because it is too large
Load Diff
@ -12,7 +12,7 @@ import com.xzzn.common.annotation.Excel;
|
||||
* PCS数据对象 ems_pcs_data
|
||||
*
|
||||
* @author xzzn
|
||||
* @date 2025-07-07
|
||||
* @date 2025-09-25
|
||||
*/
|
||||
public class EmsPcsData extends BaseEntity
|
||||
{
|
||||
@ -206,6 +206,34 @@ public class EmsPcsData extends BaseEntity
|
||||
@Excel(name = "电网频率")
|
||||
private BigDecimal dwFrequency;
|
||||
|
||||
/** 单元1U相IGBT温度 */
|
||||
@Excel(name = "单元1U相IGBT温度")
|
||||
private BigDecimal uTemperature;
|
||||
|
||||
/** 单元1V相IGBT温度 */
|
||||
@Excel(name = "单元1V相IGBT温度")
|
||||
private BigDecimal vTemperature;
|
||||
|
||||
/** 单元1W相IGBT温度 */
|
||||
@Excel(name = "单元1W相IGBT温度")
|
||||
private BigDecimal wTemperature;
|
||||
|
||||
/** 1#模块IGBT最高温 */
|
||||
@Excel(name = "1#模块IGBT最高温")
|
||||
private BigDecimal module1Temp;
|
||||
|
||||
/** 2#模块IGBT最高温 */
|
||||
@Excel(name = "2#模块IGBT最高温")
|
||||
private BigDecimal module2Temp;
|
||||
|
||||
/** 3#模块IGBT最高温 */
|
||||
@Excel(name = "3#模块IGBT最高温")
|
||||
private BigDecimal module3Temp;
|
||||
|
||||
/** 4#模块IGBT最高温 */
|
||||
@Excel(name = "4#模块IGBT最高温")
|
||||
private BigDecimal module4Temp;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
@ -676,6 +704,76 @@ public class EmsPcsData extends BaseEntity
|
||||
return dwFrequency;
|
||||
}
|
||||
|
||||
public void setuTemperature(BigDecimal uTemperature)
|
||||
{
|
||||
this.uTemperature = uTemperature;
|
||||
}
|
||||
|
||||
public BigDecimal getuTemperature()
|
||||
{
|
||||
return uTemperature;
|
||||
}
|
||||
|
||||
public void setvTemperature(BigDecimal vTemperature)
|
||||
{
|
||||
this.vTemperature = vTemperature;
|
||||
}
|
||||
|
||||
public BigDecimal getvTemperature()
|
||||
{
|
||||
return vTemperature;
|
||||
}
|
||||
|
||||
public void setwTemperature(BigDecimal wTemperature)
|
||||
{
|
||||
this.wTemperature = wTemperature;
|
||||
}
|
||||
|
||||
public BigDecimal getwTemperature()
|
||||
{
|
||||
return wTemperature;
|
||||
}
|
||||
|
||||
public void setModule1Temp(BigDecimal module1Temp)
|
||||
{
|
||||
this.module1Temp = module1Temp;
|
||||
}
|
||||
|
||||
public BigDecimal getModule1Temp()
|
||||
{
|
||||
return module1Temp;
|
||||
}
|
||||
|
||||
public void setModule2Temp(BigDecimal module2Temp)
|
||||
{
|
||||
this.module2Temp = module2Temp;
|
||||
}
|
||||
|
||||
public BigDecimal getModule2Temp()
|
||||
{
|
||||
return module2Temp;
|
||||
}
|
||||
|
||||
public void setModule3Temp(BigDecimal module3Temp)
|
||||
{
|
||||
this.module3Temp = module3Temp;
|
||||
}
|
||||
|
||||
public BigDecimal getModule3Temp()
|
||||
{
|
||||
return module3Temp;
|
||||
}
|
||||
|
||||
public void setModule4Temp(BigDecimal module4Temp)
|
||||
{
|
||||
this.module4Temp = module4Temp;
|
||||
}
|
||||
|
||||
public BigDecimal getModule4Temp()
|
||||
{
|
||||
return module4Temp;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
@ -731,6 +829,13 @@ public class EmsPcsData extends BaseEntity
|
||||
.append("sysVCurrent", getSysVCurrent())
|
||||
.append("sysWCurrent", getSysWCurrent())
|
||||
.append("dwFrequency", getDwFrequency())
|
||||
.append("uTemperature", getuTemperature())
|
||||
.append("vTemperature", getvTemperature())
|
||||
.append("wTemperature", getwTemperature())
|
||||
.append("module1Temp", getModule1Temp())
|
||||
.append("module2Temp", getModule2Temp())
|
||||
.append("module3Temp", getModule3Temp())
|
||||
.append("module4Temp", getModule4Temp())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,147 @@
|
||||
package com.xzzn.ems.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.xzzn.common.annotation.Excel;
|
||||
import com.xzzn.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 点位枚举匹配对象 ems_point_enum_match
|
||||
*
|
||||
* @author xzzn
|
||||
* @date 2025-12-08
|
||||
*/
|
||||
public class EmsPointEnumMatch extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键自增长 */
|
||||
private Long id;
|
||||
|
||||
/** 点位匹配字段 */
|
||||
@Excel(name = "点位匹配字段")
|
||||
private String matchField;
|
||||
|
||||
/** 站点id */
|
||||
@Excel(name = "站点id")
|
||||
private String siteId;
|
||||
|
||||
/** 设备类别,例如“STACK/CLUSTER/PCS等” */
|
||||
@Excel(name = "设备类别,例如“STACK/CLUSTER/PCS等”")
|
||||
private String deviceCategory;
|
||||
|
||||
/** 系统枚举代码 */
|
||||
@Excel(name = "系统枚举代码")
|
||||
private String enumCode;
|
||||
|
||||
/** 系统枚举名称 */
|
||||
@Excel(name = "系统枚举名称")
|
||||
private String enumName;
|
||||
|
||||
/** 系统枚举描述 */
|
||||
@Excel(name = "系统枚举描述")
|
||||
private String enumDesc;
|
||||
|
||||
/** 数据枚举代码 */
|
||||
@Excel(name = "数据枚举代码")
|
||||
private String dataEnumCode;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setMatchField(String matchField)
|
||||
{
|
||||
this.matchField = matchField;
|
||||
}
|
||||
|
||||
public String getMatchField()
|
||||
{
|
||||
return matchField;
|
||||
}
|
||||
|
||||
public void setSiteId(String siteId)
|
||||
{
|
||||
this.siteId = siteId;
|
||||
}
|
||||
|
||||
public String getSiteId()
|
||||
{
|
||||
return siteId;
|
||||
}
|
||||
|
||||
public void setDeviceCategory(String deviceCategory)
|
||||
{
|
||||
this.deviceCategory = deviceCategory;
|
||||
}
|
||||
|
||||
public String getDeviceCategory()
|
||||
{
|
||||
return deviceCategory;
|
||||
}
|
||||
|
||||
public void setEnumCode(String enumCode)
|
||||
{
|
||||
this.enumCode = enumCode;
|
||||
}
|
||||
|
||||
public String getEnumCode()
|
||||
{
|
||||
return enumCode;
|
||||
}
|
||||
|
||||
public void setEnumName(String enumName)
|
||||
{
|
||||
this.enumName = enumName;
|
||||
}
|
||||
|
||||
public String getEnumName()
|
||||
{
|
||||
return enumName;
|
||||
}
|
||||
|
||||
public void setEnumDesc(String enumDesc)
|
||||
{
|
||||
this.enumDesc = enumDesc;
|
||||
}
|
||||
|
||||
public String getEnumDesc()
|
||||
{
|
||||
return enumDesc;
|
||||
}
|
||||
|
||||
public void setDataEnumCode(String dataEnumCode)
|
||||
{
|
||||
this.dataEnumCode = dataEnumCode;
|
||||
}
|
||||
|
||||
public String getDataEnumCode()
|
||||
{
|
||||
return dataEnumCode;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("matchField", getMatchField())
|
||||
.append("siteId", getSiteId())
|
||||
.append("deviceCategory", getDeviceCategory())
|
||||
.append("enumCode", getEnumCode())
|
||||
.append("enumName", getEnumName())
|
||||
.append("enumDesc", getEnumDesc())
|
||||
.append("dataEnumCode", getDataEnumCode())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
261
ems-system/src/main/java/com/xzzn/ems/domain/EmsPointMatch.java
Normal file
261
ems-system/src/main/java/com/xzzn/ems/domain/EmsPointMatch.java
Normal file
@ -0,0 +1,261 @@
|
||||
package com.xzzn.ems.domain;
|
||||
|
||||
import com.xzzn.common.core.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.xzzn.common.annotation.Excel;
|
||||
|
||||
/**
|
||||
* 点位匹配对象 ems_point_match
|
||||
*
|
||||
* @author xzzn
|
||||
* @date 2025-11-04
|
||||
*/
|
||||
public class EmsPointMatch extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 设备ID,主键自增长 */
|
||||
private Long id;
|
||||
|
||||
/** 存储点位名称 */
|
||||
@Excel(name = "存储点位名称")
|
||||
private String pointName;
|
||||
|
||||
/** 点位所在表 */
|
||||
@Excel(name = "点位所在表")
|
||||
private String matchTable;
|
||||
|
||||
/** 点位匹配字段 */
|
||||
@Excel(name = "点位匹配字段")
|
||||
private String matchField;
|
||||
|
||||
/** 站点id */
|
||||
@Excel(name = "站点id")
|
||||
private String siteId;
|
||||
|
||||
/** 设备类别,例如“STACK/CLUSTER/PCS等” */
|
||||
@Excel(name = "设备类别,例如“STACK/CLUSTER/PCS等”")
|
||||
private String deviceCategory;
|
||||
|
||||
/** 数据点位 */
|
||||
@Excel(name = "数据点位")
|
||||
private String dataPoint;
|
||||
|
||||
/** 数据点位名称 */
|
||||
@Excel(name = "数据点位名称")
|
||||
private String dataPointName;
|
||||
|
||||
/** 数据点位来源设备 */
|
||||
@Excel(name = "数据点位来源设备")
|
||||
private String dataDevice;
|
||||
|
||||
/** 数据单位 */
|
||||
@Excel(name = "数据单位")
|
||||
private String dataUnit;
|
||||
|
||||
/** 地址 */
|
||||
@Excel(name = "寄存器地址")
|
||||
private String ipAddress;
|
||||
|
||||
/** 端口 */
|
||||
@Excel(name = "端口")
|
||||
private Integer ipPort;
|
||||
|
||||
/** 数据类型:1-瞬时值 2-累计值 */
|
||||
@Excel(name = "数据类型:1-瞬时值 2-累计值")
|
||||
private Long dataType;
|
||||
|
||||
/** 点位是否需要区分多设备:0-不需要 1-需要 */
|
||||
@Excel(name = "点位是否需要区分多设备:0-不需要 1-需要")
|
||||
private Long needDiffDeviceId;
|
||||
|
||||
/** 是否告警点位 */
|
||||
@Excel(name = "是否告警点位", readConverterExp = "0=否,1=是")
|
||||
private Integer isAlarm;
|
||||
|
||||
/** 设备唯一标识符 */
|
||||
@Excel(name = "设备唯一标识符")
|
||||
private String deviceId;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setPointName(String pointName)
|
||||
{
|
||||
this.pointName = pointName;
|
||||
}
|
||||
|
||||
public String getPointName()
|
||||
{
|
||||
return pointName;
|
||||
}
|
||||
|
||||
public void setMatchTable(String matchTable)
|
||||
{
|
||||
this.matchTable = matchTable;
|
||||
}
|
||||
|
||||
public String getMatchTable()
|
||||
{
|
||||
return matchTable;
|
||||
}
|
||||
|
||||
public void setMatchField(String matchField)
|
||||
{
|
||||
this.matchField = matchField;
|
||||
}
|
||||
|
||||
public String getMatchField()
|
||||
{
|
||||
return matchField;
|
||||
}
|
||||
|
||||
public void setSiteId(String siteId)
|
||||
{
|
||||
this.siteId = siteId;
|
||||
}
|
||||
|
||||
public String getSiteId()
|
||||
{
|
||||
return siteId;
|
||||
}
|
||||
|
||||
public void setDeviceCategory(String deviceCategory)
|
||||
{
|
||||
this.deviceCategory = deviceCategory;
|
||||
}
|
||||
|
||||
public String getDeviceCategory()
|
||||
{
|
||||
return deviceCategory;
|
||||
}
|
||||
|
||||
public void setDataPoint(String dataPoint)
|
||||
{
|
||||
this.dataPoint = dataPoint;
|
||||
}
|
||||
|
||||
public String getDataPoint()
|
||||
{
|
||||
return dataPoint;
|
||||
}
|
||||
|
||||
public void setDataPointName(String dataPointName)
|
||||
{
|
||||
this.dataPointName = dataPointName;
|
||||
}
|
||||
|
||||
public String getDataPointName()
|
||||
{
|
||||
return dataPointName;
|
||||
}
|
||||
|
||||
public void setDataDevice(String dataDevice)
|
||||
{
|
||||
this.dataDevice = dataDevice;
|
||||
}
|
||||
|
||||
public String getDataDevice()
|
||||
{
|
||||
return dataDevice;
|
||||
}
|
||||
|
||||
public void setDataUnit(String dataUnit)
|
||||
{
|
||||
this.dataUnit = dataUnit;
|
||||
}
|
||||
|
||||
public String getDataUnit()
|
||||
{
|
||||
return dataUnit;
|
||||
}
|
||||
|
||||
public void setIpAddress(String ipAddress)
|
||||
{
|
||||
this.ipAddress = ipAddress;
|
||||
}
|
||||
|
||||
public String getIpAddress()
|
||||
{
|
||||
return ipAddress;
|
||||
}
|
||||
|
||||
public Integer getIpPort() {
|
||||
return ipPort;
|
||||
}
|
||||
|
||||
public void setIpPort(Integer ipPort) {
|
||||
this.ipPort = ipPort;
|
||||
}
|
||||
|
||||
public void setDataType(Long dataType)
|
||||
{
|
||||
this.dataType = dataType;
|
||||
}
|
||||
|
||||
public Long getDataType()
|
||||
{
|
||||
return dataType;
|
||||
}
|
||||
|
||||
public void setNeedDiffDeviceId(Long needDiffDeviceId)
|
||||
{
|
||||
this.needDiffDeviceId = needDiffDeviceId;
|
||||
}
|
||||
|
||||
public Long getNeedDiffDeviceId()
|
||||
{
|
||||
return needDiffDeviceId;
|
||||
}
|
||||
|
||||
public Integer getIsAlarm() {
|
||||
return isAlarm;
|
||||
}
|
||||
|
||||
public void setIsAlarm(Integer isAlarm) {
|
||||
this.isAlarm = isAlarm;
|
||||
}
|
||||
|
||||
public String getDeviceId() {
|
||||
return deviceId;
|
||||
}
|
||||
|
||||
public void setDeviceId(String deviceId) {
|
||||
this.deviceId = deviceId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("pointName", getPointName())
|
||||
.append("matchTable", getMatchTable())
|
||||
.append("matchField", getMatchField())
|
||||
.append("siteId", getSiteId())
|
||||
.append("deviceCategory", getDeviceCategory())
|
||||
.append("dataPoint", getDataPoint())
|
||||
.append("dataPointName", getDataPointName())
|
||||
.append("dataDevice", getDataDevice())
|
||||
.append("dataUnit", getDataUnit())
|
||||
.append("ipAddress", getIpAddress())
|
||||
.append("ipPort", getIpPort())
|
||||
.append("dataType", getDataType())
|
||||
.append("needDiffDeviceId", getNeedDiffDeviceId())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.append("isAlarm", getIsAlarm())
|
||||
.append("deviceId", getDeviceId())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,102 @@
|
||||
package com.xzzn.ems.domain;
|
||||
|
||||
import com.xzzn.common.core.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.xzzn.common.annotation.Excel;
|
||||
|
||||
/**
|
||||
* 电价时间配置对象 ems_price_time_config
|
||||
*
|
||||
* @author xzzn
|
||||
* @date 2025-10-09
|
||||
*/
|
||||
public class EmsPriceTimeConfig extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** */
|
||||
private Long id;
|
||||
|
||||
/** 时段开始时间 */
|
||||
@Excel(name = "时段开始时间")
|
||||
private String startTime;
|
||||
|
||||
/** 时段结束时间 */
|
||||
@Excel(name = "时段结束时间")
|
||||
private String endTime;
|
||||
|
||||
/** 电价类型: 尖-peak,峰-high,平-flat,谷-valley */
|
||||
@Excel(name = "电价类型: 尖-peak,峰-high,平-flat,谷-valley")
|
||||
private String costType;
|
||||
|
||||
/** 电价配置id */
|
||||
@Excel(name = "电价配置id")
|
||||
private Long priceId;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setStartTime(String startTime)
|
||||
{
|
||||
this.startTime = startTime;
|
||||
}
|
||||
|
||||
public String getStartTime()
|
||||
{
|
||||
return startTime;
|
||||
}
|
||||
|
||||
public void setEndTime(String endTime)
|
||||
{
|
||||
this.endTime = endTime;
|
||||
}
|
||||
|
||||
public String getEndTime()
|
||||
{
|
||||
return endTime;
|
||||
}
|
||||
|
||||
public void setCostType(String costType)
|
||||
{
|
||||
this.costType = costType;
|
||||
}
|
||||
|
||||
public String getCostType()
|
||||
{
|
||||
return costType;
|
||||
}
|
||||
|
||||
public void setPriceId(Long priceId)
|
||||
{
|
||||
this.priceId = priceId;
|
||||
}
|
||||
|
||||
public Long getPriceId()
|
||||
{
|
||||
return priceId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("startTime", getStartTime())
|
||||
.append("endTime", getEndTime())
|
||||
.append("costType", getCostType())
|
||||
.append("priceId", getPriceId())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
1545
ems-system/src/main/java/com/xzzn/ems/domain/EmsStackAlarmData.java
Normal file
1545
ems-system/src/main/java/com/xzzn/ems/domain/EmsStackAlarmData.java
Normal file
File diff suppressed because it is too large
Load Diff
151
ems-system/src/main/java/com/xzzn/ems/domain/EmsXfData.java
Normal file
151
ems-system/src/main/java/com/xzzn/ems/domain/EmsXfData.java
Normal file
@ -0,0 +1,151 @@
|
||||
package com.xzzn.ems.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.xzzn.common.core.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.xzzn.common.annotation.Excel;
|
||||
|
||||
/**
|
||||
* 消防数据对象 ems_xf_data
|
||||
*
|
||||
* @author xzzn
|
||||
* @date 2025-10-21
|
||||
*/
|
||||
public class EmsXfData extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** $column.columnComment */
|
||||
private Long id;
|
||||
|
||||
/** 数据采集时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "数据采集时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date dataTimestamp;
|
||||
|
||||
/** 主电源备用电池状态 */
|
||||
@Excel(name = "主电源备用电池状态")
|
||||
private BigDecimal dczt;
|
||||
|
||||
/** 手自动状态延时状态 */
|
||||
@Excel(name = "手自动状态延时状态")
|
||||
private BigDecimal yszt;
|
||||
|
||||
/** 启动喷洒气体喷洒状态 */
|
||||
@Excel(name = "启动喷洒气体喷洒状态")
|
||||
private BigDecimal pszt;
|
||||
|
||||
/** 压力开关状态电磁阀状态 */
|
||||
@Excel(name = "压力开关状态电磁阀状态")
|
||||
private BigDecimal dcfzt;
|
||||
|
||||
/** 站点id */
|
||||
@Excel(name = "站点id")
|
||||
private String siteId;
|
||||
|
||||
/** 设备唯一标识符 */
|
||||
@Excel(name = "设备唯一标识符")
|
||||
private String deviceId;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setDataTimestamp(Date dataTimestamp)
|
||||
{
|
||||
this.dataTimestamp = dataTimestamp;
|
||||
}
|
||||
|
||||
public Date getDataTimestamp()
|
||||
{
|
||||
return dataTimestamp;
|
||||
}
|
||||
|
||||
public void setDczt(BigDecimal dczt)
|
||||
{
|
||||
this.dczt = dczt;
|
||||
}
|
||||
|
||||
public BigDecimal getDczt()
|
||||
{
|
||||
return dczt;
|
||||
}
|
||||
|
||||
public void setYszt(BigDecimal yszt)
|
||||
{
|
||||
this.yszt = yszt;
|
||||
}
|
||||
|
||||
public BigDecimal getYszt()
|
||||
{
|
||||
return yszt;
|
||||
}
|
||||
|
||||
public void setPszt(BigDecimal pszt)
|
||||
{
|
||||
this.pszt = pszt;
|
||||
}
|
||||
|
||||
public BigDecimal getPszt()
|
||||
{
|
||||
return pszt;
|
||||
}
|
||||
|
||||
public void setDcfzt(BigDecimal dcfzt)
|
||||
{
|
||||
this.dcfzt = dcfzt;
|
||||
}
|
||||
|
||||
public BigDecimal getDcfzt()
|
||||
{
|
||||
return dcfzt;
|
||||
}
|
||||
|
||||
public void setSiteId(String siteId)
|
||||
{
|
||||
this.siteId = siteId;
|
||||
}
|
||||
|
||||
public String getSiteId()
|
||||
{
|
||||
return siteId;
|
||||
}
|
||||
|
||||
public void setDeviceId(String deviceId)
|
||||
{
|
||||
this.deviceId = deviceId;
|
||||
}
|
||||
|
||||
public String getDeviceId()
|
||||
{
|
||||
return deviceId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("dataTimestamp", getDataTimestamp())
|
||||
.append("dczt", getDczt())
|
||||
.append("yszt", getYszt())
|
||||
.append("pszt", getPszt())
|
||||
.append("dcfzt", getDcfzt())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.append("siteId", getSiteId())
|
||||
.append("deviceId", getDeviceId())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
173
ems-system/src/main/java/com/xzzn/ems/domain/MqttSyncLog.java
Normal file
173
ems-system/src/main/java/com/xzzn/ems/domain/MqttSyncLog.java
Normal file
@ -0,0 +1,173 @@
|
||||
package com.xzzn.ems.domain;
|
||||
|
||||
import com.xzzn.common.core.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.xzzn.common.annotation.Excel;
|
||||
|
||||
/**
|
||||
* MQTT云上本地同步日志对象 mqtt_sync_log
|
||||
*
|
||||
* @author xzzn
|
||||
* @date 2025-11-12
|
||||
*/
|
||||
public class MqttSyncLog extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
private Long id;
|
||||
|
||||
/** 同步消息唯一标识(与消息中的syncId一致) */
|
||||
@Excel(name = "同步消息唯一标识", readConverterExp = "与=消息中的syncId一致")
|
||||
private String syncId;
|
||||
|
||||
/** MQTT主题 */
|
||||
@Excel(name = "MQTT主题")
|
||||
private String topic;
|
||||
|
||||
/** 操作类型:INSERT/UPDATE/DELETE */
|
||||
@Excel(name = "操作类型:INSERT/UPDATE/DELETE")
|
||||
private String operateType;
|
||||
|
||||
/** 涉及的表名 */
|
||||
@Excel(name = "涉及的表名")
|
||||
private String tableName;
|
||||
|
||||
/** 同步数据内容(JSON格式) */
|
||||
@Excel(name = "同步数据内容", readConverterExp = "J=SON格式")
|
||||
private String content;
|
||||
|
||||
/** 处理状态:SUCCESS/FAIL */
|
||||
@Excel(name = "处理状态:SUCCESS/FAIL")
|
||||
private String status;
|
||||
|
||||
/** 失败原因(status=FAIL时填写) */
|
||||
@Excel(name = "失败原因", readConverterExp = "s=tatus=FAIL时填写")
|
||||
private String errorMsg;
|
||||
|
||||
/** 同步对象 */
|
||||
@Excel(name = "同步对象")
|
||||
private String syncObject;
|
||||
|
||||
/** 同步目标 */
|
||||
@Excel(name = "同步目标")
|
||||
private String target;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setSyncId(String syncId)
|
||||
{
|
||||
this.syncId = syncId;
|
||||
}
|
||||
|
||||
public String getSyncId()
|
||||
{
|
||||
return syncId;
|
||||
}
|
||||
|
||||
public void setTopic(String topic)
|
||||
{
|
||||
this.topic = topic;
|
||||
}
|
||||
|
||||
public String getTopic()
|
||||
{
|
||||
return topic;
|
||||
}
|
||||
|
||||
public void setOperateType(String operateType)
|
||||
{
|
||||
this.operateType = operateType;
|
||||
}
|
||||
|
||||
public String getOperateType()
|
||||
{
|
||||
return operateType;
|
||||
}
|
||||
|
||||
public void setTableName(String tableName)
|
||||
{
|
||||
this.tableName = tableName;
|
||||
}
|
||||
|
||||
public String getTableName()
|
||||
{
|
||||
return tableName;
|
||||
}
|
||||
|
||||
public void setContent(String content)
|
||||
{
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public String getContent()
|
||||
{
|
||||
return content;
|
||||
}
|
||||
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setErrorMsg(String errorMsg)
|
||||
{
|
||||
this.errorMsg = errorMsg;
|
||||
}
|
||||
|
||||
public String getErrorMsg()
|
||||
{
|
||||
return errorMsg;
|
||||
}
|
||||
|
||||
public void setSyncObject(String syncObject)
|
||||
{
|
||||
this.syncObject = syncObject;
|
||||
}
|
||||
|
||||
public String getSyncObject()
|
||||
{
|
||||
return syncObject;
|
||||
}
|
||||
|
||||
public void setTarget(String target)
|
||||
{
|
||||
this.target = target;
|
||||
}
|
||||
|
||||
public String getTarget()
|
||||
{
|
||||
return target;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("syncId", getSyncId())
|
||||
.append("topic", getTopic())
|
||||
.append("operateType", getOperateType())
|
||||
.append("tableName", getTableName())
|
||||
.append("content", getContent())
|
||||
.append("status", getStatus())
|
||||
.append("errorMsg", getErrorMsg())
|
||||
.append("syncObject", getSyncObject())
|
||||
.append("target", getTarget())
|
||||
.append("createTime", getCreateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@ -23,6 +23,12 @@ public class AlarmRecordListRequestVo {
|
||||
/** 告警结束时间 */
|
||||
private String alarmEndTime;
|
||||
|
||||
/** 设备id */
|
||||
private String deviceId;
|
||||
|
||||
/** 告警状态 */
|
||||
private String status;
|
||||
|
||||
public String getSiteId() {
|
||||
return siteId;
|
||||
}
|
||||
@ -62,4 +68,20 @@ public class AlarmRecordListRequestVo {
|
||||
public void setAlarmEndTime(String alarmEndTime) {
|
||||
this.alarmEndTime = alarmEndTime;
|
||||
}
|
||||
|
||||
public String getDeviceId() {
|
||||
return deviceId;
|
||||
}
|
||||
|
||||
public void setDeviceId(String deviceId) {
|
||||
this.deviceId = deviceId;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,23 +1,21 @@
|
||||
package com.xzzn.ems.domain.vo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 电表数据
|
||||
*/
|
||||
public class AmmeterDataResponse {
|
||||
|
||||
/** 总表信息 */
|
||||
private AmmeterLoadDataVo ammeterLoadData;
|
||||
private AmmeterDataVo ammeterLoadData;
|
||||
|
||||
/** 储能表信息 */
|
||||
private AmmeterMeteDataVo ammeterMeteData;
|
||||
|
||||
public AmmeterLoadDataVo getAmmeterLoadData() {
|
||||
public AmmeterDataVo getAmmeterLoadData() {
|
||||
return ammeterLoadData;
|
||||
}
|
||||
|
||||
public void setAmmeterLoadDataVoList(AmmeterLoadDataVo ammeterLoadData) {
|
||||
public void setAmmeterLoadDataVoList(AmmeterDataVo ammeterLoadData) {
|
||||
this.ammeterLoadData = ammeterLoadData;
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,161 @@
|
||||
package com.xzzn.ems.domain.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 电表数据
|
||||
*/
|
||||
public class AmmeterDataVo {
|
||||
|
||||
/** 电表名称 */
|
||||
private String deviceName;
|
||||
|
||||
/** 设备id */
|
||||
private String deviceId;
|
||||
|
||||
/** 通信状态 */
|
||||
private String emsCommunicationStatus;
|
||||
|
||||
/** 数据更新时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date dataUpdateTime;
|
||||
|
||||
/** 表数据信息 */
|
||||
private List<LoadDataDetailInfo> loadDataDetailInfo;
|
||||
|
||||
// 正向有功电能
|
||||
private BigDecimal forwardActive;
|
||||
// 反向有功电能
|
||||
private BigDecimal reverseActive;
|
||||
// 正向无功电能
|
||||
private BigDecimal forwardReactive;
|
||||
// 反向无功电能
|
||||
private BigDecimal reverseReactive;
|
||||
// 有功功率
|
||||
private BigDecimal activePower;
|
||||
// 无功功率
|
||||
private BigDecimal reactivePower;
|
||||
// 有功电能
|
||||
private BigDecimal activeEnergy;
|
||||
// 无功电能
|
||||
private BigDecimal reactiveEnergy;
|
||||
|
||||
/** 报警个数 */
|
||||
private int alarmNum;
|
||||
|
||||
public BigDecimal getActiveEnergy() {
|
||||
return activeEnergy;
|
||||
}
|
||||
|
||||
public void setActiveEnergy(BigDecimal activeEnergy) {
|
||||
this.activeEnergy = activeEnergy;
|
||||
}
|
||||
|
||||
public BigDecimal getReactiveEnergy() {
|
||||
return reactiveEnergy;
|
||||
}
|
||||
|
||||
public void setReactiveEnergy(BigDecimal reactiveEnergy) {
|
||||
this.reactiveEnergy = reactiveEnergy;
|
||||
}
|
||||
|
||||
public BigDecimal getForwardActive() {
|
||||
return forwardActive;
|
||||
}
|
||||
|
||||
public void setForwardActive(BigDecimal forwardActive) {
|
||||
this.forwardActive = forwardActive;
|
||||
}
|
||||
|
||||
public BigDecimal getReverseActive() {
|
||||
return reverseActive;
|
||||
}
|
||||
|
||||
public void setReverseActive(BigDecimal reverseActive) {
|
||||
this.reverseActive = reverseActive;
|
||||
}
|
||||
|
||||
public BigDecimal getForwardReactive() {
|
||||
return forwardReactive;
|
||||
}
|
||||
|
||||
public void setForwardReactive(BigDecimal forwardReactive) {
|
||||
this.forwardReactive = forwardReactive;
|
||||
}
|
||||
|
||||
public BigDecimal getReverseReactive() {
|
||||
return reverseReactive;
|
||||
}
|
||||
|
||||
public void setReverseReactive(BigDecimal reverseReactive) {
|
||||
this.reverseReactive = reverseReactive;
|
||||
}
|
||||
|
||||
public BigDecimal getActivePower() {
|
||||
return activePower;
|
||||
}
|
||||
|
||||
public void setActivePower(BigDecimal activePower) {
|
||||
this.activePower = activePower;
|
||||
}
|
||||
|
||||
public BigDecimal getReactivePower() {
|
||||
return reactivePower;
|
||||
}
|
||||
|
||||
public void setReactivePower(BigDecimal reactivePower) {
|
||||
this.reactivePower = reactivePower;
|
||||
}
|
||||
|
||||
public String getDeviceName() {
|
||||
return deviceName;
|
||||
}
|
||||
|
||||
public void setDeviceName(String deviceName) {
|
||||
this.deviceName = deviceName;
|
||||
}
|
||||
|
||||
public String getEmsCommunicationStatus() {
|
||||
return emsCommunicationStatus;
|
||||
}
|
||||
|
||||
public void setEmsCommunicationStatus(String emsCommunicationStatus) {
|
||||
this.emsCommunicationStatus = emsCommunicationStatus;
|
||||
}
|
||||
|
||||
public Date getDataUpdateTime() {
|
||||
return dataUpdateTime;
|
||||
}
|
||||
|
||||
public void setDataUpdateTime(Date dataUpdateTime) {
|
||||
this.dataUpdateTime = dataUpdateTime;
|
||||
}
|
||||
|
||||
public List<LoadDataDetailInfo> getLoadDataDetailInfo() {
|
||||
return loadDataDetailInfo;
|
||||
}
|
||||
|
||||
public void setLoadDataDetailInfo(List<LoadDataDetailInfo> loadDataDetailInfo) {
|
||||
this.loadDataDetailInfo = loadDataDetailInfo;
|
||||
}
|
||||
|
||||
public String getDeviceId() {
|
||||
return deviceId;
|
||||
}
|
||||
|
||||
public void setDeviceId(String deviceId) {
|
||||
this.deviceId = deviceId;
|
||||
}
|
||||
|
||||
public int getAlarmNum() {
|
||||
return alarmNum;
|
||||
}
|
||||
|
||||
public void setAlarmNum(int alarmNum) {
|
||||
this.alarmNum = alarmNum;
|
||||
}
|
||||
}
|
||||
@ -1,57 +0,0 @@
|
||||
package com.xzzn.ems.domain.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 电表-总表数据
|
||||
*/
|
||||
public class AmmeterLoadDataVo {
|
||||
|
||||
/** 电表名称 */
|
||||
private String deviceName;
|
||||
|
||||
/** 通信状态 */
|
||||
private String emsCommunicationStatus;
|
||||
|
||||
/** 数据更新时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date dataUpdateTime;
|
||||
|
||||
/** 总表数据信息 */
|
||||
private List<LoadDataDetailInfo> loadDataDetailInfo;
|
||||
|
||||
public String getDeviceName() {
|
||||
return deviceName;
|
||||
}
|
||||
|
||||
public void setDeviceName(String deviceName) {
|
||||
this.deviceName = deviceName;
|
||||
}
|
||||
|
||||
public String getEmsCommunicationStatus() {
|
||||
return emsCommunicationStatus;
|
||||
}
|
||||
|
||||
public void setEmsCommunicationStatus(String emsCommunicationStatus) {
|
||||
this.emsCommunicationStatus = emsCommunicationStatus;
|
||||
}
|
||||
|
||||
public Date getDataUpdateTime() {
|
||||
return dataUpdateTime;
|
||||
}
|
||||
|
||||
public void setDataUpdateTime(Date dataUpdateTime) {
|
||||
this.dataUpdateTime = dataUpdateTime;
|
||||
}
|
||||
|
||||
public List<LoadDataDetailInfo> getLoadDataDetailInfo() {
|
||||
return loadDataDetailInfo;
|
||||
}
|
||||
|
||||
public void setLoadDataDetailInfo(List<LoadDataDetailInfo> loadDataDetailInfo) {
|
||||
this.loadDataDetailInfo = loadDataDetailInfo;
|
||||
}
|
||||
}
|
||||
@ -12,7 +12,8 @@ public class AmmeterMeteDataVo {
|
||||
|
||||
/** 电表名称 */
|
||||
private String deviceName;
|
||||
|
||||
/** 设备id */
|
||||
private String deviceId;
|
||||
/** 通信状态 */
|
||||
private String emsCommunicationStatus;
|
||||
|
||||
@ -54,4 +55,12 @@ public class AmmeterMeteDataVo {
|
||||
public void setMeteDataDetailInfo(List<MeteDataDetailInfo> meteDataDetailInfo) {
|
||||
this.meteDataDetailInfo = meteDataDetailInfo;
|
||||
}
|
||||
|
||||
public String getDeviceId() {
|
||||
return deviceId;
|
||||
}
|
||||
|
||||
public void setDeviceId(String deviceId) {
|
||||
this.deviceId = deviceId;
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,131 @@
|
||||
package com.xzzn.ems.domain.vo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 电表收益数据
|
||||
*/
|
||||
public class AmmeterRevenueStatisListVo {
|
||||
|
||||
|
||||
/** 类别 */
|
||||
private String dataTime;
|
||||
|
||||
/** 组合有功-总 */
|
||||
private BigDecimal activeTotalPrice = BigDecimal.ZERO;
|
||||
|
||||
/** 组合有功-尖 */
|
||||
private BigDecimal activePeakPrice = BigDecimal.ZERO;
|
||||
|
||||
/** 组合有功-峰 */
|
||||
private BigDecimal activeHighPrice = BigDecimal.ZERO;
|
||||
|
||||
/** 组合有功-平 */
|
||||
private BigDecimal activeFlatPrice = BigDecimal.ZERO;
|
||||
|
||||
/** 组合有功-谷 */
|
||||
private BigDecimal activeValleyPrice = BigDecimal.ZERO;
|
||||
|
||||
/** 组合无功-总 */
|
||||
private BigDecimal reActiveTotalPrice = BigDecimal.ZERO;
|
||||
|
||||
/** 组合无功-尖 */
|
||||
private BigDecimal reActivePeakPrice = BigDecimal.ZERO;
|
||||
|
||||
/** 组合无功-峰 */
|
||||
private BigDecimal reActiveHighPrice = BigDecimal.ZERO;
|
||||
|
||||
/** 组合无功-平 */
|
||||
private BigDecimal reActiveFlatPrice = BigDecimal.ZERO;
|
||||
|
||||
/** 组合无功-谷 */
|
||||
private BigDecimal reActiveValleyPrice = BigDecimal.ZERO;
|
||||
|
||||
public String getDataTime() {
|
||||
return dataTime;
|
||||
}
|
||||
|
||||
public void setDataTime(String dataTime) {
|
||||
this.dataTime = dataTime;
|
||||
}
|
||||
|
||||
public BigDecimal getActiveTotalPrice() {
|
||||
return activeTotalPrice;
|
||||
}
|
||||
|
||||
public void setActiveTotalPrice(BigDecimal activeTotalPrice) {
|
||||
this.activeTotalPrice = activeTotalPrice;
|
||||
}
|
||||
|
||||
public BigDecimal getActivePeakPrice() {
|
||||
return activePeakPrice;
|
||||
}
|
||||
|
||||
public void setActivePeakPrice(BigDecimal activePeakPrice) {
|
||||
this.activePeakPrice = activePeakPrice;
|
||||
}
|
||||
|
||||
public BigDecimal getActiveHighPrice() {
|
||||
return activeHighPrice;
|
||||
}
|
||||
|
||||
public void setActiveHighPrice(BigDecimal activeHighPrice) {
|
||||
this.activeHighPrice = activeHighPrice;
|
||||
}
|
||||
|
||||
public BigDecimal getActiveFlatPrice() {
|
||||
return activeFlatPrice;
|
||||
}
|
||||
|
||||
public void setActiveFlatPrice(BigDecimal activeFlatPrice) {
|
||||
this.activeFlatPrice = activeFlatPrice;
|
||||
}
|
||||
|
||||
public BigDecimal getActiveValleyPrice() {
|
||||
return activeValleyPrice;
|
||||
}
|
||||
|
||||
public void setActiveValleyPrice(BigDecimal activeValleyPrice) {
|
||||
this.activeValleyPrice = activeValleyPrice;
|
||||
}
|
||||
|
||||
public BigDecimal getReActiveTotalPrice() {
|
||||
return reActiveTotalPrice;
|
||||
}
|
||||
|
||||
public void setReActiveTotalPrice(BigDecimal reActiveTotalPrice) {
|
||||
this.reActiveTotalPrice = reActiveTotalPrice;
|
||||
}
|
||||
|
||||
public BigDecimal getReActivePeakPrice() {
|
||||
return reActivePeakPrice;
|
||||
}
|
||||
|
||||
public void setReActivePeakPrice(BigDecimal reActivePeakPrice) {
|
||||
this.reActivePeakPrice = reActivePeakPrice;
|
||||
}
|
||||
|
||||
public BigDecimal getReActiveHighPrice() {
|
||||
return reActiveHighPrice;
|
||||
}
|
||||
|
||||
public void setReActiveHighPrice(BigDecimal reActiveHighPrice) {
|
||||
this.reActiveHighPrice = reActiveHighPrice;
|
||||
}
|
||||
|
||||
public BigDecimal getReActiveFlatPrice() {
|
||||
return reActiveFlatPrice;
|
||||
}
|
||||
|
||||
public void setReActiveFlatPrice(BigDecimal reActiveFlatPrice) {
|
||||
this.reActiveFlatPrice = reActiveFlatPrice;
|
||||
}
|
||||
|
||||
public BigDecimal getReActiveValleyPrice() {
|
||||
return reActiveValleyPrice;
|
||||
}
|
||||
|
||||
public void setReActiveValleyPrice(BigDecimal reActiveValleyPrice) {
|
||||
this.reActiveValleyPrice = reActiveValleyPrice;
|
||||
}
|
||||
}
|
||||
@ -11,6 +11,8 @@ public class AmmeterStatisListVo {
|
||||
/** 类别 */
|
||||
private String dataTime;
|
||||
|
||||
private String timePart;
|
||||
|
||||
/** 组合有功-总 (kWh) */
|
||||
private BigDecimal activeTotalKwh = BigDecimal.ZERO;
|
||||
|
||||
@ -52,6 +54,14 @@ public class AmmeterStatisListVo {
|
||||
this.dataTime = dataTime;
|
||||
}
|
||||
|
||||
public String getTimePart() {
|
||||
return timePart;
|
||||
}
|
||||
|
||||
public void setTimePart(String timePart) {
|
||||
this.timePart = timePart;
|
||||
}
|
||||
|
||||
public BigDecimal getActiveTotalKwh() {
|
||||
return activeTotalKwh;
|
||||
}
|
||||
|
||||
@ -1,6 +1,9 @@
|
||||
package com.xzzn.ems.domain.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -12,6 +15,10 @@ public class BMSBatteryClusterVo {
|
||||
/** 设备名称 */
|
||||
private String deviceName;
|
||||
|
||||
/** 数据更新时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date dataUpdateTime;
|
||||
|
||||
/** 工作状态 */
|
||||
private String workStatus;
|
||||
|
||||
@ -57,6 +64,12 @@ public class BMSBatteryClusterVo {
|
||||
/** 设备唯一标识符 */
|
||||
private String deviceId;
|
||||
|
||||
/** 父类设备名称 */
|
||||
private String parentDeviceName;
|
||||
|
||||
/** 报警个数 */
|
||||
private int alarmNum;
|
||||
|
||||
private List<BMSBatteryClusterDataList> batteryDataList;
|
||||
|
||||
public String getDeviceName() {
|
||||
@ -67,6 +80,14 @@ public class BMSBatteryClusterVo {
|
||||
this.deviceName = deviceName;
|
||||
}
|
||||
|
||||
public Date getDataUpdateTime() {
|
||||
return dataUpdateTime;
|
||||
}
|
||||
|
||||
public void setDataUpdateTime(Date dataUpdateTime) {
|
||||
this.dataUpdateTime = dataUpdateTime;
|
||||
}
|
||||
|
||||
public String getWorkStatus() {
|
||||
return workStatus;
|
||||
}
|
||||
@ -194,4 +215,20 @@ public class BMSBatteryClusterVo {
|
||||
public void setBatteryDataList(List<BMSBatteryClusterDataList> batteryDataList) {
|
||||
this.batteryDataList = batteryDataList;
|
||||
}
|
||||
|
||||
public String getParentDeviceName() {
|
||||
return parentDeviceName;
|
||||
}
|
||||
|
||||
public void setParentDeviceName(String parentDeviceName) {
|
||||
this.parentDeviceName = parentDeviceName;
|
||||
}
|
||||
|
||||
public int getAlarmNum() {
|
||||
return alarmNum;
|
||||
}
|
||||
|
||||
public void setAlarmNum(int alarmNum) {
|
||||
this.alarmNum = alarmNum;
|
||||
}
|
||||
}
|
||||
|
||||
@ -23,15 +23,27 @@ public class BMSBatteryDataList {
|
||||
/** 单体最高电压 (V) */
|
||||
private BigDecimal maxCellVoltage;
|
||||
|
||||
/** 最高单体电压对应点号 */
|
||||
private String maxCellVoltageId;
|
||||
|
||||
/** 单体最低电压 (V) */
|
||||
private BigDecimal minCellVoltage;
|
||||
|
||||
/** 最低单体电压对应点号 */
|
||||
private String minCellVoltageId;
|
||||
|
||||
/** 单体最高温度 (℃) */
|
||||
private BigDecimal maxCellTemp;
|
||||
|
||||
/** 最高单体温度对应点号 */
|
||||
private String maxCellTempId;
|
||||
|
||||
/** 单体最低温度 (℃) */
|
||||
private BigDecimal minCellTemp;
|
||||
|
||||
/** 最低单体温度对应点号 */
|
||||
private String minCellTempId;
|
||||
|
||||
/** 换电站id */
|
||||
private String siteId;
|
||||
|
||||
@ -117,4 +129,36 @@ public class BMSBatteryDataList {
|
||||
public void setClusterVoltage(BigDecimal clusterVoltage) {
|
||||
this.clusterVoltage = clusterVoltage;
|
||||
}
|
||||
|
||||
public String getMaxCellVoltageId() {
|
||||
return maxCellVoltageId;
|
||||
}
|
||||
|
||||
public void setMaxCellVoltageId(String maxCellVoltageId) {
|
||||
this.maxCellVoltageId = maxCellVoltageId;
|
||||
}
|
||||
|
||||
public String getMinCellTempId() {
|
||||
return minCellTempId;
|
||||
}
|
||||
|
||||
public void setMinCellTempId(String minCellTempId) {
|
||||
this.minCellTempId = minCellTempId;
|
||||
}
|
||||
|
||||
public String getMaxCellTempId() {
|
||||
return maxCellTempId;
|
||||
}
|
||||
|
||||
public void setMaxCellTempId(String maxCellTempId) {
|
||||
this.maxCellTempId = maxCellTempId;
|
||||
}
|
||||
|
||||
public String getMinCellVoltageId() {
|
||||
return minCellVoltageId;
|
||||
}
|
||||
|
||||
public void setMinCellVoltageId(String minCellVoltageId) {
|
||||
this.minCellVoltageId = minCellVoltageId;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,9 @@
|
||||
package com.xzzn.ems.domain.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -12,6 +15,10 @@ public class BMSOverViewVo {
|
||||
/** 设备名称 */
|
||||
private String deviceName;
|
||||
|
||||
/** 数据更新时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date dataUpdateTime;
|
||||
|
||||
/** 工作状态 */
|
||||
private String workStatus;
|
||||
|
||||
@ -57,6 +64,9 @@ public class BMSOverViewVo {
|
||||
/** 设备唯一标识符 */
|
||||
private String deviceId;
|
||||
|
||||
/** 报警个数 */
|
||||
private int alarmNum;
|
||||
|
||||
private List<BMSBatteryDataList> batteryDataList;
|
||||
|
||||
public String getDeviceName() {
|
||||
@ -67,6 +77,14 @@ public class BMSOverViewVo {
|
||||
this.deviceName = deviceName;
|
||||
}
|
||||
|
||||
public Date getDataUpdateTime() {
|
||||
return dataUpdateTime;
|
||||
}
|
||||
|
||||
public void setDataUpdateTime(Date dataUpdateTime) {
|
||||
this.dataUpdateTime = dataUpdateTime;
|
||||
}
|
||||
|
||||
public String getWorkStatus() {
|
||||
return workStatus;
|
||||
}
|
||||
@ -187,6 +205,14 @@ public class BMSOverViewVo {
|
||||
this.deviceId = deviceId;
|
||||
}
|
||||
|
||||
public int getAlarmNum() {
|
||||
return alarmNum;
|
||||
}
|
||||
|
||||
public void setAlarmNum(int alarmNum) {
|
||||
this.alarmNum = alarmNum;
|
||||
}
|
||||
|
||||
public List<BMSBatteryDataList> getBatteryDataList() {
|
||||
return batteryDataList;
|
||||
}
|
||||
|
||||
@ -8,21 +8,26 @@ import java.util.Date;
|
||||
*
|
||||
*/
|
||||
public class BatteryAveSOCVo {
|
||||
/**
|
||||
* 游标显示日期
|
||||
*/
|
||||
private String dateDay;
|
||||
|
||||
/**
|
||||
* 数据时间
|
||||
*/
|
||||
private Date createDate;
|
||||
private String createDate;
|
||||
|
||||
/**
|
||||
* 实时SOC
|
||||
*/
|
||||
private BigDecimal batterySOC;
|
||||
|
||||
public Date getCreateDate() {
|
||||
public String getCreateDate() {
|
||||
return createDate;
|
||||
}
|
||||
|
||||
public void setCreateDate(Date createDate) {
|
||||
public void setCreateDate(String createDate) {
|
||||
this.createDate = createDate;
|
||||
}
|
||||
|
||||
@ -33,4 +38,12 @@ public class BatteryAveSOCVo {
|
||||
public void setBatterySOC(BigDecimal batterySOC) {
|
||||
this.batterySOC = batterySOC;
|
||||
}
|
||||
|
||||
public String getDateDay() {
|
||||
return dateDay;
|
||||
}
|
||||
|
||||
public void setDateDay(String dateDay) {
|
||||
this.dateDay = dateDay;
|
||||
}
|
||||
}
|
||||
|
||||
@ -8,21 +8,26 @@ import java.util.Date;
|
||||
*
|
||||
*/
|
||||
public class BatteryAveTempVo {
|
||||
/**
|
||||
* 游标显示日期
|
||||
*/
|
||||
private String dateDay;
|
||||
|
||||
/**
|
||||
* 数据时间
|
||||
*/
|
||||
private Date createDate;
|
||||
private String createDate;
|
||||
|
||||
/**
|
||||
* 实时温度
|
||||
*/
|
||||
private BigDecimal batteryTemp;
|
||||
|
||||
public Date getCreateDate() {
|
||||
public String getCreateDate() {
|
||||
return createDate;
|
||||
}
|
||||
|
||||
public void setCreateDate(Date createDate) {
|
||||
public void setCreateDate(String createDate) {
|
||||
this.createDate = createDate;
|
||||
}
|
||||
|
||||
@ -33,4 +38,12 @@ public class BatteryAveTempVo {
|
||||
public void setBatteryTemp(BigDecimal batteryTemp) {
|
||||
this.batteryTemp = batteryTemp;
|
||||
}
|
||||
|
||||
public String getDateDay() {
|
||||
return dateDay;
|
||||
}
|
||||
|
||||
public void setDateDay(String dateDay) {
|
||||
this.dateDay = dateDay;
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,143 @@
|
||||
package com.xzzn.ems.domain.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.xzzn.common.annotation.Excel;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 单站监控-液冷
|
||||
*
|
||||
*/
|
||||
public class CoolingDataViewVo {
|
||||
|
||||
/** 设备名称 */
|
||||
private String deviceName;
|
||||
|
||||
/** 数据更新时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date dataUpdateTime;
|
||||
|
||||
/** 供水温度 */
|
||||
@Excel(name = "供水温度")
|
||||
private BigDecimal gsTemp;
|
||||
|
||||
/** 回水温度 */
|
||||
@Excel(name = "回水温度")
|
||||
private BigDecimal hsTemp;
|
||||
|
||||
/** 供水压力 */
|
||||
@Excel(name = "供水压力")
|
||||
private BigDecimal gsPressure;
|
||||
|
||||
/** 回水压力 */
|
||||
@Excel(name = "回水压力")
|
||||
private BigDecimal hsPressure;
|
||||
|
||||
/** 冷源水温度 */
|
||||
@Excel(name = "冷源水温度")
|
||||
private BigDecimal lysTemp;
|
||||
|
||||
/** VB01开度 */
|
||||
@Excel(name = "VB01开度")
|
||||
private BigDecimal vb01Kd;
|
||||
|
||||
/** VB02开度 */
|
||||
@Excel(name = "VB02开度")
|
||||
private BigDecimal vb02Kd;
|
||||
|
||||
/** 设备唯一标识符 */
|
||||
private String deviceId;
|
||||
|
||||
/** 报警个数 */
|
||||
private int alarmNum;
|
||||
|
||||
public String getDeviceName() {
|
||||
return deviceName;
|
||||
}
|
||||
|
||||
public void setDeviceName(String deviceName) {
|
||||
this.deviceName = deviceName;
|
||||
}
|
||||
|
||||
public Date getDataUpdateTime() {
|
||||
return dataUpdateTime;
|
||||
}
|
||||
|
||||
public void setDataUpdateTime(Date dataUpdateTime) {
|
||||
this.dataUpdateTime = dataUpdateTime;
|
||||
}
|
||||
|
||||
public BigDecimal getGsTemp() {
|
||||
return gsTemp;
|
||||
}
|
||||
|
||||
public void setGsTemp(BigDecimal gsTemp) {
|
||||
this.gsTemp = gsTemp;
|
||||
}
|
||||
|
||||
public BigDecimal getHsTemp() {
|
||||
return hsTemp;
|
||||
}
|
||||
|
||||
public void setHsTemp(BigDecimal hsTemp) {
|
||||
this.hsTemp = hsTemp;
|
||||
}
|
||||
|
||||
public BigDecimal getGsPressure() {
|
||||
return gsPressure;
|
||||
}
|
||||
|
||||
public void setGsPressure(BigDecimal gsPressure) {
|
||||
this.gsPressure = gsPressure;
|
||||
}
|
||||
|
||||
public BigDecimal getHsPressure() {
|
||||
return hsPressure;
|
||||
}
|
||||
|
||||
public void setHsPressure(BigDecimal hsPressure) {
|
||||
this.hsPressure = hsPressure;
|
||||
}
|
||||
|
||||
public BigDecimal getLysTemp() {
|
||||
return lysTemp;
|
||||
}
|
||||
|
||||
public void setLysTemp(BigDecimal lysTemp) {
|
||||
this.lysTemp = lysTemp;
|
||||
}
|
||||
|
||||
public BigDecimal getVb01Kd() {
|
||||
return vb01Kd;
|
||||
}
|
||||
|
||||
public void setVb01Kd(BigDecimal vb01Kd) {
|
||||
this.vb01Kd = vb01Kd;
|
||||
}
|
||||
|
||||
public BigDecimal getVb02Kd() {
|
||||
return vb02Kd;
|
||||
}
|
||||
|
||||
public void setVb02Kd(BigDecimal vb02Kd) {
|
||||
this.vb02Kd = vb02Kd;
|
||||
}
|
||||
|
||||
public String getDeviceId() {
|
||||
return deviceId;
|
||||
}
|
||||
|
||||
public void setDeviceId(String deviceId) {
|
||||
this.deviceId = deviceId;
|
||||
}
|
||||
|
||||
public int getAlarmNum() {
|
||||
return alarmNum;
|
||||
}
|
||||
|
||||
public void setAlarmNum(int alarmNum) {
|
||||
this.alarmNum = alarmNum;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,124 @@
|
||||
package com.xzzn.ems.domain.vo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 综合查询返回-设备数据list
|
||||
*/
|
||||
public class DevicePointDataList
|
||||
{
|
||||
// 设备id
|
||||
private String deviceId;
|
||||
// 父类设备id
|
||||
private String parentDeviceId;
|
||||
// 该设备点位数据list
|
||||
private List<GeneralQueryDataVo> pointValueList;
|
||||
// 最大值&时间
|
||||
private BigDecimal maxValue;
|
||||
private String maxDate;
|
||||
// 最小值&时间
|
||||
private BigDecimal minValue;
|
||||
private String minDate;
|
||||
// 平均值(保留4位小数)
|
||||
private BigDecimal avgValue;
|
||||
// 差值(max - min)
|
||||
private BigDecimal diffValue;
|
||||
|
||||
public DevicePointDataList(String deviceId, List<GeneralQueryDataVo> pointValueList,String parentDeviceId,
|
||||
BigDecimal maxValue, BigDecimal minValue,
|
||||
BigDecimal avgValue, BigDecimal diffValue,
|
||||
String maxDate, String minDate) {
|
||||
this.deviceId = deviceId;
|
||||
this.pointValueList = pointValueList;
|
||||
this.parentDeviceId = parentDeviceId;
|
||||
this.maxValue = maxValue;
|
||||
this.minValue = minValue;
|
||||
this.avgValue = avgValue;
|
||||
this.diffValue = diffValue;
|
||||
this.maxDate = maxDate;
|
||||
this.minDate = minDate;
|
||||
}
|
||||
|
||||
public DevicePointDataList(String deviceId, String parentDeviceId, List<GeneralQueryDataVo> pointValueList) {
|
||||
this.deviceId = deviceId;
|
||||
this.parentDeviceId = parentDeviceId;
|
||||
this.pointValueList = pointValueList;
|
||||
}
|
||||
|
||||
public DevicePointDataList() {
|
||||
|
||||
}
|
||||
|
||||
public String getMaxDate() {
|
||||
return maxDate;
|
||||
}
|
||||
|
||||
public void setMaxDate(String maxDate) {
|
||||
this.maxDate = maxDate;
|
||||
}
|
||||
|
||||
public String getMinDate() {
|
||||
return minDate;
|
||||
}
|
||||
|
||||
public void setMinDate(String minDate) {
|
||||
this.minDate = minDate;
|
||||
}
|
||||
|
||||
public String getDeviceId() {
|
||||
return deviceId;
|
||||
}
|
||||
|
||||
public void setDeviceId(String deviceId) {
|
||||
this.deviceId = deviceId;
|
||||
}
|
||||
|
||||
public List<GeneralQueryDataVo> getPointValueList() {
|
||||
return pointValueList;
|
||||
}
|
||||
|
||||
public void setPointValueList(List<GeneralQueryDataVo> pointValueList) {
|
||||
this.pointValueList = pointValueList;
|
||||
}
|
||||
|
||||
public String getParentDeviceId() {
|
||||
return parentDeviceId;
|
||||
}
|
||||
|
||||
public void setParentDeviceId(String parentDeviceId) {
|
||||
this.parentDeviceId = parentDeviceId;
|
||||
}
|
||||
|
||||
public BigDecimal getMaxValue() {
|
||||
return maxValue;
|
||||
}
|
||||
|
||||
public void setMaxValue(BigDecimal maxValue) {
|
||||
this.maxValue = maxValue;
|
||||
}
|
||||
|
||||
public BigDecimal getMinValue() {
|
||||
return minValue;
|
||||
}
|
||||
|
||||
public void setMinValue(BigDecimal minValue) {
|
||||
this.minValue = minValue;
|
||||
}
|
||||
|
||||
public BigDecimal getAvgValue() {
|
||||
return avgValue;
|
||||
}
|
||||
|
||||
public void setAvgValue(BigDecimal avgValue) {
|
||||
this.avgValue = avgValue;
|
||||
}
|
||||
|
||||
public BigDecimal getDiffValue() {
|
||||
return diffValue;
|
||||
}
|
||||
|
||||
public void setDiffValue(BigDecimal diffValue) {
|
||||
this.diffValue = diffValue;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,121 @@
|
||||
package com.xzzn.ems.domain.vo;
|
||||
|
||||
import com.xzzn.common.annotation.Excel;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 点位清单导出参数
|
||||
*/
|
||||
public class DevicePointMatchExportVo implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 点位匹配字段 */
|
||||
@Excel(name = "点位匹配字段")
|
||||
private String matchField;
|
||||
|
||||
/** 存储点位名称 */
|
||||
@Excel(name = "点位匹配字段名称")
|
||||
private String pointName;
|
||||
|
||||
/** 数据枚举映射-导出枚举名称 */
|
||||
@Excel(name = "数据枚举映射")
|
||||
private String matchFieldEnum;
|
||||
|
||||
/** 数据点位 */
|
||||
@Excel(name = "数据点位")
|
||||
private String dataPoint;
|
||||
|
||||
/** 数据点位名称 */
|
||||
@Excel(name = "数据点位名称")
|
||||
private String dataPointName;
|
||||
|
||||
/** 数据单位 */
|
||||
@Excel(name = "数据单位")
|
||||
private String dataUnit;
|
||||
|
||||
/** 数据枚举 */
|
||||
@Excel(name = "数据枚举")
|
||||
private String dataEnum;
|
||||
|
||||
/** 是否告警点位 */
|
||||
@Excel(name = "是否告警点位", readConverterExp = "0=否,1=是")
|
||||
private String isAlarm;
|
||||
|
||||
/** 寄存器地址 */
|
||||
@Excel(name = "寄存器地址")
|
||||
private String ipAddress;
|
||||
|
||||
public String getPointName() {
|
||||
return pointName;
|
||||
}
|
||||
|
||||
public void setPointName(String pointName) {
|
||||
this.pointName = pointName;
|
||||
}
|
||||
|
||||
public String getMatchField() {
|
||||
return matchField;
|
||||
}
|
||||
|
||||
public void setMatchField(String matchField) {
|
||||
this.matchField = matchField;
|
||||
}
|
||||
|
||||
public String getMatchFieldEnum() {
|
||||
return matchFieldEnum;
|
||||
}
|
||||
|
||||
public void setMatchFieldEnum(String matchFieldEnum) {
|
||||
this.matchFieldEnum = matchFieldEnum;
|
||||
}
|
||||
|
||||
public String getDataPoint() {
|
||||
return dataPoint;
|
||||
}
|
||||
|
||||
public void setDataPoint(String dataPoint) {
|
||||
this.dataPoint = dataPoint;
|
||||
}
|
||||
|
||||
public String getDataPointName() {
|
||||
return dataPointName;
|
||||
}
|
||||
|
||||
public void setDataPointName(String dataPointName) {
|
||||
this.dataPointName = dataPointName;
|
||||
}
|
||||
|
||||
public String getDataUnit() {
|
||||
return dataUnit;
|
||||
}
|
||||
|
||||
public void setDataUnit(String dataUnit) {
|
||||
this.dataUnit = dataUnit;
|
||||
}
|
||||
|
||||
public String getDataEnum() {
|
||||
return dataEnum;
|
||||
}
|
||||
|
||||
public void setDataEnum(String dataEnum) {
|
||||
this.dataEnum = dataEnum;
|
||||
}
|
||||
|
||||
public String getIsAlarm() {
|
||||
return isAlarm;
|
||||
}
|
||||
|
||||
public void setIsAlarm(String isAlarm) {
|
||||
this.isAlarm = isAlarm;
|
||||
}
|
||||
|
||||
public String getIpAddress() {
|
||||
return ipAddress;
|
||||
}
|
||||
|
||||
public void setIpAddress(String ipAddress) {
|
||||
this.ipAddress = ipAddress;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,116 @@
|
||||
package com.xzzn.ems.domain.vo;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class DevicePointMatchInfo {
|
||||
|
||||
private Map<String, String> pcs;
|
||||
|
||||
private Map<String, String> branch;
|
||||
|
||||
private Map<String, String> stack;
|
||||
|
||||
private Map<String, String> cluster;
|
||||
|
||||
private Map<String, String> battery;
|
||||
|
||||
private Map<String, String> ammeterLoad;
|
||||
|
||||
private Map<String, String> ammeterMete;
|
||||
|
||||
private Map<String, String> cooling;
|
||||
|
||||
private Map<String, String> dh;
|
||||
|
||||
private Map<String, String> xf;
|
||||
|
||||
private Map<String, String> batteryGroup;
|
||||
|
||||
public Map<String, String> getPcs() {
|
||||
return pcs;
|
||||
}
|
||||
|
||||
public void setPcs(Map<String, String> pcs) {
|
||||
this.pcs = pcs;
|
||||
}
|
||||
|
||||
public Map<String, String> getBranch() {
|
||||
return branch;
|
||||
}
|
||||
|
||||
public void setBranch(Map<String, String> branch) {
|
||||
this.branch = branch;
|
||||
}
|
||||
|
||||
public Map<String, String> getStack() {
|
||||
return stack;
|
||||
}
|
||||
|
||||
public void setStack(Map<String, String> stack) {
|
||||
this.stack = stack;
|
||||
}
|
||||
|
||||
public Map<String, String> getCluster() {
|
||||
return cluster;
|
||||
}
|
||||
|
||||
public void setCluster(Map<String, String> cluster) {
|
||||
this.cluster = cluster;
|
||||
}
|
||||
|
||||
public Map<String, String> getBattery() {
|
||||
return battery;
|
||||
}
|
||||
|
||||
public void setBattery(Map<String, String> battery) {
|
||||
this.battery = battery;
|
||||
}
|
||||
|
||||
public Map<String, String> getAmmeterLoad() {
|
||||
return ammeterLoad;
|
||||
}
|
||||
|
||||
public void setAmmeterLoad(Map<String, String> ammeterLoad) {
|
||||
this.ammeterLoad = ammeterLoad;
|
||||
}
|
||||
|
||||
public Map<String, String> getAmmeterMete() {
|
||||
return ammeterMete;
|
||||
}
|
||||
|
||||
public void setAmmeterMete(Map<String, String> ammeterMete) {
|
||||
this.ammeterMete = ammeterMete;
|
||||
}
|
||||
|
||||
public Map<String, String> getCooling() {
|
||||
return cooling;
|
||||
}
|
||||
|
||||
public void setCooling(Map<String, String> cooling) {
|
||||
this.cooling = cooling;
|
||||
}
|
||||
|
||||
public Map<String, String> getDh() {
|
||||
return dh;
|
||||
}
|
||||
|
||||
public void setDh(Map<String, String> dh) {
|
||||
this.dh = dh;
|
||||
}
|
||||
|
||||
public Map<String, String> getXf() {
|
||||
return xf;
|
||||
}
|
||||
|
||||
public void setXf(Map<String, String> xf) {
|
||||
this.xf = xf;
|
||||
}
|
||||
|
||||
public Map<String, String> getBatteryGroup() {
|
||||
return batteryGroup;
|
||||
}
|
||||
|
||||
public void setBatteryGroup(Map<String, String> batteryGroup) {
|
||||
this.batteryGroup = batteryGroup;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,132 @@
|
||||
package com.xzzn.ems.domain.vo;
|
||||
|
||||
import com.xzzn.common.annotation.Excel;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 点位清单上传参数
|
||||
*/
|
||||
public class DevicePointMatchVo implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 点位匹配字段 */
|
||||
@Excel(name = "点位匹配字段")
|
||||
private String matchField;
|
||||
|
||||
/** 存储点位名称 */
|
||||
@Excel(name = "点位匹配字段名称")
|
||||
private String pointName;
|
||||
|
||||
/** 数据枚举映射 */
|
||||
@Excel(name = "数据枚举映射")
|
||||
private String matchFieldEnum;
|
||||
|
||||
/** 数据点位 */
|
||||
@Excel(name = "数据点位")
|
||||
private String dataPoint;
|
||||
|
||||
/** 数据点位名称 */
|
||||
@Excel(name = "数据点位名称")
|
||||
private String dataPointName;
|
||||
|
||||
/** 数据单位 */
|
||||
@Excel(name = "数据单位")
|
||||
private String dataUnit;
|
||||
|
||||
/** 数据枚举 */
|
||||
@Excel(name = "数据枚举")
|
||||
private String dataEnum;
|
||||
|
||||
/** 是否告警点位 */
|
||||
@Excel(name = "是否告警点位", readConverterExp = "0=否,1=是")
|
||||
private String isAlarm;
|
||||
|
||||
/** 寄存器地址 */
|
||||
@Excel(name = "寄存器地址")
|
||||
private String ipAddress;
|
||||
|
||||
/** 错误信息 */
|
||||
@Excel(name = "错误信息")
|
||||
private String errorMsg;
|
||||
|
||||
public String getPointName() {
|
||||
return pointName;
|
||||
}
|
||||
|
||||
public void setPointName(String pointName) {
|
||||
this.pointName = pointName;
|
||||
}
|
||||
|
||||
public String getMatchField() {
|
||||
return matchField;
|
||||
}
|
||||
|
||||
public void setMatchField(String matchField) {
|
||||
this.matchField = matchField;
|
||||
}
|
||||
|
||||
public String getMatchFieldEnum() {
|
||||
return matchFieldEnum;
|
||||
}
|
||||
|
||||
public void setMatchFieldEnum(String matchFieldEnum) {
|
||||
this.matchFieldEnum = matchFieldEnum;
|
||||
}
|
||||
|
||||
public String getDataEnum() {
|
||||
return dataEnum;
|
||||
}
|
||||
|
||||
public void setDataEnum(String dataEnum) {
|
||||
this.dataEnum = dataEnum;
|
||||
}
|
||||
|
||||
public String getDataPoint() {
|
||||
return dataPoint;
|
||||
}
|
||||
|
||||
public void setDataPoint(String dataPoint) {
|
||||
this.dataPoint = dataPoint;
|
||||
}
|
||||
|
||||
public String getDataPointName() {
|
||||
return dataPointName;
|
||||
}
|
||||
|
||||
public void setDataPointName(String dataPointName) {
|
||||
this.dataPointName = dataPointName;
|
||||
}
|
||||
|
||||
public String getDataUnit() {
|
||||
return dataUnit;
|
||||
}
|
||||
|
||||
public void setDataUnit(String dataUnit) {
|
||||
this.dataUnit = dataUnit;
|
||||
}
|
||||
|
||||
public String getIsAlarm() {
|
||||
return isAlarm;
|
||||
}
|
||||
|
||||
public void setIsAlarm(String isAlarm) {
|
||||
this.isAlarm = isAlarm;
|
||||
}
|
||||
|
||||
public String getIpAddress() {
|
||||
return ipAddress;
|
||||
}
|
||||
|
||||
public void setIpAddress(String ipAddress) {
|
||||
this.ipAddress = ipAddress;
|
||||
}
|
||||
|
||||
public String getErrorMsg() {
|
||||
return errorMsg;
|
||||
}
|
||||
|
||||
public void setErrorMsg(String errorMsg) {
|
||||
this.errorMsg = errorMsg;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,56 @@
|
||||
package com.xzzn.ems.domain.vo;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
/**
|
||||
* 设备信息更新入参
|
||||
*
|
||||
*/
|
||||
public class DeviceUpdateRequest {
|
||||
|
||||
/** 站点id */
|
||||
@NotBlank(message = "站点ID不能为空")
|
||||
private String siteId;
|
||||
|
||||
/** 设备id */
|
||||
@NotBlank(message = "设备ID不能为空")
|
||||
private String deviceId;
|
||||
|
||||
/** 设备状态:0-离线、1-待机、2-运行、3-故障、4-停机 */
|
||||
private String deviceStatus;
|
||||
|
||||
/** 设备类型 */
|
||||
private String deviceCategory;
|
||||
|
||||
public String getSiteId() {
|
||||
return siteId;
|
||||
}
|
||||
|
||||
public void setSiteId(String siteId) {
|
||||
this.siteId = siteId;
|
||||
}
|
||||
|
||||
public String getDeviceId() {
|
||||
return deviceId;
|
||||
}
|
||||
|
||||
public void setDeviceId(String deviceId) {
|
||||
this.deviceId = deviceId;
|
||||
}
|
||||
|
||||
public String getDeviceStatus() {
|
||||
return deviceStatus;
|
||||
}
|
||||
|
||||
public void setDeviceStatus(String deviceStatus) {
|
||||
this.deviceStatus = deviceStatus;
|
||||
}
|
||||
|
||||
public String getDeviceCategory() {
|
||||
return deviceCategory;
|
||||
}
|
||||
|
||||
public void setDeviceCategory(String deviceCategory) {
|
||||
this.deviceCategory = deviceCategory;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,80 @@
|
||||
package com.xzzn.ems.domain.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.xzzn.common.annotation.Excel;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 动环数据
|
||||
*/
|
||||
public class DhDataVo {
|
||||
|
||||
/** 设备唯一标识符 */
|
||||
private String deviceId;
|
||||
|
||||
/** 数据更新时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date dataUpdateTime;
|
||||
|
||||
/** 动环名称 */
|
||||
private String deviceName;
|
||||
|
||||
/** 湿度 */
|
||||
private BigDecimal humidity;
|
||||
|
||||
/** 温度 */
|
||||
private BigDecimal temperature;
|
||||
|
||||
/** 报警个数 */
|
||||
private int alarmNum;
|
||||
|
||||
public String getDeviceId() {
|
||||
return deviceId;
|
||||
}
|
||||
|
||||
public void setDeviceId(String deviceId) {
|
||||
this.deviceId = deviceId;
|
||||
}
|
||||
|
||||
public Date getDataUpdateTime() {
|
||||
return dataUpdateTime;
|
||||
}
|
||||
|
||||
public void setDataUpdateTime(Date dataUpdateTime) {
|
||||
this.dataUpdateTime = dataUpdateTime;
|
||||
}
|
||||
|
||||
public String getDeviceName() {
|
||||
return deviceName;
|
||||
}
|
||||
|
||||
public void setDeviceName(String deviceName) {
|
||||
this.deviceName = deviceName;
|
||||
}
|
||||
|
||||
public BigDecimal getHumidity() {
|
||||
return humidity;
|
||||
}
|
||||
|
||||
public void setHumidity(BigDecimal humidity) {
|
||||
this.humidity = humidity;
|
||||
}
|
||||
|
||||
public BigDecimal getTemperature() {
|
||||
return temperature;
|
||||
}
|
||||
|
||||
public void setTemperature(BigDecimal temperature) {
|
||||
this.temperature = temperature;
|
||||
}
|
||||
|
||||
public int getAlarmNum() {
|
||||
return alarmNum;
|
||||
}
|
||||
|
||||
public void setAlarmNum(int alarmNum) {
|
||||
this.alarmNum = alarmNum;
|
||||
}
|
||||
}
|
||||
168
ems-system/src/main/java/com/xzzn/ems/domain/vo/EmsDataVo.java
Normal file
168
ems-system/src/main/java/com/xzzn/ems/domain/vo/EmsDataVo.java
Normal file
@ -0,0 +1,168 @@
|
||||
package com.xzzn.ems.domain.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.xzzn.common.annotation.Excel;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* EMS数据
|
||||
*/
|
||||
public class EmsDataVo {
|
||||
|
||||
/** 设备唯一标识符 */
|
||||
private String deviceId;
|
||||
|
||||
/** 设备名称 */
|
||||
private String deviceName;
|
||||
|
||||
/** EMS控制模式 */
|
||||
private BigDecimal emsStatus;
|
||||
|
||||
/** 数据更新时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date dataUpdateTime;
|
||||
|
||||
/** BMS1SOC */
|
||||
private BigDecimal bms1Soc;
|
||||
|
||||
/** BMS2SOC */
|
||||
private BigDecimal bms2Soc;
|
||||
|
||||
/** BMS3SOC */
|
||||
private BigDecimal bms3Soc;
|
||||
|
||||
/** BMS4SOC */
|
||||
private BigDecimal bms4Soc;
|
||||
|
||||
/** PCS-1有功功率 */
|
||||
private BigDecimal pcs1Yggl;
|
||||
|
||||
/** PCS-2有功功率 */
|
||||
private BigDecimal pcs2Yggl;
|
||||
|
||||
/** PCS-3有功功率 */
|
||||
private BigDecimal pcs3Yggl;
|
||||
|
||||
/** PCS-4有功功率 */
|
||||
private BigDecimal pcs4Yggl;
|
||||
|
||||
/** EMS有功功率 */
|
||||
private BigDecimal emsYggl;
|
||||
|
||||
/** 报警个数 */
|
||||
private int alarmNum;
|
||||
|
||||
public String getDeviceId() {
|
||||
return deviceId;
|
||||
}
|
||||
|
||||
public void setDeviceId(String deviceId) {
|
||||
this.deviceId = deviceId;
|
||||
}
|
||||
|
||||
public String getDeviceName() {
|
||||
return deviceName;
|
||||
}
|
||||
|
||||
public void setDeviceName(String deviceName) {
|
||||
this.deviceName = deviceName;
|
||||
}
|
||||
|
||||
public BigDecimal getEmsStatus() {
|
||||
return emsStatus;
|
||||
}
|
||||
|
||||
public void setEmsStatus(BigDecimal emsStatus) {
|
||||
this.emsStatus = emsStatus;
|
||||
}
|
||||
|
||||
public Date getDataUpdateTime() {
|
||||
return dataUpdateTime;
|
||||
}
|
||||
|
||||
public void setDataUpdateTime(Date dataUpdateTime) {
|
||||
this.dataUpdateTime = dataUpdateTime;
|
||||
}
|
||||
|
||||
public BigDecimal getBms1Soc() {
|
||||
return bms1Soc;
|
||||
}
|
||||
|
||||
public void setBms1Soc(BigDecimal bms1Soc) {
|
||||
this.bms1Soc = bms1Soc;
|
||||
}
|
||||
|
||||
public BigDecimal getBms2Soc() {
|
||||
return bms2Soc;
|
||||
}
|
||||
|
||||
public void setBms2Soc(BigDecimal bms2Soc) {
|
||||
this.bms2Soc = bms2Soc;
|
||||
}
|
||||
|
||||
public BigDecimal getBms3Soc() {
|
||||
return bms3Soc;
|
||||
}
|
||||
|
||||
public void setBms3Soc(BigDecimal bms3Soc) {
|
||||
this.bms3Soc = bms3Soc;
|
||||
}
|
||||
|
||||
public BigDecimal getBms4Soc() {
|
||||
return bms4Soc;
|
||||
}
|
||||
|
||||
public void setBms4Soc(BigDecimal bms4Soc) {
|
||||
this.bms4Soc = bms4Soc;
|
||||
}
|
||||
|
||||
public BigDecimal getPcs1Yggl() {
|
||||
return pcs1Yggl;
|
||||
}
|
||||
|
||||
public void setPcs1Yggl(BigDecimal pcs1Yggl) {
|
||||
this.pcs1Yggl = pcs1Yggl;
|
||||
}
|
||||
|
||||
public BigDecimal getPcs2Yggl() {
|
||||
return pcs2Yggl;
|
||||
}
|
||||
|
||||
public void setPcs2Yggl(BigDecimal pcs2Yggl) {
|
||||
this.pcs2Yggl = pcs2Yggl;
|
||||
}
|
||||
|
||||
public BigDecimal getPcs3Yggl() {
|
||||
return pcs3Yggl;
|
||||
}
|
||||
|
||||
public void setPcs3Yggl(BigDecimal pcs3Yggl) {
|
||||
this.pcs3Yggl = pcs3Yggl;
|
||||
}
|
||||
|
||||
public BigDecimal getPcs4Yggl() {
|
||||
return pcs4Yggl;
|
||||
}
|
||||
|
||||
public void setPcs4Yggl(BigDecimal pcs4Yggl) {
|
||||
this.pcs4Yggl = pcs4Yggl;
|
||||
}
|
||||
|
||||
public BigDecimal getEmsYggl() {
|
||||
return emsYggl;
|
||||
}
|
||||
|
||||
public void setEmsYggl(BigDecimal emsYggl) {
|
||||
this.emsYggl = emsYggl;
|
||||
}
|
||||
|
||||
public int getAlarmNum() {
|
||||
return alarmNum;
|
||||
}
|
||||
|
||||
public void setAlarmNum(int alarmNum) {
|
||||
this.alarmNum = alarmNum;
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user