From 2d032a5d39231df096583c575f2a8cd6b56a8e45 Mon Sep 17 00:00:00 2001 From: tyty Date: Tue, 4 Jul 2023 08:47:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=92=E7=8F=AD=E8=AE=A1=E5=88=92=E5=AF=BC?= =?UTF-8?q?=E5=87=BA=EF=BC=8C=E5=85=A5=E5=8F=82=E6=A0=BC=E5=BC=8F=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../duty/controller/ImsDutyMainController.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/controller/ImsDutyMainController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/controller/ImsDutyMainController.java index 7ec8515..5382e24 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/controller/ImsDutyMainController.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/controller/ImsDutyMainController.java @@ -1,7 +1,6 @@ package com.hnac.hzims.operational.duty.controller; import com.alibaba.excel.EasyExcel; -import com.alibaba.excel.util.DateUtils; import com.baomidou.mybatisplus.core.metadata.IPage; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.hnac.hzims.common.logs.annotation.OperationAnnotation; @@ -32,7 +31,6 @@ import javax.validation.Valid; import java.io.IOException; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; -import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -220,10 +218,21 @@ public class ImsDutyMainController extends BladeController { @GetMapping("/exportDuty") @ApiOperation(value = "导出排班计划") - public void exportTemplate(HttpServletResponse response, Integer year, Integer month, Long deptId) throws IOException { + public void exportTemplate(HttpServletResponse response, String time, Long deptId) throws IOException { + Integer year; + Integer month; if (Func.isEmpty(deptId)) { deptId = Long.valueOf(AuthUtil.getDeptId()); } + if (Func.isEmpty(time)) { + Date date = new Date(); + year = date.getYear(); + month = date.getMonth()+1; + }else { + String[] split = time.split("-"); + year=Integer.valueOf(split[0]); + month=Integer.valueOf(split[1]); + } List list = imsDutyMainService.getExcelDutyData(year, month, deptId); String deptName = sysClient.getDeptName(deptId).getData();