260408_01_ENH: 리스트 업로드, 조회, 삭제 1차 구현 완료
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
package com.kri.contact.server.controller;
|
||||
|
||||
import com.kri.common.datetime.DateTimeUtil;
|
||||
import com.kri.common.webmvc.RequestUserContext;
|
||||
import com.kri.common.feature.datetime.DateTimeUtil;
|
||||
import com.kri.common.feature.web.RequestUserContext;
|
||||
import com.kri.contact.server.common.consts.ContactConstant;
|
||||
import com.kri.contact.server.dto.common.DataVerificationDto;
|
||||
import com.kri.contact.server.dto.excel.ExcelUploadResponseDto;
|
||||
import com.kri.contact.server.dto.user.UserInfoDto;
|
||||
import com.kri.contact.server.dto.excel.ExcelUploadResultDto;
|
||||
import com.kri.contact.server.dto.systemlog.UploadUserContentDto;
|
||||
import com.kri.contact.server.dto.user.UserInfoDto;
|
||||
import com.kri.contact.server.service.SystemEventLogService;
|
||||
import com.kri.contact.server.service.UserService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
@@ -25,8 +25,8 @@ import org.springframework.web.bind.annotation.PatchMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RequestPart;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
@@ -64,7 +64,7 @@ public class UserController {
|
||||
}
|
||||
}
|
||||
|
||||
@Operation(summary = "컨택원/면접원 목록 조회")
|
||||
@Operation(summary = "컨택트 면접원 목록 조회")
|
||||
@GetMapping("fieldwork")
|
||||
public List<UserInfoDto> getFiledoworkUserList(RequestUserContext ctx) {
|
||||
String searchCmpn = ctx.getUserCmpn();
|
||||
@@ -75,7 +75,7 @@ public class UserController {
|
||||
return userService.getFieldworkUserListWithCmpn(searchCmpn);
|
||||
}
|
||||
|
||||
@Operation(summary = "외주사 목록 조회")
|
||||
@Operation(summary = "외주 목록 조회")
|
||||
@GetMapping("outsource")
|
||||
List<UserInfoDto> getOutsourceList() {
|
||||
return userService.getOutsourceList();
|
||||
@@ -105,20 +105,22 @@ public class UserController {
|
||||
systemEventLogService.writeCreateUserLog(regId, now, clientIp, userInfo);
|
||||
}
|
||||
|
||||
@Operation(summary = "사용자 일괄 생성(엑셀 업로드)")
|
||||
@PostMapping("/excel")
|
||||
public ExcelUploadResponseDto createUserFromExcel(
|
||||
@RequestPart("file") MultipartFile file,
|
||||
@Operation(
|
||||
summary = "사용자 일괄 생성(엑셀 업로드)",
|
||||
description = "성공하면 JSON, 실패가 있으면 실패 내역 엑셀(xlsx) 반환"
|
||||
)
|
||||
@PostMapping(value = "/excel/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
|
||||
public ExcelUploadResultDto createUserFromExcel(
|
||||
@RequestParam("file") MultipartFile file,
|
||||
RequestUserContext ctx
|
||||
) {
|
||||
String regId = ctx.getUserId();
|
||||
String clientIp = ctx.getClientIp();
|
||||
final LocalDateTime now = DateTimeUtil.nowKstLocalDateTime();
|
||||
//외주사급이 업로드로 계정을 생성하는 경우 자신의 회사명으로 고정
|
||||
String forceCmpn =
|
||||
ctx.getUserRole() < ContactConstant.OUTSOURCE_USER_ROLE ? "" : ctx.getUserCmpn();
|
||||
|
||||
ExcelUploadResponseDto result = userService.createUsersFromExcel(file, regId, now, forceCmpn);
|
||||
ExcelUploadResultDto result = userService.createUsersFromExcel(file, regId, now, forceCmpn);
|
||||
|
||||
UploadUserContentDto content = new UploadUserContentDto(
|
||||
file.getOriginalFilename(),
|
||||
|
||||
Reference in New Issue
Block a user