添加部门接口

This commit is contained in:
2023-01-06 15:14:09 +08:00
parent f2851d2a97
commit d778e16165
7 changed files with 51 additions and 1138 deletions

View File

@@ -11,8 +11,6 @@ import com.njcn.prepare.harmonic.pojo.param.LineParam;
*/ */
public interface NormalLimitService extends IService<MpSurplusAbnormalD> { public interface NormalLimitService extends IService<MpSurplusAbnormalD> {
Boolean getNormLimitData(LineParam lineParam);
Boolean AbnormalLineData(LineParam lineParam); Boolean AbnormalLineData(LineParam lineParam);

View File

@@ -97,4 +97,10 @@ public interface DeptFeignClient {
*/ */
@GetMapping("/getSpecialDeptList") @GetMapping("/getSpecialDeptList")
HttpResult<List<Dept>> getSpecialDeptList(); HttpResult<List<Dept>> getSpecialDeptList();
/**
* 获取根部门
*/
@GetMapping("/getRootDept")
HttpResult<Dept> getRootDept();
} }

View File

@@ -105,6 +105,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<Dept> getRootDept() {
log.error("{}异常,降级处理,异常为:{}","查询根部门异常",cause.toString());
throw new BusinessException(finalExceptionEnum);
}
}; };
} }
} }

View File

@@ -375,6 +375,25 @@ public class DeptController extends BaseController {
} }
/**
* 获取最高级部门
* @author cdf
* @date 2023/1/6
*/
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
@GetMapping("/getRootDept")
@ApiOperation("获取根部门")
public HttpResult<Dept> getRootDept(){
String methodDescribe = getMethodDescribe("getRootDept");
Dept dept = deptService.getRootDept();
if(Objects.nonNull(dept)){
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, dept, methodDescribe);
}else {
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
}
}
} }

View File

@@ -193,4 +193,11 @@ public interface IDeptService extends IService<Dept> {
* @date 2022/12/8 * @date 2022/12/8
*/ */
List<Dept> getSpecialDeptList(); List<Dept> getSpecialDeptList();
/**
* 获取根部门
* @author cdf
* @date 2023/1/6
*/
Dept getRootDept();
} }

View File

@@ -364,4 +364,11 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements ID
lambdaQueryWrapper.eq(Dept::getSpecialType,1).eq(Dept::getState, DataStateEnum.ENABLE.getCode()); lambdaQueryWrapper.eq(Dept::getSpecialType,1).eq(Dept::getState, DataStateEnum.ENABLE.getCode());
return this.list(lambdaQueryWrapper); return this.list(lambdaQueryWrapper);
} }
@Override
public Dept getRootDept(){
LambdaQueryWrapper<Dept> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(Dept::getState,DataStateEnum.ENABLE.getCode()).eq(Dept::getPid,0);
return this.getOne(lambdaQueryWrapper);
}
} }