pv终端台账
This commit is contained in:
@@ -4,6 +4,7 @@ import com.njcn.common.pojo.constant.ServerInfo;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
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 org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@@ -53,4 +54,10 @@ public interface DeptFeignClient {
|
||||
@GetMapping("/allDeptList")
|
||||
HttpResult<List<PvTerminalTreeVO>> allDeptList();
|
||||
|
||||
/**
|
||||
* 获取所有部门
|
||||
*/
|
||||
@GetMapping("/getDeptById")
|
||||
HttpResult<Dept> getDeptById(@RequestParam("deptId") String deptId);
|
||||
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.user.api.DeptFeignClient;
|
||||
import com.njcn.user.pojo.dto.DeptDTO;
|
||||
import com.njcn.user.pojo.po.Dept;
|
||||
import com.njcn.user.pojo.vo.PvTerminalTreeVO;
|
||||
import com.njcn.user.utils.UserEnumUtil;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
@@ -62,6 +63,12 @@ public class DeptFeignClientFallbackFactory implements FallbackFactory<DeptFeign
|
||||
log.error("{}异常,降级处理,异常为:{}","查询所有部门异常",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<Dept> getDeptById(String deptId) {
|
||||
log.error("{}异常,降级处理,异常为:{}","查询所部门异常",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ import com.njcn.common.utils.LogUtil;
|
||||
import com.njcn.system.pojo.dto.AreaTreeDTO;
|
||||
import com.njcn.user.pojo.dto.DeptDTO;
|
||||
import com.njcn.user.pojo.param.DeptParam;
|
||||
import com.njcn.user.pojo.po.Dept;
|
||||
import com.njcn.user.pojo.vo.DeptAllTreeVO;
|
||||
import com.njcn.user.pojo.vo.DeptTreeVO;
|
||||
import com.njcn.user.pojo.vo.DeptVO;
|
||||
@@ -269,5 +270,20 @@ public class DeptController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据部门获取部门信息
|
||||
* @author cdf
|
||||
* @date 2022/7/12
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@GetMapping("/getDeptById")
|
||||
@ApiOperation("获取所有单位")
|
||||
public HttpResult<Dept> getDeptById(@RequestParam("deptId")String deptId) {
|
||||
String methodDescribe = getMethodDescribe("getDeptById");
|
||||
Dept result = deptService.getDeptById(deptId);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -138,4 +138,13 @@ public interface IDeptService extends IService<Dept> {
|
||||
* @date 2022/7/12
|
||||
*/
|
||||
List<PvTerminalTreeVO> allDeptList();
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 根据部门id获取部门详情
|
||||
* @author cdf
|
||||
* @date 2022/7/13
|
||||
*/
|
||||
Dept getDeptById(String id);
|
||||
}
|
||||
|
||||
@@ -256,6 +256,13 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements ID
|
||||
return this.baseMapper.allDeptList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dept getDeptById(String id){
|
||||
return this.baseMapper.selectById(id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 校验参数,检查是否存在相同编码的部门
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user