Browse Source

Merge remote-tracking branch 'origin/master'

zhongwei
yang_shj 10 months ago
parent
commit
a45ff4d3c8
  1. 5
      hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/report/feign/IInspectReportClient.java
  2. 7
      hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/report/feign/InspectReportClientFallback.java
  3. 3
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/HygienePlanEntity.java
  4. 3
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/TestEntity.java
  5. 31
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/TestMethodEnum.java
  6. 17
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/CarMilesYearVO.java
  7. 26
      hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/allTicket/vo/TicketInfoStatisticVO.java
  8. 20
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/gather/feigns/InspectReportClient.java
  9. 12
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/report/feigns/InspectReportClient.java
  10. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/IOperAccessTaskService.java
  11. 50
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/OperAccessTaskServiceImpl.java
  12. 3
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/IOperDefectService.java
  13. 37
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/OperDefectServiceImpl.java
  14. 5
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/IImsDutyMainService.java
  15. 147
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyMainServiceImpl.java
  16. 5
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/IMainSystemMonitoringService.java
  17. 167
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/MainSystemMonitoringServiceImpl.java
  18. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/IOperMaintenanceTaskService.java
  19. 71
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/OperMaintenanceTaskServiceImpl.java
  20. 52
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/controller/MonthReportController.java
  21. 7
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/schedule/OperStationCreateMonthReport.java
  22. 5
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/IMonthReportService.java
  23. 15
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/IOperStationMonthReportService.java
  24. 43
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/impl/MonthReportServiceImpl.java
  25. 1245
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/impl/OperStationMonthReportServiceImpl.java
  26. 32
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/vo/AccessRunReportVO.java
  27. 36
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/vo/DefectRunReportsVO.java
  28. 36
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/vo/DutyRunReportVO.java
  29. 41
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/vo/FDPRunReportVO.java
  30. 31
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/vo/RunReportVO.java
  31. 50
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/vo/StationRunReportAllVO.java
  32. 32
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/vo/StationRunReportVO.java
  33. 15
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/util/TimeUtils.java
  34. BIN
      hzims-service/operational/src/main/resources/template/word/stationMonthReport.docx
  35. 4
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/ConferenceController.java
  36. 4
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/RehearsalController.java
  37. 14
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/TrainController.java
  38. 4
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/SpecialDeviceInspectionMapper.xml
  39. 10
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TestMapper.java
  40. 23
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TestMapper.xml
  41. 10
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainRecordMapper.java
  42. 20
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainRecordMapper.xml
  43. 11
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ITestService.java
  44. 11
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ITrainRecordService.java
  45. 13
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TestServiceImpl.java
  46. 12
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TrainRecordServiceImpl.java
  47. BIN
      hzims-service/safeproduct/src/main/resources/template/会议记录表.docx
  48. BIN
      hzims-service/safeproduct/src/main/resources/template/卫生自查表.docx
  49. BIN
      hzims-service/safeproduct/src/main/resources/template/培训记录表.docx
  50. BIN
      hzims-service/safeproduct/src/main/resources/template/演练记录表.docx
  51. BIN
      hzims-service/safeproduct/src/main/resources/template/车辆检查表.docx
  52. BIN
      hzims-service/safeproduct/src/main/resources/template/车辆维保记录单.docx
  53. 47
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/allTicket/fegin/TicketInfoAllClient.java
  54. 2
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/IStandardTicketInfoService.java
  55. 112
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/StandardTicketInfoServiceImpl.java
  56. 2
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/IFirstWorkTicketService.java
  57. 75
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/FirstWorkTicketServiceImpl.java
  58. 4
      hzims-service/ticket/src/test/java/com/hnac/hzims/ticket/TicketApplicationTest.java

5
hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/report/feign/IInspectReportClient.java

@ -2,6 +2,8 @@ package com.hnac.hzinfo.inspect.report.feign;
import com.hnac.hzinfo.inspect.Constants; import com.hnac.hzinfo.inspect.Constants;
import com.hnac.hzinfo.inspect.report.vo.AlarmRoutReportVO; import com.hnac.hzinfo.inspect.report.vo.AlarmRoutReportVO;
import com.hnac.hzinfo.inspect.task.vo.DutyInspectTaskVO;
import com.hnac.hzinfo.inspect.task.vo.TaskReportVO;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
@ -16,7 +18,10 @@ import java.util.Map;
public interface IInspectReportClient { public interface IInspectReportClient {
String API_PREFIX = "/feign/report"; String API_PREFIX = "/feign/report";
String GET_ALARAM_REPORT = API_PREFIX + "/getAlarmReport"; String GET_ALARAM_REPORT = API_PREFIX + "/getAlarmReport";
String GET_INSPECT_STATISTCS_BY_NAME = API_PREFIX + "/getInspectStatisticsByName";
@PostMapping(GET_ALARAM_REPORT) @PostMapping(GET_ALARAM_REPORT)
Map<Long, AlarmRoutReportVO> getAlarmReport(@RequestParam("depts") List<Long> depts, @RequestParam("date") String date); Map<Long, AlarmRoutReportVO> getAlarmReport(@RequestParam("depts") List<Long> depts, @RequestParam("date") String date);
@PostMapping(GET_INSPECT_STATISTCS_BY_NAME)
List<TaskReportVO> getInspectStatisticsByName(@RequestParam("depts") List<Long> depts, @RequestParam("date") String startTime, @RequestParam("date") String endTime);
} }

7
hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/report/feign/InspectReportClientFallback.java

@ -1,9 +1,11 @@
package com.hnac.hzinfo.inspect.report.feign; package com.hnac.hzinfo.inspect.report.feign;
import com.hnac.hzinfo.inspect.report.vo.AlarmRoutReportVO; import com.hnac.hzinfo.inspect.report.vo.AlarmRoutReportVO;
import com.hnac.hzinfo.inspect.task.vo.TaskReportVO;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -16,4 +18,9 @@ public class InspectReportClientFallback implements IInspectReportClient{
public Map<Long, AlarmRoutReportVO> getAlarmReport(List<Long> depts, String date) { public Map<Long, AlarmRoutReportVO> getAlarmReport(List<Long> depts, String date) {
return new HashMap<>(); return new HashMap<>();
} }
@Override
public List<TaskReportVO> getInspectStatisticsByName(List<Long> depts, String startTime, String endTime) {
return new ArrayList<>();
}
} }

3
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/HygienePlanEntity.java

@ -1,6 +1,7 @@
package com.hnac.hzims.safeproduct.entity; package com.hnac.hzims.safeproduct.entity;
import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
@ -51,10 +52,12 @@ public class HygienePlanEntity extends BaseEntity {
@ApiModelProperty("自查计划状态") @ApiModelProperty("自查计划状态")
private String hygienePlanStatus; private String hygienePlanStatus;
@TableField(exist = false)
@ExcelProperty(value = "计划开始时间", index = 3) @ExcelProperty(value = "计划开始时间", index = 3)
@ApiModelProperty("计划开始时间") @ApiModelProperty("计划开始时间")
private String startTime; private String startTime;
@TableField(exist = false)
@ExcelProperty(value = "计划结束时间", index = 4) @ExcelProperty(value = "计划结束时间", index = 4)
@ApiModelProperty("计划结束时间") @ApiModelProperty("计划结束时间")
private String endTime; private String endTime;

3
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/TestEntity.java

@ -74,4 +74,7 @@ public class TestEntity extends BaseEntity {
@Size(max = 1000, message = "考试附件字段长度不能超过1000") @Size(max = 1000, message = "考试附件字段长度不能超过1000")
@ApiModelProperty("考试附件") @ApiModelProperty("考试附件")
private String filePath; private String filePath;
@ApiModelProperty("考试方式")
private String testMethod;
} }

31
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/enums/TestMethodEnum.java

@ -0,0 +1,31 @@
package com.hnac.hzims.safeproduct.enums;
/**
* 考试方式枚举类
*
* @author liwen
* @date 2024-01-25
*/
public enum TestMethodEnum {
ONLINE("ONLINE", "线上"),
OFFLINE("OFFLINE", "线下"),
MIXED("MIXED", "线上+线下");
private final String value;
private final String desc;
TestMethodEnum(String value, String desc) {
this.value = value;
this.desc = desc;
}
public String getValue() {
return value;
}
public String getDesc() {
return desc;
}
}

17
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/CarMilesYearVO.java

@ -1,5 +1,6 @@
package com.hnac.hzims.safeproduct.vo; package com.hnac.hzims.safeproduct.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
@ -14,51 +15,67 @@ import java.math.BigDecimal;
@ApiModel(value = "年度里程数据VO类") @ApiModel(value = "年度里程数据VO类")
public class CarMilesYearVO { public class CarMilesYearVO {
@ExcelProperty(value = "单位", order = 0)
@ApiModelProperty("单位") @ApiModelProperty("单位")
private String unit; private String unit;
@ExcelProperty(value = "品牌", order = 2)
@ApiModelProperty("品牌") @ApiModelProperty("品牌")
private String carBrand; private String carBrand;
@ExcelProperty(value = "车牌号", order = 1)
@ApiModelProperty("车牌号") @ApiModelProperty("车牌号")
private String plateNumber; private String plateNumber;
@ExcelProperty(value = "1月", order = 3)
@ApiModelProperty("1月里程数") @ApiModelProperty("1月里程数")
private BigDecimal januaryMiles; private BigDecimal januaryMiles;
@ExcelProperty(value = "2月", order = 4)
@ApiModelProperty("2月里程数") @ApiModelProperty("2月里程数")
private BigDecimal februaryMiles; private BigDecimal februaryMiles;
@ExcelProperty(value = "3月", order = 5)
@ApiModelProperty("3月里程数") @ApiModelProperty("3月里程数")
private BigDecimal marchMiles; private BigDecimal marchMiles;
@ExcelProperty(value = "4月", order = 6)
@ApiModelProperty("4月里程数") @ApiModelProperty("4月里程数")
private BigDecimal aprilMiles; private BigDecimal aprilMiles;
@ExcelProperty(value = "5月", order = 7)
@ApiModelProperty("5月里程数") @ApiModelProperty("5月里程数")
private BigDecimal mayMiles; private BigDecimal mayMiles;
@ExcelProperty(value = "6月", order = 8)
@ApiModelProperty("6月里程数") @ApiModelProperty("6月里程数")
private BigDecimal juneMiles; private BigDecimal juneMiles;
@ExcelProperty(value = "7月", order = 9)
@ApiModelProperty("7月里程数") @ApiModelProperty("7月里程数")
private BigDecimal julyMiles; private BigDecimal julyMiles;
@ExcelProperty(value = "8月", order = 10)
@ApiModelProperty("8月里程数") @ApiModelProperty("8月里程数")
private BigDecimal augustMiles; private BigDecimal augustMiles;
@ExcelProperty(value = "9月", order = 11)
@ApiModelProperty("9月里程数") @ApiModelProperty("9月里程数")
private BigDecimal septemberMiles; private BigDecimal septemberMiles;
@ExcelProperty(value = "10月", order = 12)
@ApiModelProperty("10月里程数") @ApiModelProperty("10月里程数")
private BigDecimal octoberMiles; private BigDecimal octoberMiles;
@ExcelProperty(value = "11月", order = 13)
@ApiModelProperty("11月里程数") @ApiModelProperty("11月里程数")
private BigDecimal novemberMiles; private BigDecimal novemberMiles;
@ExcelProperty(value = "12月", order = 14)
@ApiModelProperty("12月里程数") @ApiModelProperty("12月里程数")
private BigDecimal decemberMiles; private BigDecimal decemberMiles;
@ExcelProperty(value = "合计里程/km", order = 15)
@ApiModelProperty("合计里程数") @ApiModelProperty("合计里程数")
private BigDecimal sumMiles; private BigDecimal sumMiles;
} }

26
hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/allTicket/vo/TicketInfoStatisticVO.java

@ -20,7 +20,8 @@ public class TicketInfoStatisticVO implements Serializable {
private static final long serialVersionUID = -8870464581684939369L; private static final long serialVersionUID = -8870464581684939369L;
@ApiModelProperty("日期") @ApiModelProperty("日期")
private String dateTime; private String dateTime;
@ApiModelProperty("序号")
private Integer index;
@ApiModelProperty("本月票据合格率") @ApiModelProperty("本月票据合格率")
@JsonSerialize(nullsUsing = NullSerializer.class) @JsonSerialize(nullsUsing = NullSerializer.class)
private Double ticketInfoProportion; private Double ticketInfoProportion;
@ -29,23 +30,26 @@ public class TicketInfoStatisticVO implements Serializable {
private String ticketInfoType; private String ticketInfoType;
@ApiModelProperty("开票数量") @ApiModelProperty("开票数量")
@JsonSerialize(nullsUsing = NullSerializer.class) // @JsonSerialize(nullsUsing = NullSerializer.class)
private Integer ticketInfoNumber; private Integer ticketInfoNumber=0;
@ApiModelProperty("本月完成开票数") @ApiModelProperty("本月完成开票数")
@JsonSerialize(nullsUsing = NullSerializer.class) // @JsonSerialize(nullsUsing = NullSerializer.class)
private Integer ticketInfoCompleteNum; private Integer ticketInfoCompleteNum=0;
@ApiModelProperty("本月未完成开票数") @ApiModelProperty("本月未完成开票数")
@JsonSerialize(nullsUsing = NullSerializer.class) // @JsonSerialize(nullsUsing = NullSerializer.class)
private Integer ticketInfoStartNum; private Integer ticketInfoStartNum=0;
@ApiModelProperty("本月延期开票数") @ApiModelProperty("本月延期开票数")
@JsonSerialize(nullsUsing = NullSerializer.class) // @JsonSerialize(nullsUsing = NullSerializer.class)
private Integer ticketInfoDelayNum; private Integer ticketInfoDelayNum=0;
@ApiModelProperty("工作票合格数量") @ApiModelProperty("工作票合格数量")
@JsonSerialize(nullsUsing = NullSerializer.class) // @JsonSerialize(nullsUsing = NullSerializer.class)
private Integer ticketInfoQualifiedNum; private Integer ticketInfoQualifiedNum=0;
@ApiModelProperty("废票数")
// @JsonSerialize(nullsUsing = NullSerializer.class)
private Integer ticketInfoInvalidatedNum=0;
} }

20
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/gather/feigns/InspectReportClient.java

@ -1,20 +0,0 @@
package com.hnac.hzinfo.inspect.gather.feigns;
import com.hnac.hzinfo.inspect.report.feign.IInspectReportClient;
import com.hnac.hzinfo.inspect.report.service.InspectReportService;
import com.hnac.hzinfo.inspect.report.vo.AlarmRoutReportVO;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
import java.util.Map;
public class InspectReportClient implements IInspectReportClient {
@Autowired
private InspectReportService inspectReportService;
@Override
public Map<Long, AlarmRoutReportVO> getAlarmReport(List<Long> depts, String date) {
return inspectReportService.getAlarnReport(date,depts);
}
}

12
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/report/feigns/InspectReportClient.java

@ -3,6 +3,8 @@ package com.hnac.hzinfo.inspect.report.feigns;
import com.hnac.hzinfo.inspect.report.feign.IInspectReportClient; import com.hnac.hzinfo.inspect.report.feign.IInspectReportClient;
import com.hnac.hzinfo.inspect.report.service.InspectReportService; import com.hnac.hzinfo.inspect.report.service.InspectReportService;
import com.hnac.hzinfo.inspect.report.vo.AlarmRoutReportVO; import com.hnac.hzinfo.inspect.report.vo.AlarmRoutReportVO;
import com.hnac.hzinfo.inspect.task.service.ITaskService;
import com.hnac.hzinfo.inspect.task.vo.TaskReportVO;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
@ -15,10 +17,18 @@ public class InspectReportClient implements IInspectReportClient {
@Autowired @Autowired
private InspectReportService inspectReportService; private InspectReportService inspectReportService;
@Autowired
private ITaskService taskService;
@PostMapping(GET_ALARAM_REPORT) @PostMapping(GET_ALARAM_REPORT)
@Override @Override
public Map<Long, AlarmRoutReportVO> getAlarmReport(List<Long> depts, String date) { public Map<Long, AlarmRoutReportVO> getAlarmReport(List<Long> depts, String date) {
return inspectReportService.getAlarnReport(date,depts); return inspectReportService.getAlarnReport(date,depts);
} }
@PostMapping(GET_INSPECT_STATISTCS_BY_NAME)
@Override
public List<TaskReportVO> getInspectStatisticsByName(List<Long> depts, String startTime, String endTime) {
List<TaskReportVO> inspectTaskReport = taskService.getInspectTaskReport(startTime, endTime, depts);
return inspectTaskReport;
}
} }

2
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/IOperAccessTaskService.java

