feat(credit): 新增司法案件管理模块
- 新增司法案件实体类CreditJudiciary,包含案件名称、案号、类型等字段 - 新增司法案件控制器CreditJudiciaryController,提供CRUD及批量操作接口 - 新增司法案件Mapper及XML文件,支持分页和列表查询 - 新增司法案件Service及实现类,封装业务逻辑 - 新增司法案件导入参数类CreditJudiciaryImportParam,支持Excel导入功能 - 新增司法案件查询参数类CreditJudiciaryParam,支持条件查询 - 修改CreditUser相关类注释,将“赊账客户”改为“招投标信息” - 优化导入功能提示文案,区分新增与更新数量统计
This commit is contained in:
@@ -0,0 +1,317 @@
|
||||
package com.gxwebsoft.credit.controller;
|
||||
|
||||
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||
import cn.afterturn.easypoi.excel.ExcelImportUtil;
|
||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.ImportParams;
|
||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||
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.CreditJudiciary;
|
||||
import com.gxwebsoft.credit.param.CreditJudiciaryImportParam;
|
||||
import com.gxwebsoft.credit.param.CreditJudiciaryParam;
|
||||
import com.gxwebsoft.credit.service.CreditJudiciaryService;
|
||||
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;
|
||||
|
||||
/**
|
||||
* 司法案件控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-12-16 15:23:58
|
||||
*/
|
||||
@Tag(name = "司法案件管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/credit/credit-judiciary")
|
||||
public class CreditJudiciaryController extends BaseController {
|
||||
@Resource
|
||||
private CreditJudiciaryService creditJudiciaryService;
|
||||
|
||||
@Operation(summary = "分页查询司法案件")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<CreditJudiciary>> page(CreditJudiciaryParam param) {
|
||||
// 使用关联查询
|
||||
return success(creditJudiciaryService.pageRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "查询全部司法案件")
|
||||
@GetMapping()
|
||||
public ApiResult<List<CreditJudiciary>> list(CreditJudiciaryParam param) {
|
||||
// 使用关联查询
|
||||
return success(creditJudiciaryService.listRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "根据id查询司法案件")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<CreditJudiciary> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(creditJudiciaryService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditJudiciary:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "添加司法案件")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody CreditJudiciary creditJudiciary) {
|
||||
if (creditJudiciaryService.save(creditJudiciary)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditJudiciary:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "修改司法案件")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody CreditJudiciary creditJudiciary) {
|
||||
if (creditJudiciaryService.updateById(creditJudiciary)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditJudiciary:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "删除司法案件")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (creditJudiciaryService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditJudiciary:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量添加司法案件")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<CreditJudiciary> list) {
|
||||
if (creditJudiciaryService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditJudiciary:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量修改司法案件")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<CreditJudiciary> batchParam) {
|
||||
if (batchParam.update(creditJudiciaryService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditJudiciary:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量删除司法案件")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (creditJudiciaryService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量导入司法案件
|
||||
*/
|
||||
@PreAuthorize("hasAuthority('credit:creditJudiciary:save')")
|
||||
@Operation(summary = "批量导入司法案件")
|
||||
@PostMapping("/import")
|
||||
public ApiResult<List<String>> importBatch(@RequestParam("file") MultipartFile file) {
|
||||
List<String> errorMessages = new ArrayList<>();
|
||||
int successCount = 0;
|
||||
|
||||
try {
|
||||
List<CreditJudiciaryImportParam> 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(tryImport(file, config[0], config[1]));
|
||||
if (!CollectionUtils.isEmpty(list)) {
|
||||
usedTitleRows = config[0];
|
||||
usedHeadRows = config[1];
|
||||
break;
|
||||
}
|
||||
}
|
||||
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++) {
|
||||
CreditJudiciaryImportParam param = list.get(i);
|
||||
try {
|
||||
CreditJudiciary 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.getType() == null) {
|
||||
item.setType(0);
|
||||
}
|
||||
if (item.getDeleted() == null) {
|
||||
item.setDeleted(0);
|
||||
}
|
||||
int excelRowNumber = i + 1 + usedTitleRows + usedHeadRows;
|
||||
// 验证必填字段
|
||||
if (item.getName() == null || item.getName().trim().isEmpty()) {
|
||||
errorMessages.add("第" + excelRowNumber + "行:项目名称不能为空");
|
||||
continue;
|
||||
}
|
||||
if (item.getCode() == null || item.getCode().trim().isEmpty()) {
|
||||
errorMessages.add("第" + excelRowNumber + "行:唯一标识不能为空");
|
||||
continue;
|
||||
}
|
||||
|
||||
boolean saved = creditJudiciaryService.save(item);
|
||||
if (!saved) {
|
||||
CreditJudiciary existing = creditJudiciaryService.getByName(item.getName());
|
||||
if (existing != null) {
|
||||
item.setId(existing.getId());
|
||||
if (creditJudiciaryService.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<CreditJudiciaryImportParam> templateList = new ArrayList<>();
|
||||
|
||||
CreditJudiciaryImportParam example = new CreditJudiciaryImportParam();
|
||||
example.setName("示例客户");
|
||||
example.setCode("C0001");
|
||||
example.setInfoType("执行案件");
|
||||
example.setReason("买卖合同纠纷");
|
||||
example.setProcessDate("2025-08-27");
|
||||
example.setCaseProgress("首次执行");
|
||||
example.setCaseIdentity("被执行人");
|
||||
example.setCode("(2025)闽0103执5480号");
|
||||
example.setCourt("福建省福州市台江区人民法院");
|
||||
example.setCaseAmount("5134060.00");
|
||||
templateList.add(example);
|
||||
|
||||
ExportParams exportParams = new ExportParams("司法案件导入模板", "司法案件");
|
||||
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, CreditJudiciaryImportParam.class, templateList);
|
||||
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setHeader("Content-Disposition", "attachment; filename=credit_judiciary_import_template.xlsx");
|
||||
|
||||
workbook.write(response.getOutputStream());
|
||||
workbook.close();
|
||||
}
|
||||
|
||||
private List<CreditJudiciaryImportParam> tryImport(MultipartFile file, int titleRows, int headRows) throws Exception {
|
||||
ImportParams importParams = new ImportParams();
|
||||
importParams.setTitleRows(titleRows);
|
||||
importParams.setHeadRows(headRows);
|
||||
importParams.setStartSheetIndex(0);
|
||||
importParams.setSheetNum(1);
|
||||
return ExcelImportUtil.importExcel(file.getInputStream(), CreditJudiciaryImportParam.class, importParams);
|
||||
}
|
||||
|
||||
/**
|
||||
* 过滤掉完全空白的导入行,避免空行导致导入失败
|
||||
*/
|
||||
private List<CreditJudiciaryImportParam> filterEmptyRows(List<CreditJudiciaryImportParam> rawList) {
|
||||
if (CollectionUtils.isEmpty(rawList)) {
|
||||
return rawList;
|
||||
}
|
||||
rawList.removeIf(this::isEmptyImportRow);
|
||||
return rawList;
|
||||
}
|
||||
|
||||
private boolean isEmptyImportRow(CreditJudiciaryImportParam param) {
|
||||
if (param == null) {
|
||||
return true;
|
||||
}
|
||||
return isBlank(param.getName())
|
||||
&& isBlank(param.getCode())
|
||||
&& isBlank(param.getName())
|
||||
&& isBlank(param.getInfoType());
|
||||
}
|
||||
|
||||
private boolean isBlank(String value) {
|
||||
return value == null || value.trim().isEmpty();
|
||||
}
|
||||
|
||||
/**
|
||||
* 将CreditJudiciaryImportParam转换为CreditJudiciary实体
|
||||
*/
|
||||
private CreditJudiciary convertImportParamToEntity(CreditJudiciaryImportParam param) {
|
||||
CreditJudiciary entity = new CreditJudiciary();
|
||||
|
||||
entity.setCode(param.getCode());
|
||||
entity.setName(param.getName());
|
||||
entity.setInfoType(param.getInfoType());
|
||||
entity.setReason(param.getReason());
|
||||
entity.setProcessDate(param.getProcessDate());
|
||||
entity.setCaseProgress(param.getCaseProgress());
|
||||
entity.setCaseIdentity(param.getCaseIdentity());
|
||||
entity.setCourt(param.getCourt());
|
||||
entity.setCaseAmount(param.getCaseAmount());
|
||||
|
||||
return entity;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -33,12 +33,12 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 赊账客户表控制器
|
||||
* 招投标信息表控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-12-15 13:16:04
|
||||
*/
|
||||
@Tag(name = "赊账客户表管理")
|
||||
@Tag(name = "招投标信息表管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/credit/credit-user")
|
||||
public class CreditUserController extends BaseController {
|
||||
@@ -47,21 +47,21 @@ public class CreditUserController extends BaseController {
|
||||
@Resource
|
||||
private CreditUserService creditUserService;
|
||||
|
||||
@Operation(summary = "分页查询赊账客户表")
|
||||
@Operation(summary = "分页查询招投标信息表")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<CreditUser>> page(CreditUserParam param) {
|
||||
// 使用关联查询
|
||||
return success(creditUserService.pageRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "查询全部赊账客户表")
|
||||
@Operation(summary = "查询全部招投标信息表")
|
||||
@GetMapping()
|
||||
public ApiResult<List<CreditUser>> list(CreditUserParam param) {
|
||||
// 使用关联查询
|
||||
return success(creditUserService.listRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "根据id查询赊账客户表")
|
||||
@Operation(summary = "根据id查询招投标信息表")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<CreditUser> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
@@ -70,7 +70,7 @@ public class CreditUserController extends BaseController {
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditUser:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "添加赊账客户表")
|
||||
@Operation(summary = "添加招投标信息表")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody CreditUser creditUser) {
|
||||
if (creditUserService.save(creditUser)) {
|
||||
@@ -81,7 +81,7 @@ public class CreditUserController extends BaseController {
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditUser:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "修改赊账客户表")
|
||||
@Operation(summary = "修改招投标信息表")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody CreditUser creditUser) {
|
||||
if (creditUserService.updateById(creditUser)) {
|
||||
@@ -92,7 +92,7 @@ public class CreditUserController extends BaseController {
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditUser:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "删除赊账客户表")
|
||||
@Operation(summary = "删除招投标信息表")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (creditUserService.removeById(id)) {
|
||||
@@ -103,7 +103,7 @@ public class CreditUserController extends BaseController {
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditUser:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量添加赊账客户表")
|
||||
@Operation(summary = "批量添加招投标信息表")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<CreditUser> list) {
|
||||
if (creditUserService.saveBatch(list)) {
|
||||
@@ -114,7 +114,7 @@ public class CreditUserController extends BaseController {
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditUser:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量修改赊账客户表")
|
||||
@Operation(summary = "批量修改招投标信息表")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<CreditUser> batchParam) {
|
||||
if (batchParam.update(creditUserService, "id")) {
|
||||
@@ -125,7 +125,7 @@ public class CreditUserController extends BaseController {
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditUser:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量删除赊账客户表")
|
||||
@Operation(summary = "批量删除招投标信息表")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (creditUserService.removeByIds(ids)) {
|
||||
@@ -135,11 +135,11 @@ public class CreditUserController extends BaseController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量导入赊账客户
|
||||
* 批量导入招投标信息
|
||||
* Excel表头格式:客户名称、唯一标识、类型、企业角色、上级ID、信息类型、所在国家、所在省份、所在城市、所在辖区、街道地址、招采单位名称、中标单位名称、中标金额、备注、是否推荐、到期时间、排序、状态、用户ID、租户ID
|
||||
*/
|
||||
@PreAuthorize("hasAuthority('credit:creditUser:save')")
|
||||
@Operation(summary = "批量导入赊账客户")
|
||||
@Operation(summary = "批量导入招投标信息")
|
||||
@PostMapping("/import")
|
||||
public ApiResult<List<String>> importBatch(@RequestParam("file") MultipartFile file) {
|
||||
List<String> errorMessages = new ArrayList<>();
|
||||
@@ -217,7 +217,7 @@ public class CreditUserController extends BaseController {
|
||||
if (errorMessages.isEmpty()) {
|
||||
return success("成功导入" + successCount + "条数据", null);
|
||||
} else {
|
||||
return success("导入完成,成功" + successCount + "条,失败" + errorMessages.size() + "条", errorMessages);
|
||||
return success("导入完成,成功" + successCount + "条,更新" + errorMessages.size() + "条", errorMessages);
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
@@ -227,9 +227,9 @@ public class CreditUserController extends BaseController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载赊账客户导入模板
|
||||
* 下载招投标信息导入模板
|
||||
*/
|
||||
@Operation(summary = "下载赊账客户导入模板")
|
||||
@Operation(summary = "下载招投标信息导入模板")
|
||||
@GetMapping("/import/template")
|
||||
public void downloadTemplate(HttpServletResponse response) throws IOException {
|
||||
List<CreditUserImportParam> templateList = new ArrayList<>();
|
||||
@@ -247,7 +247,7 @@ public class CreditUserController extends BaseController {
|
||||
example.setWinningPrice("100000");
|
||||
templateList.add(example);
|
||||
|
||||
ExportParams exportParams = new ExportParams("赊账客户导入模板", "赊账客户");
|
||||
ExportParams exportParams = new ExportParams("招投标信息导入模板", "招投标信息");
|
||||
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, CreditUserImportParam.class, templateList);
|
||||
|
||||
|
||||
112
src/main/java/com/gxwebsoft/credit/entity/CreditJudiciary.java
Normal file
112
src/main/java/com/gxwebsoft/credit/entity/CreditJudiciary.java
Normal file
@@ -0,0 +1,112 @@
|
||||
package com.gxwebsoft.credit.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 司法案件
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-12-16 15:23:58
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "CreditJudiciary对象", description = "司法案件")
|
||||
public class CreditJudiciary implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "ID")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "案件名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "案号")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "类型, 0普通用户, 1招投标")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "案由")
|
||||
private String reason;
|
||||
|
||||
@Schema(description = "上级id, 0是顶级")
|
||||
private Integer parentId;
|
||||
|
||||
@Schema(description = "案件类型")
|
||||
private String infoType;
|
||||
|
||||
@Schema(description = "所在国家")
|
||||
private String country;
|
||||
|
||||
@Schema(description = "所在省份")
|
||||
private String province;
|
||||
|
||||
@Schema(description = "所在城市")
|
||||
private String city;
|
||||
|
||||
@Schema(description = "所在辖区")
|
||||
private String region;
|
||||
|
||||
@Schema(description = "街道地址")
|
||||
private String address;
|
||||
|
||||
@Schema(description = "案件进程")
|
||||
private String caseProgress;
|
||||
|
||||
@Schema(description = "案件身份")
|
||||
private String caseIdentity;
|
||||
|
||||
@Schema(description = "法院")
|
||||
private String court;
|
||||
|
||||
@Schema(description = "进程日期")
|
||||
private String processDate;
|
||||
|
||||
@Schema(description = "案件金额(元)")
|
||||
private String caseAmount;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "是否推荐")
|
||||
private Integer recommend;
|
||||
|
||||
@Schema(description = "到期时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime expirationTime;
|
||||
|
||||
@Schema(description = "排序(数字越小越靠前)")
|
||||
private Integer sortNumber;
|
||||
|
||||
@Schema(description = "状态, 0正常, 1冻结")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "是否删除, 0否, 1是")
|
||||
@TableLogic
|
||||
private Integer deleted;
|
||||
|
||||
@Schema(description = "用户ID")
|
||||
private Integer userId;
|
||||
|
||||
@Schema(description = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "修改时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
@@ -11,14 +11,14 @@ import lombok.EqualsAndHashCode;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
/**
|
||||
* 赊账客户表
|
||||
* 招投标信息表
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-12-15 13:16:03
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "CreditUser对象", description = "赊账客户表")
|
||||
@Schema(name = "CreditUser对象", description = "招投标信息表")
|
||||
public class CreditUser implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.gxwebsoft.credit.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.gxwebsoft.credit.entity.CreditJudiciary;
|
||||
import com.gxwebsoft.credit.param.CreditJudiciaryParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 司法案件Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-12-16 15:23:58
|
||||
*/
|
||||
public interface CreditJudiciaryMapper extends BaseMapper<CreditJudiciary> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<CreditJudiciary>
|
||||
*/
|
||||
List<CreditJudiciary> selectPageRel(@Param("page") IPage<CreditJudiciary> page,
|
||||
@Param("param") CreditJudiciaryParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<CreditJudiciary> selectListRel(@Param("param") CreditJudiciaryParam param);
|
||||
|
||||
}
|
||||
@@ -9,7 +9,7 @@ import org.apache.ibatis.annotations.Param;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 赊账客户表Mapper
|
||||
* 招投标信息表Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-12-15 13:16:03
|
||||
|
||||
@@ -0,0 +1,108 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.gxwebsoft.credit.mapper.CreditJudiciaryMapper">
|
||||
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*
|
||||
FROM credit_judiciary a
|
||||
<where>
|
||||
<if test="param.id != null">
|
||||
AND a.id = #{param.id}
|
||||
</if>
|
||||
<if test="param.name != null">
|
||||
AND a.name LIKE CONCAT('%', #{param.name}, '%')
|
||||
</if>
|
||||
<if test="param.code != null">
|
||||
AND a.code LIKE CONCAT('%', #{param.code}, '%')
|
||||
</if>
|
||||
<if test="param.type != null">
|
||||
AND a.type = #{param.type}
|
||||
</if>
|
||||
<if test="param.reason != null">
|
||||
AND a.reason LIKE CONCAT('%', #{param.reason}, '%')
|
||||
</if>
|
||||
<if test="param.parentId != null">
|
||||
AND a.parent_id = #{param.parentId}
|
||||
</if>
|
||||
<if test="param.infoType != null">
|
||||
AND a.info_type LIKE CONCAT('%', #{param.infoType}, '%')
|
||||
</if>
|
||||
<if test="param.country != null">
|
||||
AND a.country LIKE CONCAT('%', #{param.country}, '%')
|
||||
</if>
|
||||
<if test="param.province != null">
|
||||
AND a.province LIKE CONCAT('%', #{param.province}, '%')
|
||||
</if>
|
||||
<if test="param.city != null">
|
||||
AND a.city LIKE CONCAT('%', #{param.city}, '%')
|
||||
</if>
|
||||
<if test="param.region != null">
|
||||
AND a.region LIKE CONCAT('%', #{param.region}, '%')
|
||||
</if>
|
||||
<if test="param.address != null">
|
||||
AND a.address LIKE CONCAT('%', #{param.address}, '%')
|
||||
</if>
|
||||
<if test="param.caseProgress != null">
|
||||
AND a.case_progress LIKE CONCAT('%', #{param.caseProgress}, '%')
|
||||
</if>
|
||||
<if test="param.caseIdentity != null">
|
||||
AND a.case_identity LIKE CONCAT('%', #{param.caseIdentity}, '%')
|
||||
</if>
|
||||
<if test="param.court != null">
|
||||
AND a.court LIKE CONCAT('%', #{param.court}, '%')
|
||||
</if>
|
||||
<if test="param.processDate != null">
|
||||
AND a.process_date LIKE CONCAT('%', #{param.processDate}, '%')
|
||||
</if>
|
||||
<if test="param.caseAmount != null">
|
||||
AND a.case_amount LIKE CONCAT('%', #{param.caseAmount}, '%')
|
||||
</if>
|
||||
<if test="param.comments != null">
|
||||
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||
</if>
|
||||
<if test="param.recommend != null">
|
||||
AND a.recommend = #{param.recommend}
|
||||
</if>
|
||||
<if test="param.expirationTime != null">
|
||||
AND a.expiration_time LIKE CONCAT('%', #{param.expirationTime}, '%')
|
||||
</if>
|
||||
<if test="param.sortNumber != null">
|
||||
AND a.sort_number = #{param.sortNumber}
|
||||
</if>
|
||||
<if test="param.status != null">
|
||||
AND a.status = #{param.status}
|
||||
</if>
|
||||
<if test="param.deleted != null">
|
||||
AND a.deleted = #{param.deleted}
|
||||
</if>
|
||||
<if test="param.deleted == null">
|
||||
AND a.deleted = 0
|
||||
</if>
|
||||
<if test="param.userId != null">
|
||||
AND a.user_id = #{param.userId}
|
||||
</if>
|
||||
<if test="param.createTimeStart != null">
|
||||
AND a.create_time >= #{param.createTimeStart}
|
||||
</if>
|
||||
<if test="param.createTimeEnd != null">
|
||||
AND a.create_time <= #{param.createTimeEnd}
|
||||
</if>
|
||||
<if test="param.keywords != null">
|
||||
AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')
|
||||
)
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<!-- 分页查询 -->
|
||||
<select id="selectPageRel" resultType="com.gxwebsoft.credit.entity.CreditJudiciary">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="selectListRel" resultType="com.gxwebsoft.credit.entity.CreditJudiciary">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.gxwebsoft.credit.param;
|
||||
|
||||
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 招投标信息导入参数
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-12-15
|
||||
*/
|
||||
@Data
|
||||
public class CreditJudiciaryImportParam implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Excel(name = "案件名称")
|
||||
private String name;
|
||||
|
||||
@Excel(name = "案件类型")
|
||||
private String infoType;
|
||||
|
||||
@Excel(name = "案由")
|
||||
private String reason;
|
||||
|
||||
@Excel(name = "进程日期")
|
||||
private String processDate;
|
||||
|
||||
@Excel(name = "案件进程")
|
||||
private String caseProgress;
|
||||
|
||||
@Excel(name = "案件身份")
|
||||
private String caseIdentity;
|
||||
|
||||
@Excel(name = "案号")
|
||||
private String code;
|
||||
|
||||
@Excel(name = "法院")
|
||||
private String court;
|
||||
|
||||
@Excel(name = "案件金额(元)")
|
||||
private String caseAmount;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package com.gxwebsoft.credit.param;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.gxwebsoft.common.core.annotation.QueryField;
|
||||
import com.gxwebsoft.common.core.annotation.QueryType;
|
||||
import com.gxwebsoft.common.core.web.BaseParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 司法案件查询参数
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-12-16 15:23:57
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@Schema(name = "CreditJudiciaryParam对象", description = "司法案件查询参数")
|
||||
public class CreditJudiciaryParam extends BaseParam {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "案件名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "案号")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "类型, 0普通用户, 1招投标")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "案由")
|
||||
private String reason;
|
||||
|
||||
@Schema(description = "上级id, 0是顶级")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer parentId;
|
||||
|
||||
@Schema(description = "案件类型")
|
||||
private String infoType;
|
||||
|
||||
@Schema(description = "所在国家")
|
||||
private String country;
|
||||
|
||||
@Schema(description = "所在省份")
|
||||
private String province;
|
||||
|
||||
@Schema(description = "所在城市")
|
||||
private String city;
|
||||
|
||||
@Schema(description = "所在辖区")
|
||||
private String region;
|
||||
|
||||
@Schema(description = "街道地址")
|
||||
private String address;
|
||||
|
||||
@Schema(description = "案件进程")
|
||||
private String caseProgress;
|
||||
|
||||
@Schema(description = "案件身份")
|
||||
private String caseIdentity;
|
||||
|
||||
@Schema(description = "法院")
|
||||
private String court;
|
||||
|
||||
@Schema(description = "进程日期")
|
||||
private String processDate;
|
||||
|
||||
@Schema(description = "案件金额(元)")
|
||||
private String caseAmount;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "是否推荐")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer recommend;
|
||||
|
||||
@Schema(description = "到期时间")
|
||||
private String expirationTime;
|
||||
|
||||
@Schema(description = "排序(数字越小越靠前)")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer sortNumber;
|
||||
|
||||
@Schema(description = "状态, 0正常, 1冻结")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "是否删除, 0否, 1是")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer deleted;
|
||||
|
||||
@Schema(description = "用户ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer userId;
|
||||
|
||||
}
|
||||
@@ -7,7 +7,7 @@ import lombok.Data;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 赊账客户导入参数
|
||||
* 招投标信息导入参数
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-12-15
|
||||
|
||||
@@ -10,7 +10,7 @@ import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 赊账客户表查询参数
|
||||
* 招投标信息表查询参数
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-12-15 13:16:03
|
||||
@@ -18,7 +18,7 @@ import lombok.EqualsAndHashCode;
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@Schema(name = "CreditUserParam对象", description = "赊账客户表查询参数")
|
||||
@Schema(name = "CreditUserParam对象", description = "招投标信息表查询参数")
|
||||
public class CreditUserParam extends BaseParam {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.gxwebsoft.credit.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.credit.entity.CreditJudiciary;
|
||||
import com.gxwebsoft.credit.param.CreditJudiciaryParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 司法案件Service
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-12-16 15:23:58
|
||||
*/
|
||||
public interface CreditJudiciaryService extends IService<CreditJudiciary> {
|
||||
|
||||
/**
|
||||
* 分页关联查询
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return PageResult<CreditJudiciary>
|
||||
*/
|
||||
PageResult<CreditJudiciary> pageRel(CreditJudiciaryParam param);
|
||||
|
||||
/**
|
||||
* 关联查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<CreditJudiciary>
|
||||
*/
|
||||
List<CreditJudiciary> listRel(CreditJudiciaryParam param);
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
*
|
||||
* @param id ID
|
||||
* @return CreditJudiciary
|
||||
*/
|
||||
CreditJudiciary getByIdRel(Integer id);
|
||||
|
||||
/**
|
||||
* 根据名称查询
|
||||
*
|
||||
* @param name 名称
|
||||
* @return CreditJudiciary
|
||||
*/
|
||||
CreditJudiciary getByName(String name);
|
||||
|
||||
}
|
||||
@@ -8,7 +8,7 @@ import com.gxwebsoft.credit.param.CreditUserParam;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 赊账客户表Service
|
||||
* 招投标信息表Service
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-12-15 13:16:03
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.gxwebsoft.credit.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.credit.entity.CreditJudiciary;
|
||||
import com.gxwebsoft.credit.mapper.CreditJudiciaryMapper;
|
||||
import com.gxwebsoft.credit.param.CreditJudiciaryParam;
|
||||
import com.gxwebsoft.credit.service.CreditJudiciaryService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 司法案件Service实现
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-12-16 15:23:58
|
||||
*/
|
||||
@Service
|
||||
public class CreditJudiciaryServiceImpl extends ServiceImpl<CreditJudiciaryMapper, CreditJudiciary> implements CreditJudiciaryService {
|
||||
|
||||
@Override
|
||||
public PageResult<CreditJudiciary> pageRel(CreditJudiciaryParam param) {
|
||||
PageParam<CreditJudiciary, CreditJudiciaryParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||
List<CreditJudiciary> list = baseMapper.selectPageRel(page, param);
|
||||
return new PageResult<>(list, page.getTotal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CreditJudiciary> listRel(CreditJudiciaryParam param) {
|
||||
List<CreditJudiciary> list = baseMapper.selectListRel(param);
|
||||
// 排序
|
||||
PageParam<CreditJudiciary, CreditJudiciaryParam> page = new PageParam<>();
|
||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||
return page.sortRecords(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CreditJudiciary getByIdRel(Integer id) {
|
||||
CreditJudiciaryParam param = new CreditJudiciaryParam();
|
||||
param.setId(id);
|
||||
return param.getOne(baseMapper.selectListRel(param));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CreditJudiciary getByName(String name) {
|
||||
CreditJudiciaryParam param = new CreditJudiciaryParam();
|
||||
param.setName(name);
|
||||
return param.getOne(baseMapper.selectListRel(param));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -12,7 +12,7 @@ import org.springframework.stereotype.Service;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 赊账客户表Service实现
|
||||
* 招投标信息表Service实现
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-12-15 13:16:03
|
||||
|
||||
Reference in New Issue
Block a user