[BO] 월초이월금
This commit is contained in:
@@ -7,6 +7,9 @@ import app.module.admin.usecase.household.tab.dailyRecord.getDailyRecordStatusDe
|
|||||||
import app.module.admin.usecase.household.tab.dailyRecord.getDailyRecordStatusDetail.ports.application.domain.GetDailyPowerRecords;
|
import app.module.admin.usecase.household.tab.dailyRecord.getDailyRecordStatusDetail.ports.application.domain.GetDailyPowerRecords;
|
||||||
import app.module.admin.usecase.household.tab.dailyRecord.getDailyRecordStatusDetail.ports.application.domain.GetDailyRecordStatus;
|
import app.module.admin.usecase.household.tab.dailyRecord.getDailyRecordStatusDetail.ports.application.domain.GetDailyRecordStatus;
|
||||||
import app.module.admin.usecase.household.tab.dailyRecord.getDailyRecordStatusDetail.ports.application.domain.GetDailyWorkRecords;
|
import app.module.admin.usecase.household.tab.dailyRecord.getDailyRecordStatusDetail.ports.application.domain.GetDailyWorkRecords;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import app.module.core.config.application.enums.FileStorageType;
|
import app.module.core.config.application.enums.FileStorageType;
|
||||||
@@ -58,8 +61,10 @@ class GetDailyRecordStatusDetailDao implements GetDailyRecordStatusDetailPortOut
|
|||||||
List<GetDailyForestryRecords> forestries = mapper.getDailyForestryRecords(cmd);
|
List<GetDailyForestryRecords> forestries = mapper.getDailyForestryRecords(cmd);
|
||||||
List<GetDailyFarmingRecords> farmings = mapper.getDailyFarmingRecords(cmd);
|
List<GetDailyFarmingRecords> farmings = mapper.getDailyFarmingRecords(cmd);
|
||||||
|
|
||||||
|
Long carryOver = mapper.getMonthlyCarryOver(cmd);
|
||||||
|
|
||||||
return Optional.of(
|
return Optional.of(
|
||||||
new GetDailyRecordStatusDetail(status, incomes, works, expenses, powers, forestries,
|
new GetDailyRecordStatusDetail(status, incomes, works, expenses, powers, forestries,
|
||||||
farmings));
|
farmings, carryOver));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -20,4 +20,5 @@ public interface GetDailyRecordStatusDetailMapper {
|
|||||||
List<GetDailyPowerRecords> getDailyPowerRecords(GetDailyRecordStatusCmd cmd);
|
List<GetDailyPowerRecords> getDailyPowerRecords(GetDailyRecordStatusCmd cmd);
|
||||||
List<GetDailyForestryRecords> getDailyForestryRecords(GetDailyRecordStatusCmd cmd);
|
List<GetDailyForestryRecords> getDailyForestryRecords(GetDailyRecordStatusCmd cmd);
|
||||||
List<GetDailyFarmingRecords> getDailyFarmingRecords(GetDailyRecordStatusCmd cmd);
|
List<GetDailyFarmingRecords> getDailyFarmingRecords(GetDailyRecordStatusCmd cmd);
|
||||||
|
Long getMonthlyCarryOver(GetDailyRecordStatusCmd cmd);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,6 +44,12 @@ class GetDailyRecordStatusDetailController {
|
|||||||
GetDailyRecordStatusDetail recordView =
|
GetDailyRecordStatusDetail recordView =
|
||||||
portIn.operate(new GetDailyRecordStatusCmd(reqVO.getRecordSeq())).orElse(null);
|
portIn.operate(new GetDailyRecordStatusCmd(reqVO.getRecordSeq())).orElse(null);
|
||||||
|
|
||||||
|
if (recordView != null) {
|
||||||
|
if (!LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMM")).equals(reqVO.getRecordMonth()) && recordView.getMonthlyCarryOver() == null) {
|
||||||
|
recordView.setMonthlyCarryOver(0L);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return ResponseEntity.status(HttpStatus.OK).body(recordView);
|
return ResponseEntity.status(HttpStatus.OK).body(recordView);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,4 +18,5 @@ public class GetDailyRecordStatusDetail {
|
|||||||
List<GetDailyPowerRecords> powers; // 동력사용시간
|
List<GetDailyPowerRecords> powers; // 동력사용시간
|
||||||
List<GetDailyForestryRecords> forestries; // 자가임업
|
List<GetDailyForestryRecords> forestries; // 자가임업
|
||||||
List<GetDailyFarmingRecords> farmings; // 자가농업
|
List<GetDailyFarmingRecords> farmings; // 자가농업
|
||||||
|
Long monthlyCarryOver; //월초이월금
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -309,5 +309,15 @@
|
|||||||
ORDER BY dr.start_date asc, df.created_at asc
|
ORDER BY dr.start_date asc, df.created_at asc
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
<select id="getMonthlyCarryOver">
|
||||||
|
select ds.carry_over
|
||||||
|
from daily_summary ds
|
||||||
|
inner join daily_record dr on dr.household_seq = ds.household_seq and dr.record_month = ds.record_month
|
||||||
|
and dr.id = #{recordSeq}
|
||||||
|
order by
|
||||||
|
ds.id desc
|
||||||
|
limit 1
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -72,6 +72,13 @@
|
|||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
<!-- 월초이월금 -->
|
||||||
|
<section class="table-group _monthlyCarryOver" style="display: none;">
|
||||||
|
<div class="table-tit-group">
|
||||||
|
<h3>월초이월금 <strong id="carryOver">(0원)</strong></h3>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
<!-- 수입 -->
|
<!-- 수입 -->
|
||||||
<section class="table-group">
|
<section class="table-group">
|
||||||
<div class="table-tit-group">
|
<div class="table-tit-group">
|
||||||
@@ -435,7 +442,7 @@
|
|||||||
|
|
||||||
ajaxUtil._ajaxMethod(
|
ajaxUtil._ajaxMethod(
|
||||||
'/api/household/dailyRecordStatus',
|
'/api/household/dailyRecordStatus',
|
||||||
{ recordSeq: id },
|
{ recordSeq: id, recordMonth: f.recordMonth.value },
|
||||||
function(response) { // 성공
|
function(response) { // 성공
|
||||||
console.log("일계부 등록 상세 데이터 : ", response);
|
console.log("일계부 등록 상세 데이터 : ", response);
|
||||||
|
|
||||||
@@ -462,6 +469,18 @@
|
|||||||
gridPowerTable(response.status.powerStatus, response.powers);
|
gridPowerTable(response.status.powerStatus, response.powers);
|
||||||
gridForestryTable(response.status.forestryStatus, response.forestries);
|
gridForestryTable(response.status.forestryStatus, response.forestries);
|
||||||
gridFarmingTable(response.status.farmingStatus, response.farmings);
|
gridFarmingTable(response.status.farmingStatus, response.farmings);
|
||||||
|
|
||||||
|
if (groupNo === 1) {
|
||||||
|
console.log(groupNo, response.monthlyCarryOver)
|
||||||
|
if (response.monthlyCarryOver != null) {
|
||||||
|
$('#carryOver').text(Number(response.monthlyCarryOver).toLocaleString() + '원');
|
||||||
|
} else {
|
||||||
|
$('#carryOver').text('계산중입니다.');
|
||||||
|
}
|
||||||
|
$('._monthlyCarryOver').show();
|
||||||
|
} else {
|
||||||
|
$('._monthlyCarryOver').hide();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
function (code, rstData) { // 실패
|
function (code, rstData) { // 실패
|
||||||
console.log("error : ", code);
|
console.log("error : ", code);
|
||||||
|
|||||||
Reference in New Issue
Block a user