[agent-pipeline] pipe-20260328153638-axu2 round-1
This commit is contained in:
@@ -27,16 +27,16 @@ public class AdminController {
|
||||
*/
|
||||
@GetMapping("/menus")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getAdminMenus(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("role") String role,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("userType", role);
|
||||
params.put("userId", userId);
|
||||
params.putIfAbsent("userLang", "ko");
|
||||
params.put("isManagementScreen",
|
||||
params.get("menuType") == null || "true".equals(params.get("includeInactive")));
|
||||
params.put("company_code", companyCode);
|
||||
params.put("user_type", role);
|
||||
params.put("user_id", userId);
|
||||
params.putIfAbsent("user_lang", "ko");
|
||||
params.put("is_management_screen",
|
||||
params.get("menu_type") == null || "true".equals(params.get("include_inactive")));
|
||||
return ResponseEntity.ok(ApiResponse.success(adminService.getAdminMenuList(params), "관리자 메뉴 목록 조회 성공"));
|
||||
}
|
||||
|
||||
@@ -46,14 +46,14 @@ public class AdminController {
|
||||
*/
|
||||
@GetMapping("/user-menus")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getUserMenus(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("role") String role,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("userType", role);
|
||||
params.put("userId", userId);
|
||||
params.putIfAbsent("userLang", "ko");
|
||||
params.put("company_code", companyCode);
|
||||
params.put("user_type", role);
|
||||
params.put("user_id", userId);
|
||||
params.putIfAbsent("user_lang", "ko");
|
||||
return ResponseEntity.ok(ApiResponse.success(adminService.getUserMenuList(params), "사용자 메뉴 목록 조회 성공"));
|
||||
}
|
||||
|
||||
@@ -63,11 +63,11 @@ public class AdminController {
|
||||
*/
|
||||
@GetMapping("/pop-menus")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getPopMenus(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("role") String role) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("userType", role);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("user_type", role);
|
||||
return ResponseEntity.ok(ApiResponse.success(adminService.getPopMenuList(params), "POP 메뉴 목록 조회 성공"));
|
||||
}
|
||||
|
||||
@@ -90,9 +90,9 @@ public class AdminController {
|
||||
*/
|
||||
@PostMapping("/menus")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> saveMenu(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(adminService.saveMenu(body), "메뉴 등록 성공"));
|
||||
}
|
||||
|
||||
@@ -133,7 +133,7 @@ public class AdminController {
|
||||
@DeleteMapping("/menus/batch")
|
||||
public ResponseEntity<ApiResponse<Void>> deleteMenusBatch(@RequestBody Map<String, Object> body) {
|
||||
@SuppressWarnings("unchecked")
|
||||
List<String> menuIds = (List<String>) body.get("menuIds");
|
||||
List<String> menuIds = (List<String>) body.get("menu_ids");
|
||||
if (menuIds != null) {
|
||||
menuIds.forEach(adminService::deleteMenu);
|
||||
}
|
||||
@@ -148,14 +148,14 @@ public class AdminController {
|
||||
*/
|
||||
@GetMapping("/users")
|
||||
public ResponseEntity<?> getUserList(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("role") String role,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
// SUPER_ADMIN이 아닌 경우 자사 필터 적용
|
||||
if (!"SUPER_ADMIN".equals(role)) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
} else {
|
||||
params.put("companyCode", "*");
|
||||
params.put("company_code", "*");
|
||||
}
|
||||
params.putIfAbsent("page", "1");
|
||||
params.putIfAbsent("limit", "20");
|
||||
@@ -199,11 +199,11 @@ public class AdminController {
|
||||
*/
|
||||
@GetMapping("/users/{userId}/with-dept")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getUserWithDept(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String userId) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("userId", userId);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("user_id", userId);
|
||||
Map<String, Object> result = adminService.getUserWithDept(params);
|
||||
if (result == null) {
|
||||
return ResponseEntity.status(404).body(ApiResponse.error("사용자를 찾을 수 없습니다."));
|
||||
@@ -217,9 +217,9 @@ public class AdminController {
|
||||
*/
|
||||
@PostMapping("/users/with-dept")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> saveUserWithDept(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(adminService.saveUserWithDept(body)));
|
||||
}
|
||||
|
||||
@@ -229,9 +229,9 @@ public class AdminController {
|
||||
*/
|
||||
@PostMapping("/users")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> saveUser(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(adminService.saveUser(body), "사용자 저장 성공"));
|
||||
}
|
||||
|
||||
@@ -242,10 +242,10 @@ public class AdminController {
|
||||
@PutMapping("/users/{userId}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> updateUser(
|
||||
@PathVariable String userId,
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("userId", userId);
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("user_id", userId);
|
||||
body.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(adminService.saveUser(body), "사용자 수정 성공"));
|
||||
}
|
||||
|
||||
@@ -268,7 +268,7 @@ public class AdminController {
|
||||
*/
|
||||
@PostMapping("/users/reset-password")
|
||||
public ResponseEntity<ApiResponse<Void>> resetUserPassword(@RequestBody Map<String, Object> body) {
|
||||
String userId = (String) body.get("userId");
|
||||
String userId = (String) body.get("user_id");
|
||||
adminService.resetUserPassword(userId);
|
||||
return ResponseEntity.ok(ApiResponse.success(null, "비밀번호 초기화 성공"));
|
||||
}
|
||||
@@ -280,10 +280,10 @@ public class AdminController {
|
||||
@PostMapping("/users/check-duplicate")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> checkDuplicateUserId(
|
||||
@RequestBody Map<String, Object> body) {
|
||||
String userId = (String) body.get("userId");
|
||||
String userId = (String) body.get("user_id");
|
||||
Map<String, Object> existing = adminService.getUserInfo(userId);
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("isDuplicate", existing != null);
|
||||
result.put("is_duplicate", existing != null);
|
||||
return ResponseEntity.ok(ApiResponse.success(result, "아이디 중복 확인 완료"));
|
||||
}
|
||||
|
||||
@@ -295,9 +295,9 @@ public class AdminController {
|
||||
*/
|
||||
@PutMapping("/profile")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> updateProfile(
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("userId", userId);
|
||||
body.put("user_id", userId);
|
||||
return ResponseEntity.ok(ApiResponse.success(adminService.saveUser(body), "프로필 수정 성공"));
|
||||
}
|
||||
|
||||
@@ -309,23 +309,23 @@ public class AdminController {
|
||||
*/
|
||||
@GetMapping("/departments")
|
||||
public ResponseEntity<?> getDepartmentList(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
Map<String, Object> serviceResult = adminService.getDepartmentList(params);
|
||||
|
||||
int total = ((Number) serviceResult.get("total")).intValue();
|
||||
|
||||
Map<String, Object> data = new HashMap<>();
|
||||
data.put("departments", serviceResult.get("departments"));
|
||||
data.put("flatList", serviceResult.get("flatList"));
|
||||
data.put("flat_list", serviceResult.get("flat_list"));
|
||||
|
||||
Map<String, Object> response = new HashMap<>();
|
||||
response.put("success", true);
|
||||
response.put("data", data);
|
||||
response.put("message", "부서 목록 조회 성공");
|
||||
response.put("total", total);
|
||||
response.put("totalCount", total);
|
||||
response.put("total_count", total);
|
||||
return ResponseEntity.ok(response);
|
||||
}
|
||||
|
||||
@@ -402,7 +402,7 @@ public class AdminController {
|
||||
*/
|
||||
@GetMapping("/user-locale")
|
||||
public ResponseEntity<ApiResponse<Object>> getUserLocale(
|
||||
@RequestAttribute("userId") String userId) {
|
||||
@RequestAttribute("user_id") String userId) {
|
||||
Map<String, Object> row = adminService.getUserLocale(userId);
|
||||
Object locale = row.getOrDefault("locale", "KR");
|
||||
return ResponseEntity.ok(ApiResponse.success(locale, "사용자 로케일 조회 성공"));
|
||||
@@ -414,7 +414,7 @@ public class AdminController {
|
||||
*/
|
||||
@PostMapping("/user-locale")
|
||||
public ResponseEntity<ApiResponse<Object>> setUserLocale(
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
String locale = (String) body.get("locale");
|
||||
if (locale == null || locale.isBlank()) {
|
||||
|
||||
@@ -21,7 +21,7 @@ public class AiAssistantProxyController {
|
||||
@GetMapping("/api/ai/v1/status")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getStatus() {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("serviceUrl", "http://127.0.0.1:3100");
|
||||
result.put("service_url", "http://127.0.0.1:3100");
|
||||
result.put("status", "ok");
|
||||
result.put("message", "AI 어시스턴트 프록시 서비스가 구성되었습니다.");
|
||||
return ResponseEntity.ok(ApiResponse.success(result));
|
||||
|
||||
@@ -19,49 +19,49 @@ public class AnalyticsReportController {
|
||||
|
||||
@GetMapping("/production/data")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getProductionReportData(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(analyticsReportService.getProductionReportData(params)));
|
||||
}
|
||||
|
||||
@GetMapping("/inventory/data")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getInventoryReportData(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(analyticsReportService.getInventoryReportData(params)));
|
||||
}
|
||||
|
||||
@GetMapping("/purchase/data")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getPurchaseReportData(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(analyticsReportService.getPurchaseReportData(params)));
|
||||
}
|
||||
|
||||
@GetMapping("/quality/data")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getQualityReportData(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(analyticsReportService.getQualityReportData(params)));
|
||||
}
|
||||
|
||||
@GetMapping("/equipment/data")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getEquipmentReportData(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(analyticsReportService.getEquipmentReportData(params)));
|
||||
}
|
||||
|
||||
@GetMapping("/mold/data")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getMoldReportData(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(analyticsReportService.getMoldReportData(params)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,19 +27,19 @@ public class ApprovalController {
|
||||
@GetMapping("/definitions")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getDefinitions(
|
||||
@RequestParam Map<String, Object> params,
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
params.put("companyCode", companyCode);
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(approvalService.getDefinitions(params)));
|
||||
}
|
||||
|
||||
@GetMapping("/definitions/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getDefinition(
|
||||
@PathVariable Long id,
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
try {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("definitionId", id);
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("definition_id", id);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(approvalService.getDefinition(params)));
|
||||
} catch (IllegalArgumentException e) {
|
||||
return ResponseEntity.status(404).body(ApiResponse.error(e.getMessage()));
|
||||
@@ -49,12 +49,12 @@ public class ApprovalController {
|
||||
@PostMapping("/definitions")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> createDefinition(
|
||||
@RequestBody Map<String, Object> body,
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId) {
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId) {
|
||||
if (body.get("definition_name") == null)
|
||||
return ResponseEntity.status(400).body(ApiResponse.error("결재 유형명은 필수입니다."));
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("userId", userId);
|
||||
body.put("company_code", companyCode);
|
||||
body.put("user_id", userId);
|
||||
try {
|
||||
return ResponseEntity.status(HttpStatus.CREATED)
|
||||
.body(ApiResponse.success(approvalService.createDefinition(body), "결재 유형이 생성되었습니다."));
|
||||
@@ -68,11 +68,11 @@ public class ApprovalController {
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> updateDefinition(
|
||||
@PathVariable Long id,
|
||||
@RequestBody Map<String, Object> body,
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId) {
|
||||
body.put("definitionId", id);
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("userId", userId);
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId) {
|
||||
body.put("definition_id", id);
|
||||
body.put("company_code", companyCode);
|
||||
body.put("user_id", userId);
|
||||
try {
|
||||
return ResponseEntity.ok(ApiResponse.success(approvalService.updateDefinition(body), "결재 유형이 수정되었습니다."));
|
||||
} catch (IllegalArgumentException e) {
|
||||
@@ -86,10 +86,10 @@ public class ApprovalController {
|
||||
@DeleteMapping("/definitions/{id}")
|
||||
public ResponseEntity<ApiResponse<Void>> deleteDefinition(
|
||||
@PathVariable Long id,
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("definitionId", id);
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("definition_id", id);
|
||||
params.put("company_code", companyCode);
|
||||
try {
|
||||
approvalService.deleteDefinition(params);
|
||||
return ResponseEntity.ok(ApiResponse.success(null, "결재 유형이 삭제되었습니다."));
|
||||
@@ -108,19 +108,19 @@ public class ApprovalController {
|
||||
@GetMapping("/templates")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getTemplates(
|
||||
@RequestParam Map<String, Object> params,
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
params.put("companyCode", companyCode);
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(approvalService.getTemplates(params)));
|
||||
}
|
||||
|
||||
@GetMapping("/templates/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getTemplate(
|
||||
@PathVariable Long id,
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
try {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("templateId", id);
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("template_id", id);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(approvalService.getTemplate(params)));
|
||||
} catch (IllegalArgumentException e) {
|
||||
return ResponseEntity.status(404).body(ApiResponse.error(e.getMessage()));
|
||||
@@ -130,12 +130,12 @@ public class ApprovalController {
|
||||
@PostMapping("/templates")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> createTemplate(
|
||||
@RequestBody Map<String, Object> body,
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId) {
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId) {
|
||||
if (body.get("template_name") == null)
|
||||
return ResponseEntity.status(400).body(ApiResponse.error("템플릿명은 필수입니다."));
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("userId", userId);
|
||||
body.put("company_code", companyCode);
|
||||
body.put("user_id", userId);
|
||||
try {
|
||||
return ResponseEntity.status(HttpStatus.CREATED)
|
||||
.body(ApiResponse.success(approvalService.createTemplate(body), "결재선 템플릿이 생성되었습니다."));
|
||||
@@ -149,11 +149,11 @@ public class ApprovalController {
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> updateTemplate(
|
||||
@PathVariable Long id,
|
||||
@RequestBody Map<String, Object> body,
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId) {
|
||||
body.put("templateId", id);
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("userId", userId);
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId) {
|
||||
body.put("template_id", id);
|
||||
body.put("company_code", companyCode);
|
||||
body.put("user_id", userId);
|
||||
try {
|
||||
return ResponseEntity.ok(ApiResponse.success(approvalService.updateTemplate(body), "결재선 템플릿이 수정되었습니다."));
|
||||
} catch (IllegalArgumentException e) {
|
||||
@@ -167,10 +167,10 @@ public class ApprovalController {
|
||||
@DeleteMapping("/templates/{id}")
|
||||
public ResponseEntity<ApiResponse<Void>> deleteTemplate(
|
||||
@PathVariable Long id,
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("templateId", id);
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("template_id", id);
|
||||
params.put("company_code", companyCode);
|
||||
try {
|
||||
approvalService.deleteTemplate(params);
|
||||
return ResponseEntity.ok(ApiResponse.success(null, "결재선 템플릿이 삭제되었습니다."));
|
||||
@@ -189,21 +189,21 @@ public class ApprovalController {
|
||||
@GetMapping("/requests")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getRequests(
|
||||
@RequestParam Map<String, Object> params,
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("userId", userId);
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId) {
|
||||
params.put("company_code", companyCode);
|
||||
params.put("user_id", userId);
|
||||
return ResponseEntity.ok(ApiResponse.success(approvalService.getRequests(params)));
|
||||
}
|
||||
|
||||
@GetMapping("/requests/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getRequest(
|
||||
@PathVariable Long id,
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
try {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("requestId", id);
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("request_id", id);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(approvalService.getRequest(params)));
|
||||
} catch (IllegalArgumentException e) {
|
||||
return ResponseEntity.status(404).body(ApiResponse.error(e.getMessage()));
|
||||
@@ -213,10 +213,10 @@ public class ApprovalController {
|
||||
@PostMapping("/requests")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> createRequest(
|
||||
@RequestBody Map<String, Object> body,
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("userId", userId);
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId) {
|
||||
body.put("company_code", companyCode);
|
||||
body.put("user_id", userId);
|
||||
try {
|
||||
return ResponseEntity.status(HttpStatus.CREATED)
|
||||
.body(ApiResponse.success(approvalService.createRequest(body), "결재 요청이 생성되었습니다."));
|
||||
@@ -231,12 +231,12 @@ public class ApprovalController {
|
||||
@PostMapping("/requests/{id}/cancel")
|
||||
public ResponseEntity<ApiResponse<Void>> cancelRequest(
|
||||
@PathVariable Long id,
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId) {
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("requestId", id);
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("userId", userId);
|
||||
params.put("request_id", id);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("user_id", userId);
|
||||
try {
|
||||
approvalService.cancelRequest(params);
|
||||
return ResponseEntity.ok(ApiResponse.success(null, "결재 요청이 회수되었습니다."));
|
||||
@@ -252,13 +252,13 @@ public class ApprovalController {
|
||||
public ResponseEntity<ApiResponse<Void>> postApprove(
|
||||
@PathVariable Long id,
|
||||
@RequestBody(required = false) Map<String, Object> body,
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId) {
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
if (body != null) params.putAll(body);
|
||||
params.put("requestId", id);
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("userId", userId);
|
||||
params.put("request_id", id);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("user_id", userId);
|
||||
try {
|
||||
approvalService.postApprove(params);
|
||||
return ResponseEntity.ok(ApiResponse.success(null, "후결 처리가 완료되었습니다."));
|
||||
@@ -276,11 +276,11 @@ public class ApprovalController {
|
||||
|
||||
@GetMapping("/my-pending")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getMyPendingLines(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId) {
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("userId", userId);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("user_id", userId);
|
||||
return ResponseEntity.ok(ApiResponse.success(approvalService.getMyPendingLines(params)));
|
||||
}
|
||||
|
||||
@@ -288,16 +288,16 @@ public class ApprovalController {
|
||||
public ResponseEntity<ApiResponse<Void>> processApproval(
|
||||
@PathVariable Long lineId,
|
||||
@RequestBody Map<String, Object> body,
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId) {
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId) {
|
||||
String action = (String) body.get("action");
|
||||
if (!List.of("approved", "rejected").contains(action))
|
||||
return ResponseEntity.status(400).body(ApiResponse.error("액션은 approved 또는 rejected여야 합니다."));
|
||||
|
||||
Map<String, Object> params = new HashMap<>(body);
|
||||
params.put("lineId", lineId);
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("userId", userId);
|
||||
params.put("line_id", lineId);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("user_id", userId);
|
||||
try {
|
||||
approvalService.processApproval(params);
|
||||
String msg = "approved".equals(action) ? "승인 처리되었습니다." : "반려 처리되었습니다.";
|
||||
@@ -320,26 +320,26 @@ public class ApprovalController {
|
||||
@GetMapping("/proxy-settings/check/{targetUserId}")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> checkActiveProxy(
|
||||
@PathVariable String targetUserId,
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("userId", targetUserId);
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("user_id", targetUserId);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(approvalService.checkActiveProxy(params)));
|
||||
}
|
||||
|
||||
@GetMapping("/proxy-settings")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getProxySettings(
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(approvalService.getProxySettings(params)));
|
||||
}
|
||||
|
||||
@PostMapping("/proxy-settings")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> createProxySetting(
|
||||
@RequestBody Map<String, Object> body,
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
body.put("companyCode", companyCode);
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
body.put("company_code", companyCode);
|
||||
try {
|
||||
return ResponseEntity.status(HttpStatus.CREATED)
|
||||
.body(ApiResponse.success(approvalService.createProxySetting(body), "대결 위임이 생성되었습니다."));
|
||||
@@ -355,9 +355,9 @@ public class ApprovalController {
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> updateProxySetting(
|
||||
@PathVariable Long id,
|
||||
@RequestBody Map<String, Object> body,
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
body.put("id", id);
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
try {
|
||||
return ResponseEntity.ok(ApiResponse.success(approvalService.updateProxySetting(body), "대결 위임이 수정되었습니다."));
|
||||
} catch (IllegalArgumentException e) {
|
||||
@@ -371,10 +371,10 @@ public class ApprovalController {
|
||||
@DeleteMapping("/proxy-settings/{id}")
|
||||
public ResponseEntity<ApiResponse<Void>> deleteProxySetting(
|
||||
@PathVariable Long id,
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("id", id);
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
try {
|
||||
approvalService.deleteProxySetting(params);
|
||||
return ResponseEntity.ok(ApiResponse.success(null, "대결 위임이 삭제되었습니다."));
|
||||
|
||||
@@ -27,7 +27,7 @@ public class AuditLogController {
|
||||
*/
|
||||
@GetMapping
|
||||
public ResponseEntity<Map<String, Object>> getAuditLogs(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("role") String role,
|
||||
@RequestParam Map<String, Object> queryParams) {
|
||||
|
||||
@@ -35,11 +35,11 @@ public class AuditLogController {
|
||||
|
||||
// SUPER_ADMIN: 쿼리 파라미터 companyCode 사용(없으면 전체); 일반: JWT companyCode 강제 적용
|
||||
String filterCompany = isSuperAdmin
|
||||
? (String) queryParams.get("companyCode")
|
||||
? (String) queryParams.get("company_code")
|
||||
: companyCode;
|
||||
|
||||
Map<String, Object> filters = new HashMap<>(queryParams);
|
||||
filters.put("filterCompany", filterCompany);
|
||||
filters.put("filter_company", filterCompany);
|
||||
|
||||
int page = toInt(queryParams.get("page"), 1);
|
||||
int limit = toInt(queryParams.get("limit"), 50);
|
||||
@@ -63,9 +63,9 @@ public class AuditLogController {
|
||||
*/
|
||||
@GetMapping("/stats")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getAuditLogStats(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("role") String role,
|
||||
@RequestParam(value = "companyCode", required = false) String queryCompanyCode,
|
||||
@RequestParam(value = "company_code", required = false) String queryCompanyCode,
|
||||
@RequestParam(required = false, defaultValue = "30") int days) {
|
||||
|
||||
boolean isSuperAdmin = isSuperAdmin(role);
|
||||
@@ -81,9 +81,9 @@ public class AuditLogController {
|
||||
*/
|
||||
@GetMapping("/users")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getAuditLogUsers(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("role") String role,
|
||||
@RequestParam(value = "companyCode", required = false) String queryCompanyCode) {
|
||||
@RequestParam(value = "company_code", required = false) String queryCompanyCode) {
|
||||
|
||||
boolean isSuperAdmin = isSuperAdmin(role);
|
||||
String targetCompany = isSuperAdmin ? queryCompanyCode : companyCode;
|
||||
@@ -98,14 +98,14 @@ public class AuditLogController {
|
||||
*/
|
||||
@PostMapping
|
||||
public ResponseEntity<ApiResponse<Void>> createAuditLog(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@RequestAttribute("role") String role,
|
||||
@RequestBody Map<String, Object> body,
|
||||
HttpServletRequest request) {
|
||||
|
||||
String action = (String) body.get("action");
|
||||
String resourceType = (String) body.get("resourceType");
|
||||
String resourceType = (String) body.get("resource_type");
|
||||
|
||||
if (action == null || action.isBlank() || resourceType == null || resourceType.isBlank()) {
|
||||
return ResponseEntity.badRequest()
|
||||
@@ -113,17 +113,17 @@ public class AuditLogController {
|
||||
}
|
||||
|
||||
Map<String, Object> params = new HashMap<>(body);
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("userId", userId);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("user_id", userId);
|
||||
// userName: request attribute(JWT) → body fallback
|
||||
if (!params.containsKey("userName")) {
|
||||
Object userName = request.getAttribute("userName");
|
||||
if (!params.containsKey("user_name")) {
|
||||
Object userName = request.getAttribute("user_name");
|
||||
if (userName != null) {
|
||||
params.put("userName", userName);
|
||||
params.put("user_name", userName);
|
||||
}
|
||||
}
|
||||
params.put("ipAddress", resolveClientIp(request));
|
||||
params.put("requestPath", request.getRequestURI());
|
||||
params.put("ip_address", resolveClientIp(request));
|
||||
params.put("request_path", request.getRequestURI());
|
||||
|
||||
auditLogService.insertAuditLog(params);
|
||||
return ResponseEntity.ok(ApiResponse.success(null));
|
||||
|
||||
@@ -29,7 +29,7 @@ public class AuthController {
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> login(
|
||||
@RequestBody Map<String, Object> body,
|
||||
HttpServletRequest request) {
|
||||
String userId = (String) body.get("userId");
|
||||
String userId = (String) body.get("user_id");
|
||||
String password = (String) body.get("password");
|
||||
|
||||
if (!StringUtils.hasText(userId) || !StringUtils.hasText(password)) {
|
||||
@@ -38,13 +38,13 @@ public class AuthController {
|
||||
}
|
||||
|
||||
Map<String, Object> params = new HashMap<>(body);
|
||||
params.put("remoteAddr", getRemoteAddr(request));
|
||||
params.put("remote_addr", getRemoteAddr(request));
|
||||
|
||||
Map<String, Object> result = authService.login(params);
|
||||
|
||||
if (Boolean.TRUE.equals(result.get("loginFailed"))) {
|
||||
if (Boolean.TRUE.equals(result.get("login_failed"))) {
|
||||
return ResponseEntity.status(401)
|
||||
.body(ApiResponse.error((String) result.get("errorReason")));
|
||||
.body(ApiResponse.error((String) result.get("error_reason")));
|
||||
}
|
||||
|
||||
return ResponseEntity.ok(ApiResponse.success(result, "로그인 성공"));
|
||||
@@ -125,7 +125,7 @@ public class AuthController {
|
||||
return ResponseEntity.status(401).body(ApiResponse.error("인증 토큰이 필요합니다."));
|
||||
}
|
||||
|
||||
String companyCode = (String) body.get("companyCode");
|
||||
String companyCode = (String) body.get("company_code");
|
||||
if (!StringUtils.hasText(companyCode)) {
|
||||
return ResponseEntity.badRequest().body(ApiResponse.error("전환할 회사 코드가 필요합니다."));
|
||||
}
|
||||
@@ -143,12 +143,12 @@ public class AuthController {
|
||||
*/
|
||||
@PostMapping("/signup")
|
||||
public ResponseEntity<ApiResponse<Void>> signup(@RequestBody Map<String, Object> body) {
|
||||
String userId = (String) body.get("userId");
|
||||
String userId = (String) body.get("user_id");
|
||||
String password = (String) body.get("password");
|
||||
String userName = (String) body.get("userName");
|
||||
String phoneNumber = (String) body.get("phoneNumber");
|
||||
String licenseNumber = (String) body.get("licenseNumber");
|
||||
String vehicleNumber = (String) body.get("vehicleNumber");
|
||||
String userName = (String) body.get("user_name");
|
||||
String phoneNumber = (String) body.get("phone_number");
|
||||
String licenseNumber = (String) body.get("license_number");
|
||||
String vehicleNumber = (String) body.get("vehicle_number");
|
||||
|
||||
if (!StringUtils.hasText(userId) || !StringUtils.hasText(password)
|
||||
|| !StringUtils.hasText(userName) || !StringUtils.hasText(phoneNumber)
|
||||
|
||||
@@ -18,9 +18,9 @@ public class BarcodeLabelController {
|
||||
|
||||
@GetMapping("/list")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getBarcodeLabelList(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(barcodeLabelService.getBarcodeLabelList(params)));
|
||||
}
|
||||
|
||||
@@ -55,11 +55,11 @@ public class BarcodeLabelController {
|
||||
|
||||
@PostMapping
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> insertBarcodeLabel(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute(value = "userId", required = false) String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute(value = "user_id", required = false) String userId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("createdBy", userId);
|
||||
body.put("company_code", companyCode);
|
||||
body.put("created_by", userId);
|
||||
Map<String, Object> result = barcodeLabelService.insertBarcodeLabel(body);
|
||||
return ResponseEntity.status(201).body(ApiResponse.success(result, "라벨이 생성되었습니다."));
|
||||
}
|
||||
@@ -67,11 +67,11 @@ public class BarcodeLabelController {
|
||||
@PostMapping("/{labelId}/copy")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> copyBarcodeLabel(
|
||||
@PathVariable String labelId,
|
||||
@RequestAttribute(value = "userId", required = false) String userId) {
|
||||
@RequestAttribute(value = "user_id", required = false) String userId) {
|
||||
String newLabelId = barcodeLabelService.copyBarcodeLabel(labelId, userId);
|
||||
if (newLabelId == null) return ResponseEntity.status(404).body(ApiResponse.error("복사할 라벨을 찾을 수 없습니다."));
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("labelId", newLabelId);
|
||||
result.put("label_id", newLabelId);
|
||||
return ResponseEntity.status(201).body(ApiResponse.success(result, "라벨이 복사되었습니다."));
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ public class BarcodeLabelController {
|
||||
@PutMapping("/{labelId}/layout")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> saveBarcodeLabelLayout(
|
||||
@PathVariable String labelId,
|
||||
@RequestAttribute(value = "userId", required = false) String userId,
|
||||
@RequestAttribute(value = "user_id", required = false) String userId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
barcodeLabelService.saveBarcodeLabelLayout(labelId, body, userId);
|
||||
return ResponseEntity.ok(ApiResponse.success(null, "레이아웃이 저장되었습니다."));
|
||||
|
||||
@@ -18,28 +18,28 @@ public class BatchController {
|
||||
|
||||
@GetMapping
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getBatchList(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(batchService.getBatchList(params)));
|
||||
}
|
||||
|
||||
@GetMapping("/connections")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getConnections(
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
return ResponseEntity.ok(ApiResponse.success(batchService.getConnections(companyCode)));
|
||||
}
|
||||
|
||||
@GetMapping("/connections/{type}/tables")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getTablesByType(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String type) {
|
||||
return ResponseEntity.ok(ApiResponse.success(batchService.getTables(type, null)));
|
||||
}
|
||||
|
||||
@GetMapping("/connections/{type}/{connectionId}/tables")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getTablesByTypeAndId(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String type,
|
||||
@PathVariable Long connectionId) {
|
||||
return ResponseEntity.ok(ApiResponse.success(batchService.getTables(type, connectionId)));
|
||||
@@ -47,7 +47,7 @@ public class BatchController {
|
||||
|
||||
@GetMapping("/connections/{type}/tables/{tableName}/columns")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getColumnsByType(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String type,
|
||||
@PathVariable String tableName) {
|
||||
return ResponseEntity.ok(ApiResponse.success(batchService.getColumns(type, null, tableName)));
|
||||
@@ -55,7 +55,7 @@ public class BatchController {
|
||||
|
||||
@GetMapping("/connections/{type}/{connectionId}/tables/{tableName}/columns")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getColumnsByTypeAndId(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String type,
|
||||
@PathVariable Long connectionId,
|
||||
@PathVariable String tableName) {
|
||||
@@ -64,10 +64,10 @@ public class BatchController {
|
||||
|
||||
@GetMapping("/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getBatchInfo(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long id) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("id", id);
|
||||
Map<String, Object> result = batchService.getBatchInfo(params);
|
||||
if (result == null) {
|
||||
@@ -78,10 +78,10 @@ public class BatchController {
|
||||
|
||||
@PostMapping
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> insertBatch(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
body.put("created_by", userId);
|
||||
body.put("updated_by", userId);
|
||||
Map<String, Object> created = batchService.insertBatch(body);
|
||||
@@ -90,11 +90,11 @@ public class BatchController {
|
||||
|
||||
@PutMapping("/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> updateBatch(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@PathVariable Long id,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
body.put("updated_by", userId);
|
||||
body.put("id", id);
|
||||
Map<String, Object> updated = batchService.updateBatch(body);
|
||||
@@ -103,12 +103,12 @@ public class BatchController {
|
||||
|
||||
@DeleteMapping("/{id}")
|
||||
public ResponseEntity<ApiResponse<Void>> deleteBatch(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@PathVariable Long id) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("updatedBy", userId);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("updated_by", userId);
|
||||
params.put("id", id);
|
||||
batchService.deleteBatch(params);
|
||||
return ResponseEntity.ok(ApiResponse.success(null, "배치 설정이 성공적으로 삭제되었습니다."));
|
||||
|
||||
@@ -16,65 +16,65 @@ public class BatchExecutionLogController {
|
||||
|
||||
@GetMapping("/list")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getBatchExecutionLogList(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(batchExecutionLogService.getBatchExecutionLogList(params)));
|
||||
}
|
||||
|
||||
@GetMapping("/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getBatchExecutionLogInfo(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long id) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("id", id);
|
||||
return ResponseEntity.ok(ApiResponse.success(batchExecutionLogService.getBatchExecutionLogInfo(params)));
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> insertBatchExecutionLog(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(batchExecutionLogService.insertBatchExecutionLog(body)));
|
||||
}
|
||||
|
||||
@PutMapping("/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> updateBatchExecutionLog(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long id,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
body.put("id", id);
|
||||
return ResponseEntity.ok(ApiResponse.success(batchExecutionLogService.updateBatchExecutionLog(body)));
|
||||
}
|
||||
|
||||
@DeleteMapping("/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> deleteBatchExecutionLog(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long id) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("id", id);
|
||||
return ResponseEntity.ok(ApiResponse.success(batchExecutionLogService.deleteBatchExecutionLog(params)));
|
||||
}
|
||||
|
||||
@GetMapping("/latest/{batchConfigId}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getBatchExecutionLogLatest(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long batchConfigId) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("batchConfigId", batchConfigId);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("batch_config_id", batchConfigId);
|
||||
return ResponseEntity.ok(ApiResponse.success(batchExecutionLogService.getBatchExecutionLogLatest(params)));
|
||||
}
|
||||
|
||||
@GetMapping("/stats")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getBatchExecutionLogStats(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(batchExecutionLogService.getBatchExecutionLogStats(params)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,9 +22,9 @@ public class BatchManagementController {
|
||||
/** GET /api/batch-management/stats — 배치 대시보드 통계 */
|
||||
@GetMapping("/stats")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getBatchStats(
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(batchManagementService.getBatchStats(params)));
|
||||
}
|
||||
|
||||
@@ -33,9 +33,9 @@ public class BatchManagementController {
|
||||
/** GET /api/batch-management/node-flows — 배치 설정에서 노드 플로우 선택용 목록 */
|
||||
@GetMapping("/node-flows")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getNodeFlows(
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(batchManagementService.getNodeFlows(params)));
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ public class BatchManagementController {
|
||||
/** GET /api/batch-management/connections — 사용 가능한 커넥션 목록 조회 */
|
||||
@GetMapping("/connections")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getAvailableConnections(
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
return ResponseEntity.ok(ApiResponse.success(
|
||||
batchManagementService.getAvailableConnections(companyCode)));
|
||||
}
|
||||
@@ -52,7 +52,7 @@ public class BatchManagementController {
|
||||
/** GET /api/batch-management/connections/:type/tables — 내부 DB 테이블 목록 */
|
||||
@GetMapping("/connections/{type}/tables")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getTablesFromConnection(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String type) {
|
||||
return ResponseEntity.ok(ApiResponse.success(
|
||||
batchManagementService.getTablesFromConnection(type, null, companyCode)));
|
||||
@@ -61,7 +61,7 @@ public class BatchManagementController {
|
||||
/** GET /api/batch-management/connections/:type/:id/tables — 외부 DB 테이블 목록 */
|
||||
@GetMapping("/connections/{type}/{id}/tables")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getTablesFromExternalConnection(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String type,
|
||||
@PathVariable Long id) {
|
||||
return ResponseEntity.ok(ApiResponse.success(
|
||||
@@ -71,7 +71,7 @@ public class BatchManagementController {
|
||||
/** GET /api/batch-management/connections/:type/tables/:tableName/columns — 내부 DB 컬럼 정보 */
|
||||
@GetMapping("/connections/{type}/tables/{tableName}/columns")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getTableColumns(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String type,
|
||||
@PathVariable String tableName) {
|
||||
return ResponseEntity.ok(ApiResponse.success(
|
||||
@@ -81,7 +81,7 @@ public class BatchManagementController {
|
||||
/** GET /api/batch-management/connections/:type/:id/tables/:tableName/columns — 외부 DB 컬럼 정보 */
|
||||
@GetMapping("/connections/{type}/{id}/tables/{tableName}/columns")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getExternalTableColumns(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String type,
|
||||
@PathVariable Long id,
|
||||
@PathVariable String tableName) {
|
||||
@@ -94,9 +94,9 @@ public class BatchManagementController {
|
||||
/** POST /api/batch-management/batch-configs — 배치 설정 생성 */
|
||||
@PostMapping("/batch-configs")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> insertBatchConfig(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
Map<String, Object> result = batchManagementService.insertBatchConfig(body);
|
||||
return ResponseEntity.status(201).body(ApiResponse.success(result, "배치 설정이 성공적으로 생성되었습니다."));
|
||||
}
|
||||
@@ -104,19 +104,19 @@ public class BatchManagementController {
|
||||
/** GET /api/batch-management/batch-configs — 배치 설정 목록 조회 */
|
||||
@GetMapping("/batch-configs")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getBatchConfigList(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(batchManagementService.getBatchConfigList(params)));
|
||||
}
|
||||
|
||||
/** GET /api/batch-management/batch-configs/:id — 특정 배치 설정 조회 */
|
||||
@GetMapping("/batch-configs/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getBatchConfigInfo(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long id) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("id", id);
|
||||
Map<String, Object> result = batchManagementService.getBatchConfigInfo(params);
|
||||
if (result == null) {
|
||||
@@ -128,32 +128,32 @@ public class BatchManagementController {
|
||||
/** GET /api/batch-management/batch-configs/:id/sparkline — 최근 24시간 1시간 단위 실행 집계 */
|
||||
@GetMapping("/batch-configs/{id}/sparkline")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getBatchSparkline(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long id) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("batchConfigId", id);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("batch_config_id", id);
|
||||
return ResponseEntity.ok(ApiResponse.success(batchManagementService.getBatchSparkline(params)));
|
||||
}
|
||||
|
||||
/** GET /api/batch-management/batch-configs/:id/recent-logs — 최근 실행 로그 (최대 20건) */
|
||||
@GetMapping("/batch-configs/{id}/recent-logs")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getBatchRecentLogs(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long id) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("batchConfigId", id);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("batch_config_id", id);
|
||||
return ResponseEntity.ok(ApiResponse.success(batchManagementService.getBatchRecentLogs(params)));
|
||||
}
|
||||
|
||||
/** PUT /api/batch-management/batch-configs/:id — 배치 설정 업데이트 */
|
||||
@PutMapping("/batch-configs/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> updateBatchConfig(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long id,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
body.put("id", id);
|
||||
return ResponseEntity.ok(ApiResponse.success(
|
||||
batchManagementService.updateBatchConfig(body), "배치 설정이 성공적으로 업데이트되었습니다."));
|
||||
@@ -162,10 +162,10 @@ public class BatchManagementController {
|
||||
/** POST /api/batch-management/batch-configs/:id/execute — 배치 수동 실행 */
|
||||
@PostMapping("/batch-configs/{id}/execute")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> executeBatchConfig(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long id) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("id", id);
|
||||
return ResponseEntity.ok(ApiResponse.success(
|
||||
batchManagementService.executeBatchConfig(params), "배치가 성공적으로 실행되었습니다."));
|
||||
@@ -176,18 +176,18 @@ public class BatchManagementController {
|
||||
/** POST /api/batch-management/rest-api/preview — REST API 데이터 미리보기 */
|
||||
@PostMapping("/rest-api/preview")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> previewRestApiData(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(batchManagementService.previewRestApiData(body)));
|
||||
}
|
||||
|
||||
/** POST /api/batch-management/rest-api/save — REST API 배치 저장 */
|
||||
@PostMapping("/rest-api/save")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> saveRestApiBatch(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(
|
||||
batchManagementService.saveRestApiBatch(body), "REST API 배치가 성공적으로 저장되었습니다."));
|
||||
}
|
||||
@@ -197,9 +197,9 @@ public class BatchManagementController {
|
||||
/** GET /api/batch-management/auth-services — 인증 토큰 서비스명 목록 조회 */
|
||||
@GetMapping("/auth-services")
|
||||
public ResponseEntity<ApiResponse<List<String>>> getAuthServiceNames(
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(batchManagementService.getAuthServiceNames(params)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,46 +23,46 @@ public class BomController {
|
||||
|
||||
@GetMapping("/list")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getBomList(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(bomService.getBomList(params)));
|
||||
}
|
||||
|
||||
@GetMapping("/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getBomInfo(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long id) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("id", id);
|
||||
return ResponseEntity.ok(ApiResponse.success(bomService.getBomInfo(params)));
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> insertBom(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(bomService.insertBom(body)));
|
||||
}
|
||||
|
||||
@PutMapping("/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> updateBom(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long id,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
body.put("id", id);
|
||||
return ResponseEntity.ok(ApiResponse.success(bomService.updateBom(body)));
|
||||
}
|
||||
|
||||
@DeleteMapping("/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> deleteBom(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long id) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("id", id);
|
||||
return ResponseEntity.ok(ApiResponse.success(bomService.deleteBom(params)));
|
||||
}
|
||||
@@ -82,15 +82,15 @@ public class BomController {
|
||||
|
||||
@GetMapping("/{bomId}/history")
|
||||
public ResponseEntity<ApiResponse<Object>> getBomHistory(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String bomId) {
|
||||
return ResponseEntity.ok(ApiResponse.success(bomService.getBomHistory(bomId, companyCode)));
|
||||
}
|
||||
|
||||
@PostMapping("/{bomId}/history")
|
||||
public ResponseEntity<ApiResponse<Object>> addBomHistory(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@PathVariable String bomId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
if (body.get("change_type") == null) {
|
||||
@@ -104,32 +104,32 @@ public class BomController {
|
||||
|
||||
@GetMapping("/{bomId}/versions")
|
||||
public ResponseEntity<ApiResponse<Object>> getBomVersions(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String bomId) {
|
||||
return ResponseEntity.ok(ApiResponse.success(bomService.getBomVersions(bomId, companyCode)));
|
||||
}
|
||||
|
||||
@PostMapping("/{bomId}/versions")
|
||||
public ResponseEntity<ApiResponse<Object>> createBomVersion(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@PathVariable String bomId,
|
||||
@RequestBody(required = false) Map<String, Object> body) {
|
||||
String versionName = body != null && body.get("versionName") != null ? String.valueOf(body.get("versionName")) : null;
|
||||
String versionName = body != null && body.get("version_name") != null ? String.valueOf(body.get("version_name")) : null;
|
||||
return ResponseEntity.ok(ApiResponse.success(bomService.createBomVersion(bomId, companyCode, userId, versionName)));
|
||||
}
|
||||
|
||||
@PostMapping("/{bomId}/initialize-version")
|
||||
public ResponseEntity<ApiResponse<Object>> initializeBomVersion(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@PathVariable String bomId) {
|
||||
return ResponseEntity.ok(ApiResponse.success(bomService.initializeBomVersion(bomId, companyCode, userId)));
|
||||
}
|
||||
|
||||
@PostMapping("/{bomId}/versions/{versionId}/load")
|
||||
public ResponseEntity<ApiResponse<Object>> loadBomVersion(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String bomId,
|
||||
@PathVariable String versionId) {
|
||||
return ResponseEntity.ok(ApiResponse.success(bomService.loadBomVersion(bomId, versionId, companyCode)));
|
||||
@@ -158,8 +158,8 @@ public class BomController {
|
||||
@PostMapping("/excel-upload")
|
||||
@SuppressWarnings("unchecked")
|
||||
public ResponseEntity<ApiResponse<Object>> createBomFromExcel(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
List<Map<String, Object>> rows = (List<Map<String, Object>>) body.get("rows");
|
||||
if (rows == null || rows.isEmpty()) {
|
||||
@@ -172,22 +172,22 @@ public class BomController {
|
||||
@PostMapping("/{bomId}/excel-upload-version")
|
||||
@SuppressWarnings("unchecked")
|
||||
public ResponseEntity<ApiResponse<Object>> createBomVersionFromExcel(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@PathVariable String bomId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
List<Map<String, Object>> rows = (List<Map<String, Object>>) body.get("rows");
|
||||
if (rows == null || rows.isEmpty()) {
|
||||
return ResponseEntity.ok(ApiResponse.error("업로드할 데이터가 없습니다"));
|
||||
}
|
||||
String versionName = body.get("versionName") != null ? String.valueOf(body.get("versionName")) : null;
|
||||
String versionName = body.get("version_name") != null ? String.valueOf(body.get("version_name")) : null;
|
||||
Map<String, Object> result = bomService.createBomVersionFromExcel(bomId, companyCode, userId, rows, versionName);
|
||||
return ResponseEntity.ok(ApiResponse.success(result));
|
||||
}
|
||||
|
||||
@GetMapping("/{bomId}/excel-download")
|
||||
public ResponseEntity<ApiResponse<Object>> downloadBomExcelData(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String bomId) {
|
||||
return ResponseEntity.ok(ApiResponse.success(bomService.downloadBomExcelData(bomId, companyCode)));
|
||||
}
|
||||
|
||||
@@ -49,8 +49,8 @@ public class BookingController {
|
||||
@RequestBody(required = false) Map<String, Object> body) {
|
||||
Map<String, Object> params = new LinkedHashMap<>();
|
||||
params.put("id", id);
|
||||
if (body != null && body.containsKey("rejectionReason")) {
|
||||
params.put("rejectionReason", body.get("rejectionReason"));
|
||||
if (body != null && body.containsKey("rejection_reason")) {
|
||||
params.put("rejection_reason", body.get("rejection_reason"));
|
||||
}
|
||||
return ResponseEntity.ok(ApiResponse.success(bookingService.rejectBooking(params)));
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ public class ButtonActionStandardController {
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getButtonAction(
|
||||
@PathVariable String actionType) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("actionType", actionType);
|
||||
params.put("action_type", actionType);
|
||||
Map<String, Object> data = buttonActionStandardService.getButtonAction(params);
|
||||
if (data == null) {
|
||||
return ResponseEntity.status(HttpStatus.NOT_FOUND)
|
||||
@@ -62,7 +62,7 @@ public class ButtonActionStandardController {
|
||||
*/
|
||||
@PostMapping
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> createButtonAction(
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
// 필수 필드 검증
|
||||
if (body.get("action_type") == null || body.get("action_name") == null) {
|
||||
@@ -72,7 +72,7 @@ public class ButtonActionStandardController {
|
||||
body.put("created_by", userId);
|
||||
body.put("updated_by", userId);
|
||||
// selectButtonActionByType 에서 actionType 키 사용
|
||||
body.put("actionType", body.get("action_type"));
|
||||
body.put("action_type", body.get("action_type"));
|
||||
|
||||
Map<String, Object> data = buttonActionStandardService.createButtonAction(body);
|
||||
return ResponseEntity.status(HttpStatus.CREATED)
|
||||
@@ -85,9 +85,9 @@ public class ButtonActionStandardController {
|
||||
*/
|
||||
@PutMapping("/sort-order/bulk")
|
||||
public ResponseEntity<ApiResponse<Void>> updateButtonActionSortOrder(
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
Object raw = body.get("buttonActions");
|
||||
Object raw = body.get("button_actions");
|
||||
if (!(raw instanceof List)) {
|
||||
return ResponseEntity.status(HttpStatus.BAD_REQUEST)
|
||||
.body(ApiResponse.error("유효하지 않은 데이터 형식입니다."));
|
||||
@@ -105,9 +105,9 @@ public class ButtonActionStandardController {
|
||||
@PutMapping("/{actionType}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> updateButtonAction(
|
||||
@PathVariable String actionType,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("actionType", actionType);
|
||||
body.put("action_type", actionType);
|
||||
body.put("updated_by", userId);
|
||||
Map<String, Object> data = buttonActionStandardService.updateButtonAction(body);
|
||||
if (data == null) {
|
||||
@@ -125,7 +125,7 @@ public class ButtonActionStandardController {
|
||||
public ResponseEntity<ApiResponse<Void>> deleteButtonAction(
|
||||
@PathVariable String actionType) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("actionType", actionType);
|
||||
params.put("action_type", actionType);
|
||||
boolean deleted = buttonActionStandardService.deleteButtonAction(params);
|
||||
if (!deleted) {
|
||||
return ResponseEntity.status(HttpStatus.NOT_FOUND)
|
||||
|
||||
@@ -66,7 +66,7 @@ public class ButtonDataflowController {
|
||||
/** GET /diagrams */
|
||||
@GetMapping("/diagrams")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getAvailableDiagrams(
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
try {
|
||||
if (companyCode == null || companyCode.isBlank()) {
|
||||
return ResponseEntity.status(400).body(ApiResponse.error("회사 코드가 필요합니다."));
|
||||
@@ -82,7 +82,7 @@ public class ButtonDataflowController {
|
||||
@GetMapping("/diagrams/{diagramId}/relationships")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getDiagramRelationships(
|
||||
@PathVariable int diagramId,
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
try {
|
||||
if (companyCode == null || companyCode.isBlank()) {
|
||||
return ResponseEntity.status(400).body(ApiResponse.error("회사 코드가 필요합니다."));
|
||||
@@ -103,7 +103,7 @@ public class ButtonDataflowController {
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getRelationshipPreview(
|
||||
@PathVariable int diagramId,
|
||||
@PathVariable String relationshipId,
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
try {
|
||||
if (companyCode == null || companyCode.isBlank()) {
|
||||
return ResponseEntity.status(400).body(ApiResponse.error("관계도 ID, 관계 ID, 회사 코드가 필요합니다."));
|
||||
@@ -126,7 +126,7 @@ public class ButtonDataflowController {
|
||||
/** POST /execute-optimized (메인 최적화 실행) */
|
||||
@PostMapping("/execute-optimized")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> executeOptimizedButton(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
return doExecuteOptimized(companyCode, body);
|
||||
}
|
||||
@@ -134,7 +134,7 @@ public class ButtonDataflowController {
|
||||
/** POST /execute (레거시 — executeOptimized 와 동일) */
|
||||
@PostMapping("/execute")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> executeLegacy(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
return doExecuteOptimized(companyCode, body);
|
||||
}
|
||||
@@ -142,7 +142,7 @@ public class ButtonDataflowController {
|
||||
/** POST /execute-background (레거시 — executeOptimized 와 동일) */
|
||||
@PostMapping("/execute-background")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> executeBackground(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
return doExecuteOptimized(companyCode, body);
|
||||
}
|
||||
@@ -150,10 +150,10 @@ public class ButtonDataflowController {
|
||||
/** POST /execute-simple */
|
||||
@PostMapping("/execute-simple")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> executeSimpleDataflow(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
try {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(service.executeSimpleDataflow(body)));
|
||||
} catch (Exception e) {
|
||||
log.error("단순 데이터플로우 실행 오류", e);
|
||||
@@ -185,7 +185,7 @@ public class ButtonDataflowController {
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getJoinRelationship(
|
||||
@PathVariable String mainTable,
|
||||
@PathVariable String detailTable,
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
try {
|
||||
if (mainTable == null || detailTable == null) {
|
||||
return ResponseEntity.status(400).body(ApiResponse.error("메인 테이블과 디테일 테이블이 필요합니다."));
|
||||
@@ -205,13 +205,13 @@ public class ButtonDataflowController {
|
||||
private ResponseEntity<ApiResponse<Map<String, Object>>> doExecuteOptimized(
|
||||
String companyCode, Map<String, Object> body) {
|
||||
try {
|
||||
String buttonId = (String) body.get("buttonId");
|
||||
String actionType = (String) body.get("actionType");
|
||||
String buttonId = (String) body.get("button_id");
|
||||
String actionType = (String) body.get("action_type");
|
||||
|
||||
if (buttonId == null || actionType == null) {
|
||||
return ResponseEntity.status(400).body(ApiResponse.error("필수 파라미터가 누락되었습니다."));
|
||||
}
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(service.executeOptimizedButton(body)));
|
||||
} catch (Exception e) {
|
||||
log.error("버튼 실행 오류", e);
|
||||
|
||||
@@ -19,27 +19,27 @@ public class CascadingAutoFillController {
|
||||
// Pipeline api_test compatibility alias
|
||||
@GetMapping("/list")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getGroupListAlias(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(cascadingAutoFillService.getCascadingAutoFillGroupList(params)));
|
||||
}
|
||||
|
||||
@GetMapping("/groups")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getGroupList(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(cascadingAutoFillService.getCascadingAutoFillGroupList(params)));
|
||||
}
|
||||
|
||||
@GetMapping("/groups/{groupCode}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getGroupDetail(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String groupCode) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("groupCode", groupCode);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("group_code", groupCode);
|
||||
Map<String, Object> result = cascadingAutoFillService.getCascadingAutoFillGroupDetail(params);
|
||||
if (result == null) {
|
||||
return ResponseEntity.status(HttpStatus.NOT_FOUND)
|
||||
@@ -50,20 +50,20 @@ public class CascadingAutoFillController {
|
||||
|
||||
@PostMapping("/groups")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> createGroup(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
return ResponseEntity.status(HttpStatus.CREATED)
|
||||
.body(ApiResponse.success(cascadingAutoFillService.insertCascadingAutoFillGroup(body)));
|
||||
}
|
||||
|
||||
@PutMapping("/groups/{groupCode}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> updateGroup(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String groupCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("groupCode", groupCode);
|
||||
body.put("company_code", companyCode);
|
||||
body.put("group_code", groupCode);
|
||||
Map<String, Object> result = cascadingAutoFillService.updateCascadingAutoFillGroup(body);
|
||||
if (result == null) {
|
||||
return ResponseEntity.status(HttpStatus.NOT_FOUND)
|
||||
@@ -74,11 +74,11 @@ public class CascadingAutoFillController {
|
||||
|
||||
@DeleteMapping("/groups/{groupCode}")
|
||||
public ResponseEntity<ApiResponse<Void>> deleteGroup(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String groupCode) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("groupCode", groupCode);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("group_code", groupCode);
|
||||
boolean deleted = cascadingAutoFillService.deleteCascadingAutoFillGroup(params);
|
||||
if (!deleted) {
|
||||
return ResponseEntity.status(HttpStatus.NOT_FOUND)
|
||||
@@ -89,11 +89,11 @@ public class CascadingAutoFillController {
|
||||
|
||||
@GetMapping("/options/{groupCode}")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getMasterOptions(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String groupCode) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("groupCode", groupCode);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("group_code", groupCode);
|
||||
List<Map<String, Object>> result = cascadingAutoFillService.getAutoFillMasterOptions(params);
|
||||
if (result == null) {
|
||||
return ResponseEntity.status(HttpStatus.NOT_FOUND)
|
||||
@@ -104,7 +104,7 @@ public class CascadingAutoFillController {
|
||||
|
||||
@GetMapping("/data/{groupCode}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getAutoFillData(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String groupCode,
|
||||
@RequestParam(required = false) String masterValue) {
|
||||
if (masterValue == null || masterValue.isBlank()) {
|
||||
@@ -112,9 +112,9 @@ public class CascadingAutoFillController {
|
||||
.body(ApiResponse.error("masterValue 파라미터가 필요합니다."));
|
||||
}
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("groupCode", groupCode);
|
||||
params.put("masterValue", masterValue);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("group_code", groupCode);
|
||||
params.put("master_value", masterValue);
|
||||
Map<String, Object> result = cascadingAutoFillService.getAutoFillData(params);
|
||||
if (result == null) {
|
||||
return ResponseEntity.status(HttpStatus.NOT_FOUND)
|
||||
|
||||
@@ -17,65 +17,65 @@ public class CascadingConditionController {
|
||||
|
||||
@GetMapping("/list")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getCascadingConditionListAlias(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(cascadingConditionService.getCascadingConditionList(params)));
|
||||
}
|
||||
|
||||
@GetMapping
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getCascadingConditionList(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(cascadingConditionService.getCascadingConditionList(params)));
|
||||
}
|
||||
|
||||
@GetMapping("/filtered-options/{relationCode}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getFilteredOptions(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String relationCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("relationCode", relationCode);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("relation_code", relationCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(cascadingConditionService.getFilteredOptions(params)));
|
||||
}
|
||||
|
||||
@GetMapping("/{conditionId}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getCascadingConditionInfo(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long conditionId) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("conditionId", conditionId);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("condition_id", conditionId);
|
||||
return ResponseEntity.ok(ApiResponse.success(cascadingConditionService.getCascadingConditionInfo(params)));
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> insertCascadingCondition(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(cascadingConditionService.insertCascadingCondition(body)));
|
||||
}
|
||||
|
||||
@PutMapping("/{conditionId}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> updateCascadingCondition(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long conditionId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("conditionId", conditionId);
|
||||
body.put("company_code", companyCode);
|
||||
body.put("condition_id", conditionId);
|
||||
return ResponseEntity.ok(ApiResponse.success(cascadingConditionService.updateCascadingCondition(body)));
|
||||
}
|
||||
|
||||
@DeleteMapping("/{conditionId}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> deleteCascadingCondition(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long conditionId) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("conditionId", conditionId);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("condition_id", conditionId);
|
||||
return ResponseEntity.ok(ApiResponse.success(cascadingConditionService.deleteCascadingCondition(params)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,27 +19,27 @@ public class CascadingHierarchyController {
|
||||
// Pipeline api_test compatibility alias
|
||||
@GetMapping("/list")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getGroupListAlias(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(cascadingHierarchyService.getCascadingHierarchyGroupList(params)));
|
||||
}
|
||||
|
||||
@GetMapping
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getGroupList(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(cascadingHierarchyService.getCascadingHierarchyGroupList(params)));
|
||||
}
|
||||
|
||||
@GetMapping("/{groupCode}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getGroupDetail(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String groupCode) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("groupCode", groupCode);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("group_code", groupCode);
|
||||
Map<String, Object> result = cascadingHierarchyService.getCascadingHierarchyGroupDetail(params);
|
||||
if (result == null) {
|
||||
return ResponseEntity.status(HttpStatus.NOT_FOUND)
|
||||
@@ -50,24 +50,24 @@ public class CascadingHierarchyController {
|
||||
|
||||
@PostMapping
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> createGroup(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute(value = "userId", required = false) String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute(value = "user_id", required = false) String userId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
if (userId != null) body.put("userId", userId);
|
||||
body.put("company_code", companyCode);
|
||||
if (userId != null) body.put("user_id", userId);
|
||||
return ResponseEntity.status(HttpStatus.CREATED)
|
||||
.body(ApiResponse.success(cascadingHierarchyService.insertCascadingHierarchyGroup(body)));
|
||||
}
|
||||
|
||||
@PutMapping("/{groupCode}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> updateGroup(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute(value = "userId", required = false) String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute(value = "user_id", required = false) String userId,
|
||||
@PathVariable String groupCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("groupCode", groupCode);
|
||||
if (userId != null) body.put("userId", userId);
|
||||
body.put("company_code", companyCode);
|
||||
body.put("group_code", groupCode);
|
||||
if (userId != null) body.put("user_id", userId);
|
||||
Map<String, Object> result = cascadingHierarchyService.updateCascadingHierarchyGroup(body);
|
||||
if (result == null) {
|
||||
return ResponseEntity.status(HttpStatus.NOT_FOUND)
|
||||
@@ -78,11 +78,11 @@ public class CascadingHierarchyController {
|
||||
|
||||
@DeleteMapping("/{groupCode}")
|
||||
public ResponseEntity<ApiResponse<Void>> deleteGroup(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String groupCode) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("groupCode", groupCode);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("group_code", groupCode);
|
||||
boolean deleted = cascadingHierarchyService.deleteCascadingHierarchyGroup(params);
|
||||
if (!deleted) {
|
||||
return ResponseEntity.status(HttpStatus.NOT_FOUND)
|
||||
@@ -93,11 +93,11 @@ public class CascadingHierarchyController {
|
||||
|
||||
@PostMapping("/{groupCode}/levels")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> addLevel(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String groupCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("groupCode", groupCode);
|
||||
body.put("company_code", companyCode);
|
||||
body.put("group_code", groupCode);
|
||||
Map<String, Object> result = cascadingHierarchyService.addCascadingHierarchyLevel(body);
|
||||
if (result == null) {
|
||||
return ResponseEntity.status(HttpStatus.NOT_FOUND)
|
||||
@@ -108,11 +108,11 @@ public class CascadingHierarchyController {
|
||||
|
||||
@PutMapping("/levels/{levelId}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> updateLevel(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long levelId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("levelId", levelId);
|
||||
body.put("company_code", companyCode);
|
||||
body.put("level_id", levelId);
|
||||
Map<String, Object> result = cascadingHierarchyService.updateCascadingHierarchyLevel(body);
|
||||
if (result == null) {
|
||||
return ResponseEntity.status(HttpStatus.NOT_FOUND)
|
||||
@@ -123,11 +123,11 @@ public class CascadingHierarchyController {
|
||||
|
||||
@DeleteMapping("/levels/{levelId}")
|
||||
public ResponseEntity<ApiResponse<Void>> deleteLevel(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long levelId) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("levelId", levelId);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("level_id", levelId);
|
||||
boolean deleted = cascadingHierarchyService.deleteCascadingHierarchyLevel(params);
|
||||
if (!deleted) {
|
||||
return ResponseEntity.status(HttpStatus.NOT_FOUND)
|
||||
@@ -138,15 +138,15 @@ public class CascadingHierarchyController {
|
||||
|
||||
@GetMapping("/{groupCode}/options/{levelOrder}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getLevelOptions(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String groupCode,
|
||||
@PathVariable Integer levelOrder,
|
||||
@RequestParam(required = false) String parentValue) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("groupCode", groupCode);
|
||||
params.put("levelOrder", levelOrder);
|
||||
if (parentValue != null) params.put("parentValue", parentValue);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("group_code", groupCode);
|
||||
params.put("level_order", levelOrder);
|
||||
if (parentValue != null) params.put("parent_value", parentValue);
|
||||
Map<String, Object> result = cascadingHierarchyService.getLevelOptions(params);
|
||||
if (result == null) {
|
||||
return ResponseEntity.status(HttpStatus.NOT_FOUND)
|
||||
|
||||
+19
-19
@@ -22,9 +22,9 @@ public class CascadingMutualExclusionController {
|
||||
/** GET /list — 목록 조회 (alias) */
|
||||
@GetMapping("/list")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getCascadingMutualExclusionListAlias(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(
|
||||
cascadingMutualExclusionService.getCascadingMutualExclusionList(params)));
|
||||
}
|
||||
@@ -32,9 +32,9 @@ public class CascadingMutualExclusionController {
|
||||
/** GET / — 목록 조회 */
|
||||
@GetMapping
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getCascadingMutualExclusionList(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(
|
||||
cascadingMutualExclusionService.getCascadingMutualExclusionList(params)));
|
||||
}
|
||||
@@ -42,10 +42,10 @@ public class CascadingMutualExclusionController {
|
||||
/** GET /{exclusionId} — 상세 조회 */
|
||||
@GetMapping("/{exclusionId}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getCascadingMutualExclusionInfo(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long exclusionId) {
|
||||
Map<String, Object> params = new LinkedHashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("id", exclusionId);
|
||||
return ResponseEntity.ok(ApiResponse.success(
|
||||
cascadingMutualExclusionService.getCascadingMutualExclusionInfo(params)));
|
||||
@@ -54,9 +54,9 @@ public class CascadingMutualExclusionController {
|
||||
/** POST / — 생성 */
|
||||
@PostMapping
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> insertCascadingMutualExclusion(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(
|
||||
cascadingMutualExclusionService.insertCascadingMutualExclusion(body)));
|
||||
}
|
||||
@@ -64,10 +64,10 @@ public class CascadingMutualExclusionController {
|
||||
/** PUT /{exclusionId} — 수정 */
|
||||
@PutMapping("/{exclusionId}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> updateCascadingMutualExclusion(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long exclusionId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
body.put("id", exclusionId);
|
||||
return ResponseEntity.ok(ApiResponse.success(
|
||||
cascadingMutualExclusionService.updateCascadingMutualExclusion(body)));
|
||||
@@ -76,10 +76,10 @@ public class CascadingMutualExclusionController {
|
||||
/** DELETE /{exclusionId} — 하드 삭제 */
|
||||
@DeleteMapping("/{exclusionId}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> deleteCascadingMutualExclusion(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long exclusionId) {
|
||||
Map<String, Object> params = new LinkedHashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("id", exclusionId);
|
||||
return ResponseEntity.ok(ApiResponse.success(
|
||||
cascadingMutualExclusionService.deleteCascadingMutualExclusion(params)));
|
||||
@@ -87,14 +87,14 @@ public class CascadingMutualExclusionController {
|
||||
|
||||
/**
|
||||
* POST /validate/{exclusionCode} — 상호 배제 검증
|
||||
* body: { "fieldValues": { "fieldA": "val1", "fieldB": "val1" } }
|
||||
* body: { "field_values": { "field_a": "val1", "field_b": "val1" } }
|
||||
*/
|
||||
@PostMapping("/validate/{exclusionCode}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> validateCascadingMutualExclusion(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String exclusionCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
body.put("code", exclusionCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(
|
||||
cascadingMutualExclusionService.validateCascadingMutualExclusion(body)));
|
||||
@@ -106,15 +106,15 @@ public class CascadingMutualExclusionController {
|
||||
*/
|
||||
@GetMapping("/options/{exclusionCode}")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getExcludedOptions(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String exclusionCode,
|
||||
@RequestParam(required = false) String currentField,
|
||||
@RequestParam(required = false) String selectedValues) {
|
||||
Map<String, Object> params = new LinkedHashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("code", exclusionCode);
|
||||
params.put("currentField", currentField);
|
||||
params.put("selectedValues", selectedValues);
|
||||
params.put("current_field", currentField);
|
||||
params.put("selected_values", selectedValues);
|
||||
return ResponseEntity.ok(ApiResponse.success(
|
||||
cascadingMutualExclusionService.getExcludedOptions(params)));
|
||||
}
|
||||
|
||||
@@ -22,9 +22,9 @@ public class CascadingRelationController {
|
||||
/** GET /api/cascading-relation/list — 목록 조회 (alias) */
|
||||
@GetMapping("/list")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getCascadingRelationListAlias(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(
|
||||
cascadingRelationService.getCascadingRelationList(params)));
|
||||
}
|
||||
@@ -32,9 +32,9 @@ public class CascadingRelationController {
|
||||
/** GET /api/cascading-relation — 목록 조회 */
|
||||
@GetMapping
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getCascadingRelationList(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(
|
||||
cascadingRelationService.getCascadingRelationList(params)));
|
||||
}
|
||||
@@ -42,10 +42,10 @@ public class CascadingRelationController {
|
||||
/** GET /api/cascading-relation/{id} — 상세 조회 */
|
||||
@GetMapping("/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getCascadingRelationInfo(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long id) {
|
||||
Map<String, Object> params = new LinkedHashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("id", id);
|
||||
return ResponseEntity.ok(ApiResponse.success(
|
||||
cascadingRelationService.getCascadingRelationInfo(params)));
|
||||
@@ -54,10 +54,10 @@ public class CascadingRelationController {
|
||||
/** GET /api/cascading-relation/code/{code} — 코드로 단건 조회 */
|
||||
@GetMapping("/code/{code}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getCascadingRelationByCode(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String code) {
|
||||
Map<String, Object> params = new LinkedHashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("code", code);
|
||||
return ResponseEntity.ok(ApiResponse.success(
|
||||
cascadingRelationService.getCascadingRelationByCode(params)));
|
||||
@@ -69,10 +69,10 @@ public class CascadingRelationController {
|
||||
*/
|
||||
@GetMapping("/parent-options/{code}")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getParentOptions(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String code) {
|
||||
Map<String, Object> params = new LinkedHashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("code", code);
|
||||
return ResponseEntity.ok(ApiResponse.success(
|
||||
cascadingRelationService.getParentOptions(params)));
|
||||
@@ -84,15 +84,15 @@ public class CascadingRelationController {
|
||||
*/
|
||||
@GetMapping("/options/{code}")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getCascadingOptions(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String code,
|
||||
@RequestParam(required = false) String parentValue,
|
||||
@RequestParam(required = false) String parentValues) {
|
||||
Map<String, Object> params = new LinkedHashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("code", code);
|
||||
params.put("parentValue", parentValue);
|
||||
params.put("parentValues", parentValues);
|
||||
params.put("parent_value", parentValue);
|
||||
params.put("parent_values", parentValues);
|
||||
return ResponseEntity.ok(ApiResponse.success(
|
||||
cascadingRelationService.getCascadingOptions(params)));
|
||||
}
|
||||
@@ -100,11 +100,11 @@ public class CascadingRelationController {
|
||||
/** POST /api/cascading-relation — 생성 */
|
||||
@PostMapping
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> insertCascadingRelation(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute(value = "userId", required = false) String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute(value = "user_id", required = false) String userId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("userId", userId != null ? userId : "system");
|
||||
body.put("company_code", companyCode);
|
||||
body.put("user_id", userId != null ? userId : "system");
|
||||
return ResponseEntity.ok(ApiResponse.success(
|
||||
cascadingRelationService.insertCascadingRelation(body)));
|
||||
}
|
||||
@@ -112,12 +112,12 @@ public class CascadingRelationController {
|
||||
/** PUT /api/cascading-relation/{id} — 수정 */
|
||||
@PutMapping("/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> updateCascadingRelation(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute(value = "userId", required = false) String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute(value = "user_id", required = false) String userId,
|
||||
@PathVariable Long id,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("userId", userId != null ? userId : "system");
|
||||
body.put("company_code", companyCode);
|
||||
body.put("user_id", userId != null ? userId : "system");
|
||||
body.put("id", id);
|
||||
return ResponseEntity.ok(ApiResponse.success(
|
||||
cascadingRelationService.updateCascadingRelation(body)));
|
||||
@@ -126,12 +126,12 @@ public class CascadingRelationController {
|
||||
/** DELETE /api/cascading-relation/{id} — 소프트 삭제 (is_active = 'N') */
|
||||
@DeleteMapping("/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> deleteCascadingRelation(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute(value = "userId", required = false) String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute(value = "user_id", required = false) String userId,
|
||||
@PathVariable Long id) {
|
||||
Map<String, Object> params = new LinkedHashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("userId", userId != null ? userId : "system");
|
||||
params.put("company_code", companyCode);
|
||||
params.put("user_id", userId != null ? userId : "system");
|
||||
params.put("id", id);
|
||||
return ResponseEntity.ok(ApiResponse.success(
|
||||
cascadingRelationService.deleteCascadingRelation(params)));
|
||||
|
||||
@@ -25,7 +25,7 @@ public class CategoryTreeController {
|
||||
*/
|
||||
@GetMapping("/test/all-category-keys")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getCategoryTreeKeyList(
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
|
||||
List<Map<String, Object>> keys = categoryTreeService.getCategoryTreeKeyList(companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(keys));
|
||||
@@ -37,7 +37,7 @@ public class CategoryTreeController {
|
||||
*/
|
||||
@GetMapping("/test/{tableName}/{columnName}")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getCategoryTreeList(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String tableName,
|
||||
@PathVariable String columnName) {
|
||||
|
||||
@@ -51,7 +51,7 @@ public class CategoryTreeController {
|
||||
*/
|
||||
@GetMapping("/test/{tableName}/{columnName}/flat")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getCategoryTreeFlatList(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String tableName,
|
||||
@PathVariable String columnName) {
|
||||
|
||||
@@ -65,7 +65,7 @@ public class CategoryTreeController {
|
||||
*/
|
||||
@GetMapping("/test/value/{valueId}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getCategoryTreeInfo(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable int valueId) {
|
||||
|
||||
Map<String, Object> value = categoryTreeService.getCategoryTreeInfo(companyCode, valueId);
|
||||
@@ -81,19 +81,19 @@ public class CategoryTreeController {
|
||||
*/
|
||||
@PostMapping("/test/value")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> insertCategoryTree(
|
||||
@RequestAttribute("companyCode") String userCompanyCode,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("company_code") String userCompanyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
|
||||
if (body.get("tableName") == null || body.get("columnName") == null
|
||||
|| body.get("valueCode") == null || body.get("valueLabel") == null) {
|
||||
if (body.get("table_name") == null || body.get("column_name") == null
|
||||
|| body.get("value_code") == null || body.get("value_label") == null) {
|
||||
return ResponseEntity.badRequest()
|
||||
.body(ApiResponse.error("tableName, columnName, valueCode, valueLabel은 필수입니다"));
|
||||
}
|
||||
|
||||
// 최고 관리자(*) 는 targetCompanyCode 로 회사 코드 오버라이드 가능
|
||||
String companyCode = userCompanyCode;
|
||||
String targetCompanyCode = (String) body.get("targetCompanyCode");
|
||||
String targetCompanyCode = (String) body.get("target_company_code");
|
||||
if (targetCompanyCode != null && "*".equals(userCompanyCode)) {
|
||||
companyCode = targetCompanyCode;
|
||||
}
|
||||
@@ -115,8 +115,8 @@ public class CategoryTreeController {
|
||||
*/
|
||||
@PutMapping("/test/value/{valueId}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> updateCategoryTree(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@PathVariable int valueId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
|
||||
@@ -140,7 +140,7 @@ public class CategoryTreeController {
|
||||
*/
|
||||
@GetMapping("/test/value/{valueId}/can-delete")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> checkCanDelete(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable int valueId) {
|
||||
|
||||
Map<String, Object> result = categoryTreeService.checkCanDelete(companyCode, valueId);
|
||||
@@ -153,7 +153,7 @@ public class CategoryTreeController {
|
||||
*/
|
||||
@DeleteMapping("/test/value/{valueId}")
|
||||
public ResponseEntity<ApiResponse<Void>> deleteCategoryTree(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable int valueId) {
|
||||
|
||||
try {
|
||||
@@ -182,7 +182,7 @@ public class CategoryTreeController {
|
||||
*/
|
||||
@GetMapping("/test/columns/{tableName}")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getCategoryTreeColumnList(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String tableName) {
|
||||
|
||||
List<Map<String, Object>> columns = categoryTreeService.getCategoryTreeColumnList(companyCode, tableName);
|
||||
|
||||
+27
-27
@@ -18,20 +18,20 @@ public class CategoryValueCascadingController {
|
||||
/** GET /groups → 그룹 목록 조회 */
|
||||
@GetMapping("/groups")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getCategoryValueCascadingGroupList(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(categoryValueCascadingService.getCategoryValueCascadingGroupList(params)));
|
||||
}
|
||||
|
||||
/** GET /groups/{groupId} → 그룹 상세 조회 (매핑 포함) */
|
||||
@GetMapping("/groups/{groupId}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getCategoryValueCascadingGroupInfo(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long groupId) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("groupId", groupId);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("group_id", groupId);
|
||||
Map<String, Object> result = categoryValueCascadingService.getCategoryValueCascadingGroupInfo(params);
|
||||
if (result == null) {
|
||||
return ResponseEntity.status(404).body(ApiResponse.error("카테고리 값 연쇄관계 그룹을 찾을 수 없습니다."));
|
||||
@@ -42,10 +42,10 @@ public class CategoryValueCascadingController {
|
||||
/** GET /code/{code} → 관계 코드로 조회 */
|
||||
@GetMapping("/code/{code}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getCategoryValueCascadingGroupByCode(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String code) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("code", code);
|
||||
Map<String, Object> result = categoryValueCascadingService.getCategoryValueCascadingGroupByCode(params);
|
||||
if (result == null) {
|
||||
@@ -57,52 +57,52 @@ public class CategoryValueCascadingController {
|
||||
/** POST /groups → 그룹 생성 */
|
||||
@PostMapping("/groups")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> insertCategoryValueCascadingGroup(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(categoryValueCascadingService.insertCategoryValueCascadingGroup(body)));
|
||||
}
|
||||
|
||||
/** PUT /groups/{groupId} → 그룹 수정 */
|
||||
@PutMapping("/groups/{groupId}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> updateCategoryValueCascadingGroup(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long groupId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("groupId", groupId);
|
||||
body.put("company_code", companyCode);
|
||||
body.put("group_id", groupId);
|
||||
return ResponseEntity.ok(ApiResponse.success(categoryValueCascadingService.updateCategoryValueCascadingGroup(body)));
|
||||
}
|
||||
|
||||
/** DELETE /groups/{groupId} → 그룹 소프트 삭제 */
|
||||
@DeleteMapping("/groups/{groupId}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> deleteCategoryValueCascadingGroup(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long groupId) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("groupId", groupId);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("group_id", groupId);
|
||||
return ResponseEntity.ok(ApiResponse.success(categoryValueCascadingService.deleteCategoryValueCascadingGroup(params)));
|
||||
}
|
||||
|
||||
/** POST /groups/{groupId}/mappings → 매핑 일괄 저장 */
|
||||
@PostMapping("/groups/{groupId}/mappings")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> saveCategoryValueCascadingMappings(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long groupId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("groupId", groupId);
|
||||
body.put("company_code", companyCode);
|
||||
body.put("group_id", groupId);
|
||||
return ResponseEntity.ok(ApiResponse.success(categoryValueCascadingService.saveCategoryValueCascadingMappings(body)));
|
||||
}
|
||||
|
||||
/** GET /parent-options/{code} → 부모 카테고리 값 목록 */
|
||||
@GetMapping("/parent-options/{code}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getCategoryValueCascadingParentOptions(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String code,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("code", code);
|
||||
return ResponseEntity.ok(ApiResponse.success(categoryValueCascadingService.getCategoryValueCascadingParentOptions(params)));
|
||||
}
|
||||
@@ -110,10 +110,10 @@ public class CategoryValueCascadingController {
|
||||
/** GET /child-options/{code} → 자식 카테고리 값 목록 */
|
||||
@GetMapping("/child-options/{code}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getCategoryValueCascadingChildOptions(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String code,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("code", code);
|
||||
return ResponseEntity.ok(ApiResponse.success(categoryValueCascadingService.getCategoryValueCascadingChildOptions(params)));
|
||||
}
|
||||
@@ -121,10 +121,10 @@ public class CategoryValueCascadingController {
|
||||
/** GET /options/{code} → 연쇄 옵션 조회 (parentValue/parentValues 파라미터) */
|
||||
@GetMapping("/options/{code}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getCategoryValueCascadingOptions(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String code,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("code", code);
|
||||
return ResponseEntity.ok(ApiResponse.success(categoryValueCascadingService.getCategoryValueCascadingOptions(params)));
|
||||
}
|
||||
@@ -132,11 +132,11 @@ public class CategoryValueCascadingController {
|
||||
/** GET /table/{tableName}/mappings → 테이블별 매핑 조회 */
|
||||
@GetMapping("/table/{tableName}/mappings")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getCategoryValueCascadingMappingsByTable(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String tableName) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("tableName", tableName);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("table_name", tableName);
|
||||
return ResponseEntity.ok(ApiResponse.success(categoryValueCascadingService.getCategoryValueCascadingMappingsByTable(params)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,9 +20,9 @@ public class CodeMergeController {
|
||||
/** POST /api/code-merge/merge-all-tables — columnName 기준 전체 테이블 코드 병합 */
|
||||
@PostMapping("/merge-all-tables")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> mergeAllTables(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(
|
||||
codeMergeService.mergeAllTables(body),
|
||||
"코드 병합이 완료되었습니다."));
|
||||
@@ -39,9 +39,9 @@ public class CodeMergeController {
|
||||
/** POST /api/code-merge/preview — columnName + oldValue 기준 영향 미리보기 */
|
||||
@PostMapping("/preview")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> previewCodeMerge(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(
|
||||
codeMergeService.previewCodeMerge(body)));
|
||||
}
|
||||
@@ -49,9 +49,9 @@ public class CodeMergeController {
|
||||
/** POST /api/code-merge/merge-by-value — 값 기반 전체 테이블/컬럼 코드 병합 */
|
||||
@PostMapping("/merge-by-value")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> mergeByValue(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(
|
||||
codeMergeService.mergeByValue(body),
|
||||
"코드 병합이 완료되었습니다."));
|
||||
@@ -60,9 +60,9 @@ public class CodeMergeController {
|
||||
/** POST /api/code-merge/preview-by-value — 값 기반 영향 미리보기 */
|
||||
@PostMapping("/preview-by-value")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> previewByValue(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(
|
||||
codeMergeService.previewByValue(body)));
|
||||
}
|
||||
|
||||
@@ -16,82 +16,82 @@ public class CollectionController {
|
||||
|
||||
@GetMapping
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getCollectionList(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(collectionService.getCollectionList(params)));
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getCollectionListAlias(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(collectionService.getCollectionList(params)));
|
||||
}
|
||||
|
||||
@GetMapping("/jobs/list")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getCollectionJobList(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(collectionService.getCollectionJobList(params)));
|
||||
}
|
||||
|
||||
@GetMapping("/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getCollectionInfo(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long id) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("id", id);
|
||||
return ResponseEntity.ok(ApiResponse.success(collectionService.getCollectionInfo(params)));
|
||||
}
|
||||
|
||||
@GetMapping("/{configId}/history")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getCollectionHistory(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long configId) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("configId", configId);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("config_id", configId);
|
||||
return ResponseEntity.ok(ApiResponse.success(collectionService.getCollectionHistory(params)));
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> insertCollection(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
return ResponseEntity.status(201).body(ApiResponse.success(collectionService.insertCollection(body), "수집 설정이 생성되었습니다."));
|
||||
}
|
||||
|
||||
@PostMapping("/{id}/execute")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> executeCollection(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long id) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("id", id);
|
||||
return ResponseEntity.ok(ApiResponse.success(collectionService.executeCollection(params)));
|
||||
}
|
||||
|
||||
@PutMapping("/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> updateCollection(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long id,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
body.put("id", id);
|
||||
return ResponseEntity.ok(ApiResponse.success(collectionService.updateCollection(body)));
|
||||
}
|
||||
|
||||
@DeleteMapping("/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> deleteCollection(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long id) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("id", id);
|
||||
collectionService.deleteCollection(params);
|
||||
return ResponseEntity.ok(ApiResponse.success(null, "수집 설정이 삭제되었습니다."));
|
||||
|
||||
@@ -34,10 +34,10 @@ public class CommonCodeController {
|
||||
|
||||
@GetMapping("/categories")
|
||||
public ResponseEntity<Map<String, Object>> getCommonCodeCategoryList(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
Map<String, Object> svcResult = service.getCommonCodeCategoryList(params);
|
||||
|
||||
Map<String, Object> response = new java.util.LinkedHashMap<>();
|
||||
@@ -54,8 +54,8 @@ public class CommonCodeController {
|
||||
|
||||
@GetMapping("/categories/check-duplicate")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> checkCategoryDuplicate(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestParam(defaultValue = "categoryCode") String field,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam(defaultValue = "category_code") String field,
|
||||
@RequestParam String value,
|
||||
@RequestParam(required = false) String excludeCode) {
|
||||
|
||||
@@ -69,11 +69,11 @@ public class CommonCodeController {
|
||||
|
||||
@PostMapping("/categories")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> insertCommonCodeCategory(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
|
||||
if (body.get("categoryCode") == null || body.get("categoryName") == null) {
|
||||
if (body.get("category_code") == null || body.get("category_name") == null) {
|
||||
return ResponseEntity.status(400)
|
||||
.body(ApiResponse.error("필수 필드가 누락되었습니다. (categoryCode, categoryName)"));
|
||||
}
|
||||
@@ -94,8 +94,8 @@ public class CommonCodeController {
|
||||
|
||||
@PutMapping("/categories/{categoryCode}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> updateCommonCodeCategory(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@PathVariable String categoryCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
|
||||
@@ -119,7 +119,7 @@ public class CommonCodeController {
|
||||
|
||||
@DeleteMapping("/categories/{categoryCode}")
|
||||
public ResponseEntity<ApiResponse<Void>> deleteCommonCodeCategory(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String categoryCode) {
|
||||
|
||||
try {
|
||||
@@ -140,11 +140,11 @@ public class CommonCodeController {
|
||||
|
||||
@GetMapping("/categories/{categoryCode}/codes")
|
||||
public ResponseEntity<Map<String, Object>> getCommonCodeList(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String categoryCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
Map<String, Object> svcResult = service.getCommonCodeList(categoryCode, params);
|
||||
|
||||
Map<String, Object> response = new java.util.LinkedHashMap<>();
|
||||
@@ -161,12 +161,12 @@ public class CommonCodeController {
|
||||
|
||||
@PostMapping("/categories/{categoryCode}/codes")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> insertCommonCode(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@PathVariable String categoryCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
|
||||
if (body.get("codeValue") == null || body.get("codeName") == null) {
|
||||
if (body.get("code_value") == null || body.get("code_name") == null) {
|
||||
return ResponseEntity.status(400)
|
||||
.body(ApiResponse.error("필수 필드가 누락되었습니다. (codeValue, codeName)"));
|
||||
}
|
||||
@@ -187,9 +187,9 @@ public class CommonCodeController {
|
||||
|
||||
@GetMapping("/categories/{categoryCode}/codes/check-duplicate")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> checkCodeDuplicate(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String categoryCode,
|
||||
@RequestParam(defaultValue = "codeValue") String field,
|
||||
@RequestParam(defaultValue = "code_value") String field,
|
||||
@RequestParam String value,
|
||||
@RequestParam(required = false) String excludeCode) {
|
||||
|
||||
@@ -204,7 +204,7 @@ public class CommonCodeController {
|
||||
@SuppressWarnings("unchecked")
|
||||
@PutMapping("/categories/{categoryCode}/codes/reorder")
|
||||
public ResponseEntity<ApiResponse<Void>> updateCommonCodeOrder(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String categoryCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
|
||||
@@ -229,11 +229,11 @@ public class CommonCodeController {
|
||||
|
||||
@GetMapping("/categories/{categoryCode}/hierarchy")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getCommonCodeHierarchicalList(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String categoryCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(
|
||||
ApiResponse.success(service.getCommonCodeHierarchicalList(categoryCode, params)));
|
||||
}
|
||||
@@ -244,7 +244,7 @@ public class CommonCodeController {
|
||||
|
||||
@GetMapping("/categories/{categoryCode}/tree")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getCommonCodeTree(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String categoryCode) {
|
||||
|
||||
return ResponseEntity.ok(
|
||||
@@ -257,11 +257,11 @@ public class CommonCodeController {
|
||||
|
||||
@GetMapping("/categories/{categoryCode}/options")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getCommonCodeOptionList(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String categoryCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(
|
||||
ApiResponse.success(service.getCommonCodeOptionList(categoryCode, params)));
|
||||
}
|
||||
@@ -272,7 +272,7 @@ public class CommonCodeController {
|
||||
|
||||
@GetMapping("/categories/{categoryCode}/codes/{codeValue}/has-children")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> hasChildren(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String categoryCode,
|
||||
@PathVariable String codeValue) {
|
||||
|
||||
@@ -286,8 +286,8 @@ public class CommonCodeController {
|
||||
|
||||
@PutMapping("/categories/{categoryCode}/codes/{codeValue}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> updateCommonCode(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@PathVariable String categoryCode,
|
||||
@PathVariable String codeValue,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
@@ -312,7 +312,7 @@ public class CommonCodeController {
|
||||
|
||||
@DeleteMapping("/categories/{categoryCode}/codes/{codeValue}")
|
||||
public ResponseEntity<ApiResponse<Void>> deleteCommonCode(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String categoryCode,
|
||||
@PathVariable String codeValue) {
|
||||
|
||||
|
||||
@@ -28,14 +28,14 @@ public class CompanyManagementController {
|
||||
@RequestBody(required = false) Map<String, Object> body) {
|
||||
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
if (body != null) {
|
||||
params.putAll(body);
|
||||
}
|
||||
|
||||
try {
|
||||
Map<String, Object> data = companyManagementService.deleteCompany(params);
|
||||
String companyName = (String) data.get("companyName");
|
||||
String companyName = (String) data.get("company_name");
|
||||
return ResponseEntity.ok(
|
||||
ApiResponse.success(data, "회사 '" + companyName + "'이(가) 성공적으로 삭제되었습니다."));
|
||||
} catch (IllegalArgumentException e) {
|
||||
|
||||
@@ -41,9 +41,9 @@ public class ComponentStandardController {
|
||||
|
||||
@GetMapping
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getComponents(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(service.getComponents(params)));
|
||||
}
|
||||
|
||||
@@ -53,9 +53,9 @@ public class ComponentStandardController {
|
||||
|
||||
@GetMapping("/categories")
|
||||
public ResponseEntity<ApiResponse<List<String>>> getCategories(
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(service.getCategories(params)));
|
||||
}
|
||||
|
||||
@@ -65,9 +65,9 @@ public class ComponentStandardController {
|
||||
|
||||
@GetMapping("/statistics")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getStatistics(
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(service.getStatistics(params)));
|
||||
}
|
||||
|
||||
@@ -77,11 +77,11 @@ public class ComponentStandardController {
|
||||
|
||||
@GetMapping("/check-duplicate/{component_code}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> checkDuplicate(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable("component_code") String componentCode) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("component_code", componentCode);
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
boolean exists = service.checkDuplicate(params);
|
||||
return ResponseEntity.ok(ApiResponse.success(Map.of("exists", exists)));
|
||||
}
|
||||
@@ -106,9 +106,9 @@ public class ComponentStandardController {
|
||||
|
||||
@PostMapping
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> createComponent(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
body.putIfAbsent("company_code", companyCode);
|
||||
try {
|
||||
return ResponseEntity.ok(ApiResponse.success(service.createComponent(body)));
|
||||
|
||||
@@ -20,33 +20,33 @@ public class DashboardController {
|
||||
|
||||
@GetMapping
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getDashboards(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(dashboardService.getDashboardList(params)));
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getDashboardsLegacy(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(dashboardService.getDashboardList(params)));
|
||||
}
|
||||
|
||||
@GetMapping("/public")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getPublicDashboards(
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", "*");
|
||||
params.put("isPublic", "true");
|
||||
params.put("company_code", "*");
|
||||
params.put("is_public", "true");
|
||||
return ResponseEntity.ok(ApiResponse.success(dashboardService.getDashboardList(params)));
|
||||
}
|
||||
|
||||
@GetMapping("/my")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getMyDashboards(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(dashboardService.getDashboardList(params)));
|
||||
}
|
||||
|
||||
@@ -60,13 +60,13 @@ public class DashboardController {
|
||||
|
||||
@GetMapping("/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getDashboard(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute(value = "userId", required = false) String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute(value = "user_id", required = false) String userId,
|
||||
@PathVariable String id) {
|
||||
Map<String, Object> result = dashboardService.getDashboardById(id, companyCode);
|
||||
if (result == null) return ResponseEntity.status(404).body(ApiResponse.error("대시보드를 찾을 수 없거나 접근 권한이 없습니다."));
|
||||
// 다른 사람 것 조회 시 조회수 증가
|
||||
if (userId != null && !userId.equals(result.get("createdBy"))) {
|
||||
if (userId != null && !userId.equals(result.get("created_by"))) {
|
||||
dashboardService.incrementViewCount(id);
|
||||
}
|
||||
return ResponseEntity.ok(ApiResponse.success(result));
|
||||
@@ -74,8 +74,8 @@ public class DashboardController {
|
||||
|
||||
@PostMapping
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> createDashboard(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute(value = "userId", required = false) String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute(value = "user_id", required = false) String userId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
String title = (String) body.get("title");
|
||||
if (title == null || title.isBlank()) return ResponseEntity.status(400).body(ApiResponse.error("대시보드 제목이 필요합니다."));
|
||||
@@ -86,7 +86,7 @@ public class DashboardController {
|
||||
@PutMapping("/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> updateDashboard(
|
||||
@PathVariable String id,
|
||||
@RequestAttribute(value = "userId", required = false) String userId,
|
||||
@RequestAttribute(value = "user_id", required = false) String userId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
Map<String, Object> result = dashboardService.updateDashboard(id, body, userId);
|
||||
if (result == null) return ResponseEntity.status(404).body(ApiResponse.error("대시보드를 찾을 수 없거나 수정 권한이 없습니다."));
|
||||
@@ -96,7 +96,7 @@ public class DashboardController {
|
||||
@DeleteMapping("/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> deleteDashboard(
|
||||
@PathVariable String id,
|
||||
@RequestAttribute(value = "userId", required = false) String userId) {
|
||||
@RequestAttribute(value = "user_id", required = false) String userId) {
|
||||
boolean deleted = dashboardService.deleteDashboard(id, userId);
|
||||
if (!deleted) return ResponseEntity.status(404).body(ApiResponse.error("대시보드를 찾을 수 없거나 삭제 권한이 없습니다."));
|
||||
return ResponseEntity.ok(ApiResponse.success(null, "대시보드가 삭제되었습니다."));
|
||||
@@ -130,14 +130,14 @@ public class DashboardController {
|
||||
|
||||
@PostMapping("/fetch-external-api")
|
||||
public ResponseEntity<ApiResponse<Object>> fetchExternalApi(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
String url = (String) body.get("url");
|
||||
if (url == null || url.isBlank()) return ResponseEntity.status(400).body(ApiResponse.error("URL이 필요합니다."));
|
||||
Object externalConnectionId = body.get("externalConnectionId");
|
||||
Object externalConnectionId = body.get("external_connection_id");
|
||||
|
||||
Map<String, Object> requestParams = new HashMap<>(body);
|
||||
requestParams.put("companyCode", companyCode);
|
||||
requestParams.put("company_code", companyCode);
|
||||
if (externalConnectionId != null) {
|
||||
int connId = Integer.parseInt(String.valueOf(externalConnectionId));
|
||||
Map<String, Object> result = externalRestApiConnectionService.fetchData(connId, url, null, requestParams);
|
||||
@@ -154,7 +154,7 @@ public class DashboardController {
|
||||
@PostMapping("/table-schema")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getTableSchema(
|
||||
@RequestBody Map<String, Object> body) {
|
||||
String tableName = (String) body.get("tableName");
|
||||
String tableName = (String) body.get("table_name");
|
||||
if (tableName == null || tableName.isBlank()) return ResponseEntity.status(400).body(ApiResponse.error("테이블명이 필요합니다."));
|
||||
try {
|
||||
Map<String, Object> result = dashboardService.getTableSchema(tableName);
|
||||
|
||||
@@ -18,9 +18,9 @@ public class DataAdvancedController {
|
||||
|
||||
@PostMapping("/upsert-grouped")
|
||||
public ResponseEntity<Map<String, Object>> upsertGrouped(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
try {
|
||||
Map<String, Object> result = dataAdvancedService.upsertGrouped(body);
|
||||
Map<String, Object> response = new LinkedHashMap<>();
|
||||
@@ -29,7 +29,7 @@ public class DataAdvancedController {
|
||||
response.put("inserted", result.getOrDefault("inserted", 0));
|
||||
response.put("updated", result.getOrDefault("updated", 0));
|
||||
response.put("deleted", result.getOrDefault("deleted", 0));
|
||||
response.put("savedIds", result.getOrDefault("savedIds", Collections.emptyList()));
|
||||
response.put("saved_ids", result.getOrDefault("saved_ids", Collections.emptyList()));
|
||||
return ResponseEntity.ok(response);
|
||||
} catch (IllegalArgumentException e) {
|
||||
Map<String, Object> err = new LinkedHashMap<>();
|
||||
@@ -41,18 +41,18 @@ public class DataAdvancedController {
|
||||
|
||||
@PostMapping("/{tableName}/delete")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> deleteByCondition(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String tableName,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
// Node.js는 복합키를 body에 직접 전송 (e.g. {user_id: 'x', dept_code: 'y'})
|
||||
// DataService.deleteByCompositeKey는 params.get("keys")를 기대하므로 래핑
|
||||
Map<String, Object> keys = new LinkedHashMap<>(body);
|
||||
keys.remove("tableName");
|
||||
keys.remove("companyCode");
|
||||
keys.remove("table_name");
|
||||
keys.remove("company_code");
|
||||
|
||||
Map<String, Object> params = new LinkedHashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("tableName", tableName);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("table_name", tableName);
|
||||
params.put("keys", keys);
|
||||
try {
|
||||
return ResponseEntity.ok(ApiResponse.success(dataAdvancedService.deleteByCondition(params)));
|
||||
@@ -63,18 +63,18 @@ public class DataAdvancedController {
|
||||
|
||||
@PostMapping("/{tableName}/delete-group")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> deleteGroup(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String tableName,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
// Node.js는 필터 조건을 body에 직접 전송
|
||||
// DataService.deleteGroupRecords는 params.get("filters")를 기대하므로 래핑
|
||||
Map<String, Object> filters = new LinkedHashMap<>(body);
|
||||
filters.remove("tableName");
|
||||
filters.remove("companyCode");
|
||||
filters.remove("table_name");
|
||||
filters.remove("company_code");
|
||||
|
||||
Map<String, Object> params = new LinkedHashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("tableName", tableName);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("table_name", tableName);
|
||||
params.put("filters", filters);
|
||||
try {
|
||||
return ResponseEntity.ok(ApiResponse.success(dataAdvancedService.deleteGroup(params)));
|
||||
@@ -85,51 +85,51 @@ public class DataAdvancedController {
|
||||
|
||||
@GetMapping("/multi-table/auto-detect")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> autoDetectMultiTable(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(dataAdvancedService.autoDetectMultiTable(params)));
|
||||
}
|
||||
|
||||
@PostMapping("/multi-table/upload")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> uploadMultiTable(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(dataAdvancedService.uploadMultiTable(body)));
|
||||
}
|
||||
|
||||
@GetMapping("/master-detail/relation/{screenId}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getMasterDetailRelation(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String screenId) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("screenId", screenId);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("screen_id", screenId);
|
||||
return ResponseEntity.ok(ApiResponse.success(dataAdvancedService.getMasterDetailRelation(params)));
|
||||
}
|
||||
|
||||
@PostMapping("/master-detail/download")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> downloadMasterDetail(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(dataAdvancedService.downloadMasterDetail(body)));
|
||||
}
|
||||
|
||||
@PostMapping("/master-detail/upload")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> uploadMasterDetail(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(dataAdvancedService.uploadMasterDetail(body)));
|
||||
}
|
||||
|
||||
@PostMapping("/master-detail/upload-simple")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> uploadMasterDetailSimple(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(dataAdvancedService.uploadMasterDetailSimple(body)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,19 +17,19 @@ public class DataController {
|
||||
|
||||
@GetMapping("/join")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getJoinData(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(dataService.getJoinData(params)));
|
||||
}
|
||||
|
||||
@GetMapping("/{tableName}")
|
||||
public ResponseEntity<Map<String, Object>> getTableData(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String tableName,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("tableName", tableName);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("table_name", tableName);
|
||||
try {
|
||||
Map<String, Object> svc = dataService.getTableData(params);
|
||||
Map<String, Object> response = new LinkedHashMap<>();
|
||||
@@ -38,7 +38,7 @@ public class DataController {
|
||||
response.put("total", svc.get("total"));
|
||||
response.put("page", svc.get("page"));
|
||||
response.put("size", svc.get("limit"));
|
||||
response.put("totalPages", svc.get("totalPages"));
|
||||
response.put("total_pages", svc.get("total_pages"));
|
||||
return ResponseEntity.ok(response);
|
||||
} catch (IllegalArgumentException e) {
|
||||
Map<String, Object> err = new LinkedHashMap<>();
|
||||
@@ -50,7 +50,7 @@ public class DataController {
|
||||
|
||||
@GetMapping("/{tableName}/columns")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getTableColumns(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String tableName) {
|
||||
try {
|
||||
return ResponseEntity.ok(ApiResponse.success(dataService.getTableColumns(tableName)));
|
||||
@@ -61,12 +61,12 @@ public class DataController {
|
||||
|
||||
@GetMapping("/{tableName}/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getRecordDetail(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String tableName,
|
||||
@PathVariable String id) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("tableName", tableName);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("table_name", tableName);
|
||||
params.put("id", id);
|
||||
try {
|
||||
Map<String, Object> result = dataService.getRecordDetail(params);
|
||||
@@ -79,11 +79,11 @@ public class DataController {
|
||||
|
||||
@PostMapping("/{tableName}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> createRecord(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String tableName,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("tableName", tableName);
|
||||
body.put("company_code", companyCode);
|
||||
body.put("table_name", tableName);
|
||||
try {
|
||||
return ResponseEntity.status(201).body(
|
||||
ApiResponse.success(dataService.createRecord(body), "레코드가 생성되었습니다."));
|
||||
@@ -94,12 +94,12 @@ public class DataController {
|
||||
|
||||
@PutMapping("/{tableName}/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> updateRecord(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String tableName,
|
||||
@PathVariable String id,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("tableName", tableName);
|
||||
body.put("company_code", companyCode);
|
||||
body.put("table_name", tableName);
|
||||
body.put("id", id);
|
||||
try {
|
||||
Map<String, Object> result = dataService.updateRecord(body);
|
||||
@@ -112,12 +112,12 @@ public class DataController {
|
||||
|
||||
@DeleteMapping("/{tableName}/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> deleteRecord(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String tableName,
|
||||
@PathVariable String id) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("tableName", tableName);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("table_name", tableName);
|
||||
params.put("id", id);
|
||||
try {
|
||||
Map<String, Object> result = dataService.deleteRecord(params);
|
||||
|
||||
@@ -28,15 +28,15 @@ public class DataflowController {
|
||||
*/
|
||||
@PostMapping("/table-relationships")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> createTableRelationship(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
|
||||
String relName = str(body.get("relationshipName"));
|
||||
String fromTbl = str(body.get("fromTableName"));
|
||||
String fromCol = str(body.get("fromColumnName"));
|
||||
String toTbl = str(body.get("toTableName"));
|
||||
String toCol = str(body.get("toColumnName"));
|
||||
String relName = str(body.get("relationship_name"));
|
||||
String fromTbl = str(body.get("from_table_name"));
|
||||
String fromCol = str(body.get("from_column_name"));
|
||||
String toTbl = str(body.get("to_table_name"));
|
||||
String toCol = str(body.get("to_column_name"));
|
||||
|
||||
if (blank(relName) || blank(fromTbl) || blank(fromCol) || blank(toTbl) || blank(toCol)) {
|
||||
return ResponseEntity.badRequest()
|
||||
@@ -60,7 +60,7 @@ public class DataflowController {
|
||||
*/
|
||||
@GetMapping("/table-relationships")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getTableRelationshipList(
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
try {
|
||||
return ResponseEntity.ok(ApiResponse.success(
|
||||
dataflowService.getTableRelationshipList(companyCode),
|
||||
@@ -76,7 +76,7 @@ public class DataflowController {
|
||||
*/
|
||||
@GetMapping("/table-relationships/{relationshipId}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getTableRelationshipInfo(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable int relationshipId) {
|
||||
try {
|
||||
Map<String, Object> rel = dataflowService.getTableRelationshipInfo(relationshipId, companyCode);
|
||||
@@ -95,8 +95,8 @@ public class DataflowController {
|
||||
*/
|
||||
@PutMapping("/table-relationships/{relationshipId}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> updateTableRelationship(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@PathVariable int relationshipId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
try {
|
||||
@@ -117,7 +117,7 @@ public class DataflowController {
|
||||
*/
|
||||
@DeleteMapping("/table-relationships/{relationshipId}")
|
||||
public ResponseEntity<ApiResponse<Void>> deleteTableRelationship(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable int relationshipId) {
|
||||
try {
|
||||
boolean deleted = dataflowService.deleteTableRelationship(relationshipId, companyCode);
|
||||
@@ -140,13 +140,13 @@ public class DataflowController {
|
||||
*/
|
||||
@PostMapping("/data-links")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> createDataLink(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
|
||||
if (body.get("relationshipId") == null || blank(str(body.get("fromTableName")))
|
||||
|| blank(str(body.get("fromColumnName"))) || blank(str(body.get("toTableName")))
|
||||
|| blank(str(body.get("toColumnName"))) || blank(str(body.get("connectionType")))) {
|
||||
if (body.get("relationship_id") == null || blank(str(body.get("from_table_name")))
|
||||
|| blank(str(body.get("from_column_name"))) || blank(str(body.get("to_table_name")))
|
||||
|| blank(str(body.get("to_column_name"))) || blank(str(body.get("connection_type")))) {
|
||||
return ResponseEntity.badRequest()
|
||||
.body(ApiResponse.error("필수 필드가 누락되었습니다."));
|
||||
}
|
||||
@@ -166,7 +166,7 @@ public class DataflowController {
|
||||
*/
|
||||
@GetMapping("/data-links/relationship/{relationshipId}")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getDataLinkList(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable int relationshipId) {
|
||||
try {
|
||||
return ResponseEntity.ok(ApiResponse.success(
|
||||
@@ -183,8 +183,8 @@ public class DataflowController {
|
||||
*/
|
||||
@DeleteMapping("/data-links/{bridgeId}")
|
||||
public ResponseEntity<ApiResponse<Void>> deleteDataLink(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@PathVariable int bridgeId) {
|
||||
try {
|
||||
dataflowService.deleteDataLink(bridgeId, companyCode, userId);
|
||||
@@ -204,7 +204,7 @@ public class DataflowController {
|
||||
*/
|
||||
@GetMapping("/table-data/{tableName}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getTableData(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String tableName,
|
||||
@RequestParam(defaultValue = "1") int page,
|
||||
@RequestParam(defaultValue = "10") int limit,
|
||||
@@ -231,7 +231,7 @@ public class DataflowController {
|
||||
*/
|
||||
@GetMapping("/diagrams")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getDiagramList(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam(defaultValue = "1") int page,
|
||||
@RequestParam(defaultValue = "20") int size,
|
||||
@RequestParam(defaultValue = "") String searchTerm) {
|
||||
@@ -251,7 +251,7 @@ public class DataflowController {
|
||||
*/
|
||||
@GetMapping("/diagrams/name/{diagramName}/relationships")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getDiagramRelationshipList(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String diagramName) {
|
||||
try {
|
||||
return ResponseEntity.ok(ApiResponse.success(
|
||||
@@ -269,7 +269,7 @@ public class DataflowController {
|
||||
*/
|
||||
@GetMapping("/diagrams/{diagramId}/relationships")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getDiagramRelationshipListByDiagramId(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable int diagramId) {
|
||||
try {
|
||||
return ResponseEntity.ok(ApiResponse.success(
|
||||
@@ -286,13 +286,13 @@ public class DataflowController {
|
||||
*/
|
||||
@PostMapping("/diagrams/{diagramName}/copy")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> copyDiagram(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String diagramName) {
|
||||
try {
|
||||
String decoded = java.net.URLDecoder.decode(diagramName, "UTF-8");
|
||||
String newDiagramName = dataflowService.copyDiagram(companyCode, decoded);
|
||||
Map<String, Object> data = new HashMap<>();
|
||||
data.put("newDiagramName", newDiagramName);
|
||||
data.put("new_diagram_name", newDiagramName);
|
||||
return ResponseEntity.ok(ApiResponse.success(data, "관계도가 성공적으로 복사되었습니다."));
|
||||
} catch (IllegalArgumentException e) {
|
||||
return ResponseEntity.status(404).body(ApiResponse.error(e.getMessage()));
|
||||
@@ -307,13 +307,13 @@ public class DataflowController {
|
||||
*/
|
||||
@DeleteMapping("/diagrams/{diagramName}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> deleteDiagram(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String diagramName) {
|
||||
try {
|
||||
String decoded = java.net.URLDecoder.decode(diagramName, "UTF-8");
|
||||
int deletedCount = dataflowService.deleteDiagram(companyCode, decoded);
|
||||
Map<String, Object> data = new HashMap<>();
|
||||
data.put("deletedCount", deletedCount);
|
||||
data.put("deleted_count", deletedCount);
|
||||
return ResponseEntity.ok(ApiResponse.success(data, "관계도가 성공적으로 삭제되었습니다."));
|
||||
} catch (Exception e) {
|
||||
log.error("관계도 삭제 실패", e);
|
||||
@@ -327,7 +327,7 @@ public class DataflowController {
|
||||
*/
|
||||
@GetMapping("/relationships/{relationshipId}/diagram")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getDiagramRelationshipListByRelationshipId(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable int relationshipId) {
|
||||
try {
|
||||
return ResponseEntity.ok(ApiResponse.success(
|
||||
@@ -351,7 +351,7 @@ public class DataflowController {
|
||||
@PathVariable int diagramId,
|
||||
@RequestBody(required = false) Map<String, Object> body) {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("diagramId", diagramId);
|
||||
result.put("diagram_id", diagramId);
|
||||
result.put("tested", true);
|
||||
return ResponseEntity.ok(ApiResponse.success(result, "조건 테스트가 완료되었습니다."));
|
||||
}
|
||||
@@ -364,7 +364,7 @@ public class DataflowController {
|
||||
@PathVariable int diagramId,
|
||||
@RequestBody(required = false) Map<String, Object> body) {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("diagramId", diagramId);
|
||||
result.put("diagram_id", diagramId);
|
||||
result.put("executed", true);
|
||||
return ResponseEntity.ok(ApiResponse.success(result, "액션이 성공적으로 실행되었습니다."));
|
||||
}
|
||||
|
||||
@@ -34,10 +34,10 @@ public class DataflowDiagramController {
|
||||
|
||||
@GetMapping
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getDataflowDiagrams(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(service.getDataflowDiagrams(params)));
|
||||
}
|
||||
|
||||
@@ -47,8 +47,8 @@ public class DataflowDiagramController {
|
||||
|
||||
@GetMapping("/{diagramId}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getDataflowDiagramById(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@PathVariable("diagramId") String diagramIdStr) {
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable("diagram_id") String diagramIdStr) {
|
||||
|
||||
int diagramId = parseId(diagramIdStr);
|
||||
if (diagramId < 0) {
|
||||
@@ -70,8 +70,8 @@ public class DataflowDiagramController {
|
||||
|
||||
@PostMapping
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> createDataflowDiagram(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
|
||||
if (body.get("diagram_name") == null || body.get("relationships") == null) {
|
||||
@@ -104,9 +104,9 @@ public class DataflowDiagramController {
|
||||
|
||||
@PutMapping("/{diagramId}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> updateDataflowDiagram(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@PathVariable("diagramId") String diagramIdStr,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@PathVariable("diagram_id") String diagramIdStr,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
|
||||
int diagramId = parseId(diagramIdStr);
|
||||
@@ -144,8 +144,8 @@ public class DataflowDiagramController {
|
||||
|
||||
@DeleteMapping("/{diagramId}")
|
||||
public ResponseEntity<ApiResponse<Void>> deleteDataflowDiagram(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@PathVariable("diagramId") String diagramIdStr) {
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable("diagram_id") String diagramIdStr) {
|
||||
|
||||
int diagramId = parseId(diagramIdStr);
|
||||
if (diagramId < 0) {
|
||||
@@ -173,9 +173,9 @@ public class DataflowDiagramController {
|
||||
|
||||
@PostMapping("/{diagramId}/copy")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> copyDataflowDiagram(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@PathVariable("diagramId") String diagramIdStr,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@PathVariable("diagram_id") String diagramIdStr,
|
||||
@RequestBody(required = false) Map<String, Object> body) {
|
||||
|
||||
int diagramId = parseId(diagramIdStr);
|
||||
|
||||
@@ -25,18 +25,18 @@ public class DataflowExecutionController {
|
||||
|
||||
@PostMapping("/execute-data-action")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> executeDataAction(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
|
||||
try {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
|
||||
log.info("데이터 액션 실행 요청: action={}, table={}",
|
||||
body.get("actionType"), body.get("tableName"));
|
||||
body.get("action_type"), body.get("table_name"));
|
||||
|
||||
Map<String, Object> result = service.executeDataAction(body);
|
||||
return ResponseEntity.ok(
|
||||
ApiResponse.success(result, "데이터 액션 실행 완료: " + body.get("actionType")));
|
||||
ApiResponse.success(result, "데이터 액션 실행 완료: " + body.get("action_type")));
|
||||
|
||||
} catch (IllegalArgumentException e) {
|
||||
log.warn("데이터 액션 파라미터 오류: {}", e.getMessage());
|
||||
|
||||
@@ -28,15 +28,15 @@ public class DdlController {
|
||||
*/
|
||||
@PostMapping("/tables")
|
||||
public ResponseEntity<ApiResponse<?>> createTable(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
|
||||
if (!isSuperAdmin(companyCode)) {
|
||||
return ResponseEntity.status(403).body(ApiResponse.error("최고 관리자 권한이 필요합니다."));
|
||||
}
|
||||
|
||||
String tableName = (String) body.get("tableName");
|
||||
String tableName = (String) body.get("table_name");
|
||||
@SuppressWarnings("unchecked")
|
||||
List<Map<String, Object>> columns = (List<Map<String, Object>>) body.get("columns");
|
||||
String description = (String) body.get("description");
|
||||
@@ -50,9 +50,9 @@ public class DdlController {
|
||||
|
||||
if (Boolean.TRUE.equals(result.get("success"))) {
|
||||
return ResponseEntity.ok(ApiResponse.success(Map.of(
|
||||
"tableName", result.get("tableName"),
|
||||
"columnCount", result.get("columnCount"),
|
||||
"executedQuery", result.get("executedQuery")
|
||||
"table_name", result.get("table_name"),
|
||||
"column_count", result.get("column_count"),
|
||||
"executed_query", result.get("executed_query")
|
||||
), (String) result.get("message")));
|
||||
}
|
||||
return ResponseEntity.status(400).body(ApiResponse.error((String) result.get("message")));
|
||||
@@ -64,8 +64,8 @@ public class DdlController {
|
||||
@PostMapping("/tables/{tableName}/columns")
|
||||
public ResponseEntity<ApiResponse<?>> addColumn(
|
||||
@PathVariable String tableName,
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
|
||||
if (!isSuperAdmin(companyCode)) {
|
||||
@@ -83,9 +83,9 @@ public class DdlController {
|
||||
|
||||
if (Boolean.TRUE.equals(result.get("success"))) {
|
||||
return ResponseEntity.ok(ApiResponse.success(Map.of(
|
||||
"tableName", result.get("tableName"),
|
||||
"columnName", result.get("columnName"),
|
||||
"executedQuery", result.get("executedQuery")
|
||||
"table_name", result.get("table_name"),
|
||||
"column_name", result.get("column_name"),
|
||||
"executed_query", result.get("executed_query")
|
||||
), (String) result.get("message")));
|
||||
}
|
||||
return ResponseEntity.status(400).body(ApiResponse.error((String) result.get("message")));
|
||||
@@ -97,8 +97,8 @@ public class DdlController {
|
||||
@DeleteMapping("/tables/{tableName}")
|
||||
public ResponseEntity<ApiResponse<?>> dropTable(
|
||||
@PathVariable String tableName,
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId) {
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId) {
|
||||
|
||||
if (!isSuperAdmin(companyCode)) {
|
||||
return ResponseEntity.status(403).body(ApiResponse.error("최고 관리자 권한이 필요합니다."));
|
||||
@@ -108,8 +108,8 @@ public class DdlController {
|
||||
|
||||
if (Boolean.TRUE.equals(result.get("success"))) {
|
||||
return ResponseEntity.ok(ApiResponse.success(Map.of(
|
||||
"tableName", result.get("tableName"),
|
||||
"executedQuery", result.get("executedQuery")
|
||||
"table_name", result.get("table_name"),
|
||||
"executed_query", result.get("executed_query")
|
||||
), (String) result.get("message")));
|
||||
}
|
||||
return ResponseEntity.status(400).body(ApiResponse.error((String) result.get("message")));
|
||||
@@ -120,14 +120,14 @@ public class DdlController {
|
||||
*/
|
||||
@PostMapping("/validate/table")
|
||||
public ResponseEntity<ApiResponse<?>> validateTableCreation(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
|
||||
if (!isSuperAdmin(companyCode)) {
|
||||
return ResponseEntity.status(403).body(ApiResponse.error("최고 관리자 권한이 필요합니다."));
|
||||
}
|
||||
|
||||
String tableName = (String) body.get("tableName");
|
||||
String tableName = (String) body.get("table_name");
|
||||
@SuppressWarnings("unchecked")
|
||||
List<Map<String, Object>> columns = (List<Map<String, Object>>) body.get("columns");
|
||||
|
||||
@@ -149,7 +149,7 @@ public class DdlController {
|
||||
*/
|
||||
@GetMapping("/logs")
|
||||
public ResponseEntity<ApiResponse<?>> getDdlLogs(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam(required = false, defaultValue = "50") int limit,
|
||||
@RequestParam(required = false) String userId,
|
||||
@RequestParam(required = false) String ddlType) {
|
||||
@@ -168,7 +168,7 @@ public class DdlController {
|
||||
*/
|
||||
@GetMapping("/statistics")
|
||||
public ResponseEntity<ApiResponse<?>> getDdlStatistics(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam(required = false) String fromDate,
|
||||
@RequestParam(required = false) String toDate) {
|
||||
|
||||
@@ -186,7 +186,7 @@ public class DdlController {
|
||||
@GetMapping("/tables/{tableName}/history")
|
||||
public ResponseEntity<ApiResponse<?>> getTableDdlHistory(
|
||||
@PathVariable String tableName,
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
|
||||
if (!isSuperAdmin(companyCode)) {
|
||||
return ResponseEntity.status(403).body(ApiResponse.error("최고 관리자 권한이 필요합니다."));
|
||||
@@ -194,7 +194,7 @@ public class DdlController {
|
||||
|
||||
List<Map<String, Object>> history = ddlService.getTableDdlHistory(tableName);
|
||||
return ResponseEntity.ok(ApiResponse.success(
|
||||
Map.of("tableName", tableName, "history", history, "total", history.size()),
|
||||
Map.of("table_name", tableName, "history", history, "total", history.size()),
|
||||
"테이블 DDL 히스토리 조회 성공"));
|
||||
}
|
||||
|
||||
@@ -204,7 +204,7 @@ public class DdlController {
|
||||
@GetMapping("/tables/{tableName}/info")
|
||||
public ResponseEntity<ApiResponse<?>> getTableInfo(
|
||||
@PathVariable String tableName,
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
|
||||
if (!isSuperAdmin(companyCode)) {
|
||||
return ResponseEntity.status(403).body(ApiResponse.error("최고 관리자 권한이 필요합니다."));
|
||||
@@ -228,7 +228,7 @@ public class DdlController {
|
||||
*/
|
||||
@DeleteMapping("/logs/cleanup")
|
||||
public ResponseEntity<ApiResponse<?>> cleanupOldLogs(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam(required = false, defaultValue = "90") int retentionDays) {
|
||||
|
||||
if (!isSuperAdmin(companyCode)) {
|
||||
@@ -237,7 +237,7 @@ public class DdlController {
|
||||
|
||||
int deletedCount = ddlService.cleanupOldLogs(retentionDays);
|
||||
return ResponseEntity.ok(ApiResponse.success(
|
||||
Map.of("deletedCount", deletedCount, "retentionDays", retentionDays),
|
||||
Map.of("deleted_count", deletedCount, "retention_days", retentionDays),
|
||||
deletedCount + "개의 오래된 DDL 로그가 삭제되었습니다."));
|
||||
}
|
||||
|
||||
@@ -246,7 +246,7 @@ public class DdlController {
|
||||
*/
|
||||
@GetMapping("/info")
|
||||
public ResponseEntity<ApiResponse<?>> getInfo(
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
|
||||
if (!isSuperAdmin(companyCode)) {
|
||||
return ResponseEntity.status(403).body(ApiResponse.error("최고 관리자 권한이 필요합니다."));
|
||||
@@ -263,14 +263,14 @@ public class DdlController {
|
||||
"logging", "모든 DDL 실행은 감사 로그에 기록"
|
||||
),
|
||||
"endpoints", Map.of(
|
||||
"createTable", "POST /api/ddl/tables",
|
||||
"addColumn", "POST /api/ddl/tables/{tableName}/columns",
|
||||
"dropTable", "DELETE /api/ddl/tables/{tableName}",
|
||||
"create_table", "POST /api/ddl/tables",
|
||||
"add_column", "POST /api/ddl/tables/{tableName}/columns",
|
||||
"drop_table", "DELETE /api/ddl/tables/{tableName}",
|
||||
"validate", "POST /api/ddl/validate/table",
|
||||
"logs", "GET /api/ddl/logs",
|
||||
"statistics", "GET /api/ddl/statistics",
|
||||
"history", "GET /api/ddl/tables/{tableName}/history",
|
||||
"tableInfo", "GET /api/ddl/tables/{tableName}/info",
|
||||
"table_info", "GET /api/ddl/tables/{tableName}/info",
|
||||
"cleanup", "DELETE /api/ddl/logs/cleanup"
|
||||
)
|
||||
), "DDL 서비스 정보"));
|
||||
|
||||
@@ -20,36 +20,36 @@ public class DeliveryController {
|
||||
|
||||
@GetMapping("/status")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getDeliveryStatus(
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(deliveryService.getDeliveryStatus(params)));
|
||||
}
|
||||
|
||||
@GetMapping("/delayed")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getDelayedDeliveries(
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(deliveryService.getDelayedDeliveries(params)));
|
||||
}
|
||||
|
||||
@GetMapping("/issues")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getCustomerIssues(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam(required = false) String status) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
if (status != null) params.put("status", status);
|
||||
return ResponseEntity.ok(ApiResponse.success(deliveryService.getCustomerIssues(params)));
|
||||
}
|
||||
|
||||
@PutMapping("/{id}/status")
|
||||
public ResponseEntity<ApiResponse<Void>> updateDeliveryStatus(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String id,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
body.put("id", id);
|
||||
deliveryService.updateDeliveryStatus(body);
|
||||
return ResponseEntity.ok(ApiResponse.success(null));
|
||||
@@ -57,10 +57,10 @@ public class DeliveryController {
|
||||
|
||||
@PutMapping("/issues/{id}/status")
|
||||
public ResponseEntity<ApiResponse<Void>> updateIssueStatus(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String id,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
body.put("id", id);
|
||||
deliveryService.updateIssueStatus(body);
|
||||
return ResponseEntity.ok(ApiResponse.success(null));
|
||||
|
||||
@@ -25,7 +25,7 @@ public class DepartmentController {
|
||||
@GetMapping("/companies/{companyCode}/departments")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getDepartments(
|
||||
@PathVariable String companyCode,
|
||||
@RequestAttribute("companyCode") String userCompanyCode) {
|
||||
@RequestAttribute("company_code") String userCompanyCode) {
|
||||
|
||||
if (!isSuperAdmin(userCompanyCode) && !userCompanyCode.equals(companyCode)) {
|
||||
return ResponseEntity.status(403)
|
||||
@@ -58,7 +58,7 @@ public class DepartmentController {
|
||||
@PostMapping("/companies/{companyCode}/departments")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> createDepartment(
|
||||
@PathVariable String companyCode,
|
||||
@RequestAttribute("companyCode") String userCompanyCode,
|
||||
@RequestAttribute("company_code") String userCompanyCode,
|
||||
@RequestAttribute("role") String role,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
|
||||
@@ -176,7 +176,7 @@ public class DepartmentController {
|
||||
|
||||
// 프론트엔드는 snake_case(user_id)로 전송 (Node.js 호환)
|
||||
Object userIdObj = body.get("user_id");
|
||||
if (userIdObj == null) userIdObj = body.get("userId");
|
||||
if (userIdObj == null) userIdObj = body.get("user_id");
|
||||
if (userIdObj == null || userIdObj.toString().isBlank()) {
|
||||
return ResponseEntity.status(400).body(ApiResponse.error("사용자 ID를 입력해주세요."));
|
||||
}
|
||||
|
||||
@@ -22,15 +22,15 @@ public class DesignController {
|
||||
|
||||
@GetMapping("/requests")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getDesignRequestList(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(designService.getDesignRequestList(params)));
|
||||
}
|
||||
|
||||
@GetMapping("/requests/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getDesignRequestDetail(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String id) {
|
||||
Map<String, Object> result = designService.getDesignRequestDetail(id, companyCode);
|
||||
if (result == null) return ResponseEntity.status(404).body(ApiResponse.error("의뢰를 찾을 수 없습니다."));
|
||||
@@ -39,16 +39,16 @@ public class DesignController {
|
||||
|
||||
@PostMapping("/requests")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> createDesignRequest(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute(value = "userId", required = false) String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute(value = "user_id", required = false) String userId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
return ResponseEntity.ok(ApiResponse.success(designService.createDesignRequest(body, companyCode, userId)));
|
||||
}
|
||||
|
||||
@PutMapping("/requests/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> updateDesignRequest(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute(value = "userId", required = false) String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute(value = "user_id", required = false) String userId,
|
||||
@PathVariable String id,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
Map<String, Object> result = designService.updateDesignRequest(id, body, companyCode, userId);
|
||||
@@ -58,7 +58,7 @@ public class DesignController {
|
||||
|
||||
@DeleteMapping("/requests/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> deleteDesignRequest(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String id) {
|
||||
boolean deleted = designService.deleteDesignRequest(id, companyCode);
|
||||
if (!deleted) return ResponseEntity.status(404).body(ApiResponse.error("의뢰를 찾을 수 없습니다."));
|
||||
@@ -67,8 +67,8 @@ public class DesignController {
|
||||
|
||||
@PostMapping("/requests/{id}/history")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> addRequestHistory(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute(value = "userId", required = false) String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute(value = "user_id", required = false) String userId,
|
||||
@PathVariable String id,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
return ResponseEntity.ok(ApiResponse.success(designService.addRequestHistory(id, body, companyCode, userId)));
|
||||
@@ -80,15 +80,15 @@ public class DesignController {
|
||||
|
||||
@GetMapping("/projects")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getProjectList(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(designService.getProjectList(params)));
|
||||
}
|
||||
|
||||
@GetMapping("/projects/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getProjectDetail(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String id) {
|
||||
Map<String, Object> result = designService.getProjectDetail(id, companyCode);
|
||||
if (result == null) return ResponseEntity.status(404).body(ApiResponse.error("프로젝트를 찾을 수 없습니다."));
|
||||
@@ -97,15 +97,15 @@ public class DesignController {
|
||||
|
||||
@PostMapping("/projects")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> createProject(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute(value = "userId", required = false) String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute(value = "user_id", required = false) String userId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
return ResponseEntity.ok(ApiResponse.success(designService.createProject(body, companyCode, userId)));
|
||||
}
|
||||
|
||||
@PutMapping("/projects/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> updateProject(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String id,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
Map<String, Object> result = designService.updateProject(id, body, companyCode);
|
||||
@@ -115,7 +115,7 @@ public class DesignController {
|
||||
|
||||
@DeleteMapping("/projects/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> deleteProject(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String id) {
|
||||
boolean deleted = designService.deleteProject(id, companyCode);
|
||||
if (!deleted) return ResponseEntity.status(404).body(ApiResponse.error("프로젝트를 찾을 수 없습니다."));
|
||||
@@ -128,15 +128,15 @@ public class DesignController {
|
||||
|
||||
@GetMapping("/projects/{projectId}/tasks")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getTasksByProject(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String projectId) {
|
||||
return ResponseEntity.ok(ApiResponse.success(designService.getTasksByProject(projectId, companyCode)));
|
||||
}
|
||||
|
||||
@PostMapping("/projects/{projectId}/tasks")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> createTask(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute(value = "userId", required = false) String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute(value = "user_id", required = false) String userId,
|
||||
@PathVariable String projectId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
return ResponseEntity.ok(ApiResponse.success(designService.createTask(projectId, body, companyCode, userId)));
|
||||
@@ -144,7 +144,7 @@ public class DesignController {
|
||||
|
||||
@PutMapping("/tasks/{taskId}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> updateTask(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String taskId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
Map<String, Object> result = designService.updateTask(taskId, body, companyCode);
|
||||
@@ -154,7 +154,7 @@ public class DesignController {
|
||||
|
||||
@DeleteMapping("/tasks/{taskId}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> deleteTask(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String taskId) {
|
||||
boolean deleted = designService.deleteTask(taskId, companyCode);
|
||||
if (!deleted) return ResponseEntity.status(404).body(ApiResponse.error("태스크를 찾을 수 없습니다."));
|
||||
@@ -167,15 +167,15 @@ public class DesignController {
|
||||
|
||||
@GetMapping("/tasks/{taskId}/work-logs")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getWorkLogsByTask(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String taskId) {
|
||||
return ResponseEntity.ok(ApiResponse.success(designService.getWorkLogsByTask(taskId, companyCode)));
|
||||
}
|
||||
|
||||
@PostMapping("/tasks/{taskId}/work-logs")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> createWorkLog(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute(value = "userId", required = false) String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute(value = "user_id", required = false) String userId,
|
||||
@PathVariable String taskId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
return ResponseEntity.ok(ApiResponse.success(designService.createWorkLog(taskId, body, companyCode, userId)));
|
||||
@@ -183,7 +183,7 @@ public class DesignController {
|
||||
|
||||
@DeleteMapping("/work-logs/{workLogId}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> deleteWorkLog(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String workLogId) {
|
||||
boolean deleted = designService.deleteWorkLog(workLogId, companyCode);
|
||||
if (!deleted) return ResponseEntity.status(404).body(ApiResponse.error("작업일지를 찾을 수 없습니다."));
|
||||
@@ -196,8 +196,8 @@ public class DesignController {
|
||||
|
||||
@PostMapping("/tasks/{taskId}/sub-items")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> createSubItem(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute(value = "userId", required = false) String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute(value = "user_id", required = false) String userId,
|
||||
@PathVariable String taskId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
return ResponseEntity.ok(ApiResponse.success(designService.createSubItem(taskId, body, companyCode, userId)));
|
||||
@@ -205,7 +205,7 @@ public class DesignController {
|
||||
|
||||
@PutMapping("/sub-items/{subItemId}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> updateSubItem(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String subItemId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
Map<String, Object> result = designService.updateSubItem(subItemId, body, companyCode);
|
||||
@@ -215,7 +215,7 @@ public class DesignController {
|
||||
|
||||
@DeleteMapping("/sub-items/{subItemId}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> deleteSubItem(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String subItemId) {
|
||||
boolean deleted = designService.deleteSubItem(subItemId, companyCode);
|
||||
if (!deleted) return ResponseEntity.status(404).body(ApiResponse.error("하위항목을 찾을 수 없습니다."));
|
||||
@@ -228,8 +228,8 @@ public class DesignController {
|
||||
|
||||
@PostMapping("/tasks/{taskId}/issues")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> createIssue(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute(value = "userId", required = false) String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute(value = "user_id", required = false) String userId,
|
||||
@PathVariable String taskId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
return ResponseEntity.ok(ApiResponse.success(designService.createIssue(taskId, body, companyCode, userId)));
|
||||
@@ -237,7 +237,7 @@ public class DesignController {
|
||||
|
||||
@PutMapping("/issues/{issueId}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> updateIssue(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String issueId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
Map<String, Object> result = designService.updateIssue(issueId, body, companyCode);
|
||||
@@ -251,24 +251,24 @@ public class DesignController {
|
||||
|
||||
@GetMapping("/ecn")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getEcnList(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(designService.getEcnList(params)));
|
||||
}
|
||||
|
||||
@PostMapping("/ecn")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> createEcn(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute(value = "userId", required = false) String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute(value = "user_id", required = false) String userId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
return ResponseEntity.ok(ApiResponse.success(designService.createEcn(body, companyCode, userId)));
|
||||
}
|
||||
|
||||
@PutMapping("/ecn/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> updateEcn(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute(value = "userId", required = false) String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute(value = "user_id", required = false) String userId,
|
||||
@PathVariable String id,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
Map<String, Object> result = designService.updateEcn(id, body, companyCode, userId);
|
||||
@@ -278,7 +278,7 @@ public class DesignController {
|
||||
|
||||
@DeleteMapping("/ecn/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> deleteEcn(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String id) {
|
||||
boolean deleted = designService.deleteEcn(id, companyCode);
|
||||
if (!deleted) return ResponseEntity.status(404).body(ApiResponse.error("ECN을 찾을 수 없습니다."));
|
||||
@@ -291,8 +291,8 @@ public class DesignController {
|
||||
|
||||
@GetMapping("/my-work")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getMyWork(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute(value = "userName", required = false) String userName,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute(value = "user_name", required = false) String userName,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
return ResponseEntity.ok(ApiResponse.success(designService.getMyWork(params, companyCode, userName)));
|
||||
}
|
||||
@@ -303,8 +303,8 @@ public class DesignController {
|
||||
|
||||
@PostMapping("/work-logs/{workLogId}/purchase-reqs")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> createPurchaseReq(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute(value = "userId", required = false) String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute(value = "user_id", required = false) String userId,
|
||||
@PathVariable String workLogId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
return ResponseEntity.ok(ApiResponse.success(designService.createPurchaseReq(workLogId, body, companyCode, userId)));
|
||||
@@ -312,8 +312,8 @@ public class DesignController {
|
||||
|
||||
@PostMapping("/work-logs/{workLogId}/coop-reqs")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> createCoopReq(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute(value = "userId", required = false) String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute(value = "user_id", required = false) String userId,
|
||||
@PathVariable String workLogId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
return ResponseEntity.ok(ApiResponse.success(designService.createCoopReq(workLogId, body, companyCode, userId)));
|
||||
@@ -321,8 +321,8 @@ public class DesignController {
|
||||
|
||||
@PostMapping("/coop-reqs/{coopReqId}/responses")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> addCoopResponse(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute(value = "userId", required = false) String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute(value = "user_id", required = false) String userId,
|
||||
@PathVariable String coopReqId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
return ResponseEntity.ok(ApiResponse.success(designService.addCoopResponse(coopReqId, body, companyCode, userId)));
|
||||
|
||||
@@ -21,19 +21,19 @@ public class DigitalTwinController {
|
||||
/** GET /layouts → 레이아웃 목록 */
|
||||
@GetMapping("/layouts")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getDigitalTwinLayoutList(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(digitalTwinService.getDigitalTwinLayoutList(params)));
|
||||
}
|
||||
|
||||
/** GET /layouts/:id → 레이아웃 상세 (객체 포함) */
|
||||
@GetMapping("/layouts/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getDigitalTwinLayoutInfo(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long id) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("id", id);
|
||||
Map<String, Object> result = digitalTwinService.getDigitalTwinLayoutInfo(params);
|
||||
if (result == null) {
|
||||
@@ -45,11 +45,11 @@ public class DigitalTwinController {
|
||||
/** POST /layouts → 레이아웃 생성 */
|
||||
@PostMapping("/layouts")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> createDigitalTwinLayout(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute(value = "userId", required = false) String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute(value = "user_id", required = false) String userId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("createdBy", userId);
|
||||
body.put("company_code", companyCode);
|
||||
body.put("created_by", userId);
|
||||
Map<String, Object> result = digitalTwinService.createDigitalTwinLayout(body);
|
||||
return ResponseEntity.status(201).body(ApiResponse.success(result));
|
||||
}
|
||||
@@ -57,12 +57,12 @@ public class DigitalTwinController {
|
||||
/** PUT /layouts/:id → 레이아웃 수정 */
|
||||
@PutMapping("/layouts/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> updateDigitalTwinLayout(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute(value = "userId", required = false) String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute(value = "user_id", required = false) String userId,
|
||||
@PathVariable Long id,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("updatedBy", userId);
|
||||
body.put("company_code", companyCode);
|
||||
body.put("updated_by", userId);
|
||||
body.put("id", id);
|
||||
Map<String, Object> result = digitalTwinService.updateDigitalTwinLayout(body);
|
||||
if (result == null) {
|
||||
@@ -74,10 +74,10 @@ public class DigitalTwinController {
|
||||
/** DELETE /layouts/:id → 레이아웃 삭제 */
|
||||
@DeleteMapping("/layouts/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> deleteDigitalTwinLayout(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long id) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("id", id);
|
||||
boolean deleted = digitalTwinService.deleteDigitalTwinLayout(params);
|
||||
if (!deleted) {
|
||||
@@ -91,19 +91,19 @@ public class DigitalTwinController {
|
||||
/** GET /mapping-templates → 매핑 템플릿 목록 */
|
||||
@GetMapping("/mapping-templates")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getDigitalTwinTemplateList(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(digitalTwinService.getDigitalTwinTemplateList(params)));
|
||||
}
|
||||
|
||||
/** GET /mapping-templates/:id → 매핑 템플릿 상세 */
|
||||
@GetMapping("/mapping-templates/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getDigitalTwinTemplateInfo(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long id) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("id", id);
|
||||
Map<String, Object> result = digitalTwinService.getDigitalTwinTemplateInfo(params);
|
||||
if (result == null) {
|
||||
@@ -115,14 +115,14 @@ public class DigitalTwinController {
|
||||
/** POST /mapping-templates → 매핑 템플릿 생성 */
|
||||
@PostMapping("/mapping-templates")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> createDigitalTwinTemplate(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute(value = "userId", required = false) String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute(value = "user_id", required = false) String userId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
if (body.get("name") == null || body.get("externalDbConnectionId") == null || body.get("config") == null) {
|
||||
if (body.get("name") == null || body.get("external_db_connection_id") == null || body.get("config") == null) {
|
||||
return ResponseEntity.status(400).body(ApiResponse.error("필수 필드가 누락되었습니다. (name, externalDbConnectionId, config)"));
|
||||
}
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("createdBy", userId);
|
||||
body.put("company_code", companyCode);
|
||||
body.put("created_by", userId);
|
||||
Map<String, Object> result = digitalTwinService.createDigitalTwinTemplate(body);
|
||||
return ResponseEntity.status(201).body(ApiResponse.success(result));
|
||||
}
|
||||
@@ -133,7 +133,7 @@ public class DigitalTwinController {
|
||||
@PostMapping("/data/hierarchy")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getHierarchyData(
|
||||
@RequestBody Map<String, Object> body) {
|
||||
if (body.get("externalDbConnectionId") == null || body.get("hierarchyConfig") == null) {
|
||||
if (body.get("external_db_connection_id") == null || body.get("hierarchy_config") == null) {
|
||||
return ResponseEntity.status(400).body(
|
||||
ApiResponse.error("외부 DB 연결 ID와 계층 구조 설정이 필요합니다."));
|
||||
}
|
||||
@@ -145,8 +145,8 @@ public class DigitalTwinController {
|
||||
@PostMapping("/data/children")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getChildrenData(
|
||||
@RequestBody Map<String, Object> body) {
|
||||
if (body.get("externalDbConnectionId") == null || body.get("hierarchyConfig") == null
|
||||
|| body.get("parentLevel") == null || body.get("parentKey") == null) {
|
||||
if (body.get("external_db_connection_id") == null || body.get("hierarchy_config") == null
|
||||
|| body.get("parent_level") == null || body.get("parent_key") == null) {
|
||||
return ResponseEntity.status(400).body(ApiResponse.error("필수 파라미터가 누락되었습니다."));
|
||||
}
|
||||
List<Map<String, Object>> result = digitalTwinService.getChildrenData(body);
|
||||
@@ -219,8 +219,8 @@ public class DigitalTwinController {
|
||||
@PostMapping("/data/material-counts")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getMaterialCounts(
|
||||
@RequestBody Map<String, Object> body) {
|
||||
if (body.get("externalDbConnectionId") == null || body.get("locationKeys") == null
|
||||
|| body.get("tableName") == null) {
|
||||
if (body.get("external_db_connection_id") == null || body.get("location_keys") == null
|
||||
|| body.get("table_name") == null) {
|
||||
return ResponseEntity.status(400).body(ApiResponse.error("필수 파라미터가 누락되었습니다."));
|
||||
}
|
||||
List<Map<String, Object>> result = digitalTwinService.getMaterialCounts(body);
|
||||
|
||||
@@ -18,23 +18,23 @@ public class DriverController {
|
||||
/** GET /list → 운전자 목록 (admin용 / api_test 호환) */
|
||||
@GetMapping("/list")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getDriverList(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(driverService.getDriverList(params)));
|
||||
}
|
||||
|
||||
/** GET /profile → 운전자 프로필 조회 */
|
||||
@GetMapping("/profile")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getDriverProfile(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute(value = "userId", required = false) String userId) {
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute(value = "user_id", required = false) String userId) {
|
||||
if (userId == null) {
|
||||
return ResponseEntity.status(401).body(ApiResponse.error("인증이 필요합니다."));
|
||||
}
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("userId", userId);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("user_id", userId);
|
||||
Map<String, Object> result = driverService.getDriverProfile(params);
|
||||
if (result == null) {
|
||||
return ResponseEntity.status(404).body(ApiResponse.error("사용자를 찾을 수 없습니다."));
|
||||
@@ -45,14 +45,14 @@ public class DriverController {
|
||||
/** PUT /profile → 운전자 프로필 수정 */
|
||||
@PutMapping("/profile")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> updateDriverProfile(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute(value = "userId", required = false) String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute(value = "user_id", required = false) String userId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
if (userId == null) {
|
||||
return ResponseEntity.status(401).body(ApiResponse.error("인증이 필요합니다."));
|
||||
}
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("userId", userId);
|
||||
body.put("company_code", companyCode);
|
||||
body.put("user_id", userId);
|
||||
driverService.updateDriverProfile(body);
|
||||
return ResponseEntity.ok(ApiResponse.success(null, "프로필이 수정되었습니다."));
|
||||
}
|
||||
@@ -60,8 +60,8 @@ public class DriverController {
|
||||
/** PUT /status → 차량 상태 변경 (off: 대기, maintenance: 정비) */
|
||||
@PutMapping("/status")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> updateDriverStatus(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute(value = "userId", required = false) String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute(value = "user_id", required = false) String userId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
if (userId == null) {
|
||||
return ResponseEntity.status(401).body(ApiResponse.error("인증이 필요합니다."));
|
||||
@@ -71,7 +71,7 @@ public class DriverController {
|
||||
return ResponseEntity.status(400).body(
|
||||
ApiResponse.error("유효하지 않은 상태값입니다. (off: 대기, maintenance: 정비)"));
|
||||
}
|
||||
body.put("userId", userId);
|
||||
body.put("user_id", userId);
|
||||
driverService.updateDriverStatus(body);
|
||||
String msg = "off".equals(status) ? "차량 상태가 대기로 변경되었습니다." : "차량 상태가 정비로 변경되었습니다.";
|
||||
return ResponseEntity.ok(ApiResponse.success(null, msg));
|
||||
@@ -80,13 +80,13 @@ public class DriverController {
|
||||
/** DELETE /vehicle → 차량 삭제 (기록 보존) */
|
||||
@DeleteMapping("/vehicle")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> deleteDriverVehicle(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute(value = "userId", required = false) String userId) {
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute(value = "user_id", required = false) String userId) {
|
||||
if (userId == null) {
|
||||
return ResponseEntity.status(401).body(ApiResponse.error("인증이 필요합니다."));
|
||||
}
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("userId", userId);
|
||||
params.put("user_id", userId);
|
||||
driverService.deleteDriverVehicle(params);
|
||||
return ResponseEntity.ok(ApiResponse.success(null, "차량이 삭제되었습니다."));
|
||||
}
|
||||
@@ -94,17 +94,17 @@ public class DriverController {
|
||||
/** POST /vehicle → 새 차량 등록 */
|
||||
@PostMapping("/vehicle")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> registerDriverVehicle(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute(value = "userId", required = false) String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute(value = "user_id", required = false) String userId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
if (userId == null) {
|
||||
return ResponseEntity.status(401).body(ApiResponse.error("인증이 필요합니다."));
|
||||
}
|
||||
if (body.get("vehicleNumber") == null) {
|
||||
if (body.get("vehicle_number") == null) {
|
||||
return ResponseEntity.status(400).body(ApiResponse.error("차량번호는 필수입니다."));
|
||||
}
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("userId", userId);
|
||||
body.put("company_code", companyCode);
|
||||
body.put("user_id", userId);
|
||||
driverService.registerDriverVehicle(body);
|
||||
return ResponseEntity.ok(ApiResponse.success(null, "차량이 등록되었습니다."));
|
||||
}
|
||||
@@ -112,13 +112,13 @@ public class DriverController {
|
||||
/** DELETE /account → 회원 탈퇴 */
|
||||
@DeleteMapping("/account")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> deleteDriverAccount(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute(value = "userId", required = false) String userId) {
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute(value = "user_id", required = false) String userId) {
|
||||
if (userId == null) {
|
||||
return ResponseEntity.status(401).body(ApiResponse.error("인증이 필요합니다."));
|
||||
}
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("userId", userId);
|
||||
params.put("user_id", userId);
|
||||
driverService.deleteDriverAccount(params);
|
||||
return ResponseEntity.ok(ApiResponse.success(null, "회원 탈퇴가 완료되었습니다."));
|
||||
}
|
||||
|
||||
@@ -25,13 +25,13 @@ public class DynamicFormController {
|
||||
|
||||
@PostMapping("/save")
|
||||
public ResponseEntity<ApiResponse<Object>> saveFormData(
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body,
|
||||
HttpServletRequest request) {
|
||||
|
||||
Object screenIdRaw = body.get("screenId");
|
||||
String tableName = (String) body.get("tableName");
|
||||
Object screenIdRaw = body.get("screen_id");
|
||||
String tableName = (String) body.get("table_name");
|
||||
Map<String, Object> data = (Map<String, Object>) body.get("data");
|
||||
|
||||
if (screenIdRaw == null || tableName == null || data == null) {
|
||||
@@ -70,12 +70,12 @@ public class DynamicFormController {
|
||||
|
||||
@PostMapping("/save-enhanced")
|
||||
public ResponseEntity<ApiResponse<Object>> saveFormDataEnhanced(
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
|
||||
Object screenIdRaw = body.get("screenId");
|
||||
String tableName = (String) body.get("tableName");
|
||||
Object screenIdRaw = body.get("screen_id");
|
||||
String tableName = (String) body.get("table_name");
|
||||
Map<String, Object> data = (Map<String, Object>) body.get("data");
|
||||
|
||||
if (screenIdRaw == null || tableName == null || data == null) {
|
||||
@@ -111,15 +111,15 @@ public class DynamicFormController {
|
||||
|
||||
@PutMapping("/update-field")
|
||||
public ResponseEntity<ApiResponse<Object>> updateFieldValue(
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
|
||||
String tableName = (String) body.get("tableName");
|
||||
String keyField = (String) body.get("keyField");
|
||||
Object keyValue = body.get("keyValue");
|
||||
String updateField = (String) body.get("updateField");
|
||||
Object updateValue = body.get("updateValue");
|
||||
String tableName = (String) body.get("table_name");
|
||||
String keyField = (String) body.get("key_field");
|
||||
Object keyValue = body.get("key_value");
|
||||
String updateField = (String) body.get("update_field");
|
||||
Object updateValue = body.get("update_value");
|
||||
|
||||
if (tableName == null || keyField == null || keyValue == null
|
||||
|| updateField == null || updateValue == null) {
|
||||
@@ -150,11 +150,11 @@ public class DynamicFormController {
|
||||
@PutMapping("/{id}")
|
||||
public ResponseEntity<ApiResponse<Object>> updateFormData(
|
||||
@PathVariable String id,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
|
||||
String tableName = (String) body.get("tableName");
|
||||
String tableName = (String) body.get("table_name");
|
||||
Map<String, Object> data = (Map<String, Object>) body.get("data");
|
||||
|
||||
if (tableName == null || data == null) {
|
||||
@@ -182,13 +182,13 @@ public class DynamicFormController {
|
||||
@PatchMapping("/{id}/partial")
|
||||
public ResponseEntity<ApiResponse<Object>> updateFormDataPartial(
|
||||
@PathVariable String id,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
|
||||
String tableName = (String) body.get("tableName");
|
||||
Map<String, Object> originalData = (Map<String, Object>) body.get("originalData");
|
||||
Map<String, Object> newData = (Map<String, Object>) body.get("newData");
|
||||
String tableName = (String) body.get("table_name");
|
||||
Map<String, Object> originalData = (Map<String, Object>) body.get("original_data");
|
||||
Map<String, Object> newData = (Map<String, Object>) body.get("new_data");
|
||||
|
||||
if (tableName == null || originalData == null || newData == null) {
|
||||
return ResponseEntity.badRequest()
|
||||
@@ -215,13 +215,13 @@ public class DynamicFormController {
|
||||
@DeleteMapping("/{id}")
|
||||
public ResponseEntity<ApiResponse<Void>> deleteFormData(
|
||||
@PathVariable String id,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody(required = false) Map<String, Object> body) {
|
||||
|
||||
if (body == null) body = new HashMap<>();
|
||||
String tableName = (String) body.get("tableName");
|
||||
Object screenIdRaw = body.get("screenId");
|
||||
String tableName = (String) body.get("table_name");
|
||||
Object screenIdRaw = body.get("screen_id");
|
||||
|
||||
if (tableName == null) {
|
||||
return ResponseEntity.badRequest()
|
||||
@@ -257,8 +257,8 @@ public class DynamicFormController {
|
||||
params.put("page", page);
|
||||
params.put("size", size);
|
||||
params.put("search", search.isEmpty() ? null : search);
|
||||
params.put("sortBy", sortBy);
|
||||
params.put("sortOrder", sortOrder);
|
||||
params.put("sort_by", sortBy);
|
||||
params.put("sort_order", sortOrder);
|
||||
int sid = (screenId != null) ? screenId : 0;
|
||||
Map<String, Object> result = dynamicFormService.getFormDataList(sid, params);
|
||||
return ResponseEntity.ok(ApiResponse.success(result));
|
||||
@@ -285,8 +285,8 @@ public class DynamicFormController {
|
||||
params.put("page", page);
|
||||
params.put("size", size);
|
||||
params.put("search", search.isEmpty() ? null : search);
|
||||
params.put("sortBy", sortBy);
|
||||
params.put("sortOrder", sortOrder);
|
||||
params.put("sort_by", sortBy);
|
||||
params.put("sort_order", sortOrder);
|
||||
|
||||
Map<String, Object> result = dynamicFormService.getFormDataList(screenId, params);
|
||||
return ResponseEntity.ok(ApiResponse.success(result));
|
||||
@@ -304,7 +304,7 @@ public class DynamicFormController {
|
||||
try {
|
||||
List<Map<String, Object>> columns = dynamicFormService.getTableColumns(tableName);
|
||||
Map<String, Object> data = new LinkedHashMap<>();
|
||||
data.put("tableName", tableName);
|
||||
data.put("table_name", tableName);
|
||||
data.put("columns", columns);
|
||||
return ResponseEntity.ok(ApiResponse.success(data));
|
||||
} catch (Exception e) {
|
||||
@@ -339,7 +339,7 @@ public class DynamicFormController {
|
||||
public ResponseEntity<ApiResponse<Object>> validateFormData(
|
||||
@RequestBody Map<String, Object> body) {
|
||||
|
||||
String tableName = (String) body.get("tableName");
|
||||
String tableName = (String) body.get("table_name");
|
||||
Map<String, Object> data = (Map<String, Object>) body.get("data");
|
||||
|
||||
if (tableName == null || data == null) {
|
||||
@@ -362,7 +362,7 @@ public class DynamicFormController {
|
||||
@GetMapping("/location-history/{tripId}")
|
||||
public ResponseEntity<ApiResponse<Object>> getLocationHistory(
|
||||
@PathVariable String tripId,
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam(required = false) String userId,
|
||||
@RequestParam(required = false) String startDate,
|
||||
@RequestParam(required = false) String endDate,
|
||||
@@ -370,11 +370,11 @@ public class DynamicFormController {
|
||||
|
||||
try {
|
||||
Map<String, Object> params = new LinkedHashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("tripId", tripId);
|
||||
if (userId != null) params.put("userId", userId);
|
||||
if (startDate != null) params.put("startDate", startDate);
|
||||
if (endDate != null) params.put("endDate", endDate);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("trip_id", tripId);
|
||||
if (userId != null) params.put("user_id", userId);
|
||||
if (startDate != null) params.put("start_date", startDate);
|
||||
if (endDate != null) params.put("end_date", endDate);
|
||||
params.put("limit", limit != null ? limit : 1000);
|
||||
|
||||
List<Map<String, Object>> result = dynamicFormService.getLocationHistory(params);
|
||||
@@ -395,8 +395,8 @@ public class DynamicFormController {
|
||||
|
||||
@PostMapping("/location-history")
|
||||
public ResponseEntity<ApiResponse<Object>> saveLocationHistory(
|
||||
@RequestAttribute("userId") String loginUserId,
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("user_id") String loginUserId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
|
||||
Double latitude = body.get("latitude") != null ? ((Number) body.get("latitude")).doubleValue() : null;
|
||||
@@ -407,25 +407,25 @@ public class DynamicFormController {
|
||||
.body(ApiResponse.error("필수 필드가 누락되었습니다. (latitude, longitude)"));
|
||||
}
|
||||
|
||||
String userId = body.containsKey("userId") ? (String) body.get("userId") : loginUserId;
|
||||
String userId = body.containsKey("user_id") ? (String) body.get("user_id") : loginUserId;
|
||||
|
||||
Map<String, Object> params = new LinkedHashMap<>();
|
||||
params.put("userId", userId);
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("user_id", userId);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("latitude", latitude);
|
||||
params.put("longitude", longitude);
|
||||
params.put("accuracy", body.get("accuracy"));
|
||||
params.put("altitude", body.get("altitude"));
|
||||
params.put("speed", body.get("speed"));
|
||||
params.put("heading", body.get("heading"));
|
||||
params.put("tripId", body.get("tripId"));
|
||||
params.put("tripStatus", body.getOrDefault("tripStatus", "active"));
|
||||
params.put("trip_id", body.get("trip_id"));
|
||||
params.put("trip_status", body.getOrDefault("trip_status", "active"));
|
||||
params.put("departure", body.get("departure"));
|
||||
params.put("arrival", body.get("arrival"));
|
||||
params.put("departureName", body.get("departureName"));
|
||||
params.put("destinationName", body.get("destinationName"));
|
||||
params.put("recordedAt", body.getOrDefault("recordedAt", new java.util.Date().toInstant().toString()));
|
||||
params.put("vehicleId", body.get("vehicleId"));
|
||||
params.put("departure_name", body.get("departure_name"));
|
||||
params.put("destination_name", body.get("destination_name"));
|
||||
params.put("recorded_at", body.getOrDefault("recorded_at", new java.util.Date().toInstant().toString()));
|
||||
params.put("vehicle_id", body.get("vehicle_id"));
|
||||
|
||||
try {
|
||||
Map<String, Object> result = dynamicFormService.saveLocationHistory(params);
|
||||
|
||||
@@ -38,11 +38,11 @@ public class EntityJoinController {
|
||||
@GetMapping("/tables/{tableName}/data-with-joins")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getTableDataWithJoins(
|
||||
@PathVariable String tableName,
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> queryParams) {
|
||||
|
||||
Map<String, Object> options = new HashMap<>(queryParams);
|
||||
options.put("companyCode", companyCode);
|
||||
options.put("company_code", companyCode);
|
||||
|
||||
// search 파라미터 JSON 파싱
|
||||
Object searchRaw = queryParams.get("search");
|
||||
@@ -56,17 +56,17 @@ public class EntityJoinController {
|
||||
}
|
||||
|
||||
// autoFilter 파싱 (멀티테넌시)
|
||||
Object autoFilterRaw = queryParams.get("autoFilter");
|
||||
Object autoFilterRaw = queryParams.get("auto_filter");
|
||||
if (autoFilterRaw instanceof String af && !af.isBlank()) {
|
||||
try {
|
||||
Map<String, Object> autoFilter = objectMapper.readValue(af, new TypeReference<>() {});
|
||||
Boolean enabled = (Boolean) autoFilter.getOrDefault("enabled", false);
|
||||
if (Boolean.TRUE.equals(enabled)) {
|
||||
String filterColumn = (String) autoFilter.getOrDefault("filterColumn", "company_code");
|
||||
String filterColumn = (String) autoFilter.getOrDefault("filter_column", "company_code");
|
||||
Map<String, Object> search = getOrCreateSearch(options);
|
||||
String finalCode = companyCode;
|
||||
if ("*".equals(companyCode) && autoFilter.get("companyCodeOverride") != null) {
|
||||
finalCode = (String) autoFilter.get("companyCodeOverride");
|
||||
if ("*".equals(companyCode) && autoFilter.get("company_code_override") != null) {
|
||||
finalCode = (String) autoFilter.get("company_code_override");
|
||||
}
|
||||
search.put(filterColumn, finalCode);
|
||||
options.put("search", search);
|
||||
@@ -91,14 +91,14 @@ public class EntityJoinController {
|
||||
@GetMapping("/tables/{tableName}/entity-joins")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getEntityJoinConfigs(
|
||||
@PathVariable String tableName,
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
|
||||
List<Map<String, Object>> joinConfigs =
|
||||
entityJoinService.detectEntityJoins(tableName, null, companyCode);
|
||||
|
||||
Map<String, Object> data = new HashMap<>();
|
||||
data.put("tableName", tableName);
|
||||
data.put("joinConfigs", joinConfigs);
|
||||
data.put("table_name", tableName);
|
||||
data.put("join_configs", joinConfigs);
|
||||
data.put("count", joinConfigs.size());
|
||||
return ResponseEntity.ok(ApiResponse.success(data, "Entity 조인 설정 조회 성공"));
|
||||
}
|
||||
@@ -111,12 +111,12 @@ public class EntityJoinController {
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> updateEntitySettings(
|
||||
@PathVariable String tableName,
|
||||
@PathVariable String columnName,
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
|
||||
String webType = (String) body.get("webType");
|
||||
String referenceTable = (String) body.get("referenceTable");
|
||||
String referenceColumn = (String) body.get("referenceColumn");
|
||||
String webType = (String) body.get("web_type");
|
||||
String referenceTable = (String) body.get("reference_table");
|
||||
String referenceColumn = (String) body.get("reference_column");
|
||||
|
||||
if ("entity".equals(webType) && (referenceTable == null || referenceColumn == null)) {
|
||||
return ResponseEntity.badRequest()
|
||||
@@ -127,19 +127,19 @@ public class EntityJoinController {
|
||||
|
||||
// 관련 캐시 무효화
|
||||
if ("entity".equals(webType) && referenceTable != null) {
|
||||
String displayColumn = (String) body.get("displayColumn");
|
||||
String referenceColVal = (String) body.get("referenceColumn");
|
||||
String displayColumn = (String) body.get("display_column");
|
||||
String referenceColVal = (String) body.get("reference_column");
|
||||
entityJoinService.invalidateCache(referenceTable, referenceColVal, displayColumn);
|
||||
}
|
||||
|
||||
Map<String, Object> data = new HashMap<>();
|
||||
data.put("tableName", tableName);
|
||||
data.put("columnName", columnName);
|
||||
data.put("table_name", tableName);
|
||||
data.put("column_name", columnName);
|
||||
data.put("settings", Map.of(
|
||||
"webType", webType != null ? webType : "",
|
||||
"referenceTable", referenceTable != null ? referenceTable : "",
|
||||
"referenceColumn", referenceColumn != null ? referenceColumn : "",
|
||||
"displayColumn", body.getOrDefault("displayColumn", "")));
|
||||
"web_type", webType != null ? webType : "",
|
||||
"reference_table", referenceTable != null ? referenceTable : "",
|
||||
"reference_column", referenceColumn != null ? referenceColumn : "",
|
||||
"display_column", body.getOrDefault("display_column", "")));
|
||||
return ResponseEntity.ok(ApiResponse.success(data, "Entity 설정 업데이트 성공"));
|
||||
}
|
||||
|
||||
@@ -154,7 +154,7 @@ public class EntityJoinController {
|
||||
@GetMapping("/tables/{tableName}/entity-join-columns")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getEntityJoinColumns(
|
||||
@PathVariable String tableName,
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
|
||||
Map<String, Object> result = entityJoinService.getEntityJoinColumns(tableName, companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(result, "Entity 조인 컬럼 조회 성공"));
|
||||
@@ -167,13 +167,13 @@ public class EntityJoinController {
|
||||
@GetMapping("/reference-tables/{tableName}/columns")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getReferenceTableColumns(
|
||||
@PathVariable String tableName,
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
|
||||
List<Map<String, Object>> columns =
|
||||
entityJoinService.getReferenceTableColumns(tableName, companyCode);
|
||||
|
||||
Map<String, Object> data = new HashMap<>();
|
||||
data.put("tableName", tableName);
|
||||
data.put("table_name", tableName);
|
||||
data.put("columns", columns);
|
||||
data.put("count", columns.size());
|
||||
return ResponseEntity.ok(ApiResponse.success(data, "참조 테이블 컬럼 조회 성공"));
|
||||
@@ -223,7 +223,7 @@ public class EntityJoinController {
|
||||
@SuppressWarnings("unchecked")
|
||||
List<Map<String, Object>> caches = (List<Map<String, Object>>) cacheStatus.get("caches");
|
||||
Map<String, Object> data = new HashMap<>();
|
||||
data.put("preloadedCaches", caches != null ? caches.size() : 0);
|
||||
data.put("preloaded_caches", caches != null ? caches.size() : 0);
|
||||
data.put("caches", caches);
|
||||
return ResponseEntity.ok(ApiResponse.success(data, "공통 참조 테이블 캐싱 완료"));
|
||||
}
|
||||
|
||||
@@ -30,11 +30,11 @@ public class EntityReferenceController {
|
||||
@PathVariable String codeCategory,
|
||||
@RequestParam(required = false, defaultValue = "100") Integer limit,
|
||||
@RequestParam(required = false) String search,
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("codeCategory", codeCategory);
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("code_category", codeCategory);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("limit", limit);
|
||||
if (search != null) params.put("search", search);
|
||||
|
||||
@@ -56,12 +56,12 @@ public class EntityReferenceController {
|
||||
@PathVariable String columnName,
|
||||
@RequestParam(required = false, defaultValue = "100") Integer limit,
|
||||
@RequestParam(required = false) String search,
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("tableName", tableName);
|
||||
params.put("columnName", columnName);
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("table_name", tableName);
|
||||
params.put("column_name", columnName);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("limit", limit);
|
||||
if (search != null) params.put("search", search);
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ public class EntitySearchController {
|
||||
@RequestParam(defaultValue = "{}") String filterCondition,
|
||||
@RequestParam(defaultValue = "1") String page,
|
||||
@RequestParam(defaultValue = "20") String limit,
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
|
||||
if (tableName == null || tableName.isBlank()
|
||||
|| "undefined".equals(tableName) || "null".equals(tableName)) {
|
||||
@@ -48,11 +48,11 @@ public class EntitySearchController {
|
||||
}
|
||||
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("tableName", tableName);
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("searchText", searchText);
|
||||
params.put("searchFields", searchFields);
|
||||
params.put("filterCondition", filterCondition);
|
||||
params.put("table_name", tableName);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("search_text", searchText);
|
||||
params.put("search_fields", searchFields);
|
||||
params.put("filter_condition", filterCondition);
|
||||
params.put("page", page);
|
||||
params.put("limit", limit);
|
||||
|
||||
@@ -83,7 +83,7 @@ public class EntitySearchController {
|
||||
@RequestParam(defaultValue = "name") String label,
|
||||
@RequestParam(required = false) String fields,
|
||||
@RequestParam(required = false) String filters,
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
|
||||
if (tableName == null || tableName.isBlank()
|
||||
|| "undefined".equals(tableName) || "null".equals(tableName)) {
|
||||
@@ -91,8 +91,8 @@ public class EntitySearchController {
|
||||
}
|
||||
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("tableName", tableName);
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("table_name", tableName);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("value", value);
|
||||
params.put("label", label);
|
||||
params.put("fields", fields);
|
||||
@@ -118,7 +118,7 @@ public class EntitySearchController {
|
||||
@PathVariable String columnName,
|
||||
@RequestParam(required = false) String labelColumn,
|
||||
@RequestParam(required = false) String filters,
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
|
||||
if (tableName == null || tableName.isBlank()
|
||||
|| "undefined".equals(tableName) || "null".equals(tableName)) {
|
||||
@@ -130,10 +130,10 @@ public class EntitySearchController {
|
||||
}
|
||||
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("tableName", tableName);
|
||||
params.put("columnName", columnName);
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("labelColumn", labelColumn);
|
||||
params.put("table_name", tableName);
|
||||
params.put("column_name", columnName);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("label_column", labelColumn);
|
||||
params.put("filters", filters);
|
||||
|
||||
try {
|
||||
|
||||
@@ -18,46 +18,46 @@ public class ExcelMappingController {
|
||||
|
||||
@PostMapping("/find")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> findMappingByColumns(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
if (body.get("tableName") == null || body.get("excelColumns") == null) {
|
||||
if (body.get("table_name") == null || body.get("excel_columns") == null) {
|
||||
return ResponseEntity.status(400).body(ApiResponse.error("tableName과 excelColumns는 필수입니다."));
|
||||
}
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
Map<String, Object> result = excelMappingService.findMappingByColumns(body);
|
||||
return ResponseEntity.ok(ApiResponse.success(result));
|
||||
}
|
||||
|
||||
@PostMapping("/save")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> saveMappingTemplate(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
if (body.get("tableName") == null || body.get("excelColumns") == null || body.get("columnMappings") == null) {
|
||||
if (body.get("table_name") == null || body.get("excel_columns") == null || body.get("column_mappings") == null) {
|
||||
return ResponseEntity.status(400).body(ApiResponse.error("tableName, excelColumns, columnMappings는 필수입니다."));
|
||||
}
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
Map<String, Object> result = excelMappingService.saveMappingTemplate(body);
|
||||
return ResponseEntity.ok(ApiResponse.success(result, "매핑 템플릿이 저장되었습니다."));
|
||||
}
|
||||
|
||||
@GetMapping("/list/{tableName}")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getMappingTemplates(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String tableName) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("tableName", tableName);
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("table_name", tableName);
|
||||
params.put("company_code", companyCode);
|
||||
List<Map<String, Object>> result = excelMappingService.getMappingTemplates(params);
|
||||
return ResponseEntity.ok(ApiResponse.success(result));
|
||||
}
|
||||
|
||||
@DeleteMapping("/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> deleteMappingTemplate(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long id) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("id", id);
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
boolean deleted = excelMappingService.deleteMappingTemplate(params);
|
||||
if (!deleted) {
|
||||
return ResponseEntity.status(404).body(ApiResponse.error("매핑 템플릿을 찾을 수 없습니다."));
|
||||
|
||||
@@ -25,9 +25,9 @@ public class ExternalCallConfigController {
|
||||
*/
|
||||
@GetMapping
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getExternalCallConfigList(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> queryParams) {
|
||||
queryParams.put("companyCode", companyCode);
|
||||
queryParams.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(
|
||||
externalCallConfigService.getExternalCallConfigList(queryParams)));
|
||||
}
|
||||
@@ -39,7 +39,7 @@ public class ExternalCallConfigController {
|
||||
*/
|
||||
@GetMapping("/for-button-control")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getExternalCallConfigForButtonControl(
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
return ResponseEntity.ok(ApiResponse.success(
|
||||
externalCallConfigService.getExternalCallConfigForButtonControl(companyCode)));
|
||||
}
|
||||
@@ -51,10 +51,10 @@ public class ExternalCallConfigController {
|
||||
*/
|
||||
@GetMapping("/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getExternalCallConfigInfo(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable int id) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("id", id);
|
||||
Map<String, Object> config = externalCallConfigService.getExternalCallConfigInfo(params);
|
||||
if (config == null) {
|
||||
@@ -71,10 +71,10 @@ public class ExternalCallConfigController {
|
||||
*/
|
||||
@PostMapping
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> insertExternalCallConfig(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
body.put("created_by", userId);
|
||||
body.put("updated_by", userId);
|
||||
try {
|
||||
@@ -93,11 +93,11 @@ public class ExternalCallConfigController {
|
||||
*/
|
||||
@PutMapping("/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> updateExternalCallConfig(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@PathVariable int id,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
body.put("updated_by", userId);
|
||||
body.put("id", id);
|
||||
try {
|
||||
@@ -117,13 +117,13 @@ public class ExternalCallConfigController {
|
||||
*/
|
||||
@DeleteMapping("/{id}")
|
||||
public ResponseEntity<ApiResponse<Void>> deleteExternalCallConfig(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@PathVariable int id) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("id", id);
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("updatedBy", userId);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("updated_by", userId);
|
||||
try {
|
||||
externalCallConfigService.deleteExternalCallConfig(params);
|
||||
return ResponseEntity.ok(ApiResponse.success(null, "외부 호출 설정이 성공적으로 삭제되었습니다."));
|
||||
@@ -139,7 +139,7 @@ public class ExternalCallConfigController {
|
||||
*/
|
||||
@PostMapping("/{id}/test")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> testExternalCallConfig(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable int id) {
|
||||
Map<String, Object> result = externalCallConfigService.testExternalCallConfig(id);
|
||||
String message = (String) result.get("message");
|
||||
@@ -153,13 +153,13 @@ public class ExternalCallConfigController {
|
||||
*/
|
||||
@PostMapping("/{id}/execute")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> executeExternalCallConfig(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@PathVariable int id,
|
||||
@RequestBody(required = false) Map<String, Object> body) {
|
||||
Map<String, Object> contextData = body != null ? new HashMap<>(body) : new HashMap<>();
|
||||
contextData.put("userId", userId);
|
||||
contextData.put("companyCode", companyCode);
|
||||
contextData.put("user_id", userId);
|
||||
contextData.put("company_code", companyCode);
|
||||
Map<String, Object> result = externalCallConfigService.executeExternalCallConfig(id, contextData);
|
||||
String message = (String) result.get("message");
|
||||
return ResponseEntity.ok(ApiResponse.success(result, message));
|
||||
|
||||
@@ -22,7 +22,7 @@ public class ExternalCallController {
|
||||
@SuppressWarnings("unchecked")
|
||||
@PostMapping("/test")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> testExternalCall(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
|
||||
Map<String, Object> settings = (Map<String, Object>) body.get("settings");
|
||||
@@ -41,20 +41,20 @@ public class ExternalCallController {
|
||||
}
|
||||
|
||||
// 테스트 요청 생성
|
||||
Map<String, Object> templateData = (Map<String, Object>) body.get("templateData");
|
||||
Map<String, Object> templateData = (Map<String, Object>) body.get("template_data");
|
||||
if (templateData == null) {
|
||||
templateData = Map.of(
|
||||
"recordCount", 5,
|
||||
"tableName", "test_table",
|
||||
"record_count", 5,
|
||||
"table_name", "test_table",
|
||||
"timestamp", new Date().toString()
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, Object> request = new LinkedHashMap<>();
|
||||
request.put("diagramId", 0);
|
||||
request.put("relationshipId", "test");
|
||||
request.put("diagram_id", 0);
|
||||
request.put("relationship_id", "test");
|
||||
request.put("settings", settings);
|
||||
request.put("templateData", templateData);
|
||||
request.put("template_data", templateData);
|
||||
|
||||
Map<String, Object> result = service.executeExternalCall(request);
|
||||
boolean success = Boolean.TRUE.equals(result.get("success"));
|
||||
@@ -70,11 +70,11 @@ public class ExternalCallController {
|
||||
@SuppressWarnings("unchecked")
|
||||
@PostMapping("/execute")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> executeExternalCall(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
|
||||
Object diagramId = body.get("diagramId");
|
||||
String relationshipId = (String) body.get("relationshipId");
|
||||
Object diagramId = body.get("diagram_id");
|
||||
String relationshipId = (String) body.get("relationship_id");
|
||||
Map<String, Object> settings = (Map<String, Object>) body.get("settings");
|
||||
|
||||
if (diagramId == null || relationshipId == null || settings == null) {
|
||||
@@ -102,7 +102,7 @@ public class ExternalCallController {
|
||||
|
||||
@GetMapping("/types")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getExternalCallTypeList(
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
Map<String, Object> types = service.getExternalCallTypeList();
|
||||
return ResponseEntity.ok(ApiResponse.success(types, "지원되는 외부 호출 타입 목록"));
|
||||
}
|
||||
@@ -112,7 +112,7 @@ public class ExternalCallController {
|
||||
@SuppressWarnings("unchecked")
|
||||
@PostMapping("/validate")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> validateExternalCallSettings(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
|
||||
Map<String, Object> settings = (Map<String, Object>) body.get("settings");
|
||||
|
||||
+18
-18
@@ -33,7 +33,7 @@ public class ExternalDbConnectionController {
|
||||
*/
|
||||
@GetMapping("/types/supported")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getSupportedTypes(
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
return ResponseEntity.ok(
|
||||
ApiResponse.success(service.getSupportedTypes(), "지원하는 DB 타입 목록을 조회했습니다."));
|
||||
}
|
||||
@@ -45,9 +45,9 @@ public class ExternalDbConnectionController {
|
||||
*/
|
||||
@GetMapping("/pool-status")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getPoolStatus(
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
Map<String, Object> status = service.getPoolStatus();
|
||||
String msg = status.get("totalPools") + "개의 연결 풀 상태를 조회했습니다.";
|
||||
String msg = status.get("total_pools") + "개의 연결 풀 상태를 조회했습니다.";
|
||||
return ResponseEntity.ok(ApiResponse.success(status, msg));
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ public class ExternalDbConnectionController {
|
||||
*/
|
||||
@GetMapping("/grouped")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getConnectionsGroupedByType(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> queryParams) {
|
||||
buildFilter(queryParams, companyCode, (String) queryParams.get("company_code"));
|
||||
Map<String, Object> grouped = service.getConnectionsGroupedByType(queryParams);
|
||||
@@ -73,7 +73,7 @@ public class ExternalDbConnectionController {
|
||||
*/
|
||||
@GetMapping("/control/active")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getActiveConnectionsForControl(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam(required = false) String company_code) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
buildFilter(params, companyCode, company_code);
|
||||
@@ -89,7 +89,7 @@ public class ExternalDbConnectionController {
|
||||
*/
|
||||
@GetMapping
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getConnections(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> queryParams) {
|
||||
buildFilter(queryParams, companyCode, (String) queryParams.get("company_code"));
|
||||
List<Map<String, Object>> list = service.getConnections(queryParams);
|
||||
@@ -104,7 +104,7 @@ public class ExternalDbConnectionController {
|
||||
*/
|
||||
@GetMapping("/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getConnectionById(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable long id) {
|
||||
Map<String, Object> conn = service.getConnectionById(id);
|
||||
if (conn == null) {
|
||||
@@ -121,8 +121,8 @@ public class ExternalDbConnectionController {
|
||||
*/
|
||||
@PostMapping
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> createConnection(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("created_by", userId);
|
||||
body.put("updated_by", userId);
|
||||
@@ -142,8 +142,8 @@ public class ExternalDbConnectionController {
|
||||
*/
|
||||
@PutMapping("/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> updateConnection(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@PathVariable long id,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("updated_by", userId);
|
||||
@@ -164,7 +164,7 @@ public class ExternalDbConnectionController {
|
||||
*/
|
||||
@DeleteMapping("/{id}")
|
||||
public ResponseEntity<ApiResponse<Void>> deleteConnection(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable long id) {
|
||||
try {
|
||||
service.deleteConnection(id, companyCode);
|
||||
@@ -181,7 +181,7 @@ public class ExternalDbConnectionController {
|
||||
*/
|
||||
@PostMapping("/{id}/test")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> testConnection(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable long id,
|
||||
@RequestBody(required = false) Map<String, Object> body) {
|
||||
String testPassword = body != null ? (String) body.get("password") : null;
|
||||
@@ -197,7 +197,7 @@ public class ExternalDbConnectionController {
|
||||
*/
|
||||
@PostMapping("/{id}/execute")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> executeQuery(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable long id,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
String sql = (String) body.get("query");
|
||||
@@ -225,7 +225,7 @@ public class ExternalDbConnectionController {
|
||||
*/
|
||||
@GetMapping("/{id}/tables")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getTables(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable long id) {
|
||||
try {
|
||||
List<Map<String, Object>> tables = service.getTables(id);
|
||||
@@ -243,7 +243,7 @@ public class ExternalDbConnectionController {
|
||||
*/
|
||||
@GetMapping("/{id}/tables/{tableName}/columns")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getTableColumns(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable long id,
|
||||
@PathVariable String tableName) {
|
||||
if (tableName == null || tableName.isBlank()) {
|
||||
@@ -270,12 +270,12 @@ public class ExternalDbConnectionController {
|
||||
if ("*".equals(userCompanyCode)) {
|
||||
// SUPER_ADMIN: query param이 있으면 그것, 없으면 전체(null → WHERE 없음)
|
||||
if (queryCompanyCode != null && !queryCompanyCode.isBlank()) {
|
||||
params.put("filterCompanyCode", queryCompanyCode);
|
||||
params.put("filter_company_code", queryCompanyCode);
|
||||
}
|
||||
// filterCompanyCode 없으면 전체 조회
|
||||
} else {
|
||||
// 일반 사용자: 강제 적용
|
||||
params.put("filterCompanyCode", userCompanyCode);
|
||||
params.put("filter_company_code", userCompanyCode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+18
-18
@@ -21,9 +21,9 @@ public class ExternalRestApiConnectionController {
|
||||
|
||||
@GetMapping
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getConnections(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> queryParams) {
|
||||
queryParams.put("companyCode", companyCode);
|
||||
queryParams.put("company_code", companyCode);
|
||||
List<Map<String, Object>> list = service.getExternalRestApiConnectionList(queryParams);
|
||||
return ResponseEntity.ok(
|
||||
ApiResponse.success(list, list.size() + "개의 REST API 연결을 조회했습니다."));
|
||||
@@ -33,11 +33,11 @@ public class ExternalRestApiConnectionController {
|
||||
|
||||
@GetMapping("/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getConnectionById(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable int id) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("id", id);
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
Map<String, Object> conn = service.getExternalRestApiConnectionInfo(params);
|
||||
if (conn == null) {
|
||||
return ResponseEntity.status(404)
|
||||
@@ -50,11 +50,11 @@ public class ExternalRestApiConnectionController {
|
||||
|
||||
@PostMapping
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> createConnection(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("createdBy", userId);
|
||||
body.put("company_code", companyCode);
|
||||
body.put("created_by", userId);
|
||||
try {
|
||||
Map<String, Object> created = service.insertExternalRestApiConnection(body);
|
||||
return ResponseEntity.status(201)
|
||||
@@ -68,12 +68,12 @@ public class ExternalRestApiConnectionController {
|
||||
|
||||
@PutMapping("/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> updateConnection(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@PathVariable int id,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("updatedBy", userId);
|
||||
body.put("company_code", companyCode);
|
||||
body.put("updated_by", userId);
|
||||
Map<String, Object> updated = service.updateExternalRestApiConnection(id, body);
|
||||
if (updated == null) {
|
||||
return ResponseEntity.status(404)
|
||||
@@ -86,10 +86,10 @@ public class ExternalRestApiConnectionController {
|
||||
|
||||
@DeleteMapping("/{id}")
|
||||
public ResponseEntity<ApiResponse<Void>> deleteConnection(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable int id) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
boolean deleted = service.deleteExternalRestApiConnection(id, params);
|
||||
if (!deleted) {
|
||||
return ResponseEntity.status(404)
|
||||
@@ -102,7 +102,7 @@ public class ExternalRestApiConnectionController {
|
||||
|
||||
@PostMapping("/test")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> testConnection(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
Map<String, Object> result = service.testConnection(body, companyCode);
|
||||
boolean success = Boolean.TRUE.equals(result.get("success"));
|
||||
@@ -114,7 +114,7 @@ public class ExternalRestApiConnectionController {
|
||||
|
||||
@PostMapping("/{id}/test")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> testConnectionById(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable int id,
|
||||
@RequestBody(required = false) Map<String, Object> body) {
|
||||
String endpoint = body != null ? (String) body.get("endpoint") : null;
|
||||
@@ -128,11 +128,11 @@ public class ExternalRestApiConnectionController {
|
||||
|
||||
@PostMapping("/{id}/fetch")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> fetchData(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable int id,
|
||||
@RequestBody(required = false) Map<String, Object> body) {
|
||||
Map<String, Object> params = body != null ? new HashMap<>(body) : new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
String endpoint = (String) params.get("endpoint");
|
||||
String jsonPath = (String) params.get("json_path");
|
||||
Map<String, Object> result = service.fetchData(id, endpoint, jsonPath, params);
|
||||
|
||||
@@ -32,17 +32,17 @@ public class FileController {
|
||||
|
||||
@GetMapping
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getFileList(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(fileService.getFileList(params)));
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getFileListAlias(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(fileService.getFileList(params)));
|
||||
}
|
||||
|
||||
@@ -60,12 +60,12 @@ public class FileController {
|
||||
// 공개 응답: 메타데이터만 반환
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("objid", fileInfo.get("objid"));
|
||||
result.put("realFileName", fileInfo.get("realFileName"));
|
||||
result.put("fileSize", fileInfo.get("fileSize"));
|
||||
result.put("fileExt", fileInfo.get("fileExt"));
|
||||
result.put("filePath", fileInfo.get("filePath"));
|
||||
result.put("real_file_name", fileInfo.get("real_file_name"));
|
||||
result.put("file_size", fileInfo.get("file_size"));
|
||||
result.put("file_ext", fileInfo.get("file_ext"));
|
||||
result.put("file_path", fileInfo.get("file_path"));
|
||||
result.put("regdate", fileInfo.get("regdate"));
|
||||
result.put("isRepresentative", fileInfo.get("isRepresentative"));
|
||||
result.put("is_representative", fileInfo.get("is_representative"));
|
||||
return ResponseEntity.ok(ApiResponse.success(result));
|
||||
}
|
||||
|
||||
@@ -73,12 +73,12 @@ public class FileController {
|
||||
|
||||
@GetMapping("/linked/{tableName}/{recordId}")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getLinkedFiles(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String tableName,
|
||||
@PathVariable String recordId) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("targetObjid", tableName + ":" + recordId);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("target_objid", tableName + ":" + recordId);
|
||||
return ResponseEntity.ok(ApiResponse.success(fileService.getFilesByTarget(params)));
|
||||
}
|
||||
|
||||
@@ -86,13 +86,13 @@ public class FileController {
|
||||
|
||||
@PostMapping("/upload")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> uploadFiles(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute(value = "userId", required = false) String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute(value = "user_id", required = false) String userId,
|
||||
@RequestParam("file") List<MultipartFile> files,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
try {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("userId", userId != null ? userId : "system");
|
||||
params.put("company_code", companyCode);
|
||||
params.put("user_id", userId != null ? userId : "system");
|
||||
List<Map<String, Object>> results = fileService.uploadFiles(files, params);
|
||||
return ResponseEntity.ok(ApiResponse.success(results, "파일 업로드 완료"));
|
||||
} catch (IllegalArgumentException e) {
|
||||
@@ -107,10 +107,10 @@ public class FileController {
|
||||
|
||||
@GetMapping("/download/{objid}")
|
||||
public ResponseEntity<Resource> downloadFile(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long objid) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("objid", objid);
|
||||
Map<String, Object> fileInfo = fileService.getFileInfo(params);
|
||||
if (fileInfo == null) {
|
||||
@@ -121,7 +121,7 @@ public class FileController {
|
||||
if (!Files.exists(filePath)) {
|
||||
return ResponseEntity.notFound().build();
|
||||
}
|
||||
String realFileName = (String) fileInfo.getOrDefault("realFileName", "download");
|
||||
String realFileName = (String) fileInfo.getOrDefault("real_file_name", "download");
|
||||
String encodedName = URLEncoder.encode(realFileName, StandardCharsets.UTF_8)
|
||||
.replace("+", "%20");
|
||||
Resource resource = new FileSystemResource(filePath);
|
||||
@@ -166,10 +166,10 @@ public class FileController {
|
||||
|
||||
@DeleteMapping("/{objid}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> deleteFile(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long objid) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("objid", objid);
|
||||
fileService.deleteFile(params);
|
||||
return ResponseEntity.ok(ApiResponse.success(null, "파일이 삭제되었습니다."));
|
||||
|
||||
@@ -41,15 +41,15 @@ public class FlowController {
|
||||
|
||||
@GetMapping("/definitions")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getFlowDefinitionList(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(service.getFlowDefinitionList(params)));
|
||||
}
|
||||
|
||||
@GetMapping("/definitions/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getFlowDefinitionInfo(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable("id") int id) {
|
||||
Map<String, Object> detail = service.getFlowDefinitionInfo(id, companyCode);
|
||||
if (detail == null) {
|
||||
@@ -60,8 +60,8 @@ public class FlowController {
|
||||
|
||||
@PostMapping("/definitions")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> insertFlowDefinition(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
|
||||
if (body.get("name") == null) {
|
||||
@@ -69,8 +69,8 @@ public class FlowController {
|
||||
}
|
||||
|
||||
// 테이블 존재 확인 (REST API / multi 제외)
|
||||
String tableName = (String) body.get("tableName");
|
||||
String dbSource = (String) body.getOrDefault("dbSourceType", "internal");
|
||||
String tableName = (String) body.get("table_name");
|
||||
String dbSource = (String) body.getOrDefault("db_source_type", "internal");
|
||||
boolean skipCheck = "restapi".equals(dbSource)
|
||||
|| "multi_restapi".equals(dbSource)
|
||||
|| "multi_external_db".equals(dbSource)
|
||||
@@ -95,7 +95,7 @@ public class FlowController {
|
||||
|
||||
@PutMapping("/definitions/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> updateFlowDefinition(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable("id") int id,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
if (service.getFlowDefinitionById(id, companyCode) == null) {
|
||||
@@ -114,7 +114,7 @@ public class FlowController {
|
||||
|
||||
@DeleteMapping("/definitions/{id}")
|
||||
public ResponseEntity<ApiResponse<Void>> deleteFlowDefinition(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable("id") int id) {
|
||||
boolean deleted = service.deleteFlowDefinition(id, companyCode);
|
||||
if (!deleted) {
|
||||
@@ -129,17 +129,17 @@ public class FlowController {
|
||||
|
||||
@GetMapping("/definitions/{flowId}/steps")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getFlowStepList(
|
||||
@PathVariable("flowId") int flowId) {
|
||||
@PathVariable("flow_id") int flowId) {
|
||||
return ResponseEntity.ok(ApiResponse.success(service.getFlowStepList(flowId)));
|
||||
}
|
||||
|
||||
@PostMapping("/definitions/{flowId}/steps")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> insertFlowStep(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@PathVariable("flowId") int flowId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable("flow_id") int flowId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
|
||||
if (body.get("stepName") == null || body.get("stepOrder") == null) {
|
||||
if (body.get("step_name") == null || body.get("step_order") == null) {
|
||||
return ResponseEntity.status(400)
|
||||
.body(ApiResponse.error("stepName and stepOrder are required"));
|
||||
}
|
||||
@@ -161,8 +161,8 @@ public class FlowController {
|
||||
|
||||
@PutMapping("/steps/{stepId}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> updateFlowStep(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@PathVariable("stepId") int stepId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable("step_id") int stepId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
|
||||
// 스텝 소유권 검증: 스텝이 속한 플로우가 요청자 회사 소유인지 확인
|
||||
@@ -191,8 +191,8 @@ public class FlowController {
|
||||
|
||||
@DeleteMapping("/steps/{stepId}")
|
||||
public ResponseEntity<ApiResponse<Void>> deleteFlowStep(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@PathVariable("stepId") int stepId) {
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable("step_id") int stepId) {
|
||||
|
||||
Map<String, Object> existingStep = service.getFlowStepById(stepId);
|
||||
if (existingStep != null) {
|
||||
@@ -216,18 +216,18 @@ public class FlowController {
|
||||
|
||||
@GetMapping("/connections/{flowId}")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getFlowConnectionList(
|
||||
@PathVariable("flowId") int flowId) {
|
||||
@PathVariable("flow_id") int flowId) {
|
||||
return ResponseEntity.ok(ApiResponse.success(service.getFlowConnectionList(flowId)));
|
||||
}
|
||||
|
||||
@PostMapping("/connections")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> insertFlowConnection(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
|
||||
Object flowDefIdRaw = body.get("flowDefinitionId");
|
||||
Object fromRaw = body.get("fromStepId");
|
||||
Object toRaw = body.get("toStepId");
|
||||
Object flowDefIdRaw = body.get("flow_definition_id");
|
||||
Object fromRaw = body.get("from_step_id");
|
||||
Object toRaw = body.get("to_step_id");
|
||||
|
||||
if (flowDefIdRaw == null || fromRaw == null || toRaw == null) {
|
||||
return ResponseEntity.status(400)
|
||||
@@ -264,8 +264,8 @@ public class FlowController {
|
||||
|
||||
@DeleteMapping("/connections/{connectionId}")
|
||||
public ResponseEntity<ApiResponse<Void>> deleteFlowConnection(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@PathVariable("connectionId") int connectionId) {
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable("connection_id") int connectionId) {
|
||||
|
||||
Map<String, Object> existingConn = service.getFlowConnectionById(connectionId);
|
||||
if (existingConn != null) {
|
||||
@@ -288,8 +288,8 @@ public class FlowController {
|
||||
|
||||
@GetMapping("/{flowId}/step/{stepId}/count")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getFlowStepDataCount(
|
||||
@PathVariable("flowId") int flowId,
|
||||
@PathVariable("stepId") int stepId) {
|
||||
@PathVariable("flow_id") int flowId,
|
||||
@PathVariable("step_id") int stepId) {
|
||||
try {
|
||||
return ResponseEntity.ok(ApiResponse.success(service.getFlowStepDataCount(flowId, stepId)));
|
||||
} catch (Exception e) {
|
||||
@@ -302,8 +302,8 @@ public class FlowController {
|
||||
|
||||
@GetMapping("/{flowId}/step/{stepId}/list")
|
||||
public ResponseEntity<ApiResponse<Object>> getFlowStepDataList(
|
||||
@PathVariable("flowId") int flowId,
|
||||
@PathVariable("stepId") int stepId,
|
||||
@PathVariable("flow_id") int flowId,
|
||||
@PathVariable("step_id") int stepId,
|
||||
@RequestParam(defaultValue = "1") int page,
|
||||
@RequestParam(defaultValue = "20") int pageSize) {
|
||||
try {
|
||||
@@ -319,8 +319,8 @@ public class FlowController {
|
||||
|
||||
@GetMapping("/{flowId}/step/{stepId}/column-labels")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getFlowColumnLabelList(
|
||||
@PathVariable("flowId") int flowId,
|
||||
@PathVariable("stepId") int stepId) {
|
||||
@PathVariable("flow_id") int flowId,
|
||||
@PathVariable("step_id") int stepId) {
|
||||
try {
|
||||
Map<String, Object> step = service.getFlowStepById(stepId);
|
||||
if (step == null) {
|
||||
@@ -342,7 +342,7 @@ public class FlowController {
|
||||
|
||||
@GetMapping("/{flowId}/steps/counts")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getFlowStepCountList(
|
||||
@PathVariable("flowId") int flowId) {
|
||||
@PathVariable("flow_id") int flowId) {
|
||||
try {
|
||||
return ResponseEntity.ok(ApiResponse.success(service.getFlowStepCountList(flowId)));
|
||||
} catch (Exception e) {
|
||||
@@ -355,11 +355,11 @@ public class FlowController {
|
||||
|
||||
@PutMapping("/{flowId}/step/{stepId}/data/{recordId}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> updateFlowStepData(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@PathVariable("flowId") int flowId,
|
||||
@PathVariable("stepId") int stepId,
|
||||
@PathVariable("recordId") String recordId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@PathVariable("flow_id") int flowId,
|
||||
@PathVariable("step_id") int stepId,
|
||||
@PathVariable("record_id") String recordId,
|
||||
@RequestBody Map<String, Object> updateData) {
|
||||
|
||||
if (updateData == null || updateData.isEmpty()) {
|
||||
@@ -385,13 +385,13 @@ public class FlowController {
|
||||
|
||||
@PostMapping("/move")
|
||||
public ResponseEntity<ApiResponse<Void>> moveData(
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
|
||||
Object flowId = body.get("flowId");
|
||||
Object fromStepId = body.get("fromStepId");
|
||||
Object recordId = body.get("recordId");
|
||||
Object toStepId = body.get("toStepId");
|
||||
Object flowId = body.get("flow_id");
|
||||
Object fromStepId = body.get("from_step_id");
|
||||
Object recordId = body.get("record_id");
|
||||
Object toStepId = body.get("to_step_id");
|
||||
|
||||
if (flowId == null || fromStepId == null || recordId == null || toStepId == null) {
|
||||
return ResponseEntity.status(400)
|
||||
@@ -412,13 +412,13 @@ public class FlowController {
|
||||
|
||||
@PostMapping("/move-batch")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> moveBatchData(
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
|
||||
Object flowId = body.get("flowId");
|
||||
Object fromStepId = body.get("fromStepId");
|
||||
Object toStepId = body.get("toStepId");
|
||||
Object dataIds = body.get("dataIds");
|
||||
Object flowId = body.get("flow_id");
|
||||
Object fromStepId = body.get("from_step_id");
|
||||
Object toStepId = body.get("to_step_id");
|
||||
Object dataIds = body.get("data_ids");
|
||||
|
||||
if (flowId == null || fromStepId == null || toStepId == null
|
||||
|| !(dataIds instanceof List)) {
|
||||
@@ -449,8 +449,8 @@ public class FlowController {
|
||||
: successCount + "건 성공, " + failureCount + "건 실패";
|
||||
|
||||
Map<String, Object> data = new java.util.LinkedHashMap<>();
|
||||
data.put("successCount", successCount);
|
||||
data.put("failureCount", failureCount);
|
||||
data.put("success_count", successCount);
|
||||
data.put("failure_count", failureCount);
|
||||
data.put("total", ids.size());
|
||||
result.put("message", message);
|
||||
result.put("data", data);
|
||||
@@ -471,7 +471,7 @@ public class FlowController {
|
||||
/** GET /audit/:flowId — 플로우 전체 이력 */
|
||||
@GetMapping("/audit/{flowId}")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getFlowAuditLogList(
|
||||
@PathVariable("flowId") int flowId,
|
||||
@PathVariable("flow_id") int flowId,
|
||||
@RequestParam(defaultValue = "100") int limit) {
|
||||
try {
|
||||
return ResponseEntity.ok(ApiResponse.success(service.getFlowAuditLogList(flowId, limit)));
|
||||
@@ -486,8 +486,8 @@ public class FlowController {
|
||||
/** GET /audit/:flowId/:recordId — 특정 레코드 이력 */
|
||||
@GetMapping("/audit/{flowId}/{recordId}")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getFlowAuditLogListByRecord(
|
||||
@PathVariable("flowId") int flowId,
|
||||
@PathVariable("recordId") String recordId) {
|
||||
@PathVariable("flow_id") int flowId,
|
||||
@PathVariable("record_id") String recordId) {
|
||||
try {
|
||||
return ResponseEntity.ok(ApiResponse.success(service.getFlowAuditLogListByRecord(flowId, recordId)));
|
||||
} catch (Exception e) {
|
||||
|
||||
+10
-10
@@ -33,7 +33,7 @@ public class FlowExternalDbConnectionController {
|
||||
|
||||
@GetMapping
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getAll(
|
||||
@RequestAttribute(value = "companyCode", required = false) String companyCode,
|
||||
@RequestAttribute(value = "company_code", required = false) String companyCode,
|
||||
@RequestParam(required = false, defaultValue = "false") String activeOnly) {
|
||||
try {
|
||||
boolean active = "true".equalsIgnoreCase(activeOnly);
|
||||
@@ -49,7 +49,7 @@ public class FlowExternalDbConnectionController {
|
||||
|
||||
@GetMapping("/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getById(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable int id) {
|
||||
try {
|
||||
Map<String, Object> conn = service.findById(id);
|
||||
@@ -67,12 +67,12 @@ public class FlowExternalDbConnectionController {
|
||||
|
||||
@PostMapping
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> create(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
// 필수 필드 검증
|
||||
if (isBlank(body, "name") || isBlank(body, "dbType") || isBlank(body, "db_type") && isBlank(body, "dbType")
|
||||
if (isBlank(body, "name") || isBlank(body, "db_type") || isBlank(body, "db_type") && isBlank(body, "db_type")
|
||||
|| isBlank(body, "host") || body.get("port") == null
|
||||
|| isBlank(body, "databaseName") && isBlank(body, "database_name")
|
||||
|| isBlank(body, "database_name") && isBlank(body, "database_name")
|
||||
|| isBlank(body, "username") || isBlank(body, "password")) {
|
||||
return ResponseEntity.status(400)
|
||||
.body(ApiResponse.error("필수 필드가 누락되었습니다"));
|
||||
@@ -92,7 +92,7 @@ public class FlowExternalDbConnectionController {
|
||||
|
||||
@PutMapping("/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> update(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable int id,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
try {
|
||||
@@ -113,7 +113,7 @@ public class FlowExternalDbConnectionController {
|
||||
|
||||
@DeleteMapping("/{id}")
|
||||
public ResponseEntity<ApiResponse<Void>> delete(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable int id) {
|
||||
try {
|
||||
boolean deleted = service.delete(id);
|
||||
@@ -132,7 +132,7 @@ public class FlowExternalDbConnectionController {
|
||||
|
||||
@PostMapping("/{id}/test")
|
||||
public ResponseEntity<ApiResponse<Void>> testConnection(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable int id) {
|
||||
try {
|
||||
Map<String, Object> result = service.testConnection(id);
|
||||
@@ -154,7 +154,7 @@ public class FlowExternalDbConnectionController {
|
||||
|
||||
@GetMapping("/{id}/tables")
|
||||
public ResponseEntity<?> getTables(
|
||||
@RequestAttribute(value = "companyCode", required = false) String companyCode,
|
||||
@RequestAttribute(value = "company_code", required = false) String companyCode,
|
||||
@PathVariable int id) {
|
||||
try {
|
||||
Map<String, Object> result = service.getTables(id);
|
||||
@@ -171,7 +171,7 @@ public class FlowExternalDbConnectionController {
|
||||
|
||||
@GetMapping("/{id}/tables/{tableName}/columns")
|
||||
public ResponseEntity<?> getTableColumns(
|
||||
@RequestAttribute(value = "companyCode", required = false) String companyCode,
|
||||
@RequestAttribute(value = "company_code", required = false) String companyCode,
|
||||
@PathVariable int id,
|
||||
@PathVariable String tableName) {
|
||||
try {
|
||||
|
||||
@@ -24,9 +24,9 @@ public class LayoutController {
|
||||
*/
|
||||
@GetMapping
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getLayouts(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(layoutService.getLayouts(params)));
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ public class LayoutController {
|
||||
*/
|
||||
@GetMapping("/counts-by-category")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getLayoutCountsByCategory(
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
return ResponseEntity.ok(ApiResponse.success(
|
||||
layoutService.getLayoutCountsByCategory(companyCode)));
|
||||
}
|
||||
@@ -48,7 +48,7 @@ public class LayoutController {
|
||||
*/
|
||||
@GetMapping("/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getLayoutById(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable("id") String layoutCode) {
|
||||
Map<String, Object> layout = layoutService.getLayoutById(layoutCode, companyCode);
|
||||
if (layout == null) {
|
||||
@@ -64,15 +64,15 @@ public class LayoutController {
|
||||
*/
|
||||
@PostMapping
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> createLayout(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
|
||||
if (body.get("layoutName") == null || body.get("layoutType") == null || body.get("category") == null) {
|
||||
if (body.get("layout_name") == null || body.get("layout_type") == null || body.get("category") == null) {
|
||||
return ResponseEntity.status(400)
|
||||
.body(ApiResponse.error("필수 필드가 누락되었습니다. (layoutName, layoutType, category)"));
|
||||
}
|
||||
if (body.get("layoutConfig") == null || body.get("zonesConfig") == null) {
|
||||
if (body.get("layout_config") == null || body.get("zones_config") == null) {
|
||||
return ResponseEntity.status(400)
|
||||
.body(ApiResponse.error("레이아웃 설정과 존 설정은 필수입니다."));
|
||||
}
|
||||
@@ -94,8 +94,8 @@ public class LayoutController {
|
||||
*/
|
||||
@PutMapping("/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> updateLayout(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@PathVariable("id") String layoutCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
|
||||
@@ -119,8 +119,8 @@ public class LayoutController {
|
||||
*/
|
||||
@DeleteMapping("/{id}")
|
||||
public ResponseEntity<ApiResponse<Void>> deleteLayout(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@PathVariable("id") String layoutCode) {
|
||||
|
||||
try {
|
||||
@@ -142,12 +142,12 @@ public class LayoutController {
|
||||
*/
|
||||
@PostMapping("/{id}/duplicate")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> duplicateLayout(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@PathVariable("id") String layoutCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
|
||||
String newName = (String) body.get("newName");
|
||||
String newName = (String) body.get("new_name");
|
||||
if (newName == null || newName.isBlank()) {
|
||||
return ResponseEntity.status(400)
|
||||
.body(ApiResponse.error("새 레이아웃 이름이 필요합니다."));
|
||||
|
||||
@@ -17,46 +17,46 @@ public class MailAccountFileController {
|
||||
|
||||
@GetMapping("/list")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getMailAccountFileList(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(mailAccountFileService.getMailAccountFileList(params)));
|
||||
}
|
||||
|
||||
@GetMapping("/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getMailAccountFileInfo(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long id) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("id", id);
|
||||
return ResponseEntity.ok(ApiResponse.success(mailAccountFileService.getMailAccountFileInfo(params)));
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> insertMailAccountFile(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(mailAccountFileService.insertMailAccountFile(body)));
|
||||
}
|
||||
|
||||
@PutMapping("/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> updateMailAccountFile(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long id,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
body.put("id", id);
|
||||
return ResponseEntity.ok(ApiResponse.success(mailAccountFileService.updateMailAccountFile(body)));
|
||||
}
|
||||
|
||||
@DeleteMapping("/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> deleteMailAccountFile(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long id) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("id", id);
|
||||
return ResponseEntity.ok(ApiResponse.success(mailAccountFileService.deleteMailAccountFile(params)));
|
||||
}
|
||||
|
||||
@@ -21,9 +21,9 @@ public class MailReceiveBasicController {
|
||||
/** GET /today-count → 오늘 수신 메일 수 */
|
||||
@GetMapping("/today-count")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getMailReceiveBasicTodayCount(
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
int count = mailReceiveBasicService.getMailReceiveBasicTodayCount(params);
|
||||
Map<String, Object> data = new HashMap<>();
|
||||
data.put("count", count);
|
||||
@@ -33,22 +33,22 @@ public class MailReceiveBasicController {
|
||||
/** GET /{accountId}/{seqno}/attachment/{index} → 첨부파일 다운로드 */
|
||||
@GetMapping("/{accountId}/{seqno}/attachment/{index}")
|
||||
public ResponseEntity<byte[]> downloadMailReceiveBasicAttachment(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long accountId,
|
||||
@PathVariable String seqno,
|
||||
@PathVariable int index) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("accountId", accountId);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("account_id", accountId);
|
||||
params.put("seqno", seqno);
|
||||
params.put("attachIndex", index);
|
||||
params.put("attach_index", index);
|
||||
Map<String, Object> attachment = mailReceiveBasicService.getMailReceiveBasicAttachment(params);
|
||||
if (attachment == null) {
|
||||
return ResponseEntity.notFound().build();
|
||||
}
|
||||
byte[] data = (byte[]) attachment.get("contentData");
|
||||
String fileName = (String) attachment.getOrDefault("fileName", "attachment");
|
||||
String contentType = (String) attachment.getOrDefault("contentType", "application/octet-stream");
|
||||
byte[] data = (byte[]) attachment.get("content_data");
|
||||
String fileName = (String) attachment.getOrDefault("file_name", "attachment");
|
||||
String contentType = (String) attachment.getOrDefault("content_type", "application/octet-stream");
|
||||
return ResponseEntity.ok()
|
||||
.header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + fileName + "\"")
|
||||
.contentType(MediaType.parseMediaType(contentType))
|
||||
@@ -58,12 +58,12 @@ public class MailReceiveBasicController {
|
||||
/** POST /{accountId}/{seqno}/mark-read → 메일 읽음 처리 */
|
||||
@PostMapping("/{accountId}/{seqno}/mark-read")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> markMailReceiveBasicAsRead(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long accountId,
|
||||
@PathVariable String seqno) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("accountId", accountId);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("account_id", accountId);
|
||||
params.put("seqno", seqno);
|
||||
return ResponseEntity.ok(ApiResponse.success(mailReceiveBasicService.markMailReceiveBasicAsRead(params)));
|
||||
}
|
||||
@@ -71,12 +71,12 @@ public class MailReceiveBasicController {
|
||||
/** DELETE /{accountId}/{seqno} → 메일 삭제 */
|
||||
@DeleteMapping("/{accountId}/{seqno}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> deleteMailReceiveBasic(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long accountId,
|
||||
@PathVariable String seqno) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("accountId", accountId);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("account_id", accountId);
|
||||
params.put("seqno", seqno);
|
||||
return ResponseEntity.ok(ApiResponse.success(mailReceiveBasicService.deleteMailReceiveBasic(params)));
|
||||
}
|
||||
@@ -84,12 +84,12 @@ public class MailReceiveBasicController {
|
||||
/** GET /{accountId}/{seqno} → 메일 상세 조회 */
|
||||
@GetMapping("/{accountId}/{seqno}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getMailReceiveBasicInfo(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long accountId,
|
||||
@PathVariable String seqno) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("accountId", accountId);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("account_id", accountId);
|
||||
params.put("seqno", seqno);
|
||||
return ResponseEntity.ok(ApiResponse.success(mailReceiveBasicService.getMailReceiveBasicInfo(params)));
|
||||
}
|
||||
@@ -97,22 +97,22 @@ public class MailReceiveBasicController {
|
||||
/** POST /{accountId}/test-imap → IMAP 연결 테스트 */
|
||||
@PostMapping("/{accountId}/test-imap")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> testMailReceiveBasicImapConnection(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long accountId) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("accountId", accountId);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("account_id", accountId);
|
||||
return ResponseEntity.ok(ApiResponse.success(mailReceiveBasicService.testMailReceiveBasicImapConnection(params)));
|
||||
}
|
||||
|
||||
/** GET /{accountId} → 메일 목록 조회 */
|
||||
@GetMapping("/{accountId}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getMailReceiveBasicList(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long accountId,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("accountId", accountId);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("account_id", accountId);
|
||||
return ResponseEntity.ok(ApiResponse.success(mailReceiveBasicService.getMailReceiveBasicList(params)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ public class MailSendSimpleController {
|
||||
@PostMapping(value = "/simple",
|
||||
consumes = {MediaType.MULTIPART_FORM_DATA_VALUE, MediaType.APPLICATION_FORM_URLENCODED_VALUE})
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> sendMail(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam(required = false) String accountId,
|
||||
@RequestParam(required = false) String templateId,
|
||||
@RequestParam(required = false) String modifiedTemplateComponents,
|
||||
@@ -46,17 +46,17 @@ public class MailSendSimpleController {
|
||||
@RequestPart(value = "attachments", required = false) List<MultipartFile> attachments) {
|
||||
|
||||
Map<String, Object> params = new LinkedHashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("accountId", accountId);
|
||||
params.put("templateId", templateId);
|
||||
params.put("modifiedTemplateComponents", modifiedTemplateComponents);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("account_id", accountId);
|
||||
params.put("template_id", templateId);
|
||||
params.put("modified_template_components", modifiedTemplateComponents);
|
||||
params.put("to", to);
|
||||
params.put("cc", cc);
|
||||
params.put("bcc", bcc);
|
||||
params.put("subject", subject);
|
||||
params.put("variables", variables);
|
||||
params.put("customHtml", customHtml);
|
||||
params.put("fileNames", fileNames);
|
||||
params.put("custom_html", customHtml);
|
||||
params.put("file_names", fileNames);
|
||||
params.put("attachments", attachments);
|
||||
|
||||
return ResponseEntity.ok(ApiResponse.success(
|
||||
@@ -70,10 +70,10 @@ public class MailSendSimpleController {
|
||||
*/
|
||||
@PostMapping("/bulk")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> sendBulkMail(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
Map<String, Object> result = mailSendSimpleService.sendBulkMail(body);
|
||||
int successCount = ((Number) result.getOrDefault("success", 0)).intValue();
|
||||
int total = ((Number) result.getOrDefault("total", 0)).intValue();
|
||||
@@ -87,10 +87,10 @@ public class MailSendSimpleController {
|
||||
*/
|
||||
@PostMapping("/test-connection")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> testConnection(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(
|
||||
mailSendSimpleService.testConnection(body)));
|
||||
}
|
||||
|
||||
@@ -18,27 +18,27 @@ public class MailSentHistoryController {
|
||||
// GET /statistics — /{id} 보다 먼저 정의해야 매핑 우선순위 확보
|
||||
@GetMapping("/statistics")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getMailSentHistoryStatistics(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(mailSentHistoryService.getMailSentHistoryStatistics(params)));
|
||||
}
|
||||
|
||||
// GET / — 목록 조회 (페이지네이션)
|
||||
@GetMapping
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getMailSentHistoryList(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(mailSentHistoryService.getMailSentHistoryList(params)));
|
||||
}
|
||||
|
||||
// POST /draft — 임시 저장
|
||||
@PostMapping("/draft")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> saveMailSentHistoryDraft(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(
|
||||
mailSentHistoryService.saveMailSentHistoryDraft(body), "임시 저장되었습니다."));
|
||||
}
|
||||
@@ -46,10 +46,10 @@ public class MailSentHistoryController {
|
||||
// PUT /draft/{id} — 임시 저장 업데이트
|
||||
@PutMapping("/draft/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> updateMailSentHistoryDraft(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String id,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
body.put("id", id);
|
||||
return ResponseEntity.ok(ApiResponse.success(
|
||||
mailSentHistoryService.updateMailSentHistoryDraft(body), "임시 저장이 업데이트되었습니다."));
|
||||
@@ -58,37 +58,37 @@ public class MailSentHistoryController {
|
||||
// POST /bulk/delete — 일괄 소프트 삭제
|
||||
@PostMapping("/bulk/delete")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> bulkDeleteMailSentHistory(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(mailSentHistoryService.bulkDeleteMailSentHistory(body)));
|
||||
}
|
||||
|
||||
// POST /bulk/permanent-delete — 일괄 영구 삭제
|
||||
@PostMapping("/bulk/permanent-delete")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> bulkPermanentDeleteMailSentHistory(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(mailSentHistoryService.bulkPermanentDeleteMailSentHistory(body)));
|
||||
}
|
||||
|
||||
// POST /bulk/restore — 일괄 복구
|
||||
@PostMapping("/bulk/restore")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> bulkRestoreMailSentHistory(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(mailSentHistoryService.bulkRestoreMailSentHistory(body)));
|
||||
}
|
||||
|
||||
// POST /{id}/restore — 메일 복구
|
||||
@PostMapping("/{id}/restore")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> restoreMailSentHistory(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String id) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("id", id);
|
||||
return ResponseEntity.ok(ApiResponse.success(
|
||||
mailSentHistoryService.restoreMailSentHistory(params), "메일이 복구되었습니다."));
|
||||
@@ -97,10 +97,10 @@ public class MailSentHistoryController {
|
||||
// DELETE /{id}/permanent — 영구 삭제
|
||||
@DeleteMapping("/{id}/permanent")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> permanentlyDeleteMailSentHistory(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String id) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("id", id);
|
||||
return ResponseEntity.ok(ApiResponse.success(
|
||||
mailSentHistoryService.permanentlyDeleteMailSentHistory(params), "메일이 영구 삭제되었습니다."));
|
||||
@@ -109,10 +109,10 @@ public class MailSentHistoryController {
|
||||
// GET /{id} — 단건 조회
|
||||
@GetMapping("/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getMailSentHistoryInfo(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String id) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("id", id);
|
||||
return ResponseEntity.ok(ApiResponse.success(mailSentHistoryService.getMailSentHistoryInfo(params)));
|
||||
}
|
||||
@@ -120,10 +120,10 @@ public class MailSentHistoryController {
|
||||
// DELETE /{id} — 소프트 삭제
|
||||
@DeleteMapping("/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> deleteMailSentHistory(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String id) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("id", id);
|
||||
return ResponseEntity.ok(ApiResponse.success(
|
||||
mailSentHistoryService.deleteMailSentHistory(params), "발송 이력이 삭제되었습니다."));
|
||||
|
||||
@@ -18,28 +18,28 @@ public class MailTemplateFileController {
|
||||
/** GET /list → 템플릿 목록 조회 (alias) */
|
||||
@GetMapping("/list")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getMailTemplateFileListAlias(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(mailTemplateFileService.getMailTemplateFileList(params)));
|
||||
}
|
||||
|
||||
/** GET / → 템플릿 목록 조회 */
|
||||
@GetMapping
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getMailTemplateFileList(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(mailTemplateFileService.getMailTemplateFileList(params)));
|
||||
}
|
||||
|
||||
/** GET /{id} → 템플릿 상세 조회 */
|
||||
@GetMapping("/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getMailTemplateFileInfo(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long id) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("id", id);
|
||||
return ResponseEntity.ok(ApiResponse.success(mailTemplateFileService.getMailTemplateFileInfo(params)));
|
||||
}
|
||||
@@ -47,19 +47,19 @@ public class MailTemplateFileController {
|
||||
/** POST / → 템플릿 생성 */
|
||||
@PostMapping
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> insertMailTemplateFile(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(mailTemplateFileService.insertMailTemplateFile(body)));
|
||||
}
|
||||
|
||||
/** PUT /{id} → 템플릿 수정 */
|
||||
@PutMapping("/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> updateMailTemplateFile(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long id,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
body.put("id", id);
|
||||
return ResponseEntity.ok(ApiResponse.success(mailTemplateFileService.updateMailTemplateFile(body)));
|
||||
}
|
||||
@@ -67,10 +67,10 @@ public class MailTemplateFileController {
|
||||
/** DELETE /{id} → 템플릿 삭제 */
|
||||
@DeleteMapping("/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> deleteMailTemplateFile(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long id) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("id", id);
|
||||
return ResponseEntity.ok(ApiResponse.success(mailTemplateFileService.deleteMailTemplateFile(params)));
|
||||
}
|
||||
@@ -78,10 +78,10 @@ public class MailTemplateFileController {
|
||||
/** POST /{id}/preview → 템플릿 HTML 미리보기 */
|
||||
@PostMapping("/{id}/preview")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> previewMailTemplateFile(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long id,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
body.put("id", id);
|
||||
Map<String, Object> result = mailTemplateFileService.previewMailTemplateFile(body);
|
||||
if (result.isEmpty()) {
|
||||
@@ -93,7 +93,7 @@ public class MailTemplateFileController {
|
||||
/** POST /{id}/preview-with-query → 쿼리 연동 미리보기 (미지원) */
|
||||
@PostMapping("/{id}/preview-with-query")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> previewMailTemplateFileWithQuery(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long id) {
|
||||
return ResponseEntity.status(501).body(ApiResponse.error("SQL 쿼리 연동 기능은 현재 지원하지 않습니다."));
|
||||
}
|
||||
|
||||
@@ -25,13 +25,13 @@ public class MapDataController {
|
||||
*/
|
||||
@GetMapping("/external/{connectionId}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getExternalMapData(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long connectionId,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
|
||||
String tableName = (String) params.get("tableName");
|
||||
String latColumn = (String) params.get("latColumn");
|
||||
String lngColumn = (String) params.get("lngColumn");
|
||||
String tableName = (String) params.get("table_name");
|
||||
String latColumn = (String) params.get("lat_column");
|
||||
String lngColumn = (String) params.get("lng_column");
|
||||
|
||||
if (tableName == null || tableName.isBlank()
|
||||
|| latColumn == null || latColumn.isBlank()
|
||||
@@ -52,12 +52,12 @@ public class MapDataController {
|
||||
*/
|
||||
@GetMapping("/internal")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getInternalMapData(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
|
||||
String tableName = (String) params.get("tableName");
|
||||
String latColumn = (String) params.get("latColumn");
|
||||
String lngColumn = (String) params.get("lngColumn");
|
||||
String tableName = (String) params.get("table_name");
|
||||
String latColumn = (String) params.get("lat_column");
|
||||
String lngColumn = (String) params.get("lng_column");
|
||||
|
||||
if (tableName == null || tableName.isBlank()
|
||||
|| latColumn == null || latColumn.isBlank()
|
||||
|
||||
@@ -20,27 +20,27 @@ public class MoldController {
|
||||
|
||||
@GetMapping
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getMoldList(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(moldService.getMoldList(params)));
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getMoldListAlias(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(moldService.getMoldList(params)));
|
||||
}
|
||||
|
||||
@GetMapping("/{moldCode}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getMoldDetail(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String moldCode) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("moldCode", moldCode);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("mold_code", moldCode);
|
||||
Map<String, Object> result = moldService.getMoldInfo(params);
|
||||
if (result == null) return ResponseEntity.status(404).body(ApiResponse.error("금형을 찾을 수 없습니다."));
|
||||
return ResponseEntity.ok(ApiResponse.success(result));
|
||||
@@ -48,12 +48,12 @@ public class MoldController {
|
||||
|
||||
@PostMapping
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> createMold(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
body.put("writer", userId);
|
||||
if (body.get("moldCode") == null || body.get("moldName") == null) {
|
||||
if (body.get("mold_code") == null || body.get("mold_name") == null) {
|
||||
return ResponseEntity.status(400).body(ApiResponse.error("금형코드와 금형명은 필수입니다."));
|
||||
}
|
||||
try {
|
||||
@@ -68,11 +68,11 @@ public class MoldController {
|
||||
|
||||
@PutMapping("/{moldCode}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> updateMold(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String moldCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("moldCode", moldCode);
|
||||
body.put("company_code", companyCode);
|
||||
body.put("mold_code", moldCode);
|
||||
Map<String, Object> result = moldService.updateMold(body);
|
||||
if (result == null) return ResponseEntity.status(404).body(ApiResponse.error("금형을 찾을 수 없습니다."));
|
||||
return ResponseEntity.ok(ApiResponse.success(result, "금형이 수정되었습니다."));
|
||||
@@ -80,11 +80,11 @@ public class MoldController {
|
||||
|
||||
@DeleteMapping("/{moldCode}")
|
||||
public ResponseEntity<ApiResponse<Void>> deleteMold(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String moldCode) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("moldCode", moldCode);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("mold_code", moldCode);
|
||||
if (!moldService.deleteMold(params)) {
|
||||
return ResponseEntity.status(404).body(ApiResponse.error("금형을 찾을 수 없습니다."));
|
||||
}
|
||||
@@ -95,22 +95,22 @@ public class MoldController {
|
||||
|
||||
@GetMapping("/{moldCode}/serials")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getMoldSerials(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String moldCode) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("moldCode", moldCode);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("mold_code", moldCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(moldService.getMoldSerialList(params)));
|
||||
}
|
||||
|
||||
@PostMapping("/{moldCode}/serials")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> createMoldSerial(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@PathVariable String moldCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("moldCode", moldCode);
|
||||
body.put("company_code", companyCode);
|
||||
body.put("mold_code", moldCode);
|
||||
body.put("writer", userId);
|
||||
try {
|
||||
return ResponseEntity.ok(ApiResponse.success(moldService.insertMoldSerial(body), "일련번호가 등록되었습니다."));
|
||||
@@ -124,10 +124,10 @@ public class MoldController {
|
||||
|
||||
@DeleteMapping("/serials/{id}")
|
||||
public ResponseEntity<ApiResponse<Void>> deleteMoldSerial(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long id) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("id", id);
|
||||
if (!moldService.deleteMoldSerial(params)) {
|
||||
return ResponseEntity.status(404).body(ApiResponse.error("일련번호를 찾을 수 없습니다."));
|
||||
@@ -137,11 +137,11 @@ public class MoldController {
|
||||
|
||||
@GetMapping("/{moldCode}/serial-summary")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getMoldSerialSummary(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String moldCode) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("moldCode", moldCode);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("mold_code", moldCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(moldService.getMoldSerialSummary(params)));
|
||||
}
|
||||
|
||||
@@ -149,24 +149,24 @@ public class MoldController {
|
||||
|
||||
@GetMapping("/{moldCode}/inspections")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getMoldInspections(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String moldCode) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("moldCode", moldCode);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("mold_code", moldCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(moldService.getMoldInspectionList(params)));
|
||||
}
|
||||
|
||||
@PostMapping("/{moldCode}/inspections")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> createMoldInspection(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@PathVariable String moldCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("moldCode", moldCode);
|
||||
body.put("company_code", companyCode);
|
||||
body.put("mold_code", moldCode);
|
||||
body.put("writer", userId);
|
||||
if (body.get("inspectionItem") == null) {
|
||||
if (body.get("inspection_item") == null) {
|
||||
return ResponseEntity.status(400).body(ApiResponse.error("점검항목명은 필수입니다."));
|
||||
}
|
||||
return ResponseEntity.ok(ApiResponse.success(moldService.insertMoldInspection(body), "점검항목이 등록되었습니다."));
|
||||
@@ -174,10 +174,10 @@ public class MoldController {
|
||||
|
||||
@DeleteMapping("/inspections/{id}")
|
||||
public ResponseEntity<ApiResponse<Void>> deleteMoldInspection(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long id) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("id", id);
|
||||
if (!moldService.deleteMoldInspection(params)) {
|
||||
return ResponseEntity.status(404).body(ApiResponse.error("점검항목을 찾을 수 없습니다."));
|
||||
@@ -189,24 +189,24 @@ public class MoldController {
|
||||
|
||||
@GetMapping("/{moldCode}/parts")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getMoldParts(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String moldCode) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("moldCode", moldCode);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("mold_code", moldCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(moldService.getMoldPartList(params)));
|
||||
}
|
||||
|
||||
@PostMapping("/{moldCode}/parts")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> createMoldPart(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@PathVariable String moldCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("moldCode", moldCode);
|
||||
body.put("company_code", companyCode);
|
||||
body.put("mold_code", moldCode);
|
||||
body.put("writer", userId);
|
||||
if (body.get("partName") == null) {
|
||||
if (body.get("part_name") == null) {
|
||||
return ResponseEntity.status(400).body(ApiResponse.error("부품명은 필수입니다."));
|
||||
}
|
||||
return ResponseEntity.ok(ApiResponse.success(moldService.insertMoldPart(body), "부품이 등록되었습니다."));
|
||||
@@ -214,10 +214,10 @@ public class MoldController {
|
||||
|
||||
@DeleteMapping("/parts/{id}")
|
||||
public ResponseEntity<ApiResponse<Void>> deleteMoldPart(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long id) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("id", id);
|
||||
if (!moldService.deleteMoldPart(params)) {
|
||||
return ResponseEntity.status(404).body(ApiResponse.error("부품을 찾을 수 없습니다."));
|
||||
|
||||
@@ -21,7 +21,7 @@ public class MultiConnectionController {
|
||||
/** GET /connections/:connectionId/tables */
|
||||
@GetMapping("/connections/{connectionId}/tables")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getTablesFromConnection(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable int connectionId) {
|
||||
List<Map<String, Object>> tables = multiConnectionService.getTablesFromConnection(connectionId);
|
||||
return ResponseEntity.ok(ApiResponse.success(tables,
|
||||
@@ -31,7 +31,7 @@ public class MultiConnectionController {
|
||||
/** GET /connections/:connectionId/tables/batch */
|
||||
@GetMapping("/connections/{connectionId}/tables/batch")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getBatchTablesWithColumns(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable int connectionId) {
|
||||
List<Map<String, Object>> tables = multiConnectionService.getBatchTablesWithColumns(connectionId);
|
||||
return ResponseEntity.ok(ApiResponse.success(tables,
|
||||
@@ -41,7 +41,7 @@ public class MultiConnectionController {
|
||||
/** GET /connections/:connectionId/tables/:tableName/columns */
|
||||
@GetMapping("/connections/{connectionId}/tables/{tableName}/columns")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getColumnsFromConnection(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable int connectionId,
|
||||
@PathVariable String tableName) {
|
||||
if (tableName == null || tableName.isBlank()) {
|
||||
@@ -55,10 +55,10 @@ public class MultiConnectionController {
|
||||
/** POST /connections/:connectionId/query */
|
||||
@PostMapping("/connections/{connectionId}/query")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> fetchDataFromConnection(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable int connectionId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
if (body.get("tableName") == null) {
|
||||
if (body.get("table_name") == null) {
|
||||
return ResponseEntity.badRequest().body(ApiResponse.error("테이블명이 입력되지 않았습니다."));
|
||||
}
|
||||
List<Map<String, Object>> data = multiConnectionService.fetchDataFromConnection(connectionId, body);
|
||||
@@ -69,10 +69,10 @@ public class MultiConnectionController {
|
||||
/** POST /connections/:connectionId/insert */
|
||||
@PostMapping("/connections/{connectionId}/insert")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> insertDataToConnection(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable int connectionId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
if (body.get("tableName") == null || body.get("data") == null) {
|
||||
if (body.get("table_name") == null || body.get("data") == null) {
|
||||
return ResponseEntity.badRequest().body(ApiResponse.error("테이블명과 데이터가 필요합니다."));
|
||||
}
|
||||
Map<String, Object> result = multiConnectionService.insertDataToConnection(connectionId, body);
|
||||
@@ -82,10 +82,10 @@ public class MultiConnectionController {
|
||||
/** PUT /connections/:connectionId/update */
|
||||
@PutMapping("/connections/{connectionId}/update")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> updateDataToConnection(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable int connectionId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
if (body.get("tableName") == null || body.get("data") == null || body.get("conditions") == null) {
|
||||
if (body.get("table_name") == null || body.get("data") == null || body.get("conditions") == null) {
|
||||
return ResponseEntity.badRequest().body(ApiResponse.error("테이블명, 데이터, 조건이 모두 필요합니다."));
|
||||
}
|
||||
List<Map<String, Object>> result = multiConnectionService.updateDataToConnection(connectionId, body);
|
||||
@@ -96,10 +96,10 @@ public class MultiConnectionController {
|
||||
/** DELETE /connections/:connectionId/delete */
|
||||
@DeleteMapping("/connections/{connectionId}/delete")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> deleteDataFromConnection(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable int connectionId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
if (body.get("tableName") == null || body.get("conditions") == null) {
|
||||
if (body.get("table_name") == null || body.get("conditions") == null) {
|
||||
return ResponseEntity.badRequest().body(ApiResponse.error("테이블명과 삭제 조건이 필요합니다."));
|
||||
}
|
||||
List<Map<String, Object>> result = multiConnectionService.deleteDataFromConnection(connectionId, body);
|
||||
@@ -110,9 +110,9 @@ public class MultiConnectionController {
|
||||
/** POST /validate-self-operation */
|
||||
@PostMapping("/validate-self-operation")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> validateSelfOperation(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
if (body.get("tableName") == null || body.get("operation") == null || body.get("conditions") == null) {
|
||||
if (body.get("table_name") == null || body.get("operation") == null || body.get("conditions") == null) {
|
||||
return ResponseEntity.badRequest().body(ApiResponse.error("테이블명, 작업 타입, 조건이 모두 필요합니다."));
|
||||
}
|
||||
String op = body.get("operation").toString();
|
||||
|
||||
@@ -28,12 +28,12 @@ public class MultilangController {
|
||||
@RequestParam(required = false) String menuCode,
|
||||
@RequestParam(required = false) String userLang) {
|
||||
|
||||
String finalCompanyCode = companyCode != null ? companyCode : str(body.get("companyCode"));
|
||||
String finalMenuCode = menuCode != null ? menuCode : str(body.get("menuCode"));
|
||||
String finalUserLang = userLang != null ? userLang : str(body.get("userLang"));
|
||||
String finalCompanyCode = companyCode != null ? companyCode : str(body.get("company_code"));
|
||||
String finalMenuCode = menuCode != null ? menuCode : str(body.get("menu_code"));
|
||||
String finalUserLang = userLang != null ? userLang : str(body.get("user_lang"));
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
List<String> langKeys = (List<String>) body.get("langKeys");
|
||||
List<String> langKeys = (List<String>) body.get("lang_keys");
|
||||
|
||||
if (langKeys == null || langKeys.isEmpty()) {
|
||||
return ResponseEntity.badRequest().body(ApiResponse.error("langKeys 배열이 필요합니다."));
|
||||
@@ -59,21 +59,21 @@ public class MultilangController {
|
||||
|
||||
@PostMapping("/languages")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> createLanguage(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
|
||||
String langCode = str(body.get("langCode"));
|
||||
String langName = str(body.get("langName"));
|
||||
String langNative = str(body.get("langNative"));
|
||||
String langCode = str(body.get("lang_code"));
|
||||
String langName = str(body.get("lang_name"));
|
||||
String langNative = str(body.get("lang_native"));
|
||||
|
||||
if (langCode.isEmpty() || langName.isEmpty() || langNative.isEmpty()) {
|
||||
return ResponseEntity.badRequest()
|
||||
.body(ApiResponse.error("언어 코드, 언어명, 원어명은 필수입니다."));
|
||||
}
|
||||
|
||||
String userId = str(body.getOrDefault("createdBy", "system"));
|
||||
body.put("createdBy", userId);
|
||||
body.put("updatedBy", userId);
|
||||
String userId = str(body.getOrDefault("created_by", "system"));
|
||||
body.put("created_by", userId);
|
||||
body.put("updated_by", userId);
|
||||
Map<String, Object> created = multilangService.createLanguage(body);
|
||||
return ResponseEntity.status(201)
|
||||
.body(ApiResponse.success(created, "언어가 성공적으로 생성되었습니다."));
|
||||
@@ -81,19 +81,19 @@ public class MultilangController {
|
||||
|
||||
@PutMapping("/languages/{langCode}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> updateLanguage(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String langCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
|
||||
String userId = str(body.getOrDefault("updatedBy", "system"));
|
||||
body.put("updatedBy", userId);
|
||||
String userId = str(body.getOrDefault("updated_by", "system"));
|
||||
body.put("updated_by", userId);
|
||||
Map<String, Object> updated = multilangService.updateLanguage(langCode, body);
|
||||
return ResponseEntity.ok(ApiResponse.success(updated, "언어가 성공적으로 수정되었습니다."));
|
||||
}
|
||||
|
||||
@DeleteMapping("/languages/{langCode}")
|
||||
public ResponseEntity<ApiResponse<String>> deleteLanguage(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String langCode) {
|
||||
|
||||
multilangService.deleteLanguage(langCode);
|
||||
@@ -102,7 +102,7 @@ public class MultilangController {
|
||||
|
||||
@PutMapping("/languages/{langCode}/toggle")
|
||||
public ResponseEntity<ApiResponse<String>> toggleLanguage(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String langCode) {
|
||||
|
||||
String result = multilangService.toggleLanguage(langCode);
|
||||
@@ -115,7 +115,7 @@ public class MultilangController {
|
||||
|
||||
@GetMapping("/keys")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getLangKeys(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
|
||||
List<Map<String, Object>> keys = multilangService.getLangKeys(new HashMap<>(params));
|
||||
@@ -124,7 +124,7 @@ public class MultilangController {
|
||||
|
||||
@GetMapping("/keys/{keyId}/texts")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getLangTexts(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable int keyId) {
|
||||
|
||||
return ResponseEntity.ok(ApiResponse.success(
|
||||
@@ -133,17 +133,17 @@ public class MultilangController {
|
||||
|
||||
@PostMapping("/keys")
|
||||
public ResponseEntity<ApiResponse<Integer>> createLangKey(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
|
||||
if (str(body.get("companyCode")).isEmpty() || str(body.get("langKey")).isEmpty()) {
|
||||
if (str(body.get("company_code")).isEmpty() || str(body.get("lang_key")).isEmpty()) {
|
||||
return ResponseEntity.badRequest()
|
||||
.body(ApiResponse.error("회사 코드와 언어 키는 필수입니다."));
|
||||
}
|
||||
|
||||
String userId = str(body.getOrDefault("createdBy", "system"));
|
||||
body.put("createdBy", userId);
|
||||
body.put("updatedBy", userId);
|
||||
String userId = str(body.getOrDefault("created_by", "system"));
|
||||
body.put("created_by", userId);
|
||||
body.put("updated_by", userId);
|
||||
int keyId = multilangService.createLangKey(body);
|
||||
return ResponseEntity.status(201)
|
||||
.body(ApiResponse.success(keyId, "다국어 키가 성공적으로 생성되었습니다."));
|
||||
@@ -151,19 +151,19 @@ public class MultilangController {
|
||||
|
||||
@PutMapping("/keys/{keyId}")
|
||||
public ResponseEntity<ApiResponse<String>> updateLangKey(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable int keyId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
|
||||
String userId = str(body.getOrDefault("updatedBy", "system"));
|
||||
body.put("updatedBy", userId);
|
||||
String userId = str(body.getOrDefault("updated_by", "system"));
|
||||
body.put("updated_by", userId);
|
||||
multilangService.updateLangKey(keyId, body);
|
||||
return ResponseEntity.ok(ApiResponse.success("수정 완료", "다국어 키가 성공적으로 수정되었습니다."));
|
||||
}
|
||||
|
||||
@DeleteMapping("/keys/{keyId}")
|
||||
public ResponseEntity<ApiResponse<String>> deleteLangKey(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable int keyId) {
|
||||
|
||||
multilangService.deleteLangKey(keyId);
|
||||
@@ -172,7 +172,7 @@ public class MultilangController {
|
||||
|
||||
@PutMapping("/keys/{keyId}/toggle")
|
||||
public ResponseEntity<ApiResponse<String>> toggleLangKey(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable int keyId) {
|
||||
|
||||
String result = multilangService.toggleLangKey(keyId);
|
||||
@@ -185,7 +185,7 @@ public class MultilangController {
|
||||
|
||||
@PostMapping("/keys/{keyId}/texts")
|
||||
public ResponseEntity<ApiResponse<String>> saveLangTexts(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable int keyId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
|
||||
@@ -195,10 +195,10 @@ public class MultilangController {
|
||||
return ResponseEntity.badRequest().body(ApiResponse.error("텍스트 데이터는 필수입니다."));
|
||||
}
|
||||
|
||||
String userId = str(body.getOrDefault("updatedBy", "system"));
|
||||
String userId = str(body.getOrDefault("updated_by", "system"));
|
||||
for (Map<String, Object> t : texts) {
|
||||
if (t.get("createdBy") == null) t.put("createdBy", userId);
|
||||
if (t.get("updatedBy") == null) t.put("updatedBy", userId);
|
||||
if (t.get("created_by") == null) t.put("created_by", userId);
|
||||
if (t.get("updated_by") == null) t.put("updated_by", userId);
|
||||
}
|
||||
multilangService.saveLangTexts(keyId, texts);
|
||||
return ResponseEntity.ok(ApiResponse.success("저장 완료", "다국어 텍스트가 성공적으로 저장되었습니다."));
|
||||
@@ -234,7 +234,7 @@ public class MultilangController {
|
||||
|
||||
@GetMapping("/categories")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getCategories(
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
|
||||
return ResponseEntity.ok(ApiResponse.success(
|
||||
multilangService.getCategories(), "카테고리 목록 조회 성공"));
|
||||
@@ -242,7 +242,7 @@ public class MultilangController {
|
||||
|
||||
@GetMapping("/categories/{categoryId}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getCategoryById(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable int categoryId) {
|
||||
|
||||
Map<String, Object> category = multilangService.getCategoryById(categoryId);
|
||||
@@ -254,7 +254,7 @@ public class MultilangController {
|
||||
|
||||
@GetMapping("/categories/{categoryId}/path")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getCategoryPath(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable int categoryId) {
|
||||
|
||||
return ResponseEntity.ok(ApiResponse.success(
|
||||
@@ -267,12 +267,12 @@ public class MultilangController {
|
||||
|
||||
@PostMapping("/keys/generate")
|
||||
public ResponseEntity<ApiResponse<Integer>> generateKey(
|
||||
@RequestAttribute("companyCode") String requestCompanyCode,
|
||||
@RequestAttribute("company_code") String requestCompanyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
|
||||
String targetCompanyCode = str(body.get("companyCode"));
|
||||
if (targetCompanyCode.isEmpty() || str(body.get("categoryId")).isEmpty()
|
||||
|| str(body.get("keyMeaning")).isEmpty()) {
|
||||
String targetCompanyCode = str(body.get("company_code"));
|
||||
if (targetCompanyCode.isEmpty() || str(body.get("category_id")).isEmpty()
|
||||
|| str(body.get("key_meaning")).isEmpty()) {
|
||||
return ResponseEntity.badRequest()
|
||||
.body(ApiResponse.error("회사 코드, 카테고리 ID, 키 의미는 필수입니다."));
|
||||
}
|
||||
@@ -286,7 +286,7 @@ public class MultilangController {
|
||||
.body(ApiResponse.error("다른 회사의 키를 생성할 권한이 없습니다."));
|
||||
}
|
||||
|
||||
body.put("createdBy", body.getOrDefault("createdBy", "system"));
|
||||
body.put("created_by", body.getOrDefault("created_by", "system"));
|
||||
int keyId = multilangService.generateKey(body);
|
||||
return ResponseEntity.status(201)
|
||||
.body(ApiResponse.success(keyId, "키가 성공적으로 생성되었습니다."));
|
||||
@@ -294,12 +294,12 @@ public class MultilangController {
|
||||
|
||||
@PostMapping("/keys/preview")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> previewKey(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
|
||||
Object categoryIdObj = body.get("categoryId");
|
||||
String keyMeaning = str(body.get("keyMeaning"));
|
||||
String targetCompanyCode = str(body.get("companyCode"));
|
||||
Object categoryIdObj = body.get("category_id");
|
||||
String keyMeaning = str(body.get("key_meaning"));
|
||||
String targetCompanyCode = str(body.get("company_code"));
|
||||
|
||||
if (categoryIdObj == null || keyMeaning.isEmpty() || targetCompanyCode.isEmpty()) {
|
||||
return ResponseEntity.badRequest()
|
||||
@@ -313,11 +313,11 @@ public class MultilangController {
|
||||
|
||||
@PostMapping("/keys/override")
|
||||
public ResponseEntity<ApiResponse<Integer>> createOverrideKey(
|
||||
@RequestAttribute("companyCode") String requestCompanyCode,
|
||||
@RequestAttribute("company_code") String requestCompanyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
|
||||
String targetCompanyCode = str(body.get("companyCode"));
|
||||
if (targetCompanyCode.isEmpty() || body.get("baseKeyId") == null) {
|
||||
String targetCompanyCode = str(body.get("company_code"));
|
||||
if (targetCompanyCode.isEmpty() || body.get("base_key_id") == null) {
|
||||
return ResponseEntity.badRequest()
|
||||
.body(ApiResponse.error("회사 코드와 원본 키 ID는 필수입니다."));
|
||||
}
|
||||
@@ -330,7 +330,7 @@ public class MultilangController {
|
||||
.body(ApiResponse.error("다른 회사의 오버라이드 키를 생성할 권한이 없습니다."));
|
||||
}
|
||||
|
||||
body.put("createdBy", body.getOrDefault("createdBy", "system"));
|
||||
body.put("created_by", body.getOrDefault("created_by", "system"));
|
||||
int keyId = multilangService.createOverrideKey(body);
|
||||
return ResponseEntity.status(201)
|
||||
.body(ApiResponse.success(keyId, "오버라이드 키가 성공적으로 생성되었습니다."));
|
||||
@@ -338,7 +338,7 @@ public class MultilangController {
|
||||
|
||||
@GetMapping("/keys/overrides/{companyCode}")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getOverrideKeys(
|
||||
@RequestAttribute("companyCode") String requestCompanyCode,
|
||||
@RequestAttribute("company_code") String requestCompanyCode,
|
||||
@PathVariable String companyCode) {
|
||||
|
||||
if (!"*".equals(requestCompanyCode) && !companyCode.equals(requestCompanyCode)) {
|
||||
@@ -355,10 +355,10 @@ public class MultilangController {
|
||||
|
||||
@PostMapping("/screen-labels")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> generateScreenLabelKeys(
|
||||
@RequestAttribute("companyCode") String requestCompanyCode,
|
||||
@RequestAttribute("company_code") String requestCompanyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
|
||||
Object screenIdObj = body.get("screenId");
|
||||
Object screenIdObj = body.get("screen_id");
|
||||
@SuppressWarnings("unchecked")
|
||||
List<Map<String, Object>> labels = (List<Map<String, Object>>) body.get("labels");
|
||||
|
||||
@@ -370,14 +370,14 @@ public class MultilangController {
|
||||
}
|
||||
|
||||
// companyCode, companyName이 body에 없으면 requestCompanyCode 사용
|
||||
if (!body.containsKey("companyCode") || str(body.get("companyCode")).isEmpty()) {
|
||||
body.put("companyCode", requestCompanyCode);
|
||||
if (!body.containsKey("company_code") || str(body.get("company_code")).isEmpty()) {
|
||||
body.put("company_code", requestCompanyCode);
|
||||
}
|
||||
if (!body.containsKey("companyName") || str(body.get("companyName")).isEmpty()) {
|
||||
body.put("companyName", requestCompanyCode);
|
||||
if (!body.containsKey("company_name") || str(body.get("company_name")).isEmpty()) {
|
||||
body.put("company_name", requestCompanyCode);
|
||||
}
|
||||
|
||||
body.put("screenId", toInt(screenIdObj));
|
||||
body.put("screen_id", toInt(screenIdObj));
|
||||
List<Map<String, Object>> results = multilangService.generateScreenLabelKeys(body);
|
||||
return ResponseEntity.ok(ApiResponse.success(
|
||||
results, results.size() + "개의 다국어 키가 생성되었습니다."));
|
||||
|
||||
+3
-3
@@ -34,7 +34,7 @@ public class NodeExternalConnectionController {
|
||||
|
||||
@GetMapping("/tested")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getTestedConnections(
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
try {
|
||||
log.info("노드 플로우용 테스트 완료된 커넥션 조회 요청 - companyCode: {}", companyCode);
|
||||
List<Map<String, Object>> valid = service.getTestedConnections(companyCode);
|
||||
@@ -54,7 +54,7 @@ public class NodeExternalConnectionController {
|
||||
|
||||
@GetMapping("/{id}/tables")
|
||||
public ResponseEntity<?> getTables(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable int id) {
|
||||
try {
|
||||
log.info("외부 DB 테이블 목록 조회: connectionId={}", id);
|
||||
@@ -79,7 +79,7 @@ public class NodeExternalConnectionController {
|
||||
|
||||
@GetMapping("/{id}/tables/{tableName}/columns")
|
||||
public ResponseEntity<?> getTableColumns(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable int id,
|
||||
@PathVariable String tableName) {
|
||||
try {
|
||||
|
||||
@@ -30,7 +30,7 @@ public class NodeFlowController {
|
||||
/** GET / */
|
||||
@GetMapping
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getFlowList(
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
try {
|
||||
return ResponseEntity.ok(ApiResponse.success(service.getFlowList(companyCode)));
|
||||
} catch (Exception e) {
|
||||
@@ -47,7 +47,7 @@ public class NodeFlowController {
|
||||
@GetMapping("/{flowId}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getFlowById(
|
||||
@PathVariable int flowId,
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
try {
|
||||
Map<String, Object> flow = service.getFlowById(flowId, companyCode);
|
||||
if (flow == null) {
|
||||
@@ -67,14 +67,14 @@ public class NodeFlowController {
|
||||
/** POST / */
|
||||
@PostMapping
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> createFlow(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("userName") String userName,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@RequestAttribute("user_name") String userName,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
try {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("userId", userId);
|
||||
body.put("userName", userName);
|
||||
body.put("company_code", companyCode);
|
||||
body.put("user_id", userId);
|
||||
body.put("user_name", userName);
|
||||
return ResponseEntity.ok(ApiResponse.success(service.createFlow(body)));
|
||||
} catch (IllegalArgumentException e) {
|
||||
return ResponseEntity.status(400).body(ApiResponse.error(e.getMessage()));
|
||||
@@ -91,14 +91,14 @@ public class NodeFlowController {
|
||||
/** PUT / (flowId는 body에 포함) */
|
||||
@PutMapping
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> updateFlow(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("userName") String userName,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@RequestAttribute("user_name") String userName,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
try {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("userId", userId);
|
||||
body.put("userName", userName);
|
||||
body.put("company_code", companyCode);
|
||||
body.put("user_id", userId);
|
||||
body.put("user_name", userName);
|
||||
return ResponseEntity.ok(ApiResponse.success(service.updateFlow(body)));
|
||||
} catch (IllegalArgumentException e) {
|
||||
return ResponseEntity.status(400).body(ApiResponse.error(e.getMessage()));
|
||||
@@ -116,9 +116,9 @@ public class NodeFlowController {
|
||||
@DeleteMapping("/{flowId}")
|
||||
public ResponseEntity<ApiResponse<Void>> deleteFlow(
|
||||
@PathVariable int flowId,
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("userName") String userName) {
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@RequestAttribute("user_name") String userName) {
|
||||
try {
|
||||
service.deleteFlow(flowId, companyCode, userId, userName);
|
||||
return ResponseEntity.ok(ApiResponse.success(null, "플로우가 삭제되었습니다."));
|
||||
@@ -158,15 +158,15 @@ public class NodeFlowController {
|
||||
@PostMapping("/{flowId}/execute")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> executeFlow(
|
||||
@PathVariable int flowId,
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("userName") String userName,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@RequestAttribute("user_name") String userName,
|
||||
@RequestBody(required = false) Map<String, Object> body) {
|
||||
try {
|
||||
Map<String, Object> contextData = body != null ? body : new java.util.LinkedHashMap<>();
|
||||
contextData.put("companyCode", companyCode);
|
||||
contextData.put("userId", userId);
|
||||
contextData.put("userName", userName);
|
||||
contextData.put("company_code", companyCode);
|
||||
contextData.put("user_id", userId);
|
||||
contextData.put("user_name", userName);
|
||||
|
||||
Map<String, Object> result = service.executeFlow(flowId, contextData);
|
||||
return ResponseEntity.ok(ApiResponse.success(result));
|
||||
|
||||
@@ -25,7 +25,7 @@ public class NumberingRuleController {
|
||||
/** GET / → 회사별 채번 규칙 전체 목록 */
|
||||
@GetMapping
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getRuleList(
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
List<Map<String, Object>> list = numberingRuleService.getRuleList(companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(list, "채번 규칙 목록을 조회했습니다."));
|
||||
}
|
||||
@@ -33,7 +33,7 @@ public class NumberingRuleController {
|
||||
/** GET /available → 메뉴 기반 사용 가능 규칙 (menuObjid 없음) */
|
||||
@GetMapping("/available")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getAvailableRulesForMenu(
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
List<Map<String, Object>> list = numberingRuleService.getAvailableRulesForMenu(companyCode, null);
|
||||
return ResponseEntity.ok(ApiResponse.success(list, "사용 가능한 채번 규칙을 조회했습니다."));
|
||||
}
|
||||
@@ -41,7 +41,7 @@ public class NumberingRuleController {
|
||||
/** GET /available/{menuObjid} → 메뉴 기반 사용 가능 규칙 */
|
||||
@GetMapping("/available/{menuObjid}")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getAvailableRulesForMenuWithId(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Integer menuObjid) {
|
||||
List<Map<String, Object>> list = numberingRuleService.getAvailableRulesForMenu(companyCode, menuObjid);
|
||||
return ResponseEntity.ok(ApiResponse.success(list, "사용 가능한 채번 규칙을 조회했습니다."));
|
||||
@@ -50,7 +50,7 @@ public class NumberingRuleController {
|
||||
/** GET /available-for-screen?tableName= → 화면 기반 사용 가능 규칙 */
|
||||
@GetMapping("/available-for-screen")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getAvailableRulesForScreen(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam(required = false) String tableName) {
|
||||
List<Map<String, Object>> list = numberingRuleService.getAvailableRulesForScreen(companyCode, tableName);
|
||||
return ResponseEntity.ok(ApiResponse.success(list, "화면별 채번 규칙을 조회했습니다."));
|
||||
@@ -59,7 +59,7 @@ public class NumberingRuleController {
|
||||
/** GET /by-column/{tableName}/{columnName} → 테이블+컬럼 기반 규칙 조회 */
|
||||
@GetMapping("/by-column/{tableName}/{columnName}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getNumberingRuleByColumn(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String tableName,
|
||||
@PathVariable String columnName) {
|
||||
Map<String, Object> rule = numberingRuleService.getNumberingRuleByColumn(
|
||||
@@ -77,7 +77,7 @@ public class NumberingRuleController {
|
||||
/** GET /test/list → 테스트용 규칙 목록 */
|
||||
@GetMapping("/test/list")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getRulesFromTest(
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
List<Map<String, Object>> list = numberingRuleService.getRulesFromTest(companyCode, null);
|
||||
return ResponseEntity.ok(ApiResponse.success(list, "테스트 채번 규칙 목록을 조회했습니다."));
|
||||
}
|
||||
@@ -85,7 +85,7 @@ public class NumberingRuleController {
|
||||
/** GET /test/list/{menuObjid} → 테스트용 규칙 목록 (메뉴 필터) */
|
||||
@GetMapping("/test/list/{menuObjid}")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getRulesFromTestWithMenu(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Integer menuObjid) {
|
||||
List<Map<String, Object>> list = numberingRuleService.getRulesFromTest(companyCode, menuObjid);
|
||||
return ResponseEntity.ok(ApiResponse.success(list, "테스트 채번 규칙 목록을 조회했습니다."));
|
||||
@@ -94,7 +94,7 @@ public class NumberingRuleController {
|
||||
/** GET /test/by-column/{tableName}/{columnName} → 테스트 테이블+컬럼 기반 조회 */
|
||||
@GetMapping("/test/by-column/{tableName}/{columnName}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getTestRuleByColumn(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String tableName,
|
||||
@PathVariable String columnName) {
|
||||
Map<String, Object> rule = numberingRuleService.getNumberingRuleByColumn(
|
||||
@@ -108,9 +108,9 @@ public class NumberingRuleController {
|
||||
/** POST /test/save → UPSERT */
|
||||
@PostMapping("/test/save")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> saveRuleToTest(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
if (body.get("ruleId") == null || body.get("ruleName") == null) {
|
||||
if (body.get("rule_id") == null || body.get("rule_name") == null) {
|
||||
return ResponseEntity.badRequest().body(ApiResponse.error("ruleId와 ruleName이 필요합니다."));
|
||||
}
|
||||
Map<String, Object> result = numberingRuleService.saveRuleToTest(body, companyCode);
|
||||
@@ -120,7 +120,7 @@ public class NumberingRuleController {
|
||||
/** DELETE /test/{ruleId} → 테스트 규칙 삭제 */
|
||||
@DeleteMapping("/test/{ruleId}")
|
||||
public ResponseEntity<ApiResponse<Void>> deleteRuleFromTest(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String ruleId) {
|
||||
numberingRuleService.deleteRuleFromTest(ruleId, companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(null, "테스트 채번 규칙이 삭제되었습니다."));
|
||||
@@ -129,12 +129,12 @@ public class NumberingRuleController {
|
||||
/** POST /test/{ruleId}/preview → 테스트 미리보기 */
|
||||
@PostMapping("/test/{ruleId}/preview")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> previewCodeFromTest(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String ruleId,
|
||||
@RequestBody(required = false) Map<String, Object> body) {
|
||||
@SuppressWarnings("unchecked")
|
||||
Map<String, Object> formData = body != null ? (Map<String, Object>) body.get("formData") : null;
|
||||
String manualInputValue = body != null ? (String) body.get("manualInputValue") : null;
|
||||
Map<String, Object> formData = body != null ? (Map<String, Object>) body.get("form_data") : null;
|
||||
String manualInputValue = body != null ? (String) body.get("manual_input_value") : null;
|
||||
String code = numberingRuleService.previewCode(ruleId, companyCode, formData, manualInputValue);
|
||||
return ResponseEntity.ok(ApiResponse.success(Map.of("code", code), "미리보기 생성이 완료되었습니다."));
|
||||
}
|
||||
@@ -146,7 +146,7 @@ public class NumberingRuleController {
|
||||
/** GET /{ruleId} → 단건 조회 */
|
||||
@GetMapping("/{ruleId}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getRuleById(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String ruleId) {
|
||||
Map<String, Object> rule = numberingRuleService.getRuleById(ruleId, companyCode);
|
||||
if (rule == null) {
|
||||
@@ -158,13 +158,13 @@ public class NumberingRuleController {
|
||||
/** POST / → 규칙 생성 */
|
||||
@PostMapping
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> createRule(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute(value = "userId", required = false) String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute(value = "user_id", required = false) String userId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
if (body.get("ruleId") == null || body.get("ruleName") == null || body.get("parts") == null) {
|
||||
if (body.get("rule_id") == null || body.get("rule_name") == null || body.get("parts") == null) {
|
||||
return ResponseEntity.badRequest().body(ApiResponse.error("ruleId, ruleName, parts가 필요합니다."));
|
||||
}
|
||||
if (userId != null) body.put("userId", userId);
|
||||
if (userId != null) body.put("user_id", userId);
|
||||
Map<String, Object> result = numberingRuleService.createRule(body, companyCode);
|
||||
return ResponseEntity.status(201).body(ApiResponse.success(result, "채번 규칙이 생성되었습니다."));
|
||||
}
|
||||
@@ -172,7 +172,7 @@ public class NumberingRuleController {
|
||||
/** PUT /{ruleId} → 규칙 수정 */
|
||||
@PutMapping("/{ruleId}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> updateRule(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String ruleId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
Map<String, Object> result = numberingRuleService.updateRule(ruleId, body, companyCode);
|
||||
@@ -182,7 +182,7 @@ public class NumberingRuleController {
|
||||
/** DELETE /{ruleId} → 규칙 삭제 */
|
||||
@DeleteMapping("/{ruleId}")
|
||||
public ResponseEntity<ApiResponse<Void>> deleteRule(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String ruleId) {
|
||||
numberingRuleService.deleteRule(ruleId, companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(null, "채번 규칙이 삭제되었습니다."));
|
||||
@@ -195,12 +195,12 @@ public class NumberingRuleController {
|
||||
/** POST /{ruleId}/preview → 미리보기 (순번 증가 없음) */
|
||||
@PostMapping("/{ruleId}/preview")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> previewCode(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String ruleId,
|
||||
@RequestBody(required = false) Map<String, Object> body) {
|
||||
@SuppressWarnings("unchecked")
|
||||
Map<String, Object> formData = body != null ? (Map<String, Object>) body.get("formData") : null;
|
||||
String manualInputValue = body != null ? (String) body.get("manualInputValue") : null;
|
||||
Map<String, Object> formData = body != null ? (Map<String, Object>) body.get("form_data") : null;
|
||||
String manualInputValue = body != null ? (String) body.get("manual_input_value") : null;
|
||||
String code = numberingRuleService.previewCode(ruleId, companyCode, formData, manualInputValue);
|
||||
return ResponseEntity.ok(ApiResponse.success(Map.of("code", code), "미리보기 생성이 완료되었습니다."));
|
||||
}
|
||||
@@ -208,12 +208,12 @@ public class NumberingRuleController {
|
||||
/** POST /{ruleId}/allocate → 코드 할당 (순번 증가) */
|
||||
@PostMapping("/{ruleId}/allocate")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> allocateCode(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String ruleId,
|
||||
@RequestBody(required = false) Map<String, Object> body) {
|
||||
@SuppressWarnings("unchecked")
|
||||
Map<String, Object> formData = body != null ? (Map<String, Object>) body.get("formData") : null;
|
||||
String userInputCode = body != null ? (String) body.get("userInputCode") : null;
|
||||
Map<String, Object> formData = body != null ? (Map<String, Object>) body.get("form_data") : null;
|
||||
String userInputCode = body != null ? (String) body.get("user_input_code") : null;
|
||||
String code = numberingRuleService.allocateCode(ruleId, companyCode, formData, userInputCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(Map.of("code", code), "코드 할당이 완료되었습니다."));
|
||||
}
|
||||
@@ -221,7 +221,7 @@ public class NumberingRuleController {
|
||||
/** POST /{ruleId}/generate (deprecated) → allocateCode 위임 */
|
||||
@PostMapping("/{ruleId}/generate")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> generateCode(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String ruleId) {
|
||||
String code = numberingRuleService.generateCode(ruleId, companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(Map.of("code", code), "코드 생성이 완료되었습니다."));
|
||||
@@ -230,7 +230,7 @@ public class NumberingRuleController {
|
||||
/** POST /{ruleId}/reset → 순번 초기화 */
|
||||
@PostMapping("/{ruleId}/reset")
|
||||
public ResponseEntity<ApiResponse<Void>> resetSequence(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String ruleId) {
|
||||
numberingRuleService.resetSequence(ruleId, companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(null, "시퀀스가 초기화되었습니다."));
|
||||
@@ -243,10 +243,10 @@ public class NumberingRuleController {
|
||||
/** POST /copy-for-company → 회사간 규칙 복제 (SUPER_ADMIN) */
|
||||
@PostMapping("/copy-for-company")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> copyRulesForCompany(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
String sourceCompanyCode = (String) body.get("sourceCompanyCode");
|
||||
String targetCompanyCode = (String) body.get("targetCompanyCode");
|
||||
String sourceCompanyCode = (String) body.get("source_company_code");
|
||||
String targetCompanyCode = (String) body.get("target_company_code");
|
||||
if (sourceCompanyCode == null || targetCompanyCode == null) {
|
||||
return ResponseEntity.badRequest()
|
||||
.body(ApiResponse.error("sourceCompanyCode와 targetCompanyCode가 필요합니다."));
|
||||
|
||||
@@ -16,46 +16,46 @@ public class OpenApiProxyController {
|
||||
|
||||
@GetMapping("/list")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getOpenApiProxyList(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(openApiProxyService.getOpenApiProxyList(params)));
|
||||
}
|
||||
|
||||
@GetMapping("/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getOpenApiProxyInfo(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long id) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("id", id);
|
||||
return ResponseEntity.ok(ApiResponse.success(openApiProxyService.getOpenApiProxyInfo(params)));
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
public ResponseEntity<ApiResponse<Integer>> insertOpenApiProxy(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(openApiProxyService.insertOpenApiProxy(body)));
|
||||
}
|
||||
|
||||
@PutMapping("/{id}")
|
||||
public ResponseEntity<ApiResponse<Integer>> updateOpenApiProxy(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long id,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
body.put("id", id);
|
||||
return ResponseEntity.ok(ApiResponse.success(openApiProxyService.updateOpenApiProxy(body)));
|
||||
}
|
||||
|
||||
@DeleteMapping("/{id}")
|
||||
public ResponseEntity<ApiResponse<Integer>> deleteOpenApiProxy(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long id) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("id", id);
|
||||
return ResponseEntity.ok(ApiResponse.success(openApiProxyService.deleteOpenApiProxy(params)));
|
||||
}
|
||||
|
||||
@@ -23,36 +23,36 @@ public class PackagingController {
|
||||
|
||||
@GetMapping("/pkg-units")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getPkgUnits(
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(packagingService.getPkgUnits(params)));
|
||||
}
|
||||
|
||||
@PostMapping("/pkg-units")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> createPkgUnit(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
return ResponseEntity.status(201).body(ApiResponse.success(packagingService.createPkgUnit(body)));
|
||||
}
|
||||
|
||||
@PutMapping("/pkg-units/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> updatePkgUnit(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long id,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
body.put("id", id);
|
||||
return ResponseEntity.ok(ApiResponse.success(packagingService.updatePkgUnit(body)));
|
||||
}
|
||||
|
||||
@DeleteMapping("/pkg-units/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> deletePkgUnit(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long id) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("id", id);
|
||||
return ResponseEntity.ok(ApiResponse.success(packagingService.deletePkgUnit(params)));
|
||||
}
|
||||
@@ -61,28 +61,28 @@ public class PackagingController {
|
||||
|
||||
@GetMapping("/pkg-unit-items/{pkgCode}")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getPkgUnitItems(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String pkgCode) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("pkgCode", pkgCode);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("pkg_code", pkgCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(packagingService.getPkgUnitItems(params)));
|
||||
}
|
||||
|
||||
@PostMapping("/pkg-unit-items")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> createPkgUnitItem(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
return ResponseEntity.status(201).body(ApiResponse.success(packagingService.createPkgUnitItem(body)));
|
||||
}
|
||||
|
||||
@DeleteMapping("/pkg-unit-items/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> deletePkgUnitItem(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long id) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("id", id);
|
||||
return ResponseEntity.ok(ApiResponse.success(packagingService.deletePkgUnitItem(params)));
|
||||
}
|
||||
@@ -91,36 +91,36 @@ public class PackagingController {
|
||||
|
||||
@GetMapping("/loading-units")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getLoadingUnits(
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(packagingService.getLoadingUnits(params)));
|
||||
}
|
||||
|
||||
@PostMapping("/loading-units")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> createLoadingUnit(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
return ResponseEntity.status(201).body(ApiResponse.success(packagingService.createLoadingUnit(body)));
|
||||
}
|
||||
|
||||
@PutMapping("/loading-units/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> updateLoadingUnit(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long id,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
body.put("id", id);
|
||||
return ResponseEntity.ok(ApiResponse.success(packagingService.updateLoadingUnit(body)));
|
||||
}
|
||||
|
||||
@DeleteMapping("/loading-units/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> deleteLoadingUnit(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long id) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("id", id);
|
||||
return ResponseEntity.ok(ApiResponse.success(packagingService.deleteLoadingUnit(params)));
|
||||
}
|
||||
@@ -129,28 +129,28 @@ public class PackagingController {
|
||||
|
||||
@GetMapping("/loading-unit-pkgs/{loadingCode}")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getLoadingUnitPkgs(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String loadingCode) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("loadingCode", loadingCode);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("loading_code", loadingCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(packagingService.getLoadingUnitPkgs(params)));
|
||||
}
|
||||
|
||||
@PostMapping("/loading-unit-pkgs")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> createLoadingUnitPkg(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
return ResponseEntity.status(201).body(ApiResponse.success(packagingService.createLoadingUnitPkg(body)));
|
||||
}
|
||||
|
||||
@DeleteMapping("/loading-unit-pkgs/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> deleteLoadingUnitPkg(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long id) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("id", id);
|
||||
return ResponseEntity.ok(ApiResponse.success(packagingService.deleteLoadingUnitPkg(params)));
|
||||
}
|
||||
|
||||
@@ -23,13 +23,13 @@ public class PopActionController {
|
||||
*/
|
||||
@PostMapping("/execute-action")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> executeAction(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute(value = "userId", required = false) String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute(value = "user_id", required = false) String userId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
try {
|
||||
Map<String, Object> result = popActionService.executeAction(body, companyCode, userId);
|
||||
String message = result.containsKey("message") ? result.get("message").toString()
|
||||
: result.get("processedCount") + "건 처리 완료";
|
||||
: result.get("processed_count") + "건 처리 완료";
|
||||
return ResponseEntity.ok(ApiResponse.success(result, message));
|
||||
} catch (PopActionService.PreConditionFailException e) {
|
||||
return ResponseEntity.status(409).body(ApiResponse.error(e.getMessage()));
|
||||
|
||||
@@ -19,19 +19,19 @@ public class PopProductionController {
|
||||
|
||||
@PostMapping("/create-work-processes")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> createWorkProcesses(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("userId", userId);
|
||||
body.put("company_code", companyCode);
|
||||
body.put("user_id", userId);
|
||||
return ResponseEntity.ok(ApiResponse.success(popProductionService.createWorkProcesses(body)));
|
||||
}
|
||||
|
||||
@PostMapping("/timer")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> controlTimer(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(popProductionService.controlTimer(body)));
|
||||
}
|
||||
}
|
||||
|
||||
+40
-40
@@ -16,160 +16,160 @@ public class ProcessWorkStandardController {
|
||||
|
||||
@GetMapping("/items")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getProcessWorkStandardItemList(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(processWorkStandardService.getProcessWorkStandardItemList(params)));
|
||||
}
|
||||
|
||||
@GetMapping("/items/{itemCode}/routings")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getProcessWorkStandardRoutingList(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String itemCode) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("itemCode", itemCode);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("item_code", itemCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(processWorkStandardService.getProcessWorkStandardRoutingList(params)));
|
||||
}
|
||||
|
||||
@PutMapping("/versions/{versionId}/set-default")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> setProcessWorkStandardDefaultVersion(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long versionId) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("versionId", versionId);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("version_id", versionId);
|
||||
return ResponseEntity.ok(ApiResponse.success(processWorkStandardService.setProcessWorkStandardDefaultVersion(params)));
|
||||
}
|
||||
|
||||
@PutMapping("/versions/{versionId}/unset-default")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> unsetProcessWorkStandardDefaultVersion(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long versionId) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("versionId", versionId);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("version_id", versionId);
|
||||
return ResponseEntity.ok(ApiResponse.success(processWorkStandardService.unsetProcessWorkStandardDefaultVersion(params)));
|
||||
}
|
||||
|
||||
@GetMapping("/routing-detail/{routingDetailId}/work-items")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getProcessWorkStandardWorkItemList(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long routingDetailId) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("routingDetailId", routingDetailId);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("routing_detail_id", routingDetailId);
|
||||
return ResponseEntity.ok(ApiResponse.success(processWorkStandardService.getProcessWorkStandardWorkItemList(params)));
|
||||
}
|
||||
|
||||
@PostMapping("/work-items")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> insertProcessWorkStandardWorkItem(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(processWorkStandardService.insertProcessWorkStandardWorkItem(body)));
|
||||
}
|
||||
|
||||
@PutMapping("/work-items/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> updateProcessWorkStandardWorkItem(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long id,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
body.put("id", id);
|
||||
return ResponseEntity.ok(ApiResponse.success(processWorkStandardService.updateProcessWorkStandardWorkItem(body)));
|
||||
}
|
||||
|
||||
@DeleteMapping("/work-items/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> deleteProcessWorkStandardWorkItem(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long id) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("id", id);
|
||||
return ResponseEntity.ok(ApiResponse.success(processWorkStandardService.deleteProcessWorkStandardWorkItem(params)));
|
||||
}
|
||||
|
||||
@GetMapping("/work-items/{workItemId}/details")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getProcessWorkStandardWorkItemDetailList(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long workItemId) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("workItemId", workItemId);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("work_item_id", workItemId);
|
||||
return ResponseEntity.ok(ApiResponse.success(processWorkStandardService.getProcessWorkStandardWorkItemDetailList(params)));
|
||||
}
|
||||
|
||||
@PostMapping("/work-item-details")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> insertProcessWorkStandardWorkItemDetail(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(processWorkStandardService.insertProcessWorkStandardWorkItemDetail(body)));
|
||||
}
|
||||
|
||||
@PutMapping("/work-item-details/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> updateProcessWorkStandardWorkItemDetail(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long id,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
body.put("id", id);
|
||||
return ResponseEntity.ok(ApiResponse.success(processWorkStandardService.updateProcessWorkStandardWorkItemDetail(body)));
|
||||
}
|
||||
|
||||
@DeleteMapping("/work-item-details/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> deleteProcessWorkStandardWorkItemDetail(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long id) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("id", id);
|
||||
return ResponseEntity.ok(ApiResponse.success(processWorkStandardService.deleteProcessWorkStandardWorkItemDetail(params)));
|
||||
}
|
||||
|
||||
@PutMapping("/save-all")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> saveAllProcessWorkStandard(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(processWorkStandardService.saveAllProcessWorkStandard(body)));
|
||||
}
|
||||
|
||||
@GetMapping("/registered-items/{screenCode}")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getProcessWorkStandardRegisteredItemList(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String screenCode) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("screenCode", screenCode);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("screen_code", screenCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(processWorkStandardService.getProcessWorkStandardRegisteredItemList(params)));
|
||||
}
|
||||
|
||||
@PostMapping("/registered-items")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> insertProcessWorkStandardRegisteredItem(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(processWorkStandardService.insertProcessWorkStandardRegisteredItem(body)));
|
||||
}
|
||||
|
||||
@PostMapping("/registered-items/batch")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> insertProcessWorkStandardRegisteredItemBatch(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody List<Map<String, Object>> body) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("items", body);
|
||||
return ResponseEntity.ok(ApiResponse.success(processWorkStandardService.insertProcessWorkStandardRegisteredItemBatch(params)));
|
||||
}
|
||||
|
||||
@DeleteMapping("/registered-items/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> deleteProcessWorkStandardRegisteredItem(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long id) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("id", id);
|
||||
return ResponseEntity.ok(ApiResponse.success(processWorkStandardService.deleteProcessWorkStandardRegisteredItem(params)));
|
||||
}
|
||||
|
||||
@@ -21,29 +21,29 @@ public class ProductionController {
|
||||
|
||||
@GetMapping("/order-summary")
|
||||
public ResponseEntity<ApiResponse<Object>> getOrderSummary(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(productionService.getOrderSummary(params)));
|
||||
}
|
||||
|
||||
@GetMapping("/stock-shortage")
|
||||
public ResponseEntity<ApiResponse<Object>> getStockShortage(
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
return ResponseEntity.ok(ApiResponse.success(productionService.getStockShortage(companyCode)));
|
||||
}
|
||||
|
||||
@GetMapping("/plan/{id}")
|
||||
public ResponseEntity<ApiResponse<Object>> getPlanById(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long id) {
|
||||
return ResponseEntity.ok(ApiResponse.success(productionService.getPlanById(companyCode, id)));
|
||||
}
|
||||
|
||||
@PutMapping("/plan/{id}")
|
||||
public ResponseEntity<ApiResponse<Object>> updatePlan(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@PathVariable Long id,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
return ResponseEntity.ok(ApiResponse.success(productionService.updatePlan(companyCode, id, body, userId)));
|
||||
@@ -51,7 +51,7 @@ public class ProductionController {
|
||||
|
||||
@DeleteMapping("/plan/{id}")
|
||||
public ResponseEntity<ApiResponse<Object>> deletePlan(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long id) {
|
||||
return ResponseEntity.ok(ApiResponse.success(productionService.deletePlan(companyCode, id)));
|
||||
}
|
||||
@@ -59,7 +59,7 @@ public class ProductionController {
|
||||
@PostMapping("/generate-schedule/preview")
|
||||
@SuppressWarnings("unchecked")
|
||||
public ResponseEntity<ApiResponse<Object>> previewSchedule(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
List<Map<String, Object>> items = (List<Map<String, Object>>) body.get("items");
|
||||
return ResponseEntity.ok(ApiResponse.success(productionService.previewSchedule(companyCode, items, body)));
|
||||
@@ -68,8 +68,8 @@ public class ProductionController {
|
||||
@PostMapping("/generate-schedule")
|
||||
@SuppressWarnings("unchecked")
|
||||
public ResponseEntity<ApiResponse<Object>> generateSchedule(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
List<Map<String, Object>> items = (List<Map<String, Object>>) body.get("items");
|
||||
return ResponseEntity.ok(ApiResponse.success(productionService.generateSchedule(companyCode, items, body, userId)));
|
||||
@@ -78,21 +78,21 @@ public class ProductionController {
|
||||
@PostMapping("/merge-schedules")
|
||||
@SuppressWarnings("unchecked")
|
||||
public ResponseEntity<ApiResponse<Object>> mergeSchedules(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
List<Number> rawIds = (List<Number>) body.get("scheduleIds");
|
||||
List<Number> rawIds = (List<Number>) body.get("schedule_ids");
|
||||
List<Long> scheduleIds = rawIds.stream().map(Number::longValue).collect(Collectors.toList());
|
||||
String productType = body.get("productType") != null ? String.valueOf(body.get("productType")) : "완제품";
|
||||
String productType = body.get("product_type") != null ? String.valueOf(body.get("product_type")) : "완제품";
|
||||
return ResponseEntity.ok(ApiResponse.success(productionService.mergeSchedules(companyCode, scheduleIds, productType, userId)));
|
||||
}
|
||||
|
||||
@PostMapping("/generate-semi-schedule/preview")
|
||||
@SuppressWarnings("unchecked")
|
||||
public ResponseEntity<ApiResponse<Object>> previewSemiSchedule(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
List<Number> rawIds = (List<Number>) body.get("planIds");
|
||||
List<Number> rawIds = (List<Number>) body.get("plan_ids");
|
||||
List<Long> planIds = rawIds.stream().map(Number::longValue).collect(Collectors.toList());
|
||||
return ResponseEntity.ok(ApiResponse.success(productionService.previewSemiSchedule(companyCode, planIds, body)));
|
||||
}
|
||||
@@ -100,21 +100,21 @@ public class ProductionController {
|
||||
@PostMapping("/generate-semi-schedule")
|
||||
@SuppressWarnings("unchecked")
|
||||
public ResponseEntity<ApiResponse<Object>> generateSemiSchedule(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
List<Number> rawIds = (List<Number>) body.get("planIds");
|
||||
List<Number> rawIds = (List<Number>) body.get("plan_ids");
|
||||
List<Long> planIds = rawIds.stream().map(Number::longValue).collect(Collectors.toList());
|
||||
return ResponseEntity.ok(ApiResponse.success(productionService.generateSemiSchedule(companyCode, planIds, body, userId)));
|
||||
}
|
||||
|
||||
@PostMapping("/plan/{id}/split")
|
||||
public ResponseEntity<ApiResponse<Object>> splitSchedule(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@PathVariable Long id,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
double splitQty = toDouble(body.get("splitQty"));
|
||||
double splitQty = toDouble(body.get("split_qty"));
|
||||
return ResponseEntity.ok(ApiResponse.success(productionService.splitSchedule(companyCode, id, splitQty, userId)));
|
||||
}
|
||||
|
||||
|
||||
@@ -20,9 +20,9 @@ public class ReportController {
|
||||
|
||||
@GetMapping("/external-connections")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getExternalConnections(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(reportService.getExternalConnections(params)));
|
||||
}
|
||||
|
||||
@@ -35,18 +35,18 @@ public class ReportController {
|
||||
|
||||
@PostMapping("/templates")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> createTemplate(
|
||||
@RequestAttribute(value = "userId", required = false) String userId,
|
||||
@RequestAttribute(value = "user_id", required = false) String userId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("createdBy", userId);
|
||||
body.put("created_by", userId);
|
||||
Map<String, Object> result = reportService.createTemplate(body);
|
||||
return ResponseEntity.status(201).body(ApiResponse.success(result));
|
||||
}
|
||||
|
||||
@PostMapping("/templates/create-from-layout")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> createTemplateFromLayout(
|
||||
@RequestAttribute(value = "userId", required = false) String userId,
|
||||
@RequestAttribute(value = "user_id", required = false) String userId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("createdBy", userId);
|
||||
body.put("created_by", userId);
|
||||
Map<String, Object> result = reportService.createTemplateFromLayout(body);
|
||||
return ResponseEntity.status(201).body(ApiResponse.success(result));
|
||||
}
|
||||
@@ -55,7 +55,7 @@ public class ReportController {
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> deleteTemplate(
|
||||
@PathVariable String templateId) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("templateId", templateId);
|
||||
params.put("template_id", templateId);
|
||||
return ResponseEntity.ok(ApiResponse.success(reportService.deleteTemplate(params)));
|
||||
}
|
||||
|
||||
@@ -79,9 +79,9 @@ public class ReportController {
|
||||
|
||||
@GetMapping
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getReportList(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(reportService.getReportList(params)));
|
||||
}
|
||||
|
||||
@@ -89,15 +89,15 @@ public class ReportController {
|
||||
|
||||
@PostMapping
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> createReport(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute(value = "userId", required = false) String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute(value = "user_id", required = false) String userId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
if (body.get("reportNameKor") == null || body.get("reportType") == null) {
|
||||
if (body.get("report_name_kor") == null || body.get("report_type") == null) {
|
||||
return ResponseEntity.status(400).body(
|
||||
ApiResponse.error("리포트명과 리포트 타입은 필수입니다."));
|
||||
}
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("createdBy", userId);
|
||||
body.put("company_code", companyCode);
|
||||
body.put("created_by", userId);
|
||||
Map<String, Object> result = reportService.createReport(body);
|
||||
return ResponseEntity.status(201).body(ApiResponse.success(result, "리포트가 생성되었습니다."));
|
||||
}
|
||||
@@ -106,13 +106,13 @@ public class ReportController {
|
||||
|
||||
@PostMapping("/{reportId}/copy")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> copyReport(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute(value = "userId", required = false) String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute(value = "user_id", required = false) String userId,
|
||||
@PathVariable String reportId) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("reportId", reportId);
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("userId", userId);
|
||||
params.put("report_id", reportId);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("user_id", userId);
|
||||
Map<String, Object> result = reportService.copyReport(params);
|
||||
if (result == null) {
|
||||
return ResponseEntity.status(404).body(ApiResponse.error("리포트를 찾을 수 없습니다."));
|
||||
@@ -124,11 +124,11 @@ public class ReportController {
|
||||
|
||||
@PostMapping("/{reportId}/save-as-template")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> saveAsTemplate(
|
||||
@RequestAttribute(value = "userId", required = false) String userId,
|
||||
@RequestAttribute(value = "user_id", required = false) String userId,
|
||||
@PathVariable String reportId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("reportId", reportId);
|
||||
body.put("userId", userId);
|
||||
body.put("report_id", reportId);
|
||||
body.put("user_id", userId);
|
||||
Map<String, Object> result = reportService.saveAsTemplate(body);
|
||||
return ResponseEntity.status(201).body(ApiResponse.success(result));
|
||||
}
|
||||
@@ -138,7 +138,7 @@ public class ReportController {
|
||||
@GetMapping("/{reportId}/layout")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getLayout(
|
||||
@PathVariable String reportId) {
|
||||
Map<String, Object> params = Map.of("reportId", reportId);
|
||||
Map<String, Object> params = Map.of("report_id", reportId);
|
||||
Map<String, Object> result = reportService.getLayout(params);
|
||||
if (result == null) {
|
||||
return ResponseEntity.status(404).body(ApiResponse.error("레이아웃을 찾을 수 없습니다."));
|
||||
@@ -148,11 +148,11 @@ public class ReportController {
|
||||
|
||||
@PutMapping("/{reportId}/layout")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> saveLayout(
|
||||
@RequestAttribute(value = "userId", required = false) String userId,
|
||||
@RequestAttribute(value = "user_id", required = false) String userId,
|
||||
@PathVariable String reportId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("reportId", reportId);
|
||||
body.put("userId", userId);
|
||||
body.put("report_id", reportId);
|
||||
body.put("user_id", userId);
|
||||
Map<String, Object> result = reportService.saveLayout(body);
|
||||
return ResponseEntity.ok(ApiResponse.success(result));
|
||||
}
|
||||
@@ -164,8 +164,8 @@ public class ReportController {
|
||||
@PathVariable String reportId,
|
||||
@PathVariable String queryId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("reportId", reportId);
|
||||
body.put("queryId", queryId);
|
||||
body.put("report_id", reportId);
|
||||
body.put("query_id", queryId);
|
||||
Map<String, Object> result = reportService.executeQuery(body);
|
||||
return ResponseEntity.ok(ApiResponse.success(result));
|
||||
}
|
||||
@@ -174,11 +174,11 @@ public class ReportController {
|
||||
|
||||
@GetMapping("/{reportId}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getReportInfo(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String reportId) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("reportId", reportId);
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("report_id", reportId);
|
||||
params.put("company_code", companyCode);
|
||||
Map<String, Object> result = reportService.getReportInfo(params);
|
||||
if (result == null) {
|
||||
return ResponseEntity.status(404).body(ApiResponse.error("리포트를 찾을 수 없습니다."));
|
||||
@@ -188,23 +188,23 @@ public class ReportController {
|
||||
|
||||
@PutMapping("/{reportId}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> updateReport(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute(value = "userId", required = false) String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute(value = "user_id", required = false) String userId,
|
||||
@PathVariable String reportId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("reportId", reportId);
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("updatedBy", userId);
|
||||
body.put("report_id", reportId);
|
||||
body.put("company_code", companyCode);
|
||||
body.put("updated_by", userId);
|
||||
return ResponseEntity.ok(ApiResponse.success(reportService.updateReport(body)));
|
||||
}
|
||||
|
||||
@DeleteMapping("/{reportId}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> deleteReport(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String reportId) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("reportId", reportId);
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("report_id", reportId);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(reportService.deleteReport(params)));
|
||||
}
|
||||
|
||||
@@ -212,9 +212,9 @@ public class ReportController {
|
||||
|
||||
@GetMapping("/list")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getReportListLegacy(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(reportService.getReportList(params)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,46 +19,46 @@ public class RiskAlertController {
|
||||
/** GET / → 전체 알림 목록 */
|
||||
@GetMapping
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getAllAlerts(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(riskAlertService.getAllAlerts(params)));
|
||||
}
|
||||
|
||||
/** POST /refresh → 알림 새로고침 */
|
||||
@PostMapping("/refresh")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> refreshAlerts(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody(required = false) Map<String, Object> body) {
|
||||
Map<String, Object> params = body != null ? new HashMap<>(body) : new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(riskAlertService.refreshAlerts(params)));
|
||||
}
|
||||
|
||||
/** GET /weather → 기상 알림 목록 */
|
||||
@GetMapping("/weather")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getWeatherAlerts(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(riskAlertService.getWeatherAlerts(params)));
|
||||
}
|
||||
|
||||
/** GET /accidents → 사고 알림 목록 */
|
||||
@GetMapping("/accidents")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getAccidentAlerts(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(riskAlertService.getAccidentAlerts(params)));
|
||||
}
|
||||
|
||||
/** GET /roadworks → 공사 알림 목록 */
|
||||
@GetMapping("/roadworks")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getRoadworkAlerts(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(riskAlertService.getRoadworkAlerts(params)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ public class RoleController {
|
||||
*/
|
||||
@GetMapping
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getRoleGroups(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("role") String role,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
|
||||
@@ -40,7 +40,7 @@ public class RoleController {
|
||||
// SUPER_ADMIN: 요청 파라미터의 companyCode 사용 (없으면 전체)
|
||||
// 그 외: 자신의 companyCode 강제 적용
|
||||
if (!isSuperAdmin(role)) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
}
|
||||
|
||||
return ResponseEntity.ok(ApiResponse.success(roleService.getRoleGroups(params), "권한 그룹 목록 조회 성공"));
|
||||
@@ -53,7 +53,7 @@ public class RoleController {
|
||||
@GetMapping("/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getRoleGroupById(
|
||||
@PathVariable String id,
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("role") String role) {
|
||||
|
||||
if (!isAdmin(role)) {
|
||||
@@ -68,7 +68,7 @@ public class RoleController {
|
||||
return ResponseEntity.status(404).body(ApiResponse.error("권한 그룹을 찾을 수 없습니다."));
|
||||
}
|
||||
|
||||
if (!isSuperAdmin(role) && !companyCode.equals(group.get("companyCode"))) {
|
||||
if (!isSuperAdmin(role) && !companyCode.equals(group.get("company_code"))) {
|
||||
return ResponseEntity.status(403).body(ApiResponse.error("권한이 없습니다."));
|
||||
}
|
||||
|
||||
@@ -81,16 +81,16 @@ public class RoleController {
|
||||
*/
|
||||
@PostMapping
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> createRoleGroup(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("role") String role,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
|
||||
if (!isAdmin(role)) {
|
||||
return ResponseEntity.status(403).body(ApiResponse.error("관리자 권한이 필요합니다."));
|
||||
}
|
||||
|
||||
String targetCompany = (String) body.get("companyCode");
|
||||
String targetCompany = (String) body.get("company_code");
|
||||
if (!isSuperAdmin(role) && !companyCode.equals(targetCompany)) {
|
||||
return ResponseEntity.status(403).body(ApiResponse.error("다른 회사의 권한 그룹을 생성할 수 없습니다."));
|
||||
}
|
||||
@@ -109,7 +109,7 @@ public class RoleController {
|
||||
@PutMapping("/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> updateRoleGroup(
|
||||
@PathVariable String id,
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("role") String role,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
|
||||
@@ -123,7 +123,7 @@ public class RoleController {
|
||||
return ResponseEntity.status(404).body(ApiResponse.error("권한 그룹을 찾을 수 없습니다."));
|
||||
}
|
||||
|
||||
if (!isSuperAdmin(role) && !companyCode.equals(existing.get("companyCode"))) {
|
||||
if (!isSuperAdmin(role) && !companyCode.equals(existing.get("company_code"))) {
|
||||
return ResponseEntity.status(403).body(ApiResponse.error("권한이 없습니다."));
|
||||
}
|
||||
|
||||
@@ -141,7 +141,7 @@ public class RoleController {
|
||||
@DeleteMapping("/{id}")
|
||||
public ResponseEntity<ApiResponse<Void>> deleteRoleGroup(
|
||||
@PathVariable String id,
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("role") String role) {
|
||||
|
||||
if (!isAdmin(role)) {
|
||||
@@ -154,7 +154,7 @@ public class RoleController {
|
||||
return ResponseEntity.status(404).body(ApiResponse.error("권한 그룹을 찾을 수 없습니다."));
|
||||
}
|
||||
|
||||
if (!isSuperAdmin(role) && !companyCode.equals(existing.get("companyCode"))) {
|
||||
if (!isSuperAdmin(role) && !companyCode.equals(existing.get("company_code"))) {
|
||||
return ResponseEntity.status(403).body(ApiResponse.error("권한이 없습니다."));
|
||||
}
|
||||
|
||||
@@ -174,12 +174,12 @@ public class RoleController {
|
||||
*/
|
||||
@GetMapping("/user/my-groups")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getMyRoleGroups(
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("userId", userId);
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("user_id", userId);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(roleService.getUserRoleGroups(params), "사용자 권한 그룹 조회 성공"));
|
||||
}
|
||||
|
||||
@@ -189,9 +189,9 @@ public class RoleController {
|
||||
*/
|
||||
@GetMapping("/menus/all")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getAllMenus(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("role") String role,
|
||||
@RequestParam(value = "companyCode", required = false) String requestedCompanyCode) {
|
||||
@RequestParam(value = "company_code", required = false) String requestedCompanyCode) {
|
||||
|
||||
if (!isAdmin(role)) {
|
||||
return ResponseEntity.status(403).body(ApiResponse.error("관리자 권한이 필요합니다."));
|
||||
@@ -200,9 +200,9 @@ public class RoleController {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
if (isSuperAdmin(role)) {
|
||||
// SUPER_ADMIN: 쿼리 파라미터로 받은 companyCode 사용 (없으면 전체)
|
||||
params.put("companyCode", requestedCompanyCode);
|
||||
params.put("company_code", requestedCompanyCode);
|
||||
} else {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
}
|
||||
|
||||
return ResponseEntity.ok(ApiResponse.success(roleService.getAllMenus(params), "메뉴 목록 조회 성공"));
|
||||
@@ -215,7 +215,7 @@ public class RoleController {
|
||||
@GetMapping("/{id}/members")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getRoleMembers(
|
||||
@PathVariable String id,
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("role") String role) {
|
||||
|
||||
if (!isAdmin(role)) {
|
||||
@@ -227,12 +227,12 @@ public class RoleController {
|
||||
if (group == null) {
|
||||
return ResponseEntity.status(404).body(ApiResponse.error("권한 그룹을 찾을 수 없습니다."));
|
||||
}
|
||||
if (!isSuperAdmin(role) && !companyCode.equals(group.get("companyCode"))) {
|
||||
if (!isSuperAdmin(role) && !companyCode.equals(group.get("company_code"))) {
|
||||
return ResponseEntity.status(403).body(ApiResponse.error("권한이 없습니다."));
|
||||
}
|
||||
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("masterObjid", parseLong(id));
|
||||
params.put("master_objid", parseLong(id));
|
||||
return ResponseEntity.ok(ApiResponse.success(roleService.getRoleMembers(params), "권한 그룹 멤버 조회 성공"));
|
||||
}
|
||||
|
||||
@@ -243,9 +243,9 @@ public class RoleController {
|
||||
@PostMapping("/{id}/members")
|
||||
public ResponseEntity<ApiResponse<Void>> addRoleMembers(
|
||||
@PathVariable String id,
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("role") String role,
|
||||
@RequestAttribute("userId") String currentUserId,
|
||||
@RequestAttribute("user_id") String currentUserId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
|
||||
if (!isAdmin(role)) {
|
||||
@@ -257,12 +257,12 @@ public class RoleController {
|
||||
if (group == null) {
|
||||
return ResponseEntity.status(404).body(ApiResponse.error("권한 그룹을 찾을 수 없습니다."));
|
||||
}
|
||||
if (!isSuperAdmin(role) && !companyCode.equals(group.get("companyCode"))) {
|
||||
if (!isSuperAdmin(role) && !companyCode.equals(group.get("company_code"))) {
|
||||
return ResponseEntity.status(403).body(ApiResponse.error("권한이 없습니다."));
|
||||
}
|
||||
|
||||
Map<String, Object> params = new HashMap<>(body);
|
||||
params.put("masterObjid", parseLong(id));
|
||||
params.put("master_objid", parseLong(id));
|
||||
params.put("writer", currentUserId);
|
||||
roleService.addRoleMembers(params);
|
||||
return ResponseEntity.ok(ApiResponse.success(null, "권한 그룹 멤버 추가 성공"));
|
||||
@@ -275,9 +275,9 @@ public class RoleController {
|
||||
@PutMapping("/{id}/members")
|
||||
public ResponseEntity<ApiResponse<Void>> updateRoleMembers(
|
||||
@PathVariable String id,
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("role") String role,
|
||||
@RequestAttribute("userId") String currentUserId,
|
||||
@RequestAttribute("user_id") String currentUserId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
|
||||
if (!isAdmin(role)) {
|
||||
@@ -289,12 +289,12 @@ public class RoleController {
|
||||
if (group == null) {
|
||||
return ResponseEntity.status(404).body(ApiResponse.error("권한 그룹을 찾을 수 없습니다."));
|
||||
}
|
||||
if (!isSuperAdmin(role) && !companyCode.equals(group.get("companyCode"))) {
|
||||
if (!isSuperAdmin(role) && !companyCode.equals(group.get("company_code"))) {
|
||||
return ResponseEntity.status(403).body(ApiResponse.error("권한이 없습니다."));
|
||||
}
|
||||
|
||||
Map<String, Object> params = new HashMap<>(body);
|
||||
params.put("masterObjid", parseLong(id));
|
||||
params.put("master_objid", parseLong(id));
|
||||
params.put("writer", currentUserId);
|
||||
roleService.updateRoleMembers(params);
|
||||
return ResponseEntity.ok(ApiResponse.success(null, "권한 그룹 멤버 업데이트 성공"));
|
||||
@@ -307,7 +307,7 @@ public class RoleController {
|
||||
@DeleteMapping("/{id}/members")
|
||||
public ResponseEntity<ApiResponse<Void>> removeRoleMembers(
|
||||
@PathVariable String id,
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("role") String role,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
|
||||
@@ -320,12 +320,12 @@ public class RoleController {
|
||||
if (group == null) {
|
||||
return ResponseEntity.status(404).body(ApiResponse.error("권한 그룹을 찾을 수 없습니다."));
|
||||
}
|
||||
if (!isSuperAdmin(role) && !companyCode.equals(group.get("companyCode"))) {
|
||||
if (!isSuperAdmin(role) && !companyCode.equals(group.get("company_code"))) {
|
||||
return ResponseEntity.status(403).body(ApiResponse.error("권한이 없습니다."));
|
||||
}
|
||||
|
||||
Map<String, Object> params = new HashMap<>(body);
|
||||
params.put("masterObjid", parseLong(id));
|
||||
params.put("master_objid", parseLong(id));
|
||||
roleService.removeRoleMembers(params);
|
||||
return ResponseEntity.ok(ApiResponse.success(null, "권한 그룹 멤버 제거 성공"));
|
||||
}
|
||||
@@ -341,7 +341,7 @@ public class RoleController {
|
||||
@GetMapping("/{id}/menu-permissions")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getMenuPermissions(
|
||||
@PathVariable String id,
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("role") String role) {
|
||||
|
||||
if (!isAdmin(role)) {
|
||||
@@ -353,12 +353,12 @@ public class RoleController {
|
||||
if (group == null) {
|
||||
return ResponseEntity.status(404).body(ApiResponse.error("권한 그룹을 찾을 수 없습니다."));
|
||||
}
|
||||
if (!isSuperAdmin(role) && !companyCode.equals(group.get("companyCode"))) {
|
||||
if (!isSuperAdmin(role) && !companyCode.equals(group.get("company_code"))) {
|
||||
return ResponseEntity.status(403).body(ApiResponse.error("권한이 없습니다."));
|
||||
}
|
||||
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("authObjid", parseLong(id));
|
||||
params.put("auth_objid", parseLong(id));
|
||||
return ResponseEntity.ok(ApiResponse.success(roleService.getMenuPermissions(params), "메뉴 권한 조회 성공"));
|
||||
}
|
||||
|
||||
@@ -369,9 +369,9 @@ public class RoleController {
|
||||
@PutMapping("/{id}/menu-permissions")
|
||||
public ResponseEntity<ApiResponse<Void>> setMenuPermissions(
|
||||
@PathVariable String id,
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("role") String role,
|
||||
@RequestAttribute("userId") String currentUserId,
|
||||
@RequestAttribute("user_id") String currentUserId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
|
||||
if (!isAdmin(role)) {
|
||||
@@ -383,12 +383,12 @@ public class RoleController {
|
||||
if (group == null) {
|
||||
return ResponseEntity.status(404).body(ApiResponse.error("권한 그룹을 찾을 수 없습니다."));
|
||||
}
|
||||
if (!isSuperAdmin(role) && !companyCode.equals(group.get("companyCode"))) {
|
||||
if (!isSuperAdmin(role) && !companyCode.equals(group.get("company_code"))) {
|
||||
return ResponseEntity.status(403).body(ApiResponse.error("권한이 없습니다."));
|
||||
}
|
||||
|
||||
Map<String, Object> params = new HashMap<>(body);
|
||||
params.put("authObjid", parseLong(id));
|
||||
params.put("auth_objid", parseLong(id));
|
||||
params.put("writer", currentUserId);
|
||||
roleService.setMenuPermissions(params);
|
||||
return ResponseEntity.ok(ApiResponse.success(null, "메뉴 권한 설정 성공"));
|
||||
@@ -401,7 +401,7 @@ public class RoleController {
|
||||
@GetMapping("/user/{userId}/groups")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getUserRoleGroups(
|
||||
@PathVariable String userId,
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("role") String role) {
|
||||
|
||||
if (!isAdmin(role)) {
|
||||
@@ -409,8 +409,8 @@ public class RoleController {
|
||||
}
|
||||
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("userId", userId);
|
||||
params.put("companyCode", isSuperAdmin(role) ? null : companyCode);
|
||||
params.put("user_id", userId);
|
||||
params.put("company_code", isSuperAdmin(role) ? null : companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(roleService.getUserRoleGroups(params), "사용자 권한 그룹 조회 성공"));
|
||||
}
|
||||
|
||||
|
||||
@@ -19,25 +19,25 @@ public class SalesReportController {
|
||||
|
||||
@GetMapping("/list")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getSalesReportList(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(salesReportService.getSalesReportList(params)));
|
||||
}
|
||||
|
||||
@GetMapping("/summary")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getSalesReportSummary(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(salesReportService.getSalesReportSummary(params)));
|
||||
}
|
||||
|
||||
@GetMapping("/data")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getSalesReportData(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(salesReportService.getSalesReportData(params)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,9 +18,9 @@ public class ScheduleController {
|
||||
|
||||
@GetMapping("/list")
|
||||
public ResponseEntity<Map<String, Object>> getScheduleList(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
List<Map<String, Object>> list = scheduleService.getScheduleList(params);
|
||||
Map<String, Object> resp = new LinkedHashMap<>();
|
||||
resp.put("success", true);
|
||||
@@ -31,11 +31,11 @@ public class ScheduleController {
|
||||
|
||||
@GetMapping("/{scheduleId}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getScheduleInfo(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long scheduleId) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("scheduleId", scheduleId);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("schedule_id", scheduleId);
|
||||
return ResponseEntity.ok(ApiResponse.success(scheduleService.getScheduleInfo(params)));
|
||||
}
|
||||
|
||||
@@ -45,9 +45,9 @@ public class ScheduleController {
|
||||
*/
|
||||
@PostMapping("/preview")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> previewSchedule(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
try {
|
||||
Map<String, Object> preview = scheduleService.previewSchedule(body);
|
||||
return ResponseEntity.ok(ApiResponse.success(preview));
|
||||
@@ -62,11 +62,11 @@ public class ScheduleController {
|
||||
*/
|
||||
@PostMapping("/apply")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> applySchedules(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("userId", userId);
|
||||
body.put("company_code", companyCode);
|
||||
body.put("user_id", userId);
|
||||
try {
|
||||
Map<String, Object> applied = scheduleService.applySchedules(body);
|
||||
String message = applied.get("created") + "건 생성, " + applied.get("deleted") + "건 삭제, " + applied.get("updated") + "건 수정되었습니다.";
|
||||
@@ -78,31 +78,31 @@ public class ScheduleController {
|
||||
|
||||
@PostMapping
|
||||
public ResponseEntity<ApiResponse<Integer>> insertSchedule(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(scheduleService.insertSchedule(body)));
|
||||
}
|
||||
|
||||
@PutMapping("/{scheduleId}")
|
||||
public ResponseEntity<ApiResponse<Integer>> updateSchedule(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long scheduleId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("scheduleId", scheduleId);
|
||||
body.put("company_code", companyCode);
|
||||
body.put("schedule_id", scheduleId);
|
||||
return ResponseEntity.ok(ApiResponse.success(scheduleService.updateSchedule(body)));
|
||||
}
|
||||
|
||||
@DeleteMapping("/{scheduleId}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> deleteSchedule(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@PathVariable Long scheduleId) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("userId", userId);
|
||||
params.put("scheduleId", scheduleId);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("user_id", userId);
|
||||
params.put("schedule_id", scheduleId);
|
||||
Map<String, Object> result = scheduleService.deleteSchedule(params);
|
||||
if (Boolean.FALSE.equals(result.get("success"))) {
|
||||
return ResponseEntity.status(404).body(ApiResponse.error((String) result.get("message")));
|
||||
|
||||
@@ -47,15 +47,15 @@ public class ScreenEmbeddingController {
|
||||
@GetMapping("/screen-embedding")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getScreenEmbeddingList(
|
||||
@RequestParam(required = false) Long parentScreenId,
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
if (parentScreenId == null) {
|
||||
return ResponseEntity.status(400)
|
||||
.body(ApiResponse.error("부모 화면 ID가 필요합니다."));
|
||||
}
|
||||
try {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("parentScreenId", parentScreenId);
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("parent_screen_id", parentScreenId);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(service.getScreenEmbeddingList(params)));
|
||||
} catch (Exception e) {
|
||||
log.error("화면 임베딩 목록 조회 실패", e);
|
||||
@@ -67,11 +67,11 @@ public class ScreenEmbeddingController {
|
||||
@GetMapping("/screen-embedding/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getScreenEmbeddingInfo(
|
||||
@PathVariable Long id,
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
try {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("id", id);
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
Map<String, Object> result = service.getScreenEmbeddingInfo(params);
|
||||
if (result == null) {
|
||||
return ResponseEntity.status(404)
|
||||
@@ -88,14 +88,14 @@ public class ScreenEmbeddingController {
|
||||
@PostMapping("/screen-embedding")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> insertScreenEmbedding(
|
||||
@RequestBody Map<String, Object> body,
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId) {
|
||||
if (body.get("parentScreenId") == null || body.get("childScreenId") == null
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId) {
|
||||
if (body.get("parent_screen_id") == null || body.get("child_screen_id") == null
|
||||
|| body.get("position") == null || body.get("mode") == null) {
|
||||
return ResponseEntity.status(400).body(ApiResponse.error("필수 필드가 누락되었습니다."));
|
||||
}
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("userId", userId);
|
||||
body.put("company_code", companyCode);
|
||||
body.put("user_id", userId);
|
||||
try {
|
||||
Map<String, Object> result = service.insertScreenEmbedding(body);
|
||||
return ResponseEntity.status(HttpStatus.CREATED).body(ApiResponse.success(result));
|
||||
@@ -113,12 +113,12 @@ public class ScreenEmbeddingController {
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> updateScreenEmbedding(
|
||||
@PathVariable Long id,
|
||||
@RequestBody Map<String, Object> body,
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
if (body.get("position") == null && body.get("mode") == null && body.get("config") == null) {
|
||||
return ResponseEntity.status(400).body(ApiResponse.error("수정할 내용이 없습니다."));
|
||||
}
|
||||
body.put("id", id);
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
try {
|
||||
Map<String, Object> result = service.updateScreenEmbedding(body);
|
||||
if (result == null) {
|
||||
@@ -136,10 +136,10 @@ public class ScreenEmbeddingController {
|
||||
@DeleteMapping("/screen-embedding/{id}")
|
||||
public ResponseEntity<ApiResponse<Void>> deleteScreenEmbedding(
|
||||
@PathVariable Long id,
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("id", id);
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
try {
|
||||
boolean deleted = service.deleteScreenEmbedding(params);
|
||||
if (!deleted) {
|
||||
@@ -162,16 +162,16 @@ public class ScreenEmbeddingController {
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getScreenDataTransferInfo(
|
||||
@RequestParam(required = false) Long sourceScreenId,
|
||||
@RequestParam(required = false) Long targetScreenId,
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
if (sourceScreenId == null || targetScreenId == null) {
|
||||
return ResponseEntity.status(400)
|
||||
.body(ApiResponse.error("소스 화면 ID와 타겟 화면 ID가 필요합니다."));
|
||||
}
|
||||
try {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("sourceScreenId", sourceScreenId);
|
||||
params.put("targetScreenId", targetScreenId);
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("source_screen_id", sourceScreenId);
|
||||
params.put("target_screen_id", targetScreenId);
|
||||
params.put("company_code", companyCode);
|
||||
Map<String, Object> result = service.getScreenDataTransferInfo(params);
|
||||
if (result == null) {
|
||||
return ResponseEntity.status(404)
|
||||
@@ -188,14 +188,14 @@ public class ScreenEmbeddingController {
|
||||
@PostMapping("/screen-data-transfer")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> insertScreenDataTransfer(
|
||||
@RequestBody Map<String, Object> body,
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId) {
|
||||
if (body.get("sourceScreenId") == null || body.get("targetScreenId") == null
|
||||
|| body.get("dataReceivers") == null) {
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId) {
|
||||
if (body.get("source_screen_id") == null || body.get("target_screen_id") == null
|
||||
|| body.get("data_receivers") == null) {
|
||||
return ResponseEntity.status(400).body(ApiResponse.error("필수 필드가 누락되었습니다."));
|
||||
}
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("userId", userId);
|
||||
body.put("company_code", companyCode);
|
||||
body.put("user_id", userId);
|
||||
try {
|
||||
Map<String, Object> result = service.insertScreenDataTransfer(body);
|
||||
return ResponseEntity.status(HttpStatus.CREATED).body(ApiResponse.success(result));
|
||||
@@ -213,12 +213,12 @@ public class ScreenEmbeddingController {
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> updateScreenDataTransfer(
|
||||
@PathVariable Long id,
|
||||
@RequestBody Map<String, Object> body,
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
if (body.get("dataReceivers") == null && body.get("buttonConfig") == null) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
if (body.get("data_receivers") == null && body.get("button_config") == null) {
|
||||
return ResponseEntity.status(400).body(ApiResponse.error("수정할 내용이 없습니다."));
|
||||
}
|
||||
body.put("id", id);
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
try {
|
||||
Map<String, Object> result = service.updateScreenDataTransfer(body);
|
||||
if (result == null) {
|
||||
@@ -236,10 +236,10 @@ public class ScreenEmbeddingController {
|
||||
@DeleteMapping("/screen-data-transfer/{id}")
|
||||
public ResponseEntity<ApiResponse<Void>> deleteScreenDataTransfer(
|
||||
@PathVariable Long id,
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("id", id);
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
try {
|
||||
boolean deleted = service.deleteScreenDataTransfer(params);
|
||||
if (!deleted) {
|
||||
@@ -261,11 +261,11 @@ public class ScreenEmbeddingController {
|
||||
@GetMapping("/screen-split-panel/{screenId}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getScreenSplitPanelInfo(
|
||||
@PathVariable Long screenId,
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
try {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("screenId", screenId);
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("screen_id", screenId);
|
||||
params.put("company_code", companyCode);
|
||||
Map<String, Object> result = service.getScreenSplitPanelInfo(params);
|
||||
if (result == null) {
|
||||
return ResponseEntity.status(404)
|
||||
@@ -282,14 +282,14 @@ public class ScreenEmbeddingController {
|
||||
@PostMapping("/screen-split-panel")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> insertScreenSplitPanel(
|
||||
@RequestBody Map<String, Object> body,
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId) {
|
||||
if (body.get("screenId") == null || body.get("leftEmbedding") == null
|
||||
|| body.get("rightEmbedding") == null || body.get("dataTransfer") == null) {
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId) {
|
||||
if (body.get("screen_id") == null || body.get("left_embedding") == null
|
||||
|| body.get("right_embedding") == null || body.get("data_transfer") == null) {
|
||||
return ResponseEntity.status(400).body(ApiResponse.error("필수 필드가 누락되었습니다."));
|
||||
}
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("userId", userId);
|
||||
body.put("company_code", companyCode);
|
||||
body.put("user_id", userId);
|
||||
try {
|
||||
Map<String, Object> result = service.insertScreenSplitPanel(body);
|
||||
return ResponseEntity.status(HttpStatus.CREATED).body(ApiResponse.success(result));
|
||||
@@ -304,12 +304,12 @@ public class ScreenEmbeddingController {
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> updateScreenSplitPanel(
|
||||
@PathVariable Long id,
|
||||
@RequestBody Map<String, Object> body,
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
if (body.get("layoutConfig") == null) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
if (body.get("layout_config") == null) {
|
||||
return ResponseEntity.status(400).body(ApiResponse.error("수정할 내용이 없습니다."));
|
||||
}
|
||||
body.put("id", id);
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
try {
|
||||
Map<String, Object> result = service.updateScreenSplitPanel(body);
|
||||
if (result == null) {
|
||||
@@ -327,10 +327,10 @@ public class ScreenEmbeddingController {
|
||||
@DeleteMapping("/screen-split-panel/{id}")
|
||||
public ResponseEntity<ApiResponse<Void>> deleteScreenSplitPanel(
|
||||
@PathVariable Long id,
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("id", id);
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
try {
|
||||
boolean deleted = service.deleteScreenSplitPanel(params);
|
||||
if (!deleted) {
|
||||
|
||||
@@ -34,18 +34,18 @@ public class ScreenGroupController {
|
||||
@RequestParam(required = false, defaultValue = "1") int page,
|
||||
@RequestParam(required = false, defaultValue = "20") int size,
|
||||
@RequestParam(required = false) String filterCompanyCode,
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
try {
|
||||
String effectiveCompanyCode = ("*".equals(companyCode) && filterCompanyCode != null)
|
||||
? filterCompanyCode : companyCode;
|
||||
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", effectiveCompanyCode);
|
||||
params.put("company_code", effectiveCompanyCode);
|
||||
params.put("page", page);
|
||||
params.put("size", size);
|
||||
if (search != null) params.put("search", search);
|
||||
if (groupName != null) params.put("groupName", groupName);
|
||||
if (parentGroupId != null) params.put("parentGroupId", parentGroupId);
|
||||
if (groupName != null) params.put("group_name", groupName);
|
||||
if (parentGroupId != null) params.put("parent_group_id", parentGroupId);
|
||||
|
||||
// 페이지네이션 응답은 Node.js 동일 구조(total/page/size/totalPages) 유지
|
||||
return ResponseEntity.ok(service.getScreenGroups(params));
|
||||
@@ -60,11 +60,11 @@ public class ScreenGroupController {
|
||||
@GetMapping("/groups/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getScreenGroup(
|
||||
@PathVariable Integer id,
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
try {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("id", id);
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
Map<String, Object> group = service.getScreenGroup(params);
|
||||
if (group == null) {
|
||||
return ResponseEntity.status(404).body(ApiResponse.error("화면 그룹을 찾을 수 없습니다"));
|
||||
@@ -81,10 +81,10 @@ public class ScreenGroupController {
|
||||
@PostMapping("/groups")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> createScreenGroup(
|
||||
@RequestBody Map<String, Object> body,
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("userId", userId);
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId) {
|
||||
body.put("company_code", companyCode);
|
||||
body.put("user_id", userId);
|
||||
try {
|
||||
Map<String, Object> created = service.createScreenGroup(body);
|
||||
return ResponseEntity.status(HttpStatus.CREATED).body(ApiResponse.success(created));
|
||||
@@ -103,11 +103,11 @@ public class ScreenGroupController {
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> updateScreenGroup(
|
||||
@PathVariable Integer id,
|
||||
@RequestBody Map<String, Object> body,
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId) {
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId) {
|
||||
body.put("id", id);
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("userId", userId);
|
||||
body.put("company_code", companyCode);
|
||||
body.put("user_id", userId);
|
||||
try {
|
||||
return ResponseEntity.ok(ApiResponse.success(service.updateScreenGroup(body)));
|
||||
} catch (NoSuchElementException e) {
|
||||
@@ -128,13 +128,13 @@ public class ScreenGroupController {
|
||||
public ResponseEntity<ApiResponse<Void>> deleteScreenGroup(
|
||||
@PathVariable Integer id,
|
||||
@RequestParam(required = false, defaultValue = "false") boolean deleteNumberingRules,
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId) {
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("id", id);
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("userId", userId);
|
||||
params.put("deleteNumberingRules", deleteNumberingRules);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("user_id", userId);
|
||||
params.put("delete_numbering_rules", deleteNumberingRules);
|
||||
try {
|
||||
service.deleteScreenGroup(params);
|
||||
return ResponseEntity.ok(ApiResponse.success(null, "화면 그룹이 삭제되었습니다"));
|
||||
@@ -159,10 +159,10 @@ public class ScreenGroupController {
|
||||
@PostMapping("/group-screens")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> addScreenToGroup(
|
||||
@RequestBody Map<String, Object> body,
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("userId", userId);
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId) {
|
||||
body.put("company_code", companyCode);
|
||||
body.put("user_id", userId);
|
||||
try {
|
||||
return ResponseEntity.status(HttpStatus.CREATED)
|
||||
.body(ApiResponse.success(service.addScreenToGroup(body)));
|
||||
@@ -181,11 +181,11 @@ public class ScreenGroupController {
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> updateScreenInGroup(
|
||||
@PathVariable Integer id,
|
||||
@RequestBody Map<String, Object> body,
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId) {
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId) {
|
||||
body.put("id", id);
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("userId", userId);
|
||||
body.put("company_code", companyCode);
|
||||
body.put("user_id", userId);
|
||||
try {
|
||||
return ResponseEntity.ok(ApiResponse.success(service.updateScreenInGroup(body)));
|
||||
} catch (NoSuchElementException e) {
|
||||
@@ -202,12 +202,12 @@ public class ScreenGroupController {
|
||||
@DeleteMapping("/group-screens/{id}")
|
||||
public ResponseEntity<ApiResponse<Void>> removeScreenFromGroup(
|
||||
@PathVariable Integer id,
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId) {
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("id", id);
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("userId", userId);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("user_id", userId);
|
||||
try {
|
||||
service.removeScreenFromGroup(params);
|
||||
return ResponseEntity.ok(ApiResponse.success(null, "화면 그룹 연결이 해제되었습니다"));
|
||||
@@ -230,12 +230,12 @@ public class ScreenGroupController {
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getFieldJoins(
|
||||
@RequestParam(required = false) Integer groupId,
|
||||
@RequestParam(required = false) Integer screenId,
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
try {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
if (groupId != null) params.put("groupId", groupId);
|
||||
if (screenId != null) params.put("screenId", screenId);
|
||||
params.put("company_code", companyCode);
|
||||
if (groupId != null) params.put("group_id", groupId);
|
||||
if (screenId != null) params.put("screen_id", screenId);
|
||||
return ResponseEntity.ok(ApiResponse.success(service.getFieldJoins(params)));
|
||||
} catch (Exception e) {
|
||||
log.error("필드 조인 목록 조회 실패", e);
|
||||
@@ -248,10 +248,10 @@ public class ScreenGroupController {
|
||||
@PostMapping("/field-joins")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> createFieldJoin(
|
||||
@RequestBody Map<String, Object> body,
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("userId", userId);
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId) {
|
||||
body.put("company_code", companyCode);
|
||||
body.put("user_id", userId);
|
||||
try {
|
||||
return ResponseEntity.status(HttpStatus.CREATED)
|
||||
.body(ApiResponse.success(service.createFieldJoin(body)));
|
||||
@@ -267,11 +267,11 @@ public class ScreenGroupController {
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> updateFieldJoin(
|
||||
@PathVariable Integer id,
|
||||
@RequestBody Map<String, Object> body,
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId) {
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId) {
|
||||
body.put("id", id);
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("userId", userId);
|
||||
body.put("company_code", companyCode);
|
||||
body.put("user_id", userId);
|
||||
try {
|
||||
return ResponseEntity.ok(ApiResponse.success(service.updateFieldJoin(body)));
|
||||
} catch (NoSuchElementException e) {
|
||||
@@ -288,12 +288,12 @@ public class ScreenGroupController {
|
||||
@DeleteMapping("/field-joins/{id}")
|
||||
public ResponseEntity<ApiResponse<Void>> deleteFieldJoin(
|
||||
@PathVariable Integer id,
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId) {
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("id", id);
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("userId", userId);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("user_id", userId);
|
||||
try {
|
||||
service.deleteFieldJoin(params);
|
||||
return ResponseEntity.ok(ApiResponse.success(null, "필드 조인이 삭제되었습니다"));
|
||||
@@ -316,12 +316,12 @@ public class ScreenGroupController {
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getDataFlows(
|
||||
@RequestParam(required = false) Integer groupId,
|
||||
@RequestParam(required = false) Integer screenId,
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
try {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
if (groupId != null) params.put("groupId", groupId);
|
||||
if (screenId != null) params.put("screenId", screenId);
|
||||
params.put("company_code", companyCode);
|
||||
if (groupId != null) params.put("group_id", groupId);
|
||||
if (screenId != null) params.put("screen_id", screenId);
|
||||
return ResponseEntity.ok(ApiResponse.success(service.getDataFlows(params)));
|
||||
} catch (Exception e) {
|
||||
log.error("데이터 흐름 목록 조회 실패", e);
|
||||
@@ -334,10 +334,10 @@ public class ScreenGroupController {
|
||||
@PostMapping("/data-flows")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> createDataFlow(
|
||||
@RequestBody Map<String, Object> body,
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("userId", userId);
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId) {
|
||||
body.put("company_code", companyCode);
|
||||
body.put("user_id", userId);
|
||||
try {
|
||||
return ResponseEntity.status(HttpStatus.CREATED)
|
||||
.body(ApiResponse.success(service.createDataFlow(body)));
|
||||
@@ -353,11 +353,11 @@ public class ScreenGroupController {
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> updateDataFlow(
|
||||
@PathVariable Integer id,
|
||||
@RequestBody Map<String, Object> body,
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId) {
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId) {
|
||||
body.put("id", id);
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("userId", userId);
|
||||
body.put("company_code", companyCode);
|
||||
body.put("user_id", userId);
|
||||
try {
|
||||
return ResponseEntity.ok(ApiResponse.success(service.updateDataFlow(body)));
|
||||
} catch (NoSuchElementException e) {
|
||||
@@ -374,12 +374,12 @@ public class ScreenGroupController {
|
||||
@DeleteMapping("/data-flows/{id}")
|
||||
public ResponseEntity<ApiResponse<Void>> deleteDataFlow(
|
||||
@PathVariable Integer id,
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId) {
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("id", id);
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("userId", userId);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("user_id", userId);
|
||||
try {
|
||||
service.deleteDataFlow(params);
|
||||
return ResponseEntity.ok(ApiResponse.success(null, "데이터 흐름이 삭제되었습니다"));
|
||||
@@ -402,12 +402,12 @@ public class ScreenGroupController {
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getTableRelations(
|
||||
@RequestParam(required = false) Integer groupId,
|
||||
@RequestParam(required = false) Integer screenId,
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
try {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
if (groupId != null) params.put("groupId", groupId);
|
||||
if (screenId != null) params.put("screenId", screenId);
|
||||
params.put("company_code", companyCode);
|
||||
if (groupId != null) params.put("group_id", groupId);
|
||||
if (screenId != null) params.put("screen_id", screenId);
|
||||
return ResponseEntity.ok(ApiResponse.success(service.getTableRelations(params)));
|
||||
} catch (Exception e) {
|
||||
log.error("화면-테이블 관계 목록 조회 실패", e);
|
||||
@@ -420,10 +420,10 @@ public class ScreenGroupController {
|
||||
@PostMapping("/table-relations")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> createTableRelation(
|
||||
@RequestBody Map<String, Object> body,
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("userId", userId);
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId) {
|
||||
body.put("company_code", companyCode);
|
||||
body.put("user_id", userId);
|
||||
try {
|
||||
return ResponseEntity.status(HttpStatus.CREATED)
|
||||
.body(ApiResponse.success(service.createTableRelation(body)));
|
||||
@@ -439,11 +439,11 @@ public class ScreenGroupController {
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> updateTableRelation(
|
||||
@PathVariable Integer id,
|
||||
@RequestBody Map<String, Object> body,
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId) {
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId) {
|
||||
body.put("id", id);
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("userId", userId);
|
||||
body.put("company_code", companyCode);
|
||||
body.put("user_id", userId);
|
||||
try {
|
||||
return ResponseEntity.ok(ApiResponse.success(service.updateTableRelation(body)));
|
||||
} catch (NoSuchElementException e) {
|
||||
@@ -460,12 +460,12 @@ public class ScreenGroupController {
|
||||
@DeleteMapping("/table-relations/{id}")
|
||||
public ResponseEntity<ApiResponse<Void>> deleteTableRelation(
|
||||
@PathVariable Integer id,
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId) {
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("id", id);
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("userId", userId);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("user_id", userId);
|
||||
try {
|
||||
service.deleteTableRelation(params);
|
||||
return ResponseEntity.ok(ApiResponse.success(null, "화면-테이블 관계가 삭제되었습니다"));
|
||||
@@ -487,11 +487,11 @@ public class ScreenGroupController {
|
||||
@GetMapping("/layout-summary/{screenId}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getScreenLayoutSummary(
|
||||
@PathVariable Integer screenId,
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
try {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("screenId", screenId);
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("screen_id", screenId);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(service.getScreenLayoutSummary(params)));
|
||||
} catch (Exception e) {
|
||||
log.error("레이아웃 요약 조회 실패: screenId={}", screenId, e);
|
||||
@@ -504,10 +504,10 @@ public class ScreenGroupController {
|
||||
@PostMapping("/layout-summary/batch")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getMultipleScreenLayoutSummary(
|
||||
@RequestBody Map<String, Object> body,
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
try {
|
||||
@SuppressWarnings("unchecked")
|
||||
List<Integer> screenIds = (List<Integer>) body.get("screenIds");
|
||||
List<Integer> screenIds = (List<Integer>) body.get("screen_ids");
|
||||
return ResponseEntity.ok(ApiResponse.success(
|
||||
service.getMultipleScreenLayoutSummary(screenIds)));
|
||||
} catch (Exception e) {
|
||||
@@ -525,10 +525,10 @@ public class ScreenGroupController {
|
||||
@PostMapping("/sub-tables/batch")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getScreenSubTables(
|
||||
@RequestBody Map<String, Object> body,
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
try {
|
||||
@SuppressWarnings("unchecked")
|
||||
List<Integer> screenIds = (List<Integer>) body.get("screenIds");
|
||||
List<Integer> screenIds = (List<Integer>) body.get("screen_ids");
|
||||
return ResponseEntity.ok(ApiResponse.success(
|
||||
service.getScreenSubTables(screenIds)));
|
||||
} catch (Exception e) {
|
||||
@@ -546,7 +546,7 @@ public class ScreenGroupController {
|
||||
@GetMapping("/sync/status")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getSyncStatus(
|
||||
@RequestParam(required = false) String filterCompanyCode,
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
try {
|
||||
String effectiveCompanyCode = ("*".equals(companyCode) && filterCompanyCode != null)
|
||||
? filterCompanyCode : companyCode;
|
||||
@@ -562,12 +562,12 @@ public class ScreenGroupController {
|
||||
@PostMapping("/sync/screen-to-menu")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> syncScreenGroupsToMenu(
|
||||
@RequestBody(required = false) Map<String, Object> body,
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId) {
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId) {
|
||||
try {
|
||||
String targetCompanyCode = companyCode;
|
||||
if (body != null && body.get("companyCode") != null) {
|
||||
targetCompanyCode = (String) body.get("companyCode");
|
||||
if (body != null && body.get("company_code") != null) {
|
||||
targetCompanyCode = (String) body.get("company_code");
|
||||
}
|
||||
Map<String, Object> result = service.syncScreenGroupsToMenu(targetCompanyCode, userId);
|
||||
return ResponseEntity.ok(ApiResponse.success(result));
|
||||
@@ -582,12 +582,12 @@ public class ScreenGroupController {
|
||||
@PostMapping("/sync/menu-to-screen")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> syncMenuToScreenGroups(
|
||||
@RequestBody(required = false) Map<String, Object> body,
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId) {
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId) {
|
||||
try {
|
||||
String targetCompanyCode = companyCode;
|
||||
if (body != null && body.get("companyCode") != null) {
|
||||
targetCompanyCode = (String) body.get("companyCode");
|
||||
if (body != null && body.get("company_code") != null) {
|
||||
targetCompanyCode = (String) body.get("company_code");
|
||||
}
|
||||
Map<String, Object> result = service.syncMenuToScreenGroups(targetCompanyCode, userId);
|
||||
return ResponseEntity.ok(ApiResponse.success(result));
|
||||
@@ -601,7 +601,7 @@ public class ScreenGroupController {
|
||||
/** POST /api/screen-groups/sync/all */
|
||||
@PostMapping("/sync/all")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> syncAllCompanies(
|
||||
@RequestAttribute("userId") String userId) {
|
||||
@RequestAttribute("user_id") String userId) {
|
||||
try {
|
||||
return ResponseEntity.ok(ApiResponse.success(service.syncAllCompanies(userId)));
|
||||
} catch (Exception e) {
|
||||
@@ -619,12 +619,12 @@ public class ScreenGroupController {
|
||||
@GetMapping("/pop/groups")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getPopScreenGroups(
|
||||
@RequestParam(required = false) String filterCompanyCode,
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
try {
|
||||
String effectiveCompanyCode = ("*".equals(companyCode) && filterCompanyCode != null)
|
||||
? filterCompanyCode : companyCode;
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", effectiveCompanyCode);
|
||||
params.put("company_code", effectiveCompanyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(service.getPopScreenGroups(params)));
|
||||
} catch (Exception e) {
|
||||
log.error("POP 화면 그룹 목록 조회 실패", e);
|
||||
@@ -637,10 +637,10 @@ public class ScreenGroupController {
|
||||
@PostMapping("/pop/groups")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> createPopScreenGroup(
|
||||
@RequestBody Map<String, Object> body,
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId) {
|
||||
body.put("userCompanyCode", companyCode);
|
||||
body.put("userId", userId);
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId) {
|
||||
body.put("user_company_code", companyCode);
|
||||
body.put("user_id", userId);
|
||||
try {
|
||||
return ResponseEntity.status(HttpStatus.CREATED)
|
||||
.body(ApiResponse.success(service.createPopScreenGroup(body)));
|
||||
@@ -662,11 +662,11 @@ public class ScreenGroupController {
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> updatePopScreenGroup(
|
||||
@PathVariable Integer id,
|
||||
@RequestBody Map<String, Object> body,
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId) {
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId) {
|
||||
body.put("id", id);
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("userId", userId);
|
||||
body.put("company_code", companyCode);
|
||||
body.put("user_id", userId);
|
||||
try {
|
||||
return ResponseEntity.ok(ApiResponse.success(service.updatePopScreenGroup(body)));
|
||||
} catch (NoSuchElementException e) {
|
||||
@@ -686,12 +686,12 @@ public class ScreenGroupController {
|
||||
@DeleteMapping("/pop/groups/{id}")
|
||||
public ResponseEntity<ApiResponse<Void>> deletePopScreenGroup(
|
||||
@PathVariable Integer id,
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId) {
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("id", id);
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("userId", userId);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("user_id", userId);
|
||||
try {
|
||||
service.deletePopScreenGroup(params);
|
||||
return ResponseEntity.ok(ApiResponse.success(null, "POP 화면 그룹이 삭제되었습니다"));
|
||||
@@ -715,12 +715,12 @@ public class ScreenGroupController {
|
||||
@PostMapping("/pop/ensure-root")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> ensurePopRootGroup(
|
||||
@RequestBody(required = false) Map<String, Object> body,
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId) {
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId) {
|
||||
try {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("userId", userId);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("user_id", userId);
|
||||
if (body != null) params.putAll(body);
|
||||
Map<String, Object> result = service.ensurePopRootGroup(params);
|
||||
return ResponseEntity.ok(ApiResponse.success(result));
|
||||
|
||||
@@ -24,11 +24,11 @@ public class ScreenManagementController {
|
||||
|
||||
@GetMapping("/screens")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getScreens(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", params.getOrDefault("companyCode", companyCode));
|
||||
params.put("company_code", params.getOrDefault("company_code", companyCode));
|
||||
// 권한 확인: 최고 관리자가 아니면 자사 companyCode만 허용
|
||||
String targetCode = (String) params.get("companyCode");
|
||||
String targetCode = (String) params.get("company_code");
|
||||
if (!"*".equals(companyCode) && !companyCode.equals(targetCode)) {
|
||||
return ResponseEntity.status(403)
|
||||
.body(ApiResponse.error("다른 회사의 화면을 조회할 권한이 없습니다."));
|
||||
@@ -38,7 +38,7 @@ public class ScreenManagementController {
|
||||
|
||||
@GetMapping("/screens/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getScreen(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable("id") Integer screenId) {
|
||||
Map<String, Object> screen = service.getScreenById(screenId);
|
||||
if (screen == null) {
|
||||
@@ -49,7 +49,7 @@ public class ScreenManagementController {
|
||||
|
||||
@GetMapping("/screens/{id}/menu")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getScreenMenu(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable("id") Integer screenId) {
|
||||
Map<String, Object> menuInfo = service.getMenuByScreen(screenId, companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(menuInfo));
|
||||
@@ -59,8 +59,8 @@ public class ScreenManagementController {
|
||||
|
||||
@PostMapping("/screens")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> createScreen(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
try {
|
||||
Map<String, Object> screen = service.createScreen(body, companyCode, userId);
|
||||
@@ -75,8 +75,8 @@ public class ScreenManagementController {
|
||||
|
||||
@PutMapping("/screens/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> updateScreen(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@PathVariable("id") Integer screenId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
try {
|
||||
@@ -91,8 +91,8 @@ public class ScreenManagementController {
|
||||
|
||||
@PutMapping("/screens/{id}/info")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> updateScreenInfo(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@PathVariable("id") Integer screenId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
try {
|
||||
@@ -107,10 +107,10 @@ public class ScreenManagementController {
|
||||
|
||||
@PatchMapping("/screens/{screenId}/table-name")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> updateScreenTableName(
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@PathVariable Integer screenId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
String tableName = (String) body.get("tableName");
|
||||
String tableName = (String) body.get("table_name");
|
||||
Map<String, Object> screen = service.updateScreenTableName(screenId, tableName, userId);
|
||||
if (screen == null) return ResponseEntity.status(404).body(ApiResponse.error("화면을 찾을 수 없습니다."));
|
||||
return ResponseEntity.ok(ApiResponse.success(screen));
|
||||
@@ -120,7 +120,7 @@ public class ScreenManagementController {
|
||||
|
||||
@GetMapping("/screens/{id}/dependencies")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> checkScreenDependencies(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable("id") Integer screenId) {
|
||||
Map<String, Object> deps = service.checkScreenDependencies(screenId, companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(deps));
|
||||
@@ -128,7 +128,7 @@ public class ScreenManagementController {
|
||||
|
||||
@GetMapping("/screens/{id}/linked-modals")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> detectLinkedScreens(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable("id") Integer screenId) {
|
||||
List<Map<String, Object>> linked = service.detectLinkedScreens(screenId, companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(linked));
|
||||
@@ -138,8 +138,8 @@ public class ScreenManagementController {
|
||||
|
||||
@DeleteMapping("/screens/{id}")
|
||||
public ResponseEntity<ApiResponse<Void>> deleteScreen(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@PathVariable("id") Integer screenId,
|
||||
@RequestParam(required = false) String deleteReason) {
|
||||
try {
|
||||
@@ -153,11 +153,11 @@ public class ScreenManagementController {
|
||||
|
||||
@DeleteMapping("/screens/bulk/delete")
|
||||
public ResponseEntity<ApiResponse<Void>> bulkDeleteScreens(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
@SuppressWarnings("unchecked")
|
||||
List<Integer> screenIds = (List<Integer>) body.get("screenIds");
|
||||
List<Integer> screenIds = (List<Integer>) body.get("screen_ids");
|
||||
try {
|
||||
service.bulkSoftDeleteScreens(screenIds, userId, companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(null, screenIds.size() + "개 화면이 삭제되었습니다."));
|
||||
@@ -171,24 +171,24 @@ public class ScreenManagementController {
|
||||
|
||||
@PostMapping("/screens/check-duplicate-name")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> checkDuplicateScreenName(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
String screenName = (String) body.get("screenName");
|
||||
String targetCode = body.containsKey("companyCode") ? (String) body.get("companyCode") : companyCode;
|
||||
String screenName = (String) body.get("screen_name");
|
||||
String targetCode = body.containsKey("company_code") ? (String) body.get("company_code") : companyCode;
|
||||
boolean isDuplicate = service.checkDuplicateScreenName(screenName, targetCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(Map.of("isDuplicate", isDuplicate)));
|
||||
return ResponseEntity.ok(ApiResponse.success(Map.of("is_duplicate", isDuplicate)));
|
||||
}
|
||||
|
||||
// ─── 복사 ──────────────────────────────────────────────────
|
||||
|
||||
@PostMapping("/screens/{id}/copy")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> copyScreen(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@PathVariable("id") Integer screenId,
|
||||
@RequestBody(required = false) Map<String, Object> body) {
|
||||
try {
|
||||
String newName = body != null ? (String) body.get("newName") : null;
|
||||
String newName = body != null ? (String) body.get("new_name") : null;
|
||||
Map<String, Object> screen = service.copyScreen(screenId, newName, companyCode, userId);
|
||||
return ResponseEntity.status(201).body(ApiResponse.success(screen, "화면이 복사되었습니다."));
|
||||
} catch (IllegalArgumentException e) {
|
||||
@@ -201,8 +201,8 @@ public class ScreenManagementController {
|
||||
|
||||
@PostMapping("/screens/{id}/copy-with-modals")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> copyScreenWithModals(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@PathVariable("id") Integer screenId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
try {
|
||||
@@ -218,9 +218,9 @@ public class ScreenManagementController {
|
||||
|
||||
@GetMapping("/screens/trash/list")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getDeletedScreens(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
Map<String, Object> result = service.getDeletedScreens(params);
|
||||
@SuppressWarnings("unchecked")
|
||||
List<Map<String, Object>> list = (List<Map<String, Object>>) result.get("data");
|
||||
@@ -229,8 +229,8 @@ public class ScreenManagementController {
|
||||
|
||||
@PostMapping("/screens/{id}/restore")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> restoreScreen(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@PathVariable("id") Integer screenId) {
|
||||
try {
|
||||
Map<String, Object> screen = service.restoreScreen(screenId, userId, companyCode);
|
||||
@@ -261,7 +261,7 @@ public class ScreenManagementController {
|
||||
public ResponseEntity<ApiResponse<Void>> bulkPermanentDeleteScreens(
|
||||
@RequestBody Map<String, Object> body) {
|
||||
@SuppressWarnings("unchecked")
|
||||
List<Integer> screenIds = (List<Integer>) body.get("screenIds");
|
||||
List<Integer> screenIds = (List<Integer>) body.get("screen_ids");
|
||||
try {
|
||||
service.bulkPermanentDeleteScreens(screenIds);
|
||||
return ResponseEntity.ok(ApiResponse.success(null, screenIds.size() + "개 화면이 영구 삭제되었습니다."));
|
||||
@@ -278,7 +278,7 @@ public class ScreenManagementController {
|
||||
@PathVariable String companyCode) {
|
||||
try {
|
||||
String code = service.generateScreenCode(companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(Map.of("screenCode", code)));
|
||||
return ResponseEntity.ok(ApiResponse.success(Map.of("screen_code", code)));
|
||||
} catch (Exception e) {
|
||||
log.error("화면 코드 생성 실패", e);
|
||||
return ResponseEntity.status(500).body(ApiResponse.error("화면 코드 생성에 실패했습니다."));
|
||||
@@ -288,11 +288,11 @@ public class ScreenManagementController {
|
||||
@PostMapping("/generate-screen-codes")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> generateMultipleScreenCodes(
|
||||
@RequestBody Map<String, Object> body) {
|
||||
String companyCode = (String) body.get("companyCode");
|
||||
String companyCode = (String) body.get("company_code");
|
||||
int count = body.get("count") != null ? Integer.parseInt(body.get("count").toString()) : 1;
|
||||
try {
|
||||
List<String> codes = service.generateMultipleScreenCodes(companyCode, count);
|
||||
return ResponseEntity.ok(ApiResponse.success(Map.of("screenCodes", codes)));
|
||||
return ResponseEntity.ok(ApiResponse.success(Map.of("screen_codes", codes)));
|
||||
} catch (Exception e) {
|
||||
log.error("화면 코드 일괄 생성 실패", e);
|
||||
return ResponseEntity.status(500).body(ApiResponse.error("화면 코드 생성에 실패했습니다."));
|
||||
@@ -316,7 +316,7 @@ public class ScreenManagementController {
|
||||
|
||||
@GetMapping("/tables/{tableName}/columns")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getTableColumns(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String tableName) {
|
||||
return ResponseEntity.ok(ApiResponse.success(service.getTableColumns(tableName, companyCode)));
|
||||
}
|
||||
@@ -325,7 +325,7 @@ public class ScreenManagementController {
|
||||
|
||||
@PostMapping("/screens/{screenId}/layout")
|
||||
public ResponseEntity<ApiResponse<Void>> saveLayout(
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@PathVariable Integer screenId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
@SuppressWarnings("unchecked")
|
||||
@@ -342,14 +342,14 @@ public class ScreenManagementController {
|
||||
|
||||
@GetMapping("/screens/{screenId}/layout")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getLayout(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Integer screenId) {
|
||||
return ResponseEntity.ok(ApiResponse.success(service.getLayout(screenId, companyCode)));
|
||||
}
|
||||
|
||||
@GetMapping("/screens/{screenId}/layout-v1")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getLayoutV1(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Integer screenId) {
|
||||
Map<String, Object> result = service.getLayoutV1WithTransform(screenId, companyCode);
|
||||
if (result == null) {
|
||||
@@ -362,7 +362,7 @@ public class ScreenManagementController {
|
||||
|
||||
@GetMapping("/screens/{screenId}/layout-v2")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getLayoutV2(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Integer screenId,
|
||||
@RequestParam(required = false) Integer layerId) {
|
||||
Map<String, Object> layout = service.getLayoutV2(screenId, companyCode, layerId);
|
||||
@@ -371,8 +371,8 @@ public class ScreenManagementController {
|
||||
|
||||
@PostMapping("/screens/{screenId}/layout-v2")
|
||||
public ResponseEntity<ApiResponse<Void>> saveLayoutV2(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@PathVariable Integer screenId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
try {
|
||||
@@ -388,15 +388,15 @@ public class ScreenManagementController {
|
||||
|
||||
@GetMapping("/screens/{screenId}/layout-pop")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getLayoutPop(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Integer screenId) {
|
||||
return ResponseEntity.ok(ApiResponse.success(service.getLayoutPop(screenId, companyCode)));
|
||||
}
|
||||
|
||||
@PostMapping("/screens/{screenId}/layout-pop")
|
||||
public ResponseEntity<ApiResponse<Void>> saveLayoutPop(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@PathVariable Integer screenId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
try {
|
||||
@@ -410,7 +410,7 @@ public class ScreenManagementController {
|
||||
|
||||
@DeleteMapping("/screens/{screenId}/layout-pop")
|
||||
public ResponseEntity<ApiResponse<Void>> deleteLayoutPop(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Integer screenId) {
|
||||
service.deleteLayoutPop(screenId, companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(null, "POP 레이아웃이 삭제되었습니다."));
|
||||
@@ -418,7 +418,7 @@ public class ScreenManagementController {
|
||||
|
||||
@GetMapping("/pop-layout-screen-ids")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getScreenIdsWithPopLayout(
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
return ResponseEntity.ok(ApiResponse.success(service.getScreenIdsWithPopLayout(companyCode)));
|
||||
}
|
||||
|
||||
@@ -426,14 +426,14 @@ public class ScreenManagementController {
|
||||
|
||||
@GetMapping("/screens/{screenId}/layers")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getScreenLayers(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Integer screenId) {
|
||||
return ResponseEntity.ok(ApiResponse.success(service.getScreenLayers(screenId, companyCode)));
|
||||
}
|
||||
|
||||
@GetMapping("/screens/{screenId}/layers/{layerId}/layout")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getLayerLayout(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Integer screenId,
|
||||
@PathVariable Integer layerId) {
|
||||
Map<String, Object> layout = service.getLayerLayout(screenId, layerId, companyCode);
|
||||
@@ -442,7 +442,7 @@ public class ScreenManagementController {
|
||||
|
||||
@DeleteMapping("/screens/{screenId}/layers/{layerId}")
|
||||
public ResponseEntity<ApiResponse<Void>> deleteLayer(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Integer screenId,
|
||||
@PathVariable Integer layerId) {
|
||||
boolean deleted = service.deleteLayer(screenId, layerId, companyCode);
|
||||
@@ -452,7 +452,7 @@ public class ScreenManagementController {
|
||||
|
||||
@PutMapping("/screens/{screenId}/layers/{layerId}/condition")
|
||||
public ResponseEntity<ApiResponse<Void>> updateLayerCondition(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Integer screenId,
|
||||
@PathVariable Integer layerId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
@@ -464,14 +464,14 @@ public class ScreenManagementController {
|
||||
|
||||
@GetMapping("/screens/{screenId}/zones")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getScreenZones(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Integer screenId) {
|
||||
return ResponseEntity.ok(ApiResponse.success(service.getScreenZones(screenId, companyCode)));
|
||||
}
|
||||
|
||||
@PostMapping("/screens/{screenId}/zones")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> createZone(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Integer screenId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
try {
|
||||
@@ -485,7 +485,7 @@ public class ScreenManagementController {
|
||||
|
||||
@PutMapping("/zones/{zoneId}")
|
||||
public ResponseEntity<ApiResponse<Void>> updateZone(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Integer zoneId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
boolean updated = service.updateZone(zoneId, body, companyCode);
|
||||
@@ -495,7 +495,7 @@ public class ScreenManagementController {
|
||||
|
||||
@DeleteMapping("/zones/{zoneId}")
|
||||
public ResponseEntity<ApiResponse<Void>> deleteZone(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Integer zoneId) {
|
||||
boolean deleted = service.deleteZone(zoneId, companyCode);
|
||||
if (!deleted) return ResponseEntity.status(404).body(ApiResponse.error("Zone을 찾을 수 없습니다."));
|
||||
@@ -504,7 +504,7 @@ public class ScreenManagementController {
|
||||
|
||||
@PostMapping("/screens/{screenId}/zones/{zoneId}/layers")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> addLayerToZone(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Integer screenId,
|
||||
@PathVariable Integer zoneId,
|
||||
@RequestBody(required = false) Map<String, Object> body) {
|
||||
@@ -522,8 +522,8 @@ public class ScreenManagementController {
|
||||
|
||||
@PostMapping("/screens/{screenId}/assign-menu")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> assignScreenToMenu(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@PathVariable Integer screenId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
try {
|
||||
@@ -539,14 +539,14 @@ public class ScreenManagementController {
|
||||
|
||||
@GetMapping("/menus/{menuObjid}/screens")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getScreensByMenu(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Integer menuObjid) {
|
||||
return ResponseEntity.ok(ApiResponse.success(service.getScreensByMenu(menuObjid, companyCode)));
|
||||
}
|
||||
|
||||
@DeleteMapping("/screens/{screenId}/menus/{menuObjid}")
|
||||
public ResponseEntity<ApiResponse<Void>> unassignScreenFromMenu(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Integer screenId,
|
||||
@PathVariable Integer menuObjid) {
|
||||
try {
|
||||
@@ -644,14 +644,14 @@ public class ScreenManagementController {
|
||||
|
||||
@GetMapping("/screens/{screenId}/pop-links")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> analyzePopScreenLinks(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Integer screenId) {
|
||||
return ResponseEntity.ok(ApiResponse.success(service.analyzePopScreenLinks(screenId, companyCode)));
|
||||
}
|
||||
|
||||
@PostMapping("/deploy-pop-screens")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> deployPopScreens(
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
try {
|
||||
Map<String, Object> result = service.deployPopScreens(body, userId);
|
||||
|
||||
@@ -21,59 +21,59 @@ public class ShippingOrderController {
|
||||
|
||||
@GetMapping("/list")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getList(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(shippingOrderService.getShippingOrderList(params)));
|
||||
}
|
||||
|
||||
@GetMapping("/preview-no")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> previewNextNo(
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(shippingOrderService.previewNextNo(params)));
|
||||
}
|
||||
|
||||
@PostMapping("/save")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> save(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("userId", userId);
|
||||
body.put("company_code", companyCode);
|
||||
body.put("user_id", userId);
|
||||
return ResponseEntity.ok(ApiResponse.success(shippingOrderService.save(body)));
|
||||
}
|
||||
|
||||
@PostMapping("/delete")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> remove(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(shippingOrderService.remove(body)));
|
||||
}
|
||||
|
||||
@GetMapping("/source/shipment-plan")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getShipmentPlanSource(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(shippingOrderService.getShipmentPlanSource(params)));
|
||||
}
|
||||
|
||||
@GetMapping("/source/sales-order")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getSalesOrderSource(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(shippingOrderService.getSalesOrderSource(params)));
|
||||
}
|
||||
|
||||
@GetMapping("/source/item")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getItemSource(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(shippingOrderService.getItemSource(params)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,66 +19,66 @@ public class ShippingPlanController {
|
||||
|
||||
@GetMapping("/list")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getShippingPlanList(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(shippingPlanService.getShippingPlanList(params)));
|
||||
}
|
||||
|
||||
@GetMapping("/aggregate")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getAggregate(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(shippingPlanService.getAggregate(params)));
|
||||
}
|
||||
|
||||
@GetMapping("/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getShippingPlanInfo(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long id) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("id", id);
|
||||
return ResponseEntity.ok(ApiResponse.success(shippingPlanService.getShippingPlanInfo(params)));
|
||||
}
|
||||
|
||||
@PostMapping("/batch")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> batchSave(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("userId", userId);
|
||||
body.put("company_code", companyCode);
|
||||
body.put("user_id", userId);
|
||||
return ResponseEntity.ok(ApiResponse.success(shippingPlanService.batchSave(body)));
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> insertShippingPlan(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(shippingPlanService.insertShippingPlan(body)));
|
||||
}
|
||||
|
||||
@PutMapping("/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> updateShippingPlan(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@PathVariable Long id,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("updatedBy", userId);
|
||||
body.put("company_code", companyCode);
|
||||
body.put("updated_by", userId);
|
||||
body.put("id", id);
|
||||
return ResponseEntity.ok(ApiResponse.success(shippingPlanService.updateShippingPlan(body)));
|
||||
}
|
||||
|
||||
@DeleteMapping("/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> deleteShippingPlan(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long id) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("id", id);
|
||||
return ResponseEntity.ok(ApiResponse.success(shippingPlanService.deleteShippingPlan(params)));
|
||||
}
|
||||
|
||||
@@ -26,9 +26,9 @@ public class SystemNoticeController {
|
||||
*/
|
||||
@GetMapping
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getSystemNoticeList(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> queryParams) {
|
||||
queryParams.put("companyCode", companyCode);
|
||||
queryParams.put("company_code", companyCode);
|
||||
List<Map<String, Object>> list = systemNoticeService.getSystemNoticeList(queryParams);
|
||||
return ResponseEntity.ok(ApiResponse.success(list));
|
||||
}
|
||||
@@ -40,8 +40,8 @@ public class SystemNoticeController {
|
||||
@PostMapping
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> insertSystemNotice(
|
||||
@RequestBody Map<String, Object> body,
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId) {
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId) {
|
||||
|
||||
String title = (String) body.get("title");
|
||||
String content = (String) body.get("content");
|
||||
@@ -54,8 +54,8 @@ public class SystemNoticeController {
|
||||
}
|
||||
|
||||
Map<String, Object> params = new HashMap<>(body);
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("createdBy", userId);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("created_by", userId);
|
||||
|
||||
try {
|
||||
Map<String, Object> created = systemNoticeService.insertSystemNotice(params);
|
||||
@@ -75,7 +75,7 @@ public class SystemNoticeController {
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> updateSystemNotice(
|
||||
@PathVariable Long id,
|
||||
@RequestBody Map<String, Object> body,
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
|
||||
String title = (String) body.get("title");
|
||||
String content = (String) body.get("content");
|
||||
@@ -89,7 +89,7 @@ public class SystemNoticeController {
|
||||
|
||||
Map<String, Object> params = new HashMap<>(body);
|
||||
params.put("id", id);
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
|
||||
try {
|
||||
Map<String, Object> updated = systemNoticeService.updateSystemNotice(params);
|
||||
@@ -109,11 +109,11 @@ public class SystemNoticeController {
|
||||
@DeleteMapping("/{id}")
|
||||
public ResponseEntity<ApiResponse<Void>> deleteSystemNotice(
|
||||
@PathVariable Long id,
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("id", id);
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
|
||||
try {
|
||||
systemNoticeService.deleteSystemNotice(params);
|
||||
|
||||
@@ -27,10 +27,10 @@ public class TableCategoryValueController {
|
||||
/** GET /api/table-categories/all-columns */
|
||||
@GetMapping("/all-columns")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getAllCategoryColumns(
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
try {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(service.getAllCategoryColumns(params)));
|
||||
} catch (Exception e) {
|
||||
log.error("전체 카테고리 컬럼 조회 실패", e);
|
||||
@@ -43,11 +43,11 @@ public class TableCategoryValueController {
|
||||
@GetMapping("/{tableName}/columns")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getCategoryColumns(
|
||||
@PathVariable String tableName,
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
try {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("tableName", tableName);
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("table_name", tableName);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(service.getCategoryColumns(params)));
|
||||
} catch (Exception e) {
|
||||
log.error("카테고리 컬럼 조회 실패: tableName={}", tableName, e);
|
||||
@@ -68,18 +68,18 @@ public class TableCategoryValueController {
|
||||
@RequestParam(required = false) String menuObjid,
|
||||
@RequestParam(required = false, defaultValue = "false") boolean includeInactive,
|
||||
@RequestParam(required = false) String filterCompanyCode,
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
try {
|
||||
// SUPER_ADMIN 이 특정 회사 기준 필터링 요청 시 해당 companyCode 사용
|
||||
String effectiveCompanyCode = ("*".equals(companyCode) && filterCompanyCode != null)
|
||||
? filterCompanyCode : companyCode;
|
||||
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("tableName", tableName);
|
||||
params.put("columnName", columnName);
|
||||
params.put("companyCode", effectiveCompanyCode);
|
||||
params.put("includeInactive", includeInactive);
|
||||
if (menuObjid != null) params.put("menuObjid", Long.parseLong(menuObjid));
|
||||
params.put("table_name", tableName);
|
||||
params.put("column_name", columnName);
|
||||
params.put("company_code", effectiveCompanyCode);
|
||||
params.put("include_inactive", includeInactive);
|
||||
if (menuObjid != null) params.put("menu_objid", Long.parseLong(menuObjid));
|
||||
|
||||
return ResponseEntity.ok(ApiResponse.success(service.getCategoryValues(params)));
|
||||
} catch (Exception e) {
|
||||
@@ -97,13 +97,13 @@ public class TableCategoryValueController {
|
||||
@PostMapping("/values")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> addCategoryValue(
|
||||
@RequestBody Map<String, Object> body,
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId) {
|
||||
if (body.get("menuObjid") == null) {
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId) {
|
||||
if (body.get("menu_objid") == null) {
|
||||
return ResponseEntity.status(400).body(ApiResponse.error("menuObjid는 필수입니다"));
|
||||
}
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("userId", userId);
|
||||
body.put("company_code", companyCode);
|
||||
body.put("user_id", userId);
|
||||
try {
|
||||
return ResponseEntity.status(HttpStatus.CREATED)
|
||||
.body(ApiResponse.success(service.addCategoryValue(body)));
|
||||
@@ -121,11 +121,11 @@ public class TableCategoryValueController {
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> updateCategoryValue(
|
||||
@PathVariable Long valueId,
|
||||
@RequestBody Map<String, Object> body,
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId) {
|
||||
body.put("valueId", valueId);
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("userId", userId);
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId) {
|
||||
body.put("value_id", valueId);
|
||||
body.put("company_code", companyCode);
|
||||
body.put("user_id", userId);
|
||||
try {
|
||||
return ResponseEntity.ok(ApiResponse.success(service.updateCategoryValue(body)));
|
||||
} catch (IllegalArgumentException e) {
|
||||
@@ -140,12 +140,12 @@ public class TableCategoryValueController {
|
||||
@DeleteMapping("/values/{valueId}")
|
||||
public ResponseEntity<ApiResponse<Void>> deleteCategoryValue(
|
||||
@PathVariable Long valueId,
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId) {
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("valueId", valueId);
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("userId", userId);
|
||||
params.put("value_id", valueId);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("user_id", userId);
|
||||
try {
|
||||
service.deleteCategoryValue(params);
|
||||
return ResponseEntity.ok(ApiResponse.success(null, "카테고리 값이 삭제되었습니다"));
|
||||
@@ -166,14 +166,14 @@ public class TableCategoryValueController {
|
||||
@PostMapping("/values/bulk-delete")
|
||||
public ResponseEntity<ApiResponse<Void>> bulkDeleteCategoryValues(
|
||||
@RequestBody Map<String, Object> body,
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId) {
|
||||
Object rawIds = body.get("valueIds");
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId) {
|
||||
Object rawIds = body.get("value_ids");
|
||||
if (!(rawIds instanceof List) || ((List<?>) rawIds).isEmpty()) {
|
||||
return ResponseEntity.status(400).body(ApiResponse.error("삭제할 값 ID 목록이 필요합니다"));
|
||||
}
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("userId", userId);
|
||||
body.put("company_code", companyCode);
|
||||
body.put("user_id", userId);
|
||||
try {
|
||||
service.bulkDeleteCategoryValues(body);
|
||||
int count = ((List<?>) rawIds).size();
|
||||
@@ -189,12 +189,12 @@ public class TableCategoryValueController {
|
||||
@PostMapping("/values/reorder")
|
||||
public ResponseEntity<ApiResponse<Void>> reorderCategoryValues(
|
||||
@RequestBody Map<String, Object> body,
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
Object rawIds = body.get("orderedValueIds");
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
Object rawIds = body.get("ordered_value_ids");
|
||||
if (!(rawIds instanceof List) || ((List<?>) rawIds).isEmpty()) {
|
||||
return ResponseEntity.status(400).body(ApiResponse.error("순서 정보가 필요합니다"));
|
||||
}
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
try {
|
||||
service.reorderCategoryValues(body);
|
||||
return ResponseEntity.ok(ApiResponse.success(null, "카테고리 값 순서가 변경되었습니다"));
|
||||
@@ -212,12 +212,12 @@ public class TableCategoryValueController {
|
||||
@PostMapping("/labels-by-codes")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getCategoryLabelsByCodes(
|
||||
@RequestBody Map<String, Object> body,
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
Object rawCodes = body.get("valueCodes");
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
Object rawCodes = body.get("value_codes");
|
||||
if (!(rawCodes instanceof List) || ((List<?>) rawCodes).isEmpty()) {
|
||||
return ResponseEntity.ok(ApiResponse.success(new java.util.LinkedHashMap<>()));
|
||||
}
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
try {
|
||||
return ResponseEntity.ok(ApiResponse.success(service.getCategoryLabelsByCodes(body)));
|
||||
} catch (Exception e) {
|
||||
@@ -233,10 +233,10 @@ public class TableCategoryValueController {
|
||||
/** GET /api/table-categories/second-level-menus */
|
||||
@GetMapping("/second-level-menus")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getSecondLevelMenus(
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
try {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(service.getSecondLevelMenus(params)));
|
||||
} catch (Exception e) {
|
||||
log.error("2레벨 메뉴 목록 조회 실패", e);
|
||||
@@ -253,12 +253,12 @@ public class TableCategoryValueController {
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getColumnMapping(
|
||||
@PathVariable String tableName,
|
||||
@PathVariable Long menuObjid,
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
try {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("tableName", tableName);
|
||||
params.put("menuObjid", menuObjid);
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("table_name", tableName);
|
||||
params.put("menu_objid", menuObjid);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(service.getColumnMapping(params)));
|
||||
} catch (Exception e) {
|
||||
log.error("컬럼 매핑 조회 실패: tableName={}, menuObjid={}", tableName, menuObjid, e);
|
||||
@@ -271,12 +271,12 @@ public class TableCategoryValueController {
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getLogicalColumns(
|
||||
@PathVariable String tableName,
|
||||
@PathVariable Long menuObjid,
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
try {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("tableName", tableName);
|
||||
params.put("menuObjid", menuObjid);
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("table_name", tableName);
|
||||
params.put("menu_objid", menuObjid);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(service.getLogicalColumns(params)));
|
||||
} catch (Exception e) {
|
||||
log.error("논리적 컬럼 목록 조회 실패: tableName={}, menuObjid={}", tableName, menuObjid, e);
|
||||
@@ -288,12 +288,12 @@ public class TableCategoryValueController {
|
||||
@PostMapping("/column-mapping")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> createColumnMapping(
|
||||
@RequestBody Map<String, Object> body,
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId) {
|
||||
String tableName = (String) body.get("tableName");
|
||||
String logicalColumnName = (String) body.get("logicalColumnName");
|
||||
String physicalColumnName = (String) body.get("physicalColumnName");
|
||||
Object menuObjid = body.get("menuObjid");
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId) {
|
||||
String tableName = (String) body.get("table_name");
|
||||
String logicalColumnName = (String) body.get("logical_column_name");
|
||||
String physicalColumnName = (String) body.get("physical_column_name");
|
||||
Object menuObjid = body.get("menu_objid");
|
||||
|
||||
if (tableName == null || logicalColumnName == null
|
||||
|| physicalColumnName == null || menuObjid == null) {
|
||||
@@ -301,10 +301,10 @@ public class TableCategoryValueController {
|
||||
"tableName, logicalColumnName, physicalColumnName, menuObjid는 필수입니다"));
|
||||
}
|
||||
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("userId", userId);
|
||||
body.put("company_code", companyCode);
|
||||
body.put("user_id", userId);
|
||||
// menuObjid를 Long으로 보장
|
||||
body.put("menuObjid", toLong(menuObjid));
|
||||
body.put("menu_objid", toLong(menuObjid));
|
||||
|
||||
try {
|
||||
return ResponseEntity.status(HttpStatus.CREATED)
|
||||
@@ -326,15 +326,15 @@ public class TableCategoryValueController {
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> deleteColumnMappingsByColumn(
|
||||
@PathVariable String tableName,
|
||||
@PathVariable String columnName,
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
try {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("tableName", tableName);
|
||||
params.put("columnName", columnName);
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("table_name", tableName);
|
||||
params.put("column_name", columnName);
|
||||
params.put("company_code", companyCode);
|
||||
int deleted = service.deleteColumnMappingsByColumn(params);
|
||||
Map<String, Object> data = new HashMap<>();
|
||||
data.put("deletedCount", deleted);
|
||||
data.put("deleted_count", deleted);
|
||||
return ResponseEntity.ok(ApiResponse.success(data,
|
||||
deleted + "개의 컬럼 매핑이 삭제되었습니다"));
|
||||
} catch (Exception e) {
|
||||
@@ -347,10 +347,10 @@ public class TableCategoryValueController {
|
||||
@DeleteMapping("/column-mapping/{mappingId}")
|
||||
public ResponseEntity<ApiResponse<Void>> deleteColumnMapping(
|
||||
@PathVariable Long mappingId,
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("mappingId", mappingId);
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("mapping_id", mappingId);
|
||||
params.put("company_code", companyCode);
|
||||
try {
|
||||
service.deleteColumnMapping(params);
|
||||
return ResponseEntity.ok(ApiResponse.success(null, "컬럼 매핑이 삭제되었습니다"));
|
||||
|
||||
@@ -29,12 +29,12 @@ public class TableHistoryController {
|
||||
*/
|
||||
@GetMapping("/{tableName}/check")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> checkHistoryTableExists(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String tableName) {
|
||||
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("tableName", tableName);
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("table_name", tableName);
|
||||
params.put("company_code", companyCode);
|
||||
|
||||
Map<String, Object> data = tableHistoryService.checkHistoryTableExists(params);
|
||||
String message = (String) data.remove("_message");
|
||||
@@ -47,12 +47,12 @@ public class TableHistoryController {
|
||||
*/
|
||||
@GetMapping("/{tableName}/summary")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getTableHistorySummary(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String tableName) {
|
||||
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("tableName", tableName);
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("table_name", tableName);
|
||||
params.put("company_code", companyCode);
|
||||
|
||||
try {
|
||||
List<Map<String, Object>> data = tableHistoryService.getTableHistorySummary(params);
|
||||
@@ -71,12 +71,12 @@ public class TableHistoryController {
|
||||
*/
|
||||
@GetMapping("/{tableName}/all")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getAllTableHistory(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String tableName,
|
||||
@RequestParam Map<String, Object> queryParams) {
|
||||
|
||||
queryParams.put("tableName", tableName);
|
||||
queryParams.put("companyCode", companyCode);
|
||||
queryParams.put("table_name", tableName);
|
||||
queryParams.put("company_code", companyCode);
|
||||
|
||||
try {
|
||||
Map<String, Object> data = tableHistoryService.getAllTableHistory(queryParams);
|
||||
@@ -95,14 +95,14 @@ public class TableHistoryController {
|
||||
*/
|
||||
@GetMapping("/{tableName}/{recordId}/timeline")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getRecordTimeline(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String tableName,
|
||||
@PathVariable String recordId) {
|
||||
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("tableName", tableName);
|
||||
params.put("recordId", recordId);
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("table_name", tableName);
|
||||
params.put("record_id", recordId);
|
||||
params.put("company_code", companyCode);
|
||||
|
||||
try {
|
||||
List<Map<String, Object>> data = tableHistoryService.getRecordTimeline(params);
|
||||
@@ -121,14 +121,14 @@ public class TableHistoryController {
|
||||
*/
|
||||
@GetMapping("/{tableName}/{recordId}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getRecordHistory(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String tableName,
|
||||
@PathVariable String recordId,
|
||||
@RequestParam Map<String, Object> queryParams) {
|
||||
|
||||
queryParams.put("tableName", tableName);
|
||||
queryParams.put("recordId", recordId);
|
||||
queryParams.put("companyCode", companyCode);
|
||||
queryParams.put("table_name", tableName);
|
||||
queryParams.put("record_id", recordId);
|
||||
queryParams.put("company_code", companyCode);
|
||||
|
||||
try {
|
||||
Map<String, Object> data = tableHistoryService.getRecordHistory(queryParams);
|
||||
|
||||
@@ -38,7 +38,7 @@ public class TableManagementController {
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getTableEntityRelations(
|
||||
@RequestParam String leftTable,
|
||||
@RequestParam String rightTable,
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
return ResponseEntity.ok(ApiResponse.success(
|
||||
tableManagementService.getTableEntityRelations(leftTable, rightTable, companyCode)));
|
||||
}
|
||||
@@ -53,7 +53,7 @@ public class TableManagementController {
|
||||
@PathVariable String tableName,
|
||||
@RequestParam(defaultValue = "1") int page,
|
||||
@RequestParam(defaultValue = "50") int size,
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
return ResponseEntity.ok(ApiResponse.success(
|
||||
tableManagementService.getColumnList(tableName, page, size, companyCode),
|
||||
"컬럼 목록을 성공적으로 조회했습니다."));
|
||||
@@ -76,7 +76,7 @@ public class TableManagementController {
|
||||
public ResponseEntity<ApiResponse<Void>> updateTableLabel(
|
||||
@PathVariable String tableName,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
String displayName = (String) body.get("displayName");
|
||||
String displayName = (String) body.get("display_name");
|
||||
String description = (String) body.get("description");
|
||||
if (displayName == null || displayName.isBlank()) {
|
||||
return ResponseEntity.status(400).body(ApiResponse.error("표시명이 필요합니다."));
|
||||
@@ -105,7 +105,7 @@ public class TableManagementController {
|
||||
@PathVariable String tableName,
|
||||
@PathVariable String columnName,
|
||||
@RequestBody Map<String, Object> settings,
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
return doUpdateColumnSettings(tableName, columnName, settings, companyCode);
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@ public class TableManagementController {
|
||||
@PathVariable String tableName,
|
||||
@PathVariable String columnName,
|
||||
@RequestBody Map<String, Object> settings,
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
return doUpdateColumnSettings(tableName, columnName, settings, companyCode);
|
||||
}
|
||||
|
||||
@@ -136,7 +136,7 @@ public class TableManagementController {
|
||||
public ResponseEntity<ApiResponse<Void>> updateAllColumnSettingsPost(
|
||||
@PathVariable String tableName,
|
||||
@RequestBody List<Map<String, Object>> columnSettings,
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
return doUpdateAllColumnSettings(tableName, columnSettings, companyCode);
|
||||
}
|
||||
|
||||
@@ -145,7 +145,7 @@ public class TableManagementController {
|
||||
public ResponseEntity<ApiResponse<Void>> updateAllColumnSettingsBatch(
|
||||
@PathVariable String tableName,
|
||||
@RequestBody List<Map<String, Object>> columnSettings,
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
return doUpdateAllColumnSettings(tableName, columnSettings, companyCode);
|
||||
}
|
||||
|
||||
@@ -167,12 +167,12 @@ public class TableManagementController {
|
||||
@PathVariable String tableName,
|
||||
@PathVariable String columnName,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
String webType = (String) body.get("webType");
|
||||
String webType = (String) body.get("web_type");
|
||||
if (webType == null || webType.isBlank()) {
|
||||
return ResponseEntity.status(400).body(ApiResponse.error("웹 타입이 필요합니다."));
|
||||
}
|
||||
@SuppressWarnings("unchecked")
|
||||
Map<String, Object> detailSettings = (Map<String, Object>) body.get("detailSettings");
|
||||
Map<String, Object> detailSettings = (Map<String, Object>) body.get("detail_settings");
|
||||
tableManagementService.updateColumnWebType(tableName, columnName, webType, detailSettings);
|
||||
return ResponseEntity.ok(ApiResponse.success(null, "컬럼 웹타입이 설정되었습니다."));
|
||||
}
|
||||
@@ -183,13 +183,13 @@ public class TableManagementController {
|
||||
@PathVariable String tableName,
|
||||
@PathVariable String columnName,
|
||||
@RequestBody Map<String, Object> body,
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
String inputType = (String) body.get("inputType");
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
String inputType = (String) body.get("input_type");
|
||||
if (tableName == null || columnName == null || inputType == null || inputType.isBlank()) {
|
||||
return ResponseEntity.status(400).body(ApiResponse.error("테이블명, 컬럼명, 입력 타입이 모두 필요합니다."));
|
||||
}
|
||||
@SuppressWarnings("unchecked")
|
||||
Map<String, Object> detailSettings = (Map<String, Object>) body.get("detailSettings");
|
||||
Map<String, Object> detailSettings = (Map<String, Object>) body.get("detail_settings");
|
||||
tableManagementService.updateColumnInputType(tableName, columnName, inputType, companyCode, detailSettings);
|
||||
return ResponseEntity.ok(ApiResponse.success(null, "컬럼 입력 타입이 성공적으로 설정되었습니다."));
|
||||
}
|
||||
@@ -219,7 +219,7 @@ public class TableManagementController {
|
||||
@GetMapping("/tables/{tableName}/web-types")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getColumnWebTypes(
|
||||
@PathVariable String tableName,
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
return ResponseEntity.ok(ApiResponse.success(
|
||||
tableManagementService.getColumnInputTypes(tableName, companyCode),
|
||||
"컬럼 입력타입 정보를 성공적으로 조회했습니다."));
|
||||
@@ -257,8 +257,8 @@ public class TableManagementController {
|
||||
public ResponseEntity<ApiResponse<Void>> toggleTableIndex(
|
||||
@PathVariable String tableName,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
String columnName = (String) body.get("columnName");
|
||||
String indexType = (String) body.get("indexType");
|
||||
String columnName = (String) body.get("column_name");
|
||||
String indexType = (String) body.get("index_type");
|
||||
String action = (String) body.get("action");
|
||||
if (tableName == null || columnName == null || indexType == null || action == null) {
|
||||
return ResponseEntity.status(400).body(ApiResponse.error(
|
||||
@@ -281,7 +281,7 @@ public class TableManagementController {
|
||||
@PathVariable String tableName,
|
||||
@PathVariable String columnName,
|
||||
@RequestBody Map<String, Object> body,
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
Object nullableObj = body.get("nullable");
|
||||
if (tableName == null || columnName == null || !(nullableObj instanceof Boolean)) {
|
||||
return ResponseEntity.status(400).body(ApiResponse.error("tableName, columnName, nullable(boolean)이 필요합니다."));
|
||||
@@ -299,7 +299,7 @@ public class TableManagementController {
|
||||
@PathVariable String tableName,
|
||||
@PathVariable String columnName,
|
||||
@RequestBody Map<String, Object> body,
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
Object uniqueObj = body.get("unique");
|
||||
if (tableName == null || columnName == null || !(uniqueObj instanceof Boolean)) {
|
||||
return ResponseEntity.status(400).body(ApiResponse.error("tableName, columnName, unique(boolean)이 필요합니다."));
|
||||
@@ -330,9 +330,9 @@ public class TableManagementController {
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getTableRecord(
|
||||
@PathVariable String tableName,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
String filterColumn = (String) body.get("filterColumn");
|
||||
Object filterValue = body.get("filterValue");
|
||||
String displayColumn = (String) body.get("displayColumn");
|
||||
String filterColumn = (String) body.get("filter_column");
|
||||
Object filterValue = body.get("filter_value");
|
||||
String displayColumn = (String) body.get("display_column");
|
||||
|
||||
if (filterColumn == null || filterValue == null) {
|
||||
return ResponseEntity.status(400).body(ApiResponse.error(
|
||||
@@ -366,7 +366,7 @@ public class TableManagementController {
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> addTableData(
|
||||
@PathVariable String tableName,
|
||||
@RequestBody Map<String, Object> data,
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
if (data == null || data.isEmpty()) {
|
||||
return ResponseEntity.status(400).body(ApiResponse.error("추가할 데이터가 필요합니다."));
|
||||
}
|
||||
@@ -390,7 +390,7 @@ public class TableManagementController {
|
||||
|
||||
Map<String, Object> result = tableManagementService.addTableData(tableName, data);
|
||||
return ResponseEntity.status(201).body(ApiResponse.success(
|
||||
Map.of("id", result.getOrDefault("insertedId", "")),
|
||||
Map.of("id", result.getOrDefault("inserted_id", "")),
|
||||
"테이블 데이터를 성공적으로 추가했습니다."));
|
||||
}
|
||||
|
||||
@@ -399,11 +399,11 @@ public class TableManagementController {
|
||||
public ResponseEntity<ApiResponse<Void>> editTableData(
|
||||
@PathVariable String tableName,
|
||||
@RequestBody Map<String, Object> body,
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
@SuppressWarnings("unchecked")
|
||||
Map<String, Object> originalData = (Map<String, Object>) body.get("originalData");
|
||||
Map<String, Object> originalData = (Map<String, Object>) body.get("original_data");
|
||||
@SuppressWarnings("unchecked")
|
||||
Map<String, Object> updatedData = (Map<String, Object>) body.get("updatedData");
|
||||
Map<String, Object> updatedData = (Map<String, Object>) body.get("updated_data");
|
||||
|
||||
if (originalData == null || updatedData == null) {
|
||||
return ResponseEntity.status(400).body(ApiResponse.error("원본 데이터와 수정할 데이터가 모두 필요합니다."));
|
||||
@@ -459,8 +459,8 @@ public class TableManagementController {
|
||||
@PathVariable String tableName,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
@SuppressWarnings("unchecked")
|
||||
List<String> logColumns = (List<String>) body.get("logColumns");
|
||||
boolean isActive = Boolean.TRUE.equals(body.get("isActive"));
|
||||
List<String> logColumns = (List<String>) body.get("log_columns");
|
||||
boolean isActive = Boolean.TRUE.equals(body.get("is_active"));
|
||||
tableManagementService.createLogTable(tableName, logColumns, isActive);
|
||||
return ResponseEntity.ok(ApiResponse.success(null, "로그 테이블이 생성되었습니다."));
|
||||
}
|
||||
@@ -488,7 +488,7 @@ public class TableManagementController {
|
||||
public ResponseEntity<ApiResponse<Void>> toggleLogTable(
|
||||
@PathVariable String tableName,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
boolean isActive = Boolean.TRUE.equals(body.get("isActive"));
|
||||
boolean isActive = Boolean.TRUE.equals(body.get("is_active"));
|
||||
tableManagementService.toggleLogTable(tableName, isActive);
|
||||
return ResponseEntity.ok(ApiResponse.success(null,
|
||||
isActive ? "로그가 활성화되었습니다." : "로그가 비활성화되었습니다."));
|
||||
@@ -501,7 +501,7 @@ public class TableManagementController {
|
||||
/** GET /api/table-management/category-columns */
|
||||
@GetMapping("/category-columns")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getCategoryColumnsByCompany(
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
return ResponseEntity.ok(ApiResponse.success(
|
||||
tableManagementService.getCategoryColumnsByCompany(companyCode)));
|
||||
}
|
||||
@@ -509,7 +509,7 @@ public class TableManagementController {
|
||||
/** GET /api/table-management/numbering-columns */
|
||||
@GetMapping("/numbering-columns")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getNumberingColumnsByCompany(
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
return ResponseEntity.ok(ApiResponse.success(
|
||||
tableManagementService.getNumberingColumnsByCompany(companyCode)));
|
||||
}
|
||||
@@ -518,7 +518,7 @@ public class TableManagementController {
|
||||
@GetMapping("/menu/{menuObjid}/category-columns")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getCategoryColumnsByMenu(
|
||||
@PathVariable String menuObjid,
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
return ResponseEntity.ok(ApiResponse.success(
|
||||
tableManagementService.getCategoryColumnsByMenu(companyCode, menuObjid)));
|
||||
}
|
||||
@@ -531,7 +531,7 @@ public class TableManagementController {
|
||||
@GetMapping("/columns/{tableName}/referenced-by")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getReferencedByTables(
|
||||
@PathVariable String tableName,
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
return ResponseEntity.ok(ApiResponse.success(
|
||||
tableManagementService.getReferencedByTables(tableName, companyCode)));
|
||||
}
|
||||
@@ -544,7 +544,7 @@ public class TableManagementController {
|
||||
@PostMapping("/multi-table-save")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> multiTableSave(
|
||||
@RequestBody Map<String, Object> payload,
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
return ResponseEntity.ok(ApiResponse.success(
|
||||
tableManagementService.multiTableSave(payload, companyCode),
|
||||
"다중 테이블 저장이 완료되었습니다."));
|
||||
@@ -554,8 +554,8 @@ public class TableManagementController {
|
||||
@PostMapping("/validate-excel")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> validateExcelData(
|
||||
@RequestBody Map<String, Object> body,
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
String tableName = (String) body.get("tableName");
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
String tableName = (String) body.get("table_name");
|
||||
@SuppressWarnings("unchecked")
|
||||
List<Map<String, Object>> rows = (List<Map<String, Object>>) body.get("rows");
|
||||
if (tableName == null || rows == null) {
|
||||
|
||||
@@ -20,83 +20,83 @@ public class TaxInvoiceController {
|
||||
|
||||
@GetMapping("/list")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getTaxInvoiceList(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(taxInvoiceService.getTaxInvoiceList(params)));
|
||||
}
|
||||
|
||||
@GetMapping("/stats/monthly")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getMonthlyStats(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(taxInvoiceService.getMonthlyStats(params)));
|
||||
}
|
||||
|
||||
@GetMapping("/stats/cost-type")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getCostTypeStats(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(taxInvoiceService.getCostTypeStats(params)));
|
||||
}
|
||||
|
||||
@GetMapping("/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getTaxInvoiceInfo(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long id) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("id", id);
|
||||
return ResponseEntity.ok(ApiResponse.success(taxInvoiceService.getTaxInvoiceInfo(params)));
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> insertTaxInvoice(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
return ResponseEntity.status(201).body(ApiResponse.success(taxInvoiceService.insertTaxInvoice(body)));
|
||||
}
|
||||
|
||||
@PutMapping("/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> updateTaxInvoice(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long id,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
body.put("id", id);
|
||||
return ResponseEntity.ok(ApiResponse.success(taxInvoiceService.updateTaxInvoice(body)));
|
||||
}
|
||||
|
||||
@DeleteMapping("/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> deleteTaxInvoice(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long id) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("id", id);
|
||||
return ResponseEntity.ok(ApiResponse.success(taxInvoiceService.deleteTaxInvoice(params)));
|
||||
}
|
||||
|
||||
@PostMapping("/{id}/issue")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> issueTaxInvoice(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long id) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("id", id);
|
||||
return ResponseEntity.ok(ApiResponse.success(taxInvoiceService.issueTaxInvoice(params)));
|
||||
}
|
||||
|
||||
@PostMapping("/{id}/cancel")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> cancelTaxInvoice(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long id,
|
||||
@RequestBody(required = false) Map<String, Object> body) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("id", id);
|
||||
if (body != null) params.putAll(body);
|
||||
return ResponseEntity.ok(ApiResponse.success(taxInvoiceService.cancelTaxInvoice(params)));
|
||||
|
||||
@@ -23,10 +23,10 @@ public class TemplateStandardController {
|
||||
*/
|
||||
@GetMapping
|
||||
public ResponseEntity<Map<String, Object>> getTemplateStandardList(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
|
||||
params.putIfAbsent("companyCode", companyCode);
|
||||
params.putIfAbsent("company_code", companyCode);
|
||||
|
||||
Map<String, Object> result = templateStandardService.getTemplateStandardList(params);
|
||||
|
||||
@@ -38,7 +38,7 @@ public class TemplateStandardController {
|
||||
pagination.put("total", total);
|
||||
pagination.put("page", page);
|
||||
pagination.put("limit", limit);
|
||||
pagination.put("totalPages", (int) Math.ceil((double) total / limit));
|
||||
pagination.put("total_pages", (int) Math.ceil((double) total / limit));
|
||||
|
||||
Map<String, Object> response = new LinkedHashMap<>();
|
||||
response.put("success", true);
|
||||
@@ -54,7 +54,7 @@ public class TemplateStandardController {
|
||||
*/
|
||||
@GetMapping("/categories")
|
||||
public ResponseEntity<ApiResponse<List<String>>> getTemplateStandardCategoryList(
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
|
||||
List<String> categories = templateStandardService.getTemplateStandardCategoryList(companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(categories));
|
||||
@@ -87,8 +87,8 @@ public class TemplateStandardController {
|
||||
*/
|
||||
@PostMapping("/import")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> importTemplateStandard(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
|
||||
if (body.get("layout_config") == null) {
|
||||
@@ -135,14 +135,14 @@ public class TemplateStandardController {
|
||||
// DB 결과는 camelCase (map-underscore-to-camel-case: true)
|
||||
// 응답은 Node.js 호환을 위해 snake_case 키 사용
|
||||
Map<String, Object> exportData = new LinkedHashMap<>();
|
||||
exportData.put("template_code", template.get("templateCode"));
|
||||
exportData.put("template_name", template.get("templateName"));
|
||||
exportData.put("template_name_eng", template.get("templateNameEng"));
|
||||
exportData.put("template_code", template.get("template_code"));
|
||||
exportData.put("template_name", template.get("template_name"));
|
||||
exportData.put("template_name_eng", template.get("template_name_eng"));
|
||||
exportData.put("description", template.get("description"));
|
||||
exportData.put("category", template.get("category"));
|
||||
exportData.put("icon_name", template.get("iconName"));
|
||||
exportData.put("default_size", template.get("defaultSize"));
|
||||
exportData.put("layout_config", template.get("layoutConfig"));
|
||||
exportData.put("icon_name", template.get("icon_name"));
|
||||
exportData.put("default_size", template.get("default_size"));
|
||||
exportData.put("layout_config", template.get("layout_config"));
|
||||
|
||||
return ResponseEntity.ok(ApiResponse.success(exportData));
|
||||
}
|
||||
@@ -153,8 +153,8 @@ public class TemplateStandardController {
|
||||
*/
|
||||
@PostMapping
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> insertTemplateStandard(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
|
||||
if (body.get("template_code") == null || body.get("template_name") == null
|
||||
@@ -178,7 +178,7 @@ public class TemplateStandardController {
|
||||
@PutMapping("/{templateCode}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> updateTemplateStandard(
|
||||
@PathVariable String templateCode,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
|
||||
body.put("updated_by", userId);
|
||||
@@ -211,8 +211,8 @@ public class TemplateStandardController {
|
||||
@PostMapping("/{templateCode}/duplicate")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> duplicateTemplateStandard(
|
||||
@PathVariable String templateCode,
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
|
||||
String newTemplateCode = (String) body.get("new_template_code");
|
||||
@@ -223,9 +223,9 @@ public class TemplateStandardController {
|
||||
}
|
||||
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("originalCode", templateCode);
|
||||
params.put("newCode", newTemplateCode);
|
||||
params.put("newName", newTemplateName);
|
||||
params.put("original_code", templateCode);
|
||||
params.put("new_code", newTemplateCode);
|
||||
params.put("new_name", newTemplateName);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("created_by", userId);
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ public class TestButtonDataflowController {
|
||||
|
||||
@GetMapping("/relationships/all")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getAllRelationships(
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
try {
|
||||
return ResponseEntity.ok(ApiResponse.success(service.getAllRelationships(companyCode)));
|
||||
} catch (Exception e) {
|
||||
@@ -55,7 +55,7 @@ public class TestButtonDataflowController {
|
||||
|
||||
@GetMapping("/test-status")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getTestStatus(
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
return ResponseEntity.ok(ApiResponse.success(service.getTestStatus(companyCode)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ public class TodoController {
|
||||
@PostMapping("/reorder")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> reorderTodos(
|
||||
@RequestBody Map<String, Object> body) {
|
||||
Object todoIdsObj = body.get("todoIds");
|
||||
Object todoIdsObj = body.get("todo_ids");
|
||||
if (!(todoIdsObj instanceof List)) {
|
||||
return ResponseEntity.status(400).body(
|
||||
ApiResponse.error("todoIds는 배열이어야 합니다."));
|
||||
|
||||
@@ -16,63 +16,63 @@ public class VehicleController {
|
||||
|
||||
@GetMapping("/list")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getVehicleList(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(vehicleService.getVehicleList(params)));
|
||||
}
|
||||
|
||||
@GetMapping("/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getVehicleInfo(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long id) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("id", id);
|
||||
return ResponseEntity.ok(ApiResponse.success(vehicleService.getVehicleInfo(params)));
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> insertVehicle(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(vehicleService.insertVehicle(body)));
|
||||
}
|
||||
|
||||
@PutMapping("/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> updateVehicle(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long id,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
body.put("id", id);
|
||||
return ResponseEntity.ok(ApiResponse.success(vehicleService.updateVehicle(body)));
|
||||
}
|
||||
|
||||
@DeleteMapping("/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> deleteVehicle(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long id) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("id", id);
|
||||
return ResponseEntity.ok(ApiResponse.success(vehicleService.deleteVehicle(params)));
|
||||
}
|
||||
|
||||
@GetMapping("/locations")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getVehicleLocationList(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(vehicleService.getVehicleLocationList(params)));
|
||||
}
|
||||
|
||||
@PostMapping("/move")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> moveVehicles(
|
||||
@RequestAttribute("companyCode") String companyCode) {
|
||||
@RequestAttribute("company_code") String companyCode) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(vehicleService.moveVehicles(params)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,29 +26,29 @@ public class VehicleTripController {
|
||||
/** GET /list — 운행 목록 (alias) */
|
||||
@GetMapping("/list")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getVehicleTripListAlias(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(vehicleTripService.getTripList(params)));
|
||||
}
|
||||
|
||||
/** GET /trips — 운행 이력 목록, 응답: { data, total } */
|
||||
@GetMapping("/trips")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getTripList(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(vehicleTripService.getTripList(params)));
|
||||
}
|
||||
|
||||
/** GET /trips/{tripId} — 운행 상세 (경로 포함) */
|
||||
@GetMapping("/trips/{tripId}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getTripDetail(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable String tripId) {
|
||||
Map<String, Object> params = new LinkedHashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("tripId", tripId);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("trip_id", tripId);
|
||||
Map<String, Object> result = vehicleTripService.getTripDetail(params);
|
||||
if (result == null) {
|
||||
return ResponseEntity.status(404).body(ApiResponse.error("운행 정보를 찾을 수 없습니다."));
|
||||
@@ -61,71 +61,71 @@ public class VehicleTripController {
|
||||
/** GET /trip/active — 현재 진행 중 운행 조회 */
|
||||
@GetMapping("/trip/active")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getActiveTrip(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId) {
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId) {
|
||||
Map<String, Object> params = new LinkedHashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("userId", userId);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("user_id", userId);
|
||||
return ResponseEntity.ok(ApiResponse.success(vehicleTripService.getActiveTrip(params)));
|
||||
}
|
||||
|
||||
/** POST /trip/start — 운행 시작 */
|
||||
@PostMapping("/trip/start")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> startTrip(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
if (body.get("latitude") == null || body.get("longitude") == null) {
|
||||
return ResponseEntity.status(400).body(ApiResponse.error("위치 정보(latitude, longitude)가 필요합니다."));
|
||||
}
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("userId", userId);
|
||||
body.put("company_code", companyCode);
|
||||
body.put("user_id", userId);
|
||||
return ResponseEntity.ok(ApiResponse.success(vehicleTripService.startTrip(body), "운행이 시작되었습니다."));
|
||||
}
|
||||
|
||||
/** POST /trip/end — 운행 종료 */
|
||||
@PostMapping("/trip/end")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> endTrip(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
if (body.get("tripId") == null) {
|
||||
if (body.get("trip_id") == null) {
|
||||
return ResponseEntity.status(400).body(ApiResponse.error("tripId가 필요합니다."));
|
||||
}
|
||||
if (body.get("latitude") == null || body.get("longitude") == null) {
|
||||
return ResponseEntity.status(400).body(ApiResponse.error("위치 정보(latitude, longitude)가 필요합니다."));
|
||||
}
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("userId", userId);
|
||||
body.put("company_code", companyCode);
|
||||
body.put("user_id", userId);
|
||||
return ResponseEntity.ok(ApiResponse.success(vehicleTripService.endTrip(body), "운행이 종료되었습니다."));
|
||||
}
|
||||
|
||||
/** POST /trip/location — 위치 기록 추가 */
|
||||
@PostMapping("/trip/location")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> addTripLocation(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("userId") String userId,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestAttribute("user_id") String userId,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
if (body.get("tripId") == null) {
|
||||
if (body.get("trip_id") == null) {
|
||||
return ResponseEntity.status(400).body(ApiResponse.error("tripId가 필요합니다."));
|
||||
}
|
||||
if (body.get("latitude") == null || body.get("longitude") == null) {
|
||||
return ResponseEntity.status(400).body(ApiResponse.error("위치 정보(latitude, longitude)가 필요합니다."));
|
||||
}
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("userId", userId);
|
||||
body.put("company_code", companyCode);
|
||||
body.put("user_id", userId);
|
||||
return ResponseEntity.ok(ApiResponse.success(vehicleTripService.addLocation(body)));
|
||||
}
|
||||
|
||||
/** POST /trip/cancel — 운행 취소 */
|
||||
@PostMapping("/trip/cancel")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> cancelTrip(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
if (body.get("tripId") == null) {
|
||||
if (body.get("trip_id") == null) {
|
||||
return ResponseEntity.status(400).body(ApiResponse.error("tripId가 필요합니다."));
|
||||
}
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
Map<String, Object> result = vehicleTripService.cancelTrip(body);
|
||||
if (result == null) {
|
||||
return ResponseEntity.status(404).body(ApiResponse.error("취소할 운행을 찾을 수 없습니다."));
|
||||
@@ -138,54 +138,54 @@ public class VehicleTripController {
|
||||
/** GET /reports/summary — 요약 통계 (period: today/week/month/year) */
|
||||
@GetMapping("/reports/summary")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getSummaryReport(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(vehicleTripService.getSummaryReport(params)));
|
||||
}
|
||||
|
||||
/** GET /reports/daily — 일별 통계 */
|
||||
@GetMapping("/reports/daily")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getDailyReport(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(vehicleTripService.getDailyReport(params)));
|
||||
}
|
||||
|
||||
/** GET /reports/weekly — 주별 통계 */
|
||||
@GetMapping("/reports/weekly")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getWeeklyReport(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(vehicleTripService.getWeeklyReport(params)));
|
||||
}
|
||||
|
||||
/** GET /reports/monthly — 월별 통계 */
|
||||
@GetMapping("/reports/monthly")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getMonthlyReport(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(vehicleTripService.getMonthlyReport(params)));
|
||||
}
|
||||
|
||||
/** GET /reports/by-driver — 운전자별 통계 */
|
||||
@GetMapping("/reports/by-driver")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getDriverReport(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(vehicleTripService.getDriverReport(params)));
|
||||
}
|
||||
|
||||
/** GET /reports/by-route — 구간별 통계 */
|
||||
@GetMapping("/reports/by-route")
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getRouteReport(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(vehicleTripService.getRouteReport(params)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,9 +33,9 @@ public class WebTypeStandardController {
|
||||
private final WebTypeStandardService service;
|
||||
|
||||
private static final List<String> UPDATABLE_FIELDS = Arrays.asList(
|
||||
"typeName", "typeNameEng", "description", "category",
|
||||
"componentName", "configPanel", "defaultConfig", "validationRules",
|
||||
"defaultStyle", "inputProperties", "sortOrder", "isActive"
|
||||
"type_name", "type_name_eng", "description", "category",
|
||||
"component_name", "config_panel", "default_config", "validation_rules",
|
||||
"default_style", "input_properties", "sort_order", "is_active"
|
||||
);
|
||||
|
||||
@GetMapping
|
||||
@@ -89,20 +89,20 @@ public class WebTypeStandardController {
|
||||
@PostMapping
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> createWebType(
|
||||
@RequestBody Map<String, Object> body,
|
||||
@RequestAttribute("userId") String userId) {
|
||||
if (body.get("webType") == null && body.get("web_type") != null) {
|
||||
body.put("webType", body.get("web_type"));
|
||||
@RequestAttribute("user_id") String userId) {
|
||||
if (body.get("web_type") == null && body.get("web_type") != null) {
|
||||
body.put("web_type", body.get("web_type"));
|
||||
}
|
||||
if (body.get("typeName") == null && body.get("type_name") != null) {
|
||||
body.put("typeName", body.get("type_name"));
|
||||
if (body.get("type_name") == null && body.get("type_name") != null) {
|
||||
body.put("type_name", body.get("type_name"));
|
||||
}
|
||||
if (body.get("webType") == null || body.get("typeName") == null) {
|
||||
if (body.get("web_type") == null || body.get("type_name") == null) {
|
||||
return ResponseEntity.status(400)
|
||||
.body(ApiResponse.error("웹타입 코드와 이름은 필수입니다."));
|
||||
}
|
||||
normalizeSnakeToCamel(body);
|
||||
body.put("createdBy", userId);
|
||||
body.put("updatedBy", userId);
|
||||
body.put("created_by", userId);
|
||||
body.put("updated_by", userId);
|
||||
try {
|
||||
Map<String, Object> result = service.createWebType(body);
|
||||
return ResponseEntity.status(HttpStatus.CREATED)
|
||||
@@ -125,14 +125,14 @@ public class WebTypeStandardController {
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> updateWebType(
|
||||
@PathVariable String webType,
|
||||
@RequestBody Map<String, Object> body,
|
||||
@RequestAttribute("userId") String userId) {
|
||||
@RequestAttribute("user_id") String userId) {
|
||||
normalizeSnakeToCamel(body);
|
||||
boolean hasUpdates = UPDATABLE_FIELDS.stream().anyMatch(f -> body.get(f) != null);
|
||||
if (!hasUpdates) {
|
||||
return ResponseEntity.status(400).body(ApiResponse.error("수정할 내용이 없습니다."));
|
||||
}
|
||||
body.put("webType", webType);
|
||||
body.put("updatedBy", userId);
|
||||
body.put("web_type", webType);
|
||||
body.put("updated_by", userId);
|
||||
try {
|
||||
Map<String, Object> result = service.updateWebType(body);
|
||||
if (result == null) {
|
||||
@@ -166,13 +166,13 @@ public class WebTypeStandardController {
|
||||
@PutMapping("/sort-order/bulk")
|
||||
public ResponseEntity<ApiResponse<Void>> updateWebTypeSortOrder(
|
||||
@RequestBody Map<String, Object> body,
|
||||
@RequestAttribute("userId") String userId) {
|
||||
Object webTypes = body.get("webTypes");
|
||||
@RequestAttribute("user_id") String userId) {
|
||||
Object webTypes = body.get("web_types");
|
||||
if (!(webTypes instanceof List)) {
|
||||
return ResponseEntity.status(400)
|
||||
.body(ApiResponse.error("유효하지 않은 데이터 형식입니다."));
|
||||
}
|
||||
body.put("userId", userId);
|
||||
body.put("user_id", userId);
|
||||
try {
|
||||
service.updateWebTypeSortOrder(body);
|
||||
return ResponseEntity.ok(ApiResponse.success(null,
|
||||
@@ -189,17 +189,17 @@ public class WebTypeStandardController {
|
||||
* 프론트엔드가 snake_case로 보내는 경우를 대비해 호환 처리
|
||||
*/
|
||||
private void normalizeSnakeToCamel(Map<String, Object> body) {
|
||||
mapField(body, "web_type", "webType");
|
||||
mapField(body, "type_name", "typeName");
|
||||
mapField(body, "type_name_eng", "typeNameEng");
|
||||
mapField(body, "component_name", "componentName");
|
||||
mapField(body, "config_panel", "configPanel");
|
||||
mapField(body, "default_config", "defaultConfig");
|
||||
mapField(body, "validation_rules", "validationRules");
|
||||
mapField(body, "default_style", "defaultStyle");
|
||||
mapField(body, "input_properties", "inputProperties");
|
||||
mapField(body, "sort_order", "sortOrder");
|
||||
mapField(body, "is_active", "isActive");
|
||||
mapField(body, "web_type", "web_type");
|
||||
mapField(body, "type_name", "type_name");
|
||||
mapField(body, "type_name_eng", "type_name_eng");
|
||||
mapField(body, "component_name", "component_name");
|
||||
mapField(body, "config_panel", "config_panel");
|
||||
mapField(body, "default_config", "default_config");
|
||||
mapField(body, "validation_rules", "validation_rules");
|
||||
mapField(body, "default_style", "default_style");
|
||||
mapField(body, "input_properties", "input_properties");
|
||||
mapField(body, "sort_order", "sort_order");
|
||||
mapField(body, "is_active", "is_active");
|
||||
}
|
||||
|
||||
private void mapField(Map<String, Object> body, String snakeKey, String camelKey) {
|
||||
|
||||
@@ -16,56 +16,56 @@ public class YardLayoutController {
|
||||
|
||||
@GetMapping("/list")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getYardLayoutList(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestParam Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(yardLayoutService.getYardLayoutList(params)));
|
||||
}
|
||||
|
||||
@GetMapping("/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> getYardLayoutInfo(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long id) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("id", id);
|
||||
return ResponseEntity.ok(ApiResponse.success(yardLayoutService.getYardLayoutInfo(params)));
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> insertYardLayout(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
return ResponseEntity.ok(ApiResponse.success(yardLayoutService.insertYardLayout(body)));
|
||||
}
|
||||
|
||||
@PutMapping("/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> updateYardLayout(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long id,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("companyCode", companyCode);
|
||||
body.put("company_code", companyCode);
|
||||
body.put("id", id);
|
||||
return ResponseEntity.ok(ApiResponse.success(yardLayoutService.updateYardLayout(body)));
|
||||
}
|
||||
|
||||
@DeleteMapping("/{id}")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> deleteYardLayout(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long id) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("id", id);
|
||||
return ResponseEntity.ok(ApiResponse.success(yardLayoutService.deleteYardLayout(params)));
|
||||
}
|
||||
|
||||
@PostMapping("/{id}/duplicate")
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> duplicateYardLayout(
|
||||
@RequestAttribute("companyCode") String companyCode,
|
||||
@RequestAttribute("company_code") String companyCode,
|
||||
@PathVariable Long id) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("id", id);
|
||||
return ResponseEntity.ok(ApiResponse.success(yardLayoutService.duplicateYardLayout(params)));
|
||||
}
|
||||
@@ -74,7 +74,7 @@ public class YardLayoutController {
|
||||
public ResponseEntity<ApiResponse<List<Map<String, Object>>>> getYardPlacementList(
|
||||
@PathVariable Long id) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("yardLayoutId", id);
|
||||
params.put("yard_layout_id", id);
|
||||
return ResponseEntity.ok(ApiResponse.success(yardLayoutService.getYardPlacementList(params)));
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ public class YardLayoutController {
|
||||
public ResponseEntity<ApiResponse<Map<String, Object>>> insertYardPlacement(
|
||||
@PathVariable Long id,
|
||||
@RequestBody Map<String, Object> body) {
|
||||
body.put("yardLayoutId", id);
|
||||
body.put("yard_layout_id", id);
|
||||
return ResponseEntity.ok(ApiResponse.success(yardLayoutService.insertYardPlacement(body)));
|
||||
}
|
||||
|
||||
|
||||
@@ -31,14 +31,14 @@ public class JwtAuthenticationFilter extends OncePerRequestFilter {
|
||||
if (StringUtils.hasText(token) && jwtTokenProvider.validateToken(token)) {
|
||||
try {
|
||||
Claims claims = jwtTokenProvider.getClaims(token);
|
||||
String userId = claims.get("userId", String.class);
|
||||
String companyCode = claims.get("companyCode", String.class);
|
||||
String userType = claims.get("userType", String.class);
|
||||
String userId = claims.get("user_id", String.class);
|
||||
String companyCode = claims.get("company_code", String.class);
|
||||
String userType = claims.get("user_type", String.class);
|
||||
|
||||
request.setAttribute("userId", userId);
|
||||
request.setAttribute("companyCode", companyCode);
|
||||
request.setAttribute("user_id", userId);
|
||||
request.setAttribute("company_code", companyCode);
|
||||
request.setAttribute("role", userType);
|
||||
request.setAttribute("userType", userType);
|
||||
request.setAttribute("user_type", userType);
|
||||
|
||||
List<SimpleGrantedAuthority> authorities = List.of(
|
||||
new SimpleGrantedAuthority("ROLE_" + userType)
|
||||
|
||||
@@ -32,13 +32,13 @@ public class JwtTokenProvider {
|
||||
public String generateToken(Map<String, Object> personBean) {
|
||||
Date now = new Date();
|
||||
return Jwts.builder()
|
||||
.claim("userId", personBean.get("userId"))
|
||||
.claim("userName", personBean.get("userName"))
|
||||
.claim("deptName", personBean.get("deptName"))
|
||||
.claim("companyCode", personBean.get("companyCode"))
|
||||
.claim("companyName", personBean.get("companyName"))
|
||||
.claim("userType", personBean.get("userType"))
|
||||
.claim("userTypeName", personBean.get("userTypeName"))
|
||||
.claim("user_id", personBean.get("user_id"))
|
||||
.claim("user_name", personBean.get("user_name"))
|
||||
.claim("dept_name", personBean.get("dept_name"))
|
||||
.claim("company_code", personBean.get("company_code"))
|
||||
.claim("company_name", personBean.get("company_name"))
|
||||
.claim("user_type", personBean.get("user_type"))
|
||||
.claim("user_type_name", personBean.get("user_type_name"))
|
||||
.issuedAt(now)
|
||||
.expiration(new Date(now.getTime() + expiration))
|
||||
.audience().add("PMS-Users").and()
|
||||
@@ -65,14 +65,14 @@ public class JwtTokenProvider {
|
||||
}
|
||||
|
||||
public String getUserId(String token) {
|
||||
return getClaims(token).get("userId", String.class);
|
||||
return getClaims(token).get("user_id", String.class);
|
||||
}
|
||||
|
||||
public String getCompanyCode(String token) {
|
||||
return getClaims(token).get("companyCode", String.class);
|
||||
return getClaims(token).get("company_code", String.class);
|
||||
}
|
||||
|
||||
public String getUserType(String token) {
|
||||
return getClaims(token).get("userType", String.class);
|
||||
return getClaims(token).get("user_type", String.class);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,16 +24,16 @@ public class AdminService extends BaseService {
|
||||
// ── 메뉴 관리 ──────────────────────────────────────────────────────────
|
||||
|
||||
public List<Map<String, Object>> getAdminMenuList(Map<String, Object> params) {
|
||||
params.putIfAbsent("userLang", "ko");
|
||||
params.putIfAbsent("user_lang", "ko");
|
||||
// String "false"/"true" → Boolean (OGNL !includeInactive 오작동 방지)
|
||||
Object includeInactiveRaw = params.get("includeInactive");
|
||||
params.put("includeInactive", Boolean.TRUE.equals(includeInactiveRaw) || "true".equals(includeInactiveRaw));
|
||||
params.putIfAbsent("isManagementScreen", false);
|
||||
Object includeInactiveRaw = params.get("include_inactive");
|
||||
params.put("include_inactive", Boolean.TRUE.equals(includeInactiveRaw) || "true".equals(includeInactiveRaw));
|
||||
params.putIfAbsent("is_management_screen", false);
|
||||
return sqlSession.selectList("admin.selectAdminMenuList", params);
|
||||
}
|
||||
|
||||
public List<Map<String, Object>> getUserMenuList(Map<String, Object> params) {
|
||||
params.putIfAbsent("userLang", "ko");
|
||||
params.putIfAbsent("user_lang", "ko");
|
||||
return sqlSession.selectList("admin.selectUserMenuList", params);
|
||||
}
|
||||
|
||||
@@ -41,9 +41,9 @@ public class AdminService extends BaseService {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
List<Map<String, Object>> parents = sqlSession.selectList("admin.selectPopParentMenu", params);
|
||||
if (parents.isEmpty()) {
|
||||
result.put("parentMenu", null);
|
||||
result.put("childMenus", List.of());
|
||||
result.put("landingMenu", null);
|
||||
result.put("parent_menu", null);
|
||||
result.put("child_menus", List.of());
|
||||
result.put("landing_menu", null);
|
||||
return result;
|
||||
}
|
||||
Map<String, Object> parent = parents.get(0);
|
||||
@@ -51,8 +51,8 @@ public class AdminService extends BaseService {
|
||||
Object parentCompanyCode = parent.get("company_code");
|
||||
|
||||
Map<String, Object> childParams = new HashMap<>();
|
||||
childParams.put("parentObjid", parentObjid);
|
||||
childParams.put("parentCompanyCode", parentCompanyCode);
|
||||
childParams.put("parent_objid", parentObjid);
|
||||
childParams.put("parent_company_code", parentCompanyCode);
|
||||
List<Map<String, Object>> children = sqlSession.selectList("admin.selectPopChildMenus", childParams);
|
||||
|
||||
Map<String, Object> landingMenu = children.stream()
|
||||
@@ -63,15 +63,15 @@ public class AdminService extends BaseService {
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
|
||||
result.put("parentMenu", parent);
|
||||
result.put("childMenus", children);
|
||||
result.put("landingMenu", landingMenu);
|
||||
result.put("parent_menu", parent);
|
||||
result.put("child_menus", children);
|
||||
result.put("landing_menu", landingMenu);
|
||||
return result;
|
||||
}
|
||||
|
||||
public Map<String, Object> getMenuInfo(String menuId) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("menuId", menuId);
|
||||
params.put("menu_id", menuId);
|
||||
return sqlSession.selectOne("admin.selectMenuById", params);
|
||||
}
|
||||
|
||||
@@ -81,14 +81,14 @@ public class AdminService extends BaseService {
|
||||
}
|
||||
|
||||
public Map<String, Object> updateMenu(String menuId, Map<String, Object> params) {
|
||||
params.put("menuId", menuId);
|
||||
params.put("menu_id", menuId);
|
||||
sqlSession.update("admin.updateMenu", params);
|
||||
return params;
|
||||
}
|
||||
|
||||
public void deleteMenu(String menuId) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("menuId", menuId);
|
||||
params.put("menu_id", menuId);
|
||||
sqlSession.delete("admin.deleteMenu", params);
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ public class AdminService extends BaseService {
|
||||
if (current == null) throw new IllegalArgumentException("메뉴를 찾을 수 없습니다.");
|
||||
String newStatus = "active".equalsIgnoreCase((String) current.get("status")) ? "inactive" : "active";
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("menuId", menuId);
|
||||
params.put("menu_id", menuId);
|
||||
params.put("status", newStatus);
|
||||
sqlSession.update("admin.updateMenuStatus", params);
|
||||
return Map.of("status", newStatus);
|
||||
@@ -123,37 +123,37 @@ public class AdminService extends BaseService {
|
||||
Map<String, Object> pagination = new HashMap<>();
|
||||
pagination.put("page", page);
|
||||
pagination.put("limit", limit);
|
||||
pagination.put("totalPages", totalPages);
|
||||
pagination.put("total_pages", totalPages);
|
||||
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("data", commonService.toCamelCaseKeysList(users));
|
||||
result.put("total", total);
|
||||
result.put("searchType", rawSearch != null ? "v2" : "none");
|
||||
result.put("search_type", rawSearch != null ? "v2" : "none");
|
||||
result.put("pagination", pagination);
|
||||
return result;
|
||||
}
|
||||
|
||||
public Map<String, Object> getUserInfo(String userId) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("userId", userId);
|
||||
params.put("user_id", userId);
|
||||
return sqlSession.selectOne("admin.selectUserById", params);
|
||||
}
|
||||
|
||||
public List<Map<String, Object>> getUserHistory(String userId, Map<String, Object> params) {
|
||||
params.put("userId", userId);
|
||||
params.put("user_id", userId);
|
||||
commonService.applyPagination(params);
|
||||
return sqlSession.selectList("admin.selectUserHistory", params);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public Map<String, Object> saveUser(Map<String, Object> params) {
|
||||
String userId = (String) params.get("userId");
|
||||
Map<String, Object> existing = sqlSession.selectOne("admin.selectUserById", Map.of("userId", userId));
|
||||
String userId = (String) params.get("user_id");
|
||||
Map<String, Object> existing = sqlSession.selectOne("admin.selectUserById", Map.of("user_id", userId));
|
||||
if (existing != null) {
|
||||
sqlSession.update("admin.updateUser", params);
|
||||
} else {
|
||||
String rawPw = (String) params.getOrDefault("userPassword", "Welcome1!");
|
||||
params.put("userPassword", passwordEncoder.encode(rawPw));
|
||||
String rawPw = (String) params.getOrDefault("user_password", "Welcome1!");
|
||||
params.put("user_password", passwordEncoder.encode(rawPw));
|
||||
sqlSession.insert("admin.insertUser", params);
|
||||
}
|
||||
return params;
|
||||
@@ -161,7 +161,7 @@ public class AdminService extends BaseService {
|
||||
|
||||
public void changeUserStatus(String userId, String status) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("userId", userId);
|
||||
params.put("user_id", userId);
|
||||
params.put("status", status);
|
||||
sqlSession.update("admin.updateUserStatus", params);
|
||||
}
|
||||
@@ -169,13 +169,13 @@ public class AdminService extends BaseService {
|
||||
public void resetUserPassword(String userId) {
|
||||
String defaultPw = passwordEncoder.encode("Welcome1!");
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("userId", userId);
|
||||
params.put("userPassword", defaultPw);
|
||||
params.put("user_id", userId);
|
||||
params.put("user_password", defaultPw);
|
||||
sqlSession.update("admin.updateUserPassword", params);
|
||||
}
|
||||
|
||||
public Map<String, Object> getUserLocale(String userId) {
|
||||
Map<String, Object> row = sqlSession.selectOne("admin.selectUserLocale", Map.of("userId", userId));
|
||||
Map<String, Object> row = sqlSession.selectOne("admin.selectUserLocale", Map.of("user_id", userId));
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("locale", row != null ? row.get("locale") : "KR");
|
||||
return result;
|
||||
@@ -188,7 +188,7 @@ public class AdminService extends BaseService {
|
||||
throw new IllegalArgumentException("유효하지 않은 로케일입니다: " + locale);
|
||||
}
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("userId", userId);
|
||||
params.put("user_id", userId);
|
||||
params.put("locale", locale);
|
||||
sqlSession.update("admin.updateUserLocale", params);
|
||||
}
|
||||
@@ -204,79 +204,79 @@ public class AdminService extends BaseService {
|
||||
.filter(d -> !Boolean.TRUE.equals(d.get("is_primary")))
|
||||
.collect(Collectors.toList());
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("userInfo", userInfo);
|
||||
result.put("mainDept", mainDept);
|
||||
result.put("subDepts", subDepts);
|
||||
result.put("user_info", userInfo);
|
||||
result.put("main_dept", mainDept);
|
||||
result.put("sub_depts", subDepts);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public Map<String, Object> saveUserWithDept(Map<String, Object> body) {
|
||||
@SuppressWarnings("unchecked")
|
||||
Map<String, Object> userInfoRaw = (Map<String, Object>) body.get("userInfo");
|
||||
Map<String, Object> userInfoRaw = (Map<String, Object>) body.get("user_info");
|
||||
@SuppressWarnings("unchecked")
|
||||
Map<String, Object> mainDept = (Map<String, Object>) body.get("mainDept");
|
||||
Map<String, Object> mainDept = (Map<String, Object>) body.get("main_dept");
|
||||
@SuppressWarnings("unchecked")
|
||||
List<Map<String, Object>> subDepts = body.get("subDepts") != null
|
||||
? (List<Map<String, Object>>) body.get("subDepts") : List.of();
|
||||
String companyCode = (String) body.get("companyCode");
|
||||
List<Map<String, Object>> subDepts = body.get("sub_depts") != null
|
||||
? (List<Map<String, Object>>) body.get("sub_depts") : List.of();
|
||||
String companyCode = (String) body.get("company_code");
|
||||
|
||||
if (userInfoRaw == null) throw new IllegalArgumentException("userInfo is required");
|
||||
|
||||
// snake_case / camelCase 양쪽 처리
|
||||
String userId = getField(userInfoRaw, "userId", "user_id");
|
||||
String userId = getField(userInfoRaw, "user_id", "user_id");
|
||||
if (userId == null) throw new IllegalArgumentException("userId is required");
|
||||
|
||||
// 메인 부서 코드/이름/직위 결정
|
||||
String deptCode = mainDept != null ? getField(mainDept, "deptCode", "dept_code") : null;
|
||||
if (deptCode == null) deptCode = getField(userInfoRaw, "deptCode", "dept_code");
|
||||
String deptName = mainDept != null ? getField(mainDept, "deptName", "dept_name") : null;
|
||||
if (deptName == null) deptName = getField(userInfoRaw, "deptName", "dept_name");
|
||||
String positionName = mainDept != null ? getField(mainDept, "positionName", "position_name") : null;
|
||||
if (positionName == null) positionName = getField(userInfoRaw, "positionName", "position_name");
|
||||
String deptCode = mainDept != null ? getField(mainDept, "dept_code", "dept_code") : null;
|
||||
if (deptCode == null) deptCode = getField(userInfoRaw, "dept_code", "dept_code");
|
||||
String deptName = mainDept != null ? getField(mainDept, "dept_name", "dept_name") : null;
|
||||
if (deptName == null) deptName = getField(userInfoRaw, "dept_name", "dept_name");
|
||||
String positionName = mainDept != null ? getField(mainDept, "position_name", "position_name") : null;
|
||||
if (positionName == null) positionName = getField(userInfoRaw, "position_name", "position_name");
|
||||
|
||||
// camelCase params 빌드
|
||||
Map<String, Object> saveParams = new HashMap<>();
|
||||
saveParams.put("userId", userId);
|
||||
saveParams.put("userName", getField(userInfoRaw, "userName", "user_name"));
|
||||
saveParams.put("userNameEng", getField(userInfoRaw, "userNameEng", "user_name_eng"));
|
||||
saveParams.put("user_id", userId);
|
||||
saveParams.put("user_name", getField(userInfoRaw, "user_name", "user_name"));
|
||||
saveParams.put("user_name_eng", getField(userInfoRaw, "user_name_eng", "user_name_eng"));
|
||||
saveParams.put("email", userInfoRaw.getOrDefault("email", null));
|
||||
saveParams.put("tel", userInfoRaw.getOrDefault("tel", null));
|
||||
saveParams.put("cellPhone", getField(userInfoRaw, "cellPhone", "cell_phone"));
|
||||
saveParams.put("cell_phone", getField(userInfoRaw, "cell_phone", "cell_phone"));
|
||||
saveParams.put("sabun", userInfoRaw.getOrDefault("sabun", null));
|
||||
saveParams.put("userType", getField(userInfoRaw, "userType", "user_type"));
|
||||
saveParams.put("userTypeName", getField(userInfoRaw, "userTypeName", "user_type_name"));
|
||||
saveParams.put("user_type", getField(userInfoRaw, "user_type", "user_type"));
|
||||
saveParams.put("user_type_name", getField(userInfoRaw, "user_type_name", "user_type_name"));
|
||||
saveParams.put("status", userInfoRaw.getOrDefault("status", "active"));
|
||||
saveParams.put("locale", userInfoRaw.getOrDefault("locale", null));
|
||||
saveParams.put("positionCode", getField(userInfoRaw, "positionCode", "position_code"));
|
||||
saveParams.put("deptCode", deptCode);
|
||||
saveParams.put("deptName", deptName);
|
||||
saveParams.put("positionName", positionName);
|
||||
saveParams.put("position_code", getField(userInfoRaw, "position_code", "position_code"));
|
||||
saveParams.put("dept_code", deptCode);
|
||||
saveParams.put("dept_name", deptName);
|
||||
saveParams.put("position_name", positionName);
|
||||
String effectiveCompany = !"*".equals(companyCode) ? companyCode : null;
|
||||
saveParams.put("companyCode", effectiveCompany);
|
||||
saveParams.put("company_code", effectiveCompany);
|
||||
|
||||
// 기존 사용자 확인
|
||||
Map<String, Object> existing = sqlSession.selectOne("admin.selectUserById", Map.of("userId", userId));
|
||||
Map<String, Object> existing = sqlSession.selectOne("admin.selectUserById", Map.of("user_id", userId));
|
||||
boolean isUpdate = existing != null;
|
||||
|
||||
if (isUpdate) {
|
||||
// 비밀번호가 제공된 경우만 업데이트
|
||||
String rawPw = getField(userInfoRaw, "userPassword", "user_password");
|
||||
String rawPw = getField(userInfoRaw, "user_password", "user_password");
|
||||
if (rawPw != null && !rawPw.isBlank()) {
|
||||
saveParams.put("userPassword", passwordEncoder.encode(rawPw));
|
||||
saveParams.put("user_password", passwordEncoder.encode(rawPw));
|
||||
}
|
||||
sqlSession.update("admin.updateUserForDept", saveParams);
|
||||
} else {
|
||||
String rawPw = getField(userInfoRaw, "userPassword", "user_password");
|
||||
String rawPw = getField(userInfoRaw, "user_password", "user_password");
|
||||
if (rawPw == null || rawPw.isBlank()) rawPw = "Welcome1!";
|
||||
saveParams.put("userPassword", passwordEncoder.encode(rawPw));
|
||||
saveParams.put("user_password", passwordEncoder.encode(rawPw));
|
||||
sqlSession.insert("admin.insertUser", saveParams);
|
||||
}
|
||||
|
||||
// user_dept 처리
|
||||
if (mainDept != null || !subDepts.isEmpty()) {
|
||||
// 1. 기존 부서 목록 조회
|
||||
List<Map<String, Object>> existingDepts = sqlSession.selectList("admin.selectUserDeptList", Map.of("userId", userId));
|
||||
List<Map<String, Object>> existingDepts = sqlSession.selectList("admin.selectUserDeptList", Map.of("user_id", userId));
|
||||
Map<String, Object> existingMain = existingDepts.stream()
|
||||
.filter(d -> Boolean.TRUE.equals(d.get("is_primary")))
|
||||
.findFirst().orElse(null);
|
||||
@@ -285,47 +285,47 @@ public class AdminService extends BaseService {
|
||||
if (mainDept != null && deptCode != null && existingMain != null) {
|
||||
String existingMainCode = (String) existingMain.get("dept_code");
|
||||
if (existingMainCode != null && !existingMainCode.equals(deptCode)) {
|
||||
sqlSession.update("admin.updateUserDeptNotPrimary", Map.of("userId", userId, "deptCode", existingMainCode));
|
||||
sqlSession.update("admin.updateUserDeptNotPrimary", Map.of("user_id", userId, "dept_code", existingMainCode));
|
||||
}
|
||||
}
|
||||
|
||||
// 3. 겸직 부서 전체 삭제 (새로 입력받은 것으로 교체)
|
||||
sqlSession.delete("admin.deleteUserDeptSub", Map.of("userId", userId));
|
||||
sqlSession.delete("admin.deleteUserDeptSub", Map.of("user_id", userId));
|
||||
|
||||
// 4. 메인 부서 UPSERT
|
||||
if (mainDept != null && deptCode != null) {
|
||||
String userName = (String) saveParams.get("userName");
|
||||
String userName = (String) saveParams.get("user_name");
|
||||
Map<String, Object> dp = new HashMap<>();
|
||||
dp.put("userId", userId);
|
||||
dp.put("deptCode", deptCode);
|
||||
dp.put("isPrimary", true);
|
||||
dp.put("deptName", deptName);
|
||||
dp.put("userName", userName);
|
||||
dp.put("positionName", positionName);
|
||||
dp.put("companyCode", effectiveCompany);
|
||||
dp.put("user_id", userId);
|
||||
dp.put("dept_code", deptCode);
|
||||
dp.put("is_primary", true);
|
||||
dp.put("dept_name", deptName);
|
||||
dp.put("user_name", userName);
|
||||
dp.put("position_name", positionName);
|
||||
dp.put("company_code", effectiveCompany);
|
||||
sqlSession.insert("admin.upsertUserDept", dp);
|
||||
}
|
||||
|
||||
// 5. 겸직 부서 저장
|
||||
String userName = (String) saveParams.get("userName");
|
||||
String userName = (String) saveParams.get("user_name");
|
||||
for (Map<String, Object> sub : subDepts) {
|
||||
String subCode = getField(sub, "deptCode", "dept_code");
|
||||
String subCode = getField(sub, "dept_code", "dept_code");
|
||||
if (subCode == null || subCode.equals(deptCode)) continue;
|
||||
Map<String, Object> dp = new HashMap<>();
|
||||
dp.put("userId", userId);
|
||||
dp.put("deptCode", subCode);
|
||||
dp.put("isPrimary", false);
|
||||
dp.put("deptName", getField(sub, "deptName", "dept_name"));
|
||||
dp.put("userName", userName);
|
||||
dp.put("positionName", getField(sub, "positionName", "position_name"));
|
||||
dp.put("companyCode", effectiveCompany);
|
||||
dp.put("user_id", userId);
|
||||
dp.put("dept_code", subCode);
|
||||
dp.put("is_primary", false);
|
||||
dp.put("dept_name", getField(sub, "dept_name", "dept_name"));
|
||||
dp.put("user_name", userName);
|
||||
dp.put("position_name", getField(sub, "position_name", "position_name"));
|
||||
dp.put("company_code", effectiveCompany);
|
||||
sqlSession.insert("admin.upsertUserDept", dp);
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("userId", userId);
|
||||
result.put("isUpdate", isUpdate);
|
||||
result.put("user_id", userId);
|
||||
result.put("is_update", isUpdate);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -374,9 +374,9 @@ public class AdminService extends BaseService {
|
||||
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("departments", rootDepts);
|
||||
result.put("flatList", flatList);
|
||||
result.put("flat_list", flatList);
|
||||
result.put("total", rawList.size());
|
||||
result.put("totalCount", rawList.size());
|
||||
result.put("total_count", rawList.size());
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -389,7 +389,7 @@ public class AdminService extends BaseService {
|
||||
}
|
||||
|
||||
public Map<String, Object> getCompanyByCode(String companyCode) {
|
||||
return sqlSession.selectOne("admin.selectCompanyByCode", Map.of("companyCode", companyCode));
|
||||
return sqlSession.selectOne("admin.selectCompanyByCode", Map.of("company_code", companyCode));
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@@ -400,19 +400,19 @@ public class AdminService extends BaseService {
|
||||
|
||||
@Transactional
|
||||
public Map<String, Object> updateCompanyInfo(String companyCode, Map<String, Object> params) {
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
sqlSession.update("admin.updateCompany", params);
|
||||
return params;
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void deleteCompany(String companyCode) {
|
||||
sqlSession.delete("admin.deleteCompany", Map.of("companyCode", companyCode));
|
||||
sqlSession.delete("admin.deleteCompany", Map.of("company_code", companyCode));
|
||||
}
|
||||
|
||||
// ── 테이블 스키마 ──────────────────────────────────────────────────────
|
||||
|
||||
public List<Map<String, Object>> getTableSchema(String tableName) {
|
||||
return sqlSession.selectList("admin.selectTableSchema", Map.of("tableName", tableName));
|
||||
return sqlSession.selectList("admin.selectTableSchema", Map.of("table_name", tableName));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ public class AnalyticsReportService extends BaseService {
|
||||
private static final String NS = "analyticsReport.";
|
||||
|
||||
public Map<String, Object> getProductionReportData(Map<String, Object> params) {
|
||||
List<Map<String, Object>> rows = sqlSession.selectList(NS + "getProductionReportData", params);
|
||||
List<Map<String, Object>> rows = sqlSession.selectList(NS + "get_production_report_data", params);
|
||||
Map<String, Object> filterOptions = new LinkedHashMap<>();
|
||||
filterOptions.put("processes", extractFilterSet(rows, "process"));
|
||||
filterOptions.put("equipment", extractFilterSet(rows, "equipment"));
|
||||
@@ -24,13 +24,13 @@ public class AnalyticsReportService extends BaseService {
|
||||
filterOptions.put("workers", extractFilterSet(rows, "worker"));
|
||||
Map<String, Object> result = new LinkedHashMap<>();
|
||||
result.put("rows", rows);
|
||||
result.put("filterOptions", filterOptions);
|
||||
result.put("totalCount", rows.size());
|
||||
result.put("filter_options", filterOptions);
|
||||
result.put("total_count", rows.size());
|
||||
return result;
|
||||
}
|
||||
|
||||
public Map<String, Object> getInventoryReportData(Map<String, Object> params) {
|
||||
List<Map<String, Object>> rows = sqlSession.selectList(NS + "getInventoryReportData", params);
|
||||
List<Map<String, Object>> rows = sqlSession.selectList(NS + "get_inventory_report_data", params);
|
||||
Map<String, Object> filterOptions = new LinkedHashMap<>();
|
||||
filterOptions.put("items", extractFilterSet(rows, "item"));
|
||||
filterOptions.put("warehouses", extractFilterSet(rows, "warehouse"));
|
||||
@@ -43,13 +43,13 @@ public class AnalyticsReportService extends BaseService {
|
||||
));
|
||||
Map<String, Object> result = new LinkedHashMap<>();
|
||||
result.put("rows", rows);
|
||||
result.put("filterOptions", filterOptions);
|
||||
result.put("totalCount", rows.size());
|
||||
result.put("filter_options", filterOptions);
|
||||
result.put("total_count", rows.size());
|
||||
return result;
|
||||
}
|
||||
|
||||
public Map<String, Object> getPurchaseReportData(Map<String, Object> params) {
|
||||
List<Map<String, Object>> rows = sqlSession.selectList(NS + "getPurchaseReportData", params);
|
||||
List<Map<String, Object>> rows = sqlSession.selectList(NS + "get_purchase_report_data", params);
|
||||
Map<String, Object> filterOptions = new LinkedHashMap<>();
|
||||
filterOptions.put("suppliers", extractFilterSet(rows, "supplier"));
|
||||
filterOptions.put("items", extractFilterSet(rows, "item"));
|
||||
@@ -57,16 +57,16 @@ public class AnalyticsReportService extends BaseService {
|
||||
filterOptions.put("statuses", extractFilterSet(rows, "status"));
|
||||
Map<String, Object> result = new LinkedHashMap<>();
|
||||
result.put("rows", rows);
|
||||
result.put("filterOptions", filterOptions);
|
||||
result.put("totalCount", rows.size());
|
||||
result.put("filter_options", filterOptions);
|
||||
result.put("total_count", rows.size());
|
||||
return result;
|
||||
}
|
||||
|
||||
public Map<String, Object> getQualityReportData(Map<String, Object> params) {
|
||||
List<Map<String, Object>> rows = sqlSession.selectList(NS + "getQualityReportData", params);
|
||||
List<Map<String, Object>> rows = sqlSession.selectList(NS + "get_quality_report_data", params);
|
||||
Map<String, Object> filterOptions = new LinkedHashMap<>();
|
||||
filterOptions.put("items", extractFilterSet(rows, "item"));
|
||||
filterOptions.put("defectTypes", List.of(
|
||||
filterOptions.put("defect_types", List.of(
|
||||
Map.of("value", "외관불량", "label", "외관불량"),
|
||||
Map.of("value", "치수불량", "label", "치수불량"),
|
||||
Map.of("value", "기능불량", "label", "기능불량"),
|
||||
@@ -77,36 +77,36 @@ public class AnalyticsReportService extends BaseService {
|
||||
filterOptions.put("inspectors", extractFilterSet(rows, "inspector"));
|
||||
Map<String, Object> result = new LinkedHashMap<>();
|
||||
result.put("rows", rows);
|
||||
result.put("filterOptions", filterOptions);
|
||||
result.put("totalCount", rows.size());
|
||||
result.put("filter_options", filterOptions);
|
||||
result.put("total_count", rows.size());
|
||||
return result;
|
||||
}
|
||||
|
||||
public Map<String, Object> getEquipmentReportData(Map<String, Object> params) {
|
||||
List<Map<String, Object>> rows = sqlSession.selectList(NS + "getEquipmentReportData", params);
|
||||
List<Map<String, Object>> rows = sqlSession.selectList(NS + "get_equipment_report_data", params);
|
||||
Map<String, Object> filterOptions = new LinkedHashMap<>();
|
||||
filterOptions.put("equipment", extractFilterSet(rows, "equipment"));
|
||||
filterOptions.put("equipTypes", extractFilterSet(rows, "equipType"));
|
||||
filterOptions.put("equip_types", extractFilterSet(rows, "equip_type"));
|
||||
filterOptions.put("lines", extractFilterSet(rows, "line"));
|
||||
filterOptions.put("managers", extractFilterSet(rows, "manager"));
|
||||
Map<String, Object> result = new LinkedHashMap<>();
|
||||
result.put("rows", rows);
|
||||
result.put("filterOptions", filterOptions);
|
||||
result.put("totalCount", rows.size());
|
||||
result.put("filter_options", filterOptions);
|
||||
result.put("total_count", rows.size());
|
||||
return result;
|
||||
}
|
||||
|
||||
public Map<String, Object> getMoldReportData(Map<String, Object> params) {
|
||||
List<Map<String, Object>> rows = sqlSession.selectList(NS + "getMoldReportData", params);
|
||||
List<Map<String, Object>> rows = sqlSession.selectList(NS + "get_mold_report_data", params);
|
||||
Map<String, Object> filterOptions = new LinkedHashMap<>();
|
||||
filterOptions.put("molds", extractFilterSet(rows, "mold"));
|
||||
filterOptions.put("moldTypes", extractFilterSet(rows, "moldType"));
|
||||
filterOptions.put("mold_types", extractFilterSet(rows, "mold_type"));
|
||||
filterOptions.put("items", extractFilterSet(rows, "item"));
|
||||
filterOptions.put("makers", extractFilterSet(rows, "maker"));
|
||||
Map<String, Object> result = new LinkedHashMap<>();
|
||||
result.put("rows", rows);
|
||||
result.put("filterOptions", filterOptions);
|
||||
result.put("totalCount", rows.size());
|
||||
result.put("filter_options", filterOptions);
|
||||
result.put("total_count", rows.size());
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ public class ApprovalService extends BaseService {
|
||||
public List<Map<String, Object>> getDefinitions(Map<String, Object> params) {
|
||||
Object search = params.get("search");
|
||||
if (search != null && !search.toString().isBlank()) {
|
||||
params.put("searchLike", "%" + search + "%");
|
||||
params.put("search_like", "%" + search + "%");
|
||||
}
|
||||
return sqlSession.selectList("approval.selectDefinitions", params);
|
||||
}
|
||||
@@ -39,28 +39,28 @@ public class ApprovalService extends BaseService {
|
||||
public Map<String, Object> createDefinition(Map<String, Object> params) {
|
||||
sqlSession.insert("approval.insertDefinition", params);
|
||||
Map<String, Object> fetch = new HashMap<>();
|
||||
fetch.put("definitionId", params.get("definitionId"));
|
||||
fetch.put("companyCode", "*");
|
||||
fetch.put("definition_id", params.get("definition_id"));
|
||||
fetch.put("company_code", "*");
|
||||
return sqlSession.selectOne("approval.selectDefinitionById", fetch);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public Map<String, Object> updateDefinition(Map<String, Object> params) {
|
||||
Map<String, Object> checkP = new HashMap<>();
|
||||
checkP.put("definitionId", params.get("definitionId"));
|
||||
checkP.put("companyCode", params.get("companyCode"));
|
||||
checkP.put("definition_id", params.get("definition_id"));
|
||||
checkP.put("company_code", params.get("company_code"));
|
||||
if (sqlSession.selectOne("approval.selectDefinitionById", checkP) == null)
|
||||
throw new IllegalArgumentException("결재 유형을 찾을 수 없습니다.");
|
||||
sqlSession.update("approval.updateDefinition", params);
|
||||
checkP.put("companyCode", "*");
|
||||
checkP.put("company_code", "*");
|
||||
return sqlSession.selectOne("approval.selectDefinitionById", checkP);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void deleteDefinition(Map<String, Object> params) {
|
||||
Map<String, Object> checkP = new HashMap<>();
|
||||
checkP.put("definitionId", params.get("definitionId"));
|
||||
checkP.put("companyCode", params.get("companyCode"));
|
||||
checkP.put("definition_id", params.get("definition_id"));
|
||||
checkP.put("company_code", params.get("company_code"));
|
||||
if (sqlSession.selectOne("approval.selectDefinitionById", checkP) == null)
|
||||
throw new IllegalArgumentException("결재 유형을 찾을 수 없습니다.");
|
||||
sqlSession.delete("approval.deleteDefinition", params);
|
||||
@@ -79,8 +79,8 @@ public class ApprovalService extends BaseService {
|
||||
if (template == null) throw new IllegalArgumentException("결재선 템플릿을 찾을 수 없습니다.");
|
||||
|
||||
Map<String, Object> stepP = new HashMap<>();
|
||||
stepP.put("templateId", template.get("template_id"));
|
||||
stepP.put("companyCode", params.get("companyCode"));
|
||||
stepP.put("template_id", template.get("template_id"));
|
||||
stepP.put("company_code", params.get("company_code"));
|
||||
template.put("steps", sqlSession.selectList("approval.selectTemplateSteps", stepP));
|
||||
return template;
|
||||
}
|
||||
@@ -88,21 +88,21 @@ public class ApprovalService extends BaseService {
|
||||
@Transactional
|
||||
public Map<String, Object> createTemplate(Map<String, Object> params) {
|
||||
sqlSession.insert("approval.insertTemplate", params);
|
||||
long templateId = toLong(params.get("templateId"));
|
||||
long templateId = toLong(params.get("template_id"));
|
||||
List<Map<String, Object>> steps = castList(params.get("steps"));
|
||||
if (steps != null) insertTemplateSteps(templateId, steps, (String) params.get("companyCode"));
|
||||
if (steps != null) insertTemplateSteps(templateId, steps, (String) params.get("company_code"));
|
||||
|
||||
Map<String, Object> fetch = new HashMap<>();
|
||||
fetch.put("templateId", templateId);
|
||||
fetch.put("companyCode", "*");
|
||||
fetch.put("template_id", templateId);
|
||||
fetch.put("company_code", "*");
|
||||
return sqlSession.selectOne("approval.selectTemplateById", fetch);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public Map<String, Object> updateTemplate(Map<String, Object> params) {
|
||||
Map<String, Object> checkP = new HashMap<>();
|
||||
checkP.put("templateId", params.get("templateId"));
|
||||
checkP.put("companyCode", params.get("companyCode"));
|
||||
checkP.put("template_id", params.get("template_id"));
|
||||
checkP.put("company_code", params.get("company_code"));
|
||||
if (sqlSession.selectOne("approval.selectTemplateById", checkP) == null)
|
||||
throw new IllegalArgumentException("결재선 템플릿을 찾을 수 없습니다.");
|
||||
|
||||
@@ -110,26 +110,26 @@ public class ApprovalService extends BaseService {
|
||||
|
||||
List<Map<String, Object>> steps = castList(params.get("steps"));
|
||||
if (steps != null) {
|
||||
String cc = (String) params.get("companyCode");
|
||||
long templateId = toLong(params.get("templateId"));
|
||||
String cc = (String) params.get("company_code");
|
||||
long templateId = toLong(params.get("template_id"));
|
||||
Map<String, Object> delP = new HashMap<>();
|
||||
delP.put("templateId", templateId);
|
||||
delP.put("companyCode", cc);
|
||||
delP.put("template_id", templateId);
|
||||
delP.put("company_code", cc);
|
||||
sqlSession.delete("approval.deleteTemplateStepsByTemplateId", delP);
|
||||
insertTemplateSteps(templateId, steps, cc);
|
||||
}
|
||||
|
||||
Map<String, Object> fetch = new HashMap<>();
|
||||
fetch.put("templateId", params.get("templateId"));
|
||||
fetch.put("companyCode", "*");
|
||||
fetch.put("template_id", params.get("template_id"));
|
||||
fetch.put("company_code", "*");
|
||||
return sqlSession.selectOne("approval.selectTemplateById", fetch);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void deleteTemplate(Map<String, Object> params) {
|
||||
Map<String, Object> checkP = new HashMap<>();
|
||||
checkP.put("templateId", params.get("templateId"));
|
||||
checkP.put("companyCode", params.get("companyCode"));
|
||||
checkP.put("template_id", params.get("template_id"));
|
||||
checkP.put("company_code", params.get("company_code"));
|
||||
if (sqlSession.selectOne("approval.selectTemplateById", checkP) == null)
|
||||
throw new IllegalArgumentException("결재선 템플릿을 찾을 수 없습니다.");
|
||||
sqlSession.delete("approval.deleteTemplate", params);
|
||||
@@ -138,8 +138,8 @@ public class ApprovalService extends BaseService {
|
||||
private void insertTemplateSteps(long templateId, List<Map<String, Object>> steps, String companyCode) {
|
||||
for (Map<String, Object> step : steps) {
|
||||
Map<String, Object> sp = new HashMap<>(step);
|
||||
sp.put("templateId", templateId);
|
||||
sp.put("companyCode", companyCode);
|
||||
sp.put("template_id", templateId);
|
||||
sp.put("company_code", companyCode);
|
||||
sqlSession.insert("approval.insertTemplateStep", sp);
|
||||
}
|
||||
}
|
||||
@@ -151,8 +151,8 @@ public class ApprovalService extends BaseService {
|
||||
public Map<String, Object> getRequests(Map<String, Object> params) {
|
||||
int page = toInt(params.getOrDefault("page", "1"));
|
||||
int limit = toInt(params.getOrDefault("limit", "20"));
|
||||
params.put("pageLimit", limit);
|
||||
params.put("pageOffset", (page - 1) * limit);
|
||||
params.put("page_limit", limit);
|
||||
params.put("page_offset", (page - 1) * limit);
|
||||
|
||||
List<Map<String, Object>> data = sqlSession.selectList("approval.selectRequests", params);
|
||||
Number totalNum = sqlSession.selectOne("approval.countRequests", params);
|
||||
@@ -171,18 +171,18 @@ public class ApprovalService extends BaseService {
|
||||
if (request == null) throw new IllegalArgumentException("결재 요청을 찾을 수 없습니다.");
|
||||
|
||||
Map<String, Object> lineP = new HashMap<>();
|
||||
lineP.put("requestId", request.get("request_id"));
|
||||
lineP.put("companyCode", params.get("companyCode"));
|
||||
lineP.put("request_id", request.get("request_id"));
|
||||
lineP.put("company_code", params.get("company_code"));
|
||||
request.put("lines", sqlSession.selectList("approval.selectLinesByRequestId", lineP));
|
||||
return request;
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public Map<String, Object> createRequest(Map<String, Object> params) {
|
||||
String companyCode = (String) params.get("companyCode");
|
||||
String userId = (String) params.get("userId");
|
||||
String userName = (String) params.getOrDefault("requesterName", userId);
|
||||
String deptName = (String) params.getOrDefault("requesterDept", "");
|
||||
String companyCode = (String) params.get("company_code");
|
||||
String userId = (String) params.get("user_id");
|
||||
String userName = (String) params.getOrDefault("requester_name", userId);
|
||||
String deptName = (String) params.getOrDefault("requester_dept", "");
|
||||
String approvalType = (String) params.getOrDefault("approval_type", "escalation");
|
||||
|
||||
String title = (String) params.get("title");
|
||||
@@ -205,8 +205,8 @@ public class ApprovalService extends BaseService {
|
||||
Object defId = params.get("definition_id");
|
||||
if (defId != null) {
|
||||
Map<String, Object> defP = new HashMap<>();
|
||||
defP.put("definitionId", defId);
|
||||
defP.put("companyCode", companyCode);
|
||||
defP.put("definition_id", defId);
|
||||
defP.put("company_code", companyCode);
|
||||
Map<String, Object> def = sqlSession.selectOne("approval.selectDefinitionById", defP);
|
||||
if (def != null) {
|
||||
Object allow = def.get("allow_self_approval");
|
||||
@@ -218,9 +218,9 @@ public class ApprovalService extends BaseService {
|
||||
}
|
||||
Map<String, Object> insertP = buildRequestInsertParams(params, "approved", 1, "self",
|
||||
userId, userName, deptName, safeRecordId, recordDataJson, companyCode);
|
||||
insertP.put("finalApproverId", userId);
|
||||
insertP.put("final_approver_id", userId);
|
||||
sqlSession.insert("approval.insertRequest", insertP);
|
||||
long requestId = toLong(insertP.get("requestId"));
|
||||
long requestId = toLong(insertP.get("request_id"));
|
||||
|
||||
Map<String, Object> lineP = buildLineInsertParams(requestId, 1, userId, userName,
|
||||
null, deptName, "자기결재", "approved", "approval", true, companyCode);
|
||||
@@ -240,60 +240,60 @@ public class ApprovalService extends BaseService {
|
||||
// 같은 step_order에 approval 타입 2명 이상 방지
|
||||
Map<Integer, List<Map<String, Object>>> groups = new LinkedHashMap<>();
|
||||
for (Map<String, Object> a : normalized) {
|
||||
int so = toInt(a.get("stepOrder"));
|
||||
int so = toInt(a.get("step_order"));
|
||||
groups.computeIfAbsent(so, k -> new ArrayList<>()).add(a);
|
||||
}
|
||||
for (Map.Entry<Integer, List<Map<String, Object>>> e : groups.entrySet()) {
|
||||
List<Map<String, Object>> g = e.getValue();
|
||||
if (g.size() > 1 && g.stream().allMatch(a -> "approval".equals(a.get("stepType"))))
|
||||
if (g.size() > 1 && g.stream().allMatch(a -> "approval".equals(a.get("step_type"))))
|
||||
throw new IllegalArgumentException(
|
||||
"step_order " + e.getKey() + "에 approval 타입 결재자가 2명 이상입니다. consensus로 지정해주세요.");
|
||||
}
|
||||
|
||||
int totalSteps = normalized.stream().mapToInt(a -> toInt(a.get("stepOrder"))).max().orElse(1);
|
||||
int totalSteps = normalized.stream().mapToInt(a -> toInt(a.get("step_order"))).max().orElse(1);
|
||||
String storedType = hasExplicitStepType ? "escalation" : approvalType;
|
||||
String initialStatus = "post".equals(approvalType) ? "post_pending" : "requested";
|
||||
|
||||
Map<String, Object> insertP = buildRequestInsertParams(params, initialStatus, totalSteps, storedType,
|
||||
userId, userName, deptName, safeRecordId, recordDataJson, companyCode);
|
||||
sqlSession.insert("approval.insertRequest", insertP);
|
||||
long requestId = toLong(insertP.get("requestId"));
|
||||
long requestId = toLong(insertP.get("request_id"));
|
||||
|
||||
List<Integer> uniqueSteps = normalized.stream()
|
||||
.map(a -> toInt(a.get("stepOrder"))).distinct().sorted().collect(Collectors.toList());
|
||||
.map(a -> toInt(a.get("step_order"))).distinct().sorted().collect(Collectors.toList());
|
||||
int firstStep = uniqueSteps.get(0);
|
||||
|
||||
for (Map<String, Object> approver : normalized) {
|
||||
int so = toInt(approver.get("stepOrder"));
|
||||
int so = toInt(approver.get("step_order"));
|
||||
String ls = (so == firstStep) ? "pending" : "waiting";
|
||||
Map<String, Object> lp = buildLineInsertParams(requestId, so,
|
||||
(String) approver.get("approverId"), (String) approver.get("approverName"),
|
||||
(String) approver.get("approverPosition"), (String) approver.get("approverDept"),
|
||||
(String) approver.get("approverLabel"), ls, (String) approver.get("stepType"),
|
||||
(String) approver.get("approver_id"), (String) approver.get("approver_name"),
|
||||
(String) approver.get("approver_position"), (String) approver.get("approver_dept"),
|
||||
(String) approver.get("approver_label"), ls, (String) approver.get("step_type"),
|
||||
false, companyCode);
|
||||
sqlSession.insert("approval.insertLine", lp);
|
||||
}
|
||||
|
||||
// 첫 step이 notification이면 자동 통과
|
||||
String firstStepType = normalized.stream()
|
||||
.filter(a -> toInt(a.get("stepOrder")) == firstStep)
|
||||
.map(a -> (String) a.get("stepType"))
|
||||
.filter(a -> toInt(a.get("step_order")) == firstStep)
|
||||
.map(a -> (String) a.get("step_type"))
|
||||
.findFirst().orElse("approval");
|
||||
|
||||
if ("notification".equals(firstStepType)) {
|
||||
Map<String, Object> notifP = new HashMap<>();
|
||||
notifP.put("requestId", requestId);
|
||||
notifP.put("stepOrder", firstStep);
|
||||
notifP.put("companyCode", companyCode);
|
||||
notifP.put("request_id", requestId);
|
||||
notifP.put("step_order", firstStep);
|
||||
notifP.put("company_code", companyCode);
|
||||
sqlSession.update("approval.approveNotificationLines", notifP);
|
||||
activateNextStep(requestId, firstStep, totalSteps, companyCode, userId, null);
|
||||
}
|
||||
|
||||
if (!"post".equals(approvalType)) {
|
||||
Map<String, Object> statusP = new HashMap<>();
|
||||
statusP.put("requestId", requestId);
|
||||
statusP.put("request_id", requestId);
|
||||
statusP.put("status", "in_progress");
|
||||
statusP.put("companyCode", companyCode);
|
||||
statusP.put("company_code", companyCode);
|
||||
sqlSession.update("approval.updateRequestStatus", statusP);
|
||||
syncApprovalStatusToTarget(requestId, "in_progress", companyCode);
|
||||
} else {
|
||||
@@ -305,13 +305,13 @@ public class ApprovalService extends BaseService {
|
||||
|
||||
@Transactional
|
||||
public void cancelRequest(Map<String, Object> params) {
|
||||
long requestId = toLong(params.get("requestId"));
|
||||
String companyCode = (String) params.get("companyCode");
|
||||
String userId = (String) params.get("userId");
|
||||
long requestId = toLong(params.get("request_id"));
|
||||
String companyCode = (String) params.get("company_code");
|
||||
String userId = (String) params.get("user_id");
|
||||
|
||||
Map<String, Object> reqP = new HashMap<>();
|
||||
reqP.put("requestId", requestId);
|
||||
reqP.put("companyCode", companyCode);
|
||||
reqP.put("request_id", requestId);
|
||||
reqP.put("company_code", companyCode);
|
||||
Map<String, Object> request = sqlSession.selectOne("approval.selectRequestById", reqP);
|
||||
if (request == null) throw new IllegalArgumentException("결재 요청을 찾을 수 없습니다.");
|
||||
if (!userId.equals(String.valueOf(request.get("requester_id"))))
|
||||
@@ -326,14 +326,14 @@ public class ApprovalService extends BaseService {
|
||||
|
||||
@Transactional
|
||||
public void postApprove(Map<String, Object> params) {
|
||||
long requestId = toLong(params.get("requestId"));
|
||||
String companyCode = (String) params.get("companyCode");
|
||||
String userId = (String) params.get("userId");
|
||||
long requestId = toLong(params.get("request_id"));
|
||||
String companyCode = (String) params.get("company_code");
|
||||
String userId = (String) params.get("user_id");
|
||||
String comment = (String) params.get("comment");
|
||||
|
||||
Map<String, Object> reqP = new HashMap<>();
|
||||
reqP.put("requestId", requestId);
|
||||
reqP.put("companyCode", companyCode);
|
||||
reqP.put("request_id", requestId);
|
||||
reqP.put("company_code", companyCode);
|
||||
Map<String, Object> request = sqlSession.selectOne("approval.selectRequestById", reqP);
|
||||
if (request == null) throw new IllegalArgumentException("결재 요청을 찾을 수 없습니다.");
|
||||
if (!"post".equals(request.get("approval_type")))
|
||||
@@ -346,9 +346,9 @@ public class ApprovalService extends BaseService {
|
||||
if (pending > 0) throw new IllegalArgumentException("모든 결재자의 승인이 완료되지 않았습니다.");
|
||||
|
||||
Map<String, Object> p = new HashMap<>();
|
||||
p.put("requestId", requestId);
|
||||
p.put("companyCode", companyCode);
|
||||
p.put("userId", userId);
|
||||
p.put("request_id", requestId);
|
||||
p.put("company_code", companyCode);
|
||||
p.put("user_id", userId);
|
||||
p.put("comment", comment);
|
||||
sqlSession.update("approval.postApproveRequest", p);
|
||||
syncApprovalStatusToTarget(requestId, "approved", companyCode);
|
||||
@@ -364,16 +364,16 @@ public class ApprovalService extends BaseService {
|
||||
|
||||
@Transactional
|
||||
public void processApproval(Map<String, Object> params) {
|
||||
String companyCode = (String) params.get("companyCode");
|
||||
String userId = (String) params.get("userId");
|
||||
long lineId = toLong(params.get("lineId"));
|
||||
String companyCode = (String) params.get("company_code");
|
||||
String userId = (String) params.get("user_id");
|
||||
long lineId = toLong(params.get("line_id"));
|
||||
String action = (String) params.get("action");
|
||||
String comment = (String) params.get("comment");
|
||||
String proxyReason = (String) params.get("proxy_reason");
|
||||
|
||||
Map<String, Object> lockP = new HashMap<>();
|
||||
lockP.put("lineId", lineId);
|
||||
lockP.put("companyCode", companyCode);
|
||||
lockP.put("line_id", lineId);
|
||||
lockP.put("company_code", companyCode);
|
||||
Map<String, Object> line = sqlSession.selectOne("approval.selectLineByIdForUpdate", lockP);
|
||||
if (line == null) throw new IllegalArgumentException("결재 라인을 찾을 수 없습니다.");
|
||||
if (!"pending".equals(line.get("status"))) throw new IllegalArgumentException("대기 중인 결재만 처리할 수 있습니다.");
|
||||
@@ -391,9 +391,9 @@ public class ApprovalService extends BaseService {
|
||||
proxyReasonVal = proxyReason != null ? proxyReason : "최고관리자 대리 처리";
|
||||
} else {
|
||||
Map<String, Object> proxyP = new HashMap<>();
|
||||
proxyP.put("originalUserId", approverId);
|
||||
proxyP.put("proxyUserId", userId);
|
||||
proxyP.put("companyCode", lineCC);
|
||||
proxyP.put("original_user_id", approverId);
|
||||
proxyP.put("proxy_user_id", userId);
|
||||
proxyP.put("company_code", lineCC);
|
||||
Map<String, Object> proxy = sqlSession.selectOne("approval.selectActiveProxyForLine", proxyP);
|
||||
if (proxy == null) throw new IllegalArgumentException("본인이 결재자로 지정된 건만 처리할 수 있습니다.");
|
||||
proxyFor = approverId;
|
||||
@@ -404,16 +404,16 @@ public class ApprovalService extends BaseService {
|
||||
|
||||
// 현재 라인 업데이트
|
||||
Map<String, Object> updLineP = new HashMap<>();
|
||||
updLineP.put("lineId", lineId);
|
||||
updLineP.put("line_id", lineId);
|
||||
updLineP.put("status", action);
|
||||
updLineP.put("comment", comment);
|
||||
updLineP.put("proxyFor", proxyFor);
|
||||
updLineP.put("proxyReason", proxyReasonVal);
|
||||
updLineP.put("companyCode", lineCC);
|
||||
updLineP.put("proxy_for", proxyFor);
|
||||
updLineP.put("proxy_reason", proxyReasonVal);
|
||||
updLineP.put("company_code", lineCC);
|
||||
sqlSession.update("approval.updateLine", updLineP);
|
||||
|
||||
Map<String, Object> reqForUpdate = sqlSession.selectOne("approval.selectRequestByIdForUpdate",
|
||||
Map.of("requestId", requestId, "companyCode", lineCC));
|
||||
Map.of("request_id", requestId, "company_code", lineCC));
|
||||
if (reqForUpdate == null) return;
|
||||
|
||||
int totalSteps = toInt(reqForUpdate.get("total_steps"));
|
||||
@@ -422,34 +422,34 @@ public class ApprovalService extends BaseService {
|
||||
|
||||
if ("rejected".equals(action)) {
|
||||
Map<String, Object> rejP = new HashMap<>();
|
||||
rejP.put("requestId", requestId);
|
||||
rejP.put("companyCode", lineCC);
|
||||
rejP.put("userId", userId);
|
||||
rejP.put("request_id", requestId);
|
||||
rejP.put("company_code", lineCC);
|
||||
rejP.put("user_id", userId);
|
||||
rejP.put("comment", comment);
|
||||
sqlSession.update("approval.rejectRequest", rejP);
|
||||
Map<String, Object> skipP = new HashMap<>();
|
||||
skipP.put("requestId", requestId);
|
||||
skipP.put("lineId", lineId);
|
||||
skipP.put("companyCode", lineCC);
|
||||
skipP.put("request_id", requestId);
|
||||
skipP.put("line_id", lineId);
|
||||
skipP.put("company_code", lineCC);
|
||||
sqlSession.update("approval.skipRemainingLines", skipP);
|
||||
syncApprovalStatusToTarget(requestId, "rejected", lineCC);
|
||||
} else {
|
||||
if (isLegacy) {
|
||||
Number remainingNum = sqlSession.selectOne("approval.countRemainingLinesInStep",
|
||||
Map.of("requestId", requestId, "stepOrder", stepOrder, "lineId", lineId, "companyCode", lineCC));
|
||||
Map.of("request_id", requestId, "step_order", stepOrder, "line_id", lineId, "company_code", lineCC));
|
||||
int remaining = remainingNum != null ? remainingNum.intValue() : 0;
|
||||
if (remaining == 0) {
|
||||
Map<String, Object> complP = new HashMap<>();
|
||||
complP.put("requestId", requestId);
|
||||
complP.put("companyCode", lineCC);
|
||||
complP.put("userId", userId);
|
||||
complP.put("request_id", requestId);
|
||||
complP.put("company_code", lineCC);
|
||||
complP.put("user_id", userId);
|
||||
complP.put("comment", comment);
|
||||
sqlSession.update("approval.completeRequest", complP);
|
||||
syncApprovalStatusToTarget(requestId, "approved", lineCC);
|
||||
}
|
||||
} else if ("consensus".equals(stepType)) {
|
||||
Number remainingNum = sqlSession.selectOne("approval.countRemainingLinesInStep",
|
||||
Map.of("requestId", requestId, "stepOrder", stepOrder, "lineId", lineId, "companyCode", lineCC));
|
||||
Map.of("request_id", requestId, "step_order", stepOrder, "line_id", lineId, "company_code", lineCC));
|
||||
int remaining = remainingNum != null ? remainingNum.intValue() : 0;
|
||||
if (remaining == 0) activateNextStep(requestId, stepOrder, totalSteps, lineCC, userId, comment);
|
||||
} else {
|
||||
@@ -484,7 +484,7 @@ public class ApprovalService extends BaseService {
|
||||
sqlSession.insert("approval.insertProxySetting", params);
|
||||
Map<String, Object> fetch = new HashMap<>();
|
||||
fetch.put("id", params.get("id"));
|
||||
fetch.put("companyCode", params.get("companyCode"));
|
||||
fetch.put("company_code", params.get("company_code"));
|
||||
return sqlSession.selectOne("approval.selectProxyById", fetch);
|
||||
}
|
||||
|
||||
@@ -492,7 +492,7 @@ public class ApprovalService extends BaseService {
|
||||
public Map<String, Object> updateProxySetting(Map<String, Object> params) {
|
||||
Map<String, Object> checkP = new HashMap<>();
|
||||
checkP.put("id", params.get("id"));
|
||||
checkP.put("companyCode", params.get("companyCode"));
|
||||
checkP.put("company_code", params.get("company_code"));
|
||||
if (sqlSession.selectOne("approval.selectProxyById", checkP) == null)
|
||||
throw new IllegalArgumentException("대결 위임 설정을 찾을 수 없습니다.");
|
||||
sqlSession.update("approval.updateProxySetting", params);
|
||||
@@ -517,9 +517,9 @@ public class ApprovalService extends BaseService {
|
||||
String companyCode, String userId, String comment) {
|
||||
int nextStep = currentStep + 1;
|
||||
Map<String, Object> complP = new HashMap<>();
|
||||
complP.put("requestId", requestId);
|
||||
complP.put("companyCode", companyCode);
|
||||
complP.put("userId", userId);
|
||||
complP.put("request_id", requestId);
|
||||
complP.put("company_code", companyCode);
|
||||
complP.put("user_id", userId);
|
||||
complP.put("comment", comment);
|
||||
|
||||
if (nextStep > totalSteps) {
|
||||
@@ -529,7 +529,7 @@ public class ApprovalService extends BaseService {
|
||||
}
|
||||
|
||||
List<Map<String, Object>> nextLines = sqlSession.selectList("approval.selectLinesForStep",
|
||||
Map.of("requestId", requestId, "stepOrder", nextStep, "companyCode", companyCode));
|
||||
Map.of("request_id", requestId, "step_order", nextStep, "company_code", companyCode));
|
||||
|
||||
if (nextLines.isEmpty()) {
|
||||
sqlSession.update("approval.completeRequest", complP);
|
||||
@@ -541,21 +541,21 @@ public class ApprovalService extends BaseService {
|
||||
|
||||
if ("notification".equals(nextStepType)) {
|
||||
Map<String, Object> notifP = new HashMap<>();
|
||||
notifP.put("requestId", requestId);
|
||||
notifP.put("stepOrder", nextStep);
|
||||
notifP.put("companyCode", companyCode);
|
||||
notifP.put("request_id", requestId);
|
||||
notifP.put("step_order", nextStep);
|
||||
notifP.put("company_code", companyCode);
|
||||
sqlSession.update("approval.approveNotificationLines", notifP);
|
||||
Map<String, Object> stepP = new HashMap<>();
|
||||
stepP.put("requestId", requestId);
|
||||
stepP.put("nextStep", nextStep);
|
||||
stepP.put("companyCode", companyCode);
|
||||
stepP.put("request_id", requestId);
|
||||
stepP.put("next_step", nextStep);
|
||||
stepP.put("company_code", companyCode);
|
||||
sqlSession.update("approval.updateRequestCurrentStep", stepP);
|
||||
activateNextStep(requestId, nextStep, totalSteps, companyCode, userId, comment);
|
||||
} else {
|
||||
Map<String, Object> actP = new HashMap<>();
|
||||
actP.put("requestId", requestId);
|
||||
actP.put("nextStep", nextStep);
|
||||
actP.put("companyCode", companyCode);
|
||||
actP.put("request_id", requestId);
|
||||
actP.put("next_step", nextStep);
|
||||
actP.put("company_code", companyCode);
|
||||
sqlSession.update("approval.activateNextStepLines", actP);
|
||||
sqlSession.update("approval.updateRequestCurrentStep", actP);
|
||||
}
|
||||
@@ -564,8 +564,8 @@ public class ApprovalService extends BaseService {
|
||||
private void syncApprovalStatusToTarget(long requestId, String newStatus, String companyCode) {
|
||||
try {
|
||||
Map<String, Object> syncP = new HashMap<>();
|
||||
syncP.put("requestId", requestId);
|
||||
syncP.put("companyCode", companyCode);
|
||||
syncP.put("request_id", requestId);
|
||||
syncP.put("company_code", companyCode);
|
||||
Map<String, Object> req = sqlSession.selectOne("approval.selectRequestForSync", syncP);
|
||||
if (req == null) return;
|
||||
|
||||
@@ -579,7 +579,7 @@ public class ApprovalService extends BaseService {
|
||||
if (safeTable.isEmpty()) return;
|
||||
|
||||
Number hasColNum = sqlSession.selectOne("approval.checkTargetTableHasApprovalStatusColumn",
|
||||
Map.of("tableName", safeTable));
|
||||
Map.of("table_name", safeTable));
|
||||
int hasCol = hasColNum != null ? hasColNum.intValue() : 0;
|
||||
if (hasCol == 0) return;
|
||||
|
||||
@@ -593,10 +593,10 @@ public class ApprovalService extends BaseService {
|
||||
String businessStatus = statusMap.getOrDefault(newStatus, newStatus);
|
||||
|
||||
Map<String, Object> updP = new HashMap<>();
|
||||
updP.put("tableName", safeTable);
|
||||
updP.put("approvalStatus", businessStatus);
|
||||
updP.put("targetRecordId", targetRecordId);
|
||||
updP.put("companyCode", companyCode);
|
||||
updP.put("table_name", safeTable);
|
||||
updP.put("approval_status", businessStatus);
|
||||
updP.put("target_record_id", targetRecordId);
|
||||
updP.put("company_code", companyCode);
|
||||
sqlSession.update("approval.updateTargetTableApprovalStatus", updP);
|
||||
|
||||
if ("approved".equals(newStatus))
|
||||
@@ -612,26 +612,26 @@ public class ApprovalService extends BaseService {
|
||||
for (int i = 0; i < approvers.size(); i++) {
|
||||
Map<String, Object> a = approvers.get(i);
|
||||
Map<String, Object> norm = new HashMap<>();
|
||||
norm.put("approverId", a.get("approver_id"));
|
||||
norm.put("approverName", a.get("approver_name"));
|
||||
norm.put("approverPosition", a.get("approver_position"));
|
||||
norm.put("approverDept", a.get("approver_dept"));
|
||||
norm.put("approver_id", a.get("approver_id"));
|
||||
norm.put("approver_name", a.get("approver_name"));
|
||||
norm.put("approver_position", a.get("approver_position"));
|
||||
norm.put("approver_dept", a.get("approver_dept"));
|
||||
|
||||
if ("consensus".equals(approvalType) && !hasExplicitStepType) {
|
||||
norm.put("approverLabel", a.getOrDefault("approver_label", "합의 결재"));
|
||||
norm.put("stepOrder", 1);
|
||||
norm.put("stepType", "consensus");
|
||||
norm.put("approver_label", a.getOrDefault("approver_label", "합의 결재"));
|
||||
norm.put("step_order", 1);
|
||||
norm.put("step_type", "consensus");
|
||||
} else if (hasExplicitStepType) {
|
||||
norm.put("approverLabel", a.get("approver_label"));
|
||||
norm.put("approver_label", a.get("approver_label"));
|
||||
Object so = a.get("step_order");
|
||||
norm.put("stepOrder", so != null ? toInt(so) : i + 1);
|
||||
norm.put("stepType", a.getOrDefault("step_type", "approval"));
|
||||
norm.put("step_order", so != null ? toInt(so) : i + 1);
|
||||
norm.put("step_type", a.getOrDefault("step_type", "approval"));
|
||||
} else {
|
||||
Object label = a.get("approver_label");
|
||||
norm.put("approverLabel", label != null ? label : (i + 1) + "차 결재");
|
||||
norm.put("approver_label", label != null ? label : (i + 1) + "차 결재");
|
||||
Object so = a.get("step_order");
|
||||
norm.put("stepOrder", so != null ? toInt(so) : i + 1);
|
||||
norm.put("stepType", "approval");
|
||||
norm.put("step_order", so != null ? toInt(so) : i + 1);
|
||||
norm.put("step_type", "approval");
|
||||
}
|
||||
result.add(norm);
|
||||
}
|
||||
@@ -647,8 +647,8 @@ public class ApprovalService extends BaseService {
|
||||
|
||||
private Map<String, Object> fetchRequest(long requestId) {
|
||||
Map<String, Object> p = new HashMap<>();
|
||||
p.put("requestId", requestId);
|
||||
p.put("companyCode", "*");
|
||||
p.put("request_id", requestId);
|
||||
p.put("company_code", "*");
|
||||
return sqlSession.selectOne("approval.selectRequestById", p);
|
||||
}
|
||||
|
||||
@@ -659,20 +659,20 @@ public class ApprovalService extends BaseService {
|
||||
Map<String, Object> p = new HashMap<>();
|
||||
p.put("title", src.get("title"));
|
||||
p.put("description", src.get("description"));
|
||||
p.put("definitionId", src.get("definition_id"));
|
||||
p.put("templateId", src.get("template_id"));
|
||||
p.put("targetTable", src.get("target_table"));
|
||||
p.put("targetRecordId", safeRecordId);
|
||||
p.put("targetRecordData", recordDataJson);
|
||||
p.put("definition_id", src.get("definition_id"));
|
||||
p.put("template_id", src.get("template_id"));
|
||||
p.put("target_table", src.get("target_table"));
|
||||
p.put("target_record_id", safeRecordId);
|
||||
p.put("target_record_data", recordDataJson);
|
||||
p.put("status", status);
|
||||
p.put("totalSteps", totalSteps);
|
||||
p.put("approvalType", approvalType);
|
||||
p.put("requesterId", userId);
|
||||
p.put("requesterName", userName);
|
||||
p.put("requesterDept", deptName);
|
||||
p.put("screenId", src.get("screen_id"));
|
||||
p.put("buttonComponentId", src.get("button_component_id"));
|
||||
p.put("companyCode", companyCode);
|
||||
p.put("total_steps", totalSteps);
|
||||
p.put("approval_type", approvalType);
|
||||
p.put("requester_id", userId);
|
||||
p.put("requester_name", userName);
|
||||
p.put("requester_dept", deptName);
|
||||
p.put("screen_id", src.get("screen_id"));
|
||||
p.put("button_component_id", src.get("button_component_id"));
|
||||
p.put("company_code", companyCode);
|
||||
return p;
|
||||
}
|
||||
|
||||
@@ -681,17 +681,17 @@ public class ApprovalService extends BaseService {
|
||||
String approverPosition, String approverDept, String approverLabel,
|
||||
String status, String stepType, boolean alreadyProcessed, String companyCode) {
|
||||
Map<String, Object> p = new HashMap<>();
|
||||
p.put("requestId", requestId);
|
||||
p.put("stepOrder", stepOrder);
|
||||
p.put("approverId", approverId);
|
||||
p.put("approverName", approverName);
|
||||
p.put("approverPosition", approverPosition);
|
||||
p.put("approverDept", approverDept);
|
||||
p.put("approverLabel", approverLabel);
|
||||
p.put("request_id", requestId);
|
||||
p.put("step_order", stepOrder);
|
||||
p.put("approver_id", approverId);
|
||||
p.put("approver_name", approverName);
|
||||
p.put("approver_position", approverPosition);
|
||||
p.put("approver_dept", approverDept);
|
||||
p.put("approver_label", approverLabel);
|
||||
p.put("status", status);
|
||||
p.put("stepType", stepType);
|
||||
p.put("processedAt", alreadyProcessed ? Boolean.TRUE : null);
|
||||
p.put("companyCode", companyCode);
|
||||
p.put("step_type", stepType);
|
||||
p.put("processed_at", alreadyProcessed ? Boolean.TRUE : null);
|
||||
p.put("company_code", companyCode);
|
||||
return p;
|
||||
}
|
||||
|
||||
|
||||
@@ -51,14 +51,14 @@ public class AuditLogService extends BaseService {
|
||||
*/
|
||||
public Map<String, Object> getStats(String companyCode, int days) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("days", days);
|
||||
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("dailyCounts", sqlSession.selectList("auditLog.selectDailyCounts", params));
|
||||
result.put("resourceTypeCounts", sqlSession.selectList("auditLog.selectResourceTypeCounts", params));
|
||||
result.put("actionCounts", sqlSession.selectList("auditLog.selectActionCounts", params));
|
||||
result.put("topUsers", sqlSession.selectList("auditLog.selectTopUsers", params));
|
||||
result.put("daily_counts", sqlSession.selectList("auditLog.selectDailyCounts", params));
|
||||
result.put("resource_type_counts", sqlSession.selectList("auditLog.selectResourceTypeCounts", params));
|
||||
result.put("action_counts", sqlSession.selectList("auditLog.selectActionCounts", params));
|
||||
result.put("top_users", sqlSession.selectList("auditLog.selectTopUsers", params));
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -67,8 +67,8 @@ public class AuditLogService extends BaseService {
|
||||
*/
|
||||
public List<Map<String, Object>> getAuditLogUsers(String companyCode, boolean isSuperAdmin) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("companyCode", companyCode);
|
||||
params.put("excludeWildcard", !isSuperAdmin);
|
||||
params.put("company_code", companyCode);
|
||||
params.put("exclude_wildcard", !isSuperAdmin);
|
||||
return sqlSession.selectList("auditLog.selectAuditLogUsers", params);
|
||||
}
|
||||
|
||||
|
||||
@@ -36,15 +36,15 @@ public class AuthService extends BaseService {
|
||||
* Node.js AuthService.processLogin() 포팅
|
||||
*/
|
||||
public Map<String, Object> login(Map<String, Object> params) {
|
||||
String userId = (String) params.get("userId");
|
||||
String userId = (String) params.get("user_id");
|
||||
String password = (String) params.get("password");
|
||||
String remoteAddr = (String) params.getOrDefault("remoteAddr", "unknown");
|
||||
String remoteAddr = (String) params.getOrDefault("remote_addr", "unknown");
|
||||
|
||||
// 1. 비밀번호 검증
|
||||
boolean loginSuccess = false;
|
||||
String errorReason = null;
|
||||
|
||||
Map<String, Object> pwRow = sqlSession.selectOne("auth.selectUserPassword", Map.of("userId", userId));
|
||||
Map<String, Object> pwRow = sqlSession.selectOne("auth.selectUserPassword", Map.of("user_id", userId));
|
||||
if (pwRow == null) {
|
||||
errorReason = "사용자가 존재하지 않습니다.";
|
||||
} else {
|
||||
@@ -63,15 +63,15 @@ public class AuthService extends BaseService {
|
||||
// 2. 로그인 로그 기록 (실패해도 로그인 프로세스 유지)
|
||||
try {
|
||||
Map<String, Object> logParams = new HashMap<>();
|
||||
logParams.put("systemName", "PMS");
|
||||
logParams.put("userId", userId);
|
||||
logParams.put("loginResult", loginSuccess);
|
||||
logParams.put("errorMessage", errorReason);
|
||||
logParams.put("remoteAddr", remoteAddr);
|
||||
logParams.put("recptnDt", null);
|
||||
logParams.put("recptnRsltDtl", null);
|
||||
logParams.put("recptnRslt", null);
|
||||
logParams.put("recptnRsltCd", null);
|
||||
logParams.put("system_name", "PMS");
|
||||
logParams.put("user_id", userId);
|
||||
logParams.put("login_result", loginSuccess);
|
||||
logParams.put("error_message", errorReason);
|
||||
logParams.put("remote_addr", remoteAddr);
|
||||
logParams.put("recptn_dt", null);
|
||||
logParams.put("recptn_rslt_dtl", null);
|
||||
logParams.put("recptn_rslt", null);
|
||||
logParams.put("recptn_rslt_cd", null);
|
||||
sqlSession.insert("auth.insertLoginLog", logParams);
|
||||
} catch (Exception e) {
|
||||
log.warn("로그인 로그 기록 실패 (무시): {}", e.getMessage());
|
||||
@@ -79,17 +79,17 @@ public class AuthService extends BaseService {
|
||||
|
||||
if (!loginSuccess) {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("loginFailed", true);
|
||||
result.put("errorReason", errorReason);
|
||||
result.put("login_failed", true);
|
||||
result.put("error_reason", errorReason);
|
||||
return result;
|
||||
}
|
||||
|
||||
// 3. 사용자 정보 조회
|
||||
Map<String, Object> userInfoRow = sqlSession.selectOne("auth.selectUserInfo", Map.of("userId", userId));
|
||||
Map<String, Object> userInfoRow = sqlSession.selectOne("auth.selectUserInfo", Map.of("user_id", userId));
|
||||
if (userInfoRow == null) {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("loginFailed", true);
|
||||
result.put("errorReason", "사용자 정보를 조회할 수 없습니다.");
|
||||
result.put("login_failed", true);
|
||||
result.put("error_reason", "사용자 정보를 조회할 수 없습니다.");
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -101,29 +101,29 @@ public class AuthService extends BaseService {
|
||||
String companyName = "";
|
||||
if (companyCode != null) {
|
||||
Map<String, Object> companyRow = sqlSession.selectOne("auth.selectCompanyName",
|
||||
Map.of("companyCode", companyCode));
|
||||
Map.of("company_code", companyCode));
|
||||
companyName = companyRow != null ? getStr(companyRow, "company_name", "") : "";
|
||||
}
|
||||
|
||||
// 5. JWT 토큰 생성 — Node.js 동일 페이로드 구조
|
||||
Map<String, Object> personBean = new HashMap<>();
|
||||
personBean.put("userId", userId);
|
||||
personBean.put("userName", getStr(userInfoRow, "user_name", ""));
|
||||
personBean.put("deptName", getStr(userInfoRow, "dept_name", ""));
|
||||
personBean.put("companyCode", companyCode);
|
||||
personBean.put("companyName", companyName);
|
||||
personBean.put("userType", userType);
|
||||
personBean.put("userTypeName", getStr(userInfoRow, "user_type_name", "일반사용자"));
|
||||
personBean.put("user_id", userId);
|
||||
personBean.put("user_name", getStr(userInfoRow, "user_name", ""));
|
||||
personBean.put("dept_name", getStr(userInfoRow, "dept_name", ""));
|
||||
personBean.put("company_code", companyCode);
|
||||
personBean.put("company_name", companyName);
|
||||
personBean.put("user_type", userType);
|
||||
personBean.put("user_type_name", getStr(userInfoRow, "user_type_name", "일반사용자"));
|
||||
String token = jwtTokenProvider.generateToken(personBean);
|
||||
|
||||
// 6. firstMenuPath 계산 (Node.js authController 동일 로직)
|
||||
String firstMenuPath = null;
|
||||
try {
|
||||
Map<String, Object> menuParams = new HashMap<>();
|
||||
menuParams.put("companyCode", companyCode);
|
||||
menuParams.put("userType", userType);
|
||||
menuParams.put("userLang", "ko");
|
||||
List<Map<String, Object>> menuList = sqlSession.selectList(NS_ADMIN + "selectUserMenuList", menuParams);
|
||||
menuParams.put("company_code", companyCode);
|
||||
menuParams.put("user_type", userType);
|
||||
menuParams.put("user_lang", "ko");
|
||||
List<Map<String, Object>> menuList = sqlSession.selectList(NS_ADMIN + "select_user_menu_list", menuParams);
|
||||
firstMenuPath = menuList.stream()
|
||||
.filter(m -> {
|
||||
Object levObj = m.get("lev");
|
||||
@@ -141,14 +141,14 @@ public class AuthService extends BaseService {
|
||||
String popLandingPath = null;
|
||||
try {
|
||||
Map<String, Object> popParams = new HashMap<>();
|
||||
popParams.put("companyCode", companyCode);
|
||||
popParams.put("userType", userType);
|
||||
Map<String, Object> parentMenu = sqlSession.selectOne(NS_ADMIN + "selectPopParentMenu", popParams);
|
||||
popParams.put("company_code", companyCode);
|
||||
popParams.put("user_type", userType);
|
||||
Map<String, Object> parentMenu = sqlSession.selectOne(NS_ADMIN + "select_pop_parent_menu", popParams);
|
||||
if (parentMenu != null) {
|
||||
Map<String, Object> childParams = new HashMap<>();
|
||||
childParams.put("parentObjid", parentMenu.get("objid"));
|
||||
childParams.put("parentCompanyCode", parentMenu.get("company_code"));
|
||||
List<Map<String, Object>> childMenus = sqlSession.selectList(NS_ADMIN + "selectPopChildMenus", childParams);
|
||||
childParams.put("parent_objid", parentMenu.get("objid"));
|
||||
childParams.put("parent_company_code", parentMenu.get("company_code"));
|
||||
List<Map<String, Object>> childMenus = sqlSession.selectList(NS_ADMIN + "select_pop_child_menus", childParams);
|
||||
Map<String, Object> landingMenu = childMenus.stream()
|
||||
.filter(m -> {
|
||||
Object desc = m.get("menu_desc");
|
||||
@@ -169,16 +169,16 @@ public class AuthService extends BaseService {
|
||||
|
||||
// 8. 응답 data 구성 (Node.js 응답 형식 일치)
|
||||
Map<String, Object> userInfo = new HashMap<>();
|
||||
userInfo.put("userId", userId);
|
||||
userInfo.put("userName", getStr(userInfoRow, "user_name", ""));
|
||||
userInfo.put("deptName", getStr(userInfoRow, "dept_name", ""));
|
||||
userInfo.put("companyCode", companyCode);
|
||||
userInfo.put("user_id", userId);
|
||||
userInfo.put("user_name", getStr(userInfoRow, "user_name", ""));
|
||||
userInfo.put("dept_name", getStr(userInfoRow, "dept_name", ""));
|
||||
userInfo.put("company_code", companyCode);
|
||||
|
||||
Map<String, Object> data = new HashMap<>();
|
||||
data.put("userInfo", userInfo);
|
||||
data.put("user_info", userInfo);
|
||||
data.put("token", token);
|
||||
data.put("firstMenuPath", firstMenuPath);
|
||||
data.put("popLandingPath", popLandingPath);
|
||||
data.put("first_menu_path", firstMenuPath);
|
||||
data.put("pop_landing_path", popLandingPath);
|
||||
|
||||
log.info("로그인 성공: {} ({})", userId, remoteAddr);
|
||||
return data;
|
||||
@@ -191,13 +191,13 @@ public class AuthService extends BaseService {
|
||||
public Map<String, Object> refreshToken(String token) {
|
||||
Claims claims = jwtTokenProvider.getClaims(token);
|
||||
Map<String, Object> personBean = new HashMap<>();
|
||||
personBean.put("userId", claims.get("userId", String.class));
|
||||
personBean.put("userName", claims.get("userName", String.class));
|
||||
personBean.put("deptName", claims.get("deptName", String.class));
|
||||
personBean.put("companyCode", claims.get("companyCode", String.class));
|
||||
personBean.put("companyName", claims.get("companyName", String.class));
|
||||
personBean.put("userType", claims.get("userType", String.class));
|
||||
personBean.put("userTypeName", claims.get("userTypeName", String.class));
|
||||
personBean.put("user_id", claims.get("user_id", String.class));
|
||||
personBean.put("user_name", claims.get("user_name", String.class));
|
||||
personBean.put("dept_name", claims.get("dept_name", String.class));
|
||||
personBean.put("company_code", claims.get("company_code", String.class));
|
||||
personBean.put("company_name", claims.get("company_name", String.class));
|
||||
personBean.put("user_type", claims.get("user_type", String.class));
|
||||
personBean.put("user_type_name", claims.get("user_type_name", String.class));
|
||||
|
||||
String newToken = jwtTokenProvider.generateToken(personBean);
|
||||
|
||||
@@ -212,17 +212,17 @@ public class AuthService extends BaseService {
|
||||
*/
|
||||
public Map<String, Object> getUserInfo(String token) {
|
||||
Claims claims = jwtTokenProvider.getClaims(token);
|
||||
String userId = claims.get("userId", String.class);
|
||||
String jwtCompanyCode = claims.get("companyCode", String.class);
|
||||
String jwtUserType = claims.get("userType", String.class);
|
||||
String userId = claims.get("user_id", String.class);
|
||||
String jwtCompanyCode = claims.get("company_code", String.class);
|
||||
String jwtUserType = claims.get("user_type", String.class);
|
||||
|
||||
Map<String, Object> dbUser = sqlSession.selectOne("auth.selectUserInfo", Map.of("userId", userId));
|
||||
Map<String, Object> dbUser = sqlSession.selectOne("auth.selectUserInfo", Map.of("user_id", userId));
|
||||
if (dbUser == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// 권한명 목록 조회
|
||||
List<Map<String, Object>> authList = sqlSession.selectList("auth.selectUserAuth", Map.of("userId", userId));
|
||||
List<Map<String, Object>> authList = sqlSession.selectList("auth.selectUserAuth", Map.of("user_id", userId));
|
||||
String authNames = authList.stream()
|
||||
.map(a -> getStr(a, "auth_name", ""))
|
||||
.collect(Collectors.joining(","));
|
||||
@@ -240,19 +240,19 @@ public class AuthService extends BaseService {
|
||||
}
|
||||
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("userId", userId);
|
||||
result.put("userName", getStr(dbUser, "user_name", ""));
|
||||
result.put("deptName", getStr(dbUser, "dept_name", ""));
|
||||
result.put("companyCode", companyCode);
|
||||
result.put("user_id", userId);
|
||||
result.put("user_name", getStr(dbUser, "user_name", ""));
|
||||
result.put("dept_name", getStr(dbUser, "dept_name", ""));
|
||||
result.put("company_code", companyCode);
|
||||
result.put("userType", userType);
|
||||
result.put("userTypeName", getStr(dbUser, "user_type_name", "일반사용자"));
|
||||
result.put("company_code", companyCode);
|
||||
result.put("user_type", userType);
|
||||
result.put("user_type_name", getStr(dbUser, "user_type_name", "일반사용자"));
|
||||
result.put("email", getStr(dbUser, "email", ""));
|
||||
result.put("photo", photoStr);
|
||||
result.put("locale", getStr(dbUser, "locale", "KR"));
|
||||
result.put("deptCode", dbUser.get("dept_code"));
|
||||
result.put("authName", authNames);
|
||||
result.put("isAdmin", "ADMIN".equals(userType) || "SUPER_ADMIN".equals(userType)
|
||||
result.put("dept_code", dbUser.get("dept_code"));
|
||||
result.put("auth_name", authNames);
|
||||
result.put("is_admin", "ADMIN".equals(userType) || "SUPER_ADMIN".equals(userType)
|
||||
|| "COMPANY_ADMIN".equals(userType));
|
||||
return result;
|
||||
}
|
||||
@@ -263,18 +263,18 @@ public class AuthService extends BaseService {
|
||||
public Map<String, Object> checkAuthStatus(String token) {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
if (token == null || !jwtTokenProvider.validateToken(token)) {
|
||||
result.put("isLoggedIn", false);
|
||||
result.put("isAdmin", false);
|
||||
result.put("is_logged_in", false);
|
||||
result.put("is_admin", false);
|
||||
return result;
|
||||
}
|
||||
Claims claims = jwtTokenProvider.getClaims(token);
|
||||
String userId = claims.get("userId", String.class);
|
||||
String userType = claims.get("userType", String.class);
|
||||
String userId = claims.get("user_id", String.class);
|
||||
String userType = claims.get("user_type", String.class);
|
||||
boolean isAdmin = "plm_admin".equals(userId) || "ADMIN".equals(userType)
|
||||
|| "SUPER_ADMIN".equals(userType);
|
||||
|
||||
result.put("isLoggedIn", true);
|
||||
result.put("isAdmin", isAdmin);
|
||||
result.put("is_logged_in", true);
|
||||
result.put("is_admin", isAdmin);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -284,15 +284,15 @@ public class AuthService extends BaseService {
|
||||
public void logout(String userId, String remoteAddr) {
|
||||
try {
|
||||
Map<String, Object> logParams = new HashMap<>();
|
||||
logParams.put("systemName", "PMS");
|
||||
logParams.put("userId", userId);
|
||||
logParams.put("loginResult", false);
|
||||
logParams.put("errorMessage", "로그아웃");
|
||||
logParams.put("remoteAddr", remoteAddr);
|
||||
logParams.put("recptnDt", null);
|
||||
logParams.put("recptnRsltDtl", null);
|
||||
logParams.put("recptnRslt", null);
|
||||
logParams.put("recptnRsltCd", null);
|
||||
logParams.put("system_name", "PMS");
|
||||
logParams.put("user_id", userId);
|
||||
logParams.put("login_result", false);
|
||||
logParams.put("error_message", "로그아웃");
|
||||
logParams.put("remote_addr", remoteAddr);
|
||||
logParams.put("recptn_dt", null);
|
||||
logParams.put("recptn_rslt_dtl", null);
|
||||
logParams.put("recptn_rslt", null);
|
||||
logParams.put("recptn_rslt_cd", null);
|
||||
sqlSession.insert("auth.insertLoginLog", logParams);
|
||||
log.info("로그아웃 완료: {} ({})", userId, remoteAddr);
|
||||
} catch (Exception e) {
|
||||
@@ -305,8 +305,8 @@ public class AuthService extends BaseService {
|
||||
*/
|
||||
public Map<String, Object> switchCompany(String token, String targetCompanyCode) {
|
||||
Claims claims = jwtTokenProvider.getClaims(token);
|
||||
String userId = claims.get("userId", String.class);
|
||||
String userType = claims.get("userType", String.class);
|
||||
String userId = claims.get("user_id", String.class);
|
||||
String userType = claims.get("user_type", String.class);
|
||||
|
||||
if (!"SUPER_ADMIN".equals(userType)) {
|
||||
throw new IllegalArgumentException("회사 전환은 최고 관리자(SUPER_ADMIN)만 가능합니다.");
|
||||
@@ -315,26 +315,26 @@ public class AuthService extends BaseService {
|
||||
// 회사 코드 존재 여부 확인 ("*" 제외)
|
||||
if (!"*".equals(targetCompanyCode)) {
|
||||
Map<String, Object> company = sqlSession.selectOne("auth.selectCompanyByCode",
|
||||
Map.of("companyCode", targetCompanyCode));
|
||||
Map.of("company_code", targetCompanyCode));
|
||||
if (company == null) {
|
||||
throw new IllegalArgumentException("존재하지 않는 회사 코드입니다.");
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, Object> personBean = new HashMap<>();
|
||||
personBean.put("userId", userId);
|
||||
personBean.put("userName", claims.get("userName", String.class));
|
||||
personBean.put("deptName", claims.get("deptName", String.class));
|
||||
personBean.put("companyCode", targetCompanyCode);
|
||||
personBean.put("companyName", claims.get("companyName", String.class));
|
||||
personBean.put("userType", userType);
|
||||
personBean.put("userTypeName", claims.get("userTypeName", String.class));
|
||||
personBean.put("user_id", userId);
|
||||
personBean.put("user_name", claims.get("user_name", String.class));
|
||||
personBean.put("dept_name", claims.get("dept_name", String.class));
|
||||
personBean.put("company_code", targetCompanyCode);
|
||||
personBean.put("company_name", claims.get("company_name", String.class));
|
||||
personBean.put("user_type", userType);
|
||||
personBean.put("user_type_name", claims.get("user_type_name", String.class));
|
||||
String newToken = jwtTokenProvider.generateToken(personBean);
|
||||
log.info("회사 전환 성공: {} → {}", userId, targetCompanyCode);
|
||||
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("token", newToken);
|
||||
result.put("companyCode", targetCompanyCode);
|
||||
result.put("company_code", targetCompanyCode);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -343,15 +343,15 @@ public class AuthService extends BaseService {
|
||||
*/
|
||||
@Transactional
|
||||
public void signupDriver(Map<String, Object> params) {
|
||||
String userId = (String) params.get("userId");
|
||||
String vehicleNumber = (String) params.get("vehicleNumber");
|
||||
String userId = (String) params.get("user_id");
|
||||
String vehicleNumber = (String) params.get("vehicle_number");
|
||||
|
||||
// 아이디 중복 확인
|
||||
if (sqlSession.selectOne("auth.selectUserById", Map.of("userId", userId)) != null) {
|
||||
if (sqlSession.selectOne("auth.selectUserById", Map.of("user_id", userId)) != null) {
|
||||
throw new IllegalArgumentException("이미 존재하는 아이디입니다.");
|
||||
}
|
||||
// 차량번호 중복 확인
|
||||
if (sqlSession.selectOne("auth.selectVehicleByNumber", Map.of("vehicleNumber", vehicleNumber)) != null) {
|
||||
if (sqlSession.selectOne("auth.selectVehicleByNumber", Map.of("vehicle_number", vehicleNumber)) != null) {
|
||||
throw new IllegalArgumentException("이미 등록된 차량번호입니다.");
|
||||
}
|
||||
|
||||
@@ -359,8 +359,8 @@ public class AuthService extends BaseService {
|
||||
String hashedPassword = md5((String) params.get("password"));
|
||||
|
||||
Map<String, Object> insertParams = new HashMap<>(params);
|
||||
insertParams.put("userPassword", hashedPassword);
|
||||
insertParams.put("signupCompanyCode", "COMPANY_13");
|
||||
insertParams.put("user_password", hashedPassword);
|
||||
insertParams.put("signup_company_code", "COMPANY_13");
|
||||
|
||||
sqlSession.insert("auth.insertUserSignup", insertParams);
|
||||
sqlSession.insert("auth.insertVehicle", insertParams);
|
||||
|
||||
@@ -20,7 +20,7 @@ public class BarcodeLabelService extends BaseService {
|
||||
// 라벨 목록 조회
|
||||
// ──────────────────────────────────────────────────────────────────────────
|
||||
public Map<String, Object> getBarcodeLabelList(Map<String, Object> params) {
|
||||
if (params.get("useYn") == null) params.put("useYn", "Y");
|
||||
if (params.get("use_yn") == null) params.put("use_yn", "Y");
|
||||
commonService.applyPagination(params);
|
||||
Number cntNum = sqlSession.selectOne("barcodeLabel.getBarcodeLabelListCnt", params);
|
||||
int totalCount = cntNum != null ? cntNum.intValue() : 0;
|
||||
@@ -33,7 +33,7 @@ public class BarcodeLabelService extends BaseService {
|
||||
// ──────────────────────────────────────────────────────────────────────────
|
||||
public Map<String, Object> getBarcodeLabelInfo(String labelId) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("labelId", labelId);
|
||||
params.put("label_id", labelId);
|
||||
return sqlSession.selectOne("barcodeLabel.getBarcodeLabelInfo", params);
|
||||
}
|
||||
|
||||
@@ -60,17 +60,17 @@ public class BarcodeLabelService extends BaseService {
|
||||
@Transactional
|
||||
public Map<String, Object> insertBarcodeLabel(Map<String, Object> params) {
|
||||
String labelId = "LBL_" + UUID.randomUUID().toString().replace("-", "").substring(0, 20);
|
||||
params.put("labelId", labelId);
|
||||
params.put("label_id", labelId);
|
||||
|
||||
int widthMm = 50;
|
||||
int heightMm = 30;
|
||||
String layoutJson = null;
|
||||
|
||||
// templateId가 있으면 템플릿 치수/레이아웃 적용
|
||||
Object templateId = params.get("templateId");
|
||||
Object templateId = params.get("template_id");
|
||||
if (templateId != null && !templateId.toString().isBlank()) {
|
||||
Map<String, Object> tParams = new HashMap<>();
|
||||
tParams.put("templateId", templateId.toString().trim());
|
||||
tParams.put("template_id", templateId.toString().trim());
|
||||
Map<String, Object> template = sqlSession.selectOne("barcodeLabel.getBarcodeLabelTemplateInfo", tParams);
|
||||
if (template != null) {
|
||||
widthMm = toInt(template.get("width_mm"), 50);
|
||||
@@ -92,14 +92,14 @@ public class BarcodeLabelService extends BaseService {
|
||||
}
|
||||
}
|
||||
|
||||
params.put("widthMm", widthMm);
|
||||
params.put("heightMm", heightMm);
|
||||
params.put("layoutJson", layoutJson);
|
||||
params.put("width_mm", widthMm);
|
||||
params.put("height_mm", heightMm);
|
||||
params.put("layout_json", layoutJson);
|
||||
|
||||
sqlSession.insert("barcodeLabel.insertBarcodeLabel", params);
|
||||
|
||||
Map<String, Object> result = new LinkedHashMap<>();
|
||||
result.put("labelId", labelId);
|
||||
result.put("label_id", labelId);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ public class BarcodeLabelService extends BaseService {
|
||||
// ──────────────────────────────────────────────────────────────────────────
|
||||
@Transactional
|
||||
public boolean updateBarcodeLabel(String labelId, Map<String, Object> params) {
|
||||
params.put("labelId", labelId);
|
||||
params.put("label_id", labelId);
|
||||
int updated = sqlSession.update("barcodeLabel.updateBarcodeLabel", params);
|
||||
return updated > 0;
|
||||
}
|
||||
@@ -127,11 +127,11 @@ public class BarcodeLabelService extends BaseService {
|
||||
throw new IllegalArgumentException("레이아웃 직렬화 실패: " + e.getMessage());
|
||||
}
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("labelId", labelId);
|
||||
params.put("widthMm", widthMm);
|
||||
params.put("heightMm", heightMm);
|
||||
params.put("layoutJson", layoutJson);
|
||||
params.put("updatedBy", userId);
|
||||
params.put("label_id", labelId);
|
||||
params.put("width_mm", widthMm);
|
||||
params.put("height_mm", heightMm);
|
||||
params.put("layout_json", layoutJson);
|
||||
params.put("updated_by", userId);
|
||||
sqlSession.update("barcodeLabel.updateBarcodeLabelLayout", params);
|
||||
}
|
||||
|
||||
@@ -141,7 +141,7 @@ public class BarcodeLabelService extends BaseService {
|
||||
@Transactional
|
||||
public boolean deleteBarcodeLabel(String labelId) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("labelId", labelId);
|
||||
params.put("label_id", labelId);
|
||||
int deleted = sqlSession.delete("barcodeLabel.deleteBarcodeLabel", params);
|
||||
return deleted > 0;
|
||||
}
|
||||
@@ -156,9 +156,9 @@ public class BarcodeLabelService extends BaseService {
|
||||
|
||||
String newLabelId = "LBL_" + UUID.randomUUID().toString().replace("-", "").substring(0, 20);
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("newLabelId", newLabelId);
|
||||
params.put("labelId", labelId);
|
||||
params.put("createdBy", userId);
|
||||
params.put("new_label_id", newLabelId);
|
||||
params.put("label_id", labelId);
|
||||
params.put("created_by", userId);
|
||||
|
||||
sqlSession.insert("barcodeLabel.copyBarcodeLabel", params);
|
||||
return newLabelId;
|
||||
@@ -176,7 +176,7 @@ public class BarcodeLabelService extends BaseService {
|
||||
// ──────────────────────────────────────────────────────────────────────────
|
||||
public Map<String, Object> getBarcodeLabelTemplateInfo(String templateId) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("templateId", templateId);
|
||||
params.put("template_id", templateId);
|
||||
Map<String, Object> template = sqlSession.selectOne("barcodeLabel.getBarcodeLabelTemplateInfo", params);
|
||||
if (template == null) return null;
|
||||
|
||||
|
||||
@@ -19,43 +19,43 @@ public class BatchExecutionLogService extends BaseService {
|
||||
public Map<String, Object> getBatchExecutionLogList(Map<String, Object> params) {
|
||||
commonService.applyCompanyCodeFilter(params);
|
||||
commonService.applyPagination(params);
|
||||
Integer totalObj = sqlSession.selectOne(NS + "getBatchExecutionLogListCnt", params);
|
||||
Integer totalObj = sqlSession.selectOne(NS + "get_batch_execution_log_list_cnt", params);
|
||||
int totalCount = totalObj != null ? totalObj : 0;
|
||||
List<Map<String, Object>> list = sqlSession.selectList(NS + "getBatchExecutionLogList", params);
|
||||
List<Map<String, Object>> list = sqlSession.selectList(NS + "get_batch_execution_log_list", params);
|
||||
return commonService.buildListResponse(list, totalCount, params);
|
||||
}
|
||||
|
||||
public Map<String, Object> getBatchExecutionLogInfo(Map<String, Object> params) {
|
||||
commonService.applyCompanyCodeFilter(params);
|
||||
return sqlSession.selectOne(NS + "getBatchExecutionLogInfo", params);
|
||||
return sqlSession.selectOne(NS + "get_batch_execution_log_info", params);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public Map<String, Object> insertBatchExecutionLog(Map<String, Object> params) {
|
||||
commonService.applyCompanyCodeFilter(params);
|
||||
sqlSession.insert(NS + "insertBatchExecutionLog", params);
|
||||
sqlSession.insert(NS + "insert_batch_execution_log", params);
|
||||
return params;
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public Map<String, Object> updateBatchExecutionLog(Map<String, Object> params) {
|
||||
commonService.applyCompanyCodeFilter(params);
|
||||
sqlSession.update(NS + "updateBatchExecutionLog", params);
|
||||
sqlSession.update(NS + "update_batch_execution_log", params);
|
||||
return params;
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public Map<String, Object> deleteBatchExecutionLog(Map<String, Object> params) {
|
||||
commonService.applyCompanyCodeFilter(params);
|
||||
sqlSession.delete(NS + "deleteBatchExecutionLog", params);
|
||||
sqlSession.delete(NS + "delete_batch_execution_log", params);
|
||||
return params;
|
||||
}
|
||||
|
||||
public Map<String, Object> getBatchExecutionLogLatest(Map<String, Object> params) {
|
||||
return sqlSession.selectOne(NS + "getBatchExecutionLogLatest", params);
|
||||
return sqlSession.selectOne(NS + "get_batch_execution_log_latest", params);
|
||||
}
|
||||
|
||||
public Map<String, Object> getBatchExecutionLogStats(Map<String, Object> params) {
|
||||
return sqlSession.selectOne(NS + "getBatchExecutionLogStats", params);
|
||||
return sqlSession.selectOne(NS + "get_batch_execution_log_stats", params);
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user