Merge branch 'bo_household' into 'dev'

[BO] 임가현황 등록 필드 추가, 임가 등록 시 월별 입력상태 fn_monthly_input_status() 실행

See merge request korea-research/korea-research!81
This commit is contained in:
이강선 매니저/ST
2025-07-04 07:42:07 +00:00
22 changed files with 226 additions and 45 deletions

View File

@@ -0,0 +1,14 @@
package app.module.admin.config.application.enums;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
@Getter
@RequiredArgsConstructor
public enum EmploymentType {
FULLTIME( "1. 임업전업"),
MAIN( "2. 임업주업"),
PART( "3. 임업부업");
private final String desc;
}

View File

@@ -16,7 +16,6 @@ class CreateHouseholdDao implements CreateHouseholdPortOut {
private final CreateHouseholdMapper mapper;
@Override
@Transactional
@CreateCommand
public void operate(CreateHouseholdOutCmd outCmd) {
// 임가 등록

View File

@@ -52,6 +52,8 @@ class CreateHouseholdController {
reqVO.getIndustryDetail(),
reqVO.getResearcherSeq(),
reqVO.getIsPanel(),
reqVO.getUsageType().name(),
reqVO.getEmploymentType().name(),
reqVO.getMemo()
)
);

View File

@@ -1,5 +1,7 @@
package app.module.admin.usecase.household.createHousehold.adapters.web.model;
import app.module.admin.config.application.enums.EmploymentType;
import app.module.admin.config.application.enums.UsageType;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotEmpty;
import lombok.AllArgsConstructor;
@@ -33,5 +35,7 @@ public class CreateHouseholdReqVO {
private String industryDetail;
private Long researcherSeq;
private Boolean isPanel;
private UsageType usageType;
private EmploymentType employmentType;
private String memo;
}

View File

@@ -7,12 +7,16 @@ import app.module.admin.usecase.household.createHousehold.ports.CreateHouseholdP
import app.module.admin.usecase.household.createHousehold.ports.CreateHouseholdPortOut;
import app.module.admin.usecase.household.createHousehold.ports.application.domain.CreateHouseholdInCmd;
import app.module.admin.usecase.household.createHousehold.ports.application.domain.CreateHouseholdOutCmd;
import app.module.admin.usecase.schedule.autoSchedules.ports.AutoSchedulesPortIn;
import java.util.List;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils;
@Slf4j
@Service
@RequiredArgsConstructor
class CreateHouseholdService implements CreateHouseholdPortIn {
@@ -20,8 +24,10 @@ class CreateHouseholdService implements CreateHouseholdPortIn {
private final CreateHouseholdPortOut portOut;
private final BCryptPasswordEncoder passwordEncoder;
private final CheckHouseholdNumPortIn checkHouseholdNumPortIn;
private final AutoSchedulesPortIn autoSchedulesPortIn;
@Override
@Transactional
public void operate(CreateHouseholdInCmd inCmd) {
// 임가번호 중복체크
@@ -34,28 +40,40 @@ class CreateHouseholdService implements CreateHouseholdPortIn {
});
}
portOut.operate(new CreateHouseholdOutCmd(
null,
inCmd.getHouseholdNum(),
inCmd.getOwnerName(),
inCmd.getOwnerAge(),
(!StringUtils.hasText(inCmd.getTel2()) || !StringUtils.hasText(inCmd.getTel3()))
? null
: inCmd.getTel1() + "-" + inCmd.getTel2() + "-" + inCmd.getTel3(),
inCmd.getPhone1() + "-" + inCmd.getPhone2() + "-" + inCmd.getPhone3(),
passwordEncoder.encode(inCmd.getPhone3()), // 비밀번호 핸드폰 뒤 네자리
inCmd.getRegionMainCode(),
inCmd.getRegionSubCode(),
inCmd.getRegionDetailCode(),
inCmd.getAddress(),
inCmd.getIndustryLargeCode(),
inCmd.getIndustryMiddleCode(),
inCmd.getIndustrySubMiddle(),
inCmd.getIndustryDetail(),
inCmd.getResearcherSeq(),
inCmd.getIsPanel(),
inCmd.getMemo(),
List.of("ROLE_GENERAL")
));
// 임가 등록
try {
portOut.operate(new CreateHouseholdOutCmd(
null,
inCmd.getHouseholdNum(),
inCmd.getOwnerName(),
inCmd.getOwnerAge(),
(!StringUtils.hasText(inCmd.getTel2()) || !StringUtils.hasText(inCmd.getTel3()))
? null
: inCmd.getTel1() + "-" + inCmd.getTel2() + "-" + inCmd.getTel3(),
inCmd.getPhone1() + "-" + inCmd.getPhone2() + "-" + inCmd.getPhone3(),
passwordEncoder.encode(inCmd.getPhone3()),
inCmd.getRegionMainCode(),
inCmd.getRegionSubCode(),
inCmd.getRegionDetailCode(),
inCmd.getAddress(),
inCmd.getIndustryLargeCode(),
inCmd.getIndustryMiddleCode(),
inCmd.getIndustrySubMiddle(),
inCmd.getIndustryDetail(),
inCmd.getResearcherSeq(),
inCmd.getIsPanel(),
inCmd.getUsageType(),
inCmd.getEmploymentType(),
inCmd.getMemo(),
List.of("ROLE_GENERAL")
));
// 월별 입력 현황 레코드 추가
autoSchedulesPortIn.operate();
} catch (Exception e) {
log.info(e.getMessage());
throw e;
}
}
}

