From dfc6e608bea375e2678ae83e67dcdd6b1739a588 Mon Sep 17 00:00:00 2001 From: wsm <2746563060@qq.com> Date: Fri, 31 Jul 2026 09:25:15 +0800 Subject: [PATCH] =?UTF-8?q?feat(fixcontact):=20=E6=96=B0=E5=A2=9EEasyExcel?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E5=AF=BC=E5=85=A5=E5=AF=BC=E5=87=BA=E5=8F=8A?= =?UTF-8?q?=E6=A0=A1=E9=AA=8C=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Controller 新增 importExcelByEasyExcel/checkExcelByEasyExcel/exportXlsHeaders 三个接口, Entity 新增 @ExcelColumn 注解以支持 EasyExcel 导入导出。 --- .../FixedContact20260730Controller.java | 29 +++++++++++++++++++ .../entity/FixedContact20260730.java | 15 ++++++++++ 2 files changed, 44 insertions(+) diff --git a/jeecg-module-supervision/src/main/java/org/jeecg/modules/bg/fixcontact/controller/FixedContact20260730Controller.java b/jeecg-module-supervision/src/main/java/org/jeecg/modules/bg/fixcontact/controller/FixedContact20260730Controller.java index 5d287c5..6cb8cef 100644 --- a/jeecg-module-supervision/src/main/java/org/jeecg/modules/bg/fixcontact/controller/FixedContact20260730Controller.java +++ b/jeecg-module-supervision/src/main/java/org/jeecg/modules/bg/fixcontact/controller/FixedContact20260730Controller.java @@ -1,6 +1,7 @@ package org.jeecg.modules.bg.fixcontact.controller; import java.util.*; +import java.io.IOException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -13,6 +14,9 @@ import org.jeecg.common.api.vo.Result; import org.jeecg.common.aspect.annotation.AutoLog; import org.jeecg.common.system.base.controller.JeecgController; import org.jeecg.common.system.query.QueryGenerator; +import org.jeecg.common.util.excel.ExcelAnnotationUtils; +import org.jeecg.modules.bg.constant.BpmStatus; +import org.jeecg.modules.bg.constant.SupervisionConstant; import org.jeecg.modules.bg.fixcontact.entity.FixedContact20260730; import org.jeecg.modules.bg.fixcontact.entity.FixedContactFeedback20260730; import org.jeecg.modules.bg.fixcontact.service.IFixedContact20260730Service; @@ -134,6 +138,31 @@ public class FixedContact20260730Controller extends JeecgController importExcelByEasyExcel(HttpServletRequest request) { + return super.importExcelByEasyExcel(request, FixedContact20260730.class, + Map.of( + SupervisionConstant.ClassFieldName.BPM_STATUS_NAME, + BpmStatus.NOT_START.getCode(), + SupervisionConstant.ClassFieldName.DEL_FLAG_NAME, + SupervisionConstant.DelFlag.NORMAL)); + } + + @RequiresPermissions("bg.fixcontact:fixed_contact_20260730:importExcel") + @RequestMapping(value = "/checkExcelByEasyExcel", method = RequestMethod.POST) + public Result checkExcelByEasyExcel(HttpServletRequest request) { + return super.checkExcelByEasyExcel(request, FixedContact20260730.class); + } + + @RequiresPermissions("bg.fixcontact:fixed_contact_20260730:exportXls") + @GetMapping(value = "/exportXlsHeaders") + public void exportXlsHeaders(HttpServletResponse response) throws IOException { + FixedContact20260730 example = ExcelAnnotationUtils.buildExample(FixedContact20260730.class); + super.exportXlsWithData(response, FixedContact20260730.class, "定点联系单", + java.util.Collections.singletonList(example)); + } + @AutoLog(value = "保存业务数据同时更新流程变量jsonData") @Operation(summary = "保存业务数据同时更新流程变量jsonData") @PostMapping(value = "/saveBpmForm") diff --git a/jeecg-module-supervision/src/main/java/org/jeecg/modules/bg/fixcontact/entity/FixedContact20260730.java b/jeecg-module-supervision/src/main/java/org/jeecg/modules/bg/fixcontact/entity/FixedContact20260730.java index 9ada4a8..c5e89c9 100644 --- a/jeecg-module-supervision/src/main/java/org/jeecg/modules/bg/fixcontact/entity/FixedContact20260730.java +++ b/jeecg-module-supervision/src/main/java/org/jeecg/modules/bg/fixcontact/entity/FixedContact20260730.java @@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.annotation.TableName; import com.fasterxml.jackson.annotation.JsonFormat; import org.springframework.format.annotation.DateTimeFormat; import org.jeecgframework.poi.excel.annotation.Excel; +import org.jeecg.common.util.excel.annotation.ExcelColumn; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; @@ -46,66 +47,80 @@ public class FixedContact20260730 implements Serializable { private java.lang.String sysOrgCode; @Excel(name = "序号", width = 15) + @ExcelColumn(name = "序号", width = 15) @Schema(description = "序号") private java.lang.String seqNo; @Excel(name = "表单编号", width = 15) + @ExcelColumn(name = "表单编号", width = 15) @Schema(description = "表单编号") private java.lang.String formNo; @Excel(name = "定点联系所领导", width = 15) + @ExcelColumn(name = "定点联系所领导", width = 15, dictTable = "sys_user", dicText = "realname", dicCode = "username") @Dict(dictTable = "sys_user", dicText = "realname", dicCode = "username") @Schema(description = "定点联系所领导") private java.lang.String contactLeader; @Excel(name = "联系单位(部门)", width = 15) + @ExcelColumn(name = "联系单位(部门)", width = 15, dictTable = "sys_depart", dicText = "depart_name", dicCode = "id") @Dict(dictTable = "sys_depart", dicText = "depart_name", dicCode = "id") @Schema(description = "联系单位(部门)") private java.lang.String contactDept; @Excel(name = "联系时间", width = 15, format = "yyyy-MM-dd") + @ExcelColumn(name = "联系时间", width = 15, format = "yyyy-MM-dd") @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") @DateTimeFormat(pattern = "yyyy-MM-dd") @Schema(description = "联系时间") private java.util.Date contactTime; @Excel(name = "座谈地点", width = 15) + @ExcelColumn(name = "座谈地点", width = 15) @Schema(description = "座谈地点") private java.lang.String meetingPlace; @Excel(name = "联系点建议诉求摘要", width = 30) + @ExcelColumn(name = "联系点建议诉求摘要", width = 30) @Schema(description = "联系点建议诉求摘要") private java.lang.String suggestionSummary; @Excel(name = "定点联系所领导审批意见", width = 30) + @ExcelColumn(name = "定点联系所领导审批意见", width = 30) @Schema(description = "定点联系所领导审批意见") private java.lang.String leaderOpinion; @Excel(name = "相关分管所领导批示意见", width = 30) + @ExcelColumn(name = "相关分管所领导批示意见", width = 30) @Schema(description = "相关分管所领导批示意见") private java.lang.String relatedLeaderOpinion; @Excel(name = "相关分管所领导", width = 15) + @ExcelColumn(name = "相关分管所领导", width = 15, dictTable = "sys_user", dicText = "realname", dicCode = "username") @Dict(dictTable = "sys_user", dicText = "realname", dicCode = "username") @Schema(description = "相关分管所领导") private java.lang.String relatedLeader; @Excel(name = "申请人", width = 15) + @ExcelColumn(name = "申请人", width = 15, dictTable = "sys_user", dicText = "realname", dicCode = "username") @Dict(dictTable = "sys_user", dicText = "realname", dicCode = "username") @Schema(description = "申请人") private java.lang.String applicant; @Excel(name = "主办部门", width = 15) + @ExcelColumn(name = "主办部门", width = 15, dictTable = "sys_depart", dicText = "depart_name", dicCode = "id") @Dict(dictTable = "sys_depart", dicText = "depart_name", dicCode = "id") @Schema(description = "主办部门") private java.lang.String hostDept; @Excel(name = "协办部门", width = 15) + @ExcelColumn(name = "协办部门", width = 15, dictTable = "sys_depart", dicText = "depart_name", dicCode = "id") @Dict(dictTable = "sys_depart", dicText = "depart_name", dicCode = "id") @Schema(description = "协办部门") private java.lang.String coDept; @Excel(name = "督办次数", width = 15) + @ExcelColumn(name = "督办次数", width = 15) @Schema(description = "督办次数") private java.lang.Integer superviseCount;