Compare commits
10 Commits
b43f8ffc76
...
0195e12409
| Author | SHA1 | Date | |
|---|---|---|---|
| 0195e12409 | |||
| 3536028766 | |||
| c1d045b9b2 | |||
| 0c6cb13ca7 | |||
| 42ebdf5653 | |||
| cb8cc3c530 | |||
| 6affaba5c3 | |||
| 57cdb72208 | |||
| 6321b69dc2 | |||
| 14d1c83139 |
@@ -31,7 +31,7 @@
|
||||
|
||||
#### 外部服务
|
||||
- **MQTT服务**: 连接成功 ✅
|
||||
- 服务器: tcp://1.14.159.185:1883
|
||||
- 服务器: tcp://132.232.214.96:1883
|
||||
- 客户端ID: hjm_car_1753549632706
|
||||
- 主题订阅: /SW_GPS/#
|
||||
- **Redis**: 连接配置正常 ✅
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.gxwebsoft.ai.config;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Data
|
||||
@Component
|
||||
@ConfigurationProperties(prefix = "aliyun.knowledge-base")
|
||||
public class KnowledgeBaseConfig {
|
||||
|
||||
private String accessKeyId;
|
||||
private String accessKeySecret;
|
||||
private String workspaceId;
|
||||
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
package com.gxwebsoft.ai.config;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Data
|
||||
@Component
|
||||
@ConfigurationProperties(prefix = "ai.template")
|
||||
public class TemplateConfig {
|
||||
private String wordTemplatePath;
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package com.gxwebsoft.ai.constants;
|
||||
|
||||
public class KnowledgeBaseConstants {
|
||||
|
||||
public static final String[] KEY_WORDS = {
|
||||
"",
|
||||
"审计依据 法律法规 审计业务约定书 经济责任审计管理办法 中共中央办公厅 国务院办公厅 党政主要领导干部审计规定 国家法规 公司管理制度 年度工作目标 党政主要领导干部经济责任审计规定",
|
||||
"审计目标 经济责任审计目标 资产负债损益真实性 合法性 效益性 经济指标完成情况 重大决策执行 遵守财经法规 国有资产保值增值 经济责任评价 任职期间履职评价 责任界定 业绩评价",
|
||||
"审计对象 审计范围 被审计领导干部 [职务] [姓名] 任职期间 [开始日期]至[结束日期] 职务任期 重大问题追溯 重要事项延伸 审计时限 下属子公司 代管企业",
|
||||
"被审计单位基本情况 单位概况 组织机构 人员结构 财务会计政策 合并口径财务数据 资产总额 负债总额 营业收入 利润 内部控制制度 子公司 代管企业 职能部门设置 合并财务报表",
|
||||
"审计内容 审计重点 贯彻执行经济方针 重大决策执行 发展战略 年度目标完成 法人治理结构 内部控制 财务真实性 风险管控 党风廉政建设 以往审计整改 三重一大经济决策 资产管理 采购管理 债权债务",
|
||||
"审计风险 证据不充分 评价不客观 内部控制失效 法律法规变化 风险应对策略 审计证据充分性 评价客观性 内部控制审查 法规政策跟踪 重要性水平",
|
||||
"审计方法 穿行测试 趋势分析 比率分析 访谈法 数据分析 分析性程序 检查 监盘 观察 询问 函证 计算 重新执行",
|
||||
"审计步骤 时间安排 准备阶段 实施阶段 报告阶段 归档阶段 审计人员安排 资料收集 实质性程序 审计报告编写 交换意见 审计归档 进点会 进度表",
|
||||
"审计组织实施 审计组人员分工 职责分配 审计工作计划 前期调研 审前培训 实地审计 质量控制 内部培训 沟通协调 分级复核 集体讨论 重大事项汇报 里程碑事件清单 审计工作组 项目负责人 主审"
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
@@ -1,144 +0,0 @@
|
||||
package com.gxwebsoft.ai.controller;
|
||||
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.poi.openxml4j.util.ZipSecureFile;
|
||||
import org.apache.poi.xwpf.usermodel.XWPFDocument;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.gxwebsoft.ai.config.TemplateConfig;
|
||||
import com.gxwebsoft.ai.dto.AuditReportRequest;
|
||||
import com.gxwebsoft.ai.dto.KnowledgeBaseRequest;
|
||||
import com.gxwebsoft.ai.enums.AuditReportEnum;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
|
||||
import cn.afterturn.easypoi.word.WordExportUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
|
||||
/**
|
||||
* 审计报告控制器
|
||||
* @author GIIT-YC
|
||||
*
|
||||
*/
|
||||
@Tag(name = "审计报告")
|
||||
@RestController
|
||||
@RequestMapping("/api/ai/auditReport")
|
||||
public class AuditReportController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private TemplateConfig templateConfig;
|
||||
|
||||
@Autowired
|
||||
private KnowledgeBaseController knowledgeBaseController;
|
||||
|
||||
private String invok(String query, String knowledge, String history, String suggestion, String userName) {
|
||||
// 构建请求体
|
||||
JSONObject requestBody = new JSONObject();
|
||||
JSONObject inputs = new JSONObject();
|
||||
inputs.put("query", query);
|
||||
inputs.put("knowledge", knowledge);
|
||||
inputs.put("history", history);
|
||||
inputs.put("suggestion", suggestion);
|
||||
|
||||
requestBody.put("inputs", inputs);
|
||||
requestBody.put("response_mode", "blocking");
|
||||
requestBody.put("user", userName);
|
||||
|
||||
// 发送 POST 请求
|
||||
String result = HttpUtil.createPost("http://1.14.159.185:8180/v1/workflows/run")
|
||||
.header("Authorization", "Bearer app-d7Ok9FECVZG2Ybw9wpg7tGu9")
|
||||
.header("Content-Type", "application/json")
|
||||
.body(requestBody.toString())
|
||||
.timeout(600000)
|
||||
.execute()
|
||||
.body();
|
||||
// 解析返回的JSON字符串
|
||||
JSONObject jsonResponse = JSONObject.parseObject(result);
|
||||
// 获取data字段
|
||||
JSONObject data = jsonResponse.getJSONObject("data");
|
||||
// 获取outputs字段
|
||||
JSONObject outputs = data.getJSONObject("outputs");
|
||||
// 获取outputs中的result字符串
|
||||
String resultStr = outputs.getString("result");
|
||||
return resultStr;
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成审计报告-单一模块
|
||||
*/
|
||||
@Operation(summary = "生成审计报告-单一模块")
|
||||
@PostMapping("/generate")
|
||||
public ApiResult<?> generateAuditReport(@RequestBody AuditReportRequest req) {
|
||||
final User loginUser = getLoginUser();
|
||||
|
||||
KnowledgeBaseRequest knowledgeBaseRequest = new KnowledgeBaseRequest();
|
||||
knowledgeBaseRequest.setKbId(req.getKbId());
|
||||
knowledgeBaseRequest.setFormCommit((req.getFormCommit() > 10) ? req.getFormCommit() / 10 : req.getFormCommit());
|
||||
String knowledge = knowledgeBaseController.query(knowledgeBaseRequest).getData().toString();
|
||||
|
||||
String query = AuditReportEnum.getByCode(req.getFormCommit()).getDesc();
|
||||
String ret = this.invok(query, knowledge, req.getHistory(), req.getSuggestion(), loginUser.getUsername());
|
||||
|
||||
return success(ret);
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成并下载审计报告
|
||||
*/
|
||||
@Operation(summary = "生成并下载审计报告")
|
||||
@PostMapping("/download")
|
||||
public void downloadAuditReport(@RequestBody AuditReportRequest req, HttpServletResponse response) {
|
||||
// 保存原始的安全阈值
|
||||
double originalMinInflateRatio = ZipSecureFile.getMinInflateRatio();
|
||||
|
||||
try {
|
||||
// 降低Zip bomb检测的阈值,解决模板文件的安全检测问题
|
||||
ZipSecureFile.setMinInflateRatio(0.001);
|
||||
|
||||
// 准备模板数据
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put(AuditReportEnum.AUDIT_TITLE.getCode().toString(), req.getFrom0());
|
||||
map.put(AuditReportEnum.AUDIT_BASIS.getCode().toString(), req.getFrom1());
|
||||
map.put(AuditReportEnum.AUDIT_OBJECTIVE.getCode().toString(), req.getFrom2());
|
||||
map.put(AuditReportEnum.AUDIT_SCOPE.getCode().toString(), req.getFrom3());
|
||||
map.put(AuditReportEnum.UNIT_OVERVIEW.getCode().toString(), req.getFrom41());
|
||||
map.put(AuditReportEnum.ORG_AND_PERSONNEL.getCode().toString(), req.getFrom42());
|
||||
map.put(AuditReportEnum.AUDIT_CONTENT_METHODS.getCode().toString(), req.getFrom5());
|
||||
|
||||
// 使用Easypoi的Word模板功能
|
||||
XWPFDocument document = WordExportUtil.exportWord07(templateConfig.getWordTemplatePath(), map);
|
||||
|
||||
// 设置响应头
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.wordprocessingml.document");
|
||||
response.setHeader("Content-Disposition", "attachment; filename=audit_report.docx");
|
||||
|
||||
// 输出到响应流
|
||||
OutputStream out = response.getOutputStream();
|
||||
document.write(out);
|
||||
out.flush();
|
||||
out.close();
|
||||
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("生成审计报告失败", e);
|
||||
} finally {
|
||||
// 恢复原始的安全阈值
|
||||
ZipSecureFile.setMinInflateRatio(originalMinInflateRatio);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,59 +0,0 @@
|
||||
package com.gxwebsoft.ai.controller;
|
||||
|
||||
import com.aliyun.bailian20231229.Client;
|
||||
import com.aliyun.bailian20231229.models.RetrieveResponse;
|
||||
import com.aliyun.bailian20231229.models.RetrieveResponseBody.RetrieveResponseBodyDataNodes;
|
||||
import com.gxwebsoft.ai.config.KnowledgeBaseConfig;
|
||||
import com.gxwebsoft.ai.constants.KnowledgeBaseConstants;
|
||||
import com.gxwebsoft.ai.factory.KnowledgeBaseClientFactory;
|
||||
import com.gxwebsoft.ai.util.KnowledgeBaseRetrieve;
|
||||
import com.gxwebsoft.ai.dto.KnowledgeBaseRequest;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
@Tag(name = "知识库")
|
||||
@RestController
|
||||
@RequestMapping("/api/ai/knowledgeBase")
|
||||
public class KnowledgeBaseController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private KnowledgeBaseConfig config;
|
||||
|
||||
@Autowired
|
||||
private KnowledgeBaseClientFactory clientFactory;
|
||||
|
||||
@Operation(summary = "查询知识库")
|
||||
@GetMapping("/query")
|
||||
public ApiResult<?> query(KnowledgeBaseRequest req) {
|
||||
Set<String> ret = new LinkedHashSet<>();
|
||||
String workspaceId = config.getWorkspaceId();
|
||||
List<String> keyWords = Arrays.asList(KnowledgeBaseConstants.KEY_WORDS);
|
||||
String indexId = req.getKbId();
|
||||
String query = StrUtil.isEmpty(req.getQuery()) ? keyWords.get(req.getFormCommit()) : req.getQuery();
|
||||
Integer topK = req.getTopK() == null ? 10 : req.getTopK();
|
||||
|
||||
try {
|
||||
Client client = clientFactory.createClient();
|
||||
RetrieveResponse resp = KnowledgeBaseRetrieve.retrieveIndex(client, workspaceId, indexId, query);
|
||||
for (RetrieveResponseBodyDataNodes node : resp.getBody().getData().getNodes()) {
|
||||
ret.add(node.getText());
|
||||
if (ret.size() >= topK) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
return fail("查询失败:" + e.getMessage());
|
||||
}
|
||||
return success(ret);
|
||||
}
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
package com.gxwebsoft.ai.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class AuditReportRequest{
|
||||
|
||||
@Schema(description = "审计标题")
|
||||
private String from0;
|
||||
|
||||
@Schema(description = "审计依据")
|
||||
private String from1;
|
||||
|
||||
@Schema(description = "审计目标")
|
||||
private String from2;
|
||||
|
||||
@Schema(description = "审计对象和范围")
|
||||
private String from3;
|
||||
|
||||
@Schema(description = "被审计单位基本情况-单位概况")
|
||||
private String from41;
|
||||
|
||||
@Schema(description = "被审计单位基本情况-机构和人员相关情况")
|
||||
private String from42;
|
||||
|
||||
@Schema(description = "审计内容和重点及审计方法")
|
||||
private String from5;
|
||||
|
||||
@Schema(description = "知识库ID")
|
||||
private String kbId;
|
||||
|
||||
@Schema(description = "生成模块:AuditReportEnum.code")
|
||||
private Integer formCommit;
|
||||
|
||||
@Schema(description = "历史内容")
|
||||
private String history;
|
||||
|
||||
@Schema(description = "修改建议")
|
||||
private String suggestion;
|
||||
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package com.gxwebsoft.ai.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class KnowledgeBaseRequest {
|
||||
|
||||
@Schema(description = "知识库ID")
|
||||
private String kbId;
|
||||
|
||||
@Schema(description = "召回内容")
|
||||
private String query;
|
||||
|
||||
@Schema(description = "召回模块(1~9)")
|
||||
private Integer formCommit;
|
||||
|
||||
@Schema(description = "返回TOP切片数量")
|
||||
private Integer topK;
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
package com.gxwebsoft.ai.enums;
|
||||
|
||||
public enum AuditReportEnum {
|
||||
|
||||
AUDIT_TITLE(0, "审计标题"),
|
||||
AUDIT_BASIS(1, "审计依据"),
|
||||
AUDIT_OBJECTIVE(2, "审计目标"),
|
||||
AUDIT_SCOPE(3, "审计对象和范围"),
|
||||
UNIT_OVERVIEW(41, "被审计单位基本情况-单位概况"),
|
||||
ORG_AND_PERSONNEL(42, "被审计单位基本情况-机构和人员相关情况"),
|
||||
AUDIT_CONTENT_METHODS(5, "审计内容和重点及审计方法");
|
||||
|
||||
private final Integer code;
|
||||
private final String desc;
|
||||
|
||||
AuditReportEnum(Integer code, String desc) {
|
||||
this.code = code;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
public Integer getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
public static AuditReportEnum getByCode(Integer code) {
|
||||
for (AuditReportEnum value : values()) {
|
||||
if (value.code.equals(code)) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据代码获取描述信息
|
||||
*/
|
||||
public static String getDescByCode(Integer code) {
|
||||
AuditReportEnum enumValue = getByCode(code);
|
||||
return enumValue != null ? enumValue.getDesc() : null;
|
||||
}
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
package com.gxwebsoft.ai.factory;
|
||||
|
||||
import com.aliyun.bailian20231229.Client;
|
||||
import com.aliyun.teaopenapi.models.Config;
|
||||
import com.gxwebsoft.ai.config.KnowledgeBaseConfig;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class KnowledgeBaseClientFactory {
|
||||
|
||||
@Autowired
|
||||
private KnowledgeBaseConfig config;
|
||||
|
||||
public Client createClient() throws Exception {
|
||||
Config authConfig = new Config()
|
||||
.setAccessKeyId(config.getAccessKeyId())
|
||||
.setAccessKeySecret(config.getAccessKeySecret());
|
||||
// 下方接入地址以公有云的公网接入地址为例,可按需更换接入地址。
|
||||
authConfig.endpoint = "bailian.cn-beijing.aliyuncs.com";
|
||||
return new com.aliyun.bailian20231229.Client(authConfig);
|
||||
}
|
||||
}
|
||||
@@ -1,384 +0,0 @@
|
||||
package com.gxwebsoft.ai.util;
|
||||
|
||||
import com.aliyun.bailian20231229.models.*;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.security.MessageDigest;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* 创建知识库
|
||||
* @author GIIT-YC
|
||||
*
|
||||
*/
|
||||
public class KnowledgeBaseCreate {
|
||||
|
||||
String ALIBABA_CLOUD_ACCESS_KEY_ID = "LTAI5tD5YRKuxWz6Eg7qrM4P";
|
||||
String ALIBABA_CLOUD_ACCESS_KEY_SECRET = "bO8TBDXflOwbtSKimPpG8XrJnyzgTk";
|
||||
String WORKSPACE_ID = "llm-4pf5auwewoz34zqu";
|
||||
|
||||
/**
|
||||
* 检查并提示设置必要的环境变量。
|
||||
*
|
||||
* @return true 如果所有必需的环境变量都已设置,否则 false
|
||||
*/
|
||||
public static boolean checkEnvironmentVariables() {
|
||||
Map<String, String> requiredVars = new HashMap<>();
|
||||
requiredVars.put("ALIBABA_CLOUD_ACCESS_KEY_ID", "阿里云访问密钥ID");
|
||||
requiredVars.put("ALIBABA_CLOUD_ACCESS_KEY_SECRET", "阿里云访问密钥密码");
|
||||
requiredVars.put("WORKSPACE_ID", "阿里云百炼业务空间ID");
|
||||
|
||||
List<String> missingVars = new ArrayList<>();
|
||||
for (Map.Entry<String, String> entry : requiredVars.entrySet()) {
|
||||
String value = System.getenv(entry.getKey());
|
||||
if (value == null || value.isEmpty()) {
|
||||
missingVars.add(entry.getKey());
|
||||
System.out.println("错误:请设置 " + entry.getKey() + " 环境变量 (" + entry.getValue() + ")");
|
||||
}
|
||||
}
|
||||
|
||||
return missingVars.isEmpty();
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算文档的MD5值。
|
||||
*
|
||||
* @param filePath 文档本地路径
|
||||
* @return 文档的MD5值
|
||||
* @throws Exception 如果计算过程中发生错误
|
||||
*/
|
||||
public static String calculateMD5(String filePath) throws Exception {
|
||||
MessageDigest md = MessageDigest.getInstance("MD5");
|
||||
try (FileInputStream fis = new FileInputStream(filePath)) {
|
||||
byte[] buffer = new byte[4096];
|
||||
int bytesRead;
|
||||
while ((bytesRead = fis.read(buffer)) != -1) {
|
||||
md.update(buffer, 0, bytesRead);
|
||||
}
|
||||
}
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (byte b : md.digest()) {
|
||||
sb.append(String.format("%02x", b & 0xff));
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取文档大小(以字节为单位)。
|
||||
*
|
||||
* @param filePath 文档本地路径
|
||||
* @return 文档大小(以字节为单位)
|
||||
*/
|
||||
public static String getFileSize(String filePath) {
|
||||
File file = new File(filePath);
|
||||
long fileSize = file.length();
|
||||
return String.valueOf(fileSize);
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化客户端(Client)。
|
||||
*
|
||||
* @return 配置好的客户端对象
|
||||
*/
|
||||
public static com.aliyun.bailian20231229.Client createClient() throws Exception {
|
||||
com.aliyun.teaopenapi.models.Config config = new com.aliyun.teaopenapi.models.Config()
|
||||
.setAccessKeyId(System.getenv("ALIBABA_CLOUD_ACCESS_KEY_ID"))
|
||||
.setAccessKeySecret(System.getenv("ALIBABA_CLOUD_ACCESS_KEY_SECRET"));
|
||||
// 下方接入地址以公有云的公网接入地址为例,可按需更换接入地址。
|
||||
config.endpoint = "bailian.cn-beijing.aliyuncs.com";
|
||||
return new com.aliyun.bailian20231229.Client(config);
|
||||
}
|
||||
|
||||
/**
|
||||
* 申请文档上传租约。
|
||||
*
|
||||
* @param client 客户端对象
|
||||
* @param categoryId 类目ID
|
||||
* @param fileName 文档名称
|
||||
* @param fileMd5 文档的MD5值
|
||||
* @param fileSize 文档大小(以字节为单位)
|
||||
* @param workspaceId 业务空间ID
|
||||
* @return 阿里云百炼服务的响应对象
|
||||
*/
|
||||
public static ApplyFileUploadLeaseResponse applyLease(com.aliyun.bailian20231229.Client client, String categoryId,
|
||||
String fileName, String fileMd5, String fileSize, String workspaceId) throws Exception {
|
||||
Map<String, String> headers = new HashMap<>();
|
||||
com.aliyun.bailian20231229.models.ApplyFileUploadLeaseRequest applyFileUploadLeaseRequest = new com.aliyun.bailian20231229.models.ApplyFileUploadLeaseRequest();
|
||||
applyFileUploadLeaseRequest.setFileName(fileName);
|
||||
applyFileUploadLeaseRequest.setMd5(fileMd5);
|
||||
applyFileUploadLeaseRequest.setSizeInBytes(fileSize);
|
||||
com.aliyun.teautil.models.RuntimeOptions runtime = new com.aliyun.teautil.models.RuntimeOptions();
|
||||
ApplyFileUploadLeaseResponse applyFileUploadLeaseResponse = null;
|
||||
applyFileUploadLeaseResponse = client.applyFileUploadLeaseWithOptions(categoryId, workspaceId,
|
||||
applyFileUploadLeaseRequest, headers, runtime);
|
||||
return applyFileUploadLeaseResponse;
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传文档到临时存储。
|
||||
*
|
||||
* @param preSignedUrl 上传租约中的 URL
|
||||
* @param headers 上传请求的头部
|
||||
* @param filePath 文档本地路径
|
||||
* @throws Exception 如果上传过程中发生错误
|
||||
*/
|
||||
public static void uploadFile(String preSignedUrl, Map<String, String> headers, String filePath) throws Exception {
|
||||
File file = new File(filePath);
|
||||
if (!file.exists() || !file.isFile()) {
|
||||
throw new IllegalArgumentException("文件不存在或不是普通文件: " + filePath);
|
||||
}
|
||||
|
||||
try (FileInputStream fis = new FileInputStream(file)) {
|
||||
URL url = new URL(preSignedUrl);
|
||||
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
|
||||
conn.setRequestMethod("PUT");
|
||||
conn.setDoOutput(true);
|
||||
|
||||
// 设置上传请求头
|
||||
conn.setRequestProperty("X-bailian-extra", headers.get("X-bailian-extra"));
|
||||
conn.setRequestProperty("Content-Type", headers.get("Content-Type"));
|
||||
|
||||
// 分块读取并上传文档
|
||||
byte[] buffer = new byte[4096];
|
||||
int bytesRead;
|
||||
while ((bytesRead = fis.read(buffer)) != -1) {
|
||||
conn.getOutputStream().write(buffer, 0, bytesRead);
|
||||
}
|
||||
|
||||
int responseCode = conn.getResponseCode();
|
||||
if (responseCode != 200) {
|
||||
throw new RuntimeException("上传失败: " + responseCode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 将文档添加到类目中。
|
||||
*
|
||||
* @param client 客户端对象
|
||||
* @param leaseId 租约ID
|
||||
* @param parser 用于文档的解析器
|
||||
* @param categoryId 类目ID
|
||||
* @param workspaceId 业务空间ID
|
||||
* @return 阿里云百炼服务的响应对象
|
||||
*/
|
||||
public static AddFileResponse addFile(com.aliyun.bailian20231229.Client client, String leaseId, String parser,
|
||||
String categoryId, String workspaceId) throws Exception {
|
||||
Map<String, String> headers = new HashMap<>();
|
||||
com.aliyun.bailian20231229.models.AddFileRequest addFileRequest = new com.aliyun.bailian20231229.models.AddFileRequest();
|
||||
addFileRequest.setLeaseId(leaseId);
|
||||
addFileRequest.setParser(parser);
|
||||
addFileRequest.setCategoryId(categoryId);
|
||||
com.aliyun.teautil.models.RuntimeOptions runtime = new com.aliyun.teautil.models.RuntimeOptions();
|
||||
return client.addFileWithOptions(workspaceId, addFileRequest, headers, runtime);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询文档的基本信息。
|
||||
*
|
||||
* @param client 客户端对象
|
||||
* @param workspaceId 业务空间ID
|
||||
* @param fileId 文档ID
|
||||
* @return 阿里云百炼服务的响应对象
|
||||
*/
|
||||
public static DescribeFileResponse describeFile(com.aliyun.bailian20231229.Client client, String workspaceId,
|
||||
String fileId) throws Exception {
|
||||
Map<String, String> headers = new HashMap<>();
|
||||
com.aliyun.teautil.models.RuntimeOptions runtime = new com.aliyun.teautil.models.RuntimeOptions();
|
||||
return client.describeFileWithOptions(workspaceId, fileId, headers, runtime);
|
||||
}
|
||||
|
||||
/**
|
||||
* 在阿里云百炼服务中创建知识库(初始化)。
|
||||
*
|
||||
* @param client 客户端对象
|
||||
* @param workspaceId 业务空间ID
|
||||
* @param fileId 文档ID
|
||||
* @param name 知识库名称
|
||||
* @param structureType 知识库的数据类型
|
||||
* @param sourceType 应用数据的数据类型,支持类目类型和文档类型
|
||||
* @param sinkType 知识库的向量存储类型
|
||||
* @return 阿里云百炼服务的响应对象
|
||||
*/
|
||||
public static CreateIndexResponse createIndex(com.aliyun.bailian20231229.Client client, String workspaceId,
|
||||
String fileId, String name, String structureType, String sourceType, String sinkType) throws Exception {
|
||||
Map<String, String> headers = new HashMap<>();
|
||||
com.aliyun.bailian20231229.models.CreateIndexRequest createIndexRequest = new com.aliyun.bailian20231229.models.CreateIndexRequest();
|
||||
createIndexRequest.setStructureType(structureType);
|
||||
createIndexRequest.setName(name);
|
||||
createIndexRequest.setSourceType(sourceType);
|
||||
createIndexRequest.setSinkType(sinkType);
|
||||
createIndexRequest.setDocumentIds(Collections.singletonList(fileId));
|
||||
com.aliyun.teautil.models.RuntimeOptions runtime = new com.aliyun.teautil.models.RuntimeOptions();
|
||||
return client.createIndexWithOptions(workspaceId, createIndexRequest, headers, runtime);
|
||||
}
|
||||
|
||||
/**
|
||||
* 向阿里云百炼服务提交索引任务。
|
||||
*
|
||||
* @param client 客户端对象
|
||||
* @param workspaceId 业务空间ID
|
||||
* @param indexId 知识库ID
|
||||
* @return 阿里云百炼服务的响应对象
|
||||
*/
|
||||
public static SubmitIndexJobResponse submitIndex(com.aliyun.bailian20231229.Client client, String workspaceId,
|
||||
String indexId) throws Exception {
|
||||
Map<String, String> headers = new HashMap<>();
|
||||
com.aliyun.bailian20231229.models.SubmitIndexJobRequest submitIndexJobRequest = new com.aliyun.bailian20231229.models.SubmitIndexJobRequest();
|
||||
submitIndexJobRequest.setIndexId(indexId);
|
||||
com.aliyun.teautil.models.RuntimeOptions runtime = new com.aliyun.teautil.models.RuntimeOptions();
|
||||
return client.submitIndexJobWithOptions(workspaceId, submitIndexJobRequest, headers, runtime);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询索引任务状态。
|
||||
*
|
||||
* @param client 客户端对象
|
||||
* @param workspaceId 业务空间ID
|
||||
* @param jobId 任务ID
|
||||
* @param indexId 知识库ID
|
||||
* @return 阿里云百炼服务的响应对象
|
||||
*/
|
||||
public static GetIndexJobStatusResponse getIndexJobStatus(com.aliyun.bailian20231229.Client client,
|
||||
String workspaceId, String jobId, String indexId) throws Exception {
|
||||
Map<String, String> headers = new HashMap<>();
|
||||
com.aliyun.bailian20231229.models.GetIndexJobStatusRequest getIndexJobStatusRequest = new com.aliyun.bailian20231229.models.GetIndexJobStatusRequest();
|
||||
getIndexJobStatusRequest.setIndexId(indexId);
|
||||
getIndexJobStatusRequest.setJobId(jobId);
|
||||
com.aliyun.teautil.models.RuntimeOptions runtime = new com.aliyun.teautil.models.RuntimeOptions();
|
||||
GetIndexJobStatusResponse getIndexJobStatusResponse = null;
|
||||
getIndexJobStatusResponse = client.getIndexJobStatusWithOptions(workspaceId, getIndexJobStatusRequest, headers,
|
||||
runtime);
|
||||
return getIndexJobStatusResponse;
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用阿里云百炼服务创建知识库。
|
||||
*
|
||||
* @param filePath 文档本地路径
|
||||
* @param workspaceId 业务空间ID
|
||||
* @param name 知识库名称
|
||||
* @return 如果成功,返回知识库ID;否则返回 null
|
||||
*/
|
||||
public static String createKnowledgeBase(String filePath, String workspaceId, String name) {
|
||||
// 设置默认值
|
||||
String categoryId = "default";
|
||||
String parser = "DASHSCOPE_DOCMIND";
|
||||
String sourceType = "DATA_CENTER_FILE";
|
||||
String structureType = "unstructured";
|
||||
String sinkType = "DEFAULT";
|
||||
try {
|
||||
// 步骤1:初始化客户端(Client)
|
||||
System.out.println("步骤1:初始化Client");
|
||||
com.aliyun.bailian20231229.Client client = createClient();
|
||||
|
||||
// 步骤2:准备文档信息
|
||||
System.out.println("步骤2:准备文档信息");
|
||||
String fileName = new File(filePath).getName();
|
||||
String fileMd5 = calculateMD5(filePath);
|
||||
String fileSize = getFileSize(filePath);
|
||||
|
||||
// 步骤3:申请上传租约
|
||||
System.out.println("步骤3:向阿里云百炼申请上传租约");
|
||||
ApplyFileUploadLeaseResponse leaseResponse = applyLease(client, categoryId, fileName, fileMd5, fileSize,
|
||||
workspaceId);
|
||||
String leaseId = leaseResponse.getBody().getData().getFileUploadLeaseId();
|
||||
String uploadUrl = leaseResponse.getBody().getData().getParam().getUrl();
|
||||
Object uploadHeaders = leaseResponse.getBody().getData().getParam().getHeaders();
|
||||
|
||||
// 步骤4:上传文档
|
||||
System.out.println("步骤4:上传文档到阿里云百炼");
|
||||
// 请自行安装jackson-databind
|
||||
// 将上一步的uploadHeaders转换为Map(Key-Value形式)
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
Map<String, String> uploadHeadersMap = (Map<String, String>) mapper
|
||||
.readValue(mapper.writeValueAsString(uploadHeaders), Map.class);
|
||||
uploadFile(uploadUrl, uploadHeadersMap, filePath);
|
||||
|
||||
// 步骤5:将文档添加到服务器
|
||||
System.out.println("步骤5:将文档添加到阿里云百炼服务器");
|
||||
AddFileResponse addResponse = addFile(client, leaseId, parser, categoryId, workspaceId);
|
||||
String fileId = addResponse.getBody().getData().getFileId();
|
||||
|
||||
// 步骤6:检查文档状态
|
||||
System.out.println("步骤6:检查阿里云百炼中的文档状态");
|
||||
while (true) {
|
||||
DescribeFileResponse describeResponse = describeFile(client, workspaceId, fileId);
|
||||
String status = describeResponse.getBody().getData().getStatus();
|
||||
System.out.println("当前文档状态:" + status);
|
||||
|
||||
if (status.equals("INIT")) {
|
||||
System.out.println("文档待解析,请稍候...");
|
||||
} else if (status.equals("PARSING")) {
|
||||
System.out.println("文档解析中,请稍候...");
|
||||
} else if (status.equals("PARSE_SUCCESS")) {
|
||||
System.out.println("文档解析完成!");
|
||||
break;
|
||||
} else {
|
||||
System.out.println("未知的文档状态:" + status + ",请联系技术支持。");
|
||||
return null;
|
||||
}
|
||||
TimeUnit.SECONDS.sleep(5);
|
||||
}
|
||||
|
||||
// 步骤7:初始化知识库
|
||||
System.out.println("步骤7:在阿里云百炼中创建知识库");
|
||||
CreateIndexResponse indexResponse = createIndex(client, workspaceId, fileId, name, structureType,
|
||||
sourceType, sinkType);
|
||||
String indexId = indexResponse.getBody().getData().getId();
|
||||
|
||||
// 步骤8:提交索引任务
|
||||
System.out.println("步骤8:向阿里云百炼提交索引任务");
|
||||
SubmitIndexJobResponse submitResponse = submitIndex(client, workspaceId, indexId);
|
||||
String jobId = submitResponse.getBody().getData().getId();
|
||||
|
||||
// 步骤9:获取索引任务状态
|
||||
System.out.println("步骤9:获取阿里云百炼索引任务状态");
|
||||
while (true) {
|
||||
GetIndexJobStatusResponse getStatusResponse = getIndexJobStatus(client, workspaceId, jobId, indexId);
|
||||
String status = getStatusResponse.getBody().getData().getStatus();
|
||||
System.out.println("当前索引任务状态:" + status);
|
||||
|
||||
if (status.equals("COMPLETED")) {
|
||||
break;
|
||||
}
|
||||
TimeUnit.SECONDS.sleep(5);
|
||||
}
|
||||
|
||||
System.out.println("阿里云百炼知识库创建成功!");
|
||||
return indexId;
|
||||
|
||||
} catch (Exception e) {
|
||||
System.out.println("发生错误:" + e.getMessage());
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 主函数。
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
Scanner scanner = new Scanner(System.in);
|
||||
if (!checkEnvironmentVariables()) {
|
||||
return;
|
||||
}
|
||||
|
||||
System.out.print("请输入您需要上传文档的实际本地路径(以Linux为例:/xxx/xxx/阿里云百炼系列手机产品介绍.docx):");
|
||||
String filePath = scanner.nextLine();
|
||||
|
||||
System.out.print("请为您的知识库输入一个名称:");
|
||||
String kbName = scanner.nextLine();
|
||||
|
||||
String workspaceId = System.getenv("WORKSPACE_ID");
|
||||
String result = createKnowledgeBase(filePath, workspaceId, kbName);
|
||||
if (result != null) {
|
||||
System.out.println("知识库ID: " + result);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,145 +0,0 @@
|
||||
package com.gxwebsoft.ai.util;
|
||||
|
||||
import com.aliyun.bailian20231229.models.DeleteIndexResponse;
|
||||
import com.aliyun.bailian20231229.models.ListIndicesResponse;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 管理知识库
|
||||
* @author GIIT-YC
|
||||
*
|
||||
*/
|
||||
public class KnowledgeBaseManage {
|
||||
|
||||
String ALIBABA_CLOUD_ACCESS_KEY_ID = "LTAI5tD5YRKuxWz6Eg7qrM4P";
|
||||
String ALIBABA_CLOUD_ACCESS_KEY_SECRET = "bO8TBDXflOwbtSKimPpG8XrJnyzgTk";
|
||||
String WORKSPACE_ID = "llm-4pf5auwewoz34zqu";
|
||||
|
||||
/**
|
||||
* 检查并提示设置必要的环境变量。
|
||||
*
|
||||
* @return true 如果所有必需的环境变量都已设置,否则 false
|
||||
*/
|
||||
public static boolean checkEnvironmentVariables() {
|
||||
Map<String, String> requiredVars = new HashMap<>();
|
||||
requiredVars.put("ALIBABA_CLOUD_ACCESS_KEY_ID", "阿里云访问密钥ID");
|
||||
requiredVars.put("ALIBABA_CLOUD_ACCESS_KEY_SECRET", "阿里云访问密钥密码");
|
||||
requiredVars.put("WORKSPACE_ID", "阿里云百炼业务空间ID");
|
||||
|
||||
List<String> missingVars = new ArrayList<>();
|
||||
for (Map.Entry<String, String> entry : requiredVars.entrySet()) {
|
||||
String value = System.getenv(entry.getKey());
|
||||
if (value == null || value.isEmpty()) {
|
||||
missingVars.add(entry.getKey());
|
||||
System.out.println("错误:请设置 " + entry.getKey() + " 环境变量 (" + entry.getValue() + ")");
|
||||
}
|
||||
}
|
||||
|
||||
return missingVars.isEmpty();
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建并配置客户端(Client)
|
||||
*
|
||||
* @return 配置好的客户端(Client)
|
||||
*/
|
||||
public static com.aliyun.bailian20231229.Client createClient() throws Exception {
|
||||
com.aliyun.credentials.Client credential = new com.aliyun.credentials.Client();
|
||||
com.aliyun.teaopenapi.models.Config config = new com.aliyun.teaopenapi.models.Config()
|
||||
.setCredential(credential);
|
||||
// 下方接入地址以公有云的公网接入地址为例,可按需更换接入地址。
|
||||
config.endpoint = "bailian.cn-beijing.aliyuncs.com";
|
||||
return new com.aliyun.bailian20231229.Client(config);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取指定业务空间下一个或多个知识库的详细信息
|
||||
*
|
||||
* @param client 客户端(Client)
|
||||
* @param workspaceId 业务空间ID
|
||||
* @return 阿里云百炼服务的响应
|
||||
*/
|
||||
public static ListIndicesResponse listIndices(com.aliyun.bailian20231229.Client client, String workspaceId)
|
||||
throws Exception {
|
||||
Map<String, String> headers = new HashMap<>();
|
||||
com.aliyun.bailian20231229.models.ListIndicesRequest listIndicesRequest = new com.aliyun.bailian20231229.models.ListIndicesRequest();
|
||||
com.aliyun.teautil.models.RuntimeOptions runtime = new com.aliyun.teautil.models.RuntimeOptions();
|
||||
return client.listIndicesWithOptions(workspaceId, listIndicesRequest, headers, runtime);
|
||||
}
|
||||
|
||||
/**
|
||||
* 永久性删除指定的知识库
|
||||
*
|
||||
* @param client 客户端(Client)
|
||||
* @param workspaceId 业务空间ID
|
||||
* @param indexId 知识库ID
|
||||
* @return 阿里云百炼服务的响应
|
||||
*/
|
||||
public static DeleteIndexResponse deleteIndex(com.aliyun.bailian20231229.Client client, String workspaceId,
|
||||
String indexId) throws Exception {
|
||||
Map<String, String> headers = new HashMap<>();
|
||||
com.aliyun.bailian20231229.models.DeleteIndexRequest deleteIndexRequest = new com.aliyun.bailian20231229.models.DeleteIndexRequest();
|
||||
deleteIndexRequest.setIndexId(indexId);
|
||||
com.aliyun.teautil.models.RuntimeOptions runtime = new com.aliyun.teautil.models.RuntimeOptions();
|
||||
return client.deleteIndexWithOptions(workspaceId, deleteIndexRequest, headers, runtime);
|
||||
}
|
||||
|
||||
/**
|
||||
* 主函数
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
if (!checkEnvironmentVariables()) {
|
||||
System.out.println("环境变量校验未通过。");
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
Scanner scanner = new Scanner(System.in);
|
||||
System.out.print("请选择要执行的操作:\n1. 查看知识库\n2. 删除知识库\n请输入选项(1或2):");
|
||||
String startOption = scanner.nextLine();
|
||||
com.aliyun.bailian20231229.Client client = createClient();
|
||||
if (startOption.equals("1")) {
|
||||
// 查看知识库
|
||||
System.out.println("\n执行查看知识库");
|
||||
String workspaceId = System.getenv("WORKSPACE_ID");
|
||||
ListIndicesResponse response = listIndices(client, workspaceId);
|
||||
// 请自行安装jackson-databind。将响应转换为 JSON 字符串
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
String result = mapper.writeValueAsString(response.getBody().getData());
|
||||
System.out.println(result);
|
||||
} else if (startOption.equals("2")) {
|
||||
System.out.println("\n执行删除知识库");
|
||||
String workspaceId = System.getenv("WORKSPACE_ID");
|
||||
System.out.print("请输入知识库ID:"); // 即 CreateIndex 接口返回的 Data.Id,您也可以在阿里云百炼控制台的知识库页面获取。
|
||||
String indexId = scanner.nextLine();
|
||||
// 删除前二次确认
|
||||
boolean confirm = false;
|
||||
while (!confirm) {
|
||||
System.out.print("您确定要永久性删除该知识库 " + indexId + " 吗?(y/n): ");
|
||||
String input = scanner.nextLine().trim().toLowerCase();
|
||||
if (input.equals("y")) {
|
||||
confirm = true;
|
||||
} else if (input.equals("n")) {
|
||||
System.out.println("已取消删除操作。");
|
||||
return;
|
||||
} else {
|
||||
System.out.println("无效输入,请输入 y 或 n。");
|
||||
}
|
||||
}
|
||||
DeleteIndexResponse resp = deleteIndex(client, workspaceId, indexId);
|
||||
if (resp.getBody().getStatus().equals("200")) {
|
||||
System.out.println("知识库" + indexId + "删除成功!");
|
||||
} else {
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
System.out.println("发生错误:" + mapper.writeValueAsString(resp.getBody()));
|
||||
}
|
||||
} else {
|
||||
System.out.println("无效的选项,程序退出。");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
System.out.println("发生错误:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,110 +0,0 @@
|
||||
package com.gxwebsoft.ai.util;
|
||||
|
||||
import com.aliyun.bailian20231229.models.RetrieveRequest;
|
||||
import com.aliyun.bailian20231229.models.RetrieveResponse;
|
||||
import com.aliyun.teautil.models.RuntimeOptions;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 检索知识库
|
||||
* @author GIIT-YC
|
||||
*
|
||||
*/
|
||||
public class KnowledgeBaseRetrieve {
|
||||
|
||||
static String ALIBABA_CLOUD_ACCESS_KEY_ID = "LTAI5tD5YRKuxWz6Eg7qrM4P";
|
||||
static String ALIBABA_CLOUD_ACCESS_KEY_SECRET = "bO8TBDXflOwbtSKimPpG8XrJnyzgTk";
|
||||
static String WORKSPACE_ID = "llm-4pf5auwewoz34zqu";
|
||||
|
||||
|
||||
/**
|
||||
* 检查并提示设置必要的环境变量。
|
||||
*
|
||||
* @return true 如果所有必需的环境变量都已设置,否则 false
|
||||
*/
|
||||
public static boolean checkEnvironmentVariables() {
|
||||
Map<String, String> requiredVars = new HashMap<>();
|
||||
requiredVars.put("ALIBABA_CLOUD_ACCESS_KEY_ID", "阿里云访问密钥ID");
|
||||
requiredVars.put("ALIBABA_CLOUD_ACCESS_KEY_SECRET", "阿里云访问密钥密码");
|
||||
requiredVars.put("WORKSPACE_ID", "阿里云百炼业务空间ID");
|
||||
|
||||
List<String> missingVars = new ArrayList<>();
|
||||
for (Map.Entry<String, String> entry : requiredVars.entrySet()) {
|
||||
String value = System.getenv(entry.getKey());
|
||||
if (value == null || value.isEmpty()) {
|
||||
missingVars.add(entry.getKey());
|
||||
System.out.println("错误:请设置 " + entry.getKey() + " 环境变量 (" + entry.getValue() + ")");
|
||||
}
|
||||
}
|
||||
|
||||
return missingVars.isEmpty();
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化客户端(Client)。
|
||||
*
|
||||
* @return 配置好的客户端对象
|
||||
*/
|
||||
public static com.aliyun.bailian20231229.Client createClient() throws Exception {
|
||||
com.aliyun.teaopenapi.models.Config config = new com.aliyun.teaopenapi.models.Config()
|
||||
.setAccessKeyId(ALIBABA_CLOUD_ACCESS_KEY_ID)
|
||||
.setAccessKeySecret(ALIBABA_CLOUD_ACCESS_KEY_SECRET);
|
||||
// 下方接入地址以公有云的公网接入地址为例,可按需更换接入地址。
|
||||
config.endpoint = "bailian.cn-beijing.aliyuncs.com";
|
||||
return new com.aliyun.bailian20231229.Client(config);
|
||||
}
|
||||
|
||||
/**
|
||||
* 在指定的知识库中检索信息。
|
||||
*
|
||||
* @param client 客户端对象(bailian20231229Client)
|
||||
* @param workspaceId 业务空间ID
|
||||
* @param indexId 知识库ID
|
||||
* @param query 检索查询语句
|
||||
* @return 阿里云百炼服务的响应
|
||||
*/
|
||||
public static RetrieveResponse retrieveIndex(com.aliyun.bailian20231229.Client client, String workspaceId,
|
||||
String indexId, String query) throws Exception {
|
||||
RetrieveRequest retrieveRequest = new RetrieveRequest();
|
||||
retrieveRequest.setIndexId(indexId);
|
||||
retrieveRequest.setQuery(query);
|
||||
retrieveRequest.setDenseSimilarityTopK(null);
|
||||
RuntimeOptions runtime = new RuntimeOptions();
|
||||
return client.retrieveWithOptions(workspaceId, retrieveRequest, null, runtime);
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用阿里云百炼服务检索知识库。
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
// if (!checkEnvironmentVariables()) {
|
||||
// System.out.println("环境变量校验未通过。");
|
||||
// return;
|
||||
// }
|
||||
|
||||
try {
|
||||
// 步骤1:初始化客户端(Client)
|
||||
System.out.println("步骤1:创建Client");
|
||||
com.aliyun.bailian20231229.Client client = createClient();
|
||||
|
||||
// 步骤2:检索知识库
|
||||
System.out.println("步骤2:检索知识库");
|
||||
Scanner scanner = new Scanner(System.in);
|
||||
System.out.print("请输入知识库ID:"); // 即 CreateIndex 接口返回的 Data.Id,您也可以在阿里云百炼控制台的知识库页面获取。
|
||||
String indexId = scanner.nextLine();
|
||||
System.out.print("请输入检索query:");
|
||||
String query = scanner.nextLine();
|
||||
String workspaceId = WORKSPACE_ID;
|
||||
RetrieveResponse resp = retrieveIndex(client, workspaceId, indexId, query);
|
||||
|
||||
// 请自行安装jackson-databind。将响应体responsebody转换为 JSON 字符串
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
String result = mapper.writeValueAsString(resp.getBody());
|
||||
System.out.println(result);
|
||||
} catch (Exception e) {
|
||||
System.out.println("发生错误:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,384 +0,0 @@
|
||||
package com.gxwebsoft.ai.util;
|
||||
|
||||
import com.aliyun.bailian20231229.models.*;
|
||||
import com.aliyun.teautil.models.RuntimeOptions;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.nio.file.Paths;
|
||||
import java.security.MessageDigest;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 更新知识库
|
||||
* @author GIIT-YC
|
||||
*
|
||||
*/
|
||||
public class KnowledgeBaseUpdate {
|
||||
|
||||
String ALIBABA_CLOUD_ACCESS_KEY_ID = "LTAI5tD5YRKuxWz6Eg7qrM4P";
|
||||
String ALIBABA_CLOUD_ACCESS_KEY_SECRET = "bO8TBDXflOwbtSKimPpG8XrJnyzgTk";
|
||||
String WORKSPACE_ID = "llm-4pf5auwewoz34zqu";
|
||||
|
||||
/**
|
||||
* 检查并提示设置必要的环境变量。
|
||||
*
|
||||
* @return true 如果所有必需的环境变量都已设置,否则 false
|
||||
*/
|
||||
public static boolean checkEnvironmentVariables() {
|
||||
Map<String, String> requiredVars = new HashMap<>();
|
||||
requiredVars.put("ALIBABA_CLOUD_ACCESS_KEY_ID", "阿里云访问密钥ID");
|
||||
requiredVars.put("ALIBABA_CLOUD_ACCESS_KEY_SECRET", "阿里云访问密钥密码");
|
||||
requiredVars.put("WORKSPACE_ID", "阿里云百炼业务空间ID");
|
||||
|
||||
List<String> missingVars = new ArrayList<>();
|
||||
for (Map.Entry<String, String> entry : requiredVars.entrySet()) {
|
||||
String value = System.getenv(entry.getKey());
|
||||
if (value == null || value.isEmpty()) {
|
||||
missingVars.add(entry.getKey());
|
||||
System.out.println("错误:请设置 " + entry.getKey() + " 环境变量 (" + entry.getValue() + ")");
|
||||
}
|
||||
}
|
||||
|
||||
return missingVars.isEmpty();
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建并配置客户端(Client)
|
||||
*
|
||||
* @return 配置好的客户端(Client)
|
||||
*/
|
||||
public static com.aliyun.bailian20231229.Client createClient() throws Exception {
|
||||
com.aliyun.teaopenapi.models.Config config = new com.aliyun.teaopenapi.models.Config()
|
||||
.setAccessKeyId(System.getenv("ALIBABA_CLOUD_ACCESS_KEY_ID"))
|
||||
.setAccessKeySecret(System.getenv("ALIBABA_CLOUD_ACCESS_KEY_SECRET"));
|
||||
// 下方接入地址以公有云的公网接入地址为例,可按需更换接入地址。
|
||||
config.endpoint = "bailian.cn-beijing.aliyuncs.com";
|
||||
return new com.aliyun.bailian20231229.Client(config);
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算文档的MD5值
|
||||
*
|
||||
* @param filePath 文档本地路径
|
||||
* @return 文档的MD5值
|
||||
*/
|
||||
public static String calculateMD5(String filePath) throws Exception {
|
||||
MessageDigest md = MessageDigest.getInstance("MD5");
|
||||
try (FileInputStream fis = new FileInputStream(filePath)) {
|
||||
byte[] buffer = new byte[4096];
|
||||
int bytesRead;
|
||||
while ((bytesRead = fis.read(buffer)) != -1) {
|
||||
md.update(buffer, 0, bytesRead);
|
||||
}
|
||||
}
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (byte b : md.digest()) {
|
||||
sb.append(String.format("%02x", b & 0xff));
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取文档大小(以字节为单位)
|
||||
*
|
||||
* @param filePath 文档本地路径
|
||||
* @return 文档大小(以字节为单位)
|
||||
*/
|
||||
public static String getFileSize(String filePath) {
|
||||
File file = new File(filePath);
|
||||
long fileSize = file.length();
|
||||
return String.valueOf(fileSize);
|
||||
}
|
||||
|
||||
/**
|
||||
* 申请文档上传租约。
|
||||
*
|
||||
* @param client 客户端对象
|
||||
* @param categoryId 类目ID
|
||||
* @param fileName 文档名称
|
||||
* @param fileMd5 文档的MD5值
|
||||
* @param fileSize 文档大小(以字节为单位)
|
||||
* @param workspaceId 业务空间ID
|
||||
* @return 阿里云百炼服务的响应对象
|
||||
*/
|
||||
public static ApplyFileUploadLeaseResponse applyLease(com.aliyun.bailian20231229.Client client, String categoryId,
|
||||
String fileName, String fileMd5, String fileSize, String workspaceId) throws Exception {
|
||||
Map<String, String> headers = new HashMap<>();
|
||||
com.aliyun.bailian20231229.models.ApplyFileUploadLeaseRequest applyFileUploadLeaseRequest = new com.aliyun.bailian20231229.models.ApplyFileUploadLeaseRequest();
|
||||
applyFileUploadLeaseRequest.setFileName(fileName);
|
||||
applyFileUploadLeaseRequest.setMd5(fileMd5);
|
||||
applyFileUploadLeaseRequest.setSizeInBytes(fileSize);
|
||||
RuntimeOptions runtime = new RuntimeOptions();
|
||||
ApplyFileUploadLeaseResponse applyFileUploadLeaseResponse = null;
|
||||
applyFileUploadLeaseResponse = client.applyFileUploadLeaseWithOptions(categoryId, workspaceId,
|
||||
applyFileUploadLeaseRequest, headers, runtime);
|
||||
return applyFileUploadLeaseResponse;
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传文档到临时存储。
|
||||
*
|
||||
* @param preSignedUrl 上传租约中的 URL
|
||||
* @param headers 上传请求的头部
|
||||
* @param filePath 文档本地路径
|
||||
* @throws Exception 如果上传过程中发生错误
|
||||
*/
|
||||
public static void uploadFile(String preSignedUrl, Map<String, String> headers, String filePath) throws Exception {
|
||||
File file = new File(filePath);
|
||||
if (!file.exists() || !file.isFile()) {
|
||||
throw new IllegalArgumentException("文件不存在或不是普通文件: " + filePath);
|
||||
}
|
||||
|
||||
try (FileInputStream fis = new FileInputStream(file)) {
|
||||
URL url = new URL(preSignedUrl);
|
||||
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
|
||||
conn.setRequestMethod("PUT");
|
||||
conn.setDoOutput(true);
|
||||
|
||||
// 设置上传请求头
|
||||
conn.setRequestProperty("X-bailian-extra", headers.get("X-bailian-extra"));
|
||||
conn.setRequestProperty("Content-Type", headers.get("Content-Type"));
|
||||
|
||||
// 分块读取并上传文档
|
||||
byte[] buffer = new byte[4096];
|
||||
int bytesRead;
|
||||
while ((bytesRead = fis.read(buffer)) != -1) {
|
||||
conn.getOutputStream().write(buffer, 0, bytesRead);
|
||||
}
|
||||
|
||||
int responseCode = conn.getResponseCode();
|
||||
if (responseCode != 200) {
|
||||
throw new RuntimeException("上传失败: " + responseCode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 将文档添加到类目中。
|
||||
*
|
||||
* @param client 客户端对象
|
||||
* @param leaseId 租约ID
|
||||
* @param parser 用于文档的解析器
|
||||
* @param categoryId 类目ID
|
||||
* @param workspaceId 业务空间ID
|
||||
* @return 阿里云百炼服务的响应对象
|
||||
*/
|
||||
public static AddFileResponse addFile(com.aliyun.bailian20231229.Client client, String leaseId, String parser,
|
||||
String categoryId, String workspaceId) throws Exception {
|
||||
Map<String, String> headers = new HashMap<>();
|
||||
com.aliyun.bailian20231229.models.AddFileRequest addFileRequest = new com.aliyun.bailian20231229.models.AddFileRequest();
|
||||
addFileRequest.setLeaseId(leaseId);
|
||||
addFileRequest.setParser(parser);
|
||||
addFileRequest.setCategoryId(categoryId);
|
||||
RuntimeOptions runtime = new RuntimeOptions();
|
||||
return client.addFileWithOptions(workspaceId, addFileRequest, headers, runtime);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询文档的基本信息。
|
||||
*
|
||||
* @param client 客户端对象
|
||||
* @param workspaceId 业务空间ID
|
||||
* @param fileId 文档ID
|
||||
* @return 阿里云百炼服务的响应对象
|
||||
*/
|
||||
public static DescribeFileResponse describeFile(com.aliyun.bailian20231229.Client client, String workspaceId,
|
||||
String fileId) throws Exception {
|
||||
Map<String, String> headers = new HashMap<>();
|
||||
RuntimeOptions runtime = new RuntimeOptions();
|
||||
return client.describeFileWithOptions(workspaceId, fileId, headers, runtime);
|
||||
}
|
||||
|
||||
/**
|
||||
* 向一个非结构化知识库追加导入已解析的文档
|
||||
*
|
||||
* @param client 客户端(Client)
|
||||
* @param workspaceId 业务空间ID
|
||||
* @param indexId 知识库ID
|
||||
* @param fileId 文档ID
|
||||
* @param sourceType 数据类型
|
||||
* @return 阿里云百炼服务的响应
|
||||
*/
|
||||
public static SubmitIndexAddDocumentsJobResponse submitIndexAddDocumentsJob(
|
||||
com.aliyun.bailian20231229.Client client, String workspaceId, String indexId, String fileId,
|
||||
String sourceType) throws Exception {
|
||||
Map<String, String> headers = new HashMap<>();
|
||||
SubmitIndexAddDocumentsJobRequest submitIndexAddDocumentsJobRequest = new SubmitIndexAddDocumentsJobRequest();
|
||||
submitIndexAddDocumentsJobRequest.setIndexId(indexId);
|
||||
submitIndexAddDocumentsJobRequest.setDocumentIds(Collections.singletonList(fileId));
|
||||
submitIndexAddDocumentsJobRequest.setSourceType(sourceType);
|
||||
RuntimeOptions runtime = new RuntimeOptions();
|
||||
return client.submitIndexAddDocumentsJobWithOptions(workspaceId, submitIndexAddDocumentsJobRequest, headers,
|
||||
runtime);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询索引任务状态。
|
||||
*
|
||||
* @param client 客户端对象
|
||||
* @param workspaceId 业务空间ID
|
||||
* @param jobId 任务ID
|
||||
* @param indexId 知识库ID
|
||||
* @return 阿里云百炼服务的响应对象
|
||||
*/
|
||||
public static GetIndexJobStatusResponse getIndexJobStatus(com.aliyun.bailian20231229.Client client,
|
||||
String workspaceId, String jobId, String indexId) throws Exception {
|
||||
Map<String, String> headers = new HashMap<>();
|
||||
com.aliyun.bailian20231229.models.GetIndexJobStatusRequest getIndexJobStatusRequest = new com.aliyun.bailian20231229.models.GetIndexJobStatusRequest();
|
||||
getIndexJobStatusRequest.setIndexId(indexId);
|
||||
getIndexJobStatusRequest.setJobId(jobId);
|
||||
RuntimeOptions runtime = new RuntimeOptions();
|
||||
GetIndexJobStatusResponse getIndexJobStatusResponse = null;
|
||||
getIndexJobStatusResponse = client.getIndexJobStatusWithOptions(workspaceId, getIndexJobStatusRequest, headers,
|
||||
runtime);
|
||||
return getIndexJobStatusResponse;
|
||||
}
|
||||
|
||||
/**
|
||||
* 从指定的非结构化知识库中永久删除一个或多个文档
|
||||
*
|
||||
* @param client 客户端(Client)
|
||||
* @param workspaceId 业务空间ID
|
||||
* @param indexId 知识库ID
|
||||
* @param fileId 文档ID
|
||||
* @return 阿里云百炼服务的响应
|
||||
*/
|
||||
public static DeleteIndexDocumentResponse deleteIndexDocument(com.aliyun.bailian20231229.Client client,
|
||||
String workspaceId, String indexId, String fileId) throws Exception {
|
||||
Map<String, String> headers = new HashMap<>();
|
||||
DeleteIndexDocumentRequest deleteIndexDocumentRequest = new DeleteIndexDocumentRequest();
|
||||
deleteIndexDocumentRequest.setIndexId(indexId);
|
||||
deleteIndexDocumentRequest.setDocumentIds(Collections.singletonList(fileId));
|
||||
RuntimeOptions runtime = new RuntimeOptions();
|
||||
return client.deleteIndexDocumentWithOptions(workspaceId, deleteIndexDocumentRequest, headers, runtime);
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用阿里云百炼服务更新知识库
|
||||
*
|
||||
* @param filePath 文档(更新后的)的实际本地路径
|
||||
* @param workspaceId 业务空间ID
|
||||
* @param indexId 需要更新的知识库ID
|
||||
* @param oldFileId 需要更新的文档的FileID
|
||||
* @return 如果成功,返回知识库ID;否则返回 null
|
||||
*/
|
||||
public static String updateKnowledgeBase(String filePath, String workspaceId, String indexId, String oldFileId) {
|
||||
// 设置默认值
|
||||
String categoryId = "default";
|
||||
String parser = "DASHSCOPE_DOCMIND";
|
||||
String sourceType = "DATA_CENTER_FILE";
|
||||
try {
|
||||
// 步骤1:初始化客户端(Client)
|
||||
System.out.println("步骤1:创建Client");
|
||||
com.aliyun.bailian20231229.Client client = createClient();
|
||||
|
||||
// 步骤2:准备文档信息(更新后的文档)
|
||||
System.out.println("步骤2:准备文档信息");
|
||||
String fileName = Paths.get(filePath).getFileName().toString();
|
||||
String fileMd5 = calculateMD5(filePath);
|
||||
String fileSize = getFileSize(filePath);
|
||||
|
||||
// 步骤3:申请上传租约
|
||||
System.out.println("步骤3:向阿里云百炼申请上传租约");
|
||||
ApplyFileUploadLeaseResponse leaseResponse = applyLease(client, categoryId, fileName, fileMd5, fileSize,
|
||||
workspaceId);
|
||||
String leaseId = leaseResponse.getBody().getData().getFileUploadLeaseId();
|
||||
String uploadUrl = leaseResponse.getBody().getData().getParam().getUrl();
|
||||
Object uploadHeaders = leaseResponse.getBody().getData().getParam().getHeaders();
|
||||
|
||||
// 步骤4:上传文档到临时存储
|
||||
System.out.println("步骤4:上传文档到临时存储");
|
||||
// 请自行安装jackson-databind
|
||||
// 将上一步的uploadHeaders转换为Map(Key-Value形式)
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
Map<String, String> uploadHeadersMap = (Map<String, String>) mapper
|
||||
.readValue(mapper.writeValueAsString(uploadHeaders), Map.class);
|
||||
uploadFile(uploadUrl, uploadHeadersMap, filePath);
|
||||
|
||||
// 步骤5:添加文档到类目中
|
||||
System.out.println("步骤5:添加文档到类目中");
|
||||
AddFileResponse addResponse = addFile(client, leaseId, parser, categoryId, workspaceId);
|
||||
String fileId = addResponse.getBody().getData().getFileId();
|
||||
|
||||
// 步骤6:检查更新后的文档状态
|
||||
System.out.println("步骤6:检查阿里云百炼中的文档状态");
|
||||
while (true) {
|
||||
DescribeFileResponse describeResponse = describeFile(client, workspaceId, fileId);
|
||||
String status = describeResponse.getBody().getData().getStatus();
|
||||
System.out.println("当前文档状态:" + status);
|
||||
if ("INIT".equals(status)) {
|
||||
System.out.println("文档待解析,请稍候...");
|
||||
} else if ("PARSING".equals(status)) {
|
||||
System.out.println("文档解析中,请稍候...");
|
||||
} else if ("PARSE_SUCCESS".equals(status)) {
|
||||
System.out.println("文档解析完成!");
|
||||
break;
|
||||
} else {
|
||||
System.out.println("未知的文档状态:" + status + ",请联系技术支持。");
|
||||
return null;
|
||||
}
|
||||
Thread.sleep(5000);
|
||||
}
|
||||
|
||||
// 步骤7:提交追加文档任务
|
||||
System.out.println("步骤7:提交追加文档任务");
|
||||
SubmitIndexAddDocumentsJobResponse indexAddResponse = submitIndexAddDocumentsJob(client, workspaceId,
|
||||
indexId, fileId, sourceType);
|
||||
String jobId = indexAddResponse.getBody().getData().getId();
|
||||
|
||||
// 步骤8:等待追加任务完成
|
||||
System.out.println("步骤8:等待追加任务完成");
|
||||
while (true) {
|
||||
GetIndexJobStatusResponse jobStatusResponse = getIndexJobStatus(client, workspaceId, jobId, indexId);
|
||||
String status = jobStatusResponse.getBody().getData().getStatus();
|
||||
System.out.println("当前索引任务状态:" + status);
|
||||
if ("COMPLETED".equals(status)) {
|
||||
break;
|
||||
}
|
||||
Thread.sleep(5000);
|
||||
}
|
||||
|
||||
// 步骤9:删除旧文档
|
||||
System.out.println("步骤9:删除旧文档");
|
||||
deleteIndexDocument(client, workspaceId, indexId, oldFileId);
|
||||
|
||||
System.out.println("阿里云百炼知识库更新成功!");
|
||||
return indexId;
|
||||
} catch (Exception e) {
|
||||
System.out.println("发生错误:" + e.getMessage());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 主函数。
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
if (!checkEnvironmentVariables()) {
|
||||
System.out.println("环境变量校验未通过。");
|
||||
return;
|
||||
}
|
||||
|
||||
Scanner scanner = new Scanner(System.in);
|
||||
System.out.print("请输入您需要上传文档(更新后的)的实际本地路径(以Linux为例:/xxx/xxx/阿里云百炼系列手机产品介绍.docx):");
|
||||
String filePath = scanner.nextLine();
|
||||
|
||||
System.out.print("请输入需要更新的知识库ID:"); // 即 CreateIndex 接口返回的 Data.Id,您也可以在阿里云百炼控制台的知识库页面获取。
|
||||
String indexId = scanner.nextLine(); // 即 AddFile 接口返回的 FileId。您也可以在阿里云百炼控制台的应用数据页面,单击文件名称旁的 ID 图标获取。
|
||||
|
||||
System.out.print("请输入需要更新的文档的 FileID:");
|
||||
String oldFileId = scanner.nextLine();
|
||||
|
||||
String workspaceId = System.getenv("WORKSPACE_ID");
|
||||
String result = updateKnowledgeBase(filePath, workspaceId, indexId, oldFileId);
|
||||
if (result != null) {
|
||||
System.out.println("知识库更新成功,返回知识库ID: " + result);
|
||||
} else {
|
||||
System.out.println("知识库更新失败。");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,274 @@
|
||||
package com.gxwebsoft.credit.controller;
|
||||
|
||||
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.CreditBreachOfTrust;
|
||||
import com.gxwebsoft.credit.param.CreditJudicialImportParam;
|
||||
import com.gxwebsoft.credit.param.CreditBreachOfTrustParam;
|
||||
import com.gxwebsoft.credit.service.CreditBreachOfTrustService;
|
||||
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.time.LocalDate;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 失信被执行人控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-12-19 19:46:14
|
||||
*/
|
||||
@Tag(name = "失信被执行人管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/credit/credit-breach-of-trust")
|
||||
public class CreditBreachOfTrustController extends BaseController {
|
||||
@Resource
|
||||
private CreditBreachOfTrustService creditBreachOfTrustService;
|
||||
|
||||
@Operation(summary = "分页查询失信被执行人")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<CreditBreachOfTrust>> page(CreditBreachOfTrustParam param) {
|
||||
// 使用关联查询
|
||||
return success(creditBreachOfTrustService.pageRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "查询全部失信被执行人")
|
||||
@GetMapping()
|
||||
public ApiResult<List<CreditBreachOfTrust>> list(CreditBreachOfTrustParam param) {
|
||||
// 使用关联查询
|
||||
return success(creditBreachOfTrustService.listRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "根据id查询失信被执行人")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<CreditBreachOfTrust> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(creditBreachOfTrustService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditBreachOfTrust:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "添加失信被执行人")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody CreditBreachOfTrust creditBreachOfTrust) {
|
||||
if (creditBreachOfTrustService.save(creditBreachOfTrust)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditBreachOfTrust:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "修改失信被执行人")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody CreditBreachOfTrust creditBreachOfTrust) {
|
||||
if (creditBreachOfTrustService.updateById(creditBreachOfTrust)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditBreachOfTrust:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "删除失信被执行人")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (creditBreachOfTrustService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditBreachOfTrust:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量添加失信被执行人")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<CreditBreachOfTrust> list) {
|
||||
if (creditBreachOfTrustService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditBreachOfTrust:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量修改失信被执行人")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<CreditBreachOfTrust> batchParam) {
|
||||
if (batchParam.update(creditBreachOfTrustService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditBreachOfTrust:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量删除失信被执行人")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (creditBreachOfTrustService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量导入失信被执行人
|
||||
*/
|
||||
@PreAuthorize("hasAuthority('credit:creditBreachOfTrust:save')")
|
||||
@Operation(summary = "批量导入失信被执行人")
|
||||
@PostMapping("/import")
|
||||
public ApiResult<List<String>> importBatch(@RequestParam("file") MultipartFile file) {
|
||||
List<String> errorMessages = new ArrayList<>();
|
||||
int successCount = 0;
|
||||
|
||||
try {
|
||||
ExcelImportSupport.ImportResult<CreditJudicialImportParam> importResult = ExcelImportSupport.read(
|
||||
file, CreditJudicialImportParam.class, this::isEmptyImportRow);
|
||||
List<CreditJudicialImportParam> 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++) {
|
||||
CreditJudicialImportParam param = list.get(i);
|
||||
try {
|
||||
CreditBreachOfTrust 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.getCaseNumber())) {
|
||||
errorMessages.add("第" + excelRowNumber + "行:案号不能为空");
|
||||
continue;
|
||||
}
|
||||
|
||||
boolean saved = creditBreachOfTrustService.save(item);
|
||||
if (!saved) {
|
||||
CreditBreachOfTrust existing = creditBreachOfTrustService.lambdaQuery()
|
||||
.eq(CreditBreachOfTrust::getCaseNumber, item.getCaseNumber())
|
||||
.one();
|
||||
if (existing != null) {
|
||||
item.setId(existing.getId());
|
||||
if (creditBreachOfTrustService.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<CreditJudicialImportParam> templateList = new ArrayList<>();
|
||||
|
||||
CreditJudicialImportParam example = new CreditJudicialImportParam();
|
||||
example.setDataType("失信被执行人");
|
||||
example.setPlaintiffAppellant("原告示例");
|
||||
example.setAppellee("被告示例");
|
||||
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);
|
||||
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setHeader("Content-Disposition", "attachment; filename=credit_breach_of_trust_import_template.xlsx");
|
||||
|
||||
workbook.write(response.getOutputStream());
|
||||
workbook.close();
|
||||
}
|
||||
|
||||
private boolean isEmptyImportRow(CreditJudicialImportParam param) {
|
||||
if (param == null) {
|
||||
return true;
|
||||
}
|
||||
return ImportHelper.isBlank(param.getCaseNumber())
|
||||
&& ImportHelper.isBlank(param.getPlaintiffAppellant())
|
||||
&& ImportHelper.isBlank(param.getAppellee())
|
||||
&& ImportHelper.isBlank(param.getCauseOfAction());
|
||||
}
|
||||
|
||||
private CreditBreachOfTrust convertImportParamToEntity(CreditJudicialImportParam param) {
|
||||
CreditBreachOfTrust entity = new CreditBreachOfTrust();
|
||||
|
||||
entity.setDataType(param.getDataType());
|
||||
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.setCourtName(param.getCourtName());
|
||||
entity.setDataStatus(param.getDataStatus());
|
||||
entity.setComments(param.getComments());
|
||||
|
||||
return entity;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,278 @@
|
||||
package com.gxwebsoft.credit.controller;
|
||||
|
||||
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.CreditCaseFiling;
|
||||
import com.gxwebsoft.credit.param.CreditJudicialImportParam;
|
||||
import com.gxwebsoft.credit.param.CreditCaseFilingParam;
|
||||
import com.gxwebsoft.credit.service.CreditCaseFilingService;
|
||||
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-19 19:47:23
|
||||
*/
|
||||
@Tag(name = "司法大数据管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/credit/credit-case-filing")
|
||||
public class CreditCaseFilingController extends BaseController {
|
||||
@Resource
|
||||
private CreditCaseFilingService creditCaseFilingService;
|
||||
|
||||
@Operation(summary = "分页查询司法大数据")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<CreditCaseFiling>> page(CreditCaseFilingParam param) {
|
||||
// 使用关联查询
|
||||
return success(creditCaseFilingService.pageRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "查询全部司法大数据")
|
||||
@GetMapping()
|
||||
public ApiResult<List<CreditCaseFiling>> list(CreditCaseFilingParam param) {
|
||||
// 使用关联查询
|
||||
return success(creditCaseFilingService.listRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "根据id查询司法大数据")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<CreditCaseFiling> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(creditCaseFilingService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditCaseFiling:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "添加司法大数据")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody CreditCaseFiling creditCaseFiling) {
|
||||
// 记录当前登录用户id
|
||||
// User loginUser = getLoginUser();
|
||||
// if (loginUser != null) {
|
||||
// creditCaseFiling.setUserId(loginUser.getUserId());
|
||||
// }
|
||||
if (creditCaseFilingService.save(creditCaseFiling)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditCaseFiling:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "修改司法大数据")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody CreditCaseFiling creditCaseFiling) {
|
||||
if (creditCaseFilingService.updateById(creditCaseFiling)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditCaseFiling:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "删除司法大数据")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (creditCaseFilingService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditCaseFiling:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量添加司法大数据")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<CreditCaseFiling> list) {
|
||||
if (creditCaseFilingService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditCaseFiling:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量修改司法大数据")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<CreditCaseFiling> batchParam) {
|
||||
if (batchParam.update(creditCaseFilingService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditCaseFiling:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量删除司法大数据")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (creditCaseFilingService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量导入司法大数据
|
||||
*/
|
||||
@PreAuthorize("hasAuthority('credit:creditCaseFiling:save')")
|
||||
@Operation(summary = "批量导入司法大数据")
|
||||
@PostMapping("/import")
|
||||
public ApiResult<List<String>> importBatch(@RequestParam("file") MultipartFile file) {
|
||||
List<String> errorMessages = new ArrayList<>();
|
||||
int successCount = 0;
|
||||
|
||||
try {
|
||||
ExcelImportSupport.ImportResult<CreditJudicialImportParam> importResult = ExcelImportSupport.read(
|
||||
file, CreditJudicialImportParam.class, this::isEmptyImportRow);
|
||||
List<CreditJudicialImportParam> 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++) {
|
||||
CreditJudicialImportParam param = list.get(i);
|
||||
try {
|
||||
CreditCaseFiling 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.getCaseNumber())) {
|
||||
errorMessages.add("第" + excelRowNumber + "行:案号不能为空");
|
||||
continue;
|
||||
}
|
||||
|
||||
boolean saved = creditCaseFilingService.save(item);
|
||||
if (!saved) {
|
||||
CreditCaseFiling existing = creditCaseFilingService.lambdaQuery()
|
||||
.eq(CreditCaseFiling::getCaseNumber, item.getCaseNumber())
|
||||
.one();
|
||||
if (existing != null) {
|
||||
item.setId(existing.getId());
|
||||
if (creditCaseFilingService.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<CreditJudicialImportParam> templateList = new ArrayList<>();
|
||||
|
||||
CreditJudicialImportParam example = new CreditJudicialImportParam();
|
||||
example.setDataType("司法大数据");
|
||||
example.setPlaintiffAppellant("原告示例");
|
||||
example.setAppellee("被告示例");
|
||||
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);
|
||||
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setHeader("Content-Disposition", "attachment; filename=credit_case_filing_import_template.xlsx");
|
||||
|
||||
workbook.write(response.getOutputStream());
|
||||
workbook.close();
|
||||
}
|
||||
|
||||
private boolean isEmptyImportRow(CreditJudicialImportParam param) {
|
||||
if (param == null) {
|
||||
return true;
|
||||
}
|
||||
return ImportHelper.isBlank(param.getCaseNumber())
|
||||
&& ImportHelper.isBlank(param.getPlaintiffAppellant())
|
||||
&& ImportHelper.isBlank(param.getAppellee())
|
||||
&& ImportHelper.isBlank(param.getCauseOfAction());
|
||||
}
|
||||
|
||||
private CreditCaseFiling convertImportParamToEntity(CreditJudicialImportParam param) {
|
||||
CreditCaseFiling entity = new CreditCaseFiling();
|
||||
|
||||
entity.setDataType(param.getDataType());
|
||||
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.setCourtName(param.getCourtName());
|
||||
entity.setDataStatus(param.getDataStatus());
|
||||
entity.setComments(param.getComments());
|
||||
|
||||
return entity;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,390 @@
|
||||
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.CreditCompany;
|
||||
import com.gxwebsoft.credit.entity.CreditCompany;
|
||||
import com.gxwebsoft.credit.param.CreditCompanyImportParam;
|
||||
import com.gxwebsoft.credit.param.CreditCompanyParam;
|
||||
import com.gxwebsoft.credit.param.CreditCompanyImportParam;
|
||||
import com.gxwebsoft.credit.service.CreditCompanyService;
|
||||
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-17 08:28:03
|
||||
*/
|
||||
@Tag(name = "企业管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/credit/credit-company")
|
||||
public class CreditCompanyController extends BaseController {
|
||||
@Resource
|
||||
private CreditCompanyService creditCompanyService;
|
||||
|
||||
@Operation(summary = "分页查询企业")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<CreditCompany>> page(CreditCompanyParam param) {
|
||||
// 使用关联查询
|
||||
return success(creditCompanyService.pageRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "查询全部企业")
|
||||
@GetMapping()
|
||||
public ApiResult<List<CreditCompany>> list(CreditCompanyParam param) {
|
||||
// 使用关联查询
|
||||
return success(creditCompanyService.listRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "根据id查询企业")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<CreditCompany> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(creditCompanyService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditCompany:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "添加企业")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody CreditCompany creditCompany) {
|
||||
if (creditCompanyService.save(creditCompany)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditCompany:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "修改企业")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody CreditCompany creditCompany) {
|
||||
if (creditCompanyService.updateById(creditCompany)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditCompany:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "删除企业")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (creditCompanyService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditCompany:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量添加企业")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<CreditCompany> list) {
|
||||
if (creditCompanyService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditCompany:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量修改企业")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<CreditCompany> batchParam) {
|
||||
if (batchParam.update(creditCompanyService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditCompany:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量删除企业")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (creditCompanyService.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<CreditCompanyImportParam> 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++) {
|
||||
CreditCompanyImportParam param = list.get(i);
|
||||
try {
|
||||
CreditCompany 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 (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 = creditCompanyService.save(item);
|
||||
if (!saved) {
|
||||
CreditCompany existing = creditCompanyService.getByMatchName(item.getName());
|
||||
if (existing != null) {
|
||||
item.setId(existing.getId());
|
||||
if (creditCompanyService.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<CreditCompanyImportParam> templateList = new ArrayList<>();
|
||||
|
||||
CreditCompanyImportParam example = new CreditCompanyImportParam();
|
||||
example.setName("示例客户");
|
||||
example.setCode("C0001");
|
||||
example.setMatchName("匹配名称");
|
||||
example.setRegistrationStatus("登记状态");
|
||||
example.setLegalPerson("法定代表人");
|
||||
example.setRegisteredCapital("注册资本");
|
||||
example.setPaidinCapital("实缴资本");
|
||||
example.setEstablishDate("成立日期");
|
||||
example.setAddress("地址");
|
||||
example.setTel("电话");
|
||||
example.setMoreTel("更多电话");
|
||||
example.setEmail("邮箱");
|
||||
example.setMoreEmail("更多邮箱");
|
||||
example.setProvince("省");
|
||||
example.setCity("市");
|
||||
example.setRegion("区");
|
||||
example.setInstitutionType("机构类型");
|
||||
example.setTaxpayerCode("纳税人识别号");
|
||||
example.setRegistrationNumber("注册号");
|
||||
example.setOrganizationalCode("组织机构代码");
|
||||
example.setNumberOfInsuredPersons("参保人数");
|
||||
example.setAnnualReport("入库时间");
|
||||
example.setBusinessTerm("营业期限");
|
||||
example.setNationalStandardIndustryCategories("国标行业门类");
|
||||
example.setNationalStandardIndustryCategories2("国标行业大类");
|
||||
example.setNationalStandardIndustryCategories3("国标行业中类");
|
||||
example.setNationalStandardIndustryCategories4("国标行业小类");
|
||||
example.setNationalStandardIndustryCategories5("企查查行业门类");
|
||||
example.setNationalStandardIndustryCategories6("企查查行业大类");
|
||||
example.setNationalStandardIndustryCategories7("企查查行业中类");
|
||||
example.setNationalStandardIndustryCategories8("企查查行业小类");
|
||||
example.setCompanySize("企业规模");
|
||||
example.setFormerName("曾用名");
|
||||
example.setEnglishName("英文名");
|
||||
example.setDomain("官网");
|
||||
example.setMailingAddress("通信地址");
|
||||
example.setCompanyProfile("企业简介");
|
||||
example.setNatureOfBusiness("经营范围");
|
||||
example.setRegistrationAuthority("登记机关");
|
||||
example.setTaxpayerQualification("纳税人资质");
|
||||
example.setLatestAnnualReportYear("最新年报年份");
|
||||
example.setLatestAnnualReportOnOperatingRevenue("最新年报营业额");
|
||||
example.setEnterpriseScoreCheck("企查分");
|
||||
example.setCreditRating("信用等级");
|
||||
example.setCechnologyScore("科创分");
|
||||
example.setCechnologyLevel("科创等级");
|
||||
example.setSmallEnterprise("是否小微企业");
|
||||
templateList.add(example);
|
||||
|
||||
ExportParams exportParams = new ExportParams("一级企业主表导入模板", "企业");
|
||||
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, CreditCompanyImportParam.class, templateList);
|
||||
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setHeader("Content-Disposition", "attachment; filename=credit_company_import_template.xlsx");
|
||||
|
||||
workbook.write(response.getOutputStream());
|
||||
workbook.close();
|
||||
}
|
||||
|
||||
private List<CreditCompanyImportParam> 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(), CreditCompanyImportParam.class, importParams);
|
||||
}
|
||||
|
||||
/**
|
||||
* 过滤掉完全空白的导入行,避免空行导致导入失败
|
||||
*/
|
||||
private List<CreditCompanyImportParam> filterEmptyRows(List<CreditCompanyImportParam> rawList) {
|
||||
if (CollectionUtils.isEmpty(rawList)) {
|
||||
return rawList;
|
||||
}
|
||||
rawList.removeIf(this::isEmptyImportRow);
|
||||
return rawList;
|
||||
}
|
||||
|
||||
private boolean isEmptyImportRow(CreditCompanyImportParam param) {
|
||||
if (param == null) {
|
||||
return true;
|
||||
}
|
||||
return isBlank(param.getName())
|
||||
&& isBlank(param.getCode());
|
||||
}
|
||||
|
||||
private boolean isBlank(String value) {
|
||||
return value == null || value.trim().isEmpty();
|
||||
}
|
||||
|
||||
/**
|
||||
* 将CreditCompanyImportParam转换为CreditCompany实体
|
||||
*/
|
||||
private CreditCompany convertImportParamToEntity(CreditCompanyImportParam param) {
|
||||
CreditCompany entity = new CreditCompany();
|
||||
|
||||
entity.setCode(param.getCode());
|
||||
entity.setName(param.getName());
|
||||
entity.setMatchName(param.getMatchName());
|
||||
entity.setRegistrationStatus(param.getRegistrationStatus());
|
||||
entity.setLegalPerson(param.getLegalPerson());
|
||||
entity.setRegisteredCapital(param.getRegisteredCapital());
|
||||
entity.setPaidinCapital(param.getPaidinCapital());
|
||||
entity.setEstablishDate(param.getEstablishDate());
|
||||
entity.setAddress(param.getAddress());
|
||||
entity.setTel(param.getTel());
|
||||
entity.setMoreTel(param.getMoreTel());
|
||||
entity.setEmail(param.getEmail());
|
||||
entity.setMoreEmail(param.getMoreEmail());
|
||||
entity.setProvince(param.getProvince());
|
||||
entity.setCity(param.getCity());
|
||||
entity.setRegion(param.getRegion());
|
||||
entity.setInstitutionType(param.getInstitutionType());
|
||||
entity.setTaxpayerCode(param.getTaxpayerCode());
|
||||
entity.setRegistrationNumber(param.getRegistrationNumber());
|
||||
entity.setOrganizationalCode(param.getOrganizationalCode());
|
||||
entity.setNumberOfInsuredPersons(param.getNumberOfInsuredPersons());
|
||||
entity.setAnnualReport(param.getAnnualReport());
|
||||
entity.setBusinessTerm(param.getBusinessTerm());
|
||||
entity.setNationalStandardIndustryCategories(param.getNationalStandardIndustryCategories());
|
||||
entity.setNationalStandardIndustryCategories2(param.getNationalStandardIndustryCategories2());
|
||||
entity.setNationalStandardIndustryCategories3(param.getNationalStandardIndustryCategories3());
|
||||
entity.setNationalStandardIndustryCategories4(param.getNationalStandardIndustryCategories4());
|
||||
entity.setNationalStandardIndustryCategories5(param.getNationalStandardIndustryCategories5());
|
||||
entity.setNationalStandardIndustryCategories6(param.getNationalStandardIndustryCategories6());
|
||||
entity.setNationalStandardIndustryCategories7(param.getNationalStandardIndustryCategories7());
|
||||
entity.setNationalStandardIndustryCategories8(param.getNationalStandardIndustryCategories8());
|
||||
entity.setCompanySize(param.getCompanySize());
|
||||
entity.setFormerName(param.getFormerName());
|
||||
entity.setEnglishName(param.getEnglishName());
|
||||
entity.setDomain(param.getDomain());
|
||||
entity.setMailingAddress(param.getMailingAddress());
|
||||
entity.setCompanyProfile(param.getCompanyProfile());
|
||||
entity.setNatureOfBusiness(param.getNatureOfBusiness());
|
||||
entity.setRegistrationAuthority(param.getRegistrationAuthority());
|
||||
entity.setTaxpayerQualification(param.getTaxpayerQualification());
|
||||
entity.setLatestAnnualReportYear(param.getLatestAnnualReportYear());
|
||||
entity.setLatestAnnualReportOnOperatingRevenue(param.getLatestAnnualReportOnOperatingRevenue());
|
||||
entity.setEnterpriseScoreCheck(param.getEnterpriseScoreCheck());
|
||||
entity.setCreditRating(param.getCreditRating());
|
||||
entity.setCechnologyScore(param.getCechnologyScore());
|
||||
entity.setCechnologyLevel(param.getCechnologyLevel());
|
||||
entity.setSmallEnterprise(param.getSmallEnterprise());
|
||||
|
||||
return entity;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,272 @@
|
||||
package com.gxwebsoft.credit.controller;
|
||||
|
||||
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.CreditCompetitor;
|
||||
import com.gxwebsoft.credit.param.CreditCompetitorImportParam;
|
||||
import com.gxwebsoft.credit.param.CreditCompetitorParam;
|
||||
import com.gxwebsoft.credit.service.CreditCompetitorService;
|
||||
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-19 19:49:05
|
||||
*/
|
||||
@Tag(name = "竞争对手管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/credit/credit-competitor")
|
||||
public class CreditCompetitorController extends BaseController {
|
||||
@Resource
|
||||
private CreditCompetitorService creditCompetitorService;
|
||||
|
||||
@Operation(summary = "分页查询竞争对手")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<CreditCompetitor>> page(CreditCompetitorParam param) {
|
||||
// 使用关联查询
|
||||
return success(creditCompetitorService.pageRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "查询全部竞争对手")
|
||||
@GetMapping()
|
||||
public ApiResult<List<CreditCompetitor>> list(CreditCompetitorParam param) {
|
||||
// 使用关联查询
|
||||
return success(creditCompetitorService.listRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "根据id查询竞争对手")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<CreditCompetitor> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(creditCompetitorService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditCompetitor:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "添加竞争对手")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody CreditCompetitor creditCompetitor) {
|
||||
// 记录当前登录用户id
|
||||
// User loginUser = getLoginUser();
|
||||
// if (loginUser != null) {
|
||||
// creditCompetitor.setUserId(loginUser.getUserId());
|
||||
// }
|
||||
if (creditCompetitorService.save(creditCompetitor)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditCompetitor:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "修改竞争对手")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody CreditCompetitor creditCompetitor) {
|
||||
if (creditCompetitorService.updateById(creditCompetitor)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditCompetitor:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "删除竞争对手")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (creditCompetitorService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditCompetitor:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量添加竞争对手")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<CreditCompetitor> list) {
|
||||
if (creditCompetitorService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditCompetitor:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量修改竞争对手")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<CreditCompetitor> batchParam) {
|
||||
if (batchParam.update(creditCompetitorService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditCompetitor:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量删除竞争对手")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (creditCompetitorService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量导入竞争对手
|
||||
*/
|
||||
@PreAuthorize("hasAuthority('credit:creditCompetitor:save')")
|
||||
@Operation(summary = "批量导入竞争对手")
|
||||
@PostMapping("/import")
|
||||
public ApiResult<List<String>> importBatch(@RequestParam("file") MultipartFile file) {
|
||||
List<String> errorMessages = new ArrayList<>();
|
||||
int successCount = 0;
|
||||
|
||||
try {
|
||||
ExcelImportSupport.ImportResult<CreditCompetitorImportParam> importResult = ExcelImportSupport.read(
|
||||
file, CreditCompetitorImportParam.class, this::isEmptyImportRow,2);
|
||||
List<CreditCompetitorImportParam> 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++) {
|
||||
CreditCompetitorImportParam param = list.get(i);
|
||||
try {
|
||||
CreditCompetitor 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.getCompanyName())) {
|
||||
errorMessages.add("第" + excelRowNumber + "行:企业名称不能为空");
|
||||
continue;
|
||||
}
|
||||
|
||||
boolean saved = creditCompetitorService.save(item);
|
||||
if (!saved) {
|
||||
CreditCompetitor existing = creditCompetitorService.lambdaQuery()
|
||||
.eq(CreditCompetitor::getCompanyName, item.getCompanyName())
|
||||
.one();
|
||||
if (existing != null) {
|
||||
item.setId(existing.getId());
|
||||
if (creditCompetitorService.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<CreditCompetitorImportParam> templateList = new ArrayList<>();
|
||||
|
||||
CreditCompetitorImportParam example = new CreditCompetitorImportParam();
|
||||
example.setCompanyName("示例科技有限公司");
|
||||
example.setLegalRepresentative("张三");
|
||||
example.setRegisteredCapital("5000");
|
||||
example.setEstablishmentDate("2015-01-01");
|
||||
example.setRegistrationStatus("存续");
|
||||
example.setIndustry("软件和信息服务业");
|
||||
example.setProvince("广东省");
|
||||
example.setComments("备注信息");
|
||||
templateList.add(example);
|
||||
|
||||
Workbook workbook = ExcelImportSupport.buildTemplate("竞争对手导入模板", "竞争对手", CreditCompetitorImportParam.class, templateList);
|
||||
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setHeader("Content-Disposition", "attachment; filename=credit_competitor_import_template.xlsx");
|
||||
|
||||
workbook.write(response.getOutputStream());
|
||||
workbook.close();
|
||||
}
|
||||
|
||||
private boolean isEmptyImportRow(CreditCompetitorImportParam param) {
|
||||
if (param == null) {
|
||||
return true;
|
||||
}
|
||||
return ImportHelper.isBlank(param.getCompanyName())
|
||||
&& ImportHelper.isBlank(param.getLegalRepresentative())
|
||||
&& ImportHelper.isBlank(param.getRegisteredCapital())
|
||||
&& ImportHelper.isBlank(param.getEstablishmentDate());
|
||||
}
|
||||
|
||||
private CreditCompetitor convertImportParamToEntity(CreditCompetitorImportParam param) {
|
||||
CreditCompetitor entity = new CreditCompetitor();
|
||||
|
||||
entity.setCompanyName(param.getCompanyName());
|
||||
entity.setLegalRepresentative(param.getLegalRepresentative());
|
||||
entity.setRegisteredCapital(param.getRegisteredCapital());
|
||||
entity.setEstablishmentDate(param.getEstablishmentDate());
|
||||
entity.setRegistrationStatus(param.getRegistrationStatus());
|
||||
entity.setIndustry(param.getIndustry());
|
||||
entity.setProvince(param.getProvince());
|
||||
entity.setComments(param.getComments());
|
||||
|
||||
return entity;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,278 @@
|
||||
package com.gxwebsoft.credit.controller;
|
||||
|
||||
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.CreditCourtAnnouncement;
|
||||
import com.gxwebsoft.credit.param.CreditJudicialImportParam;
|
||||
import com.gxwebsoft.credit.param.CreditCourtAnnouncementParam;
|
||||
import com.gxwebsoft.credit.service.CreditCourtAnnouncementService;
|
||||
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-19 19:49:13
|
||||
*/
|
||||
@Tag(name = "法院公告司法大数据管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/credit/credit-court-announcement")
|
||||
public class CreditCourtAnnouncementController extends BaseController {
|
||||
@Resource
|
||||
private CreditCourtAnnouncementService creditCourtAnnouncementService;
|
||||
|
||||
@Operation(summary = "分页查询法院公告司法大数据")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<CreditCourtAnnouncement>> page(CreditCourtAnnouncementParam param) {
|
||||
// 使用关联查询
|
||||
return success(creditCourtAnnouncementService.pageRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "查询全部法院公告司法大数据")
|
||||
@GetMapping()
|
||||
public ApiResult<List<CreditCourtAnnouncement>> list(CreditCourtAnnouncementParam param) {
|
||||
// 使用关联查询
|
||||
return success(creditCourtAnnouncementService.listRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "根据id查询法院公告司法大数据")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<CreditCourtAnnouncement> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(creditCourtAnnouncementService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditCourtAnnouncement:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "添加法院公告司法大数据")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody CreditCourtAnnouncement creditCourtAnnouncement) {
|
||||
// 记录当前登录用户id
|
||||
// User loginUser = getLoginUser();
|
||||
// if (loginUser != null) {
|
||||
// creditCourtAnnouncement.setUserId(loginUser.getUserId());
|
||||
// }
|
||||
if (creditCourtAnnouncementService.save(creditCourtAnnouncement)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditCourtAnnouncement:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "修改法院公告司法大数据")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody CreditCourtAnnouncement creditCourtAnnouncement) {
|
||||
if (creditCourtAnnouncementService.updateById(creditCourtAnnouncement)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditCourtAnnouncement:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "删除法院公告司法大数据")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (creditCourtAnnouncementService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditCourtAnnouncement:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量添加法院公告司法大数据")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<CreditCourtAnnouncement> list) {
|
||||
if (creditCourtAnnouncementService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditCourtAnnouncement:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量修改法院公告司法大数据")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<CreditCourtAnnouncement> batchParam) {
|
||||
if (batchParam.update(creditCourtAnnouncementService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditCourtAnnouncement:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量删除法院公告司法大数据")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (creditCourtAnnouncementService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量导入法院公告司法大数据
|
||||
*/
|
||||
@PreAuthorize("hasAuthority('credit:creditCourtAnnouncement:save')")
|
||||
@Operation(summary = "批量导入法院公告司法大数据")
|
||||
@PostMapping("/import")
|
||||
public ApiResult<List<String>> importBatch(@RequestParam("file") MultipartFile file) {
|
||||
List<String> errorMessages = new ArrayList<>();
|
||||
int successCount = 0;
|
||||
|
||||
try {
|
||||
ExcelImportSupport.ImportResult<CreditJudicialImportParam> importResult = ExcelImportSupport.read(
|
||||
file, CreditJudicialImportParam.class, this::isEmptyImportRow);
|
||||
List<CreditJudicialImportParam> 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++) {
|
||||
CreditJudicialImportParam param = list.get(i);
|
||||
try {
|
||||
CreditCourtAnnouncement 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.getCaseNumber())) {
|
||||
errorMessages.add("第" + excelRowNumber + "行:案号不能为空");
|
||||
continue;
|
||||
}
|
||||
|
||||
boolean saved = creditCourtAnnouncementService.save(item);
|
||||
if (!saved) {
|
||||
CreditCourtAnnouncement existing = creditCourtAnnouncementService.lambdaQuery()
|
||||
.eq(CreditCourtAnnouncement::getCaseNumber, item.getCaseNumber())
|
||||
.one();
|
||||
if (existing != null) {
|
||||
item.setId(existing.getId());
|
||||
if (creditCourtAnnouncementService.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<CreditJudicialImportParam> templateList = new ArrayList<>();
|
||||
|
||||
CreditJudicialImportParam example = new CreditJudicialImportParam();
|
||||
example.setDataType("法院公告");
|
||||
example.setPlaintiffAppellant("原告示例");
|
||||
example.setAppellee("被告示例");
|
||||
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);
|
||||
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setHeader("Content-Disposition", "attachment; filename=credit_court_announcement_import_template.xlsx");
|
||||
|
||||
workbook.write(response.getOutputStream());
|
||||
workbook.close();
|
||||
}
|
||||
|
||||
private boolean isEmptyImportRow(CreditJudicialImportParam param) {
|
||||
if (param == null) {
|
||||
return true;
|
||||
}
|
||||
return ImportHelper.isBlank(param.getCaseNumber())
|
||||
&& ImportHelper.isBlank(param.getPlaintiffAppellant())
|
||||
&& ImportHelper.isBlank(param.getAppellee())
|
||||
&& ImportHelper.isBlank(param.getCauseOfAction());
|
||||
}
|
||||
|
||||
private CreditCourtAnnouncement convertImportParamToEntity(CreditJudicialImportParam param) {
|
||||
CreditCourtAnnouncement entity = new CreditCourtAnnouncement();
|
||||
|
||||
entity.setDataType(param.getDataType());
|
||||
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.setCourtName(param.getCourtName());
|
||||
entity.setDataStatus(param.getDataStatus());
|
||||
entity.setComments(param.getComments());
|
||||
|
||||
return entity;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,278 @@
|
||||
package com.gxwebsoft.credit.controller;
|
||||
|
||||
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.CreditCourtSession;
|
||||
import com.gxwebsoft.credit.param.CreditJudicialImportParam;
|
||||
import com.gxwebsoft.credit.param.CreditCourtSessionParam;
|
||||
import com.gxwebsoft.credit.service.CreditCourtSessionService;
|
||||
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-19 19:49:33
|
||||
*/
|
||||
@Tag(name = "开庭公告司法大数据管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/credit/credit-court-session")
|
||||
public class CreditCourtSessionController extends BaseController {
|
||||
@Resource
|
||||
private CreditCourtSessionService creditCourtSessionService;
|
||||
|
||||
@Operation(summary = "分页查询开庭公告司法大数据")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<CreditCourtSession>> page(CreditCourtSessionParam param) {
|
||||
// 使用关联查询
|
||||
return success(creditCourtSessionService.pageRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "查询全部开庭公告司法大数据")
|
||||
@GetMapping()
|
||||
public ApiResult<List<CreditCourtSession>> list(CreditCourtSessionParam param) {
|
||||
// 使用关联查询
|
||||
return success(creditCourtSessionService.listRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "根据id查询开庭公告司法大数据")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<CreditCourtSession> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(creditCourtSessionService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditCourtSession:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "添加开庭公告司法大数据")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody CreditCourtSession creditCourtSession) {
|
||||
// 记录当前登录用户id
|
||||
// User loginUser = getLoginUser();
|
||||
// if (loginUser != null) {
|
||||
// creditCourtSession.setUserId(loginUser.getUserId());
|
||||
// }
|
||||
if (creditCourtSessionService.save(creditCourtSession)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditCourtSession:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "修改开庭公告司法大数据")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody CreditCourtSession creditCourtSession) {
|
||||
if (creditCourtSessionService.updateById(creditCourtSession)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditCourtSession:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "删除开庭公告司法大数据")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (creditCourtSessionService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditCourtSession:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量添加开庭公告司法大数据")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<CreditCourtSession> list) {
|
||||
if (creditCourtSessionService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditCourtSession:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量修改开庭公告司法大数据")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<CreditCourtSession> batchParam) {
|
||||
if (batchParam.update(creditCourtSessionService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditCourtSession:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量删除开庭公告司法大数据")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (creditCourtSessionService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量导入开庭公告司法大数据
|
||||
*/
|
||||
@PreAuthorize("hasAuthority('credit:creditCourtSession:save')")
|
||||
@Operation(summary = "批量导入开庭公告司法大数据")
|
||||
@PostMapping("/import")
|
||||
public ApiResult<List<String>> importBatch(@RequestParam("file") MultipartFile file) {
|
||||
List<String> errorMessages = new ArrayList<>();
|
||||
int successCount = 0;
|
||||
|
||||
try {
|
||||
ExcelImportSupport.ImportResult<CreditJudicialImportParam> importResult = ExcelImportSupport.read(
|
||||
file, CreditJudicialImportParam.class, this::isEmptyImportRow);
|
||||
List<CreditJudicialImportParam> 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++) {
|
||||
CreditJudicialImportParam param = list.get(i);
|
||||
try {
|
||||
CreditCourtSession 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.getCaseNumber())) {
|
||||
errorMessages.add("第" + excelRowNumber + "行:案号不能为空");
|
||||
continue;
|
||||
}
|
||||
|
||||
boolean saved = creditCourtSessionService.save(item);
|
||||
if (!saved) {
|
||||
CreditCourtSession existing = creditCourtSessionService.lambdaQuery()
|
||||
.eq(CreditCourtSession::getCaseNumber, item.getCaseNumber())
|
||||
.one();
|
||||
if (existing != null) {
|
||||
item.setId(existing.getId());
|
||||
if (creditCourtSessionService.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<CreditJudicialImportParam> templateList = new ArrayList<>();
|
||||
|
||||
CreditJudicialImportParam example = new CreditJudicialImportParam();
|
||||
example.setDataType("开庭公告");
|
||||
example.setPlaintiffAppellant("原告示例");
|
||||
example.setAppellee("被告示例");
|
||||
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);
|
||||
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setHeader("Content-Disposition", "attachment; filename=credit_court_session_import_template.xlsx");
|
||||
|
||||
workbook.write(response.getOutputStream());
|
||||
workbook.close();
|
||||
}
|
||||
|
||||
private boolean isEmptyImportRow(CreditJudicialImportParam param) {
|
||||
if (param == null) {
|
||||
return true;
|
||||
}
|
||||
return ImportHelper.isBlank(param.getCaseNumber())
|
||||
&& ImportHelper.isBlank(param.getPlaintiffAppellant())
|
||||
&& ImportHelper.isBlank(param.getAppellee())
|
||||
&& ImportHelper.isBlank(param.getCauseOfAction());
|
||||
}
|
||||
|
||||
private CreditCourtSession convertImportParamToEntity(CreditJudicialImportParam param) {
|
||||
CreditCourtSession entity = new CreditCourtSession();
|
||||
|
||||
entity.setDataType(param.getDataType());
|
||||
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.setCourtName(param.getCourtName());
|
||||
entity.setDataStatus(param.getDataStatus());
|
||||
entity.setComments(param.getComments());
|
||||
|
||||
return entity;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,262 @@
|
||||
package com.gxwebsoft.credit.controller;
|
||||
|
||||
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.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;
|
||||
|
||||
/**
|
||||
* 客户控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-12-21 21:20:58
|
||||
*/
|
||||
@Tag(name = "客户管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/credit/credit-customer")
|
||||
public class CreditCustomerController extends BaseController {
|
||||
@Resource
|
||||
private CreditCustomerService creditCustomerService;
|
||||
|
||||
@Operation(summary = "分页查询客户")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<CreditCustomer>> page(CreditCustomerParam param) {
|
||||
// 使用关联查询
|
||||
return success(creditCustomerService.pageRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "查询全部客户")
|
||||
@GetMapping()
|
||||
public ApiResult<List<CreditCustomer>> list(CreditCustomerParam param) {
|
||||
// 使用关联查询
|
||||
return success(creditCustomerService.listRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "根据id查询客户")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<CreditCustomer> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(creditCustomerService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditCustomer:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "添加客户")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody CreditCustomer creditCustomer) {
|
||||
if (creditCustomerService.save(creditCustomer)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditCustomer:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "修改客户")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody CreditCustomer creditCustomer) {
|
||||
if (creditCustomerService.updateById(creditCustomer)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditCustomer:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "删除客户")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (creditCustomerService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditCustomer:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量添加客户")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<CreditCustomer> list) {
|
||||
if (creditCustomerService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditCustomer:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量修改客户")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<CreditCustomer> batchParam) {
|
||||
if (batchParam.update(creditCustomerService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditCustomer:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量删除客户")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (creditCustomerService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量导入客户
|
||||
*/
|
||||
@PreAuthorize("hasAuthority('credit:creditCustomer:save')")
|
||||
@Operation(summary = "批量导入客户")
|
||||
@PostMapping("/import")
|
||||
public ApiResult<List<String>> importBatch(@RequestParam("file") MultipartFile file) {
|
||||
List<String> errorMessages = new ArrayList<>();
|
||||
int successCount = 0;
|
||||
|
||||
try {
|
||||
ExcelImportSupport.ImportResult<CreditCustomerImportParam> importResult = ExcelImportSupport.read(
|
||||
file, CreditCustomerImportParam.class, this::isEmptyImportRow,4);
|
||||
List<CreditCustomerImportParam> 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<CreditCustomerImportParam> 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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,278 @@
|
||||
package com.gxwebsoft.credit.controller;
|
||||
|
||||
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.CreditDeliveryNotice;
|
||||
import com.gxwebsoft.credit.param.CreditDeliveryNoticeParam;
|
||||
import com.gxwebsoft.credit.param.CreditJudicialImportParam;
|
||||
import com.gxwebsoft.credit.service.CreditDeliveryNoticeService;
|
||||
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-19 19:49:52
|
||||
*/
|
||||
@Tag(name = "送达公告司法大数据管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/credit/credit-delivery-notice")
|
||||
public class CreditDeliveryNoticeController extends BaseController {
|
||||
@Resource
|
||||
private CreditDeliveryNoticeService creditDeliveryNoticeService;
|
||||
|
||||
@Operation(summary = "分页查询送达公告司法大数据")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<CreditDeliveryNotice>> page(CreditDeliveryNoticeParam param) {
|
||||
// 使用关联查询
|
||||
return success(creditDeliveryNoticeService.pageRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "查询全部送达公告司法大数据")
|
||||
@GetMapping()
|
||||
public ApiResult<List<CreditDeliveryNotice>> list(CreditDeliveryNoticeParam param) {
|
||||
// 使用关联查询
|
||||
return success(creditDeliveryNoticeService.listRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "根据id查询送达公告司法大数据")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<CreditDeliveryNotice> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(creditDeliveryNoticeService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditDeliveryNotice:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "添加送达公告司法大数据")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody CreditDeliveryNotice creditDeliveryNotice) {
|
||||
// 记录当前登录用户id
|
||||
// User loginUser = getLoginUser();
|
||||
// if (loginUser != null) {
|
||||
// creditDeliveryNotice.setUserId(loginUser.getUserId());
|
||||
// }
|
||||
if (creditDeliveryNoticeService.save(creditDeliveryNotice)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditDeliveryNotice:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "修改送达公告司法大数据")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody CreditDeliveryNotice creditDeliveryNotice) {
|
||||
if (creditDeliveryNoticeService.updateById(creditDeliveryNotice)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditDeliveryNotice:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "删除送达公告司法大数据")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (creditDeliveryNoticeService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditDeliveryNotice:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量添加送达公告司法大数据")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<CreditDeliveryNotice> list) {
|
||||
if (creditDeliveryNoticeService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditDeliveryNotice:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量修改送达公告司法大数据")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<CreditDeliveryNotice> batchParam) {
|
||||
if (batchParam.update(creditDeliveryNoticeService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditDeliveryNotice:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量删除送达公告司法大数据")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (creditDeliveryNoticeService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量导入送达公告司法大数据
|
||||
*/
|
||||
@PreAuthorize("hasAuthority('credit:creditDeliveryNotice:save')")
|
||||
@Operation(summary = "批量导入送达公告司法大数据")
|
||||
@PostMapping("/import")
|
||||
public ApiResult<List<String>> importBatch(@RequestParam("file") MultipartFile file) {
|
||||
List<String> errorMessages = new ArrayList<>();
|
||||
int successCount = 0;
|
||||
|
||||
try {
|
||||
ExcelImportSupport.ImportResult<CreditJudicialImportParam> importResult = ExcelImportSupport.read(
|
||||
file, CreditJudicialImportParam.class, this::isEmptyImportRow);
|
||||
List<CreditJudicialImportParam> 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++) {
|
||||
CreditJudicialImportParam param = list.get(i);
|
||||
try {
|
||||
CreditDeliveryNotice 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.getCaseNumber())) {
|
||||
errorMessages.add("第" + excelRowNumber + "行:案号不能为空");
|
||||
continue;
|
||||
}
|
||||
|
||||
boolean saved = creditDeliveryNoticeService.save(item);
|
||||
if (!saved) {
|
||||
CreditDeliveryNotice existing = creditDeliveryNoticeService.lambdaQuery()
|
||||
.eq(CreditDeliveryNotice::getCaseNumber, item.getCaseNumber())
|
||||
.one();
|
||||
if (existing != null) {
|
||||
item.setId(existing.getId());
|
||||
if (creditDeliveryNoticeService.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<CreditJudicialImportParam> templateList = new ArrayList<>();
|
||||
|
||||
CreditJudicialImportParam example = new CreditJudicialImportParam();
|
||||
example.setDataType("送达公告");
|
||||
example.setPlaintiffAppellant("原告示例");
|
||||
example.setAppellee("被告示例");
|
||||
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);
|
||||
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setHeader("Content-Disposition", "attachment; filename=credit_delivery_notice_import_template.xlsx");
|
||||
|
||||
workbook.write(response.getOutputStream());
|
||||
workbook.close();
|
||||
}
|
||||
|
||||
private boolean isEmptyImportRow(CreditJudicialImportParam param) {
|
||||
if (param == null) {
|
||||
return true;
|
||||
}
|
||||
return ImportHelper.isBlank(param.getCaseNumber())
|
||||
&& ImportHelper.isBlank(param.getPlaintiffAppellant())
|
||||
&& ImportHelper.isBlank(param.getAppellee())
|
||||
&& ImportHelper.isBlank(param.getCauseOfAction());
|
||||
}
|
||||
|
||||
private CreditDeliveryNotice convertImportParamToEntity(CreditJudicialImportParam param) {
|
||||
CreditDeliveryNotice entity = new CreditDeliveryNotice();
|
||||
|
||||
entity.setDataType(param.getDataType());
|
||||
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.setCourtName(param.getCourtName());
|
||||
entity.setDataStatus(param.getDataStatus());
|
||||
entity.setComments(param.getComments());
|
||||
|
||||
return entity;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,286 @@
|
||||
package com.gxwebsoft.credit.controller;
|
||||
|
||||
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.CreditExternal;
|
||||
import com.gxwebsoft.credit.param.CreditExternalImportParam;
|
||||
import com.gxwebsoft.credit.param.CreditExternalParam;
|
||||
import com.gxwebsoft.credit.service.CreditExternalService;
|
||||
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-19 19:50:12
|
||||
*/
|
||||
@Tag(name = "对外投资管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/credit/credit-external")
|
||||
public class CreditExternalController extends BaseController {
|
||||
@Resource
|
||||
private CreditExternalService creditExternalService;
|
||||
|
||||
@Operation(summary = "分页查询对外投资")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<CreditExternal>> page(CreditExternalParam param) {
|
||||
// 使用关联查询
|
||||
return success(creditExternalService.pageRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "查询全部对外投资")
|
||||
@GetMapping()
|
||||
public ApiResult<List<CreditExternal>> list(CreditExternalParam param) {
|
||||
// 使用关联查询
|
||||
return success(creditExternalService.listRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "根据id查询对外投资")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<CreditExternal> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(creditExternalService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditExternal:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "添加对外投资")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody CreditExternal creditExternal) {
|
||||
// 记录当前登录用户id
|
||||
// User loginUser = getLoginUser();
|
||||
// if (loginUser != null) {
|
||||
// creditExternal.setUserId(loginUser.getUserId());
|
||||
// }
|
||||
if (creditExternalService.save(creditExternal)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditExternal:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "修改对外投资")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody CreditExternal creditExternal) {
|
||||
if (creditExternalService.updateById(creditExternal)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditExternal:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "删除对外投资")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (creditExternalService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditExternal:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量添加对外投资")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<CreditExternal> list) {
|
||||
if (creditExternalService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditExternal:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量修改对外投资")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<CreditExternal> batchParam) {
|
||||
if (batchParam.update(creditExternalService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditExternal:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量删除对外投资")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (creditExternalService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量导入对外投资
|
||||
*/
|
||||
@PreAuthorize("hasAuthority('credit:creditExternal:save')")
|
||||
@Operation(summary = "批量导入对外投资")
|
||||
@PostMapping("/import")
|
||||
public ApiResult<List<String>> importBatch(@RequestParam("file") MultipartFile file) {
|
||||
List<String> errorMessages = new ArrayList<>();
|
||||
int successCount = 0;
|
||||
|
||||
try {
|
||||
ExcelImportSupport.ImportResult<CreditExternalImportParam> importResult = ExcelImportSupport.read(
|
||||
file, CreditExternalImportParam.class, this::isEmptyImportRow);
|
||||
List<CreditExternalImportParam> 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++) {
|
||||
CreditExternalImportParam param = list.get(i);
|
||||
try {
|
||||
CreditExternal 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 = creditExternalService.save(item);
|
||||
if (!saved) {
|
||||
CreditExternal existing = creditExternalService.lambdaQuery()
|
||||
.eq(CreditExternal::getName, item.getName())
|
||||
.one();
|
||||
if (existing != null) {
|
||||
item.setId(existing.getId());
|
||||
if (creditExternalService.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<CreditExternalImportParam> templateList = new ArrayList<>();
|
||||
|
||||
CreditExternalImportParam example = new CreditExternalImportParam();
|
||||
example.setName("示例科技有限公司");
|
||||
example.setStatusTxt("存续");
|
||||
example.setLegalRepresentative("李四");
|
||||
example.setRegisteredCapital("10000");
|
||||
example.setEstablishmentDate("2018-06-01");
|
||||
example.setShareholdingRatio("20");
|
||||
example.setSubscribedInvestmentAmount("2000");
|
||||
example.setSubscribedInvestmentDate("2019-01-01");
|
||||
example.setIndirectShareholdingRatio("5");
|
||||
example.setInvestmentDate("2019-06-01");
|
||||
example.setRegion("上海");
|
||||
example.setIndustry("信息技术");
|
||||
example.setInvestmentCount(1);
|
||||
example.setRelatedProductsInstitutions("关联产品示例");
|
||||
example.setComments("备注信息");
|
||||
templateList.add(example);
|
||||
|
||||
Workbook workbook = ExcelImportSupport.buildTemplate("对外投资导入模板", "对外投资", CreditExternalImportParam.class, templateList);
|
||||
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setHeader("Content-Disposition", "attachment; filename=credit_external_import_template.xlsx");
|
||||
|
||||
workbook.write(response.getOutputStream());
|
||||
workbook.close();
|
||||
}
|
||||
|
||||
private boolean isEmptyImportRow(CreditExternalImportParam param) {
|
||||
if (param == null) {
|
||||
return true;
|
||||
}
|
||||
return ImportHelper.isBlank(param.getName())
|
||||
&& ImportHelper.isBlank(param.getLegalRepresentative())
|
||||
&& ImportHelper.isBlank(param.getRegisteredCapital())
|
||||
&& ImportHelper.isBlank(param.getEstablishmentDate());
|
||||
}
|
||||
|
||||
private CreditExternal convertImportParamToEntity(CreditExternalImportParam param) {
|
||||
CreditExternal entity = new CreditExternal();
|
||||
|
||||
entity.setName(param.getName());
|
||||
entity.setStatusTxt(param.getStatusTxt());
|
||||
entity.setLegalRepresentative(param.getLegalRepresentative());
|
||||
entity.setRegisteredCapital(param.getRegisteredCapital());
|
||||
entity.setEstablishmentDate(param.getEstablishmentDate());
|
||||
entity.setShareholdingRatio(param.getShareholdingRatio());
|
||||
entity.setSubscribedInvestmentAmount(param.getSubscribedInvestmentAmount());
|
||||
entity.setSubscribedInvestmentDate(param.getSubscribedInvestmentDate());
|
||||
entity.setIndirectShareholdingRatio(param.getIndirectShareholdingRatio());
|
||||
entity.setInvestmentDate(param.getInvestmentDate());
|
||||
entity.setRegion(param.getRegion());
|
||||
entity.setIndustry(param.getIndustry());
|
||||
entity.setInvestmentCount(param.getInvestmentCount());
|
||||
entity.setRelatedProductsInstitutions(param.getRelatedProductsInstitutions());
|
||||
entity.setComments(param.getComments());
|
||||
|
||||
return entity;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,278 @@
|
||||
package com.gxwebsoft.credit.controller;
|
||||
|
||||
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.CreditFinalVersion;
|
||||
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;
|
||||
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-19 19:50:19
|
||||
*/
|
||||
@Tag(name = "终本案件管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/credit/credit-final-version")
|
||||
public class CreditFinalVersionController extends BaseController {
|
||||
@Resource
|
||||
private CreditFinalVersionService creditFinalVersionService;
|
||||
|
||||
@Operation(summary = "分页查询终本案件")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<CreditFinalVersion>> page(CreditFinalVersionParam param) {
|
||||
// 使用关联查询
|
||||
return success(creditFinalVersionService.pageRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "查询全部终本案件")
|
||||
@GetMapping()
|
||||
public ApiResult<List<CreditFinalVersion>> list(CreditFinalVersionParam param) {
|
||||
// 使用关联查询
|
||||
return success(creditFinalVersionService.listRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "根据id查询终本案件")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<CreditFinalVersion> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(creditFinalVersionService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditFinalVersion:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "添加终本案件")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody CreditFinalVersion creditFinalVersion) {
|
||||
// 记录当前登录用户id
|
||||
// User loginUser = getLoginUser();
|
||||
// if (loginUser != null) {
|
||||
// creditFinalVersion.setUserId(loginUser.getUserId());
|
||||
// }
|
||||
if (creditFinalVersionService.save(creditFinalVersion)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditFinalVersion:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "修改终本案件")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody CreditFinalVersion creditFinalVersion) {
|
||||
if (creditFinalVersionService.updateById(creditFinalVersion)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditFinalVersion:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "删除终本案件")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (creditFinalVersionService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditFinalVersion:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量添加终本案件")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<CreditFinalVersion> list) {
|
||||
if (creditFinalVersionService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditFinalVersion:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量修改终本案件")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<CreditFinalVersion> batchParam) {
|
||||
if (batchParam.update(creditFinalVersionService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditFinalVersion:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量删除终本案件")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (creditFinalVersionService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量导入终本案件
|
||||
*/
|
||||
@PreAuthorize("hasAuthority('credit:creditFinalVersion:save')")
|
||||
@Operation(summary = "批量导入终本案件")
|
||||
@PostMapping("/import")
|
||||
public ApiResult<List<String>> importBatch(@RequestParam("file") MultipartFile file) {
|
||||
List<String> errorMessages = new ArrayList<>();
|
||||
int successCount = 0;
|
||||
|
||||
try {
|
||||
ExcelImportSupport.ImportResult<CreditJudicialImportParam> importResult = ExcelImportSupport.read(
|
||||
file, CreditJudicialImportParam.class, this::isEmptyImportRow);
|
||||
List<CreditJudicialImportParam> 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++) {
|
||||
CreditJudicialImportParam param = list.get(i);
|
||||
try {
|
||||
CreditFinalVersion 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.getCaseNumber())) {
|
||||
errorMessages.add("第" + excelRowNumber + "行:案号不能为空");
|
||||
continue;
|
||||
}
|
||||
|
||||
boolean saved = creditFinalVersionService.save(item);
|
||||
if (!saved) {
|
||||
CreditFinalVersion existing = creditFinalVersionService.lambdaQuery()
|
||||
.eq(CreditFinalVersion::getCaseNumber, item.getCaseNumber())
|
||||
.one();
|
||||
if (existing != null) {
|
||||
item.setId(existing.getId());
|
||||
if (creditFinalVersionService.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<CreditJudicialImportParam> templateList = new ArrayList<>();
|
||||
|
||||
CreditJudicialImportParam example = new CreditJudicialImportParam();
|
||||
example.setDataType("终本案件");
|
||||
example.setPlaintiffAppellant("原告示例");
|
||||
example.setAppellee("被告示例");
|
||||
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);
|
||||
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setHeader("Content-Disposition", "attachment; filename=credit_final_version_import_template.xlsx");
|
||||
|
||||
workbook.write(response.getOutputStream());
|
||||
workbook.close();
|
||||
}
|
||||
|
||||
private boolean isEmptyImportRow(CreditJudicialImportParam param) {
|
||||
if (param == null) {
|
||||
return true;
|
||||
}
|
||||
return ImportHelper.isBlank(param.getCaseNumber())
|
||||
&& ImportHelper.isBlank(param.getPlaintiffAppellant())
|
||||
&& ImportHelper.isBlank(param.getAppellee())
|
||||
&& ImportHelper.isBlank(param.getCauseOfAction());
|
||||
}
|
||||
|
||||
private CreditFinalVersion convertImportParamToEntity(CreditJudicialImportParam param) {
|
||||
CreditFinalVersion entity = new CreditFinalVersion();
|
||||
|
||||
entity.setDataType(param.getDataType());
|
||||
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.setCourtName(param.getCourtName());
|
||||
entity.setDataStatus(param.getDataStatus());
|
||||
entity.setComments(param.getComments());
|
||||
|
||||
return entity;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,278 @@
|
||||
package com.gxwebsoft.credit.controller;
|
||||
|
||||
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.CreditGqdj;
|
||||
import com.gxwebsoft.credit.param.CreditGqdjParam;
|
||||
import com.gxwebsoft.credit.param.CreditJudicialImportParam;
|
||||
import com.gxwebsoft.credit.service.CreditGqdjService;
|
||||
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-19 19:50:37
|
||||
*/
|
||||
@Tag(name = "股权冻结管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/credit/credit-gqdj")
|
||||
public class CreditGqdjController extends BaseController {
|
||||
@Resource
|
||||
private CreditGqdjService creditGqdjService;
|
||||
|
||||
@Operation(summary = "分页查询股权冻结")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<CreditGqdj>> page(CreditGqdjParam param) {
|
||||
// 使用关联查询
|
||||
return success(creditGqdjService.pageRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "查询全部股权冻结")
|
||||
@GetMapping()
|
||||
public ApiResult<List<CreditGqdj>> list(CreditGqdjParam param) {
|
||||
// 使用关联查询
|
||||
return success(creditGqdjService.listRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "根据id查询股权冻结")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<CreditGqdj> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(creditGqdjService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditGqdj:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "添加股权冻结")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody CreditGqdj creditGqdj) {
|
||||
// 记录当前登录用户id
|
||||
// User loginUser = getLoginUser();
|
||||
// if (loginUser != null) {
|
||||
// creditGqdj.setUserId(loginUser.getUserId());
|
||||
// }
|
||||
if (creditGqdjService.save(creditGqdj)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditGqdj:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "修改股权冻结")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody CreditGqdj creditGqdj) {
|
||||
if (creditGqdjService.updateById(creditGqdj)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditGqdj:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "删除股权冻结")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (creditGqdjService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditGqdj:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量添加股权冻结")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<CreditGqdj> list) {
|
||||
if (creditGqdjService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditGqdj:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量修改股权冻结")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<CreditGqdj> batchParam) {
|
||||
if (batchParam.update(creditGqdjService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditGqdj:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量删除股权冻结")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (creditGqdjService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量导入股权冻结司法大数据
|
||||
*/
|
||||
@PreAuthorize("hasAuthority('credit:creditGqdj:save')")
|
||||
@Operation(summary = "批量导入股权冻结司法大数据")
|
||||
@PostMapping("/import")
|
||||
public ApiResult<List<String>> importBatch(@RequestParam("file") MultipartFile file) {
|
||||
List<String> errorMessages = new ArrayList<>();
|
||||
int successCount = 0;
|
||||
|
||||
try {
|
||||
ExcelImportSupport.ImportResult<CreditJudicialImportParam> importResult = ExcelImportSupport.read(
|
||||
file, CreditJudicialImportParam.class, this::isEmptyImportRow);
|
||||
List<CreditJudicialImportParam> 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++) {
|
||||
CreditJudicialImportParam param = list.get(i);
|
||||
try {
|
||||
CreditGqdj 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.getCaseNumber())) {
|
||||
errorMessages.add("第" + excelRowNumber + "行:案号不能为空");
|
||||
continue;
|
||||
}
|
||||
|
||||
boolean saved = creditGqdjService.save(item);
|
||||
if (!saved) {
|
||||
CreditGqdj existing = creditGqdjService.lambdaQuery()
|
||||
.eq(CreditGqdj::getCaseNumber, item.getCaseNumber())
|
||||
.one();
|
||||
if (existing != null) {
|
||||
item.setId(existing.getId());
|
||||
if (creditGqdjService.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<CreditJudicialImportParam> templateList = new ArrayList<>();
|
||||
|
||||
CreditJudicialImportParam example = new CreditJudicialImportParam();
|
||||
example.setDataType("股权冻结");
|
||||
example.setPlaintiffAppellant("原告示例");
|
||||
example.setAppellee("被告示例");
|
||||
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);
|
||||
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setHeader("Content-Disposition", "attachment; filename=credit_gqdj_import_template.xlsx");
|
||||
|
||||
workbook.write(response.getOutputStream());
|
||||
workbook.close();
|
||||
}
|
||||
|
||||
private boolean isEmptyImportRow(CreditJudicialImportParam param) {
|
||||
if (param == null) {
|
||||
return true;
|
||||
}
|
||||
return ImportHelper.isBlank(param.getCaseNumber())
|
||||
&& ImportHelper.isBlank(param.getPlaintiffAppellant())
|
||||
&& ImportHelper.isBlank(param.getAppellee())
|
||||
&& ImportHelper.isBlank(param.getCauseOfAction());
|
||||
}
|
||||
|
||||
private CreditGqdj convertImportParamToEntity(CreditJudicialImportParam param) {
|
||||
CreditGqdj entity = new CreditGqdj();
|
||||
|
||||
entity.setDataType(param.getDataType());
|
||||
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.setCourtName(param.getCourtName());
|
||||
entity.setDataStatus(param.getDataStatus());
|
||||
entity.setComments(param.getComments());
|
||||
|
||||
return entity;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,269 @@
|
||||
package com.gxwebsoft.credit.controller;
|
||||
|
||||
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.CreditJudgmentDebtor;
|
||||
import com.gxwebsoft.credit.param.CreditJudgmentDebtorImportParam;
|
||||
import com.gxwebsoft.credit.param.CreditJudgmentDebtorParam;
|
||||
import com.gxwebsoft.credit.service.CreditJudgmentDebtorService;
|
||||
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-19 19:50:55
|
||||
*/
|
||||
@Tag(name = "被执行人管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/credit/credit-judgment-debtor")
|
||||
public class CreditJudgmentDebtorController extends BaseController {
|
||||
@Resource
|
||||
private CreditJudgmentDebtorService creditJudgmentDebtorService;
|
||||
|
||||
@Operation(summary = "分页查询被执行人")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<CreditJudgmentDebtor>> page(CreditJudgmentDebtorParam param) {
|
||||
// 使用关联查询
|
||||
return success(creditJudgmentDebtorService.pageRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "查询全部被执行人")
|
||||
@GetMapping()
|
||||
public ApiResult<List<CreditJudgmentDebtor>> list(CreditJudgmentDebtorParam param) {
|
||||
// 使用关联查询
|
||||
return success(creditJudgmentDebtorService.listRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "根据id查询被执行人")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<CreditJudgmentDebtor> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(creditJudgmentDebtorService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditJudgmentDebtor:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "添加被执行人")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody CreditJudgmentDebtor creditJudgmentDebtor) {
|
||||
// 记录当前登录用户id
|
||||
// User loginUser = getLoginUser();
|
||||
// if (loginUser != null) {
|
||||
// creditJudgmentDebtor.setUserId(loginUser.getUserId());
|
||||
// }
|
||||
if (creditJudgmentDebtorService.save(creditJudgmentDebtor)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditJudgmentDebtor:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "修改被执行人")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody CreditJudgmentDebtor creditJudgmentDebtor) {
|
||||
if (creditJudgmentDebtorService.updateById(creditJudgmentDebtor)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditJudgmentDebtor:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "删除被执行人")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (creditJudgmentDebtorService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditJudgmentDebtor:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量添加被执行人")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<CreditJudgmentDebtor> list) {
|
||||
if (creditJudgmentDebtorService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditJudgmentDebtor:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量修改被执行人")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<CreditJudgmentDebtor> batchParam) {
|
||||
if (batchParam.update(creditJudgmentDebtorService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditJudgmentDebtor:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量删除被执行人")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (creditJudgmentDebtorService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量导入被执行人
|
||||
*/
|
||||
@PreAuthorize("hasAuthority('credit:creditJudgmentDebtor:save')")
|
||||
@Operation(summary = "批量导入被执行人")
|
||||
@PostMapping("/import")
|
||||
public ApiResult<List<String>> importBatch(@RequestParam("file") MultipartFile file) {
|
||||
List<String> errorMessages = new ArrayList<>();
|
||||
int successCount = 0;
|
||||
|
||||
try {
|
||||
ExcelImportSupport.ImportResult<CreditJudgmentDebtorImportParam> importResult = ExcelImportSupport.read(
|
||||
file, CreditJudgmentDebtorImportParam.class, this::isEmptyImportRow);
|
||||
List<CreditJudgmentDebtorImportParam> 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++) {
|
||||
CreditJudgmentDebtorImportParam param = list.get(i);
|
||||
try {
|
||||
CreditJudgmentDebtor 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.getCaseNumber())) {
|
||||
errorMessages.add("第" + excelRowNumber + "行:案号不能为空");
|
||||
continue;
|
||||
}
|
||||
|
||||
boolean saved = creditJudgmentDebtorService.save(item);
|
||||
if (!saved) {
|
||||
CreditJudgmentDebtor existing = creditJudgmentDebtorService.lambdaQuery()
|
||||
.eq(CreditJudgmentDebtor::getCaseNumber, item.getCaseNumber())
|
||||
.one();
|
||||
if (existing != null) {
|
||||
item.setId(existing.getId());
|
||||
if (creditJudgmentDebtorService.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<CreditJudgmentDebtorImportParam> templateList = new ArrayList<>();
|
||||
|
||||
CreditJudgmentDebtorImportParam example = new CreditJudgmentDebtorImportParam();
|
||||
example.setCaseNumber("(2024)示例案号");
|
||||
example.setName("某某公司");
|
||||
example.setCode("1234567890");
|
||||
example.setOccurrenceTime("2024-01-10");
|
||||
example.setAmount("100000");
|
||||
example.setDataStatus("已公开");
|
||||
example.setComments("备注信息");
|
||||
templateList.add(example);
|
||||
|
||||
Workbook workbook = ExcelImportSupport.buildTemplate("被执行人导入模板", "被执行人", CreditJudgmentDebtorImportParam.class, templateList);
|
||||
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setHeader("Content-Disposition", "attachment; filename=credit_judgment_debtor_import_template.xlsx");
|
||||
|
||||
workbook.write(response.getOutputStream());
|
||||
workbook.close();
|
||||
}
|
||||
|
||||
private boolean isEmptyImportRow(CreditJudgmentDebtorImportParam param) {
|
||||
if (param == null) {
|
||||
return true;
|
||||
}
|
||||
return ImportHelper.isBlank(param.getCaseNumber())
|
||||
&& ImportHelper.isBlank(param.getName())
|
||||
&& ImportHelper.isBlank(param.getCode());
|
||||
}
|
||||
|
||||
private CreditJudgmentDebtor convertImportParamToEntity(CreditJudgmentDebtorImportParam param) {
|
||||
CreditJudgmentDebtor entity = new CreditJudgmentDebtor();
|
||||
|
||||
entity.setCaseNumber(param.getCaseNumber());
|
||||
entity.setName(param.getName());
|
||||
entity.setCode(param.getCode());
|
||||
entity.setOccurrenceTime(param.getOccurrenceTime());
|
||||
entity.setAmount(ImportHelper.parseBigDecimal(param.getAmount(), "执行标的(元)"));
|
||||
entity.setDataStatus(param.getDataStatus());
|
||||
entity.setComments(param.getComments());
|
||||
|
||||
return entity;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,278 @@
|
||||
package com.gxwebsoft.credit.controller;
|
||||
|
||||
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.CreditJudicialDocument;
|
||||
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;
|
||||
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-19 19:51:03
|
||||
*/
|
||||
@Tag(name = "裁判文书司法大数据管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/credit/credit-judicial-document")
|
||||
public class CreditJudicialDocumentController extends BaseController {
|
||||
@Resource
|
||||
private CreditJudicialDocumentService creditJudicialDocumentService;
|
||||
|
||||
@Operation(summary = "分页查询裁判文书司法大数据")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<CreditJudicialDocument>> page(CreditJudicialDocumentParam param) {
|
||||
// 使用关联查询
|
||||
return success(creditJudicialDocumentService.pageRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "查询全部裁判文书司法大数据")
|
||||
@GetMapping()
|
||||
public ApiResult<List<CreditJudicialDocument>> list(CreditJudicialDocumentParam param) {
|
||||
// 使用关联查询
|
||||
return success(creditJudicialDocumentService.listRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "根据id查询裁判文书司法大数据")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<CreditJudicialDocument> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(creditJudicialDocumentService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditJudicialDocument:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "添加裁判文书司法大数据")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody CreditJudicialDocument creditJudicialDocument) {
|
||||
// 记录当前登录用户id
|
||||
// User loginUser = getLoginUser();
|
||||
// if (loginUser != null) {
|
||||
// creditJudicialDocument.setUserId(loginUser.getUserId());
|
||||
// }
|
||||
if (creditJudicialDocumentService.save(creditJudicialDocument)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditJudicialDocument:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "修改裁判文书司法大数据")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody CreditJudicialDocument creditJudicialDocument) {
|
||||
if (creditJudicialDocumentService.updateById(creditJudicialDocument)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditJudicialDocument:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "删除裁判文书司法大数据")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (creditJudicialDocumentService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditJudicialDocument:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量添加裁判文书司法大数据")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<CreditJudicialDocument> list) {
|
||||
if (creditJudicialDocumentService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditJudicialDocument:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量修改裁判文书司法大数据")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<CreditJudicialDocument> batchParam) {
|
||||
if (batchParam.update(creditJudicialDocumentService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditJudicialDocument:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量删除裁判文书司法大数据")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (creditJudicialDocumentService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量导入裁判文书司法大数据
|
||||
*/
|
||||
@PreAuthorize("hasAuthority('credit:creditJudicialDocument:save')")
|
||||
@Operation(summary = "批量导入裁判文书司法大数据")
|
||||
@PostMapping("/import")
|
||||
public ApiResult<List<String>> importBatch(@RequestParam("file") MultipartFile file) {
|
||||
List<String> errorMessages = new ArrayList<>();
|
||||
int successCount = 0;
|
||||
|
||||
try {
|
||||
ExcelImportSupport.ImportResult<CreditJudicialImportParam> importResult = ExcelImportSupport.read(
|
||||
file, CreditJudicialImportParam.class, this::isEmptyImportRow);
|
||||
List<CreditJudicialImportParam> 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++) {
|
||||
CreditJudicialImportParam param = list.get(i);
|
||||
try {
|
||||
CreditJudicialDocument 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.getCaseNumber())) {
|
||||
errorMessages.add("第" + excelRowNumber + "行:案号不能为空");
|
||||
continue;
|
||||
}
|
||||
|
||||
boolean saved = creditJudicialDocumentService.save(item);
|
||||
if (!saved) {
|
||||
CreditJudicialDocument existing = creditJudicialDocumentService.lambdaQuery()
|
||||
.eq(CreditJudicialDocument::getCaseNumber, item.getCaseNumber())
|
||||
.one();
|
||||
if (existing != null) {
|
||||
item.setId(existing.getId());
|
||||
if (creditJudicialDocumentService.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<CreditJudicialImportParam> templateList = new ArrayList<>();
|
||||
|
||||
CreditJudicialImportParam example = new CreditJudicialImportParam();
|
||||
example.setDataType("裁判文书");
|
||||
example.setPlaintiffAppellant("原告示例");
|
||||
example.setAppellee("被告示例");
|
||||
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);
|
||||
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setHeader("Content-Disposition", "attachment; filename=credit_judicial_document_import_template.xlsx");
|
||||
|
||||
workbook.write(response.getOutputStream());
|
||||
workbook.close();
|
||||
}
|
||||
|
||||
private boolean isEmptyImportRow(CreditJudicialImportParam 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) {
|
||||
CreditJudicialDocument entity = new CreditJudicialDocument();
|
||||
|
||||
entity.setDataType(param.getDataType());
|
||||
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.setCourtName(param.getCourtName());
|
||||
entity.setDataStatus(param.getDataStatus());
|
||||
entity.setComments(param.getComments());
|
||||
|
||||
return entity;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,278 @@
|
||||
package com.gxwebsoft.credit.controller;
|
||||
|
||||
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.CreditMediation;
|
||||
import com.gxwebsoft.credit.param.CreditJudicialImportParam;
|
||||
import com.gxwebsoft.credit.param.CreditMediationParam;
|
||||
import com.gxwebsoft.credit.service.CreditMediationService;
|
||||
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-19 19:51:25
|
||||
*/
|
||||
@Tag(name = "诉前调解司法大数据管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/credit/credit-mediation")
|
||||
public class CreditMediationController extends BaseController {
|
||||
@Resource
|
||||
private CreditMediationService creditMediationService;
|
||||
|
||||
@Operation(summary = "分页查询诉前调解司法大数据")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<CreditMediation>> page(CreditMediationParam param) {
|
||||
// 使用关联查询
|
||||
return success(creditMediationService.pageRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "查询全部诉前调解司法大数据")
|
||||
@GetMapping()
|
||||
public ApiResult<List<CreditMediation>> list(CreditMediationParam param) {
|
||||
// 使用关联查询
|
||||
return success(creditMediationService.listRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "根据id查询诉前调解司法大数据")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<CreditMediation> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(creditMediationService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditMediation:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "添加诉前调解司法大数据")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody CreditMediation creditMediation) {
|
||||
// 记录当前登录用户id
|
||||
// User loginUser = getLoginUser();
|
||||
// if (loginUser != null) {
|
||||
// creditMediation.setUserId(loginUser.getUserId());
|
||||
// }
|
||||
if (creditMediationService.save(creditMediation)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditMediation:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "修改诉前调解司法大数据")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody CreditMediation creditMediation) {
|
||||
if (creditMediationService.updateById(creditMediation)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditMediation:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "删除诉前调解司法大数据")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (creditMediationService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditMediation:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量添加诉前调解司法大数据")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<CreditMediation> list) {
|
||||
if (creditMediationService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditMediation:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量修改诉前调解司法大数据")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<CreditMediation> batchParam) {
|
||||
if (batchParam.update(creditMediationService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditMediation:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量删除诉前调解司法大数据")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (creditMediationService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量导入诉前调解司法大数据
|
||||
*/
|
||||
@PreAuthorize("hasAuthority('credit:creditMediation:save')")
|
||||
@Operation(summary = "批量导入诉前调解司法大数据")
|
||||
@PostMapping("/import")
|
||||
public ApiResult<List<String>> importBatch(@RequestParam("file") MultipartFile file) {
|
||||
List<String> errorMessages = new ArrayList<>();
|
||||
int successCount = 0;
|
||||
|
||||
try {
|
||||
ExcelImportSupport.ImportResult<CreditJudicialImportParam> importResult = ExcelImportSupport.read(
|
||||
file, CreditJudicialImportParam.class, this::isEmptyImportRow);
|
||||
List<CreditJudicialImportParam> 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++) {
|
||||
CreditJudicialImportParam param = list.get(i);
|
||||
try {
|
||||
CreditMediation 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.getCaseNumber())) {
|
||||
errorMessages.add("第" + excelRowNumber + "行:案号不能为空");
|
||||
continue;
|
||||
}
|
||||
|
||||
boolean saved = creditMediationService.save(item);
|
||||
if (!saved) {
|
||||
CreditMediation existing = creditMediationService.lambdaQuery()
|
||||
.eq(CreditMediation::getCaseNumber, item.getCaseNumber())
|
||||
.one();
|
||||
if (existing != null) {
|
||||
item.setId(existing.getId());
|
||||
if (creditMediationService.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<CreditJudicialImportParam> templateList = new ArrayList<>();
|
||||
|
||||
CreditJudicialImportParam example = new CreditJudicialImportParam();
|
||||
example.setDataType("诉前调解");
|
||||
example.setPlaintiffAppellant("原告示例");
|
||||
example.setAppellee("被告示例");
|
||||
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);
|
||||
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setHeader("Content-Disposition", "attachment; filename=credit_mediation_import_template.xlsx");
|
||||
|
||||
workbook.write(response.getOutputStream());
|
||||
workbook.close();
|
||||
}
|
||||
|
||||
private boolean isEmptyImportRow(CreditJudicialImportParam param) {
|
||||
if (param == null) {
|
||||
return true;
|
||||
}
|
||||
return ImportHelper.isBlank(param.getCaseNumber())
|
||||
&& ImportHelper.isBlank(param.getPlaintiffAppellant())
|
||||
&& ImportHelper.isBlank(param.getAppellee())
|
||||
&& ImportHelper.isBlank(param.getCauseOfAction());
|
||||
}
|
||||
|
||||
private CreditMediation convertImportParamToEntity(CreditJudicialImportParam param) {
|
||||
CreditMediation entity = new CreditMediation();
|
||||
|
||||
entity.setDataType(param.getDataType());
|
||||
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.setCourtName(param.getCourtName());
|
||||
entity.setDataStatus(param.getDataStatus());
|
||||
entity.setComments(param.getComments());
|
||||
|
||||
return entity;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,270 @@
|
||||
package com.gxwebsoft.credit.controller;
|
||||
|
||||
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.CreditRiskRelation;
|
||||
import com.gxwebsoft.credit.param.CreditRiskRelationImportParam;
|
||||
import com.gxwebsoft.credit.param.CreditRiskRelationParam;
|
||||
import com.gxwebsoft.credit.service.CreditRiskRelationService;
|
||||
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-19 19:51:41
|
||||
*/
|
||||
@Tag(name = "风险关系表管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/credit/credit-risk-relation")
|
||||
public class CreditRiskRelationController extends BaseController {
|
||||
@Resource
|
||||
private CreditRiskRelationService creditRiskRelationService;
|
||||
|
||||
@Operation(summary = "分页查询风险关系表")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<CreditRiskRelation>> page(CreditRiskRelationParam param) {
|
||||
// 使用关联查询
|
||||
return success(creditRiskRelationService.pageRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "查询全部风险关系表")
|
||||
@GetMapping()
|
||||
public ApiResult<List<CreditRiskRelation>> list(CreditRiskRelationParam param) {
|
||||
// 使用关联查询
|
||||
return success(creditRiskRelationService.listRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "根据id查询风险关系表")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<CreditRiskRelation> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(creditRiskRelationService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditRiskRelation:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "添加风险关系表")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody CreditRiskRelation creditRiskRelation) {
|
||||
// 记录当前登录用户id
|
||||
// User loginUser = getLoginUser();
|
||||
// if (loginUser != null) {
|
||||
// creditRiskRelation.setUserId(loginUser.getUserId());
|
||||
// }
|
||||
if (creditRiskRelationService.save(creditRiskRelation)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditRiskRelation:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "修改风险关系表")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody CreditRiskRelation creditRiskRelation) {
|
||||
if (creditRiskRelationService.updateById(creditRiskRelation)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditRiskRelation:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "删除风险关系表")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (creditRiskRelationService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditRiskRelation:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量添加风险关系表")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<CreditRiskRelation> list) {
|
||||
if (creditRiskRelationService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditRiskRelation:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量修改风险关系表")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<CreditRiskRelation> batchParam) {
|
||||
if (batchParam.update(creditRiskRelationService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditRiskRelation:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量删除风险关系表")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (creditRiskRelationService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量导入风险关系表
|
||||
*/
|
||||
@PreAuthorize("hasAuthority('credit:creditRiskRelation:save')")
|
||||
@Operation(summary = "批量导入风险关系表")
|
||||
@PostMapping("/import")
|
||||
public ApiResult<List<String>> importBatch(@RequestParam("file") MultipartFile file) {
|
||||
List<String> errorMessages = new ArrayList<>();
|
||||
int successCount = 0;
|
||||
|
||||
try {
|
||||
// 风险关系数据位于第二个选项卡,sheetIndex = 1
|
||||
ExcelImportSupport.ImportResult<CreditRiskRelationImportParam> importResult = ExcelImportSupport.read(
|
||||
file, CreditRiskRelationImportParam.class, this::isEmptyImportRow, 1);
|
||||
List<CreditRiskRelationImportParam> 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++) {
|
||||
CreditRiskRelationImportParam param = list.get(i);
|
||||
try {
|
||||
CreditRiskRelation 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.getMainBodyName())) {
|
||||
errorMessages.add("第" + excelRowNumber + "行:主体名称不能为空");
|
||||
continue;
|
||||
}
|
||||
|
||||
boolean saved = creditRiskRelationService.save(item);
|
||||
if (!saved) {
|
||||
CreditRiskRelation existing = creditRiskRelationService.lambdaQuery()
|
||||
.eq(CreditRiskRelation::getMainBodyName, item.getMainBodyName())
|
||||
.one();
|
||||
if (existing != null) {
|
||||
item.setId(existing.getId());
|
||||
if (creditRiskRelationService.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<CreditRiskRelationImportParam> templateList = new ArrayList<>();
|
||||
|
||||
CreditRiskRelationImportParam example = new CreditRiskRelationImportParam();
|
||||
example.setMainBodyName("示例企业");
|
||||
example.setRegistrationStatus("存续");
|
||||
example.setRegisteredCapital("8000");
|
||||
example.setProvinceRegion("浙江");
|
||||
example.setAssociatedRelation("关联企业");
|
||||
example.setRiskRelation("存在风险关联");
|
||||
example.setComments("备注信息");
|
||||
templateList.add(example);
|
||||
|
||||
Workbook workbook = ExcelImportSupport.buildTemplate("风险关系导入模板", "风险关系", CreditRiskRelationImportParam.class, templateList);
|
||||
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setHeader("Content-Disposition", "attachment; filename=credit_risk_relation_import_template.xlsx");
|
||||
|
||||
workbook.write(response.getOutputStream());
|
||||
workbook.close();
|
||||
}
|
||||
|
||||
private boolean isEmptyImportRow(CreditRiskRelationImportParam param) {
|
||||
if (param == null) {
|
||||
return true;
|
||||
}
|
||||
return ImportHelper.isBlank(param.getMainBodyName())
|
||||
&& ImportHelper.isBlank(param.getRegistrationStatus())
|
||||
&& ImportHelper.isBlank(param.getRegisteredCapital());
|
||||
}
|
||||
|
||||
private CreditRiskRelation convertImportParamToEntity(CreditRiskRelationImportParam param) {
|
||||
CreditRiskRelation entity = new CreditRiskRelation();
|
||||
|
||||
entity.setMainBodyName(param.getMainBodyName());
|
||||
entity.setRegistrationStatus(param.getRegistrationStatus());
|
||||
entity.setRegisteredCapital(param.getRegisteredCapital());
|
||||
entity.setProvinceRegion(param.getProvinceRegion());
|
||||
entity.setAssociatedRelation(param.getAssociatedRelation());
|
||||
entity.setRiskRelation(param.getRiskRelation());
|
||||
entity.setComments(param.getComments());
|
||||
|
||||
return entity;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,267 @@
|
||||
package com.gxwebsoft.credit.controller;
|
||||
|
||||
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.CreditSupplier;
|
||||
import com.gxwebsoft.credit.param.CreditSupplierImportParam;
|
||||
import com.gxwebsoft.credit.param.CreditSupplierParam;
|
||||
import com.gxwebsoft.credit.service.CreditSupplierService;
|
||||
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-19 19:51:47
|
||||
*/
|
||||
@Tag(name = "供应商管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/credit/credit-supplier")
|
||||
public class CreditSupplierController extends BaseController {
|
||||
@Resource
|
||||
private CreditSupplierService creditSupplierService;
|
||||
|
||||
@Operation(summary = "分页查询供应商")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<CreditSupplier>> page(CreditSupplierParam param) {
|
||||
// 使用关联查询
|
||||
return success(creditSupplierService.pageRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "查询全部供应商")
|
||||
@GetMapping()
|
||||
public ApiResult<List<CreditSupplier>> list(CreditSupplierParam param) {
|
||||
// 使用关联查询
|
||||
return success(creditSupplierService.listRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "根据id查询供应商")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<CreditSupplier> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(creditSupplierService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditSupplier:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "添加供应商")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody CreditSupplier creditSupplier) {
|
||||
// 记录当前登录用户id
|
||||
// User loginUser = getLoginUser();
|
||||
// if (loginUser != null) {
|
||||
// creditSupplier.setUserId(loginUser.getUserId());
|
||||
// }
|
||||
if (creditSupplierService.save(creditSupplier)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditSupplier:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "修改供应商")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody CreditSupplier creditSupplier) {
|
||||
if (creditSupplierService.updateById(creditSupplier)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditSupplier:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "删除供应商")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (creditSupplierService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditSupplier:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量添加供应商")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<CreditSupplier> list) {
|
||||
if (creditSupplierService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditSupplier:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量修改供应商")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<CreditSupplier> batchParam) {
|
||||
if (batchParam.update(creditSupplierService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditSupplier:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量删除供应商")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (creditSupplierService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量导入供应商
|
||||
*/
|
||||
@PreAuthorize("hasAuthority('credit:creditSupplier:save')")
|
||||
@Operation(summary = "批量导入供应商")
|
||||
@PostMapping("/import")
|
||||
public ApiResult<List<String>> importBatch(@RequestParam("file") MultipartFile file) {
|
||||
List<String> errorMessages = new ArrayList<>();
|
||||
int successCount = 0;
|
||||
|
||||
try {
|
||||
ExcelImportSupport.ImportResult<CreditSupplierImportParam> importResult = ExcelImportSupport.read(
|
||||
file, CreditSupplierImportParam.class, this::isEmptyImportRow,3);
|
||||
List<CreditSupplierImportParam> 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++) {
|
||||
CreditSupplierImportParam param = list.get(i);
|
||||
try {
|
||||
CreditSupplier 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.getSupplier())) {
|
||||
errorMessages.add("第" + excelRowNumber + "行:供应商不能为空");
|
||||
continue;
|
||||
}
|
||||
|
||||
boolean saved = creditSupplierService.save(item);
|
||||
if (!saved) {
|
||||
CreditSupplier existing = creditSupplierService.lambdaQuery()
|
||||
.eq(CreditSupplier::getSupplier, item.getSupplier())
|
||||
.one();
|
||||
if (existing != null) {
|
||||
item.setId(existing.getId());
|
||||
if (creditSupplierService.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<CreditSupplierImportParam> templateList = new ArrayList<>();
|
||||
|
||||
CreditSupplierImportParam example = new CreditSupplierImportParam();
|
||||
example.setSupplier("示例供应商");
|
||||
example.setStatusTxt("合作中");
|
||||
example.setPurchaseAmount("120");
|
||||
example.setPublicDate("2024-02-01");
|
||||
example.setDataSource("公开渠道");
|
||||
example.setComments("备注信息");
|
||||
templateList.add(example);
|
||||
|
||||
Workbook workbook = ExcelImportSupport.buildTemplate("供应商导入模板", "供应商", CreditSupplierImportParam.class, templateList);
|
||||
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setHeader("Content-Disposition", "attachment; filename=credit_supplier_import_template.xlsx");
|
||||
|
||||
workbook.write(response.getOutputStream());
|
||||
workbook.close();
|
||||
}
|
||||
|
||||
private boolean isEmptyImportRow(CreditSupplierImportParam param) {
|
||||
if (param == null) {
|
||||
return true;
|
||||
}
|
||||
return ImportHelper.isBlank(param.getSupplier())
|
||||
&& ImportHelper.isBlank(param.getStatusTxt())
|
||||
&& ImportHelper.isBlank(param.getPurchaseAmount());
|
||||
}
|
||||
|
||||
private CreditSupplier convertImportParamToEntity(CreditSupplierImportParam param) {
|
||||
CreditSupplier entity = new CreditSupplier();
|
||||
|
||||
entity.setSupplier(param.getSupplier());
|
||||
entity.setStatusTxt(param.getStatusTxt());
|
||||
entity.setPurchaseAmount(param.getPurchaseAmount());
|
||||
entity.setPublicDate(param.getPublicDate());
|
||||
entity.setDataSource(param.getDataSource());
|
||||
entity.setComments(param.getComments());
|
||||
|
||||
return entity;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -17,7 +17,11 @@ import com.gxwebsoft.credit.param.CreditUserParam;
|
||||
import com.gxwebsoft.credit.service.CreditUserService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.apache.poi.ss.usermodel.Cell;
|
||||
import org.apache.poi.ss.usermodel.Row;
|
||||
import org.apache.poi.ss.usermodel.Sheet;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.apache.poi.ss.usermodel.WorkbookFactory;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
@@ -27,18 +31,21 @@ import org.springframework.web.multipart.MultipartFile;
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 赊账客户表控制器
|
||||
* 招投标信息表控制器
|
||||
*
|
||||
* @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 +54,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 +77,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 +88,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 +99,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 +110,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 +121,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 +132,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 +142,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<>();
|
||||
@@ -166,12 +173,18 @@ public class CreditUserController extends BaseController {
|
||||
User loginUser = getLoginUser();
|
||||
Integer currentUserId = loginUser != null ? loginUser.getUserId() : null;
|
||||
Integer currentTenantId = loginUser != null ? loginUser.getTenantId() : null;
|
||||
Map<Integer, String> urlMap = readNameHyperlinks(file, 0, usedTitleRows, usedHeadRows);
|
||||
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
CreditUserImportParam param = list.get(i);
|
||||
try {
|
||||
CreditUser item = convertImportParamToEntity(param);
|
||||
|
||||
String link = urlMap.get(i);
|
||||
if (link != null && !link.isEmpty()) {
|
||||
item.setUrl(link);
|
||||
}
|
||||
|
||||
// 设置默认值
|
||||
if (item.getUserId() == null && currentUserId != null) {
|
||||
item.setUserId(currentUserId);
|
||||
@@ -217,7 +230,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 +240,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<>();
|
||||
@@ -237,6 +250,7 @@ public class CreditUserController extends BaseController {
|
||||
CreditUserImportParam example = new CreditUserImportParam();
|
||||
example.setCode("CUS001");
|
||||
example.setName("示例客户");
|
||||
example.setReleaseDate("2023-01-01");
|
||||
example.setType(0);
|
||||
example.setRole("采购方");
|
||||
example.setInfoType("企业");
|
||||
@@ -246,7 +260,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);
|
||||
|
||||
@@ -266,6 +280,46 @@ public class CreditUserController extends BaseController {
|
||||
return ExcelImportUtil.importExcel(file.getInputStream(), CreditUserImportParam.class, importParams);
|
||||
}
|
||||
|
||||
/**
|
||||
* 读取“项目名称”列的超链接,按数据行顺序返回。
|
||||
*/
|
||||
private Map<Integer, String> readNameHyperlinks(MultipartFile file, int sheetIndex, int titleRows, int headRows) throws Exception {
|
||||
Map<Integer, String> result = new HashMap<>();
|
||||
try (InputStream is = file.getInputStream(); Workbook workbook = WorkbookFactory.create(is)) {
|
||||
Sheet sheet = workbook.getSheetAt(sheetIndex);
|
||||
if (sheet == null) {
|
||||
return result;
|
||||
}
|
||||
int headerRowNum = titleRows + headRows - 1;
|
||||
Row headerRow = sheet.getRow(headerRowNum);
|
||||
int nameColIndex = 0;
|
||||
if (headerRow != null) {
|
||||
for (int c = headerRow.getFirstCellNum(); c < headerRow.getLastCellNum(); c++) {
|
||||
Cell cell = headerRow.getCell(c);
|
||||
if (cell != null && "项目名称".equals(cell.getStringCellValue())) {
|
||||
nameColIndex = c;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
int dataStartRow = titleRows + headRows;
|
||||
for (int r = dataStartRow; r <= sheet.getLastRowNum(); r++) {
|
||||
Row row = sheet.getRow(r);
|
||||
if (row == null) {
|
||||
continue;
|
||||
}
|
||||
Cell cell = row.getCell(nameColIndex);
|
||||
if (cell != null && cell.getHyperlink() != null) {
|
||||
String address = cell.getHyperlink().getAddress();
|
||||
if (address != null && !address.isEmpty()) {
|
||||
result.put(r - dataStartRow, address);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 过滤掉完全空白的导入行,避免空行导致导入失败
|
||||
*/
|
||||
@@ -303,6 +357,7 @@ public class CreditUserController extends BaseController {
|
||||
|
||||
entity.setCode(param.getCode());
|
||||
entity.setName(param.getName());
|
||||
entity.setReleaseDate(param.getReleaseDate());
|
||||
entity.setType(param.getType());
|
||||
entity.setRole(param.getRole());
|
||||
entity.setInfoType(param.getInfoType());
|
||||
|
||||
@@ -0,0 +1,278 @@
|
||||
package com.gxwebsoft.credit.controller;
|
||||
|
||||
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.CreditXgxf;
|
||||
import com.gxwebsoft.credit.param.CreditJudicialImportParam;
|
||||
import com.gxwebsoft.credit.param.CreditXgxfParam;
|
||||
import com.gxwebsoft.credit.service.CreditXgxfService;
|
||||
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-19 19:51:55
|
||||
*/
|
||||
@Tag(name = "限制高消费管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/credit/credit-xgxf")
|
||||
public class CreditXgxfController extends BaseController {
|
||||
@Resource
|
||||
private CreditXgxfService creditXgxfService;
|
||||
|
||||
@Operation(summary = "分页查询限制高消费")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<CreditXgxf>> page(CreditXgxfParam param) {
|
||||
// 使用关联查询
|
||||
return success(creditXgxfService.pageRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "查询全部限制高消费")
|
||||
@GetMapping()
|
||||
public ApiResult<List<CreditXgxf>> list(CreditXgxfParam param) {
|
||||
// 使用关联查询
|
||||
return success(creditXgxfService.listRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "根据id查询限制高消费")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<CreditXgxf> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(creditXgxfService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditXgxf:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "添加限制高消费")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody CreditXgxf creditXgxf) {
|
||||
// 记录当前登录用户id
|
||||
// User loginUser = getLoginUser();
|
||||
// if (loginUser != null) {
|
||||
// creditXgxf.setUserId(loginUser.getUserId());
|
||||
// }
|
||||
if (creditXgxfService.save(creditXgxf)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditXgxf:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "修改限制高消费")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody CreditXgxf creditXgxf) {
|
||||
if (creditXgxfService.updateById(creditXgxf)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditXgxf:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "删除限制高消费")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (creditXgxfService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditXgxf:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量添加限制高消费")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<CreditXgxf> list) {
|
||||
if (creditXgxfService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditXgxf:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量修改限制高消费")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<CreditXgxf> batchParam) {
|
||||
if (batchParam.update(creditXgxfService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('credit:creditXgxf:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量删除限制高消费")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (creditXgxfService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量导入限制高消费司法大数据
|
||||
*/
|
||||
@PreAuthorize("hasAuthority('credit:creditXgxf:save')")
|
||||
@Operation(summary = "批量导入限制高消费司法大数据")
|
||||
@PostMapping("/import")
|
||||
public ApiResult<List<String>> importBatch(@RequestParam("file") MultipartFile file) {
|
||||
List<String> errorMessages = new ArrayList<>();
|
||||
int successCount = 0;
|
||||
|
||||
try {
|
||||
ExcelImportSupport.ImportResult<CreditJudicialImportParam> importResult = ExcelImportSupport.read(
|
||||
file, CreditJudicialImportParam.class, this::isEmptyImportRow);
|
||||
List<CreditJudicialImportParam> 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++) {
|
||||
CreditJudicialImportParam param = list.get(i);
|
||||
try {
|
||||
CreditXgxf 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.getCaseNumber())) {
|
||||
errorMessages.add("第" + excelRowNumber + "行:案号不能为空");
|
||||
continue;
|
||||
}
|
||||
|
||||
boolean saved = creditXgxfService.save(item);
|
||||
if (!saved) {
|
||||
CreditXgxf existing = creditXgxfService.lambdaQuery()
|
||||
.eq(CreditXgxf::getCaseNumber, item.getCaseNumber())
|
||||
.one();
|
||||
if (existing != null) {
|
||||
item.setId(existing.getId());
|
||||
if (creditXgxfService.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<CreditJudicialImportParam> templateList = new ArrayList<>();
|
||||
|
||||
CreditJudicialImportParam example = new CreditJudicialImportParam();
|
||||
example.setDataType("限制高消费");
|
||||
example.setPlaintiffAppellant("原告示例");
|
||||
example.setAppellee("被告示例");
|
||||
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);
|
||||
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setHeader("Content-Disposition", "attachment; filename=credit_xgxf_import_template.xlsx");
|
||||
|
||||
workbook.write(response.getOutputStream());
|
||||
workbook.close();
|
||||
}
|
||||
|
||||
private boolean isEmptyImportRow(CreditJudicialImportParam param) {
|
||||
if (param == null) {
|
||||
return true;
|
||||
}
|
||||
return ImportHelper.isBlank(param.getCaseNumber())
|
||||
&& ImportHelper.isBlank(param.getPlaintiffAppellant())
|
||||
&& ImportHelper.isBlank(param.getAppellee())
|
||||
&& ImportHelper.isBlank(param.getCauseOfAction());
|
||||
}
|
||||
|
||||
private CreditXgxf convertImportParamToEntity(CreditJudicialImportParam param) {
|
||||
CreditXgxf entity = new CreditXgxf();
|
||||
|
||||
entity.setDataType(param.getDataType());
|
||||
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.setCourtName(param.getCourtName());
|
||||
entity.setDataStatus(param.getDataStatus());
|
||||
entity.setComments(param.getComments());
|
||||
|
||||
return entity;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
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 org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
/**
|
||||
* Excel 导入导出通用支持
|
||||
*/
|
||||
public class ExcelImportSupport {
|
||||
|
||||
public static class ImportResult<T> {
|
||||
private final List<T> data;
|
||||
private final int titleRows;
|
||||
private final int headRows;
|
||||
|
||||
public ImportResult(List<T> data, int titleRows, int headRows) {
|
||||
this.data = data;
|
||||
this.titleRows = titleRows;
|
||||
this.headRows = headRows;
|
||||
}
|
||||
|
||||
public List<T> getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public int getTitleRows() {
|
||||
return titleRows;
|
||||
}
|
||||
|
||||
public int getHeadRows() {
|
||||
return headRows;
|
||||
}
|
||||
}
|
||||
|
||||
public static <T> ImportResult<T> read(MultipartFile file, Class<T> clazz, Predicate<T> emptyRowPredicate) throws Exception {
|
||||
return read(file, clazz, emptyRowPredicate, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* 读取指定 sheet 的 Excel。
|
||||
*
|
||||
* @param sheetIndex 目标 sheet 下标,从 0 开始。第二个选项卡传 1。
|
||||
*/
|
||||
public static <T> ImportResult<T> read(MultipartFile file, Class<T> clazz, Predicate<T> emptyRowPredicate, int sheetIndex) throws Exception {
|
||||
List<T> 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], sheetIndex), emptyRowPredicate);
|
||||
if (!CollectionUtils.isEmpty(list)) {
|
||||
usedTitleRows = config[0];
|
||||
usedHeadRows = config[1];
|
||||
break;
|
||||
}
|
||||
}
|
||||
return new ImportResult<>(list, usedTitleRows, usedHeadRows);
|
||||
}
|
||||
|
||||
private static <T> List<T> importSheet(MultipartFile file, Class<T> clazz, int titleRows, int headRows, int sheetIndex) throws Exception {
|
||||
ImportParams importParams = new ImportParams();
|
||||
importParams.setTitleRows(titleRows);
|
||||
importParams.setHeadRows(headRows);
|
||||
importParams.setStartSheetIndex(sheetIndex);
|
||||
importParams.setSheetNum(1);
|
||||
return ExcelImportUtil.importExcel(file.getInputStream(), clazz, importParams);
|
||||
}
|
||||
|
||||
private static <T> List<T> filterEmptyRows(List<T> rawList, Predicate<T> emptyRowPredicate) {
|
||||
if (CollectionUtils.isEmpty(rawList)) {
|
||||
return rawList;
|
||||
}
|
||||
rawList.removeIf(emptyRowPredicate);
|
||||
return rawList;
|
||||
}
|
||||
|
||||
public static <T> Workbook buildTemplate(String title, String sheetName, Class<T> clazz, List<T> examples) {
|
||||
ExportParams exportParams = new ExportParams(title, sheetName);
|
||||
return ExcelExportUtil.exportExcel(exportParams, clazz, examples);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.gxwebsoft.credit.controller;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* 导入解析辅助工具
|
||||
*/
|
||||
public final class ImportHelper {
|
||||
|
||||
private ImportHelper() {
|
||||
}
|
||||
|
||||
public static boolean isBlank(String value) {
|
||||
return value == null || value.trim().isEmpty();
|
||||
}
|
||||
|
||||
public static BigDecimal parseBigDecimal(String value, String fieldLabel) {
|
||||
if (isBlank(value)) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
return new BigDecimal(value.trim());
|
||||
} catch (Exception e) {
|
||||
throw new IllegalArgumentException(fieldLabel + "格式不正确");
|
||||
}
|
||||
}
|
||||
|
||||
public static LocalDate parseLocalDate(String value, String fieldLabel) {
|
||||
if (isBlank(value)) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
return LocalDate.parse(value.trim());
|
||||
} catch (Exception e) {
|
||||
throw new IllegalArgumentException(fieldLabel + "日期格式应为yyyy-MM-dd");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
package com.gxwebsoft.credit.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
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.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 失信被执行人
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-12-19 19:46:14
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "CreditBreachOfTrust对象", description = "失信被执行人")
|
||||
public class CreditBreachOfTrust implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "ID")
|
||||
@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 involvedAmount;
|
||||
|
||||
@Schema(description = "法院")
|
||||
private String courtName;
|
||||
|
||||
@Schema(description = "数据状态")
|
||||
private String dataStatus;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "是否推荐")
|
||||
private Integer recommend;
|
||||
|
||||
@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;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
package com.gxwebsoft.credit.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
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.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 司法大数据
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-12-19 19:47:22
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "CreditCaseFiling对象", description = "司法大数据")
|
||||
public class CreditCaseFiling implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "ID")
|
||||
@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 involvedAmount;
|
||||
|
||||
@Schema(description = "法院")
|
||||
private String courtName;
|
||||
|
||||
@Schema(description = "数据状态")
|
||||
private String dataStatus;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "是否推荐")
|
||||
private Integer recommend;
|
||||
|
||||
@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;
|
||||
|
||||
}
|
||||
210
src/main/java/com/gxwebsoft/credit/entity/CreditCompany.java
Normal file
210
src/main/java/com/gxwebsoft/credit/entity/CreditCompany.java
Normal file
@@ -0,0 +1,210 @@
|
||||
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-17 08:28:03
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "CreditCompany对象", description = "企业")
|
||||
public class CreditCompany 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 matchName;
|
||||
|
||||
@Schema(description = "统一社会信用代码")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "类型")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "上级id, 0是顶级")
|
||||
private Integer parentId;
|
||||
|
||||
@Schema(description = "登记状态")
|
||||
private String registrationStatus;
|
||||
|
||||
@Schema(description = "法定代表人")
|
||||
private String legalPerson;
|
||||
|
||||
@Schema(description = "注册资本")
|
||||
private String registeredCapital;
|
||||
|
||||
@Schema(description = "实缴资本")
|
||||
private String paidinCapital;
|
||||
|
||||
@Schema(description = "成立日期")
|
||||
private String establishDate;
|
||||
|
||||
@Schema(description = "企业地址")
|
||||
private String address;
|
||||
|
||||
@Schema(description = "电话")
|
||||
private String tel;
|
||||
|
||||
@Schema(description = "更多电话")
|
||||
private String moreTel;
|
||||
|
||||
@Schema(description = "邮箱")
|
||||
private String email;
|
||||
|
||||
@Schema(description = "更多邮箱")
|
||||
private String moreEmail;
|
||||
|
||||
@Schema(description = "所在国家")
|
||||
private String country;
|
||||
|
||||
@Schema(description = "所属省份")
|
||||
private String province;
|
||||
|
||||
@Schema(description = "所属城市")
|
||||
private String city;
|
||||
|
||||
@Schema(description = "所属区县")
|
||||
private String region;
|
||||
|
||||
@Schema(description = "企业(机构)类型")
|
||||
private String institutionType;
|
||||
|
||||
@Schema(description = "纳税人识别号")
|
||||
private String taxpayerCode;
|
||||
|
||||
@Schema(description = "注册号")
|
||||
private String registrationNumber;
|
||||
|
||||
@Schema(description = "组织机构代码")
|
||||
private String organizationalCode;
|
||||
|
||||
@Schema(description = "参保人数")
|
||||
private String numberOfInsuredPersons;
|
||||
|
||||
@Schema(description = "参保人数所属年报")
|
||||
private String annualReport;
|
||||
|
||||
@Schema(description = "营业期限")
|
||||
private String businessTerm;
|
||||
|
||||
@Schema(description = "国标行业门类")
|
||||
private String nationalStandardIndustryCategories;
|
||||
|
||||
@Schema(description = "国标行业大类")
|
||||
private String nationalStandardIndustryCategories2;
|
||||
|
||||
@Schema(description = "国标行业中类")
|
||||
private String nationalStandardIndustryCategories3;
|
||||
|
||||
@Schema(description = "国标行业小类")
|
||||
private String nationalStandardIndustryCategories4;
|
||||
|
||||
@Schema(description = "企查查行业门类")
|
||||
private String nationalStandardIndustryCategories5;
|
||||
|
||||
@Schema(description = "企查查行业大类")
|
||||
private String nationalStandardIndustryCategories6;
|
||||
|
||||
@Schema(description = "企查查行业中类")
|
||||
private String nationalStandardIndustryCategories7;
|
||||
|
||||
@Schema(description = "企查查行业小类")
|
||||
private String nationalStandardIndustryCategories8;
|
||||
|
||||
@Schema(description = "企业规模")
|
||||
private String companySize;
|
||||
|
||||
@Schema(description = "曾用名")
|
||||
private String formerName;
|
||||
|
||||
@Schema(description = "英文名")
|
||||
private String englishName;
|
||||
|
||||
@Schema(description = "官网")
|
||||
private String domain;
|
||||
|
||||
@Schema(description = "通信地址")
|
||||
private String mailingAddress;
|
||||
|
||||
@Schema(description = "企业简介")
|
||||
private String companyProfile;
|
||||
|
||||
@Schema(description = "经营范围")
|
||||
private String natureOfBusiness;
|
||||
|
||||
@Schema(description = "登记机关")
|
||||
private String registrationAuthority;
|
||||
|
||||
@Schema(description = "纳税人资质")
|
||||
private String taxpayerQualification;
|
||||
|
||||
@Schema(description = "最新年报年份")
|
||||
private String latestAnnualReportYear;
|
||||
|
||||
@Schema(description = "最新年报营业收入")
|
||||
private String latestAnnualReportOnOperatingRevenue;
|
||||
|
||||
@Schema(description = "企查分")
|
||||
private String enterpriseScoreCheck;
|
||||
|
||||
@Schema(description = "信用等级")
|
||||
private String creditRating;
|
||||
|
||||
@Schema(description = "科创分")
|
||||
private String cechnologyScore;
|
||||
|
||||
@Schema(description = "科创等级")
|
||||
private String cechnologyLevel;
|
||||
|
||||
@Schema(description = "是否小微企业")
|
||||
private String smallEnterprise;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "是否推荐")
|
||||
private Integer recommend;
|
||||
|
||||
@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;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
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.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 竞争对手
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-12-19 19:49:04
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "CreditCompetitor对象", description = "竞争对手")
|
||||
public class CreditCompetitor implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "序号")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "企业名称")
|
||||
private String companyName;
|
||||
|
||||
@Schema(description = "法定代表人")
|
||||
private String legalRepresentative;
|
||||
|
||||
@Schema(description = "注册资本")
|
||||
private String registeredCapital;
|
||||
|
||||
@Schema(description = "成立日期")
|
||||
private String establishmentDate;
|
||||
|
||||
@Schema(description = "登记状态")
|
||||
private String registrationStatus;
|
||||
|
||||
@Schema(description = "所属行业")
|
||||
private String industry;
|
||||
|
||||
@Schema(description = "所属省份")
|
||||
private String province;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "是否推荐")
|
||||
private Integer recommend;
|
||||
|
||||
@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;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
package com.gxwebsoft.credit.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
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.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 法院公告司法大数据
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-12-19 19:49:13
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "CreditCourtAnnouncement对象", description = "法院公告司法大数据")
|
||||
public class CreditCourtAnnouncement implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "ID")
|
||||
@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 involvedAmount;
|
||||
|
||||
@Schema(description = "法院")
|
||||
private String courtName;
|
||||
|
||||
@Schema(description = "数据状态")
|
||||
private String dataStatus;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "是否推荐")
|
||||
private Integer recommend;
|
||||
|
||||
@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;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
package com.gxwebsoft.credit.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
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.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 开庭公告司法大数据
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-12-19 19:49:32
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "CreditCourtSession对象", description = "开庭公告司法大数据")
|
||||
public class CreditCourtSession implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "ID")
|
||||
@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 involvedAmount;
|
||||
|
||||
@Schema(description = "法院")
|
||||
private String courtName;
|
||||
|
||||
@Schema(description = "数据状态")
|
||||
private String dataStatus;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "是否推荐")
|
||||
private Integer recommend;
|
||||
|
||||
@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;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
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.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 客户
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-12-21 21:20:58
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "CreditCustomer对象", description = "客户")
|
||||
public class CreditCustomer 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 statusTxt;
|
||||
|
||||
@Schema(description = "销售金额(万元)")
|
||||
private String price;
|
||||
|
||||
@Schema(description = "公开日期")
|
||||
private String publicDate;
|
||||
|
||||
@Schema(description = "数据来源")
|
||||
private String dataSource;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "是否推荐")
|
||||
private Integer recommend;
|
||||
|
||||
@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;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
package com.gxwebsoft.credit.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
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.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 送达公告司法大数据
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-12-19 19:49:51
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "CreditDeliveryNotice对象", description = "送达公告司法大数据")
|
||||
public class CreditDeliveryNotice implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "ID")
|
||||
@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 involvedAmount;
|
||||
|
||||
@Schema(description = "法院")
|
||||
private String courtName;
|
||||
|
||||
@Schema(description = "数据状态")
|
||||
private String dataStatus;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "是否推荐")
|
||||
private Integer recommend;
|
||||
|
||||
@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;
|
||||
|
||||
}
|
||||
104
src/main/java/com/gxwebsoft/credit/entity/CreditExternal.java
Normal file
104
src/main/java/com/gxwebsoft/credit/entity/CreditExternal.java
Normal file
@@ -0,0 +1,104 @@
|
||||
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.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 对外投资
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-12-19 19:50:11
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "CreditExternal对象", description = "对外投资")
|
||||
public class CreditExternal 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 statusTxt;
|
||||
|
||||
@Schema(description = "法定代表人姓名")
|
||||
private String legalRepresentative;
|
||||
|
||||
@Schema(description = "注册资本(金额)")
|
||||
private String registeredCapital;
|
||||
|
||||
@Schema(description = "成立日期")
|
||||
private String establishmentDate;
|
||||
|
||||
@Schema(description = "持股比例")
|
||||
private String shareholdingRatio;
|
||||
|
||||
@Schema(description = "认缴出资额")
|
||||
private String subscribedInvestmentAmount;
|
||||
|
||||
@Schema(description = "认缴出资日期")
|
||||
private String subscribedInvestmentDate;
|
||||
|
||||
@Schema(description = "间接持股比例")
|
||||
private String indirectShareholdingRatio;
|
||||
|
||||
@Schema(description = "投资日期")
|
||||
private String investmentDate;
|
||||
|
||||
@Schema(description = "所属地区")
|
||||
private String region;
|
||||
|
||||
@Schema(description = "所属行业")
|
||||
private String industry;
|
||||
|
||||
@Schema(description = "投资数量")
|
||||
private Integer investmentCount;
|
||||
|
||||
@Schema(description = "关联产品/机构")
|
||||
private String relatedProductsInstitutions;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "是否推荐")
|
||||
private Integer recommend;
|
||||
|
||||
@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;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
package com.gxwebsoft.credit.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
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.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 终本案件
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-12-19 19:50:19
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "CreditFinalVersion对象", description = "终本案件")
|
||||
public class CreditFinalVersion implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "ID")
|
||||
@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 involvedAmount;
|
||||
|
||||
@Schema(description = "法院")
|
||||
private String courtName;
|
||||
|
||||
@Schema(description = "数据状态")
|
||||
private String dataStatus;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "是否推荐")
|
||||
private Integer recommend;
|
||||
|
||||
@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;
|
||||
|
||||
}
|
||||
94
src/main/java/com/gxwebsoft/credit/entity/CreditGqdj.java
Normal file
94
src/main/java/com/gxwebsoft/credit/entity/CreditGqdj.java
Normal file
@@ -0,0 +1,94 @@
|
||||
package com.gxwebsoft.credit.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
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.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 股权冻结
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-12-19 19:50:37
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "CreditGqdj对象", description = "股权冻结")
|
||||
public class CreditGqdj implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "ID")
|
||||
@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 involvedAmount;
|
||||
|
||||
@Schema(description = "法院")
|
||||
private String courtName;
|
||||
|
||||
@Schema(description = "数据状态")
|
||||
private String dataStatus;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "是否推荐")
|
||||
private Integer recommend;
|
||||
|
||||
@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;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
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.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 被执行人
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-12-19 19:50:55
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "CreditJudgmentDebtor对象", description = "被执行人")
|
||||
public class CreditJudgmentDebtor implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "ID")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "案号")
|
||||
private String caseNumber;
|
||||
|
||||
@Schema(description = "被执行人名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "证件号/组织机构代码")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "发生时间")
|
||||
private String occurrenceTime;
|
||||
|
||||
@Schema(description = "执行标的(元)")
|
||||
private BigDecimal amount;
|
||||
|
||||
@Schema(description = "法院")
|
||||
private String courtName;
|
||||
|
||||
@Schema(description = "数据状态")
|
||||
private String dataStatus;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "是否推荐")
|
||||
private Integer recommend;
|
||||
|
||||
@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;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
package com.gxwebsoft.credit.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
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.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 裁判文书司法大数据
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-12-19 19:51:02
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "CreditJudicialDocument对象", description = "裁判文书司法大数据")
|
||||
public class CreditJudicialDocument implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "ID")
|
||||
@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 involvedAmount;
|
||||
|
||||
@Schema(description = "法院")
|
||||
private String courtName;
|
||||
|
||||
@Schema(description = "数据状态")
|
||||
private String dataStatus;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "是否推荐")
|
||||
private Integer recommend;
|
||||
|
||||
@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;
|
||||
|
||||
}
|
||||
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;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
package com.gxwebsoft.credit.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
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.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 诉前调解司法大数据
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-12-19 19:51:25
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "CreditMediation对象", description = "诉前调解司法大数据")
|
||||
public class CreditMediation implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "ID")
|
||||
@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 involvedAmount;
|
||||
|
||||
@Schema(description = "法院")
|
||||
private String courtName;
|
||||
|
||||
@Schema(description = "数据状态")
|
||||
private String dataStatus;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "是否推荐")
|
||||
private Integer recommend;
|
||||
|
||||
@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;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
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.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 风险关系表
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-12-19 19:51:40
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "CreditRiskRelation对象", description = "风险关系表")
|
||||
public class CreditRiskRelation implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "序号")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "主体名称")
|
||||
private String mainBodyName;
|
||||
|
||||
@Schema(description = "登记状态")
|
||||
private String registrationStatus;
|
||||
|
||||
@Schema(description = "注册资本")
|
||||
private String registeredCapital;
|
||||
|
||||
@Schema(description = "省份地区")
|
||||
private String provinceRegion;
|
||||
|
||||
@Schema(description = "关联关系")
|
||||
private String associatedRelation;
|
||||
|
||||
@Schema(description = "风险关系")
|
||||
private String riskRelation;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "是否推荐")
|
||||
private Integer recommend;
|
||||
|
||||
@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;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
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.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 供应商
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-12-19 19:51:47
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "CreditSupplier对象", description = "供应商")
|
||||
public class CreditSupplier implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "ID")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "供应商")
|
||||
private String supplier;
|
||||
|
||||
@Schema(description = "状态")
|
||||
private String statusTxt;
|
||||
|
||||
@Schema(description = "采购金额(万元)")
|
||||
private String purchaseAmount;
|
||||
|
||||
@Schema(description = "公开日期")
|
||||
private String publicDate;
|
||||
|
||||
@Schema(description = "数据来源")
|
||||
private String dataSource;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "是否推荐")
|
||||
private Integer recommend;
|
||||
|
||||
@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;
|
||||
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.gxwebsoft.credit.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
@@ -11,14 +12,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;
|
||||
|
||||
@@ -29,6 +30,9 @@ public class CreditUser implements Serializable {
|
||||
@Schema(description = "项目名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "项目网址")
|
||||
private String url;
|
||||
|
||||
@Schema(description = "唯一标识")
|
||||
private String code;
|
||||
|
||||
|
||||
94
src/main/java/com/gxwebsoft/credit/entity/CreditXgxf.java
Normal file
94
src/main/java/com/gxwebsoft/credit/entity/CreditXgxf.java
Normal file
@@ -0,0 +1,94 @@
|
||||
package com.gxwebsoft.credit.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
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.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 限制高消费
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-12-19 19:51:55
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "CreditXgxf对象", description = "限制高消费")
|
||||
public class CreditXgxf implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "ID")
|
||||
@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 involvedAmount;
|
||||
|
||||
@Schema(description = "法院")
|
||||
private String courtName;
|
||||
|
||||
@Schema(description = "数据状态")
|
||||
private String dataStatus;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "是否推荐")
|
||||
private Integer recommend;
|
||||
|
||||
@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;
|
||||
|
||||
}
|
||||
@@ -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.CreditBreachOfTrust;
|
||||
import com.gxwebsoft.credit.param.CreditBreachOfTrustParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 失信被执行人Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-12-19 19:46:14
|
||||
*/
|
||||
public interface CreditBreachOfTrustMapper extends BaseMapper<CreditBreachOfTrust> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<CreditBreachOfTrust>
|
||||
*/
|
||||
List<CreditBreachOfTrust> selectPageRel(@Param("page") IPage<CreditBreachOfTrust> page,
|
||||
@Param("param") CreditBreachOfTrustParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<CreditBreachOfTrust> selectListRel(@Param("param") CreditBreachOfTrustParam param);
|
||||
|
||||
}
|
||||
@@ -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.CreditCaseFiling;
|
||||
import com.gxwebsoft.credit.param.CreditCaseFilingParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 司法大数据Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-12-19 19:47:22
|
||||
*/
|
||||
public interface CreditCaseFilingMapper extends BaseMapper<CreditCaseFiling> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<CreditCaseFiling>
|
||||
*/
|
||||
List<CreditCaseFiling> selectPageRel(@Param("page") IPage<CreditCaseFiling> page,
|
||||
@Param("param") CreditCaseFilingParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<CreditCaseFiling> selectListRel(@Param("param") CreditCaseFilingParam param);
|
||||
|
||||
}
|
||||
@@ -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.CreditCompany;
|
||||
import com.gxwebsoft.credit.param.CreditCompanyParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 企业Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-12-17 08:28:03
|
||||
*/
|
||||
public interface CreditCompanyMapper extends BaseMapper<CreditCompany> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<CreditCompany>
|
||||
*/
|
||||
List<CreditCompany> selectPageRel(@Param("page") IPage<CreditCompany> page,
|
||||
@Param("param") CreditCompanyParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<CreditCompany> selectListRel(@Param("param") CreditCompanyParam param);
|
||||
|
||||
}
|
||||
@@ -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.CreditCompetitor;
|
||||
import com.gxwebsoft.credit.param.CreditCompetitorParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 竞争对手Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-12-19 19:49:04
|
||||
*/
|
||||
public interface CreditCompetitorMapper extends BaseMapper<CreditCompetitor> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<CreditCompetitor>
|
||||
*/
|
||||
List<CreditCompetitor> selectPageRel(@Param("page") IPage<CreditCompetitor> page,
|
||||
@Param("param") CreditCompetitorParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<CreditCompetitor> selectListRel(@Param("param") CreditCompetitorParam param);
|
||||
|
||||
}
|
||||
@@ -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.CreditCourtAnnouncement;
|
||||
import com.gxwebsoft.credit.param.CreditCourtAnnouncementParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 法院公告司法大数据Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-12-19 19:49:13
|
||||
*/
|
||||
public interface CreditCourtAnnouncementMapper extends BaseMapper<CreditCourtAnnouncement> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<CreditCourtAnnouncement>
|
||||
*/
|
||||
List<CreditCourtAnnouncement> selectPageRel(@Param("page") IPage<CreditCourtAnnouncement> page,
|
||||
@Param("param") CreditCourtAnnouncementParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<CreditCourtAnnouncement> selectListRel(@Param("param") CreditCourtAnnouncementParam param);
|
||||
|
||||
}
|
||||
@@ -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.CreditCourtSession;
|
||||
import com.gxwebsoft.credit.param.CreditCourtSessionParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 开庭公告司法大数据Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-12-19 19:49:32
|
||||
*/
|
||||
public interface CreditCourtSessionMapper extends BaseMapper<CreditCourtSession> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<CreditCourtSession>
|
||||
*/
|
||||
List<CreditCourtSession> selectPageRel(@Param("page") IPage<CreditCourtSession> page,
|
||||
@Param("param") CreditCourtSessionParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<CreditCourtSession> selectListRel(@Param("param") CreditCourtSessionParam param);
|
||||
|
||||
}
|
||||
@@ -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.CreditCustomer;
|
||||
import com.gxwebsoft.credit.param.CreditCustomerParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 客户Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-12-21 21:20:58
|
||||
*/
|
||||
public interface CreditCustomerMapper extends BaseMapper<CreditCustomer> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<CreditCustomer>
|
||||
*/
|
||||
List<CreditCustomer> selectPageRel(@Param("page") IPage<CreditCustomer> page,
|
||||
@Param("param") CreditCustomerParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<CreditCustomer> selectListRel(@Param("param") CreditCustomerParam param);
|
||||
|
||||
}
|
||||
@@ -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.CreditDeliveryNotice;
|
||||
import com.gxwebsoft.credit.param.CreditDeliveryNoticeParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 送达公告司法大数据Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-12-19 19:49:51
|
||||
*/
|
||||
public interface CreditDeliveryNoticeMapper extends BaseMapper<CreditDeliveryNotice> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<CreditDeliveryNotice>
|
||||
*/
|
||||
List<CreditDeliveryNotice> selectPageRel(@Param("page") IPage<CreditDeliveryNotice> page,
|
||||
@Param("param") CreditDeliveryNoticeParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<CreditDeliveryNotice> selectListRel(@Param("param") CreditDeliveryNoticeParam param);
|
||||
|
||||
}
|
||||
@@ -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.CreditExternal;
|
||||
import com.gxwebsoft.credit.param.CreditExternalParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 对外投资Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-12-19 19:50:11
|
||||
*/
|
||||
public interface CreditExternalMapper extends BaseMapper<CreditExternal> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<CreditExternal>
|
||||
*/
|
||||
List<CreditExternal> selectPageRel(@Param("page") IPage<CreditExternal> page,
|
||||
@Param("param") CreditExternalParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<CreditExternal> selectListRel(@Param("param") CreditExternalParam param);
|
||||
|
||||
}
|
||||
@@ -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.CreditFinalVersion;
|
||||
import com.gxwebsoft.credit.param.CreditFinalVersionParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 终本案件Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-12-19 19:50:19
|
||||
*/
|
||||
public interface CreditFinalVersionMapper extends BaseMapper<CreditFinalVersion> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<CreditFinalVersion>
|
||||
*/
|
||||
List<CreditFinalVersion> selectPageRel(@Param("page") IPage<CreditFinalVersion> page,
|
||||
@Param("param") CreditFinalVersionParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<CreditFinalVersion> selectListRel(@Param("param") CreditFinalVersionParam param);
|
||||
|
||||
}
|
||||
@@ -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.CreditGqdj;
|
||||
import com.gxwebsoft.credit.param.CreditGqdjParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 股权冻结Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-12-19 19:50:37
|
||||
*/
|
||||
public interface CreditGqdjMapper extends BaseMapper<CreditGqdj> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<CreditGqdj>
|
||||
*/
|
||||
List<CreditGqdj> selectPageRel(@Param("page") IPage<CreditGqdj> page,
|
||||
@Param("param") CreditGqdjParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<CreditGqdj> selectListRel(@Param("param") CreditGqdjParam param);
|
||||
|
||||
}
|
||||
@@ -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.CreditJudgmentDebtor;
|
||||
import com.gxwebsoft.credit.param.CreditJudgmentDebtorParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 被执行人Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-12-19 19:50:55
|
||||
*/
|
||||
public interface CreditJudgmentDebtorMapper extends BaseMapper<CreditJudgmentDebtor> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<CreditJudgmentDebtor>
|
||||
*/
|
||||
List<CreditJudgmentDebtor> selectPageRel(@Param("page") IPage<CreditJudgmentDebtor> page,
|
||||
@Param("param") CreditJudgmentDebtorParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<CreditJudgmentDebtor> selectListRel(@Param("param") CreditJudgmentDebtorParam param);
|
||||
|
||||
}
|
||||
@@ -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.CreditJudicialDocument;
|
||||
import com.gxwebsoft.credit.param.CreditJudicialDocumentParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 裁判文书司法大数据Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-12-19 19:51:02
|
||||
*/
|
||||
public interface CreditJudicialDocumentMapper extends BaseMapper<CreditJudicialDocument> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<CreditJudicialDocument>
|
||||
*/
|
||||
List<CreditJudicialDocument> selectPageRel(@Param("page") IPage<CreditJudicialDocument> page,
|
||||
@Param("param") CreditJudicialDocumentParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<CreditJudicialDocument> selectListRel(@Param("param") CreditJudicialDocumentParam param);
|
||||
|
||||
}
|
||||
@@ -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);
|
||||
|
||||
}
|
||||
@@ -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.CreditMediation;
|
||||
import com.gxwebsoft.credit.param.CreditMediationParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 诉前调解司法大数据Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-12-19 19:51:25
|
||||
*/
|
||||
public interface CreditMediationMapper extends BaseMapper<CreditMediation> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<CreditMediation>
|
||||
*/
|
||||
List<CreditMediation> selectPageRel(@Param("page") IPage<CreditMediation> page,
|
||||
@Param("param") CreditMediationParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<CreditMediation> selectListRel(@Param("param") CreditMediationParam param);
|
||||
|
||||
}
|
||||
@@ -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.CreditRiskRelation;
|
||||
import com.gxwebsoft.credit.param.CreditRiskRelationParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 风险关系表Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-12-19 19:51:40
|
||||
*/
|
||||
public interface CreditRiskRelationMapper extends BaseMapper<CreditRiskRelation> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<CreditRiskRelation>
|
||||
*/
|
||||
List<CreditRiskRelation> selectPageRel(@Param("page") IPage<CreditRiskRelation> page,
|
||||
@Param("param") CreditRiskRelationParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<CreditRiskRelation> selectListRel(@Param("param") CreditRiskRelationParam param);
|
||||
|
||||
}
|
||||
@@ -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.CreditSupplier;
|
||||
import com.gxwebsoft.credit.param.CreditSupplierParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 供应商Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-12-19 19:51:47
|
||||
*/
|
||||
public interface CreditSupplierMapper extends BaseMapper<CreditSupplier> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<CreditSupplier>
|
||||
*/
|
||||
List<CreditSupplier> selectPageRel(@Param("page") IPage<CreditSupplier> page,
|
||||
@Param("param") CreditSupplierParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<CreditSupplier> selectListRel(@Param("param") CreditSupplierParam 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,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.CreditXgxf;
|
||||
import com.gxwebsoft.credit.param.CreditXgxfParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 限制高消费Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-12-19 19:51:55
|
||||
*/
|
||||
public interface CreditXgxfMapper extends BaseMapper<CreditXgxf> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<CreditXgxf>
|
||||
*/
|
||||
List<CreditXgxf> selectPageRel(@Param("page") IPage<CreditXgxf> page,
|
||||
@Param("param") CreditXgxfParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<CreditXgxf> selectListRel(@Param("param") CreditXgxfParam param);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
<?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.CreditBreachOfTrustMapper">
|
||||
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*
|
||||
FROM credit_breach_of_trust a
|
||||
<where>
|
||||
<if test="param.id != null">
|
||||
AND a.id = #{param.id}
|
||||
</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>
|
||||
<if test="param.otherPartiesThirdParty != null">
|
||||
AND a.other_parties_third_party LIKE CONCAT('%', #{param.otherPartiesThirdParty}, '%')
|
||||
</if>
|
||||
<if test="param.occurrenceTime != null">
|
||||
AND a.occurrence_time LIKE CONCAT('%', #{param.occurrenceTime}, '%')
|
||||
</if>
|
||||
<if test="param.caseNumber != null">
|
||||
AND a.case_number LIKE CONCAT('%', #{param.caseNumber}, '%')
|
||||
</if>
|
||||
<if test="param.causeOfAction != null">
|
||||
AND a.cause_of_action LIKE CONCAT('%', #{param.causeOfAction}, '%')
|
||||
</if>
|
||||
<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>
|
||||
<if test="param.recommend != null">
|
||||
AND a.recommend = #{param.recommend}
|
||||
</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.CreditBreachOfTrust">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="selectListRel" resultType="com.gxwebsoft.credit.entity.CreditBreachOfTrust">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,87 @@
|
||||
<?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.CreditCaseFilingMapper">
|
||||
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*
|
||||
FROM credit_case_filing a
|
||||
<where>
|
||||
<if test="param.id != null">
|
||||
AND a.id = #{param.id}
|
||||
</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>
|
||||
<if test="param.otherPartiesThirdParty != null">
|
||||
AND a.other_parties_third_party LIKE CONCAT('%', #{param.otherPartiesThirdParty}, '%')
|
||||
</if>
|
||||
<if test="param.occurrenceTime != null">
|
||||
AND a.occurrence_time LIKE CONCAT('%', #{param.occurrenceTime}, '%')
|
||||
</if>
|
||||
<if test="param.caseNumber != null">
|
||||
AND a.case_number LIKE CONCAT('%', #{param.caseNumber}, '%')
|
||||
</if>
|
||||
<if test="param.causeOfAction != null">
|
||||
AND a.cause_of_action LIKE CONCAT('%', #{param.causeOfAction}, '%')
|
||||
</if>
|
||||
<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>
|
||||
<if test="param.recommend != null">
|
||||
AND a.recommend = #{param.recommend}
|
||||
</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.CreditCaseFiling">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="selectListRel" resultType="com.gxwebsoft.credit.entity.CreditCaseFiling">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,207 @@
|
||||
<?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.CreditCompanyMapper">
|
||||
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*
|
||||
FROM credit_company 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.matchName != null">
|
||||
AND a.match_name LIKE CONCAT('%', #{param.matchName}, '%')
|
||||
</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.parentId != null">
|
||||
AND a.parent_id = #{param.parentId}
|
||||
</if>
|
||||
<if test="param.registrationStatus != null">
|
||||
AND a.registration_status LIKE CONCAT('%', #{param.registrationStatus}, '%')
|
||||
</if>
|
||||
<if test="param.legalPerson != null">
|
||||
AND a.legal_person LIKE CONCAT('%', #{param.legalPerson}, '%')
|
||||
</if>
|
||||
<if test="param.registeredCapital != null">
|
||||
AND a.registered_capital LIKE CONCAT('%', #{param.registeredCapital}, '%')
|
||||
</if>
|
||||
<if test="param.paidinCapital != null">
|
||||
AND a.paidin_capital LIKE CONCAT('%', #{param.paidinCapital}, '%')
|
||||
</if>
|
||||
<if test="param.establishDate != null">
|
||||
AND a.establish_date LIKE CONCAT('%', #{param.establishDate}, '%')
|
||||
</if>
|
||||
<if test="param.address != null">
|
||||
AND a.address LIKE CONCAT('%', #{param.address}, '%')
|
||||
</if>
|
||||
<if test="param.tel != null">
|
||||
AND a.tel LIKE CONCAT('%', #{param.tel}, '%')
|
||||
</if>
|
||||
<if test="param.moreTel != null">
|
||||
AND a.more_tel LIKE CONCAT('%', #{param.moreTel}, '%')
|
||||
</if>
|
||||
<if test="param.email != null">
|
||||
AND a.email LIKE CONCAT('%', #{param.email}, '%')
|
||||
</if>
|
||||
<if test="param.moreEmail != null">
|
||||
AND a.more_email LIKE CONCAT('%', #{param.moreEmail}, '%')
|
||||
</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.institutionType != null">
|
||||
AND a.institution_type LIKE CONCAT('%', #{param.institutionType}, '%')
|
||||
</if>
|
||||
<if test="param.taxpayerCode != null">
|
||||
AND a.taxpayer_code LIKE CONCAT('%', #{param.taxpayerCode}, '%')
|
||||
</if>
|
||||
<if test="param.registrationNumber != null">
|
||||
AND a.registration_number LIKE CONCAT('%', #{param.registrationNumber}, '%')
|
||||
</if>
|
||||
<if test="param.organizationalCode != null">
|
||||
AND a.organizational_code LIKE CONCAT('%', #{param.organizationalCode}, '%')
|
||||
</if>
|
||||
<if test="param.numberOfInsuredPersons != null">
|
||||
AND a.number_of_insured_persons LIKE CONCAT('%', #{param.numberOfInsuredPersons}, '%')
|
||||
</if>
|
||||
<if test="param.annualReport != null">
|
||||
AND a.annual_report LIKE CONCAT('%', #{param.annualReport}, '%')
|
||||
</if>
|
||||
<if test="param.businessTerm != null">
|
||||
AND a.business_term LIKE CONCAT('%', #{param.businessTerm}, '%')
|
||||
</if>
|
||||
<if test="param.nationalStandardIndustryCategories != null">
|
||||
AND a.national_standard_industry_categories LIKE CONCAT('%', #{param.nationalStandardIndustryCategories}, '%')
|
||||
</if>
|
||||
<if test="param.nationalStandardIndustryCategories2 != null">
|
||||
AND a.national_standard_industry_categories2 LIKE CONCAT('%', #{param.nationalStandardIndustryCategories2}, '%')
|
||||
</if>
|
||||
<if test="param.nationalStandardIndustryCategories3 != null">
|
||||
AND a.national_standard_industry_categories3 LIKE CONCAT('%', #{param.nationalStandardIndustryCategories3}, '%')
|
||||
</if>
|
||||
<if test="param.nationalStandardIndustryCategories4 != null">
|
||||
AND a.national_standard_industry_categories4 LIKE CONCAT('%', #{param.nationalStandardIndustryCategories4}, '%')
|
||||
</if>
|
||||
<if test="param.nationalStandardIndustryCategories5 != null">
|
||||
AND a.national_standard_industry_categories5 LIKE CONCAT('%', #{param.nationalStandardIndustryCategories5}, '%')
|
||||
</if>
|
||||
<if test="param.nationalStandardIndustryCategories6 != null">
|
||||
AND a.national_standard_industry_categories6 LIKE CONCAT('%', #{param.nationalStandardIndustryCategories6}, '%')
|
||||
</if>
|
||||
<if test="param.nationalStandardIndustryCategories7 != null">
|
||||
AND a.national_standard_industry_categories7 LIKE CONCAT('%', #{param.nationalStandardIndustryCategories7}, '%')
|
||||
</if>
|
||||
<if test="param.nationalStandardIndustryCategories8 != null">
|
||||
AND a.national_standard_industry_categories8 LIKE CONCAT('%', #{param.nationalStandardIndustryCategories8}, '%')
|
||||
</if>
|
||||
<if test="param.companySize != null">
|
||||
AND a.company_size LIKE CONCAT('%', #{param.companySize}, '%')
|
||||
</if>
|
||||
<if test="param.formerName != null">
|
||||
AND a.former_name LIKE CONCAT('%', #{param.formerName}, '%')
|
||||
</if>
|
||||
<if test="param.englishName != null">
|
||||
AND a.english_name LIKE CONCAT('%', #{param.englishName}, '%')
|
||||
</if>
|
||||
<if test="param.domain != null">
|
||||
AND a.domain LIKE CONCAT('%', #{param.domain}, '%')
|
||||
</if>
|
||||
<if test="param.mailingAddress != null">
|
||||
AND a.mailing_address LIKE CONCAT('%', #{param.mailingAddress}, '%')
|
||||
</if>
|
||||
<if test="param.companyProfile != null">
|
||||
AND a.company_profile LIKE CONCAT('%', #{param.companyProfile}, '%')
|
||||
</if>
|
||||
<if test="param.natureOfBusiness != null">
|
||||
AND a.nature_of_business LIKE CONCAT('%', #{param.natureOfBusiness}, '%')
|
||||
</if>
|
||||
<if test="param.registrationAuthority != null">
|
||||
AND a.registration_authority LIKE CONCAT('%', #{param.registrationAuthority}, '%')
|
||||
</if>
|
||||
<if test="param.taxpayerQualification != null">
|
||||
AND a.taxpayer_qualification LIKE CONCAT('%', #{param.taxpayerQualification}, '%')
|
||||
</if>
|
||||
<if test="param.latestAnnualReportYear != null">
|
||||
AND a.latest_annual_report_year LIKE CONCAT('%', #{param.latestAnnualReportYear}, '%')
|
||||
</if>
|
||||
<if test="param.latestAnnualReportOnOperatingRevenue != null">
|
||||
AND a.latest_annual_report_on_operating_revenue LIKE CONCAT('%', #{param.latestAnnualReportOnOperatingRevenue}, '%')
|
||||
</if>
|
||||
<if test="param.enterpriseScoreCheck != null">
|
||||
AND a.enterprise_score_check LIKE CONCAT('%', #{param.enterpriseScoreCheck}, '%')
|
||||
</if>
|
||||
<if test="param.creditRating != null">
|
||||
AND a.credit_rating LIKE CONCAT('%', #{param.creditRating}, '%')
|
||||
</if>
|
||||
<if test="param.cechnologyScore != null">
|
||||
AND a.cechnology_score LIKE CONCAT('%', #{param.cechnologyScore}, '%')
|
||||
</if>
|
||||
<if test="param.cechnologyLevel != null">
|
||||
AND a.cechnology_level LIKE CONCAT('%', #{param.cechnologyLevel}, '%')
|
||||
</if>
|
||||
<if test="param.smallEnterprise != null">
|
||||
AND a.small_enterprise LIKE CONCAT('%', #{param.smallEnterprise}, '%')
|
||||
</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.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.CreditCompany">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="selectListRel" resultType="com.gxwebsoft.credit.entity.CreditCompany">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,78 @@
|
||||
<?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.CreditCompetitorMapper">
|
||||
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*
|
||||
FROM credit_competitor a
|
||||
<where>
|
||||
<if test="param.id != null">
|
||||
AND a.id = #{param.id}
|
||||
</if>
|
||||
<if test="param.companyName != null">
|
||||
AND a.company_name LIKE CONCAT('%', #{param.companyName}, '%')
|
||||
</if>
|
||||
<if test="param.legalRepresentative != null">
|
||||
AND a.legal_representative LIKE CONCAT('%', #{param.legalRepresentative}, '%')
|
||||
</if>
|
||||
<if test="param.registeredCapital != null">
|
||||
AND a.registered_capital = #{param.registeredCapital}
|
||||
</if>
|
||||
<if test="param.establishmentDate != null">
|
||||
AND a.establishment_date LIKE CONCAT('%', #{param.establishmentDate}, '%')
|
||||
</if>
|
||||
<if test="param.registrationStatus != null">
|
||||
AND a.registration_status LIKE CONCAT('%', #{param.registrationStatus}, '%')
|
||||
</if>
|
||||
<if test="param.industry != null">
|
||||
AND a.industry LIKE CONCAT('%', #{param.industry}, '%')
|
||||
</if>
|
||||
<if test="param.province != null">
|
||||
AND a.province LIKE CONCAT('%', #{param.province}, '%')
|
||||
</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.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.CreditCompetitor">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="selectListRel" resultType="com.gxwebsoft.credit.entity.CreditCompetitor">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,87 @@
|
||||
<?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.CreditCourtAnnouncementMapper">
|
||||
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*
|
||||
FROM credit_court_announcement a
|
||||
<where>
|
||||
<if test="param.id != null">
|
||||
AND a.id = #{param.id}
|
||||
</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>
|
||||
<if test="param.otherPartiesThirdParty != null">
|
||||
AND a.other_parties_third_party LIKE CONCAT('%', #{param.otherPartiesThirdParty}, '%')
|
||||
</if>
|
||||
<if test="param.occurrenceTime != null">
|
||||
AND a.occurrence_time LIKE CONCAT('%', #{param.occurrenceTime}, '%')
|
||||
</if>
|
||||
<if test="param.caseNumber != null">
|
||||
AND a.case_number LIKE CONCAT('%', #{param.caseNumber}, '%')
|
||||
</if>
|
||||
<if test="param.causeOfAction != null">
|
||||
AND a.cause_of_action LIKE CONCAT('%', #{param.causeOfAction}, '%')
|
||||
</if>
|
||||
<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>
|
||||
<if test="param.recommend != null">
|
||||
AND a.recommend = #{param.recommend}
|
||||
</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.CreditCourtAnnouncement">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="selectListRel" resultType="com.gxwebsoft.credit.entity.CreditCourtAnnouncement">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,87 @@
|
||||
<?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.CreditCourtSessionMapper">
|
||||
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*
|
||||
FROM credit_court_session a
|
||||
<where>
|
||||
<if test="param.id != null">
|
||||
AND a.id = #{param.id}
|
||||
</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>
|
||||
<if test="param.otherPartiesThirdParty != null">
|
||||
AND a.other_parties_third_party LIKE CONCAT('%', #{param.otherPartiesThirdParty}, '%')
|
||||
</if>
|
||||
<if test="param.occurrenceTime != null">
|
||||
AND a.occurrence_time LIKE CONCAT('%', #{param.occurrenceTime}, '%')
|
||||
</if>
|
||||
<if test="param.caseNumber != null">
|
||||
AND a.case_number LIKE CONCAT('%', #{param.caseNumber}, '%')
|
||||
</if>
|
||||
<if test="param.causeOfAction != null">
|
||||
AND a.cause_of_action LIKE CONCAT('%', #{param.causeOfAction}, '%')
|
||||
</if>
|
||||
<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>
|
||||
<if test="param.recommend != null">
|
||||
AND a.recommend = #{param.recommend}
|
||||
</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.CreditCourtSession">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="selectListRel" resultType="com.gxwebsoft.credit.entity.CreditCourtSession">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,72 @@
|
||||
<?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.CreditCustomerMapper">
|
||||
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*
|
||||
FROM credit_customer 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.statusTxt != null">
|
||||
AND a.status_txt LIKE CONCAT('%', #{param.statusTxt}, '%')
|
||||
</if>
|
||||
<if test="param.price != null">
|
||||
AND a.price = #{param.price}
|
||||
</if>
|
||||
<if test="param.publicDate != null">
|
||||
AND a.public_date LIKE CONCAT('%', #{param.publicDate}, '%')
|
||||
</if>
|
||||
<if test="param.dataSource != null">
|
||||
AND a.data_source LIKE CONCAT('%', #{param.dataSource}, '%')
|
||||
</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.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.CreditCustomer">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="selectListRel" resultType="com.gxwebsoft.credit.entity.CreditCustomer">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,87 @@
|
||||
<?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.CreditDeliveryNoticeMapper">
|
||||
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*
|
||||
FROM credit_delivery_notice a
|
||||
<where>
|
||||
<if test="param.id != null">
|
||||
AND a.id = #{param.id}
|
||||
</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>
|
||||
<if test="param.otherPartiesThirdParty != null">
|
||||
AND a.other_parties_third_party LIKE CONCAT('%', #{param.otherPartiesThirdParty}, '%')
|
||||
</if>
|
||||
<if test="param.occurrenceTime != null">
|
||||
AND a.occurrence_time LIKE CONCAT('%', #{param.occurrenceTime}, '%')
|
||||
</if>
|
||||
<if test="param.caseNumber != null">
|
||||
AND a.case_number LIKE CONCAT('%', #{param.caseNumber}, '%')
|
||||
</if>
|
||||
<if test="param.causeOfAction != null">
|
||||
AND a.cause_of_action LIKE CONCAT('%', #{param.causeOfAction}, '%')
|
||||
</if>
|
||||
<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>
|
||||
<if test="param.recommend != null">
|
||||
AND a.recommend = #{param.recommend}
|
||||
</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.CreditDeliveryNotice">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="selectListRel" resultType="com.gxwebsoft.credit.entity.CreditDeliveryNotice">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,99 @@
|
||||
<?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.CreditExternalMapper">
|
||||
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*
|
||||
FROM credit_external 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.statusTxt != null">
|
||||
AND a.status_txt LIKE CONCAT('%', #{param.statusTxt}, '%')
|
||||
</if>
|
||||
<if test="param.legalRepresentative != null">
|
||||
AND a.legal_representative LIKE CONCAT('%', #{param.legalRepresentative}, '%')
|
||||
</if>
|
||||
<if test="param.registeredCapital != null">
|
||||
AND a.registered_capital = #{param.registeredCapital}
|
||||
</if>
|
||||
<if test="param.establishmentDate != null">
|
||||
AND a.establishment_date LIKE CONCAT('%', #{param.establishmentDate}, '%')
|
||||
</if>
|
||||
<if test="param.shareholdingRatio != null">
|
||||
AND a.shareholding_ratio = #{param.shareholdingRatio}
|
||||
</if>
|
||||
<if test="param.subscribedInvestmentAmount != null">
|
||||
AND a.subscribed_investment_amount = #{param.subscribedInvestmentAmount}
|
||||
</if>
|
||||
<if test="param.subscribedInvestmentDate != null">
|
||||
AND a.subscribed_investment_date LIKE CONCAT('%', #{param.subscribedInvestmentDate}, '%')
|
||||
</if>
|
||||
<if test="param.indirectShareholdingRatio != null">
|
||||
AND a.indirect_shareholding_ratio = #{param.indirectShareholdingRatio}
|
||||
</if>
|
||||
<if test="param.investmentDate != null">
|
||||
AND a.investment_date LIKE CONCAT('%', #{param.investmentDate}, '%')
|
||||
</if>
|
||||
<if test="param.region != null">
|
||||
AND a.region LIKE CONCAT('%', #{param.region}, '%')
|
||||
</if>
|
||||
<if test="param.industry != null">
|
||||
AND a.industry LIKE CONCAT('%', #{param.industry}, '%')
|
||||
</if>
|
||||
<if test="param.investmentCount != null">
|
||||
AND a.investment_count = #{param.investmentCount}
|
||||
</if>
|
||||
<if test="param.relatedProductsInstitutions != null">
|
||||
AND a.related_products_institutions LIKE CONCAT('%', #{param.relatedProductsInstitutions}, '%')
|
||||
</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.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.CreditExternal">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="selectListRel" resultType="com.gxwebsoft.credit.entity.CreditExternal">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,87 @@
|
||||
<?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.CreditFinalVersionMapper">
|
||||
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*
|
||||
FROM credit_final_version a
|
||||
<where>
|
||||
<if test="param.id != null">
|
||||
AND a.id = #{param.id}
|
||||
</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>
|
||||
<if test="param.otherPartiesThirdParty != null">
|
||||
AND a.other_parties_third_party LIKE CONCAT('%', #{param.otherPartiesThirdParty}, '%')
|
||||
</if>
|
||||
<if test="param.occurrenceTime != null">
|
||||
AND a.occurrence_time LIKE CONCAT('%', #{param.occurrenceTime}, '%')
|
||||
</if>
|
||||
<if test="param.caseNumber != null">
|
||||
AND a.case_number LIKE CONCAT('%', #{param.caseNumber}, '%')
|
||||
</if>
|
||||
<if test="param.causeOfAction != null">
|
||||
AND a.cause_of_action LIKE CONCAT('%', #{param.causeOfAction}, '%')
|
||||
</if>
|
||||
<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>
|
||||
<if test="param.recommend != null">
|
||||
AND a.recommend = #{param.recommend}
|
||||
</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.CreditFinalVersion">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="selectListRel" resultType="com.gxwebsoft.credit.entity.CreditFinalVersion">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,87 @@
|
||||
<?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.CreditGqdjMapper">
|
||||
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*
|
||||
FROM credit_gqdj a
|
||||
<where>
|
||||
<if test="param.id != null">
|
||||
AND a.id = #{param.id}
|
||||
</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>
|
||||
<if test="param.otherPartiesThirdParty != null">
|
||||
AND a.other_parties_third_party LIKE CONCAT('%', #{param.otherPartiesThirdParty}, '%')
|
||||
</if>
|
||||
<if test="param.occurrenceTime != null">
|
||||
AND a.occurrence_time LIKE CONCAT('%', #{param.occurrenceTime}, '%')
|
||||
</if>
|
||||
<if test="param.caseNumber != null">
|
||||
AND a.case_number LIKE CONCAT('%', #{param.caseNumber}, '%')
|
||||
</if>
|
||||
<if test="param.causeOfAction != null">
|
||||
AND a.cause_of_action LIKE CONCAT('%', #{param.causeOfAction}, '%')
|
||||
</if>
|
||||
<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>
|
||||
<if test="param.recommend != null">
|
||||
AND a.recommend = #{param.recommend}
|
||||
</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.CreditGqdj">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="selectListRel" resultType="com.gxwebsoft.credit.entity.CreditGqdj">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,78 @@
|
||||
<?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.CreditJudgmentDebtorMapper">
|
||||
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*
|
||||
FROM credit_judgment_debtor a
|
||||
<where>
|
||||
<if test="param.id != null">
|
||||
AND a.id = #{param.id}
|
||||
</if>
|
||||
<if test="param.caseNumber != null">
|
||||
AND a.case_number LIKE CONCAT('%', #{param.caseNumber}, '%')
|
||||
</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.occurrenceTime != null">
|
||||
AND a.occurrence_time LIKE CONCAT('%', #{param.occurrenceTime}, '%')
|
||||
</if>
|
||||
<if test="param.amount != null">
|
||||
AND a.amount = #{param.amount}
|
||||
</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>
|
||||
<if test="param.recommend != null">
|
||||
AND a.recommend = #{param.recommend}
|
||||
</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.CreditJudgmentDebtor">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="selectListRel" resultType="com.gxwebsoft.credit.entity.CreditJudgmentDebtor">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,87 @@
|
||||
<?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.CreditJudicialDocumentMapper">
|
||||
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*
|
||||
FROM credit_judicial_document a
|
||||
<where>
|
||||
<if test="param.id != null">
|
||||
AND a.id = #{param.id}
|
||||
</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>
|
||||
<if test="param.otherPartiesThirdParty != null">
|
||||
AND a.other_parties_third_party LIKE CONCAT('%', #{param.otherPartiesThirdParty}, '%')
|
||||
</if>
|
||||
<if test="param.occurrenceTime != null">
|
||||
AND a.occurrence_time LIKE CONCAT('%', #{param.occurrenceTime}, '%')
|
||||
</if>
|
||||
<if test="param.caseNumber != null">
|
||||
AND a.case_number LIKE CONCAT('%', #{param.caseNumber}, '%')
|
||||
</if>
|
||||
<if test="param.causeOfAction != null">
|
||||
AND a.cause_of_action LIKE CONCAT('%', #{param.causeOfAction}, '%')
|
||||
</if>
|
||||
<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>
|
||||
<if test="param.recommend != null">
|
||||
AND a.recommend = #{param.recommend}
|
||||
</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.CreditJudicialDocument">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="selectListRel" resultType="com.gxwebsoft.credit.entity.CreditJudicialDocument">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -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.name 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,87 @@
|
||||
<?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.CreditMediationMapper">
|
||||
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*
|
||||
FROM credit_mediation a
|
||||
<where>
|
||||
<if test="param.id != null">
|
||||
AND a.id = #{param.id}
|
||||
</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>
|
||||
<if test="param.otherPartiesThirdParty != null">
|
||||
AND a.other_parties_third_party LIKE CONCAT('%', #{param.otherPartiesThirdParty}, '%')
|
||||
</if>
|
||||
<if test="param.occurrenceTime != null">
|
||||
AND a.occurrence_time LIKE CONCAT('%', #{param.occurrenceTime}, '%')
|
||||
</if>
|
||||
<if test="param.caseNumber != null">
|
||||
AND a.case_number LIKE CONCAT('%', #{param.caseNumber}, '%')
|
||||
</if>
|
||||
<if test="param.causeOfAction != null">
|
||||
AND a.cause_of_action LIKE CONCAT('%', #{param.causeOfAction}, '%')
|
||||
</if>
|
||||
<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>
|
||||
<if test="param.recommend != null">
|
||||
AND a.recommend = #{param.recommend}
|
||||
</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.CreditMediation">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="selectListRel" resultType="com.gxwebsoft.credit.entity.CreditMediation">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,75 @@
|
||||
<?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.CreditRiskRelationMapper">
|
||||
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*
|
||||
FROM credit_risk_relation a
|
||||
<where>
|
||||
<if test="param.id != null">
|
||||
AND a.id = #{param.id}
|
||||
</if>
|
||||
<if test="param.mainBodyName != null">
|
||||
AND a.main_body_name LIKE CONCAT('%', #{param.mainBodyName}, '%')
|
||||
</if>
|
||||
<if test="param.registrationStatus != null">
|
||||
AND a.registration_status LIKE CONCAT('%', #{param.registrationStatus}, '%')
|
||||
</if>
|
||||
<if test="param.registeredCapital != null">
|
||||
AND a.registered_capital = #{param.registeredCapital}
|
||||
</if>
|
||||
<if test="param.provinceRegion != null">
|
||||
AND a.province_region LIKE CONCAT('%', #{param.provinceRegion}, '%')
|
||||
</if>
|
||||
<if test="param.associatedRelation != null">
|
||||
AND a.associated_relation LIKE CONCAT('%', #{param.associatedRelation}, '%')
|
||||
</if>
|
||||
<if test="param.riskRelation != null">
|
||||
AND a.risk_relation LIKE CONCAT('%', #{param.riskRelation}, '%')
|
||||
</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.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.CreditRiskRelation">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="selectListRel" resultType="com.gxwebsoft.credit.entity.CreditRiskRelation">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,72 @@
|
||||
<?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.CreditSupplierMapper">
|
||||
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*
|
||||
FROM credit_supplier a
|
||||
<where>
|
||||
<if test="param.id != null">
|
||||
AND a.id = #{param.id}
|
||||
</if>
|
||||
<if test="param.supplier != null">
|
||||
AND a.supplier LIKE CONCAT('%', #{param.supplier}, '%')
|
||||
</if>
|
||||
<if test="param.statusTxt != null">
|
||||
AND a.status_txt LIKE CONCAT('%', #{param.statusTxt}, '%')
|
||||
</if>
|
||||
<if test="param.purchaseAmount != null">
|
||||
AND a.purchase_amount = #{param.purchaseAmount}
|
||||
</if>
|
||||
<if test="param.publicDate != null">
|
||||
AND a.public_date LIKE CONCAT('%', #{param.publicDate}, '%')
|
||||
</if>
|
||||
<if test="param.dataSource != null">
|
||||
AND a.data_source LIKE CONCAT('%', #{param.dataSource}, '%')
|
||||
</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.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.CreditSupplier">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="selectListRel" resultType="com.gxwebsoft.credit.entity.CreditSupplier">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -83,7 +83,9 @@
|
||||
AND a.create_time <= #{param.createTimeEnd}
|
||||
</if>
|
||||
<if test="param.keywords != null">
|
||||
AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')
|
||||
AND (a.name LIKE CONCAT('%', #{param.keywords}, '%')
|
||||
OR a.procurement_name LIKE CONCAT('%', #{param.keywords}, '%')
|
||||
OR a.winning_name LIKE CONCAT('%', #{param.keywords}, '%')
|
||||
)
|
||||
</if>
|
||||
</where>
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
<?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.CreditXgxfMapper">
|
||||
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*
|
||||
FROM credit_xgxf a
|
||||
<where>
|
||||
<if test="param.id != null">
|
||||
AND a.id = #{param.id}
|
||||
</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>
|
||||
<if test="param.otherPartiesThirdParty != null">
|
||||
AND a.other_parties_third_party LIKE CONCAT('%', #{param.otherPartiesThirdParty}, '%')
|
||||
</if>
|
||||
<if test="param.occurrenceTime != null">
|
||||
AND a.occurrence_time LIKE CONCAT('%', #{param.occurrenceTime}, '%')
|
||||
</if>
|
||||
<if test="param.caseNumber != null">
|
||||
AND a.case_number LIKE CONCAT('%', #{param.caseNumber}, '%')
|
||||
</if>
|
||||
<if test="param.causeOfAction != null">
|
||||
AND a.cause_of_action LIKE CONCAT('%', #{param.causeOfAction}, '%')
|
||||
</if>
|
||||
<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>
|
||||
<if test="param.recommend != null">
|
||||
AND a.recommend = #{param.recommend}
|
||||
</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.CreditXgxf">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="selectListRel" resultType="com.gxwebsoft.credit.entity.CreditXgxf">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,84 @@
|
||||
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;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 失信被执行人查询参数
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-12-19 19:46:13
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@Schema(name = "CreditBreachOfTrustParam对象", description = "失信被执行人查询参数")
|
||||
public class CreditBreachOfTrustParam extends BaseParam {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "ID")
|
||||
@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 = "涉案金额")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private String involvedAmount;
|
||||
|
||||
@Schema(description = "法院")
|
||||
private String courtName;
|
||||
|
||||
@Schema(description = "数据状态")
|
||||
private String dataStatus;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "是否推荐")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer recommend;
|
||||
|
||||
@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;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
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;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 司法大数据查询参数
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-12-19 19:47:22
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@Schema(name = "CreditCaseFilingParam对象", description = "司法大数据查询参数")
|
||||
public class CreditCaseFilingParam extends BaseParam {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "ID")
|
||||
@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 involvedAmount;
|
||||
|
||||
@Schema(description = "法院")
|
||||
private String courtName;
|
||||
|
||||
@Schema(description = "数据状态")
|
||||
private String dataStatus;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "是否推荐")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer recommend;
|
||||
|
||||
@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;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,163 @@
|
||||
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;
|
||||
|
||||
/**
|
||||
* 企业导入参数
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-12-15
|
||||
*/
|
||||
@Data
|
||||
public class CreditCompanyImportParam implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Excel(name = "原文件导入名称")
|
||||
private String name;
|
||||
|
||||
@Excel(name = "系统匹配企业名称")
|
||||
private String matchName;
|
||||
|
||||
@Excel(name = "统一社会信用代码")
|
||||
private String code;
|
||||
|
||||
@Excel(name = "登记状态")
|
||||
private String registrationStatus;
|
||||
|
||||
@Excel(name = "法定代表人")
|
||||
private String legalPerson;
|
||||
|
||||
@Excel(name = "注册资本")
|
||||
private String registeredCapital;
|
||||
|
||||
@Excel(name = "实缴资本")
|
||||
private String paidinCapital;
|
||||
|
||||
@Excel(name = "成立日期")
|
||||
private String establishDate;
|
||||
|
||||
@Excel(name = "企业地址")
|
||||
private String address;
|
||||
|
||||
@Excel(name = "电话")
|
||||
private String tel;
|
||||
|
||||
@Excel(name = "更多电话")
|
||||
private String moreTel;
|
||||
|
||||
@Excel(name = "邮箱")
|
||||
private String email;
|
||||
|
||||
@Excel(name = "更多邮箱")
|
||||
private String moreEmail;
|
||||
|
||||
@Excel(name = "所在国家")
|
||||
private String country;
|
||||
|
||||
@Excel(name = "所属省份")
|
||||
private String province;
|
||||
|
||||
@Excel(name = "所属城市")
|
||||
private String city;
|
||||
|
||||
@Excel(name = "所属区县")
|
||||
private String region;
|
||||
|
||||
@Excel(name = "企业(机构)类型")
|
||||
private String institutionType;
|
||||
|
||||
@Excel(name = "纳税人识别号")
|
||||
private String taxpayerCode;
|
||||
|
||||
@Excel(name = "注册号")
|
||||
private String registrationNumber;
|
||||
|
||||
@Excel(name = "组织机构代码")
|
||||
private String organizationalCode;
|
||||
|
||||
@Excel(name = "参保人数")
|
||||
private String numberOfInsuredPersons;
|
||||
|
||||
@Excel(name = "参保人数所属年报")
|
||||
private String annualReport;
|
||||
|
||||
@Excel(name = "营业期限")
|
||||
private String businessTerm;
|
||||
|
||||
@Excel(name = "国标行业门类")
|
||||
private String nationalStandardIndustryCategories;
|
||||
|
||||
@Excel(name = "国标行业大类")
|
||||
private String nationalStandardIndustryCategories2;
|
||||
|
||||
@Excel(name = "国标行业中类")
|
||||
private String nationalStandardIndustryCategories3;
|
||||
|
||||
@Excel(name = "国标行业小类")
|
||||
private String nationalStandardIndustryCategories4;
|
||||
|
||||
@Excel(name = "企查查行业门类")
|
||||
private String nationalStandardIndustryCategories5;
|
||||
|
||||
@Excel(name = "企查查行业大类")
|
||||
private String nationalStandardIndustryCategories6;
|
||||
|
||||
@Excel(name = "企查查行业中类")
|
||||
private String nationalStandardIndustryCategories7;
|
||||
|
||||
@Excel(name = "企查查行业小类")
|
||||
private String nationalStandardIndustryCategories8;
|
||||
|
||||
@Excel(name = "企业规模")
|
||||
private String companySize;
|
||||
|
||||
@Excel(name = "曾用名")
|
||||
private String formerName;
|
||||
|
||||
@Excel(name = "英文名")
|
||||
private String englishName;
|
||||
|
||||
@Excel(name = "官网")
|
||||
private String domain;
|
||||
|
||||
@Excel(name = "通信地址")
|
||||
private String mailingAddress;
|
||||
|
||||
@Excel(name = "企业简介")
|
||||
private String companyProfile;
|
||||
|
||||
@Excel(name = "经营范围")
|
||||
private String natureOfBusiness;
|
||||
|
||||
@Excel(name = "登记机关")
|
||||
private String registrationAuthority;
|
||||
|
||||
@Excel(name = "纳税人资质")
|
||||
private String taxpayerQualification;
|
||||
|
||||
@Excel(name = "最新年报年份")
|
||||
private String latestAnnualReportYear;
|
||||
|
||||
@Excel(name = "最新年报营业收入")
|
||||
private String latestAnnualReportOnOperatingRevenue;
|
||||
|
||||
@Excel(name = "企查分")
|
||||
private String enterpriseScoreCheck;
|
||||
|
||||
@Excel(name = "信用等级")
|
||||
private String creditRating;
|
||||
|
||||
@Excel(name = "科创分")
|
||||
private String cechnologyScore;
|
||||
|
||||
@Excel(name = "科创等级")
|
||||
private String cechnologyLevel;
|
||||
|
||||
@Excel(name = "是否小微企业")
|
||||
private String smallEnterprise;
|
||||
|
||||
}
|
||||
203
src/main/java/com/gxwebsoft/credit/param/CreditCompanyParam.java
Normal file
203
src/main/java/com/gxwebsoft/credit/param/CreditCompanyParam.java
Normal file
@@ -0,0 +1,203 @@
|
||||
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-17 08:28:02
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@Schema(name = "CreditCompanyParam对象", description = "企业查询参数")
|
||||
public class CreditCompanyParam 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 matchName;
|
||||
|
||||
@Schema(description = "统一社会信用代码")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "类型")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "上级id, 0是顶级")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer parentId;
|
||||
|
||||
@Schema(description = "登记状态")
|
||||
private String registrationStatus;
|
||||
|
||||
@Schema(description = "法定代表人")
|
||||
private String legalPerson;
|
||||
|
||||
@Schema(description = "注册资本")
|
||||
private String registeredCapital;
|
||||
|
||||
@Schema(description = "实缴资本")
|
||||
private String paidinCapital;
|
||||
|
||||
@Schema(description = "成立日期")
|
||||
private String establishDate;
|
||||
|
||||
@Schema(description = "企业地址")
|
||||
private String address;
|
||||
|
||||
@Schema(description = "电话")
|
||||
private String tel;
|
||||
|
||||
@Schema(description = "更多电话")
|
||||
private String moreTel;
|
||||
|
||||
@Schema(description = "邮箱")
|
||||
private String email;
|
||||
|
||||
@Schema(description = "更多邮箱")
|
||||
private String moreEmail;
|
||||
|
||||
@Schema(description = "所在国家")
|
||||
private String country;
|
||||
|
||||
@Schema(description = "所属省份")
|
||||
private String province;
|
||||
|
||||
@Schema(description = "所属城市")
|
||||
private String city;
|
||||
|
||||
@Schema(description = "所属区县")
|
||||
private String region;
|
||||
|
||||
@Schema(description = "企业(机构)类型")
|
||||
private String institutionType;
|
||||
|
||||
@Schema(description = "纳税人识别号")
|
||||
private String taxpayerCode;
|
||||
|
||||
@Schema(description = "注册号")
|
||||
private String registrationNumber;
|
||||
|
||||
@Schema(description = "组织机构代码")
|
||||
private String organizationalCode;
|
||||
|
||||
@Schema(description = "参保人数")
|
||||
private String numberOfInsuredPersons;
|
||||
|
||||
@Schema(description = "参保人数所属年报")
|
||||
private String annualReport;
|
||||
|
||||
@Schema(description = "营业期限")
|
||||
private String businessTerm;
|
||||
|
||||
@Schema(description = "国标行业门类")
|
||||
private String nationalStandardIndustryCategories;
|
||||
|
||||
@Schema(description = "国标行业大类")
|
||||
private String nationalStandardIndustryCategories2;
|
||||
|
||||
@Schema(description = "国标行业中类")
|
||||
private String nationalStandardIndustryCategories3;
|
||||
|
||||
@Schema(description = "国标行业小类")
|
||||
private String nationalStandardIndustryCategories4;
|
||||
|
||||
@Schema(description = "企查查行业门类")
|
||||
private String nationalStandardIndustryCategories5;
|
||||
|
||||
@Schema(description = "企查查行业大类")
|
||||
private String nationalStandardIndustryCategories6;
|
||||
|
||||
@Schema(description = "企查查行业中类")
|
||||
private String nationalStandardIndustryCategories7;
|
||||
|
||||
@Schema(description = "企查查行业小类")
|
||||
private String nationalStandardIndustryCategories8;
|
||||
|
||||
@Schema(description = "企业规模")
|
||||
private String companySize;
|
||||
|
||||
@Schema(description = "曾用名")
|
||||
private String formerName;
|
||||
|
||||
@Schema(description = "英文名")
|
||||
private String englishName;
|
||||
|
||||
@Schema(description = "官网")
|
||||
private String domain;
|
||||
|
||||
@Schema(description = "通信地址")
|
||||
private String mailingAddress;
|
||||
|
||||
@Schema(description = "企业简介")
|
||||
private String companyProfile;
|
||||
|
||||
@Schema(description = "经营范围")
|
||||
private String natureOfBusiness;
|
||||
|
||||
@Schema(description = "登记机关")
|
||||
private String registrationAuthority;
|
||||
|
||||
@Schema(description = "纳税人资质")
|
||||
private String taxpayerQualification;
|
||||
|
||||
@Schema(description = "最新年报年份")
|
||||
private String latestAnnualReportYear;
|
||||
|
||||
@Schema(description = "最新年报营业收入")
|
||||
private String latestAnnualReportOnOperatingRevenue;
|
||||
|
||||
@Schema(description = "企查分")
|
||||
private String enterpriseScoreCheck;
|
||||
|
||||
@Schema(description = "信用等级")
|
||||
private String creditRating;
|
||||
|
||||
@Schema(description = "科创分")
|
||||
private String cechnologyScore;
|
||||
|
||||
@Schema(description = "科创等级")
|
||||
private String cechnologyLevel;
|
||||
|
||||
@Schema(description = "是否小微企业")
|
||||
private String smallEnterprise;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "是否推荐")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer recommend;
|
||||
|
||||
@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;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.gxwebsoft.credit.param;
|
||||
|
||||
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 竞争对手导入参数
|
||||
*/
|
||||
@Data
|
||||
public class CreditCompetitorImportParam implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Excel(name = "企业名称")
|
||||
private String companyName;
|
||||
|
||||
@Excel(name = "法定代表人")
|
||||
private String legalRepresentative;
|
||||
|
||||
@Excel(name = "注册资本")
|
||||
private String registeredCapital;
|
||||
|
||||
@Excel(name = "成立日期")
|
||||
private String establishmentDate;
|
||||
|
||||
@Excel(name = "登记状态")
|
||||
private String registrationStatus;
|
||||
|
||||
@Excel(name = "所属行业")
|
||||
private String industry;
|
||||
|
||||
@Excel(name = "所属省份")
|
||||
private String province;
|
||||
|
||||
@Excel(name = "备注")
|
||||
private String comments;
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
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;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 竞争对手查询参数
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-12-19 19:49:04
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@Schema(name = "CreditCompetitorParam对象", description = "竞争对手查询参数")
|
||||
public class CreditCompetitorParam extends BaseParam {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "序号")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "企业名称")
|
||||
private String companyName;
|
||||
|
||||
@Schema(description = "法定代表人")
|
||||
private String legalRepresentative;
|
||||
|
||||
@Schema(description = "注册资本")
|
||||
private String registeredCapital;
|
||||
|
||||
@Schema(description = "成立日期")
|
||||
private String establishmentDate;
|
||||
|
||||
@Schema(description = "登记状态")
|
||||
private String registrationStatus;
|
||||
|
||||
@Schema(description = "所属行业")
|
||||
private String industry;
|
||||
|
||||
@Schema(description = "所属省份")
|
||||
private String province;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "是否推荐")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer recommend;
|
||||
|
||||
@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;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
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;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 法院公告司法大数据查询参数
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-12-19 19:49:13
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@Schema(name = "CreditCourtAnnouncementParam对象", description = "法院公告司法大数据查询参数")
|
||||
public class CreditCourtAnnouncementParam extends BaseParam {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "ID")
|
||||
@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 involvedAmount;
|
||||
|
||||
@Schema(description = "法院")
|
||||
private String courtName;
|
||||
|
||||
@Schema(description = "数据状态")
|
||||
private String dataStatus;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "是否推荐")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer recommend;
|
||||
|
||||
@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;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
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;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 开庭公告司法大数据查询参数
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-12-19 19:49:32
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@Schema(name = "CreditCourtSessionParam对象", description = "开庭公告司法大数据查询参数")
|
||||
public class CreditCourtSessionParam extends BaseParam {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "ID")
|
||||
@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 involvedAmount;
|
||||
|
||||
@Schema(description = "法院")
|
||||
private String courtName;
|
||||
|
||||
@Schema(description = "数据状态")
|
||||
private String dataStatus;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "是否推荐")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer recommend;
|
||||
|
||||
@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;
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user