| 
						
						
						
					 | 
				
				 | 
				
					@ -1,18 +1,34 @@ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					package com.epmet.controller; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.alibaba.excel.EasyExcel; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.alibaba.excel.ExcelWriter; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.alibaba.excel.write.metadata.WriteSheet; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.annotation.LoginUser; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.annotation.MaskResponse; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.aop.NoRepeatSubmit; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.constant.NumConstant; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.page.PageData; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.security.dto.TokenDto; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.utils.DateUtils; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.utils.ExcelUtils; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.utils.Result; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.utils.poi.excel.handler.FreezeAndFilter; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.dto.IcNatCompareRecordDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.dto.IcTripReportRecordDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.dto.form.PageTripReportFormDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.dto.form.yqfk.IcNatCompareRecordPageFormDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.service.IcNatCompareRecordService; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import lombok.extern.slf4j.Slf4j; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import org.apache.commons.collections4.CollectionUtils; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import org.springframework.beans.factory.annotation.Autowired; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import org.springframework.web.bind.annotation.PostMapping; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import org.springframework.web.bind.annotation.RequestBody; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import org.springframework.web.bind.annotation.RequestMapping; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import org.springframework.web.bind.annotation.RestController; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import javax.servlet.http.HttpServletResponse; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import java.util.Date; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					/** | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					 * 核算比对记录 | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -20,6 +36,7 @@ import org.springframework.web.bind.annotation.RestController; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					 * @author generator generator@elink-cn.com | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					 * @since v1.0.0 2022-09-26 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					 */ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					@Slf4j | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					@RestController | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					@RequestMapping("icNatCompareRecord") | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					public class IcNatCompareRecordController { | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -42,7 +59,45 @@ public class IcNatCompareRecordController { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        return new Result<PageData<IcNatCompareRecordDTO>>().ok(page); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    /** | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     * pc:行程上报-导出 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     * @param tokenDto | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     * @param formDTO | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     * @param response | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     */ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @NoRepeatSubmit | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @PostMapping("export") | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    public void export(@LoginUser TokenDto tokenDto, @RequestBody PageTripReportFormDTO formDTO, HttpServletResponse response) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        formDTO.setCustomerId(tokenDto.getCustomerId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        formDTO.setUserId(tokenDto.getUserId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        // formDTO.setCustomerId("45687aa479955f9d06204d415238f7cc");
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        // formDTO.setUserId("35005df15fb0f7c791344f0b424870b7");
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        formDTO.setIsPage(false); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        ExcelWriter excelWriter = null; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        formDTO.setPageSize(NumConstant.TEN_THOUSAND); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        int pageNo = formDTO.getPageNo(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        try { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            // 这里 需要指定写用哪个class去写
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            String today= DateUtils.format(new Date(),DateUtils.DATE_PATTERN_MMDD); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            String fileName = "行程上报信息".concat(today); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel(fileName, response), IcTripReportRecordDTO.class).build(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            WriteSheet writeSheet = EasyExcel.writerSheet("Sheet1").registerWriteHandler(new FreezeAndFilter()).build(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            PageData<IcTripReportRecordDTO> data = null; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            do { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                // data = icTripReportRecordService.page(formDTO);
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                formDTO.setPageNo(++pageNo); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                excelWriter.write(data.getList(), writeSheet); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } while (CollectionUtils.isNotEmpty(data.getList()) && data.getList().size() == formDTO.getPageSize()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } catch (Exception e) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            log.error("export exception", e); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } finally { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            // 千万别忘记finish 会帮忙关闭流
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (excelWriter != null) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                excelWriter.finish(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					} | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
					 | 
				
				 | 
				
					
  |