@ -8,6 +8,7 @@ import com.hnac.hzims.operational.access.vo.AccessTaskExportVo;
import com.hnac.hzims.operational.access.vo.OperAccessTaskVO; import com.hnac.hzims.operational.access.vo.OperAccessTaskVO;
import com.hnac.hzims.operational.access.vo.RepairBillVO; import com.hnac.hzims.operational.access.vo.RepairBillVO;
import com.hnac.hzims.operational.report.vo.AccessReportVO; import com.hnac.hzims.operational.report.vo.AccessReportVO;
import com.hnac.hzims.operational.report.vo.AccessRunReportVO;
import com.hnac.hzims.vo.SafeCheckStatisticVO; import com.hnac.hzims.vo.SafeCheckStatisticVO;
import com.hnac.hzims.vo.VoteChartVo; import com.hnac.hzims.vo.VoteChartVo;
import org.springblade.core.mp.base.BaseService; import org.springblade.core.mp.base.BaseService;
@ -48,6 +49,7 @@ public interface IOperAccessTaskService extends BaseService<OperAccessTaskEntity
List<AccessReportVO> getAccessTaskByDisposer(LocalDate startDate, LocalDate endDate, List<Long> deptIdList); List<AccessReportVO> getAccessTaskByDisposer(LocalDate startDate, LocalDate endDate, List<Long> deptIdList);
List<AccessReportVO> getAccessTaskByDisposer(Map<String,Object> params); List<AccessReportVO> getAccessTaskByDisposer(Map<String,Object> params);
List<AccessRunReportVO> getAccessTaskByName(Map<String,Object> params);
List<Map<String,Object>> getAccessConclusion(Map<String,Object> params); List<Map<String,Object>> getAccessConclusion(Map<String,Object> params);

50
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/OperAccessTaskServiceImpl.java

@ -12,6 +12,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hnac.hzims.equipment.entity.EmInfoEntity; import com.hnac.hzims.equipment.entity.EmInfoEntity;
import com.hnac.hzims.equipment.feign.IEmInfoClient; import com.hnac.hzims.equipment.feign.IEmInfoClient;
import com.hnac.hzims.message.enums.PushStatEnum;
import com.hnac.hzims.message.fegin.IMessagePushClient; import com.hnac.hzims.message.fegin.IMessagePushClient;
import com.hnac.hzims.message.req.PushExtrasReq; import com.hnac.hzims.message.req.PushExtrasReq;
import com.hnac.hzims.operational.OperationalConstants; import com.hnac.hzims.operational.OperationalConstants;
@ -36,6 +37,7 @@ import com.hnac.hzims.operational.defect.mapper.OperPhenomenonMapper;
import com.hnac.hzims.operational.defect.service.IOperDefectService; import com.hnac.hzims.operational.defect.service.IOperDefectService;
import com.hnac.hzims.operational.defect.service.IOperDefectStatisticsService; import com.hnac.hzims.operational.defect.service.IOperDefectStatisticsService;
import com.hnac.hzims.operational.report.vo.AccessReportVO; import com.hnac.hzims.operational.report.vo.AccessReportVO;
import com.hnac.hzims.operational.report.vo.AccessRunReportVO;
import com.hnac.hzims.safeproduct.Constants; import com.hnac.hzims.safeproduct.Constants;
import com.hnac.hzims.safeproduct.feign.IDangerSourceClient; import com.hnac.hzims.safeproduct.feign.IDangerSourceClient;
import com.hnac.hzims.spare.entity.SpRecordEntity; import com.hnac.hzims.spare.entity.SpRecordEntity;
@ -59,6 +61,7 @@ import org.springblade.flow.core.feign.IFlowClient;
import org.springblade.flow.core.utils.FlowUtil; import org.springblade.flow.core.utils.FlowUtil;
import org.springblade.flow.core.utils.TaskUtil; import org.springblade.flow.core.utils.TaskUtil;
import org.springblade.flow.core.vo.ComleteTask; import org.springblade.flow.core.vo.ComleteTask;
import org.springblade.system.cache.DictCache;
import org.springblade.system.entity.Dept; import org.springblade.system.entity.Dept;
import org.springblade.system.feign.ISysClient; import org.springblade.system.feign.ISysClient;
import org.springblade.system.user.cache.UserCache; import org.springblade.system.user.cache.UserCache;
@ -302,6 +305,53 @@ public class OperAccessTaskServiceImpl extends BaseServiceImpl<OperAccessTaskMap
} }
@Override @Override
public List<AccessRunReportVO> getAccessTaskByName(Map<String, Object> params) {
LocalDate startDate = LocalDate.parse(params.get("startDate").toString(), DateTimeFormatter.ofPattern(DateUtil.PATTERN_DATE));
LocalDate endDate = LocalDate.parse(params.get("endDate").toString(), DateTimeFormatter.ofPattern(DateUtil.PATTERN_DATE));
List<Long> deptIdList = (List<Long>) params.get("deptId");
List<OperAccessTaskEntity> operAccessTaskEntityList = this.list(new LambdaQueryWrapper<OperAccessTaskEntity>() {{
ge(OperAccessTaskEntity::getPlanStartTime, startDate);
le(OperAccessTaskEntity::getPlanStartTime, endDate);
in(OperAccessTaskEntity::getCreateDept, deptIdList);
}});
List<AccessRunReportVO> res =new ArrayList<>();
if(CollectionUtil.isNotEmpty(operAccessTaskEntityList)) {
for (int i = 0; i < operAccessTaskEntityList.size(); i++) {
OperAccessTaskEntity operAccessTaskEntity= operAccessTaskEntityList.get(i);
AccessRunReportVO accessReportVO = new AccessRunReportVO();
accessReportVO.setIndex(i+1);
accessReportVO.setUserName(operAccessTaskEntity.getHandlerName());
accessReportVO.setMaintenanceItem(operAccessTaskEntity.getName());
switch (operAccessTaskEntity.getStatus()) {
case AccessConstants.ACCESS_TASK_STATUS_0:
accessReportVO.setCompleteSituation("未开始");
break;
case AccessConstants.ACCESS_TASK_STATUS_1:
accessReportVO.setCompleteSituation("进行中");
break;
case AccessConstants.ACCESS_TASK_STATUS_2:
accessReportVO.setCompleteSituation("待审核");
break;
case AccessConstants.ACCESS_TASK_STATUS_3:
accessReportVO.setCompleteSituation("审核未通过");
break;
case AccessConstants.ACCESS_TASK_STATUS_4:
accessReportVO.setCompleteSituation("已完成");
break;
case AccessConstants.ACCESS_TASK_STATUS_5:
accessReportVO.setCompleteSituation("未完成");
break;
default:
accessReportVO.setCompleteSituation("未开始");
break;
}
res.add(accessReportVO);
}
}
return res;
}
@Override
public List<Map<String, Object>> getAccessConclusion(Map<String, Object> params) { public List<Map<String, Object>> getAccessConclusion(Map<String, Object> params) {
return mapper.getAccessConclusion(params); return mapper.getAccessConclusion(params);
} }

3
hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/IOperDefectService.java

