入驻分账比例,如果有值,去掉自动计算。

This commit is contained in:
Jack 2025-09-22 23:43:51 +08:00
parent ec654a3539
commit e21eb8f518

View File

@ -2014,13 +2014,83 @@ public class ShopMchEntryServiceImpl extends BaseServiceImpl<ShopMchEntryMapper,
} }
} }
/**
* 检查商户入驻信息
*
* @param record 商户入驻记录
* @param checkEmpty 是否检查必填字段
* @param checkFormat 是否检查字段格式
* @return 检查结果Pair对象第一个元素表示是否通过检查第二个元素为错误信息
*/
protected Pair<Boolean, String> checkMchEntryInfo(ShopMchEntry record, boolean checkEmpty, boolean checkFormat) { protected Pair<Boolean, String> checkMchEntryInfo(ShopMchEntry record, boolean checkEmpty, boolean checkFormat) {
log.debug("开始检查商户入驻信息checkEmpty={}, checkFormat={}", checkEmpty, checkFormat);
if (record == null) { if (record == null) {
log.warn("商户入驻信息不能为空");
return Pair.of(false, "商户入驻信息不能为空"); return Pair.of(false, "商户入驻信息不能为空");
} }
if (checkEmpty) { if (checkEmpty) {
log.debug("检查商户入驻必填字段");
Pair<Boolean, String> emptyCheckResult = checkEmptyFields(record);
if (!emptyCheckResult.getFirst()) {
log.warn("必填字段检查失败: {}", emptyCheckResult.getSecond());
return emptyCheckResult;
}
}
if (checkFormat) {
log.debug("检查商户入驻字段格式");
Pair<Boolean, String> formatCheckResult = checkFormatFields(record);
if (!formatCheckResult.getFirst()) {
log.warn("字段格式检查失败: {}", formatCheckResult.getSecond());
return formatCheckResult;
}
}
log.debug("商户入驻信息检查通过");
return Pair.of(true, "");
}
/**
* 检查商户入驻必填字段
*
* @param record 商户入驻记录
* @return 检查结果Pair对象
*/
private Pair<Boolean, String> checkEmptyFields(ShopMchEntry record) {
// 检查通用必填字段 // 检查通用必填字段
Pair<Boolean, String> commonFieldsCheck = checkCommonRequiredFields(record);
if (!commonFieldsCheck.getFirst()) {
return commonFieldsCheck;
}
// 根据入驻主体类型检查相应字段
if (record.getEntity_type() == CommonConstant.MCH_ENTITY_TYPE_QY) {
// 企业类型必填字段检查
Pair<Boolean, String> enterpriseFieldsCheck = checkEnterpriseRequiredFields(record);
if (!enterpriseFieldsCheck.getFirst()) {
return enterpriseFieldsCheck;
}
} else if (record.getEntity_type() == CommonConstant.MCH_ENTITY_TYPE_GR) {
// 个人类型必填字段检查
Pair<Boolean, String> individualFieldsCheck = checkIndividualRequiredFields(record);
if (!individualFieldsCheck.getFirst()) {
return individualFieldsCheck;
}
}
// 检查结算信息必填字段
return checkSettlementRequiredFields(record);
}
/**
* 检查通用必填字段
*
* @param record 商户入驻记录
* @return 检查结果Pair对象
*/
private Pair<Boolean, String> checkCommonRequiredFields(ShopMchEntry record) {
if (StringUtils.isEmpty(record.getLogin_mobile())) { if (StringUtils.isEmpty(record.getLogin_mobile())) {
return Pair.of(false, "商家注册手机号不能为空"); return Pair.of(false, "商家注册手机号不能为空");
} }
@ -2065,9 +2135,16 @@ public class ShopMchEntryServiceImpl extends BaseServiceImpl<ShopMchEntryMapper,
return Pair.of(false, "入驻类型是企业或个人?"); return Pair.of(false, "入驻类型是企业或个人?");
} }
// 根据入驻主体类型检查相应字段 return Pair.of(true, "");
if (record.getEntity_type() == CommonConstant.MCH_ENTITY_TYPE_QY) { }
// 企业类型必填字段检查
/**
* 检查企业类型必填字段
*
* @param record 商户入驻记录
* @return 检查结果Pair对象
*/
private Pair<Boolean, String> checkEnterpriseRequiredFields(ShopMchEntry record) {
if (StringUtils.isEmpty(record.getBiz_license_image())) { if (StringUtils.isEmpty(record.getBiz_license_image())) {
return Pair.of(false, "营业执照图片不能为空"); return Pair.of(false, "营业执照图片不能为空");
} }
@ -2111,8 +2188,17 @@ public class ShopMchEntryServiceImpl extends BaseServiceImpl<ShopMchEntryMapper,
if (StringUtils.isEmpty(record.getLegal_person_id_period_end())) { if (StringUtils.isEmpty(record.getLegal_person_id_period_end())) {
return Pair.of(false, "法人身份证截止有效日期不能为空"); return Pair.of(false, "法人身份证截止有效日期不能为空");
} }
} else if (record.getEntity_type() == CommonConstant.MCH_ENTITY_TYPE_GR) {
// 个人类型必填字段检查 return Pair.of(true, "");
}
/**
* 检查个人类型必填字段
*
* @param record 商户入驻记录
* @return 检查结果Pair对象
*/
private Pair<Boolean, String> checkIndividualRequiredFields(ShopMchEntry record) {
if (StringUtils.isEmpty(record.getIndividual_id_images())) { if (StringUtils.isEmpty(record.getIndividual_id_images())) {
return Pair.of(false, "身份证正面照不能为空"); return Pair.of(false, "身份证正面照不能为空");
} }
@ -2140,9 +2226,17 @@ public class ShopMchEntryServiceImpl extends BaseServiceImpl<ShopMchEntryMapper,
if (StringUtils.isEmpty(record.getIndividual_id_period_end())) { if (StringUtils.isEmpty(record.getIndividual_id_period_end())) {
return Pair.of(false, "身份证截止有效日期不能为空"); return Pair.of(false, "身份证截止有效日期不能为空");
} }
return Pair.of(true, "");
} }
// 检查结算信息必填字段 /**
* 检查结算信息必填字段
*
* @param record 商户入驻记录
* @return 检查结果Pair对象
*/
private Pair<Boolean, String> checkSettlementRequiredFields(ShopMchEntry record) {
if (StringUtils.isEmpty(record.getBank_area())) { if (StringUtils.isEmpty(record.getBank_area())) {
return Pair.of(false, "结算账号省市区名称不能为空"); return Pair.of(false, "结算账号省市区名称不能为空");
} }
@ -2158,9 +2252,17 @@ public class ShopMchEntryServiceImpl extends BaseServiceImpl<ShopMchEntryMapper,
if (StringUtils.isEmpty(record.getAccount_number())) { if (StringUtils.isEmpty(record.getAccount_number())) {
return Pair.of(false, "结算银行卡号不能为空"); return Pair.of(false, "结算银行卡号不能为空");
} }
return Pair.of(true, "");
} }
if (checkFormat) { /**
* 检查字段格式
*
* @param record 商户入驻记录
* @return 检查结果Pair对象
*/
private Pair<Boolean, String> checkFormatFields(ShopMchEntry record) {
// 检查手机号格式 // 检查手机号格式
if (StringUtils.isNotEmpty(record.getLogin_mobile()) && !PhoneNumberUtils.checkPhoneNumber(record.getLogin_mobile())) { if (StringUtils.isNotEmpty(record.getLogin_mobile()) && !PhoneNumberUtils.checkPhoneNumber(record.getLogin_mobile())) {
return Pair.of(false, "商家注册手机号格式不正确"); return Pair.of(false, "商家注册手机号格式不正确");
@ -2228,8 +2330,6 @@ public class ShopMchEntryServiceImpl extends BaseServiceImpl<ShopMchEntryMapper,
return Pair.of(false, "店铺经度格式不正确"); return Pair.of(false, "店铺经度格式不正确");
} }
}
return Pair.of(true, ""); return Pair.of(true, "");
} }
} }