View File

@@ -29,5 +29,7 @@ public class CreateHouseholdInCmd {
private String industryDetail;
private Long researcherSeq;
private Boolean isPanel;
private String usageType;
private String employmentType;
private String memo;
}

View File

@@ -29,6 +29,8 @@ public class CreateHouseholdOutCmd extends AuditCommand {
private String industryDetail;
private Long researcherSeq;
private Boolean isPanel;
private String usageType;
private String employmentType;
private String memo;
private List<String> roleIds;
}

View File

@@ -103,6 +103,8 @@ class ExcelUploadCreateHouseholdDao implements ExcelUploadCreateHouseholdPortOut
household.getIndustryDetail(),
household.getResearcherSeq(),
household.getIsPanel(),
null,
null,
household.getMemo(),
List.of("ROLE_GENERAL")
);

View File

@@ -50,6 +50,10 @@ public class GetHouseholdStatus {
private String industryDetailName;
// 유지여부
private Boolean isPanel;
// 이용구분
private String usageType;
// 전겸업 구분
private String employmentType;
// 비고
private String memo;
// 조사원 일련번호

View File

@@ -52,6 +52,8 @@ class UpdateHouseholdController {
reqVO.getIndustryDetail(),
reqVO.getResearcherSeq(),
reqVO.getIsPanel(),
reqVO.getUsageType().name(),
reqVO.getEmploymentType().name(),
reqVO.getMemo()
)
);

View File

@@ -1,5 +1,7 @@
package app.module.admin.usecase.household.updateHousehold.adapters.web.model;
import app.module.admin.config.application.enums.EmploymentType;
import app.module.admin.config.application.enums.UsageType;
import lombok.AllArgsConstructor;
import lombok.EqualsAndHashCode;
import lombok.Getter;
@@ -31,5 +33,7 @@ public class UpdateHouseholdReqVO {
private String industryDetail;
private Long researcherSeq;
private Boolean isPanel;
private UsageType usageType;
private EmploymentType employmentType;
private String memo;
}

View File

@@ -34,6 +34,8 @@ class UpdateHouseholdService implements UpdateHouseholdPortIn {
inCmd.getIndustryDetail(),
inCmd.getResearcherSeq(),
inCmd.getIsPanel(),
inCmd.getUsageType(),
inCmd.getEmploymentType(),
inCmd.getMemo()
));
}

