diff --git a/src/main/java/com/gxwebsoft/credit/controller/CreditBreachOfTrustController.java b/src/main/java/com/gxwebsoft/credit/controller/CreditBreachOfTrustController.java index 2383bec..0d6b069 100644 --- a/src/main/java/com/gxwebsoft/credit/controller/CreditBreachOfTrustController.java +++ b/src/main/java/com/gxwebsoft/credit/controller/CreditBreachOfTrustController.java @@ -263,7 +263,7 @@ public class CreditBreachOfTrustController extends BaseController { entity.setOccurrenceTime(param.getOccurrenceTime()); entity.setCaseNumber(param.getCaseNumber()); entity.setCauseOfAction(param.getCauseOfAction()); - entity.setInvolvedAmount(ImportHelper.parseBigDecimal(param.getInvolvedAmount(), "涉案金额")); + entity.setInvolvedAmount(param.getInvolvedAmount()); entity.setCourtName(param.getCourtName()); entity.setDataStatus(param.getDataStatus()); entity.setComments(param.getComments()); diff --git a/src/main/java/com/gxwebsoft/credit/controller/CreditCaseFilingController.java b/src/main/java/com/gxwebsoft/credit/controller/CreditCaseFilingController.java index 5b7b707..0b29c8d 100644 --- a/src/main/java/com/gxwebsoft/credit/controller/CreditCaseFilingController.java +++ b/src/main/java/com/gxwebsoft/credit/controller/CreditCaseFilingController.java @@ -267,7 +267,7 @@ public class CreditCaseFilingController extends BaseController { entity.setOccurrenceTime(param.getOccurrenceTime()); entity.setCaseNumber(param.getCaseNumber()); entity.setCauseOfAction(param.getCauseOfAction()); - entity.setInvolvedAmount(ImportHelper.parseBigDecimal(param.getInvolvedAmount(), "涉案金额")); + entity.setInvolvedAmount(param.getInvolvedAmount()); entity.setCourtName(param.getCourtName()); entity.setDataStatus(param.getDataStatus()); entity.setComments(param.getComments()); diff --git a/src/main/java/com/gxwebsoft/credit/controller/CreditCompetitorController.java b/src/main/java/com/gxwebsoft/credit/controller/CreditCompetitorController.java index 1ac9ed3..73565ab 100644 --- a/src/main/java/com/gxwebsoft/credit/controller/CreditCompetitorController.java +++ b/src/main/java/com/gxwebsoft/credit/controller/CreditCompetitorController.java @@ -141,7 +141,7 @@ public class CreditCompetitorController extends BaseController { try { ExcelImportSupport.ImportResult importResult = ExcelImportSupport.read( - file, CreditCompetitorImportParam.class, this::isEmptyImportRow); + file, CreditCompetitorImportParam.class, this::isEmptyImportRow,2); List list = importResult.getData(); int usedTitleRows = importResult.getTitleRows(); int usedHeadRows = importResult.getHeadRows(); diff --git a/src/main/java/com/gxwebsoft/credit/controller/CreditCourtAnnouncementController.java b/src/main/java/com/gxwebsoft/credit/controller/CreditCourtAnnouncementController.java index 67c7734..771ecd3 100644 --- a/src/main/java/com/gxwebsoft/credit/controller/CreditCourtAnnouncementController.java +++ b/src/main/java/com/gxwebsoft/credit/controller/CreditCourtAnnouncementController.java @@ -267,7 +267,7 @@ public class CreditCourtAnnouncementController extends BaseController { entity.setOccurrenceTime(param.getOccurrenceTime()); entity.setCaseNumber(param.getCaseNumber()); entity.setCauseOfAction(param.getCauseOfAction()); - entity.setInvolvedAmount(ImportHelper.parseBigDecimal(param.getInvolvedAmount(), "涉案金额")); + entity.setInvolvedAmount(param.getInvolvedAmount()); entity.setCourtName(param.getCourtName()); entity.setDataStatus(param.getDataStatus()); entity.setComments(param.getComments()); diff --git a/src/main/java/com/gxwebsoft/credit/controller/CreditCourtSessionController.java b/src/main/java/com/gxwebsoft/credit/controller/CreditCourtSessionController.java index 751af82..e63bd9a 100644 --- a/src/main/java/com/gxwebsoft/credit/controller/CreditCourtSessionController.java +++ b/src/main/java/com/gxwebsoft/credit/controller/CreditCourtSessionController.java @@ -267,7 +267,7 @@ public class CreditCourtSessionController extends BaseController { entity.setOccurrenceTime(param.getOccurrenceTime()); entity.setCaseNumber(param.getCaseNumber()); entity.setCauseOfAction(param.getCauseOfAction()); - entity.setInvolvedAmount(ImportHelper.parseBigDecimal(param.getInvolvedAmount(), "涉案金额")); + entity.setInvolvedAmount(param.getInvolvedAmount()); entity.setCourtName(param.getCourtName()); entity.setDataStatus(param.getDataStatus()); entity.setComments(param.getComments()); diff --git a/src/main/java/com/gxwebsoft/credit/controller/CreditCustomerController.java b/src/main/java/com/gxwebsoft/credit/controller/CreditCustomerController.java index 421bf6f..b042781 100644 --- a/src/main/java/com/gxwebsoft/credit/controller/CreditCustomerController.java +++ b/src/main/java/com/gxwebsoft/credit/controller/CreditCustomerController.java @@ -5,15 +5,23 @@ import com.gxwebsoft.common.core.web.ApiResult; import com.gxwebsoft.common.core.web.BaseController; 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.CreditCustomer; +import com.gxwebsoft.credit.param.CreditCustomerImportParam; import com.gxwebsoft.credit.param.CreditCustomerParam; import com.gxwebsoft.credit.service.CreditCustomerService; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; +import org.apache.poi.ss.usermodel.Workbook; import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.util.CollectionUtils; import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.ArrayList; import java.util.List; /** @@ -116,4 +124,139 @@ public class CreditCustomerController extends BaseController { return fail("删除失败"); } + /** + * 批量导入客户 + */ + @PreAuthorize("hasAuthority('credit:creditCustomer:save')") + @Operation(summary = "批量导入客户") + @PostMapping("/import") + public ApiResult> importBatch(@RequestParam("file") MultipartFile file) { + List errorMessages = new ArrayList<>(); + int successCount = 0; + + try { + ExcelImportSupport.ImportResult importResult = ExcelImportSupport.read( + file, CreditCustomerImportParam.class, this::isEmptyImportRow,4); + List list = importResult.getData(); + int usedTitleRows = importResult.getTitleRows(); + int usedHeadRows = importResult.getHeadRows(); + + if (CollectionUtils.isEmpty(list)) { + return fail("未读取到数据,请确认模板表头与示例格式一致", null); + } + + User loginUser = getLoginUser(); + Integer currentUserId = loginUser != null ? loginUser.getUserId() : null; + Integer currentTenantId = loginUser != null ? loginUser.getTenantId() : null; + + for (int i = 0; i < list.size(); i++) { + CreditCustomerImportParam param = list.get(i); + try { + CreditCustomer item = convertImportParamToEntity(param); + + if (item.getUserId() == null && currentUserId != null) { + item.setUserId(currentUserId); + } + if (item.getTenantId() == null && currentTenantId != null) { + item.setTenantId(currentTenantId); + } + if (item.getStatus() == null) { + item.setStatus(0); + } + if (item.getRecommend() == null) { + item.setRecommend(0); + } + if (item.getDeleted() == null) { + item.setDeleted(0); + } + + int excelRowNumber = i + 1 + usedTitleRows + usedHeadRows; + if (ImportHelper.isBlank(item.getName())) { + errorMessages.add("第" + excelRowNumber + "行:客户不能为空"); + continue; + } + + boolean saved = creditCustomerService.save(item); + if (!saved) { + CreditCustomer existing = creditCustomerService.lambdaQuery() + .eq(CreditCustomer::getName, item.getName()) + .one(); + if (existing != null) { + item.setId(existing.getId()); + if (creditCustomerService.updateById(item)) { + successCount++; + continue; + } + } + } else { + successCount++; + continue; + } + errorMessages.add("第" + excelRowNumber + "行:保存失败"); + } catch (Exception e) { + int excelRowNumber = i + 1 + usedTitleRows + usedHeadRows; + errorMessages.add("第" + excelRowNumber + "行:" + e.getMessage()); + e.printStackTrace(); + } + } + + if (errorMessages.isEmpty()) { + return success("成功导入" + successCount + "条数据", null); + } else { + return success("导入完成,成功" + successCount + "条,失败" + errorMessages.size() + "条", errorMessages); + } + } catch (Exception e) { + e.printStackTrace(); + return fail("导入失败:" + e.getMessage(), null); + } + } + + /** + * 下载客户导入模板 + */ + @Operation(summary = "下载客户导入模板") + @GetMapping("/import/template") + public void downloadTemplate(HttpServletResponse response) throws IOException { + List templateList = new ArrayList<>(); + + CreditCustomerImportParam example = new CreditCustomerImportParam(); + example.setName("示例客户"); + example.setStatusTxt("合作中"); + example.setPrice("88.8"); + example.setPublicDate("2024-01-01"); + example.setDataSource("公开渠道"); + example.setComments("备注信息"); + templateList.add(example); + + Workbook workbook = ExcelImportSupport.buildTemplate("客户导入模板", "客户", CreditCustomerImportParam.class, templateList); + + response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); + response.setHeader("Content-Disposition", "attachment; filename=credit_customer_import_template.xlsx"); + + workbook.write(response.getOutputStream()); + workbook.close(); + } + + private boolean isEmptyImportRow(CreditCustomerImportParam param) { + if (param == null) { + return true; + } + return ImportHelper.isBlank(param.getName()) + && ImportHelper.isBlank(param.getStatusTxt()) + && ImportHelper.isBlank(param.getPrice()); + } + + private CreditCustomer convertImportParamToEntity(CreditCustomerImportParam param) { + CreditCustomer entity = new CreditCustomer(); + + entity.setName(param.getName()); + entity.setStatusTxt(param.getStatusTxt()); + entity.setPrice(param.getPrice()); + entity.setPublicDate(param.getPublicDate()); + entity.setDataSource(param.getDataSource()); + entity.setComments(param.getComments()); + + return entity; + } + } diff --git a/src/main/java/com/gxwebsoft/credit/controller/CreditDeliveryNoticeController.java b/src/main/java/com/gxwebsoft/credit/controller/CreditDeliveryNoticeController.java index f63567f..2982ff3 100644 --- a/src/main/java/com/gxwebsoft/credit/controller/CreditDeliveryNoticeController.java +++ b/src/main/java/com/gxwebsoft/credit/controller/CreditDeliveryNoticeController.java @@ -267,7 +267,7 @@ public class CreditDeliveryNoticeController extends BaseController { entity.setOccurrenceTime(param.getOccurrenceTime()); entity.setCaseNumber(param.getCaseNumber()); entity.setCauseOfAction(param.getCauseOfAction()); - entity.setInvolvedAmount(ImportHelper.parseBigDecimal(param.getInvolvedAmount(), "涉案金额")); + entity.setInvolvedAmount(param.getInvolvedAmount()); entity.setCourtName(param.getCourtName()); entity.setDataStatus(param.getDataStatus()); entity.setComments(param.getComments()); diff --git a/src/main/java/com/gxwebsoft/credit/controller/CreditFinalVersionController.java b/src/main/java/com/gxwebsoft/credit/controller/CreditFinalVersionController.java index 30dec64..4860843 100644 --- a/src/main/java/com/gxwebsoft/credit/controller/CreditFinalVersionController.java +++ b/src/main/java/com/gxwebsoft/credit/controller/CreditFinalVersionController.java @@ -267,7 +267,7 @@ public class CreditFinalVersionController extends BaseController { entity.setOccurrenceTime(param.getOccurrenceTime()); entity.setCaseNumber(param.getCaseNumber()); entity.setCauseOfAction(param.getCauseOfAction()); - entity.setInvolvedAmount(ImportHelper.parseBigDecimal(param.getInvolvedAmount(), "涉案金额")); + entity.setInvolvedAmount(param.getInvolvedAmount()); entity.setCourtName(param.getCourtName()); entity.setDataStatus(param.getDataStatus()); entity.setComments(param.getComments()); diff --git a/src/main/java/com/gxwebsoft/credit/controller/CreditGqdjController.java b/src/main/java/com/gxwebsoft/credit/controller/CreditGqdjController.java index d5b8b55..ab40ece 100644 --- a/src/main/java/com/gxwebsoft/credit/controller/CreditGqdjController.java +++ b/src/main/java/com/gxwebsoft/credit/controller/CreditGqdjController.java @@ -267,7 +267,7 @@ public class CreditGqdjController extends BaseController { entity.setOccurrenceTime(param.getOccurrenceTime()); entity.setCaseNumber(param.getCaseNumber()); entity.setCauseOfAction(param.getCauseOfAction()); - entity.setInvolvedAmount(ImportHelper.parseBigDecimal(param.getInvolvedAmount(), "涉案金额")); + entity.setInvolvedAmount(param.getInvolvedAmount()); entity.setCourtName(param.getCourtName()); entity.setDataStatus(param.getDataStatus()); entity.setComments(param.getComments()); diff --git a/src/main/java/com/gxwebsoft/credit/controller/CreditJudgmentDebtorController.java b/src/main/java/com/gxwebsoft/credit/controller/CreditJudgmentDebtorController.java index dfc4f78..2b72eb0 100644 --- a/src/main/java/com/gxwebsoft/credit/controller/CreditJudgmentDebtorController.java +++ b/src/main/java/com/gxwebsoft/credit/controller/CreditJudgmentDebtorController.java @@ -230,7 +230,6 @@ public class CreditJudgmentDebtorController extends BaseController { example.setCode("1234567890"); example.setOccurrenceTime("2024-01-10"); example.setAmount("100000"); - example.setCourtName("示例法院"); example.setDataStatus("已公开"); example.setComments("备注信息"); templateList.add(example); @@ -261,7 +260,6 @@ public class CreditJudgmentDebtorController extends BaseController { entity.setCode(param.getCode()); entity.setOccurrenceTime(param.getOccurrenceTime()); entity.setAmount(ImportHelper.parseBigDecimal(param.getAmount(), "执行标的(元)")); - entity.setCourtName(param.getCourtName()); entity.setDataStatus(param.getDataStatus()); entity.setComments(param.getComments()); diff --git a/src/main/java/com/gxwebsoft/credit/controller/CreditJudicialDocumentController.java b/src/main/java/com/gxwebsoft/credit/controller/CreditJudicialDocumentController.java index 98ebb84..5ed070b 100644 --- a/src/main/java/com/gxwebsoft/credit/controller/CreditJudicialDocumentController.java +++ b/src/main/java/com/gxwebsoft/credit/controller/CreditJudicialDocumentController.java @@ -267,7 +267,7 @@ public class CreditJudicialDocumentController extends BaseController { entity.setOccurrenceTime(param.getOccurrenceTime()); entity.setCaseNumber(param.getCaseNumber()); entity.setCauseOfAction(param.getCauseOfAction()); - entity.setInvolvedAmount(ImportHelper.parseBigDecimal(param.getInvolvedAmount(), "涉案金额")); + entity.setInvolvedAmount(param.getInvolvedAmount()); entity.setCourtName(param.getCourtName()); entity.setDataStatus(param.getDataStatus()); entity.setComments(param.getComments()); diff --git a/src/main/java/com/gxwebsoft/credit/controller/CreditMediationController.java b/src/main/java/com/gxwebsoft/credit/controller/CreditMediationController.java index 23236e1..bd7b4e1 100644 --- a/src/main/java/com/gxwebsoft/credit/controller/CreditMediationController.java +++ b/src/main/java/com/gxwebsoft/credit/controller/CreditMediationController.java @@ -267,7 +267,7 @@ public class CreditMediationController extends BaseController { entity.setOccurrenceTime(param.getOccurrenceTime()); entity.setCaseNumber(param.getCaseNumber()); entity.setCauseOfAction(param.getCauseOfAction()); - entity.setInvolvedAmount(ImportHelper.parseBigDecimal(param.getInvolvedAmount(), "涉案金额")); + entity.setInvolvedAmount(param.getInvolvedAmount()); entity.setCourtName(param.getCourtName()); entity.setDataStatus(param.getDataStatus()); entity.setComments(param.getComments()); diff --git a/src/main/java/com/gxwebsoft/credit/controller/CreditRiskRelationController.java b/src/main/java/com/gxwebsoft/credit/controller/CreditRiskRelationController.java index bf0fdfa..602e213 100644 --- a/src/main/java/com/gxwebsoft/credit/controller/CreditRiskRelationController.java +++ b/src/main/java/com/gxwebsoft/credit/controller/CreditRiskRelationController.java @@ -140,8 +140,9 @@ public class CreditRiskRelationController extends BaseController { int successCount = 0; try { + // 风险关系数据位于第二个选项卡,sheetIndex = 1 ExcelImportSupport.ImportResult importResult = ExcelImportSupport.read( - file, CreditRiskRelationImportParam.class, this::isEmptyImportRow); + file, CreditRiskRelationImportParam.class, this::isEmptyImportRow, 1); List list = importResult.getData(); int usedTitleRows = importResult.getTitleRows(); int usedHeadRows = importResult.getHeadRows(); diff --git a/src/main/java/com/gxwebsoft/credit/controller/CreditSupplierController.java b/src/main/java/com/gxwebsoft/credit/controller/CreditSupplierController.java index 8682c9c..e3f7f10 100644 --- a/src/main/java/com/gxwebsoft/credit/controller/CreditSupplierController.java +++ b/src/main/java/com/gxwebsoft/credit/controller/CreditSupplierController.java @@ -141,7 +141,7 @@ public class CreditSupplierController extends BaseController { try { ExcelImportSupport.ImportResult importResult = ExcelImportSupport.read( - file, CreditSupplierImportParam.class, this::isEmptyImportRow); + file, CreditSupplierImportParam.class, this::isEmptyImportRow,3); List list = importResult.getData(); int usedTitleRows = importResult.getTitleRows(); int usedHeadRows = importResult.getHeadRows(); @@ -256,8 +256,8 @@ public class CreditSupplierController extends BaseController { entity.setSupplier(param.getSupplier()); entity.setStatusTxt(param.getStatusTxt()); - entity.setPurchaseAmount(ImportHelper.parseBigDecimal(param.getPurchaseAmount(), "采购金额(万元)")); - entity.setPublicDate(ImportHelper.parseLocalDate(param.getPublicDate(), "公开日期")); + entity.setPurchaseAmount(param.getPurchaseAmount()); + entity.setPublicDate(param.getPublicDate()); entity.setDataSource(param.getDataSource()); entity.setComments(param.getComments()); diff --git a/src/main/java/com/gxwebsoft/credit/controller/CreditXgxfController.java b/src/main/java/com/gxwebsoft/credit/controller/CreditXgxfController.java index e546a90..af15cc9 100644 --- a/src/main/java/com/gxwebsoft/credit/controller/CreditXgxfController.java +++ b/src/main/java/com/gxwebsoft/credit/controller/CreditXgxfController.java @@ -267,7 +267,7 @@ public class CreditXgxfController extends BaseController { entity.setOccurrenceTime(param.getOccurrenceTime()); entity.setCaseNumber(param.getCaseNumber()); entity.setCauseOfAction(param.getCauseOfAction()); - entity.setInvolvedAmount(ImportHelper.parseBigDecimal(param.getInvolvedAmount(), "涉案金额")); + entity.setInvolvedAmount(param.getInvolvedAmount()); entity.setCourtName(param.getCourtName()); entity.setDataStatus(param.getDataStatus()); entity.setComments(param.getComments()); diff --git a/src/main/java/com/gxwebsoft/credit/controller/ExcelImportSupport.java b/src/main/java/com/gxwebsoft/credit/controller/ExcelImportSupport.java index 59cc28d..7ff536b 100644 --- a/src/main/java/com/gxwebsoft/credit/controller/ExcelImportSupport.java +++ b/src/main/java/com/gxwebsoft/credit/controller/ExcelImportSupport.java @@ -41,13 +41,22 @@ public class ExcelImportSupport { } public static ImportResult read(MultipartFile file, Class clazz, Predicate emptyRowPredicate) throws Exception { + return read(file, clazz, emptyRowPredicate, 0); + } + + /** + * 读取指定 sheet 的 Excel。 + * + * @param sheetIndex 目标 sheet 下标,从 0 开始。第二个选项卡传 1。 + */ + public static ImportResult read(MultipartFile file, Class clazz, Predicate emptyRowPredicate, int sheetIndex) throws Exception { List list = null; int usedTitleRows = 0; int usedHeadRows = 0; int[][] tryConfigs = new int[][]{{1, 1}, {0, 1}, {0, 2}, {0, 3}}; for (int[] config : tryConfigs) { - list = filterEmptyRows(importSheet(file, clazz, config[0], config[1]), emptyRowPredicate); + list = filterEmptyRows(importSheet(file, clazz, config[0], config[1], sheetIndex), emptyRowPredicate); if (!CollectionUtils.isEmpty(list)) { usedTitleRows = config[0]; usedHeadRows = config[1]; @@ -57,11 +66,11 @@ public class ExcelImportSupport { return new ImportResult<>(list, usedTitleRows, usedHeadRows); } - private static List importSheet(MultipartFile file, Class clazz, int titleRows, int headRows) throws Exception { + private static List importSheet(MultipartFile file, Class clazz, int titleRows, int headRows, int sheetIndex) throws Exception { ImportParams importParams = new ImportParams(); importParams.setTitleRows(titleRows); importParams.setHeadRows(headRows); - importParams.setStartSheetIndex(0); + importParams.setStartSheetIndex(sheetIndex); importParams.setSheetNum(1); return ExcelImportUtil.importExcel(file.getInputStream(), clazz, importParams); } diff --git a/src/main/java/com/gxwebsoft/credit/entity/CreditBreachOfTrust.java b/src/main/java/com/gxwebsoft/credit/entity/CreditBreachOfTrust.java index 6fa75fb..5838c74 100644 --- a/src/main/java/com/gxwebsoft/credit/entity/CreditBreachOfTrust.java +++ b/src/main/java/com/gxwebsoft/credit/entity/CreditBreachOfTrust.java @@ -53,7 +53,7 @@ public class CreditBreachOfTrust implements Serializable { private String causeOfAction; @Schema(description = "涉案金额") - private BigDecimal involvedAmount; + private String involvedAmount; @Schema(description = "法院") private String courtName; diff --git a/src/main/java/com/gxwebsoft/credit/entity/CreditCaseFiling.java b/src/main/java/com/gxwebsoft/credit/entity/CreditCaseFiling.java index bfacec1..1f59935 100644 --- a/src/main/java/com/gxwebsoft/credit/entity/CreditCaseFiling.java +++ b/src/main/java/com/gxwebsoft/credit/entity/CreditCaseFiling.java @@ -53,7 +53,7 @@ public class CreditCaseFiling implements Serializable { private String causeOfAction; @Schema(description = "涉案金额") - private BigDecimal involvedAmount; + private String involvedAmount; @Schema(description = "法院") private String courtName; diff --git a/src/main/java/com/gxwebsoft/credit/entity/CreditCourtAnnouncement.java b/src/main/java/com/gxwebsoft/credit/entity/CreditCourtAnnouncement.java index f6476a1..e7ae302 100644 --- a/src/main/java/com/gxwebsoft/credit/entity/CreditCourtAnnouncement.java +++ b/src/main/java/com/gxwebsoft/credit/entity/CreditCourtAnnouncement.java @@ -53,7 +53,7 @@ public class CreditCourtAnnouncement implements Serializable { private String causeOfAction; @Schema(description = "涉案金额") - private BigDecimal involvedAmount; + private String involvedAmount; @Schema(description = "法院") private String courtName; diff --git a/src/main/java/com/gxwebsoft/credit/entity/CreditCourtSession.java b/src/main/java/com/gxwebsoft/credit/entity/CreditCourtSession.java index f6636ef..3eb3874 100644 --- a/src/main/java/com/gxwebsoft/credit/entity/CreditCourtSession.java +++ b/src/main/java/com/gxwebsoft/credit/entity/CreditCourtSession.java @@ -53,7 +53,7 @@ public class CreditCourtSession implements Serializable { private String causeOfAction; @Schema(description = "涉案金额") - private BigDecimal involvedAmount; + private String involvedAmount; @Schema(description = "法院") private String courtName; diff --git a/src/main/java/com/gxwebsoft/credit/entity/CreditCustomer.java b/src/main/java/com/gxwebsoft/credit/entity/CreditCustomer.java index afb8a09..a6fe210 100644 --- a/src/main/java/com/gxwebsoft/credit/entity/CreditCustomer.java +++ b/src/main/java/com/gxwebsoft/credit/entity/CreditCustomer.java @@ -36,11 +36,10 @@ public class CreditCustomer implements Serializable { private String statusTxt; @Schema(description = "销售金额(万元)") - private BigDecimal price; + private String price; @Schema(description = "公开日期") - @JsonFormat(pattern = "yyyy-MM-dd") - private LocalDate publicDate; + private String publicDate; @Schema(description = "数据来源") private String dataSource; diff --git a/src/main/java/com/gxwebsoft/credit/entity/CreditDeliveryNotice.java b/src/main/java/com/gxwebsoft/credit/entity/CreditDeliveryNotice.java index 165d0f8..dec6c27 100644 --- a/src/main/java/com/gxwebsoft/credit/entity/CreditDeliveryNotice.java +++ b/src/main/java/com/gxwebsoft/credit/entity/CreditDeliveryNotice.java @@ -53,7 +53,7 @@ public class CreditDeliveryNotice implements Serializable { private String causeOfAction; @Schema(description = "涉案金额") - private BigDecimal involvedAmount; + private String involvedAmount; @Schema(description = "法院") private String courtName; diff --git a/src/main/java/com/gxwebsoft/credit/entity/CreditFinalVersion.java b/src/main/java/com/gxwebsoft/credit/entity/CreditFinalVersion.java index 079a0c2..627e836 100644 --- a/src/main/java/com/gxwebsoft/credit/entity/CreditFinalVersion.java +++ b/src/main/java/com/gxwebsoft/credit/entity/CreditFinalVersion.java @@ -53,7 +53,7 @@ public class CreditFinalVersion implements Serializable { private String causeOfAction; @Schema(description = "涉案金额") - private BigDecimal involvedAmount; + private String involvedAmount; @Schema(description = "法院") private String courtName; diff --git a/src/main/java/com/gxwebsoft/credit/entity/CreditGqdj.java b/src/main/java/com/gxwebsoft/credit/entity/CreditGqdj.java index 1054718..aca6a13 100644 --- a/src/main/java/com/gxwebsoft/credit/entity/CreditGqdj.java +++ b/src/main/java/com/gxwebsoft/credit/entity/CreditGqdj.java @@ -53,7 +53,7 @@ public class CreditGqdj implements Serializable { private String causeOfAction; @Schema(description = "涉案金额") - private BigDecimal involvedAmount; + private String involvedAmount; @Schema(description = "法院") private String courtName; diff --git a/src/main/java/com/gxwebsoft/credit/entity/CreditJudicialDocument.java b/src/main/java/com/gxwebsoft/credit/entity/CreditJudicialDocument.java index 2bc8520..78ef2fe 100644 --- a/src/main/java/com/gxwebsoft/credit/entity/CreditJudicialDocument.java +++ b/src/main/java/com/gxwebsoft/credit/entity/CreditJudicialDocument.java @@ -53,7 +53,7 @@ public class CreditJudicialDocument implements Serializable { private String causeOfAction; @Schema(description = "涉案金额") - private BigDecimal involvedAmount; + private String involvedAmount; @Schema(description = "法院") private String courtName; diff --git a/src/main/java/com/gxwebsoft/credit/entity/CreditMediation.java b/src/main/java/com/gxwebsoft/credit/entity/CreditMediation.java index 3f7e155..9c02b17 100644 --- a/src/main/java/com/gxwebsoft/credit/entity/CreditMediation.java +++ b/src/main/java/com/gxwebsoft/credit/entity/CreditMediation.java @@ -53,7 +53,7 @@ public class CreditMediation implements Serializable { private String causeOfAction; @Schema(description = "涉案金额") - private BigDecimal involvedAmount; + private String involvedAmount; @Schema(description = "法院") private String courtName; diff --git a/src/main/java/com/gxwebsoft/credit/entity/CreditSupplier.java b/src/main/java/com/gxwebsoft/credit/entity/CreditSupplier.java index 207be51..78150d5 100644 --- a/src/main/java/com/gxwebsoft/credit/entity/CreditSupplier.java +++ b/src/main/java/com/gxwebsoft/credit/entity/CreditSupplier.java @@ -36,11 +36,10 @@ public class CreditSupplier implements Serializable { private String statusTxt; @Schema(description = "采购金额(万元)") - private BigDecimal purchaseAmount; + private String purchaseAmount; @Schema(description = "公开日期") - @JsonFormat(pattern = "yyyy-MM-dd") - private LocalDate publicDate; + private String publicDate; @Schema(description = "数据来源") private String dataSource; diff --git a/src/main/java/com/gxwebsoft/credit/entity/CreditXgxf.java b/src/main/java/com/gxwebsoft/credit/entity/CreditXgxf.java index 535a178..f6bfe28 100644 --- a/src/main/java/com/gxwebsoft/credit/entity/CreditXgxf.java +++ b/src/main/java/com/gxwebsoft/credit/entity/CreditXgxf.java @@ -53,7 +53,7 @@ public class CreditXgxf implements Serializable { private String causeOfAction; @Schema(description = "涉案金额") - private BigDecimal involvedAmount; + private String involvedAmount; @Schema(description = "法院") private String courtName; diff --git a/src/main/java/com/gxwebsoft/credit/param/CreditBreachOfTrustParam.java b/src/main/java/com/gxwebsoft/credit/param/CreditBreachOfTrustParam.java index c55a8ad..0d5956f 100644 --- a/src/main/java/com/gxwebsoft/credit/param/CreditBreachOfTrustParam.java +++ b/src/main/java/com/gxwebsoft/credit/param/CreditBreachOfTrustParam.java @@ -50,7 +50,7 @@ public class CreditBreachOfTrustParam extends BaseParam { @Schema(description = "涉案金额") @QueryField(type = QueryType.EQ) - private BigDecimal involvedAmount; + private String involvedAmount; @Schema(description = "法院") private String courtName; diff --git a/src/main/java/com/gxwebsoft/credit/param/CreditCaseFilingParam.java b/src/main/java/com/gxwebsoft/credit/param/CreditCaseFilingParam.java index 4d15405..aa573b1 100644 --- a/src/main/java/com/gxwebsoft/credit/param/CreditCaseFilingParam.java +++ b/src/main/java/com/gxwebsoft/credit/param/CreditCaseFilingParam.java @@ -49,8 +49,7 @@ public class CreditCaseFilingParam extends BaseParam { private String causeOfAction; @Schema(description = "涉案金额") - @QueryField(type = QueryType.EQ) - private BigDecimal involvedAmount; + private String involvedAmount; @Schema(description = "法院") private String courtName; diff --git a/src/main/java/com/gxwebsoft/credit/param/CreditCourtAnnouncementParam.java b/src/main/java/com/gxwebsoft/credit/param/CreditCourtAnnouncementParam.java index 357c31c..d1d8445 100644 --- a/src/main/java/com/gxwebsoft/credit/param/CreditCourtAnnouncementParam.java +++ b/src/main/java/com/gxwebsoft/credit/param/CreditCourtAnnouncementParam.java @@ -49,8 +49,7 @@ public class CreditCourtAnnouncementParam extends BaseParam { private String causeOfAction; @Schema(description = "涉案金额") - @QueryField(type = QueryType.EQ) - private BigDecimal involvedAmount; + private String involvedAmount; @Schema(description = "法院") private String courtName; diff --git a/src/main/java/com/gxwebsoft/credit/param/CreditCourtSessionParam.java b/src/main/java/com/gxwebsoft/credit/param/CreditCourtSessionParam.java index 276254f..d29f0b8 100644 --- a/src/main/java/com/gxwebsoft/credit/param/CreditCourtSessionParam.java +++ b/src/main/java/com/gxwebsoft/credit/param/CreditCourtSessionParam.java @@ -49,8 +49,7 @@ public class CreditCourtSessionParam extends BaseParam { private String causeOfAction; @Schema(description = "涉案金额") - @QueryField(type = QueryType.EQ) - private BigDecimal involvedAmount; + private String involvedAmount; @Schema(description = "法院") private String courtName; diff --git a/src/main/java/com/gxwebsoft/credit/param/CreditCustomerImportParam.java b/src/main/java/com/gxwebsoft/credit/param/CreditCustomerImportParam.java new file mode 100644 index 0000000..1a06637 --- /dev/null +++ b/src/main/java/com/gxwebsoft/credit/param/CreditCustomerImportParam.java @@ -0,0 +1,32 @@ +package com.gxwebsoft.credit.param; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.io.Serializable; + +/** + * 客户导入参数 + */ +@Data +public class CreditCustomerImportParam implements Serializable { + private static final long serialVersionUID = 1L; + + @Excel(name = "客户") + private String name; + + @Excel(name = "状态") + private String statusTxt; + + @Excel(name = "销售金额(万元)") + private String price; + + @Excel(name = "公开日期") + private String publicDate; + + @Excel(name = "数据来源") + private String dataSource; + + @Excel(name = "备注") + private String comments; +} diff --git a/src/main/java/com/gxwebsoft/credit/param/CreditDeliveryNoticeParam.java b/src/main/java/com/gxwebsoft/credit/param/CreditDeliveryNoticeParam.java index 339db1f..021c65c 100644 --- a/src/main/java/com/gxwebsoft/credit/param/CreditDeliveryNoticeParam.java +++ b/src/main/java/com/gxwebsoft/credit/param/CreditDeliveryNoticeParam.java @@ -49,8 +49,7 @@ public class CreditDeliveryNoticeParam extends BaseParam { private String causeOfAction; @Schema(description = "涉案金额") - @QueryField(type = QueryType.EQ) - private BigDecimal involvedAmount; + private String involvedAmount; @Schema(description = "法院") private String courtName; diff --git a/src/main/java/com/gxwebsoft/credit/param/CreditFinalVersionParam.java b/src/main/java/com/gxwebsoft/credit/param/CreditFinalVersionParam.java index a65cf97..3f3cdc2 100644 --- a/src/main/java/com/gxwebsoft/credit/param/CreditFinalVersionParam.java +++ b/src/main/java/com/gxwebsoft/credit/param/CreditFinalVersionParam.java @@ -49,8 +49,7 @@ public class CreditFinalVersionParam extends BaseParam { private String causeOfAction; @Schema(description = "涉案金额") - @QueryField(type = QueryType.EQ) - private BigDecimal involvedAmount; + private String involvedAmount; @Schema(description = "法院") private String courtName; diff --git a/src/main/java/com/gxwebsoft/credit/param/CreditGqdjParam.java b/src/main/java/com/gxwebsoft/credit/param/CreditGqdjParam.java index 13ee8b7..0fa9fa1 100644 --- a/src/main/java/com/gxwebsoft/credit/param/CreditGqdjParam.java +++ b/src/main/java/com/gxwebsoft/credit/param/CreditGqdjParam.java @@ -49,8 +49,7 @@ public class CreditGqdjParam extends BaseParam { private String causeOfAction; @Schema(description = "涉案金额") - @QueryField(type = QueryType.EQ) - private BigDecimal involvedAmount; + private String involvedAmount; @Schema(description = "法院") private String courtName; diff --git a/src/main/java/com/gxwebsoft/credit/param/CreditJudicialDocumentParam.java b/src/main/java/com/gxwebsoft/credit/param/CreditJudicialDocumentParam.java index 46b262c..549c18b 100644 --- a/src/main/java/com/gxwebsoft/credit/param/CreditJudicialDocumentParam.java +++ b/src/main/java/com/gxwebsoft/credit/param/CreditJudicialDocumentParam.java @@ -49,8 +49,7 @@ public class CreditJudicialDocumentParam extends BaseParam { private String causeOfAction; @Schema(description = "涉案金额") - @QueryField(type = QueryType.EQ) - private BigDecimal involvedAmount; + private String involvedAmount; @Schema(description = "法院") private String courtName; diff --git a/src/main/java/com/gxwebsoft/credit/param/CreditMediationParam.java b/src/main/java/com/gxwebsoft/credit/param/CreditMediationParam.java index dc8bfd1..4c67448 100644 --- a/src/main/java/com/gxwebsoft/credit/param/CreditMediationParam.java +++ b/src/main/java/com/gxwebsoft/credit/param/CreditMediationParam.java @@ -49,8 +49,7 @@ public class CreditMediationParam extends BaseParam { private String causeOfAction; @Schema(description = "涉案金额") - @QueryField(type = QueryType.EQ) - private BigDecimal involvedAmount; + private String involvedAmount; @Schema(description = "法院") private String courtName; diff --git a/src/main/java/com/gxwebsoft/credit/param/CreditSupplierParam.java b/src/main/java/com/gxwebsoft/credit/param/CreditSupplierParam.java index e750326..a332581 100644 --- a/src/main/java/com/gxwebsoft/credit/param/CreditSupplierParam.java +++ b/src/main/java/com/gxwebsoft/credit/param/CreditSupplierParam.java @@ -34,8 +34,7 @@ public class CreditSupplierParam extends BaseParam { private String statusTxt; @Schema(description = "采购金额(万元)") - @QueryField(type = QueryType.EQ) - private BigDecimal purchaseAmount; + private String purchaseAmount; @Schema(description = "公开日期") private String publicDate; diff --git a/src/main/java/com/gxwebsoft/credit/param/CreditXgxfParam.java b/src/main/java/com/gxwebsoft/credit/param/CreditXgxfParam.java index d2daaef..5537d88 100644 --- a/src/main/java/com/gxwebsoft/credit/param/CreditXgxfParam.java +++ b/src/main/java/com/gxwebsoft/credit/param/CreditXgxfParam.java @@ -49,8 +49,7 @@ public class CreditXgxfParam extends BaseParam { private String causeOfAction; @Schema(description = "涉案金额") - @QueryField(type = QueryType.EQ) - private BigDecimal involvedAmount; + private String involvedAmount; @Schema(description = "法院") private String courtName;