| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.iailab.framework.common.util.date.DateUtils; |
| | | import com.iailab.framework.common.util.object.ConvertUtils; |
| | | import com.iailab.module.ansteel.api.dao.*; |
| | | import com.iailab.module.ansteel.api.dao.MainProcessIndexDayDao; |
| | | import com.iailab.module.ansteel.api.dao.MainProcessIndexTeamDao; |
| | | import com.iailab.module.ansteel.api.dto.*; |
| | | import com.iailab.module.ansteel.api.service.DataService; |
| | | import com.iailab.module.ansteel.common.constant.CommonConstant; |
| | | import com.iailab.module.ansteel.common.enums.ProcessConfDataTypeEnum; |
| | | import com.iailab.module.ansteel.power.dao.*; |
| | | import com.iailab.module.ansteel.power.entity.PowerCapacitorStatusEntity; |
| | | import com.iailab.module.ansteel.power.entity.PowerControlDetEntity; |
| | | import com.iailab.module.ansteel.power.entity.PowerControlMainEntity; |
| | | import com.iailab.module.ansteel.power.entity.PowerNetFactorEntity; |
| | | import com.iailab.module.ansteel.api.service.DataService; |
| | | import com.iailab.module.ansteel.common.constant.CommonConstant; |
| | | import com.iailab.module.data.api.ind.IndItemApi; |
| | | import com.iailab.module.data.api.ind.dto.ApiIndItemQueryDTO; |
| | | import com.iailab.module.data.api.ind.dto.ApiIndItemValueDTO; |
| | |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.*; |
| | | import java.util.concurrent.atomic.AtomicReference; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import static com.iailab.framework.common.pojo.CommonResult.success; |
| | | |
| | | @Slf4j |
| | | @Service |
| | |
| | | int lengthRight = tMap.get(CommonConstant.LENGTH_RIGHT) == null ? predictItem.getPredictLength() : new BigDecimal(tMap.get(CommonConstant.LENGTH_RIGHT)).intValue(); |
| | | String trendsDataH = tMap.get(CommonConstant.TRENDSDATA_H) == null ? null : tMap.get(CommonConstant.TRENDSDATA_H); |
| | | String trendsDataL = tMap.get(CommonConstant.TRENDSDATA_L) == null ? null : tMap.get(CommonConstant.TRENDSDATA_L); |
| | | String culIndex = tMap.get(CommonConstant.CUL_INDEX) == null ? null : tMap.get(CommonConstant.CUL_INDEX);//累计量 |
| | | |
| | | Date[] timeArray = calResultTime(predictItem, reqVO.getStartTime(), reqVO.getEndTime(), lengthLeft, lengthRight); |
| | | Date startTime = timeArray[1]; |
| | |
| | | preDataView.setTrendsDataL(newList); |
| | | } |
| | | |
| | | List<Object[]> culData = new ArrayList<>(); |
| | | double leiji = 0; |
| | | if (StringUtils.isNotBlank(culIndex) && !CollectionUtils.isEmpty(preDataView.getCurData())) { |
| | | for(int i = 0; i < preDataView.getCurData().size(); i++) { |
| | | Object[] item = preDataView.getCurData().get(i); |
| | | Object[] dataItem = new Object[2]; |
| | | dataItem[0] = item[0]; |
| | | leiji = leiji + new BigDecimal(item[1].toString()).doubleValue(); |
| | | dataItem[1] = new BigDecimal(leiji).divide(new BigDecimal(60), 2, BigDecimal.ROUND_HALF_UP) ; |
| | | culData.add(dataItem); |
| | | } |
| | | } |
| | | preDataView.setCulData(culData); |
| | | preDataView.setPreData(resultOld.getDataView().getPreDataL()); |
| | | result.setPreDataView(preDataView); |
| | | return result; |
| | |
| | | } |
| | | result.put("planData", planData); |
| | | result.put("predData", predData); |
| | | result.put("predictTime", DateUtils.format(predictTime, "yyyy-MM-dd HH:mm:00")); |
| | | result.put("startTime", DateUtils.format(startTime, "yyyy-MM-dd HH:mm:00")); |
| | | result.put("endTime", DateUtils.format(endTime, "yyyy-MM-dd HH:mm:00")); |
| | | return result; |
| | | } |
| | | |
| | |
| | | calendar.set(Calendar.MILLISECOND, 0); |
| | | if (!params.containsKey("endTime") || StringUtils.isBlank(params.get("endTime").toString())) { |
| | | endTime = calendar.getTime(); |
| | | }else { |
| | | endTime = DateUtils.parse(params.get("endTime").toString(),DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND); |
| | | } else { |
| | | endTime = DateUtils.parse(params.get("endTime").toString(), DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND); |
| | | } |
| | | if (!params.containsKey("startTime") || StringUtils.isBlank(params.get("startTime").toString())) { |
| | | calendar.add(Calendar.DAY_OF_YEAR, -1); |
| | | startTime = calendar.getTime(); |
| | | }else { |
| | | startTime = DateUtils.parse(params.get("startTime").toString(),DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND); |
| | | } else { |
| | | startTime = DateUtils.parse(params.get("startTime").toString(), DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND); |
| | | } |
| | | |
| | | switch (ProcessConfDataTypeEnum.getEumByCode(dataType)) { |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<PreDataViewDTO> getPreDataByOutIds(PreDataBarLineReqVO reqVO) { |
| | | public List<PreDataViewSimpleDTO> getPreDataByOutIds(PreDataBarLineReqVO reqVO) { |
| | | PreDataBarLineRespVO preDataBarLineRespVO = mcsApi.getPreDataCharts(reqVO); |
| | | List<PreDataViewDTO> preDataViewDTOList = new ArrayList<>(); |
| | | List<PreDataViewSimpleDTO> preDataViewSimpleDTOList = new ArrayList<>(); |
| | | preDataBarLineRespVO.getDataViewList().forEach(item -> { |
| | | PreDataViewDTO dataViewDTO = new PreDataViewDTO(); |
| | | dataViewDTO.setCurData(item.getCurData()); |
| | | dataViewDTO.setRealData(item.getRealData()); |
| | | dataViewDTO.setPredictTime(item.getPredictTime()); |
| | | preDataViewDTOList.add(dataViewDTO); |
| | | PreDataViewSimpleDTO preDataViewSimpleDTO = new PreDataViewSimpleDTO(); |
| | | preDataViewSimpleDTO.setItemName(item.getResultName()); |
| | | preDataViewSimpleDTO.setPredictTime(preDataBarLineRespVO.getPredictTime()); |
| | | preDataViewSimpleDTO.setCurData(item.getCurData()); |
| | | preDataViewSimpleDTO.setRealData(item.getRealData()); |
| | | preDataViewSimpleDTOList.add(preDataViewSimpleDTO); |
| | | }); |
| | | return preDataViewDTOList; |
| | | return preDataViewSimpleDTOList; |
| | | } |
| | | } |