
--- src/main/java/com/takensoft/taken_bi_manager/common/code/dao/CmmnCodeDAO.java
+++ src/main/java/com/takensoft/taken_bi_manager/common/code/dao/CmmnCodeDAO.java
... | ... | @@ -2,10 +2,10 @@ |
2 | 2 |
|
3 | 3 |
import java.util.List; |
4 | 4 |
|
5 |
+import com.takensoft.taken_bi_manager.common.vo.HierachyVO; |
|
5 | 6 |
import org.apache.ibatis.annotations.Mapper; |
6 | 7 |
|
7 | 8 |
import com.takensoft.taken_bi_manager.common.code.vo.CmmnCode; |
8 |
-import com.takensoft.taken_bi_manager.user.member.vo.Member; |
|
9 | 9 |
|
10 | 10 |
/** |
11 | 11 |
* @author 김성원 |
... | ... | @@ -15,13 +15,13 @@ |
15 | 15 |
*/ |
16 | 16 |
@Mapper |
17 | 17 |
public interface CmmnCodeDAO { |
18 |
- |
|
19 | 18 |
/** |
20 | 19 |
* @author 김성원 |
21 | 20 |
* @since 2021.01.10 |
22 | 21 |
* |
23 | 22 |
* 그룹아이디밑 코드 리스트 가져오기 |
24 | 23 |
*/ |
25 |
- public List<CmmnCode> getCodeListByGroupId(String groupId) throws Exception; |
|
24 |
+ public List<CmmnCode> getCodeListByGroupId(String groupId) throws Exception; |
|
26 | 25 |
|
27 |
-} |
|
26 |
+ public List<HierachyVO> findChildNode(String id); |
|
27 |
+}(파일 끝에 줄바꿈 문자 없음) |
--- src/main/java/com/takensoft/taken_bi_manager/common/code/service/CmmnCodeService.java
+++ src/main/java/com/takensoft/taken_bi_manager/common/code/service/CmmnCodeService.java
... | ... | @@ -3,14 +3,16 @@ |
3 | 3 |
import java.util.List; |
4 | 4 |
|
5 | 5 |
import com.takensoft.taken_bi_manager.common.code.vo.CmmnCode; |
6 |
+import com.takensoft.taken_bi_manager.common.vo.HierachyVO; |
|
6 | 7 |
|
7 | 8 |
public interface CmmnCodeService { |
8 |
- |
|
9 | 9 |
/** |
10 | 10 |
* @author 김성원 |
11 | 11 |
* @since 2024.01.19 |
12 | 12 |
* |
13 | 13 |
* 공통코드 리스트 가져오기 |
14 | 14 |
*/ |
15 |
- public List<CmmnCode> getCodeListByGroupId(String groupId) throws Exception; |
|
16 |
-} |
|
15 |
+ public List<CmmnCode> getCodeListByGroupId(String groupId) throws Exception; |
|
16 |
+ |
|
17 |
+ public List<HierachyVO> findChildNode(String id) throws Exception; |
|
18 |
+}(파일 끝에 줄바꿈 문자 없음) |
--- src/main/java/com/takensoft/taken_bi_manager/common/code/service/impl/CmmnCodeServiceImpl.java
+++ src/main/java/com/takensoft/taken_bi_manager/common/code/service/impl/CmmnCodeServiceImpl.java
... | ... | @@ -2,6 +2,7 @@ |
2 | 2 |
|
3 | 3 |
import java.util.List; |
4 | 4 |
|
5 |
+import com.takensoft.taken_bi_manager.common.vo.HierachyVO; |
|
5 | 6 |
import org.springframework.beans.factory.annotation.Autowired; |
6 | 7 |
import org.springframework.stereotype.Service; |
7 | 8 |
|
... | ... | @@ -11,7 +12,6 @@ |
11 | 12 |
|
12 | 13 |
@Service |
13 | 14 |
public class CmmnCodeServiceImpl implements CmmnCodeService { |
14 |
- |
|
15 | 15 |
@Autowired |
16 | 16 |
private CmmnCodeDAO cmmnCodeDAO; |
17 | 17 |
|
... | ... | @@ -21,4 +21,13 @@ |
21 | 21 |
return cmmnCodeDAO.getCodeListByGroupId(groupId); |
22 | 22 |
} |
23 | 23 |
|
24 |
-} |
|
24 |
+ @Override |
|
25 |
+ public List<HierachyVO> findChildNode(String id) throws Exception { |
|
26 |
+ List<HierachyVO> childList = cmmnCodeDAO.findChildNode(id); |
|
27 |
+ for(HierachyVO vo : childList) { |
|
28 |
+ List<HierachyVO> child = findChildNode(vo.getId()); |
|
29 |
+ vo.setChildList(child); |
|
30 |
+ } |
|
31 |
+ return childList; |
|
32 |
+ } |
|
33 |
+}(파일 끝에 줄바꿈 문자 없음) |
--- src/main/java/com/takensoft/taken_bi_manager/common/code/vo/CmmnCode.java
+++ src/main/java/com/takensoft/taken_bi_manager/common/code/vo/CmmnCode.java
... | ... | @@ -14,8 +14,6 @@ |
14 | 14 |
@Getter |
15 | 15 |
@Setter |
16 | 16 |
public class CmmnCode { |
17 |
- |
|
18 |
- |
|
19 | 17 |
// 콩통코드 |
20 | 18 |
private String cmmnCode; |
21 | 19 |
|
... | ... | @@ -48,5 +46,4 @@ |
48 | 46 |
|
49 | 47 |
// 수정자 ID |
50 | 48 |
private String updtId; |
51 |
- |
|
52 |
-} |
|
49 |
+}(파일 끝에 줄바꿈 문자 없음) |
--- src/main/java/com/takensoft/taken_bi_manager/common/schedule/dao/ScheduleDAO.java
... | ... | @@ -1,68 +0,0 @@ |
1 | -package com.takensoft.taken_bi_manager.common.schedule.dao; | |
2 | - | |
3 | -import com.takensoft.taken_bi_manager.common.schedule.vo.Schedule; | |
4 | -import com.takensoft.taken_bi_manager.common.vo.CustomeResultMap; | |
5 | -import com.takensoft.taken_bi_manager.common.vo.SearchVO; | |
6 | -import org.apache.ibatis.annotations.Mapper; | |
7 | - | |
8 | -import java.util.HashMap; | |
9 | -import java.util.List; | |
10 | - | |
11 | -@Mapper | |
12 | -public interface ScheduleDAO { | |
13 | - /** | |
14 | - * @author 김성원 | |
15 | - * @since 2021.01.24 | |
16 | - * | |
17 | - * 스케줄 등록 | |
18 | - */ | |
19 | - public int conflictInsertSchedule (Schedule schedule) throws Exception; | |
20 | - | |
21 | - /** | |
22 | - * @author 김성원 | |
23 | - * @since 2021.01.24 | |
24 | - * | |
25 | - * 스케줄 목록 조회 | |
26 | - */ | |
27 | - public List<Schedule> selectScheduleList (SearchVO searchVO) throws Exception; | |
28 | - | |
29 | - /** | |
30 | - * @author 김성원 | |
31 | - * @since 2021.01.24 | |
32 | - * | |
33 | - * 스케줄 목록 개수 조회 | |
34 | - */ | |
35 | - public int selectScheduleListCount (SearchVO searchVO) throws Exception; | |
36 | - | |
37 | - /** | |
38 | - * @author 김성원 | |
39 | - * @since 2021.01.24 | |
40 | - * | |
41 | - * 스케줄 상세 조회 | |
42 | - */ | |
43 | - public Schedule selectSchedule (String id) throws Exception; | |
44 | - | |
45 | - /** | |
46 | - * @author 박정하 | |
47 | - * @since 2024.10.04 | |
48 | - * | |
49 | - * Diagram Id로 Schedule Id 구하기 | |
50 | - */ | |
51 | - public String selectScheduleIdRead(String diagramId) throws Exception; | |
52 | - | |
53 | - /** | |
54 | - * @author 박정하 | |
55 | - * @since 2024.10.04 | |
56 | - * | |
57 | - * 스케줄 정보 삭제 | |
58 | - */ | |
59 | - public int deleteSchedule(String schdulId) throws Exception; | |
60 | - | |
61 | - /** | |
62 | - * @author 박정하 | |
63 | - * @since 2024.10.04 | |
64 | - * | |
65 | - * 스케줄 상태 변경 | |
66 | - */ | |
67 | - public int scheduleSttusChange(HashMap<String, Object> params) throws Exception; | |
68 | -}(파일 끝에 줄바꿈 문자 없음) |
--- src/main/java/com/takensoft/taken_bi_manager/common/schedule/service/impl/ScheduleServiceImpl.java
... | ... | @@ -1,91 +0,0 @@ |
1 | -package com.takensoft.taken_bi_manager.common.schedule.service.impl; | |
2 | - | |
3 | -import com.takensoft.taken_bi_manager.common.schedule.dao.ScheduleDAO; | |
4 | -import com.takensoft.taken_bi_manager.common.schedule.service.ScheduleService; | |
5 | -import com.takensoft.taken_bi_manager.common.schedule.vo.Schedule; | |
6 | -import com.takensoft.taken_bi_manager.common.util.CommonUtil; | |
7 | -import com.takensoft.taken_bi_manager.common.util.StringUtil; | |
8 | -import com.takensoft.taken_bi_manager.common.vo.CustomeResultMap; | |
9 | -import com.takensoft.taken_bi_manager.common.vo.SearchVO; | |
10 | -import com.takensoft.taken_bi_manager.jobs.service.JobService; | |
11 | -import org.springframework.beans.factory.annotation.Autowired; | |
12 | -import org.springframework.stereotype.Service; | |
13 | - | |
14 | -import java.util.HashMap; | |
15 | - | |
16 | -@Service | |
17 | -public class ScheduleServiceImpl implements ScheduleService { | |
18 | - @Autowired | |
19 | - private ScheduleDAO scheduleDAO; | |
20 | - | |
21 | - @Autowired | |
22 | - private JobService jobService; | |
23 | - | |
24 | - /* | |
25 | - * 스케줄 등록 | |
26 | - */ | |
27 | - @Override | |
28 | - public int conflictInsertSchedule(Schedule schedule) throws Exception { | |
29 | - String group_id = jobService.insertJobGroup(schedule.getJobGroup()).getResultData().get("group_id").toString(); | |
30 | - schedule.setGroup_id(group_id); | |
31 | - if(StringUtil.isEmpty(schedule.getSchdul_id())){ | |
32 | - schedule.setSchdul_id(CommonUtil.getRandKey("SCHEDULE")); | |
33 | - schedule.setCreatId(CommonUtil.getLoginUserId()); | |
34 | - }else{ | |
35 | - schedule.setUpdtId(CommonUtil.getLoginUserId()); | |
36 | - } | |
37 | - return scheduleDAO.conflictInsertSchedule(schedule); | |
38 | - } | |
39 | - | |
40 | - /* | |
41 | - * 스케줄 목록 조회 | |
42 | - */ | |
43 | - @Override | |
44 | - public CustomeResultMap selectScheduleList(SearchVO searchVO) throws Exception { | |
45 | - int totalRows = scheduleDAO.selectScheduleListCount(searchVO); | |
46 | - searchVO.setTotalRows(totalRows); | |
47 | - CustomeResultMap map = new CustomeResultMap(); | |
48 | - map.getResultData().put("scheduleList", scheduleDAO.selectScheduleList(searchVO)); | |
49 | - map.getResultData().put("searchVO", searchVO); | |
50 | - return map; | |
51 | - } | |
52 | - | |
53 | - /* | |
54 | - * 스케줄 상세 조회 | |
55 | - */ | |
56 | - @Override | |
57 | - public Schedule selectSchedule(Schedule schedule) throws Exception { | |
58 | - Schedule sc = scheduleDAO.selectSchedule(schedule.getSchdul_id()); | |
59 | - sc.setJobGroup(jobService.selectJobGroup(sc.getGroup_id())); | |
60 | - return sc; | |
61 | - } | |
62 | - | |
63 | - /** | |
64 | - * @author 박정하 | |
65 | - * @since 2024.10.04 | |
66 | - * | |
67 | - * 스케줄 정보 삭제 | |
68 | - */ | |
69 | - @Override | |
70 | - public CustomeResultMap deleteSchedule(String schdulId) throws Exception { | |
71 | - CustomeResultMap result = new CustomeResultMap(); | |
72 | - result.getResultData().put("updateResult", scheduleDAO.deleteSchedule(schdulId)); | |
73 | - return result; | |
74 | - } | |
75 | - | |
76 | - /** | |
77 | - * @author 박정하 | |
78 | - * @since 2024.10.04 | |
79 | - * | |
80 | - * 스케줄 상태 변경 | |
81 | - */ | |
82 | - @Override | |
83 | - public CustomeResultMap scheduleSttusChange(String schdulId, String schdulSttus) throws Exception { | |
84 | - CustomeResultMap result = new CustomeResultMap(); | |
85 | - HashMap<String, Object> params = new HashMap<>(); | |
86 | - params.put("schdulId", schdulId); | |
87 | - params.put("schdulSttus", schdulSttus); | |
88 | - result.getResultData().put("updateResult", scheduleDAO.scheduleSttusChange(params)); | |
89 | - return result; | |
90 | - } | |
91 | -}(파일 끝에 줄바꿈 문자 없음) |
--- src/main/java/com/takensoft/taken_bi_manager/common/schedule/vo/Schedule.java
... | ... | @@ -1,86 +0,0 @@ |
1 | -package com.takensoft.taken_bi_manager.common.schedule.vo; | |
2 | - | |
3 | -import com.takensoft.taken_bi_manager.jobs.vo.JobGroup; | |
4 | -import lombok.Getter; | |
5 | -import lombok.Setter; | |
6 | - | |
7 | -import java.io.Serializable; | |
8 | -import java.sql.Timestamp; | |
9 | -import java.util.*; | |
10 | - | |
11 | -/** | |
12 | - * @author 김성원 | |
13 | - * @since 2021.12.28 | |
14 | - * | |
15 | - * 스케줄러 Domain 입니다. | |
16 | - */ | |
17 | -@Getter | |
18 | -@Setter | |
19 | -public class Schedule implements Serializable { | |
20 | - // 시리얼 버전 | |
21 | - private static final long serialVersionUID = 1L; | |
22 | - | |
23 | - // 스케줄러 고유 ID | |
24 | - private String schdul_id; | |
25 | - | |
26 | - // 스케줄러 그룹 id | |
27 | - private String group_id; | |
28 | - | |
29 | - // 스케줄러 명 | |
30 | - private String sj; | |
31 | - | |
32 | - // 스케줄러 명 | |
33 | - private String dc; | |
34 | - | |
35 | - // 스케쥴링 | |
36 | - private String cron; | |
37 | - | |
38 | - // cron 스케쥴링 한글 | |
39 | - private String cron_chrctr; | |
40 | - | |
41 | - // 스케쥴링 상태 | |
42 | - private String schdul_sttus = "run"; | |
43 | - | |
44 | - // 생성일 | |
45 | - private Timestamp creatDt; | |
46 | - | |
47 | - // 생성자ID | |
48 | - private String creatId; | |
49 | - | |
50 | - // 수정일 | |
51 | - private Timestamp updtDt; | |
52 | - | |
53 | - // 수정자 ID | |
54 | - private String updtId; | |
55 | - | |
56 | - /** | |
57 | - * 주기적 인지 아닌지 | |
58 | - * true: 주기적 | |
59 | - * false: 일시적 | |
60 | - */ | |
61 | - private boolean cycle_at; | |
62 | - | |
63 | - /** | |
64 | - * 사용여부(삭제 여부) | |
65 | - */ | |
66 | - private boolean use_at = true; | |
67 | - | |
68 | - /** | |
69 | - * 에러 존재 유무 | |
70 | - */ | |
71 | - private boolean error_at = false; | |
72 | - | |
73 | - private boolean isUsehighClassOption = false; | |
74 | - | |
75 | - private JobGroup jobGroup; | |
76 | - | |
77 | - /** | |
78 | - * 에러 로그 리스트 | |
79 | - */ | |
80 | - private List<ScheduleLog> ScheduleLogs; | |
81 | - | |
82 | - public Schedule(){ | |
83 | - ScheduleLogs = new ArrayList<>(); | |
84 | - jobGroup = new JobGroup(); | |
85 | - } | |
86 | -} |
--- src/main/java/com/takensoft/taken_bi_manager/common/schedule/vo/ScheduleLog.java
... | ... | @@ -1,66 +0,0 @@ |
1 | -package com.takensoft.taken_bi_manager.common.schedule.vo; | |
2 | - | |
3 | -import lombok.Getter; | |
4 | -import lombok.Setter; | |
5 | - | |
6 | -import java.io.Serializable; | |
7 | - | |
8 | -/** | |
9 | - * @author 김성원 | |
10 | - * @since 2024 02.26 | |
11 | - * | |
12 | - * 스케줄러 Domain 상세정보 입니다. | |
13 | - */ | |
14 | -@Getter | |
15 | -@Setter | |
16 | -public class ScheduleLog implements Serializable { | |
17 | - | |
18 | - /** | |
19 | - * 시리얼 버전 | |
20 | - */ | |
21 | - private static final long serialVersionUID = 1L; | |
22 | - | |
23 | - /** | |
24 | - * 스케줄러 고유 ID | |
25 | - */ | |
26 | - private String schdulId; | |
27 | - | |
28 | - | |
29 | - /** | |
30 | - * 실행일 | |
31 | - */ | |
32 | - private String executDe; | |
33 | - | |
34 | - | |
35 | - /** | |
36 | - * 스케쥴링 상태 | |
37 | - */ | |
38 | - private String schdulSttus; | |
39 | - | |
40 | - | |
41 | - /** | |
42 | - * 로그정보 | |
43 | - */ | |
44 | - private String logInfo; | |
45 | - | |
46 | - | |
47 | - /** | |
48 | - * Job 의 타입코드입니다.(공통코드 참조예정) | |
49 | - */ | |
50 | - private String jobCode; | |
51 | - | |
52 | - | |
53 | - /** | |
54 | - * 실행 순서 | |
55 | - */ | |
56 | - private int indx; | |
57 | - | |
58 | - | |
59 | - /** | |
60 | - * 오류 사항 확인 유무 | |
61 | - */ | |
62 | - private boolean success; | |
63 | - | |
64 | - | |
65 | - | |
66 | -} |
--- src/main/java/com/takensoft/taken_bi_manager/common/util/CommonUtil.java
+++ src/main/java/com/takensoft/taken_bi_manager/common/util/CommonUtil.java
... | ... | @@ -3,9 +3,6 @@ |
3 | 3 |
|
4 | 4 |
|
5 | 5 |
import java.io.IOException; |
6 |
-import java.lang.reflect.Field; |
|
7 |
-import java.lang.reflect.Modifier; |
|
8 |
-import java.math.BigDecimal; |
|
9 | 6 |
import java.net.InetAddress; |
10 | 7 |
import java.net.InetSocketAddress; |
11 | 8 |
import java.net.Socket; |
... | ... | @@ -13,13 +10,11 @@ |
13 | 10 |
import java.text.SimpleDateFormat; |
14 | 11 |
import java.util.ArrayList; |
15 | 12 |
import java.util.Arrays; |
16 |
-import java.util.Collection; |
|
17 | 13 |
import java.util.Date; |
18 | 14 |
import java.util.HashMap; |
19 | 15 |
import java.util.LinkedHashMap; |
20 | 16 |
import java.util.List; |
21 | 17 |
import java.util.Map; |
22 |
-import java.util.Set; |
|
23 | 18 |
import java.util.UUID; |
24 | 19 |
|
25 | 20 |
import jakarta.servlet.http.HttpServletRequest; |
... | ... | @@ -36,7 +31,6 @@ |
36 | 31 |
import com.fasterxml.jackson.databind.JsonMappingException; |
37 | 32 |
import com.fasterxml.jackson.databind.ObjectMapper; |
38 | 33 |
import com.fasterxml.jackson.databind.SerializationFeature; |
39 |
-import com.takensoft.taken_bi_manager.user.member.vo.Member; |
|
40 | 34 |
|
41 | 35 |
public class CommonUtil { |
42 | 36 |
|
--- src/main/java/com/takensoft/taken_bi_manager/controller/cmmn/CommonController.java
+++ src/main/java/com/takensoft/taken_bi_manager/controller/cmmn/CommonController.java
... | ... | @@ -6,7 +6,8 @@ |
6 | 6 |
import com.takensoft.taken_bi_manager.common.connection.ehojoPlus.vo.ConnectionEhojoVO; |
7 | 7 |
import com.takensoft.taken_bi_manager.common.connection.db.vo.ConnectionDB; |
8 | 8 |
import com.takensoft.taken_bi_manager.common.file.vo.FileInfo; |
9 |
-import com.takensoft.taken_bi_manager.common.schedule.vo.Schedule; |
|
9 |
+import com.takensoft.taken_bi_manager.schedule.dto.NodeDTO; |
|
10 |
+import com.takensoft.taken_bi_manager.schedule.vo.ScheduleVO; |
|
10 | 11 |
import com.takensoft.taken_bi_manager.common.stylesheet.vo.Background_style; |
11 | 12 |
import com.takensoft.taken_bi_manager.common.stylesheet.vo.BorderStyle; |
12 | 13 |
import com.takensoft.taken_bi_manager.common.stylesheet.vo.FontStyle; |
... | ... | @@ -18,8 +19,6 @@ |
18 | 19 |
import com.takensoft.taken_bi_manager.data.vo.DataTable; |
19 | 20 |
import com.takensoft.taken_bi_manager.data.vo.Dataset; |
20 | 21 |
import com.takensoft.taken_bi_manager.data.vo.DatasetPost; |
21 |
-import com.takensoft.taken_bi_manager.diagram.vo.DiagramVO; |
|
22 |
-import com.takensoft.taken_bi_manager.diagram.vo.NodeVO; |
|
23 | 22 |
import com.takensoft.taken_bi_manager.jobs.vo.JobGroup; |
24 | 23 |
import com.takensoft.taken_bi_manager.jobs.vo.JobItm; |
25 | 24 |
import com.takensoft.taken_bi_manager.jobs.vo.item.DataCheck; |
... | ... | @@ -45,24 +44,28 @@ |
45 | 44 |
|
46 | 45 |
@Autowired |
47 | 46 |
private CmmnCodeService cmmnCodeService; |
48 |
- |
|
49 |
- |
|
47 |
+ |
|
50 | 48 |
/* |
51 | 49 |
* 공통코드 리스트 요청 |
52 | 50 |
*/ |
53 | 51 |
@PostMapping(path = "/getCodeList.json") |
54 | 52 |
public CustomeResultMap getCodeList(@RequestBody HashMap<String, Object> params) throws Exception { |
55 |
- |
|
56 | 53 |
CustomeResultMap map = new CustomeResultMap(); |
57 |
- |
|
58 |
- // 코드리스트 |
|
59 |
- map.getResultData().put("codeList",cmmnCodeService.getCodeListByGroupId(params.get("groupCode").toString())); |
|
60 |
- |
|
61 |
- |
|
54 |
+ // 코드리스트 |
|
55 |
+ map.getResultData().put("codeList",cmmnCodeService.getCodeListByGroupId(params.get("groupCode").toString())); |
|
62 | 56 |
return map; |
63 |
- } |
|
64 |
- |
|
65 |
- |
|
57 |
+ } |
|
58 |
+ |
|
59 |
+ /* |
|
60 |
+ * 공통코드 리스트 요청 (트리형) |
|
61 |
+ */ |
|
62 |
+ @PostMapping(path = "/getCodeListByTree.json") |
|
63 |
+ public CustomeResultMap getCodeListByTree(@RequestBody HashMap<String, Object> params) throws Exception { |
|
64 |
+ CustomeResultMap map = new CustomeResultMap(); |
|
65 |
+ map.getResultData().put("codeList",cmmnCodeService.findChildNode(params.get("codeId").toString())); |
|
66 |
+ return map; |
|
67 |
+ } |
|
68 |
+ |
|
66 | 69 |
@PostMapping(path = "/getDataBaseTypeList.json") |
67 | 70 |
public CustomeResultMap getDataBaseTypeList() throws Exception { |
68 | 71 |
|
... | ... | @@ -90,7 +93,6 @@ |
90 | 93 |
map.getResultData().put("connectionApi", new ConnectionApi()); |
91 | 94 |
map.getResultData().put("dataTable", new DataTable()); |
92 | 95 |
map.getResultData().put("dataCheck", new DataCheck()); |
93 |
- map.getResultData().put("schedule", new Schedule()); |
|
94 | 96 |
map.getResultData().put("dataset", new Dataset()); |
95 | 97 |
map.getResultData().put("datasetPost", new DatasetPost()); |
96 | 98 |
map.getResultData().put("filterItem", new FilterItem()); |
... | ... | @@ -102,9 +104,9 @@ |
102 | 104 |
// 메타데이터 표준단어 |
103 | 105 |
map.getResultData().put("stdWrm", new StdWrd()); |
104 | 106 |
|
105 |
- // NODE 아이템 |
|
106 |
- map.getResultData().put("diagram", new DiagramVO()); |
|
107 |
- map.getResultData().put("node", new NodeVO()); |
|
107 |
+ // 스케줄 아이템 |
|
108 |
+ map.getResultData().put("schedule", new ScheduleVO()); |
|
109 |
+ map.getResultData().put("node", new NodeDTO()); |
|
108 | 110 |
|
109 | 111 |
// 레이아웃 처리 아이템 |
110 | 112 |
map.getResultData().put("customSplitter", new CustomSplitterVO()); |
--- src/main/java/com/takensoft/taken_bi_manager/controller/cmmn/ScheduleController.java
... | ... | @@ -1,65 +0,0 @@ |
1 | -package com.takensoft.taken_bi_manager.controller.cmmn; | |
2 | - | |
3 | -import com.takensoft.taken_bi_manager.common.schedule.service.ScheduleService; | |
4 | -import com.takensoft.taken_bi_manager.common.schedule.vo.Schedule; | |
5 | -import com.takensoft.taken_bi_manager.common.vo.CustomeResultMap; | |
6 | -import com.takensoft.taken_bi_manager.common.vo.SearchVO; | |
7 | -import org.springframework.beans.factory.annotation.Autowired; | |
8 | -import org.springframework.web.bind.annotation.*; | |
9 | - | |
10 | -@RestController | |
11 | -@RequestMapping("/schedule") | |
12 | -public class ScheduleController { | |
13 | - @Autowired | |
14 | - private ScheduleService scheduleService; | |
15 | - | |
16 | - /* | |
17 | - * 스케줄 등록 | |
18 | - */ | |
19 | - @PostMapping(path = "/conflictInsertSchedule.json") | |
20 | - public CustomeResultMap conflictInsertSchedule(@RequestBody Schedule schedule) throws Exception { | |
21 | - CustomeResultMap map = new CustomeResultMap(); | |
22 | - scheduleService.conflictInsertSchedule(schedule); | |
23 | - return map; | |
24 | - } | |
25 | - | |
26 | - /* | |
27 | - * 스케줄 목록 조회 | |
28 | - */ | |
29 | - @PostMapping(path = "/selectScheduleList.json") | |
30 | - public CustomeResultMap selectScheduleList(@RequestBody SearchVO searchVO) throws Exception { | |
31 | - return scheduleService.selectScheduleList(searchVO); | |
32 | - } | |
33 | - | |
34 | - /* | |
35 | - * 스케줄 상세 조회 | |
36 | - */ | |
37 | - @PostMapping(path = "/selectSchedule.json") | |
38 | - public CustomeResultMap selectSchedule(@RequestBody Schedule schedule) throws Exception { | |
39 | - CustomeResultMap map = new CustomeResultMap(); | |
40 | - map.getResultData().put("schedule", scheduleService.selectSchedule(schedule)); | |
41 | - return map; | |
42 | - } | |
43 | - | |
44 | - /** | |
45 | - * @author 박정하 | |
46 | - * @since 2024.10.04 | |
47 | - * | |
48 | - * 스케줄 정보 삭제 | |
49 | - */ | |
50 | - @GetMapping(value="/deleteSchedule/{schdulId}") | |
51 | - public CustomeResultMap deleteSchedule(@PathVariable String schdulId) throws Exception { | |
52 | - return scheduleService.deleteSchedule(schdulId); | |
53 | - } | |
54 | - | |
55 | - /** | |
56 | - * @author 박정하 | |
57 | - * @since 2024.10.04 | |
58 | - * | |
59 | - * 스케줄 상태 변경 | |
60 | - */ | |
61 | - @GetMapping(value="/scheduleSttusChange/{schdulId}/{schdulSttus}") | |
62 | - public CustomeResultMap scheduleSttusChange(@PathVariable String schdulId, @PathVariable String schdulSttus) throws Exception { | |
63 | - return scheduleService.scheduleSttusChange(schdulId, schdulSttus); | |
64 | - } | |
65 | -}(파일 끝에 줄바꿈 문자 없음) |
--- src/main/java/com/takensoft/taken_bi_manager/controller/data/DataController.java
+++ src/main/java/com/takensoft/taken_bi_manager/controller/data/DataController.java
... | ... | @@ -6,8 +6,6 @@ |
6 | 6 |
import com.takensoft.taken_bi_manager.jobs.service.JobService; |
7 | 7 |
import com.takensoft.taken_bi_manager.jobs.vo.JobGroup; |
8 | 8 |
import org.springframework.beans.factory.annotation.Autowired; |
9 |
-import org.springframework.web.bind.annotation.GetMapping; |
|
10 |
-import org.springframework.web.bind.annotation.ModelAttribute; |
|
11 | 9 |
import org.springframework.web.bind.annotation.PostMapping; |
12 | 10 |
import org.springframework.web.bind.annotation.RequestBody; |
13 | 11 |
import org.springframework.web.bind.annotation.RequestMapping; |
... | ... | @@ -18,10 +16,7 @@ |
18 | 16 |
import com.takensoft.taken_bi_manager.common.connection.db.vo.ConnectionDB; |
19 | 17 |
import com.takensoft.taken_bi_manager.common.vo.CustomeResultMap; |
20 | 18 |
import com.takensoft.taken_bi_manager.common.vo.SearchVO; |
21 |
-import com.takensoft.taken_bi_manager.common.vo.SystemCode.DatabaseType; |
|
22 | 19 |
import com.takensoft.taken_bi_manager.data.service.DataService; |
23 |
-import com.takensoft.taken_bi_manager.user.member.servie.LoginService; |
|
24 |
-import com.takensoft.taken_bi_manager.user.member.vo.Member; |
|
25 | 20 |
|
26 | 21 |
import java.util.List; |
27 | 22 |
import java.util.Map; |
--- src/main/java/com/takensoft/taken_bi_manager/controller/jobs/JobController.java
+++ src/main/java/com/takensoft/taken_bi_manager/controller/jobs/JobController.java
... | ... | @@ -2,9 +2,7 @@ |
2 | 2 |
|
3 | 3 |
|
4 | 4 |
import com.takensoft.taken_bi_manager.common.file.vo.FileInfo; |
5 |
-import com.takensoft.taken_bi_manager.common.schedule.vo.Schedule; |
|
6 |
-import com.takensoft.taken_bi_manager.common.vo.SearchVO; |
|
7 |
-import com.takensoft.taken_bi_manager.data.service.DataService; |
|
5 |
+import com.takensoft.taken_bi_manager.schedule.vo.ScheduleVO; |
|
8 | 6 |
import com.takensoft.taken_bi_manager.data.vo.DataTable; |
9 | 7 |
import com.takensoft.taken_bi_manager.jobs.service.JobService; |
10 | 8 |
import com.takensoft.taken_bi_manager.jobs.vo.item.DataCheck; |
... | ... | @@ -43,7 +41,7 @@ |
43 | 41 |
map.getResultData().put("fileRead", new FileInfo()); // 하석형 추가 |
44 | 42 |
map.getResultData().put("dataTable", new DataTable()); |
45 | 43 |
map.getResultData().put("dataCheck", new DataCheck()); |
46 |
- map.getResultData().put("schedule", new Schedule()); |
|
44 |
+ map.getResultData().put("schedule", new ScheduleVO()); |
|
47 | 45 |
|
48 | 46 |
return map; |
49 | 47 |
} |
--- src/main/java/com/takensoft/taken_bi_manager/controller/login/LoginController.java
+++ src/main/java/com/takensoft/taken_bi_manager/controller/login/LoginController.java
... | ... | @@ -1,8 +1,6 @@ |
1 | 1 |
package com.takensoft.taken_bi_manager.controller.login; |
2 | 2 |
|
3 | 3 |
import org.springframework.beans.factory.annotation.Autowired; |
4 |
-import org.springframework.web.bind.annotation.GetMapping; |
|
5 |
-import org.springframework.web.bind.annotation.ModelAttribute; |
|
6 | 4 |
import org.springframework.web.bind.annotation.PostMapping; |
7 | 5 |
import org.springframework.web.bind.annotation.RequestBody; |
8 | 6 |
import org.springframework.web.bind.annotation.RequestMapping; |
... | ... | @@ -10,8 +8,8 @@ |
10 | 8 |
|
11 | 9 |
import com.fasterxml.jackson.databind.ObjectMapper; |
12 | 10 |
import com.takensoft.taken_bi_manager.common.vo.CustomeResultMap; |
13 |
-import com.takensoft.taken_bi_manager.user.member.servie.LoginService; |
|
14 |
-import com.takensoft.taken_bi_manager.user.member.vo.Member; |
|
11 |
+import com.takensoft.taken_bi_manager.user.servie.LoginService; |
|
12 |
+import com.takensoft.taken_bi_manager.user.vo.Member; |
|
15 | 13 |
|
16 | 14 |
@RestController |
17 | 15 |
@RequestMapping("/") |
--- src/main/java/com/takensoft/taken_bi_manager/department/dao/DeptUserDAO.java
+++ src/main/java/com/takensoft/taken_bi_manager/department/dao/DeptUserDAO.java
... | ... | @@ -2,7 +2,7 @@ |
2 | 2 |
|
3 | 3 |
import com.takensoft.taken_bi_manager.common.vo.SearchVO; |
4 | 4 |
import com.takensoft.taken_bi_manager.department.vo.DeptUserVO; |
5 |
-import com.takensoft.taken_bi_manager.user.member.vo.Member; |
|
5 |
+import com.takensoft.taken_bi_manager.user.vo.Member; |
|
6 | 6 |
import org.apache.ibatis.annotations.Mapper; |
7 | 7 |
|
8 | 8 |
import java.util.*; |
--- src/main/java/com/takensoft/taken_bi_manager/department/service/DeptUserService.java
+++ src/main/java/com/takensoft/taken_bi_manager/department/service/DeptUserService.java
... | ... | @@ -2,7 +2,7 @@ |
2 | 2 |
|
3 | 3 |
import com.takensoft.taken_bi_manager.common.vo.SearchVO; |
4 | 4 |
import com.takensoft.taken_bi_manager.department.vo.DeptUserVO; |
5 |
-import com.takensoft.taken_bi_manager.user.member.vo.Member; |
|
5 |
+import com.takensoft.taken_bi_manager.user.vo.Member; |
|
6 | 6 |
|
7 | 7 |
import java.util.*; |
8 | 8 |
|
--- src/main/java/com/takensoft/taken_bi_manager/department/service/Impl/DeptUserServiceImpl.java
+++ src/main/java/com/takensoft/taken_bi_manager/department/service/Impl/DeptUserServiceImpl.java
... | ... | @@ -4,7 +4,7 @@ |
4 | 4 |
import com.takensoft.taken_bi_manager.department.dao.DeptUserDAO; |
5 | 5 |
import com.takensoft.taken_bi_manager.department.service.DeptUserService; |
6 | 6 |
import com.takensoft.taken_bi_manager.department.vo.DeptUserVO; |
7 |
-import com.takensoft.taken_bi_manager.user.member.vo.Member; |
|
7 |
+import com.takensoft.taken_bi_manager.user.vo.Member; |
|
8 | 8 |
import lombok.RequiredArgsConstructor; |
9 | 9 |
import org.springframework.stereotype.Service; |
10 | 10 |
import org.springframework.transaction.annotation.Transactional; |
--- src/main/java/com/takensoft/taken_bi_manager/department/web/DeptController.java
+++ src/main/java/com/takensoft/taken_bi_manager/department/web/DeptController.java
... | ... | @@ -5,7 +5,7 @@ |
5 | 5 |
import com.takensoft.taken_bi_manager.common.vo.SearchVO; |
6 | 6 |
import com.takensoft.taken_bi_manager.department.service.DeptService; |
7 | 7 |
import com.takensoft.taken_bi_manager.department.vo.DeptVO; |
8 |
-import com.takensoft.taken_bi_manager.user.member.servie.MemberService; |
|
8 |
+import com.takensoft.taken_bi_manager.user.servie.MemberService; |
|
9 | 9 |
import lombok.RequiredArgsConstructor; |
10 | 10 |
import org.springframework.http.HttpStatus; |
11 | 11 |
import org.springframework.web.bind.annotation.*; |
--- src/main/java/com/takensoft/taken_bi_manager/department/web/DeptUserController.java
+++ src/main/java/com/takensoft/taken_bi_manager/department/web/DeptUserController.java
... | ... | @@ -5,7 +5,7 @@ |
5 | 5 |
import com.takensoft.taken_bi_manager.common.vo.SearchVO; |
6 | 6 |
import com.takensoft.taken_bi_manager.department.service.DeptUserService; |
7 | 7 |
import com.takensoft.taken_bi_manager.department.vo.DeptUserVO; |
8 |
-import com.takensoft.taken_bi_manager.user.member.vo.Member; |
|
8 |
+import com.takensoft.taken_bi_manager.user.vo.Member; |
|
9 | 9 |
import lombok.RequiredArgsConstructor; |
10 | 10 |
import org.springframework.http.HttpStatus; |
11 | 11 |
import org.springframework.web.bind.annotation.*; |
--- src/main/java/com/takensoft/taken_bi_manager/diagram/dao/DiagramDAO.java
... | ... | @@ -1,87 +0,0 @@ |
1 | -package com.takensoft.taken_bi_manager.diagram.dao; | |
2 | - | |
3 | -import com.takensoft.taken_bi_manager.common.schedule.vo.Schedule; | |
4 | -import com.takensoft.taken_bi_manager.common.vo.SearchVO; | |
5 | -import com.takensoft.taken_bi_manager.diagram.dto.DiagramListDTO; | |
6 | -import com.takensoft.taken_bi_manager.diagram.vo.*; | |
7 | -import org.apache.ibatis.annotations.Mapper; | |
8 | - | |
9 | -import java.util.HashMap; | |
10 | -import java.util.List; | |
11 | - | |
12 | -@Mapper | |
13 | -public interface DiagramDAO { | |
14 | - /** | |
15 | - * @author gkrhksdn | |
16 | - * @since 2024.01.23 | |
17 | - * | |
18 | - * Diagram 데이터 조회 | |
19 | - */ | |
20 | - List<Schedule> dataSelectListAll() throws Exception; | |
21 | - | |
22 | - Schedule scheduleList(HashMap<String,Object> params) throws Exception; | |
23 | - | |
24 | - List<LogVO> logSelectListAll(SearchVO searchVO) throws Exception; | |
25 | - int logSelectListCnt(SearchVO searchVO) throws Exception; | |
26 | - | |
27 | - List<LogVO> logSelectListAllID(HashMap<String,Object> params) throws Exception; | |
28 | - | |
29 | - List<LogDetailVO> detaillogSelectListAll(SearchVO searchVO) throws Exception; | |
30 | - int detaillogSelectListCnt(SearchVO searchVO) throws Exception; | |
31 | - | |
32 | - List<NodeVO> nodeList(String diagramId) throws Exception; | |
33 | - | |
34 | - List<EdgeVO> lineList(String diagramId) throws Exception; | |
35 | - | |
36 | - int diagramDataInsert(DiagramVO diagramVO) throws Exception; | |
37 | - | |
38 | - int nodeDataInsert(NodeVO nodeVO) throws Exception; | |
39 | - | |
40 | - int lineDataInsert(EdgeVO edgeVO) throws Exception; | |
41 | - | |
42 | - int logDataInsert(LogVO logVO) throws Exception; | |
43 | - | |
44 | - int logDataUpdate(LogVO logVO) throws Exception; | |
45 | - | |
46 | - int logDetailDataInsert(LogDetailVO logDetailVO) throws Exception; | |
47 | - | |
48 | - //dataset_post_id로 datasetID가져오기 | |
49 | - String datasetIdSelect(HashMap<String,Object> params) throws Exception; | |
50 | - | |
51 | - /** | |
52 | - * @author 하관우 | |
53 | - * @since 2024.02.15 | |
54 | - * 삭제를 위한 것들 | |
55 | - * */ | |
56 | - | |
57 | - int nodeDelete(String params) throws Exception; | |
58 | - | |
59 | - int nodeIdDelete(String params) throws Exception; | |
60 | - | |
61 | - int edgeDelete(String params) throws Exception; | |
62 | - | |
63 | - int edgeIdDelete(String params) throws Exception; | |
64 | - | |
65 | - int diagramDelete(String params) throws Exception; | |
66 | - | |
67 | - int logDelete(String params) throws Exception; | |
68 | - | |
69 | - int logDetailDelete(String params) throws Exception; | |
70 | - | |
71 | - List<String> nodeSelectId(String params) throws Exception; | |
72 | - | |
73 | - String ScheduleIdToGroubId(String params) throws Exception; | |
74 | - | |
75 | - List<String> edgeSelectId(String params) throws Exception; | |
76 | - | |
77 | - /** | |
78 | - * @author 박정하 | |
79 | - * @since 2024.10.04 | |
80 | - * | |
81 | - * Diagram 목록 조회 | |
82 | - */ | |
83 | - List<DiagramListDTO> diagramListRead(SearchVO searchVO) throws Exception; | |
84 | - int diagramListCountRead(SearchVO searchVO) throws Exception; | |
85 | - | |
86 | - DiagramVO diagramDetailRead(String diagramId) throws Exception; | |
87 | -}(파일 끝에 줄바꿈 문자 없음) |
--- src/main/java/com/takensoft/taken_bi_manager/diagram/dto/DiagramDetailDTO.java
... | ... | @@ -1,17 +0,0 @@ |
1 | -package com.takensoft.taken_bi_manager.diagram.dto; | |
2 | - | |
3 | -import com.takensoft.taken_bi_manager.common.schedule.vo.Schedule; | |
4 | -import com.takensoft.taken_bi_manager.diagram.vo.DiagramVO; | |
5 | -import lombok.Data; | |
6 | - | |
7 | -/** | |
8 | - * @author 박정하 | |
9 | - * @since 2024.09.23 | |
10 | - * | |
11 | - * 다이어그램 등록/수정을 위한 DTO | |
12 | - */ | |
13 | -@Data | |
14 | -public class DiagramDetailDTO { | |
15 | - private Schedule schedule; | |
16 | - private DiagramVO diagram; | |
17 | -}(파일 끝에 줄바꿈 문자 없음) |
--- src/main/java/com/takensoft/taken_bi_manager/diagram/dto/DiagramListDTO.java
... | ... | @@ -1,30 +0,0 @@ |
1 | -package com.takensoft.taken_bi_manager.diagram.dto; | |
2 | - | |
3 | -import lombok.Data; | |
4 | - | |
5 | -import java.sql.Timestamp; | |
6 | - | |
7 | -/** | |
8 | - * @author 박정하 | |
9 | - * @since 2024.10.04 | |
10 | - * | |
11 | - * Diagram 목록 관련 DTO | |
12 | - */ | |
13 | -@Data | |
14 | -public class DiagramListDTO { | |
15 | - // 스케줄 아이디 | |
16 | - private String schdul_id; | |
17 | - // 다이어그램 아이디 | |
18 | - private String diagram_id; | |
19 | - | |
20 | - // 제목 (Schedule - 스케줄 제목) | |
21 | - private String diagram_nm; | |
22 | - // 작성자 (DiagramVO - 생성자 ID) | |
23 | - private String creat_id; | |
24 | - // 작동일시 (Schedule - cron 스케쥴링 한글) | |
25 | - private String cron_chrctr; | |
26 | - // 등록일 (DiagramVO - 다이어그램 등록일) | |
27 | - private Timestamp creat_dt; | |
28 | - // 상태 (Schedule - 스케쥴링 상태) | |
29 | - private String schdul_sttus = "run"; | |
30 | -}(파일 끝에 줄바꿈 문자 없음) |
--- src/main/java/com/takensoft/taken_bi_manager/diagram/service/Diagramservice.java
... | ... | @@ -1,109 +0,0 @@ |
1 | -package com.takensoft.taken_bi_manager.diagram.service; | |
2 | - | |
3 | -import com.takensoft.taken_bi_manager.common.schedule.vo.Schedule; | |
4 | -import com.takensoft.taken_bi_manager.common.vo.CustomeResultMap; | |
5 | -import com.takensoft.taken_bi_manager.common.vo.SearchVO; | |
6 | -import com.takensoft.taken_bi_manager.diagram.dto.DiagramDetailDTO; | |
7 | -import com.takensoft.taken_bi_manager.diagram.vo.*; | |
8 | -import org.springframework.transaction.annotation.Propagation; | |
9 | -import org.springframework.transaction.annotation.Transactional; | |
10 | - | |
11 | -import java.util.*; | |
12 | - | |
13 | -public interface Diagramservice { | |
14 | - /** | |
15 | - * @author 하관우 | |
16 | - * @since 2024.01.23 | |
17 | - * | |
18 | - * Diagram 전체 조회 | |
19 | - */ | |
20 | - List<Schedule> dataSelectListAll() throws Exception; | |
21 | - | |
22 | - /** | |
23 | - * @author 하관우 | |
24 | - * @since 2024.01.23 | |
25 | - * | |
26 | - * log 조회 | |
27 | - */ | |
28 | - CustomeResultMap logSelectListAll(SearchVO searchVO) throws Exception; | |
29 | - | |
30 | - /** | |
31 | - * @author 하관우 | |
32 | - * @since 2024.01.23 | |
33 | - * | |
34 | - * log detial 조회 | |
35 | - */ | |
36 | - CustomeResultMap detaillogSelectListAll(SearchVO searchVO) throws Exception; | |
37 | - | |
38 | - /** | |
39 | - * @author 하관우 | |
40 | - * @since 2024.01.23 | |
41 | - * | |
42 | - * schedule 조회 | |
43 | - */ | |
44 | - Schedule scheduleList(HashMap<String,Object> params) throws Exception; | |
45 | - | |
46 | - /** | |
47 | - * @author 하관우 | |
48 | - * @since 2024.01.23 | |
49 | - * | |
50 | - * node 조회 | |
51 | - */ | |
52 | - List<NodeVO> nodeList(String diagramId) throws Exception; | |
53 | - | |
54 | - /** | |
55 | - * @author 하관우 | |
56 | - * @since 2024.01.23 | |
57 | - * | |
58 | - * line 조회 | |
59 | - */ | |
60 | - List<EdgeVO> lineList(String diagramId) throws Exception; | |
61 | - | |
62 | - /** | |
63 | - * @author 하관우 | |
64 | - * @since 2024.01.23 | |
65 | - * | |
66 | - * 다이어그램의 모든 정보 등록 | |
67 | - */ | |
68 | - int dataInsert(DiagramDetailDTO diagramDetailDTO) throws Exception; | |
69 | - | |
70 | - /** | |
71 | - * @author 하관우 | |
72 | - * @since 2024.05.29 | |
73 | - * | |
74 | - * 다이어그램의 모든 수정 등록 | |
75 | - */ | |
76 | - int dataEdit(DiagramDetailDTO diagramDetailDTO) throws Exception; | |
77 | - | |
78 | - /** | |
79 | - * @author 하관우 | |
80 | - * @since 2024.02.08 | |
81 | - * | |
82 | - * 즉시계산 | |
83 | - */ | |
84 | - List<HashMap<String, Object>> operatorNow(DiagramVO diagramVO, String type) throws Exception; | |
85 | - | |
86 | - /** | |
87 | - * @author 하관우 | |
88 | - * @since 2024.02.15 | |
89 | - * | |
90 | - * diagram_id를 가져와서 해당하는것들 삭제 | |
91 | - */ | |
92 | - int dataDelete(List<Schedule> scheduleList) throws Exception; | |
93 | - | |
94 | - /** | |
95 | - * @author 박정하 | |
96 | - * @since 2024.10.04 | |
97 | - * | |
98 | - * Diagram 목록 조회 | |
99 | - */ | |
100 | - CustomeResultMap diagramListRead(SearchVO searchVO) throws Exception; | |
101 | - | |
102 | - /** | |
103 | - * @author 박정하 | |
104 | - * @since 2024.10.04 | |
105 | - * | |
106 | - * Diagram 상세 조회 | |
107 | - */ | |
108 | - CustomeResultMap diagramDetailRead(String diagramId) throws Exception; | |
109 | -}(파일 끝에 줄바꿈 문자 없음) |
--- src/main/java/com/takensoft/taken_bi_manager/diagram/service/FilterService.java
... | ... | @@ -1,17 +0,0 @@ |
1 | -package com.takensoft.taken_bi_manager.diagram.service; | |
2 | - | |
3 | -import com.takensoft.taken_bi_manager.diagram.vo.NodeVO; | |
4 | - | |
5 | -/** | |
6 | - * @author : 박정하 | |
7 | - * @since : 2024.09.25 | |
8 | - * 필터 관련 인터페이스 | |
9 | - */ | |
10 | -public interface FilterService { | |
11 | - /** | |
12 | - * @author : 박정하 | |
13 | - * @since : 2024.09.25 | |
14 | - * 필터 실행 | |
15 | - */ | |
16 | - NodeVO runFilter(NodeVO nodeVO) throws Exception; | |
17 | -}(파일 끝에 줄바꿈 문자 없음) |
--- src/main/java/com/takensoft/taken_bi_manager/diagram/service/impl/DiagramServiceImpl.java
... | ... | @@ -1,761 +0,0 @@ |
1 | -package com.takensoft.taken_bi_manager.diagram.service.impl; | |
2 | - | |
3 | -import com.fasterxml.jackson.databind.ObjectMapper; | |
4 | -import com.takensoft.taken_bi_manager.common.connection.api.dao.ConnectionApiDAO; | |
5 | -import com.takensoft.taken_bi_manager.common.connection.api.service.ConnectionApiService; | |
6 | -import com.takensoft.taken_bi_manager.common.connection.api.vo.ConnectionApi; | |
7 | -import com.takensoft.taken_bi_manager.common.connection.db.vo.ConnectionDB; | |
8 | -import com.takensoft.taken_bi_manager.common.connection.ehojoPlus.service.ConnectEhojoPlusService; | |
9 | -import com.takensoft.taken_bi_manager.common.connection.ehojoPlus.vo.ConnectionEhojoVO; | |
10 | -import com.takensoft.taken_bi_manager.common.schedule.dao.ScheduleDAO; | |
11 | -import com.takensoft.taken_bi_manager.common.schedule.vo.Schedule; | |
12 | -import com.takensoft.taken_bi_manager.common.util.CommonUtil; | |
13 | -import com.takensoft.taken_bi_manager.common.util.StringUtil; | |
14 | -import com.takensoft.taken_bi_manager.common.vo.CustomeResultMap; | |
15 | -import com.takensoft.taken_bi_manager.common.vo.SearchVO; | |
16 | -import com.takensoft.taken_bi_manager.data.dao.DataDAO; | |
17 | -import com.takensoft.taken_bi_manager.data.dao.DatasetDAO; | |
18 | -import com.takensoft.taken_bi_manager.data.service.DataService; | |
19 | -import com.takensoft.taken_bi_manager.data.vo.ColumnData; | |
20 | -import com.takensoft.taken_bi_manager.data.vo.DataTable; | |
21 | -import com.takensoft.taken_bi_manager.diagram.dao.DiagramDAO; | |
22 | -import com.takensoft.taken_bi_manager.diagram.dto.DiagramListDTO; | |
23 | -import com.takensoft.taken_bi_manager.diagram.dto.DiagramDetailDTO; | |
24 | -import com.takensoft.taken_bi_manager.diagram.service.Diagramservice; | |
25 | -import com.takensoft.taken_bi_manager.diagram.vo.*; | |
26 | -import com.takensoft.taken_bi_manager.host.service.SftpService; | |
27 | -import com.takensoft.taken_bi_manager.jobs.dao.JobDAO; | |
28 | -import com.takensoft.taken_bi_manager.jobs.service.JobService; | |
29 | -import com.takensoft.taken_bi_manager.jobs.util.JobUtil; | |
30 | -import com.takensoft.taken_bi_manager.jobs.vo.JobGroup; | |
31 | -import com.takensoft.taken_bi_manager.jobs.vo.JobItm; | |
32 | -import com.takensoft.taken_bi_manager.jobs.vo.item.DataFilter; | |
33 | -import com.takensoft.taken_bi_manager.jobs.vo.item.FileInfoItem; | |
34 | -import com.takensoft.taken_bi_manager.jobs.vo.item.JobItemGroup; | |
35 | -import lombok.RequiredArgsConstructor; | |
36 | -import org.springframework.beans.factory.annotation.Autowired; | |
37 | -import org.springframework.stereotype.Service; | |
38 | -import org.springframework.transaction.annotation.Transactional; | |
39 | -import org.springframework.web.bind.annotation.RequestBody; | |
40 | - | |
41 | -import java.sql.Timestamp; | |
42 | -import java.util.*; | |
43 | - | |
44 | -@Service | |
45 | -@RequiredArgsConstructor | |
46 | -public class DiagramServiceImpl implements Diagramservice { | |
47 | - private final DiagramDAO diagramDAO; | |
48 | - | |
49 | - @Autowired | |
50 | - private ScheduleDAO scheduleDAO; | |
51 | - | |
52 | - @Autowired | |
53 | - private JobDAO jobDAO; | |
54 | - | |
55 | - @Autowired | |
56 | - private JobService jobService; | |
57 | - | |
58 | - @Autowired | |
59 | - private DataDAO dataDAO; | |
60 | - | |
61 | - @Autowired | |
62 | - private DataService dataService; | |
63 | - | |
64 | - @Autowired | |
65 | - private ConnectionApiDAO connectionApiDAO; | |
66 | - | |
67 | - @Autowired | |
68 | - private DatasetDAO datasetDAO; | |
69 | - | |
70 | - @Autowired | |
71 | - private ConnectionApiService connectionApiService; | |
72 | - | |
73 | - @Autowired | |
74 | - private SftpService sftpService; | |
75 | - | |
76 | - @Autowired | |
77 | - private FilterServiceImpl filterService; | |
78 | - | |
79 | - @Autowired | |
80 | - private final ConnectEhojoPlusService connectEhojoPlusService; | |
81 | - | |
82 | - private List<NodeVO> nodeListByOrder; | |
83 | - | |
84 | - | |
85 | - @Override | |
86 | - public List<Schedule> dataSelectListAll() throws Exception { | |
87 | - return diagramDAO.dataSelectListAll(); | |
88 | - } | |
89 | - | |
90 | - public Schedule scheduleList(HashMap<String,Object> params) throws Exception { | |
91 | - return diagramDAO.scheduleList(params); | |
92 | - } | |
93 | - | |
94 | - /* jobItm 타입에 따라 개별 실행 */ | |
95 | - private NodeVO runJobItm(JobItm jobItm, String diagramId, NodeVO nodeVO, List<NodeVO> nodes) throws Exception { | |
96 | - String type = jobItm.getType(); | |
97 | - NodeVO prevNode; | |
98 | - DataTable dataTable; | |
99 | - switch (type) { | |
100 | - case "dbConnection": | |
101 | - ConnectionDB connectionDB = dataDAO.selectDbConnectionOne(jobItm.getItm_id()); | |
102 | - connectionDB.decodingData(); | |
103 | - connectionDB.setQuery(jobDAO.selectIdJobItemId(diagramId).getItm_option_string()); | |
104 | - | |
105 | - JobItm newJobItm = new JobItm(); | |
106 | - newJobItm.setDataTable(new DataTable()); | |
107 | - newJobItm.setItm(connectionDB); | |
108 | - nodeVO.setItm(connectionDB); | |
109 | - | |
110 | - dataTable = JobUtil.dbConnectionExec(newJobItm); | |
111 | - nodeVO.setDataTable(dataTable); | |
112 | - break; | |
113 | - case "apiRead": | |
114 | - String itmId = jobItm.getItm_id(); | |
115 | - ConnectionApi connectionApi = connectionApiDAO.selectConnectionApi(itmId); | |
116 | - nodeVO.setItm(connectionApi); | |
117 | - dataTable = connectionApiService.apiRequest(connectionApi); | |
118 | - nodeVO.setDataTable(dataTable); | |
119 | - break; | |
120 | - case "fileRead": | |
121 | - FileInfoItem fileInfoItem = jobDAO.fileReadItmSelect(jobItm.getGroup_id()); | |
122 | - String fileName = fileInfoItem.getFileName(); | |
123 | - int lastDotIndex = fileName.lastIndexOf('.'); | |
124 | - fileName.substring(lastDotIndex + 1); | |
125 | - String extension = ""; | |
126 | - if (lastDotIndex != -1 && lastDotIndex < fileName.length() - 1) { | |
127 | - extension = fileName.substring(lastDotIndex + 1); | |
128 | - } | |
129 | - fileInfoItem.setExtension(extension); | |
130 | - nodeVO.setDataTable((DataTable) sftpService.fileRead(fileInfoItem, fileInfoItem.getDatasetId()).getResultData().get("dataTableMap")); | |
131 | - nodeVO.setItm(fileInfoItem); | |
132 | - break; | |
133 | - case "datasetRead": | |
134 | - nodeVO.setItm(datasetDAO.selectDatasetPost(jobItm.getItm_id())); | |
135 | - break; | |
136 | - case "datasetWrite": | |
137 | - prevNode = nodeListByOrder.get(nodeListByOrder.size() - 2); | |
138 | - for (NodeVO node : nodes) { | |
139 | - if (node.getId().equals(prevNode.getId())) { | |
140 | - nodeVO.setDataTable(node.getDataTable()); | |
141 | - break; | |
142 | - } | |
143 | - } | |
144 | - JobItemGroup jobItemGroup = new JobItemGroup(); | |
145 | - jobItemGroup.setGroupId(jobItm.getGroup_id()); | |
146 | - jobItemGroup.setItem(jobItm.getItm_id()); | |
147 | - jobItemGroup.setItemList(jobDAO.datasetItemSelect(jobItm)); | |
148 | - nodeVO.setItm(jobItemGroup); | |
149 | - break; | |
150 | - case "filter": | |
151 | - for (int i = 0; i < nodeListByOrder.size(); i++) { | |
152 | - if (nodeListByOrder.get(i).getId().equals(nodeVO.getId())) { | |
153 | - prevNode = nodeListByOrder.get(i - 1); | |
154 | - nodeVO.setDataTable(prevNode.getDataTable()); | |
155 | - break; | |
156 | - } | |
157 | - } | |
158 | - DataFilter dataFilter = new DataFilter(); | |
159 | - dataFilter.setGroupId(diagramId); | |
160 | - dataFilter.setFilterItems(jobDAO.filterItemSelect(jobItm)); | |
161 | - dataFilter.setMatch_type(jobItm.isItm_option_bool()); | |
162 | - nodeVO.setItm(dataFilter); | |
163 | - nodeVO = filterService.runFilter(nodeVO); | |
164 | - break; | |
165 | - case "ehojoRead": | |
166 | - String id = jobItm.getItm_id(); | |
167 | - ConnectionEhojoVO connectionEhojoVO = connectEhojoPlusService.selectEhojoPlusInfo(id); | |
168 | - nodeVO.setItm(connectionEhojoVO); | |
169 | - CustomeResultMap customeResultMap = connectEhojoPlusService.openFisCal(connectionEhojoVO); | |
170 | - dataTable = (DataTable) customeResultMap.getResultData().get("dataTable"); | |
171 | - nodeVO.setDataTable(dataTable); | |
172 | - break; | |
173 | - } | |
174 | - | |
175 | - return nodeVO; | |
176 | - } | |
177 | - | |
178 | - public CustomeResultMap logSelectListAll(SearchVO searchVO) throws Exception { | |
179 | - CustomeResultMap resultMap = new CustomeResultMap(); | |
180 | - try { | |
181 | - List<LogVO> logList = diagramDAO.logSelectListAll(searchVO); | |
182 | - resultMap.getResultData().put("logList", logList); | |
183 | - int rows = diagramDAO.logSelectListCnt(searchVO); | |
184 | - searchVO.setTotalRows(rows); | |
185 | - resultMap.getResultData().put("searchVO", searchVO); | |
186 | - } catch (Exception e) { | |
187 | - e.printStackTrace(); | |
188 | - } | |
189 | - return resultMap; | |
190 | - } | |
191 | - | |
192 | - public CustomeResultMap detaillogSelectListAll(SearchVO searchVO) throws Exception { | |
193 | - CustomeResultMap resultMap = new CustomeResultMap(); | |
194 | - try { | |
195 | - List<LogDetailVO> logList = diagramDAO.detaillogSelectListAll(searchVO); | |
196 | - resultMap.getResultData().put("logList", logList); | |
197 | - int rows = diagramDAO.detaillogSelectListCnt(searchVO); | |
198 | - searchVO.setTotalRows(rows); | |
199 | - resultMap.getResultData().put("searchVO", searchVO); | |
200 | - } catch (Exception e) { | |
201 | - e.printStackTrace(); | |
202 | - } | |
203 | - return resultMap; | |
204 | - } | |
205 | - | |
206 | - public List<NodeVO> nodeList(String diagramId) throws Exception { | |
207 | - List<NodeVO> nodeData = diagramDAO.nodeList(diagramId); | |
208 | - return nodeData; | |
209 | - } | |
210 | - | |
211 | - public List<EdgeVO> lineList(String diagramId) throws Exception { | |
212 | - List<EdgeVO> lineData = diagramDAO.lineList(diagramId); | |
213 | - return lineData; | |
214 | - } | |
215 | - | |
216 | - /* 다이어그램 등록 */ | |
217 | - @Transactional | |
218 | - public int dataInsert(DiagramDetailDTO diagramDetailDTO) throws Exception { | |
219 | - int result = 0; | |
220 | - String group_id = ""; | |
221 | - String userId = ""; | |
222 | - | |
223 | - // params 데이터 분리 | |
224 | - Schedule schedule = diagramDetailDTO.getSchedule(); | |
225 | - DiagramVO diagramVO = diagramDetailDTO.getDiagram(); | |
226 | - JobGroup jobGroup = schedule.getJobGroup(); | |
227 | - List<NodeVO> nodes = diagramVO.getNodes(); | |
228 | - List<EdgeVO> edges = diagramVO.getEdges(); | |
229 | - | |
230 | - // 노드 내역 저장 | |
231 | - List<JobItm> jobItmList = new ArrayList<>(); | |
232 | - | |
233 | - // 노드 순서대로 정렬 | |
234 | - nodeListByOrder = new ArrayList<>(); | |
235 | - for (NodeVO nodeVO : nodes) { | |
236 | - if (nodeVO.getNode_type().equals("DATASET_UPDATE")) { | |
237 | - String endNodeId = nodeVO.getId(); | |
238 | - nodeListByOrder.add(nodeVO); | |
239 | - findPrevNode(nodes, edges, endNodeId); | |
240 | - break; | |
241 | - } | |
242 | - } | |
243 | - | |
244 | - // 노드 별 실행 | |
245 | - for (NodeVO nodeVO : nodeListByOrder) { | |
246 | - JobItm jobData = new JobItm(); | |
247 | - jobData.setItm(nodeVO.getItm()); | |
248 | - switch (nodeVO.getNode_type()) { | |
249 | - case "DB_READ": | |
250 | - jobData.setType("dbConnection"); | |
251 | - break; | |
252 | - case "API_READ": | |
253 | - jobData.setType("apiRead"); | |
254 | - break; | |
255 | - case "FILE_READ": | |
256 | - jobData.setType("fileRead"); | |
257 | - break; | |
258 | - case "DATASET_READ": | |
259 | - jobData.setType("datasetRead"); | |
260 | - break; | |
261 | - case "DATASET_UPDATE": | |
262 | - jobData.setType("datasetWrite"); | |
263 | - break; | |
264 | - case "DATA_FILTER": | |
265 | - jobData.setType("filter"); | |
266 | - break; | |
267 | - case "EHOJO_READ": | |
268 | - jobData.setType("ehojoRead"); | |
269 | - break; | |
270 | - } | |
271 | - jobItmList.add(jobData); | |
272 | - } | |
273 | - jobGroup.setJobItm(jobItmList); | |
274 | - | |
275 | - try { | |
276 | - CustomeResultMap customeResultMap = jobService.insertJobGroup(jobGroup); | |
277 | - userId = CommonUtil.getLoginUserId(); | |
278 | - group_id = customeResultMap.getResultData().get("group_id").toString(); | |
279 | - } catch (Exception e) { | |
280 | - e.printStackTrace(); | |
281 | - throw e; | |
282 | - } | |
283 | - | |
284 | - if(StringUtil.isEmpty(schedule.getSchdul_id())) { | |
285 | - schedule.setSchdul_id(CommonUtil.getRandKey("SCHEDULE")); | |
286 | - schedule.setCreatId(userId); | |
287 | - } else { | |
288 | - schedule.setUpdtId(userId); | |
289 | - } | |
290 | - schedule.setGroup_id(group_id); | |
291 | - result += scheduleDAO.conflictInsertSchedule(schedule); | |
292 | - | |
293 | - diagramVO.setDiagram_id(group_id); | |
294 | - diagramVO.setCreat_id(userId); | |
295 | - result += diagramDAO.diagramDataInsert(diagramVO); | |
296 | - | |
297 | - for (NodeVO nodeVO : nodes) { | |
298 | - nodeVO.setDiagram_id(group_id); | |
299 | - nodeVO.setNode_id(nodeVO.getId()); | |
300 | - nodeVO.setNode_state("wait"); | |
301 | - nodeVO.setLog_message("is not Running"); | |
302 | - result += diagramDAO.nodeDataInsert(nodeVO); | |
303 | - } | |
304 | - | |
305 | - for (EdgeVO edge : edges) { | |
306 | - edge.setDiagram_id(group_id); | |
307 | - result += diagramDAO.lineDataInsert(edge); | |
308 | - } | |
309 | - | |
310 | - String logId = CommonUtil.getRandKey("LOGID"); | |
311 | - LogVO logVO = new LogVO(); | |
312 | - logVO.setLog_id(logId); | |
313 | - logVO.setTotal_node_count(nodes.size()); | |
314 | - logVO.setFail_node_count(0); | |
315 | - logVO.setFail_node_name("N"); | |
316 | - logVO.setState_info("success"); | |
317 | - logVO.setDiagram_id(group_id); | |
318 | - logVO.setUser_id(userId); | |
319 | - diagramDAO.logDataInsert(logVO); | |
320 | - | |
321 | - LogDetailVO logDetailVO = new LogDetailVO(); | |
322 | - List<NodeVO> nodeList = diagramDAO.nodeList(group_id); | |
323 | - for (NodeVO nodeVO : nodeList) { | |
324 | - String detailLogId = CommonUtil.getRandKey("DETAILLOGID"); | |
325 | - logDetailVO.setDetail_log_id(detailLogId); | |
326 | - logDetailVO.setNode_name(nodeVO.getNode_name()); | |
327 | - logDetailVO.setLog_id(logId); | |
328 | - logDetailVO.setLog_category("-"); | |
329 | - logDetailVO.setLog_message("등록"); | |
330 | - logDetailVO.setOperation_date(logVO.getOperation_date()); | |
331 | - diagramDAO.logDetailDataInsert(logDetailVO); | |
332 | - } | |
333 | - return result; | |
334 | - } | |
335 | - | |
336 | - /* 다이어그램 수정 */ | |
337 | - @Transactional(rollbackFor = Exception.class) | |
338 | - public int dataEdit(DiagramDetailDTO diagramDetailDTO) throws Exception { | |
339 | - int result =0; | |
340 | - | |
341 | - // params 데이터 분리 | |
342 | - Schedule schedule = diagramDetailDTO.getSchedule(); | |
343 | - DiagramVO diagramVO = diagramDetailDTO.getDiagram(); | |
344 | - // schedule 데이터 분리 | |
345 | - JobGroup jobGroup = schedule.getJobGroup(); | |
346 | - // diagram 데이터 분리 | |
347 | - List<NodeVO> nodes = diagramVO.getNodes(); | |
348 | - // 첫 번째 노드에서 다이어그램 id 가져오기 | |
349 | - // 프론트에서 노드 정보가 전달 되어야 수정 버튼이 동작하기 때문에 해당 위치에 반드시 있음 | |
350 | - String diagramId = schedule.getGroup_id(); | |
351 | - | |
352 | - // diagramId로 노드와 엣지 정보 일괄 삭제 | |
353 | - diagramDAO.nodeDelete(diagramId); | |
354 | - diagramDAO.edgeDelete(diagramId); | |
355 | - | |
356 | - // 로그 삭제 | |
357 | - HashMap<String,Object> logParams = new HashMap<>(); | |
358 | - logParams.put("diagram_id", diagramId); | |
359 | - List<LogVO> logList = diagramDAO.logSelectListAllID(logParams); | |
360 | - for (LogVO logVO : logList) { | |
361 | - result += diagramDAO.logDetailDelete(logVO.getLog_id()); | |
362 | - } | |
363 | - result += diagramDAO.logDelete(diagramId); | |
364 | - | |
365 | - // 다이어그램 삭제 | |
366 | - diagramDAO.diagramDelete(diagramId); | |
367 | - | |
368 | - // 스케줄 삭제 | |
369 | - result += scheduleDAO.conflictInsertSchedule(schedule); | |
370 | - | |
371 | - // jobItem 삭제 | |
372 | - for (NodeVO nodeVO : nodes) { | |
373 | - String itmId = null; | |
374 | - switch (nodeVO.getNode_type()) { | |
375 | - case "DB_READ": | |
376 | - itmId = jobDAO.selectIdJobItemDbId(diagramId); | |
377 | - dataDAO.deleteConnectionDb(itmId); | |
378 | - break; | |
379 | - case "API_READ": | |
380 | - itmId = jobDAO.selectIdJobItemApiId(diagramId); | |
381 | - connectionApiDAO.deleteApiParameterInfo(itmId); | |
382 | - connectionApiDAO.deleteApiConnectionInfo(itmId); | |
383 | - break; | |
384 | - case "FILE_READ": | |
385 | - jobDAO.deleteFileReadItm(diagramId); | |
386 | - break; | |
387 | - case "DATASET_UPDATE": | |
388 | - jobDAO.deleteDatasetItem(diagramId); | |
389 | - break; | |
390 | - case "DATA_FILTER": | |
391 | - jobDAO.deleteFilterItem(diagramId); | |
392 | - break; | |
393 | - case "EHOJO_READ": | |
394 | - String ehpInfoId = jobDAO.selectIdJobItemEhpId(diagramId); | |
395 | - connectEhojoPlusService.deleteEhojoPlusInfo(ehpInfoId); | |
396 | - break; | |
397 | - } | |
398 | - } | |
399 | - jobDAO.jobItemDeleteId(diagramId); | |
400 | - | |
401 | - // jobGroup 삭제 | |
402 | - jobDAO.jobGroupDelete(jobGroup); | |
403 | - | |
404 | - // 다이어그램 등록 | |
405 | - dataInsert(diagramDetailDTO); | |
406 | - | |
407 | - return result; | |
408 | - } | |
409 | - | |
410 | - /** | |
411 | - * @author 하관우 | |
412 | - * @since 2024.02.15 | |
413 | - * | |
414 | - * diagram_id를 가져와서 해당하는것들 삭제 | |
415 | - */ | |
416 | - @Transactional(rollbackFor = Exception.class) | |
417 | - public int dataDelete(List<Schedule> scheduleList) throws Exception { | |
418 | - int result = 0; | |
419 | - for (Schedule schedule : scheduleList) { | |
420 | - String diagramId = schedule.getGroup_id(); | |
421 | - result += diagramDAO.edgeDelete(diagramId); | |
422 | - result += diagramDAO.nodeDelete(diagramId); | |
423 | - | |
424 | - HashMap<String,Object> logParams = new HashMap<>(); | |
425 | - logParams.put("diagram_id", diagramId); | |
426 | - List<LogVO> logList = diagramDAO.logSelectListAllID(logParams); | |
427 | - for (LogVO logVO : logList) { | |
428 | - result += diagramDAO.logDetailDelete(logVO.getLog_id()); | |
429 | - } | |
430 | - result += diagramDAO.logDelete(diagramId); | |
431 | - result += diagramDAO.diagramDelete(diagramId); | |
432 | - | |
433 | - schedule.setUse_at(false); | |
434 | - result += scheduleDAO.conflictInsertSchedule(schedule); | |
435 | - } | |
436 | - return result; | |
437 | - } | |
438 | - | |
439 | - //로그 인서트 | |
440 | - public String diagramLog(LogVO logData)throws Exception{ | |
441 | - int result =0; | |
442 | - | |
443 | - logData.setLog_id(CommonUtil.getRandKey("LOGID")); | |
444 | - result += diagramDAO.logDataInsert(logData); | |
445 | - | |
446 | - return logData.getLog_id(); | |
447 | - } | |
448 | - | |
449 | - //로그 업데이트 | |
450 | - public int diagramLogUP(LogVO logData)throws Exception{ | |
451 | - int result =0; | |
452 | - //로그 인서트 | |
453 | - result += diagramDAO.logDataUpdate(logData); | |
454 | - | |
455 | - return result; | |
456 | - } | |
457 | - | |
458 | - //로그 상세 인서트 | |
459 | - public int dirgramDetailLog(LogDetailVO logDetailData)throws Exception{ | |
460 | - logDetailData.setDetail_log_id(CommonUtil.getRandKey("DETAILLOGID")); | |
461 | - return diagramDAO.logDetailDataInsert(logDetailData); | |
462 | - } | |
463 | - | |
464 | - /** | |
465 | - * @author 박정하 | |
466 | - * @since 2024.09.07 | |
467 | - * | |
468 | - * 즉시계산 | |
469 | - */ | |
470 | - public List<HashMap<String, Object>> operatorNow(DiagramVO diagramVO, String type) throws Exception { | |
471 | - // params 데이터 분리 | |
472 | - List<NodeVO> nodes = diagramVO.getNodes(); | |
473 | - List<EdgeVO> edges = diagramVO.getEdges(); | |
474 | - | |
475 | - // 유저 정보 가져오기 | |
476 | - String userId = null; | |
477 | - if (type.equals("create")) { | |
478 | - userId = CommonUtil.getLoginUserId(); | |
479 | - } else { | |
480 | - userId = "admin"; | |
481 | - } | |
482 | - | |
483 | - // 로그 생성 | |
484 | - LogVO logVO = new LogVO(); | |
485 | - logVO.setDiagram_id(diagramVO.getDiagram_id()); | |
486 | - logVO.setUser_id(userId); | |
487 | - logVO.setTotal_node_count(nodes.size()); | |
488 | - logVO.setFail_node_count(0); | |
489 | - logVO.setState_info("success"); | |
490 | - String logId = diagramLog(logVO); | |
491 | - | |
492 | - // 노드 순서대로 정렬 | |
493 | - nodeListByOrder = new ArrayList<>(); | |
494 | - for (NodeVO nodeVO : nodes) { | |
495 | - if (nodeVO.getNode_type().equals("DATASET_UPDATE")) { | |
496 | - String endNodeId = nodeVO.getId(); | |
497 | - nodeListByOrder.add(nodeVO); | |
498 | - findPrevNode(nodes, edges, endNodeId); | |
499 | - break; // endNode는 1개만 존재할 수 있음 (프론트에서 검증 후 등록됨) | |
500 | - } | |
501 | - } | |
502 | - | |
503 | - List<HashMap<String, Object>> resultNodeList = new ArrayList<>(); | |
504 | - int failNodeCount = 0; | |
505 | - String failNodeName = null; | |
506 | - for (int i = 0; i < nodeListByOrder.size(); i++) { | |
507 | - NodeVO node = nodeListByOrder.get(i); | |
508 | - | |
509 | - // 로그 디테일 등록 | |
510 | - LogDetailVO logDetailVO = new LogDetailVO(); | |
511 | - logDetailVO.setNode_name(node.getNode_name()); | |
512 | - logDetailVO.setLog_id(logId); | |
513 | - logDetailVO.setLog_category("success"); | |
514 | - logDetailVO.setLog_message(null); | |
515 | - logDetailVO.setCreat_id(userId); | |
516 | - Timestamp operationDate = new Timestamp(System.currentTimeMillis()); | |
517 | - logDetailVO.setOperation_date(operationDate); | |
518 | - | |
519 | - // 노드 실행 | |
520 | - try { | |
521 | - nodeCalculation(node); | |
522 | - } catch (Exception e) { | |
523 | - failNodeCount++; | |
524 | - logDetailVO.setLog_category("fail"); | |
525 | - logDetailVO.setLog_message(e.getMessage()); | |
526 | - } | |
527 | - | |
528 | - // 로그 디테일 수정 | |
529 | - dirgramDetailLog(logDetailVO); | |
530 | - | |
531 | - logVO.setFail_node_count(failNodeCount); | |
532 | - if (failNodeCount > 0) { | |
533 | - failNodeName = node.getNode_name(); | |
534 | - logVO.setFail_node_name(failNodeName); | |
535 | - } | |
536 | - } | |
537 | - | |
538 | - // 반환값 | |
539 | - return resultNodeList; | |
540 | - } | |
541 | - | |
542 | - /** | |
543 | - * @author 박정하 | |
544 | - * @since 2024.09.07 | |
545 | - * | |
546 | - * 노드 설정 값에 따라 노드 실행 | |
547 | - */ | |
548 | - private NodeVO nodeCalculation(NodeVO node) throws Exception { | |
549 | - DataTable resultDataTable = new DataTable(); | |
550 | - JobItm resultJobItm = new JobItm(); | |
551 | - | |
552 | - NodeVO prevNode; | |
553 | - List<ColumnData> columnDatas; | |
554 | - List<List<Object>> rowData; | |
555 | - ObjectMapper objectMapper = new ObjectMapper(); | |
556 | - String itmToString; | |
557 | - | |
558 | - String nodeType = node.getNode_type(); | |
559 | - switch (nodeType) { | |
560 | - // DB_READ, FILE_READ, API_READ는 선행 노드와 관계 없이 실행 | |
561 | - case "DB_READ": | |
562 | - itmToString = objectMapper.writeValueAsString(node.getItm()); | |
563 | - ConnectionDB connectionDB = objectMapper.readValue(itmToString, ConnectionDB.class); | |
564 | - connectionDB.decodingData(); | |
565 | - | |
566 | - resultJobItm.setItm(connectionDB); | |
567 | - node.setItm(connectionDB); | |
568 | - | |
569 | - DataTable resultTable = JobUtil.dbConnectionExec(resultJobItm); | |
570 | - node.setDataTable(resultTable); | |
571 | - break; | |
572 | - case "API_READ": | |
573 | - itmToString = objectMapper.writeValueAsString(node.getItm()); | |
574 | - ConnectionApi connectionApi = objectMapper.readValue(itmToString, ConnectionApi.class); | |
575 | - DataTable dataTable = connectionApiService.apiRequest(connectionApi); | |
576 | - node.setDataTable(dataTable); | |
577 | - break; | |
578 | - case "FILE_READ": | |
579 | - DataTable dataTableMap = node.getDataTable(); | |
580 | - List<ColumnData> columnDatasMapList = dataTableMap.getColumnDatas(); | |
581 | - resultDataTable.setColumnDatas(columnDatasMapList); | |
582 | - rowData = dataTableMap.getRowData(); | |
583 | - resultDataTable.setRowData(rowData); | |
584 | - resultJobItm.setDataTable(resultDataTable); | |
585 | - node.setDataTable(resultDataTable); | |
586 | - node.setItm(resultJobItm); | |
587 | - // DATA_FILTER는 선행 노드의 결과 값을 가져와서 실행 | |
588 | - case "DATA_FILTER": | |
589 | - for (int i = 0; i < nodeListByOrder.size(); i++) { | |
590 | - if (nodeListByOrder.get(i).getId().equals(node.getId())) { | |
591 | - prevNode = nodeListByOrder.get(i - 1); | |
592 | - node.setDataTable(prevNode.getDataTable()); | |
593 | - break; | |
594 | - } | |
595 | - } | |
596 | - node = filterService.runFilter(node); | |
597 | - break; | |
598 | - // DATASET_UPDATE는 선행 노드의 결과 값을 가져와서 실행 | |
599 | - case "DATASET_UPDATE": | |
600 | - prevNode = nodeListByOrder.get(nodeListByOrder.size() - 2); // dataset_update가 가장 마지막에 실행됨(순서보장) | |
601 | - rowData = prevNode.getDataTable().getRowData(); // 넣을 데이터 | |
602 | - | |
603 | - JobItemGroup itm = objectMapper.readValue(objectMapper.writeValueAsString(node.getItm()), JobItemGroup.class); | |
604 | - String datasetPostId = itm.getItem(); | |
605 | - | |
606 | - List<List<Object>> insertData = new ArrayList<>(); | |
607 | - List<List<Object>> changeData = new ArrayList<>(); | |
608 | - List<List<Object>> deleteData = new ArrayList<>(); | |
609 | - | |
610 | - List<Object> matchList = itm.getItemList(); // 매칭 결과 | |
611 | - for (List<Object> row : rowData) { // rowData 크기 만큼 실행 | |
612 | - List<Object> newData = new ArrayList<>(); | |
613 | - | |
614 | - for (Object match : matchList) { // matchList 크기 만큼 실행(ts_row 제외한 컬럼 수 만큼 실행) | |
615 | - HashMap<String, Object> item = (HashMap<String, Object>) match; | |
616 | - | |
617 | - if (item.get("targetColumnNm") != null) { | |
618 | - String sourceColumnNm = item.get("targetColumnNm").toString(); | |
619 | - Integer sourceIdx = Integer.valueOf(sourceColumnNm.substring(0, sourceColumnNm.indexOf("/"))); | |
620 | - newData.add(row.get(sourceIdx)); | |
621 | - } else { | |
622 | - newData.add(null); | |
623 | - } | |
624 | - } | |
625 | - | |
626 | - if (node.isItm_option_bool()) { | |
627 | - insertData.add(newData); | |
628 | - } else { | |
629 | - changeData.add(newData); | |
630 | - } | |
631 | - } | |
632 | - | |
633 | - dataService.datasetRowDataUpdate(datasetPostId, changeData, deleteData, insertData, "admin"); | |
634 | - break; | |
635 | - } | |
636 | - return node; | |
637 | - } | |
638 | - | |
639 | - /** | |
640 | - * @author 박정하 | |
641 | - * @since 2024.10.04 | |
642 | - * | |
643 | - * Diagram 목록 조회 | |
644 | - */ | |
645 | - @Override | |
646 | - public CustomeResultMap diagramListRead(@RequestBody SearchVO searchVO) throws Exception { | |
647 | - CustomeResultMap result = new CustomeResultMap(); | |
648 | - | |
649 | - int totalRows = diagramDAO.diagramListCountRead(searchVO); | |
650 | - searchVO.setTotalRows(totalRows); | |
651 | - result.getResultData().put("searchVO", searchVO); | |
652 | - | |
653 | - List<DiagramListDTO> diagramList = diagramDAO.diagramListRead(searchVO); | |
654 | - result.getResultData().put("diagramList", diagramList); | |
655 | - return result; | |
656 | - } | |
657 | - | |
658 | - /** | |
659 | - * @author 박정하 | |
660 | - * @since 2024.10.04 | |
661 | - * | |
662 | - * Diagram 상세 조회 | |
663 | - */ | |
664 | - @Override | |
665 | - public CustomeResultMap diagramDetailRead(String diagramId) throws Exception { | |
666 | - CustomeResultMap result = new CustomeResultMap(); | |
667 | - | |
668 | - // 스케줄 상세 조회 | |
669 | - String scheduleId = scheduleDAO.selectScheduleIdRead(diagramId); | |
670 | - Schedule schedule = scheduleDAO.selectSchedule(scheduleId); | |
671 | - schedule.setJobGroup(jobService.selectJobGroup(diagramId)); | |
672 | - | |
673 | - // 다이어그램 상세 조회 | |
674 | - DiagramVO diagramVO = diagramDAO.diagramDetailRead(diagramId); // nodes, edges 조회 안 됨 | |
675 | - | |
676 | - // edges 조회 | |
677 | - List<EdgeVO> edges = diagramDAO.lineList(diagramId); | |
678 | - diagramVO.setEdges(edges); // diagramVO에 엣지 목록 추가 | |
679 | - | |
680 | - // nodes 조회 | |
681 | - List<NodeVO> nodes = diagramDAO.nodeList(diagramId); | |
682 | - // 노드 순서대로 정렬 | |
683 | - nodeListByOrder = new ArrayList<>(); | |
684 | - for (NodeVO nodeVO : nodes) { | |
685 | - nodeVO.setNode_id(nodeVO.getId()); | |
686 | - | |
687 | - NodePosition position = new NodePosition(); | |
688 | - position.setX(nodeVO.getCenter_x()); | |
689 | - position.setY(nodeVO.getCenter_y()); | |
690 | - nodeVO.setPosition(position); | |
691 | - | |
692 | - if (nodeVO.getNode_type().equals("DATASET_UPDATE")) { | |
693 | - String endNodeId = nodeVO.getId(); | |
694 | - nodeListByOrder.add(nodeVO); | |
695 | - findPrevNode(nodes, edges, endNodeId); | |
696 | - break; // endNode는 1개만 존재할 수 있음 (프론트에서 검증 후 등록됨) | |
697 | - } | |
698 | - } | |
699 | - | |
700 | - // JobGroup 생성 | |
701 | - JobGroup jobGroup = new JobGroup(); | |
702 | - jobGroup.setGroup_id(diagramId); | |
703 | - List<JobItm> jobItmList = jobDAO.selectJobItem(jobGroup); | |
704 | - jobGroup.setJobItm(jobItmList); | |
705 | - // 노드 형식 변경 | |
706 | - for (int i = 0; i < jobItmList.size(); i++) { | |
707 | - int order = i + 1; | |
708 | - for (JobItm jobItm : jobItmList) { | |
709 | - if (jobItm.getIndx() == order) { | |
710 | - for (NodeVO nodeVO : nodes) { | |
711 | - String nodeId = nodeListByOrder.get(i).getId(); // 다이어그램 등록시 순서대로 정렬하여 실행 순서 보장됨 | |
712 | - if (nodeVO.getId().equals(nodeId)) { | |
713 | - nodeVO = runJobItm(jobItm, diagramId, nodeVO, nodes); | |
714 | - break; | |
715 | - } | |
716 | - } | |
717 | - } | |
718 | - } | |
719 | - } | |
720 | - diagramVO.setNodes(nodes); // diagramVO에 노드 목록 추가 | |
721 | - | |
722 | - DiagramDetailDTO diagramDetailDTO = new DiagramDetailDTO(); | |
723 | - diagramDetailDTO.setSchedule(schedule); | |
724 | - diagramDetailDTO.setDiagram(diagramVO); | |
725 | - | |
726 | - result.getResultData().put("diagramDetailDTO", diagramDetailDTO); | |
727 | - return result; | |
728 | - } | |
729 | - | |
730 | - /** | |
731 | - * @author 박정하 | |
732 | - * @since 2024.10.04 | |
733 | - * | |
734 | - * Diagram Id로 Schedule 구하기 | |
735 | - */ | |
736 | - private Schedule selectScheduleIdRead(String diagramId) throws Exception { | |
737 | - String scheduleId = scheduleDAO.selectScheduleIdRead(diagramId); | |
738 | - return scheduleDAO.selectSchedule(scheduleId); | |
739 | - } | |
740 | - | |
741 | - /** | |
742 | - * @author 박정하 | |
743 | - * @since 2024.09.24 | |
744 | - * | |
745 | - * 엣지로 노드 실행 순서대로 정렬 | |
746 | - */ | |
747 | - private void findPrevNode(List<NodeVO> nodes, List<EdgeVO> edges, String nodeId) { | |
748 | - for (EdgeVO edge : edges) { | |
749 | - String sourceNodeId = edge.getSource(); // 엣지 기준 왼쪽 노드 | |
750 | - String targetNodeId = edge.getTarget(); // 엣지 기준 오른쪽 노드 | |
751 | - if (targetNodeId.equals(nodeId)) { | |
752 | - for (NodeVO node : nodes) { | |
753 | - if (node.getId().equals(sourceNodeId)) { | |
754 | - nodeListByOrder.add(0, node); | |
755 | - findPrevNode(nodes, edges, node.getId()); | |
756 | - } | |
757 | - } | |
758 | - } | |
759 | - } | |
760 | - } | |
761 | -}(파일 끝에 줄바꿈 문자 없음) |
--- src/main/java/com/takensoft/taken_bi_manager/diagram/service/impl/FilterServiceImpl.java
... | ... | @@ -1,36 +0,0 @@ |
1 | -package com.takensoft.taken_bi_manager.diagram.service.impl; | |
2 | - | |
3 | -import com.fasterxml.jackson.databind.ObjectMapper; | |
4 | -import com.takensoft.taken_bi_manager.data.vo.DataTable; | |
5 | -import com.takensoft.taken_bi_manager.diagram.service.FilterService; | |
6 | -import com.takensoft.taken_bi_manager.diagram.vo.NodeVO; | |
7 | -import com.takensoft.taken_bi_manager.jobs.util.DataFilterUtil; | |
8 | -import com.takensoft.taken_bi_manager.jobs.vo.JobItm; | |
9 | -import lombok.RequiredArgsConstructor; | |
10 | -import org.springframework.stereotype.Service; | |
11 | - | |
12 | -/** | |
13 | - * @author : 박정하 | |
14 | - * @since : 2024.09.25 | |
15 | - * 필터 관련 구현체 | |
16 | - */ | |
17 | -@Service("filterService") | |
18 | -@RequiredArgsConstructor | |
19 | -public class FilterServiceImpl implements FilterService { | |
20 | - /** | |
21 | - * @author : 박정하 | |
22 | - * @since : 2024.09.25 | |
23 | - * 필터 실행 | |
24 | - * use: NodeVO | |
25 | - */ | |
26 | - @Override | |
27 | - public NodeVO runFilter(NodeVO nodeVO) throws Exception { | |
28 | - JobItm jobItm = new JobItm(); | |
29 | - jobItm.setItm(nodeVO.getItm()); | |
30 | - jobItm.setDataTable(nodeVO.getDataTable()); | |
31 | - | |
32 | - DataTable dataTable = DataFilterUtil.FilterExcute(jobItm); // 필터 실행 | |
33 | - nodeVO.setDataTable(dataTable); | |
34 | - return nodeVO; | |
35 | - } | |
36 | -}(파일 끝에 줄바꿈 문자 없음) |
--- src/main/java/com/takensoft/taken_bi_manager/diagram/vo/DiagramVO.java
... | ... | @@ -1,46 +0,0 @@ |
1 | -package com.takensoft.taken_bi_manager.diagram.vo; | |
2 | - | |
3 | -import lombok.Data; | |
4 | - | |
5 | -import java.sql.Timestamp; | |
6 | -import java.util.*; | |
7 | - | |
8 | -/** | |
9 | - * @author 하관우 | |
10 | - * @since 2024. 03. 05 | |
11 | - * | |
12 | - * 노드를 관리할 부모 클레스 입니다. | |
13 | - */ | |
14 | -@Data | |
15 | -public class DiagramVO { | |
16 | - // 다이어 그램 아이디 | |
17 | - private String diagram_id; | |
18 | - | |
19 | - // 전체 Job 그룹 이름입니다. | |
20 | - private String diagram_nm; | |
21 | - | |
22 | - // 전체 노드 리스트 | |
23 | - private List<NodeVO> nodes; | |
24 | - | |
25 | - // 전체 라인 리스트 | |
26 | - private List<EdgeVO> edges; | |
27 | - | |
28 | - // 생성일 | |
29 | - private Timestamp creat_dt; | |
30 | - | |
31 | - // 생성자 ID | |
32 | - private String creat_id; | |
33 | - | |
34 | - // 수정일 | |
35 | - private Timestamp updt_dt; | |
36 | - | |
37 | - // 수정자 ID | |
38 | - private String updt_id; | |
39 | - | |
40 | - private Object data; | |
41 | - | |
42 | - public DiagramVO(){ | |
43 | - this.nodes = new ArrayList<>(); | |
44 | - this.edges = new ArrayList<>(); | |
45 | - } | |
46 | -}(파일 끝에 줄바꿈 문자 없음) |
--- src/main/java/com/takensoft/taken_bi_manager/diagram/vo/EdgeVO.java
... | ... | @@ -1,21 +0,0 @@ |
1 | -package com.takensoft.taken_bi_manager.diagram.vo; | |
2 | - | |
3 | -import lombok.Data; | |
4 | - | |
5 | -@Data | |
6 | -public class EdgeVO { | |
7 | - /** | |
8 | - * 선 테이블 | |
9 | - */ | |
10 | - //라인 ID | |
11 | - private String edge_id; | |
12 | - | |
13 | - //라인의 시작 노드 | |
14 | - private String source; | |
15 | - | |
16 | - //라인의 끝 노드 | |
17 | - private String target; | |
18 | - | |
19 | - //다이어그램 ID | |
20 | - private String diagram_id; | |
21 | -}(파일 끝에 줄바꿈 문자 없음) |
--- src/main/java/com/takensoft/taken_bi_manager/diagram/vo/LogDetailVO.java
... | ... | @@ -1,30 +0,0 @@ |
1 | -package com.takensoft.taken_bi_manager.diagram.vo; | |
2 | - | |
3 | -import lombok.Data; | |
4 | - | |
5 | -import java.sql.Timestamp; | |
6 | - | |
7 | -@Data | |
8 | -public class LogDetailVO { | |
9 | - | |
10 | - /** | |
11 | - * 로그 디테일 | |
12 | - */ | |
13 | - private String detail_log_id; //상세 로그 ID | |
14 | - | |
15 | - private Timestamp operation_success_date; // 작동완료일시 | |
16 | - | |
17 | - private String node_name; // 노드 이름 | |
18 | - | |
19 | - private String log_category; // 로그분류(성공, 실패) | |
20 | - | |
21 | - private String log_message; // 로그메세지 | |
22 | - | |
23 | - private String sj; // 제목 | |
24 | - | |
25 | - private String log_id; // 로그ID | |
26 | - | |
27 | - private String creat_id; //유저ID | |
28 | - | |
29 | - private Timestamp operation_date; //작동일시 | |
30 | -}(파일 끝에 줄바꿈 문자 없음) |
--- src/main/java/com/takensoft/taken_bi_manager/diagram/vo/LogVO.java
... | ... | @@ -1,28 +0,0 @@ |
1 | -package com.takensoft.taken_bi_manager.diagram.vo; | |
2 | - | |
3 | -import lombok.Data; | |
4 | - | |
5 | -import java.sql.Timestamp; | |
6 | - | |
7 | -@Data | |
8 | -public class LogVO { | |
9 | - | |
10 | - /** | |
11 | - * 스케줄 부르기 | |
12 | - */ | |
13 | - private String log_id; //로그 아이디 | |
14 | - | |
15 | - private Timestamp operation_date;//실행일자 | |
16 | - | |
17 | - private int total_node_count;//총 노드 수 | |
18 | - | |
19 | - private int fail_node_count;// 실패 노드 수 | |
20 | - | |
21 | - private String fail_node_name;// 실패 노드 네임 최초의 1개 | |
22 | - | |
23 | - private String state_info;// 상태 | |
24 | - | |
25 | - private String diagram_id;// 다이어그램 ID | |
26 | - | |
27 | - private String user_id; // userID | |
28 | -}(파일 끝에 줄바꿈 문자 없음) |
--- src/main/java/com/takensoft/taken_bi_manager/diagram/vo/NodePosition.java
... | ... | @@ -1,9 +0,0 @@ |
1 | -package com.takensoft.taken_bi_manager.diagram.vo; | |
2 | - | |
3 | -import lombok.Data; | |
4 | - | |
5 | -@Data | |
6 | -public class NodePosition { | |
7 | - private double x = 0; | |
8 | - private double y = 0; | |
9 | -}(파일 끝에 줄바꿈 문자 없음) |
--- src/main/java/com/takensoft/taken_bi_manager/diagram/vo/NodeVO.java
... | ... | @@ -1,73 +0,0 @@ |
1 | -package com.takensoft.taken_bi_manager.diagram.vo; | |
2 | - | |
3 | -import com.takensoft.taken_bi_manager.data.vo.DataTable; | |
4 | -import lombok.Data; | |
5 | - | |
6 | -@Data | |
7 | -public class NodeVO { | |
8 | - // 다이어 그램 아이디 | |
9 | - private String diagram_id; | |
10 | - | |
11 | - // 노드 ID | |
12 | - private String node_id; | |
13 | - | |
14 | - // 노드 명 | |
15 | - private String node_name; | |
16 | - | |
17 | - // 노드 아이템 타입 | |
18 | - private String node_type; | |
19 | - | |
20 | - // 처리할 item 입니다. | |
21 | - private DataTable front_dataTable; | |
22 | - | |
23 | - // 처리할 item 입니다. | |
24 | - private DataTable dataTable; | |
25 | - | |
26 | - // 관련 데이터를 만들 DB id입니다. | |
27 | - private String itm_id; | |
28 | - | |
29 | - // 타입별 사용 변수(아이템별 Vo객체 받아야함) | |
30 | - private Object itm; | |
31 | - | |
32 | - // 아이템 마다 사용할 커스텀 변수 | |
33 | - private boolean itm_option_bool; | |
34 | - | |
35 | - // 아이템 마다 사용할 커스텀 변수 | |
36 | - private String itm_option_string; | |
37 | - | |
38 | - // 좌표 x | |
39 | - private Double center_x; | |
40 | - | |
41 | - // 좌표 y | |
42 | - private Double center_y; | |
43 | - | |
44 | - // 노드 상태 | |
45 | - private String node_state; | |
46 | - | |
47 | - // 로그 메세지 | |
48 | - private String log_message; | |
49 | - | |
50 | - // 모달 플래이그 ? | |
51 | - private boolean flag; | |
52 | - | |
53 | - // 화면 노드 id | |
54 | - private String id; | |
55 | - | |
56 | - // 화면 노드 label | |
57 | - private String label; | |
58 | - | |
59 | - // 화면 노드 position | |
60 | - private NodePosition position; | |
61 | - | |
62 | - // 화면 노드 type | |
63 | - private String type; | |
64 | - | |
65 | - private Object data; | |
66 | - | |
67 | - public NodeVO() { | |
68 | - this.type = "custom"; | |
69 | - this.dataTable = new DataTable(); | |
70 | - this.front_dataTable = new DataTable(); | |
71 | - this.flag = false; | |
72 | - } | |
73 | -}(파일 끝에 줄바꿈 문자 없음) |
--- src/main/java/com/takensoft/taken_bi_manager/diagram/web/DiagramController.java
... | ... | @@ -1,182 +0,0 @@ |
1 | -package com.takensoft.taken_bi_manager.diagram.web; | |
2 | - | |
3 | -import com.takensoft.taken_bi_manager.common.schedule.vo.Schedule; | |
4 | -import com.takensoft.taken_bi_manager.common.vo.CustomeResultMap; | |
5 | -import com.takensoft.taken_bi_manager.common.vo.SearchVO; | |
6 | -import com.takensoft.taken_bi_manager.diagram.dao.DiagramDAO; | |
7 | -import com.takensoft.taken_bi_manager.diagram.service.Diagramservice; | |
8 | -import com.takensoft.taken_bi_manager.diagram.dto.DiagramDetailDTO; | |
9 | -import com.takensoft.taken_bi_manager.diagram.vo.DiagramVO; | |
10 | -import lombok.RequiredArgsConstructor; | |
11 | -import org.springframework.web.bind.annotation.*; | |
12 | -import org.springframework.web.servlet.ModelAndView; | |
13 | - | |
14 | -import java.util.*; | |
15 | - | |
16 | -@RestController | |
17 | -@RequestMapping("/diagram") | |
18 | -@RequiredArgsConstructor | |
19 | -public class DiagramController { | |
20 | - private final Diagramservice diagramService; | |
21 | - private final DiagramDAO diagramDAO; | |
22 | - | |
23 | - /** | |
24 | - * @author 하관우 | |
25 | - * @since 2024.01.23 | |
26 | - * | |
27 | - * Diagram 조회 | |
28 | - */ | |
29 | - @RequestMapping(value ="/dataSelectListAll.json", method = RequestMethod.POST) | |
30 | - public ModelAndView dataSelectListAll() throws Exception { | |
31 | - ModelAndView mav = new ModelAndView("jsonView"); | |
32 | - mav.addObject("result", diagramService.dataSelectListAll()); | |
33 | - return mav; | |
34 | - } | |
35 | - | |
36 | - /** | |
37 | - * @author 하관우 | |
38 | - * @since 2024.01.23 | |
39 | - * | |
40 | - * DIAGRAM_ID 해당하는 스케줄 관리 | |
41 | - */ | |
42 | - | |
43 | - @RequestMapping(value ="/scheduleList.json", method = RequestMethod.POST) | |
44 | - public ModelAndView scheduleList(@RequestBody HashMap<String,Object> params) throws Exception { | |
45 | - | |
46 | - ModelAndView mav = new ModelAndView("jsonView"); | |
47 | - mav.addObject("result", diagramService.scheduleList(params)); | |
48 | - return mav; | |
49 | - } | |
50 | - | |
51 | - /** | |
52 | - * @author 하관우 | |
53 | - * @since 2024.01.23 | |
54 | - * | |
55 | - * 로그조회 조회 | |
56 | - */ | |
57 | - | |
58 | - @RequestMapping(value ="/logSelectListAll.json", method = RequestMethod.POST) | |
59 | - public ModelAndView logSelectListAll(@RequestBody SearchVO searchVO) throws Exception { | |
60 | - ModelAndView mav = new ModelAndView("jsonView"); | |
61 | - mav.addObject("result", diagramService.logSelectListAll(searchVO)); | |
62 | - return mav; | |
63 | - } | |
64 | - | |
65 | - | |
66 | - /** | |
67 | - * @author 하관우 | |
68 | - * @since 2024.01.23 | |
69 | - * | |
70 | - * 로그 상세조회 조회 | |
71 | - */ | |
72 | - @RequestMapping(value ="/detaillogSelectListAll.json", method = RequestMethod.POST) | |
73 | - public ModelAndView detaillogSelectListAll(@RequestBody SearchVO searchVO) throws Exception { | |
74 | - | |
75 | - ModelAndView mav = new ModelAndView("jsonView"); | |
76 | - mav.addObject("result", diagramService.detaillogSelectListAll(searchVO)); | |
77 | - return mav; | |
78 | - } | |
79 | - | |
80 | - /** | |
81 | - * @author 하관우 | |
82 | - * @since 2024.01.23 | |
83 | - * | |
84 | - * node 조회 | |
85 | - */ | |
86 | - @RequestMapping(value ="/nodeList.json", method = RequestMethod.POST) | |
87 | - public ModelAndView nodeList(@RequestBody HashMap<String,Object> params) throws Exception { | |
88 | - ModelAndView mav = new ModelAndView("jsonView"); | |
89 | - mav.addObject("result", diagramService.nodeList(params.get("diagram_id").toString())); | |
90 | - return mav; | |
91 | - } | |
92 | - | |
93 | - /** | |
94 | - * @author 하관우 | |
95 | - * @since 2024.01.23 | |
96 | - * | |
97 | - * line 조회 | |
98 | - */ | |
99 | - @RequestMapping(value ="/lineList.json", method = RequestMethod.POST) | |
100 | - public ModelAndView lineList(@RequestBody HashMap<String,Object> params) throws Exception { | |
101 | - | |
102 | - ModelAndView mav = new ModelAndView("jsonView"); | |
103 | - mav.addObject("result", diagramService.lineList(params.get("diagram_id").toString())); | |
104 | - return mav; | |
105 | - } | |
106 | - | |
107 | - /** | |
108 | - * @author 권지용 | |
109 | - * @since 2024.01.29 | |
110 | - * | |
111 | - * 다이어그램의 모든 정보 등록 | |
112 | - */ | |
113 | - | |
114 | - @RequestMapping(value = "/dataInsert.json", method = RequestMethod.POST) | |
115 | - public ModelAndView dataInsert(@RequestBody DiagramDetailDTO diagramDetailDTO) throws Exception { | |
116 | - ModelAndView mav = new ModelAndView("jsonView"); | |
117 | - mav.addObject("result", diagramService.dataInsert(diagramDetailDTO)); | |
118 | - return mav; | |
119 | - } | |
120 | - | |
121 | - /** | |
122 | - * @author 하관우 | |
123 | - * @since 2024.05.29 | |
124 | - * | |
125 | - * 다이어그램의 모든 수정 등록 | |
126 | - */ | |
127 | - | |
128 | - @RequestMapping(value = "/dataEdit.json", method = RequestMethod.POST) | |
129 | - public ModelAndView dataEdit(@RequestBody DiagramDetailDTO diagramDetailDTO) throws Exception { | |
130 | - ModelAndView mav = new ModelAndView("jsonView"); | |
131 | - mav.addObject("result", diagramService.dataEdit(diagramDetailDTO)); | |
132 | - return mav; | |
133 | - } | |
134 | - | |
135 | - /** | |
136 | - * @author 하관우 | |
137 | - * @since 2024.02.08 | |
138 | - * | |
139 | - * 즉시계산 | |
140 | - */ | |
141 | - @RequestMapping(value = "/operatorNow.json", method = RequestMethod.POST) | |
142 | - public ModelAndView operatorNow(@RequestBody DiagramVO diagramVO) throws Exception { | |
143 | - ModelAndView mav = new ModelAndView("jsonView"); | |
144 | - mav.addObject("result", diagramService.operatorNow(diagramVO, "create")); | |
145 | - return mav; | |
146 | - } | |
147 | - | |
148 | - /** | |
149 | - * @author 하관우 | |
150 | - * @since 2024.02.15 | |
151 | - * | |
152 | - * diagram_id를 가져와서 해당하는것들 삭제 | |
153 | - * */ | |
154 | - @RequestMapping(value = "/dataDelete.json", method = RequestMethod.POST) | |
155 | - public ModelAndView dataDelete(@RequestBody List<Schedule> scheduleList) throws Exception { | |
156 | - ModelAndView mav = new ModelAndView("jsonView"); | |
157 | - mav.addObject("result", diagramService.dataDelete(scheduleList)); | |
158 | - return mav; | |
159 | - } | |
160 | - | |
161 | - /** | |
162 | - * @author 박정하 | |
163 | - * @since 2024.10.04 | |
164 | - * | |
165 | - * Diagram 목록 조회 | |
166 | - */ | |
167 | - @PostMapping(value="/diagramListRead") | |
168 | - public CustomeResultMap diagramListRead(@RequestBody SearchVO searchVO) throws Exception { | |
169 | - return diagramService.diagramListRead(searchVO); | |
170 | - } | |
171 | - | |
172 | - /** | |
173 | - * @author 박정하 | |
174 | - * @since 2024.10.04 | |
175 | - * | |
176 | - * Diagram 상세 조회 | |
177 | - */ | |
178 | - @GetMapping(value="/diagramDetailRead/{diagramId}") | |
179 | - public CustomeResultMap diagramDetailRead(@PathVariable String diagramId) throws Exception { | |
180 | - return diagramService.diagramDetailRead(diagramId); | |
181 | - } | |
182 | -}(파일 끝에 줄바꿈 문자 없음) |
--- src/main/java/com/takensoft/taken_bi_manager/host/dao/SftpDAO.java
+++ src/main/java/com/takensoft/taken_bi_manager/host/dao/SftpDAO.java
... | ... | @@ -2,7 +2,7 @@ |
2 | 2 |
|
3 | 3 |
import com.takensoft.taken_bi_manager.host.vo.ConnectionVO; |
4 | 4 |
import com.takensoft.taken_bi_manager.host.vo.HostVO; |
5 |
-import com.takensoft.taken_bi_manager.user.member.vo.Member; |
|
5 |
+import com.takensoft.taken_bi_manager.user.vo.Member; |
|
6 | 6 |
import org.apache.ibatis.annotations.Mapper; |
7 | 7 |
|
8 | 8 |
import java.util.List; |
--- src/main/java/com/takensoft/taken_bi_manager/host/service/SftpService.java
+++ src/main/java/com/takensoft/taken_bi_manager/host/service/SftpService.java
... | ... | @@ -6,7 +6,7 @@ |
6 | 6 |
import com.takensoft.taken_bi_manager.host.vo.ConnectionVO; |
7 | 7 |
import com.takensoft.taken_bi_manager.host.vo.SftpVO; |
8 | 8 |
import com.takensoft.taken_bi_manager.jobs.vo.JobItm; |
9 |
-import com.takensoft.taken_bi_manager.user.member.vo.Member; |
|
9 |
+import com.takensoft.taken_bi_manager.user.vo.Member; |
|
10 | 10 |
|
11 | 11 |
import java.util.List; |
12 | 12 |
|
--- src/main/java/com/takensoft/taken_bi_manager/host/service/impl/SftpServiceImpl.java
+++ src/main/java/com/takensoft/taken_bi_manager/host/service/impl/SftpServiceImpl.java
... | ... | @@ -16,7 +16,7 @@ |
16 | 16 |
import com.takensoft.taken_bi_manager.host.vo.HostVO; |
17 | 17 |
import com.takensoft.taken_bi_manager.host.vo.SftpVO; |
18 | 18 |
import com.takensoft.taken_bi_manager.jobs.vo.JobItm; |
19 |
-import com.takensoft.taken_bi_manager.user.member.vo.Member; |
|
19 |
+import com.takensoft.taken_bi_manager.user.vo.Member; |
|
20 | 20 |
import lombok.RequiredArgsConstructor; |
21 | 21 |
import org.springframework.stereotype.Service; |
22 | 22 |
|
--- src/main/java/com/takensoft/taken_bi_manager/host/web/SftpController.java
+++ src/main/java/com/takensoft/taken_bi_manager/host/web/SftpController.java
... | ... | @@ -7,14 +7,12 @@ |
7 | 7 |
import com.takensoft.taken_bi_manager.host.service.SftpService; |
8 | 8 |
import com.takensoft.taken_bi_manager.host.vo.SftpVO; |
9 | 9 |
import com.takensoft.taken_bi_manager.jobs.vo.JobItm; |
10 |
-import com.takensoft.taken_bi_manager.user.member.vo.Member; |
|
10 |
+import com.takensoft.taken_bi_manager.user.vo.Member; |
|
11 | 11 |
import lombok.RequiredArgsConstructor; |
12 | 12 |
import org.springframework.web.bind.annotation.*; |
13 | 13 |
import org.springframework.web.multipart.MultipartFile; |
14 | 14 |
|
15 |
-import java.util.HashMap; |
|
16 | 15 |
import java.util.List; |
17 |
-import java.util.Objects; |
|
18 | 16 |
|
19 | 17 |
@RestController |
20 | 18 |
@RequiredArgsConstructor |
--- src/main/java/com/takensoft/taken_bi_manager/jobs/dao/JobDAO.java
+++ src/main/java/com/takensoft/taken_bi_manager/jobs/dao/JobDAO.java
... | ... | @@ -1,7 +1,5 @@ |
1 | 1 |
package com.takensoft.taken_bi_manager.jobs.dao; |
2 | 2 |
|
3 |
-import com.takensoft.taken_bi_manager.common.connection.db.vo.ConnectionDB; |
|
4 |
-import com.takensoft.taken_bi_manager.common.vo.SearchVO; |
|
5 | 3 |
import com.takensoft.taken_bi_manager.jobs.vo.JobGroup; |
6 | 4 |
import com.takensoft.taken_bi_manager.jobs.vo.JobItm; |
7 | 5 |
import com.takensoft.taken_bi_manager.jobs.vo.item.*; |
--- src/main/java/com/takensoft/taken_bi_manager/jobs/vo/item/DatasetWriteItem.java
+++ src/main/java/com/takensoft/taken_bi_manager/jobs/vo/item/DatasetWriteItem.java
... | ... | @@ -39,5 +39,4 @@ |
39 | 39 |
* 타겟 오리지널 컬럼명 |
40 | 40 |
*/ |
41 | 41 |
private String targetColumnNm; |
42 |
- |
|
43 |
-} |
|
42 |
+}(파일 끝에 줄바꿈 문자 없음) |
+++ src/main/java/com/takensoft/taken_bi_manager/schedule/dao/DiagramDAO.java
... | ... | @@ -0,0 +1,64 @@ |
1 | +package com.takensoft.taken_bi_manager.schedule.dao; | |
2 | + | |
3 | +import com.takensoft.taken_bi_manager.schedule.vo.DiagramVO; | |
4 | +import com.takensoft.taken_bi_manager.schedule.vo.ScheduleVO; | |
5 | +import com.takensoft.taken_bi_manager.common.vo.SearchVO; | |
6 | +import com.takensoft.taken_bi_manager.schedule.vo.*; | |
7 | +import org.apache.ibatis.annotations.Mapper; | |
8 | + | |
9 | +import java.util.HashMap; | |
10 | +import java.util.List; | |
11 | + | |
12 | +@Mapper | |
13 | +public interface DiagramDAO { | |
14 | + /** | |
15 | + * @author gkrhksdn | |
16 | + * @since 2024.01.23 | |
17 | + * | |
18 | + * Diagram 데이터 조회 | |
19 | + */ | |
20 | + List<ScheduleVO> dataSelectListAll() throws Exception; | |
21 | + | |
22 | + ScheduleVO scheduleList(HashMap<String,Object> params) throws Exception; | |
23 | + | |
24 | + List<ScheduleLogVO> logSelectListAll(SearchVO searchVO) throws Exception; | |
25 | + int logSelectListCnt(SearchVO searchVO) throws Exception; | |
26 | + | |
27 | + List<ScheduleLogVO> logSelectListAllID(HashMap<String,Object> params) throws Exception; | |
28 | + | |
29 | + List<ScheduleLogDetailVO> detaillogSelectListAll(SearchVO searchVO) throws Exception; | |
30 | + | |
31 | + int detaillogSelectListCnt(SearchVO searchVO) throws Exception; | |
32 | + | |
33 | + List<NodeVO> nodeList(String diagramId) throws Exception; | |
34 | + | |
35 | + List<EdgeVO> lineList(String diagramId) throws Exception; | |
36 | + | |
37 | + int diagramDataInsert(DiagramVO diagramVO) throws Exception; | |
38 | + | |
39 | + int nodeDataInsert(NodeVO nodeVO) throws Exception; | |
40 | + | |
41 | + int lineDataInsert(EdgeVO edgeVO) throws Exception; | |
42 | + | |
43 | + int logDataInsert(ScheduleLogVO scheduleLogVO) throws Exception; | |
44 | + | |
45 | + int logDataUpdate(ScheduleLogVO scheduleLogVO) throws Exception; | |
46 | + | |
47 | + int logDetailDataInsert(ScheduleLogDetailVO scheduleLogDetailVO) throws Exception; | |
48 | + | |
49 | + int nodeDelete(String params) throws Exception; | |
50 | + | |
51 | + int edgeDelete(String params) throws Exception; | |
52 | + | |
53 | + int diagramDelete(String params) throws Exception; | |
54 | + | |
55 | + int logDelete(String params) throws Exception; | |
56 | + | |
57 | + int logDetailDelete(String params) throws Exception; | |
58 | + | |
59 | +// List<DiagramListDTO> diagramListRead(SearchVO searchVO) throws Exception; | |
60 | + | |
61 | + int diagramListCountRead(SearchVO searchVO) throws Exception; | |
62 | + | |
63 | + DiagramVO diagramDetailRead(String diagramId) throws Exception; | |
64 | +}(파일 끝에 줄바꿈 문자 없음) |
+++ src/main/java/com/takensoft/taken_bi_manager/schedule/dao/ScheduleDAO.java
... | ... | @@ -0,0 +1,66 @@ |
1 | +package com.takensoft.taken_bi_manager.schedule.dao; | |
2 | + | |
3 | +import com.takensoft.taken_bi_manager.schedule.vo.ScheduleVO; | |
4 | +import com.takensoft.taken_bi_manager.common.vo.SearchVO; | |
5 | +import org.apache.ibatis.annotations.Mapper; | |
6 | + | |
7 | +import java.util.*; | |
8 | + | |
9 | +@Mapper | |
10 | +public interface ScheduleDAO { | |
11 | + /** | |
12 | + * @author 박정하 | |
13 | + * @since 2025.01.16 | |
14 | + * | |
15 | + * 스케줄 목록 조회 | |
16 | + */ | |
17 | + public List<ScheduleVO> selectScheduleList(SearchVO searchVO) throws Exception; | |
18 | + | |
19 | + /** | |
20 | + * @author 박정하 | |
21 | + * @since 2025.01.16 | |
22 | + * | |
23 | + * 스케줄 전체 개수 조회 | |
24 | + */ | |
25 | + public int selectScheduleCount(SearchVO searchVO) throws Exception; | |
26 | + | |
27 | + /** | |
28 | + * @author 박정하 | |
29 | + * @since 2025.01.16 | |
30 | + * | |
31 | + * 스케줄 등록 | |
32 | + */ | |
33 | + public int insertSchedule(ScheduleVO scheduleVO) throws Exception; | |
34 | + | |
35 | + /** | |
36 | + * @author 김성원 | |
37 | + * @since 2021.01.24 | |
38 | + * | |
39 | + * 스케줄 상세 조회 | |
40 | + */ | |
41 | + public ScheduleVO selectSchedule (String id) throws Exception; | |
42 | + | |
43 | + /** | |
44 | + * @author 박정하 | |
45 | + * @since 2024.10.04 | |
46 | + * | |
47 | + * Diagram Id로 Schedule Id 구하기 | |
48 | + */ | |
49 | + public String selectScheduleIdRead(String diagramId) throws Exception; | |
50 | + | |
51 | + /** | |
52 | + * @author 박정하 | |
53 | + * @since 2024.10.04 | |
54 | + * | |
55 | + * 스케줄 정보 삭제 | |
56 | + */ | |
57 | + public int deleteSchedule(String schdulId) throws Exception; | |
58 | + | |
59 | + /** | |
60 | + * @author 박정하 | |
61 | + * @since 2024.10.04 | |
62 | + * | |
63 | + * 스케줄 상태 변경 | |
64 | + */ | |
65 | + public int scheduleSttusChange(HashMap<String, Object> params) throws Exception; | |
66 | +}(파일 끝에 줄바꿈 문자 없음) |
+++ src/main/java/com/takensoft/taken_bi_manager/schedule/dto/DiagramDTO.java
... | ... | @@ -0,0 +1,13 @@ |
1 | +package com.takensoft.taken_bi_manager.schedule.dto; | |
2 | + | |
3 | +import com.takensoft.taken_bi_manager.schedule.vo.DiagramVO; | |
4 | +import lombok.Data; | |
5 | + | |
6 | +@Data | |
7 | +public class DiagramDTO { | |
8 | + // 다이어그램 | |
9 | + private DiagramVO diagram = new DiagramVO(); | |
10 | + | |
11 | + // 현재 노드 | |
12 | + private NodeDTO nodeDTO = new NodeDTO(); | |
13 | +}(파일 끝에 줄바꿈 문자 없음) |
+++ src/main/java/com/takensoft/taken_bi_manager/schedule/dto/NodeDTO.java
... | ... | @@ -0,0 +1,27 @@ |
1 | +package com.takensoft.taken_bi_manager.schedule.dto; | |
2 | + | |
3 | +import com.takensoft.taken_bi_manager.data.vo.DataTable; | |
4 | +import com.takensoft.taken_bi_manager.jobs.vo.JobItm; | |
5 | +import lombok.Data; | |
6 | + | |
7 | +@Data | |
8 | +public class NodeDTO { | |
9 | + // 노드 ID (KEY) | |
10 | + private String id; | |
11 | + | |
12 | + // 노드 타입 (노트 템플릿용) | |
13 | + private String type; | |
14 | + | |
15 | + // 노드 이름 | |
16 | + private String label; | |
17 | + | |
18 | + // 위치 | |
19 | + private NodePositionDTO position = new NodePositionDTO(); | |
20 | + | |
21 | + // 셋업 완료 여부 | |
22 | + private Boolean isSetup = false; | |
23 | + | |
24 | + | |
25 | + // jobItm | |
26 | + private JobItm jobItm = new JobItm(); | |
27 | +}(파일 끝에 줄바꿈 문자 없음) |
+++ src/main/java/com/takensoft/taken_bi_manager/schedule/dto/NodePositionDTO.java
... | ... | @@ -0,0 +1,12 @@ |
1 | +package com.takensoft.taken_bi_manager.schedule.dto; | |
2 | + | |
3 | +import lombok.Data; | |
4 | + | |
5 | +@Data | |
6 | +public class NodePositionDTO { | |
7 | + // X 좌표 | |
8 | + private Double x; | |
9 | + | |
10 | + // Y 좌표 | |
11 | + private Double y; | |
12 | +}(파일 끝에 줄바꿈 문자 없음) |
+++ src/main/java/com/takensoft/taken_bi_manager/schedule/service/Diagramservice.java
... | ... | @@ -0,0 +1,116 @@ |
1 | +package com.takensoft.taken_bi_manager.schedule.service; | |
2 | + | |
3 | +import com.takensoft.taken_bi_manager.schedule.dto.DiagramDTO; | |
4 | +import com.takensoft.taken_bi_manager.schedule.vo.ScheduleVO; | |
5 | +import com.takensoft.taken_bi_manager.common.vo.CustomeResultMap; | |
6 | +import com.takensoft.taken_bi_manager.common.vo.SearchVO; | |
7 | +import com.takensoft.taken_bi_manager.schedule.vo.*; | |
8 | + | |
9 | +import java.util.*; | |
10 | + | |
11 | +public interface Diagramservice { | |
12 | + /* | |
13 | + * @author 박정하 | |
14 | + * @since 2025.02.07 | |
15 | + * | |
16 | + * 현재 노드에 연결된 노드(target) 조회 | |
17 | + */ | |
18 | + HashMap<String, Object> getNodesByNode(DiagramDTO diagramDTO); | |
19 | + | |
20 | + | |
21 | +// /** | |
22 | +// * @author 하관우 | |
23 | +// * @since 2024.01.23 | |
24 | +// * | |
25 | +// * Diagram 전체 조회 | |
26 | +// */ | |
27 | +// List<ScheduleVO> dataSelectListAll() throws Exception; | |
28 | +// | |
29 | +// /** | |
30 | +// * @author 하관우 | |
31 | +// * @since 2024.01.23 | |
32 | +// * | |
33 | +// * log 조회 | |
34 | +// */ | |
35 | +// CustomeResultMap logSelectListAll(SearchVO searchVO) throws Exception; | |
36 | +// | |
37 | +// /** | |
38 | +// * @author 하관우 | |
39 | +// * @since 2024.01.23 | |
40 | +// * | |
41 | +// * log detial 조회 | |
42 | +// */ | |
43 | +// CustomeResultMap detaillogSelectListAll(SearchVO searchVO) throws Exception; | |
44 | +// | |
45 | +// /** | |
46 | +// * @author 하관우 | |
47 | +// * @since 2024.01.23 | |
48 | +// * | |
49 | +// * schedule 조회 | |
50 | +// */ | |
51 | +// ScheduleVO scheduleList(HashMap<String,Object> params) throws Exception; | |
52 | +// | |
53 | +// /** | |
54 | +// * @author 하관우 | |
55 | +// * @since 2024.01.23 | |
56 | +// * | |
57 | +// * node 조회 | |
58 | +// */ | |
59 | +// List<NodeVO> nodeList(String diagramId) throws Exception; | |
60 | +// | |
61 | +// /** | |
62 | +// * @author 하관우 | |
63 | +// * @since 2024.01.23 | |
64 | +// * | |
65 | +// * line 조회 | |
66 | +// */ | |
67 | +// List<EdgeVO> lineList(String diagramId) throws Exception; | |
68 | +// | |
69 | +// /** | |
70 | +// * @author 하관우 | |
71 | +// * @since 2024.01.23 | |
72 | +// * | |
73 | +// * 다이어그램의 모든 정보 등록 | |
74 | +// */ | |
75 | +//// int dataInsert(DiagramDetailDTO diagramDetailDTO) throws Exception; | |
76 | +// | |
77 | +// /** | |
78 | +// * @author 하관우 | |
79 | +// * @since 2024.05.29 | |
80 | +// * | |
81 | +// * 다이어그램의 모든 수정 등록 | |
82 | +// */ | |
83 | +//// int dataEdit(DiagramDetailDTO diagramDetailDTO) throws Exception; | |
84 | +// | |
85 | +// /** | |
86 | +// * @author 하관우 | |
87 | +// * @since 2024.02.08 | |
88 | +// * | |
89 | +// * 즉시계산 | |
90 | +// */ | |
91 | +// List<HashMap<String, Object>> operatorNow(DiagramVO diagramVO, String type) throws Exception; | |
92 | +// | |
93 | +// /** | |
94 | +// * @author 하관우 | |
95 | +// * @since 2024.02.15 | |
96 | +// * | |
97 | +// * diagram_id를 가져와서 해당하는것들 삭제 | |
98 | +// */ | |
99 | +// int dataDelete(List<ScheduleVO> scheduleVOList) throws Exception; | |
100 | +// | |
101 | +// /** | |
102 | +// * @author 박정하 | |
103 | +// * @since 2024.10.04 | |
104 | +// * | |
105 | +// * Diagram 목록 조회 | |
106 | +// */ | |
107 | +// CustomeResultMap diagramListRead(SearchVO searchVO) throws Exception; | |
108 | +// | |
109 | +// /** | |
110 | +// * @author 박정하 | |
111 | +// * @since 2024.10.04 | |
112 | +// * | |
113 | +// * Diagram 상세 조회 | |
114 | +// */ | |
115 | +// CustomeResultMap diagramDetailRead(String diagramId) throws Exception; | |
116 | +}(파일 끝에 줄바꿈 문자 없음) |
+++ src/main/java/com/takensoft/taken_bi_manager/schedule/service/FilterService.java
... | ... | @@ -0,0 +1,17 @@ |
1 | +package com.takensoft.taken_bi_manager.schedule.service; | |
2 | + | |
3 | +import com.takensoft.taken_bi_manager.schedule.dto.NodeDTO; | |
4 | + | |
5 | +/** | |
6 | + * @author : 박정하 | |
7 | + * @since : 2024.09.25 | |
8 | + * 필터 관련 인터페이스 | |
9 | + */ | |
10 | +public interface FilterService { | |
11 | + /** | |
12 | + * @author : 박정하 | |
13 | + * @since : 2024.09.25 | |
14 | + * 필터 실행 | |
15 | + */ | |
16 | + NodeDTO runFilter(NodeDTO nodeVO) throws Exception; | |
17 | +}(파일 끝에 줄바꿈 문자 없음) |
--- src/main/java/com/takensoft/taken_bi_manager/common/schedule/service/ScheduleService.java
+++ src/main/java/com/takensoft/taken_bi_manager/schedule/service/ScheduleService.java
... | ... | @@ -1,25 +1,27 @@ |
1 |
-package com.takensoft.taken_bi_manager.common.schedule.service; |
|
1 |
+package com.takensoft.taken_bi_manager.schedule.service; |
|
2 | 2 |
|
3 |
-import com.takensoft.taken_bi_manager.common.schedule.vo.Schedule; |
|
3 |
+import com.takensoft.taken_bi_manager.schedule.vo.ScheduleVO; |
|
4 | 4 |
import com.takensoft.taken_bi_manager.common.vo.CustomeResultMap; |
5 | 5 |
import com.takensoft.taken_bi_manager.common.vo.SearchVO; |
6 | 6 |
|
7 |
+import java.util.HashMap; |
|
8 |
+ |
|
7 | 9 |
public interface ScheduleService { |
8 | 10 |
/** |
9 |
- * @author 김성원 |
|
10 |
- * @since 2021.01.24 |
|
11 |
- * |
|
12 |
- * 스케줄 등록 |
|
13 |
- */ |
|
14 |
- public int conflictInsertSchedule (Schedule schedule) throws Exception; |
|
15 |
- |
|
16 |
- /** |
|
17 |
- * @author 김성원 |
|
18 |
- * @since 2021.01.24 |
|
11 |
+ * @author 박정하 |
|
12 |
+ * @since 2025.01.16 |
|
19 | 13 |
* |
20 | 14 |
* 스케줄 목록 조회 |
21 | 15 |
*/ |
22 |
- public CustomeResultMap selectScheduleList (SearchVO searchVO) throws Exception; |
|
16 |
+ public HashMap<String, Object> selectScheduleList(SearchVO searchVO) throws Exception; |
|
17 |
+ |
|
18 |
+ /** |
|
19 |
+ * @author 박정하 |
|
20 |
+ * @since 2025.01.16 |
|
21 |
+ * |
|
22 |
+ * 스케줄 등록 |
|
23 |
+ */ |
|
24 |
+ public HashMap<String, Object> insertSchedule(ScheduleVO scheduleVO) throws Exception; |
|
23 | 25 |
|
24 | 26 |
/** |
25 | 27 |
* @author 김성원 |
... | ... | @@ -27,7 +29,7 @@ |
27 | 29 |
* |
28 | 30 |
* 스케줄 상세 조회 |
29 | 31 |
*/ |
30 |
- public Schedule selectSchedule (Schedule schedule) throws Exception; |
|
32 |
+ public ScheduleVO selectSchedule (ScheduleVO scheduleVO) throws Exception; |
|
31 | 33 |
|
32 | 34 |
/** |
33 | 35 |
* @author 박정하 |
+++ src/main/java/com/takensoft/taken_bi_manager/schedule/service/impl/DiagramServiceImpl.java
... | ... | @@ -0,0 +1,788 @@ |
1 | +package com.takensoft.taken_bi_manager.schedule.service.impl; | |
2 | + | |
3 | +import com.takensoft.taken_bi_manager.common.connection.api.dao.ConnectionApiDAO; | |
4 | +import com.takensoft.taken_bi_manager.common.connection.api.service.ConnectionApiService; | |
5 | +import com.takensoft.taken_bi_manager.common.connection.ehojoPlus.service.ConnectEhojoPlusService; | |
6 | +import com.takensoft.taken_bi_manager.schedule.dao.ScheduleDAO; | |
7 | +import com.takensoft.taken_bi_manager.schedule.dto.DiagramDTO; | |
8 | +import com.takensoft.taken_bi_manager.schedule.vo.DiagramVO; | |
9 | +import com.takensoft.taken_bi_manager.schedule.dto.NodeDTO; | |
10 | +import com.takensoft.taken_bi_manager.data.dao.DataDAO; | |
11 | +import com.takensoft.taken_bi_manager.data.dao.DatasetDAO; | |
12 | +import com.takensoft.taken_bi_manager.data.service.DataService; | |
13 | +import com.takensoft.taken_bi_manager.schedule.dao.DiagramDAO; | |
14 | +import com.takensoft.taken_bi_manager.schedule.service.Diagramservice; | |
15 | +import com.takensoft.taken_bi_manager.schedule.vo.*; | |
16 | +import com.takensoft.taken_bi_manager.host.service.SftpService; | |
17 | +import com.takensoft.taken_bi_manager.jobs.dao.JobDAO; | |
18 | +import com.takensoft.taken_bi_manager.jobs.service.JobService; | |
19 | +import lombok.RequiredArgsConstructor; | |
20 | +import org.springframework.beans.factory.annotation.Autowired; | |
21 | +import org.springframework.stereotype.Service; | |
22 | + | |
23 | +import java.util.*; | |
24 | + | |
25 | +@Service | |
26 | +@RequiredArgsConstructor | |
27 | +public class DiagramServiceImpl implements Diagramservice { | |
28 | + private final DiagramDAO diagramDAO; | |
29 | + | |
30 | + @Autowired | |
31 | + private ScheduleDAO scheduleDAO; | |
32 | + | |
33 | + @Autowired | |
34 | + private JobDAO jobDAO; | |
35 | + | |
36 | + @Autowired | |
37 | + private JobService jobService; | |
38 | + | |
39 | + @Autowired | |
40 | + private DataDAO dataDAO; | |
41 | + | |
42 | + @Autowired | |
43 | + private DataService dataService; | |
44 | + | |
45 | + @Autowired | |
46 | + private ConnectionApiDAO connectionApiDAO; | |
47 | + | |
48 | + @Autowired | |
49 | + private DatasetDAO datasetDAO; | |
50 | + | |
51 | + @Autowired | |
52 | + private ConnectionApiService connectionApiService; | |
53 | + | |
54 | + @Autowired | |
55 | + private SftpService sftpService; | |
56 | + | |
57 | + @Autowired | |
58 | + private FilterServiceImpl filterService; | |
59 | + | |
60 | + @Autowired | |
61 | + private final ConnectEhojoPlusService connectEhojoPlusService; | |
62 | + | |
63 | + private List<NodeVO> nodeListByOrder; | |
64 | + | |
65 | + @Override | |
66 | + | |
67 | + /* | |
68 | + * @author 박정하 | |
69 | + * @since 2025.02.07 | |
70 | + * | |
71 | + * 현재 노드에 연결된 노드(target) 조회 | |
72 | + * | |
73 | + */ | |
74 | + public HashMap<String, Object> getNodesByNode(DiagramDTO diagramDTO) { | |
75 | + HashMap<String, Object> result = new HashMap<>(); | |
76 | + | |
77 | + DiagramVO diagram = diagramDTO.getDiagram(); // 다이어그램 | |
78 | + List<NodeDTO> nodes = diagram.getNodes(); | |
79 | + List<EdgeVO> edges = diagram.getEdges(); | |
80 | + | |
81 | + NodeDTO currentNode = diagramDTO.getNodeDTO(); // 현재 노드 | |
82 | + | |
83 | + List<NodeDTO> frontNodes = new ArrayList<>(); | |
84 | + for (EdgeVO edge : edges) { | |
85 | + if (currentNode.getId().equals(edge.getTarget())) { | |
86 | + String frontNodeId = edge.getSource(); | |
87 | + NodeDTO frontNode = findNodeByNodeId(nodes, frontNodeId); | |
88 | + frontNodes.add(frontNode); // frontNodes에 추가 | |
89 | + } | |
90 | + } | |
91 | + | |
92 | + return result; | |
93 | + } | |
94 | + | |
95 | + /* | |
96 | + * @author 박정하 | |
97 | + * @since 2025.02.07 | |
98 | + * | |
99 | + * 제공 받은 노드 목록에서 제공 받은 노드 아이디를 지닌 노드 찾기 | |
100 | + * | |
101 | + */ | |
102 | + private NodeDTO findNodeByNodeId(List<NodeDTO> nodes, String nodeId) { | |
103 | + for (NodeDTO node : nodes) { | |
104 | + if (node.getId().equals(nodeId)) { | |
105 | + return node; | |
106 | + } | |
107 | + } | |
108 | + | |
109 | + return null; | |
110 | + }; | |
111 | + | |
112 | +// @Override | |
113 | +// public List<ScheduleVO> dataSelectListAll() throws Exception { | |
114 | +// return diagramDAO.dataSelectListAll(); | |
115 | +// } | |
116 | +// | |
117 | +// public ScheduleVO scheduleList(HashMap<String,Object> params) throws Exception { | |
118 | +// return diagramDAO.scheduleList(params); | |
119 | +// } | |
120 | +// | |
121 | +// /* jobItm 타입에 따라 개별 실행 */ | |
122 | +// private NodeVO runJobItm(JobItm jobItm, String diagramId, NodeVO nodeVO, List<NodeVO> nodes) throws Exception { | |
123 | +// String type = jobItm.getType(); | |
124 | +// NodeVO prevNode; | |
125 | +// DataTable dataTable; | |
126 | +// switch (type) { | |
127 | +// case "dbConnection": | |
128 | +// ConnectionDB connectionDB = dataDAO.selectDbConnectionOne(jobItm.getItm_id()); | |
129 | +// connectionDB.decodingData(); | |
130 | +// connectionDB.setQuery(jobDAO.selectIdJobItemId(diagramId).getItm_option_string()); | |
131 | +// | |
132 | +// JobItm newJobItm = new JobItm(); | |
133 | +// newJobItm.setDataTable(new DataTable()); | |
134 | +// newJobItm.setItm(connectionDB); | |
135 | +// nodeVO.setItm(connectionDB); | |
136 | +// | |
137 | +// dataTable = JobUtil.dbConnectionExec(newJobItm); | |
138 | +// nodeVO.setDataTable(dataTable); | |
139 | +// break; | |
140 | +// case "apiRead": | |
141 | +// String itmId = jobItm.getItm_id(); | |
142 | +// ConnectionApi connectionApi = connectionApiDAO.selectConnectionApi(itmId); | |
143 | +// nodeVO.setItm(connectionApi); | |
144 | +// dataTable = connectionApiService.apiRequest(connectionApi); | |
145 | +// nodeVO.setDataTable(dataTable); | |
146 | +// break; | |
147 | +// case "fileRead": | |
148 | +// FileInfoItem fileInfoItem = jobDAO.fileReadItmSelect(jobItm.getGroup_id()); | |
149 | +// String fileName = fileInfoItem.getFileName(); | |
150 | +// int lastDotIndex = fileName.lastIndexOf('.'); | |
151 | +// fileName.substring(lastDotIndex + 1); | |
152 | +// String extension = ""; | |
153 | +// if (lastDotIndex != -1 && lastDotIndex < fileName.length() - 1) { | |
154 | +// extension = fileName.substring(lastDotIndex + 1); | |
155 | +// } | |
156 | +// fileInfoItem.setExtension(extension); | |
157 | +// nodeVO.setDataTable((DataTable) sftpService.fileRead(fileInfoItem, fileInfoItem.getDatasetId()).getResultData().get("dataTableMap")); | |
158 | +// nodeVO.setItm(fileInfoItem); | |
159 | +// break; | |
160 | +// case "datasetRead": | |
161 | +// nodeVO.setItm(datasetDAO.selectDatasetPost(jobItm.getItm_id())); | |
162 | +// break; | |
163 | +// case "datasetWrite": | |
164 | +// prevNode = nodeListByOrder.get(nodeListByOrder.size() - 2); | |
165 | +// for (NodeVO node : nodes) { | |
166 | +// if (node.getId().equals(prevNode.getId())) { | |
167 | +// nodeVO.setDataTable(node.getDataTable()); | |
168 | +// break; | |
169 | +// } | |
170 | +// } | |
171 | +// JobItemGroup jobItemGroup = new JobItemGroup(); | |
172 | +// jobItemGroup.setGroupId(jobItm.getGroup_id()); | |
173 | +// jobItemGroup.setItem(jobItm.getItm_id()); | |
174 | +// jobItemGroup.setItemList(jobDAO.datasetItemSelect(jobItm)); | |
175 | +// nodeVO.setItm(jobItemGroup); | |
176 | +// break; | |
177 | +// case "filter": | |
178 | +// for (int i = 0; i < nodeListByOrder.size(); i++) { | |
179 | +// if (nodeListByOrder.get(i).getId().equals(nodeVO.getId())) { | |
180 | +// prevNode = nodeListByOrder.get(i - 1); | |
181 | +// nodeVO.setDataTable(prevNode.getDataTable()); | |
182 | +// break; | |
183 | +// } | |
184 | +// } | |
185 | +// DataFilter dataFilter = new DataFilter(); | |
186 | +// dataFilter.setGroupId(diagramId); | |
187 | +// dataFilter.setFilterItems(jobDAO.filterItemSelect(jobItm)); | |
188 | +// dataFilter.setMatch_type(jobItm.isItm_option_bool()); | |
189 | +// nodeVO.setItm(dataFilter); | |
190 | +// nodeVO = filterService.runFilter(nodeVO); | |
191 | +// break; | |
192 | +// case "ehojoRead": | |
193 | +// String id = jobItm.getItm_id(); | |
194 | +// ConnectionEhojoVO connectionEhojoVO = connectEhojoPlusService.selectEhojoPlusInfo(id); | |
195 | +// nodeVO.setItm(connectionEhojoVO); | |
196 | +// CustomeResultMap customeResultMap = connectEhojoPlusService.openFisCal(connectionEhojoVO); | |
197 | +// dataTable = (DataTable) customeResultMap.getResultData().get("dataTable"); | |
198 | +// nodeVO.setDataTable(dataTable); | |
199 | +// break; | |
200 | +// } | |
201 | +// | |
202 | +// return nodeVO; | |
203 | +// } | |
204 | +// | |
205 | +// public CustomeResultMap logSelectListAll(SearchVO searchVO) throws Exception { | |
206 | +// CustomeResultMap resultMap = new CustomeResultMap(); | |
207 | +// try { | |
208 | +// List<ScheduleLogVO> logList = diagramDAO.logSelectListAll(searchVO); | |
209 | +// resultMap.getResultData().put("logList", logList); | |
210 | +// int rows = diagramDAO.logSelectListCnt(searchVO); | |
211 | +// searchVO.setTotalRows(rows); | |
212 | +// resultMap.getResultData().put("searchVO", searchVO); | |
213 | +// } catch (Exception e) { | |
214 | +// e.printStackTrace(); | |
215 | +// } | |
216 | +// return resultMap; | |
217 | +// } | |
218 | +// | |
219 | +// public CustomeResultMap detaillogSelectListAll(SearchVO searchVO) throws Exception { | |
220 | +// CustomeResultMap resultMap = new CustomeResultMap(); | |
221 | +// try { | |
222 | +// List<ScheduleLogDetailVO> logList = diagramDAO.detaillogSelectListAll(searchVO); | |
223 | +// resultMap.getResultData().put("logList", logList); | |
224 | +// int rows = diagramDAO.detaillogSelectListCnt(searchVO); | |
225 | +// searchVO.setTotalRows(rows); | |
226 | +// resultMap.getResultData().put("searchVO", searchVO); | |
227 | +// } catch (Exception e) { | |
228 | +// e.printStackTrace(); | |
229 | +// } | |
230 | +// return resultMap; | |
231 | +// } | |
232 | +// | |
233 | +// public List<NodeVO> nodeList(String diagramId) throws Exception { | |
234 | +// List<NodeVO> nodeData = diagramDAO.nodeList(diagramId); | |
235 | +// return nodeData; | |
236 | +// } | |
237 | +// | |
238 | +// public List<EdgeVO> lineList(String diagramId) throws Exception { | |
239 | +// List<EdgeVO> lineData = diagramDAO.lineList(diagramId); | |
240 | +// return lineData; | |
241 | +// } | |
242 | +// | |
243 | +// /* 다이어그램 등록 */ | |
244 | +// @Transactional | |
245 | +// public int dataInsert(DiagramDetailDTO diagramDetailDTO) throws Exception { | |
246 | +// int result = 0; | |
247 | +// String group_id = ""; | |
248 | +// String userId = ""; | |
249 | +// | |
250 | +// // params 데이터 분리 | |
251 | +// ScheduleVO scheduleVO = diagramDetailDTO.getScheduleVO(); | |
252 | +// DiagramVO diagramVO = diagramDetailDTO.getDiagram(); | |
253 | +// JobGroup jobGroup = scheduleVO.getJobGroup(); | |
254 | +// List<NodeVO> nodes = diagramVO.getNodes(); | |
255 | +// List<EdgeVO> edges = diagramVO.getEdges(); | |
256 | +// | |
257 | +// // 노드 내역 저장 | |
258 | +// List<JobItm> jobItmList = new ArrayList<>(); | |
259 | +// | |
260 | +// // 노드 순서대로 정렬 | |
261 | +// nodeListByOrder = new ArrayList<>(); | |
262 | +// for (NodeVO nodeVO : nodes) { | |
263 | +// if (nodeVO.getNode_type().equals("DATASET_UPDATE")) { | |
264 | +// String endNodeId = nodeVO.getId(); | |
265 | +// nodeListByOrder.add(nodeVO); | |
266 | +// findPrevNode(nodes, edges, endNodeId); | |
267 | +// break; | |
268 | +// } | |
269 | +// } | |
270 | +// | |
271 | +// // 노드 별 실행 | |
272 | +// for (NodeVO nodeVO : nodeListByOrder) { | |
273 | +// JobItm jobData = new JobItm(); | |
274 | +// jobData.setItm(nodeVO.getItm()); | |
275 | +// switch (nodeVO.getNode_type()) { | |
276 | +// case "DB_READ": | |
277 | +// jobData.setType("dbConnection"); | |
278 | +// break; | |
279 | +// case "API_READ": | |
280 | +// jobData.setType("apiRead"); | |
281 | +// break; | |
282 | +// case "FILE_READ": | |
283 | +// jobData.setType("fileRead"); | |
284 | +// break; | |
285 | +// case "DATASET_READ": | |
286 | +// jobData.setType("datasetRead"); | |
287 | +// break; | |
288 | +// case "DATASET_UPDATE": | |
289 | +// jobData.setType("datasetWrite"); | |
290 | +// break; | |
291 | +// case "DATA_FILTER": | |
292 | +// jobData.setType("filter"); | |
293 | +// break; | |
294 | +// case "EHOJO_READ": | |
295 | +// jobData.setType("ehojoRead"); | |
296 | +// break; | |
297 | +// } | |
298 | +// jobItmList.add(jobData); | |
299 | +// } | |
300 | +// jobGroup.setJobItm(jobItmList); | |
301 | +// | |
302 | +// try { | |
303 | +// CustomeResultMap customeResultMap = jobService.insertJobGroup(jobGroup); | |
304 | +// userId = CommonUtil.getLoginUserId(); | |
305 | +// group_id = customeResultMap.getResultData().get("group_id").toString(); | |
306 | +// } catch (Exception e) { | |
307 | +// e.printStackTrace(); | |
308 | +// throw e; | |
309 | +// } | |
310 | +// | |
311 | +// if(StringUtil.isEmpty(scheduleVO.getSchdulId())) { | |
312 | +// scheduleVO.setSchdulId(CommonUtil.getRandKey("SCHEDULE")); | |
313 | +// scheduleVO.setCreatId(userId); | |
314 | +// } else { | |
315 | +// scheduleVO.setUpdtId(userId); | |
316 | +// } | |
317 | +// scheduleVO.setGroupId(group_id); | |
318 | +// result += scheduleDAO.insertSchedule(scheduleVO); | |
319 | +// | |
320 | +// diagramVO.setDiagram_id(group_id); | |
321 | +// diagramVO.setCreat_id(userId); | |
322 | +// result += diagramDAO.diagramDataInsert(diagramVO); | |
323 | +// | |
324 | +// for (NodeVO nodeVO : nodes) { | |
325 | +// nodeVO.setDiagram_id(group_id); | |
326 | +// nodeVO.setNode_id(nodeVO.getId()); | |
327 | +// nodeVO.setNode_state("wait"); | |
328 | +// nodeVO.setLog_message("is not Running"); | |
329 | +// result += diagramDAO.nodeDataInsert(nodeVO); | |
330 | +// } | |
331 | +// | |
332 | +// for (EdgeVO edge : edges) { | |
333 | +// edge.setDiagram_id(group_id); | |
334 | +// result += diagramDAO.lineDataInsert(edge); | |
335 | +// } | |
336 | +// | |
337 | +// String logId = CommonUtil.getRandKey("LOGID"); | |
338 | +// ScheduleLogVO scheduleLogVO = new ScheduleLogVO(); | |
339 | +// scheduleLogVO.setLog_id(logId); | |
340 | +// scheduleLogVO.setTotal_node_count(nodes.size()); | |
341 | +// scheduleLogVO.setFail_node_count(0); | |
342 | +// scheduleLogVO.setFail_node_name("N"); | |
343 | +// scheduleLogVO.setState_info("success"); | |
344 | +// scheduleLogVO.setDiagram_id(group_id); | |
345 | +// scheduleLogVO.setUser_id(userId); | |
346 | +// diagramDAO.logDataInsert(scheduleLogVO); | |
347 | +// | |
348 | +// ScheduleLogDetailVO scheduleLogDetailVO = new ScheduleLogDetailVO(); | |
349 | +// List<NodeVO> nodeList = diagramDAO.nodeList(group_id); | |
350 | +// for (NodeVO nodeVO : nodeList) { | |
351 | +// String detailLogId = CommonUtil.getRandKey("DETAILLOGID"); | |
352 | +// scheduleLogDetailVO.setDetail_log_id(detailLogId); | |
353 | +// scheduleLogDetailVO.setNode_name(nodeVO.getNode_name()); | |
354 | +// scheduleLogDetailVO.setLog_id(logId); | |
355 | +// scheduleLogDetailVO.setLog_category("-"); | |
356 | +// scheduleLogDetailVO.setLog_message("등록"); | |
357 | +// scheduleLogDetailVO.setOperation_date(scheduleLogVO.getOperation_date()); | |
358 | +// diagramDAO.logDetailDataInsert(scheduleLogDetailVO); | |
359 | +// } | |
360 | +// return result; | |
361 | +// } | |
362 | +// | |
363 | +// /* 다이어그램 수정 */ | |
364 | +// @Transactional(rollbackFor = Exception.class) | |
365 | +// public int dataEdit(DiagramDetailDTO diagramDetailDTO) throws Exception { | |
366 | +// int result =0; | |
367 | +// | |
368 | +// // params 데이터 분리 | |
369 | +// ScheduleVO scheduleVO = diagramDetailDTO.getScheduleVO(); | |
370 | +// DiagramVO diagramVO = diagramDetailDTO.getDiagram(); | |
371 | +// // schedule 데이터 분리 | |
372 | +// JobGroup jobGroup = scheduleVO.getJobGroup(); | |
373 | +// // diagram 데이터 분리 | |
374 | +// List<NodeVO> nodes = diagramVO.getNodes(); | |
375 | +// // 첫 번째 노드에서 다이어그램 id 가져오기 | |
376 | +// // 프론트에서 노드 정보가 전달 되어야 수정 버튼이 동작하기 때문에 해당 위치에 반드시 있음 | |
377 | +// String diagramId = scheduleVO.getGroupId(); | |
378 | +// | |
379 | +// // diagramId로 노드와 엣지 정보 일괄 삭제 | |
380 | +// diagramDAO.nodeDelete(diagramId); | |
381 | +// diagramDAO.edgeDelete(diagramId); | |
382 | +// | |
383 | +// // 로그 삭제 | |
384 | +// HashMap<String,Object> logParams = new HashMap<>(); | |
385 | +// logParams.put("diagram_id", diagramId); | |
386 | +// List<ScheduleLogVO> logList = diagramDAO.logSelectListAllID(logParams); | |
387 | +// for (ScheduleLogVO scheduleLogVO : logList) { | |
388 | +// result += diagramDAO.logDetailDelete(scheduleLogVO.getLog_id()); | |
389 | +// } | |
390 | +// result += diagramDAO.logDelete(diagramId); | |
391 | +// | |
392 | +// // 다이어그램 삭제 | |
393 | +// diagramDAO.diagramDelete(diagramId); | |
394 | +// | |
395 | +// // 스케줄 삭제 | |
396 | +// result += scheduleDAO.insertSchedule(scheduleVO); | |
397 | +// | |
398 | +// // jobItem 삭제 | |
399 | +// for (NodeVO nodeVO : nodes) { | |
400 | +// String itmId = null; | |
401 | +// switch (nodeVO.getNode_type()) { | |
402 | +// case "DB_READ": | |
403 | +// itmId = jobDAO.selectIdJobItemDbId(diagramId); | |
404 | +// dataDAO.deleteConnectionDb(itmId); | |
405 | +// break; | |
406 | +// case "API_READ": | |
407 | +// itmId = jobDAO.selectIdJobItemApiId(diagramId); | |
408 | +// connectionApiDAO.deleteApiParameterInfo(itmId); | |
409 | +// connectionApiDAO.deleteApiConnectionInfo(itmId); | |
410 | +// break; | |
411 | +// case "FILE_READ": | |
412 | +// jobDAO.deleteFileReadItm(diagramId); | |
413 | +// break; | |
414 | +// case "DATASET_UPDATE": | |
415 | +// jobDAO.deleteDatasetItem(diagramId); | |
416 | +// break; | |
417 | +// case "DATA_FILTER": | |
418 | +// jobDAO.deleteFilterItem(diagramId); | |
419 | +// break; | |
420 | +// case "EHOJO_READ": | |
421 | +// String ehpInfoId = jobDAO.selectIdJobItemEhpId(diagramId); | |
422 | +// connectEhojoPlusService.deleteEhojoPlusInfo(ehpInfoId); | |
423 | +// break; | |
424 | +// } | |
425 | +// } | |
426 | +// jobDAO.jobItemDeleteId(diagramId); | |
427 | +// | |
428 | +// // jobGroup 삭제 | |
429 | +// jobDAO.jobGroupDelete(jobGroup); | |
430 | +// | |
431 | +// // 다이어그램 등록 | |
432 | +// dataInsert(diagramDetailDTO); | |
433 | +// | |
434 | +// return result; | |
435 | +// } | |
436 | +// | |
437 | +// /** | |
438 | +// * @author 하관우 | |
439 | +// * @since 2024.02.15 | |
440 | +// * | |
441 | +// * diagram_id를 가져와서 해당하는것들 삭제 | |
442 | +// */ | |
443 | +// @Transactional(rollbackFor = Exception.class) | |
444 | +// public int dataDelete(List<ScheduleVO> scheduleVOList) throws Exception { | |
445 | +// int result = 0; | |
446 | +// for (ScheduleVO scheduleVO : scheduleVOList) { | |
447 | +// String diagramId = scheduleVO.getGroupId(); | |
448 | +// result += diagramDAO.edgeDelete(diagramId); | |
449 | +// result += diagramDAO.nodeDelete(diagramId); | |
450 | +// | |
451 | +// HashMap<String,Object> logParams = new HashMap<>(); | |
452 | +// logParams.put("diagram_id", diagramId); | |
453 | +// List<ScheduleLogVO> logList = diagramDAO.logSelectListAllID(logParams); | |
454 | +// for (ScheduleLogVO scheduleLogVO : logList) { | |
455 | +// result += diagramDAO.logDetailDelete(scheduleLogVO.getLog_id()); | |
456 | +// } | |
457 | +// result += diagramDAO.logDelete(diagramId); | |
458 | +// result += diagramDAO.diagramDelete(diagramId); | |
459 | +// | |
460 | +// scheduleVO.setUseAt(false); | |
461 | +// result += scheduleDAO.insertSchedule(scheduleVO); | |
462 | +// } | |
463 | +// return result; | |
464 | +// } | |
465 | +// | |
466 | +// //로그 인서트 | |
467 | +// public String diagramLog(ScheduleLogVO logData)throws Exception{ | |
468 | +// int result =0; | |
469 | +// | |
470 | +// logData.setLog_id(CommonUtil.getRandKey("LOGID")); | |
471 | +// result += diagramDAO.logDataInsert(logData); | |
472 | +// | |
473 | +// return logData.getLog_id(); | |
474 | +// } | |
475 | +// | |
476 | +// //로그 업데이트 | |
477 | +// public int diagramLogUP(ScheduleLogVO logData)throws Exception{ | |
478 | +// int result =0; | |
479 | +// //로그 인서트 | |
480 | +// result += diagramDAO.logDataUpdate(logData); | |
481 | +// | |
482 | +// return result; | |
483 | +// } | |
484 | +// | |
485 | +// //로그 상세 인서트 | |
486 | +// public int dirgramDetailLog(ScheduleLogDetailVO logDetailData)throws Exception{ | |
487 | +// logDetailData.setDetail_log_id(CommonUtil.getRandKey("DETAILLOGID")); | |
488 | +// return diagramDAO.logDetailDataInsert(logDetailData); | |
489 | +// } | |
490 | +// | |
491 | +// /** | |
492 | +// * @author 박정하 | |
493 | +// * @since 2024.09.07 | |
494 | +// * | |
495 | +// * 즉시계산 | |
496 | +// */ | |
497 | +// public List<HashMap<String, Object>> operatorNow(DiagramVO diagramVO, String type) throws Exception { | |
498 | +// // params 데이터 분리 | |
499 | +// List<NodeVO> nodes = diagramVO.getNodes(); | |
500 | +// List<EdgeVO> edges = diagramVO.getEdges(); | |
501 | +// | |
502 | +// // 유저 정보 가져오기 | |
503 | +// String userId = null; | |
504 | +// if (type.equals("create")) { | |
505 | +// userId = CommonUtil.getLoginUserId(); | |
506 | +// } else { | |
507 | +// userId = "admin"; | |
508 | +// } | |
509 | +// | |
510 | +// // 로그 생성 | |
511 | +// ScheduleLogVO scheduleLogVO = new ScheduleLogVO(); | |
512 | +// scheduleLogVO.setDiagram_id(diagramVO.getDiagram_id()); | |
513 | +// scheduleLogVO.setUser_id(userId); | |
514 | +// scheduleLogVO.setTotal_node_count(nodes.size()); | |
515 | +// scheduleLogVO.setFail_node_count(0); | |
516 | +// scheduleLogVO.setState_info("success"); | |
517 | +// String logId = diagramLog(scheduleLogVO); | |
518 | +// | |
519 | +// // 노드 순서대로 정렬 | |
520 | +// nodeListByOrder = new ArrayList<>(); | |
521 | +// for (NodeVO nodeVO : nodes) { | |
522 | +// if (nodeVO.getNode_type().equals("DATASET_UPDATE")) { | |
523 | +// String endNodeId = nodeVO.getId(); | |
524 | +// nodeListByOrder.add(nodeVO); | |
525 | +// findPrevNode(nodes, edges, endNodeId); | |
526 | +// break; // endNode는 1개만 존재할 수 있음 (프론트에서 검증 후 등록됨) | |
527 | +// } | |
528 | +// } | |
529 | +// | |
530 | +// List<HashMap<String, Object>> resultNodeList = new ArrayList<>(); | |
531 | +// int failNodeCount = 0; | |
532 | +// String failNodeName = null; | |
533 | +// for (int i = 0; i < nodeListByOrder.size(); i++) { | |
534 | +// NodeVO node = nodeListByOrder.get(i); | |
535 | +// | |
536 | +// // 로그 디테일 등록 | |
537 | +// ScheduleLogDetailVO scheduleLogDetailVO = new ScheduleLogDetailVO(); | |
538 | +// scheduleLogDetailVO.setNode_name(node.getNode_name()); | |
539 | +// scheduleLogDetailVO.setLog_id(logId); | |
540 | +// scheduleLogDetailVO.setLog_category("success"); | |
541 | +// scheduleLogDetailVO.setLog_message(null); | |
542 | +// scheduleLogDetailVO.setCreat_id(userId); | |
543 | +// Timestamp operationDate = new Timestamp(System.currentTimeMillis()); | |
544 | +// scheduleLogDetailVO.setOperation_date(operationDate); | |
545 | +// | |
546 | +// // 노드 실행 | |
547 | +// try { | |
548 | +// nodeCalculation(node); | |
549 | +// } catch (Exception e) { | |
550 | +// failNodeCount++; | |
551 | +// scheduleLogDetailVO.setLog_category("fail"); | |
552 | +// scheduleLogDetailVO.setLog_message(e.getMessage()); | |
553 | +// } | |
554 | +// | |
555 | +// // 로그 디테일 수정 | |
556 | +// dirgramDetailLog(scheduleLogDetailVO); | |
557 | +// | |
558 | +// scheduleLogVO.setFail_node_count(failNodeCount); | |
559 | +// if (failNodeCount > 0) { | |
560 | +// failNodeName = node.getNode_name(); | |
561 | +// scheduleLogVO.setFail_node_name(failNodeName); | |
562 | +// } | |
563 | +// } | |
564 | +// | |
565 | +// // 반환값 | |
566 | +// return resultNodeList; | |
567 | +// } | |
568 | +// | |
569 | +// /** | |
570 | +// * @author 박정하 | |
571 | +// * @since 2024.09.07 | |
572 | +// * | |
573 | +// * 노드 설정 값에 따라 노드 실행 | |
574 | +// */ | |
575 | +// private NodeVO nodeCalculation(NodeVO node) throws Exception { | |
576 | +// DataTable resultDataTable = new DataTable(); | |
577 | +// JobItm resultJobItm = new JobItm(); | |
578 | +// | |
579 | +// NodeVO prevNode; | |
580 | +// List<ColumnData> columnDatas; | |
581 | +// List<List<Object>> rowData; | |
582 | +// ObjectMapper objectMapper = new ObjectMapper(); | |
583 | +// String itmToString; | |
584 | +// | |
585 | +// String nodeType = node.getNode_type(); | |
586 | +// switch (nodeType) { | |
587 | +// // DB_READ, FILE_READ, API_READ는 선행 노드와 관계 없이 실행 | |
588 | +// case "DB_READ": | |
589 | +// itmToString = objectMapper.writeValueAsString(node.getItm()); | |
590 | +// ConnectionDB connectionDB = objectMapper.readValue(itmToString, ConnectionDB.class); | |
591 | +// connectionDB.decodingData(); | |
592 | +// | |
593 | +// resultJobItm.setItm(connectionDB); | |
594 | +// node.setItm(connectionDB); | |
595 | +// | |
596 | +// DataTable resultTable = JobUtil.dbConnectionExec(resultJobItm); | |
597 | +// node.setDataTable(resultTable); | |
598 | +// break; | |
599 | +// case "API_READ": | |
600 | +// itmToString = objectMapper.writeValueAsString(node.getItm()); | |
601 | +// ConnectionApi connectionApi = objectMapper.readValue(itmToString, ConnectionApi.class); | |
602 | +// DataTable dataTable = connectionApiService.apiRequest(connectionApi); | |
603 | +// node.setDataTable(dataTable); | |
604 | +// break; | |
605 | +// case "FILE_READ": | |
606 | +// DataTable dataTableMap = node.getDataTable(); | |
607 | +// List<ColumnData> columnDatasMapList = dataTableMap.getColumnDatas(); | |
608 | +// resultDataTable.setColumnDatas(columnDatasMapList); | |
609 | +// rowData = dataTableMap.getRowData(); | |
610 | +// resultDataTable.setRowData(rowData); | |
611 | +// resultJobItm.setDataTable(resultDataTable); | |
612 | +// node.setDataTable(resultDataTable); | |
613 | +// node.setItm(resultJobItm); | |
614 | +// // DATA_FILTER는 선행 노드의 결과 값을 가져와서 실행 | |
615 | +// case "DATA_FILTER": | |
616 | +// for (int i = 0; i < nodeListByOrder.size(); i++) { | |
617 | +// if (nodeListByOrder.get(i).getId().equals(node.getId())) { | |
618 | +// prevNode = nodeListByOrder.get(i - 1); | |
619 | +// node.setDataTable(prevNode.getDataTable()); | |
620 | +// break; | |
621 | +// } | |
622 | +// } | |
623 | +// node = filterService.runFilter(node); | |
624 | +// break; | |
625 | +// // DATASET_UPDATE는 선행 노드의 결과 값을 가져와서 실행 | |
626 | +// case "DATASET_UPDATE": | |
627 | +// prevNode = nodeListByOrder.get(nodeListByOrder.size() - 2); // dataset_update가 가장 마지막에 실행됨(순서보장) | |
628 | +// rowData = prevNode.getDataTable().getRowData(); // 넣을 데이터 | |
629 | +// | |
630 | +// JobItemGroup itm = objectMapper.readValue(objectMapper.writeValueAsString(node.getItm()), JobItemGroup.class); | |
631 | +// String datasetPostId = itm.getItem(); | |
632 | +// | |
633 | +// List<List<Object>> insertData = new ArrayList<>(); | |
634 | +// List<List<Object>> changeData = new ArrayList<>(); | |
635 | +// List<List<Object>> deleteData = new ArrayList<>(); | |
636 | +// | |
637 | +// List<Object> matchList = itm.getItemList(); // 매칭 결과 | |
638 | +// for (List<Object> row : rowData) { // rowData 크기 만큼 실행 | |
639 | +// List<Object> newData = new ArrayList<>(); | |
640 | +// | |
641 | +// for (Object match : matchList) { // matchList 크기 만큼 실행(ts_row 제외한 컬럼 수 만큼 실행) | |
642 | +// HashMap<String, Object> item = (HashMap<String, Object>) match; | |
643 | +// | |
644 | +// if (item.get("targetColumnNm") != null) { | |
645 | +// String sourceColumnNm = item.get("targetColumnNm").toString(); | |
646 | +// Integer sourceIdx = Integer.valueOf(sourceColumnNm.substring(0, sourceColumnNm.indexOf("/"))); | |
647 | +// newData.add(row.get(sourceIdx)); | |
648 | +// } else { | |
649 | +// newData.add(null); | |
650 | +// } | |
651 | +// } | |
652 | +// | |
653 | +// if (node.isItm_option_bool()) { | |
654 | +// insertData.add(newData); | |
655 | +// } else { | |
656 | +// changeData.add(newData); | |
657 | +// } | |
658 | +// } | |
659 | +// | |
660 | +// dataService.datasetRowDataUpdate(datasetPostId, changeData, deleteData, insertData, "admin"); | |
661 | +// break; | |
662 | +// } | |
663 | +// return node; | |
664 | +// } | |
665 | +// | |
666 | +// /** | |
667 | +// * @author 박정하 | |
668 | +// * @since 2024.10.04 | |
669 | +// * | |
670 | +// * Diagram 목록 조회 | |
671 | +// */ | |
672 | +// @Override | |
673 | +// public CustomeResultMap diagramListRead(@RequestBody SearchVO searchVO) throws Exception { | |
674 | +// CustomeResultMap result = new CustomeResultMap(); | |
675 | +// | |
676 | +// int totalRows = diagramDAO.diagramListCountRead(searchVO); | |
677 | +// searchVO.setTotalRows(totalRows); | |
678 | +// result.getResultData().put("searchVO", searchVO); | |
679 | +// | |
680 | +// List<DiagramListDTO> diagramList = diagramDAO.diagramListRead(searchVO); | |
681 | +// result.getResultData().put("diagramList", diagramList); | |
682 | +// return result; | |
683 | +// } | |
684 | +// | |
685 | +// /** | |
686 | +// * @author 박정하 | |
687 | +// * @since 2024.10.04 | |
688 | +// * | |
689 | +// * Diagram 상세 조회 | |
690 | +// */ | |
691 | +// @Override | |
692 | +// public CustomeResultMap diagramDetailRead(String diagramId) throws Exception { | |
693 | +// CustomeResultMap result = new CustomeResultMap(); | |
694 | +// | |
695 | +// // 스케줄 상세 조회 | |
696 | +// String scheduleId = scheduleDAO.selectScheduleIdRead(diagramId); | |
697 | +// ScheduleVO scheduleVO = scheduleDAO.selectSchedule(scheduleId); | |
698 | +// scheduleVO.setJobGroup(jobService.selectJobGroup(diagramId)); | |
699 | +// | |
700 | +// // 다이어그램 상세 조회 | |
701 | +// DiagramVO diagramVO = diagramDAO.diagramDetailRead(diagramId); // nodes, edges 조회 안 됨 | |
702 | +// | |
703 | +// // edges 조회 | |
704 | +// List<EdgeVO> edges = diagramDAO.lineList(diagramId); | |
705 | +// diagramVO.setEdges(edges); // diagramVO에 엣지 목록 추가 | |
706 | +// | |
707 | +// // nodes 조회 | |
708 | +// List<NodeVO> nodes = diagramDAO.nodeList(diagramId); | |
709 | +// // 노드 순서대로 정렬 | |
710 | +// nodeListByOrder = new ArrayList<>(); | |
711 | +// for (NodeVO nodeVO : nodes) { | |
712 | +// nodeVO.setNode_id(nodeVO.getId()); | |
713 | +// | |
714 | +// NodePosition position = new NodePosition(); | |
715 | +// position.setX(nodeVO.getCenter_x()); | |
716 | +// position.setY(nodeVO.getCenter_y()); | |
717 | +// nodeVO.setPosition(position); | |
718 | +// | |
719 | +// if (nodeVO.getNode_type().equals("DATASET_UPDATE")) { | |
720 | +// String endNodeId = nodeVO.getId(); | |
721 | +// nodeListByOrder.add(nodeVO); | |
722 | +// findPrevNode(nodes, edges, endNodeId); | |
723 | +// break; // endNode는 1개만 존재할 수 있음 (프론트에서 검증 후 등록됨) | |
724 | +// } | |
725 | +// } | |
726 | +// | |
727 | +// // JobGroup 생성 | |
728 | +// JobGroup jobGroup = new JobGroup(); | |
729 | +// jobGroup.setGroup_id(diagramId); | |
730 | +// List<JobItm> jobItmList = jobDAO.selectJobItem(jobGroup); | |
731 | +// jobGroup.setJobItm(jobItmList); | |
732 | +// // 노드 형식 변경 | |
733 | +// for (int i = 0; i < jobItmList.size(); i++) { | |
734 | +// int order = i + 1; | |
735 | +// for (JobItm jobItm : jobItmList) { | |
736 | +// if (jobItm.getIndx() == order) { | |
737 | +// for (NodeVO nodeVO : nodes) { | |
738 | +// String nodeId = nodeListByOrder.get(i).getId(); // 다이어그램 등록시 순서대로 정렬하여 실행 순서 보장됨 | |
739 | +// if (nodeVO.getId().equals(nodeId)) { | |
740 | +// nodeVO = runJobItm(jobItm, diagramId, nodeVO, nodes); | |
741 | +// break; | |
742 | +// } | |
743 | +// } | |
744 | +// } | |
745 | +// } | |
746 | +// } | |
747 | +// diagramVO.setNodes(nodes); // diagramVO에 노드 목록 추가 | |
748 | +// | |
749 | +// DiagramDetailDTO diagramDetailDTO = new DiagramDetailDTO(); | |
750 | +// diagramDetailDTO.setScheduleVO(scheduleVO); | |
751 | +// diagramDetailDTO.setDiagram(diagramVO); | |
752 | +// | |
753 | +// result.getResultData().put("diagramDetailDTO", diagramDetailDTO); | |
754 | +// return result; | |
755 | +// } | |
756 | +// | |
757 | +// /** | |
758 | +// * @author 박정하 | |
759 | +// * @since 2024.10.04 | |
760 | +// * | |
761 | +// * Diagram Id로 Schedule 구하기 | |
762 | +// */ | |
763 | +// private ScheduleVO selectScheduleIdRead(String diagramId) throws Exception { | |
764 | +// String scheduleId = scheduleDAO.selectScheduleIdRead(diagramId); | |
765 | +// return scheduleDAO.selectSchedule(scheduleId); | |
766 | +// } | |
767 | +// | |
768 | +// /** | |
769 | +// * @author 박정하 | |
770 | +// * @since 2024.09.24 | |
771 | +// * | |
772 | +// * 엣지로 노드 실행 순서대로 정렬 | |
773 | +// */ | |
774 | +// private void findPrevNode(List<NodeVO> nodes, List<EdgeVO> edges, String nodeId) { | |
775 | +// for (EdgeVO edge : edges) { | |
776 | +// String sourceNodeId = edge.getSource(); // 엣지 기준 왼쪽 노드 | |
777 | +// String targetNodeId = edge.getTarget(); // 엣지 기준 오른쪽 노드 | |
778 | +// if (targetNodeId.equals(nodeId)) { | |
779 | +// for (NodeVO node : nodes) { | |
780 | +// if (node.getId().equals(sourceNodeId)) { | |
781 | +// nodeListByOrder.add(0, node); | |
782 | +// findPrevNode(nodes, edges, node.getId()); | |
783 | +// } | |
784 | +// } | |
785 | +// } | |
786 | +// } | |
787 | +// } | |
788 | +}(파일 끝에 줄바꿈 문자 없음) |
+++ src/main/java/com/takensoft/taken_bi_manager/schedule/service/impl/FilterServiceImpl.java
... | ... | @@ -0,0 +1,35 @@ |
1 | +package com.takensoft.taken_bi_manager.schedule.service.impl; | |
2 | + | |
3 | +import com.takensoft.taken_bi_manager.data.vo.DataTable; | |
4 | +import com.takensoft.taken_bi_manager.schedule.dto.NodeDTO; | |
5 | +import com.takensoft.taken_bi_manager.schedule.service.FilterService; | |
6 | +import com.takensoft.taken_bi_manager.jobs.util.DataFilterUtil; | |
7 | +import com.takensoft.taken_bi_manager.jobs.vo.JobItm; | |
8 | +import lombok.RequiredArgsConstructor; | |
9 | +import org.springframework.stereotype.Service; | |
10 | + | |
11 | +/** | |
12 | + * @author : 박정하 | |
13 | + * @since : 2024.09.25 | |
14 | + * 필터 관련 구현체 | |
15 | + */ | |
16 | +@Service("filterService") | |
17 | +@RequiredArgsConstructor | |
18 | +public class FilterServiceImpl implements FilterService { | |
19 | + /** | |
20 | + * @author : 박정하 | |
21 | + * @since : 2024.09.25 | |
22 | + * 필터 실행 | |
23 | + * use: NodeVO | |
24 | + */ | |
25 | + @Override | |
26 | + public NodeDTO runFilter(NodeDTO nodeVO) throws Exception { | |
27 | + JobItm jobItm = new JobItm(); | |
28 | +// jobItm.setItm(nodeVO.getItm()); | |
29 | +// jobItm.setDataTable(nodeVO.getDataTable()); | |
30 | +// | |
31 | +// DataTable dataTable = DataFilterUtil.FilterExcute(jobItm); // 필터 실행 | |
32 | +// nodeVO.setDataTable(dataTable); | |
33 | + return nodeVO; | |
34 | + } | |
35 | +}(파일 끝에 줄바꿈 문자 없음) |
+++ src/main/java/com/takensoft/taken_bi_manager/schedule/service/impl/ScheduleServiceImpl.java
... | ... | @@ -0,0 +1,106 @@ |
1 | +package com.takensoft.taken_bi_manager.schedule.service.impl; | |
2 | + | |
3 | +import com.takensoft.taken_bi_manager.schedule.dao.ScheduleDAO; | |
4 | +import com.takensoft.taken_bi_manager.schedule.service.ScheduleService; | |
5 | +import com.takensoft.taken_bi_manager.schedule.vo.ScheduleVO; | |
6 | +import com.takensoft.taken_bi_manager.common.util.CommonUtil; | |
7 | +import com.takensoft.taken_bi_manager.common.util.StringUtil; | |
8 | +import com.takensoft.taken_bi_manager.common.vo.CustomeResultMap; | |
9 | +import com.takensoft.taken_bi_manager.common.vo.SearchVO; | |
10 | +import com.takensoft.taken_bi_manager.jobs.service.JobService; | |
11 | +import org.springframework.beans.factory.annotation.Autowired; | |
12 | +import org.springframework.stereotype.Service; | |
13 | + | |
14 | +import java.util.HashMap; | |
15 | + | |
16 | +@Service | |
17 | +public class ScheduleServiceImpl implements ScheduleService { | |
18 | + @Autowired | |
19 | + private ScheduleDAO scheduleDAO; | |
20 | + | |
21 | + @Autowired | |
22 | + private JobService jobService; | |
23 | + | |
24 | + /** | |
25 | + * @author 박정하 | |
26 | + * @since 2025.01.16 | |
27 | + * | |
28 | + * 스케줄 목록 조회 | |
29 | + */ | |
30 | + public HashMap<String, Object> selectScheduleList(SearchVO searchVO) throws Exception { | |
31 | + // 전체 개수 조회 후 searchVO 수정 | |
32 | + int totalRows = scheduleDAO.selectScheduleCount(searchVO); | |
33 | + searchVO.setTotalRows(totalRows); | |
34 | + | |
35 | + HashMap<String, Object> result = new HashMap<>(); | |
36 | + result.put("list", scheduleDAO.selectScheduleList(searchVO)); | |
37 | + result.put("searchVO", searchVO); | |
38 | + return result; | |
39 | + } | |
40 | + | |
41 | + /* | |
42 | + * 스케줄 등록 | |
43 | + */ | |
44 | + @Override | |
45 | + public HashMap<String, Object> insertSchedule(ScheduleVO scheduleVO) throws Exception { | |
46 | + // 스케줄 ID, 작성자 혹은 수정자 ID 추가 및 수정 | |
47 | + if (StringUtil.isEmpty(scheduleVO.getSchdulId())){ | |
48 | + scheduleVO.setSchdulId(CommonUtil.getRandKey("SCHEDULE")); | |
49 | + scheduleVO.setCreatId(CommonUtil.getLoginUserId()); | |
50 | + } else { | |
51 | + scheduleVO.setUpdtId(CommonUtil.getLoginUserId()); | |
52 | + } | |
53 | + | |
54 | + // 스케줄 그룹 ID 추가 | |
55 | + String group_id = jobService.insertJobGroup(scheduleVO.getJobGroup()).getResultData().get("group_id").toString(); | |
56 | + scheduleVO.setGroupId(group_id); | |
57 | + | |
58 | + int insertCnt = scheduleDAO.insertSchedule(scheduleVO); | |
59 | + if (insertCnt < 1) { | |
60 | + throw new RuntimeException("작업 진행 중 오류가 발생했습니다."); | |
61 | + } | |
62 | + | |
63 | + HashMap<String, Object> result = new HashMap<>(); | |
64 | + result.put("insertCnt", insertCnt); | |
65 | + return result; | |
66 | + } | |
67 | + | |
68 | + /* | |
69 | + * 스케줄 상세 조회 | |
70 | + */ | |
71 | + @Override | |
72 | + public ScheduleVO selectSchedule(ScheduleVO scheduleVO) throws Exception { | |
73 | + ScheduleVO sc = scheduleDAO.selectSchedule(scheduleVO.getSchdulId()); | |
74 | + sc.setJobGroup(jobService.selectJobGroup(sc.getGroupId())); | |
75 | + return sc; | |
76 | + } | |
77 | + | |
78 | + /** | |
79 | + * @author 박정하 | |
80 | + * @since 2024.10.04 | |
81 | + * | |
82 | + * 스케줄 정보 삭제 | |
83 | + */ | |
84 | + @Override | |
85 | + public CustomeResultMap deleteSchedule(String schdulId) throws Exception { | |
86 | + CustomeResultMap result = new CustomeResultMap(); | |
87 | + result.getResultData().put("updateResult", scheduleDAO.deleteSchedule(schdulId)); | |
88 | + return result; | |
89 | + } | |
90 | + | |
91 | + /** | |
92 | + * @author 박정하 | |
93 | + * @since 2024.10.04 | |
94 | + * | |
95 | + * 스케줄 상태 변경 | |
96 | + */ | |
97 | + @Override | |
98 | + public CustomeResultMap scheduleSttusChange(String schdulId, String schdulSttus) throws Exception { | |
99 | + CustomeResultMap result = new CustomeResultMap(); | |
100 | + HashMap<String, Object> params = new HashMap<>(); | |
101 | + params.put("schdulId", schdulId); | |
102 | + params.put("schdulSttus", schdulSttus); | |
103 | + result.getResultData().put("updateResult", scheduleDAO.scheduleSttusChange(params)); | |
104 | + return result; | |
105 | + } | |
106 | +}(파일 끝에 줄바꿈 문자 없음) |
+++ src/main/java/com/takensoft/taken_bi_manager/schedule/vo/DiagramVO.java
... | ... | @@ -0,0 +1,22 @@ |
1 | +package com.takensoft.taken_bi_manager.schedule.vo; | |
2 | + | |
3 | +import com.takensoft.taken_bi_manager.schedule.dto.NodeDTO; | |
4 | +import lombok.Data; | |
5 | + | |
6 | +import java.util.ArrayList; | |
7 | +import java.util.List; | |
8 | + | |
9 | +@Data | |
10 | +public class DiagramVO { | |
11 | + // 스케줄 ID (KEY) | |
12 | + private String schdulId; | |
13 | + | |
14 | + // 스케줄 타입 (cmmn_code 테이블의 code_id와 동일) | |
15 | + private String schdulType; | |
16 | + | |
17 | + // 다이어그램 내 노드 목록 | |
18 | + private List<NodeDTO> nodes = new ArrayList<>(); | |
19 | + | |
20 | + // 다이어그램 내 엣지 목록 | |
21 | + private List<EdgeVO> edges = new ArrayList<>(); | |
22 | +}(파일 끝에 줄바꿈 문자 없음) |
+++ src/main/java/com/takensoft/taken_bi_manager/schedule/vo/EdgeVO.java
... | ... | @@ -0,0 +1,18 @@ |
1 | +package com.takensoft.taken_bi_manager.schedule.vo; | |
2 | + | |
3 | +import lombok.Data; | |
4 | + | |
5 | +@Data | |
6 | +public class EdgeVO { | |
7 | + // 스케줄 ID (KEY) | |
8 | + private String schdulId; | |
9 | + | |
10 | + // 엣지 ID (KEY) | |
11 | + private String edgeId; | |
12 | + | |
13 | + // 엣지의 시작 노드 | |
14 | + private String source; | |
15 | + | |
16 | + // 엣지의 끝 노드 | |
17 | + private String target; | |
18 | +}(파일 끝에 줄바꿈 문자 없음) |
+++ src/main/java/com/takensoft/taken_bi_manager/schedule/vo/NodeVO.java
... | ... | @@ -0,0 +1,24 @@ |
1 | +package com.takensoft.taken_bi_manager.schedule.vo; | |
2 | + | |
3 | +import lombok.Data; | |
4 | + | |
5 | +@Data | |
6 | +public class NodeVO { | |
7 | + // 스케줄 ID (KEY) | |
8 | + private String schdulId; | |
9 | + | |
10 | + // 노드 ID (KEY) | |
11 | + private String nodeId; | |
12 | + | |
13 | + // 노드 이름 | |
14 | + private String nodeLabel; | |
15 | + | |
16 | + // 노드 타입 (노트 템플릿용) | |
17 | + private String nodeType; | |
18 | + | |
19 | + // X 좌표 | |
20 | + private Double positionX; | |
21 | + | |
22 | + // Y 좌표 | |
23 | + private Double positionY; | |
24 | +}(파일 끝에 줄바꿈 문자 없음) |
+++ src/main/java/com/takensoft/taken_bi_manager/schedule/vo/ScheduleLogDetailVO.java
... | ... | @@ -0,0 +1,33 @@ |
1 | +package com.takensoft.taken_bi_manager.schedule.vo; | |
2 | + | |
3 | +import lombok.Data; | |
4 | + | |
5 | +import java.sql.Timestamp; | |
6 | + | |
7 | +@Data | |
8 | +public class ScheduleLogDetailVO { | |
9 | + // 시리얼 버전 | |
10 | + private static final long serialVersionUID = 1L; | |
11 | + | |
12 | + | |
13 | + // 스케줄 로그 ID (KEY) | |
14 | + private String schdulLogId; | |
15 | + | |
16 | + // 스케줄 로그 상세 ID (KEY) | |
17 | + private String detailLogId; | |
18 | + | |
19 | + // 작동 일시 | |
20 | + private Timestamp executDe; | |
21 | + | |
22 | + // 작동 완료 일시 | |
23 | + private Timestamp executComptDe; | |
24 | + | |
25 | + // 노드 ID | |
26 | + private String nodeId; | |
27 | + | |
28 | + // 스케줄 로그 상태 (TRUE: 성공, FALSE: 실패) | |
29 | + private String detailSttus; | |
30 | + | |
31 | + // 스케줄 로그 메세지 | |
32 | + private String detailMssage; | |
33 | +}(파일 끝에 줄바꿈 문자 없음) |
+++ src/main/java/com/takensoft/taken_bi_manager/schedule/vo/ScheduleLogVO.java
... | ... | @@ -0,0 +1,35 @@ |
1 | +package com.takensoft.taken_bi_manager.schedule.vo; | |
2 | + | |
3 | +import lombok.Data; | |
4 | + | |
5 | +import java.sql.Timestamp; | |
6 | + | |
7 | +@Data | |
8 | +public class ScheduleLogVO { | |
9 | + // 시리얼 버전 | |
10 | + private static final long serialVersionUID = 1L; | |
11 | + | |
12 | + | |
13 | + // 스케줄 ID (KEY) | |
14 | + private String schdulId; | |
15 | + | |
16 | + // 스케줄 로그 ID (KEY) | |
17 | + private String schdulLogId; | |
18 | + | |
19 | + // 작동 일시 | |
20 | + private Timestamp executDe; | |
21 | + | |
22 | + // 총 노드 수 | |
23 | + private int allNodeCo; | |
24 | + | |
25 | + // 실패 노드 수 | |
26 | + private int failrNodeCo; | |
27 | + | |
28 | + // 스케줄 상태 | |
29 | + private String schdulLogSttus; | |
30 | + | |
31 | + | |
32 | + /* 그 외 */ | |
33 | + // 실패 노드 이름 | |
34 | + private String failrNodeNm; | |
35 | +}(파일 끝에 줄바꿈 문자 없음) |
+++ src/main/java/com/takensoft/taken_bi_manager/schedule/vo/ScheduleVO.java
... | ... | @@ -0,0 +1,70 @@ |
1 | +package com.takensoft.taken_bi_manager.schedule.vo; | |
2 | + | |
3 | +import com.takensoft.taken_bi_manager.jobs.vo.JobGroup; | |
4 | +import lombok.Data; | |
5 | + | |
6 | +import java.io.Serializable; | |
7 | +import java.sql.Timestamp; | |
8 | +import java.util.*; | |
9 | + | |
10 | +@Data | |
11 | +public class ScheduleVO implements Serializable { | |
12 | + // 시리얼 버전 | |
13 | + private static final long serialVersionUID = 1L; | |
14 | + | |
15 | + | |
16 | + /* 스케줄 테이블 SCHDUL_INFO */ | |
17 | + // 스케줄 ID (KEY) | |
18 | + private String schdulId; | |
19 | + | |
20 | + // 스케줄 잡그룹 ID (KEY) | |
21 | + private String groupId; | |
22 | + | |
23 | + // 제목 | |
24 | + private String schdulSj; | |
25 | + | |
26 | + // 내용 | |
27 | + private String schdulCn; | |
28 | + | |
29 | + // 스케줄 타입 (cmmn_code 테이블의 code_id와 동일) | |
30 | + private String schdulType; | |
31 | + | |
32 | + // 시리얼 버전 | |
33 | + private String cron; | |
34 | + | |
35 | + // cron 스케줄링 한글 | |
36 | + private String cronChrctr; | |
37 | + | |
38 | + // 스케줄 상태 (TRUE: 실행 / FALSE: 중단) | |
39 | + private boolean schdulSttus = true; | |
40 | + | |
41 | + // 주기적인지 아닌지 여부 (TRUE: 주기적 / FALSE: 일시적) | |
42 | + private boolean cycleAt; | |
43 | + | |
44 | + // 사용여부 (TRUE: 사용 / FALSE: 미사용-삭제-) | |
45 | + private boolean useAt = true; | |
46 | + | |
47 | + // 등록자 | |
48 | + private String creatId; | |
49 | + | |
50 | + // 등록일 | |
51 | + private Timestamp creatDt; | |
52 | + | |
53 | + // 수정자 | |
54 | + private String updtId; | |
55 | + | |
56 | + // 수정일 | |
57 | + private Timestamp updtDt; | |
58 | + | |
59 | + | |
60 | + /* 프론트 vue flow 용 */ | |
61 | + // 다이어그램 | |
62 | + private DiagramVO diagram = new DiagramVO(); | |
63 | + | |
64 | + /* 그 외 */ | |
65 | + // 잡 그룹 | |
66 | + private JobGroup jobGroup = new JobGroup(); | |
67 | + | |
68 | + // 스케줄 로그 목록 | |
69 | + private List<ScheduleLogVO> schdulLogs = new ArrayList<>(); | |
70 | +}(파일 끝에 줄바꿈 문자 없음) |
+++ src/main/java/com/takensoft/taken_bi_manager/schedule/web/DiagramController.java
... | ... | @@ -0,0 +1,199 @@ |
1 | +package com.takensoft.taken_bi_manager.schedule.web; | |
2 | + | |
3 | +import com.takensoft.taken_bi_manager.common.vo.CheckMessage; | |
4 | +import com.takensoft.taken_bi_manager.schedule.dto.DiagramDTO; | |
5 | +import com.takensoft.taken_bi_manager.common.vo.CustomeResultMap; | |
6 | +import com.takensoft.taken_bi_manager.schedule.dao.DiagramDAO; | |
7 | +import com.takensoft.taken_bi_manager.schedule.service.Diagramservice; | |
8 | +import lombok.RequiredArgsConstructor; | |
9 | +import org.springframework.http.HttpStatus; | |
10 | +import org.springframework.web.bind.annotation.*; | |
11 | + | |
12 | +@RestController | |
13 | +@RequestMapping("/diagram") | |
14 | +@RequiredArgsConstructor | |
15 | +public class DiagramController { | |
16 | + private final Diagramservice diagramService; | |
17 | + private final DiagramDAO diagramDAO; | |
18 | + | |
19 | + /* | |
20 | + * @author 박정하 | |
21 | + * @since 2025.02.07 | |
22 | + * | |
23 | + * 현재 노드에 연결된 노드(target) 조회 | |
24 | + */ | |
25 | + @PostMapping (value ="/getNodesByNode.json") | |
26 | + public CustomeResultMap getNodesByNode(@RequestBody DiagramDTO diagramDTO) { | |
27 | + CustomeResultMap resultMap = new CustomeResultMap(); | |
28 | + | |
29 | + try { | |
30 | + resultMap.setResultData(diagramService.getNodesByNode(diagramDTO)); | |
31 | + } catch (RuntimeException e) { | |
32 | + resultMap.setCheckMessage(new CheckMessage(false, e.getMessage(), HttpStatus.BAD_REQUEST.value())); | |
33 | + } catch (Exception e) { | |
34 | + resultMap.setCheckMessage(new CheckMessage(false, e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR.value())); | |
35 | + } | |
36 | + | |
37 | + return resultMap; | |
38 | + } | |
39 | + | |
40 | +// /** | |
41 | +// * @author 하관우 | |
42 | +// * @since 2024.01.23 | |
43 | +// * | |
44 | +// * Diagram 조회 | |
45 | +// */ | |
46 | +// @RequestMapping(value ="/dataSelectListAll.json", method = RequestMethod.POST) | |
47 | +// public ModelAndView dataSelectListAll() throws Exception { | |
48 | +// ModelAndView mav = new ModelAndView("jsonView"); | |
49 | +// mav.addObject("result", diagramService.dataSelectListAll()); | |
50 | +// return mav; | |
51 | +// } | |
52 | +// | |
53 | +// /** | |
54 | +// * @author 하관우 | |
55 | +// * @since 2024.01.23 | |
56 | +// * | |
57 | +// * DIAGRAM_ID 해당하는 스케줄 관리 | |
58 | +// */ | |
59 | +// | |
60 | +// @RequestMapping(value ="/scheduleList.json", method = RequestMethod.POST) | |
61 | +// public ModelAndView scheduleList(@RequestBody HashMap<String,Object> params) throws Exception { | |
62 | +// | |
63 | +// ModelAndView mav = new ModelAndView("jsonView"); | |
64 | +// mav.addObject("result", diagramService.scheduleList(params)); | |
65 | +// return mav; | |
66 | +// } | |
67 | +// | |
68 | +// /** | |
69 | +// * @author 하관우 | |
70 | +// * @since 2024.01.23 | |
71 | +// * | |
72 | +// * 로그조회 조회 | |
73 | +// */ | |
74 | +// | |
75 | +// @RequestMapping(value ="/logSelectListAll.json", method = RequestMethod.POST) | |
76 | +// public ModelAndView logSelectListAll(@RequestBody SearchVO searchVO) throws Exception { | |
77 | +// ModelAndView mav = new ModelAndView("jsonView"); | |
78 | +// mav.addObject("result", diagramService.logSelectListAll(searchVO)); | |
79 | +// return mav; | |
80 | +// } | |
81 | +// | |
82 | +// | |
83 | +// /** | |
84 | +// * @author 하관우 | |
85 | +// * @since 2024.01.23 | |
86 | +// * | |
87 | +// * 로그 상세조회 조회 | |
88 | +// */ | |
89 | +// @RequestMapping(value ="/detaillogSelectListAll.json", method = RequestMethod.POST) | |
90 | +// public ModelAndView detaillogSelectListAll(@RequestBody SearchVO searchVO) throws Exception { | |
91 | +// | |
92 | +// ModelAndView mav = new ModelAndView("jsonView"); | |
93 | +// mav.addObject("result", diagramService.detaillogSelectListAll(searchVO)); | |
94 | +// return mav; | |
95 | +// } | |
96 | +// | |
97 | +// /** | |
98 | +// * @author 하관우 | |
99 | +// * @since 2024.01.23 | |
100 | +// * | |
101 | +// * node 조회 | |
102 | +// */ | |
103 | +// @RequestMapping(value ="/nodeList.json", method = RequestMethod.POST) | |
104 | +// public ModelAndView nodeList(@RequestBody HashMap<String,Object> params) throws Exception { | |
105 | +// ModelAndView mav = new ModelAndView("jsonView"); | |
106 | +// mav.addObject("result", diagramService.nodeList(params.get("diagram_id").toString())); | |
107 | +// return mav; | |
108 | +// } | |
109 | +// | |
110 | +// /** | |
111 | +// * @author 하관우 | |
112 | +// * @since 2024.01.23 | |
113 | +// * | |
114 | +// * line 조회 | |
115 | +// */ | |
116 | +// @RequestMapping(value ="/lineList.json", method = RequestMethod.POST) | |
117 | +// public ModelAndView lineList(@RequestBody HashMap<String,Object> params) throws Exception { | |
118 | +// | |
119 | +// ModelAndView mav = new ModelAndView("jsonView"); | |
120 | +// mav.addObject("result", diagramService.lineList(params.get("diagram_id").toString())); | |
121 | +// return mav; | |
122 | +// } | |
123 | +// | |
124 | +// /** | |
125 | +// * @author 권지용 | |
126 | +// * @since 2024.01.29 | |
127 | +// * | |
128 | +// * 다이어그램의 모든 정보 등록 | |
129 | +// */ | |
130 | +// | |
131 | +// @RequestMapping(value = "/dataInsert.json", method = RequestMethod.POST) | |
132 | +// public ModelAndView dataInsert(@RequestBody DiagramDetailDTO diagramDetailDTO) throws Exception { | |
133 | +// ModelAndView mav = new ModelAndView("jsonView"); | |
134 | +// mav.addObject("result", diagramService.dataInsert(diagramDetailDTO)); | |
135 | +// return mav; | |
136 | +// } | |
137 | +// | |
138 | +// /** | |
139 | +// * @author 하관우 | |
140 | +// * @since 2024.05.29 | |
141 | +// * | |
142 | +// * 다이어그램의 모든 수정 등록 | |
143 | +// */ | |
144 | +// | |
145 | +// @RequestMapping(value = "/dataEdit.json", method = RequestMethod.POST) | |
146 | +// public ModelAndView dataEdit(@RequestBody DiagramDetailDTO diagramDetailDTO) throws Exception { | |
147 | +// ModelAndView mav = new ModelAndView("jsonView"); | |
148 | +// mav.addObject("result", diagramService.dataEdit(diagramDetailDTO)); | |
149 | +// return mav; | |
150 | +// } | |
151 | +// | |
152 | +// /** | |
153 | +// * @author 하관우 | |
154 | +// * @since 2024.02.08 | |
155 | +// * | |
156 | +// * 즉시계산 | |
157 | +// */ | |
158 | +// @RequestMapping(value = "/operatorNow.json", method = RequestMethod.POST) | |
159 | +// public ModelAndView operatorNow(@RequestBody DiagramVO diagramVO) throws Exception { | |
160 | +// ModelAndView mav = new ModelAndView("jsonView"); | |
161 | +// mav.addObject("result", diagramService.operatorNow(diagramVO, "create")); | |
162 | +// return mav; | |
163 | +// } | |
164 | +// | |
165 | +// /** | |
166 | +// * @author 하관우 | |
167 | +// * @since 2024.02.15 | |
168 | +// * | |
169 | +// * diagram_id를 가져와서 해당하는것들 삭제 | |
170 | +// * */ | |
171 | +// @RequestMapping(value = "/dataDelete.json", method = RequestMethod.POST) | |
172 | +// public ModelAndView dataDelete(@RequestBody List<ScheduleVO> scheduleVOList) throws Exception { | |
173 | +// ModelAndView mav = new ModelAndView("jsonView"); | |
174 | +// mav.addObject("result", diagramService.dataDelete(scheduleVOList)); | |
175 | +// return mav; | |
176 | +// } | |
177 | +// | |
178 | +// /** | |
179 | +// * @author 박정하 | |
180 | +// * @since 2024.10.04 | |
181 | +// * | |
182 | +// * Diagram 목록 조회 | |
183 | +// */ | |
184 | +// @PostMapping(value="/diagramListRead") | |
185 | +// public CustomeResultMap diagramListRead(@RequestBody SearchVO searchVO) throws Exception { | |
186 | +// return diagramService.diagramListRead(searchVO); | |
187 | +// } | |
188 | +// | |
189 | +// /** | |
190 | +// * @author 박정하 | |
191 | +// * @since 2024.10.04 | |
192 | +// * | |
193 | +// * Diagram 상세 조회 | |
194 | +// */ | |
195 | +// @GetMapping(value="/diagramDetailRead/{diagramId}") | |
196 | +// public CustomeResultMap diagramDetailRead(@PathVariable String diagramId) throws Exception { | |
197 | +// return diagramService.diagramDetailRead(diagramId); | |
198 | +// } | |
199 | +}(파일 끝에 줄바꿈 문자 없음) |
--- src/main/java/com/takensoft/taken_bi_manager/diagram/web/FilterController.java
+++ src/main/java/com/takensoft/taken_bi_manager/schedule/web/FilterController.java
... | ... | @@ -1,7 +1,8 @@ |
1 |
-package com.takensoft.taken_bi_manager.diagram.web; |
|
1 |
+package com.takensoft.taken_bi_manager.schedule.web; |
|
2 | 2 |
|
3 |
-import com.takensoft.taken_bi_manager.diagram.service.FilterService; |
|
4 |
-import com.takensoft.taken_bi_manager.diagram.vo.NodeVO; |
|
3 |
+import com.takensoft.taken_bi_manager.schedule.dto.NodeDTO; |
|
4 |
+import com.takensoft.taken_bi_manager.schedule.service.FilterService; |
|
5 |
+import com.takensoft.taken_bi_manager.schedule.vo.NodeVO; |
|
5 | 6 |
import lombok.RequiredArgsConstructor; |
6 | 7 |
import org.springframework.web.bind.annotation.RequestBody; |
7 | 8 |
import org.springframework.web.bind.annotation.RequestMapping; |
... | ... | @@ -25,7 +26,7 @@ |
25 | 26 |
* 필터 실행 |
26 | 27 |
*/ |
27 | 28 |
@RequestMapping(value ="/diagram/runFilter.json", method = RequestMethod.POST) |
28 |
- public ModelAndView runFilter(@RequestBody NodeVO nodeVO) throws Exception { |
|
29 |
+ public ModelAndView runFilter(@RequestBody NodeDTO nodeVO) throws Exception { |
|
29 | 30 |
ModelAndView mav = new ModelAndView("jsonView"); |
30 | 31 |
mav.addObject("result", filterService.runFilter(nodeVO)); |
31 | 32 |
return mav; |
+++ src/main/java/com/takensoft/taken_bi_manager/schedule/web/ScheduleController.java
... | ... | @@ -0,0 +1,91 @@ |
1 | +package com.takensoft.taken_bi_manager.schedule.web; | |
2 | + | |
3 | +import com.takensoft.taken_bi_manager.common.vo.CheckMessage; | |
4 | +import com.takensoft.taken_bi_manager.schedule.service.ScheduleService; | |
5 | +import com.takensoft.taken_bi_manager.schedule.vo.ScheduleVO; | |
6 | +import com.takensoft.taken_bi_manager.common.vo.CustomeResultMap; | |
7 | +import com.takensoft.taken_bi_manager.common.vo.SearchVO; | |
8 | +import org.springframework.beans.factory.annotation.Autowired; | |
9 | +import org.springframework.http.HttpStatus; | |
10 | +import org.springframework.web.bind.annotation.*; | |
11 | + | |
12 | +@RestController | |
13 | +@RequestMapping("/schedule") | |
14 | +public class ScheduleController { | |
15 | + @Autowired | |
16 | + private ScheduleService scheduleService; | |
17 | + | |
18 | + /** | |
19 | + * @author 박정하 | |
20 | + * @since 2025.01.16 | |
21 | + * | |
22 | + * 스케줄 목록 조회 | |
23 | + */ | |
24 | + @GetMapping | |
25 | + public CustomeResultMap selectScheduleList(@RequestBody SearchVO searchVO) throws Exception { | |
26 | + CustomeResultMap resultMap = new CustomeResultMap(); | |
27 | + | |
28 | + try { | |
29 | + resultMap.setResultData(scheduleService.selectScheduleList(searchVO)); | |
30 | + } catch (RuntimeException e) { | |
31 | + resultMap.setCheckMessage(new CheckMessage(false, e.getMessage(), HttpStatus.BAD_REQUEST.value())); | |
32 | + } catch (Exception e) { | |
33 | + resultMap.setCheckMessage(new CheckMessage(false, e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR.value())); | |
34 | + } | |
35 | + | |
36 | + return resultMap; | |
37 | + } | |
38 | + | |
39 | + /* | |
40 | + * @author 박정하 | |
41 | + * @since 2025.01.16 | |
42 | + * | |
43 | + * 스케줄 등록 | |
44 | + */ | |
45 | + @PostMapping | |
46 | + public CustomeResultMap insertSchedule(@RequestBody ScheduleVO scheduleVO) throws Exception { | |
47 | + CustomeResultMap resultMap = new CustomeResultMap(); | |
48 | + | |
49 | + try { | |
50 | + resultMap.setResultData(scheduleService.insertSchedule(scheduleVO)); | |
51 | + } catch (RuntimeException e) { | |
52 | + resultMap.setCheckMessage(new CheckMessage(false, e.getMessage(), HttpStatus.BAD_REQUEST.value())); | |
53 | + } catch (Exception e) { | |
54 | + resultMap.setCheckMessage(new CheckMessage(false, e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR.value())); | |
55 | + } | |
56 | + | |
57 | + return resultMap; | |
58 | + } | |
59 | + | |
60 | + /* | |
61 | + * 스케줄 상세 조회 | |
62 | + */ | |
63 | + @PostMapping(path = "/selectSchedule.json") | |
64 | + public CustomeResultMap selectSchedule(@RequestBody ScheduleVO scheduleVO) throws Exception { | |
65 | + CustomeResultMap map = new CustomeResultMap(); | |
66 | + map.getResultData().put("schedule", scheduleService.selectSchedule(scheduleVO)); | |
67 | + return map; | |
68 | + } | |
69 | + | |
70 | + /** | |
71 | + * @author 박정하 | |
72 | + * @since 2024.10.04 | |
73 | + * | |
74 | + * 스케줄 정보 삭제 | |
75 | + */ | |
76 | + @GetMapping(value="/deleteSchedule/{schdulId}") | |
77 | + public CustomeResultMap deleteSchedule(@PathVariable String schdulId) throws Exception { | |
78 | + return scheduleService.deleteSchedule(schdulId); | |
79 | + } | |
80 | + | |
81 | + /** | |
82 | + * @author 박정하 | |
83 | + * @since 2024.10.04 | |
84 | + * | |
85 | + * 스케줄 상태 변경 | |
86 | + */ | |
87 | + @GetMapping(value="/scheduleSttusChange/{schdulId}/{schdulSttus}") | |
88 | + public CustomeResultMap scheduleSttusChange(@PathVariable String schdulId, @PathVariable String schdulSttus) throws Exception { | |
89 | + return scheduleService.scheduleSttusChange(schdulId, schdulSttus); | |
90 | + } | |
91 | +}(파일 끝에 줄바꿈 문자 없음) |
--- src/main/java/com/takensoft/taken_bi_manager/diagram/web/ScheduleOperator.java
+++ src/main/java/com/takensoft/taken_bi_manager/schedule/web/ScheduleOperator.java
... | ... | @@ -1,19 +1,14 @@ |
1 |
-package com.takensoft.taken_bi_manager.diagram.web; |
|
1 |
+package com.takensoft.taken_bi_manager.schedule.web; |
|
2 | 2 |
|
3 | 3 |
import com.cronutils.model.Cron; |
4 | 4 |
import com.cronutils.model.definition.CronDefinition; |
5 | 5 |
import com.cronutils.model.definition.CronDefinitionBuilder; |
6 | 6 |
import com.cronutils.model.time.ExecutionTime; |
7 | 7 |
import com.cronutils.parser.CronParser; |
8 |
-import com.cronutils.utils.VisibleForTesting; |
|
9 |
-import com.fasterxml.jackson.databind.ObjectMapper; |
|
10 |
-import com.takensoft.taken_bi_manager.common.schedule.dao.ScheduleDAO; |
|
11 |
-import com.takensoft.taken_bi_manager.common.schedule.service.ScheduleService; |
|
12 |
-import com.takensoft.taken_bi_manager.common.schedule.vo.Schedule; |
|
8 |
+import com.takensoft.taken_bi_manager.schedule.dao.ScheduleDAO; |
|
9 |
+import com.takensoft.taken_bi_manager.schedule.vo.ScheduleVO; |
|
13 | 10 |
import com.takensoft.taken_bi_manager.common.vo.CustomeResultMap; |
14 |
-import com.takensoft.taken_bi_manager.diagram.dto.DiagramDetailDTO; |
|
15 |
-import com.takensoft.taken_bi_manager.diagram.service.Diagramservice; |
|
16 |
-import com.takensoft.taken_bi_manager.diagram.vo.DiagramVO; |
|
11 |
+import com.takensoft.taken_bi_manager.schedule.service.Diagramservice; |
|
17 | 12 |
import jakarta.annotation.PostConstruct; |
18 | 13 |
import org.slf4j.Logger; |
19 | 14 |
import org.slf4j.LoggerFactory; |
... | ... | @@ -56,12 +51,12 @@ |
56 | 51 |
try { |
57 | 52 |
// 데이터베이스 연결 |
58 | 53 |
logger.info("데이터베이스 연결 시도"); |
59 |
- con = DriverManager.getConnection("jdbc:log4jdbc:postgresql://210.180.118.83:5432/bi_manager?currentSchema=bi_manager", "takensoft", "tts96314728!@"); |
|
54 |
+ con = DriverManager.getConnection("jdbc:log4jdbc:postgresql://210.180.118.83:5432/bi_maneger_renewal?currentSchema=bi_manager", "takensoft", "tts96314728!@"); |
|
60 | 55 |
logger.info("데이터베이스 연결 성공"); |
61 | 56 |
|
62 | 57 |
// 쿼리 실행 |
63 | 58 |
stmt = con.createStatement(); |
64 |
- rs = stmt.executeQuery("SELECT * FROM scheduler WHERE use_at = true AND schdul_sttus = 'run'"); |
|
59 |
+ rs = stmt.executeQuery("SELECT * FROM schdul_info WHERE use_at = true AND schdul_sttus = true"); |
|
65 | 60 |
while (rs.next()) { |
66 | 61 |
String cron = rs.getString("cron"); |
67 | 62 |
String schduleId = rs.getString("schdul_id"); |
... | ... | @@ -117,18 +112,17 @@ |
117 | 112 |
ZonedDateTime nextExecutionPlusOneMinute = nextExecution.plusMinutes(1); |
118 | 113 |
|
119 | 114 |
if ((now.isEqual(nextExecution) || now.isAfter(nextExecutionMinusOneMinute)) && now.isBefore(nextExecutionPlusOneMinute)) { |
120 |
- try { |
|
121 |
- Schedule schedule = scheduleDAO.selectSchedule(scheduleId); |
|
122 |
- CustomeResultMap customeResultMap = diagram.diagramDetailRead(schedule.getGroup_id()); |
|
123 |
- HashMap<String, Object> getResultData = customeResultMap.getResultData(); |
|
124 |
- DiagramDetailDTO diagramDetailDTO = (DiagramDetailDTO) getResultData.get("diagramDetailDTO"); |
|
125 |
- diagram.operatorNow(diagramDetailDTO.getDiagram(), "schedule"); |
|
126 |
- } catch (Exception e) { |
|
127 |
- e.printStackTrace(); |
|
128 |
- } |
|
115 |
+// try { |
|
116 |
+// ScheduleVO scheduleVO = scheduleDAO.selectSchedule(scheduleId); |
|
117 |
+// CustomeResultMap customeResultMap = diagram.diagramDetailRead(scheduleVO.getGroupId()); |
|
118 |
+// HashMap<String, Object> getResultData = customeResultMap.getResultData(); |
|
119 |
+// DiagramDetailDTO diagramDetailDTO = (DiagramDetailDTO) getResultData.get("diagramDetailDTO"); |
|
120 |
+// diagram.operatorNow(diagramDetailDTO.getDiagram(), "schedule"); |
|
121 |
+// } catch (Exception e) { |
|
122 |
+// e.printStackTrace(); |
|
123 |
+// } |
|
129 | 124 |
} |
130 | 125 |
} |
131 | 126 |
} |
132 | 127 |
} |
133 |
- |
|
134 | 128 |
}(파일 끝에 줄바꿈 문자 없음) |
--- src/main/java/com/takensoft/taken_bi_manager/user/member/dao/LoginDAO.java
+++ src/main/java/com/takensoft/taken_bi_manager/user/dao/LoginDAO.java
... | ... | @@ -1,8 +1,8 @@ |
1 |
-package com.takensoft.taken_bi_manager.user.member.dao; |
|
1 |
+package com.takensoft.taken_bi_manager.user.dao; |
|
2 | 2 |
|
3 | 3 |
import org.apache.ibatis.annotations.Mapper; |
4 | 4 |
|
5 |
-import com.takensoft.taken_bi_manager.user.member.vo.Member; |
|
5 |
+import com.takensoft.taken_bi_manager.user.vo.Member; |
|
6 | 6 |
|
7 | 7 |
/** |
8 | 8 |
* @author 김성원 |
--- src/main/java/com/takensoft/taken_bi_manager/user/member/dao/MemberDAO.java
+++ src/main/java/com/takensoft/taken_bi_manager/user/dao/MemberDAO.java
... | ... | @@ -1,15 +1,13 @@ |
1 |
-package com.takensoft.taken_bi_manager.user.member.dao; |
|
1 |
+package com.takensoft.taken_bi_manager.user.dao; |
|
2 | 2 |
|
3 |
-import com.takensoft.taken_bi_manager.common.vo.CustomeResultMap; |
|
4 | 3 |
import com.takensoft.taken_bi_manager.common.vo.SearchVO; |
5 |
-import com.takensoft.taken_bi_manager.user.member.vo.AuthorVO; |
|
6 |
-import com.takensoft.taken_bi_manager.user.member.vo.UserAuthorVO; |
|
4 |
+import com.takensoft.taken_bi_manager.user.vo.AuthorVO; |
|
5 |
+import com.takensoft.taken_bi_manager.user.vo.UserAuthorVO; |
|
7 | 6 |
import org.apache.ibatis.annotations.Mapper; |
8 | 7 |
|
9 |
-import com.takensoft.taken_bi_manager.user.member.vo.Member; |
|
8 |
+import com.takensoft.taken_bi_manager.user.vo.Member; |
|
10 | 9 |
import org.springframework.stereotype.Repository; |
11 | 10 |
|
12 |
-import java.util.HashMap; |
|
13 | 11 |
import java.util.List; |
14 | 12 |
|
15 | 13 |
/** |
--- src/main/java/com/takensoft/taken_bi_manager/user/member/dao/MyPageDAO.java
... | ... | @@ -1,48 +0,0 @@ |
1 | -package com.takensoft.taken_bi_manager.user.member.dao; | |
2 | - | |
3 | -import com.takensoft.taken_bi_manager.user.member.vo.Member; | |
4 | -import org.apache.ibatis.annotations.Mapper; | |
5 | -import org.springframework.stereotype.Repository; | |
6 | - | |
7 | -/** | |
8 | - * @author 박민혁 | |
9 | - * @since 2024.03.14 | |
10 | - * | |
11 | - * 사용자 관리를 위한 SQL문에 접근하는 DAO | |
12 | - */ | |
13 | -@Mapper | |
14 | -@Repository | |
15 | -public interface MyPageDAO { | |
16 | - | |
17 | - /** | |
18 | - * @author 박민혁 | |
19 | - * @since 2024.03.14 | |
20 | - * | |
21 | - * 회원정보 가져오기 | |
22 | - */ | |
23 | - public Member selectUserData(String userId) throws Exception; | |
24 | - | |
25 | - /** | |
26 | - * @author 박민혁 | |
27 | - * @since 2024.03.15 | |
28 | - * | |
29 | - * 회원정보 수정하기 | |
30 | - */ | |
31 | - public int updateUserData(Member member) throws Exception; | |
32 | - | |
33 | - /** | |
34 | - * @author 박민혁 | |
35 | - * @since 2024.03.15 | |
36 | - * | |
37 | - * 회원 비밀번호 일치 여부 체크 | |
38 | - */ | |
39 | - public Member checkUserPassword(Member member) throws Exception; | |
40 | - | |
41 | - /** | |
42 | - * @author 박민혁 | |
43 | - * @since 2024.03.15 | |
44 | - * | |
45 | - * 회원 비밀번호 수정하기 | |
46 | - */ | |
47 | - public int updateUserPassword(Member member) throws Exception; | |
48 | -} |
--- src/main/java/com/takensoft/taken_bi_manager/user/member/servie/MyPageService.java
... | ... | @@ -1,40 +0,0 @@ |
1 | -package com.takensoft.taken_bi_manager.user.member.servie; | |
2 | - | |
3 | -import com.takensoft.taken_bi_manager.common.vo.CustomeResultMap; | |
4 | -import com.takensoft.taken_bi_manager.user.member.vo.Member; | |
5 | - | |
6 | -public interface MyPageService { | |
7 | - | |
8 | - /** | |
9 | - * @author 박민혁 | |
10 | - * @since 2024.03.14 | |
11 | - * | |
12 | - * 회원정보 가져오기 | |
13 | - */ | |
14 | - CustomeResultMap selectUserData(String userId) throws Exception; | |
15 | - | |
16 | - /** | |
17 | - * @author 박민혁 | |
18 | - * @since 2024.03.15 | |
19 | - * | |
20 | - * 회원정보 수정하기 | |
21 | - */ | |
22 | - CustomeResultMap updateUserData(Member member) throws Exception; | |
23 | - | |
24 | - /** | |
25 | - * @author 박민혁 | |
26 | - * @since 2024.03.15 | |
27 | - * | |
28 | - * 회원 비밀번호 일치 여부 체크 | |
29 | - */ | |
30 | - CustomeResultMap checkUserPassword(Member member) throws Exception; | |
31 | - | |
32 | - /** | |
33 | - * @author 박민혁 | |
34 | - * @since 2024.03.15 | |
35 | - * | |
36 | - * 회원 비밀번호 수정하기 | |
37 | - */ | |
38 | - CustomeResultMap updateUserPassword(Member member) throws Exception; | |
39 | - | |
40 | -} |
--- src/main/java/com/takensoft/taken_bi_manager/user/member/servie/impl/MyPageServiceImpl.java
... | ... | @@ -1,92 +0,0 @@ |
1 | -package com.takensoft.taken_bi_manager.user.member.servie.impl; | |
2 | - | |
3 | -import com.takensoft.taken_bi_manager.common.util.AuthUtil; | |
4 | -import com.takensoft.taken_bi_manager.common.util.CryptoUtil; | |
5 | -import com.takensoft.taken_bi_manager.common.vo.CustomeResultMap; | |
6 | -import com.takensoft.taken_bi_manager.user.member.dao.MyPageDAO; | |
7 | -import com.takensoft.taken_bi_manager.user.member.servie.MyPageService; | |
8 | -import com.takensoft.taken_bi_manager.user.member.vo.Member; | |
9 | -import org.springframework.beans.factory.annotation.Autowired; | |
10 | -import org.springframework.stereotype.Service; | |
11 | - | |
12 | - | |
13 | -/** | |
14 | - * @author 박민혁 | |
15 | - * @since 2024.03.14 | |
16 | - * | |
17 | - * 사용자 관리 서비스 처리 로직 | |
18 | - */ | |
19 | -@Service | |
20 | -public class MyPageServiceImpl implements MyPageService { | |
21 | - | |
22 | - @Autowired | |
23 | - private MyPageDAO myPageDAO; | |
24 | - | |
25 | - /** | |
26 | - * @author 박민혁 | |
27 | - * @since 2024.03.14 | |
28 | - * | |
29 | - * 회원정보 가져오기 | |
30 | - */ | |
31 | - public CustomeResultMap selectUserData(String userId) throws Exception{ | |
32 | - CustomeResultMap resultMap = new CustomeResultMap(); | |
33 | - Member member = myPageDAO.selectUserData(userId); | |
34 | - member.dataDecoder(); | |
35 | - | |
36 | - resultMap.getResultData().put("selectUserData", member); | |
37 | - | |
38 | - return resultMap; | |
39 | - } | |
40 | - | |
41 | - /** | |
42 | - * @author 박민혁 | |
43 | - * @since 2024.03.15 | |
44 | - * | |
45 | - * 회원정보 수정하기 | |
46 | - */ | |
47 | - public CustomeResultMap updateUserData(Member member) throws Exception{ | |
48 | - CustomeResultMap resultMap = new CustomeResultMap(); | |
49 | - member.setUpdtId(AuthUtil.getLoginUserId()); | |
50 | - member.dataEncoder(); | |
51 | - | |
52 | - int updateUserResult = myPageDAO.updateUserData(member); | |
53 | - | |
54 | - resultMap.getResultData().put("updateUserData", updateUserResult); | |
55 | - return resultMap; | |
56 | - } | |
57 | - | |
58 | - /** | |
59 | - * @author 박민혁 | |
60 | - * @since 2024.03.15 | |
61 | - * | |
62 | - * 회원 비밀번호 일치 여부 체크 | |
63 | - */ | |
64 | - public CustomeResultMap checkUserPassword(Member member) throws Exception{ | |
65 | - CustomeResultMap resultMap = new CustomeResultMap(); | |
66 | - Member checkPasswordResult = myPageDAO.checkUserPassword(member); | |
67 | - if(CryptoUtil.passwordMatch(member.getUserPassword(), checkPasswordResult.getUserPassword())) { | |
68 | - resultMap.getResultData().put("checkUserPassword", 1); | |
69 | - } else { | |
70 | - resultMap.getResultData().put("checkUserPassword", 0); | |
71 | - } | |
72 | - return resultMap; | |
73 | - } | |
74 | - | |
75 | - /** | |
76 | - * @author 박민혁 | |
77 | - * @since 2024.03.15 | |
78 | - * | |
79 | - * 회원 비밀번호 수정하기 | |
80 | - */ | |
81 | - public CustomeResultMap updateUserPassword(Member member) throws Exception{ | |
82 | - CustomeResultMap resultMap = new CustomeResultMap(); | |
83 | - member.setUpdtId(AuthUtil.getLoginUserId()); | |
84 | - member.PasswordEncoder(); | |
85 | - | |
86 | - int updatePasswordResult = myPageDAO.updateUserPassword(member); | |
87 | - | |
88 | - resultMap.getResultData().put("updatePasswordData", updatePasswordResult); | |
89 | - return resultMap; | |
90 | - | |
91 | - } | |
92 | -} |
--- src/main/java/com/takensoft/taken_bi_manager/user/member/web/MyPageController.java
... | ... | @@ -1,64 +0,0 @@ |
1 | -package com.takensoft.taken_bi_manager.user.member.web; | |
2 | - | |
3 | - | |
4 | -import com.takensoft.taken_bi_manager.common.vo.CustomeResultMap; | |
5 | -import com.takensoft.taken_bi_manager.user.member.servie.MyPageService; | |
6 | -import com.takensoft.taken_bi_manager.user.member.vo.Member; | |
7 | -import lombok.RequiredArgsConstructor; | |
8 | -import org.springframework.web.bind.annotation.*; | |
9 | - | |
10 | -@RestController | |
11 | -@RequiredArgsConstructor | |
12 | -@RequestMapping(value = "/mypage") | |
13 | -public class MyPageController { | |
14 | - private final MyPageService myPageService; | |
15 | - | |
16 | - /** | |
17 | - * @author 박민혁 | |
18 | - * @since 2024.03.14 | |
19 | - * | |
20 | - * 회원정보 가져오기 | |
21 | - */ | |
22 | - @GetMapping(value = "/{userId}") | |
23 | - public CustomeResultMap getUserInMyPage(@PathVariable String userId) throws Exception { | |
24 | - CustomeResultMap map = myPageService.selectUserData(userId); | |
25 | - return map; | |
26 | - } | |
27 | - | |
28 | - /** | |
29 | - * @author 박민혁 | |
30 | - * @since 2024.03.15 | |
31 | - * | |
32 | - * 회원정보 수정하기 | |
33 | - */ | |
34 | - @PutMapping | |
35 | - public CustomeResultMap updateUserInMyPage(@RequestBody Member member) throws Exception { | |
36 | - CustomeResultMap map = myPageService.updateUserData(member); | |
37 | - return map; | |
38 | - } | |
39 | - | |
40 | - /** | |
41 | - * @author 박민혁 | |
42 | - * @since 2024.03.15 | |
43 | - * | |
44 | - * 회원 현재 비밀번호 일치 여부 체크 | |
45 | - */ | |
46 | - @PostMapping | |
47 | - public CustomeResultMap checkUserPassword(@RequestBody Member member) throws Exception { | |
48 | - CustomeResultMap map = myPageService.checkUserPassword(member); | |
49 | - return map; | |
50 | - } | |
51 | - | |
52 | - /** | |
53 | - * @author 박민혁 | |
54 | - * @since 2024.03.15 | |
55 | - * | |
56 | - * 회원 비밀번호 수정하기 | |
57 | - */ | |
58 | - @PutMapping(value = "/password") | |
59 | - public CustomeResultMap updateUserPassword(@RequestBody Member member) throws Exception { | |
60 | - CustomeResultMap map = myPageService.updateUserPassword(member); | |
61 | - return map; | |
62 | - } | |
63 | - | |
64 | -} |
--- src/main/java/com/takensoft/taken_bi_manager/user/org/vo/Organization.java
... | ... | @@ -1,56 +0,0 @@ |
1 | -package com.takensoft.taken_bi_manager.user.org.vo; | |
2 | - | |
3 | -import java.sql.Date; | |
4 | -import java.sql.Timestamp; | |
5 | - | |
6 | -import lombok.Getter; | |
7 | -import lombok.Setter; | |
8 | - | |
9 | -/** | |
10 | - * @author 김성원 | |
11 | - * @since 2023-12-28 | |
12 | - * | |
13 | - * 부서정보 객체 | |
14 | - */ | |
15 | -@Getter | |
16 | -@Setter | |
17 | -public class Organization { | |
18 | - | |
19 | - // 부서코드(pk) | |
20 | - private String deptCode; | |
21 | - | |
22 | - // 상위부서 코드 | |
23 | - private String upperDept; | |
24 | - | |
25 | - // 조직 코드(최상위 부서?) | |
26 | - private String orgCode; | |
27 | - | |
28 | - // 부서명 | |
29 | - private String deptNm; | |
30 | - | |
31 | - // 부서명 설명 | |
32 | - private String deptDc; | |
33 | - | |
34 | - // 부서 깊이 | |
35 | - private int deptDp; | |
36 | - | |
37 | - // 부서 정렬 순서 | |
38 | - private int dept_ordr; | |
39 | - | |
40 | - // 사용여부 | |
41 | - private boolean useAt; | |
42 | - | |
43 | - // 생성일 | |
44 | - private Timestamp creatDt; | |
45 | - | |
46 | - // 생성자ID | |
47 | - private String creatId; | |
48 | - | |
49 | - // 수정일 | |
50 | - private Timestamp updtDt; | |
51 | - | |
52 | - // 수정자 ID | |
53 | - private String updtId; | |
54 | - | |
55 | - | |
56 | -} |
--- src/main/java/com/takensoft/taken_bi_manager/user/org/vo/OrganizationHistory.java
... | ... | @@ -1,43 +0,0 @@ |
1 | -package com.takensoft.taken_bi_manager.user.org.vo; | |
2 | - | |
3 | -import java.sql.Date; | |
4 | -import java.sql.Timestamp; | |
5 | - | |
6 | -import lombok.Getter; | |
7 | -import lombok.Setter; | |
8 | - | |
9 | -/** | |
10 | - * @author 김성원 | |
11 | - * @since 2023-12-28 | |
12 | - * | |
13 | - * 부서변경정보 객체 | |
14 | - */ | |
15 | -@Getter | |
16 | -@Setter | |
17 | -public class OrganizationHistory { | |
18 | - | |
19 | - // 부서코드(pk) | |
20 | - private String deptCode; | |
21 | - | |
22 | - // 상위부서 코드 | |
23 | - private String upperDept; | |
24 | - | |
25 | - // 조직 코드(최상위 부서?) | |
26 | - private String orgCode; | |
27 | - | |
28 | - // 이전 부서명 | |
29 | - private String beforDeptNm; | |
30 | - | |
31 | - // 현재 부서설명 | |
32 | - private String deptNm; | |
33 | - | |
34 | - // 부서 깊이 | |
35 | - private int deptDp; | |
36 | - | |
37 | - // 부서 정렬 순서 | |
38 | - private int dept_ordr; | |
39 | - | |
40 | - // 수정일 | |
41 | - private Timestamp updtDt; | |
42 | - | |
43 | -} |
--- src/main/java/com/takensoft/taken_bi_manager/user/member/servie/LoginService.java
+++ src/main/java/com/takensoft/taken_bi_manager/user/servie/LoginService.java
... | ... | @@ -1,7 +1,7 @@ |
1 |
-package com.takensoft.taken_bi_manager.user.member.servie; |
|
1 |
+package com.takensoft.taken_bi_manager.user.servie; |
|
2 | 2 |
|
3 | 3 |
import com.takensoft.taken_bi_manager.common.vo.CustomeResultMap; |
4 |
-import com.takensoft.taken_bi_manager.user.member.vo.Member; |
|
4 |
+import com.takensoft.taken_bi_manager.user.vo.Member; |
|
5 | 5 |
|
6 | 6 |
public interface LoginService { |
7 | 7 |
|
--- src/main/java/com/takensoft/taken_bi_manager/user/member/servie/MemberService.java
+++ src/main/java/com/takensoft/taken_bi_manager/user/servie/MemberService.java
... | ... | @@ -1,10 +1,10 @@ |
1 |
-package com.takensoft.taken_bi_manager.user.member.servie; |
|
1 |
+package com.takensoft.taken_bi_manager.user.servie; |
|
2 | 2 |
import java.util.HashMap; |
3 | 3 |
import java.util.List; |
4 | 4 |
|
5 | 5 |
import com.takensoft.taken_bi_manager.common.vo.CustomeResultMap; |
6 | 6 |
import com.takensoft.taken_bi_manager.common.vo.SearchVO; |
7 |
-import com.takensoft.taken_bi_manager.user.member.vo.Member; |
|
7 |
+import com.takensoft.taken_bi_manager.user.vo.Member; |
|
8 | 8 |
|
9 | 9 |
public interface MemberService { |
10 | 10 |
/** |
--- src/main/java/com/takensoft/taken_bi_manager/user/member/servie/impl/LoginServiceImpl.java
+++ src/main/java/com/takensoft/taken_bi_manager/user/servie/impl/LoginServiceImpl.java
... | ... | @@ -1,4 +1,4 @@ |
1 |
-package com.takensoft.taken_bi_manager.user.member.servie.impl; |
|
1 |
+package com.takensoft.taken_bi_manager.user.servie.impl; |
|
2 | 2 |
|
3 | 3 |
import java.util.HashMap; |
4 | 4 |
import java.util.List; |
... | ... | @@ -12,10 +12,10 @@ |
12 | 12 |
import com.takensoft.taken_bi_manager.common.util.SesssionEventListener; |
13 | 13 |
import com.takensoft.taken_bi_manager.common.util.StringUtil; |
14 | 14 |
import com.takensoft.taken_bi_manager.common.vo.CustomeResultMap; |
15 |
-import com.takensoft.taken_bi_manager.user.member.dao.LoginDAO; |
|
16 |
-import com.takensoft.taken_bi_manager.user.member.dao.MemberDAO; |
|
17 |
-import com.takensoft.taken_bi_manager.user.member.servie.LoginService; |
|
18 |
-import com.takensoft.taken_bi_manager.user.member.vo.Member; |
|
15 |
+import com.takensoft.taken_bi_manager.user.dao.LoginDAO; |
|
16 |
+import com.takensoft.taken_bi_manager.user.dao.MemberDAO; |
|
17 |
+import com.takensoft.taken_bi_manager.user.servie.LoginService; |
|
18 |
+import com.takensoft.taken_bi_manager.user.vo.Member; |
|
19 | 19 |
|
20 | 20 |
import jakarta.servlet.http.HttpServletRequest; |
21 | 21 |
import jakarta.servlet.http.HttpSession; |
--- src/main/java/com/takensoft/taken_bi_manager/user/member/servie/impl/MemberServiceImpl.java
+++ src/main/java/com/takensoft/taken_bi_manager/user/servie/impl/MemberServiceImpl.java
... | ... | @@ -1,20 +1,20 @@ |
1 |
-package com.takensoft.taken_bi_manager.user.member.servie.impl; |
|
1 |
+package com.takensoft.taken_bi_manager.user.servie.impl; |
|
2 | 2 |
|
3 | 3 |
import com.takensoft.taken_bi_manager.common.util.AuthUtil; |
4 | 4 |
import com.takensoft.taken_bi_manager.common.vo.CustomeResultMap; |
5 |
-import com.takensoft.taken_bi_manager.user.member.vo.UserAuthorVO; |
|
5 |
+import com.takensoft.taken_bi_manager.user.vo.UserAuthorVO; |
|
6 | 6 |
import lombok.RequiredArgsConstructor; |
7 | 7 |
|
8 | 8 |
import org.springframework.http.HttpStatus; |
9 | 9 |
import org.springframework.stereotype.Service; |
10 | 10 |
|
11 | 11 |
import com.takensoft.taken_bi_manager.common.vo.SearchVO; |
12 |
-import com.takensoft.taken_bi_manager.user.member.dao.MemberDAO; |
|
13 |
-import com.takensoft.taken_bi_manager.user.member.servie.MemberService; |
|
14 |
-import com.takensoft.taken_bi_manager.user.member.vo.Member; |
|
12 |
+import com.takensoft.taken_bi_manager.user.dao.MemberDAO; |
|
13 |
+import com.takensoft.taken_bi_manager.user.servie.MemberService; |
|
14 |
+import com.takensoft.taken_bi_manager.user.vo.Member; |
|
15 | 15 |
import org.springframework.transaction.annotation.Transactional; |
16 | 16 |
|
17 |
-import static com.takensoft.taken_bi_manager.user.member.servie.impl.MemberServiceImpl.HistoryTypes.*; |
|
17 |
+import static com.takensoft.taken_bi_manager.user.servie.impl.MemberServiceImpl.HistoryTypes.*; |
|
18 | 18 |
|
19 | 19 |
import java.util.*; |
20 | 20 |
|
--- src/main/java/com/takensoft/taken_bi_manager/user/member/vo/AuthorVO.java
+++ src/main/java/com/takensoft/taken_bi_manager/user/vo/AuthorVO.java
... | ... | @@ -1,4 +1,4 @@ |
1 |
-package com.takensoft.taken_bi_manager.user.member.vo; |
|
1 |
+package com.takensoft.taken_bi_manager.user.vo; |
|
2 | 2 |
|
3 | 3 |
import lombok.Data; |
4 | 4 |
|
--- src/main/java/com/takensoft/taken_bi_manager/user/member/vo/Member.java
+++ src/main/java/com/takensoft/taken_bi_manager/user/vo/Member.java
... | ... | @@ -1,4 +1,4 @@ |
1 |
-package com.takensoft.taken_bi_manager.user.member.vo; |
|
1 |
+package com.takensoft.taken_bi_manager.user.vo; |
|
2 | 2 |
|
3 | 3 |
import com.takensoft.taken_bi_manager.common.util.CryptoUtil; |
4 | 4 |
|
--- src/main/java/com/takensoft/taken_bi_manager/user/member/vo/UserAuthorVO.java
+++ src/main/java/com/takensoft/taken_bi_manager/user/vo/UserAuthorVO.java
... | ... | @@ -1,4 +1,4 @@ |
1 |
-package com.takensoft.taken_bi_manager.user.member.vo; |
|
1 |
+package com.takensoft.taken_bi_manager.user.vo; |
|
2 | 2 |
|
3 | 3 |
import lombok.Data; |
4 | 4 |
|
--- src/main/java/com/takensoft/taken_bi_manager/user/member/web/MemberController.java
+++ src/main/java/com/takensoft/taken_bi_manager/user/web/MemberController.java
... | ... | @@ -1,9 +1,9 @@ |
1 |
-package com.takensoft.taken_bi_manager.user.member.web; |
|
1 |
+package com.takensoft.taken_bi_manager.user.web; |
|
2 | 2 |
|
3 | 3 |
import com.takensoft.taken_bi_manager.common.vo.CustomeResultMap; |
4 | 4 |
import com.takensoft.taken_bi_manager.common.vo.SearchVO; |
5 |
-import com.takensoft.taken_bi_manager.user.member.servie.MemberService; |
|
6 |
-import com.takensoft.taken_bi_manager.user.member.vo.Member; |
|
5 |
+import com.takensoft.taken_bi_manager.user.servie.MemberService; |
|
6 |
+import com.takensoft.taken_bi_manager.user.vo.Member; |
|
7 | 7 |
import lombok.RequiredArgsConstructor; |
8 | 8 |
import org.springframework.http.HttpStatus; |
9 | 9 |
import org.springframework.web.bind.annotation.*; |
--- src/main/resources/spring/mapper/common/commonCode-SQL.xml
+++ src/main/resources/spring/mapper/common/commonCode-SQL.xml
... | ... | @@ -1,19 +1,46 @@ |
1 | 1 |
<?xml version="1.0" encoding="UTF-8" ?> |
2 | 2 |
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
3 |
- |
|
4 |
- |
|
5 | 3 |
<mapper namespace="com.takensoft.taken_bi_manager.common.code.dao.CmmnCodeDAO"> |
6 |
- <!-- 그룹코드로 코드 조회. --> |
|
7 |
- <select id="getCodeListByGroupId" parameterType="String" resultType="CmmnCode" > |
|
8 |
- SELECT code_id as "cmmnCode" |
|
9 |
- , group_code as "groupCode" |
|
10 |
- , code_nm as "codeNm" |
|
11 |
- , code_dc as "codeDc" |
|
12 |
- , code_ordr as "codeOrdr" |
|
4 |
+ <resultMap id="CmmnCodeResult" type="CmmnCode"> |
|
5 |
+ <result property="cmmnCode" column="code_id"/> |
|
6 |
+ <result property="groupCode" column="group_code"/> |
|
7 |
+ <result property="codeNm" column="code_nm"/> |
|
8 |
+ <result property="codeDc" column="code_dc"/> |
|
9 |
+ <result property="upperCode" column="upper_code"/> |
|
10 |
+ <result property="codeOrdr" column="code_ordr"/> |
|
11 |
+ <result property="useAt" column="use_at"/> |
|
12 |
+ <result property="creatDt" column="creat_dt"/> |
|
13 |
+ <result property="creatId" column="creat_id"/> |
|
14 |
+ <result property="updtDt" column="updt_dt"/> |
|
15 |
+ <result property="updtId" column="updt_id"/> |
|
16 |
+ </resultMap> |
|
17 |
+ |
|
18 |
+ <!-- 그룹코드로 코드 조회 --> |
|
19 |
+ <select id="getCodeListByGroupId" parameterType="String" resultMap="CmmnCodeResult" > |
|
20 |
+ SELECT code_id |
|
21 |
+ , group_code |
|
22 |
+ , code_nm |
|
23 |
+ , code_dc |
|
24 |
+ , upper_code |
|
25 |
+ , code_ordr |
|
26 |
+ , use_at |
|
27 |
+ , creat_dt |
|
28 |
+ , creat_id |
|
29 |
+ , updt_dt |
|
30 |
+ , updt_id |
|
13 | 31 |
FROM cmmn_code |
14 | 32 |
WHERE group_code = #{groupCode} |
15 | 33 |
AND use_at = true |
16 | 34 |
ORDER BY code_ordr |
17 | 35 |
</select> |
18 |
- |
|
36 |
+ |
|
37 |
+ <select id="findChildNode" parameterType="String" resultType="HierachyVO"> |
|
38 |
+ SELECT code_id AS id |
|
39 |
+ , upper_code AS upId |
|
40 |
+ , code_nm AS nm |
|
41 |
+ FROM cmmn_code |
|
42 |
+ WHERE upper_code = #{id} |
|
43 |
+ AND use_at = true |
|
44 |
+ ORDER BY code_ordr |
|
45 |
+ </select> |
|
19 | 46 |
</mapper>(파일 끝에 줄바꿈 문자 없음) |
--- src/main/resources/spring/mapper/common/schedule-SQL.xml
... | ... | @@ -1,157 +0,0 @@ |
1 | -<?xml version="1.0" encoding="UTF-8" ?> | |
2 | -<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |
3 | - | |
4 | - | |
5 | -<mapper namespace="com.takensoft.taken_bi_manager.common.schedule.dao.ScheduleDAO"> | |
6 | - <!-- 스케줄 업설트 --> | |
7 | - <update id="conflictInsertSchedule" parameterType="Schedule" > | |
8 | - INSERT INTO scheduler | |
9 | - ( | |
10 | - schdul_id | |
11 | - , group_id | |
12 | - , sj | |
13 | - , dc | |
14 | - , cron | |
15 | - , cron_chrctr | |
16 | - , schdul_sttus | |
17 | - , cycle_at | |
18 | - , use_at | |
19 | - , creat_id | |
20 | - , creat_dt | |
21 | - ) | |
22 | - VALUES | |
23 | - ( | |
24 | - #{schdul_id} | |
25 | - , #{group_id} | |
26 | - , #{sj} | |
27 | - , #{dc} | |
28 | - , #{cron} | |
29 | - , #{cron_chrctr} | |
30 | - , #{schdul_sttus} | |
31 | - , #{cycle_at} | |
32 | - , #{use_at} | |
33 | - , #{creatId} | |
34 | - , NOW() | |
35 | - ) | |
36 | - ON CONFLICT(schdul_id) | |
37 | - DO UPDATE | |
38 | - SET group_id = #{group_id} | |
39 | - , sj = #{sj} | |
40 | - , dc = #{dc} | |
41 | - , cron = #{cron} | |
42 | - , cron_chrctr = #{cron_chrctr} | |
43 | - , schdul_sttus = #{schdul_sttus} | |
44 | - , cycle_at = #{cycle_at} | |
45 | - , use_at = #{use_at} | |
46 | - , updt_dt = NOW() | |
47 | - , updt_id = #{updtId} | |
48 | - </update> | |
49 | - | |
50 | - <!-- 스케줄 리스트 --> | |
51 | - <select id="selectScheduleList" parameterType="SearchVO" resultType="Schedule"> | |
52 | - SELECT schdul_id | |
53 | - , group_id | |
54 | - , sj | |
55 | - , dc | |
56 | - , cron | |
57 | - , cron_chrctr | |
58 | - , schdul_sttus | |
59 | - , cycle_at | |
60 | - , use_at | |
61 | - , creat_id as "creatId" | |
62 | - , creat_dt as "creatDt" | |
63 | - , updt_dt as "updtDt" | |
64 | - , updt_id as "updtId" | |
65 | - FROM scheduler | |
66 | - WHERE use_at = true | |
67 | - <!-- 검색영역 --> | |
68 | - <foreach item="item" index="index" collection="searchObjectList"> | |
69 | - <choose> | |
70 | - <!-- 날짜 검색 --> | |
71 | - <when test="item.type == 'dates'"> | |
72 | - AND #{item.value}::timestamp <![CDATA[<=]]> ${item.key}::timestamp | |
73 | - AND ${item.key2}::timestamp <![CDATA[<]]> #{item.value2}::timestamp + INTERVAL '1' DAY | |
74 | - </when> | |
75 | - <!-- 상태 검색 --> | |
76 | - <when test="item.type == 'string' and item.key == 'schdul_sttus' and item.value != null and item.value !=''"> | |
77 | - AND ${item.key} = #{item.value} | |
78 | - </when> | |
79 | - <!-- 일반 검색 --> | |
80 | - <when test="item.type == 'string' and item.key != null and item.key != '' and item.value != null and item.value !=''"> | |
81 | - AND ${item.key} LIKE CONCAT('%', #{item.value}, '%') | |
82 | - </when> | |
83 | - </choose> | |
84 | - </foreach> | |
85 | - <!-- 검색영역 끝 --> | |
86 | - ORDER BY creat_dt DESC | |
87 | - LIMIT #{perPage} OFFSET ((#{currentPage} - 1) * #{perPage}) | |
88 | - </select> | |
89 | - | |
90 | - <!-- 스케줄 리스트 카운트 --> | |
91 | - <select id="selectScheduleListCount" parameterType="SearchVO" resultType="Integer"> | |
92 | - SELECT count(*) | |
93 | - FROM scheduler | |
94 | - WHERE use_at = true | |
95 | - <!-- 검색영역 --> | |
96 | - <foreach item="item" index="index" collection="searchObjectList"> | |
97 | - <choose> | |
98 | - <!-- 날짜 검색 --> | |
99 | - <when test="item.type == 'dates'"> | |
100 | - AND #{item.value}::timestamp <![CDATA[<=]]> ${item.key}::timestamp | |
101 | - AND ${item.key2}::timestamp <![CDATA[<]]> #{item.value2}::timestamp + INTERVAL '1' DAY | |
102 | - </when> | |
103 | - <!-- 상태 검색 --> | |
104 | - <when test="item.type == 'string' and item.key == 'schdul_sttus' and item.value != null and item.value !=''"> | |
105 | - AND ${item.key} = #{item.value} | |
106 | - </when> | |
107 | - <!-- 일반 검색 --> | |
108 | - <when test="item.type == 'string' and item.key != null and item.key != '' and item.value != null and item.value !=''"> | |
109 | - AND ${item.key} LIKE CONCAT('%', #{item.value}, '%') | |
110 | - </when> | |
111 | - </choose> | |
112 | - </foreach> | |
113 | - <!-- 검색영역 끝 --> | |
114 | - </select> | |
115 | - | |
116 | - <!-- 스케줄 단건 조회 --> | |
117 | - <select id="selectSchedule" parameterType="String" resultType="Schedule"> | |
118 | - SELECT | |
119 | - schdul_id | |
120 | - , group_id | |
121 | - , sj | |
122 | - , dc | |
123 | - , cron | |
124 | - , cron_chrctr | |
125 | - , schdul_sttus | |
126 | - , cycle_at | |
127 | - , use_at | |
128 | - , creat_id as "creatId" | |
129 | - , creat_dt as "creatDt" | |
130 | - , updt_dt as "updtDt" | |
131 | - , updt_id as "updtId" | |
132 | - FROM scheduler | |
133 | - WHERE schdul_id = #{schdul_id} | |
134 | - AND use_at = true | |
135 | - </select> | |
136 | - | |
137 | - <!-- Diagram Id로 Schedule Id 구하기 --> | |
138 | - <select id="selectScheduleIdRead" parameterType="String" resultType="String"> | |
139 | - SELECT schdul_id | |
140 | - FROM scheduler | |
141 | - WHERE group_id = #{diagramId} | |
142 | - </select> | |
143 | - | |
144 | - <!-- 스케줄 정보 삭제 --> | |
145 | - <update id="deleteSchedule" parameterType="String"> | |
146 | - UPDATE scheduler | |
147 | - SET use_at = false | |
148 | - WHERE schdul_id = #{schdulId} | |
149 | - </update> | |
150 | - | |
151 | - <!-- 스케줄 상태 변경 --> | |
152 | - <update id="scheduleSttusChange" parameterType="HashMap"> | |
153 | - UPDATE scheduler | |
154 | - SET schdul_sttus = #{schdulSttus} | |
155 | - WHERE schdul_id = #{schdulId} | |
156 | - </update> | |
157 | -</mapper>(파일 끝에 줄바꿈 문자 없음) |
--- src/main/resources/spring/mapper/job/job-SQL.xml
+++ src/main/resources/spring/mapper/job/job-SQL.xml
... | ... | @@ -240,7 +240,7 @@ |
240 | 240 |
, job_indx |
241 | 241 |
, indx |
242 | 242 |
, origin_column_nm |
243 |
- , targer_column_nm |
|
243 |
+ , target_column_nm |
|
244 | 244 |
) VALUES ( |
245 | 245 |
#{groupId} |
246 | 246 |
, #{jobIndx} |
... | ... | @@ -266,7 +266,7 @@ |
266 | 266 |
, job_indx as jobIndx |
267 | 267 |
, indx |
268 | 268 |
, origin_column_nm as orginColumnNm |
269 |
- , targer_column_nm as targetColumnNm |
|
269 |
+ , target_column_nm as targetColumnNm |
|
270 | 270 |
FROM job_itm_dataset |
271 | 271 |
WHERE group_id = #{group_id} |
272 | 272 |
AND job_indx = #{indx} |
--- src/main/resources/spring/mapper/mybatis-config.xml
+++ src/main/resources/spring/mapper/mybatis-config.xml
... | ... | @@ -16,7 +16,6 @@ |
16 | 16 |
<typeAliases> |
17 | 17 |
<typeAlias type="com.takensoft.taken_bi_manager.common.vo.SearchVO" alias="SearchVO"/> |
18 | 18 |
<typeAlias type="com.takensoft.taken_bi_manager.common.vo.HierachyVO" alias="HierachyVO"/> |
19 |
- <typeAlias type="com.takensoft.taken_bi_manager.common.schedule.vo.Schedule" alias="Schedule"/> |
|
20 | 19 |
<typeAlias type="com.takensoft.taken_bi_manager.common.code.vo.CmmnCode" alias="CmmnCode"/> |
21 | 20 |
<typeAlias type="com.takensoft.taken_bi_manager.common.file.vo.FileManage" alias="FileManage"/> |
22 | 21 |
<typeAlias type="com.takensoft.taken_bi_manager.common.file.vo.CmmnFile" alias="CmmnFile"/> |
... | ... | @@ -36,9 +35,9 @@ |
36 | 35 |
<typeAlias type="com.takensoft.taken_bi_manager.jobs.vo.item.JobItemGroup" alias="JobItemGroup"/> |
37 | 36 |
<typeAlias type="com.takensoft.taken_bi_manager.jobs.vo.item.FilterItem" alias="FilterItem"/> |
38 | 37 |
|
39 |
- <typeAlias type="com.takensoft.taken_bi_manager.user.member.vo.Member" alias="Member"/> |
|
40 |
- <typeAlias type="com.takensoft.taken_bi_manager.user.member.vo.AuthorVO" alias="AuthorVO"/> |
|
41 |
- <typeAlias type="com.takensoft.taken_bi_manager.user.member.vo.UserAuthorVO" alias="UserAuthorVO"/> |
|
38 |
+ <typeAlias type="com.takensoft.taken_bi_manager.user.vo.Member" alias="Member"/> |
|
39 |
+ <typeAlias type="com.takensoft.taken_bi_manager.user.vo.AuthorVO" alias="AuthorVO"/> |
|
40 |
+ <typeAlias type="com.takensoft.taken_bi_manager.user.vo.UserAuthorVO" alias="UserAuthorVO"/> |
|
42 | 41 |
|
43 | 42 |
<typeAlias type="com.takensoft.taken_bi_manager.data.vo.Column" alias="Column"/> |
44 | 43 |
<typeAlias type="com.takensoft.taken_bi_manager.data.vo.ColumnData" alias="ColumnData"/> |
... | ... | @@ -55,12 +54,15 @@ |
55 | 54 |
<typeAlias type="com.takensoft.taken_bi_manager.host.vo.ConnectionVO" alias="ConnectionVO"/> |
56 | 55 |
<typeAlias type="com.takensoft.taken_bi_manager.host.vo.ConnectionVO$Host" alias="ConnectionVO_host"/> |
57 | 56 |
|
58 |
- <typeAlias type="com.takensoft.taken_bi_manager.diagram.vo.DiagramVO" alias="DiagramVO"/> |
|
59 |
- <typeAlias type="com.takensoft.taken_bi_manager.diagram.vo.NodeVO" alias="NodeVO"/> |
|
60 |
- <typeAlias type="com.takensoft.taken_bi_manager.diagram.vo.EdgeVO" alias="EdgeVO"/> |
|
61 |
- <typeAlias type="com.takensoft.taken_bi_manager.diagram.vo.LogVO" alias="LogVO"/> |
|
62 |
- <typeAlias type="com.takensoft.taken_bi_manager.diagram.vo.LogDetailVO" alias="LogDetailVO"/> |
|
63 |
- <typeAlias type="com.takensoft.taken_bi_manager.diagram.dto.DiagramListDTO" alias="DiagramListDTO"/> |
|
57 |
+ <!-- 스케줄 --> |
|
58 |
+ <typeAlias type="com.takensoft.taken_bi_manager.schedule.vo.ScheduleVO" alias="ScheduleVO"/> |
|
59 |
+ <typeAlias type="com.takensoft.taken_bi_manager.schedule.vo.DiagramVO" alias="DiagramVO"/> |
|
60 |
+ <typeAlias type="com.takensoft.taken_bi_manager.schedule.vo.NodeVO" alias="NodeVO"/> |
|
61 |
+ <typeAlias type="com.takensoft.taken_bi_manager.schedule.dto.NodeDTO" alias="NodeDTO"/> |
|
62 |
+ <typeAlias type="com.takensoft.taken_bi_manager.schedule.dto.NodePositionDTO" alias="NodePositionDTO"/> |
|
63 |
+ <typeAlias type="com.takensoft.taken_bi_manager.schedule.vo.EdgeVO" alias="EdgeVO"/> |
|
64 |
+ <typeAlias type="com.takensoft.taken_bi_manager.schedule.vo.ScheduleLogVO" alias="ScheduleLogVO"/> |
|
65 |
+ <typeAlias type="com.takensoft.taken_bi_manager.schedule.vo.ScheduleLogDetailVO" alias="ScheduleLogDetailVO"/> |
|
64 | 66 |
|
65 | 67 |
<!-- 부서 --> |
66 | 68 |
<typeAlias type="com.takensoft.taken_bi_manager.department.vo.DeptVO" alias="DeptVO"/> |
--- src/main/resources/spring/mapper/postgres/diagram-SQL.xml
... | ... | @@ -1,490 +0,0 @@ |
1 | -<?xml version="1.0" encoding="UTF-8" ?> | |
2 | -<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |
3 | - | |
4 | -<mapper namespace="com.takensoft.taken_bi_manager.diagram.dao.DiagramDAO"> | |
5 | - <!-- 다이어그램으로 로그 조회 --> | |
6 | - <select id="logSelectListAll" parameterType="SearchVO" resultType="LogVO"> | |
7 | - SELECT log_id | |
8 | - , operation_date | |
9 | - , total_node_count | |
10 | - , fail_node_count | |
11 | - , fail_node_name | |
12 | - , state_info | |
13 | - , diagram_id | |
14 | - , user_id | |
15 | - FROM diagram_log_table | |
16 | - WHERE true | |
17 | - <!-- 검색영역 --> | |
18 | - <foreach item="item" index="index" collection="searchObjectList"> | |
19 | - <choose> | |
20 | - <when test="item.key == 'diagram_id'"> | |
21 | - AND diagram_id = #{item.value} | |
22 | - </when> | |
23 | - <when test="item.type == 'dates'"> | |
24 | - AND #{item.value}::timestamp <![CDATA[<=]]> ${item.key}::timestamp | |
25 | - AND ${item.key2}::timestamp <![CDATA[<]]> #{item.value2}::timestamp + INTERVAL '1' DAY | |
26 | - </when> | |
27 | - <when test="item.type == 'string' and item.key == 'state_info' and item.value != null and item.value !=''"> | |
28 | - AND ${item.key} = #{item.value} | |
29 | - </when> | |
30 | - </choose> | |
31 | - </foreach> | |
32 | - <!-- 검색영역 끝 --> | |
33 | - ORDER BY operation_date DESC | |
34 | - LIMIT #{perPage} OFFSET ((#{currentPage} - 1) * #{perPage}) | |
35 | - </select> | |
36 | - <select id="logSelectListCnt" parameterType="SearchVO" resultType="int"> | |
37 | - SELECT COUNT(log_id) | |
38 | - FROM diagram_log_table | |
39 | - WHERE true | |
40 | - <!-- 검색영역 --> | |
41 | - <foreach item="item" index="index" collection="searchObjectList"> | |
42 | - <choose> | |
43 | - <when test="item.key == 'diagram_id'"> | |
44 | - AND diagram_id = #{item.value} | |
45 | - </when> | |
46 | - <when test="item.type == 'dates'"> | |
47 | - AND #{item.value}::timestamp <![CDATA[<=]]> ${item.key}::timestamp | |
48 | - AND ${item.key2}::timestamp <![CDATA[<]]> #{item.value2}::timestamp + INTERVAL '1' DAY | |
49 | - </when> | |
50 | - <when test="item.type == 'string' and item.key == 'state_info' and item.value != null and item.value !=''"> | |
51 | - AND ${item.key} = #{item.value} | |
52 | - </when> | |
53 | - </choose> | |
54 | - </foreach> | |
55 | - <!-- 검색영역 끝 --> | |
56 | - </select> | |
57 | - | |
58 | - | |
59 | - <select id="logSelectListAllID" parameterType="HashMap" resultType="LogVO"> | |
60 | - SELECT log_id | |
61 | - , operation_date | |
62 | - , total_node_count | |
63 | - , fail_node_count | |
64 | - , fail_node_name | |
65 | - , state_info | |
66 | - , diagram_id | |
67 | - , user_id | |
68 | - FROM diagram_log_table | |
69 | - WHERE diagram_id = #{diagram_id} | |
70 | - </select> | |
71 | - | |
72 | - <!-- DatasetId 조회--> | |
73 | - <select id="datasetIdSelect" parameterType="HashMap" resultType="String"> | |
74 | - SELECT dataset_id | |
75 | - FROM dataset | |
76 | - WHERE dataset_post_id = #{dataset_post_id} | |
77 | - </select> | |
78 | - | |
79 | - <!-- 로그 아이디로 디테일 로그 조회--> | |
80 | - <select id="detaillogSelectListAll" parameterType="HashMap" resultType="LogDetailVO"> | |
81 | - SELECT dlt.detail_log_id | |
82 | - , dlt.operation_success_date | |
83 | - , dlt.node_name | |
84 | - , dlt.log_category | |
85 | - , dlt.log_message | |
86 | - , dlt.log_id | |
87 | - , dlt.operation_date | |
88 | - , st.sj | |
89 | - , dlt.creat_id | |
90 | - FROM detail_log_table AS dlt | |
91 | - LEFT JOIN diagram_log_table AS lt | |
92 | - ON dlt.log_id = lt.log_id | |
93 | - LEFT JOIN scheduler AS st | |
94 | - ON st.group_id = lt.diagram_id | |
95 | - WHERE true | |
96 | - <!-- 검색영역 --> | |
97 | - <foreach item="item" index="index" collection="searchObjectList"> | |
98 | - <choose> | |
99 | - <when test="item.key == 'log_id' and item.value != null and item.value !=''"> | |
100 | - AND dlt.log_id = #{item.value} | |
101 | - </when> | |
102 | - <when test="item.type == 'string' and item.key == 'log_category' and item.value != null and item.value !=''"> | |
103 | - AND dlt.log_category = #{item.value} | |
104 | - </when> | |
105 | - </choose> | |
106 | - </foreach> | |
107 | - <!-- 검색영역 끝 --> | |
108 | - ORDER BY operation_date ASC | |
109 | - LIMIT #{perPage} OFFSET ((#{currentPage} - 1) * #{perPage}) | |
110 | - </select> | |
111 | - <select id="detaillogSelectListCnt" parameterType="HashMap" resultType="int"> | |
112 | - SELECT COUNT(dlt.detail_log_id) | |
113 | - FROM detail_log_table AS dlt | |
114 | - LEFT JOIN diagram_log_table AS lt | |
115 | - ON dlt.log_id = lt.log_id | |
116 | - LEFT JOIN scheduler AS st | |
117 | - ON st.group_id = lt.diagram_id | |
118 | - WHERE true | |
119 | - <!-- 검색영역 --> | |
120 | - <foreach item="item" index="index" collection="searchObjectList"> | |
121 | - <choose> | |
122 | - <when test="item.key == 'log_id' and item.value != null and item.value !=''"> | |
123 | - AND dlt.log_id = #{item.value} | |
124 | - </when> | |
125 | - <when test="item.type == 'string' and item.key == 'log_category' and item.value != null and item.value !=''"> | |
126 | - AND dlt.log_category = #{item.value} | |
127 | - </when> | |
128 | - </choose> | |
129 | - </foreach> | |
130 | - <!-- 검색영역 끝 --> | |
131 | - </select> | |
132 | - | |
133 | - <select id="detaillogSelectListAllID" parameterType="HashMap" resultType="LogDetailVO"> | |
134 | - SELECT | |
135 | - dlt.detail_log_id, | |
136 | - dlt.operation_success_date, | |
137 | - dlt.node_name, | |
138 | - dlt.log_category, | |
139 | - dlt.log_message, | |
140 | - st.sj, | |
141 | - st.creat_id, | |
142 | - lt.operation_date | |
143 | - FROM | |
144 | - detail_log_table dlt | |
145 | - JOIN | |
146 | - diagram_log_table lt ON dlt.log_id = lt.log_id | |
147 | - JOIN | |
148 | - diagram_table dt ON dt.diagram_id = lt.diagram_id | |
149 | - JOIN | |
150 | - scheduler st ON st.group_id = dt.diagram_id | |
151 | - WHERE dlt.log_id = #{logId} | |
152 | - </select> | |
153 | - | |
154 | - <!-- 다이어그램 아이디로 NODE리스트를 조회--> | |
155 | - <select id="nodeList" parameterType="String" resultType="NodeVO"> | |
156 | - SELECT DISTINCT | |
157 | - dt.diagram_id | |
158 | - , nt.node_name | |
159 | - , nt.node_type | |
160 | - , nt.itm_id | |
161 | - , nt.center_x | |
162 | - , nt.center_y | |
163 | - , nt.node_state | |
164 | - , nt.flag | |
165 | - , nt.id | |
166 | - , nt.label | |
167 | - , nt."type" | |
168 | - FROM diagram_table AS dt | |
169 | - LEFT JOIN node_table AS nt | |
170 | - ON dt.diagram_id = nt.diagram_id | |
171 | - WHERE dt.diagram_id = #{diagramId} | |
172 | - </select> | |
173 | - | |
174 | - <select id="lineList" parameterType="String" resultType="EdgeVO"> | |
175 | - SELECT edge_id | |
176 | - , source | |
177 | - , target | |
178 | - , diagram_id | |
179 | - FROM edge_table | |
180 | - WHERE diagram_id = #{diagramId} | |
181 | - </select> | |
182 | - | |
183 | - <!-- | |
184 | - 작성자 : 하관우 | |
185 | - 작성일자 : 2024-02-01 | |
186 | - 내용 : 다이어그램 업설트 | |
187 | - --> | |
188 | - <update id="diagramDataInsert" parameterType="DiagramVO" > | |
189 | - INSERT INTO diagram_table( | |
190 | - diagram_id, | |
191 | - creat_dt, | |
192 | - updt_dt, | |
193 | - creat_id, | |
194 | - updt_id | |
195 | - ) VALUES( | |
196 | - #{diagram_id}, | |
197 | - NOW(), | |
198 | - #{updt_dt}, | |
199 | - #{creat_id}, | |
200 | - #{updt_id} | |
201 | - ) | |
202 | - ON CONFLICT(diagram_id) | |
203 | - DO UPDATE | |
204 | - SET | |
205 | - updt_dt = NOW() | |
206 | - , creat_id = #{creat_id} | |
207 | - , updt_id = #{updt_id} | |
208 | - </update> | |
209 | - <!-- | |
210 | - 작성자 : 하관우 | |
211 | - 작성일자 : 2024-02-01 | |
212 | - 내용 : 노드 업설트 | |
213 | - --> | |
214 | - <update id="nodeDataInsert" parameterType="Schedule" > | |
215 | - INSERT INTO node_table( | |
216 | - diagram_id, | |
217 | - node_id, | |
218 | - node_name, | |
219 | - node_type, | |
220 | - itm_id, | |
221 | - center_x, | |
222 | - center_y, | |
223 | - node_state, | |
224 | - flag, | |
225 | - id, | |
226 | - label, | |
227 | - "type" | |
228 | - ) VALUES( | |
229 | - #{diagram_id}, | |
230 | - #{node_id}, | |
231 | - #{node_name}, | |
232 | - #{node_type}, | |
233 | - #{itm_id}, | |
234 | - #{position.x}::DOUBLE PRECISION, | |
235 | - #{position.y}::DOUBLE PRECISION, | |
236 | - #{node_state}, | |
237 | - #{flag}, | |
238 | - #{id}, | |
239 | - #{label}, | |
240 | - #{type} | |
241 | - ) | |
242 | - ON CONFLICT(node_id) | |
243 | - DO UPDATE | |
244 | - SET diagram_id = #{diagram_id} | |
245 | - , node_name = #{node_name} | |
246 | - , node_type = #{node_type} | |
247 | - , itm_id = #{itm_id} | |
248 | - , center_x = #{position.x}::DOUBLE PRECISION | |
249 | - , center_y = #{position.y}::DOUBLE PRECISION | |
250 | - , node_state = #{node_state} | |
251 | - , flag = #{flag} | |
252 | - , id = #{id} | |
253 | - , label = #{label} | |
254 | - , "type" = #{type} | |
255 | - </update> | |
256 | - <!-- | |
257 | - 작성자 : 하관우 | |
258 | - 작성일자 : 2024-02-01 | |
259 | - 내용 : 선 업설트 | |
260 | - --> | |
261 | - <update id="lineDataInsert" parameterType="EdgeVO" > | |
262 | - INSERT INTO edge_table( | |
263 | - edge_id, | |
264 | - source, | |
265 | - target, | |
266 | - diagram_id | |
267 | - ) VALUES( | |
268 | - #{edge_id}, | |
269 | - #{source}, | |
270 | - #{target}, | |
271 | - #{diagram_id} | |
272 | - ) | |
273 | - ON CONFLICT(edge_id) | |
274 | - DO UPDATE | |
275 | - SET source = #{source} | |
276 | - , target = #{target} | |
277 | - , diagram_id = #{diagram_id} | |
278 | - </update> | |
279 | - | |
280 | - <!-- | |
281 | - 작성자 : 하관우 | |
282 | - 작성일자 : 2024-02-01 | |
283 | - 내용 : 로그 인설트 | |
284 | - --> | |
285 | - <insert id="logDataInsert" parameterType="LogVO" > | |
286 | - INSERT INTO diagram_log_table( | |
287 | - log_id, | |
288 | - operation_date, | |
289 | - total_node_count, | |
290 | - fail_node_count, | |
291 | - fail_node_name, | |
292 | - state_info, | |
293 | - diagram_id, | |
294 | - user_id | |
295 | - ) VALUES( | |
296 | - #{log_id}, | |
297 | - NOW(), | |
298 | - #{total_node_count}, | |
299 | - #{fail_node_count}, | |
300 | - #{fail_node_name}, | |
301 | - #{state_info}, | |
302 | - #{diagram_id}, | |
303 | - #{user_id} | |
304 | - ) | |
305 | - </insert> | |
306 | - | |
307 | - <!-- | |
308 | - 작성자 : 하관우 | |
309 | - 작성일자 : 2024-09-03 | |
310 | - 내용 : 로그 업데이트 | |
311 | - --> | |
312 | - <update id="logDataUpdate" parameterType="LogVO"> | |
313 | - UPDATE diagram_log_table | |
314 | - SET | |
315 | - operation_date = NOW(), | |
316 | - total_node_count = #{total_node_count}, | |
317 | - fail_node_count = #{fail_node_count}, | |
318 | - fail_node_name = #{fail_node_name}, | |
319 | - state_info = #{state_info}, | |
320 | - user_id = #{user_id} | |
321 | - WHERE | |
322 | - log_id = #{log_id} | |
323 | -</update> | |
324 | - | |
325 | - <!-- | |
326 | - 작성자 : 하관우 | |
327 | - 작성일자 : 2024-02-01 | |
328 | - 내용 : 로그 디테일 인설트 | |
329 | - --> | |
330 | - <insert id="logDetailDataInsert" parameterType="LogDetailVO" > | |
331 | - INSERT INTO detail_log_table( | |
332 | - detail_log_id | |
333 | - , operation_success_date | |
334 | - , node_name | |
335 | - , log_category | |
336 | - , log_message | |
337 | - , log_id | |
338 | - , operation_date | |
339 | - , sj | |
340 | - , creat_id | |
341 | - ) VALUES( | |
342 | - #{detail_log_id} | |
343 | - , now() | |
344 | - , #{node_name} | |
345 | - , #{log_category} | |
346 | - , #{log_message} | |
347 | - , #{log_id} | |
348 | - , #{operation_date} | |
349 | - , #{sj} | |
350 | - , #{creat_id} | |
351 | - ) | |
352 | - </insert> | |
353 | - | |
354 | - <!-- 다이어그램 ID로 노드 삭제--> | |
355 | - <delete id="nodeDelete" parameterType="String"> | |
356 | - DELETE FROM node_table | |
357 | - WHERE diagram_id = #{diagram_id} | |
358 | - </delete> | |
359 | - | |
360 | - <!-- 노드 ID로 노드 삭제--> | |
361 | - <delete id="nodeIdDelete" parameterType="String"> | |
362 | - DELETE FROM node_table | |
363 | - WHERE node_id = #{node_id} | |
364 | - </delete> | |
365 | - | |
366 | - <!-- 다이어그램 ID로 라인 삭제--> | |
367 | - <delete id="edgeDelete" parameterType="String"> | |
368 | - DELETE FROM edge_table | |
369 | - WHERE diagram_id = #{diagram_id} | |
370 | - </delete> | |
371 | - | |
372 | - <!-- 라인 ID로 라인 삭제--> | |
373 | - <delete id="edgeIdDelete" parameterType="String"> | |
374 | - DELETE FROM edge_table | |
375 | - WHERE edge_id = #{edge_id} | |
376 | - </delete> | |
377 | - | |
378 | - <!-- 다이어그램 ID로 다이어그램 삭제--> | |
379 | - <delete id="diagramDelete" parameterType="String"> | |
380 | - DELETE FROM diagram_table | |
381 | - WHERE diagram_id = #{group_id} | |
382 | - </delete> | |
383 | - | |
384 | - <!-- 다이어그램 ID로 로그 삭제--> | |
385 | - <delete id="logDelete" parameterType="String"> | |
386 | - DELETE FROM diagram_log_table | |
387 | - WHERE diagram_id = #{diagram_id} | |
388 | - </delete> | |
389 | - | |
390 | - <!-- 로그 ID로 디테일 로그 삭제--> | |
391 | - <delete id="logDetailDelete" parameterType="String"> | |
392 | - DELETE FROM detail_log_table | |
393 | - WHERE log_id = #{log_id} | |
394 | - </delete> | |
395 | - | |
396 | - <!-- 다이어그램 ID로 노드 ID 찾기--> | |
397 | - <select id="nodeSelectId" parameterType="String" resultType="String"> | |
398 | - SELECT node_id | |
399 | - FROM node_table | |
400 | - WHERE diagram_id = #{diagram_id} | |
401 | - </select> | |
402 | - | |
403 | - <!-- 스케줄 ID로 그룹 ID 찾기--> | |
404 | - <select id="ScheduleIdToGroubId" parameterType="String" resultType="String"> | |
405 | - SELECT group_id | |
406 | - FROM scheduler | |
407 | - WHERE schdul_id = #{schdul_id} | |
408 | - </select> | |
409 | - | |
410 | - <!-- 다이어그램 ID로 라인 ID 찾기--> | |
411 | - <select id="edgeSelectId" parameterType="String" resultType="String"> | |
412 | - SELECT edge_id | |
413 | - FROM edge_table | |
414 | - WHERE diagram_id = #{diagram_id} | |
415 | - </select> | |
416 | - | |
417 | - <!--노드 삭제를 위한 것(끝)--> | |
418 | - <sql id="listSearch"> | |
419 | - <foreach item="item" index="index" collection="searchObjectList"> | |
420 | - <choose> | |
421 | - <!-- 날짜 검색 --> | |
422 | - <when test="item.type == 'dates'"> | |
423 | - AND #{item.value}::timestamp <![CDATA[<=]]> dt.${item.key}::timestamp | |
424 | - AND dt.${item.key2}::timestamp <![CDATA[<]]> #{item.value2}::timestamp + INTERVAL '1' DAY | |
425 | - </when> | |
426 | - <!-- 상태 검색 --> | |
427 | - <when test="item.type == 'string' and item.key == 'schdul_sttus' and item.value != null and item.value !=''"> | |
428 | - AND sch.${item.key} = #{item.value} | |
429 | - </when> | |
430 | - <!-- 일반 검색 --> | |
431 | - <when test="item.type == 'string' and item.value != null and item.value !=''"> | |
432 | - <choose> | |
433 | - <when test="item.key != null and item.value != ''"> | |
434 | - <if test="item.key == 'sj'"> | |
435 | - AND sch.sj LIKE CONCAT('%', #{item.value}, '%') | |
436 | - </if> | |
437 | - <if test="item.key == 'creat_id'"> | |
438 | - AND dt.creat_id LIKE CONCAT('%', #{item.value}, '%') | |
439 | - </if> | |
440 | - </when> | |
441 | - <otherwise> | |
442 | - AND (sch.sj LIKE '%' || #{item.value} || '%' OR dt.creat_id LIKE '%' || #{item.value} || '%') | |
443 | - </otherwise> | |
444 | - </choose> | |
445 | - </when> | |
446 | - </choose> | |
447 | - </foreach> | |
448 | - </sql> | |
449 | - <!-- // SELECT SQL --> | |
450 | - | |
451 | - <select id="diagramListRead" parameterType="SearchVO" resultType="DiagramListDTO"> | |
452 | - SELECT sch.schdul_id | |
453 | - , dt.diagram_id | |
454 | - , sch.sj AS diagram_nm | |
455 | - , dt.creat_id | |
456 | - , sch.cron_chrctr | |
457 | - , dt.creat_dt | |
458 | - , sch.schdul_sttus | |
459 | - FROM diagram_table AS dt | |
460 | - LEFT JOIN scheduler AS sch | |
461 | - ON dt.diagram_id = sch.group_id | |
462 | - WHERE sch.use_at = true | |
463 | - <include refid="listSearch" /> | |
464 | - ORDER BY creat_dt DESC | |
465 | - LIMIT #{perPage} OFFSET ((#{currentPage} - 1) * #{perPage}) | |
466 | - </select> | |
467 | - | |
468 | - <select id="diagramListCountRead" parameterType="SearchVO" resultType="Integer"> | |
469 | - SELECT count(dt.diagram_id) | |
470 | - FROM diagram_table AS dt | |
471 | - LEFT JOIN scheduler AS sch | |
472 | - ON dt.diagram_id = sch.group_id | |
473 | - WHERE sch.use_at = true | |
474 | - <include refid="listSearch" /> | |
475 | - </select> | |
476 | - | |
477 | - | |
478 | - <select id="diagramDetailRead" parameterType="String" resultType="DiagramVO"> | |
479 | - SELECT dt.diagram_id | |
480 | - , sch.sj AS diagram_nm | |
481 | - , dt.creat_dt | |
482 | - , dt.creat_id | |
483 | - , dt.updt_dt | |
484 | - , dt.updt_id | |
485 | - FROM diagram_table AS dt | |
486 | - LEFT JOIN scheduler AS sch | |
487 | - ON dt.diagram_id = sch.group_id | |
488 | - WHERE diagram_id = #{diagramId} | |
489 | - </select> | |
490 | -</mapper>(파일 끝에 줄바꿈 문자 없음) |
+++ src/main/resources/spring/mapper/schedule/diagram-SQL.xml
... | ... | @@ -0,0 +1,271 @@ |
1 | +<?xml version="1.0" encoding="UTF-8" ?> | |
2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |
3 | +<mapper namespace="com.takensoft.taken_bi_manager.schedule.dao.DiagramDAO"> | |
4 | + <!-- 스케줄 resultMap --> | |
5 | + <resultMap id="DiagramResult" type="DiagramVO"> | |
6 | + <result property="schdulId" column="schdul_id"/> | |
7 | + <result property="groupId" column="group_id"/> | |
8 | + <result property="schdulSj" column="schdul_sj"/> | |
9 | + <result property="schdulCn" column="schdul_cn"/> | |
10 | + <result property="cron" column="cron"/> | |
11 | + <result property="cronChrctr" column="cron_chrctr"/> | |
12 | + <result property="schdulSttus" column="schdul_sttus"/> | |
13 | + <result property="cycleAt" column="cycle_at"/> | |
14 | + <result property="useAt" column="use_at"/> | |
15 | + <result property="creatId" column="creat_id"/> | |
16 | + <result property="creatDt" column="creat_dt"/> | |
17 | + <result property="updtId" column="updt_id"/> | |
18 | + <result property="updtDt" column="updt_dt"/> | |
19 | + </resultMap> | |
20 | + | |
21 | + <!-- 노드 목록 조회 --> | |
22 | + <select id="nodeList" parameterType="String" resultType="NodeVO"> | |
23 | + SELECT DISTINCT | |
24 | + dt.diagram_id | |
25 | + , nt.node_name | |
26 | + , nt.node_type | |
27 | + , nt.itm_id | |
28 | + , nt.center_x | |
29 | + , nt.center_y | |
30 | + , nt.node_state | |
31 | + , nt.flag | |
32 | + , nt.id | |
33 | + , nt.label | |
34 | + , nt."type" | |
35 | + FROM diagram_info AS dt | |
36 | + LEFT JOIN diagram_node AS nt | |
37 | + ON dt.diagram_id = nt.diagram_id | |
38 | + WHERE dt.diagram_id = #{diagramId} | |
39 | + </select> | |
40 | + | |
41 | + <select id="lineList" parameterType="String" resultType="EdgeVO"> | |
42 | + SELECT edge_id | |
43 | + , source | |
44 | + , target | |
45 | + , diagram_id | |
46 | + FROM diagram_edge | |
47 | + WHERE diagram_id = #{diagramId} | |
48 | + </select> | |
49 | + | |
50 | + <!-- | |
51 | + 작성자 : 하관우 | |
52 | + 작성일자 : 2024-02-01 | |
53 | + 내용 : 다이어그램 업설트 | |
54 | + --> | |
55 | + <update id="diagramDataInsert" parameterType="DiagramVO" > | |
56 | + INSERT INTO diagram_info( | |
57 | + diagram_id, | |
58 | + creat_dt, | |
59 | + updt_dt, | |
60 | + creat_id, | |
61 | + updt_id | |
62 | + ) VALUES( | |
63 | + #{diagram_id}, | |
64 | + NOW(), | |
65 | + #{updt_dt}, | |
66 | + #{creat_id}, | |
67 | + #{updt_id} | |
68 | + ) | |
69 | + ON CONFLICT(diagram_id) | |
70 | + DO UPDATE | |
71 | + SET | |
72 | + updt_dt = NOW() | |
73 | + , creat_id = #{creat_id} | |
74 | + , updt_id = #{updt_id} | |
75 | + </update> | |
76 | + <!-- | |
77 | + 작성자 : 하관우 | |
78 | + 작성일자 : 2024-02-01 | |
79 | + 내용 : 노드 업설트 | |
80 | + --> | |
81 | + <update id="nodeDataInsert" parameterType="ScheduleVO" > | |
82 | + INSERT INTO diagram_node( | |
83 | + diagram_id, | |
84 | + node_id, | |
85 | + node_name, | |
86 | + node_type, | |
87 | + itm_id, | |
88 | + center_x, | |
89 | + center_y, | |
90 | + node_state, | |
91 | + flag, | |
92 | + id, | |
93 | + label, | |
94 | + "type" | |
95 | + ) VALUES( | |
96 | + #{diagram_id}, | |
97 | + #{node_id}, | |
98 | + #{node_name}, | |
99 | + #{node_type}, | |
100 | + #{itm_id}, | |
101 | + #{position.x}::DOUBLE PRECISION, | |
102 | + #{position.y}::DOUBLE PRECISION, | |
103 | + #{node_state}, | |
104 | + #{flag}, | |
105 | + #{id}, | |
106 | + #{label}, | |
107 | + #{type} | |
108 | + ) | |
109 | + ON CONFLICT(node_id) | |
110 | + DO UPDATE | |
111 | + SET diagram_id = #{diagram_id} | |
112 | + , node_name = #{node_name} | |
113 | + , node_type = #{node_type} | |
114 | + , itm_id = #{itm_id} | |
115 | + , center_x = #{position.x}::DOUBLE PRECISION | |
116 | + , center_y = #{position.y}::DOUBLE PRECISION | |
117 | + , node_state = #{node_state} | |
118 | + , flag = #{flag} | |
119 | + , id = #{id} | |
120 | + , label = #{label} | |
121 | + , "type" = #{type} | |
122 | + </update> | |
123 | + <!-- | |
124 | + 작성자 : 하관우 | |
125 | + 작성일자 : 2024-02-01 | |
126 | + 내용 : 선 업설트 | |
127 | + --> | |
128 | + <update id="lineDataInsert" parameterType="EdgeVO" > | |
129 | + INSERT INTO diagram_edge( | |
130 | + edge_id, | |
131 | + source, | |
132 | + target, | |
133 | + diagram_id | |
134 | + ) VALUES( | |
135 | + #{edge_id}, | |
136 | + #{source}, | |
137 | + #{target}, | |
138 | + #{diagram_id} | |
139 | + ) | |
140 | + ON CONFLICT(edge_id) | |
141 | + DO UPDATE | |
142 | + SET source = #{source} | |
143 | + , target = #{target} | |
144 | + , diagram_id = #{diagram_id} | |
145 | + </update> | |
146 | + | |
147 | + <!-- 다이어그램 ID로 노드 삭제--> | |
148 | + <delete id="nodeDelete" parameterType="String"> | |
149 | + DELETE FROM diagram_node | |
150 | + WHERE diagram_id = #{diagram_id} | |
151 | + </delete> | |
152 | + | |
153 | + <!-- 노드 ID로 노드 삭제--> | |
154 | + <delete id="nodeIdDelete" parameterType="String"> | |
155 | + DELETE FROM diagram_node | |
156 | + WHERE node_id = #{node_id} | |
157 | + </delete> | |
158 | + | |
159 | + <!-- 다이어그램 ID로 라인 삭제--> | |
160 | + <delete id="edgeDelete" parameterType="String"> | |
161 | + DELETE FROM diagram_edge | |
162 | + WHERE diagram_id = #{diagram_id} | |
163 | + </delete> | |
164 | + | |
165 | + <!-- 라인 ID로 라인 삭제--> | |
166 | + <delete id="edgeIdDelete" parameterType="String"> | |
167 | + DELETE FROM diagram_edge | |
168 | + WHERE edge_id = #{edge_id} | |
169 | + </delete> | |
170 | + | |
171 | + <!-- 다이어그램 ID로 다이어그램 삭제--> | |
172 | + <delete id="diagramDelete" parameterType="String"> | |
173 | + DELETE FROM diagram_info | |
174 | + WHERE diagram_id = #{group_id} | |
175 | + </delete> | |
176 | + | |
177 | + <!-- 다이어그램 ID로 노드 ID 찾기--> | |
178 | + <select id="nodeSelectId" parameterType="String" resultType="String"> | |
179 | + SELECT node_id | |
180 | + FROM diagram_node | |
181 | + WHERE diagram_id = #{diagram_id} | |
182 | + </select> | |
183 | + | |
184 | + <!-- 스케줄 ID로 그룹 ID 찾기--> | |
185 | + <select id="ScheduleIdToGroubId" parameterType="String" resultType="String"> | |
186 | + SELECT group_id | |
187 | + FROM schdul_info | |
188 | + WHERE schdul_id = #{schdul_id} | |
189 | + </select> | |
190 | + | |
191 | + <!-- 다이어그램 ID로 라인 ID 찾기--> | |
192 | + <select id="edgeSelectId" parameterType="String" resultType="String"> | |
193 | + SELECT edge_id | |
194 | + FROM diagram_edge | |
195 | + WHERE diagram_id = #{diagram_id} | |
196 | + </select> | |
197 | + | |
198 | + <!--노드 삭제를 위한 것(끝)--> | |
199 | + <sql id="listSearch"> | |
200 | + <foreach item="item" index="index" collection="searchObjectList"> | |
201 | + <choose> | |
202 | + <!-- 날짜 검색 --> | |
203 | + <when test="item.type == 'dates'"> | |
204 | + AND #{item.value}::timestamp <![CDATA[<=]]> dt.${item.key}::timestamp | |
205 | + AND dt.${item.key2}::timestamp <![CDATA[<]]> #{item.value2}::timestamp + INTERVAL '1' DAY | |
206 | + </when> | |
207 | + <!-- 상태 검색 --> | |
208 | + <when test="item.type == 'string' and item.key == 'schdul_sttus' and item.value != null and item.value !=''"> | |
209 | + AND sch.${item.key} = #{item.value} | |
210 | + </when> | |
211 | + <!-- 일반 검색 --> | |
212 | + <when test="item.type == 'string' and item.value != null and item.value !=''"> | |
213 | + <choose> | |
214 | + <when test="item.key != null and item.value != ''"> | |
215 | + <if test="item.key == 'sj'"> | |
216 | + AND sch.sj LIKE CONCAT('%', #{item.value}, '%') | |
217 | + </if> | |
218 | + <if test="item.key == 'creat_id'"> | |
219 | + AND dt.creat_id LIKE CONCAT('%', #{item.value}, '%') | |
220 | + </if> | |
221 | + </when> | |
222 | + <otherwise> | |
223 | + AND (sch.sj LIKE '%' || #{item.value} || '%' OR dt.creat_id LIKE '%' || #{item.value} || '%') | |
224 | + </otherwise> | |
225 | + </choose> | |
226 | + </when> | |
227 | + </choose> | |
228 | + </foreach> | |
229 | + </sql> | |
230 | + <!-- // SELECT SQL --> | |
231 | + | |
232 | + <select id="diagramListRead" parameterType="SearchVO"> | |
233 | + SELECT sch.schdul_id | |
234 | + , dt.diagram_id | |
235 | + , sch.sj AS diagram_nm | |
236 | + , dt.creat_id | |
237 | + , sch.cron_chrctr | |
238 | + , dt.creat_dt | |
239 | + , sch.schdul_sttus | |
240 | + FROM diagram_info AS dt | |
241 | + LEFT JOIN schdul_info AS sch | |
242 | + ON dt.diagram_id = sch.group_id | |
243 | + WHERE sch.use_at = true | |
244 | + <include refid="listSearch" /> | |
245 | + ORDER BY creat_dt DESC | |
246 | + LIMIT #{perPage} OFFSET ((#{currentPage} - 1) * #{perPage}) | |
247 | + </select> | |
248 | + | |
249 | + <select id="diagramListCountRead" parameterType="SearchVO" resultType="Integer"> | |
250 | + SELECT count(dt.diagram_id) | |
251 | + FROM diagram_info AS dt | |
252 | + LEFT JOIN schdul_info AS sch | |
253 | + ON dt.diagram_id = sch.group_id | |
254 | + WHERE sch.use_at = true | |
255 | + <include refid="listSearch" /> | |
256 | + </select> | |
257 | + | |
258 | + | |
259 | + <select id="diagramDetailRead" parameterType="String" resultType="DiagramVO"> | |
260 | + SELECT dt.diagram_id | |
261 | + , sch.sj AS diagram_nm | |
262 | + , dt.creat_dt | |
263 | + , dt.creat_id | |
264 | + , dt.updt_dt | |
265 | + , dt.updt_id | |
266 | + FROM diagram_info AS dt | |
267 | + LEFT JOIN schdul_info AS sch | |
268 | + ON dt.diagram_id = sch.group_id | |
269 | + WHERE diagram_id = #{diagramId} | |
270 | + </select> | |
271 | +</mapper>(파일 끝에 줄바꿈 문자 없음) |
+++ src/main/resources/spring/mapper/schedule/schedule-SQL.xml
... | ... | @@ -0,0 +1,157 @@ |
1 | +<?xml version="1.0" encoding="UTF-8" ?> | |
2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |
3 | +<mapper namespace="com.takensoft.taken_bi_manager.schedule.dao.ScheduleDAO"> | |
4 | + <!-- 스케줄 resultMap --> | |
5 | + <resultMap id="schdulResult" type="ScheduleVO"> | |
6 | + <result property="schdulId" column="schdul_id"/> | |
7 | + <result property="groupId" column="group_id"/> | |
8 | + <result property="schdulSj" column="schdul_sj"/> | |
9 | + <result property="schdulCn" column="schdul_cn"/> | |
10 | + <result property="schdulType" column="schdul_type"/> | |
11 | + <result property="cron" column="cron"/> | |
12 | + <result property="cronChrctr" column="cron_chrctr"/> | |
13 | + <result property="schdulSttus" column="schdul_sttus"/> | |
14 | + <result property="cycleAt" column="cycle_at"/> | |
15 | + <result property="useAt" column="use_at"/> | |
16 | + <result property="creatId" column="creat_id"/> | |
17 | + <result property="creatDt" column="creat_dt"/> | |
18 | + <result property="updtId" column="updt_id"/> | |
19 | + <result property="updtDt" column="updt_dt"/> | |
20 | + </resultMap> | |
21 | + | |
22 | + <!-- 스케줄 조회 --> | |
23 | + <sql id="scheduleSelect"> | |
24 | + SELECT schdul_id | |
25 | + , group_id | |
26 | + , schdul_sj | |
27 | + , schdul_cn | |
28 | + , schdul_type | |
29 | + , cron | |
30 | + , cron_chrctr | |
31 | + , schdul_sttus | |
32 | + , cycle_at | |
33 | + , use_at | |
34 | + , creat_id | |
35 | + , creat_dt | |
36 | + , updt_id | |
37 | + , updt_dt | |
38 | + FROM schdul_info | |
39 | + </sql> | |
40 | + | |
41 | + <!-- 스케줄 목록 조회 --> | |
42 | + <select id="selectScheduleList" parameterType="SearchVO" resultMap="schdulResult"> | |
43 | + <include refid="scheduleSelect" /> | |
44 | + WHERE use_at = true | |
45 | + <!-- 검색영역 --> | |
46 | + <foreach item="item" index="index" collection="searchObjectList"> | |
47 | + <choose> | |
48 | + <!-- 날짜 검색 --> | |
49 | + <when test="item.type == 'dates'"> | |
50 | + AND #{item.value}::timestamp <![CDATA[<=]]> ${item.key}::timestamp | |
51 | + AND ${item.key2}::timestamp <![CDATA[<]]> #{item.value2}::timestamp + INTERVAL '1' DAY | |
52 | + </when> | |
53 | + <!-- 상태 검색 --> | |
54 | + <when test="item.type == 'string' and item.key == 'schdul_sttus' and item.value != null and item.value !=''"> | |
55 | + AND ${item.key} = #{item.value} | |
56 | + </when> | |
57 | + <!-- 일반 검색 --> | |
58 | + <when test="item.type == 'string' and item.key != null and item.key != '' and item.value != null and item.value !=''"> | |
59 | + AND ${item.key} LIKE CONCAT('%', #{item.value}, '%') | |
60 | + </when> | |
61 | + </choose> | |
62 | + </foreach> | |
63 | + <!-- 검색영역 끝 --> | |
64 | + ORDER BY creat_dt DESC | |
65 | + LIMIT #{perPage} OFFSET ((#{currentPage} - 1) * #{perPage}) | |
66 | + </select> | |
67 | + | |
68 | + <!-- 스케줄 전체 개수 조회 --> | |
69 | + <select id="selectScheduleCount" parameterType="SearchVO"> | |
70 | + SELECT count(*) | |
71 | + FROM schdul_info | |
72 | + WHERE use_at = true | |
73 | + <!-- 검색영역 --> | |
74 | + <foreach item="item" index="index" collection="searchObjectList"> | |
75 | + <choose> | |
76 | + <!-- 날짜 검색 --> | |
77 | + <when test="item.type == 'dates'"> | |
78 | + AND #{item.value}::timestamp <![CDATA[<=]]> ${item.key}::timestamp | |
79 | + AND ${item.key2}::timestamp <![CDATA[<]]> #{item.value2}::timestamp + INTERVAL '1' DAY | |
80 | + </when> | |
81 | + <!-- 상태 검색 --> | |
82 | + <when test="item.type == 'string' and item.key == 'schdul_sttus' and item.value != null and item.value !=''"> | |
83 | + AND ${item.key} = #{item.value} | |
84 | + </when> | |
85 | + <!-- 일반 검색 --> | |
86 | + <when test="item.type == 'string' and item.key != null and item.key != '' and item.value != null and item.value !=''"> | |
87 | + AND ${item.key} LIKE CONCAT('%', #{item.value}, '%') | |
88 | + </when> | |
89 | + </choose> | |
90 | + </foreach> | |
91 | + <!-- 검색영역 끝 --> | |
92 | + </select> | |
93 | + | |
94 | + <!-- 스케줄 업설트 --> | |
95 | + <update id="insertSchedule" parameterType="ScheduleVO" > | |
96 | + INSERT INTO schdul_info ( | |
97 | + schdul_id | |
98 | + , group_id | |
99 | + , schdul_sj | |
100 | + , schdul_cn | |
101 | + , schdul_type | |
102 | + , cron | |
103 | + , cron_chrctr | |
104 | + , schdul_sttus | |
105 | + , cycle_at | |
106 | + , use_at | |
107 | + , creat_id | |
108 | + , creat_dt | |
109 | + ) VALUES ( | |
110 | + #{schdulId} | |
111 | + , #{groupId} | |
112 | + , #{schdulSj} | |
113 | + , #{schdulCn} | |
114 | + , #{schdulType} | |
115 | + , #{cron} | |
116 | + , #{cronChrctr} | |
117 | + , #{schdulSttus} | |
118 | + , #{cycleAt} | |
119 | + , #{useAt} | |
120 | + , #{creatId} | |
121 | + , NOW() | |
122 | + ) | |
123 | + ON CONFLICT(schdul_id) | |
124 | + DO UPDATE | |
125 | + SET group_id = #{group_id} | |
126 | + , schdul_sj = #{schdulSj} | |
127 | + , schdul_cn = #{schdulCn} | |
128 | + , cron = #{cron} | |
129 | + , cron_chrctr = #{cronChrctr} | |
130 | + , schdul_sttus = #{schdulSttus} | |
131 | + , cycle_at = #{cycleAt} | |
132 | + , use_at = #{useAt} | |
133 | + , updt_id = #{updtId} | |
134 | + , updt_dt = NOW() | |
135 | + </update> | |
136 | + | |
137 | + <!-- 스케줄 단건 조회 --> | |
138 | + <select id="selectSchedule" parameterType="String" resultType="ScheduleVO"> | |
139 | + <include refid="scheduleSelect" /> | |
140 | + WHERE use_at = true | |
141 | + AND schdul_id = #{schdul_id} | |
142 | + </select> | |
143 | + | |
144 | + <!-- 스케줄 정보 삭제 --> | |
145 | + <update id="deleteSchedule" parameterType="String"> | |
146 | + UPDATE schdul_info | |
147 | + SET use_at = false | |
148 | + WHERE schdul_id = #{schdulId} | |
149 | + </update> | |
150 | + | |
151 | + <!-- 스케줄 상태 변경 --> | |
152 | + <update id="scheduleSttusChange" parameterType="HashMap"> | |
153 | + UPDATE schdul_info | |
154 | + SET schdul_sttus = #{schdulSttus} | |
155 | + WHERE schdul_id = #{schdulId} | |
156 | + </update> | |
157 | +</mapper>(파일 끝에 줄바꿈 문자 없음) |
+++ src/main/resources/spring/mapper/schedule/scheduleLog-SQL.xml
... | ... | @@ -0,0 +1,248 @@ |
1 | +<?xml version="1.0" encoding="UTF-8" ?> | |
2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |
3 | +<mapper namespace="com.takensoft.taken_bi_manager.schedule.dao.DiagramDAO"> | |
4 | + <!-- 스케줄 resultMap --> | |
5 | + <resultMap id="schdulResult" type="ScheduleVO"> | |
6 | + <result property="schdulId" column="schdul_id"/> | |
7 | + <result property="groupId" column="group_id"/> | |
8 | + <result property="schdulSj" column="schdul_sj"/> | |
9 | + <result property="schdulCn" column="schdul_cn"/> | |
10 | + <result property="cron" column="cron"/> | |
11 | + <result property="cronChrctr" column="cron_chrctr"/> | |
12 | + <result property="schdulSttus" column="schdul_sttus"/> | |
13 | + <result property="cycleAt" column="cycle_at"/> | |
14 | + <result property="useAt" column="use_at"/> | |
15 | + <result property="creatId" column="creat_id"/> | |
16 | + <result property="creatDt" column="creat_dt"/> | |
17 | + <result property="updtId" column="updt_id"/> | |
18 | + <result property="updtDt" column="updt_dt"/> | |
19 | + </resultMap> | |
20 | + | |
21 | + <!-- 다이어그램으로 로그 조회 --> | |
22 | + <select id="logSelectListAll" parameterType="SearchVO" resultType="ScheduleLogVO"> | |
23 | + SELECT log_id | |
24 | + , operation_date | |
25 | + , total_node_count | |
26 | + , fail_node_count | |
27 | + , fail_node_name | |
28 | + , state_info | |
29 | + , diagram_id | |
30 | + , user_id | |
31 | + FROM diagram_lg | |
32 | + WHERE true | |
33 | + <!-- 검색영역 --> | |
34 | + <foreach item="item" index="index" collection="searchObjectList"> | |
35 | + <choose> | |
36 | + <when test="item.key == 'diagram_id'"> | |
37 | + AND diagram_id = #{item.value} | |
38 | + </when> | |
39 | + <when test="item.type == 'dates'"> | |
40 | + AND #{item.value}::timestamp <![CDATA[<=]]> ${item.key}::timestamp | |
41 | + AND ${item.key2}::timestamp <![CDATA[<]]> #{item.value2}::timestamp + INTERVAL '1' DAY | |
42 | + </when> | |
43 | + <when test="item.type == 'string' and item.key == 'state_info' and item.value != null and item.value !=''"> | |
44 | + AND ${item.key} = #{item.value} | |
45 | + </when> | |
46 | + </choose> | |
47 | + </foreach> | |
48 | + <!-- 검색영역 끝 --> | |
49 | + ORDER BY operation_date DESC | |
50 | + LIMIT #{perPage} OFFSET ((#{currentPage} - 1) * #{perPage}) | |
51 | + </select> | |
52 | + | |
53 | + <select id="logSelectListCnt" parameterType="SearchVO" resultType="int"> | |
54 | + SELECT COUNT(log_id) | |
55 | + FROM diagram_lg | |
56 | + WHERE true | |
57 | + <!-- 검색영역 --> | |
58 | + <foreach item="item" index="index" collection="searchObjectList"> | |
59 | + <choose> | |
60 | + <when test="item.key == 'diagram_id'"> | |
61 | + AND diagram_id = #{item.value} | |
62 | + </when> | |
63 | + <when test="item.type == 'dates'"> | |
64 | + AND #{item.value}::timestamp <![CDATA[<=]]> ${item.key}::timestamp | |
65 | + AND ${item.key2}::timestamp <![CDATA[<]]> #{item.value2}::timestamp + INTERVAL '1' DAY | |
66 | + </when> | |
67 | + <when test="item.type == 'string' and item.key == 'state_info' and item.value != null and item.value !=''"> | |
68 | + AND ${item.key} = #{item.value} | |
69 | + </when> | |
70 | + </choose> | |
71 | + </foreach> | |
72 | + <!-- 검색영역 끝 --> | |
73 | + </select> | |
74 | + | |
75 | + <select id="logSelectListAllID" parameterType="HashMap" resultType="ScheduleLogVO"> | |
76 | + SELECT log_id | |
77 | + , operation_date | |
78 | + , total_node_count | |
79 | + , fail_node_count | |
80 | + , fail_node_name | |
81 | + , state_info | |
82 | + , diagram_id | |
83 | + , user_id | |
84 | + FROM diagram_lg | |
85 | + WHERE diagram_id = #{diagram_id} | |
86 | + </select> | |
87 | + | |
88 | + <!-- 로그 아이디로 디테일 로그 조회--> | |
89 | + <select id="detaillogSelectListAll" parameterType="HashMap" resultType="ScheduleLogDetailVO"> | |
90 | + SELECT dlt.detail_log_id | |
91 | + , dlt.operation_success_date | |
92 | + , dlt.node_name | |
93 | + , dlt.log_category | |
94 | + , dlt.log_message | |
95 | + , dlt.log_id | |
96 | + , dlt.operation_date | |
97 | + , st.sj | |
98 | + , dlt.creat_id | |
99 | + FROM diagram_lg_detail AS dlt | |
100 | + LEFT JOIN diagram_lg AS lt | |
101 | + ON dlt.log_id = lt.log_id | |
102 | + LEFT JOIN schdul_info AS st | |
103 | + ON st.group_id = lt.diagram_id | |
104 | + WHERE true | |
105 | + <!-- 검색영역 --> | |
106 | + <foreach item="item" index="index" collection="searchObjectList"> | |
107 | + <choose> | |
108 | + <when test="item.key == 'log_id' and item.value != null and item.value !=''"> | |
109 | + AND dlt.log_id = #{item.value} | |
110 | + </when> | |
111 | + <when test="item.type == 'string' and item.key == 'log_category' and item.value != null and item.value !=''"> | |
112 | + AND dlt.log_category = #{item.value} | |
113 | + </when> | |
114 | + </choose> | |
115 | + </foreach> | |
116 | + <!-- 검색영역 끝 --> | |
117 | + ORDER BY operation_date ASC | |
118 | + LIMIT #{perPage} OFFSET ((#{currentPage} - 1) * #{perPage}) | |
119 | + </select> | |
120 | + <select id="detaillogSelectListCnt" parameterType="HashMap" resultType="int"> | |
121 | + SELECT COUNT(dlt.detail_log_id) | |
122 | + FROM diagram_lg_detail AS dlt | |
123 | + LEFT JOIN diagram_lg AS lt | |
124 | + ON dlt.log_id = lt.log_id | |
125 | + LEFT JOIN schdul_info AS st | |
126 | + ON st.group_id = lt.diagram_id | |
127 | + WHERE true | |
128 | + <!-- 검색영역 --> | |
129 | + <foreach item="item" index="index" collection="searchObjectList"> | |
130 | + <choose> | |
131 | + <when test="item.key == 'log_id' and item.value != null and item.value !=''"> | |
132 | + AND dlt.log_id = #{item.value} | |
133 | + </when> | |
134 | + <when test="item.type == 'string' and item.key == 'log_category' and item.value != null and item.value !=''"> | |
135 | + AND dlt.log_category = #{item.value} | |
136 | + </when> | |
137 | + </choose> | |
138 | + </foreach> | |
139 | + <!-- 검색영역 끝 --> | |
140 | + </select> | |
141 | + | |
142 | + <select id="detaillogSelectListAllID" parameterType="HashMap" resultType="ScheduleLogDetailVO"> | |
143 | + SELECT | |
144 | + dlt.detail_log_id, | |
145 | + dlt.operation_success_date, | |
146 | + dlt.node_name, | |
147 | + dlt.log_category, | |
148 | + dlt.log_message, | |
149 | + st.sj, | |
150 | + st.creat_id, | |
151 | + lt.operation_date | |
152 | + FROM | |
153 | + diagram_lg_detail dlt | |
154 | + JOIN | |
155 | + diagram_lg lt ON dlt.log_id = lt.log_id | |
156 | + JOIN | |
157 | + diagram_info dt ON dt.diagram_id = lt.diagram_id | |
158 | + JOIN | |
159 | + schdul_info st ON st.group_id = dt.diagram_id | |
160 | + WHERE dlt.log_id = #{logId} | |
161 | + </select> | |
162 | + | |
163 | + <!-- | |
164 | + 작성자 : 하관우 | |
165 | + 작성일자 : 2024-02-01 | |
166 | + 내용 : 로그 인설트 | |
167 | + --> | |
168 | + <insert id="logDataInsert" parameterType="ScheduleLogVO" > | |
169 | + INSERT INTO diagram_lg( | |
170 | + log_id, | |
171 | + operation_date, | |
172 | + total_node_count, | |
173 | + fail_node_count, | |
174 | + fail_node_name, | |
175 | + state_info, | |
176 | + diagram_id, | |
177 | + user_id | |
178 | + ) VALUES( | |
179 | + #{log_id}, | |
180 | + NOW(), | |
181 | + #{total_node_count}, | |
182 | + #{fail_node_count}, | |
183 | + #{fail_node_name}, | |
184 | + #{state_info}, | |
185 | + #{diagram_id}, | |
186 | + #{user_id} | |
187 | + ) | |
188 | + </insert> | |
189 | + | |
190 | + <!-- | |
191 | + 작성자 : 하관우 | |
192 | + 작성일자 : 2024-09-03 | |
193 | + 내용 : 로그 업데이트 | |
194 | + --> | |
195 | + <update id="logDataUpdate" parameterType="ScheduleLogVO"> | |
196 | + UPDATE diagram_lg | |
197 | + SET | |
198 | + operation_date = NOW(), | |
199 | + total_node_count = #{total_node_count}, | |
200 | + fail_node_count = #{fail_node_count}, | |
201 | + fail_node_name = #{fail_node_name}, | |
202 | + state_info = #{state_info}, | |
203 | + user_id = #{user_id} | |
204 | + WHERE | |
205 | + log_id = #{log_id} | |
206 | + </update> | |
207 | + | |
208 | + <!-- | |
209 | + 작성자 : 하관우 | |
210 | + 작성일자 : 2024-02-01 | |
211 | + 내용 : 로그 디테일 인설트 | |
212 | + --> | |
213 | + <insert id="logDetailDataInsert" parameterType="ScheduleLogDetailVO" > | |
214 | + INSERT INTO diagram_lg_detail( | |
215 | + detail_log_id | |
216 | + , operation_success_date | |
217 | + , node_name | |
218 | + , log_category | |
219 | + , log_message | |
220 | + , log_id | |
221 | + , operation_date | |
222 | + , sj | |
223 | + , creat_id | |
224 | + ) VALUES( | |
225 | + #{detail_log_id} | |
226 | + , now() | |
227 | + , #{node_name} | |
228 | + , #{log_category} | |
229 | + , #{log_message} | |
230 | + , #{log_id} | |
231 | + , #{operation_date} | |
232 | + , #{sj} | |
233 | + , #{creat_id} | |
234 | + ) | |
235 | + </insert> | |
236 | + | |
237 | + <!-- 다이어그램 ID로 로그 삭제--> | |
238 | + <delete id="logDelete" parameterType="String"> | |
239 | + DELETE FROM diagram_lg | |
240 | + WHERE diagram_id = #{diagram_id} | |
241 | + </delete> | |
242 | + | |
243 | + <!-- 로그 ID로 디테일 로그 삭제--> | |
244 | + <delete id="logDetailDelete" parameterType="String"> | |
245 | + DELETE FROM diagram_lg_detail | |
246 | + WHERE log_id = #{log_id} | |
247 | + </delete> | |
248 | +</mapper>(파일 끝에 줄바꿈 문자 없음) |
--- src/main/resources/spring/mapper/user/login-SQL.xml
+++ src/main/resources/spring/mapper/user/login-SQL.xml
... | ... | @@ -2,7 +2,7 @@ |
2 | 2 |
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
3 | 3 |
|
4 | 4 |
|
5 |
-<mapper namespace="com.takensoft.taken_bi_manager.user.member.dao.LoginDAO"> |
|
5 |
+<mapper namespace="com.takensoft.taken_bi_manager.user.dao.LoginDAO"> |
|
6 | 6 |
|
7 | 7 |
<!-- 로그인 성공처리 --> |
8 | 8 |
<update id="loginSuccess" parameterType="Member"> |
--- src/main/resources/spring/mapper/user/member-SQL.xml
+++ src/main/resources/spring/mapper/user/member-SQL.xml
... | ... | @@ -1,7 +1,7 @@ |
1 | 1 |
<?xml version="1.0" encoding="UTF-8" ?> |
2 | 2 |
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
3 | 3 |
|
4 |
-<mapper namespace="com.takensoft.taken_bi_manager.user.member.dao.MemberDAO"> |
|
4 |
+<mapper namespace="com.takensoft.taken_bi_manager.user.dao.MemberDAO"> |
|
5 | 5 |
<!-- 사용자 매퍼 --> |
6 | 6 |
<resultMap id="memberResult" type="Member"> |
7 | 7 |
<result property="userId" column="user_id"/> |
--- src/main/resources/spring/mapper/user/mypage-SQL.xml
+++ src/main/resources/spring/mapper/user/mypage-SQL.xml
... | ... | @@ -1,6 +1,6 @@ |
1 | 1 |
<?xml version="1.0" encoding="UTF-8"?> |
2 | 2 |
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
3 |
-<mapper namespace="com.takensoft.taken_bi_manager.user.member.dao.MyPageDAO"> |
|
3 |
+<mapper namespace="com.takensoft.taken_bi_manager.user.dao.MyPageDAO"> |
|
4 | 4 |
<!-- 사용자 매퍼 --> |
5 | 5 |
<resultMap id="myPageResult" type="Member"> |
6 | 6 |
<result property="userId" column="user_id"/> |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?