1.新增字典功能
2.RocketMQ新增治理消息模板
This commit is contained in:
@@ -1,20 +1,12 @@
|
||||
package com.njcn.system.api;
|
||||
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.constant.ServerInfo;
|
||||
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.api.fallback.EpdFeignClientFallbackFactory;
|
||||
import com.njcn.system.pojo.dto.EpdDTO;
|
||||
import com.njcn.system.pojo.param.EleEpdPqdParam;
|
||||
import com.njcn.system.pojo.po.EleEpdPqd;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
@@ -53,4 +45,7 @@ public interface EpdFeignClient {
|
||||
|
||||
@PostMapping("/findByParam")
|
||||
HttpResult<EleEpdPqd> findByParam(@RequestParam("name") String name, @RequestParam("dataType") String dataType, @RequestParam("phase") String phase);
|
||||
|
||||
@PostMapping("/findAll")
|
||||
HttpResult<List<EpdDTO>> findAll();
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.system.api.EpdFeignClient;
|
||||
import com.njcn.system.pojo.dto.EpdDTO;
|
||||
import com.njcn.system.pojo.param.EleEpdPqdParam;
|
||||
import com.njcn.system.pojo.po.EleEpdPqd;
|
||||
import com.njcn.system.utils.SystemEnumUtil;
|
||||
@@ -81,6 +82,12 @@ public class EpdFeignClientFallbackFactory implements FallbackFactory<EpdFeignCl
|
||||
log.error("{}异常,降级处理,异常为:{}","根据条件查询字典数据",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<List<EpdDTO>> findAll() {
|
||||
log.error("{}异常,降级处理,异常为:{}","查询所有字典数据",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.njcn.system.pojo.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 类的介绍:
|
||||
*
|
||||
* @author xuyang
|
||||
* @version 1.0.0
|
||||
* @createTime 2023/8/14 20:28
|
||||
*/
|
||||
@Data
|
||||
public class EpdDTO {
|
||||
|
||||
@ApiModelProperty("指标名称")
|
||||
private String dictName;
|
||||
|
||||
@ApiModelProperty("inflxuDB表名")
|
||||
private String tableName;
|
||||
|
||||
}
|
||||
@@ -8,6 +8,7 @@ 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.dto.EpdDTO;
|
||||
import com.njcn.system.pojo.param.EleEpdPqdParam;
|
||||
import com.njcn.system.pojo.po.EleEpdPqd;
|
||||
import com.njcn.system.pojo.vo.EleEpdPqdListVO;
|
||||
@@ -192,5 +193,15 @@ public class EleEpdPqdController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, eleEpdPqd, methodDescribe);
|
||||
}
|
||||
|
||||
@PostMapping("/findAll")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("查询所有字典数据")
|
||||
@ApiIgnore
|
||||
public HttpResult<List<EpdDTO>> findAll(){
|
||||
String methodDescribe = getMethodDescribe("findAll");
|
||||
List<EpdDTO> list = eleEpdPqdService.findAll();
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -3,10 +3,13 @@ package com.njcn.system.mapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.system.pojo.dto.EpdDTO;
|
||||
import com.njcn.system.pojo.po.EleEpdPqd;
|
||||
import com.njcn.system.pojo.vo.EleEpdPqdVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
@@ -19,4 +22,6 @@ public interface EleEpdPqdMapper extends BaseMapper<EleEpdPqd> {
|
||||
|
||||
Page<EleEpdPqdVO> page(@Param("page")Page<EleEpdPqdVO> page, @Param("ew") QueryWrapper<EleEpdPqdVO> queryWrapper);
|
||||
|
||||
List<EpdDTO> findAll();
|
||||
|
||||
}
|
||||
|
||||
@@ -44,4 +44,15 @@
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="findAll" resultType="EpdDTO">
|
||||
select
|
||||
t0.Name dictName,
|
||||
t1.Name tableName
|
||||
from
|
||||
ele_epd_pqd t0
|
||||
left join sys_dict_data t1 on
|
||||
t0.Class_Id = t1.Id
|
||||
where t0.status = 1
|
||||
group by t0.Name,t1.Name
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.njcn.system.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.system.pojo.dto.EpdDTO;
|
||||
import com.njcn.system.pojo.param.EleEpdPqdParam;
|
||||
import com.njcn.system.pojo.po.EleEpdPqd;
|
||||
import com.njcn.system.pojo.vo.EleEpdPqdListVO;
|
||||
@@ -103,4 +104,10 @@ public interface IEleEpdPqdService extends IService<EleEpdPqd> {
|
||||
*/
|
||||
EleEpdPqd findByParam(String name, String dataType, String phase);
|
||||
|
||||
/**
|
||||
* 查询指标和influxDB表关系
|
||||
* @return
|
||||
*/
|
||||
List<EpdDTO> findAll();
|
||||
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.db.constant.DbConstant;
|
||||
import com.njcn.system.enums.SystemResponseEnum;
|
||||
import com.njcn.system.mapper.EleEpdPqdMapper;
|
||||
import com.njcn.system.pojo.dto.EpdDTO;
|
||||
import com.njcn.system.pojo.param.EleEpdPqdParam;
|
||||
import com.njcn.system.pojo.po.DictData;
|
||||
import com.njcn.system.pojo.po.EleEpdPqd;
|
||||
@@ -206,6 +207,11 @@ public class EleEpdPqdServiceImpl extends ServiceImpl<EleEpdPqdMapper, EleEpdPqd
|
||||
return this.baseMapper.selectOne(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EpdDTO> findAll() {
|
||||
return this.baseMapper.findAll();
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验参数,
|
||||
* 1.检查是否存在相同名称的菜单
|
||||
|
||||
Reference in New Issue
Block a user