From 39ee71cc80eaa2bf8669f6a6b3234983b7d60acd Mon Sep 17 00:00:00 2001 From: javamon1174 Date: Thu, 26 Mar 2026 16:13:07 +0900 Subject: [PATCH] =?UTF-8?q?=EC=82=AC=EC=9D=B4=ED=8A=B8=20=EB=A9=94?= =?UTF-8?q?=EB=89=B4=20CRUD=EB=A5=BC=20/bag/*=20=EA=B2=BD=EB=A1=9C?= =?UTF-8?q?=EB=A1=9C=20=ED=86=B5=ED=95=A9=20=E2=80=94=20=EA=B4=80=EB=A6=AC?= =?UTF-8?q?=EC=9E=90=20=EB=A0=88=EC=9D=B4=EC=95=84=EC=9B=83=20=ED=98=BC?= =?UTF-8?q?=EC=9A=A9=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Bag 컨트롤러에 create/store 메서드 추가 (불출/발주/입고/판매/주문) - bag용 create 뷰 5개 생성 (form action을 /bag/*로 변경) - 모든 등록/취소 버튼을 /admin/* → /bag/*로 변경 - 사이트 레이아웃이 CRUD 전체에서 유지됨 - playwright.production.config.js 추가 (도메인 테스트용) Co-Authored-By: Claude Opus 4.6 (1M context) --- app/Config/Routes.php | 13 +++ app/Controllers/Bag.php | 121 +++++++++++++++++++++++++ app/Views/bag/create_bag_issue.php | 70 ++++++++++++++ app/Views/bag/create_bag_order.php | 83 +++++++++++++++++ app/Views/bag/create_bag_receiving.php | 53 +++++++++++ app/Views/bag/create_bag_sale.php | 56 ++++++++++++ app/Views/bag/create_shop_order.php | 74 +++++++++++++++ app/Views/bag/issue.php | 4 +- app/Views/bag/purchase_inbound.php | 8 +- app/Views/bag/sales.php | 4 +- playwright.production.config.js | 22 +++++ 11 files changed, 500 insertions(+), 8 deletions(-) create mode 100644 app/Views/bag/create_bag_issue.php create mode 100644 app/Views/bag/create_bag_order.php create mode 100644 app/Views/bag/create_bag_receiving.php create mode 100644 app/Views/bag/create_bag_sale.php create mode 100644 app/Views/bag/create_shop_order.php create mode 100644 playwright.production.config.js diff --git a/app/Config/Routes.php b/app/Config/Routes.php index a39fb77..6f6538e 100644 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -27,6 +27,19 @@ $routes->get('bag/analytics', 'Bag::analytics'); $routes->get('bag/window', 'Bag::window'); $routes->get('bag/help', 'Bag::help'); +// 사이트 메뉴 CRUD (사이트 레이아웃) +$routes->get('bag/issue/create', 'Bag::issueCreate'); +$routes->post('bag/issue/store', 'Bag::issueStore'); +$routes->post('bag/issue/cancel/(:num)', 'Bag::issueCancel/$1'); +$routes->get('bag/order/create', 'Bag::orderCreate'); +$routes->post('bag/order/store', 'Bag::orderStore'); +$routes->get('bag/receiving/create', 'Bag::receivingCreate'); +$routes->post('bag/receiving/store', 'Bag::receivingStore'); +$routes->get('bag/sale/create', 'Bag::saleCreate'); +$routes->post('bag/sale/store', 'Bag::saleStore'); +$routes->get('bag/shop-order/create', 'Bag::shopOrderCreate'); +$routes->post('bag/shop-order/store', 'Bag::shopOrderStore'); + // Auth $routes->get('login', 'Auth::showLoginForm'); $routes->post('login', 'Auth::login'); diff --git a/app/Controllers/Bag.php b/app/Controllers/Bag.php index 88a26b0..f6bee95 100644 --- a/app/Controllers/Bag.php +++ b/app/Controllers/Bag.php @@ -17,6 +17,7 @@ use App\Models\CompanyModel; use App\Models\PackagingUnitModel; use App\Models\SalesAgencyModel; use App\Models\ShopOrderModel; +use App\Models\DesignatedShopModel; class Bag extends BaseController { @@ -247,4 +248,124 @@ class Bag extends BaseController { return $this->render('도움말', 'bag/help', []); } + + // ══════════════════════════════════════════════ + // CRUD — 사이트 레이아웃으로 등록/처리 폼 제공 + // ══════════════════════════════════════════════ + + // --- 불출 등록 --- + public function issueCreate(): string + { + $kind = model(CodeKindModel::class)->where('ck_code', 'O')->first(); + $bagCodes = $kind ? model(CodeDetailModel::class)->where('cd_ck_idx', $kind->ck_idx)->where('cd_state', 1)->orderBy('cd_sort')->findAll() : []; + return $this->render('불출 처리', 'bag/create_bag_issue', compact('bagCodes')); + } + + public function issueStore() + { + $admin = new \App\Controllers\Admin\BagIssue(); + $admin->initController($this->request, $this->response, service('logger')); + $result = $admin->store(); + if ($result instanceof \CodeIgniter\HTTP\RedirectResponse) { + $to = (string) $result->getHeaderLine('Location'); + $to = str_replace('/admin/bag-issues', '/bag/issue', $to); + return redirect()->to($to)->with('success', session()->getFlashdata('success'))->with('errors', session()->getFlashdata('errors')); + } + return redirect()->to(site_url('bag/issue'))->with('success', '불출 처리되었습니다.'); + } + + public function issueCancel(int $id) + { + $admin = new \App\Controllers\Admin\BagIssue(); + $admin->initController($this->request, $this->response, service('logger')); + $admin->cancel($id); + return redirect()->to(site_url('bag/issue'))->with('success', session()->getFlashdata('success') ?? '취소되었습니다.'); + } + + // --- 발주 등록 --- + public function orderCreate(): string + { + helper('admin'); + $lgIdx = $this->lgIdx(); + $companies = $lgIdx ? model(CompanyModel::class)->where('cp_lg_idx', $lgIdx)->where('cp_type', 'manufacturer')->where('cp_state', 1)->findAll() : []; + $agencies = $lgIdx ? model(SalesAgencyModel::class)->where('sa_lg_idx', $lgIdx)->where('sa_state', 1)->findAll() : []; + $kind = model(CodeKindModel::class)->where('ck_code', 'O')->first(); + $bagCodes = $kind ? model(CodeDetailModel::class)->where('cd_ck_idx', $kind->ck_idx)->where('cd_state', 1)->orderBy('cd_sort')->findAll() : []; + return $this->render('발주 등록', 'bag/create_bag_order', compact('companies', 'agencies', 'bagCodes')); + } + + public function orderStore() + { + $admin = new \App\Controllers\Admin\BagOrder(); + $admin->initController($this->request, $this->response, service('logger')); + $result = $admin->store(); + if ($result instanceof \CodeIgniter\HTTP\RedirectResponse) { + return redirect()->to(site_url('bag/purchase-inbound'))->with('success', session()->getFlashdata('success'))->with('errors', session()->getFlashdata('errors')); + } + return redirect()->to(site_url('bag/purchase-inbound'))->with('success', '발주 등록되었습니다.'); + } + + // --- 입고 처리 --- + public function receivingCreate(): string + { + helper('admin'); + $lgIdx = $this->lgIdx(); + $orders = $lgIdx ? model(BagOrderModel::class)->where('bo_lg_idx', $lgIdx)->where('bo_status', 'normal')->orderBy('bo_order_date', 'DESC')->findAll() : []; + return $this->render('입고 처리', 'bag/create_bag_receiving', compact('orders')); + } + + public function receivingStore() + { + $admin = new \App\Controllers\Admin\BagReceiving(); + $admin->initController($this->request, $this->response, service('logger')); + $result = $admin->store(); + if ($result instanceof \CodeIgniter\HTTP\RedirectResponse) { + return redirect()->to(site_url('bag/purchase-inbound'))->with('success', session()->getFlashdata('success'))->with('errors', session()->getFlashdata('errors')); + } + return redirect()->to(site_url('bag/purchase-inbound'))->with('success', '입고 처리되었습니다.'); + } + + // --- 판매 등록 --- + public function saleCreate(): string + { + helper('admin'); + $lgIdx = $this->lgIdx(); + $shops = $lgIdx ? model(DesignatedShopModel::class)->where('ds_lg_idx', $lgIdx)->where('ds_state', 1)->findAll() : []; + $kind = model(CodeKindModel::class)->where('ck_code', 'O')->first(); + $bagCodes = $kind ? model(CodeDetailModel::class)->where('cd_ck_idx', $kind->ck_idx)->where('cd_state', 1)->orderBy('cd_sort')->findAll() : []; + return $this->render('판매 등록', 'bag/create_bag_sale', compact('shops', 'bagCodes')); + } + + public function saleStore() + { + $admin = new \App\Controllers\Admin\BagSale(); + $admin->initController($this->request, $this->response, service('logger')); + $result = $admin->store(); + if ($result instanceof \CodeIgniter\HTTP\RedirectResponse) { + return redirect()->to(site_url('bag/sales'))->with('success', session()->getFlashdata('success'))->with('errors', session()->getFlashdata('errors')); + } + return redirect()->to(site_url('bag/sales'))->with('success', '판매 등록되었습니다.'); + } + + // --- 주문 접수 --- + public function shopOrderCreate(): string + { + helper('admin'); + $lgIdx = $this->lgIdx(); + $shops = $lgIdx ? model(DesignatedShopModel::class)->where('ds_lg_idx', $lgIdx)->where('ds_state', 1)->findAll() : []; + $kind = model(CodeKindModel::class)->where('ck_code', 'O')->first(); + $bagCodes = $kind ? model(CodeDetailModel::class)->where('cd_ck_idx', $kind->ck_idx)->where('cd_state', 1)->orderBy('cd_sort')->findAll() : []; + return $this->render('주문 접수', 'bag/create_shop_order', compact('shops', 'bagCodes')); + } + + public function shopOrderStore() + { + $admin = new \App\Controllers\Admin\ShopOrder(); + $admin->initController($this->request, $this->response, service('logger')); + $result = $admin->store(); + if ($result instanceof \CodeIgniter\HTTP\RedirectResponse) { + return redirect()->to(site_url('bag/sales'))->with('success', session()->getFlashdata('success'))->with('errors', session()->getFlashdata('errors')); + } + return redirect()->to(site_url('bag/sales'))->with('success', '주문 접수되었습니다.'); + } } diff --git a/app/Views/bag/create_bag_issue.php b/app/Views/bag/create_bag_issue.php new file mode 100644 index 0000000..91ea400 --- /dev/null +++ b/app/Views/bag/create_bag_issue.php @@ -0,0 +1,70 @@ +
+ 무료용 불출 처리 +
+
+
+ + +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + 취소 +
+
+
diff --git a/app/Views/bag/create_bag_order.php b/app/Views/bag/create_bag_order.php new file mode 100644 index 0000000..8125ffb --- /dev/null +++ b/app/Views/bag/create_bag_order.php @@ -0,0 +1,83 @@ +
+ 발주 등록 +
+
+
+ + +
+ + +
+ +
+ + + % +
+ +
+ + +
+ +
+ + +
+ +
+ +
+ + + + + + + + + + + + + + + + + +
순번봉투박스수
+ + + +
+
+
+ +
+ + 취소 +
+
+
diff --git a/app/Views/bag/create_bag_receiving.php b/app/Views/bag/create_bag_receiving.php new file mode 100644 index 0000000..c80f00f --- /dev/null +++ b/app/Views/bag/create_bag_receiving.php @@ -0,0 +1,53 @@ +
+ 입고 처리 +
+
+
+ + +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + 취소 +
+
+
diff --git a/app/Views/bag/create_bag_sale.php b/app/Views/bag/create_bag_sale.php new file mode 100644 index 0000000..3193633 --- /dev/null +++ b/app/Views/bag/create_bag_sale.php @@ -0,0 +1,56 @@ +
+ 판매 등록 +
+
+
+ + +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + 취소 +
+
+
diff --git a/app/Views/bag/create_shop_order.php b/app/Views/bag/create_shop_order.php new file mode 100644 index 0000000..6e145c7 --- /dev/null +++ b/app/Views/bag/create_shop_order.php @@ -0,0 +1,74 @@ +
+ 주문 접수 +
+
+
+ + +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ +
+ + + + + + + + + + + + + + + + + +
순번봉투수량
+ + + +
+
+
+ +
+ + 취소 +
+
+
diff --git a/app/Views/bag/issue.php b/app/Views/bag/issue.php index 787eeef..292b069 100644 --- a/app/Views/bag/issue.php +++ b/app/Views/bag/issue.php @@ -8,7 +8,7 @@ 초기화 - 불출 처리 + 불출 처리 @@ -36,7 +36,7 @@
bi2_status ?? '') === 'normal'): ?> -
+
diff --git a/app/Views/bag/purchase_inbound.php b/app/Views/bag/purchase_inbound.php index 10d31df..e6fa18a 100644 --- a/app/Views/bag/purchase_inbound.php +++ b/app/Views/bag/purchase_inbound.php @@ -13,7 +13,7 @@

발주 현황

- 발주 등록 + 발주 등록
@@ -37,9 +37,9 @@ ?>
- 상세 + 상세 bo_status ?? '') === 'normal'): ?> -
+
@@ -58,7 +58,7 @@

입고 현황

- 입고 처리 + 입고 처리
diff --git a/app/Views/bag/sales.php b/app/Views/bag/sales.php index ec48e62..39ae55e 100644 --- a/app/Views/bag/sales.php +++ b/app/Views/bag/sales.php @@ -12,7 +12,7 @@

주문 접수

- 주문 등록 + 주문 등록
@@ -47,7 +47,7 @@

판매/반품

- 판매 등록 + 판매 등록
diff --git a/playwright.production.config.js b/playwright.production.config.js new file mode 100644 index 0000000..57cc4fb --- /dev/null +++ b/playwright.production.config.js @@ -0,0 +1,22 @@ +// @ts-check +const { defineConfig } = require('@playwright/test'); + +module.exports = defineConfig({ + testDir: './e2e', + fullyParallel: false, + workers: 1, + timeout: 60000, + reporter: 'list', + use: { + baseURL: 'https://trash.wxn.co.kr', + ignoreHTTPSErrors: true, + screenshot: 'only-on-failure', + locale: 'ko-KR', + }, + projects: [ + { + name: 'chromium', + use: { browserName: 'chromium' }, + }, + ], +});