Merge branch 'dev' into 'deploy-dev-front'
일계부 등록 배포 See merge request korea-research/korea-research!2
This commit is contained in:
@@ -143,6 +143,7 @@ CREATE TABLE daily_income (
|
|||||||
daily_record_seq bigint NOT NULL, -- 일계부 작성상태 일련번호 (FK)
|
daily_record_seq bigint NOT NULL, -- 일계부 작성상태 일련번호 (FK)
|
||||||
input_type varchar(5), -- 입력 구분(SELF, OCR)
|
input_type varchar(5), -- 입력 구분(SELF, OCR)
|
||||||
is_credit boolean, -- 외상판매 여부
|
is_credit boolean, -- 외상판매 여부
|
||||||
|
expense_mark_code varchar(10), -- 지출부호
|
||||||
crop_code varchar(255), -- 재배형태 코드 (매핑코드)
|
crop_code varchar(255), -- 재배형태 코드 (매핑코드)
|
||||||
category_code varchar(255), -- 수입 종류(매핑코드)
|
category_code varchar(255), -- 수입 종류(매핑코드)
|
||||||
category_self varchar(30), -- 수입 종류(직접입력)
|
category_self varchar(30), -- 수입 종류(직접입력)
|
||||||
@@ -169,6 +170,7 @@ COMMENT ON COLUMN daily_income.id IS '일계부 수입 ID';
|
|||||||
COMMENT ON COLUMN daily_income.daily_record_seq IS '일계부 작성상태 일련번호';
|
COMMENT ON COLUMN daily_income.daily_record_seq IS '일계부 작성상태 일련번호';
|
||||||
COMMENT ON COLUMN daily_income.input_type IS '입력 구분(SELF, OCR)';
|
COMMENT ON COLUMN daily_income.input_type IS '입력 구분(SELF, OCR)';
|
||||||
COMMENT ON COLUMN daily_income.is_credit IS '외상판매 여부';
|
COMMENT ON COLUMN daily_income.is_credit IS '외상판매 여부';
|
||||||
|
COMMENT ON COLUMN daily_income.expense_mark_code IS '지출부호';
|
||||||
COMMENT ON COLUMN daily_income.crop_code IS '재배형태 코드 (매핑코드)';
|
COMMENT ON COLUMN daily_income.crop_code IS '재배형태 코드 (매핑코드)';
|
||||||
COMMENT ON COLUMN daily_income.category_code IS '수입 종류(매핑코드)';
|
COMMENT ON COLUMN daily_income.category_code IS '수입 종류(매핑코드)';
|
||||||
COMMENT ON COLUMN daily_income.category_self IS '수입 종류(직접입력)';
|
COMMENT ON COLUMN daily_income.category_self IS '수입 종류(직접입력)';
|
||||||
@@ -195,9 +197,9 @@ CREATE SEQUENCE daily_expense_seq START WITH 1 INCREMENT BY 1 CACHE 1 NO CYCLE;
|
|||||||
CREATE TABLE daily_expense (
|
CREATE TABLE daily_expense (
|
||||||
id bigint DEFAULT nextval('daily_expense_seq') NOT NULL, -- 일계부 지출 ID
|
id bigint DEFAULT nextval('daily_expense_seq') NOT NULL, -- 일계부 지출 ID
|
||||||
daily_record_seq bigint NOT NULL, -- 일계부 작성상태 일련번호 (FK)
|
daily_record_seq bigint NOT NULL, -- 일계부 작성상태 일련번호 (FK)
|
||||||
input_type varchar(5), -- 입력 구분(SELF, OCR)
|
input_type varchar(5), -- 입력 구분(SELF, OCR)
|
||||||
is_credit boolean, -- 외상판매 여부
|
is_credit boolean, -- 외상판매 여부
|
||||||
crop_code varchar(255), -- 재배형태 코드 (매핑코드)
|
income_mark_code varchar(10), -- 수입부호 TODO : 수입종류와 다른것인지 판단 필요. 일단 다르다는 전제조건으로 생성
|
||||||
category_code varchar(255), -- 수입 종류(매핑코드)
|
category_code varchar(255), -- 수입 종류(매핑코드)
|
||||||
category_self varchar(30), -- 수입 종류(직접입력)
|
category_self varchar(30), -- 수입 종류(직접입력)
|
||||||
source_purpose varchar(10), -- 수입원(용도)
|
source_purpose varchar(10), -- 수입원(용도)
|
||||||
@@ -223,7 +225,7 @@ COMMENT ON COLUMN daily_expense.id IS '일계부 지출 ID';
|
|||||||
COMMENT ON COLUMN daily_expense.daily_record_seq IS '일계부 작성상태 일련번호';
|
COMMENT ON COLUMN daily_expense.daily_record_seq IS '일계부 작성상태 일련번호';
|
||||||
COMMENT ON COLUMN daily_expense.input_type IS '입력 구분(SELF, OCR)';
|
COMMENT ON COLUMN daily_expense.input_type IS '입력 구분(SELF, OCR)';
|
||||||
COMMENT ON COLUMN daily_expense.is_credit IS '외상판매 여부';
|
COMMENT ON COLUMN daily_expense.is_credit IS '외상판매 여부';
|
||||||
COMMENT ON COLUMN daily_expense.crop_code IS '재배형태 코드 (매핑코드)';
|
COMMENT ON COLUMN daily_expense.income_mark_code IS '수입부호';
|
||||||
COMMENT ON COLUMN daily_expense.category_code IS '지출 종류(매핑코드)';
|
COMMENT ON COLUMN daily_expense.category_code IS '지출 종류(매핑코드)';
|
||||||
COMMENT ON COLUMN daily_expense.category_self IS '지출 종류(직접입력)';
|
COMMENT ON COLUMN daily_expense.category_self IS '지출 종류(직접입력)';
|
||||||
COMMENT ON COLUMN daily_expense.source_purpose IS '지출원(용도)';
|
COMMENT ON COLUMN daily_expense.source_purpose IS '지출원(용도)';
|
||||||
|
|||||||
@@ -0,0 +1,49 @@
|
|||||||
|
package app.module.front.usecase.daily.expense.persistence;
|
||||||
|
|
||||||
|
import app.module.front.usecase.daily.expense.persistence.model.CreateDailyExpenseCmd;
|
||||||
|
import app.module.front.usecase.daily.expense.persistence.model.DailyExpenseDto;
|
||||||
|
import app.module.front.usecase.daily.expense.persistence.model.RemoveDailyExpenseCmd;
|
||||||
|
import app.module.front.usecase.daily.expense.web.model.DailyExpenseUIReqVO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface DailyExpenseMapper {
|
||||||
|
/**
|
||||||
|
* 일계부 지출 목록 조회
|
||||||
|
*
|
||||||
|
* @param reqVO 검색 조건
|
||||||
|
* @return 수입 목록
|
||||||
|
*/
|
||||||
|
List<DailyExpenseDto> getDailyExpenseList(DailyExpenseUIReqVO reqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 일계부 지출 데이터 존재 여부
|
||||||
|
*
|
||||||
|
* @param reqVO 검색 조건
|
||||||
|
* @return 중복 개수
|
||||||
|
*/
|
||||||
|
Integer getRecordExistCount(DailyExpenseUIReqVO reqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 일계부 지출 등록
|
||||||
|
*
|
||||||
|
* @param command 등록 데이터
|
||||||
|
*/
|
||||||
|
void createDailyExpense(CreateDailyExpenseCmd command);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 일계부 지출 수정
|
||||||
|
*
|
||||||
|
* @param command 수정 데이터
|
||||||
|
*/
|
||||||
|
void updateDailyExpense(CreateDailyExpenseCmd command);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 일계부 지출 삭제
|
||||||
|
*
|
||||||
|
* @param command 삭제 데이터
|
||||||
|
*/
|
||||||
|
void removeDailyExpense(RemoveDailyExpenseCmd command);
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package app.module.front.usecase.daily.expense.persistence.model;
|
||||||
|
|
||||||
|
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 CreateDailyExpenseCmd extends FrontAuditCommand {
|
||||||
|
private Long id;
|
||||||
|
private Long dailyRecordSeq;
|
||||||
|
private String inputType;
|
||||||
|
private Boolean credit;
|
||||||
|
private String incomeMarkCode;
|
||||||
|
private String categoryCode;
|
||||||
|
private String categorySelf;
|
||||||
|
private String sourcePurpose;
|
||||||
|
private Integer quantity;
|
||||||
|
private String unitCode;
|
||||||
|
private Integer price;
|
||||||
|
private Integer estimatedValue;
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package app.module.front.usecase.daily.expense.persistence.model;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class DailyExpenseDto {
|
||||||
|
private Long id;
|
||||||
|
private Long dailyRecordSeq;
|
||||||
|
// TODO : SELF, OCR
|
||||||
|
private String inputType;
|
||||||
|
private Boolean credit;
|
||||||
|
private String categoryCode;
|
||||||
|
private String categoryLabel;
|
||||||
|
private String categorySelf;
|
||||||
|
private String sourcePurpose;
|
||||||
|
private Integer quantity;
|
||||||
|
private String unitCode;
|
||||||
|
private String unitLabel;
|
||||||
|
private Integer price;
|
||||||
|
private Integer estimatedValue;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 수정 가능 여부
|
||||||
|
* @return true=가능, false=불가능(등록 상태)
|
||||||
|
*/
|
||||||
|
public boolean isUpdated() {
|
||||||
|
return this.id != null && this.id != 0L;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package app.module.front.usecase.daily.expense.persistence.model;
|
||||||
|
|
||||||
|
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 RemoveDailyExpenseCmd extends FrontAuditCommand {
|
||||||
|
private String searchMonth;
|
||||||
|
private Integer groupNo;
|
||||||
|
private Long id;
|
||||||
|
private Long dailyRecordSeq;
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
package app.module.front.usecase.daily.expense.service;
|
||||||
|
|
||||||
|
import app.module.front.usecase.daily.expense.persistence.model.DailyExpenseDto;
|
||||||
|
import app.module.front.usecase.daily.expense.web.model.CreateDailyExpenseReqVO;
|
||||||
|
import app.module.front.usecase.daily.expense.web.model.DailyExpenseUIReqVO;
|
||||||
|
import app.module.front.usecase.daily.expense.web.model.RemoveDailyExpenseReqVO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface DailyExpenseService {
|
||||||
|
/**
|
||||||
|
* 일계부 수입 목록 조회
|
||||||
|
*
|
||||||
|
* @param reqVO 검색 조건
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<DailyExpenseDto> getDailyExpenseList(DailyExpenseUIReqVO reqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 일계부 수입 조회
|
||||||
|
*
|
||||||
|
* @param reqVO 검색 조건
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
DailyExpenseDto getDailyExpense(DailyExpenseUIReqVO reqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 일계부 수입 등록
|
||||||
|
*
|
||||||
|
* @param formVO 입력 데이터
|
||||||
|
*/
|
||||||
|
void create(CreateDailyExpenseReqVO formVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 일계부 수입 삭제
|
||||||
|
*
|
||||||
|
* @param formVO 삭제 검색 조건
|
||||||
|
*/
|
||||||
|
void remove(RemoveDailyExpenseReqVO formVO);
|
||||||
|
}
|
||||||
@@ -0,0 +1,124 @@
|
|||||||
|
package app.module.front.usecase.daily.expense.service;
|
||||||
|
|
||||||
|
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.expense.persistence.DailyExpenseMapper;
|
||||||
|
import app.module.front.usecase.daily.expense.persistence.model.CreateDailyExpenseCmd;
|
||||||
|
import app.module.front.usecase.daily.expense.persistence.model.DailyExpenseDto;
|
||||||
|
import app.module.front.usecase.daily.expense.persistence.model.RemoveDailyExpenseCmd;
|
||||||
|
import app.module.front.usecase.daily.expense.web.model.CreateDailyExpenseReqVO;
|
||||||
|
import app.module.front.usecase.daily.expense.web.model.DailyExpenseUIReqVO;
|
||||||
|
import app.module.front.usecase.daily.expense.web.model.RemoveDailyExpenseReqVO;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class DailyExpenseServiceImpl implements DailyExpenseService {
|
||||||
|
private final UICodeListPortIn uiCodeListPortIn;
|
||||||
|
private final DailyExpenseMapper DailyExpenseMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DailyExpenseDto> getDailyExpenseList(DailyExpenseUIReqVO reqVO) {
|
||||||
|
return this.getRefineIncomeList(reqVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DailyExpenseDto getDailyExpense(DailyExpenseUIReqVO reqVO) {
|
||||||
|
List<DailyExpenseDto> list = this.getRefineIncomeList(reqVO);
|
||||||
|
if (list.isEmpty()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return list.get(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<DailyExpenseDto> getRefineIncomeList(DailyExpenseUIReqVO reqVO) {
|
||||||
|
List<DailyExpenseDto> list = DailyExpenseMapper.getDailyExpenseList(reqVO);
|
||||||
|
|
||||||
|
List<UICodeElement> recordIncome = uiCodeListPortIn.connect("code.record.expense");
|
||||||
|
List<UICodeElement> recordUnit = uiCodeListPortIn.connect("code.record.unit");
|
||||||
|
|
||||||
|
for (DailyExpenseDto dto : list) {
|
||||||
|
dto.setCategoryLabel(this.getCodeLabel(dto.getCategoryCode(), recordIncome));
|
||||||
|
dto.setUnitLabel(this.getCodeLabel(dto.getUnitCode(), recordUnit));
|
||||||
|
}
|
||||||
|
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 코드명 조회
|
||||||
|
* @param code 코드
|
||||||
|
* @param codeList 공통 코드 목록
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private String getCodeLabel(String code, List<UICodeElement> codeList) {
|
||||||
|
String returnValue = null;
|
||||||
|
for (UICodeElement codeSetup : codeList) {
|
||||||
|
if (codeSetup.getCodeValue().equalsIgnoreCase(code)) {
|
||||||
|
returnValue = codeSetup.getCodeText();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return returnValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void create(CreateDailyExpenseReqVO formVO) {
|
||||||
|
CreateDailyExpenseCmd command = AuditUtil.create(
|
||||||
|
new CreateDailyExpenseCmd(
|
||||||
|
formVO.getId(),
|
||||||
|
formVO.getDailyRecordSeq(),
|
||||||
|
formVO.getInputType(),
|
||||||
|
formVO.getCredit(),
|
||||||
|
(formVO.getCredit() ? "52210" : null), // [정책] 외상판매 Y 일 경우 수입부호 52210 적재
|
||||||
|
formVO.getCategoryCode(),
|
||||||
|
formVO.getCategorySelf(),
|
||||||
|
formVO.getSourcePurpose(),
|
||||||
|
formVO.getQuantity(),
|
||||||
|
formVO.getUnitCode(),
|
||||||
|
formVO.getPrice(),
|
||||||
|
formVO.getEstimatedValue()));
|
||||||
|
|
||||||
|
DailyExpenseUIReqVO existReqVO = new DailyExpenseUIReqVO(formVO.getSearchMonth(), formVO.getGroupNo());
|
||||||
|
existReqVO.setId(formVO.getId());
|
||||||
|
|
||||||
|
Integer existCount = DailyExpenseMapper.getRecordExistCount(existReqVO);
|
||||||
|
if (existCount == 0) {
|
||||||
|
DailyExpenseMapper.createDailyExpense(command);
|
||||||
|
|
||||||
|
log.debug("[CreateDailyExpense] record={}", command);
|
||||||
|
} else {
|
||||||
|
DailyExpenseMapper.updateDailyExpense(command);
|
||||||
|
|
||||||
|
log.debug("[UpdateDailyExpense] record={}", command);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void remove(RemoveDailyExpenseReqVO formVO) {
|
||||||
|
Long id = formVO.getId() != null ? Long.parseLong(formVO.getId()) : null;
|
||||||
|
RemoveDailyExpenseCmd command = AuditUtil.delete(
|
||||||
|
new RemoveDailyExpenseCmd(
|
||||||
|
formVO.getSearchMonth(),
|
||||||
|
formVO.getGroupNo(),
|
||||||
|
id,
|
||||||
|
formVO.getDailyRecordSeq()));
|
||||||
|
|
||||||
|
DailyExpenseUIReqVO existReqVO = new DailyExpenseUIReqVO(formVO.getSearchMonth(), formVO.getGroupNo());
|
||||||
|
existReqVO.setId(id);
|
||||||
|
|
||||||
|
Integer existCount = DailyExpenseMapper.getRecordExistCount(existReqVO);
|
||||||
|
if (existCount != 0) {
|
||||||
|
DailyExpenseMapper.removeDailyExpense(command);
|
||||||
|
|
||||||
|
log.debug("[RemoveDailyExpense] record={}", command);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,135 @@
|
|||||||
|
package app.module.front.usecase.daily.expense.web;
|
||||||
|
|
||||||
|
import app.module.core.config.application.exception.NoRecordDataException;
|
||||||
|
import app.module.core.config.application.util.CoreUtil;
|
||||||
|
import app.module.front.usecase.daily.expense.service.DailyExpenseService;
|
||||||
|
import app.module.front.usecase.daily.expense.web.model.CreateDailyExpenseReqVO;
|
||||||
|
import app.module.front.usecase.daily.expense.web.model.RemoveDailyExpenseReqVO;
|
||||||
|
import app.module.front.usecase.daily.expense.web.validator.CreateDailyExpenseValidator;
|
||||||
|
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 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/expense")
|
||||||
|
public class DailyExpenseController {
|
||||||
|
private final CoreUtil coreUtil;
|
||||||
|
private final DailyRecordService dailyRecordService;
|
||||||
|
private final DailyExpenseService DailyExpenseService;
|
||||||
|
private final CreateDailyExpenseValidator createDailyExpenseValidator;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 일계부 지출 등록 처리
|
||||||
|
*
|
||||||
|
* @param searchMonth 검색 월(yyyyMM)
|
||||||
|
* @param groupNo 검색 그룹
|
||||||
|
* @param id 수입 일련번호
|
||||||
|
* @param formVO 입력 데이터
|
||||||
|
* @param bindingResult BindingResult
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping(path = "/{searchMonth}/{groupNo}/form/{id}")
|
||||||
|
ResponseEntity<?> create(@PathVariable("searchMonth") String searchMonth, @PathVariable("groupNo") String groupNo
|
||||||
|
, @PathVariable("id") String id
|
||||||
|
, @Valid @RequestBody CreateDailyExpenseReqVO formVO, BindingResult bindingResult) {
|
||||||
|
|
||||||
|
createDailyExpenseValidator.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);
|
||||||
|
|
||||||
|
DailyExpenseService.create(formVO);
|
||||||
|
|
||||||
|
return ResponseEntity.status(HttpStatus.OK).body(formVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 일계부 지출 삭제 처리
|
||||||
|
*
|
||||||
|
* @param searchMonth 검색 월(yyyyMM)
|
||||||
|
* @param groupNo 검색 그룹
|
||||||
|
* @param formVO 입력 데이터
|
||||||
|
* @param bindingResult BindingResult
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping(path = "/{searchMonth}/{groupNo}/remove")
|
||||||
|
ResponseEntity<?> remove(@PathVariable("searchMonth") String searchMonth, @PathVariable("groupNo") String groupNo
|
||||||
|
, @Valid @RequestBody RemoveDailyExpenseReqVO 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);
|
||||||
|
|
||||||
|
DailyExpenseService.remove(formVO);
|
||||||
|
|
||||||
|
return ResponseEntity.status(HttpStatus.OK).body(formVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 일계부 지출 전체 삭제 처리
|
||||||
|
*
|
||||||
|
* @param searchMonth 검색 월(yyyyMM)
|
||||||
|
* @param groupNo 검색 그룹
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping(path = "/{searchMonth}/{groupNo}/reset")
|
||||||
|
ResponseEntity<?> removeAll(@PathVariable("searchMonth") String searchMonth, @PathVariable("groupNo") String groupNo) {
|
||||||
|
|
||||||
|
DailyRecordDto dailyRecord = this.vaildGetDailyRecord(searchMonth, groupNo);
|
||||||
|
|
||||||
|
RemoveDailyExpenseReqVO formVO = new RemoveDailyExpenseReqVO();
|
||||||
|
formVO.setSearchMonth(dailyRecord.getRecordMonth());
|
||||||
|
formVO.setGroupNo(dailyRecord.getGroupNo());
|
||||||
|
formVO.setDailyRecordSeq(dailyRecord.getId());
|
||||||
|
log.debug("formVO: {}", formVO);
|
||||||
|
|
||||||
|
DailyExpenseService.remove(formVO);
|
||||||
|
|
||||||
|
return ResponseEntity.status(HttpStatus.OK).body(formVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 일계부 유효성 체크 및 데이터 조회
|
||||||
|
*
|
||||||
|
* @param searchMonth 검색 월(yyyyMM)
|
||||||
|
* @param groupNo 검색 그룹
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private DailyRecordDto vaildGetDailyRecord(String searchMonth, String groupNo) {
|
||||||
|
DailyRecordUIReqVO reqVO = new DailyRecordUIReqVO(searchMonth, groupNo);
|
||||||
|
log.debug("getRecordUIReq: {}", reqVO);
|
||||||
|
|
||||||
|
DailyRecordDto dailyRecord = dailyRecordService.getDailyRecord(reqVO);
|
||||||
|
if (dailyRecord == null || dailyRecord.getId() == null) {
|
||||||
|
throw new NoRecordDataException();
|
||||||
|
}
|
||||||
|
|
||||||
|
return dailyRecord;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,113 @@
|
|||||||
|
package app.module.front.usecase.daily.expense.web;
|
||||||
|
|
||||||
|
import app.module.core.config.application.exception.NoRecordDataException;
|
||||||
|
import app.module.core.usecase.uicode.list.ports.UICodeListPortIn;
|
||||||
|
import app.module.front.usecase.daily.expense.persistence.model.DailyExpenseDto;
|
||||||
|
import app.module.front.usecase.daily.expense.service.DailyExpenseService;
|
||||||
|
import app.module.front.usecase.daily.expense.web.model.DailyExpenseUIReqVO;
|
||||||
|
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 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.thymeleaf.util.StringUtils;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@Controller
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RequestMapping(path = "/record/expense")
|
||||||
|
public class DailyExpenseUIController {
|
||||||
|
private final UICodeListPortIn uiCodeListPortIn;
|
||||||
|
private final DailyRecordService dailyRecordService;
|
||||||
|
private final DailyExpenseService DailyExpenseService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 일계부 지출 목록 화면
|
||||||
|
*
|
||||||
|
* @param model Model
|
||||||
|
* @param searchMonth 검색 월(yyyyMM)
|
||||||
|
* @param groupNo 검색 그룹
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping(path = "/{searchMonth}/{groupNo}")
|
||||||
|
public String index(Model model, @PathVariable("searchMonth") String searchMonth, @PathVariable("groupNo") String groupNo) {
|
||||||
|
|
||||||
|
DailyRecordDto dailyRecord = this.vaildGetDailyRecord(searchMonth, groupNo);
|
||||||
|
|
||||||
|
DailyExpenseUIReqVO reqVO = new DailyExpenseUIReqVO(searchMonth, groupNo);
|
||||||
|
log.debug("reqVO: {}", reqVO);
|
||||||
|
|
||||||
|
List<DailyExpenseDto> expenseList = DailyExpenseService.getDailyExpenseList(reqVO);
|
||||||
|
|
||||||
|
model.addAttribute("reqVO", reqVO);
|
||||||
|
model.addAttribute("dailyRecord", dailyRecord);
|
||||||
|
model.addAttribute("expenseList", expenseList);
|
||||||
|
|
||||||
|
return "record/expense/index";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 일계부 지출 등록 화면
|
||||||
|
*
|
||||||
|
* @param model Model
|
||||||
|
* @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
|
||||||
|
, @PathVariable("id") String id) {
|
||||||
|
|
||||||
|
DailyExpenseUIReqVO reqVO = new DailyExpenseUIReqVO(searchMonth, groupNo);
|
||||||
|
if (StringUtils.isEmpty(id)) {
|
||||||
|
reqVO.setId(0L);
|
||||||
|
} else {
|
||||||
|
reqVO.setId(Long.parseLong(id));
|
||||||
|
}
|
||||||
|
log.debug("reqVO: {}", reqVO);
|
||||||
|
|
||||||
|
DailyExpenseDto detail = new DailyExpenseDto();
|
||||||
|
if (reqVO.getId() != 0L) {
|
||||||
|
detail = DailyExpenseService.getDailyExpense(reqVO);
|
||||||
|
if (detail == null || !detail.isUpdated()) {
|
||||||
|
throw new NoRecordDataException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
model.addAttribute("recordExpense", uiCodeListPortIn.connect("code.record.expense"));
|
||||||
|
model.addAttribute("recordCrop", uiCodeListPortIn.connect("code.record.crop"));
|
||||||
|
model.addAttribute("recordUnit", uiCodeListPortIn.connect("code.record.unit"));
|
||||||
|
|
||||||
|
model.addAttribute("reqVO", reqVO);
|
||||||
|
model.addAttribute("detail", detail);
|
||||||
|
|
||||||
|
return "record/expense/form";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 일계부 유효성 체크 및 데이터 조회
|
||||||
|
*
|
||||||
|
* @param searchMonth 검색 월(yyyyMM)
|
||||||
|
* @param groupNo 검색 그룹
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private DailyRecordDto vaildGetDailyRecord(String searchMonth, String groupNo) {
|
||||||
|
DailyRecordUIReqVO reqVO = new DailyRecordUIReqVO(searchMonth, groupNo);
|
||||||
|
log.debug("getRecordUIReq: {}", reqVO);
|
||||||
|
|
||||||
|
DailyRecordDto dailyRecord = dailyRecordService.getDailyRecord(reqVO);
|
||||||
|
if (dailyRecord == null || dailyRecord.getId() == null) {
|
||||||
|
throw new NoRecordDataException();
|
||||||
|
}
|
||||||
|
|
||||||
|
return dailyRecord;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
package app.module.front.usecase.daily.expense.web.model;
|
||||||
|
|
||||||
|
import app.module.front.usecase.daily.record.web.model.DailyUIReqVO;
|
||||||
|
import jakarta.validation.constraints.NotBlank;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.ToString;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class CreateDailyExpenseReqVO extends DailyUIReqVO {
|
||||||
|
/**
|
||||||
|
* 수입 일련번호
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 일계부 일련번호
|
||||||
|
*/
|
||||||
|
private Long dailyRecordSeq;
|
||||||
|
/**
|
||||||
|
* 등록 유형(SELF, OCR)
|
||||||
|
*/
|
||||||
|
private String inputType;
|
||||||
|
/**
|
||||||
|
* 외상판매 여부
|
||||||
|
*/
|
||||||
|
private Boolean credit;
|
||||||
|
/**
|
||||||
|
* 지출의 종류 코드
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "지출 종류를 선택해 주세요.")
|
||||||
|
private String categoryCode;
|
||||||
|
/**
|
||||||
|
* 지출의 종류 직접입력
|
||||||
|
*/
|
||||||
|
private String categorySelf;
|
||||||
|
/**
|
||||||
|
* 용도
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "용도를 입력해 주세요.")
|
||||||
|
private String sourcePurpose;
|
||||||
|
/**
|
||||||
|
* 수량
|
||||||
|
*/
|
||||||
|
private Integer quantity;
|
||||||
|
/**
|
||||||
|
* 단위 코드
|
||||||
|
*/
|
||||||
|
private String unitCode;
|
||||||
|
/**
|
||||||
|
* 현금
|
||||||
|
*/
|
||||||
|
private Integer price;
|
||||||
|
/**
|
||||||
|
* 현물평가액
|
||||||
|
*/
|
||||||
|
private Integer estimatedValue;
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package app.module.front.usecase.daily.expense.web.model;
|
||||||
|
|
||||||
|
import app.module.front.usecase.daily.record.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 DailyExpenseUIReqVO extends DailyUIReqVO {
|
||||||
|
public DailyExpenseUIReqVO(String month, String no) {
|
||||||
|
setSearchMonth(month);
|
||||||
|
if (!StringUtils.isBlank(no)) {
|
||||||
|
setGroupNo(Integer.parseInt(no));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public DailyExpenseUIReqVO(String month, Integer no) {
|
||||||
|
setSearchMonth(month);
|
||||||
|
setGroupNo(no);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 수입 일련번호
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
package app.module.front.usecase.daily.expense.web.model;
|
||||||
|
|
||||||
|
import app.module.front.usecase.daily.record.web.model.DailyUIReqVO;
|
||||||
|
import jakarta.validation.constraints.NotBlank;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.ToString;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class RemoveDailyExpenseReqVO extends DailyUIReqVO {
|
||||||
|
/**
|
||||||
|
* 수입 일련번호
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "{valid.common.required}")
|
||||||
|
private String id;
|
||||||
|
/**
|
||||||
|
* 일계부 일련번호
|
||||||
|
*/
|
||||||
|
private Long dailyRecordSeq;
|
||||||
|
}
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
package app.module.front.usecase.daily.expense.web.validator;
|
||||||
|
|
||||||
|
import app.module.front.usecase.daily.expense.web.model.CreateDailyExpenseReqVO;
|
||||||
|
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 CreateDailyExpenseValidator implements Validator {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean supports(Class<?> clazz) {
|
||||||
|
return CreateDailyExpenseReqVO.class.equals(clazz);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void validate(Object target, Errors errors) {
|
||||||
|
CreateDailyExpenseReqVO vo = (CreateDailyExpenseReqVO) target;
|
||||||
|
|
||||||
|
if (StringUtils.isBlank(vo.getCategoryCode())) {
|
||||||
|
errors.rejectValue(
|
||||||
|
"categoryCode", "valid.common.required",
|
||||||
|
"지출 종류를 선택해 주세요.");
|
||||||
|
}
|
||||||
|
|
||||||
|
if ("SELF".equals(vo.getCategoryCode()) && StringUtils.isBlank(vo.getCategorySelf())) {
|
||||||
|
errors.rejectValue(
|
||||||
|
"categorySelf", "valid.common.required",
|
||||||
|
"지출 종류를 입력해 주세요.");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (vo.getPrice() == null && vo.getEstimatedValue() == null) {
|
||||||
|
errors.rejectValue(
|
||||||
|
"price", "valid.common.required",
|
||||||
|
"현금 또는 현물평가액을 입력 해주세요.");
|
||||||
|
errors.rejectValue(
|
||||||
|
"estimatedValue", "valid.common.required",
|
||||||
|
"현금 또는 현물평가액을 입력 해주세요.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -11,42 +11,39 @@ import java.util.List;
|
|||||||
@Mapper
|
@Mapper
|
||||||
public interface DailyIncomeMapper {
|
public interface DailyIncomeMapper {
|
||||||
/**
|
/**
|
||||||
* 수입내역 목록 조회
|
* 일계부 수입 목록 조회
|
||||||
*
|
*
|
||||||
* @param reqVO
|
* @param reqVO 검색 조건
|
||||||
* @return
|
* @return 수입 목록
|
||||||
*/
|
*/
|
||||||
List<DailyIncomeDto> getDailyIncomeList(DailyIncomeUIReqVO reqVO);
|
List<DailyIncomeDto> getDailyIncomeList(DailyIncomeUIReqVO reqVO);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 수입내역 데이터 존재 여부
|
* 일계부 수입 데이터 존재 여부
|
||||||
*
|
*
|
||||||
* @param reqVO
|
* @param reqVO 검색 조건
|
||||||
* @return
|
* @return 중복 개수
|
||||||
*/
|
*/
|
||||||
Integer getRecordExistCount(DailyIncomeUIReqVO reqVO);
|
Integer getRecordExistCount(DailyIncomeUIReqVO reqVO);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 수입내역 등록
|
* 일계부 수입 등록
|
||||||
*
|
*
|
||||||
* @param command
|
* @param command 등록 데이터
|
||||||
* @return
|
|
||||||
*/
|
*/
|
||||||
void createDailyIncome(CreateDailyIncomeCmd command);
|
void createDailyIncome(CreateDailyIncomeCmd command);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 수입내역 수정
|
* 일계부 수입 수정
|
||||||
*
|
*
|
||||||
* @param command
|
* @param command 수정 데이터
|
||||||
* @return
|
|
||||||
*/
|
*/
|
||||||
int updateDailyIncome(CreateDailyIncomeCmd command);
|
void updateDailyIncome(CreateDailyIncomeCmd command);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 수입내역 삭제
|
* 일계부 수입 삭제
|
||||||
*
|
*
|
||||||
* @param command
|
* @param command 삭제 데이터
|
||||||
* @return
|
|
||||||
*/
|
*/
|
||||||
int removeDailyIncome(RemoveDailyIncomeCmd command);
|
void removeDailyIncome(RemoveDailyIncomeCmd command);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,15 +14,13 @@ import lombok.ToString;
|
|||||||
public class CreateDailyIncomeCmd extends FrontAuditCommand {
|
public class CreateDailyIncomeCmd extends FrontAuditCommand {
|
||||||
private Long id;
|
private Long id;
|
||||||
private Long dailyRecordSeq;
|
private Long dailyRecordSeq;
|
||||||
// SELF, OCR
|
|
||||||
private String inputType;
|
private String inputType;
|
||||||
private Boolean credit;
|
private Boolean credit;
|
||||||
private String cropCode;
|
private String cropCode;
|
||||||
// TODO : 수입종류의 코드맵핑 여부 판단
|
private String expenseMarkCode;
|
||||||
private String categoryCode;
|
private String categoryCode;
|
||||||
private String categorySelf;
|
private String categorySelf;
|
||||||
private String sourcePurpose;
|
private String sourcePurpose;
|
||||||
// TODO : 데이터 타입 재정의 여부
|
|
||||||
private Integer quantity;
|
private Integer quantity;
|
||||||
private String unitCode;
|
private String unitCode;
|
||||||
private Integer price;
|
private Integer price;
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import java.time.LocalDateTime;
|
|||||||
public class DailyIncomeDto {
|
public class DailyIncomeDto {
|
||||||
private Long id;
|
private Long id;
|
||||||
private Long dailyRecordSeq;
|
private Long dailyRecordSeq;
|
||||||
// SELF, OCR
|
// TODO : SELF, OCR
|
||||||
private String inputType;
|
private String inputType;
|
||||||
private Boolean credit;
|
private Boolean credit;
|
||||||
private String cropCode;
|
private String cropCode;
|
||||||
@@ -25,7 +25,11 @@ public class DailyIncomeDto {
|
|||||||
private Integer price;
|
private Integer price;
|
||||||
private Integer estimatedValue;
|
private Integer estimatedValue;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 수정 가능 여부
|
||||||
|
* @return true=가능, false=불가능(등록 상태)
|
||||||
|
*/
|
||||||
public boolean isUpdated() {
|
public boolean isUpdated() {
|
||||||
return this.id != null;
|
return this.id != null && this.id != 0L;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import java.util.List;
|
|||||||
|
|
||||||
public interface DailyIncomeService {
|
public interface DailyIncomeService {
|
||||||
/**
|
/**
|
||||||
* 수입내역 목록 조회
|
* 일계부 수입 목록 조회
|
||||||
*
|
*
|
||||||
* @param reqVO 검색 조건
|
* @param reqVO 검색 조건
|
||||||
* @return
|
* @return
|
||||||
@@ -17,7 +17,7 @@ public interface DailyIncomeService {
|
|||||||
List<DailyIncomeDto> getDailyIncomeList(DailyIncomeUIReqVO reqVO);
|
List<DailyIncomeDto> getDailyIncomeList(DailyIncomeUIReqVO reqVO);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 수입내역 조회
|
* 일계부 수입 조회
|
||||||
*
|
*
|
||||||
* @param reqVO 검색 조건
|
* @param reqVO 검색 조건
|
||||||
* @return
|
* @return
|
||||||
@@ -25,16 +25,16 @@ public interface DailyIncomeService {
|
|||||||
DailyIncomeDto getDailyIncome(DailyIncomeUIReqVO reqVO);
|
DailyIncomeDto getDailyIncome(DailyIncomeUIReqVO reqVO);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 수입내역 등록
|
* 일계부 수입 등록
|
||||||
*
|
*
|
||||||
* @param formVO 등록 데이터
|
* @param formVO 입력 데이터
|
||||||
*/
|
*/
|
||||||
void create(CreateDailyIncomeReqVO formVO);
|
void create(CreateDailyIncomeReqVO formVO);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 수입내역 삭제
|
* 일계부 수입 삭제
|
||||||
*
|
*
|
||||||
* @param formVO 검색 조건
|
* @param formVO 삭제 검색 조건
|
||||||
*/
|
*/
|
||||||
void remove(RemoveDailyIncomeReqVO formVO);
|
void remove(RemoveDailyIncomeReqVO formVO);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -80,6 +80,7 @@ public class DailyIncomeServiceImpl implements DailyIncomeService {
|
|||||||
formVO.getInputType(),
|
formVO.getInputType(),
|
||||||
formVO.getCredit(),
|
formVO.getCredit(),
|
||||||
formVO.getCropCode(),
|
formVO.getCropCode(),
|
||||||
|
(formVO.getCredit() ? "91206" : null), // [정책] 외상판매 Y 일 경우 지출부호 91206 적재
|
||||||
formVO.getCategoryCode(),
|
formVO.getCategoryCode(),
|
||||||
formVO.getCategorySelf(),
|
formVO.getCategorySelf(),
|
||||||
formVO.getSourcePurpose(),
|
formVO.getSourcePurpose(),
|
||||||
|
|||||||
@@ -23,19 +23,19 @@ import org.springframework.web.bind.annotation.*;
|
|||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@RequestMapping(path = "/api/record/income")
|
@RequestMapping(path = "/api/record/income")
|
||||||
public class DailyIncomeController {
|
public class DailyIncomeController {
|
||||||
|
private final CoreUtil coreUtil;
|
||||||
private final DailyRecordService dailyRecordService;
|
private final DailyRecordService dailyRecordService;
|
||||||
private final DailyIncomeService dailyIncomeService;
|
private final DailyIncomeService dailyIncomeService;
|
||||||
private final CreateDailyIncomeValidator createDailyIncomeValidator;
|
private final CreateDailyIncomeValidator createDailyIncomeValidator;
|
||||||
private final CoreUtil coreUtil;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 일계부 수입내역 등록 처리
|
* 일계부 수입 등록 처리
|
||||||
*
|
*
|
||||||
* @param searchMonth
|
* @param searchMonth 검색 월(yyyyMM)
|
||||||
* @param groupNo
|
* @param groupNo 검색 그룹
|
||||||
* @param id
|
* @param id 수입 일련번호
|
||||||
* @param formVO
|
* @param formVO 입력 데이터
|
||||||
* @param bindingResult
|
* @param bindingResult BindingResult
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@PostMapping(path = "/{searchMonth}/{groupNo}/form/{id}")
|
@PostMapping(path = "/{searchMonth}/{groupNo}/form/{id}")
|
||||||
@@ -45,8 +45,6 @@ public class DailyIncomeController {
|
|||||||
|
|
||||||
createDailyIncomeValidator.validate(formVO, bindingResult);
|
createDailyIncomeValidator.validate(formVO, bindingResult);
|
||||||
if (bindingResult.hasErrors()) {
|
if (bindingResult.hasErrors()) {
|
||||||
// return ResponseEntity.status(HttpStatus.UNPROCESSABLE_ENTITY)
|
|
||||||
// .body(bindingResult.getFieldErrors());
|
|
||||||
return coreUtil.getErrorInfo(bindingResult);
|
return coreUtil.getErrorInfo(bindingResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -63,43 +61,27 @@ public class DailyIncomeController {
|
|||||||
return ResponseEntity.status(HttpStatus.OK).body(formVO);
|
return ResponseEntity.status(HttpStatus.OK).body(formVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping(path = "/{searchMonth}/{groupNo}/none")
|
|
||||||
ResponseEntity<?> updateByTodayNone(@PathVariable("searchMonth") String searchMonth, @PathVariable("groupNo") String groupNo) {
|
|
||||||
|
|
||||||
DailyRecordDto dailyRecord = this.vaildGetDailyRecord(searchMonth, groupNo);
|
|
||||||
|
|
||||||
RemoveDailyIncomeReqVO formVO = new RemoveDailyIncomeReqVO();
|
|
||||||
formVO.setSearchMonth(dailyRecord.getRecordMonth());
|
|
||||||
formVO.setGroupNo(dailyRecord.getGroupNo());
|
|
||||||
formVO.setDailyRecordSeq(dailyRecord.getId());
|
|
||||||
log.debug("formVO: {}", formVO);
|
|
||||||
|
|
||||||
dailyRecordService.updateDailyRecordStatus(dailyRecord.getRecordMonth(), dailyRecord.getGroupNo(),
|
|
||||||
"INCOME", DailyTargetStatus.TODAY_NONE.name());
|
|
||||||
|
|
||||||
return ResponseEntity.status(HttpStatus.OK).body(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 일계부 수입내역 삭제 처리
|
* 일계부 수입 삭제 처리
|
||||||
*
|
*
|
||||||
* @param searchMonth
|
* @param searchMonth 검색 월(yyyyMM)
|
||||||
* @param groupNo
|
* @param groupNo 검색 그룹
|
||||||
* @param formVO
|
* @param formVO 입력 데이터
|
||||||
* @param bindingResult
|
* @param bindingResult BindingResult
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@PostMapping(path = "/{searchMonth}/{groupNo}/remove")
|
@PostMapping(path = "/{searchMonth}/{groupNo}/remove")
|
||||||
ResponseEntity<?> remove(@PathVariable("searchMonth") String searchMonth, @PathVariable("groupNo") String groupNo
|
ResponseEntity<?> remove(@PathVariable("searchMonth") String searchMonth, @PathVariable("groupNo") String groupNo
|
||||||
, @Valid @RequestBody RemoveDailyIncomeReqVO formVO, BindingResult bindingResult) {
|
, @Valid @RequestBody RemoveDailyIncomeReqVO formVO, BindingResult bindingResult) {
|
||||||
|
|
||||||
log.debug("formVO: {}", formVO);
|
log.debug("before formVO: {}", formVO);
|
||||||
if (bindingResult.hasErrors()) {
|
if (bindingResult.hasErrors()) {
|
||||||
return ResponseEntity.status(HttpStatus.UNPROCESSABLE_ENTITY)
|
return ResponseEntity.status(HttpStatus.UNPROCESSABLE_ENTITY)
|
||||||
.body(bindingResult.getFieldErrors());
|
.body(bindingResult.getFieldErrors());
|
||||||
}
|
}
|
||||||
|
|
||||||
DailyRecordDto dailyRecord = this.vaildGetDailyRecord(searchMonth, groupNo);
|
DailyRecordDto dailyRecord = this.vaildGetDailyRecord(searchMonth, groupNo);
|
||||||
|
|
||||||
formVO.setSearchMonth(dailyRecord.getRecordMonth());
|
formVO.setSearchMonth(dailyRecord.getRecordMonth());
|
||||||
formVO.setGroupNo(dailyRecord.getGroupNo());
|
formVO.setGroupNo(dailyRecord.getGroupNo());
|
||||||
formVO.setDailyRecordSeq(dailyRecord.getId());
|
formVO.setDailyRecordSeq(dailyRecord.getId());
|
||||||
@@ -111,10 +93,10 @@ public class DailyIncomeController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 일계부 수입내역 전체 삭제 처리
|
* 일계부 수입 전체 삭제 처리
|
||||||
*
|
*
|
||||||
* @param searchMonth
|
* @param searchMonth 검색 월(yyyyMM)
|
||||||
* @param groupNo
|
* @param groupNo 검색 그룹
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@PostMapping(path = "/{searchMonth}/{groupNo}/reset")
|
@PostMapping(path = "/{searchMonth}/{groupNo}/reset")
|
||||||
@@ -136,8 +118,8 @@ public class DailyIncomeController {
|
|||||||
/**
|
/**
|
||||||
* 일계부 유효성 체크 및 데이터 조회
|
* 일계부 유효성 체크 및 데이터 조회
|
||||||
*
|
*
|
||||||
* @param searchMonth
|
* @param searchMonth 검색 월(yyyyMM)
|
||||||
* @param groupNo
|
* @param groupNo 검색 그룹
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private DailyRecordDto vaildGetDailyRecord(String searchMonth, String groupNo) {
|
private DailyRecordDto vaildGetDailyRecord(String searchMonth, String groupNo) {
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ public class DailyIncomeUIController {
|
|||||||
private final DailyIncomeService dailyIncomeService;
|
private final DailyIncomeService dailyIncomeService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 일계부 수입내역 목록 화면
|
* 일계부 수입 목록 화면
|
||||||
*
|
*
|
||||||
* @param model Model
|
* @param model Model
|
||||||
* @param searchMonth 검색 월(yyyyMM)
|
* @param searchMonth 검색 월(yyyyMM)
|
||||||
@@ -52,12 +52,12 @@ public class DailyIncomeUIController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 일계부 수입내역 등록 화면
|
* 일계부 수입 등록 화면
|
||||||
*
|
*
|
||||||
* @param model
|
* @param model Model
|
||||||
* @param searchMonth
|
* @param searchMonth 검색 월(yyyyMM)
|
||||||
* @param groupNo
|
* @param groupNo 검색 그룹
|
||||||
* @param id
|
* @param id 수입 일련번호
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@GetMapping(path = "/{searchMonth}/{groupNo}/form/{id}")
|
@GetMapping(path = "/{searchMonth}/{groupNo}/form/{id}")
|
||||||
@@ -93,8 +93,8 @@ public class DailyIncomeUIController {
|
|||||||
/**
|
/**
|
||||||
* 일계부 유효성 체크 및 데이터 조회
|
* 일계부 유효성 체크 및 데이터 조회
|
||||||
*
|
*
|
||||||
* @param searchMonth
|
* @param searchMonth 검색 월(yyyyMM)
|
||||||
* @param groupNo
|
* @param groupNo 검색 그룹
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private DailyRecordDto vaildGetDailyRecord(String searchMonth, String groupNo) {
|
private DailyRecordDto vaildGetDailyRecord(String searchMonth, String groupNo) {
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ import org.springframework.validation.Validator;
|
|||||||
@Component
|
@Component
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class CreateDailyIncomeValidator implements Validator {
|
public class CreateDailyIncomeValidator implements Validator {
|
||||||
private final MessageUtil messageUtil;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supports(Class<?> clazz) {
|
public boolean supports(Class<?> clazz) {
|
||||||
@@ -27,7 +26,7 @@ public class CreateDailyIncomeValidator implements Validator {
|
|||||||
if (StringUtils.isBlank(vo.getCategoryCode())) {
|
if (StringUtils.isBlank(vo.getCategoryCode())) {
|
||||||
errors.rejectValue(
|
errors.rejectValue(
|
||||||
"categoryCode", "valid.common.required",
|
"categoryCode", "valid.common.required",
|
||||||
"수입 종류를 입력해 주세요.");
|
"수입 종류를 선택해 주세요.");
|
||||||
}
|
}
|
||||||
|
|
||||||
if ("SELF".equals(vo.getCategoryCode()) && StringUtils.isBlank(vo.getCategorySelf())) {
|
if ("SELF".equals(vo.getCategoryCode()) && StringUtils.isBlank(vo.getCategorySelf())) {
|
||||||
@@ -44,7 +43,5 @@ public class CreateDailyIncomeValidator implements Validator {
|
|||||||
"estimatedValue", "valid.common.required",
|
"estimatedValue", "valid.common.required",
|
||||||
"현금 또는 현물평가액을 입력 해주세요.");
|
"현금 또는 현물평가액을 입력 해주세요.");
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO : valid
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ public interface DailyRecordMapper {
|
|||||||
DailyRecordDto getDailyRecord(DailyRecordUIReqVO reqVO);
|
DailyRecordDto getDailyRecord(DailyRecordUIReqVO reqVO);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 일계부 등록 여부
|
* 일계부 항목 등록 여부
|
||||||
*
|
*
|
||||||
* @param reqVO
|
* @param reqVO
|
||||||
* @return
|
* @return
|
||||||
@@ -20,14 +20,21 @@ public interface DailyRecordMapper {
|
|||||||
Integer getDailyRecordExistCount(DailyRecordUIReqVO reqVO);
|
Integer getDailyRecordExistCount(DailyRecordUIReqVO reqVO);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 일계부 등록(생성)
|
* 일계부 항목 등록(생성)
|
||||||
*
|
*
|
||||||
* @param command
|
* @param command
|
||||||
*/
|
*/
|
||||||
void createDailyRecord(CreateDailyRecordCmd command);
|
void createDailyRecord(CreateDailyRecordCmd command);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 일계부 상태 수정
|
* 일계부 항목 수정
|
||||||
|
*
|
||||||
|
* @param command
|
||||||
|
*/
|
||||||
|
void updateDailyRecord(CreateDailyRecordCmd command);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 일계부 항목의 상태 수정
|
||||||
*
|
*
|
||||||
* @param command
|
* @param command
|
||||||
* @return
|
* @return
|
||||||
|
|||||||
@@ -66,6 +66,9 @@ public class DailyRecordServiceImpl implements DailyRecordService {
|
|||||||
|
|
||||||
log.debug("[CreateDailyRecord] record={}", command);
|
log.debug("[CreateDailyRecord] record={}", command);
|
||||||
} else {
|
} else {
|
||||||
|
// TODO : NONE 으로 변경시 연관 테이블 데이터 삭제할 것인가?
|
||||||
|
dailyRecordMapper.updateDailyRecord(command);
|
||||||
|
|
||||||
log.warn("[DailyRecordCreate] existCount={}, recordMonth={}, dayGroupNo={}", existCount, reqVO.getRecordMonth(), reqVO.getDayGroupNo());
|
log.warn("[DailyRecordCreate] existCount={}, recordMonth={}, dayGroupNo={}", existCount, reqVO.getRecordMonth(), reqVO.getDayGroupNo());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,9 +13,9 @@ public enum DailyTargetStatus {
|
|||||||
* 등록 없음
|
* 등록 없음
|
||||||
*/
|
*/
|
||||||
NONE,
|
NONE,
|
||||||
/**
|
// /**
|
||||||
* 등록 완료
|
// * 등록 완료
|
||||||
*/
|
// */
|
||||||
DONE,
|
// DONE,
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,71 @@
|
|||||||
|
<?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.expense.persistence.DailyExpenseMapper">
|
||||||
|
|
||||||
|
<select id="getDailyExpenseList"
|
||||||
|
resultType="app.module.front.usecase.daily.expense.persistence.model.DailyExpenseDto">
|
||||||
|
select ds.id, ds.daily_record_seq, ds.input_type, ds.is_credit as credit
|
||||||
|
, ds.category_code, ds.category_self, ds.source_purpose
|
||||||
|
, ds.quantity, ds.unit_code, ds.price, ds.estimated_value
|
||||||
|
from daily_expense ds
|
||||||
|
<include refid="app.module.front.usecase.daily.record.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_expense ds
|
||||||
|
<include refid="app.module.front.usecase.daily.record.persistence.DailyRecordMapper.InnerJoinByDailyRecord"/>
|
||||||
|
where ds.is_deleted = false
|
||||||
|
<if test="id != null and id != '0'">
|
||||||
|
and ds.id = ${id}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="createDailyExpense" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
insert into daily_expense (
|
||||||
|
daily_record_seq, input_type, is_credit, income_mark_code, category_code, category_self, source_purpose
|
||||||
|
, quantity, unit_code, price, estimated_value
|
||||||
|
, is_deleted
|
||||||
|
, <include refid="common.fields.CreateUpdateBaseColumns"/>
|
||||||
|
) values (
|
||||||
|
#{dailyRecordSeq}
|
||||||
|
, #{inputType}, #{credit}, #{incomeMarkCode}, #{categoryCode}, #{categorySelf}, #{sourcePurpose}
|
||||||
|
, #{quantity}, #{unitCode}, #{price}, #{estimatedValue}
|
||||||
|
, false
|
||||||
|
, <include refid="common.fields.CreateUpdateBaseValues"/>
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateDailyExpense">
|
||||||
|
update daily_expense set <include refid="common.fields.UpdateBaseSet"/>
|
||||||
|
, is_credit = #{credit}
|
||||||
|
, income_mark_code = #{incomeMarkCode}
|
||||||
|
, category_code = #{categoryCode}
|
||||||
|
, category_self = #{categorySelf}
|
||||||
|
, source_purpose = #{sourcePurpose}
|
||||||
|
, quantity = #{quantity}
|
||||||
|
, unit_code = #{unitCode}
|
||||||
|
, price = #{price}
|
||||||
|
, estimated_value = #{estimatedValue}
|
||||||
|
where is_deleted = false
|
||||||
|
and daily_record_seq = #{dailyRecordSeq}
|
||||||
|
and id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<update id="removeDailyExpense">
|
||||||
|
update daily_expense 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>
|
||||||
@@ -29,13 +29,13 @@
|
|||||||
|
|
||||||
<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, input_type, is_credit, crop_code, category_code, category_self, source_purpose
|
daily_record_seq, input_type, is_credit, expense_mark_code, crop_code, category_code, category_self, source_purpose
|
||||||
, quantity, unit_code, price, estimated_value
|
, quantity, unit_code, price, estimated_value
|
||||||
, is_deleted
|
, is_deleted
|
||||||
, <include refid="common.fields.CreateUpdateBaseColumns"/>
|
, <include refid="common.fields.CreateUpdateBaseColumns"/>
|
||||||
) values (
|
) values (
|
||||||
#{dailyRecordSeq}
|
#{dailyRecordSeq}
|
||||||
, #{inputType}, #{credit}, #{cropCode}, #{categoryCode}, #{categorySelf}, #{sourcePurpose}
|
, #{inputType}, #{credit}, #{expenseMarkCode}, #{cropCode}, #{categoryCode}, #{categorySelf}, #{sourcePurpose}
|
||||||
, #{quantity}, #{unitCode}, #{price}, #{estimatedValue}
|
, #{quantity}, #{unitCode}, #{price}, #{estimatedValue}
|
||||||
, false
|
, false
|
||||||
, <include refid="common.fields.CreateUpdateBaseValues"/>
|
, <include refid="common.fields.CreateUpdateBaseValues"/>
|
||||||
@@ -45,6 +45,7 @@
|
|||||||
<update id="updateDailyIncome">
|
<update id="updateDailyIncome">
|
||||||
update daily_income set <include refid="common.fields.UpdateBaseSet"/>
|
update daily_income set <include refid="common.fields.UpdateBaseSet"/>
|
||||||
, is_credit = #{credit}
|
, is_credit = #{credit}
|
||||||
|
, expense_mark_code = #{expenseMarkCode}
|
||||||
, crop_code = #{cropCode}
|
, crop_code = #{cropCode}
|
||||||
, category_code = #{categoryCode}
|
, category_code = #{categoryCode}
|
||||||
, category_self = #{categorySelf}
|
, category_self = #{categorySelf}
|
||||||
|
|||||||
@@ -40,6 +40,21 @@
|
|||||||
)
|
)
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateDailyRecord">
|
||||||
|
update daily_record set <include refid="common.fields.UpdateBaseSet"/>
|
||||||
|
, all_status = #{allStatus}
|
||||||
|
, income_status = #{incomeStatus}
|
||||||
|
, work_status = #{workStatus}
|
||||||
|
, expense_status = #{expenseStatus}
|
||||||
|
, power_status = #{powerStatus}
|
||||||
|
, forestry_status = #{forestryStatus}
|
||||||
|
, farming_status = #{farmingStatus}
|
||||||
|
where is_deleted = false
|
||||||
|
and record_month = #{recordMonth}
|
||||||
|
and day_group_no = #{dayGroupNo}
|
||||||
|
and household_seq = #{householdSeq}
|
||||||
|
</update>
|
||||||
|
|
||||||
<update id="updateDailyRecordStatus">
|
<update id="updateDailyRecordStatus">
|
||||||
update daily_record set <include refid="common.fields.UpdateBaseSet"/>
|
update daily_record set <include refid="common.fields.UpdateBaseSet"/>
|
||||||
<if test="allStatus != null and allStatus != ''">
|
<if test="allStatus != null and allStatus != ''">
|
||||||
|
|||||||
@@ -31,8 +31,8 @@ uri.front.record.calendar=\uC784\uAC00\uACBD\uC81C\uC870\uC0AC \uC77C\uACC4\uBD8
|
|||||||
uri.front.record.calendar.{{pathVar}}.{{pathVar}}=\uC77C\uACC4\uBD80 \uC6D4\uBCC4 \uD604\uD669
|
uri.front.record.calendar.{{pathVar}}.{{pathVar}}=\uC77C\uACC4\uBD80 \uC6D4\uBCC4 \uD604\uD669
|
||||||
uri.front.record.daily=\uC77C\uACC4\uBD80 \uB4F1\uB85D
|
uri.front.record.daily=\uC77C\uACC4\uBD80 \uB4F1\uB85D
|
||||||
uri.front.record.daily.{{pathVar}}=\uC77C\uACC4\uBD80 \uB4F1\uB85D
|
uri.front.record.daily.{{pathVar}}=\uC77C\uACC4\uBD80 \uB4F1\uB85D
|
||||||
uri.front.record.income.{{pathVar}}=\uC218\uC785\uB0B4\uC5ED \uB4F1\uB85D
|
uri.front.record.income.{{pathVar}}=\uC77C\uACC4\uBD80 \uB4F1\uB85D
|
||||||
uri.front.record.expense.{{pathVar}}=\uC9C0\uCD9C\uB0B4\uC5ED \uB4F1\uB85D
|
uri.front.record.expense.{{pathVar}}=\uC77C\uACC4\uBD80 \uB4F1\uB85D
|
||||||
uri.front.record.work.{{pathVar}}=\uB178\uB3D9\uC2DC\uAC04 \uB4F1\uB85D
|
uri.front.record.work.{{pathVar}}=\uC77C\uACC4\uBD80 \uB4F1\uB85D
|
||||||
uri.front.record.power.{{pathVar}}=\uB3D9\uB825 \uC0AC\uC6A9\uC2DC\uAC04 \uB4F1\uB85D
|
uri.front.record.power.{{pathVar}}=\uC77C\uACC4\uBD80 \uB4F1\uB85D
|
||||||
uri.front.record.forestry.{{pathVar}}=\uC790\uAC00\uC784\uC5C5 \uC0DD\uC0B0\uBB3C \uC911 \uC790\uAC00\uC18C\uBE44\uB7C9 \uB4F1\uB85D
|
uri.front.record.forestry.{{pathVar}}=\uC77C\uACC4\uBD80 \uB4F1\uB85D
|
||||||
|
|||||||
@@ -25,14 +25,18 @@ krip.daily.goToPrev = function(target, searchMonth, groupNo) {
|
|||||||
console.log(url);
|
console.log(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
krip.daily.goToPrev = function() {
|
||||||
|
// TODO : history.back 으로 해결 되는가?
|
||||||
|
history.back();
|
||||||
|
}
|
||||||
|
|
||||||
krip.daily.goToNext = function(target, searchMonth, groupNo) {
|
krip.daily.goToNext = function(target, searchMonth, groupNo) {
|
||||||
let url = krip.daily.httpUrl.target;
|
let url = krip.daily.httpUrl.target;
|
||||||
url = url.replace('{month}', searchMonth);
|
url = url.replace('{month}', searchMonth);
|
||||||
url = url.replace('{groupNo}', groupNo);
|
url = url.replace('{groupNo}', groupNo);
|
||||||
url = url.replace('{target}', target);
|
url = url.replace('{target}', target);
|
||||||
|
|
||||||
console.log(url);
|
location.href = url;
|
||||||
//location.href = url;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -52,6 +56,8 @@ krip.daily.todayNone = function(month, groupNo, target, checked) {
|
|||||||
{},
|
{},
|
||||||
function (rstData, status) {
|
function (rstData, status) {
|
||||||
console.log('rstData', rstData)
|
console.log('rstData', rstData)
|
||||||
|
|
||||||
|
$('.component-btns').find('.btn-primary').attr('disabled', !checked);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
@@ -32,7 +32,9 @@
|
|||||||
<div class="component-input">
|
<div class="component-input">
|
||||||
<label class="switch-inner type-txt">
|
<label class="switch-inner type-txt">
|
||||||
<span class="switch-label">수입</span>
|
<span class="switch-label">수입</span>
|
||||||
<input type="checkbox" name="incomeStatus" value="WAITING" data-target="income">
|
<!-- TODO : DONE 유지여부 판단하기 -->
|
||||||
|
<input type="checkbox" name="incomeStatus" value="TARGET" data-target="income"
|
||||||
|
th:checked="${#strings.equals(dailyRecord.incomeStatus, 'TARGET') or #strings.equals(dailyRecord.incomeStatus, 'DONE')}">
|
||||||
<span class="switch-item">
|
<span class="switch-item">
|
||||||
<span class="switch-handle"></span>
|
<span class="switch-handle"></span>
|
||||||
</span>
|
</span>
|
||||||
@@ -41,7 +43,8 @@
|
|||||||
<div class="component-input">
|
<div class="component-input">
|
||||||
<label class="switch-inner type-txt">
|
<label class="switch-inner type-txt">
|
||||||
<span class="switch-label">임업노동 투입 내역</span>
|
<span class="switch-label">임업노동 투입 내역</span>
|
||||||
<input type="checkbox" name="workStatus" value="WAITING" data-target="work">
|
<input type="checkbox" name="workStatus" value="TARGET" data-target="work"
|
||||||
|
th:checked="${#strings.equals(dailyRecord.workStatus, 'TARGET') or #strings.equals(dailyRecord.workStatus, 'DONE')}">
|
||||||
<span class="switch-item">
|
<span class="switch-item">
|
||||||
<span class="switch-handle"></span>
|
<span class="switch-handle"></span>
|
||||||
</span>
|
</span>
|
||||||
@@ -50,7 +53,8 @@
|
|||||||
<div class="component-input">
|
<div class="component-input">
|
||||||
<label class="switch-inner type-txt">
|
<label class="switch-inner type-txt">
|
||||||
<span class="switch-label">지출</span>
|
<span class="switch-label">지출</span>
|
||||||
<input type="checkbox" name="expenseStatus" value="WAITING" data-target="expense">
|
<input type="checkbox" name="expenseStatus" value="TARGET" data-target="expense"
|
||||||
|
th:checked="${#strings.equals(dailyRecord.expenseStatus, 'TARGET') or #strings.equals(dailyRecord.expenseStatus, 'DONE')}">
|
||||||
<span class="switch-item">
|
<span class="switch-item">
|
||||||
<span class="switch-handle"></span>
|
<span class="switch-handle"></span>
|
||||||
</span>
|
</span>
|
||||||
@@ -59,7 +63,8 @@
|
|||||||
<div class="component-input">
|
<div class="component-input">
|
||||||
<label class="switch-inner type-txt">
|
<label class="switch-inner type-txt">
|
||||||
<span class="switch-label">동력 사용시간</span>
|
<span class="switch-label">동력 사용시간</span>
|
||||||
<input type="checkbox" name="powerStatus" value="WAITING" data-target="power">
|
<input type="checkbox" name="powerStatus" value="TARGET" data-target="power"
|
||||||
|
th:checked="${#strings.equals(dailyRecord.powerStatus, 'TARGET') or #strings.equals(dailyRecord.powerStatus, 'DONE')}">
|
||||||
<span class="switch-item">
|
<span class="switch-item">
|
||||||
<span class="switch-handle"></span>
|
<span class="switch-handle"></span>
|
||||||
</span>
|
</span>
|
||||||
@@ -68,17 +73,21 @@
|
|||||||
<div class="component-input">
|
<div class="component-input">
|
||||||
<label class="switch-inner type-txt">
|
<label class="switch-inner type-txt">
|
||||||
<span class="switch-label">자가임업 생산물 중 자가소비량</span>
|
<span class="switch-label">자가임업 생산물 중 자가소비량</span>
|
||||||
<input type="checkbox" name="forestryStatus" value="WAITING" data-target="forestry">
|
<input type="checkbox" name="forestryStatus" value="TARGET" data-target="forestry"
|
||||||
|
th:checked="${#strings.equals(dailyRecord.forestryStatus, 'TARGET') or #strings.equals(dailyRecord.forestryStatus, 'DONE')}">
|
||||||
<span class="switch-item">
|
<span class="switch-item">
|
||||||
<span class="switch-handle"></span>
|
<span class="switch-handle"></span>
|
||||||
</span>
|
</span>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<!-- TODO : 자가농업 생산물 중 자가소비량은 7일차 등록일에만 노출 및 선택 -->
|
<!--/* [정책] 자가농업 생산물 중 자가소비량은 7일차 등록일에만 노출 및 선택, 21일 이후는 마지막 날 */-->
|
||||||
<div class="component-input">
|
<div class="component-input"
|
||||||
|
th:if="${reqVO.groupNo eq 4 or reqVO.groupNo eq 8 or reqVO.groupNo eq 12
|
||||||
|
or reqVO.groupNo eq 16 or reqVO.groupNo eq 17}">
|
||||||
<label class="switch-inner type-txt">
|
<label class="switch-inner type-txt">
|
||||||
<span class="switch-label">자가농업 생산물 중 자가소비량</span>
|
<span class="switch-label">자가농업 생산물 중 자가소비량</span>
|
||||||
<input type="checkbox" name="farmingStatus" value="WAITING" data-target="farming">
|
<input type="checkbox" name="farmingStatus" value="TARGET" data-target="farming"
|
||||||
|
th:checked="${#strings.equals(dailyRecord.farmingStatus, 'TARGET') or #strings.equals(dailyRecord.farmingStatus, 'DONE')}">
|
||||||
<span class="switch-item">
|
<span class="switch-item">
|
||||||
<span class="switch-handle"></span>
|
<span class="switch-handle"></span>
|
||||||
</span>
|
</span>
|
||||||
@@ -90,7 +99,7 @@
|
|||||||
</main>
|
</main>
|
||||||
|
|
||||||
<div class="component-btns fixed">
|
<div class="component-btns fixed">
|
||||||
<div class="btns-row" th:if="${!dailyRecord.updated}">
|
<div class="btns-row">
|
||||||
<button type="button" class="btn btn-l btn-primary" th:onclick="formControl.createValid([[${reqVO.searchMonth}]], [[${reqVO.groupNo}]])">
|
<button type="button" class="btn btn-l btn-primary" th:onclick="formControl.createValid([[${reqVO.searchMonth}]], [[${reqVO.groupNo}]])">
|
||||||
<span class="btn-txt">다음 단계로 이동</span>
|
<span class="btn-txt">다음 단계로 이동</span>
|
||||||
</button>
|
</button>
|
||||||
@@ -104,7 +113,7 @@
|
|||||||
<script th:inline="javascript">
|
<script th:inline="javascript">
|
||||||
let ENV = {
|
let ENV = {
|
||||||
httpUrl: {
|
httpUrl: {
|
||||||
root: /*[[|/record/daily/${reqVO.searchMonth}/${reqVO.groupNo}|]]*/'rootUrl',
|
create: /*[[|/api/record/daily/${reqVO.searchMonth}/${reqVO.groupNo}|]]*/'createUrl',
|
||||||
},
|
},
|
||||||
month: [[${reqVO.searchMonth}]],
|
month: [[${reqVO.searchMonth}]],
|
||||||
groupNo: [[${reqVO.groupNo}]],
|
groupNo: [[${reqVO.groupNo}]],
|
||||||
@@ -156,9 +165,9 @@
|
|||||||
|
|
||||||
const obj = $(f).serializeObject();
|
const obj = $(f).serializeObject();
|
||||||
ajaxUtil._ajaxAsync(
|
ajaxUtil._ajaxAsync(
|
||||||
ENV.httpUrl.root,
|
ENV.httpUrl.create,
|
||||||
obj,
|
obj,
|
||||||
function (rstData, status) {
|
function () {
|
||||||
if (f.todayNone.value === 'Y') {
|
if (f.todayNone.value === 'Y') {
|
||||||
krip.daily.goToMain();
|
krip.daily.goToMain();
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
205
front/src/main/resources/templates/record/expense/form.html
Normal file
205
front/src/main/resources/templates/record/expense/form.html
Normal file
@@ -0,0 +1,205 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
|
||||||
|
xmlns:th="http://www.thymeleaf.org" lang="ko">
|
||||||
|
|
||||||
|
<th:block>
|
||||||
|
<th:block th:if="${@systemProperties['spring.profiles.active'] eq 'local'}">
|
||||||
|
<div>
|
||||||
|
reqVO: [[${reqVO}]]
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
detail: [[${dailyRecord}]]
|
||||||
|
</div>
|
||||||
|
</th:block>
|
||||||
|
<div class="modal-content-inner">
|
||||||
|
<div class="component-btns type-tab"
|
||||||
|
th:if="${not detail.updated}">
|
||||||
|
<div class="btns-row">
|
||||||
|
<button type="button" class="btn active">수기 등록</button>
|
||||||
|
<!--/* TODO : 2차 오픈 */-->
|
||||||
|
<!--<button type="button" class="btn">영수증 등록</button>-->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p class="form-desc">필지출력</p>
|
||||||
|
<form name="reqModalForm">
|
||||||
|
<input type="hidden" name="inputType" th:value="${#strings.defaultString(detail.inputType, 'SELF')}">
|
||||||
|
<input type="hidden" name="id" th:value="${detail.id}">
|
||||||
|
<section class="form-group">
|
||||||
|
<div class="segment-label">
|
||||||
|
<p class="label-txt">
|
||||||
|
외상 또는 카드 구입 여부
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div class="component-segment">
|
||||||
|
<div class="component-radio">
|
||||||
|
<label class="radio-inner">
|
||||||
|
<input type="radio" name="credit" value="true" th:checked="${detail.credit}">
|
||||||
|
<span class="radio-item">
|
||||||
|
<span class="radio-txt">예</span>
|
||||||
|
</span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div class="component-radio">
|
||||||
|
<label class="radio-inner">
|
||||||
|
<input type="radio" name="credit" value="false" th:checked="not ${detail.credit}">
|
||||||
|
<span class="radio-item">
|
||||||
|
<span class="radio-txt">아니오</span>
|
||||||
|
</span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
<section class="form-group">
|
||||||
|
<div class="select-group">
|
||||||
|
<div class="select-label">
|
||||||
|
<p class="label-txt">
|
||||||
|
지출의 종류
|
||||||
|
<i class="ico-required-mark" role="img" aria-label="필수">*</i>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div id="categoryCode" class="component-select bottom-sheet" data-props-default="지출 종류를 선택해 주세요" data-props-type="bottomSheet">
|
||||||
|
<input type="hidden1" name="categoryCode" th:value="${detail.categoryCode}" data-type="select">
|
||||||
|
<button type="button" class="select-box">
|
||||||
|
<span class="select-txt"></span>
|
||||||
|
</button>
|
||||||
|
<div class="select-options">
|
||||||
|
<div class="select-header">
|
||||||
|
<p>지출의 종류</p>
|
||||||
|
<button type="button" class="select-close">
|
||||||
|
<span class="hide-txt">닫기</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div class="select-scroll">
|
||||||
|
<ul class="">
|
||||||
|
<li class="option"
|
||||||
|
th:each="uiCode : ${recordExpense}"
|
||||||
|
th:data-value="${uiCode.codeValue}"
|
||||||
|
th:text="${uiCode.codeText}"></li>
|
||||||
|
<li class="option" data-value="SELF">직접 입력</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="component-input input-invalid" data-option="직접 입력">
|
||||||
|
<div class="input-field">
|
||||||
|
<input type="text" id="categorySelf" name="categorySelf" th:value="${detail.categorySelf}" maxlength="30" placeholder="지출의 종류를 입력해 주세요">
|
||||||
|
</div>
|
||||||
|
<ul class="input-info">
|
||||||
|
<li>지출 종류를 입력해 주세요.</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="component-input">
|
||||||
|
<div class="input-label">
|
||||||
|
<label for="sourcePurpose" class="label-txt">
|
||||||
|
용도
|
||||||
|
<i class="ico-required-mark" role="img" aria-label="필수">*</i>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div class="input-field">
|
||||||
|
<input type="text" id="sourcePurpose" name="sourcePurpose" th:value="${detail.sourcePurpose}" maxlength="30" placeholder="용도를 입력해 주세요">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
<section class="form-group">
|
||||||
|
<div class="component-input">
|
||||||
|
<div class="input-label">
|
||||||
|
<label for="quantity" class="label-txt">
|
||||||
|
수량
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div class="input-field">
|
||||||
|
<input type="number" inputmode="numeric" pattern="[0-9]*" id="quantity" name="quantity" th:value="${detail.quantity}" maxlength="10" placeholder="수량을 입력해 주세요">
|
||||||
|
</div>
|
||||||
|
<ul class="guide-info">
|
||||||
|
<li>예 : 2, 2.5</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="select-group">
|
||||||
|
<div class="select-label">
|
||||||
|
<p class="label-txt">
|
||||||
|
단위
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div id="unitCode" class="component-select bottom-sheet" data-props-default="단위를 선택해 주세요" data-props-type="bottomSheet">
|
||||||
|
<input type="hidden1" name="unitCode" th:value="${detail.unitCode}">
|
||||||
|
<button type="button" class="select-box">
|
||||||
|
<span class="select-txt"></span>
|
||||||
|
</button>
|
||||||
|
<div class="select-options">
|
||||||
|
<div class="select-header">
|
||||||
|
<p>단위</p>
|
||||||
|
<button type="button" class="select-close">
|
||||||
|
<span class="hide-txt">닫기</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div class="select-scroll">
|
||||||
|
<ul class="">
|
||||||
|
<li class="option" th:each="uiCode : ${recordUnit}"
|
||||||
|
th:data-value="${uiCode.codeValue}"
|
||||||
|
th:text="${uiCode.codeText}"
|
||||||
|
th:selected="${uiCode.codeValue eq detail.unitCode ? 'current' : ''}"
|
||||||
|
></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
<section class="form-group">
|
||||||
|
<div class="component-input">
|
||||||
|
<div class="input-label">
|
||||||
|
<label for="price" class="label-txt">
|
||||||
|
현금
|
||||||
|
<i class="ico-required-mark" role="img" aria-label="필수">*</i>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div class="input-field type-price">
|
||||||
|
<input type="number" inputmode="numeric" pattern="[0-9]*" id="price" name="price" th:value="${detail.price}" maxlength="10" placeholder="금액을 입력해 주세요">
|
||||||
|
<span class="input-field-txt">원</span>
|
||||||
|
</div>
|
||||||
|
<ul class="guide-info">
|
||||||
|
<li>예 : 30000</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="component-input">
|
||||||
|
<div class="input-label">
|
||||||
|
<label for="estimatedValue" class="label-txt">
|
||||||
|
현물평가액
|
||||||
|
<i class="ico-required-mark" role="img" aria-label="필수">*</i>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div class="input-field type-price">
|
||||||
|
<input type="number" inputmode="numeric" pattern="[0-9]*" id="estimatedValue" name="estimatedValue" th:value="${detail.estimatedValue}" maxlength="10" placeholder="금액을 입력해 주세요">
|
||||||
|
<span class="input-field-txt">원</span>
|
||||||
|
</div>
|
||||||
|
<ul class="guide-info">
|
||||||
|
<li>예 : 30000</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<div class="component-btns">
|
||||||
|
<div class="btns-row">
|
||||||
|
<button type="button" class="btn btn-full btn-l btn-primary" onclick="formControl.createVaild();">
|
||||||
|
<span class="btn-txt">등록</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</th:block>
|
||||||
|
|
||||||
|
</html>
|
||||||
368
front/src/main/resources/templates/record/expense/index.html
Normal file
368
front/src/main/resources/templates/record/expense/index.html
Normal file
@@ -0,0 +1,368 @@
|
|||||||
|
<!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>
|
||||||
|
dailyRecord: [[${dailyRecord}]]
|
||||||
|
</div>
|
||||||
|
</th:block>
|
||||||
|
<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(expenseList) ? 0 : #lists.size(expenseList)}]]건 등록</strong> <br>
|
||||||
|
되었습니다.
|
||||||
|
</h3>
|
||||||
|
<p>지출 내역을 등록해 주세요.</p>
|
||||||
|
</hgroup>
|
||||||
|
|
||||||
|
<form name="reqForm">
|
||||||
|
<input type="hidden" name="todayNone" value="N">
|
||||||
|
</form>
|
||||||
|
<!--/* 신규 등록 */-->
|
||||||
|
<th:block th:if="${#lists.isEmpty(expenseList)}">
|
||||||
|
<button type="button" class="btn btn-m btn-secondary btn-full button-modal01" data-testid="button-modal01"
|
||||||
|
th:disabled="${#strings.equals(dailyRecord.expenseStatus, 'TODAY_NONE')}">
|
||||||
|
<i class=" ico-small" aria-hidden="true"
|
||||||
|
th:classappend="${#strings.equals(dailyRecord.expenseStatus, '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"
|
||||||
|
th:checked="${#strings.equals(dailyRecord.expenseStatus, 'TODAY_NONE')}">
|
||||||
|
<span class="checkbox-item">
|
||||||
|
<span class="checkbox-txt">금일 등록내용 없음</span>
|
||||||
|
</span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</th:block>
|
||||||
|
<!--/* 목록 */-->
|
||||||
|
<th:block th:unless="${#lists.isEmpty(expenseList)}">
|
||||||
|
<section class="regist-item-area">
|
||||||
|
<p class="total">
|
||||||
|
<span>총 <strong>[[${#lists.size(expenseList)}]]</strong>건</span>
|
||||||
|
<button type="button" class="btn-reset" onclick="formControl.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 : ${expenseList}">
|
||||||
|
<div class="item-tit-group">
|
||||||
|
<p class="item-name">[[${item.categoryLabel}]] [[${item.categorySelf}]]</p>
|
||||||
|
<div class="btn-group">
|
||||||
|
<button type="button" class="delete" th:onclick="formControl.removeConfirm([[${item.id}]])"><span class="hide-txt">삭제</span></button>
|
||||||
|
<button type="button" class="edit" th:onclick="formControl.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.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">
|
||||||
|
<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.expenseStatus, 'TODAY_NONE') and #lists.isEmpty(expenseList)}">
|
||||||
|
<span class="btn-txt">다음 단계로 이동</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 모달 팝업 -->
|
||||||
|
<div class="layer-wrap">
|
||||||
|
<div class="component-modal acco-wrap modal01" 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>
|
||||||
|
<!-- //모달 팝업 -->
|
||||||
|
</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/daily/${reqVO.searchMonth}/${reqVO.groupNo}|]]*/'rootUrl',
|
||||||
|
form: /*[[|/record/expense/${reqVO.searchMonth}/${reqVO.groupNo}/form/{id}|]]*/'formUrl',
|
||||||
|
create: /*[[|/api/record/expense/${reqVO.searchMonth}/${reqVO.groupNo}/form/{id}|]]*/'createUrl',
|
||||||
|
remove: /*[[|/api/record/expense/${reqVO.searchMonth}/${reqVO.groupNo}/remove|]]*/'removeUrl',
|
||||||
|
reset: /*[[|/api/record/expense/${reqVO.searchMonth}/${reqVO.groupNo}/reset|]]*/'resetUrl',
|
||||||
|
},
|
||||||
|
month: [[${reqVO.searchMonth}]],
|
||||||
|
groupNo: [[${reqVO.groupNo}]],
|
||||||
|
submitted: false,
|
||||||
|
};
|
||||||
|
|
||||||
|
let bind = {
|
||||||
|
form: {
|
||||||
|
selectorId: '.button-modal01',
|
||||||
|
selector: '.modal01',
|
||||||
|
},
|
||||||
|
selectbox: null,
|
||||||
|
}
|
||||||
|
|
||||||
|
let formControl = {
|
||||||
|
init() {
|
||||||
|
formControl._bindUI();
|
||||||
|
//formControl.createModal();
|
||||||
|
|
||||||
|
// TODO 등록된 건수가 0일 경우 버튼 비활성화
|
||||||
|
|
||||||
|
},
|
||||||
|
_bindUI() {
|
||||||
|
etUI.locales.ko = {
|
||||||
|
dialog: {
|
||||||
|
positive: '예',
|
||||||
|
negative: '아니오',
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
let $noneWrap = $('#todayNone');
|
||||||
|
$noneWrap.on('click', 'input[name="todayNone"]', function() {
|
||||||
|
let checked = $(this).is(':checked');
|
||||||
|
let $btn = $('.button-modal01');
|
||||||
|
$btn.attr('disabled', checked);
|
||||||
|
if (checked) {
|
||||||
|
$btn.find('i').addClass('ico-add-disabled');
|
||||||
|
$btn.find('i').removeClass('ico-add');
|
||||||
|
document.reqForm.todayNone.value = 'Y';
|
||||||
|
} else {
|
||||||
|
$btn.find('i').addClass('ico-add');
|
||||||
|
$btn.find('i').removeClass('ico-add-disabled');
|
||||||
|
document.reqForm.todayNone.value = 'N';
|
||||||
|
}
|
||||||
|
|
||||||
|
krip.daily.todayNone(ENV.month, ENV.groupNo, 'EXPENSE', checked);
|
||||||
|
});
|
||||||
|
|
||||||
|
let $formWrap = $(bind.form.selectorId);
|
||||||
|
$formWrap.on('click', function() {
|
||||||
|
formControl.createModal();
|
||||||
|
});
|
||||||
|
|
||||||
|
// const $btnModal01 = document.querySelector(".button-modal01");
|
||||||
|
// $btnModal01.addEventListener("click", function() {
|
||||||
|
// const modal01 = document.querySelector(".modal01").ui;
|
||||||
|
// modal01.open();
|
||||||
|
// });
|
||||||
|
},
|
||||||
|
_bindModelUI() {
|
||||||
|
let $formWrap = $(bind.form.selector).find('form');
|
||||||
|
$formWrap.on('keyup', 'input[name="price"]', function() {
|
||||||
|
// TODO : UI disabled
|
||||||
|
if ($(this).val() === '') {
|
||||||
|
$formWrap.find('input[name="estimatedValue"]').attr('disabled', false);
|
||||||
|
} else {
|
||||||
|
$formWrap.find('input[name="estimatedValue"]').val('').attr('disabled', true);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$formWrap.on('keyup', 'input[name="estimatedValue"]', function() {
|
||||||
|
// TODO : UI disabled
|
||||||
|
if ($(this).val() === '') {
|
||||||
|
$formWrap.find('input[name="price"]').attr('disabled', false);
|
||||||
|
} else {
|
||||||
|
$formWrap.find('input[name="price"]').val('').attr('disabled', true);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
createModal(id) {
|
||||||
|
if (id === undefined) {
|
||||||
|
id = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
ajaxUtil._ajaxAsyncMethod(
|
||||||
|
ENV.httpUrl.form.replace('{id}', id),
|
||||||
|
{},
|
||||||
|
function(rstHtml, status) {
|
||||||
|
$('.modal01').find('.modal-content').html(rstHtml);
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
etUI.components.SelectBox().core.init(document.querySelector('#categoryCode'));
|
||||||
|
etUI.components.SelectBox().core.init(document.querySelector('#unitCode'));
|
||||||
|
|
||||||
|
/*
|
||||||
|
etUI.components.SelectBox().core.init(document.querySelector('#categoryCode'), {
|
||||||
|
onChange: function() {
|
||||||
|
console.log('sssssssssss')
|
||||||
|
},
|
||||||
|
selectItemCallback: function() {
|
||||||
|
// TODO : console.log ?
|
||||||
|
console.log(1111)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
etUI.components.SelectBox().core.init(document.querySelector('#unitCode'), {
|
||||||
|
onChange: function() {
|
||||||
|
console.log('sssssssssss')
|
||||||
|
},
|
||||||
|
selectItemCallback: function() {
|
||||||
|
console.log(3333)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*document.querySelector('#selectUnit').addEventListener('select:onChange', (e) => {
|
||||||
|
console.log(e.detail);
|
||||||
|
console.log(e.detail.value);
|
||||||
|
});
|
||||||
|
|
||||||
|
const selectbox2 = document.querySelector('.component-select');
|
||||||
|
selectbox2.addEventListener('select:onChange', (e) => {
|
||||||
|
console.log(e.detail);
|
||||||
|
console.log(e.detail.value);
|
||||||
|
});
|
||||||
|
*/
|
||||||
|
|
||||||
|
//document.queerySelector('#unitSelect')
|
||||||
|
|
||||||
|
const modal01 = document.querySelector(".modal01").ui;
|
||||||
|
modal01.open();
|
||||||
|
formControl._bindModelUI();
|
||||||
|
},
|
||||||
|
function(code, rstData) {
|
||||||
|
kri.logger.error('Do nothing. code: '+ code, rstData);
|
||||||
|
},
|
||||||
|
'get',
|
||||||
|
'html'
|
||||||
|
);
|
||||||
|
},
|
||||||
|
createVaild() {
|
||||||
|
const f = document.reqModalForm;
|
||||||
|
|
||||||
|
// TODO : setter
|
||||||
|
f.categoryCode.value = document.querySelector('#categoryCode').value !== undefined ? document.querySelector('#categoryCode').value : '';
|
||||||
|
f.unitCode.value = document.querySelector('#unitCode').value !== undefined ? document.querySelector('#unitCode').value : '';
|
||||||
|
|
||||||
|
formControl.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) {
|
||||||
|
console.log('rstData', rstData)
|
||||||
|
location.reload();
|
||||||
|
/*
|
||||||
|
if (f.todayNone.value === 'Y') {
|
||||||
|
krip.daily.goToMain();
|
||||||
|
} else {
|
||||||
|
krip.daily.goToNext($('input:checked').eq(0).data('target'), ENV.month, ENV.groupNo);
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
|
removeConfirm(id) {
|
||||||
|
etUI.dialog.alert({
|
||||||
|
title: "삭제 안내",
|
||||||
|
message: "등록하신 내용을 삭제하시겠어요?<br>삭제된 내용은 복구할 수 없습니다.",
|
||||||
|
type: "confirm",
|
||||||
|
dialogType: "confirm",
|
||||||
|
callback: function () {
|
||||||
|
formControl.remove(id);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
remove(id) {
|
||||||
|
console.log('remove', id)
|
||||||
|
ajaxUtil._ajaxAsync(
|
||||||
|
ENV.httpUrl.remove,
|
||||||
|
{ 'id': id },
|
||||||
|
function (rstData, status) {
|
||||||
|
location.reload();
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
|
resetConfirm() {
|
||||||
|
etUI.dialog.alert({
|
||||||
|
title: "초기화 안내",
|
||||||
|
message: "등록하신 모든 내용을 삭제하시겠어요?<br>삭제된 내용은 복구할 수 없습니다.",
|
||||||
|
type: "confirm",
|
||||||
|
dialogType: "confirm",
|
||||||
|
callback: function () {
|
||||||
|
formControl.reset();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
reset() {
|
||||||
|
ajaxUtil._ajaxAsync(
|
||||||
|
ENV.httpUrl.reset,
|
||||||
|
{},
|
||||||
|
function (rstData, status) {
|
||||||
|
location.reload();
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
</html>
|
||||||
@@ -114,13 +114,13 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="component-input " data-option="직접 입력"><!-- input-invalid -->
|
<div class="component-input input-invalid" data-option="직접 입력">
|
||||||
<div class="input-field">
|
<div class="input-field">
|
||||||
<input type="text" id="categorySelf" name="categorySelf" th:value="${detail.categorySelf}" placeholder="수입의 종류를 입력해 주세요">
|
<input type="text" id="categorySelf" name="categorySelf" th:value="${detail.categorySelf}" maxlength="30" placeholder="수입의 종류를 입력해 주세요">
|
||||||
</div>
|
</div>
|
||||||
<!--<ul class="input-info">
|
<ul class="input-info">
|
||||||
<li>수입 종류를 입력해 주세요.</li>
|
<li>수입 종류를 입력해 주세요.</li>
|
||||||
</ul>-->
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="component-input">
|
<div class="component-input">
|
||||||
@@ -131,7 +131,7 @@
|
|||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="input-field">
|
<div class="input-field">
|
||||||
<input type="text" id="sourcePurpose" name="sourcePurpose" th:value="${detail.sourcePurpose}" maxlength="50" placeholder="수입원을 입력해 주세요">
|
<input type="text" id="sourcePurpose" name="sourcePurpose" th:value="${detail.sourcePurpose}" maxlength="30" placeholder="수입원을 입력해 주세요">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|||||||
@@ -32,14 +32,16 @@
|
|||||||
</form>
|
</form>
|
||||||
<!--/* 신규 등록 */-->
|
<!--/* 신규 등록 */-->
|
||||||
<th:block th:if="${#lists.isEmpty(incomeList)}">
|
<th:block th:if="${#lists.isEmpty(incomeList)}">
|
||||||
<button type="button" class="btn btn-m btn-secondary btn-full button-modal01" data-testid="button-modal01">
|
<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>
|
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>
|
<span class="btn-txt">추가 등록</span>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<div class="component-input align-center">
|
<div class="component-input align-center">
|
||||||
<label class="checkbox-inner" id="todayNone">
|
<label class="checkbox-inner" id="todayNone">
|
||||||
<input type="checkbox" name="todayNone">
|
<input type="checkbox" name="todayNone"
|
||||||
|
th:checked="${#strings.equals(dailyRecord.incomeStatus, 'TODAY_NONE')}">
|
||||||
<span class="checkbox-item">
|
<span class="checkbox-item">
|
||||||
<span class="checkbox-txt">금일 등록내용 없음</span>
|
<span class="checkbox-txt">금일 등록내용 없음</span>
|
||||||
</span>
|
</span>
|
||||||
@@ -81,7 +83,7 @@
|
|||||||
</li>
|
</li>
|
||||||
<li th:if="${not #strings.isEmpty(item.quantity)}">
|
<li th:if="${not #strings.isEmpty(item.quantity)}">
|
||||||
<p>수량</p>
|
<p>수량</p>
|
||||||
<span th:text="|${item.quantity}${item.unitLabel}|">500g</span>
|
<span th:text="|${item.quantity}${#strings.defaultString(item.unitLabel,'')}|">500g</span>
|
||||||
</li>
|
</li>
|
||||||
<li th:if="${not #strings.isEmpty(item.price)}">
|
<li th:if="${not #strings.isEmpty(item.price)}">
|
||||||
<p>현금 </p>
|
<p>현금 </p>
|
||||||
@@ -106,11 +108,11 @@
|
|||||||
<!-- 하단 고정 버튼 -->
|
<!-- 하단 고정 버튼 -->
|
||||||
<div class="component-btns fixed">
|
<div class="component-btns fixed">
|
||||||
<div class="btns-row">
|
<div class="btns-row">
|
||||||
<button type="button" class="btn btn-l btn-secondary">
|
<button type="button" class="btn btn-l btn-secondary" onclick="krip.daily.goToPrev();">
|
||||||
<span class="btn-txt">이전 단계로 이동</span>
|
<span class="btn-txt">이전 단계로 이동</span>
|
||||||
</button>
|
</button>
|
||||||
<!-- 비활성화 스타일/ 버튼 속성 disable 추가-->
|
<button type="button" class="btn btn-l btn-primary"
|
||||||
<button type="button" class="btn btn-l btn-primary">
|
th:disabled="${not #strings.equals(dailyRecord.incomeStatus, 'TODAY_NONE') and #lists.isEmpty(incomeList)}">
|
||||||
<span class="btn-txt">다음 단계로 이동</span>
|
<span class="btn-txt">다음 단계로 이동</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -145,11 +147,11 @@
|
|||||||
|
|
||||||
let ENV = {
|
let ENV = {
|
||||||
httpUrl: {
|
httpUrl: {
|
||||||
root: /*[[|/record/daily/${reqVO.searchMonth}/${reqVO.groupNo}|]]*/'rootUrl',
|
root: /*[[|/record/daily/${reqVO.searchMonth}/${reqVO.groupNo}|]]*/'rootUrl',
|
||||||
form: /*[[|/record/income/${reqVO.searchMonth}/${reqVO.groupNo}/form/{id}|]]*/'formUrl',
|
form: /*[[|/record/income/${reqVO.searchMonth}/${reqVO.groupNo}/form/{id}|]]*/'formUrl',
|
||||||
create: /*[[|/api/record/income/${reqVO.searchMonth}/${reqVO.groupNo}/form/{id}|]]*/'createUrl',
|
create: /*[[|/api/record/income/${reqVO.searchMonth}/${reqVO.groupNo}/form/{id}|]]*/'createUrl',
|
||||||
remove: /*[[|/api/record/income/${reqVO.searchMonth}/${reqVO.groupNo}/remove|]]*/'removeUrl',
|
remove: /*[[|/api/record/income/${reqVO.searchMonth}/${reqVO.groupNo}/remove|]]*/'removeUrl',
|
||||||
reset: /*[[|/api/record/income/${reqVO.searchMonth}/${reqVO.groupNo}/reset|]]*/'resetUrl',
|
reset: /*[[|/api/record/income/${reqVO.searchMonth}/${reqVO.groupNo}/reset|]]*/'resetUrl',
|
||||||
},
|
},
|
||||||
month: [[${reqVO.searchMonth}]],
|
month: [[${reqVO.searchMonth}]],
|
||||||
groupNo: [[${reqVO.groupNo}]],
|
groupNo: [[${reqVO.groupNo}]],
|
||||||
@@ -159,10 +161,7 @@
|
|||||||
let bind = {
|
let bind = {
|
||||||
form: {
|
form: {
|
||||||
selectorId: '.button-modal01',
|
selectorId: '.button-modal01',
|
||||||
selector: null,
|
selector: '.modal01',
|
||||||
// scheduleMSeq: null,
|
|
||||||
// scheduleDSeq: null,
|
|
||||||
// reserveSeq: null,
|
|
||||||
},
|
},
|
||||||
selectbox: null,
|
selectbox: null,
|
||||||
}
|
}
|
||||||
@@ -181,7 +180,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
let $noneWrap = $('#todayNone');
|
let $noneWrap = $('#todayNone');
|
||||||
$noneWrap.on('click', 'input[name="todayNone"]', function() {
|
$noneWrap.on('click', 'input[name="todayNone"]', function () {
|
||||||
let checked = $(this).is(':checked');
|
let checked = $(this).is(':checked');
|
||||||
let $btn = $('.button-modal01');
|
let $btn = $('.button-modal01');
|
||||||
$btn.attr('disabled', checked);
|
$btn.attr('disabled', checked);
|
||||||
@@ -209,37 +208,54 @@
|
|||||||
// modal01.open();
|
// modal01.open();
|
||||||
// });
|
// });
|
||||||
},
|
},
|
||||||
|
_bindModelUI() {
|
||||||
|
let $formWrap = $(bind.form.selector).find('form');
|
||||||
|
$formWrap.on('keyup', 'input[name="price"]', function() {
|
||||||
|
// TODO : UI disabled
|
||||||
|
if ($(this).val() === '') {
|
||||||
|
$formWrap.find('input[name="estimatedValue"]').attr('disabled', false);
|
||||||
|
} else {
|
||||||
|
$formWrap.find('input[name="estimatedValue"]').val('').attr('disabled', true);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$formWrap.on('keyup', 'input[name="estimatedValue"]', function() {
|
||||||
|
// TODO : UI disabled
|
||||||
|
if ($(this).val() === '') {
|
||||||
|
$formWrap.find('input[name="price"]').attr('disabled', false);
|
||||||
|
} else {
|
||||||
|
$formWrap.find('input[name="price"]').val('').attr('disabled', true);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
createModal(id) {
|
createModal(id) {
|
||||||
if (id === undefined) {
|
if (id === undefined) {
|
||||||
id = 0;
|
id = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
|
||||||
|
|
||||||
ajaxUtil._ajaxAsyncMethod(
|
ajaxUtil._ajaxAsyncMethod(
|
||||||
ENV.httpUrl.form.replace('{id}', id),
|
ENV.httpUrl.form.replace('{id}', id),
|
||||||
{},
|
{},
|
||||||
function(rstHtml, status) {
|
function(rstHtml, status) {
|
||||||
$('.modal01').find('.modal-content').html(rstHtml);
|
$('.modal01').find('.modal-content').html(rstHtml);
|
||||||
|
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
etUI.components.SelectBox().core.init(document.querySelector('#categoryCode'));
|
etUI.components.SelectBox().core.init(document.querySelector('#categoryCode'));
|
||||||
etUI.components.SelectBox().core.init(document.querySelector('#cropCode'));
|
etUI.components.SelectBox().core.init(document.querySelector('#cropCode'));
|
||||||
etUI.components.SelectBox().core.init(document.querySelector('#unitCode'));
|
etUI.components.SelectBox().core.init(document.querySelector('#unitCode'));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
const selectbox = etUI.components.SelectBox();
|
etUI.components.SelectBox().core.init(document.querySelector('#categoryCode'), {
|
||||||
etUI.components.SelectBox().core.init(document.querySelector('#selectCategory'), {
|
|
||||||
onChange: function() {
|
onChange: function() {
|
||||||
console.log('sssssssssss')
|
console.log('sssssssssss')
|
||||||
},
|
},
|
||||||
selectItemCallback: function() {
|
selectItemCallback: function() {
|
||||||
|
// TODO : console.log ?
|
||||||
console.log(1111)
|
console.log(1111)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
etUI.components.SelectBox().core.init(document.querySelector('#selectUnit'), {
|
etUI.components.SelectBox().core.init(document.querySelector('#unitCode'), {
|
||||||
onChange: function() {
|
onChange: function() {
|
||||||
console.log('sssssssssss')
|
console.log('sssssssssss')
|
||||||
},
|
},
|
||||||
@@ -247,25 +263,25 @@
|
|||||||
console.log(3333)
|
console.log(3333)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
*/
|
||||||
|
|
||||||
document.querySelector('#selectUnit').addEventListener('select:onChange', (e) => {
|
/*document.querySelector('#selectUnit').addEventListener('select:onChange', (e) => {
|
||||||
console.log(e.detail);
|
console.log(e.detail);
|
||||||
console.log(e.detail.value);
|
console.log(e.detail.value);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
etUI.components.SelectBox();
|
|
||||||
const selectbox2 = document.querySelector('.component-select');
|
const selectbox2 = document.querySelector('.component-select');
|
||||||
selectbox2.addEventListener('select:onChange', (e) => {
|
selectbox2.addEventListener('select:onChange', (e) => {
|
||||||
console.log(e.detail);
|
console.log(e.detail);
|
||||||
console.log(e.detail.value);
|
console.log(e.detail.value);
|
||||||
});
|
});
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//document.queerySelector('#unitSelect')
|
//document.queerySelector('#unitSelect')
|
||||||
|
|
||||||
const modal01 = document.querySelector(".modal01").ui;
|
const modal01 = document.querySelector(".modal01").ui;
|
||||||
modal01.open();
|
modal01.open();
|
||||||
|
formControl._bindModelUI();
|
||||||
},
|
},
|
||||||
function(code, rstData) {
|
function(code, rstData) {
|
||||||
kri.logger.error('Do nothing. code: '+ code, rstData);
|
kri.logger.error('Do nothing. code: '+ code, rstData);
|
||||||
|
|||||||
Reference in New Issue
Block a user