Merge branch 'daily' into dev
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
package app.module.front.usecase.daily.calendar.adapters.persistence;
|
||||
|
||||
import app.module.core.config.application.enums.MonthStatus;
|
||||
import app.module.front.usecase.daily.calendar.adapters.persistence.model.DailyRecordCalendarDto;
|
||||
import app.module.front.usecase.daily.calendar.adapters.persistence.model.DailyRecordStatusDto;
|
||||
import app.module.front.usecase.daily.calendar.adapters.persistence.model.MonthlyStatusDto;
|
||||
import app.module.front.usecase.daily.calendar.ports.RecordCalendarPortOut;
|
||||
import app.module.front.usecase.daily.calendar.ports.application.domain.RecordCalendar;
|
||||
import app.module.front.usecase.daily.calendar.ports.application.domain.CalendarChildren;
|
||||
@@ -10,6 +12,8 @@ import app.module.front.usecase.daily.record.adapters.web.model.DailyTargetStatu
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
@@ -24,6 +28,7 @@ public class RecordCalendarDao implements RecordCalendarPortOut {
|
||||
public List<RecordCalendar> operate(RecordCalendarCmd command) {
|
||||
List<DailyRecordCalendarDto> calendarList = this.getCalendarList(command);
|
||||
List<DailyRecordStatusDto> statusList = this.getDailyRecordStatus(command);
|
||||
MonthlyStatusDto monthlyStatus = this.getBankExist(command);
|
||||
|
||||
String pathFormat = "/record/%s/%s/%s";
|
||||
|
||||
@@ -38,10 +43,10 @@ public class RecordCalendarDao implements RecordCalendarPortOut {
|
||||
.filter(f -> Objects.equals(calendar.getDailyId(), f.getDailyId()))
|
||||
.findFirst().orElse(null);
|
||||
|
||||
List<CalendarChildren> childList = new ArrayList<>();
|
||||
if (findStatus == null) {
|
||||
refine.setChildren(new ArrayList<>());
|
||||
} else {
|
||||
List<CalendarChildren> childList = new ArrayList<>();
|
||||
if (DailyTargetStatus.TARGET.equals(findStatus.getIncomeStatus())
|
||||
|| DailyTargetStatus.TODAY_NONE.equals(findStatus.getIncomeStatus())) {
|
||||
childList.add(new CalendarChildren(
|
||||
@@ -90,23 +95,22 @@ public class RecordCalendarDao implements RecordCalendarPortOut {
|
||||
findStatus.getFarmingCount(),
|
||||
String.format(pathFormat, "farming", command.getSearchMonth(), findStatus.getDayGroupNo())));
|
||||
}
|
||||
|
||||
// TODO /info/monthly
|
||||
childList.add(new CalendarChildren(
|
||||
"MONTHLY",
|
||||
"임산물 현황 등록",
|
||||
0,
|
||||
String.format("/info/monthly/month/%s", command.getSearchMonth())));
|
||||
|
||||
childList.add(new CalendarChildren(
|
||||
"BANK",
|
||||
"은행 자동이체 내역 등록",
|
||||
0,
|
||||
"/info/bank"));
|
||||
|
||||
refine.setChildren(childList);
|
||||
}
|
||||
|
||||
childList.add(new CalendarChildren(
|
||||
"MONTHLY",
|
||||
"임산물 현황 등록",
|
||||
monthlyStatus.isForestNone() ? 0 : 1,
|
||||
String.format("/info/monthly/month/%s", command.getSearchMonth())));
|
||||
|
||||
childList.add(new CalendarChildren(
|
||||
"BANK",
|
||||
"은행 자동이체 내역 등록",
|
||||
monthlyStatus.isBankNone() ? 0 : 1,
|
||||
(LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMM")).equals(command.getSearchMonth())) ? "/info/bank" : null));
|
||||
|
||||
refine.setChildren(childList);
|
||||
|
||||
refineList.add(refine);
|
||||
}
|
||||
|
||||
@@ -151,4 +155,16 @@ public class RecordCalendarDao implements RecordCalendarPortOut {
|
||||
|
||||
return statusList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 특정월의 월별 작성 상태 조회
|
||||
*
|
||||
* @param command 검색 조건
|
||||
* @return true=등록완료, false=미등록
|
||||
*/
|
||||
private MonthlyStatusDto getBankExist(RecordCalendarCmd command) {
|
||||
MonthlyStatusDto detail = recordCalendarMapper.getMonthlyStatus(command);
|
||||
|
||||
return detail == null ? new MonthlyStatusDto(MonthStatus.NONE, MonthStatus.NONE, MonthStatus.NONE) : detail;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package app.module.front.usecase.daily.calendar.adapters.persistence;
|
||||
|
||||
import app.module.front.usecase.daily.calendar.adapters.persistence.model.DailyRecordCalendarDto;
|
||||
import app.module.front.usecase.daily.calendar.adapters.persistence.model.DailyRecordStatusDto;
|
||||
import app.module.front.usecase.daily.calendar.adapters.persistence.model.MonthlyStatusDto;
|
||||
import app.module.front.usecase.daily.calendar.ports.application.domain.RecordCalendarCmd;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@@ -12,16 +13,24 @@ public interface RecordCalendarMapper {
|
||||
/**
|
||||
* 특정월의 일 그룹 조회
|
||||
*
|
||||
* @param cmd 검색 조건
|
||||
* @param command 검색 조건
|
||||
* @return 일(DAY) 그룹 목록
|
||||
*/
|
||||
List<DailyRecordCalendarDto> getCalendarByDailyRecord(RecordCalendarCmd cmd);
|
||||
List<DailyRecordCalendarDto> getCalendarByDailyRecord(RecordCalendarCmd command);
|
||||
|
||||
/**
|
||||
* 특정일의 일계부 등록 상태 조회
|
||||
*
|
||||
* @param cmd 검색 조건
|
||||
* @param command 검색 조건
|
||||
* @return 일계부 등록 현황 목록
|
||||
*/
|
||||
List<DailyRecordStatusDto> getDailyRecordStatus(RecordCalendarCmd cmd);
|
||||
List<DailyRecordStatusDto> getDailyRecordStatus(RecordCalendarCmd command);
|
||||
|
||||
/**
|
||||
* 특정월의 월별 작성 상태 조회
|
||||
*
|
||||
* @param command 검색 조건
|
||||
* @return 월별 작성 상태
|
||||
*/
|
||||
MonthlyStatusDto getMonthlyStatus(RecordCalendarCmd command);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
package app.module.front.usecase.daily.calendar.adapters.persistence.model;
|
||||
|
||||
import app.module.core.config.application.enums.MonthStatus;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@ToString
|
||||
public class MonthlyStatusDto {
|
||||
private MonthStatus forestProduct;
|
||||
private MonthStatus bankInput;
|
||||
private MonthStatus bankOutput;
|
||||
|
||||
/**
|
||||
* 임산물 현황 등록 여부
|
||||
* @return true=미등록, false=등록완료
|
||||
*/
|
||||
public boolean isForestNone() {
|
||||
return MonthStatus.NONE.equals(forestProduct) || forestProduct == null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 은행 자동이체 내역 등록 여부
|
||||
* @return true=미등록, false=등록완료
|
||||
*/
|
||||
public boolean isBankNone() {
|
||||
return (MonthStatus.NONE.equals(bankInput) || bankInput == null)
|
||||
&& (MonthStatus.NONE.equals(bankOutput) || bankOutput == null);
|
||||
}
|
||||
}
|
||||
@@ -27,7 +27,7 @@ import java.util.List;
|
||||
@RequestMapping(path = "/record/income")
|
||||
public class DailyIncomeUIController {
|
||||
private final UICodeListPortIn uiCodeListPortIn;
|
||||
private final DailyRecordPortIn dailyRecordService;
|
||||
private final DailyRecordPortIn dailyRecordPortIn;
|
||||
private final DailyIncomePortIn dailyIncomePortIn;
|
||||
|
||||
/**
|
||||
@@ -37,7 +37,6 @@ public class DailyIncomeUIController {
|
||||
* @param searchMonth 검색 월(yyyyMM)
|
||||
* @param groupNo 검색 그룹
|
||||
* @param searchType 수정여부
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(path = "/{searchMonth}/{groupNo}")
|
||||
public String index(Model model, @PathVariable("searchMonth") String searchMonth, @PathVariable("groupNo") String groupNo
|
||||
@@ -66,7 +65,6 @@ public class DailyIncomeUIController {
|
||||
* @param searchMonth 검색 월(yyyyMM)
|
||||
* @param groupNo 검색 그룹
|
||||
* @param id 수입 일련번호
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(path = "/{searchMonth}/{groupNo}/form/{id}")
|
||||
public String formBySelf(Model model, @PathVariable("searchMonth") String searchMonth, @PathVariable("groupNo") String groupNo
|
||||
@@ -102,13 +100,12 @@ public class DailyIncomeUIController {
|
||||
*
|
||||
* @param searchMonth 검색 월(yyyyMM)
|
||||
* @param groupNo 검색 그룹
|
||||
* @return
|
||||
*/
|
||||
private DailyRecordDto vaildGetDailyRecord(String searchMonth, String groupNo) {
|
||||
DailyUIReqVO reqVO = new DailyUIReqVO(searchMonth, groupNo);
|
||||
log.debug("getRecordUIReq: {}", reqVO);
|
||||
|
||||
DailyRecordDto dailyRecord = dailyRecordService.detail(reqVO);
|
||||
DailyRecordDto dailyRecord = dailyRecordPortIn.detail(reqVO);
|
||||
if (dailyRecord == null || dailyRecord.getId() == null) {
|
||||
throw new NoRecordDataException();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
package app.module.front.usecase.daily.power.adapters.persistence;
|
||||
|
||||
import app.module.core.usecase.uicode.list.ports.UICodeListPortIn;
|
||||
import app.module.front.usecase.daily.power.adapters.persistence.model.DailyPowerDto;
|
||||
import app.module.front.usecase.daily.power.ports.DailyPowerPortOut;
|
||||
import app.module.front.usecase.daily.power.ports.application.domain.CreateDailyPowerCmd;
|
||||
import app.module.front.usecase.daily.power.ports.application.domain.GetDailyPowerCmd;
|
||||
import app.module.front.usecase.daily.power.ports.application.domain.RemoveDailyPowerCmd;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class DailyPowerDao implements DailyPowerPortOut {
|
||||
private final UICodeListPortIn uiCodeListPortIn;
|
||||
private final DailyPowerMapper dailyPowerMapper;
|
||||
|
||||
@Override
|
||||
public List<DailyPowerDto> list(GetDailyPowerCmd command) {
|
||||
return dailyPowerMapper.getDailyPowerList(command);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void create(GetDailyPowerCmd findCmd, CreateDailyPowerCmd command) {
|
||||
Integer existCount = dailyPowerMapper.getRecordExistCount(findCmd);
|
||||
if (existCount == 0) {
|
||||
dailyPowerMapper.createDailyPower(command);
|
||||
|
||||
log.debug("[CreateDailyPower] record={}", command);
|
||||
} else {
|
||||
dailyPowerMapper.updateDailyPower(command);
|
||||
|
||||
log.debug("[UpdateDailyPower] record={}", command);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void remove(GetDailyPowerCmd findCmd, RemoveDailyPowerCmd command) {
|
||||
Integer existCount = dailyPowerMapper.getRecordExistCount(findCmd);
|
||||
if (existCount != 0) {
|
||||
dailyPowerMapper.removeDailyPower(command);
|
||||
|
||||
log.debug("[RemoveDailyPower] record={}", command);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package app.module.front.usecase.daily.power.adapters.persistence;
|
||||
|
||||
import app.module.front.usecase.daily.power.ports.application.domain.CreateDailyPowerCmd;
|
||||
import app.module.front.usecase.daily.power.adapters.persistence.model.DailyPowerDto;
|
||||
import app.module.front.usecase.daily.power.ports.application.domain.GetDailyPowerCmd;
|
||||
import app.module.front.usecase.daily.power.ports.application.domain.RemoveDailyPowerCmd;
|
||||
import app.module.front.usecase.daily.power.adapters.web.model.DailyPowerUIReqVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface DailyPowerMapper {
|
||||
/**
|
||||
* 일계부 동력 사용시간 목록 조회
|
||||
*
|
||||
* @param command 검색 조건
|
||||
* @return 동력 사용시간 목록
|
||||
*/
|
||||
List<DailyPowerDto> getDailyPowerList(GetDailyPowerCmd command);
|
||||
|
||||
/**
|
||||
* 일계부 동력 사용시간 데이터 존재 여부
|
||||
*
|
||||
* @param command 검색 조건
|
||||
* @return 중복 개수
|
||||
*/
|
||||
Integer getRecordExistCount(GetDailyPowerCmd command);
|
||||
|
||||
/**
|
||||
* 일계부 동력 사용시간 등록
|
||||
*
|
||||
* @param command 등록 데이터
|
||||
*/
|
||||
void createDailyPower(CreateDailyPowerCmd command);
|
||||
|
||||
/**
|
||||
* 일계부 동력 사용시간 수정
|
||||
*
|
||||
* @param command 수정 데이터
|
||||
*/
|
||||
void updateDailyPower(CreateDailyPowerCmd command);
|
||||
|
||||
/**
|
||||
* 일계부 동력 사용시간 삭제
|
||||
*
|
||||
* @param command 삭제 데이터
|
||||
*/
|
||||
void removeDailyPower(RemoveDailyPowerCmd command);
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package app.module.front.usecase.daily.power.adapters.persistence.model;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class DailyPowerDto {
|
||||
private Long id;
|
||||
private Long dailyRecordSeq;
|
||||
private String equipmentName;
|
||||
private Integer ownedHours;
|
||||
private Integer leasedHours;
|
||||
|
||||
/**
|
||||
* 수정 가능 여부
|
||||
* @return true=가능, false=불가능(등록 상태)
|
||||
*/
|
||||
public boolean isUpdated() {
|
||||
return this.id != null && this.id != 0L;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,131 @@
|
||||
package app.module.front.usecase.daily.power.adapters.web;
|
||||
|
||||
import app.module.core.config.application.exception.NoRecordDataException;
|
||||
import app.module.core.config.application.util.CoreUtil;
|
||||
import app.module.front.usecase.daily.power.adapters.web.model.CreateDailyPowerReqVO;
|
||||
import app.module.front.usecase.daily.power.adapters.web.model.RemoveDailyPowerReqVO;
|
||||
import app.module.front.usecase.daily.power.adapters.web.validator.CreateDailyPowerValidator;
|
||||
import app.module.front.usecase.daily.power.ports.DailyPowerPortIn;
|
||||
import app.module.front.usecase.daily.record.adapters.persistence.model.DailyRecordDto;
|
||||
import app.module.front.usecase.daily.record.adapters.web.model.DailyUIReqVO;
|
||||
import app.module.front.usecase.daily.record.ports.DailyRecordPortIn;
|
||||
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.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping(path = "/api/record/power")
|
||||
public class DailyPowerController {
|
||||
private final CoreUtil coreUtil;
|
||||
private final DailyRecordPortIn dailyRecordService;
|
||||
private final DailyPowerPortIn dailyPowerService;
|
||||
private final CreateDailyPowerValidator createDailyPowerValidator;
|
||||
|
||||
/**
|
||||
* 일계부 동력 사용시간 등록 처리
|
||||
*
|
||||
* @param searchMonth 검색 월(yyyyMM)
|
||||
* @param groupNo 검색 그룹
|
||||
* @param id 수입 일련번호
|
||||
* @param formVO 입력 데이터
|
||||
* @param bindingResult BindingResult
|
||||
*/
|
||||
@PostMapping(path = "/{searchMonth}/{groupNo}/form/{id}")
|
||||
ResponseEntity<?> create(@PathVariable("searchMonth") String searchMonth, @PathVariable("groupNo") String groupNo
|
||||
, @PathVariable("id") String id
|
||||
, @Valid @RequestBody CreateDailyPowerReqVO formVO, BindingResult bindingResult) {
|
||||
|
||||
createDailyPowerValidator.validate(formVO, bindingResult);
|
||||
if (bindingResult.hasErrors()) {
|
||||
return coreUtil.getErrorInfo(bindingResult);
|
||||
}
|
||||
|
||||
DailyRecordDto dailyRecord = this.vaildGetDailyRecord(searchMonth, groupNo);
|
||||
|
||||
formVO.setSearchMonth(searchMonth);
|
||||
formVO.setGroupNo(Integer.parseInt(groupNo));
|
||||
formVO.setId(Long.parseLong(id));
|
||||
formVO.setDailyRecordSeq(dailyRecord.getId());
|
||||
log.debug("formVO: {}", formVO);
|
||||
|
||||
dailyPowerService.create(formVO);
|
||||
|
||||
return ResponseEntity.status(HttpStatus.OK).body(formVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 일계부 동력 사용시간 삭제 처리
|
||||
*
|
||||
* @param searchMonth 검색 월(yyyyMM)
|
||||
* @param groupNo 검색 그룹
|
||||
* @param formVO 입력 데이터
|
||||
* @param bindingResult BindingResult
|
||||
*/
|
||||
@PostMapping(path = "/{searchMonth}/{groupNo}/remove")
|
||||
ResponseEntity<?> remove(@PathVariable("searchMonth") String searchMonth, @PathVariable("groupNo") String groupNo
|
||||
, @Valid @RequestBody RemoveDailyPowerReqVO formVO, BindingResult bindingResult) {
|
||||
|
||||
log.debug("before formVO: {}", formVO);
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResponseEntity.status(HttpStatus.UNPROCESSABLE_ENTITY)
|
||||
.body(bindingResult.getFieldErrors());
|
||||
}
|
||||
|
||||
DailyRecordDto dailyRecord = this.vaildGetDailyRecord(searchMonth, groupNo);
|
||||
|
||||
formVO.setSearchMonth(dailyRecord.getRecordMonth());
|
||||
formVO.setGroupNo(dailyRecord.getGroupNo());
|
||||
formVO.setDailyRecordSeq(dailyRecord.getId());
|
||||
log.debug("formVO: {}", formVO);
|
||||
|
||||
dailyPowerService.remove(formVO);
|
||||
|
||||
return ResponseEntity.status(HttpStatus.OK).body(formVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 일계부 동력 사용시간 전체 삭제 처리
|
||||
*
|
||||
* @param searchMonth 검색 월(yyyyMM)
|
||||
* @param groupNo 검색 그룹
|
||||
*/
|
||||
@PostMapping(path = "/{searchMonth}/{groupNo}/reset")
|
||||
ResponseEntity<?> removeAll(@PathVariable("searchMonth") String searchMonth, @PathVariable("groupNo") String groupNo) {
|
||||
|
||||
DailyRecordDto dailyRecord = this.vaildGetDailyRecord(searchMonth, groupNo);
|
||||
|
||||
RemoveDailyPowerReqVO formVO = new RemoveDailyPowerReqVO();
|
||||
formVO.setSearchMonth(dailyRecord.getRecordMonth());
|
||||
formVO.setGroupNo(dailyRecord.getGroupNo());
|
||||
formVO.setDailyRecordSeq(dailyRecord.getId());
|
||||
log.debug("formVO: {}", formVO);
|
||||
|
||||
dailyPowerService.remove(formVO);
|
||||
|
||||
return ResponseEntity.status(HttpStatus.OK).body(formVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 일계부 유효성 체크 및 데이터 조회
|
||||
*
|
||||
* @param searchMonth 검색 월(yyyyMM)
|
||||
* @param groupNo 검색 그룹
|
||||
*/
|
||||
private DailyRecordDto vaildGetDailyRecord(String searchMonth, String groupNo) {
|
||||
DailyUIReqVO reqVO = new DailyUIReqVO(searchMonth, groupNo);
|
||||
log.debug("getRecordUIReq: {}", reqVO);
|
||||
|
||||
DailyRecordDto dailyRecord = dailyRecordService.detail(reqVO);
|
||||
if (dailyRecord == null || dailyRecord.getId() == null) {
|
||||
throw new NoRecordDataException();
|
||||
}
|
||||
|
||||
return dailyRecord;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
package app.module.front.usecase.daily.power.adapters.web;
|
||||
|
||||
import app.module.core.config.application.exception.NoRecordDataException;
|
||||
import app.module.front.usecase.daily.power.adapters.persistence.model.DailyPowerDto;
|
||||
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.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.ports.DailyRecordPortIn;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.thymeleaf.util.StringUtils;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@Controller
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping(path = "/record/power")
|
||||
public class DailyPowerUIController {
|
||||
private final DailyRecordPortIn dailyRecordPortIn;
|
||||
private final DailyPowerPortIn dailyPowerPortIn;
|
||||
|
||||
/**
|
||||
* 일계부 동력 사용시간 목록 화면
|
||||
*
|
||||
* @param model Model
|
||||
* @param searchMonth 검색 월(yyyyMM)
|
||||
* @param groupNo 검색 그룹
|
||||
* @param searchType 수정여부
|
||||
*/
|
||||
@GetMapping(path = "/{searchMonth}/{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);
|
||||
|
||||
DailyPowerUIReqVO reqVO = new DailyPowerUIReqVO(searchMonth, groupNo);
|
||||
log.debug("reqVO: {}", reqVO);
|
||||
|
||||
List<DailyPowerDto> powerList = dailyPowerPortIn.list(reqVO);
|
||||
|
||||
model.addAttribute("reqVO", reqVO);
|
||||
model.addAttribute("dailyRecord", dailyRecord);
|
||||
model.addAttribute("powerList", powerList);
|
||||
model.addAttribute("moveStep", !"update".equals(searchType));
|
||||
model.addAttribute("nextStep", dailyRecord.getNextStep(DailySort.POWER));
|
||||
|
||||
return "record/power/index";
|
||||
}
|
||||
|
||||
/**
|
||||
* 일계부 동력 사용시간 등록 화면
|
||||
*
|
||||
* @param model Model
|
||||
* @param searchMonth 검색 월(yyyyMM)
|
||||
* @param groupNo 검색 그룹
|
||||
* @param id 수입 일련번호
|
||||
*/
|
||||
@GetMapping(path = "/{searchMonth}/{groupNo}/form/{id}")
|
||||
public String formBySelf(Model model, @PathVariable("searchMonth") String searchMonth, @PathVariable("groupNo") String groupNo
|
||||
, @PathVariable("id") String id) {
|
||||
|
||||
DailyPowerUIReqVO reqVO = new DailyPowerUIReqVO(searchMonth, groupNo);
|
||||
if (StringUtils.isEmpty(id)) {
|
||||
reqVO.setId(0L);
|
||||
} else {
|
||||
reqVO.setId(Long.parseLong(id));
|
||||
}
|
||||
log.debug("reqVO: {}", reqVO);
|
||||
|
||||
DailyPowerDto detail = new DailyPowerDto();
|
||||
if (reqVO.getId() != 0L) {
|
||||
detail = dailyPowerPortIn.detail(reqVO);
|
||||
if (detail == null || !detail.isUpdated()) {
|
||||
throw new NoRecordDataException();
|
||||
}
|
||||
}
|
||||
|
||||
model.addAttribute("reqVO", reqVO);
|
||||
model.addAttribute("detail", detail);
|
||||
|
||||
return "record/power/form";
|
||||
}
|
||||
|
||||
/**
|
||||
* 일계부 유효성 체크 및 데이터 조회
|
||||
*
|
||||
* @param searchMonth 검색 월(yyyyMM)
|
||||
* @param groupNo 검색 그룹
|
||||
*/
|
||||
private DailyRecordDto vaildGetDailyRecord(String searchMonth, String groupNo) {
|
||||
DailyUIReqVO reqVO = new DailyUIReqVO(searchMonth, groupNo);
|
||||
log.debug("getRecordUIReq: {}", reqVO);
|
||||
|
||||
DailyRecordDto dailyRecord = dailyRecordPortIn.detail(reqVO);
|
||||
if (dailyRecord == null || dailyRecord.getId() == null) {
|
||||
throw new NoRecordDataException();
|
||||
}
|
||||
|
||||
return dailyRecord;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package app.module.front.usecase.daily.power.adapters.web.model;
|
||||
|
||||
import app.module.front.usecase.daily.record.adapters.web.model.DailyUIReqVO;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString(callSuper = true)
|
||||
public class CreateDailyPowerReqVO extends DailyUIReqVO {
|
||||
/**
|
||||
* 동력 사용시간 일련번호
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 일계부 일련번호
|
||||
*/
|
||||
private Long dailyRecordSeq;
|
||||
|
||||
/**
|
||||
* 명칭
|
||||
*/
|
||||
@NotBlank(message = "사용 기계 이름을 입력해 주세요.")
|
||||
private String equipmentName;
|
||||
/**
|
||||
* 자가 사용시간
|
||||
*/
|
||||
private Integer ownedHours;
|
||||
/**
|
||||
* 임차 사용시간
|
||||
*/
|
||||
private Integer leasedHours;
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package app.module.front.usecase.daily.power.adapters.web.model;
|
||||
|
||||
import app.module.front.usecase.daily.record.adapters.web.model.DailyUIReqVO;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import org.apache.tika.utils.StringUtils;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString(callSuper = true)
|
||||
public class DailyPowerUIReqVO extends DailyUIReqVO {
|
||||
public DailyPowerUIReqVO(String month, String no) {
|
||||
setSearchMonth(month);
|
||||
if (!StringUtils.isBlank(no)) {
|
||||
setGroupNo(Integer.parseInt(no));
|
||||
}
|
||||
}
|
||||
|
||||
public DailyPowerUIReqVO(String month, Integer no) {
|
||||
setSearchMonth(month);
|
||||
setGroupNo(no);
|
||||
}
|
||||
|
||||
/**
|
||||
* 수입 일련번호
|
||||
*/
|
||||
private Long id;
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package app.module.front.usecase.daily.power.adapters.web.model;
|
||||
|
||||
import app.module.front.usecase.daily.record.adapters.web.model.DailyUIReqVO;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString(callSuper = true)
|
||||
public class RemoveDailyPowerReqVO extends DailyUIReqVO {
|
||||
/**
|
||||
* 수입 일련번호
|
||||
*/
|
||||
@NotBlank(message = "{valid.common.required}")
|
||||
private String id;
|
||||
/**
|
||||
* 일계부 일련번호
|
||||
*/
|
||||
private Long dailyRecordSeq;
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package app.module.front.usecase.daily.power.adapters.web.validator;
|
||||
|
||||
import app.module.front.usecase.daily.power.adapters.web.model.CreateDailyPowerReqVO;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.tika.utils.StringUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.validation.Errors;
|
||||
import org.springframework.validation.Validator;
|
||||
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class CreateDailyPowerValidator implements Validator {
|
||||
|
||||
@Override
|
||||
public boolean supports(Class<?> clazz) {
|
||||
return CreateDailyPowerReqVO.class.equals(clazz);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validate(Object target, Errors errors) {
|
||||
CreateDailyPowerReqVO vo = (CreateDailyPowerReqVO) target;
|
||||
|
||||
if (vo.getOwnedHours() == null && vo.getLeasedHours() == null) {
|
||||
errors.rejectValue(
|
||||
"ownedHours", "valid.common.required",
|
||||
"자가 또는 임차 사용시간을 입력 해주세요.");
|
||||
errors.rejectValue(
|
||||
"leasedHours", "valid.common.required",
|
||||
"자가 또는 임차 사용시간을 입력 해주세요.");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package app.module.front.usecase.daily.power.ports;
|
||||
|
||||
|
||||
import app.module.front.usecase.daily.power.adapters.persistence.model.DailyPowerDto;
|
||||
import app.module.front.usecase.daily.power.adapters.web.model.CreateDailyPowerReqVO;
|
||||
import app.module.front.usecase.daily.power.adapters.web.model.DailyPowerUIReqVO;
|
||||
import app.module.front.usecase.daily.power.adapters.web.model.RemoveDailyPowerReqVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface DailyPowerPortIn {
|
||||
/**
|
||||
* 일계부 동력 사용시간 조회
|
||||
*
|
||||
* @param reqVO 검색 조건
|
||||
* @return 동력 사용시간 목록
|
||||
*/
|
||||
List<DailyPowerDto> list(DailyPowerUIReqVO reqVO);
|
||||
|
||||
/**
|
||||
* 일계부 동력 사용시간 조회
|
||||
*
|
||||
* @param reqVO 검색 조건
|
||||
* @return 동력 사용시간 상세
|
||||
*/
|
||||
DailyPowerDto detail(DailyPowerUIReqVO reqVO);
|
||||
|
||||
/**
|
||||
* 일계부 동력 사용시간 등록
|
||||
*
|
||||
* @param formVO 입력 데이터
|
||||
*/
|
||||
void create(CreateDailyPowerReqVO formVO);
|
||||
|
||||
/**
|
||||
* 일계부 동력 사용시간 삭제
|
||||
*
|
||||
* @param formVO 삭제 검색 조건
|
||||
*/
|
||||
void remove(RemoveDailyPowerReqVO formVO);
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package app.module.front.usecase.daily.power.ports;
|
||||
|
||||
|
||||
import app.module.front.usecase.daily.power.adapters.persistence.model.DailyPowerDto;
|
||||
import app.module.front.usecase.daily.power.ports.application.domain.CreateDailyPowerCmd;
|
||||
import app.module.front.usecase.daily.power.ports.application.domain.GetDailyPowerCmd;
|
||||
import app.module.front.usecase.daily.power.ports.application.domain.RemoveDailyPowerCmd;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface DailyPowerPortOut {
|
||||
/**
|
||||
* 일계부 동력 사용시간 조회
|
||||
*
|
||||
* @param command 검색 조건
|
||||
* @return 동력 사용시간 목록
|
||||
*/
|
||||
List<DailyPowerDto> list(GetDailyPowerCmd command);
|
||||
|
||||
/**
|
||||
* 일계부 동력 사용시간 등록
|
||||
*
|
||||
* @param findCmd 검색 조건
|
||||
* @param command 입력 데이터
|
||||
*/
|
||||
void create(GetDailyPowerCmd findCmd, CreateDailyPowerCmd command);
|
||||
|
||||
/**
|
||||
* 일계부 동력 사용시간 삭제
|
||||
*
|
||||
* @param findCmd 검색 조건
|
||||
* @param command 삭제 검색 조건
|
||||
*/
|
||||
void remove(GetDailyPowerCmd findCmd, RemoveDailyPowerCmd command);
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
package app.module.front.usecase.daily.power.ports.application;
|
||||
|
||||
import app.module.core.usecase.uicode.list.ports.UICodeListPortIn;
|
||||
import app.module.core.usecase.uicode.list.ports.application.domain.UICodeElement;
|
||||
import app.module.front.config.application.util.AuditUtil;
|
||||
import app.module.front.usecase.daily.income.adapters.persistence.model.DailyIncomeDto;
|
||||
import app.module.front.usecase.daily.income.ports.application.domain.CreateDailyIncomeCmd;
|
||||
import app.module.front.usecase.daily.income.ports.application.domain.GetDailyIncomeCmd;
|
||||
import app.module.front.usecase.daily.income.ports.application.domain.RemoveDailyIncomeCmd;
|
||||
import app.module.front.usecase.daily.power.adapters.persistence.model.DailyPowerDto;
|
||||
import app.module.front.usecase.daily.power.adapters.web.model.CreateDailyPowerReqVO;
|
||||
import app.module.front.usecase.daily.power.adapters.web.model.DailyPowerUIReqVO;
|
||||
import app.module.front.usecase.daily.power.adapters.web.model.RemoveDailyPowerReqVO;
|
||||
import app.module.front.usecase.daily.power.ports.DailyPowerPortIn;
|
||||
import app.module.front.usecase.daily.power.ports.DailyPowerPortOut;
|
||||
import app.module.front.usecase.daily.power.ports.application.domain.CreateDailyPowerCmd;
|
||||
import app.module.front.usecase.daily.power.ports.application.domain.GetDailyPowerCmd;
|
||||
import app.module.front.usecase.daily.power.ports.application.domain.RemoveDailyPowerCmd;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class DailyPowerService implements DailyPowerPortIn {
|
||||
private final DailyPowerPortOut portOut;
|
||||
private final UICodeListPortIn uiCodeListPortIn;
|
||||
|
||||
@Override
|
||||
public List<DailyPowerDto> list(DailyPowerUIReqVO reqVO) {
|
||||
return this.getRefineList(reqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DailyPowerDto detail(DailyPowerUIReqVO reqVO) {
|
||||
List<DailyPowerDto> list = this.getRefineList(reqVO);
|
||||
if (list.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return list.get(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* 목록 데이터 조회
|
||||
*
|
||||
* @param reqVO 검색 조건
|
||||
* @return 공통 처리된 목록
|
||||
*/
|
||||
private List<DailyPowerDto> getRefineList(DailyPowerUIReqVO reqVO) {
|
||||
return portOut.list(new GetDailyPowerCmd(reqVO.getSearchMonth(),
|
||||
reqVO.getGroupNo(),
|
||||
reqVO.getHouseholdSeq(),
|
||||
reqVO.getId()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void create(CreateDailyPowerReqVO formVO) {
|
||||
GetDailyPowerCmd findCmd = new GetDailyPowerCmd(
|
||||
formVO.getSearchMonth(),
|
||||
formVO.getGroupNo(),
|
||||
formVO.getHouseholdSeq(),
|
||||
formVO.getId());
|
||||
|
||||
CreateDailyPowerCmd command = AuditUtil.create(
|
||||
new CreateDailyPowerCmd(
|
||||
formVO.getId(),
|
||||
formVO.getDailyRecordSeq(),
|
||||
null,
|
||||
null,
|
||||
formVO.getEquipmentName(),
|
||||
formVO.getOwnedHours(),
|
||||
formVO.getLeasedHours()));
|
||||
|
||||
portOut.create(findCmd, command);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void remove(RemoveDailyPowerReqVO formVO) {
|
||||
Long id = formVO.getId() != null ? Long.parseLong(formVO.getId()) : null;
|
||||
|
||||
GetDailyPowerCmd findCmd = new GetDailyPowerCmd(
|
||||
formVO.getSearchMonth(),
|
||||
formVO.getGroupNo(),
|
||||
formVO.getHouseholdSeq(),
|
||||
id);
|
||||
|
||||
RemoveDailyPowerCmd command = AuditUtil.delete(
|
||||
new RemoveDailyPowerCmd(
|
||||
formVO.getSearchMonth(),
|
||||
formVO.getGroupNo(),
|
||||
id,
|
||||
formVO.getDailyRecordSeq()));
|
||||
|
||||
portOut.remove(findCmd, command);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package app.module.front.usecase.daily.power.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 CreateDailyPowerCmd extends FrontAuditCommand {
|
||||
private Long id;
|
||||
private Long dailyRecordSeq;
|
||||
private String incomeMark;
|
||||
private String expenseMark;
|
||||
private String equipmentName;
|
||||
private Integer ownedHours;
|
||||
private Integer leasedHours;
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package app.module.front.usecase.daily.power.ports.application.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
public class GetDailyPowerCmd {
|
||||
/**
|
||||
* 검색 월(yyyyMM)
|
||||
*/
|
||||
private String searchMonth;
|
||||
/**
|
||||
* 검색 그룸번호
|
||||
*/
|
||||
private Integer groupNo;
|
||||
/**
|
||||
* 임가 일련번호
|
||||
*/
|
||||
private Long householdSeq;
|
||||
/**
|
||||
* 동력 사용시간 일련번호
|
||||
*/
|
||||
private Long id;
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package app.module.front.usecase.daily.power.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 RemoveDailyPowerCmd extends FrontAuditCommand {
|
||||
private String searchMonth;
|
||||
private Integer groupNo;
|
||||
private Long id;
|
||||
private Long dailyRecordSeq;
|
||||
}
|
||||
@@ -52,10 +52,6 @@ public class DailyRecordDto {
|
||||
}
|
||||
}
|
||||
|
||||
if (returnValue == null) {
|
||||
returnValue = "LAST";
|
||||
}
|
||||
|
||||
return returnValue;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,13 @@
|
||||
package app.module.front.usecase.daily.record.adapters.web;
|
||||
|
||||
import app.module.core.config.application.exception.NoMatchingURIException;
|
||||
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.income.adapters.persistence.model.DailyIncomeDto;
|
||||
import app.module.front.usecase.daily.income.adapters.web.model.DailyIncomeUIReqVO;
|
||||
import app.module.front.usecase.daily.income.ports.DailyIncomePortIn;
|
||||
import app.module.front.usecase.daily.power.adapters.web.model.DailyPowerUIReqVO;
|
||||
import app.module.front.usecase.daily.power.ports.DailyPowerPortIn;
|
||||
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;
|
||||
@@ -14,13 +21,17 @@ import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@Controller
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping(path = "/record/daily")
|
||||
public class DailyRecordUIController {
|
||||
private final DailyRecordPortIn dailyRecordPortIn;
|
||||
private final CreateDailyRecordValidator createDailyRecordValidator;
|
||||
private final DailyIncomePortIn dailyIncomePortIn;
|
||||
private final DailyExpensePortIn dailyExpensePortIn;
|
||||
private final DailyPowerPortIn dailyPowerPortIn;
|
||||
|
||||
/**
|
||||
* 일계부 항목 등록 화면
|
||||
@@ -69,6 +80,13 @@ public class DailyRecordUIController {
|
||||
String modelAndView = "record/daily/done";
|
||||
if (DailyStatus.TODAY_NONE.equals(dailyRecord.getAllStatus())) {
|
||||
modelAndView = "record/daily/finish";
|
||||
} else {
|
||||
model.addAttribute("incomeList", dailyIncomePortIn.list(new DailyIncomeUIReqVO(searchMonth, groupNo)));
|
||||
model.addAttribute("expenseList", dailyExpensePortIn.list(new DailyExpenseUIReqVO(searchMonth, groupNo)));
|
||||
model.addAttribute("workList", null); // TODO
|
||||
model.addAttribute("powerList", dailyPowerPortIn.list(new DailyPowerUIReqVO(searchMonth, groupNo)));
|
||||
model.addAttribute("forestryList", null); // TODO
|
||||
model.addAttribute("farmingList", null); // TODO
|
||||
}
|
||||
|
||||
model.addAttribute("reqVO", reqVO);
|
||||
|
||||
63
front/src/main/resources/mappers/daily/DailyPowerMapper.xml
Normal file
63
front/src/main/resources/mappers/daily/DailyPowerMapper.xml
Normal file
@@ -0,0 +1,63 @@
|
||||
<?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.daily.power.adapters.persistence.DailyPowerMapper">
|
||||
|
||||
<select id="getDailyPowerList"
|
||||
resultType="app.module.front.usecase.daily.power.adapters.persistence.model.DailyPowerDto">
|
||||
select ds.id, ds.daily_record_seq
|
||||
, ds.equipment_name, ds.owned_hours, ds.leased_hours
|
||||
from daily_power ds
|
||||
<include refid="app.module.front.usecase.daily.record.adapters.persistence.DailyRecordMapper.InnerJoinByDailyRecord"/>
|
||||
where ds.is_deleted = false
|
||||
<if test="id != null and id != '0'">
|
||||
and ds.id = ${id}
|
||||
</if>
|
||||
order by
|
||||
ds.id desc
|
||||
</select>
|
||||
|
||||
<select id="getRecordExistCount" resultType="int">
|
||||
select count(1)
|
||||
from daily_power ds
|
||||
<include refid="app.module.front.usecase.daily.record.adapters.persistence.DailyRecordMapper.InnerJoinByDailyRecord"/>
|
||||
where ds.is_deleted = false
|
||||
<if test="id != null and id != '0'">
|
||||
and ds.id = ${id}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<insert id="createDailyPower" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into daily_power (
|
||||
daily_record_seq
|
||||
, equipment_name, owned_hours, leased_hours
|
||||
, is_deleted
|
||||
, <include refid="common.fields.CreateUpdateBaseColumns"/>
|
||||
) values (
|
||||
#{dailyRecordSeq}
|
||||
, #{equipmentName}, #{ownedHours}, #{leasedHours}
|
||||
, false
|
||||
, <include refid="common.fields.CreateUpdateBaseValues"/>
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateDailyPower">
|
||||
update daily_power set <include refid="common.fields.UpdateBaseSet"/>
|
||||
, equipment_name = #{equipmentName}
|
||||
, owned_hours = #{ownedHours}
|
||||
, leased_hours = #{leasedHours}
|
||||
where is_deleted = false
|
||||
and daily_record_seq = #{dailyRecordSeq}
|
||||
and id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="removeDailyPower">
|
||||
update daily_power set
|
||||
<include refid="common.fields.DeleteBaseSet"/>
|
||||
where is_deleted = false
|
||||
and daily_record_seq = #{dailyRecordSeq}
|
||||
<if test="id != null and id != ''">
|
||||
and id = #{id}
|
||||
</if>
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
@@ -39,4 +39,15 @@
|
||||
and dr.record_month = #{searchMonth}
|
||||
</select>
|
||||
|
||||
<select id="getMonthlyStatus">
|
||||
select mis.forest_product_status as forest_product, mis.bank_auto_transfer_input_status as bank_input, mis.bank_auto_transfer_output_status as bank_output
|
||||
from monthly_input_status mis
|
||||
where mis.is_deleted = false
|
||||
and mis.household_seq = #{householdSeq}
|
||||
and mis.month = #{searchMonth}
|
||||
order by
|
||||
mis.id desc
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
<svg width="25" height="25" viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M7.33203 6.5V3.5C7.33203 3.23478 7.43739 2.98043 7.62492 2.79289C7.81246 2.60536 8.06681 2.5 8.33203 2.5H20.332C20.5972 2.5 20.8516 2.60536 21.0391 2.79289C21.2267 2.98043 21.332 3.23478 21.332 3.5V17.5C21.332 17.7652 21.2267 18.0196 21.0391 18.2071C20.8516 18.3946 20.5972 18.5 20.332 18.5H17.332V21.5C17.332 22.052 16.882 22.5 16.325 22.5H4.33903C4.20716 22.5008 4.07643 22.4755 3.95435 22.4256C3.83228 22.3757 3.72126 22.3022 3.62769 22.2093C3.53412 22.1164 3.45982 22.0059 3.40909 21.8841C3.35835 21.7624 3.33216 21.6319 3.33203 21.5L3.33503 7.5C3.33503 6.948 3.78503 6.5 4.34103 6.5H7.33203ZM5.33403 8.5L5.33203 20.5H15.332V8.5H5.33403ZM9.33203 6.5H17.332V16.5H19.332V4.5H9.33203V6.5ZM7.33203 11.5H13.332V13.5H7.33203V11.5ZM7.33203 15.5H13.332V17.5H7.33203V15.5Z" fill="#DEE2E6"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 898 B |
@@ -0,0 +1,3 @@
|
||||
<svg width="25" height="25" viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M3.66797 3.5H21.668C21.9332 3.5 22.1875 3.60536 22.3751 3.79289C22.5626 3.98043 22.668 4.23478 22.668 4.5V20.5C22.668 20.7652 22.5626 21.0196 22.3751 21.2071C22.1875 21.3946 21.9332 21.5 21.668 21.5H3.66797C3.40275 21.5 3.1484 21.3946 2.96086 21.2071C2.77333 21.0196 2.66797 20.7652 2.66797 20.5V4.5C2.66797 4.23478 2.77333 3.98043 2.96086 3.79289C3.1484 3.60536 3.40275 3.5 3.66797 3.5ZM4.66797 5.5V19.5H20.668V5.5H4.66797ZM7.66797 13.5H9.66797V17.5H7.66797V13.5ZM11.668 7.5H13.668V17.5H11.668V7.5ZM15.668 10.5H17.668V17.5H15.668V10.5Z" fill="#DEE2E6"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 667 B |
@@ -7410,12 +7410,18 @@ button.swiper-pagination-bullet {
|
||||
.footer .footer-menu ul li.menu-regi.active {
|
||||
background-image: url("../images/common/ico_menu_regi_active.svg");
|
||||
}
|
||||
.footer .footer-menu ul li.menu-regi.disabled {
|
||||
background-image: url("../images/common/ico_menu_regi_disabled.svg");
|
||||
}
|
||||
.footer .footer-menu ul li.menu-stat {
|
||||
background-image: url("../images/common/ico_menu_stat.svg");
|
||||
}
|
||||
.footer .footer-menu ul li.menu-stat.active {
|
||||
background-image: url("../images/common/ico_menu_stat_active.svg");
|
||||
}
|
||||
.footer .footer-menu ul li.menu-stat.disabled {
|
||||
background-image: url("../images/common/ico_menu_stat_disabled.svg");
|
||||
}
|
||||
.footer .footer-menu ul li.menu-info {
|
||||
background-image: url("../images/common/ico_menu_info.svg");
|
||||
}
|
||||
@@ -7425,6 +7431,10 @@ button.swiper-pagination-bullet {
|
||||
.footer .footer-menu ul li.active a {
|
||||
color: #4bbc43;
|
||||
}
|
||||
.footer .footer-menu ul li.disabled a {
|
||||
cursor: default;
|
||||
color: #CED4DA;
|
||||
}
|
||||
|
||||
.acco-wrap .daily-report-area .date {
|
||||
position: relative;
|
||||
@@ -7455,6 +7465,9 @@ button.swiper-pagination-bullet {
|
||||
margin-top: 1.6rem;
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
.acco-wrap .modal-content .alert-box + .form-group {
|
||||
margin-top: 3.2rem;
|
||||
}
|
||||
.acco-wrap .modal-content .alert-box + .form-desc {
|
||||
margin-top: 0.8rem;
|
||||
}
|
||||
|
||||
@@ -28,6 +28,15 @@ krip.daily.goToPrev = function() {
|
||||
* @param groupNo
|
||||
*/
|
||||
krip.daily.goToNext = function(target, searchMonth, groupNo) {
|
||||
if (target == null) {
|
||||
if ($('._nextStep').data('last')) {
|
||||
target = 'LAST';
|
||||
} else {
|
||||
krip.daily.goToDone(searchMonth, groupNo);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (target === 'LAST') {
|
||||
// 임가 건의사항 팝업
|
||||
const commentModal = document.querySelector('.commentModal').ui;
|
||||
@@ -231,7 +240,7 @@ krip.daily.createComment = function(month, groupNo) {
|
||||
const f = document.commentReqForm;
|
||||
|
||||
const obj = $(f).serializeObject();
|
||||
console.log(obj)
|
||||
console.log(obj, month, groupNo)
|
||||
if (f.content.value === '') {
|
||||
krip.daily.goToDone(month, groupNo);
|
||||
return;
|
||||
|
||||
@@ -153,19 +153,19 @@
|
||||
<dd class="address">
|
||||
<p>주소</p>
|
||||
<span>
|
||||
Office 1. (06652) 서울시 서초구 사임당로 18, 석오빌딩 8F
|
||||
</span>
|
||||
Office 1. (06652) 서울시 서초구 사임당로 18, 석오빌딩 8F
|
||||
</span>
|
||||
<span>
|
||||
Office 2. (06651) 서울시 서초구 사임당로 32, 재우빌딩 9F
|
||||
</span>
|
||||
Office 2. (06651) 서울시 서초구 사임당로 32, 재우빌딩 9F
|
||||
</span>
|
||||
</dd>
|
||||
<dd>
|
||||
<p>이메일</p>
|
||||
<span>info@kric.com</span>
|
||||
<a href="mailto:info@kric.com"><span>info@kric.com</span></a>
|
||||
</dd>
|
||||
<dd>
|
||||
<p>고객센터 전화번호</p>
|
||||
<span>02-3415-5187</span>
|
||||
<a href="tel:02-3415-5187"><span>02-3415-5187</span></a>
|
||||
</dd>
|
||||
</dl>
|
||||
<p class="copyright">
|
||||
@@ -184,24 +184,15 @@
|
||||
or #strings.containsIgnoreCase(currentURI?.uri, '/record/') ? 'active' : ''}">
|
||||
<a href="javascript:void(0);" onclick="kri.menu.daily();">일계부</a>
|
||||
</li>
|
||||
<!--/* TODO : 2차 오픈 */-->
|
||||
<!--<li class="menu-regi"><a href="">입력현황</a></li>
|
||||
<li class="menu-stat"><a href="">통계</a></li>-->
|
||||
<!--/* TODO : 2차 오픈 s */-->
|
||||
<li class="menu-regi disabled"><a href="javascript:void(0)">입력현황</a></li>
|
||||
<li class="menu-stat disabled"><a href="javascript:void(0)">통계</a></li>
|
||||
<!--/* TODO : 2차 오픈 e */-->P
|
||||
<li class="menu-info"
|
||||
th:classappend="${#strings.equals(currentURI?.uri, '/user')
|
||||
or #strings.containsIgnoreCase(currentURI?.uri, '/user/') ? 'actives' : ''}">
|
||||
th:classappend="${#strings.equals(currentURI?.uri, '/info')
|
||||
or #strings.containsIgnoreCase(currentURI?.uri, '/info/') ? 'active' : ''}">
|
||||
<a href="javascript:void(0);" onclick="kri.menu.my();">내정보</a>
|
||||
</li>
|
||||
<!--/* TODO : 전체메뉴 적용 전 임시 메뉴 S */-->
|
||||
<li sec:authorize="isAnonymous()" th:remove="tag">
|
||||
<a href="/login">[로그인]</a>
|
||||
</li>
|
||||
<li sec:authorize="isAuthenticated()" th:remove="tag">
|
||||
<strong th:text="${#authentication.principal.ownerName}">로그인 사용자명</strong>
|
||||
, seq=<strong th:text="${#authentication.principal.householdSeq}">로그인 사용자SEQ</strong>
|
||||
<a href="/logout">[로그아웃]</a>
|
||||
</li>
|
||||
<!--/* TODO : 전체메뉴 적용 전 임시 메뉴 E */-->
|
||||
</ul>
|
||||
</nav>
|
||||
</footer>
|
||||
|
||||
@@ -780,7 +780,7 @@
|
||||
<script id="etcRowTmpl" type="text/x-jsrender">
|
||||
<div class="regist-btn-area">
|
||||
{{for etcList}}
|
||||
<a href="{{:path}}" class="btn{{if total != null && total != 0}} complete{{/if}}">
|
||||
<a href="{{:path ? path : 'javascript:void(0);'}}" class="btn{{if total != null && total != 0}} complete{{/if}}">
|
||||
<p>{{:codeLabel}}</p>
|
||||
{{if total != null && total != 0}}
|
||||
<span>등록완료</span>
|
||||
|
||||
@@ -12,26 +12,140 @@
|
||||
</div>
|
||||
</th:block>
|
||||
<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"
|
||||
th:each="item, itemStatus : ${dailyRecord.targetList}"
|
||||
th:classappend="${(item.name eq 'INCOME' && #lists.isEmpty(incomeList))
|
||||
|| (item.name eq 'EXPENSE' && #lists.isEmpty(expenseList))
|
||||
|| (item.name eq 'POWER' && #lists.isEmpty(powerList))} ? 'no-data'"
|
||||
>
|
||||
<div class="item-tit-group">
|
||||
<p class="item-name">[[${item.desc}]]</p>
|
||||
</div>
|
||||
<!--/* 수입 */-->
|
||||
<ul class="detail-list"
|
||||
th:if="${item.name eq 'INCOME'}"
|
||||
>
|
||||
<th:block th:if="${#lists.isEmpty(incomeList)}">
|
||||
<li>
|
||||
<p>없음</p>
|
||||
</li>
|
||||
</th:block>
|
||||
<th:block th:each="child, childStatus : ${incomeList}">
|
||||
<li>
|
||||
<p>[[${child.categorySelf}]]</p>
|
||||
<span th:if="${not #strings.isEmpty(child.price)}"
|
||||
th:text="|${#numbers.formatInteger(child.price, 1, 'COMMA')}원|">302,000원</span>
|
||||
<span th:if="${not #strings.isEmpty(child.estimatedValue)}"
|
||||
th:text="|${#numbers.formatInteger(child.estimatedValue, 1, 'COMMA')}원|">302,000원</span>
|
||||
</li>
|
||||
</th:block>
|
||||
</ul>
|
||||
<!--/* 지출 */-->
|
||||
<ul class="detail-list"
|
||||
th:if="${item.name eq 'EXPENSE'}"
|
||||
>
|
||||
<th:block th:if="${#strings.isEmpty(expenseList)}">
|
||||
<li>
|
||||
<p>없음</p>
|
||||
</li>
|
||||
</th:block>
|
||||
<th:block th:each="child, childStatus : ${expenseList}">
|
||||
<li>
|
||||
<p>[[${child.categorySelf}]]</p>
|
||||
<span th:if="${not #strings.isEmpty(child.price)}"
|
||||
th:text="|${#numbers.formatInteger(child.price, 1, 'COMMA')}원|">302,000원</span>
|
||||
<span th:if="${not #strings.isEmpty(child.estimatedValue)}"
|
||||
th:text="|${#numbers.formatInteger(child.estimatedValue, 1, 'COMMA')}원|">302,000원</span>
|
||||
</li>
|
||||
</th:block>
|
||||
</ul>
|
||||
<!--/* TODO 임업노동 투입 */-->
|
||||
<!--/*<ul class="detail-list"
|
||||
th:if="${item.name eq 'WORK'}"
|
||||
>
|
||||
<th:block th:if="${#strings.isEmpty(workList)}">
|
||||
<li>
|
||||
<p>없음</p>
|
||||
</li>
|
||||
</th:block>
|
||||
<th:block th:each="child, childStatus : ${workList}">
|
||||
<li>
|
||||
<p>호두</p>
|
||||
<span>
|
||||
<span>수확</span>
|
||||
<span>총 23시간</span>
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<p>밤</p>
|
||||
<span>
|
||||
<span>줍기</span>
|
||||
<span>총 12시간</span>
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<p>밤</p>
|
||||
<span>
|
||||
<span>선별</span>
|
||||
<span>총 2시간</span>
|
||||
</span>
|
||||
</li>
|
||||
</th:block>
|
||||
</ul>*/-->
|
||||
<!--/* 동력 사용시간 */-->
|
||||
<ul class="detail-list"
|
||||
th:if="${item.name eq 'POWER'}"
|
||||
>
|
||||
<th:block th:if="${#strings.isEmpty(powerList)}">
|
||||
<li>
|
||||
<p>없음</p>
|
||||
</li>
|
||||
</th:block>
|
||||
<th:block th:each="child, childStatus : ${powerList}">
|
||||
<li>
|
||||
<p>[[${child.equipmentName}]]</p>
|
||||
<span th:if="${not #strings.isEmpty(child.ownedHours)}"
|
||||
th:text="|총${#numbers.formatInteger(child.ownedHours, 1, 'COMMA')}시간|">총8시간</span>
|
||||
<span th:if="${not #strings.isEmpty(child.leasedHours)}"
|
||||
th:text="|총${#numbers.formatInteger(child.leasedHours, 1, 'COMMA')}시간|">총8시간</span>
|
||||
</li>
|
||||
</th:block>
|
||||
</ul>
|
||||
<!--/* TODO 임업생산물 중 자가소비량 */-->
|
||||
<!--/* TODO 농업생산물 중 자가소비량 */-->
|
||||
</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>
|
||||
<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>
|
||||
@@ -30,56 +30,6 @@
|
||||
</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>
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
<!--/*<div class="component-input">
|
||||
<div class="component-input">
|
||||
<label class="switch-inner type-txt">
|
||||
<span class="switch-label">동력 사용시간</span>
|
||||
<input type="checkbox" name="powerStatus" value="TARGET" data-target="power"
|
||||
@@ -70,7 +70,7 @@
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="component-input">
|
||||
<!--/*<div class="component-input">
|
||||
<label class="switch-inner type-txt">
|
||||
<span class="switch-label">자가임업 생산물 중 자가소비량</span>
|
||||
<input type="checkbox" name="forestryStatus" value="TARGET" data-target="forestry"
|
||||
@@ -114,7 +114,7 @@
|
||||
</div>
|
||||
|
||||
<section layout:fragment="script">
|
||||
<script th:src="@{/ui/page/daily-record.js}"></script>
|
||||
<script th:src="@{/static/ui/page/daily-record.js}"></script>
|
||||
<script th:inline="javascript">
|
||||
let ENV = {
|
||||
httpUrl: {
|
||||
@@ -164,7 +164,8 @@
|
||||
create() {
|
||||
const f = document.reqForm;
|
||||
|
||||
if ($(f).find('input:checked').length === 0) {
|
||||
const $checked = $(f).find('input:checked');
|
||||
if ($checked.length === 0) {
|
||||
f.todayNone.value = 'Y';
|
||||
}
|
||||
|
||||
@@ -179,6 +180,8 @@
|
||||
} else {
|
||||
krip.daily.goToDone(ENV.month, ENV.groupNo);
|
||||
}
|
||||
} else if ($checked.data('target') !== undefined) {
|
||||
krip.daily.goToNext($checked.data('target'), ENV.month, ENV.groupNo);
|
||||
} else {
|
||||
krip.daily.goToMain();
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@
|
||||
|
||||
<!-- 모달 팝업 -->
|
||||
<div class="layer-wrap">
|
||||
<div class="component-modal acco-wrap modal01" data-props-dimm-click="true">
|
||||
<div class="component-modal acco-wrap formModal" data-props-dimm-click="true">
|
||||
<div class="modal-dimm"></div>
|
||||
<div class="modal-frame">
|
||||
<div class="modal-container">
|
||||
@@ -148,7 +148,7 @@
|
||||
// 등록 버튼
|
||||
selectorId: '.button-modal01',
|
||||
// 등록 영역
|
||||
selector: '.modal01',
|
||||
selector: '.formModal',
|
||||
},
|
||||
month: /*[[${reqVO.searchMonth}]]*/'month',
|
||||
groupNo: /*[[${reqVO.groupNo}]]*/'groupNo',
|
||||
|
||||
@@ -112,7 +112,7 @@
|
||||
|
||||
<!-- 모달 팝업 -->
|
||||
<div class="layer-wrap">
|
||||
<div class="component-modal acco-wrap modal01" data-props-dimm-click="true">
|
||||
<div class="component-modal acco-wrap formModal" data-props-dimm-click="true">
|
||||
<div class="modal-dimm"></div>
|
||||
<div class="modal-frame">
|
||||
<div class="modal-container">
|
||||
@@ -152,7 +152,7 @@
|
||||
// 등록 버튼
|
||||
selectorId: '.button-modal01',
|
||||
// 등록 영역
|
||||
selector: '.modal01',
|
||||
selector: '.formModal',
|
||||
},
|
||||
month: /*[[${reqVO.searchMonth}]]*/'month',
|
||||
groupNo: /*[[${reqVO.groupNo}]]*/'groupNo',
|
||||
|
||||
77
front/src/main/resources/templates/record/power/form.html
Normal file
77
front/src/main/resources/templates/record/power/form.html
Normal file
@@ -0,0 +1,77 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
|
||||
xmlns:th="http://www.thymeleaf.org" lang="ko">
|
||||
|
||||
<th:block>
|
||||
<div class="modal-content-inner">
|
||||
<p class="form-desc">필수입력</p>
|
||||
<form name="reqModalForm">
|
||||
<input type="hidden" name="id" th:value="${detail.id}">
|
||||
<section class="form-group">
|
||||
<div class="component-input">
|
||||
<div class="input-label">
|
||||
<label for="equipmentName" class="label-txt">
|
||||
명칭
|
||||
<i class="ico-required-mark" role="img" aria-label="필수">*</i>
|
||||
</label>
|
||||
</div>
|
||||
<div class="input-field">
|
||||
<input type="text" id="equipmentName" name="equipmentName" th:value="${detail.equipmentName}" maxlength="30" placeholder="사용 기계 이름을 입력해 주세요">
|
||||
</div>
|
||||
<ul class="guide-info">
|
||||
<li>예 : 예초기</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<hr>
|
||||
|
||||
<section class="form-group">
|
||||
<div class="component-segment">
|
||||
<div class="segment-label">
|
||||
<p class="label-txt">
|
||||
동력 사용시간 <i class="ico-required-mark" role="img" aria-label="필수">*</i>
|
||||
</p>
|
||||
<span class="label-sub-txt">
|
||||
동력 사용시간은 자가와 임차로 구분해 입력해 주세요.
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="component-input type-sub">
|
||||
<div class="input-label">
|
||||
<label for="ownedHours" class="label-txt">
|
||||
자가 사용시간
|
||||
<i class="ico-required-mark" role="img" aria-label="필수">*</i>
|
||||
</label>
|
||||
</div>
|
||||
<div class="input-field type-hour">
|
||||
<input type="number" inputmode="numeric" pattern="[0-9]*" id="ownedHours" name="ownedHours" th:value="${detail.ownedHours}" maxlength="10" placeholder="자가에서 사용한 동력 사용시간을 입력해 주세요">
|
||||
<span class="input-field-txt">시간</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="component-input type-sub">
|
||||
<div class="input-label">
|
||||
<label for="leasedHours" class="label-txt">
|
||||
임차 사용시간
|
||||
<i class="ico-required-mark" role="img" aria-label="필수">*</i>
|
||||
</label>
|
||||
</div>
|
||||
<div class="input-field type-hour">
|
||||
<input type="number" inputmode="numeric" pattern="[0-9]*" id="leasedHours" name="ownedHours" th:value="${detail.ownedHours}" maxlength="10" placeholder="임차해서 사용한 동력 사용시간을 입력해 주세요">
|
||||
<span class="input-field-txt">시간</span>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</form>
|
||||
|
||||
<div class="component-btns">
|
||||
<div class="btns-row">
|
||||
<button type="button" class="btn btn-full btn-l btn-primary" onclick="modalControl.createVaild();">
|
||||
<span class="btn-txt">등록</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</th:block>
|
||||
|
||||
</html>
|
||||
251
front/src/main/resources/templates/record/power/index.html
Normal file
251
front/src/main/resources/templates/record/power/index.html
Normal file
@@ -0,0 +1,251 @@
|
||||
<!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">
|
||||
<h3>
|
||||
<th:block th:if="${dailyRecord.startDay eq dailyRecord.endDay}">
|
||||
[[${#temporals.format(dailyRecord.startDate, 'M월 d일')}]], <br>
|
||||
</th:block>
|
||||
<th:block th:if="not ${dailyRecord.startDay eq dailyRecord.endDay}">
|
||||
[[${#temporals.format(dailyRecord.startDate, 'M월 d')}]]~[[${#temporals.format(dailyRecord.endDate, 'd일')}]], <br>
|
||||
</th:block>
|
||||
<strong>동력 사용내역 [[${#lists.isEmpty(incomeList) ? 0 : #lists.size(incomeList)}]]건 등록</strong> <br>
|
||||
되었습니다.
|
||||
</h3>
|
||||
<p>동력 사용내역을 등록해 주세요.</p>
|
||||
</hgroup>
|
||||
|
||||
<!--/* 신규 등록 */-->
|
||||
<th:block th:if="${#lists.isEmpty(incomeList)}">
|
||||
<button type="button" class="btn btn-m btn-secondary btn-full button-modal01" data-testid="button-modal01"
|
||||
th:disabled="${#strings.equals(dailyRecord.incomeStatus, 'TODAY_NONE')}">
|
||||
<i class="ico-small" aria-hidden="true"
|
||||
th:classappend="${#strings.equals(dailyRecord.incomeStatus, 'TODAY_NONE') ? 'ico-add-disabled' : 'ico-add'}"></i>
|
||||
<span class="btn-txt">추가 등록</span>
|
||||
</button>
|
||||
<div class="component-input align-center">
|
||||
<label class="checkbox-inner" id="todayNone">
|
||||
<input type="checkbox" name="todayNone"
|
||||
data-type="INCOME"
|
||||
th:checked="${#strings.equals(dailyRecord.incomeStatus, 'TODAY_NONE')}">
|
||||
<span class="checkbox-item">
|
||||
<span class="checkbox-txt">금일 등록내용 없음</span>
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
</th:block>
|
||||
<!--/* 목록 */-->
|
||||
<th:block th:unless="${#lists.isEmpty(incomeList)}">
|
||||
<section class="regist-item-area">
|
||||
<p class="total">
|
||||
<span>총 <strong>[[${#lists.size(incomeList)}]]</strong>건</span>
|
||||
<button type="button" class="btn-reset" onclick="krip.daily.resetConfirm()">
|
||||
<i class="ico-reset ico-small" aria-hidden="true"></i>
|
||||
<span>초기화</span>
|
||||
</button>
|
||||
</p>
|
||||
<div class="item-list">
|
||||
<div class="list-item"
|
||||
th:each="item, itemStatus : ${incomeList}">
|
||||
<div class="item-tit-group">
|
||||
<p class="item-name">[[${item.categorySelf}]]</p>
|
||||
<div class="btn-group">
|
||||
<button type="button" class="delete" th:onclick="krip.daily.removeConfirm([[${item.id}]])"><span class="hide-txt">삭제</span></button>
|
||||
<button type="button" class="edit" th:onclick="krip.daily.createModal([[${item.id}]])"><span class="hide-txt">수정</span></button>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="detail-list">
|
||||
<li th:if="${item.credit != null}">
|
||||
<p>외상판매</p>
|
||||
<span th:text="${item.credit ? '예' : '아니오'}">아니오</span>
|
||||
</li>
|
||||
<li th:if="${not #strings.isEmpty(item.cropLabel)}">
|
||||
<p>재배형태</p>
|
||||
<span th:text="${item.cropLabel}">재배형태</span>
|
||||
</li>
|
||||
<li th:if="${not #strings.isEmpty(item.sourcePurpose)}">
|
||||
<p>수입원</p>
|
||||
<span th:text="${item.sourcePurpose}">소비자</span>
|
||||
</li>
|
||||
<li th:if="${not #strings.isEmpty(item.quantity)}">
|
||||
<p>수량</p>
|
||||
<span th:text="|${item.quantity}${#strings.defaultString(item.unitLabel,'')}|">500g</span>
|
||||
</li>
|
||||
<li th:if="${not #strings.isEmpty(item.price)}">
|
||||
<p>현금 </p>
|
||||
<span th:text="|${#numbers.formatInteger(item.price, 1, 'COMMA')}원|">302,000원</span>
|
||||
</li>
|
||||
<li th:if="${not #strings.isEmpty(item.estimatedValue)}">
|
||||
<p>현물평가액</p>
|
||||
<span th:text="|${#numbers.formatInteger(item.estimatedValue, 1, 'COMMA')}원|">302,000원</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<button type="button" class="btn btn-m btn-secondary btn-full button-modal01" data-testid="button-modal01">
|
||||
<i class="ico-add ico-small" aria-hidden="true"></i>
|
||||
<span class="btn-txt">추가 등록</span>
|
||||
</button>
|
||||
</section>
|
||||
</th:block>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<!-- 하단 고정 버튼 -->
|
||||
<div class="component-btns fixed"
|
||||
th:if="${moveStep}">
|
||||
<div class="btns-row">
|
||||
<button type="button" class="btn btn-l btn-secondary" onclick="krip.daily.goToPrev();">
|
||||
<span class="btn-txt">이전 단계로 이동</span>
|
||||
</button>
|
||||
<button type="button" class="btn btn-l btn-primary"
|
||||
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>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 모달 팝업 -->
|
||||
<div class="layer-wrap">
|
||||
<div class="component-modal acco-wrap formModal" 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">
|
||||
<!--/* form */-->
|
||||
</div>
|
||||
<button type="button" class="modal-close"></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- //모달 팝업 -->
|
||||
<!-- /* 건의사항 모달 팝업 */ -->
|
||||
<th:block th:replace="~{/record/comment-modal}"></th:block>
|
||||
<!-- /* //건의사항 모달 팝업 */ -->
|
||||
</div>
|
||||
|
||||
<section layout:fragment="script">
|
||||
<script th:src="@{/static/ui/page/daily-record.js}"></script>
|
||||
<script th:inline="javascript">
|
||||
$(function() {
|
||||
formControl.init();
|
||||
});
|
||||
|
||||
let ENV = {
|
||||
httpUrl: {
|
||||
root: /*[[|/record/power/${reqVO.searchMonth}/${reqVO.groupNo}|]]*/'rootUrl',
|
||||
form: /*[[|/record/power/${reqVO.searchMonth}/${reqVO.groupNo}/form/{id}|]]*/'formUrl',
|
||||
create: /*[[|/api/record/power/${reqVO.searchMonth}/${reqVO.groupNo}/form/{id}|]]*/'createUrl',
|
||||
remove: /*[[|/api/record/power/${reqVO.searchMonth}/${reqVO.groupNo}/remove|]]*/'removeUrl',
|
||||
reset: /*[[|/api/record/power/${reqVO.searchMonth}/${reqVO.groupNo}/reset|]]*/'resetUrl',
|
||||
},
|
||||
modal: {
|
||||
// 등록 버튼
|
||||
selectorId: '.button-modal01',
|
||||
// 등록 영역
|
||||
selector: '.formModal',
|
||||
},
|
||||
month: /*[[${reqVO.searchMonth}]]*/'month',
|
||||
groupNo: /*[[${reqVO.groupNo}]]*/'groupNo',
|
||||
submitted: false,
|
||||
};
|
||||
|
||||
let formControl = {
|
||||
init() {
|
||||
krip.daily.baseBindUI();
|
||||
},
|
||||
};
|
||||
|
||||
let modalControl = {
|
||||
_bindModelUI() {
|
||||
const $select1 = document.querySelector('#cropCode');
|
||||
const selectboxInstance1 = new etUI.components.SelectBox();
|
||||
selectboxInstance1.core.init($select1, {
|
||||
selectItemCallback({selectValue, dataValue}){
|
||||
console.log('selectItemCallback', selectValue, dataValue)
|
||||
$('input[name="cropCode"]').val(dataValue)
|
||||
}
|
||||
});
|
||||
|
||||
const $select2 = document.querySelector('#unitCode');
|
||||
const selectboxInstance2 = new etUI.components.SelectBox();
|
||||
selectboxInstance2.core.init($select2, {
|
||||
selectItemCallback({selectValue, dataValue}){
|
||||
console.log('selectItemCallback', selectValue, dataValue)
|
||||
$('input[name="unitCode"]').val(dataValue)
|
||||
|
||||
etUI.pages.initDirectInputToggle();
|
||||
}
|
||||
});
|
||||
|
||||
const $formWrap = $(ENV.modal.selector).find('form');
|
||||
const $price = $(ENV.modal.selector).find('form input[name="price"]');
|
||||
const $estimatedValue = $(ENV.modal.selector).find('form input[name="estimatedValue"]');
|
||||
$price.on('keyup', function() {
|
||||
if ($(this).val() === '') {
|
||||
modalControl._priceActive($estimatedValue);
|
||||
} else {
|
||||
modalControl._priceDisabled($estimatedValue);
|
||||
}
|
||||
});
|
||||
|
||||
$estimatedValue.on('keyup', function() {
|
||||
if ($(this).val() === '') {
|
||||
modalControl._priceActive($price);
|
||||
} else {
|
||||
modalControl._priceDisabled($price);
|
||||
}
|
||||
});
|
||||
|
||||
// data set
|
||||
selectboxInstance1.setValue($formWrap.find('input[name="cropCode"]').val());
|
||||
//selectboxInstance1.update();
|
||||
|
||||
selectboxInstance2.setValue($formWrap.find('input[name="unitCode"]').val());
|
||||
//selectboxInstance2.update();
|
||||
|
||||
if ($price.val() === '' && $estimatedValue.val() !== '') {
|
||||
modalControl._priceDisabled($price);
|
||||
} else if ($price.val() !== '' && $estimatedValue.val() === '') {
|
||||
modalControl._priceDisabled($estimatedValue);
|
||||
}
|
||||
},
|
||||
_priceActive($input) {
|
||||
$input.val('').attr('disabled', false);
|
||||
$input.parent().parent().closest('.component-input').removeClass('input-disabled');
|
||||
},
|
||||
_priceDisabled($input) {
|
||||
$input.val('').attr('disabled', true);
|
||||
$input.parent().parent().closest('.component-input').addClass('input-disabled');
|
||||
},
|
||||
createVaild() {
|
||||
modalControl.create();
|
||||
},
|
||||
create() {
|
||||
const f = document.reqModalForm;
|
||||
|
||||
const obj = $(f).serializeObject();
|
||||
console.log(obj)
|
||||
|
||||
ajaxUtil._ajaxAsync(
|
||||
ENV.httpUrl.create.replace('{id}', f.id.value ? f.id.value : '0'),
|
||||
obj,
|
||||
function (rstData, status) {
|
||||
location.reload();
|
||||
},
|
||||
);
|
||||
},
|
||||
};
|
||||
</script>
|
||||
</section>
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user