From 414b954d367a5c7b41f29cd38a6db04e9f651c3d Mon Sep 17 00:00:00 2001 From: haungxing <1203316822@qq.com> Date: Mon, 3 Jul 2023 14:34:35 +0800 Subject: [PATCH] =?UTF-8?q?#=20=E7=AB=99=E7=82=B9=E9=9B=86=E4=B8=AD?= =?UTF-8?q?=E7=9B=91=E6=8E=A7=E5=B1=9E=E6=80=A7=E6=8E=92=E5=BA=8F=E8=B5=8B?= =?UTF-8?q?=E5=80=BC=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/hnac/hzinfo/inspect/obj/entity/ContentEntity.java | 2 +- .../operational/station/service/impl/StationAttributeServiceImpl.java | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/obj/entity/ContentEntity.java b/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/obj/entity/ContentEntity.java index e3372eb..495bdae 100644 --- a/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/obj/entity/ContentEntity.java +++ b/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/obj/entity/ContentEntity.java @@ -133,7 +133,7 @@ public class ContentEntity extends TenantEntity { @ApiModelProperty(value = "绑定物模型属性标识") private String attrSignage; - @ApiModelProperty(value = "绑定物模型属性标识") + @ApiModelProperty(value = "绑定物模型属性名称") private String attrName; @ApiModelProperty(value = "绑定采集点ID") diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationAttributeServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationAttributeServiceImpl.java index 9a60ed7..05560c2 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationAttributeServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationAttributeServiceImpl.java @@ -39,6 +39,7 @@ import org.springframework.util.Assert; import java.util.*; import java.util.function.Function; import java.util.stream.Collectors; +import java.util.stream.Stream; /** * @author hx @@ -237,6 +238,8 @@ public class StationAttributeServiceImpl extends BaseServiceImpl this.fillAttrId(stationAttrList,stationAttr)) .sorted(Comparator.comparing(StationAttributeVo::getSort,Comparator.nullsLast(Integer::compareTo))) .collect(Collectors.toList()); + // 排序完成之后循环赋值 + Stream.iterate(1,n -> n+1).limit(result.size()).forEach(index -> result.get(index-1).setSort(index)); return result; } @@ -282,7 +285,6 @@ public class StationAttributeServiceImpl extends BaseServiceImpl