[FO] 입력날짜 1-2에 월초이월금 노출
This commit is contained in:
@@ -92,7 +92,6 @@ public class DailyUtil {
|
||||
*/
|
||||
public boolean isModifiable(LocalDate startDate, LocalDate endDate) {
|
||||
LocalDate limitStart = LocalDate.now().minusDays(DailyRecordConstants.MODIFIY_LIMIT_DAY);
|
||||
log.debug("isModifiable @@limitStart: {}, startDate: {}, endDate: {}", limitStart, startDate, endDate);
|
||||
|
||||
return (limitStart.isBefore(startDate) || limitStart.isEqual(startDate) || limitStart.isEqual(endDate));
|
||||
}
|
||||
@@ -106,9 +105,8 @@ public class DailyUtil {
|
||||
*/
|
||||
public boolean isRegisterPossible(LocalDate startDate, LocalDate endDate) {
|
||||
LocalDate limitStart = LocalDate.now().minusDays(DailyRecordConstants.REGISTER_LIMIT_DAY);
|
||||
log.debug("isRegisterPossible @@limitStart: {}, startDate: {}, endDate: {}", limitStart, startDate, endDate);
|
||||
|
||||
return (limitStart.isBefore(startDate) || limitStart.isEqual(startDate));
|
||||
return (limitStart.isBefore(startDate) || limitStart.isEqual(startDate) || limitStart.isEqual(endDate));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -66,6 +66,16 @@ public class RecordCalendarDao implements RecordCalendarPortOut {
|
||||
refine.setRegistrable(dailyUtil.isRegisterPossible(refine.getStartDate(), refine.getEndDate()));
|
||||
refine.setModifiable(dailyUtil.isModifiable(refine.getStartDate(), refine.getEndDate()));
|
||||
|
||||
if (calendar.getGroupNo() == 1) {
|
||||
Long carryOver = this.getMonthlyCarryOver(command);
|
||||
|
||||
if (!LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMM")).equals(command.getSearchMonth()) && carryOver == null) {
|
||||
carryOver = 0L;
|
||||
}
|
||||
|
||||
refine.setCarryOver(carryOver);
|
||||
}
|
||||
|
||||
DailyRecordStatusDto findStatus = statusList.stream()
|
||||
.filter(f -> Objects.equals(calendar.getDailyId(), f.getDailyId()))
|
||||
.findFirst().orElse(null);
|
||||
@@ -184,6 +194,17 @@ public class RecordCalendarDao implements RecordCalendarPortOut {
|
||||
return refineList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 특정월의 월초이월금 조회
|
||||
*
|
||||
* @param command 검색 조건
|
||||
* @return 월초이월금
|
||||
*/
|
||||
private Long getMonthlyCarryOver(RecordCalendarCmd command) {
|
||||
|
||||
return recordCalendarMapper.getMonthlyCarryOver(command);
|
||||
}
|
||||
|
||||
/**
|
||||
* 특정월의 일계부 등록 상태 조회
|
||||
*
|
||||
|
||||
@@ -19,6 +19,13 @@ public interface RecordCalendarMapper {
|
||||
*/
|
||||
List<DailyRecordCalendarDto> getCalendarByDailyRecord(RecordCalendarCmd command);
|
||||
|
||||
/**
|
||||
* 특정월의 월초이월금 조회
|
||||
* @param command 검색 조건
|
||||
* @return 월초이월금
|
||||
*/
|
||||
Long getMonthlyCarryOver(RecordCalendarCmd command);
|
||||
|
||||
/**
|
||||
* 특정월의 월별 작성 상태 조회
|
||||
*
|
||||
|
||||
@@ -24,4 +24,8 @@ public class RecordCalendar {
|
||||
private boolean isModifiable;
|
||||
private List<CalendarChildren> children;
|
||||
private List<CalendarChildren> monthly;
|
||||
/**
|
||||
* 월초이월금
|
||||
*/
|
||||
private Long carryOver;
|
||||
}
|
||||
|
||||
@@ -16,6 +16,16 @@
|
||||
ddg.group_no asc
|
||||
</select>
|
||||
|
||||
<select id="getMonthlyCarryOver">
|
||||
select ds.carry_over
|
||||
from daily_summary ds
|
||||
where ds.household_seq = #{householdSeq}
|
||||
and ds.record_month = #{searchMonth}
|
||||
order by
|
||||
ds.id desc
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
<select id="getMonthlyStatus">
|
||||
select mis.forest_product_status as forest_product, mis.bank_auto_transfer_input_status as bank_input, mis.bank_auto_transfer_output_status as bank_output
|
||||
from monthly_input_status mis
|
||||
|
||||
@@ -803,6 +803,7 @@
|
||||
monthlyList: monthlyList,
|
||||
registrable: rowdata.registrable,
|
||||
modifiable: rowdata.modifiable,
|
||||
carryOver: rowdata.carryOver != null ? Number(rowdata.carryOver).toLocaleString() : null,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -830,6 +831,16 @@
|
||||
{{include tmpl="#titleTmpl" /}}
|
||||
|
||||
<ul class="btn-column-list">
|
||||
{{if no == 1}}
|
||||
<li>
|
||||
<p class="label">월초이월금</p>
|
||||
{{if carryOver == null}}
|
||||
<p class="value">계산중입니다.</p>
|
||||
{{else}}
|
||||
<p class="value"><em><b>{{:carryOver}}</b> 원</em></p>
|
||||
{{/if}}
|
||||
</li>
|
||||
{{/if}}
|
||||
{{for list ~edit=modifiable}}
|
||||
{{if status == null}}
|
||||
<li>
|
||||
|
||||
Reference in New Issue
Block a user