[FO] 일계부 DB 변경에 대한 수정 처리
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package app.module.front.usecase.daily.expense.adapters.persistence.model;
|
||||
|
||||
import app.module.front.usecase.daily.income.adapters.web.model.DailyInputType;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@@ -8,12 +9,11 @@ import lombok.Setter;
|
||||
public class DailyExpenseDto {
|
||||
private Long id;
|
||||
private Long dailyRecordSeq;
|
||||
// TODO : SELF, OCR
|
||||
private String inputType;
|
||||
private DailyInputType inputType;
|
||||
private Boolean credit;
|
||||
private String categorySelf;
|
||||
private String expenseKind;
|
||||
private String sourcePurpose;
|
||||
private Double quantity;
|
||||
private String quantity;
|
||||
private String unitCode;
|
||||
private String unitLabel;
|
||||
private String unitSelf;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package app.module.front.usecase.daily.expense.adapters.web.model;
|
||||
|
||||
import app.module.front.usecase.daily.income.adapters.web.model.DailyInputType;
|
||||
import app.module.front.usecase.daily.record.adapters.web.model.DailyUIReqVO;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import lombok.Getter;
|
||||
@@ -19,9 +20,9 @@ public class CreateDailyExpenseReqVO extends DailyUIReqVO {
|
||||
*/
|
||||
private Long dailyRecordSeq;
|
||||
/**
|
||||
* 등록 유형(SELF, OCR)
|
||||
* 등록 유형
|
||||
*/
|
||||
private String inputType;
|
||||
private DailyInputType inputType;
|
||||
/**
|
||||
* 외상판매 여부
|
||||
*/
|
||||
@@ -30,7 +31,7 @@ public class CreateDailyExpenseReqVO extends DailyUIReqVO {
|
||||
* 지출의 종류 직접입력
|
||||
*/
|
||||
@NotBlank(message = "지출 종류를 입력해 주세요.")
|
||||
private String categorySelf;
|
||||
private String expenseKind;
|
||||
/**
|
||||
* 용도
|
||||
*/
|
||||
@@ -45,7 +46,7 @@ public class CreateDailyExpenseReqVO extends DailyUIReqVO {
|
||||
*/
|
||||
private String unitCode;
|
||||
/**
|
||||
* 단위 직접입력
|
||||
* 단위 직접 입력
|
||||
*/
|
||||
private String unitSelf;
|
||||
/**
|
||||
|
||||
@@ -94,11 +94,11 @@ public class DailyExpenseService implements DailyExpensePortIn {
|
||||
new CreateDailyExpenseCmd(
|
||||
formVO.getId(),
|
||||
formVO.getDailyRecordSeq(),
|
||||
(formVO.getCredit() ? "52210" : null), // [정책] 외상판매 Y 일 경우 수입부호 52210 적재
|
||||
null,
|
||||
formVO.getInputType(),
|
||||
"2", // [정책] 2 고정
|
||||
(formVO.getCredit() ? "52210" : null), // [정책] 외상판매 Y 일 경우 수입부호 52210 적재
|
||||
formVO.getCredit(),
|
||||
formVO.getCategorySelf(),
|
||||
formVO.getExpenseKind(),
|
||||
formVO.getSourcePurpose(),
|
||||
formVO.getQuantity(),
|
||||
formVO.getUnitCode(),
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package app.module.front.usecase.daily.expense.ports.application.domain;
|
||||
|
||||
import app.module.front.config.adapters.persistence.component.FrontAuditCommand;
|
||||
import app.module.front.usecase.daily.income.adapters.web.model.DailyInputType;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
@@ -13,11 +14,17 @@ import lombok.ToString;
|
||||
public class CreateDailyExpenseCmd extends FrontAuditCommand {
|
||||
private Long id;
|
||||
private Long dailyRecordSeq;
|
||||
private DailyInputType inputType;
|
||||
/**
|
||||
* 유형
|
||||
*/
|
||||
private String category;
|
||||
/**
|
||||
* 수입 부호
|
||||
*/
|
||||
private String incomeMark;
|
||||
private String expenseMark;
|
||||
private String inputType;
|
||||
private Boolean credit;
|
||||
private String categorySelf;
|
||||
private String expenseKind;
|
||||
private String sourcePurpose;
|
||||
private Double quantity;
|
||||
private String unitCode;
|
||||
|
||||
@@ -1,23 +1,21 @@
|
||||
package app.module.front.usecase.daily.income.adapters.persistence.model;
|
||||
|
||||
import app.module.front.usecase.daily.income.adapters.web.model.DailyInputType;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class DailyIncomeDto {
|
||||
private Long id;
|
||||
private Long dailyRecordSeq;
|
||||
// TODO : SELF, OCR
|
||||
private String inputType;
|
||||
private DailyInputType inputType;
|
||||
private Boolean credit;
|
||||
private String cropCode;
|
||||
private String cropLabel;
|
||||
private String categorySelf;
|
||||
private String incomeKind;
|
||||
private String sourcePurpose;
|
||||
private Double quantity;
|
||||
private String quantity;
|
||||
private String unitCode;
|
||||
private String unitLabel;
|
||||
private String unitSelf;
|
||||
|
||||
@@ -19,9 +19,9 @@ public class CreateDailyIncomeReqVO extends DailyUIReqVO {
|
||||
*/
|
||||
private Long dailyRecordSeq;
|
||||
/**
|
||||
* 등록 유형(SELF, OCR)
|
||||
* 등록 유형
|
||||
*/
|
||||
private String inputType;
|
||||
private DailyInputType inputType;
|
||||
/**
|
||||
* 외상판매 여부
|
||||
*/
|
||||
@@ -34,7 +34,7 @@ public class CreateDailyIncomeReqVO extends DailyUIReqVO {
|
||||
* 수입의 종류 직접입력
|
||||
*/
|
||||
@NotBlank(message = "수입 종류를 입력해 주세요.")
|
||||
private String categorySelf;
|
||||
private String incomeKind;
|
||||
/**
|
||||
* 수입원
|
||||
*/
|
||||
@@ -49,7 +49,7 @@ public class CreateDailyIncomeReqVO extends DailyUIReqVO {
|
||||
*/
|
||||
private String unitCode;
|
||||
/**
|
||||
* 단위 직접입력
|
||||
* 단위 직접 입력
|
||||
*/
|
||||
private String unitSelf;
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package app.module.front.usecase.daily.income.adapters.web.model;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
public enum DailyInputType {
|
||||
/**
|
||||
* 직접 입력
|
||||
*/
|
||||
SELF,
|
||||
/**
|
||||
* 영수증 입력
|
||||
*/
|
||||
OCR,
|
||||
;
|
||||
}
|
||||
@@ -97,12 +97,12 @@ public class DailyIncomeService implements DailyIncomePortIn {
|
||||
new CreateDailyIncomeCmd(
|
||||
formVO.getId(),
|
||||
formVO.getDailyRecordSeq(),
|
||||
null,
|
||||
(formVO.getCredit() ? "91206" : null), // [정책] 외상판매 Y 일 경우 지출부호 91206 적재
|
||||
formVO.getInputType(),
|
||||
"1", // [정책] 1 고정
|
||||
(formVO.getCredit() ? "91206" : null), // [정책] 외상판매 Y 일 경우 지출부호 91206 적재
|
||||
formVO.getCredit(),
|
||||
formVO.getCropCode(),
|
||||
formVO.getCategorySelf(),
|
||||
formVO.getIncomeKind(),
|
||||
formVO.getSourcePurpose(),
|
||||
formVO.getQuantity(),
|
||||
formVO.getUnitCode(),
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package app.module.front.usecase.daily.income.ports.application.domain;
|
||||
|
||||
import app.module.front.config.adapters.persistence.component.FrontAuditCommand;
|
||||
import app.module.front.usecase.daily.income.adapters.web.model.DailyInputType;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
@@ -13,12 +14,18 @@ import lombok.ToString;
|
||||
public class CreateDailyIncomeCmd extends FrontAuditCommand {
|
||||
private Long id;
|
||||
private Long dailyRecordSeq;
|
||||
private String incomeMark;
|
||||
private DailyInputType inputType;
|
||||
/**
|
||||
* 유형
|
||||
*/
|
||||
private String category;
|
||||
/**
|
||||
* 지출 부호
|
||||
*/
|
||||
private String expenseMark;
|
||||
private String inputType;
|
||||
private Boolean credit;
|
||||
private String cropCode;
|
||||
private String categorySelf;
|
||||
private String incomeKind;
|
||||
private String sourcePurpose;
|
||||
private Double quantity;
|
||||
private String unitCode;
|
||||
|
||||
@@ -9,8 +9,8 @@ public class DailyPowerDto {
|
||||
private Long id;
|
||||
private Long dailyRecordSeq;
|
||||
private String equipmentName;
|
||||
private Integer ownedHours;
|
||||
private Integer leasedHours;
|
||||
private String ownedHours;
|
||||
private String leasedHours;
|
||||
|
||||
/**
|
||||
* 수정 가능 여부
|
||||
|
||||
@@ -27,9 +27,9 @@ public class CreateDailyPowerReqVO extends DailyUIReqVO {
|
||||
/**
|
||||
* 자가 사용시간
|
||||
*/
|
||||
private Integer ownedHours;
|
||||
private Double ownedHours;
|
||||
/**
|
||||
* 임차 사용시간
|
||||
*/
|
||||
private Integer leasedHours;
|
||||
private Double leasedHours;
|
||||
}
|
||||
|
||||
@@ -66,8 +66,6 @@ public class DailyPowerService implements DailyPowerPortIn {
|
||||
new CreateDailyPowerCmd(
|
||||
formVO.getId(),
|
||||
formVO.getDailyRecordSeq(),
|
||||
null,
|
||||
null,
|
||||
formVO.getEquipmentName(),
|
||||
formVO.getOwnedHours(),
|
||||
formVO.getLeasedHours()));
|
||||
|
||||
@@ -13,9 +13,7 @@ import lombok.ToString;
|
||||
public class CreateDailyPowerCmd extends FrontAuditCommand {
|
||||
private Long id;
|
||||
private Long dailyRecordSeq;
|
||||
private String incomeMark;
|
||||
private String expenseMark;
|
||||
private String equipmentName;
|
||||
private Integer ownedHours;
|
||||
private Integer leasedHours;
|
||||
private Double ownedHours;
|
||||
private Double leasedHours;
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ public class DailyWorkDto {
|
||||
private String itemMark;
|
||||
private String workName;
|
||||
private String workMark;
|
||||
private Double workLandArea;
|
||||
private String workLandArea;
|
||||
private String areaUnitCode;
|
||||
private String areaUnitLabel;
|
||||
private String areaUnitSelf;
|
||||
@@ -20,16 +20,16 @@ public class DailyWorkDto {
|
||||
private String harvestUnitCode;
|
||||
private String harvestUnitLabel;
|
||||
private String harvestUnitSelf;
|
||||
private Double ownerTime;
|
||||
private Double spouseTime;
|
||||
private Double familyMHours;
|
||||
private Double familyFHours;
|
||||
private Double hiredMHours;
|
||||
private Double hiredFHours;
|
||||
private Double sharedMHours;
|
||||
private Double sharedFHours;
|
||||
private Double volunteerMHours;
|
||||
private Double volunteerFHours;
|
||||
private String ownerTime;
|
||||
private String spouseTime;
|
||||
private String familyMHours;
|
||||
private String familyFHours;
|
||||
private String hiredMHours;
|
||||
private String hiredFHours;
|
||||
private String sharedMHours;
|
||||
private String sharedFHours;
|
||||
private String volunteerMHours;
|
||||
private String volunteerFHours;
|
||||
|
||||
/**
|
||||
* 수정 가능 여부
|
||||
|
||||
@@ -24,19 +24,11 @@ public class CreateDailyWorkReqVO extends DailyUIReqVO {
|
||||
*/
|
||||
@NotBlank(message = "품목명을 입력해 주세요.")
|
||||
private String itemName;
|
||||
/**
|
||||
* 품목부호
|
||||
*/
|
||||
private Boolean itemMark;
|
||||
/**
|
||||
* 작업명
|
||||
*/
|
||||
@NotBlank(message = "작업명을 입력해 주세요.")
|
||||
private String workName;
|
||||
/**
|
||||
* 작업 부호
|
||||
*/
|
||||
private String workMark;
|
||||
/**
|
||||
* 작업 면적
|
||||
*/
|
||||
@@ -52,8 +44,7 @@ public class CreateDailyWorkReqVO extends DailyUIReqVO {
|
||||
/**
|
||||
* 수확량
|
||||
*/
|
||||
@NotBlank(message = "수확량을 입력해 주세요.")
|
||||
private String harvestQuantity;
|
||||
private Double harvestQuantity;
|
||||
/**
|
||||
* 수확량 단위 코드
|
||||
*/
|
||||
|
||||
@@ -20,14 +20,10 @@ public class CreateDailyWorkValidator implements Validator {
|
||||
public void validate(Object target, Errors errors) {
|
||||
CreateDailyWorkReqVO vo = (CreateDailyWorkReqVO) target;
|
||||
|
||||
if (vo.getOwnerTime() == null && vo.getSpouseTime() == null
|
||||
&& vo.getFamilyMHours() == null && vo.getFamilyFHours() == null
|
||||
&& vo.getHiredMHours() == null && vo.getHiredFHours() == null
|
||||
&& vo.getSharedMHours() == null && vo.getSharedFHours() == null
|
||||
&& vo.getVolunteerMHours() == null && vo.getVolunteerFHours() == null) {
|
||||
if (vo.getHarvestQuantity() == null) {
|
||||
errors.rejectValue(
|
||||
"ownerTime", "valid.common.required",
|
||||
"최소 1개의 항목을 입력해주세요.");
|
||||
"harvestQuantity", "valid.common.required",
|
||||
"수확량을 입력해 주세요.");
|
||||
}
|
||||
|
||||
if ("SELF".equals(vo.getAreaUnitCode()) && StringUtils.isBlank(vo.getAreaUnitSelf())) {
|
||||
@@ -41,5 +37,15 @@ public class CreateDailyWorkValidator implements Validator {
|
||||
"harvestUnitSelf", "valid.common.required",
|
||||
"단위를 입력해 주세요.");
|
||||
}
|
||||
|
||||
if (vo.getOwnerTime() == null && vo.getSpouseTime() == null
|
||||
&& vo.getFamilyMHours() == null && vo.getFamilyFHours() == null
|
||||
&& vo.getHiredMHours() == null && vo.getHiredFHours() == null
|
||||
&& vo.getSharedMHours() == null && vo.getSharedFHours() == null
|
||||
&& vo.getVolunteerMHours() == null && vo.getVolunteerFHours() == null) {
|
||||
errors.rejectValue(
|
||||
"ownerTime", "valid.common.required",
|
||||
"최소 1개의 항목을 입력해주세요.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,9 +101,7 @@ public class DailyWorkService implements DailyWorkPortIn {
|
||||
formVO.getId(),
|
||||
formVO.getDailyRecordSeq(),
|
||||
formVO.getItemName(),
|
||||
null,
|
||||
formVO.getWorkName(),
|
||||
null,
|
||||
formVO.getWorkLandArea(),
|
||||
formVO.getAreaUnitCode(),
|
||||
formVO.getAreaUnitSelf(),
|
||||
|
||||
@@ -14,13 +14,11 @@ public class CreateDailyWorkCmd extends FrontAuditCommand {
|
||||
private Long id;
|
||||
private Long dailyRecordSeq;
|
||||
private String itemName;
|
||||
private String itemMark;
|
||||
private String workName;
|
||||
private String workMark;
|
||||
private Double workLandArea;
|
||||
private String areaUnitCode;
|
||||
private String areaUnitSelf;
|
||||
private String harvestQuantity;
|
||||
private Double harvestQuantity;
|
||||
private String harvestUnitCode;
|
||||
private String harvestUnitSelf;
|
||||
private Double ownerTime;
|
||||
|
||||
Reference in New Issue
Block a user