공지사항 5개 불러오는 JSON 추가

main
유지인 2025-06-11 11:14:21 +09:00
parent 1ee135bf9c
commit 3997f3d262
2 changed files with 64 additions and 32 deletions

View File

@ -48,6 +48,7 @@ import geoinfo.drilling.home.service.DrillingHomeService;
import geoinfo.drilling.input.service.DrillingInputService;
import geoinfo.drilling.inquiry.service.DrillingInquiryService;
import geoinfo.main.login.service.LoginService;
import geoinfo.main.notice.service.NoticeService;
import geoinfo.map.mapControl.service.MapControlService;
import geoinfo.regi.selectClassInfo.service.SelectClassService;
import geoinfo.regi.status.service.RegiPageService;
@ -73,51 +74,62 @@ public class DrillingHomeController {
@Autowired
DrillingInquiryService drillingInquiryService;
@RequestMapping(value = "/drilling/index.do")
public String drillingInquiry(@RequestParam HashMap<String, Object> params, ModelMap model, HttpServletRequest request, HttpServletResponse response) throws Exception {
@Autowired
private NoticeService noticeService;
if(request.getSession().getAttribute("USERNAME") == null){
return "redirect:/index.do";
@RequestMapping(value = "/drilling/index.do")
public ModelAndView drillingInquiry(@RequestParam HashMap<String, Object> params, HttpServletRequest request, HttpServletResponse response) throws Exception {
ModelAndView mav = new ModelAndView();
params.put("firstIndex", 0);
params.put("recordCountPerPage", 5);
List<?> noticeList = noticeService.selectInfoList(params);
if (request.getSession().getAttribute("USERNAME") == null) {
mav.setViewName("redirect:/index.do");
return mav;
}
String userId = MyUtil.getStringFromObject(request.getSession().getAttribute("USERID"));
String cls = MyUtil.getStringFromObject(request.getSession().getAttribute("CLS"));
String userId = MyUtil.getStringFromObject( request.getSession().getAttribute("USERID") );
String cls = MyUtil.getStringFromObject( request.getSession().getAttribute("CLS") );
model.addAttribute("userId", userId);
model.addAttribute("cls", cls);
mav.addObject("userId", userId);
mav.addObject("cls", cls);
try {
if(request.getSession().getAttribute("USERNAME") == null){
return "isError";
if (request.getSession().getAttribute("USERNAME") == null) {
mav.setViewName("isError");
return mav;
}
model.put("userName", String.valueOf(request.getSession().getAttribute("USERNAME")));
model.put("cls", String.valueOf(request.getSession().getAttribute("CLS")));
model.put("companyName", request.getSession().getAttribute("COMPANYNAME"));
mav.addObject("userName", String.valueOf(request.getSession().getAttribute("USERNAME")));
mav.addObject("cls", String.valueOf(request.getSession().getAttribute("CLS")));
mav.addObject("companyName", request.getSession().getAttribute("COMPANYNAME"));
Map<String, Object> map = new HashMap<String, Object>();
Map<String, Object> map = new HashMap<>();
map.put("userid", String.valueOf(request.getSession().getAttribute("USERID")));
Map<String, Object> result = loginService.selectWebMemberIn(map);
model.put("masterCompanyCode", result.get("master_company_code"));
mav.addObject("masterCompanyCode", result.get("master_company_code"));
} catch (Exception e) {
// TODO Auto-generated catch block
String strTxt =
"---------- BUG REPORTING START ----------" + "\n" +
"에러 문구:[" + request.getRequestURI() + " " + "]" + "\n" +
"params:[\n" + params.toString() + "\n]\n" +
"e.getMessage():[\n" + e.getMessage() + "\n]\n" + "\n" +
"new Date().toString():[" + new Date().toString() + "]\n" + "\n" +
"---------- BUG REPORTING END ----------" + "\n" +
"";
"---------- BUG REPORTING END ----------" + "\n";
System.out.println(strTxt);
}
return "/drilling/home/drilling_index";
mav.addObject("noticeList", noticeList);
mav.setViewName("/drilling/home/drilling_index");
return mav;
}
// 지도에서 발주기관 소속 시추공 표시

View File

@ -10,6 +10,28 @@
<div class="drilling-index">
<script type="text/javascript">
function noticeDetail(idx, src) {
var documentFrmAction = "topMenuSelect.do?url=noticeView";
if( src ) {
documentFrmAction += "&" + "src=" + src;
}
document.frm.idx.value = idx;
document.frm.action = documentFrmAction;
document.frm.submit();
}
</script>
<!-- 공지사항 상세화면 이동 -->
<form name="frm" method="post" action="/topMenuSelect.do?url=noticeView">
<input type="hidden" name="pageIndex" id="pageIndex" value="">
<input type="hidden" name="idx" id="idx" value="">
</form>
<c:out value="${masterCompanyCode}" />
<!-- wrap_container -->
<div id="wrap_container" class="main">
<div id="content" class="wrap_cont">
@ -118,11 +140,9 @@
</div>
<div class="recent-datas">
<ul class="project-list">
<li class="project-list-item">서비스 패치로 인한 중단 예정</li>
<li class="project-list-item">2024년 건설 시추정보 홍보 브로슈어 배포</li>
<li class="project-list-item">2023년 활용통계집 배포</li>
<li class="project-list-item">종무식 안내</li>
<li class="project-list-item">시스템 패치로 인한 간헐적 중단 안내</li>
<c:forEach items="${noticeList}" var="noticeList">
<li class="project-list-item"><a href="javascript:noticeDetail('${noticeList.idx }');">${noticeList.subject }</a></li>
</c:forEach>
</ul>
</div>
</div>