Browse Source

Merge remote-tracking branch 'origin/master'

zhongwei
haungxing 7 months ago
parent
commit
87d7bedad3
  1. 15
      hzims-service/hzims-alarm/src/main/resources/db/1.0.0.sql
  2. 35
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/controller/ScheduledController.java
  3. 4
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/AlarmScheduledTask.java
  4. 2
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/impl/AlarmServiceImpl.java
  5. 2
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/RealTargetService.java
  6. 99
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/RealTargetServiceImpl.java
  7. 2
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/monitor/impl/MonitorServiceImpl.java
  8. 8
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/DefectCheckServiceImpl.java
  9. 3
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/CensServiceImpl.java

15
hzims-service/hzims-alarm/src/main/resources/db/1.0.0.sql

@ -265,3 +265,18 @@ CREATE TABLE IF NOT EXISTS `hzims_interruption_alarm` (
`IS_DELETED` tinyint(4) NOT NULL COMMENT '是否删除', `IS_DELETED` tinyint(4) NOT NULL COMMENT '是否删除',
PRIMARY KEY (`ID`) USING BTREE PRIMARY KEY (`ID`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = DYNAMIC; ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = DYNAMIC;
-- 默认配置
INSERT INTO `hzims_alarm_defaul_config` (`ID`, `SOURCE`, `ALARM_CHILED_TYPE`, `IS_RIGHT_TABULATION`, `IS_SHOW_ALERT`, `IS_SMALL_BELL`, `IS_MASK`, `IS_BROADCAST`, `IS_PLATFORM_MESSAGE`, `IS_SHORT_MESSAGE`, `IS_WX_MESSAGE`, `TENANT_ID`, `CREATE_DEPT`, `CREATE_TIME`, `UPDATE_TIME`, `CREATE_USER`, `UPDATE_USER`, `IS_DELETED`, `STATUS`) VALUES (1767798439068217346, 0, 2, 0, 1, 0, 1, 1, 1, 1, 1, '200000', 200001, NULL, NULL, NULL, NULL, 0, NULL);
INSERT INTO `hzims_alarm_defaul_config` (`ID`, `SOURCE`, `ALARM_CHILED_TYPE`, `IS_RIGHT_TABULATION`, `IS_SHOW_ALERT`, `IS_SMALL_BELL`, `IS_MASK`, `IS_BROADCAST`, `IS_PLATFORM_MESSAGE`, `IS_SHORT_MESSAGE`, `IS_WX_MESSAGE`, `TENANT_ID`, `CREATE_DEPT`, `CREATE_TIME`, `UPDATE_TIME`, `CREATE_USER`, `UPDATE_USER`, `IS_DELETED`, `STATUS`) VALUES (1767798439068217349, 0, 3, 0, 0, 0, 1, 0, 0, 1, 1, '200000', 200001, NULL, NULL, NULL, NULL, 0, NULL);
INSERT INTO `hzims_alarm_defaul_config` (`ID`, `SOURCE`, `ALARM_CHILED_TYPE`, `IS_RIGHT_TABULATION`, `IS_SHOW_ALERT`, `IS_SMALL_BELL`, `IS_MASK`, `IS_BROADCAST`, `IS_PLATFORM_MESSAGE`, `IS_SHORT_MESSAGE`, `IS_WX_MESSAGE`, `TENANT_ID`, `CREATE_DEPT`, `CREATE_TIME`, `UPDATE_TIME`, `CREATE_USER`, `UPDATE_USER`, `IS_DELETED`, `STATUS`) VALUES (1767798439068217350, 0, 5, 0, 1, 0, 1, 1, 1, 1, 1, '200000', 200001, NULL, NULL, NULL, NULL, 0, NULL);
INSERT INTO `hzims_alarm_defaul_config` (`ID`, `SOURCE`, `ALARM_CHILED_TYPE`, `IS_RIGHT_TABULATION`, `IS_SHOW_ALERT`, `IS_SMALL_BELL`, `IS_MASK`, `IS_BROADCAST`, `IS_PLATFORM_MESSAGE`, `IS_SHORT_MESSAGE`, `IS_WX_MESSAGE`, `TENANT_ID`, `CREATE_DEPT`, `CREATE_TIME`, `UPDATE_TIME`, `CREATE_USER`, `UPDATE_USER`, `IS_DELETED`, `STATUS`) VALUES (1767798439068217351, 0, 13, 0, 0, 1, 0, 0, 0, 1, 1, '200000', 200001, NULL, NULL, NULL, NULL, 0, NULL);
INSERT INTO `hzims_alarm_defaul_config` (`ID`, `SOURCE`, `ALARM_CHILED_TYPE`, `IS_RIGHT_TABULATION`, `IS_SHOW_ALERT`, `IS_SMALL_BELL`, `IS_MASK`, `IS_BROADCAST`, `IS_PLATFORM_MESSAGE`, `IS_SHORT_MESSAGE`, `IS_WX_MESSAGE`, `TENANT_ID`, `CREATE_DEPT`, `CREATE_TIME`, `UPDATE_TIME`, `CREATE_USER`, `UPDATE_USER`, `IS_DELETED`, `STATUS`) VALUES (1767798439068217356, 0, 14, 0, 0, 1, 0, 0, 0, 1, 1, '200000', 200001, NULL, NULL, NULL, NULL, 0, NULL);
INSERT INTO `hzims_alarm_defaul_config` (`ID`, `SOURCE`, `ALARM_CHILED_TYPE`, `IS_RIGHT_TABULATION`, `IS_SHOW_ALERT`, `IS_SMALL_BELL`, `IS_MASK`, `IS_BROADCAST`, `IS_PLATFORM_MESSAGE`, `IS_SHORT_MESSAGE`, `IS_WX_MESSAGE`, `TENANT_ID`, `CREATE_DEPT`, `CREATE_TIME`, `UPDATE_TIME`, `CREATE_USER`, `UPDATE_USER`, `IS_DELETED`, `STATUS`) VALUES (1767798439068217357, 1, 21, 0, 0, 0, 1, 0, 0, 1, 1, '200000', 200001, NULL, NULL, NULL, NULL, 0, NULL);
INSERT INTO `hzims_alarm_defaul_config` (`ID`, `SOURCE`, `ALARM_CHILED_TYPE`, `IS_RIGHT_TABULATION`, `IS_SHOW_ALERT`, `IS_SMALL_BELL`, `IS_MASK`, `IS_BROADCAST`, `IS_PLATFORM_MESSAGE`, `IS_SHORT_MESSAGE`, `IS_WX_MESSAGE`, `TENANT_ID`, `CREATE_DEPT`, `CREATE_TIME`, `UPDATE_TIME`, `CREATE_USER`, `UPDATE_USER`, `IS_DELETED`, `STATUS`) VALUES (1767798439068217359, 1, 22, 0, 1, 0, 1, 1, 0, 1, 1, '200000', 200001, NULL, NULL, NULL, NULL, 0, NULL);
INSERT INTO `hzims_alarm_defaul_config` (`ID`, `SOURCE`, `ALARM_CHILED_TYPE`, `IS_RIGHT_TABULATION`, `IS_SHOW_ALERT`, `IS_SMALL_BELL`, `IS_MASK`, `IS_BROADCAST`, `IS_PLATFORM_MESSAGE`, `IS_SHORT_MESSAGE`, `IS_WX_MESSAGE`, `TENANT_ID`, `CREATE_DEPT`, `CREATE_TIME`, `UPDATE_TIME`, `CREATE_USER`, `UPDATE_USER`, `IS_DELETED`, `STATUS`) VALUES (1767798439068217360, 1, 23, 0, 1, 1, 1, 1, 0, 1, 1, '200000', 200001, NULL, NULL, NULL, NULL, 0, NULL);
INSERT INTO `hzims_alarm_defaul_config` (`ID`, `SOURCE`, `ALARM_CHILED_TYPE`, `IS_RIGHT_TABULATION`, `IS_SHOW_ALERT`, `IS_SMALL_BELL`, `IS_MASK`, `IS_BROADCAST`, `IS_PLATFORM_MESSAGE`, `IS_SHORT_MESSAGE`, `IS_WX_MESSAGE`, `TENANT_ID`, `CREATE_DEPT`, `CREATE_TIME`, `UPDATE_TIME`, `CREATE_USER`, `UPDATE_USER`, `IS_DELETED`, `STATUS`) VALUES (1767798439068217361, 2, 40, 0, 0, 0, 0, 0, 0, 1, 1, '200000', 200001, NULL, NULL, NULL, NULL, 0, NULL);
INSERT INTO `hzims_alarm_defaul_config` (`ID`, `SOURCE`, `ALARM_CHILED_TYPE`, `IS_RIGHT_TABULATION`, `IS_SHOW_ALERT`, `IS_SMALL_BELL`, `IS_MASK`, `IS_BROADCAST`, `IS_PLATFORM_MESSAGE`, `IS_SHORT_MESSAGE`, `IS_WX_MESSAGE`, `TENANT_ID`, `CREATE_DEPT`, `CREATE_TIME`, `UPDATE_TIME`, `CREATE_USER`, `UPDATE_USER`, `IS_DELETED`, `STATUS`) VALUES (1767798439068217362, 3, 30, 0, 1, 1, 1, 1, 0, 1, 1, '200000', 200001, NULL, NULL, NULL, NULL, 0, NULL);
INSERT INTO `hzims_alarm_defaul_config` (`ID`, `SOURCE`, `ALARM_CHILED_TYPE`, `IS_RIGHT_TABULATION`, `IS_SHOW_ALERT`, `IS_SMALL_BELL`, `IS_MASK`, `IS_BROADCAST`, `IS_PLATFORM_MESSAGE`, `IS_SHORT_MESSAGE`, `IS_WX_MESSAGE`, `TENANT_ID`, `CREATE_DEPT`, `CREATE_TIME`, `UPDATE_TIME`, `CREATE_USER`, `UPDATE_USER`, `IS_DELETED`, `STATUS`) VALUES (1767798439068217363, 4, 0, 0, 1, 1, 1, 1, 1, 1, 1, '200000', 200001, NULL, NULL, NULL, NULL, 0, NULL);
INSERT INTO `hzims_alarm_defaul_config` (`ID`, `SOURCE`, `ALARM_CHILED_TYPE`, `IS_RIGHT_TABULATION`, `IS_SHOW_ALERT`, `IS_SMALL_BELL`, `IS_MASK`, `IS_BROADCAST`, `IS_PLATFORM_MESSAGE`, `IS_SHORT_MESSAGE`, `IS_WX_MESSAGE`, `TENANT_ID`, `CREATE_DEPT`, `CREATE_TIME`, `UPDATE_TIME`, `CREATE_USER`, `UPDATE_USER`, `IS_DELETED`, `STATUS`) VALUES (1767798439068217365, 5, 50, 0, 1, 1, 1, 1, 1, 1, 1, '200000', 200001, NULL, NULL, NULL, NULL, 0, NULL);
INSERT INTO `hzims_alarm_defaul_config` (`ID`, `SOURCE`, `ALARM_CHILED_TYPE`, `IS_RIGHT_TABULATION`, `IS_SHOW_ALERT`, `IS_SMALL_BELL`, `IS_MASK`, `IS_BROADCAST`, `IS_PLATFORM_MESSAGE`, `IS_SHORT_MESSAGE`, `IS_WX_MESSAGE`, `TENANT_ID`, `CREATE_DEPT`, `CREATE_TIME`, `UPDATE_TIME`, `CREATE_USER`, `UPDATE_USER`, `IS_DELETED`, `STATUS`) VALUES (1767798439068217366, 5, 51, 0, 1, 1, 1, 1, 1, 1, 1, '200000', 200001, NULL, NULL, NULL, NULL, 0, NULL);

35
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/controller/ScheduledController.java

@ -1,35 +0,0 @@
package com.hnac.hzims.scheduled.controller;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hnac.hzims.scheduled.service.operation.monitor.MonitorService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
import org.springblade.core.log.annotation.ApiLog;
import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
* @author ysj
*/
@RestController
@AllArgsConstructor
@RequestMapping("/scheduled")
@Api(value = "定时任务", tags = "定时任务")
public class ScheduledController {
private final MonitorService service;
@ApiLog
@ApiOperation("集中监控数据加载")
@GetMapping("/loadMonitoring")
@ApiOperationSupport(order = 1)
public R duty(@ApiParam(value = "机构Id", required = true) @RequestParam Long deptId) {
service.loadMonitoring("2023-10-19");
return R.status(true);
}
}

4
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/AlarmScheduledTask.java

@ -1,15 +1,12 @@
package com.hnac.hzims.scheduled.scheduled; package com.hnac.hzims.scheduled.scheduled;
import com.hnac.hzims.scheduled.service.alarm.AlarmQueryService;
import com.hnac.hzims.scheduled.service.alarm.AlarmService; import com.hnac.hzims.scheduled.service.alarm.AlarmService;
import com.hnac.hzims.scheduled.service.alarm.InterruptionAlarmService;
import com.xxl.job.core.biz.model.ReturnT; import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob; import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springblade.core.tool.utils.DateUtil; import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.Func; import org.springblade.core.tool.utils.Func;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.util.Date; import java.util.Date;
@ -49,6 +46,7 @@ public class AlarmScheduledTask {
*/ */
@XxlJob(START_STOP_ALARM) @XxlJob(START_STOP_ALARM)
//@Scheduled(cron = "0/40 * * * * ? ") //@Scheduled(cron = "0/40 * * * * ? ")
public ReturnT<String> startStopAlarm(String param) { public ReturnT<String> startStopAlarm(String param) {
if (Func.isBlank(param)) { if (Func.isBlank(param)) {
param = DateUtil.format(new Date(), "yyyy-MM"); param = DateUtil.format(new Date(), "yyyy-MM");

2
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/impl/AlarmServiceImpl.java

@ -152,7 +152,7 @@ public class AlarmServiceImpl implements AlarmService {
alarm.setIsShowAlert(1); alarm.setIsShowAlert(1);
alarm.setIsSmallBell(1); alarm.setIsSmallBell(1);
alarm.setIsMask(1); alarm.setIsMask(1);
alarm.setIsBroadcast(0); alarm.setIsBroadcast(1);
alarm.setIsPlatformMessage(1); alarm.setIsPlatformMessage(1);
alarm.setIsShortMessage(1); alarm.setIsShortMessage(1);
alarm.setIsWxMessage(1); alarm.setIsWxMessage(1);

2
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/RealTargetService.java

@ -28,5 +28,7 @@ public interface RealTargetService {
void loadPowerData(String param, List<Integer> types, Integer serveType, int year); void loadPowerData(String param, List<Integer> types, Integer serveType, int year);
void loadPowerDataNew(List<Integer> types, Integer serveType, int year);
void loadPowerDataByWindEnergy(String param, List<Integer> types, Integer serveType, int year,String key); void loadPowerDataByWindEnergy(String param, List<Integer> types, Integer serveType, int year,String key);
} }

99
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/RealTargetServiceImpl.java

@ -35,6 +35,10 @@ import com.hnac.hzinfo.datasearch.real.po.RealDataSearchPO;
import com.hnac.hzinfo.sdk.analyse.po.MultiAnalyzeCodePO; import com.hnac.hzinfo.sdk.analyse.po.MultiAnalyzeCodePO;
import com.hnac.hzinfo.sdk.core.response.HzPage; import com.hnac.hzinfo.sdk.core.response.HzPage;
import com.hnac.hzinfo.sdk.core.response.Result; import com.hnac.hzinfo.sdk.core.response.Result;
import com.hnac.hzinfo.sdk.v5.device.DeviceDataClient;
import com.hnac.hzinfo.sdk.v5.device.dto.ReductionDataDTO;
import com.hnac.hzinfo.sdk.v5.device.vo.ReductionDataVO;
import lombok.Getter;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.MapUtils; import org.apache.commons.collections4.MapUtils;
@ -51,8 +55,10 @@ import org.springframework.stereotype.Service;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode; import java.math.RoundingMode;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.*; import java.util.*;
import java.util.concurrent.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.Stream; import java.util.stream.Stream;
@ -97,6 +103,8 @@ public class RealTargetServiceImpl implements RealTargetService {
private final IAnalyseDataSearchClient analyseDataSearchClient; private final IAnalyseDataSearchClient analyseDataSearchClient;
private final DeviceDataClient deviceDataClient;
@Value("${hzims.equipment.emInfo.emInfoList}") @Value("${hzims.equipment.emInfo.emInfoList}")
public String device_cache_cofig_final; public String device_cache_cofig_final;
@ -112,7 +120,12 @@ public class RealTargetServiceImpl implements RealTargetService {
private final static String loadwater_level_key = "hzims:operation:loadwater:level:key"; private final static String loadwater_level_key = "hzims:operation:loadwater:level:key";
private final static String load_photovoltaic_real_key = "hzims:operation:photovoltaic:real:key"; private final static String load_photovoltaic_real_key = "hzims:operation:photovoltaic:real:key";
private final static String load_photovoltaic_target_key = "hzims:operation:photovoltaic:target:key"; private final static String load_photovoltaic_target_key = "hzims:operation:photovoltaic:target:key";
@Getter
private static final ThreadPoolExecutor fixedThreadExecutor;
static {
ThreadFactory threadFactory = Executors.defaultThreadFactory();
fixedThreadExecutor = new ThreadPoolExecutor(5, 5, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingDeque(), threadFactory);
}
@Override @Override
public void loadEmInfo(String param) { public void loadEmInfo(String param) {
@ -1211,6 +1224,9 @@ public class RealTargetServiceImpl implements RealTargetService {
*/ */
@Override @Override
public void loadPowerData(String param, List<Integer> types, Integer serveType, int year) { public void loadPowerData(String param, List<Integer> types, Integer serveType, int year) {
Long time=System.currentTimeMillis();
System.out.println("近年发电量接口耗时测试开始=======================");
log.info("近年发电量接口耗时测试开始=======================");
// 站点查询 // 站点查询
List<StationEntity> stationList = stationService.list(new LambdaQueryWrapper<StationEntity>() {{ List<StationEntity> stationList = stationService.list(new LambdaQueryWrapper<StationEntity>() {{
eq(StationEntity::getDataOrigin,"0"); eq(StationEntity::getDataOrigin,"0");
@ -1235,7 +1251,10 @@ public class RealTargetServiceImpl implements RealTargetService {
String start = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATE) + " 00:00:00"; String start = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATE) + " 00:00:00";
// 存储数据map :<站点id,<月份,发电量>> // 存储数据map :<站点id,<月份,发电量>>
Map<Long, Map<String, Float>> powerMap = new HashMap<>(); Map<Long, Map<String, Float>> powerMap = new HashMap<>();
Long time2=System.currentTimeMillis();
log.info("近年发电量接口,数据组装"+(time2-time));
stationList.forEach(station -> { stationList.forEach(station -> {
fixedThreadExecutor.execute(()->{
// 站点设备集合 // 站点设备集合
List<EminfoAndEmParamVo> stationDevices = devices.stream().filter(device -> device.getCreateDept().equals(station.getRefDept())).collect(Collectors.toList()); List<EminfoAndEmParamVo> stationDevices = devices.stream().filter(device -> device.getCreateDept().equals(station.getRefDept())).collect(Collectors.toList());
log.error("load_power_data station :" + station.getCode() + "==== device :" + stationDevices ); log.error("load_power_data station :" + station.getCode() + "==== device :" + stationDevices );
@ -1245,6 +1264,77 @@ public class RealTargetServiceImpl implements RealTargetService {
} }
powerMap.put(station.getId(),generateMap); powerMap.put(station.getId(),generateMap);
}); });
});
redisTemplate.opsForValue().set(recent_year_power_data, powerMap);
Long time3=System.currentTimeMillis();
log.info("近年发电量数据接口,总耗时:"+(time3-time));
}
@Override
public void loadPowerDataNew(List<Integer> types, Integer serveType, int year) {
// 站点查询
List<StationEntity> stationList = stationService.list(new LambdaQueryWrapper<StationEntity>() {{
eq(StationEntity::getDataOrigin,"0");
if (ObjectUtil.isNotEmpty(serveType)) {
eq(StationEntity::getServeType, serveType);
}
if (CollectionUtil.isNotEmpty(types)) {
in(StationEntity::getType, types);
}
}});
// 设备信息
List<EminfoAndEmParamVo> devices = JSONObject.parseObject(redisTemplate.opsForValue().get(device_cache_cofig_final).toString(),
new TypeReference<List<EminfoAndEmParamVo>>() {});
// 结束时间
Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.MONTH, -calendar.get(Calendar.MONTH) + 12);
calendar.add(Calendar.DATE, -calendar.get(Calendar.DATE) + 1);
String end = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATE) + " 00:00:00";
LocalDateTime endTime = LocalDateTime.parse(end);
// 开始时间
calendar.set(Calendar.YEAR, calendar.get(Calendar.YEAR) - year);
calendar.add(Calendar.MONTH, -calendar.get(Calendar.MONTH));
String start = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATE) + " 00:00:00";
LocalDateTime startTime = LocalDateTime.parse(end);
// 存储数据map:<站点id, <月份, 发电量>>
Map<Long, Map<String, Float>> powerMap = new HashMap<>();
stationList.forEach(station -> {
List<PowerMonthVo> datas = new ArrayList<>();
// 站点设备集合
List<EminfoAndEmParamVo> stationDevices = devices.stream().filter(device -> device.getCreateDept().equals(station.getRefDept())).collect(Collectors.toList());
log.info("load_power_data station :" + station.getCode() + "==== device :" + stationDevices);
if (CollectionUtil.isNotEmpty(devices)) {
stationDevices.forEach(device -> {
ReductionDataDTO reductionDataDTO = new ReductionDataDTO();
reductionDataDTO.setDeviceCode(device.getEmCode());
reductionDataDTO.setSaveTimeType(5);
reductionDataDTO.setTimeInterval(1);
reductionDataDTO.setBeginTime(startTime);
reductionDataDTO.setEndTime(endTime);
reductionDataDTO.setNeedPage(false);
Result<ReductionDataVO> reductionDataVOResult = deviceDataClient.pageDeviceCodeAndSignages(reductionDataDTO);
if (!reductionDataVOResult.isSuccess() || CollectionUtil.isEmpty(reductionDataVOResult.getData().getDataList())) {
return;
}
List<Map<String, String>> dataList = reductionDataVOResult.getData().getDataList();
datas.addAll(dataList.stream().map(data -> {
PowerMonthVo generate = new PowerMonthVo();
Date time = DateUtil.parse(data.get("ts"), "yyyy-MM-dd HH:mm:ss.s");
generate.setStrMonth(DateUtil.format(time,DateUtil.PATTERN_DATE));
// generate.setPower(Float.parseFloat(Optional.ofNullable(data.get(HomePageConstant.HYDROPOWER_GENERATE_POWER))
// .orElse("0")) * device.getRideCount());
return generate;
}).collect(Collectors.toList()));
});
}
// 补充填报数据
datas.addAll(this.generateFill(station,start,end));
if (CollectionUtil.isEmpty(datas)) {
return;
}
Map<String, Float> map = datas.stream().collect(Collectors.toMap(PowerMonthVo::getStrMonth, PowerMonthVo::getPower, Float::sum));
powerMap.put(station.getId(), map);
});
redisTemplate.opsForValue().set(recent_year_power_data, powerMap); redisTemplate.opsForValue().set(recent_year_power_data, powerMap);
} }
@ -1322,6 +1412,7 @@ public class RealTargetServiceImpl implements RealTargetService {
*/ */
private Map<String, Float> getGenerateYear(StationEntity station,List<EminfoAndEmParamVo> devices, String start, String end) { private Map<String, Float> getGenerateYear(StationEntity station,List<EminfoAndEmParamVo> devices, String start, String end) {
List<PowerMonthVo> datas = new ArrayList<>(); List<PowerMonthVo> datas = new ArrayList<>();
long l = System.currentTimeMillis();
// 设备采集发电量 // 设备采集发电量
if(CollectionUtil.isNotEmpty(devices)){ if(CollectionUtil.isNotEmpty(devices)){
devices.forEach(device->{ devices.forEach(device->{
@ -1342,11 +1433,17 @@ public class RealTargetServiceImpl implements RealTargetService {
}).collect(Collectors.toList())); }).collect(Collectors.toList()));
}); });
} }
long l2 = System.currentTimeMillis();
log.info("getGenerateYear接口,"+station.getName()+"-设备采集发电量数据耗时:"+(l2-l));
// 补充填报数据 // 补充填报数据
datas.addAll(this.generateFill(station,start,end)); datas.addAll(this.generateFill(station,start,end));
long l3 = System.currentTimeMillis();
log.info("getGenerateYear接口,"+station.getName()+":补充填报数据"+(l3-l2));
if(CollectionUtil.isEmpty(datas)){ if(CollectionUtil.isEmpty(datas)){
return null; return null;
} }
long l4 = System.currentTimeMillis();
log.info("getGenerateYear接口,"+station.getName()+":接口总耗时"+(l4-l));
return datas.stream().collect(Collectors.toMap(PowerMonthVo::getStrMonth, PowerMonthVo::getPower, Float::sum)); return datas.stream().collect(Collectors.toMap(PowerMonthVo::getStrMonth, PowerMonthVo::getPower, Float::sum));
} }
/** /**

2
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/monitor/impl/MonitorServiceImpl.java

@ -451,6 +451,7 @@ public class MonitorServiceImpl implements MonitorService {
* @param item * @param item
*/ */
private void stationParam(List<StationEntity> stationEntityList, RealStationVo item,List<Dept> deptAll) { private void stationParam(List<StationEntity> stationEntityList, RealStationVo item,List<Dept> deptAll) {
item.setSort(9999);
if(CollectionUtil.isEmpty(stationEntityList)){ if(CollectionUtil.isEmpty(stationEntityList)){
return; return;
} }
@ -466,7 +467,6 @@ public class MonitorServiceImpl implements MonitorService {
item.setWaterLevelMax(Optional.ofNullable(station.getLimitWaterLevel()).orElse(0.0)); item.setWaterLevelMax(Optional.ofNullable(station.getLimitWaterLevel()).orElse(0.0));
item.setServerType(station.getServeType()); item.setServerType(station.getServeType());
item.setStationDeptId(station.getRefDept()); item.setStationDeptId(station.getRefDept());
item.setSort(9999);
// 排序 // 排序
List<Dept> list = deptAll.stream().filter(o-> station.getRefDept().equals(o.getId())).collect(Collectors.toList()); List<Dept> list = deptAll.stream().filter(o-> station.getRefDept().equals(o.getId())).collect(Collectors.toList());
if(CollectionUtil.isEmpty(list)){ if(CollectionUtil.isEmpty(list)){

8
hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/DefectCheckServiceImpl.java

@ -166,7 +166,15 @@ public class DefectCheckServiceImpl extends BaseServiceImpl<OperPhenomenonMapper
); );
String suffix = String.format(String.format("%03d", ticketList.size() + 1)); String suffix = String.format(String.format("%03d", ticketList.size() + 1));
String result = stationR.getData().getSignage() + yearMonth + suffix; String result = stationR.getData().getSignage() + yearMonth + suffix;
OperPhenomenonEntity operPhenomenonEntity = this.getOne(
Wrappers.<OperPhenomenonEntity>lambdaQuery().eq(OperPhenomenonEntity::getDefectCode, result)
.last("limit 1;")
);
if (ObjectUtil.isNotEmpty(operPhenomenonEntity)){
suffix= String.format(String.format("%03d", ticketList.size() + 10));
result= stationR.getData().getSignage() + yearMonth + suffix;
}
// 缺陷编码 : 按项目+年+月+序号 // 缺陷编码 : 按项目+年+月+序号
if (Func.isNotEmpty(result)) { if (Func.isNotEmpty(result)) {
entity.setDefectCode(result); entity.setDefectCode(result);

3
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/CensServiceImpl.java

@ -395,9 +395,6 @@ public class CensServiceImpl implements CensService {
// 操作票数量 // 操作票数量
HSSFCell header_row_cell_3 = row.getCell(3); HSSFCell header_row_cell_3 = row.getCell(3);
header_row_cell_3.setCellValue(cens.getOperateCount()); header_row_cell_3.setCellValue(cens.getOperateCount());
// 工作任务数量
HSSFCell header_row_cell_4 = row.getCell(4);
header_row_cell_4.setCellValue(cens.getWorkTaskCount());
} }
} }

Loading…
Cancel
Save