From cda6a85bc6ddaf9bdcd8736069ee7d3705f3bf62 Mon Sep 17 00:00:00 2001 From: Jone <515616805@qq.com> Date: Wed, 15 Mar 2023 18:34:16 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=8C=89=E9=98=BF=E9=87=8C=E5=B7=B4?= =?UTF-8?q?=E5=B7=B4=E8=A7=84=E7=BA=A6=E4=BF=AE=E6=94=B9=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/hnac/hzims/common/utils/Condition.java | 44 ++- .../com/hnac/hzims/monitor/entity/HisDataYc.java | 23 +- .../com/hnac/hzims/monitor/utils/DateUtils.java | 2 +- .../service/impl/WtSpManagementServiceImpl.java | 2 +- .../impl/EmAssociationDetailServiceImpl.java | 4 +- .../equipment/service/impl/EmParamServiceImpl.java | 6 +- .../service/impl/PlanGenerationServiceImpl.java | 4 +- .../service/impl/UpdateDeptIdServiceImpl.java | 8 +- .../hzims/fdp/scheduled/FdpDeviceCreateTask.java | 2 +- .../fdp/service/impl/FdpFaultInfoServiceImpl.java | 6 +- .../fdp/service/impl/FdpMonitorServiceImpl.java | 82 ++--- .../java/com/hnac/hzims/util/HttpClientUtils.java | 16 +- .../obj/services/impl/ContentServiceImpl.java | 4 +- .../obj/services/impl/ObjectServiceImpl.java | 2 +- .../inspect/obj/web/ProjectContentController.java | 4 +- .../inspect/obj/web/TemplateProjectController.java | 4 +- .../service/impl/InspectOfflineServiceImpl.java | 2 +- .../inspect/task/job/service/TaskJobService.java | 4 +- .../inspect/task/service/impl/TaskServiceImpl.java | 4 +- .../utils/Base64ImgReplacedElementFactory.java | 2 +- .../com/hnac/hzinfo/inspect/utils/Condition.java | 26 +- .../hnac/hzinfo/inspect/utils/HttpClientUtils.java | 4 + .../hnac/hzinfo/inspect/utils/ZxingGenCode.java | 3 +- .../message/schedule/MessagePushSchedule.java | 4 +- .../service/impl/StAlamRecordServiceImpl.java | 6 +- .../duty/service/impl/ImsDutyMainServiceImpl.java | 2 +- .../duty/service/impl/ImsDutyRecServiceImpl.java | 4 +- .../main/controller/RunMonthReportController.java | 4 +- .../main/service/IMainWorkBenchService.java | 1 + .../main/service/impl/AppHomeServiceImpl.java | 2 +- .../main/service/impl/HomePageServiceImpl.java | 39 +-- .../impl/MainSystemMonitoringServiceImpl.java | 6 +- .../main/service/impl/PlatformServiceImpl.java | 23 +- .../service/impl/RunMonthReportServiceImpl.java | 16 +- .../main/service/impl/SideHustleServiceImpl.java | 4 +- .../service/impl/UnitRunningTimeServiceImpl.java | 12 +- .../main/service/impl/WaterServiceImpl.java | 17 +- .../main/service/impl/WeatherServiceImpl.java | 2 + .../impl/OperMaintenanceLibraryServiceImpl.java | 15 +- .../impl/OperMaintenanceParameterServiceImpl.java | 12 +- .../station/service/impl/ImsDeptServiceImpl.java | 2 +- .../service/impl/RealMonitorServiceImpl.java | 3 +- .../station/utils/ArtemisPostUtils.java | 2 +- .../hnac/hzims/operational/util/CommonUtils.java | 4 +- .../hzims/operational/util/HttpClientUtils.java | 16 +- .../service/impl/CheckItemServiceImpl.java | 20 +- .../impl/SafeEquipmentTrialServiceImpl.java | 8 +- .../service/impl/SafetyToolTypeServiceImpl.java | 12 +- .../utils/Base64ImgReplacedElementFactory.java | 2 +- hzims-service/spare/spare.iml | 358 --------------------- hzims-service/topvision/topvision.iml | 319 ------------------ 51 files changed, 302 insertions(+), 871 deletions(-) delete mode 100644 hzims-service/spare/spare.iml delete mode 100644 hzims-service/topvision/topvision.iml diff --git a/hzims-biz-common/src/main/java/com/hnac/hzims/common/utils/Condition.java b/hzims-biz-common/src/main/java/com/hnac/hzims/common/utils/Condition.java index ee5ae24..6b76112 100644 --- a/hzims-biz-common/src/main/java/com/hnac/hzims/common/utils/Condition.java +++ b/hzims-biz-common/src/main/java/com/hnac/hzims/common/utils/Condition.java @@ -51,21 +51,29 @@ public class Condition extends org.springblade.core.mp.support.Condition { for(Field field:fieldList){ field.setAccessible(true); QueryField queryField = field.getAnnotation(QueryField.class); - if(queryField==null)continue; + if(queryField==null) { + continue; + } Object value; try { value = field.get(query); } catch (Exception e) { throw new ServiceException("获取属性性出错"); } - if(value==null)continue; + if(value==null) { + continue; + } List list = null; if(value instanceof List){ list = (List)value; - if(list.size()==0)continue; + if(list.size()==0) { + continue; + } } String condition = queryField.condition(); - if(Func.isBlank(condition))continue; + if(Func.isBlank(condition)) { + continue; + } String fileName = camel2under(field.getName()); if(SqlCondition.EQUAL.equals(condition)) { qw.eq(fileName, value); @@ -77,11 +85,15 @@ public class Condition extends org.springblade.core.mp.support.Condition { qw.likeRight(fileName,value); }else if(SqlCondition.NOT_IN.equals(condition)){ String columnName = queryField.columnName(); - if(Func.isBlank(columnName))throw new ServiceException("查询不包含条件时需要指定列名"); + if(Func.isBlank(columnName)) { + throw new ServiceException("查询不包含条件时需要指定列名"); + } qw.notIn(camel2under(columnName),list); }else if(SqlCondition.IN.equals(condition)){ String columnName = queryField.columnName(); - if(Func.isBlank(columnName))throw new ServiceException("查询包含条件时需要指定列名"); + if(Func.isBlank(columnName)) { + throw new ServiceException("查询包含条件时需要指定列名"); + } qw.in(camel2under(columnName),list); } } @@ -100,7 +112,9 @@ public class Condition extends org.springblade.core.mp.support.Condition { for(Field field:fieldList){ field.setAccessible(true); QueryField queryField = field.getAnnotation(QueryField.class); - if(queryField==null) continue; + if(queryField==null) { + continue; + } Object value; try { value = field.get(query); @@ -114,10 +128,14 @@ public class Condition extends org.springblade.core.mp.support.Condition { List list = null; if(value instanceof List){ list = (List)value; - if(list.size()==0)continue; + if(list.size()==0) { + continue; + } } String condition = queryField.condition(); - if(Func.isBlank(condition))continue; + if(Func.isBlank(condition)) { + continue; + } String fileName = Optional.ofNullable(alias).map(aliasStr -> aliasStr + ".").orElse("") + camel2under(field.getName()); if(SqlCondition.EQUAL.equals(condition)) { qw.eq(fileName, value); @@ -129,11 +147,15 @@ public class Condition extends org.springblade.core.mp.support.Condition { qw.likeRight(fileName,value); }else if(SqlCondition.NOT_IN.equals(condition)){ String columnName = queryField.columnName(); - if(Func.isBlank(columnName))throw new ServiceException("查询不包含条件时需要指定列名"); + if(Func.isBlank(columnName)) { + throw new ServiceException("查询不包含条件时需要指定列名"); + } qw.notIn(fileName,list); }else if(SqlCondition.IN.equals(condition)){ String columnName = queryField.columnName(); - if(Func.isBlank(columnName))throw new ServiceException("查询包含条件时需要指定列名"); + if(Func.isBlank(columnName)) { + throw new ServiceException("查询包含条件时需要指定列名"); + } qw.in(fileName,list); } } diff --git a/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/monitor/entity/HisDataYc.java b/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/monitor/entity/HisDataYc.java index 0e0d362..ca1ca54 100644 --- a/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/monitor/entity/HisDataYc.java +++ b/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/monitor/entity/HisDataYc.java @@ -7,7 +7,7 @@ public class HisDataYc { private Date datatime; private int q; private int _msec; - + public double getVal() { return val; } @@ -15,7 +15,7 @@ public class HisDataYc { public void setVal(double val) { this.val = val; } - + public Date getDatatime() { return datatime; } @@ -23,7 +23,7 @@ public class HisDataYc { public void setDatatime(Date datatime) { this.datatime = datatime; } - + public int getQ() { return q; } @@ -31,7 +31,7 @@ public class HisDataYc { public void setQ(int q) { this.q = q; } - + public int get_Msec() { return _msec; } @@ -50,18 +50,23 @@ public class HisDataYc { @Override public boolean equals(Object obj) { - if (this == obj) + if (this == obj) { return true; - if (obj == null) + } + if (obj == null) { return false; - if (getClass() != obj.getClass()) + } + if (getClass() != obj.getClass()) { return false; + } HisDataYc other = (HisDataYc) obj; if (datatime == null) { - if (other.datatime != null) + if (other.datatime != null) { return false; - } else if (!datatime.equals(other.datatime)) + } + } else if (!datatime.equals(other.datatime)) { return false; + } return true; } diff --git a/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/monitor/utils/DateUtils.java b/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/monitor/utils/DateUtils.java index 34827f1..7bd39ad 100644 --- a/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/monitor/utils/DateUtils.java +++ b/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/monitor/utils/DateUtils.java @@ -346,7 +346,7 @@ public class DateUtils { end.set(endYear, endMonth - 1, endDay); Long endTime = end.getTimeInMillis(); - Long oneDay = 1000 * 60 * 60 * 24l; + Long oneDay = 1000 * 60 * 60 * 24L; Long time = startTIme; while (time <= endTime) { diff --git a/hzims-service/assets/src/main/java/com/hnac/hzims/spare/service/impl/WtSpManagementServiceImpl.java b/hzims-service/assets/src/main/java/com/hnac/hzims/spare/service/impl/WtSpManagementServiceImpl.java index 01331d4..a84b3b3 100644 --- a/hzims-service/assets/src/main/java/com/hnac/hzims/spare/service/impl/WtSpManagementServiceImpl.java +++ b/hzims-service/assets/src/main/java/com/hnac/hzims/spare/service/impl/WtSpManagementServiceImpl.java @@ -140,7 +140,7 @@ public class WtSpManagementServiceImpl extends BaseServiceImpl maps = new HashMap(); Map map = new HashMap<>(); - if (emAssociationDetailVo.getProType().equals("yc")) { + if ("yc".equals(emAssociationDetailVo.getProType())) { List ycValueList = new ArrayList(); ReadDataTypes.EReadDataRet readDataRet = ReadData.Instance.ReadAnyDatasID(Arrays.asList(emAssociationDetailVo.getRealIds().split(",")), ycValueList, null, null, tenantId); @@ -72,7 +72,7 @@ public class EmAssociationDetailServiceImpl extends BaseServiceImpl pts = emParamEntities.stream().filter(o -> o.getParamName().equals("pt") && o.getInfoId().toString().equals(aLong.toString())).collect(Collectors.toList()); + List pts = emParamEntities.stream().filter(o -> "pt".equals(o.getParamName()) && o.getInfoId().toString().equals(aLong.toString())).collect(Collectors.toList()); if (CollectionUtil.isNotEmpty(pts)) { pt = Integer.valueOf(pts.get(0).getParamValue()); } - List cts = emParamEntities.stream().filter(o -> o.getParamName().equals("ct") && o.getInfoId().toString().equals(aLong.toString())).collect(Collectors.toList()); + List cts = emParamEntities.stream().filter(o -> "ct".equals(o.getParamName()) && o.getInfoId().toString().equals(aLong.toString())).collect(Collectors.toList()); if (CollectionUtil.isNotEmpty(cts)) { ct = Integer.valueOf(cts.get(0).getParamValue()); } - List installedCapacitys = emParamEntities.stream().filter(o -> o.getParamName().equals("installedCapacity") && o.getInfoId().toString().equals(aLong.toString())).collect(Collectors.toList()); + List installedCapacitys = emParamEntities.stream().filter(o -> "installedCapacity".equals(o.getParamName()) && o.getInfoId().toString().equals(aLong.toString())).collect(Collectors.toList()); if (CollectionUtil.isNotEmpty(installedCapacitys)) { installedCapacity = Double.valueOf(installedCapacitys.get(0).getParamValue()); } diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/PlanGenerationServiceImpl.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/PlanGenerationServiceImpl.java index 8b8447d..96d194b 100644 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/PlanGenerationServiceImpl.java +++ b/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/PlanGenerationServiceImpl.java @@ -203,8 +203,8 @@ public class PlanGenerationServiceImpl extends BaseServiceImpl pts = paramList.stream().filter(o -> o.getInfoId().toString().equals(emInfo.getId().toString()) && o.getParamName().equals("pt")).collect(Collectors.toList()); - List cts = paramList.stream().filter(o -> o.getInfoId().toString().equals(emInfo.getId().toString()) && o.getParamName().equals("ct")).collect(Collectors.toList()); + List pts = paramList.stream().filter(o -> o.getInfoId().toString().equals(emInfo.getId().toString()) && "pt".equals(o.getParamName())).collect(Collectors.toList()); + List cts = paramList.stream().filter(o -> o.getInfoId().toString().equals(emInfo.getId().toString()) && "ct".equals(o.getParamName())).collect(Collectors.toList()); if (CollectionUtil.isNotEmpty(pts)) { EmParamEntity emParamEntity = pts.get(0); pt = Integer.valueOf(emParamEntity.getParamValue()); diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/UpdateDeptIdServiceImpl.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/UpdateDeptIdServiceImpl.java index f96c2f0..a2e128d 100644 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/UpdateDeptIdServiceImpl.java +++ b/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/UpdateDeptIdServiceImpl.java @@ -58,7 +58,7 @@ public class UpdateDeptIdServiceImpl extends BaseServiceImpl columnMap : tableColumns) { - if(columnMap.get("COLUMN_NAME").toString().toLowerCase().equals("create_dept")) { + if("create_dept".equals(columnMap.get("COLUMN_NAME").toString().toLowerCase())) { flag = true; break; } @@ -109,7 +109,7 @@ public class UpdateDeptIdServiceImpl extends BaseServiceImpl columnMap : tableColumns) { - if(columnMap.get("COLUMN_NAME").toString().toLowerCase().equals("tenant_id")) { + if("tenant_id".equals(columnMap.get("COLUMN_NAME").toString().toLowerCase())) { flag = true; break; } @@ -141,10 +141,10 @@ public class UpdateDeptIdServiceImpl extends BaseServiceImpl columnMap : tableColumns) { - if(columnMap.get("COLUMN_NAME").toString().toLowerCase().equals("tenant_id")) { + if("tenant_id".equals(columnMap.get("COLUMN_NAME").toString().toLowerCase())) { hasColumnCount++; } - if(columnMap.get("COLUMN_NAME").toString().toLowerCase().equals("create_dept")) { + if("create_dept".equals(columnMap.get("COLUMN_NAME").toString().toLowerCase())) { hasColumnCount++; } } diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/scheduled/FdpDeviceCreateTask.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/scheduled/FdpDeviceCreateTask.java index 66bfd23..65634c0 100644 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/scheduled/FdpDeviceCreateTask.java +++ b/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/scheduled/FdpDeviceCreateTask.java @@ -65,7 +65,7 @@ public class FdpDeviceCreateTask { @Autowired private RedisTemplate redisTemplate; - private static final Long USER_ID = 1377143375838359553l; + private static final Long USER_ID = 1377143375838359553L; @Value("${url.getFaultAndMonitor}") diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpFaultInfoServiceImpl.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpFaultInfoServiceImpl.java index 6324d06..3e379a3 100644 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpFaultInfoServiceImpl.java +++ b/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpFaultInfoServiceImpl.java @@ -25,11 +25,13 @@ public class FdpFaultInfoServiceImpl extends BaseServiceImpl fdpFaultInfoEntityList = fdpFaultInfoVo.getFdpFaultInfoEntityList(); - if(CollectionUtil.isEmpty(fdpFaultInfoEntityList)) + if(CollectionUtil.isEmpty(fdpFaultInfoEntityList)) { return R.fail("请选择诊断故障提交记录"); + } Long taskId = fdpFaultInfoVo.getTaskId(); - if(null == taskId) + if(null == taskId) { return R.fail("请对诊断故障记录和诊断任务关联"); + } fdpFaultInfoEntityList.forEach(o->o.setTaskId(fdpFaultInfoVo.getTaskId())); boolean saveResult = super.saveOrUpdateBatch(fdpFaultInfoEntityList); return R.status(saveResult); diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpMonitorServiceImpl.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpMonitorServiceImpl.java index 73bcd3a..1f55dba 100644 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpMonitorServiceImpl.java +++ b/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpMonitorServiceImpl.java @@ -241,13 +241,13 @@ public class FdpMonitorServiceImpl extends BaseServiceImpl fdpMonitorEntityList = this.baseMapper.selectListPage(page, entity); if (fdpMonitorEntityList.size() > 0) { fdpMonitorEntityList.forEach(o -> { - if (o.getCallbackType().equals("bool")) { + if ("bool".equals(o.getCallbackType())) { o.setCallbackType("单点遥信"); - } else if (o.getCallbackType().equals("bool[]")) { + } else if ("bool[]".equals(o.getCallbackType())) { o.setCallbackType("多点遥信"); - } else if (o.getCallbackType().equals("float")) { + } else if ("float".equals(o.getCallbackType())) { o.setCallbackType("单点遥测"); - } else if (o.getCallbackType().equals("float[]")) { + } else if ("float[]".equals(o.getCallbackType())) { o.setCallbackType("多点遥测"); } }); @@ -585,11 +585,11 @@ public class FdpMonitorServiceImpl extends BaseServiceImpl() {{ eq(FdpMonitorEntity::getFdpId, req.getFdpId()).last(" LIMIT 1"); }}); - if (req.getImsRealIds().split(",").length > 1 && (entity.getCallbackType().equals("bool") || entity.getCallbackType().equals("float"))) { + if (req.getImsRealIds().split(",").length > 1 && ("bool".equals(entity.getCallbackType()) || "float".equals(entity.getCallbackType()))) { String name = ""; - if (entity.getCallbackType().equals("bool")) { + if ("bool".equals(entity.getCallbackType())) { name = "单点遥信"; - } else if (entity.getCallbackType().equals("float")) { + } else if ("float".equals(entity.getCallbackType())) { name = "单点遥测"; } return R.fail("该数据格式为:" + name + ",故该值最多绑定一个"); @@ -1199,7 +1199,7 @@ public class FdpMonitorServiceImpl extends BaseServiceImpl map, FdpMonitorEntity fdpMonitorEntity, List data) { Float flo[] = new Float[fdpMonitorEntity.getImsRealIds().split(",").length]; int count = 0; - if (fdpMonitorEntity.getCallbackType().equals("float[]")) { + if ("float[]".equals(fdpMonitorEntity.getCallbackType())) { for (int i = 0; i < data.size(); i++) { FieldsData datum = data.get(i); if (StringUtil.isNotBlank(datum.getValue())) { @@ -1214,7 +1214,7 @@ public class FdpMonitorServiceImpl extends BaseServiceImpl map, FdpMonitorEntity fdpMonitorEntity, List data) { List list = new ArrayList<>(); int count = 0; - if (fdpMonitorEntity.getCallbackType().equals("float[]")) { + if ("float[]".equals(fdpMonitorEntity.getCallbackType())) { for (int i = 0; i < data.size(); i++) { FieldsData datum = data.get(i); RealTimeDataFloVo vo = new RealTimeDataFloVo(); @@ -1278,7 +1278,7 @@ public class FdpMonitorServiceImpl extends BaseServiceImpl voList = new ArrayList<>(); for (int i = 0; i < data.size(); i++) { FieldsData datum = data.get(i); RealTimeDataBoolVo vo = new RealTimeDataBoolVo(); if (StringUtil.isNotBlank(datum.getValue())) { - if (datum.getValue().equals("1")) { + if ("1".equals(datum.getValue())) { vo.setValue(true); - } else if (datum.getValue().equals("0")) { + } else if ("0".equals(datum.getValue())) { vo.setValue(false); } } else { @@ -1456,13 +1456,13 @@ public class FdpMonitorServiceImpl extends BaseServiceImpl floList = new ArrayList<>(); List boolList = new ArrayList<>(); if (CollectionUtil.isNotEmpty(vo.getData())) { - if (vo.getType().equals("float[]")) { + if ("float[]".equals(vo.getType())) { return floatValue(vo.getData(), floList, vo.getType()); - } else if (vo.getType().equals("float[][]")) { + } else if ("float[][]".equals(vo.getType())) { return floatValue(vo.getData(), floList, vo.getType()); - } else if (vo.getType().equals("bool[]")) { + } else if ("bool[]".equals(vo.getType())) { return bool(vo.getData(), boolList, vo.getType()); - } else if (vo.getType().equals("bool[][]")) { + } else if ("bool[][]".equals(vo.getType())) { return bool(vo.getData(), boolList, vo.getType()); } @@ -1502,13 +1502,13 @@ public class FdpMonitorServiceImpl extends BaseServiceImpl analyzeDataConditionVOS, List> floList, List> boolList) { if (CollectionUtil.isNotEmpty(analyzeDataConditionVOS)) { - if (vo.getType().equals("float[]")) { + if ("float[]".equals(vo.getType())) { return floatValueBack(analyzeDataConditionVOS, floList, vo.getType()); - } else if (vo.getType().equals("float[][]")) { + } else if ("float[][]".equals(vo.getType())) { return floatValueBack(analyzeDataConditionVOS, floList, vo.getType()); - } else if (vo.getType().equals("bool[]")) { + } else if ("bool[]".equals(vo.getType())) { return boolBack(analyzeDataConditionVOS, boolList, vo.getType()); - } else if (vo.getType().equals("bool[][]")) { + } else if ("bool[][]".equals(vo.getType())) { return boolBack(analyzeDataConditionVOS, boolList, vo.getType()); } @@ -1536,13 +1536,13 @@ public class FdpMonitorServiceImpl extends BaseServiceImpl(); } else { @@ -1563,9 +1563,9 @@ public class FdpMonitorServiceImpl extends BaseServiceImpl(); } else { @@ -1616,7 +1616,7 @@ public class FdpMonitorServiceImpl extends BaseServiceImpl(); } else { @@ -1638,10 +1638,10 @@ public class FdpMonitorServiceImpl extends BaseServiceImpl(); } else { diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/util/HttpClientUtils.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/util/HttpClientUtils.java index dd96e60..39554bb 100644 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/util/HttpClientUtils.java +++ b/hzims-service/equipment/src/main/java/com/hnac/hzims/util/HttpClientUtils.java @@ -56,12 +56,15 @@ public abstract class HttpClientUtils { try { sc = SSLContext.getInstance("SSLv3"); sc.init((KeyManager[]) null, new TrustManager[]{new X509TrustManager() { + @Override public void checkClientTrusted(X509Certificate[] paramArrayOfX509Certificate, String paramString) throws CertificateException { } + @Override public void checkServerTrusted(X509Certificate[] paramArrayOfX509Certificate, String paramString) throws CertificateException { } + @Override public X509Certificate[] getAcceptedIssuers() { return null; } @@ -72,6 +75,7 @@ public abstract class HttpClientUtils { var2.printStackTrace(); } Registry socketFactoryRegistry = RegistryBuilder.create().register("http", PlainConnectionSocketFactory.INSTANCE).register("https", new SSLConnectionSocketFactory(sc, new HostnameVerifier() { + @Override public boolean verify(String s, SSLSession sslSession) { return true; } @@ -154,8 +158,9 @@ public abstract class HttpClientUtils { HttpGet httpGet = new HttpGet(url); for (int i = 0; i < headers.length; i += 2) { - if (headers[i] == null || headers[i + 1] == null) + if (headers[i] == null || headers[i + 1] == null) { continue; + } httpGet.addHeader(headers[i], headers[i + 1]); } @@ -189,8 +194,9 @@ public abstract class HttpClientUtils { ArrayList list = new ArrayList(); for (int i = 0; i < params.length; i += 2) { - if (params[i] == null || params[i + 1] == null) + if (params[i] == null || params[i + 1] == null) { continue; + } list.add(new BasicNameValuePair(params[i], params[i + 1])); } @@ -239,8 +245,9 @@ public abstract class HttpClientUtils { HttpPost httpPost = new HttpPost(url); for (int i = 0; i < headers.length; i += 2) { - if (headers[i] == null || headers[i + 1] == null) + if (headers[i] == null || headers[i + 1] == null) { continue; + } httpPost.addHeader(headers[i], headers[i + 1]); } @@ -269,8 +276,9 @@ public abstract class HttpClientUtils { HttpPost httpPost = new HttpPost(url); for (int i = 0; i < headers.length; i += 2) { - if (headers[i] == null || headers[i + 1] == null) + if (headers[i] == null || headers[i + 1] == null) { continue; + } httpPost.addHeader(headers[i], headers[i + 1]); } diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/services/impl/ContentServiceImpl.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/services/impl/ContentServiceImpl.java index f468a63..88743a2 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/services/impl/ContentServiceImpl.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/services/impl/ContentServiceImpl.java @@ -42,8 +42,8 @@ public class ContentServiceImpl extends BaseServiceImpl imp List re = this.baseMapper.getListPageOfPhone(page, task); for (TaskVo vo : re) { vo.setCanCancel(false); - if (vo.getMethod().equals("0")) { + if ("0".equals(vo.getMethod())) { if (vo.getStatus().equals(1) || vo.getStatus().equals(2)) { EventEntity entity = eventService.getOne(Wrappers.lambdaQuery(EventEntity.class).eq(EventEntity::getTaskId, vo.getId()).last("LIMIT 1")); if (entity == null) { @@ -961,7 +961,7 @@ public class TaskServiceImpl extends BaseServiceImpl imp throw new ServiceException("任务领取异常,请稍后重试!"); } // 任务开始列表中移除已进行领用任务 - this.startTaskIds.remove(task.getId()); + startTaskIds.remove(task.getId()); }); return true; } diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/utils/Base64ImgReplacedElementFactory.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/utils/Base64ImgReplacedElementFactory.java index 8cf5a31..1bf8dc4 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/utils/Base64ImgReplacedElementFactory.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/utils/Base64ImgReplacedElementFactory.java @@ -42,7 +42,7 @@ public class Base64ImgReplacedElementFactory implements ReplacedElementFactory { } String nodeName = e.getNodeName(); // 找到img标签 - if (nodeName.equals("img")) { + if ("img".equals(nodeName)) { String attribute = e.getAttribute("src"); FSImage fsImage; try { diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/utils/Condition.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/utils/Condition.java index 1c503ca..2679602 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/utils/Condition.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/utils/Condition.java @@ -40,21 +40,29 @@ public class Condition extends org.springblade.core.mp.support.Condition { for(Field field:fields){ field.setAccessible(true); QueryField queryField = field.getAnnotation(QueryField.class); - if(queryField==null)continue; + if(queryField==null) { + continue; + } Object value; try { value = field.get(query); } catch (Exception e) { throw new ServiceException("获取属性性出错"); } - if(value==null)continue; + if(value==null) { + continue; + } List list = null; if(value instanceof List){ list = (List)value; - if(list.size()==0)continue; + if(list.size()==0) { + continue; + } } String condition = queryField.condition(); - if(Func.isBlank(condition))continue; + if(Func.isBlank(condition)) { + continue; + } String fileName = camel2under(field.getName()); if(SqlCondition.EQUAL.equals(condition)) { qw.eq(fileName, value); @@ -66,14 +74,18 @@ public class Condition extends org.springblade.core.mp.support.Condition { qw.likeRight(fileName,value); }else if(SqlCondition.NOT_IN.equals(condition)){ String columnName = queryField.columnName(); - if(Func.isBlank(columnName))throw new ServiceException("查询不包含条件时需要指定列名"); + if(Func.isBlank(columnName)) { + throw new ServiceException("查询不包含条件时需要指定列名"); + } qw.notIn(camel2under(columnName),list); }else if(SqlCondition.IN.equals(condition)){ String columnName = queryField.columnName(); - if(Func.isBlank(columnName))throw new ServiceException("查询包含条件时需要指定列名"); + if(Func.isBlank(columnName)) { + throw new ServiceException("查询包含条件时需要指定列名"); + } qw.in(camel2under(columnName),list); } } return qw.lambda(); } -} \ No newline at end of file +} diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/utils/HttpClientUtils.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/utils/HttpClientUtils.java index 4e64290..2e1d5d0 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/utils/HttpClientUtils.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/utils/HttpClientUtils.java @@ -43,12 +43,15 @@ public abstract class HttpClientUtils { try { sc = SSLContext.getInstance("SSLv3"); sc.init((KeyManager[]) null, new TrustManager[]{new X509TrustManager() { + @Override public void checkClientTrusted(X509Certificate[] paramArrayOfX509Certificate, String paramString) throws CertificateException { } + @Override public void checkServerTrusted(X509Certificate[] paramArrayOfX509Certificate, String paramString) throws CertificateException { } + @Override public X509Certificate[] getAcceptedIssuers() { return null; } @@ -59,6 +62,7 @@ public abstract class HttpClientUtils { var2.printStackTrace(); } Registry socketFactoryRegistry = RegistryBuilder.create().register("http", PlainConnectionSocketFactory.INSTANCE).register("https", new SSLConnectionSocketFactory(sc, new HostnameVerifier() { + @Override public boolean verify(String s, SSLSession sslSession) { return true; } diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/utils/ZxingGenCode.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/utils/ZxingGenCode.java index 7999215..5002c31 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/utils/ZxingGenCode.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/utils/ZxingGenCode.java @@ -82,8 +82,9 @@ public class ZxingGenCode { resMatrix.clear(); for (int i = 0; i < resWidth; i++) { for (int j = 0; j < resHeight; j++) { - if (matrix.get(i + rec[0], j + rec[1])) + if (matrix.get(i + rec[0], j + rec[1])) { resMatrix.set(i, j); + } } } return resMatrix; diff --git a/hzims-service/message/src/main/java/com/hnac/hzims/message/schedule/MessagePushSchedule.java b/hzims-service/message/src/main/java/com/hnac/hzims/message/schedule/MessagePushSchedule.java index 19047e5..a5f0b53 100644 --- a/hzims-service/message/src/main/java/com/hnac/hzims/message/schedule/MessagePushSchedule.java +++ b/hzims-service/message/src/main/java/com/hnac/hzims/message/schedule/MessagePushSchedule.java @@ -74,7 +74,9 @@ public class MessagePushSchedule { XxlJobLogger.log("开始推送短信,推送条数为:"+pushMessageList.size()); // 获取推送消息内容体 根据用户拆分出多条短信推送 List splitSmsList = this.transform(pushMessageList); - if(CollectionUtil.isEmpty(splitSmsList)) return; + if(CollectionUtil.isEmpty(splitSmsList)) { + return; + } this.push(splitSmsList,smsConfigEntity); }); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/service/impl/StAlamRecordServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/service/impl/StAlamRecordServiceImpl.java index acd3b47..e256659 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/service/impl/StAlamRecordServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/service/impl/StAlamRecordServiceImpl.java @@ -180,7 +180,7 @@ public class StAlamRecordServiceImpl extends BaseServiceImpl faultStatusVoList, DataSet dataSet, TimeDataVo dataVo, String value) { //if (CollectionUtil.isNotEmpty(faultStatusVoList) && 0 == dataSet.getStatus() && !dataVo.getValue().equals("-")) { - if (CollectionUtil.isNotEmpty(faultStatusVoList) && !value.equals("-")) { + if (CollectionUtil.isNotEmpty(faultStatusVoList) && !"-".equals(value)) { List collect2 = faultStatusVoList.stream().filter(o -> o.getRealId().equals(dataSet.getRealId())).collect(Collectors.toList()); if (CollectionUtil.isNotEmpty(collect2)) { FdpFaultStatusVo fdpFaultStatusVo = collect2.get(0); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyMainServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyMainServiceImpl.java index 5b1ffc0..bf26530 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyMainServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyMainServiceImpl.java @@ -821,7 +821,7 @@ public class ImsDutyMainServiceImpl extends BaseServiceImpl IPage list(MainWorkBenchEntity req, Query query); + @Override boolean updateById(MainWorkBenchEntity req); List getInRefDeptStationCount(List list, String refDomain); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/AppHomeServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/AppHomeServiceImpl.java index f8a0a76..367c66e 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/AppHomeServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/AppHomeServiceImpl.java @@ -218,7 +218,7 @@ public class AppHomeServiceImpl implements IAppHomeService { if(StringUtil.isBlank(value)){ continue; } - if (value.contains("1") || value.equals("1.0")) { + if (value.contains("1") || "1.0".equals(value)) { em.setOnOff(true); } } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HomePageServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HomePageServiceImpl.java index 17b312a..7f38d0f 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HomePageServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HomePageServiceImpl.java @@ -536,7 +536,9 @@ public class HomePageServiceImpl implements IHomePageService { vo.setStrMonth(mon); if(CollectionUtil.isEmpty(planPowerList)){ vo.setPlanPower(0f); - }else vo.setPlanPower((float) planPowerList.stream().filter(o->mon.equals(o.getDateTime()+"-01")).mapToDouble(PlanGenerationEntity::getPlanGeneration).sum()); + }else { + vo.setPlanPower((float) planPowerList.stream().filter(o->mon.equals(o.getDateTime()+"-01")).mapToDouble(PlanGenerationEntity::getPlanGeneration).sum()); + } if(MapUtils.isEmpty(floatMap)){ vo.setPower(0f); }else{ @@ -1136,7 +1138,7 @@ public class HomePageServiceImpl implements IHomePageService { List areaGenerationMakeUpVos = new ArrayList<>(); deptList.forEach(iter -> { - List list = userDeptList.stream().filter(s -> s.getDeptCategory().toString().equals("4") && s.getParentId().toString().equals(iter.getId().toString())).collect(Collectors.toList()); + List list = userDeptList.stream().filter(s -> "4".equals(s.getDeptCategory().toString()) && s.getParentId().toString().equals(iter.getId().toString())).collect(Collectors.toList()); List deptList1 = new ArrayList<>(); list.forEach(f -> { if (stationByType.contains(f.getStationId())) { @@ -1242,7 +1244,7 @@ public class HomePageServiceImpl implements IHomePageService { Dept dept = min.get(); switch (dept.getDeptCategory()) { case 1: //集团 - List stationIdList = deptByCurrentUser.getData().stream().filter(s -> s.getDeptCategory().toString().equals("4")).map(Dept::getStationId).collect(Collectors.toList()); + List stationIdList = deptByCurrentUser.getData().stream().filter(s -> "4".equals(s.getDeptCategory().toString())).map(Dept::getStationId).collect(Collectors.toList()); List stationList = new ArrayList<>(); stationIdList.forEach(iter -> { if (stationByType.contains(iter)) { @@ -1254,7 +1256,7 @@ public class HomePageServiceImpl implements IHomePageService { } break; case 2: //省子公司 - List szgsStationIdList = deptByCurrentUser.getData().stream().filter(s -> s.getParentId().toString().equals(dept.getId().toString()) && s.getDeptCategory().toString().equals("4")).map(Dept::getStationId).collect(Collectors.toList()); + List szgsStationIdList = deptByCurrentUser.getData().stream().filter(s -> s.getParentId().toString().equals(dept.getId().toString()) && "4".equals(s.getDeptCategory().toString())).map(Dept::getStationId).collect(Collectors.toList()); List szgsStationList = new ArrayList<>(); szgsStationIdList.forEach(iter -> { if (stationByType.contains(iter)) { @@ -1266,9 +1268,9 @@ public class HomePageServiceImpl implements IHomePageService { } break; case 3: //区域 - List aeraDeptList = deptByCurrentUser.getData().stream().filter(s -> s.getDeptCategory().toString().equals("3")).collect(Collectors.toList()); + List aeraDeptList = deptByCurrentUser.getData().stream().filter(s -> "3".equals(s.getDeptCategory().toString())).collect(Collectors.toList()); aeraDeptList.forEach(iter -> { - List areaStationIdList = deptByCurrentUser.getData().stream().filter(s -> s.getParentId().toString().equals(iter.getId().toString()) && s.getDeptCategory().toString().equals("4")).map(Dept::getStationId).collect(Collectors.toList()); + List areaStationIdList = deptByCurrentUser.getData().stream().filter(s -> s.getParentId().toString().equals(iter.getId().toString()) && "4".equals(s.getDeptCategory().toString())).map(Dept::getStationId).collect(Collectors.toList()); List areaStationList = new ArrayList<>(); areaStationIdList.forEach(f -> { if (stationByType.contains(f)) { @@ -1300,7 +1302,7 @@ public class HomePageServiceImpl implements IHomePageService { R> deptByCurrentUser = sysClient.getDeptByCurrentUser(); - List areaStationIdList = deptByCurrentUser.getData().stream().filter(s -> s.getDeptCategory().toString().equals("4") && + List areaStationIdList = deptByCurrentUser.getData().stream().filter(s -> "4".equals(s.getDeptCategory().toString()) && s.getParentId().toString().equals(deptId.toString())).map(Dept::getStationId).collect(Collectors.toList()); if (CollectionUtil.isEmpty(stationByType)) { map.put(deptId, planGenerationTrendByDepts(areaStationIdList)); @@ -1346,7 +1348,7 @@ public class HomePageServiceImpl implements IHomePageService { Map> finalYearGenerationMap = yearGenerationMap; switch (dept.getDeptCategory()) { case 1: //集团 - List jtDeptList = deptByCurrentUser.getData().stream().filter(s -> s.getDeptCategory().toString().equals("3")).collect(Collectors.toList()); + List jtDeptList = deptByCurrentUser.getData().stream().filter(s -> "3".equals(s.getDeptCategory().toString())).collect(Collectors.toList()); List list = areaGenerationMakeUpByDepts(jtDeptList, finalYearGenerationMap, deptByCurrentUser.getData(), stationByType); if (CollectionUtil.isNotEmpty(list)) { List collect = list.stream().sorted(Comparator.comparing(AreaGenerationMakeUpVo::getGeneration).reversed()).collect(Collectors.toList()); @@ -1354,7 +1356,7 @@ public class HomePageServiceImpl implements IHomePageService { } break; case 2: //省子公司 - List deptList = deptByCurrentUser.getData().stream().filter(s -> s.getId().toString().contains(dept.getId().toString()) && s.getDeptCategory().toString().equals("3")).collect(Collectors.toList()); + List deptList = deptByCurrentUser.getData().stream().filter(s -> s.getId().toString().contains(dept.getId().toString()) && "3".equals(s.getDeptCategory().toString())).collect(Collectors.toList()); List list1 = areaGenerationMakeUpByDepts(deptList, finalYearGenerationMap, deptByCurrentUser.getData(), stationByType); if (CollectionUtil.isNotEmpty(list1)) { List collect1 = list1.stream().sorted(Comparator.comparing(AreaGenerationMakeUpVo::getGeneration).reversed()).collect(Collectors.toList()); @@ -1362,9 +1364,9 @@ public class HomePageServiceImpl implements IHomePageService { } break; case 3: //区域 - List aeraDeptList = deptByCurrentUser.getData().stream().filter(s -> s.getDeptCategory().toString().equals("3")).collect(Collectors.toList()); + List aeraDeptList = deptByCurrentUser.getData().stream().filter(s -> "3".equals(s.getDeptCategory().toString())).collect(Collectors.toList()); aeraDeptList.forEach(iter -> { - List stationDeptList = deptByCurrentUser.getData().stream().filter(s -> s.getParentId().toString().equals(iter.getId().toString()) && s.getDeptCategory().toString().equals("4")).collect(Collectors.toList()); + List stationDeptList = deptByCurrentUser.getData().stream().filter(s -> s.getParentId().toString().equals(iter.getId().toString()) && "4".equals(s.getDeptCategory().toString())).collect(Collectors.toList()); List depts = new ArrayList<>(); stationDeptList.forEach(f -> { if (stationByType.contains(f.getStationId())) { @@ -1397,7 +1399,7 @@ public class HomePageServiceImpl implements IHomePageService { Map> map = new HashMap<>(); //根据用户权限获取机构数据 R> deptByCurrentUser = sysClient.getDeptByCurrentUser(); - List deptList = deptByCurrentUser.getData().stream().filter(s -> s.getDeptCategory().toString().equals("4") && + List deptList = deptByCurrentUser.getData().stream().filter(s -> "4".equals(s.getDeptCategory().toString()) && s.getParentId().toString().equals(deptId.toString())).collect(Collectors.toList()); List depts = new ArrayList<>(); @@ -1466,7 +1468,8 @@ public class HomePageServiceImpl implements IHomePageService { * @param year * @return */ - public List getMonthList(int year, int endMoth,boolean nextMon) { + @Override + public List getMonthList(int year, int endMoth, boolean nextMon) { SimpleDateFormat sdf = new SimpleDateFormat(DateUtil.PATTERN_DATE); List list = new ArrayList<>(); // 开始日期 @@ -1598,7 +1601,7 @@ public class HomePageServiceImpl implements IHomePageService { if (null == deptId) { return R.data(this.areaCountParamIsNull(deptByCurrentUser.getData(), jointRelayMap, activePowerMap, installedCapacityMap, finalYearGenerationMap, stationByType)); } - List deptList = deptByCurrentUser.getData().stream().filter(s -> s.getParentId().toString().equals(deptId.toString()) && s.getDeptCategory().toString().equals("4")).collect(Collectors.toList()); + List deptList = deptByCurrentUser.getData().stream().filter(s -> s.getParentId().toString().equals(deptId.toString()) && "4".equals(s.getDeptCategory().toString())).collect(Collectors.toList()); Map> map = new HashMap<>(); Map> stationMap = getStationMap(true); List list = this.areaCountParamIsNotNull(stationMap, jointRelayMap, activePowerMap, deptList, installedCapacityMap, finalYearGenerationMap, stationByType); @@ -1628,7 +1631,7 @@ public class HomePageServiceImpl implements IHomePageService { Map> stationMap = getStationMap(true); areaDeptList.forEach(iter -> { - List deptList = userDeptList.stream().filter(s -> s.getParentId().toString().equals(iter.getId().toString()) && s.getDeptCategory().toString().equals("4")).collect(Collectors.toList()); + List deptList = userDeptList.stream().filter(s -> s.getParentId().toString().equals(iter.getId().toString()) && "4".equals(s.getDeptCategory().toString())).collect(Collectors.toList()); List list = this.areaCountParamIsNotNull(stationMap, jointRelayMap, activePowerMap, deptList, installedCapacityMap, finalYearGenerationMap, stationByType); if (CollectionUtil.isNotEmpty(list)) { map.put(iter.getId(), list); @@ -1646,7 +1649,7 @@ public class HomePageServiceImpl implements IHomePageService { List list = new ArrayList<>(); Map> stationMap = getStationMap(false); - List jtDeptList = userDeptList.stream().filter(s -> s.getDeptCategory().toString().equals("3")).collect(Collectors.toList()); + List jtDeptList = userDeptList.stream().filter(s -> "3".equals(s.getDeptCategory().toString())).collect(Collectors.toList()); jtDeptList.forEach(iter -> { HomePageCountVo homePageCountVo = getHomePageCountVo(iter, userDeptList, jointRelayMap, activePowerMap, installedCapacityMap, finalYearGenerationMap, stationByType); if (null != homePageCountVo) { @@ -1690,7 +1693,7 @@ public class HomePageServiceImpl implements IHomePageService { Map> finalYearGenerationMap, List stationByType) { HomePageCountVo vo = new HomePageCountVo(); - List collect = userDeptList.stream().filter(s -> s.getParentId().toString().equals(dept.getId().toString()) && s.getDeptCategory().toString().equals("4")).collect(Collectors.toList()); + List collect = userDeptList.stream().filter(s -> s.getParentId().toString().equals(dept.getId().toString()) && "4".equals(s.getDeptCategory().toString())).collect(Collectors.toList()); vo.setDeptId(dept.getId()); vo.setStationName(dept.getDeptName()); @@ -2139,7 +2142,7 @@ public class HomePageServiceImpl implements IHomePageService { List collect = deptByCurrentUser.getData().stream().filter(s -> s.getId().toString().equals(depeId.toString())).collect(Collectors.toList()); return R.data(getAreaVoList(collect)); } - List collect = deptByCurrentUser.getData().stream().filter(s -> s.getDeptCategory().toString().equals("3")).collect(Collectors.toList()); + List collect = deptByCurrentUser.getData().stream().filter(s -> "3".equals(s.getDeptCategory().toString())).collect(Collectors.toList()); return R.data(getAreaVoList(collect)); } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/MainSystemMonitoringServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/MainSystemMonitoringServiceImpl.java index 5a18943..bff519a 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/MainSystemMonitoringServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/MainSystemMonitoringServiceImpl.java @@ -1185,9 +1185,9 @@ public class MainSystemMonitoringServiceImpl implements IMainSystemMonitoringSer if (StringUtil.isNotBlank(realIdJointRelay)) { if (null != realIdKeyMap.get(realIdJointRelay)) { String value = realIdKeyMap.get(realIdJointRelay).toString(); - if (value.equals("0") || value.equals("0.0")) { + if ("0".equals(value) || "0.0".equals(value)) { vo.setOnOff(false); - } else if (value.contains("1") || value.equals("1.0")) { + } else if (value.contains("1") || "1.0".equals(value)) { vo.setOnOff(true); } } @@ -1772,7 +1772,7 @@ public class MainSystemMonitoringServiceImpl implements IMainSystemMonitoringSer @Override public List doListByAuth(StationEntity entity) { BladeUser user = AuthUtil.getUser(); - if (user.getAccount().equals("admin")) { + if ("admin".equals(user.getAccount())) { return stationService.getAll(); } return getStationList(true); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/PlatformServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/PlatformServiceImpl.java index b552be1..e694103 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/PlatformServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/PlatformServiceImpl.java @@ -127,8 +127,9 @@ public class PlatformServiceImpl implements IPlatformService { stationCountVo.setCount(0); Integer type = Integer.valueOf(o.getDictKey()); List stationEntityList = map.get(type); - if(CollectionUtil.isNotEmpty(stationEntityList)) + if(CollectionUtil.isNotEmpty(stationEntityList)) { stationCountVo.setCount(stationEntityList.size()); + } voList.add(stationCountVo); }); return voList; @@ -258,11 +259,11 @@ public class PlatformServiceImpl implements IPlatformService { return null; } String date = ""; - if (type.equals("day")) { + if ("day".equals(type)) { date = DateUtil.format(new Date(), "yyyy-MM-dd 00:00:00"); - } else if (type.equals("month")) { + } else if ("month".equals(type)) { date = DateUtil.format(new Date(), "yyyy-MM-01 00:00:00"); - } else if (type.equals("year")) { + } else if ("year".equals(type)) { date = DateUtil.format(new Date(), "yyyy-01-01 00:00:00"); } @@ -567,8 +568,8 @@ public class PlatformServiceImpl implements IPlatformService { int ct = 0; int pt = 0; if (CollectionUtil.isNotEmpty(paramList)) { - List cts = paramList.stream().filter(o -> o.getInfoId().toString().equals(entity.getId().toString()) && o.getParamName().equals("ct")).collect(Collectors.toList()); - List pts = paramList.stream().filter(o -> o.getInfoId().toString().equals(entity.getId().toString()) && o.getParamName().equals("pt")).collect(Collectors.toList()); + List cts = paramList.stream().filter(o -> o.getInfoId().toString().equals(entity.getId().toString()) && "ct".equals(o.getParamName())).collect(Collectors.toList()); + List pts = paramList.stream().filter(o -> o.getInfoId().toString().equals(entity.getId().toString()) && "pt".equals(o.getParamName())).collect(Collectors.toList()); if (CollectionUtil.isNotEmpty(cts)) { EmParamEntity emParamEntity = cts.get(0); ct = Integer.valueOf(emParamEntity.getParamValue()); @@ -712,7 +713,7 @@ public class PlatformServiceImpl implements IPlatformService { R> analyzeCodeBySignages = analyseDataSearchClient.getAnalyzeCodeBySignages(entity.getNumber()); if (analyzeCodeBySignages.isSuccess() && CollectionUtil.isNotEmpty(analyzeCodeBySignages.getData())) { List data = analyzeCodeBySignages.getData(); - List jointRelayList = data.stream().filter(o -> o.getSignage().equals("joint_relay")).collect(Collectors.toList()); + List jointRelayList = data.stream().filter(o -> "joint_relay".equals(o.getSignage())).collect(Collectors.toList()); if (CollectionUtil.isNotEmpty(jointRelayList)) { AnalyzeCodeBySignagesVO analyzeCodeBySignagesVO = jointRelayList.get(0); if (StringUtil.isNotBlank(analyzeCodeBySignagesVO.getRealId())) { @@ -750,9 +751,9 @@ public class PlatformServiceImpl implements IPlatformService { if ((record.getQ() > 0 && record.getQ() < 9)) {//异常 lastType = 1; } else if (record.getQ() == 0 || record.getQ() == 9) {//非异常 - if (Func.isNotBlank(record.getValue()) && record.getValue().equals("1")) {//开机 + if (Func.isNotBlank(record.getValue()) && "1".equals(record.getValue())) {//开机 lastType = 2; - } else if (Func.isNotBlank(record.getValue()) && record.getValue().equals("0")) {//关机 + } else if (Func.isNotBlank(record.getValue()) && "0".equals(record.getValue())) {//关机 lastType = 3; } } @@ -765,13 +766,13 @@ public class PlatformServiceImpl implements IPlatformService { lastType = 1; } } else if (record.getQ() == 0 || record.getQ() == 9) {//非异常 - if (Func.isNotBlank(record.getValue()) && record.getValue().equals("1")) {//开机 + if (Func.isNotBlank(record.getValue()) && "1".equals(record.getValue())) {//开机 if (lastType == 1) {//如果上次类型为异常 lastType = 2; } else if (lastType == 3) {//如果上次类型为关机 lastType = 2; } - } else if (Func.isNotBlank(record.getValue()) && record.getValue().equals("0")) {//关机 + } else if (Func.isNotBlank(record.getValue()) && "0".equals(record.getValue())) {//关机 if (lastType == 1) {//如果上次类型为异常 lastType = 3; } else if (lastType == 2) {//如果上次类型为开机 diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/RunMonthReportServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/RunMonthReportServiceImpl.java index f1c5586..4eac172 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/RunMonthReportServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/RunMonthReportServiceImpl.java @@ -219,7 +219,7 @@ public class RunMonthReportServiceImpl extends ServiceImpl signageAll = dataAll.stream().map(iter -> iter.getSignage()).collect(Collectors.toList()); if (CollectionUtil.isNotEmpty(dataAll)) { for (AnalyzeCodeBySignagesVO codeBySignagesVO : dataAll) { - if (codeBySignagesVO.getSignage().equals("joint_relay")) { + if ("joint_relay".equals(codeBySignagesVO.getSignage())) { realId = codeBySignagesVO.getRealId(); } signKeyMap.put(codeBySignagesVO.getSignage(), codeBySignagesVO.getInstancefName()); @@ -265,7 +265,7 @@ public class RunMonthReportServiceImpl extends ServiceImpl statorSignages = signageAll.stream().filter(iter -> iter.contains("stator_")).collect(Collectors.toList()); //包含负荷、定子、轴承 - List joinSignages = signageAll.stream().filter(iter -> iter.equals("active_power") || iter.contains("bearing_") || iter.contains("stator_")).collect(Collectors.toList()); + List joinSignages = signageAll.stream().filter(iter -> "active_power".equals(iter) || iter.contains("bearing_") || iter.contains("stator_")).collect(Collectors.toList()); //运行数据汇报--负荷 RunMonthReportUnitVo runMonthReportUnitVoFH = new RunMonthReportUnitVo(); @@ -500,9 +500,9 @@ public class RunMonthReportServiceImpl extends ServiceImpl 0 && pointData.getQ() < 9) { oneLastType = 1; } else if (pointData.getQ() == 0 || pointData.getQ() == 9) { - if (Func.isNotBlank(pointData.getValue()) && pointData.getValue().equals("1")) {//开机 + if (Func.isNotBlank(pointData.getValue()) && "1".equals(pointData.getValue())) {//开机 oneLastType = 2; - } else if (Func.isNotBlank(pointData.getValue()) && pointData.getValue().equals("0")) {//关机 + } else if (Func.isNotBlank(pointData.getValue()) && "0".equals(pointData.getValue())) {//关机 oneLastType = 3; } } @@ -548,7 +548,7 @@ public class RunMonthReportServiceImpl extends ServiceImpl backupList = equipmentCodeList.stream().filter(o-> !surplusDevices.contains(o)).collect(Collectors.toList()); if(CollectionUtil.isEmpty(backupList)){ - equipmentCountVo.setBackupCount(0l); + equipmentCountVo.setBackupCount(0L); }else{ List backup = backupList.stream().map(o->{ DeviceVo deviceVo = new DeviceVo(); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/UnitRunningTimeServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/UnitRunningTimeServiceImpl.java index f90626d..82c5ec0 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/UnitRunningTimeServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/UnitRunningTimeServiceImpl.java @@ -170,9 +170,9 @@ public class UnitRunningTimeServiceImpl extends BaseServiceImpl 0 && pointData.getQ() < 9) { oneLastType = 1; } else if (pointData.getQ() == 0 || pointData.getQ() == 9) { - if (Func.isNotBlank(pointData.getValue()) && pointData.getValue().equals("0")) {//关机 + if (Func.isNotBlank(pointData.getValue()) && "0".equals(pointData.getValue())) {//关机 oneLastType = 3; - } else if (Func.isNotBlank(pointData.getValue()) && pointData.getValue().equals("1")) {//开机 + } else if (Func.isNotBlank(pointData.getValue()) && "1".equals(pointData.getValue())) {//开机 oneLastType = 2; } } @@ -213,7 +213,7 @@ public class UnitRunningTimeServiceImpl extends BaseServiceImpl 30 * 60 * 1000l){ + if(System.currentTimeMillis() - date.getTime() > 30 * 60 * 1000L){ return 0.0; } }catch (ParseException e){ @@ -531,7 +531,9 @@ public class WaterServiceImpl implements IWaterService { if(i == result.size() - 1){ endTime = endDate; } - else endTime = DateUtil.parse(result.get(i+1).getTime(), DateUtil.PATTERN_DATETIME); + else { + endTime = DateUtil.parse(result.get(i+1).getTime(), DateUtil.PATTERN_DATETIME); + } time += endTime.getTime() - startTime.getTime(); } return time; @@ -736,7 +738,9 @@ public class WaterServiceImpl implements IWaterService { vo.setHour(dateTime.getHours()); if (StringUtil.isBlank(item.getVal())) { vo.setActivePower("0"); - }else vo.setActivePower(item.getVal()); + }else { + vo.setActivePower(item.getVal()); + } list.add(vo); } } @@ -1139,7 +1143,8 @@ public class WaterServiceImpl implements IWaterService { * @param deptId * @return */ - public Dept getTitleDetp(List authList,Long deptId) { + @Override + public Dept getTitleDetp(List authList, Long deptId) { if(null == deptId){ // 最小类型机构 Dept dept = authList.stream().min(Comparator.comparing(Dept::getDeptCategory)).orElse(null); @@ -1393,7 +1398,9 @@ public class WaterServiceImpl implements IWaterService { Map map; if(flag == 0){ map = list.get(0).getFrontCurveMap(); - } else map = list.get(0).getRearCurveMap(); + } else { + map = list.get(0).getRearCurveMap(); + } if(MapUtils.isEmpty(map)){ return null; } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/WeatherServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/WeatherServiceImpl.java index 010cf1a..fd61440 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/WeatherServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/WeatherServiceImpl.java @@ -29,6 +29,7 @@ public class WeatherServiceImpl implements IWeatherService { * @param codes * @return */ + @Override public Map getNowWeather(List codes) { if(CollectionUtil.isEmpty(codes)){ return null; @@ -46,6 +47,7 @@ public class WeatherServiceImpl implements IWeatherService { * @param codes * @return */ + @Override public Map getWeekWeather(List codes) { if(CollectionUtil.isEmpty(codes)){ return null; diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/OperMaintenanceLibraryServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/OperMaintenanceLibraryServiceImpl.java index 1f95ea9..0751fc1 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/OperMaintenanceLibraryServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/OperMaintenanceLibraryServiceImpl.java @@ -63,16 +63,21 @@ public class OperMaintenanceLibraryServiceImpl extends BaseServiceImpl> list(OperMaintenanceLibraryDTO req, Query query) { Wrapper queryWrapper = new LambdaQueryWrapper() {{ orderByDesc(OperMaintenanceLibraryEntity::getCreateTime); - if (StringUtils.isNotBlank(req.getLibraryCode())) + if (StringUtils.isNotBlank(req.getLibraryCode())) { like(OperMaintenanceLibraryEntity::getLibraryCode, req.getLibraryCode()); - if (StringUtils.isNotBlank(req.getEmCode())) + } + if (StringUtils.isNotBlank(req.getEmCode())) { like(OperMaintenanceLibraryEntity::getEmCode, req.getEmCode()); - if (StringUtils.isNotBlank(req.getTypeCode())) + } + if (StringUtils.isNotBlank(req.getTypeCode())) { eq(OperMaintenanceLibraryEntity::getTypeCode, req.getTypeCode()); - if (StringUtils.isNotBlank(req.getProcDefId())) + } + if (StringUtils.isNotBlank(req.getProcDefId())) { eq(OperMaintenanceLibraryEntity::getProcDefId, req.getProcDefId()); - if (StringUtils.isNotBlank(req.getDisposers())) + } + if (StringUtils.isNotBlank(req.getDisposers())) { like(OperMaintenanceLibraryEntity::getDisposers, "," + req.getDisposers() + ","); + } }}; IPage pages = super.page(Condition.getPage(query), queryWrapper); pages.setRecords(OperMaintenanceLibraryWrapper.build().listVO(pages.getRecords())); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/OperMaintenanceParameterServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/OperMaintenanceParameterServiceImpl.java index 845d1d7..3106c78 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/OperMaintenanceParameterServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/OperMaintenanceParameterServiceImpl.java @@ -35,14 +35,18 @@ public class OperMaintenanceParameterServiceImpl extends BaseServiceImpl> list(OperMaintenanceParameterDTO req, Query query) { Wrapper queryWrapper = new LambdaQueryWrapper() {{ orderByDesc(OperMaintenanceParameterEntity::getCreateTime); - if (StringUtils.isNotBlank(req.getEmCode())) + if (StringUtils.isNotBlank(req.getEmCode())) { like(OperMaintenanceParameterEntity::getEmCode, req.getEmCode()); - if (StringUtils.isNotBlank(req.getTypeCode())) + } + if (StringUtils.isNotBlank(req.getTypeCode())) { eq(OperMaintenanceParameterEntity::getTypeCode, req.getTypeCode()); - if (req.getRefLibraryId() != null) + } + if (req.getRefLibraryId() != null) { eq(OperMaintenanceParameterEntity::getRefLibraryId, req.getRefLibraryId()); - if (req.getDisposer() != null) + } + if (req.getDisposer() != null) { eq(OperMaintenanceParameterEntity::getDisposer, req.getDisposer()); + } }}; IPage pages = super.page(Condition.getPage(query), queryWrapper); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/ImsDeptServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/ImsDeptServiceImpl.java index 8b17c57..2bf4c65 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/ImsDeptServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/ImsDeptServiceImpl.java @@ -143,7 +143,7 @@ public class ImsDeptServiceImpl extends ServiceImpl deptIdList = deptByCurrentUser.getData().stream().map(Dept::getId).collect(Collectors.toList()); List deptData = deptTree.getData(); - List collect = deptData.stream().filter(s -> s.getParentId().toString().equals("0")).collect(Collectors.toList()); + List collect = deptData.stream().filter(s -> "0".equals(s.getParentId().toString())).collect(Collectors.toList()); List deptTreeData = transition(collect, "0", deptIdList); return R.data(createGroupAndStationTree(deptData, deptIdList, deptTreeData)); } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/RealMonitorServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/RealMonitorServiceImpl.java index 6e2c587..a124292 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/RealMonitorServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/RealMonitorServiceImpl.java @@ -234,7 +234,7 @@ public class RealMonitorServiceImpl implements IRealMonitorService { SimpleDateFormat simpleDateFormat = new SimpleDateFormat(DateUtil.PATTERN_DATETIME); Date date = simpleDateFormat.parse(time); // 实时数据超出10分钟未刷新,值置为 0 显示 - if(System.currentTimeMillis() - date.getTime() > 10 * 60 * 1000l){ + if(System.currentTimeMillis() - date.getTime() > 10 * 60 * 1000L){ value.put("value","0"); } }catch (ParseException e){ @@ -839,6 +839,7 @@ public class RealMonitorServiceImpl implements IRealMonitorService { * @param message * @return */ + @Override public TextMessage getSendMessage(MessageParamVo message) { Long beginTime = System.currentTimeMillis(); Thread thread = Thread.currentThread(); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/utils/ArtemisPostUtils.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/utils/ArtemisPostUtils.java index dc7ffa6..ec1d13b 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/utils/ArtemisPostUtils.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/utils/ArtemisPostUtils.java @@ -122,7 +122,7 @@ public class ArtemisPostUtils { String result = ArtemisHttpUtil.doPostStringArtemis(path, body, null, null, contentType, null); if (null != result || !"".equals(result)) { JSONObject json = JSONObject.parseObject(result); - if (time != -1 && json.getString("msg").equals("success")) { + if (time != -1 && "success".equals(json.getString("msg"))) { Runnable myRunnable = new Runnable(){ @Override public void run(){ diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/util/CommonUtils.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/util/CommonUtils.java index bb20d36..cb5970f 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/util/CommonUtils.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/util/CommonUtils.java @@ -70,10 +70,10 @@ public class CommonUtils { //创建第2个sheet用于放数据 wb.createSheet("数据"); //模板上设置的合并单元格失效,所以手动设置 - if(stationType.equals("0")){ + if("0".equals(stationType)){ fillText(wb, wb.getSheetAt(0), startRow - 1, "3、机组负荷、温度曲线", 14); fillAvgValueMap(wb, sheet2NowRow, avgList); - }else if(stationType.equals("")){ + }else if("".equals(stationType)){ fillText(wb, wb.getSheetAt(0), startRow - 1, "3、内河水位、外河水位、负荷、温度曲线", 14); } //循环机组遥测数据 diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/util/HttpClientUtils.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/util/HttpClientUtils.java index b110a73..626b894 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/util/HttpClientUtils.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/util/HttpClientUtils.java @@ -52,12 +52,15 @@ public abstract class HttpClientUtils { try { sc = SSLContext.getInstance("SSLv3"); sc.init((KeyManager[]) null, new TrustManager[]{new X509TrustManager() { + @Override public void checkClientTrusted(X509Certificate[] paramArrayOfX509Certificate, String paramString) throws CertificateException { } + @Override public void checkServerTrusted(X509Certificate[] paramArrayOfX509Certificate, String paramString) throws CertificateException { } + @Override public X509Certificate[] getAcceptedIssuers() { return null; } @@ -68,6 +71,7 @@ public abstract class HttpClientUtils { var2.printStackTrace(); } Registry socketFactoryRegistry = RegistryBuilder.create().register("http", PlainConnectionSocketFactory.INSTANCE).register("https", new SSLConnectionSocketFactory(sc, new HostnameVerifier() { + @Override public boolean verify(String s, SSLSession sslSession) { return true; } @@ -187,8 +191,9 @@ public abstract class HttpClientUtils { HttpGet httpGet = new HttpGet(url); for (int i = 0; i < headers.length; i += 2) { - if (headers[i] == null || headers[i + 1] == null) + if (headers[i] == null || headers[i + 1] == null) { continue; + } httpGet.addHeader(headers[i], headers[i + 1]); } @@ -222,8 +227,9 @@ public abstract class HttpClientUtils { ArrayList list = new ArrayList(); for (int i = 0; i < params.length; i += 2) { - if (params[i] == null || params[i + 1] == null) + if (params[i] == null || params[i + 1] == null) { continue; + } list.add(new BasicNameValuePair(params[i], params[i + 1])); } @@ -270,8 +276,9 @@ public abstract class HttpClientUtils { HttpPost httpPost = new HttpPost(url); for (int i = 0; i < headers.length; i += 2) { - if (headers[i] == null || headers[i + 1] == null) + if (headers[i] == null || headers[i + 1] == null) { continue; + } httpPost.addHeader(headers[i], headers[i + 1]); } @@ -300,8 +307,9 @@ public abstract class HttpClientUtils { HttpPost httpPost = new HttpPost(url); for (int i = 0; i < headers.length; i += 2) { - if (headers[i] == null || headers[i + 1] == null) + if (headers[i] == null || headers[i + 1] == null) { continue; + } httpPost.addHeader(headers[i], headers[i + 1]); } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CheckItemServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CheckItemServiceImpl.java index db76775..0a8eed5 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CheckItemServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CheckItemServiceImpl.java @@ -100,7 +100,9 @@ public class CheckItemServiceImpl extends BaseServiceImpl children = list(entityQueryWrapper); - if (!isDelete) children.add(entity); + if (!isDelete) { + children.add(entity); + } double parentTotal = children.stream().map(CheckItemEntity::getTotalScore).mapToDouble(Double::doubleValue).sum(); CheckItemEntity parentItem = getById(parentId); parentItem.setTotalScore(parentTotal); @@ -506,13 +512,13 @@ public class CheckItemServiceImpl extends BaseServiceImpl queryWrapper = new QueryWrapper() {{ - if (null != req.getSendType()) + if (null != req.getSendType()) { eq("send_type", req.getSendType()); - if (StringUtil.isNotBlank(req.getTypeName())) + } + if (StringUtil.isNotBlank(req.getTypeName())) { like("type_name", StringUtil.trimWhitespace(req.getTypeName())); - if (StringUtil.isNotBlank(req.getStartSendTime())) + } + if (StringUtil.isNotBlank(req.getStartSendTime())) { ge("send_time", req.getStartSendTime()); - if (StringUtil.isNotBlank(req.getEndSendTime())) + } + if (StringUtil.isNotBlank(req.getEndSendTime())) { le("send_time", req.getEndSendTime()); + } }}; IPage pages = super.page(Condition.getPage(query), queryWrapper); pages.setRecords(SafetyToolTypeWrapper.build().listVO(pages.getRecords())); diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/utils/Base64ImgReplacedElementFactory.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/utils/Base64ImgReplacedElementFactory.java index 3a8be8e..846cc03 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/utils/Base64ImgReplacedElementFactory.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/utils/Base64ImgReplacedElementFactory.java @@ -42,7 +42,7 @@ public class Base64ImgReplacedElementFactory implements ReplacedElementFactory { } String nodeName = e.getNodeName(); // 找到img标签 - if (nodeName.equals("img")) { + if ("img".equals(nodeName)) { String attribute = e.getAttribute("src"); FSImage fsImage; try { diff --git a/hzims-service/spare/spare.iml b/hzims-service/spare/spare.iml deleted file mode 100644 index d892b9a..0000000 --- a/hzims-service/spare/spare.iml +++ /dev/null @@ -1,358 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/hzims-service/topvision/topvision.iml b/hzims-service/topvision/topvision.iml deleted file mode 100644 index 31b330c..0000000 --- a/hzims-service/topvision/topvision.iml +++ /dev/null @@ -1,319 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file From 58e090aeb01fe5325661891b7a531f0289ead00d Mon Sep 17 00:00:00 2001 From: tyty Date: Wed, 15 Mar 2023 19:03:49 +0800 Subject: [PATCH 2/2] =?UTF-8?q?-=E5=8E=82=E7=AB=99=E9=80=9A=E8=AE=AF?= =?UTF-8?q?=E4=B8=AD=E6=96=AD=E5=91=8A=E8=AD=A6=E7=BB=9F=E8=AE=A1=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hzims-service/inspect/pom.xml | 2 +- .../impl/HistoryAbnormalAlarmServiceImpl.java | 65 +++-- .../src/main/resources/log/logback-dev.xml | 127 -------- .../src/main/resources/log/logback-prod.xml | 127 -------- .../src/main/resources/log/logback-test.xml | 127 -------- hzims-service/topvision/topvision.iml | 319 --------------------- 6 files changed, 43 insertions(+), 724 deletions(-) delete mode 100644 hzims-service/operational/src/main/resources/log/logback-dev.xml delete mode 100644 hzims-service/operational/src/main/resources/log/logback-prod.xml delete mode 100644 hzims-service/operational/src/main/resources/log/logback-test.xml delete mode 100644 hzims-service/topvision/topvision.iml diff --git a/hzims-service/inspect/pom.xml b/hzims-service/inspect/pom.xml index 0cd8536..d67566d 100644 --- a/hzims-service/inspect/pom.xml +++ b/hzims-service/inspect/pom.xml @@ -148,7 +148,7 @@ org.springblade blade-starter-oss-minio - 2.7.3.RELEASE + ${bladex.project.version} diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/HistoryAbnormalAlarmServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/HistoryAbnormalAlarmServiceImpl.java index efdc489..d56d5fe 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/HistoryAbnormalAlarmServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/HistoryAbnormalAlarmServiceImpl.java @@ -17,11 +17,12 @@ import net.logstash.logback.encoder.org.apache.commons.lang3.StringUtils; import org.springblade.core.mp.base.BaseServiceImpl; import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.utils.BeanUtil; import org.springblade.core.tool.utils.CollectionUtil; import org.springframework.beans.BeanUtils; -import org.springframework.data.domain.Page; import org.springframework.stereotype.Service; +import java.lang.reflect.Field; import java.math.BigDecimal; import java.util.*; import java.util.stream.Collectors; @@ -38,6 +39,7 @@ public class HistoryAbnormalAlarmServiceImpl extends BaseServiceImpl list(IPage page, String type) { - List stations = stationService.getStationByType(HomePageConstant.HYDROPOWER,HomePageConstant.HYDROPOWER_SERVETYPE); - if(CollectionUtil.isEmpty(stations)){ + List stations = stationService.getStationByType(HomePageConstant.HYDROPOWER, HomePageConstant.HYDROPOWER_SERVETYPE); + if (CollectionUtil.isEmpty(stations)) { return null; } - List result = this.baseMapper.selectPageList(page,type,stations.stream().map(StationEntity::getCode).collect(Collectors.toList())); + List result = this.baseMapper.selectPageList(page, type, stations.stream().map(StationEntity::getCode).collect(Collectors.toList())); page.setRecords(result); return page; } @@ -73,14 +75,16 @@ public class HistoryAbnormalAlarmServiceImpl extends BaseServiceImpl getAlarmTime(Query query, HistoryAbnormalAlarmEntity entity) { - List historyAbnormalAlarmVos= this.baseMapper.getAlarmEntity(entity.getType(),entity.getStationName(),entity.getStartTime(),entity.getEndTime()); - if (historyAbnormalAlarmVos==null){ + QueryWrapper alarmEntityQueryWrapper = getAlarmEntityQueryWrapper(entity); + List historyAbnormalAlarmEntity = this.baseMapper.selectList(alarmEntityQueryWrapper); + if (historyAbnormalAlarmEntity == null) { return null; } + List historyAbnormalAlarmVos = BeanUtil.copy(historyAbnormalAlarmEntity, HistoryAbnormalAlarmVo.class); //赋值空的endTime - if(ObjectUtils.isNotEmpty(entity.getEndTime())){ - historyAbnormalAlarmVos.stream().filter(s->s.getEndTime()==null).forEach(s->s.setEndTime(entity.getEndTime())); - }else { + if (ObjectUtils.isNotEmpty(entity.getEndTime())) { + historyAbnormalAlarmVos.stream().filter(s -> s.getEndTime() == null).forEach(s -> s.setEndTime(entity.getEndTime())); + } else { historyAbnormalAlarmVos.stream().filter(s -> s.getEndTime() == null).forEach(s -> s.setEndTime(new Date())); } List voList = historyAbnormalAlarmVos.parallelStream().map(s -> { @@ -93,8 +97,7 @@ public class HistoryAbnormalAlarmServiceImpl extends BaseServiceImpl durationList = voList.stream().collect(Collectors.groupingBy(HistoryAbnormalAlarmEntity::getStationName, Collectors.summingLong(HistoryAbnormalAlarmVo::getTimes))); - - List res=new ArrayList<>(); + List res = new ArrayList<>(); for (Map.Entry entry : durationList.entrySet()) { //累计时长 double v = BigDecimal.valueOf(entry.getValue() / (1000 * 60 * 60.00)).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); @@ -103,23 +106,23 @@ public class HistoryAbnormalAlarmServiceImpl extends BaseServiceImpl page = Condition.getPage(query); page.setTotal(res.size()); - if (query==null){ + if (entityIsNull(query)) { page.setRecords(res); - }else { - if (res.size()>query.getCurrent()* query.getSize()) { + } else { + if (res.size() > query.getCurrent() * query.getSize()) { page.setRecords(res.subList((query.getCurrent() - 1) * query.getSize(), query.getCurrent() * query.getSize())); - }else { + } else { page.setRecords(res.subList((query.getCurrent() - 1) * query.getSize(), res.size())); } } @@ -129,26 +132,42 @@ public class HistoryAbnormalAlarmServiceImpl extends BaseServiceImpl getAlarmEntityQueryWrapper(HistoryAbnormalAlarmEntity entity) { QueryWrapper queryWrapper = new QueryWrapper<>(); - if (entity.getStationName()!=null) { + if (entity.getStationName() != null) { queryWrapper.lambda().eq(HistoryAbnormalAlarmEntity::getStationName, entity.getStationName()); } - if (entity.getType()!=null) { + if (entity.getType() != null) { queryWrapper.lambda().eq(HistoryAbnormalAlarmEntity::getType, entity.getType()); } - if (entity.getStartTime()!=null) { + if (entity.getStartTime() != null) { queryWrapper.lambda().le(HistoryAbnormalAlarmEntity::getStartTime, entity.getStartTime()); } - if (entity.getEndTime()!=null) { + if (entity.getEndTime() != null) { queryWrapper.lambda().ge(HistoryAbnormalAlarmEntity::getStartTime, entity.getEndTime()); } return queryWrapper; } @Override - public IPage queryByEntity(HistoryAbnormalAlarmEntity entity,Query query) { + public IPage queryByEntity(HistoryAbnormalAlarmEntity entity, Query query) { QueryWrapper alarmEntityQueryWrapper = getAlarmEntityQueryWrapper(entity); IPage historyAbnormalAlarmEntityIPage = this.baseMapper.selectPage(Condition.getPage(query), alarmEntityQueryWrapper); return historyAbnormalAlarmEntityIPage; } + private Boolean entityIsNull(Object object) { + if (null == object) { + return true; + } + try { + for (Field f : object.getClass().getDeclaredFields()) { + f.setAccessible(true); + if (f.get(object) != null && StringUtils.isNotBlank(f.get(object).toString())) { + return false; + } + } + } catch (Exception e) { + e.printStackTrace(); + } + return true; + } } diff --git a/hzims-service/operational/src/main/resources/log/logback-dev.xml b/hzims-service/operational/src/main/resources/log/logback-dev.xml deleted file mode 100644 index c67cdd9..0000000 --- a/hzims-service/operational/src/main/resources/log/logback-dev.xml +++ /dev/null @@ -1,127 +0,0 @@ - - - - - - - - - - - - - - - ${CONSOLE_LOG_PATTERN} - utf8 - - - - - - - - - log/info.log - - - log/info/info-%d{yyyy-MM-dd_HH}.%i.log - - 240 - - 20MB - 10GB - true - - - ${log.pattern} - - - - INFO - ACCEPT - DENY - - - - - - log/error.log - - - log/error/error-%d{yyyy-MM-dd_HH}.%i.log - - 360 - - 20MB - 10GB - true - - - ${log.pattern} - - - - ERROR - ACCEPT - DENY - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/hzims-service/operational/src/main/resources/log/logback-prod.xml b/hzims-service/operational/src/main/resources/log/logback-prod.xml deleted file mode 100644 index 3083e23..0000000 --- a/hzims-service/operational/src/main/resources/log/logback-prod.xml +++ /dev/null @@ -1,127 +0,0 @@ - - - - - - - - - - - - - - - ${CONSOLE_LOG_PATTERN} - utf8 - - - - - - - - - log/info.log - - - log/info/info-%d{yyyy-MM-dd_HH}.%i.log - - 240 - - 20MB - 10GB - true - - - ${log.pattern} - - - - INFO - ACCEPT - DENY - - - - - - log/error.log - - - log/error/error-%d{yyyy-MM-dd_HH}.%i.log - - 360 - - 20MB - 10GB - true - - - ${log.pattern} - - - - ERROR - ACCEPT - DENY - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/hzims-service/operational/src/main/resources/log/logback-test.xml b/hzims-service/operational/src/main/resources/log/logback-test.xml deleted file mode 100644 index fb3de3c..0000000 --- a/hzims-service/operational/src/main/resources/log/logback-test.xml +++ /dev/null @@ -1,127 +0,0 @@ - - - - - - - - - - - - - - - ${CONSOLE_LOG_PATTERN} - utf8 - - - - - - - - - - - log/error.log - - - log/error/error-%d{yyyy-MM-dd_HH}.%i.log - - 360 - - 20MB - 10GB - true - - - ${log.pattern} - - - - ERROR - ACCEPT - DENY - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/hzims-service/topvision/topvision.iml b/hzims-service/topvision/topvision.iml deleted file mode 100644 index 31b330c..0000000 --- a/hzims-service/topvision/topvision.iml +++ /dev/null @@ -1,319 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file