Commit a862dc63 by 范富荣

添加督导日报列表查询/详情查询接口

1 parent c57263f4
package cn.com.glsx.dj.supervisor.config;
import cn.com.glsx.dj.supervisor.remote.SupervisorWarningBaselineConfigRemote;
import org.oreframework.boot.autoconfigure.dubbo.reference.ReferenceBuilderFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
......@@ -28,4 +30,9 @@ public class DubboConfig {
return factory.builder(RpcRemote.class).check(false).timeout(30000).build();
}*/
@Bean
public SupervisorWarningBaselineConfigRemote supervisorWarningBaselineConfigRemote(){
return factory.builder(SupervisorWarningBaselineConfigRemote.class).check(false).timeout(30000).build();
}
}
package cn.com.glsx.dj.supervisor.controller;
import cn.com.glsx.dj.supervisor.dto.WarningBaselineConfigDTO;
import cn.com.glsx.dj.supervisor.remote.SupervisorWarningBaselineConfigRemote;
import cn.com.glsx.dj.supervisor.request.WarningBaselineConfigRequest;
import cn.com.glsx.dj.supervisor.utils.CommonUtil;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.rop.response.RopResponse;
import com.rop.AbstractRopRequest;
import com.rop.annotation.NeedInSessionType;
import com.rop.annotation.ServiceMethod;
import com.rop.annotation.ServiceMethodBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
@Slf4j
@ServiceMethodBean(version = "1.0.0", needInSession = NeedInSessionType.NO)
@Api("督导预警基线管理")
public class SupervisorWarningBaselineConfigController {
@Autowired
private SupervisorWarningBaselineConfigRemote supervisorWarningBaselineConfigRemote;
@ServiceMethod(method = "dj.api.supervisor.baseline.config.createOrUpdate", needInSession = NeedInSessionType.YES)
@ApiOperation("创建或修改预警基线配置")
public RopResponse<Boolean> createOrUpdateWarningBaselineConfig(WarningBaselineConfigRequest request) {
WarningBaselineConfigDTO config = CommonUtil.convertRequest(WarningBaselineConfigDTO.class, request);
RpcResponse<Boolean> result = supervisorWarningBaselineConfigRemote.createOrUpdateWarningBaselineConfig(config);
if (result.isSuccess()) {
return RopResponse.success(result.getResult());
} else {
return RopResponse.error(result.getError(), result.getMessage());
}
}
@ServiceMethod(method = "dj.api.supervisor.baseline.config.listAll", needInSession = NeedInSessionType.YES)
@ApiOperation("查询所有预警基线配置")
public RopResponse<List<WarningBaselineConfigDTO>> listAllWarningBaselineConfigs(AbstractRopRequest request) {
RpcResponse<List<WarningBaselineConfigDTO>> result = supervisorWarningBaselineConfigRemote.listAllWarningBaselineConfigs();
if (result.isSuccess()) {
return RopResponse.success(result.getResult());
} else {
return RopResponse.error(result.getError(), result.getMessage());
}
}
}
package cn.com.glsx.dj.supervisor.request;
import cn.com.glsx.dj.supervisor.model.SupervisorWarningBaselineConfig;
import com.rop.AbstractRopRequest;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
@Data
public class WarningBaselineConfigRequest extends AbstractRopRequest {
@ApiModelProperty(notes = "指标编码, 个人产值:A036", required = true)
private String indicatorCode;
@ApiModelProperty(notes = "指标名称, 个人产值:个人产值", required = true)
private String indicatorName;
@ApiModelProperty(notes = "时间维度:(1.按天,2.按周,3.按月,5.按年)", required = true)
private Integer timeDimension;
@ApiModelProperty(notes = "预警基线配置列表", required = true)
private List<SupervisorWarningBaselineConfig> configList;
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!