|
@ -11,12 +11,15 @@ import org.dromara.platform.domain.PerformanceManagement; |
|
|
import org.dromara.platform.domain.PointInfo; |
|
|
import org.dromara.platform.domain.PointInfo; |
|
|
import org.dromara.platform.domain.bo.PerformanceManagementBo; |
|
|
import org.dromara.platform.domain.bo.PerformanceManagementBo; |
|
|
import org.dromara.platform.domain.bo.PointInfoBo; |
|
|
import org.dromara.platform.domain.bo.PointInfoBo; |
|
|
|
|
|
import org.dromara.platform.domain.bo.WorkOrderInfoBo; |
|
|
import org.dromara.platform.domain.vo.PerformanceManagementVo; |
|
|
import org.dromara.platform.domain.vo.PerformanceManagementVo; |
|
|
import org.dromara.platform.domain.vo.PointInfoVo; |
|
|
import org.dromara.platform.domain.vo.PointInfoVo; |
|
|
|
|
|
import org.dromara.platform.domain.vo.WorkOrderInfoVo; |
|
|
import org.dromara.platform.listener.PerformanceManagementListener; |
|
|
import org.dromara.platform.listener.PerformanceManagementListener; |
|
|
import org.dromara.platform.listener.PointInfoListener; |
|
|
import org.dromara.platform.listener.PointInfoListener; |
|
|
import org.dromara.platform.service.IPointInfoService; |
|
|
import org.dromara.platform.service.IPointInfoService; |
|
|
import org.dromara.platform.service.IProjectInfoService; |
|
|
import org.dromara.platform.service.IProjectInfoService; |
|
|
|
|
|
import org.dromara.platform.service.IWorkOrderInfoService; |
|
|
import org.dromara.platform.service.ProjectManagerService; |
|
|
import org.dromara.platform.service.ProjectManagerService; |
|
|
import org.springframework.validation.annotation.Validated; |
|
|
import org.springframework.validation.annotation.Validated; |
|
|
import org.springframework.web.bind.annotation.PostMapping; |
|
|
import org.springframework.web.bind.annotation.PostMapping; |
|
@ -37,6 +40,9 @@ import java.util.List; |
|
|
public class ExcelController { |
|
|
public class ExcelController { |
|
|
@Resource |
|
|
@Resource |
|
|
private IPointInfoService pointInfoService ; |
|
|
private IPointInfoService pointInfoService ; |
|
|
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
|
private IWorkOrderInfoService workOrderInfoService ; |
|
|
@PostMapping("/uploadPointInfo") |
|
|
@PostMapping("/uploadPointInfo") |
|
|
public void uploadPointInfo(MultipartFile file, HttpServletResponse response) throws IOException { |
|
|
public void uploadPointInfo(MultipartFile file, HttpServletResponse response) throws IOException { |
|
|
long t1 = System.currentTimeMillis(); |
|
|
long t1 = System.currentTimeMillis(); |
|
@ -68,4 +74,21 @@ public class ExcelController { |
|
|
.sheet("点位信息"+currentDate) |
|
|
.sheet("点位信息"+currentDate) |
|
|
.doWrite(list); |
|
|
.doWrite(list); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("/ExportWorkOrderInfo") |
|
|
|
|
|
public void ExportWorkOrderInfo(WorkOrderInfoBo bo, HttpServletResponse response) throws IOException { |
|
|
|
|
|
List<WorkOrderInfoVo> list = workOrderInfoService.queryList(bo); |
|
|
|
|
|
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); |
|
|
|
|
|
response.setCharacterEncoding("utf-8"); |
|
|
|
|
|
String flag = "工单信息"; |
|
|
|
|
|
// 这里URLEncoder.encode可以防止中文乱码 当然和easyexcel没有关系
|
|
|
|
|
|
LocalDate currentDate = LocalDate.now(); |
|
|
|
|
|
System.out.println("当前日期: " + currentDate); |
|
|
|
|
|
String fileName = URLEncoder.encode( flag+currentDate, "UTF-8") |
|
|
|
|
|
.replaceAll("\\+", "%20"); |
|
|
|
|
|
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx"); |
|
|
|
|
|
EasyExcel.write(response.getOutputStream(), WorkOrderInfoVo.class) |
|
|
|
|
|
.sheet("工单信息"+currentDate) |
|
|
|
|
|
.doWrite(list); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|