feat(fixcontact): 新增EasyExcel模板导入导出及校验接口

Controller 新增 importExcelByEasyExcel/checkExcelByEasyExcel/exportXlsHeaders 三个接口,
Entity 新增 @ExcelColumn 注解以支持 EasyExcel 导入导出。
This commit is contained in:
wsm
2026-07-31 09:25:15 +08:00
parent 3f10b19af3
commit dfc6e608be
2 changed files with 44 additions and 0 deletions
@@ -1,6 +1,7 @@
package org.jeecg.modules.bg.fixcontact.controller; package org.jeecg.modules.bg.fixcontact.controller;
import java.util.*; import java.util.*;
import java.io.IOException;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; 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.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController; import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator; 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.FixedContact20260730;
import org.jeecg.modules.bg.fixcontact.entity.FixedContactFeedback20260730; import org.jeecg.modules.bg.fixcontact.entity.FixedContactFeedback20260730;
import org.jeecg.modules.bg.fixcontact.service.IFixedContact20260730Service; import org.jeecg.modules.bg.fixcontact.service.IFixedContact20260730Service;
@@ -134,6 +138,31 @@ public class FixedContact20260730Controller extends JeecgController<FixedContact
return super.importExcel(request, response, FixedContact20260730.class); return super.importExcel(request, response, FixedContact20260730.class);
} }
@RequiresPermissions("bg.fixcontact:fixed_contact_20260730:importExcel")
@RequestMapping(value = "/importExcelByEasyExcel", method = RequestMethod.POST)
public Result<?> 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") @AutoLog(value = "保存业务数据同时更新流程变量jsonData")
@Operation(summary = "保存业务数据同时更新流程变量jsonData") @Operation(summary = "保存业务数据同时更新流程变量jsonData")
@PostMapping(value = "/saveBpmForm") @PostMapping(value = "/saveBpmForm")
@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel; import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.util.excel.annotation.ExcelColumn;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
@@ -46,66 +47,80 @@ public class FixedContact20260730 implements Serializable {
private java.lang.String sysOrgCode; private java.lang.String sysOrgCode;
@Excel(name = "序号", width = 15) @Excel(name = "序号", width = 15)
@ExcelColumn(name = "序号", width = 15)
@Schema(description = "序号") @Schema(description = "序号")
private java.lang.String seqNo; private java.lang.String seqNo;
@Excel(name = "表单编号", width = 15) @Excel(name = "表单编号", width = 15)
@ExcelColumn(name = "表单编号", width = 15)
@Schema(description = "表单编号") @Schema(description = "表单编号")
private java.lang.String formNo; private java.lang.String formNo;
@Excel(name = "定点联系所领导", width = 15) @Excel(name = "定点联系所领导", width = 15)
@ExcelColumn(name = "定点联系所领导", width = 15, dictTable = "sys_user", dicText = "realname", dicCode = "username")
@Dict(dictTable = "sys_user", dicText = "realname", dicCode = "username") @Dict(dictTable = "sys_user", dicText = "realname", dicCode = "username")
@Schema(description = "定点联系所领导") @Schema(description = "定点联系所领导")
private java.lang.String contactLeader; private java.lang.String contactLeader;
@Excel(name = "联系单位(部门)", width = 15) @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") @Dict(dictTable = "sys_depart", dicText = "depart_name", dicCode = "id")
@Schema(description = "联系单位(部门)") @Schema(description = "联系单位(部门)")
private java.lang.String contactDept; private java.lang.String contactDept;
@Excel(name = "联系时间", width = 15, format = "yyyy-MM-dd") @Excel(name = "联系时间", width = 15, format = "yyyy-MM-dd")
@ExcelColumn(name = "联系时间", width = 15, format = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd") @DateTimeFormat(pattern = "yyyy-MM-dd")
@Schema(description = "联系时间") @Schema(description = "联系时间")
private java.util.Date contactTime; private java.util.Date contactTime;
@Excel(name = "座谈地点", width = 15) @Excel(name = "座谈地点", width = 15)
@ExcelColumn(name = "座谈地点", width = 15)
@Schema(description = "座谈地点") @Schema(description = "座谈地点")
private java.lang.String meetingPlace; private java.lang.String meetingPlace;
@Excel(name = "联系点建议诉求摘要", width = 30) @Excel(name = "联系点建议诉求摘要", width = 30)
@ExcelColumn(name = "联系点建议诉求摘要", width = 30)
@Schema(description = "联系点建议诉求摘要") @Schema(description = "联系点建议诉求摘要")
private java.lang.String suggestionSummary; private java.lang.String suggestionSummary;
@Excel(name = "定点联系所领导审批意见", width = 30) @Excel(name = "定点联系所领导审批意见", width = 30)
@ExcelColumn(name = "定点联系所领导审批意见", width = 30)
@Schema(description = "定点联系所领导审批意见") @Schema(description = "定点联系所领导审批意见")
private java.lang.String leaderOpinion; private java.lang.String leaderOpinion;
@Excel(name = "相关分管所领导批示意见", width = 30) @Excel(name = "相关分管所领导批示意见", width = 30)
@ExcelColumn(name = "相关分管所领导批示意见", width = 30)
@Schema(description = "相关分管所领导批示意见") @Schema(description = "相关分管所领导批示意见")
private java.lang.String relatedLeaderOpinion; private java.lang.String relatedLeaderOpinion;
@Excel(name = "相关分管所领导", width = 15) @Excel(name = "相关分管所领导", width = 15)
@ExcelColumn(name = "相关分管所领导", width = 15, dictTable = "sys_user", dicText = "realname", dicCode = "username")
@Dict(dictTable = "sys_user", dicText = "realname", dicCode = "username") @Dict(dictTable = "sys_user", dicText = "realname", dicCode = "username")
@Schema(description = "相关分管所领导") @Schema(description = "相关分管所领导")
private java.lang.String relatedLeader; private java.lang.String relatedLeader;
@Excel(name = "申请人", width = 15) @Excel(name = "申请人", width = 15)
@ExcelColumn(name = "申请人", width = 15, dictTable = "sys_user", dicText = "realname", dicCode = "username")
@Dict(dictTable = "sys_user", dicText = "realname", dicCode = "username") @Dict(dictTable = "sys_user", dicText = "realname", dicCode = "username")
@Schema(description = "申请人") @Schema(description = "申请人")
private java.lang.String applicant; private java.lang.String applicant;
@Excel(name = "主办部门", width = 15) @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") @Dict(dictTable = "sys_depart", dicText = "depart_name", dicCode = "id")
@Schema(description = "主办部门") @Schema(description = "主办部门")
private java.lang.String hostDept; private java.lang.String hostDept;
@Excel(name = "协办部门", width = 15) @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") @Dict(dictTable = "sys_depart", dicText = "depart_name", dicCode = "id")
@Schema(description = "协办部门") @Schema(description = "协办部门")
private java.lang.String coDept; private java.lang.String coDept;
@Excel(name = "督办次数", width = 15) @Excel(name = "督办次数", width = 15)
@ExcelColumn(name = "督办次数", width = 15)
@Schema(description = "督办次数") @Schema(description = "督办次数")
private java.lang.Integer superviseCount; private java.lang.Integer superviseCount;