
--- Global.js
+++ Global.js
... | ... | @@ -5,10 +5,10 @@ |
5 | 5 |
const SERVICE_STATUS = process.env.NODE_ENV;//development, production |
6 | 6 |
const PORT = 80; |
7 | 7 |
const API_SERVER_HOST = 'localhost:8080'; |
8 |
-const JUSO_API_KEY = 'U01TX0FVVEgyMDIzMDQxNzIxNDY1NjExMzY5NTg='//실사용 Key u-dolbom.com |
|
9 |
-const JUSO_CORRD_API_KEY = 'U01TX0FVVEgyMDIzMDQxNzE2MTgyNzExMzY5MzE=';//실사용 Key u-dolbom.com |
|
10 |
-//const JUSO_API_KEY = 'U01TX0FVVEgyMDIyMTEyMTE3NDE1NzExMzI0MjU=';//Test용 |
|
11 |
-//const JUSO_CORRD_API_KEY = 'U01TX0FVVEgyMDIyMTEyMTE4MDIxOTExMzI0MzU=';//Test용 |
|
8 |
+//const JUSO_API_KEY = 'U01TX0FVVEgyMDIzMDQxNzIxNDY1NjExMzY5NTg='//실사용 Key u-dolbom.com |
|
9 |
+//const JUSO_CORRD_API_KEY = 'U01TX0FVVEgyMDIzMDQxNzE2MTgyNzExMzY5MzE=';//실사용 Key u-dolbom.com |
|
10 |
+const JUSO_API_KEY = 'U01TX0FVVEgyMDIyMTEyMTE3NDE1NzExMzI0MjU=';//Test용 |
|
11 |
+const JUSO_CORRD_API_KEY = 'U01TX0FVVEgyMDIyMTEyMTE4MDIxOTExMzI0MzU=';//Test용 |
|
12 | 12 |
|
13 | 13 |
module.exports = { |
14 | 14 |
PROJECT_NAME, |
--- client/views/component/chart/Chart8_government.jsx
+++ client/views/component/chart/Chart8_government.jsx
... | ... | @@ -6,10 +6,11 @@ |
6 | 6 |
import CommonUtil from "../../../resources/js/CommonUtil"; |
7 | 7 |
|
8 | 8 |
|
9 |
-export default function Chart8() { |
|
10 |
- const createChart = () => { |
|
11 |
- let root = am5.Root.new("Chart8"); |
|
9 |
+export default function Chart8(chartData) { |
|
10 |
+ console.log("chartData : ", chartData.data) |
|
12 | 11 |
|
12 |
+ const createChart = (chartData) => { |
|
13 |
+ let root = am5.Root.new("Chart8"); |
|
13 | 14 |
|
14 | 15 |
// Set themes |
15 | 16 |
// https://www.amcharts.com/docs/v5/concepts/themes/ |
... | ... | @@ -63,7 +64,7 @@ |
63 | 64 |
xAxis: xAxis, |
64 | 65 |
yAxis: yAxis, |
65 | 66 |
valueXField: "percent", |
66 |
- categoryYField: "senior_name", |
|
67 |
+ categoryYField: "user_name", |
|
67 | 68 |
tooltip: am5.Tooltip.new(root, { |
68 | 69 |
pointerOrientation: "left", |
69 | 70 |
labelText: "{valueX}" |
... | ... | @@ -89,20 +90,7 @@ |
89 | 90 |
|
90 | 91 |
|
91 | 92 |
// Set data |
92 |
- let data = [ |
|
93 |
- { |
|
94 |
- "senior_name": "보일", |
|
95 |
- "percent": 28 |
|
96 |
- }, |
|
97 |
- { |
|
98 |
- "senior_name": "보이", |
|
99 |
- "percent": 6 |
|
100 |
- }, |
|
101 |
- { |
|
102 |
- "senior_name": "보삼", |
|
103 |
- "percent": 16 |
|
104 |
- }, |
|
105 |
- ] |
|
93 |
+ let data = chartData.data; |
|
106 | 94 |
yAxis.data.setAll(data); |
107 | 95 |
series.data.setAll(data); |
108 | 96 |
sortCategoryAxis(); |
... | ... | @@ -172,7 +160,7 @@ |
172 | 160 |
} |
173 | 161 |
|
174 | 162 |
React.useEffect(() => { |
175 |
- createChart(); |
|
163 |
+ createChart(chartData); |
|
176 | 164 |
}, []) |
177 | 165 |
|
178 | 166 |
return ( |
--- client/views/pages/main/Main_agency.jsx
+++ client/views/pages/main/Main_agency.jsx
... | ... | @@ -129,7 +129,7 @@ |
129 | 129 |
<img src={medicineAgency} alt="" /> |
130 | 130 |
<div className="text"> |
131 | 131 |
<p>미복약 위험 대상자</p> |
132 |
- <p className="peoplecount">3</p> |
|
132 |
+ <p className="peoplecount">0</p> |
|
133 | 133 |
</div> |
134 | 134 |
</li> |
135 | 135 |
</ul> |
--- client/views/pages/main/Main_agencyAdmin.jsx
+++ client/views/pages/main/Main_agencyAdmin.jsx
... | ... | @@ -253,7 +253,7 @@ |
253 | 253 |
<li> |
254 | 254 |
<p><MedicationIcon sx={{ width: "50px", height: "50px", color: "#ffffff", background: "#076143", borderRadius: "50px" }} /></p> |
255 | 255 |
<p>{cityName} 미복약 위험 대상자</p> |
256 |
- <p>3</p> |
|
256 |
+ <p>0</p> |
|
257 | 257 |
</li> |
258 | 258 |
</ul> |
259 | 259 |
<ul className="content-box statistics-govern" background="#ebe7b9" > |
--- client/views/pages/main/Main_government.jsx
+++ client/views/pages/main/Main_government.jsx
... | ... | @@ -20,6 +20,7 @@ |
20 | 20 |
import MedicationIcon from '@mui/icons-material/Medication'; |
21 | 21 |
import ElderlyIcon from '@mui/icons-material/Elderly'; |
22 | 22 |
|
23 |
+import CommonUtil from "../../../resources/js/CommonUtil.js"; |
|
23 | 24 |
|
24 | 25 |
import "leaflet/dist/leaflet.css"; |
25 | 26 |
|
... | ... | @@ -31,6 +32,7 @@ |
31 | 32 |
const [cityName, setCityName] = useState(state.loginUser['government_name']); |
32 | 33 |
|
33 | 34 |
//대상자(시니어) 목록 조회 |
35 |
+ const [seniorNum, setSeniorNum] = React.useState(); |
|
34 | 36 |
const [senior, setSenior] = React.useState({ userList: [], userListCount: 0 }); |
35 | 37 |
const seniorSelectList = () => { |
36 | 38 |
fetch("/user/userSelectList.json", { |
... | ... | @@ -46,6 +48,11 @@ |
46 | 48 |
}).then((response) => response.json()).then((data) => { |
47 | 49 |
console.log("대상자(시니어) 목록 조회 : ", data); |
48 | 50 |
setSenior(data); |
51 |
+ data.userList.map((item, idx) => { |
|
52 |
+ item['senior_id'] = item['user_id'] |
|
53 |
+ seniorMedicationSelectList(item); |
|
54 |
+ }) |
|
55 |
+ console.log(medicationList) |
|
49 | 56 |
}).catch((error) => { |
50 | 57 |
console.log('seniorSelectList() /user/userSelectList.json error : ', error); |
51 | 58 |
}); |
... | ... | @@ -169,6 +176,79 @@ |
169 | 176 |
}); |
170 | 177 |
} |
171 | 178 |
|
179 |
+ //특정 대상자의 실제 복약 정보 |
|
180 |
+ const [seniorMedicationList, setSeniorMedicationList] = React.useState([]); |
|
181 |
+ const [showMedicationTimeCode, setShowMedicationTimeCode] = React.useState({}); |
|
182 |
+ //특정 대상자의 실제 복약 정보 목록 조회 |
|
183 |
+ const seniorMedicationSelectList = (seniorData) => { |
|
184 |
+ fetch("/user/seniorMedicationSelectList.json", { |
|
185 |
+ method: "POST", |
|
186 |
+ headers: { |
|
187 |
+ 'Content-Type': 'application/json; charset=UTF-8' |
|
188 |
+ }, |
|
189 |
+ body: JSON.stringify(seniorData), |
|
190 |
+ }).then((response) => response.json()).then((data) => { |
|
191 |
+ setSeniorMedicationList(data); |
|
192 |
+ seniorMedicationSelectListByDay(data, seniorData); |
|
193 |
+ }).catch((error) => { |
|
194 |
+ console.log('seniorMedicationSelectList() /user/seniorMedicationSelectList.json error : ', error); |
|
195 |
+ }); |
|
196 |
+ }; |
|
197 |
+ |
|
198 |
+ //특정 대상자의 일별, 복약시간별 복약 목록 |
|
199 |
+ const [medicationList, setMedicationList] = React.useState([]); |
|
200 |
+ //특정 대상자의 일별, 복약시간별 복약 목록 조회 |
|
201 |
+ const seniorMedicationSelectListByDay = (seniorMedicationList, seniorData) => { |
|
202 |
+ fetch("/user/seniorMedicationSelectListByDay.json", { |
|
203 |
+ method: "POST", |
|
204 |
+ headers: { |
|
205 |
+ 'Content-Type': 'application/json; charset=UTF-8' |
|
206 |
+ }, |
|
207 |
+ body: JSON.stringify(seniorData), |
|
208 |
+ }).then((response) => response.json()).then((data) => { |
|
209 |
+ let showMedicationTimeCode = {}; |
|
210 |
+ for (let i = 0; i < seniorMedicationList.length; i++) { |
|
211 |
+ showMedicationTimeCode[seniorMedicationList[i]] = true; |
|
212 |
+ } |
|
213 |
+ setShowMedicationTimeCode(showMedicationTimeCode); |
|
214 |
+ |
|
215 |
+ if (CommonUtil.isEmpty(data) == false) { |
|
216 |
+ let _stackChartData = []; |
|
217 |
+ let lenghs = 0; |
|
218 |
+ if (data.length < 30) { |
|
219 |
+ lenghs = data.length |
|
220 |
+ } else { |
|
221 |
+ lenghs = data.length - 30 |
|
222 |
+ } |
|
223 |
+ let sum = 0; // 실제 복약량 |
|
224 |
+ let counter = 0; // 복약해야하는 양 |
|
225 |
+ let percent = 0; // 복용률 |
|
226 |
+ for (let i = data.length - 1; i >= lenghs; i--) { |
|
227 |
+ for (let j = 0; j < data[i]['medication_time_code_list'].length; j++) { |
|
228 |
+ if (CommonUtil.isEmpty(showMedicationTimeCode[data[i]['medication_time_code_list'][j]]) == false) { |
|
229 |
+ counter++; |
|
230 |
+ if (i > 0) { |
|
231 |
+ sum += data[i]['medication_time_code_count_list'][j]; |
|
232 |
+ } |
|
233 |
+ } else { |
|
234 |
+ continue; |
|
235 |
+ } |
|
236 |
+ } |
|
237 |
+ } |
|
238 |
+ if (sum == 0 || counter == 0) { |
|
239 |
+ percent = 0 |
|
240 |
+ } else { |
|
241 |
+ percent = Math.floor((sum / counter) * 100); |
|
242 |
+ } |
|
243 |
+ _stackChartData = { "user_name": seniorData['user_name'], "percent": percent } |
|
244 |
+ setMedicationList(_stackChartData); |
|
245 |
+ } |
|
246 |
+ }).catch((error) => { |
|
247 |
+ console.log('seniorMedicationSelectListByDay() /user/seniorMedicationSelectListByDay.json error : ', error); |
|
248 |
+ }); |
|
249 |
+ }; |
|
250 |
+ |
|
251 |
+ |
|
172 | 252 |
function updateList(agencyList, countList) { |
173 | 253 |
|
174 | 254 |
const result = []; |
... | ... | @@ -221,7 +301,7 @@ |
221 | 301 |
<li> |
222 | 302 |
<p><MedicationIcon sx={{ width: "50px", height: "50px", color: "#ffffff", background: "#076143", borderRadius: "50px" }} /></p> |
223 | 303 |
<p>{cityName} 미복약 위험 대상자</p> |
224 |
- <p>5</p> |
|
304 |
+ <p>0</p> |
|
225 | 305 |
</li> |
226 | 306 |
</ul> |
227 | 307 |
<ul className="content-box statistics-govern" background="#ebe7b9" > |
... | ... | @@ -283,7 +363,7 @@ |
283 | 363 |
<Title title={`${cityName} 복용률 순위`} /> |
284 | 364 |
</div> |
285 | 365 |
<div style={{ height: 'calc(100% - 60px)' }}> |
286 |
- <Chart8 /> |
|
366 |
+ <Chart8 data={medicationList} /> |
|
287 | 367 |
</div> |
288 | 368 |
</div> |
289 | 369 |
<div className="content-box combine-left-government2"> |
--- server/modules/web/Server.js
+++ server/modules/web/Server.js
... | ... | @@ -17,12 +17,12 @@ |
17 | 17 |
|
18 | 18 |
http.createServer(webServer).listen(PORT); |
19 | 19 |
https.createServer({ |
20 |
- key: fs.readFileSync(`${BASE_DIR}/server/modules/web/ssl/u-dolbom.com/u-dolbom.com_nopass.key`), |
|
20 |
+ /* key: fs.readFileSync(`${BASE_DIR}/server/modules/web/ssl/u-dolbom.com/u-dolbom.com_nopass.key`), |
|
21 | 21 |
cert: fs.readFileSync(`${BASE_DIR}/server/modules/web/ssl/u-dolbom.com/u-dolbom.com.pem`), |
22 |
- ca: fs.readFileSync(`${BASE_DIR}/server/modules/web/ssl/u-dolbom.com/Chain_RootCA_Bundle.crt`), |
|
23 |
- /* key: fs.readFileSync(`${BASE_DIR}/server/modules/web/ssl/u-dolbom.co.kr/u-dolbom.co.kr_nopass.key`), |
|
22 |
+ ca: fs.readFileSync(`${BASE_DIR}/server/modules/web/ssl/u-dolbom.com/Chain_RootCA_Bundle.crt`), */ |
|
23 |
+ key: fs.readFileSync(`${BASE_DIR}/server/modules/web/ssl/u-dolbom.co.kr/u-dolbom.co.kr_nopass.key`), |
|
24 | 24 |
cert: fs.readFileSync(`${BASE_DIR}/server/modules/web/ssl/u-dolbom.co.kr/u-dolbom.co.kr.pem`), |
25 |
- ca: fs.readFileSync(`${BASE_DIR}/server/modules/web/ssl/u-dolbom.co.kr/Chain_RootCA_Bundle.crt`), */ |
|
25 |
+ ca: fs.readFileSync(`${BASE_DIR}/server/modules/web/ssl/u-dolbom.co.kr/Chain_RootCA_Bundle.crt`), |
|
26 | 26 |
/* requestCert: false, |
27 | 27 |
rejectUnauthorized: false */ |
28 | 28 |
}, webServer).listen(443); |
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?