From aa5a25c691b758eb3bf8dc394d9a8d9529600c8d Mon Sep 17 00:00:00 2001 From: yang_shj <1069818635@QQ.com> Date: Fri, 30 Aug 2024 17:01:37 +0800 Subject: [PATCH 1/6] =?UTF-8?q?#=E5=BC=80=E5=81=9C=E6=9C=BA=E8=AE=B0?= =?UTF-8?q?=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hzims/alarm/show/vo/AlarmHistoryParamVo.java | 9 ++--- .../main/constant/ScheduledConstant.java | 2 ++ .../hnac/hzims/alarm/show/mapper/AlarmMapper.xml | 7 ++-- .../scheduled/StartStopScheduledTask.java | 40 ++++++++++++++++++++++ .../service/startstop/StratStopService.java | 9 +++++ .../startstop/impl/StartStopServiceImpl.java | 24 +++++++++++++ 6 files changed, 85 insertions(+), 6 deletions(-) create mode 100644 hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/StartStopScheduledTask.java create mode 100644 hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/startstop/StratStopService.java create mode 100644 hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/startstop/impl/StartStopServiceImpl.java diff --git a/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/show/vo/AlarmHistoryParamVo.java b/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/show/vo/AlarmHistoryParamVo.java index 5660404..c2a6738 100644 --- a/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/show/vo/AlarmHistoryParamVo.java +++ b/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/show/vo/AlarmHistoryParamVo.java @@ -3,8 +3,6 @@ package com.hnac.hzims.alarm.show.vo; import io.swagger.annotations.ApiModelProperty; import lombok.Data; -import java.util.List; - /** * @author ysj * @date 2023/03/17 10:02:33 @@ -16,8 +14,11 @@ public class AlarmHistoryParamVo { @ApiModelProperty(value = "站点编号") private String stationId; - @ApiModelProperty(value = "告警日期 : yyyy-MM-dd") - private String alarmTime; + @ApiModelProperty(value = "告警开始日期 : yyyy-MM-dd") + private String startTime; + + @ApiModelProperty(value = "告警结束日期 : yyyy-MM-dd") + private String endTime; @ApiModelProperty(value = "告警类型") private Integer alarmType; 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 5dee662..9c3b265 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 @@ -13,4 +13,6 @@ public interface ScheduledConstant { String THIS_DAY_POWER_GENERATION = "thisDayPowerGeneration"; String LOAD_THREE_YEAR_POWER_GENERATION = "loadThreeYearPowerGeneration"; + + String THIS_DAY_START_STOP_RECORD = "thisDayStartStopRecord"; } \ No newline at end of file diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/mapper/AlarmMapper.xml b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/mapper/AlarmMapper.xml index f583dc7..a0fae3d 100644 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/mapper/AlarmMapper.xml +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/mapper/AlarmMapper.xml @@ -14,8 +14,11 @@ AND ALARM.STATION_ID = #{param.stationId} - - AND ALARM.ALARM_TIME like CONCAT('%',#{param.alarmTime}, '%') + + AND ALARM.ALARM_TIME >= #{param.startTime} + + + AND ALARM.ALARM_TIME <= #{param.endTime} AND ALARM.ALARM_TYPE = #{param.alarmType} diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/StartStopScheduledTask.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/StartStopScheduledTask.java new file mode 100644 index 0000000..cb02315 --- /dev/null +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/StartStopScheduledTask.java @@ -0,0 +1,40 @@ +package com.hnac.hzims.scheduled.scheduled; + +import com.hnac.hzims.scheduled.service.startstop.StratStopService; +import com.xxl.job.core.biz.model.ReturnT; +import com.xxl.job.core.handler.annotation.XxlJob; +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.stereotype.Component; + +import java.util.Date; + +import static com.hnac.hzims.operational.main.constant.ScheduledConstant.THIS_DAY_START_STOP_RECORD; + + +/** + * 开停机定时任务 + * @author ysj + */ +@Slf4j +@Component +public class StartStopScheduledTask { + + @Autowired + private StratStopService service; + + /** + * 单日开停机记录 + */ + @XxlJob(THIS_DAY_START_STOP_RECORD) + //@Scheduled(cron = "0/40 * * * * ? ") + public ReturnT thisDayStartStopRecord(String param) { + if (Func.isBlank(param)) { + param = DateUtil.format(new Date(), "yyyy-MM"); + } + service.thisDayStartStopRecord(param); + return new ReturnT<>("SUCCESS"); + } +} \ No newline at end of file diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/startstop/StratStopService.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/startstop/StratStopService.java new file mode 100644 index 0000000..c958aa4 --- /dev/null +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/startstop/StratStopService.java @@ -0,0 +1,9 @@ +package com.hnac.hzims.scheduled.service.startstop; + +/** + * @author ysj + */ +public interface StratStopService { + + void thisDayStartStopRecord(String param); +} diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/startstop/impl/StartStopServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/startstop/impl/StartStopServiceImpl.java new file mode 100644 index 0000000..2957df5 --- /dev/null +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/startstop/impl/StartStopServiceImpl.java @@ -0,0 +1,24 @@ +package com.hnac.hzims.scheduled.service.startstop.impl; + +import com.hnac.hzims.scheduled.service.startstop.StratStopService; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +/** + * @author ysj + */ +@Service +@RequiredArgsConstructor +@Slf4j +public class StartStopServiceImpl implements StratStopService { + + /** + * 单日开停机记录 + * @param param + */ + @Override + public void thisDayStartStopRecord(String param) { + + } +} \ No newline at end of file From 73ad522d4b5545eb9a88086a9e542d1cd4e80aa6 Mon Sep 17 00:00:00 2001 From: luyie Date: Fri, 30 Aug 2024 17:10:33 +0800 Subject: [PATCH 2/6] =?UTF-8?q?add:=E6=99=BA=E8=B0=B1=E5=88=86=E6=9E=90?= =?UTF-8?q?=E6=8C=89=E7=AB=99=E7=82=B9=E6=88=AA=E5=9B=BE=E5=88=86=E6=9E=90?= =?UTF-8?q?=EF=BC=8C=E4=BC=98=E5=8C=96=E8=AF=86=E5=88=AB=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E5=8C=B9=E9=85=8D=E8=BF=87=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ai/service/impl/ZhiPuBigModelServiceImpl.java | 41 +++++++++++++++------- 1 file changed, 28 insertions(+), 13 deletions(-) diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/ai/service/impl/ZhiPuBigModelServiceImpl.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/ai/service/impl/ZhiPuBigModelServiceImpl.java index af93b3c..37bb18f 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/ai/service/impl/ZhiPuBigModelServiceImpl.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/ai/service/impl/ZhiPuBigModelServiceImpl.java @@ -12,6 +12,7 @@ import com.hnac.hzinfo.inspect.ai.service.IZhiPuBigModelService; import com.hnac.hzinfo.inspect.ai.vo.ZhiPuImageAnalysisDTO; import com.hnac.hzinfo.inspect.utils.HiKUtil; import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.CollectionUtil; import org.springblade.core.tool.utils.StringUtil; @@ -21,6 +22,8 @@ import org.springframework.stereotype.Service; import java.util.ArrayList; import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; import java.util.stream.Collectors; /** @@ -29,6 +32,7 @@ import java.util.stream.Collectors; */ @Service @AllArgsConstructor +@Slf4j public class ZhiPuBigModelServiceImpl implements IZhiPuBigModelService { private final IStationVideoTypeClient stationVideoTypeClient; @@ -59,7 +63,6 @@ public class ZhiPuBigModelServiceImpl implements IZhiPuBigModelService { if (StringUtil.isBlank(url)) { continue; } - BigModelAnalysisRequestDTO zhiPuRequest = new BigModelAnalysisRequestDTO(); zhiPuRequest.setUrl(url); zhiPuRequest.setCheckTypeSonList(analysisTypeList); @@ -85,23 +88,35 @@ public class ZhiPuBigModelServiceImpl implements IZhiPuBigModelService { @Override public List getZhiPuAnalysisType(String[] originalCode) { List result = new ArrayList<>(); + Map typeMap = mappingTypes(); + for (String code : originalCode) { + String zhiPuType = typeMap.get(code); + if (StringUtil.isNotBlank(zhiPuType)) { + result.add(zhiPuType); + } + } + return result; + } + + public Map mappingTypes() { + Map typeMap = new ConcurrentHashMap<>(); R> zhiPuResponse = dictClient.getList(ZHI_PU_TYPE_KEY); - if (!zhiPuResponse.isSuccess()) { - return result; + if (!zhiPuResponse.isSuccess() || CollectionUtil.isEmpty(zhiPuResponse.getData())) { + return typeMap; + } + R> cameraResponse = dictClient.getList(CAMERA_TYPE_KEY); + if (!cameraResponse.isSuccess() || CollectionUtil.isEmpty(cameraResponse.getData())) { + return typeMap; } List zhiPuList = zhiPuResponse.getData(); - for (String code : originalCode) { - R valueResponse = dictClient.getValue(CAMERA_TYPE_KEY, code); - if (!valueResponse.isSuccess()|| StringUtil.isBlank(valueResponse.getData())) { - continue; - } - String value = valueResponse.getData(); - for (Dict dict : zhiPuList) { - if (value.indexOf(dict.getDictValue()) >= 0 || dict.getDictValue().indexOf(value) >= 0) { - result.add(dict.getDictKey()); + List cameraList = cameraResponse.getData(); + for (Dict camera : cameraList) { + for (Dict zhiPu : zhiPuList) { + if (camera.getDictValue().indexOf(zhiPu.getDictValue()) >= 0 || zhiPu.getDictValue().indexOf(camera.getDictValue()) >= 0) { + typeMap.put(camera.getDictKey(), zhiPu.getDictKey()); } } } - return result; + return typeMap; } } From d1ec70797613f4ca48661538adefa689a3ee9c53 Mon Sep 17 00:00:00 2001 From: yang_shj <1069818635@QQ.com> Date: Mon, 2 Sep 2024 08:36:00 +0800 Subject: [PATCH 3/6] =?UTF-8?q?#=E8=A7=86=E9=A2=91=E3=80=81=E5=AE=9E?= =?UTF-8?q?=E6=97=B6=E7=94=BB=E9=9D=A2=E9=85=8D=E7=BD=AE=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../history/controller/CommonUseController.java | 14 ++++---------- .../controller/StationFrameRecordController.java | 2 +- .../controller/StationVideoRecordController.java | 2 +- .../station/service/FrameRecordService.java | 1 + .../station/service/VideoRecordService.java | 1 + .../station/service/impl/FrameRecordServiceImpl.java | 15 +++++++++++++++ .../service/impl/UserDeptConfigServiceImpl.java | 13 ++++++++++++- .../station/service/impl/VideoRecordServiceImpl.java | 20 ++++++++++++++++++++ 8 files changed, 55 insertions(+), 13 deletions(-) diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/history/controller/CommonUseController.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/history/controller/CommonUseController.java index de7d4dc..3759081 100644 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/history/controller/CommonUseController.java +++ b/hzims-service/equipment/src/main/java/com/hnac/hzims/history/controller/CommonUseController.java @@ -1,25 +1,19 @@ package com.hnac.hzims.history.controller; -import com.baomidou.mybatisplus.core.metadata.IPage; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.hnac.hzims.history.entity.HistoryPointRecordEntity; -import com.hnac.hzims.history.entity.HistoryTemplateEntity; -import com.hnac.hzims.history.service.IHistoryDeviceService; import com.hnac.hzims.history.service.IHistoryPointRecordService; -import com.hnac.hzims.history.vo.*; -import com.hnac.hzinfo.sdk.v5.device.vo.DeviceInstanceVO; -import com.hnac.hzinfo.sdk.v5.hzfac.vo.FacDeviceVO; +import com.hnac.hzims.history.vo.HistoryPointRecordParamVo; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.AllArgsConstructor; import org.springblade.core.boot.ctrl.BladeController; -import org.springblade.core.mp.support.Condition; -import org.springblade.core.mp.support.Query; import org.springblade.core.tool.api.R; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; import java.util.List; -import java.util.Map; /** * @author ysj diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/StationFrameRecordController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/StationFrameRecordController.java index 91e8902..482c337 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/StationFrameRecordController.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/StationFrameRecordController.java @@ -31,7 +31,7 @@ public class StationFrameRecordController extends BladeController { @ApiOperationSupport(order = 1) @ApiOperation(value = "新增或修改站点视频播放保存记录", notes = "传入VideoRecordEntity") public R submit(@Valid @RequestBody FrameRecordEntity entity) { - return R.status(frameRecordService.saveOrUpdate(entity)); + return R.status(frameRecordService.submit(entity)); } @GetMapping("/query") diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/StationVideoRecordController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/StationVideoRecordController.java index 679d6e1..722dc2c 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/StationVideoRecordController.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/StationVideoRecordController.java @@ -29,7 +29,7 @@ public class StationVideoRecordController extends BladeController { @ApiOperationSupport(order = 1) @ApiOperation(value = "新增或修改站点视频播放保存记录", notes = "传入VideoRecordEntity") public R submit(@Valid @RequestBody VideoRecordEntity entity) { - return R.status(videoRecordService.saveOrUpdate(entity)); + return R.status(videoRecordService.submit(entity)); } @GetMapping("/query") diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/FrameRecordService.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/FrameRecordService.java index f22ba35..b1fe4f0 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/FrameRecordService.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/FrameRecordService.java @@ -7,4 +7,5 @@ import com.hnac.hzims.operational.station.entity.FrameRecordEntity; * @author ysj */ public interface FrameRecordService extends IService { + boolean submit(FrameRecordEntity entity); } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/VideoRecordService.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/VideoRecordService.java index 88bba2b..015812e 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/VideoRecordService.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/VideoRecordService.java @@ -7,4 +7,5 @@ import com.hnac.hzims.operational.station.entity.VideoRecordEntity; * @author ysj */ public interface VideoRecordService extends IService { + boolean submit(VideoRecordEntity entity); } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/FrameRecordServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/FrameRecordServiceImpl.java index 99408ed..1c509e4 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/FrameRecordServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/FrameRecordServiceImpl.java @@ -1,5 +1,7 @@ package com.hnac.hzims.operational.station.service.impl; +import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.hnac.hzims.operational.station.entity.FrameRecordEntity; import com.hnac.hzims.operational.station.entity.VideoRecordEntity; @@ -19,4 +21,17 @@ import org.springframework.stereotype.Service; @Slf4j public class FrameRecordServiceImpl extends ServiceImpl implements FrameRecordService { + @Override + public boolean submit(FrameRecordEntity entity) { + // 根据用户,站点查询历史配置记录 + FrameRecordEntity frameRecord = this.getOne(Wrappers.lambdaQuery() + .eq(FrameRecordEntity::getStationId,entity.getStationId()) + .eq(FrameRecordEntity::getCreateUser,entity.getCreateUser()) + ); + if(ObjectUtils.isEmpty(frameRecord)){ + return this.save(entity); + } + entity.setId(frameRecord.getId()); + return this.updateById(entity); + } } \ No newline at end of file diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/UserDeptConfigServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/UserDeptConfigServiceImpl.java index 50cfb2a..bbf9442 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/UserDeptConfigServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/UserDeptConfigServiceImpl.java @@ -1,9 +1,11 @@ package com.hnac.hzims.operational.station.service.impl; +import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.hnac.hzims.operational.station.entity.StationEntity; import com.hnac.hzims.operational.station.entity.UserDeptConfigEntity; +import com.hnac.hzims.operational.station.entity.VideoRecordEntity; import com.hnac.hzims.operational.station.mapper.UserDeptConfigMapper; import com.hnac.hzims.operational.station.service.IStationService; import com.hnac.hzims.operational.station.service.UserDeptConfigService; @@ -65,7 +67,16 @@ public class UserDeptConfigServiceImpl extends ServiceImpllambdaQuery() + .eq(UserDeptConfigEntity::getStationId,entity.getStationId()) + .eq(UserDeptConfigEntity::getCreateUser,entity.getCreateUser()) + ); + if(ObjectUtils.isEmpty(userDeptConfig)){ + return this.save(entity); + } + entity.setId(userDeptConfig.getId()); + return this.updateById(entity); } @Override diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/VideoRecordServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/VideoRecordServiceImpl.java index d01994c..9eb47fe 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/VideoRecordServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/VideoRecordServiceImpl.java @@ -1,5 +1,7 @@ package com.hnac.hzims.operational.station.service.impl; +import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.hnac.hzims.operational.station.entity.VideoRecordEntity; import com.hnac.hzims.operational.station.mapper.VideoRecordMapper; @@ -16,4 +18,22 @@ import org.springframework.stereotype.Service; @Slf4j public class VideoRecordServiceImpl extends ServiceImpl implements VideoRecordService { + /** + * 视频配置记录提交 + * @param entity + * @return + */ + @Override + public boolean submit(VideoRecordEntity entity) { + // 根据用户,站点查询历史配置记录 + VideoRecordEntity videoRecord = this.getOne(Wrappers.lambdaQuery() + .eq(VideoRecordEntity::getStationId,entity.getStationId()) + .eq(VideoRecordEntity::getCreateUser,entity.getCreateUser()) + ); + if(ObjectUtils.isEmpty(videoRecord)){ + return this.save(entity); + } + entity.setId(videoRecord.getId()); + return this.updateById(entity); + } } \ No newline at end of file From 1b4dc39c8677a2f17950bc51b2497b5b44f6e3e8 Mon Sep 17 00:00:00 2001 From: yang_shj <1069818635@QQ.com> Date: Mon, 2 Sep 2024 09:20:32 +0800 Subject: [PATCH 4/6] =?UTF-8?q?#=E7=94=B5=E9=87=8F=E6=8A=A5=E8=A1=A8?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=90=88=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/ElectricReportServiceImpl.java | 88 +++++++++++++++++----- 1 file changed, 70 insertions(+), 18 deletions(-) diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/electric/service/impl/ElectricReportServiceImpl.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/electric/service/impl/ElectricReportServiceImpl.java index a6026d7..b549b72 100644 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/electric/service/impl/ElectricReportServiceImpl.java +++ b/hzims-service/equipment/src/main/java/com/hnac/hzims/electric/service/impl/ElectricReportServiceImpl.java @@ -279,9 +279,9 @@ public class ElectricReportServiceImpl implements IElectricReportService { firstHead.setIsChildren(false); tableHeads.add(firstHead); TableHeadVo secondHead = new TableHeadVo(); - secondHead.setTableName("日总计发电量"); + secondHead.setTableName("总计发电量"); secondHead.setIsChildren(true); - secondHead.setChildren(Arrays.asList("日总有功","日总无功")); + secondHead.setChildren(Arrays.asList("总有功","总无功")); tableHeads.add(secondHead); // 根据设备分组 @@ -290,7 +290,7 @@ public class ElectricReportServiceImpl implements IElectricReportService { TableHeadVo tableHead = new TableHeadVo(); tableHead.setTableName(key + "发电量(kWh)"); tableHead.setIsChildren(true); - tableHead.setChildren(Arrays.asList("日有功","日无功")); + tableHead.setChildren(Arrays.asList("有功","无功")); tableHeads.add(tableHead); }); @@ -321,6 +321,13 @@ public class ElectricReportServiceImpl implements IElectricReportService { start = calendar.getTime(); tableDate.add(item); } + List item = new ArrayList<>(); + item.add("合计"); + for(int i = 1 ; i < tableDate.get(0).size() ; i++){ + int index = i; + item.add(tableDate.stream().mapToDouble(o-> Double.parseDouble(o.get(index).toString())).sum()); + } + tableDate.add(item); result.put("tableDate",tableDate); } // 年 @@ -383,6 +390,13 @@ public class ElectricReportServiceImpl implements IElectricReportService { start = calendar.getTime(); tableDate.add(item); } + List item = new ArrayList<>(); + item.add("合计"); + for(int i = 1 ; i < tableDate.get(0).size() ; i++){ + int index = i; + item.add(tableDate.stream().mapToDouble(o-> Double.parseDouble(o.get(index).toString())).sum()); + } + tableDate.add(item); result.put("tableDate",tableDate); } return result; @@ -428,9 +442,9 @@ public class ElectricReportServiceImpl implements IElectricReportService { firstHead.setIsChildren(false); tableHeads.add(firstHead); TableHeadVo secondHead = new TableHeadVo(); - secondHead.setTableName("日总计发电量"); + secondHead.setTableName("总计发电量"); secondHead.setIsChildren(true); - secondHead.setChildren(Arrays.asList("日总有功","日总无功")); + secondHead.setChildren(Arrays.asList("总有功","总无功")); tableHeads.add(secondHead); // 根据区域分组 @@ -446,7 +460,7 @@ public class ElectricReportServiceImpl implements IElectricReportService { TableHeadVo tableHead = new TableHeadVo(); tableHead.setTableName(area.getDeptName() + "发电量(kWh)"); tableHead.setIsChildren(true); - tableHead.setChildren(Arrays.asList("日有功","日无功")); + tableHead.setChildren(Arrays.asList("有功","无功")); tableHeads.add(tableHead); }); result.put("tableHead",tableHeads); @@ -484,6 +498,13 @@ public class ElectricReportServiceImpl implements IElectricReportService { start = calendar.getTime(); tableDate.add(item); } + List item = new ArrayList<>(); + item.add("合计"); + for(int i = 1 ; i < tableDate.get(0).size() ; i++){ + int index = i; + item.add(tableDate.stream().mapToDouble(o-> Double.parseDouble(o.get(index).toString())).sum()); + } + tableDate.add(item); result.put("tableDate",tableDate); }else if(type == 2){ @@ -503,9 +524,9 @@ public class ElectricReportServiceImpl implements IElectricReportService { firstHead.setIsChildren(false); tableHeads.add(firstHead); TableHeadVo secondHead = new TableHeadVo(); - secondHead.setTableName("月总计发电量"); + secondHead.setTableName("总计发电量"); secondHead.setIsChildren(true); - secondHead.setChildren(Arrays.asList("月总有功","月总无功")); + secondHead.setChildren(Arrays.asList("总有功","总无功")); tableHeads.add(secondHead); // 根据设备分组 @@ -521,7 +542,7 @@ public class ElectricReportServiceImpl implements IElectricReportService { TableHeadVo tableHead = new TableHeadVo(); tableHead.setTableName(area.getDeptName() + "发电量(kWh)"); tableHead.setIsChildren(true); - tableHead.setChildren(Arrays.asList("月有功","月无功")); + tableHead.setChildren(Arrays.asList("有功","无功")); tableHeads.add(tableHead); }); result.put("tableHead",tableHeads); @@ -559,6 +580,13 @@ public class ElectricReportServiceImpl implements IElectricReportService { start = calendar.getTime(); tableDate.add(item); } + List item = new ArrayList<>(); + item.add("合计"); + for(int i = 1 ; i < tableDate.get(0).size() ; i++){ + int index = i; + item.add(tableDate.stream().mapToDouble(o-> Double.parseDouble(o.get(index).toString())).sum()); + } + tableDate.add(item); result.put("tableDate",tableDate); } return result; @@ -602,9 +630,9 @@ public class ElectricReportServiceImpl implements IElectricReportService { firstHead.setIsChildren(false); tableHeads.add(firstHead); TableHeadVo secondHead = new TableHeadVo(); - secondHead.setTableName("时总计发电量"); + secondHead.setTableName("总计发电量"); secondHead.setIsChildren(true); - secondHead.setChildren(Arrays.asList("时总有功","时总无功")); + secondHead.setChildren(Arrays.asList("总有功","总无功")); tableHeads.add(secondHead); // 根据设备分组 @@ -612,7 +640,7 @@ public class ElectricReportServiceImpl implements IElectricReportService { TableHeadVo tableHead = new TableHeadVo(); tableHead.setTableName(device.getName() + "发电量(kWh)"); tableHead.setIsChildren(true); - tableHead.setChildren(Arrays.asList("时有功","时无功")); + tableHead.setChildren(Arrays.asList("有功","无功")); tableHeads.add(tableHead); }); result.put("tableHead",tableHeads); @@ -641,6 +669,14 @@ public class ElectricReportServiceImpl implements IElectricReportService { start = calendar.getTime(); tableDate.add(item); } + // 总计 + List item = new ArrayList<>(); + item.add("合计"); + for(int i = 1 ; i < tableDate.get(0).size() ; i++){ + int index = i; + item.add(tableDate.stream().mapToDouble(o-> Double.parseDouble(o.get(index).toString())).sum()); + } + tableDate.add(item); result.put("tableDate",tableDate); } // 月 @@ -661,9 +697,9 @@ public class ElectricReportServiceImpl implements IElectricReportService { firstHead.setIsChildren(false); tableHeads.add(firstHead); TableHeadVo secondHead = new TableHeadVo(); - secondHead.setTableName("日总计发电量"); + secondHead.setTableName("总计发电量"); secondHead.setIsChildren(true); - secondHead.setChildren(Arrays.asList("日总有功","日总无功")); + secondHead.setChildren(Arrays.asList("总有功","总无功")); tableHeads.add(secondHead); // 根据设备分组 @@ -672,7 +708,7 @@ public class ElectricReportServiceImpl implements IElectricReportService { TableHeadVo tableHead = new TableHeadVo(); tableHead.setTableName(key + "发电量(kWh)"); tableHead.setIsChildren(true); - tableHead.setChildren(Arrays.asList("日有功","日无功")); + tableHead.setChildren(Arrays.asList("有功","无功")); tableHeads.add(tableHead); }); @@ -703,6 +739,14 @@ public class ElectricReportServiceImpl implements IElectricReportService { start = calendar.getTime(); tableDate.add(item); } + // 总计 + List item = new ArrayList<>(); + item.add("合计"); + for(int i = 1 ; i < tableDate.get(0).size() ; i++){ + int index = i; + item.add(tableDate.stream().mapToDouble(o-> Double.parseDouble(o.get(index).toString())).sum()); + } + tableDate.add(item); result.put("tableDate",tableDate); } // 年 @@ -723,9 +767,9 @@ public class ElectricReportServiceImpl implements IElectricReportService { firstHead.setIsChildren(false); tableHeads.add(firstHead); TableHeadVo secondHead = new TableHeadVo(); - secondHead.setTableName("月总计发电量"); + secondHead.setTableName("总计发电量"); secondHead.setIsChildren(true); - secondHead.setChildren(Arrays.asList("月总有功","月总无功")); + secondHead.setChildren(Arrays.asList("总有功","总无功")); tableHeads.add(secondHead); // 根据设备分组 @@ -734,7 +778,7 @@ public class ElectricReportServiceImpl implements IElectricReportService { TableHeadVo tableHead = new TableHeadVo(); tableHead.setTableName(key + "发电量(kWh)"); tableHead.setIsChildren(true); - tableHead.setChildren(Arrays.asList("月有功","月无功")); + tableHead.setChildren(Arrays.asList("有功","无功")); tableHeads.add(tableHead); }); @@ -765,6 +809,14 @@ public class ElectricReportServiceImpl implements IElectricReportService { start = calendar.getTime(); tableDate.add(item); } + // 总计 + List item = new ArrayList<>(); + item.add("合计"); + for(int i = 1 ; i < tableDate.get(0).size() ; i++){ + int index = i; + item.add(tableDate.stream().mapToDouble(o-> Double.parseDouble(o.get(index).toString())).sum()); + } + tableDate.add(item); result.put("tableDate",tableDate); } return result; From 5c261de8702b0638459d56874d64d763651a6303 Mon Sep 17 00:00:00 2001 From: yang_shj <1069818635@QQ.com> Date: Mon, 2 Sep 2024 09:23:59 +0800 Subject: [PATCH 5/6] =?UTF-8?q?#=E5=91=8A=E8=AD=A6=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/hnac/hzims/alarm/show/mapper/AlarmMapper.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/mapper/AlarmMapper.xml b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/mapper/AlarmMapper.xml index a0fae3d..86cc042 100644 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/mapper/AlarmMapper.xml +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/mapper/AlarmMapper.xml @@ -14,7 +14,7 @@ AND ALARM.STATION_ID = #{param.stationId} - + AND ALARM.ALARM_TIME >= #{param.startTime} From 420da8b6fbf1953e977165ed651be9d59e6eb2a8 Mon Sep 17 00:00:00 2001 From: haungxing <1203316822@qq.com> Date: Mon, 2 Sep 2024 15:09:47 +0800 Subject: [PATCH 6/6] =?UTF-8?q?fix:=20=E5=91=8A=E8=AD=A6=E5=A4=84=E7=90=86?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E6=97=B6=E9=97=B4=E7=AD=9B=E9=80=89=E6=9D=A1?= =?UTF-8?q?=E4=BB=B6=E6=9F=A5=E8=AF=A2=E6=A0=BC=E5=BC=8F=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/hnac/hzims/alarm/show/vo/HandleQueryVo.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/show/vo/HandleQueryVo.java b/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/show/vo/HandleQueryVo.java index c8ae79c..4cd94f8 100644 --- a/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/show/vo/HandleQueryVo.java +++ b/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/show/vo/HandleQueryVo.java @@ -2,6 +2,8 @@ package com.hnac.hzims.alarm.show.vo; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import org.springblade.core.tool.utils.DateUtil; +import org.springframework.format.annotation.DateTimeFormat; import java.util.Date; @@ -20,9 +22,11 @@ public class HandleQueryVo { private Long handleUser; @ApiModelProperty("开始时间") + @DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME) private Date startTime; @ApiModelProperty("结束时间") + @DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME) private Date endTime; @ApiModelProperty("处理类型:1-延后 2-误报 3-缺陷 4-检修")