修复中介库

This commit is contained in:
wkc
2026-04-20 11:24:18 +08:00
parent c278d11390
commit 2b321a8621
31 changed files with 1360 additions and 1466 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@@ -26,8 +26,10 @@
- 前端实施计划放 `docs/plans/frontend/` - 前端实施计划放 `docs/plans/frontend/`
- 前端开发直接在当前分支进行,不需要额外创建 git worktree - 前端开发直接在当前分支进行,不需要额外创建 git worktree
- 测试结束后,自动关闭测试过程中启动的前后端进程 - 测试结束后,自动关闭测试过程中启动的前后端进程
- 重启后端时,必须优先使用 `bin/restart_java_backend.sh`,不要直接手工执行 `java -jar` 替代正式重启流程
- 遇到 MCP 数据库操作时,使用项目配置文件中的数据库连接信息 - 遇到 MCP 数据库操作时,使用项目配置文件中的数据库连接信息
- 执行包含中文内容的 MySQL SQL 脚本或数据库导入时,禁止直接手写 `mysql -e` 或普通重定向执行;必须优先使用 `bin/mysql_utf8_exec.sh <sql-file>`,确保会话字符集为 `utf8mb4`,避免导入或写入乱码 - 执行包含中文内容的 MySQL SQL 脚本或数据库导入时,禁止直接手写 `mysql -e` 或普通重定向执行;必须优先使用 `bin/mysql_utf8_exec.sh <sql-file>`,确保会话字符集为 `utf8mb4`,避免导入或写入乱码
- 数据库字符集与排序规则统一要求:所有业务表、系统表新增或修改时,必须显式使用 `utf8mb4` 字符集与 `utf8mb4_general_ci` 排序规则;禁止引入 `utf8mb4_0900_ai_ci``utf8mb4_unicode_ci` 或其他混用排序规则
- 银行流水打标相关规则与参数编码需要统一使用全大写;新增或修改 `rule_code``indicator_code``param_code` 时,禁止混用大小写风格 - 银行流水打标相关规则与参数编码需要统一使用全大写;新增或修改 `rule_code``indicator_code``param_code` 时,禁止混用大小写风格
--- ---
@@ -165,6 +167,7 @@ return AjaxResult.success(result);
- 前端表单不要暴露通用审计字段 - 前端表单不要暴露通用审计字段
- 新增菜单、字典、初始化数据时,同步补充 SQL 脚本 - 新增菜单、字典、初始化数据时,同步补充 SQL 脚本
- 执行数据库脚本或导入数据库前,需确认客户端会话字符集为 `utf8mb4`;涉及中文插入、更新、导入时默认使用 `bin/mysql_utf8_exec.sh` - 执行数据库脚本或导入数据库前,需确认客户端会话字符集为 `utf8mb4`;涉及中文插入、更新、导入时默认使用 `bin/mysql_utf8_exec.sh`
- 所有系统表和业务表的表级、字符字段级排序规则统一为 `utf8mb4_general_ci`;新增建表 SQL、字段追加 SQL、表结构修复 SQL 必须显式声明,避免因默认排序规则漂移导致联表或条件查询报错
### 前端规范 ### 前端规范

View File

@@ -83,7 +83,7 @@ collect_pids() {
fi fi
fi fi
marker_pids=$(pgrep -f "$APP_MARKER" 2>/dev/null || true) marker_pids=$(pgrep -f -- "$APP_MARKER" 2>/dev/null || true)
if [ -n "${marker_pids:-}" ]; then if [ -n "${marker_pids:-}" ]; then
for pid in $marker_pids; do for pid in $marker_pids; do
if is_managed_backend_pid "$pid"; then if is_managed_backend_pid "$pid"; then
@@ -92,6 +92,15 @@ collect_pids() {
done done
fi fi
port_pids=$(lsof -tiTCP:"$SERVER_PORT" -sTCP:LISTEN 2>/dev/null || true)
if [ -n "${port_pids:-}" ]; then
for pid in $port_pids; do
if is_managed_backend_pid "$pid"; then
all_pids="$all_pids $pid"
fi
done
fi
unique_pids="" unique_pids=""
for pid in $all_pids; do for pid in $all_pids; do
case " $unique_pids " in case " $unique_pids " in

View File

@@ -72,6 +72,26 @@ public class CcdiIntermediaryController extends BaseController {
return success(vo); return success(vo);
} }
/**
* 查询中介亲属列表
*/
@Operation(summary = "查询中介亲属列表")
@PreAuthorize("@ss.hasPermi('ccdi:intermediary:query')")
@GetMapping("/{bizId}/relatives")
public AjaxResult getRelativeList(@PathVariable String bizId) {
return success(intermediaryService.selectIntermediaryRelativeList(bizId));
}
/**
* 查询中介亲属详情
*/
@Operation(summary = "查询中介亲属详情")
@PreAuthorize("@ss.hasPermi('ccdi:intermediary:query')")
@GetMapping("/relative/{relativeBizId}")
public AjaxResult getRelativeInfo(@PathVariable String relativeBizId) {
return success(intermediaryService.selectIntermediaryRelativeDetail(relativeBizId));
}
/** /**
* 查询实体中介详情 * 查询实体中介详情
*/ */
@@ -105,6 +125,28 @@ public class CcdiIntermediaryController extends BaseController {
return toAjax(intermediaryService.updateIntermediaryPerson(editDTO)); return toAjax(intermediaryService.updateIntermediaryPerson(editDTO));
} }
/**
* 新增中介亲属
*/
@Operation(summary = "新增中介亲属")
@PreAuthorize("@ss.hasPermi('ccdi:intermediary:add')")
@Log(title = "中介亲属", businessType = BusinessType.INSERT)
@PostMapping("/{bizId}/relative")
public AjaxResult addRelative(@PathVariable String bizId, @Validated @RequestBody CcdiIntermediaryRelativeAddDTO addDTO) {
return toAjax(intermediaryService.insertIntermediaryRelative(bizId, addDTO));
}
/**
* 修改中介亲属
*/
@Operation(summary = "修改中介亲属")
@PreAuthorize("@ss.hasPermi('ccdi:intermediary:edit')")
@Log(title = "中介亲属", businessType = BusinessType.UPDATE)
@PutMapping("/relative")
public AjaxResult editRelative(@Validated @RequestBody CcdiIntermediaryRelativeEditDTO editDTO) {
return toAjax(intermediaryService.updateIntermediaryRelative(editDTO));
}
/** /**
* 新增实体中介 * 新增实体中介
*/ */
@@ -127,6 +169,49 @@ public class CcdiIntermediaryController extends BaseController {
return toAjax(intermediaryService.updateIntermediaryEntity(editDTO)); return toAjax(intermediaryService.updateIntermediaryEntity(editDTO));
} }
/**
* 查询中介关联机构列表
*/
@Operation(summary = "查询中介关联机构列表")
@PreAuthorize("@ss.hasPermi('ccdi:intermediary:query')")
@GetMapping("/{bizId}/enterprise-relations")
public AjaxResult getEnterpriseRelationList(@PathVariable String bizId) {
return success(intermediaryService.selectIntermediaryEnterpriseRelationList(bizId));
}
/**
* 查询中介关联机构详情
*/
@Operation(summary = "查询中介关联机构详情")
@PreAuthorize("@ss.hasPermi('ccdi:intermediary:query')")
@GetMapping("/enterprise-relation/{id}")
public AjaxResult getEnterpriseRelationInfo(@PathVariable Long id) {
return success(intermediaryService.selectIntermediaryEnterpriseRelationDetail(id));
}
/**
* 新增中介关联机构
*/
@Operation(summary = "新增中介关联机构")
@PreAuthorize("@ss.hasPermi('ccdi:intermediary:add')")
@Log(title = "中介关联机构", businessType = BusinessType.INSERT)
@PostMapping("/{bizId}/enterprise-relation")
public AjaxResult addEnterpriseRelation(@PathVariable String bizId,
@Validated @RequestBody CcdiIntermediaryEnterpriseRelationAddDTO addDTO) {
return toAjax(intermediaryService.insertIntermediaryEnterpriseRelation(bizId, addDTO));
}
/**
* 修改中介关联机构
*/
@Operation(summary = "修改中介关联机构")
@PreAuthorize("@ss.hasPermi('ccdi:intermediary:edit')")
@Log(title = "中介关联机构", businessType = BusinessType.UPDATE)
@PutMapping("/enterprise-relation")
public AjaxResult editEnterpriseRelation(@Validated @RequestBody CcdiIntermediaryEnterpriseRelationEditDTO editDTO) {
return toAjax(intermediaryService.updateIntermediaryEnterpriseRelation(editDTO));
}
/** /**
* 删除中介 * 删除中介
*/ */
@@ -138,6 +223,28 @@ public class CcdiIntermediaryController extends BaseController {
return toAjax(intermediaryService.deleteIntermediaryByIds(ids)); return toAjax(intermediaryService.deleteIntermediaryByIds(ids));
} }
/**
* 删除中介亲属
*/
@Operation(summary = "删除中介亲属")
@PreAuthorize("@ss.hasPermi('ccdi:intermediary:remove')")
@Log(title = "中介亲属", businessType = BusinessType.DELETE)
@DeleteMapping("/relative/{relativeBizId}")
public AjaxResult removeRelative(@PathVariable String relativeBizId) {
return toAjax(intermediaryService.deleteIntermediaryRelative(relativeBizId));
}
/**
* 删除中介关联机构
*/
@Operation(summary = "删除中介关联机构")
@PreAuthorize("@ss.hasPermi('ccdi:intermediary:remove')")
@Log(title = "中介关联机构", businessType = BusinessType.DELETE)
@DeleteMapping("/enterprise-relation/{id}")
public AjaxResult removeEnterpriseRelation(@PathVariable Long id) {
return toAjax(intermediaryService.deleteIntermediaryEnterpriseRelation(id));
}
/** /**
* 校验人员ID唯一性 * 校验人员ID唯一性
*/ */

View File

@@ -19,12 +19,15 @@ public class CcdiIntermediaryQueryDTO implements Serializable {
@Serial @Serial
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@Schema(description = "姓名/机构名称") @Schema(description = "名称")
private String name; private String name;
@Schema(description = "证件号/统一社会信用代码") @Schema(description = "证件号")
private String certificateNo; private String certificateNo;
@Schema(description = "中介类型(1=个人, 2=实体)") @Schema(description = "记录类型(INTERMEDIARY/RELATIVE/ENTERPRISE_RELATION)")
private String intermediaryType; private String recordType;
@Schema(description = "关联中介信息(姓名或证件号)")
private String relatedIntermediaryKeyword;
} }

View File

