```
feat(shopro_huifu): 完善汇付进件功能的表单验证和错误处理 - 增加支行搜索功能的城市筛选支持,优化搜索逻辑 - 添加前端表单验证机制,包括身份证、银行卡、区域等必填字段校验 - 改进支行选择验证,确保必须从搜索结果中选择带联行号的支行 - 优化后端保存逻辑,添加强制保存参数控制 - 统一异常处理机制,增加HttpResponseException的正确抛出 - 完善用户界面提示信息,明确操作指引和错误反馈 - 修复表单提交前的数据准备逻辑,确保数据完整性 ```
这个提交包含在:
@@ -31,7 +31,7 @@ class HuifuOnboardAdminService
|
||||
}
|
||||
|
||||
$service = new HuifuOnboardService();
|
||||
return $service->saveDraft($userId, $roleType, $roleRefId, $formData, $onboardId);
|
||||
return $service->saveDraft($userId, $roleType, $roleRefId, $formData, $onboardId, true);
|
||||
}
|
||||
|
||||
protected function assertRoleBinding($userId, $roleType, $roleRefId)
|
||||
|
||||
@@ -72,15 +72,20 @@ class HuifuOnboardBankBranch
|
||||
}
|
||||
}
|
||||
|
||||
protected static function searchJson($keyword, $limit)
|
||||
protected static function searchJson($keyword, $cityCode = '', $limit = 20)
|
||||
{
|
||||
$limit = max(0, (int) $limit);
|
||||
if ($limit <= 0) {
|
||||
return [];
|
||||
}
|
||||
$cityCode = HuifuOnboardAreaHelper::toCode($cityCode);
|
||||
$all = self::loadJson();
|
||||
$keywordLower = mb_strtolower($keyword, 'UTF-8');
|
||||
$rows = [];
|
||||
foreach ($all as $item) {
|
||||
if ($cityCode !== '' && HuifuOnboardAreaHelper::toCode($item['area_id'] ?? '') !== $cityCode) {
|
||||
continue;
|
||||
}
|
||||
$hay = mb_strtolower(
|
||||
($item['branch_name'] ?? '') . ' ' . ($item['bank_name'] ?? '') . ' ' . ($item['branch_code'] ?? ''),
|
||||
'UTF-8'
|
||||
|
||||
@@ -31,9 +31,9 @@ class HuifuOnboardService
|
||||
/**
|
||||
* 用户申请时仅保存进件资料,待后台业务审核通过后再提交汇付
|
||||
*/
|
||||
public function saveDraft($userId, $roleType, $roleRefId, array $formData, $onboardId = 0)
|
||||
public function saveDraft($userId, $roleType, $roleRefId, array $formData, $onboardId = 0, $force = false)
|
||||
{
|
||||
if (!HuifuOnboardGate::isOnboardRequired()) {
|
||||
if (!$force && !HuifuOnboardGate::isOnboardRequired()) {
|
||||
return null;
|
||||
}
|
||||
if (!in_array($roleType, ['promoter', 'regional_agent'], true)) {
|
||||
|
||||
@@ -93,6 +93,9 @@ class HuifuOnboardValidator
|
||||
if (empty($data['branch_code']) && empty($data['branch_name'])) {
|
||||
throw new \InvalidArgumentException('请选择开户银行支行');
|
||||
}
|
||||
if (empty($data['branch_code']) && !empty($data['branch_name'])) {
|
||||
throw new \InvalidArgumentException('请从搜索结果中点击选择开户银行支行(需联行号)');
|
||||
}
|
||||
if (empty($data['prov_id']) || empty($data['area_id'])) {
|
||||
throw new \InvalidArgumentException('请选择所在区域');
|
||||
}
|
||||
|
||||
在新工单中引用
屏蔽一个用户