增加dataType区分小流域

This commit is contained in:
zy 2026-03-21 17:38:55 +08:00
parent 8e21e73290
commit c19c345f6b
10 changed files with 52 additions and 14 deletions

View File

@ -229,6 +229,12 @@ public class SurvHisdataLivestockwater extends Model<SurvHisdataLivestockwater>
@TableField("UPDATED_TIME")
private LocalDateTime updatedTime;
/**
* 数据类型
*/
@TableField("DATA_TYPE")
private String dataType;
@Override
protected Serializable pkVal() {

View File

@ -227,7 +227,11 @@ public class SurvHisdataLivestockwaterError extends Model<SurvHisdataLivestockwa
private LocalDateTime updatedTime;
/**
* 数据类型
*/
@TableField("DATA_TYPE")
private String dataType;

View File

@ -231,6 +231,12 @@ public class SurvHisdataOrientwater extends Model<SurvHisdataOrientwater> {
@TableField("UPDATED_TIME")
private LocalDateTime updatedTime;
/**
* 数据类型
*/
@TableField("DATA_TYPE")
private String dataType;

View File

@ -265,7 +265,11 @@ public class SurvHisdataOrientwaterError extends Model<SurvHisdataOrientwaterErr
@TableField("UPDATED_TIME")
private LocalDateTime updatedTime;
/**
* 数据类型
*/
@TableField("DATA_TYPE")
private String dataType;
@Override

View File

@ -225,7 +225,11 @@ public class SurvTransdataLivestockwater extends Model<SurvTransdataLivestockwat
@TableField("UPDATED_TIME")
private LocalDateTime updatedTime;
/**
* 数据类型
*/
@TableField("DATA_TYPE")
private String dataType;
@Override

View File

@ -232,6 +232,12 @@ public class SurvTransdataOrientwater extends Model<SurvTransdataOrientwater> {
@TableField("UPDATED_TIME")
private LocalDateTime updatedTime;
/**
* 数据类型
*/
@TableField("DATA_TYPE")
private String dataType;

View File

@ -138,11 +138,12 @@ public class CommonServiceImpl implements ICommonService {
orientwater.setDeviceId(deploy.getId());
orientwater.setCreatedBy("task");//创建人
orientwater.setCreateTime(nowTime);//创建时间
orientwater.setDataType(deploy.getDeploySecondaryType());
transdataOrientwaterService.save(orientwater);
//保存历史表
SurvHisdataOrientwater hisOrientWater= new SurvHisdataOrientwater();
BeanUtil.copyProperties(orientwater,hisOrientWater);
hisOrientWater.setId(IdUtil.getSnowflakeNextIdStr());
hisOrientWater.setTransDate(nowTime);
hisdataOrientwaterService.save(hisOrientWater);
@ -158,11 +159,13 @@ public class CommonServiceImpl implements ICommonService {
livestockwater.setDeviceId(deploy.getId());
livestockwater.setCreatedBy("task");//创建人
livestockwater.setCreateTime(nowTime);//创建时间
livestockwater.setDataType(deploy.getDeploySecondaryType());
transdataLivestockwaterService.save(livestockwater);
//保存历史表
SurvHisdataLivestockwater hisdataLivestockwater = new SurvHisdataLivestockwater();
BeanUtil.copyProperties(livestockwater,hisdataLivestockwater);
hisdataLivestockwater.setId(IdUtil.getSnowflakeNextIdStr());
hisdataLivestockwater.setTransDate(nowTime);
hisdataLivestockwaterService.save(hisdataLivestockwater);

View File

@ -162,6 +162,7 @@ public class SurvHisdataLivestockwaterServiceImpl extends ServiceImpl<SurvHisdat
hisdataLivestockwater.setDeviceId(deploy.getId());
hisdataLivestockwater.setDeviceName(deploy.getDeployDes());
hisdataLivestockwater.setStationCode(deploy.getStationCode());
hisdataLivestockwater.setDataType(deploy.getDeploySecondaryType());
if(StringUtils.isNotBlank(deploy.getStationCode())){
SurvStationInfo info = survStationInfoService.getByCode(deploy.getStationCode());
if(info!=null){
@ -191,7 +192,7 @@ public class SurvHisdataLivestockwaterServiceImpl extends ServiceImpl<SurvHisdat
if(dataExamineDetail.getRules()!=null && !dataExamineDetail.getRules().isEmpty()) {
String deployId = deploy.getId();
try {
log.error("=================new畜禽逻辑===================={}", deployId);
SurvTransdataLivestockwater newestData = survTransdataLivestockwaterServiceImpl.getOneByDeviceId(deployId);
String orgId = null;
@ -224,7 +225,7 @@ public class SurvHisdataLivestockwaterServiceImpl extends ServiceImpl<SurvHisdat
if (newestData.getDataDateTime() != null) {
long secs = DateTimeUtils.getSecondsDiff(newestData.getDataDateTime(), LocalDateTime.now());
if (secs < dataExamineDetail.getExamineGap()) {//间隔不足时不生成
log.warn("--------------设备:{}:{}new畜禽间隔为:{}秒,限制时间:{}秒,跳过---------------", deploy.getDeployDes(),deploy.getDeployCode(),secs,dataExamineDetail.getExamineGap());
log.error("--------------设备:{}:{}new畜禽间隔为:{}秒,限制时间:{}秒,跳过---------------", deploy.getDeployDes(),deploy.getDeployCode(),secs,dataExamineDetail.getExamineGap());
XxlJobHelper.log("---------------设备:{}:{}new畜禽间隔为:{}秒,限制时间:{}秒,跳过---------------", deploy.getDeployDes(),deploy.getDeployCode(),secs,dataExamineDetail.getExamineGap());
return null;
}
@ -290,6 +291,7 @@ public class SurvHisdataLivestockwaterServiceImpl extends ServiceImpl<SurvHisdat
hisdataLivestockwater.setDeviceId(deploy.getId());
hisdataLivestockwater.setDeviceName(deploy.getDeployDes());
hisdataLivestockwater.setStationCode(deploy.getStationCode());
hisdataLivestockwater.setDataType(deploy.getDeploySecondaryType());
if (StringUtils.isNotBlank(deploy.getStationCode())) {
SurvStationInfo info = survStationInfoService.getByCode(deploy.getStationCode());
if (info != null) {

View File

@ -182,6 +182,8 @@ public class SurvHisdataOrientwaterServiceImpl extends ServiceImpl<SurvHisdataOr
hisdataOrientwater.setDeviceId(deploy.getId());
hisdataOrientwater.setDeviceName(deploy.getDeployDes());
hisdataOrientwater.setStationCode(deploy.getStationCode());
log.error(deploy.getId()+"================wtf========="+deploy.getDeploySecondaryType());
hisdataOrientwater.setDataType(deploy.getDeploySecondaryType());
if(StringUtils.isNotBlank(deploy.getStationCode())){
SurvStationInfo info = survStationInfoService.getByCode(deploy.getStationCode());
if(info!=null){
@ -210,7 +212,7 @@ public class SurvHisdataOrientwaterServiceImpl extends ServiceImpl<SurvHisdataOr
if (config.getRules() != null && !config.getRules().isEmpty()) {
try {
String deployId = deploy.getId();
log.warn("=================new面源逻辑====================" + deployId);
log.error("=================new面源逻辑===================={}", deployId);
SurvTransdataOrientwater newestData = orientwaterService.getOneByDeviceId(deployId);
String orgId = null;
@ -311,6 +313,7 @@ public class SurvHisdataOrientwaterServiceImpl extends ServiceImpl<SurvHisdataOr
hisdataOrientwater.setDeviceId(deploy.getId());
hisdataOrientwater.setDeviceName(deploy.getDeployDes());
hisdataOrientwater.setStationCode(deploy.getStationCode());
hisdataOrientwater.setDataType(deploy.getDeploySecondaryType());
if (StringUtils.isNotBlank(deploy.getStationCode())) {
SurvStationInfo info = survStationInfoService.getByCode(deploy.getStationCode());
if (info != null) {

View File

@ -76,27 +76,27 @@ public class DataExamineTask {
//开始处理
DateTimeFormatter sdf = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
for (SurvDeviceDeploy deploy : deployList) {
log.warn("=================new处理设备:{}====================",deploy.getDeployCode());
log.error("=================new处理设备:{}---{}====================",deploy.getDeployCode(),deploy.getId());
if(deploy.getDeployType().equals(PollutionConstants.WATER_LIVE)){
SurvTransdataLivestockwater survTransdataLivestockwater = historyLiveWaterService.genDataAuto(deploy,config);
if(survTransdataLivestockwater!=null){
log.warn("----------new设备号:{},生成成功,时间:{}-----------",deploy.getDeployCode(),sdf.format(survTransdataLivestockwater.getDataDateTime()));
log.error("----------new设备号:{},生成成功,时间:{}-----------",deploy.getDeployCode(),sdf.format(survTransdataLivestockwater.getDataDateTime()));
}else{
log.warn("----------new设备号:{},跳过------------",deploy.getDeployCode());
log.error("----------new设备号:{},跳过------------",deploy.getDeployCode());
}
} else if (deploy.getDeployType().equals(PollutionConstants.WATER_ORIENT)) {
SurvTransdataOrientwater survTransdataOrientwater = historyOrientwaterService.genDataAuto(deploy,config);
if(survTransdataOrientwater!=null){
log.warn("----------new设备号:{},生成成功,时间:{}-----------",deploy.getDeployCode(),sdf.format(survTransdataOrientwater.getDataDateTime()));
log.error("----------new设备号:{},生成成功,时间:{}-----------",deploy.getDeployCode(),sdf.format(survTransdataOrientwater.getDataDateTime()));
}else{
log.warn("----------new设备号:{},跳过------------",deploy.getDeployCode());
log.error("----------new设备号:{},跳过------------",deploy.getDeployCode());
}
}else if (deploy.getDeployType().equals(PollutionConstants.WATER_QULITY)) {
SurvTransdataSoil soil = soilService.genDataAuto(deploy,config);
if(soil!=null){
log.warn("----------new设备号:{},生成成功,时间:{}-----------",deploy.getDeployCode(),sdf.format(soil.getDataDateTime()));
log.error("----------new设备号:{},生成成功,时间:{}-----------",deploy.getDeployCode(),sdf.format(soil.getDataDateTime()));
}else{
log.warn("----------new设备号:{},跳过------------",deploy.getDeployCode());
log.error("----------new设备号:{},跳过------------",deploy.getDeployCode());
}
}
}