Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
ejercicio2-framework-back
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Josue
ejercicio2-framework-back
Commits
83408ffc
Commit
83408ffc
authored
Nov 22, 2021
by
Cristian Aguirre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updating TotalSession Method
parent
07f47cc6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
6 deletions
+10
-6
SessionByClientBean.java
...ain/java/com/bytesw/bytebot/bean/SessionByClientBean.java
+3
-0
OperativeDashboardService.java
.../bytebot/service/dashboard/OperativeDashboardService.java
+3
-2
SessionMapper.xml
.../resources/config/mappers/bytebot/mysql/SessionMapper.xml
+2
-2
SessionMapper.xml
...sources/config/mappers/bytebot/postgres/SessionMapper.xml
+2
-2
No files found.
src/main/java/com/bytesw/bytebot/bean/SessionByClientBean.java
View file @
83408ffc
...
@@ -14,6 +14,9 @@ public class SessionByClientBean implements Serializable {
...
@@ -14,6 +14,9 @@ public class SessionByClientBean implements Serializable {
@Expose
@Expose
private
BigInteger
user_id
;
private
BigInteger
user_id
;
@Expose
private
String
sender_id
;
@Expose
@Expose
private
BigInteger
count
;
private
BigInteger
count
;
}
}
src/main/java/com/bytesw/bytebot/service/dashboard/OperativeDashboardService.java
View file @
83408ffc
...
@@ -81,11 +81,12 @@ public class OperativeDashboardService extends DashboardService {
...
@@ -81,11 +81,12 @@ public class OperativeDashboardService extends DashboardService {
ArrayList
<
BigInteger
>
totalsessions
=
new
ArrayList
<
BigInteger
>();
// Total de sesiones
ArrayList
<
BigInteger
>
totalsessions
=
new
ArrayList
<
BigInteger
>();
// Total de sesiones
sessions_by_user
.
stream
().
forEach
(
x
->{
sessions_by_user
.
stream
().
forEach
(
x
->{
ArrayList
<
Object
>
session
=
new
ArrayList
<
Object
>();
ArrayList
<
Object
>
session
=
new
ArrayList
<
Object
>();
session
.
add
(
x
.
getUser_id
().
toString
());
// Split de la data para obtener el número
String
sender_id
=
x
.
getSender_id
().
split
(
":"
)[
1
];
session
.
add
(
sender_id
);
session
.
add
(
x
.
getCount
());
session
.
add
(
x
.
getCount
());
totalsessions
.
add
(
x
.
getCount
());
totalsessions
.
add
(
x
.
getCount
());
totalSessions
.
getHistory
().
add
(
session
);
totalSessions
.
getHistory
().
add
(
session
);
});
});
int
sum
=
totalsessions
.
stream
().
mapToInt
(
BigInteger:
:
intValue
).
sum
();
int
sum
=
totalsessions
.
stream
().
mapToInt
(
BigInteger:
:
intValue
).
sum
();
BigInteger
total
=
BigInteger
.
valueOf
(
sum
);
BigInteger
total
=
BigInteger
.
valueOf
(
sum
);
...
...
src/main/resources/config/mappers/bytebot/mysql/SessionMapper.xml
View file @
83408ffc
...
@@ -13,13 +13,13 @@
...
@@ -13,13 +13,13 @@
</select>
</select>
<select
id=
"countSessionsInRange"
resultType=
"SessionByClient"
flushCache=
"true"
>
<select
id=
"countSessionsInRange"
resultType=
"SessionByClient"
flushCache=
"true"
>
select
bas.user_id as us
er_id,
select
au.user_ident as send
er_id,
count(session_id) as count
count(session_id) as count
FROM AVB_SESSION bas
FROM AVB_SESSION bas
join avb_user au on au.user_id=bas.user_id
join avb_user au on au.user_id=bas.user_id
WHERE SESSION_LEDAT
<
= #{endDate}
WHERE SESSION_LEDAT
<
= #{endDate}
AND SESSION_LEDAT
>
= #{startDate}
AND SESSION_LEDAT
>
= #{startDate}
group by
bas.user_id
group by
au.user_ident
</select>
</select>
<select
id=
"avgSessionsByCustomerInRange"
resultType=
"Double"
flushCache=
"true"
>
<select
id=
"avgSessionsByCustomerInRange"
resultType=
"Double"
flushCache=
"true"
>
...
...
src/main/resources/config/mappers/bytebot/postgres/SessionMapper.xml
View file @
83408ffc
...
@@ -13,13 +13,13 @@
...
@@ -13,13 +13,13 @@
</select>
</select>
<select
id=
"countSessionsInRange"
resultType=
"SessionByClient"
flushCache=
"true"
>
<select
id=
"countSessionsInRange"
resultType=
"SessionByClient"
flushCache=
"true"
>
select
bas.user_id as us
er_id,
select
au.user_ident as send
er_id,
count(session_id) as count
count(session_id) as count
FROM AVB_SESSION bas
FROM AVB_SESSION bas
join avb_user au on au.user_id=bas.user_id
join avb_user au on au.user_id=bas.user_id
WHERE SESSION_LEDAT
<
= #{endDate}
WHERE SESSION_LEDAT
<
= #{endDate}
AND SESSION_LEDAT
>
= #{startDate}
AND SESSION_LEDAT
>
= #{startDate}
group by
bas.user_id
group by
au.user_ident
</select>
</select>
<select
id=
"avgSessionsByCustomerInRange"
resultType=
"Double"
flushCache=
"true"
>
<select
id=
"avgSessionsByCustomerInRange"
resultType=
"Double"
flushCache=
"true"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment