thkim 2025-06-12 08:18:10 +09:00
commit 8fb9d954e8
3 changed files with 86 additions and 47 deletions

View File

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

View File

@ -17,6 +17,28 @@
<!-- //javascript --> <!-- //javascript -->
<div class="drilling-index"> <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 --> <!-- wrap_container -->
<div id="wrap_container" class="main"> <div id="wrap_container" class="main">
<div id="content" class="wrap_cont"> <div id="content" class="wrap_cont">
@ -124,11 +146,9 @@
</div> </div>
<div class="recent-datas"> <div class="recent-datas">
<ul class="project-list"> <ul class="project-list">
<li class="project-list-item">서비스 패치로 인한 중단 예정</li> <c:forEach items="${noticeList}" var="noticeList">
<li class="project-list-item">2024년 건설 시추정보 홍보 브로슈어 배포</li> <li class="project-list-item"><a href="javascript:noticeDetail('${noticeList.idx }', 'drilling');">${noticeList.subject }</a></li>
<li class="project-list-item">2023년 활용통계집 배포</li> </c:forEach>
<li class="project-list-item">종무식 안내</li>
<li class="project-list-item">시스템 패치로 인한 간헐적 중단 안내</li>
</ul> </ul>
</div> </div>
</div> </div>

View File

@ -117,22 +117,29 @@ if (request.getSession().getAttribute("CLS") == null || "2".equals(request.getSe
let pagingEleHTML = ` let firstIndicator = (Math.floor((nPage - 1) / nCount) * nCount) + 1; // 현재 페이지의 첫번째 페이지인디케이터 번호
<ul> let lastIndicator = Math.ceil(nPage / nCount) * 10; // 현재 페이지의 마지막 페이지인디케이터 번호
<li><a href="#"><img src="/com/img/common/icon/ico_chevron.svg" alt="Chevron-prev" class="page-prev"></a></li> let totalIndicator = Math.ceil(obj.count / nCount); // 총 페이지인디케이터 번호
let pagingEleHTML = "<ul>"
if (!(firstIndicator-1) < 1) {
pagingEleHTML += `<li data-npage="` + (firstIndicator-1) +`" class="page-button"><a href="#"><img src="/com/img/common/icon/ico_chevron.svg" alt="Chevron-prev" class="page-prev"></a></li>
`; `;
}
for( let i = 1; i<Math.floor(obj.count / nCount)+2; i++ ) { for( let i = firstIndicator; i<lastIndicator+1; i++ ) {
if (i <= totalIndicator) {
if( i === nPage ) { if( i === nPage ) {
pagingEleHTML += `<li data-npage="` + i + `" class="page-button is-active"><a href="#">` + i + `</a></li>`; pagingEleHTML += `<li data-npage="` + i + `" class="page-button is-active"><a href="#">` + i + `</a></li>`;
} else { } else {
pagingEleHTML += `<li data-npage="` + i + `" class="page-button" ><a href="#">` + i + `</a></li>`; pagingEleHTML += `<li data-npage="` + i + `" class="page-button" ><a href="#">` + i + `</a></li>`;
} }
} }
pagingEleHTML += ` }
<li><a href="#"><img src="/com/img/common/icon/ico_chevron.svg" alt="Chevron-next" class="page-next"></a></li>
</ul> if (lastIndicator < totalIndicator) {
`; pagingEleHTML += `<li data-npage="` + (lastIndicator+1) +`" class="page-button"><a href="#"><img src="/com/img/common/icon/ico_chevron.svg" alt="Chevron-next" class="page-next"></a></li>`;
}
pagingEleHTML += "</ul>";
pagingEle.innerHTML = pagingEleHTML; pagingEle.innerHTML = pagingEleHTML;