Browse Source

#数据填报

zhongwei
yang_shj 2 years ago
parent
commit
ae25115fd1
  1. 33
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/alert/entity/AlarmHandleDetailEntity.java
  2. 35
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/alert/entity/AlarmHandleEntity.java
  3. 4
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/census/vo/CompleteTicketVo.java
  4. 22
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/census/vo/DeviceClassifyVo.java
  5. 13
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/entity/OperDefectEntity.java
  6. 44
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/fill/entity/InsertPowerEntity.java
  7. 44
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/fill/entity/InsertUseEntity.java
  8. 33
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/fill/entity/NotInsertPowerEntity.java
  9. 33
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/fill/entity/NotInsertUseEntity.java
  10. 33
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/fill/entity/RainfallEntity.java
  11. 32
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/fill/entity/StorageEntity.java
  12. 22
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/fill/vo/QueryVo.java
  13. 5
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/dto/OperMaintenanceTaskDTO.java
  14. 6
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/dto/OperAccessTaskDTO.java
  15. 6
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessTaskMapper.xml
  16. 77
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/controller/AlarmHandleController.java
  17. 13
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/mapper/AlarmHandleDetailMapper.java
  18. 6
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/mapper/AlarmHandleDetailMapper.xml
  19. 13
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/mapper/AlarmHandleMapper.java
  20. 6
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/mapper/AlarmHandleMapper.xml
  21. 13
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/AlarmHandleDetailService.java
  22. 13
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/AlarmHandleService.java
  23. 21
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/AlarmHandleDetailServiceImpl.java
  24. 21
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/AlarmHandleServiceImpl.java
  25. 33
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/controller/TargetController.java
  26. 7
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/TargetService.java
  27. 257
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/impl/TargetServiceImpl.java
  28. 6
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/controller/OperDefectController.java
  29. 74
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/InsertPowerController.java
  30. 69
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/InsertUseController.java
  31. 63
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/NotInsertPowerController.java
  32. 63
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/NotInsertUseController.java
  33. 62
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/RainfallController.java
  34. 62
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/StorageController.java
  35. 13
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/InsertPowerMapper.java
  36. 5
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/InsertPowerMapper.xml
  37. 13
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/InsertUseMapper.java
  38. 5
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/InsertUseMapper.xml
  39. 13
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/NotInsertPowerMapper.java
  40. 5
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/NotInsertPowerMapper.xml
  41. 13
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/NotInsertUseMapper.java
  42. 5
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/NotInsertUseMapper.xml
  43. 13
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/RainfallMapper.java
  44. 4
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/RainfallMapper.xml
  45. 14
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/StorageMapper.java
  46. 4
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/StorageMapper.xml
  47. 17
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/InsertPowerService.java
  48. 18
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/InsertUseService.java
  49. 28
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/NotInsertPowerService.java
  50. 26
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/NotInsertUseService.java
  51. 26
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/RainfallService.java
  52. 26
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/StorageService.java
  53. 22
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/InsertPowerServiceImpl.java
  54. 22
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/InsertUseServiceImpl.java
  55. 80
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/NotInsertPowerServiceImpl.java
  56. 81
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/NotInsertUseServiceImpl.java
  57. 81
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/RainFallServiceImpl.java
  58. 90
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/StorageServiceImpl.java
  59. 6
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/OperMaintenanceTaskServiceImpl.java
  60. 3
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/dto/StandardTicketInfoDto.java
  61. 3
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/StandardTicketInfoServiceImpl.java
  62. 3
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/dto/WorkTicketInfoDto.java
  63. 3
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketInfoServiceImpl.java

33
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;
}

35
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;
}

4
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;

22
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;
}

13
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<Long> deptIds;
}

44
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;
}

44
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;
}

33
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;
}

33
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;
}

33
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;
}

32
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;
}

22
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;
}

5
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<Long> deptIds;
@ApiModelProperty("开始时间")
private String startTime;
@ApiModelProperty("结束时间")
private String endTime;
}

6
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<OperAccessMaterialDTO> accessMaterials;
@ApiModelProperty("开始时间")
private String startTime;
@ApiModelProperty("结束时间")
private String endTime;
}