@ -7,6 +7,7 @@ import com.hnac.hzims.operational.defect.entity.OperDefectEntity;
import com.hnac.hzims.operational.defect.entity.OperPhenomenonEntity; import com.hnac.hzims.operational.defect.entity.OperPhenomenonEntity;
import com.hnac.hzims.operational.defect.vo.OperDefectVO; import com.hnac.hzims.operational.defect.vo.OperDefectVO;
import com.hnac.hzims.operational.report.vo.DefectReportsVO; import com.hnac.hzims.operational.report.vo.DefectReportsVO;
import com.hnac.hzims.operational.report.vo.DefectRunReportsVO;
import com.hnac.hzims.vo.SafeCheckStatisticVO; import com.hnac.hzims.vo.SafeCheckStatisticVO;
import org.springblade.core.mp.base.BaseService; import org.springblade.core.mp.base.BaseService;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
@ -69,6 +70,8 @@ public interface IOperDefectService extends BaseService<OperDefectEntity> {
List<DefectReportsVO> getFaultByFaultCode(Map<String,Object> params); List<DefectReportsVO> getFaultByFaultCode(Map<String,Object> params);
List<DefectRunReportsVO> getDefectByName(Map<String,Object> params);
List<Map<String,Object>> getDefectConclusion(Map<String,Object> params); List<Map<String,Object>> getDefectConclusion(Map<String,Object> params);
/** /**

37
hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/OperDefectServiceImpl.java

@ -21,8 +21,11 @@ import com.hnac.hzims.operational.defect.mapper.OperPhenomenonMapper;
import com.hnac.hzims.operational.defect.service.IOperDefectService; import com.hnac.hzims.operational.defect.service.IOperDefectService;
import com.hnac.hzims.operational.defect.vo.OperDefectVO; import com.hnac.hzims.operational.defect.vo.OperDefectVO;
import com.hnac.hzims.operational.defect.wrapper.OperDefectWrapper; import com.hnac.hzims.operational.defect.wrapper.OperDefectWrapper;
import com.hnac.hzims.operational.duty.entity.ImsDutyEmergencyEntity;
import com.hnac.hzims.operational.report.vo.DefectReportsVO; import com.hnac.hzims.operational.report.vo.DefectReportsVO;
import com.hnac.hzims.operational.report.vo.DefectRunReportsVO;
import com.hnac.hzims.safeproduct.Constants; import com.hnac.hzims.safeproduct.Constants;
import com.hnac.hzims.spare.entity.WtSpManagementEntity;
import com.hnac.hzims.vo.SafeCheckStatisticVO; import com.hnac.hzims.vo.SafeCheckStatisticVO;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import net.logstash.logback.encoder.org.apache.commons.lang3.ObjectUtils; import net.logstash.logback.encoder.org.apache.commons.lang3.ObjectUtils;
@ -354,6 +357,40 @@ public class OperDefectServiceImpl extends BaseServiceImpl<OperDefectMapper, Ope
} }
@Override @Override
public List<DefectRunReportsVO> getDefectByName(Map<String, Object> params) {
LocalDate startDate = LocalDate.parse(params.get("startDate").toString(), DateTimeFormatter.ofPattern(DateUtil.PATTERN_DATE));
LocalDate endDate = LocalDate.parse(params.get("endDate").toString(), DateTimeFormatter.ofPattern(DateUtil.PATTERN_DATE));
List<Long> deptIdList = (List<Long>) params.get("deptId");
List<DefectRunReportsVO> res=new ArrayList<>();
List<OperPhenomenonEntity> operPhenomenonEntities = operPhenomenonMapper.selectList(
Wrappers.<OperPhenomenonEntity>query().lambda()
.ge(OperPhenomenonEntity::getCreateTime, startDate)
.le(OperPhenomenonEntity::getCreateTime, endDate)
.in(OperPhenomenonEntity::getCreateDept, deptIdList)
.eq(OperPhenomenonEntity::getIsDeleted, 0)
.eq(OperPhenomenonEntity::getIsDefect, 1));
if (CollectionUtil.isNotEmpty(operPhenomenonEntities)){
for (int i = 0; i < operPhenomenonEntities.size(); i++) {
DefectRunReportsVO reportsVO=new DefectRunReportsVO();
OperPhenomenonEntity operPhenomenonEntity = operPhenomenonEntities.get(i);
reportsVO.setIndex(i+1);
reportsVO.setFinder(operPhenomenonEntity.getFinderName());
reportsVO.setFinderTime(DateUtil.formatDateTime(operPhenomenonEntity.getFindTime()));
reportsVO.setDescription(operPhenomenonEntity.getDescripiton());
if ("1".equals(operPhenomenonEntity.getHandleStatus())) {
reportsVO.setHandleTime(DateUtil.formatDateTime(operPhenomenonEntity.getActStartTime()));
reportsVO.setHandleSituation(operPhenomenonEntity.getDisposeDesc());
}else {
reportsVO.setHandleSituation("未处理");
}
res.add(reportsVO);
}
}
return res;
}
@Override
public List<Map<String, Object>> getDefectConclusion(Map<String, Object> params) { public List<Map<String, Object>> getDefectConclusion(Map<String, Object> params) {
return operDefectMapper.getDefectConclusion(params); return operDefectMapper.getDefectConclusion(params);
} }

5
hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/IImsDutyMainService.java

@ -6,6 +6,7 @@ import com.hnac.hzims.operational.duty.entity.ImsDutyRecEntity;
import com.hnac.hzims.operational.duty.vo.*; import com.hnac.hzims.operational.duty.vo.*;
import com.hnac.hzims.operational.main.vo.DutyPersonalReportVO; import com.hnac.hzims.operational.main.vo.DutyPersonalReportVO;
import com.hnac.hzims.operational.report.vo.DutyReportVO; import com.hnac.hzims.operational.report.vo.DutyReportVO;
import com.hnac.hzims.operational.report.vo.DutyRunReportVO;
import org.springblade.core.mp.base.BaseService; import org.springblade.core.mp.base.BaseService;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
@ -80,8 +81,8 @@ public interface IImsDutyMainService extends BaseService<ImsDutyMainEntity> {
*/ */
List<DutyReportVO> getDutyMainStatisticsByClassId(LocalDate startDate, LocalDate endDate, List<Long> deptIdList); List<DutyReportVO> getDutyMainStatisticsByClassId(LocalDate startDate, LocalDate endDate, List<Long> deptIdList);
List<DutyReportVO> getDutyMainStatisticsByClassId(Map<String, Object> params); // List<DutyReportVO> getDutyMainStatisticsByClassId(Map<String, Object> params);
List<DutyRunReportVO> getDutyMainRunReport(Map<String, Object> params);
List<Map<String, Object>> getDutyConclusion(Map<String, Object> params); List<Map<String, Object>> getDutyConclusion(Map<String, Object> params);
DutyPersonalReportVO getPersonalDutyMain(Map<String, Object> params); DutyPersonalReportVO getPersonalDutyMain(Map<String, Object> params);

147
hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyMainServiceImpl.java

@ -19,6 +19,7 @@ import com.hnac.hzims.operational.duty.service.*;
import com.hnac.hzims.operational.duty.vo.*; import com.hnac.hzims.operational.duty.vo.*;
import com.hnac.hzims.operational.main.vo.DutyPersonalReportVO; import com.hnac.hzims.operational.main.vo.DutyPersonalReportVO;
import com.hnac.hzims.operational.report.vo.DutyReportVO; import com.hnac.hzims.operational.report.vo.DutyReportVO;
import com.hnac.hzims.operational.report.vo.DutyRunReportVO;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springblade.core.log.exception.ServiceException; import org.springblade.core.log.exception.ServiceException;
@ -44,6 +45,7 @@ import java.time.LocalDateTime;
import java.time.ZoneId; import java.time.ZoneId;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.*; import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.Function; import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -1022,13 +1024,144 @@ public class ImsDutyMainServiceImpl extends BaseServiceImpl<ImsDutyMainMapper, I
return dutyReportVOList; return dutyReportVOList;
} }
@Override
public List<DutyReportVO> getDutyMainStatisticsByClassId(Map<String, Object> params) { private void getDutyRunReportByPerson(LocalDate startDate, LocalDate endDate, List<Long> deptIdList, List<ImsDutyMainEntity> imsDutyMainEntityList, List<DutyRunReportVO> dutyReportVOList,AtomicInteger index) {
LocalDate startDate = LocalDate.parse(params.get("startDate").toString(), DateTimeFormatter.ofPattern(DateUtil.PATTERN_DATE)); //无班组的值班数据:
LocalDate endDate = LocalDate.parse(params.get("endDate").toString(), DateTimeFormatter.ofPattern(DateUtil.PATTERN_DATE)); List<ImsDutyMainEntity> personDutyMainEntity = imsDutyMainEntityList.stream().filter(o -> ObjectUtil.isEmpty(o.getDutyGroupId())).collect(Collectors.toList());
List<Long> deptId = (List<Long>) params.get("deptId"); //获取班组名
return getDutyMainStatisticsByClassId(startDate, endDate, deptId); if (ObjectUtil.isNotEmpty(personDutyMainEntity)) {
} DutyRunReportVO dutyReportVO = new DutyRunReportVO();
dutyReportVO.setGroupName("灵活排班");
dutyReportVO.setIndex(index.get());
dutyReportVO.setDutyNum(personDutyMainEntity.size());
//获取值班ID
List<Long> dutyIdList = personDutyMainEntity.stream().map(ImsDutyMainEntity::getId).collect(Collectors.toList());
dutyReportVO.setDutyList(dutyIdList.stream().map(s->String.valueOf(s)).collect(Collectors.toList()));
//发现问题数量
List<OperPhenomenonEntity> operPhenomenonEntityList = operPhenomenonMapper.selectList(new LambdaQueryWrapper<OperPhenomenonEntity>() {{
ge(OperPhenomenonEntity::getCreateTime, startDate);
le(OperPhenomenonEntity::getCreateTime, endDate);
in(OperPhenomenonEntity::getCreateDept, deptIdList);
eq(OperPhenomenonEntity::getSourceCode, DefectConstant.DefectSourceEnum.ZB.getStatus());
eq(OperPhenomenonEntity::getIsDeleted, 0);
}});
dutyReportVO.setFindProblemNum(operPhenomenonEntityList.size());
//获取交接班异常记录
List<ImsDutyRecEntity> imsDutyRecEntityList = imsDutyRecMapper.selectList(new LambdaQueryWrapper<ImsDutyRecEntity>() {{
in(ImsDutyRecEntity::getDutyId, dutyIdList);
}});
//延迟交接班
List<ImsDutyRecEntity> delayList = imsDutyRecEntityList.stream().filter(rec -> rec.getDelayStatus() == 1).collect(Collectors.toList());
//异常交接班
List<ImsDutyRecEntity> exceptionList = imsDutyRecEntityList.stream().filter(rec -> DutyRecStatus.ANOMALY.getVal().equals(rec.getStatus())).collect(Collectors.toList());
if (CollectionUtil.isNotEmpty(delayList)) {
dutyReportVO.setDelayChangeShifts(delayList.size());
List<String> delayIdsList = delayList.stream().map(ImsDutyRecEntity::getDutyId).map(s -> String.valueOf(s)).collect(Collectors.toList());
dutyReportVO.setDelayChangeList(delayIdsList);
}
if (CollectionUtil.isNotEmpty(exceptionList)) {
dutyReportVO.setExceptionChangeShifts(exceptionList.size());
List<String> exceptionIdsList = exceptionList.stream().map(ImsDutyRecEntity::getDutyId).map(s -> String.valueOf(s)).collect(Collectors.toList());
dutyReportVO.setExceptionChangeList(exceptionIdsList);
}
dutyReportVOList.add(dutyReportVO);
}
}
private void getDutyRunReportByGroup(LocalDate startDate, LocalDate endDate, List<Long> deptIdList, List<ImsDutyMainEntity> imsDutyMainEntityList, List<DutyRunReportVO> dutyReportVOList,AtomicInteger index) {
//按班组组合值班记录
Map<Long, List<ImsDutyMainEntity>> listByGroup = imsDutyMainEntityList.stream().filter(o -> ObjectUtil.isNotEmpty(o.getDutyGroupId())).collect(Collectors.groupingBy(ImsDutyMainEntity::getDutyGroupId));
listByGroup.forEach((k, v) -> {
//获取班组名
ImsDutyGroupEntity imsDutyGroupEntity = dutyGroupMapper.selectById(k);
if (ObjectUtil.isNotEmpty(imsDutyGroupEntity)) {
DutyRunReportVO dutyReportVO = new DutyRunReportVO();
dutyReportVO.setIndex(index.get());
index.getAndIncrement();
dutyReportVO.setGroupName(imsDutyGroupEntity.getGroupName());
User user = UserCache.getUser(imsDutyGroupEntity.getManagerId());
if (ObjectUtil.isNotEmpty(user)){
dutyReportVO.setManagerName(user.getName());
}
dutyReportVO.setDutyNum(v.size());
//获取值班ID
List<Long> dutyIdList = v.stream().map(ImsDutyMainEntity::getId).collect(Collectors.toList());
dutyReportVO.setDutyList(dutyIdList.stream().map(s->String.valueOf(s)).collect(Collectors.toList()));
//发现问题数量
List<ImsDutyGroupPEntity> imsDutyGroupPEntities = imsDutyGroupPMapper.selectByGroupId(k);
List<Long> person = imsDutyGroupPEntities.stream().map(s -> s.getPersonId()).collect(Collectors.toList());
List<OperPhenomenonEntity> operPhenomenonEntityList = operPhenomenonMapper.selectList(new LambdaQueryWrapper<OperPhenomenonEntity>() {{
ge(OperPhenomenonEntity::getCreateTime, startDate);
le(OperPhenomenonEntity::getCreateTime, endDate);
in(OperPhenomenonEntity::getCreateDept, deptIdList);
in(OperPhenomenonEntity::getFinder,person);
eq(OperPhenomenonEntity::getSourceCode, DefectConstant.DefectSourceEnum.ZB.getStatus());
eq(OperPhenomenonEntity::getIsDeleted, 0);
}});
dutyReportVO.setFindProblemNum(operPhenomenonEntityList.size());
//获取交接班异常记录
List<ImsDutyRecEntity> imsDutyRecEntityList = imsDutyRecMapper.selectList(new LambdaQueryWrapper<ImsDutyRecEntity>() {{
in(ImsDutyRecEntity::getDutyId, dutyIdList);
}});
//延迟交接班
List<ImsDutyRecEntity> delayList = imsDutyRecEntityList.stream().filter(rec -> rec.getDelayStatus() == 1).collect(Collectors.toList());
//异常交接班
List<ImsDutyRecEntity> exceptionList = imsDutyRecEntityList.stream().filter(rec -> DutyRecStatus.ANOMALY.getVal().equals(rec.getStatus())).collect(Collectors.toList());
if (CollectionUtil.isNotEmpty(delayList)) {
dutyReportVO.setDelayChangeShifts(delayList.size());
List<String> delayIdsList = delayList.stream().map(ImsDutyRecEntity::getDutyId).map(s -> String.valueOf(s)).collect(Collectors.toList());
dutyReportVO.setDelayChangeList(delayIdsList);
}
if (CollectionUtil.isNotEmpty(exceptionList)) {
dutyReportVO.setExceptionChangeShifts(exceptionList.size());
List<String> exceptionIdsList = exceptionList.stream().map(ImsDutyRecEntity::getDutyId).map(s -> String.valueOf(s)).collect(Collectors.toList());
dutyReportVO.setExceptionChangeList(exceptionIdsList);
}
dutyReportVOList.add(dutyReportVO);
}
});
}
@Override
public List<DutyRunReportVO> getDutyMainRunReport(Map<String, Object> params) {
LocalDate startDate = LocalDate.parse(params.get("startDate").toString(), DateTimeFormatter.ofPattern(DateUtil.PATTERN_DATE));
LocalDate endDate = LocalDate.parse(params.get("endDate").toString(), DateTimeFormatter.ofPattern(DateUtil.PATTERN_DATE));
List<Long> deptIdList = (List<Long>) params.get("deptId");
List<DutyRunReportVO> dutyReportVOList = new ArrayList<>();
//获取当月值班记录
List<ImsDutyMainEntity> imsDutyMainEntityList = this.baseMapper.selectList(new LambdaQueryWrapper<ImsDutyMainEntity>() {{
ge(ImsDutyMainEntity::getDutyDate, startDate);
le(ImsDutyMainEntity::getDutyDate, endDate);
in(ImsDutyMainEntity::getCreateDept, deptIdList);
ne(ImsDutyMainEntity::getStatus, -1);
eq(ImsDutyMainEntity::getIsDeleted, 0);
}});
AtomicInteger index= new AtomicInteger(1);
if(CollectionUtil.isNotEmpty(imsDutyMainEntityList)) {
//带班组的值班数据
this.getDutyRunReportByGroup(startDate, endDate, deptIdList, imsDutyMainEntityList, dutyReportVOList,index);
//灵活排班的值班数据
this.getDutyRunReportByPerson(startDate, endDate, deptIdList, imsDutyMainEntityList, dutyReportVOList,index);
}
DutyRunReportVO dutyReportVO = new DutyRunReportVO();
dutyReportVO.setGroupName("合计");
if (CollectionUtil.isNotEmpty(dutyReportVOList)){
dutyReportVO.setDutyNum(dutyReportVOList.stream().mapToInt(DutyRunReportVO::getDutyNum).sum());
dutyReportVO.setFindProblemNum(dutyReportVOList.stream().mapToInt(DutyRunReportVO::getFindProblemNum).sum());
dutyReportVO.setDelayChangeShifts(dutyReportVOList.stream().mapToInt(DutyRunReportVO::getDelayChangeShifts).sum());
dutyReportVO.setExceptionChangeShifts(dutyReportVOList.stream().mapToInt(DutyRunReportVO::getExceptionChangeShifts).sum());
}else {
dutyReportVO.setDutyNum(0);
dutyReportVO.setFindProblemNum(0);
dutyReportVO.setDelayChangeShifts(0);
dutyReportVO.setExceptionChangeShifts(0);
}
return dutyReportVOList;
}
@Override @Override
public List<Map<String, Object>> getDutyConclusion(Map<String, Object> params) { public List<Map<String, Object>> getDutyConclusion(Map<String, Object> params) {

5
hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/IMainSystemMonitoringService.java

@ -3,6 +3,7 @@ package com.hnac.hzims.operational.main.service;
import com.hnac.hzims.equipment.vo.EminfoAndEmParamVo; import com.hnac.hzims.equipment.vo.EminfoAndEmParamVo;
import com.hnac.hzims.operational.main.vo.*; import com.hnac.hzims.operational.main.vo.*;
import com.hnac.hzims.operational.report.vo.StationReportVO; import com.hnac.hzims.operational.report.vo.StationReportVO;
import com.hnac.hzims.operational.report.vo.StationRunReportVO;
import com.hnac.hzims.operational.station.entity.StationEntity; import com.hnac.hzims.operational.station.entity.StationEntity;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springblade.system.entity.Dept; import org.springblade.system.entity.Dept;
@ -66,7 +67,8 @@ public interface IMainSystemMonitoringService {
List<StationReportVO> getElectricSituation(String month, String stationId); List<StationReportVO> getElectricSituation(String month, String stationId);
List<StationRunReportVO> getElectricSituationV2(String yearAndMonth, String code);
void getElectricSituationByRedis(String month, List<StationRunReportVO> reportVOS, List<StationEntity> stationEntityList);
InDustryVo getUserDataScopeHomePage(String businessType,String stationType,String deptIds,String refTerminal); InDustryVo getUserDataScopeHomePage(String businessType,String stationType,String deptIds,String refTerminal);
List<StationEntity> classifyUserDataScopeType(String deptIds, String stationType,List<String> types,boolean bool); List<StationEntity> classifyUserDataScopeType(String deptIds, String stationType,List<String> types,boolean bool);
@ -87,4 +89,5 @@ public interface IMainSystemMonitoringService {
List<EminfoAndEmParamVo> getEmInfoList(); List<EminfoAndEmParamVo> getEmInfoList();
} }

167
hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/MainSystemMonitoringServiceImpl.java

@ -24,8 +24,10 @@ import com.hnac.hzims.operational.main.service.IMainWorkBenchService;
import com.hnac.hzims.operational.main.service.IUnitRunningTimeService; import com.hnac.hzims.operational.main.service.IUnitRunningTimeService;
import com.hnac.hzims.operational.main.vo.*; import com.hnac.hzims.operational.main.vo.*;
import com.hnac.hzims.operational.report.vo.StationReportVO; import com.hnac.hzims.operational.report.vo.StationReportVO;
import com.hnac.hzims.operational.report.vo.StationRunReportVO;
import com.hnac.hzims.operational.station.entity.StationEntity; import com.hnac.hzims.operational.station.entity.StationEntity;
import com.hnac.hzims.operational.station.service.IStationService; import com.hnac.hzims.operational.station.service.IStationService;
import com.hnac.hzims.operational.util.TimeUtils;
import com.hnac.hzinfo.datasearch.analyse.IAnalyseDataSearchClient; import com.hnac.hzinfo.datasearch.analyse.IAnalyseDataSearchClient;
import com.hnac.hzinfo.datasearch.analyse.IAnalyseInstanceClient; import com.hnac.hzinfo.datasearch.analyse.IAnalyseInstanceClient;
import com.hnac.hzinfo.datasearch.analyse.po.AnalyseCodeByAnalyseDataPO; import com.hnac.hzinfo.datasearch.analyse.po.AnalyseCodeByAnalyseDataPO;
@ -50,6 +52,7 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.time.Duration; import java.time.Duration;
import java.time.LocalDate; import java.time.LocalDate;
@ -1340,7 +1343,167 @@ public class MainSystemMonitoringServiceImpl implements IMainSystemMonitoringSer
} }
} }
private final static String RECENT_YEAR_POWER_DATA = "hzims:operation:key:power:data";
/**
* 获取部门站点发电量情况
* @param month 2024-01 月份
*/
@Override
public void getElectricSituationByRedis(String month,List<StationRunReportVO> reportVOS, List<StationEntity> stationEntityList) {
String[] yearMon = month.split("-");
Integer year = Integer.valueOf(yearMon[0]);
Integer mon = Integer.valueOf(yearMon[1]);
List<String> listByYear = TimeUtils.getListByYearMon(year, mon);
String currentMon = TimeUtils.getMon(year, mon);
Integer count=0;
Map<Long, Map<String, Float>> powerMapThree = (Map<Long, Map<String, Float>>) redisTemplate.opsForValue().get(RECENT_YEAR_POWER_DATA);
for (Map.Entry<Long, Map<String, Float>> deviceMap : powerMapThree.entrySet()) {
for (StationEntity stationEntity : stationEntityList) {
if (stationEntity.getId().equals(deviceMap.getKey())) {
StationRunReportVO stationReportVO = new StationRunReportVO();
count++;
stationReportVO.setIndex(count);
stationReportVO.setStationName(stationEntity.getName());
//当前机构近三年的数据
Map<String, Float> value = deviceMap.getValue();
//当月发电量
BigDecimal powerMon = value.entrySet().stream().filter(s -> currentMon.equals(s.getKey())).map(s -> BigDecimal.valueOf(s.getValue()).setScale(1,BigDecimal.ROUND_UP)).reduce(BigDecimal.ZERO, BigDecimal::add);
stationReportVO.setFinishPowerMon(powerMon.toString());
//获取计划月发电量
R<Float> planPowerMonR = planGenertionClient.planGenerationMonthCount(stationEntity.getCode(), month);
double planPowerMon =0;
if (planPowerMonR.isSuccess()&&ObjectUtil.isNotEmpty(planPowerMonR.getData())) {
planPowerMon = planPowerMonR.getData().doubleValue();
}
stationReportVO.setPowerMonPlan(planPowerMon);
//当年发电量
BigDecimal powerYear = value.entrySet().stream().filter(s -> listByYear.contains(s.getKey())).map(s -> BigDecimal.valueOf(s.getValue()).setScale(1,BigDecimal.ROUND_UP)).reduce(BigDecimal.ZERO, BigDecimal::add);
stationReportVO.setFinishPowerYear(powerYear.toString());
//获取计划年发电量
Double planPowerYear = planGenertionClient.getPlanPowerYear(Arrays.asList(stationEntity.getId().toString()), yearMon[0]);
stationReportVO.setPowerYearPlan(planPowerYear);
if (ObjectUtil.isNotEmpty(stationReportVO.getPowerMonPlan())
&&ObjectUtil.isNotEmpty(stationReportVO.getFinishPowerMon())
&&new BigDecimal(stationReportVO.getPowerMonPlan()).compareTo(BigDecimal.ZERO)!=0){
BigDecimal monRate = new BigDecimal(stationReportVO.getFinishPowerMon()).multiply(new BigDecimal(100))
.divide(new BigDecimal(stationReportVO.getPowerMonPlan()), 2, BigDecimal.ROUND_UP);
stationReportVO.setPowerMonRate(monRate.doubleValue()+"%");
}else {
stationReportVO.setPowerMonRate(new Double(0)+"%");
}
if (ObjectUtil.isNotEmpty(stationReportVO.getFinishPowerYear())
&&ObjectUtil.isNotEmpty(stationReportVO.getPowerYearPlan())
&&new BigDecimal(stationReportVO.getPowerYearPlan()).compareTo(BigDecimal.ZERO)!=0){
BigDecimal yearRate = new BigDecimal(stationReportVO.getFinishPowerYear()).multiply(new BigDecimal(100))
.divide(new BigDecimal(stationReportVO.getPowerYearPlan()), 2, BigDecimal.ROUND_UP);
stationReportVO.setPowerYearRate(yearRate.doubleValue()+"%");
}else {
stationReportVO.setPowerYearRate(new Double(0)+"%");
}
reportVOS.add(stationReportVO);
}
}
}
}
@Override
public List<StationRunReportVO> getElectricSituationV2(String month, String stationId) {
String year = month.split("-")[0];
List<StationRunReportVO> stationReportVOList = new ArrayList<>();
DateTimeFormatter df = DateTimeFormatter.ofPattern(DateUtil.PATTERN_DATETIME);
StationRunReportVO stationReportVO = new StationRunReportVO();
//获取对应的发电量
StationEntity stationEntity = stationService.getStationByCode(stationId);
stationReportVO.setStationName(stationEntity.getName());
AtomicReference<Float> powerCount = new AtomicReference<>((float) 0L);
AtomicReference<Float> powerCountYear = new AtomicReference<>((float) 0L);
//获取站点所属部门下的设备列表
List<String> emCodes = emInfoClient.getEmCodeByDeptIdAndHomePage(stationEntity.getRefDept()).getData();
if (CollectionUtil.isNotEmpty(emCodes)) {
List<String> emCodeList = analyseInstanceClient.getListAnalyseCode(emCodes).getData();
if (CollectionUtil.isNotEmpty(emCodeList)) {
List<EmInfoEntity> data = emInfoClient.getEmInfoByEmCodes(emCodeList).getData();
for (EmInfoEntity emInfoEntity : data) {
int ct = 0;
int pt = 0;
R<EmParamEntity> EmParamEntityCT = emParamClient.getParamByEmId(emInfoEntity.getId(), "ct");
if (EmParamEntityCT.isSuccess() && ObjectUtil.isNotEmpty(EmParamEntityCT.getData())
&& StringUtil.isNotBlank(EmParamEntityCT.getData().getParamValue())) {
ct = Integer.valueOf(EmParamEntityCT.getData().getParamValue());
}
R<EmParamEntity> EmParamEntityPT = emParamClient.getParamByEmId(emInfoEntity.getId(), "pt");
if (EmParamEntityPT.isSuccess() && ObjectUtil.isNotEmpty(EmParamEntityPT.getData())
&& StringUtil.isNotBlank(EmParamEntityPT.getData().getParamValue())) {
pt = Integer.valueOf(EmParamEntityPT.getData().getParamValue());
}
//TODO
int rideCount = ct * pt;
MainVo vo = new MainVo();
MainVo yearVo = new MainVo();
R<EmParamEntity> paramByEmId = emParamClient.getParamByEmId(emInfoEntity.getId(), EquipmentConstants.MainEnum.INSTALLED_CAPACITY.getVal());
if (paramByEmId.isSuccess()) {
if (ObjectUtil.isNotEmpty(paramByEmId.getData())) {
vo.setInstalledCapacity(paramByEmId.getData().getParamValue());
}
}
//循环所有机组
//根据设备编号 标识 获取 发电量、有功功率数据
AnalyseCodeByAnalyseDataPO po = new AnalyseCodeByAnalyseDataPO();
po.setDeviceCode(emInfoEntity.getNumber());
List<AnalyzeDataConditionPO> signboardConditions = new ArrayList<>();
AnalyzeDataConditionPO analyzeDataConditionPO = new AnalyzeDataConditionPO();
analyzeDataConditionPO.setFull(1);//填充 null
analyzeDataConditionPO.setSignages(GENERATE_SIGNAGE);
analyzeDataConditionPO.setAccessRules(EquipmentConstants.AccessRulesEnum.DIFF_CYCLE.getType());//取数规则 0=(整点值/最早值)、1=最大值、2=最小值、3=平均值、4=(累计值/和值)、5=(变化值/差值) 6=最新值
analyzeDataConditionPO.setTimeInterval(1);//间隔
//月发电量
analyzeDataConditionPO.setBeginTime(LocalDateTime.parse(month + "-01 00:00:00", df));
DateTimeFormatter fmt = DateTimeFormatter.ISO_LOCAL_DATE;
LocalDate localDateMonth = LocalDate.parse(month + "-01");
String endDateTime = fmt.format(localDateMonth.with(TemporalAdjusters.lastDayOfMonth())) + " 23:59:59";
analyzeDataConditionPO.setEndTime(LocalDateTime.parse(endDateTime, df));
setValueGenerateCount(analyzeDataConditionPO, signboardConditions, po, rideCount, vo, EquipmentConstants.CycleTypeEnum.MONTH_CYCLE.getType(), true);
//年发电量
analyzeDataConditionPO.setBeginTime(LocalDateTime.parse(year + "-01-01 00:00:00", df));
setValueGenerateCount(analyzeDataConditionPO, signboardConditions, po, rideCount, vo, EquipmentConstants.CycleTypeEnum.YEAR_CYCLE.getType(), true);
powerCount.updateAndGet(v -> new Float(v + vo.getMonthGenerateCount()));
powerCountYear.updateAndGet(v -> new Float(v + yearVo.getYearGenerateCount()));
log.info("------------月发电量:[{}]--------", vo.getMonthGenerateCount());
}
}
}
Double finishPowerMon = new BigDecimal(powerCount.get()).doubleValue();
stationReportVO.setFinishPowerMon(finishPowerMon.toString());
Double finishPowerYear = new BigDecimal(powerCountYear.get()).doubleValue();
stationReportVO.setFinishPowerYear(finishPowerYear.toString());
//当年的计划发电量
Double planPowerYear = planGenertionClient.getPlanPowerYear(Arrays.asList(stationId), year);
stationReportVO.setPowerYearPlan(planPowerYear);
//当月的计划发电量
R<Float> planPowerMonR = planGenertionClient.planGenerationMonthCount(stationId, month);
Double planPowerMon = planPowerMonR.getData().doubleValue();
stationReportVO.setPowerMonPlan(planPowerMon);
if (ObjectUtil.isNotEmpty(stationReportVO.getPowerMonPlan())
&&ObjectUtil.isNotEmpty(stationReportVO.getFinishPowerMon())
&&new BigDecimal(stationReportVO.getPowerMonPlan()).compareTo(BigDecimal.ZERO)!=0){
BigDecimal monRate = new BigDecimal(stationReportVO.getFinishPowerMon()).multiply(new BigDecimal(100))
.divide(new BigDecimal(stationReportVO.getPowerMonPlan()), 2, BigDecimal.ROUND_UP);
stationReportVO.setPowerMonRate(monRate.doubleValue()+"%");
}else {
stationReportVO.setPowerMonRate(new Double(0)+"%");
}
if (ObjectUtil.isNotEmpty(stationReportVO.getFinishPowerYear())
&&ObjectUtil.isNotEmpty(stationReportVO.getPowerYearPlan())
&&new BigDecimal(stationReportVO.getPowerYearPlan()).compareTo(BigDecimal.ZERO)!=0){
BigDecimal yearRate = new BigDecimal(stationReportVO.getFinishPowerYear()).multiply(new BigDecimal(100))
.divide(new BigDecimal(stationReportVO.getPowerYearPlan()), 2, BigDecimal.ROUND_UP);
stationReportVO.setPowerYearRate(yearRate.doubleValue()+"%");
}else {
stationReportVO.setPowerYearRate(new Double(0)+"%");
}
stationReportVOList.add(stationReportVO);
return stationReportVOList;
}
/** /**
* 获取部门站点发电量情况 * 获取部门站点发电量情况
* *
@ -1380,12 +1543,12 @@ public class MainSystemMonitoringServiceImpl implements IMainSystemMonitoringSer
int pt = 0; int pt = 0;
R<EmParamEntity> EmParamEntityCT = emParamClient.getParamByEmId(emInfoEntity.getId(), "ct"); R<EmParamEntity> EmParamEntityCT = emParamClient.getParamByEmId(emInfoEntity.getId(), "ct");
if (EmParamEntityCT.isSuccess() && ObjectUtil.isNotEmpty(EmParamEntityCT.getData()) if (EmParamEntityCT.isSuccess() && ObjectUtil.isNotEmpty(EmParamEntityCT.getData())
&& StringUtil.isNotBlank(EmParamEntityCT.getData().getParamValue())) { && StringUtil.isNotBlank(EmParamEntityCT.getData().getParamValue())) {
ct = Integer.valueOf(EmParamEntityCT.getData().getParamValue()); ct = Integer.valueOf(EmParamEntityCT.getData().getParamValue());
} }
R<EmParamEntity> EmParamEntityPT = emParamClient.getParamByEmId(emInfoEntity.getId(), "pt"); R<EmParamEntity> EmParamEntityPT = emParamClient.getParamByEmId(emInfoEntity.getId(), "pt");
if (EmParamEntityPT.isSuccess() && ObjectUtil.isNotEmpty(EmParamEntityPT.getData()) if (EmParamEntityPT.isSuccess() && ObjectUtil.isNotEmpty(EmParamEntityPT.getData())
&& StringUtil.isNotBlank(EmParamEntityPT.getData().getParamValue())) { && StringUtil.isNotBlank(EmParamEntityPT.getData().getParamValue())) {
pt = Integer.valueOf(EmParamEntityPT.getData().getParamValue()); pt = Integer.valueOf(EmParamEntityPT.getData().getParamValue());
} }
//TODO //TODO

2
hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/IOperMaintenanceTaskService.java

@ -8,6 +8,7 @@ import com.hnac.hzims.operational.maintenance.entity.OperMaintenanceTaskEntity;
import com.hnac.hzims.operational.maintenance.vo.MaintenanceExportVO; import com.hnac.hzims.operational.maintenance.vo.MaintenanceExportVO;
import com.hnac.hzims.operational.maintenance.vo.OperMaintenanceTaskVO; import com.hnac.hzims.operational.maintenance.vo.OperMaintenanceTaskVO;
import com.hnac.hzims.operational.report.vo.MaintenanceReportVO; import com.hnac.hzims.operational.report.vo.MaintenanceReportVO;
import com.hnac.hzims.operational.report.vo.RunReportVO;
import com.hnac.hzims.ticket.areamonthly.vo.MaintenanceTaskVo; import com.hnac.hzims.ticket.areamonthly.vo.MaintenanceTaskVo;
import com.hnac.hzims.ticket.areamonthly.vo.MaintenanceTaskWithAreaVo; import com.hnac.hzims.ticket.areamonthly.vo.MaintenanceTaskWithAreaVo;
import com.hnac.hzims.vo.SafeCheckStatisticVO; import com.hnac.hzims.vo.SafeCheckStatisticVO;
@ -48,6 +49,7 @@ public interface IOperMaintenanceTaskService extends BaseService<OperMaintenance
List<MaintenanceReportVO> getMaintenanceStatisticsByDisposer(LocalDate startDate,LocalDate endDate,List<Long> deptIdList); List<MaintenanceReportVO> getMaintenanceStatisticsByDisposer(LocalDate startDate,LocalDate endDate,List<Long> deptIdList);
List<MaintenanceReportVO> getMaintenanceStatisticsByDisposer(Map<String,Object> params); List<MaintenanceReportVO> getMaintenanceStatisticsByDisposer(Map<String,Object> params);
List<RunReportVO> getMaintenanceStatisticsByName(Map<String,Object> params);
List<Map<String,Object>> getMaintenanceConclusion(Map<String,Object> params); List<Map<String,Object>> getMaintenanceConclusion(Map<String,Object> params);

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

@ -24,6 +24,7 @@ import com.hnac.hzims.operational.maintenance.vo.MaintenanceExportVO;
import com.hnac.hzims.operational.maintenance.vo.OperMaintenanceTaskVO; import com.hnac.hzims.operational.maintenance.vo.OperMaintenanceTaskVO;
import com.hnac.hzims.operational.maintenance.wrapper.OperMaintenanceTaskWrapper; import com.hnac.hzims.operational.maintenance.wrapper.OperMaintenanceTaskWrapper;
import com.hnac.hzims.operational.report.vo.MaintenanceReportVO; import com.hnac.hzims.operational.report.vo.MaintenanceReportVO;
import com.hnac.hzims.operational.report.vo.RunReportVO;
import com.hnac.hzims.safeproduct.Constants; import com.hnac.hzims.safeproduct.Constants;
import com.hnac.hzims.safeproduct.feign.IDangerSourceClient; import com.hnac.hzims.safeproduct.feign.IDangerSourceClient;
import com.hnac.hzims.ticket.areamonthly.vo.MaintenanceTaskVo; import com.hnac.hzims.ticket.areamonthly.vo.MaintenanceTaskVo;
@ -61,6 +62,7 @@ import java.text.DecimalFormat;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.*; import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference; import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -245,6 +247,75 @@ public class OperMaintenanceTaskServiceImpl extends BaseServiceImpl<OperMaintena
} }
@Override @Override
public List<RunReportVO> getMaintenanceStatisticsByName(Map<String, Object> params) {
LocalDate startDate = LocalDate.parse(params.get("startDate").toString(), DateTimeFormatter.ofPattern(DateUtil.PATTERN_DATE));
LocalDate endDate = LocalDate.parse(params.get("endDate").toString(), DateTimeFormatter.ofPattern(DateUtil.PATTERN_DATE));
List<Long> deptIdList = (List<Long>) params.get("deptId");
List<RunReportVO> maintenanceReportVOList = new ArrayList<>();
//查询当月日常维护任务
List<OperMaintenanceTaskEntity> operMaintenanceTaskEntityList = this.baseMapper.selectList(new LambdaQueryWrapper<OperMaintenanceTaskEntity>() {{
ge(OperMaintenanceTaskEntity::getDisposeTime, startDate);
le(OperMaintenanceTaskEntity::getDisposeTime, endDate);
in(OperMaintenanceTaskEntity::getCreateDept, deptIdList);
eq(OperMaintenanceTaskEntity::getIsDeleted, 0);
}});
AtomicInteger index= new AtomicInteger(1);
//按执行人分组
if (CollectionUtil.isNotEmpty(operMaintenanceTaskEntityList)) {
Map<String, List<OperMaintenanceTaskEntity>> map = operMaintenanceTaskEntityList.stream().filter(o -> StringUtils.isNotBlank(o.getDisposer())).collect(Collectors.groupingBy(OperMaintenanceTaskEntity::getDisposer));
map.forEach((k, v) -> {
RunReportVO maintenanceReportVO = new RunReportVO();
maintenanceReportVO.setIndex(index.get());
//获取执行人名字
List<Long> userIdList = Arrays.asList(k.split(",")).stream().map(o -> Long.parseLong(o)).collect(Collectors.toList());
String userName = userIdList.stream().map(userId -> {
User user = UserCache.getUser(userId);
return Optional.ofNullable(user).map(User::getName).orElse("");
}).collect(Collectors.joining(","));
maintenanceReportVO.setUserName(userName);
this.fillRunReport(v, maintenanceReportVO);
maintenanceReportVOList.add(maintenanceReportVO);
index.getAndIncrement();
});
//合计
List<OperMaintenanceTaskEntity> maintenanceTaskEntityList = operMaintenanceTaskEntityList.stream().filter(o -> StringUtils.isNotBlank(o.getDisposer())).collect(Collectors.toList());
RunReportVO maintenanceReportVO = new RunReportVO();
maintenanceReportVO.setUserName("合计");
this.fillRunReport(maintenanceTaskEntityList, maintenanceReportVO);
maintenanceReportVOList.add(maintenanceReportVO);
}
return maintenanceReportVOList;
}
private static void fillRunReport(List<OperMaintenanceTaskEntity> v, RunReportVO maintenanceReportVO) {
//已完成任务
List<OperMaintenanceTaskEntity> finishTask = v.stream().filter(o -> MaintenanceConstant.TASK_STATUS_5 == o.getStatus()).collect(Collectors.toList());
Map<String, List<OperMaintenanceTaskEntity>> finishTaskGroupByType = finishTask.stream().collect(Collectors.groupingBy(OperMaintenanceTaskEntity::getTypeCode));
AtomicReference<String> finishSituation = new AtomicReference<>("");
finishTaskGroupByType.forEach((TypeCode, TypeList) -> {
try {
finishSituation.set(finishSituation.get().concat(DictCache.getValue(DictConstant.MAINTENANCE_TYPE_CODE, TypeCode)).concat(":").concat(TypeList.size() + "").concat("\r\n"));
} catch (NullPointerException e) {
e.printStackTrace();
}
});
maintenanceReportVO.setCompleteNum(finishTask.size());
maintenanceReportVO.setCompleteList(finishTask.stream().map(s->String.valueOf(s.getId())).collect(Collectors.toList()));
//未完成任务
List<OperMaintenanceTaskEntity> immatureTask = v.stream().filter(o -> MaintenanceConstant.TASK_STATUS_5 != o.getStatus()).collect(Collectors.toList());
if (CollectionUtil.isNotEmpty(immatureTask)){
Map<String, List<OperMaintenanceTaskEntity>> immatureTaskTaskGroupByType = immatureTask.stream().collect(Collectors.groupingBy(OperMaintenanceTaskEntity::getTypeCode));
// AtomicReference<String> immatureTaskSituation = new AtomicReference<>("");
immatureTaskTaskGroupByType.forEach((TypeCode, TypeList) -> {
finishSituation.set(finishSituation.get().concat(DictCache.getValue(DictConstant.MAINTENANCE_TYPE_CODE, TypeCode)).concat(":").concat(TypeList.size() + "").concat("\r\n"));
});
maintenanceReportVO.setIncompleteNum(immatureTask.size());
maintenanceReportVO.setIncompleteList(immatureTask.stream().map(s->String.valueOf(s.getId())).collect(Collectors.toList()));
maintenanceReportVO.setRemark(finishSituation.get());
}
}
@Override
public List<Map<String, Object>> getMaintenanceConclusion(Map<String, Object> params) { public List<Map<String, Object>> getMaintenanceConclusion(Map<String, Object> params) {
return operMaintenanceTaskMapper.getMaintenanceConclusion(params); return operMaintenanceTaskMapper.getMaintenanceConclusion(params);
} }

52
hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/controller/MonthReportController.java

@ -13,6 +13,7 @@ import com.hnac.hzims.operational.report.schedule.OperStationCreateMonthReport;
import com.hnac.hzims.operational.report.service.IMonthReportService; import com.hnac.hzims.operational.report.service.IMonthReportService;
import com.hnac.hzims.operational.report.service.IOperPersonalMonthReportService; import com.hnac.hzims.operational.report.service.IOperPersonalMonthReportService;
import com.hnac.hzims.operational.report.service.IOperStationMonthReportService; import com.hnac.hzims.operational.report.service.IOperStationMonthReportService;
import com.hnac.hzims.operational.report.vo.StationRunReportAllVO;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import jdk.nashorn.internal.objects.annotations.Getter; import jdk.nashorn.internal.objects.annotations.Getter;
@ -29,6 +30,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.time.LocalDate; import java.time.LocalDate;
@ -66,38 +68,44 @@ public class MonthReportController {
@OperationAnnotation(moduleName = "生产月报", @OperationAnnotation(moduleName = "生产月报",
title = "统计月报(对内 对外)",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE, title = "统计月报(对内 对外)",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE,
action = "根据站点编码获取站点月报") action = "根据站点编码获取站点月报")
public R<StationReportAllVO> getStationMonthReportByStationCode(@RequestParam("deptId") Long deptId,@RequestParam("month") String month) throws Exception { public R<StationRunReportAllVO> getStationMonthReportByStationCode(@RequestParam("deptId") Long deptId,@RequestParam("month") String month) throws Exception {
// LocalDate startDate = DateUtil.getFirstDayByYearMonth(month); // LocalDate startDate = DateUtil.getFirstDayByYearMonth(month);
// LocalDate endDate = DateUtil.getLastDayByYearMonth(month); // LocalDate endDate = DateUtil.getLastDayByYearMonth(month);
// return R.data(taskMonthService.getStationMonthReport(startDate,endDate,deptId.toString())); // return R.data(taskMonthService.getStationMonthReport(startDate,endDate,deptId.toString()));
StationReportAllVO stationReportAllVO = monthReportService.getStationMonthReportByStationCode(deptId,month); StationRunReportAllVO stationReportAllVO = monthReportService.getStationMonthReportByStationCode(deptId,month);
return R.data(stationReportAllVO); return R.data(stationReportAllVO);
} }
//
@ApiLog // @ApiLog
@GetMapping("/getPersonalMonthReport") // @GetMapping("/getPersonalMonthReport")
@ApiOperation(value = "获取当前登录人个人月报",notes = "获取当前登录人个人月报") // @ApiOperation(value = "获取当前登录人个人月报",notes = "获取当前登录人个人月报")
@ApiOperationSupport(order = 2) // @ApiOperationSupport(order = 2)
@OperationAnnotation(moduleName = "生产月报",title = "统计月报-个人",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE, // @OperationAnnotation(moduleName = "生产月报",title = "统计月报-个人",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE,
action = "获取当前登录人个人月报") // action = "获取当前登录人个人月报")
public R<PersonalMonthReportVO> getPersonalMonthReport(@RequestParam("month") String month) throws Exception { // public R<PersonalMonthReportVO> getPersonalMonthReport(@RequestParam("month") String month) throws Exception {
PersonalMonthReportVO personalMonthReportVO = monthReportService.getPersonalMonthReport(month); // PersonalMonthReportVO personalMonthReportVO = monthReportService.getPersonalMonthReport(month);
return R.data(personalMonthReportVO); // return R.data(personalMonthReportVO);
} // }
@GetMapping("/exportStationMonthReport") @GetMapping("/exportStationMonthReport")
@ApiOperation(value = "导出站点月报",notes = "导出站点月报") @ApiOperation(value = "导出站点月报",notes = "导出站点月报")
@ApiOperationSupport(order = 3) @ApiOperationSupport(order = 3)
public void exportStationMonthReport(@RequestParam("month") String month,@RequestParam("stationCode") String stationCode,@RequestParam("type") String type) throws UnsupportedEncodingException { public void exportStationMonthReport(HttpServletResponse response, @RequestParam("deptId") Long deptId, @RequestParam("month") String month) throws Exception {
operStationMonthReportService.exportStationMonthReport(month,stationCode,type); StationRunReportAllVO stationReportAllVO = monthReportService.getStationMonthReportByStationCode(deptId,month);
} operStationMonthReportService.exportStationMonthReport(response, stationReportAllVO,deptId);
@GetMapping("/exportPersonalMonthReport")
@ApiOperation(value = "导出个人月报",notes = "导出个人月报")
@ApiOperationSupport(order = 4)
public void exportPersonalMonthReport(@RequestParam("month") String month){
operPersonalMonthReportService.exportPersonalMonthReport(month);
} }
// @GetMapping("/exportStationMonthReport")
// @ApiOperation(value = "导出站点月报",notes = "导出站点月报")
// @ApiOperationSupport(order = 3)
// public void exportStationMonthReport(@RequestParam("month") String month,@RequestParam("stationCode") String stationCode,@RequestParam("type") String type) throws UnsupportedEncodingException {
// operStationMonthReportService.exportStationMonthReport(month,stationCode,type);
// }
// @GetMapping("/exportPersonalMonthReport")
// @ApiOperation(value = "导出个人月报",notes = "导出个人月报")
// @ApiOperationSupport(order = 4)
// public void exportPersonalMonthReport(@RequestParam("month") String month){
// operPersonalMonthReportService.exportPersonalMonthReport(month);
// }
@GetMapping("/getStationMonthReport") @GetMapping("/getStationMonthReport")
@ApiOperation(value = "按机构获取月报测试",notes = "按机构获取月报测试") @ApiOperation(value = "按机构获取月报测试",notes = "按机构获取月报测试")

7
hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/schedule/OperStationCreateMonthReport.java

@ -9,6 +9,7 @@ import com.hnac.hzims.operational.report.entity.OperMonthReportEntity;
import com.hnac.hzims.operational.report.service.IMonthReportService; import com.hnac.hzims.operational.report.service.IMonthReportService;
import com.hnac.hzims.operational.report.service.IOperStationMonthReportService; import com.hnac.hzims.operational.report.service.IOperStationMonthReportService;
import com.hnac.hzims.operational.report.utils.ObjectHelper; import com.hnac.hzims.operational.report.utils.ObjectHelper;
import com.hnac.hzims.operational.report.vo.StationRunReportAllVO;
import com.hnac.hzims.operational.station.entity.StationEntity; import com.hnac.hzims.operational.station.entity.StationEntity;
import com.hnac.hzims.operational.station.service.IStationService; import com.hnac.hzims.operational.station.service.IStationService;
import com.xxl.job.core.biz.model.ReturnT; import com.xxl.job.core.biz.model.ReturnT;
@ -63,9 +64,7 @@ public class OperStationCreateMonthReport {
}}); }});
if(CollectionUtil.isEmpty(operMonthReportEntityList)){ if(CollectionUtil.isEmpty(operMonthReportEntityList)){
//按站点生成各电站运维月报 //按站点生成各电站运维月报
ExecutorService singleThreadExecutor = Executors.newSingleThreadExecutor(); StationRunReportAllVO stationReportAllVO = operStationMonthReportService.getStationMonthReportV2(yearAndMonth, deptVO);
singleThreadExecutor.execute(() -> {
StationReportAllVO stationReportAllVO = operStationMonthReportService.getStationMonthReport(yearAndMonth, deptVO);
if(ObjectUtil.isNotEmpty(stationReportAllVO)){ if(ObjectUtil.isNotEmpty(stationReportAllVO)){
OperMonthReportEntity operMonthReportEntity = new OperMonthReportEntity(); OperMonthReportEntity operMonthReportEntity = new OperMonthReportEntity();
operMonthReportEntity.setMonth(yearAndMonth); operMonthReportEntity.setMonth(yearAndMonth);
@ -79,8 +78,6 @@ public class OperStationCreateMonthReport {
e.printStackTrace(); e.printStackTrace();
} }
} }
});
singleThreadExecutor.shutdown();
} }
else{ else{
log.info("该月{}已生成月报",deptVO.getDeptName()); log.info("该月{}已生成月报",deptVO.getDeptName());

5
hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/IMonthReportService.java

@ -3,6 +3,7 @@ package com.hnac.hzims.operational.report.service;
import com.hnac.hzims.operational.report.vo.PersonalMonthReportVO; import com.hnac.hzims.operational.report.vo.PersonalMonthReportVO;
import com.hnac.hzims.operational.report.vo.StationReportAllVO; import com.hnac.hzims.operational.report.vo.StationReportAllVO;
import com.hnac.hzims.operational.report.entity.OperMonthReportEntity; import com.hnac.hzims.operational.report.entity.OperMonthReportEntity;
import com.hnac.hzims.operational.report.vo.StationRunReportAllVO;
import org.springblade.core.mp.base.BaseService; import org.springblade.core.mp.base.BaseService;
public interface IMonthReportService extends BaseService<OperMonthReportEntity> { public interface IMonthReportService extends BaseService<OperMonthReportEntity> {
@ -13,7 +14,7 @@ public interface IMonthReportService extends BaseService<OperMonthReportEntity>
* @return * @return
* @throws Exception * @throws Exception
*/ */
StationReportAllVO getStationMonthReportByStationCode(Long deptId, String month) throws Exception; StationRunReportAllVO getStationMonthReportByStationCode(Long deptId, String month) throws Exception;
/** /**
* 查询个人月报 * 查询个人月报
@ -21,5 +22,5 @@ public interface IMonthReportService extends BaseService<OperMonthReportEntity>
* @return * @return
* @throws Exception * @throws Exception
*/ */
PersonalMonthReportVO getPersonalMonthReport(String month) throws Exception; // PersonalMonthReportVO getPersonalMonthReport(String month) throws Exception;
} }

