|
|
@@ -1201,6 +1201,7 @@ class ImportService extends Service
|
|
|
$keys = array_column($table_config, 'key');
|
|
|
$codeIdx = array_search('code', $keys);
|
|
|
$parentIdx = array_search('parent_id', $keys);
|
|
|
+ $isOtherIdx = array_search('is_other', $keys);
|
|
|
|
|
|
// 1. 获取基础数据
|
|
|
list($dbFeeMap, $excelCodesMap) = $this->getFeeList($array, $user, $codeIdx);
|
|
|
@@ -1209,6 +1210,8 @@ class ImportService extends Service
|
|
|
$update = [];
|
|
|
$parent_code_map = [];
|
|
|
|
|
|
+ $is_other_map = array_flip(Fee::IS_OTHER);
|
|
|
+
|
|
|
// 2. 建立 Excel 内部父子关系映射(用于环路追溯)
|
|
|
$currentExcelMap = [];
|
|
|
foreach ($array as $row) {
|
|
|
@@ -1231,6 +1234,14 @@ class ImportService extends Service
|
|
|
$update[$rowIndex] = $dbFeeMap[$valCode]['id'];
|
|
|
}
|
|
|
|
|
|
+ // 其他费用
|
|
|
+ $is_other_text = $value[$isOtherIdx] ?? '';
|
|
|
+ if (!isset($is_other_map[$is_other_text])) {
|
|
|
+ $errors[] = "第{$displayLine}行:是否其他费用[{$is_other_text}]无效";
|
|
|
+ } else {
|
|
|
+ $array[$rowIndex][$isOtherIdx] = $is_other_map[$is_other_text];
|
|
|
+ }
|
|
|
+
|
|
|
if ($valParentCode !== '') {
|
|
|
// --- A. 存在性校验 ---
|
|
|
// 这里会检查 006 是否在数据库,或者是否在本次 Excel 的其他行中
|