6
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessTaskMapper.xml

@ -77,6 +77,12 @@
<if test="req.excludeNullTicket != null and req.excludeNullTicket == 1">
and t1.`TICKET_ID` is null
</if>
<if test="req.startTime != null">
and t1.`PLAN_START_TIME` &gt; #{req.startTime}
</if>
<if test="req.endTime != null">
and t1.`PLAN_START_TIME` &lt; #{req.endTime}
</if>
<if test="req.deptIds != null">
and t1.create_dept in
<foreach collection="req.deptIds" item="item" index="index" open="(" close=")" separator=",">

77
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<AlarmHandleEntity> 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<IPage<AlarmHandleEntity>> list(AlarmHandleEntity entity, Query query) {
IPage<AlarmHandleEntity> 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)));
}
}

13
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<AlarmHandleDetailEntity> {
}

6
hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/mapper/AlarmHandleDetailMapper.xml

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hnac.hzims.operational.alert.mapper.AlarmHandleDetailMapper">
</mapper>

13
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<AlarmHandleEntity> {
}

6
hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/mapper/AlarmHandleMapper.xml

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hnac.hzims.operational.alert.mapper.AlarmHandleMapper">
</mapper>

13
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<AlarmHandleDetailEntity> {
}

13
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<AlarmHandleEntity> {
}

21
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<AlarmHandleDetailMapper, AlarmHandleDetailEntity> implements AlarmHandleDetailService {
}

21
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<AlarmHandleMapper, AlarmHandleEntity> implements AlarmHandleService {
}

33
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<IPage<OperMaintenanceTaskVO>> 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<IPage<OperAccessTaskVO>> 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));
}
}

7
hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/TargetService.java