15
hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/IOperStationMonthReportService.java

@ -1,8 +1,11 @@
package com.hnac.hzims.operational.report.service; package com.hnac.hzims.operational.report.service;
import com.hnac.hzims.operational.report.vo.StationReportAllVO; import com.hnac.hzims.operational.report.vo.StationReportAllVO;
import com.hnac.hzims.operational.report.vo.StationRunReportAllVO;
import org.springblade.system.vo.DeptVO; import org.springblade.system.vo.DeptVO;
import org.springframework.web.bind.annotation.RequestParam;
import javax.servlet.http.HttpServletResponse;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
public interface IOperStationMonthReportService { public interface IOperStationMonthReportService {
@ -12,11 +15,15 @@ public interface IOperStationMonthReportService {
* @return * @return
*/ */
StationReportAllVO getStationMonthReport(String yearAndMonth, DeptVO deptVO); StationReportAllVO getStationMonthReport(String yearAndMonth, DeptVO deptVO);
/**
* 获取电站月报
* @param yearAndMonth
* @return
*/
StationRunReportAllVO getStationMonthReportV2(String yearAndMonth, DeptVO deptVO);
/** /**
* 导出站点月报 * 导出站点月报
* @param month
* @param type
*/ */
void exportStationMonthReport(String month,String stationCode,String type); // void exportStationMonthReport(String month,String stationCode,String type);
void exportStationMonthReport(HttpServletResponse response, StationRunReportAllVO stationReportAllVO,Long deptId) throws Exception;
} }

43
hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/impl/MonthReportServiceImpl.java

@ -9,6 +9,7 @@ import com.hnac.hzims.operational.report.entity.OperMonthReportEntity;
import com.hnac.hzims.operational.report.mapper.MonthReportMapper; import com.hnac.hzims.operational.report.mapper.MonthReportMapper;
import com.hnac.hzims.operational.report.service.IMonthReportService; import com.hnac.hzims.operational.report.service.IMonthReportService;
import com.hnac.hzims.operational.report.utils.ObjectHelper; import com.hnac.hzims.operational.report.utils.ObjectHelper;
import com.hnac.hzims.operational.report.vo.StationRunReportAllVO;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl; import org.springblade.core.mp.base.BaseServiceImpl;
@ -33,12 +34,12 @@ public class MonthReportServiceImpl extends BaseServiceImpl<MonthReportMapper, O
private final ISysClient sysClient; private final ISysClient sysClient;
@Override @Override
public StationReportAllVO getStationMonthReportByStationCode(Long deptId, String month) throws Exception { public StationRunReportAllVO getStationMonthReportByStationCode(Long deptId, String month) throws Exception {
StationReportAllVO stationReportAllVO = new StationReportAllVO(); StationRunReportAllVO stationReportAllVO = new StationRunReportAllVO();
Dept dept = sysClient.getDept(deptId).getData(); Dept dept = sysClient.getDept(deptId).getData();
//当月查询实时数据 //当月查询实时数据
if(month.equals(YearMonth.now().toString())){ if(month.equals(YearMonth.now().toString())){
stationReportAllVO = operStationMonthReportService.getStationMonthReport(month, BeanUtil.copy(dept, DeptVO.class)); stationReportAllVO = operStationMonthReportService.getStationMonthReportV2(month, BeanUtil.copy(dept, DeptVO.class));
} }
//历史查询定时任务生成的数据 //历史查询定时任务生成的数据
else{ else{
@ -48,26 +49,26 @@ public class MonthReportServiceImpl extends BaseServiceImpl<MonthReportMapper, O
orderByDesc(OperMonthReportEntity::getObject); orderByDesc(OperMonthReportEntity::getObject);
last("limit 1;"); last("limit 1;");
}}); }});
stationReportAllVO = ObjectUtil.isNotEmpty(operMonthReportEntity) ? (StationReportAllVO) ObjectHelper.byte2obj(operMonthReportEntity.getObject()) stationReportAllVO = ObjectUtil.isNotEmpty(operMonthReportEntity) ? (StationRunReportAllVO) ObjectHelper.byte2obj(operMonthReportEntity.getObject())
: operStationMonthReportService.getStationMonthReport(month, BeanUtil.copy(dept, DeptVO.class)); : operStationMonthReportService.getStationMonthReportV2(month, BeanUtil.copy(dept, DeptVO.class));
} }
return stationReportAllVO; return stationReportAllVO;
} }
@Override // @Override
public PersonalMonthReportVO getPersonalMonthReport(String month) throws Exception { // public PersonalMonthReportVO getPersonalMonthReport(String month) throws Exception {
PersonalMonthReportVO personalMonthReportVO = new PersonalMonthReportVO(); // PersonalMonthReportVO personalMonthReportVO = new PersonalMonthReportVO();
BladeUser user = AuthUtil.getUser(); // BladeUser user = AuthUtil.getUser();
if(month.equals(YearMonth.now().toString())){ // if(month.equals(YearMonth.now().toString())){
personalMonthReportVO = operPersonalMonthReportService.getPersonalMonthReport(month,user.getUserId()); // personalMonthReportVO = operPersonalMonthReportService.getPersonalMonthReport(month,user.getUserId());
} // }
else{ // else{
OperMonthReportEntity operMonthReportEntity = this.getOne(new LambdaQueryWrapper<OperMonthReportEntity>(){{ // OperMonthReportEntity operMonthReportEntity = this.getOne(new LambdaQueryWrapper<OperMonthReportEntity>(){{
eq(OperMonthReportEntity::getMonth,month); // eq(OperMonthReportEntity::getMonth,month);
eq(OperMonthReportEntity::getUserId,user.getUserId()); // eq(OperMonthReportEntity::getUserId,user.getUserId());
}}); // }});
personalMonthReportVO = ObjectUtil.isNotEmpty(operMonthReportEntity) ? (PersonalMonthReportVO) ObjectHelper.byte2obj(operMonthReportEntity.getObject()) : null; // personalMonthReportVO = ObjectUtil.isNotEmpty(operMonthReportEntity) ? (PersonalMonthReportVO) ObjectHelper.byte2obj(operMonthReportEntity.getObject()) : null;
} // }
return personalMonthReportVO; // return personalMonthReportVO;
} // }
} }

