일계부 말일 alert 창
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package app.module.front.usecase.daily.record.adapters.web;
|
||||
|
||||
import app.module.core.config.application.util.CommonUtil;
|
||||
import app.module.core.usecase.daily.record.adapters.persistence.model.DailyRecordDto;
|
||||
import app.module.core.config.application.enums.DailyTargetStatus;
|
||||
import app.module.core.usecase.daily.record.adapters.web.model.CreateDailyRecordReqVO;
|
||||
@@ -81,4 +82,14 @@ public class DailyRecordController {
|
||||
|
||||
return ResponseEntity.status(HttpStatus.OK).body(reqVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 일계부 해당 달 말일일경우 DONE이 아닌 일계부 Alert 창 처리
|
||||
*
|
||||
* @param searchMonth 검색 월(yyyyMM)
|
||||
*/
|
||||
@GetMapping(path = "/alert/{searchMonth}")
|
||||
ResponseEntity<?> selectNoRegister(@PathVariable("searchMonth") String searchMonth) {
|
||||
return ResponseEntity.status(HttpStatus.OK).body(dailyRecordPortIn.selectNoRegister(searchMonth, AuthUtil.getUserSeq()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -769,6 +769,7 @@
|
||||
root: '',
|
||||
list: '/record/calendar/{searchMonth}/{groupNo}',
|
||||
create: '/record/daily/{searchMonth}/{groupNo}',
|
||||
alert: '/api/record/daily/alert/{searchMonth}',
|
||||
},
|
||||
submitted: false,
|
||||
};
|
||||
@@ -807,6 +808,61 @@
|
||||
}
|
||||
|
||||
$('#selectedDay').html(html);
|
||||
|
||||
|
||||
// 오늘 날짜가 해당 달의 마지막 날인지 확인
|
||||
const today = new Date();
|
||||
const lastDayOfMonth = new Date(viewDate.getFullYear(), viewDate.getMonth() + 1, 0); // 해당 달의 마지막 날
|
||||
if (today.getFullYear() === lastDayOfMonth.getFullYear() &&
|
||||
today.getMonth() === lastDayOfMonth.getMonth() &&
|
||||
today.getDate() === lastDayOfMonth.getDate()) {
|
||||
ajaxUtil._ajaxSyncMethod(
|
||||
ENV.httpUrl.alert.replace('{searchMonth}', searchMonth.replace('-', '')),
|
||||
{},
|
||||
function (response) {
|
||||
let dailyNo = []
|
||||
let msgTxt = '';
|
||||
let month = viewDate.getMonth() + 1;
|
||||
msgTxt += "등록하지 않은 일계부 항목이 있습니다.\n 정확한 조사를 위해 꾸준히 입력해 주세요.\n";
|
||||
if(response.dailyRecordAlertDtoList.length > 0){
|
||||
response.dailyRecordAlertDtoList.forEach((dto) =>{
|
||||
let dateTxt;
|
||||
if(dto.startDay === dto.endDay){
|
||||
dateTxt = month+"월 "+dto.startDay+"일";
|
||||
}else{
|
||||
dateTxt = month+"월 "+dto.startDay+"~"+dto.endDay+"일";
|
||||
}
|
||||
dailyNo.push(dateTxt);
|
||||
});
|
||||
msgTxt += "1. 일계부 미등록 \n"+dailyNo.join(',')+"\n";
|
||||
}
|
||||
|
||||
if(response.monthRecordAlertDtoList.length > 0) {
|
||||
response.monthRecordAlertDtoList.forEach((dto,idx) => {
|
||||
if(response.dailyRecordAlertDtoList.length > 0){
|
||||
idx ++;
|
||||
}
|
||||
msgTxt += idx+". "+dto+"\n";
|
||||
});
|
||||
}
|
||||
|
||||
if(response.dailyRecordAlertDtoList.length > 0 || dto.monthRecordAlertDtoList.length > 0) {
|
||||
etUI.dialog.alert({
|
||||
title: '',
|
||||
message: msgTxt,
|
||||
type:'alert',
|
||||
callback: function () {
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
function (rstData, status) {
|
||||
|
||||
},
|
||||
'get'
|
||||
,'json'
|
||||
);
|
||||
}
|
||||
},
|
||||
recordCreate(searchMonth, groupNo) {
|
||||
location.href = ENV.httpUrl.create.replace('{searchMonth}', searchMonth.replace('-', '')).replace('{groupNo}', groupNo);
|
||||
|
||||
Reference in New Issue
Block a user