Index: web-module/src/main/java/egovframework/api/arms/module_reqstatus/controller/UserReqStatusController.java =================================================================== diff -u -rd7698afe04b9bc7fdcca30f52ccc39a8f9b1b2c1 -rd0571474eccda63a6bf7121be3731062dd6611c5 --- web-module/src/main/java/egovframework/api/arms/module_reqstatus/controller/UserReqStatusController.java (.../UserReqStatusController.java) (revision d7698afe04b9bc7fdcca30f52ccc39a8f9b1b2c1) +++ web-module/src/main/java/egovframework/api/arms/module_reqstatus/controller/UserReqStatusController.java (.../UserReqStatusController.java) (revision d0571474eccda63a6bf7121be3731062dd6611c5) @@ -11,14 +11,21 @@ */ package egovframework.api.arms.module_reqstatus.controller; +import egovframework.api.arms.module_reqadd.model.ReqAddDTO; +import egovframework.com.ext.jstree.springHibernate.core.interceptor.SessionUtil; import lombok.extern.slf4j.Slf4j; +import org.hibernate.criterion.Criterion; +import org.hibernate.criterion.Order; +import org.hibernate.criterion.Restrictions; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; +import org.springframework.ui.ModelMap; import org.springframework.validation.BindingResult; +import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; @@ -50,4 +57,29 @@ private final Logger logger = LoggerFactory.getLogger(this.getClass()); + @ResponseBody + @RequestMapping( + value = {"/{changeReqTableName}/getStatusMonitor.do"}, + method = {RequestMethod.GET} + ) + public ModelAndView getStatusMonitor( + @PathVariable(value ="changeReqTableName") String changeReqTableName, + ReqStatusDTO reqStatusDTO, ModelMap model, HttpServletRequest request) throws Exception { + + SessionUtil.setAttribute("getStatusMonitor",changeReqTableName); + + Criterion criterion = Restrictions.not( + // replace "id" below with property name, depending on what you're filtering against + Restrictions.in("c_id", new Object[] {1L, 2L}) + ); + reqStatusDTO.getCriterions().add(criterion); + List list = reqStatus.getChildNode(reqStatusDTO); + + SessionUtil.removeAttribute("getStatusMonitor"); + + ModelAndView modelAndView = new ModelAndView("jsonView"); + modelAndView.addObject("result", list); + return modelAndView; + } + } Index: web-module/src/main/java/egovframework/api/arms/module_reqstatus/service/ReqStatusImpl.java =================================================================== diff -u -r07945e40c0c57d0ac4c405e1d169fe02e050493f -rd0571474eccda63a6bf7121be3731062dd6611c5 --- web-module/src/main/java/egovframework/api/arms/module_reqstatus/service/ReqStatusImpl.java (.../ReqStatusImpl.java) (revision 07945e40c0c57d0ac4c405e1d169fe02e050493f) +++ web-module/src/main/java/egovframework/api/arms/module_reqstatus/service/ReqStatusImpl.java (.../ReqStatusImpl.java) (revision d0571474eccda63a6bf7121be3731062dd6611c5) @@ -112,6 +112,56 @@ }else{ //이슈 정보가 있다는건 //enable 인데 이슈 정보가 있어 + //req_id 가 0이 아니야, 이름도 있다면 되살려진 이슈인거야 + + if(statusDTO.getC_req_link() == 0L || StringUtility.equals(statusDTO.getC_req_name(),"deleted")){ + logger.error("enable 된 이슈인데, 요구사항이랑 연결이 안된 케이스"); + }else{ + + final JiraRestClient restClient = ArmsSchedulerUtil.getJiraRestClient(); + + Issue issue = getIssue(statusDTO.getC_jira_req_issue_key()); + + if(issue == null){ + logger.error("not found issue -> " + statusDTO.getC_jira_req_issue_key()); + }else{ + + if(StringUtility.equals(issue.getStatus().getName(),"Closed")){ + + //이슈가 closed 되어 있다면 + //되살려야 한다. + String status = "Reopen Issue"; + updateIssueStatus(issue, status); + + IssueInput input = new IssueInputBuilder() + .setDescription("==== 주의 : 확인이 필요한 a-RMS 요구사항과 재 연결된 이슈 입니다. ===\n" + + "a-RMS 에서 제공하는 요구사항 이슈 타입입니다.\n" + + "자동으로 관리되므로 이슈를 강제로 삭제하지 마세요\n" + + "아래 링크에서 요구사항을 확인 할 수 있습니다.\n" + + "=========================================\n" + + //BaseURL + /auth-anon/api/arms/reqAdd/테이블명/요구사항아이디 + "http://www.a-rms.net/auth-user/api/arms/reqSearch/" + reqaddTableName + "/" + statusDTO.getC_req_link() + "\n" + + "=========================================\n" + + "본 이슈 하위로 Sub-Task를 만들어서 개발을 하시거나\n" + + "관련한 이슈를 연결 하세요") + .setFieldValue(IssueFieldId.LABELS_FIELD.id, Collections.singleton(new String("a-RMS_재연결_요구사항"))) + .build(); + restClient.getIssueClient() + .updateIssue(statusDTO.getC_jira_req_issue_key(), input) + .claim(); + + Collection fieldInputs = Collections.EMPTY_LIST; + + updateIssueStatus(issue, "Start Progress", fieldInputs, Comment.valueOf("본 이슈는 관리대상에서 삭제되었다가 재 연결한 경우입니다. 주의가 필요합니다.")); + + } + + } + + + + } + //그리고 req_id 가 0 이고, req_name 이 disable 이면 //이건 지워진 요구사항 이슈를 다시 되살리는 거야 //그러니까 이슈 업데이트 해주고 다시