|
|
|
@@ -66,6 +66,7 @@ import org.springframework.web.bind.annotation.RestController; |
|
|
|
import java.io.Serializable; |
|
|
|
import java.text.ParseException; |
|
|
|
import java.time.Duration; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.Date; |
|
|
|
import java.util.List; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
@@ -414,6 +415,19 @@ public class DmDigitalmanController extends BaseController<DmDigitalmanQuery, Dm |
|
|
|
Integer openDoorCount = (Integer) redisTemplate.opsForValue().get("dashboard:open_door"); |
|
|
|
Integer conversationDuration = (Integer) redisTemplate.opsForValue().get("dashboard:conversation-duration"); |
|
|
|
Integer conversationTimes = (Integer) redisTemplate.opsForValue().get("dashboard:conversation-times"); |
|
|
|
Integer broadcastCount = (Integer) redisTemplate.opsForValue().get("dashboard:broadcast-count"); |
|
|
|
List<JSONObject> knowledgeList = new ArrayList<>(); |
|
|
|
if (redisTemplate.hasKey("dashboard:knowledge-consume")) { |
|
|
|
Long knowledgeCount = redisTemplate.opsForList().size("dashboard:knowledge-consume"); |
|
|
|
if (knowledgeCount > 0) |
|
|
|
knowledgeList = redisTemplate.opsForList().range("dashboard:knowledge-consume", 0, -1).stream().map(json -> JSONObject.parseObject(json.toString())).collect(Collectors.toList()); |
|
|
|
} |
|
|
|
List<JSONObject> skillList = new ArrayList<>(); |
|
|
|
if (redisTemplate.hasKey("dashboard:skill-consume")) { |
|
|
|
Long skillCount = redisTemplate.opsForList().size("dashboard:skill-consume"); |
|
|
|
if (skillCount > 0) |
|
|
|
skillList = redisTemplate.opsForList().range("dashboard:skill-consume", 0, -1).stream().map(json -> JSONObject.parseObject(json.toString())).collect(Collectors.toList()); |
|
|
|
} |
|
|
|
JSONArray jsonArray = new JSONArray(); |
|
|
|
// JSONArray jsonArray2 = new JSONArray(); |
|
|
|
for (int i = 0; i < 7; i++) { |
|
|
|
@@ -427,18 +441,22 @@ public class DmDigitalmanController extends BaseController<DmDigitalmanQuery, Dm |
|
|
|
} |
|
|
|
|
|
|
|
JSONObject json = new JSONObject(); |
|
|
|
json.put("manCount",dtos2.size()); |
|
|
|
json.put("chatTimes",conversationTimes); |
|
|
|
json.put("chatDurationCount",conversationDuration); |
|
|
|
json.put("serviceTimeCount",serviceTimeCount); |
|
|
|
json.put("servicePerCount",serverTimes); |
|
|
|
json.put("recognizedPersonCount",recognition); |
|
|
|
json.put("meetingServiceCount",meetingServiceCount); |
|
|
|
json.put("receptionCount",receptionCount); |
|
|
|
json.put("visitorCount",visitorCount); |
|
|
|
json.put("attendanceCount",attendanceCount); |
|
|
|
json.put("openDoorCount",openDoorCount); |
|
|
|
json.put("serverCharts",jsonArray); |
|
|
|
json.put("manCount",dtos2.size());//数字人数 |
|
|
|
json.put("recognizedPersonCount",recognition);//注册人员总数 |
|
|
|
json.put("serviceTimeCount",serviceTimeCount);//总服务时间 |
|
|
|
json.put("chatTimes",conversationTimes);//对话次数 |
|
|
|
json.put("chatDurationCount",conversationDuration);//对话时长 |
|
|
|
|
|
|
|
json.put("servicePerCount",serverTimes);//用户使用频次 |
|
|
|
json.put("meetingServiceCount",meetingServiceCount);//会议 |
|
|
|
json.put("receptionCount",receptionCount);//接待 |
|
|
|
json.put("visitorCount",visitorCount);//访客 |
|
|
|
json.put("attendanceCount",attendanceCount);//考勤 |
|
|
|
json.put("openDoorCount",openDoorCount);//门禁 |
|
|
|
json.put("broadcastCount",broadcastCount);//播报 |
|
|
|
json.put("knowledgeConsume",knowledgeList);//实时知识库调用 |
|
|
|
json.put("skillConsume",skillList);//实时技能调用 |
|
|
|
json.put("serverCharts",jsonArray);// |
|
|
|
log.info(json.toJSONString()); |
|
|
|
return R.ok(json); |
|
|
|
} |
|
|
|
|