@@ -21,32 +21,25 @@ public class CcdiIntermediaryVO implements Serializable {
@Serial @Serial
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@Schema(description = "ID") @Schema(description = "记录类型")
private String id; private String recordType;
@Schema(description = "姓名/机构名称") @Schema(description = "记录ID")
private String recordId;
@Schema(description = "名称")
private String name; private String name;
@Schema(description = "证件号/统一社会信用代码") @Schema(description = "证件号")
private String certificateNo; private String certificateNo;
@Schema(description = "中介类型(1=个人, 2=实体)") @Schema(description = "关联中介姓名")
private String intermediaryType; private String relatedIntermediaryName;
@Schema(description = "人员类型") @Schema(description = "关联关系")
private String personType; private String relationText;
@Schema(description = "公司")
private String company;
@Schema(description = "数据来源")
private String dataSource;
@Schema(description = "创建时间") @Schema(description = "创建时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime; private Date createTime;
@Schema(description = "修改时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime;
} }

View File

@@ -4,8 +4,10 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.info.collection.domain.dto.*; import com.ruoyi.info.collection.domain.dto.*;
import com.ruoyi.info.collection.domain.excel.CcdiIntermediaryEntityExcel; import com.ruoyi.info.collection.domain.excel.CcdiIntermediaryEntityExcel;
import com.ruoyi.info.collection.domain.excel.CcdiIntermediaryPersonExcel; import com.ruoyi.info.collection.domain.excel.CcdiIntermediaryPersonExcel;
import com.ruoyi.info.collection.domain.vo.CcdiIntermediaryEnterpriseRelationVO;
import com.ruoyi.info.collection.domain.vo.CcdiIntermediaryEntityDetailVO; import com.ruoyi.info.collection.domain.vo.CcdiIntermediaryEntityDetailVO;
import com.ruoyi.info.collection.domain.vo.CcdiIntermediaryPersonDetailVO; import com.ruoyi.info.collection.domain.vo.CcdiIntermediaryPersonDetailVO;
import com.ruoyi.info.collection.domain.vo.CcdiIntermediaryRelativeVO;
import com.ruoyi.info.collection.domain.vo.CcdiIntermediaryVO; import com.ruoyi.info.collection.domain.vo.CcdiIntermediaryVO;
import java.util.List; import java.util.List;
@@ -35,6 +37,22 @@ public interface ICcdiIntermediaryService {
*/ */
CcdiIntermediaryPersonDetailVO selectIntermediaryPersonDetail(String bizId); CcdiIntermediaryPersonDetailVO selectIntermediaryPersonDetail(String bizId);
/**
* 查询中介亲属列表
*
* @param bizId 中介本人ID
* @return 亲属列表
*/
List<CcdiIntermediaryRelativeVO> selectIntermediaryRelativeList(String bizId);
/**
* 查询中介亲属详情
*
* @param relativeBizId 亲属ID
* @return 亲属详情
*/
CcdiIntermediaryRelativeVO selectIntermediaryRelativeDetail(String relativeBizId);
/** /**
* 查询实体中介详情 * 查询实体中介详情
* *
@@ -59,6 +77,31 @@ public interface ICcdiIntermediaryService {
*/ */
int updateIntermediaryPerson(CcdiIntermediaryPersonEditDTO editDTO); int updateIntermediaryPerson(CcdiIntermediaryPersonEditDTO editDTO);
/**
* 新增中介亲属
*
* @param bizId 中介本人ID
* @param addDTO 新增DTO
* @return 结果
*/
int insertIntermediaryRelative(String bizId, CcdiIntermediaryRelativeAddDTO addDTO);
/**
* 修改中介亲属
*
* @param editDTO 编辑DTO
* @return 结果
*/
int updateIntermediaryRelative(CcdiIntermediaryRelativeEditDTO editDTO);
/**
* 删除中介亲属
*
* @param relativeBizId 亲属ID
* @return 结果
*/
int deleteIntermediaryRelative(String relativeBizId);
/** /**
* 新增实体中介 * 新增实体中介
* *
@@ -75,6 +118,47 @@ public interface ICcdiIntermediaryService {
*/ */
int updateIntermediaryEntity(CcdiIntermediaryEntityEditDTO editDTO); int updateIntermediaryEntity(CcdiIntermediaryEntityEditDTO editDTO);
/**
* 查询中介关联机构列表
*
* @param bizId 中介本人ID
* @return 关联机构列表
*/
List<CcdiIntermediaryEnterpriseRelationVO> selectIntermediaryEnterpriseRelationList(String bizId);
/**
* 查询中介关联机构详情
*
* @param id 主键ID
* @return 关联机构详情
*/
CcdiIntermediaryEnterpriseRelationVO selectIntermediaryEnterpriseRelationDetail(Long id);
/**
* 新增中介关联机构
*
* @param bizId 中介本人ID
* @param addDTO 新增DTO
* @return 结果
*/
int insertIntermediaryEnterpriseRelation(String bizId, CcdiIntermediaryEnterpriseRelationAddDTO addDTO);
/**
* 修改中介关联机构
*
* @param editDTO 编辑DTO
* @return 结果
*/
int updateIntermediaryEnterpriseRelation(CcdiIntermediaryEnterpriseRelationEditDTO editDTO);
/**
* 删除中介关联机构
*
* @param id 主键ID
* @return 结果
*/
int deleteIntermediaryEnterpriseRelation(Long id);
/** /**
* 批量删除中介 * 批量删除中介
* *

View File

@@ -4,14 +4,18 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.info.collection.domain.CcdiBizIntermediary; import com.ruoyi.info.collection.domain.CcdiBizIntermediary;
import com.ruoyi.info.collection.domain.CcdiEnterpriseBaseInfo; import com.ruoyi.info.collection.domain.CcdiEnterpriseBaseInfo;
import com.ruoyi.info.collection.domain.CcdiIntermediaryEnterpriseRelation;
import com.ruoyi.info.collection.domain.dto.*; import com.ruoyi.info.collection.domain.dto.*;
import com.ruoyi.info.collection.domain.excel.CcdiIntermediaryEntityExcel; import com.ruoyi.info.collection.domain.excel.CcdiIntermediaryEntityExcel;
import com.ruoyi.info.collection.domain.excel.CcdiIntermediaryPersonExcel; import com.ruoyi.info.collection.domain.excel.CcdiIntermediaryPersonExcel;
import com.ruoyi.info.collection.domain.vo.CcdiIntermediaryEnterpriseRelationVO;
import com.ruoyi.info.collection.domain.vo.CcdiIntermediaryEntityDetailVO; import com.ruoyi.info.collection.domain.vo.CcdiIntermediaryEntityDetailVO;
import com.ruoyi.info.collection.domain.vo.CcdiIntermediaryPersonDetailVO; import com.ruoyi.info.collection.domain.vo.CcdiIntermediaryPersonDetailVO;
import com.ruoyi.info.collection.domain.vo.CcdiIntermediaryRelativeVO;
import com.ruoyi.info.collection.domain.vo.CcdiIntermediaryVO; import com.ruoyi.info.collection.domain.vo.CcdiIntermediaryVO;
import com.ruoyi.info.collection.mapper.CcdiBizIntermediaryMapper; import com.ruoyi.info.collection.mapper.CcdiBizIntermediaryMapper;
import com.ruoyi.info.collection.mapper.CcdiEnterpriseBaseInfoMapper; import com.ruoyi.info.collection.mapper.CcdiEnterpriseBaseInfoMapper;
import com.ruoyi.info.collection.mapper.CcdiIntermediaryEnterpriseRelationMapper;
import com.ruoyi.info.collection.mapper.CcdiIntermediaryMapper; import com.ruoyi.info.collection.mapper.CcdiIntermediaryMapper;
import com.ruoyi.info.collection.service.ICcdiIntermediaryEntityImportService; import com.ruoyi.info.collection.service.ICcdiIntermediaryEntityImportService;
import com.ruoyi.info.collection.service.ICcdiIntermediaryPersonImportService; import com.ruoyi.info.collection.service.ICcdiIntermediaryPersonImportService;
@@ -48,6 +52,9 @@ public class CcdiIntermediaryServiceImpl implements ICcdiIntermediaryService {
@Resource @Resource
private CcdiIntermediaryMapper intermediaryMapper; private CcdiIntermediaryMapper intermediaryMapper;
@Resource
private CcdiIntermediaryEnterpriseRelationMapper enterpriseRelationMapper;
@Resource @Resource
private ICcdiIntermediaryPersonImportService personImportService; private ICcdiIntermediaryPersonImportService personImportService;
@@ -81,7 +88,7 @@ public class CcdiIntermediaryServiceImpl implements ICcdiIntermediaryService {
@Override @Override
public CcdiIntermediaryPersonDetailVO selectIntermediaryPersonDetail(String bizId) { public CcdiIntermediaryPersonDetailVO selectIntermediaryPersonDetail(String bizId) {
CcdiBizIntermediary person = bizIntermediaryMapper.selectById(bizId); CcdiBizIntermediary person = bizIntermediaryMapper.selectById(bizId);
if (person == null) { if (person == null || !isIntermediaryPerson(person)) {
return null; return null;
} }
@@ -92,6 +99,24 @@ public class CcdiIntermediaryServiceImpl implements ICcdiIntermediaryService {
return vo; return vo;
} }
@Override
public List<CcdiIntermediaryRelativeVO> selectIntermediaryRelativeList(String bizId) {
LambdaQueryWrapper<CcdiBizIntermediary> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(CcdiBizIntermediary::getRelatedNumId, bizId)
.ne(CcdiBizIntermediary::getPersonSubType, "本人")
.orderByDesc(CcdiBizIntermediary::getCreateTime);
return bizIntermediaryMapper.selectList(wrapper).stream().map(this::buildRelativeVo).toList();
}
@Override
public CcdiIntermediaryRelativeVO selectIntermediaryRelativeDetail(String relativeBizId) {
CcdiBizIntermediary relative = bizIntermediaryMapper.selectById(relativeBizId);
if (relative == null || isIntermediaryPerson(relative)) {
return null;
}
return buildRelativeVo(relative);
}
/** /**
* 查询实体中介详情 * 查询实体中介详情
* *
@@ -130,6 +155,8 @@ public class CcdiIntermediaryServiceImpl implements ICcdiIntermediaryService {
CcdiBizIntermediary person = new CcdiBizIntermediary(); CcdiBizIntermediary person = new CcdiBizIntermediary();
BeanUtils.copyProperties(addDTO, person); BeanUtils.copyProperties(addDTO, person);
person.setPersonSubType("本人");
person.setRelatedNumId(null);
person.setDataSource("MANUAL"); person.setDataSource("MANUAL");
return bizIntermediaryMapper.insert(person); return bizIntermediaryMapper.insert(person);
@@ -151,12 +178,64 @@ public class CcdiIntermediaryServiceImpl implements ICcdiIntermediaryService {
} }
} }
CcdiBizIntermediary existing = bizIntermediaryMapper.selectById(editDTO.getBizId());
if (existing == null || !isIntermediaryPerson(existing)) {
throw new RuntimeException("中介本人不存在");
}
CcdiBizIntermediary person = new CcdiBizIntermediary(); CcdiBizIntermediary person = new CcdiBizIntermediary();
BeanUtils.copyProperties(editDTO, person); BeanUtils.copyProperties(editDTO, person);
person.setPersonSubType("本人");
person.setRelatedNumId(null);
return bizIntermediaryMapper.updateById(person); return bizIntermediaryMapper.updateById(person);
} }
@Override
@Transactional
public int insertIntermediaryRelative(String bizId, CcdiIntermediaryRelativeAddDTO addDTO) {
CcdiBizIntermediary owner = requireIntermediaryPerson(bizId);
validateRelativePersonSubType(addDTO.getPersonSubType());
if (!checkPersonIdUnique(addDTO.getPersonId(), null)) {
throw new RuntimeException("该证件号已存在");
}
CcdiBizIntermediary relative = new CcdiBizIntermediary();
BeanUtils.copyProperties(addDTO, relative);
relative.setRelatedNumId(owner.getBizId());
relative.setDataSource("MANUAL");
return bizIntermediaryMapper.insert(relative);
}
@Override
@Transactional
public int updateIntermediaryRelative(CcdiIntermediaryRelativeEditDTO editDTO) {
CcdiBizIntermediary existing = bizIntermediaryMapper.selectById(editDTO.getBizId());
if (existing == null || isIntermediaryPerson(existing)) {
throw new RuntimeException("中介亲属不存在");
}
validateRelativePersonSubType(editDTO.getPersonSubType());
if (StringUtils.isNotEmpty(editDTO.getPersonId())
&& !checkPersonIdUnique(editDTO.getPersonId(), editDTO.getBizId())) {
throw new RuntimeException("该证件号已存在");
}
CcdiBizIntermediary relative = new CcdiBizIntermediary();
BeanUtils.copyProperties(editDTO, relative);
relative.setRelatedNumId(existing.getRelatedNumId());
return bizIntermediaryMapper.updateById(relative);
}
@Override
@Transactional
public int deleteIntermediaryRelative(String relativeBizId) {
CcdiBizIntermediary existing = bizIntermediaryMapper.selectById(relativeBizId);
if (existing == null || isIntermediaryPerson(existing)) {
throw new RuntimeException("中介亲属不存在");
}
return bizIntermediaryMapper.deleteById(relativeBizId);
}
/** /**
* 新增实体中介 * 新增实体中介
* *
@@ -197,6 +276,49 @@ public class CcdiIntermediaryServiceImpl implements ICcdiIntermediaryService {
return enterpriseBaseInfoMapper.updateById(entity); return enterpriseBaseInfoMapper.updateById(entity);
} }
@Override
public List<CcdiIntermediaryEnterpriseRelationVO> selectIntermediaryEnterpriseRelationList(String bizId) {
return enterpriseRelationMapper.selectByIntermediaryBizId(bizId);
}
@Override
public CcdiIntermediaryEnterpriseRelationVO selectIntermediaryEnterpriseRelationDetail(Long id) {
return enterpriseRelationMapper.selectDetailById(id);
}
@Override
@Transactional
public int insertIntermediaryEnterpriseRelation(String bizId, CcdiIntermediaryEnterpriseRelationAddDTO addDTO) {
CcdiBizIntermediary owner = requireIntermediaryPerson(bizId);
validateEnterpriseRelation(owner.getBizId(), addDTO.getSocialCreditCode(), null);
CcdiIntermediaryEnterpriseRelation relation = new CcdiIntermediaryEnterpriseRelation();
BeanUtils.copyProperties(addDTO, relation);
relation.setIntermediaryBizId(owner.getBizId());
return enterpriseRelationMapper.insert(relation);
}
@Override
@Transactional
public int updateIntermediaryEnterpriseRelation(CcdiIntermediaryEnterpriseRelationEditDTO editDTO) {
CcdiIntermediaryEnterpriseRelation existing = enterpriseRelationMapper.selectById(editDTO.getId());
if (existing == null) {
throw new RuntimeException("中介关联机构不存在");
}
validateEnterpriseRelation(existing.getIntermediaryBizId(), editDTO.getSocialCreditCode(), existing.getId());
CcdiIntermediaryEnterpriseRelation relation = new CcdiIntermediaryEnterpriseRelation();
BeanUtils.copyProperties(editDTO, relation);
relation.setIntermediaryBizId(existing.getIntermediaryBizId());
return enterpriseRelationMapper.updateById(relation);
}
@Override
@Transactional
public int deleteIntermediaryEnterpriseRelation(Long id) {
return enterpriseRelationMapper.deleteById(id);
}
/** /**
* 批量删除中介 * 批量删除中介
* *
@@ -208,12 +330,19 @@ public class CcdiIntermediaryServiceImpl implements ICcdiIntermediaryService {
public int deleteIntermediaryByIds(String[] ids) { public int deleteIntermediaryByIds(String[] ids) {
int count = 0; int count = 0;
for (String id : ids) { for (String id : ids) {
// 判断是个人还是实体个人ID长度较长实体统一社会信用代码18位 CcdiBizIntermediary intermediary = bizIntermediaryMapper.selectById(id);
if (id.length() > 18) { if (intermediary != null) {
// 个人中介 if (isIntermediaryPerson(intermediary)) {
bizIntermediaryMapper.delete(new LambdaQueryWrapper<CcdiBizIntermediary>()
.eq(CcdiBizIntermediary::getRelatedNumId, id));
enterpriseRelationMapper.delete(new LambdaQueryWrapper<CcdiIntermediaryEnterpriseRelation>()
.eq(CcdiIntermediaryEnterpriseRelation::getIntermediaryBizId, id));
}
count += bizIntermediaryMapper.deleteById(id); count += bizIntermediaryMapper.deleteById(id);
} else { continue;
// 实体中介 }
if (enterpriseBaseInfoMapper.selectById(id) != null) {
count += enterpriseBaseInfoMapper.deleteById(id); count += enterpriseBaseInfoMapper.deleteById(id);
} }
} }
@@ -325,4 +454,45 @@ public class CcdiIntermediaryServiceImpl implements ICcdiIntermediaryService {
return taskId; return taskId;
} }
private boolean isIntermediaryPerson(CcdiBizIntermediary person) {
return "本人".equals(person.getPersonSubType());
}
private CcdiBizIntermediary requireIntermediaryPerson(String bizId) {
CcdiBizIntermediary owner = bizIntermediaryMapper.selectById(bizId);
if (owner == null || !isIntermediaryPerson(owner)) {
throw new RuntimeException("中介本人不存在");
}
return owner;
}
private void validateRelativePersonSubType(String personSubType) {
if ("本人".equals(personSubType)) {
throw new RuntimeException("亲属关系不能为本人");
}
}
private void validateEnterpriseRelation(String bizId, String socialCreditCode, Long excludeId) {
requireIntermediaryPerson(bizId);
if (enterpriseBaseInfoMapper.selectById(socialCreditCode) == null) {
throw new RuntimeException("关联机构不存在");
}
boolean exists = enterpriseRelationMapper.existsByIntermediaryBizIdAndSocialCreditCode(bizId, socialCreditCode);
if (exists) {
if (excludeId == null) {
throw new RuntimeException("该中介已关联此机构");
}
CcdiIntermediaryEnterpriseRelation existing = enterpriseRelationMapper.selectById(excludeId);
if (existing == null || !socialCreditCode.equals(existing.getSocialCreditCode())) {
throw new RuntimeException("该中介已关联此机构");
}
}
}
private CcdiIntermediaryRelativeVO buildRelativeVo(CcdiBizIntermediary relative) {
CcdiIntermediaryRelativeVO vo = new CcdiIntermediaryRelativeVO();
BeanUtils.copyProperties(relative, vo);
return vo;
}
} }

View File

@@ -4,57 +4,86 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.info.collection.mapper.CcdiIntermediaryMapper"> <mapper namespace="com.ruoyi.info.collection.mapper.CcdiIntermediaryMapper">
<!-- <!-- 中介综合库联合查询 -->
中介黑名单联合查询
支持按中介类型筛选: 1=个人中介, 2=实体中介, null=全部
使用MyBatis Plus分页插件自动处理分页
-->
<select id="selectIntermediaryList" resultType="com.ruoyi.info.collection.domain.vo.CcdiIntermediaryVO"> <select id="selectIntermediaryList" resultType="com.ruoyi.info.collection.domain.vo.CcdiIntermediaryVO">
SELECT * FROM ( SELECT * FROM (
<!-- 查询个人中介 -->
SELECT SELECT
biz_id as id, CAST('INTERMEDIARY' AS CHAR CHARACTER SET utf8mb4) COLLATE utf8mb4_general_ci AS record_type,
name, biz_id COLLATE utf8mb4_general_ci AS record_id,
person_id as certificate_no, name COLLATE utf8mb4_general_ci AS name,
'1' as intermediary_type, person_id COLLATE utf8mb4_general_ci AS certificate_no,
person_type, name COLLATE utf8mb4_general_ci AS related_intermediary_name,
company, CAST('本人' AS CHAR CHARACTER SET utf8mb4) COLLATE utf8mb4_general_ci AS relation_text,
data_source, person_id COLLATE utf8mb4_general_ci AS related_intermediary_certificate_no,
create_time, create_time
update_time
FROM ccdi_biz_intermediary FROM ccdi_biz_intermediary
WHERE person_sub_type COLLATE utf8mb4_general_ci = '本人' COLLATE utf8mb4_general_ci
UNION ALL UNION ALL
<!-- 查询实体中介 -->
SELECT SELECT
social_credit_code as id, CAST('RELATIVE' AS CHAR CHARACTER SET utf8mb4) COLLATE utf8mb4_general_ci AS record_type,
enterprise_name as name, child.biz_id COLLATE utf8mb4_general_ci AS record_id,
social_credit_code as certificate_no, child.name COLLATE utf8mb4_general_ci AS name,
'2' as intermediary_type, child.person_id COLLATE utf8mb4_general_ci AS certificate_no,
'实体' as person_type, parent.name COLLATE utf8mb4_general_ci AS related_intermediary_name,
enterprise_name as company, child.person_sub_type COLLATE utf8mb4_general_ci AS relation_text,
data_source, parent.person_id COLLATE utf8mb4_general_ci AS related_intermediary_certificate_no,
create_time, child.create_time
update_time FROM ccdi_biz_intermediary child
FROM ccdi_enterprise_base_info INNER JOIN ccdi_biz_intermediary parent
WHERE risk_level = '1' AND ent_source = 'INTERMEDIARY' ON child.related_num_id COLLATE utf8mb4_general_ci = parent.biz_id COLLATE utf8mb4_general_ci
AND parent.person_sub_type COLLATE utf8mb4_general_ci = '本人' COLLATE utf8mb4_general_ci
WHERE child.person_sub_type IS NOT NULL
AND child.person_sub_type COLLATE utf8mb4_general_ci != '本人' COLLATE utf8mb4_general_ci
UNION ALL
SELECT
CAST('ENTERPRISE_RELATION' AS CHAR CHARACTER SET utf8mb4) COLLATE utf8mb4_general_ci AS record_type,
CAST(rel.id AS CHAR CHARACTER SET utf8mb4) COLLATE utf8mb4_general_ci AS record_id,
COALESCE(
ent.enterprise_name COLLATE utf8mb4_general_ci,
rel.social_credit_code COLLATE utf8mb4_general_ci
) COLLATE utf8mb4_general_ci AS name,
rel.social_credit_code COLLATE utf8mb4_general_ci AS certificate_no,
parent.name COLLATE utf8mb4_general_ci AS related_intermediary_name,
COALESCE(
NULLIF(rel.relation_person_post COLLATE utf8mb4_general_ci, ''),
CAST('实体' AS CHAR CHARACTER SET utf8mb4) COLLATE utf8mb4_general_ci
) COLLATE utf8mb4_general_ci AS relation_text,
parent.person_id COLLATE utf8mb4_general_ci AS related_intermediary_certificate_no,
rel.create_time
FROM ccdi_intermediary_enterprise_relation rel
INNER JOIN ccdi_biz_intermediary parent
ON rel.intermediary_biz_id COLLATE utf8mb4_general_ci = parent.biz_id COLLATE utf8mb4_general_ci
AND parent.person_sub_type COLLATE utf8mb4_general_ci = '本人' COLLATE utf8mb4_general_ci
LEFT JOIN ccdi_enterprise_base_info ent
ON rel.social_credit_code COLLATE utf8mb4_general_ci = ent.social_credit_code COLLATE utf8mb4_general_ci
) AS combined_result ) AS combined_result
<where> <where>
<!-- 按中介类型筛选 --> <if test="query.recordType != null and query.recordType != ''">
<if test="query.intermediaryType != null and query.intermediaryType != ''"> AND record_type COLLATE utf8mb4_general_ci =
AND intermediary_type = #{query.intermediaryType} CONVERT(#{query.recordType} USING utf8mb4) COLLATE utf8mb4_general_ci
</if> </if>
<!-- 按姓名/机构名称模糊查询 -->
<if test="query.name != null and query.name != ''"> <if test="query.name != null and query.name != ''">
AND name LIKE CONCAT('%', #{query.name}, '%') AND name COLLATE utf8mb4_general_ci LIKE
CONCAT('%', CONVERT(#{query.name} USING utf8mb4), '%') COLLATE utf8mb4_general_ci
</if> </if>
<!-- 按证件号/统一社会信用代码精确查询 -->
<if test="query.certificateNo != null and query.certificateNo != ''"> <if test="query.certificateNo != null and query.certificateNo != ''">
AND certificate_no = #{query.certificateNo} AND certificate_no COLLATE utf8mb4_general_ci =
CONVERT(#{query.certificateNo} USING utf8mb4) COLLATE utf8mb4_general_ci
</if>
<if test="query.relatedIntermediaryKeyword != null and query.relatedIntermediaryKeyword != ''">
AND (
related_intermediary_name COLLATE utf8mb4_general_ci LIKE
CONCAT('%', CONVERT(#{query.relatedIntermediaryKeyword} USING utf8mb4), '%') COLLATE utf8mb4_general_ci
OR related_intermediary_certificate_no COLLATE utf8mb4_general_ci LIKE
CONCAT('%', CONVERT(#{query.relatedIntermediaryKeyword} USING utf8mb4), '%') COLLATE utf8mb4_general_ci
)
</if> </if>
</where> </where>
ORDER BY update_time DESC ORDER BY create_time DESC
</select> </select>
</mapper> </mapper>

View File

@@ -39,6 +39,7 @@ public class CcdiBankTagServiceImpl implements ICcdiBankTagService {
private static final String STATUS_RUNNING = "RUNNING"; private static final String STATUS_RUNNING = "RUNNING";
private static final String STATUS_SUCCESS = "SUCCESS"; private static final String STATUS_SUCCESS = "SUCCESS";
private static final String STATUS_FAILED = "FAILED"; private static final String STATUS_FAILED = "FAILED";
private static final String TASK_ERROR_MESSAGE_FALLBACK = "任务失败,详细异常请查看后端日志";
private static final String RESULT_TYPE_STATEMENT = "STATEMENT"; private static final String RESULT_TYPE_STATEMENT = "STATEMENT";
private static final String OBJECT_TYPE_STAFF_ID_CARD = "STAFF_ID_CARD"; private static final String OBJECT_TYPE_STAFF_ID_CARD = "STAFF_ID_CARD";
@@ -147,12 +148,11 @@ public class CcdiBankTagServiceImpl implements ICcdiBankTagService {
return task.getId(); return task.getId();
} catch (Exception ex) { } catch (Exception ex) {
task.setStatus(STATUS_FAILED); task.setStatus(STATUS_FAILED);
task.setErrorMessage(ex.getMessage());
task.setEndTime(new Date()); task.setEndTime(new Date());
task.setNeedRerun(null); task.setNeedRerun(null);
task.setUpdateBy(operator); task.setUpdateBy(operator);
task.setUpdateTime(new Date()); task.setUpdateTime(new Date());
taskMapper.updateTask(task); updateFailedTaskSafely(task, ex);
projectService.updateProjectStatus(projectId, CcdiProjectStatusConstants.PROCESSING, operator); projectService.updateProjectStatus(projectId, CcdiProjectStatusConstants.PROCESSING, operator);
log.error("【流水标签】任务执行失败: taskId={}, projectId={}, modelCode={}, triggerType={}, error={}", log.error("【流水标签】任务执行失败: taskId={}, projectId={}, modelCode={}, triggerType={}, error={}",
task.getId(), projectId, modelCode, triggerType, ex.getMessage(), ex); task.getId(), projectId, modelCode, triggerType, ex.getMessage(), ex);
@@ -359,4 +359,44 @@ public class CcdiBankTagServiceImpl implements ICcdiBankTagService {
} }
return Integer.parseInt(value); return Integer.parseInt(value);
} }
private void updateFailedTaskSafely(CcdiBankTagTask task, Exception ex) {
task.setErrorMessage(buildSafeTaskErrorMessage(ex));
try {
taskMapper.updateTask(task);
} catch (Exception updateEx) {
log.error("【流水标签】写入任务失败状态异常: taskId={}, error={}",
task.getId(), updateEx.getMessage(), updateEx);
task.setErrorMessage(TASK_ERROR_MESSAGE_FALLBACK);
taskMapper.updateTask(task);
}
}
private static String buildSafeTaskErrorMessage(Throwable throwable) {
if (throwable == null) {
return TASK_ERROR_MESSAGE_FALLBACK;
}
StringBuilder builder = new StringBuilder();
if (throwable.getMessage() != null && !throwable.getMessage().isBlank()) {
builder.append(throwable.getMessage().trim());
}
Throwable rootCause = throwable;
while (rootCause.getCause() != null && rootCause.getCause() != rootCause) {
rootCause = rootCause.getCause();
}
if (rootCause != throwable && rootCause.getMessage() != null && !rootCause.getMessage().isBlank()) {
String rootMessage = rootCause.getMessage().trim();
if (!builder.toString().contains(rootMessage)) {
if (!builder.isEmpty()) {
builder.append(" | rootCause=");
}
builder.append(rootMessage);
}
}
return builder.isEmpty() ? TASK_ERROR_MESSAGE_FALLBACK : builder.toString();
}
} }

View File

@@ -924,7 +924,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
from ccdi_purchase_transaction pt from ccdi_purchase_transaction pt
inner join ( inner join (
<include refid="projectScopedDirectStaffSql"/> <include refid="projectScopedDirectStaffSql"/>
) project_staff on project_staff.staffId = pt.applicant_id ) project_staff on project_staff.staffId COLLATE utf8mb4_general_ci = pt.applicant_id COLLATE utf8mb4_general_ci
where IFNULL(pt.actual_amount, 0) > 100000 where IFNULL(pt.actual_amount, 0) > 100000
union union
select distinct select distinct
@@ -935,7 +935,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
from ccdi_purchase_transaction pt from ccdi_purchase_transaction pt
inner join ( inner join (
<include refid="projectScopedDirectStaffSql"/> <include refid="projectScopedDirectStaffSql"/>
) project_staff on project_staff.staffId = pt.purchase_leader_id ) project_staff on project_staff.staffId COLLATE utf8mb4_general_ci = pt.purchase_leader_id COLLATE utf8mb4_general_ci
where pt.purchase_leader_id is not null where pt.purchase_leader_id is not null
and IFNULL(pt.actual_amount, 0) > 100000 and IFNULL(pt.actual_amount, 0) > 100000
) t ) t
@@ -975,7 +975,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
from ccdi_purchase_transaction pt from ccdi_purchase_transaction pt
inner join ( inner join (
<include refid="projectScopedDirectStaffSql"/> <include refid="projectScopedDirectStaffSql"/>
) project_staff on project_staff.staffId = pt.applicant_id ) project_staff on project_staff.staffId COLLATE utf8mb4_general_ci = pt.applicant_id COLLATE utf8mb4_general_ci
where IFNULL(pt.actual_amount, 0) > 0 where IFNULL(pt.actual_amount, 0) > 0
and IFNULL(pt.supplier_name, '') &lt;&gt; '' and IFNULL(pt.supplier_name, '') &lt;&gt; ''
@@ -989,7 +989,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
from ccdi_purchase_transaction pt from ccdi_purchase_transaction pt
inner join ( inner join (
<include refid="projectScopedDirectStaffSql"/> <include refid="projectScopedDirectStaffSql"/>
) project_staff on project_staff.staffId = pt.purchase_leader_id ) project_staff on project_staff.staffId COLLATE utf8mb4_general_ci = pt.purchase_leader_id COLLATE utf8mb4_general_ci
where pt.purchase_leader_id is not null where pt.purchase_leader_id is not null
and IFNULL(pt.actual_amount, 0) > 0 and IFNULL(pt.actual_amount, 0) > 0
and IFNULL(pt.supplier_name, '') &lt;&gt; '' and IFNULL(pt.supplier_name, '') &lt;&gt; ''
@@ -1006,7 +1006,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
from ccdi_purchase_transaction pt from ccdi_purchase_transaction pt
inner join ( inner join (
<include refid="projectScopedDirectStaffSql"/> <include refid="projectScopedDirectStaffSql"/>
) project_staff on project_staff.staffId = pt.applicant_id ) project_staff on project_staff.staffId COLLATE utf8mb4_general_ci = pt.applicant_id COLLATE utf8mb4_general_ci
where IFNULL(pt.actual_amount, 0) > 0 where IFNULL(pt.actual_amount, 0) > 0
union union
@@ -1018,7 +1018,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
from ccdi_purchase_transaction pt from ccdi_purchase_transaction pt
inner join ( inner join (
<include refid="projectScopedDirectStaffSql"/> <include refid="projectScopedDirectStaffSql"/>
) project_staff on project_staff.staffId = pt.purchase_leader_id ) project_staff on project_staff.staffId COLLATE utf8mb4_general_ci = pt.purchase_leader_id COLLATE utf8mb4_general_ci
where pt.purchase_leader_id is not null where pt.purchase_leader_id is not null
and IFNULL(pt.actual_amount, 0) > 0 and IFNULL(pt.actual_amount, 0) > 0
) source_total ) source_total

View File

@@ -148,6 +148,34 @@ class CcdiBankTagAnalysisMapperXmlTest {
); );
} }
@Test
void largePurchaseTransactionRule_shouldAlignCollationForJoinFields() throws Exception {
String xml = readXml(RESOURCE);
String purchaseSelectSql = extractSelectSql(xml, "selectLargePurchaseTransactionStatements");
String supplierSelectSql = extractSelectSql(xml, "selectSupplierConcentrationObjects");
assertTrue(
purchaseSelectSql.contains("project_staff.staffId COLLATE utf8mb4_general_ci = pt.applicant_id COLLATE utf8mb4_general_ci")
);
assertTrue(
purchaseSelectSql.contains("project_staff.staffId COLLATE utf8mb4_general_ci = pt.purchase_leader_id COLLATE utf8mb4_general_ci")
);
assertTrue(
supplierSelectSql.contains("project_staff.staffId COLLATE utf8mb4_general_ci = pt.applicant_id COLLATE utf8mb4_general_ci")
);
assertTrue(
supplierSelectSql.contains("project_staff.staffId COLLATE utf8mb4_general_ci = pt.purchase_leader_id COLLATE utf8mb4_general_ci")
);
assertTrue(
!xml.contains("project_staff.staffId = pt.applicant_id"),
"采购交易相关 join 不应再使用未声明 COLLATE 的 applicant_id 比较"
);
assertTrue(
!xml.contains("project_staff.staffId = pt.purchase_leader_id"),
"采购交易相关 join 不应再使用未声明 COLLATE 的 purchase_leader_id 比较"
);
}
@Test @Test
void assetRegistrationMismatchRules_shouldUseRealSqlAndAssetTable() throws Exception { void assetRegistrationMismatchRules_shouldUseRealSqlAndAssetTable() throws Exception {
String xml = readXml(RESOURCE); String xml = readXml(RESOURCE);

View File

@@ -28,9 +28,11 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.concurrent.Executor; import java.util.concurrent.Executor;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.lang.reflect.Method;
import java.nio.file.Files; import java.nio.file.Files;
import java.nio.file.Path; import java.nio.file.Path;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.any;
@@ -494,6 +496,23 @@ class CcdiBankTagServiceImplTest {
))); )));
} }
@Test
void buildSafeTaskErrorMessage_shouldKeepLongMessageForLongTextColumn() throws Exception {
Method method = CcdiBankTagServiceImpl.class.getDeclaredMethod(
"buildSafeTaskErrorMessage", Throwable.class
);
method.setAccessible(true);
String longMessage = "X".repeat(5000);
RuntimeException throwable = new RuntimeException("root-cause:" + longMessage);
String result = (String) method.invoke(null, throwable);
assertNotNull(result);
assertTrue(result.length() > 2000, "LONGTEXT 方案下不应继续把错误信息截断到 2000");
assertTrue(result.contains("root-cause"), "错误信息应保留根因关键字");
}
@Test @Test
void abnormalAccountMapperXml_shouldDeclareObjectSelects() throws Exception { void abnormalAccountMapperXml_shouldDeclareObjectSelects() throws Exception {
String xml = Files.readString(Path.of("src/main/resources/mapper/ccdi/project/CcdiBankTagAnalysisMapper.xml")); String xml = Files.readString(Path.of("src/main/resources/mapper/ccdi/project/CcdiBankTagAnalysisMapper.xml"));

View File

@@ -115,7 +115,7 @@ CREATE TABLE IF NOT EXISTS `ccdi_intermediary_enterprise_relation` (
UNIQUE KEY `uk_intermediary_enterprise` (`intermediary_biz_id`, `social_credit_code`), UNIQUE KEY `uk_intermediary_enterprise` (`intermediary_biz_id`, `social_credit_code`),
KEY `idx_intermediary_biz_id` (`intermediary_biz_id`), KEY `idx_intermediary_biz_id` (`intermediary_biz_id`),
KEY `idx_social_credit_code` (`social_credit_code`) KEY `idx_social_credit_code` (`social_credit_code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='中介关联机构关系表'; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='中介关联机构关系表';
``` ```
- [ ] **Step 3: 编写 `person_sub_type` 固定值脚本** - [ ] **Step 3: 编写 `person_sub_type` 固定值脚本**
@@ -529,6 +529,20 @@ mvn -pl ccdi-info-collection -am -DskipTests compile
bin/mysql_utf8_exec.sh sql/migration/2026-04-17-create-intermediary-enterprise-relation.sql bin/mysql_utf8_exec.sh sql/migration/2026-04-17-create-intermediary-enterprise-relation.sql
``` ```
## 执行结果
- 实际测试命令:`mvn -pl ccdi-info-collection -am -Dsurefire.failIfNoSpecifiedTests=false -Dtest=CcdiIntermediaryServiceImplTest,CcdiIntermediaryMapperTest,CcdiIntermediaryControllerTest test`
- 测试结果:`BUILD SUCCESS`,共执行 8 个测试,`Failures: 0, Errors: 0, Skipped: 0`
- 实际编译命令:`mvn -pl ccdi-info-collection -am -DskipTests compile`
- 编译结果:`BUILD SUCCESS`
- 实际数据库变更命令:`bin/mysql_utf8_exec.sh sql/migration/2026-04-17-create-intermediary-enterprise-relation.sql`
- 数据库变更结果:`ccdi_intermediary_enterprise_relation` 已创建成功
- 实际全库排序规则修复命令:`bin/mysql_utf8_exec.sh sql/migration/2026-04-17-unify-all-table-collation-to-utf8mb4-general-ci.sql`
- 排序规则修复结果:业务表、系统表的表级与字符字段级排序规则已统一为 `utf8mb4_general_ci`
- 实际运行验证:
- 重新打包命令:`mvn -pl ruoyi-admin -am -DskipTests package`
- 接口验证:`POST /login/test` 获取 token 后,`GET /ccdi/intermediary/list?pageNum=1&pageSize=10` 返回 `code=200`,联合查询不再出现 `Illegal mix of collations`
## 完成标准 ## 完成标准
- `ccdi_intermediary_enterprise_relation` 表与唯一约束创建完成 - `ccdi_intermediary_enterprise_relation` 表与唯一约束创建完成

View File

@@ -0,0 +1,65 @@
# Docker 环境项目打标卡住后端实施记录
## 背景
- 现象Docker 部署后的后端中,项目打标任务会长时间停留在“打标中”。
- 样本项目:`90337`
- 排查目标:确认任务卡住的真实根因,并按最短路径修复。
## 已定位问题
### 1. 打标规则 SQL 在 MySQL 8 / Docker 环境触发排序规则冲突
- 规则:`LARGE_PURCHASE_TRANSACTION`
- 异常:`Illegal mix of collations (utf8mb4_0900_ai_ci) and (utf8mb4_general_ci)`
- 影响:任务在规则执行阶段直接失败。
### 2. 失败落库时错误信息过长,导致任务状态无法更新
- 表:`ccdi_bank_tag_task`
- 字段:`error_message`
- 异常:`Data too long for column 'error_message'`
- 影响:
- 任务本应更新为 `FAILED`,但更新再次失败
- 项目状态没有从 `打标中` 回退
- 前端看到的就是“打标一直卡住”
## 本次改动范围
- `ccdi-project/src/main/resources/mapper/ccdi/project/CcdiBankTagAnalysisMapper.xml`
-`LARGE_PURCHASE_TRANSACTION` 相关 join 显式补齐统一排序规则。
- `sql/migration/2026-04-20-fix-bank-tag-task-error-message-longtext.sql`
-`ccdi_bank_tag_task` 表统一到 `utf8mb4_general_ci`,并把 `error_message` 调整为 `LONGTEXT`
- `ccdi-project/src/main/java/com/ruoyi/ccdi/project/service/impl/CcdiBankTagServiceImpl.java`
- 调整任务失败错误信息拼装逻辑,保留完整根因,不再按 2000 截断。
- `ccdi-project/src/test/java/com/ruoyi/ccdi/project/service/impl/CcdiBankTagServiceImplTest.java`
- 新增错误信息裁剪测试。
- `ccdi-project/src/test/java/com/ruoyi/ccdi/project/mapper/CcdiBankTagAnalysisMapperXmlTest.java`
- 新增 SQL 排序规则约束测试。
## 验证
- 运行新增测试,先确认失败,再完成修复后确认通过。
- 修复后检查项目 `90337` 的任务状态是否能正确进入失败态或完成态,不再停留在 `RUNNING`
## 实际执行结果
- 已执行数据库脚本:
- `sql/migration/2026-04-20-fix-bank-tag-task-error-message-longtext.sql`
- 已重新打包并重启 Docker 后端容器。
- 已手工复位历史卡死任务:
- `ccdi_bank_tag_task.id = 76`
- 已重新触发项目 `90337` 打标。
- 最新验证结果:
- `ccdi_bank_tag_task.id = 79`
- `status = SUCCESS`
- `success_rule_count = 35`
- `hit_count = 132`
- 项目 `90337` 状态已回到 `1 = 已完成`
## 结论
- “打标卡住”并非任务一直运行,而是:
1. 采购相关规则 SQL 因排序规则冲突失败
2. 失败异常写入 `ccdi_bank_tag_task.error_message` 时又因字段长度不足再次失败
- 本次已按数据库方案改为 `LONGTEXT`,并将采购链路所有相关 join 显式统一为 `utf8mb4_general_ci`

View File

@@ -459,6 +459,15 @@ source ~/.nvm/nvm.sh && nvm use 14.21.3
npm run build:prod 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`
- Node 版本:`v14.21.3`
- 构建结果:`DONE Build complete. The dist directory is ready to be deployed.`
- 备注仅存在既有包体积告警asset size / entrypoint size limit无语法错误和模块解析错误
- 补充修复:中介库首页“查看中介亲属”弹窗已改为只读模式,查看态不再允许编辑或提交
- 补充修复:中介库首页“查看关联机构”弹窗已改为只读模式,查看态不再允许编辑或提交
## 完成标准 ## 完成标准
- 首页搜索字段调整为名称、证件号、记录类型、关联中介信息 - 首页搜索字段调整为名称、证件号、记录类型、关联中介信息

View File

@@ -43,15 +43,6 @@ export function addEntityIntermediary(data) {
}) })
} }
// 修改中介黑名单
export function updateIntermediary(data) {
return request({
url: '/ccdi/intermediary',
method: 'put',
data: data
})
}
// 修改个人中介黑名单 // 修改个人中介黑名单
export function updatePersonIntermediary(data) { export function updatePersonIntermediary(data) {
return request({ return request({
@@ -78,6 +69,90 @@ export function delIntermediary(intermediaryIds) {
}) })
} }
// 查询中介亲属列表
export function listIntermediaryRelatives(bizId) {
return request({
url: '/ccdi/intermediary/' + bizId + '/relatives',
method: 'get'
})
}
// 查询中介亲属详情
export function getIntermediaryRelative(relativeBizId) {
return request({
url: '/ccdi/intermediary/relative/' + relativeBizId,
method: 'get'
})
}
// 新增中介亲属
export function addIntermediaryRelative(bizId, data) {
return request({
url: '/ccdi/intermediary/' + bizId + '/relative',
method: 'post',
data: data
})
}
// 修改中介亲属
export function updateIntermediaryRelative(data) {
return request({
url: '/ccdi/intermediary/relative',
method: 'put',
data: data
})
}
// 删除中介亲属
export function delIntermediaryRelative(relativeBizId) {
return request({
url: '/ccdi/intermediary/relative/' + relativeBizId,
method: 'delete'
})
}
// 查询中介关联机构列表
export function listIntermediaryEnterpriseRelations(bizId) {
return request({
url: '/ccdi/intermediary/' + bizId + '/enterprise-relations',
method: 'get'
})
}
// 查询中介关联机构详情
export function getIntermediaryEnterpriseRelation(id) {
return request({
url: '/ccdi/intermediary/enterprise-relation/' + id,
method: 'get'
})
}
// 新增中介关联机构
export function addIntermediaryEnterpriseRelation(bizId, data) {
return request({
url: '/ccdi/intermediary/' + bizId + '/enterprise-relation',
method: 'post',
data: data
})
}
// 修改中介关联机构
export function updateIntermediaryEnterpriseRelation(data) {
return request({
url: '/ccdi/intermediary/enterprise-relation',
method: 'put',
data: data
})
}
// 删除中介关联机构
export function delIntermediaryEnterpriseRelation(id) {
return request({
url: '/ccdi/intermediary/enterprise-relation/' + id,
method: 'delete'
})
}
// 下载导入模板(已废弃,保留以兼容旧代码) // 下载导入模板(已废弃,保留以兼容旧代码)
export function importTemplate() { export function importTemplate() {
return request({ return request({

View File

@@ -2,34 +2,29 @@
<div> <div>
<el-table v-loading="loading" :data="dataList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="dataList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="姓名/机构名称" align="center" prop="name" :show-overflow-tooltip="true"/> <el-table-column label="名称" align="center" prop="name" :show-overflow-tooltip="true" />
<el-table-column label="证件号" align="center" prop="certificateNo" :show-overflow-tooltip="true"/> <el-table-column label="证件号" align="center" prop="certificateNo" :show-overflow-tooltip="true" />
<el-table-column label="中介类型" align="center" prop="intermediaryType" width="100"> <el-table-column label="关联中介姓名" align="center" prop="relatedIntermediaryName" :show-overflow-tooltip="true" />
<template slot-scope="scope"> <el-table-column label="关联关系" align="center" prop="relationText" :show-overflow-tooltip="true" />
<span v-if="scope.row.intermediaryType === '1'">个人</span>
<span v-else-if="scope.row.intermediaryType === '2'">实体</span>
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" width="180"> <el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span> <span>{{ parseTime(scope.row.createTime) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="240"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="260">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button size="mini" type="text" icon="el-icon-view" @click="$emit('detail', scope.row)">
size="mini" {{ scope.row.recordType === 'INTERMEDIARY' ? '详情' : '查看' }}
type="text" </el-button>
icon="el-icon-view"
@click="$emit('detail', scope.row)"
>详情</el-button>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-edit" icon="el-icon-edit"
@click="$emit('update', scope.row)" @click="$emit('update', scope.row)"
v-hasPermi="['ccdi:intermediary:edit']" v-hasPermi="['ccdi:intermediary:edit']"
>修改</el-button> >
{{ scope.row.recordType === 'INTERMEDIARY' ? '修改' : '编辑' }}
</el-button>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
@@ -42,7 +37,7 @@
</el-table> </el-table>
<pagination <pagination
v-show="total>0" v-show="total > 0"
:total="total" :total="total"
:page.sync="pageParams.pageNum" :page.sync="pageParams.pageNum"
:limit.sync="pageParams.pageSize" :limit.sync="pageParams.pageSize"

View File

@@ -1,70 +1,59 @@
<template> <template>
<el-dialog title="中介黑名单详情" :visible.sync="visible" width="800px" append-to-body> <el-dialog title="中介详情维护" :visible.sync="dialogVisible" width="1100px" append-to-body>
<div class="section-header">
<span>中介基本信息</span>
<el-button size="mini" type="primary" plain icon="el-icon-edit" @click="$emit('edit-person')">编辑中介信息</el-button>
</div>
<el-descriptions :column="2" border> <el-descriptions :column="2" border>
<!-- 核心字段 --> <el-descriptions-item label="姓名">{{ detailData.name || '-' }}</el-descriptions-item>
<el-descriptions-item label="中介类型"> <el-descriptions-item label="证件号">{{ detailData.personId || '-' }}</el-descriptions-item>
<span v-if="detailData.intermediaryType === '1'">个人</span> <el-descriptions-item label="人员类型">{{ detailData.personType || '-' }}</el-descriptions-item>
<span v-else-if="detailData.intermediaryType === '2'">实体</span> <el-descriptions-item label="性别">{{ formatGender(detailData.gender) }}</el-descriptions-item>
<span v-else>-</span> <el-descriptions-item label="证件类型">{{ detailData.idType || '-' }}</el-descriptions-item>
</el-descriptions-item> <el-descriptions-item label="职位">{{ detailData.position || '-' }}</el-descriptions-item>
<el-descriptions-item label="姓名/机构名称">{{ detailData.name || detailData.enterpriseName || '-' }}</el-descriptions-item> <el-descriptions-item label="手机号码">{{ detailData.mobile || '-' }}</el-descriptions-item>
<el-descriptions-item label="证件号/信用代码"> <el-descriptions-item label="微信号">{{ detailData.wechatNo || '-' }}</el-descriptions-item>
<span v-if="detailData.intermediaryType === '1'">{{ detailData.personId || '-' }}</span> <el-descriptions-item label="所在公司">{{ detailData.company || '-' }}</el-descriptions-item>
<span v-else>{{ detailData.socialCreditCode || '-' }}</span> <el-descriptions-item label="企业统一信用码">{{ detailData.socialCreditCode || '-' }}</el-descriptions-item>
</el-descriptions-item> <el-descriptions-item label="联系地址" :span="2">{{ detailData.contactAddress || '-' }}</el-descriptions-item>
<!-- 个人类型专属字段 -->
<template v-if="detailData.intermediaryType === '1'">
<el-descriptions-item label="人员类型">{{ detailData.personType || '-' }}</el-descriptions-item>
<el-descriptions-item label="中介子类型">{{ detailData.personSubType || detailData.relationType || '-' }}</el-descriptions-item>
<el-descriptions-item label="性别">
<span v-if="detailData.gender === 'M'"></span>
<span v-else-if="detailData.gender === 'F'"></span>
<span v-else-if="detailData.gender === 'O'">其他</span>
<span v-else>{{ detailData.gender || '-' }}</span>
</el-descriptions-item>
<el-descriptions-item label="证件类型">{{ detailData.idType || '-' }}</el-descriptions-item>
<el-descriptions-item label="手机号码">{{ detailData.mobile || '-' }}</el-descriptions-item>
<el-descriptions-item label="微信号">{{ detailData.wechatNo || '-' }}</el-descriptions-item>
<el-descriptions-item label="联系地址" :span="2">{{ detailData.contactAddress || '-' }}</el-descriptions-item>
<el-descriptions-item label="所在公司">{{ detailData.company || '-' }}</el-descriptions-item>
<el-descriptions-item label="职位">{{ detailData.position || '-' }}</el-descriptions-item>
<el-descriptions-item label="企业统一信用码">{{ detailData.socialCreditCode || '-' }}</el-descriptions-item>
<el-descriptions-item label="关联人员ID">{{ detailData.relatedNumId || '-' }}</el-descriptions-item>
</template>
<!-- 机构类型专属字段 -->
<template v-if="detailData.intermediaryType === '2'">
<el-descriptions-item label="统一社会信用代码" :span="2">{{ detailData.socialCreditCode || '-' }}</el-descriptions-item>
<el-descriptions-item label="主体类型">{{ detailData.enterpriseType || '-' }}</el-descriptions-item>
<el-descriptions-item label="企业性质">{{ detailData.enterpriseNature || '-' }}</el-descriptions-item>
<el-descriptions-item label="行业分类">{{ detailData.industryClass || '-' }}</el-descriptions-item>
<el-descriptions-item label="所属行业">{{ detailData.industryName || '-' }}</el-descriptions-item>
<el-descriptions-item label="成立日期">{{ detailData.establishDate || '-' }}</el-descriptions-item>
<el-descriptions-item label="注册地址" :span="2">{{ detailData.registerAddress || '-' }}</el-descriptions-item>
<el-descriptions-item label="法定代表人">{{ detailData.legalRepresentative || '-' }}</el-descriptions-item>
<el-descriptions-item label="法定代表人证件类型">{{ detailData.legalCertType || '-' }}</el-descriptions-item>
<el-descriptions-item label="法定代表人证件号码" :span="2">{{ detailData.legalCertNo || '-' }}</el-descriptions-item>
<el-descriptions-item label="股东1">{{ detailData.shareholder1 || '-' }}</el-descriptions-item>
<el-descriptions-item label="股东2">{{ detailData.shareholder2 || '-' }}</el-descriptions-item>
<el-descriptions-item label="股东3">{{ detailData.shareholder3 || '-' }}</el-descriptions-item>
<el-descriptions-item label="股东4">{{ detailData.shareholder4 || '-' }}</el-descriptions-item>
<el-descriptions-item label="股东5">{{ detailData.shareholder5 || '-' }}</el-descriptions-item>
</template>
<!-- 通用字段 -->
<el-descriptions-item label="数据来源">
<span v-if="detailData.dataSource === 'MANUAL'">手动录入</span>
<span v-else-if="detailData.dataSource === 'SYSTEM'">系统同步</span>
<span v-else-if="detailData.dataSource === 'IMPORT'">批量导入</span>
<span v-else-if="detailData.dataSource === 'API'">接口获取</span>
<span v-else>{{ detailData.dataSource || '-' }}</span>
</el-descriptions-item>
<el-descriptions-item label="备注" :span="2">{{ detailData.remark || '-' }}</el-descriptions-item> <el-descriptions-item label="备注" :span="2">{{ detailData.remark || '-' }}</el-descriptions-item>
<el-descriptions-item label="创建时间">{{ detailData.createTime || '-' }}</el-descriptions-item>
</el-descriptions> </el-descriptions>
<div class="section-header">
<span>亲属信息</span>
<el-button size="mini" type="primary" plain icon="el-icon-plus" @click="$emit('add-relative')">新增亲属</el-button>
</div>
<el-table :data="relativeList" border>
<el-table-column label="姓名" prop="name" />
<el-table-column label="证件号" prop="personId" />
<el-table-column label="关联关系" prop="personSubType" />
<el-table-column label="手机号码" prop="mobile" />
<el-table-column label="操作" width="180" align="center">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="$emit('edit-relative', { ...scope.row, recordType: 'RELATIVE' })">编辑</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="$emit('delete-relative', { ...scope.row, recordType: 'RELATIVE' })">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="section-header">
<span>关联机构信息</span>
<el-button size="mini" type="primary" plain icon="el-icon-plus" @click="$emit('add-enterprise-relation')">新增关联机构</el-button>
</div>
<el-table :data="enterpriseRelationList" border>
<el-table-column label="机构名称" prop="enterpriseName" />
<el-table-column label="统一社会信用代码" prop="socialCreditCode" />
<el-table-column label="关联职务" prop="relationPersonPost" />
<el-table-column label="操作" width="180" align="center">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="$emit('edit-enterprise-relation', { ...scope.row, recordType: 'ENTERPRISE_RELATION' })">编辑</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="$emit('delete-enterprise-relation', { ...scope.row, recordType: 'ENTERPRISE_RELATION' })">删除</el-button>
</template>
</el-table-column>
</el-table>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click="visible = false"> </el-button> <el-button @click="dialogVisible = false"> </el-button>
</div> </div>
</el-dialog> </el-dialog>
</template> </template>
@@ -80,12 +69,49 @@ export default {
detailData: { detailData: {
type: Object, type: Object,
default: () => ({}) default: () => ({})
},
relativeList: {
type: Array,
default: () => []
},
enterpriseRelationList: {
type: Array,
default: () => []
} }
}, },
data() {
return {
dialogVisible: false
};
},
watch: { watch: {
visible(val) { visible: {
immediate: true,
handler(val) {
this.dialogVisible = val;
}
},
dialogVisible(val) {
this.$emit("update:visible", val); this.$emit("update:visible", val);
} }
},
methods: {
formatGender(gender) {
if (gender === "M") return "男";
if (gender === "F") return "女";
if (gender === "O") return "其他";
return gender || "-";
}
} }
}; };
</script> </script>
<style scoped>
.section-header {
display: flex;
justify-content: space-between;
align-items: center;
margin: 18px 0 12px;
font-weight: 600;
}
</style>

View File

@@ -1,314 +1,104 @@
<template> <template>
<el-dialog :title="title" :visible.sync="visible" width="900px" append-to-body @close="handleClose"> <el-dialog :title="title" :visible.sync="dialogVisible" width="820px" append-to-body @close="handleClose">
<!-- 新增模式显示类型选择卡片 --> <el-form ref="formRef" :model="localForm" :rules="rules" label-width="120px">
<div v-if="isAddMode && !selectedType" class="type-selector"> <el-row>
<div class="type-cards"> <el-col :span="12">
<div <el-form-item label="姓名" prop="name">
class="type-card" <el-input v-model="localForm.name" placeholder="请输入姓名" maxlength="100" clearable />
:class="{ 'selected': tempSelectedType === '1' }" </el-form-item>
@click="handleTypeSelect('1')" </el-col>
> <el-col :span="12">
<i class="el-icon-user type-card-icon"></i> <el-form-item label="证件号" prop="personId">
<div class="type-card-title">个人</div> <el-input v-model="localForm.personId" placeholder="请输入证件号码" maxlength="50" clearable />
<div class="type-card-desc">添加个人中介信息</div> </el-form-item>
</div> </el-col>
<div </el-row>
class="type-card" <el-row>
:class="{ 'selected': tempSelectedType === '2' }" <el-col :span="12">
@click="handleTypeSelect('2')" <el-form-item label="人员类型">
> <el-select v-model="localForm.personType" placeholder="请选择人员类型" clearable style="width: 100%">
<i class="el-icon-office-building type-card-icon"></i> <el-option
<div class="type-card-title">机构</div> v-for="item in indivTypeOptions"
<div class="type-card-desc">添加机构中介信息</div> :key="item.value"
</div> :label="item.label"
</div> :value="item.value"
</div>
<!-- 表单区域选择类型后或修改模式显示 -->
<div v-show="selectedType || !isAddMode" class="form-container" :class="{ 'fade-in': shouldAnimate }">
<el-divider v-if="isAddMode" content-position="left">{{ getTypeDividerText }}</el-divider>
<!-- 个人类型表单 -->
<el-form
v-if="form.intermediaryType === '1'"
ref="indivForm"
:model="form"
:rules="indivRules"
label-width="120px"
>
<el-row>
<el-col :span="12">
<el-form-item label="姓名" prop="name">
<el-input v-model="form.name" placeholder="请输入姓名" maxlength="100" clearable/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="证件号" prop="personId">
<el-input v-model="form.personId" placeholder="请输入证件号码" maxlength="50" clearable/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="人员类型">
<el-select v-model="form.personType" placeholder="请选择人员类型" clearable style="width: 100%">
<el-option
v-for="item in indivTypeOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="中介子类型">
<el-select
v-model="form.personSubType"
placeholder="请选择中介子类型"
clearable
style="width: 100%"
@change="handlePersonSubTypeChange"
>
<el-option
v-for="item in personSubTypeOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="性别">
<el-select v-model="form.gender" placeholder="请选择性别" clearable style="width: 100%">
<el-option
v-for="item in genderOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="证件类型">
<el-select v-model="form.idType" placeholder="请选择证件类型" clearable style="width: 100%">
<el-option
v-for="item in certTypeOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="手机号码">
<el-input v-model="form.mobile" placeholder="请输入手机号码" maxlength="20" clearable/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="微信号">
<el-input v-model="form.wechatNo" placeholder="请输入微信号" maxlength="50" clearable/>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="联系地址">
<el-input v-model="form.contactAddress" placeholder="请输入联系地址" maxlength="200" clearable/>
</el-form-item>
<el-row>
<el-col :span="12">
<el-form-item label="所在公司">
<el-input v-model="form.company" placeholder="请输入所在公司" maxlength="200" clearable/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="职位">
<el-input v-model="form.position" placeholder="请输入职位" maxlength="100" clearable/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="企业统一信用码">
<el-input v-model="form.socialCreditCode" placeholder="请输入企业统一信用码" maxlength="50" clearable/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="关联人员ID">
<el-input v-model="form.relatedNumId" placeholder="请输入关联人员ID" maxlength="50" clearable/>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="备注" prop="remark">
<el-input
v-model="form.remark"
type="textarea"
placeholder="请输入备注"
maxlength="500"
:rows="3"
show-word-limit
/>
</el-form-item>
</el-form>
<!-- 机构类型表单 -->
<el-form
v-else-if="form.intermediaryType === '2'"
ref="corpForm"
:model="form"
:rules="corpRules"
label-width="140px"
>
<el-row>
<el-col :span="12">
<el-form-item label="机构名称" prop="enterpriseName">
<el-input v-model="form.enterpriseName" placeholder="请输入机构名称" maxlength="200" clearable/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="证件号" prop="socialCreditCode">
<el-input
v-model="form.socialCreditCode"
placeholder="统一社会信用代码"
maxlength="50"
clearable
/> />
</el-form-item> </el-select>
</el-col> </el-form-item>
</el-row> </el-col>
<el-row> <el-col :span="12">
<el-col :span="12"> <el-form-item label="证件类型">
<el-form-item label="主体类型"> <el-select v-model="localForm.idType" placeholder="请选择证件类型" clearable style="width: 100%">
<el-select v-model="form.enterpriseType" placeholder="请选择主体类型" clearable style="width: 100%"> <el-option
<el-option v-for="item in certTypeOptions"
v-for="item in corpTypeOptions" :key="item.value"
:key="item.value" :label="item.label"
:label="item.label" :value="item.value"
:value="item.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="企业性质">
<el-select v-model="form.enterpriseNature" placeholder="请选择企业性质" clearable style="width: 100%">
<el-option
v-for="item in corpNatureOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="成立日期">
<el-date-picker
v-model="form.establishDate"
type="date"
placeholder="选择成立日期"
value-format="yyyy-MM-dd"
style="width: 100%"
/> />
</el-form-item> </el-select>
</el-col> </el-form-item>
<el-col :span="12"> </el-col>
<el-form-item label="行业分类"> </el-row>
<el-input v-model="form.industryClass" placeholder="请输入行业分类" maxlength="100" clearable/> <el-row>
</el-form-item> <el-col :span="12">
</el-col> <el-form-item label="性别">
</el-row> <el-select v-model="localForm.gender" placeholder="请选择性别" clearable style="width: 100%">
<el-row> <el-option
<el-col :span="12"> v-for="item in genderOptions"
<el-form-item label="所属行业"> :key="item.value"
<el-input v-model="form.industryName" placeholder="请输入所属行业" maxlength="100" clearable/> :label="item.label"
</el-form-item> :value="item.value"
</el-col> />
</el-row> </el-select>
<el-form-item label="注册地址"> </el-form-item>
<el-input v-model="form.registerAddress" type="textarea" placeholder="请输入注册地址" maxlength="500" :rows="2"/> </el-col>
</el-form-item> <el-col :span="12">
<el-row> <el-form-item label="职位">
<el-col :span="12"> <el-input v-model="localForm.position" placeholder="请输入职位" maxlength="100" clearable />
<el-form-item label="法定代表人"> </el-form-item>
<el-input v-model="form.legalRepresentative" placeholder="请输入法定代表人" maxlength="100" clearable/> </el-col>
</el-form-item> </el-row>
</el-col> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="法定代表人证件类型"> <el-form-item label="手机号码">
<el-select v-model="form.legalCertType" placeholder="请选择证件类型" clearable style="width: 100%"> <el-input v-model="localForm.mobile" placeholder="请输入手机号码" maxlength="20" clearable />
<el-option </el-form-item>
v-for="item in certTypeOptions" </el-col>
:key="item.value" <el-col :span="12">
:label="item.label" <el-form-item label="微信号">
:value="item.value" <el-input v-model="localForm.wechatNo" placeholder="请输入微信号" maxlength="50" clearable />
/> </el-form-item>
</el-select> </el-col>
</el-form-item> </el-row>
</el-col> <el-form-item label="联系地址">
</el-row> <el-input v-model="localForm.contactAddress" placeholder="请输入联系地址" maxlength="200" clearable />
<el-form-item label="法定代表人证件号码"> </el-form-item>
<el-input v-model="form.legalCertNo" placeholder="请输入法定代表人证件号码" maxlength="50" clearable/> <el-row>
</el-form-item> <el-col :span="12">
<el-divider content-position="left">股东信息</el-divider> <el-form-item label="所在公司">
<el-row> <el-input v-model="localForm.company" placeholder="请输入所在公司" maxlength="200" clearable />
<el-col :span="12"> </el-form-item>
<el-form-item label="股东1"> </el-col>
<el-input v-model="form.shareholder1" placeholder="请输入股东1" maxlength="100" clearable/> <el-col :span="12">
</el-form-item> <el-form-item label="企业统一信用码">
</el-col> <el-input v-model="localForm.socialCreditCode" placeholder="请输入企业统一信用码" maxlength="50" clearable />
<el-col :span="12"> </el-form-item>
<el-form-item label="股东2"> </el-col>
<el-input v-model="form.shareholder2" placeholder="请输入股东2" maxlength="100" clearable/> </el-row>
</el-form-item> <el-form-item label="备注">
</el-col> <el-input
</el-row> v-model="localForm.remark"
<el-row> type="textarea"
<el-col :span="12"> placeholder="请输入备注"
<el-form-item label="股东3"> maxlength="500"
<el-input v-model="form.shareholder3" placeholder="请输入股东3" maxlength="100" clearable/> :rows="3"
</el-form-item> show-word-limit
</el-col> />
<el-col :span="12"> </el-form-item>
<el-form-item label="股东4"> </el-form>
<el-input v-model="form.shareholder4" placeholder="请输入股东4" maxlength="100" clearable/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="股东5">
<el-input v-model="form.shareholder5" placeholder="请输入股东5" maxlength="100" clearable/>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="备注" prop="remark">
<el-input
v-model="form.remark"
type="textarea"
placeholder="请输入备注"
maxlength="500"
:rows="3"
show-word-limit
/>
</el-form-item>
</el-form>
</div>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button <el-button type="primary" @click="handleSubmit"> </el-button>
type="primary"
:disabled="isAddMode && !selectedType"
@click="handleSubmit"
> </el-button>
<el-button @click="handleClose"> </el-button> <el-button @click="handleClose"> </el-button>
</div> </div>
</el-dialog> </el-dialog>
@@ -341,321 +131,48 @@ export default {
certTypeOptions: { certTypeOptions: {
type: Array, type: Array,
default: () => [] default: () => []
},
relationTypeOptions: {
type: Array,
default: () => []
},
corpTypeOptions: {
type: Array,
default: () => []
},
corpNatureOptions: {
type: Array,
default: () => []
} }
}, },
data() { data() {
return { return {
// 新增模式:是否为新增操作(通过 computed 动态计算) dialogVisible: false,
// isAddMode: true, localForm: {},
// 已选择的类型(确认后的类型) rules: {
selectedType: null, name: [{ required: true, message: "姓名不能为空", trigger: "blur" }],
// 临时选择的类型(用于卡片高亮) personId: [{ required: true, message: "证件号不能为空", trigger: "blur" }]
tempSelectedType: null,
// 是否需要显示淡入动画
shouldAnimate: false,
// 个人类型验证规则
indivRules: {
name: [
{ required: true, message: "姓名不能为空", trigger: "blur" },
{ max: 100, message: "姓名长度不能超过100个字符", trigger: "blur" }
],
personId: [
{ required: true, message: "证件号不能为空", trigger: "blur" },
{ max: 50, message: "证件号长度不能超过50个字符", trigger: "blur" }
],
remark: [
{ max: 500, message: "备注长度不能超过500个字符", trigger: "blur" }
]
},
// 机构类型验证规则
corpRules: {
enterpriseName: [
{ required: true, message: "机构名称不能为空", trigger: "blur" },
{ max: 200, message: "机构名称长度不能超过200个字符", trigger: "blur" }
],
socialCreditCode: [
{ required: true, message: "统一社会信用代码不能为空", trigger: "blur" },
{ max: 50, message: "统一社会信用代码长度不能超过50个字符", trigger: "blur" }
],
remark: [
{ max: 500, message: "备注长度不能超过500个字符", trigger: "blur" }
]
} }
}; };
}, },
computed: {
// 判断是否为新增模式
isAddMode() {
return !this.form || !this.form.bizId;
},
// 根据选择的类型返回分隔线文本
getTypeDividerText() {
if (this.form.intermediaryType === '1') {
return '个人信息';
} else if (this.form.intermediaryType === '2') {
return '机构信息';
}
return '';
},
personSubTypeOptions() {
const options = [{ label: '个人', value: '个人' }, ...this.relationTypeOptions];
const dedupedOptions = [];
const existedValues = new Set();
options.forEach(item => {
if (!item || !item.value || existedValues.has(item.value)) {
return;
}
existedValues.add(item.value);
dedupedOptions.push(item);
});
return dedupedOptions;
}
},
watch: { watch: {
// 监听 visible 变化,重置状态 visible: {
visible(newVal) { immediate: true,
if (newVal) { handler(val) {
// 延迟初始化,确保 form 数据已经传入 this.dialogVisible = val;
this.$nextTick(() => { }
this.initDialogState(); },
}); dialogVisible(val) {
this.$emit("update:visible", val);
},
form: {
immediate: true,
deep: true,
handler(val) {
this.localForm = { ...val };
} }
} }
}, },
methods: { methods: {
/**
* 初始化弹窗状态
*/
initDialogState() {
// 始终基于当前的 form 状态判断
const isAdd = !this.form || !this.form.bizId;
if (isAdd) {
// 新增模式:重置选择状态
this.selectedType = null;
this.tempSelectedType = null;
this.shouldAnimate = false;
// 重置为个人类型(默认)
if (this.form) {
this.form.intermediaryType = '1';
}
} else {
// 修改模式:设置已选择的类型
if (this.form && this.form.intermediaryType) {
this.selectedType = this.form.intermediaryType;
}
this.shouldAnimate = false;
}
this.syncPersonSubTypeRelation();
},
/**
* 处理类型选择
*/
handleTypeSelect(type) {
this.tempSelectedType = type;
this.form.intermediaryType = type;
if (type === '1') {
this.syncPersonSubTypeRelation();
}
// 延迟设置 selectedType使表单显示带动画效果
setTimeout(() => {
this.selectedType = type;
this.shouldAnimate = true;
// 清除表单验证状态,避免立即显示验证错误
this.$nextTick(() => {
const formRef = type === '1' ? 'indivForm' : 'corpForm';
if (this.$refs[formRef]) {
this.$refs[formRef].clearValidate();
}
});
}, 50);
},
/**
* 提交表单
*/
handleSubmit() { handleSubmit() {
// 未选择类型时不提交 this.$refs.formRef.validate(valid => {
if (this.isAddMode && !this.selectedType) {
this.$message.warning('请先选择中介类型');
return;
}
if (this.form.intermediaryType === '1') {
this.syncPersonSubTypeRelation();
}
// 根据类型验证不同的表单
const formRef = this.form.intermediaryType === '1' ? 'indivForm' : 'corpForm';
this.$refs[formRef].validate(valid => {
if (valid) { if (valid) {
this.$emit("submit"); this.$emit("submit", { ...this.localForm });
} else {
// 验证失败:滚动到第一个错误字段
this.scrollToFirstError();
} }
}); });
}, },
handlePersonSubTypeChange(value) {
this.form.relationType = value || null;
},
syncPersonSubTypeRelation() {
if (!this.form || this.form.intermediaryType !== '1') {
return;
}
const currentValue = this.form.personSubType || this.form.relationType || null;
this.form.personSubType = currentValue;
this.form.relationType = currentValue;
},
/**
* 滚动到第一个错误字段
*/
scrollToFirstError() {
const firstError = document.querySelector('.el-form-item__error');
if (firstError) {
firstError.scrollIntoView({ behavior: 'smooth', block: 'center' });
}
},
/**
* 关闭弹窗
*/
handleClose() { handleClose() {
// 清除表单验证状态 this.dialogVisible = false;
this.$nextTick(() => {
if (this.$refs.indivForm) {
this.$refs.indivForm.clearValidate();
}
if (this.$refs.corpForm) {
this.$refs.corpForm.clearValidate();
}
});
this.$emit("close"); this.$emit("close");
},
/**
* 验证表单(供父组件调用)
*/
validateForm() {
const formRef = this.form.intermediaryType === '1' ? 'indivForm' : 'corpForm';
return this.$refs[formRef] ? this.$refs[formRef].validate() : Promise.reject();
} }
} }
}; };
</script> </script>
<style scoped lang="scss">
/* 类型选择器区域 */
.type-selector {
padding: 20px 0;
text-align: center;
}
.type-cards {
display: flex;
justify-content: center;
gap: 30px;
margin-bottom: 20px;
}
.type-card {
flex: 1;
max-width: 200px;
padding: 30px 20px;
border: 2px solid #e4e7ed;
border-radius: 8px;
cursor: pointer;
transition: all 0.3s ease;
background-color: #fff;
&:hover {
border-color: #409eff;
box-shadow: 0 2px 12px rgba(64, 158, 255, 0.2);
transform: translateY(-2px);
}
&.selected {
border-color: #409eff;
background-color: #ecf5ff;
box-shadow: 0 4px 16px rgba(64, 158, 255, 0.3);
}
&-icon {
font-size: 48px;
color: #909399;
margin-bottom: 10px;
transition: color 0.3s ease;
}
&.selected &-icon {
color: #409eff;
}
&-title {
font-size: 18px;
font-weight: bold;
color: #303133;
margin-bottom: 8px;
}
&-desc {
font-size: 14px;
color: #909399;
}
}
/* 表单容器 */
.form-container {
padding: 10px 0;
&.fade-in {
animation: fadeIn 0.3s ease-in-out;
}
}
@keyframes fadeIn {
from {
opacity: 0;
transform: translateY(-10px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
/* 分隔线样式 */
::v-deep .el-divider {
margin: 20px 0;
.el-divider__text {
font-weight: bold;
color: #409eff;
}
}
/* 必填项星号样式 */
::v-deep .el-form-item.is-required:not(.is-no-asterisk) .el-form-item__label::before {
color: #f56c6c;
}
</style>

View File

@@ -5,19 +5,38 @@
<el-input :value="ownerName" disabled /> <el-input :value="ownerName" disabled />
</el-form-item> </el-form-item>
<el-form-item label="统一社会信用代码" prop="socialCreditCode"> <el-form-item label="统一社会信用代码" prop="socialCreditCode">
<el-input v-model="localForm.socialCreditCode" placeholder="请输入统一社会信用代码" maxlength="18" clearable /> <el-input
v-model="localForm.socialCreditCode"
placeholder="请输入统一社会信用代码"
maxlength="18"
clearable
:disabled="readonly"
/>
</el-form-item> </el-form-item>
<el-form-item label="关联角色/职务"> <el-form-item label="关联职务">
<el-input v-model="localForm.relationPersonPost" placeholder="请输入关联角色/职务" maxlength="100" clearable /> <el-input
v-model="localForm.relationPersonPost"
placeholder="请输入关联职务"
maxlength="100"
clearable
:disabled="readonly"
/>
</el-form-item> </el-form-item>
<el-form-item label="备注"> <el-form-item label="备注">
<el-input v-model="localForm.remark" type="textarea" :rows="3" maxlength="500" show-word-limit /> <el-input
v-model="localForm.remark"
type="textarea"
:rows="3"
maxlength="500"
show-word-limit
:disabled="readonly"
/>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="handleSubmit"> </el-button> <el-button v-if="!readonly" type="primary" @click="handleSubmit"> </el-button>
<el-button @click="handleClose"> </el-button> <el-button @click="handleClose">{{ readonly ? ' ' : ' ' }}</el-button>
</div> </div>
</el-dialog> </el-dialog>
</template> </template>
@@ -41,6 +60,10 @@ export default {
ownerName: { ownerName: {
type: String, type: String,
default: "" default: ""
},
readonly: {
type: Boolean,
default: false
} }
}, },
data() { data() {
@@ -72,6 +95,9 @@ export default {
}, },
methods: { methods: {
handleSubmit() { handleSubmit() {
if (this.readonly) {
return;
}
this.$refs.formRef.validate(valid => { this.$refs.formRef.validate(valid => {
if (valid) { if (valid) {
this.$emit("submit", { ...this.localForm }); this.$emit("submit", { ...this.localForm });

View File

@@ -9,7 +9,7 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="亲属关系" prop="personSubType"> <el-form-item label="亲属关系" prop="personSubType">
<el-select v-model="localForm.personSubType" placeholder="请选择亲属关系" clearable style="width: 100%"> <el-select v-model="localForm.personSubType" placeholder="请选择亲属关系" clearable style="width: 100%" :disabled="readonly">
<el-option <el-option
v-for="item in filteredRelationOptions" v-for="item in filteredRelationOptions"
:key="item.value" :key="item.value"
@@ -23,19 +23,19 @@
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="姓名" prop="name"> <el-form-item label="姓名" prop="name">
<el-input v-model="localForm.name" placeholder="请输入姓名" maxlength="100" clearable /> <el-input v-model="localForm.name" placeholder="请输入姓名" maxlength="100" clearable :disabled="readonly" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="证件号" prop="personId"> <el-form-item label="证件号" prop="personId">
<el-input v-model="localForm.personId" placeholder="请输入证件号码" maxlength="50" clearable /> <el-input v-model="localForm.personId" placeholder="请输入证件号码" maxlength="50" clearable :disabled="readonly" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="人员类型"> <el-form-item label="人员类型">
<el-select v-model="localForm.personType" placeholder="请选择人员类型" clearable style="width: 100%"> <el-select v-model="localForm.personType" placeholder="请选择人员类型" clearable style="width: 100%" :disabled="readonly">
<el-option <el-option
v-for="item in indivTypeOptions" v-for="item in indivTypeOptions"
:key="item.value" :key="item.value"
@@ -47,7 +47,7 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="证件类型"> <el-form-item label="证件类型">
<el-select v-model="localForm.idType" placeholder="请选择证件类型" clearable style="width: 100%"> <el-select v-model="localForm.idType" placeholder="请选择证件类型" clearable style="width: 100%" :disabled="readonly">
<el-option <el-option
v-for="item in certTypeOptions" v-for="item in certTypeOptions"
:key="item.value" :key="item.value"
@@ -61,7 +61,7 @@
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="性别"> <el-form-item label="性别">
<el-select v-model="localForm.gender" placeholder="请选择性别" clearable style="width: 100%"> <el-select v-model="localForm.gender" placeholder="请选择性别" clearable style="width: 100%" :disabled="readonly">
<el-option <el-option
v-for="item in genderOptions" v-for="item in genderOptions"
:key="item.value" :key="item.value"
@@ -73,33 +73,33 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="手机号码"> <el-form-item label="手机号码">
<el-input v-model="localForm.mobile" placeholder="请输入手机号码" maxlength="20" clearable /> <el-input v-model="localForm.mobile" placeholder="请输入手机号码" maxlength="20" clearable :disabled="readonly" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-form-item label="联系地址"> <el-form-item label="联系地址">
<el-input v-model="localForm.contactAddress" placeholder="请输入联系地址" maxlength="200" clearable /> <el-input v-model="localForm.contactAddress" placeholder="请输入联系地址" maxlength="200" clearable :disabled="readonly" />
</el-form-item> </el-form-item>
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="所在公司"> <el-form-item label="所在公司">
<el-input v-model="localForm.company" placeholder="请输入所在公司" maxlength="200" clearable /> <el-input v-model="localForm.company" placeholder="请输入所在公司" maxlength="200" clearable :disabled="readonly" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="职位"> <el-form-item label="职位">
<el-input v-model="localForm.position" placeholder="请输入职位" maxlength="100" clearable /> <el-input v-model="localForm.position" placeholder="请输入职位" maxlength="100" clearable :disabled="readonly" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-form-item label="备注"> <el-form-item label="备注">
<el-input v-model="localForm.remark" type="textarea" :rows="3" maxlength="500" show-word-limit /> <el-input v-model="localForm.remark" type="textarea" :rows="3" maxlength="500" show-word-limit :disabled="readonly" />
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="handleSubmit"> </el-button> <el-button v-if="!readonly" type="primary" @click="handleSubmit"> </el-button>
<el-button @click="handleClose"> </el-button> <el-button @click="handleClose">{{ readonly ? ' ' : ' ' }}</el-button>
</div> </div>
</el-dialog> </el-dialog>
</template> </template>
@@ -124,6 +124,10 @@ export default {
type: String, type: String,
default: "" default: ""
}, },
readonly: {
type: Boolean,
default: false
},
relationTypeOptions: { relationTypeOptions: {
type: Array, type: Array,
default: () => [] default: () => []
@@ -177,6 +181,9 @@ export default {
}, },
methods: { methods: {
handleSubmit() { handleSubmit() {
if (this.readonly) {
return;
}
this.$refs.formRef.validate(valid => { this.$refs.formRef.validate(valid => {
if (valid) { if (valid) {
this.$emit("submit", { ...this.localForm }); this.$emit("submit", { ...this.localForm });

View File

@@ -1,11 +1,11 @@
<template> <template>
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
<el-form-item label="姓名/机构名称" prop="name"> <el-form-item label="名称" prop="name">
<el-input <el-input
v-model="queryParams.name" v-model="queryParams.name"
placeholder="请输入姓名/机构名称" placeholder="请输入名称"
clearable clearable
style="width: 240px" style="width: 220px"
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
@@ -14,17 +14,26 @@
v-model="queryParams.certificateNo" v-model="queryParams.certificateNo"
placeholder="请输入证件号" placeholder="请输入证件号"
clearable clearable
style="width: 240px" style="width: 220px"
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="中介类型" prop="intermediaryType"> <el-form-item label="记录类型" prop="recordType">
<el-select v-model="queryParams.intermediaryType" placeholder="中介类型" clearable style="width: 240px"> <el-select v-model="queryParams.recordType" placeholder="请选择记录类型" clearable style="width: 180px">
<el-option label="全部" value="" /> <el-option label="中介本人" value="INTERMEDIARY" />
<el-option label="个人" value="1" /> <el-option label="中介亲属" value="RELATIVE" />
<el-option label="实体" value="2" /> <el-option label="关联机构" value="ENTERPRISE_RELATION" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="关联中介信息" prop="relatedIntermediaryKeyword">
<el-input
v-model="queryParams.relatedIntermediaryKeyword"
placeholder="请输入关联中介姓名或证件号"
clearable
style="width: 260px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> <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-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>

File diff suppressed because it is too large Load Diff

View File

@@ -57,7 +57,7 @@ CREATE TABLE IF NOT EXISTS `ccdi_bank_tag_task` (
`success_rule_count` INT NOT NULL DEFAULT 0 COMMENT '成功规则数', `success_rule_count` INT NOT NULL DEFAULT 0 COMMENT '成功规则数',
`failed_rule_count` INT NOT NULL DEFAULT 0 COMMENT '失败规则数', `failed_rule_count` INT NOT NULL DEFAULT 0 COMMENT '失败规则数',
`hit_count` INT NOT NULL DEFAULT 0 COMMENT '命中数量', `hit_count` INT NOT NULL DEFAULT 0 COMMENT '命中数量',
`error_message` VARCHAR(2000) DEFAULT NULL COMMENT '错误信息', `error_message` LONGTEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '错误信息',
`start_time` DATETIME DEFAULT NULL COMMENT '开始时间', `start_time` DATETIME DEFAULT NULL COMMENT '开始时间',
`end_time` DATETIME DEFAULT NULL COMMENT '结束时间', `end_time` DATETIME DEFAULT NULL COMMENT '结束时间',
`create_by` VARCHAR(64) DEFAULT NULL COMMENT '创建者', `create_by` VARCHAR(64) DEFAULT NULL COMMENT '创建者',

View File

@@ -29,7 +29,7 @@ CREATE TABLE `ccdi_employee` (
UNIQUE KEY `uk_id_card` (`id_card`), UNIQUE KEY `uk_id_card` (`id_card`),
KEY `idx_dept_id` (`dept_id`), KEY `idx_dept_id` (`dept_id`),
KEY `idx_status` (`status`) KEY `idx_status` (`status`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='员工信息表'; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='员工信息表';
-- ---------------------------- -- ----------------------------
-- 2. 创建员工亲属表 -- 2. 创建员工亲属表
@@ -48,7 +48,7 @@ CREATE TABLE `ccdi_employee_relative` (
PRIMARY KEY (`relative_id`), PRIMARY KEY (`relative_id`),
KEY `idx_employee_id` (`employee_id`), KEY `idx_employee_id` (`employee_id`),
KEY `idx_relative_id_card` (`relative_id_card`) KEY `idx_relative_id_card` (`relative_id_card`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='员工亲属表'; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='员工亲属表';
-- ---------------------------- -- ----------------------------
-- 3. 字典数据 SQL -- 3. 字典数据 SQL

View File

@@ -22,7 +22,7 @@ CREATE TABLE `ccdi_intermediary_blacklist` (
KEY `idx_name` (`name`), KEY `idx_name` (`name`),
KEY `idx_certificate_no` (`certificate_no`), KEY `idx_certificate_no` (`certificate_no`),
KEY `idx_intermediary_type` (`intermediary_type`) KEY `idx_intermediary_type` (`intermediary_type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='中介人员黑名单表'; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='中介人员黑名单表';
-- ---------------------------- -- ----------------------------
-- 2. 菜单 SQL -- 2. 菜单 SQL

View File

@@ -17,11 +17,11 @@ SHOW CREATE TABLE ccdi_employee_relative;
-- 4. 如果字符集不是 utf8mb4执行以下语句修复请根据实际情况修改 -- 4. 如果字符集不是 utf8mb4执行以下语句修复请根据实际情况修改
-- 修改数据库字符集 -- 修改数据库字符集
ALTER DATABASE `discipline-prelim-check` CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci; ALTER DATABASE `discipline-prelim-check` CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci;
-- 修改表字符集 -- 修改表字符集
ALTER TABLE `ccdi_employee` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; ALTER TABLE `ccdi_employee` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `ccdi_employee_relative` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; ALTER TABLE `ccdi_employee_relative` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
-- 5. 清空测试数据(可选) -- 5. 清空测试数据(可选)
-- TRUNCATE TABLE ccdi_employee_relative; -- TRUNCATE TABLE ccdi_employee_relative;

View File

@@ -12,4 +12,4 @@ CREATE TABLE IF NOT EXISTS `ccdi_intermediary_enterprise_relation` (
UNIQUE KEY `uk_intermediary_enterprise` (`intermediary_biz_id`, `social_credit_code`), UNIQUE KEY `uk_intermediary_enterprise` (`intermediary_biz_id`, `social_credit_code`),
KEY `idx_intermediary_biz_id` (`intermediary_biz_id`), KEY `idx_intermediary_biz_id` (`intermediary_biz_id`),
KEY `idx_social_credit_code` (`social_credit_code`) KEY `idx_social_credit_code` (`social_credit_code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='中介关联机构关系表'; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='中介关联机构关系表';

View File

@@ -0,0 +1,60 @@
-- 全库表字符集与排序规则统一修复
-- 目标:所有业务表、系统表统一为 utf8mb4 / utf8mb4_general_ci
SET FOREIGN_KEY_CHECKS = 0;
ALTER TABLE QRTZ_BLOB_TRIGGERS CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE QRTZ_CALENDARS CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE QRTZ_CRON_TRIGGERS CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE QRTZ_FIRED_TRIGGERS CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE QRTZ_JOB_DETAILS CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE QRTZ_LOCKS CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE QRTZ_PAUSED_TRIGGER_GRPS CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE QRTZ_SCHEDULER_STATE CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE QRTZ_SIMPLE_TRIGGERS CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE QRTZ_SIMPROP_TRIGGERS CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE QRTZ_TRIGGERS CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE ccdi_account_info CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE ccdi_asset_info CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE ccdi_bank_statement CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE ccdi_bank_statement_tag_result CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE ccdi_bank_tag_rule CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE ccdi_bank_tag_task CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE ccdi_base_staff CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE ccdi_biz_intermediary CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE ccdi_credit_negative_info CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE ccdi_cust_enterprise_relation CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE ccdi_cust_fmy_relation CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE ccdi_debts_info CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE ccdi_enterprise_base_info CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE ccdi_file_upload_record CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE ccdi_intermediary_enterprise_relation CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE ccdi_model_param CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE ccdi_project CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE ccdi_project_overview_employee_result CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE ccdi_purchase_transaction CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE ccdi_staff_enterprise_relation CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE ccdi_staff_fmy_relation CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE ccdi_staff_recruitment CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE ccdi_staff_transfer CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE gen_table CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE gen_table_column CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE sys_config CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE sys_dept CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE sys_dict_data CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE sys_dict_type CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE sys_job CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE sys_job_log CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE sys_logininfor CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE sys_menu CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE sys_notice CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE sys_oper_log CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE sys_post CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE sys_role CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE sys_role_dept CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE sys_role_menu CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE sys_user CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE sys_user_post CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE sys_user_role CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
SET FOREIGN_KEY_CHECKS = 1;

View File

@@ -0,0 +1,9 @@
-- 统一流水标签任务表排序规则,并放宽错误信息字段长度
ALTER TABLE `ccdi_bank_tag_task`
CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `ccdi_bank_tag_task`
MODIFY COLUMN `error_message` LONGTEXT
CHARACTER SET utf8mb4
COLLATE utf8mb4_general_ci
NULL COMMENT '错误信息';