From 0b9784035d6feb052b9f43e48608c1d19c040df2 Mon Sep 17 00:00:00 2001 From: tyty Date: Tue, 26 Sep 2023 14:08:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=A4=E7=A5=A8feign=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E7=BB=93=E6=9E=84=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ticket/allTicket/dto/TicketStatisticDTO.java | 15 ++++++++--- .../allTicket/fegin/ITicketInfoAllClient.java | 24 +++++------------ .../fegin/TicketInfoAllClientFallback.java | 8 +++--- .../census/service/impl/TargetServiceImpl.java | 13 ++++++++-- .../main/service/impl/HomePageServiceImpl.java | 19 +++++++++++--- .../main/service/impl/HomeServiceImpl.java | 25 +++++++++++++++--- .../impl/OperStationMonthReportServiceImpl.java | 22 +++++----------- .../allTicket/fegin/TicketInfoAllClient.java | 30 ++++++++++++++-------- 8 files changed, 95 insertions(+), 61 deletions(-) diff --git a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/allTicket/dto/TicketStatisticDTO.java b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/allTicket/dto/TicketStatisticDTO.java index 4378262..f5c46ae 100644 --- a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/allTicket/dto/TicketStatisticDTO.java +++ b/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; import com.fasterxml.jackson.annotation.JsonFormat; -import lombok.Builder; import lombok.Data; -import lombok.EqualsAndHashCode; import org.springblade.core.tool.utils.DateUtil; import org.springframework.format.annotation.DateTimeFormat; import java.io.Serializable; import java.time.LocalDateTime; +import java.util.List; +import java.util.Map; /** * @ClassName TicketStatisticDTO @@ -18,10 +18,11 @@ import java.time.LocalDateTime; * @Version 4.0 **/ @Data -@Builder -@EqualsAndHashCode public class TicketStatisticDTO implements Serializable { + /** + * 机构IDS 按逗号分隔 + */ private String deptIds; @JsonFormat(pattern = DateUtil.PATTERN_DATETIME) @@ -32,4 +33,10 @@ public class TicketStatisticDTO implements Serializable { @DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME) private LocalDateTime endTime; + private String startDate; + private String endDate; + + private Map stationMap; + private List depatList; + } diff --git a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/allTicket/fegin/ITicketInfoAllClient.java b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/allTicket/fegin/ITicketInfoAllClient.java index bb2971c..5d3c500 100644 --- a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/allTicket/fegin/ITicketInfoAllClient.java +++ b/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.springframework.cloud.openfeign.FeignClient; 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.RequestParam; -import java.time.LocalDateTime; import java.util.List; -import java.util.Map; /** * @author hx @@ -32,15 +31,10 @@ public interface ITicketInfoAllClient { /** * 统计站点统计月报-两票 - * @param startDate 开始时间 - * @param endDate 结束时间 - * @param deptIds 机构IDS 按逗号分隔 * @return 两票统计对象 */ - @GetMapping(GET_TICKET_REPORT_STATISTIC) - List getTicketReportStatistic(@RequestParam String startDate, - @RequestParam String endDate, - @RequestParam String deptIds); + @PostMapping(GET_TICKET_REPORT_STATISTIC) + List getTicketReportStatistic(@RequestBody TicketStatisticDTO ticketStatisticDTO ); /** * 根据ID更新票据状态为未完成 @@ -53,18 +47,14 @@ public interface ITicketInfoAllClient { /** * 根据归属机构获取双票率 */ - @GetMapping(API_PREFIX + DOUBLE_PASS_RATE) - DoublePassRateVO getDoublePassRate(@RequestParam(value = "depatList") List depatList, - @RequestParam(value = "firstDateTime") LocalDateTime firstDateTime, - @RequestParam(value = "now") LocalDateTime now); + @PostMapping(API_PREFIX + DOUBLE_PASS_RATE) + DoublePassRateVO getDoublePassRate(@RequestBody TicketStatisticDTO ticketStatisticDTO); /** * 根据归属机构获取双票率 */ - @GetMapping(API_PREFIX + DOUBLE_PASS_QUANTITY) - List getDoublePassQuantity(@RequestParam(value = "stationMap") Map stationMap, - @RequestParam(value = "firstDateTime") LocalDateTime firstDateTime, - @RequestParam(value = "now") LocalDateTime now); + @PostMapping(API_PREFIX + DOUBLE_PASS_QUANTITY) + List getDoublePassQuantity(@RequestBody TicketStatisticDTO ticketStatisticDTO); @GetMapping(GET_TICKET_PASS_RATE) R getTicketPassRate(TicketStatisticDTO ticketStatisticDTO); diff --git a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/allTicket/fegin/TicketInfoAllClientFallback.java b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/allTicket/fegin/TicketInfoAllClientFallback.java index 76506d0..5f38f8f 100644 --- a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/allTicket/fegin/TicketInfoAllClientFallback.java +++ b/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.springframework.stereotype.Component; -import java.time.LocalDateTime; import java.util.List; -import java.util.Map; /** * @author hx @@ -18,7 +16,7 @@ import java.util.Map; public class TicketInfoAllClientFallback implements ITicketInfoAllClient { @Override - public List getTicketReportStatistic(String startDate, String endDate, String deptIds) { + public List getTicketReportStatistic( TicketStatisticDTO ticketStatisticDTO) { return null; } @@ -28,12 +26,12 @@ public class TicketInfoAllClientFallback implements ITicketInfoAllClient { } @Override - public DoublePassRateVO getDoublePassRate(List depatList, LocalDateTime firstDateTime, LocalDateTime now) { + public DoublePassRateVO getDoublePassRate(TicketStatisticDTO ticketStatisticDTO) { return null; } @Override - public List getDoublePassQuantity(Map stationMap, LocalDateTime firstDateTime, LocalDateTime now) { + public List getDoublePassQuantity(TicketStatisticDTO ticketStatisticDTO) { return null; } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/impl/TargetServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/impl/TargetServiceImpl.java index 83aac67..8306bf4 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/impl/TargetServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/impl/TargetServiceImpl.java @@ -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.station.entity.StationEntity; 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.vo.DoublePassRateVO; import lombok.RequiredArgsConstructor; @@ -412,7 +413,11 @@ public class TargetServiceImpl implements TargetService { if(!StringUtil.isEmpty(areaName)){ 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(); if (ObjectUtil.isEmpty(doublePass)) { completeTicketVo.setAreaName(dept.getDeptName()); @@ -430,7 +435,11 @@ public class TargetServiceImpl implements TargetService { }else{ 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(); if (ObjectUtil.isEmpty(doublePass)) { completeTicketVo.setAreaName(dept.getDeptName()); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HomePageServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HomePageServiceImpl.java index c63a786..c64a2b2 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HomePageServiceImpl.java +++ b/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.station.entity.StationEntity; 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.vo.DoublePassRateVO; import com.hnac.hzims.ticket.allTicket.vo.DoublePassVO; @@ -331,7 +332,11 @@ public class HomePageServiceImpl implements IHomePageService { // 当月首日 LocalDate firstDay = LocalDate.now().withDayOfMonth(1); 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); 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)){ return "0.0"; } @@ -790,7 +799,11 @@ public class HomePageServiceImpl implements IHomePageService { exe.execute(() -> { LocalDate firstDay = LocalDate.now().withDayOfYear(1); 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)) { storageConservancyVo.setPassRate("0"); } else { diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HomeServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HomeServiceImpl.java index f047a22..eab19dd 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HomeServiceImpl.java +++ b/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.station.entity.StationEntity; 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.vo.DoublePassRateVO; import lombok.RequiredArgsConstructor; @@ -221,7 +222,11 @@ public class HomeServiceImpl implements HomeService { List 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)){ 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)){ target.setTaget_four(Double.valueOf(pass.getDoublePassRate())); } @@ -271,7 +276,11 @@ public class HomeServiceImpl implements HomeService { LocalDateTime firstDateTime = LocalDateTime.of(firstDay, LocalTime.MIN); R> result = sysClient.getDeptList(); List 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)) { target.setTaget_four(Double.valueOf(pass.getDoublePassRate())); } @@ -379,7 +388,11 @@ public class HomeServiceImpl implements HomeService { exe.execute(() -> { LocalDate firstDay = LocalDate.now().withDayOfYear(1); 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)) { target.setTaget_four(Double.valueOf(pass.getDoublePassRate())); } @@ -599,7 +612,11 @@ public class HomeServiceImpl implements HomeService { List 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)){ 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)){ target.setTaget_four(Double.valueOf(pass.getDoublePassRate())); } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/impl/OperStationMonthReportServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/impl/OperStationMonthReportServiceImpl.java index 1a455fa..a2ff283 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/impl/OperStationMonthReportServiceImpl.java +++ b/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; -import cn.afterturn.easypoi.excel.ExcelExportUtil; -import cn.afterturn.easypoi.excel.entity.TemplateExportParams; import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; 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.service.IMainSystemMonitoringService; 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.utils.ObjectHelper; import com.hnac.hzims.operational.report.vo.*; import com.hnac.hzims.operational.station.entity.StationEntity; import com.hnac.hzims.operational.station.service.IStationService; 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.vo.TicketInfoStatisticVO; 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.vo.TaskReportVO; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.apache.commons.io.FileUtils; 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.xssf.usermodel.*; 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.RequestContextHolder; import org.springframework.web.context.request.ServletRequestAttributes; -import org.springframework.web.multipart.MultipartFile; -import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletResponse; -import java.io.File; import java.io.IOException; import java.io.InputStream; import java.lang.reflect.Field; import java.math.BigDecimal; import java.math.RoundingMode; -import java.net.URLEncoder; -import java.text.SimpleDateFormat; import java.time.LocalDate; import java.time.LocalDateTime; import java.time.LocalTime; import java.time.YearMonth; import java.time.format.DateTimeFormatter; -import java.time.temporal.TemporalAdjusters; import java.util.*; import java.util.concurrent.CountDownLatch; import java.util.concurrent.ExecutorService; @@ -197,7 +183,11 @@ public class OperStationMonthReportServiceImpl implements IOperStationMonthRepor pool.execute(() -> { try { String deptIds = deptIdList.stream().map(deptId -> deptId.toString()).collect(Collectors.joining(",")); - List 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 ticketVOS = ticketInfoAllClient.getTicketReportStatistic(ticketStatisticDTO); stationReportAllVo.setTicketInfoStatisticVOList(ticketVOS); } finally { diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/allTicket/fegin/TicketInfoAllClient.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/allTicket/fegin/TicketInfoAllClient.java index 5b93bba..878cd812 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/allTicket/fegin/TicketInfoAllClient.java +++ b/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.springframework.transaction.annotation.Transactional; import org.springframework.util.Assert; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import java.time.LocalDateTime; import java.util.*; @@ -37,9 +34,16 @@ public class TicketInfoAllClient implements ITicketInfoAllClient { private final StandardTicketInfoServiceImpl standardTicketInfoService; private final IFirstWorkTicketService firstWorkTicketService; + /** + * 统计站点统计月报-两票 + * @return 两票统计对象 + */ @Override - @GetMapping("/getTicketReportStatistic") - public List getTicketReportStatistic(String startDate, String endDate, String deptIds) { + @PostMapping("/getTicketReportStatistic") + public List getTicketReportStatistic(@RequestBody TicketStatisticDTO ticketStatisticDTO) { + String startDate = ticketStatisticDTO.getStartDate(); + String endDate = ticketStatisticDTO.getEndDate(); + String deptIds = ticketStatisticDTO.getDeptIds(); Assert.isTrue(StringUtil.isNoneBlank(deptIds),()->{ throw new ServiceException("站点统计月报工作票查询机构ID不能为空"); }); @@ -62,14 +66,20 @@ public class TicketInfoAllClient implements ITicketInfoAllClient { } @Override - @GetMapping(DOUBLE_PASS_RATE) - public DoublePassRateVO getDoublePassRate(List depatList, LocalDateTime firstDateTime, LocalDateTime now) { - return standardTicketInfoService.getDoublePassRate(depatList,firstDateTime,now); + @PostMapping(DOUBLE_PASS_RATE) + public DoublePassRateVO getDoublePassRate(@RequestBody TicketStatisticDTO ticketStatisticDTO) { + List depatList = ticketStatisticDTO.getDepatList(); + LocalDateTime startTime = ticketStatisticDTO.getStartTime(); + LocalDateTime endTime =ticketStatisticDTO.getEndTime(); + return standardTicketInfoService.getDoublePassRate(depatList,startTime,endTime); } @Override @GetMapping(DOUBLE_PASS_QUANTITY) - public List getDoublePassQuantity(Map stationMap, LocalDateTime firstDateTime, LocalDateTime now) { + public List getDoublePassQuantity(@RequestBody TicketStatisticDTO ticketStatisticDTO) { + Map stationMap = ticketStatisticDTO.getStationMap(); + LocalDateTime firstDateTime = ticketStatisticDTO.getStartTime(); + LocalDateTime now =ticketStatisticDTO.getEndTime(); return standardTicketInfoService.getDoublePassQuantity(stationMap,firstDateTime,now); }