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();