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
07f47cc6
Commit
07f47cc6
authored
Nov 22, 2021
by
Cristian Aguirre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update 22-11-2021
parent
81d01727
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
19 deletions
+31
-19
SummaryBean.java
src/main/java/com/bytesw/bytebot/bean/SummaryBean.java
+1
-3
DataBaseItemReaderFactory.java
...t/etl/batch/factory/reader/DataBaseItemReaderFactory.java
+0
-1
CustomerInteractionDashboardService.java
...ervice/dashboard/CustomerInteractionDashboardService.java
+6
-3
OperativeDashboardService.java
.../bytebot/service/dashboard/OperativeDashboardService.java
+22
-10
application.yml
src/main/resources/application.yml
+2
-2
No files found.
src/main/java/com/bytesw/bytebot/bean/SummaryBean.java
View file @
07f47cc6
...
...
@@ -15,9 +15,7 @@ public class SummaryBean implements Serializable {
@Expose
private
BigInteger
value
;
@Expose
private
List
<
BigInteger
>
history
;
@Expose
private
BigDecimal
percent
;
@Expose
private
List
<
ArrayList
<
Object
>>
detail_
history
;
private
List
<
ArrayList
<
Object
>>
history
;
}
src/main/java/com/bytesw/bytebot/etl/batch/factory/reader/DataBaseItemReaderFactory.java
View file @
07f47cc6
...
...
@@ -66,5 +66,4 @@ public class DataBaseItemReaderFactory implements ItemReaderFactory<DynaBean, Ro
return
dataSource
;
}
}
src/main/java/com/bytesw/bytebot/service/dashboard/CustomerInteractionDashboardService.java
View file @
07f47cc6
...
...
@@ -100,8 +100,9 @@ public class CustomerInteractionDashboardService extends DashboardService {
others
.
setId
(
0L
);
others
.
setIdentifier
(
"others"
);
intentTopList
.
add
(
others
);
if
(
others
.
getCount
().
intValue
()>
0
){
intentTopList
.
add
(
others
);
}
data
.
get
(
"intent"
).
put
(
"total"
,
totalIntents
);
data
.
get
(
"intent"
).
put
(
"topList"
,
intentTopList
);
...
...
@@ -123,7 +124,9 @@ public class CustomerInteractionDashboardService extends DashboardService {
othersSentence
.
setId
(
0L
);
othersSentence
.
setIdentifier
(
"others"
);
sentenceTopList
.
add
(
othersSentence
);
if
(
othersSentence
.
getCount
().
intValue
()>
0
){
sentenceTopList
.
add
(
othersSentence
);
}
data
.
get
(
"sentence"
).
put
(
"topList"
,
sentenceTopList
);
data
.
get
(
"sentence"
).
put
(
"total"
,
totalSentences
);
...
...
src/main/java/com/bytesw/bytebot/service/dashboard/OperativeDashboardService.java
View file @
07f47cc6
...
...
@@ -8,7 +8,9 @@ import com.bytesw.bytebot.jdbc.BotSessionJDCBRepository;
import
com.bytesw.bytebot.jdbc.MessageJDBCRepository
;
import
com.bytesw.bytebot.jdbc.ResponseJDBCRepository
;
import
com.bytesw.xdf.exception.NotFoundException
;
import
io.swagger.models.auth.In
;
import
lombok.extern.log4j.Log4j2
;
import
org.apache.commons.collections.ArrayStack
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -17,10 +19,7 @@ import java.math.BigDecimal;
import
java.math.BigInteger
;
import
java.sql.Timestamp
;
import
java.time.*
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.*
;
@Log4j2
@Service
...
...
@@ -46,9 +45,11 @@ public class OperativeDashboardService extends DashboardService {
// Mensajes recibidos
List
<
Object
[]>
recivedMessages
=
generateDataVariablePeriod
(
rangeMinutsList
,
true
);
int
totalrecivedMessages
=
messageJDBCRepository
.
countSessionInRange
(
startDate
,
endDate
);
// Mensajes enviados
List
<
Object
[]>
responseMessages
=
generateDataVariablePeriod
(
rangeMinutsList
,
false
);
int
totalresponseMessages
=
responseJDBCRepository
.
countSessionInRange
(
startDate
,
endDate
);
//Promedio primera respuesta en mili
Object
avgFRObject
=
botSessionJDCBRepository
.
getAvgFirstResponseTime
(
startDate
,
endDate
);
...
...
@@ -76,23 +77,34 @@ public class OperativeDashboardService extends DashboardService {
// Adjutando el total de sesiones por cliente
SummaryBean
totalSessions
=
new
SummaryBean
();
totalSessions
.
setDetail_history
(
new
ArrayList
<>());
totalSessions
.
setHistory
(
new
ArrayList
<>());
ArrayList
<
BigInteger
>
totalsessions
=
new
ArrayList
<
BigInteger
>();
// Total de sesiones
sessions_by_user
.
stream
().
forEach
(
x
->{
ArrayList
<
Object
>
session
=
new
ArrayList
<
Object
>();
session
.
add
(
x
.
getUser_id
());
session
.
add
(
x
.
getUser_id
()
.
toString
()
);
session
.
add
(
x
.
getCount
());
total
Sessions
.
getDetail_history
().
add
(
session
);
}
);
total
sessions
.
add
(
x
.
getCount
()
);
totalSessions
.
getHistory
().
add
(
session
);
});
int
sum
=
totalsessions
.
stream
().
mapToInt
(
BigInteger:
:
intValue
).
sum
();
BigInteger
total
=
BigInteger
.
valueOf
(
sum
);
totalSessions
.
setValue
(
total
);
// Adjuntamos los mensajes recibidos
info
.
put
(
"totalReceivedMessages"
,
recivedMessages
);
Map
<
String
,
Object
>
recivedMessage
=
new
HashMap
<>();
recivedMessage
.
put
(
"value"
,
totalrecivedMessages
);
recivedMessage
.
put
(
"history"
,
recivedMessages
);
// Adjuntamos los mensajes enviados
info
.
put
(
"totalSentMessages"
,
responseMessages
);
Map
<
String
,
Object
>
responseMessage
=
new
HashMap
<>();
responseMessage
.
put
(
"value"
,
totalresponseMessages
);
responseMessage
.
put
(
"history"
,
responseMessages
);
Map
<
String
,
Object
>
summary
=
new
HashMap
<>();
summary
.
put
(
"sessionInactivity"
,
sessionInactivity
);
summary
.
put
(
"totalSessions"
,
totalSessions
);
summary
.
put
(
"totalSentMessages"
,
responseMessage
);
summary
.
put
(
"totalReceivedMessages"
,
recivedMessage
);
AverageBean
averageBean
=
new
AverageBean
();
if
(
avgFirstResponse
==
null
)
{
...
...
src/main/resources/application.yml
View file @
07f47cc6
...
...
@@ -4,7 +4,7 @@ server:
servlet.context-path
:
${APPLICATION_PATH:/bytebot}
port
:
${APPLICATION_PORT:9077}
web
:
static-content-location
:
file:/home/cristian/Documents/
CDB-Bytebot/bytebot-workspace/dist
/bytebot-html/
static-content-location
:
file:/home/cristian/Documents/
AVB_Backend
/bytebot-html/
#NOTA debe terminar con /
security
:
...
...
@@ -55,7 +55,7 @@ application:
multi-tenant-conf
:
exclude-service
:
/
authorization-service.url
:
http://localhost:17580
security
:
none
# none, basic, oauth2sso
security
:
oauth2sso
# none, basic, oauth2sso
security.method
:
true
security-exclude
:
/service/oauth/userinfo, /actuator/**, /mylogout, /login, /logout, /goodbye, /error, /anon, /cache.manifest, /favicon.ico, /service/file, /goodbye /byteboot
messaging
:
...
...
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