| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724 |
- package com.gyee.generation.service;//package com.gyee.generation.service;
- import com.gyee.common.contant.ContantXk;
- import com.gyee.common.model.PointData;
- import com.gyee.common.model.StringUtils;
- import com.gyee.generation.init.CacheContext;
- import com.gyee.generation.model.auto.ProBasicEquipment;
- import com.gyee.generation.model.auto.ProBasicEquipmentPoint;
- import com.gyee.generation.model.auto.ProEconEquipmentInfoDay3;
- import com.gyee.generation.service.auto.IProEconEquipmentInfoDay3Service;
- import com.gyee.generation.util.DateUtils;
- import com.gyee.generation.util.realtimesource.IEdosUtil;
- import com.gyee.generation.util.statisticcs.Initial;
- import org.springframework.stereotype.Service;
- import javax.annotation.Resource;
- import java.util.*;
- import java.util.stream.Collectors;
- @Service
- public class EquipmentInfo3Service {
- // private static final Logger logger = LoggerFactory.getLogger(WindPowerInfo2Service.class);
- @Resource
- private IEdosUtil edosUtil;
- @Resource
- private IProEconEquipmentInfoDay3Service proEconEquipmentInfoDay3Service;
- /**
- * 计算设备日信息
- */
- public void calEquipmentInfoDay(Date recordDate) throws Exception {
- Calendar c=Calendar.getInstance();
- c.setTime(recordDate);
- Date end=c.getTime();
- Date begin= DateUtils.truncDay(c.getTime());
- //判断是否有重复记录,先删除重复记录
- List<String> idls = proEconEquipmentInfoDay3Service.list().stream()
- .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
- && CacheContext.wtmap.containsKey(i.getWindturbineId())
- ).map(ProEconEquipmentInfoDay3::getId)
- .collect(Collectors.toList());
- if (idls.size() > 0) {
- proEconEquipmentInfoDay3Service.removeByIds(idls);
- }
- for(ProBasicEquipment wt:CacheContext.wtls)
- {
- if(CacheContext.wtpAimap.containsKey(wt.getId()))
- {
- ProEconEquipmentInfoDay3 pewp=new ProEconEquipmentInfoDay3();
- Initial.initial(pewp);
- pewp.setCompanyId(wt.getCompanyId());
- pewp.setWindpowerstationId(wt.getWindpowerstationId());
- pewp.setLineId(wt.getLineId());
- pewp.setProjectId(wt.getProjectId());
- pewp.setRegionId(wt.getRegionId());
- pewp.setRecordDate(DateUtils.truncDay(recordDate));
- //昨日的统计结果
- List<ProEconEquipmentInfoDay3> pepidls =new ArrayList<>();
- Calendar cl=Calendar.getInstance();
- cl.setTime(recordDate);
- cl.add(Calendar.DAY_OF_MONTH,-1);
- if(cl.get(Calendar.DAY_OF_MONTH)!=1)
- {
- pepidls = proEconEquipmentInfoDay3Service.list().stream()
- .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(cl.getTime())) == 0
- && i.getWindturbineId().equals(wt.getId())
- )
- .collect(Collectors.toList());
- }
- calDetiall( pewp, end, begin,wt,pepidls);
- calSimple( pewp, end, begin, wt,pepidls);
- proEconEquipmentInfoDay3Service.save(pewp);
- }
- }
- }
- private void calDetiall(ProEconEquipmentInfoDay3 pewp, Date end, Date begin, ProBasicEquipment wt, List<ProEconEquipmentInfoDay3> pepidls) throws Exception {
- // // 0 待机
- // 1 手动停机
- // 2 正常发电
- // 3 发电降出力
- // 4 故障
- // 5 故障受累
- // 6 检修
- // 7 检修受累
- // 8 限电降出力
- // 9 限电停机
- // 10 电网受累
- // 11 环境受累
- // 12 通讯中断
- // 13 设备离线
- double lastState;//上一分钟状态
- double djcs=0;//待机时长
- double sdtjcs=0;//手动停机时长
- double zcfdcs=0;//正常发电时长
- double fdjclcs=0;//发电降出力时长
- double gzcs=0;//故障时长
- double gzslcs=0;//故障受累时长
- double jxcs=0;//检修时长
- double jxslcs=0;//检修受累时长
- double xdjclcs=0;//限电降出力时长
- double xdtjcs=0;//限电停机时长
- double dwslcs=0;//电网受累时长
- double hjslcs=0;//环境受累时长
- double txzdcs=0;//通讯中断时长
- double sblxcs=0;//设备离线时长
- Map<String, Map<String, ProBasicEquipmentPoint>> wtpAimap = CacheContext.wtpAimap;
- lastState=-1;//上一分钟状态
- Map<String, ProBasicEquipmentPoint> aimap=wtpAimap.get(wt.getId());
- if(aimap.containsKey(ContantXk.MXZT))
- {
- ProBasicEquipmentPoint point=aimap.get(ContantXk.MXZT);
- //按照分钟时间进行统计状态快照值
- List<PointData> pointls=edosUtil.getHistoryDatasSnap(point.getNemCode(), begin.getTime()/1000, end.getTime()/1000);
- if(!pointls.isEmpty())
- {
- for(PointData po :pointls)
- {
- if(po.getPointValueInDouble()==0)
- {
- if(lastState!=po.getPointValueInDouble())
- {
- //将当前状态保存到上一分钟状态
- lastState=po.getPointValueInDouble();
- //待机时长加1
- djcs++;
- }
- }else if(po.getPointValueInDouble()==1)
- {
- if(lastState!=po.getPointValueInDouble())
- {
- //将当前状态保存到上一分钟状态
- lastState=po.getPointValueInDouble();
- //手动停机时长加1
- sdtjcs++;
- }
- }else if(po.getPointValueInDouble()==2)
- {
- if(lastState!=po.getPointValueInDouble())
- {
- //将当前状态保存到上一分钟状态
- lastState=po.getPointValueInDouble();
- //正常发电时长加1
- zcfdcs++;
- }
- }else if(po.getPointValueInDouble()==3)
- {
- if(lastState!=po.getPointValueInDouble())
- {
- //将当前状态保存到上一分钟状态
- lastState=po.getPointValueInDouble();
- //发电降出力时长加1
- fdjclcs++;
- }
- }else if(po.getPointValueInDouble()==4)
- {
- if(lastState!=po.getPointValueInDouble())
- {
- //将当前状态保存到上一分钟状态
- lastState=po.getPointValueInDouble();
- //故障时长加1
- gzcs++;
- }
- }else if(po.getPointValueInDouble()==5)
- {
- if(lastState!=po.getPointValueInDouble())
- {
- //将当前状态保存到上一分钟状态
- lastState=po.getPointValueInDouble();
- //故障受累时长加1
- gzslcs++;
- }
- }else if(po.getPointValueInDouble()==6)
- {
- if(lastState!=po.getPointValueInDouble())
- {
- //将当前状态保存到上一分钟状态
- lastState=po.getPointValueInDouble();
- //检修时长加1
- jxcs++;
- }
- }else if(po.getPointValueInDouble()==7)
- {
- if(lastState!=po.getPointValueInDouble())
- {
- //将当前状态保存到上一分钟状态
- lastState=po.getPointValueInDouble();
- //检修受累时长加1
- jxslcs++;
- }
- }else if(po.getPointValueInDouble()==8)
- {
- if(lastState!=po.getPointValueInDouble())
- {
- //将当前状态保存到上一分钟状态
- lastState=po.getPointValueInDouble();
- //限电降出力时长加1
- xdjclcs++;
- }
- }else if(po.getPointValueInDouble()==9)
- {
- if(lastState!=po.getPointValueInDouble())
- {
- //将当前状态保存到上一分钟状态
- lastState=po.getPointValueInDouble();
- //限电停机时长加1
- xdtjcs++;
- }
- //限电停机时长加1
- xdtjcs++;
- }else if(po.getPointValueInDouble()==10)
- {
- if(lastState!=po.getPointValueInDouble())
- {
- //将当前状态保存到上一分钟状态
- lastState=po.getPointValueInDouble();
- //电网受累时长加1
- dwslcs++;
- }
- }else if(po.getPointValueInDouble()==11)
- {
- if(lastState!=po.getPointValueInDouble())
- {
- //将当前状态保存到上一分钟状态
- lastState=po.getPointValueInDouble();
- //环境受累时长加1
- hjslcs++;
- }
- }else if(po.getPointValueInDouble()==12)
- {
- if(lastState!=po.getPointValueInDouble())
- {
- //将当前状态保存到上一分钟状态
- lastState=po.getPointValueInDouble();
- //通讯中断时长加1
- txzdcs++;
- }
- }else if(po.getPointValueInDouble()==13)
- {
- if(lastState!=po.getPointValueInDouble())
- {
- //将当前状态保存到上一分钟状态
- lastState=po.getPointValueInDouble();
- //设备离线时长加1
- sblxcs++;
- }
-
- }
- }
- }
- }
-
- //日合计故障次数(明细)
- pewp.setRgzcsmx(gzcs);
- //日合计场内受累故障次数(明细)
- pewp.setRcnslgzcsmx(gzslcs);
- //日合计检修次数(明细)
- pewp.setRjxcsmx(jxcs);
- //日合计场内受累检修次数(明细)
- pewp.setRcnsljxcsmx(jxslcs);
- //日合计待机次数(明细)
- pewp.setRdjcsmx(djcs);
- //日合计缺陷降出力次数(明细)
- pewp.setRqxjclcsmx(fdjclcs);
- //日合计手动停机次数(明细)
- pewp.setRsdtjcsmx(sdtjcs);
- //日合计性能次数(明细)
- pewp.setRbwcsmx(zcfdcs);
- //日合计限电停机次数(明细)
- pewp.setRxdtjcsmx(xdtjcs);
- //日合计限电降出力次数(明细)
- pewp.setRxdjclcsmx(xdjclcs);
- //日合计场外受累电网次数(明细)
- pewp.setRcwsldwcsmx(dwslcs);
- //日合计场外受累电网次数(明细)
- pewp.setRcwsltqcsmx(hjslcs);
- //日合计通讯中断次数(明细)
- pewp.setRtxzdcsmx(txzdcs);
- //日合计离线次数(明细)
- pewp.setRlxcsmx(sblxcs);
- //*******************************************日信息统计*********************************************************/
- //*******************************************月信息统计*********************************************************/
- if(pepidls.isEmpty())
- {
- setLossHoursMonth(pewp);
- }else
- {
- ProEconEquipmentInfoDay3 pepid=pepidls.get(0);
- //月合计故障次数(明细)
- pewp.setYgzcsmx(StringUtils.round(pepid.getYgzcsmx()+pewp.getRgzcsmx(),2));
- //月合计场内受累故障次数(明细)
- pewp.setYcnslgzcsmx(StringUtils.round(pepid.getYcnslgzcsmx()+pewp.getRcnslgzcsmx(),2));
- //月合计检修次数(明细)
- pewp.setYjxcsmx(StringUtils.round(pepid.getYjxcsmx()+pewp.getRjxcsmx(),2));
- //月合计场内受累检修次数(明细)
- pewp.setYcnsljxcsmx(StringUtils.round( pepid.getYcnsljxcsmx()+pewp.getRcnsljxcsmx(),2));
- //月合计待机次数(明细)
- pewp.setYdjcsmx(StringUtils.round(pepid.getYdjcsmx()+pewp.getRdjcsmx(),2));
- //月合计缺陷降出力次数(明细)
- pewp.setYqxjclcsmx(StringUtils.round(pepid.getYqxjclcsmx()+pewp.getRqxjclcsmx(),2));
- //月合计手动停机次数(明细)
- pewp.setYsdtjcsmx(StringUtils.round(pepid.getYsdtjcsmx()+pewp.getRsdtjcsmx(),2));
- //月合计性能次数(明细)
- pewp.setYbwcsmx(StringUtils.round(pepid.getYbwcsmx()+pewp.getRbwcsmx(),2));
- //月合计限电停机次数(明细)
- pewp.setYxdtjcsmx(StringUtils.round(pepid.getYxdtjcsmx()+pewp.getRxdtjcsmx(),2));
- //月合计限电降出力次数(明细)
- pewp.setYxdjclcsmx(StringUtils.round(pepid.getYxdjclcsmx()+pewp.getRxdjclcsmx(),2));
- //月合计场外受累电网次数(明细)
- pewp.setYcwsldwcsmx(StringUtils.round(pepid.getYcwsldwcsmx()+pewp.getRcwsldwcsmx(),2));
- //月合计场外受累电网次数(明细)
- pewp.setYcwsltqcsmx(StringUtils.round(pepid.getYcwsltqcsmx()+pewp.getRcwsltqcsmx(),2));
- //月合计通讯中断次数(明细)
- pewp.setYtxzdcsmx(StringUtils.round(pepid.getYtxzdcsmx()+pewp.getRtxzdcsmx(),2));
- //月合计离线次数(明细)
- pewp.setYlxcsmx(StringUtils.round(pepid.getYlxcsmx()+pewp.getRlxcsmx(),2));
- }
- //*******************************************月信息统计*********************************************************/
- //*******************************************年信息统计*********************************************************/
- if(pepidls.isEmpty())
- {
- setLossHoursYear(pewp);
- }else
- {
- ProEconEquipmentInfoDay3 pepid=pepidls.get(0);
- //年合计故障次数(明细)
- pewp.setNgzcsmx(StringUtils.round(pepid.getNgzcsmx()+pewp.getRgzcsmx(),2));
- //年合计场内受累故障次数(明细)
- pewp.setNcnslgzcsmx(StringUtils.round(pepid.getNcnslgzcsmx()+pewp.getRcnslgzcsmx(),2));
- //年合计检修次数(明细)
- pewp.setNjxcsmx(StringUtils.round(pepid.getNjxcsmx()+pewp.getRjxcsmx(),2));
- //年合计场内受累检修次数(明细)
- pewp.setNcnsljxcsmx(StringUtils.round( pepid.getNcnsljxcsmx()+pewp.getRcnsljxcsmx(),2));
- //年合计待机次数(明细)
- pewp.setNdjcsmx(StringUtils.round(pepid.getNdjcsmx()+pewp.getRdjcsmx(),2));
- //年合计缺陷降出力次数(明细)
- pewp.setNqxjclcsmx(StringUtils.round(pepid.getNqxjclcsmx()+pewp.getRqxjclcsmx(),2));
- //年合计手动停机次数(明细)
- pewp.setNsdtjcsmx(StringUtils.round(pepid.getNsdtjcsmx()+pewp.getRsdtjcsmx(),2));
- //年合计性能次数(明细)
- pewp.setNbwcsmx(StringUtils.round(pepid.getNbwcsmx()+pewp.getRbwcsmx(),2));
- //年合计限电停机次数(明细)
- pewp.setNxdtjcsmx(StringUtils.round(pepid.getNxdtjcsmx()+pewp.getRxdtjcsmx(),2));
- //年合计限电降出力次数(明细)
- pewp.setNxdjclcsmx(StringUtils.round(pepid.getNxdjclcsmx()+pewp.getRxdjclcsmx(),2));
- //年合计场外受累电网次数(明细)
- pewp.setNcwsldwcsmx(StringUtils.round(pepid.getNcwsldwcsmx()+pewp.getRcwsldwcsmx(),2));
- //年合计场外受累电网次数(明细)
- pewp.setNcwsltqcsmx(StringUtils.round(pepid.getNcwsltqcsmx()+pewp.getRcwsltqcsmx(),2));
- //年合计通讯中断次数(明细)
- pewp.setNtxzdcsmx(StringUtils.round(pepid.getNtxzdcsmx()+pewp.getRtxzdcsmx(),2));
- //年合计离线次数(明细)
- pewp.setNlxcsmx(StringUtils.round(pepid.getNlxcsmx()+pewp.getRlxcsmx(),2));
- }
- }
- private static void setLossHoursYear(ProEconEquipmentInfoDay3 pewp) {
- //年合计故障次数(明细)
- pewp.setNgzcsmx(pewp.getRgzcsmx());
- //年合计场内受累故障次数(明细)
- pewp.setNcnslgzcsmx(pewp.getRcnslgzcsmx());
- //年合计检修次数(明细)
- pewp.setNjxcsmx(pewp.getRjxcsmx());
- //年合计场内受累检修次数(明细)
- pewp.setNcnsljxcsmx(pewp.getRcnsljxcsmx());
- //年合计待机次数(明细)
- pewp.setNdjcsmx(pewp.getRdjcsmx());
- //年合计缺陷降出力次数(明细)
- pewp.setNqxjclcsmx(pewp.getRqxjclcsmx());
- //年合计手动停机次数(明细)
- pewp.setNsdtjcsmx(pewp.getRsdtjcsmx());
- //年合计性能次数(明细)
- pewp.setNbwcsmx(pewp.getRbwcsmx());
- //年合计限电停机次数(明细)
- pewp.setNxdtjcsmx(pewp.getRxdtjcsmx());
- //年合计限电降出力次数(明细)
- pewp.setNxdjclcsmx(pewp.getRxdjclcsmx());
- //年合计场外受累电网次数(明细)
- pewp.setNcwsldwcsmx(pewp.getRcwsldwcsmx());
- //年合计场外受累电网次数(明细)
- pewp.setNcwsltqcsmx(pewp.getRcwsltqcsmx());
- //年合计通讯中断次数(明细)
- pewp.setNtxzdcsmx(pewp.getRtxzdcsmx());
- //年合计离线次数(明细)
- pewp.setNlxcsmx(pewp.getRlxcsmx());
- }
- private static void setLossHoursMonth(ProEconEquipmentInfoDay3 pewp) {
- //月合计故障次数(明细)
- pewp.setYgzcsmx(pewp.getRgzcsmx());
- //月合计场内受累故障次数(明细)
- pewp.setYcnslgzcsmx(pewp.getRcnslgzcsmx());
- //月合计检修次数(明细)
- pewp.setYjxcsmx(pewp.getRjxcsmx());
- //月合计场内受累检修次数(明细)
- pewp.setYcnsljxcsmx(pewp.getRcnsljxcsmx());
- //月合计待机次数(明细)
- pewp.setYdjcsmx(pewp.getRdjcsmx());
- //月合计缺陷降出力次数(明细)
- pewp.setYqxjclcsmx(pewp.getRqxjclcsmx());
- //月合计手动停机次数(明细)
- pewp.setYsdtjcsmx(pewp.getRsdtjcsmx());
- //月合计性能次数(明细)
- pewp.setYbwcsmx(pewp.getRbwcsmx());
- //月合计限电停机次数(明细)
- pewp.setYxdtjcsmx(pewp.getRxdtjcsmx());
- //月合计限电降出力次数(明细)
- pewp.setYxdjclcsmx(pewp.getRxdjclcsmx());
- //月合计场外受累电网次数(明细)
- pewp.setYcwsldwcsmx(pewp.getRcwsldwcsmx());
- //月合计场外受累电网次数(明细)
- pewp.setYcwsltqcsmx(pewp.getRcwsltqcsmx());
- //月合计通讯中断次数(明细)
- pewp.setYtxzdcsmx(pewp.getRtxzdcsmx());
- //月合计离线次数(明细)
- pewp.setYlxcsmx(pewp.getRlxcsmx());
- }
- private static void setLossHoursMonthSimple(ProEconEquipmentInfoDay3 pewp) {
- //月合计待机次数
- pewp.setYdjcs(pewp.getRdjcs());
- //月合计维护停机次数
- pewp.setYjxtjcs(pewp.getRjxtjcs());
- // 月合计故障停机次数
- pewp.setYgztjcs(pewp.getRgztjcs());
- //月合计运行次数
- pewp.setYyxcs(pewp.getRyxcs());
- //月合计限电次数
- pewp.setYxdcs(pewp.getRxdcs());
- //月合计通讯中断次数
- pewp.setYtxzdcs(pewp.getRtxzdcs());
- //月合计受累次数
- pewp.setYslcs(pewp.getRslcs());
- }
- private static void setLossHoursYearSimple(ProEconEquipmentInfoDay3 pewp) {
- //年合计待机次数
- pewp.setNdjcs(pewp.getRdjcs());
- //年合计维护停机次数
- pewp.setNjxtjcs(pewp.getRjxtjcs());
- // 年合计故障次数
- pewp.setNgztjcs(pewp.getRgztjcs());
- //年合计运行次数
- pewp.setNyxcs(pewp.getRyxcs());
- //年合计限电次数
- pewp.setNxdcs(pewp.getRxdcs());
- //年合计通讯中断次数
- pewp.setNtxzdcs(pewp.getRtxzdcs());
- //年合计受累次数
- pewp.setNslcs(pewp.getRslcs());
- }
- private void calSimple(ProEconEquipmentInfoDay3 pewp, Date end, Date begin, ProBasicEquipment wt, List<ProEconEquipmentInfoDay3> pepidls) throws Exception {
- // 0 待机
- // 1 运行
- // 2 故障
- // 3 检修
- // 4 限电
- // 5 受累
- // 6 离线
- //*******************************************日信息统计*********************************************************/
- double lastState=-1;//上一分钟状态
- double djcs=0;//待机时长
- double zcfdcs=0;//正常发电时长
- double gzcs=0;//故障时长
- double jxcs=0;//检修时长
- double xdtjcs=0;//限电停机时长
- double slsc=0;//受累时长
- double txzdcs=0;//通讯中断时长
- Map<String, Map<String, ProBasicEquipmentPoint>> wtpAimap = CacheContext.wtpAimap;
- Map<String, ProBasicEquipmentPoint> aimap=wtpAimap.get(wt.getId());
- if(aimap.containsKey(ContantXk.SBZT))
- {
- ProBasicEquipmentPoint point=aimap.get(ContantXk.SBZT);
- //按照分钟时间进行统计状态快照值
- List<PointData> pointls=edosUtil.getHistoryDatasSnap(point.getNemCode(), begin.getTime()/1000, end.getTime()/1000);
- if(!pointls.isEmpty()) {
- for (PointData po : pointls) {
- if (po.getPointValueInDouble() == 0) {
- if (lastState != po.getPointValueInDouble()) {
- //将当前状态保存到上一分钟状态
- lastState = po.getPointValueInDouble();
- //待机时长加1
- djcs++;
- }
- } else if (po.getPointValueInDouble() == 1) {
- if (lastState != po.getPointValueInDouble()) {
- //将当前状态保存到上一分钟状态
- lastState = po.getPointValueInDouble();
- //正常发电时长加1
- zcfdcs++;
- }
- } else if (po.getPointValueInDouble() == 2) {
- if (lastState != po.getPointValueInDouble()) {
- //将当前状态保存到上一分钟状态
- lastState = po.getPointValueInDouble();
- //故障时长加1
- gzcs++;
- }
- } else if (po.getPointValueInDouble() == 3) {
- if (lastState != po.getPointValueInDouble()) {
- //将当前状态保存到上一分钟状态
- lastState = po.getPointValueInDouble();
- //检修时长加1
- jxcs++;
- }
- } else if (po.getPointValueInDouble() == 4) {
- if (lastState != po.getPointValueInDouble()) {
- //将当前状态保存到上一分钟状态
- lastState = po.getPointValueInDouble();
- //限电停机时长加1
- xdtjcs++;
- }
- } else if (po.getPointValueInDouble() == 5) {
- if (lastState != po.getPointValueInDouble()) {
- //将当前状态保存到上一分钟状态
- lastState = po.getPointValueInDouble();
- //受累时长加1
- slsc++;
- }
- } else if (po.getPointValueInDouble() == 6) {
- if (lastState != po.getPointValueInDouble()) {
- //将当前状态保存到上一分钟状态
- lastState = po.getPointValueInDouble();
- //通讯中断时长加1
- txzdcs++;
- }
- }
- }
- }
- }
-
- //日合计待机次数
- pewp.setRdjcs(gzcs);
- //日合计维护停机次数
- pewp.setRjxtjcs(jxcs);
- // 日合计待机次数
- pewp.setRdjcs(djcs);
- //日合计运行次数
- pewp.setRyxcs(zcfdcs);
- //日合计限电次数
- pewp.setRxdcs(xdtjcs);
- //日合计通讯中断次数
- pewp.setRtxzdcs(txzdcs);
- //日合计受累次数
- pewp.setRslcs(slsc);
- //*******************************************日信息统计*********************************************************/
- //*******************************************月信息统计*********************************************************/
- if(pepidls.isEmpty())
- {
- setLossHoursMonthSimple(pewp);
- }else
- {
- ProEconEquipmentInfoDay3 pepid=pepidls.get(0);
- //月合计待机次数
- pewp.setYdjcs(StringUtils.round(pepid.getYdjcs()+pewp.getRdjcs(),2));
- //月合计维护停机次数
- pewp.setYjxtjcs(StringUtils.round(pepid.getYjxtjcs()+pewp.getRjxtjcs(),2));
- // 月合计故障次数
- pewp.setYgztjcs(StringUtils.round(pepid.getYgztjcs()+pewp.getRgztjcs(),2));
- //月合计运行次数
- pewp.setYyxcs(StringUtils.round(pepid.getYyxcs()+pewp.getRyxcs(),2));
- //月合计限电次数
- pewp.setYxdcs(StringUtils.round(pepid.getYxdcs()+pewp.getRxdcs(),2));
- //月合计通讯中断次数
- pewp.setYtxzdcs(StringUtils.round(pepid.getYtxzdcs()+pewp.getRtxzdcs(),2));
- //月合计受累次数
- pewp.setYslcs(StringUtils.round(pepid.getYslcs()+pewp.getRslcs(),2));
- }
- //*******************************************月信息统计*********************************************************/
- //*******************************************年信息统计*********************************************************/
- if(pepidls.isEmpty())
- {
- setLossHoursYearSimple(pewp);
- }else
- {
- ProEconEquipmentInfoDay3 pepid=pepidls.get(0);
- //年合计待机次数
- pewp.setNdjcs(StringUtils.round(pepid.getNdjcs()+pewp.getRdjcs(),2));
- //年合计维护停机次数
- pewp.setNjxtjcs(StringUtils.round(pepid.getNjxtjcs()+pewp.getRjxtjcs(),2));
- // 年合计故障次数
- pewp.setNgztjcs(StringUtils.round(pepid.getNgztjcs()+pewp.getRgztjcs(),2));
- //年合计运行次数
- pewp.setNyxcs(StringUtils.round(pepid.getNyxcs()+pewp.getRyxcs(),2));
- //年合计限电次数
- pewp.setNxdcs(StringUtils.round(pepid.getNxdcs()+pewp.getRxdcs(),2));
- //年合计通讯中断次数
- pewp.setNtxzdcs(StringUtils.round(pepid.getNtxzdcs()+pewp.getRtxzdcs(),2));
- //年合计受累次数
- pewp.setNslcs(StringUtils.round(pepid.getNslcs()+pewp.getRslcs(),2));
- }
- //*******************************************年信息统计*********************************************************/
- }
- }
|