[FO] 일계부 권고메세지 재정의

This commit is contained in:
김현주
2025-07-08 17:36:02 +09:00
parent 2415a3090e
commit 436826e02b
13 changed files with 111 additions and 96 deletions

View File

@@ -29,58 +29,14 @@
<select id="getDataNoneCountBySomeDayAfter">
<![CDATA[
with temp_day_group as (
select group_no, start_day, end_day
, DATE_PART('day', CURRENT_DATE - INTERVAL '3 days') as current_day
, DATE_PART('day', CURRENT_DATE - INTERVAL '15 days') as prev_day
, DATE_PART('day', date_trunc('month', CURRENT_DATE) - INTERVAL '1 days') as prev_last_day
, DATE_PART('month', CURRENT_DATE - INTERVAL '3 days') as current_month1
, DATE_PART('month', CURRENT_DATE - INTERVAL '15 days') as prev_month
, TO_CHAR(CURRENT_DATE, 'YYYYMM') as current_month
from daily_day_group
where DATE_PART('month', CURRENT_DATE - INTERVAL '3 days') = DATE_PART('month', CURRENT_DATE - INTERVAL '15 days')
and (
(
start_day >= DATE_PART('day', CURRENT_DATE - INTERVAL '15 days') and end_day <= DATE_PART('day', CURRENT_DATE - INTERVAL '3 days'))
or start_day = DATE_PART('day', CURRENT_DATE - INTERVAL '3 days')
or end_day = DATE_PART('day', CURRENT_DATE - INTERVAL '3 days')
or start_day = DATE_PART('day', CURRENT_DATE - INTERVAL '15 days')
or end_day = DATE_PART('day', CURRENT_DATE - INTERVAL '15 days')
)
union all
select group_no, start_day, end_day
, DATE_PART('day', CURRENT_DATE - INTERVAL '3 days') as current_day
, DATE_PART('day', CURRENT_DATE - INTERVAL '15 days') as prev_day
, DATE_PART('day', date_trunc('month', CURRENT_DATE) - INTERVAL '1 days') as prev_last_day
, DATE_PART('month', CURRENT_DATE - INTERVAL '3 days') as current_month1
, DATE_PART('month', CURRENT_DATE - INTERVAL '15 days') as prev_month
, (case when start_day <= 16 then
TO_CHAR(CURRENT_DATE, 'YYYYMM')
else
TO_CHAR(CURRENT_DATE - INTERVAL '15 days', 'YYYYMM')
end
) as current_month
from daily_day_group
where DATE_PART('month', CURRENT_DATE - INTERVAL '3 days') != DATE_PART('month', CURRENT_DATE - INTERVAL '15 days')
and (
-- 현재월 DAY 조회
start_day >= 1 and end_day <= DATE_PART('day', CURRENT_DATE - INTERVAL '3 days')
or start_day >= DATE_PART('day', CURRENT_DATE - INTERVAL '15 days') and end_day <= DATE_PART('day', date_trunc('month', CURRENT_DATE) - INTERVAL '1 days')
-- 3일전 DAY 로 시작, 종료일이 같은지 여부
or start_day = DATE_PART('day', CURRENT_DATE - INTERVAL '3 days')
or end_day = DATE_PART('day', CURRENT_DATE - INTERVAL '3 days')
-- 이전월 마지막 DAY 로 시작, 종료일이 같은지 여부
or start_day = DATE_PART('day', date_trunc('month', CURRENT_DATE) - INTERVAL '1 days')
or end_day = DATE_PART('day', date_trunc('month', CURRENT_DATE) - INTERVAL '1 days')
)
with register_period as (
select generate_series((CURRENT_DATE - INTERVAL '${limitDay} days')::date , (CURRENT_DATE - INTERVAL '1 days')::date, '1 day'::interval)::date as record_date
)
select case when count(tdg.group_no) = count(dr.id) then 0 else count(tdg.group_no) - count(dr.id) end
from temp_day_group tdg
select count(rp.record_date) filter (where dr.id is null or dr.all_status = 'WAITING')
from register_period rp
left join
daily_record dr on dr.record_month = tdg.current_month and dr.day_group_no = tdg.group_no
and dr.household_seq = #{householdSeq}
daily_record dr on dr.household_seq = #{householdSeq} and dr.is_deleted = false
and dr.start_date <= rp.record_date and dr.end_date >= rp.record_date
]]>
</select>

View File

@@ -12,12 +12,24 @@
info : 인포(파랑)
*/-->
<article class="alert-box warning"
th:if="${dailyDataNone}">
<p class="tit"><strong th:text="${userInfo?.ownerName}">홍길동</strong>님,</p>
<span class="txt">
일계부를 등록하지 않은 날짜가 있습니다. <br>
정확한 조사를 위해 꾸준히 입력해 주세요.
</span>
th:classappend="${#strings.equals(dailyDataNone, 'DONE')} ? 'success' : 'warning'">
<p class="tit"><strong th:text="${userInfo?.ownerName}">홍길동</strong>님,</p>
<span class="txt" th:if="${#strings.equals(dailyDataNone, 'DATA_NONE')}">
일계부를 등록하지 않은 날짜가 있습니다. <br>
정확한 조사를 위해 꾸준히 입력해 주세요.
</span>
<span class="txt" th:if="${#strings.equals(dailyDataNone, 'FOREST_NONE')}">
이번 달 임산물 현황이 등록되지 않았습니다. <br>
정확한 조사를 위해 매월 1회 입력해 주세요.
</span>
<span class="txt" th:if="${#strings.equals(dailyDataNone, 'BANK_NONE')}">
이번 달 자동이체 내역이 등록되지 않았습니다. <br>
정확한 조사를 위해 매월 1회 입력해 주세요.
</span>
<span class="txt" th:if="${#strings.equals(dailyDataNone, 'DONE')}">
일계부를 성실하게 등록하고 계십니다. <br>
정확한 조사를 위해 지금처럼 계속 입력해 주세요.
</span>
</article>
<section class="info-top-area">

View File

@@ -10,13 +10,25 @@
success : 성공(초록)
info : 인포(파랑)
*/-->
<article class="alert-box warning"
th:if="${dailyDataNone}">
<article class="alert-box"
th:classappend="${#strings.equals(dailyDataNone, 'DONE')} ? 'success' : 'warning'">
<p class="tit"
sec:authorize="isAuthenticated()"><strong th:text="${#authentication.principal.ownerName}">홍길동</strong>님,</p>
<span class="txt">
일계부를 등록하지 않은 날짜가 있습니다. <br>
정확한 조사를 위해 꾸준히 입력해 주세요.
<span class="txt" th:if="${#strings.equals(dailyDataNone, 'DATA_NONE')}">
일계부를 등록하지 않은 날짜가 있습니다. <br>
정확한 조사를 위해 꾸준히 입력해 주세요.
</span>
<span class="txt" th:if="${#strings.equals(dailyDataNone, 'FOREST_NONE')}">
이번 달 임산물 현황이 등록되지 않았습니다. <br>
정확한 조사를 위해 매월 1회 입력해 주세요.
</span>
<span class="txt" th:if="${#strings.equals(dailyDataNone, 'BANK_NONE')}">
이번 달 자동이체 내역이 등록되지 않았습니다. <br>
정확한 조사를 위해 매월 1회 입력해 주세요.
</span>
<span class="txt" th:if="${#strings.equals(dailyDataNone, 'DONE')}">
일계부를 성실하게 등록하고 계십니다. <br>
정확한 조사를 위해 지금처럼 계속 입력해 주세요.
</span>
</article>