模板适配调整
This commit is contained in:
@@ -6,6 +6,7 @@ import com.njcn.csdevice.api.fallback.CsLineClientFallbackFactory;
|
|||||||
import com.njcn.csdevice.pojo.param.CsLineParam;
|
import com.njcn.csdevice.pojo.param.CsLineParam;
|
||||||
import com.njcn.csdevice.pojo.po.CsLinePO;
|
import com.njcn.csdevice.pojo.po.CsLinePO;
|
||||||
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;
|
||||||
@@ -36,4 +37,7 @@ public interface CsLineFeignClient {
|
|||||||
|
|
||||||
@PostMapping("/updateLine")
|
@PostMapping("/updateLine")
|
||||||
HttpResult<String> updateLine(@RequestBody CsLineParam csLineParam);
|
HttpResult<String> updateLine(@RequestBody CsLineParam csLineParam);
|
||||||
|
|
||||||
|
@PostMapping("/updateIds")
|
||||||
|
HttpResult<Boolean> updateIds(@RequestBody @Validated CsLineParam csLineParam);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,6 +63,12 @@ public class CsLineClientFallbackFactory implements FallbackFactory<CsLineFeignC
|
|||||||
log.error("{}异常,降级处理,异常为:{}","更新监测点信息",cause.toString());
|
log.error("{}异常,降级处理,异常为:{}","更新监测点信息",cause.toString());
|
||||||
throw new BusinessException(finalExceptionEnum);
|
throw new BusinessException(finalExceptionEnum);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<Boolean> updateIds(CsLineParam csLineParam) {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}","修改监测点模板id和数据集id",cause.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,4 +38,14 @@ public class CsLineParam extends BaseEntity {
|
|||||||
*/
|
*/
|
||||||
private Integer conType;
|
private Integer conType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 模板id
|
||||||
|
*/
|
||||||
|
private String modelId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据集id
|
||||||
|
*/
|
||||||
|
private String dataSetId;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -121,4 +121,15 @@ public class CslineController extends BaseController {
|
|||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/updateIds")
|
||||||
|
@ApiOperation("修改监测点模板id和数据集id")
|
||||||
|
@ApiImplicitParam(name = "csLineParam", value = "监测点信息", required = true)
|
||||||
|
@ApiIgnore
|
||||||
|
public HttpResult<Boolean> updateIds(@RequestBody @Validated CsLineParam csLineParam) {
|
||||||
|
String methodDescribe = getMethodDescribe("updateIds");
|
||||||
|
csLinePOService.updateIds(csLineParam);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -105,6 +105,7 @@
|
|||||||
t0.ndid = #{param.id}
|
t0.ndid = #{param.id}
|
||||||
and t1.did = #{param.did}
|
and t1.did = #{param.did}
|
||||||
and t3.cl_dev = #{param.cldId}
|
and t3.cl_dev = #{param.cldId}
|
||||||
|
and (t3.data_type = 'Stat' or t3.data_type is NULL)
|
||||||
and t4.stat_method = #{param.statMethod}
|
and t4.stat_method = #{param.statMethod}
|
||||||
order by t4.sort
|
order by t4.sort
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
@@ -40,4 +40,10 @@ public interface CsLinePOService extends IService<CsLinePO>{
|
|||||||
*/
|
*/
|
||||||
void updateLine(CsLineParam csLineParam);
|
void updateLine(CsLineParam csLineParam);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改监测点的数据集id和模板id
|
||||||
|
* @param csLineParam
|
||||||
|
*/
|
||||||
|
void updateIds(CsLineParam csLineParam);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -71,6 +71,16 @@ public class CsLinePOServiceImpl extends ServiceImpl<CsLinePOMapper, CsLinePO> i
|
|||||||
this.update(lambdaUpdateWrapper);
|
this.update(lambdaUpdateWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateIds(CsLineParam csLineParam) {
|
||||||
|
LambdaUpdateWrapper<CsLinePO> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
|
||||||
|
lambdaUpdateWrapper.eq(CsLinePO::getLineId,csLineParam.getLineId())
|
||||||
|
.eq(CsLinePO::getStatus,1)
|
||||||
|
.set(CsLinePO::getDataSetId,csLineParam.getDataSetId())
|
||||||
|
.set(CsLinePO::getDataModelId,csLineParam.getModelId());
|
||||||
|
this.update(lambdaUpdateWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
// /**
|
// /**
|
||||||
// * 1.平台端默认配置拓扑图模板,包含拓扑图信息(cs_topology_diagram_template)和拓扑图上监测点的点位信息(cs_line_topology_template)
|
// * 1.平台端默认配置拓扑图模板,包含拓扑图信息(cs_topology_diagram_template)和拓扑图上监测点的点位信息(cs_line_topology_template)
|
||||||
// *
|
// *
|
||||||
|
|||||||
Reference in New Issue
Block a user