auto: 2026-09-02 19:08 (EOMSANGDON-HOME)

This commit is contained in:
2026-09-02 19:08:55 +09:00
parent f0dd4b08ef
commit 94883733d5
2 changed files with 84 additions and 2 deletions
+27 -1
View File
@@ -120,6 +120,8 @@ async def _title_block_fields(project_id: UUID) -> dict[str, str]:
사람 배정(과업책임자·분야별책임자·설계자)은 `projects`의 FK를 따라간다. 설계자는
배정이 없으면 프로젝트 소유자로 떨어진다 — 혼자 쓰는 계정에서도 칸이 차게.
**이름이 들어가는 자리는 서명도 받는다**(2026-09-02 사용자 확정) — 세 사람 모두
자기 계정의 `SIGNATURE` 자산을 따라가고, 안 올린 사람 자리는 그림째 빠진다.
로고·서명은 회사 공유 자산(`company_assets`, 013)에서 오되 **원천이 다르다**
(2026-09-02 사용자 확정, B01 인계). 서명은 프로젝트가 아니라 **사람 계정**에 붙으므로
설계자(`designer_user_id`, 없으면 소유자) 계정의 `SIGNATURE` 자산을 따라간다. 로고는
@@ -141,7 +143,7 @@ async def _title_block_fields(project_id: UUID) -> dict[str, str]:
SELECT p.name, p.region, p.client_org, p.project_number, p.work_amount,
p.design_date, c.name, logo.file_path,
COALESCE(designer.name, owner.name), sig.file_path,
pm.name, lead.name
pm.name, lead.name, pm_sig.file_path, lead_sig.file_path
FROM projects p
LEFT JOIN companies c ON c.id = p.company_id
LEFT JOIN users owner ON owner.id = p.user_id
@@ -161,6 +163,26 @@ async def _title_block_fields(project_id: UUID) -> dict[str, str]:
ORDER BY s.id DESC
LIMIT 1
)
LEFT JOIN company_assets pm_sig
ON pm_sig.id = (
SELECT s.id
FROM company_assets s
WHERE s.user_id = p.pm_user_id
AND s.kind = 'SIGNATURE'
AND s.deleted_at IS NULL
ORDER BY s.id DESC
LIMIT 1
)
LEFT JOIN company_assets lead_sig
ON lead_sig.id = (
SELECT s.id
FROM company_assets s
WHERE s.user_id = p.field_lead_user_id
AND s.kind = 'SIGNATURE'
AND s.deleted_at IS NULL
ORDER BY s.id DESC
LIMIT 1
)
WHERE p.id = %s AND p.deleted_at IS NULL
""",
(str(project_id),),
@@ -181,6 +203,8 @@ async def _title_block_fields(project_id: UUID) -> dict[str, str]:
signature_path,
pm,
lead,
pm_signature_path,
lead_signature_path,
) = row
fields = {
"공사명": name,
@@ -196,6 +220,8 @@ async def _title_block_fields(project_id: UUID) -> dict[str, str]:
"분야별책임자": lead,
"회사로고": _asset_data_url(logo_path),
"설계자서명": _asset_data_url(signature_path),
"과업책임자서명": _asset_data_url(pm_signature_path),
"분야별책임자서명": _asset_data_url(lead_signature_path),
}
return {key: str(value) for key, value in fields.items() if value}
@@ -1277,6 +1277,62 @@
],
"imageData": "{{설계자서명}}"
}
},
{
"id": "335bfca6-01e8-50a9-bd3d-367bc1f78e7d",
"type": "Image",
"lineColor": "#f5f7fa",
"lineWidth": 1,
"layerId": "-00.기본BOX TEXT",
"shapeData": {
"points": [
{
"x": 536.89,
"y": 17.5
},
{
"x": 578.89,
"y": 17.5
},
{
"x": 578.89,
"y": 25.5
},
{
"x": 536.89,
"y": 25.5
}
],
"imageData": "{{과업책임자서명}}"
}
},
{
"id": "d404c499-15dc-528f-a3bd-821cefa41961",
"type": "Image",
"lineColor": "#f5f7fa",
"lineWidth": 1,
"layerId": "-00.기본BOX TEXT",
"shapeData": {
"points": [
{
"x": 587.91,
"y": 17.5
},
{
"x": 629.91,
"y": 17.5
},
{
"x": 629.91,
"y": 25.5
},
{
"x": 587.91,
"y": 25.5
}
],
"imageData": "{{분야별책임자서명}}"
}
}
],
"layers": [