api로 url 변경
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
package app.module.admin.usecase.researcher.persistence.model;
|
package app.module.admin.usecase.researcher.persistence.model;
|
||||||
|
|
||||||
|
import app.module.admin.config.application.enums.ManagementType;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
@@ -13,7 +14,7 @@ public class ResearchersHouseholdVisitDto {
|
|||||||
private String householdNum;
|
private String householdNum;
|
||||||
private String ownerName;
|
private String ownerName;
|
||||||
private String visitDate;
|
private String visitDate;
|
||||||
private String managementType;
|
private ManagementType managementType;
|
||||||
private String content;
|
private String content;
|
||||||
private String isGiftSentFlag;
|
private String isGiftSentFlag;
|
||||||
private LocalDateTime createdAt;
|
private LocalDateTime createdAt;
|
||||||
|
|||||||
@@ -73,7 +73,6 @@ public class ResearcherServiceImpl implements ResearcherService {
|
|||||||
@Override
|
@Override
|
||||||
public Page<GetPopupHouseholds> searchMappingHousehold(HouseholdSearchReqVO reqVO) {
|
public Page<GetPopupHouseholds> searchMappingHousehold(HouseholdSearchReqVO reqVO) {
|
||||||
Pageable pageable = PageRequest.of(reqVO.getPage() , reqVO.getSize());
|
Pageable pageable = PageRequest.of(reqVO.getPage() , reqVO.getSize());
|
||||||
|
|
||||||
List<GetPopupHouseholds> households = getPopupHouseholdsMapper.getPopupHouseholds(pageable,
|
List<GetPopupHouseholds> households = getPopupHouseholdsMapper.getPopupHouseholds(pageable,
|
||||||
new GetPopupHouseholdsCmd(
|
new GetPopupHouseholdsCmd(
|
||||||
reqVO.getOwnerField(),
|
reqVO.getOwnerField(),
|
||||||
@@ -84,7 +83,6 @@ public class ResearcherServiceImpl implements ResearcherService {
|
|||||||
reqVO.getIsPanel(),
|
reqVO.getIsPanel(),
|
||||||
reqVO.getIsMapping()
|
reqVO.getIsMapping()
|
||||||
));
|
));
|
||||||
|
|
||||||
return new PageImpl<>(households, pageable,
|
return new PageImpl<>(households, pageable,
|
||||||
households.isEmpty() ? 0 : households.get(0).getTotal());
|
households.isEmpty() ? 0 : households.get(0).getTotal());
|
||||||
}
|
}
|
||||||
@@ -97,7 +95,6 @@ public class ResearcherServiceImpl implements ResearcherService {
|
|||||||
researcherMapper.deleteHouseholdResearcherMapping(reqVO.getResearcherSeq(), householdSeq,deletedBy);
|
researcherMapper.deleteHouseholdResearcherMapping(reqVO.getResearcherSeq(), householdSeq,deletedBy);
|
||||||
i += researcherMapper.insertHouseholdResearcherMapping(reqVO.getResearcherSeq(), householdSeq,deletedBy);
|
i += researcherMapper.insertHouseholdResearcherMapping(reqVO.getResearcherSeq(), householdSeq,deletedBy);
|
||||||
}
|
}
|
||||||
|
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,49 @@
|
|||||||
|
package app.module.admin.usecase.researcher.web;
|
||||||
|
|
||||||
|
import app.module.admin.usecase.researcher.service.ResearcherService;
|
||||||
|
import app.module.admin.usecase.researcher.web.model.*;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RequestMapping(path = "/api/researcher")
|
||||||
|
class ResearcherApiController {
|
||||||
|
private final ResearcherService researcherService;
|
||||||
|
|
||||||
|
@GetMapping(path = "/list")
|
||||||
|
ResponseEntity<?> operate( @ModelAttribute("reqVO") ResearchersListReqVO reqVO) {
|
||||||
|
return ResponseEntity.status(HttpStatus.OK).body(researcherService.list(reqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping(path = "/mappingHouseholdList")
|
||||||
|
ResponseEntity<?> mappingHouseholdList( @ModelAttribute ResearchersDetailReqVO reqVO) {
|
||||||
|
return ResponseEntity.status(HttpStatus.OK).body(researcherService.mappingHouseholdList(reqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping(path = "/visitHouseholdList")
|
||||||
|
ResponseEntity<?> visitHouseholdList( @ModelAttribute ResearchersDetailReqVO 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));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/mappingHousehold/search")
|
||||||
|
ResponseEntity<?> searchMappingHousehold(HouseholdSearchReqVO reqVO) {
|
||||||
|
return ResponseEntity.status(HttpStatus.OK).body(researcherService.searchMappingHousehold(reqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/mappingHousehold/update")
|
||||||
|
ResponseEntity<?> updateMappingHousehold(@RequestBody MappingHouseholdListReqVO reqVO ) {
|
||||||
|
return ResponseEntity.status(HttpStatus.OK).body(researcherService.updateMappingHousehold(reqVO));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -6,13 +6,10 @@ 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 lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.http.HttpStatus;
|
|
||||||
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.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Controller
|
@Controller
|
||||||
@@ -29,48 +26,17 @@ class ResearcherController {
|
|||||||
return "researcher/researchers";
|
return "researcher/researchers";
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping(path = "/list")
|
|
||||||
ResponseEntity<?> operate( @ModelAttribute("reqVO") ResearchersListReqVO reqVO) {
|
|
||||||
return ResponseEntity.status(HttpStatus.OK).body(researcherService.list(reqVO));
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping(path = "/{adminSeq}")
|
@GetMapping(path = "/{adminSeq}")
|
||||||
public String operateDetail(Model model, @PathVariable Integer adminSeq, @ModelAttribute("reqVO") ResearchersDetailUIReqVO reqVO) {
|
public String operateDetail(Model model, @PathVariable Integer adminSeq, @ModelAttribute("reqVO") ResearchersDetailUIReqVO reqVO) {
|
||||||
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("regionSubList", uiCodeListPortIn.connect("code.region.sub"));
|
||||||
// 세부지역
|
// 모달용 세부지역
|
||||||
model.addAttribute("regionDetailList", uiCodeListPortIn.connect("code.region.detail"));
|
model.addAttribute("regionDetailList", uiCodeListPortIn.connect("code.region.detail"));
|
||||||
|
|
||||||
return "researcher/detail";
|
return "researcher/detail";
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping(path = "/mappingHouseholdList")
|
|
||||||
ResponseEntity<?> mappingHouseholdList( @ModelAttribute ResearchersDetailReqVO reqVO) {
|
|
||||||
return ResponseEntity.status(HttpStatus.OK).body(researcherService.mappingHouseholdList(reqVO));
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping(path = "/visitHouseholdList")
|
|
||||||
ResponseEntity<?> visitHouseholdList( @ModelAttribute ResearchersDetailReqVO 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));
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/mappingHousehold/search")
|
|
||||||
ResponseEntity<?> searchMappingHousehold(HouseholdSearchReqVO reqVO) {
|
|
||||||
return ResponseEntity.status(HttpStatus.OK).body(researcherService.searchMappingHousehold(reqVO));
|
|
||||||
}
|
|
||||||
|
|
||||||
@PostMapping("/mappingHousehold/update")
|
|
||||||
ResponseEntity<?> updateMappingHousehold(@RequestBody MappingHouseholdListReqVO reqVO ) {
|
|
||||||
return ResponseEntity.status(HttpStatus.OK).body(researcherService.updateMappingHousehold(reqVO));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -176,7 +176,7 @@
|
|||||||
f.regionMainCode.value = regionMainCode;
|
f.regionMainCode.value = regionMainCode;
|
||||||
let dataOj = $(f).serializeObject();
|
let dataOj = $(f).serializeObject();
|
||||||
ajaxUtil._ajaxMethod(
|
ajaxUtil._ajaxMethod(
|
||||||
'/researcher/mappingHousehold/search',
|
'/api/researcher/mappingHousehold/search',
|
||||||
dataOj,
|
dataOj,
|
||||||
function (response) {
|
function (response) {
|
||||||
$('#mappingHouseholdTotalElements').text(response.totalElements);
|
$('#mappingHouseholdTotalElements').text(response.totalElements);
|
||||||
@@ -242,7 +242,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
ajaxUtil._ajaxMethod(
|
ajaxUtil._ajaxMethod(
|
||||||
'/researcher/mappingHousehold/update',
|
'/api/researcher/mappingHousehold/update',
|
||||||
JSON.stringify(data),
|
JSON.stringify(data),
|
||||||
function (response) {
|
function (response) {
|
||||||
if (response === selectedIds.length) {
|
if (response === selectedIds.length) {
|
||||||
|
|||||||
@@ -178,7 +178,7 @@
|
|||||||
f.page.value = pageNo;
|
f.page.value = pageNo;
|
||||||
let dataOj = $(f).serializeObject();
|
let dataOj = $(f).serializeObject();
|
||||||
ajaxUtil._ajaxMethod(
|
ajaxUtil._ajaxMethod(
|
||||||
'/researcher/mappingHouseholdList',
|
'/api/researcher/mappingHouseholdList',
|
||||||
dataOj,
|
dataOj,
|
||||||
function (response) {
|
function (response) {
|
||||||
$('#household-totalElements').text(response.totalElements);
|
$('#household-totalElements').text(response.totalElements);
|
||||||
@@ -248,7 +248,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
ajaxUtil._ajaxMethod(
|
ajaxUtil._ajaxMethod(
|
||||||
'/researcher/visitHouseholdList',
|
'/api/researcher/visitHouseholdList',
|
||||||
dataObj,
|
dataObj,
|
||||||
function (response) {
|
function (response) {
|
||||||
$('#household-totalElements').text(response.totalElements);
|
$('#household-totalElements').text(response.totalElements);
|
||||||
@@ -337,7 +337,7 @@
|
|||||||
const data = $(f).serializeObject();
|
const data = $(f).serializeObject();
|
||||||
|
|
||||||
ajaxUtil._ajaxMethod(
|
ajaxUtil._ajaxMethod(
|
||||||
'/researcher/visitHousehold/remove',
|
'/api/researcher/visitHousehold/remove',
|
||||||
JSON.stringify(selectIds),
|
JSON.stringify(selectIds),
|
||||||
function (response) {
|
function (response) {
|
||||||
if(response > 0){
|
if(response > 0){
|
||||||
|
|||||||
@@ -113,7 +113,7 @@
|
|||||||
let dataOj = $(f).serializeObject();
|
let dataOj = $(f).serializeObject();
|
||||||
|
|
||||||
ajaxUtil._ajaxMethod(
|
ajaxUtil._ajaxMethod(
|
||||||
'/researcher/list',
|
'/api/researcher/list',
|
||||||
dataOj,
|
dataOj,
|
||||||
function (response) {
|
function (response) {
|
||||||
$('#totalElements').text(response.totalElements);
|
$('#totalElements').text(response.totalElements);
|
||||||
@@ -215,7 +215,7 @@
|
|||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
'method': 'DELETE',
|
'method': 'DELETE',
|
||||||
'url': '/researchers/remove',
|
'url': '/api/researchers/remove',
|
||||||
'data': {
|
'data': {
|
||||||
'selectIds': data.selectIds
|
'selectIds': data.selectIds
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user