Index: arms/js/analysis/topmenu/basicRadar.js =================================================================== diff -u -r8fd1675d63377afdcefc03fe72ab9ecae4e4ebdb -rb821c6800f1614fc6f63b2debc0de28160a17456 --- arms/js/analysis/topmenu/basicRadar.js (.../basicRadar.js) (revision 8fd1675d63377afdcefc03fe72ab9ecae4e4ebdb) +++ arms/js/analysis/topmenu/basicRadar.js (.../basicRadar.js) (revision b821c6800f1614fc6f63b2debc0de28160a17456) @@ -73,8 +73,12 @@ } let dateDiff = Math.abs(objectiveArr[2] - currentProgressArr[2]).toFixed(0); - if (objectiveArr[2] >= currentProgressArr[2]) { + if (currentProgressArr[2] < 0) { scheduleMax = objectiveArr[2]; + titleText += "일정 시작: " + Math.abs(currentProgressArr[2]) +"일 남음"; + titleColor = 'rgb(164,198,255)'; + } else if (objectiveArr[2] >= currentProgressArr[2]) { + scheduleMax = objectiveArr[2]; titleText += "일정: " + dateDiff +"일 남음"; titleColor = 'rgb(164,198,255)'; } else { @@ -172,7 +176,11 @@ borderRadius: 3, }, formatter: function (params) { - return params.value; + if (params.value < 0) { + return "("+Math.abs(params.value)+")"; + } else { + return params.value; + } } }, areaStyle: { Index: arms/js/analysis/topmenu/topMenuApi.js =================================================================== diff -u -r4fe8174d4c9e74beb1e1117fb4f532ffa9e14c98 -rb821c6800f1614fc6f63b2debc0de28160a17456 --- arms/js/analysis/topmenu/topMenuApi.js (.../topMenuApi.js) (revision 4fe8174d4c9e74beb1e1117fb4f532ffa9e14c98) +++ arms/js/analysis/topmenu/topMenuApi.js (.../topMenuApi.js) (revision b821c6800f1614fc6f63b2debc0de28160a17456) @@ -277,57 +277,66 @@ return new Promise((resolve) => { let totalDaysProgress = (total_days_progress ? total_days_progress : undefined); + let resultData = { + "text" : null, + "css_color" : null + }; - const url = new UrlBuilder() - .setBaseUrl("/auth-user/api/arms/analysis/top-menu/normal-version/resolution") - .addQueryParam("pdServiceLink", pdServiceLink) - .addQueryParam("pdServiceVersionLinks", pdServiceVersionLinks) - .addQueryParam("isReqType", "REQUIREMENT") - .addQueryParam("resolution", "resolutiondate") - .addQueryParam("메인그룹필드", "isReq") - .addQueryParam("크기", 1000) - .addQueryParam("컨텐츠보기여부", true) - .build(); + if(total_days_progress < 0) { + resultData["text"] = "일정 시작일 전 입니다."; + resultData["css_color"] = "rgb(164,198,255)"; + setExpectedEndDate(resultData); + resolve(); + } else { + const url = new UrlBuilder() + .setBaseUrl("/auth-user/api/arms/analysis/top-menu/normal-version/resolution") + .addQueryParam("pdServiceLink", pdServiceLink) + .addQueryParam("pdServiceVersionLinks", pdServiceVersionLinks) + .addQueryParam("isReqType", "REQUIREMENT") + .addQueryParam("resolution", "resolutiondate") + .addQueryParam("메인그룹필드", "isReq") + .addQueryParam("크기", 1000) + .addQueryParam("컨텐츠보기여부", true) + .build(); - $.ajax({ - url: url, - type: "GET", - contentType: "application/json;charset=UTF-8", - dataType: "json", - progress: true, - statusCode: { - 200: async function (data) { - console.log("[ topMenu :: getExpectedEndDate ] :: Resolution 개수 확인 = " + data.전체합계); - console.log("[ topMenuAPI :: getExpectedEndDate ] :: 전체 할당된 요구사항 개수 = " + all_req_count); - let resultData = { - "text" : null, - "css_color" : null - }; - if (data.전체합계 !== 0) { - let workingRatio = (data.전체합계 / all_req_count) * 100; - if (all_req_count === data.전체합계) { - resultData["text"] = "작업_완료"; - resultData["css_color"] = "rgb(45, 133, 21)"; - //$("#expected_end_date").text("작업 완료"); + $.ajax({ + url: url, + type: "GET", + contentType: "application/json;charset=UTF-8", + dataType: "json", + progress: true, + statusCode: { + 200: async function (data) { + console.log("[ topMenu :: getExpectedEndDate ] :: Resolution 개수 확인 = " + data.전체합계); + console.log("[ topMenuAPI :: getExpectedEndDate ] :: 전체 할당된 요구사항 개수 = " + all_req_count); + + if (data.전체합계 !== 0) { + let workingRatio = (data.전체합계 / all_req_count) * 100; + if (all_req_count === data.전체합계) { + resultData["text"] = "작업_완료"; + resultData["css_color"] = "rgb(45, 133, 21)"; + + } + else { + console.log("totalDaysProgress : " + totalDaysProgress); + let result = Math.abs((100 / workingRatio) * totalDaysProgress).toFixed(0); + resultData["text"] = addDaysToDate(result); + resultData["css_color"] = "rgb(164,198,255)"; + } } else { - console.log("totalDaysProgress : " + totalDaysProgress); - let result = Math.abs((100 / workingRatio) * totalDaysProgress).toFixed(0); - resultData["text"] = addDaysToDate(result); - resultData["css_color"] = "rgb(164,198,255)"; + resultData["text"] = "예측 불가.(완료 0)"; + resultData["css_color"] = "rgb(219, 42, 52)"; } + setExpectedEndDate(resultData); + resolve(); } - else { - resultData["text"] = "예측 불가"; - resultData["css_color"] = "rgb(219, 42, 52)"; - } - setExpectedEndDate(resultData); - resolve(); } - } - }); + }); + } }); + }; function addDaysToDate(daysToAdd) { @@ -349,23 +358,40 @@ period_info = TopMenuApi.getVersionPeriod(); issue_info = TopMenuApi.getReqAndSubtaskIssue(); resource_info = TopMenuApi.getResourceInfo(); + let today = new Date(); + console.log(today); let objectiveDateDiff = calDateDiff(period_info["start_date"], period_info["end_date"]); - let currentDateDiff = calDateDiff(period_info["start_date"], new Date()); + let currentDateDiff = calDateDiff(period_info["start_date"], today); - total_days_progress = currentDateDiff; - - $("#progressDateRate").text((currentDateDiff*100/(objectiveDateDiff === 0 ? 1 : objectiveDateDiff)).toFixed(0)+"%"); - let dateDiff = Math.abs(objectiveDateDiff - currentDateDiff).toFixed(0); - if(objectiveDateDiff>= currentDateDiff) { - $("#remaining_days").text("D-"+dateDiff); + console.log("톱메뉴_세팅 :: currentDateDiff => " + currentDateDiff); + let 목표데이터_배열 = [resource_info["resource"], req_state["total"], objectiveDateDiff]; + let 현재진행데이터_배열 = []; + if (currentDateDiff < 0) { // 시작일이 현재보다 미래인 경우 + let abs_currentDateDiff = Math.abs(currentDateDiff); + + $("#remaining_days").text("시작 D-"+abs_currentDateDiff); $("#remaining_days").css("color","rgb(164,198,255)"); - } else { - $("#remaining_days").text("D+"+dateDiff); - $("#remaining_days").css("color", "rgb(219,42,52)"); - } + $("#remaining_days").css("font-size","15px"); + $("#progressDateRate").text("0%"); - let 목표데이터_배열 = [resource_info["resource"], req_state["total"], objectiveDateDiff]; - let 현재진행데이터_배열 = [resource_info["resource"], req_state["not-open"], currentDateDiff]; + 현재진행데이터_배열 = [resource_info["resource"], req_state["not-open"], currentDateDiff]; + total_days_progress = -1; + + } else { // 시작일이 현재이거나 과거인 경우(현재 그대로 가능) + $("#progressDateRate").text((currentDateDiff*100/(objectiveDateDiff === 0 ? 1 : objectiveDateDiff)).toFixed(0)+"%"); + let dateDiff = Math.abs(objectiveDateDiff - currentDateDiff).toFixed(0); + if(objectiveDateDiff>= currentDateDiff) { + $("#remaining_days").text("D-"+dateDiff); + $("#remaining_days").css("color","rgb(164,198,255)"); + $("#remaining_days").css("font-size","20px"); + } else { + $("#remaining_days").text("D+"+dateDiff); + $("#remaining_days").css("color", "rgb(219,42,52)"); + $("#remaining_days").css("font-size","20px"); + } + 현재진행데이터_배열 = [resource_info["resource"], req_state["not-open"], currentDateDiff]; + total_days_progress = currentDateDiff; + } //레이더차트 drawBasicRadar("radarPart",목표데이터_배열, 현재진행데이터_배열); }) @@ -408,7 +434,7 @@ } const calDateDiff = (d1, d2) => { - const date1 = new Date(d1); // ISO 형식으로 변환하여 생성자에 전달합니다. + const date1 = new Date(d1); const date2 = new Date(d2); if (isNaN(date1.getTime()) || isNaN(date2.getTime())) { @@ -427,7 +453,8 @@ endDate = date1; } - const diffTime = Math.abs(endDate - startDate); + //const diffTime = Math.abs(endDate - startDate); + const diffTime = date2 - date1; const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24)); return diffDays; Index: arms/js/analysisResource.js =================================================================== diff -u -rd9290e3a734e11f2c2f783dc8a39d39e7d60d150 -rb821c6800f1614fc6f63b2debc0de28160a17456 --- arms/js/analysisResource.js (.../analysisResource.js) (revision d9290e3a734e11f2c2f783dc8a39d39e7d60d150) +++ arms/js/analysisResource.js (.../analysisResource.js) (revision b821c6800f1614fc6f63b2debc0de28160a17456) @@ -69,7 +69,6 @@ "js/analysis/table/workerStatusTable.js", "js/analysis/resource/chart/horizontalBarChart.js", "js/analysis/resource/chart/simplePie.js", - "js/analysis/resource/chart/basicRadar.js" ], [ "../reference/jquery-plugins/dataTables-1.10.16/media/css/jquery.dataTables_lightblue4.css",