Merge branch 'JIWOO'
This commit is contained in:
commit
6fd90507ee
@ -10,4 +10,6 @@ public interface HolidayService {
|
|||||||
|
|
||||||
public void insertHoliday(HolidayVO holidayVO) throws Exception;
|
public void insertHoliday(HolidayVO holidayVO) throws Exception;
|
||||||
|
|
||||||
|
public int selectHolidayCnt(HolidayVO holidayVO) throws Exception;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,6 +16,9 @@ public class HolidayVO extends ComDefaultVO implements Serializable {
|
|||||||
public String regDt = ""; //등록일
|
public String regDt = ""; //등록일
|
||||||
public String updDt = ""; //변경일
|
public String updDt = ""; //변경일
|
||||||
|
|
||||||
|
public String sdt = ""; //기간 계산 - 시작일
|
||||||
|
public String edt = ""; //기간 계산 - 종료일
|
||||||
|
|
||||||
public String getLocdate() {
|
public String getLocdate() {
|
||||||
return locdate;
|
return locdate;
|
||||||
}
|
}
|
||||||
@ -57,6 +60,18 @@ public class HolidayVO extends ComDefaultVO implements Serializable {
|
|||||||
}
|
}
|
||||||
public void setUpdDt(String updDt) {
|
public void setUpdDt(String updDt) {
|
||||||
this.updDt = updDt;
|
this.updDt = updDt;
|
||||||
|
}
|
||||||
|
public String getSdt() {
|
||||||
|
return sdt;
|
||||||
|
}
|
||||||
|
public void setSdt(String sdt) {
|
||||||
|
this.sdt = sdt;
|
||||||
|
}
|
||||||
|
public String getEdt() {
|
||||||
|
return edt;
|
||||||
|
}
|
||||||
|
public void setEdt(String edt) {
|
||||||
|
this.edt = edt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -21,4 +21,8 @@ public class HolidayDAO extends EgovAbstractDAO {
|
|||||||
update("holidayDAO.insertHoliday", holidayVO);
|
update("holidayDAO.insertHoliday", holidayVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int selectHolidayCnt(HolidayVO holidayVO) throws Exception {
|
||||||
|
return (Integer) select("holidayDAO.selectHolidayCnt", holidayVO);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -30,4 +30,9 @@ public class HolidayServiceImpl extends EgovAbstractServiceImpl implements Holid
|
|||||||
public void insertHoliday(HolidayVO holidayVO) throws Exception {
|
public void insertHoliday(HolidayVO holidayVO) throws Exception {
|
||||||
holidayDAO.insertHoliday(holidayVO);
|
holidayDAO.insertHoliday(holidayVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int selectHolidayCnt(HolidayVO holidayVO) throws Exception {
|
||||||
|
return holidayDAO.selectHolidayCnt(holidayVO);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,6 +7,7 @@ import java.net.HttpURLConnection;
|
|||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.net.URLEncoder;
|
import java.net.URLEncoder;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -15,9 +16,12 @@ import javax.servlet.http.HttpSession;
|
|||||||
import javax.xml.parsers.DocumentBuilder;
|
import javax.xml.parsers.DocumentBuilder;
|
||||||
import javax.xml.parsers.DocumentBuilderFactory;
|
import javax.xml.parsers.DocumentBuilderFactory;
|
||||||
|
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.ui.ModelMap;
|
import org.springframework.ui.ModelMap;
|
||||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||||
import org.w3c.dom.Document;
|
import org.w3c.dom.Document;
|
||||||
@ -120,4 +124,28 @@ public class HolidayController {
|
|||||||
|
|
||||||
return "redirect:/uss/holiday/selectHolidayList.do";
|
return "redirect:/uss/holiday/selectHolidayList.do";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RequestMapping(value="/uss/holiday/returnHolidayAjax.do")
|
||||||
|
public ResponseEntity<Integer> returnHolidayAjax(@RequestBody HolidayVO holidayVO, RedirectAttributes redirectAttributes)throws Exception{
|
||||||
|
String std = holidayVO.getSdt();
|
||||||
|
String etd = holidayVO.getEdt();
|
||||||
|
|
||||||
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd");
|
||||||
|
LocalDate startDate = LocalDate.parse(std, formatter);
|
||||||
|
LocalDate endDate = LocalDate.parse(etd, formatter);
|
||||||
|
|
||||||
|
//공휴일 수
|
||||||
|
int hldCnt = holidayService.selectHolidayCnt(holidayVO);
|
||||||
|
|
||||||
|
int workCnt = 0;
|
||||||
|
//주말, 공휴일 뺀 기간
|
||||||
|
for (LocalDate date = startDate; !date.isAfter(endDate); date = date.plusDays(1)) {
|
||||||
|
// 주말이 아닌 경우에만 근무일 수 증가
|
||||||
|
if (date.getDayOfWeek().getValue() != 6 && date.getDayOfWeek().getValue() != 7) {
|
||||||
|
workCnt++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
workCnt = workCnt - hldCnt -1;
|
||||||
|
return new ResponseEntity<Integer>(workCnt, HttpStatus.OK);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -52,4 +52,13 @@
|
|||||||
)
|
)
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
|
<select id="holidayDAO.selectHolidayCnt" parameterClass="holidayVO" resultClass="int">
|
||||||
|
SELECT
|
||||||
|
COUNT(DISTINCT A.LOCDATE) AS cnt
|
||||||
|
FROM
|
||||||
|
C_RESTDEINFO A
|
||||||
|
WHERE
|
||||||
|
A.DEL_YN = 'N'
|
||||||
|
AND A.LOCDATE BETWEEN #sdt# AND #edt#
|
||||||
|
</select>
|
||||||
</sqlMap>
|
</sqlMap>
|
||||||
|
|||||||
@ -96,9 +96,9 @@ function fn_holdayAPI(){
|
|||||||
</colgroup>
|
</colgroup>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="col">날짜<button class="sort sortBtn" id="sort_cntId">▲</button></th>
|
<th scope="col">날짜</th>
|
||||||
<th scope="col">공휴일 이름<button class="sort sortBtn" id="sort_cntName">▲</button></th>
|
<th scope="col">공휴일 이름</th>
|
||||||
<th scope="col">등록일<button class="sort sortBtn" id="sort_registerId">▲</button></th>
|
<th scope="col">등록일</th>
|
||||||
<th scope="col">삭제</th>
|
<th scope="col">삭제</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
|||||||
@ -257,7 +257,7 @@ $(document).ready(function(){
|
|||||||
$(".readOff div.picker").remove();
|
$(".readOff div.picker").remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
$("#suppCalculation").click(function(){
|
/* $("#suppCalculation").click(function(){
|
||||||
if($("#appReqDt").val() == ""){
|
if($("#appReqDt").val() == ""){
|
||||||
alert("신청인 보완요청일을 입력 해 주세요.");
|
alert("신청인 보완요청일을 입력 해 주세요.");
|
||||||
return false;
|
return false;
|
||||||
@ -291,7 +291,7 @@ $(document).ready(function(){
|
|||||||
callRestDeApi(appReqDt,appSubmitDt,"appReqTerm");
|
callRestDeApi(appReqDt,appSubmitDt,"appReqTerm");
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
}); */
|
||||||
|
|
||||||
$("#stopCalculation").click(function(){
|
$("#stopCalculation").click(function(){
|
||||||
if($("#stopReqDt").val() == ""){
|
if($("#stopReqDt").val() == ""){
|
||||||
@ -314,7 +314,7 @@ $(document).ready(function(){
|
|||||||
$("#stopReqTerm").val(stopReqTerm);
|
$("#stopReqTerm").val(stopReqTerm);
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#anwCalculation").click(function(){
|
/* $("#anwCalculation").click(function(){
|
||||||
if($("#answerReqDt").val() == ""){
|
if($("#answerReqDt").val() == ""){
|
||||||
alert("답변요청일을 입력 해 주세요.");
|
alert("답변요청일을 입력 해 주세요.");
|
||||||
return false;
|
return false;
|
||||||
@ -329,11 +329,110 @@ $(document).ready(function(){
|
|||||||
var respondentReqDt = $("#respondentReqDt").val().replace(/-/gi,"");
|
var respondentReqDt = $("#respondentReqDt").val().replace(/-/gi,"");
|
||||||
callRestDeApi(answerReqDt,respondentReqDt,"answerTerm");
|
callRestDeApi(answerReqDt,respondentReqDt,"answerTerm");
|
||||||
|
|
||||||
});
|
}); */
|
||||||
|
|
||||||
|
|
||||||
//처리기간 계산 ((조정종료일 - 신청서 보완기간) / 24 * 60 * 60 * 1000) - 보완기간
|
//처리기간 계산 ((조정종료일 - 신청서 보완기간) / 24 * 60 * 60 * 1000) - 보완기간
|
||||||
$("#periodCalulation").click(function(){
|
/* $("#periodCalulation").click(function(){
|
||||||
|
|
||||||
|
if($("#mediationEndDt").val() == ""){
|
||||||
|
alert("조정종료일이 존재하지 않습니다.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
var caseNo = '${masterData.caseNo}';
|
||||||
|
var caseDate = '${masterData.caseDate}';
|
||||||
|
var previousStep = '${masterData.previousStep}';
|
||||||
|
var mediationSmallRb = '${masterData.mediationSmallRb}';
|
||||||
|
if(mediationSmallRb == '0617000000' || caseNo == '유통2020-0030'){
|
||||||
|
var appReqTerm = $("#appReqTerm").val();//보완기간
|
||||||
|
var stopReqTerm = $("#stopReqTerm").val();
|
||||||
|
if(appReqTerm == ""){
|
||||||
|
appReqTerm = 0;
|
||||||
|
}
|
||||||
|
if(stopReqTerm == ""){
|
||||||
|
stopReqTerm = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
caseDate = caseDate.substring(0,4)+'-'+caseDate.substring(4,6)+'-'+caseDate.substring(6,8);
|
||||||
|
var caseDateArr = caseDate.split('-');
|
||||||
|
var mediationEndDtArr = $("#mediationEndDt").val().split('-');
|
||||||
|
|
||||||
|
var caseDateDt = new Date(caseDateArr[0], Number(caseDateArr[1]) - 1, caseDateArr[2]);//접수일
|
||||||
|
var mediationEndDt = new Date(mediationEndDtArr[0], Number(mediationEndDtArr[1])-1, mediationEndDtArr[2]);//조정종료일
|
||||||
|
|
||||||
|
var currDay = 24 * 60 * 60 * 1000;
|
||||||
|
|
||||||
|
var pendencyPeriod = ((mediationEndDt - caseDateDt) / currDay) - (appReqTerm +1) - (stopReqTerm + 1);
|
||||||
|
|
||||||
|
var processStopDay = getProcessStopDay();
|
||||||
|
|
||||||
|
pendencyPeriod = pendencyPeriod - processStopDay;
|
||||||
|
|
||||||
|
$("#pendencyPeriod").val(pendencyPeriod);
|
||||||
|
}else{
|
||||||
|
var caseDt = caseDate.replace(/-/gi,"");
|
||||||
|
var mediationEndDt = $("#mediationEndDt").val().replace(/-/gi,"");
|
||||||
|
callRestDeApi(caseDt,mediationEndDt,"pendencyPeriod");
|
||||||
|
}
|
||||||
|
}); */
|
||||||
|
|
||||||
|
|
||||||
|
//신청서 보완기간 계산
|
||||||
|
$("#suppCalculation").click(function(){
|
||||||
|
if($("#appReqDt").val() == ""){
|
||||||
|
alert("신청인 보완요청일을 입력 해 주세요.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if($("#appSubmitDt").val() == ""){
|
||||||
|
alert("신청인 제출일을 입력 해 주세요.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
var caseNo = '${masterData.caseNo}';
|
||||||
|
var caseDate = '${masterData.caseDate}';
|
||||||
|
var mediationSmallRb = '${masterData.mediationSmallRb}';
|
||||||
|
if(mediationSmallRb == '0617000000' || caseNo == '유통2020-0030'){
|
||||||
|
var appReqDtArr = $("#appReqDt").val().split('-');
|
||||||
|
var appSubmitDtArr = $("#appSubmitDt").val().split('-');
|
||||||
|
var appReqDt = new Date(appReqDtArr[0], Number(appReqDtArr[1]) -1 , appReqDtArr[2]);
|
||||||
|
var appSubmitDt = new Date(appSubmitDtArr[0], Number(appSubmitDtArr[1]) -1, appSubmitDtArr[2]);
|
||||||
|
var currDay = 24 * 60 * 60 * 1000;
|
||||||
|
var appReqTerm = (appSubmitDt - appReqDt) / currDay;
|
||||||
|
|
||||||
|
if(appReqTerm > 21){
|
||||||
|
//신청인 보완기간은 최대 21일로 고정
|
||||||
|
appReqTerm = 21;
|
||||||
|
}
|
||||||
|
|
||||||
|
$("#appReqTerm").val(appReqTerm);
|
||||||
|
}else{
|
||||||
|
var appReqDt = $("#appReqDt").val().replace(/-/gi,"");
|
||||||
|
var appSubmitDt = $("#appSubmitDt").val().replace(/-/gi,"");
|
||||||
|
returnTerm(appReqDt,appSubmitDt,"appReqTerm");
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
//답변서 제출기간 계산
|
||||||
|
$("#anwCalculation").click(function(){
|
||||||
|
if($("#answerReqDt").val() == ""){
|
||||||
|
alert("답변요청일을 입력 해 주세요.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if($("#respondentReqDt").val() == ""){
|
||||||
|
alert("피신청인 답변서 제출일을 입력 해 주세요.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
var answerReqDt = $("#answerReqDt").val().replace(/-/gi,"");
|
||||||
|
var respondentReqDt = $("#respondentReqDt").val().replace(/-/gi,"");
|
||||||
|
returnTerm(answerReqDt,respondentReqDt,"answerTerm");
|
||||||
|
});
|
||||||
|
|
||||||
|
//조정종료 처리기간 계산
|
||||||
|
$("#periodCalulation").click(function(){
|
||||||
/* if($("#appReqTerm").val() == ""){
|
/* if($("#appReqTerm").val() == ""){
|
||||||
alert("신청인 보완기간 입력 해 주세요.");
|
alert("신청인 보완기간 입력 해 주세요.");
|
||||||
return false;
|
return false;
|
||||||
@ -377,9 +476,10 @@ $(document).ready(function(){
|
|||||||
}else{
|
}else{
|
||||||
var caseDt = caseDate.replace(/-/gi,"");
|
var caseDt = caseDate.replace(/-/gi,"");
|
||||||
var mediationEndDt = $("#mediationEndDt").val().replace(/-/gi,"");
|
var mediationEndDt = $("#mediationEndDt").val().replace(/-/gi,"");
|
||||||
callRestDeApi(caseDt,mediationEndDt,"pendencyPeriod");
|
returnTerm(caseDt,mediationEndDt,"pendencyPeriod");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
$("#test").click(function(){
|
$("#test").click(function(){
|
||||||
var processStopDay = '';
|
var processStopDay = '';
|
||||||
@ -4260,6 +4360,38 @@ function callRestDeApi(sdt,edt,gubun){
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//기간 내 주말, 공휴일 계산 하기
|
||||||
|
function returnTerm(sdt,edt,gubun){
|
||||||
|
var data = {
|
||||||
|
"sdt" : sdt,
|
||||||
|
"edt" : edt
|
||||||
|
}
|
||||||
|
$.ajax({
|
||||||
|
type : "POST",
|
||||||
|
url : "/uss/holiday/returnHolidayAjax.do",
|
||||||
|
contentType: "application/json",
|
||||||
|
data : JSON.stringify(data),
|
||||||
|
success: function(response) {
|
||||||
|
if(gubun == "appReqTerm"){
|
||||||
|
$("#appReqTerm").val(response);
|
||||||
|
}else if(gubun == "answerTerm"){
|
||||||
|
$("#answerTerm").val(response);
|
||||||
|
}else if(gubun == "pendencyPeriod"){
|
||||||
|
var pendencyPeriod = response;
|
||||||
|
var processStopDay = getProcessStopDay();
|
||||||
|
pendencyPeriod = pendencyPeriod - processStopDay
|
||||||
|
$("#pendencyPeriod").val(pendencyPeriod);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error: function(xhr, status, error) {
|
||||||
|
alert("기간 계산 오류");
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
function getFormatDate(date){
|
function getFormatDate(date){
|
||||||
var year = date.getFullYear();
|
var year = date.getFullYear();
|
||||||
var month = (1+date.getMonth());
|
var month = (1+date.getMonth());
|
||||||
@ -9634,4 +9766,4 @@ function docOpen(obj) {
|
|||||||
<input type="hidden" id="caseAuthId" name="caseAuthId" value=""/>
|
<input type="hidden" id="caseAuthId" name="caseAuthId" value=""/>
|
||||||
<input type="hidden" id="caseAuthYn" name="caseAuthYn" value=""/>
|
<input type="hidden" id="caseAuthYn" name="caseAuthYn" value=""/>
|
||||||
</form>
|
</form>
|
||||||
<!-- 사건권한 끝 -->
|
<!-- 사건권한 끝 -->
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user