接口调整
This commit is contained in:
@@ -24,4 +24,7 @@ public interface DataSetFeignClient {
|
||||
@PostMapping("/getDataSet")
|
||||
HttpResult<List<LineTargetVO>> getDataSet(@RequestParam("modelId") String modelId,@RequestParam("clDev") Integer clDev);
|
||||
|
||||
@PostMapping("/getModuleDataSet")
|
||||
HttpResult<List<CsDataSet>> getModuleDataSet(@RequestParam("modelId") String modelId);
|
||||
|
||||
}
|
||||
|
||||
@@ -26,5 +26,5 @@ public interface EquipmentFeignClient {
|
||||
HttpResult<List<CsEquipmentDeliveryDTO>> queryDeviceById(@RequestParam("ids") List<String> ids);
|
||||
|
||||
@PostMapping("/updateSoftInfoBynDid")
|
||||
HttpResult<Boolean> updateSoftInfoBynDid(@RequestParam("nDId") String nDid,@RequestParam("id") String id);
|
||||
HttpResult<Boolean> updateSoftInfoBynDid(@RequestParam("nDId") String nDid, @RequestParam("id") String id, @RequestParam("module") Integer module);
|
||||
}
|
||||
|
||||
@@ -44,6 +44,12 @@ public class DataSetFeignClientFallbackFactory implements FallbackFactory<DataSe
|
||||
log.error("{}异常,降级处理,异常为:{}","获取数据集",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<List<CsDataSet>> getModuleDataSet(String modelId) {
|
||||
log.error("{}异常,降级处理,异常为:{}","获取子模块数据集",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ public class EquipmentFeignClientFallbackFactory implements FallbackFactory<Equi
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<Boolean> updateSoftInfoBynDid(String nDid, String id) {
|
||||
public HttpResult<Boolean> updateSoftInfoBynDid(String nDid, String id, Integer module) {
|
||||
log.error("{}异常,降级处理,异常为:{}","根据网关id调整软件信息",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@@ -119,4 +119,10 @@ public class CsEquipmentDeliveryAddParm{
|
||||
@ApiModelProperty(value="软件信息")
|
||||
private String softinfoId;
|
||||
|
||||
/**
|
||||
* 模块个数
|
||||
*/
|
||||
@ApiModelProperty(value="模块个数")
|
||||
private Integer modelNumber;
|
||||
|
||||
}
|
||||
@@ -123,4 +123,9 @@ public class CsEquipmentDeliveryAuditParm {
|
||||
@ApiModelProperty(value="软件信息")
|
||||
private String softinfoId;
|
||||
|
||||
/**
|
||||
* 模块个数
|
||||
*/
|
||||
@ApiModelProperty(value="模块个数")
|
||||
private Integer modelNumber;
|
||||
}
|
||||
@@ -132,5 +132,11 @@ public class CsEquipmentDeliveryPO extends BaseEntity {
|
||||
@TableField(value = "softinfo_id")
|
||||
private String softinfoId;
|
||||
|
||||
/**
|
||||
* 模块个数
|
||||
*/
|
||||
@TableField(value = "module_number")
|
||||
private Integer moduleNumber;
|
||||
|
||||
|
||||
}
|
||||
@@ -72,5 +72,13 @@ public class CsLinePO extends BaseEntity {
|
||||
@TableField(value = "conType")
|
||||
private Integer conType;
|
||||
|
||||
/**
|
||||
* 逻辑子设备id(与模板对应)
|
||||
* 治理监测点 0
|
||||
* 负载监测点 1
|
||||
* 电网监测点 2
|
||||
*/
|
||||
@TableField(value = "clDid")
|
||||
private Integer clDid;
|
||||
|
||||
}
|
||||
@@ -66,5 +66,15 @@ public class CsDataSetController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getModuleDataSet")
|
||||
@ApiOperation("获取子模块数据集")
|
||||
@ApiImplicitParam(name = "modelId", value = "模板id", required = true)
|
||||
public HttpResult<List<CsDataSet>> getModuleDataSet(@RequestParam("modelId") String modelId){
|
||||
String methodDescribe = getMethodDescribe("getModuleDataSet");
|
||||
List<CsDataSet> list = csDataSetService.getModuleDataSet(modelId);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -170,11 +170,12 @@ public class EquipmentDeliveryController extends BaseController {
|
||||
@ApiOperation("根据网关id调整软件信息")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "nDId", value = "网关id", required = true),
|
||||
@ApiImplicitParam(name = "id", value = "软件信息id", required = true)
|
||||
@ApiImplicitParam(name = "id", value = "软件信息id", required = true),
|
||||
@ApiImplicitParam(name = "module", value = "模块个数", required = true)
|
||||
})
|
||||
public HttpResult<Boolean> updateSoftInfoBynDid(@RequestParam("nDId") String nDid,@RequestParam("id") String id){
|
||||
public HttpResult<Boolean> updateSoftInfoBynDid(@RequestParam("nDId") String nDid,@RequestParam("id") String id,@RequestParam("module") Integer module){
|
||||
String methodDescribe = getMethodDescribe("updateSoftInfoBynDid");
|
||||
csEquipmentDeliveryService.updateSoftInfoBynDid(nDid,id);
|
||||
csEquipmentDeliveryService.updateSoftInfoBynDid(nDid,id,module);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@@ -106,5 +106,6 @@
|
||||
and t1.did = #{param.did}
|
||||
and t3.cl_dev = #{param.cldId}
|
||||
and t4.stat_method = #{param.statMethod}
|
||||
order by t4.sort
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -81,5 +81,5 @@ public interface CsEquipmentDeliveryService extends IService<CsEquipmentDelivery
|
||||
* 根据网关id修改软件信息
|
||||
* @param nDid 网关id
|
||||
*/
|
||||
void updateSoftInfoBynDid(String nDid,String id);
|
||||
void updateSoftInfoBynDid(String nDid,String id,Integer module);
|
||||
}
|
||||
|
||||
@@ -38,4 +38,11 @@ public interface ICsDataSetService extends IService<CsDataSet> {
|
||||
* @return
|
||||
*/
|
||||
List<LineTargetVO> getDataSet(String modelId,Integer clDev);
|
||||
|
||||
/**
|
||||
* 获取子模块数据集
|
||||
* @param modelId 模板id
|
||||
* @return
|
||||
*/
|
||||
List<CsDataSet> getModuleDataSet(String modelId);
|
||||
}
|
||||
|
||||
@@ -36,4 +36,9 @@ public class CsDataSetServiceImpl extends ServiceImpl<CsDataSetMapper, CsDataSet
|
||||
return this.baseMapper.getDataSet(modelId,clDev);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CsDataSet> getModuleDataSet(String modelId) {
|
||||
return this.lambdaQuery().eq(CsDataSet::getPid,modelId).ne(CsDataSet::getClDev,0).list();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -255,9 +255,9 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateSoftInfoBynDid(String nDid, String id) {
|
||||
public void updateSoftInfoBynDid(String nDid, String id, Integer module) {
|
||||
LambdaUpdateWrapper<CsEquipmentDeliveryPO> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
|
||||
lambdaUpdateWrapper.set(CsEquipmentDeliveryPO::getSoftinfoId,id).eq(CsEquipmentDeliveryPO::getNdid,nDid);
|
||||
lambdaUpdateWrapper.set(CsEquipmentDeliveryPO::getSoftinfoId,id).set(CsEquipmentDeliveryPO::getModuleNumber,module).eq(CsEquipmentDeliveryPO::getNdid,nDid);
|
||||
this.update(lambdaUpdateWrapper);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user