[BO] 문자 발송 작업 (3)
This commit is contained in:
@@ -33,38 +33,44 @@ public class DateUiUtil {
|
||||
return LocalDate.now().format(VALUE_FORMAT);
|
||||
}
|
||||
|
||||
public static String getMonthValue(LocalDate date) {
|
||||
return date.format(VALUE_FORMAT);
|
||||
}
|
||||
|
||||
/**
|
||||
* 문자 자동 발송 대상 날짜 범위를 반환합니다.
|
||||
*
|
||||
* 발송일 기준으로 이전 6일간의 날짜 범위를 계산하며,
|
||||
* 발송일은 매월 7일, 14일, 21일, 말일입니다.
|
||||
* 발송일 기준으로 대상자 범위를 계산합니다.
|
||||
* 발송일은 매월 8일, 15일, 22일, 다음 달 1일이며,
|
||||
* 각 발송일마다 고정된 날짜 구간이 대상자 범위로 설정됩니다.
|
||||
*
|
||||
* 예시:
|
||||
* - 7일인 경우 → 1일부터 6일까지
|
||||
* - 14일인 경우 → 7일부터 13일까지
|
||||
* - 21일인 경우 → 14일부터 20일까지
|
||||
* - 말일인 경우 → 22일부터 말일까지
|
||||
* - 8일인 경우 → 1일부터 7일 까지
|
||||
* - 15일인 경우 → 8일부터 14일 까지
|
||||
* - 22일인 경우 → 15일부터 21일 까지
|
||||
* - 다음 달 1일인 경우 → 전달의 22일 부터 28,30,31일 까지
|
||||
*
|
||||
* 발송일이 아닌 경우에는 null을 반환합니다.
|
||||
* 발송일이 아닌 경우에는 빈 Optional을 반환합니다.
|
||||
*
|
||||
* @param day 오늘 날짜의 일(day of month)
|
||||
* @return DayRange 객체 또는 발송일이 아니면 null
|
||||
* @param today 현재 날짜
|
||||
* @return DayRange 객체 또는 발송일이 아니면 Optional.empty()
|
||||
*/
|
||||
public static Optional<DayRange> getDayRange(int day) {
|
||||
LocalDate today = LocalDate.now();
|
||||
int lastDay = today.lengthOfMonth();
|
||||
public static Optional<DayRange> getDayRange(LocalDate today) {
|
||||
int day = today.getDayOfMonth();
|
||||
|
||||
// 주간 범위 계산
|
||||
if (day == 7) {
|
||||
return Optional.of(new DayRange(1, 6));
|
||||
} else if (day == 14) {
|
||||
return Optional.of(new DayRange(7, 13));
|
||||
} else if (day == 21) {
|
||||
return Optional.of(new DayRange(14, 20));
|
||||
} else if (day == lastDay) {
|
||||
return Optional.of(new DayRange(21, lastDay));
|
||||
if (day == 8) {
|
||||
return Optional.of(new DayRange(1, 7));
|
||||
} else if (day == 15) {
|
||||
return Optional.of(new DayRange(8, 14));
|
||||
} else if (day == 22) {
|
||||
return Optional.of(new DayRange(15, 21));
|
||||
} else if (day == 1) {
|
||||
// 다음 달 1일 → 전달 22~말일까지
|
||||
LocalDate prevMonth = today.minusMonths(1);
|
||||
int prevLastDay = prevMonth.lengthOfMonth();
|
||||
return Optional.of(new DayRange(22, prevLastDay));
|
||||
} else {
|
||||
return Optional.empty(); // 발송일 아님
|
||||
return Optional.empty();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
package app.module.admin.usecase.dashboard.updateSmsAutoStatus.adapters.web;
|
||||
|
||||
import app.module.admin.usecase.dashboard.updateSmsAutoStatus.ports.UpdateSmsAutoStatusPortIn;
|
||||
import app.module.admin.usecase.dashboard.updateSmsAutoStatus.ports.application.domain.UpdateSmsAutoStatusCmd;
|
||||
import app.module.core.config.application.util.MessageUtil;
|
||||
import jakarta.validation.Valid;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.PatchMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import app.module.admin.usecase.dashboard.updateSmsAutoStatus.adapters.web.model.UpdateSmsAutoStatusReqVO;
|
||||
import app.module.admin.usecase.dashboard.updateSmsAutoStatus.adapters.web.model.UpdateSmsAutoStatusResVO;
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
class UpdateSmsAutoStatusController {
|
||||
private final UpdateSmsAutoStatusPortIn portIn;
|
||||
private final MessageUtil messageUtil;
|
||||
|
||||
@PatchMapping(path = "/api/smsAutoStatus/update")
|
||||
ResponseEntity<?> operate(@Valid @RequestBody UpdateSmsAutoStatusReqVO reqVO,
|
||||
BindingResult bindingResult) {
|
||||
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResponseEntity.status(HttpStatus.UNPROCESSABLE_ENTITY)
|
||||
.body(bindingResult.getFieldErrors());
|
||||
}
|
||||
|
||||
try {
|
||||
portIn.operate(new UpdateSmsAutoStatusCmd(reqVO.getActive()));
|
||||
} catch (Exception e) {
|
||||
// update 실패
|
||||
log.info(e.getMessage());
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
return ResponseEntity.status(HttpStatus.OK).body(new UpdateSmsAutoStatusResVO(
|
||||
messageUtil.getMessage("operation.common.update.done")));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package app.module.admin.usecase.dashboard.updateSmsAutoStatus.adapters.web.model;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class UpdateSmsAutoStatusReqVO {
|
||||
private Boolean active;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package app.module.admin.usecase.dashboard.updateSmsAutoStatus.adapters.web.model;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class UpdateSmsAutoStatusResVO {
|
||||
private String message;
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
package app.module.admin.usecase.home.adapters.web;
|
||||
|
||||
import app.module.admin.config.application.util.AdminUtil;
|
||||
import app.module.admin.usecase.dashboard.getSmsAutoStatus.ports.GetSmsAutoStatusPortIn;
|
||||
import app.module.core.usecase.admin.view.ports.AdminViewPortIn;
|
||||
import java.security.Principal;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -14,6 +16,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
public class HomeController {
|
||||
|
||||
private final AdminViewPortIn adminViewPortIn;
|
||||
private final GetSmsAutoStatusPortIn getSmsAutoStatusPortIn;
|
||||
|
||||
@GetMapping
|
||||
public String home(Principal principal, Model model) {
|
||||
@@ -25,6 +28,9 @@ public class HomeController {
|
||||
model.addAttribute("loginUserRoles", loginUser.getRole());
|
||||
});
|
||||
|
||||
model.addAttribute("smsActive",
|
||||
getSmsAutoStatusPortIn.operate().orElse(null).getActive());
|
||||
|
||||
return "home";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,26 +46,23 @@ class AutoSchedulesService implements AutoSchedulesPortIn {
|
||||
return Optional.of(false);
|
||||
}
|
||||
|
||||
String currentMonth = DateUiUtil.getCurrentMonthValue(); // 현재 월
|
||||
LocalDate today = LocalDate.now();
|
||||
int day = today.getDayOfMonth();
|
||||
int lastDay = today.lengthOfMonth();
|
||||
|
||||
// 매월 7일, 24일, 21일, 말일 에만 발송
|
||||
if (day == 7 || day == 14 || day == 21 || day == lastDay) {
|
||||
DayRange dayRange = DateUiUtil.getDayRange(day).orElse(null);
|
||||
// 발송일 조건: 8일, 15일, 22일, 1일(다음 달 대상자)
|
||||
if (day == 8 || day == 15 || day == 22 || day == 1) {
|
||||
// 발송 대상 날짜 범위 구하기
|
||||
DayRange dayRange = DateUiUtil.getDayRange(today).orElse(null);
|
||||
if (dayRange == null) return Optional.of(false);
|
||||
|
||||
if (dayRange == null) {
|
||||
return Optional.of(false);
|
||||
}
|
||||
// 대상 월 계산 (1일 이면 이전 달 / 1일이 아니면 현재 달 yyyyMM 을 가져온다.)
|
||||
LocalDate baseDate = (day == 1) ? today.minusMonths(1) : today;
|
||||
String targetMonth = DateUiUtil.getMonthValue(baseDate);
|
||||
|
||||
// dayRange 날짜 범위의 일계부 미등록한 임가 목록 조회
|
||||
List<GetIncompleteHouseholds> incompleteHouseholds =
|
||||
getIncompleteHouseholdsPortIn.operate(
|
||||
new GetIncompleteHouseholdsCmd(
|
||||
currentMonth,
|
||||
dayRange.getFromDay(),
|
||||
dayRange.getToDay()));
|
||||
List<GetIncompleteHouseholds> incompleteHouseholds = getIncompleteHouseholdsPortIn.operate(
|
||||
new GetIncompleteHouseholdsCmd(targetMonth, dayRange.getFromDay(), dayRange.getToDay())
|
||||
);
|
||||
|
||||
// 미등록 임가가 있을 경우에만 실행
|
||||
if(!CollectionUtils.isEmpty(incompleteHouseholds)) {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<update id="operate">
|
||||
/* operate : 문자 자동 발송 활성화 상태 수정 */
|
||||
UPDATE sms_auto_status
|
||||
SET active = #{active}
|
||||
<include refid="common.fields.DeleteBaseSet" />
|
||||
SET active = #{active},
|
||||
<include refid="common.fields.UpdateBaseSet" />
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -94,7 +94,7 @@
|
||||
<a aria-current="page" th:href="${topNode.uri}" >
|
||||
<img class="logo" th:src="@{/static/assets/images/common/ico_logo.svg}" alt="로고 이미지">
|
||||
</a>
|
||||
<p class="logo-tit">임가경제조사 일계부 관리자모드</p>
|
||||
<p class="logo-tit"><a th:href="${topNode.uri}">임가경제조사 일계부 관리자모드</a></p>
|
||||
</div>
|
||||
<ul class="main-menu" th:if="${topNode != null}">
|
||||
<li class="menu-item" th:each="menu : ${topNode.children}"
|
||||
|
||||
@@ -1,35 +1,423 @@
|
||||
<!DOCTYPE html>
|
||||
<html layout:decorate="~{layout/layout-home}" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
|
||||
<html layout:decorate="~{layout/layout-home}"
|
||||
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
|
||||
xmlns:sec="http://www.w3.org/1999/xhtml"
|
||||
xmlns:th="http://www.thymeleaf.org">
|
||||
|
||||
<head>
|
||||
<title>관리자 수정</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<section layout:fragment="content">
|
||||
<hgroup class="page-tit-group">
|
||||
<h2 class="page-tit">
|
||||
2025년 6월 현황
|
||||
</h2>
|
||||
<div class="table-tit-group large">
|
||||
<div class="component-select">
|
||||
<select class="select-list" required>
|
||||
<option value="" disabled hidden>선택해주세요.</option>
|
||||
<option value="value1" selected>전체</option>
|
||||
<option value="value2">Option 2</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</hgroup>
|
||||
<div class="content-inner">
|
||||
<section class="dounut-chart-area">
|
||||
<div class="chart-group type-green">
|
||||
<dl>
|
||||
<dt>
|
||||
<strong>일계부 진행률</strong>
|
||||
<span>(전체 임가 기준)</span>
|
||||
</dt>
|
||||
<dd>
|
||||
<strong class="percent">50</strong>
|
||||
<span class="d-flex">
|
||||
<span>1006</span>
|
||||
/
|
||||
<span>1476</span>
|
||||
</span>
|
||||
</dd>
|
||||
</dl>
|
||||
<div class="donut-chart" style="--percent: 50;">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="p-5 mb-4 bg-light rounded-3">
|
||||
<div class="container-fluid py-5">
|
||||
<h1 class="display-5 fw-bold">안녕하세요, <span class="text-muted"
|
||||
sec:authentication="name"></span> :-)</h1>
|
||||
<p class="col-md-8 fs-4">
|
||||
관리자 메인에 오신걸 환영합니다. <span class="text-muted" sec:authentication="name"></span> 님께 부여된 역할에 따라
|
||||
메뉴이용이
|
||||
제한되는 점에 유의해주세요.
|
||||
</p>
|
||||
<div class="chart-group type-blue">
|
||||
<dl>
|
||||
<dt>
|
||||
<strong>일계부 진행률</strong>
|
||||
<span>(전체 임가 기준)</span>
|
||||
</dt>
|
||||
<dd>
|
||||
<strong class="percent">68</strong>
|
||||
<span class="d-flex">
|
||||
<span>1006</span>
|
||||
/
|
||||
<span>1476</span>
|
||||
</span>
|
||||
</dd>
|
||||
</dl>
|
||||
<div class="donut-chart" style="--percent: 68;">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="chart-group type-orange">
|
||||
<dl>
|
||||
<dt>
|
||||
<strong>일계부 진행률</strong>
|
||||
<span>(전체 임가 기준)</span>
|
||||
</dt>
|
||||
<dd>
|
||||
<strong class="percent">48</strong>
|
||||
<span class="d-flex">
|
||||
<span>1006</span>
|
||||
/
|
||||
<span>1476</span>
|
||||
</span>
|
||||
</dd>
|
||||
</dl>
|
||||
<div class="donut-chart" style="--percent: 48;">
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<div class="table-group">
|
||||
<div class="table-tit-group large">
|
||||
<h3>
|
||||
지방실사별 진행현황
|
||||
</h3>
|
||||
</div>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
실사
|
||||
</th>
|
||||
<th>임계부 진행률</th>
|
||||
<th>현장 방문률(1차)</th>
|
||||
<th>답례품 전달률</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>서울</td>
|
||||
<td>
|
||||
<div class="progress-group type-green">
|
||||
<progress class="progress" value="85" min="0" max="100"></progress>
|
||||
<div class="detail">
|
||||
<p class="percent">85</p>
|
||||
<span class="d-flex">
|
||||
(
|
||||
<span>66</span>
|
||||
/
|
||||
<span>78</span>
|
||||
)
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="progress-group type-blue">
|
||||
<progress class="progress" value="85" min="0" max="100"></progress>
|
||||
<div class="detail">
|
||||
<p class="percent">85</p>
|
||||
<span class="d-flex">
|
||||
(
|
||||
<span>66</span>
|
||||
/
|
||||
<span>78</span>
|
||||
)
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="progress-group type-orange">
|
||||
<progress class="progress" value="85" min="0" max="100"></progress>
|
||||
<div class="detail">
|
||||
<p class="percent">85</p>
|
||||
<span class="d-flex">
|
||||
(
|
||||
<span>66</span>
|
||||
/
|
||||
<span>78</span>
|
||||
)
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>강원</td>
|
||||
<td>
|
||||
<div class="progress-group type-green">
|
||||
<progress class="progress" value="35" min="0" max="100"></progress>
|
||||
<div class="detail">
|
||||
<p class="percent">35</p>
|
||||
<span class="d-flex">
|
||||
(
|
||||
<span>66</span>
|
||||
/
|
||||
<span>78</span>
|
||||
)
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="progress-group type-blue">
|
||||
<progress class="progress" value="55" min="0" max="100"></progress>
|
||||
<div class="detail">
|
||||
<p class="percent">55</p>
|
||||
<span class="d-flex">
|
||||
(
|
||||
<span>66</span>
|
||||
/
|
||||
<span>78</span>
|
||||
)
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="progress-group type-orange">
|
||||
<progress class="progress" value="85" min="0" max="100"></progress>
|
||||
<div class="detail">
|
||||
<p class="percent">85</p>
|
||||
<span class="d-flex">
|
||||
(
|
||||
<span>66</span>
|
||||
/
|
||||
<span>78</span>
|
||||
)
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="total">
|
||||
<td>전체</td>
|
||||
<td>
|
||||
<span>68</span>%
|
||||
</td>
|
||||
<td>
|
||||
<span>68</span>%
|
||||
</td>
|
||||
<td>
|
||||
<span>68</span>%
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="table-group">
|
||||
<div class="table-tit-group large">
|
||||
<h3>
|
||||
조사원별 진행 현황
|
||||
</h3>
|
||||
<div class="component-select">
|
||||
<select class="select-list" required>
|
||||
<option value="" disabled hidden>선택해주세요.</option>
|
||||
<option value="value1" selected>전체</option>
|
||||
<option value="value2">Option 2</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<table>
|
||||
<colgroup>
|
||||
<col width="8%"/>
|
||||
<col width="8%"/>
|
||||
<col width="8%"/>
|
||||
<col width="25%"/>
|
||||
<col width="25%"/>
|
||||
<col width="25%"/>
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>조사원명</th>
|
||||
<th>실사</th>
|
||||
<th>할당 임가 수</th>
|
||||
<th>임계부 진행률</th>
|
||||
<th>현장 방문률(1차)</th>
|
||||
<th>답례품 전달률</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="">김조사</a>
|
||||
</td>
|
||||
<td>서울</td>
|
||||
<td>24</td>
|
||||
<td>
|
||||
<div class="progress-group type-green">
|
||||
<progress class="progress" value="85" min="0" max="100"></progress>
|
||||
<div class="detail">
|
||||
<p class="percent">85</p>
|
||||
<span class="d-flex">
|
||||
(
|
||||
<span>66</span>
|
||||
/
|
||||
<span>78</span>
|
||||
)
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="progress-group type-blue">
|
||||
<progress class="progress" value="85" min="0" max="100"></progress>
|
||||
<div class="detail">
|
||||
<p class="percent">85</p>
|
||||
<span class="d-flex">
|
||||
(
|
||||
<span>66</span>
|
||||
/
|
||||
<span>78</span>
|
||||
)
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="progress-group type-orange">
|
||||
<progress class="progress" value="85" min="0" max="100"></progress>
|
||||
<div class="detail">
|
||||
<p class="percent">85</p>
|
||||
<span class="d-flex">
|
||||
(
|
||||
<span>66</span>
|
||||
/
|
||||
<span>78</span>
|
||||
)
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="">김조사</a>
|
||||
</td>
|
||||
<td>서울</td>
|
||||
<td>24</td>
|
||||
<td>
|
||||
<div class="progress-group type-green">
|
||||
<progress class="progress" value="85" min="0" max="100"></progress>
|
||||
<div class="detail">
|
||||
<p class="percent">85</p>
|
||||
<span class="d-flex">
|
||||
(
|
||||
<span>66</span>
|
||||
/
|
||||
<span>78</span>
|
||||
)
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="progress-group type-blue">
|
||||
<progress class="progress" value="85" min="0" max="100"></progress>
|
||||
<div class="detail">
|
||||
<p class="percent">85</p>
|
||||
<span class="d-flex">
|
||||
(
|
||||
<span>66</span>
|
||||
/
|
||||
<span>78</span>
|
||||
)
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="progress-group type-orange">
|
||||
<progress class="progress" value="85" min="0" max="100"></progress>
|
||||
<div class="detail">
|
||||
<p class="percent">85</p>
|
||||
<span class="d-flex">
|
||||
(
|
||||
<span>66</span>
|
||||
/
|
||||
<span>78</span>
|
||||
)
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section th:if="${loginUserRoles.id == 'ROLE_ADMIN'}">
|
||||
<div class="table-group">
|
||||
<div class="table-tit-group large">
|
||||
<h3>
|
||||
문자 발송 체크
|
||||
</h3>
|
||||
</div>
|
||||
<button type="button" class="btn small">
|
||||
<span class="btn-txt">
|
||||
<label class="radio-inner">
|
||||
<input type="checkbox" id="smsAutoSend" th:checked="${smsActive}"
|
||||
onclick="smsAutoSendConfirm(this);">
|
||||
<span class="radio-item">
|
||||
<span class="radio-txt">문자 자동 발송</span>
|
||||
</span>
|
||||
</label>
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<p class="col-md-8 fs-5">
|
||||
<span>역할</span>
|
||||
<span class="text-muted"
|
||||
th:each="role, status : ${loginUserRoles}"
|
||||
th:text="${role.getId()} + ' (' + ${role.description} + ')' + ${!status.last ? ', ': ''}"></span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</body>
|
||||
|
||||
<section layout:fragment="script">
|
||||
<script>
|
||||
/**
|
||||
* 문자 발송 체크 스크립트
|
||||
* */
|
||||
|
||||
// 문자 자동 발송 컨펌창
|
||||
const smsAutoSendConfirm = (el) => {
|
||||
let message = el.checked ? '문자 자동 발송 기능을 사용하시겠습니까?' : '문자 자동 발송 기능을 중지하시겠습니까?';
|
||||
|
||||
etUI.dialog.confirm({
|
||||
title: '문자 자동 발송 안내',
|
||||
message: message,
|
||||
negativeCallback: function () {
|
||||
$(el).prop('checked', !el.checked);
|
||||
},
|
||||
positiveCallback: function () {
|
||||
updateSmsAutoStatusActive(el.checked);
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
// 문자 자동 발송 기능 활성화
|
||||
const updateSmsAutoStatusActive = (active) => {
|
||||
ajaxUtil._ajaxMethod(
|
||||
'/api/smsAutoStatus/update',
|
||||
JSON.stringify({
|
||||
active: active,
|
||||
}),
|
||||
() => {
|
||||
$('#smsAutoSend').prop('checked', active);
|
||||
},
|
||||
(code, rstData) => {
|
||||
if(code == 422) alert(rstData.responseText);
|
||||
$('#smsAutoSend').prop('checked', !active);
|
||||
},
|
||||
'patch',
|
||||
'json',
|
||||
{ handle422Type: 'alert' }
|
||||
);
|
||||
}
|
||||
</script>
|
||||
</section>
|
||||
|
||||
</html>
|
||||
|
||||
@@ -4,23 +4,26 @@
|
||||
<head th:replace="~{common/components :: head}"></head>
|
||||
|
||||
<body>
|
||||
<header th:replace="~{common/components :: header}"></header>
|
||||
<div id="wrap">
|
||||
<header th:replace="~{common/components :: header}"></header>
|
||||
|
||||
<div id="container">
|
||||
|
||||
<div id="content" role="main">
|
||||
<div class="inner">
|
||||
<div class="content-inner">
|
||||
<div th:replace="~{common/components :: operationMessage}"></div>
|
||||
<div style="display: flex; justify-content: space-evenly;align-items: center; width:100%; background: #DEE2E6; height: 500px; font-size: 16px;">
|
||||
<section class="container" layout:fragment="content">
|
||||
<div th:replace="~{common/components :: operationMessage}"></div>
|
||||
<div class="content-inner">
|
||||
<section layout:fragment="content">
|
||||
page content
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div th:replace="~{common/components :: footer}"></div>
|
||||
|
||||
<section layout:fragment="script"></section>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user