Merge branch 'dev' into 'deploy-dev-front'
Dev See merge request korea-research/korea-research!101
This commit is contained in:
@@ -63,7 +63,7 @@ public class RoleUpdateAspect {
|
||||
|| currentRoles.stream().anyMatch(item -> !beforeRoles.contains(item))) {
|
||||
createLog = true;
|
||||
}
|
||||
} else if (currentRoles.size() > 0) {
|
||||
} else if (!currentRoles.isEmpty()) {
|
||||
createLog = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
package app.module.admin.config.application.batch;
|
||||
|
||||
import app.module.admin.usecase.batchLog.ports.BatchLogPortIn;
|
||||
import app.module.admin.usecase.batchLog.ports.application.domain.BatchLogType;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class BatchLogRunner {
|
||||
private final BatchLogPortIn batchLogPortIn;
|
||||
|
||||
public void run(BatchLogType batchType, Runnable action) {
|
||||
// 이미 실행 중인지 확인
|
||||
if (batchLogPortIn.exists(batchType)) {
|
||||
log.warn("[{}] 배치가 이미 실행 중 입니다.", batchType.name());
|
||||
return;
|
||||
}
|
||||
|
||||
// 실행 로그 insert (RUNNING)
|
||||
Long logId = batchLogPortIn.create(batchType);
|
||||
|
||||
try {
|
||||
action.run();
|
||||
// 성공 처리
|
||||
batchLogPortIn.update(logId, "SUCCESS", null);
|
||||
} catch (Exception e) {
|
||||
// 실패 처리
|
||||
batchLogPortIn.update(logId, "FAIL", e.getMessage());
|
||||
log.error("[{}] 배치 실패: {}", batchType.name(), e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,6 +10,8 @@ import app.module.core.usecase.admin.view.ports.AdminViewPortIn;
|
||||
import app.module.core.usecase.operationlog.save.application.domain.OperationLogSaveCommand;
|
||||
import app.module.core.usecase.operationlog.save.application.port.in.OperationLogSavePortIn;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -37,7 +39,7 @@ public class AdminAuthFailEvent {
|
||||
@EventListener
|
||||
public void handleAuthenticationFailureEvent(AbstractAuthenticationFailureEvent event) {
|
||||
HttpServletRequest request =
|
||||
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
|
||||
((ServletRequestAttributes) Objects.requireNonNull(RequestContextHolder.getRequestAttributes())).getRequest();
|
||||
|
||||
if (event.getException() instanceof BadCredentialsException) {
|
||||
adminViewPortIn
|
||||
|
||||
@@ -10,6 +10,8 @@ import app.module.core.usecase.admin.status.ports.AdminUpdateLoginFailPortIn;
|
||||
import app.module.core.usecase.admin.view.ports.AdminViewPortIn;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Objects;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
@@ -49,7 +51,7 @@ public class AdminAuthSuccessEvent {
|
||||
AdminUser adminUser = (AdminUser) authentication.getPrincipal();
|
||||
|
||||
HttpServletRequest request =
|
||||
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
|
||||
((ServletRequestAttributes) Objects.requireNonNull(RequestContextHolder.getRequestAttributes())).getRequest();
|
||||
|
||||
// 로그인 실패 회수 초기화
|
||||
adminViewPortIn
|
||||
|
||||
@@ -82,7 +82,7 @@ public class AdminSecurityConfig {
|
||||
List<String> permitPaths =
|
||||
Arrays.stream(PublicAccess.values())
|
||||
.map(PublicAccess::getPath)
|
||||
.collect(Collectors.toList());
|
||||
.toList();
|
||||
|
||||
http.authorizeHttpRequests(
|
||||
(auth) ->
|
||||
|
||||
@@ -2,10 +2,12 @@ package app.module.admin.config.application.security;
|
||||
|
||||
import java.util.Collection;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.springframework.security.core.GrantedAuthority;
|
||||
import org.springframework.security.core.userdetails.User;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class AdminUser extends User {
|
||||
private Long seq;
|
||||
private String roleId;
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
package app.module.admin.config.application.util.model;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.apache.poi.ss.usermodel.IndexedColors;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class ExcelSheetDto {
|
||||
/**
|
||||
* 시트명
|
||||
@@ -36,10 +40,4 @@ public class ExcelSheetDto {
|
||||
this.commaColumns = commaColumns;
|
||||
this.headerBgColors = headerBgColors;
|
||||
}
|
||||
|
||||
public String getSheetName() { return sheetName; }
|
||||
public List<String> getHeaders() { return headers; }
|
||||
public List<List<String>> getData() { return data; }
|
||||
public Set<Integer> getCommaColumns() { return commaColumns; }
|
||||
public Map<Integer, IndexedColors> getHeaderBgColors() { return headerBgColors; }
|
||||
}
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
package app.module.admin.usecase.batchLog.adapters.persistence;
|
||||
|
||||
import app.module.admin.usecase.batchLog.ports.BatchLogPortOut;
|
||||
import app.module.admin.usecase.batchLog.ports.application.domain.BatchLogCmd;
|
||||
import app.module.admin.usecase.batchLog.ports.application.domain.BatchLogType;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
@RequiredArgsConstructor
|
||||
class BatchLogDao implements BatchLogPortOut {
|
||||
private final BatchLogMapper mapper;
|
||||
|
||||
@Override
|
||||
public boolean exists(BatchLogType type) {
|
||||
return mapper.exists(type.name());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long create(BatchLogType type) {
|
||||
BatchLogCmd cmd = new BatchLogCmd(null, type.name(), "RUNNING", LocalDateTime.now());
|
||||
mapper.create(cmd);
|
||||
return cmd.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(Long id, String status, String errorMessage) {
|
||||
mapper.update(id, status, errorMessage);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package app.module.admin.usecase.batchLog.adapters.persistence;
|
||||
|
||||
import app.module.admin.usecase.batchLog.ports.application.domain.BatchLogCmd;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface BatchLogMapper {
|
||||
boolean exists(String type);
|
||||
Long create(BatchLogCmd cmd);
|
||||
void update(Long id, String status, String errorMessage);
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package app.module.admin.usecase.batchLog.ports;
|
||||
|
||||
import app.module.admin.usecase.batchLog.ports.application.domain.BatchLogType;
|
||||
|
||||
public interface BatchLogPortIn {
|
||||
boolean exists(BatchLogType type);
|
||||
Long create(BatchLogType type);
|
||||
void update(Long id, String status, String errorMessage);
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package app.module.admin.usecase.batchLog.ports;
|
||||
|
||||
import app.module.admin.usecase.batchLog.ports.application.domain.BatchLogType;
|
||||
|
||||
public interface BatchLogPortOut {
|
||||
boolean exists(BatchLogType type);
|
||||
Long create(BatchLogType type);
|
||||
void update(Long id, String status, String errorMessage);
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package app.module.admin.usecase.batchLog.ports.application;
|
||||
|
||||
import app.module.admin.usecase.batchLog.ports.BatchLogPortIn;
|
||||
import app.module.admin.usecase.batchLog.ports.BatchLogPortOut;
|
||||
import app.module.admin.usecase.batchLog.ports.application.domain.BatchLogType;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
class BatchLogService implements BatchLogPortIn {
|
||||
private final BatchLogPortOut portOut;
|
||||
|
||||
@Override
|
||||
public boolean exists(BatchLogType type) {
|
||||
return portOut.exists(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long create(BatchLogType type) {
|
||||
return portOut.create(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(Long id, String status, String errorMessage) {
|
||||
portOut.update(id, status, errorMessage);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package app.module.admin.usecase.batchLog.ports.application.domain;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class BatchLog {
|
||||
private Long id;
|
||||
private String type;
|
||||
private String status;
|
||||
private LocalDateTime startAt;
|
||||
private LocalDateTime endAt;
|
||||
private String errorMessage;
|
||||
private LocalDateTime createdAt;
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package app.module.admin.usecase.batchLog.ports.application.domain;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class BatchLogCmd {
|
||||
private Long id;
|
||||
private String type;
|
||||
private String status;
|
||||
private LocalDateTime startAt;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package app.module.admin.usecase.batchLog.ports.application.domain;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
@Getter
|
||||
@RequiredArgsConstructor
|
||||
public enum BatchLogType {
|
||||
AUTO_SMS,
|
||||
MONTHLY_STATUS,
|
||||
CARRYOVER;
|
||||
}
|
||||
@@ -11,9 +11,14 @@ import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.validation.FieldError;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
|
||||
@Controller
|
||||
@RequiredArgsConstructor
|
||||
class CreateNoticeController {
|
||||
@@ -23,8 +28,13 @@ class CreateNoticeController {
|
||||
ResponseEntity<?> operate(@RequestBody @Valid CreateNoticeReqVO reqVO, BindingResult bindingResult) {
|
||||
|
||||
if (bindingResult.hasErrors()) {
|
||||
List<String> fieldOrder = Arrays.asList("title", "content", "visible", "startDate", "endDate");
|
||||
|
||||
List<FieldError> sortedErrors = bindingResult.getFieldErrors().stream()
|
||||
.sorted(Comparator.comparingInt(error -> fieldOrder.indexOf(error.getField())))
|
||||
.toList();
|
||||
return ResponseEntity.status(HttpStatus.UNPROCESSABLE_ENTITY)
|
||||
.body(bindingResult.getFieldErrors());
|
||||
.body(sortedErrors);
|
||||
}
|
||||
|
||||
CreateNotice article =
|
||||
|
||||
@@ -15,19 +15,19 @@ import java.util.List;
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class CreateNoticeReqVO {
|
||||
@NotBlank(message = "{valid.common.required}")
|
||||
@NotBlank(message = "제목은 필수입력값입니다.")
|
||||
private String title;
|
||||
|
||||
@NotBlank(message = "{valid.common.required}")
|
||||
@NotBlank(message = "내용은 {valid.common.required}")
|
||||
private String content;
|
||||
|
||||
@NotNull(message = "{valid.common.required}")
|
||||
@NotNull(message = "노출 여부는 {valid.common.required}")
|
||||
private Boolean visible;
|
||||
|
||||
@NotNull(message = "{valid.common.required}")
|
||||
@NotNull(message = "시작일은 {valid.common.required}")
|
||||
private LocalDateTime startDate;
|
||||
|
||||
@NotNull(message = "{valid.common.required}")
|
||||
@NotNull(message = "종료일은 {valid.common.required}")
|
||||
private LocalDateTime endDate;
|
||||
|
||||
private List<String> fileMappingId;
|
||||
|
||||
@@ -11,10 +11,15 @@ import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.validation.FieldError;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
class UpdateNoticeController {
|
||||
@@ -26,8 +31,13 @@ class UpdateNoticeController {
|
||||
|
||||
|
||||
if (bindingResult.hasErrors()) {
|
||||
List<String> fieldOrder = Arrays.asList("title", "content", "visible", "startDate", "endDate");
|
||||
|
||||
List<FieldError> sortedErrors = bindingResult.getFieldErrors().stream()
|
||||
.sorted(Comparator.comparingInt(error -> fieldOrder.indexOf(error.getField())))
|
||||
.toList();
|
||||
return ResponseEntity.status(HttpStatus.UNPROCESSABLE_ENTITY)
|
||||
.body(bindingResult.getFieldErrors());
|
||||
.body(sortedErrors);
|
||||
}
|
||||
|
||||
updateFilePortIn.operate(
|
||||
|
||||
@@ -17,20 +17,20 @@ public class UpdateNoticeReqVO {
|
||||
@NotNull(message = "{valid.common.required}")
|
||||
private Long id;
|
||||
|
||||
@NotBlank(message = "{valid.common.required}")
|
||||
@NotBlank(message = "제목은 {valid.common.required}")
|
||||
private String title;
|
||||
|
||||
@NotBlank(message = "{valid.common.required}")
|
||||
@NotBlank(message = "내용은 {valid.common.required}")
|
||||
private String content;
|
||||
|
||||
@NotNull(message = "{valid.common.required}")
|
||||
@NotNull(message = "노출여부는 {valid.common.required}")
|
||||
private Boolean visible;
|
||||
|
||||
|
||||
@NotNull(message = "{valid.common.required}")
|
||||
@NotNull(message = "시작일은 {valid.common.required}")
|
||||
private LocalDateTime startDate;
|
||||
|
||||
@NotNull(message = "{valid.common.required}")
|
||||
@NotNull(message = "종료일은 {valid.common.required}")
|
||||
private LocalDateTime endDate;
|
||||
|
||||
private List<String> fileMappingId;
|
||||
|
||||
@@ -2,6 +2,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.admin.usecase.dashboard.getSmsAutoStatus.ports.application.domain.GetSmsAutoStatus;
|
||||
import app.module.core.usecase.admin.view.ports.AdminViewPortIn;
|
||||
import java.security.Principal;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -28,8 +29,9 @@ public class HomeController {
|
||||
model.addAttribute("loginUserRoles", loginUser.getRole());
|
||||
});
|
||||
|
||||
model.addAttribute("smsActive",
|
||||
getSmsAutoStatusPortIn.operate().orElse(null).getActive());
|
||||
GetSmsAutoStatus smsAutoStatus = getSmsAutoStatusPortIn.operate().orElse(null);
|
||||
|
||||
model.addAttribute("smsActive", smsAutoStatus != null && smsAutoStatus.getActive());
|
||||
|
||||
return "home";
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ class CreateHouseholdUIController {
|
||||
RedirectAttributes redirectAttributes) {
|
||||
|
||||
// 임가 등록 페이지는 관리자만 접근 가능
|
||||
if (!AdminUtil.getLoginUserRole().equals("ROLE_ADMIN")) {
|
||||
if (!"ROLE_ADMIN".equals(AdminUtil.getLoginUserRole())) {
|
||||
redirectAttributes.addFlashAttribute("alertMessage", "접근 권한이 없습니다.");
|
||||
return "redirect:/households";
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ class ExcelUploadCreateHouseholdDao implements ExcelUploadCreateHouseholdPortOut
|
||||
CheckHouseholdNum checkHouseholdNum = checkHouseholdNumMapper.checkHouseholdNum(new CheckHouseholdNumCmd(getCellValue(row.getCell(0)))).orElse(null);
|
||||
ExcelUploadContactVO contactVO = getDivisionContact(row.getCell(3));
|
||||
|
||||
if(!checkHouseholdNum.getIsDuplicated() && contactVO != null) {
|
||||
if(checkHouseholdNum != null && !checkHouseholdNum.getIsDuplicated() && contactVO != null) {
|
||||
int flag = 0;
|
||||
ExcelCreateHouseholdVO household = new ExcelCreateHouseholdVO();
|
||||
household.setHouseholdNum(getCellValue(row.getCell(0))); // 임가번호
|
||||
|
||||
@@ -31,7 +31,7 @@ class GetHouseholdsStatusUIController {
|
||||
|
||||
// 로그인한 관리자 역할
|
||||
model.addAttribute("userRole", AdminUtil.getLoginUserRole());
|
||||
model.addAttribute("userRegionMainCode", admin.getRegionMainCode());
|
||||
model.addAttribute("userRegionMainCode", admin != null ? admin.getRegionMainCode() : null);
|
||||
|
||||
// 실사 코드 목록
|
||||
// 지방실사와 조사원은 담당실사 지역만 조회
|
||||
|
||||
@@ -39,7 +39,7 @@ class SaveBankAutoTransferExpenseService implements SaveBankAutoTransferExpenseP
|
||||
inCmd.getPrice(),
|
||||
"code.bank.output", // 지출 type code
|
||||
"2", // 지출 유형 2 고정
|
||||
monthlyInputStatus.getId(),
|
||||
monthlyInputStatus.getBankAutoTransferOutputStatus()));
|
||||
monthlyInputStatus != null ? monthlyInputStatus.getId() : null,
|
||||
monthlyInputStatus != null ? monthlyInputStatus.getBankAutoTransferOutputStatus() : null));
|
||||
}
|
||||
}
|
||||
@@ -41,8 +41,8 @@ class SaveBankAutoTransferIncomeService implements SaveBankAutoTransferIncomePor
|
||||
inCmd.getPrice(),
|
||||
"code.bank.input", // 수입 type code
|
||||
"1", // 수입 유형 1 고정
|
||||
monthlyInputStatus.getId(),
|
||||
monthlyInputStatus.getBankAutoTransferInputStatus()
|
||||
monthlyInputStatus != null ? monthlyInputStatus.getId() : null,
|
||||
monthlyInputStatus != null ? monthlyInputStatus.getBankAutoTransferInputStatus() : null
|
||||
));
|
||||
}
|
||||
}
|
||||
@@ -32,7 +32,7 @@ class UpdateHouseholdStatusUIController {
|
||||
RedirectAttributes redirectAttributes) {
|
||||
|
||||
// 임가 수정 페이지는 관리자만 접근 가능
|
||||
if (!AdminUtil.getLoginUserRole().equals("ROLE_ADMIN")) {
|
||||
if (!"ROLE_ADMIN".equals(AdminUtil.getLoginUserRole())) {
|
||||
redirectAttributes.addFlashAttribute("alertMessage", "접근 권한이 없습니다.");
|
||||
return "redirect:/households";
|
||||
}
|
||||
@@ -52,34 +52,36 @@ class UpdateHouseholdStatusUIController {
|
||||
GetHouseholdStatus result =
|
||||
getHouseholdStatusPortIn.operate(new GetHouseholdStatusCmd(seq)).orElse(null);
|
||||
|
||||
model.addAttribute("householdInfo",
|
||||
new UpdateHouseholdStatusUIResVO(
|
||||
result.getHouseholdSeq(),
|
||||
result.getHouseholdNum(),
|
||||
result.getHouseholdName(),
|
||||
result.getHouseholdAge(),
|
||||
StringUtils.hasText(result.getHouseholdTel()) ? result.getHouseholdTel().split("-")[0] : "",
|
||||
StringUtils.hasText(result.getHouseholdTel()) ? result.getHouseholdTel().split("-")[1] : "",
|
||||
StringUtils.hasText(result.getHouseholdTel()) ? result.getHouseholdTel().split("-")[2] : "",
|
||||
StringUtils.hasText(result.getHouseholdPhone()) ? result.getHouseholdPhone().split("-")[0] : "",
|
||||
StringUtils.hasText(result.getHouseholdPhone()) ? result.getHouseholdPhone().split("-")[1] : "",
|
||||
StringUtils.hasText(result.getHouseholdPhone()) ? result.getHouseholdPhone().split("-")[2] : "",
|
||||
result.getRegionMainCode(),
|
||||
result.getRegionSubCode(),
|
||||
result.getRegionDetailCode(),
|
||||
result.getAddress(),
|
||||
result.getIndustryLargeCode(),
|
||||
result.getIndustryMiddleCode(),
|
||||
result.getIndustrySubMiddleName(),
|
||||
result.getIndustryDetailName(),
|
||||
result.getIsPanel(),
|
||||
result.getUsageType(),
|
||||
result.getEmploymentType(),
|
||||
result.getMemo(),
|
||||
result.getResearcherSeq(),
|
||||
result.getResearcherName(),
|
||||
result.getResearcherPhone()
|
||||
));
|
||||
if (result != null) {
|
||||
model.addAttribute("householdInfo",
|
||||
new UpdateHouseholdStatusUIResVO(
|
||||
result.getHouseholdSeq(),
|
||||
result.getHouseholdNum(),
|
||||
result.getHouseholdName(),
|
||||
result.getHouseholdAge(),
|
||||
StringUtils.hasText(result.getHouseholdTel()) ? result.getHouseholdTel().split("-")[0] : "",
|
||||
StringUtils.hasText(result.getHouseholdTel()) ? result.getHouseholdTel().split("-")[1] : "",
|
||||
StringUtils.hasText(result.getHouseholdTel()) ? result.getHouseholdTel().split("-")[2] : "",
|
||||
StringUtils.hasText(result.getHouseholdPhone()) ? result.getHouseholdPhone().split("-")[0] : "",
|
||||
StringUtils.hasText(result.getHouseholdPhone()) ? result.getHouseholdPhone().split("-")[1] : "",
|
||||
StringUtils.hasText(result.getHouseholdPhone()) ? result.getHouseholdPhone().split("-")[2] : "",
|
||||
result.getRegionMainCode(),
|
||||
result.getRegionSubCode(),
|
||||
result.getRegionDetailCode(),
|
||||
result.getAddress(),
|
||||
result.getIndustryLargeCode(),
|
||||
result.getIndustryMiddleCode(),
|
||||
result.getIndustrySubMiddleName(),
|
||||
result.getIndustryDetailName(),
|
||||
result.getIsPanel(),
|
||||
result.getUsageType(),
|
||||
result.getEmploymentType(),
|
||||
result.getMemo(),
|
||||
result.getResearcherSeq(),
|
||||
result.getResearcherName(),
|
||||
result.getResearcherPhone()
|
||||
));
|
||||
}
|
||||
|
||||
return "households/update/{seq}";
|
||||
}
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
package app.module.admin.usecase.schedule.autoSchedules.adapters.persistence;
|
||||
|
||||
import app.module.admin.usecase.schedule.autoSchedules.ports.AutoSchedulesPortOut;
|
||||
import app.module.admin.usecase.schedule.autoSchedules.ports.application.domain.CreateSmsAutoSendCmd;
|
||||
import java.util.Optional;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
@Slf4j
|
||||
@Repository
|
||||
@RequiredArgsConstructor
|
||||
@@ -24,24 +22,9 @@ class AutoSchedulesDao implements AutoSchedulesPortOut {
|
||||
|
||||
return Optional.of(true);
|
||||
} catch (Exception e) {
|
||||
// 예외 발생 시 false 반환
|
||||
return Optional.of(false);
|
||||
}
|
||||
log.error("[AutoSchedule][createMonthlyInputStatus] message: {}", e.getMessage(), e);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public Optional<Boolean> sendAutoSms(CreateSmsAutoSendCmd cmd) {
|
||||
try {
|
||||
mapper.createSmsAutoSend(cmd);
|
||||
|
||||
return Optional.of(true);
|
||||
} catch (Exception e) {
|
||||
log.info(e.getMessage());
|
||||
|
||||
// 예외 발생 시 false 반환
|
||||
return Optional.of(false);
|
||||
throw new RuntimeException("월별 입력 항목 관리 생성 중 오류: " + e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,8 +38,7 @@ class AutoSchedulesDao implements AutoSchedulesPortOut {
|
||||
} catch (Exception e) {
|
||||
log.error("[AutoSchedule][monthlyCarryOver] message: {}", e.getMessage(), e);
|
||||
|
||||
// 예외 발생 시 false 반환
|
||||
return Optional.of(false);
|
||||
throw new RuntimeException("일계부 월초이월금 생성 중 오류: " + e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
package app.module.admin.usecase.schedule.autoSchedules.adapters.persistence;
|
||||
|
||||
import app.module.admin.usecase.schedule.autoSchedules.ports.application.domain.CreateSmsAutoSendCmd;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface AutoSchedulesMapper {
|
||||
void createMonthlyInputStatus();
|
||||
void createSmsAutoSend(CreateSmsAutoSendCmd cmd);
|
||||
String createMonthlyInputStatus();
|
||||
String createMonthlyCarryOver();
|
||||
}
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
package app.module.admin.usecase.schedule.autoSchedules.adapters.web;
|
||||
|
||||
import app.module.admin.config.application.util.DateUiUtil;
|
||||
import app.module.admin.config.application.util.model.DayRange;
|
||||
import app.module.admin.usecase.schedule.autoSchedules.ports.AutoSchedulesPortIn;
|
||||
import java.time.LocalDate;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@@ -17,13 +14,19 @@ public class AutoSchedulesController {
|
||||
this.portIn = portIn;
|
||||
}
|
||||
|
||||
// 매 월 1일 1초 마다 실행되는 스케줄러
|
||||
/**
|
||||
* 월별입력상태 등록
|
||||
* 매 월 1일 1초 마다 실행되는 스케줄러
|
||||
*/
|
||||
@Scheduled(cron = "1 0 0 1 * *")
|
||||
public void fetchArticlesPeriodically() {
|
||||
portIn.operate();
|
||||
}
|
||||
|
||||
// 매일 오후 5시 마다 실행되는 스케줄러
|
||||
/**
|
||||
* 문자자동발송 등록
|
||||
* 매일 오후 5시 마다 실행되는 스케줄러
|
||||
*/
|
||||
@Scheduled(cron = "0 0 17 * * ?")
|
||||
public void fetchSmsAutoSend() {
|
||||
portIn.sendAutoSms();
|
||||
@@ -37,14 +40,4 @@ public class AutoSchedulesController {
|
||||
public void fetchMonthlyCarryOver() {
|
||||
portIn.monthlyCarryOver();
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO 스케쥴 있다면.. 추가.
|
||||
*/
|
||||
|
||||
// 매일 오후 5시 마다 실행되는 스케줄러
|
||||
@Scheduled(cron = "0 1 * * * ?")
|
||||
public void fetchSmsAutoSenTest() {
|
||||
portIn.sendAutoSmsTest();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,5 +7,4 @@ public interface AutoSchedulesPortIn {
|
||||
Optional<Boolean> operate();
|
||||
Optional<Boolean> sendAutoSms();
|
||||
Optional<Boolean> monthlyCarryOver();
|
||||
Optional<Boolean> sendAutoSmsTest();
|
||||
}
|
||||
@@ -1,11 +1,9 @@
|
||||
package app.module.admin.usecase.schedule.autoSchedules.ports;
|
||||
|
||||
import app.module.admin.usecase.schedule.autoSchedules.ports.application.domain.CreateSmsAutoSendCmd;
|
||||
import java.util.Optional;
|
||||
|
||||
public interface AutoSchedulesPortOut {
|
||||
|
||||
Optional<Boolean> operate();
|
||||
Optional<Boolean> sendAutoSms(CreateSmsAutoSendCmd cmd);
|
||||
Optional<Boolean> monthlyCarryOver();
|
||||
}
|
||||
@@ -1,38 +1,42 @@
|
||||
package app.module.admin.usecase.schedule.autoSchedules.ports.application;
|
||||
|
||||
import app.module.admin.config.application.batch.BatchLogRunner;
|
||||
import app.module.admin.config.application.util.DateUiUtil;
|
||||
import app.module.admin.config.application.util.model.DayRange;
|
||||
import app.module.admin.usecase.batchLog.ports.application.domain.BatchLogType;
|
||||
import app.module.admin.usecase.dashboard.getSmsAutoStatus.ports.GetSmsAutoStatusPortIn;
|
||||
import app.module.admin.usecase.dashboard.getSmsAutoStatus.ports.application.domain.GetSmsAutoStatus;
|
||||
import app.module.admin.usecase.schedule.autoSchedules.ports.AutoSchedulesPortIn;
|
||||
import app.module.admin.usecase.schedule.autoSchedules.ports.AutoSchedulesPortOut;
|
||||
import app.module.admin.usecase.schedule.autoSchedules.ports.application.domain.CreateSmsAutoSendCmd;
|
||||
import app.module.admin.usecase.schedule.getIncompleteHouseholds.ports.GetIncompleteHouseholdsPortIn;
|
||||
import app.module.admin.usecase.schedule.getIncompleteHouseholds.ports.application.domain.GetIncompleteHouseholds;
|
||||
import app.module.admin.usecase.schedule.getIncompleteHouseholds.ports.application.domain.GetIncompleteHouseholdsCmd;
|
||||
import app.module.mms.ports.MMSPortIn;
|
||||
import app.module.mms.ports.application.domain.CreateSmsAutoSendCmd;
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
import app.module.mms.ports.MMSPortIn;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Optional;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
class AutoSchedulesService implements AutoSchedulesPortIn {
|
||||
|
||||
private final AutoSchedulesPortOut portOut;
|
||||
private final MMSPortIn mmsPortIn;
|
||||
private final GetSmsAutoStatusPortIn getSmsAutoStatusPortIn;
|
||||
private final GetIncompleteHouseholdsPortIn getIncompleteHouseholdsPortIn;
|
||||
private final BatchLogRunner batchLogRunner;
|
||||
|
||||
@Override
|
||||
public Optional<Boolean> operate() {
|
||||
return portOut.operate();
|
||||
batchLogRunner.run(BatchLogType.MONTHLY_STATUS, portOut::operate);
|
||||
return Optional.of(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -40,63 +44,40 @@ class AutoSchedulesService implements AutoSchedulesPortIn {
|
||||
public Optional<Boolean> sendAutoSms() {
|
||||
GetSmsAutoStatus getSmsAutoStatus = getSmsAutoStatusPortIn.operate().orElse(null);
|
||||
|
||||
// 문자 자동 발송 활성화 상태 체크
|
||||
if (getSmsAutoStatus == null || Boolean.FALSE.equals(getSmsAutoStatus.getActive())) {
|
||||
System.out.println("문자 발송 비활성화 상태");
|
||||
log.info("문자 발송 비활성화 상태");
|
||||
return Optional.of(false);
|
||||
}
|
||||
|
||||
LocalDate today = LocalDate.now();
|
||||
int day = today.getDayOfMonth();
|
||||
|
||||
// 발송일 조건: 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) {
|
||||
log.error("잘못된 날짜({})에 문자 자동 발송 로직이 실행됨 - 발송 대상일이 아님", today);
|
||||
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(targetMonth, dayRange.getFromDay(), dayRange.getToDay())
|
||||
);
|
||||
|
||||
// 미등록 임가가 있을 경우에만 실행
|
||||
if(!CollectionUtils.isEmpty(incompleteHouseholds)) {
|
||||
portOut.sendAutoSms(new CreateSmsAutoSendCmd(
|
||||
incompleteHouseholds,
|
||||
getSmsAutoStatus.getSendPhone(),
|
||||
getSmsAutoStatus.getMessage()
|
||||
));
|
||||
if (!CollectionUtils.isEmpty(incompleteHouseholds)) {
|
||||
batchLogRunner.run(BatchLogType.AUTO_SMS, () -> {
|
||||
mmsPortIn.sendAutoSms(new CreateSmsAutoSendCmd(
|
||||
incompleteHouseholds,
|
||||
getSmsAutoStatus.getSendPhone(),
|
||||
getSmsAutoStatus.getMessage()
|
||||
));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return Optional.of(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional<Boolean> sendAutoSmsTest() {
|
||||
String targetMonth = "202507";
|
||||
DayRange dayRange = new DayRange(1, 7);
|
||||
GetSmsAutoStatus getSmsAutoStatus = new GetSmsAutoStatus(true, "테스트", "01012345678", null, null);
|
||||
|
||||
// dayRange 날짜 범위의 일계부 미등록한 임가 목록 조회
|
||||
List<GetIncompleteHouseholds> incompleteHouseholds = getIncompleteHouseholdsPortIn.operate(
|
||||
new GetIncompleteHouseholdsCmd(targetMonth, dayRange.getFromDay(), dayRange.getToDay())
|
||||
);
|
||||
|
||||
System.out.println(incompleteHouseholds);
|
||||
|
||||
// 미등록 임가가 있을 경우에만 실행
|
||||
if(!CollectionUtils.isEmpty(incompleteHouseholds)) {
|
||||
mmsPortIn.sendAutoSms(new app.module.mms.ports.application.domain.CreateSmsAutoSendCmd(
|
||||
incompleteHouseholds,
|
||||
getSmsAutoStatus.getSendPhone(),
|
||||
getSmsAutoStatus.getMessage()
|
||||
));
|
||||
} else {
|
||||
log.info("문자 발송 날짜 아님.");
|
||||
return Optional.of(false);
|
||||
}
|
||||
|
||||
return Optional.of(true);
|
||||
@@ -104,6 +85,7 @@ class AutoSchedulesService implements AutoSchedulesPortIn {
|
||||
|
||||
@Override
|
||||
public Optional<Boolean> monthlyCarryOver() {
|
||||
return portOut.monthlyCarryOver();
|
||||
batchLogRunner.run(BatchLogType.CARRYOVER, portOut::monthlyCarryOver);
|
||||
return Optional.of(true);
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package app.module.admin.usecase.schedule.autoSchedules.ports.application.domain;
|
||||
|
||||
import app.module.admin.usecase.schedule.getIncompleteHouseholds.ports.application.domain.GetIncompleteHouseholds;
|
||||
import java.util.List;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class CreateSmsAutoSendCmd {
|
||||
private List<GetIncompleteHouseholds> sendHouseholds;
|
||||
private String sendPhone;
|
||||
private String message;
|
||||
}
|
||||
@@ -19,16 +19,13 @@ public class MMSDao implements MMSPortOut {
|
||||
@Transactional
|
||||
public Optional<Boolean> sendAutoSms(CreateSmsAutoSendCmd cmd) {
|
||||
try {
|
||||
log.debug("@@@ sendAutoSmsTest");
|
||||
|
||||
mapper.createSmsAutoSend(cmd);
|
||||
|
||||
return Optional.of(true);
|
||||
} catch (Exception e) {
|
||||
log.info(e.getMessage());
|
||||
log.error(e.getMessage());
|
||||
|
||||
// 예외 발생 시 false 반환
|
||||
return Optional.of(false);
|
||||
throw new RuntimeException("문자 자동 발송 생성 중 오류: " + e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
34
admin/src/main/resources/mappers/batchLog/BatchLogMapper.xml
Normal file
34
admin/src/main/resources/mappers/batchLog/BatchLogMapper.xml
Normal file
@@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="app.module.admin.usecase.batchLog.adapters.persistence.BatchLogMapper">
|
||||
<!-- 실행 중인지 확인 -->
|
||||
<select id="exists" resultType="boolean">
|
||||
SELECT EXISTS (
|
||||
SELECT 1
|
||||
FROM batch_log
|
||||
WHERE type = #{type}
|
||||
AND status = 'RUNNING'
|
||||
AND start_at::date = CURRENT_DATE
|
||||
)
|
||||
</select>
|
||||
|
||||
<!-- 실행 로그 insert -->
|
||||
<insert id="create">
|
||||
<selectKey keyProperty="id" resultType="long" order="BEFORE">
|
||||
SELECT nextval('batch_log_seq')
|
||||
</selectKey>
|
||||
|
||||
INSERT INTO batch_log (id, type, status, start_at, created_at)
|
||||
VALUES (#{id}, #{type}, #{status}, #{startAt}, now())
|
||||
</insert>
|
||||
|
||||
<!-- 상태 업데이트 -->
|
||||
<update id="update">
|
||||
UPDATE batch_log
|
||||
SET status = #{status},
|
||||
error_message = #{errorMessage},
|
||||
end_at = now()
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -32,7 +32,7 @@
|
||||
and a.region_main_code = #{searchArea}
|
||||
</if>
|
||||
<if test="searchAccountDisabled != null and searchAccountDisabled != ''">
|
||||
and a.account_disabled = #{searchAccountDisabled}
|
||||
and a.account_disabled = #{searchAccountDisabled}::boolean
|
||||
</if>
|
||||
group by a.seq
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
and a.region_main_code = #{searchArea}
|
||||
</if>
|
||||
<if test="searchAccountDisabled != null and searchAccountDisabled != ''">
|
||||
and a.account_disabled = #{searchAccountDisabled}
|
||||
and a.account_disabled = #{searchAccountDisabled}::boolean
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
@@ -3,38 +3,11 @@
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper
|
||||
namespace="app.module.admin.usecase.schedule.autoSchedules.adapters.persistence.AutoSchedulesMapper">
|
||||
<select id="createMonthlyInputStatus">
|
||||
<select id="createMonthlyInputStatus" resultType="java.lang.String">
|
||||
select fn_monthly_input_status()
|
||||
</select>
|
||||
|
||||
<insert id="createSmsAutoSend">
|
||||
/* createSmsAutoSend : 문자 발송 insert */
|
||||
INSERT INTO biz_msg
|
||||
(
|
||||
MSG_TYPE,
|
||||
CMID,
|
||||
REQUEST_TIME,
|
||||
SEND_TIME,
|
||||
DEST_PHONE,
|
||||
SEND_PHONE,
|
||||
MSG_BODY
|
||||
)
|
||||
VALUES
|
||||
<foreach collection="sendHouseholds" item="item" separator=",">
|
||||
(
|
||||
5,
|
||||
TO_CHAR(NOW(), 'YYYYMMDDHH24MISS') || '_' || #{item.householdNum},
|
||||
NOW(),
|
||||
NOW(),
|
||||
#{item.phone},
|
||||
#{sendPhone},
|
||||
#{message}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<select id="createMonthlyCarryOver">
|
||||
<select id="createMonthlyCarryOver" resultType="java.lang.String">
|
||||
select fn_monthly_carry_over(null)
|
||||
</select>
|
||||
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -7,7 +7,7 @@
|
||||
<form method="post" name="adminParamForm" onsubmit="goSearch();"
|
||||
th:action="@{/settings/admins}"
|
||||
th:object="${listStatus}">
|
||||
<div th:replace="admin/modal/modal-admin-excel:: modalFragment"></div>
|
||||
|
||||
<!-- hidden parameters -->
|
||||
<input name="page" th:value="${listOutput.pageable.pageNumber}" type="hidden"/>
|
||||
<input name="sort" th:value="${listOutput.pageable.sort}" type="hidden"/>
|
||||
@@ -20,7 +20,7 @@
|
||||
<p class="label-txt">권한</p>
|
||||
</div>
|
||||
<div class="component-select">
|
||||
<select class="select-list" id="searchRole" th:field="*{searchRole}">
|
||||
<select class="select-list" id="searchRole" name="searchRole" th:field="*{searchRole}">
|
||||
<option selected value="">전체</option>
|
||||
<option th:each="role : ${roles}" th:text="${role.description}"
|
||||
th:value="${role.id}"></option>
|
||||
@@ -33,7 +33,7 @@
|
||||
</div>
|
||||
<div class="d-flex">
|
||||
<div class="component-select">
|
||||
<select class="select-list" id="searchField" th:field="*{searchField}">
|
||||
<select class="select-list" id="searchField" name="searchField" th:field="*{searchField}">
|
||||
<option selected value="">전체</option>
|
||||
<option value="id">ID</option>
|
||||
<option value="name">이름</option>
|
||||
@@ -53,7 +53,7 @@
|
||||
<p class="label-txt">실사</p>
|
||||
</div>
|
||||
<div class="component-select">
|
||||
<select class="select-list" id="searchArea" th:field="*{searchArea}">
|
||||
<select class="select-list" id="searchArea" name="searchArea" th:field="*{searchArea}">
|
||||
<option selected value="">전체</option>
|
||||
<option th:each="region : ${regionMainCode}" th:text="${region.codeText}"
|
||||
th:value="${region.id}"></option>
|
||||
@@ -65,7 +65,7 @@
|
||||
<p class="label-txt">계정사용여부</p>
|
||||
</div>
|
||||
<div class="component-select">
|
||||
<select class="select-list" id="searchDisabled" th:field="*{searchDisabled}">
|
||||
<select class="select-list" id="searchDisabled" name="searchDisabled" th:field="*{searchDisabled}">
|
||||
<option selected value="">전체</option>
|
||||
<option value="false">사용</option>
|
||||
<option value="true">미사용</option>
|
||||
@@ -113,7 +113,7 @@
|
||||
type="checkbox"/></label>
|
||||
</td>
|
||||
<td class="underline"><a th:href="|javascript:goUpdate('${item.id}')|" th:text="${item.id}">아이디</a></td>
|
||||
<td th:text="${item.name}">이름</td>
|
||||
<td th:text="${item.name != null && item.name != '' ? item.name : '-'}">이름</td>
|
||||
<td>
|
||||
<span th:each="role, status : ${item.roles}" th:text="${role.getDescription()} + ${!status.last ? ', ': ''}"></span>
|
||||
</td>
|
||||
@@ -128,15 +128,17 @@
|
||||
|
||||
<div class="component-btns bottom-btn-group">
|
||||
<div class="btns-row align-right">
|
||||
<button class="btn" onclick="showAdminExcelUploadModal();" type="button">
|
||||
<button class="btn" onclick="showAdminExcelUploadModal();" type="button" th:unless="${activeProfile != 'local'}">
|
||||
<span class="btn-txt">엑셀 업로드</span>
|
||||
</button>
|
||||
<button class="btn" onclick="goExcel();" type="button"><span class="btn-txt">엑셀 다운로드</span></button>
|
||||
<!-- <button class="btn" onclick="goExcel();" type="button"><span class="btn-txt" th:unless="${activeProfile != 'local'}">엑셀 다운로드</span></button>-->
|
||||
<button class="btn" onclick="location.href='/settings/admins/create';" type="button"><span class="btn-txt">등록</span></button>
|
||||
<button class="btn" onclick="goRemove();" type="button"><span class="btn-txt">삭제</span></button>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div th:replace="admin/modal/modal-admin-excel:: modalFragment"></div>
|
||||
</form>
|
||||
|
||||
</section>
|
||||
@@ -161,6 +163,8 @@
|
||||
f.searchRole.value = '';
|
||||
f.searchArea.value = '';
|
||||
f.searchDisabled.value = '';
|
||||
|
||||
goSearch();
|
||||
}
|
||||
|
||||
function goUpdate(adminId) {
|
||||
@@ -202,20 +206,20 @@
|
||||
}
|
||||
}
|
||||
|
||||
function goExcel() {
|
||||
const f = document.adminParamForm;
|
||||
f.action = '/settings/admins/excel';
|
||||
f.sort.value = convertToPageableSortValue(f.sort.value);
|
||||
f.method = 'post';
|
||||
f.submit();
|
||||
}
|
||||
|
||||
// function goExcel() {
|
||||
// const f = document.adminParamForm;
|
||||
// f.action = '/settings/admins/excel';
|
||||
// f.sort.value = convertToPageableSortValue(f.sort.value);
|
||||
// f.method = 'post';
|
||||
// f.submit();
|
||||
// }
|
||||
|
||||
function showAdminExcelUploadModal() {
|
||||
const modal = document.querySelector(".modal02");
|
||||
modal.ui.open();
|
||||
|
||||
}
|
||||
|
||||
const uploadAdminExcel = () => {
|
||||
event.preventDefault();
|
||||
|
||||
@@ -256,7 +260,6 @@
|
||||
const closeModal = () => {
|
||||
document.querySelector(".modal02").ui.close();
|
||||
};
|
||||
|
||||
</script>
|
||||
</section>
|
||||
|
||||
|
||||
@@ -33,10 +33,10 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<section layout:fragment="script">
|
||||
<script th:inline="javascript">
|
||||
<!-- <section layout:fragment="script">-->
|
||||
<!-- <script th:inline="javascript">-->
|
||||
|
||||
</script>
|
||||
</section>
|
||||
<!-- </script>-->
|
||||
<!-- </section>-->
|
||||
</div>
|
||||
</html>
|
||||
@@ -12,19 +12,43 @@
|
||||
<div th:fragment="pagination(items)">
|
||||
<div class="row">
|
||||
<nav class="component-pagination" aria-label="페이지네이션">
|
||||
<a class="pagination-item prev"
|
||||
|
||||
<!-- 첫 페이지 -->
|
||||
<a class="page-link pagination-item first"
|
||||
th:classappend="${items.pageable.pageNumber == 0} ? 'disabled'"
|
||||
th:href="'javascript:goPageable(0, ' + ${items.pageable.pageSize} + ', \'' + ${items.pageable.sort ?: 'id,desc'} + '\')'">
|
||||
<span class="hide-txt">첫 페이지로 이동</span>
|
||||
</a>
|
||||
|
||||
<!-- 이전 페이지 -->
|
||||
<a class="page-link pagination-item prev"
|
||||
th:classappend="${!items.pageable.hasPrevious} ? 'disabled'"
|
||||
th:href="${items.pageable.hasPrevious} ? 'javascript:goPageable(' + ${items.pageable.pageNumber - 1} + ', ' + ${items.pageable.pageSize} + ', \'' + ${items.pageable.sort ?: 'id,desc'} + '\')' : '#'"></a>
|
||||
th:href="'javascript:goPageable(' + (${items.pageable.pageNumber - 1}) + ', ' + ${items.pageable.pageSize} + ', \'' + ${items.pageable.sort ?: 'id,desc'} + '\')'">
|
||||
<span class="hide-txt">이전 페이지로 이동</span>
|
||||
</a>
|
||||
|
||||
<a class="pagination-item"
|
||||
th:classappend="${idx == items.pageable.pageNumber} ? 'disabled'"
|
||||
<!-- 페이지 목록 -->
|
||||
<a class="page-link pagination-item"
|
||||
th:each="idx : ${#numbers.sequence(0, items.totalPages == 0 ? 0 : items.totalPages - 1)}"
|
||||
th:classappend="${idx == items.pageable.pageNumber} ? 'disabled'"
|
||||
th:href="${idx != items.pageable.pageNumber} ? 'javascript:goPageable(' + ${idx} + ', ' + ${items.pageable.pageSize} + ', \'' + ${items.pageable.sort ?: 'id,desc'} + '\')' : '#'"
|
||||
th:text="${idx + 1}">페이지넘버</a>
|
||||
th:aria-current="${idx == items.pageable.pageNumber} ? 'page'"
|
||||
th:text="${idx + 1}">1</a>
|
||||
|
||||
<a class="pagination-item next"
|
||||
<!-- 다음 페이지 -->
|
||||
<a class="page-link pagination-item next"
|
||||
th:classappend="${items.pageable.pageNumber >= items.totalPages - 1 or items.totalPages == 0} ? 'disabled'"
|
||||
th:href="${items.pageable.pageNumber < items.totalPages - 1 and items.totalPages > 0} ? 'javascript:goPageable(' + ${items.pageable.pageNumber + 1} + ', ' + ${items.pageable.pageSize} + ', \'' + ${items.pageable.sort ?: 'id,desc'} + '\')' : '#'"></a>
|
||||
th:href="${items.pageable.pageNumber < items.totalPages - 1} ? 'javascript:goPageable(' + (${items.pageable.pageNumber + 1}) + ', ' + ${items.pageable.pageSize} + ', \'' + ${items.pageable.sort ?: 'id,desc'} + '\')' : '#'">
|
||||
<span class="hide-txt">다음 페이지로 이동</span>
|
||||
</a>
|
||||
|
||||
<!-- 마지막 페이지 -->
|
||||
<a class="page-link pagination-item last"
|
||||
th:classappend="${items.pageable.pageNumber >= items.totalPages - 1 or items.totalPages == 0} ? 'disabled'"
|
||||
th:href="${items.totalPages > 0 and items.pageable.pageNumber < items.totalPages - 1} ? 'javascript:goPageable(' + (${items.totalPages - 1}) + ', ' + ${items.pageable.pageSize} + ', \'' + ${items.pageable.sort ?: 'id,desc'} + '\')' : '#'">
|
||||
<span class="hide-txt">마지막 페이지로 이동</span>
|
||||
</a>
|
||||
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -29,15 +29,17 @@
|
||||
<tr>
|
||||
<th>첨부파일<i class="ico-required-mark" role="img" aria-label="필수">*</i></th>
|
||||
<td colspan="3">
|
||||
<div class="btns-row align-left publicFileInputs">
|
||||
<button type="button" class="btn btn-secondary" onclick="addFileInput();">
|
||||
<span class="btn-txt">다건 파일 첨부</span>
|
||||
</button>
|
||||
<div class="input-file-group">
|
||||
<label for="file" class="input-file-btn">
|
||||
<input type="file" name="multipartAttachments" id="file" onchange="uiUtil.uploadFile('NOTICE', this);" >
|
||||
<span class="file-txt">파일첨부</span>
|
||||
</label>
|
||||
<p class="desc">첨부 가능 파일 형식: 문서(pdf, docx, xlsx, pptx, hwp), 이미지(jpg, jpeg, png, gif), 기타(zip,
|
||||
csv, txt) / 파일당 최대 5MB까지 등록 가능합니다.</p>
|
||||
<ul class="file-list input-group" id="noticeAttachments">
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -74,8 +76,6 @@
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@@ -164,7 +164,8 @@
|
||||
},
|
||||
// validation fail
|
||||
422: function (res) {
|
||||
alert("error");
|
||||
debugger
|
||||
alert(res.responseJSON[0].defaultMessage);
|
||||
// $(res.responseJSON).each((idx, oj) => {
|
||||
// let target = $(f).find('[name=' + oj.field + ']');
|
||||
// target.addClass('is-invalid');
|
||||
|
||||
@@ -220,7 +220,7 @@
|
||||
},
|
||||
// validation fail
|
||||
422: function (res) {
|
||||
alert('error');
|
||||
alert(res.responseJSON[0].defaultMessage);
|
||||
// $(res.responseJSON).each((idx, oj) => {
|
||||
// let target = $(f).find('[name=' + oj.field + ']');
|
||||
// target.addClass('is-invalid');
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
xmlns:sec="http://www.w3.org/1999/xhtml"
|
||||
xmlns:th="http://www.thymeleaf.org">
|
||||
|
||||
<section layout:fragment="content">
|
||||
<section layout:fragment="content" th:unless="${activeProfile != 'local'}">
|
||||
<div class="d-flex-tit">
|
||||
<hgroup class="page-tit-group">
|
||||
<h2 class="page-tit" id="recordMonthText">
|
||||
@@ -402,10 +402,12 @@
|
||||
null
|
||||
);
|
||||
}
|
||||
const activeProfile = '[[${activeProfile}]]';
|
||||
// 페이지 로드 시 호출
|
||||
$(document).ready(function() {
|
||||
getTotalPercentage();
|
||||
|
||||
if(activeProfile === 'local'){
|
||||
getTotalPercentage();
|
||||
}
|
||||
$('#usageType').change(function() {
|
||||
getTotalPercentage();
|
||||
});
|
||||
|
||||
@@ -137,47 +137,46 @@
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<!-- TODO : 2차 오픈 -->
|
||||
<!-- <div class="input-group">-->
|
||||
<!-- <div class="d-flex">-->
|
||||
<!-- <div class="component-select">-->
|
||||
<!-- <div class="input-label">-->
|
||||
<!-- <p class="label-txt">-->
|
||||
<!-- 당일 1차 방문-->
|
||||
<!-- </p>-->
|
||||
<!-- </div>-->
|
||||
<!-- <select class="select-list" name="isFirstVisited" th:field="*{isFirstVisited}">-->
|
||||
<!-- <option value="">전체</option>-->
|
||||
<!-- <option value="true">방문</option>-->
|
||||
<!-- <option value="false">미방문</option>-->
|
||||
<!-- </select>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div class="component-select">-->
|
||||
<!-- <div class="input-label">-->
|
||||
<!-- <p class="label-txt">-->
|
||||
<!-- 당월 2차 방문-->
|
||||
<!-- </p>-->
|
||||
<!-- </div>-->
|
||||
<!-- <select class="select-list" name="isSecondVisited" th:field="*{isSecondVisited}">-->
|
||||
<!-- <option value="">전체</option>-->
|
||||
<!-- <option value="true">방문</option>-->
|
||||
<!-- <option value="false">미방문</option>-->
|
||||
<!-- </select>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div class="component-select">-->
|
||||
<!-- <div class="input-label">-->
|
||||
<!-- <p class="label-txt">-->
|
||||
<!-- 답례품 방문-->
|
||||
<!-- </p>-->
|
||||
<!-- </div>-->
|
||||
<!-- <select class="select-list" name="isGiftSent" th:field="*{isGiftSent}">-->
|
||||
<!-- <option value="">전체</option>-->
|
||||
<!-- <option value="true">전달</option>-->
|
||||
<!-- <option value="false">미전달</option>-->
|
||||
<!-- </select>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<div class="input-group">
|
||||
<div class="d-flex">
|
||||
<div class="component-select">
|
||||
<div class="input-label">
|
||||
<p class="label-txt">
|
||||
당일 1차 방문
|
||||
</p>
|
||||
</div>
|
||||
<select class="select-list" name="isFirstVisited" th:field="*{isFirstVisited}">
|
||||
<option value="">전체</option>
|
||||
<option value="true">방문</option>
|
||||
<option value="false">미방문</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="component-select">
|
||||
<div class="input-label">
|
||||
<p class="label-txt">
|
||||
당월 2차 방문
|
||||
</p>
|
||||
</div>
|
||||
<select class="select-list" name="isSecondVisited" th:field="*{isSecondVisited}">
|
||||
<option value="">전체</option>
|
||||
<option value="true">방문</option>
|
||||
<option value="false">미방문</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="component-select">
|
||||
<div class="input-label">
|
||||
<p class="label-txt">
|
||||
답례품 방문
|
||||
</p>
|
||||
</div>
|
||||
<select class="select-list" name="isGiftSent" th:field="*{isGiftSent}">
|
||||
<option value="">전체</option>
|
||||
<option value="true">전달</option>
|
||||
<option value="false">미전달</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="input-group">
|
||||
<div class="input-label">
|
||||
@@ -253,10 +252,9 @@
|
||||
<th>업종(대분류)</th>
|
||||
<th>업종(중분류)</th>
|
||||
<th>당월 일계부 현황</th>
|
||||
<!-- TODO : 2차 오픈 -->
|
||||
<!-- <th>당월 1차 임가방문</th>-->
|
||||
<!-- <th>당월 2차 임가방문</th>-->
|
||||
<!-- <th>답례품 전달</th>-->
|
||||
<th>당월 1차 임가방문</th>
|
||||
<th>당월 2차 임가방문</th>
|
||||
<th>답례품 전달</th>
|
||||
<th class="hide-role-researcher">조사원</th>
|
||||
<th class="hide-role-researcher">조사원 휴대전화</th>
|
||||
</tr>
|
||||
@@ -270,12 +268,12 @@
|
||||
<!-- 페이지네이션 -->
|
||||
<div class="row paging"></div>
|
||||
|
||||
<div class="component-btns bottom-btn-group" th:unless="${activeProfile != 'local'}">
|
||||
<div class="component-btns bottom-btn-group">
|
||||
<div class="btns-row align-right">
|
||||
<button type="button" class="btn" onclick="showExcelHouseholdModal();">
|
||||
<button type="button" class="btn" onclick="showExcelHouseholdModal();" th:unless="${activeProfile != 'local'}">
|
||||
<span class="btn-txt">엑셀 업로드 <i class="ico-download ico-small" aria-hidden="true"></i></span>
|
||||
</button>
|
||||
<button type="button" class="btn" onclick="showExcelDownloadModal();">
|
||||
<button type="button" class="btn" onclick="showExcelDownloadModal();" th:unless="${activeProfile != 'local'}">
|
||||
<span class="btn-txt">엑셀 다운로드 <i class="ico-download ico-small" aria-hidden="true"></i></span>
|
||||
</button>
|
||||
<!-- 관리자만 노출 -->
|
||||
@@ -366,6 +364,9 @@
|
||||
<td>${ct.regionDetailName}</td><!-- 세부지역 -->
|
||||
<td>${ifNullHyphen(ct.industryLargeName)}</td><!-- 업종 대분류 -->
|
||||
<td>${ifNullHyphen(ct.industryMiddleName)}</td><!-- 업종 중분류1 -->
|
||||
<td>${ifNullHyphen(ct.firstVisitDate)}</td><!-- 1차방문날짜 -->
|
||||
<td>${ifNullHyphen(ct.secondVisitDate)}</td><!-- 2차방문날짜 -->
|
||||
<td>${ct.isGiftSent ? "전달" : "미전달"}</td> <!-- 답례품 -->
|
||||
<td>${ct.progressPercent}%</td><!-- 임가 진행 상황 -->
|
||||
<td class="hide-role-researcher">${ifNullHyphen(ct.researcherName)}</td> <!-- 조사원이름 -->
|
||||
<td class="hide-role-researcher">${ifNullHyphen(ct.researcherPhone)}</td> <!-- 조사원번호 -->
|
||||
@@ -374,37 +375,10 @@
|
||||
);
|
||||
});
|
||||
|
||||
<!-- TODO : 2차 오픈 -->
|
||||
// `
|
||||
// <tr>
|
||||
// <td>
|
||||
// <div class="component-input">
|
||||
// <label class="checkbox-inner">
|
||||
// <input type="checkbox" id="chkBox_${ct.householdSeq}" name="chkBox" value="${ct.householdSeq}">
|
||||
// </label>
|
||||
// </div>
|
||||
// </td>
|
||||
// <td class="underline"><a href="/households/${ct.householdSeq}?recordMonth=${f.recordMonth.value}">${ct.householdNum}</a></td><!-- 임가번호 -->
|
||||
// <td class="underline"><a href="/households/${ct.householdSeq}?recordMonth=${f.recordMonth.value}">${ct.householdName}</a></td><!-- 경영주 이름 -->
|
||||
// <td>${ct.householdPhone}</td><!-- 경영주 번호 -->
|
||||
// <td>${ct.regionMainName}</td><!-- 실사 -->
|
||||
// <td>${ct.regionSubName}</td><!-- 지역 -->
|
||||
// <td>${ct.regionDetailName}</td><!-- 세부지역 -->
|
||||
// <td>${ifNullHyphen(ct.industryLargeName)}</td><!-- 업종 대분류 -->
|
||||
// <td>${ifNullHyphen(ct.industryMiddleName)}</td><!-- 업종 중분류1 -->
|
||||
// <td>${ct.progressPercent}%</td><!-- 임가 진행 상황 -->
|
||||
// <td>${ifNullHyphen(ct.firstVisitDate)}</td><!-- 1차방문날짜 -->
|
||||
// <td>${ifNullHyphen(ct.secondVisitDate)}</td><!-- 2차방문날짜 -->
|
||||
// <td>${ct.isGiftSent ? "전달" : "미전달"}</td> <!-- 답례품 -->
|
||||
// <td class="hide-role-researcher">${ifNullHyphen(ct.researcherName)}</td> <!-- 조사원이름 -->
|
||||
// <td class="hide-role-researcher">${ifNullHyphen(ct.researcherPhone)}</td> <!-- 조사원번호 -->
|
||||
// </tr>
|
||||
// `
|
||||
|
||||
// 현재 로그인한 유저의 역할
|
||||
const isResearcher = f.userRole.value === 'ROLE_RESEARCHER';
|
||||
// const colspanLength = isResearcher ? 13 : 15; <!-- TODO : 2차 오픈 -->
|
||||
const colspanLength = isResearcher ? 10 : 12;
|
||||
const colspanLength = isResearcher ? 13 : 15;
|
||||
|
||||
// 조사원일 경우 조사원이름, 번호 칼럼 hide
|
||||
$('.hide-role-researcher').toggle(!isResearcher);
|
||||
|
||||
@@ -42,9 +42,11 @@
|
||||
</table>
|
||||
<div class="component-btns bottom-btn-group" th:unless="${activeProfile != 'local'}">
|
||||
<div class="btns-row align-right">
|
||||
<button type="button" class="btn">
|
||||
<span class="btn-txt">정보수정</span>
|
||||
</button>
|
||||
<a th:href="@{'/settings/admins/update/' + ${researcherDto.id}}">
|
||||
<button type="button" class="btn">
|
||||
<span class="btn-txt">정보수정</span>
|
||||
</button>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
@@ -56,7 +58,7 @@
|
||||
<div class="component-tab" data-active="tab1">
|
||||
<div class="tab-head">
|
||||
<button type="button" class="tab-label" data-tab-value="tab1">담당 임가 목록</button>
|
||||
<button type="button" class="tab-label" data-tab-value="tab2" th:unless="${activeProfile != 'local'}">임가방문정보</button>
|
||||
<button type="button" class="tab-label" data-tab-value="tab2">임가방문정보</button>
|
||||
<div class="component-select select-date" id="monthTab2" style="display: none;">
|
||||
<select name="searchMonth" class="select-list search-month-container" onchange="getHouseholdVisitList();">
|
||||
<option th:each="month : ${monthList}"
|
||||
@@ -78,7 +80,7 @@
|
||||
<section class="table-group">
|
||||
<div class="table-tit-group">
|
||||
<h3>총 <strong id="household-totalElements"></strong>건</h3>
|
||||
<div class="component-btns bottom-btn-group" th:unless="${activeProfile != 'local'}">
|
||||
<div class="component-btns bottom-btn-group">
|
||||
<div class="btns-row align-right">
|
||||
<button type="button" class="btn small" th:data-researcher-seq="${researcherDto.seq}" th:data-region-main-code="${researcherDto.regionMainCode}" th:data-researcher-name="${researcherDto.name}" onclick="showHouseholdModal(this)">
|
||||
<span class="btn-txt">임가 매핑</span>
|
||||
@@ -107,7 +109,7 @@
|
||||
<div class="row paging"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-content" data-tab-value="tab2" th:unless="${activeProfile != 'local'}">
|
||||
<div class="tab-content" data-tab-value="tab2">
|
||||
<div class="content-inner">
|
||||
<article class="summary-area">
|
||||
<ul>
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
package app.module.core.config.adapters.persistence.entity;
|
||||
|
||||
import app.module.core.config.adapters.persistence.component.AuditEntity;
|
||||
import app.module.core.config.application.enums.SocialType;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class FrontUserSocial extends AuditEntity {
|
||||
|
||||
private Integer seq;
|
||||
|
||||
private String userId;
|
||||
|
||||
private SocialType socialType;
|
||||
|
||||
private String socialId;
|
||||
|
||||
private String email;
|
||||
|
||||
private String name;
|
||||
|
||||
private String ci;
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
package app.module.core.config.adapters.web.security.domain;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
import lombok.Getter;
|
||||
import org.springframework.security.core.GrantedAuthority;
|
||||
import org.springframework.security.oauth2.core.user.DefaultOAuth2User;
|
||||
|
||||
@Getter
|
||||
public class SocialUser extends DefaultOAuth2User {
|
||||
|
||||
private final String username;
|
||||
private final String password;
|
||||
private final boolean enabled;
|
||||
private final boolean accountNonExpired;
|
||||
private final boolean credentialsNonExpired;
|
||||
private final boolean accountNonLocked;
|
||||
private final String nickname;
|
||||
private final long remainPasswordDays;
|
||||
|
||||
public SocialUser(
|
||||
Collection<? extends GrantedAuthority> authorities,
|
||||
Map<String, Object> attributes,
|
||||
String nameAttributeKey,
|
||||
String username,
|
||||
String password,
|
||||
boolean enabled,
|
||||
boolean accountNonExpired,
|
||||
boolean credentialsNonExpired,
|
||||
boolean accountNonLocked,
|
||||
String nickname,
|
||||
long remainPasswordDays) {
|
||||
super(authorities, attributes, nameAttributeKey);
|
||||
this.username = username;
|
||||
this.password = password;
|
||||
this.enabled = enabled;
|
||||
this.accountNonExpired = accountNonExpired;
|
||||
this.credentialsNonExpired = credentialsNonExpired;
|
||||
this.accountNonLocked = accountNonLocked;
|
||||
this.nickname = nickname;
|
||||
this.remainPasswordDays = remainPasswordDays;
|
||||
}
|
||||
}
|
||||
@@ -6,8 +6,7 @@ import lombok.RequiredArgsConstructor;
|
||||
@Getter
|
||||
@RequiredArgsConstructor
|
||||
public enum SignUpType {
|
||||
NORMAL("일반 회원가입"),
|
||||
SOCIAL("소셜 로그인 회원가입");
|
||||
NORMAL("일반 회원가입");
|
||||
|
||||
private final String desc;
|
||||
}
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
package app.module.core.config.application.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
@Getter
|
||||
@RequiredArgsConstructor
|
||||
public enum SocialType {
|
||||
KAKAO("카카오 로그인", "kakao"),
|
||||
NAVER("네이버 로그인", "naver"),
|
||||
APPLE("애플 로그인", "apple");
|
||||
|
||||
private final String desc;
|
||||
private final String registrationId;
|
||||
}
|
||||
@@ -1,8 +1,13 @@
|
||||
package app.module.core.config.application.util;
|
||||
|
||||
import app.module.core.config.adapters.web.security.domain.SocialUser;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpSession;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.core.context.SecurityContextHolder;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@@ -12,15 +17,6 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.core.GrantedAuthority;
|
||||
import org.springframework.security.core.context.SecurityContextHolder;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
import org.springframework.security.oauth2.core.user.DefaultOAuth2User;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
@Slf4j
|
||||
public class CommonUtil {
|
||||
|
||||
@@ -88,9 +84,6 @@ public class CommonUtil {
|
||||
|
||||
if (principal instanceof UserDetails) {
|
||||
username = ((UserDetails) principal).getUsername();
|
||||
} else if (principal instanceof DefaultOAuth2User) {
|
||||
SocialUser socialUser = (SocialUser) principal;
|
||||
username = socialUser.getUsername();
|
||||
}
|
||||
|
||||
return username;
|
||||
|
||||
@@ -98,7 +98,7 @@ public class ExcelUtil {
|
||||
wb.write(responseOutputStream);
|
||||
wb.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
log.error("[ExcelUtil] generateWithoutPassword: {}", e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ public class CreateCellService implements CreateCellPortIn {
|
||||
// 셀 스타일 적용 (null 체크)
|
||||
if (cellConfig.getCellStyle() != null) {
|
||||
cell.setCellStyle(cellConfig.getCellStyle());
|
||||
} else {
|
||||
//} else {
|
||||
// TODO: cellConfig.getCellStyle()이 null인 경우, 워크북에서 새로운 스타일을 생성하거나 기본 스타일을 적용하는 로직 고려
|
||||
// XSSFWorkbook workbook = (XSSFWorkbook) sheet.getWorkbook();
|
||||
// cell.setCellStyle(workbook.createCellStyle());
|
||||
|
||||
@@ -34,9 +34,9 @@ class URICurrentMatchingService implements URICurrentMatchingPortIn {
|
||||
// {{pathVar}} 을 가진 URI 라면 배열검증 수행
|
||||
if (comparePath.endsWith("/{{pathVar}}")) {
|
||||
List<String> pathComponents =
|
||||
Arrays.stream(comparePath.split("/")).collect(Collectors.toList());
|
||||
Arrays.stream(comparePath.split("/")).toList();
|
||||
List<String> targetComponents =
|
||||
Arrays.stream(targetUri.split("/")).collect(Collectors.toList());
|
||||
Arrays.stream(targetUri.split("/")).toList();
|
||||
|
||||
if (pathComponents.size() != targetComponents.size()) {
|
||||
return false;
|
||||
|
||||
@@ -1,5 +1,68 @@
|
||||
|
||||
-- ====================================================================================================================
|
||||
-- 미사용파일 메뉴 삭제
|
||||
-- ====================================================================================================================
|
||||
delete from uri_has_role where uri_id in (
|
||||
'uri.admin.settings.user.update',
|
||||
'uri.admin.settings.user.privilege',
|
||||
'uri.admin.settings.user.role',
|
||||
'uri.admin.settings.user.group',
|
||||
'uri.admin.settings.user',
|
||||
'uri.admin.settings.admins.group',
|
||||
'uri.admin.settings.adminPrivilege',
|
||||
'uri.admin.settings.adminRoles'
|
||||
);
|
||||
delete from uri where id in (
|
||||
'uri.admin.settings.user.update',
|
||||
'uri.admin.settings.user.privilege'
|
||||
'uri.admin.settings.user.role',
|
||||
'uri.admin.settings.user',
|
||||
'uri.admin.settings.admins.group',
|
||||
'uri.admin.settings.adminPrivilege',
|
||||
'uri.admin.settings.adminRoles'
|
||||
);
|
||||
|
||||
-- front_user
|
||||
DROP TABLE IF EXISTS front_user_has_upload_file;
|
||||
DROP TABLE IF EXISTS front_user_has_role;
|
||||
DROP TABLE IF EXISTS front_user_social;
|
||||
DROP TABLE IF EXISTS front_user;
|
||||
|
||||
DROP SEQUENCE IF EXISTS front_user_seq;
|
||||
DROP SEQUENCE IF EXISTS front_user_has_upload_file_seq;
|
||||
DROP SEQUENCE IF EXISTS front_user_has_role_seq;
|
||||
DROP SEQUENCE IF EXISTS front_user_social_seq ;
|
||||
|
||||
DROP TABLE IF EXISTS input_day_group;
|
||||
DROP TABLE IF EXISTS daily_input_status;
|
||||
DROP TABLE IF EXISTS income_expense_record;
|
||||
DROP TABLE IF EXISTS power_equipment_usage;
|
||||
DROP TABLE IF EXISTS work_input_time;
|
||||
DROP TABLE IF EXISTS work_input;
|
||||
DROP TABLE IF EXISTS forestry_self_consumption;
|
||||
DROP TABLE IF EXISTS agriculture_self_consumption;
|
||||
|
||||
DROP SEQUENCE IF EXISTS input_day_group_seq;
|
||||
DROP SEQUENCE IF EXISTS daily_input_status_seq;
|
||||
DROP SEQUENCE IF EXISTS income_expense_record_seq;
|
||||
DROP SEQUENCE IF EXISTS power_equipment_usage_seq;
|
||||
DROP SEQUENCE IF EXISTS work_input_time_seq;
|
||||
DROP SEQUENCE IF EXISTS work_input_seq;
|
||||
DROP SEQUENCE IF EXISTS forestry_self_consumption_seq;
|
||||
DROP SEQUENCE IF EXISTS agriculture_self_consumption_seq;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
-- ====================================================================================================================
|
||||
-- 메뉴 추가/변경
|
||||
-- ====================================================================================================================
|
||||
-- 입력현황 메뉴 링크
|
||||
update uri set uri = '/status/daily', show_on_navi = true, order_no = 1, updated_at = now(), updated_by = 'INIT_DATA' where id = 'uri.front.status' ;
|
||||
-- 입력현황 상세 등록
|
||||
@@ -19,31 +82,34 @@ VALUES('uri.front.guide', '이용안내', '/guide', 'FRONT', 2, true, 'uri.front
|
||||
update uri set show_on_navi = true, updated_at = now(), updated_by = 'INIT_DATA' where id ='uri.front.info.notice' ;
|
||||
update uri set show_on_navi = true, updated_at = now(), updated_by = 'INIT_DATA' where id = 'uri.front.info.user.password' ;
|
||||
|
||||
-- 임가정보 테이블 -> 칼럼명 update
|
||||
ALTER TABLE household RENAME COLUMN employment_code TO employment_type;
|
||||
|
||||
-- 문자발송 메뉴 삭제
|
||||
DELETE FROM uri_has_role WHERE uri_id = 'uri.admin.communication.sms';
|
||||
DELETE FROM uri WHERE id = 'uri.admin.communication.sms';
|
||||
-- 문자발송 메뉴 숨기기
|
||||
-- update uri set show_on_navi = false, updated_at = now(), updated_by = 'INIT_DATA' where id ='uri.admin.communication.sms' ;
|
||||
|
||||
|
||||
-- ====================================================================================================================
|
||||
-- 미사용파일 메뉴 삭제
|
||||
-- 문자 발송
|
||||
-- ====================================================================================================================
|
||||
delete from uri_has_role where uri_id in (
|
||||
'uri.admin.settings.user.update',
|
||||
'uri.admin.settings.user.privilege',
|
||||
'uri.admin.settings.user.role',
|
||||
'uri.admin.settings.user.group',
|
||||
'uri.admin.settings.user',
|
||||
'uri.admin.settings.admins.group',
|
||||
'uri.admin.settings.adminPrivilege',
|
||||
'uri.admin.settings.adminRoles'
|
||||
CREATE TABLE sms_auto_status (
|
||||
active boolean NOT null,
|
||||
message text,
|
||||
send_phone varchar(255),
|
||||
updated_at timestamp(6),
|
||||
updated_by varchar(255)
|
||||
);
|
||||
delete from uri where id in (
|
||||
'uri.admin.settings.user.update',
|
||||
'uri.admin.settings.user.privilege'
|
||||
'uri.admin.settings.user.role',
|
||||
'uri.admin.settings.user',
|
||||
'uri.admin.settings.admins.group',
|
||||
'uri.admin.settings.adminPrivilege',
|
||||
'uri.admin.settings.adminRoles'
|
||||
);
|
||||
-- ====================================================================================================================
|
||||
|
||||
COMMENT ON TABLE sms_auto_status IS '문자 자동 발송 활성화 테이블';
|
||||
|
||||
COMMENT ON COLUMN sms_auto_status.active IS '자동 발송 기능 ON/OFF 여부';
|
||||
COMMENT ON COLUMN sms_auto_status.message IS '메세지';
|
||||
COMMENT ON COLUMN sms_auto_status.send_phone IS '발송번호';
|
||||
COMMENT ON COLUMN sms_auto_status.updated_at IS '수정일';
|
||||
COMMENT ON COLUMN sms_auto_status.updated_by IS '수정자';
|
||||
|
||||
-- 문자 자동 발송 초기 데이터 등록
|
||||
insert into sms_auto_status (
|
||||
@@ -201,3 +267,328 @@ $function$
|
||||
|
||||
|
||||
|
||||
-- ====================================================================================================================
|
||||
-- 배치 실행 이력 로그
|
||||
-- ====================================================================================================================
|
||||
/*
|
||||
DROP TABLE IF EXISTS batch_log;
|
||||
DROP SEQUENCE IF EXISTS batch_log_seq;
|
||||
*/
|
||||
CREATE SEQUENCE batch_log_seq START WITH 1 INCREMENT BY 1 CACHE 1 NO CYCLE;
|
||||
|
||||
CREATE TABLE batch_log (
|
||||
id int8 DEFAULT nextval('batch_log_seq'::regclass) NOT NULL,
|
||||
type VARCHAR(50) NOT NULL,
|
||||
status VARCHAR(20) NOT NULL,
|
||||
start_at TIMESTAMP NOT NULL,
|
||||
end_at TIMESTAMP,
|
||||
error_message VARCHAR(2000),
|
||||
created_at TIMESTAMP DEFAULT now(),
|
||||
|
||||
CONSTRAINT batch_log_pkey PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
COMMENT ON TABLE batch_log IS '배치 실행 이력 로그 테이블';
|
||||
COMMENT ON COLUMN batch_log.type IS '배치 유형 (AUTO_SMS, MONTHLY_STATUS, CARRYOVER)';
|
||||
COMMENT ON COLUMN batch_log.status IS '상태 (SUCCESS, FAIL, RUNNING)';
|
||||
COMMENT ON COLUMN batch_log.start_at IS '배치 시작 시간';
|
||||
COMMENT ON COLUMN batch_log.end_at IS '배치 종료 시간';
|
||||
COMMENT ON COLUMN batch_log.error_message IS '에러 메시지 (실패한 경우)';
|
||||
COMMENT ON COLUMN batch_log.created_at IS '생성일';
|
||||
|
||||
|
||||
|
||||
|
||||
-- ====================================================================================================================
|
||||
-- 엑셀용 view 생성
|
||||
-- ====================================================================================================================
|
||||
|
||||
-- ============================================
|
||||
-- VIEW : v_household_all
|
||||
-- DESC : 임가 정보 (엑셀용)
|
||||
-- ============================================
|
||||
-- DROP VIEW public.v_household_all;
|
||||
CREATE OR REPLACE VIEW public.v_household_all
|
||||
AS SELECT h.seq,
|
||||
h.household_num,
|
||||
h.owner_name,
|
||||
h.owner_age,
|
||||
h.tel,
|
||||
h.phone,
|
||||
h.region_main_code,
|
||||
fn_uicode_text(h.region_main_code) AS region_main_code_text,
|
||||
h.region_sub_code,
|
||||
fn_uicode_text(h.region_sub_code) AS region_sub_code_text,
|
||||
h.region_detail_code,
|
||||
fn_uicode_text(h.region_detail_code) AS region_detail_code_text,
|
||||
h.address,
|
||||
h.industry_large_code,
|
||||
fn_uicode_text(h.industry_large_code) AS industry_large_code_text,
|
||||
h.industry_middle_code,
|
||||
fn_uicode_text(h.industry_middle_code) AS industry_middle_code_text,
|
||||
h.industry_sub_middle,
|
||||
h.industry_detail,
|
||||
vhr.researcher_name,
|
||||
vhr.researcher_phone,
|
||||
CASE
|
||||
WHEN h.is_panel = true THEN '1.유지'::text
|
||||
ELSE '2.탈락'::text
|
||||
END AS is_panel,
|
||||
h.usage_type
|
||||
FROM household h
|
||||
LEFT JOIN v_household_researcher vhr ON vhr.household_seq = h.seq
|
||||
WHERE h.is_deleted = false
|
||||
ORDER BY h.household_num;
|
||||
|
||||
|
||||
-- ============================================
|
||||
-- VIEW : v_household_all_visit
|
||||
-- DESC : 임가 방문 정보 (엑셀용)
|
||||
-- ============================================
|
||||
-- DROP VIEW public.v_household_all_visit;
|
||||
CREATE OR REPLACE VIEW public.v_household_all_visit
|
||||
AS SELECT vha.seq,
|
||||
vha.household_num,
|
||||
vha.owner_name,
|
||||
vha.owner_age,
|
||||
vha.tel,
|
||||
vha.phone,
|
||||
vha.region_main_code_text,
|
||||
vha.region_sub_code_text,
|
||||
vha.region_detail_code_text,
|
||||
vha.researcher_name,
|
||||
vha.researcher_phone,
|
||||
to_char(hv.visit_date::timestamp with time zone, 'YYYYMM'::text) AS visit_month,
|
||||
hv.visit_date,
|
||||
hv.management_type,
|
||||
hv.content,
|
||||
CASE
|
||||
WHEN hv.updated_by IS NULL THEN hv.created_by
|
||||
ELSE hv.updated_by
|
||||
END AS updated_by,
|
||||
CASE
|
||||
WHEN hv.updated_at IS NULL THEN hv.created_at
|
||||
ELSE hv.updated_at
|
||||
END AS updated_at,
|
||||
hv.created_at,
|
||||
hv.is_gift_sent
|
||||
FROM v_household_all vha
|
||||
JOIN household_visit hv ON hv.household_seq = vha.seq AND hv.is_deleted = false
|
||||
ORDER BY vha.household_num, hv.visit_date;
|
||||
|
||||
|
||||
-- ============================================
|
||||
-- VIEW : v_household_day
|
||||
-- ============================================
|
||||
-- DROP VIEW public.v_household_day;
|
||||
CREATE OR REPLACE VIEW public.v_household_day
|
||||
AS SELECT vha.seq,
|
||||
vha.household_num,
|
||||
vha.owner_name,
|
||||
vha.owner_age,
|
||||
vha.tel,
|
||||
vha.phone,
|
||||
vha.region_main_code_text,
|
||||
vha.region_sub_code_text,
|
||||
vha.region_detail_code_text,
|
||||
vha.researcher_name,
|
||||
vha.researcher_phone,
|
||||
dr.record_month,
|
||||
CASE
|
||||
WHEN ddg.start_day = ddg.end_day THEN concat(ddg.start_day, '')
|
||||
ELSE concat(ddg.start_day, '-', ddg.end_day)
|
||||
END AS input_day,
|
||||
dr.all_status,
|
||||
dr.income_status,
|
||||
( SELECT count(*) AS count
|
||||
FROM daily_income di
|
||||
WHERE di.daily_record_seq = dr.id AND di.is_deleted = false) AS income_count,
|
||||
dr.work_status,
|
||||
( SELECT count(*) AS count
|
||||
FROM daily_work dw
|
||||
WHERE dw.daily_record_seq = dr.id AND dw.is_deleted = false) AS work_count,
|
||||
dr.expense_status,
|
||||
( SELECT count(*) AS count
|
||||
FROM daily_expense de
|
||||
WHERE de.daily_record_seq = dr.id AND de.is_deleted = false) AS expensecount,
|
||||
dr.power_status,
|
||||
( SELECT count(*) AS count
|
||||
FROM daily_power dp
|
||||
WHERE dp.daily_record_seq = dr.id AND dp.is_deleted = false) AS power_count,
|
||||
dr.forestry_status,
|
||||
( SELECT count(*) AS count
|
||||
FROM daily_forestry df
|
||||
WHERE df.daily_record_seq = dr.id AND df.is_deleted = false) AS forestry_count,
|
||||
dr.farming_status,
|
||||
( SELECT count(*) AS count
|
||||
FROM daily_farming df2
|
||||
WHERE df2.daily_record_seq = dr.id AND df2.is_deleted = false) AS farming_count
|
||||
FROM v_household_all vha
|
||||
JOIN daily_record dr ON vha.seq = dr.household_seq AND dr.is_deleted = false
|
||||
LEFT JOIN daily_day_group ddg ON ddg.group_no = dr.day_group_no AND ddg.is_deleted = false
|
||||
ORDER BY vha.household_num, dr.record_month, dr.day_group_no;
|
||||
|
||||
|
||||
-- ============================================
|
||||
-- VIEW : v_household_monthly_completed_days
|
||||
-- ============================================
|
||||
-- DROP VIEW public.v_household_monthly_completed_days;
|
||||
CREATE OR REPLACE VIEW public.v_household_monthly_completed_days
|
||||
AS SELECT daily_record.household_seq,
|
||||
daily_record.record_month,
|
||||
count(*) AS completed_day_groups
|
||||
FROM daily_record
|
||||
WHERE daily_record.is_deleted = false AND (daily_record.all_status::text = ANY (ARRAY['DONE'::character varying, 'TODAY_NONE'::character varying]::text[]))
|
||||
GROUP BY daily_record.household_seq, daily_record.record_month;
|
||||
|
||||
|
||||
-- ============================================
|
||||
-- VIEW : v_household_monthly_target_days
|
||||
-- ============================================
|
||||
-- DROP VIEW public.v_household_monthly_target_days;
|
||||
CREATE OR REPLACE VIEW public.v_household_monthly_target_days
|
||||
AS WITH param_matrix AS (
|
||||
SELECT h.seq AS household_seq,
|
||||
r.record_month,
|
||||
EXTRACT(day FROM date_trunc('month'::text, to_date(r.record_month::text, 'YYYYMM'::text)::timestamp with time zone) + '1 mon -1 days'::interval)::integer AS last_day
|
||||
FROM household h
|
||||
CROSS JOIN ( SELECT DISTINCT daily_record.record_month
|
||||
FROM daily_record
|
||||
WHERE daily_record.is_deleted = false) r
|
||||
)
|
||||
SELECT p.household_seq,
|
||||
p.record_month,
|
||||
count(*) AS total_day_groups
|
||||
FROM param_matrix p
|
||||
JOIN daily_day_group g ON g.start_day <= p.last_day
|
||||
GROUP BY p.household_seq, p.record_month;
|
||||
|
||||
|
||||
-- ============================================
|
||||
-- VIEW : v_household_visit_summary
|
||||
-- ============================================
|
||||
-- DROP VIEW public.v_household_visit_summary;
|
||||
CREATE OR REPLACE VIEW public.v_household_visit_summary
|
||||
AS WITH ranked_visits AS (
|
||||
SELECT household_visit.household_seq,
|
||||
to_char(household_visit.visit_date::timestamp with time zone, 'YYYYMM'::text) AS visit_month,
|
||||
household_visit.visit_date,
|
||||
household_visit.content,
|
||||
household_visit.is_gift_sent,
|
||||
household_visit.management_type,
|
||||
row_number() OVER (PARTITION BY household_visit.household_seq, (to_char(household_visit.visit_date::timestamp with time zone, 'YYYYMM'::text)) ORDER BY household_visit.visit_date, household_visit.id) AS rn
|
||||
FROM household_visit
|
||||
WHERE household_visit.is_deleted = false
|
||||
), pivoted AS (
|
||||
SELECT ranked_visits.household_seq,
|
||||
ranked_visits.visit_month,
|
||||
max(
|
||||
CASE
|
||||
WHEN ranked_visits.rn = 1 THEN ranked_visits.visit_date
|
||||
ELSE NULL::date
|
||||
END) AS first_visit_date,
|
||||
max(
|
||||
CASE
|
||||
WHEN ranked_visits.rn = 1 THEN ranked_visits.content
|
||||
ELSE NULL::character varying
|
||||
END::text) AS first_content,
|
||||
max(
|
||||
CASE
|
||||
WHEN ranked_visits.rn = 1 THEN ranked_visits.is_gift_sent::integer
|
||||
ELSE NULL::integer
|
||||
END) = 1 AS first_is_gift_sent,
|
||||
max(
|
||||
CASE
|
||||
WHEN ranked_visits.rn = 1 THEN ranked_visits.management_type
|
||||
ELSE NULL::character varying
|
||||
END::text) AS first_management_type,
|
||||
max(
|
||||
CASE
|
||||
WHEN ranked_visits.rn = 2 THEN ranked_visits.visit_date
|
||||
ELSE NULL::date
|
||||
END) AS second_visit_date,
|
||||
max(
|
||||
CASE
|
||||
WHEN ranked_visits.rn = 2 THEN ranked_visits.content
|
||||
ELSE NULL::character varying
|
||||
END::text) AS second_content,
|
||||
max(
|
||||
CASE
|
||||
WHEN ranked_visits.rn = 2 THEN ranked_visits.is_gift_sent::integer
|
||||
ELSE NULL::integer
|
||||
END) = 1 AS second_is_gift_sent,
|
||||
max(
|
||||
CASE
|
||||
WHEN ranked_visits.rn = 2 THEN ranked_visits.management_type
|
||||
ELSE NULL::character varying
|
||||
END::text) AS second_management_type
|
||||
FROM ranked_visits
|
||||
WHERE ranked_visits.rn = ANY (ARRAY[1::bigint, 2::bigint])
|
||||
GROUP BY ranked_visits.household_seq, ranked_visits.visit_month
|
||||
), final AS (
|
||||
SELECT pivoted.household_seq,
|
||||
pivoted.visit_month,
|
||||
pivoted.first_visit_date,
|
||||
pivoted.first_content,
|
||||
pivoted.first_is_gift_sent,
|
||||
pivoted.first_management_type,
|
||||
pivoted.second_visit_date,
|
||||
pivoted.second_content,
|
||||
pivoted.second_is_gift_sent,
|
||||
pivoted.second_management_type,
|
||||
pivoted.first_is_gift_sent OR pivoted.second_is_gift_sent AS gift_send
|
||||
FROM pivoted
|
||||
)
|
||||
SELECT final.household_seq,
|
||||
final.visit_month,
|
||||
final.first_visit_date,
|
||||
final.first_content,
|
||||
final.first_is_gift_sent,
|
||||
final.first_management_type,
|
||||
final.second_visit_date,
|
||||
final.second_content,
|
||||
final.second_is_gift_sent,
|
||||
final.second_management_type,
|
||||
final.gift_send
|
||||
FROM final;
|
||||
|
||||
|
||||
-- ============================================
|
||||
-- VIEW : v_monthly_completion_rate
|
||||
-- ============================================
|
||||
-- DROP VIEW public.v_monthly_completion_rate;
|
||||
CREATE OR REPLACE VIEW public.v_monthly_completion_rate
|
||||
AS SELECT d.household_seq,
|
||||
d.record_month,
|
||||
COALESCE(c.completed_day_groups, 0::bigint) AS completed_day_groups,
|
||||
d.total_day_groups,
|
||||
round(COALESCE(c.completed_day_groups, 0::bigint)::numeric * 100::numeric / NULLIF(d.total_day_groups, 0)::numeric, 3) AS completion_rate
|
||||
FROM v_household_monthly_target_days d
|
||||
LEFT JOIN v_household_monthly_completed_days c ON d.household_seq = c.household_seq AND d.record_month::text = c.record_month::text
|
||||
ORDER BY d.household_seq, d.record_month;
|
||||
|
||||
|
||||
-- ============================================
|
||||
-- VIEW : v_researcher_count
|
||||
-- ============================================
|
||||
-- DROP VIEW public.v_researcher_count;
|
||||
CREATE OR REPLACE VIEW public.v_researcher_count
|
||||
AS SELECT a.seq,
|
||||
a.id,
|
||||
count(rhh.id) AS household_count,
|
||||
a.name,
|
||||
a.phone,
|
||||
a.region_main_code,
|
||||
fn_uicode_text(a.region_main_code) AS region_main_code_text,
|
||||
a.account_disabled,
|
||||
CASE a.account_disabled
|
||||
WHEN false THEN '사용'::text
|
||||
WHEN true THEN '미사용'::text
|
||||
ELSE NULL::text
|
||||
END AS account_disabled_flag
|
||||
FROM admin a
|
||||
JOIN admin_has_role ahr ON a.seq = ahr.admin_seq AND ahr.is_deleted = false
|
||||
LEFT JOIN researcher_has_household rhh ON rhh.admin_seq = a.seq AND rhh.is_deleted = false
|
||||
LEFT JOIN household h ON h.seq = rhh.household_seq AND h.is_panel IS TRUE AND h.is_deleted = false
|
||||
WHERE ahr.role_id::text = 'ROLE_RESEARCHER'::text
|
||||
GROUP BY a.seq, a.id, a.name, a.phone, a.account_disabled;
|
||||
@@ -5,7 +5,7 @@ DROP TABLE IF EXISTS logged_in_user;
|
||||
DROP TABLE IF EXISTS persistent_logins;
|
||||
|
||||
DROP TABLE IF EXISTS address;
|
||||
DROP TABLE IF EXISTS input_day_group;
|
||||
|
||||
|
||||
-- 게시판 연관 테이블
|
||||
DROP TABLE IF EXISTS notice_has_upload_file;
|
||||
@@ -37,16 +37,10 @@ DROP SEQUENCE IF EXISTS daily_record_seq;
|
||||
-- household 연관 테이블
|
||||
DROP TABLE IF EXISTS suggestion;
|
||||
DROP TABLE IF EXISTS upload_receipt_files;
|
||||
DROP TABLE IF EXISTS agriculture_self_consumption;
|
||||
DROP TABLE IF EXISTS forestry_self_consumption;
|
||||
DROP TABLE IF EXISTS forest_product_yield;
|
||||
DROP TABLE IF EXISTS forest_product;
|
||||
DROP TABLE IF EXISTS power_equipment_usage;
|
||||
DROP TABLE IF EXISTS work_input_time;
|
||||
DROP TABLE IF EXISTS work_input;
|
||||
DROP TABLE IF EXISTS monthly_carryover;
|
||||
DROP TABLE IF EXISTS income_expense_record;
|
||||
--DROP TABLE IF EXISTS daily_input_status;
|
||||
|
||||
DROP TABLE IF EXISTS bank_auto_transfer;
|
||||
DROP TABLE IF EXISTS monthly_input_status;
|
||||
|
||||
@@ -54,12 +48,6 @@ DROP TABLE IF EXISTS monthly_input_status;
|
||||
DROP TABLE IF EXISTS admin_has_role;
|
||||
DROP TABLE IF EXISTS admin;
|
||||
|
||||
-- front_user
|
||||
DROP TABLE IF EXISTS front_user_has_upload_file;
|
||||
DROP TABLE IF EXISTS front_user_has_role;
|
||||
DROP TABLE IF EXISTS front_user_social;
|
||||
DROP TABLE IF EXISTS front_user;
|
||||
|
||||
-- household
|
||||
DROP TABLE IF EXISTS household_has_role;
|
||||
DROP TABLE IF EXISTS household;
|
||||
@@ -87,7 +75,6 @@ DROP TABLE IF EXISTS upload_file;
|
||||
DROP SEQUENCE IF EXISTS notice_seq;
|
||||
DROP SEQUENCE IF EXISTS suggestion_seq;
|
||||
DROP SEQUENCE IF EXISTS address_seq;
|
||||
DROP SEQUENCE IF EXISTS input_day_group_seq;
|
||||
DROP SEQUENCE IF EXISTS operation_log_seq;
|
||||
|
||||
DROP SEQUENCE IF EXISTS researcher_has_household_seq;
|
||||
@@ -95,17 +82,10 @@ DROP SEQUENCE IF EXISTS researcher_has_area_seq;
|
||||
DROP SEQUENCE IF EXISTS research_area_seq;
|
||||
|
||||
DROP SEQUENCE IF EXISTS upload_receipt_files_seq;
|
||||
DROP SEQUENCE IF EXISTS agriculture_self_consumption_seq;
|
||||
DROP SEQUENCE IF EXISTS forestry_self_consumption_seq;
|
||||
DROP SEQUENCE IF EXISTS forest_product_yield_seq;
|
||||
DROP SEQUENCE IF EXISTS forest_product_seq;
|
||||
DROP SEQUENCE IF EXISTS power_equipment_usage_seq;
|
||||
DROP SEQUENCE IF EXISTS work_input_time_seq;
|
||||
DROP SEQUENCE IF EXISTS work_input_seq;
|
||||
DROP SEQUENCE IF EXISTS monthly_carryover_seq;
|
||||
|
||||
DROP SEQUENCE IF EXISTS income_expense_record_seq;
|
||||
DROP SEQUENCE IF EXISTS daily_input_status_seq;
|
||||
|
||||
DROP SEQUENCE IF EXISTS bank_auto_transfer_seq;
|
||||
DROP SEQUENCE IF EXISTS monthly_input_status_seq;
|
||||
@@ -113,11 +93,6 @@ DROP SEQUENCE IF EXISTS monthly_input_status_seq;
|
||||
DROP SEQUENCE IF EXISTS admin_seq;
|
||||
DROP SEQUENCE IF EXISTS admin_has_role_seq;
|
||||
|
||||
DROP SEQUENCE IF EXISTS front_user_seq;
|
||||
DROP SEQUENCE IF EXISTS front_user_has_upload_file_seq;
|
||||
DROP SEQUENCE IF EXISTS front_user_has_role_seq;
|
||||
DROP SEQUENCE IF EXISTS front_user_social_seq;
|
||||
|
||||
DROP SEQUENCE IF EXISTS household_seq;
|
||||
DROP SEQUENCE IF EXISTS household_has_role_seq;
|
||||
DROP SEQUENCE IF EXISTS household_visit_seq;
|
||||
|
||||
@@ -461,285 +461,6 @@ COMMENT ON COLUMN uri_has_role.deleted_by IS '삭제자';
|
||||
COMMENT ON COLUMN uri_has_role.is_deleted IS '삭제여부';
|
||||
|
||||
|
||||
-- 5. front_user → front_user_has_role, front_user_has_upload_file, front_user_social
|
||||
-- ============================================
|
||||
-- TODO : 추후 삭제 예정
|
||||
-- TABLE : front_user
|
||||
-- DESC : 프론트 사용자 계정 테이블
|
||||
-- ============================================
|
||||
CREATE TABLE front_user (
|
||||
id varchar(255) NOT NULL, -- 사용자 ID (PK)
|
||||
email varchar(255) NOT NULL, -- 이메일
|
||||
password varchar(255), -- 비밀번호
|
||||
nickname varchar(255) NOT NULL, -- 닉네임
|
||||
sign_up_type varchar(255), -- 가입 유형 (NORMAL / SOCIAL)
|
||||
password_updated_at timestamp(6) NOT NULL, -- 비밀번호 수정일시
|
||||
account_disabled boolean, -- 계정 비활성화 여부
|
||||
account_locked boolean, -- 계정 잠김 여부
|
||||
login_fail_cnt integer, -- 로그인 실패 횟수
|
||||
created_at timestamp(6), -- 생성일시
|
||||
created_by varchar(255), -- 생성자
|
||||
updated_at timestamp(6), -- 수정일시
|
||||
updated_by varchar(255), -- 수정자
|
||||
deleted_at timestamp(6), -- 삭제일시
|
||||
deleted_by varchar(255), -- 삭제자
|
||||
is_deleted boolean DEFAULT false NOT NULL, -- 삭제 여부
|
||||
|
||||
CONSTRAINT front_user_pkey PRIMARY KEY (id),
|
||||
CONSTRAINT front_user_sign_up_type_check
|
||||
CHECK (sign_up_type::text = ANY (ARRAY['NORMAL', 'SOCIAL']))
|
||||
);
|
||||
|
||||
COMMENT ON TABLE front_user IS '프론트 사용자 계정 테이블';
|
||||
|
||||
COMMENT ON COLUMN front_user.id IS '사용자 ID (PK)';
|
||||
COMMENT ON COLUMN front_user.email IS '이메일';
|
||||
COMMENT ON COLUMN front_user.password IS '비밀번호';
|
||||
COMMENT ON COLUMN front_user.nickname IS '닉네임';
|
||||
COMMENT ON COLUMN front_user.sign_up_type IS '가입 유형 (NORMAL / SOCIAL)';
|
||||
COMMENT ON COLUMN front_user.password_updated_at IS '비밀번호 수정일시';
|
||||
COMMENT ON COLUMN front_user.account_disabled IS '계정 비활성화 여부';
|
||||
COMMENT ON COLUMN front_user.account_locked IS '계정 잠김 여부';
|
||||
COMMENT ON COLUMN front_user.login_fail_cnt IS '로그인 실패 횟수';
|
||||
COMMENT ON COLUMN front_user.created_at IS '생성일시';
|
||||
COMMENT ON COLUMN front_user.created_by IS '생성자';
|
||||
COMMENT ON COLUMN front_user.updated_at IS '수정일시';
|
||||
COMMENT ON COLUMN front_user.updated_by IS '수정자';
|
||||
COMMENT ON COLUMN front_user.deleted_at IS '삭제일시';
|
||||
COMMENT ON COLUMN front_user.deleted_by IS '삭제자';
|
||||
COMMENT ON COLUMN front_user.is_deleted IS '삭제여부';
|
||||
|
||||
|
||||
-- ============================================
|
||||
-- TODO : 추후 삭제 예정
|
||||
-- TABLE : front_user_has_role
|
||||
-- DESC : 프론트 사용자 역할 매핑 테이블
|
||||
-- ============================================
|
||||
CREATE SEQUENCE front_user_has_role_seq START WITH 1 INCREMENT BY 1 CACHE 1 NO CYCLE;
|
||||
|
||||
CREATE TABLE front_user_has_role (
|
||||
id bigint DEFAULT nextval('front_user_has_role_seq') NOT NULL, -- 매핑 ID (PK)
|
||||
front_user_id varchar(255) NOT NULL, -- 프론트 사용자 ID (FK)
|
||||
role_id varchar(255) NOT NULL, -- 역할 ID (FK)
|
||||
created_at timestamp(6), -- 생성일
|
||||
created_by varchar(255), -- 생성자
|
||||
updated_at timestamp(6), -- 수정일
|
||||
updated_by varchar(255), -- 수정자
|
||||
deleted_at timestamp(6), -- 삭제일
|
||||
deleted_by varchar(255), -- 삭제자
|
||||
is_deleted boolean DEFAULT false NOT NULL, -- 삭제 여부
|
||||
|
||||
CONSTRAINT front_user_has_role_pkey PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
ALTER TABLE front_user_has_role ADD CONSTRAINT fk_front_user_has_role__front_user FOREIGN KEY (front_user_id) REFERENCES front_user(id);
|
||||
ALTER TABLE front_user_has_role ADD CONSTRAINT fk_front_user_has_role__role FOREIGN KEY (role_id) REFERENCES role(id);
|
||||
|
||||
COMMENT ON TABLE front_user_has_role IS '프론트 사용자 역할 매핑 테이블';
|
||||
|
||||
COMMENT ON COLUMN front_user_has_role.id IS '매핑 ID';
|
||||
COMMENT ON COLUMN front_user_has_role.front_user_id IS '프론트 사용자 ID';
|
||||
COMMENT ON COLUMN front_user_has_role.role_id IS '역할 ID';
|
||||
COMMENT ON COLUMN front_user_has_role.created_at IS '생성일';
|
||||
COMMENT ON COLUMN front_user_has_role.created_by IS '생성자';
|
||||
COMMENT ON COLUMN front_user_has_role.updated_at IS '수정일';
|
||||
COMMENT ON COLUMN front_user_has_role.updated_by IS '수정자';
|
||||
COMMENT ON COLUMN front_user_has_role.deleted_at IS '삭제일';
|
||||
COMMENT ON COLUMN front_user_has_role.deleted_by IS '삭제자';
|
||||
COMMENT ON COLUMN front_user_has_role.is_deleted IS '삭제여부';
|
||||
|
||||
|
||||
-- ============================================
|
||||
-- TODO : 추후 삭제 예정
|
||||
-- TABLE : front_user_has_upload_file
|
||||
-- DESC : 프론트 사용자 파일 매핑 테이블
|
||||
-- ============================================
|
||||
CREATE TABLE front_user_has_upload_file (
|
||||
upload_files_id bigint NOT NULL, -- 업로드 파일 ID (FK)
|
||||
front_user_id varchar(255) NOT NULL, -- 프론트 사용자 ID (FK)
|
||||
created_at timestamp(6), -- 생성일
|
||||
created_by varchar(255), -- 생성자
|
||||
updated_at timestamp(6), -- 수정일
|
||||
updated_by varchar(255), -- 수정자
|
||||
deleted_at timestamp(6), -- 삭제일
|
||||
deleted_by varchar(255), -- 삭제자
|
||||
is_deleted boolean DEFAULT false NOT NULL -- 삭제 여부
|
||||
);
|
||||
|
||||
ALTER TABLE front_user_has_upload_file ADD CONSTRAINT fk_front_user_has_upload_file__front_user FOREIGN KEY (front_user_id) REFERENCES front_user(id);
|
||||
ALTER TABLE front_user_has_upload_file ADD CONSTRAINT fk_front_user_has_upload_file__upload_file FOREIGN KEY (upload_files_id) REFERENCES upload_file(id);
|
||||
|
||||
COMMENT ON TABLE front_user_has_upload_file IS '프론트 사용자 파일 매핑 테이블';
|
||||
|
||||
COMMENT ON COLUMN front_user_has_upload_file.upload_files_id IS '업로드 파일 ID';
|
||||
COMMENT ON COLUMN front_user_has_upload_file.front_user_id IS '프론트 사용자 ID';
|
||||
COMMENT ON COLUMN front_user_has_upload_file.created_at IS '생성일';
|
||||
COMMENT ON COLUMN front_user_has_upload_file.created_by IS '생성자';
|
||||
COMMENT ON COLUMN front_user_has_upload_file.updated_at IS '수정일';
|
||||
COMMENT ON COLUMN front_user_has_upload_file.updated_by IS '수정자';
|
||||
COMMENT ON COLUMN front_user_has_upload_file.deleted_at IS '삭제일';
|
||||
COMMENT ON COLUMN front_user_has_upload_file.deleted_by IS '삭제자';
|
||||
COMMENT ON COLUMN front_user_has_upload_file.is_deleted IS '삭제여부';
|
||||
|
||||
|
||||
-- ============================================
|
||||
-- TODO : 추후 삭제 예정
|
||||
-- TABLE : front_user_social
|
||||
-- DESC : 프론트 사용자 소셜 연동 테이블
|
||||
-- ============================================
|
||||
CREATE SEQUENCE front_user_social_seq START WITH 1 INCREMENT BY 1 CACHE 1 NO CYCLE;
|
||||
|
||||
CREATE TABLE front_user_social (
|
||||
seq integer DEFAULT nextval('front_user_social_seq') NOT NULL, -- 일련번호 (PK)
|
||||
user_id varchar(255), -- 사용자 ID
|
||||
name varchar(255), -- 사용자 이름
|
||||
email varchar(255), -- 이메일
|
||||
ci varchar(255), -- CI (연계정보)
|
||||
social_id varchar(255), -- 소셜 사용자 ID
|
||||
social_type varchar(255), -- 소셜 타입 (KAKAO / NAVER / APPLE)
|
||||
created_at timestamp(6), -- 생성일시
|
||||
created_by varchar(255), -- 생성자
|
||||
updated_at timestamp(6), -- 수정일
|
||||
updated_by varchar(255), -- 수정자
|
||||
deleted_at timestamp(6), -- 삭제일
|
||||
deleted_by varchar(255), -- 삭제자
|
||||
is_deleted boolean DEFAULT false NOT NULL, -- 삭제여부
|
||||
|
||||
CONSTRAINT front_user_social_pkey PRIMARY KEY (seq),
|
||||
CONSTRAINT front_user_social_social_type_check
|
||||
CHECK (social_type::text = ANY (ARRAY['KAKAO', 'NAVER', 'APPLE']))
|
||||
);
|
||||
|
||||
COMMENT ON TABLE front_user_social IS '사용자 Social 로그인 정보';
|
||||
|
||||
COMMENT ON COLUMN front_user_social.seq IS '계정 시퀀스';
|
||||
COMMENT ON COLUMN front_user_social.user_id IS '사용자 ID';
|
||||
COMMENT ON COLUMN front_user_social.name IS '소셜 네임';
|
||||
COMMENT ON COLUMN front_user_social.email IS '소셜 이메일';
|
||||
COMMENT ON COLUMN front_user_social.ci IS '소셜 CI';
|
||||
COMMENT ON COLUMN front_user_social.social_id IS '소셜 로그인 provider 별 식별 ID';
|
||||
COMMENT ON COLUMN front_user_social.social_type IS '소셜 타입';
|
||||
COMMENT ON COLUMN front_user_social.created_at IS '생성일';
|
||||
COMMENT ON COLUMN front_user_social.created_by IS '생성자 아이디';
|
||||
COMMENT ON COLUMN front_user_social.updated_at IS '수정일';
|
||||
COMMENT ON COLUMN front_user_social.updated_by IS '수정자 아이디';
|
||||
COMMENT ON COLUMN front_user_social.deleted_at IS '삭제일';
|
||||
COMMENT ON COLUMN front_user_social.deleted_by IS '삭제자 아이디';
|
||||
COMMENT ON COLUMN front_user_social.is_deleted IS '삭제여부';
|
||||
|
||||
|
||||
-- 6. article → article_comment, article_has_upload_file
|
||||
-- ============================================
|
||||
-- TABLE : article
|
||||
-- DESC : 예제게시판 테이블
|
||||
-- ============================================
|
||||
CREATE SEQUENCE article_seq START WITH 1 INCREMENT BY 1 CACHE 1 NO CYCLE;
|
||||
|
||||
CREATE TABLE article (
|
||||
id bigint DEFAULT nextval('article_seq') NOT NULL, -- 게시글 ID (PK)
|
||||
title varchar(255), -- 제목
|
||||
content text, -- 내용
|
||||
visible boolean, -- 노출 여부
|
||||
order_no integer, -- 정렬 순서
|
||||
start_date timestamp(6), -- 게시 시작일
|
||||
end_date timestamp(6), -- 게시 종료일
|
||||
created_at timestamp(6), -- 생성일
|
||||
created_by varchar(255), -- 생성자
|
||||
updated_at timestamp(6), -- 수정일
|
||||
updated_by varchar(255), -- 수정자
|
||||
deleted_at timestamp(6), -- 삭제일
|
||||
deleted_by varchar(255), -- 삭제자
|
||||
is_deleted boolean DEFAULT false NOT NULL, -- 삭제 여부
|
||||
|
||||
CONSTRAINT article_pkey PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
COMMENT ON TABLE article IS '게시글 테이블';
|
||||
|
||||
COMMENT ON COLUMN article.id IS '게시글 ID';
|
||||
COMMENT ON COLUMN article.title IS '제목';
|
||||
COMMENT ON COLUMN article.content IS '내용';
|
||||
COMMENT ON COLUMN article.visible IS '노출 여부';
|
||||
COMMENT ON COLUMN article.order_no IS '정렬 순서';
|
||||
COMMENT ON COLUMN article.start_date IS '게시 시작일';
|
||||
COMMENT ON COLUMN article.end_date IS '게시 종료일';
|
||||
COMMENT ON COLUMN article.created_at IS '생성일시';
|
||||
COMMENT ON COLUMN article.created_by IS '생성자';
|
||||
COMMENT ON COLUMN article.updated_at IS '수정일시';
|
||||
COMMENT ON COLUMN article.updated_by IS '수정자';
|
||||
COMMENT ON COLUMN article.deleted_at IS '삭제일시';
|
||||
COMMENT ON COLUMN article.deleted_by IS '삭제자';
|
||||
COMMENT ON COLUMN article.is_deleted IS '삭제여부';
|
||||
|
||||
|
||||
-- ============================================
|
||||
-- TABLE : article_comment
|
||||
-- DESC : 예제게시판 댓글 테이블
|
||||
-- ============================================
|
||||
CREATE SEQUENCE article_comment_seq START WITH 1 INCREMENT BY 1 CACHE 1 NO CYCLE;
|
||||
|
||||
CREATE TABLE article_comment (
|
||||
id bigint DEFAULT nextval('article_comment_seq') NOT NULL, -- 댓글 ID (PK)
|
||||
article_id bigint NOT NULL, -- 게시글 ID (FK)
|
||||
content text, -- 댓글 내용
|
||||
created_at timestamp(6), -- 생성일
|
||||
created_by varchar(255), -- 생성자
|
||||
updated_at timestamp(6), -- 수정일
|
||||
updated_by varchar(255), -- 수정자
|
||||
deleted_at timestamp(6), -- 삭제일
|
||||
deleted_by varchar(255), -- 삭제자
|
||||
is_deleted boolean DEFAULT false NOT NULL, -- 삭제 여부
|
||||
|
||||
CONSTRAINT article_comment_pkey PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
ALTER TABLE article_comment ADD CONSTRAINT fk_article_comment__article FOREIGN KEY (article_id) REFERENCES article(id);
|
||||
|
||||
COMMENT ON TABLE article_comment IS '게시글 댓글 테이블';
|
||||
|
||||
COMMENT ON COLUMN article_comment.id IS '댓글 ID';
|
||||
COMMENT ON COLUMN article_comment.article_id IS '게시글 ID';
|
||||
COMMENT ON COLUMN article_comment.content IS '댓글 내용';
|
||||
COMMENT ON COLUMN article_comment.created_at IS '생성일';
|
||||
COMMENT ON COLUMN article_comment.created_by IS '생성자';
|
||||
COMMENT ON COLUMN article_comment.updated_at IS '수정일';
|
||||
COMMENT ON COLUMN article_comment.updated_by IS '수정자';
|
||||
COMMENT ON COLUMN article_comment.deleted_at IS '삭제일';
|
||||
COMMENT ON COLUMN article_comment.deleted_by IS '삭제자';
|
||||
COMMENT ON COLUMN article_comment.is_deleted IS '삭제여부';
|
||||
|
||||
|
||||
-- ============================================
|
||||
-- TABLE : article_has_upload_file
|
||||
-- DESC : 예제게시판 파일 매핑 테이블
|
||||
-- ============================================
|
||||
CREATE TABLE article_has_upload_file (
|
||||
article_id bigint NOT NULL, -- 게시글 ID (FK)
|
||||
upload_files_id bigint NOT NULL, -- 업로드 파일 ID (FK)
|
||||
created_at timestamp(6), -- 생성일
|
||||
created_by varchar(255), -- 생성자
|
||||
updated_at timestamp(6), -- 수정일
|
||||
updated_by varchar(255), -- 수정자
|
||||
deleted_at timestamp(6), -- 삭제일
|
||||
deleted_by varchar(255), -- 삭제자
|
||||
is_deleted boolean DEFAULT false NOT NULL -- 삭제 여부
|
||||
);
|
||||
|
||||
ALTER TABLE article_has_upload_file ADD CONSTRAINT fk_article_has_upload_file__upload_file FOREIGN KEY (upload_files_id) REFERENCES upload_file(id);
|
||||
ALTER TABLE article_has_upload_file ADD CONSTRAINT fk_article_has_upload_file__article FOREIGN KEY (article_id) REFERENCES article(id);
|
||||
|
||||
COMMENT ON TABLE article_has_upload_file IS '게시글 파일 매핑 테이블';
|
||||
|
||||
COMMENT ON COLUMN article_has_upload_file.article_id IS '게시글 ID';
|
||||
COMMENT ON COLUMN article_has_upload_file.upload_files_id IS '업로드 파일 ID';
|
||||
COMMENT ON COLUMN article_has_upload_file.created_at IS '생성일';
|
||||
COMMENT ON COLUMN article_has_upload_file.created_by IS '생성자';
|
||||
COMMENT ON COLUMN article_has_upload_file.updated_at IS '수정일';
|
||||
COMMENT ON COLUMN article_has_upload_file.updated_by IS '수정자';
|
||||
COMMENT ON COLUMN article_has_upload_file.deleted_at IS '삭제일';
|
||||
COMMENT ON COLUMN article_has_upload_file.deleted_by IS '삭제자';
|
||||
COMMENT ON COLUMN article_has_upload_file.is_deleted IS '삭제여부';
|
||||
|
||||
|
||||
-- 7. uicode (독립 테이블)
|
||||
-- ============================================
|
||||
@@ -1061,40 +782,6 @@ COMMENT ON COLUMN household_visit.is_deleted IS '삭제여부';
|
||||
|
||||
-- 임가 일계부 입력 관련 테이블 시작
|
||||
|
||||
-- 1. input_day_group
|
||||
-- ============================================
|
||||
-- TABLE : input_day_group
|
||||
-- DESC : 일계부 작성일자 그룹 테이블
|
||||
-- ============================================
|
||||
CREATE TABLE input_day_group (
|
||||
group_no smallint NOT NULL, -- 그룹번호
|
||||
start_day smallint, -- 시작일자
|
||||
end_day smallint, -- 종료일자
|
||||
created_at timestamp(6), -- 생성일
|
||||
created_by varchar(255), -- 생성자
|
||||
updated_at timestamp(6), -- 수정일
|
||||
updated_by varchar(255), -- 수정자
|
||||
deleted_at timestamp(6), -- 삭제일
|
||||
deleted_by varchar(255), -- 삭제자
|
||||
is_deleted boolean DEFAULT false, -- 삭제여부
|
||||
|
||||
CONSTRAINT input_day_group_pkey PRIMARY KEY (group_no)
|
||||
);
|
||||
|
||||
COMMENT ON TABLE input_day_group IS '일계부 작성일자 그룹 테이블';
|
||||
|
||||
COMMENT ON COLUMN input_day_group.group_no IS '그룹번호';
|
||||
COMMENT ON COLUMN input_day_group.start_day IS '시작일자';
|
||||
COMMENT ON COLUMN input_day_group.end_day IS '종료일자';
|
||||
COMMENT ON COLUMN input_day_group.created_at IS '생성일';
|
||||
COMMENT ON COLUMN input_day_group.created_by IS '생성자';
|
||||
COMMENT ON COLUMN input_day_group.updated_at IS '수정일';
|
||||
COMMENT ON COLUMN input_day_group.updated_by IS '수정자';
|
||||
COMMENT ON COLUMN input_day_group.deleted_at IS '삭제일';
|
||||
COMMENT ON COLUMN input_day_group.deleted_by IS '삭제자';
|
||||
COMMENT ON COLUMN input_day_group.is_deleted IS '삭제여부';
|
||||
|
||||
|
||||
-- 2. monthly_input_status
|
||||
-- ============================================
|
||||
-- TABLE : monthly_input_status
|
||||
@@ -1143,60 +830,6 @@ COMMENT ON COLUMN monthly_input_status.deleted_by IS '삭제자';
|
||||
COMMENT ON COLUMN monthly_input_status.is_deleted IS '삭제여부';
|
||||
|
||||
|
||||
-- 3. daily_input_status
|
||||
-- ============================================
|
||||
-- TABLE : daily_input_status
|
||||
-- DESC : 일계부 일별 작성상태
|
||||
-- ============================================
|
||||
/*
|
||||
CREATE SEQUENCE daily_input_status_seq START WITH 1 INCREMENT BY 1 CACHE 1 NO CYCLE;
|
||||
|
||||
CREATE TABLE daily_input_status (
|
||||
id bigint DEFAULT nextval('daily_input_status_seq') NOT NULL, -- 일계부 작성상태 ID
|
||||
household_seq bigint NOT NULL, -- 임가 일련번호 (FK)
|
||||
month varchar(7) NOT NULL, -- 조사시행 월 (yyyy-mm)
|
||||
start_date date, -- 작성시작일(yyyy-mm-dd)
|
||||
end_date date, -- 작성종료일(yyyy-mm-dd)
|
||||
all_status varchar(15), -- 전체 입력상태
|
||||
income_status varchar(15), -- 수입 입력상태
|
||||
work_input_status varchar(15), -- 임업노동 투입내역 입력상태
|
||||
expense_status varchar(15), -- 지출 입력상태
|
||||
power_status varchar(15), -- 동력사용시간 입력상태
|
||||
forestry_status varchar(15), -- 자가임업 생산물 중 자가소비량 입력상태
|
||||
created_at timestamp(6), -- 생성일
|
||||
created_by varchar(255), -- 생성자
|
||||
updated_at timestamp(6), -- 수정일
|
||||
updated_by varchar(255), -- 수정자
|
||||
deleted_at timestamp(6), -- 삭제일
|
||||
deleted_by varchar(255), -- 삭제자
|
||||
is_deleted boolean DEFAULT false, -- 삭제여부
|
||||
|
||||
CONSTRAINT daily_input_status_pkey PRIMARY KEY (id),
|
||||
CONSTRAINT fk_daily_input_status__household FOREIGN KEY (household_seq) REFERENCES household(seq)
|
||||
);
|
||||
|
||||
COMMENT ON TABLE daily_input_status IS '일계부 일별 작성상태';
|
||||
|
||||
COMMENT ON COLUMN daily_input_status.id IS '일계부 작성상태 ID';
|
||||
COMMENT ON COLUMN daily_input_status.household_seq IS '임가 일련번호';
|
||||
COMMENT ON COLUMN daily_input_status.month IS '조사시행 월 (yyyy-mm)';
|
||||
COMMENT ON COLUMN daily_input_status.start_date IS '작성시작일(yyyy-mm-dd)';
|
||||
COMMENT ON COLUMN daily_input_status.end_date IS '작성종료일(yyyy-mm-dd)';
|
||||
COMMENT ON COLUMN daily_input_status.all_status IS '전체 입력상태';
|
||||
COMMENT ON COLUMN daily_input_status.income_status IS '수입 입력상태';
|
||||
COMMENT ON COLUMN daily_input_status.work_input_status IS '임업노동 투입내역 입력상태';
|
||||
COMMENT ON COLUMN daily_input_status.expense_status IS '지출 입력상태';
|
||||
COMMENT ON COLUMN daily_input_status.power_status IS '동력사용시간 입력상태';
|
||||
COMMENT ON COLUMN daily_input_status.forestry_status IS '자가임업 생산물 중 자가소비량 입력상태';
|
||||
COMMENT ON COLUMN daily_input_status.created_at IS '생성일';
|
||||
COMMENT ON COLUMN daily_input_status.created_by IS '생성자';
|
||||
COMMENT ON COLUMN daily_input_status.updated_at IS '수정일';
|
||||
COMMENT ON COLUMN daily_input_status.updated_by IS '수정자';
|
||||
COMMENT ON COLUMN daily_input_status.deleted_at IS '삭제일';
|
||||
COMMENT ON COLUMN daily_input_status.deleted_by IS '삭제자';
|
||||
COMMENT ON COLUMN daily_input_status.is_deleted IS '삭제여부';
|
||||
*/
|
||||
|
||||
|
||||
-- 4. forest_product → forest_product_yield
|
||||
-- ============================================
|
||||
@@ -1424,310 +1057,6 @@ COMMENT ON COLUMN monthly_carryover.deleted_by IS '삭제자';
|
||||
COMMENT ON COLUMN monthly_carryover.is_deleted IS '삭제여부';
|
||||
|
||||
|
||||
-- 7. income_expense_record
|
||||
-- ============================================
|
||||
-- TABLE : income_expense_record
|
||||
-- DESC : 수입/지출 테이블
|
||||
-- ============================================
|
||||
CREATE SEQUENCE income_expense_record_seq START WITH 1 INCREMENT BY 1 CACHE 1 NO CYCLE;
|
||||
|
||||
CREATE TABLE income_expense_record (
|
||||
id bigint DEFAULT nextval('income_expense_record_seq') NOT NULL, -- 수입/지출 ID
|
||||
household_seq bigint NOT NULL, -- 임가정보 일련번호 (FK)
|
||||
record_type varchar(7) NOT NULL, -- 수입/지출 유형 (enum)
|
||||
record_code varchar(255), -- 수입/지출 코드 (매핑코드)
|
||||
crop_code varchar(255), -- 재배형태 코드 (매핑코드)
|
||||
record_category varchar(30) NOT NULL, -- 수입/지출 종류
|
||||
source_purpose varchar(10), -- 수입원(용도)
|
||||
quantity decimal(6,2) NOT NULL, -- 수량
|
||||
unit_code varchar(10) NOT NULL, -- 단위 (매핑코드)
|
||||
price integer NOT NULL, -- 현금(원)
|
||||
estimated_value integer NOT NULL, -- 현물(평가액)
|
||||
month varchar(7) NOT NULL, -- 조사시행 월 (yyyy-mm)
|
||||
day_group_no smallint, -- 일계부 작성일자 그룹 번호
|
||||
created_at timestamp(6), -- 생성일
|
||||
created_by varchar(255), -- 생성자
|
||||
updated_at timestamp(6), -- 수정일
|
||||
updated_by varchar(255), -- 수정자
|
||||
deleted_at timestamp(6), -- 삭제일
|
||||
deleted_by varchar(255), -- 삭제자
|
||||
is_deleted boolean DEFAULT false, -- 삭제여부
|
||||
|
||||
CONSTRAINT income_expense_record_pkey PRIMARY KEY (id),
|
||||
CONSTRAINT fk_income_expense_record__household FOREIGN KEY (household_seq) REFERENCES household(seq)
|
||||
-- CONSTRAINT chk_income_expense_record__type CHECK (record_type IN ('INCOME', 'EXPENSE')) -- 필요 시 사용
|
||||
);
|
||||
|
||||
COMMENT ON TABLE income_expense_record IS '수입/지출';
|
||||
|
||||
COMMENT ON COLUMN income_expense_record.id IS '수입/지출 ID';
|
||||
COMMENT ON COLUMN income_expense_record.household_seq IS '임가정보 일련번호';
|
||||
COMMENT ON COLUMN income_expense_record.record_type IS '수입/지출 유형 (enum)';
|
||||
COMMENT ON COLUMN income_expense_record.record_code IS '수입/지출 코드 (매핑코드)';
|
||||
COMMENT ON COLUMN income_expense_record.crop_code IS '재배형태 코드 (매핑코드)';
|
||||
COMMENT ON COLUMN income_expense_record.record_category IS '수입/지출 종류';
|
||||
COMMENT ON COLUMN income_expense_record.source_purpose IS '수입원(용도)';
|
||||
COMMENT ON COLUMN income_expense_record.quantity IS '수량';
|
||||
COMMENT ON COLUMN income_expense_record.unit_code IS '단위 (매핑코드)';
|
||||
COMMENT ON COLUMN income_expense_record.price IS '현금(원)';
|
||||
COMMENT ON COLUMN income_expense_record.estimated_value IS '현물(평가액)';
|
||||
COMMENT ON COLUMN income_expense_record.month IS '조사시행 월 (yyyy-mm)';
|
||||
COMMENT ON COLUMN income_expense_record.day_group_no IS '일계부 작성일자 그룹 번호';
|
||||
COMMENT ON COLUMN income_expense_record.created_at IS '생성일';
|
||||
COMMENT ON COLUMN income_expense_record.created_by IS '생성자';
|
||||
COMMENT ON COLUMN income_expense_record.updated_at IS '수정일';
|
||||
COMMENT ON COLUMN income_expense_record.updated_by IS '수정자';
|
||||
COMMENT ON COLUMN income_expense_record.deleted_at IS '삭제일';
|
||||
COMMENT ON COLUMN income_expense_record.deleted_by IS '삭제자';
|
||||
COMMENT ON COLUMN income_expense_record.is_deleted IS '삭제여부';
|
||||
|
||||
|
||||
-- 8. power_equipment_usage
|
||||
-- ============================================
|
||||
-- TABLE : power_equipment_usage
|
||||
-- DESC : 동력 사용 시간
|
||||
-- ============================================
|
||||
CREATE SEQUENCE power_equipment_usage_seq START WITH 1 INCREMENT BY 1 CACHE 1 NO CYCLE;
|
||||
|
||||
CREATE TABLE power_equipment_usage (
|
||||
id bigint DEFAULT nextval('power_equipment_usage_seq') NOT NULL, -- 동력사용시간 ID
|
||||
household_seq bigint NOT NULL, -- 임가 일련번호 (FK)
|
||||
equipment_name varchar(15), -- 명칭
|
||||
equipment_code varchar(255), -- 명칭 부호 (매핑코드)
|
||||
owned_hours decimal(5,2), -- 자가 시간
|
||||
leased_hours decimal(5,2), -- 임차 시간
|
||||
month varchar(7) NOT NULL, -- 조사시행 월 (yyyy-mm)
|
||||
day_group_no smallint, -- 일계부 작성일자 그룹 번호
|
||||
created_at timestamp(6), -- 생성일
|
||||
created_by varchar(255), -- 생성자
|
||||
updated_at timestamp(6), -- 수정일
|
||||
updated_by varchar(255), -- 수정자
|
||||
deleted_at timestamp(6), -- 삭제일
|
||||
deleted_by varchar(255), -- 삭제자
|
||||
is_deleted boolean DEFAULT false, -- 삭제여부
|
||||
|
||||
CONSTRAINT power_equipment_usage_pkey PRIMARY KEY (id),
|
||||
CONSTRAINT fk_power_equipment_usage__household FOREIGN KEY (household_seq) REFERENCES household(seq)
|
||||
);
|
||||
|
||||
COMMENT ON TABLE power_equipment_usage IS '동력 사용 시간';
|
||||
|
||||
COMMENT ON COLUMN power_equipment_usage.id IS '동력사용시간 ID';
|
||||
COMMENT ON COLUMN power_equipment_usage.household_seq IS '임가 일련번호';
|
||||
COMMENT ON COLUMN power_equipment_usage.equipment_name IS '명칭';
|
||||
COMMENT ON COLUMN power_equipment_usage.equipment_code IS '명칭 부호 (매핑코드)';
|
||||
COMMENT ON COLUMN power_equipment_usage.owned_hours IS '자가 시간';
|
||||
COMMENT ON COLUMN power_equipment_usage.leased_hours IS '임차 시간';
|
||||
COMMENT ON COLUMN power_equipment_usage.month IS '조사시행 월 (yyyy-mm)';
|
||||
COMMENT ON COLUMN power_equipment_usage.day_group_no IS '일계부 작성일자 그룹 번호';
|
||||
COMMENT ON COLUMN power_equipment_usage.created_at IS '생성일';
|
||||
COMMENT ON COLUMN power_equipment_usage.created_by IS '생성자';
|
||||
COMMENT ON COLUMN power_equipment_usage.updated_at IS '수정일';
|
||||
COMMENT ON COLUMN power_equipment_usage.updated_by IS '수정자';
|
||||
COMMENT ON COLUMN power_equipment_usage.deleted_at IS '삭제일';
|
||||
COMMENT ON COLUMN power_equipment_usage.deleted_by IS '삭제자';
|
||||
COMMENT ON COLUMN power_equipment_usage.is_deleted IS '삭제여부';
|
||||
|
||||
|
||||
-- 9. work_input → work_input_time
|
||||
-- ============================================
|
||||
-- TABLE : work_input
|
||||
-- DESC : 임업노동 투입내역
|
||||
-- ============================================
|
||||
CREATE SEQUENCE work_input_seq START WITH 1 INCREMENT BY 1 CACHE 1 NO CYCLE;
|
||||
|
||||
CREATE TABLE work_input (
|
||||
id bigint DEFAULT nextval('work_input_seq') NOT NULL,
|
||||
household_seq bigint NOT NULL,
|
||||
item_name varchar(15) NOT NULL,
|
||||
item_code varchar(255),
|
||||
work_name varchar(30) NOT NULL,
|
||||
work_code varchar(255),
|
||||
work_land_area int,
|
||||
harvest_quantity decimal(7,2),
|
||||
unit_code varchar(10),
|
||||
month varchar(7) NOT NULL,
|
||||
day_group_no smallint,
|
||||
created_at timestamp(6),
|
||||
created_by varchar(255),
|
||||
updated_at timestamp(6),
|
||||
updated_by varchar(255),
|
||||
deleted_at timestamp(6),
|
||||
deleted_by varchar(255),
|
||||
is_deleted boolean NOT NULL DEFAULT false,
|
||||
|
||||
CONSTRAINT work_input_pkey PRIMARY KEY (id),
|
||||
CONSTRAINT fk_work_input__household FOREIGN KEY (household_seq) REFERENCES household(seq)
|
||||
);
|
||||
|
||||
COMMENT ON TABLE work_input IS '임업노동 투입내역';
|
||||
COMMENT ON COLUMN work_input.id IS '투입내역 내부키';
|
||||
COMMENT ON COLUMN work_input.household_seq IS '임가정보내부키';
|
||||
COMMENT ON COLUMN work_input.item_name IS '품목명';
|
||||
COMMENT ON COLUMN work_input.item_code IS '품목부호 (매핑코드)';
|
||||
COMMENT ON COLUMN work_input.work_name IS '작업명';
|
||||
COMMENT ON COLUMN work_input.work_code IS '작업부호 (매핑코드)';
|
||||
COMMENT ON COLUMN work_input.work_land_area IS '작업면적';
|
||||
COMMENT ON COLUMN work_input.harvest_quantity IS '수확량';
|
||||
COMMENT ON COLUMN work_input.unit_code IS '단위 (코드매핑)';
|
||||
COMMENT ON COLUMN work_input.month IS '조사시행 월 (yyyy-mm)';
|
||||
COMMENT ON COLUMN work_input.day_group_no IS '일계부 작성일자 그룹 번호';
|
||||
COMMENT ON COLUMN work_input.created_at IS '생성일';
|
||||
COMMENT ON COLUMN work_input.created_by IS '생성자';
|
||||
COMMENT ON COLUMN work_input.updated_at IS '수정일';
|
||||
COMMENT ON COLUMN work_input.updated_by IS '수정자';
|
||||
COMMENT ON COLUMN work_input.deleted_at IS '삭제일';
|
||||
COMMENT ON COLUMN work_input.deleted_by IS '삭제자';
|
||||
COMMENT ON COLUMN work_input.is_deleted IS '삭제여부';
|
||||
|
||||
|
||||
-- ============================================
|
||||
-- TABLE : work_input_time
|
||||
-- DESC : 임업노동 노동투입시간
|
||||
-- ============================================
|
||||
CREATE SEQUENCE work_input_time_seq START WITH 1 INCREMENT BY 1 CACHE 1 NO CYCLE;
|
||||
|
||||
CREATE TABLE work_input_time (
|
||||
id bigint DEFAULT nextval('work_input_time_seq') NOT NULL,
|
||||
work_input_id bigint NOT NULL,
|
||||
labor_type varchar(10),
|
||||
gender_code smallint,
|
||||
hours decimal(5,2),
|
||||
created_at timestamp(6),
|
||||
created_by varchar(255),
|
||||
updated_at timestamp(6),
|
||||
updated_by varchar(255),
|
||||
deleted_at timestamp(6),
|
||||
deleted_by varchar(255),
|
||||
is_deleted boolean NOT NULL DEFAULT false,
|
||||
|
||||
CONSTRAINT work_input_time_pkey PRIMARY KEY (id),
|
||||
CONSTRAINT fk_work_input_time__work_input FOREIGN KEY (work_input_id) REFERENCES work_input(id)
|
||||
);
|
||||
|
||||
COMMENT ON TABLE work_input_time IS '임업노동 노동투입시간';
|
||||
COMMENT ON COLUMN work_input_time.id IS '노동투입시간 내부키';
|
||||
COMMENT ON COLUMN work_input_time.work_input_id IS '투입내역 내부키';
|
||||
COMMENT ON COLUMN work_input_time.labor_type IS '노동유형(OWNER, SPOUSE, FAMILY, HIRED, SHARED, VOLUNTEER)';
|
||||
COMMENT ON COLUMN work_input_time.gender_code IS '성별 코드 (매핑코드)';
|
||||
COMMENT ON COLUMN work_input_time.hours IS '투입 시간';
|
||||
COMMENT ON COLUMN work_input_time.created_at IS '생성일';
|
||||
COMMENT ON COLUMN work_input_time.created_by IS '생성자';
|
||||
COMMENT ON COLUMN work_input_time.updated_at IS '수정일';
|
||||
COMMENT ON COLUMN work_input_time.updated_by IS '수정자';
|
||||
COMMENT ON COLUMN work_input_time.deleted_at IS '삭제일';
|
||||
COMMENT ON COLUMN work_input_time.deleted_by IS '삭제자';
|
||||
COMMENT ON COLUMN work_input_time.is_deleted IS '삭제여부';
|
||||
|
||||
|
||||
-- 10. forestry_self_consumption
|
||||
-- ============================================
|
||||
-- TABLE : forestry_self_consumption
|
||||
-- DESC : 자가임업 생산물 중 자가소비량
|
||||
-- ============================================
|
||||
CREATE SEQUENCE forestry_self_consumption_seq START WITH 1 INCREMENT BY 1 CACHE 1 NO CYCLE;
|
||||
|
||||
CREATE TABLE forestry_self_consumption (
|
||||
id bigint DEFAULT nextval('forestry_self_consumption_seq') NOT NULL, -- 임업 자가소비량 일련번호
|
||||
household_seq bigint NOT NULL, -- 임가 일련번호
|
||||
income_code varchar(255), -- 수입 코드 (매핑코드)
|
||||
expense_code varchar(255), -- 지출 코드 (매핑코드)
|
||||
product_name varchar(15), -- 생산물
|
||||
usage varchar(20), -- 용도
|
||||
quantity decimal(6,2), -- 수량
|
||||
unit_code varchar(10), -- 단위 (매핑코드)
|
||||
estimated_value integer, -- 현물평가
|
||||
month varchar(7) NOT NULL, -- 조사시행 월 (yyyy-mm)
|
||||
day_group_no smallint, -- 일계부 작성일자 그룹 번호
|
||||
created_at timestamp(6), -- 생성일
|
||||
created_by varchar(255), -- 생성자
|
||||
updated_at timestamp(6), -- 수정일
|
||||
updated_by varchar(255), -- 수정자
|
||||
deleted_at timestamp(6), -- 삭제일
|
||||
deleted_by varchar(255), -- 삭제자
|
||||
is_deleted boolean DEFAULT false NOT NULL, -- 삭제여부
|
||||
|
||||
CONSTRAINT forestry_self_consumption_pkey PRIMARY KEY (id),
|
||||
CONSTRAINT fk_forestry_self_consumption__household FOREIGN KEY (household_seq) REFERENCES household(seq)
|
||||
);
|
||||
|
||||
COMMENT ON TABLE forestry_self_consumption IS '자가임업 생산물 중 자가소비량';
|
||||
|
||||
COMMENT ON COLUMN forestry_self_consumption.id IS '임가 일련번호';
|
||||
COMMENT ON COLUMN forestry_self_consumption.household_seq IS '임가정보내부키';
|
||||
COMMENT ON COLUMN forestry_self_consumption.income_code IS '수입 코드(매핑코드)';
|
||||
COMMENT ON COLUMN forestry_self_consumption.expense_code IS '지출 코드(매핑코드)';
|
||||
COMMENT ON COLUMN forestry_self_consumption.product_name IS '생산물';
|
||||
COMMENT ON COLUMN forestry_self_consumption.usage IS '용도';
|
||||
COMMENT ON COLUMN forestry_self_consumption.quantity IS '수량';
|
||||
COMMENT ON COLUMN forestry_self_consumption.unit_code IS '단위(매핑코드)';
|
||||
COMMENT ON COLUMN forestry_self_consumption.estimated_value IS '현물평가';
|
||||
COMMENT ON COLUMN forestry_self_consumption.month IS '조사시행 월(yyyy-mm)';
|
||||
COMMENT ON COLUMN forestry_self_consumption.day_group_no IS '일계부 작성일자 그룹 번호';
|
||||
COMMENT ON COLUMN forestry_self_consumption.created_at IS '생성일';
|
||||
COMMENT ON COLUMN forestry_self_consumption.created_by IS '생성자';
|
||||
COMMENT ON COLUMN forestry_self_consumption.updated_at IS '수정일';
|
||||
COMMENT ON COLUMN forestry_self_consumption.updated_by IS '수정자';
|
||||
COMMENT ON COLUMN forestry_self_consumption.deleted_at IS '삭제일';
|
||||
COMMENT ON COLUMN forestry_self_consumption.deleted_by IS '삭제자';
|
||||
COMMENT ON COLUMN forestry_self_consumption.is_deleted IS '삭제여부';
|
||||
|
||||
|
||||
-- 11. agriculture_self_consumption
|
||||
-- ============================================
|
||||
-- TABLE : agriculture_self_consumption
|
||||
-- DESC : 자가농업 생산물 중 자가소비량
|
||||
-- ============================================
|
||||
CREATE SEQUENCE agriculture_self_consumption_seq START WITH 1 INCREMENT BY 1 CACHE 1 NO CYCLE;
|
||||
|
||||
CREATE TABLE agriculture_self_consumption (
|
||||
id bigint DEFAULT nextval('agriculture_self_consumption_seq') NOT NULL, -- 농업 자가소비량 내부키
|
||||
household_seq bigint NOT NULL, -- 임가정보내부키
|
||||
income_code varchar(255), -- 수입 코드 (매핑코드)
|
||||
expense_code varchar(255), -- 지출 코드 (매핑코드)
|
||||
product_name varchar(15), -- 생산물
|
||||
product_detail varchar(20), -- 생산물 상세
|
||||
usage varchar(20), -- 용도
|
||||
quantity decimal(6,2), -- 수량
|
||||
unit_code varchar(10), -- 단위 (매핑코드)
|
||||
estimated_value integer, -- 현물평가액
|
||||
month varchar(7) NOT NULL, -- 조사시행 월 (yyyy-mm)
|
||||
week smallint, -- 입력차수(1,2,3,4)
|
||||
created_at timestamp(6), -- 생성일
|
||||
created_by varchar(255), -- 생성자
|
||||
updated_at timestamp(6), -- 수정일
|
||||
updated_by varchar(255), -- 수정자
|
||||
deleted_at timestamp(6), -- 삭제일
|
||||
deleted_by varchar(255), -- 삭제자
|
||||
is_deleted boolean DEFAULT false NOT NULL, -- 삭제여부
|
||||
|
||||
CONSTRAINT agriculture_self_consumption_pkey PRIMARY KEY (id),
|
||||
CONSTRAINT fk_agriculture_self_consumption__household FOREIGN KEY (household_seq) REFERENCES household(seq)
|
||||
);
|
||||
|
||||
COMMENT ON TABLE agriculture_self_consumption IS '자가농업 생산물 중 자가소비량';
|
||||
|
||||
COMMENT ON COLUMN agriculture_self_consumption.id IS '농업 자가소비량 내부키';
|
||||
COMMENT ON COLUMN agriculture_self_consumption.household_seq IS '임가정보내부키';
|
||||
COMMENT ON COLUMN agriculture_self_consumption.income_code IS '수입 코드(매핑코드)';
|
||||
COMMENT ON COLUMN agriculture_self_consumption.expense_code IS '지출 코드(매핑코드)';
|
||||
COMMENT ON COLUMN agriculture_self_consumption.product_name IS '생산물';
|
||||
COMMENT ON COLUMN agriculture_self_consumption.product_detail IS '생산물 상세';
|
||||
COMMENT ON COLUMN agriculture_self_consumption.usage IS '용도';
|
||||
COMMENT ON COLUMN agriculture_self_consumption.quantity IS '수량';
|
||||
COMMENT ON COLUMN agriculture_self_consumption.unit_code IS '단위(매핑코드)';
|
||||
COMMENT ON COLUMN agriculture_self_consumption.estimated_value IS '현물평가';
|
||||
COMMENT ON COLUMN agriculture_self_consumption.month IS '조사시행 월(yyyy-mm)';
|
||||
COMMENT ON COLUMN agriculture_self_consumption.week IS '입력차수(1,2,3,4)';
|
||||
COMMENT ON COLUMN agriculture_self_consumption.created_at IS '생성일';
|
||||
COMMENT ON COLUMN agriculture_self_consumption.created_by IS '생성자';
|
||||
COMMENT ON COLUMN agriculture_self_consumption.updated_at IS '수정일';
|
||||
COMMENT ON COLUMN agriculture_self_consumption.updated_by IS '수정자';
|
||||
COMMENT ON COLUMN agriculture_self_consumption.deleted_at IS '삭제일';
|
||||
COMMENT ON COLUMN agriculture_self_consumption.deleted_by IS '삭제자';
|
||||
COMMENT ON COLUMN agriculture_self_consumption.is_deleted IS '삭제여부';
|
||||
|
||||
|
||||
-- 12. upload_receipt_files
|
||||
-- ============================================
|
||||
-- TABLE : upload_receipt_files
|
||||
@@ -1904,26 +1233,4 @@ COMMENT ON COLUMN address.updated_at IS '수정일';
|
||||
COMMENT ON COLUMN address.updated_by IS '수정자';
|
||||
COMMENT ON COLUMN address.deleted_at IS '삭제일';
|
||||
COMMENT ON COLUMN address.deleted_by IS '삭제자';
|
||||
COMMENT ON COLUMN address.is_deleted IS '삭제여부';
|
||||
|
||||
|
||||
|
||||
-- ============================================
|
||||
-- TABLE : sms_auto_send
|
||||
-- DESC : 문자 자동 발송 활성화 테이블
|
||||
-- ============================================
|
||||
CREATE TABLE sms_auto_status (
|
||||
active boolean NOT null,
|
||||
message text,
|
||||
send_phone varchar(255),
|
||||
updated_at timestamp(6),
|
||||
updated_by varchar(255)
|
||||
);
|
||||
|
||||
COMMENT ON TABLE sms_auto_status IS '문자 자동 발송 활성화 테이블';
|
||||
|
||||
COMMENT ON COLUMN sms_auto_status.active IS '자동 발송 기능 ON/OFF 여부';
|
||||
COMMENT ON COLUMN sms_auto_status.message IS '메세지';
|
||||
COMMENT ON COLUMN sms_auto_status.send_phone IS '발송번호';
|
||||
COMMENT ON COLUMN sms_auto_status.updated_at IS '수정일';
|
||||
COMMENT ON COLUMN sms_auto_status.updated_by IS '수정자';
|
||||
COMMENT ON COLUMN address.is_deleted IS '삭제여부';
|
||||
@@ -1,48 +0,0 @@
|
||||
package app.module.front.config.application.security;
|
||||
|
||||
import app.module.core.config.application.enums.SocialType;
|
||||
import app.module.front.usecase.user.social.processSocialLogin.ports.ProcessSocialLoginPortIn;
|
||||
import app.module.front.usecase.user.social.processSocialLogin.ports.application.domain.ProcessSocialLoginCmd;
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.security.oauth2.client.userinfo.DefaultOAuth2UserService;
|
||||
import org.springframework.security.oauth2.client.userinfo.OAuth2UserRequest;
|
||||
import org.springframework.security.oauth2.client.userinfo.OAuth2UserService;
|
||||
import org.springframework.security.oauth2.core.OAuth2AuthenticationException;
|
||||
import org.springframework.security.oauth2.core.user.OAuth2User;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class CustomOAuth2UserService implements OAuth2UserService<OAuth2UserRequest, OAuth2User> {
|
||||
|
||||
private final ProcessSocialLoginPortIn processSocialLoginPortIn;
|
||||
|
||||
@Override
|
||||
public OAuth2User loadUser(OAuth2UserRequest userRequest) throws OAuth2AuthenticationException {
|
||||
OAuth2UserService<OAuth2UserRequest, OAuth2User> delegate = new DefaultOAuth2UserService();
|
||||
OAuth2User oAuth2User = delegate.loadUser(userRequest);
|
||||
|
||||
String registrationId = userRequest.getClientRegistration().getRegistrationId();
|
||||
SocialType socialType =
|
||||
Arrays.stream(SocialType.values())
|
||||
.filter(type -> type.getRegistrationId().equals(registrationId))
|
||||
.findFirst()
|
||||
.orElseThrow(() -> new RuntimeException("Social type not found"));
|
||||
String userNameAttributeName =
|
||||
userRequest
|
||||
.getClientRegistration()
|
||||
.getProviderDetails()
|
||||
.getUserInfoEndpoint()
|
||||
.getUserNameAttributeName();
|
||||
|
||||
Map<String, Object> attributes = oAuth2User.getAttributes();
|
||||
|
||||
return processSocialLoginPortIn
|
||||
.operate(new ProcessSocialLoginCmd(socialType, userNameAttributeName, attributes))
|
||||
.orElseThrow();
|
||||
}
|
||||
}
|
||||
@@ -31,7 +31,6 @@ public class FrontSecurityConfig {
|
||||
private final FrontDetailService frontDetailService;
|
||||
private final DataSource dataSource;
|
||||
private final BCryptPasswordEncoder passwordEncoder;
|
||||
private final CustomOAuth2UserService customOAuth2UserService;
|
||||
private final CustomAuthenticationEntryPoint customAuthenticationEntryPoint;
|
||||
@Value("${app.front.session.maximum.num}")
|
||||
private Integer maxSessionNum;
|
||||
@@ -69,7 +68,7 @@ public class FrontSecurityConfig {
|
||||
List<String> publicAccess =
|
||||
Arrays.stream(PublicAccess.values())
|
||||
.map(PublicAccess::getPath)
|
||||
.collect(Collectors.toList());
|
||||
.toList();
|
||||
|
||||
// front - 익명 사용자 접근 허용 URI 등록 (admin 과 달리 공개/비공개 URL 이 존재한다)
|
||||
FrontPublicAccess.getInstance().setURIs(List.of("/", "/user/register", "/policy/**"));
|
||||
@@ -104,13 +103,7 @@ public class FrontSecurityConfig {
|
||||
session -> session.maximumSessions(maxSessionNum).maxSessionsPreventsLogin(false).expiredUrl("/login"))
|
||||
.sessionManagement(
|
||||
session -> session.invalidSessionUrl("/login"))
|
||||
.oauth2Login(
|
||||
config ->
|
||||
config
|
||||
.loginPage("/login")
|
||||
.userInfoEndpoint(
|
||||
userInfoEndpointConfig ->
|
||||
userInfoEndpointConfig.userService(customOAuth2UserService)));
|
||||
;
|
||||
|
||||
return http.build();
|
||||
}
|
||||
|
||||
@@ -2,10 +2,12 @@ package app.module.front.config.application.security;
|
||||
|
||||
import java.util.Collection;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.springframework.security.core.GrantedAuthority;
|
||||
import org.springframework.security.core.userdetails.User;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class FrontUser extends User {
|
||||
|
||||
private String nickname;
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
package app.module.front.config.application.util;
|
||||
|
||||
import app.module.core.config.adapters.web.security.domain.SocialUser;
|
||||
import app.module.front.config.application.security.FrontHouseholdUser;
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.core.context.SecurityContextHolder;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
import org.springframework.security.oauth2.core.user.DefaultOAuth2User;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package app.module.front.usecase.daily.expense.adapters.persistence.model;
|
||||
|
||||
import app.module.front.usecase.daily.status.ports.DailyStatusHasChildren;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@@ -8,7 +9,7 @@ import java.util.List;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class DailyExpenseMonthDto {
|
||||
public class DailyExpenseMonthDto implements DailyStatusHasChildren {
|
||||
private Long dailyRecordSeq;
|
||||
private LocalDate startDate;
|
||||
private LocalDate endDate;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package app.module.front.usecase.daily.farming.adapters.persistence.model;
|
||||
|
||||
import app.module.front.usecase.daily.income.adapters.persistence.model.DailyIncomeDto;
|
||||
import app.module.front.usecase.daily.status.ports.DailyStatusHasChildren;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@@ -9,7 +10,7 @@ import java.util.List;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class DailyFarmingMonthDto {
|
||||
public class DailyFarmingMonthDto implements DailyStatusHasChildren {
|
||||
private Long dailyRecordSeq;
|
||||
private LocalDate startDate;
|
||||
private LocalDate endDate;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package app.module.front.usecase.daily.forestry.adapters.persistence.model;
|
||||
|
||||
import app.module.front.usecase.daily.income.adapters.persistence.model.DailyIncomeDto;
|
||||
import app.module.front.usecase.daily.status.ports.DailyStatusHasChildren;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@@ -9,7 +10,7 @@ import java.util.List;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class DailyForestryMonthDto {
|
||||
public class DailyForestryMonthDto implements DailyStatusHasChildren {
|
||||
private Long dailyRecordSeq;
|
||||
private LocalDate startDate;
|
||||
private LocalDate endDate;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package app.module.front.usecase.daily.income.adapters.persistence.model;
|
||||
|
||||
import app.module.front.usecase.daily.status.ports.DailyStatusHasChildren;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
@@ -10,7 +11,7 @@ import java.util.List;
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
public class DailyIncomeMonthDto {
|
||||
public class DailyIncomeMonthDto implements DailyStatusHasChildren {
|
||||
private Long dailyRecordSeq;
|
||||
private LocalDate startDate;
|
||||
private LocalDate endDate;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package app.module.front.usecase.daily.power.adapters.persistence.model;
|
||||
|
||||
import app.module.front.usecase.daily.status.ports.DailyStatusHasChildren;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@@ -8,7 +9,7 @@ import java.util.List;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class DailyPowerMonthDto {
|
||||
public class DailyPowerMonthDto implements DailyStatusHasChildren {
|
||||
private Long dailyRecordSeq;
|
||||
private LocalDate startDate;
|
||||
private LocalDate endDate;
|
||||
|
||||
@@ -70,7 +70,7 @@ public class DailyRecordController {
|
||||
*/
|
||||
@PostMapping(path = "/{searchMonth}/{groupNo}/today-none")
|
||||
ResponseEntity<?> todayNone(@PathVariable("searchMonth") String searchMonth, @PathVariable("groupNo") String groupNo
|
||||
, @RequestParam(name = "target", required = true, defaultValue = "") String targetType
|
||||
, @RequestParam(name = "target", defaultValue = "") String targetType
|
||||
, @RequestParam(name = "status", required = false, defaultValue = "N") String targetStatus) {
|
||||
|
||||
DailyUIReqVO reqVO = new DailyUIReqVO(searchMonth, groupNo);
|
||||
|
||||
@@ -2,12 +2,14 @@ package app.module.front.usecase.daily.status.adapters.web;
|
||||
|
||||
import app.module.core.config.application.enums.DailySort;
|
||||
import app.module.core.config.application.exception.NoMatchingURIException;
|
||||
import app.module.front.usecase.daily.expense.adapters.persistence.model.DailyExpenseMonthDto;
|
||||
import app.module.front.usecase.daily.expense.adapters.web.model.DailyExpenseUIReqVO;
|
||||
import app.module.front.usecase.daily.expense.ports.DailyExpensePortIn;
|
||||
import app.module.front.usecase.daily.farming.adapters.web.model.DailyFarmingUIReqVO;
|
||||
import app.module.front.usecase.daily.farming.ports.DailyFarmingPortIn;
|
||||
import app.module.front.usecase.daily.forestry.adapters.web.model.DailyForestryUIReqVO;
|
||||
import app.module.front.usecase.daily.forestry.ports.DailyForestryPortIn;
|
||||
import app.module.front.usecase.daily.status.ports.DailyStatusHasChildren;
|
||||
import app.module.front.usecase.daily.income.adapters.web.model.DailyIncomeUIReqVO;
|
||||
import app.module.front.usecase.daily.income.ports.DailyIncomePortIn;
|
||||
import app.module.front.usecase.daily.power.adapters.web.model.DailyPowerUIReqVO;
|
||||
@@ -25,6 +27,9 @@ import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@Slf4j
|
||||
@Controller
|
||||
@RequiredArgsConstructor
|
||||
@@ -63,29 +68,54 @@ public class DailyStatusUIController {
|
||||
*/
|
||||
@GetMapping(path = "/{step}/{searchMonth}")
|
||||
public String detail(Model model, @PathVariable("step") String step, @PathVariable("searchMonth") String searchMonth) {
|
||||
if (DailySort.INCOME.name().equalsIgnoreCase(step)) {
|
||||
model.addAttribute("step", DailySort.INCOME);
|
||||
model.addAttribute("list", dailyIncomePortIn.monthList(new DailyIncomeUIReqVO(searchMonth, "")));
|
||||
} else if (DailySort.WORK.name().equalsIgnoreCase(step)) {
|
||||
model.addAttribute("step", DailySort.WORK);
|
||||
model.addAttribute("list", dailyWorkPortIn.monthList(new DailyWorkUIReqVO(searchMonth, "")));
|
||||
} else if (DailySort.EXPENSE.name().equalsIgnoreCase(step)) {
|
||||
model.addAttribute("step", DailySort.EXPENSE);
|
||||
model.addAttribute("list", dailyExpensePortIn.monthList(new DailyExpenseUIReqVO(searchMonth, "")));
|
||||
} else if (DailySort.POWER.name().equalsIgnoreCase(step)) {
|
||||
model.addAttribute("step", DailySort.POWER);
|
||||
model.addAttribute("list", dailyPowerPortIn.monthList(new DailyPowerUIReqVO(searchMonth, "")));
|
||||
} else if (DailySort.FORESTRY.name().equalsIgnoreCase(step)) {
|
||||
model.addAttribute("step", DailySort.FORESTRY);
|
||||
model.addAttribute("list", dailyForestryPortIn.monthList(new DailyForestryUIReqVO(searchMonth, "")));
|
||||
} else if (DailySort.FARMING.name().equalsIgnoreCase(step)) {
|
||||
model.addAttribute("step", DailySort.FARMING);
|
||||
model.addAttribute("list", dailyFarmingPortIn.monthList(new DailyFarmingUIReqVO(searchMonth, "")));
|
||||
} else {
|
||||
throw new NoMatchingURIException("잘못된 접근");
|
||||
switch (DailySort.valueOf(step.toUpperCase())) {
|
||||
case INCOME -> {
|
||||
processStep(model, DailySort.INCOME,
|
||||
dailyIncomePortIn.monthList(new DailyIncomeUIReqVO(searchMonth, "")));
|
||||
}
|
||||
case WORK -> {
|
||||
processStep(model, DailySort.WORK,
|
||||
dailyWorkPortIn.monthList(new DailyWorkUIReqVO(searchMonth, "")));
|
||||
}
|
||||
case EXPENSE -> {
|
||||
processStep(model, DailySort.EXPENSE,
|
||||
dailyExpensePortIn.monthList(new DailyExpenseUIReqVO(searchMonth, "")));
|
||||
}
|
||||
case POWER -> {
|
||||
processStep(model, DailySort.POWER,
|
||||
dailyPowerPortIn.monthList(new DailyPowerUIReqVO(searchMonth, "")));
|
||||
}
|
||||
case FORESTRY -> {
|
||||
processStep(model, DailySort.EXPENSE,
|
||||
dailyForestryPortIn.monthList(new DailyForestryUIReqVO(searchMonth, "")));
|
||||
}
|
||||
case FARMING -> {
|
||||
processStep(model, DailySort.FARMING,
|
||||
dailyFarmingPortIn.monthList(new DailyFarmingUIReqVO(searchMonth, "")));
|
||||
}
|
||||
default -> throw new NoMatchingURIException("잘못된 접근");
|
||||
}
|
||||
|
||||
model.addAttribute("searchMonth", searchMonth);
|
||||
return String.format("status/daily/detail-%s", step);
|
||||
}
|
||||
|
||||
/**
|
||||
* 일계부 입력 현황 상세 화면 처리
|
||||
*
|
||||
* @param model Model
|
||||
* @param step 단계
|
||||
* @param list 데이터 목록
|
||||
* @param <T> 데이터 Model
|
||||
*/
|
||||
private <T extends DailyStatusHasChildren> void processStep(Model model, DailySort step, List<T> list) {
|
||||
int childrenCount = list.stream()
|
||||
.filter(Objects::nonNull)
|
||||
.mapToInt(dto -> dto.getChildren() != null ? dto.getChildren().size() : 0)
|
||||
.sum();
|
||||
|
||||
model.addAttribute("step", step);
|
||||
model.addAttribute("list", list);
|
||||
model.addAttribute("childrenCount", childrenCount);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
package app.module.front.usecase.daily.status.ports;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface DailyStatusHasChildren {
|
||||
List<?> getChildren();
|
||||
}
|
||||
@@ -1,19 +1,17 @@
|
||||
package app.module.front.usecase.daily.work.adapters.persistence.model;
|
||||
|
||||
import app.module.front.usecase.daily.income.adapters.persistence.model.DailyIncomeDto;
|
||||
import app.module.front.usecase.daily.status.ports.DailyStatusHasChildren;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@Getter
|
||||
@Setter
|
||||
public class DailyWorkMonthDto {
|
||||
public class DailyWorkMonthDto implements DailyStatusHasChildren {
|
||||
private Long dailyRecordSeq;
|
||||
private LocalDate startDate;
|
||||
private LocalDate endDate;
|
||||
|
||||
@@ -12,7 +12,6 @@ import java.util.List;
|
||||
@EqualsAndHashCode
|
||||
public class CreateBankInputReqVO {
|
||||
|
||||
|
||||
// private Boolean status;
|
||||
private Long id;
|
||||
private String transferType;
|
||||
@@ -22,9 +21,4 @@ public class CreateBankInputReqVO {
|
||||
return bankList != null ? bankList : new ArrayList<>();
|
||||
}
|
||||
|
||||
public void setBankList(List<CreateBankInputProductReqVO> bankList) {
|
||||
this.bankList = bankList;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -11,8 +11,6 @@ import java.util.List;
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class CreateMonthlyReqVO {
|
||||
|
||||
|
||||
private Boolean status;
|
||||
private Long id;
|
||||
private List<CreateMonthlyProductReqVO> productList;
|
||||
@@ -20,10 +18,4 @@ public class CreateMonthlyReqVO {
|
||||
public List<CreateMonthlyProductReqVO> getProductList() {
|
||||
return productList != null ? productList : new ArrayList<>();
|
||||
}
|
||||
|
||||
public void setProductList(List<CreateMonthlyProductReqVO> productList) {
|
||||
this.productList = productList;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
package app.module.front.usecase.user.social.parseSocialUser.ports;
|
||||
|
||||
import app.module.front.usecase.user.social.parseSocialUser.ports.application.domain.ParseSocialUserCmd;
|
||||
import app.module.front.usecase.user.social.parseSocialUser.ports.application.domain.ParsedUserInfo;
|
||||
import java.util.Optional;
|
||||
|
||||
public interface ParseSocialUserPortIn {
|
||||
|
||||
Optional<ParsedUserInfo> operate(ParseSocialUserCmd cmd);
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
package app.module.front.usecase.user.social.parseSocialUser.ports.application;
|
||||
|
||||
import app.module.front.usecase.user.social.parseSocialUser.ports.ParseSocialUserPortIn;
|
||||
import app.module.front.usecase.user.social.parseSocialUser.ports.application.domain.KakaoUserInfo;
|
||||
import app.module.front.usecase.user.social.parseSocialUser.ports.application.domain.NaverUserInfo;
|
||||
import app.module.front.usecase.user.social.parseSocialUser.ports.application.domain.ParseSocialUserCmd;
|
||||
import app.module.front.usecase.user.social.parseSocialUser.ports.application.domain.ParsedUserInfo;
|
||||
import java.util.Optional;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
class ParseSocialUserService implements ParseSocialUserPortIn {
|
||||
|
||||
@Override
|
||||
public Optional<ParsedUserInfo> operate(ParseSocialUserCmd cmd) {
|
||||
ParsedUserInfo parsedUserInfo = null;
|
||||
|
||||
switch (cmd.getSocialType()) {
|
||||
case KAKAO -> {
|
||||
parsedUserInfo = new KakaoUserInfo(cmd.getUserNameAttributeName(),
|
||||
cmd.getAttributes());
|
||||
}
|
||||
case NAVER -> {
|
||||
parsedUserInfo = new NaverUserInfo(cmd.getUserNameAttributeName(),
|
||||
cmd.getAttributes());
|
||||
}
|
||||
}
|
||||
|
||||
if (parsedUserInfo != null) {
|
||||
log.info("socialId: {}", parsedUserInfo.getSocialId());
|
||||
log.info("nickname: {}", parsedUserInfo.getNickName());
|
||||
log.info("name: {}", parsedUserInfo.getName());
|
||||
log.info("ci: {}", parsedUserInfo.getCi());
|
||||
log.info("birthday: {}", parsedUserInfo.getBirthday());
|
||||
log.info("email: {}", parsedUserInfo.getEmail());
|
||||
log.info("phone: {}", parsedUserInfo.getPhone());
|
||||
}
|
||||
|
||||
return Optional.ofNullable(parsedUserInfo);
|
||||
}
|
||||
}
|
||||
@@ -1,116 +0,0 @@
|
||||
package app.module.front.usecase.user.social.parseSocialUser.ports.application.domain;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
public class KakaoUserInfo implements ParsedUserInfo {
|
||||
|
||||
private final String userNameAttribute;
|
||||
private final Map<String, Object> attributes;
|
||||
|
||||
public KakaoUserInfo(String userNameAttribute, Map<String, Object> attributes) {
|
||||
this.userNameAttribute = userNameAttribute;
|
||||
this.attributes = attributes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSocialId() {
|
||||
return String.valueOf(attributes.get(userNameAttribute));
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public String getNickName() {
|
||||
Map<String, Object> account = (Map<String, Object>) attributes.get("kakao_account");
|
||||
Map<String, Object> profile = (Map<String, Object>) account.get("profile");
|
||||
|
||||
return (String) profile.get("nickname");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public String getName() {
|
||||
Map<String, Object> account = (Map<String, Object>) attributes.get("kakao_account");
|
||||
|
||||
if (account == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// 카카오 로그인 서비스 인증 전에 이름 정보는 전달되지 않는다.
|
||||
if (account.get("name") == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (String) account.get("name");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public String getEmail() {
|
||||
Map<String, Object> account = (Map<String, Object>) attributes.get("kakao_account");
|
||||
|
||||
if (account == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
String email = (String) account.get("email");
|
||||
|
||||
// 카카오 로그인 서비스 인증 전에 이메일 정보는 전달되지 않는다.
|
||||
return Objects.requireNonNullElse(email, "NO-KAKAO-EMAIL@noemail.com");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public String getPhone() {
|
||||
Map<String, Object> account = (Map<String, Object>) attributes.get("kakao_account");
|
||||
|
||||
if (account == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// 카카오 로그인 서비스 인증 전에 phone 정보는 전달되지 않는다.
|
||||
if (account.get("phone_number") == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// "0" + s.replaceAll("^\\+\\d{1,3}-?|-", "").trim();
|
||||
return (String) account.get("phone_number");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public String getBirthday() {
|
||||
Map<String, Object> account = (Map<String, Object>) attributes.get("kakao_account");
|
||||
|
||||
if (account == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
String birthyear = (String) account.get("birthyear");
|
||||
String birthday = (String) account.get("birthday");
|
||||
|
||||
// 카카오 로그인 서비스 인증 전에 생년월일 정보는 전달되지 않는다.
|
||||
if (birthyear == null || birthday == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return birthyear + birthday;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public String getCi() {
|
||||
Map<String, Object> account = (Map<String, Object>) attributes.get("kakao_account");
|
||||
|
||||
if (account == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// 카카오 로그인 서비스 인증 전에 CI 정보는 전달되지 않는다.
|
||||
if (account.get("ci") == null || ((String) account.get("ci")).equals("")) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (String) account.get("ci");
|
||||
}
|
||||
}
|
||||
@@ -1,60 +0,0 @@
|
||||
package app.module.front.usecase.user.social.parseSocialUser.ports.application.domain;
|
||||
|
||||
import java.util.Map;
|
||||
import lombok.ToString;
|
||||
|
||||
@ToString
|
||||
public class NaverUserInfo implements ParsedUserInfo {
|
||||
|
||||
private final String userNameAttribute;
|
||||
private final Map<String, Object> attributes;
|
||||
|
||||
public NaverUserInfo(String userNameAttribute, Map<String, Object> attributes) {
|
||||
this.userNameAttribute = userNameAttribute;
|
||||
this.attributes = attributes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSocialId() {
|
||||
return (String) getAttrs().get("id");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNickName() {
|
||||
return (String) getAttrs().get("nickname");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return (String) getAttrs().get("name");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEmail() {
|
||||
return (String) getAttrs().get("email");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPhone() {
|
||||
String phone = (String) getAttrs().get("mobile");
|
||||
return phone != null ? phone.replaceAll("-", "") : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBirthday() {
|
||||
String birthYear = (String) getAttrs().get("birthyear");
|
||||
String birthday = (String) getAttrs().get("birthday");
|
||||
return (birthYear + birthday).replaceAll("-", "");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCi() {
|
||||
// 네이버 로그인 서비스 인증 전에 CI 정보는 전달되지 않는다.
|
||||
return (String) getAttrs().get("ci");
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private Map<String, Object> getAttrs() {
|
||||
return (Map<String, Object>) attributes.get(userNameAttribute);
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package app.module.front.usecase.user.social.parseSocialUser.ports.application.domain;
|
||||
|
||||
import app.module.core.config.application.enums.SocialType;
|
||||
import java.util.Map;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class ParseSocialUserCmd {
|
||||
|
||||
private SocialType socialType;
|
||||
private String userNameAttributeName;
|
||||
private Map<String, Object> attributes;
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package app.module.front.usecase.user.social.parseSocialUser.ports.application.domain;
|
||||
|
||||
public interface ParsedUserInfo {
|
||||
|
||||
String getSocialId();
|
||||
|
||||
String getNickName();
|
||||
|
||||
String getName();
|
||||
|
||||
String getEmail();
|
||||
|
||||
String getPhone();
|
||||
|
||||
String getBirthday();
|
||||
|
||||
String getCi();
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
package app.module.front.usecase.user.social.processSocialLogin.adapters.persistence;
|
||||
|
||||
import app.module.core.config.adapters.persistence.entity.FrontUserSocial;
|
||||
import app.module.core.config.application.enums.SocialType;
|
||||
import java.util.Optional;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface FrontUserSocialRepo {
|
||||
|
||||
Optional<FrontUserSocial> findBySocialTypeAndSocialId(SocialType socialType, String socialId);
|
||||
}
|
||||
@@ -1,66 +0,0 @@
|
||||
package app.module.front.usecase.user.social.processSocialLogin.adapters.persistence;
|
||||
|
||||
import app.module.core.config.adapters.persistence.entity.FrontUserSocial;
|
||||
import app.module.front.usecase.user.social.processSocialLogin.ports.ProcessSocialLoginPortOut;
|
||||
import app.module.front.usecase.user.social.processSocialLogin.ports.application.domain.CreateUserSocialCmd;
|
||||
import app.module.front.usecase.user.social.processSocialLogin.ports.application.domain.GetUserSocial;
|
||||
import app.module.front.usecase.user.social.processSocialLogin.ports.application.domain.GetUserSocialCmd;
|
||||
import app.module.front.usecase.user.social.processSocialLogin.ports.application.domain.ProcessSocialLogin;
|
||||
import app.module.front.usecase.user.social.processSocialLogin.ports.application.domain.ProcessSocialLoginCmd;
|
||||
import java.util.Optional;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
@RequiredArgsConstructor
|
||||
class ProcessSocialLoginDao implements ProcessSocialLoginPortOut {
|
||||
|
||||
private final FrontUserSocialRepo frontUserSocialRepo;
|
||||
|
||||
@Override
|
||||
public Optional<ProcessSocialLogin> operate(ProcessSocialLoginCmd cmd) {
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional<GetUserSocial> findUserSocial(GetUserSocialCmd cmd) {
|
||||
return frontUserSocialRepo
|
||||
.findBySocialTypeAndSocialId(cmd.getSocialType(), cmd.getSocialId())
|
||||
.flatMap(
|
||||
frontSocialUser ->
|
||||
Optional.of(
|
||||
new GetUserSocial(
|
||||
frontSocialUser.getSeq(),
|
||||
frontSocialUser.getUserId(),
|
||||
frontSocialUser.getSocialType(),
|
||||
frontSocialUser.getSocialId(),
|
||||
frontSocialUser.getEmail(),
|
||||
frontSocialUser.getName(),
|
||||
frontSocialUser.getCi())));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional<GetUserSocial> createUserSocial(CreateUserSocialCmd cmd) {
|
||||
// FrontUserSocial createUserSocial =
|
||||
// frontUserSocialRepo.save(
|
||||
// new FrontUserSocial(
|
||||
// null,
|
||||
// cmd.getUserId(),
|
||||
// cmd.getSocialType(),
|
||||
// cmd.getSocialId(),
|
||||
// cmd.getEmail(),
|
||||
// cmd.getName(),
|
||||
// cmd.getCi()));
|
||||
//
|
||||
// return Optional.of(
|
||||
// new GetUserSocial(
|
||||
// createUserSocial.getSeq(),
|
||||
// createUserSocial.getUserId(),
|
||||
// createUserSocial.getSocialType(),
|
||||
// createUserSocial.getSocialId(),
|
||||
// createUserSocial.getEmail(),
|
||||
// createUserSocial.getName(),
|
||||
// createUserSocial.getCi()));
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
package app.module.front.usecase.user.social.processSocialLogin.ports;
|
||||
|
||||
import app.module.core.config.adapters.web.security.domain.SocialUser;
|
||||
import app.module.front.usecase.user.social.processSocialLogin.ports.application.domain.ProcessSocialLoginCmd;
|
||||
import java.util.Optional;
|
||||
|
||||
public interface ProcessSocialLoginPortIn {
|
||||
|
||||
Optional<SocialUser> operate(ProcessSocialLoginCmd cmd);
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package app.module.front.usecase.user.social.processSocialLogin.ports;
|
||||
|
||||
import app.module.front.usecase.user.social.processSocialLogin.ports.application.domain.CreateUserSocialCmd;
|
||||
import app.module.front.usecase.user.social.processSocialLogin.ports.application.domain.GetUserSocial;
|
||||
import app.module.front.usecase.user.social.processSocialLogin.ports.application.domain.GetUserSocialCmd;
|
||||
import app.module.front.usecase.user.social.processSocialLogin.ports.application.domain.ProcessSocialLogin;
|
||||
import app.module.front.usecase.user.social.processSocialLogin.ports.application.domain.ProcessSocialLoginCmd;
|
||||
import java.util.Optional;
|
||||
|
||||
public interface ProcessSocialLoginPortOut {
|
||||
|
||||
Optional<ProcessSocialLogin> operate(ProcessSocialLoginCmd cmd);
|
||||
|
||||
Optional<GetUserSocial> findUserSocial(GetUserSocialCmd cmd);
|
||||
|
||||
Optional<GetUserSocial> createUserSocial(CreateUserSocialCmd cmd);
|
||||
}
|
||||
@@ -1,131 +0,0 @@
|
||||
package app.module.front.usecase.user.social.processSocialLogin.ports.application;
|
||||
|
||||
import app.module.core.config.adapters.web.security.domain.CorePrivilege;
|
||||
import app.module.core.config.adapters.web.security.domain.CoreRole;
|
||||
import app.module.core.config.adapters.web.security.domain.SocialUser;
|
||||
import app.module.core.config.application.enums.SignUpType;
|
||||
import app.module.core.usecase.user.createUser.ports.CreateUserPortIn;
|
||||
import app.module.core.usecase.user.createUser.ports.application.domain.CreateUserCmd;
|
||||
import app.module.core.usecase.user.findUser.ports.FindUserPortIn;
|
||||
import app.module.core.usecase.user.findUser.ports.application.domain.FindUser;
|
||||
import app.module.core.usecase.user.findUser.ports.application.domain.FindUserCmd;
|
||||
import app.module.front.usecase.user.social.parseSocialUser.ports.ParseSocialUserPortIn;
|
||||
import app.module.front.usecase.user.social.parseSocialUser.ports.application.domain.ParseSocialUserCmd;
|
||||
import app.module.front.usecase.user.social.parseSocialUser.ports.application.domain.ParsedUserInfo;
|
||||
import app.module.front.usecase.user.social.processSocialLogin.ports.ProcessSocialLoginPortIn;
|
||||
import app.module.front.usecase.user.social.processSocialLogin.ports.ProcessSocialLoginPortOut;
|
||||
import app.module.front.usecase.user.social.processSocialLogin.ports.application.domain.CreateUserSocialCmd;
|
||||
import app.module.front.usecase.user.social.processSocialLogin.ports.application.domain.GetUserSocialCmd;
|
||||
import app.module.front.usecase.user.social.processSocialLogin.ports.application.domain.ProcessSocialLoginCmd;
|
||||
import java.util.Collection;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.security.core.GrantedAuthority;
|
||||
import org.springframework.security.core.authority.SimpleGrantedAuthority;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
class ProcessSocialLoginService implements ProcessSocialLoginPortIn {
|
||||
|
||||
private final ProcessSocialLoginPortOut portOut;
|
||||
private final ParseSocialUserPortIn parseSocialUserPortIn;
|
||||
private final FindUserPortIn findUserPortIn;
|
||||
private final CreateUserPortIn createUserPortIn;
|
||||
|
||||
@Override
|
||||
public Optional<SocialUser> operate(ProcessSocialLoginCmd cmd) {
|
||||
|
||||
// SNS Login Provider 가 제공하는 사용자 정보 파싱
|
||||
Optional<ParsedUserInfo> parsedUserInfo =
|
||||
parseSocialUserPortIn.operate(
|
||||
new ParseSocialUserCmd(
|
||||
cmd.getSocialType(), cmd.getUserNameAttributeName(), cmd.getAttributes()));
|
||||
|
||||
if (parsedUserInfo.isPresent()) {
|
||||
ParsedUserInfo parsedUser = parsedUserInfo.get();
|
||||
|
||||
return portOut
|
||||
.findUserSocial(new GetUserSocialCmd(cmd.getSocialType(), parsedUser.getSocialId()))
|
||||
.flatMap(
|
||||
getUserSocial ->
|
||||
findUserPortIn
|
||||
.operate(new FindUserCmd(getUserSocial.getUserId()))
|
||||
.flatMap(findUser -> getSocialUserOpt(findUser, cmd)))
|
||||
.or(
|
||||
() -> {
|
||||
// 신규 회원인 경우,
|
||||
String uuid = UUID.randomUUID().toString();
|
||||
|
||||
return createUserPortIn
|
||||
.operate(
|
||||
new CreateUserCmd(
|
||||
uuid,
|
||||
"NO_PASSWD",
|
||||
parsedUser.getEmail(),
|
||||
parsedUser.getNickName(),
|
||||
SignUpType.SOCIAL,
|
||||
false,
|
||||
0,
|
||||
false,
|
||||
Set.of("ROLE_GENERAL")))
|
||||
.flatMap(
|
||||
createUser ->
|
||||
portOut.createUserSocial(
|
||||
new CreateUserSocialCmd(
|
||||
createUser.getId(),
|
||||
cmd.getSocialType(),
|
||||
parsedUser.getSocialId(),
|
||||
createUser.getEmail(),
|
||||
parsedUser.getName(),
|
||||
parsedUser.getCi())))
|
||||
.flatMap(
|
||||
getUserSocial ->
|
||||
findUserPortIn
|
||||
.operate(new FindUserCmd(getUserSocial.getUserId()))
|
||||
.flatMap(findUser -> getSocialUserOpt(findUser, cmd)));
|
||||
});
|
||||
}
|
||||
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
private Optional<SocialUser> getSocialUserOpt(FindUser findUser, ProcessSocialLoginCmd cmd) {
|
||||
boolean accountLocked = Optional.ofNullable(findUser.getAccountLocked()).orElse(false);
|
||||
boolean accountDisabled = Optional.ofNullable(findUser.getAccountDisabled()).orElse(false);
|
||||
|
||||
return Optional.of(
|
||||
new SocialUser(
|
||||
getAuthorities(findUser.getRoles()),
|
||||
cmd.getAttributes(),
|
||||
cmd.getUserNameAttributeName(),
|
||||
findUser.getId(),
|
||||
findUser.getPassword(),
|
||||
!accountDisabled,
|
||||
true,
|
||||
true,
|
||||
!accountLocked,
|
||||
findUser.getNickname(),
|
||||
0L));
|
||||
}
|
||||
|
||||
private Collection<? extends GrantedAuthority> getAuthorities(Collection<CoreRole> roles) {
|
||||
return Stream.concat(getRoles(roles), getPrivileges(roles))
|
||||
.map(SimpleGrantedAuthority::new)
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
private Stream<String> getRoles(Collection<CoreRole> roles) {
|
||||
return roles.stream().map(CoreRole::getId);
|
||||
}
|
||||
|
||||
private Stream<String> getPrivileges(Collection<CoreRole> roles) {
|
||||
return roles.stream()
|
||||
.flatMap(roleOutput -> roleOutput.getPrivileges().stream())
|
||||
.map(CorePrivilege::getId);
|
||||
}
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
package app.module.front.usecase.user.social.processSocialLogin.ports.application.domain;
|
||||
|
||||
import app.module.core.config.application.enums.SocialType;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class CreateUserSocialCmd {
|
||||
|
||||
private String userId;
|
||||
|
||||
private SocialType socialType;
|
||||
|
||||
private String socialId;
|
||||
|
||||
private String email;
|
||||
|
||||
private String name;
|
||||
|
||||
private String ci;
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
package app.module.front.usecase.user.social.processSocialLogin.ports.application.domain;
|
||||
|
||||
import app.module.core.config.application.enums.SocialType;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class GetUserSocial {
|
||||
|
||||
private Integer seq;
|
||||
|
||||
private String userId;
|
||||
|
||||
private SocialType socialType;
|
||||
|
||||
private String socialId;
|
||||
|
||||
private String email;
|
||||
|
||||
private String name;
|
||||
|
||||
private String ci;
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package app.module.front.usecase.user.social.processSocialLogin.ports.application.domain;
|
||||
|
||||
import app.module.core.config.application.enums.SocialType;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class GetUserSocialCmd {
|
||||
|
||||
private SocialType socialType;
|
||||
private String socialId;
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
package app.module.front.usecase.user.social.processSocialLogin.ports.application.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class ProcessSocialLogin {
|
||||
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package app.module.front.usecase.user.social.processSocialLogin.ports.application.domain;
|
||||
|
||||
import app.module.core.config.application.enums.SocialType;
|
||||
import java.util.Map;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class ProcessSocialLoginCmd {
|
||||
|
||||
private SocialType socialType;
|
||||
private String userNameAttributeName;
|
||||
private Map<String, Object> attributes;
|
||||
}
|
||||
@@ -13,7 +13,7 @@
|
||||
where only_day.day <= DATE_PART('day', (date_trunc('MONTH', TO_DATE(#{recordMonth}, 'YYYYMM')) + INTERVAL '1 MONTH - 1 day'))
|
||||
)
|
||||
select count(dg.day) as day_count
|
||||
, (count(dg.day) filter (where dr.all_status = 'DONE')) as done_count
|
||||
, (count(dg.day) filter (where dr.all_status = 'DONE' or dr.all_status = 'TODAY_NONE')) as done_count
|
||||
from day_gorup dg
|
||||
left join
|
||||
daily_record dr on dr.day_group_no = dg.group_no and dr.record_month = to_char(TO_DATE(#{recordMonth}, 'YYYYMM'), 'YYYYMM') and dr.household_seq = #{householdSeq}
|
||||
|
||||
@@ -21,7 +21,8 @@
|
||||
COUNT(*) OVER () AS total
|
||||
FROM notice a
|
||||
WHERE a.is_deleted = false
|
||||
|
||||
AND now() between a.start_date and a.end_date
|
||||
|
||||
<if test="cmd.searchField != null and cmd.searchField != ''">
|
||||
<choose>
|
||||
<when test="cmd.searchField eq 'titleContent'">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<hgroup class="tit-group">
|
||||
<h3>
|
||||
[[${#temporals.format(#temporals.createDate(searchMonth+'01', 'yyyyMMdd'), 'yyyy년 M월')}]]의 [[${step.desc2}]] 내역이 <br>
|
||||
<strong>[[${#lists.size(list)}]]건 등록</strong> 되었습니다.
|
||||
<strong>[[${childrenCount}]]건 등록</strong> 되었습니다.
|
||||
</h3>
|
||||
</hgroup>
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<hgroup class="tit-group">
|
||||
<h3>
|
||||
[[${#temporals.format(#temporals.createDate(searchMonth+'01', 'yyyyMMdd'), 'yyyy년 M월')}]]의 [[${step.desc2}]] 내역이 <br>
|
||||
<strong>[[${#lists.size(list)}]]건 등록</strong> 되었습니다.
|
||||
<strong>[[${childrenCount}]]건 등록</strong> 되었습니다.
|
||||
</h3>
|
||||
</hgroup>
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<hgroup class="tit-group">
|
||||
<h3>
|
||||
[[${#temporals.format(#temporals.createDate(searchMonth+'01', 'yyyyMMdd'), 'yyyy년 M월')}]]의 [[${step.desc2}]] 내역이 <br>
|
||||
<strong>[[${#lists.size(list)}]]건 등록</strong> 되었습니다.
|
||||
<strong>[[${childrenCount}]]건 등록</strong> 되었습니다.
|
||||
</h3>
|
||||
</hgroup>
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<hgroup class="tit-group">
|
||||
<h3>
|
||||
[[${#temporals.format(#temporals.createDate(searchMonth+'01', 'yyyyMMdd'), 'yyyy년 M월')}]]의 [[${step.desc2}]] 내역이 <br>
|
||||
<strong>[[${#lists.size(list)}]]건 등록</strong> 되었습니다.
|
||||
<strong>[[${childrenCount}]]건 등록</strong> 되었습니다.
|
||||
</h3>
|
||||
</hgroup>
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<hgroup class="tit-group">
|
||||
<h3>
|
||||
[[${#temporals.format(#temporals.createDate(searchMonth+'01', 'yyyyMMdd'), 'yyyy년 M월')}]]의 [[${step.desc2}]] 내역이 <br>
|
||||
<strong>[[${#lists.size(list)}]]건 등록</strong> 되었습니다.
|
||||
<strong>[[${childrenCount}]]건 등록</strong> 되었습니다.
|
||||
</h3>
|
||||
</hgroup>
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<hgroup class="tit-group">
|
||||
<h3>
|
||||
[[${#temporals.format(#temporals.createDate(searchMonth+'01', 'yyyyMMdd'), 'yyyy년 M월')}]]의 [[${step.desc2}]] 내역이 <br>
|
||||
<strong>[[${#lists.size(list)}]]건 등록</strong> 되었습니다.
|
||||
<strong>[[${childrenCount}]]건 등록</strong> 되었습니다.
|
||||
</h3>
|
||||
</hgroup>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user