@ -24,10 +24,10 @@ public interface TargetService {
List<InstalledCapacityVo> installedCapacity(String stationName,Integer type);
// 发电量统计
List<ElectricGenerationVo> electricGeneration();
List<ElectricGenerationVo> electricGeneration(String stationName,Integer type);
// 计划发电量/实际发电量统计
List<CompleteGenerationVo> completeGeneration();
List<CompleteGenerationVo> completeGeneration(String stationName,Integer type);
// 两票统计
List<CompleteTicketVo> completeTicket(String areaName,Integer type);
@ -46,4 +46,7 @@ public interface TargetService {
// 检修任务统计
R<IPage<OperAccessTaskVO>> examineRepair(OperAccessTaskDTO params, Query query, Integer type);
// 设备分类统计
List<DeviceClassifyVo> deviceClassify(String stationName, Long deptId);
}

257
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<ElectricGenerationVo> electricGeneration() {
// 站点
List<StationEntity> stations = stationService.getStationType(HomePageConstant.HYDROPOWER_SERVETYPE, Collections.singletonList(HomePageConstant.HYDROPOWER), null);
if(CollectionUtils.isEmpty(stations)){
public List<ElectricGenerationVo> electricGeneration(String stationName,Integer type) {
// 接入站点
List<StationEntity> stations = stationService.list(Wrappers.<StationEntity>lambdaQuery()
.eq(StationEntity::getType, type)
.eq(StationEntity::getServeType,HomePageConstant.HYDROPOWER_SERVETYPE)
.like(StationEntity::getName,stationName)
);if(CollectionUtils.isEmpty(stations)){
return new ArrayList<>();
}
// 设备指标数据
List<HydropowerUnitTargetVo> targets = (List<HydropowerUnitTargetVo>) redisTemplate.opsForValue().get(load_hydropower_unit_target_key);
if(CollectionUtils.isEmpty(targets)){
return new ArrayList<>();
// 填报数据
if(HomePageConstant.HYDROPOWER.equals(type)){
// 设备指标数据
List<HydropowerUnitTargetVo> targets = (List<HydropowerUnitTargetVo>) 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<HydropowerUnitTargetVo> 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<String> 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<PowerEntity> powers = powerService.list(Wrappers.<PowerEntity>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<HydropowerUnitTargetVo> stationTargets = targets.stream().filter(device->device.getDeptId().equals(station.getRefDept())).collect(Collectors.toList());
if(CollectionUtils.isEmpty(stationTargets)){
// 发电量
List<PowerEntity> 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<String> 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<CompleteGenerationVo> completeGeneration() {
public List<CompleteGenerationVo> completeGeneration(String stationName,Integer type) {
// 站点
List<StationEntity> stations = stationService.getStationType(HomePageConstant.HYDROPOWER_SERVETYPE, Collections.singletonList(HomePageConstant.HYDROPOWER), null);
List<StationEntity> stations = stationService.list(Wrappers.<StationEntity>lambdaQuery()
.eq(StationEntity::getType, type)
.eq(StationEntity::getServeType,HomePageConstant.HYDROPOWER_SERVETYPE)
.like(StationEntity::getName,stationName));
if(CollectionUtils.isEmpty(stations)){
return new ArrayList<>();
}
// 计划发电量
List<PlanGenerationEntity> plans = planClient.getPlanGenerationByParam(stations.stream().map(StationEntity::getCode).collect(Collectors.toList()), null, DateUtil.format(new Date(), "yyyy"));
// 设备指标数据
List<HydropowerUnitTargetVo> targets = (List<HydropowerUnitTargetVo>) redisTemplate.opsForValue().get(load_hydropower_unit_target_key);
if(CollectionUtils.isEmpty(targets)){
return new ArrayList<>();
if(HomePageConstant.HYDROPOWER.equals(type)){
// 计划发电量
List<PlanGenerationEntity> plans = planClient.getPlanGenerationByParam(stations.stream().map(StationEntity::getCode).collect(Collectors.toList()), null, DateUtil.format(new Date(), "yyyy"));
// 设备指标数据
List<HydropowerUnitTargetVo> targets = (List<HydropowerUnitTargetVo>) 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<HydropowerUnitTargetVo> 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<Float> 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<PowerEntity> powers = powerService.list(Wrappers.<PowerEntity>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<HydropowerUnitTargetVo> 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<Float> planGenerations = plans.stream().filter(plan->plan.getStationId().equals(station.getCode())).map(PlanGenerationEntity::getPlanGeneration).collect(Collectors.toList());
if(CollectionUtils.isEmpty(planGenerations)){
// 发电量
List<PowerEntity> 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<CompleteTicketVo> completeTicket(String areaName,Integer type) {
// 光伏/风电双票填报数据
if(HomePageConstant.WIND_POWER.equals(type) || HomePageConstant.PHOTOVOLTAIC.equals(type)){
return this.getcompleteFillTicket(areaName,type);
}
// 平台业务数据
List<Integer> types;
if(HomePageConstant.WATER_CONSERVANCY.equals(type)){
types = HomePageConstant.waterList;
}else{
types = Collections.singletonList(type);
}
// 获取水电站区域机构
Map<Dept, List<StationEntity>> areas = areaService.getAuthArea(null,null,Collections.singletonList(HomePageConstant.HYDROPOWER),HomePageConstant.HYDROPOWER_SERVETYPE);
Map<Dept, List<StationEntity>> 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<CompleteTicketVo> getcompleteFillTicket(String stationName, Integer type) {
List<StationEntity> stations = stationService.list(Wrappers.<StationEntity>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<PowerEntity> powers = powerService.list(Wrappers.<PowerEntity>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<OverEntity> overs = overService.list(Wrappers.<OverEntity>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<DeviceClassifyVo> deviceClassify(String stationName, Long deptId) {
// 获取区域设备统计
Map<String, List<String>> deviceClassifyMap = (Map<String, List<String>>) redisTemplate.opsForValue().get(device_classify_key);
List<String> faultList = deviceClassifyMap.get(HomePageConstant.FAULT);
List<String> overhaultList = deviceClassifyMap.get(HomePageConstant.OVERHAUL);
List<String> runtList = deviceClassifyMap.get(HomePageConstant.RUN);
//根据用户权限获取机构
R<List<Dept>> result = sysClient.getDeptByCurrentUser();
if (!result.isSuccess() || ObjectUtil.isEmpty(result.getData())) {
return new ArrayList<>();
}
// 站点
List<StationEntity> stations = stationService.getStationList(result.getData(),deptId,Collections.singletonList(HomePageConstant.HYDROPOWER),HomePageConstant.HYDROPOWER_SERVETYPE);
if(CollectionUtils.isEmpty(stations)){
return new ArrayList<>();
}
List<Long> 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<EminfoAndEmParamVo> 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
*/

6
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<OperDefectEntity> pages = defectService.page(Condition.getPage(query), queryWrapper);
IPage<OperDefectVO> vos = OperDefectWrapper.build().pageVO(pages);

74
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<IPage<OtherVo>> list(OtherVo vo, Query query) {
return service.pageCondition(vo, query);
}*/
}

69
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<IPage<OtherVo>> list(OtherVo vo, Query query) {
return service.pageCondition(vo, query);
}*/
}

63
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<IPage<NotInsertPowerEntity>> list(QueryVo filter, Query query) {
return service.pageCondition(filter, query);
}
}

63
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<IPage<NotInsertUseEntity>> list(QueryVo filter, Query query) {
return service.pageCondition(filter, query);
}
}

62
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<IPage<RainfallEntity>> list(QueryVo filter, Query query) {
return service.pageCondition(filter, query);
}
}

62
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<IPage<StorageEntity>> list(QueryVo vo, Query query) {
return service.pageCondition(vo, query);
}
}

13
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<InsertPowerEntity> {
}

5
hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/InsertPowerMapper.xml

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.hnac.hzims.operational.fill.mapper.InsertPowerMapper">
</mapper>

13
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<InsertUseEntity> {
}

5
hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/InsertUseMapper.xml

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.hnac.hzims.operational.fill.mapper.InsertUseMapper">
</mapper>

13
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<NotInsertPowerEntity> {
}

5
hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/NotInsertPowerMapper.xml

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.hnac.hzims.operational.fill.mapper.NotInsertPowerMapper">
</mapper>

13
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<NotInsertUseEntity> {
}

5
hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/NotInsertUseMapper.xml

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.hnac.hzims.operational.fill.mapper.NotInsertUseMapper">
</mapper>

13
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<RainfallEntity> {
}

4
hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/RainfallMapper.xml

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.hnac.hzims.operational.fill.mapper.RainfallMapper">
</mapper>

14
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<StorageEntity> {
}

4
hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/mapper/StorageMapper.xml

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.hnac.hzims.operational.fill.mapper.StorageMapper">
</mapper>

17
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<InsertPowerEntity> {
}

18
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<InsertUseEntity> {
}

28
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<NotInsertPowerEntity> {
// 新增/修改未接入电站发电量填报数据
boolean saveUpdate(NotInsertPowerEntity entity);
// 分页查询未接入电站发电量填报数据
R<IPage<NotInsertPowerEntity>> pageCondition(QueryVo filter, Query query);
}

26
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<NotInsertUseEntity> {
// 新增/修改未接入泵站用电量填报数据
boolean saveUpdate(NotInsertUseEntity entity);
// 分页查询未接入泵站用电量填报数据
R<IPage<NotInsertUseEntity>> pageCondition(QueryVo filter, Query query);
}

26
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<RainfallEntity> {
// 分页查询水利降雨量填报数据
R<IPage<RainfallEntity>> pageCondition(QueryVo filter, Query query);
// 新增/修改水利降雨量填报数据
boolean saveUpdate(RainfallEntity entity);
}

26
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<StorageEntity> {
// 分页查询储能发电填报数据
R<IPage<StorageEntity>> pageCondition(QueryVo vo, Query query);
// 新增/修改储能发电量填报
boolean saveUpdate(StorageEntity entity);
}

22
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<InsertPowerMapper, InsertPowerEntity> implements InsertPowerService {
}

22
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<InsertUseMapper, InsertUseEntity> implements InsertUseService {
}

80
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<NotInsertPowerMapper, NotInsertPowerEntity> implements NotInsertPowerService {
/**
* 分页查询未接入电站发电量填报数据
* @param filter
* @param query
* @return
*/
@Override
public R<IPage<NotInsertPowerEntity>> pageCondition(QueryVo filter, Query query) {
QueryWrapper<NotInsertPowerEntity> queryWrapper = new QueryWrapper<NotInsertPowerEntity>() {{
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<NotInsertPowerEntity>(){{
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);
}
}

81
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<NotInsertUseMapper, NotInsertUseEntity> implements NotInsertUseService {
/**
* 分页查询未接入泵站用电量填报数据
* @param filter
* @param query
* @return
*/
@Override
public R<IPage<NotInsertUseEntity>> pageCondition(QueryVo filter, Query query) {
QueryWrapper<NotInsertUseEntity> queryWrapper = new QueryWrapper<NotInsertUseEntity>() {{
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<NotInsertUseEntity>(){{
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);
}
}

81
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<RainfallMapper, RainfallEntity> implements RainfallService {
/**
* 分页查询水利降雨量填报数据
* @param filter
* @param query
* @return
*/
@Override
public R<IPage<RainfallEntity>> pageCondition(QueryVo filter, Query query) {
QueryWrapper<RainfallEntity> queryWrapper = new QueryWrapper<RainfallEntity>() {{
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<RainfallEntity>(){{
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);
}
}

90
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<StorageMapper, StorageEntity> implements StorageService {
private final SimpleDateFormat sdf = new SimpleDateFormat(DateUtil.PATTERN_DATE);
/**
* 分页查询储能发电填报数据
* @param filter
* @param query
* @return
*/
@Override
public R<IPage<StorageEntity>> pageCondition(QueryVo filter, Query query) {
QueryWrapper<StorageEntity> queryWrapper = new QueryWrapper<StorageEntity>() {{
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<StorageEntity>(){{
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);
}
}

6
hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/OperMaintenanceTaskServiceImpl.java

@ -113,6 +113,12 @@ public class OperMaintenanceTaskServiceImpl extends BaseServiceImpl<OperMaintena
if (req.getExcludeNullTicket() != null && req.getExcludeNullTicket() == 1) {
isNull(OperMaintenanceTaskEntity::getTicketId);
}
if (!StringUtil.isEmpty(req.getStartTime())) {
gt(OperMaintenanceTaskEntity::getDisposeTime,req.getStartTime());
}
if (!StringUtil.isEmpty(req.getEndTime())) {
lt(OperMaintenanceTaskEntity::getDisposeTime,req.getEndTime());
}
if(!CollectionUtils.isEmpty(req.getDeptIds())){
in(OperMaintenanceTaskEntity::getCreateDept,req.getDeptIds());
}

3
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/dto/StandardTicketInfoDto.java

@ -40,4 +40,7 @@ public class StandardTicketInfoDto extends StandardTicketInfoEntity implements S
@ApiModelProperty("安全措施列表")
private List<StandardTicketMeasureEntity> workTicketSafetyMeasureDtoList;
@ApiModelProperty("机构编码集合")
private List<Long> deptIds;
}

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

@ -416,6 +416,9 @@ public class StandardTicketInfoServiceImpl extends BaseServiceImpl<StandardTicke
if(Func.isNotEmpty(req.getEndTime())){
queryWrapper.le(StandardTicketInfoEntity::getCreateTime,req.getEndTime());
}
if(!CollectionUtil.isEmpty(req.getDeptIds())){
queryWrapper.in(StandardTicketInfoEntity::getCreateDept,req.getDeptIds());
}
return queryWrapper;
}

3
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/dto/WorkTicketInfoDto.java

@ -61,4 +61,7 @@ public class WorkTicketInfoDto extends WorkTicketInfoEntity implements Serializa
@ApiModelProperty("工作票结束上传图片文件名")
private String finishImgFilenames;
@ApiModelProperty("机构编号集合")
private List<Long> deptIds;
}

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

@ -683,6 +683,9 @@ public class WorkTicketInfoServiceImpl extends BaseServiceImpl<WorkTicketInfoMap
if(Func.isNotEmpty(req.getEndTime())){
lqw.le(WorkTicketInfoEntity::getCreateTime,req.getEndTime());
}
if(!CollectionUtil.isEmpty(req.getDeptIds())){
lqw.in(WorkTicketInfoEntity::getCreateDept,req.getDeptIds());
}
return lqw;
}

Loading…
Cancel
Save