2034b5b1
함상기
Init Version 2024...
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
|
package daeucna.batch.controller;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.google.gson.JsonObject;
import daeucna.batch.service.JobService;
import daeucna.batch.util.FileUtil;
import daeucna.config.batch.MatchingSetup;
import daeucna.config.batch.MatchingSetup.Matching;
import daeucna.mapper.primary.batch.MatchingInnerDelingMapper;
import lombok.extern.slf4j.Slf4j;
@RestController
@RequestMapping("/api/job")
@Slf4j
public class JobController {
@Autowired
private JobService jobService;
@Autowired
private MatchingInnerDelingMapper matchingInnerDelingMapper;
@PostMapping("/create")
public String createJob( @RequestBody Map<String, String> params) throws Exception {
/*
* {
* "sysSe": "LS_ALL",
* "accnutYm": "202306",
* }
*/
log.debug("Start Create Job");
jobService.createData(params);
log.debug("End Create Job");
return "신규 작업데이타를 생성합니다. 작업이 끝난후 작업결과는 별도로 확인 바랍니다.";
}
@PostMapping("/matching")
public String matchingJob( @RequestBody Map<String, String> params) throws Exception {
/*
* {
* "sysSe": "LS_ALL",
* "accnutYm": "202306",
* }
*/
log.debug("Start Matching Job");
jobService.matchingJob(params);
log.debug("End Matching Job");
return "매칭작업을 시작합니다. 작업이 끝난후 작업결과는 별도로 확인 바랍니다.";
}
@PostMapping("/extramatching")
public String extraMatchingJob( @RequestBody Map<String, String> params) throws Exception {
/*
* {
* "sysSe": "LS_ALL",
* "accnutYm": "202306",
* }
*/
log.debug("Start Extra Matching Job");
List<Map> retData = matchingInnerDelingMapper.getCustomItemReadData(params);
// List<Map> retData = new ArrayList<Map>();
// Map m = new HashMap();
// m.put("sys_se", "LS_ALL");
// m.put("accnut_ym", "202311");
// m.put("cpr_code", "A15300");
// m.put("partn_cpr", "A01100");
// retData.add(m);
for(Map curMap : retData) {
jobService.extraJobSub(curMap);
}
log.debug("End Extra Matching Job");
return "Extra 매칭작업을 시작합니다. 작업이 끝난후 작업결과는 별도로 확인 바랍니다.";
}
@PostMapping("/aimatching")
public String aiMatchingJob( @RequestBody Map<String, String> params) throws Exception {
/*
* {
* "sysSe": "LS_ALL",
* "accnutYm": "202306",
* }
*/
log.debug("Start AI Matching Job");
List<Map> retData = matchingInnerDelingMapper.getAiReadData(params);
for(Map curMap : retData) {
jobService.aiJobSub(curMap);
}
log.debug("End AI Matching Job");
return "AI 매칭작업을 시작합니다. 작업이 끝난후 작업결과는 별도로 확인 바랍니다.";
}
@PostMapping("/return")
public String returnJob( @RequestBody Map<String, String> params) throws Exception {
/*
* {
* "sysSe": "LS_ALL",
* "accnutYm": "202306",
* }
*/
log.debug("Start Return Job");
jobService.returnRwsultData(params);
log.debug("End Return Job");
return "매칭결과 반영을 시작합니다. 작업이 끝난후 작업결과는 별도로 확인 바랍니다.";
}
@GetMapping("/configJobStr")
public String configJobStr() throws Exception {
StringBuffer sb = FileUtil.readFileToString("matchingSetup.json");
return sb.toString();
}
@GetMapping("/configJobJsonObj")
public JsonObject configJobJsonObj() throws Exception {
StringBuffer sb = FileUtil.readFileToString("matchingSetup.json");
JsonObject jobj = FileUtil.strToJsonObj(sb.toString());
return jobj;
}
@GetMapping("/configJobObj")
public Object configJobObj() throws Exception {
StringBuffer sb = FileUtil.readFileToString("matchingSetup.json");
MatchingSetup matchingSetup = (MatchingSetup) FileUtil.strToObj(sb.toString(), MatchingSetup.class);
return matchingSetup;
}
@GetMapping("/config")
public Object config() throws Exception {
return configJobObj();
}
@GetMapping("/config/jobList")
public Object configJobList() throws Exception {
StringBuffer sb = FileUtil.readFileToString("matchingSetup.json");
MatchingSetup matchingSetup = (MatchingSetup) FileUtil.strToObj(sb.toString(), MatchingSetup.class);
List<String> lJobList = new ArrayList<String>();
for (Matching curMatching : matchingSetup.getMatchingSetup()) {
lJobList.add(curMatching.getType() + ':' + curMatching.getTypeName());
}
return lJobList;
}
}
|