260812_01_ENH: 배정·진행 현황 개선 및 예약/이벤트 이력 기능 추가
- 프로젝트별 외주사·필드워커 배정 현황 API 추가 - 진행 현황을 리스트 배정 기준으로 변경 및 미배정 집계 추가 - 마지막 이벤트 일자 필터·정렬 추가 - 예약 알림·기간 조회·확인 API 추가 - 이벤트 이력 단건 삭제 기능 추가 - 일반 리스트 헤더 ID를 101부터 생성 - 비밀번호 검증 규칙 완화
This commit is contained in:
@@ -2,6 +2,8 @@ package com.kri.contact.server.controller;
|
||||
|
||||
import com.kri.common.feature.datetime.DateTimeUtil;
|
||||
import com.kri.common.feature.web.RequestUserContext;
|
||||
import com.kri.contact.server.dto.assign.ProjectCompanyAssignSummaryDto;
|
||||
import com.kri.contact.server.dto.assign.ProjectFieldworkAssignSummaryDto;
|
||||
import com.kri.contact.server.dto.list.ListAssignRequestDto;
|
||||
import com.kri.contact.server.dto.list.ListAssignResetRequestDto;
|
||||
import com.kri.contact.server.service.AssignService;
|
||||
@@ -18,6 +20,7 @@ import org.springframework.web.bind.annotation.PathVariable;
|
||||
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.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@@ -41,6 +44,32 @@ public class AssignController {
|
||||
return assignService.getPrjctCmpnAssign(prjctIdx);
|
||||
}
|
||||
|
||||
@Operation(summary = "프로젝트 외주사별 리스트 배정 현황 조회")
|
||||
@GetMapping("/prjct-cmpn-summary/{prjctIdx}")
|
||||
public ProjectCompanyAssignSummaryDto getProjectCompanyAssignSummary(
|
||||
@PathVariable Long prjctIdx,
|
||||
RequestUserContext ctx
|
||||
) {
|
||||
return assignService.getProjectCompanyAssignSummary(prjctIdx, ctx.getUserRole());
|
||||
}
|
||||
|
||||
@Operation(summary = "프로젝트 필드워커별 리스트 배정 현황 조회")
|
||||
@GetMapping("/prjct-fieldwork-summary/{prjctIdx}")
|
||||
public ProjectFieldworkAssignSummaryDto getProjectFieldworkAssignSummary(
|
||||
@PathVariable Long prjctIdx,
|
||||
@RequestParam Short assignType,
|
||||
@RequestParam(required = false) List<String> cmpnIds,
|
||||
RequestUserContext ctx
|
||||
) {
|
||||
return assignService.getProjectFieldworkAssignSummary(
|
||||
prjctIdx,
|
||||
assignType,
|
||||
cmpnIds,
|
||||
ctx.getUserCmpn(),
|
||||
ctx.getUserRole()
|
||||
);
|
||||
}
|
||||
|
||||
@Operation(summary = "프로젝트 fieldwork 배정")
|
||||
@PutMapping("/prjct-fieldwork/{prjctIdx}")
|
||||
public void upsertPrjctFieldworkAssign(
|
||||
|
||||
@@ -23,6 +23,7 @@ import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
@@ -108,6 +109,22 @@ public class ListHistoryController {
|
||||
);
|
||||
}
|
||||
|
||||
@Operation(description = "리스트 이벤트 이력 단건 삭제")
|
||||
@DeleteMapping("/event/{listEventHistIdx}")
|
||||
public ResponseEntity<Void> deleteEventHistory(
|
||||
@PathVariable Long listEventHistIdx,
|
||||
RequestUserContext ctx
|
||||
) {
|
||||
final LocalDateTime now = DateTimeUtil.nowKstLocalDateTime();
|
||||
listUpdateService.deleteEventHistory(
|
||||
listEventHistIdx,
|
||||
ctx.getUserId(),
|
||||
ctx.getUserRole(),
|
||||
now
|
||||
);
|
||||
return ResponseEntity.noContent().build();
|
||||
}
|
||||
|
||||
private String resolveRegUser(ListEventHistFromSurveyDto request, RequestUserContext ctx) {
|
||||
if (ctx.getUserId() != null) {
|
||||
return ctx.getUserId();
|
||||
|
||||
@@ -8,14 +8,18 @@ import com.kri.contact.server.service.ReserveService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PatchMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
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.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@@ -36,6 +40,26 @@ public class ReserveController {
|
||||
return reserveService.reserve(request, ctx.getUserId(), now);
|
||||
}
|
||||
|
||||
@Operation(summary = "Find reserve notifications by user")
|
||||
@GetMapping("/user/{userId}")
|
||||
public List<ListReserveDto> findNotifications(
|
||||
@PathVariable String userId,
|
||||
@RequestParam(defaultValue = "false") boolean requestPast
|
||||
) {
|
||||
LocalDateTime now = DateTimeUtil.nowKstLocalDateTime();
|
||||
return reserveService.findNotifications(userId, requestPast, now);
|
||||
}
|
||||
|
||||
@Operation(summary = "Find reserves by user and date range")
|
||||
@GetMapping("/user/{userId}/search")
|
||||
public List<ListReserveDto> findByUserAndDateRange(
|
||||
@PathVariable String userId,
|
||||
@RequestParam @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate fromDt,
|
||||
@RequestParam @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate toDt
|
||||
) {
|
||||
return reserveService.findByUserAndDateRange(userId, fromDt, toDt);
|
||||
}
|
||||
|
||||
@Operation(summary = "Find reserves by user")
|
||||
@GetMapping("/{prjctIdx}/user/{userId}")
|
||||
public List<ListReserveDto> findByUser(
|
||||
@@ -53,4 +77,13 @@ public class ReserveController {
|
||||
) {
|
||||
return reserveService.findBySid(prjctIdx, sid);
|
||||
}
|
||||
|
||||
@Operation(summary = "Confirm reserve notification")
|
||||
@PatchMapping("/confirm/{listResveIdx}")
|
||||
public void confirm(
|
||||
@PathVariable Long listResveIdx,
|
||||
RequestUserContext ctx
|
||||
) {
|
||||
reserveService.confirm(listResveIdx, ctx.getUserId());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user