1.完善模板字典解析功能
This commit is contained in:
@@ -1,10 +1,18 @@
|
||||
package com.njcn.system.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.common.utils.LogUtil;
|
||||
import com.njcn.system.api.fallback.EpdFeignClientFallbackFactory;
|
||||
import com.njcn.system.pojo.param.EleEpdPqdParam;
|
||||
import com.njcn.system.pojo.po.EleEpdPqd;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
@@ -42,4 +50,7 @@ public interface EpdFeignClient {
|
||||
|
||||
@PostMapping("/judgeExist")
|
||||
HttpResult<List<EleEpdPqd>> judgeExist(@RequestParam("name") String name,@RequestParam("dataType") String dataType);
|
||||
|
||||
@PostMapping("/findByParam")
|
||||
HttpResult<EleEpdPqd> findByParam(@RequestParam("name") String name, @RequestParam("dataType") String dataType, @RequestParam("phase") String phase);
|
||||
}
|
||||
|
||||
@@ -75,6 +75,12 @@ public class EpdFeignClientFallbackFactory implements FallbackFactory<EpdFeignCl
|
||||
log.error("{}异常,降级处理,异常为:{}","校验字典是否存在",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<EleEpdPqd> findByParam(String name, String dataType, String phase) {
|
||||
log.error("{}异常,降级处理,异常为:{}","根据条件查询字典数据",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -177,5 +177,20 @@ public class EleEpdPqdController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
|
||||
@PostMapping("/findByParam")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("根据条件查询字典数据")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "name", value = "指标名称", required = true),
|
||||
@ApiImplicitParam(name = "dataType", value = "数据模型", required = true),
|
||||
@ApiImplicitParam(name = "phase", value = "相别", required = true)
|
||||
})
|
||||
public HttpResult<EleEpdPqd> findByParam(@RequestParam("name") @Validated String name, @RequestParam("dataType") @Validated String dataType, @RequestParam("phase") @Validated String phase){
|
||||
String methodDescribe = getMethodDescribe("judgeExist");
|
||||
LogUtil.njcnDebug(log, "{},根据条件查询字典数据:", methodDescribe);
|
||||
EleEpdPqd eleEpdPqd = eleEpdPqdService.findByParam(name,dataType,phase);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, eleEpdPqd, methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -94,4 +94,13 @@ public interface IEleEpdPqdService extends IService<EleEpdPqd> {
|
||||
*/
|
||||
List<EleEpdPqd> judgeExist(String name, String dataType);
|
||||
|
||||
/**
|
||||
* 根据条件查询字典数据
|
||||
* @param name
|
||||
* @param dataType
|
||||
* @param phase
|
||||
* @return
|
||||
*/
|
||||
EleEpdPqd findByParam(String name, String dataType, String phase);
|
||||
|
||||
}
|
||||
|
||||
@@ -199,6 +199,13 @@ public class EleEpdPqdServiceImpl extends ServiceImpl<EleEpdPqdMapper, EleEpdPqd
|
||||
return this.baseMapper.selectList(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EleEpdPqd findByParam(String name, String dataType, String phase) {
|
||||
LambdaQueryWrapper<EleEpdPqd> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(EleEpdPqd::getDataType,dataType).eq(EleEpdPqd::getName,name).eq(EleEpdPqd::getPhase,phase).eq(EleEpdPqd::getStatus,1);
|
||||
return this.baseMapper.selectOne(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验参数,
|
||||
* 1.检查是否存在相同名称的菜单
|
||||
|
||||
Reference in New Issue
Block a user