1245
hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/impl/OperStationMonthReportServiceImpl.java

File diff suppressed because it is too large Load Diff

32
hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/vo/AccessRunReportVO.java

@ -0,0 +1,32 @@
package com.hnac.hzims.operational.report.vo;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.NullSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
@Data
public class AccessRunReportVO implements Serializable {
private static final long serialVersionUID = -6752409583963294512L;
private Integer index;
@ApiModelProperty("人员ID")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Long userId;
@ApiModelProperty("姓名")
private String userName;
@ApiModelProperty("检修项目")
private String maintenanceItem;
@ApiModelProperty("完成情况")
private String completeSituation;
@ApiModelProperty("备注")
private String remark;
}

36
hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/vo/DefectRunReportsVO.java

@ -0,0 +1,36 @@
package com.hnac.hzims.operational.report.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.List;
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class DefectRunReportsVO implements Serializable {
private static final long serialVersionUID = 4172942990070215282L;
private Integer index;
@ApiModelProperty("缺陷名称")
private String faultName;
@ApiModelProperty("缺陷等级")
private String seriousSituation;
@ApiModelProperty("发现人")
private String finder;
@ApiModelProperty("发现时间")
private String finderTime;
@ApiModelProperty("缺陷描述")
private String description;
@ApiModelProperty("处理时间")
private String handleTime;
@ApiModelProperty("处理情况")
private String handleSituation;
}

