指标库代码
This commit is contained in:
@@ -0,0 +1,74 @@
|
|||||||
|
package com.njcn.system.pojo.param;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.njcn.common.pojo.constant.PatternRegex;
|
||||||
|
import com.njcn.web.constant.ValidMessage;
|
||||||
|
import com.njcn.web.pojo.param.BaseParam;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author hongawen
|
||||||
|
* @version 1.0.0
|
||||||
|
* @date 2021年12月17日 15:49
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class DictTreeParam {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 父id
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "父id")
|
||||||
|
private String pid;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 名称
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编码
|
||||||
|
*/
|
||||||
|
@TableField(value = "编码")
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 排序
|
||||||
|
*/
|
||||||
|
@TableField(value = "sort")
|
||||||
|
private Integer sort;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 描述
|
||||||
|
*/
|
||||||
|
@TableField(value = "remark")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新操作实体
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public static class DictTreeUpdateParam extends DictTreeParam {
|
||||||
|
|
||||||
|
|
||||||
|
@ApiModelProperty("id")
|
||||||
|
@NotBlank(message = ValidMessage.ID_NOT_BLANK)
|
||||||
|
@Pattern(regexp = PatternRegex.SYSTEM_ID, message = ValidMessage.ID_FORMAT_ERROR)
|
||||||
|
private String id;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package com.njcn.system.pojo.vo;
|
||||||
|
|
||||||
|
import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description:
|
||||||
|
* Date: 2023/6/14 9:59【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class CsStatisticalSetVO {
|
||||||
|
/*选中指标*/
|
||||||
|
private List<EleEpdPqdListVO> selectedList;
|
||||||
|
/*未选中指标*/
|
||||||
|
private List<EleEpdPqdListVO> unSelectedList;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,60 @@
|
|||||||
|
package com.njcn.system.pojo.vo;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author hongawen
|
||||||
|
* @version 1.0.0
|
||||||
|
* @date 2021年12月20日 15:52
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class DictTreeVO implements Serializable {
|
||||||
|
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 父id
|
||||||
|
*/
|
||||||
|
private String pid;
|
||||||
|
/**
|
||||||
|
* 父类名称
|
||||||
|
*/
|
||||||
|
private String pname;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编码
|
||||||
|
*/
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 排序
|
||||||
|
*/
|
||||||
|
private Integer sort;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 描述
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态(字典 0正常 1停用 2删除)
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package com.njcn.system.pojo.vo;
|
||||||
|
|
||||||
|
import com.njcn.system.pojo.po.EleEpdPqd;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类的介绍:
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2023/5/24 15:30
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class EleEpdPqdListVO implements Serializable {
|
||||||
|
|
||||||
|
private String dataType;
|
||||||
|
|
||||||
|
private String dataTypeName;
|
||||||
|
|
||||||
|
private List<EleEpdPqd> eleEpdPqdVOS;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.njcn.system;
|
package com.njcn.system;
|
||||||
|
|
||||||
|
import com.github.jeffreyning.mybatisplus.conf.EnableMPP;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.mybatis.spring.annotation.MapperScan;
|
import org.mybatis.spring.annotation.MapperScan;
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
|
|||||||
@@ -0,0 +1,86 @@
|
|||||||
|
package com.njcn.system.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||||
|
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||||
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
|
import com.njcn.common.utils.HttpResultUtil;
|
||||||
|
|
||||||
|
import com.njcn.system.pojo.po.EleEpdPqd;
|
||||||
|
import com.njcn.system.pojo.vo.CsStatisticalSetVO;
|
||||||
|
|
||||||
|
import com.njcn.system.service.CsStatisticalSetPOService;
|
||||||
|
|
||||||
|
import com.njcn.web.controller.BaseController;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
|
import io.swagger.annotations.ApiImplicitParams;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import springfox.documentation.annotations.ApiIgnore;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 前端控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @since 2023-05-24
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/csstatisticalset")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Api(tags = "绑定指标")
|
||||||
|
@Validated
|
||||||
|
public class CsStatisticalSetController extends BaseController {
|
||||||
|
|
||||||
|
private final CsStatisticalSetPOService csStatisticalSetPOService;
|
||||||
|
|
||||||
|
@PostMapping("/addStatistical")
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@ApiOperation("绑定指标")
|
||||||
|
@ApiImplicitParams({
|
||||||
|
@ApiImplicitParam(name = "id", value = "统计类型id", required = true),
|
||||||
|
@ApiImplicitParam(name = "ids", value = "统计指标id集合", required = true)
|
||||||
|
})
|
||||||
|
public HttpResult<Boolean> addStatistical(@RequestParam("id")String id,@RequestParam("ids")List<String> ids){
|
||||||
|
log.info("根据模板录入字典数据");
|
||||||
|
String methodDescribe = getMethodDescribe("addstatistical");
|
||||||
|
Boolean result = csStatisticalSetPOService.saveData(id,ids);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/queryStatistical")
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@ApiOperation("根据统计类型id查询已绑定指标及未绑定数据")
|
||||||
|
public HttpResult<CsStatisticalSetVO> queryStatistical(@RequestParam("id")String id){
|
||||||
|
log.info("根据模板录入字典数据");
|
||||||
|
String methodDescribe = getMethodDescribe("querystatistical");
|
||||||
|
CsStatisticalSetVO result = csStatisticalSetPOService.queryStatistical(id);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/queryStatistical")
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@ApiOperation("根据统计类型id查询已绑定指标下拉框")
|
||||||
|
public HttpResult<List<EleEpdPqd>> queryStatisticalSelect(@RequestParam("id")String id){
|
||||||
|
log.info("根据模板录入字典数据");
|
||||||
|
String methodDescribe = getMethodDescribe("EleEpdPqd");
|
||||||
|
List<EleEpdPqd> result = csStatisticalSetPOService.queryStatisticalSelect(id);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,118 @@
|
|||||||
|
package com.njcn.system.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||||
|
import com.njcn.common.pojo.constant.OperateType;
|
||||||
|
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||||
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
|
import com.njcn.common.utils.HttpResultUtil;
|
||||||
|
import com.njcn.common.utils.LogUtil;
|
||||||
|
import com.njcn.system.pojo.param.DictDataParam;
|
||||||
|
import com.njcn.system.pojo.param.DictTreeParam;
|
||||||
|
import com.njcn.system.pojo.po.DictData;
|
||||||
|
import com.njcn.system.pojo.vo.DictDataVO;
|
||||||
|
import com.njcn.system.pojo.vo.DictTreeVO;
|
||||||
|
import com.njcn.system.service.IDictDataService;
|
||||||
|
import com.njcn.system.service.SysDicTreePOService;
|
||||||
|
import com.njcn.web.controller.BaseController;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
|
import io.swagger.annotations.ApiImplicitParams;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import springfox.documentation.annotations.ApiIgnore;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 前端控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author hongawen
|
||||||
|
* @since 2021-12-13
|
||||||
|
*/
|
||||||
|
@Validated
|
||||||
|
@Slf4j
|
||||||
|
@Api(tags = "字典树操作")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/dictTree")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class DictTreeController extends BaseController {
|
||||||
|
|
||||||
|
private final SysDicTreePOService sysDicTreePOService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询字典类型数据
|
||||||
|
*/
|
||||||
|
// @OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||||
|
// @PostMapping("/list")
|
||||||
|
// @ApiOperation("查询字典数据")
|
||||||
|
// @ApiImplicitParam(name = "queryParam", value = "查询参数", required = true)
|
||||||
|
// public HttpResult<Page<DictDataVO>> list(@RequestBody @Validated DictDataParam.DictDataQueryParam queryParam) {
|
||||||
|
// String methodDescribe = getMethodDescribe("list");
|
||||||
|
// LogUtil.njcnDebug(log, "{},查询数据为:{}", methodDescribe, queryParam);
|
||||||
|
// Page<DictDataVO> result = dictDataService.listDictData(queryParam);
|
||||||
|
// return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.ADD)
|
||||||
|
@PostMapping("/add")
|
||||||
|
@ApiOperation("新增字典树数据")
|
||||||
|
@ApiImplicitParam(name = "dictTreeParam", value = "字典数据", required = true)
|
||||||
|
public HttpResult<Object> add(@RequestBody @Validated DictTreeParam dictTreeParam) {
|
||||||
|
String methodDescribe = getMethodDescribe("add");
|
||||||
|
LogUtil.njcnDebug(log, "{},字典数据为:{}", methodDescribe, dictTreeParam);
|
||||||
|
boolean result = sysDicTreePOService.addDictTree(dictTreeParam);
|
||||||
|
if (result) {
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
} else {
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.QUERY)
|
||||||
|
@PostMapping("/query")
|
||||||
|
@ApiOperation("根据pid查询字典树")
|
||||||
|
public HttpResult<List<DictTreeVO>> query(@RequestParam("pid") String pid) {
|
||||||
|
String methodDescribe = getMethodDescribe("query");
|
||||||
|
LogUtil.njcnDebug(log, "{},字典数据为:{}", methodDescribe, pid);
|
||||||
|
List<DictTreeVO> result = sysDicTreePOService.queryByPid(pid);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.QUERY)
|
||||||
|
@PostMapping("/queryByCode")
|
||||||
|
@ApiOperation("根据Code查询字典树")
|
||||||
|
public HttpResult<DictTreeVO> queryByCode(@RequestParam("code") String code) {
|
||||||
|
String methodDescribe = getMethodDescribe("queryByCode");
|
||||||
|
LogUtil.njcnDebug(log, "{},字典数据为:{}", methodDescribe, code);
|
||||||
|
DictTreeVO result = sysDicTreePOService.queryByCode(code);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
|
||||||
|
}
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.QUERY)
|
||||||
|
@PostMapping("/queryByid")
|
||||||
|
@ApiOperation("根据id查询字典树最底层")
|
||||||
|
public HttpResult<List<DictTreeVO>> queryByid(@RequestParam("id") String id) {
|
||||||
|
String methodDescribe = getMethodDescribe("queryByid");
|
||||||
|
LogUtil.njcnDebug(log, "{},字典数据为:{}", methodDescribe, id);
|
||||||
|
List<DictTreeVO> result = sysDicTreePOService.queryByid(id);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@@ -10,6 +10,7 @@ import com.njcn.common.utils.HttpResultUtil;
|
|||||||
import com.njcn.common.utils.LogUtil;
|
import com.njcn.common.utils.LogUtil;
|
||||||
import com.njcn.system.pojo.param.EleEpdPqdParam;
|
import com.njcn.system.pojo.param.EleEpdPqdParam;
|
||||||
import com.njcn.system.pojo.po.EleEpdPqd;
|
import com.njcn.system.pojo.po.EleEpdPqd;
|
||||||
|
import com.njcn.system.pojo.vo.EleEpdPqdListVO;
|
||||||
import com.njcn.system.pojo.vo.EleEpdPqdVO;
|
import com.njcn.system.pojo.vo.EleEpdPqdVO;
|
||||||
import com.njcn.system.service.IEleEpdPqdService;
|
import com.njcn.system.service.IEleEpdPqdService;
|
||||||
import com.njcn.web.controller.BaseController;
|
import com.njcn.web.controller.BaseController;
|
||||||
@@ -138,6 +139,17 @@ public class EleEpdPqdController extends BaseController {
|
|||||||
EleEpdPqd eleEpdPqd = eleEpdPqdService.selectById(id);
|
EleEpdPqd eleEpdPqd = eleEpdPqdService.selectById(id);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, eleEpdPqd, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, eleEpdPqd, methodDescribe);
|
||||||
}
|
}
|
||||||
|
/*查询指标库,按datatype分类*/
|
||||||
|
@PostMapping("/selectAll")
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@ApiOperation("查询指标库,按datatype分类")
|
||||||
|
public HttpResult<List<EleEpdPqdListVO>> selectAll(){
|
||||||
|
log.info("查询指标库,按datatype分类");
|
||||||
|
String methodDescribe = getMethodDescribe("selectAll");
|
||||||
|
LogUtil.njcnDebug(log, "{},查询指标库,按datatype分类:", methodDescribe);
|
||||||
|
List<EleEpdPqdListVO> eleEpdPqds = eleEpdPqdService.selectAll();
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, eleEpdPqds, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
package com.njcn.system.service;
|
package com.njcn.system.service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.njcn.system.pojo.param.EleEpdPqdParam;
|
import com.njcn.system.pojo.param.EleEpdPqdParam;
|
||||||
import com.njcn.system.pojo.po.EleEpdPqd;
|
import com.njcn.system.pojo.po.EleEpdPqd;
|
||||||
|
import com.njcn.system.pojo.vo.EleEpdPqdListVO;
|
||||||
import com.njcn.system.pojo.vo.EleEpdPqdVO;
|
import com.njcn.system.pojo.vo.EleEpdPqdVO;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -16,7 +18,7 @@ import java.util.Map;
|
|||||||
* @author xuyang
|
* @author xuyang
|
||||||
* @since 2023-05-24
|
* @since 2023-05-24
|
||||||
*/
|
*/
|
||||||
public interface IEleEpdPqdService {
|
public interface IEleEpdPqdService extends IService<EleEpdPqd> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 存储模板的字典数据
|
* 存储模板的字典数据
|
||||||
@@ -66,4 +68,12 @@ public interface IEleEpdPqdService {
|
|||||||
* @param id
|
* @param id
|
||||||
*/
|
*/
|
||||||
EleEpdPqd selectById(String id);
|
EleEpdPqd selectById(String id);
|
||||||
|
/**
|
||||||
|
* @Description: 查询指标库,按datatype分类
|
||||||
|
* @Param:
|
||||||
|
* @return: java.util.List<com.njcn.system.pojo.vo.EleEpdPqdListVO>
|
||||||
|
* @Author: clam
|
||||||
|
* @Date: 2023/6/12
|
||||||
|
*/
|
||||||
|
List<EleEpdPqdListVO> selectAll();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,14 +11,19 @@ import com.njcn.db.constant.DbConstant;
|
|||||||
import com.njcn.system.enums.SystemResponseEnum;
|
import com.njcn.system.enums.SystemResponseEnum;
|
||||||
import com.njcn.system.mapper.EleEpdPqdMapper;
|
import com.njcn.system.mapper.EleEpdPqdMapper;
|
||||||
import com.njcn.system.pojo.param.EleEpdPqdParam;
|
import com.njcn.system.pojo.param.EleEpdPqdParam;
|
||||||
|
import com.njcn.system.pojo.po.DictData;
|
||||||
import com.njcn.system.pojo.po.EleEpdPqd;
|
import com.njcn.system.pojo.po.EleEpdPqd;
|
||||||
|
import com.njcn.system.pojo.vo.EleEpdPqdListVO;
|
||||||
import com.njcn.system.pojo.vo.EleEpdPqdVO;
|
import com.njcn.system.pojo.vo.EleEpdPqdVO;
|
||||||
|
import com.njcn.system.service.IDictDataService;
|
||||||
import com.njcn.system.service.IEleEpdPqdService;
|
import com.njcn.system.service.IEleEpdPqdService;
|
||||||
import com.njcn.web.factory.PageFactory;
|
import com.njcn.web.factory.PageFactory;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -33,8 +38,11 @@ import java.util.stream.Collectors;
|
|||||||
* @since 2023-05-24
|
* @since 2023-05-24
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
public class EleEpdPqdServiceImpl extends ServiceImpl<EleEpdPqdMapper, EleEpdPqd> implements IEleEpdPqdService {
|
public class EleEpdPqdServiceImpl extends ServiceImpl<EleEpdPqdMapper, EleEpdPqd> implements IEleEpdPqdService {
|
||||||
|
|
||||||
|
private final IDictDataService idictDataService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void saveData(List<EleEpdPqdParam> eleEpdPqdParam) {
|
public void saveData(List<EleEpdPqdParam> eleEpdPqdParam) {
|
||||||
List<EleEpdPqd> list = eleEpdPqdParam.stream().map(item->{
|
List<EleEpdPqd> list = eleEpdPqdParam.stream().map(item->{
|
||||||
@@ -132,6 +140,26 @@ public class EleEpdPqdServiceImpl extends ServiceImpl<EleEpdPqdMapper, EleEpdPqd
|
|||||||
return this.lambdaQuery().eq(EleEpdPqd::getId,id).one();
|
return this.lambdaQuery().eq(EleEpdPqd::getId,id).one();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<EleEpdPqdListVO> selectAll() {
|
||||||
|
|
||||||
|
List<EleEpdPqdListVO> vos = new ArrayList<>();
|
||||||
|
|
||||||
|
this.getBaseMapper().selectList(null);
|
||||||
|
List<EleEpdPqd> eleEpdPqds = this.baseMapper.selectList(null);
|
||||||
|
Map<String, List<EleEpdPqd>> collect = eleEpdPqds.stream().collect(Collectors.groupingBy(EleEpdPqd::getDataType));
|
||||||
|
collect.forEach((k,v)->{
|
||||||
|
EleEpdPqdListVO vo = new EleEpdPqdListVO();
|
||||||
|
vo.setDataType(k);
|
||||||
|
vo.setEleEpdPqdVOS(v);
|
||||||
|
DictData dicDataById = idictDataService.getDicDataById(vo.getDataType());
|
||||||
|
vo.setDataTypeName(dicDataById.getName());
|
||||||
|
vos.add(vo);
|
||||||
|
});
|
||||||
|
|
||||||
|
return vos;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验参数,
|
* 校验参数,
|
||||||
* 1.检查是否存在相同名称的菜单
|
* 1.检查是否存在相同名称的菜单
|
||||||
|
|||||||
Reference in New Issue
Block a user