Browse Source

Merge remote-tracking branch 'origin/master'

zhongwei
haungxing 1 year ago
parent
commit
ef792cf177
  1. 15
      hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/allTicket/dto/TicketStatisticDTO.java
  2. 24
      hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/allTicket/fegin/ITicketInfoAllClient.java
  3. 8
      hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/allTicket/fegin/TicketInfoAllClientFallback.java
  4. 13
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/impl/TargetServiceImpl.java
  5. 19
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HomePageServiceImpl.java
  6. 25
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HomeServiceImpl.java
  7. 22
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/impl/OperStationMonthReportServiceImpl.java
  8. 30
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/allTicket/fegin/TicketInfoAllClient.java

15
hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/allTicket/dto/TicketStatisticDTO.java

@ -1,14 +1,14 @@
package com.hnac.hzims.ticket.allTicket.dto; package com.hnac.hzims.ticket.allTicket.dto;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Builder;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tool.utils.DateUtil; import org.springblade.core.tool.utils.DateUtil;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable; import java.io.Serializable;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;
/** /**
* @ClassName TicketStatisticDTO * @ClassName TicketStatisticDTO
@ -18,10 +18,11 @@ import java.time.LocalDateTime;
* @Version 4.0 * @Version 4.0
**/ **/
@Data @Data
@Builder
@EqualsAndHashCode
public class TicketStatisticDTO implements Serializable { public class TicketStatisticDTO implements Serializable {
/**
* 机构IDS 按逗号分隔
*/
private String deptIds; private String deptIds;
@JsonFormat(pattern = DateUtil.PATTERN_DATETIME) @JsonFormat(pattern = DateUtil.PATTERN_DATETIME)
@ -32,4 +33,10 @@ public class TicketStatisticDTO implements Serializable {
@DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME) @DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)
private LocalDateTime endTime; private LocalDateTime endTime;
private String startDate;
private String endDate;
private Map<String, String> stationMap;
private List<Long> depatList;
} }

24
hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/allTicket/fegin/ITicketInfoAllClient.java

