Compare commits
10 Commits
5aaf6c83be
...
c278d11390
| Author | SHA1 | Date | |
|---|---|---|---|
| c278d11390 | |||
| e0629f22e5 | |||
| 03ecbbd204 | |||
| eabd38fa58 | |||
| 03a4acb63a | |||
| 3286795f98 | |||
| 4c6ca52e7e | |||
| cc1a4538af | |||
| 1bb24ab0a2 | |||
| 9c22e8a3ce |
10
.gitignore
vendored
10
.gitignore
vendored
@@ -79,4 +79,12 @@ output/
|
||||
|
||||
logs/
|
||||
|
||||
.DS_Store
|
||||
.DS_Store
|
||||
|
||||
ruoyi-ui/vue.config.js
|
||||
|
||||
*/src/test/
|
||||
|
||||
.pytest_cache/
|
||||
|
||||
tests/
|
||||
17
.mcp.json
17
.mcp.json
@@ -1,17 +0,0 @@
|
||||
{
|
||||
"mcpServers": {
|
||||
"mysql": {
|
||||
"command": "node",
|
||||
"args": [
|
||||
"C:/Users/wkc/.codex/mcp-tools/mysql-server/node_modules/@fhuang/mcp-mysql-server/build/index.js"
|
||||
],
|
||||
"env": {
|
||||
"MYSQL_DATABASE": "ccdi",
|
||||
"MYSQL_HOST": "116.62.17.81",
|
||||
"MYSQL_PASSWORD": "Kfcx@1234",
|
||||
"MYSQL_PORT": "3306",
|
||||
"MYSQL_USER": "root"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
24
.opencode
24
.opencode
@@ -1,24 +0,0 @@
|
||||
{
|
||||
"$schema": "https://opencode.ai/config.json",
|
||||
"plugin": [
|
||||
"oh-my-opencode@latest"
|
||||
],
|
||||
"agent": {
|
||||
"Sisyphus-Junior": {
|
||||
"mode": "subagent",
|
||||
"model": "glm/glm-5"
|
||||
},
|
||||
"oracle": {
|
||||
"mode": "subagent",
|
||||
"model": "gmn/gpt-5.3-codex"
|
||||
},
|
||||
"Metis (Plan Consultant)": {
|
||||
"mode": "subagent",
|
||||
"model": "gmn/gpt-5.3-codex"
|
||||
},
|
||||
"Momus (Plan Critic)": {
|
||||
"mode": "subagent",
|
||||
"model": "gmn/gpt-5.3-codex"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -57,6 +57,12 @@
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ccdi-lsfx</artifactId>
|
||||
<version>3.9.1</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
||||
@@ -0,0 +1,181 @@
|
||||
package com.ruoyi.info.collection.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.PageDomain;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.page.TableSupport;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.info.collection.domain.dto.CcdiAccountInfoAddDTO;
|
||||
import com.ruoyi.info.collection.domain.dto.CcdiAccountInfoEditDTO;
|
||||
import com.ruoyi.info.collection.domain.dto.CcdiAccountInfoQueryDTO;
|
||||
import com.ruoyi.info.collection.domain.excel.CcdiAccountInfoExcel;
|
||||
import com.ruoyi.info.collection.domain.vo.AccountInfoImportFailureVO;
|
||||
import com.ruoyi.info.collection.domain.vo.CcdiAccountInfoVO;
|
||||
import com.ruoyi.info.collection.domain.vo.CcdiBaseStaffOptionVO;
|
||||
import com.ruoyi.info.collection.domain.vo.ImportResult;
|
||||
import com.ruoyi.info.collection.service.ICcdiAccountInfoService;
|
||||
import com.ruoyi.info.collection.service.ICcdiBaseStaffService;
|
||||
import com.ruoyi.info.collection.utils.EasyExcelUtil;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 账户库Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-04-13
|
||||
*/
|
||||
@Tag(name = "账户库管理")
|
||||
@RestController
|
||||
@RequestMapping("/ccdi/accountInfo")
|
||||
public class CcdiAccountInfoController extends BaseController {
|
||||
|
||||
@Resource
|
||||
private ICcdiAccountInfoService accountInfoService;
|
||||
|
||||
@Resource
|
||||
private ICcdiBaseStaffService baseStaffService;
|
||||
|
||||
/**
|
||||
* 查询账户库列表
|
||||
*/
|
||||
@Operation(summary = "查询账户库列表")
|
||||
@PreAuthorize("@ss.hasPermi('ccdi:accountInfo:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(CcdiAccountInfoQueryDTO queryDTO) {
|
||||
PageDomain pageDomain = TableSupport.buildPageRequest();
|
||||
Page<CcdiAccountInfoVO> page = new Page<>(pageDomain.getPageNum(), pageDomain.getPageSize());
|
||||
Page<CcdiAccountInfoVO> result = accountInfoService.selectAccountInfoPage(page, queryDTO);
|
||||
return getDataTable(result.getRecords(), result.getTotal());
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询账户库详情
|
||||
*/
|
||||
@Operation(summary = "查询账户库详情")
|
||||
@PreAuthorize("@ss.hasPermi('ccdi:accountInfo:query')")
|
||||
@GetMapping("/{id}")
|
||||
public AjaxResult getInfo(@PathVariable Long id) {
|
||||
return success(accountInfoService.selectAccountInfoById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出账户库列表
|
||||
*/
|
||||
@Operation(summary = "导出账户库列表")
|
||||
@PreAuthorize("@ss.hasPermi('ccdi:accountInfo:export')")
|
||||
@Log(title = "账户库管理", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, CcdiAccountInfoQueryDTO queryDTO) {
|
||||
List<CcdiAccountInfoExcel> list = accountInfoService.selectAccountInfoListForExport(queryDTO);
|
||||
EasyExcelUtil.exportExcel(response, list, CcdiAccountInfoExcel.class, "账户库管理");
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增账户
|
||||
*/
|
||||
@Operation(summary = "新增账户")
|
||||
@PreAuthorize("@ss.hasPermi('ccdi:accountInfo:add')")
|
||||
@Log(title = "账户库管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@Validated @RequestBody CcdiAccountInfoAddDTO addDTO) {
|
||||
return toAjax(accountInfoService.insertAccountInfo(addDTO));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改账户
|
||||
*/
|
||||
@Operation(summary = "修改账户")
|
||||
@PreAuthorize("@ss.hasPermi('ccdi:accountInfo:edit')")
|
||||
@Log(title = "账户库管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@Validated @RequestBody CcdiAccountInfoEditDTO editDTO) {
|
||||
return toAjax(accountInfoService.updateAccountInfo(editDTO));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除账户
|
||||
*/
|
||||
@Operation(summary = "删除账户")
|
||||
@PreAuthorize("@ss.hasPermi('ccdi:accountInfo:remove')")
|
||||
@Log(title = "账户库管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(accountInfoService.deleteAccountInfoByIds(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询账户归属员工下拉
|
||||
*/
|
||||
@Operation(summary = "查询账户归属员工下拉")
|
||||
@PreAuthorize("@ss.hasPermi('ccdi:accountInfo:list')")
|
||||
@GetMapping("/staffOptions")
|
||||
public AjaxResult getStaffOptions(@RequestParam(required = false) String query) {
|
||||
List<CcdiBaseStaffOptionVO> list = baseStaffService.selectStaffOptions(query);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询关系人下拉
|
||||
*/
|
||||
@Operation(summary = "查询关系人下拉")
|
||||
@PreAuthorize("@ss.hasPermi('ccdi:accountInfo:list')")
|
||||
@GetMapping("/relationOptions")
|
||||
public AjaxResult getRelationOptions(@RequestParam Long staffId) {
|
||||
return success(accountInfoService.selectRelationOptionsByStaffId(staffId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载导入模板
|
||||
*/
|
||||
@Operation(summary = "下载导入模板")
|
||||
@PostMapping("/importTemplate")
|
||||
public void importTemplate(HttpServletResponse response) {
|
||||
EasyExcelUtil.importTemplateExcel(response, CcdiAccountInfoExcel.class, "账户库管理");
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入账户库信息
|
||||
*/
|
||||
@Operation(summary = "导入账户库信息")
|
||||
@PreAuthorize("@ss.hasPermi('ccdi:accountInfo:import')")
|
||||
@Log(title = "账户库管理", businessType = BusinessType.IMPORT)
|
||||
@PostMapping("/importData")
|
||||
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception {
|
||||
List<CcdiAccountInfoExcel> list = EasyExcelUtil.importExcel(file.getInputStream(), CcdiAccountInfoExcel.class);
|
||||
if (list == null || list.isEmpty()) {
|
||||
return error("至少需要一条数据");
|
||||
}
|
||||
ImportResult result = accountInfoService.importAccountInfo(list, updateSupport);
|
||||
List<AccountInfoImportFailureVO> failures = accountInfoService.getLatestImportFailures();
|
||||
Map<String, Object> data = new HashMap<>(4);
|
||||
data.put("totalCount", result.getTotalCount());
|
||||
data.put("successCount", result.getSuccessCount());
|
||||
data.put("failureCount", result.getFailureCount());
|
||||
data.put("failures", failures);
|
||||
String message = "导入完成,共 " + result.getTotalCount() + " 条,成功 " + result.getSuccessCount()
|
||||
+ " 条,失败 " + result.getFailureCount() + " 条";
|
||||
return AjaxResult.success(message, data);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,146 @@
|
||||
package com.ruoyi.info.collection.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.PageDomain;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.page.TableSupport;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.info.collection.domain.dto.CcdiEnterpriseBaseInfoAddDTO;
|
||||
import com.ruoyi.info.collection.domain.dto.CcdiEnterpriseBaseInfoEditDTO;
|
||||
import com.ruoyi.info.collection.domain.dto.CcdiEnterpriseBaseInfoQueryDTO;
|
||||
import com.ruoyi.info.collection.domain.excel.CcdiEnterpriseBaseInfoExcel;
|
||||
import com.ruoyi.info.collection.domain.vo.CcdiEnterpriseBaseInfoVO;
|
||||
import com.ruoyi.info.collection.domain.vo.EnterpriseBaseInfoImportFailureVO;
|
||||
import com.ruoyi.info.collection.domain.vo.ImportResultVO;
|
||||
import com.ruoyi.info.collection.domain.vo.ImportStatusVO;
|
||||
import com.ruoyi.info.collection.service.ICcdiEnterpriseBaseInfoImportService;
|
||||
import com.ruoyi.info.collection.service.ICcdiEnterpriseBaseInfoService;
|
||||
import com.ruoyi.info.collection.utils.EasyExcelUtil;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 实体库管理 Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-04-17
|
||||
*/
|
||||
@Tag(name = "实体库管理")
|
||||
@RestController
|
||||
@RequestMapping("/ccdi/enterpriseBaseInfo")
|
||||
public class CcdiEnterpriseBaseInfoController extends BaseController {
|
||||
|
||||
@Resource
|
||||
private ICcdiEnterpriseBaseInfoService enterpriseBaseInfoService;
|
||||
|
||||
@Resource
|
||||
private ICcdiEnterpriseBaseInfoImportService enterpriseBaseInfoImportService;
|
||||
|
||||
@Operation(summary = "查询实体库列表")
|
||||
@PreAuthorize("@ss.hasPermi('ccdi:enterpriseBaseInfo:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(CcdiEnterpriseBaseInfoQueryDTO queryDTO) {
|
||||
PageDomain pageDomain = TableSupport.buildPageRequest();
|
||||
Page<CcdiEnterpriseBaseInfoVO> page = new Page<>(pageDomain.getPageNum(), pageDomain.getPageSize());
|
||||
Page<CcdiEnterpriseBaseInfoVO> result = enterpriseBaseInfoService.selectEnterpriseBaseInfoPage(page, queryDTO);
|
||||
return getDataTable(result.getRecords(), result.getTotal());
|
||||
}
|
||||
|
||||
@Operation(summary = "获取实体库详细信息")
|
||||
@PreAuthorize("@ss.hasPermi('ccdi:enterpriseBaseInfo:query')")
|
||||
@GetMapping("/{socialCreditCode}")
|
||||
public AjaxResult getInfo(@PathVariable String socialCreditCode) {
|
||||
return success(enterpriseBaseInfoService.selectEnterpriseBaseInfoById(socialCreditCode));
|
||||
}
|
||||
|
||||
@Operation(summary = "新增实体库信息")
|
||||
@PreAuthorize("@ss.hasPermi('ccdi:enterpriseBaseInfo:add')")
|
||||
@Log(title = "实体库管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@Validated @RequestBody CcdiEnterpriseBaseInfoAddDTO addDTO) {
|
||||
return toAjax(enterpriseBaseInfoService.insertEnterpriseBaseInfo(addDTO));
|
||||
}
|
||||
|
||||
@Operation(summary = "修改实体库信息")
|
||||
@PreAuthorize("@ss.hasPermi('ccdi:enterpriseBaseInfo:edit')")
|
||||
@Log(title = "实体库管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@Validated @RequestBody CcdiEnterpriseBaseInfoEditDTO editDTO) {
|
||||
return toAjax(enterpriseBaseInfoService.updateEnterpriseBaseInfo(editDTO));
|
||||
}
|
||||
|
||||
@Operation(summary = "删除实体库信息")
|
||||
@PreAuthorize("@ss.hasPermi('ccdi:enterpriseBaseInfo:remove')")
|
||||
@Log(title = "实体库管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{socialCreditCodes}")
|
||||
public AjaxResult remove(@PathVariable String[] socialCreditCodes) {
|
||||
return toAjax(enterpriseBaseInfoService.deleteEnterpriseBaseInfoByIds(socialCreditCodes));
|
||||
}
|
||||
|
||||
@Operation(summary = "下载导入模板")
|
||||
@PostMapping("/importTemplate")
|
||||
public void importTemplate(HttpServletResponse response) {
|
||||
EasyExcelUtil.importTemplateWithDictDropdown(response, CcdiEnterpriseBaseInfoExcel.class, "实体库管理");
|
||||
}
|
||||
|
||||
@Operation(summary = "导入实体库信息")
|
||||
@PreAuthorize("@ss.hasPermi('ccdi:enterpriseBaseInfo:import')")
|
||||
@Log(title = "实体库管理", businessType = BusinessType.IMPORT)
|
||||
@PostMapping("/importData")
|
||||
public AjaxResult importData(MultipartFile file) throws Exception {
|
||||
List<CcdiEnterpriseBaseInfoExcel> list = EasyExcelUtil.importExcel(file.getInputStream(), CcdiEnterpriseBaseInfoExcel.class);
|
||||
if (list == null || list.isEmpty()) {
|
||||
return error("至少需要一条数据");
|
||||
}
|
||||
|
||||
String taskId = enterpriseBaseInfoService.importEnterpriseBaseInfo(list);
|
||||
ImportResultVO result = new ImportResultVO();
|
||||
result.setTaskId(taskId);
|
||||
result.setStatus("PROCESSING");
|
||||
result.setMessage("导入任务已提交,正在后台处理");
|
||||
return AjaxResult.success("导入任务已提交,正在后台处理", result);
|
||||
}
|
||||
|
||||
@Operation(summary = "查询导入状态")
|
||||
@PreAuthorize("@ss.hasPermi('ccdi:enterpriseBaseInfo:import')")
|
||||
@GetMapping("/importStatus/{taskId}")
|
||||
public AjaxResult getImportStatus(@PathVariable String taskId) {
|
||||
ImportStatusVO status = enterpriseBaseInfoImportService.getImportStatus(taskId);
|
||||
return success(status);
|
||||
}
|
||||
|
||||
@Operation(summary = "查询导入失败记录")
|
||||
@PreAuthorize("@ss.hasPermi('ccdi:enterpriseBaseInfo:import')")
|
||||
@GetMapping("/importFailures/{taskId}")
|
||||
public TableDataInfo getImportFailures(@PathVariable String taskId,
|
||||
@RequestParam(defaultValue = "1") Integer pageNum,
|
||||
@RequestParam(defaultValue = "10") Integer pageSize) {
|
||||
List<EnterpriseBaseInfoImportFailureVO> failures = enterpriseBaseInfoImportService.getImportFailures(taskId);
|
||||
int fromIndex = (pageNum - 1) * pageSize;
|
||||
if (fromIndex >= failures.size()) {
|
||||
return getDataTable(new ArrayList<>(), failures.size());
|
||||
}
|
||||
int toIndex = Math.min(fromIndex + pageSize, failures.size());
|
||||
return getDataTable(failures.subList(fromIndex, toIndex), failures.size());
|
||||
}
|
||||
}
|
||||
@@ -138,4 +138,30 @@ public class CcdiEnumController {
|
||||
}
|
||||
return AjaxResult.success(options);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取实体风险等级选项
|
||||
*/
|
||||
@Operation(summary = "获取实体风险等级选项")
|
||||
@GetMapping("/enterpriseRiskLevel")
|
||||
public AjaxResult getEnterpriseRiskLevelOptions() {
|
||||
List<EnumOptionVO> options = new ArrayList<>();
|
||||
for (EnterpriseRiskLevel level : EnterpriseRiskLevel.values()) {
|
||||
options.add(new EnumOptionVO(level.getCode(), level.getDesc()));
|
||||
}
|
||||
return AjaxResult.success(options);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取企业来源选项
|
||||
*/
|
||||
@Operation(summary = "获取企业来源选项")
|
||||
@GetMapping("/enterpriseSource")
|
||||
public AjaxResult getEnterpriseSourceOptions() {
|
||||
List<EnumOptionVO> options = new ArrayList<>();
|
||||
for (EnterpriseSource source : EnterpriseSource.values()) {
|
||||
options.add(new EnumOptionVO(source.getCode(), source.getDesc()));
|
||||
}
|
||||
return AjaxResult.success(options);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,120 @@
|
||||
package com.ruoyi.info.collection.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 账户基础信息对象 ccdi_account_info
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-04-13
|
||||
*/
|
||||
@Data
|
||||
@TableName("ccdi_account_info")
|
||||
public class CcdiAccountInfo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键ID */
|
||||
@TableId(value = "account_id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/** 所属人类型:EMPLOYEE/RELATION/INTERMEDIARY/EXTERNAL */
|
||||
private String ownerType;
|
||||
|
||||
/** 所属人标识 */
|
||||
private String ownerId;
|
||||
|
||||
/** 账户号码 */
|
||||
private String accountNo;
|
||||
|
||||
/** 账户类型 */
|
||||
private String accountType;
|
||||
|
||||
/** 账户范围:INTERNAL/EXTERNAL */
|
||||
private String bankScope;
|
||||
|
||||
/** 账户姓名 */
|
||||
private String accountName;
|
||||
|
||||
/** 开户机构 */
|
||||
@TableField("bank")
|
||||
private String openBank;
|
||||
|
||||
/** 银行代码 */
|
||||
private String bankCode;
|
||||
|
||||
/** 币种 */
|
||||
private String currency;
|
||||
|
||||
/** 是否实控账户:0-否 1-是 */
|
||||
@TableField("is_self_account")
|
||||
private Integer isActualControl;
|
||||
|
||||
/** 月均交易笔数 */
|
||||
@TableField("monthly_avg_trans_count")
|
||||
private Integer avgMonthTxnCount;
|
||||
|
||||
/** 月均交易金额 */
|
||||
@TableField("monthly_avg_trans_amount")
|
||||
private BigDecimal avgMonthTxnAmount;
|
||||
|
||||
/** 交易频率等级 */
|
||||
@TableField("trans_freq_type")
|
||||
private String txnFrequencyLevel;
|
||||
|
||||
/** 借方单笔最高额 */
|
||||
@TableField("dr_max_single_amount")
|
||||
private BigDecimal debitSingleMaxAmount;
|
||||
|
||||
/** 贷方单笔最高额 */
|
||||
@TableField("cr_max_single_amount")
|
||||
private BigDecimal creditSingleMaxAmount;
|
||||
|
||||
/** 借方日累计最高额 */
|
||||
@TableField("dr_max_daily_amount")
|
||||
private BigDecimal debitDailyMaxAmount;
|
||||
|
||||
/** 贷方日累计最高额 */
|
||||
@TableField("cr_max_daily_amount")
|
||||
private BigDecimal creditDailyMaxAmount;
|
||||
|
||||
/** 风险等级 */
|
||||
@TableField("trans_risk_level")
|
||||
private String txnRiskLevel;
|
||||
|
||||
/** 状态:1-正常 2-已销户 */
|
||||
private Integer status;
|
||||
|
||||
/** 生效日期 */
|
||||
private Date effectiveDate;
|
||||
|
||||
/** 失效日期 */
|
||||
private Date invalidDate;
|
||||
|
||||
/** 创建者 */
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private String createBy;
|
||||
|
||||
/** 创建时间 */
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private Date createTime;
|
||||
|
||||
/** 更新者 */
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private String updateBy;
|
||||
|
||||
/** 更新时间 */
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private Date updateTime;
|
||||
}
|
||||
@@ -43,6 +43,10 @@ public class CcdiBaseStaff implements Serializable {
|
||||
/** 入职时间 */
|
||||
private Date hireDate;
|
||||
|
||||
/** 是否党员:0-否 1-是 */
|
||||
@TableField("is_party_member")
|
||||
private Integer partyMember;
|
||||
|
||||
/** 状态 */
|
||||
private String status;
|
||||
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.ruoyi.info.collection.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 中介关联机构关系对象 ccdi_intermediary_enterprise_relation
|
||||
*/
|
||||
@Data
|
||||
@TableName("ccdi_intermediary_enterprise_relation")
|
||||
public class CcdiIntermediaryEnterpriseRelation implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
private String intermediaryBizId;
|
||||
|
||||
private String socialCreditCode;
|
||||
|
||||
private String relationPersonPost;
|
||||
|
||||
private String remark;
|
||||
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private String createdBy;
|
||||
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private Date createTime;
|
||||
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private String updatedBy;
|
||||
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private Date updateTime;
|
||||
}
|
||||
@@ -0,0 +1,138 @@
|
||||
package com.ruoyi.info.collection.domain.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.DecimalMin;
|
||||
import jakarta.validation.constraints.Min;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 账户库新增DTO
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-04-13
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "账户库新增")
|
||||
public class CcdiAccountInfoAddDTO implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 所属人类型 */
|
||||
@NotBlank(message = "所属人类型不能为空")
|
||||
@Schema(description = "所属人类型")
|
||||
private String ownerType;
|
||||
|
||||
/** 所属人标识 */
|
||||
@Schema(description = "所属人标识")
|
||||
private String ownerId;
|
||||
|
||||
/** 账户号码 */
|
||||
@NotBlank(message = "账户号码不能为空")
|
||||
@Size(max = 240, message = "账户号码长度不能超过240个字符")
|
||||
@Schema(description = "账户号码")
|
||||
private String accountNo;
|
||||
|
||||
/** 账户类型 */
|
||||
@NotBlank(message = "账户类型不能为空")
|
||||
@Size(max = 30, message = "账户类型长度不能超过30个字符")
|
||||
@Schema(description = "账户类型")
|
||||
private String accountType;
|
||||
|
||||
/** 账户范围 */
|
||||
@NotBlank(message = "账户范围不能为空")
|
||||
@Size(max = 20, message = "账户范围长度不能超过20个字符")
|
||||
@Schema(description = "账户范围")
|
||||
private String bankScope;
|
||||
|
||||
/** 账户姓名 */
|
||||
@NotBlank(message = "账户姓名不能为空")
|
||||
@Size(max = 100, message = "账户姓名长度不能超过100个字符")
|
||||
@Schema(description = "账户姓名")
|
||||
private String accountName;
|
||||
|
||||
/** 开户机构 */
|
||||
@NotBlank(message = "开户机构不能为空")
|
||||
@Size(max = 100, message = "开户机构长度不能超过100个字符")
|
||||
@Schema(description = "开户机构")
|
||||
private String openBank;
|
||||
|
||||
/** 银行代码 */
|
||||
@Size(max = 20, message = "银行代码长度不能超过20个字符")
|
||||
@Schema(description = "银行代码")
|
||||
private String bankCode;
|
||||
|
||||
/** 币种 */
|
||||
@Size(max = 3, message = "币种长度不能超过3个字符")
|
||||
@Schema(description = "币种")
|
||||
private String currency;
|
||||
|
||||
/** 状态 */
|
||||
@NotNull(message = "状态不能为空")
|
||||
@Schema(description = "状态")
|
||||
private Integer status;
|
||||
|
||||
/** 生效日期 */
|
||||
@NotNull(message = "生效日期不能为空")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Schema(description = "生效日期")
|
||||
private Date effectiveDate;
|
||||
|
||||
/** 失效日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Schema(description = "失效日期")
|
||||
private Date invalidDate;
|
||||
|
||||
/** 是否实控账户 */
|
||||
@Schema(description = "是否实控账户")
|
||||
private Integer isActualControl;
|
||||
|
||||
/** 月均交易笔数 */
|
||||
@Min(value = 0, message = "月均交易笔数不能小于0")
|
||||
@Schema(description = "月均交易笔数")
|
||||
private Integer avgMonthTxnCount;
|
||||
|
||||
/** 月均交易金额 */
|
||||
@DecimalMin(value = "0", message = "月均交易金额不能小于0")
|
||||
@Schema(description = "月均交易金额")
|
||||
private BigDecimal avgMonthTxnAmount;
|
||||
|
||||
/** 频率等级 */
|
||||
@Size(max = 20, message = "频率等级长度不能超过20个字符")
|
||||
@Schema(description = "频率等级")
|
||||
private String txnFrequencyLevel;
|
||||
|
||||
/** 借方单笔最高额 */
|
||||
@DecimalMin(value = "0", message = "借方单笔最高额不能小于0")
|
||||
@Schema(description = "借方单笔最高额")
|
||||
private BigDecimal debitSingleMaxAmount;
|
||||
|
||||
/** 贷方单笔最高额 */
|
||||
@DecimalMin(value = "0", message = "贷方单笔最高额不能小于0")
|
||||
@Schema(description = "贷方单笔最高额")
|
||||
private BigDecimal creditSingleMaxAmount;
|
||||
|
||||
/** 借方日累计最高额 */
|
||||
@DecimalMin(value = "0", message = "借方日累计最高额不能小于0")
|
||||
@Schema(description = "借方日累计最高额")
|
||||
private BigDecimal debitDailyMaxAmount;
|
||||
|
||||
/** 贷方日累计最高额 */
|
||||
@DecimalMin(value = "0", message = "贷方日累计最高额不能小于0")
|
||||
@Schema(description = "贷方日累计最高额")
|
||||
private BigDecimal creditDailyMaxAmount;
|
||||
|
||||
/** 风险等级 */
|
||||
@Size(max = 10, message = "风险等级长度不能超过10个字符")
|
||||
@Schema(description = "风险等级")
|
||||
private String txnRiskLevel;
|
||||
}
|
||||
@@ -0,0 +1,143 @@
|
||||
package com.ruoyi.info.collection.domain.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.DecimalMin;
|
||||
import jakarta.validation.constraints.Min;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 账户库编辑DTO
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-04-13
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "账户库编辑")
|
||||
public class CcdiAccountInfoEditDTO implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键ID */
|
||||
@NotNull(message = "主键ID不能为空")
|
||||
@Schema(description = "主键ID")
|
||||
private Long id;
|
||||
|
||||
/** 所属人类型 */
|
||||
@NotBlank(message = "所属人类型不能为空")
|
||||
@Schema(description = "所属人类型")
|
||||
private String ownerType;
|
||||
|
||||
/** 所属人标识 */
|
||||
@Schema(description = "所属人标识")
|
||||
private String ownerId;
|
||||
|
||||
/** 账户号码 */
|
||||
@NotBlank(message = "账户号码不能为空")
|
||||
@Size(max = 240, message = "账户号码长度不能超过240个字符")
|
||||
@Schema(description = "账户号码")
|
||||
private String accountNo;
|
||||
|
||||
/** 账户类型 */
|
||||
@NotBlank(message = "账户类型不能为空")
|
||||
@Size(max = 30, message = "账户类型长度不能超过30个字符")
|
||||
@Schema(description = "账户类型")
|
||||
private String accountType;
|
||||
|
||||
/** 账户范围 */
|
||||
@NotBlank(message = "账户范围不能为空")
|
||||
@Size(max = 20, message = "账户范围长度不能超过20个字符")
|
||||
@Schema(description = "账户范围")
|
||||
private String bankScope;
|
||||
|
||||
/** 账户姓名 */
|
||||
@NotBlank(message = "账户姓名不能为空")
|
||||
@Size(max = 100, message = "账户姓名长度不能超过100个字符")
|
||||
@Schema(description = "账户姓名")
|
||||
private String accountName;
|
||||
|
||||
/** 开户机构 */
|
||||
@NotBlank(message = "开户机构不能为空")
|
||||
@Size(max = 100, message = "开户机构长度不能超过100个字符")
|
||||
@Schema(description = "开户机构")
|
||||
private String openBank;
|
||||
|
||||
/** 银行代码 */
|
||||
@Size(max = 20, message = "银行代码长度不能超过20个字符")
|
||||
@Schema(description = "银行代码")
|
||||
private String bankCode;
|
||||
|
||||
/** 币种 */
|
||||
@Size(max = 3, message = "币种长度不能超过3个字符")
|
||||
@Schema(description = "币种")
|
||||
private String currency;
|
||||
|
||||
/** 状态 */
|
||||
@NotNull(message = "状态不能为空")
|
||||
@Schema(description = "状态")
|
||||
private Integer status;
|
||||
|
||||
/** 生效日期 */
|
||||
@NotNull(message = "生效日期不能为空")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Schema(description = "生效日期")
|
||||
private Date effectiveDate;
|
||||
|
||||
/** 失效日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Schema(description = "失效日期")
|
||||
private Date invalidDate;
|
||||
|
||||
/** 是否实控账户 */
|
||||
@Schema(description = "是否实控账户")
|
||||
private Integer isActualControl;
|
||||
|
||||
/** 月均交易笔数 */
|
||||
@Min(value = 0, message = "月均交易笔数不能小于0")
|
||||
@Schema(description = "月均交易笔数")
|
||||
private Integer avgMonthTxnCount;
|
||||
|
||||
/** 月均交易金额 */
|
||||
@DecimalMin(value = "0", message = "月均交易金额不能小于0")
|
||||
@Schema(description = "月均交易金额")
|
||||
private BigDecimal avgMonthTxnAmount;
|
||||
|
||||
/** 频率等级 */
|
||||
@Size(max = 20, message = "频率等级长度不能超过20个字符")
|
||||
@Schema(description = "频率等级")
|
||||
private String txnFrequencyLevel;
|
||||
|
||||
/** 借方单笔最高额 */
|
||||
@DecimalMin(value = "0", message = "借方单笔最高额不能小于0")
|
||||
@Schema(description = "借方单笔最高额")
|
||||
private BigDecimal debitSingleMaxAmount;
|
||||
|
||||
/** 贷方单笔最高额 */
|
||||
@DecimalMin(value = "0", message = "贷方单笔最高额不能小于0")
|
||||
@Schema(description = "贷方单笔最高额")
|
||||
private BigDecimal creditSingleMaxAmount;
|
||||
|
||||
/** 借方日累计最高额 */
|
||||
@DecimalMin(value = "0", message = "借方日累计最高额不能小于0")
|
||||
@Schema(description = "借方日累计最高额")
|
||||
private BigDecimal debitDailyMaxAmount;
|
||||
|
||||
/** 贷方日累计最高额 */
|
||||
@DecimalMin(value = "0", message = "贷方日累计最高额不能小于0")
|
||||
@Schema(description = "贷方日累计最高额")
|
||||
private BigDecimal creditDailyMaxAmount;
|
||||
|
||||
/** 风险等级 */
|
||||
@Size(max = 10, message = "风险等级长度不能超过10个字符")
|
||||
@Schema(description = "风险等级")
|
||||
private String txnRiskLevel;
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.ruoyi.info.collection.domain.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 账户库查询DTO
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-04-13
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "账户库查询条件")
|
||||
public class CcdiAccountInfoQueryDTO implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 员工姓名 */
|
||||
@Schema(description = "员工姓名")
|
||||
private String staffName;
|
||||
|
||||
/** 所属人类型 */
|
||||
@Schema(description = "所属人类型")
|
||||
private String ownerType;
|
||||
|
||||
/** 账户范围 */
|
||||
@Schema(description = "账户范围")
|
||||
private String bankScope;
|
||||
|
||||
/** 关系类型 */
|
||||
@Schema(description = "关系类型")
|
||||
private String relationType;
|
||||
|
||||
/** 账户姓名 */
|
||||
@Schema(description = "账户姓名")
|
||||
private String accountName;
|
||||
|
||||
/** 账户类型 */
|
||||
@Schema(description = "账户类型")
|
||||
private String accountType;
|
||||
|
||||
/** 是否实控账户 */
|
||||
@Schema(description = "是否实控账户")
|
||||
private Integer isActualControl;
|
||||
|
||||
/** 风险等级 */
|
||||
@Schema(description = "风险等级")
|
||||
private String riskLevel;
|
||||
|
||||
/** 状态 */
|
||||
@Schema(description = "状态")
|
||||
private Integer status;
|
||||
}
|
||||
@@ -53,6 +53,10 @@ public class CcdiBaseStaffAddDTO implements Serializable {
|
||||
/** 入职时间 */
|
||||
private Date hireDate;
|
||||
|
||||
/** 是否党员:0-否 1-是 */
|
||||
@NotNull(message = "是否党员不能为空")
|
||||
private Integer partyMember;
|
||||
|
||||
/** 状态 */
|
||||
@NotBlank(message = "状态不能为空")
|
||||
private String status;
|
||||
|
||||
@@ -52,6 +52,10 @@ public class CcdiBaseStaffEditDTO implements Serializable {
|
||||
/** 入职时间 */
|
||||
private Date hireDate;
|
||||
|
||||
/** 是否党员:0-否 1-是 */
|
||||
@NotNull(message = "是否党员不能为空")
|
||||
private Integer partyMember;
|
||||
|
||||
/** 状态 */
|
||||
private String status;
|
||||
|
||||
|
||||
@@ -0,0 +1,107 @@
|
||||
package com.ruoyi.info.collection.domain.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.Pattern;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 实体库管理新增 DTO
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-04-17
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "实体库管理新增DTO")
|
||||
public class CcdiEnterpriseBaseInfoAddDTO implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "统一社会信用代码")
|
||||
@NotBlank(message = "统一社会信用代码不能为空")
|
||||
@Pattern(regexp = "^[0-9A-HJ-NPQRTUWXY]{2}\\d{6}[0-9A-HJ-NPQRTUWXY]{10}$", message = "统一社会信用代码格式不正确")
|
||||
private String socialCreditCode;
|
||||
|
||||
@Schema(description = "企业名称")
|
||||
@NotBlank(message = "企业名称不能为空")
|
||||
@Size(max = 200, message = "企业名称长度不能超过200个字符")
|
||||
private String enterpriseName;
|
||||
|
||||
@Schema(description = "企业类型")
|
||||
@Size(max = 50, message = "企业类型长度不能超过50个字符")
|
||||
private String enterpriseType;
|
||||
|
||||
@Schema(description = "企业性质")
|
||||
@Size(max = 50, message = "企业性质长度不能超过50个字符")
|
||||
private String enterpriseNature;
|
||||
|
||||
@Schema(description = "行业分类")
|
||||
@Size(max = 100, message = "行业分类长度不能超过100个字符")
|
||||
private String industryClass;
|
||||
|
||||
@Schema(description = "所属行业")
|
||||
@Size(max = 100, message = "所属行业长度不能超过100个字符")
|
||||
private String industryName;
|
||||
|
||||
@Schema(description = "成立日期")
|
||||
private Date establishDate;
|
||||
|
||||
@Schema(description = "注册地址")
|
||||
@Size(max = 500, message = "注册地址长度不能超过500个字符")
|
||||
private String registerAddress;
|
||||
|
||||
@Schema(description = "法定代表人")
|
||||
@Size(max = 100, message = "法定代表人长度不能超过100个字符")
|
||||
private String legalRepresentative;
|
||||
|
||||
@Schema(description = "法定代表人证件类型")
|
||||
@Size(max = 50, message = "法定代表人证件类型长度不能超过50个字符")
|
||||
private String legalCertType;
|
||||
|
||||
@Schema(description = "法定代表人证件号码")
|
||||
@Size(max = 50, message = "法定代表人证件号码长度不能超过50个字符")
|
||||
private String legalCertNo;
|
||||
|
||||
@Schema(description = "股东1")
|
||||
@Size(max = 100, message = "股东1长度不能超过100个字符")
|
||||
private String shareholder1;
|
||||
|
||||
@Schema(description = "股东2")
|
||||
@Size(max = 100, message = "股东2长度不能超过100个字符")
|
||||
private String shareholder2;
|
||||
|
||||
@Schema(description = "股东3")
|
||||
@Size(max = 100, message = "股东3长度不能超过100个字符")
|
||||
private String shareholder3;
|
||||
|
||||
@Schema(description = "股东4")
|
||||
@Size(max = 100, message = "股东4长度不能超过100个字符")
|
||||
private String shareholder4;
|
||||
|
||||
@Schema(description = "股东5")
|
||||
@Size(max = 100, message = "股东5长度不能超过100个字符")
|
||||
private String shareholder5;
|
||||
|
||||
@Schema(description = "经营状态")
|
||||
@NotBlank(message = "经营状态不能为空")
|
||||
@Size(max = 50, message = "经营状态长度不能超过50个字符")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "风险等级")
|
||||
@NotBlank(message = "风险等级不能为空")
|
||||
private String riskLevel;
|
||||
|
||||
@Schema(description = "企业来源")
|
||||
@NotBlank(message = "企业来源不能为空")
|
||||
private String entSource;
|
||||
|
||||
@Schema(description = "数据来源")
|
||||
@NotBlank(message = "数据来源不能为空")
|
||||
private String dataSource;
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
package com.ruoyi.info.collection.domain.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.Pattern;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 实体库管理编辑 DTO
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-04-17
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "实体库管理编辑DTO")
|
||||
public class CcdiEnterpriseBaseInfoEditDTO implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "统一社会信用代码")
|
||||
@NotBlank(message = "统一社会信用代码不能为空")
|
||||
@Pattern(regexp = "^[0-9A-HJ-NPQRTUWXY]{2}\\d{6}[0-9A-HJ-NPQRTUWXY]{10}$", message = "统一社会信用代码格式不正确")
|
||||
private String socialCreditCode;
|
||||
|
||||
@Schema(description = "企业名称")
|
||||
@NotBlank(message = "企业名称不能为空")
|
||||
@Size(max = 200, message = "企业名称长度不能超过200个字符")
|
||||
private String enterpriseName;
|
||||
|
||||
@Schema(description = "企业类型")
|
||||
@Size(max = 50, message = "企业类型长度不能超过50个字符")
|
||||
private String enterpriseType;
|
||||
|
||||
@Schema(description = "企业性质")
|
||||
@Size(max = 50, message = "企业性质长度不能超过50个字符")
|
||||
private String enterpriseNature;
|
||||
|
||||
@Schema(description = "行业分类")
|
||||
@Size(max = 100, message = "行业分类长度不能超过100个字符")
|
||||
private String industryClass;
|
||||
|
||||
@Schema(description = "所属行业")
|
||||
@Size(max = 100, message = "所属行业长度不能超过100个字符")
|
||||
private String industryName;
|
||||
|
||||
@Schema(description = "成立日期")
|
||||
private Date establishDate;
|
||||
|
||||
@Schema(description = "注册地址")
|
||||
@Size(max = 500, message = "注册地址长度不能超过500个字符")
|
||||
private String registerAddress;
|
||||
|
||||
@Schema(description = "法定代表人")
|
||||
@Size(max = 100, message = "法定代表人长度不能超过100个字符")
|
||||
private String legalRepresentative;
|
||||
|
||||
@Schema(description = "法定代表人证件类型")
|
||||
@Size(max = 50, message = "法定代表人证件类型长度不能超过50个字符")
|
||||
private String legalCertType;
|
||||
|
||||
@Schema(description = "法定代表人证件号码")
|
||||
@Size(max = 50, message = "法定代表人证件号码长度不能超过50个字符")
|
||||
private String legalCertNo;
|
||||
|
||||
@Schema(description = "股东1")
|
||||
@Size(max = 100, message = "股东1长度不能超过100个字符")
|
||||
private String shareholder1;
|
||||
|
||||
@Schema(description = "股东2")
|
||||
@Size(max = 100, message = "股东2长度不能超过100个字符")
|
||||
private String shareholder2;
|
||||
|
||||
@Schema(description = "股东3")
|
||||
@Size(max = 100, message = "股东3长度不能超过100个字符")
|
||||
private String shareholder3;
|
||||
|
||||
@Schema(description = "股东4")
|
||||
@Size(max = 100, message = "股东4长度不能超过100个字符")
|
||||
private String shareholder4;
|
||||
|
||||
@Schema(description = "股东5")
|
||||
@Size(max = 100, message = "股东5长度不能超过100个字符")
|
||||
private String shareholder5;
|
||||
|
||||
@Schema(description = "经营状态")
|
||||
@NotBlank(message = "经营状态不能为空")
|
||||
@Size(max = 50, message = "经营状态长度不能超过50个字符")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "风险等级")
|
||||
@NotBlank(message = "风险等级不能为空")
|
||||
private String riskLevel;
|
||||
|
||||
@Schema(description = "企业来源")
|
||||
@NotBlank(message = "企业来源不能为空")
|
||||
private String entSource;
|
||||
|
||||
@Schema(description = "数据来源")
|
||||
@NotBlank(message = "数据来源不能为空")
|
||||
private String dataSource;
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.ruoyi.info.collection.domain.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 实体库管理查询 DTO
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-04-17
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "实体库管理查询DTO")
|
||||
public class CcdiEnterpriseBaseInfoQueryDTO implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "企业名称")
|
||||
private String enterpriseName;
|
||||
|
||||
@Schema(description = "统一社会信用代码")
|
||||
private String socialCreditCode;
|
||||
|
||||
@Schema(description = "企业类型")
|
||||
private String enterpriseType;
|
||||
|
||||
@Schema(description = "企业性质")
|
||||
private String enterpriseNature;
|
||||
|
||||
@Schema(description = "行业分类")
|
||||
private String industryClass;
|
||||
|
||||
@Schema(description = "经营状态")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "风险等级")
|
||||
private String riskLevel;
|
||||
|
||||
@Schema(description = "企业来源")
|
||||
private String entSource;
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.ruoyi.info.collection.domain.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 中介关联机构新增DTO
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "中介关联机构新增DTO")
|
||||
public class CcdiIntermediaryEnterpriseRelationAddDTO implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "统一社会信用代码")
|
||||
@NotBlank(message = "统一社会信用代码不能为空")
|
||||
@Size(max = 18, message = "统一社会信用代码长度不能超过18个字符")
|
||||
private String socialCreditCode;
|
||||
|
||||
@Schema(description = "关联角色/职务")
|
||||
@Size(max = 100, message = "关联角色/职务长度不能超过100个字符")
|
||||
private String relationPersonPost;
|
||||
|
||||
@Schema(description = "备注")
|
||||
@Size(max = 500, message = "备注长度不能超过500个字符")
|
||||
private String remark;
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.ruoyi.info.collection.domain.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 中介关联机构编辑DTO
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "中介关联机构编辑DTO")
|
||||
public class CcdiIntermediaryEnterpriseRelationEditDTO implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "主键ID")
|
||||
@NotNull(message = "主键ID不能为空")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "统一社会信用代码")
|
||||
@NotBlank(message = "统一社会信用代码不能为空")
|
||||
@Size(max = 18, message = "统一社会信用代码长度不能超过18个字符")
|
||||
private String socialCreditCode;
|
||||
|
||||
@Schema(description = "关联角色/职务")
|
||||
@Size(max = 100, message = "关联角色/职务长度不能超过100个字符")
|
||||
private String relationPersonPost;
|
||||
|
||||
@Schema(description = "备注")
|
||||
@Size(max = 500, message = "备注长度不能超过500个字符")
|
||||
private String remark;
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package com.ruoyi.info.collection.domain.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 中介亲属新增DTO
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "中介亲属新增DTO")
|
||||
public class CcdiIntermediaryRelativeAddDTO implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "姓名")
|
||||
@NotBlank(message = "姓名不能为空")
|
||||
@Size(max = 100, message = "姓名长度不能超过100个字符")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "人员类型")
|
||||
private String personType;
|
||||
|
||||
@Schema(description = "亲属关系")
|
||||
@NotBlank(message = "亲属关系不能为空")
|
||||
@Size(max = 50, message = "亲属关系长度不能超过50个字符")
|
||||
private String personSubType;
|
||||
|
||||
@Schema(description = "性别")
|
||||
private String gender;
|
||||
|
||||
@Schema(description = "证件类型")
|
||||
private String idType;
|
||||
|
||||
@Schema(description = "证件号码")
|
||||
@NotBlank(message = "证件号码不能为空")
|
||||
@Size(max = 50, message = "证件号码长度不能超过50个字符")
|
||||
private String personId;
|
||||
|
||||
@Schema(description = "手机号码")
|
||||
@Size(max = 20, message = "手机号码长度不能超过20个字符")
|
||||
private String mobile;
|
||||
|
||||
@Schema(description = "微信号")
|
||||
@Size(max = 50, message = "微信号长度不能超过50个字符")
|
||||
private String wechatNo;
|
||||
|
||||
@Schema(description = "联系地址")
|
||||
@Size(max = 200, message = "联系地址长度不能超过200个字符")
|
||||
private String contactAddress;
|
||||
|
||||
@Schema(description = "所在公司")
|
||||
@Size(max = 200, message = "所在公司长度不能超过200个字符")
|
||||
private String company;
|
||||
|
||||
@Schema(description = "企业统一信用码")
|
||||
@Size(max = 50, message = "企业统一信用码长度不能超过50个字符")
|
||||
private String socialCreditCode;
|
||||
|
||||
@Schema(description = "职位")
|
||||
@Size(max = 100, message = "职位长度不能超过100个字符")
|
||||
private String position;
|
||||
|
||||
@Schema(description = "备注")
|
||||
@Size(max = 500, message = "备注长度不能超过500个字符")
|
||||
private String remark;
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
package com.ruoyi.info.collection.domain.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 中介亲属编辑DTO
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "中介亲属编辑DTO")
|
||||
public class CcdiIntermediaryRelativeEditDTO implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "人员ID")
|
||||
@NotBlank(message = "人员ID不能为空")
|
||||
private String bizId;
|
||||
|
||||
@Schema(description = "姓名")
|
||||
@NotBlank(message = "姓名不能为空")
|
||||
@Size(max = 100, message = "姓名长度不能超过100个字符")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "人员类型")
|
||||
private String personType;
|
||||
|
||||
@Schema(description = "亲属关系")
|
||||
@NotBlank(message = "亲属关系不能为空")
|
||||
@Size(max = 50, message = "亲属关系长度不能超过50个字符")
|
||||
private String personSubType;
|
||||
|
||||
@Schema(description = "性别")
|
||||
private String gender;
|
||||
|
||||
@Schema(description = "证件类型")
|
||||
private String idType;
|
||||
|
||||
@Schema(description = "证件号码")
|
||||
@Size(max = 50, message = "证件号码长度不能超过50个字符")
|
||||
private String personId;
|
||||
|
||||
@Schema(description = "手机号码")
|
||||
@Size(max = 20, message = "手机号码长度不能超过20个字符")
|
||||
private String mobile;
|
||||
|
||||
@Schema(description = "微信号")
|
||||
@Size(max = 50, message = "微信号长度不能超过50个字符")
|
||||
private String wechatNo;
|
||||
|
||||
@Schema(description = "联系地址")
|
||||
@Size(max = 200, message = "联系地址长度不能超过200个字符")
|
||||
private String contactAddress;
|
||||
|
||||
@Schema(description = "所在公司")
|
||||
@Size(max = 200, message = "所在公司长度不能超过200个字符")
|
||||
private String company;
|
||||
|
||||
@Schema(description = "企业统一信用码")
|
||||
@Size(max = 50, message = "企业统一信用码长度不能超过50个字符")
|
||||
private String socialCreditCode;
|
||||
|
||||
@Schema(description = "职位")
|
||||
@Size(max = 100, message = "职位长度不能超过100个字符")
|
||||
private String position;
|
||||
|
||||
@Schema(description = "备注")
|
||||
@Size(max = 500, message = "备注长度不能超过500个字符")
|
||||
private String remark;
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
package com.ruoyi.info.collection.domain.excel;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.alibaba.excel.annotation.write.style.ColumnWidth;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 账户库导入导出对象
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-04-14
|
||||
*/
|
||||
@Data
|
||||
public class CcdiAccountInfoExcel implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ExcelProperty(value = "所属人类型*", index = 0)
|
||||
@ColumnWidth(16)
|
||||
private String ownerType;
|
||||
|
||||
@ExcelProperty(value = "证件号*", index = 1)
|
||||
@ColumnWidth(24)
|
||||
private String ownerId;
|
||||
|
||||
@ExcelProperty(value = "账户姓名*", index = 2)
|
||||
@ColumnWidth(18)
|
||||
private String accountName;
|
||||
|
||||
@ExcelProperty(value = "账户号码*", index = 3)
|
||||
@ColumnWidth(28)
|
||||
private String accountNo;
|
||||
|
||||
@ExcelProperty(value = "账户类型*", index = 4)
|
||||
@ColumnWidth(16)
|
||||
private String accountType;
|
||||
|
||||
@ExcelProperty(value = "账户范围*", index = 5)
|
||||
@ColumnWidth(14)
|
||||
private String bankScope;
|
||||
|
||||
@ExcelProperty(value = "开户机构*", index = 6)
|
||||
@ColumnWidth(28)
|
||||
private String openBank;
|
||||
|
||||
@ExcelProperty(value = "银行代码", index = 7)
|
||||
@ColumnWidth(16)
|
||||
private String bankCode;
|
||||
|
||||
@ExcelProperty(value = "币种", index = 8)
|
||||
@ColumnWidth(10)
|
||||
private String currency;
|
||||
|
||||
@ExcelProperty(value = "状态*", index = 9)
|
||||
@ColumnWidth(12)
|
||||
private String status;
|
||||
|
||||
@ExcelProperty(value = "生效日期*(yyyy-MM-dd)", index = 10)
|
||||
@ColumnWidth(18)
|
||||
private String effectiveDate;
|
||||
|
||||
@ExcelProperty(value = "失效日期(yyyy-MM-dd)", index = 11)
|
||||
@ColumnWidth(18)
|
||||
private String invalidDate;
|
||||
|
||||
@ExcelProperty(value = "是否实控账户", index = 12)
|
||||
@ColumnWidth(14)
|
||||
private String isActualControl;
|
||||
|
||||
@ExcelProperty(value = "月均交易笔数", index = 13)
|
||||
@ColumnWidth(14)
|
||||
private String avgMonthTxnCount;
|
||||
|
||||
@ExcelProperty(value = "月均交易金额", index = 14)
|
||||
@ColumnWidth(16)
|
||||
private String avgMonthTxnAmount;
|
||||
|
||||
@ExcelProperty(value = "频率等级", index = 15)
|
||||
@ColumnWidth(12)
|
||||
private String txnFrequencyLevel;
|
||||
|
||||
@ExcelProperty(value = "借方单笔最高额", index = 16)
|
||||
@ColumnWidth(16)
|
||||
private String debitSingleMaxAmount;
|
||||
|
||||
@ExcelProperty(value = "贷方单笔最高额", index = 17)
|
||||
@ColumnWidth(16)
|
||||
private String creditSingleMaxAmount;
|
||||
|
||||
@ExcelProperty(value = "借方日累计最高额", index = 18)
|
||||
@ColumnWidth(16)
|
||||
private String debitDailyMaxAmount;
|
||||
|
||||
@ExcelProperty(value = "贷方日累计最高额", index = 19)
|
||||
@ColumnWidth(16)
|
||||
private String creditDailyMaxAmount;
|
||||
|
||||
@ExcelProperty(value = "风险等级", index = 20)
|
||||
@ColumnWidth(12)
|
||||
private String txnRiskLevel;
|
||||
}
|
||||
@@ -63,8 +63,15 @@ public class CcdiBaseStaffExcel implements Serializable {
|
||||
@ColumnWidth(15)
|
||||
private Date hireDate;
|
||||
|
||||
/** 是否党员 */
|
||||
@ExcelProperty(value = "是否党员", index = 7)
|
||||
@ColumnWidth(12)
|
||||
@DictDropdown(dictType = "ccdi_yes_no_flag")
|
||||
@Required
|
||||
private Integer partyMember;
|
||||
|
||||
/** 状态 */
|
||||
@ExcelProperty(value = "状态", index = 7)
|
||||
@ExcelProperty(value = "状态", index = 8)
|
||||
@ColumnWidth(10)
|
||||
@DictDropdown(dictType = "ccdi_employee_status")
|
||||
@Required
|
||||
|
||||
@@ -0,0 +1,106 @@
|
||||
package com.ruoyi.info.collection.domain.excel;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.alibaba.excel.annotation.write.style.ColumnWidth;
|
||||
import com.ruoyi.common.annotation.DictDropdown;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 实体库管理 Excel 导入模板对象
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-04-17
|
||||
*/
|
||||
@Data
|
||||
public class CcdiEnterpriseBaseInfoExcel implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ExcelProperty(value = "统一社会信用代码*", index = 0)
|
||||
@ColumnWidth(24)
|
||||
private String socialCreditCode;
|
||||
|
||||
@ExcelProperty(value = "企业名称*", index = 1)
|
||||
@ColumnWidth(30)
|
||||
private String enterpriseName;
|
||||
|
||||
@ExcelProperty(value = "企业类型", index = 2)
|
||||
@ColumnWidth(18)
|
||||
@DictDropdown(dictType = "ccdi_entity_type")
|
||||
private String enterpriseType;
|
||||
|
||||
@ExcelProperty(value = "企业性质", index = 3)
|
||||
@ColumnWidth(18)
|
||||
@DictDropdown(dictType = "ccdi_enterprise_nature")
|
||||
private String enterpriseNature;
|
||||
|
||||
@ExcelProperty(value = "行业分类", index = 4)
|
||||
@ColumnWidth(18)
|
||||
private String industryClass;
|
||||
|
||||
@ExcelProperty(value = "所属行业", index = 5)
|
||||
@ColumnWidth(18)
|
||||
private String industryName;
|
||||
|
||||
@ExcelProperty(value = "成立日期", index = 6)
|
||||
@ColumnWidth(16)
|
||||
private Date establishDate;
|
||||
|
||||
@ExcelProperty(value = "注册地址", index = 7)
|
||||
@ColumnWidth(36)
|
||||
private String registerAddress;
|
||||
|
||||
@ExcelProperty(value = "法定代表人", index = 8)
|
||||
@ColumnWidth(18)
|
||||
private String legalRepresentative;
|
||||
|
||||
@ExcelProperty(value = "法定代表人证件类型", index = 9)
|
||||
@ColumnWidth(22)
|
||||
@DictDropdown(dictType = "ccdi_certificate_type")
|
||||
private String legalCertType;
|
||||
|
||||
@ExcelProperty(value = "法定代表人证件号码", index = 10)
|
||||
@ColumnWidth(24)
|
||||
private String legalCertNo;
|
||||
|
||||
@ExcelProperty(value = "股东1", index = 11)
|
||||
@ColumnWidth(18)
|
||||
private String shareholder1;
|
||||
|
||||
@ExcelProperty(value = "股东2", index = 12)
|
||||
@ColumnWidth(18)
|
||||
private String shareholder2;
|
||||
|
||||
@ExcelProperty(value = "股东3", index = 13)
|
||||
@ColumnWidth(18)
|
||||
private String shareholder3;
|
||||
|
||||
@ExcelProperty(value = "股东4", index = 14)
|
||||
@ColumnWidth(18)
|
||||
private String shareholder4;
|
||||
|
||||
@ExcelProperty(value = "股东5", index = 15)
|
||||
@ColumnWidth(18)
|
||||
private String shareholder5;
|
||||
|
||||
@ExcelProperty(value = "经营状态*", index = 16)
|
||||
@ColumnWidth(16)
|
||||
private String status;
|
||||
|
||||
@ExcelProperty(value = "风险等级*", index = 17)
|
||||
@ColumnWidth(16)
|
||||
private String riskLevel;
|
||||
|
||||
@ExcelProperty(value = "企业来源*", index = 18)
|
||||
@ColumnWidth(18)
|
||||
private String entSource;
|
||||
|
||||
@ExcelProperty(value = "数据来源*", index = 19)
|
||||
@ColumnWidth(18)
|
||||
private String dataSource;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.ruoyi.info.collection.domain.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 账户库导入失败记录
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-04-14
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "账户库导入失败记录")
|
||||
public class AccountInfoImportFailureVO {
|
||||
|
||||
@Schema(description = "行号")
|
||||
private Integer rowNum;
|
||||
|
||||
@Schema(description = "所属人类型")
|
||||
private String ownerType;
|
||||
|
||||
@Schema(description = "证件号")
|
||||
private String ownerId;
|
||||
|
||||
@Schema(description = "账户号码")
|
||||
private String accountNo;
|
||||
|
||||
@Schema(description = "错误信息")
|
||||
private String errorMessage;
|
||||
}
|
||||
@@ -0,0 +1,156 @@
|
||||
package com.ruoyi.info.collection.domain.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 账户库VO
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-04-13
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "账户库信息")
|
||||
public class CcdiAccountInfoVO implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键ID */
|
||||
@Schema(description = "主键ID")
|
||||
private Long id;
|
||||
|
||||
/** 所属人类型 */
|
||||
@Schema(description = "所属人类型")
|
||||
private String ownerType;
|
||||
|
||||
/** 所属人标识 */
|
||||
@Schema(description = "所属人标识")
|
||||
private String ownerId;
|
||||
|
||||
/** 员工工号 */
|
||||
@Schema(description = "员工工号")
|
||||
private Long staffId;
|
||||
|
||||
/** 员工姓名 */
|
||||
@Schema(description = "员工姓名")
|
||||
private String staffName;
|
||||
|
||||
/** 关系人ID */
|
||||
@Schema(description = "关系人ID")
|
||||
private Long relationId;
|
||||
|
||||
/** 关系类型 */
|
||||
@Schema(description = "关系类型")
|
||||
private String relationType;
|
||||
|
||||
/** 关系人姓名 */
|
||||
@Schema(description = "关系人姓名")
|
||||
private String relationName;
|
||||
|
||||
/** 关系人证件号 */
|
||||
@Schema(description = "关系人证件号")
|
||||
private String relationCertNo;
|
||||
|
||||
/** 账户号码 */
|
||||
@Schema(description = "账户号码")
|
||||
private String accountNo;
|
||||
|
||||
/** 账户类型 */
|
||||
@Schema(description = "账户类型")
|
||||
private String accountType;
|
||||
|
||||
/** 账户范围 */
|
||||
@Schema(description = "账户范围")
|
||||
private String bankScope;
|
||||
|
||||
/** 账户姓名 */
|
||||
@Schema(description = "账户姓名")
|
||||
private String accountName;
|
||||
|
||||
/** 开户机构 */
|
||||
@Schema(description = "开户机构")
|
||||
private String openBank;
|
||||
|
||||
/** 银行代码 */
|
||||
@Schema(description = "银行代码")
|
||||
private String bankCode;
|
||||
|
||||
/** 币种 */
|
||||
@Schema(description = "币种")
|
||||
private String currency;
|
||||
|
||||
/** 状态 */
|
||||
@Schema(description = "状态")
|
||||
private Integer status;
|
||||
|
||||
/** 生效日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Schema(description = "生效日期")
|
||||
private Date effectiveDate;
|
||||
|
||||
/** 失效日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Schema(description = "失效日期")
|
||||
private Date invalidDate;
|
||||
|
||||
/** 是否实控账户 */
|
||||
@Schema(description = "是否实控账户")
|
||||
private Integer isActualControl;
|
||||
|
||||
/** 月均交易笔数 */
|
||||
@Schema(description = "月均交易笔数")
|
||||
private Integer avgMonthTxnCount;
|
||||
|
||||
/** 月均交易金额 */
|
||||
@Schema(description = "月均交易金额")
|
||||
private BigDecimal avgMonthTxnAmount;
|
||||
|
||||
/** 频率等级 */
|
||||
@Schema(description = "频率等级")
|
||||
private String txnFrequencyLevel;
|
||||
|
||||
/** 借方单笔最高额 */
|
||||
@Schema(description = "借方单笔最高额")
|
||||
private BigDecimal debitSingleMaxAmount;
|
||||
|
||||
/** 贷方单笔最高额 */
|
||||
@Schema(description = "贷方单笔最高额")
|
||||
private BigDecimal creditSingleMaxAmount;
|
||||
|
||||
/** 借方日累计最高额 */
|
||||
@Schema(description = "借方日累计最高额")
|
||||
private BigDecimal debitDailyMaxAmount;
|
||||
|
||||
/** 贷方日累计最高额 */
|
||||
@Schema(description = "贷方日累计最高额")
|
||||
private BigDecimal creditDailyMaxAmount;
|
||||
|
||||
/** 风险等级 */
|
||||
@Schema(description = "风险等级")
|
||||
private String txnRiskLevel;
|
||||
|
||||
/** 创建者 */
|
||||
@Schema(description = "创建者")
|
||||
private String createBy;
|
||||
|
||||
/** 创建时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Schema(description = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
/** 更新者 */
|
||||
@Schema(description = "更新者")
|
||||
private String updateBy;
|
||||
|
||||
/** 更新时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Schema(description = "更新时间")
|
||||
private Date updateTime;
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.ruoyi.info.collection.domain.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 账户库关系人下拉VO
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-04-13
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "账户库关系人下拉选项")
|
||||
public class CcdiAccountRelationOptionVO implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 关系人ID */
|
||||
@Schema(description = "关系人ID")
|
||||
private Long id;
|
||||
|
||||
/** 关系人姓名 */
|
||||
@Schema(description = "关系人姓名")
|
||||
private String relationName;
|
||||
|
||||
/** 关系类型 */
|
||||
@Schema(description = "关系类型")
|
||||
private String relationType;
|
||||
|
||||
/** 关系人证件号 */
|
||||
@Schema(description = "关系人证件号")
|
||||
private String relationCertNo;
|
||||
}
|
||||
@@ -26,6 +26,11 @@ public class CcdiBaseStaffOptionVO {
|
||||
*/
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 身份证号
|
||||
*/
|
||||
private String idCard;
|
||||
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
|
||||
@@ -44,6 +44,9 @@ public class CcdiBaseStaffVO implements Serializable {
|
||||
/** 入职时间 */
|
||||
private Date hireDate;
|
||||
|
||||
/** 是否党员:0-否 1-是 */
|
||||
private Integer partyMember;
|
||||
|
||||
/** 状态 */
|
||||
private String status;
|
||||
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
package com.ruoyi.info.collection.domain.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 实体库管理 VO
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-04-17
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "实体库管理VO")
|
||||
public class CcdiEnterpriseBaseInfoVO implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "统一社会信用代码")
|
||||
private String socialCreditCode;
|
||||
|
||||
@Schema(description = "企业名称")
|
||||
private String enterpriseName;
|
||||
|
||||
@Schema(description = "企业类型")
|
||||
private String enterpriseType;
|
||||
|
||||
@Schema(description = "企业性质")
|
||||
private String enterpriseNature;
|
||||
|
||||
@Schema(description = "行业分类")
|
||||
private String industryClass;
|
||||
|
||||
@Schema(description = "所属行业")
|
||||
private String industryName;
|
||||
|
||||
@Schema(description = "成立日期")
|
||||
private Date establishDate;
|
||||
|
||||
@Schema(description = "注册地址")
|
||||
private String registerAddress;
|
||||
|
||||
@Schema(description = "法定代表人")
|
||||
private String legalRepresentative;
|
||||
|
||||
@Schema(description = "法定代表人证件类型")
|
||||
private String legalCertType;
|
||||
|
||||
@Schema(description = "法定代表人证件号码")
|
||||
private String legalCertNo;
|
||||
|
||||
@Schema(description = "股东1")
|
||||
private String shareholder1;
|
||||
|
||||
@Schema(description = "股东2")
|
||||
private String shareholder2;
|
||||
|
||||
@Schema(description = "股东3")
|
||||
private String shareholder3;
|
||||
|
||||
@Schema(description = "股东4")
|
||||
private String shareholder4;
|
||||
|
||||
@Schema(description = "股东5")
|
||||
private String shareholder5;
|
||||
|
||||
@Schema(description = "经营状态")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "风险等级")
|
||||
private String riskLevel;
|
||||
|
||||
@Schema(description = "企业来源")
|
||||
private String entSource;
|
||||
|
||||
@Schema(description = "数据来源")
|
||||
private String dataSource;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private Date createTime;
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.ruoyi.info.collection.domain.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 中介关联机构VO
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "中介关联机构VO")
|
||||
public class CcdiIntermediaryEnterpriseRelationVO implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "主键ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "所属中介ID")
|
||||
private String intermediaryBizId;
|
||||
|
||||
@Schema(description = "所属中介姓名")
|
||||
private String intermediaryName;
|
||||
|
||||
@Schema(description = "所属中介证件号")
|
||||
private String intermediaryPersonId;
|
||||
|
||||
@Schema(description = "统一社会信用代码")
|
||||
private String socialCreditCode;
|
||||
|
||||
@Schema(description = "机构名称")
|
||||
private String enterpriseName;
|
||||
|
||||
@Schema(description = "关联角色/职务")
|
||||
private String relationPersonPost;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.ruoyi.info.collection.domain.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 中介亲属VO
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "中介亲属VO")
|
||||
public class CcdiIntermediaryRelativeVO implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "人员ID")
|
||||
private String bizId;
|
||||
|
||||
@Schema(description = "所属中介ID")
|
||||
private String relatedNumId;
|
||||
|
||||
@Schema(description = "姓名")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "人员类型")
|
||||
private String personType;
|
||||
|
||||
@Schema(description = "亲属关系")
|
||||
private String personSubType;
|
||||
|
||||
@Schema(description = "性别")
|
||||
private String gender;
|
||||
|
||||
@Schema(description = "证件类型")
|
||||
private String idType;
|
||||
|
||||
@Schema(description = "证件号码")
|
||||
private String personId;
|
||||
|
||||
@Schema(description = "手机号码")
|
||||
private String mobile;
|
||||
|
||||
@Schema(description = "微信号")
|
||||
private String wechatNo;
|
||||
|
||||
@Schema(description = "联系地址")
|
||||
private String contactAddress;
|
||||
|
||||
@Schema(description = "所在公司")
|
||||
private String company;
|
||||
|
||||
@Schema(description = "企业统一信用码")
|
||||
private String socialCreditCode;
|
||||
|
||||
@Schema(description = "职位")
|
||||
private String position;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.ruoyi.info.collection.domain.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 实体库导入失败记录 VO
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-04-17
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "实体库导入失败记录")
|
||||
public class EnterpriseBaseInfoImportFailureVO {
|
||||
|
||||
@Schema(description = "企业名称")
|
||||
private String enterpriseName;
|
||||
|
||||
@Schema(description = "统一社会信用代码")
|
||||
private String socialCreditCode;
|
||||
|
||||
@Schema(description = "企业类型")
|
||||
private String enterpriseType;
|
||||
|
||||
@Schema(description = "企业性质")
|
||||
private String enterpriseNature;
|
||||
|
||||
@Schema(description = "行业分类")
|
||||
private String industryClass;
|
||||
|
||||
@Schema(description = "所属行业")
|
||||
private String industryName;
|
||||
|
||||
@Schema(description = "法定代表人")
|
||||
private String legalRepresentative;
|
||||
|
||||
@Schema(description = "经营状态")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "风险等级")
|
||||
private String riskLevel;
|
||||
|
||||
@Schema(description = "企业来源")
|
||||
private String entSource;
|
||||
|
||||
@Schema(description = "数据来源")
|
||||
private String dataSource;
|
||||
|
||||
@Schema(description = "错误信息")
|
||||
private String errorMessage;
|
||||
}
|
||||
@@ -32,6 +32,9 @@ public class ImportFailureVO {
|
||||
@Schema(description = "年收入")
|
||||
private BigDecimal annualIncome;
|
||||
|
||||
@Schema(description = "是否党员:0-否 1-是")
|
||||
private Integer partyMember;
|
||||
|
||||
@Schema(description = "状态")
|
||||
private String status;
|
||||
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
package com.ruoyi.info.collection.enums;
|
||||
|
||||
/**
|
||||
* 实体风险等级枚举
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public enum EnterpriseRiskLevel {
|
||||
|
||||
HIGH("1", "高风险"),
|
||||
MEDIUM("2", "中风险"),
|
||||
LOW("3", "低风险");
|
||||
|
||||
private final String code;
|
||||
private final String desc;
|
||||
|
||||
EnterpriseRiskLevel(String code, String desc) {
|
||||
this.code = code;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
public static String getDescByCode(String code) {
|
||||
for (EnterpriseRiskLevel value : values()) {
|
||||
if (value.code.equals(code)) {
|
||||
return value.desc;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static boolean contains(String code) {
|
||||
for (EnterpriseRiskLevel value : values()) {
|
||||
if (value.code.equals(code)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static String resolveCode(String value) {
|
||||
for (EnterpriseRiskLevel item : values()) {
|
||||
if (item.code.equals(value) || item.desc.equals(value)) {
|
||||
return item.code;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.ruoyi.info.collection.enums;
|
||||
|
||||
/**
|
||||
* 企业来源枚举
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public enum EnterpriseSource {
|
||||
|
||||
GENERAL("GENERAL", "一般企业"),
|
||||
EMP_RELATION("EMP_RELATION", "员工关系人"),
|
||||
CREDIT_CUSTOMER("CREDIT_CUSTOMER", "信贷客户"),
|
||||
INTERMEDIARY("INTERMEDIARY", "中介"),
|
||||
BOTH("BOTH", "兼有");
|
||||
|
||||
private final String code;
|
||||
private final String desc;
|
||||
|
||||
EnterpriseSource(String code, String desc) {
|
||||
this.code = code;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
public static String getDescByCode(String code) {
|
||||
for (EnterpriseSource value : values()) {
|
||||
if (value.code.equals(code)) {
|
||||
return value.desc;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static boolean contains(String code) {
|
||||
for (EnterpriseSource value : values()) {
|
||||
if (value.code.equals(code)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static String resolveCode(String value) {
|
||||
for (EnterpriseSource item : values()) {
|
||||
if (item.code.equals(value) || item.desc.equals(value)) {
|
||||
return item.code;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -11,26 +11,26 @@ public enum RelationType {
|
||||
/** 配偶 */
|
||||
SPOUSE("配偶", "配偶"),
|
||||
|
||||
/** 父子 */
|
||||
FATHER_SON("父子", "父子"),
|
||||
/** 父亲 */
|
||||
FATHER("父亲", "父亲"),
|
||||
|
||||
/** 母女 */
|
||||
MOTHER_DAUGHTER("母女", "母女"),
|
||||
/** 母亲 */
|
||||
MOTHER("母亲", "母亲"),
|
||||
|
||||
/** 兄弟 */
|
||||
BROTHER("兄弟", "兄弟"),
|
||||
/** 子女 */
|
||||
CHILDREN("子女", "子女"),
|
||||
|
||||
/** 姐妹 */
|
||||
SISTER("姐妹", "姐妹"),
|
||||
|
||||
/** 亲属 */
|
||||
RELATIVE("亲属", "亲属"),
|
||||
/** 兄弟姐妹 */
|
||||
SIBLINGS("兄弟姐妹", "兄弟姐妹"),
|
||||
|
||||
/** 朋友 */
|
||||
FRIEND("朋友", "朋友"),
|
||||
|
||||
/** 同事 */
|
||||
COLLEAGUE("同事", "同事");
|
||||
COLLEAGUE("同事", "同事"),
|
||||
|
||||
/** 其他 */
|
||||
OTHER("其他", "其他");
|
||||
|
||||
private final String code;
|
||||
private final String desc;
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.ruoyi.info.collection.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.info.collection.domain.CcdiAccountInfo;
|
||||
import com.ruoyi.info.collection.domain.dto.CcdiAccountInfoQueryDTO;
|
||||
import com.ruoyi.info.collection.domain.vo.CcdiAccountInfoVO;
|
||||
import com.ruoyi.info.collection.domain.vo.CcdiAccountRelationOptionVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 账户库数据层
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-04-13
|
||||
*/
|
||||
public interface CcdiAccountInfoMapper extends BaseMapper<CcdiAccountInfo> {
|
||||
|
||||
/**
|
||||
* 分页查询账户库
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param queryDTO 查询条件
|
||||
* @return 账户库分页结果
|
||||
*/
|
||||
Page<CcdiAccountInfoVO> selectAccountInfoPage(@Param("page") Page<CcdiAccountInfoVO> page,
|
||||
@Param("query") CcdiAccountInfoQueryDTO queryDTO);
|
||||
|
||||
/**
|
||||
* 查询账户库详情
|
||||
*
|
||||
* @param id 主键ID
|
||||
* @return 账户库详情
|
||||
*/
|
||||
CcdiAccountInfoVO selectAccountInfoById(@Param("id") Long id);
|
||||
|
||||
/**
|
||||
* 导出账户库列表
|
||||
*
|
||||
* @param queryDTO 查询条件
|
||||
* @return 导出列表
|
||||
*/
|
||||
List<CcdiAccountInfoVO> selectAccountInfoListForExport(@Param("query") CcdiAccountInfoQueryDTO queryDTO);
|
||||
|
||||
/**
|
||||
* 查询关系人下拉选项
|
||||
*
|
||||
* @param staffId 员工工号
|
||||
* @return 关系人下拉
|
||||
*/
|
||||
List<CcdiAccountRelationOptionVO> selectRelationOptionsByStaffId(@Param("staffId") Long staffId);
|
||||
}
|
||||
@@ -1,7 +1,10 @@
|
||||
package com.ruoyi.info.collection.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.info.collection.domain.CcdiEnterpriseBaseInfo;
|
||||
import com.ruoyi.info.collection.domain.dto.CcdiEnterpriseBaseInfoQueryDTO;
|
||||
import com.ruoyi.info.collection.domain.vo.CcdiEnterpriseBaseInfoVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@@ -16,6 +19,16 @@ import java.util.List;
|
||||
@Mapper
|
||||
public interface CcdiEnterpriseBaseInfoMapper extends BaseMapper<CcdiEnterpriseBaseInfo> {
|
||||
|
||||
/**
|
||||
* 分页查询实体库列表
|
||||
*
|
||||
* @param page 分页参数
|
||||
* @param queryDTO 查询条件
|
||||
* @return 分页结果
|
||||
*/
|
||||
Page<CcdiEnterpriseBaseInfoVO> selectEnterpriseBaseInfoPage(Page<CcdiEnterpriseBaseInfoVO> page,
|
||||
@Param("queryDTO") CcdiEnterpriseBaseInfoQueryDTO queryDTO);
|
||||
|
||||
/**
|
||||
* 批量插入实体中介
|
||||
*
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.ruoyi.info.collection.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.ruoyi.info.collection.domain.CcdiIntermediaryEnterpriseRelation;
|
||||
import com.ruoyi.info.collection.domain.vo.CcdiIntermediaryEnterpriseRelationVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 中介关联机构关系Mapper
|
||||
*/
|
||||
@Mapper
|
||||
public interface CcdiIntermediaryEnterpriseRelationMapper extends BaseMapper<CcdiIntermediaryEnterpriseRelation> {
|
||||
|
||||
List<CcdiIntermediaryEnterpriseRelationVO> selectByIntermediaryBizId(@Param("bizId") String bizId);
|
||||
|
||||
CcdiIntermediaryEnterpriseRelationVO selectDetailById(@Param("id") Long id);
|
||||
|
||||
boolean existsByIntermediaryBizIdAndSocialCreditCode(@Param("bizId") String bizId,
|
||||
@Param("socialCreditCode") String socialCreditCode);
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
package com.ruoyi.info.collection.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.info.collection.domain.dto.CcdiAccountInfoAddDTO;
|
||||
import com.ruoyi.info.collection.domain.dto.CcdiAccountInfoEditDTO;
|
||||
import com.ruoyi.info.collection.domain.dto.CcdiAccountInfoQueryDTO;
|
||||
import com.ruoyi.info.collection.domain.excel.CcdiAccountInfoExcel;
|
||||
import com.ruoyi.info.collection.domain.vo.AccountInfoImportFailureVO;
|
||||
import com.ruoyi.info.collection.domain.vo.CcdiAccountInfoVO;
|
||||
import com.ruoyi.info.collection.domain.vo.CcdiAccountRelationOptionVO;
|
||||
import com.ruoyi.info.collection.domain.vo.ImportResult;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 账户库服务层
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-04-13
|
||||
*/
|
||||
public interface ICcdiAccountInfoService {
|
||||
|
||||
/**
|
||||
* 分页查询账户库
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param queryDTO 查询条件
|
||||
* @return 分页结果
|
||||
*/
|
||||
Page<CcdiAccountInfoVO> selectAccountInfoPage(Page<CcdiAccountInfoVO> page, CcdiAccountInfoQueryDTO queryDTO);
|
||||
|
||||
/**
|
||||
* 查询账户库详情
|
||||
*
|
||||
* @param id 主键ID
|
||||
* @return 账户库详情
|
||||
*/
|
||||
CcdiAccountInfoVO selectAccountInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 新增账户
|
||||
*
|
||||
* @param addDTO 新增DTO
|
||||
* @return 影响行数
|
||||
*/
|
||||
int insertAccountInfo(CcdiAccountInfoAddDTO addDTO);
|
||||
|
||||
/**
|
||||
* 修改账户
|
||||
*
|
||||
* @param editDTO 编辑DTO
|
||||
* @return 影响行数
|
||||
*/
|
||||
int updateAccountInfo(CcdiAccountInfoEditDTO editDTO);
|
||||
|
||||
/**
|
||||
* 批量删除账户
|
||||
*
|
||||
* @param ids 主键ID数组
|
||||
* @return 影响行数
|
||||
*/
|
||||
int deleteAccountInfoByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 查询关系人下拉
|
||||
*
|
||||
* @param staffId 员工工号
|
||||
* @return 下拉列表
|
||||
*/
|
||||
List<CcdiAccountRelationOptionVO> selectRelationOptionsByStaffId(Long staffId);
|
||||
|
||||
/**
|
||||
* 导出账户库列表
|
||||
*
|
||||
* @param queryDTO 查询条件
|
||||
* @return 导出列表
|
||||
*/
|
||||
List<CcdiAccountInfoExcel> selectAccountInfoListForExport(CcdiAccountInfoQueryDTO queryDTO);
|
||||
|
||||
/**
|
||||
* 导入账户库信息
|
||||
*
|
||||
* @param excelList Excel数据
|
||||
* @param updateSupport 是否更新已存在账户
|
||||
* @return 导入结果
|
||||
*/
|
||||
ImportResult importAccountInfo(List<CcdiAccountInfoExcel> excelList, boolean updateSupport);
|
||||
|
||||
/**
|
||||
* 获取导入失败记录
|
||||
*
|
||||
* @return 失败记录
|
||||
*/
|
||||
List<AccountInfoImportFailureVO> getLatestImportFailures();
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.ruoyi.info.collection.service;
|
||||
|
||||
import com.ruoyi.info.collection.domain.CcdiEnterpriseBaseInfo;
|
||||
import com.ruoyi.info.collection.domain.excel.CcdiEnterpriseBaseInfoExcel;
|
||||
import com.ruoyi.info.collection.domain.vo.EnterpriseBaseInfoImportFailureVO;
|
||||
import com.ruoyi.info.collection.domain.vo.ImportStatusVO;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 实体库管理导入 Service 接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-04-17
|
||||
*/
|
||||
public interface ICcdiEnterpriseBaseInfoImportService {
|
||||
|
||||
void importEnterpriseBaseInfoAsync(List<CcdiEnterpriseBaseInfoExcel> excelList, String taskId, String userName);
|
||||
|
||||
ImportStatusVO getImportStatus(String taskId);
|
||||
|
||||
List<EnterpriseBaseInfoImportFailureVO> getImportFailures(String taskId);
|
||||
|
||||
CcdiEnterpriseBaseInfo validateAndBuildEntity(CcdiEnterpriseBaseInfoExcel excel,
|
||||
Set<String> existingCreditCodes,
|
||||
Set<String> processedCreditCodes,
|
||||
String userName);
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.ruoyi.info.collection.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.info.collection.domain.dto.CcdiEnterpriseBaseInfoAddDTO;
|
||||
import com.ruoyi.info.collection.domain.dto.CcdiEnterpriseBaseInfoEditDTO;
|
||||
import com.ruoyi.info.collection.domain.dto.CcdiEnterpriseBaseInfoQueryDTO;
|
||||
import com.ruoyi.info.collection.domain.excel.CcdiEnterpriseBaseInfoExcel;
|
||||
import com.ruoyi.info.collection.domain.vo.CcdiEnterpriseBaseInfoVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 实体库管理 Service 接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-04-17
|
||||
*/
|
||||
public interface ICcdiEnterpriseBaseInfoService {
|
||||
|
||||
Page<CcdiEnterpriseBaseInfoVO> selectEnterpriseBaseInfoPage(Page<CcdiEnterpriseBaseInfoVO> page,
|
||||
CcdiEnterpriseBaseInfoQueryDTO queryDTO);
|
||||
|
||||
CcdiEnterpriseBaseInfoVO selectEnterpriseBaseInfoById(String socialCreditCode);
|
||||
|
||||
int insertEnterpriseBaseInfo(CcdiEnterpriseBaseInfoAddDTO addDTO);
|
||||
|
||||
int updateEnterpriseBaseInfo(CcdiEnterpriseBaseInfoEditDTO editDTO);
|
||||
|
||||
int deleteEnterpriseBaseInfoByIds(String[] socialCreditCodes);
|
||||
|
||||
List<CcdiEnterpriseBaseInfoExcel> selectEnterpriseBaseInfoListForExport(CcdiEnterpriseBaseInfoQueryDTO queryDTO);
|
||||
|
||||
String importEnterpriseBaseInfo(List<CcdiEnterpriseBaseInfoExcel> excelList);
|
||||
}
|
||||
@@ -0,0 +1,586 @@
|
||||
package com.ruoyi.info.collection.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.info.collection.domain.CcdiAccountInfo;
|
||||
import com.ruoyi.info.collection.domain.CcdiBaseStaff;
|
||||
import com.ruoyi.info.collection.domain.CcdiStaffFmyRelation;
|
||||
import com.ruoyi.info.collection.domain.dto.CcdiAccountInfoAddDTO;
|
||||
import com.ruoyi.info.collection.domain.dto.CcdiAccountInfoEditDTO;
|
||||
import com.ruoyi.info.collection.domain.dto.CcdiAccountInfoQueryDTO;
|
||||
import com.ruoyi.info.collection.domain.excel.CcdiAccountInfoExcel;
|
||||
import com.ruoyi.info.collection.domain.vo.AccountInfoImportFailureVO;
|
||||
import com.ruoyi.info.collection.domain.vo.CcdiAccountInfoVO;
|
||||
import com.ruoyi.info.collection.domain.vo.CcdiAccountRelationOptionVO;
|
||||
import com.ruoyi.info.collection.domain.vo.ImportResult;
|
||||
import com.ruoyi.info.collection.mapper.CcdiAccountInfoMapper;
|
||||
import com.ruoyi.info.collection.mapper.CcdiBaseStaffMapper;
|
||||
import com.ruoyi.info.collection.mapper.CcdiStaffFmyRelationMapper;
|
||||
import com.ruoyi.info.collection.service.ICcdiAccountInfoService;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
/**
|
||||
* 账户库服务实现
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-04-13
|
||||
*/
|
||||
@Service
|
||||
public class CcdiAccountInfoServiceImpl implements ICcdiAccountInfoService {
|
||||
|
||||
private static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd");
|
||||
|
||||
private static final Set<String> OWNER_TYPES = Set.of("EMPLOYEE", "RELATION", "INTERMEDIARY", "EXTERNAL");
|
||||
private static final Set<String> ACCOUNT_TYPES = Set.of("BANK", "SECURITIES", "PAYMENT", "OTHER");
|
||||
private static final Set<String> BANK_SCOPES = Set.of("INTERNAL", "EXTERNAL");
|
||||
private static final Set<String> LEVELS = Set.of("LOW", "MEDIUM", "HIGH");
|
||||
private final List<AccountInfoImportFailureVO> latestImportFailures = new CopyOnWriteArrayList<>();
|
||||
|
||||
@Resource
|
||||
private CcdiAccountInfoMapper accountInfoMapper;
|
||||
|
||||
@Resource
|
||||
private CcdiBaseStaffMapper baseStaffMapper;
|
||||
|
||||
@Resource
|
||||
private CcdiStaffFmyRelationMapper staffFmyRelationMapper;
|
||||
|
||||
@Override
|
||||
public Page<CcdiAccountInfoVO> selectAccountInfoPage(Page<CcdiAccountInfoVO> page, CcdiAccountInfoQueryDTO queryDTO) {
|
||||
return accountInfoMapper.selectAccountInfoPage(page, queryDTO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CcdiAccountInfoVO selectAccountInfoById(Long id) {
|
||||
return accountInfoMapper.selectAccountInfoById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public int insertAccountInfo(CcdiAccountInfoAddDTO addDTO) {
|
||||
normalizeAddDto(addDTO);
|
||||
validateDto(addDTO.getOwnerType(), addDTO.getOwnerId(), addDTO.getAccountType(), addDTO.getBankScope(),
|
||||
addDTO.getStatus(), addDTO.getEffectiveDate(), addDTO.getInvalidDate(), addDTO.getTxnFrequencyLevel(),
|
||||
addDTO.getTxnRiskLevel(), addDTO.getAvgMonthTxnAmount(), addDTO.getDebitSingleMaxAmount(),
|
||||
addDTO.getCreditSingleMaxAmount(), addDTO.getDebitDailyMaxAmount(), addDTO.getCreditDailyMaxAmount());
|
||||
validateDuplicateAccountNo(addDTO.getAccountNo(), null);
|
||||
|
||||
CcdiAccountInfo accountInfo = new CcdiAccountInfo();
|
||||
BeanUtils.copyProperties(addDTO, accountInfo);
|
||||
prepareAnalysisFields(accountInfo);
|
||||
return accountInfoMapper.insert(accountInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public int updateAccountInfo(CcdiAccountInfoEditDTO editDTO) {
|
||||
normalizeEditDto(editDTO);
|
||||
validateDto(editDTO.getOwnerType(), editDTO.getOwnerId(), editDTO.getAccountType(), editDTO.getBankScope(),
|
||||
editDTO.getStatus(), editDTO.getEffectiveDate(), editDTO.getInvalidDate(), editDTO.getTxnFrequencyLevel(),
|
||||
editDTO.getTxnRiskLevel(), editDTO.getAvgMonthTxnAmount(), editDTO.getDebitSingleMaxAmount(),
|
||||
editDTO.getCreditSingleMaxAmount(), editDTO.getDebitDailyMaxAmount(), editDTO.getCreditDailyMaxAmount());
|
||||
|
||||
CcdiAccountInfo existing = accountInfoMapper.selectById(editDTO.getId());
|
||||
if (existing == null) {
|
||||
throw new RuntimeException("账户不存在");
|
||||
}
|
||||
|
||||
validateDuplicateAccountNo(editDTO.getAccountNo(), editDTO.getId());
|
||||
|
||||
CcdiAccountInfo accountInfo = new CcdiAccountInfo();
|
||||
BeanUtils.copyProperties(editDTO, accountInfo);
|
||||
prepareAnalysisFields(accountInfo);
|
||||
return accountInfoMapper.updateById(accountInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public int deleteAccountInfoByIds(Long[] ids) {
|
||||
return accountInfoMapper.deleteBatchIds(Arrays.asList(ids));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CcdiAccountRelationOptionVO> selectRelationOptionsByStaffId(Long staffId) {
|
||||
if (staffId == null) {
|
||||
return List.of();
|
||||
}
|
||||
return accountInfoMapper.selectRelationOptionsByStaffId(staffId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CcdiAccountInfoExcel> selectAccountInfoListForExport(CcdiAccountInfoQueryDTO queryDTO) {
|
||||
return accountInfoMapper.selectAccountInfoListForExport(queryDTO).stream().map(this::toExcel).toList();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public ImportResult importAccountInfo(List<CcdiAccountInfoExcel> excelList, boolean updateSupport) {
|
||||
latestImportFailures.clear();
|
||||
ImportResult result = new ImportResult();
|
||||
result.setTotalCount(excelList.size());
|
||||
|
||||
int successCount = 0;
|
||||
int rowNum = 1;
|
||||
for (CcdiAccountInfoExcel excel : excelList) {
|
||||
rowNum++;
|
||||
try {
|
||||
importSingleRow(excel, updateSupport);
|
||||
successCount++;
|
||||
} catch (Exception e) {
|
||||
latestImportFailures.add(buildFailure(rowNum, excel, e.getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
result.setSuccessCount(successCount);
|
||||
result.setFailureCount(latestImportFailures.size());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AccountInfoImportFailureVO> getLatestImportFailures() {
|
||||
return new ArrayList<>(latestImportFailures);
|
||||
}
|
||||
|
||||
private void validateDto(String ownerType, String ownerId, String accountType, String bankScope, Integer status,
|
||||
java.util.Date effectiveDate, java.util.Date invalidDate, String txnFrequencyLevel,
|
||||
String txnRiskLevel, BigDecimal avgMonthTxnAmount, BigDecimal debitSingleMaxAmount,
|
||||
BigDecimal creditSingleMaxAmount, BigDecimal debitDailyMaxAmount,
|
||||
BigDecimal creditDailyMaxAmount) {
|
||||
if (!OWNER_TYPES.contains(ownerType)) {
|
||||
throw new RuntimeException("所属人类型不合法");
|
||||
}
|
||||
if (!ACCOUNT_TYPES.contains(accountType)) {
|
||||
throw new RuntimeException("账户类型不合法");
|
||||
}
|
||||
if (!BANK_SCOPES.contains(bankScope)) {
|
||||
throw new RuntimeException("账户范围不合法");
|
||||
}
|
||||
if (status == null || (status != 1 && status != 2)) {
|
||||
throw new RuntimeException("状态不合法");
|
||||
}
|
||||
if (effectiveDate == null) {
|
||||
throw new RuntimeException("生效日期不能为空");
|
||||
}
|
||||
if (invalidDate != null && invalidDate.before(effectiveDate)) {
|
||||
throw new RuntimeException("失效日期不能早于生效日期");
|
||||
}
|
||||
if (StringUtils.isNotEmpty(txnFrequencyLevel) && !LEVELS.contains(txnFrequencyLevel)) {
|
||||
throw new RuntimeException("频率等级不合法");
|
||||
}
|
||||
if (StringUtils.isNotEmpty(txnRiskLevel) && !LEVELS.contains(txnRiskLevel)) {
|
||||
throw new RuntimeException("风险等级不合法");
|
||||
}
|
||||
validateAmount(avgMonthTxnAmount, "月均交易金额");
|
||||
validateAmount(debitSingleMaxAmount, "借方单笔最高额");
|
||||
validateAmount(creditSingleMaxAmount, "贷方单笔最高额");
|
||||
validateAmount(debitDailyMaxAmount, "借方日累计最高额");
|
||||
validateAmount(creditDailyMaxAmount, "贷方日累计最高额");
|
||||
validateOwner(ownerType, ownerId);
|
||||
}
|
||||
|
||||
private void validateOwner(String ownerType, String ownerId) {
|
||||
if (StringUtils.isEmpty(ownerId)) {
|
||||
if ("EXTERNAL".equals(ownerType) || "INTERMEDIARY".equals(ownerType)) {
|
||||
throw new RuntimeException("证件号不能为空");
|
||||
}
|
||||
throw new RuntimeException("所属人不能为空");
|
||||
}
|
||||
if ("EXTERNAL".equals(ownerType) || "INTERMEDIARY".equals(ownerType)) {
|
||||
return;
|
||||
}
|
||||
if ("EMPLOYEE".equals(ownerType)) {
|
||||
LambdaQueryWrapper<CcdiBaseStaff> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(CcdiBaseStaff::getIdCard, ownerId);
|
||||
CcdiBaseStaff staff = baseStaffMapper.selectOne(wrapper);
|
||||
if (staff == null) {
|
||||
throw new RuntimeException("员工不存在");
|
||||
}
|
||||
return;
|
||||
}
|
||||
LambdaQueryWrapper<CcdiStaffFmyRelation> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(CcdiStaffFmyRelation::getRelationCertNo, ownerId);
|
||||
CcdiStaffFmyRelation relation = staffFmyRelationMapper.selectOne(wrapper);
|
||||
if (relation == null) {
|
||||
throw new RuntimeException("关系人不存在");
|
||||
}
|
||||
}
|
||||
|
||||
private void validateDuplicateAccountNo(String accountNo, Long excludeId) {
|
||||
LambdaQueryWrapper<CcdiAccountInfo> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(CcdiAccountInfo::getAccountNo, accountNo);
|
||||
if (excludeId != null) {
|
||||
wrapper.ne(CcdiAccountInfo::getId, excludeId);
|
||||
}
|
||||
if (accountInfoMapper.selectCount(wrapper) > 0) {
|
||||
throw new RuntimeException("账户号码已存在");
|
||||
}
|
||||
}
|
||||
|
||||
private void prepareAnalysisFields(CcdiAccountInfo accountInfo) {
|
||||
if (!"EXTERNAL".equals(accountInfo.getBankScope())) {
|
||||
clearAnalysisFields(accountInfo);
|
||||
return;
|
||||
}
|
||||
if (accountInfo.getIsActualControl() == null) {
|
||||
accountInfo.setIsActualControl(1);
|
||||
}
|
||||
if (accountInfo.getAvgMonthTxnCount() == null) {
|
||||
accountInfo.setAvgMonthTxnCount(0);
|
||||
}
|
||||
if (accountInfo.getAvgMonthTxnAmount() == null) {
|
||||
accountInfo.setAvgMonthTxnAmount(BigDecimal.ZERO);
|
||||
}
|
||||
if (StringUtils.isEmpty(accountInfo.getTxnFrequencyLevel())) {
|
||||
accountInfo.setTxnFrequencyLevel("MEDIUM");
|
||||
}
|
||||
if (StringUtils.isEmpty(accountInfo.getTxnRiskLevel())) {
|
||||
accountInfo.setTxnRiskLevel("LOW");
|
||||
}
|
||||
}
|
||||
|
||||
private void clearAnalysisFields(CcdiAccountInfo accountInfo) {
|
||||
accountInfo.setIsActualControl(null);
|
||||
accountInfo.setAvgMonthTxnCount(null);
|
||||
accountInfo.setAvgMonthTxnAmount(null);
|
||||
accountInfo.setTxnFrequencyLevel(null);
|
||||
accountInfo.setDebitSingleMaxAmount(null);
|
||||
accountInfo.setCreditSingleMaxAmount(null);
|
||||
accountInfo.setDebitDailyMaxAmount(null);
|
||||
accountInfo.setCreditDailyMaxAmount(null);
|
||||
accountInfo.setTxnRiskLevel(null);
|
||||
}
|
||||
|
||||
private void validateAmount(BigDecimal amount, String fieldLabel) {
|
||||
if (amount == null) {
|
||||
return;
|
||||
}
|
||||
if (amount.compareTo(BigDecimal.ZERO) < 0) {
|
||||
throw new RuntimeException(fieldLabel + "不能为负数");
|
||||
}
|
||||
if (amount.scale() > 2) {
|
||||
throw new RuntimeException(fieldLabel + "最多保留2位小数");
|
||||
}
|
||||
}
|
||||
|
||||
private void normalizeAddDto(CcdiAccountInfoAddDTO addDTO) {
|
||||
addDTO.setOwnerType(toUpper(addDTO.getOwnerType()));
|
||||
addDTO.setAccountType(toUpper(addDTO.getAccountType()));
|
||||
addDTO.setBankScope(toUpper(addDTO.getBankScope()));
|
||||
addDTO.setCurrency(normalizeCurrency(addDTO.getCurrency()));
|
||||
addDTO.setTxnFrequencyLevel(toUpper(addDTO.getTxnFrequencyLevel()));
|
||||
addDTO.setTxnRiskLevel(toUpper(addDTO.getTxnRiskLevel()));
|
||||
addDTO.setOwnerId(normalizeOwnerId(addDTO.getOwnerId()));
|
||||
}
|
||||
|
||||
private void normalizeEditDto(CcdiAccountInfoEditDTO editDTO) {
|
||||
editDTO.setOwnerType(toUpper(editDTO.getOwnerType()));
|
||||
editDTO.setAccountType(toUpper(editDTO.getAccountType()));
|
||||
editDTO.setBankScope(toUpper(editDTO.getBankScope()));
|
||||
editDTO.setCurrency(normalizeCurrency(editDTO.getCurrency()));
|
||||
editDTO.setTxnFrequencyLevel(toUpper(editDTO.getTxnFrequencyLevel()));
|
||||
editDTO.setTxnRiskLevel(toUpper(editDTO.getTxnRiskLevel()));
|
||||
editDTO.setOwnerId(normalizeOwnerId(editDTO.getOwnerId()));
|
||||
}
|
||||
|
||||
private String normalizeCurrency(String currency) {
|
||||
if (StringUtils.isEmpty(currency)) {
|
||||
return "CNY";
|
||||
}
|
||||
return currency.trim().toUpperCase(Locale.ROOT);
|
||||
}
|
||||
|
||||
private String toUpper(String value) {
|
||||
if (StringUtils.isEmpty(value)) {
|
||||
return value;
|
||||
}
|
||||
return value.trim().toUpperCase(Locale.ROOT);
|
||||
}
|
||||
|
||||
private String normalizeOwnerId(String ownerId) {
|
||||
if (StringUtils.isEmpty(ownerId)) {
|
||||
return ownerId;
|
||||
}
|
||||
return ownerId.trim();
|
||||
}
|
||||
|
||||
private CcdiAccountInfoExcel toExcel(CcdiAccountInfoVO vo) {
|
||||
CcdiAccountInfoExcel excel = new CcdiAccountInfoExcel();
|
||||
excel.setOwnerType(ownerTypeLabel(vo.getOwnerType()));
|
||||
excel.setOwnerId(vo.getOwnerId());
|
||||
excel.setAccountName(vo.getAccountName());
|
||||
excel.setAccountNo(vo.getAccountNo());
|
||||
excel.setAccountType(accountTypeLabel(vo.getAccountType()));
|
||||
excel.setBankScope(bankScopeLabel(vo.getBankScope()));
|
||||
excel.setOpenBank(vo.getOpenBank());
|
||||
excel.setBankCode(vo.getBankCode());
|
||||
excel.setCurrency(vo.getCurrency());
|
||||
excel.setStatus(vo.getStatus() == null ? "" : (vo.getStatus() == 1 ? "正常" : "已销户"));
|
||||
excel.setEffectiveDate(formatDate(vo.getEffectiveDate()));
|
||||
excel.setInvalidDate(formatDate(vo.getInvalidDate()));
|
||||
excel.setIsActualControl(formatYesNo(vo.getIsActualControl()));
|
||||
excel.setAvgMonthTxnCount(vo.getAvgMonthTxnCount() == null ? "" : String.valueOf(vo.getAvgMonthTxnCount()));
|
||||
excel.setAvgMonthTxnAmount(formatNumber(vo.getAvgMonthTxnAmount()));
|
||||
excel.setTxnFrequencyLevel(StringUtils.isEmpty(vo.getTxnFrequencyLevel()) ? "" : vo.getTxnFrequencyLevel());
|
||||
excel.setDebitSingleMaxAmount(formatNumber(vo.getDebitSingleMaxAmount()));
|
||||
excel.setCreditSingleMaxAmount(formatNumber(vo.getCreditSingleMaxAmount()));
|
||||
excel.setDebitDailyMaxAmount(formatNumber(vo.getDebitDailyMaxAmount()));
|
||||
excel.setCreditDailyMaxAmount(formatNumber(vo.getCreditDailyMaxAmount()));
|
||||
excel.setTxnRiskLevel(StringUtils.isEmpty(vo.getTxnRiskLevel()) ? "" : vo.getTxnRiskLevel());
|
||||
return excel;
|
||||
}
|
||||
|
||||
private void importSingleRow(CcdiAccountInfoExcel excel, boolean updateSupport) {
|
||||
CcdiAccountInfo existing = findByAccountNo(excel.getAccountNo());
|
||||
if (existing != null && !updateSupport) {
|
||||
throw new RuntimeException("账户号码已存在,请勾选更新已存在数据后重试");
|
||||
}
|
||||
|
||||
if (existing != null) {
|
||||
CcdiAccountInfoEditDTO editDTO = toEditDto(existing.getId(), excel);
|
||||
updateAccountInfo(editDTO);
|
||||
return;
|
||||
}
|
||||
|
||||
CcdiAccountInfoAddDTO addDTO = toAddDto(excel);
|
||||
insertAccountInfo(addDTO);
|
||||
}
|
||||
|
||||
private CcdiAccountInfoAddDTO toAddDto(CcdiAccountInfoExcel excel) {
|
||||
CcdiAccountInfoAddDTO dto = new CcdiAccountInfoAddDTO();
|
||||
dto.setOwnerType(parseOwnerType(excel.getOwnerType()));
|
||||
dto.setOwnerId(normalizeOwnerId(excel.getOwnerId()));
|
||||
dto.setAccountName(trimToNull(excel.getAccountName()));
|
||||
dto.setAccountNo(trimToNull(excel.getAccountNo()));
|
||||
dto.setAccountType(parseAccountType(excel.getAccountType()));
|
||||
dto.setBankScope(parseBankScope(excel.getBankScope()));
|
||||
dto.setOpenBank(trimToNull(excel.getOpenBank()));
|
||||
dto.setBankCode(trimToNull(excel.getBankCode()));
|
||||
dto.setCurrency(normalizeCurrency(excel.getCurrency()));
|
||||
dto.setStatus(parseStatus(excel.getStatus()));
|
||||
dto.setEffectiveDate(parseDateRequired(excel.getEffectiveDate(), "生效日期"));
|
||||
dto.setInvalidDate(parseDateOptional(excel.getInvalidDate()));
|
||||
dto.setIsActualControl(parseBooleanFlag(excel.getIsActualControl(), 1));
|
||||
dto.setAvgMonthTxnCount(parseInteger(excel.getAvgMonthTxnCount()));
|
||||
dto.setAvgMonthTxnAmount(parseDecimal(excel.getAvgMonthTxnAmount()));
|
||||
dto.setTxnFrequencyLevel(parseLevel(excel.getTxnFrequencyLevel(), "频率等级"));
|
||||
dto.setDebitSingleMaxAmount(parseDecimal(excel.getDebitSingleMaxAmount()));
|
||||
dto.setCreditSingleMaxAmount(parseDecimal(excel.getCreditSingleMaxAmount()));
|
||||
dto.setDebitDailyMaxAmount(parseDecimal(excel.getDebitDailyMaxAmount()));
|
||||
dto.setCreditDailyMaxAmount(parseDecimal(excel.getCreditDailyMaxAmount()));
|
||||
dto.setTxnRiskLevel(parseLevel(excel.getTxnRiskLevel(), "风险等级"));
|
||||
return dto;
|
||||
}
|
||||
|
||||
private CcdiAccountInfoEditDTO toEditDto(Long id, CcdiAccountInfoExcel excel) {
|
||||
CcdiAccountInfoEditDTO dto = new CcdiAccountInfoEditDTO();
|
||||
BeanUtils.copyProperties(toAddDto(excel), dto);
|
||||
dto.setId(id);
|
||||
return dto;
|
||||
}
|
||||
|
||||
private CcdiAccountInfo findByAccountNo(String accountNo) {
|
||||
LambdaQueryWrapper<CcdiAccountInfo> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(CcdiAccountInfo::getAccountNo, trimToNull(accountNo));
|
||||
return accountInfoMapper.selectOne(wrapper);
|
||||
}
|
||||
|
||||
private AccountInfoImportFailureVO buildFailure(int rowNum, CcdiAccountInfoExcel excel, String errorMessage) {
|
||||
AccountInfoImportFailureVO failure = new AccountInfoImportFailureVO();
|
||||
failure.setRowNum(rowNum);
|
||||
failure.setOwnerType(excel.getOwnerType());
|
||||
failure.setOwnerId(excel.getOwnerId());
|
||||
failure.setAccountNo(excel.getAccountNo());
|
||||
failure.setErrorMessage(errorMessage);
|
||||
return failure;
|
||||
}
|
||||
|
||||
private String parseOwnerType(String value) {
|
||||
String normalized = toUpper(value);
|
||||
if ("员工".equals(value)) {
|
||||
return "EMPLOYEE";
|
||||
}
|
||||
if ("员工关系人".equals(value)) {
|
||||
return "RELATION";
|
||||
}
|
||||
if ("中介".equals(value)) {
|
||||
return "INTERMEDIARY";
|
||||
}
|
||||
if ("外部人员".equals(value)) {
|
||||
return "EXTERNAL";
|
||||
}
|
||||
return normalized;
|
||||
}
|
||||
|
||||
private String parseAccountType(String value) {
|
||||
String normalized = toUpper(value);
|
||||
return switch (normalized) {
|
||||
case "银行账户" -> "BANK";
|
||||
case "证券账户" -> "SECURITIES";
|
||||
case "支付账户" -> "PAYMENT";
|
||||
case "其他" -> "OTHER";
|
||||
default -> normalized;
|
||||
};
|
||||
}
|
||||
|
||||
private String parseBankScope(String value) {
|
||||
String normalized = toUpper(value);
|
||||
return switch (normalized) {
|
||||
case "行内" -> "INTERNAL";
|
||||
case "行外" -> "EXTERNAL";
|
||||
default -> normalized;
|
||||
};
|
||||
}
|
||||
|
||||
private Integer parseStatus(String value) {
|
||||
String normalized = trimToNull(value);
|
||||
if (normalized == null) {
|
||||
return null;
|
||||
}
|
||||
return switch (normalized) {
|
||||
case "1", "正常" -> 1;
|
||||
case "2", "已销户" -> 2;
|
||||
default -> throw new RuntimeException("状态仅支持“正常/已销户”或“1/2”");
|
||||
};
|
||||
}
|
||||
|
||||
private Integer parseBooleanFlag(String value, Integer defaultValue) {
|
||||
String normalized = trimToNull(value);
|
||||
if (normalized == null) {
|
||||
return defaultValue;
|
||||
}
|
||||
return switch (normalized) {
|
||||
case "1", "是", "Y", "YES", "TRUE", "true" -> 1;
|
||||
case "0", "否", "N", "NO", "FALSE", "false" -> 0;
|
||||
default -> throw new RuntimeException("是否实控账户仅支持“是/否”或“1/0”");
|
||||
};
|
||||
}
|
||||
|
||||
private Integer parseInteger(String value) {
|
||||
String normalized = trimToNull(value);
|
||||
if (normalized == null) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
return Integer.valueOf(normalized);
|
||||
} catch (NumberFormatException e) {
|
||||
throw new RuntimeException("月均交易笔数格式不正确");
|
||||
}
|
||||
}
|
||||
|
||||
private BigDecimal parseDecimal(String value) {
|
||||
String normalized = trimToNull(value);
|
||||
if (normalized == null) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
return new BigDecimal(normalized);
|
||||
} catch (NumberFormatException e) {
|
||||
throw new RuntimeException("金额字段格式不正确");
|
||||
}
|
||||
}
|
||||
|
||||
private String parseLevel(String value, String fieldLabel) {
|
||||
String normalized = toUpper(value);
|
||||
if (StringUtils.isEmpty(normalized)) {
|
||||
return null;
|
||||
}
|
||||
return switch (normalized) {
|
||||
case "低", "LOW" -> "LOW";
|
||||
case "中", "MEDIUM" -> "MEDIUM";
|
||||
case "高", "HIGH" -> "HIGH";
|
||||
default -> throw new RuntimeException(fieldLabel + "仅支持 LOW/MEDIUM/HIGH");
|
||||
};
|
||||
}
|
||||
|
||||
private Date parseDateRequired(String value, String fieldLabel) {
|
||||
Date date = parseDateOptional(value);
|
||||
if (date == null) {
|
||||
throw new RuntimeException(fieldLabel + "不能为空");
|
||||
}
|
||||
return date;
|
||||
}
|
||||
|
||||
private Date parseDateOptional(String value) {
|
||||
String normalized = trimToNull(value);
|
||||
if (normalized == null) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
synchronized (DATE_FORMAT) {
|
||||
return DATE_FORMAT.parse(normalized);
|
||||
}
|
||||
} catch (ParseException e) {
|
||||
throw new RuntimeException("日期格式需为 yyyy-MM-dd");
|
||||
}
|
||||
}
|
||||
|
||||
private String trimToNull(String value) {
|
||||
if (StringUtils.isEmpty(value)) {
|
||||
return null;
|
||||
}
|
||||
return value.trim();
|
||||
}
|
||||
|
||||
private String ownerTypeLabel(String value) {
|
||||
return switch (value) {
|
||||
case "EMPLOYEE" -> "员工";
|
||||
case "RELATION" -> "员工关系人";
|
||||
case "INTERMEDIARY" -> "中介";
|
||||
case "EXTERNAL" -> "外部人员";
|
||||
default -> value;
|
||||
};
|
||||
}
|
||||
|
||||
private String accountTypeLabel(String value) {
|
||||
return switch (value) {
|
||||
case "BANK" -> "银行账户";
|
||||
case "SECURITIES" -> "证券账户";
|
||||
case "PAYMENT" -> "支付账户";
|
||||
case "OTHER" -> "其他";
|
||||
default -> value;
|
||||
};
|
||||
}
|
||||
|
||||
private String bankScopeLabel(String value) {
|
||||
return switch (value) {
|
||||
case "INTERNAL" -> "行内";
|
||||
case "EXTERNAL" -> "行外";
|
||||
default -> value;
|
||||
};
|
||||
}
|
||||
|
||||
private String formatYesNo(Integer value) {
|
||||
if (value == null) {
|
||||
return "";
|
||||
}
|
||||
return value == 1 ? "是" : "否";
|
||||
}
|
||||
|
||||
private String formatDate(Date value) {
|
||||
if (value == null) {
|
||||
return "";
|
||||
}
|
||||
synchronized (DATE_FORMAT) {
|
||||
return DATE_FORMAT.format(value);
|
||||
}
|
||||
}
|
||||
|
||||
private String formatNumber(Number value) {
|
||||
return value == null ? "" : String.valueOf(value);
|
||||
}
|
||||
}
|
||||
@@ -320,6 +320,9 @@ public class CcdiBaseStaffImportServiceImpl implements ICcdiBaseStaffImportServi
|
||||
if (StringUtils.isEmpty(addDTO.getPhone())) {
|
||||
throw new RuntimeException("电话不能为空");
|
||||
}
|
||||
if (addDTO.getPartyMember() == null) {
|
||||
throw new RuntimeException("是否党员不能为空");
|
||||
}
|
||||
if (StringUtils.isEmpty(addDTO.getStatus())) {
|
||||
throw new RuntimeException("状态不能为空");
|
||||
}
|
||||
@@ -357,6 +360,9 @@ public class CcdiBaseStaffImportServiceImpl implements ICcdiBaseStaffImportServi
|
||||
if (!"0".equals(addDTO.getStatus()) && !"1".equals(addDTO.getStatus())) {
|
||||
throw new RuntimeException("状态只能填写'在职'或'离职'");
|
||||
}
|
||||
if (addDTO.getPartyMember() != 0 && addDTO.getPartyMember() != 1) {
|
||||
throw new RuntimeException("是否党员只能填写'0'或'1'");
|
||||
}
|
||||
|
||||
validateAnnualIncome(addDTO.getAnnualIncome(), "年收入");
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ public class CcdiBaseStaffServiceImpl implements ICcdiBaseStaffService {
|
||||
CcdiBaseStaff staff = baseStaffMapper.selectById(staffId);
|
||||
CcdiBaseStaffVO vo = convertToVO(staff);
|
||||
if (staff != null) {
|
||||
vo.setAssetInfoList(assetInfoService.selectByFamilyId(staff.getIdCard()).stream().map(asset -> {
|
||||
vo.setAssetInfoList(assetInfoService.selectByFamilyIdAndPersonId(staff.getIdCard(), staff.getIdCard()).stream().map(asset -> {
|
||||
CcdiAssetInfoVO assetInfoVO = new CcdiAssetInfoVO();
|
||||
BeanUtils.copyProperties(asset, assetInfoVO);
|
||||
return assetInfoVO;
|
||||
@@ -131,6 +131,7 @@ public class CcdiBaseStaffServiceImpl implements ICcdiBaseStaffService {
|
||||
@Transactional
|
||||
public int insertBaseStaff(CcdiBaseStaffAddDTO addDTO) {
|
||||
validateAnnualIncome(addDTO.getAnnualIncome(), "年收入");
|
||||
validatePartyMember(addDTO.getPartyMember(), "是否党员");
|
||||
// 检查员工ID唯一性
|
||||
if (baseStaffMapper.selectById(addDTO.getStaffId()) != null) {
|
||||
throw new RuntimeException("该员工ID已存在");
|
||||
@@ -161,6 +162,7 @@ public class CcdiBaseStaffServiceImpl implements ICcdiBaseStaffService {
|
||||
@Transactional
|
||||
public int updateBaseStaff(CcdiBaseStaffEditDTO editDTO) {
|
||||
validateAnnualIncome(editDTO.getAnnualIncome(), "年收入");
|
||||
validatePartyMember(editDTO.getPartyMember(), "是否党员");
|
||||
CcdiBaseStaff existing = baseStaffMapper.selectById(editDTO.getStaffId());
|
||||
if (existing == null) {
|
||||
throw new RuntimeException("员工不存在");
|
||||
@@ -291,4 +293,13 @@ public class CcdiBaseStaffServiceImpl implements ICcdiBaseStaffService {
|
||||
}
|
||||
}
|
||||
|
||||
private void validatePartyMember(Integer partyMember, String fieldLabel) {
|
||||
if (partyMember == null) {
|
||||
throw new RuntimeException(fieldLabel + "不能为空");
|
||||
}
|
||||
if (partyMember != 0 && partyMember != 1) {
|
||||
throw new RuntimeException(fieldLabel + "只能填写'0'或'1'");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,225 @@
|
||||
package com.ruoyi.info.collection.service.impl;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.info.collection.domain.CcdiEnterpriseBaseInfo;
|
||||
import com.ruoyi.info.collection.domain.excel.CcdiEnterpriseBaseInfoExcel;
|
||||
import com.ruoyi.info.collection.domain.vo.EnterpriseBaseInfoImportFailureVO;
|
||||
import com.ruoyi.info.collection.domain.vo.ImportResult;
|
||||
import com.ruoyi.info.collection.domain.vo.ImportStatusVO;
|
||||
import com.ruoyi.info.collection.enums.DataSource;
|
||||
import com.ruoyi.info.collection.enums.EnterpriseRiskLevel;
|
||||
import com.ruoyi.info.collection.enums.EnterpriseSource;
|
||||
import com.ruoyi.info.collection.mapper.CcdiEnterpriseBaseInfoMapper;
|
||||
import com.ruoyi.info.collection.service.ICcdiEnterpriseBaseInfoImportService;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.scheduling.annotation.EnableAsync;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 实体库管理导入 Service 实现
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-04-17
|
||||
*/
|
||||
@Service
|
||||
@EnableAsync
|
||||
public class CcdiEnterpriseBaseInfoImportServiceImpl implements ICcdiEnterpriseBaseInfoImportService {
|
||||
|
||||
@Resource
|
||||
private CcdiEnterpriseBaseInfoMapper enterpriseBaseInfoMapper;
|
||||
|
||||
@Resource
|
||||
private RedisTemplate<String, Object> redisTemplate;
|
||||
|
||||
@Override
|
||||
@Async
|
||||
public void importEnterpriseBaseInfoAsync(List<CcdiEnterpriseBaseInfoExcel> excelList, String taskId, String userName) {
|
||||
List<CcdiEnterpriseBaseInfo> successRecords = new ArrayList<>();
|
||||
List<EnterpriseBaseInfoImportFailureVO> failures = new ArrayList<>();
|
||||
Set<String> existingCreditCodes = getExistingCreditCodes(excelList);
|
||||
Set<String> processedCreditCodes = new HashSet<>();
|
||||
|
||||
for (CcdiEnterpriseBaseInfoExcel excel : excelList) {
|
||||
try {
|
||||
CcdiEnterpriseBaseInfo entity = validateAndBuildEntity(excel, existingCreditCodes, processedCreditCodes, userName);
|
||||
successRecords.add(entity);
|
||||
processedCreditCodes.add(entity.getSocialCreditCode());
|
||||
} catch (Exception e) {
|
||||
EnterpriseBaseInfoImportFailureVO failureVO = new EnterpriseBaseInfoImportFailureVO();
|
||||
BeanUtils.copyProperties(excel, failureVO);
|
||||
failureVO.setErrorMessage(e.getMessage());
|
||||
failures.add(failureVO);
|
||||
}
|
||||
}
|
||||
|
||||
if (!successRecords.isEmpty()) {
|
||||
saveBatch(successRecords, 500);
|
||||
}
|
||||
|
||||
if (!failures.isEmpty()) {
|
||||
redisTemplate.opsForValue().set(buildFailuresKey(taskId), failures, 7, TimeUnit.DAYS);
|
||||
}
|
||||
|
||||
ImportResult result = new ImportResult();
|
||||
result.setTotalCount(excelList.size());
|
||||
result.setSuccessCount(successRecords.size());
|
||||
result.setFailureCount(failures.size());
|
||||
updateImportStatus(taskId, failures.isEmpty() ? "SUCCESS" : "PARTIAL_SUCCESS", result);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ImportStatusVO getImportStatus(String taskId) {
|
||||
String key = buildStatusKey(taskId);
|
||||
Boolean exists = redisTemplate.hasKey(key);
|
||||
if (Boolean.FALSE.equals(exists)) {
|
||||
throw new RuntimeException("任务不存在或已过期");
|
||||
}
|
||||
|
||||
Map<Object, Object> statusMap = redisTemplate.opsForHash().entries(key);
|
||||
ImportStatusVO statusVO = new ImportStatusVO();
|
||||
statusVO.setTaskId((String) statusMap.get("taskId"));
|
||||
statusVO.setStatus((String) statusMap.get("status"));
|
||||
statusVO.setTotalCount((Integer) statusMap.get("totalCount"));
|
||||
statusVO.setSuccessCount((Integer) statusMap.get("successCount"));
|
||||
statusVO.setFailureCount((Integer) statusMap.get("failureCount"));
|
||||
statusVO.setProgress((Integer) statusMap.get("progress"));
|
||||
statusVO.setStartTime((Long) statusMap.get("startTime"));
|
||||
statusVO.setEndTime((Long) statusMap.get("endTime"));
|
||||
statusVO.setMessage((String) statusMap.get("message"));
|
||||
return statusVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EnterpriseBaseInfoImportFailureVO> getImportFailures(String taskId) {
|
||||
Object failuresObj = redisTemplate.opsForValue().get(buildFailuresKey(taskId));
|
||||
if (failuresObj == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return JSON.parseArray(JSON.toJSONString(failuresObj), EnterpriseBaseInfoImportFailureVO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CcdiEnterpriseBaseInfo validateAndBuildEntity(CcdiEnterpriseBaseInfoExcel excel,
|
||||
Set<String> existingCreditCodes,
|
||||
Set<String> processedCreditCodes,
|
||||
String userName) {
|
||||
if (excel == null) {
|
||||
throw new RuntimeException("导入数据不能为空");
|
||||
}
|
||||
if (StringUtils.isEmpty(excel.getEnterpriseName())) {
|
||||
throw new RuntimeException("企业名称不能为空");
|
||||
}
|
||||
if (StringUtils.isEmpty(excel.getSocialCreditCode())) {
|
||||
throw new RuntimeException("统一社会信用代码不能为空");
|
||||
}
|
||||
if (!excel.getSocialCreditCode().matches("^[0-9A-HJ-NPQRTUWXY]{2}\\d{6}[0-9A-HJ-NPQRTUWXY]{10}$")) {
|
||||
throw new RuntimeException("统一社会信用代码格式不正确");
|
||||
}
|
||||
if (StringUtils.isEmpty(excel.getStatus())) {
|
||||
throw new RuntimeException("经营状态不能为空");
|
||||
}
|
||||
|
||||
String riskLevel = EnterpriseRiskLevel.resolveCode(StringUtils.trim(excel.getRiskLevel()));
|
||||
if (riskLevel == null) {
|
||||
throw new RuntimeException("风险等级不在允许范围内");
|
||||
}
|
||||
String entSource = EnterpriseSource.resolveCode(StringUtils.trim(excel.getEntSource()));
|
||||
if (entSource == null) {
|
||||
throw new RuntimeException("企业来源不在允许范围内");
|
||||
}
|
||||
String dataSource = resolveDataSourceCode(StringUtils.trim(excel.getDataSource()));
|
||||
if (dataSource == null) {
|
||||
throw new RuntimeException("数据来源不在允许范围内");
|
||||
}
|
||||
|
||||
if (existingCreditCodes.contains(excel.getSocialCreditCode())) {
|
||||
throw new RuntimeException(String.format("统一社会信用代码[%s]已存在,请勿重复导入", excel.getSocialCreditCode()));
|
||||
}
|
||||
if (processedCreditCodes.contains(excel.getSocialCreditCode())) {
|
||||
throw new RuntimeException(String.format("统一社会信用代码[%s]在导入文件中重复,已跳过此条记录", excel.getSocialCreditCode()));
|
||||
}
|
||||
|
||||
CcdiEnterpriseBaseInfo entity = new CcdiEnterpriseBaseInfo();
|
||||
BeanUtils.copyProperties(excel, entity);
|
||||
entity.setRiskLevel(riskLevel);
|
||||
entity.setEntSource(entSource);
|
||||
entity.setDataSource(dataSource);
|
||||
entity.setStatus(StringUtils.trim(excel.getStatus()));
|
||||
entity.setCreatedBy(userName);
|
||||
entity.setUpdatedBy(userName);
|
||||
return entity;
|
||||
}
|
||||
|
||||
private Set<String> getExistingCreditCodes(List<CcdiEnterpriseBaseInfoExcel> excelList) {
|
||||
List<String> creditCodes = excelList.stream()
|
||||
.map(CcdiEnterpriseBaseInfoExcel::getSocialCreditCode)
|
||||
.filter(StringUtils::isNotEmpty)
|
||||
.collect(Collectors.toList());
|
||||
if (creditCodes.isEmpty()) {
|
||||
return Collections.emptySet();
|
||||
}
|
||||
LambdaQueryWrapper<CcdiEnterpriseBaseInfo> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.in(CcdiEnterpriseBaseInfo::getSocialCreditCode, creditCodes);
|
||||
return enterpriseBaseInfoMapper.selectList(wrapper).stream()
|
||||
.map(CcdiEnterpriseBaseInfo::getSocialCreditCode)
|
||||
.filter(Objects::nonNull)
|
||||
.collect(Collectors.toSet());
|
||||
}
|
||||
|
||||
private int saveBatch(List<CcdiEnterpriseBaseInfo> list, int batchSize) {
|
||||
int total = 0;
|
||||
for (int i = 0; i < list.size(); i += batchSize) {
|
||||
int end = Math.min(i + batchSize, list.size());
|
||||
total += enterpriseBaseInfoMapper.insertBatch(list.subList(i, end));
|
||||
}
|
||||
return total;
|
||||
}
|
||||
|
||||
private void updateImportStatus(String taskId, String status, ImportResult result) {
|
||||
Map<String, Object> statusData = new HashMap<>();
|
||||
statusData.put("status", status);
|
||||
statusData.put("successCount", result.getSuccessCount());
|
||||
statusData.put("failureCount", result.getFailureCount());
|
||||
statusData.put("progress", 100);
|
||||
statusData.put("endTime", System.currentTimeMillis());
|
||||
if ("SUCCESS".equals(status)) {
|
||||
statusData.put("message", "全部成功!共导入" + result.getTotalCount() + "条数据");
|
||||
} else {
|
||||
statusData.put("message", "成功" + result.getSuccessCount() + "条,失败" + result.getFailureCount() + "条");
|
||||
}
|
||||
redisTemplate.opsForHash().putAll(buildStatusKey(taskId), statusData);
|
||||
}
|
||||
|
||||
private String resolveDataSourceCode(String value) {
|
||||
for (DataSource source : DataSource.values()) {
|
||||
if (source.getCode().equals(value) || source.getDesc().equals(value)) {
|
||||
return source.getCode();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private String buildStatusKey(String taskId) {
|
||||
return "import:enterpriseBaseInfo:" + taskId;
|
||||
}
|
||||
|
||||
private String buildFailuresKey(String taskId) {
|
||||
return "import:enterpriseBaseInfo:" + taskId + ":failures";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,182 @@
|
||||
package com.ruoyi.info.collection.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.info.collection.domain.CcdiEnterpriseBaseInfo;
|
||||
import com.ruoyi.info.collection.domain.dto.CcdiEnterpriseBaseInfoAddDTO;
|
||||
import com.ruoyi.info.collection.domain.dto.CcdiEnterpriseBaseInfoEditDTO;
|
||||
import com.ruoyi.info.collection.domain.dto.CcdiEnterpriseBaseInfoQueryDTO;
|
||||
import com.ruoyi.info.collection.domain.excel.CcdiEnterpriseBaseInfoExcel;
|
||||
import com.ruoyi.info.collection.domain.vo.CcdiEnterpriseBaseInfoVO;
|
||||
import com.ruoyi.info.collection.enums.DataSource;
|
||||
import com.ruoyi.info.collection.enums.EnterpriseRiskLevel;
|
||||
import com.ruoyi.info.collection.enums.EnterpriseSource;
|
||||
import com.ruoyi.info.collection.mapper.CcdiEnterpriseBaseInfoMapper;
|
||||
import com.ruoyi.info.collection.service.ICcdiEnterpriseBaseInfoImportService;
|
||||
import com.ruoyi.info.collection.service.ICcdiEnterpriseBaseInfoService;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* 实体库管理 Service 实现
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-04-17
|
||||
*/
|
||||
@Service
|
||||
public class CcdiEnterpriseBaseInfoServiceImpl implements ICcdiEnterpriseBaseInfoService {
|
||||
|
||||
@Resource
|
||||
private CcdiEnterpriseBaseInfoMapper enterpriseBaseInfoMapper;
|
||||
|
||||
@Resource
|
||||
private ICcdiEnterpriseBaseInfoImportService enterpriseBaseInfoImportService;
|
||||
|
||||
@Resource
|
||||
private RedisTemplate<String, Object> redisTemplate;
|
||||
|
||||
@Override
|
||||
public Page<CcdiEnterpriseBaseInfoVO> selectEnterpriseBaseInfoPage(Page<CcdiEnterpriseBaseInfoVO> page,
|
||||
CcdiEnterpriseBaseInfoQueryDTO queryDTO) {
|
||||
return enterpriseBaseInfoMapper.selectEnterpriseBaseInfoPage(page, queryDTO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CcdiEnterpriseBaseInfoVO selectEnterpriseBaseInfoById(String socialCreditCode) {
|
||||
CcdiEnterpriseBaseInfo entity = enterpriseBaseInfoMapper.selectById(socialCreditCode);
|
||||
if (entity == null) {
|
||||
return null;
|
||||
}
|
||||
CcdiEnterpriseBaseInfoVO vo = new CcdiEnterpriseBaseInfoVO();
|
||||
BeanUtils.copyProperties(entity, vo);
|
||||
return vo;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public int insertEnterpriseBaseInfo(CcdiEnterpriseBaseInfoAddDTO addDTO) {
|
||||
if (enterpriseBaseInfoMapper.selectById(addDTO.getSocialCreditCode()) != null) {
|
||||
throw new RuntimeException("该统一社会信用代码已存在");
|
||||
}
|
||||
validateEnumFields(addDTO.getStatus(), addDTO.getRiskLevel(), addDTO.getEntSource(), addDTO.getDataSource());
|
||||
|
||||
CcdiEnterpriseBaseInfo entity = new CcdiEnterpriseBaseInfo();
|
||||
BeanUtils.copyProperties(addDTO, entity);
|
||||
return enterpriseBaseInfoMapper.insert(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public int updateEnterpriseBaseInfo(CcdiEnterpriseBaseInfoEditDTO editDTO) {
|
||||
CcdiEnterpriseBaseInfo existing = enterpriseBaseInfoMapper.selectById(editDTO.getSocialCreditCode());
|
||||
if (existing == null) {
|
||||
throw new RuntimeException("实体库记录不存在");
|
||||
}
|
||||
validateEnumFields(editDTO.getStatus(), editDTO.getRiskLevel(), editDTO.getEntSource(), editDTO.getDataSource());
|
||||
|
||||
CcdiEnterpriseBaseInfo entity = new CcdiEnterpriseBaseInfo();
|
||||
BeanUtils.copyProperties(editDTO, entity);
|
||||
return enterpriseBaseInfoMapper.updateById(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public int deleteEnterpriseBaseInfoByIds(String[] socialCreditCodes) {
|
||||
if (socialCreditCodes == null || socialCreditCodes.length == 0) {
|
||||
return 0;
|
||||
}
|
||||
return enterpriseBaseInfoMapper.deleteBatchIds(List.of(socialCreditCodes));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CcdiEnterpriseBaseInfoExcel> selectEnterpriseBaseInfoListForExport(CcdiEnterpriseBaseInfoQueryDTO queryDTO) {
|
||||
LambdaQueryWrapper<CcdiEnterpriseBaseInfo> wrapper = buildQueryWrapper(queryDTO);
|
||||
return enterpriseBaseInfoMapper.selectList(wrapper).stream().map(entity -> {
|
||||
CcdiEnterpriseBaseInfoExcel excel = new CcdiEnterpriseBaseInfoExcel();
|
||||
BeanUtils.copyProperties(entity, excel);
|
||||
return excel;
|
||||
}).toList();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public String importEnterpriseBaseInfo(List<CcdiEnterpriseBaseInfoExcel> excelList) {
|
||||
String taskId = UUID.randomUUID().toString();
|
||||
String statusKey = "import:enterpriseBaseInfo:" + taskId;
|
||||
|
||||
Map<String, Object> statusData = new HashMap<>();
|
||||
statusData.put("taskId", taskId);
|
||||
statusData.put("status", "PROCESSING");
|
||||
statusData.put("totalCount", excelList.size());
|
||||
statusData.put("successCount", 0);
|
||||
statusData.put("failureCount", 0);
|
||||
statusData.put("progress", 0);
|
||||
statusData.put("startTime", System.currentTimeMillis());
|
||||
statusData.put("message", "正在处理...");
|
||||
|
||||
redisTemplate.opsForHash().putAll(statusKey, statusData);
|
||||
redisTemplate.expire(statusKey, 7, TimeUnit.DAYS);
|
||||
|
||||
enterpriseBaseInfoImportService.importEnterpriseBaseInfoAsync(excelList, taskId, SecurityUtils.getUsername());
|
||||
return taskId;
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<CcdiEnterpriseBaseInfo> buildQueryWrapper(CcdiEnterpriseBaseInfoQueryDTO queryDTO) {
|
||||
LambdaQueryWrapper<CcdiEnterpriseBaseInfo> wrapper = new LambdaQueryWrapper<>();
|
||||
if (queryDTO == null) {
|
||||
return wrapper.orderByDesc(CcdiEnterpriseBaseInfo::getCreateTime);
|
||||
}
|
||||
wrapper.like(StringUtils.isNotEmpty(queryDTO.getEnterpriseName()),
|
||||
CcdiEnterpriseBaseInfo::getEnterpriseName, queryDTO.getEnterpriseName());
|
||||
wrapper.eq(StringUtils.isNotEmpty(queryDTO.getSocialCreditCode()),
|
||||
CcdiEnterpriseBaseInfo::getSocialCreditCode, queryDTO.getSocialCreditCode());
|
||||
wrapper.eq(StringUtils.isNotEmpty(queryDTO.getEnterpriseType()),
|
||||
CcdiEnterpriseBaseInfo::getEnterpriseType, queryDTO.getEnterpriseType());
|
||||
wrapper.eq(StringUtils.isNotEmpty(queryDTO.getEnterpriseNature()),
|
||||
CcdiEnterpriseBaseInfo::getEnterpriseNature, queryDTO.getEnterpriseNature());
|
||||
wrapper.like(StringUtils.isNotEmpty(queryDTO.getIndustryClass()),
|
||||
CcdiEnterpriseBaseInfo::getIndustryClass, queryDTO.getIndustryClass());
|
||||
wrapper.eq(StringUtils.isNotEmpty(queryDTO.getStatus()),
|
||||
CcdiEnterpriseBaseInfo::getStatus, queryDTO.getStatus());
|
||||
wrapper.eq(StringUtils.isNotEmpty(queryDTO.getRiskLevel()),
|
||||
CcdiEnterpriseBaseInfo::getRiskLevel, queryDTO.getRiskLevel());
|
||||
wrapper.eq(StringUtils.isNotEmpty(queryDTO.getEntSource()),
|
||||
CcdiEnterpriseBaseInfo::getEntSource, queryDTO.getEntSource());
|
||||
return wrapper.orderByDesc(CcdiEnterpriseBaseInfo::getCreateTime);
|
||||
}
|
||||
|
||||
private void validateEnumFields(String status, String riskLevel, String entSource, String dataSource) {
|
||||
if (StringUtils.isEmpty(status)) {
|
||||
throw new RuntimeException("经营状态不能为空");
|
||||
}
|
||||
if (!EnterpriseRiskLevel.contains(riskLevel)) {
|
||||
throw new RuntimeException("风险等级不在允许范围内");
|
||||
}
|
||||
if (!EnterpriseSource.contains(entSource)) {
|
||||
throw new RuntimeException("企业来源不在允许范围内");
|
||||
}
|
||||
if (!containsDataSource(dataSource)) {
|
||||
throw new RuntimeException("数据来源不在允许范围内");
|
||||
}
|
||||
}
|
||||
|
||||
private boolean containsDataSource(String code) {
|
||||
for (DataSource source : DataSource.values()) {
|
||||
if (source.getCode().equals(code)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,165 @@
|
||||
<?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.ruoyi.info.collection.mapper.CcdiAccountInfoMapper">
|
||||
|
||||
<resultMap id="CcdiAccountInfoVOResult" type="com.ruoyi.info.collection.domain.vo.CcdiAccountInfoVO">
|
||||
<id property="id" column="id"/>
|
||||
<result property="ownerType" column="ownerType"/>
|
||||
<result property="ownerId" column="ownerId"/>
|
||||
<result property="staffId" column="staffId"/>
|
||||
<result property="staffName" column="staffName"/>
|
||||
<result property="relationId" column="relationId"/>
|
||||
<result property="relationType" column="relationType"/>
|
||||
<result property="relationName" column="relationName"/>
|
||||
<result property="relationCertNo" column="relationCertNo"/>
|
||||
<result property="accountNo" column="accountNo"/>
|
||||
<result property="accountType" column="accountType"/>
|
||||
<result property="bankScope" column="bankScope"/>
|
||||
<result property="accountName" column="accountName"/>
|
||||
<result property="openBank" column="openBank"/>
|
||||
<result property="bankCode" column="bankCode"/>
|
||||
<result property="currency" column="currency"/>
|
||||
<result property="status" column="status"/>
|
||||
<result property="effectiveDate" column="effectiveDate"/>
|
||||
<result property="invalidDate" column="invalidDate"/>
|
||||
<result property="isActualControl" column="isActualControl"/>
|
||||
<result property="avgMonthTxnCount" column="avgMonthTxnCount"/>
|
||||
<result property="avgMonthTxnAmount" column="avgMonthTxnAmount"/>
|
||||
<result property="txnFrequencyLevel" column="txnFrequencyLevel"/>
|
||||
<result property="debitSingleMaxAmount" column="debitSingleMaxAmount"/>
|
||||
<result property="creditSingleMaxAmount" column="creditSingleMaxAmount"/>
|
||||
<result property="debitDailyMaxAmount" column="debitDailyMaxAmount"/>
|
||||
<result property="creditDailyMaxAmount" column="creditDailyMaxAmount"/>
|
||||
<result property="txnRiskLevel" column="txnRiskLevel"/>
|
||||
<result property="createBy" column="createBy"/>
|
||||
<result property="createTime" column="createTime"/>
|
||||
<result property="updateBy" column="updateBy"/>
|
||||
<result property="updateTime" column="updateTime"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="AccountInfoSelectColumns">
|
||||
ai.account_id AS id,
|
||||
ai.owner_type AS ownerType,
|
||||
ai.owner_id AS ownerId,
|
||||
CASE
|
||||
WHEN ai.owner_type = 'EMPLOYEE' THEN bs.staff_id
|
||||
WHEN ai.owner_type = 'RELATION' THEN bsRel.staff_id
|
||||
ELSE NULL
|
||||
END AS staffId,
|
||||
CASE
|
||||
WHEN ai.owner_type = 'EMPLOYEE' THEN bs.name
|
||||
WHEN ai.owner_type = 'RELATION' THEN bsRel.name
|
||||
ELSE NULL
|
||||
END AS staffName,
|
||||
CASE WHEN ai.owner_type = 'RELATION' THEN fr.id ELSE NULL END AS relationId,
|
||||
CASE WHEN ai.owner_type = 'RELATION' THEN fr.relation_type ELSE NULL END AS relationType,
|
||||
CASE WHEN ai.owner_type = 'RELATION' THEN fr.relation_name ELSE NULL END AS relationName,
|
||||
CASE WHEN ai.owner_type = 'RELATION' THEN fr.relation_cert_no ELSE NULL END AS relationCertNo,
|
||||
ai.account_no AS accountNo,
|
||||
ai.account_type AS accountType,
|
||||
ai.bank_scope AS bankScope,
|
||||
ai.account_name AS accountName,
|
||||
ai.bank AS openBank,
|
||||
ai.bank_code AS bankCode,
|
||||
ai.currency AS currency,
|
||||
ai.status AS status,
|
||||
ai.effective_date AS effectiveDate,
|
||||
ai.invalid_date AS invalidDate,
|
||||
ai.is_self_account AS isActualControl,
|
||||
ai.monthly_avg_trans_count AS avgMonthTxnCount,
|
||||
ai.monthly_avg_trans_amount AS avgMonthTxnAmount,
|
||||
ai.trans_freq_type AS txnFrequencyLevel,
|
||||
ai.dr_max_single_amount AS debitSingleMaxAmount,
|
||||
ai.cr_max_single_amount AS creditSingleMaxAmount,
|
||||
ai.dr_max_daily_amount AS debitDailyMaxAmount,
|
||||
ai.cr_max_daily_amount AS creditDailyMaxAmount,
|
||||
ai.trans_risk_level AS txnRiskLevel,
|
||||
ai.create_by AS createBy,
|
||||
ai.create_time AS createTime,
|
||||
ai.update_by AS updateBy,
|
||||
ai.update_time AS updateTime
|
||||
</sql>
|
||||
|
||||
<sql id="AccountInfoWhereClause">
|
||||
WHERE 1 = 1
|
||||
<if test="query.staffName != null and query.staffName != ''">
|
||||
AND (
|
||||
(ai.owner_type = 'EMPLOYEE' AND bs.name LIKE CONCAT('%', #{query.staffName}, '%'))
|
||||
OR
|
||||
(ai.owner_type = 'RELATION' AND bsRel.name LIKE CONCAT('%', #{query.staffName}, '%'))
|
||||
)
|
||||
</if>
|
||||
<if test="query.ownerType != null and query.ownerType != ''">
|
||||
AND ai.owner_type = #{query.ownerType}
|
||||
</if>
|
||||
<if test="query.bankScope != null and query.bankScope != ''">
|
||||
AND ai.bank_scope = #{query.bankScope}
|
||||
</if>
|
||||
<if test="query.relationType != null and query.relationType != ''">
|
||||
AND fr.relation_type = #{query.relationType}
|
||||
</if>
|
||||
<if test="query.accountName != null and query.accountName != ''">
|
||||
AND ai.account_name LIKE CONCAT('%', #{query.accountName}, '%')
|
||||
</if>
|
||||
<if test="query.accountType != null and query.accountType != ''">
|
||||
AND ai.account_type = #{query.accountType}
|
||||
</if>
|
||||
<if test="query.isActualControl != null">
|
||||
AND ai.is_self_account = #{query.isActualControl}
|
||||
</if>
|
||||
<if test="query.riskLevel != null and query.riskLevel != ''">
|
||||
AND ai.trans_risk_level = #{query.riskLevel}
|
||||
</if>
|
||||
<if test="query.status != null">
|
||||
AND ai.status = #{query.status}
|
||||
</if>
|
||||
</sql>
|
||||
|
||||
<select id="selectAccountInfoPage" resultMap="CcdiAccountInfoVOResult">
|
||||
SELECT
|
||||
<include refid="AccountInfoSelectColumns"/>
|
||||
FROM ccdi_account_info ai
|
||||
LEFT JOIN ccdi_base_staff bs ON ai.owner_type = 'EMPLOYEE' AND ai.owner_id = bs.id_card
|
||||
LEFT JOIN ccdi_staff_fmy_relation fr ON ai.owner_type = 'RELATION' AND ai.owner_id = fr.relation_cert_no
|
||||
LEFT JOIN ccdi_base_staff bsRel ON fr.person_id = bsRel.id_card
|
||||
<include refid="AccountInfoWhereClause"/>
|
||||
ORDER BY ai.update_time DESC, ai.account_id DESC
|
||||
</select>
|
||||
|
||||
<select id="selectAccountInfoListForExport" resultMap="CcdiAccountInfoVOResult">
|
||||
SELECT
|
||||
<include refid="AccountInfoSelectColumns"/>
|
||||
FROM ccdi_account_info ai
|
||||
LEFT JOIN ccdi_base_staff bs ON ai.owner_type = 'EMPLOYEE' AND ai.owner_id = bs.id_card
|
||||
LEFT JOIN ccdi_staff_fmy_relation fr ON ai.owner_type = 'RELATION' AND ai.owner_id = fr.relation_cert_no
|
||||
LEFT JOIN ccdi_base_staff bsRel ON fr.person_id = bsRel.id_card
|
||||
<include refid="AccountInfoWhereClause"/>
|
||||
ORDER BY ai.update_time DESC, ai.account_id DESC
|
||||
</select>
|
||||
|
||||
<select id="selectAccountInfoById" resultMap="CcdiAccountInfoVOResult">
|
||||
SELECT
|
||||
<include refid="AccountInfoSelectColumns"/>
|
||||
FROM ccdi_account_info ai
|
||||
LEFT JOIN ccdi_base_staff bs ON ai.owner_type = 'EMPLOYEE' AND ai.owner_id = bs.id_card
|
||||
LEFT JOIN ccdi_staff_fmy_relation fr ON ai.owner_type = 'RELATION' AND ai.owner_id = fr.relation_cert_no
|
||||
LEFT JOIN ccdi_base_staff bsRel ON fr.person_id = bsRel.id_card
|
||||
WHERE ai.account_id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="selectRelationOptionsByStaffId" resultType="com.ruoyi.info.collection.domain.vo.CcdiAccountRelationOptionVO">
|
||||
SELECT
|
||||
fr.id,
|
||||
fr.relation_name AS relationName,
|
||||
fr.relation_type AS relationType,
|
||||
fr.relation_cert_no AS relationCertNo
|
||||
FROM ccdi_staff_fmy_relation fr
|
||||
INNER JOIN ccdi_base_staff bs ON fr.person_id = bs.id_card
|
||||
WHERE bs.staff_id = #{staffId}
|
||||
AND fr.is_emp_family = 1
|
||||
AND fr.status = 1
|
||||
ORDER BY fr.id DESC
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -14,13 +14,14 @@
|
||||
<result property="phone" column="phone"/>
|
||||
<result property="annualIncome" column="annual_income"/>
|
||||
<result property="hireDate" column="hire_date"/>
|
||||
<result property="partyMember" column="is_party_member"/>
|
||||
<result property="status" column="status"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="selectBaseStaffPageWithDept" resultMap="CcdiBaseStaffVOResult">
|
||||
SELECT
|
||||
e.staff_id, e.name, e.dept_id, e.id_card, e.phone, e.annual_income, e.hire_date, e.status, e.create_time,
|
||||
e.staff_id, e.name, e.dept_id, e.id_card, e.phone, e.annual_income, e.hire_date, e.is_party_member, e.status, e.create_time,
|
||||
d.dept_name
|
||||
FROM ccdi_base_staff e
|
||||
LEFT JOIN sys_dept d ON e.dept_id = d.dept_id
|
||||
@@ -47,12 +48,12 @@
|
||||
<!-- 批量插入或更新员工信息(只更新非null字段) -->
|
||||
<insert id="insertOrUpdateBatch" parameterType="java.util.List">
|
||||
INSERT INTO ccdi_base_staff
|
||||
(staff_id, name, dept_id, id_card, phone, annual_income, hire_date, status,
|
||||
(staff_id, name, dept_id, id_card, phone, annual_income, hire_date, is_party_member, status,
|
||||
create_time, create_by, update_by, update_time)
|
||||
VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(#{item.staffId}, #{item.name}, #{item.deptId}, #{item.idCard},
|
||||
#{item.phone}, #{item.annualIncome}, #{item.hireDate}, #{item.status}, NOW(),
|
||||
#{item.phone}, #{item.annualIncome}, #{item.hireDate}, #{item.partyMember}, #{item.status}, NOW(),
|
||||
#{item.createBy}, #{item.updateBy}, NOW())
|
||||
</foreach>
|
||||
ON DUPLICATE KEY UPDATE
|
||||
@@ -61,6 +62,7 @@
|
||||
phone = COALESCE(VALUES(phone), phone),
|
||||
annual_income = COALESCE(VALUES(annual_income), annual_income),
|
||||
hire_date = COALESCE(VALUES(hire_date), hire_date),
|
||||
is_party_member = COALESCE(VALUES(is_party_member), is_party_member),
|
||||
status = COALESCE(VALUES(status), status),
|
||||
update_by = COALESCE(VALUES(update_by), update_by),
|
||||
update_time = NOW()
|
||||
@@ -69,12 +71,12 @@
|
||||
<!-- 批量插入员工信息 -->
|
||||
<insert id="insertBatch" parameterType="java.util.List">
|
||||
INSERT INTO ccdi_base_staff
|
||||
(staff_id, name, dept_id, id_card, phone, annual_income, hire_date, status,
|
||||
(staff_id, name, dept_id, id_card, phone, annual_income, hire_date, is_party_member, status,
|
||||
create_time, create_by, update_by, update_time)
|
||||
VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(#{item.staffId}, #{item.name}, #{item.deptId}, #{item.idCard},
|
||||
#{item.phone}, #{item.annualIncome}, #{item.hireDate}, #{item.status}, NOW(),
|
||||
#{item.phone}, #{item.annualIncome}, #{item.hireDate}, #{item.partyMember}, #{item.status}, NOW(),
|
||||
#{item.createBy}, #{item.updateBy}, NOW())
|
||||
</foreach>
|
||||
</insert>
|
||||
@@ -86,6 +88,7 @@
|
||||
e.staff_id,
|
||||
e.name,
|
||||
e.dept_id,
|
||||
e.id_card,
|
||||
d.dept_name
|
||||
FROM ccdi_base_staff e
|
||||
LEFT JOIN sys_dept d ON e.dept_id = d.dept_id
|
||||
|
||||
@@ -4,6 +4,83 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.info.collection.mapper.CcdiEnterpriseBaseInfoMapper">
|
||||
|
||||
<resultMap id="CcdiEnterpriseBaseInfoVoResultMap" type="com.ruoyi.info.collection.domain.vo.CcdiEnterpriseBaseInfoVO">
|
||||
<id property="socialCreditCode" column="social_credit_code"/>
|
||||
<result property="enterpriseName" column="enterprise_name"/>
|
||||
<result property="enterpriseType" column="enterprise_type"/>
|
||||
<result property="enterpriseNature" column="enterprise_nature"/>
|
||||
<result property="industryClass" column="industry_class"/>
|
||||
<result property="industryName" column="industry_name"/>
|
||||
<result property="establishDate" column="establish_date"/>
|
||||
<result property="registerAddress" column="register_address"/>
|
||||
<result property="legalRepresentative" column="legal_representative"/>
|
||||
<result property="legalCertType" column="legal_cert_type"/>
|
||||
<result property="legalCertNo" column="legal_cert_no"/>
|
||||
<result property="shareholder1" column="shareholder1"/>
|
||||
<result property="shareholder2" column="shareholder2"/>
|
||||
<result property="shareholder3" column="shareholder3"/>
|
||||
<result property="shareholder4" column="shareholder4"/>
|
||||
<result property="shareholder5" column="shareholder5"/>
|
||||
<result property="status" column="status"/>
|
||||
<result property="riskLevel" column="risk_level"/>
|
||||
<result property="entSource" column="ent_source"/>
|
||||
<result property="dataSource" column="data_source"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="selectEnterpriseBaseInfoPage" resultMap="CcdiEnterpriseBaseInfoVoResultMap">
|
||||
SELECT
|
||||
social_credit_code,
|
||||
enterprise_name,
|
||||
enterprise_type,
|
||||
enterprise_nature,
|
||||
industry_class,
|
||||
industry_name,
|
||||
establish_date,
|
||||
register_address,
|
||||
legal_representative,
|
||||
legal_cert_type,
|
||||
legal_cert_no,
|
||||
shareholder1,
|
||||
shareholder2,
|
||||
shareholder3,
|
||||
shareholder4,
|
||||
shareholder5,
|
||||
status,
|
||||
risk_level,
|
||||
ent_source,
|
||||
data_source,
|
||||
create_time
|
||||
FROM ccdi_enterprise_base_info
|
||||
<where>
|
||||
<if test="queryDTO != null and queryDTO.enterpriseName != null and queryDTO.enterpriseName != ''">
|
||||
AND enterprise_name LIKE CONCAT('%', #{queryDTO.enterpriseName}, '%')
|
||||
</if>
|
||||
<if test="queryDTO != null and queryDTO.socialCreditCode != null and queryDTO.socialCreditCode != ''">
|
||||
AND social_credit_code = #{queryDTO.socialCreditCode}
|
||||
</if>
|
||||
<if test="queryDTO != null and queryDTO.enterpriseType != null and queryDTO.enterpriseType != ''">
|
||||
AND enterprise_type = #{queryDTO.enterpriseType}
|
||||
</if>
|
||||
<if test="queryDTO != null and queryDTO.enterpriseNature != null and queryDTO.enterpriseNature != ''">
|
||||
AND enterprise_nature = #{queryDTO.enterpriseNature}
|
||||
</if>
|
||||
<if test="queryDTO != null and queryDTO.industryClass != null and queryDTO.industryClass != ''">
|
||||
AND industry_class LIKE CONCAT('%', #{queryDTO.industryClass}, '%')
|
||||
</if>
|
||||
<if test="queryDTO != null and queryDTO.status != null and queryDTO.status != ''">
|
||||
AND status = #{queryDTO.status}
|
||||
</if>
|
||||
<if test="queryDTO != null and queryDTO.riskLevel != null and queryDTO.riskLevel != ''">
|
||||
AND risk_level = #{queryDTO.riskLevel}
|
||||
</if>
|
||||
<if test="queryDTO != null and queryDTO.entSource != null and queryDTO.entSource != ''">
|
||||
AND ent_source = #{queryDTO.entSource}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
<!-- 批量插入实体中介 -->
|
||||
<insert id="insertBatch" parameterType="java.util.List">
|
||||
INSERT INTO ccdi_enterprise_base_info (
|
||||
@@ -21,7 +98,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
#{item.legalRepresentative}, #{item.legalCertType}, #{item.legalCertNo},
|
||||
#{item.shareholder1}, #{item.shareholder2}, #{item.shareholder3}, #{item.shareholder4}, #{item.shareholder5},
|
||||
#{item.status}, #{item.riskLevel}, #{item.entSource}, #{item.dataSource},
|
||||
#{item.createdBy}, #{item.updatedBy}, #{item.createTime}, #{item.updateTime}
|
||||
#{item.createdBy}, #{item.updatedBy}, NOW(), NOW()
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
@@ -43,7 +120,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
#{item.legalRepresentative}, #{item.legalCertType}, #{item.legalCertNo},
|
||||
#{item.shareholder1}, #{item.shareholder2}, #{item.shareholder3}, #{item.shareholder4}, #{item.shareholder5},
|
||||
#{item.status}, #{item.riskLevel}, #{item.entSource}, #{item.dataSource},
|
||||
#{item.createdBy}, #{item.updatedBy}, #{item.createTime}, #{item.updateTime}
|
||||
#{item.createdBy}, #{item.updatedBy}, NOW(), NOW()
|
||||
)
|
||||
</foreach>
|
||||
ON DUPLICATE KEY UPDATE
|
||||
@@ -67,7 +144,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
ent_source = VALUES(ent_source),
|
||||
data_source = VALUES(data_source),
|
||||
updated_by = VALUES(updated_by),
|
||||
update_time = VALUES(update_time)
|
||||
update_time = NOW()
|
||||
</insert>
|
||||
|
||||
<!-- 批量更新实体中介 -->
|
||||
@@ -95,7 +172,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="item.entSource != null">ent_source = #{item.entSource},</if>
|
||||
<if test="item.dataSource != null">data_source = #{item.dataSource},</if>
|
||||
<if test="item.updatedBy != null">updated_by = #{item.updatedBy},</if>
|
||||
update_time = #{item.updateTime}
|
||||
update_time = NOW()
|
||||
</set>
|
||||
WHERE social_credit_code = #{item.socialCreditCode}
|
||||
</foreach>
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
<?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.ruoyi.info.collection.mapper.CcdiIntermediaryEnterpriseRelationMapper">
|
||||
|
||||
<resultMap id="CcdiIntermediaryEnterpriseRelationVOResult"
|
||||
type="com.ruoyi.info.collection.domain.vo.CcdiIntermediaryEnterpriseRelationVO">
|
||||
<id property="id" column="id"/>
|
||||
<result property="intermediaryBizId" column="intermediary_biz_id"/>
|
||||
<result property="intermediaryName" column="intermediary_name"/>
|
||||
<result property="intermediaryPersonId" column="intermediary_person_id"/>
|
||||
<result property="socialCreditCode" column="social_credit_code"/>
|
||||
<result property="enterpriseName" column="enterprise_name"/>
|
||||
<result property="relationPersonPost" column="relation_person_post"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="selectByIntermediaryBizId" resultMap="CcdiIntermediaryEnterpriseRelationVOResult">
|
||||
SELECT
|
||||
rel.id,
|
||||
rel.intermediary_biz_id,
|
||||
parent.name AS intermediary_name,
|
||||
parent.person_id AS intermediary_person_id,
|
||||
rel.social_credit_code,
|
||||
ent.enterprise_name,
|
||||
rel.relation_person_post,
|
||||
rel.remark,
|
||||
rel.create_time
|
||||
FROM ccdi_intermediary_enterprise_relation rel
|
||||
INNER JOIN ccdi_biz_intermediary parent
|
||||
ON rel.intermediary_biz_id = parent.biz_id
|
||||
LEFT JOIN ccdi_enterprise_base_info ent
|
||||
ON rel.social_credit_code = ent.social_credit_code
|
||||
WHERE rel.intermediary_biz_id = #{bizId}
|
||||
ORDER BY rel.create_time DESC
|
||||
</select>
|
||||
|
||||
<select id="selectDetailById" resultMap="CcdiIntermediaryEnterpriseRelationVOResult">
|
||||
SELECT
|
||||
rel.id,
|
||||
rel.intermediary_biz_id,
|
||||
parent.name AS intermediary_name,
|
||||
parent.person_id AS intermediary_person_id,
|
||||
rel.social_credit_code,
|
||||
ent.enterprise_name,
|
||||
rel.relation_person_post,
|
||||
rel.remark,
|
||||
rel.create_time
|
||||
FROM ccdi_intermediary_enterprise_relation rel
|
||||
INNER JOIN ccdi_biz_intermediary parent
|
||||
ON rel.intermediary_biz_id = parent.biz_id
|
||||
LEFT JOIN ccdi_enterprise_base_info ent
|
||||
ON rel.social_credit_code = ent.social_credit_code
|
||||
WHERE rel.id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="existsByIntermediaryBizIdAndSocialCreditCode" resultType="boolean">
|
||||
SELECT COUNT(1) > 0
|
||||
FROM ccdi_intermediary_enterprise_relation
|
||||
WHERE intermediary_biz_id = #{bizId}
|
||||
AND social_credit_code = #{socialCreditCode}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,109 @@
|
||||
package com.ruoyi.info.collection.mapper;
|
||||
|
||||
import com.ruoyi.info.collection.domain.dto.CcdiAccountInfoQueryDTO;
|
||||
import org.apache.ibatis.builder.xml.XMLMapperBuilder;
|
||||
import org.apache.ibatis.mapping.BoundSql;
|
||||
import org.apache.ibatis.mapping.Environment;
|
||||
import org.apache.ibatis.mapping.MappedStatement;
|
||||
import org.apache.ibatis.scripting.xmltags.XMLLanguageDriver;
|
||||
import org.apache.ibatis.session.Configuration;
|
||||
import org.apache.ibatis.transaction.jdbc.JdbcTransactionFactory;
|
||||
import org.apache.ibatis.type.TypeAliasRegistry;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
import java.io.InputStream;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
class CcdiAccountInfoMapperTest {
|
||||
|
||||
private static final String RESOURCE = "mapper/info/collection/CcdiAccountInfoMapper.xml";
|
||||
|
||||
@Test
|
||||
void selectAccountInfoPage_shouldReadAnalysisColumnsFromAccountInfoTableOnly() throws Exception {
|
||||
MappedStatement mappedStatement = loadMappedStatement(
|
||||
"com.ruoyi.info.collection.mapper.CcdiAccountInfoMapper.selectAccountInfoPage");
|
||||
|
||||
String sql = renderSql(mappedStatement, Map.of("query", new CcdiAccountInfoQueryDTO())).toLowerCase();
|
||||
|
||||
assertTrue(sql.contains("from ccdi_account_info ai"), sql);
|
||||
assertFalse(sql.contains("ccdi_account_result"), sql);
|
||||
assertTrue(sql.contains("ai.is_self_account as isactualcontrol"), sql);
|
||||
assertTrue(sql.contains("ai.monthly_avg_trans_count as avgmonthtxncount"), sql);
|
||||
assertTrue(sql.contains("ai.trans_risk_level as txnrisklevel"), sql);
|
||||
}
|
||||
|
||||
private MappedStatement loadMappedStatement(String statementId) throws Exception {
|
||||
Configuration configuration = new Configuration();
|
||||
configuration.setEnvironment(new Environment("test", new JdbcTransactionFactory(), new NoOpDataSource()));
|
||||
registerTypeAliases(configuration.getTypeAliasRegistry());
|
||||
configuration.getLanguageRegistry().register(XMLLanguageDriver.class);
|
||||
configuration.addMapper(CcdiAccountInfoMapper.class);
|
||||
|
||||
try (InputStream inputStream = getClass().getClassLoader().getResourceAsStream(RESOURCE)) {
|
||||
XMLMapperBuilder xmlMapperBuilder =
|
||||
new XMLMapperBuilder(inputStream, configuration, RESOURCE, configuration.getSqlFragments());
|
||||
xmlMapperBuilder.parse();
|
||||
}
|
||||
return configuration.getMappedStatement(statementId);
|
||||
}
|
||||
|
||||
private String renderSql(MappedStatement mappedStatement, Map<String, Object> params) {
|
||||
BoundSql boundSql = mappedStatement.getBoundSql(new HashMap<>(params));
|
||||
return boundSql.getSql().replaceAll("\\s+", " ").trim();
|
||||
}
|
||||
|
||||
private void registerTypeAliases(TypeAliasRegistry typeAliasRegistry) {
|
||||
typeAliasRegistry.registerAlias("map", Map.class);
|
||||
}
|
||||
|
||||
private static class NoOpDataSource implements DataSource {
|
||||
|
||||
@Override
|
||||
public java.sql.Connection getConnection() {
|
||||
throw new UnsupportedOperationException("Not required for SQL rendering tests");
|
||||
}
|
||||
|
||||
@Override
|
||||
public java.sql.Connection getConnection(String username, String password) {
|
||||
throw new UnsupportedOperationException("Not required for SQL rendering tests");
|
||||
}
|
||||
|
||||
@Override
|
||||
public java.io.PrintWriter getLogWriter() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLogWriter(java.io.PrintWriter out) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLoginTimeout(int seconds) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLoginTimeout() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public java.util.logging.Logger getParentLogger() {
|
||||
return java.util.logging.Logger.getGlobal();
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> T unwrap(Class<T> iface) {
|
||||
throw new UnsupportedOperationException("Not supported");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isWrapperFor(Class<?> iface) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -17,6 +17,8 @@ class CcdiBaseStaffMapperTest {
|
||||
|
||||
assertTrue(xml.contains("annual_income"), xml);
|
||||
assertTrue(xml.contains("#{item.annualIncome}"), xml);
|
||||
assertTrue(xml.contains("is_party_member"), xml);
|
||||
assertTrue(xml.contains("#{item.partyMember}"), xml);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,124 @@
|
||||
package com.ruoyi.info.collection.service;
|
||||
|
||||
import com.ruoyi.info.collection.domain.CcdiAccountInfo;
|
||||
import com.ruoyi.info.collection.domain.CcdiBaseStaff;
|
||||
import com.ruoyi.info.collection.domain.dto.CcdiAccountInfoAddDTO;
|
||||
import com.ruoyi.info.collection.mapper.CcdiAccountInfoMapper;
|
||||
import com.ruoyi.info.collection.mapper.CcdiBaseStaffMapper;
|
||||
import com.ruoyi.info.collection.mapper.CcdiStaffFmyRelationMapper;
|
||||
import com.ruoyi.info.collection.service.impl.CcdiAccountInfoServiceImpl;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
import org.mockito.ArgumentCaptor;
|
||||
import org.mockito.InjectMocks;
|
||||
import org.mockito.Mock;
|
||||
import org.mockito.junit.jupiter.MockitoExtension;
|
||||
import org.springframework.beans.BeanWrapperImpl;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertNull;
|
||||
import static org.mockito.ArgumentMatchers.any;
|
||||
import static org.mockito.Mockito.verify;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
@ExtendWith(MockitoExtension.class)
|
||||
class CcdiAccountInfoServiceImplTest {
|
||||
|
||||
@InjectMocks
|
||||
private CcdiAccountInfoServiceImpl service;
|
||||
|
||||
@Mock
|
||||
private CcdiAccountInfoMapper accountInfoMapper;
|
||||
|
||||
@Mock
|
||||
private CcdiBaseStaffMapper baseStaffMapper;
|
||||
|
||||
@Mock
|
||||
private CcdiStaffFmyRelationMapper staffFmyRelationMapper;
|
||||
|
||||
@Test
|
||||
void insertExternalAccount_shouldPersistAnalysisFieldsOnAccountInfo() {
|
||||
CcdiAccountInfoAddDTO dto = buildBaseAddDto();
|
||||
dto.setOwnerType("EXTERNAL");
|
||||
dto.setOwnerId("330101199001010011");
|
||||
dto.setBankScope("EXTERNAL");
|
||||
dto.setIsActualControl(0);
|
||||
dto.setAvgMonthTxnCount(6);
|
||||
dto.setAvgMonthTxnAmount(new BigDecimal("1234.56"));
|
||||
dto.setTxnFrequencyLevel("HIGH");
|
||||
dto.setDebitSingleMaxAmount(new BigDecimal("100.00"));
|
||||
dto.setCreditSingleMaxAmount(new BigDecimal("200.00"));
|
||||
dto.setDebitDailyMaxAmount(new BigDecimal("300.00"));
|
||||
dto.setCreditDailyMaxAmount(new BigDecimal("400.00"));
|
||||
dto.setTxnRiskLevel("MEDIUM");
|
||||
|
||||
when(accountInfoMapper.selectCount(any())).thenReturn(0L);
|
||||
when(accountInfoMapper.insert(any(CcdiAccountInfo.class))).thenReturn(1);
|
||||
|
||||
service.insertAccountInfo(dto);
|
||||
|
||||
ArgumentCaptor<CcdiAccountInfo> captor = ArgumentCaptor.forClass(CcdiAccountInfo.class);
|
||||
verify(accountInfoMapper).insert(captor.capture());
|
||||
BeanWrapperImpl wrapper = new BeanWrapperImpl(captor.getValue());
|
||||
assertEquals(0, wrapper.getPropertyValue("isActualControl"));
|
||||
assertEquals(6, wrapper.getPropertyValue("avgMonthTxnCount"));
|
||||
assertEquals(new BigDecimal("1234.56"), wrapper.getPropertyValue("avgMonthTxnAmount"));
|
||||
assertEquals("HIGH", wrapper.getPropertyValue("txnFrequencyLevel"));
|
||||
assertEquals("MEDIUM", wrapper.getPropertyValue("txnRiskLevel"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void insertInternalAccount_shouldClearAnalysisFieldsOnAccountInfo() {
|
||||
CcdiAccountInfoAddDTO dto = buildBaseAddDto();
|
||||
dto.setOwnerType("EMPLOYEE");
|
||||
dto.setOwnerId("330101199001010022");
|
||||
dto.setBankScope("INTERNAL");
|
||||
dto.setIsActualControl(1);
|
||||
dto.setAvgMonthTxnCount(8);
|
||||
dto.setAvgMonthTxnAmount(new BigDecimal("9988.66"));
|
||||
dto.setTxnFrequencyLevel("HIGH");
|
||||
dto.setDebitSingleMaxAmount(new BigDecimal("111.11"));
|
||||
dto.setCreditSingleMaxAmount(new BigDecimal("222.22"));
|
||||
dto.setDebitDailyMaxAmount(new BigDecimal("333.33"));
|
||||
dto.setCreditDailyMaxAmount(new BigDecimal("444.44"));
|
||||
dto.setTxnRiskLevel("HIGH");
|
||||
|
||||
CcdiBaseStaff staff = new CcdiBaseStaff();
|
||||
staff.setIdCard(dto.getOwnerId());
|
||||
|
||||
when(baseStaffMapper.selectOne(any())).thenReturn(staff);
|
||||
when(accountInfoMapper.selectCount(any())).thenReturn(0L);
|
||||
when(accountInfoMapper.insert(any(CcdiAccountInfo.class))).thenReturn(1);
|
||||
|
||||
service.insertAccountInfo(dto);
|
||||
|
||||
ArgumentCaptor<CcdiAccountInfo> captor = ArgumentCaptor.forClass(CcdiAccountInfo.class);
|
||||
verify(accountInfoMapper).insert(captor.capture());
|
||||
BeanWrapperImpl wrapper = new BeanWrapperImpl(captor.getValue());
|
||||
assertNull(wrapper.getPropertyValue("isActualControl"));
|
||||
assertNull(wrapper.getPropertyValue("avgMonthTxnCount"));
|
||||
assertNull(wrapper.getPropertyValue("avgMonthTxnAmount"));
|
||||
assertNull(wrapper.getPropertyValue("txnFrequencyLevel"));
|
||||
assertNull(wrapper.getPropertyValue("debitSingleMaxAmount"));
|
||||
assertNull(wrapper.getPropertyValue("creditSingleMaxAmount"));
|
||||
assertNull(wrapper.getPropertyValue("debitDailyMaxAmount"));
|
||||
assertNull(wrapper.getPropertyValue("creditDailyMaxAmount"));
|
||||
assertNull(wrapper.getPropertyValue("txnRiskLevel"));
|
||||
}
|
||||
|
||||
private CcdiAccountInfoAddDTO buildBaseAddDto() {
|
||||
CcdiAccountInfoAddDTO dto = new CcdiAccountInfoAddDTO();
|
||||
dto.setAccountNo("6222024000000001");
|
||||
dto.setAccountType("BANK");
|
||||
dto.setAccountName("测试账户");
|
||||
dto.setOpenBank("中国银行");
|
||||
dto.setBankCode("BOC");
|
||||
dto.setCurrency("CNY");
|
||||
dto.setStatus(1);
|
||||
dto.setEffectiveDate(new Date());
|
||||
return dto;
|
||||
}
|
||||
}
|
||||
@@ -27,6 +27,28 @@ class CcdiBaseStaffImportServiceImplTest {
|
||||
assertDoesNotThrow(() -> service.validateStaffData(buildDto(new BigDecimal("12345.67")), false, Collections.emptySet(), Collections.emptySet()));
|
||||
}
|
||||
|
||||
@Test
|
||||
void validateStaffData_shouldAllowPartyMemberValuesZeroAndOne() {
|
||||
CcdiBaseStaffAddDTO nonPartyMember = buildDto(null);
|
||||
nonPartyMember.setPartyMember(0);
|
||||
CcdiBaseStaffAddDTO partyMember = buildDto(null);
|
||||
partyMember.setPartyMember(1);
|
||||
|
||||
assertDoesNotThrow(() -> service.validateStaffData(nonPartyMember, false, Collections.emptySet(), Collections.emptySet()));
|
||||
assertDoesNotThrow(() -> service.validateStaffData(partyMember, false, Collections.emptySet(), Collections.emptySet()));
|
||||
}
|
||||
|
||||
@Test
|
||||
void validateStaffData_shouldRejectInvalidPartyMemberValue() {
|
||||
CcdiBaseStaffAddDTO dto = buildDto(null);
|
||||
dto.setPartyMember(2);
|
||||
|
||||
RuntimeException exception = assertThrows(RuntimeException.class,
|
||||
() -> service.validateStaffData(dto, false, Set.of(), Set.of()));
|
||||
|
||||
assertEquals("是否党员只能填写'0'或'1'", exception.getMessage());
|
||||
}
|
||||
|
||||
@Test
|
||||
void validateStaffData_shouldRejectNegativeAnnualIncome() {
|
||||
RuntimeException exception = assertThrows(RuntimeException.class,
|
||||
@@ -51,6 +73,7 @@ class CcdiBaseStaffImportServiceImplTest {
|
||||
dto.setIdCard("320101199001010014");
|
||||
dto.setPhone("13812345678");
|
||||
dto.setStatus("0");
|
||||
dto.setPartyMember(1);
|
||||
dto.setAnnualIncome(annualIncome);
|
||||
return dto;
|
||||
}
|
||||
|
||||
@@ -55,6 +55,7 @@ class CcdiBaseStaffServiceImplTest {
|
||||
addDTO.setIdCard("320101199001010011");
|
||||
addDTO.setPhone("13812345678");
|
||||
addDTO.setStatus("0");
|
||||
addDTO.setPartyMember(1);
|
||||
addDTO.setAnnualIncome(new BigDecimal("12345.67"));
|
||||
addDTO.setAssetInfoList(List.of(
|
||||
buildAssetDto("房产"),
|
||||
@@ -70,6 +71,7 @@ class CcdiBaseStaffServiceImplTest {
|
||||
assertEquals(1, result);
|
||||
ArgumentCaptor<CcdiBaseStaff> staffCaptor = ArgumentCaptor.forClass(CcdiBaseStaff.class);
|
||||
verify(baseStaffMapper).insert(staffCaptor.capture());
|
||||
assertEquals(1, staffCaptor.getValue().getPartyMember());
|
||||
assertEquals(new BigDecimal("12345.67"), staffCaptor.getValue().getAnnualIncome());
|
||||
ArgumentCaptor<List<CcdiAssetInfoDTO>> captor = ArgumentCaptor.forClass(List.class);
|
||||
verify(assetInfoService).replaceByFamilyId(eq("320101199001010011"), captor.capture());
|
||||
@@ -92,6 +94,7 @@ class CcdiBaseStaffServiceImplTest {
|
||||
editDTO.setIdCard("320101199001010011");
|
||||
editDTO.setPhone("13812345678");
|
||||
editDTO.setStatus("0");
|
||||
editDTO.setPartyMember(0);
|
||||
editDTO.setAnnualIncome(new BigDecimal("45678.90"));
|
||||
editDTO.setAssetInfoList(List.of(buildAssetDto("车辆")));
|
||||
|
||||
@@ -104,6 +107,7 @@ class CcdiBaseStaffServiceImplTest {
|
||||
assertEquals(1, result);
|
||||
ArgumentCaptor<CcdiBaseStaff> staffCaptor = ArgumentCaptor.forClass(CcdiBaseStaff.class);
|
||||
verify(baseStaffMapper).updateById(staffCaptor.capture());
|
||||
assertEquals(0, staffCaptor.getValue().getPartyMember());
|
||||
assertEquals(new BigDecimal("45678.90"), staffCaptor.getValue().getAnnualIncome());
|
||||
verify(assetInfoService, never()).deleteByFamilyId("320101199001010011");
|
||||
verify(assetInfoService).replaceByFamilyId("320101199001010011", editDTO.getAssetInfoList());
|
||||
@@ -122,6 +126,7 @@ class CcdiBaseStaffServiceImplTest {
|
||||
editDTO.setIdCard("320101199001010011");
|
||||
editDTO.setPhone("13812345678");
|
||||
editDTO.setStatus("0");
|
||||
editDTO.setPartyMember(1);
|
||||
editDTO.setAssetInfoList(List.of(buildAssetDto("车辆")));
|
||||
|
||||
when(baseStaffMapper.selectById(1001L)).thenReturn(existing);
|
||||
@@ -135,17 +140,18 @@ class CcdiBaseStaffServiceImplTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
void selectBaseStaffById_shouldReturnAssetInfoList() {
|
||||
void selectBaseStaffById_shouldReturnSelfOwnedAssetInfoList() {
|
||||
CcdiBaseStaff staff = new CcdiBaseStaff();
|
||||
staff.setStaffId(1001L);
|
||||
staff.setName("张三");
|
||||
staff.setIdCard("320101199001010011");
|
||||
staff.setStatus("0");
|
||||
staff.setPartyMember(1);
|
||||
staff.setAnnualIncome(new BigDecimal("88888.88"));
|
||||
|
||||
CcdiAssetInfo assetInfo = new CcdiAssetInfo();
|
||||
assetInfo.setFamilyId("320101199001010011");
|
||||
assetInfo.setPersonId("320101199201010022");
|
||||
assetInfo.setPersonId("320101199001010011");
|
||||
assetInfo.setAssetMainType("车辆");
|
||||
assetInfo.setAssetSubType("小汽车");
|
||||
assetInfo.setAssetName("家庭车辆");
|
||||
@@ -153,14 +159,16 @@ class CcdiBaseStaffServiceImplTest {
|
||||
assetInfo.setAssetStatus("正常");
|
||||
|
||||
when(baseStaffMapper.selectById(1001L)).thenReturn(staff);
|
||||
when(assetInfoService.selectByFamilyId("320101199001010011")).thenReturn(List.of(assetInfo));
|
||||
when(assetInfoService.selectByFamilyIdAndPersonId("320101199001010011", "320101199001010011"))
|
||||
.thenReturn(List.of(assetInfo));
|
||||
|
||||
CcdiBaseStaffVO result = service.selectBaseStaffById(1001L);
|
||||
|
||||
assertNotNull(result.getAssetInfoList());
|
||||
assertEquals(1, result.getPartyMember());
|
||||
assertEquals(new BigDecimal("88888.88"), result.getAnnualIncome());
|
||||
assertEquals(1, result.getAssetInfoList().size());
|
||||
assertEquals("320101199201010022", result.getAssetInfoList().get(0).getPersonId());
|
||||
assertEquals("320101199001010011", result.getAssetInfoList().get(0).getPersonId());
|
||||
assertEquals("车辆", result.getAssetInfoList().get(0).getAssetMainType());
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.ruoyi.info.collection.utils;
|
||||
|
||||
import com.ruoyi.common.core.domain.entity.SysDictData;
|
||||
import com.ruoyi.common.utils.DictUtils;
|
||||
import com.ruoyi.info.collection.domain.excel.CcdiBaseStaffExcel;
|
||||
import com.ruoyi.info.collection.domain.excel.CcdiAssetInfoExcel;
|
||||
import com.ruoyi.info.collection.domain.excel.CcdiStaffFmyRelationExcel;
|
||||
import org.apache.poi.ss.usermodel.CellStyle;
|
||||
@@ -72,6 +73,31 @@ class EasyExcelUtilTemplateTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
void importTemplateWithDictDropdown_shouldAddPartyMemberDropdownToBaseStaffTemplate() throws Exception {
|
||||
MockHttpServletResponse response = new MockHttpServletResponse();
|
||||
|
||||
try (MockedStatic<DictUtils> mocked = mockStatic(DictUtils.class)) {
|
||||
mocked.when(() -> DictUtils.getDictCache("ccdi_employee_status"))
|
||||
.thenReturn(List.of(
|
||||
buildDictData("在职", "0"),
|
||||
buildDictData("离职", "1")
|
||||
));
|
||||
mocked.when(() -> DictUtils.getDictCache("ccdi_yes_no_flag"))
|
||||
.thenReturn(List.of(
|
||||
buildDictData("是", "1"),
|
||||
buildDictData("否", "0")
|
||||
));
|
||||
|
||||
EasyExcelUtil.importTemplateWithDictDropdown(response, CcdiBaseStaffExcel.class, "员工信息");
|
||||
}
|
||||
|
||||
try (Workbook workbook = WorkbookFactory.create(new ByteArrayInputStream(response.getContentAsByteArray()))) {
|
||||
Sheet sheet = workbook.getSheetAt(0);
|
||||
assertTrue(hasValidationOnColumn(sheet, 7), "是否党员列应包含下拉校验");
|
||||
}
|
||||
}
|
||||
|
||||
private void assertTextColumn(Sheet sheet, int columnIndex) {
|
||||
CellStyle style = sheet.getColumnStyle(columnIndex);
|
||||
assertNotNull(style, "文本列应设置默认样式");
|
||||
@@ -90,9 +116,13 @@ class EasyExcelUtilTemplateTest {
|
||||
}
|
||||
|
||||
private SysDictData buildDictData(String label) {
|
||||
return buildDictData(label, label);
|
||||
}
|
||||
|
||||
private SysDictData buildDictData(String label, String value) {
|
||||
SysDictData dictData = new SysDictData();
|
||||
dictData.setDictLabel(label);
|
||||
dictData.setDictValue(label);
|
||||
dictData.setDictValue(value);
|
||||
return dictData;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,90 +0,0 @@
|
||||
package com.ruoyi.lsfx.client;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.ruoyi.lsfx.domain.response.CreditParseResponse;
|
||||
import com.ruoyi.lsfx.exception.LsfxApiException;
|
||||
import com.ruoyi.lsfx.util.HttpUtil;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
import org.mockito.InjectMocks;
|
||||
import org.mockito.Mock;
|
||||
import org.mockito.junit.jupiter.MockitoExtension;
|
||||
import org.springframework.test.util.ReflectionTestUtils;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
import static org.mockito.ArgumentMatchers.anyMap;
|
||||
import static org.mockito.ArgumentMatchers.anyString;
|
||||
import static org.mockito.ArgumentMatchers.eq;
|
||||
import static org.mockito.ArgumentMatchers.isNull;
|
||||
import static org.mockito.Mockito.argThat;
|
||||
import static org.mockito.Mockito.verify;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
@ExtendWith(MockitoExtension.class)
|
||||
class CreditParseClientTest {
|
||||
|
||||
private final ObjectMapper objectMapper = new ObjectMapper();
|
||||
|
||||
@Mock
|
||||
private HttpUtil httpUtil;
|
||||
|
||||
@InjectMocks
|
||||
private CreditParseClient client;
|
||||
|
||||
@BeforeEach
|
||||
void setUp() {
|
||||
ReflectionTestUtils.setField(client, "creditParseUrl", "http://credit-host/xfeature-mngs/conversation/htmlEval");
|
||||
}
|
||||
|
||||
@Test
|
||||
void shouldDeserializeCreditParseResponse() throws Exception {
|
||||
String json = """
|
||||
{
|
||||
"message": "成功",
|
||||
"status_code": "0",
|
||||
"payload": {
|
||||
"lx_header": {"query_cert_no": "3301"},
|
||||
"lx_debt": {"uncle_bank_house_bal": "12.00"},
|
||||
"lx_publictype": {"civil_cnt": 1}
|
||||
}
|
||||
}
|
||||
""";
|
||||
|
||||
CreditParseResponse response = objectMapper.readValue(json, CreditParseResponse.class);
|
||||
|
||||
assertEquals("0", response.getStatusCode());
|
||||
assertEquals("3301", response.getPayload().getLxHeader().get("query_cert_no"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void shouldCallConfiguredUrlWithMultipartParams() {
|
||||
File file = new File("sample.html");
|
||||
CreditParseResponse response = new CreditParseResponse();
|
||||
response.setStatusCode("0");
|
||||
|
||||
when(httpUtil.uploadFile(eq("http://credit-host/xfeature-mngs/conversation/htmlEval"), anyMap(), isNull(), eq(CreditParseResponse.class)))
|
||||
.thenReturn(response);
|
||||
|
||||
CreditParseResponse actual = client.parse("LXCUSTALL", "PERSON", file);
|
||||
|
||||
assertEquals("0", actual.getStatusCode());
|
||||
verify(httpUtil).uploadFile(eq("http://credit-host/xfeature-mngs/conversation/htmlEval"), argThat(params ->
|
||||
"LXCUSTALL".equals(params.get("model"))
|
||||
&& "PERSON".equals(params.get("hType"))
|
||||
&& file.equals(params.get("file"))
|
||||
), isNull(), eq(CreditParseResponse.class));
|
||||
}
|
||||
|
||||
@Test
|
||||
void shouldWrapHttpErrorsAsLsfxApiException() {
|
||||
when(httpUtil.uploadFile(anyString(), anyMap(), isNull(), eq(CreditParseResponse.class)))
|
||||
.thenThrow(new LsfxApiException("网络失败"));
|
||||
|
||||
assertThrows(LsfxApiException.class,
|
||||
() -> client.parse("LXCUSTALL", "PERSON", new File("sample.html")));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.ruoyi.ccdi.project.sql;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertAll;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
class CcdiAccountInfoMergeSqlTest {
|
||||
|
||||
@Test
|
||||
void accountInfoMergeSql_shouldAddColumnsMigrateDataAndDropLegacyTable() throws IOException {
|
||||
Path path = Path.of("..", "sql", "migration",
|
||||
"2026-04-16-merge-ccdi-account-result-into-info.sql");
|
||||
|
||||
assertTrue(Files.exists(path), "账户库合表迁移脚本应存在");
|
||||
|
||||
String sql = Files.readString(path, StandardCharsets.UTF_8).toLowerCase();
|
||||
assertAll(
|
||||
() -> assertTrue(sql.contains("bin/mysql_utf8_exec.sh")),
|
||||
() -> assertTrue(sql.contains("ccdi_account_info")),
|
||||
() -> assertTrue(sql.contains("add column `is_self_account`")),
|
||||
() -> assertTrue(sql.contains("monthly_avg_trans_count")),
|
||||
() -> assertTrue(sql.contains("update `ccdi_account_info` ai")),
|
||||
() -> assertTrue(sql.contains("join `ccdi_account_result` ar")),
|
||||
() -> assertTrue(sql.contains("drop table `ccdi_account_result`"))
|
||||
);
|
||||
}
|
||||
}
|
||||
101
deploy/deploy-to-nas-tongweb.sh
Executable file
101
deploy/deploy-to-nas-tongweb.sh
Executable file
@@ -0,0 +1,101 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
REPO_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)"
|
||||
|
||||
SERVER_HOST="116.62.17.81"
|
||||
SERVER_PORT="9444"
|
||||
SERVER_USERNAME="wkc"
|
||||
SERVER_PASSWORD="wkc@0825"
|
||||
REMOTE_ROOT="/volume1/webapp/ccdi"
|
||||
TONGWEB_HOME="${TONGWEB_HOME:-/opt/TongWeb}"
|
||||
APP_NAME="${APP_NAME:-ruoyi-admin}"
|
||||
DRY_RUN="false"
|
||||
|
||||
ensure_command() {
|
||||
local command_name="$1"
|
||||
if ! command -v "${command_name}" >/dev/null 2>&1; then
|
||||
echo "缺少命令: ${command_name}" >&2
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
ensure_paramiko() {
|
||||
if python3 - <<'PY'
|
||||
import importlib.util
|
||||
import sys
|
||||
|
||||
sys.exit(0 if importlib.util.find_spec("paramiko") else 1)
|
||||
PY
|
||||
then
|
||||
return
|
||||
fi
|
||||
|
||||
python3 -m pip install --user paramiko
|
||||
}
|
||||
|
||||
POSITION=0
|
||||
for arg in "$@"; do
|
||||
if [[ "${arg}" == "--dry-run" ]]; then
|
||||
DRY_RUN="true"
|
||||
continue
|
||||
fi
|
||||
|
||||
POSITION=$((POSITION + 1))
|
||||
case "${POSITION}" in
|
||||
1) SERVER_HOST="${arg}" ;;
|
||||
2) SERVER_PORT="${arg}" ;;
|
||||
3) SERVER_USERNAME="${arg}" ;;
|
||||
4) SERVER_PASSWORD="${arg}" ;;
|
||||
5) REMOTE_ROOT="${arg}" ;;
|
||||
6) TONGWEB_HOME="${arg}" ;;
|
||||
7) APP_NAME="${arg}" ;;
|
||||
*)
|
||||
echo "仅支持 [host] [port] [username] [password] [remoteRoot] [tongwebHome] [appName] [--dry-run]" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [[ "${DRY_RUN}" == "true" ]]; then
|
||||
echo "[DryRun] TongWeb NAS 部署参数预览"
|
||||
echo "Host: ${SERVER_HOST}"
|
||||
echo "Port: ${SERVER_PORT}"
|
||||
echo "Username: ${SERVER_USERNAME}"
|
||||
echo "RemoteRoot: ${REMOTE_ROOT}"
|
||||
echo "TongWebHome: ${TONGWEB_HOME}"
|
||||
echo "AppName: ${APP_NAME}"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "[1/4] 检查本地环境"
|
||||
ensure_command "mvn"
|
||||
ensure_command "python3"
|
||||
|
||||
echo "[2/4] 打包后端 war"
|
||||
(
|
||||
cd "${REPO_ROOT}"
|
||||
mvn -pl ruoyi-admin -am package -DskipTests
|
||||
)
|
||||
|
||||
WAR_PATH="${REPO_ROOT}/ruoyi-admin/target/ruoyi-admin.war"
|
||||
if [[ ! -f "${WAR_PATH}" ]]; then
|
||||
echo "未找到后端 war 包: ${WAR_PATH}" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "[3/4] 检查远端执行依赖"
|
||||
ensure_paramiko
|
||||
|
||||
echo "[4/4] 上传 war 并重启 TongWeb"
|
||||
python3 "${SCRIPT_DIR}/remote-deploy-tongweb.py" \
|
||||
--host "${SERVER_HOST}" \
|
||||
--port "${SERVER_PORT}" \
|
||||
--username "${SERVER_USERNAME}" \
|
||||
--password "${SERVER_PASSWORD}" \
|
||||
--local-war "${WAR_PATH}" \
|
||||
--remote-root "${REMOTE_ROOT}" \
|
||||
--tongweb-home "${TONGWEB_HOME}" \
|
||||
--app-name "${APP_NAME}"
|
||||
136
deploy/remote-deploy-tongweb.py
Normal file
136
deploy/remote-deploy-tongweb.py
Normal file
@@ -0,0 +1,136 @@
|
||||
import argparse
|
||||
import posixpath
|
||||
import shlex
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
import paramiko
|
||||
|
||||
|
||||
def parse_args():
|
||||
parser = argparse.ArgumentParser(description="Upload backend war to NAS and restart TongWeb.")
|
||||
parser.add_argument("--host", required=True)
|
||||
parser.add_argument("--port", type=int, required=True)
|
||||
parser.add_argument("--username", required=True)
|
||||
parser.add_argument("--password", required=True)
|
||||
parser.add_argument("--local-war", required=True)
|
||||
parser.add_argument("--remote-root", required=True)
|
||||
parser.add_argument("--tongweb-home", required=True)
|
||||
parser.add_argument("--app-name", required=True)
|
||||
return parser.parse_args()
|
||||
|
||||
|
||||
def run_command(ssh, command):
|
||||
stdin, stdout, stderr = ssh.exec_command(command)
|
||||
exit_code = stdout.channel.recv_exit_status()
|
||||
output = stdout.read().decode("utf-8", errors="ignore")
|
||||
error = stderr.read().decode("utf-8", errors="ignore")
|
||||
return exit_code, output, error
|
||||
|
||||
|
||||
def sudo_prefix(password):
|
||||
return f"printf '%s\\n' {shlex.quote(password)} | sudo -S -p '' "
|
||||
|
||||
|
||||
def detect_command_prefix(ssh, password, command):
|
||||
plain_exit_code, _, _ = run_command(ssh, f"{command} >/dev/null 2>&1")
|
||||
if plain_exit_code == 0:
|
||||
return ""
|
||||
|
||||
sudo_probe = f"{sudo_prefix(password)}{command} >/dev/null 2>&1"
|
||||
sudo_exit_code, _, _ = run_command(ssh, sudo_probe)
|
||||
if sudo_exit_code == 0:
|
||||
return sudo_prefix(password)
|
||||
|
||||
raise RuntimeError(f"Remote command is not accessible: {command}")
|
||||
|
||||
|
||||
def ensure_remote_path(ssh, prefix, remote_path):
|
||||
command = f"{prefix}mkdir -p {shlex.quote(remote_path)}"
|
||||
exit_code, output, error = run_command(ssh, command)
|
||||
if exit_code != 0:
|
||||
raise RuntimeError(f"Failed to create remote directory {remote_path}:\n{output}\n{error}")
|
||||
|
||||
|
||||
def upload_file(sftp, local_file, remote_file):
|
||||
parent_dir = posixpath.dirname(remote_file)
|
||||
try:
|
||||
sftp.listdir(parent_dir)
|
||||
except OSError:
|
||||
raise RuntimeError(f"SFTP remote directory not found: {parent_dir}")
|
||||
sftp.put(str(local_file), remote_file)
|
||||
|
||||
|
||||
def build_deploy_command(args, prefix):
|
||||
app_war_name = f"{args.app_name}.war"
|
||||
remote_war_path = posixpath.join(args.remote_root.rstrip("/"), "backend", app_war_name)
|
||||
autodeploy_dir = posixpath.join(args.tongweb_home.rstrip("/"), "autodeploy")
|
||||
deployed_war_path = posixpath.join(autodeploy_dir, app_war_name)
|
||||
deployed_dir_path = posixpath.join(autodeploy_dir, args.app_name)
|
||||
stop_script = posixpath.join(args.tongweb_home.rstrip("/"), "bin", "stopserver.sh")
|
||||
start_script = posixpath.join(args.tongweb_home.rstrip("/"), "bin", "startservernohup.sh")
|
||||
|
||||
return (
|
||||
"set -e;"
|
||||
f"test -d {shlex.quote(args.tongweb_home)};"
|
||||
f"test -x {shlex.quote(stop_script)};"
|
||||
f"test -x {shlex.quote(start_script)};"
|
||||
f"{prefix}mkdir -p {shlex.quote(autodeploy_dir)};"
|
||||
f"{prefix}sh {shlex.quote(stop_script)} >/dev/null 2>&1 || true;"
|
||||
f"{prefix}rm -rf {shlex.quote(deployed_dir_path)};"
|
||||
f"{prefix}rm -f {shlex.quote(deployed_war_path)};"
|
||||
f"{prefix}cp {shlex.quote(remote_war_path)} {shlex.quote(deployed_war_path)};"
|
||||
f"{prefix}sh {shlex.quote(start_script)};"
|
||||
"sleep 5;"
|
||||
f"ls -l {shlex.quote(autodeploy_dir)};"
|
||||
)
|
||||
|
||||
|
||||
def main():
|
||||
args = parse_args()
|
||||
local_war = Path(args.local_war).resolve()
|
||||
if not local_war.exists():
|
||||
raise FileNotFoundError(f"Local war does not exist: {local_war}")
|
||||
|
||||
ssh = paramiko.SSHClient()
|
||||
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
||||
ssh.connect(
|
||||
hostname=args.host,
|
||||
port=args.port,
|
||||
username=args.username,
|
||||
password=args.password,
|
||||
timeout=20,
|
||||
)
|
||||
|
||||
sftp = ssh.open_sftp()
|
||||
try:
|
||||
remote_root = args.remote_root.rstrip("/")
|
||||
remote_backend_dir = posixpath.join(remote_root, "backend")
|
||||
remote_war_path = posixpath.join(remote_backend_dir, f"{args.app_name}.war")
|
||||
|
||||
ensure_remote_path(ssh, "", remote_root)
|
||||
ensure_remote_path(ssh, "", remote_backend_dir)
|
||||
upload_file(sftp, local_war, remote_war_path)
|
||||
|
||||
command_prefix = detect_command_prefix(ssh, args.password, f"test -d {shlex.quote(args.tongweb_home)}")
|
||||
deploy_command = build_deploy_command(args, command_prefix)
|
||||
exit_code, output, error = run_command(ssh, deploy_command)
|
||||
if exit_code != 0:
|
||||
raise RuntimeError(f"Remote TongWeb deploy failed:\n{output}\n{error}")
|
||||
|
||||
print("=== DEPLOY OUTPUT ===")
|
||||
print(output.strip())
|
||||
if error.strip():
|
||||
print("=== DEPLOY STDERR ===")
|
||||
print(error.strip())
|
||||
finally:
|
||||
sftp.close()
|
||||
ssh.close()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
try:
|
||||
main()
|
||||
except Exception as exc:
|
||||
print(str(exc), file=sys.stderr)
|
||||
sys.exit(1)
|
||||
574
docs/design/2026-04-17-intermediary-library-refactor-design.md
Normal file
574
docs/design/2026-04-17-intermediary-library-refactor-design.md
Normal file
@@ -0,0 +1,574 @@
|
||||
# 中介库主从结构改造设计文档
|
||||
|
||||
**模块**: 中介库管理
|
||||
**日期**: 2026-04-17
|
||||
**作者**: Codex
|
||||
**状态**: 已确认
|
||||
|
||||
## 一、背景
|
||||
|
||||
当前中介库模块采用“个人中介 / 机构中介”并列维护方式:
|
||||
|
||||
1. 个人中介数据存放于 `ccdi_biz_intermediary`
|
||||
2. 机构中介数据直接复用 `ccdi_enterprise_base_info`
|
||||
3. 前端新增弹窗在“个人 / 机构”之间二选一录入
|
||||
4. 首页列表通过联合查询同时展示个人中介与机构中介
|
||||
|
||||
现业务需求已变更为新的主从维护模式:
|
||||
|
||||
1. 用户先录入中介个人信息
|
||||
2. 再在该中介名下录入亲属个人信息
|
||||
3. 再在该中介名下录入关联机构关系信息
|
||||
4. 关联机构信息只维护“中介与机构的关系”,实体主档仍由实体信息维护功能负责
|
||||
5. 首页列表需要统一查询“中介本人 / 中介亲属 / 中介关联机构”三类记录
|
||||
|
||||
本次设计目标是在尽量复用现有中介库模块基础上,将原并列建模改造为“中介本人主记录 + 亲属子记录 + 机构关系子记录”的结构。
|
||||
|
||||
## 二、目标
|
||||
|
||||
本次设计目标如下:
|
||||
|
||||
1. 中介库主记录统一为“中介本人”
|
||||
2. `ccdi_biz_intermediary` 同时承载中介本人和中介亲属
|
||||
3. 新增 `ccdi_intermediary_enterprise_relation` 维护中介与机构的关系
|
||||
4. 首页统一展示三类记录,并支持统一查询
|
||||
5. 新增流程改为“先新增中介本人,再在详情中维护亲属和关联机构”
|
||||
6. 保持最短路径实现,不引入额外通用关系模型或平行模块
|
||||
|
||||
## 三、范围
|
||||
|
||||
### 3.1 本次范围
|
||||
|
||||
- 调整中介库数据模型
|
||||
- 新增中介关联机构关系表
|
||||
- 改造中介库首页联合查询
|
||||
- 改造中介新增、详情、亲属维护、关联机构维护交互
|
||||
- 调整后端中介、亲属、关联机构关系接口
|
||||
- 补充设计文档与实施计划
|
||||
|
||||
### 3.2 不在本次范围
|
||||
|
||||
- 不负责录入或修改实体机构主档
|
||||
- 不新增机构主档补录兜底逻辑
|
||||
- 不做通用人员关系平台化抽象
|
||||
- 不新增独立一级菜单拆分为三个平行模块
|
||||
- 不扩展导入、导出、异步任务链路
|
||||
- 不新增兼容性补丁、降级方案或过度设计
|
||||
|
||||
## 四、现状分析
|
||||
|
||||
### 4.1 前端现状
|
||||
|
||||
当前中介库页面位于:
|
||||
|
||||
- `ruoyi-ui/src/views/ccdiIntermediary/index.vue`
|
||||
- `ruoyi-ui/src/views/ccdiIntermediary/components/EditDialog.vue`
|
||||
|
||||
现有特点:
|
||||
|
||||
1. 首页列表面向“个人中介 / 机构中介”两类并列记录
|
||||
2. 新增弹窗先选择类型,再进入不同表单
|
||||
3. 个人中介与机构中介使用不同详情接口
|
||||
4. 机构中介可直接在中介库模块中新增与修改
|
||||
|
||||
这与当前需求存在三个核心偏差:
|
||||
|
||||
1. 主记录不是“中介本人”,而是“个人 / 机构”并列
|
||||
2. 没有中介详情下的亲属子列表与机构关系子列表
|
||||
3. 首页列表未按“本人 / 亲属 / 机构关系”统一口径展示
|
||||
|
||||
### 4.2 后端现状
|
||||
|
||||
当前中介控制器位于:
|
||||
|
||||
- `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/controller/CcdiIntermediaryController.java`
|
||||
|
||||
现有后端特点:
|
||||
|
||||
1. `POST /ccdi/intermediary/person` 新增个人中介
|
||||
2. `POST /ccdi/intermediary/entity` 新增机构中介
|
||||
3. `GET /ccdi/intermediary/list` 联合查询个人中介与机构中介
|
||||
4. 机构中介直接写入 `ccdi_enterprise_base_info`
|
||||
|
||||
这与新需求的偏差在于:
|
||||
|
||||
1. 机构不应再作为中介库主记录新增
|
||||
2. 亲属未形成独立子资源模型
|
||||
3. 中介与机构之间缺少独立关系表
|
||||
|
||||
### 4.3 现有可复用基础
|
||||
|
||||
仓库中已存在以下可参考实现:
|
||||
|
||||
1. `ccdi_staff_fmy_relation` 员工亲属关系维护
|
||||
2. `ccdi_staff_enterprise_relation` 员工关联企业维护
|
||||
3. `ccdi_cust_enterprise_relation` 客户关联企业维护
|
||||
|
||||
可复用的思路主要是:
|
||||
|
||||
1. 子资源独立 CRUD
|
||||
2. 统一列表查询 + 独立编辑弹窗
|
||||
3. 关系表联查企业主档展示企业名称
|
||||
|
||||
但本次不直接照搬上述模块,而是在中介库现有主页面中完成收口。
|
||||
|
||||
## 五、方案对比
|
||||
|
||||
### 5.1 方案 A:中介本人为主记录,亲属与机构关系作为子记录
|
||||
|
||||
做法:
|
||||
|
||||
1. `ccdi_biz_intermediary` 统一存中介本人和中介亲属
|
||||
2. 新增 `ccdi_intermediary_enterprise_relation`
|
||||
3. 首页列表联合查询三类记录
|
||||
4. 首页新增只允许新增中介本人
|
||||
5. 详情页维护亲属与关联机构
|
||||
|
||||
优点:
|
||||
|
||||
1. 最贴合当前业务口径
|
||||
2. 最大程度复用现有中介库菜单、权限与主页面
|
||||
3. 后端改造边界清晰
|
||||
4. 前端操作路径与“先建中介,再维护子信息”一致
|
||||
|
||||
缺点:
|
||||
|
||||
1. 需要重写现有“个人 / 机构并列”的列表语义
|
||||
2. 需要补一张新的机构关系表
|
||||
|
||||
### 5.2 方案 B:拆成中介本人、亲属、机构关系三个平行页面
|
||||
|
||||
做法:
|
||||
|
||||
1. 中介本人独立页面
|
||||
2. 中介亲属独立页面
|
||||
3. 中介关联机构独立页面
|
||||
|
||||
问题:
|
||||
|
||||
1. 与“先建中介,再在下面维护”不一致
|
||||
2. 页面、菜单、权限改动面更大
|
||||
3. 首页聚合查询与跳转链路更复杂
|
||||
|
||||
### 5.3 方案 C:抽象统一关系模型
|
||||
|
||||
做法:
|
||||
|
||||
1. 抽象统一的人员关系与机构关系模型
|
||||
2. 中介、员工、客户共用一套关系平台
|
||||
|
||||
问题:
|
||||
|
||||
1. 抽象过重
|
||||
2. 明显超出当前需求
|
||||
3. 会引入额外改造面,不符合最短路径原则
|
||||
|
||||
### 5.4 结论
|
||||
|
||||
采用 **方案 A:中介本人为主记录,亲属与机构关系作为子记录**。
|
||||
|
||||
## 六、总体设计
|
||||
|
||||
### 6.1 设计原则
|
||||
|
||||
本次设计遵循以下原则:
|
||||
|
||||
1. 中介库只维护中介本人、亲属和中介机构关系
|
||||
2. 机构主档继续归实体信息维护功能负责
|
||||
3. 不新增无必要的身份字段,优先复用现有字段表达业务含义
|
||||
4. 首页统一查询,编辑入口按记录类型分流
|
||||
5. 删除中介本人时同时清理亲属与机构关系
|
||||
|
||||
### 6.2 数据流
|
||||
|
||||
新增中介链路:
|
||||
|
||||
1. 首页点击新增
|
||||
2. 打开中介本人新增弹窗
|
||||
3. 保存中介本人到 `ccdi_biz_intermediary`
|
||||
4. 自动进入中介详情
|
||||
5. 在详情中新增亲属与关联机构关系
|
||||
|
||||
首页查询链路:
|
||||
|
||||
1. 前端调用 `GET /ccdi/intermediary/list`
|
||||
2. 后端联合查询:
|
||||
- `ccdi_biz_intermediary` 中 `person_sub_type = 本人`
|
||||
- `ccdi_biz_intermediary` 中 `person_sub_type != 本人`
|
||||
- `ccdi_intermediary_enterprise_relation` 联查 `ccdi_enterprise_base_info`
|
||||
3. 统一返回前端展示字段与 `recordType`
|
||||
|
||||
删除中介链路:
|
||||
|
||||
1. 删除中介本人
|
||||
2. 删除本人记录
|
||||
3. 删除名下亲属记录
|
||||
4. 删除名下关联机构关系记录
|
||||
5. 不删除企业主档
|
||||
|
||||
## 七、数据模型设计
|
||||
|
||||
### 7.1 `ccdi_biz_intermediary` 使用方式调整
|
||||
|
||||
`ccdi_biz_intermediary` 继续作为人员表,不新增新的身份字段,直接复用:
|
||||
|
||||
- `person_sub_type`
|
||||
- `related_num_id`
|
||||
|
||||
字段口径调整如下:
|
||||
|
||||
1. 中介本人
|
||||
- `person_sub_type = 本人`
|
||||
- `related_num_id` 为空
|
||||
|
||||
2. 中介亲属
|
||||
- `person_sub_type = 配偶 / 子女 / 父母 / 兄弟姐妹 / 其他`
|
||||
- `related_num_id = 所属中介本人的 biz_id`
|
||||
|
||||
因此:
|
||||
|
||||
- `person_sub_type` 负责表达“本人 / 亲属关系”
|
||||
- `related_num_id` 负责表达“归属到哪个中介本人”
|
||||
|
||||
### 7.2 新增 `ccdi_intermediary_enterprise_relation`
|
||||
|
||||
新增表:`ccdi_intermediary_enterprise_relation`
|
||||
|
||||
建议字段:
|
||||
|
||||
1. `id` BIGINT 主键
|
||||
2. `intermediary_biz_id` VARCHAR(64)
|
||||
关联中介本人 `biz_id`
|
||||
3. `social_credit_code` VARCHAR(18)
|
||||
关联机构统一社会信用代码
|
||||
4. `relation_person_post` VARCHAR(100)
|
||||
中介在该机构的关联角色/职务
|
||||
5. `remark` VARCHAR(500)
|
||||
6. `created_by`
|
||||
7. `create_time`
|
||||
8. `updated_by`
|
||||
9. `update_time`
|
||||
|
||||
唯一性约束建议:
|
||||
|
||||
- `uk_intermediary_enterprise (intermediary_biz_id, social_credit_code)`
|
||||
|
||||
说明:
|
||||
|
||||
1. 只维护关系,不维护企业主档
|
||||
2. 企业名称通过联查 `ccdi_enterprise_base_info.enterprise_name` 获取
|
||||
3. 删除关系时只删该表记录
|
||||
|
||||
### 7.3 删除规则
|
||||
|
||||
删除中介本人时:
|
||||
|
||||
1. 删除 `ccdi_biz_intermediary` 中本人记录
|
||||
2. 删除 `ccdi_biz_intermediary` 中 `related_num_id = 本人 biz_id` 的亲属记录
|
||||
3. 删除 `ccdi_intermediary_enterprise_relation` 中 `intermediary_biz_id = 本人 biz_id` 的全部关系记录
|
||||
4. 不删除 `ccdi_enterprise_base_info`
|
||||
|
||||
## 八、首页列表与查询口径
|
||||
|
||||
### 8.1 列表展示字段
|
||||
|
||||
首页列表统一展示以下字段:
|
||||
|
||||
1. 名称
|
||||
2. 证件号
|
||||
3. 关联中介姓名
|
||||
4. 关联关系
|
||||
5. 创建时间
|
||||
|
||||
### 8.2 三类记录展示映射
|
||||
|
||||
1. 中介本人
|
||||
- 名称:`name`
|
||||
- 证件号:`person_id`
|
||||
- 关联中介姓名:本人姓名
|
||||
- 关联关系:`本人`
|
||||
|
||||
2. 中介亲属
|
||||
- 名称:`name`
|
||||
- 证件号:`person_id`
|
||||
- 关联中介姓名:所属中介本人姓名
|
||||
- 关联关系:`person_sub_type`
|
||||
|
||||
3. 关联机构
|
||||
- 名称:机构名称
|
||||
- 证件号:统一社会信用代码
|
||||
- 关联中介姓名:所属中介本人姓名
|
||||
- 关联关系:`relation_person_post`
|
||||
|
||||
### 8.3 搜索字段
|
||||
|
||||
首页搜索字段固定为:
|
||||
|
||||
1. 名称
|
||||
2. 证件号
|
||||
3. 记录类型
|
||||
4. 关联中介信息
|
||||
|
||||
其中“关联中介信息”为一个合并输入框,同时支持:
|
||||
|
||||
1. 按关联中介姓名查询
|
||||
2. 按关联中介证件号查询
|
||||
|
||||
### 8.4 记录类型
|
||||
|
||||
联合查询结果中增加派生字段 `recordType`,仅用于前端分流,不落库:
|
||||
|
||||
1. `INTERMEDIARY`
|
||||
2. `RELATIVE`
|
||||
3. `ENTERPRISE_RELATION`
|
||||
|
||||
## 九、接口设计
|
||||
|
||||
### 9.1 中介本人接口
|
||||
|
||||
保留现有中介主线接口,语义调整为“中介本人”:
|
||||
|
||||
1. `POST /ccdi/intermediary/person`
|
||||
- 新增中介本人
|
||||
- 固定写入:
|
||||
- `person_sub_type = 本人`
|
||||
- `related_num_id = null`
|
||||
|
||||
2. `PUT /ccdi/intermediary/person`
|
||||
- 修改中介本人
|
||||
|
||||
3. `GET /ccdi/intermediary/person/{bizId}`
|
||||
- 查询中介本人详情
|
||||
|
||||
### 9.2 中介亲属接口
|
||||
|
||||
新增中介名下亲属接口,仍然落 `ccdi_biz_intermediary`:
|
||||
|
||||
1. `GET /ccdi/intermediary/{bizId}/relatives`
|
||||
- 查询某中介名下亲属列表
|
||||
|
||||
2. `POST /ccdi/intermediary/{bizId}/relative`
|
||||
- 新增亲属
|
||||
- 固定写入:
|
||||
- `related_num_id = bizId`
|
||||
- `person_sub_type != 本人`
|
||||
|
||||
3. `GET /ccdi/intermediary/relative/{relativeBizId}`
|
||||
- 查询亲属详情
|
||||
|
||||
4. `PUT /ccdi/intermediary/relative`
|
||||
- 修改亲属
|
||||
|
||||
5. `DELETE /ccdi/intermediary/relative/{relativeBizId}`
|
||||
- 删除亲属
|
||||
|
||||
### 9.3 中介关联机构关系接口
|
||||
|
||||
新增关系表对应接口:
|
||||
|
||||
1. `GET /ccdi/intermediary/{bizId}/enterprise-relations`
|
||||
- 查询某中介名下关联机构列表
|
||||
|
||||
2. `POST /ccdi/intermediary/{bizId}/enterprise-relation`
|
||||
- 新增关联机构关系
|
||||
|
||||
3. `GET /ccdi/intermediary/enterprise-relation/{id}`
|
||||
- 查询单条机构关系详情
|
||||
|
||||
4. `PUT /ccdi/intermediary/enterprise-relation`
|
||||
- 修改机构关系
|
||||
|
||||
5. `DELETE /ccdi/intermediary/enterprise-relation/{id}`
|
||||
- 删除机构关系
|
||||
|
||||
### 9.4 首页联合查询接口
|
||||
|
||||
保留:
|
||||
|
||||
- `GET /ccdi/intermediary/list`
|
||||
|
||||
返回统一字段:
|
||||
|
||||
1. `recordType`
|
||||
2. `recordId`
|
||||
3. `name`
|
||||
4. `certificateNo`
|
||||
5. `relatedIntermediaryName`
|
||||
6. `relationText`
|
||||
7. `createTime`
|
||||
|
||||
查询条件:
|
||||
|
||||
1. `name`
|
||||
2. `certificateNo`
|
||||
3. `recordType`
|
||||
4. `relatedIntermediaryKeyword`
|
||||
|
||||
其中 `relatedIntermediaryKeyword` 同时匹配:
|
||||
|
||||
1. 关联中介姓名
|
||||
2. 关联中介证件号
|
||||
|
||||
### 9.5 删除接口行为
|
||||
|
||||
1. 删除中介本人:
|
||||
- 继续使用中介主删除接口
|
||||
- 服务层执行本人、亲属、机构关系级联清理
|
||||
|
||||
2. 删除亲属:
|
||||
- 走亲属删除接口
|
||||
|
||||
3. 删除关联机构:
|
||||
- 走关联机构关系删除接口
|
||||
|
||||
## 十、前端页面设计
|
||||
|
||||
### 10.1 首页页面
|
||||
|
||||
保留页面:
|
||||
|
||||
- `ruoyi-ui/src/views/ccdiIntermediary/index.vue`
|
||||
|
||||
页面语义调整为“中介综合库”。
|
||||
|
||||
改造内容:
|
||||
|
||||
1. 搜索区改为新搜索字段
|
||||
2. 列表改为三类记录混合展示
|
||||
3. 新增按钮只允许新增中介本人
|
||||
|
||||
### 10.2 列表操作行为
|
||||
|
||||
1. `recordType = INTERMEDIARY`
|
||||
- 详情
|
||||
- 修改
|
||||
- 删除
|
||||
|
||||
2. `recordType = RELATIVE`
|
||||
- 详情 / 编辑亲属
|
||||
- 删除亲属
|
||||
|
||||
3. `recordType = ENTERPRISE_RELATION`
|
||||
- 详情 / 编辑关联机构关系
|
||||
- 删除关联关系
|
||||
|
||||
### 10.3 新增流程
|
||||
|
||||
首页新增流程固定为:
|
||||
|
||||
1. 点击新增
|
||||
2. 打开中介本人新增弹窗
|
||||
3. 保存成功
|
||||
4. 自动进入该中介详情
|
||||
5. 在详情中继续维护亲属与关联机构
|
||||
|
||||
### 10.4 中介详情页
|
||||
|
||||
中介本人详情建议改为“大弹窗详情维护页”,包含三个区域:
|
||||
|
||||
1. 中介基本信息
|
||||
2. 亲属信息列表
|
||||
3. 关联机构信息列表
|
||||
|
||||
支持在详情中:
|
||||
|
||||
1. 编辑中介本人
|
||||
2. 新增 / 编辑 / 删除亲属
|
||||
3. 新增 / 编辑 / 删除关联机构关系
|
||||
|
||||
### 10.5 子记录编辑
|
||||
|
||||
首页点到亲属或关联机构时:
|
||||
|
||||
1. 直接打开对应编辑弹窗
|
||||
2. 弹窗中展示所属中介姓名,只读
|
||||
3. 保存成功后刷新首页列表
|
||||
4. 如当前已打开中介详情,同时刷新详情内子列表
|
||||
|
||||
### 10.6 弹窗拆分建议
|
||||
|
||||
当前 `EditDialog.vue` 同时承担个人和机构两套表单,本次建议拆分为:
|
||||
|
||||
1. 中介本人编辑弹窗
|
||||
2. 亲属编辑弹窗
|
||||
3. 关联机构关系编辑弹窗
|
||||
|
||||
如果实现时考虑最短路径,也允许在现有组件上拆成三个分支表单,但从设计上仍以三类用途明确的编辑组件为目标。
|
||||
|
||||
## 十一、校验与业务规则
|
||||
|
||||
### 11.1 中介本人
|
||||
|
||||
1. 新增时固定 `person_sub_type = 本人`
|
||||
2. `related_num_id` 必须为空
|
||||
3. 证件号仍需保持唯一性校验
|
||||
|
||||
### 11.2 中介亲属
|
||||
|
||||
1. `person_sub_type` 禁止保存为 `本人`
|
||||
2. `related_num_id` 必须指向所属中介本人
|
||||
3. 首页展示关联关系时直接取 `person_sub_type`
|
||||
|
||||
### 11.3 关联机构关系
|
||||
|
||||
1. `social_credit_code` 必须存在于实体信息库
|
||||
2. 同一中介下不允许重复关联同一统一社会信用代码
|
||||
3. 不允许通过中介模块新增机构主档
|
||||
|
||||
## 十二、数据库与代码改动清单
|
||||
|
||||
### 12.1 后端
|
||||
|
||||
预计改动:
|
||||
|
||||
1. `CcdiIntermediaryController`
|
||||
2. `ICcdiIntermediaryService`
|
||||
3. `CcdiIntermediaryServiceImpl`
|
||||
4. 中介相关 DTO / VO
|
||||
5. 新增中介关联机构关系 domain / DTO / VO / mapper / service / controller
|
||||
6. `CcdiIntermediaryMapper.xml`
|
||||
7. 新增机构关系 Mapper XML
|
||||
|
||||
### 12.2 前端
|
||||
|
||||
预计改动:
|
||||
|
||||
1. `ruoyi-ui/src/views/ccdiIntermediary/index.vue`
|
||||
2. `SearchForm.vue`
|
||||
3. `DataTable.vue`
|
||||
4. `DetailDialog.vue`
|
||||
5. `EditDialog.vue` 或拆分后的三个编辑组件
|
||||
6. `ruoyi-ui/src/api/ccdiIntermediary.js`
|
||||
7. 新增关联机构关系 API
|
||||
|
||||
### 12.3 SQL
|
||||
|
||||
预计新增:
|
||||
|
||||
1. `ccdi_intermediary_enterprise_relation` 建表脚本
|
||||
2. 如需字典补充,再新增对应迁移脚本
|
||||
|
||||
## 十三、测试要点
|
||||
|
||||
1. 新增中介本人成功,自动进入详情
|
||||
2. 在详情中新增亲属成功,首页能查到亲属记录
|
||||
3. 在详情中新增关联机构关系成功,首页能查到关联机构记录
|
||||
4. 首页支持按名称、证件号、记录类型、关联中介信息查询
|
||||
5. 首页点击亲属记录可直接编辑
|
||||
6. 首页点击关联机构记录可直接编辑
|
||||
7. 删除中介本人后,亲属记录一并删除
|
||||
8. 删除中介本人后,关联机构关系一并删除
|
||||
9. 删除中介本人后,机构主档仍保留
|
||||
10. 同一中介重复关联同一机构时正确拦截
|
||||
|
||||
## 十四、结论
|
||||
|
||||
本次中介库改造采用“中介本人主记录 + 亲属子记录 + 关联机构关系子记录”的主从结构:
|
||||
|
||||
1. `ccdi_biz_intermediary` 负责维护中介本人和亲属
|
||||
2. `ccdi_intermediary_enterprise_relation` 负责维护中介与机构的关系
|
||||
3. 首页以统一列表展示三类记录
|
||||
4. 新增流程固定为“先建中介本人,再维护子信息”
|
||||
5. 机构主档继续由实体信息维护功能独立负责
|
||||
|
||||
该方案满足当前需求,并保持了最短路径实现与清晰的前后端边界。
|
||||
@@ -0,0 +1,94 @@
|
||||
# 2026-04-14 后端运行与打包约定实施记录
|
||||
|
||||
## 1. 改动目标
|
||||
|
||||
- 固化本地后端继续走 `ruoyi-admin.jar + 内嵌 Tomcat` 启动链路
|
||||
- 固化 `mvn -pl ruoyi-admin -am package -DskipTests` 同时产出 `jar` 与 `war`
|
||||
- 固化部署脚本统一消费 `ruoyi-admin.war`
|
||||
- 固化 `bin/restart_java_backend.sh` 默认跟随后端日志,并支持 `FOLLOW_LOGS=false`
|
||||
|
||||
## 2. 实施内容
|
||||
|
||||
### 2.1 Maven 打包链路
|
||||
|
||||
涉及文件:
|
||||
|
||||
- `ruoyi-admin/pom.xml`
|
||||
|
||||
实施内容:
|
||||
|
||||
- 保持 `ruoyi-admin` 的 `<packaging>jar</packaging>` 不变,确保本地运行仍使用可执行 `jar`
|
||||
- 为 `maven-war-plugin` 增加 `package` 阶段显式执行 `war` 目标,确保执行 `mvn -pl ruoyi-admin -am package -DskipTests` 时额外生成 `ruoyi-admin.war`
|
||||
- 保留 `spring-boot-maven-plugin repackage`,继续生成可执行 `ruoyi-admin.jar`
|
||||
|
||||
### 2.2 本地后端重启脚本
|
||||
|
||||
涉及文件:
|
||||
|
||||
- `bin/restart_java_backend.sh`
|
||||
|
||||
实施内容:
|
||||
|
||||
- 新增 `FOLLOW_LOGS="${FOLLOW_LOGS:-true}"` 默认开关
|
||||
- `start`、`restart` 成功后默认执行 `tail -F` 持续输出后端日志
|
||||
- 当外部传入 `FOLLOW_LOGS=false` 时,仅启动后端,不进入日志跟随
|
||||
|
||||
### 2.3 部署产物切换
|
||||
|
||||
涉及文件:
|
||||
|
||||
- `deploy/deploy-to-nas.sh`
|
||||
- `deploy/deploy.ps1`
|
||||
- `docker/backend/Dockerfile`
|
||||
|
||||
实施内容:
|
||||
|
||||
- 部署目录组装时由复制 `ruoyi-admin.jar` 改为复制 `ruoyi-admin.war`
|
||||
- Docker 后端镜像改为消费 `ruoyi-admin.war`
|
||||
- 保证部署脚本不再把 `ruoyi-admin.jar` 当作生产部署产物
|
||||
|
||||
### 2.4 项目约定同步
|
||||
|
||||
涉及文件:
|
||||
|
||||
- `AGENTS.md`
|
||||
|
||||
实施内容:
|
||||
|
||||
- 补充本地运行、双产物打包、部署使用 `war`、`FOLLOW_LOGS` 开关等仓库级约定
|
||||
- 在 Build / Run / Test Commands 中补充主应用定向打包命令
|
||||
|
||||
## 3. 验证记录
|
||||
|
||||
### 3.1 脚本检查
|
||||
|
||||
执行:
|
||||
|
||||
```bash
|
||||
sh docs/tests/scripts/test-restart-java-backend.sh
|
||||
sh docs/tests/scripts/test-backend-package-and-deploy-conventions.sh
|
||||
```
|
||||
|
||||
结果:
|
||||
|
||||
- 两个脚本均通过
|
||||
|
||||
### 3.2 Maven 双产物验证
|
||||
|
||||
执行:
|
||||
|
||||
```bash
|
||||
mvn -pl ruoyi-admin -am package -DskipTests
|
||||
```
|
||||
|
||||
结果:
|
||||
|
||||
- 构建成功
|
||||
- 生成 `ruoyi-admin/target/ruoyi-admin.jar`
|
||||
- 生成 `ruoyi-admin/target/ruoyi-admin.war`
|
||||
|
||||
## 4. 结论
|
||||
|
||||
- 本地开发链路继续保持 `jar + 内嵌 Tomcat`
|
||||
- 部署链路统一切换为 `war`
|
||||
- 后端重启脚本默认跟日志,且支持显式关闭
|
||||
@@ -0,0 +1,62 @@
|
||||
# 2026-04-14 NAS TongWeb 部署脚本实施记录
|
||||
|
||||
## 1. 目标
|
||||
|
||||
- 新增一套独立于 Docker 的 NAS 部署脚本
|
||||
- 部署链路固定使用 `ruoyi-admin.war`
|
||||
- 远端通过 `TongWeb` 自动部署目录发布应用,并使用 `stopserver.sh` / `startservernohup.sh` 重启服务
|
||||
|
||||
## 2. 实施内容
|
||||
|
||||
### 2.1 新增 TongWeb NAS 部署入口
|
||||
|
||||
涉及文件:
|
||||
|
||||
- `deploy/deploy-to-nas-tongweb.sh`
|
||||
|
||||
实施内容:
|
||||
|
||||
- 提供与现有 NAS 脚本一致的 SSH 连接参数风格
|
||||
- 默认执行 `mvn -pl ruoyi-admin -am package -DskipTests`
|
||||
- 本地仅校验并上传 `ruoyi-admin/target/ruoyi-admin.war`
|
||||
- 支持 `--dry-run` 预览参数
|
||||
|
||||
### 2.2 新增 TongWeb 远端执行器
|
||||
|
||||
涉及文件:
|
||||
|
||||
- `deploy/remote-deploy-tongweb.py`
|
||||
|
||||
实施内容:
|
||||
|
||||
- 通过 SFTP 将 `war` 上传到 NAS 临时目录 `${remoteRoot}/backend/`
|
||||
- 远端复制 `war` 到 `${TONGWEB_HOME}/autodeploy/${appName}.war`
|
||||
- 清理 `${TONGWEB_HOME}/autodeploy/${appName}` 旧解压目录
|
||||
- 依次执行 `stopserver.sh`、`startservernohup.sh`
|
||||
|
||||
### 2.3 新增脚本回归测试
|
||||
|
||||
涉及文件:
|
||||
|
||||
- `tests/deploy/test_deploy_to_nas_tongweb.py`
|
||||
|
||||
实施内容:
|
||||
|
||||
- 覆盖默认参数 `dry-run`
|
||||
- 覆盖自定义参数 `dry-run`
|
||||
- 校验部署入口已调用 `remote-deploy-tongweb.py`
|
||||
- 校验远端执行器包含 `autodeploy`、`stopserver.sh`、`startservernohup.sh`
|
||||
|
||||
## 3. 验证命令
|
||||
|
||||
```bash
|
||||
python3 -m pytest tests/deploy/test_deploy_to_nas_tongweb.py -q
|
||||
bash -n deploy/deploy-to-nas-tongweb.sh
|
||||
bash deploy/deploy-to-nas-tongweb.sh --dry-run
|
||||
```
|
||||
|
||||
## 4. 说明
|
||||
|
||||
- 默认 `TongWebHome` 取 `/opt/TongWeb`,可通过第 6 个位置参数或环境变量 `TONGWEB_HOME` 覆盖
|
||||
- 默认应用名为 `ruoyi-admin`,可通过第 7 个位置参数或环境变量 `APP_NAME` 覆盖
|
||||
- 本次只新增 `TongWeb` 后端部署链路,不改动现有 Docker NAS 部署脚本
|
||||
@@ -0,0 +1,26 @@
|
||||
# LSFX Mock Server `ccdi_account_info` 异常账户字段补迁移后端实施文档
|
||||
|
||||
## 背景
|
||||
|
||||
- `lsfx-mock-server` 上传接口 `/watson/api/project/remoteUploadSplitFile` 在写入 `ccdi_account_info` 时使用了 `is_self_account`、`trans_risk_level` 字段。
|
||||
- 当前开发库中的 `ccdi_account_info` 为历史表结构,不包含这两列,导致 `AbnormalAccountBaselineService.apply(...)` 执行 upsert 时依次抛出 `Unknown column 'is_self_account' in 'field list'`、`Unknown column 'trans_risk_level' in 'field list'`,上传接口直接返回 500。
|
||||
|
||||
## 本次修改
|
||||
|
||||
- 新增增量脚本 `sql/migration/2026-04-15-sync-ccdi-account-info-abnormal-account-columns.sql`。
|
||||
- 脚本以最短路径为已有 `ccdi_account_info` 表补齐异常账户同步当前必需的字段,并保持可重复执行:
|
||||
- 使用 `information_schema.columns` 判断字段是否已存在
|
||||
- 通过 `PREPARE / EXECUTE` 仅在缺列时执行 `ALTER TABLE`
|
||||
- 补齐 `is_self_account` 与 `trans_risk_level`
|
||||
- 列位置与当前写库 SQL 保持一致
|
||||
- 新增回归测试 `lsfx-mock-server/tests/test_schema_migration_scripts.py`,锁定该增量脚本必须存在且包含两条补列语句。
|
||||
|
||||
## 验证
|
||||
|
||||
- `python3 -m pytest /Users/wkc/Desktop/ccdi/ccdi/lsfx-mock-server/tests/test_schema_migration_scripts.py -q`
|
||||
- 使用 `bin/mysql_utf8_exec.sh` 执行增量脚本后,复查 `SHOW COLUMNS FROM ccdi_account_info`,确认存在 `is_self_account`、`trans_risk_level` 字段。
|
||||
|
||||
## 影响范围
|
||||
|
||||
- 仅影响 `lsfx-mock-server` 依赖的 `ccdi_account_info` 历史表结构补齐。
|
||||
- 不修改接口协议,不改动前端。
|
||||
@@ -0,0 +1,53 @@
|
||||
# 账户库双表合单表后端实施计划
|
||||
|
||||
## 1. 目标
|
||||
|
||||
将账户库由 `ccdi_account_info` + `ccdi_account_result` 双表结构收敛为单表 `ccdi_account_info`,迁移完成后删除旧表,同时保持现有账户库接口、字段名和前端交互不变。
|
||||
|
||||
## 2. 实施范围
|
||||
|
||||
- 数据库增量迁移脚本
|
||||
- 账户库后端实体、Mapper XML、服务层
|
||||
- 外部场景种子脚本
|
||||
- 账户库相关回归测试
|
||||
|
||||
本次不调整前端页面、接口路径和接口字段名。
|
||||
|
||||
## 3. 实施步骤
|
||||
|
||||
### 3.1 数据库迁移
|
||||
|
||||
1. 新增 `sql/migration/2026-04-16-merge-ccdi-account-result-into-info.sql`
|
||||
2. 在脚本中先校验 `ccdi_account_info.account_no` 无重复
|
||||
3. 为 `ccdi_account_info` 补齐分析字段
|
||||
4. 按 `account_no` 从 `ccdi_account_result` 回填数据
|
||||
5. 回填完成后删除 `ccdi_account_result`
|
||||
|
||||
### 3.2 后端代码调整
|
||||
|
||||
1. `CcdiAccountInfo` 实体吸收分析字段映射
|
||||
2. 删除 `CcdiAccountResult` 实体与 `CcdiAccountResultMapper`
|
||||
3. `CcdiAccountInfoMapper.xml` 去掉对 `ccdi_account_result` 的联表
|
||||
4. `CcdiAccountInfoServiceImpl` 去掉结果表双写逻辑
|
||||
5. 保持原有业务语义:
|
||||
- `bankScope = EXTERNAL` 时补齐默认分析字段
|
||||
- `bankScope != EXTERNAL` 时清空分析字段,避免误写
|
||||
|
||||
### 3.3 配套脚本与测试
|
||||
|
||||
1. 将 `2026-04-13` 外部账户场景种子脚本改为单表写入
|
||||
2. 新增 SQL 脚本文本断言测试
|
||||
3. 新增账户库服务层与 Mapper SQL 结构测试
|
||||
|
||||
## 4. 验证要点
|
||||
|
||||
- 迁移脚本包含“补字段、回填、删旧表”三步
|
||||
- 账户库列表/详情/导出查询均只读 `ccdi_account_info`
|
||||
- 行外账户保存分析字段
|
||||
- 行内账户清空分析字段
|
||||
- 外部场景种子脚本不再写入 `ccdi_account_result`
|
||||
|
||||
## 5. 风险说明
|
||||
|
||||
- 仓库当前 `ccdi-info-collection` 模块存在既有依赖缺失问题,可能影响常规 Maven 全量编译与测试执行
|
||||
- 本次需要将“账户库改动验证结果”和“仓库原有构建阻塞”分开记录
|
||||
@@ -0,0 +1,83 @@
|
||||
# 员工基础信息新增是否党员字段后端实施计划
|
||||
|
||||
> **For agentic workers:** REQUIRED: Use superpowers:subagent-driven-development (if subagents available) or superpowers:executing-plans to implement this plan. Steps use checkbox (`- [ ]`) syntax for tracking.
|
||||
|
||||
**Goal:** 在员工基础信息后端链路中新增“是否党员”字段,保证数据库、实体、接口、导入导出与最小测试契约保持一致。
|
||||
|
||||
**Architecture:** 继续沿用 `ccdi_base_staff` 现有维护链路,在表上增加 `is_party_member` 字段,并在 `CcdiBaseStaff` 的实体、DTO、VO、Excel、Mapper XML 与服务校验中同步补齐。实现保持最短路径,不新增新的接口层或旁路转换逻辑,只在现有员工维护链路上扩字段。
|
||||
|
||||
**Tech Stack:** MySQL, Java 21, Spring Boot 3, MyBatis Plus, EasyExcel, JUnit 5, Markdown
|
||||
|
||||
---
|
||||
|
||||
## 文件结构与职责
|
||||
|
||||
**后端源码**
|
||||
|
||||
- `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/domain/CcdiBaseStaff.java`
|
||||
新增 `partyMember` 字段并映射 `is_party_member`。
|
||||
- `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/domain/dto/CcdiBaseStaffAddDTO.java`
|
||||
新增新增接口入参字段与非空校验。
|
||||
- `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/domain/dto/CcdiBaseStaffEditDTO.java`
|
||||
新增编辑接口入参字段与非空校验。
|
||||
- `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/domain/vo/CcdiBaseStaffVO.java`
|
||||
新增详情/列表返回字段。
|
||||
- `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/domain/excel/CcdiBaseStaffExcel.java`
|
||||
新增 Excel 导入导出列,并挂接“是/否”字典下拉。
|
||||
- `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/domain/vo/ImportFailureVO.java`
|
||||
新增导入失败记录字段回显。
|
||||
- `ccdi-info-collection/src/main/resources/mapper/info/collection/CcdiBaseStaffMapper.xml`
|
||||
在列表查询、批量新增、批量更新 SQL 中补 `is_party_member`。
|
||||
- `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/service/impl/CcdiBaseStaffServiceImpl.java`
|
||||
补新增/编辑链路校验,约束 `partyMember` 只能为 `0/1`。
|
||||
- `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/service/impl/CcdiBaseStaffImportServiceImpl.java`
|
||||
补导入链路的必填和枚举值校验。
|
||||
|
||||
**SQL**
|
||||
|
||||
- `sql/migration/2026-04-17-add-base-staff-party-member.sql`
|
||||
以幂等方式为 `ccdi_base_staff` 增加字段,并补充 `ccdi_yes_no_flag` 字典数据。
|
||||
- `sql/ccdi_yes_no_flag_dict.sql`
|
||||
提供“是/否标记”字典初始化脚本,供新环境或独立初始化使用。
|
||||
|
||||
**测试**
|
||||
|
||||
- `ccdi-info-collection/src/test/java/com/ruoyi/info/collection/service/CcdiBaseStaffServiceImplTest.java`
|
||||
验证服务层新增/修改/详情查询会透传 `partyMember`。
|
||||
- `ccdi-info-collection/src/test/java/com/ruoyi/info/collection/service/CcdiBaseStaffImportServiceImplTest.java`
|
||||
验证导入场景仅允许 `0/1`。
|
||||
- `ccdi-info-collection/src/test/java/com/ruoyi/info/collection/mapper/CcdiBaseStaffMapperTest.java`
|
||||
验证 Mapper XML 已包含 `is_party_member` 与 `#{item.partyMember}`。
|
||||
- `ccdi-info-collection/src/test/java/com/ruoyi/info/collection/utils/EasyExcelUtilTemplateTest.java`
|
||||
验证员工模板已补“是否党员”下拉列。
|
||||
|
||||
## 实施步骤
|
||||
|
||||
- [ ] 在 `ccdi_base_staff` 表增加 `is_party_member`,默认值为 `0`,避免历史数据为空。
|
||||
- [ ] 在员工基础信息实体、DTO、VO、Excel 对象中补齐 `partyMember`。
|
||||
- [ ] 在 `CcdiBaseStaffMapper.xml` 的列表、批量新增、批量更新 SQL 中补 `is_party_member`。
|
||||
- [ ] 在 `CcdiBaseStaffServiceImpl` 与 `CcdiBaseStaffImportServiceImpl` 中增加 `0/1` 值域校验。
|
||||
- [ ] 新增 `ccdi_yes_no_flag` 字典脚本,保证导入模板下拉可用。
|
||||
- [ ] 补充并执行后端定向测试;若执行受现有依赖问题阻塞,需要在记录中明确注明阻塞原因。
|
||||
|
||||
## 验证记录
|
||||
|
||||
- 已尝试执行:
|
||||
|
||||
```bash
|
||||
mvn -pl ccdi-info-collection -Dtest=CcdiBaseStaffServiceImplTest,CcdiBaseStaffImportServiceImplTest,CcdiBaseStaffMapperTest,EasyExcelUtilTemplateTest test
|
||||
mvn -pl ccdi-info-collection -DskipTests compile
|
||||
```
|
||||
|
||||
- 当前结果:
|
||||
- `test` 在进入本次新增断言前,被模块内既有测试编译问题拦截,表现为缺少 `org.springframework.data.redis.core.*` 类型。
|
||||
- `compile` 被模块当前既有依赖缺失拦截,表现为缺少 `com.ruoyi.common.annotation.*`、`org.springframework.data.redis.core.*`、`IdCardUtil` 等类型。
|
||||
- 上述阻塞不是本次“是否党员”字段新增引入的新问题,但会影响自动化验证结论,需要后续先修复模块依赖基线。
|
||||
|
||||
## 完成标准
|
||||
|
||||
- 员工基础信息接口可读写 `partyMember`
|
||||
- 员工列表、详情、导入导出链路都包含 `partyMember`
|
||||
- 数据库字段与字典 SQL 已补齐
|
||||
- 后端测试契约已同步更新
|
||||
- 已明确记录当前自动化验证阻塞点
|
||||
@@ -0,0 +1,22 @@
|
||||
# 员工信息仅展示本人资产后端实施计划
|
||||
|
||||
## 变更目标
|
||||
|
||||
- 员工详情接口返回的 `assetInfoList` 仅包含员工本人资产
|
||||
- 员工信息页不再通过详情接口混入亲属资产数据
|
||||
|
||||
## 变更范围
|
||||
|
||||
- `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/service/impl/CcdiBaseStaffServiceImpl.java`
|
||||
- `ccdi-info-collection/src/test/java/com/ruoyi/info/collection/service/CcdiBaseStaffServiceImplTest.java`
|
||||
|
||||
## 实施步骤
|
||||
|
||||
1. 将员工详情聚合资产的查询口径从 `family_id = 员工身份证号` 调整为 `family_id = 员工身份证号 and person_id = 员工身份证号`
|
||||
2. 保持员工新增、编辑时的 `replaceByFamilyId` 逻辑不变,继续由后端写入本人资产
|
||||
3. 调整单元测试,验证员工详情仅返回本人资产
|
||||
|
||||
## 验证要点
|
||||
|
||||
- 查询员工详情时,`assetInfoList` 不再返回亲属资产
|
||||
- 现有员工新增、编辑、删除链路不受影响
|
||||
@@ -0,0 +1,188 @@
|
||||
# 实体库管理后端实施计划
|
||||
|
||||
> **For agentic workers:** REQUIRED: Use superpowers:subagent-driven-development (if subagents available) or superpowers:executing-plans to implement this plan. Steps use checkbox (`- [ ]`) syntax for tracking.
|
||||
|
||||
**Goal:** 新增独立的实体库管理后端链路,基于 `ccdi_enterprise_base_info` 支持分页查询、详情、新增、编辑、删除、异步导入、导入状态查询和失败记录查询。
|
||||
|
||||
**Architecture:** 复用现有 `CcdiEnterpriseBaseInfo` 实体与 Mapper,新增独立的 Controller、Service、DTO、VO、Excel 与导入服务,接口风格与员工信息维护保持一致。`riskLevel`、`entSource`、`dataSource` 统一通过枚举接口对外提供选项,导入采用严格新增策略,数据库重复和 Excel 内重复统一记为失败。
|
||||
|
||||
**Tech Stack:** Java 21, Spring Boot 3, MyBatis Plus, Redis, EasyExcel, JUnit 5, MySQL, Markdown
|
||||
|
||||
---
|
||||
|
||||
## 文件结构与职责
|
||||
|
||||
**后端源码**
|
||||
|
||||
- `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/controller/CcdiEnterpriseBaseInfoController.java`
|
||||
实体库管理对外接口入口,提供 CRUD、导入模板、导入任务状态和失败记录查询。
|
||||
- `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/service/ICcdiEnterpriseBaseInfoService.java`
|
||||
定义实体库管理服务接口。
|
||||
- `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/service/ICcdiEnterpriseBaseInfoImportService.java`
|
||||
定义异步导入状态与失败记录查询接口。
|
||||
- `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/service/impl/CcdiEnterpriseBaseInfoServiceImpl.java`
|
||||
承接分页查询、详情、增删改和导入任务提交。
|
||||
- `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/service/impl/CcdiEnterpriseBaseInfoImportServiceImpl.java`
|
||||
处理异步导入、校验、失败记录落 Redis 与状态回写。
|
||||
- `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/domain/dto/CcdiEnterpriseBaseInfoQueryDTO.java`
|
||||
定义查询条件。
|
||||
- `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/domain/dto/CcdiEnterpriseBaseInfoAddDTO.java`
|
||||
定义新增入参和校验规则。
|
||||
- `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/domain/dto/CcdiEnterpriseBaseInfoEditDTO.java`
|
||||
定义编辑入参与主键不可变约束。
|
||||
- `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/domain/vo/CcdiEnterpriseBaseInfoVO.java`
|
||||
承接列表和详情返回。
|
||||
- `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/domain/vo/EnterpriseBaseInfoImportFailureVO.java`
|
||||
承接导入失败记录回显。
|
||||
- `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/domain/excel/CcdiEnterpriseBaseInfoExcel.java`
|
||||
定义导入模板列、导入字段和字典下拉。
|
||||
- `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/enums/EnterpriseRiskLevel.java`
|
||||
新增实体风险等级枚举。
|
||||
- `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/enums/EnterpriseSource.java`
|
||||
新增企业来源枚举。
|
||||
- `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/controller/CcdiEnumController.java`
|
||||
新增风险等级与企业来源选项接口。
|
||||
- `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/mapper/CcdiEnterpriseBaseInfoMapper.java`
|
||||
补充分页查询与批量导入方法声明。
|
||||
- `ccdi-info-collection/src/main/resources/mapper/info/collection/CcdiEnterpriseBaseInfoMapper.xml`
|
||||
补充分页查询、结果映射、批量插入 SQL。
|
||||
|
||||
**SQL**
|
||||
|
||||
- `sql/migration/2026-04-17-add-enterprise-base-info-menu.sql`
|
||||
新增“实体库管理”菜单和功能权限。
|
||||
- `sql/migration/2026-04-17-add-enterprise-base-info-dict-or-enum-seed.sql`
|
||||
如需初始化与导入模板一致的固定值说明,可在脚本中补充注释性或字典性数据;若最终走纯枚举接口,则只保留菜单 SQL。
|
||||
|
||||
**测试**
|
||||
|
||||
- `ccdi-info-collection/src/test/java/com/ruoyi/info/collection/service/CcdiEnterpriseBaseInfoServiceImplTest.java`
|
||||
校验新增、编辑、删除、详情和枚举值校验。
|
||||
- `ccdi-info-collection/src/test/java/com/ruoyi/info/collection/service/CcdiEnterpriseBaseInfoImportServiceImplTest.java`
|
||||
校验导入重复失败、Excel 内重复失败和状态回写。
|
||||
- `ccdi-info-collection/src/test/java/com/ruoyi/info/collection/mapper/CcdiEnterpriseBaseInfoMapperTest.java`
|
||||
校验分页 SQL 和结果映射关键片段。
|
||||
- `ccdi-info-collection/src/test/java/com/ruoyi/info/collection/controller/CcdiEnumControllerTest.java`
|
||||
校验新增的枚举选项接口。
|
||||
|
||||
## 实施任务
|
||||
|
||||
### Task 1: 搭建实体库管理 DTO / VO / Excel 契约
|
||||
|
||||
**Files:**
|
||||
|
||||
- Create: `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/domain/dto/CcdiEnterpriseBaseInfoQueryDTO.java`
|
||||
- Create: `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/domain/dto/CcdiEnterpriseBaseInfoAddDTO.java`
|
||||
- Create: `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/domain/dto/CcdiEnterpriseBaseInfoEditDTO.java`
|
||||
- Create: `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/domain/vo/CcdiEnterpriseBaseInfoVO.java`
|
||||
- Create: `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/domain/vo/EnterpriseBaseInfoImportFailureVO.java`
|
||||
- Create: `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/domain/excel/CcdiEnterpriseBaseInfoExcel.java`
|
||||
- Reference: `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/domain/CcdiEnterpriseBaseInfo.java`
|
||||
- Reference: `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/domain/excel/CcdiIntermediaryEntityExcel.java`
|
||||
|
||||
- [x] 定义 QueryDTO,包含 `enterpriseName`、`socialCreditCode`、`enterpriseType`、`enterpriseNature`、`industryClass`、`status`、`riskLevel`、`entSource`。
|
||||
- [x] 定义 AddDTO / EditDTO,完整覆盖单表维护字段,并给 `socialCreditCode`、`enterpriseName`、`status`、`riskLevel`、`entSource`、`dataSource` 加基础校验。
|
||||
- [x] 在 EditDTO 中保持主键为必填,不新增改主键语义字段。
|
||||
- [x] 定义 VO,补齐列表和详情所需字段,并预留 `createTime` 供前端表格展示。
|
||||
- [x] 定义 Excel 对象,列顺序与页面表单一致,并为 `enterpriseType`、`enterpriseNature`、`legalCertType` 使用现有字典下拉;`riskLevel`、`entSource`、`dataSource` 保持文本列,后续由导入服务做枚举校验。
|
||||
|
||||
### Task 2: 补齐风险等级与企业来源枚举出口
|
||||
|
||||
**Files:**
|
||||
|
||||
- Create: `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/enums/EnterpriseRiskLevel.java`
|
||||
- Create: `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/enums/EnterpriseSource.java`
|
||||
- Modify: `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/controller/CcdiEnumController.java`
|
||||
|
||||
- [x] 新增 `EnterpriseRiskLevel` 枚举,口径固定为 `1/2/3` 对应高/中/低风险,并提供 `getCode()`、`getDesc()`、`getDescByCode()`、`contains()`。
|
||||
- [x] 新增 `EnterpriseSource` 枚举,口径固定为 `GENERAL`、`EMP_RELATION`、`CREDIT_CUSTOMER`、`INTERMEDIARY`、`BOTH`,并提供与现有 `DataSource` 一致的方法。
|
||||
- [x] 在 `CcdiEnumController` 中新增 `/enterpriseRiskLevel` 与 `/enterpriseSource` 两个接口,返回 `EnumOptionVO` 列表。
|
||||
- [x] 保持现有 `/dataSource` 不变,避免前端重复造轮子。
|
||||
|
||||
### Task 3: 实现分页查询与 CRUD 服务链路
|
||||
|
||||
**Files:**
|
||||
|
||||
- Modify: `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/mapper/CcdiEnterpriseBaseInfoMapper.java`
|
||||
- Modify: `ccdi-info-collection/src/main/resources/mapper/info/collection/CcdiEnterpriseBaseInfoMapper.xml`
|
||||
- Create: `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/service/ICcdiEnterpriseBaseInfoService.java`
|
||||
- Create: `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/service/impl/CcdiEnterpriseBaseInfoServiceImpl.java`
|
||||
- Create: `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/controller/CcdiEnterpriseBaseInfoController.java`
|
||||
- Reference: `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/controller/CcdiBaseStaffController.java`
|
||||
- Reference: `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/service/impl/CcdiBaseStaffServiceImpl.java`
|
||||
|
||||
- [x] 在 Mapper 中新增分页查询方法,按 QueryDTO 动态拼装筛选条件。
|
||||
- [x] 在 Mapper XML 中新增结果映射和 `selectEnterpriseBaseInfoPage` SQL,输出 `create_time`、`risk_level`、`ent_source`、`data_source` 等字段。
|
||||
- [x] 在 Service 接口中定义分页、详情、新增、编辑、删除、导出列表、导入任务提交方法。
|
||||
- [x] 在 ServiceImpl 中实现主键唯一校验、编辑存在性校验、枚举值校验和删除批量处理。
|
||||
- [x] 新建 Controller,接口路径统一使用 `/ccdi/enterpriseBaseInfo`,返回风格完全对齐员工信息维护。
|
||||
- [x] 导入模板下载复用 `EasyExcelUtil.importTemplateWithDictDropdown`。
|
||||
|
||||
### Task 4: 实现异步导入与失败记录查询
|
||||
|
||||
**Files:**
|
||||
|
||||
- Create: `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/service/ICcdiEnterpriseBaseInfoImportService.java`
|
||||
- Create: `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/service/impl/CcdiEnterpriseBaseInfoImportServiceImpl.java`
|
||||
- Modify: `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/service/impl/CcdiEnterpriseBaseInfoServiceImpl.java`
|
||||
- Modify: `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/controller/CcdiEnterpriseBaseInfoController.java`
|
||||
- Reference: `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/service/impl/CcdiBaseStaffImportServiceImpl.java`
|
||||
- Reference: `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/service/impl/CcdiIntermediaryEntityImportServiceImpl.java`
|
||||
|
||||
- [x] 在 ServiceImpl 中提交导入任务,Redis key 建议使用 `import:enterpriseBaseInfo:{taskId}`。
|
||||
- [x] 在导入服务中实现 Excel 行校验,数据库重复与 Excel 内重复统一生成失败记录。
|
||||
- [x] 新增 `riskLevel`、`entSource`、`dataSource` 枚举校验,拒绝非法值。
|
||||
- [x] 成功记录分批批量插入;导入不支持更新,不提供 `updateSupport` 分支逻辑。
|
||||
- [x] 失败记录写入 Redis,状态统一支持 `PROCESSING`、`SUCCESS`、`PARTIAL_SUCCESS`。
|
||||
- [x] Controller 补 `/importData`、`/importStatus/{taskId}`、`/importFailures/{taskId}` 三个接口,分页失败记录方式与员工信息维护一致。
|
||||
|
||||
### Task 5: 补菜单 SQL 和权限口径
|
||||
|
||||
**Files:**
|
||||
|
||||
- Create: `sql/migration/2026-04-17-add-enterprise-base-info-menu.sql`
|
||||
- Reference: `sql/ccdi_staff_fmy_relation_menu.sql`
|
||||
- Reference: `sql/migration/2026-04-13-add-ccdi-account-info-menu.sql`
|
||||
|
||||
- [x] 在“信息维护”目录下新增“实体库管理”菜单。
|
||||
- [x] 菜单 path 固定为 `enterpriseBaseInfo`,component 固定为 `ccdiEnterpriseBaseInfo/index`。
|
||||
- [x] 功能权限至少包含 `list`、`query`、`add`、`edit`、`remove`、`import`。
|
||||
- [x] SQL 保持幂等写法,避免重复插入菜单。
|
||||
|
||||
### Task 6: 补后端测试与验证命令
|
||||
|
||||
**Files:**
|
||||
|
||||
- Create: `ccdi-info-collection/src/test/java/com/ruoyi/info/collection/service/CcdiEnterpriseBaseInfoServiceImplTest.java`
|
||||
- Create: `ccdi-info-collection/src/test/java/com/ruoyi/info/collection/service/CcdiEnterpriseBaseInfoImportServiceImplTest.java`
|
||||
- Create: `ccdi-info-collection/src/test/java/com/ruoyi/info/collection/mapper/CcdiEnterpriseBaseInfoMapperTest.java`
|
||||
- Create: `ccdi-info-collection/src/test/java/com/ruoyi/info/collection/controller/CcdiEnumControllerTest.java`
|
||||
|
||||
- [x] 为新增、编辑、删除、详情和枚举值校验补服务测试。
|
||||
- [x] 为导入数据库重复失败、Excel 内重复失败补导入服务测试。
|
||||
- [x] 为 Mapper XML 的分页查询关键 SQL 补测试或最小断言。
|
||||
- [x] 为新增枚举接口补 Controller 测试。
|
||||
- [x] 执行后端验证命令并记录结果。
|
||||
|
||||
## 验证命令
|
||||
|
||||
```bash
|
||||
mvn -pl ccdi-info-collection -Dtest=CcdiEnterpriseBaseInfoServiceImplTest,CcdiEnterpriseBaseInfoImportServiceImplTest,CcdiEnterpriseBaseInfoMapperTest,CcdiEnumControllerTest test
|
||||
mvn -pl ccdi-info-collection -DskipTests compile
|
||||
```
|
||||
|
||||
## 执行结果
|
||||
|
||||
- 实际测试命令:`mvn -pl ccdi-info-collection -am -Dsurefire.failIfNoSpecifiedTests=false -Dtest=CcdiEnterpriseBaseInfoServiceImplTest,CcdiEnterpriseBaseInfoImportServiceImplTest,CcdiEnterpriseBaseInfoMapperTest,CcdiEnumControllerTest test`
|
||||
- 测试结果:`BUILD SUCCESS`,共执行 11 个测试,`Failures: 0, Errors: 0, Skipped: 0`
|
||||
- 实际编译命令:`mvn -pl ccdi-info-collection -am -DskipTests compile`
|
||||
- 编译结果:`BUILD SUCCESS`
|
||||
|
||||
## 完成标准
|
||||
|
||||
- 后端新增独立 `/ccdi/enterpriseBaseInfo` 管理接口
|
||||
- 列表、详情、新增、编辑、删除链路可用
|
||||
- 导入严格新增,数据库重复与 Excel 内重复都进入失败记录
|
||||
- `riskLevel`、`entSource`、`dataSource` 均有统一选项口径
|
||||
- 菜单 SQL 与权限标识已补齐
|
||||
- 后端定向测试与编译验证已执行并记录结果
|
||||
@@ -0,0 +1,23 @@
|
||||
# 修复员工资产信息表注释乱码后端实施计划
|
||||
|
||||
## 变更目标
|
||||
|
||||
- 修复 `ccdi_asset_info` 表中 `family_id`、`person_id` 列注释乱码问题
|
||||
- 保持表结构、字段类型和业务数据不变,仅修正元数据注释
|
||||
|
||||
## 变更范围
|
||||
|
||||
- `sql/migration/2026-04-17-fix-ccdi-asset-info-comment-encoding.sql`
|
||||
|
||||
## 实施步骤
|
||||
|
||||
1. 查询 `information_schema.COLUMNS`,确认 `ccdi_asset_info` 列注释实际存在乱码
|
||||
2. 新增增量 SQL,使用 `ALTER TABLE ... MODIFY COLUMN ... COMMENT` 修复 `family_id`、`person_id` 注释
|
||||
3. 通过 `bin/mysql_utf8_exec.sh` 以 `utf8mb4` 会话执行脚本
|
||||
4. 再次查询 `information_schema.COLUMNS` 验证注释已恢复为中文
|
||||
|
||||
## 验证要点
|
||||
|
||||
- `family_id` 注释显示为“归属员工证件号”
|
||||
- `person_id` 注释显示为“资产实际持有人证件号”
|
||||
- 字段类型仍为 `VARCHAR(100) NOT NULL`
|
||||
@@ -0,0 +1,540 @@
|
||||
# 中介库主从结构改造后端实施计划
|
||||
|
||||
> **For agentic workers:** REQUIRED: Use superpowers:subagent-driven-development (if subagents available) or superpowers:executing-plans to implement this plan. Steps use checkbox (`- [ ]`) syntax for tracking.
|
||||
|
||||
**Goal:** 将中介库后端从“个人中介 / 机构中介并列维护”改造为“中介本人主记录 + 中介亲属子记录 + 中介机构关系子记录”,并提供统一首页查询、详情维护和级联删除能力。
|
||||
|
||||
**Architecture:** 继续以 `CcdiIntermediaryController` 和 `ccdi_biz_intermediary` 为主线,保留中介本人主资源;亲属仍落同表,通过 `person_sub_type` 和 `related_num_id` 表达主从关系;新增 `ccdi_intermediary_enterprise_relation` 作为中介与机构的关系表。首页 `/ccdi/intermediary/list` 改为三路联合查询,返回统一展示字段与 `recordType` 供前端分流。
|
||||
|
||||
**Tech Stack:** Java 21, Spring Boot 3, MyBatis Plus, MySQL, JUnit 5, Maven, Markdown
|
||||
|
||||
---
|
||||
|
||||
## 文件结构与职责
|
||||
|
||||
**设计与参考**
|
||||
|
||||
- `docs/design/2026-04-17-intermediary-library-refactor-design.md`
|
||||
本次改造的设计基线,实施时不得偏离文档确认的字段、接口与删除规则。
|
||||
|
||||
**数据库与 SQL**
|
||||
|
||||
- `sql/migration/2026-04-17-create-intermediary-enterprise-relation.sql`
|
||||
创建 `ccdi_intermediary_enterprise_relation`,补索引和唯一约束。
|
||||
- `sql/migration/2026-04-17-fix-intermediary-person-sub-type-dict.sql`
|
||||
如需补齐 `person_sub_type` 固定值“本人/配偶/子女/父母/兄弟姐妹/其他”,在此脚本中补充字典数据。
|
||||
|
||||
**中介主链路**
|
||||
|
||||
- `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/controller/CcdiIntermediaryController.java`
|
||||
继续作为中介模块统一入口,补亲属与机构关系子资源接口。
|
||||
- `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/service/ICcdiIntermediaryService.java`
|
||||
增加亲属列表、亲属 CRUD、机构关系列表、机构关系 CRUD、统一联合查询新口径方法。
|
||||
- `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/service/impl/CcdiIntermediaryServiceImpl.java`
|
||||
承接中介本人、亲属、机构关系、联合查询和级联删除逻辑。
|
||||
- `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/mapper/CcdiIntermediaryMapper.java`
|
||||
保留首页联合查询入口,参数口径调整。
|
||||
- `ccdi-info-collection/src/main/resources/mapper/info/collection/CcdiIntermediaryMapper.xml`
|
||||
将首页联合查询改为“本人 + 亲属 + 机构关系”三路 `UNION ALL`。
|
||||
|
||||
**亲属与中介本人 DTO / VO**
|
||||
|
||||
- `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/domain/dto/CcdiIntermediaryQueryDTO.java`
|
||||
改成新首页查询条件。
|
||||
- `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/domain/dto/CcdiIntermediaryPersonAddDTO.java`
|
||||
收敛为“中介本人新增”入参,不再承担亲属语义。
|
||||
- `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/domain/dto/CcdiIntermediaryPersonEditDTO.java`
|
||||
收敛为“中介本人编辑”入参。
|
||||
- `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/domain/dto/CcdiIntermediaryRelativeAddDTO.java`
|
||||
新增中介亲属新增入参。
|
||||
- `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/domain/dto/CcdiIntermediaryRelativeEditDTO.java`
|
||||
新增中介亲属编辑入参。
|
||||
- `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/domain/vo/CcdiIntermediaryVO.java`
|
||||
改为首页统一列表 VO。
|
||||
- `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/domain/vo/CcdiIntermediaryPersonDetailVO.java`
|
||||
改为中介本人详情 VO。
|
||||
- `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/domain/vo/CcdiIntermediaryRelativeVO.java`
|
||||
新增亲属列表 / 详情返回。
|
||||
|
||||
**中介机构关系链路**
|
||||
|
||||
- `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/domain/CcdiIntermediaryEnterpriseRelation.java`
|
||||
新增中介机构关系实体。
|
||||
- `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/domain/dto/CcdiIntermediaryEnterpriseRelationAddDTO.java`
|
||||
新增中介机构关系新增入参。
|
||||
- `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/domain/dto/CcdiIntermediaryEnterpriseRelationEditDTO.java`
|
||||
新增中介机构关系编辑入参。
|
||||
- `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/domain/vo/CcdiIntermediaryEnterpriseRelationVO.java`
|
||||
新增关系列表 / 详情返回。
|
||||
- `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/mapper/CcdiIntermediaryEnterpriseRelationMapper.java`
|
||||
新增关系表 Mapper。
|
||||
- `ccdi-info-collection/src/main/resources/mapper/info/collection/CcdiIntermediaryEnterpriseRelationMapper.xml`
|
||||
新增关系表查询 SQL。
|
||||
|
||||
**测试**
|
||||
|
||||
- `ccdi-info-collection/src/test/java/com/ruoyi/info/collection/service/CcdiIntermediaryServiceImplTest.java`
|
||||
补中介本人、亲属、机构关系和级联删除测试。
|
||||
- `ccdi-info-collection/src/test/java/com/ruoyi/info/collection/mapper/CcdiIntermediaryMapperTest.java`
|
||||
补首页联合查询 SQL 测试。
|
||||
- `ccdi-info-collection/src/test/java/com/ruoyi/info/collection/controller/CcdiIntermediaryControllerTest.java`
|
||||
补新增接口和子资源接口测试。
|
||||
|
||||
## 实施任务
|
||||
|
||||
### Task 1: 建立关系表和固定口径 SQL
|
||||
|
||||
**Files:**
|
||||
|
||||
- Create: `sql/migration/2026-04-17-create-intermediary-enterprise-relation.sql`
|
||||
- Create: `sql/migration/2026-04-17-fix-intermediary-person-sub-type-dict.sql`
|
||||
- Reference: `sql/ccdi_staff_fmy_relation.sql`
|
||||
- Reference: `sql/menu-intermediary.sql`
|
||||
|
||||
- [ ] **Step 1: 梳理当前 `ccdi_biz_intermediary` 对 `person_sub_type` 的实际使用口径**
|
||||
|
||||
Run: `rg -n "personSubType|person_sub_type" ccdi-info-collection ruoyi-ui sql -S`
|
||||
Expected: 能定位现有中介与前端表单对该字段的读写位置。
|
||||
|
||||
- [ ] **Step 2: 编写关系表建表 SQL**
|
||||
|
||||
在 `sql/migration/2026-04-17-create-intermediary-enterprise-relation.sql` 中创建:
|
||||
|
||||
```sql
|
||||
CREATE TABLE IF NOT EXISTS `ccdi_intermediary_enterprise_relation` (
|
||||
`id` BIGINT NOT NULL AUTO_INCREMENT COMMENT '主键ID',
|
||||
`intermediary_biz_id` VARCHAR(64) NOT NULL COMMENT '所属中介biz_id',
|
||||
`social_credit_code` VARCHAR(18) NOT NULL COMMENT '统一社会信用代码',
|
||||
`relation_person_post` VARCHAR(100) DEFAULT NULL COMMENT '关联角色/职务',
|
||||
`remark` VARCHAR(500) DEFAULT NULL COMMENT '备注',
|
||||
`created_by` VARCHAR(64) DEFAULT NULL COMMENT '创建人',
|
||||
`create_time` DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`updated_by` VARCHAR(64) DEFAULT NULL COMMENT '更新人',
|
||||
`update_time` DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `uk_intermediary_enterprise` (`intermediary_biz_id`, `social_credit_code`),
|
||||
KEY `idx_intermediary_biz_id` (`intermediary_biz_id`),
|
||||
KEY `idx_social_credit_code` (`social_credit_code`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='中介关联机构关系表';
|
||||
```
|
||||
|
||||
- [ ] **Step 3: 编写 `person_sub_type` 固定值脚本**
|
||||
|
||||
在 `sql/migration/2026-04-17-fix-intermediary-person-sub-type-dict.sql` 中补齐:
|
||||
|
||||
```sql
|
||||
-- 根据实际字典表结构插入 本人 / 配偶 / 子女 / 父母 / 兄弟姐妹 / 其他
|
||||
```
|
||||
|
||||
Expected: 后端和前端都能使用一致的固定值。
|
||||
|
||||
- [ ] **Step 4: 人工校对 SQL 字段注释与唯一约束**
|
||||
|
||||
Expected: 能明确表达“只删关系,不删机构主档”的边界。
|
||||
|
||||
- [ ] **Step 5: 提交 SQL 与计划中的字段口径**
|
||||
|
||||
```bash
|
||||
git add sql/migration/2026-04-17-create-intermediary-enterprise-relation.sql sql/migration/2026-04-17-fix-intermediary-person-sub-type-dict.sql
|
||||
git commit -m "feat: 新增中介机构关系表脚本"
|
||||
```
|
||||
|
||||
### Task 2: 收敛中介本人与亲属 DTO / VO
|
||||
|
||||
**Files:**
|
||||
|
||||
- Modify: `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/domain/dto/CcdiIntermediaryQueryDTO.java`
|
||||
- Modify: `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/domain/dto/CcdiIntermediaryPersonAddDTO.java`
|
||||
- Modify: `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/domain/dto/CcdiIntermediaryPersonEditDTO.java`
|
||||
- Create: `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/domain/dto/CcdiIntermediaryRelativeAddDTO.java`
|
||||
- Create: `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/domain/dto/CcdiIntermediaryRelativeEditDTO.java`
|
||||
- Modify: `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/domain/vo/CcdiIntermediaryVO.java`
|
||||
- Modify: `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/domain/vo/CcdiIntermediaryPersonDetailVO.java`
|
||||
- Create: `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/domain/vo/CcdiIntermediaryRelativeVO.java`
|
||||
|
||||
- [ ] **Step 1: 修改首页查询 DTO**
|
||||
|
||||
将 `CcdiIntermediaryQueryDTO` 调整为:
|
||||
|
||||
```java
|
||||
private String name;
|
||||
private String certificateNo;
|
||||
private String recordType;
|
||||
private String relatedIntermediaryKeyword;
|
||||
```
|
||||
|
||||
- [ ] **Step 2: 收敛中介本人新增 DTO**
|
||||
|
||||
`CcdiIntermediaryPersonAddDTO` 仅保留中介本人字段,并在服务层固定写入:
|
||||
|
||||
```java
|
||||
personSubType = "本人";
|
||||
relatedNumId = null;
|
||||
```
|
||||
|
||||
- [ ] **Step 3: 新增亲属新增 / 编辑 DTO**
|
||||
|
||||
亲属 DTO 需要明确:
|
||||
|
||||
```java
|
||||
@NotBlank(message = "亲属关系不能为空")
|
||||
private String personSubType;
|
||||
```
|
||||
|
||||
并在实现中拒绝 `"本人"`。
|
||||
|
||||
- [ ] **Step 4: 改造首页统一列表 VO**
|
||||
|
||||
`CcdiIntermediaryVO` 收敛为:
|
||||
|
||||
```java
|
||||
private String recordType;
|
||||
private String recordId;
|
||||
private String name;
|
||||
private String certificateNo;
|
||||
private String relatedIntermediaryName;
|
||||
private String relationText;
|
||||
private Date createTime;
|
||||
```
|
||||
|
||||
- [ ] **Step 5: 新增亲属 VO 并整理详情返回**
|
||||
|
||||
Expected: 前后端不再复用旧“个人 / 机构并列”字段集合。
|
||||
|
||||
- [ ] **Step 6: 提交 DTO / VO 重构**
|
||||
|
||||
```bash
|
||||
git add ccdi-info-collection/src/main/java/com/ruoyi/info/collection/domain/dto ccdi-info-collection/src/main/java/com/ruoyi/info/collection/domain/vo
|
||||
git commit -m "feat: 调整中介本人亲属传输对象"
|
||||
```
|
||||
|
||||
### Task 3: 新增中介机构关系实体与 Mapper
|
||||
|
||||
**Files:**
|
||||
|
||||
- Create: `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/domain/CcdiIntermediaryEnterpriseRelation.java`
|
||||
- Create: `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/domain/dto/CcdiIntermediaryEnterpriseRelationAddDTO.java`
|
||||
- Create: `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/domain/dto/CcdiIntermediaryEnterpriseRelationEditDTO.java`
|
||||
- Create: `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/domain/vo/CcdiIntermediaryEnterpriseRelationVO.java`
|
||||
- Create: `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/mapper/CcdiIntermediaryEnterpriseRelationMapper.java`
|
||||
- Create: `ccdi-info-collection/src/main/resources/mapper/info/collection/CcdiIntermediaryEnterpriseRelationMapper.xml`
|
||||
- Reference: `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/domain/CcdiCustEnterpriseRelation.java`
|
||||
- Reference: `ccdi-info-collection/src/main/resources/mapper/info/collection/CcdiCustEnterpriseRelationMapper.xml`
|
||||
|
||||
- [ ] **Step 1: 新建关系实体**
|
||||
|
||||
```java
|
||||
@TableName("ccdi_intermediary_enterprise_relation")
|
||||
public class CcdiIntermediaryEnterpriseRelation implements Serializable {
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
private String intermediaryBizId;
|
||||
private String socialCreditCode;
|
||||
private String relationPersonPost;
|
||||
private String remark;
|
||||
}
|
||||
```
|
||||
|
||||
- [ ] **Step 2: 新建关系新增 / 编辑 DTO**
|
||||
|
||||
新增 DTO 需要校验:
|
||||
|
||||
```java
|
||||
@NotBlank(message = "统一社会信用代码不能为空")
|
||||
private String socialCreditCode;
|
||||
```
|
||||
|
||||
- [ ] **Step 3: 新建关系 VO**
|
||||
|
||||
VO 需要联查展示:
|
||||
|
||||
```java
|
||||
private Long id;
|
||||
private String intermediaryBizId;
|
||||
private String intermediaryName;
|
||||
private String intermediaryPersonId;
|
||||
private String socialCreditCode;
|
||||
private String enterpriseName;
|
||||
private String relationPersonPost;
|
||||
private String remark;
|
||||
private Date createTime;
|
||||
```
|
||||
|
||||
- [ ] **Step 4: 新建 Mapper 与 XML**
|
||||
|
||||
需要提供:
|
||||
|
||||
```xml
|
||||
<select id="selectByIntermediaryBizId" ... />
|
||||
<select id="selectDetailById" ... />
|
||||
<select id="existsByIntermediaryBizIdAndSocialCreditCode" ... />
|
||||
```
|
||||
|
||||
- [ ] **Step 5: 运行编译验证新链路能被 Spring 扫描**
|
||||
|
||||
Run: `mvn -pl ccdi-info-collection -am -DskipTests compile`
|
||||
Expected: `BUILD SUCCESS`
|
||||
|
||||
- [ ] **Step 6: 提交关系表 Java 链路**
|
||||
|
||||
```bash
|
||||
git add ccdi-info-collection/src/main/java/com/ruoyi/info/collection/domain/CcdiIntermediaryEnterpriseRelation.java ccdi-info-collection/src/main/java/com/ruoyi/info/collection/domain/dto/CcdiIntermediaryEnterpriseRelationAddDTO.java ccdi-info-collection/src/main/java/com/ruoyi/info/collection/domain/dto/CcdiIntermediaryEnterpriseRelationEditDTO.java ccdi-info-collection/src/main/java/com/ruoyi/info/collection/domain/vo/CcdiIntermediaryEnterpriseRelationVO.java ccdi-info-collection/src/main/java/com/ruoyi/info/collection/mapper/CcdiIntermediaryEnterpriseRelationMapper.java ccdi-info-collection/src/main/resources/mapper/info/collection/CcdiIntermediaryEnterpriseRelationMapper.xml
|
||||
git commit -m "feat: 新增中介机构关系后端链路"
|
||||
```
|
||||
|
||||
### Task 4: 重写首页三类记录联合查询
|
||||
|
||||
**Files:**
|
||||
|
||||
- Modify: `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/mapper/CcdiIntermediaryMapper.java`
|
||||
- Modify: `ccdi-info-collection/src/main/resources/mapper/info/collection/CcdiIntermediaryMapper.xml`
|
||||
- Modify: `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/domain/vo/CcdiIntermediaryVO.java`
|
||||
|
||||
- [ ] **Step 1: 先写 Mapper 测试,锁定三类记录口径**
|
||||
|
||||
在 `CcdiIntermediaryMapperTest` 中至少覆盖:
|
||||
|
||||
```java
|
||||
assertThat(records).extracting("recordType")
|
||||
.contains("INTERMEDIARY", "RELATIVE", "ENTERPRISE_RELATION");
|
||||
```
|
||||
|
||||
- [ ] **Step 2: 运行测试确认旧 SQL 不满足新断言**
|
||||
|
||||
Run: `mvn -pl ccdi-info-collection -am -Dtest=CcdiIntermediaryMapperTest test`
|
||||
Expected: FAIL,原因是旧 SQL 只返回个人 / 机构并列记录。
|
||||
|
||||
- [ ] **Step 3: 改写 `CcdiIntermediaryMapper.xml`**
|
||||
|
||||
三段 SQL 分别返回统一字段:
|
||||
|
||||
```sql
|
||||
'INTERMEDIARY' AS record_type
|
||||
'RELATIVE' AS record_type
|
||||
'ENTERPRISE_RELATION' AS record_type
|
||||
```
|
||||
|
||||
并统一别名为:
|
||||
|
||||
```sql
|
||||
record_id, name, certificate_no, related_intermediary_name, relation_text, create_time
|
||||
```
|
||||
|
||||
- [ ] **Step 4: 加入首页搜索条件**
|
||||
|
||||
`relatedIntermediaryKeyword` 同时匹配:
|
||||
|
||||
```sql
|
||||
related_name LIKE ...
|
||||
OR related_person_id LIKE ...
|
||||
```
|
||||
|
||||
- [ ] **Step 5: 运行测试确认联合查询通过**
|
||||
|
||||
Run: `mvn -pl ccdi-info-collection -am -Dtest=CcdiIntermediaryMapperTest test`
|
||||
Expected: PASS
|
||||
|
||||
- [ ] **Step 6: 提交首页联合查询改造**
|
||||
|
||||
```bash
|
||||
git add ccdi-info-collection/src/main/java/com/ruoyi/info/collection/mapper/CcdiIntermediaryMapper.java ccdi-info-collection/src/main/resources/mapper/info/collection/CcdiIntermediaryMapper.xml ccdi-info-collection/src/test/java/com/ruoyi/info/collection/mapper/CcdiIntermediaryMapperTest.java
|
||||
git commit -m "feat: 改造中介首页联合查询口径"
|
||||
```
|
||||
|
||||
### Task 5: 实现中介本人、亲属、机构关系服务逻辑
|
||||
|
||||
**Files:**
|
||||
|
||||
- Modify: `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/service/ICcdiIntermediaryService.java`
|
||||
- Modify: `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/service/impl/CcdiIntermediaryServiceImpl.java`
|
||||
- Modify: `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/domain/CcdiBizIntermediary.java`
|
||||
- Reference: `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/service/impl/CcdiCustEnterpriseRelationServiceImpl.java`
|
||||
|
||||
- [ ] **Step 1: 先写服务测试,锁定关键规则**
|
||||
|
||||
测试覆盖:
|
||||
|
||||
```java
|
||||
// 新增中介本人固定 personSubType=本人
|
||||
// 新增亲属时禁止 personSubType=本人
|
||||
// 删除中介本人会同时删除亲属和机构关系
|
||||
```
|
||||
|
||||
- [ ] **Step 2: 运行服务测试确认旧实现失败**
|
||||
|
||||
Run: `mvn -pl ccdi-info-collection -am -Dtest=CcdiIntermediaryServiceImplTest test`
|
||||
Expected: FAIL,原因是旧服务不支持亲属和关系表链路。
|
||||
|
||||
- [ ] **Step 3: 扩展服务接口**
|
||||
|
||||
新增方法:
|
||||
|
||||
```java
|
||||
List<CcdiIntermediaryRelativeVO> selectRelativeList(String bizId);
|
||||
int insertRelative(String bizId, CcdiIntermediaryRelativeAddDTO addDTO);
|
||||
int updateRelative(CcdiIntermediaryRelativeEditDTO editDTO);
|
||||
int deleteRelativeById(String relativeBizId);
|
||||
List<CcdiIntermediaryEnterpriseRelationVO> selectEnterpriseRelationList(String bizId);
|
||||
int insertEnterpriseRelation(String bizId, CcdiIntermediaryEnterpriseRelationAddDTO addDTO);
|
||||
int updateEnterpriseRelation(CcdiIntermediaryEnterpriseRelationEditDTO editDTO);
|
||||
int deleteEnterpriseRelationById(Long id);
|
||||
```
|
||||
|
||||
- [ ] **Step 4: 实现中介本人固定口径**
|
||||
|
||||
```java
|
||||
person.setPersonSubType("本人");
|
||||
person.setRelatedNumId(null);
|
||||
```
|
||||
|
||||
- [ ] **Step 5: 实现亲属校验**
|
||||
|
||||
亲属新增 / 编辑时:
|
||||
|
||||
```java
|
||||
if ("本人".equals(addDTO.getPersonSubType())) {
|
||||
throw new RuntimeException("亲属关系不能为本人");
|
||||
}
|
||||
```
|
||||
|
||||
- [ ] **Step 6: 实现机构关系校验**
|
||||
|
||||
校验:
|
||||
|
||||
```java
|
||||
enterpriseBaseInfoMapper.selectById(socialCreditCode) != null
|
||||
```
|
||||
|
||||
并拦截同一中介重复关系。
|
||||
|
||||
- [ ] **Step 7: 实现中介本人级联删除**
|
||||
|
||||
```java
|
||||
bizIntermediaryMapper.deleteById(bizId);
|
||||
bizIntermediaryMapper.delete(new LambdaQueryWrapper<CcdiBizIntermediary>()
|
||||
.eq(CcdiBizIntermediary::getRelatedNumId, bizId));
|
||||
enterpriseRelationMapper.delete(new LambdaQueryWrapper<CcdiIntermediaryEnterpriseRelation>()
|
||||
.eq(CcdiIntermediaryEnterpriseRelation::getIntermediaryBizId, bizId));
|
||||
```
|
||||
|
||||
- [ ] **Step 8: 运行服务测试确认通过**
|
||||
|
||||
Run: `mvn -pl ccdi-info-collection -am -Dtest=CcdiIntermediaryServiceImplTest test`
|
||||
Expected: PASS
|
||||
|
||||
- [ ] **Step 9: 提交服务层改造**
|
||||
|
||||
```bash
|
||||
git add ccdi-info-collection/src/main/java/com/ruoyi/info/collection/service/ICcdiIntermediaryService.java ccdi-info-collection/src/main/java/com/ruoyi/info/collection/service/impl/CcdiIntermediaryServiceImpl.java ccdi-info-collection/src/test/java/com/ruoyi/info/collection/service/CcdiIntermediaryServiceImplTest.java
|
||||
git commit -m "feat: 实现中介主从结构服务逻辑"
|
||||
```
|
||||
|
||||
### Task 6: 暴露控制器子资源接口
|
||||
|
||||
**Files:**
|
||||
|
||||
- Modify: `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/controller/CcdiIntermediaryController.java`
|
||||
- Create: `ccdi-info-collection/src/test/java/com/ruoyi/info/collection/controller/CcdiIntermediaryControllerTest.java`
|
||||
|
||||
- [ ] **Step 1: 先写控制器测试**
|
||||
|
||||
至少覆盖:
|
||||
|
||||
```java
|
||||
GET /ccdi/intermediary/{bizId}/relatives
|
||||
POST /ccdi/intermediary/{bizId}/relative
|
||||
GET /ccdi/intermediary/{bizId}/enterprise-relations
|
||||
POST /ccdi/intermediary/{bizId}/enterprise-relation
|
||||
```
|
||||
|
||||
- [ ] **Step 2: 运行测试确认接口未实现时失败**
|
||||
|
||||
Run: `mvn -pl ccdi-info-collection -am -Dtest=CcdiIntermediaryControllerTest test`
|
||||
Expected: FAIL
|
||||
|
||||
- [ ] **Step 3: 补亲属子资源接口**
|
||||
|
||||
```java
|
||||
@GetMapping("/{bizId}/relatives")
|
||||
@PostMapping("/{bizId}/relative")
|
||||
@GetMapping("/relative/{relativeBizId}")
|
||||
@PutMapping("/relative")
|
||||
@DeleteMapping("/relative/{relativeBizId}")
|
||||
```
|
||||
|
||||
- [ ] **Step 4: 补机构关系子资源接口**
|
||||
|
||||
```java
|
||||
@GetMapping("/{bizId}/enterprise-relations")
|
||||
@PostMapping("/{bizId}/enterprise-relation")
|
||||
@GetMapping("/enterprise-relation/{id}")
|
||||
@PutMapping("/enterprise-relation")
|
||||
@DeleteMapping("/enterprise-relation/{id}")
|
||||
```
|
||||
|
||||
- [ ] **Step 5: 调整原有中介本人接口注释与语义**
|
||||
|
||||
Expected: Swagger 注释不再出现“机构中介新增 / 编辑”旧语义。
|
||||
|
||||
- [ ] **Step 6: 运行控制器测试确认通过**
|
||||
|
||||
Run: `mvn -pl ccdi-info-collection -am -Dtest=CcdiIntermediaryControllerTest test`
|
||||
Expected: PASS
|
||||
|
||||
- [ ] **Step 7: 提交控制器改造**
|
||||
|
||||
```bash
|
||||
git add ccdi-info-collection/src/main/java/com/ruoyi/info/collection/controller/CcdiIntermediaryController.java ccdi-info-collection/src/test/java/com/ruoyi/info/collection/controller/CcdiIntermediaryControllerTest.java
|
||||
git commit -m "feat: 新增中介亲属和机构关系接口"
|
||||
```
|
||||
|
||||
### Task 7: 完成整体回归验证
|
||||
|
||||
**Files:**
|
||||
|
||||
- Modify: `docs/plans/backend/2026-04-17-intermediary-library-refactor-backend-implementation.md`
|
||||
执行阶段补充真实验证结果。
|
||||
|
||||
- [ ] **Step 1: 运行中介模块定向测试**
|
||||
|
||||
Run: `mvn -pl ccdi-info-collection -am -Dtest=CcdiIntermediaryServiceImplTest,CcdiIntermediaryMapperTest,CcdiIntermediaryControllerTest test`
|
||||
Expected: `BUILD SUCCESS`
|
||||
|
||||
- [ ] **Step 2: 运行模块编译**
|
||||
|
||||
Run: `mvn -pl ccdi-info-collection -am -DskipTests compile`
|
||||
Expected: `BUILD SUCCESS`
|
||||
|
||||
- [ ] **Step 3: 如需验证 SQL,使用 UTF-8 脚本执行**
|
||||
|
||||
Run: `bin/mysql_utf8_exec.sh sql/migration/2026-04-17-create-intermediary-enterprise-relation.sql`
|
||||
Expected: 关系表创建成功,无乱码。
|
||||
|
||||
- [ ] **Step 4: 记录真实执行结果**
|
||||
|
||||
Expected: 文档中补充实际命令和结果,不写假数据。
|
||||
|
||||
- [ ] **Step 5: 汇总并提交**
|
||||
|
||||
```bash
|
||||
git add docs/plans/backend/2026-04-17-intermediary-library-refactor-backend-implementation.md
|
||||
git commit -m "docs: 更新中介库后端实施计划执行结果"
|
||||
```
|
||||
|
||||
## 验证命令
|
||||
|
||||
```bash
|
||||
mvn -pl ccdi-info-collection -am -Dtest=CcdiIntermediaryServiceImplTest,CcdiIntermediaryMapperTest,CcdiIntermediaryControllerTest test
|
||||
mvn -pl ccdi-info-collection -am -DskipTests compile
|
||||
bin/mysql_utf8_exec.sh sql/migration/2026-04-17-create-intermediary-enterprise-relation.sql
|
||||
```
|
||||
|
||||
## 完成标准
|
||||
|
||||
- `ccdi_intermediary_enterprise_relation` 表与唯一约束创建完成
|
||||
- 中介本人固定使用 `person_sub_type=本人`
|
||||
- 亲属使用 `person_sub_type` 表达关系,并通过 `related_num_id` 关联所属中介
|
||||
- 首页列表统一返回“中介本人 / 亲属 / 机构关系”三类记录
|
||||
- 中介本人、亲属、机构关系接口链路完整
|
||||
- 删除中介本人时会删除亲属和机构关系,但不会删除机构主档
|
||||
- 后端定向测试、编译与 SQL 验证命令已执行并记录真实结果
|
||||
@@ -0,0 +1,79 @@
|
||||
# 2026-04-17 TongWeb 接入实施记录
|
||||
|
||||
## 1. 改动目标
|
||||
|
||||
- 按 TongWeb 接入指南将后端默认内嵌容器从 Tomcat 切换为 TongWeb
|
||||
- 保持当前 Spring Boot 3.5.8 工程结构不变,按 Jakarta 体系接入 TongWeb 3.x Starter
|
||||
- 将 TongWeb license 随 `ruoyi-admin` 产物一起打包,并补齐可回归测试
|
||||
|
||||
## 2. 实施内容
|
||||
|
||||
### 2.1 Maven 依赖与仓库配置
|
||||
|
||||
涉及文件:
|
||||
|
||||
- `pom.xml`
|
||||
- `ruoyi-admin/pom.xml`
|
||||
|
||||
实施内容:
|
||||
|
||||
- 在根 `pom.xml` 增加 `tongweb.version=7.0.E.7`
|
||||
- 在根 `pom.xml` 增加 TongWeb Maven 仓库 `https://mvn.elitescloud.com/nexus/repository/maven-releases/`
|
||||
- 在根 `pom.xml` 的 `dependencyManagement` 中声明 `com.tongweb.springboot:tongweb-spring-boot-starter-3.x`
|
||||
- 在 `ruoyi-admin/pom.xml` 中对 `ruoyi-framework` 传递进来的 `spring-boot-starter-tomcat` 做排除
|
||||
- 在 `ruoyi-admin/pom.xml` 中引入 `tongweb-spring-boot-starter-3.x`
|
||||
- 在 `ruoyi-admin/pom.xml` 中显式保留 `src/main/resources` 资源打包规则,确保 `.dat` 文件进入产物
|
||||
|
||||
说明:
|
||||
|
||||
- 指南中的 `tongweb-spring-boot-starter-2.x` 仅适用于 Spring Boot 2.x
|
||||
- 当前仓库为 Spring Boot 3.5.8,因此本次按 TongWeb 3.x Starter 接入,避免 Jakarta/Servlet 版本不兼容
|
||||
|
||||
### 2.2 TongWeb 基础配置与 license 资源
|
||||
|
||||
涉及文件:
|
||||
|
||||
- `ruoyi-admin/src/main/resources/application.yml`
|
||||
- `ruoyi-admin/src/main/resources/Tongweb_license.dat`
|
||||
|
||||
实施内容:
|
||||
|
||||
- 在基础配置 `application.yml` 中新增 `server.tongweb.license.path=classpath:Tongweb_license.dat`
|
||||
- 将 TongWeb license 以 `Tongweb_license.dat` 固定名称放入 `ruoyi-admin/src/main/resources/`
|
||||
- 保留现有环境文件中的 `server.tomcat.*` 配置,先不做额外收缩,后续仅在 TongWeb 启动日志明确报冲突时再按最小范围调整
|
||||
|
||||
### 2.3 回归测试补齐
|
||||
|
||||
涉及文件:
|
||||
|
||||
- `ruoyi-admin/src/test/java/com/ruoyi/config/TongWebIntegrationConfigurationTest.java`
|
||||
|
||||
实施内容:
|
||||
|
||||
- 新增 classpath 资源测试,校验 `Tongweb_license.dat` 能从测试类路径读取
|
||||
- 新增基础配置测试,校验 `application.yml` 中存在 `server.tongweb.license.path`
|
||||
- 测试目标是防止后续重构时误删 TongWeb 配置或 license 资源
|
||||
|
||||
## 3. 验证项
|
||||
|
||||
建议执行以下命令:
|
||||
|
||||
```bash
|
||||
mvn -pl ruoyi-admin -am test -Dtest=TongWebIntegrationConfigurationTest,LogbackConfigurationTest
|
||||
mvn -pl ruoyi-admin -am package -DskipTests
|
||||
mvn -pl ruoyi-admin -am dependency:tree "-Dincludes=com.tongweb.springboot:*,com.tongweb:*,org.apache.tomcat.embed:*"
|
||||
jar tf ruoyi-admin/target/ruoyi-admin.jar | rg 'Tongweb_license.dat|tongweb'
|
||||
```
|
||||
|
||||
验证重点:
|
||||
|
||||
- TongWeb 依赖能够正常解析
|
||||
- `spring-boot-starter-tomcat` 不再作为 `ruoyi-admin` 主依赖链出现
|
||||
- `Tongweb_license.dat` 已进入打包产物
|
||||
- TongWeb 相关 jar 已进入 `BOOT-INF/lib/`
|
||||
|
||||
## 4. 结论
|
||||
|
||||
- 本次接入保持现有工程结构与启动入口不变,仅替换内嵌 Servlet 容器实现
|
||||
- 接入链路已经覆盖依赖、配置、资源与自动化校验四个层面
|
||||
- 后续若要做运行态验证,可继续基于本次改造执行 `spring-boot:run` 或打包后启动,并在验证完成后关闭测试进程
|
||||
@@ -0,0 +1,33 @@
|
||||
# 员工信息页资产提示文案移除前端实施计划
|
||||
|
||||
> **For agentic workers:** REQUIRED: Use superpowers:subagent-driven-development (if subagents available) or superpowers:executing-plans to implement this plan. Steps use checkbox (`- [ ]`) syntax for tracking.
|
||||
|
||||
**Goal:** 移除员工信息页资产信息区域中“员工信息页仅维护员工本人资产”“资产持有人默认为当前员工本人,无需额外填写”的备注展示。
|
||||
|
||||
**Architecture:** 本次仅调整员工信息维护页模板展示,不改动资产表单字段、默认值、提交参数或后端接口。实现上直接删除备注 DOM 和对应样式,保持页面其余交互不变。
|
||||
|
||||
**Tech Stack:** Vue 2, Element UI, JavaScript, Markdown
|
||||
|
||||
---
|
||||
|
||||
## 文件结构与职责
|
||||
|
||||
- `ruoyi-ui/src/views/ccdiBaseStaff/index.vue`
|
||||
删除资产信息区域的备注文案和无用样式。
|
||||
|
||||
## 实施步骤
|
||||
|
||||
- [ ] 删除资产信息区备注展示块
|
||||
- [ ] 删除 `assets-helper` 对应样式,避免残留无用 CSS
|
||||
- [ ] 运行前端构建确认页面模板调整未引入语法错误
|
||||
|
||||
## 验证
|
||||
|
||||
```bash
|
||||
source ~/.nvm/nvm.sh && nvm use 14.21.3 >/dev/null && npm run build:prod
|
||||
```
|
||||
|
||||
## 完成标准
|
||||
|
||||
- 员工信息页不再展示上述两条资产备注
|
||||
- 资产新增、编辑、提交逻辑保持不变
|
||||
@@ -0,0 +1,53 @@
|
||||
# 员工基础信息新增是否党员字段前端实施计划
|
||||
|
||||
> **For agentic workers:** REQUIRED: Use superpowers:subagent-driven-development (if subagents available) or superpowers:executing-plans to implement this plan. Steps use checkbox (`- [ ]`) syntax for tracking.
|
||||
|
||||
**Goal:** 在员工信息维护页面新增“是否党员”基础字段,并打通列表展示、详情回显、编辑录入与导入失败记录展示。
|
||||
|
||||
**Architecture:** 保持 `ruoyi-ui/src/views/ccdiBaseStaff/index.vue` 的现有页面结构不变,仅在已有“基本信息”区域与员工列表中插入一个新字段。字段值与后端保持一致,前端统一使用 `0/1` 数值口径,并通过页面内格式化方法展示为“是/否”。
|
||||
|
||||
**Tech Stack:** Vue 2, Element UI, JavaScript, npm, nvm, Markdown
|
||||
|
||||
---
|
||||
|
||||
## 文件结构与职责
|
||||
|
||||
**前端源码**
|
||||
|
||||
- `ruoyi-ui/src/views/ccdiBaseStaff/index.vue`
|
||||
新增列表列、编辑表单、详情弹窗、失败记录弹窗和格式化方法。
|
||||
|
||||
**依赖接口**
|
||||
|
||||
- `ruoyi-ui/src/api/ccdiBaseStaff.js`
|
||||
本次接口路径不变,继续复用现有新增/编辑/详情 API,只承接新增字段。
|
||||
|
||||
## 实施步骤
|
||||
|
||||
- [ ] 在员工列表中增加“是否党员”列,统一显示“是/否”。
|
||||
- [ ] 在新增/编辑弹窗的基本信息区域增加“是否党员”单选项,默认值设为“否”。
|
||||
- [ ] 在详情弹窗中增加“是否党员”展示,保证历史员工查看时能回显。
|
||||
- [ ] 在导入失败记录弹窗中增加“是否党员”列,便于排查模板数据问题。
|
||||
- [ ] 在页面 methods 中新增 `formatPartyMember`,统一处理 `0/1/null` 的展示。
|
||||
- [ ] 使用 `nvm` 选择当前机器可用的 Node 版本后执行前端构建验证。
|
||||
|
||||
## 验证记录
|
||||
|
||||
- 已尝试执行:
|
||||
|
||||
```bash
|
||||
source ~/.nvm/nvm.sh && nvm use
|
||||
source ~/.nvm/nvm.sh && nvm use 14.21.3 && npm run build:prod
|
||||
```
|
||||
|
||||
- 当前结果:
|
||||
- 仓库内未提供 `.nvmrc`,直接执行 `nvm use` 无法自动切到项目版本。
|
||||
- 当前机器存在 `v14.21.3`、`v25.9.0` 与 `system(v24.14.0)`,后续前端验证建议优先使用 `v14.21.3`。
|
||||
- 已使用 `v14.21.3` 成功执行 `npm run build:prod`,构建通过,仅保留项目原有的包体积告警。
|
||||
|
||||
## 完成标准
|
||||
|
||||
- 员工列表、详情、编辑弹窗可见“是否党员”
|
||||
- 提交新增/编辑时会带上 `partyMember`
|
||||
- 导入失败记录能展示该字段
|
||||
- 已明确前端构建使用 `nvm` 的版本前提与当前环境限制
|
||||
@@ -0,0 +1,24 @@
|
||||
# 员工信息仅展示本人资产前端实施计划
|
||||
|
||||
## 变更目标
|
||||
|
||||
- 员工信息页资产区域统一按“本人资产”口径展示
|
||||
- 详情弹窗移除“资产实际持有人身份证号”和“归属类型”
|
||||
- 员工资产编辑表单不再保留亲属资产相关提示与校验
|
||||
|
||||
## 变更范围
|
||||
|
||||
- `ruoyi-ui/src/views/ccdiBaseStaff/index.vue`
|
||||
|
||||
## 实施步骤
|
||||
|
||||
1. 更新资产信息区提示文案,明确员工信息页仅维护员工本人资产
|
||||
2. 删除详情弹窗中的“资产实际持有人身份证号”“归属类型”列
|
||||
3. 清理表单中 `personId` 的必填与格式校验,新增资产时默认带入当前员工身份证号
|
||||
4. 更新员工资产导入弹窗提示文案,明确仅允许导入员工本人资产
|
||||
|
||||
## 验证要点
|
||||
|
||||
- 员工详情弹窗仅显示本人资产字段
|
||||
- 新增、编辑员工资产时不再出现亲属资产口径提示
|
||||
- 员工身份证号变更后,表单内资产仍跟随当前员工身份证号
|
||||
@@ -0,0 +1,126 @@
|
||||
# 实体库管理前端实施计划
|
||||
|
||||
> **For agentic workers:** REQUIRED: Use superpowers:subagent-driven-development (if subagents available) or superpowers:executing-plans to implement this plan. Steps use checkbox (`- [ ]`) syntax for tracking.
|
||||
|
||||
**Goal:** 新增独立的实体库管理前端页面,打通查询、新增、查看、编辑、删除、导入、导入状态轮询与失败记录查看。
|
||||
|
||||
**Architecture:** 继续沿用员工信息维护的单页大文件实现方式,新建 `ccdiEnterpriseBaseInfo` 页面和独立 API 文件,不改造现有中介页面。选项数据统一从 `ccdiEnum` 拉取,列表、弹窗、导入和失败记录交互整体对齐员工信息维护,避免页面内再维护一套业务语义。
|
||||
|
||||
**Tech Stack:** Vue 2, Element UI, JavaScript, npm, nvm, Markdown
|
||||
|
||||
---
|
||||
|
||||
## 文件结构与职责
|
||||
|
||||
**前端源码**
|
||||
|
||||
- `ruoyi-ui/src/views/ccdiEnterpriseBaseInfo/index.vue`
|
||||
实体库管理主页面,负责搜索、表格、编辑弹窗、详情弹窗、导入和失败记录。
|
||||
- `ruoyi-ui/src/api/ccdiEnterpriseBaseInfo.js`
|
||||
新增实体库管理接口封装。
|
||||
- `ruoyi-ui/src/api/ccdiEnum.js`
|
||||
补风险等级与企业来源选项请求方法。
|
||||
|
||||
**依赖参考**
|
||||
|
||||
- `ruoyi-ui/src/views/ccdiBaseStaff/index.vue`
|
||||
作为页面结构、导入轮询、失败记录和工具栏交互模板。
|
||||
- `ruoyi-ui/src/views/ccdiIntermediary/index.vue`
|
||||
参考实体导入失败记录展示字段。
|
||||
- `ruoyi-ui/src/api/ccdiBaseStaff.js`
|
||||
参考单表管理 API 风格。
|
||||
|
||||
## 实施任务
|
||||
|
||||
### Task 1: 搭建实体库管理 API 与选项加载
|
||||
|
||||
**Files:**
|
||||
|
||||
- Create: `ruoyi-ui/src/api/ccdiEnterpriseBaseInfo.js`
|
||||
- Modify: `ruoyi-ui/src/api/ccdiEnum.js`
|
||||
|
||||
- [x] 在新 API 文件中定义 `listEnterpriseBaseInfo`、`getEnterpriseBaseInfo`、`addEnterpriseBaseInfo`、`updateEnterpriseBaseInfo`、`delEnterpriseBaseInfo`、`importTemplate`、`importData`、`getImportStatus`、`getImportFailures`。
|
||||
- [x] 在 `ccdiEnum.js` 中新增 `getEnterpriseRiskLevelOptions` 与 `getEnterpriseSourceOptions`。
|
||||
- [x] 继续复用现有 `getCorpTypeOptions`、`getCorpNatureOptions`、`getCertTypeOptions`、`getDataSourceOptions`。
|
||||
|
||||
### Task 2: 搭建页面骨架与查询表单
|
||||
|
||||
**Files:**
|
||||
|
||||
- Create: `ruoyi-ui/src/views/ccdiEnterpriseBaseInfo/index.vue`
|
||||
- Reference: `ruoyi-ui/src/views/ccdiBaseStaff/index.vue`
|
||||
|
||||
- [x] 初始化页面数据结构,至少包含 `loading`、`enterpriseBaseInfoList`、`queryParams`、`form`、`rules`、`open`、`detailOpen`、`upload`、`showFailureButton`。
|
||||
- [x] 查询区按设计文档落 `enterpriseName`、`socialCreditCode`、`enterpriseType`、`enterpriseNature`、`industryClass`、`status`、`riskLevel`、`entSource`。
|
||||
- [x] 在 `created` 或首屏初始化流程中并发拉取主体类型、企业性质、证件类型、风险等级、企业来源、数据来源选项。
|
||||
- [x] 搜索、重置、分页方法命名保持员工页一致,降低后续维护成本。
|
||||
|
||||
### Task 3: 完成列表、详情与编辑弹窗
|
||||
|
||||
**Files:**
|
||||
|
||||
- Modify: `ruoyi-ui/src/views/ccdiEnterpriseBaseInfo/index.vue`
|
||||
|
||||
- [x] 列表区展示企业名称、统一社会信用代码、企业类型、企业性质、行业分类、所属行业、法定代表人、经营状态、风险等级、企业来源、数据来源、创建时间。
|
||||
- [x] 通过格式化方法把 `riskLevel`、`entSource`、`dataSource` 展示成中文描述,不直接露出编码。
|
||||
- [x] 实现详情弹窗,只读展示与表单同口径字段。
|
||||
- [x] 实现新增/编辑弹窗,编辑态禁用统一社会信用代码输入框。
|
||||
- [x] 表单中补齐 `status`、`riskLevel`、`entSource`、`dataSource` 四个可维护字段。
|
||||
- [x] 提交时保持最短路径,不做额外参数转换层,只在需要时把空字符串标准化。
|
||||
|
||||
### Task 4: 完成删除、导入与失败记录流程
|
||||
|
||||
**Files:**
|
||||
|
||||
- Modify: `ruoyi-ui/src/views/ccdiEnterpriseBaseInfo/index.vue`
|
||||
|
||||
- [x] 删除逻辑对齐员工页,支持单条删除和批量删除。
|
||||
- [x] 新增导入弹窗配置,上传地址指向 `/ccdi/enterpriseBaseInfo/importData`。
|
||||
- [x] 导入完成后缓存最近一次任务号,建议 key 使用 `enterprise_base_info_import_last_task`。
|
||||
- [x] 增加导入状态轮询逻辑,状态结束后刷新列表并按结果决定是否显示“查看导入失败记录”按钮。
|
||||
- [x] 新增失败记录弹窗,至少展示企业名称、统一社会信用代码、企业类型、企业性质、风险等级、企业来源、失败原因。
|
||||
- [x] 提供“清除历史记录”能力,行为与员工页保持一致。
|
||||
|
||||
### Task 5: 补页面校验和展示细节
|
||||
|
||||
**Files:**
|
||||
|
||||
- Modify: `ruoyi-ui/src/views/ccdiEnterpriseBaseInfo/index.vue`
|
||||
|
||||
- [x] 为统一社会信用代码增加 18 位格式校验。
|
||||
- [x] 为企业名称、经营状态、风险等级、企业来源、数据来源增加必填校验。
|
||||
- [x] 新增 `formatRiskLevel`、`formatEnterpriseSource`、`formatDataSource`、`formatStatus` 等展示方法。
|
||||
- [x] 详情和列表统一复用格式化方法,避免页面出现双口径文本。
|
||||
|
||||
### Task 6: 执行前端构建验证
|
||||
|
||||
**Files:**
|
||||
|
||||
- Modify: `docs/plans/frontend/2026-04-17-enterprise-base-info-management-frontend-implementation.md`
|
||||
在执行阶段补实际验证结果。
|
||||
|
||||
- [x] 使用 `nvm` 切换 Node 版本,优先使用当前仓库已验证可构建的版本。
|
||||
- [x] 执行生产构建,确认页面编译通过。
|
||||
- [x] 若有构建阻塞,记录真实错误,不引入额外兼容方案。
|
||||
|
||||
## 验证命令
|
||||
|
||||
```bash
|
||||
cd /Users/wkc/Desktop/ccdi/ccdi/ruoyi-ui
|
||||
source ~/.nvm/nvm.sh && nvm use 14.21.3
|
||||
npm run build:prod
|
||||
```
|
||||
|
||||
## 执行结果
|
||||
|
||||
- 实际执行命令:`cd /Users/wkc/Desktop/ccdi/ccdi/ruoyi-ui && source ~/.nvm/nvm.sh && nvm use 14.21.3 && npm run build:prod`
|
||||
- 构建结果:`BUILD SUCCESS`
|
||||
- 备注:构建过程中仅有既有包体积告警(asset size / entrypoint size limit),未出现语法或模块解析错误
|
||||
|
||||
## 完成标准
|
||||
|
||||
- 前端新增独立“实体库管理”页面与 API 文件
|
||||
- 查询、分页、详情、新增、编辑、删除链路可用
|
||||
- 风险等级、企业来源、数据来源全部以统一选项口径展示和提交
|
||||
- 导入轮询、失败记录、历史任务缓存可用
|
||||
- 已使用 `nvm` 切换 Node 版本并完成前端构建验证
|
||||
@@ -0,0 +1,470 @@
|
||||
# 中介库主从结构改造前端实施计划
|
||||
|
||||
> **For agentic workers:** REQUIRED: Use superpowers:subagent-driven-development (if subagents available) or superpowers:executing-plans to implement this plan. Steps use checkbox (`- [ ]`) syntax for tracking.
|
||||
|
||||
**Goal:** 将中介库前端页面改造为“中介综合库”,支持三类记录统一列表展示、按记录类型分流编辑,并支持“先新增中介本人,再在详情中维护亲属和关联机构”的交互链路。
|
||||
|
||||
**Architecture:** 保留 `ruoyi-ui/src/views/ccdiIntermediary/` 作为唯一页面入口,不新增一级菜单和独立平行页面。首页搜索与表格改成统一口径,新增只新增中介本人;中介详情改成维护容器,内部承载中介本人信息、亲属列表、关联机构列表;亲属和机构关系通过独立编辑弹窗维护。
|
||||
|
||||
**Tech Stack:** Vue 2, Element UI, JavaScript, npm, nvm, Markdown
|
||||
|
||||
---
|
||||
|
||||
## 文件结构与职责
|
||||
|
||||
**设计与参考**
|
||||
|
||||
- `docs/design/2026-04-17-intermediary-library-refactor-design.md`
|
||||
本次前端实施的设计基线。
|
||||
|
||||
**前端 API**
|
||||
|
||||
- `ruoyi-ui/src/api/ccdiIntermediary.js`
|
||||
继续作为中介综合库 API 文件,补亲属与机构关系子资源接口,并收敛旧机构中介接口。
|
||||
|
||||
**页面主文件**
|
||||
|
||||
- `ruoyi-ui/src/views/ccdiIntermediary/index.vue`
|
||||
负责搜索、统一列表、三类记录分流、新增链路和详情联动。
|
||||
|
||||
**页面组件**
|
||||
|
||||
- `ruoyi-ui/src/views/ccdiIntermediary/components/SearchForm.vue`
|
||||
改为新搜索字段与提示文案。
|
||||
- `ruoyi-ui/src/views/ccdiIntermediary/components/DataTable.vue`
|
||||
改为固定五列表头和按 `recordType` 分流操作按钮。
|
||||
- `ruoyi-ui/src/views/ccdiIntermediary/components/DetailDialog.vue`
|
||||
从只读详情改为“中介详情维护容器”。
|
||||
- `ruoyi-ui/src/views/ccdiIntermediary/components/EditDialog.vue`
|
||||
收敛为中介本人新增 / 编辑弹窗,去掉旧机构中介表单。
|
||||
- `ruoyi-ui/src/views/ccdiIntermediary/components/RelativeEditDialog.vue`
|
||||
新增亲属编辑弹窗。
|
||||
- `ruoyi-ui/src/views/ccdiIntermediary/components/EnterpriseRelationEditDialog.vue`
|
||||
新增关联机构关系编辑弹窗。
|
||||
|
||||
**依赖参考**
|
||||
|
||||
- `ruoyi-ui/src/views/ccdiStaffFmyRelation/index.vue`
|
||||
参考亲属类表单字段与关系展示。
|
||||
- `ruoyi-ui/src/views/ccdiCustEnterpriseRelation/index.vue`
|
||||
参考关系类表单和列表交互。
|
||||
- `ruoyi-ui/src/views/ccdiBaseStaff/index.vue`
|
||||
参考统一页内搜索、分页与基础弹窗写法。
|
||||
|
||||
## 实施任务
|
||||
|
||||
### Task 1: 收敛 API 文件为三类记录统一链路
|
||||
|
||||
**Files:**
|
||||
|
||||
- Modify: `ruoyi-ui/src/api/ccdiIntermediary.js`
|
||||
|
||||
- [ ] **Step 1: 先梳理旧 API 的调用位置**
|
||||
|
||||
Run: `rg -n "addEntityIntermediary|getEntityIntermediary|updateEntityIntermediary" ruoyi-ui/src/views/ccdiIntermediary -S`
|
||||
Expected: 明确哪些旧机构中介方法会被移除或替换。
|
||||
|
||||
- [ ] **Step 2: 保留中介本人接口并调整命名语义**
|
||||
|
||||
保留:
|
||||
|
||||
```js
|
||||
listIntermediary(query)
|
||||
getPersonIntermediary(bizId)
|
||||
addPersonIntermediary(data)
|
||||
updatePersonIntermediary(data)
|
||||
```
|
||||
|
||||
- [ ] **Step 3: 新增亲属接口**
|
||||
|
||||
补充:
|
||||
|
||||
```js
|
||||
listIntermediaryRelatives(bizId)
|
||||
getIntermediaryRelative(relativeBizId)
|
||||
addIntermediaryRelative(bizId, data)
|
||||
updateIntermediaryRelative(data)
|
||||
delIntermediaryRelative(relativeBizId)
|
||||
```
|
||||
|
||||
- [ ] **Step 4: 新增机构关系接口**
|
||||
|
||||
补充:
|
||||
|
||||
```js
|
||||
listIntermediaryEnterpriseRelations(bizId)
|
||||
getIntermediaryEnterpriseRelation(id)
|
||||
addIntermediaryEnterpriseRelation(bizId, data)
|
||||
updateIntermediaryEnterpriseRelation(data)
|
||||
delIntermediaryEnterpriseRelation(id)
|
||||
```
|
||||
|
||||
- [ ] **Step 5: 删除前端对旧机构中介 CRUD 的直接依赖**
|
||||
|
||||
Expected: 不再调用旧 `/ccdi/intermediary/entity` 新增 / 修改接口。
|
||||
|
||||
- [ ] **Step 6: 提交 API 调整**
|
||||
|
||||
```bash
|
||||
git add ruoyi-ui/src/api/ccdiIntermediary.js
|
||||
git commit -m "feat: 调整中介综合库前端接口"
|
||||
```
|
||||
|
||||
### Task 2: 改造搜索表单和首页查询参数
|
||||
|
||||
**Files:**
|
||||
|
||||
- Modify: `ruoyi-ui/src/views/ccdiIntermediary/index.vue`
|
||||
- Modify: `ruoyi-ui/src/views/ccdiIntermediary/components/SearchForm.vue`
|
||||
|
||||
- [ ] **Step 1: 先写页面数据结构变更**
|
||||
|
||||
将 `queryParams` 收敛为:
|
||||
|
||||
```js
|
||||
{
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
name: null,
|
||||
certificateNo: null,
|
||||
recordType: null,
|
||||
relatedIntermediaryKeyword: null
|
||||
}
|
||||
```
|
||||
|
||||
- [ ] **Step 2: 修改搜索表单字段**
|
||||
|
||||
搜索区固定为:
|
||||
|
||||
```vue
|
||||
名称
|
||||
证件号
|
||||
记录类型
|
||||
关联中介信息
|
||||
```
|
||||
|
||||
- [ ] **Step 3: 为“关联中介信息”补提示文案**
|
||||
|
||||
文案示例:
|
||||
|
||||
```vue
|
||||
placeholder="请输入关联中介姓名或证件号"
|
||||
```
|
||||
|
||||
- [ ] **Step 4: 移除旧“中介类型”搜索**
|
||||
|
||||
Expected: 页面上不再出现“个人 / 机构”并列筛选语义。
|
||||
|
||||
- [ ] **Step 5: 运行本地 lint 前自查**
|
||||
|
||||
Expected: 查询参数和表单字段命名完全一致,没有遗留旧字段。
|
||||
|
||||
- [ ] **Step 6: 提交搜索区改造**
|
||||
|
||||
```bash
|
||||
git add ruoyi-ui/src/views/ccdiIntermediary/index.vue ruoyi-ui/src/views/ccdiIntermediary/components/SearchForm.vue
|
||||
git commit -m "feat: 调整中介综合库搜索条件"
|
||||
```
|
||||
|
||||
### Task 3: 改造统一列表与三类记录操作分流
|
||||
|
||||
**Files:**
|
||||
|
||||
- Modify: `ruoyi-ui/src/views/ccdiIntermediary/components/DataTable.vue`
|
||||
- Modify: `ruoyi-ui/src/views/ccdiIntermediary/index.vue`
|
||||
|
||||
- [ ] **Step 1: 先写出列表固定列结构**
|
||||
|
||||
表格列固定为:
|
||||
|
||||
```vue
|
||||
名称
|
||||
证件号
|
||||
关联中介姓名
|
||||
关联关系
|
||||
创建时间
|
||||
操作
|
||||
```
|
||||
|
||||
- [ ] **Step 2: 让表格读取统一字段**
|
||||
|
||||
统一使用:
|
||||
|
||||
```js
|
||||
row.name
|
||||
row.certificateNo
|
||||
row.relatedIntermediaryName
|
||||
row.relationText
|
||||
row.createTime
|
||||
```
|
||||
|
||||
- [ ] **Step 3: 按 `recordType` 渲染操作按钮**
|
||||
|
||||
逻辑示例:
|
||||
|
||||
```js
|
||||
if (row.recordType === 'INTERMEDIARY') { ... }
|
||||
if (row.recordType === 'RELATIVE') { ... }
|
||||
if (row.recordType === 'ENTERPRISE_RELATION') { ... }
|
||||
```
|
||||
|
||||
- [ ] **Step 4: 在 `index.vue` 中改造 `handleDetail` / `handleUpdate` / `handleDelete`**
|
||||
|
||||
Expected: 三类记录进入不同弹窗和不同删除接口。
|
||||
|
||||
- [ ] **Step 5: 删除对旧机构中介详情弹窗的依赖**
|
||||
|
||||
Expected: 首页不再把机构主档当作中介主记录。
|
||||
|
||||
- [ ] **Step 6: 提交列表分流改造**
|
||||
|
||||
```bash
|
||||
git add ruoyi-ui/src/views/ccdiIntermediary/components/DataTable.vue ruoyi-ui/src/views/ccdiIntermediary/index.vue
|
||||
git commit -m "feat: 改造中介综合库统一列表"
|
||||
```
|
||||
|
||||
### Task 4: 收敛中介本人编辑弹窗
|
||||
|
||||
**Files:**
|
||||
|
||||
- Modify: `ruoyi-ui/src/views/ccdiIntermediary/components/EditDialog.vue`
|
||||
- Modify: `ruoyi-ui/src/views/ccdiIntermediary/index.vue`
|
||||
|
||||
- [ ] **Step 1: 删除旧“个人 / 机构二选一”入口**
|
||||
|
||||
Expected: 新增按钮点击后直接打开中介本人表单,不再先选类型。
|
||||
|
||||
- [ ] **Step 2: 删除旧机构中介表单片段**
|
||||
|
||||
Expected: `EditDialog.vue` 仅保留中介本人字段。
|
||||
|
||||
- [ ] **Step 3: 在提交前固定前端口径**
|
||||
|
||||
前端不让用户选择:
|
||||
|
||||
```js
|
||||
form.personSubType = '本人'
|
||||
form.relatedNumId = null
|
||||
```
|
||||
|
||||
- [ ] **Step 4: 保存成功后自动进入中介详情维护页**
|
||||
|
||||
在 `index.vue` 中串起:
|
||||
|
||||
```js
|
||||
await addPersonIntermediary(data)
|
||||
await openDetailByBizId(...)
|
||||
```
|
||||
|
||||
- [ ] **Step 5: 自查编辑态**
|
||||
|
||||
Expected: 修改中介本人时仍可正常加载详情和更新,但不允许切换为亲属语义。
|
||||
|
||||
- [ ] **Step 6: 提交中介本人弹窗改造**
|
||||
|
||||
```bash
|
||||
git add ruoyi-ui/src/views/ccdiIntermediary/components/EditDialog.vue ruoyi-ui/src/views/ccdiIntermediary/index.vue
|
||||
git commit -m "feat: 收敛中介本人编辑弹窗"
|
||||
```
|
||||
|
||||
### Task 5: 新增亲属编辑弹窗
|
||||
|
||||
**Files:**
|
||||
|
||||
- Create: `ruoyi-ui/src/views/ccdiIntermediary/components/RelativeEditDialog.vue`
|
||||
- Modify: `ruoyi-ui/src/views/ccdiIntermediary/index.vue`
|
||||
- Reference: `ruoyi-ui/src/views/ccdiStaffFmyRelation/index.vue`
|
||||
|
||||
- [ ] **Step 1: 新建亲属弹窗组件骨架**
|
||||
|
||||
最小 props:
|
||||
|
||||
```js
|
||||
visible
|
||||
title
|
||||
form
|
||||
relationTypeOptions
|
||||
certTypeOptions
|
||||
ownerName
|
||||
```
|
||||
|
||||
- [ ] **Step 2: 布置亲属字段**
|
||||
|
||||
至少包含:
|
||||
|
||||
```vue
|
||||
姓名
|
||||
证件号
|
||||
证件类型
|
||||
性别
|
||||
手机号码
|
||||
联系地址
|
||||
亲属关系(personSubType)
|
||||
备注
|
||||
所属中介姓名(只读)
|
||||
```
|
||||
|
||||
- [ ] **Step 3: 禁止选择“本人”**
|
||||
|
||||
Expected: 亲属关系选项中过滤掉 `本人`。
|
||||
|
||||
- [ ] **Step 4: 在 `index.vue` 中接入新增 / 编辑 / 删除亲属流程**
|
||||
|
||||
Expected: 首页点亲属记录可直接编辑;详情页也可新增亲属。
|
||||
|
||||
- [ ] **Step 5: 保存成功后刷新首页和详情内亲属列表**
|
||||
|
||||
Expected: 无需手工刷新页面。
|
||||
|
||||
- [ ] **Step 6: 提交亲属弹窗链路**
|
||||
|
||||
```bash
|
||||
git add ruoyi-ui/src/views/ccdiIntermediary/components/RelativeEditDialog.vue ruoyi-ui/src/views/ccdiIntermediary/index.vue
|
||||
git commit -m "feat: 新增中介亲属编辑弹窗"
|
||||
```
|
||||
|
||||
### Task 6: 新增机构关系编辑弹窗
|
||||
|
||||
**Files:**
|
||||
|
||||
- Create: `ruoyi-ui/src/views/ccdiIntermediary/components/EnterpriseRelationEditDialog.vue`
|
||||
- Modify: `ruoyi-ui/src/views/ccdiIntermediary/index.vue`
|
||||
- Reference: `ruoyi-ui/src/views/ccdiCustEnterpriseRelation/index.vue`
|
||||
|
||||
- [ ] **Step 1: 新建机构关系弹窗组件骨架**
|
||||
|
||||
最小 props:
|
||||
|
||||
```js
|
||||
visible
|
||||
title
|
||||
form
|
||||
ownerName
|
||||
```
|
||||
|
||||
- [ ] **Step 2: 布置机构关系字段**
|
||||
|
||||
固定字段为:
|
||||
|
||||
```vue
|
||||
统一社会信用代码
|
||||
关联角色/职务(relationPersonPost)
|
||||
备注
|
||||
所属中介姓名(只读)
|
||||
```
|
||||
|
||||
- [ ] **Step 3: 只做关系维护,不出现机构主档字段**
|
||||
|
||||
Expected: 不出现企业性质、法定代表人等机构主档表单项。
|
||||
|
||||
- [ ] **Step 4: 在 `index.vue` 中接入新增 / 编辑 / 删除机构关系流程**
|
||||
|
||||
Expected: 首页点机构关系记录可直接编辑;详情页也可新增关系。
|
||||
|
||||
- [ ] **Step 5: 保存成功后刷新首页和详情内机构关系列表**
|
||||
|
||||
Expected: 新增关系后首页能查到该条记录。
|
||||
|
||||
- [ ] **Step 6: 提交机构关系弹窗链路**
|
||||
|
||||
```bash
|
||||
git add ruoyi-ui/src/views/ccdiIntermediary/components/EnterpriseRelationEditDialog.vue ruoyi-ui/src/views/ccdiIntermediary/index.vue
|
||||
git commit -m "feat: 新增中介机构关系编辑弹窗"
|
||||
```
|
||||
|
||||
### Task 7: 将详情弹窗改为中介详情维护容器
|
||||
|
||||
**Files:**
|
||||
|
||||
- Modify: `ruoyi-ui/src/views/ccdiIntermediary/components/DetailDialog.vue`
|
||||
- Modify: `ruoyi-ui/src/views/ccdiIntermediary/index.vue`
|
||||
|
||||
- [ ] **Step 1: 先定义详情容器需要的数据结构**
|
||||
|
||||
至少包括:
|
||||
|
||||
```js
|
||||
personDetail
|
||||
relativeList
|
||||
enterpriseRelationList
|
||||
```
|
||||
|
||||
- [ ] **Step 2: 将详情弹窗改为三个分区**
|
||||
|
||||
分区固定为:
|
||||
|
||||
```vue
|
||||
中介基本信息
|
||||
亲属信息
|
||||
关联机构信息
|
||||
```
|
||||
|
||||
- [ ] **Step 3: 在亲属分区增加“新增亲属 / 编辑 / 删除”**
|
||||
|
||||
Expected: 用户在中介详情中即可维护名下亲属。
|
||||
|
||||
- [ ] **Step 4: 在机构关系分区增加“新增关联机构 / 编辑 / 删除”**
|
||||
|
||||
Expected: 用户在中介详情中即可维护名下机构关系。
|
||||
|
||||
- [ ] **Step 5: 让首页新增成功后自动打开该详情容器**
|
||||
|
||||
Expected: 完整符合“先建中介,再在下面维护”的流程。
|
||||
|
||||
- [ ] **Step 6: 提交详情维护容器改造**
|
||||
|
||||
```bash
|
||||
git add ruoyi-ui/src/views/ccdiIntermediary/components/DetailDialog.vue ruoyi-ui/src/views/ccdiIntermediary/index.vue
|
||||
git commit -m "feat: 改造中介详情维护容器"
|
||||
```
|
||||
|
||||
### Task 8: 执行前端构建验证
|
||||
|
||||
**Files:**
|
||||
|
||||
- Modify: `docs/plans/frontend/2026-04-17-intermediary-library-refactor-frontend-implementation.md`
|
||||
在执行阶段补充真实验证结果。
|
||||
|
||||
- [ ] **Step 1: 使用 nvm 切换前端 Node 版本**
|
||||
|
||||
Run: `cd /Users/wkc/Desktop/ccdi/ccdi/ruoyi-ui && source ~/.nvm/nvm.sh && nvm use 14.21.3`
|
||||
Expected: 输出 `Now using node v14.21.3`
|
||||
|
||||
- [ ] **Step 2: 执行生产构建**
|
||||
|
||||
Run: `cd /Users/wkc/Desktop/ccdi/ccdi/ruoyi-ui && source ~/.nvm/nvm.sh && nvm use 14.21.3 && npm run build:prod`
|
||||
Expected: 构建成功,无语法错误和模块缺失错误。
|
||||
|
||||
- [ ] **Step 3: 如需联调,启动前端后手工验证关键链路**
|
||||
|
||||
Run: `cd /Users/wkc/Desktop/ccdi/ccdi/ruoyi-ui && source ~/.nvm/nvm.sh && nvm use 14.21.3 && npm run dev`
|
||||
Expected: 页面可打开,退出后主动结束进程。
|
||||
|
||||
- [ ] **Step 4: 记录真实执行结果**
|
||||
|
||||
Expected: 文档中补充实际命令与结果,不写假数据。
|
||||
|
||||
- [ ] **Step 5: 提交验证结果**
|
||||
|
||||
```bash
|
||||
git add docs/plans/frontend/2026-04-17-intermediary-library-refactor-frontend-implementation.md
|
||||
git commit -m "docs: 更新中介库前端实施计划执行结果"
|
||||
```
|
||||
|
||||
## 验证命令
|
||||
|
||||
```bash
|
||||
cd /Users/wkc/Desktop/ccdi/ccdi/ruoyi-ui
|
||||
source ~/.nvm/nvm.sh && nvm use 14.21.3
|
||||
npm run build:prod
|
||||
```
|
||||
|
||||
## 完成标准
|
||||
|
||||
- 首页搜索字段调整为名称、证件号、记录类型、关联中介信息
|
||||
- 首页列表固定展示名称、证件号、关联中介姓名、关联关系、创建时间
|
||||
- 新增按钮只新增中介本人,不再新增机构中介主记录
|
||||
- 首页能同时展示中介本人、亲属、机构关系三类记录
|
||||
- 首页点击亲属或机构关系记录可直接进入各自编辑弹窗
|
||||
- 中介详情支持维护中介本人、亲属列表、机构关系列表
|
||||
- 前端已使用 `nvm` 指定 Node 版本并完成构建验证
|
||||
437
docs/plans/fullstack/2026-04-09-account-library-design.md
Normal file
437
docs/plans/fullstack/2026-04-09-account-library-design.md
Normal file
@@ -0,0 +1,437 @@
|
||||
# 账户库管理设计方案
|
||||
|
||||
## 1. 背景与目标
|
||||
|
||||
当前系统在“信息维护”下已具备员工信息维护、员工亲属关系维护等基础档案能力,但尚未形成独立的“账户库管理”。现有员工表 `ccdi_base_staff` 与员工亲属关系表 `ccdi_staff_fmy_relation` 中均不承载完整账户信息,无法满足后续账户台账维护、手工补录、导入和账户分析展示的需要。
|
||||
|
||||
本次设计目标如下:
|
||||
|
||||
- 在“信息维护”菜单下新增“账户库管理”
|
||||
- 支持维护员工本人账户与员工亲属账户
|
||||
- 账户静态档案与分析结果分表存储
|
||||
- 页面风格沿用现有维护页交互方式
|
||||
- 第一版仅考虑当前有效账户分析结果,不保留多版本分析历史
|
||||
|
||||
本次明确不做以下事项:
|
||||
|
||||
- 不扩展朋友、同事、司机、秘书等非亲属关系
|
||||
- 不修改“员工亲属关系维护”现有业务命名
|
||||
- 不增加额外脱敏展示字段
|
||||
- 不展开后端实现设计
|
||||
|
||||
## 2. 设计原则
|
||||
|
||||
- 主表只描述“谁持有了什么账户”
|
||||
- 分析表只描述“该账户的交易画像和风险等级”
|
||||
- 员工本人账户依附员工表
|
||||
- 亲属账户依附员工亲属关系表
|
||||
- 页面录入时允许在一个弹窗中同时维护主表和分析表信息
|
||||
- 第一版以人工维护为主,分析字段允许手工录入或后续导入覆盖
|
||||
|
||||
## 3. 数据模型
|
||||
|
||||
### 3.1 关系说明
|
||||
|
||||
- 员工主表:`ccdi_base_staff`
|
||||
- 员工亲属关系表:`ccdi_staff_fmy_relation`
|
||||
- 账户主表:`ccdi_account_info`
|
||||
- 账户分析表:`ccdi_account_analysis`
|
||||
|
||||
关系约束如下:
|
||||
|
||||
- 一个员工可有多个本人账户
|
||||
- 一个员工亲属关系记录可有多个账户
|
||||
- 一个账户仅归属于一个员工或一个亲属关系记录
|
||||
- 一个账户在第一版仅对应一条当前分析记录
|
||||
|
||||
### 3.2 归属规则
|
||||
|
||||
- 当 `is_self_account = 1` 时:
|
||||
- `staff_id` 必填
|
||||
- `relation_id` 为空
|
||||
- 当 `is_self_account = 0` 时:
|
||||
- `staff_id` 必填
|
||||
- `relation_id` 必填
|
||||
- `relation_id` 对应的亲属记录应属于该 `staff_id`
|
||||
|
||||
## 4. 表结构设计
|
||||
|
||||
### 4.1 账户主表 `ccdi_account_info`
|
||||
|
||||
用途:存储账户静态档案、开户信息、归属关系和生效状态。
|
||||
|
||||
| 字段名 | 类型 | 必填 | 默认值 | 说明 |
|
||||
|------|------|------|------|------|
|
||||
| id | BIGINT | 是 | 自增 | 主键 |
|
||||
| staff_id | BIGINT | 是 | - | 员工ID,对应 `ccdi_base_staff.staff_id` |
|
||||
| relation_id | BIGINT | 否 | NULL | 亲属关系ID,对应 `ccdi_staff_fmy_relation.id` |
|
||||
| account_no | VARCHAR(200) | 是 | - | 账户号码,按业务要求加密存储 |
|
||||
| account_type | VARCHAR(30) | 是 | - | `BANK/SECURITIES/PAYMENT/OTHER` |
|
||||
| account_name | VARCHAR(100) | 是 | - | 账户名称 |
|
||||
| open_bank | VARCHAR(100) | 是 | - | 开户银行、证券公司或支付平台 |
|
||||
| bank_code | VARCHAR(20) | 否 | NULL | 金融机构代码 |
|
||||
| currency | CHAR(3) | 是 | `CNY` | 币种,ISO 4217 标准 |
|
||||
| is_self_account | BOOLEAN | 是 | TRUE | 是否本人账户 |
|
||||
| status | INT | 是 | 1 | 状态:1-有效,0-无效 |
|
||||
| effective_date | DATE | 是 | 当前日期 | 生效日期 |
|
||||
| invalid_date | DATE | 否 | NULL | 失效日期 |
|
||||
| data_source | VARCHAR(30) | 是 | `MANUAL` | 数据来源:MANUAL、IMPORT、SYNC |
|
||||
| remark | VARCHAR(500) | 否 | NULL | 备注 |
|
||||
| create_by | VARCHAR(64) | 是 | - | 创建人 |
|
||||
| create_time | DATETIME | 是 | 当前时间 | 创建时间 |
|
||||
| update_by | VARCHAR(64) | 否 | NULL | 更新人 |
|
||||
| update_time | DATETIME | 否 | 当前时间 | 更新时间 |
|
||||
|
||||
说明:
|
||||
|
||||
- `relation_id` 为空表示员工本人账户
|
||||
- `relation_id` 不为空表示员工亲属账户
|
||||
- 本次不增加账户号码 hash 字段与脱敏展示字段
|
||||
|
||||
### 4.2 账户分析表 `ccdi_account_analysis`
|
||||
|
||||
用途:存储账户交易画像、金额特征和风险等级。
|
||||
|
||||
| 字段名 | 类型 | 必填 | 默认值 | 说明 |
|
||||
|------|------|------|------|------|
|
||||
| id | BIGINT | 是 | 自增 | 主键 |
|
||||
| account_id | BIGINT | 是 | - | 账户ID,对应 `ccdi_account_info.id` |
|
||||
| analysis_months | INT | 是 | 6 | 统计月数 |
|
||||
| stat_start_date | DATE | 否 | NULL | 统计开始日期 |
|
||||
| stat_end_date | DATE | 否 | NULL | 统计结束日期 |
|
||||
| avg_month_txn_count | INT | 否 | 0 | 月均交易笔数 |
|
||||
| avg_month_txn_amount | DECIMAL(18,2) | 否 | 0.00 | 月均交易金额 |
|
||||
| txn_frequency_level | VARCHAR(20) | 否 | `MEDIUM` | 交易频率:LOW、MEDIUM、HIGH |
|
||||
| debit_single_max_amount | DECIMAL(18,2) | 否 | NULL | 借方单笔交易最高额 |
|
||||
| credit_single_max_amount | DECIMAL(18,2) | 否 | NULL | 贷方单笔交易最高额 |
|
||||
| debit_daily_max_amount | DECIMAL(18,2) | 否 | NULL | 借方日累计交易最高额 |
|
||||
| credit_daily_max_amount | DECIMAL(18,2) | 否 | NULL | 贷方日累计交易最高额 |
|
||||
| txn_risk_level | VARCHAR(10) | 否 | `MEDIUM` | 交易风险等级 |
|
||||
| remark | VARCHAR(500) | 否 | NULL | 分析备注 |
|
||||
| create_by | VARCHAR(64) | 是 | - | 创建人 |
|
||||
| create_time | DATETIME | 是 | 当前时间 | 创建时间 |
|
||||
| update_by | VARCHAR(64) | 否 | NULL | 更新人 |
|
||||
| update_time | DATETIME | 否 | 当前时间 | 更新时间 |
|
||||
|
||||
说明:
|
||||
|
||||
- 第一版以“一户一条当前分析记录”为目标
|
||||
- 后续如果需要保留历史分析版本,可新增 `is_latest`、`analysis_batch_no` 或改造唯一约束
|
||||
|
||||
## 5. 索引与约束建议
|
||||
|
||||
### 5.1 `ccdi_account_info`
|
||||
|
||||
- 主键:`PRIMARY KEY (id)`
|
||||
- 索引:`idx_staff_id (staff_id)`
|
||||
- 索引:`idx_relation_id (relation_id)`
|
||||
- 索引:`idx_account_type (account_type)`
|
||||
- 索引:`idx_open_bank (open_bank)`
|
||||
- 索引:`idx_is_self_account (is_self_account)`
|
||||
- 索引:`idx_status (status)`
|
||||
|
||||
### 5.2 `ccdi_account_analysis`
|
||||
|
||||
- 主键:`PRIMARY KEY (id)`
|
||||
- 唯一索引:`uk_account_id (account_id)`
|
||||
- 索引:`idx_txn_risk_level (txn_risk_level)`
|
||||
|
||||
### 5.3 校验规则
|
||||
|
||||
- `invalid_date` 不得早于 `effective_date`
|
||||
- `analysis_months` 应大于 0
|
||||
- 金额字段不得为负数
|
||||
- 若账户为本人账户,则不允许选择亲属
|
||||
- 若账户为亲属账户,则必须选定亲属关系记录
|
||||
|
||||
## 6. DDL 草案
|
||||
|
||||
```sql
|
||||
CREATE TABLE IF NOT EXISTS `ccdi_account_info` (
|
||||
`id` BIGINT(20) NOT NULL AUTO_INCREMENT COMMENT '主键ID',
|
||||
`staff_id` BIGINT(20) NOT NULL COMMENT '员工ID',
|
||||
`relation_id` BIGINT(20) DEFAULT NULL COMMENT '员工亲属关系ID,员工本人账户为空',
|
||||
`account_no` VARCHAR(200) NOT NULL COMMENT '账户号码(加密存储)',
|
||||
`account_type` VARCHAR(30) NOT NULL COMMENT '账户类型:BANK/SECURITIES/PAYMENT/OTHER',
|
||||
`account_name` VARCHAR(100) NOT NULL COMMENT '账户名称',
|
||||
`open_bank` VARCHAR(100) NOT NULL COMMENT '开户银行/证券公司/支付平台',
|
||||
`bank_code` VARCHAR(20) DEFAULT NULL COMMENT '金融机构代码',
|
||||
`currency` CHAR(3) NOT NULL DEFAULT 'CNY' COMMENT '币种',
|
||||
`is_self_account` TINYINT(1) NOT NULL DEFAULT 1 COMMENT '是否本人账户:1-是 0-否',
|
||||
`status` INT(11) NOT NULL DEFAULT 1 COMMENT '状态:1-有效 0-无效',
|
||||
`effective_date` DATE NOT NULL COMMENT '生效日期',
|
||||
`invalid_date` DATE DEFAULT NULL COMMENT '失效日期',
|
||||
`data_source` VARCHAR(30) NOT NULL DEFAULT 'MANUAL' COMMENT '数据来源',
|
||||
`remark` VARCHAR(500) DEFAULT NULL COMMENT '备注',
|
||||
`create_by` VARCHAR(64) NOT NULL COMMENT '创建人',
|
||||
`create_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`update_by` VARCHAR(64) DEFAULT NULL COMMENT '更新人',
|
||||
`update_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_staff_id` (`staff_id`),
|
||||
KEY `idx_relation_id` (`relation_id`),
|
||||
KEY `idx_account_type` (`account_type`),
|
||||
KEY `idx_open_bank` (`open_bank`),
|
||||
KEY `idx_is_self_account` (`is_self_account`),
|
||||
KEY `idx_status` (`status`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='账户主表';
|
||||
```
|
||||
|
||||
```sql
|
||||
CREATE TABLE IF NOT EXISTS `ccdi_account_analysis` (
|
||||
`id` BIGINT(20) NOT NULL AUTO_INCREMENT COMMENT '主键ID',
|
||||
`account_id` BIGINT(20) NOT NULL COMMENT '账户ID',
|
||||
`analysis_months` INT(11) NOT NULL DEFAULT 6 COMMENT '统计月数',
|
||||
`stat_start_date` DATE DEFAULT NULL COMMENT '统计开始日期',
|
||||
`stat_end_date` DATE DEFAULT NULL COMMENT '统计结束日期',
|
||||
`avg_month_txn_count` INT(11) DEFAULT 0 COMMENT '月均交易笔数',
|
||||
`avg_month_txn_amount` DECIMAL(18,2) DEFAULT 0.00 COMMENT '月均交易金额',
|
||||
`txn_frequency_level` VARCHAR(20) DEFAULT 'MEDIUM' COMMENT '交易频率等级',
|
||||
`debit_single_max_amount` DECIMAL(18,2) DEFAULT NULL COMMENT '借方单笔最高额',
|
||||
`credit_single_max_amount` DECIMAL(18,2) DEFAULT NULL COMMENT '贷方单笔最高额',
|
||||
`debit_daily_max_amount` DECIMAL(18,2) DEFAULT NULL COMMENT '借方日累计最高额',
|
||||
`credit_daily_max_amount` DECIMAL(18,2) DEFAULT NULL COMMENT '贷方日累计最高额',
|
||||
`txn_risk_level` VARCHAR(10) DEFAULT 'MEDIUM' COMMENT '交易风险等级',
|
||||
`remark` VARCHAR(500) DEFAULT NULL COMMENT '分析备注',
|
||||
`create_by` VARCHAR(64) NOT NULL COMMENT '创建人',
|
||||
`create_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`update_by` VARCHAR(64) DEFAULT NULL COMMENT '更新人',
|
||||
`update_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `uk_account_id` (`account_id`),
|
||||
KEY `idx_txn_risk_level` (`txn_risk_level`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='账户分析表';
|
||||
```
|
||||
|
||||
## 7. 页面原型设计
|
||||
|
||||
### 7.1 菜单位置
|
||||
|
||||
新增菜单:
|
||||
|
||||
- 父级:信息维护
|
||||
- 名称:账户库管理
|
||||
- 建议顺序:放在“员工亲属关系维护”后、“招聘信息管理”前
|
||||
|
||||
### 7.2 列表页
|
||||
|
||||
#### 查询区
|
||||
|
||||
- 员工姓名
|
||||
- 归属类型:本人 / 亲属
|
||||
- 关系类型
|
||||
- 关系人姓名
|
||||
- 账户类型
|
||||
- 开户机构
|
||||
- 风险等级
|
||||
- 状态
|
||||
|
||||
#### 操作区
|
||||
|
||||
- 新增
|
||||
- 导入
|
||||
- 导出
|
||||
|
||||
#### 表格字段
|
||||
|
||||
- 员工姓名
|
||||
- 归属类型
|
||||
- 关系类型
|
||||
- 关系人姓名
|
||||
- 账户号码
|
||||
- 账户名称
|
||||
- 账户类型
|
||||
- 开户机构
|
||||
- 币种
|
||||
- 是否本人账户
|
||||
- 月均交易笔数
|
||||
- 月均交易金额
|
||||
- 交易频率等级
|
||||
- 交易风险等级
|
||||
- 生效日期
|
||||
- 状态
|
||||
- 创建时间
|
||||
- 操作
|
||||
|
||||
#### 列表页低保真线框
|
||||
|
||||
```text
|
||||
+----------------------------------------------------------------------------------+
|
||||
| 账户库管理 |
|
||||
+----------------------------------------------------------------------------------+
|
||||
| 员工姓名 [________] 归属类型 [本人/亲属] 关系类型 [____] 关系人姓名 [________] |
|
||||
| 账户类型 [____] 开户机构 [________] 风险等级 [____] 状态 [有效/无效] |
|
||||
| [搜索] [重置] |
|
||||
+----------------------------------------------------------------------------------+
|
||||
| [新增] [导入] [导出] |
|
||||
+----------------------------------------------------------------------------------+
|
||||
| 员工姓名 | 归属类型 | 关系类型 | 关系人姓名 | 账号 | 账户名称 | 账户类型 | ... |
|
||||
|----------------------------------------------------------------------------------|
|
||||
| 张三 | 本人 | - | - | 6222 | 工资卡 | BANK | ... |
|
||||
| 张三 | 亲属 | 配偶 | 李四 | 6217 | 储蓄卡 | BANK | ... |
|
||||
| ... |
|
||||
+----------------------------------------------------------------------------------+
|
||||
| 分页 |
|
||||
+----------------------------------------------------------------------------------+
|
||||
```
|
||||
|
||||
### 7.3 新增/编辑弹窗
|
||||
|
||||
#### 一、归属信息
|
||||
|
||||
- 归属类型
|
||||
- 员工选择
|
||||
- 关系人选择
|
||||
- 关系类型
|
||||
- 是否本人账户
|
||||
|
||||
交互规则:
|
||||
|
||||
- 归属类型为“本人”时,关系人选择和关系类型隐藏
|
||||
- 归属类型为“亲属”时,先选员工,再加载该员工亲属列表
|
||||
- 是否本人账户根据归属类型自动带出,只读显示
|
||||
|
||||
#### 二、账户信息
|
||||
|
||||
- 账户号码
|
||||
- 账户类型
|
||||
- 账户名称
|
||||
- 开户机构
|
||||
- 银行代码
|
||||
- 币种
|
||||
- 生效日期
|
||||
- 失效日期
|
||||
- 状态
|
||||
- 备注
|
||||
|
||||
#### 三、分析信息
|
||||
|
||||
- 统计月数
|
||||
- 统计开始日期
|
||||
- 统计结束日期
|
||||
- 月均交易笔数
|
||||
- 月均交易金额
|
||||
- 交易频率等级
|
||||
- 借方单笔最高额
|
||||
- 贷方单笔最高额
|
||||
- 借方日累计最高额
|
||||
- 贷方日累计最高额
|
||||
- 交易风险等级
|
||||
- 分析备注
|
||||
|
||||
#### 弹窗低保真线框
|
||||
|
||||
```text
|
||||
+--------------------------------------------------------------+
|
||||
| 新增账户 [X] |
|
||||
+--------------------------------------------------------------+
|
||||
| 一、归属信息 |
|
||||
| 归属类型 [本人/亲属] |
|
||||
| 员工 [请选择员工____________________] |
|
||||
| 关系人 [请选择关系人__________________] |
|
||||
| 关系类型 [自动带出______________________] |
|
||||
| 是否本人 [是/否,只读] |
|
||||
+--------------------------------------------------------------+
|
||||
| 二、账户信息 |
|
||||
| 账户号码 [____________________________] |
|
||||
| 账户类型 [BANK/SECURITIES/PAYMENT/OTHER] |
|
||||
| 账户名称 [____________________________] |
|
||||
| 开户机构 [____________________________] |
|
||||
| 银行代码 [________________] 币种 [CNY] |
|
||||
| 生效日期 [yyyy-MM-dd] 失效日期 [yyyy-MM-dd] |
|
||||
| 状态 [有效/无效] |
|
||||
| 备注 [____________________________________________] |
|
||||
+--------------------------------------------------------------+
|
||||
| 三、分析信息 |
|
||||
| 统计月数 [6] |
|
||||
| 开始日期 [yyyy-MM-dd] 结束日期 [yyyy-MM-dd] |
|
||||
| 月均笔数 [____] 月均金额 [__________] |
|
||||
| 频率等级 [LOW/MEDIUM/HIGH] 风险等级 [LOW/MEDIUM/HIGH] |
|
||||
| 借方单笔最高 [________] 贷方单笔最高 [________] |
|
||||
| 借方日累计最高 [________] 贷方日累计最高 [________] |
|
||||
| 分析备注 [____________________________________________] |
|
||||
+--------------------------------------------------------------+
|
||||
| [取消] [确定] |
|
||||
+--------------------------------------------------------------+
|
||||
```
|
||||
|
||||
### 7.4 详情弹窗
|
||||
|
||||
详情页建议与新增/编辑弹窗结构一致,全部字段只读展示,避免维护两套信息布局。
|
||||
|
||||
## 8. 导入模板建议
|
||||
|
||||
建议导入模板字段如下:
|
||||
|
||||
- 员工柜员号
|
||||
- 员工姓名
|
||||
- 归属类型
|
||||
- 关系人姓名
|
||||
- 关系类型
|
||||
- 账户号码
|
||||
- 账户类型
|
||||
- 账户名称
|
||||
- 开户机构
|
||||
- 银行代码
|
||||
- 币种
|
||||
- 生效日期
|
||||
- 失效日期
|
||||
- 统计月数
|
||||
- 月均交易笔数
|
||||
- 月均交易金额
|
||||
- 交易频率等级
|
||||
- 借方单笔最高额
|
||||
- 贷方单笔最高额
|
||||
- 借方日累计最高额
|
||||
- 贷方日累计最高额
|
||||
- 交易风险等级
|
||||
- 备注
|
||||
|
||||
导入校验建议:
|
||||
|
||||
- 本人账户时,不允许填写关系人姓名
|
||||
- 亲属账户时,关系人姓名不能为空
|
||||
- 若员工不存在,则导入失败
|
||||
- 若亲属不存在,则导入失败
|
||||
|
||||
## 9. 菜单 SQL 草案
|
||||
|
||||
```sql
|
||||
SET @parent_menu_id = (
|
||||
SELECT menu_id
|
||||
FROM sys_menu
|
||||
WHERE menu_name = '信息维护' AND parent_id = 0
|
||||
LIMIT 1
|
||||
);
|
||||
|
||||
INSERT INTO sys_menu (
|
||||
menu_name, parent_id, order_num, path, component, is_frame, is_cache,
|
||||
menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark
|
||||
) VALUES (
|
||||
'账户库管理', @parent_menu_id, 5, 'accountInfo', 'ccdiAccountInfo/index', 1, 0,
|
||||
'C', '0', '0', 'ccdi:accountInfo:list', 'money', 'admin', NOW(), '', NULL, '账户库管理菜单'
|
||||
);
|
||||
|
||||
SET @menu_id = LAST_INSERT_ID();
|
||||
|
||||
INSERT INTO sys_menu (
|
||||
menu_name, parent_id, order_num, path, component, is_frame, is_cache,
|
||||
menu_type, visible, status, perms, icon, create_by, create_time, remark
|
||||
) VALUES
|
||||
('账户查询', @menu_id, 1, '', '', 1, 0, 'F', '0', '0', 'ccdi:accountInfo:query', '#', 'admin', NOW(), ''),
|
||||
('账户新增', @menu_id, 2, '', '', 1, 0, 'F', '0', '0', 'ccdi:accountInfo:add', '#', 'admin', NOW(), ''),
|
||||
('账户修改', @menu_id, 3, '', '', 1, 0, 'F', '0', '0', 'ccdi:accountInfo:edit', '#', 'admin', NOW(), ''),
|
||||
('账户删除', @menu_id, 4, '', '', 1, 0, 'F', '0', '0', 'ccdi:accountInfo:remove', '#', 'admin', NOW(), ''),
|
||||
('账户导入', @menu_id, 5, '', '', 1, 0, 'F', '0', '0', 'ccdi:accountInfo:import', '#', 'admin', NOW(), ''),
|
||||
('账户导出', @menu_id, 6, '', '', 1, 0, 'F', '0', '0', 'ccdi:accountInfo:export', '#', 'admin', NOW(), '');
|
||||
```
|
||||
|
||||
## 10. 后续落地建议
|
||||
|
||||
如果本方案确认,可按以下顺序实施:
|
||||
|
||||
1. 先建两张表并补菜单 SQL
|
||||
2. 再补前端列表页与弹窗原型
|
||||
3. 最后对接后端接口与导入导出
|
||||
|
||||
当前方案适合作为第一版基础模型,后续若需要接入自动打标或保留历史分析结果,可在 `ccdi_account_analysis` 上继续扩展,而不破坏 `ccdi_account_info` 主档结构。
|
||||
96
docs/plans/fullstack/2026-04-10-account-library-handoff.md
Normal file
96
docs/plans/fullstack/2026-04-10-account-library-handoff.md
Normal file
@@ -0,0 +1,96 @@
|
||||
# 账户库管理交接记录
|
||||
|
||||
日期:2026-04-10
|
||||
|
||||
## 当前状态
|
||||
|
||||
- 前端原型页:`ruoyi-ui/src/views/ccdiAccountInfoPrototype/index.vue`
|
||||
- 本地预览路由:`/ccdiAccountInfo`
|
||||
- 原型页入口路由:`/prototype/account-library`
|
||||
- 当前截图:`docs/plans/fullstack/account-library-preview-2026-04-10.png`
|
||||
- 真实数据库:`ccdi.ccdi_account_info`、`ccdi.ccdi_account_result`
|
||||
- 当前实现仍是前端静态原型,尚未接真实后端接口。
|
||||
|
||||
## 本次已落地
|
||||
|
||||
1. `ccdi_account_info` 已新增字段:
|
||||
- 字段名:`bank_scope`
|
||||
- 类型:`VARCHAR(20) NOT NULL DEFAULT 'INTERNAL'`
|
||||
- 含义:`INTERNAL-行内,EXTERNAL-行外`
|
||||
- 当前已有 21 条账户数据均为 `INTERNAL`
|
||||
|
||||
2. `ccdi_account_result.trans_risk_level` 默认值已改为 `LOW`。
|
||||
|
||||
3. 前端原型已恢复“账户范围”:
|
||||
- 查询区支持按“行内/行外”筛选
|
||||
- 表格展示“账户范围”
|
||||
- 新增/编辑弹窗可选择“账户范围”
|
||||
- 行内账户的分析信息默认只展示,语义上由 T+1 自动同步维护
|
||||
- 行外账户的分析信息允许手工维护
|
||||
|
||||
4. 前端原型兼容当前数据库 `account_type = DEBIT` 的老数据:
|
||||
- `DEBIT` 展示为“借记卡账户”
|
||||
- 仍保留 `BANK`、`SECURITIES`、`PAYMENT`、`OTHER` 作为后续扩展选项
|
||||
|
||||
5. 关系类型口径已按员工亲属关系统一为:
|
||||
- 配偶、父亲、母亲、子女、兄弟姐妹、朋友、同事、其他
|
||||
|
||||
## 字段对应
|
||||
|
||||
### `ccdi_account_info`
|
||||
|
||||
| 页面字段 | 前端字段 | 数据库字段 | 说明 |
|
||||
| --- | --- | --- | --- |
|
||||
| 账户号码 | `accountNo` | `account_no` | 账号 |
|
||||
| 账户类型 | `accountType` | `account_type` | 当前库里有 `DEBIT` |
|
||||
| 账户范围 | `bankScope` | `bank_scope` | `INTERNAL` 行内,`EXTERNAL` 行外 |
|
||||
| 账户姓名 | `accountName` | `account_name` | 账户户名/所属姓名 |
|
||||
| 所属人类型 | `ownerType` | `owner_type` | 员工、员工关系人、外部人员 |
|
||||
| 所属人标识 | `staffId` / `relationId` | `owner_id` | 后续接口需按类型取值 |
|
||||
| 开户机构 | `openBank` | `bank` | 开户行/机构 |
|
||||
| 银行代码 | `bankCode` | `bank_code` | 机构代码 |
|
||||
| 币种 | `currency` | `currency` | 默认 `CNY` |
|
||||
| 状态 | `status` | `status` | `1` 正常,`2` 已销户 |
|
||||
| 生效日期 | `effectiveDate` | `effective_date` | 开户/生效日期 |
|
||||
| 失效日期 | `invalidDate` | `invalid_date` | 销户/失效日期 |
|
||||
|
||||
### `ccdi_account_result`
|
||||
|
||||
| 页面字段 | 前端字段 | 数据库字段 | 说明 |
|
||||
| --- | --- | --- | --- |
|
||||
| 是否实控账户 | `isActualControl` | `is_self_account` | `1` 是,`0` 否 |
|
||||
| 月均交易笔数 | `avgMonthTxnCount` | `monthly_avg_trans_count` | 交易画像 |
|
||||
| 月均交易金额 | `avgMonthTxnAmount` | `monthly_avg_trans_amount` | 交易画像 |
|
||||
| 频率等级 | `txnFrequencyLevel` | `trans_freq_type` | `LOW`、`MEDIUM`、`HIGH` |
|
||||
| 借方单笔最高额 | `debitSingleMaxAmount` | `dr_max_single_amount` | 交易画像 |
|
||||
| 贷方单笔最高额 | `creditSingleMaxAmount` | `cr_max_single_amount` | 交易画像 |
|
||||
| 借方日累计最高额 | `debitDailyMaxAmount` | `dr_max_daily_amount` | 交易画像 |
|
||||
| 贷方日累计最高额 | `creditDailyMaxAmount` | `cr_max_daily_amount` | 交易画像 |
|
||||
| 风险等级 | `txnRiskLevel` | `trans_risk_level` | 默认 `LOW` |
|
||||
|
||||
## 后端同步判断
|
||||
|
||||
仓库里当前没有找到已成型的 `CcdiAccountInfo` 后端 Controller、Entity、Mapper、Service 或前端 API 文件,所以本次没有强行新建完整后端 CRUD。
|
||||
|
||||
后续如果正式接后端接口,需要同步增加:
|
||||
|
||||
- Entity/DTO/VO 字段:`bankScope`
|
||||
- Mapper XML 或 MyBatis Plus 查询条件:支持 `bank_scope`
|
||||
- 新增/编辑接口:写入 `bank_scope`
|
||||
- 列表接口:返回 `bank_scope`
|
||||
- 行内账户:分析结果从同步任务/T+1结果表维护
|
||||
- 行外账户:允许页面写入或更新 `ccdi_account_result`
|
||||
|
||||
## 本地启动说明
|
||||
|
||||
前端可以在 `ruoyi-ui` 下启动:
|
||||
|
||||
```bash
|
||||
npm run dev
|
||||
```
|
||||
|
||||
当前环境里没有检测到 `java`、`mvn`、`mvnw`,所以这台机器不能直接用命令启动后端。后端正常需要 Java 21 和 Maven,然后启动端口按配置是 `62318`。
|
||||
|
||||
## 明天切换对话可以这样说
|
||||
|
||||
继续做 `C:\Users\20696\Desktop\初核\ccdi` 这个仓库的“账户库管理”。请先阅读 `docs/plans/fullstack/2026-04-10-account-library-handoff.md`,然后检查以下本地改动:前端原型 `ruoyi-ui/src/views/ccdiAccountInfoPrototype/index.vue`、路由 `ruoyi-ui/src/router/index.js`、白名单 `ruoyi-ui/src/permission.js`、关系枚举 `ccdi-info-collection/src/main/java/com/ruoyi/info/collection/enums/RelationType.java`、SQL 脚本 `sql/migration/2026-04-10-split-ccdi-account-info.sql`。数据库 `ccdi_account_info` 已新增 `bank_scope`,`ccdi_account_result.trans_risk_level` 默认值已是 `LOW`。下一步优先判断是否要做真实后端 CRUD/API 联调,而不是继续只改静态原型。
|
||||
BIN
docs/plans/fullstack/account-library-preview-2026-04-10.png
Normal file
BIN
docs/plans/fullstack/account-library-preview-2026-04-10.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 803 KiB |
@@ -0,0 +1,62 @@
|
||||
# 账户库双表合单表实施记录
|
||||
|
||||
## 1. 本次实施内容
|
||||
|
||||
### 1.1 单表模型收敛
|
||||
|
||||
- 在 `CcdiAccountInfo` 中补齐以下分析字段映射:
|
||||
- `is_self_account`
|
||||
- `monthly_avg_trans_count`
|
||||
- `monthly_avg_trans_amount`
|
||||
- `trans_freq_type`
|
||||
- `dr_max_single_amount`
|
||||
- `cr_max_single_amount`
|
||||
- `dr_max_daily_amount`
|
||||
- `cr_max_daily_amount`
|
||||
- `trans_risk_level`
|
||||
- 删除 `CcdiAccountResult` 实体与 `CcdiAccountResultMapper`
|
||||
|
||||
### 1.2 查询与写入逻辑调整
|
||||
|
||||
- `CcdiAccountInfoMapper.xml` 已移除 `ccdi_account_result` 联表
|
||||
- 账户库列表、详情、导出统一从 `ccdi_account_info` 读取分析字段
|
||||
- `CcdiAccountInfoServiceImpl` 已移除结果表双写逻辑
|
||||
- 新增单表分析字段处理规则:
|
||||
- 行外账户默认补齐分析字段缺省值
|
||||
- 行内账户统一清空分析字段
|
||||
|
||||
### 1.3 数据迁移与种子脚本
|
||||
|
||||
- 新增增量脚本:
|
||||
- `sql/migration/2026-04-16-merge-ccdi-account-result-into-info.sql`
|
||||
- 更新外部场景种子脚本:
|
||||
- `sql/migration/2026-04-13-seed-ccdi-account-info-external-scenarios.sql`
|
||||
- 种子脚本已改为直接写入 `ccdi_account_info`,不再依赖旧表
|
||||
|
||||
### 1.4 测试补充
|
||||
|
||||
- 新增 `CcdiAccountInfoServiceImplTest`
|
||||
- 新增 `CcdiAccountInfoMapperTest`
|
||||
- 新增 `CcdiAccountInfoMergeSqlTest`
|
||||
|
||||
## 2. 验证记录
|
||||
|
||||
### 2.1 已完成验证
|
||||
|
||||
- `ccdi-project` 模块执行 `mvn -pl ccdi-project -DskipTests compile` 成功
|
||||
- 文件级检查确认:
|
||||
- 账户库主链路代码已无 `CcdiAccountResult` / `accountResultMapper` 引用
|
||||
- `CcdiAccountInfoMapper.xml` 已无 `ccdi_account_result` 联表
|
||||
- 新增迁移脚本包含补字段、按 `account_no` 回填、删除旧表逻辑
|
||||
|
||||
### 2.2 现存仓库阻塞
|
||||
|
||||
- `ccdi-info-collection` 模块常规编译失败,失败原因为仓库已有依赖/类缺失,与本次账户库改动不直接相关
|
||||
- 典型阻塞包括:
|
||||
- `com.ruoyi.common.annotation` 下若干注解类缺失
|
||||
- 多个服务类依赖 `org.springframework.data.redis.core`,当前模块未解析
|
||||
- 既有测试代码与当前依赖版本存在不一致
|
||||
|
||||
## 3. 结论
|
||||
|
||||
本次账户库已按方案完成“双表合单表”代码与 SQL 收敛,后续若要做完整 Maven 回归,需要先处理仓库当前已有的模块依赖与测试编译问题。
|
||||
@@ -0,0 +1,431 @@
|
||||
# 实体库管理设计文档
|
||||
|
||||
## 1. 背景
|
||||
|
||||
当前仓库已经存在企业主体表 `ccdi_enterprise_base_info`,并且“中介管理”中的实体中介部分已经在复用该表完成部分新增、编辑、详情和导入能力。
|
||||
|
||||
本次需求不是新建表,也不是扩展复杂关联能力,而是基于现有企业主体表,单独建设一个“实体库管理”页面,并严格参照“员工信息维护”的实现方式交付完整的新增、查看、编辑、删除、导入能力。
|
||||
|
||||
## 2. 目标
|
||||
|
||||
建设一套独立的“实体库管理”模块,满足以下要求:
|
||||
|
||||
- 页面名称固定为“实体库管理”
|
||||
- 数据表固定为 `ccdi_enterprise_base_info`
|
||||
- 功能范围仅包含单表维护,不引入子表或聚合编辑
|
||||
- 支持新建、查看、编辑、删除、导入
|
||||
- 页面交互、接口组织、异步导入、失败记录查看方式整体对齐员工信息维护
|
||||
- `riskLevel`、`entSource` 允许维护,不写死
|
||||
- 导入时若统一社会信用代码已存在,一律按失败处理,不覆盖更新
|
||||
|
||||
## 3. 非目标
|
||||
|
||||
- 不改造“中介管理”现有混合页面
|
||||
- 不在本次中引入企业附属信息子表
|
||||
- 不在本次中引入员工企业关系、客户企业关系、中介关系联动维护
|
||||
- 不设计兼容性补丁式方案,不保留中介实体 DTO 命名给新模块复用
|
||||
|
||||
## 4. 现状分析
|
||||
|
||||
### 4.1 已有基础
|
||||
|
||||
仓库中已经存在以下可复用基础:
|
||||
|
||||
- 实体表对应领域对象:`CcdiEnterpriseBaseInfo`
|
||||
- 实体表 Mapper:`CcdiEnterpriseBaseInfoMapper`
|
||||
- 中介模块中的实体新增、编辑、详情、导入能力
|
||||
- 员工信息维护的完整单表维护范式:
|
||||
- 独立 Controller
|
||||
- 独立 DTO / VO / Excel / ImportFailureVO
|
||||
- 独立前端页面与 API
|
||||
- 异步导入状态轮询
|
||||
- 失败记录分页查看
|
||||
|
||||
### 4.2 已有问题
|
||||
|
||||
当前实体企业数据虽然已经能在中介模块中被部分维护,但存在以下问题:
|
||||
|
||||
- 业务语义属于“中介管理”,不等于“实体库管理”
|
||||
- DTO / VO / Excel 命名与字段口径绑定在 `IntermediaryEntity` 语义上
|
||||
- 现有实体中介字段未完整覆盖本次需要维护的 `status`、`riskLevel`、`entSource`、`dataSource`
|
||||
- 页面是中介混合模式,不符合“完全按照员工信息维护方式实现”的要求
|
||||
|
||||
因此本次应建设独立模块,而不是继续把“实体库管理”能力挂靠在中介模块之下。
|
||||
|
||||
## 5. 方案比较
|
||||
|
||||
### 5.1 方案一:新建独立实体库管理模块
|
||||
|
||||
做法:
|
||||
|
||||
- 新建独立的后端 Controller / Service / DTO / VO / Excel / 导入服务
|
||||
- 新建独立前端页面、独立 API、独立菜单和权限
|
||||
- 底层复用 `ccdi_enterprise_base_info`
|
||||
|
||||
优点:
|
||||
|
||||
- 与“员工信息维护”模式最一致
|
||||
- 业务语义清晰,后续维护成本最低
|
||||
- 不会把“实体库管理”和“中介管理”概念揉在一起
|
||||
|
||||
缺点:
|
||||
|
||||
- 开发量略高于直接复用中介实体代码
|
||||
|
||||
### 5.2 方案二:直接复用中介管理中的实体部分
|
||||
|
||||
做法:
|
||||
|
||||
- 将中介管理中的“实体中介”能力直接暴露为实体库入口
|
||||
|
||||
优点:
|
||||
|
||||
- 改动少
|
||||
|
||||
缺点:
|
||||
|
||||
- 模块语义错误
|
||||
- DTO / VO / 页面命名与业务不一致
|
||||
- 后续权限、菜单、字段扩展容易混乱
|
||||
|
||||
### 5.3 方案三:页面独立,后端继续复用中介实体 DTO / 导入类
|
||||
|
||||
做法:
|
||||
|
||||
- 页面新建
|
||||
- 后端尽量套用 `IntermediaryEntity` 的类和导入逻辑
|
||||
|
||||
优点:
|
||||
|
||||
- 开发速度较快
|
||||
|
||||
缺点:
|
||||
|
||||
- 代码命名混乱
|
||||
- 字段口径不完整
|
||||
- 后续扩展时会继续带来语义污染
|
||||
|
||||
### 5.4 结论
|
||||
|
||||
采用方案一:新建独立“实体库管理”模块,底层复用 `ccdi_enterprise_base_info`,实现方式全面对齐员工信息维护。
|
||||
|
||||
## 6. 总体设计
|
||||
|
||||
### 6.1 模块边界
|
||||
|
||||
本次实体库管理模块只负责维护 `ccdi_enterprise_base_info` 单表数据,不承担其他关系表维护职责。
|
||||
|
||||
### 6.2 后端结构
|
||||
|
||||
新增独立链路:
|
||||
|
||||
- `CcdiEnterpriseBaseInfoController`
|
||||
- `ICcdiEnterpriseBaseInfoService`
|
||||
- `CcdiEnterpriseBaseInfoServiceImpl`
|
||||
- `CcdiEnterpriseBaseInfoQueryDTO`
|
||||
- `CcdiEnterpriseBaseInfoAddDTO`
|
||||
- `CcdiEnterpriseBaseInfoEditDTO`
|
||||
- `CcdiEnterpriseBaseInfoVO`
|
||||
- `CcdiEnterpriseBaseInfoExcel`
|
||||
- `EnterpriseBaseInfoImportFailureVO`
|
||||
- `ICcdiEnterpriseBaseInfoImportService`
|
||||
- `CcdiEnterpriseBaseInfoImportServiceImpl`
|
||||
|
||||
Mapper 层优先复用现有 `CcdiEnterpriseBaseInfoMapper`,若分页查询或批量导入需要独立 SQL,则在现有 Mapper 基础上补充对应方法。
|
||||
|
||||
### 6.3 前端结构
|
||||
|
||||
新增独立页面与 API:
|
||||
|
||||
- `ruoyi-ui/src/views/ccdiEnterpriseBaseInfo/index.vue`
|
||||
- `ruoyi-ui/src/api/ccdiEnterpriseBaseInfo.js`
|
||||
|
||||
页面交互模式整体对齐员工信息维护:
|
||||
|
||||
- 查询表单
|
||||
- 工具栏按钮
|
||||
- 数据表格
|
||||
- 新增/编辑弹窗
|
||||
- 详情弹窗
|
||||
- 导入弹窗
|
||||
- 导入失败记录查看
|
||||
|
||||
## 7. 数据口径设计
|
||||
|
||||
### 7.1 主键
|
||||
|
||||
主键固定为 `socialCreditCode`。
|
||||
|
||||
规则如下:
|
||||
|
||||
- 新增时必填
|
||||
- 编辑时不可修改
|
||||
- 详情、删除、导入去重均以该字段为准
|
||||
|
||||
### 7.2 维护字段
|
||||
|
||||
本次页面维护字段覆盖 `ccdi_enterprise_base_info` 核心单表字段:
|
||||
|
||||
- `socialCreditCode`
|
||||
- `enterpriseName`
|
||||
- `enterpriseType`
|
||||
- `enterpriseNature`
|
||||
- `industryClass`
|
||||
- `industryName`
|
||||
- `establishDate`
|
||||
- `registerAddress`
|
||||
- `legalRepresentative`
|
||||
- `legalCertType`
|
||||
- `legalCertNo`
|
||||
- `shareholder1`
|
||||
- `shareholder2`
|
||||
- `shareholder3`
|
||||
- `shareholder4`
|
||||
- `shareholder5`
|
||||
- `status`
|
||||
- `riskLevel`
|
||||
- `entSource`
|
||||
- `dataSource`
|
||||
|
||||
### 7.3 字段策略
|
||||
|
||||
- `riskLevel` 允许查询、展示、编辑、导入
|
||||
- `entSource` 允许查询、展示、编辑、导入
|
||||
- `dataSource` 允许查询、展示、编辑、导入
|
||||
- 不新增动态股东列表,继续保持 `shareholder1-5` 固定字段结构
|
||||
|
||||
## 8. 页面设计
|
||||
|
||||
### 8.1 查询区
|
||||
|
||||
查询条件按员工信息维护的密度设计,包含:
|
||||
|
||||
- 企业名称
|
||||
- 统一社会信用代码
|
||||
- 企业类型
|
||||
- 企业性质
|
||||
- 行业分类
|
||||
- 经营状态
|
||||
- 风险等级
|
||||
- 企业来源
|
||||
|
||||
### 8.2 列表区
|
||||
|
||||
建议展示列:
|
||||
|
||||
- 企业名称
|
||||
- 统一社会信用代码
|
||||
- 企业类型
|
||||
- 企业性质
|
||||
- 行业分类
|
||||
- 所属行业
|
||||
- 法定代表人
|
||||
- 经营状态
|
||||
- 风险等级
|
||||
- 企业来源
|
||||
- 数据来源
|
||||
- 创建时间
|
||||
- 操作
|
||||
|
||||
操作列固定为:
|
||||
|
||||
- 详情
|
||||
- 编辑
|
||||
- 删除
|
||||
|
||||
### 8.3 新增/编辑弹窗
|
||||
|
||||
交互方式对齐员工信息维护,采用整页弹窗表单。
|
||||
|
||||
表单项包含:
|
||||
|
||||
- 统一社会信用代码
|
||||
- 企业名称
|
||||
- 企业类型
|
||||
- 企业性质
|
||||
- 行业分类
|
||||
- 所属行业
|
||||
- 成立日期
|
||||
- 注册地址
|
||||
- 法定代表人
|
||||
- 法定代表人证件类型
|
||||
- 法定代表人证件号码
|
||||
- 股东1
|
||||
- 股东2
|
||||
- 股东3
|
||||
- 股东4
|
||||
- 股东5
|
||||
- 经营状态
|
||||
- 风险等级
|
||||
- 企业来源
|
||||
- 数据来源
|
||||
|
||||
其中:
|
||||
|
||||
- 新增时 `socialCreditCode` 可填写
|
||||
- 编辑时 `socialCreditCode` 禁止修改
|
||||
|
||||
### 8.4 详情弹窗
|
||||
|
||||
详情展示字段与编辑表单保持同口径,采用只读方式展示。
|
||||
|
||||
### 8.5 导入交互
|
||||
|
||||
导入流程完全对齐员工信息维护:
|
||||
|
||||
- 下载模板
|
||||
- 上传 Excel
|
||||
- 提交异步导入任务
|
||||
- 轮询导入状态
|
||||
- 本地缓存最近一次任务信息
|
||||
- 导入失败时展示“查看导入失败记录”按钮
|
||||
- 失败记录支持分页查看
|
||||
|
||||
## 9. 接口设计
|
||||
|
||||
接口前缀建议统一为 `/ccdi/enterpriseBaseInfo`。
|
||||
|
||||
### 9.1 列表查询
|
||||
|
||||
- `GET /ccdi/enterpriseBaseInfo/list`
|
||||
|
||||
入参为查询 DTO,返回分页表格结构。
|
||||
|
||||
### 9.2 详情查询
|
||||
|
||||
- `GET /ccdi/enterpriseBaseInfo/{socialCreditCode}`
|
||||
|
||||
### 9.3 新增
|
||||
|
||||
- `POST /ccdi/enterpriseBaseInfo`
|
||||
|
||||
### 9.4 编辑
|
||||
|
||||
- `PUT /ccdi/enterpriseBaseInfo`
|
||||
|
||||
### 9.5 删除
|
||||
|
||||
- `DELETE /ccdi/enterpriseBaseInfo/{socialCreditCodes}`
|
||||
|
||||
支持批量删除。
|
||||
|
||||
### 9.6 导入模板
|
||||
|
||||
- `POST /ccdi/enterpriseBaseInfo/importTemplate`
|
||||
|
||||
### 9.7 导入数据
|
||||
|
||||
- `POST /ccdi/enterpriseBaseInfo/importData`
|
||||
|
||||
### 9.8 查询导入状态
|
||||
|
||||
- `GET /ccdi/enterpriseBaseInfo/importStatus/{taskId}`
|
||||
|
||||
### 9.9 查询导入失败记录
|
||||
|
||||
- `GET /ccdi/enterpriseBaseInfo/importFailures/{taskId}`
|
||||
|
||||
## 10. 权限与菜单设计
|
||||
|
||||
新增菜单名称固定为“实体库管理”。
|
||||
|
||||
建议菜单与权限如下:
|
||||
|
||||
- 菜单路径:`enterpriseBaseInfo`
|
||||
- 组件路径:`ccdiEnterpriseBaseInfo/index`
|
||||
- 列表权限:`ccdi:enterpriseBaseInfo:list`
|
||||
- 查询权限:`ccdi:enterpriseBaseInfo:query`
|
||||
- 新增权限:`ccdi:enterpriseBaseInfo:add`
|
||||
- 修改权限:`ccdi:enterpriseBaseInfo:edit`
|
||||
- 删除权限:`ccdi:enterpriseBaseInfo:remove`
|
||||
- 导入权限:`ccdi:enterpriseBaseInfo:import`
|
||||
|
||||
菜单应挂到“信息维护”目录下,方式与员工信息维护等现有业务菜单一致。
|
||||
|
||||
## 11. 校验规则
|
||||
|
||||
### 11.1 新增/编辑校验
|
||||
|
||||
- 企业名称不能为空
|
||||
- 统一社会信用代码不能为空
|
||||
- 统一社会信用代码必须符合 18 位社会信用代码格式
|
||||
- 新增时若数据库中已存在相同统一社会信用代码,则报错
|
||||
- 编辑时若记录不存在,则报错
|
||||
- `status`、`riskLevel`、`entSource`、`dataSource` 必须在允许值内
|
||||
- 其他字段按长度、日期格式做基础校验
|
||||
|
||||
### 11.2 导入校验
|
||||
|
||||
- Excel 至少包含一条数据
|
||||
- 企业名称不能为空
|
||||
- 统一社会信用代码不能为空
|
||||
- 统一社会信用代码格式必须正确
|
||||
- 同一导入文件中若统一社会信用代码重复,则该重复记录失败
|
||||
- 数据库中若已存在相同统一社会信用代码,则该记录失败
|
||||
|
||||
## 12. 导入策略
|
||||
|
||||
本次导入采用“严格新增”策略,不支持覆盖更新。
|
||||
|
||||
即:
|
||||
|
||||
- 不提供 `updateSupport` 覆盖更新能力
|
||||
- 已存在统一社会信用代码的记录直接记为失败
|
||||
- Excel 内重复记录直接记为失败
|
||||
- 成功记录批量插入
|
||||
- 失败记录落 Redis,保留最近任务失败明细查询能力
|
||||
|
||||
导入状态结构与员工信息维护保持一致:
|
||||
|
||||
- `PROCESSING`
|
||||
- `SUCCESS`
|
||||
- `PARTIAL_SUCCESS`
|
||||
|
||||
## 13. 错误处理
|
||||
|
||||
错误处理遵循现有员工维护风格,使用直接明确的业务提示:
|
||||
|
||||
- “该统一社会信用代码已存在”
|
||||
- “实体信息不存在”
|
||||
- “至少需要一条数据”
|
||||
- “任务不存在或已过期”
|
||||
|
||||
不引入额外异常框架或复杂回退逻辑。
|
||||
|
||||
## 14. 测试设计
|
||||
|
||||
### 14.1 后端测试重点
|
||||
|
||||
- 列表分页和多条件查询正确
|
||||
- 详情返回正确
|
||||
- 新增成功,主键重复时报错
|
||||
- 编辑成功,编辑不存在记录时报错
|
||||
- 删除成功
|
||||
- 导入成功、部分成功、失败状态正确
|
||||
- 导入失败记录查询正确
|
||||
|
||||
### 14.2 前端测试重点
|
||||
|
||||
- 查询、重置、分页交互正常
|
||||
- 新增、详情、编辑、删除链路正常
|
||||
- 编辑态主键不可修改
|
||||
- 导入弹窗、状态轮询、失败记录查看正常
|
||||
- 最近一次导入任务缓存与失败按钮显示逻辑正常
|
||||
- 权限按钮显示与菜单路由正确
|
||||
|
||||
## 15. 实施文档要求
|
||||
|
||||
由于本次需求涉及前后端改动,后续实施阶段需按仓库规范输出两份实施计划:
|
||||
|
||||
- 后端实施计划:`docs/plans/backend/`
|
||||
- 前端实施计划:`docs/plans/frontend/`
|
||||
|
||||
## 16. 最终结论
|
||||
|
||||
本次采用“独立实体库管理模块 + 复用现有企业主体表”的实现方式,以最短路径满足业务目标,同时保证:
|
||||
|
||||
- 业务语义清晰
|
||||
- 代码结构与员工信息维护一致
|
||||
- `riskLevel`、`entSource`、`dataSource` 均可维护
|
||||
- 导入严格新增,重复统一社会信用代码直接失败
|
||||
- 不引入超出需求范围的扩展能力
|
||||
@@ -0,0 +1,219 @@
|
||||
# 账户库管理验收清单
|
||||
|
||||
## 1. 验收目标
|
||||
|
||||
确认“账户库管理”页面已满足本轮最小闭环范围,包含:
|
||||
|
||||
- 菜单可见
|
||||
- 页面可打开
|
||||
- 列表查询正常
|
||||
- 新增、编辑、删除正常
|
||||
- 导入、导出正常
|
||||
- 导入模板可下载
|
||||
- 字段口径与数据库一致
|
||||
- 页面样式与其他“信息维护”页面保持一致
|
||||
|
||||
## 2. 验收前提
|
||||
|
||||
验收前需先确认:
|
||||
|
||||
- 前端服务已启动
|
||||
- 后端服务已启动
|
||||
- Redis 可连接
|
||||
- 数据库使用开发库 `116.62.17.81:3307/ccdi`
|
||||
- 当前账号具备“账户库管理”菜单与按钮权限
|
||||
|
||||
建议验收入口:
|
||||
|
||||
- 菜单入口:`信息维护 -> 账户库管理`
|
||||
- 路由入口:`/maintain/accountInfo`
|
||||
|
||||
## 3. 基础可用性验收
|
||||
|
||||
### 3.1 菜单与路由
|
||||
|
||||
- [ ] 左侧“信息维护”下可见“账户库管理”
|
||||
- [ ] 点击“账户库管理”可正常进入页面
|
||||
- [ ] 页面打开后无白屏、无 404、无 `No static resource`
|
||||
- [ ] 页面刷新后仍可正常进入
|
||||
|
||||
### 3.2 页面样式
|
||||
|
||||
- [ ] 页面背景、卡片、表头颜色与其他“信息维护”页面一致
|
||||
- [ ] 页面顶部不再显示“信息维护 / 账户库管理”说明卡片
|
||||
- [ ] 搜索区、工具栏、表格、分页布局正常
|
||||
- [ ] 右上角搜索折叠工具栏可正常使用
|
||||
|
||||
## 4. 查询列表验收
|
||||
|
||||
### 4.1 列表展示
|
||||
|
||||
- [ ] 页面默认可加载账户列表
|
||||
- [ ] 表格列显示完整,无错位、无遮挡
|
||||
- [ ] 列表包含“证件号”列
|
||||
- [ ] “所属人类型”列能正确显示:员工、员工关系人、中介、外部人员
|
||||
- [ ] “账户类型”列能正确显示:银行账户、证券账户、支付账户、其他
|
||||
- [ ] “账户范围”列能正确显示:行内、行外
|
||||
- [ ] 风险等级、频率等级、状态色块显示正常
|
||||
|
||||
### 4.2 查询条件
|
||||
|
||||
- [ ] “所属人类型”筛选在最前面
|
||||
- [ ] 可按员工姓名查询
|
||||
- [ ] 可按账户范围查询
|
||||
- [ ] 可按关系类型查询
|
||||
- [ ] 可按账户姓名查询
|
||||
- [ ] 可按账户类型查询
|
||||
- [ ] 可按是否实控查询
|
||||
- [ ] 可按风险等级查询
|
||||
- [ ] 可按状态查询
|
||||
- [ ] “搜索”后结果正确
|
||||
- [ ] “重置”后条件恢复默认
|
||||
|
||||
## 5. 新增验收
|
||||
|
||||
### 5.1 新增弹窗
|
||||
|
||||
- [ ] 点击“新增”可打开弹窗
|
||||
- [ ] 弹窗内“所属人类型”可选:员工、员工关系人、中介、外部人员
|
||||
- [ ] 默认新增账户范围为“行外”
|
||||
- [ ] 账户类型下拉仅有:
|
||||
- [ ] `BANK`
|
||||
- [ ] `SECURITIES`
|
||||
- [ ] `PAYMENT`
|
||||
- [ ] `OTHER`
|
||||
|
||||
### 5.2 所属人逻辑
|
||||
|
||||
- [ ] 选择“员工”时,可选择员工姓名
|
||||
- [ ] 选择“员工”后可自动带出证件号
|
||||
- [ ] 选择“员工关系人”时,可先选员工,再选关系人
|
||||
- [ ] 选择“员工关系人”后可自动带出关系类型、关系人证件号
|
||||
- [ ] 选择“中介”时,可手工录入中介名称和证件号
|
||||
- [ ] 选择“外部人员”时,可手工录入姓名和证件号
|
||||
|
||||
### 5.3 保存验证
|
||||
|
||||
- [ ] 必填项为空时有校验提示
|
||||
- [ ] 保存成功后列表可看到新增数据
|
||||
- [ ] 刷新页面后新增数据仍存在
|
||||
|
||||
## 6. 编辑验收
|
||||
|
||||
- [ ] 点击“编辑”可打开已有记录
|
||||
- [ ] 已有字段可正确回显
|
||||
- [ ] 可修改基础信息并保存成功
|
||||
- [ ] 保存后列表显示更新内容
|
||||
- [ ] 刷新页面后修改结果仍存在
|
||||
|
||||
## 7. 删除验收
|
||||
|
||||
- [ ] 点击“删除”有确认提示
|
||||
- [ ] 确认删除后提示成功
|
||||
- [ ] 删除后列表不再显示该数据
|
||||
- [ ] 刷新页面后该数据仍已删除
|
||||
|
||||
## 8. 详情验收
|
||||
|
||||
- [ ] 点击“详情”可打开只读弹窗
|
||||
- [ ] 基础信息、归属信息、分析信息都可查看
|
||||
- [ ] 详情弹窗内字段与列表、数据库保持一致
|
||||
|
||||
## 9. 批量维护验收
|
||||
|
||||
### 9.1 工具栏能力
|
||||
|
||||
- [ ] 页面工具栏包含“导入”“导出”按钮
|
||||
- [ ] 按钮风格、位置与其他“信息维护”页面一致
|
||||
- [ ] 权限控制正常,无权限时按钮不显示
|
||||
|
||||
### 9.2 导入功能
|
||||
|
||||
- [ ] 点击“导入”可打开上传弹窗
|
||||
- [ ] 点击“下载模板”可下载 Excel 模板
|
||||
- [ ] 上传合法模板后可返回导入结果
|
||||
- [ ] 导入成功后页面列表可看到更新结果
|
||||
|
||||
### 9.3 导出功能
|
||||
|
||||
- [ ] 点击“导出”可按当前筛选条件导出 Excel
|
||||
- [ ] 导出文件可正常打开
|
||||
- [ ] 导出列与页面口径一致
|
||||
|
||||
## 10. 数据口径验收
|
||||
|
||||
### 9.1 页面与数据库字段映射
|
||||
|
||||
- [ ] `ccdi_account_info.account_id -> 页面主键 id`
|
||||
- [ ] `ccdi_account_info.owner_type -> 所属人类型`
|
||||
- [ ] `ccdi_account_info.owner_id -> 证件号`
|
||||
- [ ] `ccdi_account_info.account_no -> 账户号码`
|
||||
- [ ] `ccdi_account_info.account_type -> 账户类型`
|
||||
- [ ] `ccdi_account_info.bank_scope -> 账户范围`
|
||||
- [ ] `ccdi_account_info.account_name -> 账户姓名`
|
||||
- [ ] `ccdi_account_info.bank -> 开户机构`
|
||||
- [ ] `ccdi_account_info.bank_code -> 银行代码`
|
||||
- [ ] `ccdi_account_info.currency -> 币种`
|
||||
- [ ] `ccdi_account_info.status -> 状态`
|
||||
- [ ] `ccdi_account_info.effective_date -> 生效日期`
|
||||
- [ ] `ccdi_account_info.invalid_date -> 失效日期`
|
||||
- [ ] `ccdi_account_result.is_self_account -> 是否实控账户`
|
||||
- [ ] `ccdi_account_result.monthly_avg_trans_count -> 月均交易笔数`
|
||||
- [ ] `ccdi_account_result.monthly_avg_trans_amount -> 月均交易金额`
|
||||
- [ ] `ccdi_account_result.trans_freq_type -> 频率等级`
|
||||
- [ ] `ccdi_account_result.trans_risk_level -> 风险等级`
|
||||
|
||||
### 9.2 当前口径确认
|
||||
|
||||
- [ ] `owner_id` 口径为“证件号”
|
||||
- [ ] `owner_type` 仅有:`EMPLOYEE / RELATION / INTERMEDIARY / EXTERNAL`
|
||||
- [ ] `account_type` 仅有:`BANK / SECURITIES / PAYMENT / OTHER`
|
||||
- [ ] 行内账户分析信息只读
|
||||
- [ ] 行外账户分析信息支持人工维护
|
||||
|
||||
## 11. 测试数据验收
|
||||
|
||||
建议至少核对以下场景各 1 条:
|
||||
|
||||
- [ ] 员工 + 银行账户 + 行外
|
||||
- [ ] 员工关系人 + 证券账户 + 行外
|
||||
- [ ] 中介 + 支付账户 + 行外
|
||||
- [ ] 外部人员 + 其他账户 + 行外
|
||||
|
||||
建议重点核对:
|
||||
|
||||
- [ ] 中介支付账户账号表现为手机号样式
|
||||
- [ ] 证件号列显示正确
|
||||
- [ ] 不存在本轮新增测试数据被重复插入两次的情况
|
||||
|
||||
## 12. 异常与兼容性验收
|
||||
|
||||
- [ ] 后端不可用时,前端错误提示可理解
|
||||
- [ ] 页面没有明显控制台报错
|
||||
- [ ] 分页切换正常
|
||||
- [ ] 搜索后再点详情/编辑不报错
|
||||
- [ ] 移动端窄屏下页面不出现严重错位
|
||||
|
||||
## 13. 本轮验收结论
|
||||
|
||||
### 12.1 验收结果
|
||||
|
||||
- [ ] 通过
|
||||
- [ ] 有问题需整改
|
||||
|
||||
### 12.2 问题记录
|
||||
|
||||
| 序号 | 问题描述 | 严重程度 | 是否已修复 | 备注 |
|
||||
|---|---|---|---|---|
|
||||
| 1 | | | | |
|
||||
| 2 | | | | |
|
||||
| 3 | | | | |
|
||||
|
||||
### 12.3 验收签字
|
||||
|
||||
| 角色 | 姓名 | 日期 | 结果 |
|
||||
|---|---|---|---|
|
||||
| 业务验收 | | | |
|
||||
| 产品/需求 | | | |
|
||||
| 开发确认 | | | |
|
||||
| 测试确认 | | | |
|
||||
@@ -0,0 +1,119 @@
|
||||
# 账户库管理验收记录
|
||||
|
||||
## 验收时间
|
||||
|
||||
- 日期:2026-04-14
|
||||
- 验收方式:代码检查 + 数据库核对 + 页面在线验收 + 真实接口联调
|
||||
|
||||
## 验收结论
|
||||
|
||||
本轮“账户库管理”页面已完成最小闭环与批量维护能力验收,字段口径、菜单挂载、批量导入导出、测试数据、页面收口均已完成,正式页联调通过。
|
||||
|
||||
## 已通过项
|
||||
|
||||
### 1. 页面与样式
|
||||
|
||||
- 已删除顶部“信息维护 / 账户库管理”说明卡片
|
||||
- 页面背景、主卡片、表头样式已收回到信息维护页常见灰白体系
|
||||
- 已补 `right-toolbar`
|
||||
- 搜索区域支持显隐
|
||||
- 工具栏、操作列风格已向若依现有页面对齐
|
||||
- 页面工具栏已补“导入”“导出”按钮,风格与中介库等页面保持一致
|
||||
|
||||
### 2. 字段口径
|
||||
|
||||
- `owner_id` 已按“证件号”口径处理
|
||||
- `owner_type` 仅支持:
|
||||
- `EMPLOYEE`
|
||||
- `RELATION`
|
||||
- `INTERMEDIARY`
|
||||
- `EXTERNAL`
|
||||
- `account_type` 仅支持:
|
||||
- `BANK`
|
||||
- `SECURITIES`
|
||||
- `PAYMENT`
|
||||
- `OTHER`
|
||||
- 新增默认账户范围为“行外”
|
||||
- 列表已展示“证件号”列
|
||||
- 所属人类型筛选已移动到最前面
|
||||
|
||||
### 3. 批量维护能力
|
||||
|
||||
- 已补导入模板下载接口:`POST /ccdi/accountInfo/importTemplate`
|
||||
- 已补导入接口:`POST /ccdi/accountInfo/importData`
|
||||
- 已补导出接口:`POST /ccdi/accountInfo/export`
|
||||
- 已补按钮权限:
|
||||
- `ccdi:accountInfo:import`
|
||||
- `ccdi:accountInfo:export`
|
||||
- 已补管理员角色菜单授权
|
||||
|
||||
本次在线验收结果:
|
||||
|
||||
- 导入模板下载成功,生成文件:`logs/account-info-import-template-check.xlsx`
|
||||
- 导出成功,生成文件:`logs/account-info-export-check.xlsx`
|
||||
- 合法导入样例成功,结果为“共 1 条,成功 1 条,失败 0 条”
|
||||
- 非法导入样例会在导入结果中提示失败数量,失败原因校验正常
|
||||
|
||||
### 4. 数据与测试样例
|
||||
|
||||
已核对本轮补充的 4 条测试数据,且未重复插入:
|
||||
|
||||
| account_id | owner_type | owner_id | account_no | account_type | bank_scope |
|
||||
|---|---|---|---|---|---|
|
||||
| 30 | RELATION | 330101199104010101 | ZQ330101199104010101 | SECURITIES | EXTERNAL |
|
||||
| 31 | INTERMEDIARY | 330101197901010055 | 13700000035 | PAYMENT | EXTERNAL |
|
||||
| 32 | EXTERNAL | 91330100EXT20260413 | wx-ext-20260413-001 | OTHER | EXTERNAL |
|
||||
| 33 | EMPLOYEE | 330101199001010001 | 622202440000010001 | BANK | EXTERNAL |
|
||||
|
||||
补充说明:
|
||||
|
||||
- `account_no` 维度未发现本轮测试数据重复插入
|
||||
- 页面中“看起来重复”的旧数据,主要来自历史库里原本存在的同人多卡记录
|
||||
|
||||
### 5. 菜单与权限
|
||||
|
||||
- 已补菜单 SQL:`sql/migration/2026-04-13-add-ccdi-account-info-menu.sql`
|
||||
- 前端已补按钮权限:
|
||||
- `ccdi:accountInfo:add`
|
||||
- `ccdi:accountInfo:edit`
|
||||
- `ccdi:accountInfo:remove`
|
||||
- `ccdi:accountInfo:import`
|
||||
- `ccdi:accountInfo:export`
|
||||
|
||||
### 6. 真实联调结果
|
||||
|
||||
本次已在正式页完成真实联调,结果如下:
|
||||
|
||||
- `/ccdi/accountInfo/list` 可正常返回真实库数据
|
||||
- 详情接口可用
|
||||
- 新增接口可用
|
||||
- 编辑接口可用
|
||||
- 删除接口可用
|
||||
- 导入模板接口可用
|
||||
- 导入接口可用
|
||||
- 导出接口可用
|
||||
- `ccdi_account_info` 与 `ccdi_account_result` 联表映射正确
|
||||
|
||||
## 当前可查看页面
|
||||
|
||||
当前正式页已可访问:
|
||||
|
||||
- `http://localhost/maintain/accountInfo`
|
||||
|
||||
说明:
|
||||
|
||||
- 此地址为“真前端 + 真后端 + 真数据库”联调页
|
||||
- 页面当前显示的账户数据为开发库真实数据
|
||||
- 可继续用于业务验收
|
||||
|
||||
## 最终判断
|
||||
|
||||
- 页面功能验收:通过
|
||||
- 数据口径验收:通过
|
||||
- 批量维护验收:通过
|
||||
- 真实联调环境验收:通过
|
||||
|
||||
## 建议下一步
|
||||
|
||||
1. 由业务侧继续在线验收页面与数据口径
|
||||
2. 如后续确认需要,再继续补导入模板说明或批量校验规则优化
|
||||
@@ -0,0 +1,70 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -eu
|
||||
|
||||
ROOT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")/../../.." && pwd)
|
||||
POM_FILE="$ROOT_DIR/ruoyi-admin/pom.xml"
|
||||
DEPLOY_SH="$ROOT_DIR/deploy/deploy-to-nas.sh"
|
||||
DEPLOY_PS1="$ROOT_DIR/deploy/deploy.ps1"
|
||||
DOCKERFILE="$ROOT_DIR/docker/backend/Dockerfile"
|
||||
TARGET_DIR="$ROOT_DIR/ruoyi-admin/target"
|
||||
|
||||
echo "[检查] 后端打包必须同时产出 jar 与 war,部署脚本只能使用 war"
|
||||
|
||||
if ! grep -Fq '<packaging>jar</packaging>' "$POM_FILE"; then
|
||||
echo "失败: ruoyi-admin 仍需保持 jar 打包类型以支持本地内嵌 Tomcat 运行"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! grep -Fq '<goal>war</goal>' "$POM_FILE"; then
|
||||
echo "失败: 未显式执行 war 打包目标"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! grep -Fq 'ruoyi-admin.war' "$DEPLOY_SH"; then
|
||||
echo "失败: deploy-to-nas.sh 未改为使用 ruoyi-admin.war"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if grep -Fq 'ruoyi-admin.jar' "$DEPLOY_SH"; then
|
||||
echo "失败: deploy-to-nas.sh 仍引用 ruoyi-admin.jar"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! grep -Fq 'ruoyi-admin.war' "$DEPLOY_PS1"; then
|
||||
echo "失败: deploy.ps1 未改为使用 ruoyi-admin.war"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if grep -Fq 'ruoyi-admin.jar' "$DEPLOY_PS1"; then
|
||||
echo "失败: deploy.ps1 仍引用 ruoyi-admin.jar"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! grep -Fq 'COPY backend/ruoyi-admin.war /app/ruoyi-admin.war' "$DOCKERFILE"; then
|
||||
echo "失败: Dockerfile 未改为复制 ruoyi-admin.war"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if grep -Fq 'ruoyi-admin.jar' "$DOCKERFILE"; then
|
||||
echo "失败: Dockerfile 仍引用 ruoyi-admin.jar"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "[检查] 执行 Maven 打包产物校验"
|
||||
(
|
||||
cd "$ROOT_DIR"
|
||||
mvn -pl ruoyi-admin -am package -DskipTests
|
||||
)
|
||||
|
||||
if [ ! -f "$TARGET_DIR/ruoyi-admin.jar" ]; then
|
||||
echo "失败: 未生成 $TARGET_DIR/ruoyi-admin.jar"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -f "$TARGET_DIR/ruoyi-admin.war" ]; then
|
||||
echo "失败: 未生成 $TARGET_DIR/ruoyi-admin.war"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "通过"
|
||||
19
lsfx-mock-server/tests/test_schema_migration_scripts.py
Normal file
19
lsfx-mock-server/tests/test_schema_migration_scripts.py
Normal file
@@ -0,0 +1,19 @@
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
def test_ccdi_account_info_should_have_incremental_migration_for_abnormal_account_columns():
|
||||
project_root = Path(__file__).resolve().parents[2]
|
||||
migration_path = (
|
||||
project_root
|
||||
/ "sql"
|
||||
/ "migration"
|
||||
/ "2026-04-15-sync-ccdi-account-info-abnormal-account-columns.sql"
|
||||
)
|
||||
|
||||
assert migration_path.exists(), "缺少 ccdi_account_info 异常账户字段补迁移脚本"
|
||||
|
||||
sql = migration_path.read_text(encoding="utf-8")
|
||||
|
||||
assert "information_schema.columns" in sql
|
||||
assert "ALTER TABLE `ccdi_account_info` ADD COLUMN `is_self_account`" in sql
|
||||
assert "ALTER TABLE `ccdi_account_info` ADD COLUMN `trans_risk_level`" in sql
|
||||
20
pom.xml
20
pom.xml
@@ -36,6 +36,7 @@
|
||||
<jaxb-api.version>2.3.1</jaxb-api.version>
|
||||
<jakarta.version>6.0.0</jakarta.version>
|
||||
<springdoc.version>2.8.14</springdoc.version>
|
||||
<tongweb.version>7.0.E.7</tongweb.version>
|
||||
</properties>
|
||||
|
||||
<!-- 依赖声明 -->
|
||||
@@ -110,6 +111,12 @@
|
||||
<version>${springdoc.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.tongweb.springboot</groupId>
|
||||
<artifactId>tongweb-spring-boot-starter-3.x</artifactId>
|
||||
<version>${tongweb.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- io常用工具类 -->
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
@@ -261,6 +268,17 @@
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>tongweb-releases</id>
|
||||
<name>TongWeb Maven Releases</name>
|
||||
<url>https://mvn.elitescloud.com/nexus/repository/maven-releases/</url>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
<snapshots>
|
||||
<enabled>false</enabled>
|
||||
</snapshots>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<pluginRepositories>
|
||||
@@ -277,4 +295,4 @@
|
||||
</pluginRepository>
|
||||
</pluginRepositories>
|
||||
|
||||
</project>
|
||||
</project>
|
||||
|
||||
@@ -40,6 +40,12 @@
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-framework</artifactId>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-tomcat</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<!-- 定时任务-->
|
||||
@@ -73,6 +79,11 @@
|
||||
<version>3.9.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.tongweb.springboot</groupId>
|
||||
<artifactId>tongweb-spring-boot-starter-3.x</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
@@ -82,6 +93,15 @@
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<filtering>false</filtering>
|
||||
<includes>
|
||||
<include>**/*</include>
|
||||
</includes>
|
||||
</resource>
|
||||
</resources>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
|
||||
@@ -23,6 +23,11 @@ logging:
|
||||
"com.ruoyi.ccdi.project.mapper.CcdiBankStatementMapper.insertBatch": info
|
||||
"com.ruoyi.ccdi.project.mapper.CcdiBankTagResultMapper.insertBatch": info
|
||||
|
||||
server:
|
||||
tongweb:
|
||||
license:
|
||||
path: classpath:license.dat
|
||||
|
||||
# 用户配置
|
||||
user:
|
||||
password:
|
||||
|
||||
1
ruoyi-admin/src/main/resources/license.dat
Normal file
1
ruoyi-admin/src/main/resources/license.dat
Normal file
@@ -0,0 +1 @@
|
||||
uc3Y29XJfVtZtZTbmF72t3V405cxamrXBnM0P0vqrrLnJjQ0T0Mt93avL/euwcmvgpWN09qZhbWX25eO9U91ptOrcWNK1XJz6z9waqNC5L40d09ybfrmrDP352Ny76fqyPauv06+ru7f+bTwG99zvHOS8bQvJub/rL3JkoKbfbnZXJmVyVtYwMjPTIjEyQtMsaWMQpnNlNlbkPTX2lTE5EwNsaWOApnNlNlb5cGX3RmVsU9czZQZWFmVhpjcfZGdGVT0yF0Z0LTMDITEwEyLuZFCmVXRl9kYxClPS01ByRXX1Y3b2RmFtRfTUb2ZT12Vi5nVXX1ClRnNpZlcfTnb25mVyVtYuMCPTclRX5FCQVVX0N1VO9DTKYmVD0GlwluZUV1PQpXJk9IYyZVd2FD0K9JZfTWVFd051F4XlcjbWJQpU0tMFZGV19W9ul0atYmPUVk5FVkCWRVV19U9OJTSJQ0X0x0U9VOQLWUWFlTU1lLbSMmSmhkNHlBRrcVdG8kNtUxYCT2RHFTc5lperM2WUFkkvU3M3MzTDBldOlqeTb3YUVGx3VWT1WkaERHhilxOTM0T0l1FrdBS1aUWG4GE5FtaLMyUXZUlz8zM0UnSCs0lDM5RDVFRzJDBzZmOoRkNFdEt6YwNKTkTXA1ZFVXXJT0UlNElD5fTDRTRU5TdU1YdROEL2xUhvV3OLY3bTVmhMpZUJU2QXF2I1VYdxTjWVVm9jZKUPWUMXFHNrFJeJZDU29mM2hKQpUmUVJGIxwwOVSUaXFXQy9JU4cFdlkGJQY4SCYWYjFkJndiaCVFMlNk1QZQTwQWRDJ0th1YMwaHYmEzQrB2aWTTRmpgpOA5dfVkRVd0lPVSUMSUTl9kNFNFTyaWPU0G5mNwaieUdUJ0NiZjNVbnOC90tNYyb2S3djNmh4BidmNlRnBk1PdCShdDYUdS9mNMSiMnYzVml2pSameEY2NStCZtRvU3dloGgvQyU0TmcTlTlMJVYhc3VEp01EpYRwUGNUUWZ5daVxU3blZzg3dnR2UncnR2U4RkU2CkSUc19W5FVTSURVJ0xJ9OXOQ0Q0VG1iU9WFcDYWNktah2M3blbjNlZsZndjOTdXFTFHNQS0SzUE4FVpdqR1dEL2RWgvpMSabVZkJlhRJFRMZUTUJ0NGdwUGbGZitjFE01bZSlRzZHZ4RMUFd2cHhEZqtZbwR2clQUgxFsb0Z1ZFVW5tJvUwWEd2gjVog1eKYUaUdHYK5JUXX1TkVlNJZFUfTET05U5DlDRTVURV9jJi49SmbHR2pU5UFwVUK0ZTBFE5pmd3ZGOEdXppU1VTNEb09UtntCRycUaHUmR1ovVYNGUU1HFy1vVsZXYlBmt1lsNVZDVUNUNyJQeHUXZlF2pzVMVlVjVmNWx2VxWZaUSEh1FlJ0bmRmbENkRV9VWiRVT3R01apMUIMkWjdW8K5JTXX1TkVlNJZFUfTET05U5DlDRTVURV9Ulw49bhMWcW5HdRdZNaK0UEp3AyU0TwY0Wm1md6tDMpN0cDRVBK11aKR0VTZkI3RocKUXRm5Vl6llcpMWaXJXRLZOOaZDOGZ1R0gychWURVJk5JR5VNYXQTl250dGYheFOG1FZog4RFZWMkRmtK1QRCaUclJlNYNFRHSWTFpFUKxYRXX1TkVlNJZFUfTET05U5DlDRTVURV9Hho49T5aTempVMwFhU1b1Vi9HR4YzO1dDNks05HhEQxY2VUZXlMNybyVmVEl3dNlLbYSGbGlWxMVNWUcEZXpVN0w5NVZDVGFUw4NMSUOWbkRjV21QaMbESVhGx1w3MiY1WmJXB6o0NjS1T2tWxjNSeRY0UzV0g2VhR5Z0RWlzkKRMdXX1TkVlNJZFUfTET05U5DlDRTVURV9Hdt49apUHZVNnhlpxQ5MENGNnh1VYN3aDQ2QW5qRqd4K1cXYk9ZdHW4VzeE9XVHB6YmM3Wk1DYwVLdqS1aTNUtjhINicVeUV1JBZRZxTGYWdTVytuepR1QVVXZlNoSVOFdVlVkzRqdPcjOW9HBll6Ota2dHFGV6dtN6c1ekN2UKdwc
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.ruoyi.config;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.boot.env.YamlPropertySourceLoader;
|
||||
import org.springframework.core.env.PropertySource;
|
||||
import org.springframework.core.io.ClassPathResource;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
class TongWebIntegrationConfigurationTest {
|
||||
|
||||
@Test
|
||||
void shouldExposeTongWebLicenseResourceOnClasspath() {
|
||||
assertThat(getClass().getClassLoader().getResource("license.dat"))
|
||||
.as("TongWeb license 文件应随应用资源一起打包")
|
||||
.isNotNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
void shouldDeclareTongWebLicensePathInApplicationYaml() throws IOException {
|
||||
YamlPropertySourceLoader loader = new YamlPropertySourceLoader();
|
||||
List<PropertySource<?>> propertySources = loader.load("application", new ClassPathResource("application.yml"));
|
||||
|
||||
Object propertyValue = propertySources.stream()
|
||||
.map(source -> source.getProperty("server.tongweb.license.path"))
|
||||
.filter(value -> value != null)
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
|
||||
assertThat(propertyValue)
|
||||
.as("基础配置中应声明 TongWeb license 路径")
|
||||
.isEqualTo("classpath:license.dat");
|
||||
}
|
||||
}
|
||||
62
ruoyi-ui/src/api/ccdiAccountInfo.js
Normal file
62
ruoyi-ui/src/api/ccdiAccountInfo.js
Normal file
@@ -0,0 +1,62 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询账户库列表
|
||||
export function listAccountInfo(query) {
|
||||
return request({
|
||||
url: '/ccdi/accountInfo/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询账户库详情
|
||||
export function getAccountInfo(id) {
|
||||
return request({
|
||||
url: '/ccdi/accountInfo/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增账户
|
||||
export function addAccountInfo(data) {
|
||||
return request({
|
||||
url: '/ccdi/accountInfo',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改账户
|
||||
export function updateAccountInfo(data) {
|
||||
return request({
|
||||
url: '/ccdi/accountInfo',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除账户
|
||||
export function delAccountInfo(ids) {
|
||||
return request({
|
||||
url: '/ccdi/accountInfo/' + ids,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 查询员工下拉
|
||||
export function listAccountStaffOptions(query) {
|
||||
return request({
|
||||
url: '/ccdi/accountInfo/staffOptions',
|
||||
method: 'get',
|
||||
params: { query }
|
||||
})
|
||||
}
|
||||
|
||||
// 查询关系人下拉
|
||||
export function listAccountRelationOptions(staffId) {
|
||||
return request({
|
||||
url: '/ccdi/accountInfo/relationOptions',
|
||||
method: 'get',
|
||||
params: { staffId }
|
||||
})
|
||||
}
|
||||
78
ruoyi-ui/src/api/ccdiEnterpriseBaseInfo.js
Normal file
78
ruoyi-ui/src/api/ccdiEnterpriseBaseInfo.js
Normal file
@@ -0,0 +1,78 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询实体库列表
|
||||
export function listEnterpriseBaseInfo(query) {
|
||||
return request({
|
||||
url: '/ccdi/enterpriseBaseInfo/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询实体库详细
|
||||
export function getEnterpriseBaseInfo(socialCreditCode) {
|
||||
return request({
|
||||
url: '/ccdi/enterpriseBaseInfo/' + socialCreditCode,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增实体库
|
||||
export function addEnterpriseBaseInfo(data) {
|
||||
return request({
|
||||
url: '/ccdi/enterpriseBaseInfo',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改实体库
|
||||
export function updateEnterpriseBaseInfo(data) {
|
||||
return request({
|
||||
url: '/ccdi/enterpriseBaseInfo',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除实体库
|
||||
export function delEnterpriseBaseInfo(socialCreditCodes) {
|
||||
return request({
|
||||
url: '/ccdi/enterpriseBaseInfo/' + socialCreditCodes,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 下载导入模板
|
||||
export function importTemplate() {
|
||||
return request({
|
||||
url: '/ccdi/enterpriseBaseInfo/importTemplate',
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
// 导入实体库
|
||||
export function importData(data) {
|
||||
return request({
|
||||
url: '/ccdi/enterpriseBaseInfo/importData',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 查询导入状态
|
||||
export function getImportStatus(taskId) {
|
||||
return request({
|
||||
url: '/ccdi/enterpriseBaseInfo/importStatus/' + taskId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 查询导入失败记录
|
||||
export function getImportFailures(taskId, pageNum, pageSize) {
|
||||
return request({
|
||||
url: '/ccdi/enterpriseBaseInfo/importFailures/' + taskId,
|
||||
method: 'get',
|
||||
params: { pageNum, pageSize }
|
||||
})
|
||||
}
|
||||
@@ -89,3 +89,23 @@ export function getDataSourceOptions() {
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询实体风险等级选项
|
||||
*/
|
||||
export function getEnterpriseRiskLevelOptions() {
|
||||
return request({
|
||||
url: '/ccdi/enum/enterpriseRiskLevel',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询企业来源选项
|
||||
*/
|
||||
export function getEnterpriseSourceOptions() {
|
||||
return request({
|
||||
url: '/ccdi/enum/enterpriseSource',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ import { isRelogin } from '@/utils/request'
|
||||
|
||||
NProgress.configure({ showSpinner: false })
|
||||
|
||||
const whiteList = ['/login', '/register']
|
||||
const whiteList = ['/login', '/register', '/prototype/account-library']
|
||||
|
||||
const isWhiteList = (path) => {
|
||||
return whiteList.some(pattern => isPathMatch(pattern, path))
|
||||
|
||||
@@ -77,6 +77,20 @@ export const constantRoutes = [
|
||||
name: 'ProjectDetail',
|
||||
hidden: true,
|
||||
meta: { title: '项目详情', noCache: true }
|
||||
},
|
||||
{
|
||||
path: 'prototype/account-library',
|
||||
component: () => import('@/views/ccdiAccountInfoPrototype/index'),
|
||||
name: 'AccountLibraryPrototype',
|
||||
hidden: true,
|
||||
meta: { title: '账户库管理原型', noCache: true }
|
||||
},
|
||||
{
|
||||
path: 'ccdiAccountInfo',
|
||||
component: () => import('@/views/ccdiAccountInfo/index'),
|
||||
name: 'CcdiAccountInfo',
|
||||
hidden: true,
|
||||
meta: { title: '账户库管理', noCache: true }
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
903
ruoyi-ui/src/views/ccdiAccountInfo/index.vue
Normal file
903
ruoyi-ui/src/views/ccdiAccountInfo/index.vue
Normal file
@@ -0,0 +1,903 @@
|
||||
<template>
|
||||
<div class="app-container account-page">
|
||||
<div class="board">
|
||||
<el-form
|
||||
v-show="showSearch"
|
||||
ref="queryForm"
|
||||
:model="queryParams"
|
||||
size="small"
|
||||
:inline="true"
|
||||
class="query-form"
|
||||
label-width="96px"
|
||||
>
|
||||
<el-form-item label="所属人类型">
|
||||
<el-select v-model="queryParams.ownerType" placeholder="请选择所属人类型" clearable style="width: 180px">
|
||||
<el-option label="员工" value="EMPLOYEE" />
|
||||
<el-option label="员工关系人" value="RELATION" />
|
||||
<el-option label="中介" value="INTERMEDIARY" />
|
||||
<el-option label="外部人员" value="EXTERNAL" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="员工姓名">
|
||||
<el-input v-model="queryParams.staffName" placeholder="请输入员工姓名" clearable style="width: 220px" @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="账户范围">
|
||||
<el-select v-model="queryParams.bankScope" placeholder="请选择账户范围" clearable style="width: 160px">
|
||||
<el-option label="行内" value="INTERNAL" />
|
||||
<el-option label="行外" value="EXTERNAL" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="关系类型">
|
||||
<el-select v-model="queryParams.relationType" placeholder="请选择关系类型" clearable style="width: 180px">
|
||||
<el-option v-for="item in relationTypeOptions" :key="item" :label="item" :value="item" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="账户姓名">
|
||||
<el-input v-model="queryParams.accountName" placeholder="请输入账户姓名" clearable style="width: 220px" @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="账户类型">
|
||||
<el-select v-model="queryParams.accountType" placeholder="请选择账户类型" clearable style="width: 180px">
|
||||
<el-option label="银行账户" value="BANK" />
|
||||
<el-option label="证券账户" value="SECURITIES" />
|
||||
<el-option label="支付账户" value="PAYMENT" />
|
||||
<el-option label="其他" value="OTHER" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否实控">
|
||||
<el-select v-model="queryParams.isActualControl" placeholder="请选择是否实控" clearable style="width: 180px">
|
||||
<el-option label="是" :value="1" />
|
||||
<el-option label="否" :value="0" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="风险等级">
|
||||
<el-select v-model="queryParams.riskLevel" placeholder="请选择风险等级" clearable style="width: 180px">
|
||||
<el-option label="LOW" value="LOW" />
|
||||
<el-option label="MEDIUM" value="MEDIUM" />
|
||||
<el-option label="HIGH" value="HIGH" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态">
|
||||
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable style="width: 160px">
|
||||
<el-option label="正常" :value="1" />
|
||||
<el-option label="已销户" :value="2" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item class="query-actions">
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="openCreateDialog"
|
||||
v-hasPermi="['ccdi:accountInfo:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-upload2"
|
||||
size="mini"
|
||||
@click="handleImport"
|
||||
v-hasPermi="['ccdi:accountInfo:import']"
|
||||
>导入</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['ccdi:accountInfo:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" />
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="rows" stripe border class="account-table">
|
||||
<el-table-column label="员工姓名" prop="staffName" min-width="120">
|
||||
<template slot-scope="scope">{{ scope.row.staffName || '-' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="所属人类型" prop="ownerType" width="132" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="ownerTypeTagType(scope.row.ownerType)" size="mini" effect="plain">
|
||||
{{ ownerTypeLabel(scope.row.ownerType) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="关系类型" prop="relationType" width="90" align="center">
|
||||
<template slot-scope="scope">{{ scope.row.relationType || '-' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="证件号" prop="ownerId" min-width="170" show-overflow-tooltip>
|
||||
<template slot-scope="scope">{{ scope.row.ownerId || scope.row.relationCertNo || '-' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="账户姓名" prop="accountName" min-width="120">
|
||||
<template slot-scope="scope">{{ scope.row.accountName || '-' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="账户号码" prop="accountNo" min-width="180" />
|
||||
<el-table-column label="账户类型" prop="accountType" width="110" align="center">
|
||||
<template slot-scope="scope">{{ accountTypeLabel(scope.row.accountType) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="账户范围" prop="bankScope" width="96" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-tag size="mini" :type="bankScopeTagType(scope.row.bankScope)" effect="plain">{{ bankScopeLabel(scope.row.bankScope) }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="开户机构" prop="openBank" min-width="160" show-overflow-tooltip />
|
||||
<el-table-column label="是否实控" prop="isActualControl" width="92" align="center">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.isActualControl === null || scope.row.isActualControl === undefined">-</span>
|
||||
<el-tag v-else size="mini" :type="scope.row.isActualControl ? 'success' : 'danger'">
|
||||
{{ scope.row.isActualControl ? '是' : '否' }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="月均笔数" prop="avgMonthTxnCount" width="90" align="center">
|
||||
<template slot-scope="scope">{{ scope.row.avgMonthTxnCount === null || scope.row.avgMonthTxnCount === undefined ? '-' : scope.row.avgMonthTxnCount }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="月均金额" prop="avgMonthTxnAmount" min-width="120" align="right">
|
||||
<template slot-scope="scope">{{ formatAmount(scope.row.avgMonthTxnAmount) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="频率等级" prop="txnFrequencyLevel" width="96" align="center">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="!scope.row.txnFrequencyLevel">-</span>
|
||||
<el-tag v-else size="mini" :type="frequencyTagType(scope.row.txnFrequencyLevel)">{{ scope.row.txnFrequencyLevel }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="风险等级" prop="txnRiskLevel" width="96" align="center">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="!scope.row.txnRiskLevel">-</span>
|
||||
<el-tag v-else size="mini" effect="dark" :type="riskTagType(scope.row.txnRiskLevel)">{{ scope.row.txnRiskLevel }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" prop="status" width="80" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-tag size="mini" :type="scope.row.status === 1 ? 'success' : 'danger'">{{ scope.row.status === 1 ? '正常' : '已销户' }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="180" fixed="right" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="mini" icon="el-icon-view" @click="openDetailDialog(scope.row)">详情</el-button>
|
||||
<el-button
|
||||
type="text"
|
||||
size="mini"
|
||||
icon="el-icon-edit"
|
||||
@click="openEditDialog(scope.row)"
|
||||
v-hasPermi="['ccdi:accountInfo:edit']"
|
||||
>编辑</el-button>
|
||||
<el-button
|
||||
type="text"
|
||||
size="mini"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['ccdi:accountInfo:remove']"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
|
||||
</div>
|
||||
|
||||
<el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="1160px" append-to-body>
|
||||
<el-form ref="dialogForm" :model="form" :rules="rules" label-width="120px">
|
||||
<div class="form-section">
|
||||
<div class="section-head"><span>归属信息</span></div>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="所属人类型" prop="ownerType">
|
||||
<el-radio-group v-model="form.ownerType" :disabled="dialogMode === 'detail'" @change="handleOwnerTypeChange">
|
||||
<el-radio label="EMPLOYEE">员工</el-radio>
|
||||
<el-radio label="RELATION">员工关系人</el-radio>
|
||||
<el-radio label="INTERMEDIARY">中介</el-radio>
|
||||
<el-radio label="EXTERNAL">外部人员</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item v-if="isInternalOwner" label="员工姓名" prop="staffId">
|
||||
<el-select v-model="form.staffId" placeholder="请选择员工" filterable clearable style="width: 100%" :disabled="dialogMode === 'detail'" @change="handleStaffChange">
|
||||
<el-option v-for="item in staffOptions" :key="item.staffId" :label="item.name" :value="item.staffId" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item v-else :label="manualOwnerNameLabel" prop="accountName">
|
||||
<el-input v-model="form.accountName" :placeholder="manualOwnerNamePlaceholder" :disabled="dialogMode === 'detail'" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="是否本人账户">
|
||||
<el-input :value="form.ownerType === 'EMPLOYEE' ? '是' : '否'" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16" v-if="form.ownerType === 'RELATION'">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="关系人姓名" prop="relationId">
|
||||
<el-select v-model="form.relationId" placeholder="请选择关系人" clearable style="width: 100%" :disabled="dialogMode === 'detail'" @change="fillRelationMeta">
|
||||
<el-option v-for="item in relationOptions" :key="item.id" :label="item.relationName" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="关系类型">
|
||||
<el-input v-model="form.relationType" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="关系人证件号">
|
||||
<el-input v-model="form.relationCertNo" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="证件号" prop="ownerId">
|
||||
<el-input
|
||||
v-if="!isRelationOwner"
|
||||
v-model="form.ownerId"
|
||||
:placeholder="ownerIdPlaceholder"
|
||||
:disabled="dialogMode === 'detail' || isEmployeeOwner"
|
||||
/>
|
||||
<el-input v-else :value="form.relationCertNo" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
|
||||
<div class="form-section">
|
||||
<div class="section-head"><span>账户信息</span></div>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="账户号码" prop="accountNo">
|
||||
<el-input v-model="form.accountNo" :disabled="dialogMode === 'detail'" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="账户类型" prop="accountType">
|
||||
<el-select v-model="form.accountType" style="width: 100%" :disabled="dialogMode === 'detail'">
|
||||
<el-option label="银行账户" value="BANK" />
|
||||
<el-option label="证券账户" value="SECURITIES" />
|
||||
<el-option label="支付账户" value="PAYMENT" />
|
||||
<el-option label="其他" value="OTHER" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="账户范围" prop="bankScope">
|
||||
<el-select v-model="form.bankScope" style="width: 100%" :disabled="dialogMode === 'detail'">
|
||||
<el-option label="行内" value="INTERNAL" />
|
||||
<el-option label="行外" value="EXTERNAL" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="账户姓名" prop="accountName" v-if="isInternalOwner">
|
||||
<el-input v-model="form.accountName" :disabled="dialogMode === 'detail'" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="开户机构" prop="openBank">
|
||||
<el-input v-model="form.openBank" :disabled="dialogMode === 'detail'" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="银行代码">
|
||||
<el-input v-model="form.bankCode" :disabled="dialogMode === 'detail'" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="币种">
|
||||
<el-input v-model="form.currency" :disabled="dialogMode === 'detail'" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="form.status" style="width: 100%" :disabled="dialogMode === 'detail'">
|
||||
<el-option label="正常" :value="1" />
|
||||
<el-option label="已销户" :value="2" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="生效日期" prop="effectiveDate">
|
||||
<el-date-picker v-model="form.effectiveDate" type="date" value-format="yyyy-MM-dd" style="width: 100%" :disabled="dialogMode === 'detail'" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="失效日期" prop="invalidDate">
|
||||
<el-date-picker v-model="form.invalidDate" type="date" value-format="yyyy-MM-dd" style="width: 100%" :disabled="dialogMode === 'detail'" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
|
||||
<div class="form-section accent-section">
|
||||
<div class="section-head"><span>分析信息</span></div>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="是否实控账户">
|
||||
<el-select v-model="form.isActualControl" style="width: 100%" :disabled="analysisReadonly">
|
||||
<el-option label="是" :value="1" />
|
||||
<el-option label="否" :value="0" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="月均交易笔数">
|
||||
<el-input-number v-model="form.avgMonthTxnCount" :min="0" :disabled="analysisReadonly" style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="月均交易金额">
|
||||
<el-input-number v-model="form.avgMonthTxnAmount" :min="0" :precision="2" :disabled="analysisReadonly" style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="频率等级">
|
||||
<el-select v-model="form.txnFrequencyLevel" style="width: 100%" :disabled="analysisReadonly">
|
||||
<el-option label="LOW" value="LOW" />
|
||||
<el-option label="MEDIUM" value="MEDIUM" />
|
||||
<el-option label="HIGH" value="HIGH" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="风险等级">
|
||||
<el-select v-model="form.txnRiskLevel" style="width: 100%" :disabled="analysisReadonly">
|
||||
<el-option label="LOW" value="LOW" />
|
||||
<el-option label="MEDIUM" value="MEDIUM" />
|
||||
<el-option label="HIGH" value="HIGH" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="借方单笔最高额">
|
||||
<el-input-number v-model="form.debitSingleMaxAmount" :min="0" :precision="2" :disabled="analysisReadonly" style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="贷方单笔最高额">
|
||||
<el-input-number v-model="form.creditSingleMaxAmount" :min="0" :precision="2" :disabled="analysisReadonly" style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="借方日累计最高额">
|
||||
<el-input-number v-model="form.debitDailyMaxAmount" :min="0" :precision="2" :disabled="analysisReadonly" style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="贷方日累计最高额">
|
||||
<el-input-number v-model="form.creditDailyMaxAmount" :min="0" :precision="2" :disabled="analysisReadonly" style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-form>
|
||||
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">{{ dialogMode === 'detail' ? '关 闭' : '取 消' }}</el-button>
|
||||
<el-button v-if="dialogMode !== 'detail'" type="primary" @click="submitForm">保 存</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog
|
||||
:title="upload.title"
|
||||
:visible.sync="upload.open"
|
||||
width="400px"
|
||||
append-to-body
|
||||
@close="handleImportDialogClose"
|
||||
v-loading="upload.isUploading"
|
||||
element-loading-text="正在导入数据,请稍候..."
|
||||
element-loading-spinner="el-icon-loading"
|
||||
element-loading-background="rgba(0, 0, 0, 0.7)"
|
||||
>
|
||||
<el-upload
|
||||
ref="upload"
|
||||
:limit="1"
|
||||
accept=".xlsx,.xls"
|
||||
:headers="upload.headers"
|
||||
:action="upload.url"
|
||||
:disabled="upload.isUploading"
|
||||
:on-progress="handleFileUploadProgress"
|
||||
:on-success="handleFileSuccess"
|
||||
:auto-upload="false"
|
||||
drag
|
||||
>
|
||||
<i class="el-icon-upload"></i>
|
||||
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
||||
<div slot="tip" class="el-upload__tip">
|
||||
<el-link type="primary" :underline="false" style="font-size: 12px; vertical-align: baseline;" @click="importTemplate">下载模板</el-link>
|
||||
</div>
|
||||
<div slot="tip" class="el-upload__tip">
|
||||
<span>仅允许导入 xls、xlsx 文件。</span>
|
||||
</div>
|
||||
</el-upload>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitFileForm" :loading="upload.isUploading">确 定</el-button>
|
||||
<el-button @click="upload.open = false" :disabled="upload.isUploading">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<import-result-dialog
|
||||
:visible.sync="importResultVisible"
|
||||
:content="importResultContent"
|
||||
title="导入结果"
|
||||
@close="handleImportResultClose"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ImportResultDialog from '@/components/ImportResultDialog.vue'
|
||||
import { getToken } from '@/utils/auth'
|
||||
import {
|
||||
addAccountInfo,
|
||||
delAccountInfo,
|
||||
getAccountInfo,
|
||||
listAccountInfo,
|
||||
listAccountRelationOptions,
|
||||
listAccountStaffOptions,
|
||||
updateAccountInfo
|
||||
} from '@/api/ccdiAccountInfo'
|
||||
|
||||
const RELATION_TYPES = ['配偶', '父亲', '母亲', '子女', '兄弟姐妹', '朋友', '同事', '其他']
|
||||
|
||||
function createEmptyForm() {
|
||||
return {
|
||||
id: null,
|
||||
ownerType: 'EMPLOYEE',
|
||||
ownerId: '',
|
||||
staffId: undefined,
|
||||
relationId: undefined,
|
||||
relationType: '',
|
||||
relationName: '',
|
||||
relationCertNo: '',
|
||||
accountNo: '',
|
||||
accountType: 'BANK',
|
||||
bankScope: 'EXTERNAL',
|
||||
accountName: '',
|
||||
openBank: '',
|
||||
bankCode: '',
|
||||
currency: 'CNY',
|
||||
status: 1,
|
||||
effectiveDate: '',
|
||||
invalidDate: '',
|
||||
isActualControl: 1,
|
||||
avgMonthTxnCount: 0,
|
||||
avgMonthTxnAmount: 0,
|
||||
txnFrequencyLevel: 'MEDIUM',
|
||||
debitSingleMaxAmount: 0,
|
||||
creditSingleMaxAmount: 0,
|
||||
debitDailyMaxAmount: 0,
|
||||
creditDailyMaxAmount: 0,
|
||||
txnRiskLevel: 'LOW'
|
||||
}
|
||||
}
|
||||
|
||||
export default {
|
||||
name: 'CcdiAccountInfo',
|
||||
components: { ImportResultDialog },
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
showSearch: true,
|
||||
total: 0,
|
||||
rows: [],
|
||||
dialogVisible: false,
|
||||
dialogMode: 'create',
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
staffName: '',
|
||||
ownerType: '',
|
||||
bankScope: '',
|
||||
relationType: '',
|
||||
accountName: '',
|
||||
accountType: '',
|
||||
isActualControl: undefined,
|
||||
riskLevel: '',
|
||||
status: undefined
|
||||
},
|
||||
form: createEmptyForm(),
|
||||
staffOptions: [],
|
||||
relationOptions: [],
|
||||
relationTypeOptions: RELATION_TYPES,
|
||||
upload: {
|
||||
open: false,
|
||||
title: '导入账户数据',
|
||||
isUploading: false,
|
||||
headers: { Authorization: 'Bearer ' + getToken() },
|
||||
url: process.env.VUE_APP_BASE_API + '/ccdi/accountInfo/importData'
|
||||
},
|
||||
importResultVisible: false,
|
||||
importResultContent: '',
|
||||
rules: {
|
||||
ownerType: [{ required: true, message: '请选择所属人类型', trigger: 'change' }],
|
||||
staffId: [{ validator: (rule, value, callback) => {
|
||||
if (this.isInternalOwner && !value) {
|
||||
callback(new Error('请选择员工'))
|
||||
return
|
||||
}
|
||||
callback()
|
||||
}, trigger: 'change' }],
|
||||
relationId: [{ validator: (rule, value, callback) => {
|
||||
if (this.form.ownerType === 'RELATION' && !value) {
|
||||
callback(new Error('请选择关系人'))
|
||||
return
|
||||
}
|
||||
callback()
|
||||
}, trigger: 'change' }],
|
||||
ownerId: [{ validator: (rule, value, callback) => {
|
||||
if (!this.isInternalOwner && !value) {
|
||||
callback(new Error('请输入证件号'))
|
||||
return
|
||||
}
|
||||
callback()
|
||||
}, trigger: 'blur' }],
|
||||
accountNo: [{ required: true, message: '请输入账户号码', trigger: 'blur' }],
|
||||
accountType: [{ required: true, message: '请选择账户类型', trigger: 'change' }],
|
||||
bankScope: [{ required: true, message: '请选择账户范围', trigger: 'change' }],
|
||||
accountName: [{ required: true, message: '请输入账户姓名', trigger: 'blur' }],
|
||||
openBank: [{ required: true, message: '请输入开户机构', trigger: 'blur' }],
|
||||
status: [{ required: true, message: '请选择状态', trigger: 'change' }],
|
||||
effectiveDate: [{ required: true, message: '请选择生效日期', trigger: 'change' }],
|
||||
invalidDate: [{ validator: (rule, value, callback) => {
|
||||
if (value && this.form.effectiveDate && value < this.form.effectiveDate) {
|
||||
callback(new Error('失效日期不能早于生效日期'))
|
||||
return
|
||||
}
|
||||
callback()
|
||||
}, trigger: 'change' }]
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
isEmployeeOwner() {
|
||||
return this.form.ownerType === 'EMPLOYEE'
|
||||
},
|
||||
isRelationOwner() {
|
||||
return this.form.ownerType === 'RELATION'
|
||||
},
|
||||
isInternalOwner() {
|
||||
return this.isEmployeeOwner || this.isRelationOwner
|
||||
},
|
||||
manualOwnerNameLabel() {
|
||||
return this.form.ownerType === 'INTERMEDIARY' ? '中介名称' : '外部人员姓名'
|
||||
},
|
||||
manualOwnerNamePlaceholder() {
|
||||
return this.form.ownerType === 'INTERMEDIARY' ? '请输入中介名称' : '请输入外部人员姓名'
|
||||
},
|
||||
ownerIdPlaceholder() {
|
||||
return this.form.ownerType === 'INTERMEDIARY' ? '请输入中介证件号' : '请输入身份证号'
|
||||
},
|
||||
analysisReadonly() {
|
||||
return this.dialogMode === 'detail' || this.form.bankScope === 'INTERNAL'
|
||||
},
|
||||
dialogTitle() {
|
||||
if (this.dialogMode === 'detail') return '账户详情'
|
||||
if (this.dialogMode === 'edit') return '编辑账户'
|
||||
return '新增账户'
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
this.loading = true
|
||||
listAccountInfo(this.queryParams).then(response => {
|
||||
this.rows = response.rows || []
|
||||
this.total = response.total || 0
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
async loadStaffOptions(query = '') {
|
||||
const response = await listAccountStaffOptions(query)
|
||||
this.staffOptions = response.data || []
|
||||
},
|
||||
async loadRelationOptions(staffId) {
|
||||
if (!staffId) {
|
||||
this.relationOptions = []
|
||||
return
|
||||
}
|
||||
const response = await listAccountRelationOptions(staffId)
|
||||
this.relationOptions = response.data || []
|
||||
},
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1
|
||||
this.getList()
|
||||
},
|
||||
resetQuery() {
|
||||
this.queryParams = {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
staffName: '',
|
||||
ownerType: '',
|
||||
bankScope: '',
|
||||
relationType: '',
|
||||
accountName: '',
|
||||
accountType: '',
|
||||
isActualControl: undefined,
|
||||
riskLevel: '',
|
||||
status: undefined
|
||||
}
|
||||
this.resetForm('queryForm')
|
||||
this.getList()
|
||||
},
|
||||
handleImport() {
|
||||
this.upload.open = true
|
||||
},
|
||||
handleExport() {
|
||||
this.download('ccdi/accountInfo/export', {
|
||||
...this.queryParams
|
||||
}, `账户库管理_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
importTemplate() {
|
||||
this.download('ccdi/accountInfo/importTemplate', {}, `账户库导入模板_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
handleFileUploadProgress() {
|
||||
this.upload.isUploading = true
|
||||
},
|
||||
handleFileSuccess(response) {
|
||||
this.upload.isUploading = false
|
||||
this.upload.open = false
|
||||
this.$refs.upload.clearFiles()
|
||||
if (response.code !== 200) {
|
||||
this.$modal.msgError(response.msg || '导入失败')
|
||||
return
|
||||
}
|
||||
const importData = response.data || {}
|
||||
this.importResultContent = this.buildImportResultHtml(importData)
|
||||
this.importResultVisible = true
|
||||
this.getList()
|
||||
},
|
||||
buildImportResultHtml(importData) {
|
||||
const totalCount = importData.totalCount || 0
|
||||
const successCount = importData.successCount || 0
|
||||
const failureCount = importData.failureCount || 0
|
||||
let html = '<div style="padding: 10px;">'
|
||||
html += `<p><strong>导入完成</strong></p><p>总数:${totalCount} 条</p><p>成功:${successCount} 条</p><p>失败:${failureCount} 条</p>`
|
||||
html += '</div>'
|
||||
return html
|
||||
},
|
||||
submitFileForm() {
|
||||
this.$refs.upload.submit()
|
||||
},
|
||||
handleImportDialogClose() {
|
||||
this.upload.isUploading = false
|
||||
this.$refs.upload && this.$refs.upload.clearFiles()
|
||||
},
|
||||
handleImportResultClose() {
|
||||
this.importResultVisible = false
|
||||
this.importResultContent = ''
|
||||
},
|
||||
formatAmount(value) {
|
||||
if (value === null || value === undefined || value === '') return '-'
|
||||
return Number(value).toLocaleString('zh-CN', { minimumFractionDigits: 2, maximumFractionDigits: 2 })
|
||||
},
|
||||
accountTypeLabel(type) {
|
||||
return { BANK: '银行账户', SECURITIES: '证券账户', PAYMENT: '支付账户', OTHER: '其他' }[type] || type
|
||||
},
|
||||
bankScopeLabel(scope) {
|
||||
return { INTERNAL: '行内', EXTERNAL: '行外' }[scope] || scope
|
||||
},
|
||||
bankScopeTagType(scope) {
|
||||
return scope === 'INTERNAL' ? 'success' : 'warning'
|
||||
},
|
||||
ownerTypeLabel(type) {
|
||||
return { EMPLOYEE: '员工', RELATION: '员工关系人', INTERMEDIARY: '中介', EXTERNAL: '外部人员' }[type] || type
|
||||
},
|
||||
ownerTypeTagType(type) {
|
||||
return { EMPLOYEE: 'success', RELATION: 'info', INTERMEDIARY: 'danger', EXTERNAL: 'warning' }[type] || 'info'
|
||||
},
|
||||
riskTagType(level) {
|
||||
return { LOW: 'success', MEDIUM: 'warning', HIGH: 'danger' }[level] || 'info'
|
||||
},
|
||||
frequencyTagType(level) {
|
||||
return { LOW: 'info', MEDIUM: '', HIGH: 'danger' }[level] || 'info'
|
||||
},
|
||||
async openCreateDialog() {
|
||||
this.dialogMode = 'create'
|
||||
this.form = createEmptyForm()
|
||||
this.relationOptions = []
|
||||
await this.loadStaffOptions()
|
||||
this.dialogVisible = true
|
||||
this.$nextTick(() => this.clearDialogValidate())
|
||||
},
|
||||
async openEditDialog(row) {
|
||||
await this.openDialog('edit', row.id)
|
||||
},
|
||||
async openDetailDialog(row) {
|
||||
await this.openDialog('detail', row.id)
|
||||
},
|
||||
async openDialog(mode, id) {
|
||||
this.dialogMode = mode
|
||||
await this.loadStaffOptions()
|
||||
const response = await getAccountInfo(id)
|
||||
const data = response.data || {}
|
||||
if (data.ownerType === 'RELATION' && data.staffId) {
|
||||
await this.loadRelationOptions(data.staffId)
|
||||
} else {
|
||||
this.relationOptions = []
|
||||
}
|
||||
this.form = Object.assign(createEmptyForm(), data, {
|
||||
staffId: data.staffId || undefined,
|
||||
relationId: data.relationId || undefined,
|
||||
invalidDate: data.invalidDate || ''
|
||||
})
|
||||
this.dialogVisible = true
|
||||
this.$nextTick(() => this.clearDialogValidate())
|
||||
},
|
||||
handleOwnerTypeChange(value) {
|
||||
if (value !== 'RELATION') {
|
||||
this.form.relationId = undefined
|
||||
this.form.relationType = ''
|
||||
this.form.relationName = ''
|
||||
this.form.relationCertNo = ''
|
||||
this.relationOptions = []
|
||||
}
|
||||
if (!this.isInternalOwner) {
|
||||
this.form.staffId = undefined
|
||||
this.form.relationId = undefined
|
||||
this.form.relationType = ''
|
||||
this.form.relationName = ''
|
||||
this.form.relationCertNo = ''
|
||||
this.form.accountName = ''
|
||||
this.form.ownerId = ''
|
||||
} else if (value === 'EMPLOYEE' && this.form.staffId) {
|
||||
this.handleStaffChange(this.form.staffId)
|
||||
} else if (value === 'RELATION' && this.form.staffId) {
|
||||
this.loadRelationOptions(this.form.staffId)
|
||||
this.form.accountName = ''
|
||||
this.form.ownerId = ''
|
||||
}
|
||||
},
|
||||
async handleStaffChange(staffId) {
|
||||
const staff = this.staffOptions.find(item => item.staffId === staffId)
|
||||
if (this.form.ownerType === 'EMPLOYEE') {
|
||||
this.form.accountName = staff ? staff.name : ''
|
||||
this.form.ownerId = staff ? (staff.idCard || '') : ''
|
||||
} else if (this.form.ownerType === 'RELATION') {
|
||||
this.form.relationId = undefined
|
||||
this.form.relationType = ''
|
||||
this.form.relationName = ''
|
||||
this.form.relationCertNo = ''
|
||||
this.form.accountName = ''
|
||||
this.form.ownerId = ''
|
||||
await this.loadRelationOptions(staffId)
|
||||
}
|
||||
},
|
||||
fillRelationMeta(relationId) {
|
||||
const relation = this.relationOptions.find(item => item.id === relationId)
|
||||
if (!relation) return
|
||||
this.form.relationType = relation.relationType
|
||||
this.form.relationName = relation.relationName
|
||||
this.form.relationCertNo = relation.relationCertNo
|
||||
this.form.ownerId = relation.relationCertNo
|
||||
this.form.accountName = relation.relationName
|
||||
},
|
||||
buildPayload() {
|
||||
return {
|
||||
id: this.form.id,
|
||||
ownerType: this.form.ownerType,
|
||||
ownerId: this.form.ownerId,
|
||||
accountNo: this.form.accountNo,
|
||||
accountType: this.form.accountType,
|
||||
bankScope: this.form.bankScope,
|
||||
accountName: this.form.accountName,
|
||||
openBank: this.form.openBank,
|
||||
bankCode: this.form.bankCode,
|
||||
currency: this.form.currency,
|
||||
status: this.form.status,
|
||||
effectiveDate: this.form.effectiveDate,
|
||||
invalidDate: this.form.invalidDate || null,
|
||||
isActualControl: this.form.isActualControl,
|
||||
avgMonthTxnCount: this.form.avgMonthTxnCount,
|
||||
avgMonthTxnAmount: this.form.avgMonthTxnAmount,
|
||||
txnFrequencyLevel: this.form.txnFrequencyLevel,
|
||||
debitSingleMaxAmount: this.form.debitSingleMaxAmount,
|
||||
creditSingleMaxAmount: this.form.creditSingleMaxAmount,
|
||||
debitDailyMaxAmount: this.form.debitDailyMaxAmount,
|
||||
creditDailyMaxAmount: this.form.creditDailyMaxAmount,
|
||||
txnRiskLevel: this.form.txnRiskLevel
|
||||
}
|
||||
},
|
||||
clearDialogValidate() {
|
||||
if (this.$refs.dialogForm) {
|
||||
this.$refs.dialogForm.clearValidate()
|
||||
}
|
||||
},
|
||||
submitForm() {
|
||||
this.$refs.dialogForm.validate(valid => {
|
||||
if (!valid) return
|
||||
const payload = this.buildPayload()
|
||||
const request = this.dialogMode === 'edit' ? updateAccountInfo(payload) : addAccountInfo(payload)
|
||||
request.then(() => {
|
||||
this.$modal.msgSuccess(this.dialogMode === 'edit' ? '修改成功' : '新增成功')
|
||||
this.dialogVisible = false
|
||||
this.getList()
|
||||
})
|
||||
})
|
||||
},
|
||||
handleDelete(row) {
|
||||
this.$modal.confirm('是否确认删除账户号码为“' + row.accountNo + '”的数据项?').then(() => {
|
||||
return delAccountInfo(row.id)
|
||||
}).then(() => {
|
||||
this.$modal.msgSuccess('删除成功')
|
||||
this.getList()
|
||||
}).catch(() => {})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.account-page {
|
||||
min-height: calc(100vh - 84px);
|
||||
background: #f5f7fa;
|
||||
}
|
||||
|
||||
.board {
|
||||
padding: 20px;
|
||||
border-radius: 8px;
|
||||
background: #fff;
|
||||
border: 1px solid #ebeef5;
|
||||
}
|
||||
|
||||
.account-table ::v-deep .el-table__header th {
|
||||
background: #f8f8f9;
|
||||
color: #515a6e;
|
||||
}
|
||||
|
||||
.form-section {
|
||||
margin-bottom: 18px;
|
||||
padding: 18px 18px 4px;
|
||||
border-radius: 8px;
|
||||
background: #f9fafb;
|
||||
border: 1px solid #ebeef5;
|
||||
}
|
||||
|
||||
.accent-section {
|
||||
background: #f9fafb;
|
||||
}
|
||||
|
||||
.section-head {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
justify-content: space-between;
|
||||
gap: 16px;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.section-head span {
|
||||
color: #303133;
|
||||
font-size: 16px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.query-form ::v-deep .el-form-item {
|
||||
display: block;
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user