feat: Add sales order bulk upload functionality
- Introduced a new controller for handling bulk uploads of sales orders via Excel, allowing users to efficiently manage large volumes of sales data. - Implemented validation to ensure required fields are present and provided appropriate error messages for missing data. - Enhanced the service layer to support item creation and master data management during the upload process. - Updated routes to include a new endpoint for the bulk upload feature, ensuring secure access through token authentication. These changes aim to streamline the sales order management process and improve user experience when handling bulk data uploads.
This commit is contained in:
@@ -1185,12 +1185,15 @@ export async function editTableData(
|
||||
if (companyCode !== "*") {
|
||||
const hasCompanyCodeColumn = await tableManagementService.hasColumn(tableName, "company_code");
|
||||
if (hasCompanyCodeColumn) {
|
||||
// 1. 원본 데이터의 company_code 확인
|
||||
if (originalData?.id) {
|
||||
// 1. 원본 데이터의 company_code 확인 (id exact match 필수)
|
||||
if (originalData?.id !== undefined && originalData?.id !== null && originalData?.id !== "") {
|
||||
try {
|
||||
// ⚠️ 기존 search: { id: String(id) } 는 내부에서 ILIKE '%id%' 부분일치로 변환되어
|
||||
// 다른 회사의 id (예: 116 검색 시 1116, 1160 등)가 매칭되어 cross-company 오탐 발생.
|
||||
// 반드시 operator:equals 를 명시하여 정확 일치 조회할 것.
|
||||
const existing = await tableManagementService.getTableData(tableName, {
|
||||
page: 1, size: 1,
|
||||
search: { id: String(originalData.id) },
|
||||
search: { id: { value: String(originalData.id), operator: "equals" } },
|
||||
});
|
||||
const existingRow = existing.data?.[0];
|
||||
if (existingRow && existingRow.company_code && existingRow.company_code !== companyCode && existingRow.company_code !== "*") {
|
||||
|
||||
Reference in New Issue
Block a user