|
|
|
@@ -15,6 +15,7 @@ import com.xueyi.common.core.web.validate.V_E; |
|
|
|
import com.xueyi.common.datasource.annotation.Master; |
|
|
|
import com.xueyi.common.log.annotation.Log; |
|
|
|
import com.xueyi.common.log.enums.BusinessType; |
|
|
|
import com.xueyi.common.redis.utils.RedisUtil; |
|
|
|
import com.xueyi.common.security.annotation.InnerAuth; |
|
|
|
import com.xueyi.common.security.annotation.RequiresPermissions; |
|
|
|
import com.xueyi.common.web.entity.controller.BaseController; |
|
|
|
@@ -406,54 +407,57 @@ public class DmDigitalmanController extends BaseController<DmDigitalmanQuery, Dm |
|
|
|
serviceTimeCount += (System.currentTimeMillis() - dto.getActivateTime().getTime())/3600000; |
|
|
|
} |
|
|
|
|
|
|
|
Integer meetingServiceCount = (Integer) redisTemplate.opsForValue().get("dashboard:meeting"); |
|
|
|
Integer serverTimes = (Integer) redisTemplate.opsForValue().get("dashboard:server"); |
|
|
|
Integer recognition = (Integer) redisTemplate.opsForValue().get("dashboard:recognition"); |
|
|
|
Integer receptionCount = (Integer) redisTemplate.opsForValue().get("dashboard:create_visitor_info"); |
|
|
|
Integer visitorCount = (Integer) redisTemplate.opsForValue().get("dashboard:register_visitor"); |
|
|
|
Integer attendanceCount = (Integer) redisTemplate.opsForValue().get("dashboard:attendance"); |
|
|
|
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"); |
|
|
|
Integer meetingServiceCount = RedisUtil.getNumberVal("dashboard:meeting"); |
|
|
|
Integer serverTimes = RedisUtil.getNumberVal("dashboard:server"); |
|
|
|
Integer recognition = RedisUtil.getNumberVal("dashboard:recognition"); |
|
|
|
Integer receptionCount = RedisUtil.getNumberVal("dashboard:create_visitor_info"); |
|
|
|
Integer visitorCount = RedisUtil.getNumberVal("dashboard:register_visitor"); |
|
|
|
Integer attendanceCount = RedisUtil.getNumberVal("dashboard:attendance"); |
|
|
|
Integer openDoorCount = RedisUtil.getNumberVal("dashboard:open_door"); |
|
|
|
Integer conversationDuration = RedisUtil.getNumberVal("dashboard:conversation-duration"); |
|
|
|
Integer conversationTimes = RedisUtil.getNumberVal("dashboard:conversation-times"); |
|
|
|
Integer broadcastCount = RedisUtil.getNumberVal("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()); |
|
|
|
if (RedisUtil.existed("dashboard:knowledge-consume")) { |
|
|
|
knowledgeList = RedisUtil.getJsonList("dashboard:knowledge-consume"); |
|
|
|
//取值后清除缓存list,5秒后过期 |
|
|
|
RedisUtil.expire("dashboard:knowledge-consume", 5); |
|
|
|
} |
|
|
|
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()); |
|
|
|
if (RedisUtil.existed("dashboard:skill-consume")) { |
|
|
|
skillList = RedisUtil.getJsonList("dashboard:skill-consume"); |
|
|
|
//取值后清除缓存list,5秒后过期 |
|
|
|
RedisUtil.expire("dashboard:skill-consume", 5); |
|
|
|
} |
|
|
|
JSONArray jsonArray = new JSONArray(); |
|
|
|
// JSONArray jsonArray2 = new JSONArray(); |
|
|
|
for (int i = 0; i < 7; i++) { |
|
|
|
// 最近三十天的数据,服务人次,知识库增量 |
|
|
|
for (int i = 0; i < 30; i++) { |
|
|
|
Date date = DateUtils.addDays(new Date(), -i); |
|
|
|
String dateStr2 = DateUtils.formatDate(date, "yyyy-MM-dd"); |
|
|
|
JSONObject json2 = new JSONObject(); |
|
|
|
json2.put("date", dateStr2); |
|
|
|
json2.put("serviceTimes", (Integer) redisTemplate.opsForValue().get("dashboard:server-chart:"+dateStr2)); |
|
|
|
json2.put("knowledgeNums", (Integer) redisTemplate.opsForValue().get("dashboard:server-chart:"+dateStr2)); |
|
|
|
json2.put("serviceTimes", RedisUtil.getNumberVal("dashboard:server-chart:"+dateStr2)); |
|
|
|
json2.put("knowledgeNums", RedisUtil.getNumberVal("dashboard:server-chart:"+dateStr2)); |
|
|
|
jsonArray.add(json2); |
|
|
|
} |
|
|
|
|
|
|
|
JSONObject json = new JSONObject(); |
|
|
|
json.put("manCount",dtos2.size());//数字人数 |
|
|
|
json.put("recognizedPersonCount",recognition);//注册人员总数 |
|
|
|
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("servicePerCount",serverTimes);//用户使用频次?改成服务人次 |
|
|
|
json.put("serviceTotal",meetingServiceCount+receptionCount+visitorCount+attendanceCount+openDoorCount+broadcastCount); |
|
|
|
|
|
|
|
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);// |
|
|
|
|