diff --git a/src/main/java/com/urpsys/itmsapi/rem/controller/ReportController.java b/src/main/java/com/urpsys/itmsapi/rem/controller/ReportController.java index 8f8ccaf2..e7648fad 100644 --- a/src/main/java/com/urpsys/itmsapi/rem/controller/ReportController.java +++ b/src/main/java/com/urpsys/itmsapi/rem/controller/ReportController.java @@ -46,7 +46,7 @@ public class ReportController ReportService reportService; // 보고서 양식 관리 서비스 /** - * 보고서 양식 목록 조회 + * 보고서 양식 목록 조회(보고서 작성) * @author urp 인프라본부 나혁제 * 작성일 : 2025.02.08 */ diff --git a/src/main/java/com/urpsys/itmsapi/rem/service/ReportService.java b/src/main/java/com/urpsys/itmsapi/rem/service/ReportService.java index 4ab7cd00..8cf2c142 100644 --- a/src/main/java/com/urpsys/itmsapi/rem/service/ReportService.java +++ b/src/main/java/com/urpsys/itmsapi/rem/service/ReportService.java @@ -40,7 +40,7 @@ public class ReportService { return reportDao.getReportForms(inMap); } - + // 보고서 양식 목록 조회 건수 public int getReportFormsCnt(LinkedHashMap inMap) throws Exception { diff --git a/src/main/java/com/urpsys/itmsapi/srm/controller/ReportOtherController.java b/src/main/java/com/urpsys/itmsapi/srm/controller/ReportOtherController.java new file mode 100644 index 00000000..3b4f9279 --- /dev/null +++ b/src/main/java/com/urpsys/itmsapi/srm/controller/ReportOtherController.java @@ -0,0 +1,591 @@ +package com.urpsys.itmsapi.srm.controller; + +import java.util.LinkedHashMap; +import java.util.List; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.RestController; + +import com.urpsys.baseapi.common.util.CommonUtil; +import com.urpsys.baseapi.common.util.ResultData; +import com.urpsys.baseapi.domain.TokenInfo; +import com.urpsys.itmsapi.srm.service.ReportOtherService; +import com.urpsys.itmsapi.srm.service.SvcDeskService; + +import lombok.extern.slf4j.Slf4j; + +/** + * 기타 보고서을 처리하는 API Controller 클래스 + * @author urp 인프라본부 나혁제 + * @since 2025.10.15 + * @version 1.0 + * @see + * + *
+ * << 개정이력(Modification Information) >>
+ *
+ *  수정일          수정자           수정내용
+ *  ----------   --------   ---------------------------
+ *  2025.10.15    나혁제        최초 생성
+ *
+ *  
+ */ + +@Slf4j +@RestController +public class ReportOtherController +{ + @Autowired + ReportOtherService reportOtherService; // 이슈보고서 관리 서비스 + + @Autowired + SvcDeskService svcDeskService; // 서비스 인스던트 관리 서비스 + + /** + * 이슈보고서 목록 조회 + * @author urp 인프라본부 나혁제 + * 작성일 : 2025.02.25 + */ + @ResponseBody + @RequestMapping(value="/srm/searchReportOther.do") + public ResponseEntity searchReportOther( @RequestBody LinkedHashMap requestMap + , HttpServletRequest request + , HttpServletResponse response + ) throws Exception + { + log.info("\n\n\n\n\n"); + log.info(">>>>>>>>>>>>>>>>>>>>>>>>> /srm/searchReportOther.do <<<<<<<<<<<<<<<<<<<<<<<<<"); + log.info("getRequestURI [{}]", request.getRequestURI() ); + log.info("입력값 확인 requestMap [{}]", requestMap.toString() ); + + LinkedHashMap resBody = new LinkedHashMap(); + + // 토큰정보 획득 + TokenInfo tokenInfo = CommonUtil.getAccessTokenInfo(request); + + log.info("tokenInfo [{}]", tokenInfo.toString() ); + log.info("tokenInfo [{}]", tokenInfo.getAuthorities() ); + + requestMap.put("reqUser", tokenInfo.getUniqId()); + // requestMap.put("reqUser", "0"); + + // 이슈보고서 목록 조회 + List> resultList = reportOtherService.searchReport(requestMap); + + // count 조회 + int totCnt = reportOtherService.searchReportCount(requestMap); + + resBody.put("resultList", resultList ); + resBody.put("totCnt" , totCnt ); + + log.info("<<<<<<<<<<<<<<<<<<<<<<<<< /srm/searchReportOther.do >>>>>>>>>>>>>>>>>>>>>>>>>"); + + return ResultData.ok(resBody); + } + + /** + * 이슈보고서 정보 상세조회 + * @author urp 인프라본부 나혁제 + * 작성일 : 2025.02.25 + */ + @ResponseBody + @RequestMapping(value="/srm/getReportWithBodyOther.do") + public ResponseEntity getReportWithBodyOther( @RequestBody LinkedHashMap requestMap + , HttpServletRequest request + , HttpServletResponse response + ) throws Exception + { + log.info("\n\n\n\n\n"); + log.info(">>>>>>>>>>>>>>>>>>>>>>>>> /srm/getReportWithBodyOther.do <<<<<<<<<<<<<<<<<<<<<<<<<"); + log.info("getRequestURI [{}]", request.getRequestURI() ); + log.info("입력값 확인 requestMap [{}]", requestMap.toString() ); + + LinkedHashMap resBody = new LinkedHashMap(); + + // 토큰정보 획득 + TokenInfo tokenInfo = CommonUtil.getAccessTokenInfo(request); + + int inReportSeq = (int)requestMap.get("inReportSeq"); + + // 보고서 정보 상세조회 + LinkedHashMap resultReportOther = reportOtherService.getReportWithBody(inReportSeq); + + int inIncidentSeq = 0; + if (resultReportOther.get("inIncidentSeq") != null) + { + inIncidentSeq = CommonUtil.zeroConvert(resultReportOther.get("inIncidentSeq")); + } + String incidentId = ""; + if( inIncidentSeq > 0) + { + LinkedHashMap tempMap = svcDeskService.getIncidentBySeq(inIncidentSeq); + incidentId = (String)tempMap.get("vcIncidentNum"); + } + + // 공유범위 + List> resultSharings = reportOtherService.getReportSharing(inReportSeq); + + String stxt = ""; + for(LinkedHashMap tempMap : resultSharings) + { + if (stxt.equals("")) + stxt = (String)tempMap.get("vcUserGroup"); + else + stxt = stxt + "," + (String)tempMap.get("vcUserGroup"); + } + + // 연결자산 + List> resultAssets = reportOtherService.getReportAssets(inReportSeq); + + // 결재정보 + List> resultApprovals = reportOtherService.getReportApproval(inReportSeq); + + String strRole = tokenInfo.getAuthorities(); + String sessUserSeq = tokenInfo.getUniqId(); + int privTemplSeq = 0; + + int approvalReq=0; + // 서비스 승인요청 상태 + if ((int)resultReportOther.get("inReportStatus") == 1) + { + // 0:대기, 1:승인요청, 2:반려, 3:승인 + for (LinkedHashMap app : resultApprovals) + { + if ( (int)app.get("inStatus") == 1 + && app.get("inUserSeq").equals(sessUserSeq) + ) + { + approvalReq=1; + break; + } + } + } + + if(strRole.indexOf("ROLE_ADMIN") > -1) + { + privTemplSeq=1; + } + + String privType=""; + /** + * 1. 본인이 작성한 경우 priv - 승인요청, 삭제(승인완료전) 2. 슈퍼유저인 경우 - 모든권한 허용 + **/ + if (privTemplSeq == 1 || privTemplSeq ==2) + { + privType = "super"; + } + else + { + // mine : 접수자 + if (resultReportOther.get("inRegUser").equals(sessUserSeq)) + { + privType = "mine"; + } + else + { + privType = "nothing"; + } + } + + resBody.put("sharingTxt" , stxt ); // String + resBody.put("approvalReq" , approvalReq ); // int + resBody.put("privType" , privType ); // String + resBody.put("incidentId" , incidentId ); // String + + resBody.put("resultReportOther" , resultReportOther ); // Map + resBody.put("resultSharings" , resultSharings ); // List + resBody.put("resultAssets" , resultAssets ); // List + resBody.put("resultApprovals" , resultApprovals ); // List + + log.info("<<<<<<<<<<<<<<<<<<<<<<<<< /srm/getReportWithBodyOther.do >>>>>>>>>>>>>>>>>>>>>>>>>"); + + return ResultData.ok(resBody); + } + + /** + * 이슈보고서 등록 + * @author urp 인프라본부 나혁제 + * 작성일 : 2025.02.25 + */ + @ResponseBody + @RequestMapping(value="/srm/addReportOther.do") + public ResponseEntity addReportOther( @RequestBody LinkedHashMap requestMap + , HttpServletRequest request + , HttpServletResponse response + ) throws Exception + { + log.info("\n\n\n\n\n"); + log.info(">>>>>>>>>>>>>>>>>>>>>>>>> /srm/addReportOther.do <<<<<<<<<<<<<<<<<<<<<<<<<"); + log.info("getRequestURI [{}]", request.getRequestURI() ); + log.info("입력값 확인 requestMap [{}]", requestMap.toString() ); + + LinkedHashMap resBody = new LinkedHashMap(); + + LinkedHashMap reportVoMap = (LinkedHashMap)requestMap.get("reportVo" ); // 보고서 기본정보 + LinkedHashMap reqApprovalMap = (LinkedHashMap)requestMap.get("reqApprovalMap" ); // 승인요청 정보 + + List> assetList = (List>)requestMap.get("assetList"); + List> approvalsList = (List>)requestMap.get("approvalsList"); + List> fileList = (List>)requestMap.get("fileList"); + + // 보고서 등록 + LinkedHashMap returnMap = reportOtherService.addReport(reportVoMap, assetList, approvalsList, fileList, reqApprovalMap); + + if((int)returnMap.get("iSucc") > 0) + { + resBody.put("resultCd" , "0" ); + resBody.put("resultMsg" , "정상적으로 등록되었습니다." ); + resBody.put("inReportSeq" , returnMap.get("inReportSeq") ); + } + else + { + resBody.put("resultCd" , "-1" ); + resBody.put("resultMsg" , "보고서 등록중 오류가 발생 하였습니다." ); + resBody.put("inReportSeq" , -1 ); + } + + log.info("<<<<<<<<<<<<<<<<<<<<<<<<< /srm/addReportOther.do >>>>>>>>>>>>>>>>>>>>>>>>>"); + + return ResultData.ok(resBody); + } + + /** + * 이슈보고서 수정 + * @author urp 인프라본부 나혁제 + * 작성일 : 2025.02.25 + */ + @ResponseBody + @RequestMapping(value="/srm/updateReportOther.do") + public ResponseEntity updateReportOther( @RequestBody LinkedHashMap requestMap + , HttpServletRequest request + , HttpServletResponse response + ) throws Exception + { + log.info("\n\n\n\n\n"); + log.info(">>>>>>>>>>>>>>>>>>>>>>>>> /srm/updateReportOther.do <<<<<<<<<<<<<<<<<<<<<<<<<"); + log.info("getRequestURI [{}]", request.getRequestURI() ); + log.info("입력값 확인 requestMap [{}]", requestMap.toString() ); + + LinkedHashMap resBody = new LinkedHashMap(); + + LinkedHashMap reportVoMap = (LinkedHashMap)requestMap.get("reportVo" ); // 보고서 기본정보 + LinkedHashMap reqApprovalMap = (LinkedHashMap)requestMap.get("reqApprovalMap" ); // 승인요청 정보 + + List> assetList = (List>)requestMap.get("assetList"); + List> approvalsList = (List>)requestMap.get("approvalsList"); + List> fileList = (List>)requestMap.get("fileList"); + + // 보고서 수정 + int iSucc = reportOtherService.updateReport(reportVoMap, assetList, approvalsList, fileList, reqApprovalMap); + + if(iSucc > 0) + { + resBody.put("resultCd" , "0" ); + resBody.put("resultMsg", "정상적으로 수정되었습니다." ); + } + else + { + resBody.put("resultCd" , "-1" ); + resBody.put("resultMsg", "보고서 수정중 오류가 발생 하였습니다." ); + } + + log.info("<<<<<<<<<<<<<<<<<<<<<<<<< /srm/updateReportOther.do >>>>>>>>>>>>>>>>>>>>>>>>>"); + + return ResultData.ok(resBody); + } + + /** + * 이슈보고서 삭제 + * @author urp 인프라본부 나혁제 + * 작성일 : 2025.02.25 + */ + @ResponseBody + @RequestMapping(value="/srm/deleteReportOther.do") + public ResponseEntity deleteReportOther( @RequestBody LinkedHashMap requestMap + , HttpServletRequest request + , HttpServletResponse response + ) throws Exception + { + log.info("\n\n\n\n\n"); + log.info(">>>>>>>>>>>>>>>>>>>>>>>>> /srm/deleteReportOther.do <<<<<<<<<<<<<<<<<<<<<<<<<"); + log.info("getRequestURI [{}]", request.getRequestURI() ); + log.info("입력값 확인 requestMap [{}]", requestMap.toString() ); + + LinkedHashMap resBody = new LinkedHashMap(); + + LinkedHashMap reportVoMap = (LinkedHashMap)requestMap.get("reportVo"); // 보고서 기본정보 + + // 보고서 삭제 + int iSucc = reportOtherService.deleteReport(reportVoMap); + + if(iSucc > 0) + { + resBody.put("resultCd" , "0" ); + resBody.put("resultMsg", "정상적으로 수정되었습니다." ); + } + else + { + resBody.put("resultCd" , "-1" ); + resBody.put("resultMsg", "보고서 삭제중 오류가 발생 하였습니다." ); + } + + log.info("<<<<<<<<<<<<<<<<<<<<<<<<< /srm/deleteReportOther.do >>>>>>>>>>>>>>>>>>>>>>>>>"); + + return ResultData.ok(resBody); + } + + /** + * 이슈보고서 승인요청 + * @author urp 인프라본부 나혁제 + * 작성일 : 2025.02.25 + */ + @ResponseBody + @RequestMapping(value="/srm/procApprovalReportOther.do") + public ResponseEntity procApprovalReportOther( @RequestBody LinkedHashMap requestMap + , HttpServletRequest request + , HttpServletResponse response + ) throws Exception + { + log.info("\n\n\n\n\n"); + log.info(">>>>>>>>>>>>>>>>>>>>>>>>> /srm/procApprovalReportOther.do <<<<<<<<<<<<<<<<<<<<<<<<<"); + log.info("getRequestURI [{}]", request.getRequestURI() ); + log.info("입력값 확인 requestMap [{}]", requestMap.toString() ); + + LinkedHashMap resBody = new LinkedHashMap(); + + // 보고서 승인요청 + int iSucc = reportOtherService.procApprovalReport(requestMap); + + if(iSucc > 0) + { + resBody.put("resultCd" , "0" ); + resBody.put("resultMsg", "정상적으로 승인요청 되었습니다." ); + } + else + { + resBody.put("resultCd" , "-1" ); + resBody.put("resultMsg", "검검보고서 승인요청중 오류가 발생 하였습니다." ); + } + + log.info("<<<<<<<<<<<<<<<<<<<<<<<<< /srm/procApprovalReportOther.do >>>>>>>>>>>>>>>>>>>>>>>>>"); + + return ResultData.ok(resBody); + } + + /** + * 이슈보고서 승인 + * @author urp 인프라본부 나혁제 + * 작성일 : 2025.02.25 + */ + @ResponseBody + @RequestMapping(value="/srm/procApprovalOther.do") + public ResponseEntity procApprovalOther ( @RequestBody LinkedHashMap requestMap + , HttpServletRequest request + , HttpServletResponse response + ) throws Exception + { + log.info("\n\n\n\n\n"); + log.info(">>>>>>>>>>>>>>>>>>>>>>>>> /srm/procApprovalOther.do <<<<<<<<<<<<<<<<<<<<<<<<<"); + log.info("getRequestURI [{}]", request.getRequestURI() ); + log.info("입력값 확인 requestMap [{}]", requestMap.toString() ); + + LinkedHashMap resBody = new LinkedHashMap(); + + // 보고서 승인 + int iSucc = reportOtherService.procApproval(requestMap); + + // 상태 추출 + int inReportSeq = CommonUtil.zeroConvert((requestMap.get("inReportSeq"))); + LinkedHashMap vo = reportOtherService.getReportWithBody(inReportSeq); + + if(iSucc > 0) + { + resBody.put("resultCd" , "0" ); + resBody.put("resultMsg", "정상적으로 승인 되었습니다." ); + + resBody.put("resultInReportStatus" , CommonUtil.zeroConvert(vo.get("inReportStatus")) ); + } + else + { + resBody.put("resultCd" , "-1" ); + resBody.put("resultMsg", "점검보고서 승인중 오류가 발생 하였습니다." ); + resBody.put("resultInReportStatus" , -1 ); + } + + log.info("<<<<<<<<<<<<<<<<<<<<<<<<< /srm/procApprovalOther.do >>>>>>>>>>>>>>>>>>>>>>>>>"); + + return ResultData.ok(resBody); + } + + /** + * 이슈보고서 반려 + * @author urp 인프라본부 나혁제 + * 작성일 : 2025.02.25 + */ + @ResponseBody + @RequestMapping(value="/srm/rejectReportOther.do") + public ResponseEntity rejectReportOther( @RequestBody LinkedHashMap requestMap + , HttpServletRequest request + , HttpServletResponse response + ) throws Exception + { + log.info("\n\n\n\n\n"); + log.info(">>>>>>>>>>>>>>>>>>>>>>>>> /srm/rejectReportOther.do <<<<<<<<<<<<<<<<<<<<<<<<<"); + log.info("getRequestURI [{}]", request.getRequestURI() ); + log.info("입력값 확인 requestMap [{}]", requestMap.toString() ); + + LinkedHashMap resBody = new LinkedHashMap(); + + // 보고서 반려 + int iSucc = reportOtherService.rejectReport(requestMap); + + if(iSucc > 0) + { + resBody.put("resultCd" , "0" ); + resBody.put("resultMsg", "정상적으로 반려 되었습니다." ); + } + else + { + resBody.put("resultCd" , "-1" ); + resBody.put("resultMsg", "점검보고서 반려중 오류가 발생 하였습니다." ); + } + + log.info("<<<<<<<<<<<<<<<<<<<<<<<<< /srm/rejectReportOther.do >>>>>>>>>>>>>>>>>>>>>>>>>"); + + return ResultData.ok(resBody); + } + + /** + * 기타 보고서 초기 기준정보 조회 + * @author urp 인프라본부 나혁제 + * 작성일 : 2025.10.15 + */ + @ResponseBody + @RequestMapping(value="/srm/getInitReportOther.do") + public ResponseEntity getInitReportOther( @RequestBody LinkedHashMap requestMap + , HttpServletRequest request + , HttpServletResponse response + ) throws Exception + { + log.info("\n\n\n\n\n"); + log.info(">>>>>>>>>>>>>>>>>>>>>>>>> /srm/getInitReportOther.do <<<<<<<<<<<<<<<<<<<<<<<<<"); + log.info("getRequestURI [{}]", request.getRequestURI() ); + log.info("입력값 확인 requestMap [{}]", requestMap.toString() ); + + LinkedHashMap resBody = new LinkedHashMap(); + + int inInt = 0; + + // 서비스데스크 인스던트 정보 조회 + int inIncidentSeq = CommonUtil.zeroConvert(requestMap.get("inIncidentSeq")); + + // 보고서유형 + int inTask = CommonUtil.zeroConvert(requestMap.get("inTask")); + + LinkedHashMap resultIncident = new LinkedHashMap(); + + // 인스던트 정보 조회 + if(inIncidentSeq>0) + { + resultIncident = svcDeskService.getIncidentBySeq(inIncidentSeq); + } + + int inServiceCode = CommonUtil.zeroConvert(resultIncident.get("inServiceCode")); + + // 서비스정보 조회 + List> resultService = reportOtherService.getServiceCombo(inServiceCode); + + // 작업종류 조회 + LinkedHashMap resultTask = reportOtherService.getTaskCategory(inTask); + + // 보고서 양식 추출 + List> resultForm = reportOtherService.getReportForms(resultTask); + + resBody.put("resultIncident" , resultIncident ); + resBody.put("resultService" , resultService ); + resBody.put("resultTask" , resultTask ); + resBody.put("resultForm" , resultForm ); + + + log.info("<<<<<<<<<<<<<<<<<<<<<<<<< /srm/getInitReportOther.do >>>>>>>>>>>>>>>>>>>>>>>>>"); + + return ResultData.ok(resBody); + } + + /** + * 서비스정보 결재라인 목록 조회 + * @author urp 인프라본부 나혁제 + * 작성일 : 2025.02.25 + */ + @ResponseBody + @RequestMapping(value="/srm/getSvcApprovalListOther.do") + public ResponseEntity getSvcApprovalListOther( @RequestBody LinkedHashMap requestMap + , HttpServletRequest request + , HttpServletResponse response + ) throws Exception + { + log.info("\n\n\n\n\n"); + log.info(">>>>>>>>>>>>>>>>>>>>>>>>> /srm/getSvcApprovalListOther.do <<<<<<<<<<<<<<<<<<<<<<<<<"); + log.info("getRequestURI [{}]", request.getRequestURI() ); + log.info("입력값 확인 requestMap [{}]", requestMap.toString() ); + + LinkedHashMap resBody = new LinkedHashMap(); + + int inServiceCode = CommonUtil.zeroConvert(requestMap.get("inServiceCode")); + + log.info("inServiceCode [{}]", inServiceCode ); + + // 서비스 결재라인 조회 + List> resultList = reportOtherService.getSvcApprovalList(inServiceCode); + + resBody.put("resultList", resultList ); + + log.info("<<<<<<<<<<<<<<<<<<<<<<<<< /srm/getSvcApprovalListOther.do >>>>>>>>>>>>>>>>>>>>>>>>>"); + + return ResultData.ok(resBody); + } + + /** + * 보고서 양식 조회 + * @author urp 인프라본부 나혁제 + * 작성일 : 2025.02.25 + */ + @ResponseBody + @RequestMapping(value="/srm/getReportFormOther.do") + public ResponseEntity getReportFormOther( @RequestBody LinkedHashMap requestMap + , HttpServletRequest request + , HttpServletResponse response + ) throws Exception + { + log.info("\n\n\n\n\n"); + log.info(">>>>>>>>>>>>>>>>>>>>>>>>> /srm/getReportFormOther.do <<<<<<<<<<<<<<<<<<<<<<<<<"); + log.info("getRequestURI [{}]", request.getRequestURI() ); + log.info("입력값 확인 requestMap [{}]", requestMap.toString() ); + + LinkedHashMap resBody = new LinkedHashMap(); + + // 2025.05.21 나혁제 출력인자 변경 + // 보고서 양식 조회 + LinkedHashMap resultMap = reportOtherService.getReportForm(requestMap); + + resBody.put("resultMap", resultMap ); + + log.info("<<<<<<<<<<<<<<<<<<<<<<<<< /srm/getReportFormOther.do >>>>>>>>>>>>>>>>>>>>>>>>>"); + + return ResultData.ok(resBody); + } + + + + + + + +} diff --git a/src/main/java/com/urpsys/itmsapi/srm/dao/ReportOtherDao.java b/src/main/java/com/urpsys/itmsapi/srm/dao/ReportOtherDao.java new file mode 100644 index 00000000..e4408d29 --- /dev/null +++ b/src/main/java/com/urpsys/itmsapi/srm/dao/ReportOtherDao.java @@ -0,0 +1,115 @@ +package com.urpsys.itmsapi.srm.dao; + +import java.util.LinkedHashMap; +import java.util.List; + +import org.apache.ibatis.annotations.Mapper; +import org.springframework.stereotype.Repository; + +/** + * 기타보고서 관리에 대한 DAO 클래스를 정의 + * + * @author urp 인프라본부 나혁제 + * @since 2025.10.15 + * @version 1.0.0 + * @see + * + *
+ *
+ * << 개정이력(Modification information) >>
+ *
+ *   수정일        수정자            수정내용
+ * -----------  ---------    ------------------------
+ * 2025.10.15    나혁제          최초작성
+ *
+ * 
+ */ + +@Mapper +@Repository +public interface ReportOtherDao +{ + // 이슈보고서 목록 조회 + public List> searchReport(LinkedHashMap inMap) throws Exception; + + // 이슈보고서 목록 조회 건수 + public int searchReportCount(LinkedHashMap inMap) throws Exception; + + + // 보고서 양식 목록 추출 + public List> getReportForms(LinkedHashMap inMap) throws Exception; + + // 2025.05.21 나혁제 출력인자 변경 + // 보고서 양식 추출 + public LinkedHashMap getReportForm(LinkedHashMap inMap) throws Exception; + + // 서비스 정보 목록 추출 + public List> getServiceCombo(int inInt) throws Exception; + + // 작업목록 추출 + public LinkedHashMap getTaskCategory(int inInt) throws Exception; + + // 서비스 결재라인 조회 + public List> getSvcApprovalList(int inInt) throws Exception; + + // 메일전송 대상자 조회 + public List> getReportMailReciever(LinkedHashMap inMap) throws Exception; + + + + // 보고서정보 상세조회 + public LinkedHashMap getReportWithBody(int inInt) throws Exception; + + // 보고서 공유그룹 조회 + public List> getReportSharing(int inInt) throws Exception; + + // 보고서 지산 구조 정보 조회 + public List> getReportAssets(int inInt) throws Exception; + + // 보고서 결재 정보 조회 + public List> getReportApproval(int inInt) throws Exception; + + + + + // 보고서 등록 + public int addReport(LinkedHashMap inMap) throws Exception; + + // 보고서 자산 구조 등록 + public int addReportAssets(LinkedHashMap inMap) throws Exception; + + // 보고서 결재정보 등록 + public int addReportApproval(LinkedHashMap inMap) throws Exception; + + // 보고서 공유정보 등록 + public int addReportSharing(LinkedHashMap inMap) throws Exception; + + // 보고서 변경 + public int updateReport(LinkedHashMap inMap) throws Exception; + + // 보고서 공유그룹 삭제 + public int deleteReportSharing(int inInt) throws Exception; + + // 보고서 자산 구조 삭제 + public int deleteReportAssetAll(int inInt) throws Exception; + + // 보고서 결재정보 삭제 + public int deleteReportApproval(int inInt) throws Exception; + + // 보고서 대기 상태로 변경 + public int approvalInit(int inInt) throws Exception; + + // 보고서 삭제 + public int deleteReport(int inInt) throws Exception; + + // 승인요청 + public int procApprovalReport(LinkedHashMap inMap) throws Exception; + + // 승인 + public int procApproval(LinkedHashMap inMap) throws Exception; + + // 반려 + public int rejectReport(LinkedHashMap inMap) throws Exception; + + +} diff --git a/src/main/java/com/urpsys/itmsapi/srm/service/ReportOtherService.java b/src/main/java/com/urpsys/itmsapi/srm/service/ReportOtherService.java new file mode 100644 index 00000000..79921377 --- /dev/null +++ b/src/main/java/com/urpsys/itmsapi/srm/service/ReportOtherService.java @@ -0,0 +1,321 @@ +package com.urpsys.itmsapi.srm.service; + +import java.util.LinkedHashMap; +import java.util.List; + +import javax.annotation.Resource; + +import org.egovframe.rte.fdl.idgnr.EgovIdGnrService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import com.urpsys.baseapi.common.util.CommonUtil; +import com.urpsys.itmsapi.cmm.service.FileManageService; +import com.urpsys.itmsapi.srm.dao.ReportOtherDao; + +/** + * 기타 보고서 정보에 관한 비즈니스 구현 클래스를 정의 + * + * @author urp 인프라본부 나혁제 + * @since 2025.10.15 + * @version 1.0.0 + * @see + * + *
+ *
+ * << 개정이력(Modification information) >>
+ *
+ *   수정일       수정자      수정내용
+ * -----------  ---------    ------------------------
+ * 2025.10.15   나혁제      최초작성
+ *
+ *      
+ */ + +@Service +@Transactional +public class ReportOtherService +{ + @Autowired + ReportOtherDao reportOtherDao; + + @Autowired + HomeService homeService; + + @Autowired + FileManageService fileManageService; // 파일처리 + + /** 보고서ID 추출 */ + @Resource(name="egovRptIdGnrService") + private EgovIdGnrService egovRptIdGnrService; + + + // 이슈보고서 목록 조회 + public List> searchReport(LinkedHashMap inMap) throws Exception + { + inMap.put("groups", homeService.getMyUserGroups((String)inMap.get("reqUser"))); + return reportOtherDao.searchReport(inMap); + } + + // 이슈보고서 목록 조회 건수 + public int searchReportCount(LinkedHashMap inMap) throws Exception + { + return reportOtherDao.searchReportCount(inMap); + } + + // 이슈보고서 양식 목록 추출 + public List> getReportForms(LinkedHashMap inMap) throws Exception + { + return reportOtherDao.getReportForms(inMap); + } + + // 2025.05.21 나혁제 출력인자 변경 + // 이슈보고서 양식 추출 + public LinkedHashMap getReportForm(LinkedHashMap inMap) throws Exception + { + return reportOtherDao.getReportForm(inMap); + } + + // 서비스 정보 목록 추출 + public List> getServiceCombo(int inInt) throws Exception + { + return reportOtherDao.getServiceCombo(inInt); + } + + // 작업목록 추출 + public LinkedHashMap getTaskCategory(int inInt) throws Exception + { + return reportOtherDao.getTaskCategory(inInt); + } + + // 서비스 결재라인 조회 + public List> getSvcApprovalList(int inInt) throws Exception + { + return reportOtherDao.getSvcApprovalList(inInt); + } + + + // 이슈보고서 상세조회 + public LinkedHashMap getReportWithBody(int inInt) throws Exception + { + return reportOtherDao.getReportWithBody(inInt); + } + + // 이슈보고서 지산 구조 정보 조회 + public List> getReportAssets(int inInt) throws Exception + { + return reportOtherDao.getReportAssets(inInt); + } + + // 이슈보고서 결재 정보 조회 + public List> getReportApproval(int inInt) throws Exception + { + return reportOtherDao.getReportApproval(inInt); + } + + // 이슈보고서 공유그룹 조회 + public List> getReportSharing(int inInt) throws Exception + { + return reportOtherDao.getReportSharing(inInt); + } + + // 메일전송 대상자 조회 + public List> getReportMailReciever(LinkedHashMap inMap) throws Exception + { + return reportOtherDao.getReportMailReciever(inMap); + } + + + + + + + + + // 이슈보고서 등록처리 + public LinkedHashMap addReport( LinkedHashMap inMap + , List> assetList + , List> approvalsList + , List> fileList + , LinkedHashMap reqApprovalMap + ) throws Exception + { + String strReportId = generateRptId(); + inMap.put("vcReportId", strReportId); + + int iSucc = reportOtherDao.addReport(inMap); + + // 보고서 자산 구조 입력 + if(assetList != null && assetList.size()>0) + { + for(LinkedHashMap tempMap : assetList) + { + tempMap.put("inReportSeq", inMap.get("inReportSeq")); + + reportOtherDao.addReportAssets(tempMap); + } + } + + // 결제라인 입력 + if(approvalsList != null && approvalsList.size()>0) + { + for(LinkedHashMap approvalMap : approvalsList) + { + approvalMap.put("inReportSeq", inMap.get("inReportSeq")); + + reportOtherDao.addReportApproval(approvalMap); + } + } + + // 파일정보저장 + if( fileList != null + && fileList.size()>0) + { + fileManageService.insertFileInfs(fileList); + } + + // 승인요청 처리 + if(reqApprovalMap.get("reqApprovalYn") != null && reqApprovalMap.get("reqApprovalYn").equals("Y")) + { + reqApprovalMap.put("inReportSeq", inMap.get("inReportSeq")); + procApprovalReport(reqApprovalMap); + } + + LinkedHashMap returnMap = new LinkedHashMap(); + + returnMap.put("iSucc" , iSucc); + returnMap.put("inReportSeq" , inMap.get("inReportSeq")); + + return returnMap; + } + + // 이슈보고서 변경처리 + public int updateReport( LinkedHashMap inMap + , List> assetList + , List> approvalsList + , List> fileList + , LinkedHashMap reqApprovalMap + ) throws Exception + { + int inReportStatus = CommonUtil.zeroConvert(inMap.get("inReportStatus")); + int inReportSeq = CommonUtil.zeroConvert(inMap.get("inReportSeq")); + + int iSucc = reportOtherDao.updateReport(inMap); + + // 보고서 자산 구조 입력 + reportOtherDao.deleteReportAssetAll(inReportSeq); + if(assetList != null && assetList.size()>0) + { + for(LinkedHashMap tempMap : assetList) + { + tempMap.put("inReportSeq", inMap.get("inReportSeq")); + + reportOtherDao.addReportAssets(tempMap); + } + } + + // 결제라인 입력 + if(inReportStatus == 0) + { + reportOtherDao.deleteReportApproval(inReportSeq); + + if(approvalsList != null && approvalsList.size()>0) + { + for(LinkedHashMap approvalMap : approvalsList) + { + approvalMap.put("inReportSeq", inMap.get("inReportSeq")); + reportOtherDao.addReportApproval(approvalMap); + } + } + } + else + { + if(approvalsList != null && approvalsList.size()>0) + { + reportOtherDao.deleteReportApproval(inReportSeq); + + for(LinkedHashMap approvalMap : approvalsList) + { + approvalMap.put("inReportSeq", inMap.get("inReportSeq")); + reportOtherDao.addReportApproval(approvalMap); + } + reportOtherDao.approvalInit(inReportSeq); + } + } + + // 파일정보저장 + if( fileList != null && fileList.size()>0) + { + if(inMap.get("atchFileInUpGb").equals("U")) + { + // 상세 정보만 입력 + fileManageService.updateFileInfs(fileList); + } + else + { + // 마스터+상세 정보 입력 처리 + fileManageService.insertFileInfs(fileList); + } + } + + // 승인요청 처리 + if(reqApprovalMap.get("reqApprovalYn") != null && reqApprovalMap.get("reqApprovalYn").equals("Y")) + { + procApprovalReport(reqApprovalMap); + } + + return iSucc; + } + + // 이슈보고서 삭제 + public int deleteReport(LinkedHashMap inMap) throws Exception + { + int inReportSeq = CommonUtil.zeroConvert(inMap.get("inReportSeq")); + + int iSucc = reportOtherDao.deleteReport(inReportSeq); + + if(iSucc>0) + { + reportOtherDao.deleteReportApproval(inReportSeq); + reportOtherDao.deleteReportAssetAll(inReportSeq); + } + + return iSucc; + } + + // 이슈보고서 승인요청 + public int procApprovalReport(LinkedHashMap inMap) throws Exception + { + return reportOtherDao.procApprovalReport(inMap); + } + + // 이슈보고서 승인 + public int procApproval(LinkedHashMap inMap) throws Exception + { + return reportOtherDao.procApproval(inMap); + } + + // 이슈보고서 반려 + public int rejectReport(LinkedHashMap inMap) throws Exception + { + return reportOtherDao.rejectReport(inMap); + } + + // 보고서ID 추출 + private String generateRptId() throws Exception + { + String strIncidentId = CommonUtil.getKST("YY-MMdd-") + egovRptIdGnrService.getNextStringId(); + return strIncidentId; + } + + + + + + + + + + +} diff --git a/src/main/resources/mapper/primarydb/sqlmap/itms/rem/ReportMapper.xml b/src/main/resources/mapper/primarydb/sqlmap/itms/rem/ReportMapper.xml index 75c5218e..2341967d 100644 --- a/src/main/resources/mapper/primarydb/sqlmap/itms/rem/ReportMapper.xml +++ b/src/main/resources/mapper/primarydb/sqlmap/itms/rem/ReportMapper.xml @@ -24,6 +24,8 @@ + + diff --git a/src/main/resources/mapper/primarydb/sqlmap/itms/srm/ReportOtherMapper.xml b/src/main/resources/mapper/primarydb/sqlmap/itms/srm/ReportOtherMapper.xml new file mode 100644 index 00000000..a6dd533f --- /dev/null +++ b/src/main/resources/mapper/primarydb/sqlmap/itms/srm/ReportOtherMapper.xml @@ -0,0 +1,669 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + LIMIT #{recordCountPerPage} OFFSET #{firstIndex} + + + + + + AND ( + A.IN_REPORT_SEQ IN ( SELECT IN_TARGET_SEQ + FROM CM_SHARING_MEMBER + WHERE IN_TYPE=1 + AND IN_USER_GROUP_SEQ IN (#{groups}) ) + OR + A.IN_REPORT_SEQ NOT IN (SELECT IN_TARGET_SEQ + FROM CM_SHARING_MEMBER + WHERE IN_TYPE=1) + ) + + + + + + + AND ( + A.IN_REG_USER IN (SELECT IN_USER_SEQ + FROM CM_USER + WHERE IN_COMPANY_SEQ=${reqUserCompany}) + ) + + + + + AND A.IN_REPORT_STATUS IN (${status}) + AND A.VC_REPORT_ID LIKE "%${reportId}%" + AND C.VC_INCIDENT_NUM LIKE "%${incidentNum}%" + AND A.VC_REPORT_TITLE LIKE "%${reportTitle}%" + AND A.VC_REG_USER LIKE "%${regUser}%" + AND A.IN_TASK_USER = #{taskUser} + AND A.IN_TASK = ${taskCode} + = UNIX_TIMESTAMP("${sdate}")]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + /* ReportOtherDao.addReport */ + INSERT INTO CM_REPORT + ( + IN_REPORT_STATUS + , VC_REPORT_ID + , IN_INCIDENT_SEQ + , IN_TASK + , IN_PERCALL_PRICE + , DT_START_DATETIME, + DT_FINISH_DATETIME, + IN_DOWNTIME + , IN_TASK_USER + , VC_TASK_USER + , IN_REG_USER + , VC_REG_USER + , IN_SERVICE_CODE + , DT_DOWNSTART_DATETIME, + DT_DOWNFINISH_DATETIME, + DT_LAST_UPDATE + , VC_REPORT_TITLE + , TX_REPORT_BODY + , ATCH_FILE_ID + ) + VALUES + ( + #{inReportStatus} + , "${vcReportId}" + , #{inIncidentSeq} + , #{inTask} + , #{inPercallPrice} + , "${dtStartDatetime}", + "${dtFinishDatetime}", + #{inDowntime} + , #{inTaskUser} + , "${vcTaskUser}" + , #{inRegUser} + , "${vcRegUser}" + , #{inServiceCode} + , "${dtDownstartDatetime}", + "${dtDownfinishDatetime}", + now() + , "${vcReportTitle}" + , "${txReportBody}" + , #{atchFileId} + ) + + + + /* ReportOtherDao.addReportAssets */ + INSERT INTO CM_REPORT_ASSET + ( + IN_REPORT_SEQ + , IN_ASSET_SEQ + , TX_COMMENT + ) + VALUES + ( + #{inReportSeq} + , #{inAssetSeq} + , '${txComment}' + ) + + + + /* ReportOtherDao.addReportSharing */ + INSERT INTO CM_SHARING_MEMBER + ( IN_TYPE + , IN_TARGET_SEQ + , IN_USER_SEQ + , IN_USER_GROUP_SEQ + ) + VALUES + ( + 1 + , #{inReportSeq} + , 0 + , #{sharing.inUserGroupSeq} + ) + + + + /* ReportOtherDao.addReportApproval */ + INSERT INTO CM_REPORT_APPROVAL + ( + IN_REPORT_SEQ + , IN_ORDER + , IN_USER_SEQ + , VC_USER_NAME + , IN_STATUS + , TX_COMMENT + , DT_APPROVAL_DATETIME + ) + VALUES + ( + #{inReportSeq} + , #{idx} + , #{inUserSeq} + , "${vcUserName}" + , 0 + , "" + , null + ) + + + + + + + + + + + + /* ReportOtherDao.updateReport */ + UPDATE CM_REPORT + SET IN_TASK=#{inTask} + , DT_START_DATETIME="${dtStartDatetime}", + DT_START_DATETIME=null, + DT_FINISH_DATETIME="${dtFinishDatetime}", + DT_FINISH_DATETIME=null, + IN_DOWNTIME=#{inDowntime} + , IN_PERCALL_PRICE=#{inPercallPrice} + , IN_TASK_USER=#{inTaskUser} + , VC_TASK_USER=#{vcTaskUser} + , IN_REG_USER=#{inRegUser} + , VC_REG_USER=#{vcRegUser} + , IN_SERVICE_CODE=#{inServiceCode} + , DT_DOWNSTART_DATETIME="${dtDownstartDatetime}", + DT_DOWNSTART_DATETIME=null, + DT_DOWNFINISH_DATETIME="${dtDownfinishDatetime}", + DT_DOWNFINISH_DATETIME=null, + DT_LAST_UPDATE=now() + , VC_REPORT_TITLE=#{vcReportTitle} + , TX_REPORT_BODY=#{txReportBody} + , ATCH_FILE_ID=#{atchFileId} + WHERE IN_REPORT_SEQ=${inReportSeq} + + + + /* ReportOtherDao.deleteReportAssetAll */ + DELETE FROM CM_REPORT_ASSET + WHERE IN_REPORT_SEQ = #{value} + + + + /* ReportOtherDao.deleteReportSharing */ + DELETE FROM CM_SHARING_MEMBER + WHERE IN_TYPE=1 + AND IN_TARGET_SEQ=#{value} + + + + /* ReportOtherDao.deleteReportApproval */ + DELETE FROM CM_REPORT_APPROVAL + WHERE IN_REPORT_SEQ=#{inReportSeq} + + + + + /* ReportOtherDao.approvalInit */ + UPDATE CM_REPORT + SET IN_REPORT_STATUS=0 + , DT_REQ_APPROVAL_DATETIME = NULL + , TX_REQ_APPROVAL_COMMENT = '' + WHERE IN_REPORT_SEQ=#{value} + + + + /* ReportOtherDao.deleteReport */ + DELETE FROM CM_REPORT + WHERE IN_REPORT_SEQ = #{inReportSeq} + + + + { call PROC_REQ_APPROVAL( + 1 + , #{inReportSeq} + , #{inUserSeq} + , "${txComment}" + ) + } + + + + { call PROC_APPROVAL( + 1 + , #{inReportSeq} + , #{inUserSeq} + ,"${txComment}" + ) + } + + + + { call PROC_REJECT( + 1 + , #{inReportSeq} + , #{inUserSeq} + , "${txComment}" + ) + } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file