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