36
hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/vo/DutyRunReportVO.java

@ -0,0 +1,36 @@
package com.hnac.hzims.operational.report.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
@Data
public class DutyRunReportVO implements Serializable {
private static final long serialVersionUID = 3273581622730234931L;
private Integer index;
@ApiModelProperty("班组名称")
private String groupName;
@ApiModelProperty("值长")
private String managerName;
@ApiModelProperty("值班次数")
private Integer dutyNum=0;
@ApiModelProperty("值班")
private List<String> dutyList;
@ApiModelProperty("发现问题数量")
private Integer findProblemNum=0;
@ApiModelProperty("发现问题数量")
private List<String> findProblemList;
@ApiModelProperty("延迟交接班")
private Integer delayChangeShifts=0;
@ApiModelProperty("延迟交接班")
private List<String> delayChangeList;
@ApiModelProperty("异常交接班")
private Integer exceptionChangeShifts=0;
@ApiModelProperty("异常交接班")
private List<String> exceptionChangeList;
}

41
hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/vo/FDPRunReportVO.java

@ -0,0 +1,41 @@
package com.hnac.hzims.operational.report.vo;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.NullSerializer;
import com.hnac.hzims.operational.maintenance.entity.OperMaintenanceTaskEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
@Data
public class FDPRunReportVO implements Serializable {
private static final long serialVersionUID = -4198449565005940501L;
private Integer index;
@ApiModelProperty("最近出现告警时间")
@JSONField(name = "LASTBEGINTIME")
private String lastBeginTime;
@ApiModelProperty("告警内容")
private String content;
@ApiModelProperty("告警类型")
private String type;
@ApiModelProperty("告警次数")
private String num;
@ApiModelProperty("初步分析原因")
@JSONField(name = "ORD")
private String reason;
@ApiModelProperty("建议处置方式")
@JSONField(name = "INFO")
private String advise;
}

31
hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/vo/RunReportVO.java

@ -0,0 +1,31 @@
package com.hnac.hzims.operational.report.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
@Data
public class RunReportVO implements Serializable {
private static final long serialVersionUID = -4198449565005940501L;
private Integer index;
@ApiModelProperty("人员ID")
private String userId;
@ApiModelProperty("姓名")
private String userName;
@ApiModelProperty("完成次数")
private Integer completeNum;
@ApiModelProperty("完成任务数量")
private List<String> completeList;
@ApiModelProperty("未完成次数")
private Integer incompleteNum;
@ApiModelProperty("完成任务数量")
private List<String> incompleteList;
@ApiModelProperty("备注")
private String remark;
}

50
hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/vo/StationRunReportAllVO.java

@ -0,0 +1,50 @@
package com.hnac.hzims.operational.report.vo;
import com.hnac.hzims.fdp.vo.StatisticStatusVO;
import com.hnac.hzims.ticket.allTicket.vo.TicketInfoStatisticVO;
import com.hnac.hzinfo.inspect.task.vo.TaskReportVO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
import java.util.Map;
@Data
public class StationRunReportAllVO implements Serializable {
private static final long serialVersionUID = -3173423342834166988L;
@ApiModelProperty("月报统计月份")
private String yearMonth;
@ApiModelProperty("电站名称")
private String stationName;
@ApiModelProperty("电站发电情况")
private List<StationRunReportVO> stationReportVOList;
@ApiModelProperty("值班")
private List<DutyRunReportVO> dutyReportVOList;
@ApiModelProperty("日常维护")
private List<RunReportVO> maintenanceReportVOList;
@ApiModelProperty("巡检")
private List<RunReportVO> inspectReportVOList;
@ApiModelProperty("检修")
private List<AccessRunReportVO> accessReportVOList;
@ApiModelProperty("缺陷")
private List<DefectRunReportsVO> defectReportsVOList;
@ApiModelProperty("两票")
private List<TicketInfoStatisticVO> ticketInfoStatisticVOList;
@ApiModelProperty("智能诊断")
private List<FDPRunReportVO> fdpRunReportVOList;
@ApiModelProperty("建议")
private String suggestion;
}

32
hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/vo/StationRunReportVO.java

@ -0,0 +1,32 @@
package com.hnac.hzims.operational.report.vo;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.NullSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
@Data
public class StationRunReportVO implements Serializable {
private static final long serialVersionUID = -8957498837980526029L;
@ApiModelProperty("序号")
private Integer index;
@ApiModelProperty(value = "电站名称")
private String stationName;
@ApiModelProperty(value = "月计划发电量")
private Double powerMonPlan;
@ApiModelProperty(value = "实发电量")
private String finishPowerMon;
@JsonSerialize(nullsUsing = NullSerializer.class)
@ApiModelProperty(value = "月度完成率")
private String powerMonRate;
@JsonSerialize(nullsUsing = NullSerializer.class)
@ApiModelProperty(value = "年度计划")
private Double powerYearPlan;
@JsonSerialize(nullsUsing = NullSerializer.class)
@ApiModelProperty(value = "已完成")
private String finishPowerYear;
@ApiModelProperty(value = "年度完成率")
private String powerYearRate;
}

15
hzims-service/operational/src/main/java/com/hnac/hzims/operational/util/TimeUtils.java

@ -127,6 +127,21 @@ public class TimeUtils {
} }
return monthList; return monthList;
} }
public static List<String> getListByYearMon(Integer year,Integer mon) {
List<String> monthList=new ArrayList<>();
for (int i = 0; i <mon; i++) {
// 创建一个Calendar对象
Calendar calendar = Calendar.getInstance();
// 设置年份
calendar.set(Calendar.YEAR, Integer.valueOf(year));
// 设置月份为1(即一月)
calendar.set(Calendar.MONTH, i);
calendar.set(Calendar.DAY_OF_MONTH, 1);
String monTime = DateUtil.format(calendar.getTime(), DateUtil.PATTERN_DATE);
monthList.add(monTime);
}
return monthList;
}
public static String getMon(Integer year,Integer month) { public static String getMon(Integer year,Integer month) {
// 创建一个Calendar对象 // 创建一个Calendar对象
Calendar calendar = Calendar.getInstance(); Calendar calendar = Calendar.getInstance();

BIN
hzims-service/operational/src/main/resources/template/word/stationMonthReport.docx

Binary file not shown.

4
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/ConferenceController.java

@ -110,8 +110,8 @@ public class ConferenceController extends BladeController {
@GetMapping("/recordPage") @GetMapping("/recordPage")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "conferencePlanId", value = "会议计划id", dataType = "query", paramType = "string"), @ApiImplicitParam(name = "conferencePlanId", value = "会议计划id", dataType = "query", paramType = "string"),
@ApiImplicitParam(name = "actualStartTime", value = "计划开始时间", dataType = "query", paramType = "string"), @ApiImplicitParam(name = "actualStartTime", value = "开始时间", dataType = "query", paramType = "string"),
@ApiImplicitParam(name = "actualEndTime", value = "计划结束时间", dataType = "query", paramType = "string") @ApiImplicitParam(name = "actualEndTime", value = "结束时间", dataType = "query", paramType = "string")
}) })
@ApiOperation(value = "会议记录分页") @ApiOperation(value = "会议记录分页")
@ApiOperationSupport(order = 10) @ApiOperationSupport(order = 10)

4
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/RehearsalController.java

@ -113,8 +113,8 @@ public class RehearsalController extends BladeController {
@GetMapping("/rehearsalRecordPage") @GetMapping("/rehearsalRecordPage")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "rehearsalPlanId", value = "演练计划id", dataType = "query", paramType = "string"), @ApiImplicitParam(name = "rehearsalPlanId", value = "演练计划id", dataType = "query", paramType = "string"),
@ApiImplicitParam(name = "actualStartTime", value = "计划开始时间", dataType = "query", paramType = "string"), @ApiImplicitParam(name = "actualStartTime", value = "开始时间", dataType = "query", paramType = "string"),
@ApiImplicitParam(name = "actualEndTime", value = "计划结束时间", dataType = "query", paramType = "string") @ApiImplicitParam(name = "actualEndTime", value = "结束时间", dataType = "query", paramType = "string")
}) })
@ApiOperation(value = "演练记录分页") @ApiOperation(value = "演练记录分页")
@ApiOperationSupport(order = 10) @ApiOperationSupport(order = 10)

14
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/TrainController.java

@ -124,13 +124,14 @@ public class TrainController extends BladeController {
@GetMapping("/trainRecordPage") @GetMapping("/trainRecordPage")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "trainPlanId", value = "培训计划id", dataType = "query", paramType = "string") @ApiImplicitParam(name = "trainPlanId", value = "培训计划id", dataType = "query", paramType = "string"),
@ApiImplicitParam(name = "startTime", value = "计划开始时间", dataType = "query", paramType = "string"),
@ApiImplicitParam(name = "endTime", value = "计划结束时间", dataType = "query", paramType = "string")
}) })
@ApiOperation(value = "培训记录分页") @ApiOperation(value = "培训记录分页")
@ApiOperationSupport(order = 10) @ApiOperationSupport(order = 10)
public R<IPage<TrainRecordEntity>> trainRecordPage(@ApiIgnore @RequestParam Map<String, Object> param, Query query) { public R<IPage<TrainRecordEntity>> trainRecordPage(@ApiIgnore @RequestParam Map<String, Object> param, Query query) {
IPage<TrainRecordEntity> page = trainRecordService.page(Condition.getPage(query), Condition.getQueryWrapper( IPage<TrainRecordEntity> page = trainRecordService.trainRecordPage(param, query);
param, TrainRecordEntity.class).lambda().orderByDesc(TrainRecordEntity::getCreateTime));
return R.data(page); return R.data(page);
} }
@ -173,13 +174,14 @@ public class TrainController extends BladeController {
@GetMapping("/testPage") @GetMapping("/testPage")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "trainPlanId", value = "培训计划id", dataType = "query", paramType = "string"), @ApiImplicitParam(name = "trainPlanId", value = "培训计划id", dataType = "query", paramType = "string"),
@ApiImplicitParam(name = "trainRecordId", value = "培训记录id", dataType = "query", paramType = "string") @ApiImplicitParam(name = "trainRecordId", value = "培训记录id", dataType = "query", paramType = "string"),
@ApiImplicitParam(name = "testName", value = "考试名称", dataType = "query", paramType = "string"),
@ApiImplicitParam(name = "unit", value = "单位", dataType = "query", paramType = "string")
}) })
@ApiOperation(value = "考试记录分页") @ApiOperation(value = "考试记录分页")
@ApiOperationSupport(order = 16) @ApiOperationSupport(order = 16)
public R<IPage<TestEntity>> testPage(@ApiIgnore @RequestParam Map<String, Object> param, Query query) { public R<IPage<TestEntity>> testPage(@ApiIgnore @RequestParam Map<String, Object> param, Query query) {
IPage<TestEntity> page = testService.page(Condition.getPage(query), Condition.getQueryWrapper(param, TestEntity.class) IPage<TestEntity> page = testService.testPage(param, query);
.lambda().orderByDesc(TestEntity::getCreateTime));
return R.data(page); return R.data(page);
} }

4
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/SpecialDeviceInspectionMapper.xml

@ -13,10 +13,10 @@
AND device_id = #{param.deviceId} AND device_id = #{param.deviceId}
</if> </if>
<if test="param.startTime != null and param.startTime != ''"> <if test="param.startTime != null and param.startTime != ''">
AND inspectionTime >= #{param.startTime} AND inspection_time >= #{param.startTime}
</if> </if>
<if test="param.endTime != null and param.endTime != ''"> <if test="param.endTime != null and param.endTime != ''">
AND inspectionTime &lt;= #{param.endTime} AND inspection_time &lt;= #{param.endTime}
</if> </if>
ORDER BY ORDER BY
create_time DESC create_time DESC

10
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TestMapper.java

@ -1,11 +1,13 @@
package com.hnac.hzims.safeproduct.mapper; package com.hnac.hzims.safeproduct.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hnac.hzims.safeproduct.dto.TestDTO; import com.hnac.hzims.safeproduct.dto.TestDTO;
import com.hnac.hzims.safeproduct.entity.TestEntity; import com.hnac.hzims.safeproduct.entity.TestEntity;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 考试记录Mapper类 * 考试记录Mapper类
@ -22,4 +24,12 @@ public interface TestMapper extends BaseMapper<TestEntity> {
* @return 考试记录名称列表 * @return 考试记录名称列表
*/ */
List<TestDTO> getTestNameList(String trainPlanId); List<TestDTO> getTestNameList(String trainPlanId);
/**
* 考试记录分页
* @param param 入参
* @param page 分页类
* @return 考试记录数据
*/
IPage<TestEntity> testPage(IPage<TestEntity> page, Map<String, Object> param);
} }

23
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TestMapper.xml

@ -15,4 +15,27 @@
ORDER BY ORDER BY
create_time DESC create_time DESC
</select> </select>
<select id="testPage" resultType="com.hnac.hzims.safeproduct.entity.TestEntity">
SELECT
*
FROM
hzims_test
WHERE
is_deleted = 0
<if test="param.trainPlanId != null and param.trainPlanId != ''">
AND train_plan_id = #{param.trainPlanId}
</if>
<if test="param.trainRecordId != null and param.trainRecordId != ''">
AND train_record_id = #{param.trainRecordId}
</if>
<if test="param.testName != null and param.testName != ''">
AND test_name like concat('%', #{param.testName}, '%)'
</if>
<if test="param.unit != null and param.unit != ''">
AND test_name like concat('%', #{param.unit}, '%)'
</if>
ORDER BY
create_time DESC
</select>
</mapper> </mapper>

10
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainRecordMapper.java

@ -1,12 +1,14 @@
package com.hnac.hzims.safeproduct.mapper; package com.hnac.hzims.safeproduct.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hnac.hzims.safeproduct.dto.TrainRecordDTO; import com.hnac.hzims.safeproduct.dto.TrainRecordDTO;
import com.hnac.hzims.safeproduct.entity.TrainRecordEntity; import com.hnac.hzims.safeproduct.entity.TrainRecordEntity;
import com.hnac.hzims.safeproduct.vo.TrainRecordDetailVO; import com.hnac.hzims.safeproduct.vo.TrainRecordDetailVO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 培训记录Mapper类 * 培训记录Mapper类
@ -30,4 +32,12 @@ public interface TrainRecordMapper extends BaseMapper<TrainRecordEntity> {
* @return 培训记录表VO类 * @return 培训记录表VO类
*/ */
TrainRecordDetailVO getTrainRecordDetailById(Long id); TrainRecordDetailVO getTrainRecordDetailById(Long id);
/**
* 培训记录分页
* @param param 入参
* @param page 分页类
* @return 培训记录数据
*/
IPage<TrainRecordEntity> trainRecordPage(IPage<TrainRecordEntity> page, Map<String, Object> param);
} }

20
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainRecordMapper.xml

@ -27,4 +27,24 @@
t1.is_deleted = 0 t1.is_deleted = 0
AND t1.id = #{id} AND t1.id = #{id}
</select> </select>
<select id="trainRecordPage" resultType="com.hnac.hzims.safeproduct.entity.TrainRecordEntity">
SELECT
*
FROM
hzims_train_record
WHERE
is_deleted = 0
<if test="param.trainPlanId != null and param.trainPlanId != ''">
AND train_plan_id = #{param.trainPlanId}
</if>
<if test="param.startTime != null and param.startTime != ''">
AND actual_start_time >= #{param.startTime}
</if>
<if test="param.endTime != null and param.endTime != ''">
AND actual_end_time &lt;= #{param.endTime}
</if>
ORDER BY
create_time DESC
</select>
</mapper> </mapper>

11
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ITestService.java

@ -1,11 +1,14 @@
package com.hnac.hzims.safeproduct.service; package com.hnac.hzims.safeproduct.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.hnac.hzims.safeproduct.dto.TestDTO; import com.hnac.hzims.safeproduct.dto.TestDTO;
import com.hnac.hzims.safeproduct.entity.TestEntity; import com.hnac.hzims.safeproduct.entity.TestEntity;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 考试记录服务类 * 考试记录服务类
@ -63,4 +66,12 @@ public interface ITestService extends IService<TestEntity> {
* @return true-成功false-失败 * @return true-成功false-失败
*/ */
boolean updateTest(TestEntity testEntity); boolean updateTest(TestEntity testEntity);
/**
* 考试记录分页
* @param param 入参
* @param query 分页类
* @return 考试记录数据
*/
IPage<TestEntity> testPage(Map<String, Object> param, Query query);
} }

