diff --git a/src/main/java/com/gxwebsoft/credit/controller/CreditBreachOfTrustController.java b/src/main/java/com/gxwebsoft/credit/controller/CreditBreachOfTrustController.java index 41b86b6..79699d7 100644 --- a/src/main/java/com/gxwebsoft/credit/controller/CreditBreachOfTrustController.java +++ b/src/main/java/com/gxwebsoft/credit/controller/CreditBreachOfTrustController.java @@ -7,7 +7,7 @@ import com.gxwebsoft.common.core.web.BatchParam; import com.gxwebsoft.common.core.web.PageResult; import com.gxwebsoft.common.system.entity.User; import com.gxwebsoft.credit.entity.CreditBreachOfTrust; -import com.gxwebsoft.credit.param.CreditJudicialImportParam; +import com.gxwebsoft.credit.param.CreditBreachOfTrustImportParam; import com.gxwebsoft.credit.param.CreditBreachOfTrustParam; import com.gxwebsoft.credit.service.CreditBreachOfTrustService; import io.swagger.v3.oas.annotations.Operation; @@ -141,9 +141,9 @@ public class CreditBreachOfTrustController extends BaseController { try { int sheetIndex = ExcelImportSupport.findSheetIndex(file, "失信被执行人", 0); - ExcelImportSupport.ImportResult importResult = ExcelImportSupport.read( - file, CreditJudicialImportParam.class, this::isEmptyImportRow, sheetIndex); - List list = importResult.getData(); + ExcelImportSupport.ImportResult importResult = ExcelImportSupport.read( + file, CreditBreachOfTrustImportParam.class, this::isEmptyImportRow, sheetIndex); + List list = importResult.getData(); int usedTitleRows = importResult.getTitleRows(); int usedHeadRows = importResult.getHeadRows(); @@ -161,7 +161,7 @@ public class CreditBreachOfTrustController extends BaseController { List chunkRowNumbers = new ArrayList<>(chunkSize); for (int i = 0; i < list.size(); i++) { - CreditJudicialImportParam param = list.get(i); + CreditBreachOfTrustImportParam param = list.get(i); try { CreditBreachOfTrust item = convertImportParamToEntity(param); @@ -291,23 +291,19 @@ public class CreditBreachOfTrustController extends BaseController { @Operation(summary = "下载失信被执行人导入模板") @GetMapping("/import/template") public void downloadTemplate(HttpServletResponse response) throws IOException { - List templateList = new ArrayList<>(); + List templateList = new ArrayList<>(); - CreditJudicialImportParam example = new CreditJudicialImportParam(); - example.setDataType("失信被执行人"); + CreditBreachOfTrustImportParam example = new CreditBreachOfTrustImportParam(); + example.setCaseNumber("(2024)示例案号"); example.setPlaintiffAppellant("原告示例"); example.setAppellee("被告示例"); - example.setOtherPartiesThirdParty("第三人示例"); + example.setInvolvedAmount("20,293.91"); example.setOccurrenceTime("2024-01-01"); - example.setCaseNumber("(2024)示例案号"); - example.setCauseOfAction("案由示例"); - example.setInvolvedAmount("100000"); example.setCourtName("示例法院"); - example.setDataStatus("已公开"); - example.setComments("备注信息"); + example.setReleaseDate("2024-01-01"); templateList.add(example); - Workbook workbook = ExcelImportSupport.buildTemplate("失信被执行人导入模板", "失信被执行人", CreditJudicialImportParam.class, templateList); + Workbook workbook = ExcelImportSupport.buildTemplate("失信被执行人导入模板", "失信被执行人", CreditBreachOfTrustImportParam.class, templateList); response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); response.setHeader("Content-Disposition", "attachment; filename=credit_breach_of_trust_import_template.xlsx"); @@ -316,29 +312,25 @@ public class CreditBreachOfTrustController extends BaseController { workbook.close(); } - private boolean isEmptyImportRow(CreditJudicialImportParam param) { + private boolean isEmptyImportRow(CreditBreachOfTrustImportParam param) { if (param == null) { return true; } return ImportHelper.isBlank(param.getCaseNumber()) && ImportHelper.isBlank(param.getPlaintiffAppellant()) - && ImportHelper.isBlank(param.getAppellee()) - && ImportHelper.isBlank(param.getCauseOfAction()); + && ImportHelper.isBlank(param.getAppellee()); } - private CreditBreachOfTrust convertImportParamToEntity(CreditJudicialImportParam param) { + private CreditBreachOfTrust convertImportParamToEntity(CreditBreachOfTrustImportParam param) { CreditBreachOfTrust entity = new CreditBreachOfTrust(); - entity.setDataType(param.getDataType()); + entity.setCaseNumber(param.getCaseNumber()); entity.setPlaintiffAppellant(param.getPlaintiffAppellant()); entity.setAppellee(param.getAppellee()); - entity.setOtherPartiesThirdParty(param.getOtherPartiesThirdParty()); - entity.setOccurrenceTime(param.getOccurrenceTime()); - entity.setCaseNumber(param.getCaseNumber()); - entity.setCauseOfAction(param.getCauseOfAction()); entity.setInvolvedAmount(param.getInvolvedAmount()); + entity.setOccurrenceTime(param.getOccurrenceTime()); entity.setCourtName(param.getCourtName()); - entity.setDataStatus(param.getDataStatus()); + entity.setReleaseDate(param.getReleaseDate()); entity.setComments(param.getComments()); return entity; diff --git a/src/main/java/com/gxwebsoft/credit/controller/CreditFinalVersionController.java b/src/main/java/com/gxwebsoft/credit/controller/CreditFinalVersionController.java index 233c681..0d14ec6 100644 --- a/src/main/java/com/gxwebsoft/credit/controller/CreditFinalVersionController.java +++ b/src/main/java/com/gxwebsoft/credit/controller/CreditFinalVersionController.java @@ -7,8 +7,8 @@ import com.gxwebsoft.common.core.web.BatchParam; import com.gxwebsoft.common.core.web.PageResult; import com.gxwebsoft.common.system.entity.User; import com.gxwebsoft.credit.entity.CreditFinalVersion; +import com.gxwebsoft.credit.param.CreditFinalVersionImportParam; import com.gxwebsoft.credit.param.CreditFinalVersionParam; -import com.gxwebsoft.credit.param.CreditJudicialImportParam; import com.gxwebsoft.credit.service.CreditFinalVersionService; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; @@ -144,9 +144,11 @@ public class CreditFinalVersionController extends BaseController { int successCount = 0; try { - ExcelImportSupport.ImportResult importResult = ExcelImportSupport.read( - file, CreditJudicialImportParam.class, this::isEmptyImportRow); - List list = importResult.getData(); + // 按选项卡名称读取(客户提供的文件可能不是把目标 sheet 放在第一个) + int sheetIndex = ExcelImportSupport.findSheetIndex(file, "终本案件", 0); + ExcelImportSupport.ImportResult importResult = ExcelImportSupport.read( + file, CreditFinalVersionImportParam.class, this::isEmptyImportRow, sheetIndex); + List list = importResult.getData(); int usedTitleRows = importResult.getTitleRows(); int usedHeadRows = importResult.getHeadRows(); @@ -164,7 +166,7 @@ public class CreditFinalVersionController extends BaseController { List chunkRowNumbers = new ArrayList<>(chunkSize); for (int i = 0; i < list.size(); i++) { - CreditJudicialImportParam param = list.get(i); + CreditFinalVersionImportParam param = list.get(i); try { CreditFinalVersion item = convertImportParamToEntity(param); @@ -294,23 +296,20 @@ public class CreditFinalVersionController extends BaseController { @Operation(summary = "下载终本案件导入模板") @GetMapping("/import/template") public void downloadTemplate(HttpServletResponse response) throws IOException { - List templateList = new ArrayList<>(); + List templateList = new ArrayList<>(); - CreditJudicialImportParam example = new CreditJudicialImportParam(); - example.setDataType("终本案件"); + CreditFinalVersionImportParam example = new CreditFinalVersionImportParam(); + example.setCaseNumber("(2024)示例案号"); example.setPlaintiffAppellant("原告示例"); example.setAppellee("被告示例"); - example.setOtherPartiesThirdParty("第三人示例"); - example.setOccurrenceTime("2024-01-01"); - example.setCaseNumber("(2024)示例案号"); - example.setCauseOfAction("案由示例"); - example.setInvolvedAmount("100000"); + example.setInvolvedAmount("20,293.91"); example.setCourtName("示例法院"); - example.setDataStatus("已公开"); + example.setOccurrenceTime("2024-01-01"); + example.setFinalDate("2024-01-01"); example.setComments("备注信息"); templateList.add(example); - Workbook workbook = ExcelImportSupport.buildTemplate("终本案件导入模板", "终本案件", CreditJudicialImportParam.class, templateList); + Workbook workbook = ExcelImportSupport.buildTemplate("终本案件导入模板", "终本案件", CreditFinalVersionImportParam.class, templateList); response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); response.setHeader("Content-Disposition", "attachment; filename=credit_final_version_import_template.xlsx"); @@ -319,29 +318,23 @@ public class CreditFinalVersionController extends BaseController { workbook.close(); } - private boolean isEmptyImportRow(CreditJudicialImportParam param) { + private boolean isEmptyImportRow(CreditFinalVersionImportParam param) { if (param == null) { return true; } - return ImportHelper.isBlank(param.getCaseNumber()) - && ImportHelper.isBlank(param.getPlaintiffAppellant()) - && ImportHelper.isBlank(param.getAppellee()) - && ImportHelper.isBlank(param.getCauseOfAction()); + return ImportHelper.isBlank(param.getCaseNumber()); } - private CreditFinalVersion convertImportParamToEntity(CreditJudicialImportParam param) { + private CreditFinalVersion convertImportParamToEntity(CreditFinalVersionImportParam param) { CreditFinalVersion entity = new CreditFinalVersion(); - entity.setDataType(param.getDataType()); + entity.setCaseNumber(param.getCaseNumber()); entity.setPlaintiffAppellant(param.getPlaintiffAppellant()); entity.setAppellee(param.getAppellee()); - entity.setOtherPartiesThirdParty(param.getOtherPartiesThirdParty()); - entity.setOccurrenceTime(param.getOccurrenceTime()); - entity.setCaseNumber(param.getCaseNumber()); - entity.setCauseOfAction(param.getCauseOfAction()); + entity.setUnfulfilledAmount(param.getUnfulfilledAmount()); entity.setInvolvedAmount(param.getInvolvedAmount()); entity.setCourtName(param.getCourtName()); - entity.setDataStatus(param.getDataStatus()); + entity.setFinalDate(param.getFinalDate()); entity.setComments(param.getComments()); return entity; diff --git a/src/main/java/com/gxwebsoft/credit/entity/CreditBreachOfTrust.java b/src/main/java/com/gxwebsoft/credit/entity/CreditBreachOfTrust.java index 54c83c4..7e72801 100644 --- a/src/main/java/com/gxwebsoft/credit/entity/CreditBreachOfTrust.java +++ b/src/main/java/com/gxwebsoft/credit/entity/CreditBreachOfTrust.java @@ -30,34 +30,37 @@ public class CreditBreachOfTrust implements Serializable { @TableId(value = "id", type = IdType.AUTO) private Integer id; - @Schema(description = "数据类型") - private String dataType; + @Schema(description = "案号") + private String caseNumber; - @Schema(description = "原告/上诉人") + @Schema(description = "失信被执行人") private String plaintiffAppellant; - @Schema(description = "被告/被上诉人") + @Schema(description = "疑似申请执行人") @TableField("Appellee") private String appellee; + @Schema(description = "涉案金额(元)") + private String involvedAmount; + + @Schema(description = "执行法院") + private String courtName; + + @Schema(description = "立案日期") + private String occurrenceTime; + + @Schema(description = "发布日期") + private String releaseDate; + + @Schema(description = "数据类型") + private String dataType; + @Schema(description = "其他当事人/第三人") private String otherPartiesThirdParty; - @Schema(description = "发生时间") - private String occurrenceTime; - - @Schema(description = "案号") - private String caseNumber; - @Schema(description = "案由") private String causeOfAction; - @Schema(description = "涉案金额") - private String involvedAmount; - - @Schema(description = "法院") - private String courtName; - @Schema(description = "数据状态") private String dataStatus; diff --git a/src/main/java/com/gxwebsoft/credit/entity/CreditFinalVersion.java b/src/main/java/com/gxwebsoft/credit/entity/CreditFinalVersion.java index 48a2704..e0f214a 100644 --- a/src/main/java/com/gxwebsoft/credit/entity/CreditFinalVersion.java +++ b/src/main/java/com/gxwebsoft/credit/entity/CreditFinalVersion.java @@ -30,36 +30,29 @@ public class CreditFinalVersion implements Serializable { @TableId(value = "id", type = IdType.AUTO) private Integer id; - @Schema(description = "数据类型") - private String dataType; - - @Schema(description = "原告/上诉人") - private String plaintiffAppellant; - - @Schema(description = "被告/被上诉人") - @TableField("Appellee") - private String appellee; - - @Schema(description = "其他当事人/第三人") - private String otherPartiesThirdParty; - - @Schema(description = "发生时间") - private String occurrenceTime; - @Schema(description = "案号") private String caseNumber; - @Schema(description = "案由") - private String causeOfAction; + @Schema(description = "被执行人") + private String appellee; - @Schema(description = "涉案金额") + @Schema(description = "疑似申请执行人") + private String plaintiffAppellant; + + @Schema(description = "未履行金额(元)") + private String unfulfilledAmount; + + @Schema(description = "执行标的(元)") private String involvedAmount; - @Schema(description = "法院") + @Schema(description = "执行法院") private String courtName; - @Schema(description = "数据状态") - private String dataStatus; + @Schema(description = "立案时间") + private String occurrenceTime; + + @Schema(description = "终本日期") + private String finalDate; @Schema(description = "企业ID") private Integer companyId; diff --git a/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditBreachOfTrustMapper.xml b/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditBreachOfTrustMapper.xml index 2cd12d2..fde1526 100644 --- a/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditBreachOfTrustMapper.xml +++ b/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditBreachOfTrustMapper.xml @@ -14,36 +14,24 @@ AND a.company_id = #{param.companyId} - - AND a.data_type LIKE CONCAT('%', #{param.dataType}, '%') - AND a.plaintiff_appellant LIKE CONCAT('%', #{param.plaintiffAppellant}, '%') AND a.appellee LIKE CONCAT('%', #{param.defendant appellee}, '%') - - AND a.other_parties_third_party LIKE CONCAT('%', #{param.otherPartiesThirdParty}, '%') - AND a.occurrence_time LIKE CONCAT('%', #{param.occurrenceTime}, '%') AND a.case_number LIKE CONCAT('%', #{param.caseNumber}, '%') - - AND a.cause_of_action LIKE CONCAT('%', #{param.causeOfAction}, '%') - AND a.involved_amount = #{param.involvedAmount} AND a.court_name LIKE CONCAT('%', #{param.courtName}, '%') - - AND a.data_status LIKE CONCAT('%', #{param.dataStatus}, '%') - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') diff --git a/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditFinalVersionMapper.xml b/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditFinalVersionMapper.xml index 9aaa712..add9c97 100644 --- a/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditFinalVersionMapper.xml +++ b/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditFinalVersionMapper.xml @@ -14,36 +14,24 @@ AND a.company_id = #{param.companyId} - - AND a.data_type LIKE CONCAT('%', #{param.dataType}, '%') - AND a.plaintiff_appellant LIKE CONCAT('%', #{param.plaintiffAppellant}, '%') AND a.appellee LIKE CONCAT('%', #{param.defendant appellee}, '%') - - AND a.other_parties_third_party LIKE CONCAT('%', #{param.otherPartiesThirdParty}, '%') - AND a.occurrence_time LIKE CONCAT('%', #{param.occurrenceTime}, '%') AND a.case_number LIKE CONCAT('%', #{param.caseNumber}, '%') - - AND a.cause_of_action LIKE CONCAT('%', #{param.causeOfAction}, '%') - AND a.involved_amount = #{param.involvedAmount} AND a.court_name LIKE CONCAT('%', #{param.courtName}, '%') - - AND a.data_status LIKE CONCAT('%', #{param.dataStatus}, '%') - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') diff --git a/src/main/java/com/gxwebsoft/credit/param/CreditBreachOfTrustImportParam.java b/src/main/java/com/gxwebsoft/credit/param/CreditBreachOfTrustImportParam.java new file mode 100644 index 0000000..efb482d --- /dev/null +++ b/src/main/java/com/gxwebsoft/credit/param/CreditBreachOfTrustImportParam.java @@ -0,0 +1,43 @@ +package com.gxwebsoft.credit.param; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import com.baomidou.mybatisplus.annotation.TableField; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; + +/** + * 司法通用导入参数 + */ +@Data +public class CreditBreachOfTrustImportParam implements Serializable { + private static final long serialVersionUID = 1L; + + + @Excel(name = "案号") + private String caseNumber; + + @Excel(name = "失信被执行人") + private String plaintiffAppellant; + + @Excel(name = "疑似申请执行人") + @TableField("Appellee") + private String appellee; + + @Excel(name = "涉案金额(元)") + private String involvedAmount; + + @Excel(name = "执行法院") + private String courtName; + + @Excel(name = "立案日期") + private String occurrenceTime; + + @Excel(name = "发布日期") + private String releaseDate; + + @Excel(name = "备注") + private String comments; + +} diff --git a/src/main/java/com/gxwebsoft/credit/param/CreditBreachOfTrustParam.java b/src/main/java/com/gxwebsoft/credit/param/CreditBreachOfTrustParam.java index 8f0f50a..3391169 100644 --- a/src/main/java/com/gxwebsoft/credit/param/CreditBreachOfTrustParam.java +++ b/src/main/java/com/gxwebsoft/credit/param/CreditBreachOfTrustParam.java @@ -1,5 +1,6 @@ package com.gxwebsoft.credit.param; +import com.baomidou.mybatisplus.annotation.TableField; import com.fasterxml.jackson.annotation.JsonInclude; import com.gxwebsoft.common.core.annotation.QueryField; import com.gxwebsoft.common.core.annotation.QueryType; @@ -27,36 +28,27 @@ public class CreditBreachOfTrustParam extends BaseParam { @QueryField(type = QueryType.EQ) private Integer id; - @Schema(description = "数据类型") - private String dataType; - - @Schema(description = "原告/上诉人") - private String plaintiffAppellant; - - @Schema(description = "被告/被上诉人") - private String appellee; - - @Schema(description = "其他当事人/第三人") - private String otherPartiesThirdParty; - - @Schema(description = "发生时间") - private String occurrenceTime; - @Schema(description = "案号") private String caseNumber; - @Schema(description = "案由") - private String causeOfAction; + @Schema(description = "失信被执行人") + private String plaintiffAppellant; - @Schema(description = "涉案金额") - @QueryField(type = QueryType.EQ) + @Schema(description = "疑似申请执行人") + @TableField("Appellee") + private String appellee; + + @Schema(description = "涉案金额(元)") private String involvedAmount; - @Schema(description = "法院") + @Schema(description = "执行法院") private String courtName; - @Schema(description = "数据状态") - private String dataStatus; + @Schema(description = "立案日期") + private String occurrenceTime; + + @Schema(description = "发布日期") + private String releaseDate; @Schema(description = "企业ID") private Integer companyId; diff --git a/src/main/java/com/gxwebsoft/credit/param/CreditFinalVersionImportParam.java b/src/main/java/com/gxwebsoft/credit/param/CreditFinalVersionImportParam.java new file mode 100644 index 0000000..db41853 --- /dev/null +++ b/src/main/java/com/gxwebsoft/credit/param/CreditFinalVersionImportParam.java @@ -0,0 +1,44 @@ +package com.gxwebsoft.credit.param; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import com.baomidou.mybatisplus.annotation.TableField; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; + +/** + * 司法通用导入参数 + */ +@Data +public class CreditFinalVersionImportParam implements Serializable { + private static final long serialVersionUID = 1L; + + @Excel(name = "案号") + private String caseNumber; + + @Excel(name = "被告/被上诉人") + private String appellee; + + @Excel(name = "疑似申请执行人") + private String plaintiffAppellant; + + @Excel(name = "未履行金额(元)") + private String unfulfilledAmount; + + @Excel(name = "执行标的(元)") + private String involvedAmount; + + @Excel(name = "执行法院") + private String courtName; + + @Excel(name = "立案时间") + private String occurrenceTime; + + @Excel(name = "终本日期") + private String finalDate; + + @Excel(name = "备注") + private String comments; + +} diff --git a/src/main/java/com/gxwebsoft/credit/param/CreditFinalVersionParam.java b/src/main/java/com/gxwebsoft/credit/param/CreditFinalVersionParam.java index 91c4696..8a64116 100644 --- a/src/main/java/com/gxwebsoft/credit/param/CreditFinalVersionParam.java +++ b/src/main/java/com/gxwebsoft/credit/param/CreditFinalVersionParam.java @@ -27,35 +27,29 @@ public class CreditFinalVersionParam extends BaseParam { @QueryField(type = QueryType.EQ) private Integer id; - @Schema(description = "数据类型") - private String dataType; - - @Schema(description = "原告/上诉人") - private String plaintiffAppellant; + @Schema(description = "案号") + private String caseNumber; @Schema(description = "被告/被上诉人") private String appellee; - @Schema(description = "其他当事人/第三人") - private String otherPartiesThirdParty; + @Schema(description = "疑似申请执行人") + private String plaintiffAppellant; - @Schema(description = "发生时间") - private String occurrenceTime; + @Schema(description = "未履行金额(元)") + private String unfulfilledAmount; - @Schema(description = "案号") - private String caseNumber; - - @Schema(description = "案由") - private String causeOfAction; - - @Schema(description = "涉案金额") + @Schema(description = "执行标的(元)") private String involvedAmount; - @Schema(description = "法院") + @Schema(description = "执行法院") private String courtName; - @Schema(description = "数据状态") - private String dataStatus; + @Schema(description = "立案时间") + private String occurrenceTime; + + @Schema(description = "终本日期") + private String finalDate; @Schema(description = "企业ID") private Integer companyId;