chore: 네 창 작업 269건 main 반영 (2026-09-09) #13

Merged
eomsangdon merged 269 commits from main_desktop_1 into main 2026-09-09 18:21:28 +09:00
2 changed files with 48 additions and 9 deletions
Showing only changes of commit df6d33c462 - Show all commits
+8 -1
View File
@@ -42,7 +42,14 @@ interface ServerCalcInput {
/** 구조물 터파기 잔토(㎥, 양수) — B08 이 낸다. 사토에 **더한다**. */
structure_spoil_m3?: number | null;
/** 측점별 잔토 — 오면 **그 자리**에 얹는다(운반거리가 맞다). */
structure_spoil_points?: Array<{ chainage_m: number; spoil_m3: number }> | null;
structure_spoil_points?: Array<{
chainage_m: number;
spoil_m3: number;
/** 그 터파기의 토질 — B08 이 이미 판정한 값(품셈 9-13). `null` 이면 「지반 모름」. */
ground_type?: string | null;
ground_label?: string | null;
ground?: string | null;
}> | null;
};
}
+40 -8
View File
@@ -394,6 +394,21 @@ function applyCollectedStoneDeduction(residuals: HaulResidual[], deduction: numb
*
* 돌려주는 값은 **실제로 더한 양(㎥)**. 받을 사토 잔량이 하나도 없으면 0 이다.
*/
/**
* 터파기 토질 문자열 → 잔량의 지반 갈래 칸. 모르면 `null`(그 몫은 「지반 모름」으로 남는다).
* 받는 말은 B08 의 품셈 9-13 3구분과 우리 내부 이름 둘 다 받는다.
*/
function groundBucket(ground: string | null | undefined): "ea_m3" | "rr_m3" | "br_m3" | null {
const text = (ground ?? "").trim();
if (!text) return null;
if (text === "토사" || text === "soil" || text === "ea") return "ea_m3";
if (text === "암절취" || text === "리핑암" || text === "ripping_rock" || text === "rr") {
return "rr_m3";
}
if (text === "발파암" || text === "blasting_rock" || text === "br") return "br_m3";
return null;
}
function newSpoilResidual(fromM: number, toM: number, volumeM3: number): HaulResidual {
// 잔토를 담을 사토 잔량이 없을 때 **새로 세운다**(2026-09-09 확정 ㉰).
// ⚠ 지반유형 안분·자연방토는 0 이다 — 어느 지반에서 나온 흙인지 모르고, **실어 내는** 흙이다.
@@ -430,7 +445,14 @@ function newSpoilResidual(fromM: number, toM: number, volumeM3: number): HaulRes
function applyStructureSpoil(
residuals: HaulResidual[],
amount: number | null,
points: Array<{ chainage_m: number; spoil_m3: number }> | null,
points: Array<{
chainage_m: number;
spoil_m3: number;
/** B08 이 보내는 이름은 `ground_type`(soil·ripping_rock·blasting_rock). 옛 이름·라벨도 받는다. */
ground_type?: string | null;
ground_label?: string | null;
ground?: string | null;
}> | null,
): number {
const spoilsOf = (): HaulResidual[] => residuals.filter((residual) => residual.kind === "spoil");
@@ -445,12 +467,13 @@ function applyStructureSpoil(
const covering = spoils.find(
(residual) => chainage >= residual.from_m - 1e-9 && chainage <= residual.to_m + 1e-9,
);
if (covering) {
covering.volume_m3 += value;
} else {
// 그 자리를 품는 사토가 없다 — 그 측점에 사토를 새로 세워 담는다.
residuals.push(newSpoilResidual(chainage, chainage, value));
}
// 터파기 토질이 함께 오면 **그 갈래로 담는다** — B08 이 이미 판정한 값을 이어받는 것이라
// 새 근거를 만드는 것이 아니다. 안 오면 갈래 없이 담겨 「지반 모름」으로 남는다.
const bucket = groundBucket(point?.ground_type ?? point?.ground ?? point?.ground_label);
const target = covering ?? newSpoilResidual(chainage, chainage, 0);
if (!covering) residuals.push(target);
target.volume_m3 += value;
if (bucket) target[bucket] += value;
added += value;
}
return added;
@@ -487,7 +510,16 @@ export function computeHaulPlan(
collected_stone_deduction_m3?: number | null;
structure_spoil_m3?: number | null;
/** 측점별 구조물 잔토 — 오면 **이쪽이 이긴다**(그 자리 잔량에 얹어 운반거리를 맞춘다). */
structure_spoil_points?: Array<{ chainage_m: number; spoil_m3: number }> | null;
structure_spoil_points?: Array<{
chainage_m: number;
spoil_m3: number;
/** 그 터파기의 토질 — B08 이 `design.ground_type` 으로 이미 판정한 값(품셈 9-13 3구분).
* **새 근거를 만드는 것이 아니라 이어받는 것**이다. 섞여서 못 고른 구조물은 `null` 로
* 오고, 그 몫은 「지반 모름」(`ground_unknown_m3`)으로 남는다. */
ground_type?: string | null;
ground_label?: string | null;
ground?: string | null;
}> | null;
},
): HaulPlan | null {
const points = result.points;