代码提交

This commit is contained in:
2023-06-06 16:43:40 +08:00
parent 2f4d0be940
commit d4372dca40
6 changed files with 33 additions and 1 deletions

View File

@@ -6,6 +6,7 @@ import com.njcn.system.api.fallback.EpdFeignClientFallbackFactory;
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;
@@ -30,4 +31,7 @@ public interface EpdFeignClient {
@PostMapping("/addEvt") @PostMapping("/addEvt")
HttpResult<Map<String,String>> addEvt(@RequestBody List<EleEpdPqdParam> eleEpdPqdParam); HttpResult<Map<String,String>> addEvt(@RequestBody List<EleEpdPqdParam> eleEpdPqdParam);
@PostMapping("/selectById")
HttpResult<EleEpdPqd> selectById(@RequestParam("id") String id);
} }

View File

@@ -51,6 +51,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<EleEpdPqd> selectById(String id) {
log.error("{}异常,降级处理,异常为:{}","根据id查询字典数据",cause.toString());
throw new BusinessException(finalExceptionEnum);
}
}; };
} }
} }

View File

@@ -1,7 +1,6 @@
package com.njcn.system.pojo.po; package com.njcn.system.pojo.po;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
import lombok.Data; import lombok.Data;
/** /**

View File

@@ -127,5 +127,17 @@ public class EleEpdPqdController extends BaseController {
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, map, methodDescribe); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, map, methodDescribe);
} }
@PostMapping("/selectById")
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@ApiOperation("根据id查询字典数据")
@ApiImplicitParam(name = "id", value = "字典id", required = true)
public HttpResult<EleEpdPqd> selectById(@RequestParam("id") @Validated String id){
log.info("根据id查询字典数据");
String methodDescribe = getMethodDescribe("selectById");
LogUtil.njcnDebug(log, "{}根据id查询字典数据:", methodDescribe);
EleEpdPqd eleEpdPqd = eleEpdPqdService.selectById(id);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, eleEpdPqd, methodDescribe);
}
} }

View File

@@ -60,4 +60,10 @@ public interface IEleEpdPqdService {
* @param eleEpdPqdParam * @param eleEpdPqdParam
*/ */
Map<String,String> saveEvt(List<EleEpdPqdParam> eleEpdPqdParam); Map<String,String> saveEvt(List<EleEpdPqdParam> eleEpdPqdParam);
/**
* 存储事件的字典数据
* @param id
*/
EleEpdPqd selectById(String id);
} }

View File

@@ -127,6 +127,11 @@ public class EleEpdPqdServiceImpl extends ServiceImpl<EleEpdPqdMapper, EleEpdPqd
return map; return map;
} }
@Override
public EleEpdPqd selectById(String id) {
return this.lambdaQuery().eq(EleEpdPqd::getId,id).one();
}
/** /**
* 校验参数, * 校验参数,
* 1.检查是否存在相同名称的菜单 * 1.检查是否存在相同名称的菜单