11
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ITrainRecordService.java

@ -1,12 +1,15 @@
package com.hnac.hzims.safeproduct.service; package com.hnac.hzims.safeproduct.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.hnac.hzims.safeproduct.dto.TrainRecordDTO; import com.hnac.hzims.safeproduct.dto.TrainRecordDTO;
import com.hnac.hzims.safeproduct.entity.TrainRecordEntity; import com.hnac.hzims.safeproduct.entity.TrainRecordEntity;
import com.hnac.hzims.safeproduct.vo.TrainRecordDetailVO; import com.hnac.hzims.safeproduct.vo.TrainRecordDetailVO;
import org.springblade.core.mp.support.Query;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 培训记录服务类 * 培训记录服务类
@ -64,4 +67,12 @@ public interface ITrainRecordService extends IService<TrainRecordEntity> {
* @return 培训记录表VO类 * @return 培训记录表VO类
*/ */
TrainRecordDetailVO getTrainRecordDetailById(Long id); TrainRecordDetailVO getTrainRecordDetailById(Long id);
/**
* 培训记录分页
* @param param 入参
* @param query 分页类
* @return 培训记录数据
*/
IPage<TrainRecordEntity> trainRecordPage(Map<String, Object> param, Query query);
} }

13
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TestServiceImpl.java

@ -3,6 +3,8 @@ package com.hnac.hzims.safeproduct.service.impl;
import cn.hutool.core.date.DatePattern; import cn.hutool.core.date.DatePattern;
import com.alibaba.excel.util.CollectionUtils; import com.alibaba.excel.util.CollectionUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hnac.hzims.safeproduct.constants.SafeProductConstant; import com.hnac.hzims.safeproduct.constants.SafeProductConstant;
import com.hnac.hzims.safeproduct.dto.TestDTO; import com.hnac.hzims.safeproduct.dto.TestDTO;
@ -14,6 +16,7 @@ import com.hnac.hzims.safeproduct.mapper.TrainPlanMapper;
import com.hnac.hzims.safeproduct.service.ITestScoreService; import com.hnac.hzims.safeproduct.service.ITestScoreService;
import com.hnac.hzims.safeproduct.service.ITestService; import com.hnac.hzims.safeproduct.service.ITestService;
import com.hnac.hzims.safeproduct.utils.BaseUtil; import com.hnac.hzims.safeproduct.utils.BaseUtil;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -23,6 +26,7 @@ import javax.annotation.Resource;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
@ -175,6 +179,15 @@ public class TestServiceImpl extends ServiceImpl<TestMapper, TestEntity> impleme
} }
/** /**
* 考试记录分页
*/
@Override
public IPage<TestEntity> testPage(Map<String, Object> param, Query query) {
IPage<TestEntity> page = new Page<>(query.getCurrent(), query.getSize());
return baseMapper.testPage(page, param);
}
/**
* 获取成绩列表 * 获取成绩列表
* @param testEntity 考试记录实体类 * @param testEntity 考试记录实体类
* @param person 参考人员 * @param person 参考人员

12
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TrainRecordServiceImpl.java

@ -4,6 +4,8 @@ import cn.afterturn.easypoi.entity.ImageEntity;
import cn.hutool.core.date.DatePattern; import cn.hutool.core.date.DatePattern;
import com.alibaba.excel.util.CollectionUtils; import com.alibaba.excel.util.CollectionUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hnac.hzims.common.logs.utils.StringUtils; import com.hnac.hzims.common.logs.utils.StringUtils;
import com.hnac.hzims.safeproduct.constants.SafeProductConstant; import com.hnac.hzims.safeproduct.constants.SafeProductConstant;
@ -18,6 +20,7 @@ import com.hnac.hzims.safeproduct.service.ITestService;
import com.hnac.hzims.safeproduct.service.ITrainRecordService; import com.hnac.hzims.safeproduct.service.ITrainRecordService;
import com.hnac.hzims.safeproduct.utils.BaseUtil; import com.hnac.hzims.safeproduct.utils.BaseUtil;
import com.hnac.hzims.safeproduct.vo.TrainRecordDetailVO; import com.hnac.hzims.safeproduct.vo.TrainRecordDetailVO;
import org.springblade.core.mp.support.Query;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -180,6 +183,15 @@ public class TrainRecordServiceImpl extends ServiceImpl<TrainRecordMapper, Train
} }
/** /**
* 培训记录分页
*/
@Override
public IPage<TrainRecordEntity> trainRecordPage(Map<String, Object> param, Query query) {
IPage<TrainRecordEntity> page = new Page<>(query.getCurrent(), query.getSize());
return baseMapper.trainRecordPage(page, param);
}
/**
* 查询是否存在同月编号 * 查询是否存在同月编号
* @param currentMonth 当月 * @param currentMonth 当月
* @return 存在则返回上一编号否则返回null * @return 存在则返回上一编号否则返回null

BIN
hzims-service/safeproduct/src/main/resources/template/会议记录表.docx

Binary file not shown.

BIN
hzims-service/safeproduct/src/main/resources/template/卫生自查表.docx

Binary file not shown.

BIN
hzims-service/safeproduct/src/main/resources/template/培训记录表.docx

Binary file not shown.

BIN
hzims-service/safeproduct/src/main/resources/template/演练记录表.docx

Binary file not shown.

BIN
hzims-service/safeproduct/src/main/resources/template/车辆检查表.docx

Binary file not shown.

BIN
hzims-service/safeproduct/src/main/resources/template/车辆维保记录单.docx

Binary file not shown.

47
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/allTicket/fegin/TicketInfoAllClient.java

@ -12,13 +12,16 @@ import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springblade.core.log.exception.ServiceException; import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.core.tool.utils.StringUtil; import org.springblade.core.tool.utils.StringUtil;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.Assert; import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.math.BigDecimal;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.*; import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
@ -41,19 +44,53 @@ public class TicketInfoAllClient implements ITicketInfoAllClient {
@Override @Override
@PostMapping("/getTicketReportStatistic") @PostMapping("/getTicketReportStatistic")
public List<TicketInfoStatisticVO> getTicketReportStatistic(@RequestBody TicketStatisticDTO ticketStatisticDTO) { public List<TicketInfoStatisticVO> getTicketReportStatistic(@RequestBody TicketStatisticDTO ticketStatisticDTO) {
List<TicketInfoStatisticVO> workTicketStatistic = new ArrayList<>();
String startDate = ticketStatisticDTO.getStartDate(); String startDate = ticketStatisticDTO.getStartDate();
String endDate = ticketStatisticDTO.getEndDate(); String endDate = ticketStatisticDTO.getEndDate();
String deptIds = ticketStatisticDTO.getDeptIds(); String deptIds = ticketStatisticDTO.getDeptIds();
Assert.isTrue(StringUtil.isNoneBlank(deptIds),()->{ Assert.isTrue(StringUtil.isNoneBlank(deptIds), () -> {
throw new ServiceException("站点统计月报工作票查询机构ID不能为空"); throw new ServiceException("站点统计月报工作票查询机构ID不能为空");
}); });
List<Long> deptIdList = Arrays.stream(deptIds.split(",")).map(Long::parseLong).collect(Collectors.toList()); List<Long> deptIdList = Arrays.stream(deptIds.split(",")).map(Long::parseLong).collect(Collectors.toList());
// 统计工作票 // 统计工作票
TicketInfoStatisticVO workTicketStatistic = firstWorkTicketService.workTicketReportStatistic(startDate, endDate, deptIdList); workTicketStatistic = firstWorkTicketService.workTicketReportStatistic(startDate, endDate, deptIdList);
// 统计操作票 // 统计操作票
TicketInfoStatisticVO operateTicketStatistic = standardTicketInfoService.operateTicketReportStatistic(startDate,endDate,deptIdList); List<TicketInfoStatisticVO> operateTicketStatistic = standardTicketInfoService.operateTicketReportStatistic(startDate, endDate, deptIdList);
//TODO 统计应急抢修单 if (CollectionUtil.isNotEmpty(operateTicketStatistic)) {
return Lists.newArrayList(workTicketStatistic,operateTicketStatistic); workTicketStatistic.addAll(operateTicketStatistic);
//TODO 统计应急抢修单
}
if (CollectionUtil.isNotEmpty(workTicketStatistic)){
AtomicInteger index = new AtomicInteger(1);
workTicketStatistic = workTicketStatistic.stream().map(s -> {
s.setIndex(index.get());
index.getAndIncrement();
return s;
}).collect(Collectors.toList());
TicketInfoStatisticVO ticketInfoStatisticVO=new TicketInfoStatisticVO();
ticketInfoStatisticVO.setTicketInfoType("合计");
int sum = workTicketStatistic.stream().mapToInt(TicketInfoStatisticVO::getTicketInfoNumber).sum();
int CompleteNum = workTicketStatistic.stream().mapToInt(TicketInfoStatisticVO::getTicketInfoCompleteNum).sum();
int InvalidatedNum = workTicketStatistic.stream().mapToInt(TicketInfoStatisticVO::getTicketInfoInvalidatedNum).sum();
int QualifiedNum = workTicketStatistic.stream().mapToInt(TicketInfoStatisticVO::getTicketInfoQualifiedNum).sum();
Double Proportion = new BigDecimal(QualifiedNum).divide(new BigDecimal(sum),2,BigDecimal.ROUND_UP).doubleValue();
ticketInfoStatisticVO.setTicketInfoNumber(sum);
ticketInfoStatisticVO.setTicketInfoCompleteNum(CompleteNum);
ticketInfoStatisticVO.setTicketInfoInvalidatedNum(InvalidatedNum);
ticketInfoStatisticVO.setTicketInfoQualifiedNum(QualifiedNum);
ticketInfoStatisticVO.setTicketInfoProportion(Proportion);
workTicketStatistic.add(ticketInfoStatisticVO);
}else {
TicketInfoStatisticVO ticketInfoStatisticVO=new TicketInfoStatisticVO();
ticketInfoStatisticVO.setTicketInfoType("合计");
ticketInfoStatisticVO.setTicketInfoNumber(0);
ticketInfoStatisticVO.setTicketInfoCompleteNum(0);
ticketInfoStatisticVO.setTicketInfoInvalidatedNum(0);
ticketInfoStatisticVO.setTicketInfoQualifiedNum(0);
ticketInfoStatisticVO.setTicketInfoProportion(0.0);
workTicketStatistic.add(ticketInfoStatisticVO);
}
return workTicketStatistic;
} }
@Override @Override

2
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/IStandardTicketInfoService.java

@ -94,7 +94,7 @@ public interface IStandardTicketInfoService extends BaseService<StandardTicketIn
* @param deptIdList 机构ID列表 * @param deptIdList 机构ID列表
* @return * @return
*/ */
TicketInfoStatisticVO operateTicketReportStatistic(String startDate, String endDate, List<Long> deptIdList); List<TicketInfoStatisticVO> operateTicketReportStatistic(String startDate, String endDate, List<Long> deptIdList);
/** /**
* 获取首页区域当月操作票/工作票 * 获取首页区域当月操作票/工作票

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

@ -38,6 +38,7 @@ import com.hnac.hzims.ticket.utils.PdfUtils;
import com.hnac.hzims.ticket.workTicket.entity.WorkTicketInfoEntity; import com.hnac.hzims.ticket.workTicket.entity.WorkTicketInfoEntity;
import com.hnac.hzims.ticket.workTicket.service.IWorkTicketInfoService; import com.hnac.hzims.ticket.workTicket.service.IWorkTicketInfoService;
import com.hnac.hzims.ticket.workTicket.vo.TicketMonthVO; import com.hnac.hzims.ticket.workTicket.vo.TicketMonthVO;
import com.hnac.hzims.ticket.workTicket.vo.WorkTicketReportStatisticVO;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
@ -681,20 +682,33 @@ public class StandardTicketInfoServiceImpl extends BaseServiceImpl<StandardTicke
* @return * @return
*/ */
@Override @Override
public TicketInfoStatisticVO operateTicketReportStatistic(String startDate, String endDate, List<Long> deptIdList) { public List<TicketInfoStatisticVO> operateTicketReportStatistic(String startDate, String endDate, List<Long> deptIdList) {
TicketInfoStatisticVO result = new TicketInfoStatisticVO(); List<TicketInfoStatisticVO> res = new ArrayList<>();
result.setTicketInfoType("操作票");
List<OperateTicketStatisticVO> operateTicketReportStatistic = this.baseMapper.getOperateTicketReportStatistic(startDate, endDate, deptIdList); List<OperateTicketStatisticVO> operateTicketReportStatistic = this.baseMapper.getOperateTicketReportStatistic(startDate, endDate, deptIdList);
Map<String, List<OperateTicketStatisticVO>> operateTicket = operateTicketReportStatistic.stream().filter(o -> ObjectUtil.isNotEmpty(o.getTicketType()))
.collect(Collectors.groupingBy(OperateTicketStatisticVO::getTicketType));
if (CollectionUtil.isNotEmpty(operateTicketReportStatistic)) { if (CollectionUtil.isNotEmpty(operateTicketReportStatistic)) {
//已完成数量 for (Map.Entry<String, List<OperateTicketStatisticVO>> typeOperateTicket : operateTicket.entrySet()) {
int ticketInfoCompleteNum = operateTicketReportStatistic.stream().filter(item -> "结束".equals(item.getFlowTaskName())).collect(Collectors.toList()).size(); String type = TicketConstants.TicketTypeNameEnum.getTicketNameByType(typeOperateTicket.getKey());
//合格数量 //已完成数量
int ticketInfoQualifiedNum = operateTicketReportStatistic.stream().filter(ticket -> Func.isNotEmpty(ticket.getEvaluation()) && 1 == ticket.getEvaluation().intValue()).collect(Collectors.toList()).size(); int ticketInfoCompleteNum = operateTicketReportStatistic.stream().filter(item -> "结束".equals(item.getFlowTaskName())).collect(Collectors.toList()).size();
//计算合格率 //合格数量
double ticketInfoProportion = new BigDecimal(ticketInfoQualifiedNum / (double) operateTicketReportStatistic.size() * 100).setScale(2, RoundingMode.HALF_DOWN).doubleValue(); int ticketInfoQualifiedNum = operateTicketReportStatistic.stream().filter(ticket -> Func.isNotEmpty(ticket.getEvaluation()) && 1 == ticket.getEvaluation().intValue()).collect(Collectors.toList()).size();
result = TicketInfoStatisticVO.builder().ticketInfoType("操作票").ticketInfoNumber(operateTicketReportStatistic.size()).ticketInfoCompleteNum(ticketInfoCompleteNum).ticketInfoQualifiedNum(ticketInfoQualifiedNum).ticketInfoStartNum(operateTicketReportStatistic.size() - ticketInfoCompleteNum).ticketInfoProportion(ticketInfoProportion).build(); //废票数量
} int ticketInfoInvalidatedNum = operateTicketReportStatistic.stream().filter(item -> "作废".equals(item.getFlowTaskName())).collect(Collectors.toList()).size();
return result; //计算合格率
double ticketInfoProportion = new BigDecimal(ticketInfoQualifiedNum / (double) operateTicketReportStatistic.size() * 100).setScale(2, RoundingMode.HALF_DOWN).doubleValue();
TicketInfoStatisticVO ticketInfoStatisticVO = TicketInfoStatisticVO.builder().ticketInfoType(type)
.ticketInfoNumber(operateTicketReportStatistic.size())
.ticketInfoCompleteNum(ticketInfoCompleteNum)
.ticketInfoQualifiedNum(ticketInfoQualifiedNum)
.ticketInfoInvalidatedNum(ticketInfoInvalidatedNum)
.ticketInfoStartNum(operateTicketReportStatistic.size() - ticketInfoCompleteNum)
.ticketInfoProportion(ticketInfoProportion).build();
res.add(ticketInfoStatisticVO);
}
}
return res;
} }
@ -788,16 +802,17 @@ public class StandardTicketInfoServiceImpl extends BaseServiceImpl<StandardTicke
/** /**
* 操作票-关联数据 * 操作票-关联数据
*
* @param page * @param page
* @param business * @param business
* @return * @return
*/ */
@Override @Override
public IPage<StandardTicketInfoVO> operate(IPage<StandardTicketInfoEntity> page,OperateVo business) { public IPage<StandardTicketInfoVO> operate(IPage<StandardTicketInfoEntity> page, OperateVo business) {
QueryWrapper<StandardTicketInfoEntity> queryWrapper = new QueryWrapper<>(); QueryWrapper<StandardTicketInfoEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.ge(Func.isNotEmpty(business.getStartTime()), "oper.create_time", business.getStartTime()); queryWrapper.ge(Func.isNotEmpty(business.getStartTime()), "oper.create_time", business.getStartTime());
queryWrapper.le(Func.isNotEmpty(business.getEndTime()), "oper.create_time", business.getEndTime()); queryWrapper.le(Func.isNotEmpty(business.getEndTime()), "oper.create_time", business.getEndTime());
queryWrapper.in(Func.isNotEmpty(business.getDeptIds()), "oper.create_dept",Func.toLongList(",",business.getDeptIds())); queryWrapper.in(Func.isNotEmpty(business.getDeptIds()), "oper.create_dept", Func.toLongList(",", business.getDeptIds()));
queryWrapper.like(Func.isNotEmpty(business.getCode()), "oper.code", business.getCode()); queryWrapper.like(Func.isNotEmpty(business.getCode()), "oper.code", business.getCode());
queryWrapper.eq(Func.isNotEmpty(business.getTicketType()), "oper.ticket_type", business.getTicketType()); queryWrapper.eq(Func.isNotEmpty(business.getTicketType()), "oper.ticket_type", business.getTicketType());
queryWrapper.eq(Func.isNotEmpty(business.getStatus()), "eva.status", business.getStatus()); queryWrapper.eq(Func.isNotEmpty(business.getStatus()), "eva.status", business.getStatus());
@ -816,11 +831,11 @@ public class StandardTicketInfoServiceImpl extends BaseServiceImpl<StandardTicke
queryWrapper.eq(StandardTicketInfoEntity::getFlowTaskName, entity.getFlowTaskName()); queryWrapper.eq(StandardTicketInfoEntity::getFlowTaskName, entity.getFlowTaskName());
} }
List<StandardTicketInfoEntity> standardTicketInfoEntities = super.baseMapper.selectList(queryWrapper); List<StandardTicketInfoEntity> standardTicketInfoEntities = super.baseMapper.selectList(queryWrapper);
List<StandardTicketExportVO> list=new ArrayList<>(); List<StandardTicketExportVO> list = new ArrayList<>();
if (CollectionUtils.isNotEmpty(standardTicketInfoEntities)){ if (CollectionUtils.isNotEmpty(standardTicketInfoEntities)) {
List<StandardTicketExportVO> standardTicketInfoVOS = standardTicketInfoEntities.parallelStream().map(standardTicketInfoEntity -> { List<StandardTicketExportVO> standardTicketInfoVOS = standardTicketInfoEntities.parallelStream().map(standardTicketInfoEntity -> {
StandardTicketExportVO exportVO = new StandardTicketExportVO(); StandardTicketExportVO exportVO = new StandardTicketExportVO();
try { try {
exportVO.setCompany(Optional.ofNullable(standardTicketInfoEntity.getCompany()).orElse(null)); exportVO.setCompany(Optional.ofNullable(standardTicketInfoEntity.getCompany()).orElse(null));
exportVO.setTicketType(Optional.ofNullable(DictCache.getValue(TicketConstants.TICKET_TYPE, standardTicketInfoEntity.getTicketType())).orElse(null)); exportVO.setTicketType(Optional.ofNullable(DictCache.getValue(TicketConstants.TICKET_TYPE, standardTicketInfoEntity.getTicketType())).orElse(null));
exportVO.setCode(Optional.ofNullable(standardTicketInfoEntity.getCode()).orElse(null)); exportVO.setCode(Optional.ofNullable(standardTicketInfoEntity.getCode()).orElse(null));
@ -853,22 +868,23 @@ public class StandardTicketInfoServiceImpl extends BaseServiceImpl<StandardTicke
exportVO.setEndTime(Optional.ofNullable(DateUtil.format(standardTicketInfoEntity.getEndTime(), TicketConstants.TICKET_DATE_PATTERN)).orElse("")); exportVO.setEndTime(Optional.ofNullable(DateUtil.format(standardTicketInfoEntity.getEndTime(), TicketConstants.TICKET_DATE_PATTERN)).orElse(""));
exportVO.setIsEvaluate("未评价"); exportVO.setIsEvaluate("未评价");
if (ObjectUtils.isNotEmpty(standardTicketInfoEntity.getIsEvaluate())) { if (ObjectUtils.isNotEmpty(standardTicketInfoEntity.getIsEvaluate())) {
if (1==standardTicketInfoEntity.getIsEvaluate() ) { if (1 == standardTicketInfoEntity.getIsEvaluate()) {
TicketInfoEvaluateEntity evaluateEntity = ticketInfoEvaluateService.getOne(new LambdaQueryWrapper<TicketInfoEvaluateEntity>() {{ TicketInfoEvaluateEntity evaluateEntity = ticketInfoEvaluateService.getOne(new LambdaQueryWrapper<TicketInfoEvaluateEntity>() {{
eq(TicketInfoEvaluateEntity::getTicketId, standardTicketInfoEntity.getId()); eq(TicketInfoEvaluateEntity::getTicketId, standardTicketInfoEntity.getId());
}}.last(" limit 1")); }}.last(" limit 1"));
if ( ObjectUtil.isNotEmpty(evaluateEntity)) { if (ObjectUtil.isNotEmpty(evaluateEntity)) {
exportVO.setIsEvaluate(evaluateEntity.getStatus() == 1 ? "合格" : "不合格"); exportVO.setIsEvaluate(evaluateEntity.getStatus() == 1 ? "合格" : "不合格");
} }
} }
}}catch (Exception e){
log.error("转换失败----》"+e.toString()+standardTicketInfoEntity.toString());
System.out.println("转换失败----》"+e.toString()+standardTicketInfoEntity.toString());
} }
return exportVO; } catch (Exception e) {
}).collect(Collectors.toList()); log.error("转换失败----》" + e.toString() + standardTicketInfoEntity.toString());
return standardTicketInfoVOS; System.out.println("转换失败----》" + e.toString() + standardTicketInfoEntity.toString());
}else { }
return exportVO;
}).collect(Collectors.toList());
return standardTicketInfoVOS;
} else {
return list; return list;
} }
} }
@ -876,8 +892,8 @@ public class StandardTicketInfoServiceImpl extends BaseServiceImpl<StandardTicke
@Override @Override
public void exportOperateTicket(HttpServletResponse response, Long ticketId) { public void exportOperateTicket(HttpServletResponse response, Long ticketId) {
StandardTicketInfoVO detail = this.detail(ticketId).getData(); StandardTicketInfoVO detail = this.detail(ticketId).getData();
Map<String,Object> params = com.hnac.hzims.ticket.utils.ObjectUtils.obj2Map(detail); Map<String, Object> params = com.hnac.hzims.ticket.utils.ObjectUtils.obj2Map(detail);
params.put("measureMapList",this.convert(detail.getStandardTicketMeasureVOList())); params.put("measureMapList", this.convert(detail.getStandardTicketMeasureVOList()));
XWPFDocument xwpfDocument = null; XWPFDocument xwpfDocument = null;
String fileName = "template/电气操作票.docx"; String fileName = "template/电气操作票.docx";
try { try {
@ -885,15 +901,15 @@ public class StandardTicketInfoServiceImpl extends BaseServiceImpl<StandardTicke
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
String wordPath = this.getFileSavePath() + detail.getTitle() +".docx"; String wordPath = this.getFileSavePath() + detail.getTitle() + ".docx";
try { try {
this.exportTicketWord(Lists.newArrayList(xwpfDocument),wordPath); this.exportTicketWord(Lists.newArrayList(xwpfDocument), wordPath);
} catch (IOException e) { } catch (IOException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
String pdfPath = this.getFileSavePath() + detail.getTitle() +".pdf"; String pdfPath = this.getFileSavePath() + detail.getTitle() + ".pdf";
AsposeUtil.wordToPdf(wordPath,pdfPath); AsposeUtil.wordToPdf(wordPath, pdfPath);
PdfUtils.readPdf(response,pdfPath); PdfUtils.readPdf(response, pdfPath);
} }
private void exportTicketWord(List<XWPFDocument> documents, String savePath) throws IOException { private void exportTicketWord(List<XWPFDocument> documents, String savePath) throws IOException {
@ -902,39 +918,35 @@ public class StandardTicketInfoServiceImpl extends BaseServiceImpl<StandardTicke
for (XWPFDocument document : documents) { for (XWPFDocument document : documents) {
document.write(out); document.write(out);
} }
} } catch (Exception e) {
catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} } finally {
finally {
out.close(); out.close();
} }
} }
private String getFileSavePath() { private String getFileSavePath() {
String os = System.getProperty("os.name").toLowerCase(); String os = System.getProperty("os.name").toLowerCase();
if("linux".equals(os)) { if ("linux".equals(os)) {
return pdfSavePath; return pdfSavePath;
} } else {
else {
return "E://template/"; return "E://template/";
} }
} }
private List<Map> convert (List<? extends Object> list) { private List<Map> convert(List<? extends Object> list) {
if(CollectionUtil.isNotEmpty(list)) { if (CollectionUtil.isNotEmpty(list)) {
return IntStream.iterate(0, index -> index + 1).limit(list.size() > 25 ? list.size() : 25).mapToObj(index -> { return IntStream.iterate(0, index -> index + 1).limit(list.size() > 25 ? list.size() : 25).mapToObj(index -> {
if(index <= list.size() - 1) { if (index <= list.size() - 1) {
Map result = com.hnac.hzims.ticket.utils.ObjectUtils.obj2Map(list.get(index)); Map result = com.hnac.hzims.ticket.utils.ObjectUtils.obj2Map(list.get(index));
result.put("index",index + 1); result.put("index", index + 1);
result.put("status",TicketConstants.MATTER_FINISH_STATUS == result.get("status") ? "√" : null); result.put("status", TicketConstants.MATTER_FINISH_STATUS == result.get("status") ? "√" : null);
return result; return result;
} } else {
else {
return new HashMap(); return new HashMap();
} }
}).collect(Collectors.toList()); }).collect(Collectors.toList());
} }
return IntStream.iterate(0,index -> index + 1).limit(4).mapToObj(index -> new HashMap()).collect(Collectors.toList()); return IntStream.iterate(0, index -> index + 1).limit(4).mapToObj(index -> new HashMap()).collect(Collectors.toList());
} }
} }

