[FO] 일계부 최근등록일 일괄 수정
This commit is contained in:
@@ -125,6 +125,26 @@ public class RecordCalendarDao implements RecordCalendarPortOut {
|
||||
return dataNoneCount != 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLatestDate(RecordCalendarCmd command) {
|
||||
String returnValue = null;
|
||||
DailyRecordStatusDto detail = recordCalendarMapper.getLatestDate(command);
|
||||
if (detail != null && detail.getStartDate() != null && detail.getEndDate() != null) {
|
||||
if (detail.getStartDate().getMonth() != detail.getEndDate().getMonth()) {
|
||||
// 종료일의 달이 변경되면 시작일=종료일 처리
|
||||
detail.setEndDate(detail.getStartDate());
|
||||
}
|
||||
|
||||
if (detail.getStartDate().equals(detail.getEndDate())) {
|
||||
returnValue = detail.getStartDate().format(DateTimeFormatter.ofPattern("yyyy년 M월 d일"));
|
||||
} else {
|
||||
returnValue = detail.getStartDate().format(DateTimeFormatter.ofPattern("yyyy년 M월 d")) + "~" + detail.getEndDate().format(DateTimeFormatter.ofPattern("d일"));
|
||||
}
|
||||
}
|
||||
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* 특정월의 일 그룹 조회
|
||||
*
|
||||
|
||||
@@ -41,4 +41,12 @@ public interface RecordCalendarMapper {
|
||||
* @return 미등록 건 수
|
||||
*/
|
||||
Integer getDataNoneCountBySomeDayAfter(RecordCalendarCmd command);
|
||||
|
||||
/**
|
||||
* 최신 등록일 데이터 조회
|
||||
*
|
||||
* @param command 검색 조건
|
||||
* @return 최신 등록 데이터
|
||||
*/
|
||||
DailyRecordStatusDto getLatestDate(RecordCalendarCmd command);
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ public class RecordCalendarUIController {
|
||||
|
||||
model.addAttribute("reqVO", reqVO);
|
||||
|
||||
model.addAttribute("dataNone", recordCalendarPortIn.getDataNoneCountBySomeDayAfter(reqVO));
|
||||
model.addAttribute("dailyDataNone", recordCalendarPortIn.getDataNoneCountBySomeDayAfter());
|
||||
|
||||
return "record/calendar";
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package app.module.front.usecase.daily.calendar.ports;
|
||||
|
||||
import app.module.front.usecase.daily.calendar.adapters.persistence.model.DailyRecordStatusDto;
|
||||
import app.module.front.usecase.daily.calendar.adapters.web.model.RecordCalendarUIReqVO;
|
||||
import app.module.front.usecase.daily.calendar.ports.application.domain.RecordCalendar;
|
||||
import app.module.front.usecase.daily.calendar.ports.application.domain.RecordCalendarCmd;
|
||||
@@ -7,7 +8,25 @@ import app.module.front.usecase.daily.calendar.ports.application.domain.RecordCa
|
||||
import java.util.List;
|
||||
|
||||
public interface RecordCalendarPortIn {
|
||||
/**
|
||||
* 특정월의 일계부 등록 현황 조회
|
||||
*
|
||||
* @param command 검색 조건
|
||||
* @return 특정월의 일계부 등록 현황
|
||||
*/
|
||||
List<RecordCalendar> operate(RecordCalendarCmd command);
|
||||
|
||||
boolean getDataNoneCountBySomeDayAfter(RecordCalendarUIReqVO reqVO);
|
||||
/**
|
||||
* 특정기간의 데이터 미등록 여부 조회
|
||||
*
|
||||
* @return true=미등록 데이터 있음, false=없음
|
||||
*/
|
||||
boolean getDataNoneCountBySomeDayAfter();
|
||||
|
||||
/**
|
||||
* 일계부 최신 데이터 조회
|
||||
*
|
||||
* @return 최신 등록 기간
|
||||
*/
|
||||
String getLatestDate();
|
||||
}
|
||||
|
||||
@@ -11,4 +11,6 @@ public interface RecordCalendarPortOut {
|
||||
List<RecordCalendar> operate(RecordCalendarCmd command);
|
||||
|
||||
boolean getDataNoneCountBySomeDayAfter(RecordCalendarCmd command);
|
||||
|
||||
String getLatestDate(RecordCalendarCmd command);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package app.module.front.usecase.daily.calendar.ports.application;
|
||||
|
||||
import app.module.front.usecase.daily.calendar.adapters.persistence.model.DailyRecordStatusDto;
|
||||
import app.module.front.usecase.daily.calendar.adapters.web.model.RecordCalendarUIReqVO;
|
||||
import app.module.front.usecase.daily.calendar.ports.RecordCalendarPortIn;
|
||||
import app.module.front.usecase.daily.calendar.ports.RecordCalendarPortOut;
|
||||
@@ -8,7 +9,12 @@ import app.module.front.usecase.daily.calendar.ports.application.domain.RecordCa
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@@ -21,7 +27,16 @@ public class RecordCalendarService implements RecordCalendarPortIn {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getDataNoneCountBySomeDayAfter(RecordCalendarUIReqVO reqVO) {
|
||||
public boolean getDataNoneCountBySomeDayAfter() {
|
||||
RecordCalendarUIReqVO reqVO = new RecordCalendarUIReqVO();
|
||||
|
||||
return portOut.getDataNoneCountBySomeDayAfter(new RecordCalendarCmd(reqVO.getSearchMonth(), reqVO.getHouseholdSeq(), 0));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLatestDate() {
|
||||
RecordCalendarUIReqVO reqVO = new RecordCalendarUIReqVO();
|
||||
|
||||
return portOut.getLatestDate(new RecordCalendarCmd(reqVO.getSearchMonth(), reqVO.getHouseholdSeq(), 0));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,8 @@ package app.module.front.usecase.info;
|
||||
import app.module.core.config.application.util.CommonUtil;
|
||||
import app.module.core.usecase.household.getHousehold.ports.GetHouseholdPortIn;
|
||||
import app.module.core.usecase.household.getHousehold.ports.application.domain.GetHouseholdCmd;
|
||||
import app.module.front.usecase.daily.calendar.adapters.web.model.RecordCalendarUIReqVO;
|
||||
import app.module.front.usecase.daily.calendar.ports.RecordCalendarPortIn;
|
||||
import app.module.front.usecase.info.notice.getNotices.ports.GetNoticesPortIn;
|
||||
import app.module.front.usecase.info.notice.getNotices.ports.application.domain.GetNotices;
|
||||
import app.module.front.usecase.info.notice.getNotices.ports.application.domain.GetNoticesCmd;
|
||||
@@ -18,16 +20,13 @@ import org.springframework.web.bind.annotation.GetMapping;
|
||||
@Controller
|
||||
@RequiredArgsConstructor
|
||||
class GetInfoUIController {
|
||||
|
||||
private final GetHouseholdPortIn getHouseholdPortIn;
|
||||
|
||||
private final GetNoticesPortIn getNoticesPortIn;
|
||||
|
||||
private final RecordCalendarPortIn recordCalendarPortIn;
|
||||
|
||||
@GetMapping(path = "/info")
|
||||
String operate(Model model
|
||||
,@PageableDefault(sort = "createdAt", direction = Sort.Direction.DESC, page = 0, size = 5) Pageable pageable) {
|
||||
|
||||
, @PageableDefault(sort = "createdAt", direction = Sort.Direction.DESC, page = 0, size = 5) Pageable pageable) {
|
||||
|
||||
//공지사항
|
||||
Page<GetNotices> notices =
|
||||
@@ -38,16 +37,10 @@ class GetInfoUIController {
|
||||
? notices.getContent().get(0)
|
||||
: null);
|
||||
|
||||
model.addAttribute("userInfo", getHouseholdPortIn.operate(new GetHouseholdCmd(CommonUtil.getLoginUsername())).orElseThrow());
|
||||
model.addAttribute("dailyDataNone", recordCalendarPortIn.getDataNoneCountBySomeDayAfter());
|
||||
model.addAttribute("dailyLatest", recordCalendarPortIn.getLatestDate());
|
||||
|
||||
|
||||
//TODO 일계부입력상태에 따른 경고문구 노출
|
||||
boolean isUnregisteredDate = false;
|
||||
|
||||
//TODO 일계부입력 최근등록일 취득 해야함
|
||||
String latestRegisteredDate = "2025년 5월 16~17일";
|
||||
|
||||
model.addAttribute("userInfo",getHouseholdPortIn.operate(new GetHouseholdCmd(CommonUtil.getLoginUsername())).orElseThrow());
|
||||
model.addAttribute("isUnregisteredDate",isUnregisteredDate);
|
||||
return "info/main";
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,8 @@
|
||||
package app.module.front.usecase.menu.adapters.web;
|
||||
|
||||
import app.module.front.usecase.daily.calendar.adapters.web.model.RecordCalendarUIReqVO;
|
||||
import app.module.front.usecase.daily.calendar.ports.RecordCalendarPortIn;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Controller;
|
||||
@@ -8,17 +11,18 @@ import org.springframework.web.bind.annotation.GetMapping;
|
||||
import java.util.HashMap;
|
||||
|
||||
@Controller
|
||||
@RequiredArgsConstructor
|
||||
public class MenuController {
|
||||
private final RecordCalendarPortIn recordCalendarPortIn;
|
||||
|
||||
/**
|
||||
* FRONT 메인 페이지
|
||||
* @return
|
||||
* FRONT 전체 메뉴 팝업 화면
|
||||
*/
|
||||
@GetMapping(path = "/menu")
|
||||
ResponseEntity<?> allMenu() {
|
||||
// TODO
|
||||
|
||||
HashMap<String, String> resVO = new HashMap<>();
|
||||
// resVO.put("daily", "2025년 5월 16~17일");
|
||||
resVO.put("dailyLatest", recordCalendarPortIn.getLatestDate());
|
||||
|
||||
return ResponseEntity.status(HttpStatus.OK).body(resVO);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user