Commit 0b3bf94f authored by hezhuozhi's avatar hezhuozhi

提交工况变量选择

parent 87ee35f1
...@@ -151,4 +151,12 @@ public class IdxBizFanPointVarCorrelationController extends BaseController { ...@@ -151,4 +151,12 @@ public class IdxBizFanPointVarCorrelationController extends BaseController {
return ResponseHelper.buildResponse(idxBizFanPointVarCorrelationServiceImpl.getDetailBySequenceNbr(sequenceNbr)); return ResponseHelper.buildResponse(idxBizFanPointVarCorrelationServiceImpl.getDetailBySequenceNbr(sequenceNbr));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST",value = "查询当前点位所选择的工况变量", notes = "查询当前点位所选择的工况变量")
@PostMapping(value = "/updatePointChooseBySequenceNbrList")
public ResponseModel updatePointChooseBySequenceNbrList(@RequestBody IdxBizFanPointVarCorrelationDto dto) {
idxBizFanPointVarCorrelationServiceImpl.updatePointChooseBySequenceNbrList(dto.getSequenceNbrList());
return CommonResponseUtil.success();
}
} }
...@@ -152,4 +152,11 @@ public class IdxBizPvPointVarCorrelationController extends BaseController { ...@@ -152,4 +152,11 @@ public class IdxBizPvPointVarCorrelationController extends BaseController {
return ResponseHelper.buildResponse(idxBizPvPointVarCorrelationServiceImpl.getDetailBySequenceNbr(sequenceNbr)); return ResponseHelper.buildResponse(idxBizPvPointVarCorrelationServiceImpl.getDetailBySequenceNbr(sequenceNbr));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST",value = "查询当前点位所选择的工况变量", notes = "查询当前点位所选择的工况变量")
@PostMapping(value = "/updatePointChooseBySequenceNbrList")
public ResponseModel updatePointChooseBySequenceNbrList(@RequestBody IdxBizFanPointVarCorrelationDto dto) {
idxBizPvPointVarCorrelationServiceImpl.updatePointChooseBySequenceNbrList(dto.getSequenceNbrList());
return CommonResponseUtil.success();
}
} }
...@@ -89,4 +89,6 @@ public class IdxBizFanPointVarCorrelationDto { ...@@ -89,4 +89,6 @@ public class IdxBizFanPointVarCorrelationDto {
@TableField(exist = false) @TableField(exist = false)
private List<String> processPointIds; private List<String> processPointIds;
@TableField(exist = false)
private List<String> sequenceNbrList;
} }
...@@ -10,11 +10,13 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -10,11 +10,13 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.jxiop.biz.dto.IdxBizFanPointVarCorrelationDto; import com.yeejoin.amos.boot.module.jxiop.biz.dto.IdxBizFanPointVarCorrelationDto;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanPointVarCorrelation; import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanPointVarCorrelation;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanWeight; import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanWeight;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizPvPointVarCorrelation;
import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizFanPointVarCorrelationMapper; import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizFanPointVarCorrelationMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.service.IIdxBizFanPointVarCorrelationService; import com.yeejoin.amos.boot.module.jxiop.biz.service.IIdxBizFanPointVarCorrelationService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
...@@ -106,4 +108,28 @@ public class IdxBizFanPointVarCorrelationServiceImpl extends BaseService<IdxBizF ...@@ -106,4 +108,28 @@ public class IdxBizFanPointVarCorrelationServiceImpl extends BaseService<IdxBizF
List<IdxBizFanPointVarCorrelation> fanPointVarCorrelationList = list(wrapper); List<IdxBizFanPointVarCorrelation> fanPointVarCorrelationList = list(wrapper);
return fanPointVarCorrelationList; return fanPointVarCorrelationList;
} }
public void updatePointChooseBySequenceNbrList(List<String> sequenceNbrList) {
if(CollectionUtil.isNotEmpty(sequenceNbrList) ){
if(sequenceNbrList.size()>3){
throw new BadRequest("最多选择3个");
}
LambdaQueryWrapper<IdxBizFanPointVarCorrelation> wrapper = new LambdaQueryWrapper<>();
wrapper.in(IdxBizFanPointVarCorrelation::getSequenceNbr, sequenceNbrList);
List<IdxBizFanPointVarCorrelation> fanPointVarCorrelations = list(wrapper);
if(CollectionUtil.isNotEmpty(fanPointVarCorrelations)){
IdxBizFanPointVarCorrelation firstData = fanPointVarCorrelations.get(0);
String analysisGatewayId = firstData.getAnalysisGatewayId();
Long analysisPointId = firstData.getAnalysisPointId();
List<String> processPointIds = new ArrayList<>();
for (IdxBizFanPointVarCorrelation fanPointVarCorrelation : fanPointVarCorrelations) {
if(!analysisGatewayId.equals(fanPointVarCorrelation.getAnalysisGatewayId())|| !analysisPointId.equals(fanPointVarCorrelation.getAnalysisPointId())){
throw new BadRequest("不是同一批分析测点无法操作");
}
processPointIds.add(String.valueOf(fanPointVarCorrelation.getProcessPointId()));
}
updatePointChoose(analysisGatewayId,Long.valueOf(analysisPointId),processPointIds);
}
}
}
} }
\ No newline at end of file
...@@ -14,6 +14,7 @@ import com.yeejoin.amos.boot.module.jxiop.biz.service.IIdxBizPvPointVarCorrelati ...@@ -14,6 +14,7 @@ import com.yeejoin.amos.boot.module.jxiop.biz.service.IIdxBizPvPointVarCorrelati
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
...@@ -106,4 +107,28 @@ public class IdxBizPvPointVarCorrelationServiceImpl extends BaseService<IdxBizPv ...@@ -106,4 +107,28 @@ public class IdxBizPvPointVarCorrelationServiceImpl extends BaseService<IdxBizPv
List<IdxBizPvPointVarCorrelation> pvPointVarCorrelationList = list(wrapper); List<IdxBizPvPointVarCorrelation> pvPointVarCorrelationList = list(wrapper);
return pvPointVarCorrelationList; return pvPointVarCorrelationList;
} }
public void updatePointChooseBySequenceNbrList(List<String> sequenceNbrList) {
if(CollectionUtil.isNotEmpty(sequenceNbrList) ){
if(sequenceNbrList.size()>3){
throw new BadRequest("最多选择3个");
}
LambdaQueryWrapper<IdxBizPvPointVarCorrelation> wrapper = new LambdaQueryWrapper<>();
wrapper.in(IdxBizPvPointVarCorrelation::getSequenceNbr, sequenceNbrList);
List<IdxBizPvPointVarCorrelation> pvPointVarCorrelations = list(wrapper);
if(CollectionUtil.isNotEmpty(pvPointVarCorrelations)){
IdxBizPvPointVarCorrelation firstData = pvPointVarCorrelations.get(0);
String analysisGatewayId = firstData.getAnalysisGatewayId();
String analysisPointId = firstData.getAnalysisPointId();
List<String> processPointIds = new ArrayList<>();
for (IdxBizPvPointVarCorrelation pvPointdVarCorrelation : pvPointVarCorrelations) {
if(!analysisGatewayId.equals(pvPointdVarCorrelation.getAnalysisGatewayId())|| !analysisPointId.equals(pvPointdVarCorrelation.getAnalysisPointId())){
throw new BadRequest("不是同一批分析测点无法操作");
}
processPointIds.add(pvPointdVarCorrelation.getProcessPointId());
}
updatePointChoose(analysisGatewayId,Long.valueOf(analysisPointId),processPointIds);
}
}
}
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment