diff --git a/hzims-service-api/common-api/src/main/java/com/hnac/hzims/vo/SafeCheckStatisticVO.java b/hzims-service-api/common-api/src/main/java/com/hnac/hzims/vo/SafeCheckStatisticVO.java index 70bb67a..b7f0f4f 100644 --- a/hzims-service-api/common-api/src/main/java/com/hnac/hzims/vo/SafeCheckStatisticVO.java +++ b/hzims-service-api/common-api/src/main/java/com/hnac/hzims/vo/SafeCheckStatisticVO.java @@ -13,7 +13,7 @@ import java.io.Serializable; */ @ApiModel(value = "安全检查项目统计对象",description = "安全检查项目统计对象") @Data -public class SafeCheckStatisticVO implements Serializable { +public class SafeCheckStatisticVO { @ApiModelProperty(value = "项目类型") private String projectType; diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/constant/ScheduledConstant.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/constant/ScheduledConstant.java index c5b9176..5dee662 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/constant/ScheduledConstant.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/constant/ScheduledConstant.java @@ -11,4 +11,6 @@ public interface ScheduledConstant { String THIRTY_DAY_POWER_GENERATION = "thirtyDayPowerGeneration"; String THIS_DAY_POWER_GENERATION = "thisDayPowerGeneration"; + + String LOAD_THREE_YEAR_POWER_GENERATION = "loadThreeYearPowerGeneration"; } \ No newline at end of file diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/HydropowerStationVo.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/HydropowerStationVo.java index 09e09ac..a39e0cc 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/HydropowerStationVo.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/HydropowerStationVo.java @@ -1,6 +1,7 @@ package com.hnac.hzims.operational.main.vo; import com.hnac.hzims.hzimsweather.response.weather.Daily; +import com.hnac.hzims.operational.main.vo.pv.PowerRainVo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -45,30 +46,42 @@ public class HydropowerStationVo { @ApiModelProperty(value = "总发电负荷单位") private String powerUnit; + @ApiModelProperty(value = "容量利用率") + private Double capacityRate; + @ApiModelProperty(value = "月计划发电量") private Float planPowerMon; - @ApiModelProperty(value = "年计划发电量") - private Float planPowerYear; - @ApiModelProperty(value = "月发电量") private Float powerMon; @ApiModelProperty(value = "月发电量完成率") private Double powerRateMon; + @ApiModelProperty(value = "年计划发电量") + private Float planPowerYear; + @ApiModelProperty(value = "年发电量") private Float powerYear; @ApiModelProperty(value = "年发电完成率") private Double powerRateYear; + @ApiModelProperty(value = "今日发电量") + private Float powerDay; + + @ApiModelProperty(value = "昨日发电量") + private Float powerYesterDay; + @ApiModelProperty(value = "站点实时温度") private String temp; @ApiModelProperty(value = "七日内天气") private List weather; + @ApiModelProperty(value = "降雨/发电量曲线") + private List powerRains; + @ApiModelProperty(value = "前水位曲线数据") private Map frontCurveMap; diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/HydropowerUnitTargetVo.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/HydropowerUnitTargetVo.java index e80e55a..a74368e 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/HydropowerUnitTargetVo.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/HydropowerUnitTargetVo.java @@ -5,7 +5,6 @@ import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.util.List; -import java.util.Map; /** * @author ysj @@ -29,12 +28,30 @@ public class HydropowerUnitTargetVo { @ApiModelProperty(value = "当年发电量") private Float powerYear; + @ApiModelProperty(value = "当年发电量") + private Float powerYesterYear; + @ApiModelProperty(value = "当月发电量") private Float powerMon; @ApiModelProperty(value = "当日发电量") private Float powerDay; + @ApiModelProperty(value = "昨日发电量") + private Float powerYesterDay; + + @ApiModelProperty(value = "本次开机时间") + private String startDownTime; + + @ApiModelProperty(value = "本次开机时长") + private Double startupDownDuration; + + @ApiModelProperty(value = "年停机时长") + private Double shutDownDurationYear; + + @ApiModelProperty(value = "年开机时长") + private Double startupDurationYear; + @ApiModelProperty(value = "当日机组有功功率") private List activePowerVoList; diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/pv/PowerRainVo.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/pv/PowerRainVo.java new file mode 100644 index 0000000..0020a96 --- /dev/null +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/pv/PowerRainVo.java @@ -0,0 +1,26 @@ +package com.hnac.hzims.operational.main.vo.pv; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.NullSerializer; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @author ysj + */ +@Data +@ApiModel(value = "当日机组有功功率") +public class PowerRainVo { + + @ApiModelProperty(value = "日期") + private String date; + + @ApiModelProperty(value = "发电量") + @JsonSerialize(nullsUsing = NullSerializer.class) + private Double generate; + + @ApiModelProperty(value = "降雨") + @JsonSerialize(nullsUsing = NullSerializer.class) + private Double rain; +} diff --git a/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/task/feign/IInspectTaskClient.java b/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/task/feign/IInspectTaskClient.java index 2804780..79db235 100644 --- a/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/task/feign/IInspectTaskClient.java +++ b/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/task/feign/IInspectTaskClient.java @@ -42,7 +42,7 @@ public interface IInspectTaskClient { * @param inspectType 查询类型 1:为运行人员 2:管理及其他人员 * @return */ - @GetMapping(EXPIRE_INSPECT) + @GetMapping(GET_INSPECT_TASK_CHECK) R getInspectTaskCheck(@RequestParam("startDate") String startDate, @RequestParam("endDate") String endDate, @RequestParam("dept") Long dept, diff --git a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/MiddleApplication.java b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/MiddleApplication.java index b3e7bd1..99004da 100644 --- a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/MiddleApplication.java +++ b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/MiddleApplication.java @@ -15,12 +15,6 @@ import org.springframework.context.annotation.ComponentScan; @MapperScan(basePackages = {"com.hnac.hzinfo.**.mapper","com.hnac.hzims.**.mapper"}) @EnableFeignClients(basePackages = {"org.springblade", "com.hnac"}) public class MiddleApplication { -// static { -// System.setProperty("spring.cloud.nacos.discovery.server-addr", "http://175.6.40.67:10042"); -// System.setProperty("spring.cloud.nacos.config.server-addr", "http://175.6.40.67:10042"); -// System.setProperty("spring.cloud.nacos.username", "nacos"); -// System.setProperty("spring.cloud.nacos.password", "nacos"); -// } public static void main(String[] args) { BladeApplication.run("hzims-middle", MiddleApplication.class, args); diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/GenerationScheduledTask.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/GenerationScheduledTask.java index bd21b68..29b4042 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/GenerationScheduledTask.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/GenerationScheduledTask.java @@ -8,6 +8,7 @@ import lombok.extern.slf4j.Slf4j; import org.springblade.core.tool.utils.DateUtil; import org.springblade.core.tool.utils.Func; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; import java.util.Arrays; @@ -69,4 +70,20 @@ public class GenerationScheduledTask { return new ReturnT<>("SUCCESS"); } + /** + * 新版-近3年发电量 + * @param param + * @return + */ + //@XxlJob(LOAD_THREE_YEAR_POWER_GENERATION) + @Scheduled(cron = "0/40 * * * * ? ") + public ReturnT loadThreeYearPowerGeneration() { + String param = ""; + if (Func.isBlank(param)) { + param = DateUtil.format(new Date(), "yyyy-MM"); + } + service.loadThreeYearPowerGeneration(param,Arrays.asList(HomePageConstant.HYDROPOWER,HomePageConstant.PHOTOVOLTAIC),2,3); + return new ReturnT<>("SUCCESS"); + } + } \ No newline at end of file diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/RealTargetScheduledTask.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/RealTargetScheduledTask.java index 4e68cab..e082119 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/RealTargetScheduledTask.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/RealTargetScheduledTask.java @@ -8,6 +8,7 @@ import lombok.extern.slf4j.Slf4j; import org.springblade.core.tool.utils.DateUtil; import org.springblade.core.tool.utils.Func; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; import java.util.Arrays; @@ -58,9 +59,10 @@ public class RealTargetScheduledTask { /** * 水电站-机组指标加载 */ - @XxlJob(LOAD_HYDROPOWER_UNIT_TARGET) - //@Scheduled(cron = "0/40 * * * * ? ") - public ReturnT loadHydropowerTarget(String param) { + //@XxlJob(LOAD_HYDROPOWER_UNIT_TARGET) + @Scheduled(cron = "0/40 * * * * ? ") + public ReturnT loadHydropowerTarget() { + String param = ""; if (Func.isBlank(param)) { param = DateUtil.format(new Date(), "yyyy-MM"); } diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/ObtainGenerationService.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/ObtainGenerationService.java index 61c6fc7..50210c2 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/ObtainGenerationService.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/ObtainGenerationService.java @@ -1,5 +1,7 @@ package com.hnac.hzims.scheduled.service.operation.home; +import java.util.List; + /** * @author ysj */ @@ -10,4 +12,6 @@ public interface ObtainGenerationService { void thirtyDayPowerGeneration(String param); void thisDayPowerGeneration(String param); + + void loadThreeYearPowerGeneration(String param, List types, Integer serveType,int year); } diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/ObtainGenerationServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/ObtainGenerationServiceImpl.java index 632c2f2..de2d8f6 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/ObtainGenerationServiceImpl.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/ObtainGenerationServiceImpl.java @@ -2,6 +2,7 @@ package com.hnac.hzims.scheduled.service.operation.home.impl; import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.TypeReference; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.google.common.util.concurrent.ThreadFactoryBuilder; import com.hnac.hzims.equipment.entity.ThirtyGenerationEntity; @@ -59,8 +60,11 @@ public class ObtainGenerationServiceImpl implements ObtainGenerationService { @Value("${hzims.equipment.emInfo.emInfoList}") public String device_cache_cofig_final; + private final static String recent_year_power_data = "hzims:operation:key:power:data"; + private static final ExecutorService pool = new ThreadPoolExecutor(10, 10, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>(1024), new ThreadFactoryBuilder().setNameFormat("obtain-generation-pool-%d").build() , new ThreadPoolExecutor.CallerRunsPolicy()); + /** * 设备近3年发电量数据 : 按月分割 * @param param @@ -131,8 +135,8 @@ public class ObtainGenerationServiceImpl implements ObtainGenerationService { CountDownLatch countDownLatch = new CountDownLatch(limits.size()); List saves = new CopyOnWriteArrayList<>(); for(List item : limits){ - try{ - pool.submit(()->{ + pool.submit(()->{ + try{ item.forEach(station->{ // 站点设备集合 List eminfos = devices.stream().filter(device -> device.getCreateDept().equals(station.getRefDept())).collect(Collectors.toList()); @@ -175,10 +179,11 @@ public class ObtainGenerationServiceImpl implements ObtainGenerationService { }); countDownLatch.countDown(); log.error("save_generation_execute_complete: {}" ,item.stream().map(StationEntity::getName).collect(Collectors.toList())); - }); - }catch (Exception e){ - log.error("save_generation_execute_complete_error : {}" ,e.getMessage()); - } + }catch (Exception e){ + countDownLatch.countDown(); + log.error("save_generation_execute_complete_error : {}" ,e.getMessage()); + } + }); } // 等待所有线程执行完成 try { @@ -216,9 +221,7 @@ public class ObtainGenerationServiceImpl implements ObtainGenerationService { calendar.set(Calendar.YEAR, calendar.get(Calendar.YEAR) - 3); calendar.add(Calendar.MONTH, -calendar.get(Calendar.MONTH)); String start = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATE) + " 00:00:00"; - stations.forEach(station->{ - this.threeGenerateService.saveBatch(this.saveFillGenerate(station,start,end)); - }); + stations.forEach(station-> this.threeGenerateService.saveBatch(this.saveFillGenerate(station,start,end))); } /** @@ -306,6 +309,7 @@ public class ObtainGenerationServiceImpl implements ObtainGenerationService { log.error("save_generation_execute_complete: {}" ,item.stream().map(StationEntity::getName).collect(Collectors.toList())); }); }catch (Exception e){ + countDownLatch.countDown(); log.error("save_generation_execute_complete_error : {}" ,e.getMessage()); } } @@ -378,6 +382,7 @@ public class ObtainGenerationServiceImpl implements ObtainGenerationService { log.error("save_generation_execute_complete: {}" ,item.stream().map(StationEntity::getName).collect(Collectors.toList())); }); }catch (Exception e){ + countDownLatch.countDown(); log.error("save_generation_execute_complete_error : {}" ,e.getMessage()); } } @@ -437,4 +442,54 @@ public class ObtainGenerationServiceImpl implements ObtainGenerationService { private static Integer countStep(Integer size) { return (size + 3 - 1) / 3; } + + + /** + * 新版-近3年发电量 + * @param param + */ + @Override + public void loadThreeYearPowerGeneration(String param, List types, Integer serveType,int year) { + // 站点查询 + List stations = stationService.list(new LambdaQueryWrapper() {{ + if (CollectionUtil.isNotEmpty(types)) { + in(StationEntity::getType, types); + } + }}); + // 开始时间 + 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); + // 结束日期 + 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); + + List generations = threeGenerateService.list(Wrappers.lambdaQuery() + .in(ThreeGenerationEntity::getStationId,stations.stream().map(StationEntity::getCode).collect(Collectors.toList())) + .ge(ThreeGenerationEntity::getStrMonth,start) + .le(ThreeGenerationEntity::getStrMonth,end) + ); + if(CollectionUtil.isEmpty(generations)){ + return; + } + Map> map = generations.stream().collect(Collectors.groupingBy(ThreeGenerationEntity::getStationId)); + // 定义接收参数 + Map> container = new HashMap<>(); + map.forEach((key, value) -> { + Optional optional = stations.stream().filter(o -> o.getCode().equals(key)).findFirst(); + if (!optional.isPresent()) { + return; + } + // 根据月份分组 + Map> months = value.stream().collect(Collectors.groupingBy(ThreeGenerationEntity::getStrMonth)); + // 接收月份发电量对象 + Map son = new HashMap<>(); + // 遍历月份数据 + months.entrySet().stream().sorted(Map.Entry.comparingByKey()).forEach(iter -> son.put(iter.getKey(), (float) iter.getValue().stream().mapToDouble(o -> o.getGenerate().doubleValue()).sum())); + container.put(optional.get().getCode(), son); + }); + redisTemplate.opsForValue().set(recent_year_power_data, container); + } } \ No newline at end of file diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/RealTargetServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/RealTargetServiceImpl.java index 24efa10..746b25b 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/RealTargetServiceImpl.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/RealTargetServiceImpl.java @@ -7,6 +7,8 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.google.common.util.concurrent.ThreadFactoryBuilder; import com.hnac.hzims.EquipmentConstants; import com.hnac.hzims.equipment.entity.EmParamEntity; +import com.hnac.hzims.equipment.entity.ThirtyGenerationEntity; +import com.hnac.hzims.equipment.entity.ThreeGenerationEntity; import com.hnac.hzims.equipment.vo.EminfoAndEmParamVo; import com.hnac.hzims.hzimsweather.feign.IHeWeatherWeatherClient; import com.hnac.hzims.hzimsweather.vo.RainFallCountByMonthVo; @@ -19,6 +21,8 @@ import com.hnac.hzims.operational.station.entity.HzimsAnalyzeModelStationEntity; import com.hnac.hzims.operational.station.entity.StationEntity; import com.hnac.hzims.scheduled.service.equipment.DeviceParamService; import com.hnac.hzims.scheduled.service.equipment.DeviceService; +import com.hnac.hzims.scheduled.service.equipment.ThirtyGenerateService; +import com.hnac.hzims.scheduled.service.equipment.ThreeGenerateService; import com.hnac.hzims.scheduled.service.operation.fill.*; import com.hnac.hzims.scheduled.service.operation.home.ModelStationService; import com.hnac.hzims.scheduled.service.operation.home.RealTargetService; @@ -92,6 +96,10 @@ public class RealTargetServiceImpl implements RealTargetService { private final ModelStationService modelStationService; + private final ThreeGenerateService threeGenerateService; + + private final ThirtyGenerateService thirtyGenerateService; + private final RedisTemplate redisTemplate; private final IHeWeatherWeatherClient heWeatherWeatherClient; @@ -102,6 +110,7 @@ public class RealTargetServiceImpl implements RealTargetService { private final DeviceDataClient deviceDataClient; + @Value("${hzims.equipment.emInfo.emInfoList}") public String device_cache_cofig_final; @@ -272,10 +281,17 @@ public class RealTargetServiceImpl implements RealTargetService { if(CollectionUtil.isEmpty(stations)){ return; } + // 设备30日发电量 + List generations = this.thirtyGenerations(stations.stream().map(StationEntity::getCode).collect(Collectors.toList())); + // 设备当年发电量 + List generationYears = this.threeGenerations(stations.stream().map(StationEntity::getCode).collect(Collectors.toList())); + // 设备去年发电量 + List generationYesterYears = this.threeYesterGenerations(stations.stream().map(StationEntity::getCode).collect(Collectors.toList())); // 补充填补发电指标 List targets = this.generteFill(stations); // 水电站设备 List devices = this.pumpDevices(stations.stream().map(StationEntity::getRefDept).collect(Collectors.toList())); + Random random = new Random(); if(CollectionUtil.isNotEmpty(devices)){ CountDownLatch countDownLatch = new CountDownLatch(devices.size()); for(EminfoAndEmParamVo device : devices) { @@ -283,19 +299,34 @@ public class RealTargetServiceImpl implements RealTargetService { try{ HydropowerUnitTargetVo target = new HydropowerUnitTargetVo(); target.setDeptId(device.getCreateDept()); + Optional station = stations.stream().filter(o->o.getRefDept().equals(device.getCreateDept())).findFirst(); + station.ifPresent(stationEntity -> target.setDeptName(stationEntity.getName())); target.setDeviceCode(device.getEmCode()); target.setDeviceName(device.getName()); - target.setDeptName(device.getName()); // 当年发电量 - target.setPowerYear(this.getGenerationPower(device, 0)); + target.setPowerYear(this.devicePowerYear(generationYears,device)); + // 去年发电量 + target.setPowerYesterYear(this.devicePowerYesterYear(generationYesterYears,device)); // 当月发电量 - target.setPowerMon(this.getGenerationPower(device, 1)); + target.setPowerMon(this.devicePowerMon(generationYears,device)); // 当日发电量 - target.setPowerDay(this.getGenerationPower(device, 2)); - // 当天有功功率 + target.setPowerDay(this.devicePowerDay(generations,device)); + // 昨日发电量 + target.setPowerYesterDay(this.devicePowerYesterDay(generations,device)); + // 近24小时有功功率 target.setActivePowerVoList(this.getLoadsByDay(device)); // 30天发电量 - target.setGenerationPowerVoList(this.getGenerationPowerList(device)); + target.setGenerationPowerVoList(this.getGenerationPowerList(generations,device)); + // FIXME 本次开机/停机时间 + Calendar calendar = Calendar.getInstance(); + calendar.add(Calendar.MINUTE,random.nextInt(1440)); + target.setStartDownTime(DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATETIME)); + // FIXME 本次开/停机时长 + target.setStartupDownDuration(random.nextDouble() * 24); + // FIXME 今年开机时长 + target.setStartupDurationYear(random.nextDouble() * 5024); + // FIXME 今年停机时长 + target.setShutDownDurationYear(5024 - target.getStartupDurationYear()); targets.add(target); countDownLatch.countDown(); }catch (Exception exception){ @@ -314,9 +345,79 @@ public class RealTargetServiceImpl implements RealTargetService { if(CollectionUtil.isEmpty(targets)){ return; } + redisTemplate.opsForValue().set(load_hydropower_unit_target_key,targets); } + + /** + * 去年发电量 + * @param generations + * @param device + * @return + */ + private Float devicePowerYesterYear(List generations, EminfoAndEmParamVo device) { + if(CollectionUtil.isEmpty(generations)){ + return 0f; + } + return (float) generations.stream().filter(o -> StringUtil.isNotBlank(o.getDeviceCode()) && o.getDeviceCode().equals(device.getEmCode())).mapToDouble(o->o.getGenerate().doubleValue()).sum(); + } + + /** + * 当年发电量 + * @param generations + * @param device + * @return + */ + private Float devicePowerYear(List generations, EminfoAndEmParamVo device) { + if(CollectionUtil.isEmpty(generations)){ + return 0f; + } + return (float) generations.stream().filter(o -> StringUtil.isNotBlank(o.getDeviceCode()) && o.getDeviceCode().equals(device.getEmCode())).mapToDouble(o->o.getGenerate().doubleValue()).sum(); + } + + /** + * 当月发电量 + * @param generations + * @param device + * @return + */ + private Float devicePowerMon(List generations, EminfoAndEmParamVo device) { + if(CollectionUtil.isEmpty(generations)){ + return 0f; + } + return (float) generations.stream().filter(o-> StringUtil.isNotBlank(o.getDeviceCode()) && o.getDeviceCode().equals(device.getEmCode()) && o.getStrMonth().contains(DateUtil.format(new Date(),"yyyy-MM"))).mapToDouble(o->o.getGenerate().doubleValue()).sum(); + + } + + /** + * 设备当日发电量 + * @param generations + * @param device + * @return + */ + private Float devicePowerDay(List generations, EminfoAndEmParamVo device) { + if(CollectionUtil.isEmpty(generations)){ + return 0f; + } + return (float) generations.stream().filter(o->o.getDeviceCode().equals(device.getEmCode()) && o.getStrDay().contains(DateUtil.format(new Date(),DateUtil.PATTERN_DATE))).mapToDouble(o->o.getGenerate().doubleValue()).sum(); + } + + /** + * 设备昨日发电量 + * @param generations + * @param device + * @return + */ + private Float devicePowerYesterDay(List generations, EminfoAndEmParamVo device) { + if(CollectionUtil.isEmpty(generations)){ + return 0f; + } + Calendar calendar = Calendar.getInstance(); + calendar.add(Calendar.DAY_OF_MONTH,-1); + return (float) generations.stream().filter(o->o.getDeviceCode().equals(device.getEmCode()) && o.getStrDay().contains(DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATE))).mapToDouble(o->o.getGenerate().doubleValue()).sum(); + } + /** * 水利-泵组实时加载 * @param param @@ -1382,17 +1483,19 @@ public class RealTargetServiceImpl implements RealTargetService { * @return */ private List getLoadsByDay(EminfoAndEmParamVo device) { - // 开始日期 - String start = DateUtil.format(new Date(),DateUtil.PATTERN_DATE) + " 00:00:00"; + Calendar calendar = Calendar.getInstance(); // 结束日期 - String end = DateUtil.format(new Date(),DateUtil.PATTERN_DATE) + " 23:59:59"; + String end = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATETIME); + calendar.add(Calendar.DAY_OF_MONTH,-1); + // 开始日期 + String start = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATE) + " 00:00:00"; List records = dataService.periodTargetData(start, end, 3, 2, device.getEmCode(), HomePageConstant.PV_LOAD); if (CollectionUtil.isEmpty(records)) { return new ArrayList<>(); } return records.stream().map(record -> { ActivePowerVo load = new ActivePowerVo(); - Date time = DateUtil.parse(record.getTs(), "yyyy-MM-dd HH:mm:ss.s"); + Date time = DateUtil.parse(record.getTs(), "yyyy-MM-dd HH:mm:ss"); load.setStrHour(DateUtil.format(time,"yyyy-MM-dd HH")); load.setHour(time.getHours()); if(StringUtil.isNotBlank(record.getVal())){ @@ -1469,10 +1572,14 @@ public class RealTargetServiceImpl implements RealTargetService { target.setDeptName(station.getName()); // 当年发电量 target.setPowerYear(generateService.generate(year,station.getCode())); + // FIXME 去年发电量 + target.setPowerYesterYear(0f); // 当月发电量 target.setPowerMon(generateService.generate(mon,station.getCode())); // 当日发电量 target.setPowerDay(generateService.generate(day,station.getCode())); + // FIXME 昨日发电量 + target.setPowerYesterDay(0f); // 30天发电量 target.setGenerationPowerVoList(generateService.generate30Day(day,station.getCode())); return target; @@ -1875,33 +1982,78 @@ public class RealTargetServiceImpl implements RealTargetService { return dataService.periodTargetFloat(start,end,5,accessRules,device.getEmCode(),device.getRideCount(),HomePageConstant.HYDROPOWER_GENERATE_POWER); } + /** - * 近30天发电量 + * 站点设备近30天发电量 + * @param stations + * @return + */ + private List thirtyGenerations(List stations) { + Calendar calendar = Calendar.getInstance(); + String end = DateUtil.format(calendar.getTime(), DateUtil.PATTERN_DATE); + calendar.add(Calendar.DAY_OF_MONTH,-30); + String start = DateUtil.format(calendar.getTime(), DateUtil.PATTERN_DATE); + return thirtyGenerateService.list(Wrappers.lambdaQuery() + .in(ThirtyGenerationEntity::getStationId,stations) + .ge(ThirtyGenerationEntity::getStrDay,start) + .le(ThirtyGenerationEntity::getStrDay,end) + ); + } + + /** + * 站点设备今年发电量 + * @param stations + * @return + */ + private List threeGenerations(List stations) { + return threeGenerateService.list(Wrappers.lambdaQuery() + .in(ThreeGenerationEntity::getStationId,stations) + .like(ThreeGenerationEntity::getStrMonth,DateUtil.format(new Date(),"yyyy")) + ); + } + + /** + * 查询设备去年发电量 + * @param stations + * @return + */ + private List threeYesterGenerations(List stations) { + Calendar calendar = Calendar.getInstance(); + calendar.add(Calendar.YEAR,-1); + return threeGenerateService.list(Wrappers.lambdaQuery() + .in(ThreeGenerationEntity::getStationId,stations) + .like(ThreeGenerationEntity::getStrMonth,DateUtil.format(calendar.getTime(),"yyyy")) + ); + } + + + /** + * 设备近30天发电量组装 + * @param generations * @param device * @return */ - private List getGenerationPowerList(EminfoAndEmParamVo device) { + private List getGenerationPowerList(List generations,EminfoAndEmParamVo device) { Calendar calendar = Calendar.getInstance(); - String end = DateUtil.format(calendar.getTime(), DateUtil.PATTERN_DATETIME); - 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 start = DateUtil.format(calendar.getTime(), DateUtil.PATTERN_DATETIME); - List records = dataService.periodTargetData(start,end,5,EquipmentConstants.CycleTypeEnum.DAY_CYCLE.getType(),device.getEmCode(),HomePageConstant.HYDROPOWER_GENERATE_POWER); - if(CollectionUtil.isEmpty(records)){ - return new ArrayList<>(); - } - return records.stream().map(record -> { - GenerationPowerVo generate = new GenerationPowerVo(); - Date time = DateUtil.parse(record.getTs(), "yyyy-MM-dd HH:mm:ss.s"); - generate.setDate(DateUtil.format(time,DateUtil.PATTERN_DATE)); - if(StringUtil.isEmpty(record.getVal())){ - generate.setGenerate(0f); + Date end = calendar.getTime(); + calendar.add(Calendar.DAY_OF_MONTH,-30); + Date start = calendar.getTime(); + List powers = new ArrayList<>(); + while (end.compareTo(start) > 0){ + GenerationPowerVo power = new GenerationPowerVo(); + if (CollectionUtil.isEmpty(generations)) { + power.setDate(DateUtil.format(start,DateUtil.PATTERN_DATE)); + power.setGenerate(0f); }else{ - generate.setGenerate(Float.parseFloat(String.valueOf(Double.parseDouble(record.getVal()) * device.getRideCount()))); + String date = DateUtil.format(start,DateUtil.PATTERN_DATE); + power.setDate(date); + power.setGenerate((float) generations.stream().filter(iter->iter.getDeviceCode().equals(device.getEmCode()) && iter.getStrDay().contains(date)).mapToDouble(o->o.getGenerate().doubleValue()).sum()); } - return generate; - }).collect(Collectors.toList()); + calendar.add(Calendar.DAY_OF_MONTH,1); + powers.add(power); + start = calendar.getTime(); + } + return powers; } + } \ No newline at end of file diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/feign/InspectTaskClient.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/feign/InspectTaskClient.java index 0fc8788..b7df8c9 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/feign/InspectTaskClient.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/feign/InspectTaskClient.java @@ -84,6 +84,7 @@ public class InspectTaskClient implements IInspectTaskClient { * @param deptId * @return */ + @GetMapping(EXPIRE_INSPECT) @Override public List expireInspect(String start, String end, Long deptId) { return taskService.list(Wrappers.lambdaQuery() diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/OperAccessLibraryServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/OperAccessLibraryServiceImpl.java index 019096a..5610484 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/OperAccessLibraryServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/OperAccessLibraryServiceImpl.java @@ -86,8 +86,12 @@ public class OperAccessLibraryServiceImpl extends ServiceImpl detail(Long id) { + public R + detail(Long id) { OperAccessLibraryVO detail = OperAccessLibraryWrapper.build(emInfoClient).entityVO(super.getById(id)); + if(StringUtils.isEmpty(detail.getSafeInfos())){ + R.data(detail); + } detail.setDangerSources(dangerSourceClient.details(detail.getSafeInfos().split(","))); return R.data(detail); } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HydropowerServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HydropowerServiceImpl.java index 37e52f1..f40aac0 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HydropowerServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HydropowerServiceImpl.java @@ -6,6 +6,7 @@ import com.google.common.util.concurrent.ThreadFactoryBuilder; import com.hnac.hzims.equipment.entity.PlanGenerationEntity; import com.hnac.hzims.equipment.feign.IPlanGenertionClient; import com.hnac.hzims.equipment.vo.EminfoAndEmParamVo; +import com.hnac.hzims.hzimsweather.feign.IRainfallClient; import com.hnac.hzims.hzimsweather.response.weather.Daily; import com.hnac.hzims.hzimsweather.response.weather.HeWeatherWeatherDailyResponse; import com.hnac.hzims.hzimsweather.response.weather.HeWeatherWeatherNowResponse; @@ -17,11 +18,11 @@ import com.hnac.hzims.operational.defect.entity.OperPhenomenonEntity; import com.hnac.hzims.operational.defect.service.IOperPhenomenonService; import com.hnac.hzims.operational.duty.service.IImsDutyMainService; import com.hnac.hzims.operational.duty.vo.DutyMainInfoVo; -import com.hnac.hzims.operational.fill.entity.GenerateEntity; import com.hnac.hzims.operational.main.constant.HomePageConstant; import com.hnac.hzims.operational.main.entity.UserDeptEntity; import com.hnac.hzims.operational.main.service.*; import com.hnac.hzims.operational.main.vo.*; +import com.hnac.hzims.operational.main.vo.pv.PowerRainVo; import com.hnac.hzims.operational.maintenance.entity.OperMaintenanceTaskEntity; import com.hnac.hzims.operational.maintenance.service.IOperMaintenanceTaskService; import com.hnac.hzims.operational.station.entity.StationEntity; @@ -92,6 +93,8 @@ public class HydropowerServiceImpl implements HydropowerService { private final ISysClient sysClient; + private final IRainfallClient rainfallClient; + private final ITicketInfoClient ticketInfoClient; private final IPlanGenertionClient planGenertionClient; @@ -139,6 +142,8 @@ public class HydropowerServiceImpl implements HydropowerService { Map weather = this.getWeather(Collections.singletonList(station.getCode())); // 七天天气 Map weekWeather = this.getWeekWeather(Collections.singletonList(station.getCode())); + // 近30天降雨 + List> rains = this.get30DayRain(station.getCode()); HydropowerStationVo response = new HydropowerStationVo(); // 近年发电量数据 Map> map = (Map>) redisTemplate.opsForValue().get(recent_year_power_data); @@ -161,22 +166,104 @@ public class HydropowerServiceImpl implements HydropowerService { response.setPowerSum(this.getPowerSum(realList,station.getRefDept())); // 总有功单位 response.setPowerUnit(this.getPowerUnit(realList,station.getRefDept())); + // 容量利用率 + response.setCapacityRate(this.getCapacityRate(response)); // 月计划发电量 response.setPlanPowerMon(this.getPlanPowerrMon(station.getCode())); // 年计划发电量 response.setPlanPowerYear(this.getPlanPowerYear(station.getCode())); // 年发电量、月发电量 this.stationMonthPower(station.getCode(),map,response); - // 水位、水位曲线 + // 水位 this.handleWaterLeve(station.getCode(),response); - // 年发电量完成百分比 + // 今日,昨日发电量 + this.powerDay(station,targetList,response); + // 年发电量完成百分比曲线 response.setPowerYearMap(this.handlePowerFinish(Collections.singletonList(station),map)); // 设备信息 response.setDeviceList(this.getDevices(station,realList,targetList)); + // 降雨 + response.setPowerRains(this.getPowerRains(station,response.getDeviceList(),rains)); return response; } /** + * 站点发电、降雨曲线 + * @param devices + * @param rains + * @return + */ + private List getPowerRains(StationEntity station,List devices, List> rains) { + List powers = new ArrayList<>(); + if(CollectionUtil.isNotEmpty(devices)){ + devices.forEach(device->{ + if(ObjectUtil.isNotEmpty(device.getHydropowerPumpTargetVo()) && CollectionUtil.isNotEmpty(device.getHydropowerPumpTargetVo().getGenerationPowerVoList())){ + powers.addAll(device.getHydropowerPumpTargetVo().getGenerationPowerVoList()); + } + }); + } + // 根据日期遍历 + List days = this.get30Day(); + return days.stream().map(day->{ + PowerRainVo powerRain = new PowerRainVo(); + powerRain.setDate(day); + if(CollectionUtil.isEmpty(powers)){ + powerRain.setGenerate(0.0); + }else{ + powerRain.setGenerate(powers.stream().filter(o-> day.equals(o.getDate())).mapToDouble(GenerationPowerVo::getGenerate).sum()); + } + if(CollectionUtil.isEmpty(rains)){ + powerRain.setRain(0.0); + }else{ + powerRain.setRain(rains.stream().mapToDouble(map->{ + if (map.get("fx_date").equals(day)) { + Object object = map.get("precip"); + if(ObjectUtil.isEmpty(object)){ + return 0.0; + }else{ + return Double.parseDouble(object.toString()); + } + } + return 0.0; + }).sum()); + } + return powerRain; + }).collect(Collectors.toList()); + } + + /** + * 容量利用率 + * @param response + * @return + */ + private double getCapacityRate(HydropowerStationVo response) { + if(response.getInstalledCapacity() > 0 && response.getPowerSum() > 0){ + return BigDecimal.valueOf(response.getPowerSum() / response.getInstalledCapacity() * 100).setScale(2, RoundingMode.HALF_UP).doubleValue(); + } + return 0.0; + } + + /** + * 今日、昨日发电量 + * @param station + * @param targetList + * @param response + */ + private void powerDay(StationEntity station, List targetList, HydropowerStationVo response) { + response.setPowerDay(0f); + response.setPowerYesterDay(0f); + if(CollectionUtil.isEmpty(targetList)){ + return; + } + List valids = targetList.stream().filter(o-> null != station.getRefDept() && station.getRefDept().equals(o.getDeptId())).collect(Collectors.toList()); + if(CollectionUtil.isEmpty(valids)){ + return; + } + response.setPowerDay((float)valids.stream().mapToDouble(HydropowerUnitTargetVo::getPowerDay).sum()); + response.setPowerYesterDay((float)valids.stream().mapToDouble(HydropowerUnitTargetVo::getPowerYesterDay).sum()); + } + + /** * 水电站-机组列表 * @param deptId * @return @@ -223,10 +310,8 @@ public class HydropowerServiceImpl implements HydropowerService { hydropowerUnitVo.setHydropowerPumpRealVo(real); // 指标数据 if(CollectionUtil.isNotEmpty(validTargetList)){ - List target = targetList.stream().filter(o->real.getDeviceCode().equals(o.getDeviceCode())).collect(Collectors.toList()); - if(CollectionUtil.isNotEmpty(target)){ - hydropowerUnitVo.setHydropowerPumpTargetVo(target.get(0)); - } + Optional optional = targetList.stream().filter(o->real.getDeviceCode().equals(o.getDeviceCode())).findFirst(); + optional.ifPresent(hydropowerUnitVo::setHydropowerPumpTargetVo); } list.add(hydropowerUnitVo); } @@ -292,6 +377,50 @@ public class HydropowerServiceImpl implements HydropowerService { } /** + * 获取30天 + * @return + */ + private List get30Day() { + List times = new ArrayList<>(); + Calendar calendar = Calendar.getInstance(); + Date end = calendar.getTime(); + 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)); + calendar.add(Calendar.DAY_OF_MONTH,-29); + Date start = calendar.getTime(); + while (start.compareTo(end) < 0) { + times.add(DateUtil.format(calendar.getTime(),"yyyy-MM-dd")); + calendar.add(Calendar.DAY_OF_MONTH,1); + start = calendar.getTime(); + } + return times; + } + + /** + * 近30天降雨 + * @param code + * @return + */ + private List> get30DayRain(String code) { + Calendar calendar = Calendar.getInstance(); + String endTime = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATETIME); + calendar.add(Calendar.DAY_OF_MONTH,-1); + String rainEnd = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATE); + 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)); + calendar.add(Calendar.DAY_OF_MONTH,-29); + String rainStart = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATE); + R>> rains = rainfallClient.getDurationRainFall(code,rainStart,rainEnd); + if(!rains.isSuccess() || CollectionUtil.isEmpty(rains.getData())){ + return new ArrayList<>(); + } + return rains.getData(); + } + + + /** * 获取设备装机容量 * @param list * @param refDept @@ -438,7 +567,6 @@ public class HydropowerServiceImpl implements HydropowerService { WaterLevelVo level = validList.get(0); // 前池水位、当日水位曲线 response.setFrontWaterLevel(level.getFrontWaterLevel()); - response.setFrontCurveMap(level.getFrontCurveMap()); } /** diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarMapper.xml b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarMapper.xml index 61bea9f..82c6fae 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarMapper.xml +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarMapper.xml @@ -4,7 +4,7 @@ SELECT - t1.unit, t1.car_brand, t1.plate_number, DATE_FORMAT(t2.end_time, '%m') as dateTime, sum(t2.miles) as miles + t1.unit, t1.car_brand, t1.plate_number, DATE_FORMAT(t2.end_time, '%m') as dateTime, sum(t2.miles) as miles, + t1.create_user, t1.create_dept FROM hzims_car t1 LEFT JOIN hzims_car_used_record t2 ON t1.id = t2.car_id diff --git a/hzims-service/ticket/pom.xml b/hzims-service/ticket/pom.xml index d1732f0..f5bfa18 100644 --- a/hzims-service/ticket/pom.xml +++ b/hzims-service/ticket/pom.xml @@ -15,7 +15,7 @@ UTF-8 UTF-8 - 1.0.3 + 1.1.5 1.9.6 4.1.2 diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/TicketApplication.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/TicketApplication.java index 4db5df6..17e8860 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/TicketApplication.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/TicketApplication.java @@ -24,10 +24,4 @@ public class TicketApplication { public static void main(String[] args) { BladeApplication.run(TicketConstants.APP_NAME, TicketApplication.class, args); } - -// @Override -// protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) { -// return BladeApplication.createSpringApplicationBuilder(builder, TicketConstants.APP_NAME, TicketApplication.class); -// } - -} +} \ No newline at end of file diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/mapper/xml/OperRepairMapper.xml b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/mapper/OperRepairMapper.xml similarity index 100% rename from hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/mapper/xml/OperRepairMapper.xml rename to hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/mapper/OperRepairMapper.xml diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/mapper/xml/WorkTaskMapper.xml b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/mapper/WorkTaskMapper.xml similarity index 100% rename from hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/mapper/xml/WorkTaskMapper.xml rename to hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/mapper/WorkTaskMapper.xml diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/mapper/StandardTicketInfoMapper.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/mapper/StandardTicketInfoMapper.java index 48cd76e..9a86545 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/mapper/StandardTicketInfoMapper.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/mapper/StandardTicketInfoMapper.java @@ -1,16 +1,11 @@ package com.hnac.hzims.ticket.standardTicket.mapper; -import com.baomidou.mybatisplus.core.conditions.Wrapper; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.Constants; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.hnac.hzims.ticket.standardTicket.entity.StandardTicketInfoEntity; import com.hnac.hzims.ticket.standardTicket.vo.OperateTicketStatisticVO; -import com.hnac.hzims.ticket.standardTicket.vo.OperateVo; -import com.hnac.hzims.ticket.workTicket.entity.WorkTicketInfoEntity; import com.hnac.hzims.vo.SafeCheckStatisticVO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -30,14 +25,9 @@ public interface StandardTicketInfoMapper extends UserDataScopeBaseMapper deptIdList); - /** * 分页查询 * @param searchPage @@ -61,7 +50,6 @@ public interface StandardTicketInfoMapper extends UserDataScopeBaseMapper selectPages(Page searchPage, @Param(Constants.WRAPPER) QueryWrapper queryWrapper); - List selectTicketList(@Param(Constants.WRAPPER) QueryWrapper queryWrapper); IPage pageCondition(IPage page, @Param(Constants.WRAPPER) QueryWrapper queryWrapper); } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/mapper/xml/StandardTicketInfoMapper.xml b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/mapper/StandardTicketInfoMapper.xml similarity index 92% rename from hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/mapper/xml/StandardTicketInfoMapper.xml rename to hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/mapper/StandardTicketInfoMapper.xml index e4071b5..4e1309d 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/mapper/xml/StandardTicketInfoMapper.xml +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/mapper/StandardTicketInfoMapper.xml @@ -39,23 +39,6 @@ and MONTH(t.CREATE_TIME) = #{month} and e.status = 1; - - + + diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/mapper/xml/StandardTicketMeasureMapper.xml b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/mapper/StandardTicketMeasureMapper.xml similarity index 100% rename from hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/mapper/xml/StandardTicketMeasureMapper.xml rename to hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/mapper/StandardTicketMeasureMapper.xml diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/IStandardTicketInfoService.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/IStandardTicketInfoService.java index af31217..6a98d18 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/IStandardTicketInfoService.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/IStandardTicketInfoService.java @@ -16,6 +16,7 @@ import com.hnac.hzims.ticket.twoTicket.vo.operation.StandardTicketInfoVo; import com.hnac.hzims.ticket.twoTicket.vo.ticket.StandardTicketCountQueryVo; import com.hnac.hzims.ticket.workTicket.vo.TicketMonthVO; +import com.hnac.hzims.vo.SafeCheckStatisticVO; import org.springblade.core.mp.support.BladePage; import org.springblade.core.mp.support.Query; import org.springblade.core.tool.api.R; @@ -81,10 +82,10 @@ public interface IStandardTicketInfoService extends IService depatList - * @param LocalDateTime firstDateTime - * @param LocalDateTime now - * @return DoublePassRateVO + * @param depatList + * @param firstDateTime + * @param now + * @return */ DoublePassRateVO getDoublePassRate(List depatList, LocalDateTime firstDateTime, LocalDateTime now); @@ -151,4 +152,6 @@ public interface IStandardTicketInfoService extends IService documents, String savePath) throws IOException { FileOutputStream out = new FileOutputStream(savePath); try { diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/FirstWorkTicketServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/FirstWorkTicketServiceImpl.java index 15eeb51..cfee432 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/FirstWorkTicketServiceImpl.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/FirstWorkTicketServiceImpl.java @@ -370,11 +370,11 @@ public class FirstWorkTicketServiceImpl extends ServiceImpl getOperateTicketCheck(@RequestParam("startDate") String startDate, @RequestParam("endDate") String endDate, @RequestParam("dept") Long dept) { - StandardTicketInfoServiceImpl service = SpringUtil.getBean(StandardTicketInfoServiceImpl.class); - SafeCheckStatisticVO vo = service.getBaseMapper().getOperateTicketStatistic(startDate,endDate,dept); + SafeCheckStatisticVO vo = standardTicketInfoService.getOperateTicketStatistic(startDate,endDate,dept); //查询合格率 保留两位小数 if(vo == null){ vo = new SafeCheckStatisticVO(); diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/mapper/xml/TwoTicketMatterLibraryMapper.xml b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/mapper/TwoTicketMatterLibraryMapper.xml similarity index 100% rename from hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/mapper/xml/TwoTicketMatterLibraryMapper.xml rename to hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/mapper/TwoTicketMatterLibraryMapper.xml diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/mapper/xml/WorkTicketDelayMapper.xml b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/mapper/WorkTicketDelayMapper.xml similarity index 100% rename from hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/mapper/xml/WorkTicketDelayMapper.xml rename to hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/mapper/WorkTicketDelayMapper.xml diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/mapper/xml/WorkTicketFlowMapper.xml b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/mapper/WorkTicketFlowMapper.xml similarity index 100% rename from hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/mapper/xml/WorkTicketFlowMapper.xml rename to hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/mapper/WorkTicketFlowMapper.xml diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/mapper/xml/WorkTicketInfoMapper.xml b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/mapper/WorkTicketInfoMapper.xml similarity index 99% rename from hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/mapper/xml/WorkTicketInfoMapper.xml rename to hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/mapper/WorkTicketInfoMapper.xml index e3183c2..4e301db 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/mapper/xml/WorkTicketInfoMapper.xml +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/mapper/WorkTicketInfoMapper.xml @@ -52,7 +52,7 @@ and ti.create_time < #{endDate} - + and ti.create_dept = #{dept} diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/mapper/xml/WorkTicketMembersChangeMapper.xml b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/mapper/WorkTicketMembersChangeMapper.xml similarity index 100% rename from hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/mapper/xml/WorkTicketMembersChangeMapper.xml rename to hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/mapper/WorkTicketMembersChangeMapper.xml diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/mapper/xml/WorkTicketOperateTimeMapper.xml b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/mapper/WorkTicketOperateTimeMapper.xml similarity index 100% rename from hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/mapper/xml/WorkTicketOperateTimeMapper.xml rename to hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/mapper/WorkTicketOperateTimeMapper.xml diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/mapper/xml/WorkTicketPrincipalChangeMapper.xml b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/mapper/WorkTicketPrincipalChangeMapper.xml similarity index 100% rename from hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/mapper/xml/WorkTicketPrincipalChangeMapper.xml rename to hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/mapper/WorkTicketPrincipalChangeMapper.xml diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/mapper/xml/WorkTicketSafetyMeasureMapper.xml b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/mapper/WorkTicketSafetyMeasureMapper.xml similarity index 100% rename from hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/mapper/xml/WorkTicketSafetyMeasureMapper.xml rename to hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/mapper/WorkTicketSafetyMeasureMapper.xml diff --git a/hzims-service/ticket/src/main/resources/template/电气第一种工作票模版.docx b/hzims-service/ticket/src/main/resources/template/电气第一种工作票模版.docx index ebe394f..5a9cc2d 100644 Binary files a/hzims-service/ticket/src/main/resources/template/电气第一种工作票模版.docx and b/hzims-service/ticket/src/main/resources/template/电气第一种工作票模版.docx differ