View File

@@ -30,5 +30,7 @@ public class UpdateHouseholdInCmd {
private String industryDetail;
private Long researcherSeq;
private Boolean isPanel;
private String usageType;
private String employmentType;
private String memo;
}

View File

@@ -27,5 +27,7 @@ public class UpdateHouseholdOutCmd extends AuditCommand {
private String industryDetail;
private Long researcherSeq;
private Boolean isPanel;
private String usageType;
private String employmentType;
private String memo;
}

View File

@@ -73,6 +73,8 @@ class UpdateHouseholdStatusUIController {
result.getIndustrySubMiddleName(),
result.getIndustryDetailName(),
result.getIsPanel(),
result.getUsageType(),
result.getEmploymentType(),
result.getMemo(),
result.getResearcherSeq(),
result.getResearcherName(),

View File

@@ -44,6 +44,10 @@ public class UpdateHouseholdStatusUIResVO {
private String industryDetail;
// 유지여부
private Boolean isPanel;
// 이용구분
private String usageType;
// 전겸업 구분
private String employmentType;
// 비고
private String memo;
// 조사원 일련번호

View File

@@ -36,10 +36,9 @@
<if test="industryDetail != null and industryDetail != ''">
industry_detail,
</if>
<!-- <if test="employmentCode != null or employmentCode != ''">-->
<!-- employment_code,-->
<!-- </if>-->
is_panel,
usage_type,
employment_type,
<if test="memo != null and memo != ''">
memo,
</if>
@@ -70,10 +69,9 @@
<if test="industryDetail != null and industryDetail != ''">
#{industryDetail},
</if>
<!-- <if test="employmentCode != null or employmentCode != ''">-->
<!-- #{employmentCode},-->
<!-- </if>-->
#{isPanel},
#{usageType},
#{employmentType},
<if test="memo != null and memo != ''">
#{memo},
</if>

View File

@@ -27,6 +27,8 @@
h.industry_sub_middle AS industrySubMiddleName,
h.industry_detail AS industryDetailName,
h.is_panel AS isPanel,
h.usage_type AS usageType,
h.employment_type AS employmentType,
h.memo AS memo,
r.admin_seq AS researcherSeq,
r.researcher_name AS researcherName,

View File

@@ -31,6 +31,12 @@
industry_detail = #{industryDetail},
</if>
is_panel = #{isPanel},
<if test="usageType != null and usageType != ''">
usage_type = #{usageType},
</if>
<if test="employmentType != null and employmentType != ''">
employment_type = #{employmentType},
</if>
<if test="memo != null and memo != ''">
memo = #{memo},
</if>

View File

@@ -205,27 +205,79 @@
</button>
</div>
</td>
<th>유지 여부</th>
<td class="radio-group" colspan="3">
<div class="d-flex">
<div class="component-input">
<label class="radio-inner">
<input type="radio" id="isPanel_Y" name="isPanel" value="true" checked>
<span class="radio-item">
<span class="radio-txt">유지</span>
</span>
</label>
</div>
<div class="component-input">
<label class="radio-inner">
<input type="radio" id="isPanel_N" name="isPanel" value="false">
<span class="radio-item">
<span class="radio-txt">탈락</span>
</span>
</label>
</div>
</div>
</td>
</tr>
<tr>
<th>유지 여부</th>
<th>구분</th>
<td class="radio-group">
<div class="component-input">
<label class="radio-inner">
<input type="radio" id="isPanel_Y" name="isPanel" value="true" checked>
<input type="radio" id="usageType_MOBILE" name="usageType" value="MOBILE" checked>
<span class="radio-item">
<span class="radio-txt">유지</span>
<span class="radio-txt">모바일</span>
</span>
</label>
</div>
<div class="component-input">
<label class="radio-inner">
<input type="radio" id="isPanel_N" name="isPanel" value="false">
<input type="radio" id="usageType_PAPER" name="usageType" value="PAPER">
<span class="radio-item">
<span class="radio-txt">탈락</span>
<span class="radio-txt">지류</span>
</span>
</label>
</div>
</td>
<th>전·겸업</th>
<td class="radio-group" colspan="3">
<div class="d-flex">
<div class="component-input">
<label class="radio-inner">
<input type="radio" id="EmploymentType_FULLTIME" name="employmentType" value="FULLTIME" checked>
<span class="radio-item">
<span class="radio-txt">1. 임업전업</span>
</span>
</label>
</div>
<div class="component-input">
<label class="radio-inner">
<input type="radio" id="EmploymentType_MAIN" name="employmentType" value="MAIN">
<span class="radio-item">
<span class="radio-txt">2. 임업주업</span>
</span>
</label>
</div>
<div class="component-input">
<label class="radio-inner">
<input type="radio" id="EmploymentType_PART" name="employmentType" value="PART">
<span class="radio-item">
<span class="radio-txt">3. 임업부업</span>
</span>
</label>
</div>
</div>
</td>
</tr>
<tr>
<th>비고</th>

View File

@@ -224,29 +224,86 @@
</button>
</div>
</td>
<th>유지 여부</th>
<td class="radio-group" colspan="3">
<div class="d-flex">
<div class="component-input">
<label class="radio-inner">
<input type="radio" id="isPanel_Y" name="isPanel" value="true"
th:checked="${householdInfo.isPanel == true}">
<span class="radio-item">
<span class="radio-txt">유지</span>
</span>
</label>
</div>
<div class="component-input">
<label class="radio-inner">
<input type="radio" id="isPanel_N" name="isPanel" value="false"
th:checked="${householdInfo.isPanel == false}">
<span class="radio-item">
<span class="radio-txt">탈락</span>
</span>
</label>
</div>
</div>
</td>
</tr>
<tr>
<th>유지 여부</th>
<th>구분</th>
<td class="radio-group">
<div class="component-input">
<label class="radio-inner">
<input type="radio" id="isPanel_Y" name="isPanel" value="true"
th:checked="${householdInfo.isPanel == true}">
<input type="radio" id="usageType_MOBILE" name="usageType" value="MOBILE"
th:checked="${householdInfo.usageType == 'MOBILE'}">
<span class="radio-item">
<span class="radio-txt">유지</span>
<span class="radio-txt">모바일</span>
</span>
</label>
</div>
<div class="component-input">
<label class="radio-inner">
<input type="radio" id="isPanel_N" name="isPanel" value="false"
th:checked="${householdInfo.isPanel == false}">
<input type="radio" id="usageType_PAPER" name="usageType" value="PAPER"
th:checked="${householdInfo.usageType == 'PAPER'}">
<span class="radio-item">
<span class="radio-txt">탈락</span>
</span>
<span class="radio-txt">지류</span>
</span>
</label>
</div>
</td>
<th>전·겸업</th>
<td class="radio-group" colspan="3">
<div class="d-flex">
<div class="component-input">
<label class="radio-inner">
<input type="radio" id="EmploymentType_FULLTIME" name="employmentType" value="FULLTIME"
th:checked="${householdInfo.employmentType == 'FULLTIME'}">
<span class="radio-item">
<span class="radio-txt">1. 임업전업</span>
</span>
</label>
</div>
<div class="component-input">
<label class="radio-inner">
<input type="radio" id="EmploymentType_MAIN" name="employmentType" value="MAIN"
th:checked="${householdInfo.employmentType == 'MAIN'}">
<span class="radio-item">
<span class="radio-txt">2. 임업주업</span>
</span>
</label>
</div>
<div class="component-input">
<label class="radio-inner">
<input type="radio" id="EmploymentType_PART" name="employmentType" value="PART"
th:checked="${householdInfo.employmentType == 'PART'}">
<span class="radio-item">
<span class="radio-txt">3. 임업부업</span>
</span>
</label>
</div>
</div>
</td>
</tr>
<tr>
<th>비고</th>