2
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/IFirstWorkTicketService.java

@ -133,5 +133,5 @@ public interface IFirstWorkTicketService extends ITwoTicketService<WorkTicketInf
* @param deptIdList 机构ID列表 * @param deptIdList 机构ID列表
* @return * @return
*/ */
TicketInfoStatisticVO workTicketReportStatistic(String startDate, String endDate, List<Long> deptIdList); List<TicketInfoStatisticVO> workTicketReportStatistic(String startDate, String endDate, List<Long> deptIdList);
} }

75
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/FirstWorkTicketServiceImpl.java

@ -1073,38 +1073,57 @@ public class FirstWorkTicketServiceImpl extends BaseServiceImpl<WorkTicketInfoMa
* @return * @return
*/ */
@Override @Override
public TicketInfoStatisticVO workTicketReportStatistic(String startDate, String endDate, List<Long> deptIdList) { public List<TicketInfoStatisticVO> workTicketReportStatistic(String startDate, String endDate, List<Long> deptIdList) {
TicketInfoStatisticVO workTicketStatistic = new TicketInfoStatisticVO(); List<TicketInfoStatisticVO> res = new ArrayList<>();
workTicketStatistic.setTicketInfoType("工作票");
// 统计工作票 // 统计工作票
List<WorkTicketReportStatisticVO> workTicketReportStatistic = this.baseMapper.getWorkTicketReportStatistic(startDate, endDate, deptIdList); List<WorkTicketReportStatisticVO> workTicketReportStatistic = this.baseMapper.getWorkTicketReportStatistic(startDate, endDate, deptIdList);
Map<String, List<WorkTicketReportStatisticVO>> workTicketMap = workTicketReportStatistic.stream().filter(o -> ObjectUtil.isNotEmpty(o.getType()))
.collect(Collectors.groupingBy(WorkTicketReportStatisticVO::getType));
if(CollectionUtil.isNotEmpty(workTicketReportStatistic)) { if(CollectionUtil.isNotEmpty(workTicketReportStatistic)) {
// 工作票完成数量 for (Map.Entry<String, List<WorkTicketReportStatisticVO>> typeWorkTicket : workTicketMap.entrySet()) {
int ticketInfoCompleteNum = workTicketReportStatistic.stream().filter(item -> "结束".equals(item.getFlowTaskName())) String ticketInfoType="";
.collect(Collectors.toList()).size(); switch (typeWorkTicket.getKey()){
// 工作票未完成数量 case "6":
int ticketInfoStartNum = workTicketReportStatistic.size() - ticketInfoCompleteNum; ticketInfoType="第一种工作票";
// 延期数量统计 break;
int ticketInfoDelayNum = workTicketReportStatistic.stream().filter(item -> "延期".equals(item.getInput())) case "7":
.collect(Collectors.toList()).size(); ticketInfoType="第二种工作票";
// 合格数量统计 break;
int ticketInfoQualifiedNum = workTicketReportStatistic.stream().filter(ticket -> Func.isNotEmpty(ticket.getEvaluation()) && ticket.getEvaluation().intValue() == 1) case "8":
.collect(Collectors.toList()).size(); ticketInfoType="机械工作票";
//计算合格率 break;
Double ticketInfoProportion = new BigDecimal(ticketInfoQualifiedNum / (double) workTicketReportStatistic.size() *100) }
.setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue(); // 工作票完成数量
int ticketInfoCompleteNum = typeWorkTicket.getValue().stream().filter(item -> "结束".equals(item.getFlowTaskName()))
workTicketStatistic = TicketInfoStatisticVO.builder() .collect(Collectors.toList()).size();
.ticketInfoType("工作票") // 工作票未完成数量
.ticketInfoNumber(workTicketReportStatistic.size()) int ticketInfoStartNum = typeWorkTicket.getValue().size() - ticketInfoCompleteNum;
.ticketInfoCompleteNum(ticketInfoCompleteNum) // 延期数量统计
.ticketInfoStartNum(ticketInfoStartNum) int ticketInfoDelayNum = typeWorkTicket.getValue().stream().filter(item -> "延期".equals(item.getInput()))
.ticketInfoDelayNum(ticketInfoDelayNum) .collect(Collectors.toList()).size();
.ticketInfoQualifiedNum(ticketInfoQualifiedNum) // 废票数量统计
.ticketInfoProportion(ticketInfoProportion) int invalidatedNum = typeWorkTicket.getValue().stream().filter(item -> "废票".equals(item.getFlowTaskName()))
.build(); .collect(Collectors.toList()).size();
// 合格数量统计
int ticketInfoQualifiedNum = typeWorkTicket.getValue().stream().filter(ticket -> Func.isNotEmpty(ticket.getEvaluation()) && ticket.getEvaluation().intValue() == 1)
.collect(Collectors.toList()).size();
//计算合格率
Double ticketInfoProportion = new BigDecimal(ticketInfoQualifiedNum / (double) workTicketReportStatistic.size() *100)
.setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue();
TicketInfoStatisticVO workTicketStatistic = TicketInfoStatisticVO.builder()
.ticketInfoType(ticketInfoType)
.ticketInfoNumber(workTicketReportStatistic.size())
.ticketInfoCompleteNum(ticketInfoCompleteNum)
.ticketInfoStartNum(ticketInfoStartNum)
.ticketInfoDelayNum(ticketInfoDelayNum)
.ticketInfoInvalidatedNum(invalidatedNum)
.ticketInfoQualifiedNum(ticketInfoQualifiedNum)
.ticketInfoProportion(ticketInfoProportion)
.build();
res.add(workTicketStatistic);
}
} }
return workTicketStatistic; return res;
} }
/** /**

4
hzims-service/ticket/src/test/java/com/hnac/hzims/ticket/TicketApplicationTest.java

@ -81,8 +81,8 @@ public class TicketApplicationTest {
String startDate = "2022-07-01"; String startDate = "2022-07-01";
String endDate = "2022-07-31"; String endDate = "2022-07-31";
List<Long> deptIdList = Lists.newArrayList(2000000109L); List<Long> deptIdList = Lists.newArrayList(2000000109L);
TicketInfoStatisticVO ticketInfoStatisticVO = firstWorkTicketService.workTicketReportStatistic(startDate, endDate, deptIdList); // TicketInfoStatisticVO ticketInfoStatisticVO = firstWorkTicketService.workTicketReportStatistic(startDate, endDate, deptIdList);
log.info("{}",JSON.toJSONString(ticketInfoStatisticVO)); // log.info("{}",JSON.toJSONString(ticketInfoStatisticVO));
} }

Loading…
Cancel
Save