diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tcZz/controller/TcAqgController.java b/ruoyi-admin/src/main/java/com/ruoyi/tcZz/controller/TcAqgController.java index 72a4e059..81a3ae8c 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tcZz/controller/TcAqgController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tcZz/controller/TcAqgController.java @@ -2,6 +2,7 @@ package com.ruoyi.tcZz.controller; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.tcZz.domain.TcAqg; @@ -13,6 +14,8 @@ import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletResponse; +import java.io.File; +import java.io.FileInputStream; import java.util.List; /** @@ -99,7 +102,6 @@ public class TcAqgController extends BaseController { } - /** * 批量启用禁用 * @@ -109,8 +111,16 @@ public class TcAqgController extends BaseController { @ApiOperation("批量启用禁用") @GetMapping("/isStatus") - public AjaxResult isStatus(@RequestParam("isStatus") Integer isStatus,@RequestParam("ids") List ids) { - tcAqgService.updateByisStatus(isStatus,ids); + public AjaxResult isStatus(@RequestParam("isStatus") Integer isStatus, @RequestParam("ids") List ids) { + tcAqgService.updateByisStatus(isStatus, ids); return AjaxResult.success(); } + @ApiOperation("通用下载excel模板") + @PostMapping("/importTemplate") + public void importTemplate(HttpServletResponse response) + { + ExcelUtil util = new ExcelUtil(TcAqg.class); + util.importTemplateExcel(response, " 网络安全官"); + } + } diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/BaseEntity.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/BaseEntity.java index 8a490e7e..9463f4a9 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/BaseEntity.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/BaseEntity.java @@ -29,7 +29,7 @@ public class BaseEntity implements Serializable private String createBy; /** 创建时间 */ - @Excel(name = "创建时间", dateFormat = "yyyy-MM-dd") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @ApiModelProperty(value = "创建时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @@ -40,7 +40,6 @@ public class BaseEntity implements Serializable private String updateBy; /** 更新时间 */ - @Excel(name = "更新时间", dateFormat = "yyyy-MM-dd") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @ApiModelProperty(value = "更新时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")