| | |
| | | |
| | | import com.iailab.framework.common.pojo.PageResult; |
| | | import com.iailab.framework.common.service.impl.BaseServiceImpl; |
| | | import com.iailab.framework.mybatis.core.query.LambdaQueryWrapperX; |
| | | import com.iailab.framework.mybatis.core.query.QueryWrapperX; |
| | | import com.iailab.module.data.api.point.DataPointApiImpl; |
| | | import com.iailab.module.data.api.point.dto.ApiPointValueDTO; |
| | | import com.iailab.module.data.api.point.dto.ApiPointValueQueryDTO; |
| | |
| | | arcDataEntity.setArcTime(arcTime); |
| | | arcDataEntity.setArcId(item.getId()); |
| | | arcDataEntity.setArcValue(value); |
| | | arcDataDao.delete(new LambdaQueryWrapperX<ArcDataEntity>() |
| | | .eq(ArcDataEntity::getArcId, arcDataEntity.getArcId()) |
| | | .eq(ArcDataEntity::getArcTime, arcDataEntity.getArcId()) |
| | | ); |
| | | insert(arcDataEntity); |
| | | log.debug("归档完成,point:"+item.getPoint()); |
| | | }); |
| | |
| | | arcDataEntity.setArcTime(arcTime); |
| | | arcDataEntity.setArcId(item.getId()); |
| | | arcDataEntity.setArcValue(value); |
| | | arcDataDao.delete(new LambdaQueryWrapperX<ArcDataEntity>() |
| | | .eq(ArcDataEntity::getArcId, arcDataEntity.getArcId()) |
| | | .eq(ArcDataEntity::getArcTime, arcDataEntity.getArcId()) |
| | | ); |
| | | insert(arcDataEntity); |
| | | log.debug("归档完成,point:"+item.getPoint()); |
| | | }); |
| | |
| | | arcDataEntity.setArcTime(arcTime); |
| | | arcDataEntity.setArcId(item.getId()); |
| | | arcDataEntity.setArcValue(value); |
| | | arcDataEntity.setCode(item.getCode()); |
| | | arcDataEntity.setCreateTime(new Date()); |
| | | arcDataDao.delete(new LambdaQueryWrapperX<ArcDataEntity>() |
| | | .eq(ArcDataEntity::getArcId, arcDataEntity.getArcId()) |
| | | .eq(ArcDataEntity::getArcTime, arcDataEntity.getArcId()) |
| | | ); |
| | | insert(arcDataEntity); |
| | | log.debug("归档完成,point:"+item.getPoint()); |
| | | }); |
| | |
| | | arcDataEntity.setArcTime(arcTime); |
| | | arcDataEntity.setArcId(item.getId()); |
| | | arcDataEntity.setArcValue(value); |
| | | arcDataEntity.setCode(item.getCode()); |
| | | arcDataEntity.setCreateTime(new Date()); |
| | | arcDataDao.delete(new LambdaQueryWrapperX<ArcDataEntity>() |
| | | .eq(ArcDataEntity::getArcId, arcDataEntity.getArcId()) |
| | | .eq(ArcDataEntity::getArcTime, arcDataEntity.getArcId()) |
| | | ); |
| | | insert(arcDataEntity); |
| | | log.debug("归档完成,point:"+item.getPoint()); |
| | | }); |
| | |
| | | arcDataEntity.setArcTime(arcTime); |
| | | arcDataEntity.setArcId(item.getId()); |
| | | arcDataEntity.setArcValue(value); |
| | | arcDataEntity.setCode(item.getCode()); |
| | | arcDataEntity.setCreateTime(new Date()); |
| | | arcDataDao.delete(new LambdaQueryWrapperX<ArcDataEntity>() |
| | | .eq(ArcDataEntity::getArcId, arcDataEntity.getArcId()) |
| | | .eq(ArcDataEntity::getArcTime, arcDataEntity.getArcId()) |
| | | ); |
| | | insert(arcDataEntity); |
| | | log.debug("归档完成,point:"+item.getPoint()); |
| | | }); |
| | |
| | | BigDecimal prev = BigDecimal.valueOf(valueList.get(0).getV()); |
| | | for (int i = 1; i < valueList.size(); i++) { |
| | | BigDecimal curr = BigDecimal.valueOf(valueList.get(i).getV()); |
| | | value = value.add(curr.subtract(prev)); |
| | | if(curr.compareTo(prev) > 0) { |
| | | value = value.add(curr.subtract(prev)); |
| | | } |
| | | prev = curr; |
| | | } |
| | | break; |