|
|
|
@ -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<TicketCountMapper, T
|
|
|
|
|
/** |
|
|
|
|
* 两票统计分析导出 |
|
|
|
|
* |
|
|
|
|
* @param dateTime |
|
|
|
|
* @param response |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
public void exportTicketCount(HttpServletResponse response) { |
|
|
|
|
public void exportTicketCount(String dateTime, HttpServletResponse response) { |
|
|
|
|
String fileName = URLEncoder.encode("两票月报分析统计报表.xlsx"); |
|
|
|
|
response.setHeader("Content-Disposition", "attachment; filename=" + fileName); |
|
|
|
|
response.setContentType("application/vnd.ms-excel;charset=utf-8"); |
|
|
|
|
response.setCharacterEncoding("utf-8"); |
|
|
|
|
List<TicketCount> ticketCounts = baseMapper.selectList(null); |
|
|
|
|
LambdaQueryWrapper<TicketCount> queryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
queryWrapper.eq(TicketCount::getDateTime, dateTime); |
|
|
|
|
List<TicketCount> ticketCounts = baseMapper.selectList(queryWrapper); |
|
|
|
|
List<TicketCountResponseVo> countResponseList = getTicketCountResponseList(ticketCounts); |
|
|
|
|
//导出
|
|
|
|
|
//内容样式策略
|
|
|
|
@ -304,7 +301,7 @@ public class TicketCountServiceImpl extends BaseServiceImpl<TicketCountMapper, T
|
|
|
|
|
*/ |
|
|
|
|
private List<TicketCount> getStandardTicketCountList(List<Long> createDept, List<TicketCount> items, String ticketType, String dateTime, BladeUser user) { |
|
|
|
|
List<StandardTicketInfoEntity> 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<TicketCountMapper, T
|
|
|
|
|
String dateTime, |
|
|
|
|
BladeUser user) { |
|
|
|
|
List<WorkTicketInfoEntity> ticketInfoEntities = |
|
|
|
|
workTicketInfoService.selectTicketByDeptIdWithTicketType(createDept, ticketType,dateTime); |
|
|
|
|
workTicketInfoService.selectTicketByDeptIdWithTicketType(createDept, ticketType, dateTime); |
|
|
|
|
if (CollectionUtils.isEmpty(ticketInfoEntities)) { |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|