|
@@ -5,9 +5,9 @@ import com.alibaba.fastjson.TypeReference;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
-import com.gyee.backconfig.model.auto.ProBasicWindpowerstation;
|
|
|
-import com.gyee.backconfig.mapper.auto.ProBasicWindpowerstationMapper;
|
|
|
-import com.gyee.backconfig.service.auto.IProBasicWindpowerstationService;
|
|
|
+import com.gyee.backconfig.model.auto.ProBasicPowerstation;
|
|
|
+import com.gyee.backconfig.mapper.auto.ProBasicPowerstationMapper;
|
|
|
+import com.gyee.backconfig.service.auto.IProBasicPowerstationService;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.gyee.backconfig.service.auto.RedisService;
|
|
|
import com.gyee.backconfig.until.realtimedate.EdosUtil;
|
|
@@ -32,22 +32,22 @@ import java.util.Map;
|
|
|
* @since 2022-10-15
|
|
|
*/
|
|
|
@Service
|
|
|
-public class ProBasicWindpowerstationServiceImpl extends ServiceImpl<ProBasicWindpowerstationMapper, ProBasicWindpowerstation> implements IProBasicWindpowerstationService {
|
|
|
+public class ProBasicPowerstationServiceImpl extends ServiceImpl<ProBasicPowerstationMapper, ProBasicPowerstation> implements IProBasicPowerstationService {
|
|
|
@Resource
|
|
|
private RedisService redisService;
|
|
|
|
|
|
@Autowired
|
|
|
private EdosUtil goldenUtil;
|
|
|
@Override
|
|
|
- public IPage<ProBasicWindpowerstation> getList(String id, String name, String code, String companyId, String pageNum, String pageSize) {
|
|
|
- QueryWrapper<ProBasicWindpowerstation> qw = new QueryWrapper<>();
|
|
|
+ public IPage<ProBasicPowerstation> getList(String id, String name, String code, String companyId, String pageNum, String pageSize) {
|
|
|
+ QueryWrapper<ProBasicPowerstation> qw = new QueryWrapper<>();
|
|
|
|
|
|
if (StringUtils.isNotEmpty(id)){
|
|
|
qw.eq("id",id);
|
|
|
}
|
|
|
|
|
|
if (StringUtils.isNotEmpty(code)){
|
|
|
- qw.like("code",code);
|
|
|
+ qw.like("nemCode",code);
|
|
|
}
|
|
|
|
|
|
if (StringUtils.isNotEmpty(name)){
|
|
@@ -58,22 +58,22 @@ public class ProBasicWindpowerstationServiceImpl extends ServiceImpl<ProBasicWin
|
|
|
qw.like("companyId",companyId);
|
|
|
}
|
|
|
|
|
|
- Page<ProBasicWindpowerstation> page = new Page<>(Integer.parseInt(pageNum),Integer.parseInt(pageSize));
|
|
|
- IPage<ProBasicWindpowerstation> companysPage = getBaseMapper().selectPage(page, qw);
|
|
|
+ Page<ProBasicPowerstation> page = new Page<>(Integer.parseInt(pageNum),Integer.parseInt(pageSize));
|
|
|
+ IPage<ProBasicPowerstation> companysPage = getBaseMapper().selectPage(page, qw);
|
|
|
// List<Windpowerstation> list = companysPage.getRecords();
|
|
|
return companysPage;
|
|
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public List<ProBasicWindpowerstation> getList(String regionId) {
|
|
|
- QueryWrapper<ProBasicWindpowerstation> qw = new QueryWrapper<>();
|
|
|
+ public List<ProBasicPowerstation> getList(String regionId) {
|
|
|
+ QueryWrapper<ProBasicPowerstation> qw = new QueryWrapper<>();
|
|
|
|
|
|
if (StringUtils.isNotEmpty(regionId)){
|
|
|
qw.eq("regionid",regionId);
|
|
|
}
|
|
|
|
|
|
- List<ProBasicWindpowerstation> list = baseMapper.selectList(qw);
|
|
|
+ List<ProBasicPowerstation> list = baseMapper.selectList(qw);
|
|
|
return list;
|
|
|
}
|
|
|
|
|
@@ -81,7 +81,7 @@ public class ProBasicWindpowerstationServiceImpl extends ServiceImpl<ProBasicWin
|
|
|
public List<WindpowerstationAdmVo> getList(String id, String regionId, String companyId) throws Exception {
|
|
|
|
|
|
List<WindpowerstationAdmVo> admvos = new ArrayList<>();
|
|
|
- QueryWrapper<ProBasicWindpowerstation> qw = new QueryWrapper<>();
|
|
|
+ QueryWrapper<ProBasicPowerstation> qw = new QueryWrapper<>();
|
|
|
|
|
|
if (StringUtils.isNotEmpty(id)){
|
|
|
qw.eq("id",id);
|
|
@@ -94,25 +94,25 @@ public class ProBasicWindpowerstationServiceImpl extends ServiceImpl<ProBasicWin
|
|
|
qw.eq("companyId",companyId);
|
|
|
}
|
|
|
|
|
|
- List<ProBasicWindpowerstation> list = baseMapper.selectList(qw);
|
|
|
+ List<ProBasicPowerstation> list = baseMapper.selectList(qw);
|
|
|
|
|
|
list.stream().forEach(i->{
|
|
|
List<String> codes = new ArrayList<>();
|
|
|
// RPJFS
|
|
|
// RFDL
|
|
|
String wpString = redisService.get(i.getId());
|
|
|
- Map<String, ProBasicWindpowerstation> stringMapMap = JSONObject.parseObject(wpString, new TypeReference<Map<String, ProBasicWindpowerstation>>() {
|
|
|
+ Map<String, ProBasicPowerstation> stringMapMap = JSONObject.parseObject(wpString, new TypeReference<Map<String, ProBasicPowerstation>>() {
|
|
|
|
|
|
});
|
|
|
if(null !=stringMapMap){
|
|
|
- codes.add(stringMapMap.get("RPJFS").getCode());//日平局风速
|
|
|
- codes.add(stringMapMap.get("RFDL").getCode());//日发电量
|
|
|
+ codes.add(stringMapMap.get("RPJFS").getNemCode());//日平局风速
|
|
|
+ codes.add(stringMapMap.get("RFDL").getNemCode());//日发电量
|
|
|
}
|
|
|
try {
|
|
|
List<PointData> pointList = goldenUtil.getRealData(codes);
|
|
|
WindpowerstationAdmVo vo = new WindpowerstationAdmVo();
|
|
|
vo.setId(i.getId());
|
|
|
- vo.setCode(i.getCode());
|
|
|
+ vo.setCode(i.getNemCode());
|
|
|
vo.setName(i.getName());
|
|
|
vo.setCapacity(i.getCapacity());//装机容量
|
|
|
vo.setCapacityUnit(i.getCapacityUnit());//装机容量单位
|