Merge branch 'dev' into first_open_fetch
@@ -29,6 +29,11 @@ public class FrontURIInterceptor implements HandlerInterceptor {
|
||||
private final URIAncestryPortIn uriAncestryPortIn;
|
||||
private final URITopTierPortIn topTierPortIn;
|
||||
|
||||
/**
|
||||
* AttributeName: currentURI
|
||||
*/
|
||||
private static final String ATTR_NAME_URI = "currentURI";
|
||||
|
||||
@Override
|
||||
public boolean preHandle(HttpServletRequest request, HttpServletResponse response,
|
||||
Object handler)
|
||||
@@ -47,7 +52,7 @@ public class FrontURIInterceptor implements HandlerInterceptor {
|
||||
throw new NoMatchingURIException(String.format("매핑되는 않은 URI - %s", requestURI));
|
||||
}
|
||||
|
||||
request.setAttribute("currentURI", currentURI);
|
||||
request.setAttribute(ATTR_NAME_URI, currentURI);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -69,8 +74,8 @@ public class FrontURIInterceptor implements HandlerInterceptor {
|
||||
URITopTier topTierOutput = topTierPortIn.connect(AppType.FRONT);
|
||||
modelAndView.addObject("topNode", recursiveMapping(topTierOutput));
|
||||
|
||||
if (modelAndView.getModelMap().getAttribute("currentURI") == null) {
|
||||
modelAndView.addObject("currentURI", request.getAttribute("currentURI"));
|
||||
if (modelAndView.getModelMap().getAttribute(ATTR_NAME_URI) == null) {
|
||||
modelAndView.addObject(ATTR_NAME_URI, request.getAttribute(ATTR_NAME_URI));
|
||||
}
|
||||
|
||||
modelAndView.addObject(
|
||||
@@ -86,6 +91,6 @@ public class FrontURIInterceptor implements HandlerInterceptor {
|
||||
output.getShowOnNavi(),
|
||||
CollectionUtils.emptyIfNull(output.getChildren()).stream()
|
||||
.map(this::recursiveMapping)
|
||||
.collect(Collectors.toList()));
|
||||
.toList());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ public class FrontDetailService implements UserDetailsService {
|
||||
private Collection<? extends GrantedAuthority> getAuthorities(Collection<CoreRole> roles) {
|
||||
return Stream.concat(getRoles(roles), getPrivileges(roles))
|
||||
.map(SimpleGrantedAuthority::new)
|
||||
.collect(Collectors.toList());
|
||||
.toList();
|
||||
}
|
||||
|
||||
private Stream<String> getRoles(Collection<CoreRole> roles) {
|
||||
@@ -70,17 +70,4 @@ public class FrontDetailService implements UserDetailsService {
|
||||
.flatMap(roleOutput -> roleOutput.getPrivileges().stream())
|
||||
.map(CorePrivilege::getId);
|
||||
}
|
||||
|
||||
// 패스워드 만료 여부체크. 이 기능이 필요하지 않다면 항상 true 를 반환하도록 변경하면 된다.
|
||||
private boolean isCredentialsNonExpired(LocalDateTime passwordUpdatedAt) {
|
||||
// return passwordValidPeriodDays == -1
|
||||
// || getDaysPassedFrom(passwordUpdatedAt) <= passwordValidPeriodDays;
|
||||
return true;
|
||||
}
|
||||
|
||||
// 패스워드 만료일 정보를 반환. 이 기능이 필요하지 않다면 항상 0L 을 반환하도록 변경하면 된다.
|
||||
private long getDaysPassedFrom(LocalDateTime passwordUpdatedAt) {
|
||||
// return Duration.between(passwordUpdatedAt, LocalDateTime.now()).toDays();
|
||||
return 0L;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,19 +8,22 @@ import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class AuthUtil {
|
||||
public static Long getUserSeq() {
|
||||
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
|
||||
if (authentication == null) {
|
||||
return null;
|
||||
private AuthUtil() {
|
||||
}
|
||||
|
||||
Object principal = authentication.getPrincipal();
|
||||
Long userseq = null;
|
||||
public static Long getUserSeq() {
|
||||
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
|
||||
if (authentication == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (principal instanceof UserDetails) {
|
||||
userseq = ((FrontHouseholdUser) principal).getHouseholdSeq();
|
||||
Object principal = authentication.getPrincipal();
|
||||
Long userseq = null;
|
||||
|
||||
if (principal instanceof UserDetails) {
|
||||
userseq = ((FrontHouseholdUser) principal).getHouseholdSeq();
|
||||
}
|
||||
|
||||
return userseq;
|
||||
}
|
||||
|
||||
return userseq;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.YearMonth;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
@@ -48,12 +49,17 @@ public class RecordCalendarDao implements RecordCalendarPortOut {
|
||||
monthlyStatus.isForestNone() ? 0 : 1,
|
||||
monthlyStatus.isForestNone() ? "/info/monthly" : String.format("/info/monthly/month/%s", command.getSearchMonth())));
|
||||
|
||||
YearMonth yearMonth = YearMonth.parse(command.getSearchMonth(), DateTimeFormatter.ofPattern("yyyyMM"));
|
||||
LocalDate maxMonth = DailyRecordConstants.MODIFY_LIMIT_DAY == 31 ?
|
||||
yearMonth.plusMonths(DailyRecordConstants.MODIFY_LIMIT_MONTH).atEndOfMonth() : yearMonth.plusMonths(DailyRecordConstants.MODIFY_LIMIT_MONTH).atDay(DailyRecordConstants.MODIFY_LIMIT_DAY);
|
||||
boolean editable = !LocalDate.now().isAfter(maxMonth);
|
||||
|
||||
monthlyList.add(new CalendarChildren(
|
||||
"BANK",
|
||||
"은행 자동이체 내역 등록",
|
||||
null,
|
||||
monthlyStatus.isBankNone() ? 0 : 1,
|
||||
(LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMM")).equals(command.getSearchMonth())) ? "/info/bank" : null));
|
||||
editable ? String.format("/info/bank/%s", command.getSearchMonth()) : null));
|
||||
|
||||
List<RecordCalendar> refineList = new ArrayList<>();
|
||||
for (DailyRecordCalendarDto calendar : calendarList) {
|
||||
@@ -156,10 +162,8 @@ public class RecordCalendarDao implements RecordCalendarPortOut {
|
||||
|
||||
@Override
|
||||
public int getDataNoneCountBySomeDayAfter(Long householdSeq) {
|
||||
// 검색 당일을 제외하여 -1 처리
|
||||
int limitDay = DailyRecordConstants.REGISTER_LIMIT_DAY - 1;
|
||||
|
||||
return recordCalendarMapper.getDataNoneCountBySomeDayAfter(householdSeq, limitDay);
|
||||
LocalDate limitDate = dailyUtil.getLimitDate();
|
||||
return recordCalendarMapper.getDataNoneCountBySomeDayAfter(householdSeq, limitDate);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -7,6 +7,7 @@ import app.module.front.usecase.daily.calendar.ports.application.domain.RecordCa
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
@@ -38,10 +39,10 @@ public interface RecordCalendarMapper {
|
||||
* 등록가능 기간에 미등록된 데이터 개수 조회
|
||||
*
|
||||
* @param householdSeq 임가회원 일련번호
|
||||
* @param limitDay 전일로부터 x일전 검색 일
|
||||
* @param limitDate 입력 가능한 최소 날짜
|
||||
* @return 미등록 건 수
|
||||
*/
|
||||
Integer getDataNoneCountBySomeDayAfter(@Param("householdSeq") Long householdSeq, @Param("limitDay") Integer limitDay);
|
||||
Integer getDataNoneCountBySomeDayAfter(@Param("householdSeq") Long householdSeq, @Param("limitDate") LocalDate limitDate);
|
||||
|
||||
/**
|
||||
* 최신 등록일 데이터 조회
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package app.module.front.usecase.daily.expense.adapters.web;
|
||||
|
||||
import app.module.core.config.application.exception.NoRecordDataException;
|
||||
import app.module.core.config.application.logging.SafeLogger;
|
||||
import app.module.core.config.application.util.CoreUtil;
|
||||
import app.module.core.usecase.daily.record.adapters.persistence.model.DailyRecordDto;
|
||||
import app.module.core.usecase.daily.record.ports.DailyRecordPortIn;
|
||||
@@ -11,17 +12,19 @@ import app.module.front.usecase.daily.expense.ports.DailyExpensePortIn;
|
||||
import app.module.front.usecase.daily.record.adapters.web.model.DailyUIReqVO;
|
||||
import jakarta.validation.Valid;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping(path = "/api/record/expense")
|
||||
public class DailyExpenseController {
|
||||
SafeLogger safeLogger = new SafeLogger(LoggerFactory.getLogger(DailyExpenseController.class));
|
||||
|
||||
private final CoreUtil coreUtil;
|
||||
private final DailyRecordPortIn dailyRecordPortIn;
|
||||
private final DailyExpensePortIn dailyExpensePortIn;
|
||||
@@ -52,7 +55,7 @@ public class DailyExpenseController {
|
||||
formVO.setGroupNo(Integer.parseInt(groupNo));
|
||||
formVO.setId(Long.parseLong(id));
|
||||
formVO.setDailyRecordSeq(dailyRecord.getId());
|
||||
log.debug("formVO: {}", formVO);
|
||||
safeLogger.debug("createFormVO: {}", formVO);
|
||||
|
||||
dailyExpensePortIn.create(formVO);
|
||||
|
||||
@@ -71,7 +74,7 @@ public class DailyExpenseController {
|
||||
ResponseEntity<?> remove(@PathVariable("searchMonth") String searchMonth, @PathVariable("groupNo") String groupNo
|
||||
, @Valid @RequestBody RemoveDailyExpenseReqVO formVO, BindingResult bindingResult) {
|
||||
|
||||
log.debug("before formVO: {}", formVO);
|
||||
safeLogger.debug("before formVO: {}", formVO);
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResponseEntity.status(HttpStatus.UNPROCESSABLE_ENTITY)
|
||||
.body(bindingResult.getFieldErrors());
|
||||
@@ -82,7 +85,7 @@ public class DailyExpenseController {
|
||||
formVO.setSearchMonth(dailyRecord.getRecordMonth());
|
||||
formVO.setGroupNo(dailyRecord.getGroupNo());
|
||||
formVO.setDailyRecordSeq(dailyRecord.getId());
|
||||
log.debug("formVO: {}", formVO);
|
||||
safeLogger.debug("removeFormVO: {}", formVO);
|
||||
|
||||
dailyExpensePortIn.remove(formVO);
|
||||
|
||||
@@ -104,7 +107,7 @@ public class DailyExpenseController {
|
||||
formVO.setSearchMonth(dailyRecord.getRecordMonth());
|
||||
formVO.setGroupNo(dailyRecord.getGroupNo());
|
||||
formVO.setDailyRecordSeq(dailyRecord.getId());
|
||||
log.debug("formVO: {}", formVO);
|
||||
safeLogger.debug("removeAllFormVO: {}", formVO);
|
||||
|
||||
dailyExpensePortIn.remove(formVO);
|
||||
|
||||
@@ -119,7 +122,7 @@ public class DailyExpenseController {
|
||||
*/
|
||||
private DailyRecordDto vaildGetDailyRecord(String searchMonth, String groupNo) {
|
||||
DailyUIReqVO reqVO = new DailyUIReqVO(searchMonth, groupNo);
|
||||
log.debug("getRecordUIReq: {}", reqVO);
|
||||
safeLogger.debug("getRecordUIReq: {}", reqVO);
|
||||
|
||||
DailyRecordDto dailyRecord = dailyRecordPortIn.detail(reqVO.getSearchMonth(), reqVO.getGroupNo(), reqVO.getHouseholdSeq());
|
||||
if (dailyRecord == null || dailyRecord.getId() == null) {
|
||||
|
||||
@@ -2,6 +2,7 @@ package app.module.front.usecase.daily.expense.adapters.web;
|
||||
|
||||
import app.module.core.config.application.enums.DailySort;
|
||||
import app.module.core.config.application.exception.NoRecordDataException;
|
||||
import app.module.core.config.application.logging.SafeLogger;
|
||||
import app.module.core.usecase.daily.record.adapters.persistence.model.DailyRecordDto;
|
||||
import app.module.core.usecase.daily.record.ports.DailyRecordPortIn;
|
||||
import app.module.core.usecase.uicode.list.ports.UICodeListPortIn;
|
||||
@@ -10,7 +11,8 @@ import app.module.front.usecase.daily.expense.adapters.web.model.DailyExpenseUIR
|
||||
import app.module.front.usecase.daily.expense.ports.DailyExpensePortIn;
|
||||
import app.module.front.usecase.daily.record.adapters.web.model.DailyUIReqVO;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@@ -22,11 +24,12 @@ import org.thymeleaf.util.StringUtils;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@Controller
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping(path = "/record/expense")
|
||||
public class DailyExpenseUIController {
|
||||
SafeLogger safeLogger = new SafeLogger(LoggerFactory.getLogger(DailyExpenseUIController.class));
|
||||
|
||||
private final UICodeListPortIn uiCodeListPortIn;
|
||||
private final DailyRecordPortIn dailyRecordPortIn;
|
||||
private final DailyExpensePortIn dailyExpensePortIn;
|
||||
@@ -48,7 +51,7 @@ public class DailyExpenseUIController {
|
||||
DailyRecordDto dailyRecord = this.vaildGetDailyRecord(searchMonth, groupNo, targetList);
|
||||
|
||||
DailyExpenseUIReqVO reqVO = new DailyExpenseUIReqVO(searchMonth, groupNo);
|
||||
log.debug("reqVO: {}", reqVO);
|
||||
safeLogger.debug("reqVO: {}", reqVO);
|
||||
|
||||
List<DailyExpenseDto> expenseList = dailyExpensePortIn.list(reqVO);
|
||||
|
||||
@@ -79,7 +82,7 @@ public class DailyExpenseUIController {
|
||||
} else {
|
||||
reqVO.setId(Long.parseLong(id));
|
||||
}
|
||||
log.debug("reqVO: {}", reqVO);
|
||||
safeLogger.debug("reqVO: {}", reqVO);
|
||||
|
||||
DailyExpenseDto detail = new DailyExpenseDto();
|
||||
if (reqVO.getId() != 0L) {
|
||||
@@ -106,7 +109,7 @@ public class DailyExpenseUIController {
|
||||
*/
|
||||
private DailyRecordDto vaildGetDailyRecord(String searchMonth, String groupNo, String targetList) {
|
||||
DailyUIReqVO reqVO = new DailyUIReqVO(searchMonth, groupNo);
|
||||
log.debug("getRecordUIReq: {}", reqVO);
|
||||
safeLogger.debug("getRecordUIReq: {}", reqVO);
|
||||
|
||||
DailyRecordDto dailyRecord = dailyRecordPortIn.detail(reqVO.getSearchMonth(), reqVO.getGroupNo(), reqVO.getHouseholdSeq());
|
||||
if (dailyRecord == null || dailyRecord.getId() == null) {
|
||||
|
||||
@@ -23,28 +23,28 @@ public class CreateDailyExpenseValidator implements Validator {
|
||||
|
||||
if (vo.getQuantity() == null && !StringUtils.isBlank(vo.getUnitCode())) {
|
||||
errors.rejectValue(
|
||||
"quantity", "valid.common.required",
|
||||
"quantity", CommonConstants.VALID_CODE_NOTBLANK,
|
||||
"수량을 입력해 주세요.");
|
||||
}
|
||||
|
||||
if (vo.getQuantity() != null && StringUtils.isBlank(vo.getUnitCode())) {
|
||||
errors.rejectValue(
|
||||
"unitCode", "valid.common.required",
|
||||
"unitCode", CommonConstants.VALID_CODE_NOTBLANK,
|
||||
"단위를 선택해 주세요.");
|
||||
}
|
||||
|
||||
if (CommonConstants.UNIT_CODE_SELF.equals(vo.getUnitCode()) && StringUtils.isBlank(vo.getUnitSelf())) {
|
||||
errors.rejectValue(
|
||||
"unitSelf", "valid.common.required",
|
||||
"unitSelf", CommonConstants.VALID_CODE_NOTBLANK,
|
||||
"단위를 입력해 주세요.");
|
||||
}
|
||||
|
||||
if (vo.getPrice() == null && vo.getEstimatedValue() == null) {
|
||||
errors.rejectValue(
|
||||
"price", "valid.common.required",
|
||||
"price", CommonConstants.VALID_CODE_NOTBLANK,
|
||||
"현금 또는 현물평가액을 입력해 주세요.");
|
||||
errors.rejectValue(
|
||||
"estimatedValue", "valid.common.required",
|
||||
"estimatedValue", CommonConstants.VALID_CODE_NOTBLANK,
|
||||
"현금 또는 현물평가액을 입력해 주세요.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package app.module.front.usecase.daily.farming.adapters.web;
|
||||
|
||||
import app.module.core.config.application.exception.NoRecordDataException;
|
||||
import app.module.core.config.application.logging.SafeLogger;
|
||||
import app.module.core.config.application.util.CoreUtil;
|
||||
import app.module.core.usecase.daily.record.adapters.persistence.model.DailyRecordDto;
|
||||
import app.module.core.usecase.daily.record.ports.DailyRecordPortIn;
|
||||
@@ -11,17 +12,19 @@ import app.module.front.usecase.daily.farming.ports.application.DailyFarmingServ
|
||||
import app.module.front.usecase.daily.record.adapters.web.model.DailyUIReqVO;
|
||||
import jakarta.validation.Valid;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping(path = "/api/record/farming")
|
||||
public class DailyFarmingController {
|
||||
SafeLogger safeLogger = new SafeLogger(LoggerFactory.getLogger(DailyFarmingController.class));
|
||||
|
||||
private final CoreUtil coreUtil;
|
||||
private final DailyRecordPortIn dailyRecordPortIn;
|
||||
private final DailyFarmingService dailyFarmingPortIn;
|
||||
@@ -52,7 +55,7 @@ public class DailyFarmingController {
|
||||
formVO.setGroupNo(Integer.parseInt(groupNo));
|
||||
formVO.setId(Long.parseLong(id));
|
||||
formVO.setDailyRecordSeq(dailyRecord.getId());
|
||||
log.debug("formVO: {}", formVO);
|
||||
safeLogger.debug("createFormVO: {}", formVO);
|
||||
|
||||
dailyFarmingPortIn.create(formVO);
|
||||
|
||||
@@ -71,7 +74,7 @@ public class DailyFarmingController {
|
||||
ResponseEntity<?> remove(@PathVariable("searchMonth") String searchMonth, @PathVariable("groupNo") String groupNo
|
||||
, @Valid @RequestBody RemoveDailyFarmingReqVO formVO, BindingResult bindingResult) {
|
||||
|
||||
log.debug("before formVO: {}", formVO);
|
||||
safeLogger.debug("before formVO: {}", formVO);
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResponseEntity.status(HttpStatus.UNPROCESSABLE_ENTITY)
|
||||
.body(bindingResult.getFieldErrors());
|
||||
@@ -82,7 +85,7 @@ public class DailyFarmingController {
|
||||
formVO.setSearchMonth(dailyRecord.getRecordMonth());
|
||||
formVO.setGroupNo(dailyRecord.getGroupNo());
|
||||
formVO.setDailyRecordSeq(dailyRecord.getId());
|
||||
log.debug("formVO: {}", formVO);
|
||||
safeLogger.debug("removeFormVO: {}", formVO);
|
||||
|
||||
dailyFarmingPortIn.remove(formVO);
|
||||
|
||||
@@ -104,7 +107,7 @@ public class DailyFarmingController {
|
||||
formVO.setSearchMonth(dailyRecord.getRecordMonth());
|
||||
formVO.setGroupNo(dailyRecord.getGroupNo());
|
||||
formVO.setDailyRecordSeq(dailyRecord.getId());
|
||||
log.debug("formVO: {}", formVO);
|
||||
safeLogger.debug("removeAllFormVO: {}", formVO);
|
||||
|
||||
dailyFarmingPortIn.remove(formVO);
|
||||
|
||||
@@ -119,7 +122,7 @@ public class DailyFarmingController {
|
||||
*/
|
||||
private DailyRecordDto vaildGetDailyRecord(String searchMonth, String groupNo) {
|
||||
DailyUIReqVO reqVO = new DailyUIReqVO(searchMonth, groupNo);
|
||||
log.debug("getRecordUIReq: {}", reqVO);
|
||||
safeLogger.debug("getRecordUIReq: {}", reqVO);
|
||||
|
||||
DailyRecordDto dailyRecord = dailyRecordPortIn.detail(reqVO.getSearchMonth(), reqVO.getGroupNo(), reqVO.getHouseholdSeq());
|
||||
if (dailyRecord == null || dailyRecord.getId() == null) {
|
||||
|
||||
@@ -2,6 +2,7 @@ package app.module.front.usecase.daily.farming.adapters.web;
|
||||
|
||||
import app.module.core.config.application.enums.DailySort;
|
||||
import app.module.core.config.application.exception.NoRecordDataException;
|
||||
import app.module.core.config.application.logging.SafeLogger;
|
||||
import app.module.core.usecase.daily.record.adapters.persistence.model.DailyRecordDto;
|
||||
import app.module.core.usecase.daily.record.ports.DailyRecordPortIn;
|
||||
import app.module.core.usecase.uicode.list.ports.UICodeListPortIn;
|
||||
@@ -10,7 +11,8 @@ import app.module.front.usecase.daily.farming.adapters.web.model.DailyFarmingUIR
|
||||
import app.module.front.usecase.daily.farming.ports.application.DailyFarmingService;
|
||||
import app.module.front.usecase.daily.record.adapters.web.model.DailyUIReqVO;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@@ -22,11 +24,12 @@ import org.thymeleaf.util.StringUtils;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@Controller
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping(path = "/record/farming")
|
||||
public class DailyFarmingUIController {
|
||||
SafeLogger safeLogger = new SafeLogger(LoggerFactory.getLogger(DailyFarmingUIController.class));
|
||||
|
||||
private final UICodeListPortIn uiCodeListPortIn;
|
||||
private final DailyRecordPortIn dailyRecordPortIn;
|
||||
private final DailyFarmingService dailyFarmingPortIn;
|
||||
@@ -48,7 +51,7 @@ public class DailyFarmingUIController {
|
||||
DailyRecordDto dailyRecord = this.vaildGetDailyRecord(searchMonth, groupNo, targetList);
|
||||
|
||||
DailyFarmingUIReqVO reqVO = new DailyFarmingUIReqVO(searchMonth, groupNo);
|
||||
log.debug("reqVO: {}", reqVO);
|
||||
safeLogger.debug("reqVO: {}", reqVO);
|
||||
|
||||
List<DailyFarmingDto> farmingList = dailyFarmingPortIn.list(reqVO);
|
||||
|
||||
@@ -79,7 +82,7 @@ public class DailyFarmingUIController {
|
||||
} else {
|
||||
reqVO.setId(Long.parseLong(id));
|
||||
}
|
||||
log.debug("reqVO: {}", reqVO);
|
||||
safeLogger.debug("reqVO: {}", reqVO);
|
||||
|
||||
DailyFarmingDto detail = new DailyFarmingDto();
|
||||
if (reqVO.getId() != 0L) {
|
||||
@@ -106,7 +109,7 @@ public class DailyFarmingUIController {
|
||||
*/
|
||||
private DailyRecordDto vaildGetDailyRecord(String searchMonth, String groupNo, String targetList) {
|
||||
DailyUIReqVO reqVO = new DailyUIReqVO(searchMonth, groupNo);
|
||||
log.debug("getRecordUIReq: {}", reqVO);
|
||||
safeLogger.debug("getRecordUIReq: {}", reqVO);
|
||||
|
||||
DailyRecordDto dailyRecord = dailyRecordPortIn.detail(reqVO.getSearchMonth(), reqVO.getGroupNo(), reqVO.getHouseholdSeq());
|
||||
if (dailyRecord == null || dailyRecord.getId() == null) {
|
||||
|
||||
@@ -23,31 +23,31 @@ public class CreateDailyFarmingValidator implements Validator {
|
||||
|
||||
if ("code.record.farming.self".equals(vo.getProductCode()) && StringUtils.isBlank(vo.getProductSelf())) {
|
||||
errors.rejectValue(
|
||||
"productSelf", "valid.common.required",
|
||||
"productSelf", CommonConstants.VALID_CODE_NOTBLANK,
|
||||
"생산물을 입력해 주세요.");
|
||||
}
|
||||
|
||||
if (vo.getQuantity() == null && !StringUtils.isBlank(vo.getUnitCode())) {
|
||||
errors.rejectValue(
|
||||
"quantity", "valid.common.required",
|
||||
"quantity", CommonConstants.VALID_CODE_NOTBLANK,
|
||||
"수량을 입력해 주세요.");
|
||||
}
|
||||
|
||||
if (vo.getQuantity() != null && StringUtils.isBlank(vo.getUnitCode())) {
|
||||
errors.rejectValue(
|
||||
"unitCode", "valid.common.required",
|
||||
"unitCode", CommonConstants.VALID_CODE_NOTBLANK,
|
||||
"단위를 선택해 주세요.");
|
||||
}
|
||||
|
||||
if (CommonConstants.UNIT_CODE_SELF.equals(vo.getUnitCode()) && StringUtils.isBlank(vo.getUnitSelf())) {
|
||||
errors.rejectValue(
|
||||
"unitSelf", "valid.common.required",
|
||||
"unitSelf", CommonConstants.VALID_CODE_NOTBLANK,
|
||||
"단위를 입력해 주세요.");
|
||||
}
|
||||
|
||||
if (vo.getEstimatedValue() == null) {
|
||||
errors.rejectValue(
|
||||
"estimatedValue", "valid.common.required",
|
||||
"estimatedValue", CommonConstants.VALID_CODE_NOTBLANK,
|
||||
"현물평가액을 입력해 주세요.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package app.module.front.usecase.daily.forestry.adapters.web;
|
||||
|
||||
import app.module.core.config.application.exception.NoRecordDataException;
|
||||
import app.module.core.config.application.logging.SafeLogger;
|
||||
import app.module.core.config.application.util.CoreUtil;
|
||||
import app.module.core.usecase.daily.record.adapters.persistence.model.DailyRecordDto;
|
||||
import app.module.core.usecase.daily.record.ports.DailyRecordPortIn;
|
||||
@@ -11,17 +12,19 @@ import app.module.front.usecase.daily.forestry.ports.DailyForestryPortIn;
|
||||
import app.module.front.usecase.daily.record.adapters.web.model.DailyUIReqVO;
|
||||
import jakarta.validation.Valid;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping(path = "/api/record/forestry")
|
||||
public class DailyForestryController {
|
||||
SafeLogger safeLogger = new SafeLogger(LoggerFactory.getLogger(DailyForestryController.class));
|
||||
|
||||
private final CoreUtil coreUtil;
|
||||
private final DailyRecordPortIn dailyRecordService;
|
||||
private final DailyForestryPortIn dailyForestryPortIn;
|
||||
@@ -52,7 +55,7 @@ public class DailyForestryController {
|
||||
formVO.setGroupNo(Integer.parseInt(groupNo));
|
||||
formVO.setId(Long.parseLong(id));
|
||||
formVO.setDailyRecordSeq(dailyRecord.getId());
|
||||
log.debug("formVO: {}", formVO);
|
||||
safeLogger.debug("createFormVO: {}", formVO);
|
||||
|
||||
dailyForestryPortIn.create(formVO);
|
||||
|
||||
@@ -71,7 +74,7 @@ public class DailyForestryController {
|
||||
ResponseEntity<?> remove(@PathVariable("searchMonth") String searchMonth, @PathVariable("groupNo") String groupNo
|
||||
, @Valid @RequestBody RemoveDailyForestryReqVO formVO, BindingResult bindingResult) {
|
||||
|
||||
log.debug("before formVO: {}", formVO);
|
||||
safeLogger.debug("before formVO: {}", formVO);
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResponseEntity.status(HttpStatus.UNPROCESSABLE_ENTITY)
|
||||
.body(bindingResult.getFieldErrors());
|
||||
@@ -82,7 +85,7 @@ public class DailyForestryController {
|
||||
formVO.setSearchMonth(dailyRecord.getRecordMonth());
|
||||
formVO.setGroupNo(dailyRecord.getGroupNo());
|
||||
formVO.setDailyRecordSeq(dailyRecord.getId());
|
||||
log.debug("formVO: {}", formVO);
|
||||
safeLogger.debug("removeFormVO: {}", formVO);
|
||||
|
||||
dailyForestryPortIn.remove(formVO);
|
||||
|
||||
@@ -104,7 +107,7 @@ public class DailyForestryController {
|
||||
formVO.setSearchMonth(dailyRecord.getRecordMonth());
|
||||
formVO.setGroupNo(dailyRecord.getGroupNo());
|
||||
formVO.setDailyRecordSeq(dailyRecord.getId());
|
||||
log.debug("formVO: {}", formVO);
|
||||
safeLogger.debug("removeAllFormVO: {}", formVO);
|
||||
|
||||
dailyForestryPortIn.remove(formVO);
|
||||
|
||||
@@ -119,7 +122,7 @@ public class DailyForestryController {
|
||||
*/
|
||||
private DailyRecordDto vaildGetDailyRecord(String searchMonth, String groupNo) {
|
||||
DailyUIReqVO reqVO = new DailyUIReqVO(searchMonth, groupNo);
|
||||
log.debug("getRecordUIReq: {}", reqVO);
|
||||
safeLogger.debug("getRecordUIReq: {}", reqVO);
|
||||
|
||||
DailyRecordDto dailyRecord = dailyRecordService.detail(reqVO.getSearchMonth(), reqVO.getGroupNo(), reqVO.getHouseholdSeq());
|
||||
if (dailyRecord == null || dailyRecord.getId() == null) {
|
||||
|
||||
@@ -2,6 +2,7 @@ package app.module.front.usecase.daily.forestry.adapters.web;
|
||||
|
||||
import app.module.core.config.application.enums.DailySort;
|
||||
import app.module.core.config.application.exception.NoRecordDataException;
|
||||
import app.module.core.config.application.logging.SafeLogger;
|
||||
import app.module.core.usecase.daily.record.adapters.persistence.model.DailyRecordDto;
|
||||
import app.module.core.usecase.daily.record.ports.DailyRecordPortIn;
|
||||
import app.module.core.usecase.uicode.list.ports.UICodeListPortIn;
|
||||
@@ -10,7 +11,8 @@ import app.module.front.usecase.daily.forestry.adapters.web.model.DailyForestryU
|
||||
import app.module.front.usecase.daily.forestry.ports.DailyForestryPortIn;
|
||||
import app.module.front.usecase.daily.record.adapters.web.model.DailyUIReqVO;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@@ -22,11 +24,12 @@ import org.thymeleaf.util.StringUtils;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@Controller
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping(path = "/record/forestry")
|
||||
public class DailyForestryUIController {
|
||||
SafeLogger safeLogger = new SafeLogger(LoggerFactory.getLogger(DailyForestryUIController.class));
|
||||
|
||||
private final UICodeListPortIn uiCodeListPortIn;
|
||||
private final DailyRecordPortIn dailyRecordPortIn;
|
||||
private final DailyForestryPortIn dailyForestryPortIn;
|
||||
@@ -48,7 +51,7 @@ public class DailyForestryUIController {
|
||||
DailyRecordDto dailyRecord = this.vaildGetDailyRecord(searchMonth, groupNo, targetList);
|
||||
|
||||
DailyForestryUIReqVO reqVO = new DailyForestryUIReqVO(searchMonth, groupNo);
|
||||
log.debug("reqVO: {}", reqVO);
|
||||
safeLogger.debug("reqVO: {}", reqVO);
|
||||
|
||||
List<DailyForestryDto> forestryList = dailyForestryPortIn.list(reqVO);
|
||||
|
||||
@@ -79,7 +82,7 @@ public class DailyForestryUIController {
|
||||
} else {
|
||||
reqVO.setId(Long.parseLong(id));
|
||||
}
|
||||
log.debug("reqVO: {}", reqVO);
|
||||
safeLogger.debug("reqVO: {}", reqVO);
|
||||
|
||||
DailyForestryDto detail = new DailyForestryDto();
|
||||
if (reqVO.getId() != 0L) {
|
||||
@@ -106,7 +109,7 @@ public class DailyForestryUIController {
|
||||
*/
|
||||
private DailyRecordDto vaildGetDailyRecord(String searchMonth, String groupNo, String targetList) {
|
||||
DailyUIReqVO reqVO = new DailyUIReqVO(searchMonth, groupNo);
|
||||
log.debug("getRecordUIReq: {}", reqVO);
|
||||
safeLogger.debug("getRecordUIReq: {}", reqVO);
|
||||
|
||||
DailyRecordDto dailyRecord = dailyRecordPortIn.detail(reqVO.getSearchMonth(), reqVO.getGroupNo(), reqVO.getHouseholdSeq());
|
||||
if (dailyRecord == null || dailyRecord.getId() == null) {
|
||||
|
||||
@@ -23,25 +23,25 @@ public class CreateDailyForestryValidator implements Validator {
|
||||
|
||||
if (vo.getQuantity() == null && !StringUtils.isBlank(vo.getUnitCode())) {
|
||||
errors.rejectValue(
|
||||
"quantity", "valid.common.required",
|
||||
"quantity", CommonConstants.VALID_CODE_NOTBLANK,
|
||||
"수량을 입력해 주세요.");
|
||||
}
|
||||
|
||||
if (vo.getQuantity() != null && StringUtils.isBlank(vo.getUnitCode())) {
|
||||
errors.rejectValue(
|
||||
"unitCode", "valid.common.required",
|
||||
"unitCode", CommonConstants.VALID_CODE_NOTBLANK,
|
||||
"단위를 선택해 주세요.");
|
||||
}
|
||||
|
||||
if (CommonConstants.UNIT_CODE_SELF.equals(vo.getUnitCode()) && StringUtils.isBlank(vo.getUnitSelf())) {
|
||||
errors.rejectValue(
|
||||
"unitSelf", "valid.common.required",
|
||||
"unitSelf", CommonConstants.VALID_CODE_NOTBLANK,
|
||||
"단위를 입력해 주세요.");
|
||||
}
|
||||
|
||||
if (vo.getEstimatedValue() == null) {
|
||||
errors.rejectValue(
|
||||
"estimatedValue", "valid.common.required",
|
||||
"estimatedValue", CommonConstants.VALID_CODE_NOTBLANK,
|
||||
"현물평가액을 입력해 주세요.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ public class DailyForestryService implements DailyForestryPortIn {
|
||||
|
||||
@Override
|
||||
public List<DailyForestryDto> list(DailyForestryUIReqVO reqVO) {
|
||||
return this.getRefineList(reqVO, false);
|
||||
return this.getRefineList(reqVO, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package app.module.front.usecase.daily.income.adapters.web;
|
||||
|
||||
import app.module.core.config.application.exception.NoRecordDataException;
|
||||
import app.module.core.config.application.logging.SafeLogger;
|
||||
import app.module.core.config.application.util.CoreUtil;
|
||||
import app.module.core.usecase.daily.record.adapters.persistence.model.DailyRecordDto;
|
||||
import app.module.core.usecase.daily.record.ports.DailyRecordPortIn;
|
||||
@@ -11,17 +12,19 @@ import app.module.front.usecase.daily.income.ports.DailyIncomePortIn;
|
||||
import app.module.front.usecase.daily.record.adapters.web.model.DailyUIReqVO;
|
||||
import jakarta.validation.Valid;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping(path = "/api/record/income")
|
||||
public class DailyIncomeController {
|
||||
SafeLogger safeLogger = new SafeLogger(LoggerFactory.getLogger(DailyIncomeController.class));
|
||||
|
||||
private final CoreUtil coreUtil;
|
||||
private final DailyRecordPortIn dailyRecordPortIn;
|
||||
private final DailyIncomePortIn dailyIncomePortIn;
|
||||
@@ -52,7 +55,7 @@ public class DailyIncomeController {
|
||||
formVO.setGroupNo(Integer.parseInt(groupNo));
|
||||
formVO.setId(Long.parseLong(id));
|
||||
formVO.setDailyRecordSeq(dailyRecord.getId());
|
||||
log.debug("formVO: {}", formVO);
|
||||
safeLogger.debug("createFormVO: {}", formVO);
|
||||
|
||||
dailyIncomePortIn.create(formVO);
|
||||
|
||||
@@ -71,7 +74,7 @@ public class DailyIncomeController {
|
||||
ResponseEntity<?> remove(@PathVariable("searchMonth") String searchMonth, @PathVariable("groupNo") String groupNo
|
||||
, @Valid @RequestBody RemoveDailyIncomeReqVO formVO, BindingResult bindingResult) {
|
||||
|
||||
log.debug("before formVO: {}", formVO);
|
||||
safeLogger.debug("before formVO: {}", formVO);
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResponseEntity.status(HttpStatus.UNPROCESSABLE_ENTITY)
|
||||
.body(bindingResult.getFieldErrors());
|
||||
@@ -82,7 +85,7 @@ public class DailyIncomeController {
|
||||
formVO.setSearchMonth(dailyRecord.getRecordMonth());
|
||||
formVO.setGroupNo(dailyRecord.getGroupNo());
|
||||
formVO.setDailyRecordSeq(dailyRecord.getId());
|
||||
log.debug("formVO: {}", formVO);
|
||||
safeLogger.debug("removeFormVO: {}", formVO);
|
||||
|
||||
dailyIncomePortIn.remove(formVO);
|
||||
|
||||
@@ -104,7 +107,7 @@ public class DailyIncomeController {
|
||||
formVO.setSearchMonth(dailyRecord.getRecordMonth());
|
||||
formVO.setGroupNo(dailyRecord.getGroupNo());
|
||||
formVO.setDailyRecordSeq(dailyRecord.getId());
|
||||
log.debug("formVO: {}", formVO);
|
||||
safeLogger.debug("removeAllFormVO: {}", formVO);
|
||||
|
||||
dailyIncomePortIn.remove(formVO);
|
||||
|
||||
@@ -119,7 +122,7 @@ public class DailyIncomeController {
|
||||
*/
|
||||
private DailyRecordDto vaildGetDailyRecord(String searchMonth, String groupNo) {
|
||||
DailyUIReqVO reqVO = new DailyUIReqVO(searchMonth, groupNo);
|
||||
log.debug("getRecordUIReq: {}", reqVO);
|
||||
safeLogger.debug("getRecordUIReq: {}", reqVO);
|
||||
|
||||
DailyRecordDto dailyRecord = dailyRecordPortIn.detail(reqVO.getSearchMonth(), reqVO.getGroupNo(), reqVO.getHouseholdSeq());
|
||||
if (dailyRecord == null || dailyRecord.getId() == null) {
|
||||
|
||||
@@ -2,6 +2,7 @@ package app.module.front.usecase.daily.income.adapters.web;
|
||||
|
||||
import app.module.core.config.application.enums.DailySort;
|
||||
import app.module.core.config.application.exception.NoRecordDataException;
|
||||
import app.module.core.config.application.logging.SafeLogger;
|
||||
import app.module.core.usecase.daily.record.adapters.persistence.model.DailyRecordDto;
|
||||
import app.module.core.usecase.daily.record.ports.DailyRecordPortIn;
|
||||
import app.module.core.usecase.uicode.list.ports.UICodeListPortIn;
|
||||
@@ -10,8 +11,9 @@ import app.module.front.usecase.daily.income.adapters.web.model.DailyIncomeUIReq
|
||||
import app.module.front.usecase.daily.income.ports.DailyIncomePortIn;
|
||||
import app.module.front.usecase.daily.record.adapters.web.model.DailyUIReqVO;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@@ -22,11 +24,12 @@ import org.springframework.web.bind.annotation.RequestParam;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@Controller
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping(path = "/record/income")
|
||||
public class DailyIncomeUIController {
|
||||
SafeLogger safeLogger = new SafeLogger(LoggerFactory.getLogger(DailyIncomeUIController.class));
|
||||
|
||||
private final UICodeListPortIn uiCodeListPortIn;
|
||||
private final DailyRecordPortIn dailyRecordPortIn;
|
||||
private final DailyIncomePortIn dailyIncomePortIn;
|
||||
@@ -48,7 +51,7 @@ public class DailyIncomeUIController {
|
||||
DailyRecordDto dailyRecord = this.vaildGetDailyRecord(searchMonth, groupNo, targetList);
|
||||
|
||||
DailyIncomeUIReqVO reqVO = new DailyIncomeUIReqVO(searchMonth, groupNo);
|
||||
log.debug("reqVO: {}", reqVO);
|
||||
safeLogger.debug("reqVO: {}", reqVO);
|
||||
|
||||
List<DailyIncomeDto> incomeList = dailyIncomePortIn.list(reqVO);
|
||||
|
||||
@@ -80,7 +83,7 @@ public class DailyIncomeUIController {
|
||||
} else {
|
||||
reqVO.setId(Long.parseLong(id));
|
||||
}
|
||||
log.debug("reqVO: {}", reqVO);
|
||||
safeLogger.debug("reqVO: {}", reqVO);
|
||||
|
||||
DailyIncomeDto detail = new DailyIncomeDto();
|
||||
if (reqVO.getId() != 0L) {
|
||||
@@ -107,7 +110,7 @@ public class DailyIncomeUIController {
|
||||
*/
|
||||
private DailyRecordDto vaildGetDailyRecord(String searchMonth, String groupNo, String targetList) {
|
||||
DailyUIReqVO reqVO = new DailyUIReqVO(searchMonth, groupNo);
|
||||
log.debug("getRecordUIReq: {}", reqVO);
|
||||
safeLogger.debug("getRecordUIReq: {}", reqVO);
|
||||
|
||||
DailyRecordDto dailyRecord = dailyRecordPortIn.detail(reqVO.getSearchMonth(), reqVO.getGroupNo(), reqVO.getHouseholdSeq());
|
||||
if (dailyRecord == null || dailyRecord.getId() == null) {
|
||||
|
||||
@@ -23,28 +23,28 @@ public class CreateDailyIncomeValidator implements Validator {
|
||||
|
||||
if (vo.getQuantity() == null && !StringUtils.isBlank(vo.getUnitCode())) {
|
||||
errors.rejectValue(
|
||||
"quantity", "valid.common.required",
|
||||
"quantity", CommonConstants.VALID_CODE_NOTBLANK,
|
||||
"수량을 입력해 주세요.");
|
||||
}
|
||||
|
||||
if (vo.getQuantity() != null && StringUtils.isBlank(vo.getUnitCode())) {
|
||||
errors.rejectValue(
|
||||
"unitCode", "valid.common.required",
|
||||
"unitCode", CommonConstants.VALID_CODE_NOTBLANK,
|
||||
"단위를 선택해 주세요.");
|
||||
}
|
||||
|
||||
if (CommonConstants.UNIT_CODE_SELF.equals(vo.getUnitCode()) && StringUtils.isBlank(vo.getUnitSelf())) {
|
||||
errors.rejectValue(
|
||||
"unitSelf", "valid.common.required",
|
||||
"unitSelf", CommonConstants.VALID_CODE_NOTBLANK,
|
||||
"단위를 입력해 주세요.");
|
||||
}
|
||||
|
||||
if (vo.getPrice() == null && vo.getEstimatedValue() == null) {
|
||||
errors.rejectValue(
|
||||
"price", "valid.common.required",
|
||||
"price", CommonConstants.VALID_CODE_NOTBLANK,
|
||||
"현금 또는 현물평가액을 입력해 주세요.");
|
||||
errors.rejectValue(
|
||||
"estimatedValue", "valid.common.required",
|
||||
"estimatedValue", CommonConstants.VALID_CODE_NOTBLANK,
|
||||
"현금 또는 현물평가액을 입력해 주세요.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package app.module.front.usecase.daily.power.adapters.web;
|
||||
|
||||
import app.module.core.config.application.exception.NoRecordDataException;
|
||||
import app.module.core.config.application.logging.SafeLogger;
|
||||
import app.module.core.config.application.util.CoreUtil;
|
||||
import app.module.core.usecase.daily.record.adapters.persistence.model.DailyRecordDto;
|
||||
import app.module.core.usecase.daily.record.ports.DailyRecordPortIn;
|
||||
@@ -11,17 +12,19 @@ import app.module.front.usecase.daily.power.ports.DailyPowerPortIn;
|
||||
import app.module.front.usecase.daily.record.adapters.web.model.DailyUIReqVO;
|
||||
import jakarta.validation.Valid;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping(path = "/api/record/power")
|
||||
public class DailyPowerController {
|
||||
SafeLogger safeLogger = new SafeLogger(LoggerFactory.getLogger(DailyPowerController.class));
|
||||
|
||||
private final CoreUtil coreUtil;
|
||||
private final DailyRecordPortIn dailyRecordPortIn;
|
||||
private final DailyPowerPortIn dailyPowerPortIn;
|
||||
@@ -52,7 +55,7 @@ public class DailyPowerController {
|
||||
formVO.setGroupNo(Integer.parseInt(groupNo));
|
||||
formVO.setId(Long.parseLong(id));
|
||||
formVO.setDailyRecordSeq(dailyRecord.getId());
|
||||
log.debug("formVO: {}", formVO);
|
||||
safeLogger.debug("createFormVO: {}", formVO);
|
||||
|
||||
dailyPowerPortIn.create(formVO);
|
||||
|
||||
@@ -71,7 +74,7 @@ public class DailyPowerController {
|
||||
ResponseEntity<?> remove(@PathVariable("searchMonth") String searchMonth, @PathVariable("groupNo") String groupNo
|
||||
, @Valid @RequestBody RemoveDailyPowerReqVO formVO, BindingResult bindingResult) {
|
||||
|
||||
log.debug("before formVO: {}", formVO);
|
||||
safeLogger.debug("before formVO: {}", formVO);
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResponseEntity.status(HttpStatus.UNPROCESSABLE_ENTITY)
|
||||
.body(bindingResult.getFieldErrors());
|
||||
@@ -82,7 +85,7 @@ public class DailyPowerController {
|
||||
formVO.setSearchMonth(dailyRecord.getRecordMonth());
|
||||
formVO.setGroupNo(dailyRecord.getGroupNo());
|
||||
formVO.setDailyRecordSeq(dailyRecord.getId());
|
||||
log.debug("formVO: {}", formVO);
|
||||
safeLogger.debug("removeFormVO: {}", formVO);
|
||||
|
||||
dailyPowerPortIn.remove(formVO);
|
||||
|
||||
@@ -104,7 +107,7 @@ public class DailyPowerController {
|
||||
formVO.setSearchMonth(dailyRecord.getRecordMonth());
|
||||
formVO.setGroupNo(dailyRecord.getGroupNo());
|
||||
formVO.setDailyRecordSeq(dailyRecord.getId());
|
||||
log.debug("formVO: {}", formVO);
|
||||
safeLogger.debug("removeAllFormVO: {}", formVO);
|
||||
|
||||
dailyPowerPortIn.remove(formVO);
|
||||
|
||||
@@ -119,7 +122,7 @@ public class DailyPowerController {
|
||||
*/
|
||||
private DailyRecordDto vaildGetDailyRecord(String searchMonth, String groupNo) {
|
||||
DailyUIReqVO reqVO = new DailyUIReqVO(searchMonth, groupNo);
|
||||
log.debug("getRecordUIReq: {}", reqVO);
|
||||
safeLogger.debug("getRecordUIReq: {}", reqVO);
|
||||
|
||||
DailyRecordDto dailyRecord = dailyRecordPortIn.detail(reqVO.getSearchMonth(), reqVO.getGroupNo(), reqVO.getHouseholdSeq());
|
||||
if (dailyRecord == null || dailyRecord.getId() == null) {
|
||||
|
||||
@@ -2,6 +2,7 @@ package app.module.front.usecase.daily.power.adapters.web;
|
||||
|
||||
import app.module.core.config.application.enums.DailySort;
|
||||
import app.module.core.config.application.exception.NoRecordDataException;
|
||||
import app.module.core.config.application.logging.SafeLogger;
|
||||
import app.module.core.usecase.daily.record.adapters.persistence.model.DailyRecordDto;
|
||||
import app.module.core.usecase.daily.record.ports.DailyRecordPortIn;
|
||||
import app.module.front.usecase.daily.power.adapters.persistence.model.DailyPowerDto;
|
||||
@@ -9,7 +10,8 @@ import app.module.front.usecase.daily.power.adapters.web.model.DailyPowerUIReqVO
|
||||
import app.module.front.usecase.daily.power.ports.DailyPowerPortIn;
|
||||
import app.module.front.usecase.daily.record.adapters.web.model.DailyUIReqVO;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@@ -21,11 +23,12 @@ import org.thymeleaf.util.StringUtils;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@Controller
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping(path = "/record/power")
|
||||
public class DailyPowerUIController {
|
||||
SafeLogger safeLogger = new SafeLogger(LoggerFactory.getLogger(DailyPowerUIController.class));
|
||||
|
||||
private final DailyRecordPortIn dailyRecordPortIn;
|
||||
private final DailyPowerPortIn dailyPowerPortIn;
|
||||
|
||||
@@ -46,7 +49,7 @@ public class DailyPowerUIController {
|
||||
DailyRecordDto dailyRecord = this.vaildGetDailyRecord(searchMonth, groupNo, targetList);
|
||||
|
||||
DailyPowerUIReqVO reqVO = new DailyPowerUIReqVO(searchMonth, groupNo);
|
||||
log.debug("reqVO: {}", reqVO);
|
||||
safeLogger.debug("reqVO: {}", reqVO);
|
||||
|
||||
List<DailyPowerDto> powerList = dailyPowerPortIn.list(reqVO);
|
||||
|
||||
@@ -77,7 +80,7 @@ public class DailyPowerUIController {
|
||||
} else {
|
||||
reqVO.setId(Long.parseLong(id));
|
||||
}
|
||||
log.debug("reqVO: {}", reqVO);
|
||||
safeLogger.debug("reqVO: {}", reqVO);
|
||||
|
||||
DailyPowerDto detail = new DailyPowerDto();
|
||||
if (reqVO.getId() != 0L) {
|
||||
@@ -101,7 +104,7 @@ public class DailyPowerUIController {
|
||||
*/
|
||||
private DailyRecordDto vaildGetDailyRecord(String searchMonth, String groupNo, String targetList) {
|
||||
DailyUIReqVO reqVO = new DailyUIReqVO(searchMonth, groupNo);
|
||||
log.debug("getRecordUIReq: {}", reqVO);
|
||||
safeLogger.debug("getRecordUIReq: {}", reqVO);
|
||||
|
||||
DailyRecordDto dailyRecord = dailyRecordPortIn.detail(reqVO.getSearchMonth(), reqVO.getGroupNo(), reqVO.getHouseholdSeq());
|
||||
if (dailyRecord == null || dailyRecord.getId() == null) {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package app.module.front.usecase.daily.power.adapters.web.validator;
|
||||
|
||||
import app.module.core.config.constants.CommonConstants;
|
||||
import app.module.front.usecase.daily.power.adapters.web.model.CreateDailyPowerReqVO;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -21,10 +22,10 @@ public class CreateDailyPowerValidator implements Validator {
|
||||
|
||||
if (vo.getOwnedHours() == null && vo.getLeasedHours() == null) {
|
||||
errors.rejectValue(
|
||||
"ownedHours", "valid.common.required",
|
||||
"ownedHours", CommonConstants.VALID_CODE_NOTBLANK,
|
||||
"자가 사용시간 또는 임차 사용시간을 입력해 주세요.");
|
||||
errors.rejectValue(
|
||||
"leasedHours", "valid.common.required",
|
||||
"leasedHours", CommonConstants.VALID_CODE_NOTBLANK,
|
||||
"자가 사용시간 또는 임차 사용시간을 입력해 주세요.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package app.module.front.usecase.daily.work.adapters.web;
|
||||
|
||||
import app.module.core.config.application.exception.NoRecordDataException;
|
||||
import app.module.core.config.application.logging.SafeLogger;
|
||||
import app.module.core.config.application.util.CoreUtil;
|
||||
import app.module.core.usecase.daily.record.adapters.persistence.model.DailyRecordDto;
|
||||
import app.module.core.usecase.daily.record.ports.DailyRecordPortIn;
|
||||
@@ -11,17 +12,19 @@ import app.module.front.usecase.daily.work.adapters.web.validator.CreateDailyWor
|
||||
import app.module.front.usecase.daily.work.ports.DailyWorkPortIn;
|
||||
import jakarta.validation.Valid;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping(path = "/api/record/work")
|
||||
public class DailyWorkController {
|
||||
SafeLogger safeLogger = new SafeLogger(LoggerFactory.getLogger(DailyWorkController.class));
|
||||
|
||||
private final CoreUtil coreUtil;
|
||||
private final DailyRecordPortIn dailyRecordPortIn;
|
||||
private final DailyWorkPortIn dailyWorkPortIn;
|
||||
@@ -53,7 +56,7 @@ public class DailyWorkController {
|
||||
formVO.setGroupNo(Integer.parseInt(groupNo));
|
||||
formVO.setId(Long.parseLong(id));
|
||||
formVO.setDailyRecordSeq(dailyRecord.getId());
|
||||
log.debug("formVO: {}", formVO);
|
||||
safeLogger.debug("createFormVO: {}", formVO);
|
||||
|
||||
dailyWorkPortIn.create(formVO);
|
||||
|
||||
@@ -73,7 +76,7 @@ public class DailyWorkController {
|
||||
ResponseEntity<?> remove(@PathVariable("searchMonth") String searchMonth, @PathVariable("groupNo") String groupNo
|
||||
, @Valid @RequestBody RemoveDailyWorkReqVO formVO, BindingResult bindingResult) {
|
||||
|
||||
log.debug("before formVO: {}", formVO);
|
||||
safeLogger.debug("beforeFormVO: {}", formVO);
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResponseEntity.status(HttpStatus.UNPROCESSABLE_ENTITY)
|
||||
.body(bindingResult.getFieldErrors());
|
||||
@@ -84,7 +87,7 @@ public class DailyWorkController {
|
||||
formVO.setSearchMonth(dailyRecord.getRecordMonth());
|
||||
formVO.setGroupNo(dailyRecord.getGroupNo());
|
||||
formVO.setDailyRecordSeq(dailyRecord.getId());
|
||||
log.debug("formVO: {}", formVO);
|
||||
safeLogger.debug("removeFormVO: {}", formVO);
|
||||
|
||||
dailyWorkPortIn.remove(formVO);
|
||||
|
||||
@@ -107,7 +110,7 @@ public class DailyWorkController {
|
||||
formVO.setSearchMonth(dailyRecord.getRecordMonth());
|
||||
formVO.setGroupNo(dailyRecord.getGroupNo());
|
||||
formVO.setDailyRecordSeq(dailyRecord.getId());
|
||||
log.debug("formVO: {}", formVO);
|
||||
safeLogger.debug("removeAllFormVO: {}", formVO);
|
||||
|
||||
dailyWorkPortIn.remove(formVO);
|
||||
|
||||
@@ -123,7 +126,7 @@ public class DailyWorkController {
|
||||
*/
|
||||
private DailyRecordDto vaildGetDailyRecord(String searchMonth, String groupNo) {
|
||||
DailyUIReqVO reqVO = new DailyUIReqVO(searchMonth, groupNo);
|
||||
log.debug("getRecordUIReq: {}", reqVO);
|
||||
safeLogger.debug("getRecordUIReq: {}", reqVO);
|
||||
|
||||
DailyRecordDto dailyRecord = dailyRecordPortIn.detail(reqVO.getSearchMonth(), reqVO.getGroupNo(), reqVO.getHouseholdSeq());
|
||||
if (dailyRecord == null || dailyRecord.getId() == null) {
|
||||
|
||||
@@ -2,6 +2,7 @@ package app.module.front.usecase.daily.work.adapters.web;
|
||||
|
||||
import app.module.core.config.application.enums.DailySort;
|
||||
import app.module.core.config.application.exception.NoRecordDataException;
|
||||
import app.module.core.config.application.logging.SafeLogger;
|
||||
import app.module.core.usecase.daily.record.adapters.persistence.model.DailyRecordDto;
|
||||
import app.module.core.usecase.daily.record.ports.DailyRecordPortIn;
|
||||
import app.module.core.usecase.uicode.list.ports.UICodeListPortIn;
|
||||
@@ -10,7 +11,8 @@ import app.module.front.usecase.daily.work.adapters.persistence.model.DailyWorkD
|
||||
import app.module.front.usecase.daily.work.adapters.web.model.DailyWorkUIReqVO;
|
||||
import app.module.front.usecase.daily.work.ports.DailyWorkPortIn;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@@ -22,11 +24,12 @@ import org.thymeleaf.util.StringUtils;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@Controller
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping(path = "/record/work")
|
||||
public class DailyWorkUIController {
|
||||
SafeLogger safeLogger = new SafeLogger(LoggerFactory.getLogger(DailyWorkUIController.class));
|
||||
|
||||
private final UICodeListPortIn uiCodeListPortIn;
|
||||
private final DailyRecordPortIn dailyRecordPortIn;
|
||||
private final DailyWorkPortIn dailyWorkPortIn;
|
||||
@@ -48,7 +51,7 @@ public class DailyWorkUIController {
|
||||
DailyRecordDto dailyRecord = this.vaildGetDailyRecord(searchMonth, groupNo, targetList);
|
||||
|
||||
DailyWorkUIReqVO reqVO = new DailyWorkUIReqVO(searchMonth, groupNo);
|
||||
log.debug("reqVO: {}", reqVO);
|
||||
safeLogger.debug("reqVO: {}", reqVO);
|
||||
|
||||
List<DailyWorkDto> workList = dailyWorkPortIn.list(reqVO);
|
||||
|
||||
@@ -79,7 +82,7 @@ public class DailyWorkUIController {
|
||||
} else {
|
||||
reqVO.setId(Long.parseLong(id));
|
||||
}
|
||||
log.debug("reqVO: {}", reqVO);
|
||||
safeLogger.debug("reqVO: {}", reqVO);
|
||||
|
||||
DailyWorkDto detail = new DailyWorkDto();
|
||||
if (reqVO.getId() != 0L) {
|
||||
@@ -107,7 +110,7 @@ public class DailyWorkUIController {
|
||||
*/
|
||||
private DailyRecordDto vaildGetDailyRecord(String searchMonth, String groupNo, String targetList) {
|
||||
DailyUIReqVO reqVO = new DailyUIReqVO(searchMonth, groupNo);
|
||||
log.debug("getRecordUIReq: {}", reqVO);
|
||||
safeLogger.debug("getRecordUIReq: {}", reqVO);
|
||||
|
||||
DailyRecordDto dailyRecord = dailyRecordPortIn.detail(reqVO.getSearchMonth(), reqVO.getGroupNo(), reqVO.getHouseholdSeq());
|
||||
if (dailyRecord == null || dailyRecord.getId() == null) {
|
||||
|
||||
@@ -23,37 +23,37 @@ public class CreateDailyWorkValidator implements Validator {
|
||||
|
||||
if (vo.getWorkLandArea() == null && !StringUtils.isBlank(vo.getAreaUnitCode())) {
|
||||
errors.rejectValue(
|
||||
"workLandArea", "valid.common.required",
|
||||
"workLandArea", CommonConstants.VALID_CODE_NOTBLANK,
|
||||
"작업 면적을 입력해 주세요.");
|
||||
}
|
||||
|
||||
if (vo.getWorkLandArea() != null && StringUtils.isBlank(vo.getAreaUnitCode())) {
|
||||
errors.rejectValue(
|
||||
"areaUnitCode", "valid.common.required",
|
||||
"areaUnitCode", CommonConstants.VALID_CODE_NOTBLANK,
|
||||
"단위를 선택해 주세요.");
|
||||
}
|
||||
|
||||
if (CommonConstants.AREA_CODE_OTHER.equals(vo.getAreaUnitCode()) && StringUtils.isBlank(vo.getAreaUnitSelf())) {
|
||||
errors.rejectValue(
|
||||
"areaUnitSelf", "valid.common.required",
|
||||
"areaUnitSelf", CommonConstants.VALID_CODE_NOTBLANK,
|
||||
"단위를 입력해 주세요.");
|
||||
}
|
||||
|
||||
if (vo.getHarvestQuantity() == null && !StringUtils.isBlank(vo.getHarvestUnitCode())) {
|
||||
errors.rejectValue(
|
||||
"harvestQuantity", "valid.common.required",
|
||||
"harvestQuantity", CommonConstants.VALID_CODE_NOTBLANK,
|
||||
"수확량을 입력해 주세요.");
|
||||
}
|
||||
|
||||
if (vo.getHarvestQuantity() != null && StringUtils.isBlank(vo.getHarvestUnitCode())) {
|
||||
errors.rejectValue(
|
||||
"harvestUnitCode", "valid.common.required",
|
||||
"harvestUnitCode", CommonConstants.VALID_CODE_NOTBLANK,
|
||||
"단위를 선택해 주세요.");
|
||||
}
|
||||
|
||||
if (CommonConstants.UNIT_CODE_SELF.equals(vo.getHarvestUnitCode()) && StringUtils.isBlank(vo.getHarvestUnitSelf())) {
|
||||
errors.rejectValue(
|
||||
"harvestUnitSelf", "valid.common.required",
|
||||
"harvestUnitSelf", CommonConstants.VALID_CODE_NOTBLANK,
|
||||
"단위를 입력해 주세요.");
|
||||
}
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ class GetBanksDao implements GetBanksPortOut {
|
||||
article.getCreatedBy(),
|
||||
article.getUpdatedAt(),
|
||||
article.getUpdatedBy()))
|
||||
.collect(Collectors.toList()),
|
||||
.toList(),
|
||||
pageable,
|
||||
contents.isEmpty() ? 0 : contents.get(0).getTotal());
|
||||
}
|
||||
|
||||
@@ -67,7 +67,9 @@ class CreateBankInputController {
|
||||
String expenseCode = null;
|
||||
if(reqVO.getTransferType().equals("code.bank.input")){
|
||||
incomdeCode = !code.getId().equals(reqVO.getTransferType()+".self") && code.getCodeType().equals("INPUT") ? code.getCodeValue() : null;
|
||||
expenseCode = !code.getId().equals(reqVO.getTransferType()+".self") && code.getCodeType().equals("OUTPUT") ?code.getCodeValue() : null;
|
||||
expenseCode = !code.getId().equals(reqVO.getTransferType()+".self") && code.getCodeType().equals("OUTPUT") ?code.getCodeValue() : null;
|
||||
} else {
|
||||
expenseCode = !code.getId().equals(reqVO.getTransferType()+".self") ? code.getCodeValue() : null;
|
||||
}
|
||||
createBankPortIn.operate(new CreateBankCmd(
|
||||
AuthUtil.getUserSeq(),
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package app.module.front.usecase.info.bankUI.getBankInputUI.adapters.web;
|
||||
|
||||
import app.module.core.config.application.enums.MonthStatus;
|
||||
import app.module.core.config.constants.DailyRecordConstants;
|
||||
import app.module.core.usecase.uicode.list.ports.UICodeListPortIn;
|
||||
import app.module.front.config.application.util.AuthUtil;
|
||||
import app.module.front.usecase.info.bank.getBanks.ports.GetBanksPortIn;
|
||||
@@ -31,7 +32,10 @@ import java.time.format.DateTimeFormatter;
|
||||
@Controller
|
||||
@RequiredArgsConstructor
|
||||
class GetBankInputUIController {
|
||||
|
||||
/**
|
||||
* 자동이체종류의 수입 코드
|
||||
*/
|
||||
public static final String BANK_INPUT_CODE = "code.bank.input";
|
||||
|
||||
private final GetPrevMonthlyInputStatusPortIn prevMonthlyInputStatusPortIn;
|
||||
private final GetMonthlyInputStatusPortIn getMonthlyInputStatusPortIn;
|
||||
@@ -64,14 +68,14 @@ class GetBankInputUIController {
|
||||
if (pastMonthlyInfo != null) {
|
||||
pastList = getBanksPortIn.operate(
|
||||
pageable,
|
||||
new GetBanksCmd(pastMonthlyInfo.getId(), AuthUtil.getUserSeq(),"code.bank.input"));
|
||||
new GetBanksCmd(pastMonthlyInfo.getId(), AuthUtil.getUserSeq(), BANK_INPUT_CODE));
|
||||
}
|
||||
|
||||
Page<GetBanks> currentList = Page.empty();
|
||||
if (currentMonthlyInfo != null) {
|
||||
currentList = getBanksPortIn.operate(
|
||||
pageable,
|
||||
new GetBanksCmd(currentMonthlyInfo.getId(), AuthUtil.getUserSeq(),"code.bank.input"));
|
||||
new GetBanksCmd(currentMonthlyInfo.getId(), AuthUtil.getUserSeq(), BANK_INPUT_CODE));
|
||||
}
|
||||
|
||||
|
||||
@@ -79,11 +83,16 @@ class GetBankInputUIController {
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMM");
|
||||
YearMonth yearMonth = YearMonth.parse(currentMonthlyInfo.getMonth(), formatter);
|
||||
|
||||
LocalDate maxMonth = yearMonth.plusMonths(1).atDay(15);
|
||||
LocalDate minMonth = yearMonth.minusMonths(1).atDay(15);
|
||||
LocalDate maxMonth = DailyRecordConstants.MODIFY_LIMIT_DAY == 31 ?
|
||||
yearMonth.plusMonths(DailyRecordConstants.MODIFY_LIMIT_MONTH).atEndOfMonth() : yearMonth.plusMonths(DailyRecordConstants.MODIFY_LIMIT_MONTH).atDay(DailyRecordConstants.MODIFY_LIMIT_DAY);
|
||||
LocalDate minMonth = DailyRecordConstants.MODIFY_LIMIT_DAY == 31 ?
|
||||
yearMonth.minusMonths(1).plusMonths(DailyRecordConstants.MODIFY_LIMIT_MONTH).atEndOfMonth() : yearMonth.minusMonths(DailyRecordConstants.MODIFY_LIMIT_MONTH).atDay(DailyRecordConstants.MODIFY_LIMIT_DAY);
|
||||
|
||||
LocalDate today = LocalDate.now();
|
||||
|
||||
|
||||
boolean editable = !today.isAfter(maxMonth);
|
||||
boolean preEditable = !today.isBefore(minMonth);
|
||||
boolean preEditable = !today.isAfter(minMonth);
|
||||
|
||||
model.addAttribute("pastMonthlyInfo", pastMonthlyInfo);
|
||||
model.addAttribute("currentMonthlyInfo", currentMonthlyInfo);
|
||||
@@ -93,7 +102,7 @@ class GetBankInputUIController {
|
||||
model.addAttribute("bankList", currentList);
|
||||
|
||||
|
||||
model.addAttribute("transferCategoryList", uiCodeListPortIn.connect("code.bank.input"));
|
||||
model.addAttribute("transferCategoryList", uiCodeListPortIn.connect(BANK_INPUT_CODE));
|
||||
model.addAttribute("codeRecordCropList", uiCodeListPortIn.connect("code.record.crop"));
|
||||
model.addAttribute("countList", uiCodeListPortIn.connect("code.count.unit"));
|
||||
|
||||
@@ -110,7 +119,7 @@ class GetBankInputUIController {
|
||||
public String operateForm(Model model) {
|
||||
|
||||
|
||||
model.addAttribute("transferCategoryList", uiCodeListPortIn.connect("code.bank.input"));
|
||||
model.addAttribute("transferCategoryList", uiCodeListPortIn.connect(BANK_INPUT_CODE));
|
||||
model.addAttribute("codeRecordCropList", uiCodeListPortIn.connect("code.record.crop"));
|
||||
model.addAttribute("countList", uiCodeListPortIn.connect("code.count.unit"));
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package app.module.front.usecase.info.bankUI.getBankOutputUI.adapters.web;
|
||||
|
||||
import app.module.core.config.application.enums.MonthStatus;
|
||||
import app.module.core.config.constants.DailyRecordConstants;
|
||||
import app.module.core.usecase.uicode.list.ports.UICodeListPortIn;
|
||||
import app.module.front.config.application.util.AuthUtil;
|
||||
import app.module.front.usecase.info.bank.getBanks.ports.GetBanksPortIn;
|
||||
@@ -29,16 +30,16 @@ import java.time.format.DateTimeFormatter;
|
||||
@Controller
|
||||
@RequiredArgsConstructor
|
||||
class GetBankOutputUIController {
|
||||
|
||||
|
||||
/**
|
||||
* 자동이체종류의 지출 코드
|
||||
*/
|
||||
public static final String BANK_OUTPUT_CODE = "code.bank.output";
|
||||
|
||||
private final GetPrevMonthlyInputStatusPortIn prevMonthlyInputStatusPortIn;
|
||||
private final GetMonthlyInputStatusPortIn getMonthlyInputStatusPortIn;
|
||||
private final GetBanksPortIn getBanksPortIn;
|
||||
private final UICodeListPortIn uiCodeListPortIn;
|
||||
|
||||
|
||||
|
||||
@GetMapping(path = "/info/bank/create/output/{id}")
|
||||
public String operate(Model model,
|
||||
@PathVariable Long id
|
||||
@@ -66,14 +67,14 @@ class GetBankOutputUIController {
|
||||
if (pastMonthlyInfo != null) {
|
||||
pastList = getBanksPortIn.operate(
|
||||
pageable,
|
||||
new GetBanksCmd(pastMonthlyInfo.getId(), AuthUtil.getUserSeq(),"code.bank.output"));
|
||||
new GetBanksCmd(pastMonthlyInfo.getId(), AuthUtil.getUserSeq(), BANK_OUTPUT_CODE));
|
||||
}
|
||||
|
||||
Page<GetBanks> currentList = Page.empty();
|
||||
if (currentMonthlyInfo != null) {
|
||||
currentList = getBanksPortIn.operate(
|
||||
pageable,
|
||||
new GetBanksCmd(currentMonthlyInfo.getId(), AuthUtil.getUserSeq(),"code.bank.output"));
|
||||
new GetBanksCmd(currentMonthlyInfo.getId(), AuthUtil.getUserSeq(), BANK_OUTPUT_CODE));
|
||||
}
|
||||
|
||||
|
||||
@@ -81,11 +82,15 @@ class GetBankOutputUIController {
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMM");
|
||||
YearMonth yearMonth = YearMonth.parse(currentMonthlyInfo.getMonth(), formatter);
|
||||
|
||||
LocalDate maxMonth = yearMonth.plusMonths(1).atDay(15);
|
||||
LocalDate minMonth = yearMonth.minusMonths(1).atDay(15);
|
||||
LocalDate maxMonth = DailyRecordConstants.MODIFY_LIMIT_DAY == 31 ?
|
||||
yearMonth.plusMonths(DailyRecordConstants.MODIFY_LIMIT_MONTH).atEndOfMonth() : yearMonth.plusMonths(DailyRecordConstants.MODIFY_LIMIT_MONTH).atDay(DailyRecordConstants.MODIFY_LIMIT_DAY);
|
||||
LocalDate minMonth = DailyRecordConstants.MODIFY_LIMIT_DAY == 31 ?
|
||||
yearMonth.minusMonths(1).plusMonths(DailyRecordConstants.MODIFY_LIMIT_MONTH).atEndOfMonth() : yearMonth.minusMonths(DailyRecordConstants.MODIFY_LIMIT_MONTH).atDay(DailyRecordConstants.MODIFY_LIMIT_DAY);
|
||||
|
||||
LocalDate today = LocalDate.now();
|
||||
boolean editable = !today.isAfter(maxMonth);
|
||||
boolean preEditable = !today.isBefore(minMonth);
|
||||
|
||||
boolean preEditable = !today.isAfter(minMonth);
|
||||
|
||||
model.addAttribute("pastMonthlyInfo", pastMonthlyInfo);
|
||||
model.addAttribute("currentMonthlyInfo", currentMonthlyInfo);
|
||||
@@ -95,7 +100,7 @@ class GetBankOutputUIController {
|
||||
model.addAttribute("bankList", currentList);
|
||||
|
||||
|
||||
model.addAttribute("transferCategoryList", uiCodeListPortIn.connect("code.bank.output"));
|
||||
model.addAttribute("transferCategoryList", uiCodeListPortIn.connect(BANK_OUTPUT_CODE));
|
||||
model.addAttribute("codeRecordCropList", uiCodeListPortIn.connect("code.record.crop"));
|
||||
model.addAttribute("countList", uiCodeListPortIn.connect("code.count.unit"));
|
||||
|
||||
@@ -110,7 +115,7 @@ class GetBankOutputUIController {
|
||||
public String operateForm(Model model) {
|
||||
|
||||
|
||||
model.addAttribute("transferCategoryList", uiCodeListPortIn.connect("code.bank.output"));
|
||||
model.addAttribute("transferCategoryList", uiCodeListPortIn.connect(BANK_OUTPUT_CODE));
|
||||
model.addAttribute("codeRecordCropList", uiCodeListPortIn.connect("code.record.crop"));
|
||||
model.addAttribute("countList", uiCodeListPortIn.connect("code.count.unit"));
|
||||
|
||||
|
||||
@@ -50,8 +50,6 @@ class GetBanksUIController {
|
||||
.orElseThrow(() -> new NoSuchElementException("해당 월의 데이터가 없습니다."));
|
||||
|
||||
model.addAttribute("monthStatus", monthStatus);
|
||||
|
||||
// TODO 페키지명이 넘무 길어서 그냥
|
||||
model.addAttribute("MonthStatus", MonthStatus.class);
|
||||
|
||||
return "info/bank/banks";
|
||||
|
||||
@@ -44,7 +44,7 @@ class GetMonthlyInputStatussDao implements GetMonthlyInputStatussPortOut {
|
||||
article.getUpdatedAt(),
|
||||
article.getUpdatedBy()
|
||||
))
|
||||
.collect(Collectors.toList()),
|
||||
.toList(),
|
||||
pageable,
|
||||
contents.isEmpty() ? 0 : contents.get(0).getTotal());
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ class GetForestProductsDao implements GetForestProductsPortOut {
|
||||
article.getCreatedBy(),
|
||||
article.getUpdatedAt(),
|
||||
article.getUpdatedBy()))
|
||||
.collect(Collectors.toList()),
|
||||
.toList(),
|
||||
pageable,
|
||||
contents.isEmpty() ? 0 : contents.get(0).getTotal());
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ class GetMonthlyForestProductsDao implements GetMonthlyForestProductsPortOut {
|
||||
article.getCreatedBy(),
|
||||
article.getUpdatedAt(),
|
||||
article.getUpdatedBy()))
|
||||
.collect(Collectors.toList()),
|
||||
.toList(),
|
||||
pageable,
|
||||
contents.isEmpty() ? 0 : contents.get(0).getTotal());
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package app.module.front.usecase.info.monthlyUI.createMonthlyUI.adapters.web;
|
||||
|
||||
import app.module.core.config.application.enums.MonthStatus;
|
||||
import app.module.core.config.constants.DailyRecordConstants;
|
||||
import app.module.core.usecase.uicode.list.ports.UICodeListPortIn;
|
||||
import app.module.front.config.application.util.AuthUtil;
|
||||
import app.module.front.usecase.info.monthly.getMonthlyInputStatus.ports.GetMonthlyInputStatusPortIn;
|
||||
@@ -16,6 +17,7 @@ import app.module.front.usecase.info.monthlyProduct.getMonthlyForestProducts.por
|
||||
import app.module.front.usecase.info.monthlyProduct.getMonthlyForestProducts.ports.application.domain.GetMonthlyForestProducts;
|
||||
import app.module.front.usecase.info.monthlyProduct.getMonthlyForestProducts.ports.application.domain.GetMonthlyForestProductsCmd;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
@@ -31,6 +33,7 @@ import java.time.YearMonth;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.NoSuchElementException;
|
||||
|
||||
@Slf4j
|
||||
@Controller
|
||||
@RequiredArgsConstructor
|
||||
class CreateMonthlyUIController {
|
||||
@@ -114,11 +117,12 @@ class CreateMonthlyUIController {
|
||||
//수정 가능 여부 판단
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMM");
|
||||
YearMonth yearMonth = YearMonth.parse(currentMonthlyInfo.getMonth(), formatter);
|
||||
LocalDate maxMonth = yearMonth.plusMonths(1).atDay(15);
|
||||
LocalDate maxMonth = DailyRecordConstants.MODIFY_LIMIT_DAY == 31 ?
|
||||
yearMonth.plusMonths(DailyRecordConstants.MODIFY_LIMIT_MONTH).atEndOfMonth() : yearMonth.plusMonths(DailyRecordConstants.MODIFY_LIMIT_MONTH).atDay(DailyRecordConstants.MODIFY_LIMIT_DAY);
|
||||
|
||||
LocalDate today = LocalDate.now();
|
||||
boolean editable = !today.isAfter(maxMonth);
|
||||
|
||||
|
||||
model.addAttribute("pastMonthlyInfo", pastMonthlyInfo);
|
||||
model.addAttribute("currentMonthlyInfo", currentMonthlyInfo);
|
||||
model.addAttribute("pastList", pastList);
|
||||
|
||||
@@ -35,8 +35,6 @@ class GetMonthlysUIController {
|
||||
reqVO.getSearchField(), reqVO.getSearchValue(), AuthUtil.getUserSeq()));
|
||||
|
||||
model.addAttribute("list", list);
|
||||
|
||||
// TODO 페키지명이 넘무 길어서 그냥
|
||||
model.addAttribute("MonthStatus", MonthStatus.class);
|
||||
|
||||
return "info/monthly/monthlys";
|
||||
|
||||
@@ -56,7 +56,7 @@ class GetNoticeDao implements GetNoticePortOut {
|
||||
|
||||
return uploadFile;
|
||||
})
|
||||
.collect(Collectors.toList()));
|
||||
.toList());
|
||||
|
||||
return Optional.of(secArticle);
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ class GetNoticesDao implements GetNoticesPortOut {
|
||||
: ListUtils.emptyIfNull(
|
||||
mapper.getUploadFiles(
|
||||
contents.stream().map(GetNoticesDto::getId)
|
||||
.collect(Collectors.toList()),
|
||||
.toList(),
|
||||
FileUploadType.NOTICE));
|
||||
|
||||
return new PageImpl<>(
|
||||
@@ -60,7 +60,7 @@ class GetNoticesDao implements GetNoticesPortOut {
|
||||
.filter(file -> file.getNoticeId().equals(article.getId()))
|
||||
.findFirst()
|
||||
.orElse(null)))
|
||||
.collect(Collectors.toList()),
|
||||
.toList(),
|
||||
pageable,
|
||||
contents.isEmpty() ? 0 : contents.get(0).getTotal());
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
<select id="getDataNoneCountBySomeDayAfter">
|
||||
<![CDATA[
|
||||
with register_period as (
|
||||
select generate_series((CURRENT_DATE - INTERVAL '${limitDay} days')::date , (CURRENT_DATE - INTERVAL '1 days')::date, '1 day'::interval)::date as record_date
|
||||
select generate_series(#{limitDate}::date , (CURRENT_DATE - INTERVAL '1 days')::date, '1 day'::interval)::date as record_date
|
||||
)
|
||||
select count(rp.record_date) filter (where dr.id is null or dr.all_status = 'WAITING')
|
||||
from register_period rp
|
||||
|
||||
@@ -51,6 +51,7 @@
|
||||
<when test="order.property eq 'updatedAt'">a.updated_at</when>
|
||||
<when test="order.property eq 'createdBy'">a.created_by</when>
|
||||
<when test="order.property eq 'createdAt'">a.created_at</when>
|
||||
<when test="order.property eq 'month'">a.month</when>
|
||||
<otherwise>a.id</otherwise>
|
||||
</choose>
|
||||
<choose>
|
||||
@@ -58,6 +59,7 @@
|
||||
<otherwise>ASC</otherwise>
|
||||
</choose>
|
||||
</foreach>
|
||||
|
||||
OFFSET #{pageable.offset} ROWS FETCH NEXT #{pageable.pageSize} ROWS ONLY
|
||||
</if>
|
||||
</select>
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
a.updated_by AS updatedBy
|
||||
FROM monthly_input_status a
|
||||
WHERE a.is_deleted = false
|
||||
AND a.forest_product_status != 'NONE'
|
||||
AND a.household_seq = #{householdSeq}
|
||||
AND a.month = (
|
||||
SELECT TO_CHAR(TO_DATE(month, 'YYYYMM') - INTERVAL '1 month', 'YYYYMM')
|
||||
|
||||
@@ -62,9 +62,9 @@
|
||||
<when test="order.property eq 'endDate'">a.end_date</when>
|
||||
<when test="order.property eq 'updatedBy'">a.updated_by</when>
|
||||
<when test="order.property eq 'updatedAt'">a.updated_at</when>
|
||||
<when test="order.property eq 'createdBy'">a.created_by</when>
|
||||
<when test="order.property eq 'createdAt'">a.created_at</when>
|
||||
<otherwise>a.id</otherwise>
|
||||
<when test="order.property eq 'createdBy'">a.created_by</when>
|
||||
<when test="order.property eq 'createdAt'">a.created_at</when>
|
||||
<otherwise>a.id</otherwise>
|
||||
</choose>
|
||||
<choose>
|
||||
<when test="order.direction.toString() eq 'DESC'">DESC</when>
|
||||
@@ -79,16 +79,15 @@
|
||||
resultType="app.module.front.usecase.info.notice.getNotices.ports.application.domain.GetNoticeFiles">
|
||||
/* getUploadFiles : 게시물 리스트의 대표 이미지 */
|
||||
SELECT
|
||||
awuf.notice_id,
|
||||
uf.mapping_id as notice_id,
|
||||
uf.id,
|
||||
uf.type,
|
||||
uf.path,
|
||||
uf.name,
|
||||
uf.origin_name,
|
||||
uf.file_length
|
||||
FROM notice_has_upload_file awuf
|
||||
INNER JOIN upload_file uf ON awuf.upload_files_id = uf.id
|
||||
WHERE awuf.notice_id IN
|
||||
FROM upload_file uf
|
||||
WHERE uf.mapping_id IN
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
|
||||
|
Before Width: | Height: | Size: 80 KiB After Width: | Height: | Size: 80 KiB |
|
Before Width: | Height: | Size: 125 KiB After Width: | Height: | Size: 125 KiB |
|
Before Width: | Height: | Size: 94 KiB After Width: | Height: | Size: 94 KiB |
|
Before Width: | Height: | Size: 57 KiB After Width: | Height: | Size: 57 KiB |
|
Before Width: | Height: | Size: 70 KiB After Width: | Height: | Size: 70 KiB |
|
Before Width: | Height: | Size: 130 KiB After Width: | Height: | Size: 130 KiB |
|
Before Width: | Height: | Size: 91 KiB After Width: | Height: | Size: 91 KiB |
|
Before Width: | Height: | Size: 266 KiB After Width: | Height: | Size: 266 KiB |
|
Before Width: | Height: | Size: 177 KiB After Width: | Height: | Size: 176 KiB |
|
Before Width: | Height: | Size: 58 KiB After Width: | Height: | Size: 58 KiB |
|
Before Width: | Height: | Size: 185 KiB After Width: | Height: | Size: 186 KiB |
|
Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 60 KiB |
|
Before Width: | Height: | Size: 110 KiB After Width: | Height: | Size: 110 KiB |
|
Before Width: | Height: | Size: 51 KiB After Width: | Height: | Size: 51 KiB |
|
Before Width: | Height: | Size: 84 KiB After Width: | Height: | Size: 84 KiB |
|
Before Width: | Height: | Size: 98 KiB After Width: | Height: | Size: 98 KiB |
|
Before Width: | Height: | Size: 75 KiB After Width: | Height: | Size: 75 KiB |
|
Before Width: | Height: | Size: 120 KiB After Width: | Height: | Size: 120 KiB |
|
Before Width: | Height: | Size: 106 KiB After Width: | Height: | Size: 106 KiB |
|
Before Width: | Height: | Size: 75 KiB After Width: | Height: | Size: 75 KiB |
|
Before Width: | Height: | Size: 121 KiB After Width: | Height: | Size: 121 KiB |
|
Before Width: | Height: | Size: 116 KiB After Width: | Height: | Size: 116 KiB |
|
Before Width: | Height: | Size: 51 KiB After Width: | Height: | Size: 51 KiB |
|
Before Width: | Height: | Size: 74 KiB After Width: | Height: | Size: 74 KiB |
|
Before Width: | Height: | Size: 210 KiB After Width: | Height: | Size: 210 KiB |
|
Before Width: | Height: | Size: 112 KiB After Width: | Height: | Size: 112 KiB |
|
Before Width: | Height: | Size: 59 KiB After Width: | Height: | Size: 59 KiB |
|
Before Width: | Height: | Size: 51 KiB After Width: | Height: | Size: 50 KiB |
|
Before Width: | Height: | Size: 64 KiB After Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 53 KiB After Width: | Height: | Size: 53 KiB |
|
Before Width: | Height: | Size: 142 KiB After Width: | Height: | Size: 142 KiB |
|
Before Width: | Height: | Size: 103 KiB After Width: | Height: | Size: 104 KiB |
|
Before Width: | Height: | Size: 59 KiB After Width: | Height: | Size: 59 KiB |
|
Before Width: | Height: | Size: 64 KiB After Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 53 KiB After Width: | Height: | Size: 53 KiB |
|
Before Width: | Height: | Size: 103 KiB After Width: | Height: | Size: 104 KiB |
@@ -55,8 +55,9 @@
|
||||
31. 송이채취업
|
||||
</button>
|
||||
<div class="collapse-content">
|
||||
<p>1. 자기산림면적 3h~5ha미만</p>
|
||||
<p>2. 자기산림면적 5ha이상</p>
|
||||
<strong>규모기준</strong>
|
||||
<p>1. 판매금액 120만원 이상 ~ 500만원 미만</p>
|
||||
<p>2. 판매금액 500만원 이상</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="accordion-item component-collapse">
|
||||
|
||||
@@ -123,6 +123,7 @@
|
||||
currentStatus: /*[[${currentMonthlyInfo.bankAutoTransferInputStatus}]]*/'',
|
||||
pastStatus: /*[[${pastMonthlyInfo?.bankAutoTransferInputStatus}]]*/'',
|
||||
pastBankId: /*[[${pastMonthlyInfo?.id}]]*/'',
|
||||
pastMonth: /*[[${pastMonthlyInfo?.month}]]*/'',
|
||||
editable: /*[[${editable}]]*/,
|
||||
preEditable: /*[[${preEditable}]]*/,
|
||||
},
|
||||
@@ -207,29 +208,31 @@
|
||||
if( ENV.data.pastBankList.length === 0) {
|
||||
callPastInfoBtn.disabled = true;
|
||||
|
||||
if (ENV.data.preEditable && ENV.data.pastBankList.length === 0 && ENV.data.currentMonth >= "202508") {
|
||||
//if (ENV.data.preEditable && ENV.data.pastBankList.length === 0 && ENV.data.currentMonth >= "202508") {
|
||||
if (ENV.data.preEditable && ENV.data.pastBankList.length === 0 ) {
|
||||
const handlePageShow = function (event) {
|
||||
if ('sessionStorage' in window && window['sessionStorage'] !== null) {
|
||||
// history.back으로 돌아온 경우 (navigation.type == 2)
|
||||
console.log("window.performance.navigation.type ",window.performance.navigation.type );
|
||||
if (event.persisted || (window.performance && window.performance.navigation.type === 2)) {
|
||||
sessionStorage.removeItem('pastInputAlertShown'); // 플래그 제거
|
||||
return; // 알림창 표시하지 않음
|
||||
}
|
||||
|
||||
// 페이지가 처음 로드되었거나 새로고침된 경우 (navigation.type == 0 또는 1)
|
||||
if (event.persisted || (window.performance && window.performance.navigation.type <= 1)) {
|
||||
} else if (event.persisted || (window.performance && window.performance.navigation.type <= 1)) {
|
||||
// 페이지가 처음 로드되었거나 새로고침된 경우 (navigation.type == 0 또는 1)
|
||||
kri.isReturn = true;
|
||||
const hasShownAlert = sessionStorage.getItem('pastInputAlertShown');
|
||||
if (!hasShownAlert && ENV.data.pastBankList.length === 0) {
|
||||
if (hasShownAlert !== ENV.data.currentMonth && hasShownAlert !== ENV.data.pastMonth && ENV.data.pastBankList.length === 0) {
|
||||
etUI.dialog.alert({
|
||||
title: '지난달 정보 등록하기',
|
||||
message: '지난달 정보를 아직 입력하지 않으셨네요.\n정확한 조사를 위해 지난달 정보를 입력해주세요.\n\n확인 버튼을 누르시면 지난달 은행자동이체 내역등록으로 이동합니다.',
|
||||
type: 'alert',
|
||||
callback: function () {
|
||||
sessionStorage.setItem('pastInputAlertShown', 'true');
|
||||
sessionStorage.setItem('pastInputAlertShown', ENV.data.pastMonth);
|
||||
location.href = ENV.httpUrl.preMonth + "/" + ENV.data.pastBankId;
|
||||
},
|
||||
});
|
||||
} else if(hasShownAlert === ENV.data.pastMonth) {
|
||||
sessionStorage.removeItem('pastInputAlertShown');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -550,7 +553,7 @@
|
||||
if (rstData.code === 'SUCCESS') {
|
||||
ajaxUtil._alert('등록이 완료되었습니다.', null, function () {
|
||||
|
||||
location.href = '/info/bank';
|
||||
location.href = '/info/bank/' + ENV.data.currentMonth;
|
||||
});
|
||||
} else if (rstData.code === 'ERROR') {
|
||||
ajaxUtil._alert('잠시 뒤에 다시 시도해 주세요.', null);
|
||||
|
||||
@@ -119,9 +119,11 @@
|
||||
bankList : /*[[${bankList.content}]]*/ [],
|
||||
pastBankList : /*[[${pastBankList.content}]]*/ [],
|
||||
id: /*[[${currentMonthlyInfo.id}]]*/'',
|
||||
currentMonth: /*[[${currentMonthlyInfo.month}]]*/'',
|
||||
currentStatus: /*[[${currentMonthlyInfo.bankAutoTransferOutputStatus}]]*/'',
|
||||
pastStatus: /*[[${pastMonthlyInfo?.bankAutoTransferOutputStatus}]]*/'',
|
||||
pastBankId: /*[[${pastMonthlyInfo?.id}]]*/'',
|
||||
pastMonth: /*[[${pastMonthlyInfo?.month}]]*/'',
|
||||
editable: /*[[${editable}]]*/,
|
||||
preEditable: /*[[${preEditable}]]*/,
|
||||
},
|
||||
@@ -204,7 +206,8 @@
|
||||
|
||||
if (ENV.data.editable) {
|
||||
|
||||
if (ENV.data.preEditable && ENV.data.pastBankList.length === 0 && ENV.data.currentMonth >= "202508") {
|
||||
//if (ENV.data.preEditable && ENV.data.pastBankList.length === 0 && ENV.data.currentMonth >= "202508") {
|
||||
if (ENV.data.preEditable && ENV.data.pastBankList.length === 0) {
|
||||
callPastInfoBtn.disabled = true;
|
||||
|
||||
const handlePageShow = function(event) {
|
||||
@@ -213,23 +216,23 @@
|
||||
if (event.persisted || (window.performance && window.performance.navigation.type === 2)) {
|
||||
sessionStorage.removeItem('pastOutputAlertShown'); // 플래그 제거
|
||||
return; // 알림창 표시하지 않음
|
||||
}
|
||||
|
||||
// 페이지가 처음 로드되었거나 새로고침된 경우 (navigation.type == 0 또는 1)
|
||||
if (event.persisted || (window.performance && window.performance.navigation.type <= 1)) {
|
||||
}else if (event.persisted || (window.performance && window.performance.navigation.type <= 1)) {
|
||||
// 페이지가 처음 로드되었거나 새로고침된 경우 (navigation.type == 0 또는 1)
|
||||
kri.isReturn = true;
|
||||
const hasShownAlert = sessionStorage.getItem('pastOutputAlertShown');
|
||||
if (!hasShownAlert && ENV.data.pastBankList.length === 0) {
|
||||
if (hasShownAlert !== ENV.data.currentMonth && hasShownAlert !== ENV.data.pastMonth && ENV.data.pastBankList.length === 0) {
|
||||
callPastInfoBtn.disabled = true;
|
||||
etUI.dialog.alert({
|
||||
title: '지난달 정보 등록하기',
|
||||
message: '지난달 정보를 아직 입력하지 않으셨네요.\n정확한 조사를 위해 지난달 정보를 입력해주세요.\n\n확인 버튼을 누르시면 지난달 은행자동이체 내역등록으로 이동합니다.',
|
||||
type: 'alert',
|
||||
callback: function() {
|
||||
sessionStorage.setItem('pastOutputAlertShown', 'true');
|
||||
sessionStorage.setItem('pastOutputAlertShown', ENV.data.pastMonth);
|
||||
location.href = ENV.httpUrl.preMonth + "/" + ENV.data.pastBankId;
|
||||
},
|
||||
});
|
||||
} else if (hasShownAlert === ENV.data.pastMonth) {
|
||||
sessionStorage.removeItem('pastOutputAlertShown');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -399,7 +402,7 @@
|
||||
if(document.getElementById(form.transferCategoryCode.value+"_value")){
|
||||
if (form.transferCategoryCode.value && document.getElementById(form.transferCategoryCode.value+"_value")
|
||||
&& !document.getElementById(form.transferCategoryCode.value+"_value").value){
|
||||
errors.push({field: form.transferCategoryCode.value+"_value", message: '지출 대상을 입력해주세요.'});
|
||||
errors.push({field: form.transferCategoryCode.value+"_value", message: '지출의 종류를 입력해주세요.'});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -529,7 +532,7 @@
|
||||
if (rstData.code === 'SUCCESS') {
|
||||
ajaxUtil._alert('등록이 완료되었습니다.', null, function () {
|
||||
|
||||
location.href = '/info/bank';
|
||||
location.href = '/info/bank/' + ENV.data.currentMonth;
|
||||
});
|
||||
} else if (rstData.code === 'ERROR') {
|
||||
ajaxUtil._alert('잠시 뒤에 다시 시도해 주세요.', null);
|
||||
|
||||
@@ -43,10 +43,10 @@
|
||||
</dl>
|
||||
|
||||
<th:block th:if="${notice != null}">
|
||||
<a th:href="@{'/info/notice/' + ${notice.id}}" class="notice-box">
|
||||
<p class="tit">공지사항</p>
|
||||
<p class="txt" th:text="${notice.title}"></p>
|
||||
</a>
|
||||
<div class="notice-box">
|
||||
<a href="/info/notice" class="tit">공지사항</a>
|
||||
<a th:href="@{'/info/notice/' + ${notice.id}}" class="txt" th:text="${notice.title}"></a>
|
||||
</div>
|
||||
<div class="notice-box nodata"
|
||||
th:unless="${notice != null}">
|
||||
<a href="/info/notice" class="tit">공지사항</a>
|
||||
|
||||
@@ -13,7 +13,8 @@
|
||||
<ul class="product-col-list">
|
||||
|
||||
<li th:each="item : ${list.content}"
|
||||
th:classappend="${item.forestProductStatus != MonthStatus.NONE} ? ' complete'">
|
||||
th:class="|${item?.forestProductStatus == MonthStatus.REGISTERED ? 'complete' :
|
||||
item?.forestProductStatus == MonthStatus.NOTHING ? 'complete-nodata' : ''}|">
|
||||
<a th:href="@{/info/monthly/create/{id}(id=${item.id})}">
|
||||
<p class="list-tit" th:text="${item.koreanMonth}"></p>
|
||||
<span class="tag" th:text="${item.forestProductStatus.desc}"></span>
|
||||
|
||||
@@ -64,10 +64,12 @@
|
||||
<ul class="">
|
||||
<li class="option" data-value="" th:classappend="${userInfo.tel1 == ''?' current':'' }">선택</li>
|
||||
<li class="option" data-value="02" th:classappend="${userInfo.tel1 == '02'?' current':'' }">02</li>
|
||||
<li class="option" data-value="031" th:classappend="${userInfo.tel1 == '031'?' current':'' }">31</li>
|
||||
<li class="option" data-value="031" th:classappend="${userInfo.tel1 == '031'?' current':'' }">031</li>
|
||||
<li class="option" data-value="033" th:classappend="${userInfo.tel1 == '033'?' current':'' }">033</li>
|
||||
<li class="option" data-value="041" th:classappend="${userInfo.tel1 == '041'?' current':'' }">041</li>
|
||||
<li class="option" data-value="042" th:classappend="${userInfo.tel1 == '042'?' current':'' }">042</li>
|
||||
<li class="option" data-value="043" th:classappend="${userInfo.tel1 == '043'?' current':'' }">043</li>
|
||||
<li class="option" data-value="044" th:classappend="${userInfo.tel1 == '044'?' current':'' }">044</li>
|
||||
<li class="option" data-value="051" th:classappend="${userInfo.tel1 == '051'?' current':'' }">051</li>
|
||||
<li class="option" data-value="052" th:classappend="${userInfo.tel1 == '052'?' current':'' }">052</li>
|
||||
<li class="option" data-value="053" th:classappend="${userInfo.tel1 == '053'?' current':'' }">053</li>
|
||||
@@ -366,11 +368,11 @@
|
||||
//유효성 검사
|
||||
const form = document.getElementById('reqForm');
|
||||
kri.form.errorInit(form);
|
||||
const selects = ['tel1', 'phone1', 'regionSubCode', 'regionDetailCode'];
|
||||
selects.forEach(id => {
|
||||
const sel = document.getElementById(id);
|
||||
if (sel && sel.value) form[id].value = sel.value;
|
||||
});
|
||||
|
||||
form.regionSubCode.value = ENV.select.regionSelect.getParentValue();
|
||||
form.regionDetailCode.value = ENV.select.regionSelect.getChildValue();
|
||||
form.tel1.value = ENV.select.selectTel.getValue();
|
||||
form.phone1.value = ENV.select.selectPhone.getValue();
|
||||
|
||||
const errors = [];
|
||||
if (!form.ownerName.value) errors.push({field: 'ownerName', message: '이름을 입력해 주세요.'});
|
||||
|
||||
@@ -819,15 +819,15 @@
|
||||
|
||||
// 오늘 날짜가 해당 달의 마지막 날인지 확인
|
||||
const today = new Date();
|
||||
const lastDayOfMonth = new Date(viewDate.getFullYear(), viewDate.getMonth() + 1, 0); // 해당 달의 마지막 날
|
||||
// 쿠키에서 마지막 alert 날짜 확인
|
||||
const lastAlertDate = getCookie('lastAlertDate');
|
||||
const todayDateString = today.toISOString().split('T')[0];
|
||||
const lastDayOfMonth = new Date(today.getFullYear(), today.getMonth() + 1, 0); // 해당 달의 마지막 날
|
||||
// 마지막 alert 날짜 확인
|
||||
const lastAlertDate = sessionStorage.getItem('lastAlertDate');
|
||||
const todayDateString = today.toDateString();
|
||||
|
||||
if (lastAlertDate !== todayDateString &&
|
||||
today.getFullYear() === lastDayOfMonth.getFullYear() &&
|
||||
today.getMonth() === lastDayOfMonth.getMonth() &&
|
||||
today.getMonth() === lastDayOfMonth.getMonth() &&
|
||||
today.getDate() === lastDayOfMonth.getDate()) {
|
||||
|
||||
ajaxUtil._ajaxSyncMethod(
|
||||
ENV.httpUrl.alert.replace('{searchMonth}', searchMonth.replace('-', '')),
|
||||
{},
|
||||
@@ -862,6 +862,7 @@
|
||||
message: msgTxt,
|
||||
type:'alert',
|
||||
callback: function () {
|
||||
sessionStorage.setItem('lastAlertDate',lastDayOfMonth.toDateString());
|
||||
},
|
||||
});
|
||||
}
|
||||
@@ -879,20 +880,6 @@
|
||||
},
|
||||
};
|
||||
|
||||
// 쿠키 설정 함수
|
||||
function setCookie(name, value, days) {
|
||||
const expires = new Date();
|
||||
expires.setTime(expires.getTime() + days * 24 * 60 * 60 * 1000);
|
||||
document.cookie = `${name}=${value};expires=${expires.toUTCString()};path=/`;
|
||||
}
|
||||
|
||||
// 쿠키 가져오기 함수
|
||||
function getCookie(name) {
|
||||
const value = `; ${document.cookie}`;
|
||||
const parts = value.split(`; ${name}=`);
|
||||
if (parts.length === 2) return parts.pop().split(';').shift();
|
||||
return null;
|
||||
}
|
||||
</script>
|
||||
<script id="dailyNoneTmpl" type="text/x-jsrender">
|
||||
{{include tmpl="#titleTmpl" /}}
|
||||
|
||||
@@ -144,7 +144,7 @@
|
||||
<script th:inline="javascript">
|
||||
let ENV = {
|
||||
httpUrl: {
|
||||
root: /*[[|/record/daily/${reqVO.searchMonth}/${reqVO.groupNo}|]]*/'rootUrl',
|
||||
root: /*[[|/record/expense/${reqVO.searchMonth}/${reqVO.groupNo}|]]*/'rootUrl',
|
||||
form: /*[[|/record/expense/${reqVO.searchMonth}/${reqVO.groupNo}/form/{id}|]]*/'formUrl',
|
||||
create: /*[[|/api/record/expense/${reqVO.searchMonth}/${reqVO.groupNo}/form/{id}|]]*/'createUrl',
|
||||
remove: /*[[|/api/record/expense/${reqVO.searchMonth}/${reqVO.groupNo}/remove|]]*/'removeUrl',
|
||||
|
||||
@@ -158,7 +158,7 @@
|
||||
<script th:inline="javascript">
|
||||
let ENV = {
|
||||
httpUrl: {
|
||||
root: /*[[|/record/daily/${reqVO.searchMonth}/${reqVO.groupNo}|]]*/'rootUrl',
|
||||
root: /*[[|/record/income/${reqVO.searchMonth}/${reqVO.groupNo}|]]*/'rootUrl',
|
||||
form: /*[[|/record/income/${reqVO.searchMonth}/${reqVO.groupNo}/form/{id}|]]*/'formUrl',
|
||||
create: /*[[|/api/record/income/${reqVO.searchMonth}/${reqVO.groupNo}/form/{id}|]]*/'createUrl',
|
||||
remove: /*[[|/api/record/income/${reqVO.searchMonth}/${reqVO.groupNo}/remove|]]*/'removeUrl',
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<p th:if="${#lists.isEmpty(workList)}">임업노동 투입 내역을 등록해 주세요.</p>
|
||||
<p th:unless="${#lists.isEmpty(workList)}">등록 내용을 확인하거나 다음 단계로 이동하세요.</p>
|
||||
</hgroup>
|
||||
|
||||
-
|
||||
<!--/* 신규 등록 : dailyRecord.modifiable=false 수정 기간 아님 */-->
|
||||
<th:block th:if="${#lists.isEmpty(workList)}">
|
||||
<button type="button" class="btn btn-m btn-secondary btn-full button-modal01" data-testid="button-modal01"
|
||||
|
||||