From ace1b894be4465b8f09cdc38b32d37a4e0de662c Mon Sep 17 00:00:00 2001 From: ljlong_2630 Date: Fri, 12 Jan 2024 10:52:44 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B5=84=E4=BA=A7=E6=B7=BB=E5=8A=A0=E5=AD=97?= =?UTF-8?q?=E6=AE=B5org=5Fid,=E6=8C=87=E6=A0=87=E7=A9=BA=E6=8C=87=E9=92=88?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .DS_Store | Bin 0 -> 6148 bytes .gitignore | 1 + lzbi-admin/.DS_Store | Bin 0 -> 6148 bytes .../lzbi/asset/domain/DcBaseAssetInfo.java | 62 +++++++++--------- .../DcBaseAssetTargetController.java | 29 +++++++- 5 files changed, 58 insertions(+), 34 deletions(-) create mode 100644 .DS_Store create mode 100644 lzbi-admin/.DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..64574b386413e2c65f2f1d4c76fa500a38241c72 GIT binary patch literal 6148 zcmeHKOHRWu6dcn^EfgUnHf)e`0V*MJfB@|R30S}dAW12oga9exv&x=3a0SlC3g+1s zirsbzLddVOC$VSj=TQ>Z0Mzb7wgs#L=&}g5msrgR>6bDU3$|sAsAP;XP4Y6~oeUQu zI1n88>ki1f+d_g%-0bJh`@6%Q{-+MTh!!%GNIllO$Lin!``E(}M>xUIWvdO3-9?Uq z9+PdldShDAo0h}zSNu}y6= zTgfxS12Y+UDlvGT>W+#t&Nsn}tI~GQQ&o6IMa>9>s{$WCwbC%W$E>cHSArB<*yaOs zCG&YI`st`TxTUTj`-ye#vc*A%y^Lc%xH}l&kl5EA_NmJ}9o=(ui=J*;LFXJri>to# z^AV>U7VZAY;GQkf?HLSpa3DAk9QbxXz7G+LU~I8As6QR7^bvsAX0r}n>p%a*NE(Q- z#o8cS7|KYAMyl))L)o)~GII9EmR}n*awt7B$FVajdqPq6=%FG_hl&k`Iyevt|;6E2Z96t$^q3LoD6okB)hjxEl&2@h~<<;LU^@7En#K1V|^i8@j8nR Z_C<0*j4jp%*}@2a1hfsI3J(0L17BlB1Iqva literal 0 HcmV?d00001 diff --git a/.gitignore b/.gitignore index ed8368a..3f85143 100644 --- a/.gitignore +++ b/.gitignore @@ -27,6 +27,7 @@ target/ ### JRebel ### rebel.xml +.DS_Store ### NetBeans ### nbproject/private/ diff --git a/lzbi-admin/.DS_Store b/lzbi-admin/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..638b0d7026a296895fb31efe27e5047a6d991ff3 GIT binary patch literal 6148 zcmeHKJ8l9o5S<|it(0a9^us9E~@hB50G26hv>N@w3PC zZ21*CJ0hapdG{vLibw-Dl#2~hvwic4%`&1uIL_G1u>0B`K90x3B>U%paThYkMo#ki zoo^d7DnJFO02QDDRN&zXWQlEFAAT|qqykjn*%h$wLxCIC#4*r69T>a?0L~G1!`yob zV6gzOCXRuKz%;19plY@l8g#@<=GDY8FzBM$d}!XR*`cW4j`NGBi`GDnRDcTHEASG_ z*6RNX{!9OVPvVLSP=SA?fX@5(zQdEUwoV>rwYI?5aLc*E%`kTg1~11zFUMF|IbM2F bPDkA7K>iGvE;K6e*9zPK5X%*r literal 0 HcmV?d00001 diff --git a/lzbi-module/src/main/java/com/lzbi/asset/domain/DcBaseAssetInfo.java b/lzbi-module/src/main/java/com/lzbi/asset/domain/DcBaseAssetInfo.java index 8276ae2..c088144 100644 --- a/lzbi-module/src/main/java/com/lzbi/asset/domain/DcBaseAssetInfo.java +++ b/lzbi-module/src/main/java/com/lzbi/asset/domain/DcBaseAssetInfo.java @@ -3,6 +3,7 @@ package com.lzbi.asset.domain; import com.lzbi.common.annotation.Excel; import com.lzbi.module.base.BaseModuleEntity; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.experimental.Accessors; @@ -17,59 +18,56 @@ import lombok.experimental.Accessors; public class DcBaseAssetInfo extends BaseModuleEntity { private static final long serialVersionUID = 1L; - /** - * 资产名称 - */ - @Excel(name = "资产名称") + /** 统计单元名称 */ + @Excel(name = "统计单元名称") + @ApiModelProperty(name = "统计单元名称",notes = "assetName") private String assetName; - /** - * 资产编码 - */ - @Excel(name = "资产编码") + /** 统计单元编码 */ + @Excel(name = "统计单元编码") + @ApiModelProperty(name = "统计单元编码",notes = "assetCode") private String assetCode; - /** - * 资产类别;设备型资产;管理型资产; - */ - @Excel(name = "资产类别;设备型资产;管理型资产;") + /** 统计单元别名 */ + @Excel(name = "统计单元别名") + @ApiModelProperty(name = "统计单元别名",notes = "assetNameAlias") + private String assetNameAlias; + + /** 统计单元类别;设备型;管理型; */ + @Excel(name = "统计单元类别;设备型;管理型;") + @ApiModelProperty(name = "统计单元类别;设备型;管理型;",notes = "assetClass") private String assetClass; - /** - * 部门共享;0不共享;1限定部门共享;2所有部门可见 - */ + /** 部门共享;0不共享;1限定部门共享;2所有部门可见 */ @Excel(name = "部门共享;0不共享;1限定部门共享;2所有部门可见") + @ApiModelProperty(name = "部门共享;0不共享;1限定部门共享;2所有部门可见",notes = "flagValidateDept") private String flagValidateDept; - /** - * 角色内共享;0不共享;1限定角色共享;2所有角色可见 - */ + /** 角色内共享;0不共享;1限定角色共享;2所有角色可见 */ @Excel(name = "角色内共享;0不共享;1限定角色共享;2所有角色可见") + @ApiModelProperty(name = "角色内共享;0不共享;1限定角色共享;2所有角色可见",notes = "flagValidateRole") private String flagValidateRole; - /** - * 用户共享;0不共享;1限定用户共享;2所有用户可见 - */ + /** 用户共享;0不共享;1限定用户共享;2所有用户可见 */ @Excel(name = "用户共享;0不共享;1限定用户共享;2所有用户可见") + @ApiModelProperty(name = "用户共享;0不共享;1限定用户共享;2所有用户可见",notes = "flagValidateUser") private String flagValidateUser; - /** - * 资产状态 - */ - @Excel(name = "资产状态") + /** 统计单元状态 */ + @Excel(name = "统计单元状态") + @ApiModelProperty(name = "统计单元状态",notes = "statusAsset") private String statusAsset; - /** - * 所属公司 - */ + /** 所属公司 */ @Excel(name = "所属公司") + @ApiModelProperty(name = "所属公司",notes = "comanyId") private Long comanyId; - /** - * 所属组织结构 - */ + /** 所属组织结构 */ @Excel(name = "所属组织结构") - private Long deptId; + @ApiModelProperty(name = "所属组织结构",notes = "orgId") + private Long orgId; + public String getValue() { return this.assetCode; } diff --git a/lzbi-module/src/main/java/com/lzbi/targetFolder/controller/DcBaseAssetTargetController.java b/lzbi-module/src/main/java/com/lzbi/targetFolder/controller/DcBaseAssetTargetController.java index 73007cb..ce0e976 100644 --- a/lzbi-module/src/main/java/com/lzbi/targetFolder/controller/DcBaseAssetTargetController.java +++ b/lzbi-module/src/main/java/com/lzbi/targetFolder/controller/DcBaseAssetTargetController.java @@ -193,11 +193,18 @@ public class DcBaseAssetTargetController extends BaseController @GetMapping("/listUsedModel") public AjaxResult listUsedModel(DcBaseAssetTargetExpand dcBaseAssetTarget) { List list = dcBaseAssetTargetService.selectDcBaseAssetTargetExpandList(dcBaseAssetTarget); + + if (list == null) { + // 处理列表为空的情况 + return AjaxResult.error("列表为空"); + } + // 去重 List distinctList = list.stream() + .filter(Objects::nonNull) // 过滤掉空对象 .collect(Collectors.collectingAndThen( - Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(DcBaseAssetTargetExpand::getFieldCode) - .thenComparing(DcBaseAssetTargetExpand::getTargetModelCode))), + Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(DcBaseAssetTargetExpand::getFieldCode, Comparator.nullsFirst(String::compareTo)) + .thenComparing(DcBaseAssetTargetExpand::getTargetModelCode, Comparator.nullsFirst(String::compareTo)))), ArrayList::new)); // 分组 @@ -206,5 +213,23 @@ public class DcBaseAssetTargetController extends BaseController return AjaxResult.success(groupedMap); } +// @PreAuthorize("@ss.hasPermi('target:target:list')") +// @GetMapping("/listUsedModel") +// public AjaxResult listUsedModel(DcBaseAssetTargetExpand dcBaseAssetTarget) { +// List list = dcBaseAssetTargetService.selectDcBaseAssetTargetExpandList(dcBaseAssetTarget); +// // 去重 +// List distinctList = list.stream() +// .collect(Collectors.collectingAndThen( +// Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(DcBaseAssetTargetExpand::getFieldCode) +// .thenComparing(DcBaseAssetTargetExpand::getTargetModelCode))), +// ArrayList::new)); +// +// // 分组 +// Map> groupedMap = distinctList.stream() +// .collect(Collectors.groupingBy(DcBaseAssetTargetExpand::getFieldCode)); +// +// return AjaxResult.success(groupedMap); +// } + }