refactor(credit): 调整司法文书实体和参数结构
- 移除 dataType、plaintiffAppellant 等字段,新增 title 字段 - 重命名 involvedAmount 为案件金额(元),defendantAppellee 为裁判结果 - 新增 releaseDate 发布日期字段和 defendantAppellee 裁判结果字段 - 更新导入参数类 CreditJudicialDocumentImportParam 替代旧参数类 - 修改
This commit is contained in:
@@ -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.CreditJudicialDocument;
|
||||
import com.gxwebsoft.credit.param.CreditJudicialDocumentImportParam;
|
||||
import com.gxwebsoft.credit.param.CreditJudicialDocumentParam;
|
||||
import com.gxwebsoft.credit.param.CreditJudicialImportParam;
|
||||
import com.gxwebsoft.credit.service.CreditJudicialDocumentService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
@@ -144,9 +144,9 @@ public class CreditJudicialDocumentController extends BaseController {
|
||||
int successCount = 0;
|
||||
|
||||
try {
|
||||
ExcelImportSupport.ImportResult<CreditJudicialImportParam> importResult = ExcelImportSupport.read(
|
||||
file, CreditJudicialImportParam.class, this::isEmptyImportRow);
|
||||
List<CreditJudicialImportParam> list = importResult.getData();
|
||||
ExcelImportSupport.ImportResult<CreditJudicialDocumentImportParam> importResult = ExcelImportSupport.read(
|
||||
file, CreditJudicialDocumentImportParam.class, this::isEmptyImportRow);
|
||||
List<CreditJudicialDocumentImportParam> list = importResult.getData();
|
||||
int usedTitleRows = importResult.getTitleRows();
|
||||
int usedHeadRows = importResult.getHeadRows();
|
||||
|
||||
@@ -164,7 +164,7 @@ public class CreditJudicialDocumentController extends BaseController {
|
||||
List<Integer> chunkRowNumbers = new ArrayList<>(chunkSize);
|
||||
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
CreditJudicialImportParam param = list.get(i);
|
||||
CreditJudicialDocumentImportParam param = list.get(i);
|
||||
try {
|
||||
CreditJudicialDocument item = convertImportParamToEntity(param);
|
||||
|
||||
@@ -294,23 +294,20 @@ public class CreditJudicialDocumentController extends BaseController {
|
||||
@Operation(summary = "下载裁判文书导入模板")
|
||||
@GetMapping("/import/template")
|
||||
public void downloadTemplate(HttpServletResponse response) throws IOException {
|
||||
List<CreditJudicialImportParam> templateList = new ArrayList<>();
|
||||
List<CreditJudicialDocumentImportParam> templateList = new ArrayList<>();
|
||||
|
||||
CreditJudicialImportParam example = new CreditJudicialImportParam();
|
||||
example.setDataType("裁判文书");
|
||||
example.setPlaintiffAppellant("原告示例");
|
||||
example.setAppellee("被告示例");
|
||||
CreditJudicialDocumentImportParam example = new CreditJudicialDocumentImportParam();
|
||||
example.setTitle("裁判文书");
|
||||
example.setOtherPartiesThirdParty("第三人示例");
|
||||
example.setOccurrenceTime("2024-01-01");
|
||||
example.setCaseNumber("(2024)示例案号");
|
||||
example.setCauseOfAction("案由示例");
|
||||
example.setInvolvedAmount("100000");
|
||||
example.setCourtName("示例法院");
|
||||
example.setDataStatus("已公开");
|
||||
example.setComments("备注信息");
|
||||
templateList.add(example);
|
||||
|
||||
Workbook workbook = ExcelImportSupport.buildTemplate("裁判文书导入模板", "裁判文书", CreditJudicialImportParam.class, templateList);
|
||||
Workbook workbook = ExcelImportSupport.buildTemplate("裁判文书导入模板", "裁判文书", CreditJudicialDocumentImportParam.class, templateList);
|
||||
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setHeader("Content-Disposition", "attachment; filename=credit_judicial_document_import_template.xlsx");
|
||||
@@ -319,29 +316,24 @@ public class CreditJudicialDocumentController extends BaseController {
|
||||
workbook.close();
|
||||
}
|
||||
|
||||
private boolean isEmptyImportRow(CreditJudicialImportParam param) {
|
||||
private boolean isEmptyImportRow(CreditJudicialDocumentImportParam param) {
|
||||
if (param == null) {
|
||||
return true;
|
||||
}
|
||||
return ImportHelper.isBlank(param.getCaseNumber())
|
||||
&& ImportHelper.isBlank(param.getPlaintiffAppellant())
|
||||
&& ImportHelper.isBlank(param.getAppellee())
|
||||
&& ImportHelper.isBlank(param.getCauseOfAction());
|
||||
}
|
||||
|
||||
private CreditJudicialDocument convertImportParamToEntity(CreditJudicialImportParam param) {
|
||||
private CreditJudicialDocument convertImportParamToEntity(CreditJudicialDocumentImportParam param) {
|
||||
CreditJudicialDocument entity = new CreditJudicialDocument();
|
||||
|
||||
entity.setDataType(param.getDataType());
|
||||
entity.setPlaintiffAppellant(param.getPlaintiffAppellant());
|
||||
entity.setAppellee(param.getAppellee());
|
||||
entity.setTitle(param.getTitle());
|
||||
entity.setOtherPartiesThirdParty(param.getOtherPartiesThirdParty());
|
||||
entity.setOccurrenceTime(param.getOccurrenceTime());
|
||||
entity.setCaseNumber(param.getCaseNumber());
|
||||
entity.setCauseOfAction(param.getCauseOfAction());
|
||||
entity.setInvolvedAmount(param.getInvolvedAmount());
|
||||
entity.setCourtName(param.getCourtName());
|
||||
entity.setDataStatus(param.getDataStatus());
|
||||
entity.setComments(param.getComments());
|
||||
|
||||
return entity;
|
||||
|
||||
@@ -30,21 +30,8 @@ public class CreditJudicialDocument 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 title;
|
||||
|
||||
@Schema(description = "案号")
|
||||
private String caseNumber;
|
||||
@@ -52,9 +39,25 @@ public class CreditJudicialDocument implements Serializable {
|
||||
@Schema(description = "案由")
|
||||
private String causeOfAction;
|
||||
|
||||
@Schema(description = "涉案金额")
|
||||
@Schema(description = "当事人")
|
||||
private String otherPartiesThirdParty;
|
||||
|
||||
@Schema(description = "案件金额(元)")
|
||||
private String involvedAmount;
|
||||
|
||||
@Schema(description = "裁判结果")
|
||||
private String defendantAppellee;
|
||||
|
||||
@Schema(description = "裁判日期")
|
||||
private String occurrenceTime;
|
||||
|
||||
@Schema(description = "发布日期")
|
||||
private String releaseDate;
|
||||
|
||||
@Schema(description = "被告/被上诉人")
|
||||
@TableField("Appellee")
|
||||
private String appellee;
|
||||
|
||||
@Schema(description = "法院")
|
||||
private String courtName;
|
||||
|
||||
|
||||
@@ -14,14 +14,8 @@
|
||||
<if test="param.companyId != null">
|
||||
AND a.company_id = #{param.companyId}
|
||||
</if>
|
||||
<if test="param.dataType != null">
|
||||
AND a.data_type LIKE CONCAT('%', #{param.dataType}, '%')
|
||||
</if>
|
||||
<if test="param.plaintiffAppellant != null">
|
||||
AND a.plaintiff_appellant LIKE CONCAT('%', #{param.plaintiffAppellant}, '%')
|
||||
</if>
|
||||
<if test="param.appellee != null">
|
||||
AND a.appellee LIKE CONCAT('%', #{param.defendant appellee}, '%')
|
||||
<if test="param.title != null">
|
||||
AND a.title LIKE CONCAT('%', #{param.title}, '%')
|
||||
</if>
|
||||
<if test="param.otherPartiesThirdParty != null">
|
||||
AND a.other_parties_third_party LIKE CONCAT('%', #{param.otherPartiesThirdParty}, '%')
|
||||
@@ -38,12 +32,6 @@
|
||||
<if test="param.involvedAmount != null">
|
||||
AND a.involved_amount = #{param.involvedAmount}
|
||||
</if>
|
||||
<if test="param.courtName != null">
|
||||
AND a.court_name LIKE CONCAT('%', #{param.courtName}, '%')
|
||||
</if>
|
||||
<if test="param.dataStatus != null">
|
||||
AND a.data_status LIKE CONCAT('%', #{param.dataStatus}, '%')
|
||||
</if>
|
||||
<if test="param.comments != null">
|
||||
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||
</if>
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.gxwebsoft.credit.param;
|
||||
|
||||
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 司法通用导入参数
|
||||
*/
|
||||
@Data
|
||||
public class CreditJudicialDocumentImportParam implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Excel(name = "文书标题")
|
||||
private String title;
|
||||
|
||||
@Excel(name = "案号")
|
||||
private String caseNumber;
|
||||
|
||||
@Excel(name = "案由")
|
||||
private String causeOfAction;
|
||||
|
||||
@Excel(name = "当事人")
|
||||
private String otherPartiesThirdParty;
|
||||
|
||||
@Excel(name = "案件金额(元)")
|
||||
private String involvedAmount;
|
||||
|
||||
@Excel(name = "裁判结果")
|
||||
private String defendantAppellee;
|
||||
|
||||
@Excel(name = "裁判日期")
|
||||
private String occurrenceTime;
|
||||
|
||||
@Excel(name = "发布日期")
|
||||
private String releaseDate;
|
||||
|
||||
@Excel(name = "法院")
|
||||
private String courtName;
|
||||
|
||||
@Excel(name = "备注")
|
||||
private String comments;
|
||||
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.gxwebsoft.credit.param;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.gxwebsoft.common.core.annotation.QueryField;
|
||||
import com.gxwebsoft.common.core.annotation.QueryType;
|
||||
@@ -23,24 +25,11 @@ import java.math.BigDecimal;
|
||||
public class CreditJudicialDocumentParam extends BaseParam {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
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 title;
|
||||
|
||||
@Schema(description = "案号")
|
||||
private String caseNumber;
|
||||
@@ -48,14 +37,20 @@ public class CreditJudicialDocumentParam extends BaseParam {
|
||||
@Schema(description = "案由")
|
||||
private String causeOfAction;
|
||||
|
||||
@Schema(description = "涉案金额")
|
||||
@Schema(description = "当事人")
|
||||
private String otherPartiesThirdParty;
|
||||
|
||||
@Schema(description = "案件金额(元)")
|
||||
private String involvedAmount;
|
||||
|
||||
@Schema(description = "法院")
|
||||
private String courtName;
|
||||
@Schema(description = "裁判结果")
|
||||
private String defendantAppellee;
|
||||
|
||||
@Schema(description = "数据状态")
|
||||
private String dataStatus;
|
||||
@Schema(description = "裁判日期")
|
||||
private String occurrenceTime;
|
||||
|
||||
@Schema(description = "发布日期")
|
||||
private String releaseDate;
|
||||
|
||||
@Schema(description = "企业ID")
|
||||
private Integer companyId;
|
||||
|
||||
Reference in New Issue
Block a user