Commit 840f787c authored by tangwei's avatar tangwei

增加td 电站数据存储

parent eac91471
package com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.tdeingine;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.io.Serializable;
/**
* @description:
* @author: tw
* @createDate: 2024/4/2
*/
@Data
@TableName(value = "td_hygf_jp_station" ,autoResultMap = true)
public class TdJpStation implements Serializable {
private Long createdTime;
private String thirdStationId; //采集电站id
private String regionalCompaniesCode; //区域公司code
private String amosCompanyCode; //经销商code
private String thirdCode ;//厂商标识
}
package com.yeejoin.amos.api.householdapi.face.orm.mapper.tdengine;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.tdeingine.TdJpStation;
/**
* @description:
* @author: tw
* @createDate: 2024/4/2
*/
public interface TdJpStationMapper extends BaseMapper<TdJpStation> {
}
\ No newline at end of file
...@@ -101,6 +101,10 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe ...@@ -101,6 +101,10 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
@Autowired @Autowired
private TdHYGFInverterTotalGenerateMapper tdHYGFInverterTotalGenerateMapper; private TdHYGFInverterTotalGenerateMapper tdHYGFInverterTotalGenerateMapper;
@Autowired
TdJpStationMapper tdJpStationMapper;
@Scheduled(cron = "${dataRequstScheduled.jinlangyun}") @Scheduled(cron = "${dataRequstScheduled.jinlangyun}")
@Async @Async
...@@ -204,6 +208,29 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe ...@@ -204,6 +208,29 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
} else { } else {
jpStationMapper.insert(jpStation); jpStationMapper.insert(jpStation);
} }
//增加td 电站区域公司,经销商绑定表
TdJpStation tdJpStation = tdJpStationMapper.selectOne(new QueryWrapper<TdJpStation>().
eq("third_code", PVProducerInfoEnum.JLY.getCode()).
eq("third_station_id", stationIds.get(i)));
//判断是否存在
if (ObjectUtils.isEmpty(tdJpStation)) {
tdJpStation = new TdJpStation();
}
tdJpStation.setAmosCompanyCode(jpStation.getAmosCompanyCode());
tdJpStation.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode());
tdJpStation.setThirdStationId(stationIds.get(i));
tdJpStation.setThirdCode(PVProducerInfoEnum.JLY.getCode());
tdJpStation.setCreatedTime(System.currentTimeMillis());
if (!ObjectUtils.isEmpty(tdJpStation.getCreatedTime())) {
tdJpStationMapper.updateById(tdJpStation);
} else {
tdJpStationMapper.insert(tdJpStation);
}
HYGFJPStationPowerHistory hygfjpStationPowerHistory = new HYGFJPStationPowerHistory(); HYGFJPStationPowerHistory hygfjpStationPowerHistory = new HYGFJPStationPowerHistory();
hygfjpStationPowerHistory.setCreatedTime(System.currentTimeMillis()); hygfjpStationPowerHistory.setCreatedTime(System.currentTimeMillis());
hygfjpStationPowerHistory.setThirdStationId(jpStation.getThirdStationId()); hygfjpStationPowerHistory.setThirdStationId(jpStation.getThirdStationId());
......
...@@ -114,7 +114,8 @@ public class ImasterDataServiceImpl implements ImasterDataService { ...@@ -114,7 +114,8 @@ public class ImasterDataServiceImpl implements ImasterDataService {
private TdHYGFStationYearGenerateMapper tdHYGFStationYearGenerateMapper; private TdHYGFStationYearGenerateMapper tdHYGFStationYearGenerateMapper;
@Autowired @Autowired
private TdHYGFInverterTotalGenerateMapper tdHYGFInverterTotalGenerateMapper; private TdHYGFInverterTotalGenerateMapper tdHYGFInverterTotalGenerateMapper;
@Autowired
TdJpStationMapper tdJpStationMapper;
@Scheduled(cron = "${dataRequstScheduled.huawei}") @Scheduled(cron = "${dataRequstScheduled.huawei}")
@Override @Override
...@@ -299,6 +300,33 @@ public class ImasterDataServiceImpl implements ImasterDataService { ...@@ -299,6 +300,33 @@ public class ImasterDataServiceImpl implements ImasterDataService {
} else { } else {
jpStationMapper.insert(jpStation); jpStationMapper.insert(jpStation);
} }
//增加td 电站区域公司,经销商绑定表
TdJpStation tdJpStation = tdJpStationMapper.selectOne(new QueryWrapper<TdJpStation>().
eq("third_code",PVProducerInfoEnum.HUAWEI.getCode()).
eq("third_station_id", imasterStationList.getPlantCode()));
//判断是否存在
if (ObjectUtils.isEmpty(tdJpStation)) {
tdJpStation = new TdJpStation();
}
tdJpStation.setAmosCompanyCode(jpStation.getAmosCompanyCode());
tdJpStation.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode());
tdJpStation.setThirdStationId( imasterStationList.getPlantCode());
tdJpStation.setThirdCode(PVProducerInfoEnum.JLY.getCode());
tdJpStation.setCreatedTime(System.currentTimeMillis());
if (!ObjectUtils.isEmpty(tdJpStation.getCreatedTime())) {
tdJpStationMapper.updateById(tdJpStation);
} else {
tdJpStationMapper.insert(tdJpStation);
}
HYGFJPStationPowerHistory hygfjpStationPowerHistory = new HYGFJPStationPowerHistory(); HYGFJPStationPowerHistory hygfjpStationPowerHistory = new HYGFJPStationPowerHistory();
hygfjpStationPowerHistory.setCreatedTime(System.currentTimeMillis()); hygfjpStationPowerHistory.setCreatedTime(System.currentTimeMillis());
hygfjpStationPowerHistory.setThirdStationId(jpStation.getThirdStationId()); hygfjpStationPowerHistory.setThirdStationId(jpStation.getThirdStationId());
......
...@@ -108,7 +108,9 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe ...@@ -108,7 +108,9 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe
private TdHYGFStationYearGenerateMapper tdHYGFStationYearGenerateMapper; private TdHYGFStationYearGenerateMapper tdHYGFStationYearGenerateMapper;
@Autowired @Autowired
private TdHYGFInverterTotalGenerateMapper tdHYGFInverterTotalGenerateMapper; private TdHYGFInverterTotalGenerateMapper tdHYGFInverterTotalGenerateMapper;
@Autowired
TdJpStationMapper tdJpStationMapper;
@Scheduled(cron = "${dataRequstScheduled.keshida}") @Scheduled(cron = "${dataRequstScheduled.keshida}")
@Override @Override
public void stationList() { public void stationList() {
...@@ -237,6 +239,40 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe ...@@ -237,6 +239,40 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe
jpStationMapper.insert(jpStation); jpStationMapper.insert(jpStation);
} }
//增加td 电站区域公司,经销商绑定表
TdJpStation tdJpStation = tdJpStationMapper.selectOne(new QueryWrapper<TdJpStation>().
eq("third_code",PVProducerInfoEnum.KSOLAR.getCode()).
eq("third_station_id", ksolarStation.getStationId()));
//判断是否存在
if (ObjectUtils.isEmpty(tdJpStation)) {
tdJpStation = new TdJpStation();
}
tdJpStation.setAmosCompanyCode(jpStation.getAmosCompanyCode());
tdJpStation.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode());
tdJpStation.setThirdStationId( ksolarStation.getStationId());
tdJpStation.setThirdCode(PVProducerInfoEnum.JLY.getCode());
tdJpStation.setCreatedTime(System.currentTimeMillis());
if (!ObjectUtils.isEmpty(tdJpStation.getCreatedTime())) {
tdJpStationMapper.updateById(tdJpStation);
} else {
tdJpStationMapper.insert(tdJpStation);
}
HYGFJPStationPowerHistory hygfjpStationPowerHistory = new HYGFJPStationPowerHistory(); HYGFJPStationPowerHistory hygfjpStationPowerHistory = new HYGFJPStationPowerHistory();
hygfjpStationPowerHistory.setCreatedTime(System.currentTimeMillis()); hygfjpStationPowerHistory.setCreatedTime(System.currentTimeMillis());
hygfjpStationPowerHistory.setThirdStationId(jpStation.getThirdStationId()); hygfjpStationPowerHistory.setThirdStationId(jpStation.getThirdStationId());
......
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