fix: 修复intermediaryType字段访问错误
- intermediaryType字段仅存在于VO中,不应在Entity上访问
- 移除查询条件中对getIntermediaryType()的错误引用
- 修改插入方法,使用正确的字段设置:
- 个人中介:setPersonType('中介') + setDataSource
- 实体中介:setRiskLevel('1') + setEntSource('INTERMEDIARY') + setDataSource
- 修复位置:查询条件、新增方法、导入方法共6处
编译验证:通过
This commit is contained in:
@@ -55,12 +55,9 @@ public class CcdiIntermediaryServiceImpl implements ICcdiIntermediaryService {
|
|||||||
|
|
||||||
// 查询个人中介
|
// 查询个人中介
|
||||||
LambdaQueryWrapper<CcdiBizIntermediary> personWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<CcdiBizIntermediary> personWrapper = new LambdaQueryWrapper<>();
|
||||||
personWrapper.like(StringUtils.isNotEmpty(queryDTO.getName()), CcdiBizIntermediary::getName, queryDTO.getName())
|
personWrapper.eq(CcdiBizIntermediary::getPersonType, "中介")
|
||||||
.like(StringUtils.isNotEmpty(queryDTO.getCertificateNo()), CcdiBizIntermediary::getPersonId, queryDTO.getCertificateNo())
|
.like(StringUtils.isNotEmpty(queryDTO.getName()), CcdiBizIntermediary::getName, queryDTO.getName())
|
||||||
.eq(StringUtils.isNotEmpty(queryDTO.getIntermediaryType()), CcdiBizIntermediary::getIntermediaryType, queryDTO.getIntermediaryType())
|
.like(StringUtils.isNotEmpty(queryDTO.getCertificateNo()), CcdiBizIntermediary::getPersonId, queryDTO.getCertificateNo());
|
||||||
.or()
|
|
||||||
.eq(StringUtils.isEmpty(queryDTO.getIntermediaryType()) || "1".equals(queryDTO.getIntermediaryType()),
|
|
||||||
CcdiBizIntermediary::getIntermediaryType, "1");
|
|
||||||
|
|
||||||
List<CcdiBizIntermediary> personList = bizIntermediaryMapper.selectList(personWrapper);
|
List<CcdiBizIntermediary> personList = bizIntermediaryMapper.selectList(personWrapper);
|
||||||
for (CcdiBizIntermediary person : personList) {
|
for (CcdiBizIntermediary person : personList) {
|
||||||
@@ -78,12 +75,10 @@ public class CcdiIntermediaryServiceImpl implements ICcdiIntermediaryService {
|
|||||||
|
|
||||||
// 查询实体中介
|
// 查询实体中介
|
||||||
LambdaQueryWrapper<CcdiEnterpriseBaseInfo> entityWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<CcdiEnterpriseBaseInfo> entityWrapper = new LambdaQueryWrapper<>();
|
||||||
entityWrapper.like(StringUtils.isNotEmpty(queryDTO.getName()), CcdiEnterpriseBaseInfo::getEnterpriseName, queryDTO.getName())
|
entityWrapper.eq(CcdiEnterpriseBaseInfo::getRiskLevel, "1")
|
||||||
.like(StringUtils.isNotEmpty(queryDTO.getCertificateNo()), CcdiEnterpriseBaseInfo::getSocialCreditCode, queryDTO.getCertificateNo())
|
.eq(CcdiEnterpriseBaseInfo::getEntSource, "INTERMEDIARY")
|
||||||
.eq(StringUtils.isNotEmpty(queryDTO.getIntermediaryType()), CcdiEnterpriseBaseInfo::getIntermediaryType, queryDTO.getIntermediaryType())
|
.like(StringUtils.isNotEmpty(queryDTO.getName()), CcdiEnterpriseBaseInfo::getEnterpriseName, queryDTO.getName())
|
||||||
.or()
|
.like(StringUtils.isNotEmpty(queryDTO.getCertificateNo()), CcdiEnterpriseBaseInfo::getSocialCreditCode, queryDTO.getCertificateNo());
|
||||||
.eq(StringUtils.isEmpty(queryDTO.getIntermediaryType()) || "2".equals(queryDTO.getIntermediaryType()),
|
|
||||||
CcdiEnterpriseBaseInfo::getIntermediaryType, "2");
|
|
||||||
|
|
||||||
List<CcdiEnterpriseBaseInfo> entityList = enterpriseBaseInfoMapper.selectList(entityWrapper);
|
List<CcdiEnterpriseBaseInfo> entityList = enterpriseBaseInfoMapper.selectList(entityWrapper);
|
||||||
for (CcdiEnterpriseBaseInfo entity : entityList) {
|
for (CcdiEnterpriseBaseInfo entity : entityList) {
|
||||||
@@ -164,7 +159,8 @@ public class CcdiIntermediaryServiceImpl implements ICcdiIntermediaryService {
|
|||||||
|
|
||||||
CcdiBizIntermediary person = new CcdiBizIntermediary();
|
CcdiBizIntermediary person = new CcdiBizIntermediary();
|
||||||
BeanUtils.copyProperties(addDTO, person);
|
BeanUtils.copyProperties(addDTO, person);
|
||||||
person.setIntermediaryType("1");
|
person.setPersonType("中介");
|
||||||
|
person.setDataSource("MANUAL");
|
||||||
|
|
||||||
return bizIntermediaryMapper.insert(person);
|
return bizIntermediaryMapper.insert(person);
|
||||||
}
|
}
|
||||||
@@ -209,7 +205,9 @@ public class CcdiIntermediaryServiceImpl implements ICcdiIntermediaryService {
|
|||||||
|
|
||||||
CcdiEnterpriseBaseInfo entity = new CcdiEnterpriseBaseInfo();
|
CcdiEnterpriseBaseInfo entity = new CcdiEnterpriseBaseInfo();
|
||||||
BeanUtils.copyProperties(addDTO, entity);
|
BeanUtils.copyProperties(addDTO, entity);
|
||||||
entity.setIntermediaryType("2");
|
entity.setRiskLevel("1");
|
||||||
|
entity.setEntSource("INTERMEDIARY");
|
||||||
|
entity.setDataSource("MANUAL");
|
||||||
|
|
||||||
return enterpriseBaseInfoMapper.insert(entity);
|
return enterpriseBaseInfoMapper.insert(entity);
|
||||||
}
|
}
|
||||||
@@ -318,7 +316,8 @@ public class CcdiIntermediaryServiceImpl implements ICcdiIntermediaryService {
|
|||||||
// 转换为实体
|
// 转换为实体
|
||||||
CcdiBizIntermediary person = new CcdiBizIntermediary();
|
CcdiBizIntermediary person = new CcdiBizIntermediary();
|
||||||
BeanUtils.copyProperties(excel, person);
|
BeanUtils.copyProperties(excel, person);
|
||||||
person.setIntermediaryType("1");
|
person.setPersonType("中介");
|
||||||
|
person.setDataSource("IMPORT");
|
||||||
|
|
||||||
// 检查唯一性
|
// 检查唯一性
|
||||||
if (!checkPersonIdUnique(excel.getPersonId(), null)) {
|
if (!checkPersonIdUnique(excel.getPersonId(), null)) {
|
||||||
@@ -385,7 +384,9 @@ public class CcdiIntermediaryServiceImpl implements ICcdiIntermediaryService {
|
|||||||
// 转换为实体
|
// 转换为实体
|
||||||
CcdiEnterpriseBaseInfo entity = new CcdiEnterpriseBaseInfo();
|
CcdiEnterpriseBaseInfo entity = new CcdiEnterpriseBaseInfo();
|
||||||
BeanUtils.copyProperties(excel, entity);
|
BeanUtils.copyProperties(excel, entity);
|
||||||
entity.setIntermediaryType("2");
|
entity.setRiskLevel("1");
|
||||||
|
entity.setEntSource("INTERMEDIARY");
|
||||||
|
entity.setDataSource("IMPORT");
|
||||||
|
|
||||||
// 检查唯一性
|
// 检查唯一性
|
||||||
if (StringUtils.isNotEmpty(excel.getSocialCreditCode())) {
|
if (StringUtils.isNotEmpty(excel.getSocialCreditCode())) {
|
||||||
|
|||||||
Reference in New Issue
Block a user