Merge remote-tracking branch 'origin/jtdev' into jtdev
6 files modified
6 files added
| New file |
| | |
| | | package cn.gistack.sm.appmanage.controller; |
| | | |
| | | import cn.gistack.sm.appmanage.entity.AppManage; |
| | | import cn.gistack.sm.appmanage.service.IAppManageService; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * @ClassName app管理 |
| | | * @Description TODO |
| | | * @Author aix |
| | | * @Date 2023/4/26 20:55 |
| | | * @Version 1.0 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags="app管理") |
| | | @RestController |
| | | @RequestMapping("/app/manage") |
| | | @AllArgsConstructor |
| | | public class AppManageController { |
| | | |
| | | private IAppManageService appManageService; |
| | | |
| | | /** |
| | | * 分页列表查询 |
| | | * |
| | | * @param appManage |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "app管理-分页列表查询", notes = "app管理-分页列表查询") |
| | | @GetMapping(value = "/list") |
| | | public R queryPageList(AppManage appManage, Query query) { |
| | | IPage<AppManage> pageList = appManageService.page(Condition.getPage(query), Condition.getQueryWrapper(appManage)); |
| | | return R.data(pageList); |
| | | } |
| | | |
| | | /** |
| | | * 添加 |
| | | * |
| | | * @param appManage |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "app管理-添加", notes = "app管理-添加") |
| | | @PostMapping(value = "/add") |
| | | public R add(@RequestBody AppManage appManage) { |
| | | return R.data(appManageService.save(appManage)); |
| | | } |
| | | |
| | | /** |
| | | * 编辑 |
| | | * |
| | | * @param appManage |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "app管理-编辑", notes = "app管理-编辑") |
| | | @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST}) |
| | | public R edit(@RequestBody AppManage appManage) { |
| | | return R.data(appManageService.updateById(appManage)); |
| | | } |
| | | |
| | | /** |
| | | * 通过id删除 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "app管理-通过id删除", notes = "app管理-通过id删除") |
| | | @DeleteMapping(value = "/delete") |
| | | public R<?> delete(@RequestParam(name = "id", required = true) String id) { |
| | | return R.data(appManageService.removeById(id)); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.appmanage.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | import org.springblade.core.mp.base.BaseEntity; |
| | | |
| | | /** |
| | | * @ClassName AppManage |
| | | * @Description TODO |
| | | * @Author aix |
| | | * @Date 2023/4/26 20:31 |
| | | * @Version 1.0 |
| | | */ |
| | | @Data |
| | | @TableName("sm_app_manage") |
| | | @ApiModel(value = "app管理", description = "app管理对象") |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | public class AppManage extends BaseEntity { |
| | | /** |
| | | * 设备类型 |
| | | */ |
| | | @ApiModelProperty(value = "设备类型") |
| | | private String appType; |
| | | /** |
| | | * 设备版本 |
| | | */ |
| | | @ApiModelProperty(value = "设备版本") |
| | | private String appVersion; |
| | | /** |
| | | * 版本编码 |
| | | */ |
| | | @ApiModelProperty(value = "版本编码") |
| | | private String appNo; |
| | | /** |
| | | * 存储路径 |
| | | */ |
| | | @ApiModelProperty(value = "存储路径") |
| | | private String path; |
| | | /** |
| | | * 是否强制更新 |
| | | */ |
| | | @ApiModelProperty(value = "是否强制更新") |
| | | private Integer isForce; |
| | | /** |
| | | * 是否提示 |
| | | */ |
| | | @ApiModelProperty(value = "是否提示") |
| | | private Integer isHint; |
| | | /** |
| | | * 更新内容 |
| | | */ |
| | | @ApiModelProperty(value = "更新内容") |
| | | private String remarks; |
| | | |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.appmanage.mapper; |
| | | |
| | | import cn.gistack.sm.appmanage.entity.AppManage; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | | /** |
| | | * @ClassName AppManageMapper |
| | | * @Description TODO |
| | | * @Author aix |
| | | * @Date 2023/4/26 20:52 |
| | | * @Version 1.0 |
| | | */ |
| | | public interface AppManageMapper extends BaseMapper<AppManage> { |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="cn.gistack.sm.appmanage.mapper.AppManageMapper"> |
| | | |
| | | |
| | | </mapper> |
| New file |
| | |
| | | package cn.gistack.sm.appmanage.service; |
| | | |
| | | import cn.gistack.sm.appmanage.entity.AppManage; |
| | | import org.springblade.core.mp.base.BaseService; |
| | | |
| | | /** |
| | | * @ClassName IAppmanageService |
| | | * @Description TODO |
| | | * @Author aix |
| | | * @Date 2023/4/26 20:53 |
| | | * @Version 1.0 |
| | | */ |
| | | public interface IAppManageService extends BaseService<AppManage> { |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.appmanage.service.impl; |
| | | |
| | | import cn.gistack.sm.appmanage.entity.AppManage; |
| | | import cn.gistack.sm.appmanage.mapper.AppManageMapper; |
| | | import cn.gistack.sm.appmanage.service.IAppManageService; |
| | | import org.springblade.core.mp.base.BaseServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * @ClassName AppManageService |
| | | * @Description TODO |
| | | * @Author aix |
| | | * @Date 2023/4/26 20:54 |
| | | * @Version 1.0 |
| | | */ |
| | | @Service |
| | | public class AppManageService extends BaseServiceImpl<AppManageMapper, AppManage> implements IAppManageService { |
| | | } |
| | |
| | | public R queryHkPreviewUrl(HkVO hk) { |
| | | String url = ""; |
| | | // 获取海康播放url |
| | | String result = GetCameraPreviewURL(HkConstant.previewURLs, hk.getCameraIndexCode(), ProtocolConstant.HLS); |
| | | String result = GetCameraPreviewURL(HkConstant.previewURLs, hk.getCameraIndexCode(), ProtocolConstant.WS); |
| | | if (null!=result) { |
| | | JSONObject jsonObject = JSONObject.parseObject(result); |
| | | Map map = (Map) jsonObject.get("data"); |
| | |
| | | // //e2cb261e14144f53a300769839d54753 |
| | | // //根据子节点编号获取设备播放地址 |
| | | // String result3 = GetCameraPreviewURL(HkConstant.previewURLs, |
| | | // "ff1f050afd1c47829dec1ec14575c9e3", ProtocolConstant.HLS); |
| | | // "0113d3498d2e41caaf9e5355d1575da3", ProtocolConstant.WS); |
| | | // JSONObject jsonObject = JSONObject.parseObject(result3); |
| | | // Map map = (Map) jsonObject.get("data"); |
| | | // //根据子节点编号获取音频对讲地址 |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/createCall") |
| | | public R createCall(@RequestBody List<Map<String,String>> list){ |
| | | public R createCall(@RequestBody Map<String,Object> map){ |
| | | // 返回 |
| | | return R.data(callService.createTask(list)); |
| | | return R.data(callService.createTask(map)); |
| | | } |
| | | |
| | | /** |
| | |
| | | select |
| | | ct."id", |
| | | ct."task_name" as taskName, |
| | | ct."gmt_create" as createTime, |
| | | date_format(ct."gmt_create",'yyyy-MM-dd HH:mm:ss') as createTime, |
| | | ct."task_status" as taskStatus, |
| | | ctr."calling_number" as callingNumber, |
| | | ctr."callee_number" as calleeNumber, |
| | | ctr."gmt_create" as executeTime, |
| | | date_format(ctr."gmt_create",'yyyy-MM-dd HH:mm:ss') as executeTime, |
| | | ctra."callee_number_count" as calleeNumberCount, |
| | | ctra."connection_count" as connectionCount, |
| | | ctra."failure_count" as failureCount, |
| | |
| | | ctr."call_conversation_round" as callConversationRound, |
| | | ctr."call_hangup_direction" as callHangupDirection, |
| | | ctr."call_id" as callId, |
| | | ctr."gmt_create" as gmtCreate, |
| | | date_format(ctr."gmt_create",'yyyy-MM-dd HH:mm:ss') as gmtCreate, |
| | | ctr."calling_number" as callingNumber, |
| | | ctr."callee_number" as calleeNumber, |
| | | ctr."task_id" as taskId, |
| | |
| | | |
| | | /** |
| | | * 创建任务 |
| | | * @param params |
| | | * @param map |
| | | * @return |
| | | */ |
| | | Object createTask(List<Map<String, String>> params); |
| | | Object createTask(Map<String,Object> map); |
| | | |
| | | /** |
| | | * 获取通话详情 |
| | |
| | | |
| | | /** |
| | | * 创建任务 |
| | | * @param params |
| | | * @param map |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Object createTask(List<Map<String, String>> params) { |
| | | public Object createTask(Map<String,Object> map) { |
| | | List<Map<String, String>> params = (List<Map<String, String>>) map.get("list"); |
| | | String requestUrl = url + CREATE_TASK_URL; |
| | | LocalDateTime now = LocalDateTime.now(); |
| | | String timestamp = now.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss SSS")); |
| | | String transId = generateTransId(now); |
| | | String taskName = now.format(DateTimeFormatter.ofPattern("yyyy年MM月dd日HH:mm")) + "智能外呼"; |
| | | // String taskName = now.format(DateTimeFormatter.ofPattern("yyyy年MM月dd日HH:mm")) + "智能外呼"; |
| | | String taskName = map.get("taskName").toString(); |
| | | String[] numbers = StringUtils.split(callingNumbers,","); |
| | | String taskScheduleTime = LocalDateTime.now().plusHours(1).format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); |
| | | // String taskScheduleTime = LocalDateTime.now().plusHours(1).format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); |
| | | String taskScheduleTime = map.get("taskScheduleTime").toString(); |
| | | JSONArray arr = getCalleeInfo(params); |
| | | HttpHeaders httpHeaders = new HttpHeaders(); |
| | | httpHeaders.add("Content-Type", CONTENT_TYPE); |