算法提交

This commit is contained in:
2023-12-11 17:03:22 +08:00
parent ec9d9bca64
commit e1f697f180
11 changed files with 222 additions and 34 deletions

View File

@@ -1,14 +1,21 @@
package com.njcn.user.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.user.api.fallback.DeptFeignClientFallbackFactory;
import com.njcn.user.pojo.dto.DeptDTO;
import com.njcn.user.pojo.po.Dept;
import com.njcn.user.pojo.vo.PvTerminalTreeVO;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
@@ -133,4 +140,20 @@ public interface DeptFeignClient {
*/
@GetMapping("/getUpByDeptIds")
HttpResult<List<String>> getUpByDeptIds(@RequestParam("deptId") String deptId);
/**
* 根据单位集合查询对应部门
* @param list code集合
* @return
*/
@PostMapping("/getDeptByCodeList")
HttpResult<List<Dept>> getDeptByCodeList(@RequestBody List<String> list);
/**
* 获取所有的部门集合
* @author xy
* @date 2023/12/11
*/
@GetMapping("/getAllDept")
HttpResult<List<Dept>> getAllDept();
}

View File

@@ -128,6 +128,18 @@ public class DeptFeignClientFallbackFactory implements FallbackFactory<DeptFeign
log.error("{}异常,降级处理,异常为:{}","根据部门id查询当前部门所有父级部门id",cause.toString());
throw new BusinessException(finalExceptionEnum);
}
@Override
public HttpResult<List<Dept>> getDeptByCodeList(List<String> list) {
log.error("{}异常,降级处理,异常为:{}","根据单位code集合查询对应部门:",cause.toString());
throw new BusinessException(finalExceptionEnum);
}
@Override
public HttpResult<List<Dept>> getAllDept() {
log.error("{}异常,降级处理,异常为:{}","获取所有单位:",cause.toString());
throw new BusinessException(finalExceptionEnum);
}
};
}
}