From 6919543b5d963fb8eb15bbe88d5e199c0df67a7a Mon Sep 17 00:00:00 2001 From: ljlong_2630 Date: Wed, 27 Dec 2023 11:19:24 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E5=8D=95=E5=85=83=E5=9F=BA?= =?UTF-8?q?=E6=9C=AC=E9=85=8D=E7=BD=AE=E6=94=B9=E9=80=A0=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DcBaseParamModelController.java | 13 +++ .../DcBaseAssetTargetController.java | 27 ++++- .../domain/DcBaseAssetTargetExpand.java | 27 +++++ .../mapper/DcBaseAssetTargetMapper.java | 7 ++ .../service/DcBaseAssetTargetService.java | 13 +++ .../targetFolder/DcBaseAssetTargetMapper.xml | 106 ++++++++++++++++++ 6 files changed, 190 insertions(+), 3 deletions(-) create mode 100644 lzbi-module/src/main/java/com/lzbi/targetFolder/domain/DcBaseAssetTargetExpand.java diff --git a/lzbi-module/src/main/java/com/lzbi/asset/controller/DcBaseParamModelController.java b/lzbi-module/src/main/java/com/lzbi/asset/controller/DcBaseParamModelController.java index 004f976..852c417 100644 --- a/lzbi-module/src/main/java/com/lzbi/asset/controller/DcBaseParamModelController.java +++ b/lzbi-module/src/main/java/com/lzbi/asset/controller/DcBaseParamModelController.java @@ -12,6 +12,7 @@ import com.lzbi.common.enums.BusinessType; import com.lzbi.common.utils.DateUtils; import com.lzbi.common.utils.poi.ExcelUtil; import io.swagger.annotations.ApiOperation; +import org.aspectj.weaver.loadtime.Aj; import org.springframework.beans.factory.annotation.Autowired; import javax.servlet.http.HttpServletResponse; import javax.validation.Valid; @@ -191,5 +192,17 @@ public class DcBaseParamModelController extends BaseController return toAjax(dcBaseParamModelService.updateBatchById(dcBaseParamModelList)); } + /** + * 分页列表查询 + * @return 分页数据 + */ + @PreAuthorize("@ss.hasPermi('asset:paramModel:list')") + @GetMapping("/listNoPage") + public AjaxResult listNoPage(DcBaseParamModel dcBaseParamModel) + { + List list = dcBaseParamModelService.selectByVo(dcBaseParamModel); + return AjaxResult.success(list); + } + } 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 93a793e..73007cb 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 @@ -1,7 +1,8 @@ package com.lzbi.targetFolder.controller; -import java.util.ArrayList; -import java.util.List; +import java.util.*; +import java.util.concurrent.ConcurrentHashMap; +import java.util.stream.Collectors; import javax.servlet.http.HttpServletResponse; import com.alibaba.fastjson2.JSON; @@ -9,6 +10,7 @@ import com.alibaba.fastjson2.JSONArray; import com.alibaba.fastjson2.JSONObject; import com.lzbi.common.utils.DateUtils; import com.lzbi.targetFolder.domain.DcBaseAssetTarget; +import com.lzbi.targetFolder.domain.DcBaseAssetTargetExpand; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; @@ -184,6 +186,25 @@ public class DcBaseAssetTargetController extends BaseController return toAjax(dcBaseAssetTargetService.updateBatchById(beanList)); } - + /** + * 查询资产指标配置列表 + */ + @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); + } } diff --git a/lzbi-module/src/main/java/com/lzbi/targetFolder/domain/DcBaseAssetTargetExpand.java b/lzbi-module/src/main/java/com/lzbi/targetFolder/domain/DcBaseAssetTargetExpand.java new file mode 100644 index 0000000..ced09e9 --- /dev/null +++ b/lzbi-module/src/main/java/com/lzbi/targetFolder/domain/DcBaseAssetTargetExpand.java @@ -0,0 +1,27 @@ +package com.lzbi.targetFolder.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; + +import java.math.BigDecimal; + +/** + * 资产指标配置对象 dc_base_asset_target + * + * @author Lu.JL + * @date 2023-12-19 + */ +@Data +@Accessors(chain = true) +public class DcBaseAssetTargetExpand extends DcBaseAssetTarget +{ + private static final long serialVersionUID = 1L; + + private String modelName; + + private String modelValue; + +} diff --git a/lzbi-module/src/main/java/com/lzbi/targetFolder/mapper/DcBaseAssetTargetMapper.java b/lzbi-module/src/main/java/com/lzbi/targetFolder/mapper/DcBaseAssetTargetMapper.java index f647a4b..e1ad15a 100644 --- a/lzbi-module/src/main/java/com/lzbi/targetFolder/mapper/DcBaseAssetTargetMapper.java +++ b/lzbi-module/src/main/java/com/lzbi/targetFolder/mapper/DcBaseAssetTargetMapper.java @@ -4,6 +4,7 @@ import java.util.List; import com.lzbi.targetFolder.domain.DcBaseAssetTarget; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.lzbi.targetFolder.domain.DcBaseAssetTargetExpand; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -73,4 +74,10 @@ public interface DcBaseAssetTargetMapper extends BaseMapper * @return 结果 */ public int deleteDcBaseAssetTargetByIds(Long[] ids); + + + public List selectDcBaseAssetTargetExpandList(DcBaseAssetTargetExpand dcBaseAssetTargetExpand); + + + } diff --git a/lzbi-module/src/main/java/com/lzbi/targetFolder/service/DcBaseAssetTargetService.java b/lzbi-module/src/main/java/com/lzbi/targetFolder/service/DcBaseAssetTargetService.java index 964d2b5..dd31685 100644 --- a/lzbi-module/src/main/java/com/lzbi/targetFolder/service/DcBaseAssetTargetService.java +++ b/lzbi-module/src/main/java/com/lzbi/targetFolder/service/DcBaseAssetTargetService.java @@ -4,6 +4,7 @@ import java.util.List; import com.lzbi.common.utils.DateUtils; import com.lzbi.targetFolder.domain.DcBaseAssetTarget; +import com.lzbi.targetFolder.domain.DcBaseAssetTargetExpand; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.lzbi.targetFolder.mapper.DcBaseAssetTargetMapper; @@ -92,4 +93,16 @@ public class DcBaseAssetTargetService extends ServiceImpl selectDcBaseAssetTargetExpandList(DcBaseAssetTargetExpand dcBaseAssetTargetExpand) + { + return dcBaseAssetTargetMapper.selectDcBaseAssetTargetExpandList(dcBaseAssetTargetExpand); + } } diff --git a/lzbi-module/src/main/resources/mapper/targetFolder/DcBaseAssetTargetMapper.xml b/lzbi-module/src/main/resources/mapper/targetFolder/DcBaseAssetTargetMapper.xml index 739d9b7..ecf8a7c 100644 --- a/lzbi-module/src/main/resources/mapper/targetFolder/DcBaseAssetTargetMapper.xml +++ b/lzbi-module/src/main/resources/mapper/targetFolder/DcBaseAssetTargetMapper.xml @@ -35,6 +35,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, asset_code, asset_id, target_model_code, target_name, target_name_alias, target_code, field_code, limit_up, limit_down, value_base, flag_avg, flag_sum, flag_compute, tenant_id, revision, created_by, created_time, updated_by, updated_time, delete_by, delete_time, sort, field_name, column_type, field_unit, dept_id, user_id from dc_base_asset_target @@ -182,4 +215,77 @@ #{id} + + + \ No newline at end of file