From 98655b3923baf72b25006b4123191adbadf540c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AE=B5=E9=A3=9E=E5=AE=87?= <2684146481@qq.com> Date: Mon, 10 Jul 2023 08:43:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=A4=E7=A5=A8=E7=94=9F=E6=88=90=E6=9C=88?= =?UTF-8?q?=E6=8A=A5=E5=AF=BC=E5=87=BA=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../twoTicket/controller/TicketCountController.java | 5 +++-- .../ticket/twoTicket/service/TicketCountService.java | 8 +++----- .../twoTicket/service/impl/TicketCountServiceImpl.java | 17 +++++++---------- 3 files changed, 13 insertions(+), 17 deletions(-) diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/controller/TicketCountController.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/controller/TicketCountController.java index 202bb4e..f757ac2 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/controller/TicketCountController.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/controller/TicketCountController.java @@ -53,10 +53,11 @@ public class TicketCountController { /** * 两票统计分析导出 + * @param dateTime 月份 */ @GetMapping("/export") - public R export(HttpServletResponse response) { - ticketCountService.exportTicketCount(response); + public R export(String dateTime, HttpServletResponse response) { + ticketCountService.exportTicketCount(dateTime,response); return R.success("导出成功"); } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/TicketCountService.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/TicketCountService.java index 5838b40..02f9562 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/TicketCountService.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/TicketCountService.java @@ -1,15 +1,11 @@ package com.hnac.hzims.ticket.twoTicket.service; -import cn.hutool.http.server.HttpServerResponse; -import com.baomidou.mybatisplus.extension.service.IService; import com.hnac.hzims.ticket.twoTicket.entity.TicketCount; -import com.hnac.hzims.ticket.twoTicket.entity.TicketInfoDanger; import com.hnac.hzims.ticket.twoTicket.vo.ticket.TicketCountResponseVo; import com.hnac.hzims.ticket.twoTicket.vo.ticket.TicketCountVo; import org.springblade.core.mp.base.BaseService; import javax.servlet.http.HttpServletResponse; -import java.time.YearMonth; import java.util.List; /** @@ -35,7 +31,9 @@ public interface TicketCountService extends BaseService { /** * 两票统计分析导出 + * + * @param dateTime * @param response */ - void exportTicketCount(HttpServletResponse response); + void exportTicketCount(String dateTime, HttpServletResponse response); } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketCountServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketCountServiceImpl.java index 0003eaa..4594890 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketCountServiceImpl.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketCountServiceImpl.java @@ -1,15 +1,11 @@ package com.hnac.hzims.ticket.twoTicket.service.impl; -import cn.hutool.http.server.HttpServerResponse; import com.alibaba.excel.EasyExcel; import com.alibaba.excel.support.ExcelTypeEnum; import com.alibaba.excel.write.metadata.style.WriteCellStyle; -import com.alibaba.excel.write.metadata.style.WriteFont; import com.alibaba.excel.write.style.HorizontalCellStyleStrategy; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.toolkit.IdWorker; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.hnac.hzims.common.logs.utils.StringUtils; import com.hnac.hzims.ticket.allTicket.entity.TicketInfoEvaluateEntity; import com.hnac.hzims.ticket.allTicket.service.TicketInfoEvaluateService; @@ -41,9 +37,7 @@ import org.springblade.system.user.feign.IUserClient; import org.springframework.stereotype.Service; import javax.servlet.http.HttpServletResponse; -import java.io.FileOutputStream; import java.io.IOException; -import java.io.OutputStream; import java.net.URLEncoder; import java.text.SimpleDateFormat; import java.util.*; @@ -158,15 +152,18 @@ public class TicketCountServiceImpl extends BaseServiceImpl ticketCounts = baseMapper.selectList(null); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(TicketCount::getDateTime, dateTime); + List ticketCounts = baseMapper.selectList(queryWrapper); List countResponseList = getTicketCountResponseList(ticketCounts); //导出 //内容样式策略 @@ -304,7 +301,7 @@ public class TicketCountServiceImpl extends BaseServiceImpl getStandardTicketCountList(List createDept, List items, String ticketType, String dateTime, BladeUser user) { List ticketInfoEntities = - standardTicketInfoService.selectStandardTicketByDeptIdWithTicketType(createDept, ticketType,dateTime); + standardTicketInfoService.selectStandardTicketByDeptIdWithTicketType(createDept, ticketType, dateTime); if (CollectionUtils.isEmpty(ticketInfoEntities)) { return null; } @@ -371,7 +368,7 @@ public class TicketCountServiceImpl extends BaseServiceImpl ticketInfoEntities = - workTicketInfoService.selectTicketByDeptIdWithTicketType(createDept, ticketType,dateTime); + workTicketInfoService.selectTicketByDeptIdWithTicketType(createDept, ticketType, dateTime); if (CollectionUtils.isEmpty(ticketInfoEntities)) { return null; }