部门代码调整 新增部门查询子部门接口
This commit is contained in:
@@ -25,6 +25,7 @@ import com.njcn.energy.pojo.param.GroupArrParam;
|
|||||||
import com.njcn.energy.pojo.po.*;
|
import com.njcn.energy.pojo.po.*;
|
||||||
import com.njcn.energy.pojo.vo.*;
|
import com.njcn.energy.pojo.vo.*;
|
||||||
import com.njcn.energy.service.*;
|
import com.njcn.energy.service.*;
|
||||||
|
import com.njcn.influxdb.param.InfluxDBPublicParam;
|
||||||
import com.njcn.influxdb.utils.InfluxDbUtils;
|
import com.njcn.influxdb.utils.InfluxDbUtils;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.influxdb.dto.QueryResult;
|
import org.influxdb.dto.QueryResult;
|
||||||
@@ -416,7 +417,7 @@ public class LogicDeviceLineServiceImpl extends ServiceImpl<LogicDeviceLineMappe
|
|||||||
stringBuilderMax.append(listData.get(j).getName()).append(", ");
|
stringBuilderMax.append(listData.get(j).getName()).append(", ");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stringBuilderMax.append("from ").append(tableName + "_Real").append(" where").append(" LineId='" + lineId + "'").append(" order by time");
|
stringBuilderMax.append("from ").append(tableName + "_Real").append(" where").append(" LineId='" + lineId + "'").append(" order by time").append(InfluxDBPublicParam.TIME_ZONE);
|
||||||
List<Map<String, Object>> list = influxDbUtils.getResult(stringBuilderMax.toString(), "");
|
List<Map<String, Object>> list = influxDbUtils.getResult(stringBuilderMax.toString(), "");
|
||||||
if (CollectionUtil.isNotEmpty(list)) {
|
if (CollectionUtil.isNotEmpty(list)) {
|
||||||
for(int i=0;i<list.size();i++){
|
for(int i=0;i<list.size();i++){
|
||||||
|
|||||||
@@ -50,6 +50,10 @@ public class DictDataParam {
|
|||||||
private Integer algoDescribe;
|
private Integer algoDescribe;
|
||||||
|
|
||||||
|
|
||||||
|
@ApiModelProperty("字典值")
|
||||||
|
private String value;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新操作实体
|
* 更新操作实体
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -53,6 +53,8 @@ public class DictData extends BaseEntity {
|
|||||||
*/
|
*/
|
||||||
private Integer algoDescribe;
|
private Integer algoDescribe;
|
||||||
|
|
||||||
|
private String value;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 状态:0-删除 1-正常
|
* 状态:0-删除 1-正常
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -50,6 +50,11 @@ public class DictDataVO implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private Integer algoDescribe;
|
private Integer algoDescribe;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 字典值
|
||||||
|
*/
|
||||||
|
private String value;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 状态:0-删除 1-正常
|
* 状态:0-删除 1-正常
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -86,4 +86,10 @@ public interface DeptFeignClient {
|
|||||||
@GetMapping("/getDepSonIdByDeptId")
|
@GetMapping("/getDepSonIdByDeptId")
|
||||||
HttpResult<List<String>> getDepSonIdByDeptId(@RequestParam("deptId") String deptId);
|
HttpResult<List<String>> getDepSonIdByDeptId(@RequestParam("deptId") String deptId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据部门id获取直接子部门及自身
|
||||||
|
*/
|
||||||
|
@GetMapping("/getDirectSonSelf")
|
||||||
|
HttpResult<List<Dept>> getDirectSonSelf(@RequestParam("deptId") String deptId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -93,6 +93,12 @@ public class DeptFeignClientFallbackFactory implements FallbackFactory<DeptFeign
|
|||||||
log.error("{}异常,降级处理,异常为:{}","查询所有子孙部门异常",cause.toString());
|
log.error("{}异常,降级处理,异常为:{}","查询所有子孙部门异常",cause.toString());
|
||||||
throw new BusinessException(finalExceptionEnum);
|
throw new BusinessException(finalExceptionEnum);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<List<Dept>> getDirectSonSelf(String deptId) {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}","查询所有子部门以及自身异常",cause.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -291,7 +291,7 @@ public class DeptController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||||
@GetMapping("/getDeptByCode")
|
@GetMapping("/getDeptByCode")
|
||||||
@ApiOperation("根据部门Id获取部门信息")
|
@ApiOperation("根据部门code获取部门信息")
|
||||||
public HttpResult<Dept> getDeptByCode(@RequestParam("deptCode")String deptCode) {
|
public HttpResult<Dept> getDeptByCode(@RequestParam("deptCode")String deptCode) {
|
||||||
String methodDescribe = getMethodDescribe("getDeptByCode");
|
String methodDescribe = getMethodDescribe("getDeptByCode");
|
||||||
Dept result = deptService.getDeptByCode(deptCode);
|
Dept result = deptService.getDeptByCode(deptCode);
|
||||||
@@ -342,5 +342,24 @@ public class DeptController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据部门id获取直接子部门及自身
|
||||||
|
* @param deptId 部门编号
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/12/1
|
||||||
|
*/
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||||
|
@GetMapping("/getDirectSonSelf")
|
||||||
|
@ApiOperation("根据部门id获取直接子部门及自身")
|
||||||
|
public HttpResult<List<Dept>> getDirectSonSelf(@RequestParam("deptId")String deptId){
|
||||||
|
String methodDescribe = getMethodDescribe("getDirectSonSelf");
|
||||||
|
List<Dept> deptList = deptService.getDirectSonSelf(deptId);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, deptList, methodDescribe);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.njcn.user.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.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
import com.njcn.system.pojo.dto.AreaTreeDTO;
|
import com.njcn.system.pojo.dto.AreaTreeDTO;
|
||||||
import com.njcn.user.pojo.dto.DeptDTO;
|
import com.njcn.user.pojo.dto.DeptDTO;
|
||||||
import com.njcn.user.pojo.param.DeptParam;
|
import com.njcn.user.pojo.param.DeptParam;
|
||||||
@@ -10,6 +11,7 @@ import com.njcn.user.pojo.vo.DeptAllTreeVO;
|
|||||||
import com.njcn.user.pojo.vo.DeptTreeVO;
|
import com.njcn.user.pojo.vo.DeptTreeVO;
|
||||||
import com.njcn.user.pojo.vo.DeptVO;
|
import com.njcn.user.pojo.vo.DeptVO;
|
||||||
import com.njcn.user.pojo.vo.PvTerminalTreeVO;
|
import com.njcn.user.pojo.vo.PvTerminalTreeVO;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -176,4 +178,12 @@ public interface IDeptService extends IService<Dept> {
|
|||||||
* @date 2022/7/13
|
* @date 2022/7/13
|
||||||
*/
|
*/
|
||||||
List<String> getDepSonIdByDeptId(String id);
|
List<String> getDepSonIdByDeptId(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据部门deptId获取直接子部门及自身
|
||||||
|
* @param deptId 部门编号
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/12/1
|
||||||
|
*/
|
||||||
|
List<Dept> getDirectSonSelf(String deptId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -349,4 +349,12 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements ID
|
|||||||
}
|
}
|
||||||
return sonId;
|
return sonId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Dept> getDirectSonSelf(String deptId) {
|
||||||
|
LambdaQueryWrapper<Dept> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
lambdaQueryWrapper.eq(Dept::getPid,deptId).eq(Dept::getState, DataStateEnum.ENABLE.getCode()).
|
||||||
|
or().eq(Dept::getId,deptId);
|
||||||
|
return this.list(lambdaQueryWrapper);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user