Merge branch 'daily' into dev
This commit is contained in:
@@ -0,0 +1,19 @@
|
|||||||
|
package app.module.core.config.application.exception;
|
||||||
|
|
||||||
|
public class NoRecordDataException extends RuntimeException {
|
||||||
|
/**
|
||||||
|
* 생성자
|
||||||
|
*/
|
||||||
|
public NoRecordDataException() {
|
||||||
|
super("데이터 없음");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 생성자
|
||||||
|
*
|
||||||
|
* @param message 예외 메시지
|
||||||
|
*/
|
||||||
|
public NoRecordDataException(String message, Throwable cause) {
|
||||||
|
super(message, cause);
|
||||||
|
}
|
||||||
|
}
|
||||||
1
front/.gitignore
vendored
1
front/.gitignore
vendored
@@ -34,3 +34,4 @@ build/
|
|||||||
|
|
||||||
### Project
|
### Project
|
||||||
**/resources/static/pages/**
|
**/resources/static/pages/**
|
||||||
|
**/resources/static/guide/**
|
||||||
|
|||||||
@@ -1,58 +1,50 @@
|
|||||||
package app.module.front.usecase.daily.income.persistence;
|
package app.module.front.usecase.daily.income.persistence;
|
||||||
|
|
||||||
import app.module.front.usecase.daily.income.application.model.DailyIncomeCmd;
|
import app.module.front.usecase.daily.income.persistence.model.CreateDailyIncomeCmd;
|
||||||
import app.module.front.usecase.daily.income.persistence.model.DailyIncomeDto;
|
import app.module.front.usecase.daily.income.persistence.model.DailyIncomeDto;
|
||||||
|
import app.module.front.usecase.daily.income.web.model.DailyIncomeUIReqVO;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface DailyIncomeMapper {
|
public interface DailyIncomeMapper {
|
||||||
/**
|
/**
|
||||||
* 수입내역 데이터 존재 여부
|
* 수입내역 목록 조회
|
||||||
* @param householdSeq
|
*
|
||||||
* @param recordMonth
|
* @param reqVO
|
||||||
* @param dayGroupNo
|
* @return
|
||||||
* @return
|
*/
|
||||||
*/
|
List<DailyIncomeDto> getDailyIncomeList(DailyIncomeUIReqVO reqVO);
|
||||||
Long getDailyIncomeExistCount(@Param("householdSeq") Long householdSeq, @Param("recordMonth") String recordMonth, @Param("dayGroupNo") Integer dayGroupNo);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 수입내역 목록 조회
|
* 수입내역 데이터 존재 여부
|
||||||
* @param householdSeq
|
*
|
||||||
* @param recordMonth
|
* @param reqVO
|
||||||
* @param dayGroupNo
|
* @return
|
||||||
* @return
|
*/
|
||||||
*/
|
Integer getDailyIncomeExistCount(DailyIncomeUIReqVO reqVO);
|
||||||
List<DailyIncomeDto> getDailyIncomeList(@Param("householdSeq") Long householdSeq, @Param("recordMonth") String recordMonth, @Param("dayGroupNo") Integer dayGroupNo);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 수입내역 단건 조회
|
* 수입내역 등록
|
||||||
* @param householdSeq
|
*
|
||||||
* @param recordMonth
|
* @param command
|
||||||
* @param dayGroupNo
|
* @return
|
||||||
* @return
|
*/
|
||||||
*/
|
void createDailyIncome(CreateDailyIncomeCmd command);
|
||||||
DailyIncomeDto getDailyIncome(@Param("householdSeq") Long householdSeq, @Param("recordMonth") String recordMonth, @Param("dayGroupNo") Integer dayGroupNo);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 수입내역 등록
|
* 수입내역 수정
|
||||||
* @param command
|
*
|
||||||
* @return
|
* @param command
|
||||||
*/
|
* @return
|
||||||
Long createDailyIncome(DailyIncomeCmd command);
|
*/
|
||||||
|
int updateDailyIncome(CreateDailyIncomeCmd command);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 수입내역 수정
|
* 수입내역 삭제
|
||||||
* @param command
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
int updateDailyIncome(DailyIncomeCmd command);
|
int removeDailyIncome();
|
||||||
|
|
||||||
/**
|
|
||||||
* 수입내역 삭제
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
int removeDailyIncome();
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
package app.module.front.usecase.daily.income.application.model;
|
package app.module.front.usecase.daily.income.persistence.model;
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
public class DailyIncomeCmd {
|
public class CreateDailyIncomeCmd {
|
||||||
private Long id;
|
private Long id;
|
||||||
private Long householdSeq;
|
private Long householdSeq;
|
||||||
private Boolean isCredit;
|
private Boolean isCredit;
|
||||||
@@ -8,14 +8,17 @@ import java.time.LocalDateTime;
|
|||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
public class DailyIncomeDto {
|
public class DailyIncomeDto {
|
||||||
private Long id;
|
private Long id;
|
||||||
private Long householdSeq;
|
private Long dailyRecordSeq;
|
||||||
private Boolean isCredit;
|
// SELF, OCR
|
||||||
// TODO
|
private String inputType;
|
||||||
private String createdBy;
|
private Boolean isCredit;
|
||||||
private LocalDateTime createdAt;
|
private String cropCode;
|
||||||
private Integer price;
|
private String categoryCode;
|
||||||
private Integer estimatedValue;
|
private String categorySelf;
|
||||||
private String updatedBy;
|
private String sourcePurpose;
|
||||||
private LocalDateTime updatedAt;
|
private String quantity;
|
||||||
|
private String unitCode;
|
||||||
|
private String price;
|
||||||
|
private String estimated_value;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package app.module.front.usecase.daily.income.service;
|
||||||
|
|
||||||
|
import app.module.front.usecase.daily.income.persistence.model.DailyIncomeDto;
|
||||||
|
import app.module.front.usecase.daily.income.web.model.CreateDailyIncomeReqVO;
|
||||||
|
import app.module.front.usecase.daily.income.web.model.DailyIncomeUIReqVO;
|
||||||
|
import app.module.front.usecase.daily.income.web.model.RemoveDailyIncomeReqVO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface DailyIncomeService {
|
||||||
|
List<DailyIncomeDto> getDailyIncomeList(DailyIncomeUIReqVO reqVO);
|
||||||
|
|
||||||
|
DailyIncomeDto getDailyIncome(DailyIncomeUIReqVO reqVO);
|
||||||
|
|
||||||
|
void createDailyIncome(CreateDailyIncomeReqVO command);
|
||||||
|
|
||||||
|
void removeDailyIncome(RemoveDailyIncomeReqVO command);
|
||||||
|
}
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
package app.module.front.usecase.daily.income.service;
|
||||||
|
|
||||||
|
import app.module.front.usecase.daily.income.persistence.DailyIncomeMapper;
|
||||||
|
import app.module.front.usecase.daily.income.persistence.model.DailyIncomeDto;
|
||||||
|
import app.module.front.usecase.daily.income.web.model.CreateDailyIncomeReqVO;
|
||||||
|
import app.module.front.usecase.daily.income.web.model.DailyIncomeUIReqVO;
|
||||||
|
import app.module.front.usecase.daily.income.web.model.RemoveDailyIncomeReqVO;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class DailyIncomeServiceImpl implements DailyIncomeService {
|
||||||
|
private final DailyIncomeMapper dailyIncomeMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DailyIncomeDto> getDailyIncomeList(DailyIncomeUIReqVO reqVO) {
|
||||||
|
return this.getRefineIncomeList(reqVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DailyIncomeDto getDailyIncome(DailyIncomeUIReqVO reqVO) {
|
||||||
|
List<DailyIncomeDto> list = this.getRefineIncomeList(reqVO);
|
||||||
|
if (list.isEmpty()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return list.get(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<DailyIncomeDto> getRefineIncomeList(DailyIncomeUIReqVO reqVO) {
|
||||||
|
List<DailyIncomeDto> list = dailyIncomeMapper.getDailyIncomeList(reqVO);
|
||||||
|
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void createDailyIncome(CreateDailyIncomeReqVO command) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void removeDailyIncome(RemoveDailyIncomeReqVO command) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,8 +1,13 @@
|
|||||||
package app.module.front.usecase.daily.income.web;
|
package app.module.front.usecase.daily.income.web;
|
||||||
|
|
||||||
|
import app.module.core.config.application.exception.NoMatchingURIException;
|
||||||
|
import app.module.core.config.application.exception.NoRecordDataException;
|
||||||
import app.module.front.config.application.util.AuthUtil;
|
import app.module.front.config.application.util.AuthUtil;
|
||||||
|
import app.module.front.usecase.daily.income.persistence.model.DailyIncomeDto;
|
||||||
|
import app.module.front.usecase.daily.income.service.DailyIncomeService;
|
||||||
import app.module.front.usecase.daily.income.web.model.DailyIncomeUIReqVO;
|
import app.module.front.usecase.daily.income.web.model.DailyIncomeUIReqVO;
|
||||||
import app.module.front.usecase.daily.record.persistence.model.DailyRecordDto;
|
import app.module.front.usecase.daily.record.persistence.model.DailyRecordDto;
|
||||||
|
import app.module.front.usecase.daily.record.service.DailyRecordService;
|
||||||
import app.module.front.usecase.daily.record.web.model.DailyRecordUIReqVO;
|
import app.module.front.usecase.daily.record.web.model.DailyRecordUIReqVO;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -12,26 +17,47 @@ 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 java.util.List;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Controller
|
@Controller
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@RequestMapping(path = "/record/income")
|
@RequestMapping(path = "/record/income")
|
||||||
public class DailyIncomeController {
|
public class DailyIncomeController {
|
||||||
|
private final DailyRecordService dailyRecordService;
|
||||||
|
private final DailyIncomeService dailyIncomeService;
|
||||||
|
|
||||||
@GetMapping(path = "/{searchMonth}/{groupNo}")
|
/**
|
||||||
public String index(Model model,
|
* 일계부 수입내역 등록 화면
|
||||||
@PathVariable(required = true) String searchMonth,
|
*
|
||||||
@PathVariable(required = true) String groupNo) {
|
* @param model
|
||||||
|
* @param searchMonth 검색 월(yyyyMM)
|
||||||
|
* @param groupNo 검색 그룹
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping(path = "/{searchMonth}/{groupNo}")
|
||||||
|
public String index(Model model, @PathVariable(required = true) String searchMonth, @PathVariable(required = true) String groupNo) {
|
||||||
|
|
||||||
DailyIncomeUIReqVO reqVO = new DailyIncomeUIReqVO();
|
DailyRecordUIReqVO recordReqVO = new DailyRecordUIReqVO(searchMonth, groupNo);
|
||||||
reqVO.setSearchMonth(searchMonth);
|
log.debug("recordReqVO: {}", recordReqVO);
|
||||||
reqVO.setGroupNo(Integer.parseInt(groupNo));
|
|
||||||
reqVO.setHouseholdSeq(AuthUtil.getUserSeq());
|
|
||||||
log.debug("reqVO: {}", reqVO);
|
|
||||||
|
|
||||||
model.addAttribute("reqVO", reqVO);
|
DailyRecordDto dailyRecord = dailyRecordService.getDailyRecord(recordReqVO);
|
||||||
model.addAttribute("detail", null);
|
if (dailyRecord == null || dailyRecord.getId() == null) {
|
||||||
|
throw new NoRecordDataException();
|
||||||
|
}
|
||||||
|
|
||||||
return "record/income/index";
|
DailyIncomeUIReqVO reqVOs = new DailyIncomeUIReqVO();
|
||||||
}
|
reqVOs.setSearchMonth(searchMonth);
|
||||||
|
reqVOs.setGroupNo(Integer.parseInt(groupNo));
|
||||||
|
reqVOs.setHouseholdSeq(AuthUtil.getUserSeq());
|
||||||
|
log.debug("reqVO: {}", reqVOs);
|
||||||
|
|
||||||
|
List<DailyIncomeDto> incomeList = dailyIncomeService.getDailyIncomeList(reqVOs);
|
||||||
|
|
||||||
|
model.addAttribute("reqVO", reqVOs);
|
||||||
|
model.addAttribute("dailyRecord", dailyRecord);
|
||||||
|
model.addAttribute("incomeList", incomeList);
|
||||||
|
|
||||||
|
return "record/income/index";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
package app.module.front.usecase.daily.income.web.model;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.ToString;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@ToString
|
||||||
|
public class CreateDailyIncomeReqVO {
|
||||||
|
private Long id;
|
||||||
|
private Long dailyRecordSeq;
|
||||||
|
// SELF, OCR
|
||||||
|
private String inputType;
|
||||||
|
private Boolean isCredit;
|
||||||
|
private String cropCode;
|
||||||
|
private String categoryCode;
|
||||||
|
private String categorySelf;
|
||||||
|
private String sourcePurpose;
|
||||||
|
private String quantity;
|
||||||
|
private String unitCode;
|
||||||
|
private String price;
|
||||||
|
private String estimated_value;
|
||||||
|
}
|
||||||
@@ -9,4 +9,5 @@ public class DailyIncomeUIReqVO {
|
|||||||
private String searchMonth;
|
private String searchMonth;
|
||||||
private Integer groupNo;
|
private Integer groupNo;
|
||||||
private Long householdSeq;
|
private Long householdSeq;
|
||||||
|
private Long incomeId;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
package app.module.front.usecase.daily.income.web.model;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.ToString;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@ToString
|
||||||
|
public class RemoveDailyIncomeReqVO {
|
||||||
|
private Long id;
|
||||||
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
package app.module.front.usecase.daily.record.persistence;
|
package app.module.front.usecase.daily.record.persistence;
|
||||||
|
|
||||||
|
import app.module.front.usecase.daily.record.persistence.model.CreateDailyRecordCmd;
|
||||||
import app.module.front.usecase.daily.record.persistence.model.DailyRecordDto;
|
import app.module.front.usecase.daily.record.persistence.model.DailyRecordDto;
|
||||||
import app.module.front.usecase.daily.record.web.model.CreateDailyRecordReqVO;
|
|
||||||
import app.module.front.usecase.daily.record.web.model.DailyRecordUIReqVO;
|
import app.module.front.usecase.daily.record.web.model.DailyRecordUIReqVO;
|
||||||
import app.module.front.usecase.daily.record.web.model.UpdateDailyRecordStatusCmd;
|
import app.module.front.usecase.daily.record.web.model.UpdateDailyRecordStatusCmd;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
@@ -10,28 +10,28 @@ import org.apache.ibatis.annotations.Param;
|
|||||||
@Mapper
|
@Mapper
|
||||||
public interface DailyRecordMapper {
|
public interface DailyRecordMapper {
|
||||||
|
|
||||||
DailyRecordDto getDailyRecord(DailyRecordUIReqVO reqVO);
|
DailyRecordDto getDailyRecord(DailyRecordUIReqVO reqVO);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 일계부 등록 여부
|
* 일계부 등록 여부
|
||||||
* @param householdSeq
|
*
|
||||||
* @param recordMonth
|
* @param reqVO
|
||||||
* @param dayGroupNo
|
* @return
|
||||||
* @return
|
*/
|
||||||
*/
|
Integer getDailyRecordExistCount(DailyRecordUIReqVO reqVO);
|
||||||
Long getDailyRecordExistCount(@Param("householdSeq") Long householdSeq, @Param("recordMonth") String recordMonth, @Param("dayGroupNo") Integer dayGroupNo);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 일계부 등록(생성)
|
* 일계부 등록(생성)
|
||||||
* @param command
|
*
|
||||||
* @return
|
* @param command
|
||||||
*/
|
*/
|
||||||
Long createDailyRecord(CreateDailyRecordReqVO command);
|
void createDailyRecord(CreateDailyRecordCmd command);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 일계부 상태 수정
|
* 일계부 상태 수정
|
||||||
* @param command
|
*
|
||||||
* @return
|
* @param command
|
||||||
*/
|
* @return
|
||||||
int updateDailyRecordStatus(UpdateDailyRecordStatusCmd command);
|
*/
|
||||||
|
int updateDailyRecordStatus(UpdateDailyRecordStatusCmd command);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package app.module.front.usecase.daily.record.persistence.model;
|
||||||
|
|
||||||
|
import app.module.front.config.adapters.persistence.component.FrontAuditCommand;
|
||||||
|
import app.module.front.usecase.daily.record.web.model.DailyStatus;
|
||||||
|
import app.module.front.usecase.daily.record.web.model.DailyTargetStatus;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.ToString;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@AllArgsConstructor
|
||||||
|
@ToString
|
||||||
|
public class CreateDailyRecordCmd extends FrontAuditCommand {
|
||||||
|
private Long id;
|
||||||
|
private String recordMonth;
|
||||||
|
private int dayGroupNo;
|
||||||
|
private LocalDate startDate;
|
||||||
|
private LocalDate endDate;
|
||||||
|
private DailyStatus allStatus;
|
||||||
|
private DailyTargetStatus incomeStatus;
|
||||||
|
private DailyTargetStatus workStatus;
|
||||||
|
private DailyTargetStatus expenseStatus;
|
||||||
|
private DailyTargetStatus powerStatus;
|
||||||
|
private DailyTargetStatus forestryStatus;
|
||||||
|
private DailyTargetStatus farmingStatus;
|
||||||
|
}
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
package app.module.front.usecase.daily.record.persistence.model;
|
package app.module.front.usecase.daily.record.persistence.model;
|
||||||
|
|
||||||
|
import app.module.front.usecase.daily.record.web.model.DailyStatus;
|
||||||
|
import app.module.front.usecase.daily.record.web.model.DailyTargetStatus;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
|
||||||
@@ -11,23 +13,22 @@ public class DailyRecordDto {
|
|||||||
// , all_status, income_status, work_status, expense_status, power_status, forestry_status
|
// , all_status, income_status, work_status, expense_status, power_status, forestry_status
|
||||||
// , created_at, created_by, is_deleted
|
// , created_at, created_by, is_deleted
|
||||||
|
|
||||||
private Integer groupNo;
|
private Integer groupNo;
|
||||||
private Integer startDay;
|
private Integer startDay;
|
||||||
private Integer endDay;
|
private Integer endDay;
|
||||||
|
|
||||||
private Long id;
|
private Long id;
|
||||||
// TODO enum
|
private LocalDate startDate;
|
||||||
private LocalDate startDate;
|
private LocalDate endDate;
|
||||||
private LocalDate endDate;
|
private DailyStatus allStatus;
|
||||||
private String allStatus;
|
private DailyTargetStatus incomeStatus;
|
||||||
private String incomeStatus;
|
private DailyTargetStatus workStatus;
|
||||||
|
private DailyTargetStatus expenseStatus;
|
||||||
|
private DailyTargetStatus powerStatus;
|
||||||
|
private DailyTargetStatus forestryStatus;
|
||||||
|
private DailyTargetStatus farmingStatus;
|
||||||
|
|
||||||
public boolean isUpdated() {
|
public boolean isUpdated() {
|
||||||
boolean returnValue = false;
|
return this.id != null;
|
||||||
if (id != null) {
|
|
||||||
returnValue = true;
|
|
||||||
}
|
}
|
||||||
return returnValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,9 +6,9 @@ import lombok.Setter;
|
|||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
public class UpdateDailyRecordDto {
|
public class UpdateDailyRecordDto {
|
||||||
private String monthly;
|
private String monthly;
|
||||||
private String updatedBy;
|
private String updatedBy;
|
||||||
private String statusType;
|
private String statusType;
|
||||||
private String statusCode;
|
private String statusCode;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import app.module.front.usecase.daily.record.web.model.CreateDailyRecordReqVO;
|
|||||||
import app.module.front.usecase.daily.record.web.model.DailyRecordUIReqVO;
|
import app.module.front.usecase.daily.record.web.model.DailyRecordUIReqVO;
|
||||||
|
|
||||||
public interface DailyRecordService {
|
public interface DailyRecordService {
|
||||||
DailyRecordDto getDailyRecord(DailyRecordUIReqVO reqVO);
|
DailyRecordDto getDailyRecord(DailyRecordUIReqVO reqVO);
|
||||||
|
|
||||||
void createDailyRecord(CreateDailyRecordReqVO command);
|
void createDailyRecord(CreateDailyRecordReqVO reqVO);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,11 +2,10 @@ package app.module.front.usecase.daily.record.service;
|
|||||||
|
|
||||||
import app.module.front.config.application.util.AuditUtil;
|
import app.module.front.config.application.util.AuditUtil;
|
||||||
import app.module.front.usecase.daily.record.persistence.DailyRecordMapper;
|
import app.module.front.usecase.daily.record.persistence.DailyRecordMapper;
|
||||||
|
import app.module.front.usecase.daily.record.persistence.model.CreateDailyRecordCmd;
|
||||||
import app.module.front.usecase.daily.record.persistence.model.DailyRecordDto;
|
import app.module.front.usecase.daily.record.persistence.model.DailyRecordDto;
|
||||||
import app.module.front.usecase.daily.record.web.model.CreateDailyRecordReqVO;
|
import app.module.front.usecase.daily.record.web.model.CreateDailyRecordReqVO;
|
||||||
import app.module.front.usecase.daily.record.web.model.DailyRecordUIReqVO;
|
import app.module.front.usecase.daily.record.web.model.DailyRecordUIReqVO;
|
||||||
import app.module.front.usecase.daily.record.web.model.DailyStatus;
|
|
||||||
import app.module.front.usecase.daily.record.web.model.DailyTargetStatus;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@@ -20,54 +19,53 @@ import java.util.Locale;
|
|||||||
@Service
|
@Service
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class DailyRecordServiceImpl implements DailyRecordService {
|
public class DailyRecordServiceImpl implements DailyRecordService {
|
||||||
private final DailyRecordMapper dailyRecordMapper;
|
private final DailyRecordMapper dailyRecordMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DailyRecordDto getDailyRecord(DailyRecordUIReqVO reqVO) {
|
public DailyRecordDto getDailyRecord(DailyRecordUIReqVO reqVO) {
|
||||||
DailyRecordDto detail = dailyRecordMapper.getDailyRecord(reqVO);
|
DailyRecordDto detail = dailyRecordMapper.getDailyRecord(reqVO);
|
||||||
if (detail != null && !detail.isUpdated()) {
|
if (detail != null && !detail.isUpdated()) {
|
||||||
try {
|
try {
|
||||||
SimpleDateFormat beforeSdf = new SimpleDateFormat("yyyyMMdd", Locale.KOREAN);
|
SimpleDateFormat beforeSdf = new SimpleDateFormat("yyyyMMdd", Locale.KOREAN);
|
||||||
SimpleDateFormat afterSdf = new SimpleDateFormat("yyyy-MM-dd", Locale.KOREAN);
|
SimpleDateFormat afterSdf = new SimpleDateFormat("yyyy-MM-dd", Locale.KOREAN);
|
||||||
|
|
||||||
Date formatDate = beforeSdf.parse(reqVO.getSearchMonth() + String.format("%02d", detail.getStartDay()));
|
Date formatDate = beforeSdf.parse(reqVO.getSearchMonth() + String.format("%02d", detail.getStartDay()));
|
||||||
detail.setStartDate(LocalDate.parse(afterSdf.format(formatDate)));
|
detail.setStartDate(LocalDate.parse(afterSdf.format(formatDate)));
|
||||||
|
|
||||||
formatDate = beforeSdf.parse(reqVO.getSearchMonth() + String.format("%02d", detail.getEndDay()));
|
formatDate = beforeSdf.parse(reqVO.getSearchMonth() + String.format("%02d", detail.getEndDay()));
|
||||||
detail.setEndDate(LocalDate.parse(afterSdf.format(formatDate)));
|
detail.setEndDate(LocalDate.parse(afterSdf.format(formatDate)));
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.warn("[DateParse] target={}", detail.getStartDay(), e);
|
log.warn("[DateParse] target={}", detail.getStartDay(), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return detail;
|
return detail;
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void createDailyRecord(CreateDailyRecordReqVO command) {
|
|
||||||
|
|
||||||
if ("Y".equals(command.getTodayNone())) {
|
|
||||||
command.setAllStatus(DailyStatus.TODAY_NONE);
|
|
||||||
} else {
|
|
||||||
command.setAllStatus(DailyStatus.WAITING);
|
|
||||||
|
|
||||||
if (command.getIncomeStatus() == null) {
|
|
||||||
command.setIncomeStatus(DailyTargetStatus.NONE);
|
|
||||||
}
|
|
||||||
if (command.getWorkStatus() == null) {
|
|
||||||
command.setWorkStatus(DailyTargetStatus.NONE);
|
|
||||||
}
|
|
||||||
if (command.getExpenseStatus() == null) {
|
|
||||||
command.setExpenseStatus(DailyTargetStatus.NONE);
|
|
||||||
}
|
|
||||||
if (command.getPowerStatus() == null) {
|
|
||||||
command.setPowerStatus(DailyTargetStatus.NONE);
|
|
||||||
}
|
|
||||||
if (command.getForestryStatus() == null) {
|
|
||||||
command.setForestryStatus(DailyTargetStatus.NONE);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dailyRecordMapper.createDailyRecord(AuditUtil.create(command));
|
@Override
|
||||||
}
|
public void createDailyRecord(CreateDailyRecordReqVO reqVO) {
|
||||||
|
CreateDailyRecordCmd command = AuditUtil.create(
|
||||||
|
new CreateDailyRecordCmd(
|
||||||
|
null,
|
||||||
|
reqVO.getRecordMonth(),
|
||||||
|
reqVO.getDayGroupNo(),
|
||||||
|
reqVO.getStartDate(),
|
||||||
|
reqVO.getEndDate(),
|
||||||
|
reqVO.getAllStatus(),
|
||||||
|
reqVO.getIncomeStatus(),
|
||||||
|
reqVO.getWorkStatus(),
|
||||||
|
reqVO.getExpenseStatus(),
|
||||||
|
reqVO.getPowerStatus(),
|
||||||
|
reqVO.getForestryStatus(),
|
||||||
|
reqVO.getFarmingStatus()));
|
||||||
|
|
||||||
|
Integer existCount = dailyRecordMapper.getDailyRecordExistCount(new DailyRecordUIReqVO(reqVO.getRecordMonth(), reqVO.getDayGroupNo()));
|
||||||
|
if (existCount == 0) {
|
||||||
|
dailyRecordMapper.createDailyRecord(command);
|
||||||
|
|
||||||
|
log.debug("[CreateDailyRecord] record={}", command);
|
||||||
|
} else {
|
||||||
|
log.warn("[DailyRecordCreate] existCount={}, recordMonth={}, dayGroupNo={}", existCount, reqVO.getRecordMonth(), reqVO.getDayGroupNo());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package app.module.front.usecase.daily.record.web;
|
package app.module.front.usecase.daily.record.web;
|
||||||
|
|
||||||
import app.module.front.config.application.util.AuthUtil;
|
import app.module.core.config.application.exception.NoMatchingURIException;
|
||||||
import app.module.front.usecase.daily.calendar.service.RecordCalendarService;
|
import app.module.front.usecase.daily.calendar.service.RecordCalendarService;
|
||||||
import app.module.front.usecase.daily.record.persistence.model.DailyRecordDto;
|
import app.module.front.usecase.daily.record.persistence.model.DailyRecordDto;
|
||||||
import app.module.front.usecase.daily.record.service.DailyRecordService;
|
import app.module.front.usecase.daily.record.service.DailyRecordService;
|
||||||
@@ -22,62 +22,66 @@ import org.springframework.web.bind.annotation.*;
|
|||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@RequestMapping(path = "/record/daily")
|
@RequestMapping(path = "/record/daily")
|
||||||
public class DailyRecordController {
|
public class DailyRecordController {
|
||||||
private final RecordCalendarService recordCalendarService;
|
private final RecordCalendarService recordCalendarService;
|
||||||
private final DailyRecordService dailyRecordService;
|
private final DailyRecordService dailyRecordService;
|
||||||
private final CreateDailyRecordValidator createDailyRecordValidator;;
|
private final CreateDailyRecordValidator createDailyRecordValidator;
|
||||||
|
|
||||||
@GetMapping(path = "/{searchMonth}/{groupNo}")
|
/**
|
||||||
public String createForm(Model model
|
* 일계부 등록 화면
|
||||||
, @PathVariable(required = true) String searchMonth
|
*
|
||||||
, @PathVariable(required = true) String groupNo) {
|
* @param model
|
||||||
|
* @param searchMonth 검색 월(yyyyMM)
|
||||||
|
* @param groupNo 검색 그룹
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping(path = "/{searchMonth}/{groupNo}")
|
||||||
|
public String createForm(Model model, @PathVariable(required = true) String searchMonth, @PathVariable(required = true) String groupNo) {
|
||||||
|
|
||||||
DailyRecordUIReqVO reqVO = new DailyRecordUIReqVO();
|
DailyRecordUIReqVO reqVO = new DailyRecordUIReqVO(searchMonth, groupNo);
|
||||||
reqVO.setSearchMonth(searchMonth);
|
log.debug("reqVO: {}", reqVO);
|
||||||
reqVO.setGroupNo(Integer.parseInt(groupNo));
|
|
||||||
reqVO.setHouseholdSeq(AuthUtil.getUserSeq());
|
|
||||||
log.debug("reqVO: {}", reqVO);
|
|
||||||
|
|
||||||
//uiCodeListPortIn.connect("code.pageable.rows");
|
DailyRecordDto dailyRecord = dailyRecordService.getDailyRecord(reqVO);
|
||||||
|
if (dailyRecord == null) {
|
||||||
|
throw new NoMatchingURIException("[Record] 잘못된 접근");
|
||||||
|
}
|
||||||
|
|
||||||
DailyRecordDto detail = dailyRecordService.getDailyRecord(reqVO);
|
model.addAttribute("reqVO", reqVO);
|
||||||
|
model.addAttribute("dailyRecord", dailyRecord);
|
||||||
|
|
||||||
model.addAttribute("reqVO", reqVO);
|
return "record/daily";
|
||||||
model.addAttribute("detail", detail);
|
|
||||||
|
|
||||||
return "record/daily";
|
|
||||||
}
|
|
||||||
|
|
||||||
@PostMapping(path = "/{searchMonth}/{groupNo}")
|
|
||||||
ResponseEntity<?> create(@PathVariable(required = true) String searchMonth
|
|
||||||
, @PathVariable(required = true) String groupNo
|
|
||||||
, @Valid @RequestBody CreateDailyRecordReqVO formVO, BindingResult bindingResult) {
|
|
||||||
|
|
||||||
createDailyRecordValidator.validate(formVO, bindingResult);
|
|
||||||
if (bindingResult.hasErrors()) {
|
|
||||||
return ResponseEntity.status(HttpStatus.UNPROCESSABLE_ENTITY)
|
|
||||||
.body(bindingResult.getFieldErrors());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DailyRecordUIReqVO reqVO = new DailyRecordUIReqVO();
|
/**
|
||||||
reqVO.setSearchMonth(searchMonth);
|
* 일계부 등록 처리
|
||||||
reqVO.setGroupNo(Integer.parseInt(groupNo));
|
*
|
||||||
// reqVO.setHouseholdSeq(AuthUtil.getUserSeq());
|
* @param searchMonth
|
||||||
log.debug("reqVO: {}", reqVO);
|
* @param groupNo
|
||||||
|
* @param formVO
|
||||||
|
* @param bindingResult
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping(path = "/{searchMonth}/{groupNo}")
|
||||||
|
ResponseEntity<?> create(@PathVariable(required = true) String searchMonth, @PathVariable(required = true) String groupNo
|
||||||
|
, @Valid @RequestBody CreateDailyRecordReqVO formVO, BindingResult bindingResult) {
|
||||||
|
|
||||||
//uiCodeListPortIn.connect("code.pageable.rows");
|
createDailyRecordValidator.validate(formVO, bindingResult);
|
||||||
|
if (bindingResult.hasErrors()) {
|
||||||
|
return ResponseEntity.status(HttpStatus.UNPROCESSABLE_ENTITY)
|
||||||
|
.body(bindingResult.getFieldErrors());
|
||||||
|
}
|
||||||
|
|
||||||
DailyRecordDto detail = dailyRecordService.getDailyRecord(reqVO);
|
DailyRecordUIReqVO reqVO = new DailyRecordUIReqVO(searchMonth, groupNo);
|
||||||
|
log.debug("reqVO: {}", reqVO);
|
||||||
|
|
||||||
formVO.setHouseholdSeq(reqVO.getHouseholdSeq());
|
DailyRecordDto detail = dailyRecordService.getDailyRecord(reqVO);
|
||||||
formVO.setRecordMonth(reqVO.getSearchMonth());
|
formVO.setRecordMonth(reqVO.getSearchMonth());
|
||||||
formVO.setDayGroupNo(reqVO.getGroupNo());
|
formVO.setDayGroupNo(reqVO.getGroupNo());
|
||||||
formVO.setStartDate(detail.getStartDate());
|
formVO.setStartDate(detail.getStartDate());
|
||||||
formVO.setEndDate(detail.getEndDate());
|
formVO.setEndDate(detail.getEndDate());
|
||||||
|
log.debug("formVO: {}", formVO);
|
||||||
|
|
||||||
log.debug("formVO: {}", formVO);
|
dailyRecordService.createDailyRecord(formVO);
|
||||||
dailyRecordService.createDailyRecord(formVO);
|
|
||||||
log.debug("createDailyRecord: id-{}", formVO.getId());
|
|
||||||
|
|
||||||
return ResponseEntity.status(HttpStatus.OK).body(reqVO);
|
return ResponseEntity.status(HttpStatus.OK).body(reqVO);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,26 +2,51 @@ package app.module.front.usecase.daily.record.web.model;
|
|||||||
|
|
||||||
import app.module.front.config.adapters.persistence.component.FrontAuditCommand;
|
import app.module.front.config.adapters.persistence.component.FrontAuditCommand;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.ToString;
|
||||||
|
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class CreateDailyRecordReqVO extends FrontAuditCommand {
|
@ToString
|
||||||
private Long id;
|
public class CreateDailyRecordReqVO {
|
||||||
// private Long householdSeq;
|
private Long id;
|
||||||
private String recordMonth;
|
private String recordMonth;
|
||||||
private int dayGroupNo;
|
private int dayGroupNo;
|
||||||
private LocalDate startDate;
|
private LocalDate startDate;
|
||||||
private LocalDate endDate;
|
private LocalDate endDate;
|
||||||
// TODO : 전체 상태값 정의 ING, DONE
|
private String todayNone;
|
||||||
private String todayNone;
|
private DailyStatus allStatus;
|
||||||
private DailyStatus allStatus;
|
private DailyTargetStatus incomeStatus;
|
||||||
// TODO : 개별 상태값 정의 WAITING, TYPING, TODAY_NONE, NONE, DONE
|
private DailyTargetStatus workStatus;
|
||||||
private DailyTargetStatus incomeStatus;
|
private DailyTargetStatus expenseStatus;
|
||||||
private DailyTargetStatus workStatus;
|
private DailyTargetStatus powerStatus;
|
||||||
private DailyTargetStatus expenseStatus;
|
private DailyTargetStatus forestryStatus;
|
||||||
private DailyTargetStatus powerStatus;
|
private DailyTargetStatus farmingStatus;
|
||||||
private DailyTargetStatus forestryStatus;
|
|
||||||
// TODO : 무슨 데이터 넣을 것인가?
|
public void setTodayNone(String todayNone) {
|
||||||
// private String createdBy;
|
if ("Y".equals(todayNone)) {
|
||||||
|
this.allStatus = DailyStatus.TODAY_NONE;
|
||||||
|
} else {
|
||||||
|
this.allStatus = DailyStatus.WAITING;
|
||||||
|
|
||||||
|
if (incomeStatus == null) {
|
||||||
|
this.incomeStatus = DailyTargetStatus.NONE;
|
||||||
|
}
|
||||||
|
if (workStatus == null) {
|
||||||
|
this.workStatus = DailyTargetStatus.NONE;
|
||||||
|
}
|
||||||
|
if (expenseStatus == null) {
|
||||||
|
this.expenseStatus = DailyTargetStatus.NONE;
|
||||||
|
}
|
||||||
|
if (powerStatus == null) {
|
||||||
|
this.powerStatus = DailyTargetStatus.NONE;
|
||||||
|
}
|
||||||
|
if (forestryStatus == null) {
|
||||||
|
this.forestryStatus = DailyTargetStatus.NONE;
|
||||||
|
}
|
||||||
|
if (farmingStatus == null) {
|
||||||
|
this.farmingStatus = DailyTargetStatus.NONE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,21 @@
|
|||||||
package app.module.front.usecase.daily.record.web.model;
|
package app.module.front.usecase.daily.record.web.model;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
|
|
||||||
@Data
|
@Getter
|
||||||
@ToString
|
@Setter
|
||||||
public class DailyRecordUIReqVO {
|
@ToString(callSuper = true)
|
||||||
private String searchMonth;
|
public class DailyRecordUIReqVO extends DailyUIReqVO {
|
||||||
private Integer groupNo;
|
public DailyRecordUIReqVO(String month, String no) {
|
||||||
private Long householdSeq;
|
setSearchMonth(month);
|
||||||
|
setGroupNo(Integer.parseInt(no));
|
||||||
|
}
|
||||||
|
|
||||||
|
public DailyRecordUIReqVO(String month, Integer no) {
|
||||||
|
setSearchMonth(month);
|
||||||
|
setGroupNo(no);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,17 @@
|
|||||||
package app.module.front.usecase.daily.record.web.model;
|
package app.module.front.usecase.daily.record.web.model;
|
||||||
|
|
||||||
public enum DailyStatus {
|
public enum DailyStatus {
|
||||||
WAITING, TODAY_NONE, DONE;
|
/**
|
||||||
|
* 입력중
|
||||||
|
*/
|
||||||
|
WAITING,
|
||||||
|
/**
|
||||||
|
* 등록 없음
|
||||||
|
*/
|
||||||
|
TODAY_NONE,
|
||||||
|
/**
|
||||||
|
* 등록 완료
|
||||||
|
*/
|
||||||
|
DONE,
|
||||||
|
;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,21 @@
|
|||||||
package app.module.front.usecase.daily.record.web.model;
|
package app.module.front.usecase.daily.record.web.model;
|
||||||
|
|
||||||
public enum DailyTargetStatus {
|
public enum DailyTargetStatus {
|
||||||
WAITING, TODAY_NONE, NONE, DONE;
|
/**
|
||||||
|
* 입력 중
|
||||||
|
*/
|
||||||
|
WAITING,
|
||||||
|
/**
|
||||||
|
* 금일 없음
|
||||||
|
*/
|
||||||
|
TODAY_NONE,
|
||||||
|
/**
|
||||||
|
* 등록 없음
|
||||||
|
*/
|
||||||
|
NONE,
|
||||||
|
/**
|
||||||
|
* 등록 완료
|
||||||
|
*/
|
||||||
|
DONE,
|
||||||
|
;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package app.module.front.usecase.daily.record.web.model;
|
||||||
|
|
||||||
|
import app.module.front.config.application.util.AuthUtil;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.ToString;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@ToString
|
||||||
|
public class DailyUIReqVO {
|
||||||
|
public DailyUIReqVO() {
|
||||||
|
this.householdSeq = AuthUtil.getUserSeq();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 검색 월(yyyyMM)
|
||||||
|
*/
|
||||||
|
private String searchMonth;
|
||||||
|
/**
|
||||||
|
* 검색 그룸번호
|
||||||
|
*/
|
||||||
|
private Integer groupNo;
|
||||||
|
/**
|
||||||
|
* 임가 일련번호
|
||||||
|
*/
|
||||||
|
private Long householdSeq;
|
||||||
|
}
|
||||||
@@ -6,15 +6,15 @@ import lombok.Setter;
|
|||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
public class UpdateDailyRecordStatusCmd {
|
public class UpdateDailyRecordStatusCmd {
|
||||||
private Long id;
|
private Long id;
|
||||||
private Long householdSeq;
|
private Long householdSeq;
|
||||||
private String recordMonth;
|
private String recordMonth;
|
||||||
private int dayGroupNo;
|
private int dayGroupNo;
|
||||||
// TODO : 전체 상태값 정의 ING, DONE
|
// TODO : 전체 상태값 정의 ING, DONE
|
||||||
private String allStatus;
|
private String allStatus;
|
||||||
// TODO : 개별 상태값 정의 WAITING, TYPING, TODAY_NONE, NONE, DONE
|
// TODO : 개별 상태값 정의 WAITING, TYPING, TODAY_NONE, NONE, DONE
|
||||||
private String targetType;
|
private String targetType;
|
||||||
private String targetStatus;
|
private String targetStatus;
|
||||||
// TODO : 무슨 데이터 넣을 것인가?
|
// TODO : 무슨 데이터 넣을 것인가?
|
||||||
private String updatedBy;
|
private String updatedBy;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package app.module.front.usecase.daily.record.web.validator;
|
|||||||
|
|
||||||
import app.module.core.config.application.util.MessageUtil;
|
import app.module.core.config.application.util.MessageUtil;
|
||||||
import app.module.front.usecase.daily.record.web.model.CreateDailyRecordReqVO;
|
import app.module.front.usecase.daily.record.web.model.CreateDailyRecordReqVO;
|
||||||
|
import app.module.front.usecase.daily.record.web.model.DailyStatus;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.apache.tika.utils.StringUtils;
|
import org.apache.tika.utils.StringUtils;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
@@ -10,41 +11,41 @@ import org.springframework.validation.Validator;
|
|||||||
|
|
||||||
@Component
|
@Component
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class CreateDailyRecordValidator implements Validator {
|
public class CreateDailyRecordValidator implements Validator {
|
||||||
private final MessageUtil messageUtil;
|
private final MessageUtil messageUtil;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supports(Class<?> clazz) {
|
public boolean supports(Class<?> clazz) {
|
||||||
return CreateDailyRecordReqVO.class.equals(clazz);
|
return CreateDailyRecordReqVO.class.equals(clazz);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void validate(Object target, Errors errors) {
|
public void validate(Object target, Errors errors) {
|
||||||
CreateDailyRecordReqVO vo = (CreateDailyRecordReqVO) target;
|
CreateDailyRecordReqVO vo = (CreateDailyRecordReqVO) target;
|
||||||
|
|
||||||
if (StringUtils.isBlank(vo.getTodayNone())) {
|
if (DailyStatus.WAITING.equals(vo.getAllStatus())) {
|
||||||
int noneCount = 0;
|
int noneCount = 0;
|
||||||
if (vo.getIncomeStatus() != null) {
|
if (vo.getIncomeStatus() != null) {
|
||||||
noneCount++;
|
noneCount++;
|
||||||
}
|
}
|
||||||
if (vo.getWorkStatus() != null) {
|
if (vo.getWorkStatus() != null) {
|
||||||
noneCount++;
|
noneCount++;
|
||||||
}
|
}
|
||||||
if (vo.getExpenseStatus() != null) {
|
if (vo.getExpenseStatus() != null) {
|
||||||
noneCount++;
|
noneCount++;
|
||||||
}
|
}
|
||||||
if (vo.getPowerStatus() != null) {
|
if (vo.getPowerStatus() != null) {
|
||||||
noneCount++;
|
noneCount++;
|
||||||
}
|
}
|
||||||
if (vo.getForestryStatus() != null) {
|
if (vo.getForestryStatus() != null) {
|
||||||
noneCount++;
|
noneCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (noneCount == 0) {
|
if (noneCount == 0) {
|
||||||
errors.rejectValue(
|
errors.rejectValue(
|
||||||
"incomeStatus", "valid.common.required",
|
"incomeStatus", "valid.common.required",
|
||||||
messageUtil.getMessage("valid.common.required"));
|
"등록하실 항목을 선택해 주세요.");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,12 +6,12 @@ import org.springframework.web.bind.annotation.GetMapping;
|
|||||||
@Controller
|
@Controller
|
||||||
public class HomeController {
|
public class HomeController {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* FRONT 메인 페이지
|
* FRONT 메인 페이지
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@GetMapping(path = "/")
|
@GetMapping(path = "/")
|
||||||
public String home() {
|
public String home() {
|
||||||
return "forward:/record/calendar";
|
return "forward:/record/calendar";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,12 +6,12 @@ import org.springframework.web.bind.annotation.GetMapping;
|
|||||||
@Controller
|
@Controller
|
||||||
public class LoginController {
|
public class LoginController {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* FRONT 로그인 페이지
|
* FRONT 로그인 페이지
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@GetMapping("/login")
|
@GetMapping("/login")
|
||||||
public String login() {
|
public String login() {
|
||||||
return "security/login";
|
return "security/login";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,36 +2,29 @@
|
|||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
<!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.income.persistence.DailyIncomeMapper">
|
<mapper namespace="app.module.front.usecase.daily.income.persistence.DailyIncomeMapper">
|
||||||
|
|
||||||
<select id="getDailyIncomeExistCount" resultType="int">
|
<select id="getDailyIncomeList"
|
||||||
select count(ds.*)
|
resultType="app.module.front.usecase.daily.income.persistence.model.DailyIncomeDto">
|
||||||
from daily_income ds
|
select ds.id, ds.daily_record_seq, ds.input_type, ds.is_credit
|
||||||
|
, ds.crop_code, ds.category_code, ds.category_self, ds.source_purpose
|
||||||
|
, ds.quantity, ds.unit_code, ds.price, ds.estimated_value
|
||||||
|
from daily_income ds
|
||||||
<include refid="app.module.front.usecase.daily.record.persistence.DailyRecordMapper.InnerJoinByDailyRecord"/>
|
<include refid="app.module.front.usecase.daily.record.persistence.DailyRecordMapper.InnerJoinByDailyRecord"/>
|
||||||
where ds.is_deleted = false
|
where ds.is_deleted = false
|
||||||
|
<if test="incomeId != null and incomeId != ''">
|
||||||
|
and ds.id = ${incomeId}
|
||||||
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getDailyIncomeList">
|
<select id="getDailyIncomeExistCount" resultType="int">
|
||||||
select id, daily_record_seq, is_credit, crop_code, category_code, category_name, source_purpose
|
select count(1)
|
||||||
, quantity, unit_code, price, estimated_value
|
from daily_income ds
|
||||||
, created_at, created_by
|
<include refid="app.module.front.usecase.daily.record.persistence.DailyRecordMapper.InnerJoinByDailyRecord"/>
|
||||||
from daily_income
|
where ds.is_deleted = false
|
||||||
where is_deleted = false
|
|
||||||
and daily_record_seq = 1
|
|
||||||
and id = 1
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="getDailyIncome">
|
|
||||||
select id, daily_record_seq, is_credit, crop_code, category_code, category_name, source_purpose
|
|
||||||
, quantity, unit_code, price, estimated_value
|
|
||||||
, created_at, created_by
|
|
||||||
from daily_income
|
|
||||||
where is_deleted = false
|
|
||||||
and daily_record_seq = 1
|
|
||||||
and id = 1
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="createDailyIncome" useGeneratedKeys="true" keyProperty="id">
|
<insert id="createDailyIncome" useGeneratedKeys="true" keyProperty="id">
|
||||||
insert into daily_income (
|
insert into daily_income (
|
||||||
daily_record_seq, is_credit, crop_code, category_code, category_name, source_purpose
|
daily_record_seq, is_credit, crop_code, category_code, category_self, source_purpose
|
||||||
, quantity, unit_code, price, estimated_value
|
, quantity, unit_code, price, estimated_value
|
||||||
, created_at, created_by, is_deleted
|
, created_at, created_by, is_deleted
|
||||||
) values (
|
) values (
|
||||||
@@ -49,7 +42,7 @@
|
|||||||
, is_credit = #{isCredit}
|
, is_credit = #{isCredit}
|
||||||
, crop_code = #{cropCode}
|
, crop_code = #{cropCode}
|
||||||
, category_code = #{categoryCode}
|
, category_code = #{categoryCode}
|
||||||
, category_name = #{categoryName}
|
, category_self = #{categorySelf}
|
||||||
, source_purpose = #{sourcePurpose}
|
, source_purpose = #{sourcePurpose}
|
||||||
, quantity = #{quantity}
|
, quantity = #{quantity}
|
||||||
, unit_code = #{unitCode}
|
, unit_code = #{unitCode}
|
||||||
|
|||||||
@@ -16,27 +16,25 @@
|
|||||||
and ddg.group_no = #{groupNo}
|
and ddg.group_no = #{groupNo}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getDailyRecordExistCount"
|
<select id="getDailyRecordExistCount" resultType="int">
|
||||||
resultType="int">
|
select count(1) as exist
|
||||||
/* 일계부 데이터 존재 여부 getDailyRecordExistCount */
|
from daily_record dr
|
||||||
select count(*) as exist
|
where dr.is_deleted = false
|
||||||
from daily_record dr
|
and dr.household_seq = #{householdSeq}
|
||||||
where dr.household_seq = 2
|
and dr.record_month = #{searchMonth}
|
||||||
and dr.is_deleted = false
|
and dr.day_group_no = #{groupNo}
|
||||||
and dr.record_month = '2025-06'
|
|
||||||
and dr.day_group_no = 3
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="createDailyRecord" useGeneratedKeys="true" keyProperty="id">
|
<insert id="createDailyRecord" useGeneratedKeys="true" keyProperty="id">
|
||||||
insert into daily_record (
|
insert into daily_record (
|
||||||
household_seq, record_month, day_group_no, start_date, end_date
|
household_seq, record_month, day_group_no, start_date, end_date
|
||||||
, all_status, income_status, work_status, expense_status, power_status, forestry_status
|
, all_status, income_status, work_status, expense_status, power_status, forestry_status, farming_status
|
||||||
, is_deleted
|
, is_deleted
|
||||||
, <include refid="common.fields.CreateUpdateBaseColumns"/>
|
, <include refid="common.fields.CreateUpdateBaseColumns"/>
|
||||||
) values (
|
) values (
|
||||||
#{householdSeq}
|
#{householdSeq}
|
||||||
, #{recordMonth}, #{dayGroupNo}, #{startDate}, #{endDate}
|
, #{recordMonth}, #{dayGroupNo}, #{startDate}, #{endDate}
|
||||||
, #{allStatus}, #{incomeStatus}, #{workStatus}, #{expenseStatus}, #{powerStatus}, #{forestryStatus}
|
, #{allStatus}, #{incomeStatus}, #{workStatus}, #{expenseStatus}, #{powerStatus}, #{forestryStatus}, #{farmingStatus}
|
||||||
, false
|
, false
|
||||||
, <include refid="common.fields.CreateUpdateBaseValues"/>
|
, <include refid="common.fields.CreateUpdateBaseValues"/>
|
||||||
)
|
)
|
||||||
@@ -62,11 +60,10 @@
|
|||||||
</update>
|
</update>
|
||||||
|
|
||||||
<sql id="InnerJoinByDailyRecord">
|
<sql id="InnerJoinByDailyRecord">
|
||||||
/* TODO */
|
|
||||||
inner join daily_record dr on
|
inner join daily_record dr on
|
||||||
dr.id = ds.daily_record_seq
|
dr.id = ds.daily_record_seq
|
||||||
and dr.is_deleted = false
|
and dr.is_deleted = false
|
||||||
and dr.recordMonth = #{recordMonth} and dr.day_group_no = #{dayGroupNo}
|
and dr.record_month = #{searchMonth} and dr.day_group_no = #{groupNo}
|
||||||
and dr.household_seq = #{householdSeq}
|
and dr.household_seq = #{householdSeq}
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
|
|||||||
@@ -32,11 +32,13 @@ var ajaxUtil = {
|
|||||||
ajaxUtil._alert(message, '오류 안내');
|
ajaxUtil._alert(message, '오류 안내');
|
||||||
},
|
},
|
||||||
_alert : function (alertMessage, alertTitle, afterEvent) {
|
_alert : function (alertMessage, alertTitle, afterEvent) {
|
||||||
ajaxUtil._alertMethod({
|
etUI.dialog.alert({
|
||||||
id: null,
|
title: alertTitle,
|
||||||
title: alertTitle !== undefined ? alertTitle : null,
|
|
||||||
message: alertMessage,
|
message: alertMessage,
|
||||||
after: afterEvent !== undefined ? (afterEvent ? 'Y' : 'N') : 'N',
|
type: "alert",
|
||||||
|
callback: function() {
|
||||||
|
console.log("alert callback");
|
||||||
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
_alertId : function (alertId, afterEvent) {
|
_alertId : function (alertId, afterEvent) {
|
||||||
@@ -133,14 +135,17 @@ var ajaxUtil = {
|
|||||||
if (typeof errorCallback !== 'undefined') {
|
if (typeof errorCallback !== 'undefined') {
|
||||||
errorCallback(ajaxUtil.$404, rstData);
|
errorCallback(ajaxUtil.$404, rstData);
|
||||||
} else {
|
} else {
|
||||||
kri.menu.main();
|
// kri.menu.main();
|
||||||
|
kri.logger.error('statusCode: 404');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
401:function(){
|
401:function(){
|
||||||
kri.menu.main();
|
// kri.menu.main();
|
||||||
|
kri.logger.error('statusCode: 401');
|
||||||
},
|
},
|
||||||
403:function(rstData){
|
403:function(rstData){
|
||||||
kri.menu.main();
|
// kri.menu.main();
|
||||||
|
kri.logger.error('statusCode: 403');
|
||||||
},
|
},
|
||||||
422:function(rstData, status) {
|
422:function(rstData, status) {
|
||||||
console.log(rstData)
|
console.log(rstData)
|
||||||
@@ -151,6 +156,14 @@ var ajaxUtil = {
|
|||||||
|
|
||||||
target.parent().find('.invalid-feedback').text(oj.defaultMessage);
|
target.parent().find('.invalid-feedback').text(oj.defaultMessage);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if ($('.invalid-feedback').length === 0) {
|
||||||
|
let fieldErrors = rstData.responseJSON != null ? rstData.responseJSON : null;
|
||||||
|
if (fieldErrors != null && fieldErrors.length > 0) {
|
||||||
|
ajaxUtil._alert(fieldErrors[0].defaultMessage, '유효성 체크');
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
},
|
},
|
||||||
500:function(rstData){
|
500:function(rstData){
|
||||||
ajaxUtil._hideWaiting();
|
ajaxUtil._hideWaiting();
|
||||||
|
|||||||
@@ -2,9 +2,9 @@ let krip= {};
|
|||||||
krip.daily = new Object();
|
krip.daily = new Object();
|
||||||
|
|
||||||
krip.daily.httpUrl = {
|
krip.daily.httpUrl = {
|
||||||
base: '/record/calendar',
|
root: '/record/calendar',
|
||||||
daily: '/record/daily/{month}/{groupNo}',
|
daily: '/record/daily/{month}/{groupNo}',
|
||||||
target: '/record/daily/{month}/{groupNo}/{target}',
|
target: '/record/{target}/{month}/{groupNo}',
|
||||||
// income: '/record/daily/{month}/{groupNo}/income',
|
// income: '/record/daily/{month}/{groupNo}/income',
|
||||||
// work: '/record/daily/{month}/{groupNo}/work',
|
// work: '/record/daily/{month}/{groupNo}/work',
|
||||||
// expense: '/record/daily/{month}/{groupNo}/expense',
|
// expense: '/record/daily/{month}/{groupNo}/expense',
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<div id="wrap">
|
<div id="wrap">
|
||||||
<section th:replace="~{common/components :: header}"></section>
|
<section th:replace="~{common/components :: header}"></section>
|
||||||
|
|
||||||
<div class="acco-wrap" id="container" layout:fragment="content">
|
<div id="container" layout:fragment="content">
|
||||||
page content
|
page content
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<div id="wrap">
|
<div id="wrap">
|
||||||
<section th:replace="~{common/components :: header}"></section>
|
<section th:replace="~{common/components :: header}"></section>
|
||||||
|
|
||||||
<div class="acco-wrap btm-footer" id="container" layout:fragment="content">
|
<div class="btm-footer" id="container" layout:fragment="content">
|
||||||
page content
|
page content
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<html layout:decorate="~{layout/layout}" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
|
<html layout:decorate="~{layout/layout}" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
|
||||||
xmlns:th="http://www.thymeleaf.org" lang="ko">
|
xmlns:th="http://www.thymeleaf.org" lang="ko">
|
||||||
|
|
||||||
<div layout:fragment="content">
|
<div layout:fragment="content" th:classappend="acco-wrap">
|
||||||
<main id="content" role="main">
|
<main id="content" role="main">
|
||||||
<h2>calendar</h2>
|
<h2>calendar</h2>
|
||||||
<div>
|
<div>
|
||||||
|
|||||||
@@ -2,85 +2,100 @@
|
|||||||
<html layout:decorate="~{layout/layout-none}" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
|
<html layout:decorate="~{layout/layout-none}" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
|
||||||
xmlns:th="http://www.thymeleaf.org" lang="ko">
|
xmlns:th="http://www.thymeleaf.org" lang="ko">
|
||||||
|
|
||||||
<div layout:fragment="content">
|
<div layout:fragment="content" th:classappend="acco-wrap">
|
||||||
<main id="content" role="main">
|
<th:block th:if="${@systemProperties['spring.profiles.active'] eq 'local'}">
|
||||||
<h2>daily Form</h2>
|
<div>
|
||||||
<div>
|
reqVO: [[${reqVO}]]
|
||||||
reqVO: [[${reqVO}]]
|
</div>
|
||||||
</div>
|
<div>
|
||||||
<div>
|
detail: [[${dailyRecord}]]
|
||||||
[[${#temporals.format(detail.startDate, 'yyyy년 MM월 dd일')}]] ~ [[${#temporals.format(detail.endDate, 'yyyy년 MM월 dd일')}]]<br/>
|
</div>
|
||||||
|
</th:block>
|
||||||
|
<main id="content" role="main">
|
||||||
|
<div class="inner">
|
||||||
<form name="reqForm">
|
<hgroup class="tit-group">
|
||||||
<input type="hidden1" name="todayNone" value="" />
|
<h3 th:data-start="${#temporals.format(dailyRecord.startDate, 'M월 d일')}"
|
||||||
|
th:data-end="${#temporals.format(dailyRecord.endDate, 'd일')}">
|
||||||
<br/>
|
<th:block th:if="${dailyRecord.startDay eq dailyRecord.endDay}">
|
||||||
<div>
|
[[${#temporals.format(dailyRecord.startDate, 'M월 d일')}]], <br>
|
||||||
<input type="checkbox" name="incomeStatus" value="WAITING" data-target="income" /> 수입 내역
|
</th:block>
|
||||||
<div class="invalid-feedback">
|
<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>등록하실 내용</strong>이 있나요?
|
||||||
|
</h3>
|
||||||
|
<p>등록하실 항목을 선택해 주세요.</p>
|
||||||
|
</hgroup>
|
||||||
|
<form name="reqForm">
|
||||||
|
<input type="hidden" name="todayNone" value="">
|
||||||
|
<section class="switch-group">
|
||||||
|
<div class="component-input">
|
||||||
|
<label class="switch-inner type-txt">
|
||||||
|
<span class="switch-label">수입</span>
|
||||||
|
<input type="checkbox" name="incomeStatus" value="WAITING" data-target="income">
|
||||||
|
<span class="switch-item">
|
||||||
|
<span class="switch-handle"></span>
|
||||||
|
</span>
|
||||||
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="component-input">
|
||||||
|
<label class="switch-inner type-txt">
|
||||||
|
<span class="switch-label">임업노동 투입 내역</span>
|
||||||
<br/>
|
<input type="checkbox" name="workStatus" value="WAITING" data-target="work">
|
||||||
<div>
|
<span class="switch-item">
|
||||||
<input type="checkbox" name="workStatus" value="WAITING" data-target="work" /> 노동 내역
|
<span class="switch-handle"></span>
|
||||||
<div class="invalid-feedback">
|
</span>
|
||||||
에러 메세지
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="component-input">
|
||||||
|
<label class="switch-inner type-txt">
|
||||||
|
<span class="switch-label">지출</span>
|
||||||
|
<input type="checkbox" name="expenseStatus" value="WAITING" data-target="expense">
|
||||||
|
<span class="switch-item">
|
||||||
|
<span class="switch-handle"></span>
|
||||||
|
</span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div class="component-input">
|
||||||
|
<label class="switch-inner type-txt">
|
||||||
|
<span class="switch-label">동력 사용시간</span>
|
||||||
|
<input type="checkbox" name="powerStatus" value="WAITING" data-target="power">
|
||||||
|
<span class="switch-item">
|
||||||
|
<span class="switch-handle"></span>
|
||||||
|
</span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div class="component-input">
|
||||||
|
<label class="switch-inner type-txt">
|
||||||
|
<span class="switch-label">자가임업 생산물 중 자가소비량</span>
|
||||||
|
<input type="checkbox" name="forestryStatus" value="WAITING" data-target="forestry">
|
||||||
|
<span class="switch-item">
|
||||||
|
<span class="switch-handle"></span>
|
||||||
|
</span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<!-- TODO : 자가농업 생산물 중 자가소비량은 7일차 등록일에만 노출 및 선택 -->
|
||||||
|
<div class="component-input">
|
||||||
|
<label class="switch-inner type-txt">
|
||||||
|
<span class="switch-label">자가농업 생산물 중 자가소비량</span>
|
||||||
|
<input type="checkbox" name="farmingStatus" value="WAITING" data-target="farming">
|
||||||
|
<span class="switch-item">
|
||||||
|
<span class="switch-handle"></span>
|
||||||
|
</span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
|
||||||
</form>
|
<div class="component-btns fixed">
|
||||||
|
<div class="btns-row" th:if="${!dailyRecord.updated}">
|
||||||
|
<button type="button" class="btn btn-l btn-primary" th:onclick="formControl.createValid([[${reqVO.searchMonth}]], [[${reqVO.groupNo}]])">
|
||||||
<th:block th:if="${detail.updated}">
|
<span class="btn-txt">다음 단계로 이동</span>
|
||||||
수정
|
</button>
|
||||||
</th:block>
|
</div>
|
||||||
<th:block th:if="${!detail.updated}">
|
|
||||||
<input type="button" value="등록" th:onclick="formControl.create([[${reqVO.searchMonth}]], [[${reqVO.groupNo}]])" />
|
|
||||||
</th:block>
|
|
||||||
|
|
||||||
<br/><br/>
|
|
||||||
detail: [[${detail}]]
|
|
||||||
</div>
|
</div>
|
||||||
</main>
|
|
||||||
|
|
||||||
<style>
|
|
||||||
.content {
|
|
||||||
margin-bottom: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.content label {
|
|
||||||
font-weight: bold;
|
|
||||||
display: block;
|
|
||||||
margin-bottom: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.content div {
|
|
||||||
padding: 8px 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tox-tinymce {
|
|
||||||
border: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.invalid-feedback {
|
|
||||||
display: none;
|
|
||||||
font-size: 12px;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
.is-invalid + .invalid-feedback {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
|
|
||||||
textarea.is-invalid ~ .invalid-feedback {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -89,35 +104,66 @@
|
|||||||
<script th:inline="javascript">
|
<script th:inline="javascript">
|
||||||
let ENV = {
|
let ENV = {
|
||||||
httpUrl: {
|
httpUrl: {
|
||||||
root: '',
|
root: /*[[|/record/daily/${reqVO.searchMonth}/${reqVO.groupNo}|]]*/'rootUrl',
|
||||||
create: '',
|
|
||||||
},
|
},
|
||||||
|
month: [[${reqVO.searchMonth}]],
|
||||||
|
groupNo: [[${reqVO.groupNo}]],
|
||||||
submitted: false,
|
submitted: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
let formControl = {
|
let formControl = {
|
||||||
create(searchMonth, groupNo) {
|
createValid() {
|
||||||
const f = document.reqForm;
|
const f = document.reqForm;
|
||||||
|
|
||||||
if ($(f).find('input:checked').length == 0) {
|
if ($(f).find('input:checked').length === 0) {
|
||||||
if (confirm('등록할 내용이 없음?')) {
|
this.createConfirm();
|
||||||
f.todayNone.value = 'Y';
|
} else {
|
||||||
}
|
this.create();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
createConfirm() {
|
||||||
|
etUI.locales.ko = {
|
||||||
|
dialog: {
|
||||||
|
positive: '예',
|
||||||
|
negative: '아니오',
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
let message = ', 등록하실 항목이 없나요?';
|
||||||
|
let $messageWrap = $('#content .tit-group h3');
|
||||||
|
if ($messageWrap.data('start').indexOf($messageWrap.data('end')) !== -1) {
|
||||||
|
message = $messageWrap.data('start') + '~' + $messageWrap.data('end') + message;
|
||||||
|
} else {
|
||||||
|
message = $messageWrap.data('start') + message;
|
||||||
|
}
|
||||||
|
|
||||||
|
etUI.dialog.alert({
|
||||||
|
title: "등록 항목 확인",
|
||||||
|
message: message,
|
||||||
|
type: "confirm",
|
||||||
|
dialogType: "confirm",
|
||||||
|
callback: function () {
|
||||||
|
formControl.create();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
create() {
|
||||||
|
const f = document.reqForm;
|
||||||
|
|
||||||
|
if ($(f).find('input:checked').length === 0) {
|
||||||
|
f.todayNone.value = 'Y';
|
||||||
}
|
}
|
||||||
|
|
||||||
const obj = $(f).serializeObject();
|
const obj = $(f).serializeObject();
|
||||||
ajaxUtil._ajaxAsync(
|
ajaxUtil._ajaxAsync(
|
||||||
ENV.httpUrl.create.replace('{searchMonth}', searchMonth).replace('{groupNo}', groupNo),
|
ENV.httpUrl.root,
|
||||||
obj,
|
obj,
|
||||||
function(rstData, status) {
|
function (rstData, status) {
|
||||||
console.log(rstData);
|
if (f.todayNone.value === 'Y') {
|
||||||
|
|
||||||
if (f.todayNone.value == 'Y') {
|
|
||||||
krip.daily.goToMain();
|
krip.daily.goToMain();
|
||||||
} else {
|
} else {
|
||||||
krip.daily.goToNext($('input:checked').eq(0).data('target'), searchMonth, groupNo);
|
krip.daily.goToNext($('input:checked').eq(0).data('target'), ENV.month, ENV.groupNo);
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|||||||
34
front/src/main/resources/templates/record/work/index.html
Normal file
34
front/src/main/resources/templates/record/work/index.html
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
<!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: [[${detail}]]
|
||||||
|
</div>
|
||||||
|
</th:block>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<section layout:fragment="script">
|
||||||
|
<script th:src="@{/static/ui/page/daily-record.js}"></script>
|
||||||
|
<script th:inline="javascript">
|
||||||
|
let ENV = {
|
||||||
|
httpUrl: {
|
||||||
|
root: /*[[|/record/daily/${reqVO.searchMonth}/${reqVO.groupNo}|]]*/'rootUrl',
|
||||||
|
},
|
||||||
|
month: [[${reqVO.searchMonth}]],
|
||||||
|
groupNo: [[${reqVO.groupNo}]],
|
||||||
|
submitted: false,
|
||||||
|
};
|
||||||
|
|
||||||
|
let formControl = {
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
</html>
|
||||||
Reference in New Issue
Block a user