조사원 현황 수정
This commit is contained in:
@@ -6,6 +6,7 @@ import app.module.admin.usecase.researcher.persistence.model.ResearchersMappingH
|
|||||||
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;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -19,5 +20,5 @@ public interface ResearcherMapper {
|
|||||||
Long mappingHouseholdListCountAll(ResearchersDetailReqVO reqVO);
|
Long mappingHouseholdListCountAll(ResearchersDetailReqVO reqVO);
|
||||||
List<ResearchersHouseholdVisitDto> visitHouseholdList(ResearchersDetailReqVO reqVO);
|
List<ResearchersHouseholdVisitDto> visitHouseholdList(ResearchersDetailReqVO reqVO);
|
||||||
Long visitHouseholdListCountAll(ResearchersDetailReqVO reqVO);
|
Long visitHouseholdListCountAll(ResearchersDetailReqVO reqVO);
|
||||||
|
Integer visitHouseholdDelete(@Param("selectIds") List<Integer> selectIds,@Param("deletedBy") String deletedBy);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ public class ResearchersHouseholdVisitDto {
|
|||||||
private String ownerName;
|
private String ownerName;
|
||||||
private String visitDate;
|
private String visitDate;
|
||||||
private String isGiftSentFlag;
|
private String isGiftSentFlag;
|
||||||
private String Memo;
|
private String memo;
|
||||||
private LocalDateTime createdAt;
|
private LocalDateTime createdAt;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,11 +7,13 @@ 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;
|
||||||
import org.springframework.data.domain.Page;
|
import org.springframework.data.domain.Page;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
public interface ResearcherService {
|
public interface ResearcherService {
|
||||||
Page<ResearchersDto> list(ResearchersListReqVO reqVO);
|
Page<ResearchersDto> list(ResearchersListReqVO reqVO);
|
||||||
ResearchersDto detail(Integer adminSeq);
|
ResearchersDto detail(Integer adminSeq);
|
||||||
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);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import app.module.admin.usecase.researcher.persistence.model.ResearchersHousehol
|
|||||||
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.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;
|
||||||
|
import app.module.core.config.application.util.CommonUtil;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.data.domain.Page;
|
import org.springframework.data.domain.Page;
|
||||||
@@ -53,4 +54,10 @@ public class ResearcherServiceImpl implements ResearcherService {
|
|||||||
long total = researcherMapper.visitHouseholdListCountAll(reqVO);
|
long total = researcherMapper.visitHouseholdListCountAll(reqVO);
|
||||||
return new PageImpl<>(result, pageable, total);
|
return new PageImpl<>(result, pageable, total);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer visitHouseholdDelete(List<Integer> selectIds) {
|
||||||
|
String deletedBy = CommonUtil.getLoginUsername();
|
||||||
|
return researcherMapper.visitHouseholdDelete(selectIds,deletedBy);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package app.module.admin.usecase.researcher.web;
|
package app.module.admin.usecase.researcher.web;
|
||||||
|
|
||||||
|
import app.module.admin.config.application.util.DateUiUtil;
|
||||||
import app.module.admin.usecase.researcher.service.ResearcherService;
|
import app.module.admin.usecase.researcher.service.ResearcherService;
|
||||||
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.ResearchersDetailUIReqVO;
|
import app.module.admin.usecase.researcher.web.model.ResearchersDetailUIReqVO;
|
||||||
@@ -10,11 +11,10 @@ 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;
|
||||||
import org.springframework.ui.Model;
|
import org.springframework.ui.Model;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
|
||||||
import app.module.admin.usecase.researcher.web.model.GetResearchersUIReqVO;
|
import app.module.admin.usecase.researcher.web.model.GetResearchersUIReqVO;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import java.util.List;
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@@ -35,19 +35,28 @@ class ResearcherController {
|
|||||||
return ResponseEntity.status(HttpStatus.OK).body(researcherService.list(reqVO));
|
return ResponseEntity.status(HttpStatus.OK).body(researcherService.list(reqVO));
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping(path = "/{seq}")
|
@GetMapping(path = "/{adminSeq}")
|
||||||
public String operateDetail(Model model, @PathVariable Integer seq, @ModelAttribute("reqVO") ResearchersDetailUIReqVO reqVO) {
|
public String operateDetail(Model model, @PathVariable Integer adminSeq, @ModelAttribute("reqVO") ResearchersDetailUIReqVO reqVO) {
|
||||||
model.addAttribute("researcherDto", researcherService.detail(seq));;
|
model.addAttribute("researcherDto", researcherService.detail(adminSeq));
|
||||||
|
model.addAttribute("monthList", DateUiUtil.getRecentMonths(13));
|
||||||
|
model.addAttribute("currentMonth", DateUiUtil.getCurrentMonthValue());
|
||||||
return "researcher/detail";
|
return "researcher/detail";
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping(path = "/mappingHouseholdList")
|
@GetMapping(path = "/mappingHouseholdList")
|
||||||
ResponseEntity<?> mappingHouseholdList( @ModelAttribute("reqVO") ResearchersDetailReqVO reqVO) {
|
ResponseEntity<?> mappingHouseholdList( @ModelAttribute ResearchersDetailReqVO reqVO) {
|
||||||
return ResponseEntity.status(HttpStatus.OK).body(researcherService.mappingHouseholdList(reqVO));
|
return ResponseEntity.status(HttpStatus.OK).body(researcherService.mappingHouseholdList(reqVO));
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping(path = "/visitHouseholdList")
|
@GetMapping(path = "/visitHouseholdList")
|
||||||
ResponseEntity<?> visitHouseholdList( @ModelAttribute("reqVO") 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));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@DeleteMapping(path = "/visitHousehold/remove")
|
||||||
|
ResponseEntity<?> visitHouseholdDelete( @RequestBody List<Integer> selectIds) {
|
||||||
|
return ResponseEntity.status(HttpStatus.OK).body(researcherService.visitHouseholdDelete(selectIds));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,19 +1,15 @@
|
|||||||
package app.module.admin.usecase.researcher.web.model;
|
package app.module.admin.usecase.researcher.web.model;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
@AllArgsConstructor
|
|
||||||
@EqualsAndHashCode
|
|
||||||
public class ResearchersDetailReqVO {
|
public class ResearchersDetailReqVO {
|
||||||
private Integer page;
|
private Integer page;
|
||||||
private Integer size;
|
private Integer size;
|
||||||
private Integer adminSeq;
|
private Integer seq;
|
||||||
private String searchMonthly;
|
private String searchMonth;
|
||||||
|
|
||||||
public Integer getPage() {
|
public Integer getPage() {
|
||||||
// 요청 페이지 넘버 - 초기값 `0`
|
// 요청 페이지 넘버 - 초기값 `0`
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
a.name,
|
a.name,
|
||||||
a.phone,
|
a.phone,
|
||||||
max(u.code_text) AS region_main_code_name,
|
max(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
|
||||||
join admin_has_role ahr ON a.seq = ahr.admin_seq
|
join admin_has_role ahr ON a.seq = ahr.admin_seq
|
||||||
left join uicode u ON u.parent_id = 'code.region.main' AND u.id = a.region_main_code
|
left join uicode u ON u.parent_id = 'code.region.main' AND u.id = a.region_main_code
|
||||||
@@ -25,6 +25,9 @@
|
|||||||
<if test="searchField == 'phone' and searchValue != null and searchValue != ''">
|
<if test="searchField == 'phone' and searchValue != null and searchValue != ''">
|
||||||
and a.phone LIKE CONCAT('%', #{searchValue}, '%')
|
and a.phone LIKE CONCAT('%', #{searchValue}, '%')
|
||||||
</if>
|
</if>
|
||||||
|
<if test="searchArea != null and searchArea != ''">
|
||||||
|
and a.region_main_code = #{searchArea}
|
||||||
|
</if>
|
||||||
<if test="searchAccountDisabled != null and searchAccountDisabled != ''">
|
<if test="searchAccountDisabled != null and searchAccountDisabled != ''">
|
||||||
and a.account_disabled = #{searchAccountDisabled}
|
and a.account_disabled = #{searchAccountDisabled}
|
||||||
</if>
|
</if>
|
||||||
@@ -56,7 +59,7 @@
|
|||||||
a.name,
|
a.name,
|
||||||
a.phone,
|
a.phone,
|
||||||
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
|
||||||
join admin_has_role ahr ON a.seq = ahr.admin_seq
|
join admin_has_role ahr ON a.seq = ahr.admin_seq
|
||||||
left join uicode u ON u.parent_id = 'code.region.main' AND u.id = a.region_main_code
|
left join uicode u ON u.parent_id = 'code.region.main' AND u.id = a.region_main_code
|
||||||
@@ -86,8 +89,8 @@
|
|||||||
left join uicode il ON il.parent_id = 'code.industry.large' AND il.id = h.industry_large_code
|
left join uicode il ON il.parent_id = 'code.industry.large' AND il.id = h.industry_large_code
|
||||||
left join uicode im ON im.parent_id = 'code.industry.middle' AND im.id = h.industry_middle_code
|
left join uicode im ON im.parent_id = 'code.industry.middle' AND im.id = h.industry_middle_code
|
||||||
where ahr.role_id = 'ROLE_RESEARCHER' and ahr.is_deleted = false
|
where ahr.role_id = 'ROLE_RESEARCHER' and ahr.is_deleted = false
|
||||||
<if test="adminSeq > 0">
|
<if test="seq > 0">
|
||||||
and a.seq = #{adminSeq}
|
and ahr.admin_seq = #{seq}
|
||||||
</if>
|
</if>
|
||||||
LIMIT #{size} OFFSET #{page}*#{size}
|
LIMIT #{size} OFFSET #{page}*#{size}
|
||||||
</select>
|
</select>
|
||||||
@@ -98,8 +101,8 @@
|
|||||||
from household h
|
from household h
|
||||||
join admin_has_role ahr ON h.seq = ahr.admin_seq
|
join admin_has_role ahr ON h.seq = ahr.admin_seq
|
||||||
where ahr.role_id = 'ROLE_RESEARCHER' and ahr.is_deleted = false
|
where ahr.role_id = 'ROLE_RESEARCHER' and ahr.is_deleted = false
|
||||||
<if test="adminSeq > 0">
|
<if test="seq > 0">
|
||||||
and a.admin_seq = #{adminSeq}
|
and ahr.admin_seq = #{seq}
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
@@ -108,7 +111,7 @@
|
|||||||
select
|
select
|
||||||
rhv.id,
|
rhv.id,
|
||||||
rhv.admin_seq,
|
rhv.admin_seq,
|
||||||
rhv.household_seq
|
rhv.household_seq,
|
||||||
h.household_num,
|
h.household_num,
|
||||||
h.owner_name,
|
h.owner_name,
|
||||||
rhv.visit_date,
|
rhv.visit_date,
|
||||||
@@ -119,8 +122,11 @@
|
|||||||
join household h on rhv.household_seq = h.seq
|
join household h on rhv.household_seq = h.seq
|
||||||
join admin a on a.seq = rhv.admin_seq
|
join admin a on a.seq = rhv.admin_seq
|
||||||
where rhv.is_deleted = false
|
where rhv.is_deleted = false
|
||||||
<if test="adminSeq > 0">
|
<if test="seq > 0">
|
||||||
and rhv.admin_seq = #{adminSeq}
|
and rhv.admin_seq = #{seq}
|
||||||
|
</if>
|
||||||
|
<if test="searchMonth != null and searchMonth != ''">
|
||||||
|
and TO_CHAR(rhv.visit_date ,'YYYYMM')= #{searchMonth}
|
||||||
</if>
|
</if>
|
||||||
LIMIT #{size} OFFSET #{page}*#{size}
|
LIMIT #{size} OFFSET #{page}*#{size}
|
||||||
</select>
|
</select>
|
||||||
@@ -129,9 +135,23 @@
|
|||||||
select count(*)
|
select count(*)
|
||||||
from researcher_household_visit rhv
|
from researcher_household_visit rhv
|
||||||
where rhv.is_deleted = false
|
where rhv.is_deleted = false
|
||||||
<if test="adminSeq > 0">
|
<if test="seq > 0">
|
||||||
and rhv.admin_seq = #{adminSeq}
|
and rhv.admin_seq = #{seq}
|
||||||
|
</if>
|
||||||
|
<if test="searchMonth != null and searchMonth != ''">
|
||||||
|
and TO_CHAR(rhv.visit_date ,'YYYYMM')= #{searchMonth}
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<update id="visitHouseholdDelete">
|
||||||
|
update researcher_household_visit
|
||||||
|
set is_deleted = true,
|
||||||
|
deleted_at = NOW(),
|
||||||
|
deleted_by = #{deletedBy}
|
||||||
|
where id in (
|
||||||
|
<foreach collection="selectIds" item="item" separator=",">
|
||||||
|
#{item}
|
||||||
|
</foreach>)
|
||||||
|
</update>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
<html layout:decorate="~{layout/layout}" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
|
<html layout:decorate="~{layout/layout}" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
|
||||||
xmlns:th="http://www.thymeleaf.org">
|
xmlns:th="http://www.thymeleaf.org">
|
||||||
|
|
||||||
<section layout:fragment="content">
|
<th layout:fragment="content">
|
||||||
<section>
|
<section>
|
||||||
<!-- 테이블 영역 -->
|
<!-- 테이블 영역 -->
|
||||||
<table class="type-form confirm" th:object="${researcherDto}" >
|
<table class="type-form confirm" th:object="${researcherDto}" >
|
||||||
@@ -42,10 +42,20 @@
|
|||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
<section>
|
<section>
|
||||||
|
<form autocomplete="off" method="get" name="householdReqForm" th:object="${reqVO}">
|
||||||
<div class="component-tab" data-active="tab1">
|
<div class="component-tab" data-active="tab1">
|
||||||
<div class="tab-head">
|
<div class="tab-head">
|
||||||
<button type="button" class="tab-label" data-tab-value="tab1">담당 임가 목록</button>
|
<button type="button" class="tab-label" data-tab-value="tab1">담당 임가 목록</button>
|
||||||
<button type="button" class="tab-label" data-tab-value="tab2">임가방문정보</button>
|
<button type="button" class="tab-label" data-tab-value="tab2">임가방문정보</button>
|
||||||
|
<div class="component-select select-date" id="monthTab2" style="display: none;">
|
||||||
|
<select name="searchMonth" class="select-list search-month-container" onchange="getHouseholdVisitList(0);">
|
||||||
|
<option th:each="month : ${monthList}"
|
||||||
|
th:value="${month.value}"
|
||||||
|
th:text="${month.label}"
|
||||||
|
th:selected="${month.value == currentMonth}">
|
||||||
|
</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col text-start">
|
<div class="col text-start">
|
||||||
@@ -55,27 +65,28 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<form autocomplete="off" method="get" name="householdReqForm" th:object="${reqVO}">
|
|
||||||
<!-- hidden parameters -->
|
<!-- hidden parameters -->
|
||||||
<input name="page" th:field="*{page}" type="hidden"/>
|
<input name="page" th:field="*{page}" type="hidden"/>
|
||||||
<input name="adminSeq" th:field="${researcherDto.seq}" type="hidden"/>
|
<input name="adminSeq" th:field="${researcherDto.seq}" type="hidden"/>
|
||||||
</form>
|
|
||||||
|
|
||||||
<div class="tab-body">
|
<div class="tab-body">
|
||||||
<div class="tab-content" data-tab-value="tab1">
|
<div class="tab-content" data-tab-value="tab1">
|
||||||
<div class="content-inner">
|
<div class="content-inner">
|
||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>임가번호</th>
|
<th>임가번호</th>
|
||||||
<th>경영주명</th>
|
<th>경영주명</th>
|
||||||
<th>휴대폰번호</th>
|
<th>휴대폰번호</th>
|
||||||
<th>실사</th>
|
<th>실사</th>
|
||||||
<th>지역</th>
|
<th>지역</th>
|
||||||
<th>세부지역</th>
|
<th>세부지역</th>
|
||||||
<th>업종 대분류</th>
|
<th>업종 대분류</th>
|
||||||
<th>업종 중분류1</th>
|
<th>업종 중분류1</th>
|
||||||
<th>유지여부</th>
|
<th>유지여부</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody id="household-list">
|
<tbody id="household-list">
|
||||||
</tbody>
|
</tbody>
|
||||||
@@ -84,29 +95,30 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="tab-content" data-tab-value="tab2">
|
<div class="tab-content" data-tab-value="tab2">
|
||||||
<div class="component-btns bottom-btn-group">
|
<div class="component-btns bottom-btn-group">
|
||||||
<div class="btns-row two-col">
|
<div class="btns-row">
|
||||||
|
|
||||||
<div class="btns-col-1 align-right">
|
<div class="btns-col-1 align-right">
|
||||||
<button type="button" class="btn" onClick="goRemove();">
|
<button type="button" class="btn" onClick="goRemove();">
|
||||||
<span class="btn-txt">삭제 <i class="ico-print" aria-hidden="true"></i></span>
|
<span class="btn-txt">삭제 <i class="ico-print" aria-hidden="true"></i></span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>-
|
</div>
|
||||||
<div class="content-inner">
|
<div class="content-inner">
|
||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>
|
<th>
|
||||||
<input class="form-check-input" onchange="toggleCheckbox(this);" type="checkbox"/>
|
<input onchange="toggleCheckbox(this);" type="checkbox"/>
|
||||||
</th>
|
</th>
|
||||||
<th>임가번호</th>
|
<th>임가번호</th>
|
||||||
<th>경영주명</th>
|
<th>경영주명</th>
|
||||||
<th>방문일</th>
|
<th>방문일</th>
|
||||||
<th>관리분야</th>
|
<th>관리분야</th>
|
||||||
<th>내용</th>
|
<th>내용</th>
|
||||||
<th>작성일</th>
|
<th>작성일</th>
|
||||||
<th>답례품 전달</th>
|
<th>답례품 전달</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody id="household-visit-list">
|
<tbody id="household-visit-list">
|
||||||
</tbody>
|
</tbody>
|
||||||
@@ -131,18 +143,39 @@
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>-
|
</div>
|
||||||
</section>
|
</form>
|
||||||
|
</section>
|
||||||
|
<th:block layout:fragment="script">
|
||||||
|
<script th:inline="javascript">
|
||||||
|
// 탭 클릭 시 함수 호출
|
||||||
|
document.addEventListener('DOMContentLoaded', function () {
|
||||||
|
const tabButtons = document.querySelectorAll('.tab-label');
|
||||||
|
tabButtons.forEach(button => {
|
||||||
|
button.addEventListener('click', function () {
|
||||||
|
const tabValue = this.getAttribute('data-tab-value');
|
||||||
|
const form = document.householdReqForm;
|
||||||
|
form.page.value = 1; // 페이지 초기화
|
||||||
|
document.getElementById('monthTab2').style.display = 'block';
|
||||||
|
if (tabValue === 'tab1') {
|
||||||
|
getHouseholdList(0);
|
||||||
|
} else if (tabValue === 'tab2') {
|
||||||
|
if (!form.searchMonth.value) {
|
||||||
|
form.searchMonth.value = '[[${currentMonth}]]'; // 기본값 복원
|
||||||
|
}
|
||||||
|
getHouseholdVisitList(0);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
// 초기 데이터 로드 (tab1)
|
||||||
|
getHouseholdList(document.householdReqForm.page.value);
|
||||||
|
});
|
||||||
|
|
||||||
<section layout:fragment="script">
|
|
||||||
<script>
|
|
||||||
// 담당 임가 목록
|
// 담당 임가 목록
|
||||||
const getHouseholdList = (pageNo) => {
|
const getHouseholdList = (pageNo) => {
|
||||||
const f = document.householdReqForm;
|
const f = document.householdReqForm;
|
||||||
f.page.value = pageNo;
|
f.page.value = pageNo;
|
||||||
|
|
||||||
let dataOj = $(f).serializeObject();
|
let dataOj = $(f).serializeObject();
|
||||||
|
|
||||||
ajaxUtil._ajaxMethod(
|
ajaxUtil._ajaxMethod(
|
||||||
'/researcher/mappingHouseholdList',
|
'/researcher/mappingHouseholdList',
|
||||||
dataOj,
|
dataOj,
|
||||||
@@ -153,6 +186,8 @@
|
|||||||
const tbody = $('#household-list');
|
const tbody = $('#household-list');
|
||||||
tbody.empty();
|
tbody.empty();
|
||||||
|
|
||||||
|
document.getElementById('monthTab2').style.display = 'none';
|
||||||
|
|
||||||
$(response.content).each((idx, ct) => {
|
$(response.content).each((idx, ct) => {
|
||||||
tbody.append(
|
tbody.append(
|
||||||
`
|
`
|
||||||
@@ -175,7 +210,7 @@
|
|||||||
if (!$(response.content).length) {
|
if (!$(response.content).length) {
|
||||||
tbody.append(`
|
tbody.append(`
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="10" class="text-center text-muted">담당임가정보가 존재하지 않습니다.</td>
|
<td colspan="9" class="text-center text-muted">담당임가정보가 존재하지 않습니다.</td>
|
||||||
</tr>
|
</tr>
|
||||||
`);
|
`);
|
||||||
}
|
}
|
||||||
@@ -192,7 +227,6 @@
|
|||||||
|
|
||||||
},
|
},
|
||||||
function (code, rstData) {
|
function (code, rstData) {
|
||||||
console.log("왜지 ");
|
|
||||||
|
|
||||||
},
|
},
|
||||||
'get',
|
'get',
|
||||||
@@ -200,22 +234,21 @@
|
|||||||
null
|
null
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
// 최초 리스트 로드
|
|
||||||
getHouseholdList(document.householdReqForm.page.value);
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<script th:inline="javascript">
|
|
||||||
|
|
||||||
// 임가 방문 정보
|
// 임가 방문 정보
|
||||||
const getHouseholdVisitList = (pageNo) => {
|
const getHouseholdVisitList = (pageNo) => {
|
||||||
const f = document.householdReqForm;
|
const f = document.householdReqForm;
|
||||||
f.page.value = pageNo;
|
f.page.value = pageNo;
|
||||||
|
|
||||||
let dataOj = $(f).serializeObject();
|
let dataObj = {
|
||||||
|
page: f.page.value,
|
||||||
|
adminSeq: f.seq.value,
|
||||||
|
searchMonth: f.searchMonth.value,
|
||||||
|
};
|
||||||
|
|
||||||
ajaxUtil._ajaxMethod(
|
ajaxUtil._ajaxMethod(
|
||||||
'/researcher/visitHouseholdList',
|
'/researcher/visitHouseholdList',
|
||||||
dataOj,
|
dataObj,
|
||||||
function (response) {
|
function (response) {
|
||||||
$('#household-totalElements').text(response.totalElements);
|
$('#household-totalElements').text(response.totalElements);
|
||||||
|
|
||||||
@@ -235,8 +268,8 @@
|
|||||||
<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.visitDate}</td>
|
<td>${ct.visitDate}</td>
|
||||||
<td>${ct.Memo}</td>
|
<td>${ct.memo}</td>
|
||||||
<td>${ct.Memo}</td>
|
<td>${ct.memo}</td>
|
||||||
<td>${ct.createdAt}</td>
|
<td>${ct.createdAt}</td>
|
||||||
<td>${ct.isGiftSentFlag}</td>
|
<td>${ct.isGiftSentFlag}</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -247,7 +280,7 @@
|
|||||||
if (!$(response.content).length) {
|
if (!$(response.content).length) {
|
||||||
tbody.append(`
|
tbody.append(`
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="10" class="text-center text-muted">임가 방문 정보가 존재하지 않습니다.</td>
|
<td colspan="8" class="text-center text-muted">임가 방문 정보가 존재하지 않습니다.</td>
|
||||||
</tr>
|
</tr>
|
||||||
`);
|
`);
|
||||||
}
|
}
|
||||||
@@ -264,7 +297,6 @@
|
|||||||
|
|
||||||
},
|
},
|
||||||
function (code, rstData) {
|
function (code, rstData) {
|
||||||
console.log("왜지 ");
|
|
||||||
|
|
||||||
},
|
},
|
||||||
'get',
|
'get',
|
||||||
@@ -290,8 +322,12 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function goRemove() {
|
function goRemove() {
|
||||||
if (!$('input[name=selectIds]').is(':checked')) {
|
const selectIds = $('input[name=selectIds]:checked').map(function() {
|
||||||
alert(/*[[#{operation.common.remove.choose}]]*/);
|
return parseInt(this.value);
|
||||||
|
}).get();
|
||||||
|
|
||||||
|
if (!selectIds.length) {
|
||||||
|
alert('삭제할 항목을 선택해주세요.');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -299,26 +335,31 @@
|
|||||||
const f = document.householdReqForm;
|
const f = document.householdReqForm;
|
||||||
const data = $(f).serializeObject();
|
const data = $(f).serializeObject();
|
||||||
|
|
||||||
$.ajax({
|
ajaxUtil._ajaxMethod(
|
||||||
'method': 'DELETE',
|
'/researcher/visitHousehold/remove',
|
||||||
'url': '/researchers/householdVisit/remove',
|
JSON.stringify(selectIds),
|
||||||
'data': {
|
function (response) {
|
||||||
'selectIds': data.selectIds
|
console.log("여기있어요");
|
||||||
|
console.log(response);
|
||||||
|
if(response > 0){
|
||||||
|
alert('선택한 임가정보가 삭제되었습니다.');
|
||||||
|
getHouseholdVisitList(document.householdReqForm.page.value);
|
||||||
|
} else {
|
||||||
|
alert('삭제에 실패했습니다.');
|
||||||
|
}
|
||||||
},
|
},
|
||||||
beforeSend: function (xhr) {
|
function (code, rstData) {
|
||||||
xhr.setRequestHeader(
|
console.error("Error in goRemove: ", err);
|
||||||
$("meta[name='_csrf_header']").attr("content"),
|
alert('삭제 중 오류가 발생했습니다.');
|
||||||
$("meta[name='_csrf']").attr("content"));
|
|
||||||
},
|
},
|
||||||
success(res) {
|
'delete',
|
||||||
alert('선택한 아이템이 삭제되었습니다.');
|
'json',
|
||||||
f.method = 'GET';
|
null
|
||||||
f.submit();
|
);
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
</section>
|
</th:block>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
@@ -43,7 +43,7 @@
|
|||||||
<option selected value="">전체</option>
|
<option selected value="">전체</option>
|
||||||
<option
|
<option
|
||||||
th:each="item : ${inspectionArea}"
|
th:each="item : ${inspectionArea}"
|
||||||
th:text="${item.codeText}" th:value="${item.codeValue}"></option>
|
th:text="${item.codeText}" th:value="${item.id}"></option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -56,8 +56,8 @@
|
|||||||
<div class="component-select">
|
<div class="component-select">
|
||||||
<select class="select-list" required th:field="*{searchAccountDisabled}">
|
<select class="select-list" required th:field="*{searchAccountDisabled}">
|
||||||
<option selected value="">전체</option>
|
<option selected value="">전체</option>
|
||||||
<option value="0">사용</option>
|
<option value="false">사용</option>
|
||||||
<option value="1">미사용</option>
|
<option value="true">미사용</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -68,7 +68,7 @@
|
|||||||
<span class="btn-txt">초기화</span>
|
<span class="btn-txt">초기화</span>
|
||||||
</button>
|
</button>
|
||||||
<button type="button" class="btn btn-primary" onclick="goSearch();" >
|
<button type="button" class="btn btn-primary" onclick="goSearch();" >
|
||||||
<i class="bi bi-search"></i>
|
<span class="btn-txt">검색</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -106,15 +106,6 @@
|
|||||||
<button type="button" class="btn" onclick="goExcel();">
|
<button type="button" class="btn" onclick="goExcel();">
|
||||||
<span class="btn-txt">엑셀 다운로드 <i class="ico-download ico-small" aria-hidden="true"></i></span>
|
<span class="btn-txt">엑셀 다운로드 <i class="ico-download ico-small" aria-hidden="true"></i></span>
|
||||||
</button>
|
</button>
|
||||||
<button type="button" class="btn" onclick="goSave();">
|
|
||||||
<span class="btn-txt">등록</span>
|
|
||||||
</button>
|
|
||||||
<button type="button" class="btn" >
|
|
||||||
<span class="btn-txt">조사원 매핑</span>
|
|
||||||
</button>
|
|
||||||
<button type="button" class="btn" onclick="goRemove();">
|
|
||||||
<span class="btn-txt">비활성화</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
@@ -154,7 +145,7 @@
|
|||||||
if (!$(response.content).length) {
|
if (!$(response.content).length) {
|
||||||
tbody.append(`
|
tbody.append(`
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="10" class="text-center text-muted">조사원이 존재하지 않습니다.</td>
|
<td colspan="5" class="text-center text-muted">조사원이 존재하지 않습니다.</td>
|
||||||
</tr>
|
</tr>
|
||||||
`);
|
`);
|
||||||
}
|
}
|
||||||
@@ -198,17 +189,6 @@
|
|||||||
f.searchArea.value = '';
|
f.searchArea.value = '';
|
||||||
f.searchAccountDisabled.value = '';
|
f.searchAccountDisabled.value = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
// 저장페이지 이동
|
|
||||||
function goSave() {
|
|
||||||
location.href = '/board/articles/create';
|
|
||||||
}
|
|
||||||
|
|
||||||
// 수정페이지 이동
|
|
||||||
function goUpdate(itemId) {
|
|
||||||
location.href = '/board/articles/' + itemId;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 상세페이지 이동
|
// 상세페이지 이동
|
||||||
function goDetail(seq) {
|
function goDetail(seq) {
|
||||||
location.href = '/researcher/' + seq;
|
location.href = '/researcher/' + seq;
|
||||||
|
|||||||
Reference in New Issue
Block a user