Browse Source

Merge remote-tracking branch 'origin/master'

zhongwei
tyty 2 years ago
parent
commit
3433dc3ba3
  1. 4
      hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/plan/vo/PlanListQueryVO.java
  2. 3
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/mapper/InspectObjectMapper.xml
  3. 4
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/vo/ContentListQueryVO.java
  4. 4
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/vo/ProjectListQueryVO.java
  5. 4
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/vo/TemplateListQueryVO.java
  6. 3
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/plan/controller/PlanController.java
  7. 2
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/controller/TaskController.java
  8. 3
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/mapper/TaskMapper.xml
  9. 5
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/vo/TaskListQuery.java
  10. 3
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessStatisticsMapper.xml
  11. 3
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/HistoryAbnormalAlarmServiceImpl.java
  12. 3
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/controller/OperDefectController.java
  13. 4
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/controller/OperDefectStatisticsController.java
  14. 3
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/controller/OperPhenomenonController.java
  15. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/mapper/MainWorkBenchMapper.xml
  16. 57
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HydropowerServiceImpl.java
  17. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/MainWorkBenchServiceImpl.java
  18. 41
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/PhotovoltaicServiceImpl.java
  19. 16
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/WaterServiceImpl.java
  20. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/RealMonitorServiceImpl.java
  21. 1
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/StandardTicketInfoServiceImpl.java
  22. 1
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketInfoServiceImpl.java

4
hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/plan/vo/PlanListQueryVO.java

@ -86,4 +86,8 @@ public class PlanListQueryVO implements Serializable {
@ApiModelProperty("业务状态 0:待审核-->1:已审核-->2:派发中-->3:暂停-->4:结束-->5审核不通过-->6待提交")
@QueryField(condition = SqlCondition.EQUAL)
private Integer status;
@ApiModelProperty("创建机构")
@QueryField(condition = SqlCondition.EQUAL)
private Long createDept;
}

3
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/mapper/InspectObjectMapper.xml

@ -28,6 +28,9 @@
<if test="obj.tenantId != null and obj.tenantId != ''">
and OBJ.`TENANT_ID` = #{obj.tenantId}
</if>
<if test="obj.createDept != null">
and OBJ.`CREATE_DEPT` = #{obj.createDept}
</if>
ORDER BY OBJ.UPDATE_TIME DESC
</select>

4
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/vo/ContentListQueryVO.java

@ -67,4 +67,8 @@ public class ContentListQueryVO implements Serializable {
@QueryField(condition = SqlCondition.EQUAL)
@ApiModelProperty(value = "支持的巡检类型 0普通巡检,1视频自动巡检,2机器人巡检")
private Integer supportAutoVideo;
@QueryField(condition = SqlCondition.EQUAL)
@ApiModelProperty(value = "创建机构")
private Long createDept;
}

4
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/vo/ProjectListQueryVO.java

@ -51,4 +51,8 @@ public class ProjectListQueryVO implements Serializable {
@ApiModelProperty(value = " inspectType 支持的巡检类型 0普通巡检,1视频自动巡检,2机器人巡检")
private String supportAutoVideo;
@QueryField(condition = SqlCondition.EQUAL)
@ApiModelProperty(value = "创建机构")
private Long createDept;
}

4
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/vo/TemplateListQueryVO.java

@ -51,5 +51,7 @@ public class TemplateListQueryVO implements Serializable {
@ApiModelProperty(value = "是否支持视频自动巡检")
private Integer supportAutoVideo;
@QueryField(condition = SqlCondition.EQUAL)
@ApiModelProperty(value = "创建机构")
private Long createDept;
}

3
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/plan/controller/PlanController.java

