|
@@ -5,10 +5,12 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.gyee.backconfig.config.CacheContext;
|
|
|
+import com.gyee.backconfig.config.DistinctObject;
|
|
|
import com.gyee.backconfig.mapper.auto.ProEconTestingPointMapper;
|
|
|
import com.gyee.backconfig.model.auto.*;
|
|
|
import com.gyee.backconfig.service.auto.*;
|
|
|
import com.gyee.common.model.StringUtils;
|
|
|
+import lombok.extern.log4j.Log4j2;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
@@ -25,6 +27,7 @@ import java.util.stream.Collectors;
|
|
|
* @author wang
|
|
|
* @since 2022-11-10
|
|
|
*/
|
|
|
+@Log4j2
|
|
|
@Service
|
|
|
public class ProEconTestingPointServiceImpl extends ServiceImpl<ProEconTestingPointMapper, ProEconTestingPoint> implements IProEconTestingPointService {
|
|
|
|
|
@@ -46,15 +49,20 @@ public class ProEconTestingPointServiceImpl extends ServiceImpl<ProEconTestingPo
|
|
|
@Autowired
|
|
|
private IProBasicPowerstationPointService proBasicPowerstationPointService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ public IProBasicPowerstationService proBasicPowerstationService;
|
|
|
+
|
|
|
@Override
|
|
|
public void generatePoint(String station, String[] setpoints) {
|
|
|
|
|
|
List<ProBasicEquipmentPoint> equipmentPoints = initalFj(station,setpoints);
|
|
|
List<ProBasicPowerstationPoint> powerstationPoints = initalFc();
|
|
|
|
|
|
+
|
|
|
proBasicEquipmentPointService.batchAddEquipmentPoint(equipmentPoints);
|
|
|
proBasicPowerstationPointService.batchAddPowerstationPoints(powerstationPoints);
|
|
|
|
|
|
+ generateSubStationPoint(station,setpoints);
|
|
|
|
|
|
}
|
|
|
|
|
@@ -105,8 +113,8 @@ public class ProEconTestingPointServiceImpl extends ServiceImpl<ProEconTestingPo
|
|
|
public List<ProBasicPowerstationPoint> initalSbs(String station,String[] setpoints) {
|
|
|
List<ProBasicPowerstationPoint> allpoints = new ArrayList<>();
|
|
|
|
|
|
- List<ProEconTestingPoint> fcs = proEconTestingPointService.list().stream().filter(i -> i.getTypeId().equals("agc") || i.getTypeId().equals("agcjsfw") || i.getTypeId().equals("cft")).collect(Collectors.toList());
|
|
|
- List<ProEconTestingPoint> gcs = proEconTestingPointService.list().stream().filter(i -> i.getTypeId().equals("agc") || i.getTypeId().equals("agcjsfw")).collect(Collectors.toList());
|
|
|
+ List<ProEconTestingPoint> fcs = proEconTestingPointService.list().stream().filter(i -> i.getTypeId().equals("agc") || i.getTypeId().equals("agcjsfw") || i.getTypeId().equals("fggl") || i.getTypeId().equals("cft")).collect(Collectors.toList());
|
|
|
+ List<ProEconTestingPoint> gcs = proEconTestingPointService.list().stream().filter(i -> i.getTypeId().equals("agc") || i.getTypeId().equals("agcjsfw") || i.getTypeId().equals("fggl") || i.getTypeId().equals("qxz")).collect(Collectors.toList());
|
|
|
//获取场站
|
|
|
for (ProBasicPowerstation postation : CacheContext.wpls) {
|
|
|
if (null != station && !"".equals(station) && !station.equals(postation.getId())) {
|
|
@@ -189,7 +197,7 @@ public class ProEconTestingPointServiceImpl extends ServiceImpl<ProEconTestingPo
|
|
|
po.setName(String.valueOf(sb));
|
|
|
po.setWindpowerstationId(sub.getId());
|
|
|
po.setUniformCode(p.getUniformCode());
|
|
|
-
|
|
|
+ po.setTypeId(p.getTypeId());
|
|
|
sb = new StringBuilder();
|
|
|
sb.append(sbtable.toString().substring(0, sbtable.toString().lastIndexOf(".")));
|
|
|
po.setRealtimeId(String.valueOf(sb));
|
|
@@ -336,6 +344,7 @@ public class ProEconTestingPointServiceImpl extends ServiceImpl<ProEconTestingPo
|
|
|
po.setModelId(wt.getModelId());
|
|
|
po.setWindturbineId(wt.getId());
|
|
|
po.setUniformCode(stp.getUniformCode());
|
|
|
+ po.setTypeId(stp.getTypeId());
|
|
|
po.setWindpowerstationId(wt.getWindpowerstationId());
|
|
|
po.setLogicalUnitId(ls.get(i).getLogicalUnitId());
|
|
|
|
|
@@ -374,6 +383,8 @@ public class ProEconTestingPointServiceImpl extends ServiceImpl<ProEconTestingPo
|
|
|
List<ProEconTestingPoint> pointls = proEconTestingPointService.list().stream()
|
|
|
.filter(i -> i.getTypeId().equals(FCJSFW) || i.getTypeId().equals(GCJSFW)).collect(Collectors.toList());
|
|
|
|
|
|
+ pointls = pointls.stream().filter(DistinctObject.distinctByKey(p->p.getUniformCode())).collect(Collectors.toList());
|
|
|
+
|
|
|
List<ProEconTestingPoint> fdpointls = proEconTestingPointService.list().stream()
|
|
|
.filter(i -> i.getTypeId().equals(FCJSFW)).collect(Collectors.toList());
|
|
|
List<ProEconTestingPoint> gfpointls = proEconTestingPointService.list().stream()
|
|
@@ -397,8 +408,17 @@ public class ProEconTestingPointServiceImpl extends ServiceImpl<ProEconTestingPo
|
|
|
|
|
|
List<ProBasicPowerstationPoint> points = new ArrayList<>();
|
|
|
for (int i = 0; i < pointls.size(); i++) {
|
|
|
-
|
|
|
ProEconTestingPoint stp = pointls.get(i);
|
|
|
+ List<ProBasicPowerstation> groupFCRegion = CacheContext.wpmapGroupFCRegion.get(re.getId());
|
|
|
+ if((null == groupFCRegion || groupFCRegion.size()<=0) && stp.getTypeId().equals(FCJSFW) ){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ List<ProBasicPowerstation> groupGCRegion = CacheContext.wpmapGroupGCRegion.get(re.getId());
|
|
|
+ if((null == groupGCRegion || groupGCRegion.size()<=0) && stp.getTypeId().equals(GCJSFW) ){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
StringBuilder sb = new StringBuilder();
|
|
|
StringBuilder sbtable = new StringBuilder();
|
|
|
sbtable.append(re.getId().substring(0, re.getId().indexOf("_")));
|
|
@@ -430,7 +450,7 @@ public class ProEconTestingPointServiceImpl extends ServiceImpl<ProEconTestingPo
|
|
|
|
|
|
po.setWindpowerstationId(String.valueOf(tempsb));
|
|
|
po.setUniformCode(stp.getUniformCode());
|
|
|
-
|
|
|
+ po.setTypeId(stp.getTypeId());
|
|
|
|
|
|
sb = new StringBuilder();
|
|
|
sb.append(re.getNemCode()).append(".JSFW");
|
|
@@ -448,6 +468,12 @@ public class ProEconTestingPointServiceImpl extends ServiceImpl<ProEconTestingPo
|
|
|
points = new ArrayList<>();
|
|
|
|
|
|
for (int i = 0; i < fdpointls.size(); i++) {
|
|
|
+
|
|
|
+ List<ProBasicPowerstation> groupFCRegion = CacheContext.wpmapGroupFCRegion.get(re.getId());
|
|
|
+ if(null == groupFCRegion || groupFCRegion.size()<=0){
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
sba = new StringBuilder();
|
|
|
|
|
|
ProEconTestingPoint stp = fdpointls.get(i);
|
|
@@ -480,7 +506,7 @@ public class ProEconTestingPointServiceImpl extends ServiceImpl<ProEconTestingPo
|
|
|
}
|
|
|
po.setWindpowerstationId(String.valueOf(tempsb));
|
|
|
po.setUniformCode(stp.getUniformCode());
|
|
|
-
|
|
|
+ po.setTypeId(stp.getTypeId());
|
|
|
|
|
|
sb = new StringBuilder();
|
|
|
sb.append(re.getNemCode()).append(".JSFW");
|
|
@@ -498,6 +524,10 @@ public class ProEconTestingPointServiceImpl extends ServiceImpl<ProEconTestingPo
|
|
|
points = new ArrayList<>();
|
|
|
for (int i = 0; i < gfpointls.size(); i++) {
|
|
|
|
|
|
+ List<ProBasicPowerstation> groupGCRegion = CacheContext.wpmapGroupGCRegion.get(re.getId());
|
|
|
+ if(null == groupGCRegion || groupGCRegion.size()<=0){
|
|
|
+ break;
|
|
|
+ }
|
|
|
|
|
|
ProEconTestingPoint stp = gfpointls.get(i);
|
|
|
StringBuilder sb = new StringBuilder();
|
|
@@ -530,7 +560,7 @@ public class ProEconTestingPointServiceImpl extends ServiceImpl<ProEconTestingPo
|
|
|
|
|
|
po.setWindpowerstationId(String.valueOf(tempsb));
|
|
|
po.setUniformCode(stp.getUniformCode());
|
|
|
-
|
|
|
+ po.setTypeId(stp.getTypeId());
|
|
|
sb = new StringBuilder();
|
|
|
sb.append(re.getNemCode()).append(".JSFW");
|
|
|
po.setRealtimeId(String.valueOf(sb));
|
|
@@ -548,9 +578,17 @@ public class ProEconTestingPointServiceImpl extends ServiceImpl<ProEconTestingPo
|
|
|
/********************************************区域公司测点**************************************************/
|
|
|
points = new ArrayList<>();
|
|
|
for (int i = 0; i < pointls.size(); i++) {
|
|
|
+ ProEconTestingPoint stp = pointls.get(i);
|
|
|
+ List<ProBasicPowerstation> groupFCCompany = CacheContext.wpmapGroupFCCompany.get(cs.getId());
|
|
|
+ if((null == groupFCCompany || groupFCCompany.size()<=0) && stp.getTypeId().equals(FCJSFW) ){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
|
|
|
+ List<ProBasicPowerstation> groupGCCompany = CacheContext.wpmapGroupGCCompany.get(cs.getId());
|
|
|
+ if((null == groupGCCompany || groupGCCompany.size()<=0) && stp.getTypeId().equals(GCJSFW) ){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
|
|
|
- ProEconTestingPoint stp = pointls.get(i);
|
|
|
StringBuilder sb = new StringBuilder();
|
|
|
StringBuilder sbtable = new StringBuilder();
|
|
|
sbtable.append(re.getId().substring(0, re.getId().indexOf("_")));
|
|
@@ -583,7 +621,7 @@ public class ProEconTestingPointServiceImpl extends ServiceImpl<ProEconTestingPo
|
|
|
|
|
|
po.setWindpowerstationId(String.valueOf(tempsb));
|
|
|
po.setUniformCode(stp.getUniformCode());
|
|
|
-
|
|
|
+ po.setTypeId(stp.getTypeId());
|
|
|
sb = new StringBuilder();
|
|
|
sb.append(cs.getId()).append(".JSFW");
|
|
|
po.setRealtimeId(String.valueOf(sb));
|
|
@@ -603,6 +641,10 @@ public class ProEconTestingPointServiceImpl extends ServiceImpl<ProEconTestingPo
|
|
|
sba.append(cs.getId().substring(0, cs.getId().lastIndexOf("_"))).append("_");
|
|
|
for (int i = 0; i < fdpointls.size(); i++) {
|
|
|
|
|
|
+ List<ProBasicPowerstation> groupFCCompany = CacheContext.wpmapGroupFCCompany.get(cs.getId());
|
|
|
+ if(null == groupFCCompany || groupFCCompany.size()<=0){
|
|
|
+ break;
|
|
|
+ }
|
|
|
ProEconTestingPoint stp = fdpointls.get(i);
|
|
|
StringBuilder sb = new StringBuilder();
|
|
|
StringBuilder sbtable = new StringBuilder();
|
|
@@ -633,7 +675,7 @@ public class ProEconTestingPointServiceImpl extends ServiceImpl<ProEconTestingPo
|
|
|
}
|
|
|
po.setWindpowerstationId(String.valueOf(tempsb));
|
|
|
po.setUniformCode(stp.getUniformCode());
|
|
|
-
|
|
|
+ po.setTypeId(stp.getTypeId());
|
|
|
sb = new StringBuilder();
|
|
|
sb.append(cs.getId()).append(".JSFW");
|
|
|
po.setRealtimeId(String.valueOf(sb));
|
|
@@ -654,6 +696,10 @@ public class ProEconTestingPointServiceImpl extends ServiceImpl<ProEconTestingPo
|
|
|
points = new ArrayList<>();
|
|
|
for (int i = 0; i < gfpointls.size(); i++) {
|
|
|
|
|
|
+ List<ProBasicPowerstation> groupGCCompany = CacheContext.wpmapGroupGCCompany.get(cs.getId());
|
|
|
+ if(null == groupGCCompany || groupGCCompany.size()<=0){
|
|
|
+ break;
|
|
|
+ }
|
|
|
ProEconTestingPoint stp = gfpointls.get(i);
|
|
|
StringBuilder sb = new StringBuilder();
|
|
|
StringBuilder sbtable = new StringBuilder();
|
|
@@ -685,7 +731,7 @@ public class ProEconTestingPointServiceImpl extends ServiceImpl<ProEconTestingPo
|
|
|
|
|
|
po.setWindpowerstationId(String.valueOf(tempsb));
|
|
|
po.setUniformCode(stp.getUniformCode());
|
|
|
-
|
|
|
+ po.setTypeId(stp.getTypeId());
|
|
|
sb = new StringBuilder();
|
|
|
sb.append(cs.getId()).append(".JSFW");
|
|
|
po.setRealtimeId(String.valueOf(sb));
|
|
@@ -776,7 +822,7 @@ public class ProEconTestingPointServiceImpl extends ServiceImpl<ProEconTestingPo
|
|
|
po.setModelId(null);
|
|
|
po.setWindpowerstationId(wp.getId());
|
|
|
po.setUniformCode(stp.getUniformCode());
|
|
|
-
|
|
|
+ po.setTypeId(stp.getTypeId());
|
|
|
|
|
|
sb = new StringBuilder();
|
|
|
|
|
@@ -858,7 +904,7 @@ public class ProEconTestingPointServiceImpl extends ServiceImpl<ProEconTestingPo
|
|
|
po.setModelId(null);
|
|
|
po.setWindpowerstationId(pj.getId());
|
|
|
po.setUniformCode(stp.getUniformCode());
|
|
|
-
|
|
|
+ po.setTypeId(stp.getTypeId());
|
|
|
sb = new StringBuilder();
|
|
|
|
|
|
if (StringUtils.notEmp(wp.getPhoto())) {
|
|
@@ -946,7 +992,7 @@ public class ProEconTestingPointServiceImpl extends ServiceImpl<ProEconTestingPo
|
|
|
po.setModelId(null);
|
|
|
po.setWindpowerstationId(ln.getId());
|
|
|
po.setUniformCode(stp.getUniformCode());
|
|
|
-
|
|
|
+ po.setTypeId(stp.getTypeId());
|
|
|
sb = new StringBuilder();
|
|
|
|
|
|
if (StringUtils.notEmp(wp.getPhoto())) {
|
|
@@ -968,4 +1014,5 @@ public class ProEconTestingPointServiceImpl extends ServiceImpl<ProEconTestingPo
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
}
|