Commit 07f47cc6 authored by Cristian Aguirre's avatar Cristian Aguirre

Update 22-11-2021

parent 81d01727
......@@ -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;
}
......@@ -66,5 +66,4 @@ public class DataBaseItemReaderFactory implements ItemReaderFactory<DynaBean, Ro
return dataSource;
}
}
......@@ -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);
......
......@@ -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());
totalSessions.getDetail_history().add(session);
});
totalsessions.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) {
......
......@@ -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:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment