1.入库添加集合数量
2.同步监测点、装置状态
This commit is contained in:
@@ -27,7 +27,7 @@ public class PqDataVerifyServiceImpl extends MppServiceImpl<PqDataVerifyMapper,
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void insertData(List<PqDataVerify> list) {
|
public void insertData(List<PqDataVerify> list) {
|
||||||
this.saveOrUpdateBatchByMultiId(list);
|
this.saveOrUpdateBatchByMultiId(list,500);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -31,6 +31,6 @@ public class RelationDataComAssImpl extends MppServiceImpl<RStatDataComAssMapper
|
|||||||
BeanUtils.copyProperties(item, limitRate);
|
BeanUtils.copyProperties(item, limitRate);
|
||||||
result.add(limitRate);
|
result.add(limitRate);
|
||||||
});
|
});
|
||||||
this.saveOrUpdateBatchByMultiId(result);
|
this.saveOrUpdateBatchByMultiId(result,500);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ public class RelationDataFlickerImpl extends MppServiceImpl<RStatDataFlickerRela
|
|||||||
BeanUtils.copyProperties(item, data);
|
BeanUtils.copyProperties(item, data);
|
||||||
result.add(data);
|
result.add(data);
|
||||||
});
|
});
|
||||||
dataFlicker.saveOrUpdateBatchByMultiId(result);
|
dataFlicker.saveOrUpdateBatchByMultiId(result,500);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ public class RelationDataFlucImpl extends MppServiceImpl<RStatDataFlucRelationMa
|
|||||||
BeanUtils.copyProperties(item, data);
|
BeanUtils.copyProperties(item, data);
|
||||||
result.add(data);
|
result.add(data);
|
||||||
});
|
});
|
||||||
dataFluc.saveOrUpdateBatchByMultiId(result);
|
dataFluc.saveOrUpdateBatchByMultiId(result,500);
|
||||||
}
|
}
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|||||||
@@ -43,6 +43,6 @@ public class RelationDataHarmRateIImpl extends MppServiceImpl<RStatDataHarmRateI
|
|||||||
BeanUtils.copyProperties(item, data);
|
BeanUtils.copyProperties(item, data);
|
||||||
result.add(data);
|
result.add(data);
|
||||||
});
|
});
|
||||||
dataHarmRateI.saveOrUpdateBatchByMultiId(result);
|
dataHarmRateI.saveOrUpdateBatchByMultiId(result,500);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ public class RelationDataHarmRateVImpl extends MppServiceImpl<RStatDataHarmRateV
|
|||||||
BeanUtils.copyProperties(item, data);
|
BeanUtils.copyProperties(item, data);
|
||||||
result.add(data);
|
result.add(data);
|
||||||
});
|
});
|
||||||
dataHarmRateV.saveOrUpdateBatchByMultiId(result);
|
dataHarmRateV.saveOrUpdateBatchByMultiId(result,500);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -83,6 +83,6 @@ public class RelationDataHarmphasicIImpl extends MppServiceImpl<RStatDataHarmPha
|
|||||||
BeanUtils.copyProperties(item, data);
|
BeanUtils.copyProperties(item, data);
|
||||||
result.add(data);
|
result.add(data);
|
||||||
});
|
});
|
||||||
dataHarmphasicI.saveOrUpdateBatchByMultiId(result);
|
dataHarmphasicI.saveOrUpdateBatchByMultiId(result,500);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ public class RelationDataHarmphasicVImpl extends MppServiceImpl<RStatDataHarmPha
|
|||||||
BeanUtils.copyProperties(item, data);
|
BeanUtils.copyProperties(item, data);
|
||||||
result.add(data);
|
result.add(data);
|
||||||
});
|
});
|
||||||
dataHarmphasicV.saveOrUpdateBatchByMultiId(result);
|
dataHarmphasicV.saveOrUpdateBatchByMultiId(result,500);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -87,6 +87,6 @@ public class RelationDataHarmpowerPImpl extends MppServiceImpl<RStatDataHarmPowe
|
|||||||
BeanUtils.copyProperties(item, data);
|
BeanUtils.copyProperties(item, data);
|
||||||
result.add(data);
|
result.add(data);
|
||||||
});
|
});
|
||||||
dataHarmPowerP.saveOrUpdateBatchByMultiId(result);
|
dataHarmPowerP.saveOrUpdateBatchByMultiId(result,500);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -85,6 +85,6 @@ public class RelationDataHarmpowerQImpl extends MppServiceImpl<RStatDataHarmPowe
|
|||||||
BeanUtils.copyProperties(item, data);
|
BeanUtils.copyProperties(item, data);
|
||||||
result.add(data);
|
result.add(data);
|
||||||
});
|
});
|
||||||
dataHarmpowerQ.saveOrUpdateBatchByMultiId(result);
|
dataHarmpowerQ.saveOrUpdateBatchByMultiId(result,500);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -80,6 +80,6 @@ public class RelationDataHarmpowerSImpl extends MppServiceImpl<RStatDataHarmPowe
|
|||||||
BeanUtils.copyProperties(item, data);
|
BeanUtils.copyProperties(item, data);
|
||||||
result.add(data);
|
result.add(data);
|
||||||
});
|
});
|
||||||
dataHarmPowerS.saveOrUpdateBatchByMultiId(result);
|
dataHarmPowerS.saveOrUpdateBatchByMultiId(result,500);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ public class RelationDataIImpl extends MppServiceImpl<RStatDataIRelationMapper,
|
|||||||
BeanUtils.copyProperties(item, dataI);
|
BeanUtils.copyProperties(item, dataI);
|
||||||
result.add(dataI);
|
result.add(dataI);
|
||||||
});
|
});
|
||||||
iDataI.saveOrUpdateBatchByMultiId(result);
|
iDataI.saveOrUpdateBatchByMultiId(result,500);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -78,6 +78,6 @@ public class RelationDataInharmIImpl extends MppServiceImpl<RStatDataInHarmIRela
|
|||||||
BeanUtils.copyProperties(item, data);
|
BeanUtils.copyProperties(item, data);
|
||||||
result.add(data);
|
result.add(data);
|
||||||
});
|
});
|
||||||
dataInharmI.saveOrUpdateBatchByMultiId(result);
|
dataInharmI.saveOrUpdateBatchByMultiId(result,500);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -86,6 +86,6 @@ public class RelationDataInharmVImpl extends MppServiceImpl<RStatDataInHarmVRela
|
|||||||
BeanUtils.copyProperties(item, data);
|
BeanUtils.copyProperties(item, data);
|
||||||
result.add(data);
|
result.add(data);
|
||||||
});
|
});
|
||||||
dataInHarmV.saveOrUpdateBatchByMultiId(result);
|
dataInHarmV.saveOrUpdateBatchByMultiId(result,500);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ public class RelationDataIntegrityImpl extends MppServiceImpl<RStatIntegrityDMap
|
|||||||
BeanUtils.copyProperties(item, onlineRate);
|
BeanUtils.copyProperties(item, onlineRate);
|
||||||
result.add(onlineRate);
|
result.add(onlineRate);
|
||||||
});
|
});
|
||||||
this.saveOrUpdateBatchByMultiId(result);
|
this.saveOrUpdateBatchByMultiId(result,500);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ public class RelationDataLimitQualifiedImpl extends MppServiceImpl<RStatLimitQua
|
|||||||
BeanUtils.copyProperties(item, limitRate);
|
BeanUtils.copyProperties(item, limitRate);
|
||||||
result.add(limitRate);
|
result.add(limitRate);
|
||||||
});
|
});
|
||||||
this.saveOrUpdateBatchByMultiId(result);
|
this.saveOrUpdateBatchByMultiId(result,500);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ public class RelationDataLimitRateDetailImpl extends MppServiceImpl<RStatLimitRa
|
|||||||
BeanUtils.copyProperties(item, limitRate);
|
BeanUtils.copyProperties(item, limitRate);
|
||||||
result.add(limitRate);
|
result.add(limitRate);
|
||||||
});
|
});
|
||||||
this.saveOrUpdateBatchByMultiId(result);
|
this.saveOrUpdateBatchByMultiId(result,500);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ public class RelationDataLimitRateImpl extends MppServiceImpl<RStatLimitRateRela
|
|||||||
BeanUtils.copyProperties(item, limitRate);
|
BeanUtils.copyProperties(item, limitRate);
|
||||||
result.add(limitRate);
|
result.add(limitRate);
|
||||||
});
|
});
|
||||||
this.saveOrUpdateBatchByMultiId(result);
|
this.saveOrUpdateBatchByMultiId(result,500);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ public class RelationDataLimitTargetImpl extends MppServiceImpl<RStatLimitTarget
|
|||||||
BeanUtils.copyProperties(item, limitRate);
|
BeanUtils.copyProperties(item, limitRate);
|
||||||
result.add(limitRate);
|
result.add(limitRate);
|
||||||
});
|
});
|
||||||
this.saveOrUpdateBatchByMultiId(result);
|
this.saveOrUpdateBatchByMultiId(result,500);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ public class RelationDataOnlineRateImpl extends MppServiceImpl<RStatOnlineRateD
|
|||||||
BeanUtils.copyProperties(item, onlineRate);
|
BeanUtils.copyProperties(item, onlineRate);
|
||||||
result.add(onlineRate);
|
result.add(onlineRate);
|
||||||
});
|
});
|
||||||
this.saveOrUpdateBatchByMultiId(result);
|
this.saveOrUpdateBatchByMultiId(result,500);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ public class RelationDataOrgIntegrityImpl extends MppServiceImpl<RStatOrgIntegri
|
|||||||
BeanUtils.copyProperties(item, onlineRate);
|
BeanUtils.copyProperties(item, onlineRate);
|
||||||
result.add(onlineRate);
|
result.add(onlineRate);
|
||||||
});
|
});
|
||||||
this.saveOrUpdateBatchByMultiId(result);
|
this.saveOrUpdateBatchByMultiId(result,500);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ public class RelationDataPltImpl extends MppServiceImpl<RStatDataPltRelationMapp
|
|||||||
BeanUtils.copyProperties(item, data);
|
BeanUtils.copyProperties(item, data);
|
||||||
result.add(data);
|
result.add(data);
|
||||||
});
|
});
|
||||||
dataPlt.saveOrUpdateBatchByMultiId(result);
|
dataPlt.saveOrUpdateBatchByMultiId(result,500);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ public class RelationDataPollutionImpl extends MppServiceImpl<RMpPollutionDMappe
|
|||||||
BeanUtils.copyProperties(item, limitRate);
|
BeanUtils.copyProperties(item, limitRate);
|
||||||
result.add(limitRate);
|
result.add(limitRate);
|
||||||
});
|
});
|
||||||
this.saveOrUpdateBatchByMultiId(result);
|
this.saveOrUpdateBatchByMultiId(result,500);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ public class RelationDataPollutionOrgDImpl extends MppServiceImpl<RStatPollution
|
|||||||
BeanUtils.copyProperties(item, limitRate);
|
BeanUtils.copyProperties(item, limitRate);
|
||||||
result.add(limitRate);
|
result.add(limitRate);
|
||||||
});
|
});
|
||||||
this.saveOrUpdateBatchByMultiId(result);
|
this.saveOrUpdateBatchByMultiId(result,500);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ public class RelationDataPollutionOrgMImpl extends MppServiceImpl<RStatPollution
|
|||||||
BeanUtils.copyProperties(item, limitRate);
|
BeanUtils.copyProperties(item, limitRate);
|
||||||
result.add(limitRate);
|
result.add(limitRate);
|
||||||
});
|
});
|
||||||
this.saveOrUpdateBatchByMultiId(result);
|
this.saveOrUpdateBatchByMultiId(result,500);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ public class RelationDataPollutionOrgQImpl extends MppServiceImpl<RStatPollution
|
|||||||
BeanUtils.copyProperties(item, limitRate);
|
BeanUtils.copyProperties(item, limitRate);
|
||||||
result.add(limitRate);
|
result.add(limitRate);
|
||||||
});
|
});
|
||||||
this.saveOrUpdateBatchByMultiId(result);
|
this.saveOrUpdateBatchByMultiId(result,500);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ public class RelationDataPollutionOrgYImpl extends MppServiceImpl<RStatPollution
|
|||||||
BeanUtils.copyProperties(item, limitRate);
|
BeanUtils.copyProperties(item, limitRate);
|
||||||
result.add(limitRate);
|
result.add(limitRate);
|
||||||
});
|
});
|
||||||
this.saveOrUpdateBatchByMultiId(result);
|
this.saveOrUpdateBatchByMultiId(result,500);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ public class RelationDataPollutionSubstationDImpl extends MppServiceImpl<RStatPo
|
|||||||
BeanUtils.copyProperties(item, limitRate);
|
BeanUtils.copyProperties(item, limitRate);
|
||||||
result.add(limitRate);
|
result.add(limitRate);
|
||||||
});
|
});
|
||||||
this.saveOrUpdateBatchByMultiId(result);
|
this.saveOrUpdateBatchByMultiId(result,500);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ public class RelationDataPollutionSubstationMImpl extends MppServiceImpl<RStatPo
|
|||||||
BeanUtils.copyProperties(item, limitRate);
|
BeanUtils.copyProperties(item, limitRate);
|
||||||
result.add(limitRate);
|
result.add(limitRate);
|
||||||
});
|
});
|
||||||
this.saveOrUpdateBatchByMultiId(result);
|
this.saveOrUpdateBatchByMultiId(result,500);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ public class RelationDataPollutionSubstationQImpl extends MppServiceImpl<RStatPo
|
|||||||
BeanUtils.copyProperties(item, limitRate);
|
BeanUtils.copyProperties(item, limitRate);
|
||||||
result.add(limitRate);
|
result.add(limitRate);
|
||||||
});
|
});
|
||||||
this.saveOrUpdateBatchByMultiId(result);
|
this.saveOrUpdateBatchByMultiId(result,500);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ public class RelationDataPollutionSubstationYImpl extends MppServiceImpl<RStatPo
|
|||||||
BeanUtils.copyProperties(item, limitRate);
|
BeanUtils.copyProperties(item, limitRate);
|
||||||
result.add(limitRate);
|
result.add(limitRate);
|
||||||
});
|
});
|
||||||
this.saveOrUpdateBatchByMultiId(result);
|
this.saveOrUpdateBatchByMultiId(result,500);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -120,7 +120,7 @@ public class RelationDataVImpl extends MppServiceImpl<RStatDataVRelationMapper,
|
|||||||
BeanUtils.copyProperties(item, dataV);
|
BeanUtils.copyProperties(item, dataV);
|
||||||
result.add(dataV);
|
result.add(dataV);
|
||||||
});
|
});
|
||||||
iDataV.saveOrUpdateBatchByMultiId(result);
|
iDataV.saveOrUpdateBatchByMultiId(result,500);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -32,6 +32,6 @@ public class RelationRActivePowerRangeServiceImpl extends MppServiceImpl<RActive
|
|||||||
powerRange.setState(1);
|
powerRange.setState(1);
|
||||||
result.add(powerRange);
|
result.add(powerRange);
|
||||||
});
|
});
|
||||||
this.saveOrUpdateBatchByMultiId(result);
|
this.saveOrUpdateBatchByMultiId(result,500);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ public class RelationRmpEventDetailDImpl extends MppServiceImpl<RMpEventDetailDM
|
|||||||
BeanUtils.copyProperties(item, limitRate);
|
BeanUtils.copyProperties(item, limitRate);
|
||||||
result.add(limitRate);
|
result.add(limitRate);
|
||||||
});
|
});
|
||||||
this.saveOrUpdateBatchByMultiId(result);
|
this.saveOrUpdateBatchByMultiId(result,500);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ public class RelationRmpEventDetailMImpl extends MppServiceImpl<RMpEventDetailMM
|
|||||||
BeanUtils.copyProperties(item, limitRate);
|
BeanUtils.copyProperties(item, limitRate);
|
||||||
result.add(limitRate);
|
result.add(limitRate);
|
||||||
});
|
});
|
||||||
this.saveOrUpdateBatchByMultiId(result);
|
this.saveOrUpdateBatchByMultiId(result,500);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ public class RelationRmpEventDetailQImpl extends MppServiceImpl<RMpEventDetailQM
|
|||||||
BeanUtils.copyProperties(item, limitRate);
|
BeanUtils.copyProperties(item, limitRate);
|
||||||
result.add(limitRate);
|
result.add(limitRate);
|
||||||
});
|
});
|
||||||
this.saveOrUpdateBatchByMultiId(result);
|
this.saveOrUpdateBatchByMultiId(result,500);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -30,6 +30,6 @@ public class RelationRmpEventDetailYImpl extends MppServiceImpl<RMpEventDetailYM
|
|||||||
BeanUtils.copyProperties(item, limitRate);
|
BeanUtils.copyProperties(item, limitRate);
|
||||||
result.add(limitRate);
|
result.add(limitRate);
|
||||||
});
|
});
|
||||||
this.saveOrUpdateBatchByMultiId(result);
|
this.saveOrUpdateBatchByMultiId(result,500);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
package com.njcn.api;
|
||||||
|
|
||||||
|
import com.njcn.api.fallback.SyncStatusFeignClientFallbackFactory;
|
||||||
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
|
import com.njcn.po.mysql.Device;
|
||||||
|
import com.njcn.po.mysql.LineDetail;
|
||||||
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author denghuajun
|
||||||
|
* @version 1.0.0
|
||||||
|
* @date 2022年01月05日 15:11
|
||||||
|
*/
|
||||||
|
@FeignClient(value = "migration-influxdb-insert-boot", path = "/syncStatusUpdate", fallbackFactory = SyncStatusFeignClientFallbackFactory.class, contextId = "syncStatusUpdate")
|
||||||
|
public interface SyncStatusFeignClient {
|
||||||
|
|
||||||
|
@PostMapping("/syncDevStatusUpdate")
|
||||||
|
HttpResult<String> syncDevStatusUpdate(@RequestBody List<Device> list);
|
||||||
|
|
||||||
|
@PostMapping("/syncLineStatusUpdate")
|
||||||
|
HttpResult<String> syncLineStatusUpdate(@RequestBody List<LineDetail> list);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
package com.njcn.api.fallback;
|
||||||
|
|
||||||
|
import com.njcn.api.SyncStatusFeignClient;
|
||||||
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
|
import com.njcn.dataProcess.util.DataProcessingEnumUtil;
|
||||||
|
import com.njcn.po.mysql.Device;
|
||||||
|
import com.njcn.po.mysql.LineDetail;
|
||||||
|
import feign.hystrix.FallbackFactory;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description:
|
||||||
|
* @Author: wr
|
||||||
|
* @Date: 2025/3/19 10:19
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
public class SyncStatusFeignClientFallbackFactory implements FallbackFactory<SyncStatusFeignClient> {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 输出远程请求接口异常日志
|
||||||
|
* @param cause RPC请求异常
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public SyncStatusFeignClient create(Throwable cause) {
|
||||||
|
//判断抛出异常是否为解码器抛出的业务异常
|
||||||
|
Enum<?> exceptionEnum = CommonResponseEnum.SERVICE_FALLBACK;
|
||||||
|
if(cause.getCause() instanceof BusinessException){
|
||||||
|
BusinessException businessException = (BusinessException) cause.getCause();
|
||||||
|
exceptionEnum = DataProcessingEnumUtil.getExceptionEnum(businessException.getResult());
|
||||||
|
}
|
||||||
|
Enum<?> finalExceptionEnum = exceptionEnum;
|
||||||
|
return new SyncStatusFeignClient() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<String> syncDevStatusUpdate(List<Device> list) {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}","同步装置运行状态",cause.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<String> syncLineStatusUpdate(List<LineDetail> list) {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}","同步监测点运行状态",cause.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,165 @@
|
|||||||
|
package com.njcn.po.mysql;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
*
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @since 2022-01-04
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("pq_device")
|
||||||
|
public class Device implements Serializable{
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 装置序号
|
||||||
|
*/
|
||||||
|
@TableId
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 装置模型(0:虚拟设备;1:实际设备;2:离线设备;)默认是实际设备
|
||||||
|
*/
|
||||||
|
private Integer devModel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据类型(0:暂态系统;1:稳态系统;2:两个系统)
|
||||||
|
*/
|
||||||
|
private Integer devDataType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 终端运行状态(0:运行;1:检修;2:停运;3:调试;4:退运)
|
||||||
|
*/
|
||||||
|
private Integer runFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通讯状态(0:中断;1:正常)
|
||||||
|
*/
|
||||||
|
private Integer comFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备制造商,字典表
|
||||||
|
*/
|
||||||
|
private String manufacturer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 定检状态(0:未检 1:已检)
|
||||||
|
*/
|
||||||
|
private Integer checkFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 前置类型(MMS、CLD)字典表
|
||||||
|
*/
|
||||||
|
private String frontType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 终端型号(570、580……)字典表
|
||||||
|
*/
|
||||||
|
private String devType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 网络参数
|
||||||
|
*/
|
||||||
|
private String ip;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 召唤标志(0:周期触发;1:变为触发)
|
||||||
|
*/
|
||||||
|
private Integer callFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 端口
|
||||||
|
*/
|
||||||
|
private Integer port;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 装置识别码(3ds加密)
|
||||||
|
*/
|
||||||
|
private String series;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 装置秘钥(3ds加密)
|
||||||
|
*/
|
||||||
|
private String devKey;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 前置序号Id,前置表
|
||||||
|
*/
|
||||||
|
private String nodeId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 投运时间
|
||||||
|
*/
|
||||||
|
private LocalDate loginTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据更新时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 本次定检时间,默认等于投运时间
|
||||||
|
*/
|
||||||
|
private LocalDate thisTimeCheck;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下次定检时间,默认为投运时间后推3年,假如时间小于3个月则为待检
|
||||||
|
*/
|
||||||
|
private LocalDate nextTimeCheck;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电度功能 0 关闭 1开启
|
||||||
|
*/
|
||||||
|
private Integer electroplate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 对时功能 0 关闭, 1开启
|
||||||
|
*/
|
||||||
|
private Integer onTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 合同号
|
||||||
|
*/
|
||||||
|
private String contract;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备sim卡号
|
||||||
|
*/
|
||||||
|
private String sim;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 装置系列
|
||||||
|
*/
|
||||||
|
private String devSeries;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监测装置安装位置
|
||||||
|
*/
|
||||||
|
private String devLocation;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监测厂家设备编号
|
||||||
|
*/
|
||||||
|
private String devNo;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 告警功能 0:关闭 null、1:开启
|
||||||
|
*/
|
||||||
|
private Integer isAlarm;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,215 @@
|
|||||||
|
package com.njcn.po.mysql;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
*
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @since 2022-01-04
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("pq_line_detail")
|
||||||
|
public class LineDetail {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监测点序号
|
||||||
|
*/
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 线路号(在同一台设备中的监测点号)
|
||||||
|
*/
|
||||||
|
private Integer num;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PT一次变比
|
||||||
|
*/
|
||||||
|
private Float pt1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PT二次变比
|
||||||
|
*/
|
||||||
|
private Float pt2;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* CT一次变比
|
||||||
|
*/
|
||||||
|
private Float ct1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* CT二次变比
|
||||||
|
*/
|
||||||
|
private Float ct2;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备容量
|
||||||
|
*/
|
||||||
|
private Float devCapacity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 短路容量
|
||||||
|
*/
|
||||||
|
private Float shortCapacity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 基准容量
|
||||||
|
*/
|
||||||
|
private Float standardCapacity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 协议容量
|
||||||
|
*/
|
||||||
|
private Float dealCapacity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 接线类型(0:星型接法;1:三角型接法;2:开口三角型接法)
|
||||||
|
*/
|
||||||
|
private Integer ptType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 测量间隔(1-10分钟)
|
||||||
|
*/
|
||||||
|
private Integer timeInterval;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 干扰源类型,字典表
|
||||||
|
*/
|
||||||
|
private String loadType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 行业类型,字典表
|
||||||
|
*/
|
||||||
|
private String businessType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 网公司谐波监测平台标志(0-否;1-是),默认否
|
||||||
|
*/
|
||||||
|
private Integer monitorFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电网标志(0-电网侧;1-非电网侧)
|
||||||
|
*/
|
||||||
|
private Integer powerFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 国网谐波监测平台监测点号
|
||||||
|
*/
|
||||||
|
private String monitorId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监测点对象名称
|
||||||
|
*/
|
||||||
|
@Deprecated
|
||||||
|
private String objName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监测点对象id
|
||||||
|
*/
|
||||||
|
private String objId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监测对象大类
|
||||||
|
*/
|
||||||
|
private String bigObjType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监测对象小类
|
||||||
|
*/
|
||||||
|
private String smallObjType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 人为干预 0 不参与统计 1 参与统计
|
||||||
|
*/
|
||||||
|
private Integer statFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联字典的终端等级
|
||||||
|
*/
|
||||||
|
private String lineGrade;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电网侧变电站
|
||||||
|
*/
|
||||||
|
private String powerSubstationName;
|
||||||
|
/**
|
||||||
|
* 分类等级
|
||||||
|
*/
|
||||||
|
private String calssificationGrade;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上级电站
|
||||||
|
*/
|
||||||
|
@Deprecated
|
||||||
|
private String superiorsSubstation;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 挂接线路
|
||||||
|
*/
|
||||||
|
@Deprecated
|
||||||
|
private String hangLine;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监测点拥有者
|
||||||
|
*/
|
||||||
|
@Deprecated
|
||||||
|
private String owner;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拥有者职务
|
||||||
|
*/
|
||||||
|
@Deprecated
|
||||||
|
private String ownerDuty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拥有者联系方式
|
||||||
|
*/
|
||||||
|
@Deprecated
|
||||||
|
private String ownerTel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 接线图
|
||||||
|
*/
|
||||||
|
private String wiringDiagram;
|
||||||
|
/**
|
||||||
|
* 监测点接线相别(0,单相,1,三相,默认三相)
|
||||||
|
*/
|
||||||
|
private Integer ptPhaseType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监测点实际安装位置
|
||||||
|
*/
|
||||||
|
private String actualArea;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监测点运行状态(0:运行;1:检修;2:停运;3:调试;4:退运)
|
||||||
|
*/
|
||||||
|
private Integer runFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新能源场站信息ID
|
||||||
|
*/
|
||||||
|
@Deprecated
|
||||||
|
private String newStationId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通讯状态
|
||||||
|
*/
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Integer comFlag;
|
||||||
|
}
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
package com.njcn.migration.insert.controller;
|
||||||
|
|
||||||
|
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||||
|
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||||
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
|
import com.njcn.common.utils.HttpResultUtil;
|
||||||
|
import com.njcn.migration.insert.service.ISyncStatusUpdateService;
|
||||||
|
import com.njcn.po.mysql.Device;
|
||||||
|
import com.njcn.po.mysql.LineDetail;
|
||||||
|
import com.njcn.web.controller.BaseController;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author xy
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/syncStatusUpdate")
|
||||||
|
@Api(tags = "同步状态")
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class SyncStatusUpdateController extends BaseController {
|
||||||
|
|
||||||
|
private final ISyncStatusUpdateService syncStatusUpdateService;
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/syncDevStatusUpdate")
|
||||||
|
@ApiOperation("同步装置状态")
|
||||||
|
public HttpResult<String> syncDevStatusUpdate(@RequestBody List<Device> list){
|
||||||
|
String methodDescribe = getMethodDescribe("syncDevStatusUpdate");
|
||||||
|
syncStatusUpdateService.syncDevStatusUpdate(list);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/syncLineStatusUpdate")
|
||||||
|
@ApiOperation("同步监测点状态")
|
||||||
|
public HttpResult<String> syncLineStatusUpdate(@RequestBody List<LineDetail> list){
|
||||||
|
String methodDescribe = getMethodDescribe("syncLineStatusUpdate");
|
||||||
|
syncStatusUpdateService.syncLineStatusUpdate(list);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package com.njcn.migration.insert.mapper;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.njcn.po.mysql.Device;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @since 2022-01-04
|
||||||
|
*/
|
||||||
|
public interface DeviceMapper extends BaseMapper<Device> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.njcn.migration.insert.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.njcn.po.mysql.LineDetail;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @since 2022-01-04
|
||||||
|
*/
|
||||||
|
public interface LineDetailMapper extends BaseMapper<LineDetail> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package com.njcn.migration.insert.service;
|
||||||
|
|
||||||
|
import com.njcn.po.mysql.Device;
|
||||||
|
import com.njcn.po.mysql.LineDetail;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public interface ISyncStatusUpdateService {
|
||||||
|
|
||||||
|
void syncDevStatusUpdate(List<Device> list);
|
||||||
|
|
||||||
|
void syncLineStatusUpdate(List<LineDetail> list);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
package com.njcn.migration.insert.service.impl;
|
||||||
|
|
||||||
|
import com.njcn.migration.insert.mapper.DeviceMapper;
|
||||||
|
import com.njcn.migration.insert.mapper.LineDetailMapper;
|
||||||
|
import com.njcn.migration.insert.service.ISyncStatusUpdateService;
|
||||||
|
import com.njcn.po.mysql.Device;
|
||||||
|
import com.njcn.po.mysql.LineDetail;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author xy
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class SyncStatusUpdateServiceImpl implements ISyncStatusUpdateService {
|
||||||
|
|
||||||
|
private final DeviceMapper deviceMapper;
|
||||||
|
private final LineDetailMapper lineDetailMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void syncDevStatusUpdate(List<Device> list) {
|
||||||
|
list.forEach(deviceMapper::updateById);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void syncLineStatusUpdate(List<LineDetail> list) {
|
||||||
|
list.forEach(lineDetailMapper::updateById);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
package com.njcn.migration.read.controller;
|
||||||
|
|
||||||
|
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||||
|
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||||
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
|
import com.njcn.common.utils.HttpResultUtil;
|
||||||
|
import com.njcn.migration.read.service.ISyncStatusService;
|
||||||
|
import com.njcn.web.controller.BaseController;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author xy
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/syncStatus")
|
||||||
|
@Api(tags = "同步状态")
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class SyncStatusController extends BaseController {
|
||||||
|
|
||||||
|
private final ISyncStatusService syncStatusService;
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/syncDevStatus")
|
||||||
|
@ApiOperation("同步装置状态")
|
||||||
|
public HttpResult<String> syncDevStatus(){
|
||||||
|
String methodDescribe = getMethodDescribe("syncDevStatus");
|
||||||
|
syncStatusService.syncDevStatus();
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/syncLineStatus")
|
||||||
|
@ApiOperation("同步监测点状态")
|
||||||
|
public HttpResult<String> syncLineStatus(){
|
||||||
|
String methodDescribe = getMethodDescribe("syncLineStatus");
|
||||||
|
syncStatusService.syncLineStatus();
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -45,8 +45,8 @@ public class MigrationInfluxDBJob {
|
|||||||
public void InfluxDBJob() {
|
public void InfluxDBJob() {
|
||||||
// 获取当前时间
|
// 获取当前时间
|
||||||
LocalDateTime now = LocalDateTime.now();
|
LocalDateTime now = LocalDateTime.now();
|
||||||
// 减去一个小时
|
// 减去2个小时
|
||||||
LocalDateTime oneHourAgo = now.minusHours(1);
|
LocalDateTime oneHourAgo = now.minusHours(2);
|
||||||
// 将分钟和秒设置为0
|
// 将分钟和秒设置为0
|
||||||
LocalDateTime result = oneHourAgo.truncatedTo(ChronoUnit.HOURS);
|
LocalDateTime result = oneHourAgo.truncatedTo(ChronoUnit.HOURS);
|
||||||
// 加上59分钟59秒
|
// 加上59分钟59秒
|
||||||
|
|||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package com.njcn.migration.read.job;
|
||||||
|
|
||||||
|
import com.njcn.migration.read.service.ISyncStatusService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||||
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description:
|
||||||
|
* Date: 2024/1/18 10:15【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
@EnableScheduling
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Slf4j
|
||||||
|
public class SyncStatusJob {
|
||||||
|
|
||||||
|
private final ISyncStatusService syncStatusService;
|
||||||
|
|
||||||
|
@Scheduled(cron="0 0/10 * * * ?")
|
||||||
|
public void syncRunFlag() {
|
||||||
|
System.out.println("--------------------------------装置、监测点运行状态同步------------------------------------");
|
||||||
|
syncStatusService.syncDevStatus();
|
||||||
|
syncStatusService.syncLineStatus();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package com.njcn.migration.read.mapper;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.njcn.po.mysql.Device;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @since 2022-01-04
|
||||||
|
*/
|
||||||
|
public interface DeviceMapper extends BaseMapper<Device> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.njcn.migration.read.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.njcn.po.mysql.LineDetail;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @since 2022-01-04
|
||||||
|
*/
|
||||||
|
public interface LineDetailMapper extends BaseMapper<LineDetail> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
package com.njcn.migration.read.service;
|
||||||
|
|
||||||
|
public interface ISyncStatusService {
|
||||||
|
|
||||||
|
void syncDevStatus();
|
||||||
|
|
||||||
|
void syncLineStatus();
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
package com.njcn.migration.read.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.njcn.api.SyncStatusFeignClient;
|
||||||
|
import com.njcn.migration.read.mapper.DeviceMapper;
|
||||||
|
import com.njcn.migration.read.mapper.LineDetailMapper;
|
||||||
|
import com.njcn.migration.read.service.ISyncStatusService;
|
||||||
|
import com.njcn.po.mysql.Device;
|
||||||
|
import com.njcn.po.mysql.LineDetail;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author xy
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class SyncStatusServiceImpl implements ISyncStatusService {
|
||||||
|
|
||||||
|
private final DeviceMapper deviceMapper;
|
||||||
|
private final LineDetailMapper lineDetailMapper;
|
||||||
|
private final SyncStatusFeignClient syncStatusFeignClient;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void syncDevStatus() {
|
||||||
|
Wrapper<Device> wrapper = new QueryWrapper<>();
|
||||||
|
List<Device> list = deviceMapper.selectList(wrapper);
|
||||||
|
if (!list.isEmpty()) {
|
||||||
|
//调用修改程序
|
||||||
|
syncStatusFeignClient.syncDevStatusUpdate(list);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void syncLineStatus() {
|
||||||
|
Wrapper<LineDetail> wrapper = new QueryWrapper<>();
|
||||||
|
List<LineDetail> list = lineDetailMapper.selectList(wrapper);
|
||||||
|
if (!list.isEmpty()) {
|
||||||
|
//调用修改程序
|
||||||
|
syncStatusFeignClient.syncLineStatusUpdate(list);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user