Merge pull request 'krc/receipt_waiting' (#22) from krc/receipt_waiting into dev
Reviewed-on: http://211.119.124.110:3000/cjm/clean-parking/pulls/22pull/25/head^2
commit
b5aa1fcc3f
@ -0,0 +1,58 @@
|
||||
package go.kr.project.biz.minwon.wait.controller;
|
||||
|
||||
|
||||
import egovframework.constant.TilesConstants;
|
||||
import egovframework.util.ApiResponseUtil;
|
||||
import go.kr.project.biz.minwon.wait.dto.MinwonWaitDto;
|
||||
import go.kr.project.biz.minwon.wait.service.MinwonWaitService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Controller
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
|
||||
public class MinwonWaitController {
|
||||
|
||||
private final MinwonWaitService minwonWaitService;
|
||||
|
||||
/**
|
||||
* 민원접수 대기자료 목록 페이지
|
||||
* @return 뷰 경로
|
||||
*/
|
||||
@GetMapping("/minwon/wait/wait.do")
|
||||
@Operation(summary = "민원접수 대기자료", description="민원접수 대기자료 목록 페이지를 조회합니다.")
|
||||
@ApiResponses({
|
||||
@ApiResponse(responseCode = "200", description = "조회 성공")
|
||||
})
|
||||
public String minwonWaitView(){
|
||||
|
||||
return "biz/minwon/wait/wait" + TilesConstants.BASE;
|
||||
}
|
||||
|
||||
@PostMapping("/minwon/wait/minwonwait-myBatis.ajax")
|
||||
public ResponseEntity<?> minwonwaitAjaxMybatis(@ModelAttribute MinwonWaitDto.Request.Search waitDto, String searchKeyword) {
|
||||
// 총 게시물 수 조회
|
||||
int totalCount = 0;
|
||||
waitDto.setTotalCount(totalCount);
|
||||
|
||||
// 페이징 처리를 위한 설정
|
||||
waitDto.setPagingYn("N");
|
||||
|
||||
List<MinwonWaitDto.Response.cpMainAnswerCancel> result = minwonWaitService.findminwonwaitSearchMybatis(waitDto, searchKeyword);
|
||||
|
||||
return ApiResponseUtil.successWithGrid(result, waitDto);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,39 @@
|
||||
package go.kr.project.biz.minwon.wait.dto;
|
||||
|
||||
|
||||
import go.kr.project.system.common.model.PagingVO;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
public class MinwonWaitDto {
|
||||
public static class Request {
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public static class Search extends PagingVO {
|
||||
private String mmDlgb;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static class Response {
|
||||
@Getter
|
||||
@Setter
|
||||
public static class cpMainAnswerCancel{
|
||||
private String mmCode;
|
||||
private String mmDlgb;
|
||||
private String asBbsNo;
|
||||
private String mmSgnm;
|
||||
private String mmSgtel;
|
||||
private String mmDate;
|
||||
private String asLimitDt;
|
||||
private String mmIndt;
|
||||
private String asJsno;
|
||||
private String mmCarno;
|
||||
private String ccCause;
|
||||
private String asIngb;
|
||||
private String mmText;
|
||||
private String asText;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,11 @@
|
||||
package go.kr.project.biz.minwon.wait.mapper;
|
||||
|
||||
import go.kr.project.biz.minwon.wait.dto.MinwonWaitDto;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface MinwonWaitMapper {
|
||||
List<MinwonWaitDto.Response.cpMainAnswerCancel> findminwonwaitSearchMybatis(MinwonWaitDto.Request.Search waitDto, String searchKeyword);
|
||||
}
|
||||
@ -0,0 +1,178 @@
|
||||
//package go.kr.project.biz.minwon.wait.repository;
|
||||
//
|
||||
//import com.querydsl.core.types.Projections;
|
||||
//import com.querydsl.jpa.impl.JPAQueryFactory;
|
||||
//import lombok.RequiredArgsConstructor;
|
||||
//import org.springframework.stereotype.Repository;
|
||||
//
|
||||
//import java.util.List;
|
||||
//
|
||||
//import static go.kr.project.domain.entity.QCpAnswer.cpAnswer;
|
||||
//import static go.kr.project.domain.entity.QCpMain.cpMain;
|
||||
//
|
||||
//@Repository
|
||||
//@RequiredArgsConstructor
|
||||
//public class MinwonWaitQueryDsRepository {
|
||||
//
|
||||
// private final JPAQueryFactory queryFactory;
|
||||
//
|
||||
// public List<MinwonWaitDto.Response.WaitAnswers> findWaitAnswers(MinwonWaitDto.Request.SearchMinwonWaitList dto) {
|
||||
//
|
||||
// List<MinwonWaitDto.Response.WaitAnswers> result = queryFactory
|
||||
// .select(
|
||||
// Projections.fields(
|
||||
// MinwonWaitDto.Response.WaitAnswers.class,
|
||||
// cpAnswer.asJsdate,
|
||||
// cpAnswer.asJsno,
|
||||
// cpAnswer.asJsnoM,
|
||||
// cpAnswer.asState,
|
||||
// cpAnswer.asPostCd,
|
||||
// cpAnswer.asLimitDt,
|
||||
// cpAnswer.asPostDt,
|
||||
// cpMain.mmCarno
|
||||
// )
|
||||
// )
|
||||
// .from(cpMain)
|
||||
// .innerJoin(cpAnswer).on(cpMain.mmCode.eq(cpAnswer.asMmcode))
|
||||
// .where(
|
||||
// //cpAnswer.asState.eq("01")
|
||||
// cpMain.mmState.eq("01"),
|
||||
// cpAnswer.asState.eq("0")
|
||||
// )
|
||||
// .fetch();
|
||||
// return result;
|
||||
// }
|
||||
//
|
||||
// public List<MinwonWaitDto.Response.WaitAnswers> findWaitAnswersSearch(MinwonWaitDto.Request.SearchMinwonWaitList dto, String searchCondition, String searchKeyword, String searchStartDt, String searchEndDt) {
|
||||
//
|
||||
// if (searchCondition.equals("jsdate")) {
|
||||
// List<MinwonWaitDto.Response.WaitAnswers> result = queryFactory
|
||||
// .select(
|
||||
// Projections.fields(
|
||||
// MinwonWaitDto.Response.WaitAnswers.class,
|
||||
// cpAnswer.asJsdate,
|
||||
// cpAnswer.asJsno,
|
||||
// cpAnswer.asJsnoM,
|
||||
// cpAnswer.asState,
|
||||
// cpAnswer.asPostCd,
|
||||
// cpAnswer.asLimitDt,
|
||||
// cpAnswer.asPostDt,
|
||||
// cpMain.mmCarno
|
||||
// )
|
||||
// )
|
||||
// .from(cpMain)
|
||||
// .innerJoin(cpAnswer).on(cpMain.mmCode.eq(cpAnswer.asMmcode))
|
||||
// .where(
|
||||
// cpMain.mmState.eq("01"),
|
||||
//// cpAnswer.asState.eq("0"),
|
||||
// cpAnswer.asJsdate.between(searchStartDt, searchEndDt)
|
||||
// )
|
||||
// .fetch();
|
||||
// return result;
|
||||
//
|
||||
// } else if (searchCondition.equals("jsno")) {
|
||||
// List<MinwonWaitDto.Response.WaitAnswers> result = queryFactory
|
||||
// .select(
|
||||
// Projections.fields(
|
||||
// MinwonWaitDto.Response.WaitAnswers.class,
|
||||
// cpAnswer.asJsdate,
|
||||
// cpAnswer.asJsno,
|
||||
// cpAnswer.asJsnoM,
|
||||
// cpAnswer.asState,
|
||||
// cpAnswer.asPostCd,
|
||||
// cpAnswer.asLimitDt,
|
||||
// cpAnswer.asPostDt,
|
||||
// cpMain.mmCarno
|
||||
// )
|
||||
// )
|
||||
// .from(cpMain)
|
||||
// .innerJoin(cpAnswer).on(cpMain.mmCode.eq(cpAnswer.asMmcode))
|
||||
// .where(
|
||||
// cpMain.mmState.eq("01"),
|
||||
//// cpAnswer.asState.eq("0"),
|
||||
// cpAnswer.asJsno.like("%" + searchKeyword + "%")
|
||||
// )
|
||||
// .fetch();
|
||||
// return result;
|
||||
//
|
||||
// } else if (searchCondition.equals("iimitdt")) {
|
||||
// List<MinwonWaitDto.Response.WaitAnswers> result = queryFactory
|
||||
// .select(
|
||||
// Projections.fields(
|
||||
// MinwonWaitDto.Response.WaitAnswers.class,
|
||||
// cpAnswer.asJsdate,
|
||||
// cpAnswer.asJsno,
|
||||
// cpAnswer.asJsnoM,
|
||||
// cpAnswer.asState,
|
||||
// cpAnswer.asPostCd,
|
||||
// cpAnswer.asLimitDt,
|
||||
// cpAnswer.asPostDt,
|
||||
// cpMain.mmCarno
|
||||
// )
|
||||
// )
|
||||
// .from(cpMain)
|
||||
// .innerJoin(cpAnswer).on(cpMain.mmCode.eq(cpAnswer.asMmcode))
|
||||
// .where(
|
||||
// cpMain.mmState.eq("01"),
|
||||
//// cpAnswer.asState.eq("0"),
|
||||
// cpAnswer.asLimitDt.between(searchStartDt, searchEndDt)
|
||||
// )
|
||||
// .fetch();
|
||||
// return result;
|
||||
//
|
||||
// } else {
|
||||
// List<MinwonWaitDto.Response.WaitAnswers> result = queryFactory
|
||||
// .select(
|
||||
// Projections.fields(
|
||||
// MinwonWaitDto.Response.WaitAnswers.class,
|
||||
// cpAnswer.asJsdate,
|
||||
// cpAnswer.asJsno,
|
||||
// cpAnswer.asJsnoM,
|
||||
// cpAnswer.asState,
|
||||
// cpAnswer.asPostCd,
|
||||
// cpAnswer.asLimitDt,
|
||||
// cpAnswer.asPostDt,
|
||||
// cpMain.mmCarno
|
||||
// )
|
||||
// )
|
||||
// .from(cpMain)
|
||||
// .innerJoin(cpAnswer).on(cpMain.mmCode.eq(cpAnswer.asMmcode))
|
||||
// .where(
|
||||
// cpMain.mmState.eq("01"),
|
||||
//// cpAnswer.asState.eq("0")
|
||||
// cpAnswer.asJsno.like("%" +searchKeyword + "%")
|
||||
// )
|
||||
// .fetch();
|
||||
// return result;
|
||||
// }
|
||||
//
|
||||
//
|
||||
///*
|
||||
// List<MinwonWaitDto.Response.WaitAnswers> result = queryFactory
|
||||
// .select(
|
||||
// Projections.fields(
|
||||
// MinwonWaitDto.Response.WaitAnswers.class,
|
||||
// cpAnswer.asJsdate,
|
||||
// cpAnswer.asJsno,
|
||||
// cpAnswer.asJsnoM,
|
||||
// cpAnswer.asState,
|
||||
// cpAnswer.asPostCd,
|
||||
// cpAnswer.asLimitDt,
|
||||
// cpAnswer.asPostDt,
|
||||
// cpMain.mmCarno
|
||||
// )
|
||||
// )
|
||||
// .from(cpMain)
|
||||
// .innerJoin(cpAnswer).on(cpMain.mmCode.eq(cpAnswer.asMmcode))
|
||||
// .where(
|
||||
// cpMain.mmState.eq("01"),
|
||||
//// cpAnswer.asState.eq("0"),
|
||||
// cpAnswer.asJsno.like("%" + searchKeyword + "%")
|
||||
// )
|
||||
// .fetch();
|
||||
// return result;
|
||||
//
|
||||
// */
|
||||
//
|
||||
// }
|
||||
//}
|
||||
@ -0,0 +1,11 @@
|
||||
package go.kr.project.biz.minwon.wait.service;
|
||||
|
||||
|
||||
import go.kr.project.biz.minwon.wait.dto.MinwonWaitDto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface MinwonWaitService {
|
||||
|
||||
List<MinwonWaitDto.Response.cpMainAnswerCancel> findminwonwaitSearchMybatis(MinwonWaitDto.Request.Search waitDto, String searchKeyword);
|
||||
}
|
||||
@ -0,0 +1,40 @@
|
||||
package go.kr.project.biz.minwon.wait.service.impl;
|
||||
|
||||
|
||||
import go.kr.project.biz.minwon.wait.dto.MinwonWaitDto;
|
||||
import go.kr.project.biz.minwon.wait.mapper.MinwonWaitMapper;
|
||||
import go.kr.project.biz.minwon.wait.service.MinwonWaitService;
|
||||
import go.kr.project.domain.repo.cp.CpAnswerRepository;
|
||||
import go.kr.project.domain.repo.cp.CpMainRepository;
|
||||
import go.kr.project.vo.code.AsIngbEnum;
|
||||
import go.kr.project.vo.code.MmDlgbEnum;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
public class MinwonWaitServiceImpl implements MinwonWaitService {
|
||||
|
||||
private final CpMainRepository cpMainRepository;
|
||||
private final CpAnswerRepository cpAnswerRepository;
|
||||
// private final MinwonWaitQueryDsRepository minwonWaitQueryDsRepository;
|
||||
private final MinwonWaitMapper minwonWaitMapper;
|
||||
|
||||
@Override
|
||||
public List<MinwonWaitDto.Response.cpMainAnswerCancel> findminwonwaitSearchMybatis(MinwonWaitDto.Request.Search waitDto, String searchKeyword) {
|
||||
List<MinwonWaitDto.Response.cpMainAnswerCancel> result = minwonWaitMapper.findminwonwaitSearchMybatis(waitDto, searchKeyword);
|
||||
|
||||
result.forEach(item -> {
|
||||
item.setMmDlgb(MmDlgbEnum.getDescByCode(item.getMmDlgb()));
|
||||
item.setAsIngb(AsIngbEnum.getDescByCode(item.getAsIngb()));
|
||||
});
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,38 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<!-- 여기는 매퍼인터페이스를 경로를 정확히 입력해야 바인딩이 된다. -->
|
||||
<mapper namespace="go.kr.project.biz.minwon.wait.mapper.MinwonWaitMapper">
|
||||
|
||||
<select id="findminwonwaitSearchMybatis"
|
||||
parameterType="go.kr.project.biz.minwon.wait.dto.MinwonWaitDto$Request$Search"
|
||||
resultType="go.kr.project.biz.minwon.wait.dto.MinwonWaitDto$Response$cpMainAnswerCancel">
|
||||
select main.MM_CODE
|
||||
, main.MM_DLGB
|
||||
, answer.AS_BBS_NO
|
||||
, main.MM_SGNM
|
||||
, main.MM_SGTEL
|
||||
, main.MM_DATE
|
||||
, answer.AS_LIMIT_DT
|
||||
, main.MM_INDT
|
||||
, answer.AS_JSNO
|
||||
, main.MM_CARNO
|
||||
, cancel.CC_CAUSE
|
||||
, answer.AS_INGB
|
||||
, etc.MM_TEXT
|
||||
, answer.AS_TEXT
|
||||
from cp_main main
|
||||
inner join cp_answer answer on (answer.AS_MMCODE = main.MM_CODE)
|
||||
left outer join cp_cancel cancel on (cancel.CC_MMCODE = main.MM_CODE)
|
||||
left outer join cp_main_etc1 etc on (etc.MM_CODE = main.MM_CODE)
|
||||
where AS_STATE = '1'
|
||||
|
||||
<if test="searchKeyword != null and searchKeyword != ''">
|
||||
and MM_DLGB = #{searchKeyword}
|
||||
</if>
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
@ -0,0 +1,308 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
|
||||
<!-- Main body -->
|
||||
<div class="main_body">
|
||||
<section id="section8" class="main_bars">
|
||||
<div class="bgs-main">
|
||||
<section id="section5">
|
||||
<div class="sub_title"></div>
|
||||
</section>
|
||||
</div>
|
||||
</section>
|
||||
<div class="lef">
|
||||
<ul class="lef">
|
||||
<button type="button" id="view_btn" class="newbtnss bg1">민원내용 원본</button>
|
||||
<button type="button" id="preview_btn" class="newbtnss bg1">답변내용 미리보기</button>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="contants_body">
|
||||
<div class="gs_b_top">
|
||||
<ul class="lef">
|
||||
<li class="th">등록구분</li>
|
||||
<li>
|
||||
<select id="searchKeyword" name="searchKeyword" class="input">
|
||||
<option value="">등록구분</option>
|
||||
<option value="0" <c:if test="${paramVO.searchKeyword eq '0'}">selected</c:if>>변환등록</option>
|
||||
<option value="1" <c:if test="${paramVO.searchKeyword eq '1'}">selected</c:if>>수기등록</option>
|
||||
<option value="2" <c:if test="${paramVO.searchKeyword eq '2'}">selected</c:if>>자동등록</option>
|
||||
<option value="3" <c:if test="${paramVO.searchKeyword eq '3'}">selected</c:if>>재등록</option>
|
||||
<option value="4" <c:if test="${paramVO.searchKeyword eq '4'}">selected</c:if>>복사등록</option>
|
||||
<option value="5" <c:if test="${paramVO.searchKeyword eq '5'}">selected</c:if>>관외 이첩자료 등록</option>
|
||||
<option value="6" <c:if test="${paramVO.searchKeyword eq '6'}">selected</c:if>>스마트폰단속</option>
|
||||
</select>
|
||||
</li>
|
||||
<li>
|
||||
<button type="button" id="search_btn" class="newbtnss bg1">검색</button>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="rig2">
|
||||
<li>
|
||||
<select id="perPageSelect" class="input">
|
||||
<option value="10" <c:if test="${param.perPage eq '10'}">selected</c:if>>페이지당 10</option>
|
||||
<option value="30" <c:if test="${empty param.perPage or param.perPage eq '30'}">selected</c:if>>페이지당 30</option>
|
||||
<option value="100" <c:if test="${param.perPage eq '100'}">selected</c:if>>페이지당 100</option>
|
||||
</select>
|
||||
<span class="page_number"><span id="currentPage"></span><span class="bar">/</span><sapn id="totalPages"></sapn> Pages</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="gs_booking">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="box_column">
|
||||
<div class="containers">
|
||||
<div id="grid"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="popupDiv" style="display:none;">
|
||||
<ul style="background-color:rgb(173,216,115); border-style:solid; border-width:1px; width:100%; height:60px">
|
||||
<table style="width:100%; height:60px;">
|
||||
<tr>
|
||||
<td style="width:80%; height:100%; text-align:center; font-weight: bold; font-size:20px">민원내용 보기</td>
|
||||
<td style="width:20%; text-align:center;">
|
||||
<button type="button" id="view_close_btn" class="newbtnss bg1">닫기</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</ul>
|
||||
<ul style="background-color:rgb(226,230,233); border-style:solid; border-width:1px; width:100%; height:60px;">
|
||||
<table style="width:100%; height:100%;">
|
||||
<tr style="width:100%; height:50%;">
|
||||
<td style="width: 50px;"> </td>
|
||||
<td style="width: 60px; font-size:12px; text-align:right;">목록번호 </td>
|
||||
<td style="width:140px;">
|
||||
<input type="text" name="m_BbsNo" id="m_BbsNo" style="width:140px; height:20px; font-size:13px; border-style:none;" readonly>
|
||||
</td>
|
||||
<td style="width: 60px; font-size:12px; text-align:right;">신청자 </td>
|
||||
<td style="width:140px;">
|
||||
<input type="text" name="m_Sgnm" id="m_Sgnm" style="width:140px; height:20px; font-size:13px; border-style:none;" readonly>
|
||||
</td>
|
||||
<td style="width: 60px; font-size:12px; text-align:right;">전화번호 </td>
|
||||
<td style="width:140px;">
|
||||
<input type="text" name="m_Tel" id="m_Tel" style="width:140px; height:20px; font-size:13px; border-style:none;" readonly>
|
||||
</td>
|
||||
<td style="width: 50px;"> </td>
|
||||
</tr>
|
||||
<tr style="height:50%;">
|
||||
<td> </td>
|
||||
<td style="font-size:12px; text-align:right;">접수일자 </td>
|
||||
<td>
|
||||
<input type="text" name="m_Jsdate" id="m_Jsdate" style="width:140px; height:20px; font-size:13px; border-style:none;" readonly>
|
||||
</td>
|
||||
<td style="font-size:12px; text-align:right;">처리기한 </td>
|
||||
<td>
|
||||
<input type="text" name="m_LimitDt" id="m_LimitDt" style="width:140px; height:20px; font-size:13px; border-style:none;" readonly>
|
||||
</td>
|
||||
<td style="font-size:12px; text-align:right;">접수번호 </td>
|
||||
<td>
|
||||
<input type="text" name="m_Jsno" id="m_Jsno" style="width:140px; height:20px; font-size:13px; border-style:none;" readonly>
|
||||
</td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</ul>
|
||||
<ul style="border-style:solid; border-width:1px; width:100%; height:400px;" >
|
||||
<textarea id="minwon_view" name="minwon_view" style="font-size:12px; width:100%; height:100%; border-style:none;" readonly></textarea>
|
||||
</ul>
|
||||
</div>
|
||||
<!-- /Main body -->
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
let GRID = null;
|
||||
let TOTAL_INFO = null;
|
||||
|
||||
let SEARCH_COND = {};
|
||||
|
||||
let perPage = parseInt($('#perPageSelect').val() || 10, 10);
|
||||
|
||||
let selectRow_mmCode = null;
|
||||
let selectRow_BbsNo = null;
|
||||
let selectRow_Sgnm = null;
|
||||
let selectRow_Tel = null;
|
||||
let selectRow_Jsdate = null;
|
||||
let selectRow_LimitDt = null;
|
||||
let selectRow_Jsno = null;
|
||||
let selectRow_mmText = null;
|
||||
let selectRow_asText = null;
|
||||
|
||||
// 검색정보 셋팅
|
||||
let setSearchCond = function() {
|
||||
let searchKeyword = $.trim(nvl($("#searchKeyword").val(), ""));
|
||||
|
||||
SEARCH_COND.searchKeyword = searchKeyword;
|
||||
};
|
||||
|
||||
const fnBiz = {
|
||||
|
||||
|
||||
init: () => {
|
||||
initGrid();
|
||||
},
|
||||
|
||||
eventListener: () => {
|
||||
// 검색 버튼 클릭 이벤트
|
||||
$('#search_btn').on('click', function() {
|
||||
// 페이지를 1로 리셋
|
||||
$("#page").val(1);
|
||||
// 그리드 데이터 리로드
|
||||
TuiGrid.instance.readData(1);
|
||||
});
|
||||
|
||||
// 검색어 입력 필드에서 엔터키 이벤트 처리
|
||||
$('#searchKeyword').on('keypress', function(e) {
|
||||
if (e.which === 13) { // 엔터키 코드는 13
|
||||
e.preventDefault(); // 기본 이벤트 방지
|
||||
$('#search_btn').trigger('click'); // 검색 버튼 클릭 이벤트 트리거
|
||||
}
|
||||
});
|
||||
|
||||
// perPage 변경 이벤트 추가
|
||||
$('#perPageSelect').on('change', () => {
|
||||
const pagination = TuiGrid.instance.getPagination();
|
||||
if (!pagination) return;
|
||||
|
||||
pagination.setItemsPerPage($('#perPageSelect').val());
|
||||
pagination.reset(TuiGrid.instance.getRowCount());
|
||||
pagination.movePageTo(1);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/** tui-grid Set */
|
||||
const initGrid = () => {
|
||||
|
||||
const gridColumns = [
|
||||
{header: '등록구분', name: 'mmDlgb', sortable: true, width: 50,},
|
||||
{header: '번호', name: 'asBbsNo', sortable: true, width: 50,},
|
||||
{header: '신고자', name: 'mmSgnm', sortable: true, width: 80,},
|
||||
{header: '전화번호', name: 'asTel', width: 100,},
|
||||
{header: '접수일자', name: 'mmDate', sortable: true, width: 70,},
|
||||
{header: '처리기한', name: 'asLimitDt', sortable: true, width: 70,},
|
||||
{header: '위반일자', name: 'mmDate', sortable: true, width: 120,},
|
||||
{header: '접수번호', name: 'asJsno', sortable: true, width: 150,},
|
||||
{header: '차량번호', name: 'mmCarno', sortable: true, width: 100,},
|
||||
{header: '미부과사유', name: 'ccCause', width: 150,},
|
||||
{header: '메인코드', name: 'mmCode', sortable: true, width: 180, align: 'center', hidden: true},
|
||||
{header: '민원내용', name: 'mmText', sortable: true, width: 1, hidden: true},
|
||||
{header: '답변내용', name: 'asText', sortable: true, width: 1, hidden: true}
|
||||
];
|
||||
|
||||
const gridDatasource = {
|
||||
api: {
|
||||
readData: {
|
||||
url: '<c:url value="/minwon/wait/minwonwait-myBatis.ajax"/>',
|
||||
method: 'POST',
|
||||
contentType: 'application/x-www-form-urlencoded',
|
||||
processData: true
|
||||
}
|
||||
},
|
||||
initialRequest: true, //초기화시 조회
|
||||
serializer: function (params) {
|
||||
setSearchCond();
|
||||
SEARCH_COND.perPage = params.perPage;
|
||||
SEARCH_COND.page = params.page;
|
||||
return $.param(SEARCH_COND);
|
||||
}
|
||||
}
|
||||
|
||||
const gridOptions = {
|
||||
el: 'grid',
|
||||
rowHeaders: ['checkbox'],
|
||||
columns: gridColumns,
|
||||
noData: "조회된 대기자료가 없습니다.",
|
||||
pageOptions: {
|
||||
useClient: true, // 클라이언트 페이징 여부(false: 서버 페이징)
|
||||
perPage: perPage,
|
||||
},
|
||||
};
|
||||
|
||||
GRID = TuiGrid.of(gridOptions, gridDatasource, (res) => {
|
||||
|
||||
GRID.on("dblclick", (e) => {
|
||||
var popUrl = '/total/info.do';
|
||||
var popTitle = "TotaInfo";
|
||||
var popOption = "width=1400px, height=900px, resizable=yes, scrollbars=yes, location=no, top=100px, left=100px";
|
||||
|
||||
// 1) localStorage에 저장
|
||||
console.log(e)
|
||||
let cursor = e.instance.getValue(e.rowKey, 'mmCode');
|
||||
let mmCodes = e.instance.getData().map(row => row.mmCode);
|
||||
|
||||
const state = { cursor, mmCodes, savedAt: Date.now() };
|
||||
localStorage.setItem('TOTAL_INFO_STATE', JSON.stringify(state));
|
||||
|
||||
// 2) 팝업이 없거나 닫혀 있으면 새로 열기
|
||||
if (!TOTAL_INFO || TOTAL_INFO.closed) {
|
||||
TOTAL_INFO = window.open(popUrl, popTitle, popOption);
|
||||
} else {
|
||||
// 이미 떠 있으면 새로 안 만들고, 그 창에 포커스만 줌
|
||||
TOTAL_INFO.focus();
|
||||
TOTAL_INFO.TOTAL_INFO_POPUP_API.search();
|
||||
}
|
||||
});
|
||||
|
||||
GRID.on("click", (e) => {
|
||||
selectRow_mmCode = e.instance.getValue(e.rowKey, 'mmCode');
|
||||
selectRow_BbsNo = e.instance.getValue(e.rowKey, 'asBbsNo');
|
||||
selectRow_Sgnm = e.instance.getValue(e.rowKey, 'mmSgnm');
|
||||
selectRow_Tel = e.instance.getValue(e.rowKey, 'asTel');
|
||||
selectRow_Jsdate = e.instance.getValue(e.rowKey, 'mmDate');
|
||||
selectRow_LimitDt = e.instance.getValue(e.rowKey, 'asLimitDt');
|
||||
selectRow_Jsno = e.instance.getValue(e.rowKey, 'asJsno');
|
||||
selectRow_mmText = e.instance.getValue(e.rowKey, 'mmText');
|
||||
selectRow_asText = e.instance.getValue(e.rowKey, 'asText');
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
// 레디펑션
|
||||
$(function () {
|
||||
|
||||
fnBiz.init();
|
||||
fnBiz.eventListener();
|
||||
|
||||
});
|
||||
|
||||
$('#view_btn').on('click', function() {
|
||||
if (selectRow_mmCode != null && selectRow_mmCode != '') {
|
||||
document.getElementById('m_BbsNo').value = selectRow_BbsNo;
|
||||
document.getElementById('m_Sgnm').value = selectRow_Sgnm;
|
||||
document.getElementById('m_Tel').value = selectRow_Tel;
|
||||
document.getElementById('m_Jsdate').value = selectRow_Jsdate;
|
||||
document.getElementById('m_LimitDt').value = selectRow_LimitDt;
|
||||
document.getElementById('m_Jsno').value = selectRow_Jsno;
|
||||
document.getElementById('minwon_view').value = selectRow_mmText;
|
||||
|
||||
var popupDiv = document.getElementById('popupDiv');
|
||||
popupDiv.style = 'display:inline-block; position:absolute; top:200px; left:350px; z-index:999999; background-color:rgb(226,230,233); width:900px; height:400px;';
|
||||
}
|
||||
});
|
||||
|
||||
$('#view_close_btn').on('click', function() {
|
||||
var popupDiv = document.getElementById('popupDiv');
|
||||
popupDiv.style = 'display:none;';
|
||||
});
|
||||
|
||||
|
||||
|
||||
$('#preview_btn').on('click', function() {
|
||||
alert('답변내용 미리보기 클릭')
|
||||
/*
|
||||
const popUrl = '${pageContext.request.contextPath}/minwon/dayanswer/dayanswerregister.do';
|
||||
const popTitle = '자료 등록';
|
||||
const popOption = 'width=700,height=600,resizable=yes,scrollbars=yes';
|
||||
|
||||
window.open(popUrl, popTitle, popOption);
|
||||
*/
|
||||
});
|
||||
|
||||
</script>
|
||||
Loading…
Reference in New Issue