머징 작업 - 소스 복원
This commit is contained in:
parent
c9a5d5159f
commit
7035cb4e9c
@ -1,4 +1,3 @@
|
||||
<<<<<<< HEAD
|
||||
package nlib.col.web;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@ -172,179 +171,4 @@ public class InterestController extends NlibCommonController
|
||||
return message;
|
||||
}
|
||||
|
||||
=======
|
||||
package nlib.col.web;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import nlib.cmm.NlibCommonController;
|
||||
import nlib.cmm.service.CodeService;
|
||||
import nlib.cmm.service.NlibProperty;
|
||||
import nlib.col.service.CollectionService;
|
||||
import nlib.col.service.CollectionVO;
|
||||
import nlib.col.service.DeptVO;
|
||||
import nlib.col.service.InterestService;
|
||||
import nlib.col.service.RentService;
|
||||
import nlib.user.service.NlibLoginVO;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* @Class Name : InterestController.java
|
||||
*
|
||||
* @Description : 관심자료 컨트롤러
|
||||
*
|
||||
*
|
||||
* @프로젝트명: 지방문화원 통합자료관리시스템 구축사업 (2021)
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @ ------------ -------- ---------------------------
|
||||
* @ 수정일 수정자 수정내용
|
||||
* @ ------------ -------- ---------------------------
|
||||
* @ 2021. 10. 01. JSYOO 최초 생성
|
||||
*
|
||||
*
|
||||
* @author 이씨플라자 * DIGITALSHIP JSYOO
|
||||
* @since 2021. 10. 01.
|
||||
* @version 1.0
|
||||
*
|
||||
*/
|
||||
@Controller
|
||||
public class InterestController extends NlibCommonController
|
||||
{
|
||||
private static final Logger log = LoggerFactory.getLogger(InterestController.class);
|
||||
static final String DEFUALT_PAGE_SIZE = NlibProperty.getProperty("list.paging.page.size");
|
||||
|
||||
@Resource(name = "interestService")
|
||||
private InterestService interestService;
|
||||
|
||||
@Resource(name = "collectionService")
|
||||
private CollectionService collectionService;
|
||||
|
||||
@Resource(name = "codeService")
|
||||
private CodeService codeService;
|
||||
|
||||
/**
|
||||
* 관심 자료 화면을 호출한다.
|
||||
*
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/interest/listInterests.do")
|
||||
public String listInterests(HttpServletRequest req, Authentication authentication,
|
||||
@RequestParam Map<String, String> paramMap,
|
||||
CollectionVO searchCollectionVO, ModelMap model) throws Exception {
|
||||
|
||||
List<DeptVO> vo = new ArrayList();
|
||||
|
||||
//사용자 정보를 가져온다.
|
||||
NlibLoginVO loginVO = getNlibLoginVO(authentication);
|
||||
|
||||
searchCollectionVO.setMbInfoId(loginVO.getMbInfoId());
|
||||
|
||||
//문화원 목록 조회
|
||||
vo = interestService.selectOrgList(searchCollectionVO);
|
||||
|
||||
model.addAttribute("deptList",vo);
|
||||
model.addAttribute("searchCollection", searchCollectionVO);
|
||||
return "nlib/collection/listInterests";
|
||||
}
|
||||
|
||||
/**
|
||||
* 관심 자료를 조회한다.
|
||||
*
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value="/interest/listInterestsAjax.do")
|
||||
public ResponseEntity<String> listInterestsAjax(HttpServletRequest req,
|
||||
Authentication authentication, @RequestBody CollectionVO searchCollectionVO) {
|
||||
|
||||
if(searchCollectionVO.getPageIndex() < 1) searchCollectionVO.setPageIndex(1);
|
||||
if(searchCollectionVO.getPageSize() < 1) searchCollectionVO.setPageSize(DEFUALT_PAGE_SIZE);
|
||||
|
||||
int totalCount= 0;
|
||||
//사용자 정보를 가져온다.
|
||||
NlibLoginVO loginVO = getNlibLoginVO(authentication);
|
||||
|
||||
searchCollectionVO.setMbInfoId(loginVO.getMbInfoId());
|
||||
searchCollectionVO.setPageStart(searchCollectionVO.getPageIndex(), searchCollectionVO.getPageSize());
|
||||
List<CollectionVO> List = new ArrayList();
|
||||
|
||||
// 요청
|
||||
List = interestService.listInterests(searchCollectionVO);
|
||||
totalCount = interestService.countListInterests(searchCollectionVO);
|
||||
|
||||
//-------------------------------
|
||||
// JSON변환 응답 처리
|
||||
//-------------------------------
|
||||
// JS-GRID 페이징 처리를 포함한 응답값 처리
|
||||
// {data: [{...}],
|
||||
// itemsCount: 255
|
||||
// }
|
||||
HashMap<String, Object> retMap = new HashMap<String, Object>();
|
||||
retMap.put("data", List);
|
||||
retMap.put("itemsCount", totalCount);
|
||||
|
||||
return makeResponseEntityJson(retMap);
|
||||
}
|
||||
|
||||
/**
|
||||
* 관심자료 목록 삭제
|
||||
* @param masterIdList
|
||||
*/
|
||||
@RequestMapping(value="/interest/deleteInterests.ajax")
|
||||
@ResponseBody
|
||||
public void deleteInterests(@RequestParam(value="mbInterestIdList[]") List<Integer> mbInterestIdList,Authentication authentication) {
|
||||
NlibLoginVO loginVO = getNlibLoginVO(authentication);
|
||||
interestService.deleteInterests(mbInterestIdList,loginVO.getMbInfoId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 관심자료 추가
|
||||
* @param masterIdList
|
||||
*/
|
||||
@RequestMapping(value="/interest/insertInterest.ajax")
|
||||
@ResponseBody
|
||||
public String insertInterest(@RequestParam(value="masterId") String masterId,HttpServletResponse response,Authentication authentication,HttpServletRequest request) {
|
||||
NlibLoginVO loginVO = getNlibLoginVO(authentication);
|
||||
|
||||
CollectionVO vo = new CollectionVO();
|
||||
vo.setMbInfoId(loginVO.getMbInfoId());
|
||||
vo.setMasterId(masterId);
|
||||
|
||||
int count = 0;
|
||||
String message = "";
|
||||
count = interestService.countInterest(vo);
|
||||
|
||||
//중복된 관심자료가 있을시
|
||||
if(count > 0)
|
||||
{
|
||||
message="이미 추가된 관심자료입니다.";
|
||||
}else {
|
||||
interestService.insertInterest(vo);
|
||||
message="관심자료에 추가되었습니다.";
|
||||
}
|
||||
return message;
|
||||
}
|
||||
|
||||
>>>>>>> refs/remotes/origin/master
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user