[BO] 일계부 수입 등록&수정
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
package app.module.core.config.application.enums;
|
||||
|
||||
public enum DailyInputType {
|
||||
/**
|
||||
* 직접 입력
|
||||
*/
|
||||
SELF,
|
||||
/**
|
||||
* 영수증 입력
|
||||
*/
|
||||
OCR,
|
||||
;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package app.module.core.config.constants;
|
||||
|
||||
public class CommonConstants {
|
||||
private CommonConstants() {
|
||||
throw new IllegalAccessError("어플리케이션에서 공통으로 사용되는 상수 클래스로 생성자를 사용할 수 없습니다.");
|
||||
}
|
||||
|
||||
/**
|
||||
* 단위의 직접입력 코드
|
||||
*/
|
||||
public static final String UNIT_CODE_SELF = "code.record.unit.self";
|
||||
|
||||
/**
|
||||
* 작업 면적의 직접입력 코드
|
||||
*/
|
||||
public static final String AREA_CODE_OTHER = "code.record.area.self";
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package app.module.core.config.constants;
|
||||
|
||||
public class DailyRecordConstants {
|
||||
private DailyRecordConstants() {
|
||||
throw new IllegalAccessError("어플리케이션에서 일계부에서 사용되는 상수 클래스로 생성자를 사용할 수 없습니다.");
|
||||
}
|
||||
|
||||
/**
|
||||
* 수입의 유형
|
||||
* [정책] 1 고정
|
||||
*/
|
||||
public static final String INCOME_CATEGORY = "1";
|
||||
|
||||
/**
|
||||
* 수입의 지출부호
|
||||
* [정책] 외상판매 Y 일 경우 지출부호 91206 적재
|
||||
*/
|
||||
public static final String INCOME_EXPENSE_MARK = "91206";
|
||||
}
|
||||
@@ -76,6 +76,8 @@ public class DailyRecordDao implements DailyRecordPortOut {
|
||||
)
|
||||
);
|
||||
|
||||
log.debug("[updateByStatus] command: {}", command);
|
||||
|
||||
if ("ALL".equals(targetType)) {
|
||||
// 전체 입력상태 변경
|
||||
String allStatus = this.getUpdateAllStatus(recordMonth, dayGroupNo, householdSeq);
|
||||
@@ -119,10 +121,9 @@ public class DailyRecordDao implements DailyRecordPortOut {
|
||||
);
|
||||
|
||||
dailyRecordMapper.updateDailyRecordStatus(command);
|
||||
|
||||
} else {
|
||||
log.debug("[updateByAllStatus] do nothing. findCmd: {}");
|
||||
}
|
||||
|
||||
log.debug("[updateByAllStatus] allStatus: {}", allStatus);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -134,7 +135,7 @@ public class DailyRecordDao implements DailyRecordPortOut {
|
||||
* @return 변경할 전체 입력상태
|
||||
*/
|
||||
private String getUpdateAllStatus(String searchMonth, Integer dayGroupNo, Long householdSeq) {
|
||||
GetDailyRecordCmd findCmd = new GetDailyRecordCmd(searchMonth, dayGroupNo, householdSeq);
|
||||
GetDailyRecordCmd findCmd = new GetDailyRecordCmd(searchMonth, dayGroupNo, householdSeq, null);
|
||||
|
||||
DailyRecordStatusDto statusDetail = null;
|
||||
List<DailyRecordStatusDto> statusList = dailyRecordMapper.getDailyRecordStatus(findCmd);
|
||||
|
||||
@@ -15,6 +15,13 @@ public interface DailyRecordPortIn {
|
||||
*/
|
||||
DailyRecordDto detail(String recordMonth, Integer dayGroupNo, Long householdSeq);
|
||||
|
||||
/**
|
||||
* 일계부 항목 조회
|
||||
*
|
||||
* @param dailyRecordSeq
|
||||
*/
|
||||
DailyRecordDto detail(Long dailyRecordSeq);
|
||||
|
||||
/**
|
||||
* 일계부 항목 등록
|
||||
*
|
||||
|
||||
@@ -53,6 +53,36 @@ public class DailyRecordService implements DailyRecordPortIn {
|
||||
return dailyRecord;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DailyRecordDto detail(Long dailyRecordSeq) {
|
||||
DailyRecordDto dailyRecord = portOut.detail(new GetDailyRecordCmd(dailyRecordSeq));
|
||||
|
||||
if (dailyRecord != null) {
|
||||
List<DailySort> targetList = new ArrayList<>();
|
||||
if (this.isTarget(dailyRecord.getIncomeStatus())) {
|
||||
targetList.add(DailySort.INCOME);
|
||||
}
|
||||
if (this.isTarget(dailyRecord.getWorkStatus())) {
|
||||
targetList.add(DailySort.WORK);
|
||||
}
|
||||
if (this.isTarget(dailyRecord.getExpenseStatus())) {
|
||||
targetList.add(DailySort.EXPENSE);
|
||||
}
|
||||
if (this.isTarget(dailyRecord.getPowerStatus())) {
|
||||
targetList.add(DailySort.POWER);
|
||||
}
|
||||
if (this.isTarget(dailyRecord.getForestryStatus())) {
|
||||
targetList.add(DailySort.FORESTRY);
|
||||
}
|
||||
if (this.isTarget(dailyRecord.getFarmingStatus())) {
|
||||
targetList.add(DailySort.FARMING);
|
||||
}
|
||||
dailyRecord.setTargetList(targetList);
|
||||
}
|
||||
|
||||
return dailyRecord;
|
||||
}
|
||||
|
||||
/**
|
||||
* 데이터 등록 대상 여부
|
||||
*
|
||||
@@ -68,7 +98,8 @@ public class DailyRecordService implements DailyRecordPortIn {
|
||||
GetDailyRecordCmd findCmd = new GetDailyRecordCmd(
|
||||
formVO.getRecordMonth(),
|
||||
formVO.getDayGroupNo(),
|
||||
formVO.getHouseholdSeq());
|
||||
formVO.getHouseholdSeq(),
|
||||
null);
|
||||
|
||||
CreateDailyRecordCmd command = AuditUtil.create(
|
||||
new CreateDailyRecordCmd(
|
||||
|
||||
@@ -8,6 +8,16 @@ import lombok.Setter;
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
public class GetDailyRecordCmd {
|
||||
public GetDailyRecordCmd(String searchMonth, Integer groupNo, Long householdSeq) {
|
||||
this.searchMonth = searchMonth;
|
||||
this.groupNo = groupNo;
|
||||
this.householdSeq = householdSeq;
|
||||
}
|
||||
|
||||
public GetDailyRecordCmd(Long dailyRecordSeq) {
|
||||
this.dailyRecordSeq = dailyRecordSeq;
|
||||
}
|
||||
|
||||
/**
|
||||
* 검색 월(yyyyMM)
|
||||
*/
|
||||
@@ -20,4 +30,8 @@ public class GetDailyRecordCmd {
|
||||
* 임가 일련번호
|
||||
*/
|
||||
private Long householdSeq;
|
||||
/**
|
||||
* 일계부 항목 일련번호
|
||||
*/
|
||||
private Long dailyRecordSeq;
|
||||
}
|
||||
|
||||
@@ -8,12 +8,20 @@
|
||||
, dr.id, dr.record_month, dr.day_group_no, dr.start_date, dr.end_date
|
||||
, dr.all_status, dr.income_status, dr.work_status, dr.expense_status, dr.power_status, dr.forestry_status, dr.farming_status
|
||||
from daily_day_group ddg
|
||||
<if test="dailyRecordSeq == null">
|
||||
left join
|
||||
daily_record dr on dr.day_group_no = ddg.group_no and dr.is_deleted = false
|
||||
and dr.record_month = #{searchMonth}
|
||||
and dr.household_seq = #{householdSeq}
|
||||
where ddg.is_deleted = false
|
||||
and ddg.group_no = #{groupNo}
|
||||
</if>
|
||||
<if test="dailyRecordSeq != null">
|
||||
inner join
|
||||
daily_record dr on dr.day_group_no = ddg.group_no and dr.is_deleted = false
|
||||
and dr.id = #{dailyRecordSeq}
|
||||
where ddg.is_deleted = false
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getDailyRecordStatus"
|
||||
|
||||
Reference in New Issue
Block a user