Merge branch 'susu' into dev
This commit is contained in:
@@ -43,7 +43,9 @@ class GetHouseholdsStatusController {
|
|||||||
reqVO.getResearcherValue(),
|
reqVO.getResearcherValue(),
|
||||||
reqVO.getIsPanel(),
|
reqVO.getIsPanel(),
|
||||||
reqVO.getUserRole(),
|
reqVO.getUserRole(),
|
||||||
reqVO.getUserRegionMainCode()
|
reqVO.getUserRegionMainCode(),
|
||||||
|
null,
|
||||||
|
null
|
||||||
))
|
))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,5 +27,6 @@ public class GetHouseholdsStatus {
|
|||||||
private Boolean isGiftSent;
|
private Boolean isGiftSent;
|
||||||
private String researcherName;
|
private String researcherName;
|
||||||
private String researcherPhone;
|
private String researcherPhone;
|
||||||
|
private String view;
|
||||||
private Integer total;
|
private Integer total;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package app.module.admin.usecase.household.getHouseholdsStatus.ports.application.domain;
|
package app.module.admin.usecase.household.getHouseholdsStatus.ports.application.domain;
|
||||||
|
|
||||||
|
import app.module.admin.usecase.researcher.web.model.HouseholdSearchReqVO;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
@@ -45,8 +46,17 @@ public class GetHouseholdsStatusCmd {
|
|||||||
// 로그인한 유저 실사 지역
|
// 로그인한 유저 실사 지역
|
||||||
private String userRegionMainCode;
|
private String userRegionMainCode;
|
||||||
|
|
||||||
public GetHouseholdsStatusCmd(String searchRegionMainCode) {
|
private Boolean isMapping;
|
||||||
this.regionMainCode = searchRegionMainCode;
|
private String viewType;
|
||||||
|
public GetHouseholdsStatusCmd(HouseholdSearchReqVO reqVO) {
|
||||||
|
this.ownerField = reqVO.getOwnerField();
|
||||||
|
this.ownerValue = reqVO.getOwnerValue();
|
||||||
|
this.regionMainCode = reqVO.getRegionMainCode();
|
||||||
|
this.regionSubCode = reqVO.getRegionSubCode();
|
||||||
|
this.regionDetailCode = reqVO.getRegionDetailCode();
|
||||||
|
this.isPanel = reqVO.getIsPanel();
|
||||||
|
this.isMapping = reqVO.getIsMapping();
|
||||||
|
this.viewType = "popup";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ public class ResearchersDto {
|
|||||||
private String id;
|
private String id;
|
||||||
private String name;
|
private String name;
|
||||||
private String phone;
|
private String phone;
|
||||||
|
private String regionMainCode;
|
||||||
private String regionMainCodeName;
|
private String regionMainCodeName;
|
||||||
private Integer householdCount;
|
private Integer householdCount;
|
||||||
private String accountDisabledFlag;
|
private String accountDisabledFlag;
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import app.module.admin.usecase.household.getHouseholdsStatus.ports.application.
|
|||||||
import app.module.admin.usecase.researcher.persistence.model.ResearchersDto;
|
import app.module.admin.usecase.researcher.persistence.model.ResearchersDto;
|
||||||
import app.module.admin.usecase.researcher.persistence.model.ResearchersHouseholdVisitDto;
|
import app.module.admin.usecase.researcher.persistence.model.ResearchersHouseholdVisitDto;
|
||||||
import app.module.admin.usecase.researcher.persistence.model.ResearchersMappingHouseholdDto;
|
import app.module.admin.usecase.researcher.persistence.model.ResearchersMappingHouseholdDto;
|
||||||
|
import app.module.admin.usecase.researcher.web.model.HouseholdSearchReqVO;
|
||||||
import app.module.admin.usecase.researcher.web.model.MappingHouseholdListUIReqVO;
|
import app.module.admin.usecase.researcher.web.model.MappingHouseholdListUIReqVO;
|
||||||
import app.module.admin.usecase.researcher.web.model.ResearchersDetailReqVO;
|
import app.module.admin.usecase.researcher.web.model.ResearchersDetailReqVO;
|
||||||
import app.module.admin.usecase.researcher.web.model.ResearchersListReqVO;
|
import app.module.admin.usecase.researcher.web.model.ResearchersListReqVO;
|
||||||
@@ -18,5 +19,5 @@ public interface ResearcherService {
|
|||||||
Page<ResearchersMappingHouseholdDto> mappingHouseholdList(ResearchersDetailReqVO reqVO);
|
Page<ResearchersMappingHouseholdDto> mappingHouseholdList(ResearchersDetailReqVO reqVO);
|
||||||
Page<ResearchersHouseholdVisitDto> visitHouseholdList(ResearchersDetailReqVO reqVO);
|
Page<ResearchersHouseholdVisitDto> visitHouseholdList(ResearchersDetailReqVO reqVO);
|
||||||
Integer visitHouseholdDelete(List<Integer> selectIds);
|
Integer visitHouseholdDelete(List<Integer> selectIds);
|
||||||
Page<GetHouseholdsStatus> reginMainCodeHouseholdList(MappingHouseholdListUIReqVO reqVO);
|
Page<GetHouseholdsStatus> searchMappingHousehold(HouseholdSearchReqVO reqVO);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import app.module.admin.usecase.researcher.persistence.ResearcherMapper;
|
|||||||
import app.module.admin.usecase.researcher.persistence.model.ResearchersDto;
|
import app.module.admin.usecase.researcher.persistence.model.ResearchersDto;
|
||||||
import app.module.admin.usecase.researcher.persistence.model.ResearchersHouseholdVisitDto;
|
import app.module.admin.usecase.researcher.persistence.model.ResearchersHouseholdVisitDto;
|
||||||
import app.module.admin.usecase.researcher.persistence.model.ResearchersMappingHouseholdDto;
|
import app.module.admin.usecase.researcher.persistence.model.ResearchersMappingHouseholdDto;
|
||||||
|
import app.module.admin.usecase.researcher.web.model.HouseholdSearchReqVO;
|
||||||
import app.module.admin.usecase.researcher.web.model.MappingHouseholdListUIReqVO;
|
import app.module.admin.usecase.researcher.web.model.MappingHouseholdListUIReqVO;
|
||||||
import app.module.admin.usecase.researcher.web.model.ResearchersDetailReqVO;
|
import app.module.admin.usecase.researcher.web.model.ResearchersDetailReqVO;
|
||||||
import app.module.admin.usecase.researcher.web.model.ResearchersListReqVO;
|
import app.module.admin.usecase.researcher.web.model.ResearchersListReqVO;
|
||||||
@@ -67,11 +68,11 @@ public class ResearcherServiceImpl implements ResearcherService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Page<GetHouseholdsStatus> reginMainCodeHouseholdList(MappingHouseholdListUIReqVO reqVO) {
|
public Page<GetHouseholdsStatus> searchMappingHousehold(HouseholdSearchReqVO reqVO) {
|
||||||
Pageable pageable = PageRequest.of(reqVO.getPage() , reqVO.getSize());
|
Pageable pageable = PageRequest.of(reqVO.getPage() , reqVO.getSize());
|
||||||
|
|
||||||
List<GetHouseholdsStatus> householdsStatus = householdsStatusMapper.getHouseholdsStatus(pageable,
|
List<GetHouseholdsStatus> householdsStatus = householdsStatusMapper.getHouseholdsStatus(pageable,
|
||||||
new GetHouseholdsStatusCmd(reqVO.getSearchRegionMainCode()));
|
new GetHouseholdsStatusCmd(reqVO));
|
||||||
|
|
||||||
return new PageImpl<>(householdsStatus, pageable,
|
return new PageImpl<>(householdsStatus, pageable,
|
||||||
householdsStatus.isEmpty() ? 0 : householdsStatus.get(0).getTotal());
|
householdsStatus.isEmpty() ? 0 : householdsStatus.get(0).getTotal());
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import app.module.admin.usecase.researcher.service.ResearcherService;
|
|||||||
import app.module.admin.usecase.researcher.web.model.*;
|
import app.module.admin.usecase.researcher.web.model.*;
|
||||||
import app.module.core.usecase.uicode.list.ports.UICodeListPortIn;
|
import app.module.core.usecase.uicode.list.ports.UICodeListPortIn;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
@@ -13,6 +14,7 @@ import org.springframework.web.bind.annotation.*;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
@Controller
|
@Controller
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@RequestMapping(path = "/researcher")
|
@RequestMapping(path = "/researcher")
|
||||||
@@ -37,6 +39,13 @@ class ResearcherController {
|
|||||||
model.addAttribute("researcherDto", researcherService.detail(adminSeq));
|
model.addAttribute("researcherDto", researcherService.detail(adminSeq));
|
||||||
model.addAttribute("monthList", DateUiUtil.getRecentMonths(13));
|
model.addAttribute("monthList", DateUiUtil.getRecentMonths(13));
|
||||||
model.addAttribute("currentMonth", DateUiUtil.getCurrentMonthValue());
|
model.addAttribute("currentMonth", DateUiUtil.getCurrentMonthValue());
|
||||||
|
|
||||||
|
//모달용
|
||||||
|
// 지역
|
||||||
|
model.addAttribute("regionSubList", uiCodeListPortIn.connect("code.region.sub"));
|
||||||
|
// 세부지역
|
||||||
|
model.addAttribute("regionDetailList", uiCodeListPortIn.connect("code.region.detail"));
|
||||||
|
|
||||||
return "researcher/detail";
|
return "researcher/detail";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -45,13 +54,6 @@ class ResearcherController {
|
|||||||
return ResponseEntity.status(HttpStatus.OK).body(researcherService.mappingHouseholdList(reqVO));
|
return ResponseEntity.status(HttpStatus.OK).body(researcherService.mappingHouseholdList(reqVO));
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping(path = "/mappingHousehold/list")
|
|
||||||
String mappingHouseholdResearcherList(Model model, @ModelAttribute("reqVO") MappingHouseholdListUIReqVO reqVO) {
|
|
||||||
model.addAttribute("householdDto", researcherService.reginMainCodeHouseholdList(reqVO));
|
|
||||||
return "researcher/mappingHouserhold";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@GetMapping(path = "/visitHouseholdList")
|
@GetMapping(path = "/visitHouseholdList")
|
||||||
ResponseEntity<?> visitHouseholdList( @ModelAttribute ResearchersDetailReqVO reqVO) {
|
ResponseEntity<?> visitHouseholdList( @ModelAttribute ResearchersDetailReqVO reqVO) {
|
||||||
return ResponseEntity.status(HttpStatus.OK).body(researcherService.visitHouseholdList(reqVO));
|
return ResponseEntity.status(HttpStatus.OK).body(researcherService.visitHouseholdList(reqVO));
|
||||||
@@ -62,5 +64,15 @@ class ResearcherController {
|
|||||||
return ResponseEntity.status(HttpStatus.OK).body(researcherService.visitHouseholdDelete(selectIds));
|
return ResponseEntity.status(HttpStatus.OK).body(researcherService.visitHouseholdDelete(selectIds));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/mappingHousehold/search")
|
||||||
|
ResponseEntity<?> searchMappingHousehold(HouseholdSearchReqVO reqVO) {
|
||||||
|
return ResponseEntity.status(HttpStatus.OK).body(researcherService.searchMappingHousehold(reqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/surveyor/register")
|
||||||
|
@ResponseBody
|
||||||
|
public String registerSurveyor(@RequestParam("surveyorId") String surveyorId) {
|
||||||
|
//surveyorService.registerSurveyor(surveyorId);
|
||||||
|
return "success";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
package app.module.admin.usecase.researcher.web.model;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class HouseholdSearchReqVO {
|
||||||
|
private Integer page;
|
||||||
|
private Integer size;
|
||||||
|
private String ownerField;
|
||||||
|
private String ownerValue;
|
||||||
|
private String regionMainCode;
|
||||||
|
private String regionSubCode;
|
||||||
|
private String regionDetailCode;
|
||||||
|
private Boolean isPanel;
|
||||||
|
private Boolean isMapping;
|
||||||
|
public Integer getPage() {
|
||||||
|
// 요청 페이지 넘버 - 초기값 `0`
|
||||||
|
return page != null ? page : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getSize() {
|
||||||
|
// 페이지 당 아이템 수 - 초기값 `10`
|
||||||
|
return size != null ? size : 10;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -7,21 +7,22 @@
|
|||||||
<select id="getHouseholdsStatus"
|
<select id="getHouseholdsStatus"
|
||||||
resultType="app.module.admin.usecase.household.getHouseholdsStatus.ports.application.domain.GetHouseholdsStatus">
|
resultType="app.module.admin.usecase.household.getHouseholdsStatus.ports.application.domain.GetHouseholdsStatus">
|
||||||
/* getHouseholdsStatus : 임가현황 리스트 조회 */
|
/* getHouseholdsStatus : 임가현황 리스트 조회 */
|
||||||
WITH record_progress AS (
|
<if test="!(cmd.viewType eq 'popup')">
|
||||||
SELECT ROUND(
|
WITH record_progress AS (
|
||||||
100.0 *
|
SELECT ROUND(
|
||||||
(SELECT COUNT(*)
|
100.0 *
|
||||||
FROM daily_record
|
|
||||||
WHERE record_month = #{cmd.recordMonth} AND all_status = 'DONE')
|
|
||||||
/ NULLIF(
|
|
||||||
(SELECT COUNT(*)
|
(SELECT COUNT(*)
|
||||||
FROM daily_day_group
|
FROM daily_record
|
||||||
WHERE end_day <= EXTRACT(DAY FROM CURRENT_DATE)), 0
|
WHERE record_month = #{cmd.recordMonth} AND all_status = 'DONE')
|
||||||
),
|
/ NULLIF(
|
||||||
2
|
(SELECT COUNT(*)
|
||||||
) AS progress_percent
|
FROM daily_day_group
|
||||||
) /* 일계부 입력 진행 완료 퍼센테이지 (이번달 작성 완료일 수 / 현재날짜 기준 전체 입력 가능 날짜 수) */
|
WHERE end_day <= EXTRACT(DAY FROM CURRENT_DATE)), 0
|
||||||
|
),
|
||||||
|
2
|
||||||
|
) AS progress_percent
|
||||||
|
) /* 일계부 입력 진행 완료 퍼센테이지 (이번달 작성 완료일 수 / 현재날짜 기준 전체 입력 가능 날짜 수) */
|
||||||
|
</if>
|
||||||
SELECT
|
SELECT
|
||||||
hvr.*,
|
hvr.*,
|
||||||
COUNT(*) OVER () AS total
|
COUNT(*) OVER () AS total
|
||||||
@@ -42,7 +43,12 @@
|
|||||||
h.industry_middle_code as industryMiddleCode,
|
h.industry_middle_code as industryMiddleCode,
|
||||||
h.industry_middle_name AS industryMiddleName,
|
h.industry_middle_name AS industryMiddleName,
|
||||||
h.is_panel AS isPanel,
|
h.is_panel AS isPanel,
|
||||||
|
<if test="!(cmd.viewType eq 'popup')">
|
||||||
ps.progress_percent AS progressPercent,
|
ps.progress_percent AS progressPercent,
|
||||||
|
</if>
|
||||||
|
<if test="cmd.viewType eq 'popup'">
|
||||||
|
0 AS progressPercent,
|
||||||
|
</if>
|
||||||
v.first_visit_date AS firstVisitDate,
|
v.first_visit_date AS firstVisitDate,
|
||||||
v.second_visit_date AS secondVisitDate,
|
v.second_visit_date AS secondVisitDate,
|
||||||
COALESCE(v.is_gift_sent, false) AS isGiftSent,
|
COALESCE(v.is_gift_sent, false) AS isGiftSent,
|
||||||
@@ -51,7 +57,9 @@
|
|||||||
FROM v_household_with_code h
|
FROM v_household_with_code h
|
||||||
LEFT JOIN v_household_visit v ON h.seq = v.household_seq
|
LEFT JOIN v_household_visit v ON h.seq = v.household_seq
|
||||||
LEFT JOIN v_household_researcher r ON h.seq = r.household_seq
|
LEFT JOIN v_household_researcher r ON h.seq = r.household_seq
|
||||||
|
<if test="!(cmd.viewType eq 'popup')">
|
||||||
CROSS JOIN record_progress ps
|
CROSS JOIN record_progress ps
|
||||||
|
</if>
|
||||||
) AS hvr
|
) AS hvr
|
||||||
|
|
||||||
<where>
|
<where>
|
||||||
@@ -178,6 +186,18 @@
|
|||||||
</when>
|
</when>
|
||||||
</choose>
|
</choose>
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
|
<if test="cmd.isMapping != null">
|
||||||
|
/* 패널 유지 여부 */
|
||||||
|
<choose>
|
||||||
|
<when test="cmd.isMapping">
|
||||||
|
AND r.researcher_name is not null
|
||||||
|
</when>
|
||||||
|
<when test="!cmd.isMapping">
|
||||||
|
AND r.researcher_name is null
|
||||||
|
</when>
|
||||||
|
</choose>
|
||||||
|
</if>
|
||||||
</where>
|
</where>
|
||||||
|
|
||||||
ORDER BY hvr.householdNum ASC
|
ORDER BY hvr.householdNum ASC
|
||||||
|
|||||||
@@ -58,6 +58,7 @@
|
|||||||
a.id,
|
a.id,
|
||||||
a.name,
|
a.name,
|
||||||
a.phone,
|
a.phone,
|
||||||
|
a.region_main_code,
|
||||||
u.code_text AS region_main_code_name,
|
u.code_text AS region_main_code_name,
|
||||||
case a.account_disabled when false then '사용' when true then '미사용' end account_disabled_flag
|
case a.account_disabled when false then '사용' when true then '미사용' end account_disabled_flag
|
||||||
from admin a
|
from admin a
|
||||||
|
|||||||
@@ -0,0 +1,250 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" xmlns:th="http://www.thymeleaf.org"
|
||||||
|
layout:decorate="~{layout/layout}">
|
||||||
|
|
||||||
|
<div class="layer-wrap" th:fragment="modalFragment">
|
||||||
|
<div class="component-modal modal01" id="mappingHouseholdModal" data-props-dimm-click="true" data-state="close">
|
||||||
|
<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">
|
||||||
|
<div class="modal-content-inner">
|
||||||
|
<section class="filter-wrap">
|
||||||
|
<div class="form-area">
|
||||||
|
<form autocomplete="off" method="get" name="reqHouseholdForm" id="reqHouseholdForm">
|
||||||
|
<input name="page" th:field="*{reqVO.page}" type="hidden"/>
|
||||||
|
<input type="hidden" name="regionMainCode" th:value="${regionMainCode}">
|
||||||
|
<!-- 경영주 -->
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-label">
|
||||||
|
<p class="label-txt">경영주</p>
|
||||||
|
</div>
|
||||||
|
<div class="d-flex">
|
||||||
|
<div class="component-select">
|
||||||
|
<select class="select-list" id="ownerField" name="ownerField">
|
||||||
|
<option value="all" selected>전체</option>
|
||||||
|
<option value="ownerName">이름</option>
|
||||||
|
<option value="phone">전화번호</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="component-input">
|
||||||
|
<div class="input-field">
|
||||||
|
<input type="text" id="ownerValue" name="ownerValue" placeholder="입력" th:value="${ownerValue}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 지역 -->
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="d-flex">
|
||||||
|
<div class="component-select">
|
||||||
|
<div class="input-label">
|
||||||
|
<p class="label-txt">지역</p>
|
||||||
|
</div>
|
||||||
|
<select class="select-list" id="regionSubCode" name="regionSubCode">
|
||||||
|
<option value="" selected>전체</option>
|
||||||
|
<option th:each="region : ${regionSubList}" th:value="${region.id}" th:text="${region.codeText}"></option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="component-select">
|
||||||
|
<div class="input-label">
|
||||||
|
<p class="label-txt">세부지역</p>
|
||||||
|
</div>
|
||||||
|
<select class="select-list" id="regionDetailCode" name="regionDetailCode">
|
||||||
|
<option value="" selected>전체</option>
|
||||||
|
<option th:each="subRegion : ${regionDetailList}" th:value="${subRegion.id}" th:text="${subRegion.codeText}"></option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 패널 유지 여부 및 맵핑 여부 -->
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="d-flex">
|
||||||
|
<div class="component-select">
|
||||||
|
<div class="input-label">
|
||||||
|
<p class="label-txt">패널유지여부</p>
|
||||||
|
</div>
|
||||||
|
<select class="select-list" id="isPanel" name="isPanel">
|
||||||
|
<option value="" selected>전체</option>
|
||||||
|
<option value="true">유지</option>
|
||||||
|
<option value="false">탈락</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="component-select">
|
||||||
|
<div class="input-label">
|
||||||
|
<p class="label-txt">맵핑여부</p>
|
||||||
|
</div>
|
||||||
|
<select class="select-list" id="isMapping" name="isMapping">
|
||||||
|
<option value="" selected>전체</option>
|
||||||
|
<option value="true">맵핑 완료</option>
|
||||||
|
<option value="false">맵핑 없음</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<div class="component-btns">
|
||||||
|
<div class="btns-row">
|
||||||
|
<button type="button" class="btn" onclick="resetSearchForm()">
|
||||||
|
<span class="btn-txt">초기화</span>
|
||||||
|
</button>
|
||||||
|
<button type="button" class="btn btn-primary" onclick="searchHouseholdList()">
|
||||||
|
<span class="btn-txt">검색</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section>
|
||||||
|
<p class="input-label" style="font-size: 16px;">
|
||||||
|
총 <span id="mappingHouseholdTotalElements"></span>건
|
||||||
|
</p>
|
||||||
|
<table id="householdTable">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>선택</th>
|
||||||
|
<th>임가번호</th>
|
||||||
|
<th>경영주명</th>
|
||||||
|
<th>휴대폰번호</th>
|
||||||
|
<th>실사</th>
|
||||||
|
<th>지역</th>
|
||||||
|
<th>세부지역</th>
|
||||||
|
<th>조사원</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody id="mappingHousehold-list"></tbody>
|
||||||
|
</table>
|
||||||
|
<!-- 페이지네이션 -->
|
||||||
|
<div class="row paging"></div>
|
||||||
|
|
||||||
|
<!-- 등록 버튼 -->
|
||||||
|
<div class="component-btns bottom-btn-group" th:fragment="modalButtons">
|
||||||
|
<div class="btns-row align-right">
|
||||||
|
<button type="button" class="btn btn-primary" onclick="registerHouseholds()">
|
||||||
|
<span class="btn-txt">등록</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
<button class="modal-close" onclick="closeModal()"></button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script th:inline="javascript">
|
||||||
|
const showHouseholdModal = (button) => {
|
||||||
|
// 버튼의 data-region-main-code 속성에서 regionMainCode 가져오기
|
||||||
|
const regionMainCode = button.getAttribute('data-region-main-code') || '';
|
||||||
|
const existingModal = document.querySelector("#mappingHouseholdModal");
|
||||||
|
if (existingModal) {
|
||||||
|
existingModal.remove();
|
||||||
|
}
|
||||||
|
|
||||||
|
document.querySelector(".modal01").ui.open();
|
||||||
|
|
||||||
|
// 초기 데이터 조회
|
||||||
|
searchHouseholdList(0,regionMainCode);
|
||||||
|
};
|
||||||
|
|
||||||
|
const resetSearchForm = () => {
|
||||||
|
const form = document.getElementById('reqHouseholdForm');
|
||||||
|
form.reset();
|
||||||
|
$('#ownerField').val('all');
|
||||||
|
$('#regionSubCode').val('all');
|
||||||
|
$('#regionDetailCode').val('all');
|
||||||
|
$('#isPanel').val('all');
|
||||||
|
$('#searchMapping').val('all');
|
||||||
|
$('#ownerValue').val('');
|
||||||
|
};
|
||||||
|
|
||||||
|
const searchHouseholdList = (pageNo,regionMainCode) => {
|
||||||
|
const f = document.reqHouseholdForm;
|
||||||
|
f.page.value = pageNo;
|
||||||
|
f.regionMainCode.value = regionMainCode;
|
||||||
|
let dataOj = $(f).serializeObject();
|
||||||
|
ajaxUtil._ajaxMethod(
|
||||||
|
'/researcher/mappingHousehold/search',
|
||||||
|
dataOj,
|
||||||
|
function (response) {
|
||||||
|
$('#mappingHouseholdTotalElements').text(response.totalElements);
|
||||||
|
|
||||||
|
// List 구성하기
|
||||||
|
const tbody = $('#mappingHousehold-list');
|
||||||
|
tbody.empty();
|
||||||
|
|
||||||
|
$(response.content).each((idx, ct) => {
|
||||||
|
tbody.append(
|
||||||
|
`
|
||||||
|
<tr data-id="${ct.id}">
|
||||||
|
<td>
|
||||||
|
<label>
|
||||||
|
<input class="form-check-input" name="selectIds" type="checkbox" value="${ct.seq}"/>
|
||||||
|
</label>
|
||||||
|
</td>
|
||||||
|
<td>${ct.householdNum}</td>
|
||||||
|
<td>${ct.householdName}</td>
|
||||||
|
<td>${ct.householdPhone}</td>
|
||||||
|
<td>${ct.regionMainName}</td>
|
||||||
|
<td>${ct.regionSubName}</td>
|
||||||
|
<td>${ct.regionDetailName}</td>
|
||||||
|
<td>${ct.researcherName}</td>
|
||||||
|
</tr>
|
||||||
|
`);
|
||||||
|
});
|
||||||
|
// Pagination 구성하기
|
||||||
|
const paging = $('.paging');
|
||||||
|
paging.empty();
|
||||||
|
paging.append(
|
||||||
|
uiUtil.getPagingUI(pageNo, response.size, response.totalPages,
|
||||||
|
(movePageNo) => {
|
||||||
|
f.page.value = movePageNo;
|
||||||
|
searchHouseholdList(movePageNo,regionMainCode);
|
||||||
|
}));
|
||||||
|
},
|
||||||
|
function (code, rstData) {
|
||||||
|
alert('임가 조회에 실패했습니다.');
|
||||||
|
},
|
||||||
|
'get',
|
||||||
|
'json',
|
||||||
|
null
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const registerHouseholds = () => {
|
||||||
|
const selectedIds = [];
|
||||||
|
$('input[name="householdSelect"]:checked').each(function () {
|
||||||
|
selectedIds.push($(this).val());
|
||||||
|
});
|
||||||
|
|
||||||
|
if (selectedIds.length === 0) {
|
||||||
|
alert('선택된 임가가 없습니다.');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ajaxUtil._ajaxMethod(
|
||||||
|
'/researcher/mappingHousehold/search',
|
||||||
|
{ regionMainCode: regionMainCode },
|
||||||
|
function (response) {
|
||||||
|
$("#mappingHouseholdModal").append(response);
|
||||||
|
// 모달 표시
|
||||||
|
|
||||||
|
},
|
||||||
|
function (code, rstData) {
|
||||||
|
alert('임가 등록에 실패했습니다.');
|
||||||
|
},
|
||||||
|
'get',
|
||||||
|
'json',
|
||||||
|
null
|
||||||
|
);
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
</div>
|
||||||
|
</html>
|
||||||
@@ -56,17 +56,14 @@
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<p class="input-label" style="font-size: 16px;">
|
||||||
<div class="col text-start">
|
총 <span id="household-totalElements"></span>건
|
||||||
<div class="fw-bolder text-muted">
|
</p>
|
||||||
TOTAL. <span id="household-totalElements"></span>
|
|
||||||
</div>
|
<div id="researcher-tab1" >
|
||||||
</div>
|
<button type="button" class="btn" th:data-region-main-code="${researcherDto.regionMainCode}" onclick="showHouseholdModal(this)">
|
||||||
<div id="researcher-tab1" style="display: none;">
|
<span class="btn-txt">임가매핑</span>
|
||||||
<button type="button" class="btn" onclick="location.href='/researcher/researchers'">
|
</button>
|
||||||
<span class="btn-txt">임가매핑</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- hidden parameters -->
|
<!-- hidden parameters -->
|
||||||
@@ -147,9 +144,11 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
<div th:replace="common/modal-household-mapping:: modalFragment"></div>
|
||||||
</section>
|
</section>
|
||||||
<th:block layout:fragment="script">
|
<th:block layout:fragment="script">
|
||||||
<script th:inline="javascript">
|
<script th:inline="javascript">
|
||||||
|
|
||||||
// 탭 클릭 시 함수 호출
|
// 탭 클릭 시 함수 호출
|
||||||
document.addEventListener('DOMContentLoaded', function () {
|
document.addEventListener('DOMContentLoaded', function () {
|
||||||
const tabButtons = document.querySelectorAll('.tab-label');
|
const tabButtons = document.querySelectorAll('.tab-label');
|
||||||
@@ -157,7 +156,7 @@
|
|||||||
button.addEventListener('click', function () {
|
button.addEventListener('click', function () {
|
||||||
const tabValue = this.getAttribute('data-tab-value');
|
const tabValue = this.getAttribute('data-tab-value');
|
||||||
const form = document.householdReqForm;
|
const form = document.householdReqForm;
|
||||||
form.page.value = 1; // 페이지 초기화
|
form.page.value = 0; // 페이지 초기화
|
||||||
document.getElementById('monthTab2').style.display = 'block';
|
document.getElementById('monthTab2').style.display = 'block';
|
||||||
if (tabValue === 'tab1') {
|
if (tabValue === 'tab1') {
|
||||||
getHouseholdList(0);
|
getHouseholdList(0);
|
||||||
@@ -193,7 +192,7 @@
|
|||||||
$(response.content).each((idx, ct) => {
|
$(response.content).each((idx, ct) => {
|
||||||
tbody.append(
|
tbody.append(
|
||||||
`
|
`
|
||||||
<tr data-id="${ct.id}">
|
<tr data-id="${ct.seq}">
|
||||||
<td class="underline"><a href="">${ct.householdNum}</a></td>
|
<td class="underline"><a href="">${ct.householdNum}</a></td>
|
||||||
<td>${ct.ownerName}</td>
|
<td>${ct.ownerName}</td>
|
||||||
<td>${ct.phone}</td>
|
<td>${ct.phone}</td>
|
||||||
@@ -221,10 +220,10 @@
|
|||||||
const paging = $('.paging');
|
const paging = $('.paging');
|
||||||
paging.empty();
|
paging.empty();
|
||||||
paging.append(
|
paging.append(
|
||||||
uiUtil.getPagingUI(pageNo, f.size.value, response.totalPages,
|
uiUtil.getPagingUI(pageNo, response.size, response.totalPages,
|
||||||
(movePageNo) => {
|
(movePageNo) => {
|
||||||
f.page.value = movePageNo;
|
f.page.value = movePageNo;
|
||||||
goSearch();
|
getHouseholdList(movePageNo);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
},
|
},
|
||||||
@@ -237,6 +236,7 @@
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 임가 방문 정보
|
// 임가 방문 정보
|
||||||
const getHouseholdVisitList = (pageNo) => {
|
const getHouseholdVisitList = (pageNo) => {
|
||||||
const f = document.householdReqForm;
|
const f = document.householdReqForm;
|
||||||
@@ -244,7 +244,7 @@
|
|||||||
|
|
||||||
let dataObj = {
|
let dataObj = {
|
||||||
page: f.page.value,
|
page: f.page.value,
|
||||||
adminSeq: f.seq.value,
|
seq: f.seq.value,
|
||||||
searchMonth: f.searchMonth.value,
|
searchMonth: f.searchMonth.value,
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -264,7 +264,7 @@
|
|||||||
<tr data-id="${ct.id}">
|
<tr data-id="${ct.id}">
|
||||||
<td>
|
<td>
|
||||||
<label>
|
<label>
|
||||||
<input class="form-check-input" name="selectIds" type="checkbox" value="${ct.id}"/>
|
<input class="form-check-input" name="selectIds" type="checkbox" value="${ct.seq}"/>
|
||||||
</label>
|
</label>
|
||||||
</td>
|
</td>
|
||||||
<td class="underline"><a href="">${ct.householdNum}</a></td>
|
<td class="underline"><a href="">${ct.householdNum}</a></td>
|
||||||
@@ -291,10 +291,10 @@
|
|||||||
const paging = $('.paging');
|
const paging = $('.paging');
|
||||||
paging.empty();
|
paging.empty();
|
||||||
paging.append(
|
paging.append(
|
||||||
uiUtil.getPagingUI(pageNo, f.size.value, response.totalPages,
|
uiUtil.getPagingUI(pageNo,response.size, response.totalPages,
|
||||||
(movePageNo) => {
|
(movePageNo) => {
|
||||||
f.page.value = movePageNo;
|
f.page.value = movePageNo;
|
||||||
goSearch();
|
getHouseholdVisitList(movePageNo);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
},
|
},
|
||||||
@@ -359,6 +359,10 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
</th:block>
|
</th:block>
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,6 @@
|
|||||||
<section layout:fragment="content">
|
<section layout:fragment="content">
|
||||||
<form autocomplete="off" method="get" name="reqForm" th:action="@{/researcher/researchers}" th:object="${reqVO}">
|
<form autocomplete="off" method="get" name="reqForm" th:action="@{/researcher/researchers}" th:object="${reqVO}">
|
||||||
<section class="filter-wrap">
|
<section class="filter-wrap">
|
||||||
|
|
||||||
<div class="form-area">
|
<div class="form-area">
|
||||||
<!-- hidden parameters -->
|
<!-- hidden parameters -->
|
||||||
<input name="sort" th:field="*{sort}" type="hidden"/>
|
<input name="sort" th:field="*{sort}" type="hidden"/>
|
||||||
@@ -73,41 +72,36 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</form>
|
<section>
|
||||||
<div class="row">
|
<p class="input-label" style="font-size: 16px;">
|
||||||
<div class="col text-start">
|
총 <span id="totalElements"></span>건
|
||||||
<div class="fw-bolder text-muted">
|
</p>
|
||||||
TOTAL. <span id="totalElements"></span>
|
<table>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>이름</th>
|
||||||
|
<th>전화번호</th>
|
||||||
|
<th>실사지역</th>
|
||||||
|
<th>임가수</th>
|
||||||
|
<th>사용여부</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody id="listTBody">
|
||||||
|
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<div class="row paging"></div>
|
||||||
|
|
||||||
|
<div class="component-btns bottom-btn-group">
|
||||||
|
<div class="btns-row align-right">
|
||||||
|
<button type="button" class="btn" onclick="goExcel();">
|
||||||
|
<span class="btn-txt">엑셀 다운로드 <i class="ico-download ico-small" aria-hidden="true"></i></span>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</form>
|
||||||
<section>
|
|
||||||
<table>
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th>이름</th>
|
|
||||||
<th>전화번호</th>
|
|
||||||
<th>실사지역</th>
|
|
||||||
<th>임가수</th>
|
|
||||||
<th>사용여부</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody id="listTBody">
|
|
||||||
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<div class="row paging"></div>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="component-btns bottom-btn-group">
|
|
||||||
<div class="btns-row align-right">
|
|
||||||
<button type="button" class="btn" onclick="goExcel();">
|
|
||||||
<span class="btn-txt">엑셀 다운로드 <i class="ico-download ico-small" aria-hidden="true"></i></span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section layout:fragment="script">
|
<section layout:fragment="script">
|
||||||
@@ -154,10 +148,10 @@
|
|||||||
const paging = $('.paging');
|
const paging = $('.paging');
|
||||||
paging.empty();
|
paging.empty();
|
||||||
paging.append(
|
paging.append(
|
||||||
uiUtil.getPagingUI(pageNo, f.size.value, response.totalPages,
|
uiUtil.getPagingUI(pageNo, response.size, response.totalPages,
|
||||||
(movePageNo) => {
|
(movePageNo) => {
|
||||||
f.page.value = movePageNo;
|
f.page.value = movePageNo;
|
||||||
goSearch();
|
getResearchers(movePageNo);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user