[FO] 일계부 이전/다음/종료/완료 페이지 이동 처리, 건의사항 등록
This commit is contained in:
@@ -1773,7 +1773,7 @@ CREATE SEQUENCE suggestion_seq START WITH 1 INCREMENT BY 1 CACHE 1 NO CYCLE;
|
|||||||
CREATE TABLE suggestion (
|
CREATE TABLE suggestion (
|
||||||
id bigint DEFAULT nextval('suggestion_seq') NOT NULL, -- 건의하기 ID
|
id bigint DEFAULT nextval('suggestion_seq') NOT NULL, -- 건의하기 ID
|
||||||
household_seq bigint NOT NULL, -- 임가정보 일련번호
|
household_seq bigint NOT NULL, -- 임가정보 일련번호
|
||||||
content varchar(255), -- 내용
|
content varchar(1500), -- 내용
|
||||||
created_at timestamp(6), -- 생성일
|
created_at timestamp(6), -- 생성일
|
||||||
created_by varchar(255), -- 생성자
|
created_by varchar(255), -- 생성자
|
||||||
updated_at timestamp(6), -- 수정일
|
updated_at timestamp(6), -- 수정일
|
||||||
|
|||||||
@@ -42,43 +42,48 @@ public class RecordCalendarDao implements RecordCalendarPortOut {
|
|||||||
refine.setChildren(new ArrayList<>());
|
refine.setChildren(new ArrayList<>());
|
||||||
} else {
|
} else {
|
||||||
List<CalendarChildren> childList = new ArrayList<>();
|
List<CalendarChildren> childList = new ArrayList<>();
|
||||||
|
if (DailyTargetStatus.TARGET.equals(findStatus.getIncomeStatus())
|
||||||
if (DailyTargetStatus.TARGET.equals(findStatus.getIncomeStatus())) {
|
|| DailyTargetStatus.TODAY_NONE.equals(findStatus.getIncomeStatus())) {
|
||||||
childList.add(new CalendarChildren(
|
childList.add(new CalendarChildren(
|
||||||
"INCOME",
|
"INCOME",
|
||||||
"수입",
|
"수입",
|
||||||
findStatus.getIncomeCount(),
|
findStatus.getIncomeCount(),
|
||||||
String.format(pathFormat, "income", command.getSearchMonth(), findStatus.getDayGroupNo())));
|
String.format(pathFormat, "income", command.getSearchMonth(), findStatus.getDayGroupNo())));
|
||||||
}
|
}
|
||||||
if (DailyTargetStatus.TARGET.equals(findStatus.getWorkStatus())) {
|
if (DailyTargetStatus.TARGET.equals(findStatus.getWorkStatus())
|
||||||
|
|| DailyTargetStatus.TODAY_NONE.equals(findStatus.getWorkStatus())) {
|
||||||
childList.add(new CalendarChildren(
|
childList.add(new CalendarChildren(
|
||||||
"WORK",
|
"WORK",
|
||||||
"임업노동 투입 내역",
|
"임업노동 투입 내역",
|
||||||
findStatus.getWorkCount(),
|
findStatus.getWorkCount(),
|
||||||
String.format(pathFormat, "work", command.getSearchMonth(), findStatus.getDayGroupNo())));
|
String.format(pathFormat, "work", command.getSearchMonth(), findStatus.getDayGroupNo())));
|
||||||
}
|
}
|
||||||
if (DailyTargetStatus.TARGET.equals(findStatus.getExpenseStatus())) {
|
if (DailyTargetStatus.TARGET.equals(findStatus.getExpenseStatus())
|
||||||
|
|| DailyTargetStatus.TODAY_NONE.equals(findStatus.getExpenseStatus())) {
|
||||||
childList.add(new CalendarChildren(
|
childList.add(new CalendarChildren(
|
||||||
"EXPENSE",
|
"EXPENSE",
|
||||||
"지출",
|
"지출",
|
||||||
findStatus.getExpenseCount(),
|
findStatus.getExpenseCount(),
|
||||||
String.format(pathFormat, "expense", command.getSearchMonth(), findStatus.getDayGroupNo())));
|
String.format(pathFormat, "expense", command.getSearchMonth(), findStatus.getDayGroupNo())));
|
||||||
}
|
}
|
||||||
if (DailyTargetStatus.TARGET.equals(findStatus.getPowerStatus())) {
|
if (DailyTargetStatus.TARGET.equals(findStatus.getPowerStatus())
|
||||||
|
|| DailyTargetStatus.TODAY_NONE.equals(findStatus.getPowerStatus())) {
|
||||||
childList.add(new CalendarChildren(
|
childList.add(new CalendarChildren(
|
||||||
"POWER",
|
"POWER",
|
||||||
"동력 사용시간",
|
"동력 사용시간",
|
||||||
findStatus.getPowerCount(),
|
findStatus.getPowerCount(),
|
||||||
String.format(pathFormat, "power", command.getSearchMonth(), findStatus.getDayGroupNo())));
|
String.format(pathFormat, "power", command.getSearchMonth(), findStatus.getDayGroupNo())));
|
||||||
}
|
}
|
||||||
if (DailyTargetStatus.TARGET.equals(findStatus.getForestryStatus())) {
|
if (DailyTargetStatus.TARGET.equals(findStatus.getForestryStatus())
|
||||||
|
|| DailyTargetStatus.TODAY_NONE.equals(findStatus.getForestryStatus())) {
|
||||||
childList.add(new CalendarChildren(
|
childList.add(new CalendarChildren(
|
||||||
"FORESTRY",
|
"FORESTRY",
|
||||||
"자가임업 생산물 중 자가소비량",
|
"자가임업 생산물 중 자가소비량",
|
||||||
findStatus.getForestryCount(),
|
findStatus.getForestryCount(),
|
||||||
String.format(pathFormat, "forestry", command.getSearchMonth(), findStatus.getDayGroupNo())));
|
String.format(pathFormat, "forestry", command.getSearchMonth(), findStatus.getDayGroupNo())));
|
||||||
}
|
}
|
||||||
if (DailyTargetStatus.TARGET.equals(findStatus.getFarmingStatus())) {
|
if (DailyTargetStatus.TARGET.equals(findStatus.getFarmingStatus())
|
||||||
|
|| DailyTargetStatus.TODAY_NONE.equals(findStatus.getFarmingStatus())) {
|
||||||
childList.add(new CalendarChildren(
|
childList.add(new CalendarChildren(
|
||||||
"FARMING",
|
"FARMING",
|
||||||
"자가농업 생산물 중 자가소비량",
|
"자가농업 생산물 중 자가소비량",
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import app.module.front.usecase.daily.expense.adapters.persistence.model.DailyEx
|
|||||||
import app.module.front.usecase.daily.expense.adapters.web.model.DailyExpenseUIReqVO;
|
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.expense.ports.DailyExpensePortIn;
|
||||||
import app.module.front.usecase.daily.record.adapters.persistence.model.DailyRecordDto;
|
import app.module.front.usecase.daily.record.adapters.persistence.model.DailyRecordDto;
|
||||||
|
import app.module.front.usecase.daily.record.adapters.web.model.DailySort;
|
||||||
import app.module.front.usecase.daily.record.adapters.web.model.DailyUIReqVO;
|
import app.module.front.usecase.daily.record.adapters.web.model.DailyUIReqVO;
|
||||||
import app.module.front.usecase.daily.record.ports.DailyRecordPortIn;
|
import app.module.front.usecase.daily.record.ports.DailyRecordPortIn;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
@@ -15,6 +16,7 @@ import org.springframework.ui.Model;
|
|||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
import org.thymeleaf.util.StringUtils;
|
import org.thymeleaf.util.StringUtils;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -34,10 +36,12 @@ public class DailyExpenseUIController {
|
|||||||
* @param model Model
|
* @param model Model
|
||||||
* @param searchMonth 검색 월(yyyyMM)
|
* @param searchMonth 검색 월(yyyyMM)
|
||||||
* @param groupNo 검색 그룹
|
* @param groupNo 검색 그룹
|
||||||
|
* @param searchType 수정여부
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@GetMapping(path = "/{searchMonth}/{groupNo}")
|
@GetMapping(path = "/{searchMonth}/{groupNo}")
|
||||||
public String index(Model model, @PathVariable("searchMonth") String searchMonth, @PathVariable("groupNo") String groupNo) {
|
public String index(Model model, @PathVariable("searchMonth") String searchMonth, @PathVariable("groupNo") String groupNo
|
||||||
|
, @RequestParam(name = "type", required = false) String searchType) {
|
||||||
|
|
||||||
DailyRecordDto dailyRecord = this.vaildGetDailyRecord(searchMonth, groupNo);
|
DailyRecordDto dailyRecord = this.vaildGetDailyRecord(searchMonth, groupNo);
|
||||||
|
|
||||||
@@ -49,6 +53,8 @@ public class DailyExpenseUIController {
|
|||||||
model.addAttribute("reqVO", reqVO);
|
model.addAttribute("reqVO", reqVO);
|
||||||
model.addAttribute("dailyRecord", dailyRecord);
|
model.addAttribute("dailyRecord", dailyRecord);
|
||||||
model.addAttribute("expenseList", expenseList);
|
model.addAttribute("expenseList", expenseList);
|
||||||
|
model.addAttribute("moveStep", !"update".equals(searchType));
|
||||||
|
model.addAttribute("nextStep", dailyRecord.getNextStep(DailySort.EXPENSE));
|
||||||
|
|
||||||
return "record/expense/index";
|
return "record/expense/index";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import app.module.front.usecase.daily.income.adapters.web.model.RemoveDailyIncom
|
|||||||
import app.module.front.usecase.daily.income.adapters.web.validator.CreateDailyIncomeValidator;
|
import app.module.front.usecase.daily.income.adapters.web.validator.CreateDailyIncomeValidator;
|
||||||
import app.module.front.usecase.daily.income.ports.DailyIncomePortIn;
|
import app.module.front.usecase.daily.income.ports.DailyIncomePortIn;
|
||||||
import app.module.front.usecase.daily.record.adapters.persistence.model.DailyRecordDto;
|
import app.module.front.usecase.daily.record.adapters.persistence.model.DailyRecordDto;
|
||||||
|
import app.module.front.usecase.daily.record.adapters.web.model.DailyTargetStatus;
|
||||||
import app.module.front.usecase.daily.record.adapters.web.model.DailyUIReqVO;
|
import app.module.front.usecase.daily.record.adapters.web.model.DailyUIReqVO;
|
||||||
import app.module.front.usecase.daily.record.ports.DailyRecordPortIn;
|
import app.module.front.usecase.daily.record.ports.DailyRecordPortIn;
|
||||||
import jakarta.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
@@ -17,6 +18,9 @@ import org.springframework.http.ResponseEntity;
|
|||||||
import org.springframework.validation.BindingResult;
|
import org.springframework.validation.BindingResult;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@RestController
|
@RestController
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import app.module.front.usecase.daily.income.adapters.persistence.model.DailyInc
|
|||||||
import app.module.front.usecase.daily.income.adapters.web.model.DailyIncomeUIReqVO;
|
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.income.ports.DailyIncomePortIn;
|
||||||
import app.module.front.usecase.daily.record.adapters.persistence.model.DailyRecordDto;
|
import app.module.front.usecase.daily.record.adapters.persistence.model.DailyRecordDto;
|
||||||
|
import app.module.front.usecase.daily.record.adapters.web.model.DailySort;
|
||||||
import app.module.front.usecase.daily.record.adapters.web.model.DailyUIReqVO;
|
import app.module.front.usecase.daily.record.adapters.web.model.DailyUIReqVO;
|
||||||
import app.module.front.usecase.daily.record.ports.DailyRecordPortIn;
|
import app.module.front.usecase.daily.record.ports.DailyRecordPortIn;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
@@ -15,6 +16,7 @@ import org.springframework.ui.Model;
|
|||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
import org.thymeleaf.util.StringUtils;
|
import org.thymeleaf.util.StringUtils;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -34,10 +36,12 @@ public class DailyIncomeUIController {
|
|||||||
* @param model Model
|
* @param model Model
|
||||||
* @param searchMonth 검색 월(yyyyMM)
|
* @param searchMonth 검색 월(yyyyMM)
|
||||||
* @param groupNo 검색 그룹
|
* @param groupNo 검색 그룹
|
||||||
|
* @param searchType 수정여부
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@GetMapping(path = "/{searchMonth}/{groupNo}")
|
@GetMapping(path = "/{searchMonth}/{groupNo}")
|
||||||
public String index(Model model, @PathVariable("searchMonth") String searchMonth, @PathVariable("groupNo") String groupNo) {
|
public String index(Model model, @PathVariable("searchMonth") String searchMonth, @PathVariable("groupNo") String groupNo
|
||||||
|
, @RequestParam(name = "type", required = false) String searchType) {
|
||||||
|
|
||||||
DailyRecordDto dailyRecord = this.vaildGetDailyRecord(searchMonth, groupNo);
|
DailyRecordDto dailyRecord = this.vaildGetDailyRecord(searchMonth, groupNo);
|
||||||
|
|
||||||
@@ -49,6 +53,8 @@ public class DailyIncomeUIController {
|
|||||||
model.addAttribute("reqVO", reqVO);
|
model.addAttribute("reqVO", reqVO);
|
||||||
model.addAttribute("dailyRecord", dailyRecord);
|
model.addAttribute("dailyRecord", dailyRecord);
|
||||||
model.addAttribute("incomeList", incomeList);
|
model.addAttribute("incomeList", incomeList);
|
||||||
|
model.addAttribute("moveStep", !"update".equals(searchType));
|
||||||
|
model.addAttribute("nextStep", dailyRecord.getNextStep(DailySort.INCOME));
|
||||||
|
|
||||||
return "record/income/index";
|
return "record/income/index";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
package app.module.front.usecase.daily.record.adapters.persistence.model;
|
package app.module.front.usecase.daily.record.adapters.persistence.model;
|
||||||
|
|
||||||
|
import app.module.front.usecase.daily.record.adapters.web.model.DailySort;
|
||||||
import app.module.front.usecase.daily.record.adapters.web.model.DailyStatus;
|
import app.module.front.usecase.daily.record.adapters.web.model.DailyStatus;
|
||||||
import app.module.front.usecase.daily.record.adapters.web.model.DailyTargetStatus;
|
import app.module.front.usecase.daily.record.adapters.web.model.DailyTargetStatus;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class DailyRecordDto {
|
public class DailyRecordDto {
|
||||||
@@ -28,7 +30,32 @@ public class DailyRecordDto {
|
|||||||
private DailyTargetStatus forestryStatus;
|
private DailyTargetStatus forestryStatus;
|
||||||
private DailyTargetStatus farmingStatus;
|
private DailyTargetStatus farmingStatus;
|
||||||
|
|
||||||
|
private boolean lastDay;
|
||||||
|
private List<DailySort> targetList;
|
||||||
|
|
||||||
public boolean isUpdated() {
|
public boolean isUpdated() {
|
||||||
return this.id != null;
|
return this.id != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getNextStep(DailySort currentStep) {
|
||||||
|
String returnValue = null;
|
||||||
|
if (targetList != null) {
|
||||||
|
int index = 0;
|
||||||
|
int size = targetList.size();
|
||||||
|
for (DailySort target : targetList) {
|
||||||
|
if (target.equals(currentStep) && (index + 1) != size) {
|
||||||
|
returnValue = targetList.get(index + 1).name();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (returnValue == null) {
|
||||||
|
returnValue = "LAST";
|
||||||
|
}
|
||||||
|
|
||||||
|
return returnValue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package app.module.front.usecase.daily.record.adapters.web;
|
|||||||
|
|
||||||
import app.module.core.config.application.exception.NoMatchingURIException;
|
import app.module.core.config.application.exception.NoMatchingURIException;
|
||||||
import app.module.front.usecase.daily.record.adapters.persistence.model.DailyRecordDto;
|
import app.module.front.usecase.daily.record.adapters.persistence.model.DailyRecordDto;
|
||||||
|
import app.module.front.usecase.daily.record.adapters.web.model.DailyStatus;
|
||||||
import app.module.front.usecase.daily.record.adapters.web.model.DailyUIReqVO;
|
import app.module.front.usecase.daily.record.adapters.web.model.DailyUIReqVO;
|
||||||
import app.module.front.usecase.daily.record.adapters.web.validator.CreateDailyRecordValidator;
|
import app.module.front.usecase.daily.record.adapters.web.validator.CreateDailyRecordValidator;
|
||||||
import app.module.front.usecase.daily.record.ports.DailyRecordPortIn;
|
import app.module.front.usecase.daily.record.ports.DailyRecordPortIn;
|
||||||
@@ -24,7 +25,7 @@ public class DailyRecordUIController {
|
|||||||
/**
|
/**
|
||||||
* 일계부 등록 화면
|
* 일계부 등록 화면
|
||||||
*
|
*
|
||||||
* @param model
|
* @param model Model
|
||||||
* @param searchMonth 검색 월(yyyyMM)
|
* @param searchMonth 검색 월(yyyyMM)
|
||||||
* @param groupNo 검색 그룹
|
* @param groupNo 검색 그룹
|
||||||
* @return
|
* @return
|
||||||
@@ -45,4 +46,36 @@ public class DailyRecordUIController {
|
|||||||
|
|
||||||
return "record/daily";
|
return "record/daily";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 일계부 등록 완료(종료) 화면
|
||||||
|
*
|
||||||
|
* @param model Model
|
||||||
|
* @param searchMonth 검색 월(yyyyMM)
|
||||||
|
* @param groupNo 검색 그룹
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping(path = "/{searchMonth}/{groupNo}/done")
|
||||||
|
public String done(Model model, @PathVariable("searchMonth") String searchMonth, @PathVariable("groupNo") String groupNo) {
|
||||||
|
|
||||||
|
DailyUIReqVO reqVO = new DailyUIReqVO(searchMonth, groupNo);
|
||||||
|
log.debug("reqVO: {}", reqVO);
|
||||||
|
|
||||||
|
DailyRecordDto dailyRecord = dailyRecordPortIn.detail(reqVO);
|
||||||
|
if (dailyRecord == null) {
|
||||||
|
throw new NoMatchingURIException("[Record] 잘못된 접근");
|
||||||
|
}
|
||||||
|
|
||||||
|
String modelAndView = "record/daily/done";
|
||||||
|
if (DailyStatus.TODAY_NONE.equals(dailyRecord.getAllStatus())) {
|
||||||
|
modelAndView = "record/daily/finish";
|
||||||
|
}
|
||||||
|
|
||||||
|
model.addAttribute("reqVO", reqVO);
|
||||||
|
model.addAttribute("dailyRecord", dailyRecord);
|
||||||
|
|
||||||
|
return modelAndView;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,6 +25,18 @@ public class CreateDailyRecordReqVO {
|
|||||||
public void setTodayNone(String todayNone) {
|
public void setTodayNone(String todayNone) {
|
||||||
if ("Y".equals(todayNone)) {
|
if ("Y".equals(todayNone)) {
|
||||||
this.allStatus = DailyStatus.TODAY_NONE;
|
this.allStatus = DailyStatus.TODAY_NONE;
|
||||||
|
this.incomeStatus = DailyTargetStatus.TODAY_NONE;
|
||||||
|
this.workStatus = DailyTargetStatus.TODAY_NONE;
|
||||||
|
this.expenseStatus = DailyTargetStatus.TODAY_NONE;
|
||||||
|
this.powerStatus = DailyTargetStatus.TODAY_NONE;
|
||||||
|
this.forestryStatus = DailyTargetStatus.TODAY_NONE;
|
||||||
|
|
||||||
|
// TODO : 7의 배수와 마지막날의 기준
|
||||||
|
if (dayGroupNo == 4 || dayGroupNo == 8 || dayGroupNo == 12 || dayGroupNo == 16 || dayGroupNo == 17) {
|
||||||
|
this.farmingStatus = DailyTargetStatus.TODAY_NONE;
|
||||||
|
} else {
|
||||||
|
this.farmingStatus = DailyTargetStatus.NONE;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
this.allStatus = DailyStatus.WAITING;
|
this.allStatus = DailyStatus.WAITING;
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package app.module.front.usecase.daily.record.adapters.web.model;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public enum DailySort {
|
||||||
|
INCOME("수입"),
|
||||||
|
WORK("임업노동 투입"),
|
||||||
|
EXPENSE("지출"),
|
||||||
|
POWER("동력 사용시간"),
|
||||||
|
FORESTRY("임업생산물 중 자가소비량"),
|
||||||
|
FARMING("농업생산물 중 자가소비량"),
|
||||||
|
;
|
||||||
|
|
||||||
|
private final String desc;
|
||||||
|
}
|
||||||
@@ -4,14 +4,22 @@ import app.module.front.config.application.util.AuditUtil;
|
|||||||
import app.module.front.config.application.util.AuthUtil;
|
import app.module.front.config.application.util.AuthUtil;
|
||||||
import app.module.front.usecase.daily.record.adapters.persistence.model.DailyRecordDto;
|
import app.module.front.usecase.daily.record.adapters.persistence.model.DailyRecordDto;
|
||||||
import app.module.front.usecase.daily.record.adapters.web.model.CreateDailyRecordReqVO;
|
import app.module.front.usecase.daily.record.adapters.web.model.CreateDailyRecordReqVO;
|
||||||
|
import app.module.front.usecase.daily.record.adapters.web.model.DailySort;
|
||||||
|
import app.module.front.usecase.daily.record.adapters.web.model.DailyTargetStatus;
|
||||||
import app.module.front.usecase.daily.record.adapters.web.model.DailyUIReqVO;
|
import app.module.front.usecase.daily.record.adapters.web.model.DailyUIReqVO;
|
||||||
import app.module.front.usecase.daily.record.ports.DailyRecordPortIn;
|
import app.module.front.usecase.daily.record.ports.DailyRecordPortIn;
|
||||||
import app.module.front.usecase.daily.record.ports.DailyRecordPortOut;
|
import app.module.front.usecase.daily.record.ports.DailyRecordPortOut;
|
||||||
import app.module.front.usecase.daily.record.ports.application.domain.CreateDailyRecordCmd;
|
import app.module.front.usecase.daily.record.ports.application.domain.CreateDailyRecordCmd;
|
||||||
import app.module.front.usecase.daily.record.ports.application.domain.GetDailyRecordCmd;
|
import app.module.front.usecase.daily.record.ports.application.domain.GetDailyRecordCmd;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class DailyRecordService implements DailyRecordPortIn {
|
public class DailyRecordService implements DailyRecordPortIn {
|
||||||
@@ -19,9 +27,49 @@ public class DailyRecordService implements DailyRecordPortIn {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DailyRecordDto detail(DailyUIReqVO reqVO) {
|
public DailyRecordDto detail(DailyUIReqVO reqVO) {
|
||||||
return portOut.detail(new GetDailyRecordCmd(reqVO.getSearchMonth(),
|
DailyRecordDto dailyRecord = portOut.detail(new GetDailyRecordCmd(reqVO.getSearchMonth(),
|
||||||
reqVO.getGroupNo(),
|
reqVO.getGroupNo(),
|
||||||
reqVO.getHouseholdSeq()));
|
reqVO.getHouseholdSeq()));
|
||||||
|
|
||||||
|
if (dailyRecord != null) {
|
||||||
|
// TODO : 이전 다음을 체크하기 위함
|
||||||
|
List<DailySort> targetList = new ArrayList<>();
|
||||||
|
if (this.isTarget(dailyRecord.getIncomeStatus())) {
|
||||||
|
targetList.add(DailySort.INCOME);
|
||||||
|
}
|
||||||
|
if (this.isTarget(dailyRecord.getWorkStatus())) {
|
||||||
|
targetList.add(DailySort.WORK);
|
||||||
|
}
|
||||||
|
if (this.isTarget(dailyRecord.getExpenseStatus())) {
|
||||||
|
targetList.add(DailySort.EXPENSE);
|
||||||
|
}
|
||||||
|
if (this.isTarget(dailyRecord.getPowerStatus())) {
|
||||||
|
targetList.add(DailySort.POWER);
|
||||||
|
}
|
||||||
|
if (this.isTarget(dailyRecord.getForestryStatus())) {
|
||||||
|
targetList.add(DailySort.FORESTRY);
|
||||||
|
}
|
||||||
|
if (this.isTarget(dailyRecord.getFarmingStatus())) {
|
||||||
|
targetList.add(DailySort.FARMING);
|
||||||
|
}
|
||||||
|
dailyRecord.setTargetList(targetList);
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO : 마지막날 건의사항 모달 팝업 뜨는 것
|
||||||
|
LocalDate lastDate = dailyRecord.getEndDate().withDayOfMonth(dailyRecord.getEndDate().lengthOfMonth());
|
||||||
|
log.debug("lastDate: {}", lastDate);
|
||||||
|
|
||||||
|
if (dailyRecord.getEndDate() == lastDate) {
|
||||||
|
dailyRecord.setLastDay(true);
|
||||||
|
} else {
|
||||||
|
dailyRecord.setLastDay(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
return dailyRecord;
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean isTarget(DailyTargetStatus status) {
|
||||||
|
return DailyTargetStatus.TARGET.equals(status) || DailyTargetStatus.TODAY_NONE.equals(status);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package app.module.front.usecase.suggestion.adapters.persistence;
|
||||||
|
|
||||||
|
import app.module.front.usecase.suggestion.ports.SuggestionPortOut;
|
||||||
|
import app.module.front.usecase.suggestion.ports.application.domain.CreateSuggestionCmd;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class SuggestionDao implements SuggestionPortOut {
|
||||||
|
private final SuggestionMapper suggestionMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void create(CreateSuggestionCmd command) {
|
||||||
|
suggestionMapper.createSuggestion(command);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package app.module.front.usecase.suggestion.adapters.persistence;
|
||||||
|
|
||||||
|
import app.module.front.usecase.suggestion.ports.application.domain.CreateSuggestionCmd;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface SuggestionMapper {
|
||||||
|
/**
|
||||||
|
* 건의사항 등록
|
||||||
|
*
|
||||||
|
* @param command 등록 데이터
|
||||||
|
*/
|
||||||
|
void createSuggestion(CreateSuggestionCmd command);
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package app.module.front.usecase.suggestion.adapters.web;
|
||||||
|
|
||||||
|
import app.module.front.usecase.suggestion.adapters.web.model.CreateSuggestionReqVO;
|
||||||
|
import app.module.front.usecase.suggestion.ports.SuggestionPortIn;
|
||||||
|
import jakarta.validation.Valid;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RequestMapping(path = "/api/suggestion")
|
||||||
|
public class SuggestionController {
|
||||||
|
private final SuggestionPortIn suggestionPortIn;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 건의사항 등록 처리
|
||||||
|
*
|
||||||
|
* @param formVO 입력 데이터
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping(path = "")
|
||||||
|
ResponseEntity<?> create(@Valid @RequestBody CreateSuggestionReqVO formVO) {
|
||||||
|
log.debug("formVO: {}", formVO);
|
||||||
|
|
||||||
|
suggestionPortIn.create(formVO);
|
||||||
|
|
||||||
|
return ResponseEntity.status(HttpStatus.OK).body(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package app.module.front.usecase.suggestion.adapters.web.model;
|
||||||
|
|
||||||
|
import app.module.front.usecase.daily.record.adapters.web.model.DailyUIReqVO;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.ToString;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class CreateSuggestionReqVO extends DailyUIReqVO {
|
||||||
|
/**
|
||||||
|
* 내용
|
||||||
|
*/
|
||||||
|
private String content;
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package app.module.front.usecase.suggestion.ports;
|
||||||
|
|
||||||
|
import app.module.front.usecase.suggestion.adapters.web.model.CreateSuggestionReqVO;
|
||||||
|
|
||||||
|
public interface SuggestionPortIn {
|
||||||
|
/**
|
||||||
|
* 건의사항 등록
|
||||||
|
*
|
||||||
|
* @param formVO 입력 데이터
|
||||||
|
*/
|
||||||
|
void create(CreateSuggestionReqVO formVO);
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package app.module.front.usecase.suggestion.ports;
|
||||||
|
|
||||||
|
import app.module.front.usecase.suggestion.ports.application.domain.CreateSuggestionCmd;
|
||||||
|
|
||||||
|
public interface SuggestionPortOut {
|
||||||
|
/**
|
||||||
|
* 건의사항 등록
|
||||||
|
*
|
||||||
|
* @param command 입력 데이터
|
||||||
|
*/
|
||||||
|
void create(CreateSuggestionCmd command);
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package app.module.front.usecase.suggestion.ports.application;
|
||||||
|
|
||||||
|
import app.module.front.config.application.util.AuditUtil;
|
||||||
|
import app.module.front.usecase.suggestion.adapters.web.model.CreateSuggestionReqVO;
|
||||||
|
import app.module.front.usecase.suggestion.ports.SuggestionPortIn;
|
||||||
|
import app.module.front.usecase.suggestion.ports.SuggestionPortOut;
|
||||||
|
import app.module.front.usecase.suggestion.ports.application.domain.CreateSuggestionCmd;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class SuggestionService implements SuggestionPortIn {
|
||||||
|
private final SuggestionPortOut portOut;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void create(CreateSuggestionReqVO formVO) {
|
||||||
|
CreateSuggestionCmd command = AuditUtil.create(
|
||||||
|
new CreateSuggestionCmd(
|
||||||
|
formVO.getContent()));
|
||||||
|
|
||||||
|
portOut.create(command);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package app.module.front.usecase.suggestion.ports.application.domain;
|
||||||
|
|
||||||
|
import app.module.front.config.adapters.persistence.component.FrontAuditCommand;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.ToString;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@AllArgsConstructor
|
||||||
|
@ToString
|
||||||
|
public class CreateSuggestionCmd extends FrontAuditCommand {
|
||||||
|
private String content;
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<?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.front.usecase.suggestion.adapters.persistence.SuggestionMapper">
|
||||||
|
|
||||||
|
<insert id="createSuggestion">
|
||||||
|
insert into suggestion (
|
||||||
|
household_seq
|
||||||
|
, content
|
||||||
|
, is_deleted
|
||||||
|
, <include refid="common.fields.CreateUpdateBaseColumns"/>
|
||||||
|
) values (
|
||||||
|
#{householdSeq}
|
||||||
|
, #{content}
|
||||||
|
, false
|
||||||
|
, <include refid="common.fields.CreateUpdateBaseValues"/>
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -43,3 +43,4 @@ uri.front.record.expense.{{pathVar}}=\uC77C\uACC4\uBD80 \uB4F1\uB85D
|
|||||||
uri.front.record.work.{{pathVar}}=\uC77C\uACC4\uBD80 \uB4F1\uB85D
|
uri.front.record.work.{{pathVar}}=\uC77C\uACC4\uBD80 \uB4F1\uB85D
|
||||||
uri.front.record.power.{{pathVar}}=\uC77C\uACC4\uBD80 \uB4F1\uB85D
|
uri.front.record.power.{{pathVar}}=\uC77C\uACC4\uBD80 \uB4F1\uB85D
|
||||||
uri.front.record.forestry.{{pathVar}}=\uC77C\uACC4\uBD80 \uB4F1\uB85D
|
uri.front.record.forestry.{{pathVar}}=\uC77C\uACC4\uBD80 \uB4F1\uB85D
|
||||||
|
uri.front.record.daily.done=\uC77C\uACC4\uBD80 \uB4F1\uB85D
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -5,63 +5,82 @@ krip.daily.httpUrl = {
|
|||||||
root: '/record/calendar',
|
root: '/record/calendar',
|
||||||
daily: '/record/daily/{month}/{groupNo}',
|
daily: '/record/daily/{month}/{groupNo}',
|
||||||
target: '/record/{target}/{month}/{groupNo}',
|
target: '/record/{target}/{month}/{groupNo}',
|
||||||
// income: '/record/daily/{month}/{groupNo}/income',
|
|
||||||
// work: '/record/daily/{month}/{groupNo}/work',
|
|
||||||
// expense: '/record/daily/{month}/{groupNo}/expense',
|
|
||||||
// power: '/record/daily/{month}/{groupNo}/power',
|
|
||||||
// forestry: '/record/daily/{month}/{groupNo}/forestry',
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 일계부 현황으로 이동
|
||||||
|
*/
|
||||||
krip.daily.goToMain = function() {
|
krip.daily.goToMain = function() {
|
||||||
location.href = krip.daily.httpUrl.root;
|
location.href = krip.daily.httpUrl.root;
|
||||||
};
|
};
|
||||||
|
|
||||||
krip.daily.goToPrev = function(target, searchMonth, groupNo) {
|
/**
|
||||||
let url = krip.daily.httpUrl.target;
|
* 이전 단계로 이동
|
||||||
url = url.replace('{month}', searchMonth);
|
*/
|
||||||
url = url.replace('{groupNo}', groupNo);
|
|
||||||
url = url.replace('{target}', target);
|
|
||||||
|
|
||||||
console.log(url);
|
|
||||||
};
|
|
||||||
|
|
||||||
krip.daily.goToPrev = function() {
|
krip.daily.goToPrev = function() {
|
||||||
// TODO : history.back 으로 해결 되는가?
|
|
||||||
history.back();
|
history.back();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 다음 단계로 이동
|
||||||
|
* @param target
|
||||||
|
* @param searchMonth
|
||||||
|
* @param groupNo
|
||||||
|
*/
|
||||||
krip.daily.goToNext = function(target, searchMonth, groupNo) {
|
krip.daily.goToNext = function(target, searchMonth, groupNo) {
|
||||||
let url = krip.daily.httpUrl.target;
|
let url = krip.daily.httpUrl.target;
|
||||||
url = url.replace('{month}', searchMonth);
|
url = url.replace('{month}', searchMonth);
|
||||||
url = url.replace('{groupNo}', groupNo);
|
url = url.replace('{groupNo}', groupNo);
|
||||||
url = url.replace('{target}', target);
|
url = url.replace('{target}', target.toLowerCase());
|
||||||
|
|
||||||
|
if (target === 'LAST') {
|
||||||
|
alert('LAST');
|
||||||
|
|
||||||
|
const commentModal = document.querySelector('.commentModal').ui;
|
||||||
|
commentModal.open();
|
||||||
|
|
||||||
|
/*
|
||||||
|
commentModal.open({
|
||||||
|
afterClose() {
|
||||||
|
console.log(1111)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
*/
|
||||||
|
|
||||||
|
//modal02.afterClose
|
||||||
|
|
||||||
|
/*
|
||||||
|
const $modal1 = document.querySelector('.modal02');
|
||||||
|
const modalInstance1 = new etUI.components.Modal();
|
||||||
|
modalInstance1.core.init($modal1, {
|
||||||
|
afterClose(){
|
||||||
|
console.log('ssssssssssssss')
|
||||||
|
}
|
||||||
|
});
|
||||||
|
*/
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
location.href = url;
|
location.href = url;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 금일 등록내용 없음 변경
|
* 완료 단계로 이동
|
||||||
* @param month
|
* @param searchMonth
|
||||||
* @param groupNo
|
* @param groupNo
|
||||||
* @param target
|
|
||||||
* @param checked
|
|
||||||
*/
|
*/
|
||||||
krip.daily.todayNone = function(month, groupNo, target, checked) {
|
krip.daily.goToDone = function(searchMonth, groupNo) {
|
||||||
let url = '/api/record/daily/{month}/{groupNo}/today-none'.replace('{month}', month).replace('{groupNo}', groupNo);
|
let url = krip.daily.httpUrl.daily + '/done';
|
||||||
url += '?target=' + target;
|
url = url.replace('{month}', searchMonth);
|
||||||
url += '&status=' + (checked ? 'Y' : 'N');
|
url = url.replace('{groupNo}', groupNo);
|
||||||
|
|
||||||
ajaxUtil._ajaxAsync(
|
location.replace(url);
|
||||||
url,
|
|
||||||
{},
|
|
||||||
function (rstData, status) {
|
|
||||||
console.log('rstData', rstData)
|
|
||||||
|
|
||||||
$('.component-btns').find('.btn-primary').attr('disabled', !checked);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 기본 UI
|
||||||
|
*/
|
||||||
krip.daily.baseBindUI = function() {
|
krip.daily.baseBindUI = function() {
|
||||||
etUI.locales.ko = {
|
etUI.locales.ko = {
|
||||||
dialog: {
|
dialog: {
|
||||||
@@ -97,6 +116,10 @@ krip.daily.baseBindUI = function() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 수정 팝업
|
||||||
|
* @param id
|
||||||
|
*/
|
||||||
krip.daily.createModal = function(id) {
|
krip.daily.createModal = function(id) {
|
||||||
if (ENV.httpUrl.form === undefined) {
|
if (ENV.httpUrl.form === undefined) {
|
||||||
kri.logger.warn('[daily] form url is none.');
|
kri.logger.warn('[daily] form url is none.');
|
||||||
@@ -126,6 +149,10 @@ krip.daily.createModal = function(id) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 삭제 안내 팝업
|
||||||
|
* @param id
|
||||||
|
*/
|
||||||
krip.daily.removeConfirm = function(id) {
|
krip.daily.removeConfirm = function(id) {
|
||||||
etUI.dialog.alert({
|
etUI.dialog.alert({
|
||||||
title: '삭제 안내',
|
title: '삭제 안내',
|
||||||
@@ -138,6 +165,10 @@ krip.daily.removeConfirm = function(id) {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 삭제 처리
|
||||||
|
* @param id
|
||||||
|
*/
|
||||||
krip.daily.remove = function(id) {
|
krip.daily.remove = function(id) {
|
||||||
if (ENV.httpUrl.remove === undefined) {
|
if (ENV.httpUrl.remove === undefined) {
|
||||||
kri.logger.warn('[daily] remove url is none.');
|
kri.logger.warn('[daily] remove url is none.');
|
||||||
@@ -153,6 +184,9 @@ krip.daily.remove = function(id) {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 초기화 안내 팝업
|
||||||
|
*/
|
||||||
krip.daily.resetConfirm = function() {
|
krip.daily.resetConfirm = function() {
|
||||||
etUI.dialog.alert({
|
etUI.dialog.alert({
|
||||||
title: '초기화 안내',
|
title: '초기화 안내',
|
||||||
@@ -165,6 +199,9 @@ krip.daily.resetConfirm = function() {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 초기화 처리
|
||||||
|
*/
|
||||||
krip.daily.reset = function() {
|
krip.daily.reset = function() {
|
||||||
if (ENV.httpUrl.reset === undefined) {
|
if (ENV.httpUrl.reset === undefined) {
|
||||||
kri.logger.warn('[daily] reset url is none.');
|
kri.logger.warn('[daily] reset url is none.');
|
||||||
@@ -179,3 +216,50 @@ krip.daily.reset = function() {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 금일 등록내용 없음 변경 처리
|
||||||
|
* @param month
|
||||||
|
* @param groupNo
|
||||||
|
* @param target
|
||||||
|
* @param checked
|
||||||
|
*/
|
||||||
|
krip.daily.todayNone = function(month, groupNo, target, checked) {
|
||||||
|
let url = '/api/record/daily/{month}/{groupNo}/today-none'.replace('{month}', month).replace('{groupNo}', groupNo);
|
||||||
|
url += '?target=' + target;
|
||||||
|
url += '&status=' + (checked ? 'Y' : 'N');
|
||||||
|
|
||||||
|
ajaxUtil._ajaxAsync(
|
||||||
|
url,
|
||||||
|
{},
|
||||||
|
function (rstData, status) {
|
||||||
|
console.log('rstData', rstData)
|
||||||
|
|
||||||
|
$('.component-btns').find('.btn-primary').attr('disabled', !checked);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 임가 건의사항 등록 처리
|
||||||
|
* @param month
|
||||||
|
* @param groupNo
|
||||||
|
*/
|
||||||
|
krip.daily.createComment = function(month, groupNo) {
|
||||||
|
const f = document.commentReqForm;
|
||||||
|
|
||||||
|
const obj = $(f).serializeObject();
|
||||||
|
console.log(obj)
|
||||||
|
if (f.content.value === '') {
|
||||||
|
krip.daily.goToDone(month, groupNo);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ajaxUtil._ajaxAsync(
|
||||||
|
'/api/suggestion',
|
||||||
|
obj,
|
||||||
|
function () {
|
||||||
|
krip.daily.goToDone(month, groupNo);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|||||||
@@ -110,8 +110,8 @@
|
|||||||
<h2>[[${#messages.msg(currentURI.id)}]]</h2>
|
<h2>[[${#messages.msg(currentURI.id)}]]</h2>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!--/* TODO 전체메뉴 선택 */-->
|
<!--/* TODO 전체메뉴 선택 2차 */-->
|
||||||
<button type="button" class="btn-allmenu"><span class="hide-txt">전체메뉴 열기</span></button>
|
<!--<button type="button" class="btn-allmenu"><span class="hide-txt">전체메뉴 열기</span></button>-->
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
</th:block>
|
</th:block>
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
49
front/src/main/resources/templates/record/comment-modal.html
Normal file
49
front/src/main/resources/templates/record/comment-modal.html
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
<!--/* [정책] 매달 30~31일 현황 등록 시에 마지막 완료 단계 직전에 노출 */-->
|
||||||
|
<div class="layer-wrap">
|
||||||
|
<div class="component-modal acco-wrap commentModal" data-props-dimm-click="true">
|
||||||
|
<div class="modal-dimm"></div>
|
||||||
|
<div class="modal-frame">
|
||||||
|
<div class="modal-container">
|
||||||
|
<div class="modal-header">
|
||||||
|
<h3 class="modal-tit">임가 건의사항 등록</h3>
|
||||||
|
</div>
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-content-inner">
|
||||||
|
|
||||||
|
<article class="alert-box full green">
|
||||||
|
<ul>
|
||||||
|
<li>임가경제조사 일계부를 작성하시면서 필요한 사항이나 불편하신 점 있으면 적어주세요. 보내주신 의견에 대해서는 가급적 빨리 답변을 드리겠습니다.</li>
|
||||||
|
</ul>
|
||||||
|
</article>
|
||||||
|
|
||||||
|
<form name="commentReqForm">
|
||||||
|
<section class="form-group">
|
||||||
|
<div class="segment-label">
|
||||||
|
<p class="label-txt">
|
||||||
|
임가 건의사항
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div class="component-input" data-props-count="1000" data-props-count-limit="1000">
|
||||||
|
<div class="input-textarea-field">
|
||||||
|
<textarea id="temp_textarea_0001" name="content" type="textarea" class="textarea" placeholder="임가 건의사항을 입력해 주세요."></textarea>
|
||||||
|
<span class="textarea-count" style="opacity: 1">(<em class="textarea-count-num">0</em>/<em class="textarea-count-total">1000</em>)</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<div class="component-btns">
|
||||||
|
<div class="btns-row">
|
||||||
|
<button type="button" class="btn btn-full btn-l btn-primary"
|
||||||
|
th:onclick="krip.daily.createComment([[${reqVO.searchMonth}]], [[${reqVO.groupNo}]])">
|
||||||
|
<span class="btn-txt">등록</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<button type="button" class="modal-close"></button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@@ -100,12 +100,17 @@
|
|||||||
|
|
||||||
<div class="component-btns fixed">
|
<div class="component-btns fixed">
|
||||||
<div class="btns-row">
|
<div class="btns-row">
|
||||||
<button type="button" class="btn btn-l btn-primary" th:onclick="formControl.createValid([[${reqVO.searchMonth}]], [[${reqVO.groupNo}]])">
|
<button type="button" class="btn btn-l btn-primary _nextStep"
|
||||||
|
th:data-last="${dailyRecord.lastDay}"
|
||||||
|
th:onclick="formControl.createValid([[${reqVO.searchMonth}]], [[${reqVO.groupNo}]])">
|
||||||
<span class="btn-txt">다음 단계로 이동</span>
|
<span class="btn-txt">다음 단계로 이동</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- /* 건의사항 모달 팝업 */ -->
|
||||||
|
<th:block th:replace="~{/record/comment-modal}"></th:block>
|
||||||
|
<!-- /* //건의사항 모달 팝업 */ -->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<section layout:fragment="script">
|
<section layout:fragment="script">
|
||||||
@@ -115,8 +120,8 @@
|
|||||||
httpUrl: {
|
httpUrl: {
|
||||||
create: /*[[|/api/record/daily/${reqVO.searchMonth}/${reqVO.groupNo}|]]*/'createUrl',
|
create: /*[[|/api/record/daily/${reqVO.searchMonth}/${reqVO.groupNo}|]]*/'createUrl',
|
||||||
},
|
},
|
||||||
month: [[${reqVO.searchMonth}]],
|
month: /*[[${reqVO.searchMonth}]]*/'month',
|
||||||
groupNo: [[${reqVO.groupNo}]],
|
groupNo: /*[[${reqVO.groupNo}]]*/'groupNo',
|
||||||
submitted: false,
|
submitted: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -140,17 +145,17 @@
|
|||||||
|
|
||||||
let message = ', 등록하실 항목이 없나요?';
|
let message = ', 등록하실 항목이 없나요?';
|
||||||
let $messageWrap = $('#content .tit-group h3');
|
let $messageWrap = $('#content .tit-group h3');
|
||||||
if ($messageWrap.data('start').indexOf($messageWrap.data('end')) !== -1) {
|
if ($messageWrap.data('start').indexOf($messageWrap.data('end')) === -1) {
|
||||||
message = $messageWrap.data('start') + '~' + $messageWrap.data('end') + message;
|
message = $messageWrap.data('start') + '~' + $messageWrap.data('end') + message;
|
||||||
} else {
|
} else {
|
||||||
message = $messageWrap.data('start') + message;
|
message = $messageWrap.data('start') + message;
|
||||||
}
|
}
|
||||||
|
|
||||||
etUI.dialog.alert({
|
etUI.dialog.alert({
|
||||||
title: "등록 항목 확인",
|
title: '등록 항목 확인',
|
||||||
message: message,
|
message: message,
|
||||||
type: "confirm",
|
type: 'confirm',
|
||||||
dialogType: "confirm",
|
dialogType: 'confirm',
|
||||||
callback: function () {
|
callback: function () {
|
||||||
formControl.create();
|
formControl.create();
|
||||||
},
|
},
|
||||||
@@ -169,9 +174,13 @@
|
|||||||
obj,
|
obj,
|
||||||
function () {
|
function () {
|
||||||
if (f.todayNone.value === 'Y') {
|
if (f.todayNone.value === 'Y') {
|
||||||
krip.daily.goToMain();
|
if ($('._nextStep').data('last')) {
|
||||||
|
krip.daily.goToNext('LAST', ENV.month, ENV.groupNo);
|
||||||
|
} else {
|
||||||
|
krip.daily.goToDone(ENV.month, ENV.groupNo);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
krip.daily.goToNext($('input:checked').eq(0).data('target'), ENV.month, ENV.groupNo);
|
krip.daily.goToMain();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|||||||
37
front/src/main/resources/templates/record/daily/done.html
Normal file
37
front/src/main/resources/templates/record/daily/done.html
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html layout:decorate="~{layout/layout-none}" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
|
||||||
|
xmlns:th="http://www.thymeleaf.org" lang="ko">
|
||||||
|
|
||||||
|
<div layout:fragment="content" th:classappend="acco-wrap">
|
||||||
|
<th:block th:if="${@systemProperties['spring.profiles.active'] eq 'local'}">
|
||||||
|
<div>
|
||||||
|
reqVO: [[${reqVO}]]
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
detail: [[${dailyRecord}]]
|
||||||
|
</div>
|
||||||
|
</th:block>
|
||||||
|
<main id="content" role="main">
|
||||||
|
일계부 등록이
|
||||||
|
모두 완료 되었습니다.
|
||||||
|
</main>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<section layout:fragment="script">
|
||||||
|
<script th:src="@{/static/ui/page/daily-record.js}"></script>
|
||||||
|
<script th:inline="javascript">
|
||||||
|
let ENV = {
|
||||||
|
httpUrl: {
|
||||||
|
create: /*[[|/api/record/daily/${reqVO.searchMonth}/${reqVO.groupNo}|]]*/'createUrl',
|
||||||
|
},
|
||||||
|
month: [[${reqVO.searchMonth}]],
|
||||||
|
groupNo: [[${reqVO.groupNo}]],
|
||||||
|
submitted: false,
|
||||||
|
};
|
||||||
|
|
||||||
|
let formControl = {
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
</html>
|
||||||
102
front/src/main/resources/templates/record/daily/finish.html
Normal file
102
front/src/main/resources/templates/record/daily/finish.html
Normal file
@@ -0,0 +1,102 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html layout:decorate="~{layout/layout-none}" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
|
||||||
|
xmlns:th="http://www.thymeleaf.org" lang="ko">
|
||||||
|
|
||||||
|
<div layout:fragment="content" th:classappend="acco-wrap">
|
||||||
|
<main id="content" role="main">
|
||||||
|
<div class="inner">
|
||||||
|
<hgroup class="tit-group">
|
||||||
|
<i class="ico-alert-lightgreen ico-xlarge" aria-hidden="true"></i>
|
||||||
|
<h3>
|
||||||
|
일계부 등록이 <br>
|
||||||
|
종료 되었습니다.
|
||||||
|
</h3>
|
||||||
|
<p>
|
||||||
|
추가 입력 없이 등록 절차를 마쳤습니다. <br>
|
||||||
|
항목에 대한 '추가/수정/삭제'는 일계부에서 가능합니다.
|
||||||
|
</p>
|
||||||
|
</hgroup>
|
||||||
|
|
||||||
|
<section class="regist-item-area complete">
|
||||||
|
<div class="item-list">
|
||||||
|
<div class="list-item no-data"
|
||||||
|
th:each="item, itemStatus : ${dailyRecord.targetList}">
|
||||||
|
<div class="item-tit-group">
|
||||||
|
<p class="item-name">[[${item.desc}]]</p>
|
||||||
|
</div>
|
||||||
|
<ul class="detail-list">
|
||||||
|
<li>
|
||||||
|
<p>없음</p>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="list-item no-data">
|
||||||
|
<div class="item-tit-group">
|
||||||
|
<p class="item-name">임업노동 투입</p>
|
||||||
|
</div>
|
||||||
|
<ul class="detail-list">
|
||||||
|
<li>
|
||||||
|
<p>없음</p>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="list-item no-data">
|
||||||
|
<div class="item-tit-group">
|
||||||
|
<p class="item-name">지출</p>
|
||||||
|
</div>
|
||||||
|
<ul class="detail-list">
|
||||||
|
<li>
|
||||||
|
<p>없음</p>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="list-item no-data">
|
||||||
|
<div class="item-tit-group">
|
||||||
|
<p class="item-name">동력 사용시간</p>
|
||||||
|
</div>
|
||||||
|
<ul class="detail-list">
|
||||||
|
<li>
|
||||||
|
<p>없음</p>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="list-item no-data">
|
||||||
|
<div class="item-tit-group">
|
||||||
|
<p class="item-name">임업생산물 중 자가소비량</p>
|
||||||
|
</div>
|
||||||
|
<ul class="detail-list">
|
||||||
|
<li>
|
||||||
|
<p>없음</p>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="list-item no-data">
|
||||||
|
<div class="item-tit-group">
|
||||||
|
<p class="item-name">농업생산물 중 자가소비량</p>
|
||||||
|
</div>
|
||||||
|
<ul class="detail-list">
|
||||||
|
<li>
|
||||||
|
<p>없음</p>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
|
||||||
|
<div class="component-btns fixed">
|
||||||
|
<div class="btns-row">
|
||||||
|
<button type="button" class="btn btn-l btn-primary" onclick="krip.daily.goToMain();">
|
||||||
|
<span class="btn-txt">확인</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<section layout:fragment="script">
|
||||||
|
<script th:src="@{/static/ui/page/daily-record.js}"></script>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
</html>
|
||||||
@@ -92,13 +92,15 @@
|
|||||||
</main>
|
</main>
|
||||||
|
|
||||||
<!-- 하단 고정 버튼 -->
|
<!-- 하단 고정 버튼 -->
|
||||||
<div class="component-btns fixed">
|
<div class="component-btns fixed"
|
||||||
|
th:if="${moveStep}">
|
||||||
<div class="btns-row">
|
<div class="btns-row">
|
||||||
<button type="button" class="btn btn-l btn-secondary" onclick="krip.daily.goToPrev();">
|
<button type="button" class="btn btn-l btn-secondary" onclick="krip.daily.goToPrev();">
|
||||||
<span class="btn-txt">이전 단계로 이동</span>
|
<span class="btn-txt">이전 단계로 이동</span>
|
||||||
</button>
|
</button>
|
||||||
<button type="button" class="btn btn-l btn-primary"
|
<button type="button" class="btn btn-l btn-primary"
|
||||||
th:disabled="${not #strings.equals(dailyRecord.expenseStatus, 'TODAY_NONE') and #lists.isEmpty(expenseList)}">
|
th:disabled="${not #strings.equals(dailyRecord.expenseStatus, 'TODAY_NONE') and #lists.isEmpty(expenseList)}"
|
||||||
|
th:onclick="krip.daily.goToNext([[${nextStep}]], [[${reqVO.searchMonth}]], [[${reqVO.groupNo}]])">
|
||||||
<span class="btn-txt">다음 단계로 이동</span>
|
<span class="btn-txt">다음 단계로 이동</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -122,6 +124,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- //모달 팝업 -->
|
<!-- //모달 팝업 -->
|
||||||
|
<!-- /* 건의사항 모달 팝업 */ -->
|
||||||
|
<th:block th:replace="~{/record/comment-modal}"></th:block>
|
||||||
|
<!-- /* //건의사항 모달 팝업 */ -->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<section layout:fragment="script">
|
<section layout:fragment="script">
|
||||||
@@ -165,10 +170,7 @@
|
|||||||
console.log('selectItemCallback', selectValue, dataValue)
|
console.log('selectItemCallback', selectValue, dataValue)
|
||||||
$('input[name="unitCode"]').val(dataValue)
|
$('input[name="unitCode"]').val(dataValue)
|
||||||
|
|
||||||
// TODO : ui js 에서 show 적용유무 파악하기
|
etUI.pages.initDirectInputToggle();
|
||||||
if (dataValue === 'code.record.unit.self') {
|
|
||||||
$('#unitCode').parent().find('.component-input').addClass('show');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -220,16 +222,7 @@
|
|||||||
ENV.httpUrl.create.replace('{id}', f.id.value ? f.id.value : '0'),
|
ENV.httpUrl.create.replace('{id}', f.id.value ? f.id.value : '0'),
|
||||||
obj,
|
obj,
|
||||||
function (rstData, status) {
|
function (rstData, status) {
|
||||||
console.log('rstData', rstData)
|
|
||||||
location.reload();
|
location.reload();
|
||||||
// TODO : next
|
|
||||||
/*
|
|
||||||
if (f.todayNone.value === 'Y') {
|
|
||||||
krip.daily.goToMain();
|
|
||||||
} else {
|
|
||||||
krip.daily.goToNext($('input:checked').eq(0).data('target'), ENV.month, ENV.groupNo);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -96,13 +96,15 @@
|
|||||||
</main>
|
</main>
|
||||||
|
|
||||||
<!-- 하단 고정 버튼 -->
|
<!-- 하단 고정 버튼 -->
|
||||||
<div class="component-btns fixed">
|
<div class="component-btns fixed"
|
||||||
|
th:if="${moveStep}">
|
||||||
<div class="btns-row">
|
<div class="btns-row">
|
||||||
<button type="button" class="btn btn-l btn-secondary" onclick="krip.daily.goToPrev();">
|
<button type="button" class="btn btn-l btn-secondary" onclick="krip.daily.goToPrev();">
|
||||||
<span class="btn-txt">이전 단계로 이동</span>
|
<span class="btn-txt">이전 단계로 이동</span>
|
||||||
</button>
|
</button>
|
||||||
<button type="button" class="btn btn-l btn-primary"
|
<button type="button" class="btn btn-l btn-primary"
|
||||||
th:disabled="${not #strings.equals(dailyRecord.incomeStatus, 'TODAY_NONE') and #lists.isEmpty(incomeList)}">
|
th:disabled="${not #strings.equals(dailyRecord.incomeStatus, 'TODAY_NONE') and #lists.isEmpty(incomeList)}"
|
||||||
|
th:onclick="krip.daily.goToNext([[${nextStep}]], [[${reqVO.searchMonth}]], [[${reqVO.groupNo}]])">
|
||||||
<span class="btn-txt">다음 단계로 이동</span>
|
<span class="btn-txt">다음 단계로 이동</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -126,6 +128,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- //모달 팝업 -->
|
<!-- //모달 팝업 -->
|
||||||
|
<!-- /* 건의사항 모달 팝업 */ -->
|
||||||
|
<th:block th:replace="~{/record/comment-modal}"></th:block>
|
||||||
|
<!-- /* //건의사항 모달 팝업 */ -->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<section layout:fragment="script">
|
<section layout:fragment="script">
|
||||||
@@ -178,12 +183,7 @@
|
|||||||
console.log('selectItemCallback', selectValue, dataValue)
|
console.log('selectItemCallback', selectValue, dataValue)
|
||||||
$('input[name="unitCode"]').val(dataValue)
|
$('input[name="unitCode"]').val(dataValue)
|
||||||
|
|
||||||
// TODO : ui js 에서 show 적용유무 파악하기
|
etUI.pages.initDirectInputToggle();
|
||||||
/*
|
|
||||||
if (dataValue === 'code.record.unit.self') {
|
|
||||||
$('#unitCode').parent().find('.component-input').addClass('show');
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -240,16 +240,7 @@
|
|||||||
ENV.httpUrl.create.replace('{id}', f.id.value ? f.id.value : '0'),
|
ENV.httpUrl.create.replace('{id}', f.id.value ? f.id.value : '0'),
|
||||||
obj,
|
obj,
|
||||||
function (rstData, status) {
|
function (rstData, status) {
|
||||||
console.log('rstData', rstData)
|
|
||||||
location.reload();
|
location.reload();
|
||||||
// TODO : next
|
|
||||||
/*
|
|
||||||
if (f.todayNone.value === 'Y') {
|
|
||||||
krip.daily.goToMain();
|
|
||||||
} else {
|
|
||||||
krip.daily.goToNext($('input:checked').eq(0).data('target'), ENV.month, ENV.groupNo);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user