[FO] 일계부 최근등록일 일괄 수정
This commit is contained in:
@@ -36,8 +36,6 @@ public class GetHousehold {
|
||||
private Boolean isPanel;
|
||||
private String memo;
|
||||
private String dropReason;
|
||||
private LocalDate latestRegisterStartDate;
|
||||
private LocalDate latestRegisterEndDate;
|
||||
private LocalDateTime createdAt;
|
||||
private String createdBy;
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
@@ -26,18 +26,11 @@
|
||||
h.is_panel,
|
||||
h.memo,
|
||||
h.drop_reason,
|
||||
dr.start_date as latest_register_start_date,
|
||||
dr.end_date as latest_register_end_date,
|
||||
h.created_at,
|
||||
h.created_by,
|
||||
h.updated_at,
|
||||
h.updated_by
|
||||
FROM household h
|
||||
LEFT JOIN (
|
||||
SELECT start_date , end_date ,household_seq
|
||||
FROM daily_record dr
|
||||
ORDER BY start_date desc
|
||||
LIMIT 1 ) dr ON dr.household_seq = h.seq
|
||||
WHERE h.household_num = #{householdNum}
|
||||
AND h.is_deleted = false
|
||||
</select>
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -114,4 +114,15 @@
|
||||
]]>
|
||||
</select>
|
||||
|
||||
<select id="getLatestDate"
|
||||
resultType="app.module.front.usecase.daily.calendar.adapters.persistence.model.DailyRecordStatusDto">
|
||||
select dr.id as daily_id
|
||||
, dr.day_group_no, dr.start_date, dr.end_date
|
||||
from daily_record dr
|
||||
where dr.is_deleted = false
|
||||
and dr.household_seq = #{householdSeq}
|
||||
order by dr.record_month desc, dr.day_group_no desc
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -36,8 +36,8 @@ kri.menu.open = function() {
|
||||
'/menu',
|
||||
{},
|
||||
function(rstData, status) {
|
||||
if (rstData != null && rstData.daily !== undefined && rstData.daily !== null) {
|
||||
$('.menuModal').find('.date').html('최근등록 : <span>' + rstData.daily + '</span>');
|
||||
if (rstData != null && rstData.dailyLatest !== undefined && rstData.dailyLatest !== null) {
|
||||
$('.menuModal').find('.date').html('최근등록 : <span>' + rstData.dailyLatest + '</span>');
|
||||
} else {
|
||||
$('.menuModal').find('.date').html('등록된 일계부가 없습니다.');
|
||||
}
|
||||
|
||||
@@ -5,18 +5,19 @@
|
||||
|
||||
<div layout:fragment="content" th:classappend="'mypage-wrap bg-gray'">
|
||||
<main id="content" role="main">
|
||||
<!-- alert-box 클래스 리스트
|
||||
<!--/* alert-box 클래스 리스트
|
||||
fail : 실패(빨강)
|
||||
warning : 경고(노랑)
|
||||
success : 성공(초록)
|
||||
info : 인포(파랑)
|
||||
-->
|
||||
<article class="alert-box warning" > <!-- TODO Controller 단에서 처리 필요. 임시 항상 노출로 수정 -->
|
||||
*/-->
|
||||
<article class="alert-box warning"
|
||||
th:if="${dailyDataNone}">
|
||||
<p class="tit"><strong th:text="${userInfo?.ownerName}">홍길동</strong>님,</p>
|
||||
<span class="txt">
|
||||
일계부를 등록하지 않은 날짜가 있습니다. <br>
|
||||
정확한 조사를 위해 꾸준히 입력해 주세요.
|
||||
</span>
|
||||
일계부를 등록하지 않은 날짜가 있습니다. <br>
|
||||
정확한 조사를 위해 꾸준히 입력해 주세요.
|
||||
</span>
|
||||
</article>
|
||||
|
||||
<section class="info-top-area">
|
||||
@@ -24,9 +25,9 @@
|
||||
<dl class="info-card">
|
||||
<dt class="name" th:text="${userInfo?.ownerName}"></dt>
|
||||
<dd class="location" th:text="${userInfo?.address}"></dd><!-- TODO 임가 주소 위치 임시로 . 처리함. -->
|
||||
<dd class="date" th:if="${userInfo.latestRegisterStartDate != null or !#strings.isEmpty(userInfo.latestRegisterStartDate)}">
|
||||
최근등록 :<span th:text="${#temporals.format(userInfo.latestRegisterStartDate, 'M월 d일')+'-'+#temporals.format(userInfo.latestRegisterEndDate, 'd일')}"></span></dd>
|
||||
<dd class="date" th:if="${userInfo.latestRegisterStartDate == null or #strings.isEmpty(userInfo.latestRegisterStartDate)}">등록된 일계부가 없습니다.</dd>
|
||||
<dd class="date" th:if="${not #strings.isEmpty(dailyLatest)}">
|
||||
최근등록 : <span th:text="${dailyLatest}"></span></dd>
|
||||
<dd class="date" th:if="${#strings.isEmpty(dailyLatest)}">등록된 일계부가 없습니다.</dd>
|
||||
</dl>
|
||||
<th:block th:if="${notice != null}">
|
||||
<a th:href="@{'/info/notice/' + ${notice.id}}" class="notice-box">
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
info : 인포(파랑)
|
||||
*/-->
|
||||
<article class="alert-box warning"
|
||||
th:if="${dataNone}">
|
||||
th:if="${dailyDataNone}">
|
||||
<p class="tit"
|
||||
sec:authorize="isAuthenticated()"><strong th:text="${#authentication.principal.ownerName}">홍길동</strong>님,</p>
|
||||
<span class="txt">
|
||||
|
||||
Reference in New Issue
Block a user