Reviewed-on: http://39.105.23.186:3000/develop/digimeta-MultiSaas/pulls/159tags/B.2.2.2_20231028_test
| @@ -391,7 +391,7 @@ | |||
| <properties> | |||
| <!-- 环境标识,需要与配置文件的名称相对应 --> | |||
| <activatedProperties>test</activatedProperties> | |||
| <nacos.host>172.17.0.1</nacos.host> | |||
| <nacos.host>39.107.77.235</nacos.host> | |||
| <nacos.port>18848</nacos.port> | |||
| <nacos.namespace></nacos.namespace> | |||
| </properties> | |||
| @@ -8,7 +8,6 @@ import org.springframework.cloud.openfeign.FeignClient; | |||
| import org.springframework.http.MediaType; | |||
| import org.springframework.scheduling.annotation.Async; | |||
| import org.springframework.web.bind.annotation.DeleteMapping; | |||
| import org.springframework.web.bind.annotation.PathVariable; | |||
| import org.springframework.web.bind.annotation.PostMapping; | |||
| import org.springframework.web.bind.annotation.RequestParam; | |||
| import org.springframework.web.bind.annotation.RequestPart; | |||
| @@ -59,6 +58,10 @@ public interface RemoteFileService { | |||
| * @param url 文件地址 | |||
| * @return 结果 | |||
| */ | |||
| @DeleteMapping(value = "/inner/delete/{url}") | |||
| R<Boolean> delete(@PathVariable("url") String url); | |||
| @DeleteMapping(value = "/inner/delete") | |||
| R<Boolean> delete(@RequestParam (value = "url") String url); | |||
| @DeleteMapping(value = "/inner/delete-files") | |||
| R<Boolean> deleteFiles(@RequestParam (value = "urls") List<String> urls); | |||
| } | |||
| @@ -52,6 +52,11 @@ public class RemoteFileFallbackFactory implements FallbackFactory<RemoteFileServ | |||
| public R<Boolean> delete(String url) { | |||
| return R.fail("删除文件失败:" + throwable.getMessage()); | |||
| } | |||
| @Override | |||
| public R<Boolean> deleteFiles(List<String> urls) { | |||
| return R.fail("删除文件失败:" + throwable.getMessage() ); | |||
| } | |||
| }; | |||
| } | |||
| } | |||
| @@ -24,6 +24,7 @@ public class DmSyncDigitalmanDto extends DmDigitalmanPo { | |||
| protected DmDigitalmanWorktimePo worktime; | |||
| protected SysDeptExt workdayHour; | |||
| protected String iconPos; | |||
| protected String direction; | |||
| protected List<DmBroadcastVo> broadcast; | |||
| } | |||
| @@ -51,4 +51,7 @@ public class DmModelPo extends BaseEntity { | |||
| protected Long CurrentModel; | |||
| protected String iconPos; | |||
| /** 进出方向 */ | |||
| protected String direction; | |||
| } | |||
| @@ -56,4 +56,6 @@ public class DmSkillPo extends TBaseEntity { | |||
| protected String welcomByMeetingTime; | |||
| /** 离开时打招呼 */ | |||
| protected String leavingResp; | |||
| } | |||
| @@ -6,6 +6,7 @@ import com.xueyi.common.core.constant.basic.ServiceConstants; | |||
| import com.xueyi.common.core.web.result.R; | |||
| import com.xueyi.system.api.organize.domain.dto.SysEnterpriseDto; | |||
| import com.xueyi.system.api.organize.feign.factory.RemoteUserFallbackFactory; | |||
| import com.xueyi.system.api.pass.domain.po.DmRecognizedRecordsPo; | |||
| import com.xueyi.system.api.staff.domain.dto.DmStaffCommonDto; | |||
| import com.xueyi.system.api.staff.domain.vo.DmStaffFeature; | |||
| import org.springframework.cloud.openfeign.FeignClient; | |||
| @@ -46,4 +47,10 @@ public interface RemoteStaffService { | |||
| @GetMapping("/staff/api/staff-count") | |||
| JSONObject staffCount(); | |||
| @GetMapping("/staff/api/recognized-records") | |||
| R<List<DmRecognizedRecordsPo>> recognizedRecords(); | |||
| @GetMapping("/staff/api/inner-recognized-records") | |||
| R<List<DmRecognizedRecordsPo>> _recognizedRecords(@RequestHeader(SecurityConstants.ENTERPRISE_ID) Long enterpriseId, @RequestHeader(SecurityConstants.SOURCE_NAME) String sourceName, @RequestHeader(SecurityConstants.FROM_SOURCE) String source); | |||
| } | |||
| @@ -23,9 +23,9 @@ import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.web.bind.annotation.DeleteMapping; | |||
| import org.springframework.web.bind.annotation.PathVariable; | |||
| import org.springframework.web.bind.annotation.PostMapping; | |||
| import org.springframework.web.bind.annotation.RequestBody; | |||
| import org.springframework.web.bind.annotation.RequestParam; | |||
| import org.springframework.web.bind.annotation.RestController; | |||
| import org.springframework.web.multipart.MultipartFile; | |||
| @@ -208,7 +208,7 @@ public class SysFileController { | |||
| remoteFileManageService.saveFileLog(sysFile, SecurityConstants.INNER); | |||
| results.add(sysFile); | |||
| log.info("上传第 {} 张图片完成。。。",(num-1)); | |||
| }; | |||
| } | |||
| long endTs = System.currentTimeMillis(); | |||
| log.info("上传图片结束。。。,图片上传用时:{} ms,总用时:{} ms", (endTs-pdfTs), (endTs-startTs)); | |||
| @@ -238,8 +238,8 @@ public class SysFileController { | |||
| /** | |||
| * 删除文件 | 内部调用 | |||
| */ | |||
| @DeleteMapping(value = "/inner/delete/{url}") | |||
| public R<Boolean> deleteInner(@PathVariable String url) { | |||
| @DeleteMapping(value = "/inner/delete") | |||
| public R<Boolean> deleteInner(@RequestParam(value = "url") String url) { | |||
| try { | |||
| Boolean result = sysFileService.deleteFile(url); | |||
| return R.ok(result); | |||
| @@ -248,6 +248,17 @@ public class SysFileController { | |||
| return R.fail(e.getMessage()); | |||
| } | |||
| } | |||
| @DeleteMapping(value = "/inner/delete-files") | |||
| public R<Boolean> deleteFilesInner(@RequestParam(value = "urls") List<String> urls) { | |||
| try { | |||
| Boolean result = minioSysFileService.deleteFiles(urls); | |||
| return R.ok(result); | |||
| } catch (Exception e) { | |||
| log.error("文件删除失败", e); | |||
| return R.fail(e.getMessage()); | |||
| } | |||
| } | |||
| /** | |||
| * 文件上传请求 | |||
| */ | |||
| @@ -5,6 +5,10 @@ import com.xueyi.file.utils.FileUploadUtils; | |||
| import io.minio.MinioClient; | |||
| import io.minio.PutObjectArgs; | |||
| import io.minio.RemoveObjectArgs; | |||
| import io.minio.RemoveObjectsArgs; | |||
| import io.minio.Result; | |||
| import io.minio.messages.DeleteError; | |||
| import io.minio.messages.DeleteObject; | |||
| import io.minio.messages.Retention; | |||
| import io.minio.messages.RetentionMode; | |||
| import org.apache.commons.io.FileUtils; | |||
| @@ -22,6 +26,8 @@ import java.io.FileInputStream; | |||
| import java.io.InputStream; | |||
| import java.net.URLEncoder; | |||
| import java.time.ZonedDateTime; | |||
| import java.util.LinkedList; | |||
| import java.util.List; | |||
| /** | |||
| * Minio 文件存储 | |||
| @@ -191,4 +197,20 @@ public class MinioSysFileServiceImpl implements ISysFileService { | |||
| client.removeObject(RemoveObjectArgs.builder().bucket(minioConfig.getBucketName()).object(fileName).build()); | |||
| return true; | |||
| } | |||
| public Boolean deleteFiles(List<String> urls) throws Exception { | |||
| String bucketName = minioConfig.getBucketName(); | |||
| List<DeleteObject> objects = new LinkedList<>(); | |||
| for (String url:urls){ | |||
| String fileName = url.substring(url.indexOf(bucketName) + bucketName.length() + 1); | |||
| objects.add(new DeleteObject(fileName)); | |||
| } | |||
| Iterable<Result<DeleteError>> results = client.removeObjects(RemoveObjectsArgs.builder().bucket(bucketName).objects(objects).build()); | |||
| for (Result<DeleteError> result : results) { | |||
| DeleteError error = result.get(); | |||
| log.error("Error in deleting object {}; {}" ,error.objectName(), error.message()); | |||
| } | |||
| // client.removeObject(RemoveObjectArgs.builder().bucket(minioConfig.getBucketName()).object(fileName).build()); | |||
| return true; | |||
| } | |||
| } | |||
| @@ -65,6 +65,11 @@ | |||
| <artifactId>xueyi-api-job</artifactId> | |||
| </dependency> | |||
| <dependency> | |||
| <groupId>com.xueyi</groupId> | |||
| <artifactId>xueyi-api-file</artifactId> | |||
| </dependency> | |||
| <dependency> | |||
| <groupId>com.xueyi</groupId> | |||
| <artifactId>xueyi-api-nlt</artifactId> | |||
| @@ -3,7 +3,6 @@ package com.xueyi.job.task; | |||
| import com.xueyi.common.cache.utils.SourceUtil; | |||
| import com.xueyi.common.core.utils.core.StrUtil; | |||
| import com.xueyi.common.core.web.result.R; | |||
| import com.xueyi.message.api.transfer.feign.RemoteTransferService; | |||
| import com.xueyi.system.api.digitalmans.feign.RemoteManDeviceService; | |||
| import com.xueyi.system.api.model.Source; | |||
| import com.xueyi.tenant.api.tenant.domain.dto.TeTenantDto; | |||
| @@ -46,6 +45,7 @@ public class DgmanTask { | |||
| System.out.println("监控心跳执行完成"); | |||
| } | |||
| /** | |||
| * 触发条件:0 0 10 * * * | |||
| * 每日十点触发,收集当前在线数 | |||
| @@ -202,7 +202,7 @@ public class ApiController { | |||
| case 3: | |||
| R<DmReceptionVo> receptionVo = remoteReceptionService.getReceptionTaskInner(manDeviceDtoR.getData().getManCode(), manDeviceDtoR.getData().getTId(), source.getMaster(), SecurityConstants.INNER); | |||
| if (receptionVo.isFail()) { | |||
| return AjaxResult.warn("接待模式任务获取失败,请检查"); | |||
| return AjaxResult.success(null); | |||
| } | |||
| @@ -332,10 +332,11 @@ public class ApiController { | |||
| //取值后清除缓存list,5秒后过期 | |||
| // RedisUtil.expire("dashboard:skill-consume", 5); | |||
| } | |||
| Long onlineCount = 0L; | |||
| Long onlineCount = 0L,manCount = 0L; | |||
| if (RedisUtil.existed(MessageConstants.REDIS_GROUP_DEVICE_HEADER)) { | |||
| List<Object> hashVals = RedisUtil.getObjectList(MessageConstants.REDIS_GROUP_DEVICE_HEADER); | |||
| List<DmManDeviceDto> dtos = hashVals.stream().map(item->(DmManDeviceDto)item).collect(Collectors.toList()); | |||
| manCount = Integer.valueOf(dtos.size()).longValue(); | |||
| onlineCount = dtos.stream().filter(item->(!item.getOnlineStatus().isEmpty()) && | |||
| item.getOnlineStatus().equalsIgnoreCase("1")).count(); | |||
| @@ -360,7 +361,7 @@ public class ApiController { | |||
| } | |||
| JSONObject json = new JSONObject(); | |||
| json.put("manCount",5);//数字人数 | |||
| json.put("manCount",manCount);//数字人数 | |||
| json.put("manOnlineCount",onlineCount);//数字人数 | |||
| json.put("recognizedPersonCount", recognition);//注册人员总数 | |||
| json.put("serviceTimeCount",serviceTimeCount);//总服务时间 | |||
| @@ -169,9 +169,17 @@ public class MeetingOrderTemplate implements BaseTemplate { | |||
| try { | |||
| //遍历roomListR.getData(),判断content中是否包含item.getName(),如果包含,则将item.getId()赋值给locationId | |||
| List<DmMeetingRoomsDto> aaa = roomListR.getData().stream().sorted((x,y)->y.getName().length() - x.getName().length()).collect(Collectors.toList()); | |||
| for (DmMeetingRoomsDto roomsDto : aaa) { | |||
| if (content.contains(roomsDto.getName())) { | |||
| List<DmMeetingRoomsDto> roomsDtoList = roomListR.getData().stream().sorted((x,y)->y.getName().length() - x.getName().length()).collect(Collectors.toList()); | |||
| String[] chinesenumber = {"一","二","三","四","五","六","七","八","九","十"}; | |||
| String[] number = {"1","2","3","4","5","6","7","8","9","10"}; | |||
| for (DmMeetingRoomsDto roomsDto : roomsDtoList) { | |||
| String roomName = roomsDto.getName(); | |||
| for(int i = 0;i<10;i++){ | |||
| if(roomName.contains(chinesenumber[i])){ | |||
| roomName = roomName.replace(chinesenumber[i], number[i]); | |||
| } | |||
| } | |||
| if (content.contains(roomName)) { | |||
| // 更新session中的locationId与location | |||
| session.getFormat().put("location",roomsDto.getName()); | |||
| session.getFormat().put("locationId",roomsDto.getId()); | |||
| @@ -238,10 +246,12 @@ public class MeetingOrderTemplate implements BaseTemplate { | |||
| //判断是否为确认或取消指令 | |||
| checkObject = session.getFormat(); | |||
| if(checkObject.containsKey("date") && checkObject.containsKey("start_time") && checkObject.containsKey("location") && checkObject.containsKey("duration") && content.contains("确认")){ | |||
| if(checkObject.containsKey("conflict")){ | |||
| if(checkObject.getInteger("conflict") == 0){ | |||
| session.getFormat().put("confirm", 1); | |||
| if(checkObject.containsKey("date") && checkObject.containsKey("start_time") && checkObject.containsKey("location") && checkObject.containsKey("duration")){ | |||
| if(content.contains("确定") || content.contains("确认")){ | |||
| if(checkObject.containsKey("conflict")){ | |||
| if(checkObject.getInteger("conflict") == 0){ | |||
| session.getFormat().put("confirm", 1); | |||
| } | |||
| } | |||
| } | |||
| } | |||
| @@ -18,6 +18,7 @@ import com.xueyi.common.security.annotation.InnerAuth; | |||
| import com.xueyi.common.security.annotation.RequiresPermissions; | |||
| import com.xueyi.common.web.entity.controller.BaseController; | |||
| import com.xueyi.common.web.utils.DateUtils; | |||
| import com.xueyi.file.api.feign.RemoteFileService; | |||
| import com.xueyi.message.api.transfer.feign.RemoteTransferService; | |||
| import com.xueyi.system.api.device.domain.vo.DeviceTenantSourceMergeVo; | |||
| import com.xueyi.system.api.device.feign.RemoteDeviceTenantMergeService; | |||
| @@ -449,4 +450,15 @@ public class DmDigitalmanController extends BaseController<DmDigitalmanQuery, Dm | |||
| public R netInfo() { | |||
| return R.ok(); | |||
| } | |||
| @Autowired | |||
| RemoteFileService fileService; | |||
| @GetMapping("/api/fileDel") | |||
| public R fileDel(String url) { | |||
| R<Boolean> r = fileService.delete(url); | |||
| log.info("删除文件返回结果:{}", r.getData()); | |||
| return R.ok(); | |||
| } | |||
| } | |||
| @@ -141,6 +141,7 @@ public class DmDigitalmanManager extends BaseManagerImpl<DmDigitalmanQuery, DmDi | |||
| sdmdto.setIconPos(mpo.getIconPos()); | |||
| DmResourcesPo screenOffPo = dmResourcesMapper.selectById(mpo.getCurrentScreenOff()); | |||
| sdmdto.setScreenOff(screenOffPo); | |||
| sdmdto.setDirection(mpo.getDirection()); | |||
| System.out.println(sdmdto); | |||
| return sdmdto; | |||
| } | |||
| @@ -5,6 +5,7 @@ import cn.hutool.core.util.ObjectUtil; | |||
| import com.alibaba.fastjson.JSONArray; | |||
| import com.alibaba.fastjson.JSONObject; | |||
| import com.xueyi.common.core.utils.core.IdUtil; | |||
| import com.xueyi.common.core.utils.core.StrUtil; | |||
| import com.xueyi.common.core.utils.file.FileTypeUtil; | |||
| import com.xueyi.common.core.utils.file.FileUtil; | |||
| import com.xueyi.common.core.utils.file.MimeTypeUtil; | |||
| @@ -111,6 +112,9 @@ public class DmResourcesController extends BaseController<DmResourcesQuery, DmRe | |||
| return super.edit(dmResources); | |||
| } | |||
| @Autowired | |||
| RemoteFileService fileService; | |||
| /** | |||
| * 静态资源批量删除 | |||
| */ | |||
| @@ -119,6 +123,12 @@ public class DmResourcesController extends BaseController<DmResourcesQuery, DmRe | |||
| @RequiresPermissions(Auth.DM_RESOURCES_DEL) | |||
| @Log(title = "静态资源管理", businessType = BusinessType.DELETE) | |||
| public AjaxResult batchRemove(@PathVariable List<Long> idList) { | |||
| for (Long id : idList) { | |||
| DmResourcesDto dmResources = iDmResourcesService.selectById(id); | |||
| if (null != dmResources && StrUtil.isNotEmpty(dmResources.getUrl())) { | |||
| fileService.delete(dmResources.getUrl()); | |||
| } | |||
| } | |||
| return super.batchRemove(idList); | |||
| } | |||
| @@ -5,17 +5,22 @@ import com.alibaba.fastjson.JSON; | |||
| import com.alibaba.fastjson.JSONObject; | |||
| import com.alibaba.nacos.api.exception.NacosException; | |||
| import com.aliyun.tea.utils.StringUtils; | |||
| import com.baomidou.dynamic.datasource.annotation.DSTransactional; | |||
| import com.xueyi.common.core.constant.nacos.NacosConstants; | |||
| import com.xueyi.common.web.entity.service.impl.BaseServiceImpl; | |||
| import com.xueyi.system.api.digitalmans.domain.dto.DmManDeviceDto; | |||
| import com.xueyi.system.digitalmans.domain.dto.DmDigitalmanDto; | |||
| import com.xueyi.system.digitalmans.domain.dto.DmDigitalmanExtDto; | |||
| import com.xueyi.system.digitalmans.domain.query.DmDigitalmanExtQuery; | |||
| import com.xueyi.system.digitalmans.domain.query.DmManDeviceQuery; | |||
| import com.xueyi.system.digitalmans.manager.IDmDigitalmanExtManager; | |||
| import com.xueyi.system.digitalmans.manager.IDmManDeviceManager; | |||
| import com.xueyi.system.digitalmans.service.IDmManDeviceService; | |||
| import com.xueyi.system.resource.domain.dto.DmH5ConfigDto; | |||
| import com.xueyi.system.resource.domain.query.DmH5ConfigQuery; | |||
| import com.xueyi.system.resource.manager.IDmH5ConfigManager; | |||
| import com.xueyi.system.resource.manager.impl.DmH5ConfigManager; | |||
| import com.xueyi.system.resource.service.IDmH5ConfigService; | |||
| import com.xueyi.system.resource.manager.IDmH5ConfigManager; | |||
| import com.xueyi.common.web.entity.service.impl.BaseServiceImpl; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| @@ -24,6 +29,7 @@ import org.springframework.stereotype.Service; | |||
| import java.io.Serializable; | |||
| import java.util.ArrayList; | |||
| import java.util.List; | |||
| import java.util.Objects; | |||
| import java.util.stream.Collectors; | |||
| /** | |||
| @@ -71,15 +77,20 @@ public class DmH5ConfigServiceImpl extends BaseServiceImpl<DmH5ConfigQuery, DmH5 | |||
| temp.setManCode(items.getManCode()); | |||
| try { | |||
| String property = nacosConfigManager.getConfigService().getConfig(item.getName(), NacosConstants.DEFAULT_GROUP, 5000); | |||
| JSONObject jo = JSON.parseObject(property); | |||
| if (jo != null && jo.containsKey("system")) { | |||
| JSONObject sys = jo.getJSONObject("system"); | |||
| if (sys != null && sys.containsKey("H5")) { | |||
| JSONObject H5 = sys.getJSONObject("H5"); | |||
| H5.put("streamUrl", streamUrl); | |||
| if(!StringUtils.isEmpty(property)){ | |||
| JSONObject jo = JSON.parseObject(property); | |||
| if (jo != null && jo.containsKey("system")) { | |||
| JSONObject sys = jo.getJSONObject("system"); | |||
| if (sys != null && sys.containsKey("H5")) { | |||
| JSONObject H5 = sys.getJSONObject("H5"); | |||
| H5.put("streamUrl", streamUrl); | |||
| } | |||
| } | |||
| temp.setProperty(jo.toString()); | |||
| } | |||
| else{ | |||
| continue; | |||
| } | |||
| temp.setProperty(jo.toString()); | |||
| } catch (NacosException ne) { | |||
| log.error("H5配置表上传nacos-获取配置文件失败:{}", ne.getMessage()); | |||
| } | |||
| @@ -137,14 +148,16 @@ public class DmH5ConfigServiceImpl extends BaseServiceImpl<DmH5ConfigQuery, DmH5 | |||
| DmManDeviceDto target = mdList.get(0); | |||
| try { | |||
| String property = nacosConfigManager.getConfigService().getConfig(dto.getName(), NacosConstants.DEFAULT_GROUP, 5000); | |||
| JSONObject jo = JSON.parseObject(property); | |||
| if (jo != null && jo.containsKey("system")) { | |||
| JSONObject sys = jo.getJSONObject("system"); | |||
| if (sys != null && sys.containsKey("H5")) { | |||
| JSONObject H5 = sys.getJSONObject("H5"); | |||
| String streamUrl = H5.getString("streamUrl"); | |||
| target.setStreamUrl(streamUrl); | |||
| dmManDeviceManager.update(target); | |||
| if (!StringUtils.isEmpty(property)) { | |||
| JSONObject jo = JSON.parseObject(property); | |||
| if (jo != null && jo.containsKey("system")) { | |||
| JSONObject sys = jo.getJSONObject("system"); | |||
| if (sys != null && sys.containsKey("H5")) { | |||
| JSONObject H5 = sys.getJSONObject("H5"); | |||
| String streamUrl = H5.getString("streamUrl"); | |||
| target.setStreamUrl(streamUrl); | |||
| dmManDeviceManager.update(target); | |||
| } | |||
| } | |||
| } | |||
| } catch (NacosException ne) { | |||
| @@ -215,16 +228,17 @@ public class DmH5ConfigServiceImpl extends BaseServiceImpl<DmH5ConfigQuery, DmH5 | |||
| if (StringUtils.isEmpty(streamUrl)) { | |||
| return null; | |||
| } | |||
| JSONObject jo = JSON.parseObject(result); | |||
| if (jo != null && jo.containsKey("system")) { | |||
| JSONObject sys = jo.getJSONObject("system"); | |||
| if (sys != null && sys.containsKey("H5")) { | |||
| JSONObject H5 = sys.getJSONObject("H5"); | |||
| H5.put("streamUrl", streamUrl); | |||
| if (!StringUtils.isEmpty(result)){ | |||
| JSONObject jo = JSON.parseObject(result); | |||
| if (jo != null && jo.containsKey("system")) { | |||
| JSONObject sys = jo.getJSONObject("system"); | |||
| if (sys != null && sys.containsKey("H5")) { | |||
| JSONObject H5 = sys.getJSONObject("H5"); | |||
| H5.put("streamUrl", streamUrl); | |||
| } | |||
| } | |||
| } | |||
| if (jo != null) | |||
| result = jo.toString(); | |||
| } | |||
| dto.setProperty(result); | |||
| } | |||
| return dto; | |||
| @@ -258,16 +272,17 @@ public class DmH5ConfigServiceImpl extends BaseServiceImpl<DmH5ConfigQuery, DmH5 | |||
| if (extList != null && extList.size() > 0) { | |||
| String streamUrl = extList.get(0).getStreamUrl(); | |||
| if (!StringUtils.isEmpty(streamUrl)) { | |||
| JSONObject jo = JSON.parseObject(result); | |||
| if (jo != null && jo.containsKey("system")) { | |||
| JSONObject sys = jo.getJSONObject("system"); | |||
| if (sys != null && sys.containsKey("H5")) { | |||
| JSONObject H5 = sys.getJSONObject("H5"); | |||
| H5.put("streamUrl", streamUrl); | |||
| if(!StringUtils.isEmpty(result)){ | |||
| JSONObject jo = JSON.parseObject(result); | |||
| if (jo != null && jo.containsKey("system")) { | |||
| JSONObject sys = jo.getJSONObject("system"); | |||
| if (sys != null && sys.containsKey("H5")) { | |||
| JSONObject H5 = sys.getJSONObject("H5"); | |||
| H5.put("streamUrl", streamUrl); | |||
| } | |||
| } | |||
| } | |||
| if (jo != null) | |||
| result = jo.toString(); | |||
| } | |||
| return result; | |||
| } else { | |||
| return result; | |||
| @@ -1,6 +1,7 @@ | |||
| package com.xueyi.system.staff.controller.api; | |||
| import com.alibaba.fastjson2.JSONObject; | |||
| import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |||
| import com.xueyi.common.cache.utils.SourceUtil; | |||
| import com.xueyi.common.core.constant.basic.SecurityConstants; | |||
| import com.xueyi.common.core.context.SecurityContextHolder; | |||
| @@ -9,8 +10,10 @@ import com.xueyi.common.redis.utils.RedisUtil; | |||
| import com.xueyi.common.web.annotation.TenantIgnore; | |||
| import com.xueyi.system.api.device.domain.vo.DeviceTenantSourceMergeVo; | |||
| import com.xueyi.system.api.model.Source; | |||
| import com.xueyi.system.api.pass.domain.po.DmRecognizedRecordsPo; | |||
| import com.xueyi.system.api.staff.domain.dto.DmStaffCommonDto; | |||
| import com.xueyi.system.api.staff.feign.RemoteStaffService; | |||
| import com.xueyi.system.pass.mapper.DmRecognizedRecordsMapper; | |||
| import com.xueyi.system.resource.controller.api.BaseApiController; | |||
| import com.xueyi.system.staff.service.impl.DmStaffServiceImpl; | |||
| import com.xueyi.tenant.api.tenant.domain.dto.TeTenantDto; | |||
| @@ -26,6 +29,7 @@ import org.springframework.web.bind.annotation.RequestMapping; | |||
| import org.springframework.web.bind.annotation.ResponseBody; | |||
| import org.springframework.web.bind.annotation.RestController; | |||
| import java.time.LocalDateTime; | |||
| import java.util.List; | |||
| /** | |||
| @@ -98,4 +102,33 @@ public class DmStaffApiController extends BaseApiController { | |||
| return outputSuccess().toJSON(); | |||
| } | |||
| @Autowired | |||
| DmRecognizedRecordsMapper recognizedRecordsMapper; | |||
| @GetMapping(value = "inner-recognized-records") | |||
| @ResponseBody | |||
| @TenantIgnore(tenantLine = true) | |||
| public R<List<DmRecognizedRecordsPo>> queryRecords(){ | |||
| List<DmRecognizedRecordsPo> lists = recognizedRecordsMapper.selectList(new LambdaQueryWrapper<DmRecognizedRecordsPo>().between(DmRecognizedRecordsPo::getRecognizedTime, LocalDateTime.now().minusDays(30), LocalDateTime.now())); | |||
| return R.ok(lists); | |||
| } | |||
| @GetMapping(value = "recognized-records") | |||
| @ResponseBody | |||
| public R<List<DmRecognizedRecordsPo>> recognizedRecords(){ | |||
| R<List<TeTenantDto>> listR = tenantService.tenantList(); | |||
| if (listR.isFail()) { | |||
| System.out.println("租户列表获取失败"); | |||
| return null; | |||
| } | |||
| List<TeTenantDto> res = listR.getData(); | |||
| TeTenantDto teTenantDto = res.get(0); | |||
| if (teTenantDto != null) { | |||
| Source source = SourceUtil.getSourceCache(teTenantDto.getStrategyId()); | |||
| // return countJson; | |||
| return staffService._recognizedRecords(teTenantDto.getId(), source.getMaster(), SecurityConstants.INNER); | |||
| } | |||
| return null; | |||
| } | |||
| } | |||
| @@ -15,17 +15,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |||
| <result property="delFlag" column="del_flag" /> | |||
| <result property="firstCall" column="first_call" /> | |||
| <result property="status" column="status" /> | |||
| <result property="leavingResp" column="leaving_resp" /> | |||
| <result property="welcomByMeetingTime" column="welcom_by_meeting_time" /> | |||
| </resultMap> | |||
| <select id="selectSkillListByH5" parameterType="DmSyncDigitalmanVo" resultMap="DmSkillResult"> | |||
| select s.id, s.man_id,s.status, s.first_call, s.skill_code, s.info, s.del_flag, s.resp, s.motion_id, s.motion_name from dm_skills s | |||
| select s.id, s.man_id,s.status, s.first_call, s.skill_code, s.info, s.del_flag, s.resp, s.motion_id, s.motion_name,s.leaving_resp,s.welcom_by_meeting_time from dm_skills s | |||
| where (UNIX_TIMESTAMP(s.update_time) * 1000 > #{timestamp} or UNIX_TIMESTAMP(s.create_time) * 1000 > #{timestamp} ) and man_id = #{manId} | |||
| </select> | |||
| <select id="selectSkillByCode" parameterType="String" resultMap="DmSkillResult"> | |||
| select s.id, s.man_id,s.status, s.first_call, s.skill_code, s.info, s.del_flag, s.resp, s.motion_id, s.motion_name, s.auth from dm_skills s | |||
| select s.id, s.man_id,s.status, s.first_call, s.skill_code, s.info, s.del_flag, s.resp, s.motion_id, s.motion_name, s.auth,s.leaving_resp,s.welcom_by_meeting_time from dm_skills s | |||
| where s.skill_code = #{skillCode} limit 1 | |||
| </select> | |||
| </mapper> | |||