@ -80,6 +80,9 @@ public class PlanController extends BladeController {
if(plan.getStatus()==null){
queryWrapper.ne(PlanEntity::getStatus, PlanContants.PlanStatusEnum.PLAN_AUTH.getStatus());
}
if(plan.getCreateDept()!=null){
queryWrapper.eq(PlanEntity::getCreateDept,plan.getCreateDept());
}
queryWrapper.orderByDesc(PlanEntity::getUpdateTime);
IPage<PlanEntity> pages = planService.page(Condition.getPage(query), (!bladeUser.getTenantId().equals(BladeConstant.ADMIN_TENANT_ID)) ? queryWrapper.eq(PlanEntity::getTenantId, bladeUser.getTenantId()) : queryWrapper);
return R.data(pages);

2
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/controller/TaskController.java

@ -113,7 +113,7 @@ public class TaskController extends BladeController {
task.setCurUserId(AuthUtil.getUserId());
task.setTenantId(AuthUtil.getTenantId());
}
if (task.getCurUserId().longValue() == -1) {
if (task.getCurUserId() == -1) {
task.setCurUserId(null);
}
List<TaskVo> list = taskService.getListPage(pages,task);

3
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/mapper/TaskMapper.xml

@ -74,6 +74,9 @@
<if test="task.autoVideo != null">
and t.AUTO_VIDEO=#{task.autoVideo}
</if>
<if test="task.createDept != null">
and t.CREATE_DEPT=#{task.createDept}
</if>
order by t.UPDATE_TIME desc
</select>

5
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/vo/TaskListQuery.java

@ -126,5 +126,8 @@ public class TaskListQuery implements Serializable {
*/
private String areaId;
/**
* 创建机构
*/
private Long createDept;
}

3
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessStatisticsMapper.xml

@ -40,6 +40,9 @@
<if test="dto.areaId != null and dto.areaId != ''">
and OT.CREATE_DEPT = #{dto.areaId}
</if>
<if test="dto.createDept != null and dto.createDept != ''">
and OT.CREATE_DEPT = #{dto.createDept}
</if>
<if test="dto.yearMonth != null">
and date_format(OT.PLAN_START_TIME,'%Y-%m') = #{dto.yearMonth}
</if>

3
hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/HistoryAbnormalAlarmServiceImpl.java

@ -23,7 +23,6 @@ import com.hnac.hzinfo.datasearch.soe.domian.SoeData;
import com.hnac.hzinfo.datasearch.soe.domian.SoeQueryConditionByStation;
import com.hnac.hzinfo.sdk.core.response.HzPage;
import com.hnac.hzinfo.sdk.core.response.Result;
import com.hnac.hzinfo.sdk.v5.soe.SoeClient;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import net.logstash.logback.encoder.org.apache.commons.lang3.ObjectUtils;
@ -352,7 +351,7 @@ public class HistoryAbnormalAlarmServiceImpl extends BaseServiceImpl<HistoryAbno
Result<HzPage<SoeData>> result = alarmClient.getByStationsAndTime(condition);
IPage<AlarmVo> page = Condition.getPage(query);
if(result.isSuccess() && ObjectUtil.isNotEmpty(result)){
// 步骤3.TODO 过滤完成告警处理数据
// 步骤3.过滤完成告警处理数据
List<AlarmVo> alarms = result.getData().getRecords().stream().map(record ->{
AlarmVo alarm = new AlarmVo();
alarm.setId(record.getId());

3
hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/controller/OperDefectController.java

@ -85,6 +85,9 @@ public class OperDefectController extends BladeController {
if (defect.getEndTime() != null) {
queryWrapper.le(OperDefectEntity::getCreateTime, defect.getEndTime());
}
if (defect.getCreateDept() != null) {
queryWrapper.eq(OperDefectEntity::getCreateDept, defect.getCreateDept());
}
queryWrapper.orderByDesc(OperDefectEntity::getActStartTime);
IPage<OperDefectEntity> pages = defectService.page(Condition.getPage(query), queryWrapper);
IPage<OperDefectVO> vos = OperDefectWrapper.build().pageVO(pages);

4
hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/controller/OperDefectStatisticsController.java

@ -7,6 +7,7 @@ import com.hnac.hzims.common.logs.annotation.OperationAnnotation;
import com.hnac.hzims.common.logs.enums.BusinessType;
import com.hnac.hzims.common.logs.enums.OperatorType;
import com.hnac.hzims.operational.defect.dto.OperDefectStatisticsDTO;
import com.hnac.hzims.operational.defect.entity.OperDefectEntity;
import com.hnac.hzims.operational.defect.entity.OperDefectStatisticsEntity;
import com.hnac.hzims.operational.defect.entity.OperFaultEntity;
import com.hnac.hzims.operational.defect.service.IOperDefectStatisticsService;
@ -79,6 +80,9 @@ public class OperDefectStatisticsController extends BladeController {
if(entity.getActEndTime()!=null){
queryWrapper.le(OperDefectStatisticsEntity::getActStartTime,entity.getActEndTime());
}
if (entity.getCreateDept() != null) {
queryWrapper.eq(OperDefectStatisticsEntity::getCreateDept, entity.getCreateDept());
}
queryWrapper.orderByDesc(OperDefectStatisticsEntity::getActStartTime);
IPage<OperDefectStatisticsEntity> pages = statisticsService.page(Condition.getPage(query), queryWrapper);
IPage<OperDefectStatisticsVO> vos = OperDefectStatisticsWrapper.build().pageVO(pages);

3
hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/controller/OperPhenomenonController.java

@ -86,6 +86,9 @@ public class OperPhenomenonController extends BladeController {
if (Func.isNotEmpty(entity.getDiscriminateStatus())) {
queryWrapper.eq(OperPhenomenonEntity::getDiscriminateStatus, entity.getDiscriminateStatus());
}
if (Func.isNotEmpty(entity.getCreateDept())) {
queryWrapper.eq(OperPhenomenonEntity::getCreateDept, entity.getCreateDept());
}
// // 区域Id
// if (Func.isNotEmpty(entity.getAreaId())) {

2
hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/mapper/MainWorkBenchMapper.xml

@ -69,7 +69,7 @@
and (NOT EXCLUDE_DEPT like #{excludeDept} OR EXCLUDE_DEPT IS NULL OR EXCLUDE_DEPT = '')
</if>
<if test="ascriptionUser != null">
and (ASCRIPTION_USER like #{ascriptionUser} OR ASCRIPTION_USER IS NULL OR ASCRIPTION_USER = '')
and (ASCRIPTION_USER like concat('%',#{ascriptionUser},'%') OR ASCRIPTION_USER IS NULL OR ASCRIPTION_USER = '')
</if>
order by ord
</select>

57
hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HydropowerServiceImpl.java

@ -281,32 +281,19 @@ public class HydropowerServiceImpl implements HydropowerService {
* @return
*/
private List<ActivePowerVo> getLoadsByDay(EminfoAndEmParamVo device) {
// FIXME 当天功率测试数据
Calendar start = Calendar.getInstance();
start.add(Calendar.HOUR_OF_DAY,-start.get(Calendar.HOUR_OF_DAY));
List<ActivePowerVo> list = new ArrayList<>();
Random random = new Random();
while (start.getTime().compareTo(new Date()) <= 0){
ActivePowerVo load = new ActivePowerVo();
load.setHour(start.get(Calendar.HOUR_OF_DAY));
load.setActivePower(String.valueOf(random.nextDouble() * 500));
list.add(load);
start.add(Calendar.HOUR_OF_DAY,1);
}
return list;
/*String start = DateUtil.format(new Date(), DateUtil.PATTERN_DATE) + " 00:00:00";
String start = DateUtil.format(new Date(), DateUtil.PATTERN_DATE) + " 00:00:00";
String end = DateUtil.format(new Date(), DateUtil.PATTERN_DATETIME);
List<AnalyseDataTaosVO> records = analyseDataService.periodTargetData(start, end, 1, 2, device.getEmCode(), HomePageConstant.PV_LOAD);
if (CollectionUtil.isEmpty(records)) {
return new ArrayList<>();
}
return records.stream().map(record -> {
PhotovoltaicPowerVo load = new PhotovoltaicPowerVo();
ActivePowerVo load = new ActivePowerVo();
Date time = DateUtil.parse(record.getTs(), "yyyy-MM-dd HH:mm:ss.s");
load.setHour(DateUtil.format(time,"yyyy-mm-dd HH"));
load.setHour(time.getHours());
load.setActivePower(Optional.ofNullable(record.getVal()).orElse("0"));
return load;
}).sorted(Comparator.comparing(PhotovoltaicPowerVo::getHour)).collect(Collectors.toList());*/
}).sorted(Comparator.comparing(ActivePowerVo::getHour)).collect(Collectors.toList());
}
/**
@ -527,25 +514,9 @@ public class HydropowerServiceImpl implements HydropowerService {
* @return
*/
private List<GenerationPowerVo> getGenerationPowerList(EminfoAndEmParamVo device) {
// FIXME 测试数据
String start = DateUtil.format(new Date(),DateUtil.PATTERN_DATETIME);
Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.DAY_OF_MONTH,-29);
calendar.add(Calendar.HOUR_OF_DAY,-calendar.get(Calendar.HOUR_OF_DAY));
calendar.add(Calendar.MINUTE,-calendar.get(Calendar.MINUTE));
calendar.add(Calendar.SECOND,-calendar.get(Calendar.SECOND));
String end = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATETIME);
Random random = new Random();
List<GenerationPowerVo> generates = new ArrayList<>();
if(calendar.getTime().compareTo(new Date()) <= 0){
GenerationPowerVo generate = new GenerationPowerVo();
generate.setDate(DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATE));
generate.setGenerate(random.nextFloat() * 500000f);
generates.add(generate);
}
return generates;
/*List<AnalyseDataTaosVO> records = analyseDataService.periodTargetData(start,end,EquipmentConstants.CycleTypeEnum.DAY_CYCLE.getType(),5,device.getEmCode(),HomePageConstant.HYDROPOWER_GENERATE_POWER);
String start = DateUtil.format(new Date(), "yyyy-MM") + "-01 00:00:00";
String end = DateUtil.format(new Date(), DateUtil.PATTERN_DATETIME);
List<AnalyseDataTaosVO> records = analyseDataService.periodTargetData(start,end,EquipmentConstants.CycleTypeEnum.DAY_CYCLE.getType(),5,device.getEmCode(),HomePageConstant.HYDROPOWER_GENERATE_POWER);
if(CollectionUtil.isEmpty(records)){
return new ArrayList<>();
}
@ -555,7 +526,7 @@ public class HydropowerServiceImpl implements HydropowerService {
generate.setDate(DateUtil.format(time,DateUtil.PATTERN_DATE));
generate.setGenerate(Float.valueOf(Optional.ofNullable(record.getVal()).orElse("0")));
return generate;
}).collect(Collectors.toList());*/
}).collect(Collectors.toList());
}
/**
@ -1499,7 +1470,7 @@ public class HydropowerServiceImpl implements HydropowerService {
if(CollectionUtil.isEmpty(list)){
return 0;
}
return (float) list.stream().filter(o->createDept.equals(o.getDeptId())).mapToDouble(o->Double.valueOf(o.getActivePower())).sum();
return (float) list.stream().filter(o->createDept.equals(o.getDeptId())).mapToDouble(HydropowerUnitRealVo::getActivePower).sum();
}
/**
@ -1597,7 +1568,7 @@ public class HydropowerServiceImpl implements HydropowerService {
this.settingBase(duty,item);
// 开始时间、结束时间
LocalDateTime localDateTime = LocalDateTime.ofInstant(duty.getDutyDate().toInstant(), ZoneId.systemDefault());
LocalDateTime startDate = localDateTime.withHour(duty.getStartTime().getHours()).withMinute(duty.getStartTime().getMinutes()).withSecond(00);
LocalDateTime startDate = localDateTime.withHour(duty.getStartTime().getHours()).withMinute(duty.getStartTime().getMinutes()).withSecond(0);
//LocalDateTime endDate = localDateTime.withHour(duty.getEndTime().getHours()).withMinute(duty.getEndTime().getMinutes()).withSecond(00);
DateTimeFormatter dtf = DateTimeFormatter.ofPattern(DateUtil.PATTERN_DATETIME);
String start = dtf.format(startDate);
@ -1605,7 +1576,7 @@ public class HydropowerServiceImpl implements HydropowerService {
List<Long> deptList = Collections.singletonList(deptId);
// 使用多线程处理数据
ThreadFactory namedThreadFactory = new ThreadFactoryBuilder().setNameFormat("duty_data-pool-%d").build();
ExecutorService pool = new ThreadPoolExecutor(5, 5, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>(1024), namedThreadFactory, new ThreadPoolExecutor.AbortPolicy());
ExecutorService pool = new ThreadPoolExecutor(5, 5, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>(1024), namedThreadFactory, new ThreadPoolExecutor.AbortPolicy());
CountDownLatch countDownLatch = new CountDownLatch(DUTY_POOL_QUANTITY);
// 下一班组
pool.execute(()-> {
@ -1614,7 +1585,7 @@ public class HydropowerServiceImpl implements HydropowerService {
});
// 缺陷
pool.execute(()-> {
this.getDutyDefect(item,startDate,null);
this.getDutyDefect(item,startDate);
countDownLatch.countDown();
});
// 巡检
@ -1766,11 +1737,11 @@ public class HydropowerServiceImpl implements HydropowerService {
/**
* 获取当班缺陷数据
*
* @param item
* @param startTime
* @param endTime
*/
private void getDutyDefect(AppAreaDutyVo item, LocalDateTime startTime, LocalDateTime endTime) {
private void getDutyDefect(AppAreaDutyVo item, LocalDateTime startTime) {
LambdaQueryWrapper<OperPhenomenonEntity> wrapper = Wrappers.lambdaQuery();
wrapper.ge(OperPhenomenonEntity::getCreateTime,startTime);
//wrapper.le(OperPhenomenonEntity::getCreateTime,endTime);

2
hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/MainWorkBenchServiceImpl.java

@ -163,7 +163,7 @@ public class MainWorkBenchServiceImpl extends BaseServiceImpl<MainWorkBenchMappe
// 首页分类类型 : 集团、省子公司、区域、站点
Optional<Dept> optionalDept = deptByCurrentUser.getData().stream().min(Comparator.comparing(Dept::getDeptCategory));
Integer deptCategory = optionalDept.isPresent() ? optionalDept.map(Dept::getDeptCategory).orElse(null) : null;
Dept dept = optionalDept.isPresent() ? optionalDept.get() : null;
Dept dept = optionalDept.orElse(null);
//Integer deptCategory = deptByCurrentUser.getData().stream().min(Comparator.comparing(Dept::getDeptCategory)).get().getDeptCategory();
// 所属机构
List<Long> deptList = deptByCurrentUser.getData().stream().map(Dept::getId).collect(Collectors.toList());

41
hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/PhotovoltaicServiceImpl.java

@ -301,20 +301,7 @@ public class PhotovoltaicServiceImpl implements PhotovoltaicService {
* @return
*/
private List<PhotovoltaicPowerVo> getLoadsByDay(EminfoAndEmParamVo device) {
// FIXME 当天功率测试数据
Calendar start = Calendar.getInstance();
start.add(Calendar.HOUR_OF_DAY,-start.get(Calendar.HOUR_OF_DAY));
List<PhotovoltaicPowerVo> list = new ArrayList<>();
Random random = new Random();
while (start.getTime().compareTo(new Date()) <= 0){
PhotovoltaicPowerVo load = new PhotovoltaicPowerVo();
load.setHour(start.get(Calendar.HOUR_OF_DAY));
load.setActivePower(String.valueOf(random.nextDouble() * 500));
list.add(load);
start.add(Calendar.HOUR_OF_DAY,1);
}
return list.stream().sorted(Comparator.comparing(PhotovoltaicPowerVo::getHour)).collect(Collectors.toList());
/*String start = DateUtil.format(new Date(), DateUtil.PATTERN_DATE) + " 00:00:00";
String start = DateUtil.format(new Date(), DateUtil.PATTERN_DATE) + " 00:00:00";
String end = DateUtil.format(new Date(), DateUtil.PATTERN_DATETIME);
List<AnalyseDataTaosVO> records = analyseDataService.periodTargetData(start, end, 1, 2, device.getEmCode(), HomePageConstant.PV_LOAD);
if (CollectionUtil.isEmpty(records)) {
@ -326,7 +313,7 @@ public class PhotovoltaicServiceImpl implements PhotovoltaicService {
load.setHour(time.getHours());
load.setActivePower(Optional.ofNullable(record.getVal()).orElse("0"));
return load;
}).sorted(Comparator.comparing(PhotovoltaicPowerVo::getHour)).collect(Collectors.toList());*/
}).sorted(Comparator.comparing(PhotovoltaicPowerVo::getHour)).collect(Collectors.toList());
}
/**
@ -363,11 +350,8 @@ public class PhotovoltaicServiceImpl implements PhotovoltaicService {
*/
private List<PhotovoltaicTargetVo> generateFill(List<StationEntity> stations) {
Calendar calendar = Calendar.getInstance();
//String day = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATE);
String mon = DateUtil.format(calendar.getTime(),"yyyy-MM");
String year = String.valueOf(calendar.get(Calendar.YEAR));
//calendar.add(Calendar.DAY_OF_MONTH,-1);
//String yesterday = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATE);
return stations.stream().map(station ->{
PhotovoltaicTargetVo target = new PhotovoltaicTargetVo();
target.setDeptId(station.getRefDept());
@ -1347,20 +1331,6 @@ public class PhotovoltaicServiceImpl implements PhotovoltaicService {
* @return
*/
private List<PhotovoltaicLoadGenerateVo> periodLoadDay(List<Long> stations) {
// FIXME 当天功率测试数据
Calendar start = Calendar.getInstance();
start.add(Calendar.HOUR_OF_DAY,-start.get(Calendar.HOUR_OF_DAY));
List<PhotovoltaicLoadGenerateVo> list = new ArrayList<>();
Random random = new Random();
while (start.getTime().compareTo(new Date()) <= 0){
PhotovoltaicLoadGenerateVo load = new PhotovoltaicLoadGenerateVo();
load.setPeriod(DateUtil.format(start.getTime(),"yyyy-mm-dd HH"));
load.setValue(random.nextFloat() * 500);
list.add(load);
start.add(Calendar.HOUR_OF_DAY,1);
}
return list;
/*
// redis实时数据
List<PhotovoltaicTargetVo> photovoltaics = (List<PhotovoltaicTargetVo>) redisTemplate.opsForValue().get(load_photovoltaic_target_key);
if(CollectionUtil.isEmpty(photovoltaics)){
@ -1371,10 +1341,11 @@ public class PhotovoltaicServiceImpl implements PhotovoltaicService {
if(CollectionUtil.isEmpty(devices)){
return new ArrayList<>();
}
String start = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATE);
Calendar calendar = Calendar.getInstance();
String start = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATE) + " 00:00:00";
List<AnalyseDataTaosVO> list = new ArrayList<>();
for(PhotovoltaicTargetVo device : devices){
list.addAll(analyseDataService.periodTargetData(start,end,1,2,device.getDeviceCode(),HomePageConstant.PV_LOAD));
list.addAll(analyseDataService.periodTargetData(start,DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATETIME),1,2,device.getDeviceCode(),HomePageConstant.PV_LOAD));
}
if(CollectionUtil.isEmpty(list)){
return new ArrayList<>();
@ -1385,7 +1356,7 @@ public class PhotovoltaicServiceImpl implements PhotovoltaicService {
target.setPeriod(String.valueOf(time.getHour()));
target.setValue((float) entry.getValue().stream().mapToDouble(o-> Double.parseDouble(String.valueOf(o.getVal()))).sum());
return target;
}).collect(Collectors.toList());*/
}).collect(Collectors.toList());
}
/**

16
hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/WaterServiceImpl.java

@ -289,19 +289,7 @@ public class WaterServiceImpl implements IWaterService {
* @return
*/
private Map<Integer, String> getWaterLevelMap(String instanceCode, String signage) {
/**
* FIXME 水位测试数据
*/
Calendar start = Calendar.getInstance();
start.add(Calendar.HOUR_OF_DAY,-start.get(Calendar.HOUR_OF_DAY));
Map<Integer, String> map = new HashMap<>();
Random random = new Random();
while (start.getTime().compareTo(new Date()) <= 0){
map.put(start.get(Calendar.HOUR_OF_DAY),String.valueOf(random.nextDouble() * 500));
start.add(Calendar.HOUR_OF_DAY,1);
}
return map;
/*LocalDateTime beginTime = LocalDateTime.parse(DateUtil.format(new Date(), "yyyy-MM-dd 00:00:00"), DateUtil.DATETIME_FORMATTER);
LocalDateTime beginTime = LocalDateTime.parse(DateUtil.format(new Date(), "yyyy-MM-dd 00:00:00"), DateUtil.DATETIME_FORMATTER);
LocalDateTime endTime = LocalDateTime.now();
AnalyseCodeByAnalyseDataPO po = new AnalyseCodeByAnalyseDataPO();
List<AnalyzeDataConditionPO> signboardConditions = new ArrayList<>();
@ -334,7 +322,7 @@ public class WaterServiceImpl implements IWaterService {
return "0";
}
return value.getVal();
}));*/
}));
}
/**

2
hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/RealMonitorServiceImpl.java

@ -895,7 +895,6 @@ public class RealMonitorServiceImpl implements IRealMonitorService {
weather.setIcon(now.getIcon());
weather.setTemp(now.getTemp());
weather.setText(now.getText());
station.setPrecipitation(now.getPrecip());
}
}
// 站点七日内天气
@ -906,6 +905,7 @@ public class RealMonitorServiceImpl implements IRealMonitorService {
Daily daily = dailyList.stream().sorted(Comparator.comparing(Daily::getFxDate)).collect(Collectors.toList()).get(0);
weather.setTempMin(daily.getTempMin());
weather.setTempMax(daily.getTempMax());
station.setPrecipitation(daily.getPrecip());
}
}
station.setNowWater(weather);

1
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/StandardTicketInfoServiceImpl.java

@ -107,6 +107,7 @@ public class StandardTicketInfoServiceImpl extends BaseServiceImpl<StandardTicke
@Override
public R<IPage<StandardTicketInfoVO>> queryList(StandardTicketInfoDto req, Query query) {
LambdaQueryWrapper<StandardTicketInfoEntity> queryWrapper = this.getQueryWrapper(req);
queryWrapper.eq(StandardTicketInfoEntity::getCreateDept,req.getCreateDept());
queryWrapper.orderByDesc(StandardTicketInfoEntity::getCreateTime);
IPage pages = super.page(Condition.getPage(query), queryWrapper);
return R.data(pages.setRecords(StandardTicketInfoWrapper.build().listVO(pages.getRecords())));

1
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketInfoServiceImpl.java

@ -236,6 +236,7 @@ public class WorkTicketInfoServiceImpl extends BaseServiceImpl<WorkTicketInfoMap
@Override
public R<IPage<WorkTicketInfoVO>> queryList(WorkTicketInfoDto req, Query query) {
LambdaQueryWrapper<WorkTicketInfoEntity> lqw = this.getQueryWrapper(req);
lqw.eq(WorkTicketInfoEntity::getCreateDept,req.getCreateDept());
lqw.orderByDesc(WorkTicketInfoEntity::getCreateTime).orderByDesc(WorkTicketInfoEntity::getUpdateTime);
IPage pages = super.page(Condition.getPage(query), lqw);
pages.setRecords(WorkTicketInfoWrapper.build().listVO(pages.getRecords()));

Loading…
Cancel
Save