From 83eff7d1ee6c3cd8eb1e4f65cabd406577170359 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 18 Sep 2025 14:05:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=B7=E5=A4=96=E5=B9=B3=E5=8F=B0-=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=85=A8=E8=8B=B1=E6=96=87=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ho/business/entity/Device.java | 6 + .../com/ho/business/entity/DeviceCall.java | 6 + .../ho/business/entity/HisCurveRelate.java | 15 + .../entity/PlanCurveOperationRecordReq.java | 6 + .../entity/PlanningCurveTemplate.java | 6 + .../business/entity/PlanningIssueDevice.java | 3 + .../com/ho/business/entity/PointConfig.java | 3 + ...ranslateNation.java => TranslateName.java} | 5 +- .../ho/business/entity/VirtualDeviceCol.java | 5 +- .../com/ho/business/vo/req/DeviceReqVO.java | 3 + .../business/vo/req/DeviceTypeColReqVO.java | 3 + .../com/ho/business/vo/req/StationReq.java | 4 + .../vo/req/carbin/EarningsCalculateReq.java | 3 +- .../business/vo/req/device/DeviceTreeReq.java | 3 + .../req/dynamicConfig/DynamicConfigQuery.java | 3 + .../vo/req/dynamicConfig/PointConfigAdd.java | 3 + .../req/dynamicConfig/PointConfigQuery.java | 3 + .../vo/req/modelType/ModelTypeQueryReq.java | 3 + .../business/vo/req/point/PointCurveReq.java | 3 + .../ho/business/vo/req/point/PointReq.java | 3 + .../com/ho/business/vo/req/point/PointVo.java | 3 + .../ElecPriceTemplateExcelEn.java | 66 ++ .../business/vo/resp/point/PointRespEnVO.java | 74 ++ .../com/ho/business/mapper/DeviceMapper.java | 2 +- .../business/mapper/DeviceTypeColMapper.java | 6 +- .../mapper/PlanningCurveIssueMapper.java | 2 +- .../ho/business/mapper/PointConfigMapper.java | 9 + .../mapper/PointPolysemyConfigMapper.java | 2 +- .../business/mapper/TranslateNameMapper.java | 28 + .../mapper/TranslateNationMapper.java | 21 - .../ho/business/service/DeviceService.java | 11 +- .../service/DeviceTypeColService.java | 6 +- .../service/DynamicConfigService.java | 8 + .../business/service/OpenStationService.java | 2 +- .../service/PlanningCurveIssueService.java | 2 +- .../service/impl/DeviceModelServiceImpl.java | 4 +- .../service/impl/DeviceServiceImpl.java | 41 +- .../impl/DeviceTypeColServiceImpl.java | 14 +- .../impl/DynamicConfigServiceImpl.java | 68 +- .../impl/EarningsCalculateServiceImpl.java | 10 +- .../impl/HisCurveRelateServiceImpl.java | 8 + .../impl/IargeScreenShowServiceImpl.java | 59 +- .../service/impl/InverterServiceImpl.java | 2 +- .../service/impl/ModelDeviceServiceImpl.java | 2 +- .../service/impl/OpenStationServiceImpl.java | 55 +- .../impl/PlanningCurveIssueServiceImpl.java | 19 +- .../impl/PlanningCurveServiceImpl.java | 14 + .../service/impl/PointDemoServiceImpl.java | 55 +- .../service/impl/StationHomeServiceImpl.java | 19 +- .../service/impl/StationServiceImpl.java | 5 +- .../impl/VirtualDeviceColServiceImpl.java | 2 +- .../resources/mapper/CurveConfigMapper.xml | 11 +- .../main/resources/mapper/DeviceMapper.xml | 30 +- .../resources/mapper/DeviceTypeColMapper.xml | 46 +- .../resources/mapper/HisCurveRelateMapper.xml | 24 +- .../mapper/PlanningCurveIssueMapper.xml | 53 +- .../resources/mapper/PlanningCurveMapper.xml | 63 +- .../resources/mapper/PointConfigMapper.xml | 35 +- .../mapper/PointPolysemyConfigMapper.xml | 14 +- .../resources/mapper/TranslateNameMapper.xml | 30 + .../mapper/TranslateNationMapper.xml | 15 - .../mapper/VirtualDeviceColMapper.xml | 11 +- .../ho/business/config/BizMergeStrategy.java | 3 +- .../config/NotSportEnOperationAspect.java | 49 ++ .../controller/AutoDeviceCurveController.java | 4 +- .../business/controller/CabinController.java | 4 +- .../business/controller/DeviceController.java | 32 +- .../controller/DeviceTypeColController.java | 2 +- .../controller/DynamicConfigController.java | 29 +- .../EarningsCalculateController.java | 21 +- .../controller/ElecPriceCurveController.java | 26 +- .../controller/HisCurveRelateController.java | 1 + .../controller/IargeScreenShowController.java | 2 +- .../controller/OpenStationController.java | 14 +- .../controller/PlanningCurveController.java | 6 +- .../PlanningCurveIssueController.java | 13 +- .../controller/PointDemoController.java | 35 +- .../controller/RevenueOverviewController.java | 11 +- .../StrategyOverviewController.java | 19 +- .../resources/template/RevenueOverview.xlsx | Bin 11060 -> 15240 bytes .../template/RevenueOverviewen_US.xlsx | Bin 11085 -> 15250 bytes .../resources/template/earningsTemplate.xlsx | Bin 10201 -> 14558 bytes .../template/earningsTemplateen_US.xlsx | Bin 10401 -> 14547 bytes .../template/earningsUserTemplate.xlsx | Bin 9676 -> 14008 bytes .../template/earningsUserTemplateen_US.xlsx | Bin 9849 -> 13990 bytes .../test/java/com/ho/business/TestReport.java | 2 +- .../tools/annotation/NotSportEnOperation.java | 15 + .../common/tools/constant/CommonConstant.java | 13 + .../common/tools/constant/DefineConstant.java | 9 + .../tools/constant/RedisKeyConstant.java | 2 + .../tools/exception/BaseResponseCode.java | 1 + .../ho/common/tools/util/TranslateUtils.java | 27 +- .../impl/DeviceDataCollectServiceImpl.java | 6 + .../filecenter/controller/FileController.java | 39 +- .../controller/HeartbeatCheckController.java | 22 +- .../controller/OrderSendController.java | 48 +- .../src/main/resources/template/template.xls | Bin 24064 -> 28160 bytes .../src/main/java/com/ho/flow/vo/Event.java | 3 + .../src/main/java/com/ho/flow/vo/EventVo.java | 18 + .../com/ho/flow/vo/req/event/DropDownReq.java | 4 + .../ho/flow/vo/req/event/EventReqPageVO.java | 3 + .../java/com/ho/flow/mapper/EventMapper.java | 7 + .../ho/flow/mapper/TranslateNameMapper.java | 26 + .../com/ho/flow/service/EventService.java | 8 + .../flow/service/impl/EventServiceImpl.java | 61 ++ .../src/main/resources/mapper/EventMapper.xml | 41 +- .../resources/mapper/TranslateNameMapper.xml | 30 + flowable-center/pom.xml | 34 +- .../ho/flow/controller/EventController.java | 21 + .../ho/flow/service/FlowOutApiService.java | 33 + .../service/impl/FlowOutApiServiceImpl.java | 711 ++++++++++++++++++ .../main/resources/lib/flowable-src-1.0.jar | Bin 16301 -> 0 bytes 112 files changed, 2151 insertions(+), 344 deletions(-) rename business-service-api/src/main/java/com/ho/business/entity/{TranslateNation.java => TranslateName.java} (80%) create mode 100644 business-service-api/src/main/java/com/ho/business/vo/resp/elecPriceCurve/ElecPriceTemplateExcelEn.java create mode 100644 business-service-api/src/main/java/com/ho/business/vo/resp/point/PointRespEnVO.java create mode 100644 business-service-dao/src/main/java/com/ho/business/mapper/TranslateNameMapper.java delete mode 100644 business-service-dao/src/main/java/com/ho/business/mapper/TranslateNationMapper.java create mode 100644 business-service-dao/src/main/resources/mapper/TranslateNameMapper.xml delete mode 100644 business-service-dao/src/main/resources/mapper/TranslateNationMapper.xml create mode 100644 business-service/src/main/java/com/ho/business/config/NotSportEnOperationAspect.java create mode 100644 common-tools/src/main/java/com/ho/common/tools/annotation/NotSportEnOperation.java create mode 100644 flowable-center-api/src/main/java/com/ho/flow/vo/EventVo.java create mode 100644 flowable-center-dao/src/main/java/com/ho/flow/mapper/TranslateNameMapper.java create mode 100644 flowable-center-dao/src/main/resources/mapper/TranslateNameMapper.xml create mode 100644 flowable-center/src/main/java/com/ho/flow/service/FlowOutApiService.java create mode 100644 flowable-center/src/main/java/com/ho/flow/service/impl/FlowOutApiServiceImpl.java delete mode 100644 flowable-center/src/main/resources/lib/flowable-src-1.0.jar diff --git a/business-service-api/src/main/java/com/ho/business/entity/Device.java b/business-service-api/src/main/java/com/ho/business/entity/Device.java index d20f024..f36010a 100644 --- a/business-service-api/src/main/java/com/ho/business/entity/Device.java +++ b/business-service-api/src/main/java/com/ho/business/entity/Device.java @@ -55,6 +55,12 @@ public class Device implements Serializable { @ApiModelProperty(value = "设备名字") private String deviceName; + /** + * 设备名字-英文 + */ + @ApiModelProperty(value = "设备名字-英文") + private String deviceNameEn; + @ApiModelProperty(value = "设备类型") private String deviceType; diff --git a/business-service-api/src/main/java/com/ho/business/entity/DeviceCall.java b/business-service-api/src/main/java/com/ho/business/entity/DeviceCall.java index 90102b3..dd32468 100644 --- a/business-service-api/src/main/java/com/ho/business/entity/DeviceCall.java +++ b/business-service-api/src/main/java/com/ho/business/entity/DeviceCall.java @@ -55,6 +55,12 @@ public class DeviceCall implements Serializable { @ApiModelProperty(value = "设备名字") private String deviceName; + /** + * 设备名字-英文 + */ + @ApiModelProperty(value = "设备名字-英文") + private String deviceNameEn; + @ApiModelProperty(value = "设备类型") private String deviceType; diff --git a/business-service-api/src/main/java/com/ho/business/entity/HisCurveRelate.java b/business-service-api/src/main/java/com/ho/business/entity/HisCurveRelate.java index 68e1c87..3c43b80 100644 --- a/business-service-api/src/main/java/com/ho/business/entity/HisCurveRelate.java +++ b/business-service-api/src/main/java/com/ho/business/entity/HisCurveRelate.java @@ -42,6 +42,13 @@ public class HisCurveRelate implements Serializable { private String modelName; + /** + * 模板名称-英文 + */ + + private String modelNameEn; + + /** * srcId */ @@ -59,6 +66,11 @@ public class HisCurveRelate implements Serializable { */ private String colName; + /** + * 字段英文名称 + */ + private String colNameEn; + /** * 设备类型 */ @@ -67,4 +79,7 @@ public class HisCurveRelate implements Serializable { List list; + @ApiModelProperty(value = "中英切换-查询字段") + private String lang; + } \ No newline at end of file diff --git a/business-service-api/src/main/java/com/ho/business/entity/PlanCurveOperationRecordReq.java b/business-service-api/src/main/java/com/ho/business/entity/PlanCurveOperationRecordReq.java index 056c179..13653ab 100644 --- a/business-service-api/src/main/java/com/ho/business/entity/PlanCurveOperationRecordReq.java +++ b/business-service-api/src/main/java/com/ho/business/entity/PlanCurveOperationRecordReq.java @@ -21,9 +21,15 @@ public class PlanCurveOperationRecordReq { @ApiModelProperty(value = "操作内容") String operateContent; + @ApiModelProperty(value = "操作内容-英文") + String operateContentEn; + @ApiModelProperty(value = "操作结果") String operateResult; + @ApiModelProperty(value = "操作结果-英文") + String operateResultEn; + @ApiModelProperty(value = "生效时间") String effectiveTime; diff --git a/business-service-api/src/main/java/com/ho/business/entity/PlanningCurveTemplate.java b/business-service-api/src/main/java/com/ho/business/entity/PlanningCurveTemplate.java index 83542bd..bdaecca 100644 --- a/business-service-api/src/main/java/com/ho/business/entity/PlanningCurveTemplate.java +++ b/business-service-api/src/main/java/com/ho/business/entity/PlanningCurveTemplate.java @@ -26,6 +26,9 @@ public class PlanningCurveTemplate { /* 模板名称 */ private String templateName; + /* 模板名称-英文 */ + private String templateNameEn; + /* 电价模板id */ //private Integer elecTemplateId; @@ -69,4 +72,7 @@ public class PlanningCurveTemplate { /* 计划曲线列表数据 */ private List planningCurves; + + @ApiModelProperty(value = "中英切换-查询字段") + private String lang; } diff --git a/business-service-api/src/main/java/com/ho/business/entity/PlanningIssueDevice.java b/business-service-api/src/main/java/com/ho/business/entity/PlanningIssueDevice.java index 2c7a4ca..03d9b02 100644 --- a/business-service-api/src/main/java/com/ho/business/entity/PlanningIssueDevice.java +++ b/business-service-api/src/main/java/com/ho/business/entity/PlanningIssueDevice.java @@ -1,6 +1,7 @@ package com.ho.business.entity; import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.util.Date; @@ -22,4 +23,6 @@ public class PlanningIssueDevice { @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") private Date operationDate; + @ApiModelProperty(value = "中英切换-查询字段") + private String lang; } diff --git a/business-service-api/src/main/java/com/ho/business/entity/PointConfig.java b/business-service-api/src/main/java/com/ho/business/entity/PointConfig.java index a596623..132f181 100644 --- a/business-service-api/src/main/java/com/ho/business/entity/PointConfig.java +++ b/business-service-api/src/main/java/com/ho/business/entity/PointConfig.java @@ -25,6 +25,9 @@ public class PointConfig implements Serializable { @ApiModelProperty(value = "默认值") private String defaultValue; + @ApiModelProperty(value = "默认值-英文") + private String defaultValueEn; + @ApiModelProperty(value = "配置点类型") private Integer pointType; diff --git a/business-service-api/src/main/java/com/ho/business/entity/TranslateNation.java b/business-service-api/src/main/java/com/ho/business/entity/TranslateName.java similarity index 80% rename from business-service-api/src/main/java/com/ho/business/entity/TranslateNation.java rename to business-service-api/src/main/java/com/ho/business/entity/TranslateName.java index 2628b5a..faaa502 100644 --- a/business-service-api/src/main/java/com/ho/business/entity/TranslateNation.java +++ b/business-service-api/src/main/java/com/ho/business/entity/TranslateName.java @@ -5,11 +5,12 @@ import lombok.Data; import java.io.Serializable; + /** - * @TableName translate_nation + * @author kerwin */ @Data -public class TranslateNation implements Serializable { +public class TranslateName implements Serializable { @ApiModelProperty(value = "id") private Integer id; diff --git a/business-service-api/src/main/java/com/ho/business/entity/VirtualDeviceCol.java b/business-service-api/src/main/java/com/ho/business/entity/VirtualDeviceCol.java index f71f355..e181f7e 100644 --- a/business-service-api/src/main/java/com/ho/business/entity/VirtualDeviceCol.java +++ b/business-service-api/src/main/java/com/ho/business/entity/VirtualDeviceCol.java @@ -41,5 +41,8 @@ public class VirtualDeviceCol implements Serializable { private String name; //查询条件,非数据库中列 - List typeList;; + List typeList; + + @ApiModelProperty(value = "中英切换-查询字段") + private String lang; } \ No newline at end of file diff --git a/business-service-api/src/main/java/com/ho/business/vo/req/DeviceReqVO.java b/business-service-api/src/main/java/com/ho/business/vo/req/DeviceReqVO.java index 3290816..1c35056 100644 --- a/business-service-api/src/main/java/com/ho/business/vo/req/DeviceReqVO.java +++ b/business-service-api/src/main/java/com/ho/business/vo/req/DeviceReqVO.java @@ -77,4 +77,7 @@ public class DeviceReqVO { @ApiModelProperty(hidden = true,value = "获取设备类型不为空的第一个设备") private Integer needDeviceTypeNotNull; + + @ApiModelProperty(value = "中英切换-查询字段") + private String lang; } diff --git a/business-service-api/src/main/java/com/ho/business/vo/req/DeviceTypeColReqVO.java b/business-service-api/src/main/java/com/ho/business/vo/req/DeviceTypeColReqVO.java index 7f39d3e..06632c9 100644 --- a/business-service-api/src/main/java/com/ho/business/vo/req/DeviceTypeColReqVO.java +++ b/business-service-api/src/main/java/com/ho/business/vo/req/DeviceTypeColReqVO.java @@ -32,4 +32,7 @@ public class DeviceTypeColReqVO { * 遥信遥测 1遥信 2遥测 3遥控 默认送2 */ Integer sensType; + + @ApiModelProperty(value = "中英切换-查询字段") + private String lang; } diff --git a/business-service-api/src/main/java/com/ho/business/vo/req/StationReq.java b/business-service-api/src/main/java/com/ho/business/vo/req/StationReq.java index 6a98918..3897ae6 100644 --- a/business-service-api/src/main/java/com/ho/business/vo/req/StationReq.java +++ b/business-service-api/src/main/java/com/ho/business/vo/req/StationReq.java @@ -29,4 +29,8 @@ public class StationReq implements Serializable { @ApiModelProperty(value = "设备类型",hidden = true) String deviceType; + + @ApiModelProperty(value = "中英切换-查询字段") + String lang; + } diff --git a/business-service-api/src/main/java/com/ho/business/vo/req/carbin/EarningsCalculateReq.java b/business-service-api/src/main/java/com/ho/business/vo/req/carbin/EarningsCalculateReq.java index d5749f5..e1b50d7 100644 --- a/business-service-api/src/main/java/com/ho/business/vo/req/carbin/EarningsCalculateReq.java +++ b/business-service-api/src/main/java/com/ho/business/vo/req/carbin/EarningsCalculateReq.java @@ -34,6 +34,7 @@ public class EarningsCalculateReq { @ApiModelProperty(value = "结束时间",hidden = true) String endTime; - + @ApiModelProperty(value = "中英切换-查询字段") + private String lang; } diff --git a/business-service-api/src/main/java/com/ho/business/vo/req/device/DeviceTreeReq.java b/business-service-api/src/main/java/com/ho/business/vo/req/device/DeviceTreeReq.java index 86cdacd..19c591d 100644 --- a/business-service-api/src/main/java/com/ho/business/vo/req/device/DeviceTreeReq.java +++ b/business-service-api/src/main/java/com/ho/business/vo/req/device/DeviceTreeReq.java @@ -17,4 +17,7 @@ public class DeviceTreeReq { @ApiModelProperty(value = "src_id") Integer srcId; + @ApiModelProperty(value = "中英切换-查询字段") + private String lang; + } diff --git a/business-service-api/src/main/java/com/ho/business/vo/req/dynamicConfig/DynamicConfigQuery.java b/business-service-api/src/main/java/com/ho/business/vo/req/dynamicConfig/DynamicConfigQuery.java index 525e52f..bded2b7 100644 --- a/business-service-api/src/main/java/com/ho/business/vo/req/dynamicConfig/DynamicConfigQuery.java +++ b/business-service-api/src/main/java/com/ho/business/vo/req/dynamicConfig/DynamicConfigQuery.java @@ -35,4 +35,7 @@ public class DynamicConfigQuery { @ApiModelProperty(value = "是否隐藏(0否,1是,默认0)",hidden = true) private Integer isHide; + + @ApiModelProperty(value = "中英切换-查询字段") + private String lang; } diff --git a/business-service-api/src/main/java/com/ho/business/vo/req/dynamicConfig/PointConfigAdd.java b/business-service-api/src/main/java/com/ho/business/vo/req/dynamicConfig/PointConfigAdd.java index 64e7725..5250e5d 100644 --- a/business-service-api/src/main/java/com/ho/business/vo/req/dynamicConfig/PointConfigAdd.java +++ b/business-service-api/src/main/java/com/ho/business/vo/req/dynamicConfig/PointConfigAdd.java @@ -21,6 +21,9 @@ public class PointConfigAdd { @ApiModelProperty(value = "默认值") private String defaultValue; + @ApiModelProperty(value = "默认值-英文") + private String defaultValueEn; + @ApiModelProperty(value = "配置点类型") private Integer pointType; diff --git a/business-service-api/src/main/java/com/ho/business/vo/req/dynamicConfig/PointConfigQuery.java b/business-service-api/src/main/java/com/ho/business/vo/req/dynamicConfig/PointConfigQuery.java index a99f3cc..fd1a525 100644 --- a/business-service-api/src/main/java/com/ho/business/vo/req/dynamicConfig/PointConfigQuery.java +++ b/business-service-api/src/main/java/com/ho/business/vo/req/dynamicConfig/PointConfigQuery.java @@ -20,4 +20,7 @@ public class PointConfigQuery { @ApiModelProperty(value = "设备id(用以区分属于哪个设备页)") private Integer deviceId; + + @ApiModelProperty(value = "中英切换-查询字段") + private String lang; } diff --git a/business-service-api/src/main/java/com/ho/business/vo/req/modelType/ModelTypeQueryReq.java b/business-service-api/src/main/java/com/ho/business/vo/req/modelType/ModelTypeQueryReq.java index f1c3b0f..aa06428 100644 --- a/business-service-api/src/main/java/com/ho/business/vo/req/modelType/ModelTypeQueryReq.java +++ b/business-service-api/src/main/java/com/ho/business/vo/req/modelType/ModelTypeQueryReq.java @@ -28,4 +28,7 @@ public class ModelTypeQueryReq { @ApiModelProperty(value = "用户id",hidden = true) private String userId; + + @ApiModelProperty(value = "中英切换-查询字段") + private String lang; } diff --git a/business-service-api/src/main/java/com/ho/business/vo/req/point/PointCurveReq.java b/business-service-api/src/main/java/com/ho/business/vo/req/point/PointCurveReq.java index 596ea6f..1c41b08 100644 --- a/business-service-api/src/main/java/com/ho/business/vo/req/point/PointCurveReq.java +++ b/business-service-api/src/main/java/com/ho/business/vo/req/point/PointCurveReq.java @@ -49,4 +49,7 @@ public class PointCurveReq { @ApiModelProperty(value = "是否为策略总览页面(1:是;0:否)") Integer isStrategy; + + @ApiModelProperty(value = "中英切换-查询字段") + private String lang; } diff --git a/business-service-api/src/main/java/com/ho/business/vo/req/point/PointReq.java b/business-service-api/src/main/java/com/ho/business/vo/req/point/PointReq.java index 97d648b..d651065 100644 --- a/business-service-api/src/main/java/com/ho/business/vo/req/point/PointReq.java +++ b/business-service-api/src/main/java/com/ho/business/vo/req/point/PointReq.java @@ -42,5 +42,8 @@ public class PointReq { @ApiModelProperty(value = "值2的定义 大于1 小于2 等于3 大于等于4 小于等于5") private BigDecimal Value2; + @ApiModelProperty(value = "中英切换-查询字段") + private String lang; + } diff --git a/business-service-api/src/main/java/com/ho/business/vo/req/point/PointVo.java b/business-service-api/src/main/java/com/ho/business/vo/req/point/PointVo.java index e800ab1..ecf8c70 100644 --- a/business-service-api/src/main/java/com/ho/business/vo/req/point/PointVo.java +++ b/business-service-api/src/main/java/com/ho/business/vo/req/point/PointVo.java @@ -24,6 +24,9 @@ public class PointVo { @ApiModelProperty(value = "遥信遥测 1遥信 2遥测 默认送2") private Integer sensType; + + @ApiModelProperty(value = "中英切换-查询字段") + private String lang; } diff --git a/business-service-api/src/main/java/com/ho/business/vo/resp/elecPriceCurve/ElecPriceTemplateExcelEn.java b/business-service-api/src/main/java/com/ho/business/vo/resp/elecPriceCurve/ElecPriceTemplateExcelEn.java new file mode 100644 index 0000000..0e770a0 --- /dev/null +++ b/business-service-api/src/main/java/com/ho/business/vo/resp/elecPriceCurve/ElecPriceTemplateExcelEn.java @@ -0,0 +1,66 @@ +package com.ho.business.vo.resp.elecPriceCurve; + +import com.alibaba.excel.annotation.ExcelIgnore; +import com.alibaba.excel.annotation.ExcelProperty; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; + +import java.util.Date; + +/** + * @author kerwin + */ +public class ElecPriceTemplateExcelEn { + + + // @ExcelProperty(value = "模板编号") + @ExcelIgnore + private String templateNo; + + @ExcelProperty(value = "Time period starts", index = 1) + private String beginTime; + + @ExcelProperty(value = "End of time period", index = 2) + private String endTime; + + @ExcelProperty(value = "Electricity type", index = 3) + private String type; + + @ExcelProperty(value = "price", index = 4) + private String price; + + @ExcelProperty(value = "Template Name", index = 0) + private String templateName; + + @ExcelProperty(value = "Enable or not", index = 5) + private String isEnable; + + + //@ExcelProperty(value = "电价曲线类型", index = 6) + //private String elecType; + + @ExcelProperty(value = "Modification time", index = 9) + private String updateTime; + + //电站id + @ExcelIgnore + private Integer stationId; + //集团id + @ExcelIgnore + private Integer groupId; + + @ApiModelProperty(value="模板有效期开始时间") + @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") + @ExcelProperty(value = "Template validity period start time", index = 6) + private Date validityStartTime; + + @ApiModelProperty(value="模板有效期结束时间") + @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") + @ExcelProperty(value = "End time of template validity period", index = 7) + private Date validityEndTime; + + @ApiModelProperty(value="电价折扣(%)") + @ExcelProperty(value = "Electricity price discount (%)", index = 8) + private Double discount; + +} diff --git a/business-service-api/src/main/java/com/ho/business/vo/resp/point/PointRespEnVO.java b/business-service-api/src/main/java/com/ho/business/vo/resp/point/PointRespEnVO.java new file mode 100644 index 0000000..2fa42dd --- /dev/null +++ b/business-service-api/src/main/java/com/ho/business/vo/resp/point/PointRespEnVO.java @@ -0,0 +1,74 @@ +package com.ho.business.vo.resp.point; + +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ho.common.tools.constant.CommonConstant; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * @author kerwin + */ +@Data +@ExcelIgnoreUnannotated +public class PointRespEnVO { + + @ApiModelProperty(value = "id") + private Integer id; + + @ApiModelProperty(value = "设备映射表的id") + Integer deviceTypeColId; + + @ApiModelProperty(value = "站点id") + Integer stationId; + + @ApiModelProperty(value = "设备id") + Integer srcId; + + @ApiModelProperty(value = "设备类型") + @ExcelProperty(value = "device type",index = 3) + String deviceType; + + @ApiModelProperty(value = "1遥信 2遥测 3遥控") + private Integer sensType; + + @ApiModelProperty(value = "设备名") + @ExcelProperty(value = "associated device",index = 2) + String deviceName; + + @ApiModelProperty(value = "点表字段") + @ExcelProperty(value = "code",index = 1) + String col; + + @ApiModelProperty(value = "点表字段名称") + @ExcelProperty(value = "name",index = 0) + String colName; + + @ApiModelProperty(value = "当前值") + @ExcelProperty(value = "current value",index = 7) + BigDecimal value; + + @ApiModelProperty(value = "单位") + @ExcelProperty(value = "unit",index = 8) + String unit; + + @ApiModelProperty(value = "最大值") + @ExcelProperty(value = "maximum",index = 4) + BigDecimal maxValue; + + @ApiModelProperty(value = "最小值") + @ExcelProperty(value = "minimum",index = 5) + BigDecimal minValue; + + @ApiModelProperty(value = "更新时间") + @JsonFormat(pattern = CommonConstant.DATE) + @ExcelProperty(value = "update time",index = 6) + String updateTime; + + @ApiModelProperty(value = "是否具有品质位 1是 2否") + private Integer qualityLevel; + +} diff --git a/business-service-dao/src/main/java/com/ho/business/mapper/DeviceMapper.java b/business-service-dao/src/main/java/com/ho/business/mapper/DeviceMapper.java index b22712a..24573c0 100644 --- a/business-service-dao/src/main/java/com/ho/business/mapper/DeviceMapper.java +++ b/business-service-dao/src/main/java/com/ho/business/mapper/DeviceMapper.java @@ -54,7 +54,7 @@ public interface DeviceMapper { * @param needAccessPoint 是否需要接入点,不为空表示需要 * @return */ - List selectByIdAndSrcIdNotZero(Integer stationId,Integer needHide,Integer needAccessPoint); + List selectByIdAndSrcIdNotZero(Integer stationId,Integer needHide,Integer needAccessPoint,String lang); int insertBatch(@Param("list")List deviceList); diff --git a/business-service-dao/src/main/java/com/ho/business/mapper/DeviceTypeColMapper.java b/business-service-dao/src/main/java/com/ho/business/mapper/DeviceTypeColMapper.java index 1c29036..28d4bc2 100644 --- a/business-service-dao/src/main/java/com/ho/business/mapper/DeviceTypeColMapper.java +++ b/business-service-dao/src/main/java/com/ho/business/mapper/DeviceTypeColMapper.java @@ -32,7 +32,7 @@ public interface DeviceTypeColMapper { int updateList(@Param("deviceTypeColList")List deviceTypeColList); //deviceType查询 - List selectByDeviceType(String deviceType); + List selectByDeviceType(@Param("deviceType")String deviceType,@Param("lang") String lang); List selectByParam(@Param("deviceTypeCol") DeviceTypeCol deviceTypeCol); @@ -53,7 +53,7 @@ public interface DeviceTypeColMapper { List getCompListByType(@Param("type") String type, @Param("typeName") String typeName, @Param("modelCol") String modelCol); - List selectSameCol(@Param("deviceType") String deviceType, @Param("list") List collect); + List selectSameCol(@Param("deviceType") String deviceType, @Param("list") List collect,@Param("lang") String lang); //批量新增设备表字段 void addBatchDevice(@Param("list") List deviceTypeColList); @@ -65,7 +65,7 @@ public interface DeviceTypeColMapper { void deleteBatchModel(List ids); - DeviceTypeCol selectTypeAndCol(String col, String deviceType); + DeviceTypeCol selectTypeAndCol(String col, String deviceType,String lang); Integer selectCountByDeviceType(@Param("deviceTypeCol")DeviceTypeCol deviceTypeCol); diff --git a/business-service-dao/src/main/java/com/ho/business/mapper/PlanningCurveIssueMapper.java b/business-service-dao/src/main/java/com/ho/business/mapper/PlanningCurveIssueMapper.java index 82f549a..57ee011 100644 --- a/business-service-dao/src/main/java/com/ho/business/mapper/PlanningCurveIssueMapper.java +++ b/business-service-dao/src/main/java/com/ho/business/mapper/PlanningCurveIssueMapper.java @@ -33,7 +33,7 @@ public interface PlanningCurveIssueMapper { void addPlanningCurveHistory(@Param("condition") List PlanningCurveHistory); - List getPlanCurveOperationList(@Param("stationId") String stationId); + List getPlanCurveOperationList(@Param("stationId") String stationId,@Param("lang") String lang); List getPlanningCurveHistory(@Param("planningCurveId") String planningCurveId); diff --git a/business-service-dao/src/main/java/com/ho/business/mapper/PointConfigMapper.java b/business-service-dao/src/main/java/com/ho/business/mapper/PointConfigMapper.java index 9f4d429..13654c3 100644 --- a/business-service-dao/src/main/java/com/ho/business/mapper/PointConfigMapper.java +++ b/business-service-dao/src/main/java/com/ho/business/mapper/PointConfigMapper.java @@ -63,4 +63,13 @@ public interface PointConfigMapper { */ int updateList(List list); + /** + * 查询所有name_en 为空的数据 + * @return + */ + List selectTableList(@Param("tableName") String tableName,@Param("name") String name,@Param("nameEn") String nameEn); + + int updateNameEnById(@Param("id") Integer id, @Param("tableName") String tableName,@Param("nameEn") String nameEn,@Param("translateName") String translateName); + + } diff --git a/business-service-dao/src/main/java/com/ho/business/mapper/PointPolysemyConfigMapper.java b/business-service-dao/src/main/java/com/ho/business/mapper/PointPolysemyConfigMapper.java index 7fd1418..c7076e1 100644 --- a/business-service-dao/src/main/java/com/ho/business/mapper/PointPolysemyConfigMapper.java +++ b/business-service-dao/src/main/java/com/ho/business/mapper/PointPolysemyConfigMapper.java @@ -38,7 +38,7 @@ public interface PointPolysemyConfigMapper { * @param ids * @return */ - List selectByPointIds(@Param("ids") List ids); + List selectByPointIds(@Param("ids") List ids,@Param("lang") String lang); /** * 根据id删除配置信息 diff --git a/business-service-dao/src/main/java/com/ho/business/mapper/TranslateNameMapper.java b/business-service-dao/src/main/java/com/ho/business/mapper/TranslateNameMapper.java new file mode 100644 index 0000000..64c26d1 --- /dev/null +++ b/business-service-dao/src/main/java/com/ho/business/mapper/TranslateNameMapper.java @@ -0,0 +1,28 @@ +package com.ho.business.mapper; + +import com.ho.business.entity.TranslateName; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** +* @author xwz +* @description 针对表【Dict_Province】的数据库操作Mapper +* @createDate 2024-12-18 +*/ +@Mapper +public interface TranslateNameMapper { + + List getDictNation(); + + TranslateName selectNameEN(@Param("name")String name); + + int insert(@Param("vo")TranslateName vo); + + int updateNameEnById(@Param("id") Integer id, @Param("nameEn") String nameEn); +} + + + + diff --git a/business-service-dao/src/main/java/com/ho/business/mapper/TranslateNationMapper.java b/business-service-dao/src/main/java/com/ho/business/mapper/TranslateNationMapper.java deleted file mode 100644 index 3522be2..0000000 --- a/business-service-dao/src/main/java/com/ho/business/mapper/TranslateNationMapper.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.ho.business.mapper; - -import com.ho.business.entity.TranslateNation; -import org.apache.ibatis.annotations.Mapper; - -import java.util.List; - -/** -* @author xwz -* @description 针对表【Dict_Province】的数据库操作Mapper -* @createDate 2024-12-18 -*/ -@Mapper -public interface TranslateNationMapper { - - List getDictNation(); -} - - - - diff --git a/business-service-dao/src/main/java/com/ho/business/service/DeviceService.java b/business-service-dao/src/main/java/com/ho/business/service/DeviceService.java index 77e6d58..3c61354 100644 --- a/business-service-dao/src/main/java/com/ho/business/service/DeviceService.java +++ b/business-service-dao/src/main/java/com/ho/business/service/DeviceService.java @@ -89,11 +89,14 @@ public interface DeviceService { //根据电站id和srcId查询 Device selectByStationIdAndSrcId(Integer stationId, Integer srcId); + Device selectByStationIdAndSrcIdAndLng(Integer stationId, Integer srcId,String lang); + + List selectByGroup(Integer groupId); List selectDistinctDeviceTypeByStationId(Integer stationId); - List getDeviceByStationId(Integer stationId); + List getDeviceByStationId(Integer stationId,String lang); List getDeviceByStationIds(List stationIds); @@ -138,7 +141,7 @@ public interface DeviceService { * @param stationId * @return */ - List selectByIdAndSrcIdNotZero(Integer stationId); + List selectByIdAndSrcIdNotZero(Integer stationId,String lang); /** * 查询设备需要设备接入点 @@ -146,7 +149,7 @@ public interface DeviceService { * @param stationId * @return */ - List selectDeviceByStationId(Integer stationId); + List selectDeviceByStationId(Integer stationId,String lang); /** * 查询所有设备,不包含接入点 @@ -154,7 +157,7 @@ public interface DeviceService { * @param stationId * @return */ - List selectAllDeviceAndSrcIdNotZero(Integer stationId); + List selectAllDeviceAndSrcIdNotZero(Integer stationId,String lang); /** * 获取单个设备电压电流正太分布数据 diff --git a/business-service-dao/src/main/java/com/ho/business/service/DeviceTypeColService.java b/business-service-dao/src/main/java/com/ho/business/service/DeviceTypeColService.java index f3e574a..a8ec5d1 100644 --- a/business-service-dao/src/main/java/com/ho/business/service/DeviceTypeColService.java +++ b/business-service-dao/src/main/java/com/ho/business/service/DeviceTypeColService.java @@ -19,14 +19,14 @@ public interface DeviceTypeColService { int insertList(List list,Integer GroupId); - List selectByDeviceType(String deviceType); + List selectByDeviceType(String deviceType,String lang); DeviceTypeCol selectById(Integer id); - DeviceTypeCol selectTypeAndCol(String col, String deviceType); + DeviceTypeCol selectTypeAndCol(String col, String deviceType,String lang); - List selectDeviceTypeColList(String deviceType,List collect); + List selectDeviceTypeColList(String deviceType,List collect,String lang); Integer selectCountByDeviceType(DeviceTypeCol deviceTypeCol); diff --git a/business-service-dao/src/main/java/com/ho/business/service/DynamicConfigService.java b/business-service-dao/src/main/java/com/ho/business/service/DynamicConfigService.java index 39bd63a..082b702 100644 --- a/business-service-dao/src/main/java/com/ho/business/service/DynamicConfigService.java +++ b/business-service-dao/src/main/java/com/ho/business/service/DynamicConfigService.java @@ -119,4 +119,12 @@ public interface DynamicConfigService { * @return */ int delDynamicConfigTitle(DynamicConfigTitle vo); + + /** + * 修改点名称英文 + * @return + */ + int updatePointNameEn(String tableName,String name,String nameEn); + + String getNameEn(String name); } diff --git a/business-service-dao/src/main/java/com/ho/business/service/OpenStationService.java b/business-service-dao/src/main/java/com/ho/business/service/OpenStationService.java index 12671e7..651c176 100644 --- a/business-service-dao/src/main/java/com/ho/business/service/OpenStationService.java +++ b/business-service-dao/src/main/java/com/ho/business/service/OpenStationService.java @@ -42,7 +42,7 @@ public interface OpenStationService { * @param req * @param response */ - void exportEleData(PcsStationReq req, HttpServletResponse response); + void exportEleData(PcsStationReq req, HttpServletResponse response,String lang); /** * 查询日冻结数据 diff --git a/business-service-dao/src/main/java/com/ho/business/service/PlanningCurveIssueService.java b/business-service-dao/src/main/java/com/ho/business/service/PlanningCurveIssueService.java index 8c82b35..0b14e70 100644 --- a/business-service-dao/src/main/java/com/ho/business/service/PlanningCurveIssueService.java +++ b/business-service-dao/src/main/java/com/ho/business/service/PlanningCurveIssueService.java @@ -28,7 +28,7 @@ public interface PlanningCurveIssueService { public void planCurveOperationRecord(PlanCurveOperationRecordReq planCurveOperationRecordReq); - List getPlanCurveOperationList(String stationId); + List getPlanCurveOperationList(String stationId,String lang); Map getPlanningCurveHistory(List planningCurveIds); } diff --git a/business-service-dao/src/main/java/com/ho/business/service/impl/DeviceModelServiceImpl.java b/business-service-dao/src/main/java/com/ho/business/service/impl/DeviceModelServiceImpl.java index 60958e7..01a0b3c 100644 --- a/business-service-dao/src/main/java/com/ho/business/service/impl/DeviceModelServiceImpl.java +++ b/business-service-dao/src/main/java/com/ho/business/service/impl/DeviceModelServiceImpl.java @@ -89,7 +89,7 @@ public class DeviceModelServiceImpl implements DeviceModelService { List addCollect = addColList.stream().map(DeviceCol::getCol) .collect(Collectors.toList()); if (!addCollect.isEmpty()) { - List deviceTypeCols = deviceTypeColMapper.selectSameCol(vo.getDeviceType(), addCollect); + List deviceTypeCols = deviceTypeColMapper.selectSameCol(vo.getDeviceType(), addCollect,null); if (!deviceTypeCols.isEmpty()) { throw new BusinessException(BaseResponseCode.THE_SAME_DATA_EXISTS_DATABASE_PLEASE_CHECK); } @@ -158,7 +158,7 @@ public class DeviceModelServiceImpl implements DeviceModelService { @Override public void addDeviceTypeCol(DeviceTypeColAddReq vo) { - DeviceTypeCol deviceCol = deviceTypeColMapper.selectTypeAndCol(vo.getCol(), vo.getDeviceType()); + DeviceTypeCol deviceCol = deviceTypeColMapper.selectTypeAndCol(vo.getCol(), vo.getDeviceType(),null); if (deviceCol != null && vo.getId() == null) { throw new BusinessException(BaseResponseCode.THE_SAME_DATA_EXISTS_DATABASE_PLEASE_CHECK); } diff --git a/business-service-dao/src/main/java/com/ho/business/service/impl/DeviceServiceImpl.java b/business-service-dao/src/main/java/com/ho/business/service/impl/DeviceServiceImpl.java index 505f5fa..055c37f 100644 --- a/business-service-dao/src/main/java/com/ho/business/service/impl/DeviceServiceImpl.java +++ b/business-service-dao/src/main/java/com/ho/business/service/impl/DeviceServiceImpl.java @@ -106,6 +106,10 @@ public class DeviceServiceImpl implements DeviceService { @Autowired Snowflake snowflake; + @Autowired + DynamicConfigService dynamicConfigService; + + @Override public PageResult getPageListByInfo(DeviceReqVO deviceReqVO) { //是否是多个电站 @@ -391,6 +395,7 @@ public class DeviceServiceImpl implements DeviceService { String dName = adddevice.getDeviceName() + (i + 1); newSrcIdList.add(newSrcId); device.setDeviceName(dName); + device.setDeviceNameEn(dynamicConfigService.getNameEn(dName)); device.setSrcId(newSrcId); device.setDeptId(adddevice.getDeptId()); device.setDeviceType(adddevice.getDeviceType()); @@ -517,6 +522,21 @@ public class DeviceServiceImpl implements DeviceService { return device; } + @Override +// @Cacheable(value = "device", sync = true) + public Device selectByStationIdAndSrcIdAndLng(Integer stationId, Integer srcId,String lang) { + Device device = new Device(); + DeviceReqVO deviceReqVO = new DeviceReqVO(); + deviceReqVO.setStationId(stationId); + deviceReqVO.setSrcId(srcId); + deviceReqVO.setLang(lang); + List deviceRespVOList = getList(deviceReqVO); + if(deviceRespVOList!=null && !deviceRespVOList.isEmpty()){ + device = deviceRespVOList.get(0); + } + return device; + } + @Override public List selectByGroup(Integer groupId) { Device device = new Device(); @@ -532,9 +552,10 @@ public class DeviceServiceImpl implements DeviceService { } @Override - public List getDeviceByStationId(Integer stationId) { + public List getDeviceByStationId(Integer stationId,String lang) { DeviceReqVO reqVO = new DeviceReqVO(); reqVO.setStationId(stationId); + reqVO.setLang(lang); List deviceRespVOS = deviceMapper.selectByCondition(reqVO); deviceRespVOS = getDeviceRespVOS(deviceRespVOS); return deviceRespVOS; @@ -814,26 +835,26 @@ public class DeviceServiceImpl implements DeviceService { } @Override - public List selectByIdAndSrcIdNotZero(Integer stationId) { - List list = deviceMapper.selectByIdAndSrcIdNotZero(stationId, null, null); + public List selectByIdAndSrcIdNotZero(Integer stationId,String lang) { + List list = deviceMapper.selectByIdAndSrcIdNotZero(stationId, null, null,lang); return list; } @Override - public List selectDeviceByStationId(Integer stationId) { - List list = deviceMapper.selectByIdAndSrcIdNotZero(stationId, null, CommonConstant.ONE); + public List selectDeviceByStationId(Integer stationId,String lang) { + List list = deviceMapper.selectByIdAndSrcIdNotZero(stationId, null, CommonConstant.ONE,lang); return list; } @Override - public List selectAllDeviceAndSrcIdNotZero(Integer stationId) { - List list = deviceMapper.selectByIdAndSrcIdNotZero(stationId, CommonConstant.ONE, null); + public List selectAllDeviceAndSrcIdNotZero(Integer stationId,String lang) { + List list = deviceMapper.selectByIdAndSrcIdNotZero(stationId, CommonConstant.ONE, null,lang); return list; } @Override public TemperatureVoltageResp getTemperatureVoltageData(DeviceTreeReq vo) { - List deviceRespVOS = selectByIdAndSrcIdNotZero(vo.getStationId()); + List deviceRespVOS = selectByIdAndSrcIdNotZero(vo.getStationId(),vo.getLang()); List treeDevices = new ArrayList<>(); if (!deviceRespVOS.isEmpty()) { treeDevices = deviceTypeConfigService.getTreeDevices(deviceRespVOS, vo.getSrcId()); @@ -1118,7 +1139,7 @@ public class DeviceServiceImpl implements DeviceService { List deviceRespVOS = deviceMapper.selectByCondition(deviceReqVO); List srcIdList = deviceRespVOS.stream().map(s -> s.getSrcId()).collect(Collectors.toList()); //查询对应的设备 - List deviceStation = selectByIdAndSrcIdNotZero(vo.getStationId()); + List deviceStation = selectByIdAndSrcIdNotZero(vo.getStationId(),vo.getLang()); List treeDevices = new ArrayList<>(); if (!deviceRespVOS.isEmpty()) { for (Integer srcId : srcIdList) { @@ -1140,7 +1161,7 @@ public class DeviceServiceImpl implements DeviceService { List deviceRespVOS = deviceMapper.selectByCondition(deviceReqVO); List srcIdList = deviceRespVOS.stream().map(s -> s.getSrcId()).collect(Collectors.toList()); //查询对应的设备 - List deviceStation = selectByIdAndSrcIdNotZero(vo.getStationId()); + List deviceStation = selectByIdAndSrcIdNotZero(vo.getStationId(),vo.getLang()); List treeDevices = new ArrayList<>(); if (!deviceRespVOS.isEmpty()) { for (Integer srcId : srcIdList) { diff --git a/business-service-dao/src/main/java/com/ho/business/service/impl/DeviceTypeColServiceImpl.java b/business-service-dao/src/main/java/com/ho/business/service/impl/DeviceTypeColServiceImpl.java index c8452f9..d943ad4 100644 --- a/business-service-dao/src/main/java/com/ho/business/service/impl/DeviceTypeColServiceImpl.java +++ b/business-service-dao/src/main/java/com/ho/business/service/impl/DeviceTypeColServiceImpl.java @@ -50,7 +50,7 @@ public class DeviceTypeColServiceImpl implements DeviceTypeColService { DeviceTypeCol deviceTypeCol = null; for (Map.Entry> src : mapList.entrySet()) { //已经存在的 - List isSaveList = deviceTypeColMapper.selectByDeviceType(src.getKey()); + List isSaveList = deviceTypeColMapper.selectByDeviceType(src.getKey(),null); Map isSaveMap = isSaveList.stream().collect(Collectors.toMap(k -> k.getDeviceType() + "_" + k.getCol(), DeviceTypeCol -> DeviceTypeCol)); Map> addMap = new HashMap<>(); @@ -118,8 +118,8 @@ public class DeviceTypeColServiceImpl implements DeviceTypeColService { } @Override - public List selectByDeviceType(String deviceType) { - List deviceTypeColList = deviceTypeColMapper.selectByDeviceType(deviceType); + public List selectByDeviceType(String deviceType,String lang) { + List deviceTypeColList = deviceTypeColMapper.selectByDeviceType(deviceType,lang); return deviceTypeColList; } @@ -130,14 +130,14 @@ public class DeviceTypeColServiceImpl implements DeviceTypeColService { } @Override - public DeviceTypeCol selectTypeAndCol(String col, String deviceType) { - DeviceTypeCol deviceTypeCol = deviceTypeColMapper.selectTypeAndCol(col, deviceType); + public DeviceTypeCol selectTypeAndCol(String col, String deviceType,String lang) { + DeviceTypeCol deviceTypeCol = deviceTypeColMapper.selectTypeAndCol(col, deviceType,lang); return deviceTypeCol; } @Override - public List selectDeviceTypeColList(String deviceType, List collect) { - List deviceTypeCols = deviceTypeColMapper.selectSameCol(deviceType, collect); + public List selectDeviceTypeColList(String deviceType, List collect,String lang) { + List deviceTypeCols = deviceTypeColMapper.selectSameCol(deviceType, collect,lang); return deviceTypeCols; } diff --git a/business-service-dao/src/main/java/com/ho/business/service/impl/DynamicConfigServiceImpl.java b/business-service-dao/src/main/java/com/ho/business/service/impl/DynamicConfigServiceImpl.java index 5a6d84f..803ae46 100644 --- a/business-service-dao/src/main/java/com/ho/business/service/impl/DynamicConfigServiceImpl.java +++ b/business-service-dao/src/main/java/com/ho/business/service/impl/DynamicConfigServiceImpl.java @@ -18,7 +18,9 @@ import com.ho.business.vo.resp.DeviceRespVO; import com.ho.business.vo.resp.dynamicConfig.*; import com.ho.common.tools.constant.CommonConstant; import com.ho.common.tools.service.RedisService; +import com.ho.common.tools.util.TranslateUtils; import com.ho.datacollect.api.constant.DataCollectConstant; +import jodd.util.StringUtil; import lombok.extern.slf4j.Slf4j; import org.jetbrains.annotations.NotNull; import org.springframework.beans.BeanUtils; @@ -27,6 +29,7 @@ import org.springframework.stereotype.Service; import java.math.BigDecimal; import java.util.*; +import java.util.concurrent.CompletableFuture; import java.util.function.Function; import java.util.stream.Collectors; @@ -70,6 +73,9 @@ public class DynamicConfigServiceImpl implements DynamicConfigService { @Autowired DynamicConfigTitleMapper configTitleMapper; + @Autowired + TranslateNameMapper translateNameMapper; + @Override public int insertList(List list) { List insertList = list.stream().filter(i -> i.getId() == null).collect(Collectors.toList()); @@ -153,6 +159,8 @@ public class DynamicConfigServiceImpl implements DynamicConfigService { List insertList = new ArrayList<>(); CurveConfig config = null; for (CurveConfigAdd c:list) { + //curveName 设置英文翻译 20250821 + c.setCurveNameEn(getNameEn(c.getCurveName())); config = new CurveConfig(); BeanUtils.copyProperties(c,config); if(c.getId() == null){ @@ -180,6 +188,7 @@ public class DynamicConfigServiceImpl implements DynamicConfigService { list.get(i).setId(id); List dList = list.get(i).getList(); if(null != dList && !dList.isEmpty()){ + dList.stream().forEach(s->{s.setColNameEn(getNameEn(s.getColName()));}); //动态配置点国际化 result = dynamicConfigMapper.insertList(dList); log.info("插入动态配置结果,{}",result); @@ -293,6 +302,11 @@ public class DynamicConfigServiceImpl implements DynamicConfigService { if(srcPoint.getSort()==null){ srcPoint.setSort(i); } + //name defaultValue 设置英文翻译 20250821 + srcPoint.setNameEn(getNameEn(srcPoint.getName())); + if(StringUtil.isNotBlank(srcPoint.getDefaultValue())){ + srcPoint.setDefaultValueEn(getNameEn(srcPoint.getDefaultValue())); + } pointConfig = new PointConfig(); BeanUtils.copyProperties(srcPoint,pointConfig); if(srcPoint.getId()==null){ @@ -337,6 +351,7 @@ public class DynamicConfigServiceImpl implements DynamicConfigService { List dynamicConfigs = list.get(i).getList(); //插入动态配置点 if(!dynamicConfigs.isEmpty()){ + dynamicConfigs.stream().forEach(s->{s.setColNameEn(getNameEn(s.getColName()));}); result = dynamicConfigMapper.insertList(dynamicConfigs); for (DynamicConfig d:dynamicConfigs) { relation = new PointConfigRelation(); @@ -359,6 +374,8 @@ public class DynamicConfigServiceImpl implements DynamicConfigService { p.getPolysemyList().forEach(i->i.setPointId(p.getId())); pList.addAll(p.getPolysemyList()); } + //name 设置英文翻译 20250821 + pList.stream().forEach(i->{i.setNameEn(getNameEn(i.getName()));}); result = polysemyMapper.insertList(pList); log.info("插入一点多义表结果:{}",result); } @@ -386,7 +403,7 @@ public class DynamicConfigServiceImpl implements DynamicConfigService { List polysemyList = pointConfigResultList.stream().filter(i -> CommonConstant.TWO.equals(i.getPointType()) || CommonConstant.ELEVEN.equals(i.getPointType())).map(PointConfigResultResp::getId).distinct().collect(Collectors.toList()); Map> vMap = new HashMap<>(); if(!polysemyList.isEmpty()){ - List list = polysemyMapper.selectByPointIds(polysemyList); + List list = polysemyMapper.selectByPointIds(polysemyList,vo.getLang()); vMap = list.stream().collect(Collectors.groupingBy(PointPolysemyConfig::getPointId)); } //拆电芯 @@ -445,14 +462,14 @@ public class DynamicConfigServiceImpl implements DynamicConfigService { List polysemyList = pointConfigResultList.stream().filter(i -> CommonConstant.TWO.equals(i.getPointType())).map(PointConfigResultResp::getId).distinct().collect(Collectors.toList()); Map vMap = new HashMap<>(); if(!polysemyList.isEmpty()){ - List list = polysemyMapper.selectByPointIds(polysemyList); + List list = polysemyMapper.selectByPointIds(polysemyList,vo.getLang()); vMap = list.stream().filter(s->s.getValue()!=null&&s.getName()!=null).collect(Collectors.toMap(s -> s.getPointId() + "," + s.getValue().intValue(), s -> s.getName(), (k1, k2) -> k1)); } //范围内的一点多义 List rangePolysemyList = pointConfigResultList.stream().filter(i -> CommonConstant.ELEVEN.equals(i.getPointType())).map(PointConfigResultResp::getId).distinct().collect(Collectors.toList()); Map> rMap = new HashMap<>(); if(!rangePolysemyList.isEmpty()){ - List list = polysemyMapper.selectByPointIds(rangePolysemyList); + List list = polysemyMapper.selectByPointIds(rangePolysemyList,vo.getLang()); rMap = list.stream().filter(s -> s.getValue() != null && s.getName() != null && s.getSymbol() != null).collect(Collectors.groupingBy(PointPolysemyConfig::getPointId)); } //拆电芯 @@ -762,6 +779,51 @@ public class DynamicConfigServiceImpl implements DynamicConfigService { return result; } + @Override + public int updatePointNameEn(String tableName,String name,String nameEn) { + int a=0; + //查询所有name_en 为空的数据 + List pointList = pointConfigMapper.selectTableList(tableName,name,nameEn); + for (PointConfigResp vo:pointList){ + if(StringUtil.isNotBlank(vo.getName())){ + String translateName = getNameEn(vo.getName()); + int resoult=pointConfigMapper.updateNameEnById(vo.getId(),tableName,nameEn,translateName); + a=a+resoult; + log.info("修改进度:{}",a); + } + } + return a; + } + + @Override + public String getNameEn(String name) { + // 查询数据库中有预先翻译的中文字段 + String nameEn = null; + TranslateName vo = translateNameMapper.selectNameEN(name); + if(vo == null){ + nameEn = TranslateUtils.translate(name); + // 插入中文预翻译表 + TranslateName translate = new TranslateName(); + translate.setName(name); + translate.setNameEn(nameEn); + CompletableFuture.runAsync(()->{ + translateNameMapper.insert(translate); + }); + }else{ + if(StringUtil.isEmpty(vo.getNameEn())){ + nameEn = TranslateUtils.translate(name); + String finalNameEn = nameEn; + CompletableFuture.runAsync(()->{ + translateNameMapper.updateNameEnById(vo.getId(), finalNameEn); + }); + }else{ + nameEn = vo.getNameEn(); + } + } + return nameEn; + } + + private void getConfigAddList(SyncDynamicConfigParam vo, List pointList, List pointAddList,Integer deviceId,Map map) { PointConfigAdd configAdd = null; for (PointConfigResultResp p: pointList) { diff --git a/business-service-dao/src/main/java/com/ho/business/service/impl/EarningsCalculateServiceImpl.java b/business-service-dao/src/main/java/com/ho/business/service/impl/EarningsCalculateServiceImpl.java index 5568cf2..e91aef0 100644 --- a/business-service-dao/src/main/java/com/ho/business/service/impl/EarningsCalculateServiceImpl.java +++ b/business-service-dao/src/main/java/com/ho/business/service/impl/EarningsCalculateServiceImpl.java @@ -194,11 +194,17 @@ public class EarningsCalculateServiceImpl implements EarningsCalculateService { String time = earningsCalculateReq.getTime(); ec.setMonth(time.substring(time.length() - 2, time.length())); + String reportName = CommonConstant.REPORT_NAME; + String billName = CommonConstant.BILL_NAME; + if(RedisKeyConstant.User.EN_US.equals(earningsCalculateReq.getLang())){ + reportName = CommonConstant.REPORT_NAME_EN; + billName = CommonConstant.BILL_NAME_EN; + } // 电站名称(报表标题) if (type == 0) { - ec.setStationName(station.getName() + "( " + time + " ) 月度报表"); + ec.setStationName(station.getName() + "( " + time + " ) "+reportName); } else { - ec.setStationName(station.getName() + "( " + time + " ) 月度账单"); + ec.setStationName(station.getName() + "( " + time + " ) "+billName); } ec.setList(list); //充电收益 diff --git a/business-service-dao/src/main/java/com/ho/business/service/impl/HisCurveRelateServiceImpl.java b/business-service-dao/src/main/java/com/ho/business/service/impl/HisCurveRelateServiceImpl.java index 1e2ab9e..a456d3d 100644 --- a/business-service-dao/src/main/java/com/ho/business/service/impl/HisCurveRelateServiceImpl.java +++ b/business-service-dao/src/main/java/com/ho/business/service/impl/HisCurveRelateServiceImpl.java @@ -6,6 +6,7 @@ import com.github.pagehelper.PageInfo; import com.ho.business.entity.ElecMeterValue; import com.ho.business.entity.HisCurveRelate; import com.ho.business.mapper.HisCurveRelateMapper; +import com.ho.business.service.DynamicConfigService; import com.ho.business.service.HisCurveRelateService; import com.ho.business.vo.req.modelType.ModelTypeQueryReq; import com.ho.business.vo.req.point.HisPointReqVo; @@ -38,6 +39,10 @@ public class HisCurveRelateServiceImpl implements HisCurveRelateService { @Autowired private HisCurveRelateMapper hisCurveRelateMapper; + @Autowired + private DynamicConfigService dynamicConfigService; + + @Override public void add(HisPointReqVo hisPointReqVo, SimpleUser user) { List list =new ArrayList<>(); @@ -49,10 +54,12 @@ public class HisCurveRelateServiceImpl implements HisCurveRelateService { hisCurveRelate.setDeviceType(hisPointCurveReqVo.getDeviceType()); hisCurveRelate.setModelId(String.valueOf(modelId)); hisCurveRelate.setColName(hisPointCurveReqVo.getColName()); + hisCurveRelate.setColNameEn(dynamicConfigService.getNameEn(hisPointCurveReqVo.getColName())); hisCurveRelate.setStationId(hisPointCurveReqVo.getStationId()); //modelname 不能重复 //hisCurveRelateMapper.selectName(hisPointReqVo.getModelName()); hisCurveRelate.setModelName(hisPointReqVo.getModelName()); + hisCurveRelate.setModelNameEn(dynamicConfigService.getNameEn(hisPointReqVo.getModelName())); hisCurveRelate.setSrcId(hisPointCurveReqVo.getSrcId()); hisCurveRelate.setUserId(user.getUserId()); list.add(hisCurveRelate); @@ -69,6 +76,7 @@ public class HisCurveRelateServiceImpl implements HisCurveRelateService { HisCurveRelate queryVo = new HisCurveRelate(); queryVo.setStationId(vo.getStationId()); queryVo.setUserId(vo.getUserId()); + queryVo.setLang(vo.getLang()); List hisCurveRelateList = hisCurveRelateMapper.selectAll(queryVo); Map> chargeMap = hisCurveRelateList.stream().collect(Collectors.groupingBy(HisCurveRelate::getModelId)); List resultList = new ArrayList<>(); diff --git a/business-service-dao/src/main/java/com/ho/business/service/impl/IargeScreenShowServiceImpl.java b/business-service-dao/src/main/java/com/ho/business/service/impl/IargeScreenShowServiceImpl.java index 303f53c..b09bf11 100644 --- a/business-service-dao/src/main/java/com/ho/business/service/impl/IargeScreenShowServiceImpl.java +++ b/business-service-dao/src/main/java/com/ho/business/service/impl/IargeScreenShowServiceImpl.java @@ -967,48 +967,15 @@ public class IargeScreenShowServiceImpl implements IargeScreenShowService { } private List getProvince(List stations) { - //地址选取前三个字 -// Map> provincesMap = stations.stream().sorted(Comparator.comparing(Station::getName)).collect(Collectors.groupingBy(s -> { -// return s.getAddress().substring(0, 3); -// })); -// //创建返回值集合 -// List provinceList = new ArrayList<>(); -// provincesMap.forEach((k, v) -> { -// ProvinceStation provinceStation = new ProvinceStation(); -// if (k.contains("省")) { -// provinceStation.setName(k.replace("省", "")); -// } else if (k.contains("广西")) { -// provinceStation.setName(CommonConstant.ChineseProvinces.guangxi); -// } else if (k.contains("宁夏")) { -// provinceStation.setName(CommonConstant.ChineseProvinces.ningxia); -// } else if (k.contains("内蒙古")) { -// provinceStation.setName(CommonConstant.ChineseProvinces.neimenggu); -// } else if (k.contains("新疆")) { -// provinceStation.setName(CommonConstant.ChineseProvinces.xinjiang); -// } else if (k.contains("西藏")) { -// provinceStation.setName(CommonConstant.ChineseProvinces.xizang); -// } else if (k.contains("香港")) { -// provinceStation.setName(CommonConstant.ChineseProvinces.xianggang); -// } else if (k.contains("澳门")) { -// provinceStation.setName(CommonConstant.ChineseProvinces.aomen); -// } else { -// provinceStation.setName(k.replaceFirst("市", "")); -// } -// provinceStation.setList(v); -// provinceList.add(provinceStation); -// }); - List dictProvince = translateProvinceMapper.getDictProvince(); - Map provinceMap = dictProvince.stream().collect(Collectors.toMap(s -> s.getName(), s -> s.getNameEn(), (k1, k2) -> k1)); - Map> provincesMap = stations.stream().filter(s->s.getProvince()!=null).collect(Collectors.groupingBy(Station::getProvince)); - List provinceList = new ArrayList<>(); - provincesMap.forEach((k, v) -> { + Map> natioMap = stations.stream().filter(s->s.getProvince()!=null).collect(Collectors.groupingBy(Station::getNation)); + List list = new ArrayList<>(); + natioMap.forEach((k, v) -> { ProvinceStation provinceStation = new ProvinceStation(); provinceStation.setName(k); - provinceStation.setNameEn(provinceMap.get(k)); provinceStation.setList(v); - provinceList.add(provinceStation); + list.add(provinceStation); }); - return provinceList; + return list; } @Override @@ -1306,16 +1273,16 @@ public class IargeScreenShowServiceImpl implements IargeScreenShowService { } List list = getCountStations(stationIds); List regionList = new ArrayList<>(); - Map> provinceMap = list.stream().filter(i -> i.getProvince() != null).collect(Collectors.groupingBy(Station::getProvince)); - if (provinceMap.size() > CommonConstant.ONE) { - regionList = getListSubdata(provinceMap); + Map> nationMap = list.stream().filter(i -> i.getProvince() != null).collect(Collectors.groupingBy(Station::getNation)); + if (nationMap.size() > CommonConstant.ONE) { + regionList = getListSubdata(nationMap); } else { - Map> cityMap = list.stream().filter(i -> i.getCity() != null).collect(Collectors.groupingBy(Station::getCity)); - if (cityMap.size() > CommonConstant.ONE) { - regionList = getListSubdata(cityMap); + Map> provinceMap = list.stream().filter(i -> i.getCity() != null).collect(Collectors.groupingBy(Station::getProvince)); + if (provinceMap.size() > CommonConstant.ONE) { + regionList = getListSubdata(provinceMap); } else { - Map> districtMap = list.stream().filter(i -> i.getDistrict() != null).collect(Collectors.groupingBy(Station::getDistrict)); - regionList = getListSubdata(districtMap); + Map> cityMap = list.stream().filter(i -> i.getDistrict() != null).collect(Collectors.groupingBy(Station::getCity)); + regionList = getListSubdata(cityMap); } } return regionList; diff --git a/business-service-dao/src/main/java/com/ho/business/service/impl/InverterServiceImpl.java b/business-service-dao/src/main/java/com/ho/business/service/impl/InverterServiceImpl.java index 394b0bc..a2838e7 100644 --- a/business-service-dao/src/main/java/com/ho/business/service/impl/InverterServiceImpl.java +++ b/business-service-dao/src/main/java/com/ho/business/service/impl/InverterServiceImpl.java @@ -1081,7 +1081,7 @@ public class InverterServiceImpl implements InverterService { //查询设备映射字段 List colMappingList = modelDeviceService.getCompListByType(CommonConstant.ModelDeviceType.DEVICE, device.getDeviceType(), null); //查询没有映射字段 - List deviceTypeCols = deviceTypeColMapper.selectByDeviceType(device.getDeviceType()); + List deviceTypeCols = deviceTypeColMapper.selectByDeviceType(device.getDeviceType(),null); //拼接缓存key String inverterRedisKey = device.getDeviceType() + ":" + vo.getStationId() + ":" + vo.getSrcId(); //先判断缓存中是否存在 diff --git a/business-service-dao/src/main/java/com/ho/business/service/impl/ModelDeviceServiceImpl.java b/business-service-dao/src/main/java/com/ho/business/service/impl/ModelDeviceServiceImpl.java index 6feb7d8..a23bd78 100644 --- a/business-service-dao/src/main/java/com/ho/business/service/impl/ModelDeviceServiceImpl.java +++ b/business-service-dao/src/main/java/com/ho/business/service/impl/ModelDeviceServiceImpl.java @@ -104,7 +104,7 @@ public class ModelDeviceServiceImpl implements ModelDeviceService { if(redisService.hasKey(key)){ deviceTypeCols =(List) redisService.get(key); }else{ - deviceTypeCols = deviceTypeColMapper.selectByDeviceType(deviceType); + deviceTypeCols = deviceTypeColMapper.selectByDeviceType(deviceType,null); redisService.set(key,deviceTypeCols); redisService.expire(key,1, TimeUnit.HOURS); } diff --git a/business-service-dao/src/main/java/com/ho/business/service/impl/OpenStationServiceImpl.java b/business-service-dao/src/main/java/com/ho/business/service/impl/OpenStationServiceImpl.java index b41d1d7..2b804db 100644 --- a/business-service-dao/src/main/java/com/ho/business/service/impl/OpenStationServiceImpl.java +++ b/business-service-dao/src/main/java/com/ho/business/service/impl/OpenStationServiceImpl.java @@ -27,6 +27,7 @@ import com.ho.business.vo.resp.pcsStation.*; import com.ho.business.vo.resp.station.ActiveReactivePower; import com.ho.common.tools.constant.CommonConstant; import com.ho.common.tools.constant.DefineConstant; +import com.ho.common.tools.constant.RedisKeyConstant; import com.ho.common.tools.entity.PointCurveSrcCol; import com.ho.common.tools.exception.BaseResponseCode; import com.ho.common.tools.exception.BusinessException; @@ -554,7 +555,7 @@ public class OpenStationServiceImpl implements OpenStationService { } @Override - public void exportEleData(PcsStationReq req, HttpServletResponse response) { + public void exportEleData(PcsStationReq req, HttpServletResponse response,String lang) { try { List stationIds = req.getStationIds(); List stations = stationService.selectStationsByIds(stationIds); @@ -567,6 +568,10 @@ public class OpenStationServiceImpl implements OpenStationService { String name = ""; String summary = DefineConstant.SUMMARY; String summaryData = DefineConstant.SUMMARY_DATA_STATION; + if(RedisKeyConstant.User.EN_US.equals(lang)){ + summary = DefineConstant.SUMMARY_EN; + summaryData = DefineConstant.SUMMARY_DATA_STATION_EN; + } if("segment".equals(segmentType)){ List totalList = new ArrayList<>(); BigDecimal chargeTip = BigDecimal.ZERO; @@ -595,7 +600,7 @@ public class OpenStationServiceImpl implements OpenStationService { name = idNameMap.get(stationId); if(dataList.size()>0){ dataList.add(calculateData); - setSheetEarningsData(sheetsList, name==null?"":name.replaceAll("/", " "), dataList); + setSheetEarningsData(sheetsList, name==null?"":name.replaceAll("/", " "), dataList,lang); } charge = charge.add(calculateData.getChargeElec()); discharge = discharge.add(calculateData.getDischargeElec()); @@ -626,7 +631,7 @@ public class OpenStationServiceImpl implements OpenStationService { calculateData.setDischargeElec(discharge); calculateData.setDate(summary); totalList.add(calculateData); - setSheetEarningsData(sheetsList, summaryData, totalList); + setSheetEarningsData(sheetsList, summaryData, totalList,lang); } ExcelUtil.exportExcel(sheetsList,response); }else{ @@ -649,7 +654,7 @@ public class OpenStationServiceImpl implements OpenStationService { name = idNameMap.get(stationId); if(dataList.size()>0){ dataList.add(pcsElecData); - setSheetElecData(sheetsList, name==null?"":name.replaceAll("/", " "), dataList); + setSheetElecData(sheetsList, name==null?"":name.replaceAll("/", " "), dataList,lang); } charge = charge.add(pcsElecData.getChargeElec()); discharge = discharge.add(pcsElecData.getDischargeElec()); @@ -664,7 +669,7 @@ public class OpenStationServiceImpl implements OpenStationService { pcsElecData.setDischargeElec(discharge); pcsElecData.setDate(summary); totalList.add(pcsElecData); - setSheetElecData(sheetsList, summaryData, totalList); + setSheetElecData(sheetsList, summaryData, totalList,lang); } ExcelUtil.exportExcel(sheetsList,response); } @@ -1024,7 +1029,7 @@ public class OpenStationServiceImpl implements OpenStationService { return data; } - private void setSheetElecData(List> sheetsList, String name, List dataList) { + private void setSheetElecData(List> sheetsList, String name, List dataList,String lang) { // 创建参数对象(用来设定excel的sheet1内容等信息) ExportParams userExportParams = new ExportParams(); // 设置sheet得名称 @@ -1034,13 +1039,25 @@ public class OpenStationServiceImpl implements OpenStationService { // title的参数为ExportParams类型,目前仅仅在ExportParams中设置了sheetName userExportMap.put("title", userExportParams); // 模版导出对应得实体类型 - userExportMap.put("entity", PcsElecData.class); - // sheet1中要填充得数据 - userExportMap.put("data", dataList); + if(RedisKeyConstant.User.EN_US.equals(lang)){ + userExportMap.put("entity", PcsElecDataEn.class); + List enList=new ArrayList<>(); + dataList.stream().forEach(s->{ + PcsElecDataEn en = new PcsElecDataEn(); + BeanUtils.copyProperties(s, en); + enList.add(en); + }); + // sheet1中要填充得数据 + userExportMap.put("data", enList); + }else{ + userExportMap.put("entity", PcsElecData.class); + // sheet1中要填充得数据 + userExportMap.put("data", dataList); + } sheetsList.add(userExportMap); } - private void setSheetEarningsData(List> sheetsList, String name, List dataList) { + private void setSheetEarningsData(List> sheetsList, String name, List dataList,String lang) { // 创建参数对象(用来设定excel的sheet1内容等信息) ExportParams userExportParams = new ExportParams(); // 设置sheet得名称 @@ -1050,9 +1067,21 @@ public class OpenStationServiceImpl implements OpenStationService { // title的参数为ExportParams类型,目前仅仅在ExportParams中设置了sheetName userExportMap.put("title", userExportParams); // 模版导出对应得实体类型 - userExportMap.put("entity", EarningsCalculateData.class); - // sheet1中要填充得数据 - userExportMap.put("data", dataList); + if(RedisKeyConstant.User.EN_US.equals(lang)){ + userExportMap.put("entity", EarningsCalculateDataEn.class); + List enList=new ArrayList<>(); + dataList.stream().forEach(s->{ + EarningsCalculateDataEn en = new EarningsCalculateDataEn(); + BeanUtils.copyProperties(s, en); + enList.add(en); + }); + // sheet1中要填充得数据 + userExportMap.put("data", enList); + }else{ + userExportMap.put("entity", EarningsCalculateData.class); + // sheet1中要填充得数据 + userExportMap.put("data", dataList); + } sheetsList.add(userExportMap); } } diff --git a/business-service-dao/src/main/java/com/ho/business/service/impl/PlanningCurveIssueServiceImpl.java b/business-service-dao/src/main/java/com/ho/business/service/impl/PlanningCurveIssueServiceImpl.java index e0bf446..dc3706a 100644 --- a/business-service-dao/src/main/java/com/ho/business/service/impl/PlanningCurveIssueServiceImpl.java +++ b/business-service-dao/src/main/java/com/ho/business/service/impl/PlanningCurveIssueServiceImpl.java @@ -7,6 +7,7 @@ import com.ho.business.entity.*; import com.ho.business.feignclient.UserFeignClient; import com.ho.business.mapper.PlanningCurveIssueMapper; import com.ho.business.mapper.PlanningCurveMapper; +import com.ho.business.service.DynamicConfigService; import com.ho.business.service.PlanningCurveIssueService; import com.ho.business.vo.DeviceTransfer; import com.ho.business.vo.resp.planningCurve.PlanningIssueQueryVo; @@ -18,6 +19,7 @@ import com.ho.common.tools.service.RedisService; import com.ho.datacollect.api.constant.DataCollectConstant; import com.ho.user.api.entity.SysUser; import com.ho.user.api.vo.req.QueryUserReqVO; +import jodd.util.StringUtil; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -42,6 +44,9 @@ public class PlanningCurveIssueServiceImpl implements PlanningCurveIssueService @Autowired private PlanningCurveMapper planningMapper; + @Autowired + private DynamicConfigService dynamicConfigService; + @Override public List> getIssueDevices(PlanningIssueDevice issueDevice) { return issueMapper.getIssueDevices(issueDevice); @@ -358,21 +363,27 @@ public class PlanningCurveIssueServiceImpl implements PlanningCurveIssueService planCurveOperationRecordReq.setLatestPlanningCurve(lastestOperateId); //获取电站的上一次计划曲线模板id String previousOperateId = null; - List result = issueMapper.getPlanCurveOperationList(String.valueOf(planCurveOperationRecordReq.getStationId())); + List result = issueMapper.getPlanCurveOperationList(String.valueOf(planCurveOperationRecordReq.getStationId()),null); //取成功下发的操作记录 result = result.stream().filter(e ->1==e.getStatus()).collect(Collectors.toList()); if(result.size()>0){ previousOperateId = result.get(0).getLatestPlanningCurve(); } planCurveOperationRecordReq.setPreviousPlanningCurve(previousOperateId); - + // 英文字段处理 + if(StringUtil.isNotBlank(planCurveOperationRecordReq.getOperateContent())){ + planCurveOperationRecordReq.setOperateContentEn(dynamicConfigService.getNameEn(planCurveOperationRecordReq.getOperateContent())); + } + if(StringUtil.isNotBlank(planCurveOperationRecordReq.getOperateResult())){ + planCurveOperationRecordReq.setOperateResultEn(dynamicConfigService.getNameEn(planCurveOperationRecordReq.getOperateResult())); + } //插入操作记录 issueMapper.planCurveOperationRecord(planCurveOperationRecordReq); } @Override - public List getPlanCurveOperationList(String stationId) { - List result = issueMapper.getPlanCurveOperationList(stationId); + public List getPlanCurveOperationList(String stationId,String lang) { + List result = issueMapper.getPlanCurveOperationList(stationId,lang); return result; } diff --git a/business-service-dao/src/main/java/com/ho/business/service/impl/PlanningCurveServiceImpl.java b/business-service-dao/src/main/java/com/ho/business/service/impl/PlanningCurveServiceImpl.java index ebe5048..6739fe0 100644 --- a/business-service-dao/src/main/java/com/ho/business/service/impl/PlanningCurveServiceImpl.java +++ b/business-service-dao/src/main/java/com/ho/business/service/impl/PlanningCurveServiceImpl.java @@ -10,10 +10,12 @@ import com.ho.business.entity.PlanningCurveTemplate; import com.ho.business.entity.Station; import com.ho.business.mapper.PlanningCurveMapper; import com.ho.business.mapper.PlanningCurveTacticsMapper; +import com.ho.business.service.DynamicConfigService; import com.ho.business.service.PlanningCurveService; import com.ho.business.service.StationService; import com.ho.common.tools.constant.DefineConstant; import com.ho.common.tools.entity.UserDetailRespVO; +import jodd.util.StringUtil; import lombok.extern.slf4j.Slf4j; import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.ss.usermodel.*; @@ -48,6 +50,9 @@ public class PlanningCurveServiceImpl implements PlanningCurveService { @Autowired private PlanningCurveTacticsMapper planningCurveTacticsMapper; + @Autowired + private DynamicConfigService dynamicConfigService; + @Override public List> getPlanningCurveTemplates(PlanningCurveTemplate template) { return planningMapper.getPlanningCurveTemplates(template); @@ -62,6 +67,11 @@ public class PlanningCurveServiceImpl implements PlanningCurveService { try { if (null != template) { + if(StringUtil.isNotBlank(template.getTemplateName())){ + // 摸版名字英文处理 + template.setTemplateNameEn(dynamicConfigService.getNameEn(template.getTemplateName())); + } + if (template.getPlanningCurves().size() <= 0) { result.put("code", 500); result.put("msg", DefineConstant.PeakShaving.TEMPLATE_CHECK_SIZE); @@ -101,6 +111,10 @@ public class PlanningCurveServiceImpl implements PlanningCurveService { result.put("msg", DefineConstant.PeakShaving.EDIT_TEMPLATE_SUCCESS); try { if (null != template && null != template.getTemId()) { + if(StringUtil.isNotBlank(template.getTemplateName())){ + // 摸版名字英文处理 + template.setTemplateNameEn(dynamicConfigService.getNameEn(template.getTemplateName())); + } Integer templateId = template.getTemId(); Map check = this.checkData(template, templateId); if (null != check) { diff --git a/business-service-dao/src/main/java/com/ho/business/service/impl/PointDemoServiceImpl.java b/business-service-dao/src/main/java/com/ho/business/service/impl/PointDemoServiceImpl.java index bcc9d4e..a4d643f 100644 --- a/business-service-dao/src/main/java/com/ho/business/service/impl/PointDemoServiceImpl.java +++ b/business-service-dao/src/main/java/com/ho/business/service/impl/PointDemoServiceImpl.java @@ -23,6 +23,7 @@ import com.ho.business.vo.req.configure.*; import com.ho.business.vo.resp.point.*; import com.ho.common.tools.constant.CommonConstant; import com.ho.common.tools.constant.DefineConstant; +import com.ho.common.tools.constant.RedisKeyConstant; import com.ho.common.tools.constant.TableConstant; import com.ho.common.tools.entity.PointCurveSrcCol; import com.ho.common.tools.exception.BaseResponseCode; @@ -108,6 +109,9 @@ public class PointDemoServiceImpl implements PointDemoService { @Autowired PlanningCurveService planningService; + @Autowired + DynamicConfigService dynamicConfigService; + @Override public List getPointList(PointReq pointReq) { Integer stationId = pointReq.getStationId(); @@ -121,13 +125,13 @@ public class PointDemoServiceImpl implements PointDemoService { return new ArrayList<>(); } if (srcId != null) { - deviceInfo = deviceService.selectByStationIdAndSrcId(stationId, srcId); + deviceInfo = deviceService.selectByStationIdAndSrcIdAndLng(stationId, srcId,pointReq.getLang()); if (deviceInfo != null && CommonConstant.ONE.equals(deviceInfo.getVirtual())) { realSrcId = deviceInfo.getFromId(); virtualDevice = true; virtualId = deviceInfo.getSrcId(); String deviceName = deviceInfo.getDeviceName(); - deviceInfo = deviceService.selectByStationIdAndSrcId(stationId, realSrcId); + deviceInfo = deviceService.selectByStationIdAndSrcIdAndLng(stationId, realSrcId,pointReq.getLang()); deviceInfo.setDeviceName(deviceName); } }else{ @@ -171,6 +175,7 @@ public class PointDemoServiceImpl implements PointDemoService { } deviceTypeColReqVO.setName("".equals(pointReq.getName()) ? null : pointReq.getName()); deviceTypeColReqVO.setSensType(pointReq.getSensType()); + deviceTypeColReqVO.setLang(pointReq.getLang()); //增加单位 List deviceTypeCols = modelDeviceService.selectByDeviceTypeList(deviceTypeColReqVO); Map deviceColMap = new HashMap<>(); @@ -400,7 +405,7 @@ public class PointDemoServiceImpl implements PointDemoService { if (device.getVirtual() == 0) { DeviceTypeConfig deviceTypeConfig = deviceTypeConfigService.selectByDeviceType(device.getDeviceType(), device.getGroupId()); if (deviceTypeConfig != null) { - deviceTypeCols = deviceTypeColService.selectByDeviceType(deviceTypeConfig.getDeviceType()); + deviceTypeCols = deviceTypeColService.selectByDeviceType(deviceTypeConfig.getDeviceType(),vo.getLang()); queryPointRespVo.setDeviceTypeName(deviceTypeConfig.getName()); } } else if (device.getVirtual() == 1) { @@ -408,6 +413,7 @@ public class PointDemoServiceImpl implements PointDemoService { VirtualDeviceCol virtualDeviceColReq = new VirtualDeviceCol(); virtualDeviceColReq.setStationId(vo.getStationId()); virtualDeviceColReq.setSrcId(srcId); + virtualDeviceColReq.setLang(vo.getLang()); List virtualColList = virtualDeviceColService.getList(virtualDeviceColReq); for (VirtualDeviceColResp virtualDeviceColResp : virtualColList) { DeviceTypeCol deviceTypeCol = new DeviceTypeCol(); @@ -455,7 +461,7 @@ public class PointDemoServiceImpl implements PointDemoService { if (device.getVirtual() == 0) { DeviceTypeConfig deviceTypeConfig = deviceTypeConfigService.selectByDeviceType(device.getDeviceType(), device.getGroupId()); if (deviceTypeConfig != null) { - deviceTypeCols = deviceTypeColService.selectByDeviceType(deviceTypeConfig.getDeviceType()); + deviceTypeCols = deviceTypeColService.selectByDeviceType(deviceTypeConfig.getDeviceType(),vo.getLang()); queryPointRespVo.setDeviceTypeName(deviceTypeConfig.getName()); } } @@ -661,7 +667,7 @@ public class PointDemoServiceImpl implements PointDemoService { Map colMaxMap = new HashMap<>(); Map colMinMap = new HashMap<>(); for (PointCurveSrcCol pointCurveSrcCol : deviceIdList) { - Device device = deviceService.selectByStationIdAndSrcId(pointCurveReq.getStationId(), pointCurveSrcCol.getSrcId()); + Device device = deviceService.selectByStationIdAndSrcIdAndLng(pointCurveReq.getStationId(), pointCurveSrcCol.getSrcId(),pointCurveReq.getLang()); DeviceTypeConfig deviceTypeConfig = new DeviceTypeConfig(); if (device != null && device.getDeviceType() != null) { deviceTypeConfig = deviceTypeConfigService.selectByDeviceType(device.getDeviceType(), device.getGroupId()); @@ -672,7 +678,7 @@ public class PointDemoServiceImpl implements PointDemoService { srcIdAndDeviceTypeMap.put(pointCurveSrcCol.getSrcId(), device.getDeviceType()); pointCurveSrcCol.setDeviceType(device.getDeviceType()); } - List deviceTypeCols = deviceTypeColService.selectDeviceTypeColList(pointCurveSrcCol.getDeviceType(), pointCurveSrcCol.getCols()); + List deviceTypeCols = deviceTypeColService.selectDeviceTypeColList(pointCurveSrcCol.getDeviceType(), pointCurveSrcCol.getCols(),pointCurveReq.getLang()); Map nameMap = deviceTypeCols.stream().collect(Collectors.toMap(s -> s.getDeviceType() + "_" + s.getCol(), DeviceTypeCol::getColName)); Map maxMap = deviceTypeCols.stream().collect(Collectors.toMap(s -> s.getDeviceType() + "_" + s.getCol(), DeviceTypeCol::getMaxValue)); Map minMap = deviceTypeCols.stream().collect(Collectors.toMap(s -> s.getDeviceType() + "_" + s.getCol(), DeviceTypeCol::getMinValue));; @@ -814,12 +820,12 @@ public class PointDemoServiceImpl implements PointDemoService { Map colMinMap = new HashMap<>(); for (PointCurveSrcCol pointCurveSrcCol : deviceIdList) { - Device device = deviceService.selectByStationIdAndSrcId(pointCurveReq.getStationId(), pointCurveSrcCol.getSrcId()); + Device device = deviceService.selectByStationIdAndSrcIdAndLng(pointCurveReq.getStationId(), pointCurveSrcCol.getSrcId(),pointCurveReq.getLang()); DeviceTypeConfig deviceTypeConfig = new DeviceTypeConfig(); if (device != null && device.getDeviceType() != null) { //若是虚拟设备,则取来自的真实设备 if (device.getSrcId() < 0) { - device = deviceService.selectByStationIdAndSrcId(pointCurveReq.getStationId(), device.getFromId()); + device = deviceService.selectByStationIdAndSrcIdAndLng(pointCurveReq.getStationId(), device.getFromId(),pointCurveReq.getLang()); pointCurveSrcCol.setSrcId(device.getSrcId()); } pointCurveSrcCol.setDeviceName(device.getDeviceName()); @@ -831,7 +837,7 @@ public class PointDemoServiceImpl implements PointDemoService { srcIdAndDeviceTypeMap.put(pointCurveSrcCol.getSrcId(), device.getDeviceType()); pointCurveSrcCol.setDeviceType(device.getDeviceType()); } - List deviceTypeCols = deviceTypeColService.selectDeviceTypeColList(pointCurveSrcCol.getDeviceType(), pointCurveSrcCol.getCols()); + List deviceTypeCols = deviceTypeColService.selectDeviceTypeColList(pointCurveSrcCol.getDeviceType(), pointCurveSrcCol.getCols(),pointCurveReq.getLang()); Map nameMap = deviceTypeCols.stream().collect(Collectors.toMap(s -> s.getDeviceType() + "_" + s.getCol(), DeviceTypeCol::getColName)); Map maxMap = deviceTypeCols.stream().collect(Collectors.toMap(s -> s.getDeviceType() + "_" + s.getCol(), DeviceTypeCol::getMaxValue)); Map minMap = deviceTypeCols.stream().collect(Collectors.toMap(s -> s.getDeviceType() + "_" + s.getCol(), DeviceTypeCol::getMinValue));; @@ -943,10 +949,10 @@ public class PointDemoServiceImpl implements PointDemoService { // srcIdAndNameMap.put(id, device.getDeviceName()); // srcIdAndDeviceTypeMap.put(id, device.getDeviceType()); // } - Device device = deviceService.selectByStationIdAndSrcId(pointCurveReq.getStationId(), pointCurveSrcCol.getSrcId()); + Device device = deviceService.selectByStationIdAndSrcIdAndLng(pointCurveReq.getStationId(), pointCurveSrcCol.getSrcId(),pointCurveReq.getLang()); Integer realSrcId = device.getFromId(); if (device != null && device.getVirtual() == 1) { - device = deviceService.selectByStationIdAndSrcId(pointCurveReq.getStationId(), device.getFromId()); + device = deviceService.selectByStationIdAndSrcIdAndLng(pointCurveReq.getStationId(), device.getFromId(),pointCurveReq.getLang()); //此时把 pointCurveSrcCol 的设备id设置为真实设备id pointCurveSrcCol.setSrcId(realSrcId); } @@ -982,7 +988,7 @@ public class PointDemoServiceImpl implements PointDemoService { List yxCols = new ArrayList<>(); List ycCols = new ArrayList<>(); for (String col : cols) { - DeviceTypeCol deviceTypeCol = deviceTypeColService.selectTypeAndCol(col, device.getDeviceType()); + DeviceTypeCol deviceTypeCol = deviceTypeColService.selectTypeAndCol(col, device.getDeviceType(),pointCurveReq.getLang()); if (deviceTypeCol != null) { if (CommonConstant.ONE.equals(pointCurveReq.getIsOriginal())) { yxCols.add(col); @@ -1123,7 +1129,7 @@ public class PointDemoServiceImpl implements PointDemoService { if (pointCurveResp.getSrcId().equals(pointCurveSrcCol.getSrcId())) { Device device = deviceService.selectByStationIdAndSrcId(pointCurveReq.getStationId(), pointCurveSrcCol.getSrcId()); //根据deviceType和col进行在deviceTypeCol表 - DeviceTypeCol deviceTypeCol = deviceTypeColService.selectTypeAndCol(pointCurveResp.getCol(), device.getDeviceType()); + DeviceTypeCol deviceTypeCol = deviceTypeColService.selectTypeAndCol(pointCurveResp.getCol(), device.getDeviceType(),pointCurveReq.getLang()); if (deviceTypeCol != null) { pointCurveResp.setUnit(deviceTypeCol.getUnit()); pointCurveResp.setColName(deviceTypeCol.getColName()); @@ -1141,7 +1147,7 @@ public class PointDemoServiceImpl implements PointDemoService { point.setCol(pointCurveResp.getCol()); point.setDeviceName(srcIdAndNameMap.get(pointCurveResp.getSrcId())); //根据deviceType 和col进行查询colName - DeviceTypeCol deviceTypeCol = deviceTypeColService.selectTypeAndCol(pointCurveResp.getCol(), deviceType); + DeviceTypeCol deviceTypeCol = deviceTypeColService.selectTypeAndCol(pointCurveResp.getCol(), deviceType,pointCurveReq.getLang()); point.setColName(deviceTypeCol.getColName()); point.setStaticCurveList(new ArrayList<>()); point.setUnit(deviceTypeCol.getUnit()); @@ -1162,7 +1168,7 @@ public class PointDemoServiceImpl implements PointDemoService { pointCurveResp.setCol(col); pointCurveResp.setDeviceName(srcIdAndNameMap.get(pointCurveSrcCol.getSrcId())); //根据deviceType 和col进行查询colName - deviceTypeCol = deviceTypeColService.selectTypeAndCol(pointCurveResp.getCol(), deviceType); + deviceTypeCol = deviceTypeColService.selectTypeAndCol(pointCurveResp.getCol(), deviceType,pointCurveReq.getLang()); pointCurveResp.setColName(deviceTypeCol.getColName()); pointCurveResp.setStaticCurveList(new ArrayList<>()); pointCurveResp.setUnit(deviceTypeCol.getUnit()); @@ -1363,7 +1369,12 @@ public class PointDemoServiceImpl implements PointDemoService { } } List titleList = new ArrayList<>(); - String time = DefineConstant.PointDemo.TIME; + String time; + if(RedisKeyConstant.User.EN_US.equals(pointCurveReq.getLang())){ + time = DefineConstant.PointDemo.TIME_EN; + }else{ + time = DefineConstant.PointDemo.TIME; + } if (!CommonConstant.ONE.equals(pointCurveReq.getPageType())) { titleList.add(time); } @@ -1550,12 +1561,12 @@ public class PointDemoServiceImpl implements PointDemoService { Map colNameMap = new HashMap<>(); for (PointCurveSrcCol pointCurveSrcCol : deviceIdList) { - Device device = deviceService.selectByStationIdAndSrcId(pointCurveReq.getStationId(), pointCurveSrcCol.getSrcId()); + Device device = deviceService.selectByStationIdAndSrcIdAndLng(pointCurveReq.getStationId(), pointCurveSrcCol.getSrcId(),pointCurveReq.getLang()); DeviceTypeConfig deviceTypeConfig = new DeviceTypeConfig(); if (device != null && device.getDeviceType() != null) { //若是虚拟设备,则取来自的真实设备 if (device.getSrcId() < 0) { - device = deviceService.selectByStationIdAndSrcId(pointCurveReq.getStationId(), device.getFromId()); + device = deviceService.selectByStationIdAndSrcIdAndLng(pointCurveReq.getStationId(), device.getFromId(),pointCurveReq.getLang()); pointCurveSrcCol.setSrcId(device.getSrcId()); } pointCurveSrcCol.setDeviceName(device.getDeviceName()); @@ -1567,7 +1578,7 @@ public class PointDemoServiceImpl implements PointDemoService { srcIdAndDeviceTypeMap.put(pointCurveSrcCol.getSrcId(), device.getDeviceType()); pointCurveSrcCol.setDeviceType(device.getDeviceType()); } - List deviceTypeCols = deviceTypeColService.selectDeviceTypeColList(pointCurveSrcCol.getDeviceType(), pointCurveSrcCol.getCols()); + List deviceTypeCols = deviceTypeColService.selectDeviceTypeColList(pointCurveSrcCol.getDeviceType(), pointCurveSrcCol.getCols(),pointCurveReq.getLang()); Map nameMap = deviceTypeCols.stream().collect(Collectors.toMap(s -> s.getDeviceType() + "_" + s.getCol(), DeviceTypeCol::getColName)); colNameMap.putAll(nameMap); } @@ -1762,12 +1773,12 @@ public class PointDemoServiceImpl implements PointDemoService { Map colNameMap = new HashMap<>(); for (PointCurveSrcCol pointCurveSrcCol : deviceIdList) { - Device device = deviceService.selectByStationIdAndSrcId(pointCurveReq.getStationId(), pointCurveSrcCol.getSrcId()); + Device device = deviceService.selectByStationIdAndSrcIdAndLng(pointCurveReq.getStationId(), pointCurveSrcCol.getSrcId(),pointCurveReq.getLang()); DeviceTypeConfig deviceTypeConfig = new DeviceTypeConfig(); if (device != null && device.getDeviceType() != null) { //若是虚拟设备,则取来自的真实设备 if (device.getSrcId() < 0) { - device = deviceService.selectByStationIdAndSrcId(pointCurveReq.getStationId(), device.getFromId()); + device = deviceService.selectByStationIdAndSrcIdAndLng(pointCurveReq.getStationId(), device.getFromId(),pointCurveReq.getLang()); pointCurveSrcCol.setSrcId(device.getSrcId()); } pointCurveSrcCol.setDeviceName(device.getDeviceName()); @@ -1779,7 +1790,7 @@ public class PointDemoServiceImpl implements PointDemoService { srcIdAndDeviceTypeMap.put(pointCurveSrcCol.getSrcId(), device.getDeviceType()); pointCurveSrcCol.setDeviceType(device.getDeviceType()); } - List deviceTypeCols = deviceTypeColService.selectDeviceTypeColList(pointCurveSrcCol.getDeviceType(), pointCurveSrcCol.getCols()); + List deviceTypeCols = deviceTypeColService.selectDeviceTypeColList(pointCurveSrcCol.getDeviceType(), pointCurveSrcCol.getCols(),pointCurveReq.getLang()); Map nameMap = deviceTypeCols.stream().collect(Collectors.toMap(s -> s.getDeviceType() + "_" + s.getCol(), DeviceTypeCol::getColName)); colNameMap.putAll(nameMap); } diff --git a/business-service-dao/src/main/java/com/ho/business/service/impl/StationHomeServiceImpl.java b/business-service-dao/src/main/java/com/ho/business/service/impl/StationHomeServiceImpl.java index abd5073..b2ec14a 100644 --- a/business-service-dao/src/main/java/com/ho/business/service/impl/StationHomeServiceImpl.java +++ b/business-service-dao/src/main/java/com/ho/business/service/impl/StationHomeServiceImpl.java @@ -33,6 +33,7 @@ import com.ho.business.vo.resp.station.ActiveReactivePower; import com.ho.business.vo.resp.station.NewRealTimeCurveVo; import com.ho.common.tools.constant.CommonConstant; import com.ho.common.tools.constant.DefineConstant; +import com.ho.common.tools.constant.RedisKeyConstant; import com.ho.common.tools.entity.PointCurveSrcCol; import com.ho.common.tools.exception.BaseResponseCode; import com.ho.common.tools.exception.BusinessException; @@ -297,7 +298,7 @@ public class StationHomeServiceImpl implements StationHomeService { vo.setDeviceName(deviceRespVO.getDeviceName()); if (pointTableData != null) { //BMS过滤超过最大最小值的数据 - DeviceTypeCol deviceTypeCol = deviceTypeColService.selectTypeAndCol(socPowerData.getDeviceIdList().get(0).getCols().get(0), deviceRespVO.getDeviceType()); + DeviceTypeCol deviceTypeCol = deviceTypeColService.selectTypeAndCol(socPowerData.getDeviceIdList().get(0).getCols().get(0), deviceRespVO.getDeviceType(),null); BigDecimal maxValue = deviceTypeCol.getMaxValue(); BigDecimal minValue = deviceTypeCol.getMinValue(); if(maxValue!= null && minValue!= null){ @@ -554,7 +555,7 @@ public class StationHomeServiceImpl implements StationHomeService { if (cols.isEmpty()) { cols.add(compListByType.get(0).getDeviceCol()); } - DeviceTypeCol deviceTypeCol = deviceTypeColService.selectTypeAndCol(cols.get(0), deviceValue.getDeviceType()); + DeviceTypeCol deviceTypeCol = deviceTypeColService.selectTypeAndCol(cols.get(0), deviceValue.getDeviceType(),null); deviceColData.setSensType(deviceTypeCol.getSensType()); pointCurveSrcCol.setCols(cols); deviceIdList.add(pointCurveSrcCol); @@ -641,9 +642,19 @@ public class StationHomeServiceImpl implements StationHomeService { //计算运行天数 String operationDayStr = null; if (station.getStatus().equals(CommonConstant.TWO)) { - operationDayStr = DefineConstant.StationHome.BUILDING; + if(RedisKeyConstant.User.EN_US.equals(req.getLang())){ + //切换为英文 + operationDayStr = DefineConstant.StationHome.BUILDING_EN; + }else{ + operationDayStr = DefineConstant.StationHome.BUILDING; + } } else if (station.getStatus().equals(CommonConstant.THREE)) { - operationDayStr = DefineConstant.StationHome.PROPOSED; + if(RedisKeyConstant.User.EN_US.equals(req.getLang())){ + //切换为英文 + operationDayStr = DefineConstant.StationHome.PROPOSED_EN; + }else{ + operationDayStr = DefineConstant.StationHome.PROPOSED; + } } else { long operationDays = DateUtil.between(station.getGridTime(), new Date(), DateUnit.DAY); operationDayStr = Long.toString(operationDays); diff --git a/business-service-dao/src/main/java/com/ho/business/service/impl/StationServiceImpl.java b/business-service-dao/src/main/java/com/ho/business/service/impl/StationServiceImpl.java index 671664d..bb49fce 100644 --- a/business-service-dao/src/main/java/com/ho/business/service/impl/StationServiceImpl.java +++ b/business-service-dao/src/main/java/com/ho/business/service/impl/StationServiceImpl.java @@ -10,7 +10,7 @@ import com.ho.business.entity.*; import com.ho.business.feignclient.FileCenterFeignClient; import com.ho.business.feignclient.FlowFeignClient; import com.ho.business.feignclient.UserFeignClient; -import com.ho.business.mapper.TranslateNationMapper; +import com.ho.business.mapper.TranslateNameMapper; import com.ho.business.mapper.TranslateProvinceMapper; import com.ho.business.mapper.StationMapper; import com.ho.business.service.*; @@ -100,9 +100,6 @@ public class StationServiceImpl implements StationService { @Autowired TranslateProvinceMapper translateProvinceMapper; - @Autowired - TranslateNationMapper translateNationMapper; - @Value("${station.timeDifference}") Integer minute; diff --git a/business-service-dao/src/main/java/com/ho/business/service/impl/VirtualDeviceColServiceImpl.java b/business-service-dao/src/main/java/com/ho/business/service/impl/VirtualDeviceColServiceImpl.java index b73a438..6cbff65 100644 --- a/business-service-dao/src/main/java/com/ho/business/service/impl/VirtualDeviceColServiceImpl.java +++ b/business-service-dao/src/main/java/com/ho/business/service/impl/VirtualDeviceColServiceImpl.java @@ -119,7 +119,7 @@ public class VirtualDeviceColServiceImpl implements VirtualDeviceColService { } virtualDeviceColList = new ArrayList<>(); String deviceType = deviceValue.getDeviceType().replace(UNDERLINE + vo.getModelStationId(), UNDERLINE + vo.getStationId()); - List deviceTypeCols = deviceTypeColService.selectByDeviceType(deviceType); + List deviceTypeCols = deviceTypeColService.selectByDeviceType(deviceType,null); Map> modelMap = deviceTypeCols.stream().collect(Collectors.groupingBy(DeviceTypeCol::getCol)); //根据col进行数据对比,更换device_col_id for (VirtualDeviceColResp virtualDeviceColResp : virtualDeviceColRespList) { diff --git a/business-service-dao/src/main/resources/mapper/CurveConfigMapper.xml b/business-service-dao/src/main/resources/mapper/CurveConfigMapper.xml index 5065a55..d52077e 100644 --- a/business-service-dao/src/main/resources/mapper/CurveConfigMapper.xml +++ b/business-service-dao/src/main/resources/mapper/CurveConfigMapper.xml @@ -35,9 +35,14 @@ select @@ -81,7 +87,14 @@ select - + + + + + + + + from device_type_col @@ -103,7 +118,14 @@ select - + + + + + + + + from device_type_col @@ -197,7 +226,14 @@ select - + + + + + + + + from his_curve_relate diff --git a/business-service-dao/src/main/resources/mapper/PlanningCurveIssueMapper.xml b/business-service-dao/src/main/resources/mapper/PlanningCurveIssueMapper.xml index 94e755f..b3eec32 100644 --- a/business-service-dao/src/main/resources/mapper/PlanningCurveIssueMapper.xml +++ b/business-service-dao/src/main/resources/mapper/PlanningCurveIssueMapper.xml @@ -6,12 +6,29 @@ @@ -110,11 +127,12 @@ insert into planning_curve_operation_record - (user_id,user_name,operate_time,operate_content,operate_result,effective_time,status,previous_planning_curve,latest_planning_curve,station_id) - values ( - #{condition.userId},#{condition.userName},#{condition.operateTime},#{condition.operateContent},#{condition.operateResult}, - #{condition.effectiveTime},#{condition.status},#{condition.previousPlanningCurve},#{condition.latestPlanningCurve},#{condition.stationId} - ) + (user_id,user_name,operate_time,operate_content,operate_content_en,operate_result,operate_result_en,effective_time,status,previous_planning_curve,latest_planning_curve,station_id) + values ( + #{condition.userId},#{condition.userName},#{condition.operateTime},#{condition.operateContent},#{condition.operateContentEn}, + #{condition.operateResult},#{condition.operateResultEn}, + #{condition.effectiveTime},#{condition.status},#{condition.previousPlanningCurve},#{condition.latestPlanningCurve},#{condition.stationId} + ) @@ -125,8 +143,25 @@ @@ -67,22 +76,22 @@ - insert into planning_curve_template ( id,template_no,template_name, - - station_id, - - - group_id, - - income,status,p,capacity,soc_upper,soc_lower,create_time ) - values( #{temId},#{templateNo},#{templateName}, - - #{stationId}, - - - #{groupId}, - - #{income},#{status},#{temP},#{capacity},#{socUpper},#{socLower},sysdate() ) + insert into planning_curve_template ( id,template_no,template_name,template_name_en, + + station_id, + + + group_id, + + income,status,p,capacity,soc_upper,soc_lower,create_time ) + values( #{temId},#{templateNo},#{templateName},#{templateNameEn}, + + #{stationId}, + + + #{groupId}, + + #{income},#{status},#{temP},#{capacity},#{socUpper},#{socLower},sysdate() ) @@ -102,6 +111,9 @@ template_name = #{templateName}, + + template_name_en = #{templateNameEn}, + - - com.hoenergy - flowable-src - ${flowable-src.version} - system - ${project.basedir}/src/main/resources/lib/flowable-src-1.0.jar - - - com.hoenergy - common-tools - - - com.hoenergy - flowable-center-dao - - - + + + + + + + + + + + + + + + + + com.hoenergy flowable-center-dao diff --git a/flowable-center/src/main/java/com/ho/flow/controller/EventController.java b/flowable-center/src/main/java/com/ho/flow/controller/EventController.java index ab0362f..fadd636 100644 --- a/flowable-center/src/main/java/com/ho/flow/controller/EventController.java +++ b/flowable-center/src/main/java/com/ho/flow/controller/EventController.java @@ -31,6 +31,7 @@ import com.ho.flow.vo.req.event.EventWorkOrder; import com.ho.flow.vo.resp.event.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import jodd.util.StringUtil; import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.CellType; import org.apache.poi.ss.usermodel.Row; @@ -101,6 +102,7 @@ public class EventController { //@LogAnnotation(title = "告警管理", action = "分页查询告警信息") public DataResult> page(@RequestBody @Valid EventReqPageVO vo, HttpServletRequest request) { + vo.setLang(request.getHeader(RedisKeyConstant.User.LANG)); //如果有srcIdList ,则根据这个查询deviceType List srcIdList = vo.getSrcIdList(); @@ -224,6 +226,7 @@ public class EventController { //@LogAnnotation(title = "告警管理", action = "分页查询告警历史信息") public DataResult> hispage(@RequestBody @Valid EventReqPageVO vo, HttpServletRequest request) { + vo.setLang(request.getHeader(RedisKeyConstant.User.LANG)); DataResult> result = DataResult.success(); String token = request.getHeader(RedisKeyConstant.User.ACCESS_TOKEN); SimpleUser user = redisService.getSimpleUserByToken(token); @@ -418,6 +421,10 @@ public class EventController { request) { String token = request.getHeader(RedisKeyConstant.User.ACCESS_TOKEN); SimpleUser user = redisService.getSimpleUserByToken(token); + String lang = request.getHeader(RedisKeyConstant.User.LANG); + list.stream().forEach(s->{ + s.setLang(lang); + }); List eventRespVOList = eventService.dropDownBatchList(user, list); return DataResult.success(eventRespVOList); } @@ -517,6 +524,7 @@ public class EventController { @PostMapping("/exportEvnData") @ApiOperation(value = "导出实时告警数据") public void exportEvnData(@RequestBody @Valid EventReqPageVO vo, HttpServletRequest request, HttpServletResponse response) { + vo.setLang(request.getHeader(RedisKeyConstant.User.LANG)); //如果有srcIdList ,则根据这个查询deviceType List srcIdList = vo.getSrcIdList(); if (srcIdList != null && !srcIdList.isEmpty()) { @@ -789,4 +797,17 @@ public class EventController { return DataResult.success(result); } + + @PostMapping("updatePointNameEn") + @ApiOperation(value = "修改表中点名称英文") + @TokenIgnore + public DataResult updatePointNameEn(String tableName,String name,String nameEn) { + int count = 0; + if(StringUtil.isNotBlank(tableName) + &&StringUtil.isNotBlank(name) + &&StringUtil.isNotBlank(nameEn)){ + count = eventService.updatePointNameEn(tableName,name,nameEn); + } + return DataResult.success(count); + } } diff --git a/flowable-center/src/main/java/com/ho/flow/service/FlowOutApiService.java b/flowable-center/src/main/java/com/ho/flow/service/FlowOutApiService.java new file mode 100644 index 0000000..ce290ad --- /dev/null +++ b/flowable-center/src/main/java/com/ho/flow/service/FlowOutApiService.java @@ -0,0 +1,33 @@ +package com.ho.flow.service; + +import com.alibaba.fastjson.JSONObject; +import com.ho.common.tools.exception.DataResult; +import com.ho.flow.vo.AlarmConfig; +import com.ho.flow.vo.Event; +import com.ho.flow.vo.req.AlarmConfig.AlarmConfigQueryVo; +import com.ho.flow.vo.req.event.EventAddReq; +import com.ho.flow.vo.resp.StationStatusRespVO; +import com.ho.flow.vo.resp.event.EventTypeAndLevelsReqVO; + +import java.util.List; +import java.util.Map; + +/** + * @author kerwin flowable-src-1.0.jar原有 + */ +public interface FlowOutApiService { + + Map> matchEventRecords(EventAddReq eventAddReq, JSONObject dataSet, Map stationConfigMap, Map groupConfigMap); + + Boolean isRecoveryDevice(AlarmConfigQueryVo alarmConfigQueryVo); + + List isNormalStation(AlarmConfigQueryVo alarmConfigQueryVo); + + void polymerizationAlarm(EventAddReq eventAddReq, List groupAlarmConfigs, List stationAlarmConfigs); + + Event getNotRecovered(AlarmConfigQueryVo stationStatusReq); + + EventTypeAndLevelsReqVO getAlarmDataStatistics(AlarmConfigQueryVo stationStatusReq); + + DataResult addEvents(List list); +} diff --git a/flowable-center/src/main/java/com/ho/flow/service/impl/FlowOutApiServiceImpl.java b/flowable-center/src/main/java/com/ho/flow/service/impl/FlowOutApiServiceImpl.java new file mode 100644 index 0000000..b20a0b0 --- /dev/null +++ b/flowable-center/src/main/java/com/ho/flow/service/impl/FlowOutApiServiceImpl.java @@ -0,0 +1,711 @@ +package com.ho.flow.service.impl; + +import cn.hutool.core.date.DateTime; +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.lang.Snowflake; +import com.alibaba.fastjson.JSONObject; +import com.ho.business.entity.Station; +import com.ho.business.vo.DeviceTransfer; +import com.ho.common.tools.constant.CommonConstant; +import com.ho.common.tools.entity.UserDetailRespVO; +import com.ho.common.tools.exception.DataResult; +import com.ho.common.tools.service.RedisService; +import com.ho.flow.entity.process.MovementDTO; +import com.ho.flow.feignclient.BusinessFeignClient; +import com.ho.flow.mapper.AlarmConfigMapper; +import com.ho.flow.mapper.EventMapper; +import com.ho.flow.monitor.EventToProcessMonitor; +import com.ho.flow.service.AlarmConfigService; +import com.ho.flow.service.EventService; +import com.ho.flow.service.FlowOutApiService; +import com.ho.flow.service.SendSmsConfigService; +import com.ho.flow.vo.AlarmConfig; +import com.ho.flow.vo.Event; +import com.ho.flow.vo.req.AlarmConfig.AlarmConfigQueryVo; +import com.ho.flow.vo.req.SendSmsConfig.SendSmsConfigQueryReq; +import com.ho.flow.vo.req.event.EventAddReq; +import com.ho.flow.vo.resp.StationStatusRespVO; +import com.ho.flow.vo.resp.event.EventTypeAndLevelsReqVO; +import org.apache.commons.lang.time.DateFormatUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.scheduling.annotation.Async; +import org.springframework.stereotype.Service; + +import java.math.BigDecimal; +import java.text.SimpleDateFormat; +import java.util.*; +import java.util.stream.Collectors; + +/** + * @author kerwin 原有flowable-src-1.0.jar + */ +@Service +@ConditionalOnProperty( + name = {"switch.usedDefaultAlarmLogic"}, + havingValue = "true", + matchIfMissing = true +) +public class FlowOutApiServiceImpl implements FlowOutApiService { + private static final Logger log = LoggerFactory.getLogger(FlowOutApiServiceImpl.class); + @Autowired + Snowflake snowflake; + @Autowired + RedisService redisService; + @Autowired + EventMapper eventMapper; + @Autowired + AlarmConfigMapper alarmConfigMapper; + @Autowired + BusinessFeignClient businessFeignClient; + @Autowired + SendSmsConfigService sendSmsConfigService; + @Autowired + AlarmConfigService alarmConfigService; + @Autowired + EventService eventService; + @Value("${spring.activiti.flag}") + private Integer flag; + EventToProcessMonitor monitor = new EventToProcessMonitor(); + + public FlowOutApiServiceImpl() { + } + + public Map> matchEventRecords(EventAddReq eventAddReq, JSONObject dataSet, Map stationConfigMap, Map groupConfigMap) { + Map> resultMap = this.receiveEvent(eventAddReq, dataSet, stationConfigMap, groupConfigMap); + return resultMap; + } + + public Map> receiveEvent(EventAddReq eventAddReq, JSONObject dataSet, Map stationConfigMap, Map groupConfigMap) { + Map> resultMap = new HashMap(); + List events = new ArrayList(); + List updateEvents = new ArrayList(); + List updateEventStatus = new ArrayList(); + Date date = new Date(); + String redisKey = eventAddReq.getDeviceType() + ":" + eventAddReq.getStationId() + ":" + eventAddReq.getSrcId(); + Map hgetall = this.redisService.hgetall(redisKey); + DeviceTransfer deviceTransfer = null; + Iterator var13 = dataSet.entrySet().iterator(); + + while(true) { + while(true) { + String k; + Object v; + AlarmConfig alarmConfig; + do { + do { + if (!var13.hasNext()) { + resultMap.put("updateEvents", updateEvents); + resultMap.put("events", events); + resultMap.put("updateEventStatus", updateEventStatus); + return resultMap; + } + + Map.Entry entry = (Map.Entry)var13.next(); + k = (String)entry.getKey(); + v = entry.getValue(); + } while(v == null); + + alarmConfig = null; + if (stationConfigMap.containsKey(k)) { + alarmConfig = (AlarmConfig)stationConfigMap.get(k); + } else if (groupConfigMap.containsKey(k)) { + alarmConfig = (AlarmConfig)groupConfigMap.get(k); + } + } while(alarmConfig == null); + + Event event = new Event(); + boolean needSave = false; + event.setSensType(alarmConfig.getSensType()); + if (CommonConstant.EventSignal.SIGNAL.equals(alarmConfig.getSensType())) { + needSave = true; + Integer value = (Integer)v; + String info = null; + if (eventAddReq.getDeviceType().contains("communicationStatus")) { + if (CommonConstant.ONE.equals(value)) { + info = alarmConfig.getInfo0(); + event.setIsRecovery(CommonConstant.ONE); + event.setEventLevel(CommonConstant.EventLevel.notice); + } else { + info = alarmConfig.getInfo1(); + event.setIsRecovery(CommonConstant.ZERO); + event.setEventLevel(alarmConfig.getAlarmLevel()); + } + } else if ("communicationStatus".equals(k)) { + if (CommonConstant.ZERO.equals(value)) { + info = alarmConfig.getInfo0(); + event.setIsRecovery(CommonConstant.ZERO); + event.setEventLevel(alarmConfig.getAlarmLevel()); + } else if (CommonConstant.ONE.equals(value)) { + info = alarmConfig.getInfo1(); + event.setIsRecovery(CommonConstant.ONE); + event.setEventLevel(CommonConstant.EventLevel.notice); + } + } else if (CommonConstant.ZERO.equals(value)) { + info = alarmConfig.getInfo0(); + event.setIsRecovery(CommonConstant.ONE); + event.setEventLevel(CommonConstant.EventLevel.notice); + } else if (value > CommonConstant.ZERO) { + info = alarmConfig.getInfo1(); + event.setIsRecovery(CommonConstant.ZERO); + event.setEventLevel(alarmConfig.getAlarmLevel()); + } + + event.setDescription(info); + event.setDescriptionEn(eventService.getNameEn(event.getDescription())); + } else if (CommonConstant.EventSignal.TELEMETER.equals(alarmConfig.getSensType())) { + BigDecimal lowerLimit = alarmConfig.getLowerLimit(); + BigDecimal upperLimit = alarmConfig.getUpperLimit(); + BigDecimal value = new BigDecimal(String.valueOf(v)); + String desc = alarmConfig.getColName() + "恢复"; + if (upperLimit != null && value.compareTo(upperLimit) > 0) { + needSave = true; + desc = alarmConfig.getColName() + " 越上限"; + } + + if (lowerLimit != null && value.compareTo(lowerLimit) < 0) { + needSave = true; + desc = alarmConfig.getColName() + " 越下限"; + } + + event.setIsRecovery(CommonConstant.ONE); + event.setEventLevel(CommonConstant.EventLevel.notice); + if (needSave) { + event.setIsRecovery(CommonConstant.ZERO); + event.setEventLevel(CommonConstant.EventLevel.overLimit); + } + + event.setDescription(desc); + event.setDescriptionEn(eventService.getNameEn(event.getDescription())); + } + + Event eventLast = null; + deviceTransfer = (DeviceTransfer)hgetall.get(k); + if (null != deviceTransfer) { + Long eventId = deviceTransfer.getEventId(); + Integer isRecovery = deviceTransfer.getIsRecovery(); + if (null != isRecovery && null != eventId) { + eventLast = new Event(); + eventLast.setIsRecovery(isRecovery); + eventLast.setId(eventId); + } + } + + needSave = true; + long id; + if (CommonConstant.ONE.equals(event.getIsRecovery())) { + if (null != eventLast && !CommonConstant.ONE.equals(eventLast.getIsRecovery())) { + id = this.snowflake.nextId(); + log.info("new recovery event snowflake id: {},event_level:{},alarmStationId:{},targetDevice:{},deviceType:{},signal:{}", new Object[]{id, event.getEventLevel(), eventAddReq.getStationId(), eventAddReq.getSrcId(), eventAddReq.getDeviceType(), k}); + event.setId(id); + event.setSignal(k); + event.setBeforeEventId(eventLast.getId()); + this.generateAlarm(eventAddReq, v, event); + log.info("new recovery event update redis before:{},redisKey:{},k:{}", new Object[]{this.redisService.hget(redisKey, k), redisKey, k}); + deviceTransfer.setEventId(event.getId()); + deviceTransfer.setIsRecovery(event.getIsRecovery()); + this.redisService.hset(redisKey, k, deviceTransfer); + log.info("new recovery event update redis after:{},redisKey:{},k:{}", new Object[]{this.redisService.hget(redisKey, k), redisKey, k}); + Event conformEvent = new Event(); + conformEvent.setConfirmMan("system"); + conformEvent.setConfirmTime(date); + conformEvent.setId(eventLast.getId()); + conformEvent.setStatus(CommonConstant.ONE); + this.eventMapper.updateByPrimaryKeySelective(conformEvent); + } + } else if (CommonConstant.ZERO.equals(event.getIsRecovery())) { + if (eventLast != null && CommonConstant.ZERO.equals(eventLast.getIsRecovery())) { + eventLast.setValue(new BigDecimal(String.valueOf(v))); + eventLast.setDescription(event.getDescription()); + eventLast.setDescriptionEn(eventService.getNameEn(event.getDescription())); + this.eventMapper.updateBatchById(eventLast); + } else { + id = this.snowflake.nextId(); + log.info("new error event snowflake id: {},event_level:{},alarmStationId:{},targetDevice:{},deviceType:{},signal:{}", new Object[]{id, event.getEventLevel(), eventAddReq.getStationId(), eventAddReq.getSrcId(), eventAddReq.getDeviceType(), k}); + event.setId(id); + event.setSignal(k); + this.generateAlarm(eventAddReq, v, event); + log.info("new error event update redis before:{},redisKey:{},k:{}", new Object[]{this.redisService.hget(redisKey, k), redisKey, k}); + deviceTransfer.setEventId(event.getId()); + deviceTransfer.setIsRecovery(event.getIsRecovery()); + this.redisService.hset(redisKey, k, deviceTransfer); + log.info("new error event update redis after:{},redisKey:{},k:{}", new Object[]{this.redisService.hget(redisKey, k), redisKey, k}); + } + } + } + } + } + + private void generateAlarm(EventAddReq eventAddReq, Object v, Event event) { + event.setGroupId(eventAddReq.getGroupId()); + event.setStationId(eventAddReq.getStationId()); + event.setEventType(CommonConstant.EventType.alarm); + event.setTimeStamp(eventAddReq.getTs()); + event.setTargetDevice(eventAddReq.getSrcId()); + event.setDeviceType(eventAddReq.getDeviceType()); + event.setDeviceTypeId(eventAddReq.getDeviceTypeId()); + event.setStatus(CommonConstant.ZERO); + if (CommonConstant.EventLevel.notice.equals(event.getEventLevel()) || CommonConstant.EventLevel.statusChange.equals(event.getEventLevel()) || CommonConstant.ONE.equals(event.getIsRecovery())) { + event.setStatus(CommonConstant.ONE); + event.setConfirmTime(new Date()); + event.setConfirmMan("system"); + } + + event.setValue(new BigDecimal(String.valueOf(v))); + Date now = new Date(); + event.setCreateTime(new Date()); + event.setUpdateTime(now); + this.eventMapper.insert(event); + } + + public Boolean isRecoveryDevice(AlarmConfigQueryVo alarmConfigQueryVo) { + if (null == alarmConfigQueryVo.getStartTime() || null == alarmConfigQueryVo.getEndTime()) { + alarmConfigQueryVo.setStartTime(DateUtil.format(DateUtil.offsetDay(new Date(), -10), "yyyy-MM-dd")); + alarmConfigQueryVo.setEndTime(DateUtil.format(DateUtil.tomorrow(), "yyyy-MM-dd")); + } + + List eventsList = this.eventMapper.selectByTargetDevice(alarmConfigQueryVo); + log.info("isRecoveryDevice. eventsList.size: {} ", eventsList.size()); + Map> eventList = (Map)eventsList.stream().collect(Collectors.groupingBy(Event::getSignal)); + log.info("isRecoveryDevice. eventList.size: {} ", eventList.size()); + return this.isNormal(eventList); + } + + private boolean isNormal(Map> eventList) { + boolean flag = true; + List events = null; + int eventNum = 0; + int num = 0; + Iterator var6 = eventList.entrySet().iterator(); + + while(var6.hasNext()) { + Map.Entry> map = (Map.Entry)var6.next(); + events = (List)map.getValue(); + if (null != events && events.size() > 0) { + ++eventNum; + if (CommonConstant.ONE.equals(((Event)events.get(0)).getIsRecovery())) { + ++num; + } + } + } + + log.info("isRecoveryDevice. eventNum: {} ,num:{}", eventNum, num); + if (num < eventNum) { + flag = false; + } + + return flag; + } + + public List isNormalStation(AlarmConfigQueryVo alarmConfigQueryVo) { + List resultList = new ArrayList(); + if (null == alarmConfigQueryVo.getStartTime() || null == alarmConfigQueryVo.getEndTime()) { + alarmConfigQueryVo.setStartTime(DateUtil.format(DateUtil.offsetDay(new Date(), -10), "yyyy-MM-dd")); + alarmConfigQueryVo.setEndTime(DateUtil.format(DateUtil.tomorrow(), "yyyy-MM-dd")); + } + + List eventsList = this.eventMapper.selectByTargetDevice(alarmConfigQueryVo); + Map stationStatusMap = new HashMap(); + Map> stationEventMap = (Map)eventsList.stream().collect(Collectors.groupingBy(Event::getStationId)); + Iterator var6 = stationEventMap.entrySet().iterator(); + + List stationStatusRespVO; + while(var6.hasNext()) { + Map.Entry> map = (Map.Entry)var6.next(); + stationStatusRespVO = map.getValue(); + Map> deviceSignalEventMap = (Map)stationStatusRespVO.stream().collect(Collectors.groupingBy((s) -> { + return s.getTargetDevice() + "_" + s.getSignal(); + })); + stationStatusMap.put(map.getKey(), this.isNormal(deviceSignalEventMap)); + } + + DataResult> dataResult = this.businessFeignClient.selectByGroupId(alarmConfigQueryVo.getGroupId()); + List stationList = (List)dataResult.getData(); + stationStatusRespVO = null; + boolean stationStatus = true; + Iterator var10 = stationList.iterator(); + + while(var10.hasNext()) { + Station station = (Station)var10.next(); + StationStatusRespVO vo = new StationStatusRespVO(); + vo.setStationId(station.getId()); + stationStatus = stationStatusMap.get(station.getId()) == null || (Boolean)stationStatusMap.get(station.getId()); + vo.setStationStatus(stationStatus); + resultList.add(vo); + } + + return resultList; + } + + public void polymerizationAlarm(EventAddReq eventAddReq, List groupAlarmConfigs, List stationAlarmConfigs) { + String redisKey = eventAddReq.getDeviceType() + ":" + eventAddReq.getStationId() + ":" + eventAddReq.getSrcId(); + Map hgetall = this.redisService.hgetall(redisKey); + Map groupMapOne = groupAlarmConfigs == null ? new HashMap() : (Map)groupAlarmConfigs.stream().filter((i) -> { + return i.getAlarmLevel() != null && CommonConstant.ONE.equals(i.getAlarmLevel()); + }).collect(Collectors.toMap(AlarmConfig::getCol, (AlarmConfig) -> { + return AlarmConfig; + })); + Map stationMapOne = stationAlarmConfigs == null ? new HashMap() : (Map)stationAlarmConfigs.stream().filter((i) -> { + return i.getAlarmLevel() != null && CommonConstant.ONE.equals(i.getAlarmLevel()); + }).collect(Collectors.toMap(AlarmConfig::getCol, (AlarmConfig) -> { + return AlarmConfig; + })); + Map groupMapTwo = groupAlarmConfigs == null ? new HashMap() : (Map)groupAlarmConfigs.stream().filter((i) -> { + return i.getAlarmLevel() != null && CommonConstant.TWO.equals(i.getAlarmLevel()); + }).collect(Collectors.toMap(AlarmConfig::getCol, (AlarmConfig) -> { + return AlarmConfig; + })); + Map stationMapTwo = stationAlarmConfigs == null ? new HashMap() : (Map)stationAlarmConfigs.stream().filter((i) -> { + return i.getAlarmLevel() != null && CommonConstant.TWO.equals(i.getAlarmLevel()); + }).collect(Collectors.toMap(AlarmConfig::getCol, (AlarmConfig) -> { + return AlarmConfig; + })); + Map groupMapThree = groupAlarmConfigs == null ? new HashMap() : (Map)groupAlarmConfigs.stream().filter((i) -> { + return i.getAlarmLevel() != null && CommonConstant.THREE.equals(i.getAlarmLevel()); + }).collect(Collectors.toMap(AlarmConfig::getCol, (AlarmConfig) -> { + return AlarmConfig; + })); + Map stationMapThree = stationAlarmConfigs == null ? new HashMap() : (Map)stationAlarmConfigs.stream().filter((i) -> { + return i.getAlarmLevel() != null && CommonConstant.THREE.equals(i.getAlarmLevel()); + }).collect(Collectors.toMap(AlarmConfig::getCol, (AlarmConfig) -> { + return AlarmConfig; + })); + Event vo = new Event(); + vo.setStationId(eventAddReq.getStationId()); + vo.setTargetDevice(eventAddReq.getSrcId()); + vo.setSignal("polymerization"); + vo.setEventLevel(CommonConstant.ONE); + if (((Map)stationMapOne).size() != 0 || ((Map)groupMapOne).size() != 0) { + this.commonPolymerizationAlarm(eventAddReq, (Map)stationMapOne, (Map)groupMapOne, hgetall, vo); + } + + vo.setEventLevel(CommonConstant.TWO); + if (((Map)stationMapTwo).size() != 0 || ((Map)groupMapTwo).size() != 0) { + this.commonPolymerizationAlarm(eventAddReq, (Map)stationMapTwo, (Map)groupMapTwo, hgetall, vo); + } + + vo.setEventLevel(CommonConstant.THREE); + if (((Map)stationMapThree).size() != 0 || ((Map)groupMapThree).size() != 0) { + this.commonPolymerizationAlarm(eventAddReq, (Map)stationMapThree, (Map)groupMapThree, hgetall, vo); + } + + } + + private void commonPolymerizationAlarm(EventAddReq eventAddReq, Map stationMap, Map groupMap, Map hgetall, Event vo) { + boolean isError = false; + Event event = new Event(); + isError = this.isError(stationMap, hgetall, isError, event, eventAddReq); + if (!isError && groupMap.size() > 0) { + isError = this.isError(groupMap, hgetall, isError, event, eventAddReq); + } + + String redisKey = "polymerization:" + vo.getStationId() + ":" + vo.getTargetDevice(); + DeviceTransfer eventLast = (DeviceTransfer)this.redisService.hget(redisKey, vo.getEventLevel().toString()); + Integer level = vo.getEventLevel(); + event.setEventLevel(level); + long eventId; + if (null != eventLast) { + if (CommonConstant.ONE.equals(eventLast.getIsRecovery()) && isError) { + event.setStatus(CommonConstant.ZERO); + eventId = this.insertNewEvent(eventAddReq, CommonConstant.ZERO, event); + this.updatePolymerization(redisKey, eventLast, vo.getEventLevel(), CommonConstant.ZERO, eventId); + if (!CommonConstant.THREE.equals(level)) { + this.sendSms(eventAddReq.getStationId(), event.getDescription(), level); + this.sendWorkOrder(event); + } + } else if (CommonConstant.ZERO.equals(eventLast.getIsRecovery()) && !isError) { + List ids = new ArrayList(); + ids.add(eventLast.getEventId()); + UserDetailRespVO userDetail = new UserDetailRespVO(); + userDetail.setUsername("system"); + this.eventMapper.updateByIds(ids, userDetail); + event.setBeforeEventId(eventLast.getEventId()); + event.setConfirmMan("system"); + event.setStatus(CommonConstant.ONE); + event.setConfirmTime(new Date()); + eventId = this.insertNewEvent(eventAddReq, CommonConstant.ONE, event); + this.updatePolymerization(redisKey, eventLast, vo.getEventLevel(), CommonConstant.ONE, eventId); + } + } else if (isError) { + event.setStatus(CommonConstant.ZERO); + eventId = this.insertNewEvent(eventAddReq, CommonConstant.ZERO, event); + eventLast = new DeviceTransfer(); + this.updatePolymerization(redisKey, eventLast, vo.getEventLevel(), CommonConstant.ZERO, eventId); + if (!CommonConstant.THREE.equals(level)) { + this.sendSms(eventAddReq.getStationId(), event.getDescription(), level); + this.sendWorkOrder(event); + } + } + + } + + private void updatePolymerization(String redisKey, DeviceTransfer eventLast, Integer level, Integer recovery, long eventId) { + eventLast.setEventId(eventId); + eventLast.setIsRecovery(recovery); + eventLast.setUpdateTime(new Date()); + this.redisService.hset(redisKey, level.toString(), eventLast); + log.info("updatePolymerization redis:{},{},{}", new Object[]{redisKey, level.toString(), eventLast}); + } + + private void sendWorkOrder(Event event) { + MovementDTO movementDTO = new MovementDTO(); + List events = new ArrayList(); + events.add(event); + movementDTO.setEvents(events); + this.monitor.setEvents(movementDTO); + } + + private long insertNewEvent(EventAddReq eventAddReq, Integer recoveryStatus, Event event) { + long id = this.snowflake.nextId(); + event.setId(id); + event.setGroupId(eventAddReq.getGroupId()); + event.setStationId(eventAddReq.getStationId()); + event.setEventType(CommonConstant.EventType.alarm); + event.setTimeStamp(eventAddReq.getTs()); + event.setTargetDevice(eventAddReq.getSrcId()); + event.setDeviceType(eventAddReq.getDeviceType()); + event.setDeviceTypeId(eventAddReq.getDeviceTypeId()); + event.setSignal("polymerization"); + event.setIsRecovery(recoveryStatus); + event.setCreateTime(new Date()); + List list = new ArrayList(); + list.add(event); + this.eventMapper.insertBatch(list); + return id; + } + + private boolean isError(Map alarmMap, Map hgetall, boolean isError, Event event, EventAddReq eventAddReq) { + String deviceName = eventAddReq.getDeviceName(); + Iterator var9 = alarmMap.entrySet().iterator(); + + while(var9.hasNext()) { + Map.Entry entry = (Map.Entry)var9.next(); + String k = (String)entry.getKey(); + Object obj = hgetall.get(k); + AlarmConfig alarmConfig = (AlarmConfig)entry.getValue(); + if (obj != null) { + if (CommonConstant.EventSignal.SIGNAL.equals(alarmConfig.getSensType())) { + int value; + if (obj instanceof DeviceTransfer) { + DeviceTransfer deviceTransfer = (DeviceTransfer)obj; + value = deviceTransfer.getValue().intValue(); + } else { + value = Integer.parseInt(String.valueOf(obj)); + } + + if (eventAddReq.getDeviceType().contains("communicationStatus")) { + if (!CommonConstant.ONE.equals(value)) { + isError = true; + break; + } + } else if ("communicationStatus".equals(k)) { + if (CommonConstant.ZERO.equals(value)) { + isError = true; + break; + } + } else if (value > CommonConstant.ZERO) { + isError = true; + break; + } + } else if (CommonConstant.EventSignal.TELEMETER.equals(alarmConfig.getSensType())) { + BigDecimal lowerLimit = alarmConfig.getLowerLimit(); + BigDecimal upperLimit = alarmConfig.getUpperLimit(); + DeviceTransfer deviceTransfer = (DeviceTransfer)obj; + BigDecimal value = deviceTransfer.getValue(); + if (upperLimit != null && value.compareTo(upperLimit) > 0) { + isError = true; + break; + } + + if (lowerLimit != null && value.compareTo(lowerLimit) < 0) { + isError = true; + break; + } + } + + event.setEventLevel(alarmConfig.getAlarmLevel()); + } + } + + event.setDescription(deviceName + "设备告警恢复"); + event.setDescriptionEn(eventService.getNameEn(deviceName + "设备告警恢复")); + if (isError) { + event.setDescription(deviceName + "设备告警"); + event.setDescriptionEn(eventService.getNameEn(deviceName + "设备告警")); + } + + return isError; + } + + private void sendSms(Integer stationId, String content, Integer level) { + SendSmsConfigQueryReq vo = new SendSmsConfigQueryReq(); + vo.setStationId(stationId); + vo.setSmsType(CommonConstant.ONE); + vo.setAlarmLevel(String.valueOf(level)); + JSONObject jsonObject = new JSONObject(); + jsonObject.put("siteName", this.getStationName(stationId)); + jsonObject.put("content", content); + vo.setParam(jsonObject); + this.sendSmsConfigService.sendSms(vo); + } + + private String getStationName(Integer stationId) { + String name = ""; + String key = "station:" + stationId; + Station station = null; + if (this.redisService.hasKey(key)) { + station = (Station)this.redisService.get(key); + } else { + DataResult result = this.businessFeignClient.selectByStationId(stationId); + station = (Station)result.getData(); + } + + if (null != station) { + name = station.getName(); + } + + return name; + } + + public Event getNotRecovered(AlarmConfigQueryVo stationStatusReq) { + AlarmConfigQueryVo alarmConfigQueryVo = new AlarmConfigQueryVo(); + alarmConfigQueryVo.setStationId(stationStatusReq.getStationId()); + Event event = this.eventMapper.selectLastTime(alarmConfigQueryVo); + return event; + } + + public EventTypeAndLevelsReqVO getAlarmDataStatistics(AlarmConfigQueryVo vo) { + String alarmNum = null; + String alarmUnresolvedNum = null; + EventTypeAndLevelsReqVO eventTypeAndLevelsReqVO = new EventTypeAndLevelsReqVO(); + if (!vo.getStationList().isEmpty() && vo.getStationId() == null) { + Iterator var5 = vo.getStationList().iterator(); + + while(var5.hasNext()) { + Station station = (Station)var5.next(); + AlarmConfigQueryVo alarmConfigQueryVo = new AlarmConfigQueryVo(); + if (null == vo.getStartTime() && null == vo.getStartTime()) { + DateTime yesterday = DateUtil.yesterday(); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + String begin = sdf.format(DateUtil.beginOfDay(yesterday)); + String endOfDay = sdf.format(DateUtil.endOfDay(yesterday)); + alarmConfigQueryVo.setStartTime(begin); + alarmConfigQueryVo.setEndTime(endOfDay); + } else { + alarmConfigQueryVo.setStartTime(vo.getStartTime()); + alarmConfigQueryVo.setEndTime(vo.getEndTime()); + } + + List list = new ArrayList(); + list.add(CommonConstant.EventLevel.accident); + list.add(CommonConstant.EventLevel.abnormal); + list.add(CommonConstant.EventLevel.overLimit); + alarmConfigQueryVo.setStationId(station.getId()); + alarmConfigQueryVo.setEventLevelList(list); + List events = this.eventMapper.selectByTargetDeviceAsc(alarmConfigQueryVo); + List recovered = new ArrayList(); + List notRecovered = new ArrayList(); + Integer alarmOccurrencesNumber = 0; + Integer alarmUnresolvedNumber = 0; + Iterator var14 = events.iterator(); + + Event event; + while(var14.hasNext()) { + event = (Event)var14.next(); + if (CommonConstant.ZERO.equals(event.getIsRecovery())) { + alarmOccurrencesNumber = alarmOccurrencesNumber + 1; + notRecovered.add(event); + } + + if (CommonConstant.ONE.equals(event.getIsRecovery())) { + recovered.add(event); + } + } + + var14 = notRecovered.iterator(); + + while(var14.hasNext()) { + event = (Event)var14.next(); + Event beforeEventId = this.eventMapper.selectByBeforeEventId(event.getId()); + if (null == beforeEventId) { + alarmUnresolvedNumber = alarmUnresolvedNumber + 1; + } + } + + eventTypeAndLevelsReqVO.setAlarmOccurrencesNumber(alarmOccurrencesNumber); + eventTypeAndLevelsReqVO.setAlarmUnresolvedNumber(alarmUnresolvedNumber); + alarmNum = alarmOccurrencesNumber.toString(); + alarmUnresolvedNum = alarmUnresolvedNumber.toString(); + String redisKey = "dmaintenance:" + station.getId(); + JSONObject modifyDataObject = new JSONObject(); + modifyDataObject.put("alarmNum", alarmNum); + modifyDataObject.put("alarmUnresolvedNum", alarmUnresolvedNum); + String format = DateFormatUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss"); + modifyDataObject.put("updateTime", format); + this.redisService.hmset(redisKey, modifyDataObject); + log.info("elecMeter.insert OK"); + } + } + + return eventTypeAndLevelsReqVO; + } + + @Async("flowThreadPoolExecutor") + public DataResult addEvents(List list) { + Iterator var2 = list.iterator(); + + while(var2.hasNext()) { + EventAddReq eventAddReq = (EventAddReq)var2.next(); + List groupAlarmConfigs = this.alarmConfigService.selectListGroupCache(eventAddReq.getGroupId(), com.ho.flow.constant.FlowConstant.AlarmConfig.SCOPE_GROUP, eventAddReq.getDeviceType()); + List stationAlarmConfigs = this.alarmConfigService.selectListCompanyCache(eventAddReq.getGroupId(), eventAddReq.getStationId(), com.ho.flow.constant.FlowConstant.AlarmConfig.SCOPE_STATION, eventAddReq.getDeviceType()); + Map stationConfigMap = (Map)stationAlarmConfigs.stream().collect(Collectors.toMap(AlarmConfig::getCol, (AlarmConfig) -> { + return AlarmConfig; + })); + Map groupConfigMap = (Map)groupAlarmConfigs.stream().collect(Collectors.toMap(AlarmConfig::getCol, (AlarmConfig) -> { + return AlarmConfig; + })); + JSONObject dataSet = eventAddReq.getDataSet(); + if (dataSet == null) { + return DataResult.success(); + } + + this.polymerizationAlarm(eventAddReq, groupAlarmConfigs, stationAlarmConfigs); + Map> resultMap = this.matchEventRecords(eventAddReq, dataSet, stationConfigMap, groupConfigMap); + + try { + List events = (List)resultMap.get("events"); + if (events != null && !events.isEmpty()) { + log.info("电站id:{},设备id:{}, events. size: {} ", new Object[]{eventAddReq.getStationId(), eventAddReq.getSrcId(), events.size()}); + this.eventService.insertEventBatch(events); + MovementDTO movementDTO = new MovementDTO(); + movementDTO.setEvents(events); + if (this.flag == 1) { + this.monitor.setEvents(movementDTO); + } + } + + List updateEvents = (List)resultMap.get("updateEvents"); + if (updateEvents != null && !updateEvents.isEmpty()) { + log.info("电站id:{},设备id:{}, updateEvents. size: {} ", new Object[]{eventAddReq.getStationId(), eventAddReq.getSrcId(), updateEvents.size()}); + this.eventService.updateEventBatch(updateEvents); + } + + List updateEventStatus = (List)resultMap.get("updateEventStatus"); + if (updateEventStatus != null && !updateEventStatus.isEmpty()) { + log.info("电站id:{},设备id:{}, updateEventStatus. size: {} ", new Object[]{eventAddReq.getStationId(), eventAddReq.getSrcId(), updateEventStatus.size()}); + List ids = (List)updateEventStatus.stream().map(Event::getId).collect(Collectors.toList()); + UserDetailRespVO userDetailRespVO = new UserDetailRespVO(); + userDetailRespVO.setUsername("system"); + this.eventService.updateById(ids, userDetailRespVO); + } + } catch (Exception var15) { + log.error("新增告警入库异常,电站id:{},设备id:{},dataSet:{},异常信息:{}", new Object[]{eventAddReq.getStationId(), eventAddReq.getSrcId(), eventAddReq.getDataSet(), var15.getMessage()}); + } + } + + return DataResult.success(); + } +} diff --git a/flowable-center/src/main/resources/lib/flowable-src-1.0.jar b/flowable-center/src/main/resources/lib/flowable-src-1.0.jar deleted file mode 100644 index e120f665738ee6c2db2157950623042906d851cd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 16301 zcmb8019YU@wzgy2HahHdoQ{)@ZQHhO+wR!5JE+*Utqwa*{`A@Bo_+4Qckh4PRrQTp z^^N(yYt~xxTcz>HN`Qi)0Rcfl0U;^Rs%tI!oH+mi0mXeBA7_E2gcSMd#H58kOYuvK z2@5GG(n|^7NR5q3O3=|y!%NUnPmE30%QMU|ZS7x=(G7`>OO4Zr(E`Jq1REyr6{u4c z?C+&eQtTI;U|^CPl<>3sC}n1%6k4Pq*I;WQV!j8jWiFVL+p0ht*X1qYJ-ND}5FNuYlu`H|PZ8uUl+UrGLT7}!UcfsNJYzm9Z}1PBKWhrQ1xU&T1PF-# zV~T11;zbI7$Yq=y`EAV<{+K9w14}&zhekyS1yp{d3qL-v{@Cvi-WKSZnGwyhib8(Z z$f0$L7YXaqjHT;YM$W9^F7JtuKEAvobtWjHYyBv|3M@(I+11_N((ezC=bS(tfhIz( z@`1&0BXJDgF2ymm9DF**L`G9O)z8#BT7cEur~c<~3$7j0FKfgW{In7AOr(Ncl<^%caS7NJXSv5^TLDuf0s-mzYQ1rS5CA@` z?ObA0^T0T2@5-H~vsjJ*3;fDDL&@5$VQE^)qPW_T_hB;!qF|B>+euSwmohirM%g1% zBqgWQyaQaHW=S#T4ly zRm6in>FZaALX!o=OWr3%e>;MI8q_@mA&{9Ra~U?eluVQ`NWavp`1LtIyilxu`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