报告模板配置
This commit is contained in:
@@ -7,7 +7,7 @@ import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class DictDTO implements Serializable {
|
||||
public class EventReportDictDTO implements Serializable {
|
||||
|
||||
@ApiModelProperty("组件Id")
|
||||
private String id;
|
||||
@@ -28,5 +28,5 @@ public class DictDTO implements Serializable {
|
||||
private Integer sort;
|
||||
|
||||
@ApiModelProperty("子级")
|
||||
List<DictDTO> children;
|
||||
List<EventReportDictDTO> children;
|
||||
}
|
||||
@@ -7,7 +7,7 @@ import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class DictVO implements Serializable {
|
||||
public class EventReportDictVO implements Serializable {
|
||||
|
||||
@ApiModelProperty("Id")
|
||||
private String id;
|
||||
@@ -28,6 +28,6 @@ public class DictVO implements Serializable {
|
||||
private Integer sort;
|
||||
|
||||
@ApiModelProperty("子级")
|
||||
List<DictVO> children;
|
||||
List<EventReportDictVO> children;
|
||||
|
||||
}
|
||||
@@ -10,7 +10,7 @@ import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.common.utils.LogUtil;
|
||||
import com.njcn.system.pojo.param.EventDictParam;
|
||||
import com.njcn.system.pojo.po.ReportDict;
|
||||
import com.njcn.system.pojo.vo.DictVO;
|
||||
import com.njcn.system.pojo.vo.EventReportDictVO;
|
||||
import com.njcn.system.service.IEventDictService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
@@ -133,9 +133,9 @@ public class EventDictController extends BaseController {
|
||||
@OperateInfo
|
||||
@GetMapping("/DictTree")
|
||||
@ApiOperation("字典树")
|
||||
public HttpResult<List<DictVO>> getDictTree(){
|
||||
public HttpResult<List<EventReportDictVO>> getDictTree(){
|
||||
String methodDescribe = getMethodDescribe("getDictTree");
|
||||
List<DictVO> list = iEventDictService.getDictTree();
|
||||
List<EventReportDictVO> list = iEventDictService.getDictTree();
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,list,methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package com.njcn.system.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.system.pojo.dto.DictDTO;
|
||||
import com.njcn.system.pojo.dto.EventReportDictDTO;
|
||||
import com.njcn.system.pojo.po.ReportDict;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface EventDictMapper extends BaseMapper<ReportDict> {
|
||||
|
||||
List<DictDTO> getAllDict();
|
||||
List<EventReportDictDTO> getAllDict();
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.system.mapper.EventDictMapper">
|
||||
|
||||
<select id="getAllDict" resultType="DictDTO">
|
||||
<select id="getAllDict" resultType="EventReportDictDTO">
|
||||
SELECT * from report_dict WHERE State = 1
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.njcn.system.service;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.system.pojo.param.EventDictParam;
|
||||
import com.njcn.system.pojo.po.ReportDict;
|
||||
import com.njcn.system.pojo.vo.DictVO;
|
||||
import com.njcn.system.pojo.vo.EventReportDictVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -51,5 +51,5 @@ public interface IEventDictService {
|
||||
* 获取字典树
|
||||
* @return
|
||||
*/
|
||||
List<DictVO> getDictTree();
|
||||
List<EventReportDictVO> getDictTree();
|
||||
}
|
||||
|
||||
@@ -14,10 +14,10 @@ import com.njcn.db.constant.DbConstant;
|
||||
import com.njcn.system.enums.EventResponseEnum;
|
||||
import com.njcn.system.enums.TemplateTreeEnum;
|
||||
import com.njcn.system.mapper.EventDictMapper;
|
||||
import com.njcn.system.pojo.dto.DictDTO;
|
||||
import com.njcn.system.pojo.dto.EventReportDictDTO;
|
||||
import com.njcn.system.pojo.param.EventDictParam;
|
||||
import com.njcn.system.pojo.po.ReportDict;
|
||||
import com.njcn.system.pojo.vo.DictVO;
|
||||
import com.njcn.system.pojo.vo.EventReportDictVO;
|
||||
import com.njcn.system.service.IEventDictService;
|
||||
import com.njcn.web.factory.PageFactory;
|
||||
import lombok.AllArgsConstructor;
|
||||
@@ -25,7 +25,6 @@ import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -74,6 +73,7 @@ public class EventDictServiceImpl extends ServiceImpl<EventDictMapper, ReportDic
|
||||
checkName(dictUpdateParam,true);
|
||||
ReportDict rptDict = new ReportDict();
|
||||
BeanUtils.copyProperties(dictUpdateParam,rptDict);
|
||||
rptDict.setPid(rptDict.getPids());
|
||||
return this.updateById(rptDict);
|
||||
}
|
||||
|
||||
@@ -139,11 +139,11 @@ public class EventDictServiceImpl extends ServiceImpl<EventDictMapper, ReportDic
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<DictVO> getDictTree() {
|
||||
List<DictVO> list = new ArrayList<>();
|
||||
List<DictDTO> dictList = eventDictMapper.getAllDict();
|
||||
public List<EventReportDictVO> getDictTree() {
|
||||
List<EventReportDictVO> list = new ArrayList<>();
|
||||
List<EventReportDictDTO> dictList = eventDictMapper.getAllDict();
|
||||
dictList.forEach(item -> {
|
||||
DictVO dictVO = new DictVO();
|
||||
EventReportDictVO dictVO = new EventReportDictVO();
|
||||
BeanUtil.copyProperties(item, dictVO);
|
||||
list.add(dictVO);
|
||||
});
|
||||
@@ -156,7 +156,7 @@ public class EventDictServiceImpl extends ServiceImpl<EventDictMapper, ReportDic
|
||||
/**
|
||||
* 递归组装字典表
|
||||
*/
|
||||
private List<DictVO> getChildList(DictVO dictMenu, List<DictVO> categories) {
|
||||
private List<EventReportDictVO> getChildList(EventReportDictVO dictMenu, List<EventReportDictVO> categories) {
|
||||
return categories.stream().filter(o -> Objects.equals(o.getPid(), dictMenu.getId()))
|
||||
.peek(o -> o.setChildren(getChildList(o, categories)))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
Reference in New Issue
Block a user