diff --git a/hzims-biz-common/src/main/java/com/hnac/hzims/common/config/RedisMessageConfig.java b/hzims-biz-common/src/main/java/com/hnac/hzims/common/config/RedisMessageConfig.java index 50055b4..6b67249 100644 --- a/hzims-biz-common/src/main/java/com/hnac/hzims/common/config/RedisMessageConfig.java +++ b/hzims-biz-common/src/main/java/com/hnac/hzims/common/config/RedisMessageConfig.java @@ -34,7 +34,7 @@ import java.util.concurrent.atomic.AtomicLong; public class RedisMessageConfig implements ApplicationRunner { /**AtomicLong 可以理解为加了synchronized的long类型**/ - private AtomicLong counter = new AtomicLong(0); + private final AtomicLong counter = new AtomicLong(0); @Autowired private ApplicationContext context; diff --git a/hzims-biz-common/src/main/java/com/hnac/hzims/common/constant/DateConstant.java b/hzims-biz-common/src/main/java/com/hnac/hzims/common/constant/DateConstant.java index d931e9d..c999bb7 100644 --- a/hzims-biz-common/src/main/java/com/hnac/hzims/common/constant/DateConstant.java +++ b/hzims-biz-common/src/main/java/com/hnac/hzims/common/constant/DateConstant.java @@ -11,7 +11,8 @@ import java.util.Optional; */ public interface DateConstant { - @AllArgsConstructor + @Getter + @AllArgsConstructor enum UnitEnum { YEAR("year","年"), MONTH("month","月"), @@ -21,7 +22,6 @@ public interface DateConstant { SECOND("second","秒") ; - @Getter private String unit; @Getter private String describe; diff --git a/hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/annotation/OperationAnnotation.java b/hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/annotation/OperationAnnotation.java index e29ad1e..a16af7b 100644 --- a/hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/annotation/OperationAnnotation.java +++ b/hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/annotation/OperationAnnotation.java @@ -45,7 +45,7 @@ public @interface OperationAnnotation { /** * 是否保存响应的参数 */ - public boolean isSaveResponseData() default true; + boolean isSaveResponseData() default true; /** * 功能说明 diff --git a/hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/aop/SysLogAspect.java b/hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/aop/SysLogAspect.java index b258d29..2c7904f 100644 --- a/hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/aop/SysLogAspect.java +++ b/hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/aop/SysLogAspect.java @@ -172,7 +172,7 @@ public class SysLogAspect { for (StackTraceElement stet : elements) { strbuff.append(stet + "\n"); } - String message = exceptionName + ":" + exceptionMessage + "\n\t" + strbuff.toString(); + String message = exceptionName + ":" + exceptionMessage + "\n\t" + strbuff; return message; } diff --git a/hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/consumer/SysLogConsumer.java b/hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/consumer/SysLogConsumer.java index 83d30b2..1d21c36 100644 --- a/hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/consumer/SysLogConsumer.java +++ b/hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/consumer/SysLogConsumer.java @@ -34,7 +34,7 @@ public class SysLogConsumer implements Runnable { /** * 批次数 */ - private int batchSize = DEFAULT_BATCH_SIZE; + private final int batchSize = DEFAULT_BATCH_SIZE; @Autowired private SysLogFeignService sysLogFeignService; diff --git a/hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/consumer/SysLogQueue.java b/hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/consumer/SysLogQueue.java index 5185582..73cf9c0 100644 --- a/hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/consumer/SysLogQueue.java +++ b/hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/consumer/SysLogQueue.java @@ -20,7 +20,7 @@ public class SysLogQueue { /** * BlockingDequeue为双端阻塞队列,blockingQueue阻塞队列 */ - private BlockingQueue blockingQueue = new LinkedBlockingQueue<>(); + private final BlockingQueue blockingQueue = new LinkedBlockingQueue<>(); /** * 存入数据 diff --git a/hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/enums/BusinessStatus.java b/hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/enums/BusinessStatus.java index 90cfa91..f29b118 100644 --- a/hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/enums/BusinessStatus.java +++ b/hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/enums/BusinessStatus.java @@ -8,6 +8,7 @@ import lombok.Getter; * @author ruoyi * */ +@Getter public enum BusinessStatus { /** @@ -20,11 +21,10 @@ public enum BusinessStatus */ FAIL(1,"执行异常"); - @Getter - private Integer key; + private final Integer key; @Getter - private String value; + private final String value; BusinessStatus(Integer key,String value){ this.key = key; diff --git a/hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/enums/BusinessType.java b/hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/enums/BusinessType.java index 6556577..0f5c790 100644 --- a/hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/enums/BusinessType.java +++ b/hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/enums/BusinessType.java @@ -8,6 +8,7 @@ import lombok.Getter; * * @author ruoyi */ +@Getter public enum BusinessType { /** @@ -60,11 +61,10 @@ public enum BusinessType */ CLEAN("CLEAN","清空数据"); - @Getter - private String key; + private final String key; @Getter - private String value; + private final String value; BusinessType(String key,String value){ this.key = key; diff --git a/hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/enums/OperatorType.java b/hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/enums/OperatorType.java index 6ba76cd..779ae9c 100644 --- a/hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/enums/OperatorType.java +++ b/hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/enums/OperatorType.java @@ -7,6 +7,7 @@ import lombok.Getter; * * @author ruoyi */ +@Getter public enum OperatorType { /** @@ -29,11 +30,10 @@ public enum OperatorType APPSYSTEMS("APPSYSTEMS","app端"); - @Getter - private String key; + private final String key; @Getter - private String value; + private final String value; OperatorType(String key,String value){ diff --git a/hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/text/CharsetKit.java b/hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/text/CharsetKit.java index ca91975..c20213a 100644 --- a/hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/text/CharsetKit.java +++ b/hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/text/CharsetKit.java @@ -21,9 +21,9 @@ public class CharsetKit public static final String GBK = "GBK"; /** ISO-8859-1 */ - public static final Charset CHARSET_ISO_8859_1 = Charset.forName(ISO_8859_1); + public static final Charset CHARSET_ISO_8859_1 = StandardCharsets.ISO_8859_1; /** UTF-8 */ - public static final Charset CHARSET_UTF_8 = Charset.forName(UTF_8); + public static final Charset CHARSET_UTF_8 = StandardCharsets.UTF_8; /** GBK */ public static final Charset CHARSET_GBK = Charset.forName(GBK); diff --git a/hzims-biz-common/src/main/java/com/hnac/hzims/common/support/constants/Order.java b/hzims-biz-common/src/main/java/com/hnac/hzims/common/support/constants/Order.java index 67e68c4..4e914c1 100644 --- a/hzims-biz-common/src/main/java/com/hnac/hzims/common/support/constants/Order.java +++ b/hzims-biz-common/src/main/java/com/hnac/hzims/common/support/constants/Order.java @@ -1,5 +1,5 @@ package com.hnac.hzims.common.support.constants; public enum Order { - ASC,DESC; + ASC,DESC } diff --git a/hzims-biz-common/src/main/java/com/hnac/hzims/common/utils/CacheUtil.java b/hzims-biz-common/src/main/java/com/hnac/hzims/common/utils/CacheUtil.java index 59345a9..a7b2dfb 100644 --- a/hzims-biz-common/src/main/java/com/hnac/hzims/common/utils/CacheUtil.java +++ b/hzims-biz-common/src/main/java/com/hnac/hzims/common/utils/CacheUtil.java @@ -29,11 +29,11 @@ public class CacheUtil { public StringRedisTemplate stringRedisTemplate; /**String 锁**/ - private Lock stringLock = new ReentrantLock(); + private final Lock stringLock = new ReentrantLock(); /**hash 锁**/ - private Lock hashLock = new ReentrantLock(); + private final Lock hashLock = new ReentrantLock(); /**zSet 锁**/ - private Lock zSetLock = new ReentrantLock(); + private final Lock zSetLock = new ReentrantLock(); /** * redis String类型容错机制处理 超出容错机制自动删除 diff --git a/hzims-service-api/assets-api/src/main/java/com/hnac/hzims/AssetsConstants.java b/hzims-service-api/assets-api/src/main/java/com/hnac/hzims/AssetsConstants.java index b96c554..c1572cb 100644 --- a/hzims-service-api/assets-api/src/main/java/com/hnac/hzims/AssetsConstants.java +++ b/hzims-service-api/assets-api/src/main/java/com/hnac/hzims/AssetsConstants.java @@ -5,14 +5,14 @@ import lombok.Getter; public class AssetsConstants { public final static String APP_NAME = "hzims-assets"; - public enum TaskTypeEnum{ + @Getter + public enum TaskTypeEnum{ MANUAL("1","手动"), AUTO("2","自动") ; + private final String type; @Getter - private String type; - @Getter - private String describe; + private final String describe; TaskTypeEnum(String type, String describe) { @@ -24,7 +24,8 @@ public class AssetsConstants { /** * 周期类型 */ - public enum CycleTypeEnum { + @Getter + public enum CycleTypeEnum { /** * 秒 */ @@ -53,11 +54,10 @@ public class AssetsConstants { * 年 */ YEAR_CYCLE(6,"年"); + private final int type; @Getter - private int type; - @Getter - private String name; - private CycleTypeEnum(int type,String name){ + private final String name; + CycleTypeEnum(int type, String name){ this.type = type; this.name = name; } @@ -67,7 +67,8 @@ public class AssetsConstants { /** * 取数规则 */ - public enum AccessRulesEnum { + @Getter + public enum AccessRulesEnum { /** * 最早值 */ @@ -96,11 +97,10 @@ public class AssetsConstants { * 最后值 */ FINAL_CYCLE(6,"最后值"); + private final int type; @Getter - private int type; - @Getter - private String name; - private AccessRulesEnum(int type,String name){ + private final String name; + AccessRulesEnum(int type, String name){ this.type = type; this.name = name; } @@ -110,17 +110,17 @@ public class AssetsConstants { /** * 装机容量 */ - public enum MainEnum { + @Getter + public enum MainEnum { /** * 装机容量 */ INSTALLED_CAPACITY("installedCapacity","装机容量"); + private final String val; @Getter - private String val; - @Getter - private String name; - private MainEnum(String val,String name){ + private final String name; + MainEnum(String val, String name){ this.val = val; this.name = name; } @@ -129,17 +129,17 @@ public class AssetsConstants { /** * 运行状态 */ - public enum RunStatus { + @Getter + public enum RunStatus { run("1","运行中"), spare("2","热备用"), access("0","检修"), ; + private final String status; @Getter - private String status; - @Getter - private String des; + private final String des; - private RunStatus(String status, String des) { + RunStatus(String status, String des) { this.status = status; this.des = des; } @@ -149,7 +149,8 @@ public class AssetsConstants { /** * 装机容量 */ - public enum SignageEnum { + @Getter + public enum SignageEnum { /** * 发电标识 */ @@ -163,11 +164,10 @@ public class AssetsConstants { */ JOINT_RELAY_SIGNAGE_SIGNAGE("joint_relay","合位继电器"); + private final String val; @Getter - private String val; - @Getter - private String name; - private SignageEnum(String val,String name){ + private final String name; + SignageEnum(String val, String name){ this.val = val; this.name = name; } diff --git a/hzims-service-api/assets-api/src/main/java/com/hnac/hzims/spare/constants/AssetsConstant.java b/hzims-service-api/assets-api/src/main/java/com/hnac/hzims/spare/constants/AssetsConstant.java index f979d36..ed0a3fd 100644 --- a/hzims-service-api/assets-api/src/main/java/com/hnac/hzims/spare/constants/AssetsConstant.java +++ b/hzims-service-api/assets-api/src/main/java/com/hnac/hzims/spare/constants/AssetsConstant.java @@ -11,33 +11,33 @@ public interface AssetsConstant { /** * 工单记录生成使用系统名称 */ - final String TICKET_SYSTEM_USE_NAME = "系统"; + String TICKET_SYSTEM_USE_NAME = "系统"; /** * 工单记录生成使用系统名称 */ - final BigDecimal TICKET_INITIAL_COEFFICIENT = new BigDecimal("1.0"); + BigDecimal TICKET_INITIAL_COEFFICIENT = new BigDecimal("1.0"); /** * 常量1 */ - final String TICKET_ONE = "1"; + String TICKET_ONE = "1"; /** * 常量2 */ - final String TICKET_ZRE = "0"; + String TICKET_ZRE = "0"; /** * 常量4 */ - final String TICKET_FOR = "4"; + String TICKET_FOR = "4"; /** * 常量 */ - final String YES = "YES"; + String YES = "YES"; /** * 工单数量缓存 */ - final String TICKET_DAY_NUM = "hzims:assets"; + String TICKET_DAY_NUM = "hzims:assets"; } diff --git a/hzims-service-api/assets-api/src/main/java/com/hnac/hzims/spare/enume/BusinessType.java b/hzims-service-api/assets-api/src/main/java/com/hnac/hzims/spare/enume/BusinessType.java index 2d29921..3d241ea 100644 --- a/hzims-service-api/assets-api/src/main/java/com/hnac/hzims/spare/enume/BusinessType.java +++ b/hzims-service-api/assets-api/src/main/java/com/hnac/hzims/spare/enume/BusinessType.java @@ -1,26 +1,21 @@ package com.hnac.hzims.spare.enume; +import lombok.Getter; + /** * 单据类型 */ +@Getter public enum BusinessType { IN(1, "入库"), OUT(2, "出库"), ALLOT(3, "调拨"), RECEIVE(4, "领用"), RETURNED(5, "归还"),RETURN(6,"退回"); private int type; private String name; - public int getType() { - return type; - } - public void setType(int type) { this.type = type; } - public String getName() { - return name; - } - public void setName(String name) { this.name = name; } diff --git a/hzims-service-api/assets-api/src/main/java/com/hnac/hzims/spare/enume/WarehouseInType.java b/hzims-service-api/assets-api/src/main/java/com/hnac/hzims/spare/enume/WarehouseInType.java index 363663d..5999e6e 100644 --- a/hzims-service-api/assets-api/src/main/java/com/hnac/hzims/spare/enume/WarehouseInType.java +++ b/hzims-service-api/assets-api/src/main/java/com/hnac/hzims/spare/enume/WarehouseInType.java @@ -1,26 +1,21 @@ package com.hnac.hzims.spare.enume; +import lombok.Getter; + /** * 入库类型 */ +@Getter public enum WarehouseInType { BUY(1,"购买入库"),BACK(2,"退回入库"),ALLOT(3,"调拨入库"),OLD(4,"旧品入库"); private int type; private String name; - public int getType() { - return type; - } - public void setType(int type) { this.type = type; } - public String getName() { - return name; - } - public void setName(String name) { this.name = name; } diff --git a/hzims-service-api/assets-api/src/main/java/com/hnac/hzims/spare/enume/WarehouseOutType.java b/hzims-service-api/assets-api/src/main/java/com/hnac/hzims/spare/enume/WarehouseOutType.java index 09a4ce3..3ec0f70 100644 --- a/hzims-service-api/assets-api/src/main/java/com/hnac/hzims/spare/enume/WarehouseOutType.java +++ b/hzims-service-api/assets-api/src/main/java/com/hnac/hzims/spare/enume/WarehouseOutType.java @@ -1,26 +1,21 @@ package com.hnac.hzims.spare.enume; +import lombok.Getter; + /** * 出库类型 */ +@Getter public enum WarehouseOutType { MAINTENANCE(1,"维保出库"),REPAIR(2,"维修出库"),ALLOT(3,"调拨出库"),OTHER(4,"其他"); private int type; private String name; - public int getType() { - return type; - } - public void setType(int type) { this.type = type; } - public String getName() { - return name; - } - public void setName(String name) { this.name = name; } diff --git a/hzims-service-api/common-api/src/main/java/com/hnac/hzims/cache/CaffeineCacheUtil.java b/hzims-service-api/common-api/src/main/java/com/hnac/hzims/cache/CaffeineCacheUtil.java index 06b1e18..6157064 100644 --- a/hzims-service-api/common-api/src/main/java/com/hnac/hzims/cache/CaffeineCacheUtil.java +++ b/hzims-service-api/common-api/src/main/java/com/hnac/hzims/cache/CaffeineCacheUtil.java @@ -13,7 +13,7 @@ import java.util.concurrent.TimeUnit; public class CaffeineCacheUtil { //创建guava cache - private static Cache loadingCache = Caffeine.newBuilder() + private static final Cache loadingCache = Caffeine.newBuilder() //cache的初始容量 .initialCapacity(5) //cache最大缓存数 @@ -24,7 +24,7 @@ public class CaffeineCacheUtil { //.expireAfterAccess(17, TimeUnit.SECONDS) .build(); - private static Cache loadingYearCache = Caffeine.newBuilder() + private static final Cache loadingYearCache = Caffeine.newBuilder() //cache的初始容量 .initialCapacity(5) //cache最大缓存数 @@ -35,7 +35,7 @@ public class CaffeineCacheUtil { //.expireAfterAccess(17, TimeUnit.SECONDS) .build(); - private static Cache>> loadingMapCache = Caffeine.newBuilder() + private static final Cache>> loadingMapCache = Caffeine.newBuilder() //cache的初始容量 .initialCapacity(5) //cache最大缓存数 diff --git a/hzims-service-api/common-api/src/main/java/com/hnac/hzims/entity/Report.java b/hzims-service-api/common-api/src/main/java/com/hnac/hzims/entity/Report.java index 7925b1c..fd61a1d 100644 --- a/hzims-service-api/common-api/src/main/java/com/hnac/hzims/entity/Report.java +++ b/hzims-service-api/common-api/src/main/java/com/hnac/hzims/entity/Report.java @@ -2,6 +2,7 @@ package com.hnac.hzims.entity; import com.hnac.hzims.enums.QueryDateTypeEnum; import com.hnac.hzims.util.ReportDateUtil; +import lombok.Getter; import org.apache.commons.lang3.builder.ToStringBuilder; import java.text.SimpleDateFormat; @@ -14,6 +15,7 @@ import java.util.*; * @Author: liugang * @Date: 2019/7/8 15:03 */ +@Getter public class Report { /** @@ -241,26 +243,14 @@ public class Report { } } - public List> getTitle() { - return title; - } - public void setTitle(List> title) { this.title = title; } - public List getData() { - return data; - } - public void setData(List data) { this.data = data; } - public List getStandardData() { - return standardData; - } - public void setStandardData(List standardData) { this.standardData = standardData; } diff --git a/hzims-service-api/common-api/src/main/java/com/hnac/hzims/entity/ReportData.java b/hzims-service-api/common-api/src/main/java/com/hnac/hzims/entity/ReportData.java index bfde3a8..3cdafba 100644 --- a/hzims-service-api/common-api/src/main/java/com/hnac/hzims/entity/ReportData.java +++ b/hzims-service-api/common-api/src/main/java/com/hnac/hzims/entity/ReportData.java @@ -1,5 +1,7 @@ package com.hnac.hzims.entity; +import lombok.Getter; + /** * 封装一个key,value键值对象 * 可能是数据库返回查询数据 @@ -11,50 +13,41 @@ package com.hnac.hzims.entity; */ public class ReportData { + @Getter private String keyStr; + @Getter private String keyDate; + @Getter private String val; //测站 或 属性 + @Getter private String stcd; //属性名 + @Getter private String name; private Double value; + @Getter private int month=-1; + @Getter private String day; - public String getDay() { - return day; - } - public void setDay(String day) { this.day = day; } - public int getMonth() { - return month; - } - public void setMonth(int month) { this.month = month; } - public String getName() { - return name; - } - public void setName(String name) { this.name = name; } - public String getStcd() { - return stcd; - } - public void setStcd(String stcd) { this.stcd = stcd; } @@ -62,10 +55,6 @@ public class ReportData { public ReportData() { } - public String getKeyDate() { - return keyDate; - } - public void setKeyDate(String keyDate) { this.keyDate = keyDate; } @@ -75,18 +64,10 @@ public class ReportData { this.val = val; } - public String getKeyStr() { - return keyStr; - } - public void setKeyStr(String keyStr) { this.keyStr = keyStr; } - public String getVal() { - return val; - } - public void setVal(String val) { this.val = val; } diff --git a/hzims-service-api/common-api/src/main/java/com/hnac/hzims/entity/ReportUnit.java b/hzims-service-api/common-api/src/main/java/com/hnac/hzims/entity/ReportUnit.java index deac24c..fd8bac2 100644 --- a/hzims-service-api/common-api/src/main/java/com/hnac/hzims/entity/ReportUnit.java +++ b/hzims-service-api/common-api/src/main/java/com/hnac/hzims/entity/ReportUnit.java @@ -1,8 +1,11 @@ package com.hnac.hzims.entity; +import lombok.Getter; + import java.util.ArrayList; import java.util.List; +@Getter public class ReportUnit { private String key; @@ -16,18 +19,10 @@ public class ReportUnit { } } - public String getKey() { - return key; - } - public void setKey(String key) { this.key = key; } - public List getDataList() { - return dataList; - } - public void setDataList(List dataList) { this.dataList = dataList; } diff --git a/hzims-service-api/common-api/src/main/java/com/hnac/hzims/entity/StandardData.java b/hzims-service-api/common-api/src/main/java/com/hnac/hzims/entity/StandardData.java index 01ac0bb..c6f3f6e 100644 --- a/hzims-service-api/common-api/src/main/java/com/hnac/hzims/entity/StandardData.java +++ b/hzims-service-api/common-api/src/main/java/com/hnac/hzims/entity/StandardData.java @@ -1,10 +1,12 @@ package com.hnac.hzims.entity; +import lombok.Getter; import org.apache.commons.lang3.StringUtils; import java.math.BigDecimal; import java.util.Objects; +@Getter public class StandardData { public static final String STANDARD_AVG = "时刻平均值"; public static final String STANDARD_MAX = "时刻最大值"; @@ -116,58 +118,30 @@ public class StandardData { } } - public String getDataAvg() { - return dataAvg; - } - public void setDataAvg(String dataAvg) { this.dataAvg = dataAvg; } - public String getDataMax() { - return dataMax; - } - public void setDataMax(String dataMax) { this.dataMax = dataMax; } - public String getDataMaxDate() { - return dataMaxDate; - } - public void setDataMaxDate(String dataMaxDate) { this.dataMaxDate = dataMaxDate; } - public String getDataMin() { - return dataMin; - } - public void setDataMin(String dataMin) { this.dataMin = dataMin; } - public String getDataMinDate() { - return dataMinDate; - } - public void setDataMinDate(String dataMinDate) { this.dataMinDate = dataMinDate; } - public String getAmplitude() { - return amplitude; - } - public void setAmplitude(String amplitude) { this.amplitude = amplitude; } - public String getDataSum() { - return dataSum; - } - public void setDataSum(String dataSum) { this.dataSum = dataSum; } diff --git a/hzims-service-api/common-api/src/main/java/com/hnac/hzims/entity/YearReport.java b/hzims-service-api/common-api/src/main/java/com/hnac/hzims/entity/YearReport.java index a601e1d..a261834 100644 --- a/hzims-service-api/common-api/src/main/java/com/hnac/hzims/entity/YearReport.java +++ b/hzims-service-api/common-api/src/main/java/com/hnac/hzims/entity/YearReport.java @@ -3,12 +3,14 @@ package com.hnac.hzims.entity; import com.hnac.hzims.util.ReportDateUtil; +import lombok.Getter; import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import java.util.Objects; +@Getter public class YearReport { private static final int MAX_DAY = 31; @@ -136,42 +138,22 @@ public class YearReport { return temp; } - public int getYear() { - return year; - } - public void setYear(int year) { this.year = year; } - public String getStcd() { - return stcd; - } - public void setStcd(String stcd) { this.stcd = stcd; } - public List> getDayList() { - return dayList; - } - public void setDayList(List> dayList) { this.dayList = dayList; } - public List getMonthList() { - return monthList; - } - public void setMonthList(List monthList) { this.monthList = monthList; } - public List getYearList() { - return yearList; - } - public void setYearList(List yearList) { this.yearList = yearList; } diff --git a/hzims-service-api/common-api/src/main/java/com/hnac/hzims/enums/QueryDateTypeEnum.java b/hzims-service-api/common-api/src/main/java/com/hnac/hzims/enums/QueryDateTypeEnum.java index da64139..88fef7f 100644 --- a/hzims-service-api/common-api/src/main/java/com/hnac/hzims/enums/QueryDateTypeEnum.java +++ b/hzims-service-api/common-api/src/main/java/com/hnac/hzims/enums/QueryDateTypeEnum.java @@ -1,5 +1,8 @@ package com.hnac.hzims.enums; +import lombok.Getter; + +@Getter public enum QueryDateTypeEnum { //时 HOUR("hour"), @@ -25,10 +28,6 @@ public enum QueryDateTypeEnum { return null; } - public String getQueryDateType() { - return queryDateType; - } - public void setQueryDateType(String queryDateType) { this.queryDateType = queryDateType; } diff --git a/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/EquipmentConstants.java b/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/EquipmentConstants.java index 03f3ac7..dbb4246 100644 --- a/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/EquipmentConstants.java +++ b/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/EquipmentConstants.java @@ -6,14 +6,14 @@ import lombok.Getter; public class EquipmentConstants { public final static String APP_NAME = "hzims-equipment"; - public enum TaskTypeEnum{ + @Getter + public enum TaskTypeEnum{ MANUAL("1","手动"), AUTO("2","自动") ; + private final String type; @Getter - private String type; - @Getter - private String describe; + private final String describe; TaskTypeEnum(String type, String describe) { @@ -25,7 +25,8 @@ public class EquipmentConstants { /** * 周期类型 */ - public enum CycleTypeEnum { + @Getter + public enum CycleTypeEnum { /** * 秒 */ @@ -54,11 +55,10 @@ public class EquipmentConstants { * 年 */ YEAR_CYCLE(6,"年"); + private final int type; @Getter - private int type; - @Getter - private String name; - private CycleTypeEnum(int type,String name){ + private final String name; + CycleTypeEnum(int type, String name){ this.type = type; this.name = name; } @@ -68,7 +68,8 @@ public class EquipmentConstants { /** * 取数规则 */ - public enum AccessRulesEnum { + @Getter + public enum AccessRulesEnum { /** * 最早值 */ @@ -97,11 +98,10 @@ public class EquipmentConstants { * 最后值 */ FINAL_CYCLE(6,"最后值"); + private final int type; @Getter - private int type; - @Getter - private String name; - private AccessRulesEnum(int type,String name){ + private final String name; + AccessRulesEnum(int type, String name){ this.type = type; this.name = name; } @@ -111,17 +111,17 @@ public class EquipmentConstants { /** * 装机容量 */ - public enum MainEnum { + @Getter + public enum MainEnum { /** * 装机容量 */ INSTALLED_CAPACITY("installedCapacity","装机容量"); + private final String val; @Getter - private String val; - @Getter - private String name; - private MainEnum(String val,String name){ + private final String name; + MainEnum(String val, String name){ this.val = val; this.name = name; } @@ -130,17 +130,17 @@ public class EquipmentConstants { /** * 运行状态 */ - public enum RunStatus { + @Getter + public enum RunStatus { run("1","正常"), spare("2","备用"), access("0","检修"), ; + private final String status; @Getter - private String status; - @Getter - private String des; + private final String des; - private RunStatus(String status, String des) { + RunStatus(String status, String des) { this.status = status; this.des = des; } @@ -149,16 +149,16 @@ public class EquipmentConstants { /** * 运行状态 */ - public enum ActivateStatusEnum { + @Getter + public enum ActivateStatusEnum { stop(0,"停用"), start(1,"启用") ; + private final Integer status; @Getter - private Integer status; - @Getter - private String des; + private final String des; - private ActivateStatusEnum(Integer status, String des) { + ActivateStatusEnum(Integer status, String des) { this.status = status; this.des = des; } @@ -168,7 +168,8 @@ public class EquipmentConstants { /** * 装机容量 */ - public enum SignageEnum { + @Getter + public enum SignageEnum { /** * 发电标识 */ @@ -182,11 +183,10 @@ public class EquipmentConstants { */ JOINT_RELAY_SIGNAGE_SIGNAGE("joint_relay","合位继电器"); + private final String val; @Getter - private String val; - @Getter - private String name; - private SignageEnum(String val,String name){ + private final String name; + SignageEnum(String val, String name){ this.val = val; this.name = name; } diff --git a/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/constants/MonitorConstants.java b/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/constants/MonitorConstants.java index 4cf8b71..78b41a4 100644 --- a/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/constants/MonitorConstants.java +++ b/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/constants/MonitorConstants.java @@ -20,7 +20,8 @@ public interface MonitorConstants { /**未绑定**/ String BANDING_STATUS_3 = "3"; - @AllArgsConstructor + @Getter + @AllArgsConstructor enum TimeUnitEnum { /**时**/ HOURS("hr", 2, ChronoUnit.HOURS), @@ -29,7 +30,6 @@ public interface MonitorConstants { /**秒**/ SECOND("sec", 0, ChronoUnit.SECONDS), ; - @Getter private String fdpTimeUnit; @Getter @@ -46,7 +46,8 @@ public interface MonitorConstants { } - @AllArgsConstructor + @Getter + @AllArgsConstructor enum TimeTypeEnum { /**采样时刻点的实际值**/ CURRENT("current",6,"采样时刻点的实际值"), @@ -59,7 +60,6 @@ public interface MonitorConstants { /**采样间隔内的所有值的累加**/ SUM("sum",4,"采样间隔内的所有值的累加"), ; - @Getter private String mode; @Getter private Integer timeType; @@ -72,7 +72,8 @@ public interface MonitorConstants { } } - @AllArgsConstructor + @Getter + @AllArgsConstructor enum DataTypeEnum { /**布尔值(单点)**/ BOOLEAN("bool[]"), @@ -83,7 +84,6 @@ public interface MonitorConstants { /**浮点值(多点)**/ FLOAT_ARRAY("float[][]") ; - @Getter private String type; public static DataTypeEnum getDataTypeEnumByType(String type) { diff --git a/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/equipment/entity/EmTreeNode.java b/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/equipment/entity/EmTreeNode.java index 4eceb6c..b734933 100644 --- a/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/equipment/entity/EmTreeNode.java +++ b/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/equipment/entity/EmTreeNode.java @@ -1,9 +1,12 @@ package com.hnac.hzims.equipment.entity; +import lombok.Getter; + import java.io.Serializable; import java.util.List; +@Getter public class EmTreeNode implements Serializable { private Object id; private Object parentId; @@ -11,42 +14,22 @@ public class EmTreeNode implements Serializable { private Integer level; private List children; - public Object getId() { - return id; - } - public void setId(Object id) { this.id = id; } - public Object getParentId() { - return parentId; - } - - public void setParentId(Object parentId) { + public void setParentId(Object parentId) { this.parentId = parentId; } - public String getTitle() { - return title; - } - - public void setTitle(String title) { + public void setTitle(String title) { this.title = title; } - public Integer getLevel() { - return level; - } - - public void setLevel(Integer level) { + public void setLevel(Integer level) { this.level = level; } - public List getChildren() { - return children; - } - public void setChildren(List children) { this.children = children;} diff --git a/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/fdp/constants/FdpConstant.java b/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/fdp/constants/FdpConstant.java index e9cb527..bedde15 100644 --- a/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/fdp/constants/FdpConstant.java +++ b/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/fdp/constants/FdpConstant.java @@ -16,7 +16,8 @@ public interface FdpConstant { String SET_DEVICE_TYPE = "2"; /**-----------------------------------------------------------------------------------------**/ - enum FdpTaskStatusEnum{ + @Getter + enum FdpTaskStatusEnum{ /** * 未开始 */ @@ -30,10 +31,9 @@ public interface FdpConstant { */ FINISH_STATUS(3,"已完成"); + private final int status; @Getter - private int status; - @Getter - private String msg; + private final String msg; FdpTaskStatusEnum(int status,String msg){ this.status = status; diff --git a/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/fdp/enums/ReadDataTypes.java b/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/fdp/enums/ReadDataTypes.java index e475da2..0a8d2d8 100644 --- a/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/fdp/enums/ReadDataTypes.java +++ b/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/fdp/enums/ReadDataTypes.java @@ -3,11 +3,11 @@ package com.hnac.hzims.fdp.enums; public class ReadDataTypes { - public static enum EYxTpye { + public enum EYxTpye { yxOneBit, yxTwoBit; - private EYxTpye() { + EYxTpye() { } } diff --git a/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/fdp/util/HttpRequestUtil.java b/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/fdp/util/HttpRequestUtil.java index 3ceba04..6b10a50 100644 --- a/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/fdp/util/HttpRequestUtil.java +++ b/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/fdp/util/HttpRequestUtil.java @@ -6,6 +6,7 @@ import lombok.extern.slf4j.Slf4j; import java.io.*; import java.net.HttpURLConnection; import java.net.URL; +import java.nio.charset.StandardCharsets; import java.util.Map; @Slf4j public class HttpRequestUtil { @@ -36,7 +37,7 @@ public class HttpRequestUtil { * 下面的三句代码,就是调用第三方http接口 */ //获取URLConnection对象对应的输出流 - out = new OutputStreamWriter(conn.getOutputStream(), "UTF-8"); + out = new OutputStreamWriter(conn.getOutputStream(), StandardCharsets.UTF_8); //发送请求参数即数据 out.write(JSON.toJSONString(param)); //flush输出流的缓冲 @@ -103,7 +104,7 @@ public class HttpRequestUtil { * 下面的三句代码,就是调用第三方http接口 */ //获取URLConnection对象对应的输出流 - out = new OutputStreamWriter(conn.getOutputStream(), "UTF-8"); + out = new OutputStreamWriter(conn.getOutputStream(), StandardCharsets.UTF_8); //发送请求参数即数据 out.write(JSON.toJSONString(param)); //flush输出流的缓冲 diff --git a/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/fdp/vo/YxRValueVo.java b/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/fdp/vo/YxRValueVo.java index dfa66b9..dc6008d 100644 --- a/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/fdp/vo/YxRValueVo.java +++ b/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/fdp/vo/YxRValueVo.java @@ -1,9 +1,11 @@ package com.hnac.hzims.fdp.vo; import com.hnac.hzims.fdp.enums.ReadDataTypes; +import lombok.Getter; import java.util.Date; +@Getter public class YxRValueVo { public byte Value; public short q; @@ -14,27 +16,15 @@ public class YxRValueVo { public YxRValueVo() { } - public byte getValue() { - return this.Value; - } - - public void setValue(byte value) { + public void setValue(byte value) { this.Value = value; } - public short getQ() { - return this.q; - } - - public void setQ(short q) { + public void setQ(short q) { this.q = q; } - public Date getTime() { - return this.Time; - } - - public void setTime(Date time) { + public void setTime(Date time) { this.Time = time; } } 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 ca1ca54..bf4d2ec 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 @@ -1,34 +1,27 @@ package com.hnac.hzims.monitor.entity; +import lombok.Getter; + import java.util.Date; public class HisDataYc { - private double val; - private Date datatime; - private int q; + @Getter + private double val; + @Getter + private Date datatime; + @Getter + private int q; private int _msec; - public double getVal() { - return val; - } - - public void setVal(double val) { + public void setVal(double val) { this.val = val; } - public Date getDatatime() { - return datatime; - } - - public void setDatatime(Date datatime) { + public void setDatatime(Date datatime) { this.datatime = datatime; } - public int getQ() { - return q; - } - - public void setQ(int q) { + public void setQ(int q) { this.q = q; } @@ -61,14 +54,9 @@ public class HisDataYc { } HisDataYc other = (HisDataYc) obj; if (datatime == null) { - if (other.datatime != null) { - return false; - } - } else if (!datatime.equals(other.datatime)) { - return false; - } - return true; - } + return other.datatime == null; + } else return datatime.equals(other.datatime); + } @Override public String toString() { diff --git a/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/monitor/entity/HisDataYx.java b/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/monitor/entity/HisDataYx.java index 75dde16..d5f4ae2 100644 --- a/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/monitor/entity/HisDataYx.java +++ b/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/monitor/entity/HisDataYx.java @@ -1,20 +1,19 @@ package com.hnac.hzims.monitor.entity; +import lombok.Getter; + import java.util.Date; +@Getter public class HisDataYx { private int val; private Date datatime; - public int getVal() { - return val; - } - public void setVal(int val) { + + public void setVal(int val) { this.val = val; } - public Date getDatatime() { - return datatime; - } - public void setDatatime(Date datatime) { + + public void setDatatime(Date datatime) { this.datatime = datatime; } @Override diff --git a/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/monitor/utils/DataGridModel.java b/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/monitor/utils/DataGridModel.java index ad7560e..2eaffc3 100644 --- a/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/monitor/utils/DataGridModel.java +++ b/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/monitor/utils/DataGridModel.java @@ -1,9 +1,12 @@ package com.hnac.hzims.monitor.utils; +import lombok.Getter; + import java.io.Serializable; import java.util.List; +@Getter public class DataGridModel implements Serializable { private static final long serialVersionUID = 8591890308861767849L; private long total = 0L; @@ -13,27 +16,15 @@ public class DataGridModel implements Serializable { public DataGridModel() { } - public List getFooter() { - return this.footer; - } - - public void setFooter(List footer) { + public void setFooter(List footer) { this.footer = footer; } - public long getTotal() { - return this.total; - } - - public void setTotal(long total) { + public void setTotal(long total) { this.total = total; } - public List getRows() { - return this.rows; - } - - public void setRows(List rows) { + public void setRows(List rows) { this.rows = rows; } } diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/OperationalConstants.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/OperationalConstants.java index 145e762..2a49f48 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/OperationalConstants.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/OperationalConstants.java @@ -12,7 +12,8 @@ public class OperationalConstants { /** * 交接班类型 */ - public enum DutyRecTypeEnum { + @Getter + public enum DutyRecTypeEnum { /** * 交班 */ @@ -22,12 +23,11 @@ public class OperationalConstants { */ CARRY_REC(2, "接班"); + private final int val; @Getter - private int val; - @Getter - private String name; + private final String name; - private DutyRecTypeEnum(int val, String name) { + DutyRecTypeEnum(int val, String name) { this.val = val; this.name = name; } @@ -36,7 +36,8 @@ public class OperationalConstants { /** * 交接班类型 */ - public enum MessageRecTypeEnum { + @Getter + public enum MessageRecTypeEnum { /** * 提前 15 分钟 提醒交班 */ @@ -49,12 +50,11 @@ public class OperationalConstants { DELAYED_HAND_REC_MESSAGE(1, "延时交班提醒"), //最迟延迟交班提醒 DELAYED_HAND_REC_MESSAGE_LAST(15, "延时交班提醒"); + private final int val; @Getter - private int val; - @Getter - private String name; + private final String name; - private MessageRecTypeEnum(int val, String name) { + MessageRecTypeEnum(int val, String name) { this.val = val; this.name = name; } @@ -63,7 +63,8 @@ public class OperationalConstants { /** * 消息业务分类 */ - public enum MessageClassifyEnum { + @Getter + public enum MessageClassifyEnum { /** * 系统通知 */ @@ -85,12 +86,11 @@ public class OperationalConstants { */ MESSAGE_CNONE("none", "无"); + private final String val; @Getter - private String val; - @Getter - private String name; + private final String name; - private MessageClassifyEnum(String val, String name) { + MessageClassifyEnum(String val, String name) { this.val = val; this.name = name; } @@ -100,7 +100,8 @@ public class OperationalConstants { /** * 交接班类型 */ - public enum RecTypeEnum { + @Getter + public enum RecTypeEnum { /** * 交班提醒 */ @@ -114,12 +115,11 @@ public class OperationalConstants { */ REMIND_HAND_PERSON(3, "提醒交班人交班"); + private final int val; @Getter - private int val; - @Getter - private String name; + private final String name; - private RecTypeEnum(int val, String name) { + RecTypeEnum(int val, String name) { this.val = val; this.name = name; } @@ -129,7 +129,8 @@ public class OperationalConstants { /** * 工作流状态 */ - public enum ProcessStatusEnum { + @Getter + public enum ProcessStatusEnum { /** * 默认 */ @@ -142,12 +143,11 @@ public class OperationalConstants { * 提醒交班人交班 */ COMPLETED_PROCESS_STATUS(2, "已完成"); + private final int val; @Getter - private int val; - @Getter - private String name; + private final String name; - private ProcessStatusEnum(int val, String name) { + ProcessStatusEnum(int val, String name) { this.val = val; this.name = name; } @@ -156,7 +156,8 @@ public class OperationalConstants { /** * 数据类型 */ - public enum UserDataScopeTypeEnum { + @Getter + public enum UserDataScopeTypeEnum { /** * 只看自己 */ @@ -181,12 +182,11 @@ public class OperationalConstants { * 全部可见 */ SELT_SUBORDINATE_BODY("5", "个人及下属机构"); + private final String val; @Getter - private String val; - @Getter - private String name; + private final String name; - private UserDataScopeTypeEnum(String val, String name) { + UserDataScopeTypeEnum(String val, String name) { this.val = val; this.name = name; } @@ -196,7 +196,8 @@ public class OperationalConstants { /** * 站点类型 */ - public enum StationTypeEnum { + @Getter + public enum StationTypeEnum { /** * 水电站 */ @@ -221,12 +222,11 @@ public class OperationalConstants { * 闸门 */ GATE_STATION("6", "闸门"); + private final String val; @Getter - private String val; - @Getter - private String name; + private final String name; - private StationTypeEnum(String val, String name) { + StationTypeEnum(String val, String name) { this.val = val; this.name = name; } @@ -236,7 +236,8 @@ public class OperationalConstants { /** * 所属行业 */ - public enum TradeEnum { + @Getter + public enum TradeEnum { /** * 水电站 */ @@ -245,12 +246,11 @@ public class OperationalConstants { * 风电 */ WATER_AFFAIRS_INDUSTRY("2", "水务行业"); + private final String val; @Getter - private String val; - @Getter - private String name; + private final String name; - private TradeEnum(String val, String name) { + TradeEnum(String val, String name) { this.val = val; this.name = name; } @@ -260,7 +260,8 @@ public class OperationalConstants { /** * 站点类型 */ - public enum StationQuantityEnum { + @Getter + public enum StationQuantityEnum { /** * 水电站 */ @@ -277,12 +278,11 @@ public class OperationalConstants { * 泵站 */ WHOLE("4", "整"); + private final String val; @Getter - private String val; - @Getter - private String name; + private final String name; - private StationQuantityEnum(String val, String name) { + StationQuantityEnum(String val, String name) { this.val = val; this.name = name; } @@ -291,7 +291,8 @@ public class OperationalConstants { /** * 行业类型 */ - public enum InDustryEnum { + @Getter + public enum InDustryEnum { /** * 系统 */ @@ -308,12 +309,11 @@ public class OperationalConstants { * 单个站点类型 */ SINGLE_STATION_TYPE("4", "单个站点类型"); + private final String val; @Getter - private String val; - @Getter - private String name; + private final String name; - private InDustryEnum(String val, String name) { + InDustryEnum(String val, String name) { this.val = val; this.name = name; } @@ -323,7 +323,8 @@ public class OperationalConstants { /** * 首页分类 */ - public enum FirstPageTypeEnum { + @Getter + public enum FirstPageTypeEnum { /** * 系统 */ @@ -335,12 +336,11 @@ public class OperationalConstants { STATION("3", "站点数据总览"), TOW("4", "两站数据总览"), ONE("5", "单站数据总览"); + private final String val; @Getter - private String val; - @Getter - private String name; + private final String name; - private FirstPageTypeEnum(String val, String name) { + FirstPageTypeEnum(String val, String name) { this.val = val; this.name = name; } @@ -350,7 +350,8 @@ public class OperationalConstants { /** * 行业站点类型 */ - public enum BusinessStationTypeEnum { + @Getter + public enum BusinessStationTypeEnum { /** * 行业 */ @@ -363,17 +364,17 @@ public class OperationalConstants { * 单个站点分类 */ SINGLE_STATION_TYPE("3", "单个站点分类"); + private final String val; @Getter - private String val; - @Getter - private String name; + private final String name; - private BusinessStationTypeEnum(String val, String name) { + BusinessStationTypeEnum(String val, String name) { this.val = val; this.name = name; } } - public enum DutyLogLevel { + @Getter + public enum DutyLogLevel { /** * 水电站 */ @@ -386,12 +387,11 @@ public class OperationalConstants { /** * 泵站 */ + private final String val; @Getter - private String val; - @Getter - private String name; + private final String name; - private DutyLogLevel(String val, String name) { + DutyLogLevel(String val, String name) { this.val = val; this.name = name; } diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/constants/AccessConstants.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/constants/AccessConstants.java index 1bc8278..f96e746 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/constants/AccessConstants.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/constants/AccessConstants.java @@ -73,6 +73,7 @@ public interface AccessConstants { String MESSAGE_BUSINESS_CLASSIFY = "access";//消息推送检修类型 String MESSAGE_ACCESS_TYPE = "7";//消息推送检修 + @Getter enum AccessProcessEnum{ ACCESS_CHARGE_APPROVAL("主管审核","accessManager","有一条检修任务待您审核,请及时处理"), ACCESS_ADJUST_APPROVAL("调整计划","","您有一条检修计划审核未通过,请及时处理"), @@ -80,12 +81,11 @@ public interface AccessConstants { ACCESS_BACKLOG("生成任务","accessProprietor","有一条待您处理的检修任务生成,请及时处理"), ; + private final String status; @Getter - private String status; + private final String role; @Getter - private String role; - @Getter - private String msg; + private final String msg; AccessProcessEnum(String status, String role, String msg) { this.status = status; diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/config/entity/DataSet.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/config/entity/DataSet.java index aa3a2ca..6aab4b6 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/config/entity/DataSet.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/config/entity/DataSet.java @@ -1,5 +1,8 @@ package com.hnac.hzims.operational.config.entity; +import lombok.Getter; + +@Getter public class DataSet implements Comparable{ private Long id; private Integer propertyType;//类型,1-遥信;2-遥测 @@ -14,91 +17,47 @@ public class DataSet implements Comparable{ private String fdpFaultId;//fdp故障ID private String fdpMonitorId;//fdp监测点ID - public Long getId() { - return id; - } - public void setId(Long id) { this.id = id; } - public Integer getPropertyType() { - return propertyType; - } - public void setPropertyType(Integer propertyType) { this.propertyType = propertyType; } - public String getRealId() { - return realId; - } - public void setRealId(String realId) { this.realId = realId; } - public String getPropertyName() { - return propertyName; - } - public void setPropertyName(String propertyName) { this.propertyName = propertyName; } - public String getValue() { - return value; - } - public void setValue(String value) { this.value = value; } - public int getStatus() { - return status; - } - public void setStatus(int status) { this.status = status; } - public int getQ() { - return q; - } - public void setQ(int q) { this.q = q; } - public String getTime() { - return time; - } - public void setTime(String time) { this.time = time; } - public Double getFdpRate() { - return fdpRate; - } - - public void setFdpRate(Double fdpRate) { + public void setFdpRate(Double fdpRate) { this.fdpRate = fdpRate; } - public String getFdpFaultId() { - return fdpFaultId; - } - - public void setFdpFaultId(String fdpFaultId) { + public void setFdpFaultId(String fdpFaultId) { this.fdpFaultId = fdpFaultId; } - public String getFdpMonitorId() { - return fdpMonitorId; - } - - public void setFdpMonitorId(String fdpMonitorId) { + public void setFdpMonitorId(String fdpMonitorId) { this.fdpMonitorId = fdpMonitorId; } diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/config/enume/ConfigStatus.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/config/enume/ConfigStatus.java index dff1835..e4a7475 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/config/enume/ConfigStatus.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/config/enume/ConfigStatus.java @@ -10,7 +10,8 @@ public interface ConfigStatus { * * @author LiangXiang */ - public enum ConfigStatusEnum { + @Getter + enum ConfigStatusEnum { /** * 正常 */ @@ -35,12 +36,11 @@ public interface ConfigStatus { * 告警 */ HAND_DELAY_STATUS(5, "告警"); + private final int status; @Getter - private int status; - @Getter - private String name; + private final String name; - private ConfigStatusEnum(int status, String name) { + ConfigStatusEnum(int status, String name) { this.status = status; this.name = name; } diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/constants/DefectConstant.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/constants/DefectConstant.java index ccea269..7d61da9 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/constants/DefectConstant.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/constants/DefectConstant.java @@ -62,7 +62,8 @@ public interface DefectConstant { - enum HandlerStatusEnum{ + @Getter + enum HandlerStatusEnum{ /** * 未处理 */ @@ -71,17 +72,17 @@ public interface DefectConstant { * 已处理 */ FINISH_STATUS("1","已处理"); + private final String status; @Getter - private String status; - @Getter - private String msg; + private final String msg; HandlerStatusEnum(String status,String msg){ this.status = status; this.msg = msg; } } - enum DiscrStatusEnum{ + @Getter + enum DiscrStatusEnum{ /** * 未甄别 */ @@ -90,10 +91,9 @@ public interface DefectConstant { * 已甄别 */ FINISH_STATUS("1","已甄别"); + private final String status; @Getter - private String status; - @Getter - private String msg; + private final String msg; DiscrStatusEnum(String status,String msg){ this.status = status; this.msg = msg; @@ -101,7 +101,8 @@ public interface DefectConstant { } - enum AutoDiscrStatusEnum{ + @Getter + enum AutoDiscrStatusEnum{ /** * 普通甄别 */ @@ -110,17 +111,17 @@ public interface DefectConstant { * 自动甄别 */ AUTO_STATUS("1","自动甄别"); + private final String status; @Getter - private String status; - @Getter - private String msg; + private final String msg; AutoDiscrStatusEnum(String status,String msg){ this.status = status; this.msg = msg; } } - enum IsDefectStatusEnum{ + @Getter + enum IsDefectStatusEnum{ /** * 是否为缺陷,0 否,1是 */ @@ -129,17 +130,17 @@ public interface DefectConstant { * 是否为缺陷,0 否,1是 */ IS_DEFECT(1,"是缺陷"); + private final Integer status; @Getter - private Integer status; - @Getter - private String msg; + private final String msg; IsDefectStatusEnum(Integer status,String msg){ this.status = status; this.msg = msg; } } - enum ConclStatusEnum{ + @Getter + enum ConclStatusEnum{ /** * 未定论 */ @@ -148,10 +149,9 @@ public interface DefectConstant { * 已定论 */ FINISH_STATUS("1","已定论"); + private final String status; @Getter - private String status; - @Getter - private String msg; + private final String msg; ConclStatusEnum(String status,String msg){ this.status = status; this.msg = msg; @@ -159,7 +159,8 @@ public interface DefectConstant { } - enum DefectHandlerStatusEnum{ + @Getter + enum DefectHandlerStatusEnum{ /** * 处理中 */ @@ -168,10 +169,9 @@ public interface DefectConstant { * 已完成 */ FINISH_STATUS("1","已完成"); + private final String status; @Getter - private String status; - @Getter - private String msg; + private final String msg; DefectHandlerStatusEnum(String status,String msg){ this.status = status; this.msg = msg; @@ -181,14 +181,14 @@ public interface DefectConstant { /** * 缺陷等级 */ - enum DefectLevelEnum{ + @Getter + enum DefectLevelEnum{ ONE("1","Ⅰ级缺陷"), TWO("2","·"), THREE("3","Ⅲ级缺陷"); + private final String status; @Getter - private String status; - @Getter - private String msg; + private final String msg; DefectLevelEnum(String status,String msg){ this.status = status; this.msg = msg; @@ -198,16 +198,16 @@ public interface DefectConstant { /** * 问题来源:ZB:值班管理,RCWH:日常维护,XJ:巡检管理,JX:检修管理,ZNZD:智能诊断 */ - enum DefectSourceEnum{ + @Getter + enum DefectSourceEnum{ ZB("ZB","值班管理"), RCWH("RCWH","日常维护"), XJ("XJ","巡检管理"), JX("JX","检修管理"), ZNZD("ZNZD","智能诊断"); + private final String status; @Getter - private String status; - @Getter - private String msg; + private final String msg; DefectSourceEnum(String status,String msg){ this.status = status; this.msg = msg; diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/feign/StatisticsFeignClient.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/feign/StatisticsFeignClient.java index 57651d8..9225f67 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/feign/StatisticsFeignClient.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/feign/StatisticsFeignClient.java @@ -35,5 +35,5 @@ public interface StatisticsFeignClient { * @return */ @GetMapping("/defect_statistic/defectStatistictCount") - public R> defectStatistictCount(); + R> defectStatistictCount(); } diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/duty/DutyContants.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/duty/DutyContants.java index 1c3a186..19b11ba 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/duty/DutyContants.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/duty/DutyContants.java @@ -13,7 +13,8 @@ public interface DutyContants { * @author LiangXiang * */ - public enum DutyRecDelayStatusEnum{ + @Getter + enum DutyRecDelayStatusEnum{ /** * 延时状态:未延时 */ @@ -30,9 +31,8 @@ public interface DutyContants { * 延时状态:交接班延时 */ REC_DELAY_STATUS(3); - @Getter - private int status; - private DutyRecDelayStatusEnum(int status){ + private final int status; + DutyRecDelayStatusEnum(int status){ this.status = status; } } diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/duty/enume/DutyMainStatus.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/duty/enume/DutyMainStatus.java index 8f8eb52..89a10a6 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/duty/enume/DutyMainStatus.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/duty/enume/DutyMainStatus.java @@ -1,9 +1,12 @@ package com.hnac.hzims.operational.duty.enume; +import lombok.Getter; + /** * @Author: py * 交接班状态值 */ +@Getter public enum DutyMainStatus { UMSUBMIT(0,"待值班"),EXEC(1,"值班中"),ACCEPT(2,"已完成"); private Integer val; @@ -14,19 +17,11 @@ public enum DutyMainStatus { this.name = name; } - public Integer getVal() { - return val; - } - - public void setVal(Integer val) { + public void setVal(Integer val) { this.val = val; } - public String getName() { - return name; - } - - public void setName(String name) { + public void setName(String name) { this.name = name; } diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/duty/enume/DutyRecStatus.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/duty/enume/DutyRecStatus.java index 86ec4c5..25750e7 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/duty/enume/DutyRecStatus.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/duty/enume/DutyRecStatus.java @@ -1,9 +1,12 @@ package com.hnac.hzims.operational.duty.enume; +import lombok.Getter; + /** * @Author: py * 交接班状态值 */ +@Getter public enum DutyRecStatus { UMSUBMIT(1,"未提交"),EXEC(2,"流程处理中"),ACCEPT(3,"已完成"),ANOMALY(4,"异常交接班"); private Integer val; @@ -14,19 +17,11 @@ public enum DutyRecStatus { this.name = name; } - public Integer getVal() { - return val; - } - - public void setVal(Integer val) { + public void setVal(Integer val) { this.val = val; } - public String getName() { - return name; - } - - public void setName(String name) { + public void setName(String name) { this.name = name; } diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/duty/enume/DutyStatus.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/duty/enume/DutyStatus.java index 2e6e9cb..31d22ea 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/duty/enume/DutyStatus.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/duty/enume/DutyStatus.java @@ -1,9 +1,12 @@ package com.hnac.hzims.operational.duty.enume; +import lombok.Getter; + /** * @Author: py * 调班状态值 */ +@Getter public enum DutyStatus { UMSUBMIT(1,"未提交"),CHANGE(2,"调班人审批"),BEIN(3,"主管审批"),FINISH(4,"已完成"),NOTPASS(5,"驳回"),CLOSED(6,"已关闭"); private Integer val; @@ -14,19 +17,11 @@ public enum DutyStatus { this.name = name; } - public Integer getVal() { - return val; - } - - public void setVal(Integer val) { + public void setVal(Integer val) { this.val = val; } - public String getName() { - return name; - } - - public void setName(String name) { + public void setName(String name) { this.name = name; } diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/duty/enume/JoinStatus.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/duty/enume/JoinStatus.java index d7e683a..7252647 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/duty/enume/JoinStatus.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/duty/enume/JoinStatus.java @@ -1,25 +1,21 @@ package com.hnac.hzims.operational.duty.enume; + +import lombok.Getter; + /** * 交接班状态 */ +@Getter public enum JoinStatus { DUTY_WAIT(0, "待值班"), DUTY_ING(1, "值班中"),DUTY_FINISH(2, "已完成"); private int status; private String name; - public int getStatus() { - return status; - } - - public void setStatus(int status) { + public void setStatus(int status) { this.status = status; } - public String getName() { - return name; - } - - public void setName(String name) { + public void setName(String name) { this.name = name; } diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/duty/enume/JoinType.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/duty/enume/JoinType.java index 1e97a75..3037be1 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/duty/enume/JoinType.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/duty/enume/JoinType.java @@ -1,26 +1,21 @@ package com.hnac.hzims.operational.duty.enume; +import lombok.Getter; + /** * 交接班类型 */ +@Getter public enum JoinType { OVER(1, "交班待提交"), START(2, "接班待确认"),FINISH(3,"已完成"),REJECT(4,"已驳回"),; private int type; private String name; - public int getType() { - return type; - } - - public void setType(int type) { + public void setType(int type) { this.type = type; } - public String getName() { - return name; - } - - public void setName(String name) { + public void setName(String name) { this.name = name; } JoinType(int type, String name) { diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/constant/MainEnumConstants.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/constant/MainEnumConstants.java index 1a6296f..6a76d74 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/constant/MainEnumConstants.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/constant/MainEnumConstants.java @@ -5,7 +5,8 @@ import lombok.Getter; public interface MainEnumConstants { - enum SoeKindEnum{ + @Getter + enum SoeKindEnum{ /** * 系统告警 */ @@ -71,17 +72,17 @@ public interface MainEnumConstants { * 用于初始化 */ SOE_KIND_16(16,"用于初始化"); + private final int status; @Getter - private int status; - @Getter - private String value; - private SoeKindEnum(int status,String value){ + private final String value; + SoeKindEnum(int status, String value){ this.status = status; this.value = value; } } - enum TaskTypeEnum{ + @Getter + enum TaskTypeEnum{ RCWH("RCWH","日常维护"), XJ("XJ","巡检管理"), JX("JX","检修管理"), @@ -89,10 +90,9 @@ public interface MainEnumConstants { GZP("GZP","工作票"), CZP("CZP","操作票"), ; + private final String status; @Getter - private String status; - @Getter - private String msg; + private final String msg; TaskTypeEnum(String status,String msg){ this.status = status; this.msg = msg; diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/feign/MaintenanceFeignClient.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/feign/MaintenanceFeignClient.java index 712a3fd..3effec7 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/feign/MaintenanceFeignClient.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/feign/MaintenanceFeignClient.java @@ -25,6 +25,6 @@ public interface MaintenanceFeignClient { @PostMapping("/maintenance/findPending") @ApiOperation(value = "日常维护待处理") - public Boolean findPending(@RequestBody ProcessWorkFlowResponse response); + Boolean findPending(@RequestBody ProcessWorkFlowResponse response); } diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/report/constants/ReportConstant.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/report/constants/ReportConstant.java index 0069a0f..4b5e7a9 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/report/constants/ReportConstant.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/report/constants/ReportConstant.java @@ -1,12 +1,15 @@ package com.hnac.hzims.operational.report.constants; +import lombok.Getter; + public interface ReportConstant { String MONTH_REPORT_TYPE_MAINTENANCE = "1";//日常维护 String MONTH_REPORT_TYPE_ACCESS = "2";//检修 String MONTH_REPORT_TYPE_INSPECT = "3";//巡检 - enum RoleEnum{ + @Getter + enum RoleEnum{ OPERATE_CREW("operatingCrew","运行人员"), ; @@ -15,15 +18,8 @@ public interface ReportConstant { this.name = name; } - private String code; - private String name; - - public String getCode() { - return code; - } + private final String code; + private final String name; - public String getName() { - return name; - } - } + } } diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/station/StationConstants.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/station/StationConstants.java index e42046c..8c911e5 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/station/StationConstants.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/station/StationConstants.java @@ -29,12 +29,12 @@ public interface StationConstants { String DATA_ORIGIN_FILL = "1"; - enum DeptCategoryEnum { + @Getter + enum DeptCategoryEnum { STATION(4,"站点") ; - @Getter - private Integer value; - private String describe; + private final Integer value; + private final String describe; DeptCategoryEnum(Integer value, String describe) { this.value = value; @@ -43,18 +43,18 @@ public interface StationConstants { } /**视频监测秘钥**/ - enum VideoMonitorEnum { + @Getter + enum VideoMonitorEnum { ZT_YUN("175.6.40.71:443","21815698","QzPHyG2qWgQM8tBJOAJk"), TX_YUN("","","") ; - @Getter - private String videoHost; + private final String videoHost; @Getter - private String appKey; + private final String appKey; @Getter - private String appSecret; + private final String appSecret; VideoMonitorEnum(String videoHost, String appKey, String appSecret) { this.videoHost = videoHost; @@ -69,15 +69,15 @@ public interface StationConstants { String APP_SECRET = "QzPHyG2qWgQM8tBJOAJk"; - enum HikVideoStatusEnum{ + @Getter + enum HikVideoStatusEnum{ IS_HIKVIDEO(1,"平台接入"), NOT_HIKVIDEO(0,"非平台接入") ; + private final int status; @Getter - private int status; - @Getter - private String des; + private final String des; HikVideoStatusEnum(int status, String des) { this.status = status; diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/station/enume/StationEnumConstants.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/station/enume/StationEnumConstants.java index 266ce4e..1f2fff1 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/station/enume/StationEnumConstants.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/station/enume/StationEnumConstants.java @@ -7,7 +7,8 @@ public interface StationEnumConstants { /** * 站点类型 */ - enum StationTypeEnum { + @Getter + enum StationTypeEnum { /** * 水电站 */ @@ -45,12 +46,11 @@ public interface StationEnumConstants { * 泵站 */ STATION_TYPE_8(8, "泵站"); + private final int status; @Getter - private int status; - @Getter - private String value; + private final String value; - private StationTypeEnum(int status, String value) { + StationTypeEnum(int status, String value) { this.status = status; this.value = value; } diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/vRView/constant/VRViewEnum.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/vRView/constant/VRViewEnum.java index 683c2b4..19ee735 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/vRView/constant/VRViewEnum.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/vRView/constant/VRViewEnum.java @@ -153,11 +153,11 @@ public enum VRViewEnum { // BEARING_SDZW_WD("水导轴瓦温度", "℃"); - private String type; + private final String type; - private String desc; + private final String desc; - private VRViewEnum(String type, String desc) { + VRViewEnum(String type, String desc) { this.type = type; this.desc = desc; } diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/vRView/constant/VRViewSortEnum.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/vRView/constant/VRViewSortEnum.java index 3275684..de2905a 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/vRView/constant/VRViewSortEnum.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/vRView/constant/VRViewSortEnum.java @@ -102,11 +102,11 @@ public enum VRViewSortEnum { - private String type; + private final String type; - private Integer value; + private final Integer value; - private VRViewSortEnum(String type, Integer value) { + VRViewSortEnum(String type, Integer value) { this.type = type; this.value = value; } diff --git a/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/areamonthly/feign/TaskFeignClient.java b/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/areamonthly/feign/TaskFeignClient.java index 599e462..30c0c84 100644 --- a/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/areamonthly/feign/TaskFeignClient.java +++ b/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/areamonthly/feign/TaskFeignClient.java @@ -34,11 +34,11 @@ public interface TaskFeignClient { @GetMapping("/task/list") @ApiOperation(value = "分页显示任务列表", notes = "传入task") - public R> list(@SpringQueryMap TaskListQuery task, @SpringQueryMap Query query); + R> list(@SpringQueryMap TaskListQuery task, @SpringQueryMap Query query); @GetMapping(value = "/task/detail") @ApiOperation(value = "查看,下面列表再调用eventController.list", notes = "传入taskid") - public R detail(@RequestParam Long id); + R detail(@RequestParam Long id); /** @@ -46,16 +46,16 @@ public interface TaskFeignClient { */ @GetMapping("/task/pageList/{page}/{size}") @ApiOperation(value = "分页显示任务列表", notes = "传入task") - public R> pageList( + R> pageList( @PathVariable("page") Long page, - @PathVariable("size") Long size, + @PathVariable("size") Long size, @SpringQueryMap TaskListQuery task); @GetMapping(value = "/task/event/list") @ApiOperation(value = "任务查看弹窗下面的列表 巡检情况列表信息分页", notes = "传入taskId") - public R> eventList(@RequestParam Long taskId, @SpringQueryMap Query query, - @SpringQueryMap BladeUser bladeUser); + R> eventList(@RequestParam Long taskId, @SpringQueryMap Query query, + @SpringQueryMap BladeUser bladeUser); /** @@ -63,7 +63,7 @@ public interface TaskFeignClient { */ @GetMapping(value = "/task/getTaskById") @ApiOperation(value = "获取任务详情", notes = "传入taskId") - public R> getTaskById(@RequestParam Long id); + R> getTaskById(@RequestParam Long id); /** @@ -71,7 +71,7 @@ public interface TaskFeignClient { */ @GetMapping("task/getTaskListStatistics") @ApiOperation(value = "巡检计划统计", notes = "传入计划id") - public R> getTaskListStatistics(@RequestParam String startTime,@RequestParam String endTime, - @RequestParam Long deptId); + R> getTaskListStatistics(@RequestParam String startTime, @RequestParam String endTime, + @RequestParam Long deptId); } diff --git a/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/plan/PlanContants.java b/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/plan/PlanContants.java index 8ee47f8..3ce1186 100644 --- a/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/plan/PlanContants.java +++ b/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/plan/PlanContants.java @@ -17,7 +17,8 @@ public interface PlanContants { /**计划状态字典key**/ String PLAN_STATUS = "planStatus"; - public enum PlanTypeEnum{ + @Getter + enum PlanTypeEnum{ /** * 计划人员模式 */ @@ -38,9 +39,8 @@ public interface PlanContants { * 计划班次模式 */ CLASS_TYPE("4"); - @Getter - private String type; - private PlanTypeEnum(String type){ + private final String type; + PlanTypeEnum(String type){ this.type = type; } } @@ -48,7 +48,8 @@ public interface PlanContants { /** * 0:待审核-->1:已审核-->2:派发中-->3:暂停-->4:结束-->5审核不通过-->6待提交 */ - public enum PlanStatusEnum{ + @Getter + enum PlanStatusEnum{ /** * 待审核 */ @@ -78,14 +79,14 @@ public interface PlanContants { */ PLAN_SUBMIT("6"); - @Getter - private String status; - private PlanStatusEnum(String status){ + private final String status; + PlanStatusEnum(String status){ this.status = status; } } - public enum PlanCycleEnum { + @Getter + enum PlanCycleEnum { /** * 计划周期每次 */ @@ -110,9 +111,8 @@ public interface PlanContants { * 计划周期每周 */ EVERYYEAR_CYCLE("4"); - @Getter - private String cycle; - private PlanCycleEnum(String cycle){ + private final String cycle; + PlanCycleEnum(String cycle){ this.cycle = cycle; } } @@ -121,10 +121,10 @@ public interface PlanContants { * 派发方式:0 抢占模式 1 并发模式 */ @Getter - public enum PlanMethodEnum{ + enum PlanMethodEnum{ SEIZE("0"),CONCURRENT("1"); - private String method; - private PlanMethodEnum(String method){ + private final String method; + PlanMethodEnum(String method){ this.method = method; } } @@ -135,8 +135,8 @@ public interface PlanContants { @Getter enum PlanContentTypeEnum{ COMMON("common"),TEMP("temporary"); - private String desc; - private PlanContentTypeEnum(String desc){ + private final String desc; + PlanContentTypeEnum(String desc){ this.desc = desc; } } @@ -158,7 +158,7 @@ public interface PlanContants { * 2机器人巡检 */ ROBOT("2"); - private String val; + private final String val; InspectTypeEnum(String val){ this.val = val; } @@ -170,7 +170,7 @@ public interface PlanContants { @Getter enum GenTaskImmediateEnum{ YES(1),NO(0); - private int flag; + private final int flag; GenTaskImmediateEnum(int flag){ this.flag = flag; } @@ -179,10 +179,10 @@ public interface PlanContants { /** * 是否自动巡检 0-否 1-是 */ - @AllArgsConstructor + @Getter + @AllArgsConstructor enum AutoVideoEnum { YES("1"),NO("0"); - @Getter private String flag; diff --git a/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/task/TaskContants.java b/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/task/TaskContants.java index 68efead..6795574 100644 --- a/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/task/TaskContants.java +++ b/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/task/TaskContants.java @@ -25,7 +25,7 @@ public interface TaskContants { /** * 流程key */ - final String PROGROM_FLOWABLE_KEY = "inspectProgram"; + String PROGROM_FLOWABLE_KEY = "inspectProgram"; /** * 巡检任务类型字典key @@ -35,14 +35,15 @@ public interface TaskContants { /** * 流程key */ - final String TASK_USER = "problemUser"; + String TASK_USER = "problemUser"; /** * 0未开始 1进行中 2暂停 3已完成 4未完成 * @author ninglong * */ - public enum TaskStatusEnum{ + @Getter + enum TaskStatusEnum{ /** * 任务状态未开始常量值 */ @@ -63,9 +64,8 @@ public interface TaskContants { * 任务状态未完成常量值 */ UNFINISH_STATUS("4"); - @Getter - private String status; - private TaskStatusEnum(String status){ + private final String status; + TaskStatusEnum(String status){ this.status = status; } } @@ -74,7 +74,8 @@ public interface TaskContants { * 领用状态 0:未领用 1:已领用 * @author ninglong */ - public enum ClaimStatusEnum{ + @Getter + enum ClaimStatusEnum{ /** * 0:未领用 */ @@ -83,9 +84,8 @@ public interface TaskContants { * 1:已领用 */ COLLECT("1"); - @Getter - private String status; - private ClaimStatusEnum(String status){ + private final String status; + ClaimStatusEnum(String status){ this.status = status; } } @@ -94,11 +94,11 @@ public interface TaskContants { * 报备模式 0 任务报备 1 人员报备 * @author ninglong */ - public enum TaskRecordTypeEnum{ + @Getter + enum TaskRecordTypeEnum{ task("0"),people("1"); - @Getter - private String type; - private TaskRecordTypeEnum(String type){ + private final String type; + TaskRecordTypeEnum(String type){ this.type = type; } } @@ -106,11 +106,11 @@ public interface TaskContants { * 巡检备案 0 未备案 1已备案 * @author ninglong */ - public enum keepOnRecordEnum{ + @Getter + enum keepOnRecordEnum{ no("0"),yes("1"); - @Getter - private String type; - private keepOnRecordEnum(String type){ + private final String type; + keepOnRecordEnum(String type){ this.type = type; } } @@ -119,11 +119,11 @@ public interface TaskContants { * 是否问题 0:否 1 是 默认0 * @author ninglong */ - public enum ProblemEnum{ + @Getter + enum ProblemEnum{ no("0"),yes("1"); - @Getter - private String type; - private ProblemEnum(String type){ + private final String type; + ProblemEnum(String type){ this.type = type; } } @@ -133,11 +133,11 @@ public interface TaskContants { * @author ninglong * */ - public enum AvailableEnum{ + @Getter + enum AvailableEnum{ no("0"),yes("1"); - @Getter - private String type; - private AvailableEnum(String type){ + private final String type; + AvailableEnum(String type){ this.type = type; } } @@ -147,16 +147,17 @@ public interface TaskContants { * @author py * */ - public enum CurrentStatusEnum{ + @Getter + enum CurrentStatusEnum{ normal("1"), abnormal("0") ; - @Getter - private String type; - private CurrentStatusEnum(String type){ + private final String type; + CurrentStatusEnum(String type){ this.type = type; } } - enum StatusEnum{ + @Getter + enum StatusEnum{ /** * 状态未完成 */ @@ -165,9 +166,8 @@ public interface TaskContants { * 任务状态已完成 */ FINISH_STATUS(1); - @Getter - private Integer status; - private StatusEnum(Integer status){ + private final Integer status; + StatusEnum(Integer status){ this.status = status; } } diff --git a/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/threedimensional/fegin/RouteFeignClient.java b/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/threedimensional/fegin/RouteFeignClient.java index 76881f3..f15dae2 100644 --- a/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/threedimensional/fegin/RouteFeignClient.java +++ b/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/threedimensional/fegin/RouteFeignClient.java @@ -41,8 +41,8 @@ public interface RouteFeignClient { * @return */ @GetMapping("/st_re_route/list") - public R> list(@ApiIgnore @RequestParam Map st_re_route, - @SpringQueryMap Query query); + R> list(@ApiIgnore @RequestParam Map st_re_route, + @SpringQueryMap Query query); /** @@ -51,7 +51,7 @@ public interface RouteFeignClient { @PostMapping("/st_re_route/save") @ApiOperationSupport(order = 4) @ApiOperation(value = "新增", notes = "传入st_re_route") - public R save(@RequestBody RouteEntity st_re_route); + R save(@RequestBody RouteEntity st_re_route); /** @@ -60,7 +60,7 @@ public interface RouteFeignClient { @PostMapping("/st_re_route/update") @ApiOperationSupport(order = 5) @ApiOperation(value = "修改", notes = "传入st_re_route") - public R update(@RequestBody RouteEntity st_re_route); + R update(@RequestBody RouteEntity st_re_route); /** @@ -69,5 +69,5 @@ public interface RouteFeignClient { @PostMapping("/st_re_route/remove") @ApiOperationSupport(order = 7) @ApiOperation(value = "逻辑删除", notes = "传入ids") - public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids); + R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids); } diff --git a/hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/MessageConstants.java b/hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/MessageConstants.java index fcdb8da..94d6454 100644 --- a/hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/MessageConstants.java +++ b/hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/MessageConstants.java @@ -28,13 +28,13 @@ public class MessageConstants { public final static String WS_MESSAGE_KEY = "hzims:message:websocket:push"; - @AllArgsConstructor + @Getter + @AllArgsConstructor public enum LogInquireDateEnum { YEAR("year"), MONTH("month"), DAY("day") ; - @Getter private String value; public static LogInquireDateEnum getClassifyDesByKey(String value) { Optional anEnum = Arrays.stream(LogInquireDateEnum.class.getEnumConstants()) @@ -43,7 +43,8 @@ public class MessageConstants { } } - @AllArgsConstructor + @Getter + @AllArgsConstructor @NoArgsConstructor public enum BusinessClassifyEnum { INSPECT("inspect","巡检管理"), @@ -68,7 +69,6 @@ public class MessageConstants { OVERHAUL_TASK("overhaul-task","检修任务"), ; - @Getter private String key; @Getter private String description; diff --git a/hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/enums/PushStatEnum.java b/hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/enums/PushStatEnum.java index 1a58dce..f860fee 100644 --- a/hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/enums/PushStatEnum.java +++ b/hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/enums/PushStatEnum.java @@ -23,7 +23,7 @@ public enum PushStatEnum { private Integer code; @Getter - private String value; + private final String value; PushStatEnum(Integer code, String value) { this.code = code; diff --git a/hzims-service-api/middle-api/src/main/java/com/hnac/hzims/middle/process/feign/ProcessDictFeignService.java b/hzims-service-api/middle-api/src/main/java/com/hnac/hzims/middle/process/feign/ProcessDictFeignService.java index 70413dc..b982376 100644 --- a/hzims-service-api/middle-api/src/main/java/com/hnac/hzims/middle/process/feign/ProcessDictFeignService.java +++ b/hzims-service-api/middle-api/src/main/java/com/hnac/hzims/middle/process/feign/ProcessDictFeignService.java @@ -24,8 +24,8 @@ public interface ProcessDictFeignService { * @return */ @GetMapping("/process-dict/getTicketByCode") - public String getTicketByCode(@RequestParam("staff") String staff, - @RequestParam("typeInstrument") String typeInstrument); + String getTicketByCode(@RequestParam("staff") String staff, + @RequestParam("typeInstrument") String typeInstrument); /** @@ -35,5 +35,5 @@ public interface ProcessDictFeignService { * @return */ @GetMapping("/process-dict/selectDictValueByKey") - public String selectDictValueByKey(@RequestParam("dictKey") String dictKey); + String selectDictValueByKey(@RequestParam("dictKey") String dictKey); } diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/Constants.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/Constants.java index eceea8d..6128828 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/Constants.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/Constants.java @@ -22,7 +22,8 @@ public class Constants { /** * 安全检查项目枚举 */ - @NoArgsConstructor + @Getter + @NoArgsConstructor @AllArgsConstructor public enum SafeCheckProjectEnum { WORK_TICKET("1.1","工作票合格率"), @@ -34,21 +35,20 @@ public class Constants { MAINTENANCE_TASK("4.1","定期维护"), ACCESS_TASK("4.2","定期检修"), ; - @Getter private String type; @Getter private String name; } - public enum SysFileStatusEnum { + @Getter + public enum SysFileStatusEnum { PENDING(1,"待审批"), APPROVED(2,"已审批"), REJECT(3,"驳回") ; + private final Integer status; @Getter - private Integer status; - @Getter - private String describe; + private final String describe; SysFileStatusEnum(Integer status, String describe) { this.status = status; diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/areamonthly/feign/CheckCompanyFeignClient.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/areamonthly/feign/CheckCompanyFeignClient.java index 8a8bc0c..033f480 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/areamonthly/feign/CheckCompanyFeignClient.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/areamonthly/feign/CheckCompanyFeignClient.java @@ -45,5 +45,5 @@ public interface CheckCompanyFeignClient { @GetMapping("/detail") @ApiOperationSupport(order = 40) @ApiOperation(value = "详情", notes = "传入id") - public R detail(@RequestParam Long id); + R detail(@RequestParam Long id); } diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/areamonthly/feign/SafeEquipmentTrialFeignClient.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/areamonthly/feign/SafeEquipmentTrialFeignClient.java index 7fec8c9..3fd2923 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/areamonthly/feign/SafeEquipmentTrialFeignClient.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/areamonthly/feign/SafeEquipmentTrialFeignClient.java @@ -29,7 +29,7 @@ public interface SafeEquipmentTrialFeignClient { @GetMapping("/safeEquimentTrial/list") @ApiOperationSupport(order = 50) @ApiOperation(value = "分页", notes = "查询条件:createDept,fileName,startTime,endTime") - public R> list(SafeEquipmentTrialDTO safeEquipmentTrialDTO, Query query) ; + R> list(SafeEquipmentTrialDTO safeEquipmentTrialDTO, Query query) ; } diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/areamonthly/feign/SafeproductFeignClient.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/areamonthly/feign/SafeproductFeignClient.java index ca82045..1f00e52 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/areamonthly/feign/SafeproductFeignClient.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/areamonthly/feign/SafeproductFeignClient.java @@ -33,8 +33,8 @@ public interface SafeproductFeignClient { @GetMapping("/checkMonth/listconferenceScope/{page}/{size}") @ApiOperationSupport(order = 50) @ApiOperation(value = "分页", notes = "查询条件:month,status,createDept") - public R> listconferenceScope(@PathVariable Long page, @PathVariable Long size, - @SpringQueryMap CheckMonthEntity req); + R> listconferenceScope(@PathVariable Long page, @PathVariable Long size, + @SpringQueryMap CheckMonthEntity req); /** @@ -43,7 +43,7 @@ public interface SafeproductFeignClient { @GetMapping("/checkMonth/detail") @ApiOperationSupport(order = 40) @ApiOperation(value = "详情", notes = "传入id") - public R detail(@RequestParam Long id); + R detail(@RequestParam Long id); diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/constants/DictConstants.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/constants/DictConstants.java index a01b53e..059d369 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/constants/DictConstants.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/constants/DictConstants.java @@ -18,12 +18,12 @@ public interface DictConstants { /**危险等级**/ String RISK_LEVEL = "riskLevel"; - @AllArgsConstructor + @Getter + @AllArgsConstructor enum DangerSourceTypeEnum { OPERATION(1,"作业活动"), EQUIPMENT(2,"设备"), ; - @Getter private Integer type; @Getter private String typeName; diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/CarAnnualInspectionStatusEnum.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/CarAnnualInspectionStatusEnum.java index 1338ecf..2ccd30e 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/CarAnnualInspectionStatusEnum.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/CarAnnualInspectionStatusEnum.java @@ -1,11 +1,14 @@ package com.hnac.hzims.safeproduct.enums; +import lombok.Getter; + /** * 车辆年检记录状态枚举类 * * @author liwen * @date 2024-01-22 */ +@Getter public enum CarAnnualInspectionStatusEnum { FINISHED("FINISHED", "已完成"), @@ -20,11 +23,4 @@ public enum CarAnnualInspectionStatusEnum { this.desc = desc; } - public String getValue() { - return value; - } - - public String getDesc() { - return desc; - } } diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/CarInsuranceStatusEnum.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/CarInsuranceStatusEnum.java index c3e90e2..bfdbbec 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/CarInsuranceStatusEnum.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/CarInsuranceStatusEnum.java @@ -1,11 +1,14 @@ package com.hnac.hzims.safeproduct.enums; +import lombok.Getter; + /** * 车辆保险记录状态枚举类 * * @author liwen * @date 2024-01-11 */ +@Getter public enum CarInsuranceStatusEnum { INSURED("INSURED", "已参保"), @@ -20,11 +23,4 @@ public enum CarInsuranceStatusEnum { this.desc = desc; } - public String getValue() { - return value; - } - - public String getDesc() { - return desc; - } } diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/CarMaintenanceStatusEnum.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/CarMaintenanceStatusEnum.java index f239837..35ae820 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/CarMaintenanceStatusEnum.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/CarMaintenanceStatusEnum.java @@ -1,11 +1,14 @@ package com.hnac.hzims.safeproduct.enums; +import lombok.Getter; + /** * 车辆维保记录状态枚举类 * * @author liwen * @date 2024-01-10 */ +@Getter public enum CarMaintenanceStatusEnum { MAINTAINED("MAINTAINED", "已维保"), @@ -20,11 +23,4 @@ public enum CarMaintenanceStatusEnum { this.desc = desc; } - public String getValue() { - return value; - } - - public String getDesc() { - return desc; - } } diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/CarMaintenanceTypeEnum.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/CarMaintenanceTypeEnum.java index d19ccf3..c2a8bf6 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/CarMaintenanceTypeEnum.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/CarMaintenanceTypeEnum.java @@ -1,11 +1,14 @@ package com.hnac.hzims.safeproduct.enums; +import lombok.Getter; + /** * 车辆维保类型枚举类 * * @author liwen * @date 2024-01-16 */ +@Getter public enum CarMaintenanceTypeEnum { MAINTAIN("MAINTAIN", "保养"), @@ -20,11 +23,4 @@ public enum CarMaintenanceTypeEnum { this.desc = desc; } - public String getValue() { - return value; - } - - public String getDesc() { - return desc; - } } diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/CarUsedRecordEnum.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/CarUsedRecordEnum.java index b8e5211..f0b45d6 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/CarUsedRecordEnum.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/CarUsedRecordEnum.java @@ -1,11 +1,14 @@ package com.hnac.hzims.safeproduct.enums; +import lombok.Getter; + /** * 用车记录枚举类 * * @author liwen * @date 2024-01-10 */ +@Getter public enum CarUsedRecordEnum { USING("USING", "使用中"), @@ -20,11 +23,4 @@ public enum CarUsedRecordEnum { this.desc = desc; } - public String getValue() { - return value; - } - - public String getDesc() { - return desc; - } } diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/ConferenceMethodEnum.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/ConferenceMethodEnum.java index b459dde..afc52ff 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/ConferenceMethodEnum.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/ConferenceMethodEnum.java @@ -1,11 +1,14 @@ package com.hnac.hzims.safeproduct.enums; +import lombok.Getter; + /** * 会议方式枚举类 * * @author liwen * @date 2023-12-27 */ +@Getter public enum ConferenceMethodEnum { ONLINE("ONLINE", "线上"), @@ -21,11 +24,4 @@ public enum ConferenceMethodEnum { this.desc = desc; } - public String getValue() { - return value; - } - - public String getDesc() { - return desc; - } } diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/ConferenceStatusEnum.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/ConferenceStatusEnum.java index ea68dfc..4de5972 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/ConferenceStatusEnum.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/ConferenceStatusEnum.java @@ -1,11 +1,14 @@ package com.hnac.hzims.safeproduct.enums; +import lombok.Getter; + /** * 会议状态枚举类 * * @author liwen * @date 2023-12-27 */ +@Getter public enum ConferenceStatusEnum { WAITING("WAITING", "未开始"), @@ -21,11 +24,4 @@ public enum ConferenceStatusEnum { this.desc = desc; } - public String getValue() { - return value; - } - - public String getDesc() { - return desc; - } } diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/DeviceStatusEnum.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/DeviceStatusEnum.java index 22a183c..8b3f4bd 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/DeviceStatusEnum.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/DeviceStatusEnum.java @@ -1,11 +1,14 @@ package com.hnac.hzims.safeproduct.enums; +import lombok.Getter; + /** * 特种设备状态枚举类 * * @author liwen * @date 2024-01-16 */ +@Getter public enum DeviceStatusEnum { NORMAL("NORMAL", "正常"), @@ -20,11 +23,4 @@ public enum DeviceStatusEnum { this.desc = desc; } - public String getValue() { - return value; - } - - public String getDesc() { - return desc; - } } diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/HygieneStatusEnum.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/HygieneStatusEnum.java index 2c86fcb..cac5d8f 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/HygieneStatusEnum.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/HygieneStatusEnum.java @@ -1,11 +1,14 @@ package com.hnac.hzims.safeproduct.enums; +import lombok.Getter; + /** * 卫生自查状态枚举类 * * @author liwen * @date 2023-12-29 */ +@Getter public enum HygieneStatusEnum { WAITING("WAITING", "未开始"), @@ -21,11 +24,4 @@ public enum HygieneStatusEnum { this.desc = desc; } - public String getValue() { - return value; - } - - public String getDesc() { - return desc; - } } diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/MsgSendTypeEnum.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/MsgSendTypeEnum.java index 6ca0edb..2634546 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/MsgSendTypeEnum.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/MsgSendTypeEnum.java @@ -1,26 +1,22 @@ package com.hnac.hzims.safeproduct.enums; +import lombok.Getter; + /** * 消息发送类型枚举 */ +@Getter public enum MsgSendTypeEnum { SMS(1,"短信"), WECHAT(2,"微信"), APP(3,"APP"); - private int value; - private String desc; + private final int value; + private final String desc; MsgSendTypeEnum(int value, String desc) { this.value = value; this.desc = desc; } - public int getValue() { - return value; - } - - public String getDesc() { - return desc; - } } diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/RehearsalMethodEnum.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/RehearsalMethodEnum.java index a1cb0f8..a7378d3 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/RehearsalMethodEnum.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/RehearsalMethodEnum.java @@ -1,11 +1,14 @@ package com.hnac.hzims.safeproduct.enums; +import lombok.Getter; + /** * 演练方式枚举类 * * @author liwen * @date 2023-12-14 */ +@Getter public enum RehearsalMethodEnum { ONLINE("ONLINE", "线上"), @@ -21,11 +24,4 @@ public enum RehearsalMethodEnum { this.desc = desc; } - public String getValue() { - return value; - } - - public String getDesc() { - return desc; - } } diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/RehearsalStatusEnum.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/RehearsalStatusEnum.java index 864af73..1d9fbdb 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/RehearsalStatusEnum.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/RehearsalStatusEnum.java @@ -1,11 +1,14 @@ package com.hnac.hzims.safeproduct.enums; +import lombok.Getter; + /** * 演练状态枚举类 * * @author liwen * @date 2023-12-14 */ +@Getter public enum RehearsalStatusEnum { WAITING("WAITING", "未开始"), @@ -21,12 +24,4 @@ public enum RehearsalStatusEnum { this.desc = desc; } - public String getValue() { - return value; - } - - public String getDesc() { - return desc; - } - } diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/TestMethodEnum.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/TestMethodEnum.java index 0e39487..04d0872 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/TestMethodEnum.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/TestMethodEnum.java @@ -1,11 +1,14 @@ package com.hnac.hzims.safeproduct.enums; +import lombok.Getter; + /** * 考试方式枚举类 * * @author liwen * @date 2024-01-25 */ +@Getter public enum TestMethodEnum { ONLINE("ONLINE", "线上"), @@ -21,11 +24,4 @@ public enum TestMethodEnum { this.desc = desc; } - public String getValue() { - return value; - } - - public String getDesc() { - return desc; - } } diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/TrainMethodEnum.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/TrainMethodEnum.java index 843244d..bc0858e 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/TrainMethodEnum.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/TrainMethodEnum.java @@ -1,11 +1,14 @@ package com.hnac.hzims.safeproduct.enums; +import lombok.Getter; + /** * 培训方式枚举类 * * @author liwen * @date 2024-01-15 */ +@Getter public enum TrainMethodEnum { ONLINE("ONLINE", "线上"), @@ -21,11 +24,4 @@ public enum TrainMethodEnum { this.desc = desc; } - public String getValue() { - return value; - } - - public String getDesc() { - return desc; - } } diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/TrainStatusEnum.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/TrainStatusEnum.java index bb156f0..0eb764f 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/TrainStatusEnum.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/TrainStatusEnum.java @@ -1,11 +1,14 @@ package com.hnac.hzims.safeproduct.enums; +import lombok.Getter; + /** * 培训计划状态枚举类 * * @author liwen * @date 2023-12-27 */ +@Getter public enum TrainStatusEnum { WAITING("WAITING", "未开始"), @@ -21,11 +24,4 @@ public enum TrainStatusEnum { this.desc = desc; } - public String getValue() { - return value; - } - - public String getDesc() { - return desc; - } } diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hazard/enums/DangerSourceLevelEnum.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hazard/enums/DangerSourceLevelEnum.java index ad93f58..68e75f8 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hazard/enums/DangerSourceLevelEnum.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hazard/enums/DangerSourceLevelEnum.java @@ -1,5 +1,6 @@ package com.hnac.hzims.safeproduct.hazard.enums; +import lombok.Getter; import org.springblade.core.tool.utils.StringUtil; /** @@ -8,29 +9,22 @@ import org.springblade.core.tool.utils.StringUtil; * @author xiashandong * @created 2020/9/1 15:34 **/ +@Getter public enum DangerSourceLevelEnum { _10(10, "稍有危险"), _20(20, "一般危险"), _30(30, "显著危险"), _40(40, "高度危险"); - private int value; - private String name; + private final int value; + private final String name; DangerSourceLevelEnum(int value, String name) { this.value = value; this.name = name; } - public int getValue() { - return value; - } - - public String getName() { - return name; - } - - public static String getName(int value) { + public static String getName(int value) { for (DangerSourceLevelEnum item : DangerSourceLevelEnum.values()) { if (value == item.getValue()) { return item.getName(); diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/Constants.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/Constants.java index 494e1fa..842015b 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/Constants.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/Constants.java @@ -10,18 +10,19 @@ import java.util.Optional; public interface Constants { + @Getter @AllArgsConstructor enum PlanStatusEnum { NOT_START(0,"未开始"), HAVE(1,"进行中"), STOPPED(2,"已停止") ; - @Getter private final Integer status; @Getter private final String describe; } + @Getter @AllArgsConstructor enum TaskStatusEnum { NOT_START(0,"未开始"), @@ -29,12 +30,12 @@ public interface Constants { FINISH(2,"已完成"), NON_FINISH(3,"未完成") ; - @Getter private Integer status; @Getter private String describe; } + @Getter @AllArgsConstructor enum CycleEnum { /**一天一次**/ @@ -48,7 +49,6 @@ public interface Constants { /**一年一次**/ CYCLE_FIVE("5",1,"year") ; - @Getter private String cycle; @Getter private int days; diff --git a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/areamonthly/feign/TicketFeignClient.java b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/areamonthly/feign/TicketFeignClient.java index 7b23e63..e285ea9 100644 --- a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/areamonthly/feign/TicketFeignClient.java +++ b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/areamonthly/feign/TicketFeignClient.java @@ -62,7 +62,7 @@ public interface TicketFeignClient { */ @PostMapping("/allTicket/ticketEvaluate/save") @ApiOperation(value = "新增") - public R save(@RequestBody TicketInfoEvaluateDto req); + R save(@RequestBody TicketInfoEvaluateDto req); /** diff --git a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/constants/TicketConstants.java b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/constants/TicketConstants.java index 03808ec..c2e6855 100644 --- a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/constants/TicketConstants.java +++ b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/constants/TicketConstants.java @@ -44,14 +44,14 @@ public interface TicketConstants { /** * 开票任务类型 **/ + @Getter enum TaskTypeEnum { RCWH("1", "日常维护"), JXRW("2", "检修任务"), JXJH("3", "检修计划"); + private final String type; @Getter - private String type; - @Getter - private String typeName; + private final String typeName; TaskTypeEnum(String type, String typeName) { this.type = type; @@ -62,6 +62,7 @@ public interface TicketConstants { /** * 工作票流程环节 */ + @Getter enum WorkTicketFlowEnum { /** * 开票 @@ -104,12 +105,11 @@ public interface TicketConstants { **/ SIGN_CONFIRM_DELAY("9", "sid-5476EB52-438F-4C74-94FB-88A6EA6625EA", "签发人审核"), ; + private final String status; @Getter - private String status; - @Getter - private String flowId; + private final String flowId; @Getter - private String segment; + private final String segment; WorkTicketFlowEnum(String status, String flowId, String segment) { this.status = status; @@ -123,6 +123,7 @@ public interface TicketConstants { } } + @Getter enum WordFileNameEnum { OPERATE("1", "操作票"), WORK("2", "工作票"), @@ -136,10 +137,9 @@ public interface TicketConstants { NEW_FIRST_WORK("10", "新电气第一种工作票模板"), NEW_FIRST_WORK1("11", "第一种工作票"), ; + private final String type; @Getter - private String type; - @Getter - private String fileName; + private final String fileName; WordFileNameEnum(String type, String fileName) { this.type = type; @@ -153,6 +153,7 @@ public interface TicketConstants { } // 两票类型枚举类 + @Getter enum TicketTypeNameEnum { SWITCH_OFF("3", "倒闸操作票",1), @@ -162,12 +163,11 @@ public interface TicketConstants { SECOND_WORK("7", "第二种工作票",2), MECHANICAL_WORK("8", "水力机械工作票",2), ; + private final String type; @Getter - private String type; + private final String fileName; @Getter - private String fileName; - @Getter - private Integer ticketType; + private final Integer ticketType; TicketTypeNameEnum(String type, String fileName, Integer ticketType) { this.type = type; @@ -184,14 +184,14 @@ public interface TicketConstants { /** * 工作票安全注意事项类型 */ + @Getter enum MeasureTypeEnum { INIT_MEASURE("1", "开票时的安全措施"), SIGN_MEASURE("2", "签发补充安全措施"), LICENSE_MEASURE("3", "许可人补充安全措施"); + private final String type; @Getter - private String type; - @Getter - private String describe; + private final String describe; MeasureTypeEnum(String type, String describe) { this.type = type; @@ -199,11 +199,11 @@ public interface TicketConstants { } } + @Getter @AllArgsConstructor enum TicketCodePreEnum { DQ_WORK("6", "S-DQ", "电气工作票", "workTicketInfoService"), DQ_OPERATE("3", "YX-DQ", "电气标准票", "standardTicketInfoService"); - @Getter private String type; @Getter private String prefix; @@ -215,14 +215,14 @@ public interface TicketConstants { private String service; } + @Getter enum DelayStatusEnum { PRINCIPAL_INITIATE(1, "负责人发起"), LICENSOR_CONFIRM(2, "许可人确认"), PRINCIPAL_CONFIRM(3, "负责人确认"); + private final int status; @Getter - private int status; - @Getter - private String describe; + private final String describe; DelayStatusEnum(int status, String describe) { this.status = status; @@ -233,13 +233,13 @@ public interface TicketConstants { /** * 安全措施/注意事项 */ + @Getter @AllArgsConstructor enum SafetyMeasureStatusEnum { NO_EXECUTE(1, "未执行"), EXECUTED(2, "执行中"), NO_FINISH(4, "执行中"), FINISH(3, "已执行"); - @Getter private Integer status; @Getter private String describe; @@ -258,6 +258,7 @@ public interface TicketConstants { /** * 工作票处理流程 */ + @Getter enum FirstWorkTicketFlowEnum { SIGN("sign", "签发"), LICENSE("license", "许可人确认安全事项"), @@ -269,10 +270,9 @@ public interface TicketConstants { PRINCIPAL_DELAY("principalDelay", "负责人发起工作票延期"), LICENSOR_DELAY("licensorDelay", "许可人确认工作票延期"), ; + private final String code; @Getter - private String code; - @Getter - private String describe; + private final String describe; FirstWorkTicketFlowEnum(String code, String describe) { this.code = code; @@ -283,16 +283,16 @@ public interface TicketConstants { /** * 标准票处理流程 */ + @Getter enum StandardTicketStatusEnum { GUARDIAN_CONFIRM(1, "待监护人确认"), PRINCIPAL_CONFIRM(2, "待值班负责人确认"), END(3, "结束"), TERMINATION(4, "终止"); + private final Integer status; @Getter - private Integer status; - @Getter - private String describe; + private final String describe; StandardTicketStatusEnum(Integer status, String describe) { this.status = status; @@ -303,6 +303,7 @@ public interface TicketConstants { /** * 工作票处理流程 */ + @Getter @AllArgsConstructor enum FirstWorkTicketFlowStatusEnum { SIGN(1, "待签发"), @@ -325,7 +326,6 @@ public interface TicketConstants { OFFLINE_OPERATE(18, "线下执行任务"), OFFLINE_LICENSE(19, "线下许可人许可"), OFFLINE_END(20, "线下结束"); - @Getter private Integer status; @Getter private String describe; @@ -352,15 +352,15 @@ public interface TicketConstants { /** * 票据合格 */ + @Getter enum TicketQualifiedEnum { Qualified(1, "合格"), No_Qualified(2, "不合格"); - @Getter - private Integer code; + private final Integer code; @Getter - private String msg; + private final String msg; TicketQualifiedEnum(Integer code, String msg) { this.code = code; diff --git a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/constants/WorkTicketConstants.java b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/constants/WorkTicketConstants.java index 737d4c6..84f1b27 100644 --- a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/constants/WorkTicketConstants.java +++ b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/constants/WorkTicketConstants.java @@ -13,6 +13,7 @@ import java.util.Optional; */ public interface WorkTicketConstants { + @Getter @AllArgsConstructor enum WorkTicketMeasureTypeEnum { /** 第一种安措 **/ @@ -32,7 +33,6 @@ public interface WorkTicketConstants { TEN("10", "matterLibraryListTen"), ; - @Getter private String type; @Getter private String convertAttributes; @@ -43,6 +43,7 @@ public interface WorkTicketConstants { } } + @Getter @AllArgsConstructor enum FirstWorkTicketStatusEnum { /** 签发 **/ @@ -77,7 +78,6 @@ public interface WorkTicketConstants { OFFLINE_LICENSE(15, "线下许可人许可"), /** 线下结束 **/ OFFLINE_END(16, "线下结束"); - @Getter private Integer status; @Getter private String description; @@ -89,6 +89,7 @@ public interface WorkTicketConstants { } } + @Getter @AllArgsConstructor enum TicketSignageEnum { /**第一种工作票**/ @@ -98,7 +99,6 @@ public interface WorkTicketConstants { /**机械工作票**/ MACHINE("8","JX","水力机械工作票模版.docx"), ; - @Getter private String ticketType; @Getter private String signage; diff --git a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/ticketprocess/feign/OperationTicketFeignClient.java b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/ticketprocess/feign/OperationTicketFeignClient.java index 8070650..19b5ff7 100644 --- a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/ticketprocess/feign/OperationTicketFeignClient.java +++ b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/ticketprocess/feign/OperationTicketFeignClient.java @@ -27,7 +27,7 @@ public interface OperationTicketFeignClient { */ @PostMapping("/operation-ticket/findPending") @ApiOperation(value = "操作票待处理") - public Boolean findPending(@RequestBody ProcessWorkFlowResponse response); + Boolean findPending(@RequestBody ProcessWorkFlowResponse response); diff --git a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/ticketprocess/feign/TicketProcessFeignClient.java b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/ticketprocess/feign/TicketProcessFeignClient.java index f117e90..12cafd5 100644 --- a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/ticketprocess/feign/TicketProcessFeignClient.java +++ b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/ticketprocess/feign/TicketProcessFeignClient.java @@ -28,6 +28,6 @@ public interface TicketProcessFeignClient { */ @PostMapping("/ticket-process/findPending") @ApiOperation(value = "工作票待处理") - public Boolean findPending(@RequestBody ProcessWorkFlowResponse response); + Boolean findPending(@RequestBody ProcessWorkFlowResponse response); } diff --git a/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/HeWeatherInitialize.java b/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/HeWeatherInitialize.java index eea093c..d64427e 100644 --- a/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/HeWeatherInitialize.java +++ b/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/HeWeatherInitialize.java @@ -1,5 +1,7 @@ package com.hnac.hzims.hzimsweather; +import lombok.Getter; + /** * 用户秘钥 * @@ -7,9 +9,13 @@ package com.hnac.hzims.hzimsweather; */ public class HeWeatherInitialize { + @Getter private static String privateKey; + @Getter private static String publicId; + @Getter private static String domain; + @Getter private static String geoDomain; public static void init(String publicId, String privateKey) { @@ -27,19 +33,4 @@ public class HeWeatherInitialize { HeWeatherInitialize.geoDomain = "https://geoapi.heweather.net"; } - public static String getPrivateKey() { - return privateKey; - } - - public static String getPublicId() { - return publicId; - } - - public static String getDomain() { - return domain; - } - - public static String getGeoDomain() { - return geoDomain; - } } diff --git a/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/common/ApiEnum.java b/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/common/ApiEnum.java index d898e08..f3be5b2 100644 --- a/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/common/ApiEnum.java +++ b/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/common/ApiEnum.java @@ -1,9 +1,12 @@ package com.hnac.hzims.hzimsweather.common; +import lombok.Getter; + /** * @author Djc * 接口标识 */ +@Getter public enum ApiEnum { /** @@ -113,7 +116,4 @@ public enum ApiEnum { this.path = path; } - public String getPath() { - return path; - } } diff --git a/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/common/LangEnum.java b/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/common/LangEnum.java index b757b2f..602fed3 100644 --- a/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/common/LangEnum.java +++ b/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/common/LangEnum.java @@ -1,9 +1,12 @@ package com.hnac.hzims.hzimsweather.common; +import lombok.Getter; + /** * @author Djc * 天气标识 */ +@Getter public enum LangEnum { ZH("zh"), ZH_HANT("zh-hant"), @@ -41,7 +44,4 @@ public enum LangEnum { this.lang = lang; } - public String getLang() { - return lang; - } } diff --git a/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/common/PoiTypeEnum.java b/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/common/PoiTypeEnum.java index b392cf3..39f3817 100644 --- a/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/common/PoiTypeEnum.java +++ b/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/common/PoiTypeEnum.java @@ -1,5 +1,8 @@ package com.hnac.hzims.hzimsweather.common; +import lombok.Getter; + +@Getter public enum PoiTypeEnum { SCENIC("scenic"); @@ -10,7 +13,4 @@ public enum PoiTypeEnum { this.type = type; } - public String getType() { - return type; - } } diff --git a/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/common/StatusEnum.java b/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/common/StatusEnum.java index 3ff22cf..37103a9 100644 --- a/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/common/StatusEnum.java +++ b/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/common/StatusEnum.java @@ -17,7 +17,7 @@ public enum StatusEnum implements ApiStatus { INTERNAL_ERROR("500"), UNKNOWN("999"); - private String code; + private final String code; StatusEnum(String code) { this.code = code; diff --git a/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/common/UnitEnum.java b/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/common/UnitEnum.java index f574d57..37f83f5 100644 --- a/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/common/UnitEnum.java +++ b/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/common/UnitEnum.java @@ -1,8 +1,11 @@ package com.hnac.hzims.hzimsweather.common; +import lombok.Getter; + /** * 单位标识 */ +@Getter public enum UnitEnum { /** @@ -20,7 +23,4 @@ public enum UnitEnum { this.unit = unit; } - public String getUnit() { - return unit; - } } diff --git a/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/common/WarningCountryEnum.java b/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/common/WarningCountryEnum.java index 71c0a11..d2a5251 100644 --- a/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/common/WarningCountryEnum.java +++ b/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/common/WarningCountryEnum.java @@ -1,5 +1,8 @@ package com.hnac.hzims.hzimsweather.common; +import lombok.Getter; + +@Getter public enum WarningCountryEnum { CHINA("cn"); @@ -9,7 +12,4 @@ public enum WarningCountryEnum { this.country = country; } - public String getCountry() { - return country; - } } diff --git a/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/constants/WeatherConstant.java b/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/constants/WeatherConstant.java index aa3df77..41cefe3 100644 --- a/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/constants/WeatherConstant.java +++ b/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/constants/WeatherConstant.java @@ -15,7 +15,8 @@ public interface WeatherConstant { /** * 天气数据保存枚举(key-方法) */ - @AllArgsConstructor + @Getter + @AllArgsConstructor @NoArgsConstructor enum WeatherMethodKeyEnum { WEATHER_3D("hzims:weather:station:3dWeather","getWeather3d"), @@ -24,7 +25,6 @@ public interface WeatherConstant { WEATHER_15D("hzims:weather:station:15dWeather","getWeather15d"), WEATHER_NOW("hzims:weather:station:nowWeather","getWeatherNow"), ; - @Getter private String key; @Getter private String method; diff --git a/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/HeWeatherGeoResponse.java b/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/HeWeatherGeoResponse.java index 1bb9633..2968ee9 100644 --- a/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/HeWeatherGeoResponse.java +++ b/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/HeWeatherGeoResponse.java @@ -3,10 +3,12 @@ package com.hnac.hzims.hzimsweather.response; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.hnac.hzims.hzimsweather.common.StatusEnum; import com.hnac.hzims.hzimsweather.common.jackson.StatusDeserializer; +import lombok.Getter; /** * 城市信息搜索 */ +@Getter public class HeWeatherGeoResponse { @JsonDeserialize(using = StatusDeserializer.class) @@ -20,18 +22,10 @@ public class HeWeatherGeoResponse { this.code = statusEnum; } - public StatusEnum getCode() { - return code; - } - public void setCode(StatusEnum code) { this.code = code; } - public Refer getRefer() { - return refer; - } - public void setRefer(Refer refer) { this.refer = refer; } diff --git a/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/HeWeatherResponse.java b/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/HeWeatherResponse.java index 81208d6..86ec8a6 100644 --- a/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/HeWeatherResponse.java +++ b/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/HeWeatherResponse.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.hnac.hzims.hzimsweather.common.StatusEnum; import com.hnac.hzims.hzimsweather.common.jackson.StatusDeserializer; import com.hnac.hzims.hzimsweather.common.jackson.ZonedDatetimeDeserializer; +import lombok.Getter; import org.springblade.core.tool.utils.DateUtil; import org.springframework.format.annotation.DateTimeFormat; @@ -17,6 +18,7 @@ import java.util.Map; * * @author djc */ +@Getter public class HeWeatherResponse implements Serializable { @JsonDeserialize(using = StatusDeserializer.class) @@ -30,11 +32,7 @@ public class HeWeatherResponse implements Serializable { private String fxLink; private Refer refer; - public Map getExpand() { - return expand; - } - - public void setExpand(Map expand) { + public void setExpand(Map expand) { this.expand = expand; } @@ -48,34 +46,18 @@ public class HeWeatherResponse implements Serializable { } - public StatusEnum getCode() { - return code; - } - public void setCode(StatusEnum code) { this.code = code; } - public ZonedDateTime getUpdateTime() { - return updateTime; - } - public void setUpdateTime(ZonedDateTime updateTime) { this.updateTime = updateTime; } - public String getFxLink() { - return fxLink; - } - public void setFxLink(String fxLink) { this.fxLink = fxLink; } - public Refer getRefer() { - return refer; - } - public void setRefer(Refer refer) { this.refer = refer; } diff --git a/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/Refer.java b/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/Refer.java index 68d8b94..c1836f6 100644 --- a/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/Refer.java +++ b/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/Refer.java @@ -1,27 +1,22 @@ package com.hnac.hzims.hzimsweather.response; +import lombok.Getter; + import java.util.List; /** * @author djc */ +@Getter public class Refer { private List sources; private List license; - public List getSources() { - return sources; - } - public void setSources(List sources) { this.sources = sources; } - public List getLicense() { - return license; - } - public void setLicense(List license) { this.license = license; } diff --git a/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/air/HeWeatherAirNowResponse.java b/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/air/HeWeatherAirNowResponse.java index d842175..4284a1c 100644 --- a/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/air/HeWeatherAirNowResponse.java +++ b/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/air/HeWeatherAirNowResponse.java @@ -3,6 +3,7 @@ package com.hnac.hzims.hzimsweather.response.air; import com.hnac.hzims.hzimsweather.common.StatusEnum; import com.hnac.hzims.hzimsweather.response.HeWeatherResponse; +import lombok.Getter; import java.util.List; @@ -10,6 +11,7 @@ import java.util.List; * 返回实体类 * @author hx */ +@Getter public class HeWeatherAirNowResponse extends HeWeatherResponse { private Now now; @@ -22,18 +24,10 @@ public class HeWeatherAirNowResponse extends HeWeatherResponse { super(statusEnum); } - public Now getNow() { - return now; - } - public void setNow(Now now) { this.now = now; } - public List getStation() { - return station; - } - public void setStation(List station) { this.station = station; } diff --git a/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/geo/City.java b/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/geo/City.java index 57d6b21..dedfda8 100644 --- a/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/geo/City.java +++ b/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/geo/City.java @@ -1,8 +1,11 @@ package com.hnac.hzims.hzimsweather.response.geo; +import lombok.Getter; + /** * 城市信息搜索 */ +@Getter public class City { private String name; private String id; @@ -18,106 +21,54 @@ public class City { private String rank; private String fxLink; - public String getName() { - return name; - } - public void setName(String name) { this.name = name; } - public String getId() { - return id; - } - public void setId(String id) { this.id = id; } - public String getLat() { - return lat; - } - public void setLat(String lat) { this.lat = lat; } - public String getLon() { - return lon; - } - public void setLon(String lon) { this.lon = lon; } - public String getAdm2() { - return adm2; - } - public void setAdm2(String adm2) { this.adm2 = adm2; } - public String getAdm1() { - return adm1; - } - public void setAdm1(String adm1) { this.adm1 = adm1; } - public String getCountry() { - return country; - } - public void setCountry(String country) { this.country = country; } - public String getTz() { - return tz; - } - public void setTz(String tz) { this.tz = tz; } - public String getUtcOffset() { - return utcOffset; - } - public void setUtcOffset(String utcOffset) { this.utcOffset = utcOffset; } - public String getIsDst() { - return isDst; - } - public void setIsDst(String isDst) { this.isDst = isDst; } - public String getType() { - return type; - } - public void setType(String type) { this.type = type; } - public String getRank() { - return rank; - } - public void setRank(String rank) { this.rank = rank; } - public String getFxLink() { - return fxLink; - } - public void setFxLink(String fxLink) { this.fxLink = fxLink; } diff --git a/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/geo/HeWeatherLookupResponse.java b/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/geo/HeWeatherLookupResponse.java index 9fd7ef4..4a946a8 100644 --- a/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/geo/HeWeatherLookupResponse.java +++ b/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/geo/HeWeatherLookupResponse.java @@ -3,6 +3,7 @@ package com.hnac.hzims.hzimsweather.response.geo; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.hnac.hzims.hzimsweather.common.StatusEnum; import com.hnac.hzims.hzimsweather.response.HeWeatherGeoResponse; +import lombok.Getter; import java.util.List; @@ -10,6 +11,7 @@ import java.util.List; * @author djc * @date 2020-09-06 16:05:47 */ +@Getter @JsonIgnoreProperties(ignoreUnknown = true) public class HeWeatherLookupResponse extends HeWeatherGeoResponse { @@ -22,10 +24,6 @@ public class HeWeatherLookupResponse extends HeWeatherGeoResponse { super(statusEnum); } - public List getLocation() { - return location; - } - public void setLocation(List location) { this.location = location; } diff --git a/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/geo/HeWeatherPoiResponse.java b/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/geo/HeWeatherPoiResponse.java index a2fe9df..aef46ce 100644 --- a/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/geo/HeWeatherPoiResponse.java +++ b/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/geo/HeWeatherPoiResponse.java @@ -3,6 +3,7 @@ package com.hnac.hzims.hzimsweather.response.geo; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.hnac.hzims.hzimsweather.common.StatusEnum; import com.hnac.hzims.hzimsweather.response.HeWeatherGeoResponse; +import lombok.Getter; import java.util.List; @@ -10,6 +11,7 @@ import java.util.List; * @author djc * @date 2020-09-06 16:05:47 */ +@Getter @JsonIgnoreProperties(ignoreUnknown = true) public class HeWeatherPoiResponse extends HeWeatherGeoResponse { @@ -22,10 +24,6 @@ public class HeWeatherPoiResponse extends HeWeatherGeoResponse { super(statusEnum); } - public List getPoi() { - return poi; - } - public void setPoi(List poi) { this.poi = poi; } diff --git a/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/geo/HeWeatherTopCityResponse.java b/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/geo/HeWeatherTopCityResponse.java index ed2b2b4..108e012 100644 --- a/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/geo/HeWeatherTopCityResponse.java +++ b/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/geo/HeWeatherTopCityResponse.java @@ -3,6 +3,7 @@ package com.hnac.hzims.hzimsweather.response.geo; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.hnac.hzims.hzimsweather.common.StatusEnum; import com.hnac.hzims.hzimsweather.response.HeWeatherGeoResponse; +import lombok.Getter; import java.util.List; @@ -10,6 +11,7 @@ import java.util.List; * @author djc * @date 2020-09-06 16:05:47 */ +@Getter @JsonIgnoreProperties(ignoreUnknown = true) public class HeWeatherTopCityResponse extends HeWeatherGeoResponse { @@ -22,10 +24,6 @@ public class HeWeatherTopCityResponse extends HeWeatherGeoResponse { super(statusEnum); } - public List getTopCityList() { - return topCityList; - } - public void setTopCityList(List topCityList) { this.topCityList = topCityList; } diff --git a/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/history/HeWeatherHistoricalAirResponse.java b/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/history/HeWeatherHistoricalAirResponse.java index e5044d0..519add5 100644 --- a/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/history/HeWeatherHistoricalAirResponse.java +++ b/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/history/HeWeatherHistoricalAirResponse.java @@ -3,12 +3,14 @@ package com.hnac.hzims.hzimsweather.response.history; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.hnac.hzims.hzimsweather.common.StatusEnum; import com.hnac.hzims.hzimsweather.response.HeWeatherResponse; +import lombok.Getter; import java.util.List; /** * 返回实体类 */ +@Getter @JsonIgnoreProperties(ignoreUnknown = true) public class HeWeatherHistoricalAirResponse extends HeWeatherResponse { @@ -21,10 +23,6 @@ public class HeWeatherHistoricalAirResponse extends HeWeatherResponse { super(statusEnum); } - public List getAirHourly() { - return airHourly; - } - public void setAirHourly(List airHourly) { this.airHourly = airHourly; } diff --git a/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/history/HeWeatherHistoricalWeatherResponse.java b/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/history/HeWeatherHistoricalWeatherResponse.java index da9c1b2..2363274 100644 --- a/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/history/HeWeatherHistoricalWeatherResponse.java +++ b/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/history/HeWeatherHistoricalWeatherResponse.java @@ -3,12 +3,14 @@ package com.hnac.hzims.hzimsweather.response.history; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.hnac.hzims.hzimsweather.common.StatusEnum; import com.hnac.hzims.hzimsweather.response.HeWeatherResponse; +import lombok.Getter; import java.util.List; /** * 返回实体类 */ +@Getter @JsonIgnoreProperties(ignoreUnknown = true) public class HeWeatherHistoricalWeatherResponse extends HeWeatherResponse { @@ -22,18 +24,10 @@ public class HeWeatherHistoricalWeatherResponse extends HeWeatherResponse { super(statusEnum); } - public WeatherDaily getWeatherDaily() { - return weatherDaily; - } - public void setWeatherDaily(WeatherDaily weatherDaily) { this.weatherDaily = weatherDaily; } - public List getWeatherHourly() { - return weatherHourly; - } - public void setWeatherHourly(List weatherHourly) { this.weatherHourly = weatherHourly; } diff --git a/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/indices/HeWeatherLifestyleResponse.java b/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/indices/HeWeatherLifestyleResponse.java index 6f73108..0e5465a 100644 --- a/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/indices/HeWeatherLifestyleResponse.java +++ b/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/indices/HeWeatherLifestyleResponse.java @@ -3,12 +3,14 @@ package com.hnac.hzims.hzimsweather.response.indices; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.hnac.hzims.hzimsweather.common.StatusEnum; import com.hnac.hzims.hzimsweather.response.HeWeatherResponse; +import lombok.Getter; import java.util.List; /** * 返回实体类 */ +@Getter @JsonIgnoreProperties(ignoreUnknown = true) public class HeWeatherLifestyleResponse extends HeWeatherResponse { @@ -21,10 +23,6 @@ public class HeWeatherLifestyleResponse extends HeWeatherResponse { super(statusEnum); } - public List getDaily() { - return daily; - } - public void setDaily(List daily) { this.daily = daily; } diff --git a/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/minutely/HeWeatherMinutelyResponse.java b/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/minutely/HeWeatherMinutelyResponse.java index d38912e..23bd205 100644 --- a/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/minutely/HeWeatherMinutelyResponse.java +++ b/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/minutely/HeWeatherMinutelyResponse.java @@ -3,12 +3,14 @@ package com.hnac.hzims.hzimsweather.response.minutely; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.hnac.hzims.hzimsweather.common.StatusEnum; import com.hnac.hzims.hzimsweather.response.HeWeatherResponse; +import lombok.Getter; import java.util.List; /** * 返回实体类 */ +@Getter @JsonIgnoreProperties(ignoreUnknown = true) public class HeWeatherMinutelyResponse extends HeWeatherResponse { @@ -22,18 +24,10 @@ public class HeWeatherMinutelyResponse extends HeWeatherResponse { super(statusEnum); } - public String getSummary() { - return summary; - } - public void setSummary(String summary) { this.summary = summary; } - public List getMinutely() { - return minutely; - } - public void setMinutely(List minutely) { this.minutely = minutely; } diff --git a/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/minutely/Pcpn5m.java b/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/minutely/Pcpn5m.java index 853ab55..31517ea 100644 --- a/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/minutely/Pcpn5m.java +++ b/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/minutely/Pcpn5m.java @@ -2,6 +2,7 @@ package com.hnac.hzims.hzimsweather.response.minutely; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.hnac.hzims.hzimsweather.common.jackson.ZonedDatetimeDeserializer; +import lombok.Getter; import java.time.ZonedDateTime; @@ -9,6 +10,7 @@ import java.time.ZonedDateTime; * @author djc * @date 2020/03/17 18:32 */ +@Getter public class Pcpn5m { @JsonDeserialize(using = ZonedDatetimeDeserializer.class) @@ -16,26 +18,14 @@ public class Pcpn5m { private String precip; private String type; - public ZonedDateTime getFxTime() { - return fxTime; - } - public void setFxTime(ZonedDateTime fxTime) { this.fxTime = fxTime; } - public String getPrecip() { - return precip; - } - public void setPrecip(String precip) { this.precip = precip; } - public String getType() { - return type; - } - public void setType(String type) { this.type = type; } diff --git a/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/poi/HeWeatherPoiDailyResponse.java b/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/poi/HeWeatherPoiDailyResponse.java index f329fff..2320631 100644 --- a/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/poi/HeWeatherPoiDailyResponse.java +++ b/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/poi/HeWeatherPoiDailyResponse.java @@ -3,12 +3,14 @@ package com.hnac.hzims.hzimsweather.response.poi; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.hnac.hzims.hzimsweather.common.StatusEnum; import com.hnac.hzims.hzimsweather.response.HeWeatherResponse; +import lombok.Getter; import java.util.List; /** * 返回实体类 */ +@Getter @JsonIgnoreProperties(ignoreUnknown = true) public class HeWeatherPoiDailyResponse extends HeWeatherResponse { @@ -21,10 +23,6 @@ public class HeWeatherPoiDailyResponse extends HeWeatherResponse { super(statusEnum); } - public List getDaily() { - return daily; - } - public void setDaily(List daily) { this.daily = daily; } diff --git a/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/poi/HeWeatherPoiNowResponse.java b/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/poi/HeWeatherPoiNowResponse.java index acc1a33..67bfa15 100644 --- a/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/poi/HeWeatherPoiNowResponse.java +++ b/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/poi/HeWeatherPoiNowResponse.java @@ -3,10 +3,12 @@ package com.hnac.hzims.hzimsweather.response.poi; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.hnac.hzims.hzimsweather.common.StatusEnum; import com.hnac.hzims.hzimsweather.response.HeWeatherResponse; +import lombok.Getter; /** * 返回实体类 */ +@Getter @JsonIgnoreProperties(ignoreUnknown = true) public class HeWeatherPoiNowResponse extends HeWeatherResponse { @@ -19,10 +21,6 @@ public class HeWeatherPoiNowResponse extends HeWeatherResponse { super(statusEnum); } - public Now getNow() { - return now; - } - public void setNow(Now now) { this.now = now; } diff --git a/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/warning/HeWeatherWarningListResponse.java b/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/warning/HeWeatherWarningListResponse.java index 94f0e7e..6382eeb 100644 --- a/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/warning/HeWeatherWarningListResponse.java +++ b/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/warning/HeWeatherWarningListResponse.java @@ -3,12 +3,14 @@ package com.hnac.hzims.hzimsweather.response.warning; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.hnac.hzims.hzimsweather.common.StatusEnum; import com.hnac.hzims.hzimsweather.response.HeWeatherResponse; +import lombok.Getter; import java.util.List; /** * 返回实体类 */ +@Getter @JsonIgnoreProperties(ignoreUnknown = true) public class HeWeatherWarningListResponse extends HeWeatherResponse { @@ -21,10 +23,6 @@ public class HeWeatherWarningListResponse extends HeWeatherResponse { super(statusEnum); } - public List getWarningLocList() { - return warningLocList; - } - public void setWarningLocList(List warningLocList) { this.warningLocList = warningLocList; } diff --git a/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/warning/HeWeatherWarningResponse.java b/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/warning/HeWeatherWarningResponse.java index 91acefb..e7a4897 100644 --- a/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/warning/HeWeatherWarningResponse.java +++ b/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/warning/HeWeatherWarningResponse.java @@ -3,12 +3,14 @@ package com.hnac.hzims.hzimsweather.response.warning; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.hnac.hzims.hzimsweather.common.StatusEnum; import com.hnac.hzims.hzimsweather.response.HeWeatherResponse; +import lombok.Getter; import java.util.List; /** * 返回实体类 */ +@Getter @JsonIgnoreProperties(ignoreUnknown = true) public class HeWeatherWarningResponse extends HeWeatherResponse { @@ -21,10 +23,6 @@ public class HeWeatherWarningResponse extends HeWeatherResponse { super(statusEnum); } - public List getWarning() { - return warning; - } - public void setWarning(List warning) { this.warning = warning; } diff --git a/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/weather/HeWeatherWeatherDailyResponse.java b/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/weather/HeWeatherWeatherDailyResponse.java index 6a4c96b..32f09d3 100644 --- a/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/weather/HeWeatherWeatherDailyResponse.java +++ b/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/weather/HeWeatherWeatherDailyResponse.java @@ -3,6 +3,7 @@ package com.hnac.hzims.hzimsweather.response.weather; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.hnac.hzims.hzimsweather.common.StatusEnum; import com.hnac.hzims.hzimsweather.response.HeWeatherResponse; +import lombok.Getter; import java.io.Serializable; import java.util.List; @@ -10,6 +11,7 @@ import java.util.List; /** * 返回实体类 */ +@Getter @JsonIgnoreProperties(ignoreUnknown = true) public class HeWeatherWeatherDailyResponse extends HeWeatherResponse implements Serializable { @@ -22,10 +24,6 @@ public class HeWeatherWeatherDailyResponse extends HeWeatherResponse implements super(statusEnum); } - public List getDaily() { - return daily; - } - public void setDaily(List daily) { this.daily = daily; } diff --git a/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/weather/HeWeatherWeatherHourlyResponse.java b/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/weather/HeWeatherWeatherHourlyResponse.java index 2680a3a..5221a14 100644 --- a/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/weather/HeWeatherWeatherHourlyResponse.java +++ b/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/weather/HeWeatherWeatherHourlyResponse.java @@ -3,6 +3,7 @@ package com.hnac.hzims.hzimsweather.response.weather; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.hnac.hzims.hzimsweather.common.StatusEnum; import com.hnac.hzims.hzimsweather.response.HeWeatherResponse; +import lombok.Getter; import java.io.Serializable; import java.util.List; @@ -11,6 +12,7 @@ import java.util.List; * 返回实体类 * @author hx */ +@Getter @JsonIgnoreProperties(ignoreUnknown = true) public class HeWeatherWeatherHourlyResponse extends HeWeatherResponse implements Serializable { @@ -23,10 +25,6 @@ public class HeWeatherWeatherHourlyResponse extends HeWeatherResponse implements super(statusEnum); } - public List getHourly() { - return hourly; - } - public void setHourly(List hourly) { this.hourly = hourly; } diff --git a/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/weather/HeWeatherWeatherNowResponse.java b/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/weather/HeWeatherWeatherNowResponse.java index 2da5544..3ab7bfa 100644 --- a/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/weather/HeWeatherWeatherNowResponse.java +++ b/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/response/weather/HeWeatherWeatherNowResponse.java @@ -3,6 +3,7 @@ package com.hnac.hzims.hzimsweather.response.weather; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.hnac.hzims.hzimsweather.common.StatusEnum; import com.hnac.hzims.hzimsweather.response.HeWeatherResponse; +import lombok.Getter; import java.io.Serializable; @@ -10,6 +11,7 @@ import java.io.Serializable; * 返回实体类 * @author 86187 */ +@Getter @JsonIgnoreProperties(ignoreUnknown = true) public class HeWeatherWeatherNowResponse extends HeWeatherResponse implements Serializable { @@ -22,10 +24,6 @@ public class HeWeatherWeatherNowResponse extends HeWeatherResponse implements Se super(statusEnum); } - public Now getNow() { - return now; - } - public void setNow(Now now) { this.now = now; } diff --git a/hzims-service/assets/src/main/java/com/hnac/hzims/spare/aspect/LimitRemindAspect.java b/hzims-service/assets/src/main/java/com/hnac/hzims/spare/aspect/LimitRemindAspect.java index 981f9f7..a65e58a 100644 --- a/hzims-service/assets/src/main/java/com/hnac/hzims/spare/aspect/LimitRemindAspect.java +++ b/hzims-service/assets/src/main/java/com/hnac/hzims/spare/aspect/LimitRemindAspect.java @@ -265,7 +265,7 @@ public class LimitRemindAspect { appPushDto.setSubject("库存预警"); appPushDto.setTitle("库存预警"); appPushDto.setAudienceType(PushAudienceType.TAG); - appPushDto.setTags(Lists.newArrayList(new String[]{pusher.getId().toString()})); + appPushDto.setTags(Lists.newArrayList(pusher.getId().toString())); //FIXME 因feign接口请求头丢失 登录信息失效先启用未登陆方式 appPushDto.setTenantId("200000"); appPushDto.setCreateUser(1380746947515691009L); @@ -288,7 +288,7 @@ public class LimitRemindAspect { wsPushDto.setContent(alert); wsPushDto.setSubject("库存预警"); wsPushDto.setSubject("备品备件预警信息"); - wsPushDto.setUserIdList(Lists.newArrayList(new String[]{pusher.getId().toString()})); + wsPushDto.setUserIdList(Lists.newArrayList(pusher.getId().toString())); wsPushDto.setText(alert); //FIXME 因feign接口请求头丢失 登录信息失效先启用未登陆方式 wsPushDto.setTenantId("200000"); diff --git a/hzims-service/assets/src/main/java/com/hnac/hzims/spare/service/impl/WtSpBasicServiceImpl.java b/hzims-service/assets/src/main/java/com/hnac/hzims/spare/service/impl/WtSpBasicServiceImpl.java index 700ad53..86f64bd 100644 --- a/hzims-service/assets/src/main/java/com/hnac/hzims/spare/service/impl/WtSpBasicServiceImpl.java +++ b/hzims-service/assets/src/main/java/com/hnac/hzims/spare/service/impl/WtSpBasicServiceImpl.java @@ -510,7 +510,7 @@ public class WtSpBasicServiceImpl extends BaseServiceImpl> select(@RequestParam(value = "deptId",required = false) Long deptId) { return R.data(em_infoService.select(deptId)); } diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/EmInfoServiceImpl.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/EmInfoServiceImpl.java index 07ffcff..98a220a 100644 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/EmInfoServiceImpl.java +++ b/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/EmInfoServiceImpl.java @@ -430,8 +430,7 @@ public class EmInfoServiceImpl extends BaseServiceImpl emInfoList = this.list(queryWrapper); List result = emInfoList.stream().map(emInfoEntity -> { JSONObject object = JSONObject.parseObject(JSON.toJSONString(emInfoEntity)); - object.put("disabled", emCodes.contains(emInfoEntity.getNumber()) ? false : true); + object.put("disabled", !emCodes.contains(emInfoEntity.getNumber())); object.put("children",this.getEmInfoTree(deptId,emInfoEntity.getNumber(),emCodes)); return object; }).collect(Collectors.toList()); 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 a2e128d..6b38ea7 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("create_dept".equals(columnMap.get("COLUMN_NAME").toString().toLowerCase())) { + if("create_dept".equalsIgnoreCase(columnMap.get("COLUMN_NAME").toString())) { flag = true; break; } @@ -109,7 +109,7 @@ public class UpdateDeptIdServiceImpl extends BaseServiceImpl columnMap : tableColumns) { - if("tenant_id".equals(columnMap.get("COLUMN_NAME").toString().toLowerCase())) { + if("tenant_id".equalsIgnoreCase(columnMap.get("COLUMN_NAME").toString())) { flag = true; break; } @@ -141,10 +141,10 @@ public class UpdateDeptIdServiceImpl extends BaseServiceImpl columnMap : tableColumns) { - if("tenant_id".equals(columnMap.get("COLUMN_NAME").toString().toLowerCase())) { + if("tenant_id".equalsIgnoreCase(columnMap.get("COLUMN_NAME").toString())) { hasColumnCount++; } - if("create_dept".equals(columnMap.get("COLUMN_NAME").toString().toLowerCase())) { + if("create_dept".equalsIgnoreCase(columnMap.get("COLUMN_NAME").toString())) { hasColumnCount++; } } diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/scheduled/ThreadTask.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/scheduled/ThreadTask.java index 08920bd..f6fe355 100644 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/scheduled/ThreadTask.java +++ b/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/scheduled/ThreadTask.java @@ -159,7 +159,7 @@ public class ThreadTask { r1.setCode(fdpHttpResponseVo.getCode()); r1.setMsg(fdpHttpResponseVo.getMessage()); r1.setData(r1.getData()); - r1.setSuccess(fdpHttpResponseVo.getSuccess() == 1 ? true : false); + r1.setSuccess(fdpHttpResponseVo.getSuccess() == 1); diagnoseStatusVo.setStatus(3); diagnoseStatusVo.setMessage("数据推送完成"); r2.setData(diagnoseStatusVo); @@ -234,7 +234,7 @@ public class ThreadTask { r1.setCode(fdpHttpResponseVo.getCode()); r1.setMsg(fdpHttpResponseVo.getMessage()); r1.setData(r1.getData()); - r1.setSuccess(fdpHttpResponseVo.getSuccess() == 1 ? true : false); + r1.setSuccess(fdpHttpResponseVo.getSuccess() == 1); diagnoseStatusVo.setStatus(3); diagnoseStatusVo.setMessage("数据推送完成"); r2.setData(diagnoseStatusVo); 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 041b7b6..b1fabda 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 @@ -597,7 +597,7 @@ public class FdpMonitorServiceImpl extends BaseServiceImpl map, FdpMonitorEntity fdpMonitorEntity, List data) { - Float flo[] = new Float[fdpMonitorEntity.getImsRealIds().split(",").length]; + Float[] flo = new Float[fdpMonitorEntity.getImsRealIds().split(",").length]; int count = 0; if ("float[]".equals(fdpMonitorEntity.getCallbackType())) { for (int i = 0; i < data.size(); i++) { @@ -1419,7 +1419,7 @@ public class FdpMonitorServiceImpl extends BaseServiceImpl res, Integer level, String name, Integer size, Integer all) { TaskStatisticsVo taskStatisticsByDeviceName = new TaskStatisticsVo(); taskStatisticsByDeviceName.setCount(size); - BigDecimal bigDecimal = BigDecimal.valueOf(all).divide(BigDecimal.valueOf(size), 2, BigDecimal.ROUND_UP); + BigDecimal bigDecimal = BigDecimal.valueOf(all).divide(BigDecimal.valueOf(size), 2, RoundingMode.UP); taskStatisticsByDeviceName.setPercentage(bigDecimal.toString()); taskStatisticsByDeviceName.setLevel(level); taskStatisticsByDeviceName.setMemuName(name); @@ -305,10 +306,10 @@ public class FdpTaskServiceImpl extends BaseServiceImpl { TaskStatisticsVo taskStatisticsVo = new TaskStatisticsVo(); taskStatisticsVo.setCount(s.getValue().size()); - BigDecimal bigDecimal = BigDecimal.valueOf(s.getValue().size()).divide(BigDecimal.valueOf(fdpTaskEntities.size()), 2, BigDecimal.ROUND_UP); + BigDecimal bigDecimal = BigDecimal.valueOf(s.getValue().size()).divide(BigDecimal.valueOf(fdpTaskEntities.size()), 2, RoundingMode.UP); taskStatisticsVo.setPercentage(bigDecimal.toString()); taskStatisticsVo.setLevel(level); - taskStatisticsVo.setMemuName(key + "-" + s.getKey().toString()); + taskStatisticsVo.setMemuName(key + "-" + s.getKey()); res.add(taskStatisticsVo); }); } diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/monitor/enums/PointType.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/monitor/enums/PointType.java index e20428b..122ea89 100644 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/monitor/enums/PointType.java +++ b/hzims-service/equipment/src/main/java/com/hnac/hzims/monitor/enums/PointType.java @@ -1,5 +1,8 @@ package com.hnac.hzims.monitor.enums; +import lombok.Getter; + +@Getter public enum PointType { IsNull(0, "空节点"), IsYc(1, "遥测点"), IsYx(2, "遥信点"), IsYk(3, "遥控点"), IsSoe(4, "告警点"), group(5, "组"), factory(6, "厂"), ycGroup(7, "遥测组"), yxGroup(8, "遥信组"), ykGroup(9, "遥控组"), soeGroup(10, "告警组"), IsStr(11, "字符串点"),strGroup(11,"字符串组"); private int code; @@ -12,18 +15,10 @@ public enum PointType { this.desc = desc; } - public int getCode() { - return code; - } - public void setCode(int code) { this.code = code; } - public String getDesc() { - return desc; - } - public void setDesc(String desc) { this.desc = desc; } diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/monitor/enums/SaveTimeType.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/monitor/enums/SaveTimeType.java index 5adaee9..47da2d4 100644 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/monitor/enums/SaveTimeType.java +++ b/hzims-service/equipment/src/main/java/com/hnac/hzims/monitor/enums/SaveTimeType.java @@ -1,5 +1,8 @@ package com.hnac.hzims.monitor.enums; +import lombok.Getter; + +@Getter public enum SaveTimeType { Minute(0, "分"), Time(1, "时"), Sky(2, "天"), Month(3, "月"), Year(4, "年"); @@ -11,19 +14,11 @@ public enum SaveTimeType { this.desc = desc; } - public int getCode() { - return code; - } - - public void setCode(int code) { + public void setCode(int code) { this.code = code; } - public String getDesc() { - return desc; - } - - public void setDesc(String desc) { + public void setDesc(String desc) { this.desc = desc; } } 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 39554bb..4d0174e 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 @@ -55,7 +55,7 @@ public abstract class HttpClientUtils { try { sc = SSLContext.getInstance("SSLv3"); - sc.init((KeyManager[]) null, new TrustManager[]{new X509TrustManager() { + sc.init(null, new TrustManager[]{new X509TrustManager() { @Override public void checkClientTrusted(X509Certificate[] paramArrayOfX509Certificate, String paramString) throws CertificateException { } @@ -68,7 +68,7 @@ public abstract class HttpClientUtils { public X509Certificate[] getAcceptedIssuers() { return null; } - }}, (SecureRandom) null); + }}, null); } catch (NoSuchAlgorithmException var3) { var3.printStackTrace(); } catch (KeyManagementException var2) { @@ -328,7 +328,7 @@ public abstract class HttpClientUtils { while ((ch = is.read(buffer)) != -1) { bytestream.write(buffer, 0, ch); } - byte data[] = bytestream.toByteArray(); + byte[] data = bytestream.toByteArray(); bytestream.close(); return data; } diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/util/MemoryPagination.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/util/MemoryPagination.java index f03edce..f356cf4 100644 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/util/MemoryPagination.java +++ b/hzims-service/equipment/src/main/java/com/hnac/hzims/util/MemoryPagination.java @@ -27,12 +27,12 @@ public class MemoryPagination { int remainder = totalCount % pageSize; int pageCount = (remainder > 0) ? totalCount / pageSize + 1 : totalCount / pageSize; if (remainder == 0) { - return records.stream().skip((pageNum - 1) * pageSize).limit(pageSize).collect(Collectors.toList()); + return records.stream().skip((long) (pageNum - 1) * pageSize).limit(pageSize).collect(Collectors.toList()); } else { if (pageNum == pageCount) { - return records.stream().skip((pageNum - 1) * pageSize).limit(totalCount).collect(Collectors.toList()); + return records.stream().skip((long) (pageNum - 1) * pageSize).limit(totalCount).collect(Collectors.toList()); } else { - return records.stream().skip((pageNum - 1) * pageSize).limit(pageSize).collect(Collectors.toList()); + return records.stream().skip((long) (pageNum - 1) * pageSize).limit(pageSize).collect(Collectors.toList()); } } } diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/util/TableJsonUtils.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/util/TableJsonUtils.java index f111cf7..bb0a795 100644 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/util/TableJsonUtils.java +++ b/hzims-service/equipment/src/main/java/com/hnac/hzims/util/TableJsonUtils.java @@ -4,11 +4,12 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.*; +import java.nio.charset.StandardCharsets; public class TableJsonUtils { // 获取日志输出对象 - private static Logger logger = LoggerFactory.getLogger(TableJsonUtils.class); + private static final Logger logger = LoggerFactory.getLogger(TableJsonUtils.class); @@ -90,7 +91,7 @@ public class TableJsonUtils { } sb.append(" OFFLINE_FLAG VARCHAR(2) DEFAULT '0')"); // 拼接完整的建表语句 - createTableSql = createTableSql.substring(0, firstParenthesesIndex+1) + sb.toString(); + createTableSql = createTableSql.substring(0, firstParenthesesIndex+1) + sb; // 转成成大写 createTableSql = createTableSql.toUpperCase(); logger.info("建表语句净化后="+createTableSql); @@ -138,7 +139,7 @@ public class TableJsonUtils { /** * 单位缩进字符串。 */ - private static String SPACE = " "; + private static final String SPACE = " "; /** * 生成.json格式文件 */ @@ -183,7 +184,7 @@ public class TableJsonUtils { // jsonString = this.formatJson(jsonString); // 将格式化后的字符串写入文件 - Writer write = new OutputStreamWriter(new FileOutputStream(file), "UTF-8"); + Writer write = new OutputStreamWriter(new FileOutputStream(file), StandardCharsets.UTF_8); write.write(jsonString); write.flush(); write.close(); @@ -208,7 +209,7 @@ public class TableJsonUtils { try { File jsonFile = new File(fileName); FileReader fileReader = new FileReader(jsonFile); - Reader reader = new InputStreamReader(new FileInputStream(jsonFile),"utf-8"); + Reader reader = new InputStreamReader(new FileInputStream(jsonFile), StandardCharsets.UTF_8); int ch = 0; StringBuffer sb = new StringBuffer(); while ((ch = reader.read()) != -1) { diff --git a/hzims-service/equipment/src/test/java/com/hnac/hzims/equipment/service/IEmOreanizationServiceTest.java b/hzims-service/equipment/src/test/java/com/hnac/hzims/equipment/service/IEmOreanizationServiceTest.java index 23a477c..6833a06 100644 --- a/hzims-service/equipment/src/test/java/com/hnac/hzims/equipment/service/IEmOreanizationServiceTest.java +++ b/hzims-service/equipment/src/test/java/com/hnac/hzims/equipment/service/IEmOreanizationServiceTest.java @@ -9,6 +9,7 @@ import javax.crypto.Cipher; import javax.crypto.KeyGenerator; import javax.crypto.spec.SecretKeySpec; import java.math.BigInteger; +import java.nio.charset.StandardCharsets; public class IEmOreanizationServiceTest { @@ -95,7 +96,7 @@ public class IEmOreanizationServiceTest { Cipher cipher = Cipher.getInstance(ALGORITHMSTR); cipher.init(Cipher.ENCRYPT_MODE, new SecretKeySpec(encryptKey.getBytes(), "AES")); - return cipher.doFinal(content.getBytes("utf-8")); + return cipher.doFinal(content.getBytes(StandardCharsets.UTF_8)); } @@ -125,7 +126,7 @@ public class IEmOreanizationServiceTest { Cipher cipher = Cipher.getInstance(ALGORITHMSTR); cipher.init(Cipher.DECRYPT_MODE, new SecretKeySpec(decryptKey.getBytes(), "AES")); byte[] decryptBytes = cipher.doFinal(encryptBytes); - return new String(decryptBytes,"utf-8"); //指定编码格式,防止tomcat未指定编码格式导致中文乱码 + return new String(decryptBytes, StandardCharsets.UTF_8); //指定编码格式,防止tomcat未指定编码格式导致中文乱码 } diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/AlarmHandleFlowServiceImpl.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/AlarmHandleFlowServiceImpl.java index 88ccba6..75e4b2f 100644 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/AlarmHandleFlowServiceImpl.java +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/AlarmHandleFlowServiceImpl.java @@ -73,7 +73,7 @@ public class AlarmHandleFlowServiceImpl extends BaseServiceImpl map = new HashMap<>(); map.put("uuid", alarmHandleFlowEntity.getAlarmId()); - if (1l == alarmHandleFlowEntity.getHandleWay()) { + if (1L == alarmHandleFlowEntity.getHandleWay()) { //如果是误诊,把处理结果复制到误报原因 alarmHandleFlowEntity.setFalseAlarmDesc(alarmHandleFlowEntity.getDealDesc()); alarmHandleMapper.update(null, Wrappers.lambdaUpdate() @@ -83,7 +83,7 @@ public class AlarmHandleFlowServiceImpl extends BaseServiceImpllambdaUpdate() .set(AlarmHandleEntity::getHandleWay, alarmHandleFlowEntity.getHandleWay()) .set(AlarmHandleEntity::getDelayCause, alarmHandleFlowEntity.getDelayCause()) @@ -97,7 +97,7 @@ public class AlarmHandleFlowServiceImpl extends BaseServiceImpllambdaUpdate() - .set(AlarmHandleEntity::getHandleWay, 6l) + .set(AlarmHandleEntity::getHandleWay, 6L) .set(AlarmHandleEntity::getFalseAlarmDesc, alarmHandleFlowEntity.getDealDesc()) .eq(AlarmHandleEntity::getAlarmId, alarmHandleFlowEntity.getAlarmId())); map.put("result", "处理完成"); diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/AlarmHandleServiceImpl.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/AlarmHandleServiceImpl.java index 17310fe..bc15768 100644 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/AlarmHandleServiceImpl.java +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/AlarmHandleServiceImpl.java @@ -101,10 +101,10 @@ public class AlarmHandleServiceImpl extends BaseServiceImpl map=new HashMap<>(); map.put("uuid",param.getAlarmId()); - if (1l==way){ + if (1L ==way){ map.put("result","误报"); map.put("diag_solution",param.getFalseAlarmDesc()); - } else if (2l==way){ + } else if (2L ==way){ map.put("result","延后处理"); map.put("result_info",param.getDelayCause()); }else { diff --git a/hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/controller/PresonManagementController.java b/hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/controller/PresonManagementController.java index 51334ae..9b9e548 100644 --- a/hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/controller/PresonManagementController.java +++ b/hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/controller/PresonManagementController.java @@ -102,7 +102,7 @@ public class PresonManagementController extends BladeController { .doWrite(list); } } catch (Exception e) { - System.out.println("exportExcel = " + e.toString()); + System.out.println("exportExcel = " + e); // 重置response response.reset(); response.setContentType("application/json"); @@ -113,7 +113,7 @@ public class PresonManagementController extends BladeController { try { response.getWriter().println(JSONUtils.toJSONString(map)); } catch (IOException e3) { - throw new ServiceException( "发生异常 :" + e.toString()); + throw new ServiceException( "发生异常 :" + e); } } } diff --git a/hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/utils/CertificatetType.java b/hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/utils/CertificatetType.java index 041f5fe..8043aee 100644 --- a/hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/utils/CertificatetType.java +++ b/hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/utils/CertificatetType.java @@ -7,6 +7,7 @@ import lombok.Getter; * 证书类型 * @author ty */ +@Getter public enum CertificatetType { /** @@ -28,11 +29,10 @@ public enum CertificatetType * 桥机证 */ Bridge("4","桥机证"); - @Getter - private String value; + private final String value; @Getter - private String key; + private final String key; CertificatetType(String value, String key){ this.key = key; diff --git a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/core/ProcessIdWorker.java b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/core/ProcessIdWorker.java index 061f096..eb0b2c9 100644 --- a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/core/ProcessIdWorker.java +++ b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/core/ProcessIdWorker.java @@ -29,13 +29,13 @@ import java.util.concurrent.atomic.AtomicInteger; @Component public class ProcessIdWorker { - private static Map cacheMap = new HashMap<>(); + private static final Map cacheMap = new HashMap<>(); @Autowired private StringRedisTemplate redisTemplate; - private static NumberFormat numberFormatter; + private static final NumberFormat numberFormatter; static { diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/DutyNoticeScheduledTask.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/DutyNoticeScheduledTask.java index 1fc6b8e..f651a03 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/DutyNoticeScheduledTask.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/DutyNoticeScheduledTask.java @@ -67,9 +67,7 @@ public class DutyNoticeScheduledTask { List deptAndSendNotice3 = service.getDeptByMainDate(dateAddThree); //去除一天后有排版计划部门 for (Long deptIdByDayOne : deptAndSendNotice1) { - if (deptByDate.contains(deptIdByDayOne)) { - deptByDate.remove(deptIdByDayOne); - } + deptByDate.remove(deptIdByDayOne); } sendMessage(deptByDate, 1); //去除二天有排版计划的部门 diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/impl/AlarmQueryServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/impl/AlarmQueryServiceImpl.java index 1902bd2..dbcd506 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/impl/AlarmQueryServiceImpl.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/impl/AlarmQueryServiceImpl.java @@ -48,7 +48,7 @@ public class AlarmQueryServiceImpl extends BaseServiceImpl startStopMap = (HashMap) redisTemplate.opsForValue().get(start_stop_cache_final);; + Map startStopMap = (HashMap) redisTemplate.opsForValue().get(start_stop_cache_final); // 查询接入水电站点 List stations = stationService.list(new LambdaQueryWrapper() diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/RealTargetServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/RealTargetServiceImpl.java index 79b3e3a..8d7cb11 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/RealTargetServiceImpl.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/RealTargetServiceImpl.java @@ -45,6 +45,7 @@ import org.springframework.data.redis.core.RedisTemplate; import org.springframework.stereotype.Service; import java.math.BigDecimal; +import java.math.RoundingMode; import java.util.*; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -819,7 +820,7 @@ public class RealTargetServiceImpl implements RealTargetService { waterRunVo.setCount(count); // 开机运行时长 long time = this.getRunTime(result,startDate,endDate); - waterRunVo.setHour(BigDecimal.valueOf(time / (1000 * 60 * 60.00)).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue()); + waterRunVo.setHour(BigDecimal.valueOf(time / (1000 * 60 * 60.00)).setScale(2, RoundingMode.HALF_UP).doubleValue()); return waterRunVo; } @@ -1365,7 +1366,7 @@ public class RealTargetServiceImpl implements RealTargetService { } // 开机运行时长 long time = this.getRunTime(result, start, end); - return BigDecimal.valueOf(time / (1000 * 60 * 60.00)).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); + return BigDecimal.valueOf(time / (1000 * 60 * 60.00)).setScale(2, RoundingMode.HALF_UP).doubleValue(); } /** diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/ShowServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/ShowServiceImpl.java index 6bbffe2..a3af3a5 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/ShowServiceImpl.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/ShowServiceImpl.java @@ -53,6 +53,7 @@ import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.math.BigDecimal; +import java.math.RoundingMode; import java.net.HttpURLConnection; import java.net.URL; import java.nio.charset.StandardCharsets; @@ -235,7 +236,7 @@ public class ShowServiceImpl implements ShowService { if(CollectionUtil.isNotEmpty(plans)){ double plan = plans.stream().mapToDouble(PlanGenerationEntity::getPlanGeneration).sum(); if(Math.abs(plan) > 0){ - target.setTaget_three(BigDecimal.valueOf(target.getTaget_two() / plan * 100).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue()); + target.setTaget_three(BigDecimal.valueOf(target.getTaget_two() / plan * 100).setScale(2, RoundingMode.HALF_UP).doubleValue()); } } } @@ -335,10 +336,10 @@ public class ShowServiceImpl implements ShowService { target.setTaget_two(list.stream().mapToDouble(PowerEntity::getPowerMon).sum()); if(Math.abs(plan) > 0){ // 发电完成率 - target.setTaget_three(BigDecimal.valueOf(target.getTaget_two() / plan * 100).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue()); + target.setTaget_three(BigDecimal.valueOf(target.getTaget_two() / plan * 100).setScale(2, RoundingMode.HALF_UP).doubleValue()); } // 双票合格率 - target.setTaget_four(BigDecimal.valueOf(pass / list.size()).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue()); + target.setTaget_four(BigDecimal.valueOf(pass / list.size()).setScale(2, RoundingMode.HALF_UP).doubleValue()); return target; } @@ -388,7 +389,7 @@ public class ShowServiceImpl implements ShowService { exe.execute(() -> { OverhaulVo overhaul = accessService.overhaul_count(areas,DateUtil.format(DateUtil.toDate(firstDateTime.toLocalDate()),DateUtil.PATTERN_DATETIME),DateUtil.format(new Date(),DateUtil.PATTERN_DATETIME)); if(Math.abs(overhaul.getOverhaul()) > 0 && Math.abs(overhaul.getOverhaulFinish()) > 0){ - target.setTaget_two(BigDecimal.valueOf((double)overhaul.getOverhaulFinish() / overhaul.getOverhaul() * 100).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue()); + target.setTaget_two(BigDecimal.valueOf((double)overhaul.getOverhaulFinish() / overhaul.getOverhaul() * 100).setScale(2, RoundingMode.HALF_UP).doubleValue()); }else{ target.setTaget_two(0.0); } @@ -398,7 +399,7 @@ public class ShowServiceImpl implements ShowService { exe.execute(() -> { SolveHomeVO solve = phenomenonService.solve_count(areas,DateUtil.format(DateUtil.toDate(firstDateTime.toLocalDate()),DateUtil.PATTERN_DATETIME),DateUtil.format(new Date(),DateUtil.PATTERN_DATETIME)); if(Math.abs(solve.getSolveCount()) > 0 && Math.abs(solve.getDefectCount()) > 0){ - target.setTaget_three(BigDecimal.valueOf((double)solve.getSolveCount() / solve.getDefectCount() * 100).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue()); + target.setTaget_three(BigDecimal.valueOf((double)solve.getSolveCount() / solve.getDefectCount() * 100).setScale(2, RoundingMode.HALF_UP).doubleValue()); }else{ target.setTaget_three(0.0); } @@ -488,7 +489,7 @@ public class ShowServiceImpl implements ShowService { // FA上线率 double online = others.stream().mapToDouble(o-> Double.parseDouble(o.getOnlineRate())).sum(); if(Math.abs(online) > 0){ - target.setTaget_three(BigDecimal.valueOf(online / others.size()).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue()); + target.setTaget_three(BigDecimal.valueOf(online / others.size()).setScale(2, RoundingMode.HALF_UP).doubleValue()); } // FA投入条数 target.setTaget_four(others.stream().mapToDouble(OtherEntity::getFaQuantity).sum()); @@ -542,10 +543,10 @@ public class ShowServiceImpl implements ShowService { double pass = list.stream().mapToDouble(power -> Double.parseDouble(power.getDoubleQualifyRate())).sum(); if(Math.abs(plan) > 0){ // 发电完成率 - target.setTaget_three(BigDecimal.valueOf(target.getTaget_two() / plan * 100).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue()); + target.setTaget_three(BigDecimal.valueOf(target.getTaget_two() / plan * 100).setScale(2, RoundingMode.HALF_UP).doubleValue()); } // 双票合格率 - target.setTaget_four(BigDecimal.valueOf(pass / list.size()).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue()); + target.setTaget_four(BigDecimal.valueOf(pass / list.size()).setScale(2, RoundingMode.HALF_UP).doubleValue()); } return target; } @@ -1002,7 +1003,7 @@ public class ShowServiceImpl implements ShowService { if (maintainFinish == 0) { areaDutyVo.setMaintainRateMoth("0"); } else { - double maintainRate = BigDecimal.valueOf(maintainFinish / (double)maintainSum * 100L).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); + double maintainRate = BigDecimal.valueOf(maintainFinish / (double)maintainSum * 100L).setScale(2, RoundingMode.HALF_UP).doubleValue(); areaDutyVo.setMaintainRateMoth(String.valueOf(maintainRate)); } countDownLatch.countDown(); @@ -1018,7 +1019,7 @@ public class ShowServiceImpl implements ShowService { if (Math.abs(shortagesSum) <= 0) { areaDutyVo.setShortagesRateMoth("0"); } else { - double shortagesRate = BigDecimal.valueOf(shortages / (double)shortagesSum * 100L).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); + double shortagesRate = BigDecimal.valueOf(shortages / (double)shortagesSum * 100L).setScale(2, RoundingMode.HALF_UP).doubleValue(); areaDutyVo.setShortagesRateMoth(String.valueOf(shortagesRate)); } countDownLatch.countDown(); @@ -1033,7 +1034,7 @@ public class ShowServiceImpl implements ShowService { if (overhaulFinish == 0) { areaDutyVo.setOverhaulRateMoth("0"); } else { - double overhaulRate = BigDecimal.valueOf(overhaulFinish / (double)overhaul * 100L).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); + double overhaulRate = BigDecimal.valueOf(overhaulFinish / (double)overhaul * 100L).setScale(2, RoundingMode.HALF_UP).doubleValue(); areaDutyVo.setOverhaulRateMoth(String.valueOf(overhaulRate)); } countDownLatch.countDown(); @@ -1058,7 +1059,7 @@ public class ShowServiceImpl implements ShowService { if (operateQualify == 0) { areaDutyVo.setOperateRateMoth("0"); } else { - double operateRate = BigDecimal.valueOf(operateQualify / (double)operate * 100L).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); + double operateRate = BigDecimal.valueOf(operateQualify / (double)operate * 100L).setScale(2, RoundingMode.HALF_UP).doubleValue(); areaDutyVo.setOperateRateMoth(String.valueOf(operateRate)); } // 工作票 @@ -1069,7 +1070,7 @@ public class ShowServiceImpl implements ShowService { if (workQualify == 0) { areaDutyVo.setWorkRateMoth("0"); } else { - double workRate = BigDecimal.valueOf(workQualify / (double)work * 100L).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); + double workRate = BigDecimal.valueOf(workQualify / (double)work * 100L).setScale(2, RoundingMode.HALF_UP).doubleValue(); areaDutyVo.setWorkRateMoth(String.valueOf(workRate)); } countDownLatch.countDown(); @@ -1215,7 +1216,7 @@ public class ShowServiceImpl implements ShowService { if(Math.abs(task.getInspectTaskSum()) <= 0){ areaDutyVo.setInspectionFinishRate(0.0); }else{ - double inspectionFinishRate = BigDecimal.valueOf(task.getInspectTaskFinish() / (double)task.getInspectTaskSum() * 100).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); + double inspectionFinishRate = BigDecimal.valueOf(task.getInspectTaskFinish() / (double)task.getInspectTaskSum() * 100).setScale(2, RoundingMode.HALF_UP).doubleValue(); areaDutyVo.setInspectionFinishRate(inspectionFinishRate); } areaDutyVo.setInspectTaskIds(task.getInspectTaskIds()); @@ -1232,7 +1233,7 @@ public class ShowServiceImpl implements ShowService { if(Math.abs(defect.getDefectSum()) <= 0){ areaDutyVo.setShortagesRate(0.0); }else{ - double shortagesRate = BigDecimal.valueOf(defect.getDefect() / (double)defect.getDefectSum() * 100).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); + double shortagesRate = BigDecimal.valueOf(defect.getDefect() / (double)defect.getDefectSum() * 100).setScale(2, RoundingMode.HALF_UP).doubleValue(); areaDutyVo.setShortagesRate(shortagesRate); } } @@ -1247,7 +1248,7 @@ public class ShowServiceImpl implements ShowService { if(Math.abs(areaDutyVo.getWorkRegularlySum()) <= 0){ areaDutyVo.setWorkRegularlyRate(0.0); }else{ - double workRegularlyRate = BigDecimal.valueOf(areaDutyVo.getWorkRegularly() / (double)areaDutyVo.getWorkRegularlySum() * 100).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); + double workRegularlyRate = BigDecimal.valueOf(areaDutyVo.getWorkRegularly() / (double)areaDutyVo.getWorkRegularlySum() * 100).setScale(2, RoundingMode.HALF_UP).doubleValue(); areaDutyVo.setWorkRegularlyRate(workRegularlyRate); } } diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/ticket/impl/TicketServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/ticket/impl/TicketServiceImpl.java index 03ed645..0ea087e 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/ticket/impl/TicketServiceImpl.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/ticket/impl/TicketServiceImpl.java @@ -19,6 +19,7 @@ import org.springblade.core.tool.utils.CollectionUtil; import org.springframework.stereotype.Service; import java.math.BigDecimal; +import java.math.RoundingMode; import java.time.LocalDateTime; import java.util.ArrayList; import java.util.List; @@ -81,7 +82,7 @@ public class TicketServiceImpl extends BaseServiceImpl modules = Lists.newArrayList(inspectPdf); //转化html - String pdfPath = uploadPath + "/" + UUID.randomUUID().toString() + ".pdf"; + String pdfPath = uploadPath + "/" + UUID.randomUUID() + ".pdf"; try { String html = HtmlModule.buildHtml(modules, pdfModulePathInspect); HtmltoPdf.htmlToPdf(html, pdfPath); HtmltoPdf.previewPdf(pdfPath); } catch (Exception e) { - throw new ServiceException("HTML转PDF转换异常 : " + e.toString()); + throw new ServiceException("HTML转PDF转换异常 : " + e); } } @@ -321,12 +321,12 @@ public class ObjectServiceImpl extends BaseServiceImpl modules = asPDFModuleList(objects); //转化html - String pdfPath = uploadPath + "/" + UUID.randomUUID().toString() + ".pdf"; + String pdfPath = uploadPath + "/" + UUID.randomUUID() + ".pdf"; try { String html = HtmlModule.buildHtml(modules, pdfModulePathInspect); HtmltoPdf.htmlToPdf(html, pdfPath); } catch (Exception e) { - throw new ServiceException("HTML转PDF转换异常 : " + e.toString()); + throw new ServiceException("HTML转PDF转换异常 : " + e); } //返还pdf文档位置 return pdfPath; diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/web/ObjectController.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/web/ObjectController.java index ac491bc..1192887 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/web/ObjectController.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/web/ObjectController.java @@ -246,7 +246,7 @@ public class ObjectController extends BladeController { out.write(FileUtils.readFileToByteArray(file)); out.flush(); } catch (IOException e) { - throw new ServiceException("导出PDF发生异常 :" + e.toString()); + throw new ServiceException("导出PDF发生异常 :" + e); } finally { if (out != null) { try { diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/offline/service/impl/InspectOfflineServiceImpl.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/offline/service/impl/InspectOfflineServiceImpl.java index 93fb744..052dd15 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/offline/service/impl/InspectOfflineServiceImpl.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/offline/service/impl/InspectOfflineServiceImpl.java @@ -905,7 +905,7 @@ public class InspectOfflineServiceImpl implements IOfflineDataService { MultipartFile multipartFile = this.getMultipartFile(file); r = ossClient.putFile(multipartFile); if (!r.isSuccess()) { - throw new RuntimeException("上传文件["+fileName+"]失败,bladex-resource报错:" + r.toString()); + throw new RuntimeException("上传文件["+fileName+"]失败,bladex-resource报错:" + r); } BladeFile bladeFile = r.getData(); return bladeFile != null ? bladeFile.getLink() : null; @@ -948,7 +948,7 @@ public class InspectOfflineServiceImpl implements IOfflineDataService { MultipartFile multipartFile = this.getMultipartFile(file); r = ossClient.putFile(multipartFile); if (!r.isSuccess()) { - throw new RuntimeException("上传文件["+fileName+"]失败,bladex-resource报错:" + r.toString()); + throw new RuntimeException("上传文件["+fileName+"]失败,bladex-resource报错:" + r); } BladeFile bladeFile = r.getData(); return bladeFile != null ? bladeFile.getLink() : null; diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/offline/service/impl/OffLineServiceImpl.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/offline/service/impl/OffLineServiceImpl.java index f8fb524..e1625e4 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/offline/service/impl/OffLineServiceImpl.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/offline/service/impl/OffLineServiceImpl.java @@ -434,7 +434,7 @@ public class OffLineServiceImpl implements IOffLineService { r = ossClient.putFile(multipartFile); log.info(">>>>>>>>>>>>>>上传文件返回结果:" + r.toString()); if (!r.isSuccess()) { - throw new RuntimeException("上传文件["+fileName+"]失败,bladex-resource报错:" + r.toString()); + throw new RuntimeException("上传文件["+fileName+"]失败,bladex-resource报错:" + r); } BladeFile bladeFile = r.getData(); return bladeFile != null ? bladeFile.getLink() : null; diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/offline/util/CompressUtils.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/offline/util/CompressUtils.java index 9009cea..af0ccc1 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/offline/util/CompressUtils.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/offline/util/CompressUtils.java @@ -17,7 +17,7 @@ import java.util.zip.ZipOutputStream; public class CompressUtils { // 获取日志输出对象 - private static Logger logger = LoggerFactory.getLogger(CompressUtils.class); + private static final Logger logger = LoggerFactory.getLogger(CompressUtils.class); private static final int BUFFER_SIZE = 2 * 1024; diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/offline/util/TableJsonUtils.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/offline/util/TableJsonUtils.java index 218b5de..c99c38a 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/offline/util/TableJsonUtils.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/offline/util/TableJsonUtils.java @@ -4,11 +4,12 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.*; +import java.nio.charset.StandardCharsets; public class TableJsonUtils { // 获取日志输出对象 - private static Logger logger = LoggerFactory.getLogger(TableJsonUtils.class); + private static final Logger logger = LoggerFactory.getLogger(TableJsonUtils.class); @@ -96,7 +97,7 @@ public class TableJsonUtils { sb.append(" OFFLINE_FLAG VARCHAR(2) DEFAULT '0')"); } // 拼接完整的建表语句 - createTableSql = createTableSql.substring(0, firstParenthesesIndex+1) + sb.toString(); + createTableSql = createTableSql.substring(0, firstParenthesesIndex+1) + sb; // 转成成大写 createTableSql = createTableSql.toUpperCase(); logger.info("建表语句净化后="+createTableSql); @@ -147,7 +148,7 @@ public class TableJsonUtils { /** * 单位缩进字符串。 */ - private static String SPACE = " "; + private static final String SPACE = " "; /** * 生成.json格式文件 */ @@ -192,7 +193,7 @@ public class TableJsonUtils { // jsonString = this.formatJson(jsonString); // 将格式化后的字符串写入文件 - Writer write = new OutputStreamWriter(new FileOutputStream(file), "UTF-8"); + Writer write = new OutputStreamWriter(new FileOutputStream(file), StandardCharsets.UTF_8); write.write(jsonString); write.flush(); write.close(); @@ -217,7 +218,7 @@ public class TableJsonUtils { try { File jsonFile = new File(fileName); FileReader fileReader = new FileReader(jsonFile); - Reader reader = new InputStreamReader(new FileInputStream(jsonFile),"utf-8"); + Reader reader = new InputStreamReader(new FileInputStream(jsonFile), StandardCharsets.UTF_8); int ch = 0; StringBuffer sb = new StringBuffer(); while ((ch = reader.read()) != -1) { diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/report/controller/InspectReportController.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/report/controller/InspectReportController.java index 9ad2d66..b20b936 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/report/controller/InspectReportController.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/report/controller/InspectReportController.java @@ -83,7 +83,7 @@ public class InspectReportController { .doWrite(datas); } } catch (Exception e) { - System.out.println("exportExcel = " + e.toString()); + System.out.println("exportExcel = " + e); // 重置response response.reset(); response.setContentType("application/json"); @@ -94,7 +94,7 @@ public class InspectReportController { try { response.getWriter().println(JSONUtils.toJSONString(map)); } catch (IOException e3) { - throw new ServiceException( "发生异常 :" + e.toString()); + throw new ServiceException( "发生异常 :" + e); } } } @@ -124,7 +124,7 @@ public class InspectReportController { .doWrite(datas); } } catch (Exception e) { - System.out.println("exportExcel = " + e.toString()); + System.out.println("exportExcel = " + e); // 重置response response.reset(); response.setContentType("application/json"); @@ -135,7 +135,7 @@ public class InspectReportController { try { response.getWriter().println(JSONUtils.toJSONString(map)); } catch (IOException e3) { - throw new ServiceException( "发生异常 :" + e.toString()); + throw new ServiceException( "发生异常 :" + e); } } } diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/controller/TaskController.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/controller/TaskController.java index 39617a3..10167db 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/controller/TaskController.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/controller/TaskController.java @@ -56,10 +56,7 @@ import java.io.IOException; import java.net.URLEncoder; import java.time.LocalDateTime; import java.time.temporal.TemporalAdjusters; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; /** @@ -181,7 +178,7 @@ public class TaskController extends BladeController { .doWrite(list); } } catch (Exception e) { - System.out.println("exportExcel = " + e.toString()); + System.out.println("exportExcel = " + e); // 重置response response.reset(); response.setContentType("application/json"); @@ -192,7 +189,7 @@ public class TaskController extends BladeController { try { response.getWriter().println(JSONUtils.toJSONString(map)); } catch (IOException e3) { - throw new ServiceException( "发生异常 :" + e.toString()); + throw new ServiceException( "发生异常 :" + e); } } } @@ -395,9 +392,9 @@ public class TaskController extends BladeController { PushPlatform platform = PushPlatform.all(); Map> audienceMap = new HashMap<>(); if(Func.isNotEmpty(tags)){ - audienceMap.put(PushAudienceType.TAG, Arrays.asList(tags)); + audienceMap.put(PushAudienceType.TAG, Collections.singletonList(tags)); } else { - audienceMap.put(PushAudienceType.TAG, Arrays.asList("test")); + audienceMap.put(PushAudienceType.TAG, Collections.singletonList("test")); } PushAudience audience = new PushAudience(false, audienceMap); PushInfo pushInfo = new PushInfo("hzinfo-inspect" diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/job/HzThreadPool.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/job/HzThreadPool.java index eff5ac6..23b64fc 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/job/HzThreadPool.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/job/HzThreadPool.java @@ -1,21 +1,20 @@ package com.hnac.hzinfo.inspect.task.job; +import lombok.Getter; + import java.util.concurrent.*; /** * @Author: py */ public class HzThreadPool { - private static ThreadPoolExecutor fixedThreadExecutor; + @Getter + private static final ThreadPoolExecutor fixedThreadExecutor; public HzThreadPool() { } - public static ThreadPoolExecutor getFixedThreadExecutor() { - return fixedThreadExecutor; - } - - static { + static { ThreadFactory threadFactory = Executors.defaultThreadFactory(); fixedThreadExecutor = new ThreadPoolExecutor(5, 5, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingDeque(), threadFactory); } diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/job/service/TaskJobService.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/job/service/TaskJobService.java index b256697..0617732 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/job/service/TaskJobService.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/job/service/TaskJobService.java @@ -279,7 +279,7 @@ public class TaskJobService { users = positionUsers.stream().filter(user->user.getCreateDept().toString().contains(entity.getCreateDept().toString())).collect(Collectors.toList()); } //List users = userClient.userListByPositionAndDept(entity.getPositionId(), plan.getCreateDept()).getData(); - log.info("岗位信息:" + entity.toString() + "; 获取到的user:{}",users.stream().map(User::getName).collect(Collectors.joining(","))); + log.info("岗位信息:" + entity + "; 获取到的user:{}",users.stream().map(User::getName).collect(Collectors.joining(","))); for(User u:users){ res.add(PlanUserEntity.builder().planId(plan.getId()).userId(u.getId()).build()); } @@ -294,14 +294,14 @@ public class TaskJobService { } }); }else if(PlanTypeEnum.CLASS_TYPE.getType().equals(plan.getType())){ - log.error("巡检计划为班次时,有单独的处理流程,不应该跑到该分支下面来, plan = " + plan.toString()); + log.error("巡检计划为班次时,有单独的处理流程,不应该跑到该分支下面来, plan = " + plan); JSONArray timeJsonArray; if(Func.isNotEmpty(plan.getExecTimeJson())){ /** 多次计划执行时间 **/ timeJsonArray = JSON.parseArray(plan.getExecTimeJson()); } else{ - throw new ServiceException("巡检计划未设置值班班次: plan = " + plan.toString()); + throw new ServiceException("巡检计划未设置值班班次: plan = " + plan); } for(int i=0;i> audienceMap = new HashMap<>(); - audienceMap.put(PushAudienceType.TAG, Arrays.asList(task.getUserId().toString())); + audienceMap.put(PushAudienceType.TAG, Collections.singletonList(task.getUserId().toString())); PushAudience audience = new PushAudience(false, audienceMap); PushInfo pushInfo = new PushInfo(jgPushCode , title diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/job/service/impl/ConcurrentTaskServcie.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/job/service/impl/ConcurrentTaskServcie.java index ad2a840..8aeadfd 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/job/service/impl/ConcurrentTaskServcie.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/job/service/impl/ConcurrentTaskServcie.java @@ -112,8 +112,8 @@ public class ConcurrentTaskServcie extends TaskJobService implements ITaskJobSer if (taskUserList.size() > 0) { taskUserService.saveBatch(taskUserList); } else { - log.error("ConcurrentTaskServcie...没有任务用户: plan = " + plan.toString()); - XxlJobLogger.log("ConcurrentTaskServcie...没有任务用户: plan = " + plan.toString()); + log.error("ConcurrentTaskServcie...没有任务用户: plan = " + plan); + XxlJobLogger.log("ConcurrentTaskServcie...没有任务用户: plan = " + plan); } } @@ -134,7 +134,7 @@ public class ConcurrentTaskServcie extends TaskJobService implements ITaskJobSer /** 多次计划执行时间 **/ timeJsonArray = JSON.parseArray(plan.getExecTimeJson()); } else { - log.error("巡检计划未设置值班班次: plan = " + plan.toString()); + log.error("巡检计划未设置值班班次: plan = " + plan); return taskIds; } /** 多次任务 **/ @@ -177,11 +177,11 @@ public class ConcurrentTaskServcie extends TaskJobService implements ITaskJobSer taskIds.add(task.getId()); } } else { - log.error("获取该班次值班人员为空, plan = " + plan.toString()); + log.error("获取该班次值班人员为空, plan = " + plan); return taskIds; } } else { - log.error("巡检计划未设置值班班次, plan = " + plan.toString()); + log.error("巡检计划未设置值班班次, plan = " + plan); return taskIds; } } @@ -247,8 +247,8 @@ public class ConcurrentTaskServcie extends TaskJobService implements ITaskJobSer if (taskUserList.size() > 0) { taskUserService.saveBatch(taskUserList); } else { - log.error("ConcurrentTaskServcie...没有任务用户: plan = " + plan.toString()); - XxlJobLogger.log("ConcurrentTaskServcie...没有任务用户: plan = " + plan.toString()); + log.error("ConcurrentTaskServcie...没有任务用户: plan = " + plan); + XxlJobLogger.log("ConcurrentTaskServcie...没有任务用户: plan = " + plan); } return taskIds; diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/job/service/impl/SeizeTaskService.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/job/service/impl/SeizeTaskService.java index be17cef..d9effd6 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/job/service/impl/SeizeTaskService.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/job/service/impl/SeizeTaskService.java @@ -105,8 +105,8 @@ public class SeizeTaskService extends TaskJobService implements ITaskJobService if(taskUserList.size()>0){ taskUserService.saveBatch(taskUserList); } else { - log.error("没有用户: plan = " + plan.toString()); - XxlJobLogger.log("SeizeTaskService...没有任务用户: plan = " + plan.toString()); + log.error("没有用户: plan = " + plan); + XxlJobLogger.log("SeizeTaskService...没有任务用户: plan = " + plan); } } @@ -126,7 +126,7 @@ public class SeizeTaskService extends TaskJobService implements ITaskJobService /** 多次计划执行时间 **/ timeJsonArray = JSON.parseArray(plan.getExecTimeJson()); } else { - log.error("巡检计划未设置值班班次: plan = " + plan.toString()); + log.error("巡检计划未设置值班班次: plan = " + plan); return taskIds; } /** 多次任务 **/ @@ -157,7 +157,7 @@ public class SeizeTaskService extends TaskJobService implements ITaskJobService } } } else { - log.error("获取该班次值班人员为空, plan = " + plan.toString()); + log.error("获取该班次值班人员为空, plan = " + plan); return taskIds; } String reason = this.distributeTaskObjs(plan,task); @@ -229,8 +229,8 @@ public class SeizeTaskService extends TaskJobService implements ITaskJobService if(taskUserList.size()>0){ taskUserService.saveBatch(taskUserList); } else { - log.error("没有用户: plan = " + plan.toString()); - XxlJobLogger.log("SeizeTaskService...没有任务用户: plan = " + plan.toString()); + log.error("没有用户: plan = " + plan); + XxlJobLogger.log("SeizeTaskService...没有任务用户: plan = " + plan); } return taskIds; } diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/service/impl/TaskServiceImpl.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/service/impl/TaskServiceImpl.java index 4083a1d..56183d2 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/service/impl/TaskServiceImpl.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/service/impl/TaskServiceImpl.java @@ -55,6 +55,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.math.BigDecimal; +import java.math.RoundingMode; import java.time.LocalDate; import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; @@ -408,7 +409,7 @@ public class TaskServiceImpl extends BaseServiceImpl imp if (ObjectUtil.isEmpty(user)) { return false; } - return Arrays.asList(user.getRoleId().split(",")).contains(roleIdR.getData()) ? true : false; + return Arrays.asList(user.getRoleId().split(",")).contains(roleIdR.getData()); }).collect(Collectors.toList()); //根据传参分类型获取巡检任务统计情况 if ("1".equals(inspectType)) { @@ -669,7 +670,7 @@ public class TaskServiceImpl extends BaseServiceImpl imp task.setAutoVideo(PlanContants.InspectTypeEnum.ROBOT.getVal()); List tasks = this.baseMapper.getListOfPhone(task); setVoInfo(tasks); - return Func.isEmpty(tasks) ? new ArrayList<>() : Arrays.asList(tasks.get(0)); + return Func.isEmpty(tasks) ? new ArrayList<>() : Collections.singletonList(tasks.get(0)); } /** @@ -1038,7 +1039,7 @@ public class TaskServiceImpl extends BaseServiceImpl imp resEntity.setCompany(Optional.ofNullable(dept.getData().getDeptName()).orElse("")); } } - resEntity.setPlanName(Optional.ofNullable(taskVo.getPlanName().toString()).orElse("")); + resEntity.setPlanName(Optional.ofNullable(taskVo.getPlanName()).orElse("")); if (ObjectUtil.isNotEmpty(taskVo.getPlanStartTime())) { resEntity.setPlanStartTime(Optional.ofNullable(DateUtil.format(taskVo.getPlanStartTime(), TaskContants.INSPECT_DATE_PATTERN)).orElse("")); } @@ -1173,7 +1174,7 @@ public class TaskServiceImpl extends BaseServiceImpl imp if (CollectionUtil.isEmpty(list)||CollectionUtil.isEmpty(undoneIds)){ voteChartVo.setFinishRate(0.00d); }else { - BigDecimal divide = new BigDecimal(finishIds.size()).divide(new BigDecimal(list.size()),2,BigDecimal.ROUND_UP); + BigDecimal divide = new BigDecimal(finishIds.size()).divide(new BigDecimal(list.size()),2, RoundingMode.UP); voteChartVo.setFinishRate(divide.doubleValue()); } return voteChartVo; diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/util/CacheUtils.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/util/CacheUtils.java index 055cb1b..33aa290 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/util/CacheUtils.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/util/CacheUtils.java @@ -2,6 +2,7 @@ package com.hnac.hzinfo.inspect.task.util; import com.hnac.hzinfo.inspect.task.entity.InspectionTaskSMS; +import lombok.Getter; import net.sf.ehcache.Cache; import net.sf.ehcache.CacheManager; import net.sf.ehcache.Element; @@ -13,7 +14,8 @@ import java.util.Iterator; import java.util.List; public class CacheUtils { - private static CacheManager cacheManager = (CacheManager) SpringUtil.getBean("ehcache"); + @Getter + private static final CacheManager cacheManager = SpringUtil.getBean("ehcache"); private static final String SYS_CACHE = "sysCache"; public CacheUtils() { @@ -78,8 +80,8 @@ public class CacheUtils { List taskList = (obj==null?new ArrayList():(List)obj) ; InspectionTaskSMS taskSMS = new InspectionTaskSMS(); BeanUtils.copyProperties(value,taskSMS) ; - taskSMS.setStartRemindFlag(taskSMS.getStartRemindFlag() == null?false:taskSMS.getStartRemindFlag() ); - taskSMS.setEndRemindFlag(taskSMS.getEndRemindFlag() == null?false:taskSMS.getEndRemindFlag() ); + taskSMS.setStartRemindFlag(taskSMS.getStartRemindFlag() != null && taskSMS.getStartRemindFlag()); + taskSMS.setEndRemindFlag(taskSMS.getEndRemindFlag() != null && taskSMS.getEndRemindFlag()); taskList.add(taskSMS) ; put(cacheName,key,taskList); } @@ -133,7 +135,4 @@ public class CacheUtils { return cache; } - public static CacheManager getCacheManager() { - return cacheManager; - } } diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/util/TaskRemindCacheUtils.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/util/TaskRemindCacheUtils.java index 05a7e75..838d0b3 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/util/TaskRemindCacheUtils.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/util/TaskRemindCacheUtils.java @@ -8,6 +8,7 @@ package com.hnac.hzinfo.inspect.task.util; import com.hnac.hzinfo.inspect.task.entity.InspectionTaskSMS; import com.hnac.hzinfo.inspect.task.entity.TaskEntity; +import lombok.Getter; import net.sf.ehcache.Cache; import net.sf.ehcache.CacheManager; import net.sf.ehcache.Element; @@ -18,16 +19,13 @@ import java.util.Map.Entry; import java.util.stream.Collectors; public class TaskRemindCacheUtils { - private static CacheManager cacheManager = (CacheManager) SpringUtil.getBean("ehcache"); + @Getter + private static final CacheManager cacheManager = SpringUtil.getBean("ehcache"); private static final String task_REMIND_CACHE = "taskRemindCache"; public TaskRemindCacheUtils() { } - public static CacheManager getCacheManager() { - return cacheManager; - } - private static Cache getCache(String cacheName) { Cache cache = cacheManager.getCache(cacheName); if (cache == null) { @@ -132,8 +130,8 @@ public class TaskRemindCacheUtils { // remindDateMap = taskSMSList.stream().collect(Collectors.groupingBy(InspectionTaskSMS::getStartRemindTime)) ; } remindDateMap.entrySet().stream().forEach(entry ->{ - Date thisKey = (Date) entry.getKey(); - List thisValue = (List) entry.getValue(); + Date thisKey = entry.getKey(); + List thisValue = entry.getValue(); Map> planIdAndUserIdMap = thisValue.stream().collect(Collectors.groupingBy(TaskSMS -> TaskSMS.getPlanId().toString()+"_"+TaskSMS.getUserId().toString())) ; taskSMSMap.put(thisKey,planIdAndUserIdMap) ; }); 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 1bf8dc4..886a814 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 @@ -74,7 +74,7 @@ public class Base64ImgReplacedElementFactory implements ReplacedElementFactory { BadElementException { FSImage fiImg = null; if (srcAttr.toLowerCase().startsWith("data:image/")) { - String base64Code = srcAttr.substring(srcAttr.indexOf("base64,") + "base64,".length(), srcAttr.length()); + String base64Code = srcAttr.substring(srcAttr.indexOf("base64,") + "base64,".length()); // 解码 byte[] decodedBytes = Base64.decode(base64Code); diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/utils/HtmlModule.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/utils/HtmlModule.java index 19d93b7..2310fd8 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/utils/HtmlModule.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/utils/HtmlModule.java @@ -4,6 +4,7 @@ import lombok.extern.slf4j.Slf4j; import java.io.*; import java.lang.reflect.Field; +import java.nio.charset.StandardCharsets; import java.util.List; import java.util.Objects; import java.util.regex.Matcher; @@ -92,7 +93,7 @@ public class HtmlModule { InputStream is = new FileInputStream(filePath); StringBuffer buffer = new StringBuffer(); String line; // 用来保存每行读取的内容 - BufferedReader reader = new BufferedReader(new InputStreamReader(is, "utf-8")); + BufferedReader reader = new BufferedReader(new InputStreamReader(is, StandardCharsets.UTF_8)); line = reader.readLine(); // 读取第一行 while (line != null) { // 如果 line 为空说明读完了 buffer.append(line); // 将读到的内容添加到 buffer 中 diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/utils/HtmltoPdf.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/utils/HtmltoPdf.java index ace7dd6..97cfa1f 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/utils/HtmltoPdf.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/utils/HtmltoPdf.java @@ -24,6 +24,7 @@ import java.io.*; import java.net.URL; import java.net.URLEncoder; import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; /** * HTML 转 PDF @@ -42,7 +43,7 @@ public class HtmltoPdf { Document document = new Document(rectangle,10,10,10,10); PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream(filePath)); document.open(); - InputStream htmlInput = new ByteArrayInputStream(htmlstr.getBytes("UTF-8")); + InputStream htmlInput = new ByteArrayInputStream(htmlstr.getBytes(StandardCharsets.UTF_8)); // 使用自定义的字体提供器,并将其设置为unicode字体样式 FontsProvider fontProvider = new FontsProvider(); fontProvider.addFontSubstitute("lowagie", "garamond"); @@ -52,7 +53,7 @@ public class HtmltoPdf { htmlContext.setTagFactory(Tags.getHtmlTagProcessorFactory()); XMLWorkerHelper.getInstance().getDefaultCssResolver(true); //解析html文件 - XMLWorkerHelper.getInstance().parseXHtml(writer, document, htmlInput, null, Charset.forName("UTF-8"), fontProvider); + XMLWorkerHelper.getInstance().parseXHtml(writer, document, htmlInput, null, StandardCharsets.UTF_8, fontProvider); //关闭流 document.close(); 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 2e1d5d0..05fff9c 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 @@ -42,7 +42,7 @@ public abstract class HttpClientUtils { try { sc = SSLContext.getInstance("SSLv3"); - sc.init((KeyManager[]) null, new TrustManager[]{new X509TrustManager() { + sc.init(null, new TrustManager[]{new X509TrustManager() { @Override public void checkClientTrusted(X509Certificate[] paramArrayOfX509Certificate, String paramString) throws CertificateException { } @@ -55,7 +55,7 @@ public abstract class HttpClientUtils { public X509Certificate[] getAcceptedIssuers() { return null; } - }}, (SecureRandom) null); + }}, null); } catch (NoSuchAlgorithmException var3) { var3.printStackTrace(); } catch (KeyManagementException var2) { diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/utils/HzimsThreadPool.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/utils/HzimsThreadPool.java index fd6d7d8..ea286fd 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/utils/HzimsThreadPool.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/utils/HzimsThreadPool.java @@ -1,21 +1,20 @@ package com.hnac.hzinfo.inspect.utils; +import lombok.Getter; + import java.util.concurrent.*; /** * @Author: py */ public class HzimsThreadPool { - private static ThreadPoolExecutor fixedThreadExecutor; + @Getter + private static final ThreadPoolExecutor fixedThreadExecutor; public HzimsThreadPool() { } - public static ThreadPoolExecutor getFixedThreadExecutor() { - return fixedThreadExecutor; - } - - static { + static { ThreadFactory threadFactory = Executors.defaultThreadFactory(); fixedThreadExecutor = new ThreadPoolExecutor(5, 5, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingDeque(), threadFactory); } diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/utils/JsonFileUtil.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/utils/JsonFileUtil.java index f603e33..6c17eb2 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/utils/JsonFileUtil.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/utils/JsonFileUtil.java @@ -7,6 +7,7 @@ import org.apache.commons.io.FileUtils; import java.io.*; import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Collection; import java.util.Enumeration; @@ -73,7 +74,7 @@ public class JsonFileUtil { json = JSONObject.toJSONString(list); } try { - OutputStreamWriter op = new OutputStreamWriter(new FileOutputStream(jsonFile), "UTF-8"); + OutputStreamWriter op = new OutputStreamWriter(new FileOutputStream(jsonFile), StandardCharsets.UTF_8); op.append(json); op.flush(); op.close(); @@ -183,7 +184,7 @@ public class JsonFileUtil { ZipEntry entry = (ZipEntry)entries.nextElement(); String zipEntryName = entry.getName(); InputStream in = zip.getInputStream(entry); - String outPath = (descDir + zipEntryName).replaceAll("\\*", "/");; + String outPath = (descDir + zipEntryName).replaceAll("\\*", "/"); //判断路径是否存在,不存在则创建文件路径 File file = new File(outPath.substring(0, outPath.lastIndexOf('/'))); if(!file.exists()) { 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 5002c31..8708fbb 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 @@ -40,7 +40,7 @@ public class ZxingGenCode { MatrixToImageWriter.writeToStream(bitMatrix, "png", new FileOutputStream(imgPath)); } catch (Exception e) { - throw new ServiceException("生产条码或二维码异常:" + e.toString()); + throw new ServiceException("生产条码或二维码异常:" + e); } } @@ -63,7 +63,7 @@ public class ZxingGenCode { result = new MultiFormatReader().decode(bitmap, null); return result.getText(); } catch (Exception e) { - throw new ServiceException("解析条码或二维码异常:" + e.toString()); + throw new ServiceException("解析条码或二维码异常:" + e); } } diff --git a/hzims-service/message/src/main/java/com/hnac/hzims/message/configure/service/ISmsConfigService.java b/hzims-service/message/src/main/java/com/hnac/hzims/message/configure/service/ISmsConfigService.java index 1e6a2b5..cb2a6d3 100644 --- a/hzims-service/message/src/main/java/com/hnac/hzims/message/configure/service/ISmsConfigService.java +++ b/hzims-service/message/src/main/java/com/hnac/hzims/message/configure/service/ISmsConfigService.java @@ -98,8 +98,7 @@ public interface ISmsConfigService extends IMessageConfigService { if(!content.containsKey(contentVariable)) { isInvalid.set(false); - return; - } + } }); } return isInvalid.get(); diff --git a/hzims-service/message/src/main/java/com/hnac/hzims/message/service/impl/MessagePushRecordServiceImpl.java b/hzims-service/message/src/main/java/com/hnac/hzims/message/service/impl/MessagePushRecordServiceImpl.java index 3ced72c..015735b 100644 --- a/hzims-service/message/src/main/java/com/hnac/hzims/message/service/impl/MessagePushRecordServiceImpl.java +++ b/hzims-service/message/src/main/java/com/hnac/hzims/message/service/impl/MessagePushRecordServiceImpl.java @@ -194,9 +194,7 @@ public class MessagePushRecordServiceImpl extends BaseServiceImpl pushStatResponseVos = entry.getValue(); for (PushStatResponseVo pushStatResponseVo : pushStatResponseVos) { - if (arrayList.contains(pushStatResponseVo.getPusherName())){ - arrayList.remove(pushStatResponseVo.getPusherName()); - } + arrayList.remove(pushStatResponseVo.getPusherName()); treeMap.put(pushStatResponseVo.getPusherName(),pushStatResponseVo.getCount()); } //如果不存在设为0 @@ -334,7 +330,7 @@ public class MessagePushRecordServiceImpl extends BaseServiceImpl pushers = Lists.newArrayList(record.getPusher().toString()); + ArrayList pushers = Lists.newArrayList(record.getPusher()); R androidPush = pushService.sendAndroidMsg(record.getSubject(), record.getContent(), pushers, CommonConstant.TENANT_ID); R iosPush = pushService.sendIOSMsg(record.getSubject(), record.getContent(), pushers, CommonConstant.TENANT_ID); String faultResult = ""; @@ -479,9 +475,7 @@ public class MessagePushRecordServiceImpl extends BaseServiceImpl SESSION_POOL = new ConcurrentHashMap<>(); - private static Lock lock = new ReentrantLock(); + private static final Lock lock = new ReentrantLock(); /** * 添加会话 diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/impl/AreaDutyServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/impl/AreaDutyServiceImpl.java index 0913098..5019abf 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/impl/AreaDutyServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/impl/AreaDutyServiceImpl.java @@ -80,7 +80,7 @@ public class AreaDutyServiceImpl implements AreaDutyService { private final RedisTemplate redisTemplate; - private static ScheduledExecutorService pool = new ScheduledThreadPoolExecutor(5, new ThreadFactoryBuilder().setNameFormat("area-duty-pool-%d").build(), new ThreadPoolExecutor.AbortPolicy()); + private static final ScheduledExecutorService pool = new ScheduledThreadPoolExecutor(5, new ThreadFactoryBuilder().setNameFormat("area-duty-pool-%d").build(), new ThreadPoolExecutor.AbortPolicy()); /** * 区域值班数据 diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/impl/TargetServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/impl/TargetServiceImpl.java index a7a0deb..93e17d2 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/impl/TargetServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/impl/TargetServiceImpl.java @@ -56,6 +56,7 @@ import org.springframework.util.CollectionUtils; import org.springframework.util.StringUtils; import java.math.BigDecimal; +import java.math.RoundingMode; import java.time.LocalDate; import java.time.LocalDateTime; import java.time.LocalTime; @@ -309,7 +310,7 @@ public class TargetServiceImpl implements TargetService { if(Math.abs(item.getPlanGeneration()) <= 0){ item.setCompleteRate(0.0); }else{ - item.setCompleteRate(BigDecimal.valueOf(item.getRealityGeneration() / item.getPlanGeneration() * 100).setScale(1, BigDecimal.ROUND_HALF_UP).doubleValue()); + item.setCompleteRate(BigDecimal.valueOf(item.getRealityGeneration() / item.getPlanGeneration() * 100).setScale(1, RoundingMode.HALF_UP).doubleValue()); } }else{ item.setPlanGeneration(0.0); @@ -352,7 +353,7 @@ public class TargetServiceImpl implements TargetService { if(Math.abs(item.getPlanGeneration()) <= 0){ item.setCompleteRate(0.0); }else{ - item.setCompleteRate(BigDecimal.valueOf(item.getRealityGeneration() / item.getPlanGeneration() * 100).setScale(1, BigDecimal.ROUND_HALF_UP).doubleValue()); + item.setCompleteRate(BigDecimal.valueOf(item.getRealityGeneration() / item.getPlanGeneration() * 100).setScale(1, RoundingMode.HALF_UP).doubleValue()); } }else{ item.setPlanGeneration(0.0); @@ -536,7 +537,7 @@ public class TargetServiceImpl implements TargetService { item.setCompleteRate("0.0"); }else{ double rate = stationPower.stream().mapToDouble(o->Double.parseDouble(o.getDoubleQualifyRate())).sum(); - item.setCompleteRate(String.valueOf(BigDecimal.valueOf(rate/ stationPower.size()).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue())); + item.setCompleteRate(String.valueOf(BigDecimal.valueOf(rate/ stationPower.size()).setScale(2, RoundingMode.HALF_UP).doubleValue())); } return item; }).collect(Collectors.toList()); @@ -582,7 +583,7 @@ public class TargetServiceImpl implements TargetService { if (defect.getDefectCount() <= 0) { defect.setCompleteRate(0.0); } else { - defect.setCompleteRate(BigDecimal.valueOf(defect.getCompleteCount() / defect.getDefectCount() * 100L).setScale(1, BigDecimal.ROUND_HALF_UP).doubleValue()); + defect.setCompleteRate(BigDecimal.valueOf(defect.getCompleteCount() / defect.getDefectCount() * 100L).setScale(1, RoundingMode.HALF_UP).doubleValue()); } completeDefects.add(defect); countDownLatch.countDown(); @@ -731,7 +732,7 @@ public class TargetServiceImpl implements TargetService { if (Math.abs(defect.getDefectCount()) <= 0) { defect.setCompleteRate(0.0); } else { - defect.setCompleteRate(BigDecimal.valueOf(defect.getCompleteCount() / defect.getDefectCount() * 100L).setScale(1, BigDecimal.ROUND_HALF_UP).doubleValue()); + defect.setCompleteRate(BigDecimal.valueOf(defect.getCompleteCount() / defect.getDefectCount() * 100L).setScale(1, RoundingMode.HALF_UP).doubleValue()); } return defect; }).collect(Collectors.toList()); 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 66b4041..0daee7e 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 @@ -313,7 +313,7 @@ public class StAlamRecordServiceImpl extends BaseServiceImpl) entry.getValue()); } - System.out.printf("总共耗时:" + String.valueOf(new Date().getTime() - date2.getTime())); + System.out.print("总共耗时:" + (new Date().getTime() - date2.getTime())); } R result = new R(); result.setCode(200); @@ -423,7 +423,7 @@ public class StAlamRecordServiceImpl extends BaseServiceImpl real = JSONObject.parseObject(realJson.toString(), new TypeReference>() {});; - if(MapUtils.isEmpty(real)){ + Map real = JSONObject.parseObject(realJson.toString(), new TypeReference>() {}); + if(MapUtils.isEmpty(real)){ return; } // 获取设备 @@ -663,8 +663,8 @@ public class StAlamRecordServiceImpl extends BaseServiceImpl list = this.baseMapper.getManageIndex(month, createDeptList); manageIndex.setInTimeNum(list.get(0)); if (!list.get(1).equals(0)) { - double inTimeRatio = new BigDecimal(list.get(0)).divide(new BigDecimal(list.get(1)), 2, BigDecimal.ROUND_UP).doubleValue(); + double inTimeRatio = new BigDecimal(list.get(0)).divide(new BigDecimal(list.get(1)), 2, RoundingMode.UP).doubleValue(); manageIndex.setInTimeRatio(list.get(0).equals(0) ? 0.0 : inTimeRatio); } manageIndex.setHistoryRemindNum(list.get(3)); manageIndex.setMonthRemindNum(list.get(2)); if (!list.get(4).equals(0)) { - double dealRatio = new BigDecimal(list.get(1)).divide(new BigDecimal(list.get(4)), 2, BigDecimal.ROUND_UP).doubleValue(); + double dealRatio = new BigDecimal(list.get(1)).divide(new BigDecimal(list.get(4)), 2, RoundingMode.UP).doubleValue(); manageIndex.setDealRatio(list.get(1).equals(0) ? 0.0 : dealRatio); } return manageIndex; @@ -1045,11 +1046,11 @@ public class OperDefectServiceImpl extends BaseServiceImpl> workTicketInfoById = iTicketInfoClient.getWorkTicketInfoById(Arrays.asList(Long.valueOf(entity.getTicketId()))); + R> workTicketInfoById = iTicketInfoClient.getWorkTicketInfoById(Collections.singletonList(Long.valueOf(entity.getTicketId()))); if (workTicketInfoById.isSuccess() && CollectionUtil.isNotEmpty(workTicketInfoById.getData())) { //获取工作票的编码Id operDefectStatisticsExportVO.setTicketId(workTicketInfoById.getData().get(0).getCode()); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/util/TableJsonUtils.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/util/TableJsonUtils.java index 49f143f..ee2ca67 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/util/TableJsonUtils.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/util/TableJsonUtils.java @@ -4,11 +4,12 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.*; +import java.nio.charset.StandardCharsets; public class TableJsonUtils { // 获取日志输出对象 - private static Logger logger = LoggerFactory.getLogger(TableJsonUtils.class); + private static final Logger logger = LoggerFactory.getLogger(TableJsonUtils.class); @@ -91,7 +92,7 @@ public class TableJsonUtils { sb.append(" OFFLINE_FLAG VARCHAR(2) DEFAULT '0')"); // 拼接完整的建表语句 - createTableSql = createTableSql.substring(0, firstParenthesesIndex+1) + sb.toString(); + createTableSql = createTableSql.substring(0, firstParenthesesIndex+1) + sb; // 转成成大写 createTableSql = createTableSql.toUpperCase(); logger.info("建表语句净化后="+createTableSql); @@ -142,7 +143,7 @@ public class TableJsonUtils { /** * 单位缩进字符串。 */ - private static String SPACE = " "; + private static final String SPACE = " "; /** * 生成.json格式文件 */ @@ -187,7 +188,7 @@ public class TableJsonUtils { // jsonString = this.formatJson(jsonString); // 将格式化后的字符串写入文件 - Writer write = new OutputStreamWriter(new FileOutputStream(file), "UTF-8"); + Writer write = new OutputStreamWriter(new FileOutputStream(file), StandardCharsets.UTF_8); write.write(jsonString); write.flush(); write.close(); @@ -212,7 +213,7 @@ public class TableJsonUtils { try { File jsonFile = new File(fileName); FileReader fileReader = new FileReader(jsonFile); - Reader reader = new InputStreamReader(new FileInputStream(jsonFile),"utf-8"); + Reader reader = new InputStreamReader(new FileInputStream(jsonFile), StandardCharsets.UTF_8); int ch = 0; StringBuffer sb = new StringBuffer(); while ((ch = reader.read()) != -1) { diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/controller/ImsDutyChangeController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/controller/ImsDutyChangeController.java index 3378b37..f94a86d 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/controller/ImsDutyChangeController.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/controller/ImsDutyChangeController.java @@ -51,9 +51,9 @@ public class ImsDutyChangeController extends BladeController { ImsDutyChangeVO vo = ImsDutyChangeWrapper.build().entityVO(detail); imsDutyService.setUserNmae(vo); ImsSchedulingVo imsSchedulingVo1 = imsDutyMainService.getByIdOneV2(detail.getAcceptDutyId()); - vo.setAcceptDutyMainVo(imsSchedulingVo1 == null ? null : imsSchedulingVo1); + vo.setAcceptDutyMainVo(imsSchedulingVo1); ImsSchedulingVo imsSchedulingVo = imsDutyMainService.getByIdOneV2(detail.getApplyDutyId()); - vo.setApplyDutyMainVo(imsSchedulingVo == null ? null : imsSchedulingVo); + vo.setApplyDutyMainVo(imsSchedulingVo); return R.data(vo); } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsAnalyseExampleServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsAnalyseExampleServiceImpl.java index 2611bdd..82cdea2 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsAnalyseExampleServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsAnalyseExampleServiceImpl.java @@ -153,14 +153,14 @@ public class ImsAnalyseExampleServiceImpl extends BaseServiceImpl> head=new ArrayList<>(); - List title = new ArrayList<>(Arrays.asList("时间")); + List title = new ArrayList<>(Collections.singletonList("时间")); head.add(title); List records = page.getRecords(); AnalyzeDataList analyzeDataList = records.get(0); //把时间加属性名称作为表头 List stringList=analyzeDataList.getFields().stream().map(FieldsData::getFieldName).collect(Collectors.toList()); for (String s : stringList) { - head.add(Arrays.asList(s)); + head.add(Collections.singletonList(s)); } //把数据填充 List> data=new ArrayList<>(); @@ -172,7 +172,7 @@ public class ImsAnalyseExampleServiceImpl extends BaseServiceImpl list = imsDutyGroupPService.selectByGroupIds(Arrays.asList(num)); + List list = imsDutyGroupPService.selectByGroupIds(Collections.singletonList(num)); List collectPerson = list.stream().filter(iter -> iter.getGroupId().toString().equals(dutyGroupId)).map(iter -> iter.getPersonId()).collect(Collectors.toList()); if (CollectionUtil.isNotEmpty(collectPerson)) { personIds = StringUtils.join(collectPerson, "^"); @@ -514,7 +514,7 @@ public class ImsDutyMainServiceImpl extends BaseServiceImpl list = imsDutyGroupPService.selectByGroupIds(Arrays.asList(num)); + List list = imsDutyGroupPService.selectByGroupIds(Collections.singletonList(num)); collectPerson = list.stream().filter(iter -> iter.getGroupId().toString().equals(groupId)).map(iter -> iter.getPersonId()).collect(Collectors.toList()); if (CollectionUtil.isNotEmpty(collectPerson)) { personIds = StringUtils.join(collectPerson, "^"); @@ -583,7 +583,7 @@ public class ImsDutyMainServiceImpl extends BaseServiceImpl dates = getTwoPeriodsAll(Integer.valueOf(start[0]), Integer.valueOf(start[1]), Integer.valueOf(start[2]), Integer.valueOf(end[0]), Integer.valueOf(end[1]), Integer.valueOf(end[2])); - if (imsSchedulingVo.isCompose() == false) { + if (!imsSchedulingVo.isCompose()) { List imsDutyMainEntities2 = this.baseMapper.selectList(new LambdaQueryWrapper() {{ ge(ImsDutyMainEntity::getDutyDate, imsSchedulingVo.getStartDate()); le(ImsDutyMainEntity::getDutyDate, imsSchedulingVo.getEndDate()); @@ -861,7 +861,7 @@ public class ImsDutyMainServiceImpl extends BaseServiceImpl 0) { + if (null != split) { for (String s : split) { ImsDutyMainVO vo = new ImsDutyMainVO(); User user = UserCache.getUser(Long.valueOf(s)); @@ -888,7 +888,7 @@ public class ImsDutyMainServiceImpl extends BaseServiceImpl 0) { + if (null != split) { for (String s : split) { ImsDutyMainVO vo = new ImsDutyMainVO(); R user = userClient.userInfoById(Long.valueOf(s)); @@ -1418,7 +1418,7 @@ public class ImsDutyMainServiceImpl extends BaseServiceImpl personEntityList = imsDutyMainPersonMapper.selectList(new LambdaQueryWrapper() {{ in(ImsDutyMainPersonEntity::getDutyMainId, mainIds); }}); - List list = personEntityList.stream().map(s -> Long.valueOf(s.getId())).collect(Collectors.toList()); + List list = personEntityList.stream().map(s -> s.getId()).collect(Collectors.toList()); if (CollectionUtil.isEmpty(personEntityList)) { //如果人员计划表中,无值,需要填充对应信息(只有排班-班组,人员计划表才有可能无值) //对上一个版本做兼容 @@ -1533,7 +1533,7 @@ public class ImsDutyMainServiceImpl extends BaseServiceImpl updateDutyMainIds = updateDutyMainEntities.stream().map(s -> Long.valueOf(s.getId())).collect(Collectors.toList()); + List updateDutyMainIds = updateDutyMainEntities.stream().map(s -> s.getId()).collect(Collectors.toList()); this.baseMapper.deleteByUserId(updateDutyMainIds); this.saveBatch(updateDutyMainEntities); iImsDutyMainPersonService.deleteLogic(list); @@ -1799,7 +1799,7 @@ public class ImsDutyMainServiceImpl extends BaseServiceImpl dates = getTwoPeriodsAll(Integer.valueOf(start[0]), Integer.valueOf(start[1]), Integer.valueOf(start[2]), Integer.valueOf(end[0]), Integer.valueOf(end[1]), Integer.valueOf(end[2])); - if (imsSchedulingVo.isCompose() == false) { + if (!imsSchedulingVo.isCompose()) { List imsDutyMainEntities2 = this.baseMapper.selectList(new LambdaQueryWrapper() {{ le(ImsDutyMainEntity::getDutyDate, imsSchedulingVo.getEndDate()); eq(ImsDutyMainEntity::getCreateDept, imsSchedulingVo.getCreateDept()); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyRecServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyRecServiceImpl.java index c5b1caa..307d893 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyRecServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyRecServiceImpl.java @@ -66,6 +66,7 @@ import org.springframework.util.ObjectUtils; import javax.annotation.Resource; import javax.xml.ws.WebServiceException; import java.math.BigDecimal; +import java.math.RoundingMode; import java.sql.Time; import java.text.SimpleDateFormat; import java.time.*; @@ -881,7 +882,7 @@ public class ImsDutyRecServiceImpl extends BaseServiceImpl() {{ eq(ImsDutyMainEntity::getDutyDate, date); - eq(ImsDutyMainEntity::getPreDutyId, Long.valueOf(dutyMainEntity.getPreDutyId())); + eq(ImsDutyMainEntity::getPreDutyId, dutyMainEntity.getPreDutyId()); ne(ImsDutyMainEntity::getStatus, "-1"); eq(ImsDutyMainEntity::getCreateDept, mainEntityById.getCreateDept()); }}); @@ -1062,7 +1063,7 @@ public class ImsDutyRecServiceImpl extends BaseServiceImpl() {{ eq(ImsDutyMainEntity::getId, dutyMainEntity.getPreDutyId()); }}); @@ -1399,7 +1400,7 @@ public class ImsDutyRecServiceImpl extends BaseServiceImpl mergeRegions = sheet.getMergedRegions(); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/utils/QRCodeUtils.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/utils/QRCodeUtils.java index 9046e9d..28087cb 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/utils/QRCodeUtils.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/utils/QRCodeUtils.java @@ -69,7 +69,7 @@ public class QRCodeUtils { boolean needCompress) throws Exception { File file = new File(imgPath); if (!file.exists()) { - System.err.println(""+imgPath+" 该文件不存在!"); + System.err.println(imgPath+" 该文件不存在!"); return; } Image src = ImageIO.read(new File(imgPath)); @@ -272,7 +272,7 @@ public class QRCodeUtils { MatrixToImageWriter.writeToStream(bitMatrix, "png", new FileOutputStream(imgPath)); } catch (Exception e) { - throw new ServiceException("生产条码或二维码异常:" + e.toString()); + throw new ServiceException("生产条码或二维码异常:" + e); } } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/ecology/service/impl/EcologyFlowStationServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/ecology/service/impl/EcologyFlowStationServiceImpl.java index ddd00d1..56d7836 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/ecology/service/impl/EcologyFlowStationServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/ecology/service/impl/EcologyFlowStationServiceImpl.java @@ -32,6 +32,7 @@ import org.springframework.data.redis.core.RedisTemplate; import org.springframework.stereotype.Service; import java.math.BigDecimal; +import java.math.RoundingMode; import java.util.*; import java.util.stream.Collectors; @@ -103,10 +104,10 @@ public class EcologyFlowStationServiceImpl extends BaseServiceImpl o.getIsComplete().equals(1L)).count() / (double) stations.size() * 100).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue()); - station.setOnLine(BigDecimal.valueOf((int) stations.stream().filter(o -> o.getIsOnLine().equals(1L)).count() / (double) stations.size() * 100).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue()); - station.setDemonstrate(BigDecimal.valueOf((int) stations.stream().filter(o -> o.getIsDemonstrate().equals(1L)).count() / (double) stations.size() * 100).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue()); - station.setTimely(BigDecimal.valueOf((int) stations.stream().filter(o -> o.getIsTimely().equals(1L)).count() / (double) stations.size() * 100).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue()); + station.setComplete(BigDecimal.valueOf((int) stations.stream().filter(o -> o.getIsComplete().equals(1L)).count() / (double) stations.size() * 100).setScale(2, RoundingMode.HALF_UP).doubleValue()); + station.setOnLine(BigDecimal.valueOf((int) stations.stream().filter(o -> o.getIsOnLine().equals(1L)).count() / (double) stations.size() * 100).setScale(2, RoundingMode.HALF_UP).doubleValue()); + station.setDemonstrate(BigDecimal.valueOf((int) stations.stream().filter(o -> o.getIsDemonstrate().equals(1L)).count() / (double) stations.size() * 100).setScale(2, RoundingMode.HALF_UP).doubleValue()); + station.setTimely(BigDecimal.valueOf((int) stations.stream().filter(o -> o.getIsTimely().equals(1L)).count() / (double) stations.size() * 100).setScale(2, RoundingMode.HALF_UP).doubleValue()); station.setCount(stations.size()); List datas = dataService.list(Wrappers.lambdaQuery() @@ -228,7 +229,7 @@ public class EcologyFlowStationServiceImpl extends BaseServiceImpl item.setSolveRate(0.0); return; } - double solveRate = BigDecimal.valueOf((double)solveSucQuantity / solveQuantity * 100L).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); + double solveRate = BigDecimal.valueOf((double)solveSucQuantity / solveQuantity * 100L).setScale(2, RoundingMode.HALF_UP).doubleValue(); item.setSolveRate(solveRate); }); return R.data(pages.setRecords(list)); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/common/ExcelData.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/common/ExcelData.java index a8824e1..9f6dcc8 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/common/ExcelData.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/common/ExcelData.java @@ -1,6 +1,7 @@ package com.hnac.hzims.operational.main.common; +import lombok.Getter; import org.apache.poi.xssf.usermodel.XSSFCell; import org.apache.poi.xssf.usermodel.XSSFRow; import org.apache.poi.xssf.usermodel.XSSFSheet; @@ -12,7 +13,8 @@ import java.io.InputStream; public class ExcelData { private XSSFSheet XSSfSheet; - private XSSFWorkbook wb; + @Getter + private XSSFWorkbook wb; /** * 构造函数,初始化excel数据 @@ -83,12 +85,7 @@ public class ExcelData { } - - public XSSFWorkbook getWb() { - return wb; - } - - //测试方法 + //测试方法 // public static void main(String[] args){ // ExcelData sheet1 = new ExcelData("F:/文档/华自/运维月度报表内容设计0708.xlsx", "站长月度报告-对外"); // //获取第二行第4列 diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/config/IPageDeserializer.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/config/IPageDeserializer.java index 9f7bfc9..986e2f0 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/config/IPageDeserializer.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/config/IPageDeserializer.java @@ -23,7 +23,7 @@ public class IPageDeserializer extends StdDeserializer { } @Override - public IPage deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JacksonException { + public IPage deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException { JsonNode node = jsonParser.getCodec().readTree(jsonParser); String s = node.toString(); ObjectMapper om = new ObjectMapper(); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/enums/ColumnEnum.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/enums/ColumnEnum.java index f29d5bb..fd4ee5e 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/enums/ColumnEnum.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/enums/ColumnEnum.java @@ -1,7 +1,9 @@ package com.hnac.hzims.operational.main.enums; +import lombok.Getter; import org.springblade.core.tool.utils.StringUtil; +@Getter public enum ColumnEnum { duty_conclusion_class_col("CONCLUSION_CLASS_COUNT","值班小结班次统计"), duty_conclusion_date_col("CONCLUSION_DUTY_DATE","值班日期统计"), @@ -20,19 +22,11 @@ public enum ColumnEnum { this.des = des; } - public String getColumnName() { - return columnName; - } - - public void setColumnName(String columnName) { + public void setColumnName(String columnName) { this.columnName = columnName; } - public String getDes() { - return des; - } - - public void setDes(String des) { + public void setDes(String des) { this.des = des; } } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/AreaMonthReportServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/AreaMonthReportServiceImpl.java index 58587d6..4c4d8c7 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/AreaMonthReportServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/AreaMonthReportServiceImpl.java @@ -64,6 +64,7 @@ import javax.servlet.http.HttpServletResponse; import javax.validation.constraints.NotNull; import java.io.IOException; import java.math.BigDecimal; +import java.math.RoundingMode; import java.net.URLEncoder; import java.text.ParseException; import java.text.SimpleDateFormat; @@ -328,7 +329,7 @@ public class AreaMonthReportServiceImpl implements IAreaMonthReportService { .orElse(new ArrayList<>()).stream() .filter(s -> s.getInstalledCapacity() != null) .mapToDouble(HydropowerUnitRealVo::getInstalledCapacity).sum(); - BigDecimal sumData=new BigDecimal(sum).divide(new BigDecimal(1000),2,BigDecimal.ROUND_UP); + BigDecimal sumData=new BigDecimal(sum).divide(new BigDecimal(1000),2, RoundingMode.UP); map.put("installedCapacity", sumData); //各站点分组 @@ -486,7 +487,7 @@ public class AreaMonthReportServiceImpl implements IAreaMonthReportService { int shortagesYear = (int) levelList.getValue().stream().filter(s -> "1".equals(s.getConclusionStatus())).count(); double shortagesRate = 0d; if (findShortagesYear != 0 && shortagesYear != 0) { - shortagesRate = BigDecimal.valueOf(shortagesYear).divide(BigDecimal.valueOf(findShortagesYear), 2, BigDecimal.ROUND_UP).doubleValue(); + shortagesRate = BigDecimal.valueOf(shortagesYear).divide(BigDecimal.valueOf(findShortagesYear), 2, RoundingMode.UP).doubleValue(); } int findShortagesMon = (int) Optional.ofNullable(monPhenomenonList).orElse(new ArrayList<>()).stream().filter(s -> s.getDefectGrading().equals(levelList.getKey())).count(); int shortagesMon = (int) Optional.ofNullable(monConclusionList).orElse(new ArrayList<>()).stream().filter(s -> s.getDefectGrading().equals(levelList.getKey())).count(); @@ -502,7 +503,7 @@ public class AreaMonthReportServiceImpl implements IAreaMonthReportService { .filter(s -> s.getDefectGrading().equals(levelPhenomenon.getKey())).count(); double shortagesRate = 0d; if (findShortagesYear != 0 && shortagesYear != 0) { - shortagesRate = BigDecimal.valueOf(shortagesYear).divide(BigDecimal.valueOf(findShortagesYear), 2, BigDecimal.ROUND_UP).doubleValue(); + shortagesRate = BigDecimal.valueOf(shortagesYear).divide(BigDecimal.valueOf(findShortagesYear), 2, RoundingMode.UP).doubleValue(); } int findShortagesMon = (int) Optional.ofNullable(monPhenomenonList).orElse(new ArrayList<>()).stream().filter(s -> s.getDefectGrading().equals(levelPhenomenon.getKey())).count(); int shortagesMon = (int) Optional.ofNullable(monConclusionList).orElse(new ArrayList<>()).stream().filter(s -> s.getDefectGrading().equals(levelPhenomenon.getKey())).count(); @@ -572,7 +573,7 @@ public class AreaMonthReportServiceImpl implements IAreaMonthReportService { ticketChartCell.setTicketYearPassCount(0); R ticketPassCount = ticketInfoClient.getTicketPassByIds(ticketIds); if (ticketPassCount.isSuccess() && ticketPassCount.getData() != null && count != 0) { - double ticketYearPerc = BigDecimal.valueOf(ticketPassCount.getData()).divide(BigDecimal.valueOf(count), 2, BigDecimal.ROUND_UP).doubleValue(); + double ticketYearPerc = BigDecimal.valueOf(ticketPassCount.getData()).divide(BigDecimal.valueOf(count), 2, RoundingMode.UP).doubleValue(); ticketChartCell.setTicketYeaPercr(ticketYearPerc); ticketChartCell.setTicketYearPassCount(ticketPassCount.getData().intValue()); } @@ -586,7 +587,7 @@ public class AreaMonthReportServiceImpl implements IAreaMonthReportService { R ticketMonthPassCount = ticketInfoClient.getTicketPassByIds(monthTicketIds); ticketChartCell.setTicketMonPassCount(0); if (ticketMonthPassCount.isSuccess() && ticketMonthPassCount.getData() != null && count != 0) { - double ticketMonthPerc = BigDecimal.valueOf(ticketMonthPassCount.getData()).divide(BigDecimal.valueOf(count), 2, BigDecimal.ROUND_UP).doubleValue(); + double ticketMonthPerc = BigDecimal.valueOf(ticketMonthPassCount.getData()).divide(BigDecimal.valueOf(count), 2, RoundingMode.UP).doubleValue(); ticketChartCell.setTicketMonPerc(ticketMonthPerc); ticketChartCell.setTicketMonPassCount(ticketMonthPassCount.getData().intValue()); } @@ -609,7 +610,7 @@ public class AreaMonthReportServiceImpl implements IAreaMonthReportService { R ticketPassCount = ticketInfoClient.getTicketPassByIds(ticketIds); ticketChartCell.setTicketYearPassCount(0); if (ticketPassCount.isSuccess() && ticketPassCount.getData() != null && count != 0) { - double ticketYearPerc = BigDecimal.valueOf(ticketPassCount.getData()).divide(BigDecimal.valueOf(count), 2, BigDecimal.ROUND_UP).doubleValue(); + double ticketYearPerc = BigDecimal.valueOf(ticketPassCount.getData()).divide(BigDecimal.valueOf(count), 2, RoundingMode.UP).doubleValue(); ticketChartCell.setTicketYeaPercr(ticketYearPerc); ticketChartCell.setTicketYearPassCount(ticketPassCount.getData().intValue()); } @@ -622,7 +623,7 @@ public class AreaMonthReportServiceImpl implements IAreaMonthReportService { R ticketMonthPassCount = ticketInfoClient.getTicketPassByIds(monthTicketIds); ticketChartCell.setTicketMonPassCount(0); if (ticketMonthPassCount.isSuccess() && ticketMonthPassCount.getData() != null && count != 0) { - double ticketMonthPerc = BigDecimal.valueOf(ticketMonthPassCount.getData()).divide(BigDecimal.valueOf(count), 2, BigDecimal.ROUND_UP).doubleValue(); + double ticketMonthPerc = BigDecimal.valueOf(ticketMonthPassCount.getData()).divide(BigDecimal.valueOf(count), 2, RoundingMode.UP).doubleValue(); ticketChartCell.setTicketMonPerc(ticketMonthPerc); ticketChartCell.setTicketMonPassCount(ticketMonthPassCount.getData().intValue()); } @@ -651,11 +652,11 @@ public class AreaMonthReportServiceImpl implements IAreaMonthReportService { int sumTicketMonPass = ticketChartValue.stream().mapToInt(TicketChartCell::getTicketMonPassCount).sum(); int sumTicketYearPass = ticketChartValue.stream().mapToInt(TicketChartCell::getTicketYearPassCount).sum(); if (sumTicketMonPass>0&&sumTicketMon>0){ - BigDecimal monPassPerc = new BigDecimal(sumTicketMonPass).divide(new BigDecimal(sumTicketMon), 2, BigDecimal.ROUND_UP); + BigDecimal monPassPerc = new BigDecimal(sumTicketMonPass).divide(new BigDecimal(sumTicketMon), 2, RoundingMode.UP); sumCell.setTicketMonPerc(monPassPerc.doubleValue()); } if (sumTicketYear>0&&sumTicketYearPass>0){ - BigDecimal yearPassPerc = new BigDecimal(sumTicketYearPass).divide(new BigDecimal(sumTicketYear), 2, BigDecimal.ROUND_UP); + BigDecimal yearPassPerc = new BigDecimal(sumTicketYearPass).divide(new BigDecimal(sumTicketYear), 2, RoundingMode.UP); sumCell.setTicketYeaPercr(yearPassPerc.doubleValue()); } sumCollect.add(sumCell); @@ -679,8 +680,8 @@ public class AreaMonthReportServiceImpl implements IAreaMonthReportService { ticketMap2.put("info", "合格率"); ticketMap.put("ticketMon" + ticketType, String.valueOf(chartCell.getTicketMon())); ticketMap.put("ticketYear" + ticketType, String.valueOf(chartCell.getTicketYear())); - ticketMap2.put("ticketMon" + ticketType, new BigDecimal(chartCell.getTicketMonPerc()).multiply(new BigDecimal(100)).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue() + "%"); - ticketMap2.put("ticketYear" + ticketType,new BigDecimal(chartCell.getTicketYeaPercr()).multiply(new BigDecimal(100)).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()+ "%"); + ticketMap2.put("ticketMon" + ticketType, BigDecimal.valueOf(chartCell.getTicketMonPerc()).multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP).doubleValue() + "%"); + ticketMap2.put("ticketYear" + ticketType, BigDecimal.valueOf(chartCell.getTicketYeaPercr()).multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP).doubleValue()+ "%"); } ticketListRes.add(ticketMap); ticketListRes.add(ticketMap2); @@ -743,26 +744,26 @@ public class AreaMonthReportServiceImpl implements IAreaMonthReportService { //今年发电量 powerYear=value.entrySet().stream().filter(s->listByYear.contains(s.getKey())).map(s->BigDecimal.valueOf(s.getValue())).reduce(BigDecimal.ZERO, BigDecimal::add); //转换单位kwh-》万Kwh - powerYear=powerYear.divide(new BigDecimal(10000),2,BigDecimal.ROUND_UP).setScale(2,BigDecimal.ROUND_UP); + powerYear=powerYear.divide(new BigDecimal(10000),2, RoundingMode.UP).setScale(2, RoundingMode.UP); powerYearBefore=value.entrySet().stream().filter(s->listByYearBefore.contains(s.getKey())).map(s->BigDecimal.valueOf(s.getValue())).reduce(BigDecimal.ZERO, BigDecimal::add); - powerYearBefore=powerYearBefore.divide(new BigDecimal(10000),2,BigDecimal.ROUND_UP).setScale(2,BigDecimal.ROUND_UP); + powerYearBefore=powerYearBefore.divide(new BigDecimal(10000),2, RoundingMode.UP).setScale(2, RoundingMode.UP); powerMonth=value.entrySet().stream().filter(s->monStart.equals(s.getKey())).map(s->BigDecimal.valueOf(s.getValue())).reduce(BigDecimal.ZERO, BigDecimal::add); - powerMonth=powerMonth.divide(new BigDecimal(10000),2,BigDecimal.ROUND_UP).setScale(2,BigDecimal.ROUND_UP); + powerMonth=powerMonth.divide(new BigDecimal(10000),2, RoundingMode.UP).setScale(2, RoundingMode.UP); powerMonthBefore=value.entrySet().stream().filter(s->monStartMonBefore.equals(s.getKey())).map(s->BigDecimal.valueOf(s.getValue())).reduce(BigDecimal.ZERO, BigDecimal::add); - powerMonthBefore=powerMonthBefore.divide(new BigDecimal(10000),2,BigDecimal.ROUND_UP).setScale(2,BigDecimal.ROUND_UP); + powerMonthBefore=powerMonthBefore.divide(new BigDecimal(10000),2, RoundingMode.UP).setScale(2, RoundingMode.UP); powerMonthYearBefore=value.entrySet().stream().filter(s->monStartYearBefore.equals(s.getKey())).map(s->BigDecimal.valueOf(s.getValue())).reduce(BigDecimal.ZERO, BigDecimal::add); - powerMonthYearBefore=powerMonthYearBefore.divide(new BigDecimal(10000),2,BigDecimal.ROUND_UP).setScale(2,BigDecimal.ROUND_UP).setScale(2,BigDecimal.ROUND_UP); + powerMonthYearBefore=powerMonthYearBefore.divide(new BigDecimal(10000),2, RoundingMode.UP).setScale(2, RoundingMode.UP).setScale(2, RoundingMode.UP); powerVo.setPowerYear(powerYear.doubleValue()); powerVo.setPowerYearBefore(powerYearBefore.doubleValue()); BigDecimal yearPercentage = new BigDecimal(0); BigDecimal planPercentage = new BigDecimal(0); if (powerYearBefore.compareTo(BigDecimal.ZERO) != 0) { - yearPercentage = (powerYear.subtract(powerYearBefore)).divide(powerYearBefore, 2, BigDecimal.ROUND_UP); - yearPercentage.setScale(2, BigDecimal.ROUND_UP); + yearPercentage = (powerYear.subtract(powerYearBefore)).divide(powerYearBefore, 2, RoundingMode.UP); + yearPercentage.setScale(2, RoundingMode.UP); } if (BigDecimal.valueOf(planGeneration).compareTo(BigDecimal.ZERO) != 0) { - planPercentage = powerYear.divide(BigDecimal.valueOf(planGeneration), 2, BigDecimal.ROUND_UP); - planPercentage.setScale(2, BigDecimal.ROUND_UP); + planPercentage = powerYear.divide(BigDecimal.valueOf(planGeneration), 2, RoundingMode.UP); + planPercentage.setScale(2, RoundingMode.UP); } powerVo.setPlanPercentage(planPercentage.doubleValue()); powerVo.setPowerYearPercentage(yearPercentage.doubleValue()); @@ -771,8 +772,8 @@ public class AreaMonthReportServiceImpl implements IAreaMonthReportService { powerVo.setPowerMonYearBefore(powerMonthYearBefore.doubleValue()); BigDecimal monPercentage = new BigDecimal(0); if (powerMonthYearBefore.compareTo(BigDecimal.ZERO) != 0) { - monPercentage = (powerMonth.subtract(powerMonthYearBefore)).divide(powerMonthYearBefore, 2, BigDecimal.ROUND_UP); - monPercentage.setScale(2, BigDecimal.ROUND_UP); + monPercentage = (powerMonth.subtract(powerMonthYearBefore)).divide(powerMonthYearBefore, 2, RoundingMode.UP); + monPercentage.setScale(2, RoundingMode.UP); } powerVo.setPowerMonPercentage(monPercentage.doubleValue()); powerPercentageVoList.add(powerVo); @@ -846,10 +847,10 @@ public class AreaMonthReportServiceImpl implements IAreaMonthReportService { BigDecimal yearPercentage = new BigDecimal(0); BigDecimal planPercentage = new BigDecimal(0); if (powerYearBefore.compareTo(BigDecimal.ZERO) != 0) { - yearPercentage = (powerYear.subtract(powerYearBefore)).divide(powerYearBefore, 2, BigDecimal.ROUND_UP); + yearPercentage = (powerYear.subtract(powerYearBefore)).divide(powerYearBefore, 2, RoundingMode.UP); } if (BigDecimal.valueOf(planGeneration).compareTo(BigDecimal.ZERO) != 0) { - planPercentage = powerYear.divide(BigDecimal.valueOf(planGeneration), 2, BigDecimal.ROUND_UP); + planPercentage = powerYear.divide(BigDecimal.valueOf(planGeneration), 2, RoundingMode.UP); } powerVo.setPlanPercentage(planPercentage.doubleValue()); powerVo.setPowerYearPercentage(yearPercentage.doubleValue()); @@ -858,7 +859,7 @@ public class AreaMonthReportServiceImpl implements IAreaMonthReportService { powerVo.setPowerMonYearBefore(powerMonthYearBefore.doubleValue()); BigDecimal monPercentage = new BigDecimal(0); if (powerMonthYearBefore.compareTo(BigDecimal.ZERO) != 0) { - monPercentage = (powerMonth.subtract(powerMonthYearBefore)).divide(powerMonthYearBefore, 2, BigDecimal.ROUND_UP); + monPercentage = (powerMonth.subtract(powerMonthYearBefore)).divide(powerMonthYearBefore, 2, RoundingMode.UP); } powerVo.setPowerMonPercentage(monPercentage.doubleValue()); powerPercentageVoList.add(powerVo); @@ -891,11 +892,11 @@ public class AreaMonthReportServiceImpl implements IAreaMonthReportService { BigDecimal planPercentage = new BigDecimal(0); if (powerYearBefore.compareTo(BigDecimal.ZERO) != 0) { // 年累计环比 - yearPercentage = (powerYear.subtract(powerYearBefore)).divide(powerYearBefore, 2, BigDecimal.ROUND_UP); + yearPercentage = (powerYear.subtract(powerYearBefore)).divide(powerYearBefore, 2, RoundingMode.UP); } if (BigDecimal.valueOf(planGeneration).compareTo(BigDecimal.ZERO) != 0) { //因为计划发电量的单位是kwh,发电量已经转换为万kwh,再加上百分比转换所以需要乘以10000*100 - planPercentage = powerYear.divide(BigDecimal.valueOf(planGeneration).divide(new BigDecimal(1000000)), 2, BigDecimal.ROUND_UP); + planPercentage = powerYear.divide(BigDecimal.valueOf(planGeneration).divide(new BigDecimal(1000000)), 2, RoundingMode.UP); // 年计划完成率 map.put("yearCompletionRate", planPercentage.toString()); } else { @@ -913,7 +914,7 @@ public class AreaMonthReportServiceImpl implements IAreaMonthReportService { BigDecimal planMonPercentage = new BigDecimal(0); if (powerMonth.compareTo(BigDecimal.ZERO) != 0 && BigDecimal.valueOf(planMonGeneration).compareTo(BigDecimal.ZERO) != 0) { //因为计划发电量的单位是kwh,发电量已经转换为万kwh,再加上百分比转换所以需要乘以10000*100 - planMonPercentage = powerMonth.divide(BigDecimal.valueOf(planMonGeneration).divide(new BigDecimal(1000000)), 2, BigDecimal.ROUND_UP); + planMonPercentage = powerMonth.divide(BigDecimal.valueOf(planMonGeneration).divide(new BigDecimal(1000000)), 2, RoundingMode.UP); } map.put("monCompletionRate", planMonPercentage); BigDecimal powerMonthBefore = powerPercentageVoList.stream() @@ -926,14 +927,14 @@ public class AreaMonthReportServiceImpl implements IAreaMonthReportService { powerVo.setPowerMonYearBefore(powerMonthYearBefore.doubleValue()); BigDecimal monPercentage = new BigDecimal(0); if (powerMonthYearBefore.compareTo(BigDecimal.ZERO) != 0) { - monPercentage = (powerMonth.subtract(powerMonthYearBefore)).divide(powerMonthYearBefore, 2, BigDecimal.ROUND_UP); + monPercentage = (powerMonth.subtract(powerMonthYearBefore)).divide(powerMonthYearBefore, 2, RoundingMode.UP); } //发电量环比增加 BigDecimal monAdd = powerMonth.subtract(powerMonthBefore); if (powerMonthBefore.compareTo(BigDecimal.ZERO) == 0) { map.put("percentageAdd", 0); } else { - map.put("percentageAdd", monAdd.divide(powerMonthBefore, 2, BigDecimal.ROUND_UP).toString()); + map.put("percentageAdd", monAdd.divide(powerMonthBefore, 2, RoundingMode.UP).toString()); } powerVo.setPowerMonPercentage(monPercentage.doubleValue()); powerPercentageVoList.add(powerVo); @@ -1407,7 +1408,7 @@ public class AreaMonthReportServiceImpl implements IAreaMonthReportService { if (Math.abs(oldActualPower) <= 0 && Math.abs(oldOldActualPower) <= 0) { return; } - double predictPlanPower = BigDecimal.valueOf((oldActualPower + oldOldActualPower) / 2).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); + double predictPlanPower = BigDecimal.valueOf((oldActualPower + oldOldActualPower) / 2).setScale(2, RoundingMode.HALF_UP).doubleValue(); areaMonthReport.setPredictPlanPower(predictPlanPower); } @@ -1571,7 +1572,7 @@ public class AreaMonthReportServiceImpl implements IAreaMonthReportService { areaMonthReport.setPowerFinishRate(0.0); } else { // 发电完成率 - double powerFinishRate = BigDecimal.valueOf(actualPower / planPower * 100).setScale(1, BigDecimal.ROUND_HALF_UP).doubleValue(); + double powerFinishRate = BigDecimal.valueOf(actualPower / planPower * 100).setScale(1, RoundingMode.HALF_UP).doubleValue(); areaMonthReport.setPowerFinishRate(powerFinishRate); } // 同比 @@ -1580,7 +1581,7 @@ public class AreaMonthReportServiceImpl implements IAreaMonthReportService { areaMonthReport.setComparePowerRate(0.0); return; } - double comparePowerRate = BigDecimal.valueOf(actualPower / oldActualPower).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); + double comparePowerRate = BigDecimal.valueOf(actualPower / oldActualPower).setScale(2, RoundingMode.HALF_UP).doubleValue(); areaMonthReport.setComparePowerRate(comparePowerRate); } @@ -1612,7 +1613,7 @@ public class AreaMonthReportServiceImpl implements IAreaMonthReportService { if (operateQualify <= 0) { areaMonthReport.setOperaQualifyRate(0.0); } else { - double operateQualifyRate = BigDecimal.valueOf(operateQualify / (double) operate * 100L).setScale(1, BigDecimal.ROUND_HALF_UP).doubleValue(); + double operateQualifyRate = BigDecimal.valueOf(operateQualify / (double) operate * 100L).setScale(1, RoundingMode.HALF_UP).doubleValue(); areaMonthReport.setOperaQualifyRate(operateQualifyRate); } //工作票 @@ -1622,7 +1623,7 @@ public class AreaMonthReportServiceImpl implements IAreaMonthReportService { if (workQualify <= 0) { areaMonthReport.setWorkQualifyRate(0.0); } else { - double workQualifyRate = BigDecimal.valueOf(workQualify / (double) work * 100L).setScale(1, BigDecimal.ROUND_HALF_UP).doubleValue(); + double workQualifyRate = BigDecimal.valueOf(workQualify / (double) work * 100L).setScale(1, RoundingMode.HALF_UP).doubleValue(); areaMonthReport.setWorkQualifyRate(workQualifyRate); } } @@ -1671,7 +1672,7 @@ public class AreaMonthReportServiceImpl implements IAreaMonthReportService { if (defectSum <= 0) { areaMonthReport.setDefectRate(0.0); } else { - double deletionRate = BigDecimal.valueOf(defect / defectSum * 100L).setScale(1, BigDecimal.ROUND_HALF_UP).doubleValue(); + double deletionRate = BigDecimal.valueOf(defect / defectSum * 100L).setScale(1, RoundingMode.HALF_UP).doubleValue(); areaMonthReport.setDefectRate(deletionRate); } countDownLatch.countDown(); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HomeServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HomeServiceImpl.java index 3d22cd3..3501ff6 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HomeServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HomeServiceImpl.java @@ -39,6 +39,7 @@ import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.math.BigDecimal; +import java.math.RoundingMode; import java.net.HttpURLConnection; import java.net.URL; import java.nio.charset.StandardCharsets; @@ -217,7 +218,7 @@ public class HomeServiceImpl implements HomeService { if(CollectionUtil.isNotEmpty(plans)){ double plan = plans.stream().mapToDouble(PlanGenerationEntity::getPlanGeneration).sum(); if(Math.abs(plan) > 0){ - target.setTaget_three(BigDecimal.valueOf(target.getTaget_two() / plan * 100).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue()); + target.setTaget_three(BigDecimal.valueOf(target.getTaget_two() / plan * 100).setScale(2, RoundingMode.HALF_UP).doubleValue()); } } } @@ -274,7 +275,7 @@ public class HomeServiceImpl implements HomeService { target.setTaget_two(power); if(Math.abs(plan) > 0){ // 发电完成率 - target.setTaget_three(BigDecimal.valueOf(power / plan * 100).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue()); + target.setTaget_three(BigDecimal.valueOf(power / plan * 100).setScale(2, RoundingMode.HALF_UP).doubleValue()); } // 双票合格率 LocalDate firstDay = LocalDate.now().withDayOfYear(1); @@ -330,10 +331,10 @@ public class HomeServiceImpl implements HomeService { double pass = list.stream().mapToDouble(power -> Double.parseDouble(power.getDoubleQualifyRate())).sum(); if(Math.abs(plan) > 0){ // 发电完成率 - target.setTaget_three(BigDecimal.valueOf(target.getTaget_two() / plan * 100).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue()); + target.setTaget_three(BigDecimal.valueOf(target.getTaget_two() / plan * 100).setScale(2, RoundingMode.HALF_UP).doubleValue()); } // 双票合格率 - target.setTaget_four(BigDecimal.valueOf(pass / list.size()).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue()); + target.setTaget_four(BigDecimal.valueOf(pass / list.size()).setScale(2, RoundingMode.HALF_UP).doubleValue()); } return target; } @@ -479,7 +480,7 @@ public class HomeServiceImpl implements HomeService { // FA上线率 double online = others.stream().mapToDouble(o-> Double.parseDouble(o.getOnlineRate())).sum(); if(Math.abs(online) > 0){ - target.setTaget_three(BigDecimal.valueOf(online / others.size()).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue()); + target.setTaget_three(BigDecimal.valueOf(online / others.size()).setScale(2, RoundingMode.HALF_UP).doubleValue()); } // FA投入条数 target.setTaget_four(others.stream().mapToDouble(OtherEntity::getFaQuantity).sum()); @@ -607,7 +608,7 @@ public class HomeServiceImpl implements HomeService { if(CollectionUtil.isNotEmpty(plans)){ double plan = plans.stream().mapToDouble(PlanGenerationEntity::getPlanGeneration).sum(); if(Math.abs(plan) > 0){ - target.setTaget_three(BigDecimal.valueOf(target.getTaget_two() / plan * 100).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue()); + target.setTaget_three(BigDecimal.valueOf(target.getTaget_two() / plan * 100).setScale(2, RoundingMode.HALF_UP).doubleValue()); } } } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HydropowerServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HydropowerServiceImpl.java index 266387d..e4a04b0 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HydropowerServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HydropowerServiceImpl.java @@ -840,7 +840,7 @@ public class HydropowerServiceImpl implements HydropowerService { if(Math.abs(planPowerYear) <= 0){ response.setPowerRateYear(0.0); } else { - double powerRateYear = BigDecimal.valueOf(powerYear / planPowerYear * 100).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); + double powerRateYear = BigDecimal.valueOf(powerYear / planPowerYear * 100).setScale(2, RoundingMode.HALF_UP).doubleValue(); response.setPowerRateYear(powerRateYear); } } @@ -1032,7 +1032,7 @@ public class HydropowerServiceImpl implements HydropowerService { if (Math.abs(kpi.getInstalledCapacity()) <= 0) { kpi.setCapacityRate(0.0); }else{ - kpi.setCapacityRate(BigDecimal.valueOf(kpi.getLoad() / kpi.getInstalledCapacity() * 100).setScale(1, BigDecimal.ROUND_HALF_UP).doubleValue()); + kpi.setCapacityRate(BigDecimal.valueOf(kpi.getLoad() / kpi.getInstalledCapacity() * 100).setScale(1, RoundingMode.HALF_UP).doubleValue()); } } } @@ -1053,7 +1053,7 @@ public class HydropowerServiceImpl implements HydropowerService { if(Math.abs(plan) <= 0){ kpi.setPlanRate(0.0); }else{ - kpi.setPlanRate(BigDecimal.valueOf(kpi.getGenerateYear() / plan * 100).setScale(1, BigDecimal.ROUND_HALF_UP).doubleValue()); + kpi.setPlanRate(BigDecimal.valueOf(kpi.getGenerateYear() / plan * 100).setScale(1, RoundingMode.HALF_UP).doubleValue()); } } @@ -1114,7 +1114,7 @@ public class HydropowerServiceImpl implements HydropowerService { // 当年计划发电量 double generatePlan = plans.stream().filter(plan-> entry.getValue().stream().map(StationEntity::getCode).collect(Collectors.toList()).contains(plan.getStationId())).mapToDouble(PlanGenerationEntity::getPlanGeneration).sum(); if(Math.abs(generatePlan) > 0){ - scale.setGenerationRate(BigDecimal.valueOf(generate / generatePlan * 100).setScale(1, BigDecimal.ROUND_HALF_UP).doubleValue()); + scale.setGenerationRate(BigDecimal.valueOf(generate / generatePlan * 100).setScale(1, RoundingMode.HALF_UP).doubleValue()); }else{ scale.setGenerationRate(0.0); } @@ -1136,7 +1136,7 @@ public class HydropowerServiceImpl implements HydropowerService { // 装机容量 double capacity = reals.stream().filter(real-> entry.getValue().stream().map(StationEntity::getRefDept).collect(Collectors.toList()).contains(real.getDeptId())).mapToDouble(HydropowerUnitRealVo::getInstalledCapacity).sum(); if(Math.abs(capacity) > 0){ - scale.setCapacityUse(BigDecimal.valueOf(use / capacity * 100).setScale(1, BigDecimal.ROUND_HALF_UP).doubleValue()); + scale.setCapacityUse(BigDecimal.valueOf(use / capacity * 100).setScale(1, RoundingMode.HALF_UP).doubleValue()); }else{ scale.setCapacityUse(0.0); } @@ -1147,7 +1147,7 @@ public class HydropowerServiceImpl implements HydropowerService { long on = reals.stream().filter(real -> entry.getValue().stream().map(StationEntity::getRefDept).collect(Collectors.toList()).contains(real.getDeptId()) && real.getState()).count(); long sum = reals.stream().filter(real->entry.getValue().stream().map(StationEntity::getRefDept).collect(Collectors.toList()).contains(real.getDeptId())).count(); if(Math.abs(sum) > 0){ - scale.setDeviceUse(BigDecimal.valueOf(on / (double)sum * 100).setScale(1, BigDecimal.ROUND_HALF_UP).doubleValue()); + scale.setDeviceUse(BigDecimal.valueOf(on / (double)sum * 100).setScale(1, RoundingMode.HALF_UP).doubleValue()); } } return scale; @@ -1155,7 +1155,7 @@ public class HydropowerServiceImpl implements HydropowerService { double generate_sum = scales.stream().mapToDouble(AreaScaleVo::getPowerYear).sum(); // 返回结果集 if(Math.abs(generate_sum) > 0){ - return scales.stream().peek(scale-> scale.setAreaMakeUp(BigDecimal.valueOf(scale.getPowerYear() / generate_sum * 100).setScale(1, BigDecimal.ROUND_HALF_UP).doubleValue())). + return scales.stream().peek(scale-> scale.setAreaMakeUp(BigDecimal.valueOf(scale.getPowerYear() / generate_sum * 100).setScale(1, RoundingMode.HALF_UP).doubleValue())). filter(scale-> Math.abs(scale.getCapacityUse()) > 0 || Math.abs(scale.getAreaMakeUp()) > 0 || Math.abs(scale.getDeviceUse()) > 0 || Math.abs(scale.getGenerationRate()) > 0) .sorted(Comparator.comparing(AreaScaleVo::getPowerYear).reversed()).collect(Collectors.toList()); @@ -1298,7 +1298,7 @@ public class HydropowerServiceImpl implements HydropowerService { area.setReality(this.appAreaReality(entry.getValue(),targets)); // 发电完成率 if(Math.abs(plan) > 0){ - area.setRate(BigDecimal.valueOf(area.getReality() / plan *100).setScale(1, BigDecimal.ROUND_HALF_UP).doubleValue()); + area.setRate(BigDecimal.valueOf(area.getReality() / plan *100).setScale(1, RoundingMode.HALF_UP).doubleValue()); }else{ area.setRate(0.0); } @@ -1686,7 +1686,7 @@ public class HydropowerServiceImpl implements HydropowerService { if(Math.abs(taskSum) <= 0){ item.setTaskRate(0.0); }else{ - double taskRate = BigDecimal.valueOf((double)finishSum / (double)taskSum * 100).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); + double taskRate = BigDecimal.valueOf((double)finishSum / (double)taskSum * 100).setScale(2, RoundingMode.HALF_UP).doubleValue(); item.setTaskRate(taskRate); } return item; 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 c176274..08c828d 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 @@ -53,6 +53,7 @@ import org.springframework.data.redis.core.RedisTemplate; import org.springframework.stereotype.Service; import java.math.BigDecimal; +import java.math.RoundingMode; import java.text.SimpleDateFormat; import java.time.Duration; import java.time.LocalDate; @@ -1367,7 +1368,7 @@ public class MainSystemMonitoringServiceImpl implements IMainSystemMonitoringSer //当前机构近三年的数据 Map value = deviceMap.getValue(); //当月发电量 - BigDecimal powerMon = value.entrySet().stream().filter(s -> currentMon.equals(s.getKey())).map(s -> BigDecimal.valueOf(s.getValue()).setScale(1,BigDecimal.ROUND_UP)).reduce(BigDecimal.ZERO, BigDecimal::add); + BigDecimal powerMon = value.entrySet().stream().filter(s -> currentMon.equals(s.getKey())).map(s -> BigDecimal.valueOf(s.getValue()).setScale(1, RoundingMode.UP)).reduce(BigDecimal.ZERO, BigDecimal::add); stationReportVO.setFinishPowerMon(powerMon.toString()); //获取计划月发电量 R planPowerMonR = planGenertionClient.planGenerationMonthCount(stationEntity.getCode(), month); @@ -1377,25 +1378,25 @@ public class MainSystemMonitoringServiceImpl implements IMainSystemMonitoringSer } stationReportVO.setPowerMonPlan(planPowerMon); //当年发电量 - BigDecimal powerYear = value.entrySet().stream().filter(s -> listByYear.contains(s.getKey())).map(s -> BigDecimal.valueOf(s.getValue()).setScale(1,BigDecimal.ROUND_UP)).reduce(BigDecimal.ZERO, BigDecimal::add); + BigDecimal powerYear = value.entrySet().stream().filter(s -> listByYear.contains(s.getKey())).map(s -> BigDecimal.valueOf(s.getValue()).setScale(1, RoundingMode.UP)).reduce(BigDecimal.ZERO, BigDecimal::add); stationReportVO.setFinishPowerYear(powerYear.toString()); //获取计划年发电量 - Double planPowerYear = planGenertionClient.getPlanPowerYear(Arrays.asList(stationEntity.getId().toString()), yearMon[0]); + Double planPowerYear = planGenertionClient.getPlanPowerYear(Collections.singletonList(stationEntity.getId().toString()), yearMon[0]); stationReportVO.setPowerYearPlan(planPowerYear); if (ObjectUtil.isNotEmpty(stationReportVO.getPowerMonPlan()) &&ObjectUtil.isNotEmpty(stationReportVO.getFinishPowerMon()) - &&new BigDecimal(stationReportVO.getPowerMonPlan()).compareTo(BigDecimal.ZERO)!=0){ + && BigDecimal.valueOf(stationReportVO.getPowerMonPlan()).compareTo(BigDecimal.ZERO)!=0){ BigDecimal monRate = new BigDecimal(stationReportVO.getFinishPowerMon()).multiply(new BigDecimal(100)) - .divide(new BigDecimal(stationReportVO.getPowerMonPlan()), 2, BigDecimal.ROUND_UP); + .divide(BigDecimal.valueOf(stationReportVO.getPowerMonPlan()), 2, RoundingMode.UP); stationReportVO.setPowerMonRate(monRate.doubleValue()+"%"); }else { stationReportVO.setPowerMonRate(new Double(0)+"%"); } if (ObjectUtil.isNotEmpty(stationReportVO.getFinishPowerYear()) &&ObjectUtil.isNotEmpty(stationReportVO.getPowerYearPlan()) - &&new BigDecimal(stationReportVO.getPowerYearPlan()).compareTo(BigDecimal.ZERO)!=0){ + && BigDecimal.valueOf(stationReportVO.getPowerYearPlan()).compareTo(BigDecimal.ZERO)!=0){ BigDecimal yearRate = new BigDecimal(stationReportVO.getFinishPowerYear()).multiply(new BigDecimal(100)) - .divide(new BigDecimal(stationReportVO.getPowerYearPlan()), 2, BigDecimal.ROUND_UP); + .divide(BigDecimal.valueOf(stationReportVO.getPowerYearPlan()), 2, RoundingMode.UP); stationReportVO.setPowerYearRate(yearRate.doubleValue()+"%"); }else { stationReportVO.setPowerYearRate(new Double(0)+"%"); @@ -1472,12 +1473,12 @@ public class MainSystemMonitoringServiceImpl implements IMainSystemMonitoringSer } } } - Double finishPowerMon = new BigDecimal(powerCount.get()).doubleValue(); + Double finishPowerMon = BigDecimal.valueOf(powerCount.get()).doubleValue(); stationReportVO.setFinishPowerMon(finishPowerMon.toString()); - Double finishPowerYear = new BigDecimal(powerCountYear.get()).doubleValue(); + Double finishPowerYear = BigDecimal.valueOf(powerCountYear.get()).doubleValue(); stationReportVO.setFinishPowerYear(finishPowerYear.toString()); //当年的计划发电量 - Double planPowerYear = planGenertionClient.getPlanPowerYear(Arrays.asList(stationId), year); + Double planPowerYear = planGenertionClient.getPlanPowerYear(Collections.singletonList(stationId), year); stationReportVO.setPowerYearPlan(planPowerYear); //当月的计划发电量 R planPowerMonR = planGenertionClient.planGenerationMonthCount(stationId, month); @@ -1485,18 +1486,18 @@ public class MainSystemMonitoringServiceImpl implements IMainSystemMonitoringSer stationReportVO.setPowerMonPlan(planPowerMon); if (ObjectUtil.isNotEmpty(stationReportVO.getPowerMonPlan()) &&ObjectUtil.isNotEmpty(stationReportVO.getFinishPowerMon()) - &&new BigDecimal(stationReportVO.getPowerMonPlan()).compareTo(BigDecimal.ZERO)!=0){ + && BigDecimal.valueOf(stationReportVO.getPowerMonPlan()).compareTo(BigDecimal.ZERO)!=0){ BigDecimal monRate = new BigDecimal(stationReportVO.getFinishPowerMon()).multiply(new BigDecimal(100)) - .divide(new BigDecimal(stationReportVO.getPowerMonPlan()), 2, BigDecimal.ROUND_UP); + .divide(BigDecimal.valueOf(stationReportVO.getPowerMonPlan()), 2, RoundingMode.UP); stationReportVO.setPowerMonRate(monRate.doubleValue()+"%"); }else { stationReportVO.setPowerMonRate(new Double(0)+"%"); } if (ObjectUtil.isNotEmpty(stationReportVO.getFinishPowerYear()) &&ObjectUtil.isNotEmpty(stationReportVO.getPowerYearPlan()) - &&new BigDecimal(stationReportVO.getPowerYearPlan()).compareTo(BigDecimal.ZERO)!=0){ + && BigDecimal.valueOf(stationReportVO.getPowerYearPlan()).compareTo(BigDecimal.ZERO)!=0){ BigDecimal yearRate = new BigDecimal(stationReportVO.getFinishPowerYear()).multiply(new BigDecimal(100)) - .divide(new BigDecimal(stationReportVO.getPowerYearPlan()), 2, BigDecimal.ROUND_UP); + .divide(BigDecimal.valueOf(stationReportVO.getPowerYearPlan()), 2, RoundingMode.UP); stationReportVO.setPowerYearRate(yearRate.doubleValue()+"%"); }else { stationReportVO.setPowerYearRate(new Double(0)+"%"); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/MainTaskStatisticServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/MainTaskStatisticServiceImpl.java index 22f7753..e433b4d 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/MainTaskStatisticServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/MainTaskStatisticServiceImpl.java @@ -38,6 +38,7 @@ import org.springblade.core.tool.utils.*; import org.springframework.stereotype.Service; import java.math.BigDecimal; +import java.math.RoundingMode; import java.time.LocalDate; import java.time.LocalDateTime; import java.time.LocalTime; @@ -173,7 +174,7 @@ public class MainTaskStatisticServiceImpl implements IMainTaskStatisticService { return "0"; } // 消缺率 = (缺陷数 / 总数) * 100 - double finishRate = BigDecimal.valueOf(finishTask.size() / (double) pTaskList.size() * 100).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); + double finishRate = BigDecimal.valueOf(finishTask.size() / (double) pTaskList.size() * 100).setScale(2, RoundingMode.HALF_UP).doubleValue(); return String.valueOf(finishRate); } @@ -388,7 +389,7 @@ public class MainTaskStatisticServiceImpl implements IMainTaskStatisticService { && MaintenanceConstant.TASK_STATUS_4 == task.getStatus()).collect(Collectors.toList()); mainTaskStatisticDTO.setTaskTotal(mTaskList.size()); mainTaskStatisticDTO.setTaskFinishAmount(finishTask.size()); - double finishRate = new BigDecimal(finishTask.size() / (double) mTaskList.size() * 100).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); + double finishRate = BigDecimal.valueOf(finishTask.size() / (double) mTaskList.size() * 100).setScale(2, RoundingMode.HALF_UP).doubleValue(); mainTaskStatisticDTO.setFinishRate(finishRate); } @@ -419,7 +420,7 @@ public class MainTaskStatisticServiceImpl implements IMainTaskStatisticService { && AccessConstants.ACCESS_TASK_STATUS_4 == task.getStatus()).collect(Collectors.toList()); mainTaskStatisticDTO.setTaskTotal(aTaskList.size()); mainTaskStatisticDTO.setTaskFinishAmount(finishTask.size()); - double finishRate = new BigDecimal(finishTask.size() / (double) aTaskList.size() * 100).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); + double finishRate = BigDecimal.valueOf(finishTask.size() / (double) aTaskList.size() * 100).setScale(2, RoundingMode.HALF_UP).doubleValue(); mainTaskStatisticDTO.setFinishRate(finishRate); } else { @@ -451,7 +452,7 @@ public class MainTaskStatisticServiceImpl implements IMainTaskStatisticService { ).collect(Collectors.toList()); mainTaskStatisticDTO.setTaskTotal(pTaskList.size()); mainTaskStatisticDTO.setTaskFinishAmount(finishTask.size()); - double finishRate = new BigDecimal(finishTask.size() / (double) pTaskList.size() * 100).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); + double finishRate = BigDecimal.valueOf(finishTask.size() / (double) pTaskList.size() * 100).setScale(2, RoundingMode.HALF_UP).doubleValue(); mainTaskStatisticDTO.setFinishRate(finishRate); } else { @@ -478,7 +479,7 @@ public class MainTaskStatisticServiceImpl implements IMainTaskStatisticService { && TicketConstants.FirstWorkTicketFlowStatusEnum.FINISH.getStatus().equals(task.getStatus())).collect(Collectors.toList()); mainTaskStatisticDTO.setTaskTotal(workTicketListR.getData().size()); mainTaskStatisticDTO.setTaskFinishAmount(finishTask.size()); - double finishRate = new BigDecimal(finishTask.size() / (double) workTicketListR.getData().size() * 100).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); + double finishRate = BigDecimal.valueOf(finishTask.size() / (double) workTicketListR.getData().size() * 100).setScale(2, RoundingMode.HALF_UP).doubleValue(); mainTaskStatisticDTO.setFinishRate(finishRate); } else { @@ -505,7 +506,7 @@ public class MainTaskStatisticServiceImpl implements IMainTaskStatisticService { && TicketConstants.StandardTicketStatusEnum.END.getStatus().equals(task.getStatus())).collect(Collectors.toList()); mainTaskStatisticDTO.setTaskTotal(operateTicketListR.getData().size()); mainTaskStatisticDTO.setTaskFinishAmount(finishTask.size()); - double finishRate = new BigDecimal(finishTask.size() / (double) operateTicketListR.getData().size() * 100).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); + double finishRate = BigDecimal.valueOf(finishTask.size() / (double) operateTicketListR.getData().size() * 100).setScale(2, RoundingMode.HALF_UP).doubleValue(); mainTaskStatisticDTO.setFinishRate(finishRate); } else { diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/PVAppMainServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/PVAppMainServiceImpl.java index bb935d0..ab1a175 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/PVAppMainServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/PVAppMainServiceImpl.java @@ -31,6 +31,7 @@ import org.springframework.data.redis.core.RedisTemplate; import org.springframework.stereotype.Service; import java.math.BigDecimal; +import java.math.RoundingMode; import java.time.LocalDate; import java.time.Period; import java.util.List; @@ -95,7 +96,7 @@ public class PVAppMainServiceImpl implements IPVAppMainService { .mapToDouble(WsRealDataVO::getInstalledCapacity).sum()); result.setIcUnit(wsRealDataVOList.get(0).getIcUnit()); // 当前出力 - result.setCapacityRate(Func.isNotEmpty(result.getInstalledCapacity()) && result.getInstalledCapacity() != 0 ? new BigDecimal(result.getGenerationCapacity() / result.getInstalledCapacity() * 100).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue() : 0); + result.setCapacityRate(Func.isNotEmpty(result.getInstalledCapacity()) && result.getInstalledCapacity() != 0 ? BigDecimal.valueOf(result.getGenerationCapacity() / result.getInstalledCapacity() * 100).setScale(2, RoundingMode.HALF_UP).doubleValue() : 0); // 安全运行天数 result.setRunDays(wsRealDataVOList.stream().filter(vo -> Func.isNotEmpty(vo.getRunDays())).mapToInt(WsRealDataVO::getRunDays).sum()); // 天气 @@ -116,7 +117,7 @@ public class PVAppMainServiceImpl implements IPVAppMainService { // 装机容量 R paramR = paramClient.getParamByEmId(wsInfo.getId(), HomePageConstant.INSTALLED_CAPACITY); if(paramR.isSuccess() && ObjectUtil.isNotEmpty(paramR.getData())) { - result.setInstalledCapacity(new BigDecimal(Optional.ofNullable(paramR.getData().getParamValue()).filter(StringUtil::isNotBlank).orElse("0.0")).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); + result.setInstalledCapacity(new BigDecimal(Optional.ofNullable(paramR.getData().getParamValue()).filter(StringUtil::isNotBlank).orElse("0.0")).setScale(2, RoundingMode.HALF_UP).doubleValue()); result.setIcUnit(paramR.getData().getUnit()); } result.setGcUnit("kW·h"); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/PhotovoltaicServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/PhotovoltaicServiceImpl.java index 65d58b8..1cd49aa 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/PhotovoltaicServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/PhotovoltaicServiceImpl.java @@ -38,6 +38,7 @@ import org.springframework.data.redis.core.RedisTemplate; import org.springframework.stereotype.Service; import java.math.BigDecimal; +import java.math.RoundingMode; import java.time.Duration; import java.time.LocalDate; import java.time.LocalDateTime; @@ -525,7 +526,7 @@ public class PhotovoltaicServiceImpl implements PhotovoltaicService { } // 开机运行时长 long time = this.runTime(result, start, end); - return BigDecimal.valueOf(time / (1000 * 60 * 60.00)).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); + return BigDecimal.valueOf(time / (1000 * 60 * 60.00)).setScale(2, RoundingMode.HALF_UP).doubleValue(); } /** @@ -966,17 +967,17 @@ public class PhotovoltaicServiceImpl implements PhotovoltaicService { if (Math.abs(sumGeneration) <= 0) { subordinate.setGenerationRate(0.0); } else { - subordinate.setGenerationRate(BigDecimal.valueOf(subordinate.getGeneration() / sumGeneration * 100L).setScale(1, BigDecimal.ROUND_HALF_UP).doubleValue()); + subordinate.setGenerationRate(BigDecimal.valueOf(subordinate.getGeneration() / sumGeneration * 100L).setScale(1, RoundingMode.HALF_UP).doubleValue()); } if (Math.abs(sumLoad) <= 0) { subordinate.setCapacityUse(0.0); } else { - subordinate.setCapacityUse(BigDecimal.valueOf(subordinate.getLoad() / sumLoad * 100L).setScale(1, BigDecimal.ROUND_HALF_UP).doubleValue()); + subordinate.setCapacityUse(BigDecimal.valueOf(subordinate.getLoad() / sumLoad * 100L).setScale(1, RoundingMode.HALF_UP).doubleValue()); } if (Math.abs(sumStationCount) <= 0) { subordinate.setStationUse(0.0); } else { - subordinate.setStationUse(BigDecimal.valueOf(subordinate.getStationUseCount() / sumStationCount * 100L).setScale(1, BigDecimal.ROUND_HALF_UP).doubleValue()); + subordinate.setStationUse(BigDecimal.valueOf(subordinate.getStationUseCount() / sumStationCount * 100L).setScale(1, RoundingMode.HALF_UP).doubleValue()); } }).sorted(Comparator.comparing(PhotovoltaicSubordinateVo::getCapacity)).collect(Collectors.toList()); } @@ -1533,7 +1534,7 @@ public class PhotovoltaicServiceImpl implements PhotovoltaicService { if (Math.abs(generationDay) <= 0 || Math.abs(generationYesterday) <= 0) { photovoltaic.setGenerateDayRatio(0.0); } else { - photovoltaic.setGenerateDayRatio(BigDecimal.valueOf((generationDay - generationYesterday) / generationYesterday * 100).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue()); + photovoltaic.setGenerateDayRatio(BigDecimal.valueOf((generationDay - generationYesterday) / generationYesterday * 100).setScale(2, RoundingMode.HALF_UP).doubleValue()); } double load = photovoltaic.getDevices().stream().mapToDouble(PhotovoltaicDeviceVo::getLoad).sum(); double lastLoad = photovoltaic.getDevices().stream().mapToDouble(PhotovoltaicDeviceVo::getLastLoad).sum(); @@ -1541,7 +1542,7 @@ public class PhotovoltaicServiceImpl implements PhotovoltaicService { if (Math.abs(load) <= 0 || Math.abs(lastLoad) <= 0) { photovoltaic.setLoadRatio(0.0); } else { - photovoltaic.setLoadRatio(BigDecimal.valueOf((load - lastLoad) / lastLoad * 100).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue()); + photovoltaic.setLoadRatio(BigDecimal.valueOf((load - lastLoad) / lastLoad * 100).setScale(2, RoundingMode.HALF_UP).doubleValue()); } } @@ -1712,7 +1713,7 @@ public class PhotovoltaicServiceImpl implements PhotovoltaicService { if (Math.abs(mateReals.get(0).getLoad()) <= 0 || mateReals.get(0).getLastLoad() <= 0) { item.setLoadRatio(0.0); } else { - item.setLoadRatio(BigDecimal.valueOf((mateReals.get(0).getLoad() - mateReals.get(0).getLastLoad()) / mateReals.get(0).getLastLoad() * 100).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue()); + item.setLoadRatio(BigDecimal.valueOf((mateReals.get(0).getLoad() - mateReals.get(0).getLastLoad()) / mateReals.get(0).getLastLoad() * 100).setScale(2, RoundingMode.HALF_UP).doubleValue()); } } @@ -1734,7 +1735,7 @@ public class PhotovoltaicServiceImpl implements PhotovoltaicService { if (Math.abs(mateTargets.get(0).getGenerationDay()) <= 0 || mateTargets.get(0).getGenerationYesterday() <= 0) { item.setGenerateDayRatio(0.0); } else { - item.setGenerateDayRatio(BigDecimal.valueOf((mateTargets.get(0).getGenerationDay() - mateTargets.get(0).getGenerationYesterday()) / mateTargets.get(0).getGenerationYesterday() * 100).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue()); + item.setGenerateDayRatio(BigDecimal.valueOf((mateTargets.get(0).getGenerationDay() - mateTargets.get(0).getGenerationYesterday()) / mateTargets.get(0).getGenerationYesterday() * 100).setScale(2, RoundingMode.HALF_UP).doubleValue()); } } return item; 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 e470d45..4c8b490 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 @@ -140,7 +140,7 @@ public class PlatformServiceImpl implements IPlatformService { return cloudKeyIndexVo; } - private static String array[] = {"系统告警", "告警", "故障、事故", "操作", "遥测越限", "遥信变位", "注册信息", "信息提示", "设备巡检", "遥信变位", "遥测越限", "遥测越限2", "遥控操作", "遥控操作2", "遥测越限恢复", "用于初始化"}; + private static final String[] array = {"系统告警", "告警", "故障、事故", "操作", "遥测越限", "遥信变位", "注册信息", "信息提示", "设备巡检", "遥信变位", "遥测越限", "遥测越限2", "遥控操作", "遥控操作2", "遥测越限恢复", "用于初始化"}; /** * 云服务-告警信息 @@ -383,7 +383,7 @@ public class PlatformServiceImpl implements IPlatformService { return null; } - private static String arrayRec[] = {"交班延迟", "接班延迟", "交接班延迟"}; + private static final String[] arrayRec = {"交班延迟", "接班延迟", "交接班延迟"}; /** * 根据服务类型查询代运维服务站点告警信息 diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/SideHustleServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/SideHustleServiceImpl.java index 31b75b0..cdf5868 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/SideHustleServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/SideHustleServiceImpl.java @@ -640,7 +640,7 @@ public class SideHustleServiceImpl implements ISideHustleService { if(Math.abs(R.getData().getInspectTaskSum()) <= 0){ areaDutyVo.setInspectionFinishRate(0.0); }else{ - double inspectionFinishRate = BigDecimal.valueOf(R.getData().getInspectTaskFinish() / (double)R.getData().getInspectTaskSum() * 100).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); + double inspectionFinishRate = BigDecimal.valueOf(R.getData().getInspectTaskFinish() / (double)R.getData().getInspectTaskSum() * 100).setScale(2, RoundingMode.HALF_UP).doubleValue(); areaDutyVo.setInspectionFinishRate(inspectionFinishRate); } areaDutyVo.setInspectTaskIds(R.getData().getInspectTaskIds()); @@ -657,7 +657,7 @@ public class SideHustleServiceImpl implements ISideHustleService { if(Math.abs(defectVO.getDefectSum()) <= 0){ areaDutyVo.setShortagesRate(0.0); }else{ - double shortagesRate = BigDecimal.valueOf(defectVO.getDefect() / (double)defectVO.getDefectSum() * 100).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); + double shortagesRate = BigDecimal.valueOf(defectVO.getDefect() / (double)defectVO.getDefectSum() * 100).setScale(2, RoundingMode.HALF_UP).doubleValue(); areaDutyVo.setShortagesRate(shortagesRate); } } @@ -672,7 +672,7 @@ public class SideHustleServiceImpl implements ISideHustleService { if(Math.abs(areaDutyVo.getWorkRegularlySum()) <= 0){ areaDutyVo.setWorkRegularlyRate(0.0); }else{ - double workRegularlyRate = BigDecimal.valueOf(areaDutyVo.getWorkRegularly() / (double)areaDutyVo.getWorkRegularlySum() * 100).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); + double workRegularlyRate = BigDecimal.valueOf(areaDutyVo.getWorkRegularly() / (double)areaDutyVo.getWorkRegularlySum() * 100).setScale(2, RoundingMode.HALF_UP).doubleValue(); areaDutyVo.setWorkRegularlyRate(workRegularlyRate); } } @@ -722,7 +722,7 @@ public class SideHustleServiceImpl implements ISideHustleService { if (maintainFinish == 0) { areaDutyVo.setMaintainRateMoth("0"); } else { - double maintainRate = BigDecimal.valueOf(maintainFinish / (double)maintainSum * 100L).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); + double maintainRate = BigDecimal.valueOf(maintainFinish / (double)maintainSum * 100L).setScale(2, RoundingMode.HALF_UP).doubleValue(); areaDutyVo.setMaintainRateMoth(String.valueOf(maintainRate)); } countDownLatch.countDown(); @@ -738,7 +738,7 @@ public class SideHustleServiceImpl implements ISideHustleService { if (Math.abs(shortagesSum) <= 0) { areaDutyVo.setShortagesRateMoth("0"); } else { - double shortagesRate = BigDecimal.valueOf(shortages / (double)shortagesSum * 100L).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); + double shortagesRate = BigDecimal.valueOf(shortages / (double)shortagesSum * 100L).setScale(2, RoundingMode.HALF_UP).doubleValue(); areaDutyVo.setShortagesRateMoth(String.valueOf(shortagesRate)); } countDownLatch.countDown(); @@ -753,7 +753,7 @@ public class SideHustleServiceImpl implements ISideHustleService { if (overhaulFinish == 0) { areaDutyVo.setOverhaulRateMoth("0"); } else { - double overhaulRate = BigDecimal.valueOf(overhaulFinish / (double)overhaul * 100L).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); + double overhaulRate = BigDecimal.valueOf(overhaulFinish / (double)overhaul * 100L).setScale(2, RoundingMode.HALF_UP).doubleValue(); areaDutyVo.setOverhaulRateMoth(String.valueOf(overhaulRate)); } countDownLatch.countDown(); @@ -784,7 +784,7 @@ public class SideHustleServiceImpl implements ISideHustleService { if (operateQualify == 0) { areaDutyVo.setOperateRateMoth("0"); } else { - double operateRate = BigDecimal.valueOf(operateQualify / (double)operate * 100L).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); + double operateRate = BigDecimal.valueOf(operateQualify / (double)operate * 100L).setScale(2, RoundingMode.HALF_UP).doubleValue(); areaDutyVo.setOperateRateMoth(String.valueOf(operateRate)); } // 工作票 @@ -795,7 +795,7 @@ public class SideHustleServiceImpl implements ISideHustleService { if (workQualify == 0) { areaDutyVo.setWorkRateMoth("0"); } else { - double workRate = BigDecimal.valueOf(workQualify / (double)work * 100L).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); + double workRate = BigDecimal.valueOf(workQualify / (double)work * 100L).setScale(2, RoundingMode.HALF_UP).doubleValue(); areaDutyVo.setWorkRateMoth(String.valueOf(workRate)); } countDownLatch.countDown(); @@ -1008,7 +1008,7 @@ public class SideHustleServiceImpl implements ISideHustleService { return 0.0; } // 发电量占比 - return BigDecimal.valueOf(power / sumPower * 100).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); + return BigDecimal.valueOf(power / sumPower * 100).setScale(2, RoundingMode.HALF_UP).doubleValue(); } /** @@ -1074,7 +1074,7 @@ public class SideHustleServiceImpl implements ISideHustleService { } // 总有功功率 double sumActivePower = map.entrySet().stream().filter(o->codeList.contains(o.getKey())).mapToDouble(Map.Entry::getValue).sum(); - return BigDecimal.valueOf(sumActivePower / sumCapacity * 100).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); + return BigDecimal.valueOf(sumActivePower / sumCapacity * 100).setScale(2, RoundingMode.HALF_UP).doubleValue(); } /** @@ -1096,7 +1096,7 @@ public class SideHustleServiceImpl implements ISideHustleService { if(Math.abs(planPower) <= 0){ return 0.0; } - return BigDecimal.valueOf(power / planPower * 100).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); + return BigDecimal.valueOf(power / planPower * 100).setScale(2, RoundingMode.HALF_UP).doubleValue(); } /** diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/WaterServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/WaterServiceImpl.java index 99c71b8..9346d01 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/WaterServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/WaterServiceImpl.java @@ -48,6 +48,7 @@ import org.springframework.data.redis.core.RedisTemplate; import org.springframework.stereotype.Service; import java.math.BigDecimal; +import java.math.RoundingMode; import java.time.Duration; import java.time.LocalDate; import java.time.LocalDateTime; @@ -434,7 +435,7 @@ public class WaterServiceImpl implements IWaterService { waterRunVo.setCount(count); // 开机运行时长 long time = this.getRunTime(result,startDate,endDate); - waterRunVo.setHour(BigDecimal.valueOf(time / (1000 * 60 * 60.00)).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue()); + waterRunVo.setHour(BigDecimal.valueOf(time / (1000 * 60 * 60.00)).setScale(2, RoundingMode.HALF_UP).doubleValue()); return waterRunVo; } @@ -1370,7 +1371,7 @@ public class WaterServiceImpl implements IWaterService { double activePower = list.stream().filter(o-> deptList.contains(o.getDeptId())).mapToDouble(WaterPumpRealVo::getActivePower).sum(); // 泵站利用率 if(Math.abs(installedCapacity) > 0 && Math.abs(activePower) > 0){ - vo.setStationUseRate(BigDecimal.valueOf(activePower / installedCapacity *100).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue()); + vo.setStationUseRate(BigDecimal.valueOf(activePower / installedCapacity *100).setScale(2, RoundingMode.HALF_UP).doubleValue()); } // 泵租总数 int count = (int) list.stream().filter(o-> deptList.contains(o.getDeptId())).count(); @@ -1378,7 +1379,7 @@ public class WaterServiceImpl implements IWaterService { int runCount = (int) list.stream().filter(o-> deptList.contains(o.getDeptId()) && 0 == o.getState()).count(); // 泵组利用率 if(Math.abs(count) > 0 && Math.abs(runCount) > 0){ - vo.setGroupUseRate(BigDecimal.valueOf(runCount / (double) count *100).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue()); + vo.setGroupUseRate(BigDecimal.valueOf(runCount / (double) count *100).setScale(2, RoundingMode.HALF_UP).doubleValue()); } } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/WindHomeServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/WindHomeServiceImpl.java index fd8bab1..150bf65 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/WindHomeServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/WindHomeServiceImpl.java @@ -148,7 +148,7 @@ public class WindHomeServiceImpl implements WindHomeService { score.setCompleteMonRate(BigDecimal.valueOf(score.getGenerateMon() / score.getPlanMon() * 100).setScale(2, RoundingMode.HALF_UP).doubleValue()); } // 月平均风速 - OptionalDouble speed = winds.stream().filter(o->o.getFillDate().contains(DateUtil.format(new Date(),"yyyy-MM"))).mapToDouble(WindEntity::getSpeed).average();; + OptionalDouble speed = winds.stream().filter(o->o.getFillDate().contains(DateUtil.format(new Date(),"yyyy-MM"))).mapToDouble(WindEntity::getSpeed).average(); if(speed.isPresent()){ score.setSpeedRate(speed.getAsDouble()); } @@ -263,7 +263,7 @@ public class WindHomeServiceImpl implements WindHomeService { subordinate.setGeneration(piece.stream().mapToDouble(WindEntity::getPower).sum()); // 集团发电占比 if(Math.abs(subordinate.getGeneration()) > 0 && Math.abs(winds.stream().mapToDouble(WindEntity::getPower).sum()) > 0){ - subordinate.setGenerationRate(BigDecimal.valueOf(subordinate.getGeneration() / winds.stream().mapToDouble(WindEntity::getPower).sum() * 100).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); + subordinate.setGenerationRate(BigDecimal.valueOf(subordinate.getGeneration() / winds.stream().mapToDouble(WindEntity::getPower).sum() * 100).setScale(2, RoundingMode.HALF_UP).doubleValue()); }else{ subordinate.setGenerationRate(0.0); } @@ -272,7 +272,7 @@ public class WindHomeServiceImpl implements WindHomeService { double plan = plans.stream().mapToDouble(PlanGenerationEntity::getPlanGeneration).sum(); // 发电完成率 if(Math.abs(subordinate.getGeneration()) > 0 && Math.abs(plan) > 0){ - subordinate.setGenerationComplete(BigDecimal.valueOf(subordinate.getGeneration() / plan * 100).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); + subordinate.setGenerationComplete(BigDecimal.valueOf(subordinate.getGeneration() / plan * 100).setScale(2, RoundingMode.HALF_UP).doubleValue()); }else{ subordinate.setGenerationComplete(0.0); } @@ -280,7 +280,7 @@ public class WindHomeServiceImpl implements WindHomeService { double fault = piece.stream().mapToDouble(WindEntity::getFaultHours).sum(); double use = piece.stream().mapToDouble(WindEntity::getAvailable).sum(); if(Math.abs(fault) > 0 ){ - subordinate.setFanUse(BigDecimal.valueOf(use / (use + fault) * 100).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); + subordinate.setFanUse(BigDecimal.valueOf(use / (use + fault) * 100).setScale(2, RoundingMode.HALF_UP).doubleValue()); }else{ subordinate.setFanUse(0.0); } @@ -288,7 +288,7 @@ public class WindHomeServiceImpl implements WindHomeService { double surf = piece.stream().mapToDouble(WindEntity::getSurfPower).sum(); double below = piece.stream().mapToDouble(WindEntity::getBelowPower).sum(); if(Math.abs(subordinate.getGeneration()) > 0 && Math.abs(surf + below) > 0){ - subordinate.setFactoryUse(BigDecimal.valueOf((subordinate.getGeneration() - surf + below) / subordinate.getGeneration() * 100).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); + subordinate.setFactoryUse(BigDecimal.valueOf((subordinate.getGeneration() - surf + below) / subordinate.getGeneration() * 100).setScale(2, RoundingMode.HALF_UP).doubleValue()); }else{ subordinate.setFactoryUse(0.0); } @@ -336,7 +336,7 @@ public class WindHomeServiceImpl implements WindHomeService { kpi.setGenerate(winds.stream().mapToDouble(WindEntity::getPower).sum()); // 发电量完成率 if(Math.abs(kpi.getPlan()) > 0 && Math.abs(kpi.getGenerate()) > 0){ - kpi.setGenerateComplete(BigDecimal.valueOf(kpi.getGenerate() / kpi.getPlan() * 100).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue()); + kpi.setGenerateComplete(BigDecimal.valueOf(kpi.getGenerate() / kpi.getPlan() * 100).setScale(2, RoundingMode.HALF_UP).doubleValue()); } // 峰值功率 kpi.setPeak(winds.stream().filter(o->o.getFillDate().contains(DateUtil.format(new Date(),DateUtil.PATTERN_DATE))).mapToDouble(WindEntity::getPeakPower).sum()); @@ -394,7 +394,7 @@ public class WindHomeServiceImpl implements WindHomeService { area.setPlan(plans.stream().filter(o-> stationCodes.contains(o.getStationId())).mapToDouble(PlanGenerationEntity::getPlanGeneration).sum()); area.setGenerate(winds.stream().filter(o-> stationCodes.contains(o.getStationCode())).mapToDouble(WindEntity::getPower).sum()); if(Math.abs(area.getPlan()) > 0 && Math.abs(area.getGenerate()) > 0){ - area.setGenerateComplete(BigDecimal.valueOf(area.getGenerate() / area.getPlan() * 100).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue()); + area.setGenerateComplete(BigDecimal.valueOf(area.getGenerate() / area.getPlan() * 100).setScale(2, RoundingMode.HALF_UP).doubleValue()); } if(MapUtils.isNotEmpty(nowWeather) && nowWeather.containsKey(entry.getValue().get(0).getCode())){ HeWeatherWeatherNowResponse nowData = nowWeather.get(entry.getValue().get(0).getCode()); @@ -494,7 +494,7 @@ public class WindHomeServiceImpl implements WindHomeService { if(Math.abs(taskSum) <= 0){ areaDuty.setTaskRate(0.0); }else{ - double taskRate = BigDecimal.valueOf((double)finishSum / (double)taskSum * 100).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); + double taskRate = BigDecimal.valueOf((double)finishSum / (double)taskSum * 100).setScale(2, RoundingMode.HALF_UP).doubleValue(); areaDuty.setTaskRate(taskRate); } return areaDuty; @@ -533,7 +533,7 @@ public class WindHomeServiceImpl implements WindHomeService { areaDuty.setPlanMon(plans.stream().filter(o->o.getDateTime().contains(DateUtil.format(new Date(),"yyyy-MM"))).mapToDouble(PlanGenerationEntity::getPlanGeneration).sum()); // 月发电量完成率 if(Math.abs(areaDuty.getGenerateMon()) > 0 && Math.abs(areaDuty.getPlanMon()) > 0){ - areaDuty.setCompleteMonRate(BigDecimal.valueOf(areaDuty.getGenerateMon() / areaDuty.getPlanMon() * 100).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); + areaDuty.setCompleteMonRate(BigDecimal.valueOf(areaDuty.getGenerateMon() / areaDuty.getPlanMon() * 100).setScale(2, RoundingMode.HALF_UP).doubleValue()); } areaDuty.setAvailableMon(windMons.stream().mapToDouble(WindEntity::getAvailable).sum()); } @@ -548,7 +548,7 @@ public class WindHomeServiceImpl implements WindHomeService { areaDuty.setGenerate(windYears.stream().mapToDouble(WindEntity::getPower).sum()); // 发电量完成率 if(Math.abs(areaDuty.getPlan()) > 0 && Math.abs(areaDuty.getGenerate()) > 0){ - areaDuty.setGenerateComplete(BigDecimal.valueOf(areaDuty.getGenerate() / areaDuty.getPlan() * 100).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue()); + areaDuty.setGenerateComplete(BigDecimal.valueOf(areaDuty.getGenerate() / areaDuty.getPlan() * 100).setScale(2, RoundingMode.HALF_UP).doubleValue()); } } @@ -841,7 +841,7 @@ public class WindHomeServiceImpl implements WindHomeService { generate.setGenerate(winds.stream().filter(o-> o.getStationCode().equals(station.getCode())).mapToDouble(WindEntity::getPower).sum()); // 发电量完成率 if(Math.abs(generate.getPlan()) > 0 && Math.abs(generate.getGenerate()) > 0){ - generate.setGenerateComplete(BigDecimal.valueOf(generate.getGenerate() / generate.getPlan() * 100).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue()); + generate.setGenerateComplete(BigDecimal.valueOf(generate.getGenerate() / generate.getPlan() * 100).setScale(2, RoundingMode.HALF_UP).doubleValue()); } // 设备数量 generate.setDeviceCount(devices.stream().filter(o->o.getCreateDept().equals(station.getRefDept())).count()); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/vo/OperationalReportVO.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/vo/OperationalReportVO.java index bd9b9b9..9415f77 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/vo/OperationalReportVO.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/vo/OperationalReportVO.java @@ -42,7 +42,7 @@ public class OperationalReportVO { if (total < 1) { return BigDecimal.ZERO; } else { - return BigDecimal.valueOf(this.maintenanceFinish + this.accessFinish + this.inspectFinish).setScale(3, RoundingMode.HALF_UP).divide(BigDecimal.valueOf(total), BigDecimal.ROUND_HALF_UP); + return BigDecimal.valueOf(this.maintenanceFinish + this.accessFinish + this.inspectFinish).setScale(3, RoundingMode.HALF_UP).divide(BigDecimal.valueOf(total), RoundingMode.HALF_UP); } } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/OperationalContants.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/OperationalContants.java index 17a9d31..d3aebb4 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/OperationalContants.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/OperationalContants.java @@ -1,6 +1,9 @@ package com.hnac.hzims.operational.maintenance; +import lombok.Getter; + +@Getter public enum OperationalContants { Test("01", "定期试验"), @@ -16,23 +19,16 @@ public enum OperationalContants { this.desc = desc; } - public String getCode() { - return code; - } - - public void setCode(String code) { + public void setCode(String code) { this.code = code; } - public String getDesc() { - return desc; - } - - public void setDesc(String desc) { + public void setDesc(String desc) { this.desc = desc; } - public enum ModelEnum { + @Getter + public enum ModelEnum { Person(1, "人员"), Class(2, "值班"), @@ -46,19 +42,11 @@ public enum OperationalContants { this.desc = desc; } - public Integer getCode() { - return code; - } - - public void setCode(Integer code) { + public void setCode(Integer code) { this.code = code; } - public String getDesc() { - return desc; - } - - public void setDesc(String desc) { + public void setDesc(String desc) { this.desc = desc; } } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/controller/MaintenanceController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/controller/MaintenanceController.java index d504a91..d845d0f 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/controller/MaintenanceController.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/controller/MaintenanceController.java @@ -61,7 +61,7 @@ public class MaintenanceController { return true; } catch (Exception e) { e.printStackTrace(); - log.error("param"+response+"报错信息"+e.toString()); + log.error("param"+response+"报错信息"+ e); throw new ServiceException("日常维护待处理:" + e.getMessage()); } } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/controller/OperMaintenanceTaskController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/controller/OperMaintenanceTaskController.java index 0f9c89f..7beedd1 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/controller/OperMaintenanceTaskController.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/controller/OperMaintenanceTaskController.java @@ -155,7 +155,7 @@ public class OperMaintenanceTaskController extends BladeController { .doWrite(list); } } catch (Exception e) { - System.out.println("exportExcel = " + e.toString()); + System.out.println("exportExcel = " + e); // 重置response response.reset(); response.setContentType("application/json"); @@ -166,7 +166,7 @@ public class OperMaintenanceTaskController extends BladeController { try { response.getWriter().println(JSONUtils.toJSONString(map)); } catch (IOException e3) { - throw new ServiceException( "发生异常 :" + e.toString()); + throw new ServiceException( "发生异常 :" + e); } } } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/scheduled/MaintenancePlanCreateTask.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/scheduled/MaintenancePlanCreateTask.java index 5c1fcc9..838779a 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/scheduled/MaintenancePlanCreateTask.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/scheduled/MaintenancePlanCreateTask.java @@ -136,7 +136,7 @@ public class MaintenancePlanCreateTask { planEntity.setRefLibraryId(libraryEntity.getId()); if(!"0".equals(planEntity.getRefLibraryId()+"")) { List emInfoEntityList = new ArrayList<>(); - List emCodeList = Arrays.asList(planEntity.getEmCode().split(",")); + String[] emCodeList = planEntity.getEmCode().split(","); for(String emCode : emCodeList) { EmInfoEntity emInfoEntity = emInfoClient.getByCode(emCode); if(ObjectUtil.isNotEmpty(emInfoEntity)){ diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/scheduled/MaintenanceTaskCreateTask.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/scheduled/MaintenanceTaskCreateTask.java index e10a281..ad4a48f 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/scheduled/MaintenanceTaskCreateTask.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/scheduled/MaintenanceTaskCreateTask.java @@ -96,7 +96,7 @@ public class MaintenanceTaskCreateTask { do { int startIndex = (page - 1) * size; int endIndex = page * size < planEntities.size() ? page * size : planEntities.size(); - System.out.println(String.format("startIndex:%s, endIndex:%s", startIndex, endIndex)); + System.out.printf("startIndex:%s, endIndex:%s%n", startIndex, endIndex); //生成日常巡检任务并插入数据库 for (int i = startIndex; i < endIndex; i++) { @@ -132,7 +132,7 @@ public class MaintenanceTaskCreateTask { //拆分设备 每个设备生成一条任务 List taskIds=new ArrayList<>(); if(StringUtil.isNotBlank(planEntity.getEmCode())){ - List emCodeList = Arrays.asList(planEntity.getEmCode().split(",")); + String[] emCodeList = planEntity.getEmCode().split(","); for(String emCode : emCodeList){ //一旦有一条任务失败,则删除当前生成的任务,不更新当前的计划状态 try { diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/scheduled/MaintenanceTaskSchedule.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/scheduled/MaintenanceTaskSchedule.java index cf7d0b9..233d91c 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/scheduled/MaintenanceTaskSchedule.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/scheduled/MaintenanceTaskSchedule.java @@ -85,7 +85,7 @@ public class MaintenanceTaskSchedule { .atZone(ZoneId.systemDefault()).toLocalDateTime(); taskEntity.setPlanEndTime(disposeTime.plusHours(taskEntity.getHours())); if(StringUtil.isNotBlank(plan.getEmCode())){ - List emCodeList = Arrays.asList(plan.getEmCode().split(",")); + String[] emCodeList = plan.getEmCode().split(","); for(String emCode : emCodeList){ taskEntity.setEmCode(emCode); this.createTask(taskEntity,plan); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/OperMaintenanceTaskServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/OperMaintenanceTaskServiceImpl.java index 7f17469..13be0dd 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/OperMaintenanceTaskServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/OperMaintenanceTaskServiceImpl.java @@ -273,7 +273,7 @@ public class OperMaintenanceTaskServiceImpl extends BaseServiceImpl maintenanceTaskEntityList = operMaintenanceTaskEntityList.stream().filter(o -> StringUtils.isNotBlank(o.getDisposer())).collect(Collectors.toList()); RunReportVO maintenanceReportVO = new RunReportVO(); maintenanceReportVO.setUserName("合计"); - this.fillRunReport(maintenanceTaskEntityList, maintenanceReportVO); + fillRunReport(maintenanceTaskEntityList, maintenanceReportVO); maintenanceReportVOList.add(maintenanceReportVO); } return maintenanceReportVOList; diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/impl/OperStationMonthReportServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/impl/OperStationMonthReportServiceImpl.java index 6671d89..582c811 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/impl/OperStationMonthReportServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/impl/OperStationMonthReportServiceImpl.java @@ -114,7 +114,7 @@ public class OperStationMonthReportServiceImpl implements IOperStationMonthRepor /** * 通过线程池异步获取月报各模块内容 主要分为八块内容 **/ - private static ExecutorService pool = Executors.newFixedThreadPool(POOL_QUANTITY); + private static final ExecutorService pool = Executors.newFixedThreadPool(POOL_QUANTITY); /** * 统计月报-电站-对内 @@ -168,7 +168,7 @@ public class OperStationMonthReportServiceImpl implements IOperStationMonthRepor } finally { countDownLatch.countDown(); log.info("电站发电耗时:"+(System.currentTimeMillis()-startMillis)+"ms"); - System.out.printf("电站发电耗时:"+(System.currentTimeMillis()-startMillis)+"ms"); + System.out.print("电站发电耗时:"+(System.currentTimeMillis()-startMillis)+"ms"); } }); //值班情况 @@ -179,7 +179,7 @@ public class OperStationMonthReportServiceImpl implements IOperStationMonthRepor } finally { countDownLatch.countDown(); log.info("值班情况耗时:"+(System.currentTimeMillis()-startMillis)+"ms"); - System.out.printf("值班情况耗时:"+(System.currentTimeMillis()-startMillis)+"ms"); + System.out.print("值班情况耗时:"+(System.currentTimeMillis()-startMillis)+"ms"); } }); //日常维护 @@ -190,7 +190,7 @@ public class OperStationMonthReportServiceImpl implements IOperStationMonthRepor } finally { countDownLatch.countDown(); log.info("日常维护:"+(System.currentTimeMillis()-startMillis)+"ms"); - System.out.printf("日常维护:"+(System.currentTimeMillis()-startMillis)+"ms"); + System.out.print("日常维护:"+(System.currentTimeMillis()-startMillis)+"ms"); } }); //检修 @@ -201,7 +201,7 @@ public class OperStationMonthReportServiceImpl implements IOperStationMonthRepor } finally { countDownLatch.countDown(); log.info("检修:"+(System.currentTimeMillis()-startMillis)+"ms"); - System.out.printf("检修:"+(System.currentTimeMillis()-startMillis)+"ms"); + System.out.print("检修:"+(System.currentTimeMillis()-startMillis)+"ms"); } }); //缺陷 @@ -212,7 +212,7 @@ public class OperStationMonthReportServiceImpl implements IOperStationMonthRepor } finally { countDownLatch.countDown(); log.info("缺陷:"+(System.currentTimeMillis()-startMillis)+"ms"); - System.out.printf("缺陷:"+(System.currentTimeMillis()-startMillis)+"ms"); + System.out.print("缺陷:"+(System.currentTimeMillis()-startMillis)+"ms"); } }); //两票统计 @@ -228,7 +228,7 @@ public class OperStationMonthReportServiceImpl implements IOperStationMonthRepor } finally { countDownLatch.countDown(); log.info("两票统计:"+(System.currentTimeMillis()-startMillis)+"ms"); - System.out.printf("两票统计:"+(System.currentTimeMillis()-startMillis)+"ms"); + System.out.print("两票统计:"+(System.currentTimeMillis()-startMillis)+"ms"); } }); //巡检 @@ -240,7 +240,7 @@ public class OperStationMonthReportServiceImpl implements IOperStationMonthRepor } finally { countDownLatch.countDown(); log.info("巡检:"+(System.currentTimeMillis()-startMillis)+"ms"); - System.out.printf("巡检:"+(System.currentTimeMillis()-startMillis)+"ms"); + System.out.print("巡检:"+(System.currentTimeMillis()-startMillis)+"ms"); } }); //智能诊断 @@ -354,7 +354,7 @@ public class OperStationMonthReportServiceImpl implements IOperStationMonthRepor }finally { countDownLatch.countDown(); log.info("电站发电耗时:"+(System.currentTimeMillis()-startMillis)+"ms"); - System.out.printf("电站发电耗时:"+(System.currentTimeMillis()-startMillis)+"ms"); + System.out.print("电站发电耗时:"+(System.currentTimeMillis()-startMillis)+"ms"); } }); //值班情况 @@ -365,7 +365,7 @@ public class OperStationMonthReportServiceImpl implements IOperStationMonthRepor } finally { countDownLatch.countDown(); log.info("值班情况耗时:"+(System.currentTimeMillis()-startMillis)+"ms"); - System.out.printf("值班情况耗时:"+(System.currentTimeMillis()-startMillis)+"ms"); + System.out.print("值班情况耗时:"+(System.currentTimeMillis()-startMillis)+"ms"); } }); //日常维护 @@ -376,7 +376,7 @@ public class OperStationMonthReportServiceImpl implements IOperStationMonthRepor } finally { countDownLatch.countDown(); log.info("日常维护:"+(System.currentTimeMillis()-startMillis)+"ms"); - System.out.printf("日常维护:"+(System.currentTimeMillis()-startMillis)+"ms"); + System.out.print("日常维护:"+(System.currentTimeMillis()-startMillis)+"ms"); } }); //巡检 @@ -392,7 +392,7 @@ public class OperStationMonthReportServiceImpl implements IOperStationMonthRepor runReportVO.setUserName(taskReportVO.getUserName()); runReportVO.setCompleteNum(taskReportVO.getCompleteNum()); runReportVO.setIncompleteNum(taskReportVO.getIncompleteNum()); - runReportVO.setRemark(taskReportVO.getCompleteSituation() + "" + taskReportVO.getIncompleteSituation()); + runReportVO.setRemark(taskReportVO.getCompleteSituation() + taskReportVO.getIncompleteSituation()); reportVOS.add(runReportVO); } int complete = inspectStatisticsByName.stream().mapToInt(TaskReportVO::getCompleteNum).sum(); @@ -413,7 +413,7 @@ public class OperStationMonthReportServiceImpl implements IOperStationMonthRepor } finally { countDownLatch.countDown(); log.info("日常维护:"+(System.currentTimeMillis()-startMillis)+"ms"); - System.out.printf("日常维护:"+(System.currentTimeMillis()-startMillis)+"ms"); + System.out.print("日常维护:"+(System.currentTimeMillis()-startMillis)+"ms"); } }); //检修 @@ -424,7 +424,7 @@ public class OperStationMonthReportServiceImpl implements IOperStationMonthRepor } finally { countDownLatch.countDown(); log.info("检修:"+(System.currentTimeMillis()-startMillis)+"ms"); - System.out.printf("检修:"+(System.currentTimeMillis()-startMillis)+"ms"); + System.out.print("检修:"+(System.currentTimeMillis()-startMillis)+"ms"); } }); //缺陷 @@ -435,7 +435,7 @@ public class OperStationMonthReportServiceImpl implements IOperStationMonthRepor } finally { countDownLatch.countDown(); log.info("缺陷:"+(System.currentTimeMillis()-startMillis)+"ms"); - System.out.printf("缺陷:"+(System.currentTimeMillis()-startMillis)+"ms"); + System.out.print("缺陷:"+(System.currentTimeMillis()-startMillis)+"ms"); } }); //两票统计 @@ -453,7 +453,7 @@ public class OperStationMonthReportServiceImpl implements IOperStationMonthRepor } finally { countDownLatch.countDown(); log.info("两票统计:"+(System.currentTimeMillis()-startMillis)+"ms"); - System.out.printf("两票统计:"+(System.currentTimeMillis()-startMillis)+"ms"); + System.out.print("两票统计:"+(System.currentTimeMillis()-startMillis)+"ms"); } }); //智能诊断 @@ -599,7 +599,7 @@ public class OperStationMonthReportServiceImpl implements IOperStationMonthRepor temp.put("userName",maintenanceReport.getUserName()); temp.put("completeNum",maintenanceReport.getCompleteNum().toString()); temp.put("incompleteNum",maintenanceReport.getIncompleteNum().toString()); - temp.put("remark",maintenanceReport.getRemark().toString()); + temp.put("remark", maintenanceReport.getRemark()); sumList.add(temp); map.put("maintenanceSum", sumList); continue; diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/impl/TaskMonthServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/impl/TaskMonthServiceImpl.java index 996b13c..f12ac8c 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/impl/TaskMonthServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/impl/TaskMonthServiceImpl.java @@ -73,7 +73,7 @@ public class TaskMonthServiceImpl implements ITaskMonthService { private final int POOL_QUANTITY = 8; /** 执行 **/ - private static ExecutorService executorService = Executors.newFixedThreadPool(7); + private static final ExecutorService executorService = Executors.newFixedThreadPool(7); @Override public void exportTaskMonthReport(String month, String deptId) { diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/EstimateServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/EstimateServiceImpl.java index cb9f0f0..67b7ce9 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/EstimateServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/EstimateServiceImpl.java @@ -44,7 +44,7 @@ public class EstimateServiceImpl extends ServiceImpl i @Autowired private EvaluationDetailsOptionService evaluationDetailsOptionService; - private static Map cacheMap = new HashMap<>(); + private static final Map cacheMap = new HashMap<>(); /** * 查询列表数据 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 41ef519..2b12fc2 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 @@ -124,7 +124,7 @@ public class ArtemisPostUtils { @Override public void run(){ try { - Thread.sleep(time*1000); + Thread.sleep(time* 1000L); jsonBody.put("action", 1); String body = jsonBody.toJSONString(); String result = ArtemisHttpUtil.doPostStringArtemis(path, body, null, null, contentType, null); @@ -204,7 +204,7 @@ public class ArtemisPostUtils { jsonBody.put("transmode", 1); String body = jsonBody.toJSONString(); - String result = ArtemisHttpUtil.doPostStringArtemis(path, body, (Map)null, (String)null, contentType, (Map)null); + String result = ArtemisHttpUtil.doPostStringArtemis(path, body, null, null, contentType, null); if (null == result && "".equals(result)) { return null; } else { diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/util/ExcelUtil.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/util/ExcelUtil.java index b61af63..a95d8d4 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/util/ExcelUtil.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/util/ExcelUtil.java @@ -13,6 +13,7 @@ import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletResponse; import java.io.*; import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Map; @@ -43,7 +44,7 @@ public class ExcelUtil { response.reset(); response.setContentType("application/x-msdownload"); fileName = fileName + new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()); - response.setHeader("Content-disposition","attachment; filename="+new String(fileName.getBytes("gb2312"),"ISO-8859-1")+".xls"); + response.setHeader("Content-disposition","attachment; filename="+new String(fileName.getBytes("gb2312"), StandardCharsets.ISO_8859_1)+".xls"); ServletOutputStream outStream=null; try{ outStream = response.getOutputStream(); 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 626b894..95e9f7c 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 @@ -51,7 +51,7 @@ public abstract class HttpClientUtils { try { sc = SSLContext.getInstance("SSLv3"); - sc.init((KeyManager[]) null, new TrustManager[]{new X509TrustManager() { + sc.init(null, new TrustManager[]{new X509TrustManager() { @Override public void checkClientTrusted(X509Certificate[] paramArrayOfX509Certificate, String paramString) throws CertificateException { } @@ -64,7 +64,7 @@ public abstract class HttpClientUtils { public X509Certificate[] getAcceptedIssuers() { return null; } - }}, (SecureRandom) null); + }}, null); } catch (NoSuchAlgorithmException var3) { var3.printStackTrace(); } catch (KeyManagementException var2) { @@ -352,7 +352,7 @@ public abstract class HttpClientUtils { while ((ch = is.read(buffer)) != -1) { bytestream.write(buffer, 0, ch); } - byte data[] = bytestream.toByteArray(); + byte[] data = bytestream.toByteArray(); bytestream.close(); return data; } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/util/JFreeUtil.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/util/JFreeUtil.java index 909c71c..fd607db 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/util/JFreeUtil.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/util/JFreeUtil.java @@ -39,8 +39,8 @@ import java.util.Map; @Slf4j public class JFreeUtil { - private static String tempImgPath = "D:\\tempJfree.jpeg"; - private static String tempImgPath2 = "D:\\tempJfree2.jpeg"; + private static final String tempImgPath = "D:\\tempJfree.jpeg"; + private static final String tempImgPath2 = "D:\\tempJfree2.jpeg"; /** * 将图片转化为字节数组 diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/util/SpringContextHolder.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/util/SpringContextHolder.java index 58e1193..cfb9116 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/util/SpringContextHolder.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/util/SpringContextHolder.java @@ -15,7 +15,7 @@ public class SpringContextHolder implements ApplicationContextAware, DisposableB private static ApplicationContext applicationContext = null; - private static Logger logger = LoggerFactory.getLogger(SpringContextHolder.class); + private static final Logger logger = LoggerFactory.getLogger(SpringContextHolder.class); /** * 取得存储在静态变量中的ApplicationContext. diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/util/TimeUtils.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/util/TimeUtils.java index c5afd70..7c4f9a9 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/util/TimeUtils.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/util/TimeUtils.java @@ -88,7 +88,7 @@ public class TimeUtils { // 创建一个Calendar对象 Calendar calendar = Calendar.getInstance(); // 设置年份 - calendar.set(Calendar.YEAR, Integer.valueOf(year)); + calendar.set(Calendar.YEAR, year); // 设置月份为1(即一月) calendar.set(Calendar.MONTH, mon); calendar.set(Calendar.DAY_OF_MONTH, 1); @@ -101,7 +101,7 @@ public class TimeUtils { // 创建一个Calendar对象 Calendar calendar = Calendar.getInstance(); // 设置年份 - calendar.set(Calendar.YEAR, Integer.valueOf(year)); + calendar.set(Calendar.YEAR, year); // 设置月份为1(即一月) calendar.set(Calendar.MONTH, mon); calendar.set(Calendar.DAY_OF_MONTH, 1); @@ -116,7 +116,7 @@ public class TimeUtils { // 创建一个Calendar对象 Calendar calendar = Calendar.getInstance(); // 设置年份 - calendar.set(Calendar.YEAR, Integer.valueOf(year)); + calendar.set(Calendar.YEAR, year); // 设置月份为1(即一月) calendar.set(Calendar.MONTH, i); calendar.set(Calendar.DAY_OF_MONTH, 1); @@ -133,7 +133,7 @@ public class TimeUtils { // 创建一个Calendar对象 Calendar calendar = Calendar.getInstance(); // 设置年份 - calendar.set(Calendar.YEAR, Integer.valueOf(year)); + calendar.set(Calendar.YEAR, year); // 设置月份为1(即一月) calendar.set(Calendar.MONTH, i); calendar.set(Calendar.DAY_OF_MONTH, 1); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/util/ZpiUtil.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/util/ZpiUtil.java index 09ab3b0..49644fc 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/util/ZpiUtil.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/util/ZpiUtil.java @@ -107,7 +107,7 @@ public class ZpiUtil { int lastIndexOf = entryName.lastIndexOf("."); if (lastIndexOf != -1) { String name = entryName.substring(0, lastIndexOf); - String suffix = entryName.substring(lastIndexOf + 1, entryName.length()); + String suffix = entryName.substring(lastIndexOf + 1); entryName = name + "(" + seq + ")" + "." + suffix; } else { entryName += "(" + seq + ")"; diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/vRView/ws/HzWebSocketServer.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/vRView/ws/HzWebSocketServer.java index 212d86c..c7dc9cb 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/vRView/ws/HzWebSocketServer.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/vRView/ws/HzWebSocketServer.java @@ -26,12 +26,12 @@ public class HzWebSocketServer { //静态变量,用来记录当前在线连接数。应该把它设计成线程安全的。 - private static AtomicInteger onlineNum = new AtomicInteger(); + private static final AtomicInteger onlineNum = new AtomicInteger(); //concurrent包的线程安全Set,用来存放每个客户端对应的WebSocketServer对象。 - private static ConcurrentHashMap sessionPools = new ConcurrentHashMap<>(); + private static final ConcurrentHashMap sessionPools = new ConcurrentHashMap<>(); //记录参数 - private static ConcurrentHashMap params = new ConcurrentHashMap<>(); + private static final ConcurrentHashMap params = new ConcurrentHashMap<>(); //发送消息 public void sendMessage(Session session, String message) throws IOException { @@ -95,7 +95,7 @@ public class HzWebSocketServer { data.setJsonData("{" + "\"name\": \"" + deviceName + "\"," + - "\"data\": \"" + sb.toString() + "\"" + + "\"data\": \"" + sb + "\"" + "}"); } else { String str = "暂无数据"; diff --git a/hzims-service/operational/src/main/resources/db/4.0.0 .sql b/hzims-service/operational/src/main/resources/db/4.0.0 .sql.1 similarity index 52% rename from hzims-service/operational/src/main/resources/db/4.0.0 .sql rename to hzims-service/operational/src/main/resources/db/4.0.0 .sql.1 index 6eb45b3..94cf96e 100644 --- a/hzims-service/operational/src/main/resources/db/4.0.0 .sql +++ b/hzims-service/operational/src/main/resources/db/4.0.0 .sql.1 @@ -30,65 +30,4 @@ CREATE TABLE `HZIMS_OPER_CONSTRUCTION` ( `UPDATE_USER` BIGINT(20) NULL DEFAULT NULL COMMENT '修改人', `UPDATE_TIME` DATETIME NULL DEFAULT NULL COMMENT '修改时间', PRIMARY KEY (`ID`) USING BTREE -) ENGINE = INNODB CHARACTER SET = UTF8MB4 COLLATE = UTF8MB4_GENERAL_CI ROW_FORMAT = DYNAMIC; - - -ALTER TABLE `HZIMS_OPER_ACCESS_CONTENT` DROP COLUMN `STATION_CODE`; - -ALTER TABLE `HZIMS_OPER_ACCESS_CONTENT` DROP COLUMN `STATION_NAME`; - -ALTER TABLE `HZIMS_OPER_ACCESS_CONTENT` DROP COLUMN `EM_NAME`; - -ALTER TABLE `HZIMS_OPER_ACCESS_LIBRARY` MODIFY COLUMN `EM_CODE` VARCHAR(64) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NOT NULL COMMENT '设备编码' AFTER `ID`; - -ALTER TABLE `HZIMS_OPER_ACCESS_LIBRARY` MODIFY COLUMN `PERIOD` INT(11) NOT NULL COMMENT '检修间隔' AFTER `GRADE_CODE`; - -ALTER TABLE `HZIMS_OPER_ACCESS_LIBRARY` MODIFY COLUMN `WORK_STANDARDS` VARCHAR(500) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NOT NULL DEFAULT '' COMMENT '操作规范' AFTER `PERIOD`; - -ALTER TABLE `HZIMS_OPER_ACCESS_LIBRARY` MODIFY COLUMN `SAFE_INFOS` VARCHAR(500) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NOT NULL DEFAULT '' COMMENT '安全警告' AFTER `WORK_STANDARDS`; - -ALTER TABLE `HZIMS_OPER_ACCESS_LIBRARY` MODIFY COLUMN `STOP_HOURS` INT(11) NOT NULL COMMENT '停用时间' AFTER `SAFE_INFOS`; - -ALTER TABLE `HZIMS_OPER_ACCESS_LIBRARY` MODIFY COLUMN `DESCRIPITON` VARCHAR(500) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NOT NULL DEFAULT '' COMMENT '描述' AFTER `LAST_SERVICE_TIME`; - -ALTER TABLE `HZIMS_OPER_ACCESS_LIBRARY` DROP COLUMN `EM_NAME`; - -ALTER TABLE `HZIMS_OPER_ACCESS_PLAN` DROP COLUMN `UPDATE_USER_NAME`; - -ALTER TABLE `HZIMS_OPER_ACCESS_PLAN` DROP COLUMN `CREATE_USER_NAME`; - -ALTER TABLE `HZIMS_OPER_ACCESS_PLAN` DROP COLUMN `MANAGER_NAME`; - -ALTER TABLE `HZIMS_OPER_ACCESS_PLAN` DROP COLUMN `TECH_LEAD_NAME`; - -ALTER TABLE `HZIMS_OPER_ACCESS_STATISTICS` DROP COLUMN `EM_CODE`; - -ALTER TABLE `HZIMS_OPER_ACCESS_STATISTICS` DROP COLUMN `PLAN_HOURS`; - -ALTER TABLE `HZIMS_OPER_ACCESS_STATISTICS` DROP COLUMN `UPDATE_USER_NAME`; - -ALTER TABLE `HZIMS_OPER_ACCESS_STATISTICS` DROP COLUMN `CREATE_USER_NAME`; - -ALTER TABLE `HZIMS_OPER_ACCESS_STATISTICS` DROP COLUMN `MANAGER_NAME`; - -ALTER TABLE `HZIMS_OPER_ACCESS_STATISTICS` DROP COLUMN `EM_NAME`; - -ALTER TABLE `HZIMS_OPER_ACCESS_TASK` DROP COLUMN `STATION_CODE`; - -ALTER TABLE `HZIMS_OPER_ACCESS_TASK` DROP COLUMN `STATION_NAME`; - -ALTER TABLE `HZIMS_OPER_ACCESS_TASK` DROP COLUMN `EM_NAME`; - -ALTER TABLE `HZIMS_OPER_ACCESS_TASK` DROP COLUMN `PLAN_HOURS`; - -ALTER TABLE `HZIMS_OPER_ACCESS_TASK` DROP COLUMN `CONSTRUCTION_ID`; - -ALTER TABLE `HZIMS_OPER_ACCESS_TASK` DROP COLUMN `UPDATE_USER_NAME`; - -ALTER TABLE `HZIMS_OPER_ACCESS_TASK` DROP COLUMN `CREATE_USER_NAME`; - -ALTER TABLE `HZIMS_OPER_ACCESS_TASK` DROP COLUMN `HANDLER_NAME`; - -ALTER TABLE `HZIMS_OPER_ACCESS_TASK_DETAIL` DROP COLUMN `UPDATE_USER_NAME`; - -ALTER TABLE `HZIMS_OPER_ACCESS_TASK_DETAIL` DROP COLUMN `CREATE_USER_NAME`; \ No newline at end of file +) ENGINE = INNODB CHARACTER SET = UTF8MB4 COLLATE = UTF8MB4_GENERAL_CI ROW_FORMAT = DYNAMIC; \ No newline at end of file diff --git a/hzims-service/operational/src/test/java/com/hnac/hzims/operational/OperationApplicationTest.java b/hzims-service/operational/src/test/java/com/hnac/hzims/operational/OperationApplicationTest.java index 4184d72..b3d1553 100644 --- a/hzims-service/operational/src/test/java/com/hnac/hzims/operational/OperationApplicationTest.java +++ b/hzims-service/operational/src/test/java/com/hnac/hzims/operational/OperationApplicationTest.java @@ -148,13 +148,13 @@ public class OperationApplicationTest { phenomenon.setDiscriminateStatus("0"); phenomenon.setFaultName("1G压力表阀对象-1G压力表阀-下-磁翻板液位计-智能巡检异常"); phenomenon.setSourceCode("JX"); - phenomenon.setSourceId(1571697505073217538l); - phenomenon.setFinder(1380502803954315265l); + phenomenon.setSourceId(1571697505073217538L); + phenomenon.setFinder(1380502803954315265L); phenomenon.setDescripiton("机器人巡检事件 - 识别"); phenomenon.setInitResult(null); phenomenon.setTenantId("200000"); - phenomenon.setCreateUser(1380502803954315265l); - phenomenon.setCreateDept(20000001l); + phenomenon.setCreateUser(1380502803954315265L); + phenomenon.setCreateDept(20000001L); R result = operPhenomenonClient.submit(phenomenon); log.info("结果为:{}",JSON.toJSONString(result)); } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/AccidentController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/AccidentController.java index 6cd9bc6..51e90c8 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/AccidentController.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/AccidentController.java @@ -50,9 +50,9 @@ public class AccidentController extends BladeController { private final IAccidentService accidentService; private final IOssClient ossClient; - private static ReentrantReadWriteLock lock = new ReentrantReadWriteLock(); - private static ReentrantReadWriteLock.WriteLock writeLock = lock.writeLock(); - private static ReentrantReadWriteLock.ReadLock readLock = lock.readLock(); + private static final ReentrantReadWriteLock lock = new ReentrantReadWriteLock(); + private static final ReentrantReadWriteLock.WriteLock writeLock = lock.writeLock(); + private static final ReentrantReadWriteLock.ReadLock readLock = lock.readLock(); @PostMapping("/save") @ApiOperation("事故管理保存") diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/SafetyToolController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/SafetyToolController.java index 9c990b3..c809b6b 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/SafetyToolController.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/SafetyToolController.java @@ -167,7 +167,7 @@ public class SafetyToolController extends BladeController { out.write(FileUtils.readFileToByteArray(file)); out.flush(); } catch (IOException e) { - throw new ServiceException("导出PDF发生异常 :" + e.toString()); + throw new ServiceException("导出PDF发生异常 :" + e); } finally { out.close(); } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/enums/CheckItemEnum.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/enums/CheckItemEnum.java index 03f5de3..3eee294 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/enums/CheckItemEnum.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/enums/CheckItemEnum.java @@ -1,8 +1,11 @@ package com.hnac.hzims.safeproduct.enums; +import lombok.Getter; + /** * 检查项(初始化数据,固定不能修改) */ +@Getter public enum CheckItemEnum { WORK_TICKET("工作票合格率", "开票数:%s张,合格率:%s%%"), OPERATION_TICKET("操作票合格率", "开票数:%s张,合格率:%s%%"), @@ -18,20 +21,12 @@ public enum CheckItemEnum { SAFETY_METTING("现场每月1次安全生产会议", ""), SKILLS_TRAINING("每月开展1次技能培训", ""); - private String name; - private String value; + private final String name; + private final String value; CheckItemEnum(String name, String value) { this.name = name; this.value = value; } - public String getValue() { - return value; - } - - public String getName() { - return name; - } - } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/enums/CheckStatusEnum.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/enums/CheckStatusEnum.java index 1e7a92b..c414b55 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/enums/CheckStatusEnum.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/enums/CheckStatusEnum.java @@ -1,34 +1,28 @@ package com.hnac.hzims.safeproduct.enums; +import lombok.Getter; import org.springblade.core.tool.utils.StringUtil; /** * 检查状态 */ +@Getter public enum CheckStatusEnum { NOT_SUBMIT(1, "暂存"), SUBMIT(2, "已提交"), PASS(3, "核查通过"), NOT_PASS(4, "核查不通过"); - private int value; - private String name; + private final int value; + private final String name; CheckStatusEnum(int value, String name) { this.value = value; this.name = name; } - public int getValue() { - return value; - } - - public String getName() { - return name; - } - - public static String getName(int value) { + public static String getName(int value) { for (CheckStatusEnum item : CheckStatusEnum.values()) { if (value == item.getValue()) { return item.getName(); diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/excel/SafetyToolImporter.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/excel/SafetyToolImporter.java index 29dbd1b..516bce5 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/excel/SafetyToolImporter.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/excel/SafetyToolImporter.java @@ -23,7 +23,7 @@ public class SafetyToolImporter implements ExcelImporter { //计数器 public int counter = 2; //类型名称//todo 这里需要加上缓存 - private Map typeNames; + private final Map typeNames; public SafetyToolImporter(ISafetyToolService service, Map typeNames) { this.service = service; diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hazard/util/ExcelConvertPdf.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hazard/util/ExcelConvertPdf.java index c68fa1f..3868825 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hazard/util/ExcelConvertPdf.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hazard/util/ExcelConvertPdf.java @@ -127,19 +127,11 @@ public class ExcelConvertPdf { System.out.println("合并"+rowNum+"、"+colNum); table.addCell(cell1); flag = false; - if (ranges.size()>1){ - mergeFlag = true; - }else { - mergeFlag = false; - } + mergeFlag = ranges.size() > 1; break; } flag = false; - if (ranges.size()>1){ - mergeFlag = true; - }else { - mergeFlag = false; - } + mergeFlag = ranges.size() > 1; } } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/schedule/HiddenDangerPlanSchedule.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/schedule/HiddenDangerPlanSchedule.java index 6f1aa37..844116b 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/schedule/HiddenDangerPlanSchedule.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/schedule/HiddenDangerPlanSchedule.java @@ -186,11 +186,11 @@ public class HiddenDangerPlanSchedule { case com.hnac.hzims.common.utils.DateUtil.YEAR: return date.plusYears(nums); case com.hnac.hzims.common.utils.DateUtil.QUARTER: - return date.plusMonths(nums*4); + return date.plusMonths(nums* 4L); case com.hnac.hzims.common.utils.DateUtil.MONTH: return date.plusMonths(nums); case com.hnac.hzims.common.utils.DateUtil.WEEK: - return date.plusDays(nums*7); + return date.plusDays(nums* 7L); case com.hnac.hzims.common.utils.DateUtil.DAY: return date.plusDays(nums); default: diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/management/excel/CustomMergeStrategy.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/management/excel/CustomMergeStrategy.java index d47a30d..c230933 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/management/excel/CustomMergeStrategy.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/management/excel/CustomMergeStrategy.java @@ -34,12 +34,12 @@ public class CustomMergeStrategy implements RowWriteHandler { /** * 需要合并的列的下标集合 */ - private List needMergeColumnIndex = new ArrayList<>(); + private final List needMergeColumnIndex = new ArrayList<>(); /** * DTO数据类型 */ - private Class elementType; + private final Class elementType; public CustomMergeStrategy(Class elementType) { this.elementType = elementType; @@ -146,7 +146,7 @@ public class CustomMergeStrategy implements RowWriteHandler { continue; } // 将字段和excel的表头匹配上 - if (easyExcelAnno.value()[0].equalsIgnoreCase(((Cell) theCell).getStringCellValue())) { + if (easyExcelAnno.value()[0].equalsIgnoreCase(theCell.getStringCellValue())) { if (customMerge.isPk()) { pkIndex = index; } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/management/handler/CustomMergeStrategyHandler.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/management/handler/CustomMergeStrategyHandler.java index 0b75661..186b3c0 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/management/handler/CustomMergeStrategyHandler.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/management/handler/CustomMergeStrategyHandler.java @@ -23,12 +23,12 @@ public class CustomMergeStrategyHandler extends AbstractMergeStrategy { /** * 分组,每几行合并一次 */ - private List> mergeColDataGroupCountList; + private final List> mergeColDataGroupCountList; /** * 目标合并列index */ - private List targetColumnIndex; + private final List targetColumnIndex; /** * 需要开始合并单元格的首行index */ diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/SafetyToolServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/SafetyToolServiceImpl.java index 195239c..eb608fc 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/SafetyToolServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/SafetyToolServiceImpl.java @@ -255,7 +255,7 @@ public class SafetyToolServiceImpl extends BaseServiceImpl dataConversion, String key, Object value); + void getDataConversion(Map dataConversion, String key, Object value); Long startUpOfflineTicket(WorkTicketVo workTicketVo); } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/FirstWorkTicketServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/FirstWorkTicketServiceImpl.java index 47e620c..87ced23 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/FirstWorkTicketServiceImpl.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/FirstWorkTicketServiceImpl.java @@ -64,6 +64,7 @@ import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.math.BigDecimal; +import java.math.RoundingMode; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; @@ -1109,7 +1110,7 @@ public class FirstWorkTicketServiceImpl extends BaseServiceImpl result, String key) { String value = WordHelper.toString(result.get(key)); - if (StringUtils.isBlank(value)) { - return true; - } - return false; + return StringUtils.isBlank(value); } @@ -72,10 +69,7 @@ public class WordHelper extends StringUtils { */ public static boolean isNoneBlank(Map result, String key) { String value = WordHelper.toString(result.get(key)); - if (StringUtils.isNoneBlank(value)) { - return true; - } - return false; + return StringUtils.isNoneBlank(value); } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/utils/ExcelUtil.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/utils/ExcelUtil.java index 42e8081..968e95b 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/utils/ExcelUtil.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/utils/ExcelUtil.java @@ -14,6 +14,7 @@ import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletResponse; import java.io.*; +import java.nio.charset.StandardCharsets; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Map; @@ -44,7 +45,7 @@ public class ExcelUtil { response.reset(); response.setContentType("application/x-msdownload"); fileName = fileName + new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()); - response.setHeader("Content-disposition","attachment; filename="+new String(fileName.getBytes("gb2312"),"ISO-8859-1")+".xls"); + response.setHeader("Content-disposition","attachment; filename="+new String(fileName.getBytes("gb2312"), StandardCharsets.ISO_8859_1)+".xls"); ServletOutputStream outStream=null; try{ outStream = response.getOutputStream(); diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/utils/PdfUtils.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/utils/PdfUtils.java index 490b280..ae5b8b6 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/utils/PdfUtils.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/utils/PdfUtils.java @@ -55,7 +55,7 @@ public class PdfUtils { File templateFile = new File(templateFilePath); File saveFile = new File(saveFilePath); //获取文件类型 - String fileType = templateFileName.substring(templateFileName.lastIndexOf("."), templateFileName.length()); + String fileType = templateFileName.substring(templateFileName.lastIndexOf(".")); InputStream inputStream = null; OutputStream outputStream = null; try { diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/controller/WorkTicketInfoController.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/controller/WorkTicketInfoController.java index 3391c6d..31ac092 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/controller/WorkTicketInfoController.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/controller/WorkTicketInfoController.java @@ -159,7 +159,7 @@ public class WorkTicketInfoController { .doWrite(list); } } catch (Exception e) { - System.out.println("exportExcel = " + e.toString()); + System.out.println("exportExcel = " + e); // 重置response response.reset(); response.setContentType("application/json"); @@ -170,7 +170,7 @@ public class WorkTicketInfoController { try { response.getWriter().println(JSONUtils.toJSONString(map)); } catch (IOException e3) { - throw new ServiceException( "发生异常 :" + e.toString()); + throw new ServiceException( "发生异常 :" + e); } } } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/feign/OperateTicketClient.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/feign/OperateTicketClient.java index 7fe5054..de029a0 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/feign/OperateTicketClient.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/feign/OperateTicketClient.java @@ -12,6 +12,7 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import java.math.BigDecimal; +import java.math.RoundingMode; /** * @author hx @@ -39,9 +40,7 @@ public class OperateTicketClient implements IOperateTicketClient { vo = new SafeCheckStatisticVO(); } if(ObjectUtil.isNotEmpty(vo.getTotal()) && vo.getTotal() != 0){ - double qualifiedRate = new BigDecimal( - (vo.getQualified() / (double) vo.getTotal() * 100) - ).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue(); + double qualifiedRate = BigDecimal.valueOf(vo.getQualified() / (double) vo.getTotal() * 100).setScale(2, RoundingMode.HALF_UP).doubleValue(); vo.setQualifiedRate(qualifiedRate); } vo.setProjectType(Constants.SafeCheckProjectEnum.OPERATE_TICKET.getType()); diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/feign/TicketInfoClient.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/feign/TicketInfoClient.java index 3c9d3f5..c0a81cc 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/feign/TicketInfoClient.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/feign/TicketInfoClient.java @@ -29,6 +29,7 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.*; import java.math.BigDecimal; +import java.math.RoundingMode; import java.text.ParseException; import java.text.SimpleDateFormat; import java.time.LocalDateTime; @@ -284,9 +285,7 @@ public class TicketInfoClient implements ITicketInfoClient { vo.setProjectTypeName(Constants.SafeCheckProjectEnum.WORK_TICKET.getName()); //计算合格率 if (ObjectUtil.isNotEmpty(vo.getTotal()) && vo.getTotal() != 0) { - double qualifiedRate = new BigDecimal( - vo.getQualified() / (double) vo.getTotal() * 100 - ).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); + double qualifiedRate = BigDecimal.valueOf(vo.getQualified() / (double) vo.getTotal() * 100).setScale(2, RoundingMode.HALF_UP).doubleValue(); vo.setQualifiedRate(qualifiedRate); } return R.data(vo); diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketInfoServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketInfoServiceImpl.java index fd8385a..f9df574 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketInfoServiceImpl.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketInfoServiceImpl.java @@ -118,7 +118,7 @@ public class WorkTicketInfoServiceImpl extends BaseServiceImpl paramMap = new HashMap<>(7); - paramMap.put("location", BigDecimal.valueOf(longitude).setScale(6, BigDecimal.ROUND_HALF_UP).toString() + "," + BigDecimal.valueOf(latitude).setScale(6, BigDecimal.ROUND_HALF_UP).toString()); + paramMap.put("location", BigDecimal.valueOf(longitude).setScale(6, RoundingMode.HALF_UP).toString() + "," + BigDecimal.valueOf(latitude).setScale(6, RoundingMode.HALF_UP).toString()); paramMap.put("type", poiTypeEnum.getType()); paramMap.put("radius", String.valueOf(radius)); paramMap.put("number", String.valueOf(number)); diff --git a/hzims-service/weather/src/main/java/com/hnac/hzims/weather/service/impl/HeWeatherMinutelyServiceImpl.java b/hzims-service/weather/src/main/java/com/hnac/hzims/weather/service/impl/HeWeatherMinutelyServiceImpl.java index 12310f9..ea3b75b 100644 --- a/hzims-service/weather/src/main/java/com/hnac/hzims/weather/service/impl/HeWeatherMinutelyServiceImpl.java +++ b/hzims-service/weather/src/main/java/com/hnac/hzims/weather/service/impl/HeWeatherMinutelyServiceImpl.java @@ -11,6 +11,7 @@ import com.hnac.hzims.weather.service.HeWeatherMinutelyService; import java.io.IOException; import java.math.BigDecimal; +import java.math.RoundingMode; import java.util.HashMap; import java.util.Map; @@ -35,7 +36,7 @@ public class HeWeatherMinutelyServiceImpl extends HeWeatherBaseService implement return new HeWeatherMinutelyResponse(StatusEnum.KEY_INVALID); } Map paramMap = new HashMap<>(6); - paramMap.put("location", BigDecimal.valueOf(longitude).setScale(6, BigDecimal.ROUND_HALF_UP).toString() + "," + BigDecimal.valueOf(latitude).setScale(6, BigDecimal.ROUND_HALF_UP).toString()); + paramMap.put("location", BigDecimal.valueOf(longitude).setScale(6, RoundingMode.HALF_UP).toString() + "," + BigDecimal.valueOf(latitude).setScale(6, RoundingMode.HALF_UP).toString()); paramMap.put("lang", langEnum.getLang()); String response = getResponse(getPath(ApiEnum.MINUTELY), getRequestParam(paramMap)); try { diff --git a/hzims-service/weather/src/main/java/com/hnac/hzims/weather/util/HttpUtil.java b/hzims-service/weather/src/main/java/com/hnac/hzims/weather/util/HttpUtil.java index ddc88d6..892c9e7 100644 --- a/hzims-service/weather/src/main/java/com/hnac/hzims/weather/util/HttpUtil.java +++ b/hzims-service/weather/src/main/java/com/hnac/hzims/weather/util/HttpUtil.java @@ -331,9 +331,9 @@ public class HttpUtil { public class ResponseWrap { - private CloseableHttpResponse response; - private HttpClientContext context; - private HttpEntity entity; + private final CloseableHttpResponse response; + private final HttpClientContext context; + private final HttpEntity entity; public ResponseWrap(CloseableHttpResponse response, HttpClientContext context) { this.response = response;