添加配置

This commit is contained in:
hzj
2024-09-12 10:41:28 +08:00
parent 500fbbad9c
commit 2c9f941cfa
5 changed files with 24 additions and 1 deletions

View File

@@ -7,7 +7,6 @@ import com.njcn.system.pojo.dto.EpdDTO;
import com.njcn.system.pojo.param.EleEpdPqdParam; import com.njcn.system.pojo.param.EleEpdPqdParam;
import com.njcn.system.pojo.po.EleEpdPqd; import com.njcn.system.pojo.po.EleEpdPqd;
import org.springframework.cloud.openfeign.FeignClient; 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.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
@@ -58,4 +57,6 @@ public interface EpdFeignClient {
@PostMapping("/findListByShowName") @PostMapping("/findListByShowName")
HttpResult<List<EleEpdPqd>> findListByShowName(@RequestParam("name") String name); HttpResult<List<EleEpdPqd>> findListByShowName(@RequestParam("name") String name);
@PostMapping("/selectByClassId")
HttpResult<List<EleEpdPqd>> selectByClassId(@RequestParam("id") String classId);
} }

View File

@@ -106,6 +106,12 @@ public class EpdFeignClientFallbackFactory implements FallbackFactory<EpdFeignCl
log.error("{}异常,降级处理,异常为:{}","根据名称查询字典信息集合",cause.toString()); log.error("{}异常,降级处理,异常为:{}","根据名称查询字典信息集合",cause.toString());
throw new BusinessException(finalExceptionEnum); throw new BusinessException(finalExceptionEnum);
} }
@Override
public HttpResult<List<EleEpdPqd>> selectByClassId(String classId) {
log.error("{}异常,降级处理,异常为:{}","根据数据分类查询字典信息集合",cause.toString());
throw new BusinessException(finalExceptionEnum);
}
}; };
} }
} }

View File

@@ -164,6 +164,16 @@ public class EleEpdPqdController extends BaseController {
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, eleEpdPqds, methodDescribe); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, eleEpdPqds, methodDescribe);
} }
@PostMapping("/selectByClassId")
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@ApiOperation("根据数据分类查询字典数据")
public HttpResult<List<EleEpdPqd>> selectByClassId(@RequestParam("classId") @Validated String classId){
String methodDescribe = getMethodDescribe("selectByClassId");
LogUtil.njcnDebug(log, "{},根据数据分类查询字典数据:", methodDescribe);
List<EleEpdPqd> eleEpdPqds = eleEpdPqdService.selectByClassId(classId);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, eleEpdPqds, methodDescribe);
}
@PostMapping("/judgeExist") @PostMapping("/judgeExist")
@OperateInfo(info = LogEnum.BUSINESS_COMMON) @OperateInfo(info = LogEnum.BUSINESS_COMMON)
@ApiOperation("校验字典是否存在") @ApiOperation("校验字典是否存在")

View File

@@ -114,4 +114,5 @@ public interface IEleEpdPqdService extends IService<EleEpdPqd> {
*/ */
List<EpdDTO> findAll(); List<EpdDTO> findAll();
List<EleEpdPqd> selectByClassId(String classId);
} }

View File

@@ -253,6 +253,11 @@ public class EleEpdPqdServiceImpl extends ServiceImpl<EleEpdPqdMapper, EleEpdPqd
return list; return list;
} }
@Override
public List<EleEpdPqd> selectByClassId(String classId) {
return this.lambdaQuery().eq(EleEpdPqd::getClassId,classId).list();
}
/** /**
* 校验参数, * 校验参数,
* 1.检查是否存在相同名称的菜单 * 1.检查是否存在相同名称的菜单