diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/alert/entity/AlarmHandleDetailEntity.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/alert/entity/AlarmHandleDetailEntity.java new file mode 100644 index 0000000..be52a81 --- /dev/null +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/alert/entity/AlarmHandleDetailEntity.java @@ -0,0 +1,33 @@ +package com.hnac.hzims.operational.alert.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springblade.core.mp.base.BaseEntity; + +@Data +@TableName("hzims_alarm_handle_detail") +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "告警处理详情对象") +public class AlarmHandleDetailEntity extends BaseEntity { + + @ApiModelProperty("现象ID") + private Long phenomenonId; + + @ApiModelProperty("检修ID") + private Long accessId; + + @ApiModelProperty("延后时间") + private Long delayTime; + + @ApiModelProperty("延后原因") + private Long delayCause; + + @ApiModelProperty("误报描述") + private Long falseAlarmDesc; + + @ApiModelProperty("附件路径") + private Long filePath; +} diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/alert/entity/AlarmHandleEntity.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/alert/entity/AlarmHandleEntity.java new file mode 100644 index 0000000..fb37ade --- /dev/null +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/alert/entity/AlarmHandleEntity.java @@ -0,0 +1,35 @@ +package com.hnac.hzims.operational.alert.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springblade.core.mp.base.BaseEntity; + +import java.util.Date; + +@Data +@TableName("hzims_alarm_handle") +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "告警处理对象") +public class AlarmHandleEntity extends BaseEntity { + + @ApiModelProperty("站点编码") + private String stationCode; + + @ApiModelProperty("告警类型") + private Long alarmType; + + @ApiModelProperty("告警时间") + private Date alarmTime; + + @ApiModelProperty("告警内容") + private String alarmContent; + + @ApiModelProperty("处理方式") + private String handleWay; + + @ApiModelProperty("处理详情ID") + private String detailId; +} diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/census/vo/CompleteTicketVo.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/census/vo/CompleteTicketVo.java index 4b699f5..81f83b4 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/census/vo/CompleteTicketVo.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/census/vo/CompleteTicketVo.java @@ -15,10 +15,10 @@ public class CompleteTicketVo { private String areaName; @ApiModelProperty("两票数量") - private Integer ticketCount; + private String ticketCount; @ApiModelProperty("合格票据数量") - private Integer completeCount; + private String completeCount; @ApiModelProperty("合格率") private String completeRate; diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/census/vo/DeviceClassifyVo.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/census/vo/DeviceClassifyVo.java new file mode 100644 index 0000000..58b69e4 --- /dev/null +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/census/vo/DeviceClassifyVo.java @@ -0,0 +1,22 @@ +package com.hnac.hzims.operational.census.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @author ysj + * @date 2023/02/23 13:37:22 + * @version 4.0.0 + */ +@Data +public class DeviceClassifyVo { + + @ApiModelProperty("站点名称") + private String stationName; + + @ApiModelProperty("设备名称") + private String deviceName; + + @ApiModelProperty("设备状态") + private String deviceStatus; +} diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/entity/OperDefectEntity.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/entity/OperDefectEntity.java index 3b53abc..14d1094 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/entity/OperDefectEntity.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/entity/OperDefectEntity.java @@ -1,6 +1,7 @@ package com.hnac.hzims.operational.defect.entity; import com.baomidou.mybatisplus.annotation.SqlCondition; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; import com.fasterxml.jackson.annotation.JsonFormat; import org.springblade.core.mp.support.QueryField; @@ -12,6 +13,7 @@ import io.swagger.annotations.ApiModelProperty; import org.springframework.format.annotation.DateTimeFormat; import java.util.Date; +import java.util.List; /** @@ -93,4 +95,15 @@ public class OperDefectEntity extends TenantEntity { @ApiModelProperty(value = "最后处理人处理描述") private String disposeDesc; + @TableField(exist=false) + @ApiModelProperty(value = "开始时间") + private String startTime; + + @TableField(exist=false) + @ApiModelProperty(value = "结束时间") + private String endTime; + + @TableField(exist=false) + @ApiModelProperty(value = "机构编号集合") + private List deptIds; } diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/fill/entity/InsertPowerEntity.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/fill/entity/InsertPowerEntity.java new file mode 100644 index 0000000..4d506c4 --- /dev/null +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/fill/entity/InsertPowerEntity.java @@ -0,0 +1,44 @@ +package com.hnac.hzims.operational.fill.entity; + + +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.springblade.core.tenant.mp.TenantEntity; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.util.Date; + + +@Data +@TableName("hzims_fill_inset_power") +@ApiModel(value="InsetPowerEntity对象", description="接入电站历史发电量填报") +public class InsertPowerEntity extends TenantEntity implements Serializable { + + @ApiModelProperty("开始工作日期") + @DateTimeFormat( + pattern = "yyyy-MM-dd" + ) + @JsonFormat( + pattern = "yyyy-MM-dd" + ) + private Date startDate; + + @ApiModelProperty("结束工作日期") + @DateTimeFormat( + pattern = "yyyy-MM-dd" + ) + @JsonFormat( + pattern = "yyyy-MM-dd" + ) + private Date endDate; + + @ApiModelProperty("FA_投入条数") + private Integer faQuantity; + + @ApiModelProperty("设备在线率") + private String onlineRate; +} diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/fill/entity/InsertUseEntity.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/fill/entity/InsertUseEntity.java new file mode 100644 index 0000000..4b034b4 --- /dev/null +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/fill/entity/InsertUseEntity.java @@ -0,0 +1,44 @@ +package com.hnac.hzims.operational.fill.entity; + + +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.springblade.core.tenant.mp.TenantEntity; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.util.Date; + + +@Data +@TableName("hzims_fill_inset_use") +@ApiModel(value="InsertUseEntity对象", description="接入电站历史发电量填报") +public class InsertUseEntity extends TenantEntity implements Serializable { + + @ApiModelProperty("开始工作日期") + @DateTimeFormat( + pattern = "yyyy-MM-dd" + ) + @JsonFormat( + pattern = "yyyy-MM-dd" + ) + private Date startDate; + + @ApiModelProperty("结束工作日期") + @DateTimeFormat( + pattern = "yyyy-MM-dd" + ) + @JsonFormat( + pattern = "yyyy-MM-dd" + ) + private Date endDate; + + @ApiModelProperty("FA_投入条数") + private Integer faQuantity; + + @ApiModelProperty("设备在线率") + private String onlineRate; +} diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/fill/entity/NotInsertPowerEntity.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/fill/entity/NotInsertPowerEntity.java new file mode 100644 index 0000000..dc22f15 --- /dev/null +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/fill/entity/NotInsertPowerEntity.java @@ -0,0 +1,33 @@ +package com.hnac.hzims.operational.fill.entity; + + +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.springblade.core.tenant.mp.TenantEntity; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + + +@Data +@TableName("hzims_fill_notinset_power") +@ApiModel(value="NotInsetPowerEntity对象", description="未接入电站历史发电量填报") +public class NotInsertPowerEntity extends TenantEntity implements Serializable { + + @ApiModelProperty("站点编号") + private String stationCode; + + @ApiModelProperty("站点名称") + private String stationName; + + @ApiModelProperty("发电量") + private BigDecimal power; + + @ApiModelProperty("填报日期") + private Date fillDate; +} diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/fill/entity/NotInsertUseEntity.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/fill/entity/NotInsertUseEntity.java new file mode 100644 index 0000000..95b3a05 --- /dev/null +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/fill/entity/NotInsertUseEntity.java @@ -0,0 +1,33 @@ +package com.hnac.hzims.operational.fill.entity; + + +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.springblade.core.tenant.mp.TenantEntity; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + + +@Data +@TableName("hzims_fill_notinset_use") +@ApiModel(value="NotInsertUseEntity对象", description="未接入泵站用电量填报") +public class NotInsertUseEntity extends TenantEntity implements Serializable { + + @ApiModelProperty("站点编号") + private String stationCode; + + @ApiModelProperty("站点名称") + private String stationName; + + @ApiModelProperty("用电量") + private BigDecimal use; + + @ApiModelProperty("填报日期") + private Date fillDate; +} diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/fill/entity/RainfallEntity.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/fill/entity/RainfallEntity.java new file mode 100644 index 0000000..6fee245 --- /dev/null +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/fill/entity/RainfallEntity.java @@ -0,0 +1,33 @@ +package com.hnac.hzims.operational.fill.entity; + + +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.springblade.core.tenant.mp.TenantEntity; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + + +@Data +@TableName("hzims_fill_rainfall") +@ApiModel(value="RainfallEntity", description="水利降雨量填报") +public class RainfallEntity extends TenantEntity implements Serializable { + + @ApiModelProperty("站点编号") + private String stationCode; + + @ApiModelProperty("站点名称") + private String stationName; + + @ApiModelProperty("发电量") + private BigDecimal rain; + + @ApiModelProperty("填报日期") + private Date fillDate; +} diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/fill/entity/StorageEntity.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/fill/entity/StorageEntity.java new file mode 100644 index 0000000..6c2d908 --- /dev/null +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/fill/entity/StorageEntity.java @@ -0,0 +1,32 @@ +package com.hnac.hzims.operational.fill.entity; + + +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.springblade.core.tenant.mp.TenantEntity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + + +@Data +@TableName("hzims_fill_storage") +@ApiModel(value="StorageEntity", description="储能站发电量对象") +public class StorageEntity extends TenantEntity implements Serializable { + + @ApiModelProperty("站点编号") + private String stationCode; + + @ApiModelProperty("站点名称") + private String stationName; + + @ApiModelProperty("发电量") + private BigDecimal power; + + @ApiModelProperty("填报日期") + private Date fillDate; + +} diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/fill/vo/QueryVo.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/fill/vo/QueryVo.java new file mode 100644 index 0000000..42cde47 --- /dev/null +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/fill/vo/QueryVo.java @@ -0,0 +1,22 @@ +package com.hnac.hzims.operational.fill.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; + +@Data +public class QueryVo{ + + @ApiModelProperty("站点编号") + private String stationCode; + + @ApiModelProperty("开始时间") + private Date startTime; + + @ApiModelProperty("结束时间") + private Date endTime; + + @ApiModelProperty("设备编号") + private String deviceCode; +} diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/dto/OperMaintenanceTaskDTO.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/dto/OperMaintenanceTaskDTO.java index 379bd5d..bd32e77 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/dto/OperMaintenanceTaskDTO.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/dto/OperMaintenanceTaskDTO.java @@ -28,4 +28,9 @@ public class OperMaintenanceTaskDTO extends OperMaintenanceTaskEntity { @ApiModelProperty("任务Id 多个按逗号分隔") private List deptIds; + @ApiModelProperty("开始时间") + private String startTime; + + @ApiModelProperty("结束时间") + private String endTime; } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/dto/OperAccessTaskDTO.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/dto/OperAccessTaskDTO.java index 4b648a4..ae0d3b3 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/dto/OperAccessTaskDTO.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/dto/OperAccessTaskDTO.java @@ -33,4 +33,10 @@ public class OperAccessTaskDTO extends OperAccessTaskEntity { @ApiModelProperty("检修材料列表") private List accessMaterials; + + @ApiModelProperty("开始时间") + private String startTime; + + @ApiModelProperty("结束时间") + private String endTime; } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessTaskMapper.xml b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessTaskMapper.xml index 4495409..e8f9b95 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessTaskMapper.xml +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessTaskMapper.xml @@ -77,6 +77,12 @@ and t1.`TICKET_ID` is null + + and t1.`PLAN_START_TIME` > #{req.startTime} + + + and t1.`PLAN_START_TIME` < #{req.endTime} + and t1.create_dept in diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/controller/AlarmHandleController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/controller/AlarmHandleController.java new file mode 100644 index 0000000..1ff7ff8 --- /dev/null +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/controller/AlarmHandleController.java @@ -0,0 +1,77 @@ +package com.hnac.hzims.operational.alert.controller; + + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import com.hnac.hzims.operational.alert.entity.AlarmHandleEntity; +import com.hnac.hzims.operational.alert.service.AlarmHandleService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +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.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; + +/** + * @author ysj + * @date 2023/03/09 09:19:13 + * @version 4.0.0 + */ +@Api(tags = {"告警处理"}) +@RestController +@AllArgsConstructor +@RequestMapping("/alarm/handle") +public class AlarmHandleController extends BladeController { + + private final AlarmHandleService service; + + + /** + * 详情 + */ + @GetMapping("/detail") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "详情", notes = "传入AlarmHandleEntity") + public R detail(AlarmHandleEntity entity) { + AlarmHandleEntity detail = service.getOne(Condition.getQueryWrapper(entity)); + return R.data(detail); + } + + /** + * 分页 + */ + @GetMapping("/list") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "分页", notes = "传入AlarmHandleEntity") + public R> list(AlarmHandleEntity entity, Query query) { + IPage pages = service.page(Condition.getPage(query), Condition.getQueryWrapper(entity)); + return R.data(pages); + } + + /** + * 新增或修改 + */ + @PostMapping("/submit") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "新增或修改", notes = "传入AlarmHandleEntity") + public R submit(@Valid @RequestBody AlarmHandleEntity entity) { + return R.status(service.saveOrUpdate(entity)); + } + + + /** + * 删除 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "逻辑删除", notes = "传入ids") + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return R.status(service.deleteLogic(Func.toLongList(ids))); + } +} diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/mapper/AlarmHandleDetailMapper.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/mapper/AlarmHandleDetailMapper.java new file mode 100644 index 0000000..b87f290 --- /dev/null +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/mapper/AlarmHandleDetailMapper.java @@ -0,0 +1,13 @@ +package com.hnac.hzims.operational.alert.mapper; + +import com.hnac.hzims.operational.alert.entity.AlarmHandleDetailEntity; +import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper; + +/** + * @author ysj + * @date 2023/03/09 09:19:13 + * @version 4.0.0 + */ +public interface AlarmHandleDetailMapper extends UserDataScopeBaseMapper { + +} diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/mapper/AlarmHandleDetailMapper.xml b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/mapper/AlarmHandleDetailMapper.xml new file mode 100644 index 0000000..c4664e9 --- /dev/null +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/mapper/AlarmHandleDetailMapper.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/mapper/AlarmHandleMapper.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/mapper/AlarmHandleMapper.java new file mode 100644 index 0000000..f6b2cb5 --- /dev/null +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/mapper/AlarmHandleMapper.java @@ -0,0 +1,13 @@ +package com.hnac.hzims.operational.alert.mapper; + +import com.hnac.hzims.operational.alert.entity.AlarmHandleEntity; +import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper; + +/** + * @author ysj + * @date 2023/03/09 09:19:13 + * @version 4.0.0 + */ +public interface AlarmHandleMapper extends UserDataScopeBaseMapper { + +} diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/mapper/AlarmHandleMapper.xml b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/mapper/AlarmHandleMapper.xml new file mode 100644 index 0000000..4811e4d --- /dev/null +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/mapper/AlarmHandleMapper.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/AlarmHandleDetailService.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/AlarmHandleDetailService.java new file mode 100644 index 0000000..d14dcf0 --- /dev/null +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/AlarmHandleDetailService.java @@ -0,0 +1,13 @@ +package com.hnac.hzims.operational.alert.service; + +import com.hnac.hzims.operational.alert.entity.AlarmHandleDetailEntity; +import org.springblade.core.mp.base.BaseService; + +/** + * @author ysj + * @date 2023/03/09 09:19:13 + * @version 4.0.0 + */ +public interface AlarmHandleDetailService extends BaseService { + +} diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/AlarmHandleService.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/AlarmHandleService.java new file mode 100644 index 0000000..5c8dcf0 --- /dev/null +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/AlarmHandleService.java @@ -0,0 +1,13 @@ +package com.hnac.hzims.operational.alert.service; + +import com.hnac.hzims.operational.alert.entity.AlarmHandleEntity; +import org.springblade.core.mp.base.BaseService; + +/** + * @author ysj + * @date 2023/03/09 09:19:13 + * @version 4.0.0 + */ +public interface AlarmHandleService extends BaseService { + +} diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/AlarmHandleDetailServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/AlarmHandleDetailServiceImpl.java new file mode 100644 index 0000000..d40abac --- /dev/null +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/AlarmHandleDetailServiceImpl.java @@ -0,0 +1,21 @@ +package com.hnac.hzims.operational.alert.service.impl; + +import com.hnac.hzims.operational.alert.entity.AlarmHandleDetailEntity; +import com.hnac.hzims.operational.alert.mapper.AlarmHandleDetailMapper; +import com.hnac.hzims.operational.alert.service.AlarmHandleDetailService; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springblade.core.mp.base.BaseServiceImpl; +import org.springframework.stereotype.Service; + +/** + * @author ysj + * @date 2023/03/09 09:29:34 + * @version 4.0.0 + */ +@Slf4j +@Service +@RequiredArgsConstructor +public class AlarmHandleDetailServiceImpl extends BaseServiceImpl implements AlarmHandleDetailService { + +} diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/AlarmHandleServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/AlarmHandleServiceImpl.java new file mode 100644 index 0000000..d706f34 --- /dev/null +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/AlarmHandleServiceImpl.java @@ -0,0 +1,21 @@ +package com.hnac.hzims.operational.alert.service.impl; + +import com.hnac.hzims.operational.alert.entity.AlarmHandleEntity; +import com.hnac.hzims.operational.alert.mapper.AlarmHandleMapper; +import com.hnac.hzims.operational.alert.service.AlarmHandleService; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springblade.core.mp.base.BaseServiceImpl; +import org.springframework.stereotype.Service; + +/** + * @author ysj + * @date 2023/03/09 09:29:34 + * @version 4.0.0 + */ +@Slf4j +@Service +@RequiredArgsConstructor +public class AlarmHandleServiceImpl extends BaseServiceImpl implements AlarmHandleService { + +} diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/controller/TargetController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/controller/TargetController.java index 68eede3..0d5092a 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/controller/TargetController.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/controller/TargetController.java @@ -28,37 +28,37 @@ public class TargetController { private final TargetService service; - @ApiOperation("装机容量统计") + @ApiOperation("装机容量统计:区分填报/接入站点") @PostMapping("/installed-capacity") @ApiOperationSupport(order = 1) public R installedCapacity(@RequestParam(value = "stationName") String stationName,@RequestParam(value = "type") Integer type) { return R.data(service.installedCapacity(stationName,type)); } - @ApiOperation("发电量统计") + @ApiOperation("发电量统计:区分填报/接入站点") @PostMapping("/electric-generation") @ApiOperationSupport(order = 2) - public R electricGeneration() { - return R.data(service.electricGeneration()); + public R electricGeneration(@RequestParam(value = "stationName") String stationName,@RequestParam(value = "type") Integer type) { + return R.data(service.electricGeneration(stationName,type)); } - @ApiOperation("计划发电量/实际发电量统计") + @ApiOperation("计划发电量/实际发电量统计:区分填报/接入站点") @PostMapping("/complete-generation") @ApiOperationSupport(order = 3) - public R completeGeneration() { - return R.data(service.completeGeneration()); + public R completeGeneration(@RequestParam(value = "stationName") String stationName,@RequestParam(value = "type") Integer type) { + return R.data(service.completeGeneration(stationName,type)); } - @ApiOperation("两票统计") + @ApiOperation("两票统计:区分填报/平台业务数据") @PostMapping("/complete-ticket") @ApiOperationSupport(order = 4) public R completeTicket(@RequestParam(value = "areaName") String areaName,@RequestParam(value = "type") Integer type) { return R.data(service.completeTicket(areaName,type)); } - @ApiOperation("缺陷率统计") + @ApiOperation("缺陷率统计:区分填报/平台业务数据") @GetMapping("/complete-defect") - @ApiOperationSupport(order = 6) + @ApiOperationSupport(order = 5) public R completeDefect(@RequestParam(value = "areaName") String areaName,@RequestParam(value = "type") Integer type) { return R.data(service.defect(areaName,type)); } @@ -72,23 +72,30 @@ public class TargetController { @ApiOperation("日常维护统计") @GetMapping("/routine-maintenance") - @ApiOperationSupport(order = 5) + @ApiOperationSupport(order = 7) public R> routineMaintenance(OperMaintenanceTaskDTO params,Query query,Integer type) { return service.routineMaintenance(params,query,type); } @ApiOperation("检修任务统计") @GetMapping("/examine-repair") - @ApiOperationSupport(order = 6) + @ApiOperationSupport(order = 8) public R> examineRepair(OperAccessTaskDTO params, Query query, Integer type) { return service.examineRepair(params, query,type); } @ApiOperation("检修卡统计") @GetMapping("/examineCard") - @ApiOperationSupport(order = 6) + @ApiOperationSupport(order = 9) public R examineCard(@RequestParam(value = "stationName") String stationName,@RequestParam(value = "type") Integer type) { return R.data(service.examineCard(stationName,type)); } + @ApiOperation("设备统计") + @GetMapping("/device-classify") + @ApiOperationSupport(order = 10) + public R deviceClassify(@RequestParam(value = "stationName") String stationName,@RequestParam(value = "deptId") Long deptId) { + return R.data(service.deviceClassify(stationName,deptId)); + } + } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/TargetService.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/TargetService.java index a497454..ad30169 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/TargetService.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/TargetService.java @@ -24,10 +24,10 @@ public interface TargetService { List installedCapacity(String stationName,Integer type); // 发电量统计 - List electricGeneration(); + List electricGeneration(String stationName,Integer type); // 计划发电量/实际发电量统计 - List completeGeneration(); + List completeGeneration(String stationName,Integer type); // 两票统计 List completeTicket(String areaName,Integer type); @@ -46,4 +46,7 @@ public interface TargetService { // 检修任务统计 R> examineRepair(OperAccessTaskDTO params, Query query, Integer type); + + // 设备分类统计 + List deviceClassify(String stationName, Long deptId); } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/impl/TargetServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/impl/TargetServiceImpl.java index 6a56762..15bdbf3 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/impl/TargetServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/impl/TargetServiceImpl.java @@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.hnac.hzims.equipment.entity.EmInfoEntity; import com.hnac.hzims.equipment.entity.PlanGenerationEntity; import com.hnac.hzims.equipment.feign.IPlanGenertionClient; +import com.hnac.hzims.equipment.vo.EmInfoExtendVo; import com.hnac.hzims.equipment.vo.EminfoAndEmParamVo; import com.hnac.hzims.operational.access.dto.OperAccessStatisticsDTO; import com.hnac.hzims.operational.access.dto.OperAccessTaskDTO; @@ -38,6 +39,8 @@ import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.DateUtil; import org.springblade.core.tool.utils.ObjectUtil; import org.springblade.system.entity.Dept; +import org.springblade.system.feign.ISysClient; +import org.springframework.beans.factory.annotation.Value; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; @@ -89,12 +92,17 @@ public class TargetServiceImpl implements TargetService { private final ITicketInfoAllClient ticketInfoAllClient; + private final ISysClient sysClient; + private final RedisTemplate redisTemplate; private final SimpleDateFormat sdf = new SimpleDateFormat(DateUtil.PATTERN_DATETIME); private final static String load_hydropower_unit_target_key = "hzims:operation:loadhydropowerunit:target:key"; + @Value("${hzims.operation.region.deviceClassifyKey}") + private String device_classify_key; + /** * 获取站点装机容量 * @return @@ -157,32 +165,57 @@ public class TargetServiceImpl implements TargetService { * @return */ @Override - public List electricGeneration() { - // 站点 - List stations = stationService.getStationType(HomePageConstant.HYDROPOWER_SERVETYPE, Collections.singletonList(HomePageConstant.HYDROPOWER), null); - if(CollectionUtils.isEmpty(stations)){ + public List electricGeneration(String stationName,Integer type) { + // 接入站点 + List stations = stationService.list(Wrappers.lambdaQuery() + .eq(StationEntity::getType, type) + .eq(StationEntity::getServeType,HomePageConstant.HYDROPOWER_SERVETYPE) + .like(StationEntity::getName,stationName) + );if(CollectionUtils.isEmpty(stations)){ return new ArrayList<>(); } - // 设备指标数据 - List targets = (List) redisTemplate.opsForValue().get(load_hydropower_unit_target_key); - if(CollectionUtils.isEmpty(targets)){ - return new ArrayList<>(); + // 填报数据 + if(HomePageConstant.HYDROPOWER.equals(type)){ + // 设备指标数据 + List targets = (List) redisTemplate.opsForValue().get(load_hydropower_unit_target_key); + if(CollectionUtils.isEmpty(targets)){ + return new ArrayList<>(); + } + return stations.stream().map(station->{ + ElectricGenerationVo item = new ElectricGenerationVo(); + item.setStationName(station.getName()); + List stationTargets = targets.stream().filter(device->device.getDeptId().equals(station.getRefDept())).collect(Collectors.toList()); + if(CollectionUtils.isEmpty(stationTargets)){ + item.setElectricGeneration(0.0); + item.setDetail("站点暂无发电"); + return item; + } + // 年发电量 + double sum = targets.stream().mapToDouble(HydropowerUnitTargetVo::getPowerYear).sum(); + item.setElectricGeneration(sum); + // 发电量详情 + List details = targets.stream().map(target-> "[" + target.getDeviceCode() + " " + target.getPowerYear() +"kw]").collect(Collectors.toList()); + item.setDetail(String.join("|",details)); + return item; + }).collect(Collectors.toList()); } - return stations.stream().map(station->{ + // 查询填报数据 + String mon = DateUtil.format(new Date(),"yyyy"); + List powers = powerService.list(Wrappers.lambdaQuery() + .in(PowerEntity::getCreateDept,stations.stream().map(StationEntity::getRefDept).collect(Collectors.toList())) + .ge(PowerEntity::getMon, mon + "-01") + ); + return stations.stream().map(station -> { ElectricGenerationVo item = new ElectricGenerationVo(); item.setStationName(station.getName()); - List stationTargets = targets.stream().filter(device->device.getDeptId().equals(station.getRefDept())).collect(Collectors.toList()); - if(CollectionUtils.isEmpty(stationTargets)){ + // 发电量 + List stationPowers = powers.stream().filter(o->o.getCreateDept().equals(station.getRefDept())).collect(Collectors.toList()); + if(CollectionUtils.isEmpty(stationPowers)){ item.setElectricGeneration(0.0); - item.setDetail("站点暂无发电"); - return item; + }else{ + item.setElectricGeneration(stationPowers.stream().sorted(Comparator.comparing(PowerEntity::getMon).reversed()).collect(Collectors.toList()).get(0).getPowerYear()); } - // 年发电量 - double sum = targets.stream().mapToDouble(HydropowerUnitTargetVo::getPowerYear).sum(); - item.setElectricGeneration(sum); - // 装机容量详情 - List details = targets.stream().map(target-> "[" + target.getDeviceCode() + " " + target.getPowerYear() +"kw]").collect(Collectors.toList()); - item.setDetail(String.join("|",details)); + item.setDetail("站点为填报数据,暂无设备装机发电量信息!"); return item; }).collect(Collectors.toList()); } @@ -192,42 +225,68 @@ public class TargetServiceImpl implements TargetService { * @return */ @Override - public List completeGeneration() { + public List completeGeneration(String stationName,Integer type) { // 站点 - List stations = stationService.getStationType(HomePageConstant.HYDROPOWER_SERVETYPE, Collections.singletonList(HomePageConstant.HYDROPOWER), null); + List stations = stationService.list(Wrappers.lambdaQuery() + .eq(StationEntity::getType, type) + .eq(StationEntity::getServeType,HomePageConstant.HYDROPOWER_SERVETYPE) + .like(StationEntity::getName,stationName)); if(CollectionUtils.isEmpty(stations)){ return new ArrayList<>(); } - // 计划发电量 - List plans = planClient.getPlanGenerationByParam(stations.stream().map(StationEntity::getCode).collect(Collectors.toList()), null, DateUtil.format(new Date(), "yyyy")); - // 设备指标数据 - List targets = (List) redisTemplate.opsForValue().get(load_hydropower_unit_target_key); - if(CollectionUtils.isEmpty(targets)){ - return new ArrayList<>(); + if(HomePageConstant.HYDROPOWER.equals(type)){ + // 计划发电量 + List plans = planClient.getPlanGenerationByParam(stations.stream().map(StationEntity::getCode).collect(Collectors.toList()), null, DateUtil.format(new Date(), "yyyy")); + // 设备指标数据 + List targets = (List) redisTemplate.opsForValue().get(load_hydropower_unit_target_key); + if(CollectionUtils.isEmpty(targets)){ + return new ArrayList<>(); + } + return stations.stream().map(station->{ + CompleteGenerationVo item = new CompleteGenerationVo(); + item.setStationName(station.getName()); + List stationTargets = targets.stream().filter(device->device.getDeptId().equals(station.getRefDept())).collect(Collectors.toList()); + // 实际发电量 + if(CollectionUtils.isEmpty(stationTargets)){ + item.setRealityGeneration(0.0); + }else { + double sum = targets.stream().mapToDouble(HydropowerUnitTargetVo::getPowerYear).sum(); + item.setRealityGeneration(sum); + } + // 计划发电量 + List planGenerations = plans.stream().filter(plan->plan.getStationId().equals(station.getCode())).map(PlanGenerationEntity::getPlanGeneration).collect(Collectors.toList()); + if(CollectionUtils.isEmpty(planGenerations)){ + item.setPlanGeneration(0.0); + }else{ + item.setPlanGeneration(BigDecimal.valueOf(planGenerations.get(0)).setScale(1, BigDecimal.ROUND_HALF_UP).doubleValue()); + } + // 完成率 + if(Math.abs(item.getPlanGeneration()) <= 0){ + item.setCompleteRate(0.0); + }else{ + item.setCompleteRate(BigDecimal.valueOf(item.getRealityGeneration() / item.getPlanGeneration() * 100).setScale(1, BigDecimal.ROUND_HALF_UP).doubleValue()); + } + return item; + }).collect(Collectors.toList()); } - return stations.stream().map(station->{ + String mon = DateUtil.format(new Date(),"yyyy"); + List powers = powerService.list(Wrappers.lambdaQuery() + .in(PowerEntity::getCreateDept,stations.stream().map(StationEntity::getRefDept).collect(Collectors.toList())) + .ge(PowerEntity::getMon, mon + "-01") + ); + return stations.stream().map(station -> { CompleteGenerationVo item = new CompleteGenerationVo(); item.setStationName(station.getName()); - List stationTargets = targets.stream().filter(device->device.getDeptId().equals(station.getRefDept())).collect(Collectors.toList()); - // 实际发电量 - if(CollectionUtils.isEmpty(stationTargets)){ - item.setRealityGeneration(0.0); - }else { - double sum = targets.stream().mapToDouble(HydropowerUnitTargetVo::getPowerYear).sum(); - item.setRealityGeneration(sum); - } - // 计划发电量 - List planGenerations = plans.stream().filter(plan->plan.getStationId().equals(station.getCode())).map(PlanGenerationEntity::getPlanGeneration).collect(Collectors.toList()); - if(CollectionUtils.isEmpty(planGenerations)){ + // 发电量 + List stationPowers = powers.stream().filter(o->o.getCreateDept().equals(station.getRefDept())).collect(Collectors.toList()); + if(CollectionUtils.isEmpty(stationPowers)){ item.setPlanGeneration(0.0); - }else{ - item.setPlanGeneration(BigDecimal.valueOf(planGenerations.get(0)).setScale(1, BigDecimal.ROUND_HALF_UP).doubleValue()); - } - // 完成率 - if(Math.abs(item.getPlanGeneration()) <= 0){ + item.setRealityGeneration(0.0); item.setCompleteRate(0.0); }else{ - item.setCompleteRate(BigDecimal.valueOf(item.getRealityGeneration() / item.getPlanGeneration() * 100).setScale(1, BigDecimal.ROUND_HALF_UP).doubleValue()); + item.setPlanGeneration(stationPowers.stream().sorted(Comparator.comparing(PowerEntity::getMon).reversed()).collect(Collectors.toList()).get(0).getPlannedPowerYear()); + item.setRealityGeneration(stationPowers.stream().sorted(Comparator.comparing(PowerEntity::getMon).reversed()).collect(Collectors.toList()).get(0).getPowerYear()); + item.setCompleteRate(Double.valueOf(stationPowers.stream().sorted(Comparator.comparing(PowerEntity::getMon).reversed()).collect(Collectors.toList()).get(0).getPowerRateYear())); } return item; }).collect(Collectors.toList()); @@ -239,8 +298,19 @@ public class TargetServiceImpl implements TargetService { */ @Override public List completeTicket(String areaName,Integer type) { + // 光伏/风电双票填报数据 + if(HomePageConstant.WIND_POWER.equals(type) || HomePageConstant.PHOTOVOLTAIC.equals(type)){ + return this.getcompleteFillTicket(areaName,type); + } + // 平台业务数据 + List types; + if(HomePageConstant.WATER_CONSERVANCY.equals(type)){ + types = HomePageConstant.waterList; + }else{ + types = Collections.singletonList(type); + } // 获取水电站区域机构 - Map> areas = areaService.getAuthArea(null,null,Collections.singletonList(HomePageConstant.HYDROPOWER),HomePageConstant.HYDROPOWER_SERVETYPE); + Map> areas = areaService.getAuthArea(null,null,types,HomePageConstant.HYDROPOWER_SERVETYPE); if(MapUtils.isEmpty(areas)){ return new ArrayList<>(); } @@ -262,13 +332,13 @@ public class TargetServiceImpl implements TargetService { CompleteTicketVo completeTicketVo = new CompleteTicketVo(); if (ObjectUtil.isEmpty(doublePass)) { completeTicketVo.setAreaName(dept.getDeptName()); - completeTicketVo.setTicketCount(0); - completeTicketVo.setCompleteCount(0); + completeTicketVo.setTicketCount("0"); + completeTicketVo.setCompleteCount("0"); completeTicketVo.setCompleteRate("0.0"); } else { completeTicketVo.setAreaName(dept.getDeptName()); - completeTicketVo.setTicketCount(doublePass.getDoubleTicketCount()); - completeTicketVo.setCompleteCount(doublePass.getDoubleTicketPassCount()); + completeTicketVo.setTicketCount(doublePass.getDoubleTicketCount().toString()); + completeTicketVo.setCompleteCount(doublePass.getDoubleTicketPassCount().toString()); completeTicketVo.setCompleteRate(doublePass.getDoublePassRate()); } completeTickets.add(completeTicketVo); @@ -287,6 +357,36 @@ public class TargetServiceImpl implements TargetService { } /** + * 光伏/风电双票填报数据 + * @param stationName + * @param type + * @return + */ + private List getcompleteFillTicket(String stationName, Integer type) { + List stations = stationService.list(Wrappers.lambdaQuery() + .eq(StationEntity::getType, type) + .eq(StationEntity::getServeType,HomePageConstant.HYDROPOWER_SERVETYPE) + .like(StationEntity::getName,stationName)); + if(CollectionUtils.isEmpty(stations)){ + return new ArrayList<>(); + } + String mon = DateUtil.format(new Date(),"yyyy"); + List powers = powerService.list(Wrappers.lambdaQuery() + .in(PowerEntity::getCreateDept,stations.stream().map(StationEntity::getRefDept).collect(Collectors.toList())) + .ge(PowerEntity::getMon, mon + "-01") + ); + return stations.stream().map(station -> { + CompleteTicketVo item = new CompleteTicketVo(); + item.setAreaName(station.getName()); + // 双票合格率 + item.setTicketCount("*"); + item.setCompleteCount("*"); + item.setCompleteRate(powers.stream().mapToDouble(o->Double.valueOf(o.getDoubleQualifyRate())).average().toString()); + return item; + }).collect(Collectors.toList()); + } + + /** * 缺陷统计 * @param areaName * @param type @@ -362,9 +462,9 @@ public class TargetServiceImpl implements TargetService { String startTime = this.getFristDayByYear(); String endTime = DateUtil.format(new Date(),DateUtil.PATTERN_DATETIME); List overs = overService.list(Wrappers.lambdaQuery() - .in(OverEntity::getCreateDept,stations.stream().map(StationEntity::getRefDept).collect(Collectors.toList())) - .ge(OverEntity::getCreateTime,startTime) - .le(OverEntity::getCreateTime,endTime) + .in(OverEntity::getCreateDept,stations.stream().map(StationEntity::getRefDept).collect(Collectors.toList())) + .ge(OverEntity::getCreateTime,startTime) + .le(OverEntity::getCreateTime,endTime) ); if(CollectionUtils.isEmpty(overs)){ return new ArrayList<>(); @@ -377,7 +477,7 @@ public class TargetServiceImpl implements TargetService { ExamineCardVo examineCard = new ExamineCardVo(); examineCard.setStationName(stations.stream().filter(station -> station.getRefDept().equals(entry.getKey())).collect(Collectors.toList()).get(0).getName()); examineCard.setCardTotal(entry.getValue().stream().mapToDouble(over-> Double.valueOf(over.getTotalPrice().toString())).sum()); - examineCard.setCardCount(overDetails.stream().filter(detail-> detail.getOverId().equals(entry.getKey())).mapToInt(OverDetailsEntity::getQuantity).sum()); + examineCard.setCardCount(overDetails.stream().filter(detail-> entry.getValue().stream().map(OverEntity::getId).collect(Collectors.toList()).contains(detail.getOverId())).mapToInt(OverDetailsEntity::getQuantity).sum()); return examineCard; }).collect(Collectors.toList()); } @@ -504,6 +604,55 @@ public class TargetServiceImpl implements TargetService { } /** + * 设备统计 + * @param stationName + * @param deptId + * @return + */ + @Override + public List deviceClassify(String stationName, Long deptId) { + // 获取区域设备统计 + Map> deviceClassifyMap = (Map>) redisTemplate.opsForValue().get(device_classify_key); + List faultList = deviceClassifyMap.get(HomePageConstant.FAULT); + List overhaultList = deviceClassifyMap.get(HomePageConstant.OVERHAUL); + List runtList = deviceClassifyMap.get(HomePageConstant.RUN); + //根据用户权限获取机构 + R> result = sysClient.getDeptByCurrentUser(); + if (!result.isSuccess() || ObjectUtil.isEmpty(result.getData())) { + return new ArrayList<>(); + } + // 站点 + List stations = stationService.getStationList(result.getData(),deptId,Collections.singletonList(HomePageConstant.HYDROPOWER),HomePageConstant.HYDROPOWER_SERVETYPE); + if(CollectionUtils.isEmpty(stations)){ + return new ArrayList<>(); + } + List detpIds = stations.stream().filter(o-> StringUtils.isEmpty(stationName) || o.getName().contains(stationName)).map(StationEntity::getRefDept).collect(Collectors.toList()); + if(CollectionUtils.isEmpty(detpIds)){ + return new ArrayList<>(); + } + // 设备 + List devices = maintenanceService.getEmInfoList(); + if(CollectionUtils.isEmpty(devices)){ + return new ArrayList<>(); + } + return devices.stream().sorted(Comparator.comparing(EminfoAndEmParamVo::getCreateDept)).map(device -> { + DeviceClassifyVo deviceClassify = new DeviceClassifyVo(); + deviceClassify.setStationName(stations.stream().filter(o-> o.getRefDept().equals(o.getCreateDept())).collect(Collectors.toList()).get(0).getName()); + deviceClassify.setDeviceName(device.getName()); + if(faultList.contains(device.getEmCode())){ + deviceClassify.setDeviceStatus(HomePageConstant.FAULT); + }else if(overhaultList.contains(device.getEmCode())){ + deviceClassify.setDeviceStatus(HomePageConstant.OVERHAUL); + }else if(runtList.contains(device.getEmCode())){ + deviceClassify.setDeviceStatus(HomePageConstant.RUN); + }else{ + deviceClassify.setDeviceStatus(HomePageConstant.SPARE); + } + return deviceClassify; + }).collect(Collectors.toList()); + } + + /** * 获取当年的第一天 * @return */ diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/controller/OperDefectController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/controller/OperDefectController.java index 6a32907..0312d3d 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/controller/OperDefectController.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/controller/OperDefectController.java @@ -68,6 +68,12 @@ public class OperDefectController extends BladeController { if (defect.getActEndTime() != null) { queryWrapper.le(OperDefectEntity::getActEndTime, defect.getActEndTime()); } + if (defect.getStartTime() != null) { + queryWrapper.ge(OperDefectEntity::getCreateTime, defect.getStartTime()); + } + if (defect.getEndTime() != null) { + queryWrapper.le(OperDefectEntity::getCreateTime, defect.getEndTime()); + } queryWrapper.orderByDesc(OperDefectEntity::getActStartTime); IPage pages = defectService.page(Condition.getPage(query), queryWrapper); IPage vos = OperDefectWrapper.build().pageVO(pages); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/InsertPowerController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/InsertPowerController.java new file mode 100644 index 0000000..15f9ac3 --- /dev/null +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/InsertPowerController.java @@ -0,0 +1,74 @@ +package com.hnac.hzims.operational.fill.controller; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import com.hnac.hzims.operational.fill.entity.InsertPowerEntity; +import com.hnac.hzims.operational.fill.entity.OtherEntity; +import com.hnac.hzims.operational.fill.service.InsertPowerService; +import com.hnac.hzims.operational.fill.service.OtherService; +import com.hnac.hzims.operational.fill.vo.OtherVo; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import lombok.AllArgsConstructor; +import org.springblade.core.boot.ctrl.BladeController; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; + +/** + * @author ysj + * @date 2023/03/09 16:12:22 + * @version 4.0.0 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/insert/power") +@Api(value = "接入电站填报", tags = "接入电站历史发电量填报") +public class InsertPowerController extends BladeController { + + private final InsertPowerService service; + + /** + * 新增 + */ + @PostMapping("/save") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "新增", notes = "传入InsertPowerEntity对象") + public R save(@RequestBody InsertPowerEntity entity) { + return R.status(service.save(entity)); + } + + /** + * 删除 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "逻辑删除", notes = "传入id字符串以逗号分隔") + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return R.status(service.deleteLogic(Func.toLongList(ids))); + } + + /** + * 修改 + */ + @PostMapping("/update") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "修改") + public R update(@Valid @RequestBody InsertPowerEntity entity) { + return R.status(service.updateById(entity)); + } + + /** + * 分页 + *//* + @GetMapping("/list") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "分页", notes = "查询条件:createDept,fileName,startTime,endTime") + public R> list(OtherVo vo, Query query) { + return service.pageCondition(vo, query); + }*/ +} diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/InsertUseController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/InsertUseController.java new file mode 100644 index 0000000..80b1bf8 --- /dev/null +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/InsertUseController.java @@ -0,0 +1,69 @@ +package com.hnac.hzims.operational.fill.controller; + +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import com.hnac.hzims.operational.fill.entity.InsertPowerEntity; +import com.hnac.hzims.operational.fill.service.InsertPowerService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import lombok.AllArgsConstructor; +import org.springblade.core.boot.ctrl.BladeController; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; + +/** + * @author ysj + * @date 2023/03/09 16:12:22 + * @version 4.0.0 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/insert/use") +@Api(value = "接入泵站用电量填报", tags = "接入泵站用电量填报") +public class InsertUseController extends BladeController { + + private final InsertPowerService service; + + /** + * 新增 + */ + @PostMapping("/save") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "新增", notes = "传入InsertPowerEntity对象") + public R save(@RequestBody InsertPowerEntity entity) { + return R.status(service.save(entity)); + } + + /** + * 删除 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "逻辑删除", notes = "传入id字符串以逗号分隔") + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return R.status(service.deleteLogic(Func.toLongList(ids))); + } + + /** + * 修改 + */ + @PostMapping("/update") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "修改") + public R update(@Valid @RequestBody InsertPowerEntity entity) { + return R.status(service.updateById(entity)); + } + + /** + * 分页 + *//* + @GetMapping("/list") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "分页", notes = "查询条件:createDept,fileName,startTime,endTime") + public R> list(OtherVo vo, Query query) { + return service.pageCondition(vo, query); + }*/ +} diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/NotInsertPowerController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/NotInsertPowerController.java new file mode 100644 index 0000000..7dc48f3 --- /dev/null +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/NotInsertPowerController.java @@ -0,0 +1,63 @@ +package com.hnac.hzims.operational.fill.controller; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import com.hnac.hzims.operational.fill.entity.NotInsertPowerEntity; +import com.hnac.hzims.operational.fill.entity.RainfallEntity; +import com.hnac.hzims.operational.fill.service.NotInsertPowerService; +import com.hnac.hzims.operational.fill.vo.QueryVo; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import lombok.AllArgsConstructor; +import org.springblade.core.boot.ctrl.BladeController; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; + +/** + * @author ysj + * @date 2023/03/09 16:12:22 + * @version 4.0.0 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/notInsert/power") +@Api(value = "未接入电站填报", tags = "未接入电站历史发电量填报") +public class NotInsertPowerController extends BladeController { + + private final NotInsertPowerService service; + + /** + * 新增 + */ + @PostMapping("/saveOrUpdate") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "新增", notes = "传入InsertPowerEntity对象") + public R saveOrUpdate(@RequestBody NotInsertPowerEntity entity) { + return R.status(service.saveUpdate(entity)); + } + + /** + * 删除 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "逻辑删除", notes = "传入id字符串以逗号分隔") + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return R.status(service.deleteLogic(Func.toLongList(ids))); + } + + /** + * 分页 + */ + @GetMapping("/list") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "分页", notes = "查询条件::startTime,endTime,stationCode") + public R> list(QueryVo filter, Query query) { + return service.pageCondition(filter, query); + } +} diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/NotInsertUseController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/NotInsertUseController.java new file mode 100644 index 0000000..8658446 --- /dev/null +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/NotInsertUseController.java @@ -0,0 +1,63 @@ +package com.hnac.hzims.operational.fill.controller; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import com.hnac.hzims.operational.fill.entity.NotInsertUseEntity; +import com.hnac.hzims.operational.fill.entity.RainfallEntity; +import com.hnac.hzims.operational.fill.service.NotInsertUseService; +import com.hnac.hzims.operational.fill.vo.QueryVo; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import lombok.AllArgsConstructor; +import org.springblade.core.boot.ctrl.BladeController; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; + +/** + * @author ysj + * @date 2023/03/09 16:12:22 + * @version 4.0.0 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/notInsert/use") +@Api(value = "未接入泵站历史用电量填报", tags = "未接入泵站历史用电量填报") +public class NotInsertUseController extends BladeController { + + private final NotInsertUseService service; + + /** + * 新增 + */ + @PostMapping("/saveOrUpdate") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "新增", notes = "传入InsertPowerEntity对象") + public R saveOrUpdate(@RequestBody NotInsertUseEntity entity) { + return R.status(service.saveUpdate(entity)); + } + + /** + * 删除 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "逻辑删除", notes = "传入id字符串以逗号分隔") + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return R.status(service.deleteLogic(Func.toLongList(ids))); + } + + /** + * 分页 + */ + @GetMapping("/list") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "分页", notes = "查询条件::startTime,endTime,stationCode") + public R> list(QueryVo filter, Query query) { + return service.pageCondition(filter, query); + } +} diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/RainfallController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/RainfallController.java new file mode 100644 index 0000000..aac7045 --- /dev/null +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/RainfallController.java @@ -0,0 +1,62 @@ +package com.hnac.hzims.operational.fill.controller; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.core.mp.support.Query; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import com.hnac.hzims.operational.fill.entity.RainfallEntity; +import com.hnac.hzims.operational.fill.service.RainfallService; +import com.hnac.hzims.operational.fill.vo.QueryVo; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import lombok.AllArgsConstructor; +import org.springblade.core.boot.ctrl.BladeController; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; + +/** + * @author ysj + * @date 2023/03/09 16:12:22 + * @version 4.0.0 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/rainfall") +@Api(value = "水利降雨量填报", tags = "接入泵站用电量填报") +public class RainfallController extends BladeController { + + private final RainfallService service; + + /** + * 新增 + */ + @PostMapping("/saveOrUpdate") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "新增", notes = "传入InsertPowerEntity对象") + public R saveOrUpdate(@RequestBody RainfallEntity entity) { + return R.status(service.saveUpdate(entity)); + } + + /** + * 删除 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "逻辑删除", notes = "传入id字符串以逗号分隔") + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return R.status(service.deleteLogic(Func.toLongList(ids))); + } + + /** + * 分页 + */ + @GetMapping("/list") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "分页", notes = "查询条件::startTime,endTime,stationCode") + public R> list(QueryVo filter, Query query) { + return service.pageCondition(filter, query); + } +} diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/StorageController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/StorageController.java new file mode 100644 index 0000000..3dcb9f2 --- /dev/null +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/StorageController.java @@ -0,0 +1,62 @@ +package com.hnac.hzims.operational.fill.controller; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import com.hnac.hzims.operational.fill.entity.StorageEntity; +import com.hnac.hzims.operational.fill.service.StorageService; +import com.hnac.hzims.operational.fill.vo.QueryVo; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import lombok.AllArgsConstructor; +import org.springblade.core.boot.ctrl.BladeController; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; + +/** + * @author ysj + * @date 2023/03/09 16:12:22 + * @version 4.0.0 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/rainfall") +@Api(value = "水利降雨量填报", tags = "接入泵站用电量填报") +public class StorageController extends BladeController { + + private final StorageService service; + + /** + * 新增 + */ + @PostMapping("/saveOrUpdate") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "新增", notes = "传入InsertPowerEntity对象") + public R saveOrUpdate(@RequestBody StorageEntity entity) { + return R.status(service.saveUpdate(entity)); + } + + /** + * 删除 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "逻辑删除", notes = "传入id字符串以逗号分隔") + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return R.status(service.deleteLogic(Func.toLongList(ids))); + } + + /** + * 分页 + */ + @GetMapping("/list") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "分页", notes = "查询条件:startTime,endTime,stationCode") + public R> list(QueryVo vo, Query query) { + return service.pageCondition(vo, query); + } +} diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/InsertPowerMapper.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/InsertPowerMapper.java new file mode 100644 index 0000000..cdfbda1 --- /dev/null +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/InsertPowerMapper.java @@ -0,0 +1,13 @@ +package com.hnac.hzims.operational.fill.mapper; + +import com.hnac.hzims.operational.fill.entity.InsertPowerEntity; +import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper; + +/** + * @author ysj + * @date 2023/03/09 16:12:22 + * @version 4.0.0 + */ +public interface InsertPowerMapper extends UserDataScopeBaseMapper { + +} diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/InsertPowerMapper.xml b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/InsertPowerMapper.xml new file mode 100644 index 0000000..16bdc6f --- /dev/null +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/InsertPowerMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/InsertUseMapper.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/InsertUseMapper.java new file mode 100644 index 0000000..347d75b --- /dev/null +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/InsertUseMapper.java @@ -0,0 +1,13 @@ +package com.hnac.hzims.operational.fill.mapper; + +import com.hnac.hzims.operational.fill.entity.InsertUseEntity; +import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper; + +/** + * @author ysj + * @date 2023/03/09 16:12:22 + * @version 4.0.0 + */ +public interface InsertUseMapper extends UserDataScopeBaseMapper { + +} diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/InsertUseMapper.xml b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/InsertUseMapper.xml new file mode 100644 index 0000000..b325207 --- /dev/null +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/InsertUseMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/NotInsertPowerMapper.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/NotInsertPowerMapper.java new file mode 100644 index 0000000..97f39f0 --- /dev/null +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/NotInsertPowerMapper.java @@ -0,0 +1,13 @@ +package com.hnac.hzims.operational.fill.mapper; + +import com.hnac.hzims.operational.fill.entity.NotInsertPowerEntity; +import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper; + +/** + * @author ysj + * @date 2023/03/09 16:12:22 + * @version 4.0.0 + */ +public interface NotInsertPowerMapper extends UserDataScopeBaseMapper { + +} diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/NotInsertPowerMapper.xml b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/NotInsertPowerMapper.xml new file mode 100644 index 0000000..9b9758d --- /dev/null +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/NotInsertPowerMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/NotInsertUseMapper.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/NotInsertUseMapper.java new file mode 100644 index 0000000..876157c --- /dev/null +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/NotInsertUseMapper.java @@ -0,0 +1,13 @@ +package com.hnac.hzims.operational.fill.mapper; + +import com.hnac.hzims.operational.fill.entity.NotInsertUseEntity; +import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper; + +/** + * @author ysj + * @date 2023/03/09 16:12:22 + * @version 4.0.0 + */ +public interface NotInsertUseMapper extends UserDataScopeBaseMapper { + +} diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/NotInsertUseMapper.xml b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/NotInsertUseMapper.xml new file mode 100644 index 0000000..b5062bb --- /dev/null +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/NotInsertUseMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/RainfallMapper.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/RainfallMapper.java new file mode 100644 index 0000000..96e6230 --- /dev/null +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/RainfallMapper.java @@ -0,0 +1,13 @@ +package com.hnac.hzims.operational.fill.mapper; + +import com.hnac.hzims.operational.fill.entity.RainfallEntity; +import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper; + +/** + * @author ysj + * @date 2023/03/09 16:12:22 + * @version 4.0.0 + */ +public interface RainfallMapper extends UserDataScopeBaseMapper { + +} diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/RainfallMapper.xml b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/RainfallMapper.xml new file mode 100644 index 0000000..fe5c64c --- /dev/null +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/RainfallMapper.xml @@ -0,0 +1,4 @@ + + + + diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/StorageMapper.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/StorageMapper.java new file mode 100644 index 0000000..3e69fe4 --- /dev/null +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/StorageMapper.java @@ -0,0 +1,14 @@ +package com.hnac.hzims.operational.fill.mapper; + +import com.hnac.hzims.operational.fill.entity.RainfallEntity; +import com.hnac.hzims.operational.fill.entity.StorageEntity; +import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper; + +/** + * @author ysj + * @date 2023/03/09 16:12:22 + * @version 4.0.0 + */ +public interface StorageMapper extends UserDataScopeBaseMapper { + +} diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/StorageMapper.xml b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/StorageMapper.xml new file mode 100644 index 0000000..b7b48d2 --- /dev/null +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/StorageMapper.xml @@ -0,0 +1,4 @@ + + + + diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/InsertPowerService.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/InsertPowerService.java new file mode 100644 index 0000000..a2a8729 --- /dev/null +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/InsertPowerService.java @@ -0,0 +1,17 @@ +package com.hnac.hzims.operational.fill.service; + +import com.hnac.hzims.operational.fill.entity.InsertPowerEntity; +import org.springblade.core.mp.base.BaseService; + +/** + * @author ysj + * @date 2023/03/09 16:12:22 + * @version 4.0.0 + */ +/** + * 接入电站历史发电量填报 + */ +public interface InsertPowerService extends BaseService { + + +} diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/InsertUseService.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/InsertUseService.java new file mode 100644 index 0000000..95fd0c3 --- /dev/null +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/InsertUseService.java @@ -0,0 +1,18 @@ +package com.hnac.hzims.operational.fill.service; + +import com.hnac.hzims.operational.fill.entity.InsertUseEntity; +import org.springblade.core.mp.base.BaseService; + +/** + * @author ysj + * @date 2023/03/09 16:12:22 + * @version 4.0.0 + */ + +/** + * 接入电站历史发电量填报 + */ +public interface InsertUseService extends BaseService { + + +} diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/NotInsertPowerService.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/NotInsertPowerService.java new file mode 100644 index 0000000..0bc1d25 --- /dev/null +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/NotInsertPowerService.java @@ -0,0 +1,28 @@ +package com.hnac.hzims.operational.fill.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.hnac.hzims.operational.fill.entity.InsertPowerEntity; +import com.hnac.hzims.operational.fill.entity.NotInsertPowerEntity; +import com.hnac.hzims.operational.fill.vo.QueryVo; +import org.springblade.core.mp.base.BaseService; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; + +/** + * @author ysj + * @date 2023/03/09 16:12:22 + * @version 4.0.0 + */ + +/** + * 接入电站历史发电量填报 + */ +public interface NotInsertPowerService extends BaseService { + + + // 新增/修改未接入电站发电量填报数据 + boolean saveUpdate(NotInsertPowerEntity entity); + + // 分页查询未接入电站发电量填报数据 + R> pageCondition(QueryVo filter, Query query); +} diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/NotInsertUseService.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/NotInsertUseService.java new file mode 100644 index 0000000..b073c77 --- /dev/null +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/NotInsertUseService.java @@ -0,0 +1,26 @@ +package com.hnac.hzims.operational.fill.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.hnac.hzims.operational.fill.entity.NotInsertUseEntity; +import com.hnac.hzims.operational.fill.vo.QueryVo; +import org.springblade.core.mp.base.BaseService; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; + +/** + * @author ysj + * @date 2023/03/09 16:12:22 + * @version 4.0.0 + */ + +/** + * 接入电站历史发电量填报 + */ +public interface NotInsertUseService extends BaseService { + + // 新增/修改未接入泵站用电量填报数据 + boolean saveUpdate(NotInsertUseEntity entity); + + // 分页查询未接入泵站用电量填报数据 + R> pageCondition(QueryVo filter, Query query); +} diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/RainfallService.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/RainfallService.java new file mode 100644 index 0000000..9d6e3dd --- /dev/null +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/RainfallService.java @@ -0,0 +1,26 @@ +package com.hnac.hzims.operational.fill.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.hnac.hzims.operational.fill.entity.RainfallEntity; +import com.hnac.hzims.operational.fill.vo.QueryVo; +import org.springblade.core.mp.base.BaseService; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; + +/** + * @author ysj + * @date 2023/03/09 16:12:22 + * @version 4.0.0 + */ + +/** + * 接入电站历史发电量填报 + */ +public interface RainfallService extends BaseService { + + // 分页查询水利降雨量填报数据 + R> pageCondition(QueryVo filter, Query query); + + // 新增/修改水利降雨量填报数据 + boolean saveUpdate(RainfallEntity entity); +} diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/StorageService.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/StorageService.java new file mode 100644 index 0000000..a0961a5 --- /dev/null +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/StorageService.java @@ -0,0 +1,26 @@ +package com.hnac.hzims.operational.fill.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.hnac.hzims.operational.fill.entity.StorageEntity; +import com.hnac.hzims.operational.fill.vo.QueryVo; +import org.springblade.core.mp.base.BaseService; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; + +/** + * @author ysj + * @date 2023/03/09 16:12:22 + * @version 4.0.0 + */ + +/** + * 接入电站历史发电量填报 + */ +public interface StorageService extends BaseService { + + // 分页查询储能发电填报数据 + R> pageCondition(QueryVo vo, Query query); + + // 新增/修改储能发电量填报 + boolean saveUpdate(StorageEntity entity); +} diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/InsertPowerServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/InsertPowerServiceImpl.java new file mode 100644 index 0000000..11717d9 --- /dev/null +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/InsertPowerServiceImpl.java @@ -0,0 +1,22 @@ +package com.hnac.hzims.operational.fill.service.impl; + +import com.hnac.hzims.operational.fill.entity.InsertPowerEntity; +import com.hnac.hzims.operational.fill.mapper.InsertPowerMapper; +import com.hnac.hzims.operational.fill.service.InsertPowerService; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springblade.core.mp.base.BaseServiceImpl; +import org.springframework.stereotype.Service; + +/** + * @author ysj + * @date 2023/03/09 16:12:22 + * @version 4.0.0 + */ +@Slf4j +@Service +@AllArgsConstructor +public class InsertPowerServiceImpl extends BaseServiceImpl implements InsertPowerService { + + +} diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/InsertUseServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/InsertUseServiceImpl.java new file mode 100644 index 0000000..0a079c7 --- /dev/null +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/InsertUseServiceImpl.java @@ -0,0 +1,22 @@ +package com.hnac.hzims.operational.fill.service.impl; + +import com.hnac.hzims.operational.fill.entity.InsertUseEntity; +import com.hnac.hzims.operational.fill.mapper.InsertUseMapper; +import com.hnac.hzims.operational.fill.service.InsertUseService; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springblade.core.mp.base.BaseServiceImpl; +import org.springframework.stereotype.Service; + +/** + * @author ysj + * @date 2023/03/09 16:12:22 + * @version 4.0.0 + */ +@Slf4j +@Service +@AllArgsConstructor +public class InsertUseServiceImpl extends BaseServiceImpl implements InsertUseService { + + +} diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/NotInsertPowerServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/NotInsertPowerServiceImpl.java new file mode 100644 index 0000000..9730904 --- /dev/null +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/NotInsertPowerServiceImpl.java @@ -0,0 +1,80 @@ +package com.hnac.hzims.operational.fill.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.hnac.hzims.operational.fill.entity.NotInsertPowerEntity; +import com.hnac.hzims.operational.fill.entity.RainfallEntity; +import com.hnac.hzims.operational.fill.mapper.NotInsertPowerMapper; +import com.hnac.hzims.operational.fill.service.NotInsertPowerService; +import com.hnac.hzims.operational.fill.vo.QueryVo; +import com.hnac.hzims.operational.fill.wrapper.OverWrapper; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springblade.core.log.exception.ServiceException; +import org.springblade.core.mp.base.BaseServiceImpl; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.ObjectUtil; +import org.springblade.core.tool.utils.StringUtil; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @author ysj + * @date 2023/03/09 16:12:22 + * @version 4.0.0 + */ +@Slf4j +@Service +@AllArgsConstructor +public class NotInsertPowerServiceImpl extends BaseServiceImpl implements NotInsertPowerService { + + /** + * 分页查询未接入电站发电量填报数据 + * @param filter + * @param query + * @return + */ + @Override + public R> pageCondition(QueryVo filter, Query query) { + QueryWrapper queryWrapper = new QueryWrapper() {{ + if(!StringUtil.isEmpty(filter.getStationCode())){ + eq("STATION_CODE",filter.getStationCode()); + } + if(!ObjectUtil.isEmpty(filter.getStartTime())){ + ge("FILL_DATE",filter.getStartTime()); + } + if(!ObjectUtil.isEmpty(filter.getEndTime())){ + le("FILL_DATE",filter.getEndTime()); + } + orderByDesc("create_time"); + }}; + IPage pages = super.page(Condition.getPage(query), queryWrapper); + List list = OverWrapper.build().listVO(pages.getRecords()); + return R.data(pages.setRecords(list)); + } + + /** + * 新增/修改未接入电站发电量填报数据 + * @param entity + * @return + */ + @Override + public boolean saveUpdate(NotInsertPowerEntity entity) { + // 查询是否存在历史记录 + NotInsertPowerEntity history = this.getOne(new LambdaQueryWrapper(){{ + eq(NotInsertPowerEntity::getStationCode, entity.getStationCode()); + eq(NotInsertPowerEntity::getFillDate,entity.getFillDate()); + }}); + if(!ObjectUtil.isEmpty(entity.getId())){ + throw new ServiceException("日期已经存在填报数据!"); + } + if(ObjectUtil.isEmpty(history)){ + return this.save(entity); + } + return this.updateById(entity); + } +} diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/NotInsertUseServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/NotInsertUseServiceImpl.java new file mode 100644 index 0000000..8d797d0 --- /dev/null +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/NotInsertUseServiceImpl.java @@ -0,0 +1,81 @@ +package com.hnac.hzims.operational.fill.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.hnac.hzims.operational.fill.entity.NotInsertUseEntity; +import com.hnac.hzims.operational.fill.entity.RainfallEntity; +import com.hnac.hzims.operational.fill.mapper.NotInsertUseMapper; +import com.hnac.hzims.operational.fill.service.NotInsertUseService; +import com.hnac.hzims.operational.fill.vo.QueryVo; +import com.hnac.hzims.operational.fill.wrapper.OverWrapper; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springblade.core.log.exception.ServiceException; +import org.springblade.core.mp.base.BaseServiceImpl; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.ObjectUtil; +import org.springblade.core.tool.utils.StringUtil; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @author ysj + * @date 2023/03/09 16:12:22 + * @version 4.0.0 + */ +@Slf4j +@Service +@AllArgsConstructor +public class NotInsertUseServiceImpl extends BaseServiceImpl implements NotInsertUseService { + + + /** + * 分页查询未接入泵站用电量填报数据 + * @param filter + * @param query + * @return + */ + @Override + public R> pageCondition(QueryVo filter, Query query) { + QueryWrapper queryWrapper = new QueryWrapper() {{ + if(!StringUtil.isEmpty(filter.getStationCode())){ + eq("STATION_CODE",filter.getStationCode()); + } + if(!ObjectUtil.isEmpty(filter.getStartTime())){ + ge("FILL_DATE",filter.getStartTime()); + } + if(!ObjectUtil.isEmpty(filter.getEndTime())){ + le("FILL_DATE",filter.getEndTime()); + } + orderByDesc("create_time"); + }}; + IPage pages = super.page(Condition.getPage(query), queryWrapper); + List list = OverWrapper.build().listVO(pages.getRecords()); + return R.data(pages.setRecords(list)); + } + + /** + * 新增/修改未接入泵站用电量填报数据 + * @param entity + * @return + */ + @Override + public boolean saveUpdate(NotInsertUseEntity entity) { + // 查询是否存在历史记录 + NotInsertUseEntity history = this.getOne(new LambdaQueryWrapper(){{ + eq(NotInsertUseEntity::getStationCode, entity.getStationCode()); + eq(NotInsertUseEntity::getFillDate,entity.getFillDate()); + }}); + if(!ObjectUtil.isEmpty(entity.getId())){ + throw new ServiceException("日期已经存在填报数据!"); + } + if(ObjectUtil.isEmpty(history)){ + return this.save(entity); + } + return this.updateById(entity); + } +} diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/RainFallServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/RainFallServiceImpl.java new file mode 100644 index 0000000..ba13ada --- /dev/null +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/RainFallServiceImpl.java @@ -0,0 +1,81 @@ +package com.hnac.hzims.operational.fill.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.hnac.hzims.operational.fill.entity.RainfallEntity; +import com.hnac.hzims.operational.fill.entity.StorageEntity; +import com.hnac.hzims.operational.fill.mapper.RainfallMapper; +import com.hnac.hzims.operational.fill.service.RainfallService; +import com.hnac.hzims.operational.fill.vo.QueryVo; +import com.hnac.hzims.operational.fill.wrapper.OverWrapper; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springblade.core.log.exception.ServiceException; +import org.springblade.core.mp.base.BaseServiceImpl; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.ObjectUtil; +import org.springblade.core.tool.utils.StringUtil; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @author ysj + * @date 2023/03/09 16:12:22 + * @version 4.0.0 + */ +@Slf4j +@Service +@AllArgsConstructor +public class RainFallServiceImpl extends BaseServiceImpl implements RainfallService { + + + /** + * 分页查询水利降雨量填报数据 + * @param filter + * @param query + * @return + */ + @Override + public R> pageCondition(QueryVo filter, Query query) { + QueryWrapper queryWrapper = new QueryWrapper() {{ + if(!StringUtil.isEmpty(filter.getStationCode())){ + eq("STATION_CODE",filter.getStationCode()); + } + if(!ObjectUtil.isEmpty(filter.getStartTime())){ + ge("FILL_DATE",filter.getStartTime()); + } + if(!ObjectUtil.isEmpty(filter.getEndTime())){ + le("FILL_DATE",filter.getEndTime()); + } + orderByDesc("create_time"); + }}; + IPage pages = super.page(Condition.getPage(query), queryWrapper); + List list = OverWrapper.build().listVO(pages.getRecords()); + return R.data(pages.setRecords(list)); + } + + /** + * 新增/修改储能发电填报数据 + * @param entity + * @return + */ + @Override + public boolean saveUpdate(RainfallEntity entity) { + // 查询是否存在历史记录 + RainfallEntity history = this.getOne(new LambdaQueryWrapper(){{ + eq(RainfallEntity::getStationCode, entity.getStationCode()); + eq(RainfallEntity::getFillDate,entity.getFillDate()); + }}); + if(!ObjectUtil.isEmpty(entity.getId())){ + throw new ServiceException("日期已经存在填报数据!"); + } + if(ObjectUtil.isEmpty(history)){ + return this.save(entity); + } + return this.updateById(entity); + } +} diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/StorageServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/StorageServiceImpl.java new file mode 100644 index 0000000..0312dd7 --- /dev/null +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/StorageServiceImpl.java @@ -0,0 +1,90 @@ +package com.hnac.hzims.operational.fill.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.hnac.hzims.fdp.entity.FdpTaskEntity; +import com.hnac.hzims.operational.fill.entity.OverEntity; +import com.hnac.hzims.operational.fill.entity.StorageEntity; +import com.hnac.hzims.operational.fill.mapper.StorageMapper; +import com.hnac.hzims.operational.fill.service.StorageService; +import com.hnac.hzims.operational.fill.vo.QueryVo; +import com.hnac.hzims.operational.fill.wrapper.OverWrapper; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import net.bytebuddy.asm.Advice; +import org.springblade.core.log.exception.ServiceException; +import org.springblade.core.mp.base.BaseServiceImpl; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.DateUtil; +import org.springblade.core.tool.utils.ObjectUtil; +import org.springblade.core.tool.utils.StringUtil; +import org.springframework.stereotype.Service; + +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import java.util.Optional; + +/** + * @author ysj + * @date 2023/03/09 16:12:22 + * @version 4.0.0 + */ +@Slf4j +@Service +@AllArgsConstructor +public class StorageServiceImpl extends BaseServiceImpl implements StorageService { + + + private final SimpleDateFormat sdf = new SimpleDateFormat(DateUtil.PATTERN_DATE); + + /** + * 分页查询储能发电填报数据 + * @param filter + * @param query + * @return + */ + @Override + public R> pageCondition(QueryVo filter, Query query) { + QueryWrapper queryWrapper = new QueryWrapper() {{ + if(!StringUtil.isEmpty(filter.getStationCode())){ + eq("STATION_CODE",filter.getStationCode()); + } + if(!ObjectUtil.isEmpty(filter.getStartTime())){ + ge("FILL_DATE",filter.getStartTime()); + } + if(!ObjectUtil.isEmpty(filter.getEndTime())){ + le("FILL_DATE",filter.getEndTime()); + } + orderByDesc("create_time"); + }}; + IPage pages = super.page(Condition.getPage(query), queryWrapper); + List list = OverWrapper.build().listVO(pages.getRecords()); + return R.data(pages.setRecords(list)); + } + + /** + * 新增/修改储能发电填报数据 + * @param entity + * @return + */ + @Override + public boolean saveUpdate(StorageEntity entity) { + // 查询是否存在历史记录 + StorageEntity history = this.getOne(new LambdaQueryWrapper(){{ + eq(StorageEntity::getStationCode, entity.getStationCode()); + eq(StorageEntity::getFillDate,entity.getFillDate()); + }}); + if(!ObjectUtil.isEmpty(entity.getId())){ + throw new ServiceException("日期已经存在填报数据!"); + } + if(ObjectUtil.isEmpty(history)){ + return this.save(entity); + } + return this.updateById(entity); + } +} diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/OperMaintenanceTaskServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/OperMaintenanceTaskServiceImpl.java index 39900f5..21f09c8 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/OperMaintenanceTaskServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/OperMaintenanceTaskServiceImpl.java @@ -113,6 +113,12 @@ public class OperMaintenanceTaskServiceImpl extends BaseServiceImpl workTicketSafetyMeasureDtoList; + + @ApiModelProperty("机构编码集合") + private List deptIds; } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/StandardTicketInfoServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/StandardTicketInfoServiceImpl.java index bc26baa..aa45bac 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/StandardTicketInfoServiceImpl.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/StandardTicketInfoServiceImpl.java @@ -416,6 +416,9 @@ public class StandardTicketInfoServiceImpl extends BaseServiceImpl deptIds; + } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketInfoServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketInfoServiceImpl.java index b05a38f..5af6e85 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketInfoServiceImpl.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketInfoServiceImpl.java @@ -683,6 +683,9 @@ public class WorkTicketInfoServiceImpl extends BaseServiceImpl