pms国网上送代码提交
This commit is contained in:
@@ -28,6 +28,8 @@ public class Monitor extends BaseEntity {
|
||||
@TableId
|
||||
private String id;
|
||||
|
||||
private String monitorId;
|
||||
|
||||
/**
|
||||
* 监测点名称
|
||||
*/
|
||||
|
||||
@@ -186,6 +186,20 @@ public class PmsStatationStatController extends BaseController {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 批量同步中台电站id
|
||||
* @author cdf
|
||||
* @date 2023/12/19
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/batchSync")
|
||||
@ApiOperation("批量同步中台电站id")
|
||||
public HttpResult<Boolean> batchSync() {
|
||||
String methodDescribe = getMethodDescribe("batchSync");
|
||||
statationStatService.batchSync();
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -144,4 +144,6 @@ public interface IStatationStatService extends IService<StatationStat> {
|
||||
|
||||
List<PmsMidLedger> getStationByDeptCode(String deptCode);
|
||||
|
||||
Boolean batchSync();
|
||||
|
||||
}
|
||||
|
||||
@@ -895,6 +895,32 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
||||
|
||||
//当前电站下面没有监测点,可以新增
|
||||
Monitor monitorPO = new Monitor();
|
||||
|
||||
String monitorId = "04";
|
||||
String one ="";
|
||||
if(deptDTO.getName().contains("石家庄")){
|
||||
one= "01";
|
||||
}else if(deptDTO.getName().contains("邯郸")){
|
||||
one= "02";
|
||||
}else if(deptDTO.getName().contains("保定")){
|
||||
one= "03";
|
||||
}else if(deptDTO.getName().contains("沧州")){
|
||||
one= "04";
|
||||
}else if(deptDTO.getName().contains("邢台")){
|
||||
one= "05";
|
||||
}else if(deptDTO.getName().contains("衡水")){
|
||||
one= "06";
|
||||
}else if(deptDTO.getName().contains("超高压")){
|
||||
one= "07";
|
||||
}else {
|
||||
one= "3.14159";
|
||||
}
|
||||
|
||||
String last = String.format("M%05d",oracleTerminalExcel.getId());
|
||||
|
||||
monitorPO.setMonitorId(monitorId+one+last);
|
||||
|
||||
|
||||
monitorPO.setName(oracleTerminalExcel.getLineName());
|
||||
monitorPO.setPowerrName(stationName);
|
||||
monitorPO.setPowerrId(stationId);
|
||||
|
||||
@@ -6,6 +6,7 @@ import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
@@ -415,6 +416,39 @@ public class StatationStatServiceImpl extends ServiceImpl<StatationStatMapper, S
|
||||
return pmsMidLedgerList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean batchSync() {
|
||||
LambdaQueryWrapper<PmsMidLedger> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(PmsMidLedger::getLevel,0).eq(PmsMidLedger::getState,DataStateEnum.ENABLE.getCode());
|
||||
List<PmsMidLedger> pmsMidLedgerList = pmsMidLedgerMapper.selectList(lambdaQueryWrapper);
|
||||
|
||||
List<StatationStat> statationStatList = statationStatMapper.selectList(new LambdaQueryWrapper<>());
|
||||
|
||||
for(StatationStat statationStat :statationStatList){
|
||||
|
||||
for(PmsMidLedger pmsMidLedger :pmsMidLedgerList){
|
||||
if(statationStat.getOrgId().equals(pmsMidLedger.getSectionId())){
|
||||
if(pmsMidLedger.getName().equals(statationStat.getPowerName())){
|
||||
statationStat.setMidStationId(pmsMidLedger.getId());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
List<StatationStat> poList = statationStatList.stream().filter(item->Objects.nonNull(item.getMidStationId())).collect(Collectors.toList());
|
||||
|
||||
for(StatationStat statationStat : poList){
|
||||
LambdaUpdateWrapper<StatationStat> lambdaUpdateWrapper = new LambdaUpdateWrapper();
|
||||
lambdaUpdateWrapper.set(StatationStat::getMidStationId,statationStat.getMidStationId()).eq(StatationStat::getPowerId,statationStat.getPowerId());
|
||||
this.update(lambdaUpdateWrapper);
|
||||
}
|
||||
System.out.println("5555");
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private Map<String, String> voltageLevel() {
|
||||
//获取电压指定电压id
|
||||
Map<String, String> voltageIDs = new HashMap<>();
|
||||
|
||||
Reference in New Issue
Block a user