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; private final CreateHouseholdMapper mapper;
@Override @Override
@Transactional
@CreateCommand @CreateCommand
public void operate(CreateHouseholdOutCmd outCmd) { public void operate(CreateHouseholdOutCmd outCmd) {
// 임가 등록 // 임가 등록

View File

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

View File

@@ -1,5 +1,7 @@
package app.module.admin.usecase.household.createHousehold.adapters.web.model; 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.NotBlank;
import jakarta.validation.constraints.NotEmpty; import jakarta.validation.constraints.NotEmpty;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
@@ -33,5 +35,7 @@ public class CreateHouseholdReqVO {
private String industryDetail; private String industryDetail;
private Long researcherSeq; private Long researcherSeq;
private Boolean isPanel; private Boolean isPanel;
private UsageType usageType;
private EmploymentType employmentType;
private String memo; 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.CreateHouseholdPortOut;
import app.module.admin.usecase.household.createHousehold.ports.application.domain.CreateHouseholdInCmd; 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.household.createHousehold.ports.application.domain.CreateHouseholdOutCmd;
import app.module.admin.usecase.schedule.autoSchedules.ports.AutoSchedulesPortIn;
import java.util.List; import java.util.List;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
@Slf4j
@Service @Service
@RequiredArgsConstructor @RequiredArgsConstructor
class CreateHouseholdService implements CreateHouseholdPortIn { class CreateHouseholdService implements CreateHouseholdPortIn {
@@ -20,8 +24,10 @@ class CreateHouseholdService implements CreateHouseholdPortIn {
private final CreateHouseholdPortOut portOut; private final CreateHouseholdPortOut portOut;
private final BCryptPasswordEncoder passwordEncoder; private final BCryptPasswordEncoder passwordEncoder;
private final CheckHouseholdNumPortIn checkHouseholdNumPortIn; private final CheckHouseholdNumPortIn checkHouseholdNumPortIn;
private final AutoSchedulesPortIn autoSchedulesPortIn;
@Override @Override
@Transactional
public void operate(CreateHouseholdInCmd inCmd) { public void operate(CreateHouseholdInCmd inCmd) {
// 임가번호 중복체크 // 임가번호 중복체크
@@ -34,28 +40,40 @@ class CreateHouseholdService implements CreateHouseholdPortIn {
}); });
} }
portOut.operate(new CreateHouseholdOutCmd( // 임가 등록
null, try {
inCmd.getHouseholdNum(), portOut.operate(new CreateHouseholdOutCmd(
inCmd.getOwnerName(), null,
inCmd.getOwnerAge(), inCmd.getHouseholdNum(),
(!StringUtils.hasText(inCmd.getTel2()) || !StringUtils.hasText(inCmd.getTel3())) inCmd.getOwnerName(),
? null inCmd.getOwnerAge(),
: inCmd.getTel1() + "-" + inCmd.getTel2() + "-" + inCmd.getTel3(), (!StringUtils.hasText(inCmd.getTel2()) || !StringUtils.hasText(inCmd.getTel3()))
inCmd.getPhone1() + "-" + inCmd.getPhone2() + "-" + inCmd.getPhone3(), ? null
passwordEncoder.encode(inCmd.getPhone3()), // 비밀번호 핸드폰 뒤 네자리 : inCmd.getTel1() + "-" + inCmd.getTel2() + "-" + inCmd.getTel3(),
inCmd.getRegionMainCode(), inCmd.getPhone1() + "-" + inCmd.getPhone2() + "-" + inCmd.getPhone3(),
inCmd.getRegionSubCode(), passwordEncoder.encode(inCmd.getPhone3()),
inCmd.getRegionDetailCode(), inCmd.getRegionMainCode(),
inCmd.getAddress(), inCmd.getRegionSubCode(),
inCmd.getIndustryLargeCode(), inCmd.getRegionDetailCode(),
inCmd.getIndustryMiddleCode(), inCmd.getAddress(),
inCmd.getIndustrySubMiddle(), inCmd.getIndustryLargeCode(),
inCmd.getIndustryDetail(), inCmd.getIndustryMiddleCode(),
inCmd.getResearcherSeq(), inCmd.getIndustrySubMiddle(),
inCmd.getIsPanel(), inCmd.getIndustryDetail(),
inCmd.getMemo(), inCmd.getResearcherSeq(),
List.of("ROLE_GENERAL") 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 String industryDetail;
private Long researcherSeq; private Long researcherSeq;
private Boolean isPanel; private Boolean isPanel;
private String usageType;
private String employmentType;
private String memo; private String memo;
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -31,6 +31,12 @@
industry_detail = #{industryDetail}, industry_detail = #{industryDetail},
</if> </if>
is_panel = #{isPanel}, 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 != ''"> <if test="memo != null and memo != ''">
memo = #{memo}, memo = #{memo},
</if> </if>

View File

@@ -205,27 +205,79 @@
</button> </button>
</div> </div>
</td> </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>
<tr> <tr>
<th>유지 여부</th> <th>구분</th>
<td class="radio-group"> <td class="radio-group">
<div class="component-input"> <div class="component-input">
<label class="radio-inner"> <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-item">
<span class="radio-txt">유지</span> <span class="radio-txt">모바일</span>
</span> </span>
</label> </label>
</div> </div>
<div class="component-input"> <div class="component-input">
<label class="radio-inner"> <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-item">
<span class="radio-txt">탈락</span> <span class="radio-txt">지류</span>
</span> </span>
</label> </label>
</div> </div>
</td> </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>
<tr> <tr>
<th>비고</th> <th>비고</th>

View File

@@ -224,29 +224,86 @@
</button> </button>
</div> </div>
</td> </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>
<tr> <tr>
<th>유지 여부</th> <th>구분</th>
<td class="radio-group"> <td class="radio-group">
<div class="component-input"> <div class="component-input">
<label class="radio-inner"> <label class="radio-inner">
<input type="radio" id="isPanel_Y" name="isPanel" value="true" <input type="radio" id="usageType_MOBILE" name="usageType" value="MOBILE"
th:checked="${householdInfo.isPanel == true}"> th:checked="${householdInfo.usageType == 'MOBILE'}">
<span class="radio-item"> <span class="radio-item">
<span class="radio-txt">유지</span> <span class="radio-txt">모바일</span>
</span> </span>
</label> </label>
</div> </div>
<div class="component-input"> <div class="component-input">
<label class="radio-inner"> <label class="radio-inner">
<input type="radio" id="isPanel_N" name="isPanel" value="false" <input type="radio" id="usageType_PAPER" name="usageType" value="PAPER"
th:checked="${householdInfo.isPanel == false}"> th:checked="${householdInfo.usageType == 'PAPER'}">
<span class="radio-item"> <span class="radio-item">
<span class="radio-txt">탈락</span> <span class="radio-txt">지류</span>
</span> </span>
</label> </label>
</div> </div>
</td> </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>
<tr> <tr>
<th>비고</th> <th>비고</th>

View File

@@ -43,8 +43,9 @@ SELECT
h.industry_sub_middle, h.industry_sub_middle,
h.industry_detail, h.industry_detail,
h.is_panel, h.is_panel,
h.memo, h.usage_type,
h.usage_type h.employment_type,
h.memo
FROM household h FROM household h
LEFT JOIN uicode main ON h.region_main_code = main.id LEFT JOIN uicode main ON h.region_main_code = main.id
LEFT JOIN v_uicode_view_name sub ON h.region_sub_code = sub.id LEFT JOIN v_uicode_view_name sub ON h.region_sub_code = sub.id