P2-15~18, P5-04~11, CT-05~06 웹 미구현 기능 전체 구현
P2-15: 지정판매소 다조건 조회 (이름/구군/상태 필터) P2-17: 지정판매소 지도 표시 (Kakao Maps) P2-18: 지정판매소 현황 (연도별 신규/취소 통계) P5-04: 년 판매 현황 (월별 피벗 테이블) P5-05: 지정판매소별 판매현황 (판매소별 수량/금액) P5-06: 홈택스 세금계산서 엑셀 내보내기 P5-08: 반품/파기 현황 (기간별 조회) P5-10: LOT 수불 조회 (LOT 번호 검색) P5-11: 기타 입출고 (등록 + 재고 연동) CT-05: CRUD 로깅 (activity_log 테이블 + audit_helper) CT-06: 대시보드 실 데이터 (발주/판매/재고/불출 통계) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -43,10 +43,24 @@ class DesignatedShop extends BaseController
|
||||
->with('error', '작업할 지자체가 선택되지 않았습니다. 지자체를 선택해 주세요.');
|
||||
}
|
||||
|
||||
$list = $this->shopModel
|
||||
->where('ds_lg_idx', $lgIdx)
|
||||
->orderBy('ds_idx', 'DESC')
|
||||
->paginate(20);
|
||||
$builder = $this->shopModel->where('ds_lg_idx', $lgIdx);
|
||||
|
||||
// 다조건 검색 (P2-15)
|
||||
$dsName = $this->request->getGet('ds_name');
|
||||
$dsGugunCode = $this->request->getGet('ds_gugun_code');
|
||||
$dsState = $this->request->getGet('ds_state');
|
||||
|
||||
if ($dsName !== null && $dsName !== '') {
|
||||
$builder->like('ds_name', $dsName);
|
||||
}
|
||||
if ($dsGugunCode !== null && $dsGugunCode !== '') {
|
||||
$builder->where('ds_gugun_code', $dsGugunCode);
|
||||
}
|
||||
if ($dsState !== null && $dsState !== '') {
|
||||
$builder->where('ds_state', (int) $dsState);
|
||||
}
|
||||
|
||||
$list = $builder->orderBy('ds_idx', 'DESC')->paginate(20);
|
||||
$pager = $this->shopModel->pager;
|
||||
|
||||
// 지자체 이름 매핑용
|
||||
@@ -55,12 +69,20 @@ class DesignatedShop extends BaseController
|
||||
$lgMap[$lg->lg_idx] = $lg->lg_name;
|
||||
}
|
||||
|
||||
// 구군코드 목록 (검색 필터용)
|
||||
$db = \Config\Database::connect();
|
||||
$gugunCodes = $db->query("SELECT DISTINCT ds_gugun_code FROM designated_shop WHERE ds_lg_idx = ? AND ds_gugun_code != '' ORDER BY ds_gugun_code", [$lgIdx])->getResult();
|
||||
|
||||
return view('admin/layout', [
|
||||
'title' => '지정판매소 관리',
|
||||
'content' => view('admin/designated_shop/index', [
|
||||
'list' => $list,
|
||||
'lgMap' => $lgMap,
|
||||
'pager' => $pager,
|
||||
'list' => $list,
|
||||
'lgMap' => $lgMap,
|
||||
'pager' => $pager,
|
||||
'dsName' => $dsName ?? '',
|
||||
'dsGugunCode' => $dsGugunCode ?? '',
|
||||
'dsState' => $dsState ?? '',
|
||||
'gugunCodes' => $gugunCodes,
|
||||
]),
|
||||
]);
|
||||
}
|
||||
@@ -317,6 +339,78 @@ class DesignatedShop extends BaseController
|
||||
->with('success', '지정판매소가 삭제되었습니다.');
|
||||
}
|
||||
|
||||
/**
|
||||
* P2-17: 지정판매소 지도 표시
|
||||
*/
|
||||
public function map()
|
||||
{
|
||||
helper('admin');
|
||||
$lgIdx = admin_effective_lg_idx();
|
||||
if ($lgIdx === null || $lgIdx <= 0) {
|
||||
return redirect()->to(site_url('admin'))
|
||||
->with('error', '작업할 지자체가 선택되지 않았습니다.');
|
||||
}
|
||||
|
||||
$shops = $this->shopModel
|
||||
->where('ds_lg_idx', $lgIdx)
|
||||
->where('ds_state', 1)
|
||||
->findAll();
|
||||
|
||||
return view('admin/layout', [
|
||||
'title' => '지정판매소 지도',
|
||||
'content' => view('admin/designated_shop/map', [
|
||||
'shops' => $shops,
|
||||
]),
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* P2-18: 지정판매소 현황 (연도별 신규/취소)
|
||||
*/
|
||||
public function status()
|
||||
{
|
||||
helper('admin');
|
||||
$lgIdx = admin_effective_lg_idx();
|
||||
if ($lgIdx === null || $lgIdx <= 0) {
|
||||
return redirect()->to(site_url('admin'))
|
||||
->with('error', '작업할 지자체가 선택되지 않았습니다.');
|
||||
}
|
||||
|
||||
$db = \Config\Database::connect();
|
||||
|
||||
// 연도별 신규등록 건수 (ds_designated_at 기준)
|
||||
$newByYear = $db->query("
|
||||
SELECT YEAR(ds_designated_at) as yr, COUNT(*) as cnt
|
||||
FROM designated_shop
|
||||
WHERE ds_lg_idx = ? AND ds_designated_at IS NOT NULL
|
||||
GROUP BY YEAR(ds_designated_at)
|
||||
ORDER BY yr DESC
|
||||
", [$lgIdx])->getResult();
|
||||
|
||||
// 연도별 취소/비활성 건수 (ds_state != 1, ds_regdate 기준)
|
||||
$cancelByYear = $db->query("
|
||||
SELECT YEAR(ds_regdate) as yr, COUNT(*) as cnt
|
||||
FROM designated_shop
|
||||
WHERE ds_lg_idx = ? AND ds_state != 1
|
||||
GROUP BY YEAR(ds_regdate)
|
||||
ORDER BY yr DESC
|
||||
", [$lgIdx])->getResult();
|
||||
|
||||
// 전체 현황 합계
|
||||
$totalActive = $this->shopModel->where('ds_lg_idx', $lgIdx)->where('ds_state', 1)->countAllResults(false);
|
||||
$totalInactive = $this->shopModel->where('ds_lg_idx', $lgIdx)->where('ds_state !=', 1)->countAllResults(false);
|
||||
|
||||
return view('admin/layout', [
|
||||
'title' => '지정판매소 현황',
|
||||
'content' => view('admin/designated_shop/status', [
|
||||
'newByYear' => $newByYear,
|
||||
'cancelByYear' => $cancelByYear,
|
||||
'totalActive' => $totalActive,
|
||||
'totalInactive' => $totalInactive,
|
||||
]),
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 지자체별 다음 판매소번호 생성 (lg_code + 3자리 일련번호)
|
||||
* 문서: docs/기본 개발계획/22-판매소번호_일련번호_결정.md §3
|
||||
|
||||
Reference in New Issue
Block a user