@ -8,12 +8,11 @@ import com.hnac.hzims.ticket.constants.TicketConstants;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import java.time.LocalDateTime;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* @author hx * @author hx
@ -32,15 +31,10 @@ public interface ITicketInfoAllClient {
/** /**
* 统计站点统计月报-两票 * 统计站点统计月报-两票
* @param startDate 开始时间
* @param endDate 结束时间
* @param deptIds 机构IDS 按逗号分隔
* @return 两票统计对象 * @return 两票统计对象
*/ */
@GetMapping(GET_TICKET_REPORT_STATISTIC) @PostMapping(GET_TICKET_REPORT_STATISTIC)
List<TicketInfoStatisticVO> getTicketReportStatistic(@RequestParam String startDate, List<TicketInfoStatisticVO> getTicketReportStatistic(@RequestBody TicketStatisticDTO ticketStatisticDTO );
@RequestParam String endDate,
@RequestParam String deptIds);
/** /**
* 根据ID更新票据状态为未完成 * 根据ID更新票据状态为未完成
@ -53,18 +47,14 @@ public interface ITicketInfoAllClient {
/** /**
* 根据归属机构获取双票率 * 根据归属机构获取双票率
*/ */
@GetMapping(API_PREFIX + DOUBLE_PASS_RATE) @PostMapping(API_PREFIX + DOUBLE_PASS_RATE)
DoublePassRateVO getDoublePassRate(@RequestParam(value = "depatList") List<Long> depatList, DoublePassRateVO getDoublePassRate(@RequestBody TicketStatisticDTO ticketStatisticDTO);
@RequestParam(value = "firstDateTime") LocalDateTime firstDateTime,
@RequestParam(value = "now") LocalDateTime now);
/** /**
* 根据归属机构获取双票率 * 根据归属机构获取双票率
*/ */
@GetMapping(API_PREFIX + DOUBLE_PASS_QUANTITY) @PostMapping(API_PREFIX + DOUBLE_PASS_QUANTITY)
List<DoublePassVO> getDoublePassQuantity(@RequestParam(value = "stationMap") Map<String,String> stationMap, List<DoublePassVO> getDoublePassQuantity(@RequestBody TicketStatisticDTO ticketStatisticDTO);
@RequestParam(value = "firstDateTime") LocalDateTime firstDateTime,
@RequestParam(value = "now") LocalDateTime now);
@GetMapping(GET_TICKET_PASS_RATE) @GetMapping(GET_TICKET_PASS_RATE)
R<DoublePassRateVO> getTicketPassRate(TicketStatisticDTO ticketStatisticDTO); R<DoublePassRateVO> getTicketPassRate(TicketStatisticDTO ticketStatisticDTO);

8
hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/allTicket/fegin/TicketInfoAllClientFallback.java

@ -7,9 +7,7 @@ import com.hnac.hzims.ticket.allTicket.vo.TicketInfoStatisticVO;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.time.LocalDateTime;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* @author hx * @author hx
@ -18,7 +16,7 @@ import java.util.Map;
public class TicketInfoAllClientFallback implements ITicketInfoAllClient { public class TicketInfoAllClientFallback implements ITicketInfoAllClient {
@Override @Override
public List<TicketInfoStatisticVO> getTicketReportStatistic(String startDate, String endDate, String deptIds) { public List<TicketInfoStatisticVO> getTicketReportStatistic( TicketStatisticDTO ticketStatisticDTO) {
return null; return null;
} }
@ -28,12 +26,12 @@ public class TicketInfoAllClientFallback implements ITicketInfoAllClient {
} }
@Override @Override
public DoublePassRateVO getDoublePassRate(List<Long> depatList, LocalDateTime firstDateTime, LocalDateTime now) { public DoublePassRateVO getDoublePassRate(TicketStatisticDTO ticketStatisticDTO) {
return null; return null;
} }
@Override @Override
public List<DoublePassVO> getDoublePassQuantity(Map<String, String> stationMap, LocalDateTime firstDateTime, LocalDateTime now) { public List<DoublePassVO> getDoublePassQuantity(TicketStatisticDTO ticketStatisticDTO) {
return null; return null;
} }

13
hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/impl/TargetServiceImpl.java

@ -29,6 +29,7 @@ import com.hnac.hzims.operational.maintenance.vo.OperMaintenanceTaskVO;
import com.hnac.hzims.operational.report.vo.DutyDefectVO; import com.hnac.hzims.operational.report.vo.DutyDefectVO;
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.ticket.allTicket.dto.TicketStatisticDTO;
import com.hnac.hzims.ticket.allTicket.fegin.ITicketInfoAllClient; import com.hnac.hzims.ticket.allTicket.fegin.ITicketInfoAllClient;
import com.hnac.hzims.ticket.allTicket.vo.DoublePassRateVO; import com.hnac.hzims.ticket.allTicket.vo.DoublePassRateVO;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
@ -412,7 +413,11 @@ public class TargetServiceImpl implements TargetService {
if(!StringUtil.isEmpty(areaName)){ if(!StringUtil.isEmpty(areaName)){
for (Dept dept: areas.stream().filter(area->area.getDeptName().equals(areaName)).collect(Collectors.toList())) { for (Dept dept: areas.stream().filter(area->area.getDeptName().equals(areaName)).collect(Collectors.toList())) {
// 双票 // 双票
DoublePassRateVO doublePass = ticketInfoAllClient.getDoublePassRate(Collections.singletonList(dept.getId()), firstDateTime, LocalDateTime.now()); TicketStatisticDTO ticketStatisticDTO=new TicketStatisticDTO();
ticketStatisticDTO.setDepatList(Collections.singletonList(dept.getId()));
ticketStatisticDTO.setStartTime(firstDateTime);
ticketStatisticDTO.setEndTime(LocalDateTime.now());
DoublePassRateVO doublePass = ticketInfoAllClient.getDoublePassRate(ticketStatisticDTO);
CompleteTicketVo completeTicketVo = new CompleteTicketVo(); CompleteTicketVo completeTicketVo = new CompleteTicketVo();
if (ObjectUtil.isEmpty(doublePass)) { if (ObjectUtil.isEmpty(doublePass)) {
completeTicketVo.setAreaName(dept.getDeptName()); completeTicketVo.setAreaName(dept.getDeptName());
@ -430,7 +435,11 @@ public class TargetServiceImpl implements TargetService {
}else{ }else{
for (Dept dept: areas) { for (Dept dept: areas) {
// 双票 // 双票
DoublePassRateVO doublePass = ticketInfoAllClient.getDoublePassRate(Collections.singletonList(dept.getId()), firstDateTime, LocalDateTime.now()); TicketStatisticDTO ticketStatisticDTO=new TicketStatisticDTO();
ticketStatisticDTO.setDepatList(Collections.singletonList(dept.getId()));
ticketStatisticDTO.setStartTime(firstDateTime);
ticketStatisticDTO.setEndTime(LocalDateTime.now());
DoublePassRateVO doublePass = ticketInfoAllClient.getDoublePassRate(ticketStatisticDTO);
CompleteTicketVo completeTicketVo = new CompleteTicketVo(); CompleteTicketVo completeTicketVo = new CompleteTicketVo();
if (ObjectUtil.isEmpty(doublePass)) { if (ObjectUtil.isEmpty(doublePass)) {
completeTicketVo.setAreaName(dept.getDeptName()); completeTicketVo.setAreaName(dept.getDeptName());

19
hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HomePageServiceImpl.java

@ -18,6 +18,7 @@ import com.hnac.hzims.operational.main.service.IMainTaskStatisticService;
import com.hnac.hzims.operational.main.vo.*; import com.hnac.hzims.operational.main.vo.*;
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.ticket.allTicket.dto.TicketStatisticDTO;
import com.hnac.hzims.ticket.allTicket.fegin.ITicketInfoAllClient; import com.hnac.hzims.ticket.allTicket.fegin.ITicketInfoAllClient;
import com.hnac.hzims.ticket.allTicket.vo.DoublePassRateVO; import com.hnac.hzims.ticket.allTicket.vo.DoublePassRateVO;
import com.hnac.hzims.ticket.allTicket.vo.DoublePassVO; import com.hnac.hzims.ticket.allTicket.vo.DoublePassVO;
@ -331,7 +332,11 @@ public class HomePageServiceImpl implements IHomePageService {
// 当月首日 // 当月首日
LocalDate firstDay = LocalDate.now().withDayOfMonth(1); LocalDate firstDay = LocalDate.now().withDayOfMonth(1);
LocalDateTime firstDateTime = LocalDateTime.of(firstDay, LocalTime.MIN); LocalDateTime firstDateTime = LocalDateTime.of(firstDay, LocalTime.MIN);
return ticketInfoAllClient.getDoublePassQuantity(stationMap, firstDateTime, LocalDateTime.now()); TicketStatisticDTO ticketStatisticDTO=new TicketStatisticDTO();
ticketStatisticDTO.setStationMap(stationMap);
ticketStatisticDTO.setStartTime(firstDateTime);
ticketStatisticDTO.setEndTime(LocalDateTime.now());
return ticketInfoAllClient.getDoublePassQuantity(ticketStatisticDTO);
} }
/** /**
@ -683,7 +688,11 @@ public class HomePageServiceImpl implements IHomePageService {
} }
LocalDate firstDay = LocalDate.now().withDayOfYear(1); LocalDate firstDay = LocalDate.now().withDayOfYear(1);
LocalDateTime firstDateTime = LocalDateTime.of(firstDay, LocalTime.MIN); LocalDateTime firstDateTime = LocalDateTime.of(firstDay, LocalTime.MIN);
DoublePassRateVO doublePassRateVO = ticketInfoAllClient.getDoublePassRate(list, firstDateTime, LocalDateTime.now()); TicketStatisticDTO ticketStatisticDTO=new TicketStatisticDTO();
ticketStatisticDTO.setDepatList(list);
ticketStatisticDTO.setStartTime(firstDateTime);
ticketStatisticDTO.setEndTime(LocalDateTime.now());
DoublePassRateVO doublePassRateVO = ticketInfoAllClient.getDoublePassRate(ticketStatisticDTO);
if(ObjectUtil.isEmpty(doublePassRateVO)){ if(ObjectUtil.isEmpty(doublePassRateVO)){
return "0.0"; return "0.0";
} }
@ -790,7 +799,11 @@ public class HomePageServiceImpl implements IHomePageService {
exe.execute(() -> { exe.execute(() -> {
LocalDate firstDay = LocalDate.now().withDayOfYear(1); LocalDate firstDay = LocalDate.now().withDayOfYear(1);
LocalDateTime firstDateTime = LocalDateTime.of(firstDay, LocalTime.MIN); LocalDateTime firstDateTime = LocalDateTime.of(firstDay, LocalTime.MIN);
DoublePassRateVO doublePassRateVO = ticketInfoAllClient.getDoublePassRate(entry.getValue(), firstDateTime, LocalDateTime.now()); TicketStatisticDTO ticketStatisticDTO=new TicketStatisticDTO();
ticketStatisticDTO.setDepatList(entry.getValue());
ticketStatisticDTO.setStartTime(firstDateTime);
ticketStatisticDTO.setEndTime(LocalDateTime.now());
DoublePassRateVO doublePassRateVO = ticketInfoAllClient.getDoublePassRate(ticketStatisticDTO);
if (ObjectUtil.isEmpty(doublePassRateVO)) { if (ObjectUtil.isEmpty(doublePassRateVO)) {
storageConservancyVo.setPassRate("0"); storageConservancyVo.setPassRate("0");
} else { } else {

25
hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HomeServiceImpl.java

@ -17,6 +17,7 @@ import com.hnac.hzims.operational.main.service.IMainTaskStatisticService;
import com.hnac.hzims.operational.main.vo.*; import com.hnac.hzims.operational.main.vo.*;
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.ticket.allTicket.dto.TicketStatisticDTO;
import com.hnac.hzims.ticket.allTicket.fegin.ITicketInfoAllClient; import com.hnac.hzims.ticket.allTicket.fegin.ITicketInfoAllClient;
import com.hnac.hzims.ticket.allTicket.vo.DoublePassRateVO; import com.hnac.hzims.ticket.allTicket.vo.DoublePassRateVO;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
@ -221,7 +222,11 @@ public class HomeServiceImpl implements HomeService {
List<Long> areas = result.getData().stream().filter(dept -> stations.stream().map(StationEntity::getRefDept).collect(Collectors.toList()).contains(dept.getId())).map(Dept::getParentId).collect(Collectors.toList()); List<Long> areas = result.getData().stream().filter(dept -> stations.stream().map(StationEntity::getRefDept).collect(Collectors.toList()).contains(dept.getId())).map(Dept::getParentId).collect(Collectors.toList());
if(CollectionUtil.isNotEmpty(areas)){ if(CollectionUtil.isNotEmpty(areas)){
LocalDateTime firstDateTime = LocalDateTime.of(LocalDate.now().withDayOfYear(1), LocalTime.MIN); LocalDateTime firstDateTime = LocalDateTime.of(LocalDate.now().withDayOfYear(1), LocalTime.MIN);
DoublePassRateVO pass = ticketClient.getDoublePassRate(areas, firstDateTime, LocalDateTime.now()); TicketStatisticDTO ticketStatisticDTO=new TicketStatisticDTO();
ticketStatisticDTO.setDepatList(areas);
ticketStatisticDTO.setStartTime(firstDateTime);
ticketStatisticDTO.setEndTime(LocalDateTime.now());
DoublePassRateVO pass = ticketClient.getDoublePassRate(ticketStatisticDTO);
if(ObjectUtil.isNotEmpty(pass)){ if(ObjectUtil.isNotEmpty(pass)){
target.setTaget_four(Double.valueOf(pass.getDoublePassRate())); target.setTaget_four(Double.valueOf(pass.getDoublePassRate()));
} }
@ -271,7 +276,11 @@ public class HomeServiceImpl implements HomeService {
LocalDateTime firstDateTime = LocalDateTime.of(firstDay, LocalTime.MIN); LocalDateTime firstDateTime = LocalDateTime.of(firstDay, LocalTime.MIN);
R<List<Dept>> result = sysClient.getDeptList(); R<List<Dept>> result = sysClient.getDeptList();
List<Long> areas = result.getData().stream().filter(dept -> stations.stream().map(StationEntity::getRefDept).collect(Collectors.toList()).contains(dept.getId())).map(Dept::getParentId).collect(Collectors.toList()); List<Long> areas = result.getData().stream().filter(dept -> stations.stream().map(StationEntity::getRefDept).collect(Collectors.toList()).contains(dept.getId())).map(Dept::getParentId).collect(Collectors.toList());
DoublePassRateVO pass = ticketClient.getDoublePassRate(areas, firstDateTime, LocalDateTime.now()); TicketStatisticDTO ticketStatisticDTO=new TicketStatisticDTO();
ticketStatisticDTO.setDepatList(areas);
ticketStatisticDTO.setStartTime(firstDateTime);
ticketStatisticDTO.setEndTime(LocalDateTime.now());
DoublePassRateVO pass = ticketClient.getDoublePassRate(ticketStatisticDTO);
if (ObjectUtil.isNotEmpty(pass)) { if (ObjectUtil.isNotEmpty(pass)) {
target.setTaget_four(Double.valueOf(pass.getDoublePassRate())); target.setTaget_four(Double.valueOf(pass.getDoublePassRate()));
} }
@ -379,7 +388,11 @@ public class HomeServiceImpl implements HomeService {
exe.execute(() -> { exe.execute(() -> {
LocalDate firstDay = LocalDate.now().withDayOfYear(1); LocalDate firstDay = LocalDate.now().withDayOfYear(1);
LocalDateTime firstDateTime = LocalDateTime.of(firstDay, LocalTime.MIN); LocalDateTime firstDateTime = LocalDateTime.of(firstDay, LocalTime.MIN);
DoublePassRateVO pass = ticketClient.getDoublePassRate(areas, firstDateTime, LocalDateTime.now()); TicketStatisticDTO ticketStatisticDTO=new TicketStatisticDTO();
ticketStatisticDTO.setDepatList(areas);
ticketStatisticDTO.setStartTime(firstDateTime);
ticketStatisticDTO.setEndTime(LocalDateTime.now());
DoublePassRateVO pass = ticketClient.getDoublePassRate(ticketStatisticDTO);
if (ObjectUtil.isNotEmpty(pass)) { if (ObjectUtil.isNotEmpty(pass)) {
target.setTaget_four(Double.valueOf(pass.getDoublePassRate())); target.setTaget_four(Double.valueOf(pass.getDoublePassRate()));
} }
@ -599,7 +612,11 @@ public class HomeServiceImpl implements HomeService {
List<Long> areas = result.getData().stream().filter(dept -> stations.stream().map(StationEntity::getRefDept).collect(Collectors.toList()).contains(dept.getId())).map(Dept::getParentId).collect(Collectors.toList()); List<Long> areas = result.getData().stream().filter(dept -> stations.stream().map(StationEntity::getRefDept).collect(Collectors.toList()).contains(dept.getId())).map(Dept::getParentId).collect(Collectors.toList());
if(CollectionUtil.isNotEmpty(areas)){ if(CollectionUtil.isNotEmpty(areas)){
LocalDateTime firstDateTime = LocalDateTime.of(LocalDate.now().withDayOfYear(1), LocalTime.MIN); LocalDateTime firstDateTime = LocalDateTime.of(LocalDate.now().withDayOfYear(1), LocalTime.MIN);
DoublePassRateVO pass = ticketClient.getDoublePassRate(areas, firstDateTime, LocalDateTime.now()); TicketStatisticDTO ticketStatisticDTO=new TicketStatisticDTO();
ticketStatisticDTO.setDepatList(areas);
ticketStatisticDTO.setStartTime(firstDateTime);
ticketStatisticDTO.setEndTime(LocalDateTime.now());
DoublePassRateVO pass = ticketClient.getDoublePassRate(ticketStatisticDTO);
if(ObjectUtil.isNotEmpty(pass)){ if(ObjectUtil.isNotEmpty(pass)){
target.setTaget_four(Double.valueOf(pass.getDoublePassRate())); target.setTaget_four(Double.valueOf(pass.getDoublePassRate()));
} }

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

@ -1,7 +1,5 @@
package com.hnac.hzims.operational.report.service.impl; package com.hnac.hzims.operational.report.service.impl;
import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.entity.TemplateExportParams;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
@ -19,26 +17,20 @@ import com.hnac.hzims.operational.main.common.ExcelData;
import com.hnac.hzims.operational.main.enums.ColumnEnum; import com.hnac.hzims.operational.main.enums.ColumnEnum;
import com.hnac.hzims.operational.main.service.IMainSystemMonitoringService; import com.hnac.hzims.operational.main.service.IMainSystemMonitoringService;
import com.hnac.hzims.operational.maintenance.service.IOperMaintenanceTaskService; import com.hnac.hzims.operational.maintenance.service.IOperMaintenanceTaskService;
import com.hnac.hzims.operational.report.entity.OperMonthReportEntity;
import com.hnac.hzims.operational.report.mapper.MonthReportMapper;
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.vo.*; import com.hnac.hzims.operational.report.vo.*;
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.ExcelUtil; import com.hnac.hzims.operational.util.ExcelUtil;
import com.hnac.hzims.operational.util.ObjectUtils; import com.hnac.hzims.ticket.allTicket.dto.TicketStatisticDTO;
import com.hnac.hzims.ticket.allTicket.fegin.ITicketInfoAllClient; import com.hnac.hzims.ticket.allTicket.fegin.ITicketInfoAllClient;
import com.hnac.hzims.ticket.allTicket.vo.TicketInfoStatisticVO; import com.hnac.hzims.ticket.allTicket.vo.TicketInfoStatisticVO;
import com.hnac.hzinfo.inspect.ai.feign.IInspectRobotTaskClient; import com.hnac.hzinfo.inspect.ai.feign.IInspectRobotTaskClient;
import com.hnac.hzinfo.inspect.gather.feign.IInspectGatherClient;
import com.hnac.hzinfo.inspect.task.feign.IInspectTaskReportClient; import com.hnac.hzinfo.inspect.task.feign.IInspectTaskReportClient;
import com.hnac.hzinfo.inspect.task.vo.TaskReportVO; import com.hnac.hzinfo.inspect.task.vo.TaskReportVO;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.FileUtils;
import org.apache.poi.ss.usermodel.HorizontalAlignment; import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.util.CellRangeAddress; import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.xssf.usermodel.*; import org.apache.poi.xssf.usermodel.*;
import org.springblade.core.log.exception.ServiceException; import org.springblade.core.log.exception.ServiceException;
@ -54,24 +46,18 @@ import org.springframework.util.Assert;
import org.springframework.web.context.request.RequestAttributes; import org.springframework.web.context.request.RequestAttributes;
import org.springframework.web.context.request.RequestContextHolder; import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes; import org.springframework.web.context.request.ServletRequestAttributes;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode; import java.math.RoundingMode;
import java.net.URLEncoder;
import java.text.SimpleDateFormat;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.LocalTime; import java.time.LocalTime;
import java.time.YearMonth; import java.time.YearMonth;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.time.temporal.TemporalAdjusters;
import java.util.*; import java.util.*;
import java.util.concurrent.CountDownLatch; import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutorService; import java.util.concurrent.ExecutorService;
@ -197,7 +183,11 @@ public class OperStationMonthReportServiceImpl implements IOperStationMonthRepor
pool.execute(() -> { pool.execute(() -> {
try { try {
String deptIds = deptIdList.stream().map(deptId -> deptId.toString()).collect(Collectors.joining(",")); String deptIds = deptIdList.stream().map(deptId -> deptId.toString()).collect(Collectors.joining(","));
List<TicketInfoStatisticVO> ticketVOS = ticketInfoAllClient.getTicketReportStatistic(fmt.format(startDate),fmt.format(endDate),deptIds); TicketStatisticDTO ticketStatisticDTO=new TicketStatisticDTO();
ticketStatisticDTO.setStartDate(fmt.format(startDate));
ticketStatisticDTO.setEndDate(fmt.format(endDate));
ticketStatisticDTO.setDeptIds(deptIds);
List<TicketInfoStatisticVO> ticketVOS = ticketInfoAllClient.getTicketReportStatistic(ticketStatisticDTO);
stationReportAllVo.setTicketInfoStatisticVOList(ticketVOS); stationReportAllVo.setTicketInfoStatisticVOList(ticketVOS);
} }
finally { finally {

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

@ -15,10 +15,7 @@ import org.springblade.core.tool.api.R;
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.GetMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.*; import java.util.*;
@ -37,9 +34,16 @@ public class TicketInfoAllClient implements ITicketInfoAllClient {
private final StandardTicketInfoServiceImpl standardTicketInfoService; private final StandardTicketInfoServiceImpl standardTicketInfoService;
private final IFirstWorkTicketService firstWorkTicketService; private final IFirstWorkTicketService firstWorkTicketService;
/**
* 统计站点统计月报-两票
* @return 两票统计对象
*/
@Override @Override
@GetMapping("/getTicketReportStatistic") @PostMapping("/getTicketReportStatistic")
public List<TicketInfoStatisticVO> getTicketReportStatistic(String startDate, String endDate, String deptIds) { public List<TicketInfoStatisticVO> getTicketReportStatistic(@RequestBody TicketStatisticDTO ticketStatisticDTO) {
String startDate = ticketStatisticDTO.getStartDate();
String endDate = ticketStatisticDTO.getEndDate();
String deptIds = ticketStatisticDTO.getDeptIds();
Assert.isTrue(StringUtil.isNoneBlank(deptIds),()->{ Assert.isTrue(StringUtil.isNoneBlank(deptIds),()->{
throw new ServiceException("站点统计月报工作票查询机构ID不能为空"); throw new ServiceException("站点统计月报工作票查询机构ID不能为空");
}); });
@ -62,14 +66,20 @@ public class TicketInfoAllClient implements ITicketInfoAllClient {
} }
@Override @Override
@GetMapping(DOUBLE_PASS_RATE) @PostMapping(DOUBLE_PASS_RATE)
public DoublePassRateVO getDoublePassRate(List<Long> depatList, LocalDateTime firstDateTime, LocalDateTime now) { public DoublePassRateVO getDoublePassRate(@RequestBody TicketStatisticDTO ticketStatisticDTO) {
return standardTicketInfoService.getDoublePassRate(depatList,firstDateTime,now); List<Long> depatList = ticketStatisticDTO.getDepatList();
LocalDateTime startTime = ticketStatisticDTO.getStartTime();
LocalDateTime endTime =ticketStatisticDTO.getEndTime();
return standardTicketInfoService.getDoublePassRate(depatList,startTime,endTime);
} }
@Override @Override
@GetMapping(DOUBLE_PASS_QUANTITY) @GetMapping(DOUBLE_PASS_QUANTITY)
public List<DoublePassVO> getDoublePassQuantity(Map<String, String> stationMap, LocalDateTime firstDateTime, LocalDateTime now) { public List<DoublePassVO> getDoublePassQuantity(@RequestBody TicketStatisticDTO ticketStatisticDTO) {
Map<String, String> stationMap = ticketStatisticDTO.getStationMap();
LocalDateTime firstDateTime = ticketStatisticDTO.getStartTime();
LocalDateTime now =ticketStatisticDTO.getEndTime();
return standardTicketInfoService.getDoublePassQuantity(stationMap,firstDateTime,now); return standardTicketInfoService.getDoublePassQuantity(stationMap,firstDateTime,now);
} }

Loading…
Cancel
Save