Browse Source

资产添加字段org_id,指标空指针问题处理

develop
ljlong_2630 11 months ago
parent
commit
ace1b894be
  1. BIN
      .DS_Store
  2. 1
      .gitignore
  3. BIN
      lzbi-admin/.DS_Store
  4. 62
      lzbi-module/src/main/java/com/lzbi/asset/domain/DcBaseAssetInfo.java
  5. 29
      lzbi-module/src/main/java/com/lzbi/targetFolder/controller/DcBaseAssetTargetController.java

BIN
.DS_Store

Binary file not shown.

1
.gitignore

@ -27,6 +27,7 @@ target/
### JRebel ###
rebel.xml
.DS_Store
### NetBeans ###
nbproject/private/

BIN
lzbi-admin/.DS_Store

Binary file not shown.

62
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;
}

29
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<DcBaseAssetTargetExpand> list = dcBaseAssetTargetService.selectDcBaseAssetTargetExpandList(dcBaseAssetTarget);
if (list == null) {
// 处理列表为空的情况
return AjaxResult.error("列表为空");
}
// 去重
List<DcBaseAssetTargetExpand> 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<DcBaseAssetTargetExpand> list = dcBaseAssetTargetService.selectDcBaseAssetTargetExpandList(dcBaseAssetTarget);
// // 去重
// List<DcBaseAssetTargetExpand> distinctList = list.stream()
// .collect(Collectors.collectingAndThen(
// Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(DcBaseAssetTargetExpand::getFieldCode)
// .thenComparing(DcBaseAssetTargetExpand::getTargetModelCode))),
// ArrayList::new));
//
// // 分组
// Map<String, List<DcBaseAssetTargetExpand>> groupedMap = distinctList.stream()
// .collect(Collectors.groupingBy(DcBaseAssetTargetExpand::getFieldCode));
//
// return AjaxResult.success(groupedMap);
// }
}

Loading…
Cancel
Save