69 changed files with 2364 additions and 1155 deletions
@ -1,245 +0,0 @@ |
|||
package cn.iocoder.yudao.module.interphone.controller.admin; |
|||
|
|||
import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
|||
import cn.iocoder.yudao.module.interphone.service.InterphoneApiService; |
|||
import io.swagger.v3.oas.annotations.Operation; |
|||
import io.swagger.v3.oas.annotations.Parameter; |
|||
import io.swagger.v3.oas.annotations.Parameters; |
|||
import io.swagger.v3.oas.annotations.tags.Tag; |
|||
import jakarta.annotation.Resource; |
|||
import jakarta.annotation.security.PermitAll; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.web.bind.annotation.GetMapping; |
|||
import org.springframework.web.bind.annotation.PostMapping; |
|||
import org.springframework.web.bind.annotation.RequestBody; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RequestParam; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
import java.util.Map; |
|||
|
|||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; |
|||
|
|||
@Tag(name = "开放接口 - 对讲平台代理") |
|||
@RestController |
|||
@RequestMapping("/interphone/open-api") |
|||
@Validated |
|||
public class InterphoneOpenController { |
|||
|
|||
@Resource |
|||
private InterphoneApiService interphoneApiService; |
|||
|
|||
@GetMapping("/profile/agent") |
|||
@Operation(summary = "获取代理商个人信息") |
|||
@PermitAll |
|||
public CommonResult<String> getAgentProfile() { |
|||
return success(interphoneApiService.getAgentProfile()); |
|||
} |
|||
|
|||
@GetMapping("/agent/list") |
|||
@Operation(summary = "查询代理商列表") |
|||
@Parameters({ |
|||
@Parameter(name = "pageNo", description = "页码", required = true), |
|||
@Parameter(name = "pageSize", description = "每页数量", required = true), |
|||
@Parameter(name = "name", description = "代理商名称") |
|||
}) |
|||
@PermitAll |
|||
public CommonResult<String> getAgentList(@RequestParam("pageNo") Integer pageNo, |
|||
@RequestParam("pageSize") Integer pageSize, |
|||
@RequestParam(value = "name", required = false) String name) { |
|||
return success(interphoneApiService.getAgentList(pageNo, pageSize, name)); |
|||
} |
|||
|
|||
@GetMapping("/agent/detail") |
|||
@Operation(summary = "查询代理商详情") |
|||
@Parameter(name = "id", description = "代理商 ID", required = true) |
|||
@PermitAll |
|||
public CommonResult<String> getAgentDetail(@RequestParam("id") String id) { |
|||
return success(interphoneApiService.getAgentDetail(id)); |
|||
} |
|||
|
|||
@GetMapping("/profile/faststats") |
|||
@Operation(summary = "查询代理商单位群组用户统计") |
|||
@PermitAll |
|||
public CommonResult<String> getFastStats() { |
|||
return success(interphoneApiService.getFastStats()); |
|||
} |
|||
|
|||
@GetMapping("/group/getGroupName") |
|||
@Operation(summary = "查询群组名称") |
|||
@Parameter(name = "orgId", description = "单位 ID", required = true) |
|||
@PermitAll |
|||
public CommonResult<String> getGroupName(@RequestParam("orgId") String orgId) { |
|||
return success(interphoneApiService.getGroupName(orgId)); |
|||
} |
|||
|
|||
@GetMapping("/terminal/querySubordinateUser") |
|||
@Operation(summary = "查询下级用户") |
|||
@Parameters({ |
|||
@Parameter(name = "pageNo", description = "页码", required = true), |
|||
@Parameter(name = "pageSize", description = "每页数量", required = true), |
|||
@Parameter(name = "agentId", description = "代理商 ID"), |
|||
@Parameter(name = "orgId", description = "单位 ID"), |
|||
@Parameter(name = "groupId", description = "群组 ID"), |
|||
@Parameter(name = "userName", description = "用户名称"), |
|||
@Parameter(name = "account", description = "账号") |
|||
}) |
|||
@PermitAll |
|||
public CommonResult<String> querySubordinateUser(@RequestParam("pageNo") Integer pageNo, |
|||
@RequestParam("pageSize") Integer pageSize, |
|||
@RequestParam(value = "agentId", required = false) String agentId, |
|||
@RequestParam(value = "orgId", required = false) String orgId, |
|||
@RequestParam(value = "groupId", required = false) String groupId, |
|||
@RequestParam(value = "userName", required = false) String userName, |
|||
@RequestParam(value = "account", required = false) String account) { |
|||
return success(interphoneApiService.querySubordinateUser(pageNo, pageSize, agentId, orgId, groupId, userName, account)); |
|||
} |
|||
|
|||
@GetMapping("/agent/orgs") |
|||
@Operation(summary = "查询单位列表") |
|||
@Parameters({ |
|||
@Parameter(name = "pageNo", description = "页码", required = true), |
|||
@Parameter(name = "pageSize", description = "每页数量", required = true), |
|||
@Parameter(name = "name", description = "单位名称") |
|||
}) |
|||
@PermitAll |
|||
public CommonResult<String> getAgentOrgs(@RequestParam("pageNo") Integer pageNo, |
|||
@RequestParam("pageSize") Integer pageSize, |
|||
@RequestParam(value = "name", required = false) String name) { |
|||
return success(interphoneApiService.getAgentOrgs(pageNo, pageSize, name)); |
|||
} |
|||
|
|||
@GetMapping("/group/list") |
|||
@Operation(summary = "查询群组列表") |
|||
@Parameters({ |
|||
@Parameter(name = "pageNo", description = "页码", required = true), |
|||
@Parameter(name = "pageSize", description = "每页数量", required = true), |
|||
@Parameter(name = "name", description = "群组名称"), |
|||
@Parameter(name = "orgname", description = "单位名称") |
|||
}) |
|||
@PermitAll |
|||
public CommonResult<String> getGroupList(@RequestParam("pageNo") Integer pageNo, |
|||
@RequestParam("pageSize") Integer pageSize, |
|||
@RequestParam(value = "name", required = false) String name, |
|||
@RequestParam(value = "orgname", required = false) String orgName) { |
|||
return success(interphoneApiService.getGroupList(pageNo, pageSize, name, orgName)); |
|||
} |
|||
|
|||
@PostMapping("/group/add") |
|||
@Operation(summary = "新增群组") |
|||
@PermitAll |
|||
public CommonResult<String> addGroup(@RequestBody String requestBody) { |
|||
return success(interphoneApiService.addGroup(requestBody)); |
|||
} |
|||
|
|||
@GetMapping("/group/detail") |
|||
@Operation(summary = "查询群组详情") |
|||
@Parameter(name = "id", description = "群组 ID", required = true) |
|||
@PermitAll |
|||
public CommonResult<String> getGroupDetail(@RequestParam("id") String id) { |
|||
return success(interphoneApiService.getGroupDetail(id)); |
|||
} |
|||
|
|||
@PostMapping("/group/updateGroup") |
|||
@Operation(summary = "编辑群组") |
|||
@PermitAll |
|||
public CommonResult<String> updateGroup(@RequestBody String requestBody) { |
|||
return success(interphoneApiService.updateGroup(requestBody)); |
|||
} |
|||
|
|||
@PostMapping("/group/delete") |
|||
@Operation(summary = "删除群组") |
|||
@PermitAll |
|||
public CommonResult<String> deleteGroup(@RequestBody String requestBody) { |
|||
return success(interphoneApiService.deleteGroup(requestBody)); |
|||
} |
|||
|
|||
@GetMapping("/group/members") |
|||
@Operation(summary = "获取群组成员") |
|||
@Parameter(name = "id", description = "群组 ID", required = true) |
|||
@PermitAll |
|||
public CommonResult<String> getGroupMembers(@RequestParam("id") String id) { |
|||
return success(interphoneApiService.getGroupMembers(id)); |
|||
} |
|||
|
|||
@PostMapping("/group/members/add") |
|||
@Operation(summary = "添加群组成员") |
|||
@PermitAll |
|||
public CommonResult<String> addGroupMembers(@RequestBody String requestBody) { |
|||
return success(interphoneApiService.addGroupMembers(requestBody)); |
|||
} |
|||
|
|||
@PostMapping("/group/members/remove") |
|||
@Operation(summary = "移除群组成员") |
|||
@PermitAll |
|||
public CommonResult<String> removeGroupMembers(@RequestBody String requestBody) { |
|||
return success(interphoneApiService.removeGroupMembers(requestBody)); |
|||
} |
|||
|
|||
@GetMapping("/jsp/queryGroupByUId") |
|||
@Operation(summary = "查询用户群组") |
|||
@PermitAll |
|||
public CommonResult<String> queryGroupByUid(@RequestParam Map<String, String> queryParams) { |
|||
return success(interphoneApiService.queryGroupByUid(queryParams)); |
|||
} |
|||
|
|||
@PostMapping("/terminal/batch") |
|||
@Operation(summary = "创建对讲用户") |
|||
@PermitAll |
|||
public CommonResult<String> createTerminalUsers(@RequestBody String requestBody) { |
|||
return success(interphoneApiService.createTerminalUsers(requestBody)); |
|||
} |
|||
|
|||
@GetMapping("/terminal/list") |
|||
@Operation(summary = "查询对讲用户列表") |
|||
@Parameters({ |
|||
@Parameter(name = "pageNo", description = "页码", required = true), |
|||
@Parameter(name = "pageSize", description = "每页数量", required = true), |
|||
@Parameter(name = "org_id", description = "单位 ID"), |
|||
@Parameter(name = "groupId", description = "群组 ID"), |
|||
@Parameter(name = "name", description = "用户名称") |
|||
}) |
|||
@PermitAll |
|||
public CommonResult<String> getTerminalList(@RequestParam("pageNo") Integer pageNo, |
|||
@RequestParam("pageSize") Integer pageSize, |
|||
@RequestParam(value = "org_id", required = false) String orgId, |
|||
@RequestParam(value = "groupId", required = false) String groupId, |
|||
@RequestParam(value = "name", required = false) String name) { |
|||
return success(interphoneApiService.getTerminalList(pageNo, pageSize, orgId, groupId, name)); |
|||
} |
|||
|
|||
@GetMapping("/terminal/detail") |
|||
@Operation(summary = "查询对讲用户详情") |
|||
@PermitAll |
|||
public CommonResult<String> getTerminalDetail(@RequestParam Map<String, String> queryParams) { |
|||
return success(interphoneApiService.getTerminalDetail(queryParams)); |
|||
} |
|||
|
|||
@PostMapping("/terminal/updateUser") |
|||
@Operation(summary = "修改对讲用户信息") |
|||
@PermitAll |
|||
public CommonResult<String> updateTerminalUser(@RequestBody String requestBody) { |
|||
return success(interphoneApiService.updateTerminalUser(requestBody)); |
|||
} |
|||
|
|||
@PostMapping("/terminal/deleteUser") |
|||
@Operation(summary = "删除对讲用户") |
|||
@PermitAll |
|||
public CommonResult<String> deleteTerminalUser(@RequestBody String requestBody) { |
|||
return success(interphoneApiService.deleteTerminalUser(requestBody)); |
|||
} |
|||
|
|||
@GetMapping("/terminal/userOnlineStatus") |
|||
@Operation(summary = "查询对讲用户在线状态") |
|||
@PermitAll |
|||
public CommonResult<String> getTerminalUserOnlineStatus(@RequestParam Map<String, String> queryParams) { |
|||
return success(interphoneApiService.getTerminalUserOnlineStatus(queryParams)); |
|||
} |
|||
|
|||
@GetMapping("/record/list") |
|||
@Operation(summary = "查询录音列表") |
|||
@PermitAll |
|||
public CommonResult<String> getRecordList(@RequestParam Map<String, String> queryParams) { |
|||
return success(interphoneApiService.getRecordList(queryParams)); |
|||
} |
|||
} |
|||
@ -0,0 +1,49 @@ |
|||
package cn.iocoder.yudao.module.interphone.controller.admin.agent; |
|||
|
|||
import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
|||
import cn.iocoder.yudao.module.interphone.service.InterphoneAgentService; |
|||
import io.swagger.v3.oas.annotations.Operation; |
|||
import io.swagger.v3.oas.annotations.Parameter; |
|||
import io.swagger.v3.oas.annotations.Parameters; |
|||
import io.swagger.v3.oas.annotations.tags.Tag; |
|||
import jakarta.annotation.Resource; |
|||
import jakarta.annotation.security.PermitAll; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.web.bind.annotation.GetMapping; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RequestParam; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; |
|||
|
|||
@Tag(name = "开放接口 - 对讲平台代理商") |
|||
@RestController |
|||
@RequestMapping("/interphone/open-api/agent") |
|||
@Validated |
|||
public class InterphoneAgentController { |
|||
|
|||
@Resource |
|||
private InterphoneAgentService interphoneAgentService; |
|||
|
|||
@GetMapping("/list") |
|||
@Operation(summary = "查询代理商列表") |
|||
@Parameters({ |
|||
@Parameter(name = "pageNo", description = "页码", required = true), |
|||
@Parameter(name = "pageSize", description = "每页数量", required = true), |
|||
@Parameter(name = "name", description = "代理商名称") |
|||
}) |
|||
@PermitAll |
|||
public CommonResult<String> getAgentList(@RequestParam("pageNo") Integer pageNo, |
|||
@RequestParam("pageSize") Integer pageSize, |
|||
@RequestParam(value = "name", required = false) String name) { |
|||
return success(interphoneAgentService.getAgentList(pageNo, pageSize, name)); |
|||
} |
|||
|
|||
@GetMapping("/detail") |
|||
@Operation(summary = "查询代理商详情") |
|||
@Parameter(name = "id", description = "代理商 ID", required = true) |
|||
@PermitAll |
|||
public CommonResult<String> getAgentDetail(@RequestParam("id") String id) { |
|||
return success(interphoneAgentService.getAgentDetail(id)); |
|||
} |
|||
} |
|||
@ -0,0 +1,104 @@ |
|||
package cn.iocoder.yudao.module.interphone.controller.admin.group; |
|||
|
|||
import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
|||
import cn.iocoder.yudao.module.interphone.service.InterphoneGroupService; |
|||
import io.swagger.v3.oas.annotations.Operation; |
|||
import io.swagger.v3.oas.annotations.Parameter; |
|||
import io.swagger.v3.oas.annotations.Parameters; |
|||
import io.swagger.v3.oas.annotations.tags.Tag; |
|||
import jakarta.annotation.Resource; |
|||
import jakarta.annotation.security.PermitAll; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.web.bind.annotation.GetMapping; |
|||
import org.springframework.web.bind.annotation.PostMapping; |
|||
import org.springframework.web.bind.annotation.RequestBody; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RequestParam; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; |
|||
|
|||
@Tag(name = "开放接口 - 对讲平台群组") |
|||
@RestController |
|||
@RequestMapping("/interphone/open-api/group") |
|||
@Validated |
|||
public class InterphoneGroupController { |
|||
|
|||
@Resource |
|||
private InterphoneGroupService interphoneGroupService; |
|||
|
|||
@GetMapping("/getGroupName") |
|||
@Operation(summary = "查询群组名称") |
|||
@Parameter(name = "orgId", description = "单位 ID", required = true) |
|||
@PermitAll |
|||
public CommonResult<String> getGroupName(@RequestParam("orgId") String orgId) { |
|||
return success(interphoneGroupService.getGroupName(orgId)); |
|||
} |
|||
|
|||
@GetMapping("/list") |
|||
@Operation(summary = "查询群组列表") |
|||
@Parameters({ |
|||
@Parameter(name = "pageNo", description = "页码", required = true), |
|||
@Parameter(name = "pageSize", description = "每页数量", required = true), |
|||
@Parameter(name = "name", description = "群组名称"), |
|||
@Parameter(name = "orgname", description = "单位名称") |
|||
}) |
|||
@PermitAll |
|||
public CommonResult<String> getGroupList(@RequestParam("pageNo") Integer pageNo, |
|||
@RequestParam("pageSize") Integer pageSize, |
|||
@RequestParam(value = "name", required = false) String name, |
|||
@RequestParam(value = "orgname", required = false) String orgName) { |
|||
return success(interphoneGroupService.getGroupList(pageNo, pageSize, name, orgName)); |
|||
} |
|||
|
|||
@PostMapping("/add") |
|||
@Operation(summary = "新增群组") |
|||
@PermitAll |
|||
public CommonResult<String> addGroup(@RequestBody String requestBody) { |
|||
return success(interphoneGroupService.addGroup(requestBody)); |
|||
} |
|||
|
|||
@GetMapping("/detail") |
|||
@Operation(summary = "查询群组详情") |
|||
@Parameter(name = "id", description = "群组 ID", required = true) |
|||
@PermitAll |
|||
public CommonResult<String> getGroupDetail(@RequestParam("id") String id) { |
|||
return success(interphoneGroupService.getGroupDetail(id)); |
|||
} |
|||
|
|||
@PostMapping("/updateGroup") |
|||
@Operation(summary = "编辑群组") |
|||
@PermitAll |
|||
public CommonResult<String> updateGroup(@RequestBody String requestBody) { |
|||
return success(interphoneGroupService.updateGroup(requestBody)); |
|||
} |
|||
|
|||
@PostMapping("/delete") |
|||
@Operation(summary = "删除群组") |
|||
@PermitAll |
|||
public CommonResult<String> deleteGroup(@RequestBody String requestBody) { |
|||
return success(interphoneGroupService.deleteGroup(requestBody)); |
|||
} |
|||
|
|||
@GetMapping("/members") |
|||
@Operation(summary = "获取群组成员") |
|||
@Parameter(name = "id", description = "群组 ID", required = true) |
|||
@PermitAll |
|||
public CommonResult<String> getGroupMembers(@RequestParam("id") String id) { |
|||
return success(interphoneGroupService.getGroupMembers(id)); |
|||
} |
|||
|
|||
@PostMapping("/members/add") |
|||
@Operation(summary = "添加群组成员") |
|||
@PermitAll |
|||
public CommonResult<String> addGroupMembers(@RequestBody String requestBody) { |
|||
return success(interphoneGroupService.addGroupMembers(requestBody)); |
|||
} |
|||
|
|||
@PostMapping("/members/remove") |
|||
@Operation(summary = "移除群组成员") |
|||
@PermitAll |
|||
public CommonResult<String> removeGroupMembers(@RequestBody String requestBody) { |
|||
return success(interphoneGroupService.removeGroupMembers(requestBody)); |
|||
} |
|||
} |
|||
@ -0,0 +1,34 @@ |
|||
package cn.iocoder.yudao.module.interphone.controller.admin.jsp; |
|||
|
|||
import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
|||
import cn.iocoder.yudao.module.interphone.service.InterphoneJspService; |
|||
import io.swagger.v3.oas.annotations.Operation; |
|||
import io.swagger.v3.oas.annotations.tags.Tag; |
|||
import jakarta.annotation.Resource; |
|||
import jakarta.annotation.security.PermitAll; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.web.bind.annotation.GetMapping; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RequestParam; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
import java.util.Map; |
|||
|
|||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; |
|||
|
|||
@Tag(name = "开放接口 - 对讲平台用户群组") |
|||
@RestController |
|||
@RequestMapping("/interphone/open-api/jsp") |
|||
@Validated |
|||
public class InterphoneJspController { |
|||
|
|||
@Resource |
|||
private InterphoneJspService interphoneJspService; |
|||
|
|||
@GetMapping("/queryGroupByUId") |
|||
@Operation(summary = "查询用户群组") |
|||
@PermitAll |
|||
public CommonResult<String> queryGroupByUid(@RequestParam Map<String, String> queryParams) { |
|||
return success(interphoneJspService.queryGroupByUid(queryParams)); |
|||
} |
|||
} |
|||
@ -0,0 +1,35 @@ |
|||
package cn.iocoder.yudao.module.interphone.controller.admin.org; |
|||
|
|||
import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
|||
import cn.iocoder.yudao.framework.common.pojo.PageResult; |
|||
import cn.iocoder.yudao.module.interphone.controller.admin.org.vo.InterphoneOrgCreateReqVO; |
|||
import cn.iocoder.yudao.module.interphone.controller.admin.org.vo.InterphoneOrgPageReqVO; |
|||
import cn.iocoder.yudao.module.interphone.controller.admin.org.vo.InterphoneOrgRespVO; |
|||
import cn.iocoder.yudao.module.interphone.service.InterphoneOrgService; |
|||
import io.swagger.v3.oas.annotations.Operation; |
|||
import io.swagger.v3.oas.annotations.tags.Tag; |
|||
import jakarta.annotation.Resource; |
|||
import jakarta.annotation.security.PermitAll; |
|||
import jakarta.validation.Valid; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; |
|||
|
|||
@Tag(name = "开放接口 - 对讲平台单位创建") |
|||
@RestController |
|||
@RequestMapping("/interphone/open-api/org") |
|||
@Validated |
|||
public class InterphoneOrgController { |
|||
|
|||
@Resource |
|||
private InterphoneOrgService interphoneOrgService; |
|||
|
|||
@GetMapping("/orgs") |
|||
@Operation(summary = "查询单位列表") |
|||
@PermitAll |
|||
public CommonResult<PageResult<InterphoneOrgRespVO>> getAgentOrgs(@Valid InterphoneOrgPageReqVO reqVO) { |
|||
return success(interphoneOrgService.getAgentOrgs(reqVO)); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,40 @@ |
|||
package cn.iocoder.yudao.module.interphone.controller.admin.org.vo; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonIgnore; |
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import jakarta.validation.constraints.AssertTrue; |
|||
import jakarta.validation.constraints.Max; |
|||
import jakarta.validation.constraints.Min; |
|||
import jakarta.validation.constraints.NotBlank; |
|||
import jakarta.validation.constraints.NotNull; |
|||
import lombok.Data; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
|
|||
@Schema(description = "管理后台 - 对讲平台单位创建 Request VO") |
|||
@Data |
|||
public class InterphoneOrgCreateReqVO { |
|||
|
|||
@Schema(description = "单位id(uuid类型)") |
|||
private String id; |
|||
|
|||
@Schema(description = "单位名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "测试平台") |
|||
@NotBlank(message = "单位名称不能为空") |
|||
private String name; |
|||
|
|||
@Schema(description = "账号", requiredMode = Schema.RequiredMode.REQUIRED, example = "broadtest") |
|||
private String loginname; |
|||
|
|||
@Schema(description = "密码", requiredMode = Schema.RequiredMode.REQUIRED, example = "123456") |
|||
private String password; |
|||
|
|||
@Schema(description = "联系人", requiredMode = Schema.RequiredMode.REQUIRED, example = "测试测试") |
|||
private String contact; |
|||
|
|||
@Schema(description = "手机号", example = "13800138000") |
|||
private String phone; |
|||
|
|||
@Schema(description = "详细地址", example = "广东省深圳市") |
|||
private String address; |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,15 @@ |
|||
package cn.iocoder.yudao.module.interphone.controller.admin.org.vo; |
|||
|
|||
import cn.iocoder.yudao.framework.common.pojo.PageParam; |
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
@Schema(description = "管理后台 - 对讲平台单位分页 Request VO") |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
public class InterphoneOrgPageReqVO extends PageParam { |
|||
|
|||
@Schema(description = "单位名称", example = "测试平台") |
|||
private String name; |
|||
} |
|||
@ -0,0 +1,88 @@ |
|||
package cn.iocoder.yudao.module.interphone.controller.admin.org.vo; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonProperty; |
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.Data; |
|||
|
|||
@Schema(description = "管理后台 - 对讲平台单位 Response VO") |
|||
@Data |
|||
public class InterphoneOrgRespVO { |
|||
|
|||
@Schema(description = "单位自增 ID", example = "865") |
|||
@JsonProperty("corg_id") |
|||
private Long corgId; |
|||
|
|||
@Schema(description = "单位名称", example = "测试透传") |
|||
@JsonProperty("corg_name") |
|||
private String corgName; |
|||
|
|||
@Schema(description = "父级单位 ID", example = "0") |
|||
@JsonProperty("corg_parent") |
|||
private Integer corgParent; |
|||
|
|||
@Schema(description = "单位层级", example = "0") |
|||
@JsonProperty("corg_level") |
|||
private Integer corgLevel; |
|||
|
|||
@Schema(description = "是否允许用户设置优先级", example = "1") |
|||
@JsonProperty("corg_isallowusersetprior") |
|||
private Integer corgIsAllowUserSetPrior; |
|||
|
|||
@Schema(description = "临时群组优先级", example = "1") |
|||
@JsonProperty("corg_tempgroupprior") |
|||
private Integer corgTempGroupPrior; |
|||
|
|||
@Schema(description = "临时群组发言时长限制", example = "30") |
|||
@JsonProperty("corg_tempgrouplimitsecond") |
|||
private Integer corgTempGroupLimitSecond; |
|||
|
|||
@Schema(description = "单位类型", example = "0") |
|||
@JsonProperty("corg_type") |
|||
private Integer corgType; |
|||
|
|||
@Schema(description = "是否启用", example = "1") |
|||
@JsonProperty("isactive") |
|||
private Integer active; |
|||
|
|||
@Schema(description = "代理商 ID", example = "efad38ced1bb4ac0bf97665041db752a") |
|||
@JsonProperty("agent_id") |
|||
private String agentId; |
|||
|
|||
@Schema(description = "单位 UUID", example = "30b119a9c36c46de8a19afe8722e99d6") |
|||
private String id; |
|||
|
|||
@Schema(description = "手机号", example = "13800138000") |
|||
private String mobile; |
|||
|
|||
@Schema(description = "地址", example = "广东省深圳市") |
|||
private String address; |
|||
|
|||
@Schema(description = "联系人", example = "测试测试") |
|||
private String contact; |
|||
|
|||
@Schema(description = "成员详情级别", example = "1") |
|||
@JsonProperty("corg_memberdetaillevel") |
|||
private Integer corgMemberDetailLevel; |
|||
|
|||
@Schema(description = "是否开启降噪", example = "false") |
|||
@JsonProperty("is_denoise") |
|||
private Boolean denoise; |
|||
|
|||
@Schema(description = "手机号码串", example = "") |
|||
private String mobiles; |
|||
|
|||
@Schema(description = "群组总数", example = "2") |
|||
@JsonProperty("group_count") |
|||
private Integer groupCount; |
|||
|
|||
@Schema(description = "名称", example = "测试平台") |
|||
private String name; |
|||
|
|||
@Schema(description = "登录账号", example = "broadtest") |
|||
@JsonProperty("loginname") |
|||
private String loginName; |
|||
|
|||
@Schema(description = "用户总数", example = "2") |
|||
@JsonProperty("user_count") |
|||
private Integer userCount; |
|||
} |
|||
@ -0,0 +1,38 @@ |
|||
package cn.iocoder.yudao.module.interphone.controller.admin.profile; |
|||
|
|||
import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
|||
import cn.iocoder.yudao.module.interphone.service.InterphoneProfileService; |
|||
import io.swagger.v3.oas.annotations.Operation; |
|||
import io.swagger.v3.oas.annotations.tags.Tag; |
|||
import jakarta.annotation.Resource; |
|||
import jakarta.annotation.security.PermitAll; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.web.bind.annotation.GetMapping; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; |
|||
|
|||
@Tag(name = "开放接口 - 对讲平台个人信息") |
|||
@RestController |
|||
@RequestMapping("/interphone/open-api/profile") |
|||
@Validated |
|||
public class InterphoneProfileController { |
|||
|
|||
@Resource |
|||
private InterphoneProfileService interphoneProfileService; |
|||
|
|||
@GetMapping("/agent") |
|||
@Operation(summary = "获取代理商个人信息") |
|||
@PermitAll |
|||
public CommonResult<String> getAgentProfile() { |
|||
return success(interphoneProfileService.getAgentProfile()); |
|||
} |
|||
|
|||
@GetMapping("/faststats") |
|||
@Operation(summary = "查询代理商单位群组用户统计") |
|||
@PermitAll |
|||
public CommonResult<String> getFastStats() { |
|||
return success(interphoneProfileService.getFastStats()); |
|||
} |
|||
} |
|||
@ -0,0 +1,34 @@ |
|||
package cn.iocoder.yudao.module.interphone.controller.admin.record; |
|||
|
|||
import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
|||
import cn.iocoder.yudao.module.interphone.service.InterphoneRecordService; |
|||
import io.swagger.v3.oas.annotations.Operation; |
|||
import io.swagger.v3.oas.annotations.tags.Tag; |
|||
import jakarta.annotation.Resource; |
|||
import jakarta.annotation.security.PermitAll; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.web.bind.annotation.GetMapping; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RequestParam; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
import java.util.Map; |
|||
|
|||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; |
|||
|
|||
@Tag(name = "开放接口 - 对讲平台录音") |
|||
@RestController |
|||
@RequestMapping("/interphone/open-api/record") |
|||
@Validated |
|||
public class InterphoneRecordController { |
|||
|
|||
@Resource |
|||
private InterphoneRecordService interphoneRecordService; |
|||
|
|||
@GetMapping("/list") |
|||
@Operation(summary = "查询录音列表") |
|||
@PermitAll |
|||
public CommonResult<String> getRecordList(@RequestParam Map<String, String> queryParams) { |
|||
return success(interphoneRecordService.getRecordList(queryParams)); |
|||
} |
|||
} |
|||
@ -0,0 +1,89 @@ |
|||
package cn.iocoder.yudao.module.interphone.controller.admin.recordaudio; |
|||
|
|||
import org.springframework.web.bind.annotation.*; |
|||
import jakarta.annotation.Resource; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.security.access.prepost.PreAuthorize; |
|||
import io.swagger.v3.oas.annotations.tags.Tag; |
|||
import io.swagger.v3.oas.annotations.Parameter; |
|||
import io.swagger.v3.oas.annotations.Operation; |
|||
|
|||
import jakarta.validation.constraints.*; |
|||
import jakarta.validation.*; |
|||
import jakarta.servlet.http.*; |
|||
import java.util.*; |
|||
import java.io.IOException; |
|||
|
|||
import cn.iocoder.yudao.framework.common.pojo.PageParam; |
|||
import cn.iocoder.yudao.framework.common.pojo.PageResult; |
|||
import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
|||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils; |
|||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; |
|||
|
|||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog; |
|||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*; |
|||
|
|||
import cn.iocoder.yudao.module.interphone.controller.admin.recordaudio.vo.*; |
|||
import cn.iocoder.yudao.module.interphone.dal.dataobject.recordaudio.RecordAudioDO; |
|||
import cn.iocoder.yudao.module.interphone.service.recordaudio.RecordAudioService; |
|||
|
|||
@Tag(name = "管理后台 - 实时录音记录") |
|||
@RestController |
|||
@RequestMapping("/interphone/record-audio") |
|||
@Validated |
|||
public class RecordAudioController { |
|||
|
|||
@Resource |
|||
private RecordAudioService recordAudioService; |
|||
|
|||
@PostMapping("/create") |
|||
@Operation(summary = "创建实时录音记录") |
|||
@PreAuthorize("@ss.hasPermission('interphone:record-audio:create')") |
|||
public CommonResult<Long> createRecordAudio(@Valid @RequestBody RecordAudioSaveReqVO createReqVO) { |
|||
return success(recordAudioService.createRecordAudio(createReqVO)); |
|||
} |
|||
|
|||
@PutMapping("/update") |
|||
@Operation(summary = "更新实时录音记录") |
|||
@PreAuthorize("@ss.hasPermission('interphone:record-audio:update')") |
|||
public CommonResult<Boolean> updateRecordAudio(@Valid @RequestBody RecordAudioSaveReqVO updateReqVO) { |
|||
recordAudioService.updateRecordAudio(updateReqVO); |
|||
return success(true); |
|||
} |
|||
|
|||
@DeleteMapping("/delete") |
|||
@Operation(summary = "删除实时录音记录") |
|||
@Parameter(name = "id", description = "编号", required = true) |
|||
@PreAuthorize("@ss.hasPermission('interphone:record-audio:delete')") |
|||
public CommonResult<Boolean> deleteRecordAudio(@RequestParam("id") Long id) { |
|||
recordAudioService.deleteRecordAudio(id); |
|||
return success(true); |
|||
} |
|||
|
|||
@DeleteMapping("/delete-list") |
|||
@Parameter(name = "ids", description = "编号", required = true) |
|||
@Operation(summary = "批量删除实时录音记录") |
|||
@PreAuthorize("@ss.hasPermission('interphone:record-audio:delete')") |
|||
public CommonResult<Boolean> deleteRecordAudioList(@RequestParam("ids") List<Long> ids) { |
|||
recordAudioService.deleteRecordAudioListByIds(ids); |
|||
return success(true); |
|||
} |
|||
|
|||
@GetMapping("/get") |
|||
@Operation(summary = "获得实时录音记录") |
|||
@Parameter(name = "id", description = "编号", required = true, example = "1024") |
|||
@PreAuthorize("@ss.hasPermission('interphone:record-audio:query')") |
|||
public CommonResult<RecordAudioRespVO> getRecordAudio(@RequestParam("id") Long id) { |
|||
RecordAudioDO recordAudio = recordAudioService.getRecordAudio(id); |
|||
return success(BeanUtils.toBean(recordAudio, RecordAudioRespVO.class)); |
|||
} |
|||
|
|||
@GetMapping("/page") |
|||
@Operation(summary = "获得实时录音记录分页") |
|||
@PreAuthorize("@ss.hasPermission('interphone:record-audio:query')") |
|||
public CommonResult<PageResult<RecordAudioRespVO>> getRecordAudioPage(@Valid RecordAudioPageReqVO pageReqVO) { |
|||
PageResult<RecordAudioDO> pageResult = recordAudioService.getRecordAudioPage(pageReqVO); |
|||
return success(BeanUtils.toBean(pageResult, RecordAudioRespVO.class)); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,66 @@ |
|||
package cn.iocoder.yudao.module.interphone.controller.admin.recordaudio.vo; |
|||
|
|||
import lombok.*; |
|||
import java.util.*; |
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import cn.iocoder.yudao.framework.common.pojo.PageParam; |
|||
import org.springframework.format.annotation.DateTimeFormat; |
|||
import java.time.LocalDateTime; |
|||
|
|||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
|||
|
|||
@Schema(description = "管理后台 - 实时录音记录分页 Request VO") |
|||
@Data |
|||
public class RecordAudioPageReqVO extends PageParam { |
|||
|
|||
@Schema(description = "第三方录音ID", example = "29527") |
|||
private String thirdId; |
|||
|
|||
@Schema(description = "终端ID", example = "13888") |
|||
private Integer tId; |
|||
|
|||
@Schema(description = "用户ID", example = "5926") |
|||
private Long userId; |
|||
|
|||
@Schema(description = "用户名", example = "芋艿") |
|||
private String userName; |
|||
|
|||
@Schema(description = "群组ID", example = "4378") |
|||
private Long groupId; |
|||
|
|||
@Schema(description = "群组名称", example = "张三") |
|||
private String groupName; |
|||
|
|||
@Schema(description = "群组类型", example = "2") |
|||
private Integer groupType; |
|||
|
|||
@Schema(description = "组织ID", example = "12968") |
|||
private Long orgId; |
|||
|
|||
@Schema(description = "录音时长毫秒") |
|||
private Integer durationMs; |
|||
|
|||
@Schema(description = "音频路径") |
|||
private String audioPath; |
|||
|
|||
@Schema(description = "完整音频OSS URL", example = "https://www.iocoder.cn") |
|||
private String audioOssUrl; |
|||
|
|||
@Schema(description = "编码格式") |
|||
private String codeFormat; |
|||
|
|||
@Schema(description = "录音时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime[] audioTime; |
|||
|
|||
@Schema(description = "ASR状态 0未处理 1处理中 2完成 3失败", example = "2") |
|||
private Integer asrStatus; |
|||
|
|||
@Schema(description = "语音识别结果") |
|||
private String asrText; |
|||
|
|||
@Schema(description = "创建时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime[] createTime; |
|||
|
|||
} |
|||
@ -0,0 +1,59 @@ |
|||
package cn.iocoder.yudao.module.interphone.controller.admin.recordaudio.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.*; |
|||
import java.util.*; |
|||
import org.springframework.format.annotation.DateTimeFormat; |
|||
import java.time.LocalDateTime; |
|||
import com.alibaba.excel.annotation.*; |
|||
|
|||
@Schema(description = "管理后台 - 实时录音记录 Response VO") |
|||
@Data |
|||
@ExcelIgnoreUnannotated |
|||
public class RecordAudioRespVO { |
|||
|
|||
@Schema(description = "用户名", example = "芋艿") |
|||
@ExcelProperty("用户名") |
|||
private String userName; |
|||
|
|||
@Schema(description = "群组名称", example = "张三") |
|||
@ExcelProperty("群组名称") |
|||
private String groupName; |
|||
|
|||
@Schema(description = "群组类型", example = "2") |
|||
@ExcelProperty("群组类型") |
|||
private Integer groupType; |
|||
|
|||
@Schema(description = "录音时长毫秒") |
|||
@ExcelProperty("录音时长毫秒") |
|||
private Integer durationMs; |
|||
|
|||
@Schema(description = "音频路径") |
|||
@ExcelProperty("音频路径") |
|||
private String audioPath; |
|||
|
|||
@Schema(description = "完整音频OSS URL", example = "https://www.iocoder.cn") |
|||
@ExcelProperty("完整音频OSS URL") |
|||
private String audioOssUrl; |
|||
|
|||
@Schema(description = "编码格式") |
|||
@ExcelProperty("编码格式") |
|||
private String codeFormat; |
|||
|
|||
@Schema(description = "录音时间") |
|||
@ExcelProperty("录音时间") |
|||
private LocalDateTime audioTime; |
|||
|
|||
@Schema(description = "ASR状态 0未处理 1处理中 2完成 3失败", example = "2") |
|||
@ExcelProperty("ASR状态 0未处理 1处理中 2完成 3失败") |
|||
private Integer asrStatus; |
|||
|
|||
@Schema(description = "语音识别结果") |
|||
@ExcelProperty("语音识别结果") |
|||
private String asrText; |
|||
|
|||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@ExcelProperty("创建时间") |
|||
private LocalDateTime createTime; |
|||
|
|||
} |
|||
@ -0,0 +1,12 @@ |
|||
package cn.iocoder.yudao.module.interphone.controller.admin.recordaudio.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.*; |
|||
import java.util.*; |
|||
import jakarta.validation.constraints.*; |
|||
|
|||
@Schema(description = "管理后台 - 实时录音记录新增/修改 Request VO") |
|||
@Data |
|||
public class RecordAudioSaveReqVO { |
|||
|
|||
} |
|||
@ -0,0 +1,106 @@ |
|||
package cn.iocoder.yudao.module.interphone.controller.admin.terminal; |
|||
|
|||
import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
|||
import cn.iocoder.yudao.module.interphone.service.InterphoneTerminalService; |
|||
import io.swagger.v3.oas.annotations.Operation; |
|||
import io.swagger.v3.oas.annotations.Parameter; |
|||
import io.swagger.v3.oas.annotations.Parameters; |
|||
import io.swagger.v3.oas.annotations.tags.Tag; |
|||
import jakarta.annotation.Resource; |
|||
import jakarta.annotation.security.PermitAll; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.web.bind.annotation.GetMapping; |
|||
import org.springframework.web.bind.annotation.PostMapping; |
|||
import org.springframework.web.bind.annotation.RequestBody; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RequestParam; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
import java.util.Map; |
|||
|
|||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; |
|||
|
|||
@Tag(name = "开放接口 - 对讲平台终端") |
|||
@RestController |
|||
@RequestMapping("/interphone/open-api/terminal") |
|||
@Validated |
|||
public class InterphoneTerminalController { |
|||
|
|||
@Resource |
|||
private InterphoneTerminalService interphoneTerminalService; |
|||
|
|||
@GetMapping("/querySubordinateUser") |
|||
@Operation(summary = "查询下级用户") |
|||
@Parameters({ |
|||
@Parameter(name = "pageNo", description = "页码", required = true), |
|||
@Parameter(name = "pageSize", description = "每页数量", required = true), |
|||
@Parameter(name = "agentId", description = "代理商 ID"), |
|||
@Parameter(name = "orgId", description = "单位 ID"), |
|||
@Parameter(name = "groupId", description = "群组 ID"), |
|||
@Parameter(name = "userName", description = "用户名称"), |
|||
@Parameter(name = "account", description = "账号") |
|||
}) |
|||
@PermitAll |
|||
public CommonResult<String> querySubordinateUser(@RequestParam("pageNo") Integer pageNo, |
|||
@RequestParam("pageSize") Integer pageSize, |
|||
@RequestParam(value = "agentId", required = false) String agentId, |
|||
@RequestParam(value = "orgId", required = false) String orgId, |
|||
@RequestParam(value = "groupId", required = false) String groupId, |
|||
@RequestParam(value = "userName", required = false) String userName, |
|||
@RequestParam(value = "account", required = false) String account) { |
|||
return success(interphoneTerminalService.querySubordinateUser(pageNo, pageSize, agentId, orgId, groupId, userName, account)); |
|||
} |
|||
|
|||
@PostMapping("/batch") |
|||
@Operation(summary = "创建对讲用户") |
|||
@PermitAll |
|||
public CommonResult<String> createTerminalUsers(@RequestBody String requestBody) { |
|||
return success(interphoneTerminalService.createTerminalUsers(requestBody)); |
|||
} |
|||
|
|||
@GetMapping("/list") |
|||
@Operation(summary = "查询对讲用户列表") |
|||
@Parameters({ |
|||
@Parameter(name = "pageNo", description = "页码", required = true), |
|||
@Parameter(name = "pageSize", description = "每页数量", required = true), |
|||
@Parameter(name = "org_id", description = "单位 ID"), |
|||
@Parameter(name = "groupId", description = "群组 ID"), |
|||
@Parameter(name = "name", description = "用户名称") |
|||
}) |
|||
@PermitAll |
|||
public CommonResult<String> getTerminalList(@RequestParam("pageNo") Integer pageNo, |
|||
@RequestParam("pageSize") Integer pageSize, |
|||
@RequestParam(value = "org_id", required = false) String orgId, |
|||
@RequestParam(value = "groupId", required = false) String groupId, |
|||
@RequestParam(value = "name", required = false) String name) { |
|||
return success(interphoneTerminalService.getTerminalList(pageNo, pageSize, orgId, groupId, name)); |
|||
} |
|||
|
|||
@GetMapping("/detail") |
|||
@Operation(summary = "查询对讲用户详情") |
|||
@PermitAll |
|||
public CommonResult<String> getTerminalDetail(@RequestParam Map<String, String> queryParams) { |
|||
return success(interphoneTerminalService.getTerminalDetail(queryParams)); |
|||
} |
|||
|
|||
@PostMapping("/updateUser") |
|||
@Operation(summary = "修改对讲用户信息") |
|||
@PermitAll |
|||
public CommonResult<String> updateTerminalUser(@RequestBody String requestBody) { |
|||
return success(interphoneTerminalService.updateTerminalUser(requestBody)); |
|||
} |
|||
|
|||
@PostMapping("/deleteUser") |
|||
@Operation(summary = "删除对讲用户") |
|||
@PermitAll |
|||
public CommonResult<String> deleteTerminalUser(@RequestBody String requestBody) { |
|||
return success(interphoneTerminalService.deleteTerminalUser(requestBody)); |
|||
} |
|||
|
|||
@GetMapping("/userOnlineStatus") |
|||
@Operation(summary = "查询对讲用户在线状态") |
|||
@PermitAll |
|||
public CommonResult<String> getTerminalUserOnlineStatus(@RequestParam Map<String, String> queryParams) { |
|||
return success(interphoneTerminalService.getTerminalUserOnlineStatus(queryParams)); |
|||
} |
|||
} |
|||
@ -0,0 +1,93 @@ |
|||
package cn.iocoder.yudao.module.interphone.dal.dataobject.recordaudio; |
|||
|
|||
import lombok.*; |
|||
import java.util.*; |
|||
import java.time.LocalDateTime; |
|||
import java.time.LocalDateTime; |
|||
import java.time.LocalDateTime; |
|||
import com.baomidou.mybatisplus.annotation.*; |
|||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; |
|||
|
|||
/** |
|||
* 实时录音记录 DO |
|||
* |
|||
* @author 超级管理员 |
|||
*/ |
|||
@TableName("interphone_record_audio") |
|||
@KeySequence("interphone_record_audio_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
@Builder |
|||
@NoArgsConstructor |
|||
@AllArgsConstructor |
|||
public class RecordAudioDO extends BaseDO { |
|||
|
|||
/** |
|||
* 本地ID |
|||
*/ |
|||
@TableId |
|||
private Long id; |
|||
/** |
|||
* 第三方录音ID |
|||
*/ |
|||
private String thirdId; |
|||
/** |
|||
* 终端ID |
|||
*/ |
|||
private Integer tId; |
|||
/** |
|||
* 用户ID |
|||
*/ |
|||
private Long userId; |
|||
/** |
|||
* 用户名 |
|||
*/ |
|||
private String userName; |
|||
/** |
|||
* 群组ID |
|||
*/ |
|||
private Long groupId; |
|||
/** |
|||
* 群组名称 |
|||
*/ |
|||
private String groupName; |
|||
/** |
|||
* 群组类型 |
|||
*/ |
|||
private Integer groupType; |
|||
/** |
|||
* 组织ID |
|||
*/ |
|||
private Long orgId; |
|||
/** |
|||
* 录音时长毫秒 |
|||
*/ |
|||
private Integer durationMs; |
|||
/** |
|||
* 音频路径 |
|||
*/ |
|||
private String audioPath; |
|||
/** |
|||
* 完整音频OSS URL |
|||
*/ |
|||
private String audioOssUrl; |
|||
/** |
|||
* 编码格式 |
|||
*/ |
|||
private String codeFormat; |
|||
/** |
|||
* 录音时间 |
|||
*/ |
|||
private LocalDateTime audioTime; |
|||
/** |
|||
* ASR状态 0未处理 1处理中 2完成 3失败 |
|||
*/ |
|||
private Integer asrStatus; |
|||
/** |
|||
* 语音识别结果 |
|||
*/ |
|||
private String asrText; |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,41 @@ |
|||
package cn.iocoder.yudao.module.interphone.dal.mysql.recordaudio; |
|||
|
|||
import java.util.*; |
|||
|
|||
import cn.iocoder.yudao.framework.common.pojo.PageResult; |
|||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; |
|||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; |
|||
import cn.iocoder.yudao.module.interphone.dal.dataobject.recordaudio.RecordAudioDO; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import cn.iocoder.yudao.module.interphone.controller.admin.recordaudio.vo.*; |
|||
|
|||
/** |
|||
* 实时录音记录 Mapper |
|||
* |
|||
* @author 超级管理员 |
|||
*/ |
|||
@Mapper |
|||
public interface RecordAudioMapper extends BaseMapperX<RecordAudioDO> { |
|||
|
|||
default PageResult<RecordAudioDO> selectPage(RecordAudioPageReqVO reqVO) { |
|||
return selectPage(reqVO, new LambdaQueryWrapperX<RecordAudioDO>() |
|||
.eqIfPresent(RecordAudioDO::getThirdId, reqVO.getThirdId()) |
|||
.eqIfPresent(RecordAudioDO::getTId, reqVO.getTId()) |
|||
.eqIfPresent(RecordAudioDO::getUserId, reqVO.getUserId()) |
|||
.likeIfPresent(RecordAudioDO::getUserName, reqVO.getUserName()) |
|||
.eqIfPresent(RecordAudioDO::getGroupId, reqVO.getGroupId()) |
|||
.likeIfPresent(RecordAudioDO::getGroupName, reqVO.getGroupName()) |
|||
.eqIfPresent(RecordAudioDO::getGroupType, reqVO.getGroupType()) |
|||
.eqIfPresent(RecordAudioDO::getOrgId, reqVO.getOrgId()) |
|||
.eqIfPresent(RecordAudioDO::getDurationMs, reqVO.getDurationMs()) |
|||
.eqIfPresent(RecordAudioDO::getAudioPath, reqVO.getAudioPath()) |
|||
.eqIfPresent(RecordAudioDO::getAudioOssUrl, reqVO.getAudioOssUrl()) |
|||
.eqIfPresent(RecordAudioDO::getCodeFormat, reqVO.getCodeFormat()) |
|||
.betweenIfPresent(RecordAudioDO::getAudioTime, reqVO.getAudioTime()) |
|||
.eqIfPresent(RecordAudioDO::getAsrStatus, reqVO.getAsrStatus()) |
|||
.eqIfPresent(RecordAudioDO::getAsrText, reqVO.getAsrText()) |
|||
.betweenIfPresent(RecordAudioDO::getCreateTime, reqVO.getCreateTime()) |
|||
.orderByDesc(RecordAudioDO::getId)); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,7 @@ |
|||
package cn.iocoder.yudao.module.interphone.enums; |
|||
|
|||
import cn.iocoder.yudao.framework.common.exception.ErrorCode; |
|||
|
|||
public interface ErrorCodeConstants { |
|||
ErrorCode RECORD_AUDIO_NOT_EXISTS = new ErrorCode(1000101, "实时录音记录不存在"); |
|||
} |
|||
@ -0,0 +1,8 @@ |
|||
package cn.iocoder.yudao.module.interphone.service; |
|||
|
|||
public interface InterphoneAgentService { |
|||
|
|||
String getAgentList(Integer pageNo, Integer pageSize, String name); |
|||
|
|||
String getAgentDetail(String id); |
|||
} |
|||
@ -1,53 +0,0 @@ |
|||
package cn.iocoder.yudao.module.interphone.service; |
|||
|
|||
import java.util.Map; |
|||
|
|||
public interface InterphoneApiService { |
|||
|
|||
String getAgentProfile(); |
|||
|
|||
String getAgentList(Integer pageNo, Integer pageSize, String name); |
|||
|
|||
String getAgentDetail(String id); |
|||
|
|||
String getFastStats(); |
|||
|
|||
String getGroupName(String orgId); |
|||
|
|||
String querySubordinateUser(Integer pageNo, Integer pageSize, String agentId, String orgId, |
|||
String groupId, String userName, String account); |
|||
|
|||
String getAgentOrgs(Integer pageNo, Integer pageSize, String name); |
|||
|
|||
String getGroupList(Integer pageNo, Integer pageSize, String name, String orgName); |
|||
|
|||
String addGroup(String requestBody); |
|||
|
|||
String getGroupDetail(String id); |
|||
|
|||
String updateGroup(String requestBody); |
|||
|
|||
String deleteGroup(String requestBody); |
|||
|
|||
String getGroupMembers(String id); |
|||
|
|||
String addGroupMembers(String requestBody); |
|||
|
|||
String removeGroupMembers(String requestBody); |
|||
|
|||
String queryGroupByUid(Map<String, String> queryParams); |
|||
|
|||
String createTerminalUsers(String requestBody); |
|||
|
|||
String getTerminalList(Integer pageNo, Integer pageSize, String orgId, String groupId, String name); |
|||
|
|||
String getTerminalDetail(Map<String, String> queryParams); |
|||
|
|||
String updateTerminalUser(String requestBody); |
|||
|
|||
String deleteTerminalUser(String requestBody); |
|||
|
|||
String getTerminalUserOnlineStatus(Map<String, String> queryParams); |
|||
|
|||
String getRecordList(Map<String, String> queryParams); |
|||
} |
|||
@ -0,0 +1,22 @@ |
|||
package cn.iocoder.yudao.module.interphone.service; |
|||
|
|||
public interface InterphoneGroupService { |
|||
|
|||
String getGroupName(String orgId); |
|||
|
|||
String getGroupList(Integer pageNo, Integer pageSize, String name, String orgName); |
|||
|
|||
String addGroup(String requestBody); |
|||
|
|||
String getGroupDetail(String id); |
|||
|
|||
String updateGroup(String requestBody); |
|||
|
|||
String deleteGroup(String requestBody); |
|||
|
|||
String getGroupMembers(String id); |
|||
|
|||
String addGroupMembers(String requestBody); |
|||
|
|||
String removeGroupMembers(String requestBody); |
|||
} |
|||
@ -0,0 +1,8 @@ |
|||
package cn.iocoder.yudao.module.interphone.service; |
|||
|
|||
import java.util.Map; |
|||
|
|||
public interface InterphoneJspService { |
|||
|
|||
String queryGroupByUid(Map<String, String> queryParams); |
|||
} |
|||
@ -0,0 +1,30 @@ |
|||
package cn.iocoder.yudao.module.interphone.service; |
|||
|
|||
import cn.iocoder.yudao.framework.common.pojo.PageResult; |
|||
import cn.iocoder.yudao.module.interphone.controller.admin.org.vo.InterphoneOrgCreateReqVO; |
|||
import cn.iocoder.yudao.module.interphone.controller.admin.org.vo.InterphoneOrgPageReqVO; |
|||
import cn.iocoder.yudao.module.interphone.controller.admin.org.vo.InterphoneOrgRespVO; |
|||
|
|||
public interface InterphoneOrgService { |
|||
|
|||
/** |
|||
* 新增单位 |
|||
* @param createReqVO |
|||
* @return 单位ID |
|||
*/ |
|||
String addOrg(InterphoneOrgCreateReqVO createReqVO); |
|||
|
|||
PageResult<InterphoneOrgRespVO> getAgentOrgs(InterphoneOrgPageReqVO reqVO); |
|||
|
|||
/** |
|||
* 删除单位 |
|||
* @param id 单位id(uuid类型) |
|||
*/ |
|||
void deleteOrg(String id); |
|||
|
|||
/** |
|||
* 修改单位信息 |
|||
*/ |
|||
void updateOrg(InterphoneOrgCreateReqVO createReqVO); |
|||
|
|||
} |
|||
@ -0,0 +1,8 @@ |
|||
package cn.iocoder.yudao.module.interphone.service; |
|||
|
|||
public interface InterphoneProfileService { |
|||
|
|||
String getAgentProfile(); |
|||
|
|||
String getFastStats(); |
|||
} |
|||
@ -0,0 +1,8 @@ |
|||
package cn.iocoder.yudao.module.interphone.service; |
|||
|
|||
import java.util.Map; |
|||
|
|||
public interface InterphoneRecordService { |
|||
|
|||
String getRecordList(Map<String, String> queryParams); |
|||
} |
|||
@ -0,0 +1,21 @@ |
|||
package cn.iocoder.yudao.module.interphone.service; |
|||
|
|||
import java.util.Map; |
|||
|
|||
public interface InterphoneTerminalService { |
|||
|
|||
String querySubordinateUser(Integer pageNo, Integer pageSize, String agentId, String orgId, |
|||
String groupId, String userName, String account); |
|||
|
|||
String createTerminalUsers(String requestBody); |
|||
|
|||
String getTerminalList(Integer pageNo, Integer pageSize, String orgId, String groupId, String name); |
|||
|
|||
String getTerminalDetail(Map<String, String> queryParams); |
|||
|
|||
String updateTerminalUser(String requestBody); |
|||
|
|||
String deleteTerminalUser(String requestBody); |
|||
|
|||
String getTerminalUserOnlineStatus(Map<String, String> queryParams); |
|||
} |
|||
@ -0,0 +1,17 @@ |
|||
package cn.iocoder.yudao.module.interphone.service.dto; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.util.List; |
|||
|
|||
@Data |
|||
public class InterphonePageResponse<T> { |
|||
|
|||
private Integer code; |
|||
|
|||
private String msg; |
|||
|
|||
private List<T> data; |
|||
|
|||
private Long count; |
|||
} |
|||
@ -0,0 +1,74 @@ |
|||
package cn.iocoder.yudao.module.interphone.service.impl; |
|||
|
|||
import cn.hutool.core.util.StrUtil; |
|||
import cn.iocoder.yudao.module.interphone.core.ApiClient; |
|||
import cn.iocoder.yudao.module.interphone.core.ApiRequest; |
|||
import cn.iocoder.yudao.module.interphone.core.ApiResponse; |
|||
import com.alibaba.fastjson.JSONObject; |
|||
|
|||
import java.util.LinkedHashMap; |
|||
import java.util.Map; |
|||
|
|||
public abstract class AbstractInterphoneServiceSupport { |
|||
|
|||
private final ApiClient apiClient; |
|||
|
|||
protected AbstractInterphoneServiceSupport(ApiClient apiClient) { |
|||
this.apiClient = apiClient; |
|||
} |
|||
|
|||
protected String executeGet(String path) { |
|||
return executeGet(path, null); |
|||
} |
|||
|
|||
protected String executeGet(String path, Map<String, String> queryParams) { |
|||
ApiRequest request = ApiRequest.get(path, sanitizeQueryParams(queryParams)); |
|||
ApiResponse response = apiClient.execute(request); |
|||
JSONObject jsonBody = JSONObject.parseObject(response.getBody()); |
|||
|
|||
if (!jsonBody.getString("code").startsWith("200")) throw new RuntimeException(response.getBody()); |
|||
// 修改后
|
|||
JSONObject data = jsonBody.getJSONObject("data"); |
|||
return data != null ? data.toString() : ""; |
|||
} |
|||
|
|||
protected String executePost(String path, Map<String, String> queryParams) { |
|||
ApiRequest request = ApiRequest.postParam(path, sanitizeQueryParams(queryParams)); |
|||
ApiResponse response = apiClient.execute(request); |
|||
JSONObject jsonBody = JSONObject.parseObject(response.getBody()); |
|||
|
|||
if (!jsonBody.getString("code").startsWith("200")) throw new RuntimeException(response.getBody()); |
|||
// 修改后
|
|||
JSONObject data = jsonBody.getJSONObject("data"); |
|||
return data != null ? data.toString() : ""; |
|||
} |
|||
|
|||
protected Map<String, String> newQueryParams() { |
|||
return new LinkedHashMap<>(); |
|||
} |
|||
|
|||
protected void putIfHasText(Map<String, String> queryParams, String key, String value) { |
|||
if (StrUtil.isNotBlank(value)) { |
|||
queryParams.put(key, value); |
|||
} |
|||
} |
|||
|
|||
protected void putIfNotNull(Map<String, String> queryParams, String key, Object value) { |
|||
if (value != null) { |
|||
queryParams.put(key, String.valueOf(value)); |
|||
} |
|||
} |
|||
|
|||
private Map<String, String> sanitizeQueryParams(Map<String, String> queryParams) { |
|||
if (queryParams == null || queryParams.isEmpty()) { |
|||
return null; |
|||
} |
|||
Map<String, String> sanitized = new LinkedHashMap<>(); |
|||
queryParams.forEach((key, value) -> { |
|||
if (value != null) { |
|||
sanitized.put(key, value); |
|||
} |
|||
}); |
|||
return sanitized.isEmpty() ? null : sanitized; |
|||
} |
|||
} |
|||
@ -0,0 +1,31 @@ |
|||
package cn.iocoder.yudao.module.interphone.service.impl; |
|||
|
|||
import cn.iocoder.yudao.module.interphone.core.ApiClient; |
|||
import cn.iocoder.yudao.module.interphone.service.InterphoneAgentService; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.validation.annotation.Validated; |
|||
|
|||
import java.util.Map; |
|||
|
|||
@Service |
|||
@Validated |
|||
public class InterphoneAgentServiceImpl extends AbstractInterphoneServiceSupport implements InterphoneAgentService { |
|||
|
|||
public InterphoneAgentServiceImpl(ApiClient apiClient) { |
|||
super(apiClient); |
|||
} |
|||
|
|||
@Override |
|||
public String getAgentList(Integer pageNo, Integer pageSize, String name) { |
|||
Map<String, String> queryParams = newQueryParams(); |
|||
putIfNotNull(queryParams, "pageNo", pageNo); |
|||
putIfNotNull(queryParams, "pageSize", pageSize); |
|||
putIfHasText(queryParams, "name", name); |
|||
return executeGet("/agent/list", queryParams); |
|||
} |
|||
|
|||
@Override |
|||
public String getAgentDetail(String id) { |
|||
return executeGet("/agent/detail", Map.of("id", id)); |
|||
} |
|||
} |
|||
@ -1,207 +0,0 @@ |
|||
package cn.iocoder.yudao.module.interphone.service.impl; |
|||
|
|||
import cn.hutool.core.util.StrUtil; |
|||
import cn.iocoder.yudao.module.interphone.core.ApiClient; |
|||
import cn.iocoder.yudao.module.interphone.core.ApiRequest; |
|||
import cn.iocoder.yudao.module.interphone.core.ApiResponse; |
|||
import cn.iocoder.yudao.module.interphone.service.InterphoneApiService; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.validation.annotation.Validated; |
|||
|
|||
import java.util.LinkedHashMap; |
|||
import java.util.Map; |
|||
|
|||
@Service |
|||
@Validated |
|||
public class InterphoneApiServiceImpl implements InterphoneApiService { |
|||
|
|||
private final ApiClient apiClient; |
|||
|
|||
public InterphoneApiServiceImpl(ApiClient apiClient) { |
|||
this.apiClient = apiClient; |
|||
} |
|||
|
|||
@Override |
|||
public String getAgentProfile() { |
|||
return executeGet("/profile/agent"); |
|||
} |
|||
|
|||
@Override |
|||
public String getAgentList(Integer pageNo, Integer pageSize, String name) { |
|||
Map<String, String> queryParams = new LinkedHashMap<>(); |
|||
putIfNotNull(queryParams, "pageNo", pageNo); |
|||
putIfNotNull(queryParams, "pageSize", pageSize); |
|||
putIfHasText(queryParams, "name", name); |
|||
return executeGet("/agent/list", queryParams); |
|||
} |
|||
|
|||
@Override |
|||
public String getAgentDetail(String id) { |
|||
return executeGet("/agent/detail", Map.of("id", id)); |
|||
} |
|||
|
|||
@Override |
|||
public String getFastStats() { |
|||
return executeGet("/profile/faststats"); |
|||
} |
|||
|
|||
@Override |
|||
public String getGroupName(String orgId) { |
|||
return executeGet("/group/getGroupName", Map.of("orgId", orgId)); |
|||
} |
|||
|
|||
@Override |
|||
public String querySubordinateUser(Integer pageNo, Integer pageSize, String agentId, String orgId, |
|||
String groupId, String userName, String account) { |
|||
Map<String, String> queryParams = new LinkedHashMap<>(); |
|||
putIfNotNull(queryParams, "pageNo", pageNo); |
|||
putIfNotNull(queryParams, "pageSize", pageSize); |
|||
putIfHasText(queryParams, "agentId", agentId); |
|||
putIfHasText(queryParams, "orgId", orgId); |
|||
putIfHasText(queryParams, "groupId", groupId); |
|||
putIfHasText(queryParams, "userName", userName); |
|||
putIfHasText(queryParams, "account", account); |
|||
return executeGet("/terminal/querySubordinateUser", queryParams); |
|||
} |
|||
|
|||
@Override |
|||
public String getAgentOrgs(Integer pageNo, Integer pageSize, String name) { |
|||
Map<String, String> queryParams = new LinkedHashMap<>(); |
|||
putIfNotNull(queryParams, "pageNo", pageNo); |
|||
putIfNotNull(queryParams, "pageSize", pageSize); |
|||
putIfHasText(queryParams, "name", name); |
|||
return executeGet("/agent/orgs", queryParams); |
|||
} |
|||
|
|||
@Override |
|||
public String getGroupList(Integer pageNo, Integer pageSize, String name, String orgName) { |
|||
Map<String, String> queryParams = new LinkedHashMap<>(); |
|||
putIfNotNull(queryParams, "pageNo", pageNo); |
|||
putIfNotNull(queryParams, "pageSize", pageSize); |
|||
putIfHasText(queryParams, "name", name); |
|||
putIfHasText(queryParams, "orgname", orgName); |
|||
return executeGet("/group/list", queryParams); |
|||
} |
|||
|
|||
@Override |
|||
public String addGroup(String requestBody) { |
|||
return executePost("/group/add", requestBody); |
|||
} |
|||
|
|||
@Override |
|||
public String getGroupDetail(String id) { |
|||
return executeGet("/group/detail", Map.of("id", id)); |
|||
} |
|||
|
|||
@Override |
|||
public String updateGroup(String requestBody) { |
|||
return executePost("/group/updateGroup", requestBody); |
|||
} |
|||
|
|||
@Override |
|||
public String deleteGroup(String requestBody) { |
|||
return executePost("/group/delete", requestBody); |
|||
} |
|||
|
|||
@Override |
|||
public String getGroupMembers(String id) { |
|||
return executeGet("/group/members", Map.of("id", id)); |
|||
} |
|||
|
|||
@Override |
|||
public String addGroupMembers(String requestBody) { |
|||
return executePost("/group/members/add", requestBody); |
|||
} |
|||
|
|||
@Override |
|||
public String removeGroupMembers(String requestBody) { |
|||
return executePost("/group/members/remove", requestBody); |
|||
} |
|||
|
|||
@Override |
|||
public String queryGroupByUid(Map<String, String> queryParams) { |
|||
return executeGet("/jsp/queryGroupByUId", queryParams); |
|||
} |
|||
|
|||
@Override |
|||
public String createTerminalUsers(String requestBody) { |
|||
return executePost("/terminal/batch", requestBody); |
|||
} |
|||
|
|||
@Override |
|||
public String getTerminalList(Integer pageNo, Integer pageSize, String orgId, String groupId, String name) { |
|||
Map<String, String> queryParams = new LinkedHashMap<>(); |
|||
putIfNotNull(queryParams, "pageNo", pageNo); |
|||
putIfNotNull(queryParams, "pageSize", pageSize); |
|||
putIfHasText(queryParams, "org_id", orgId); |
|||
putIfHasText(queryParams, "groupId", groupId); |
|||
putIfHasText(queryParams, "name", name); |
|||
return executeGet("/terminal/list", queryParams); |
|||
} |
|||
|
|||
@Override |
|||
public String getTerminalDetail(Map<String, String> queryParams) { |
|||
return executeGet("/terminal/detail", queryParams); |
|||
} |
|||
|
|||
@Override |
|||
public String updateTerminalUser(String requestBody) { |
|||
return executePost("/terminal/updateUser", requestBody); |
|||
} |
|||
|
|||
@Override |
|||
public String deleteTerminalUser(String requestBody) { |
|||
return executePost("/terminal/deleteUser", requestBody); |
|||
} |
|||
|
|||
@Override |
|||
public String getTerminalUserOnlineStatus(Map<String, String> queryParams) { |
|||
return executeGet("/terminal/userOnlineStatus", queryParams); |
|||
} |
|||
|
|||
@Override |
|||
public String getRecordList(Map<String, String> queryParams) { |
|||
return executeGet("/record/list", queryParams); |
|||
} |
|||
|
|||
private String executeGet(String path) { |
|||
return executeGet(path, null); |
|||
} |
|||
|
|||
private String executeGet(String path, Map<String, String> queryParams) { |
|||
ApiRequest request = ApiRequest.get(path, sanitizeQueryParams(queryParams)); |
|||
ApiResponse response = apiClient.execute(request); |
|||
return response.getBody(); |
|||
} |
|||
|
|||
private String executePost(String path, String requestBody) { |
|||
ApiRequest request = ApiRequest.postJson(path, StrUtil.emptyToDefault(requestBody, "")); |
|||
ApiResponse response = apiClient.execute(request); |
|||
return response.getBody(); |
|||
} |
|||
|
|||
private Map<String, String> sanitizeQueryParams(Map<String, String> queryParams) { |
|||
if (queryParams == null || queryParams.isEmpty()) { |
|||
return null; |
|||
} |
|||
Map<String, String> sanitized = new LinkedHashMap<>(); |
|||
queryParams.forEach((key, value) -> { |
|||
if (value != null) { |
|||
sanitized.put(key, value); |
|||
} |
|||
}); |
|||
return sanitized.isEmpty() ? null : sanitized; |
|||
} |
|||
|
|||
private void putIfHasText(Map<String, String> queryParams, String key, String value) { |
|||
if (StrUtil.isNotBlank(value)) { |
|||
queryParams.put(key, value); |
|||
} |
|||
} |
|||
|
|||
private void putIfNotNull(Map<String, String> queryParams, String key, Object value) { |
|||
if (value != null) { |
|||
queryParams.put(key, String.valueOf(value)); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,67 @@ |
|||
package cn.iocoder.yudao.module.interphone.service.impl; |
|||
|
|||
import cn.iocoder.yudao.module.interphone.core.ApiClient; |
|||
import cn.iocoder.yudao.module.interphone.service.InterphoneGroupService; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.validation.annotation.Validated; |
|||
|
|||
import java.util.Map; |
|||
|
|||
@Service |
|||
@Validated |
|||
public class InterphoneGroupServiceImpl extends AbstractInterphoneServiceSupport implements InterphoneGroupService { |
|||
|
|||
public InterphoneGroupServiceImpl(ApiClient apiClient) { |
|||
super(apiClient); |
|||
} |
|||
|
|||
@Override |
|||
public String getGroupName(String orgId) { |
|||
return executeGet("/group/getGroupName", Map.of("orgId", orgId)); |
|||
} |
|||
|
|||
@Override |
|||
public String getGroupList(Integer pageNo, Integer pageSize, String name, String orgName) { |
|||
Map<String, String> queryParams = newQueryParams(); |
|||
putIfNotNull(queryParams, "pageNo", pageNo); |
|||
putIfNotNull(queryParams, "pageSize", pageSize); |
|||
putIfHasText(queryParams, "name", name); |
|||
putIfHasText(queryParams, "orgname", orgName); |
|||
return executeGet("/group/list", queryParams); |
|||
} |
|||
|
|||
@Override |
|||
public String addGroup(String requestBody) { |
|||
return null; |
|||
} |
|||
|
|||
@Override |
|||
public String getGroupDetail(String id) { |
|||
return executeGet("/group/detail", Map.of("id", id)); |
|||
} |
|||
|
|||
@Override |
|||
public String updateGroup(String requestBody) { |
|||
return null; |
|||
} |
|||
|
|||
@Override |
|||
public String deleteGroup(String requestBody) { |
|||
return null; |
|||
} |
|||
|
|||
@Override |
|||
public String getGroupMembers(String id) { |
|||
return executeGet("/group/members", Map.of("id", id)); |
|||
} |
|||
|
|||
@Override |
|||
public String addGroupMembers(String requestBody) { |
|||
return null; |
|||
} |
|||
|
|||
@Override |
|||
public String removeGroupMembers(String requestBody) { |
|||
return null; |
|||
} |
|||
} |
|||
@ -0,0 +1,22 @@ |
|||
package cn.iocoder.yudao.module.interphone.service.impl; |
|||
|
|||
import cn.iocoder.yudao.module.interphone.core.ApiClient; |
|||
import cn.iocoder.yudao.module.interphone.service.InterphoneJspService; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.validation.annotation.Validated; |
|||
|
|||
import java.util.Map; |
|||
|
|||
@Service |
|||
@Validated |
|||
public class InterphoneJspServiceImpl extends AbstractInterphoneServiceSupport implements InterphoneJspService { |
|||
|
|||
public InterphoneJspServiceImpl(ApiClient apiClient) { |
|||
super(apiClient); |
|||
} |
|||
|
|||
@Override |
|||
public String queryGroupByUid(Map<String, String> queryParams) { |
|||
return executeGet("/jsp/queryGroupByUId", queryParams); |
|||
} |
|||
} |
|||
@ -0,0 +1,83 @@ |
|||
package cn.iocoder.yudao.module.interphone.service.impl; |
|||
|
|||
import cn.iocoder.yudao.framework.common.pojo.PageResult; |
|||
import cn.iocoder.yudao.framework.common.util.json.JsonUtils; |
|||
import cn.iocoder.yudao.module.interphone.controller.admin.org.vo.InterphoneOrgCreateReqVO; |
|||
import cn.iocoder.yudao.module.interphone.controller.admin.org.vo.InterphoneOrgPageReqVO; |
|||
import cn.iocoder.yudao.module.interphone.controller.admin.org.vo.InterphoneOrgRespVO; |
|||
import cn.iocoder.yudao.module.interphone.core.ApiClient; |
|||
import cn.iocoder.yudao.module.interphone.service.InterphoneOrgService; |
|||
import cn.iocoder.yudao.module.interphone.service.dto.InterphonePageResponse; |
|||
import com.fasterxml.jackson.core.type.TypeReference; |
|||
import lombok.extern.log4j.Log4j; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.validation.annotation.Validated; |
|||
|
|||
import java.util.Collections; |
|||
import java.util.Map; |
|||
|
|||
@Service |
|||
@Validated |
|||
@Slf4j |
|||
public class InterphoneOrgServiceImpl extends AbstractInterphoneServiceSupport implements InterphoneOrgService { |
|||
|
|||
public InterphoneOrgServiceImpl(ApiClient apiClient) { |
|||
super(apiClient); |
|||
} |
|||
|
|||
@Override |
|||
public String addOrg(InterphoneOrgCreateReqVO createReqVO) { |
|||
Map<String, String> queryParams = newQueryParams(); |
|||
putIfHasText(queryParams, "name", createReqVO.getName()); |
|||
putIfHasText(queryParams, "loginname", createReqVO.getLoginname()); |
|||
putIfHasText(queryParams, "password", createReqVO.getPassword()); |
|||
putIfHasText(queryParams, "phone", createReqVO.getPhone()); |
|||
putIfHasText(queryParams, "address", createReqVO.getAddress()); |
|||
putIfHasText(queryParams, "contact", createReqVO.getContact()); |
|||
putIfNotNull(queryParams, "isDefault", "0"); |
|||
|
|||
String responseBody = executePost("/org/add", queryParams); |
|||
try { |
|||
InterphoneOrgRespVO response = JsonUtils.parseObject(responseBody, InterphoneOrgRespVO.class); |
|||
return response.getId(); |
|||
} catch (Exception e) { |
|||
throw new RuntimeException("对讲平台新增单位失败", e); |
|||
} |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public PageResult<InterphoneOrgRespVO> getAgentOrgs(InterphoneOrgPageReqVO reqVO) { |
|||
Map<String, String> queryParams = newQueryParams(); |
|||
putIfNotNull(queryParams, "pageNo", reqVO.getPageNo()); |
|||
putIfNotNull(queryParams, "pageSize", reqVO.getPageSize()); |
|||
putIfHasText(queryParams, "name", reqVO.getName()); |
|||
String responseBody = executeGet("/agent/orgs", queryParams); |
|||
InterphonePageResponse<InterphoneOrgRespVO> response = JsonUtils.parseObject(responseBody, |
|||
new TypeReference<InterphonePageResponse<InterphoneOrgRespVO>>() { |
|||
}); |
|||
if (response == null) { |
|||
return PageResult.empty(); |
|||
} |
|||
return new PageResult<>(response.getData() == null ? Collections.emptyList() : response.getData(), |
|||
response.getCount() == null ? 0L : response.getCount()); |
|||
} |
|||
|
|||
@Override |
|||
public void deleteOrg(String id) { |
|||
Map<String, String> queryParams = newQueryParams(); |
|||
putIfHasText(queryParams, "id", id); |
|||
executePost("/org/deletingUnit", queryParams); |
|||
} |
|||
|
|||
@Override |
|||
public void updateOrg(InterphoneOrgCreateReqVO createReqVO) { |
|||
Map<String, String> queryParams = newQueryParams(); |
|||
putIfHasText(queryParams, "id", createReqVO.getId()); |
|||
putIfHasText(queryParams, "corgName", createReqVO.getName()); |
|||
putIfHasText(queryParams, "contact", createReqVO.getContact()); |
|||
putIfHasText(queryParams, "address", createReqVO.getAddress()); |
|||
executePost("/org/xiugaiUnit", queryParams); |
|||
} |
|||
} |
|||
@ -0,0 +1,25 @@ |
|||
package cn.iocoder.yudao.module.interphone.service.impl; |
|||
|
|||
import cn.iocoder.yudao.module.interphone.core.ApiClient; |
|||
import cn.iocoder.yudao.module.interphone.service.InterphoneProfileService; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.validation.annotation.Validated; |
|||
|
|||
@Service |
|||
@Validated |
|||
public class InterphoneProfileServiceImpl extends AbstractInterphoneServiceSupport implements InterphoneProfileService { |
|||
|
|||
public InterphoneProfileServiceImpl(ApiClient apiClient) { |
|||
super(apiClient); |
|||
} |
|||
|
|||
@Override |
|||
public String getAgentProfile() { |
|||
return executeGet("/profile/agent"); |
|||
} |
|||
|
|||
@Override |
|||
public String getFastStats() { |
|||
return executeGet("/profile/faststats"); |
|||
} |
|||
} |
|||
@ -0,0 +1,22 @@ |
|||
package cn.iocoder.yudao.module.interphone.service.impl; |
|||
|
|||
import cn.iocoder.yudao.module.interphone.core.ApiClient; |
|||
import cn.iocoder.yudao.module.interphone.service.InterphoneRecordService; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.validation.annotation.Validated; |
|||
|
|||
import java.util.Map; |
|||
|
|||
@Service |
|||
@Validated |
|||
public class InterphoneRecordServiceImpl extends AbstractInterphoneServiceSupport implements InterphoneRecordService { |
|||
|
|||
public InterphoneRecordServiceImpl(ApiClient apiClient) { |
|||
super(apiClient); |
|||
} |
|||
|
|||
@Override |
|||
public String getRecordList(Map<String, String> queryParams) { |
|||
return executeGet("/record/list", queryParams); |
|||
} |
|||
} |
|||
@ -0,0 +1,67 @@ |
|||
package cn.iocoder.yudao.module.interphone.service.impl; |
|||
|
|||
import cn.iocoder.yudao.module.interphone.core.ApiClient; |
|||
import cn.iocoder.yudao.module.interphone.service.InterphoneTerminalService; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.validation.annotation.Validated; |
|||
|
|||
import java.util.Map; |
|||
|
|||
@Service |
|||
@Validated |
|||
public class InterphoneTerminalServiceImpl extends AbstractInterphoneServiceSupport implements InterphoneTerminalService { |
|||
|
|||
public InterphoneTerminalServiceImpl(ApiClient apiClient) { |
|||
super(apiClient); |
|||
} |
|||
|
|||
@Override |
|||
public String querySubordinateUser(Integer pageNo, Integer pageSize, String agentId, String orgId, |
|||
String groupId, String userName, String account) { |
|||
Map<String, String> queryParams = newQueryParams(); |
|||
putIfNotNull(queryParams, "pageNo", pageNo); |
|||
putIfNotNull(queryParams, "pageSize", pageSize); |
|||
putIfHasText(queryParams, "agentId", agentId); |
|||
putIfHasText(queryParams, "orgId", orgId); |
|||
putIfHasText(queryParams, "groupId", groupId); |
|||
putIfHasText(queryParams, "userName", userName); |
|||
putIfHasText(queryParams, "account", account); |
|||
return executeGet("/terminal/querySubordinateUser", queryParams); |
|||
} |
|||
|
|||
@Override |
|||
public String createTerminalUsers(String requestBody) { |
|||
return null; |
|||
} |
|||
|
|||
@Override |
|||
public String getTerminalList(Integer pageNo, Integer pageSize, String orgId, String groupId, String name) { |
|||
Map<String, String> queryParams = newQueryParams(); |
|||
putIfNotNull(queryParams, "pageNo", pageNo); |
|||
putIfNotNull(queryParams, "pageSize", pageSize); |
|||
putIfHasText(queryParams, "org_id", orgId); |
|||
putIfHasText(queryParams, "groupId", groupId); |
|||
putIfHasText(queryParams, "name", name); |
|||
return executeGet("/terminal/list", queryParams); |
|||
} |
|||
|
|||
@Override |
|||
public String getTerminalDetail(Map<String, String> queryParams) { |
|||
return executeGet("/terminal/detail", queryParams); |
|||
} |
|||
|
|||
@Override |
|||
public String updateTerminalUser(String requestBody) { |
|||
return null; |
|||
} |
|||
|
|||
@Override |
|||
public String deleteTerminalUser(String requestBody) { |
|||
return null; |
|||
} |
|||
|
|||
@Override |
|||
public String getTerminalUserOnlineStatus(Map<String, String> queryParams) { |
|||
return executeGet("/terminal/userOnlineStatus", queryParams); |
|||
} |
|||
} |
|||
@ -0,0 +1,62 @@ |
|||
package cn.iocoder.yudao.module.interphone.service.recordaudio; |
|||
|
|||
import java.util.*; |
|||
import jakarta.validation.*; |
|||
import cn.iocoder.yudao.module.interphone.controller.admin.recordaudio.vo.*; |
|||
import cn.iocoder.yudao.module.interphone.dal.dataobject.recordaudio.RecordAudioDO; |
|||
import cn.iocoder.yudao.framework.common.pojo.PageResult; |
|||
import cn.iocoder.yudao.framework.common.pojo.PageParam; |
|||
|
|||
/** |
|||
* 实时录音记录 Service 接口 |
|||
* |
|||
* @author 超级管理员 |
|||
*/ |
|||
public interface RecordAudioService { |
|||
|
|||
/** |
|||
* 创建实时录音记录 |
|||
* |
|||
* @param createReqVO 创建信息 |
|||
* @return 编号 |
|||
*/ |
|||
Long createRecordAudio(@Valid RecordAudioSaveReqVO createReqVO); |
|||
|
|||
/** |
|||
* 更新实时录音记录 |
|||
* |
|||
* @param updateReqVO 更新信息 |
|||
*/ |
|||
void updateRecordAudio(@Valid RecordAudioSaveReqVO updateReqVO); |
|||
|
|||
/** |
|||
* 删除实时录音记录 |
|||
* |
|||
* @param id 编号 |
|||
*/ |
|||
void deleteRecordAudio(Long id); |
|||
|
|||
/** |
|||
* 批量删除实时录音记录 |
|||
* |
|||
* @param ids 编号 |
|||
*/ |
|||
void deleteRecordAudioListByIds(List<Long> ids); |
|||
|
|||
/** |
|||
* 获得实时录音记录 |
|||
* |
|||
* @param id 编号 |
|||
* @return 实时录音记录 |
|||
*/ |
|||
RecordAudioDO getRecordAudio(Long id); |
|||
|
|||
/** |
|||
* 获得实时录音记录分页 |
|||
* |
|||
* @param pageReqVO 分页查询 |
|||
* @return 实时录音记录分页 |
|||
*/ |
|||
PageResult<RecordAudioDO> getRecordAudioPage(RecordAudioPageReqVO pageReqVO); |
|||
|
|||
} |
|||
@ -0,0 +1,81 @@ |
|||
package cn.iocoder.yudao.module.interphone.service.recordaudio; |
|||
|
|||
import cn.hutool.core.collection.CollUtil; |
|||
import org.springframework.stereotype.Service; |
|||
import jakarta.annotation.Resource; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
import java.util.*; |
|||
import cn.iocoder.yudao.module.interphone.controller.admin.recordaudio.vo.*; |
|||
import cn.iocoder.yudao.module.interphone.dal.dataobject.recordaudio.RecordAudioDO; |
|||
import cn.iocoder.yudao.framework.common.pojo.PageResult; |
|||
import cn.iocoder.yudao.framework.common.pojo.PageParam; |
|||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils; |
|||
|
|||
import cn.iocoder.yudao.module.interphone.dal.mysql.recordaudio.RecordAudioMapper; |
|||
|
|||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; |
|||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList; |
|||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.diffList; |
|||
import static cn.iocoder.yudao.module.interphone.enums.ErrorCodeConstants.*; |
|||
|
|||
/** |
|||
* 实时录音记录 Service 实现类 |
|||
* |
|||
* @author 超级管理员 |
|||
*/ |
|||
@Service |
|||
@Validated |
|||
public class RecordAudioServiceImpl implements RecordAudioService { |
|||
|
|||
@Resource |
|||
private RecordAudioMapper recordAudioMapper; |
|||
|
|||
@Override |
|||
public Long createRecordAudio(RecordAudioSaveReqVO createReqVO) { |
|||
// 插入
|
|||
RecordAudioDO recordAudio = BeanUtils.toBean(createReqVO, RecordAudioDO.class); |
|||
recordAudioMapper.insert(recordAudio); |
|||
|
|||
// 返回
|
|||
return recordAudio.getId(); |
|||
} |
|||
|
|||
@Override |
|||
public void updateRecordAudio(RecordAudioSaveReqVO updateReqVO) { |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public void deleteRecordAudio(Long id) { |
|||
// 校验存在
|
|||
validateRecordAudioExists(id); |
|||
// 删除
|
|||
recordAudioMapper.deleteById(id); |
|||
} |
|||
|
|||
@Override |
|||
public void deleteRecordAudioListByIds(List<Long> ids) { |
|||
// 删除
|
|||
recordAudioMapper.deleteByIds(ids); |
|||
} |
|||
|
|||
|
|||
private void validateRecordAudioExists(Long id) { |
|||
if (recordAudioMapper.selectById(id) == null) { |
|||
throw exception(RECORD_AUDIO_NOT_EXISTS); |
|||
} |
|||
} |
|||
|
|||
@Override |
|||
public RecordAudioDO getRecordAudio(Long id) { |
|||
return recordAudioMapper.selectById(id); |
|||
} |
|||
|
|||
@Override |
|||
public PageResult<RecordAudioDO> getRecordAudioPage(RecordAudioPageReqVO pageReqVO) { |
|||
return recordAudioMapper.selectPage(pageReqVO); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,12 @@ |
|||
<?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.iocoder.yudao.module.interphone.dal.mysql.recordaudio.RecordAudioMapper"> |
|||
|
|||
<!-- |
|||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。 |
|||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。 |
|||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。 |
|||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/ |
|||
--> |
|||
|
|||
</mapper> |
|||
@ -0,0 +1,46 @@ |
|||
package cn.iocoder.yudao.module.interphone.demo; |
|||
|
|||
import cn.iocoder.yudao.framework.test.core.ut.BaseRedisUnitTest; |
|||
import cn.iocoder.yudao.module.interphone.auth.DefaultLoginService; |
|||
import cn.iocoder.yudao.module.interphone.auth.DefaultTokenManager; |
|||
import cn.iocoder.yudao.module.interphone.config.OkHttpClientConfig; |
|||
import cn.iocoder.yudao.module.interphone.controller.admin.org.vo.InterphoneOrgCreateReqVO; |
|||
import cn.iocoder.yudao.module.interphone.core.ApiClient; |
|||
import cn.iocoder.yudao.module.interphone.retry.TokenExpiredRetryHandler; |
|||
import cn.iocoder.yudao.module.interphone.service.InterphoneOrgService; |
|||
import cn.iocoder.yudao.module.interphone.service.impl.InterphoneOrgServiceImpl; |
|||
import jakarta.annotation.Resource; |
|||
import okhttp3.OkHttpClient; |
|||
import org.checkerframework.checker.units.qual.A; |
|||
import org.junit.jupiter.api.Test; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.context.annotation.Import; |
|||
|
|||
@Import({ |
|||
OkHttpClientConfig.class, |
|||
DefaultLoginService.class, |
|||
DefaultTokenManager.class, |
|||
ApiClient.class, |
|||
TokenExpiredRetryHandler.class, |
|||
OkHttpClient.class, |
|||
InterphoneOrgServiceImpl.class |
|||
}) |
|||
public class orgClientTest extends BaseRedisUnitTest { |
|||
|
|||
@Autowired |
|||
private InterphoneOrgService orgService; |
|||
|
|||
@Test |
|||
public void testAddOrg_Success() { |
|||
InterphoneOrgCreateReqVO createReqVO = new InterphoneOrgCreateReqVO(); |
|||
createReqVO.setName("fubowen"); |
|||
createReqVO.setLoginname("fubowen"); |
|||
createReqVO.setPassword("Gsking164411."); |
|||
createReqVO.setContact("fubowen"); |
|||
String s = orgService.addOrg(createReqVO); |
|||
System.out.println(s); |
|||
} |
|||
|
|||
|
|||
|
|||
} |
|||
@ -1,104 +0,0 @@ |
|||
package cn.iocoder.yudao.module.system.controller.admin.tenantinterphone; |
|||
|
|||
import org.springframework.web.bind.annotation.*; |
|||
import jakarta.annotation.Resource; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.security.access.prepost.PreAuthorize; |
|||
import io.swagger.v3.oas.annotations.tags.Tag; |
|||
import io.swagger.v3.oas.annotations.Parameter; |
|||
import io.swagger.v3.oas.annotations.Operation; |
|||
|
|||
import jakarta.validation.constraints.*; |
|||
import jakarta.validation.*; |
|||
import jakarta.servlet.http.*; |
|||
import java.util.*; |
|||
import java.io.IOException; |
|||
|
|||
import cn.iocoder.yudao.framework.common.pojo.PageParam; |
|||
import cn.iocoder.yudao.framework.common.pojo.PageResult; |
|||
import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
|||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils; |
|||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; |
|||
|
|||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; |
|||
|
|||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog; |
|||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*; |
|||
|
|||
import cn.iocoder.yudao.module.system.controller.admin.tenantinterphone.vo.*; |
|||
import cn.iocoder.yudao.module.system.dal.dataobject.tenantinterphone.TenantInterphoneDO; |
|||
import cn.iocoder.yudao.module.system.service.tenantinterphone.TenantInterphoneService; |
|||
|
|||
@Tag(name = "管理后台 - 租户对讲平台对应") |
|||
@RestController |
|||
@RequestMapping("/system/tenant-interphone") |
|||
@Validated |
|||
public class TenantInterphoneController { |
|||
|
|||
@Resource |
|||
private TenantInterphoneService tenantInterphoneService; |
|||
|
|||
@PostMapping("/create") |
|||
@Operation(summary = "创建租户对讲平台对应") |
|||
@PreAuthorize("@ss.hasPermission('system:tenant-interphone:create')") |
|||
public CommonResult<Long> createTenantInterphone(@Valid @RequestBody TenantInterphoneSaveReqVO createReqVO) { |
|||
return success(tenantInterphoneService.createTenantInterphone(createReqVO)); |
|||
} |
|||
|
|||
@PutMapping("/update") |
|||
@Operation(summary = "更新租户对讲平台对应") |
|||
@PreAuthorize("@ss.hasPermission('system:tenant-interphone:update')") |
|||
public CommonResult<Boolean> updateTenantInterphone(@Valid @RequestBody TenantInterphoneSaveReqVO updateReqVO) { |
|||
tenantInterphoneService.updateTenantInterphone(updateReqVO); |
|||
return success(true); |
|||
} |
|||
|
|||
@DeleteMapping("/delete") |
|||
@Operation(summary = "删除租户对讲平台对应") |
|||
@Parameter(name = "id", description = "编号", required = true) |
|||
@PreAuthorize("@ss.hasPermission('system:tenant-interphone:delete')") |
|||
public CommonResult<Boolean> deleteTenantInterphone(@RequestParam("id") Long id) { |
|||
tenantInterphoneService.deleteTenantInterphone(id); |
|||
return success(true); |
|||
} |
|||
|
|||
@DeleteMapping("/delete-list") |
|||
@Parameter(name = "ids", description = "编号", required = true) |
|||
@Operation(summary = "批量删除租户对讲平台对应") |
|||
@PreAuthorize("@ss.hasPermission('system:tenant-interphone:delete')") |
|||
public CommonResult<Boolean> deleteTenantInterphoneList(@RequestParam("ids") List<Long> ids) { |
|||
tenantInterphoneService.deleteTenantInterphoneListByIds(ids); |
|||
return success(true); |
|||
} |
|||
|
|||
@GetMapping("/get") |
|||
@Operation(summary = "获得租户对讲平台对应") |
|||
@Parameter(name = "id", description = "编号", required = true, example = "1024") |
|||
@PreAuthorize("@ss.hasPermission('system:tenant-interphone:query')") |
|||
public CommonResult<TenantInterphoneRespVO> getTenantInterphone(@RequestParam("id") Long id) { |
|||
TenantInterphoneDO tenantInterphone = tenantInterphoneService.getTenantInterphone(id); |
|||
return success(BeanUtils.toBean(tenantInterphone, TenantInterphoneRespVO.class)); |
|||
} |
|||
|
|||
@GetMapping("/page") |
|||
@Operation(summary = "获得租户对讲平台对应分页") |
|||
@PreAuthorize("@ss.hasPermission('system:tenant-interphone:query')") |
|||
public CommonResult<PageResult<TenantInterphoneRespVO>> getTenantInterphonePage(@Valid TenantInterphonePageReqVO pageReqVO) { |
|||
PageResult<TenantInterphoneDO> pageResult = tenantInterphoneService.getTenantInterphonePage(pageReqVO); |
|||
return success(BeanUtils.toBean(pageResult, TenantInterphoneRespVO.class)); |
|||
} |
|||
|
|||
@GetMapping("/export-excel") |
|||
@Operation(summary = "导出租户对讲平台对应 Excel") |
|||
@PreAuthorize("@ss.hasPermission('system:tenant-interphone:export')") |
|||
@ApiAccessLog(operateType = EXPORT) |
|||
public void exportTenantInterphoneExcel(@Valid TenantInterphonePageReqVO pageReqVO, |
|||
HttpServletResponse response) throws IOException { |
|||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); |
|||
List<TenantInterphoneDO> list = tenantInterphoneService.getTenantInterphonePage(pageReqVO).getList(); |
|||
// 导出 Excel
|
|||
ExcelUtils.write(response, "租户对讲平台对应.xls", "数据", TenantInterphoneRespVO.class, |
|||
BeanUtils.toBean(list, TenantInterphoneRespVO.class)); |
|||
} |
|||
|
|||
} |
|||
@ -1,44 +0,0 @@ |
|||
package cn.iocoder.yudao.module.system.controller.admin.tenantinterphone.vo; |
|||
|
|||
import lombok.*; |
|||
import java.util.*; |
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import cn.iocoder.yudao.framework.common.pojo.PageParam; |
|||
import org.springframework.format.annotation.DateTimeFormat; |
|||
import java.time.LocalDateTime; |
|||
|
|||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
|||
|
|||
@Schema(description = "管理后台 - 租户对讲平台对应分页 Request VO") |
|||
@Data |
|||
public class TenantInterphonePageReqVO extends PageParam { |
|||
|
|||
@Schema(description = "租户id", example = "18871") |
|||
private Long tendId; |
|||
|
|||
@Schema(description = "创建时间") |
|||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|||
private LocalDateTime[] createTime; |
|||
|
|||
@Schema(description = "对讲平台单位id", example = "16985") |
|||
private Long corgId; |
|||
|
|||
@Schema(description = "对讲平台单位名称", example = "张三") |
|||
private String corgName; |
|||
|
|||
@Schema(description = "对讲平台用户数量", example = "11267") |
|||
private Long userCount; |
|||
|
|||
@Schema(description = "对讲平台群组数量", example = "27649") |
|||
private Long groupCount; |
|||
|
|||
@Schema(description = "对讲平台账号", example = "张三") |
|||
private String loginname; |
|||
|
|||
@Schema(description = "对讲平台联系人") |
|||
private String contact; |
|||
|
|||
@Schema(description = "对讲平台单位是否绑定平台") |
|||
private Integer bindingPlatform; |
|||
|
|||
} |
|||
@ -1,55 +0,0 @@ |
|||
package cn.iocoder.yudao.module.system.controller.admin.tenantinterphone.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.*; |
|||
import java.util.*; |
|||
import org.springframework.format.annotation.DateTimeFormat; |
|||
import java.time.LocalDateTime; |
|||
import com.alibaba.excel.annotation.*; |
|||
|
|||
@Schema(description = "管理后台 - 租户对讲平台对应 Response VO") |
|||
@Data |
|||
@ExcelIgnoreUnannotated |
|||
public class TenantInterphoneRespVO { |
|||
|
|||
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "8781") |
|||
@ExcelProperty("id") |
|||
private Long id; |
|||
|
|||
@Schema(description = "租户id", requiredMode = Schema.RequiredMode.REQUIRED, example = "18871") |
|||
@ExcelProperty("租户id") |
|||
private Long tendId; |
|||
|
|||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) |
|||
@ExcelProperty("创建时间") |
|||
private LocalDateTime createTime; |
|||
|
|||
@Schema(description = "对讲平台单位id", requiredMode = Schema.RequiredMode.REQUIRED, example = "16985") |
|||
@ExcelProperty("对讲平台单位id") |
|||
private Long corgId; |
|||
|
|||
@Schema(description = "对讲平台单位名称", example = "张三") |
|||
@ExcelProperty("对讲平台单位名称") |
|||
private String corgName; |
|||
|
|||
@Schema(description = "对讲平台用户数量", example = "11267") |
|||
@ExcelProperty("对讲平台用户数量") |
|||
private Long userCount; |
|||
|
|||
@Schema(description = "对讲平台群组数量", example = "27649") |
|||
@ExcelProperty("对讲平台群组数量") |
|||
private Long groupCount; |
|||
|
|||
@Schema(description = "对讲平台账号", example = "张三") |
|||
@ExcelProperty("对讲平台账号") |
|||
private String loginname; |
|||
|
|||
@Schema(description = "对讲平台联系人") |
|||
@ExcelProperty("对讲平台联系人") |
|||
private String contact; |
|||
|
|||
@Schema(description = "对讲平台单位是否绑定平台") |
|||
@ExcelProperty("对讲平台单位是否绑定平台") |
|||
private Integer bindingPlatform; |
|||
|
|||
} |
|||
@ -1,44 +0,0 @@ |
|||
package cn.iocoder.yudao.module.system.controller.admin.tenantinterphone.vo; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.*; |
|||
import java.util.*; |
|||
import jakarta.validation.constraints.*; |
|||
|
|||
@Schema(description = "管理后台 - 租户对讲平台对应新增/修改 Request VO") |
|||
@Data |
|||
public class TenantInterphoneSaveReqVO { |
|||
|
|||
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "8781") |
|||
private Long id; |
|||
|
|||
@Schema(description = "租户id", requiredMode = Schema.RequiredMode.REQUIRED, example = "18871") |
|||
@NotNull(message = "租户id不能为空") |
|||
private Long tendId; |
|||
|
|||
@Schema(description = "对讲平台单位id", requiredMode = Schema.RequiredMode.REQUIRED, example = "16985") |
|||
@NotNull(message = "对讲平台单位id不能为空") |
|||
private Long corgId; |
|||
|
|||
@Schema(description = "对讲平台单位名称", example = "张三") |
|||
private String corgName; |
|||
|
|||
@Schema(description = "对讲平台用户数量", example = "11267") |
|||
private Long userCount; |
|||
|
|||
@Schema(description = "对讲平台群组数量", example = "27649") |
|||
private Long groupCount; |
|||
|
|||
@Schema(description = "对讲平台账号", example = "张三") |
|||
private String loginname; |
|||
|
|||
@Schema(description = "对讲平台密码") |
|||
private String password; |
|||
|
|||
@Schema(description = "对讲平台联系人") |
|||
private String contact; |
|||
|
|||
@Schema(description = "对讲平台单位是否绑定平台") |
|||
private Integer bindingPlatform; |
|||
|
|||
} |
|||
@ -1,68 +0,0 @@ |
|||
package cn.iocoder.yudao.module.system.dal.dataobject.tenantinterphone; |
|||
|
|||
import lombok.*; |
|||
import java.util.*; |
|||
import java.time.LocalDateTime; |
|||
import java.time.LocalDateTime; |
|||
import com.baomidou.mybatisplus.annotation.*; |
|||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; |
|||
|
|||
/** |
|||
* 租户对讲平台对应 DO |
|||
* |
|||
* @author 超级管理员 |
|||
*/ |
|||
@TableName("system_tenant_interphone") |
|||
@KeySequence("system_tenant_interphone_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@ToString(callSuper = true) |
|||
@Builder |
|||
@NoArgsConstructor |
|||
@AllArgsConstructor |
|||
public class TenantInterphoneDO extends BaseDO { |
|||
|
|||
/** |
|||
* id |
|||
*/ |
|||
@TableId |
|||
private Long id; |
|||
/** |
|||
* 租户id |
|||
*/ |
|||
private Long tendId; |
|||
/** |
|||
* 对讲平台单位id |
|||
*/ |
|||
private Long corgId; |
|||
/** |
|||
* 对讲平台单位名称 |
|||
*/ |
|||
private String corgName; |
|||
/** |
|||
* 对讲平台用户数量 |
|||
*/ |
|||
private Long userCount; |
|||
/** |
|||
* 对讲平台群组数量 |
|||
*/ |
|||
private Long groupCount; |
|||
/** |
|||
* 对讲平台账号 |
|||
*/ |
|||
private String loginname; |
|||
/** |
|||
* 对讲平台密码 |
|||
*/ |
|||
private String password; |
|||
/** |
|||
* 对讲平台联系人 |
|||
*/ |
|||
private String contact; |
|||
/** |
|||
* 对讲平台单位是否绑定平台 |
|||
*/ |
|||
private Integer bindingPlatform; |
|||
|
|||
|
|||
} |
|||
@ -1,34 +0,0 @@ |
|||
package cn.iocoder.yudao.module.system.dal.mysql.tenantinterphone; |
|||
|
|||
import java.util.*; |
|||
|
|||
import cn.iocoder.yudao.framework.common.pojo.PageResult; |
|||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; |
|||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; |
|||
import cn.iocoder.yudao.module.system.dal.dataobject.tenantinterphone.TenantInterphoneDO; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import cn.iocoder.yudao.module.system.controller.admin.tenantinterphone.vo.*; |
|||
|
|||
/** |
|||
* 租户对讲平台对应 Mapper |
|||
* |
|||
* @author 超级管理员 |
|||
*/ |
|||
@Mapper |
|||
public interface TenantInterphoneMapper extends BaseMapperX<TenantInterphoneDO> { |
|||
|
|||
default PageResult<TenantInterphoneDO> selectPage(TenantInterphonePageReqVO reqVO) { |
|||
return selectPage(reqVO, new LambdaQueryWrapperX<TenantInterphoneDO>() |
|||
.eqIfPresent(TenantInterphoneDO::getTendId, reqVO.getTendId()) |
|||
.betweenIfPresent(TenantInterphoneDO::getCreateTime, reqVO.getCreateTime()) |
|||
.eqIfPresent(TenantInterphoneDO::getCorgId, reqVO.getCorgId()) |
|||
.likeIfPresent(TenantInterphoneDO::getCorgName, reqVO.getCorgName()) |
|||
.eqIfPresent(TenantInterphoneDO::getUserCount, reqVO.getUserCount()) |
|||
.eqIfPresent(TenantInterphoneDO::getGroupCount, reqVO.getGroupCount()) |
|||
.likeIfPresent(TenantInterphoneDO::getLoginname, reqVO.getLoginname()) |
|||
.eqIfPresent(TenantInterphoneDO::getContact, reqVO.getContact()) |
|||
.eqIfPresent(TenantInterphoneDO::getBindingPlatform, reqVO.getBindingPlatform()) |
|||
.orderByDesc(TenantInterphoneDO::getId)); |
|||
} |
|||
|
|||
} |
|||
@ -1,62 +0,0 @@ |
|||
package cn.iocoder.yudao.module.system.service.tenantinterphone; |
|||
|
|||
import java.util.*; |
|||
import jakarta.validation.*; |
|||
import cn.iocoder.yudao.module.system.controller.admin.tenantinterphone.vo.*; |
|||
import cn.iocoder.yudao.module.system.dal.dataobject.tenantinterphone.TenantInterphoneDO; |
|||
import cn.iocoder.yudao.framework.common.pojo.PageResult; |
|||
import cn.iocoder.yudao.framework.common.pojo.PageParam; |
|||
|
|||
/** |
|||
* 租户对讲平台对应 Service 接口 |
|||
* |
|||
* @author 超级管理员 |
|||
*/ |
|||
public interface TenantInterphoneService { |
|||
|
|||
/** |
|||
* 创建租户对讲平台对应 |
|||
* |
|||
* @param createReqVO 创建信息 |
|||
* @return 编号 |
|||
*/ |
|||
Long createTenantInterphone(@Valid TenantInterphoneSaveReqVO createReqVO); |
|||
|
|||
/** |
|||
* 更新租户对讲平台对应 |
|||
* |
|||
* @param updateReqVO 更新信息 |
|||
*/ |
|||
void updateTenantInterphone(@Valid TenantInterphoneSaveReqVO updateReqVO); |
|||
|
|||
/** |
|||
* 删除租户对讲平台对应 |
|||
* |
|||
* @param id 编号 |
|||
*/ |
|||
void deleteTenantInterphone(Long id); |
|||
|
|||
/** |
|||
* 批量删除租户对讲平台对应 |
|||
* |
|||
* @param ids 编号 |
|||
*/ |
|||
void deleteTenantInterphoneListByIds(List<Long> ids); |
|||
|
|||
/** |
|||
* 获得租户对讲平台对应 |
|||
* |
|||
* @param id 编号 |
|||
* @return 租户对讲平台对应 |
|||
*/ |
|||
TenantInterphoneDO getTenantInterphone(Long id); |
|||
|
|||
/** |
|||
* 获得租户对讲平台对应分页 |
|||
* |
|||
* @param pageReqVO 分页查询 |
|||
* @return 租户对讲平台对应分页 |
|||
*/ |
|||
PageResult<TenantInterphoneDO> getTenantInterphonePage(TenantInterphonePageReqVO pageReqVO); |
|||
|
|||
} |
|||
@ -1,85 +0,0 @@ |
|||
package cn.iocoder.yudao.module.system.service.tenantinterphone; |
|||
|
|||
import cn.hutool.core.collection.CollUtil; |
|||
import org.springframework.stereotype.Service; |
|||
import jakarta.annotation.Resource; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
import java.util.*; |
|||
import cn.iocoder.yudao.module.system.controller.admin.tenantinterphone.vo.*; |
|||
import cn.iocoder.yudao.module.system.dal.dataobject.tenantinterphone.TenantInterphoneDO; |
|||
import cn.iocoder.yudao.framework.common.pojo.PageResult; |
|||
import cn.iocoder.yudao.framework.common.pojo.PageParam; |
|||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils; |
|||
|
|||
import cn.iocoder.yudao.module.system.dal.mysql.tenantinterphone.TenantInterphoneMapper; |
|||
|
|||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; |
|||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList; |
|||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.diffList; |
|||
import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*; |
|||
|
|||
/** |
|||
* 租户对讲平台对应 Service 实现类 |
|||
* |
|||
* @author 超级管理员 |
|||
*/ |
|||
@Service |
|||
@Validated |
|||
public class TenantInterphoneServiceImpl implements TenantInterphoneService { |
|||
|
|||
@Resource |
|||
private TenantInterphoneMapper tenantInterphoneMapper; |
|||
|
|||
@Override |
|||
public Long createTenantInterphone(TenantInterphoneSaveReqVO createReqVO) { |
|||
// 插入
|
|||
TenantInterphoneDO tenantInterphone = BeanUtils.toBean(createReqVO, TenantInterphoneDO.class); |
|||
tenantInterphoneMapper.insert(tenantInterphone); |
|||
|
|||
// 返回
|
|||
return tenantInterphone.getId(); |
|||
} |
|||
|
|||
@Override |
|||
public void updateTenantInterphone(TenantInterphoneSaveReqVO updateReqVO) { |
|||
// 校验存在
|
|||
validateTenantInterphoneExists(updateReqVO.getId()); |
|||
// 更新
|
|||
TenantInterphoneDO updateObj = BeanUtils.toBean(updateReqVO, TenantInterphoneDO.class); |
|||
tenantInterphoneMapper.updateById(updateObj); |
|||
} |
|||
|
|||
@Override |
|||
public void deleteTenantInterphone(Long id) { |
|||
// 校验存在
|
|||
validateTenantInterphoneExists(id); |
|||
// 删除
|
|||
tenantInterphoneMapper.deleteById(id); |
|||
} |
|||
|
|||
@Override |
|||
public void deleteTenantInterphoneListByIds(List<Long> ids) { |
|||
// 删除
|
|||
tenantInterphoneMapper.deleteByIds(ids); |
|||
} |
|||
|
|||
|
|||
private void validateTenantInterphoneExists(Long id) { |
|||
if (tenantInterphoneMapper.selectById(id) == null) { |
|||
throw exception(TENANT_INTERPHONE_NOT_EXISTS); |
|||
} |
|||
} |
|||
|
|||
@Override |
|||
public TenantInterphoneDO getTenantInterphone(Long id) { |
|||
return tenantInterphoneMapper.selectById(id); |
|||
} |
|||
|
|||
@Override |
|||
public PageResult<TenantInterphoneDO> getTenantInterphonePage(TenantInterphonePageReqVO pageReqVO) { |
|||
return tenantInterphoneMapper.selectPage(pageReqVO); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,44 @@ |
|||
import request from '@/config/axios' |
|||
import type { Dayjs } from 'dayjs'; |
|||
|
|||
/** 实时录音记录信息 */ |
|||
export interface RecordAudio { |
|||
} |
|||
|
|||
// 实时录音记录 API
|
|||
export const RecordAudioApi = { |
|||
// 查询实时录音记录分页
|
|||
getRecordAudioPage: async (params: any) => { |
|||
return await request.get({ url: `/interphone/record-audio/page`, params }) |
|||
}, |
|||
|
|||
// 查询实时录音记录详情
|
|||
getRecordAudio: async (id: number) => { |
|||
return await request.get({ url: `/interphone/record-audio/get?id=` + id }) |
|||
}, |
|||
|
|||
// 新增实时录音记录
|
|||
createRecordAudio: async (data: RecordAudio) => { |
|||
return await request.post({ url: `/interphone/record-audio/create`, data }) |
|||
}, |
|||
|
|||
// 修改实时录音记录
|
|||
updateRecordAudio: async (data: RecordAudio) => { |
|||
return await request.put({ url: `/interphone/record-audio/update`, data }) |
|||
}, |
|||
|
|||
// 删除实时录音记录
|
|||
deleteRecordAudio: async (id: number) => { |
|||
return await request.delete({ url: `/interphone/record-audio/delete?id=` + id }) |
|||
}, |
|||
|
|||
/** 批量删除实时录音记录 */ |
|||
deleteRecordAudioList: async (ids: number[]) => { |
|||
return await request.delete({ url: `/interphone/record-audio/delete-list?ids=${ids.join(',')}` }) |
|||
}, |
|||
|
|||
// 导出实时录音记录 Excel
|
|||
exportRecordAudio: async (params) => { |
|||
return await request.download({ url: `/interphone/record-audio/export-excel`, params }) |
|||
}, |
|||
} |
|||
@ -0,0 +1,84 @@ |
|||
<template> |
|||
<Dialog :title="dialogTitle" v-model="dialogVisible"> |
|||
<el-form |
|||
ref="formRef" |
|||
:model="formData" |
|||
:rules="formRules" |
|||
label-width="100px" |
|||
v-loading="formLoading" |
|||
> |
|||
</el-form> |
|||
<template #footer> |
|||
<el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button> |
|||
<el-button @click="dialogVisible = false">取 消</el-button> |
|||
</template> |
|||
</Dialog> |
|||
</template> |
|||
<script setup lang="ts"> |
|||
import { RecordAudioApi, RecordAudio } from '@/api/interphone/recordaudio' |
|||
|
|||
/** 实时录音记录 表单 */ |
|||
defineOptions({ name: 'RecordAudioForm' }) |
|||
|
|||
const { t } = useI18n() // 国际化 |
|||
const message = useMessage() // 消息弹窗 |
|||
|
|||
const dialogVisible = ref(false) // 弹窗的是否展示 |
|||
const dialogTitle = ref('') // 弹窗的标题 |
|||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用 |
|||
const formType = ref('') // 表单的类型:create - 新增;update - 修改 |
|||
const formData = ref({ |
|||
}) |
|||
const formRules = reactive({ |
|||
}) |
|||
const formRef = ref() // 表单 Ref |
|||
|
|||
/** 打开弹窗 */ |
|||
const open = async (type: string, id?: number) => { |
|||
dialogVisible.value = true |
|||
dialogTitle.value = t('action.' + type) |
|||
formType.value = type |
|||
resetForm() |
|||
// 修改时,设置数据 |
|||
if (id) { |
|||
formLoading.value = true |
|||
try { |
|||
formData.value = await RecordAudioApi.getRecordAudio(id) |
|||
} finally { |
|||
formLoading.value = false |
|||
} |
|||
} |
|||
} |
|||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗 |
|||
|
|||
/** 提交表单 */ |
|||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调 |
|||
const submitForm = async () => { |
|||
// 校验表单 |
|||
await formRef.value.validate() |
|||
// 提交请求 |
|||
formLoading.value = true |
|||
try { |
|||
const data = formData.value as unknown as RecordAudio |
|||
if (formType.value === 'create') { |
|||
await RecordAudioApi.createRecordAudio(data) |
|||
message.success(t('common.createSuccess')) |
|||
} else { |
|||
await RecordAudioApi.updateRecordAudio(data) |
|||
message.success(t('common.updateSuccess')) |
|||
} |
|||
dialogVisible.value = false |
|||
// 发送操作成功的事件 |
|||
emit('success') |
|||
} finally { |
|||
formLoading.value = false |
|||
} |
|||
} |
|||
|
|||
/** 重置表单 */ |
|||
const resetForm = () => { |
|||
formData.value = { |
|||
} |
|||
formRef.value?.resetFields() |
|||
} |
|||
</script> |
|||
@ -0,0 +1,379 @@ |
|||
<template> |
|||
<ContentWrap> |
|||
<!-- 搜索工作栏 --> |
|||
<el-form |
|||
class="-mb-15px" |
|||
:model="queryParams" |
|||
ref="queryFormRef" |
|||
:inline="true" |
|||
label-width="68px" |
|||
> |
|||
<el-form-item label="第三方录音ID" prop="thirdId"> |
|||
<el-input |
|||
v-model="queryParams.thirdId" |
|||
placeholder="请输入第三方录音ID" |
|||
clearable |
|||
@keyup.enter="handleQuery" |
|||
class="!w-240px" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item label="终端ID" prop="tId"> |
|||
<el-input |
|||
v-model="queryParams.tId" |
|||
placeholder="请输入终端ID" |
|||
clearable |
|||
@keyup.enter="handleQuery" |
|||
class="!w-240px" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item label="用户ID" prop="userId"> |
|||
<el-input |
|||
v-model="queryParams.userId" |
|||
placeholder="请输入用户ID" |
|||
clearable |
|||
@keyup.enter="handleQuery" |
|||
class="!w-240px" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item label="用户名" prop="userName"> |
|||
<el-input |
|||
v-model="queryParams.userName" |
|||
placeholder="请输入用户名" |
|||
clearable |
|||
@keyup.enter="handleQuery" |
|||
class="!w-240px" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item label="群组ID" prop="groupId"> |
|||
<el-input |
|||
v-model="queryParams.groupId" |
|||
placeholder="请输入群组ID" |
|||
clearable |
|||
@keyup.enter="handleQuery" |
|||
class="!w-240px" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item label="群组名称" prop="groupName"> |
|||
<el-input |
|||
v-model="queryParams.groupName" |
|||
placeholder="请输入群组名称" |
|||
clearable |
|||
@keyup.enter="handleQuery" |
|||
class="!w-240px" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item label="群组类型" prop="groupType"> |
|||
<el-select |
|||
v-model="queryParams.groupType" |
|||
placeholder="请选择群组类型" |
|||
clearable |
|||
class="!w-240px" |
|||
> |
|||
<el-option label="请选择字典生成" value="" /> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="组织ID" prop="orgId"> |
|||
<el-input |
|||
v-model="queryParams.orgId" |
|||
placeholder="请输入组织ID" |
|||
clearable |
|||
@keyup.enter="handleQuery" |
|||
class="!w-240px" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item label="录音时长毫秒" prop="durationMs"> |
|||
<el-input |
|||
v-model="queryParams.durationMs" |
|||
placeholder="请输入录音时长毫秒" |
|||
clearable |
|||
@keyup.enter="handleQuery" |
|||
class="!w-240px" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item label="音频路径" prop="audioPath"> |
|||
<el-input |
|||
v-model="queryParams.audioPath" |
|||
placeholder="请输入音频路径" |
|||
clearable |
|||
@keyup.enter="handleQuery" |
|||
class="!w-240px" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item label="完整音频OSS URL" prop="audioOssUrl"> |
|||
<el-input |
|||
v-model="queryParams.audioOssUrl" |
|||
placeholder="请输入完整音频OSS URL" |
|||
clearable |
|||
@keyup.enter="handleQuery" |
|||
class="!w-240px" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item label="编码格式" prop="codeFormat"> |
|||
<el-input |
|||
v-model="queryParams.codeFormat" |
|||
placeholder="请输入编码格式" |
|||
clearable |
|||
@keyup.enter="handleQuery" |
|||
class="!w-240px" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item label="录音时间" prop="audioTime"> |
|||
<el-date-picker |
|||
v-model="queryParams.audioTime" |
|||
value-format="YYYY-MM-DD HH:mm:ss" |
|||
type="daterange" |
|||
start-placeholder="开始日期" |
|||
end-placeholder="结束日期" |
|||
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]" |
|||
class="!w-220px" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item label="ASR状态 0未处理 1处理中 2完成 3失败" prop="asrStatus"> |
|||
<el-select |
|||
v-model="queryParams.asrStatus" |
|||
placeholder="请选择ASR状态 0未处理 1处理中 2完成 3失败" |
|||
clearable |
|||
class="!w-240px" |
|||
> |
|||
<el-option label="请选择字典生成" value="" /> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="语音识别结果" prop="asrText"> |
|||
<el-input |
|||
v-model="queryParams.asrText" |
|||
placeholder="请输入语音识别结果" |
|||
clearable |
|||
@keyup.enter="handleQuery" |
|||
class="!w-240px" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item label="创建时间" prop="createTime"> |
|||
<el-date-picker |
|||
v-model="queryParams.createTime" |
|||
value-format="YYYY-MM-DD HH:mm:ss" |
|||
type="daterange" |
|||
start-placeholder="开始日期" |
|||
end-placeholder="结束日期" |
|||
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]" |
|||
class="!w-220px" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item> |
|||
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button> |
|||
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button> |
|||
<el-button |
|||
type="primary" |
|||
plain |
|||
@click="openForm('create')" |
|||
v-hasPermi="['interphone:record-audio:create']" |
|||
> |
|||
<Icon icon="ep:plus" class="mr-5px" /> 新增 |
|||
</el-button> |
|||
<el-button |
|||
type="success" |
|||
plain |
|||
@click="handleExport" |
|||
:loading="exportLoading" |
|||
v-hasPermi="['interphone:record-audio:export']" |
|||
> |
|||
<Icon icon="ep:download" class="mr-5px" /> 导出 |
|||
</el-button> |
|||
<el-button |
|||
type="danger" |
|||
plain |
|||
:disabled="isEmpty(checkedIds)" |
|||
@click="handleDeleteBatch" |
|||
v-hasPermi="['interphone:record-audio:delete']" |
|||
> |
|||
<Icon icon="ep:delete" class="mr-5px" /> 批量删除 |
|||
</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
</ContentWrap> |
|||
|
|||
<!-- 列表 --> |
|||
<ContentWrap> |
|||
<el-table |
|||
row-key="id" |
|||
v-loading="loading" |
|||
:data="list" |
|||
:stripe="true" |
|||
:show-overflow-tooltip="true" |
|||
@selection-change="handleRowCheckboxChange" |
|||
> |
|||
<el-table-column type="selection" width="55" /> |
|||
<el-table-column label="用户名" align="center" prop="userName" /> |
|||
<el-table-column label="群组名称" align="center" prop="groupName" /> |
|||
<el-table-column label="群组类型" align="center" prop="groupType" /> |
|||
<el-table-column label="录音时长毫秒" align="center" prop="durationMs" /> |
|||
<el-table-column label="音频路径" align="center" prop="audioPath" /> |
|||
<el-table-column label="完整音频OSS URL" align="center" prop="audioOssUrl" /> |
|||
<el-table-column label="编码格式" align="center" prop="codeFormat" /> |
|||
<el-table-column |
|||
label="录音时间" |
|||
align="center" |
|||
prop="audioTime" |
|||
:formatter="dateFormatter" |
|||
width="180px" |
|||
/> |
|||
<el-table-column label="ASR状态 0未处理 1处理中 2完成 3失败" align="center" prop="asrStatus" /> |
|||
<el-table-column label="语音识别结果" align="center" prop="asrText" /> |
|||
<el-table-column |
|||
label="创建时间" |
|||
align="center" |
|||
prop="createTime" |
|||
:formatter="dateFormatter" |
|||
width="180px" |
|||
/> |
|||
<el-table-column label="操作" align="center" min-width="120px"> |
|||
<template #default="scope"> |
|||
<el-button |
|||
link |
|||
type="primary" |
|||
@click="openForm('update', scope.row.id)" |
|||
v-hasPermi="['interphone:record-audio:update']" |
|||
> |
|||
编辑 |
|||
</el-button> |
|||
<el-button |
|||
link |
|||
type="danger" |
|||
@click="handleDelete(scope.row.id)" |
|||
v-hasPermi="['interphone:record-audio:delete']" |
|||
> |
|||
删除 |
|||
</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<!-- 分页 --> |
|||
<Pagination |
|||
:total="total" |
|||
v-model:page="queryParams.pageNo" |
|||
v-model:limit="queryParams.pageSize" |
|||
@pagination="getList" |
|||
/> |
|||
</ContentWrap> |
|||
|
|||
<!-- 表单弹窗:添加/修改 --> |
|||
<RecordAudioForm ref="formRef" @success="getList" /> |
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import { isEmpty } from '@/utils/is' |
|||
import { dateFormatter } from '@/utils/formatTime' |
|||
import download from '@/utils/download' |
|||
import { RecordAudioApi, RecordAudio } from '@/api/interphone/recordaudio' |
|||
import RecordAudioForm from './RecordAudioForm.vue' |
|||
|
|||
/** 实时录音记录 列表 */ |
|||
defineOptions({ name: 'RecordAudio' }) |
|||
|
|||
const message = useMessage() // 消息弹窗 |
|||
const { t } = useI18n() // 国际化 |
|||
|
|||
const loading = ref(true) // 列表的加载中 |
|||
const list = ref<RecordAudio[]>([]) // 列表的数据 |
|||
const total = ref(0) // 列表的总页数 |
|||
const queryParams = reactive({ |
|||
pageNo: 1, |
|||
pageSize: 10, |
|||
thirdId: undefined, |
|||
tId: undefined, |
|||
userId: undefined, |
|||
userName: undefined, |
|||
groupId: undefined, |
|||
groupName: undefined, |
|||
groupType: undefined, |
|||
orgId: undefined, |
|||
durationMs: undefined, |
|||
audioPath: undefined, |
|||
audioOssUrl: undefined, |
|||
codeFormat: undefined, |
|||
audioTime: [], |
|||
asrStatus: undefined, |
|||
asrText: undefined, |
|||
createTime: [], |
|||
}) |
|||
const queryFormRef = ref() // 搜索的表单 |
|||
const exportLoading = ref(false) // 导出的加载中 |
|||
|
|||
/** 查询列表 */ |
|||
const getList = async () => { |
|||
loading.value = true |
|||
try { |
|||
const data = await RecordAudioApi.getRecordAudioPage(queryParams) |
|||
list.value = data.list |
|||
total.value = data.total |
|||
} finally { |
|||
loading.value = false |
|||
} |
|||
} |
|||
|
|||
/** 搜索按钮操作 */ |
|||
const handleQuery = () => { |
|||
queryParams.pageNo = 1 |
|||
getList() |
|||
} |
|||
|
|||
/** 重置按钮操作 */ |
|||
const resetQuery = () => { |
|||
queryFormRef.value.resetFields() |
|||
handleQuery() |
|||
} |
|||
|
|||
/** 添加/修改操作 */ |
|||
const formRef = ref() |
|||
const openForm = (type: string, id?: number) => { |
|||
formRef.value.open(type, id) |
|||
} |
|||
|
|||
/** 删除按钮操作 */ |
|||
const handleDelete = async (id: number) => { |
|||
try { |
|||
// 删除的二次确认 |
|||
await message.delConfirm() |
|||
// 发起删除 |
|||
await RecordAudioApi.deleteRecordAudio(id) |
|||
message.success(t('common.delSuccess')) |
|||
// 刷新列表 |
|||
await getList() |
|||
} catch {} |
|||
} |
|||
|
|||
/** 批量删除实时录音记录 */ |
|||
const handleDeleteBatch = async () => { |
|||
try { |
|||
// 删除的二次确认 |
|||
await message.delConfirm() |
|||
await RecordAudioApi.deleteRecordAudioList(checkedIds.value); |
|||
message.success(t('common.delSuccess')) |
|||
await getList(); |
|||
} catch {} |
|||
} |
|||
|
|||
const checkedIds = ref<number[]>([]) |
|||
const handleRowCheckboxChange = (records: RecordAudio[]) => { |
|||
checkedIds.value = records.map((item) => item.id); |
|||
} |
|||
|
|||
/** 导出按钮操作 */ |
|||
const handleExport = async () => { |
|||
try { |
|||
// 导出的二次确认 |
|||
await message.exportConfirm() |
|||
// 发起导出 |
|||
exportLoading.value = true |
|||
const data = await RecordAudioApi.exportRecordAudio(queryParams) |
|||
download.excel(data, '实时录音记录.xls') |
|||
} catch { |
|||
} finally { |
|||
exportLoading.value = false |
|||
} |
|||
} |
|||
|
|||
/** 初始化 **/ |
|||
onMounted(() => { |
|||
getList() |
|||
}) |
|||
</script> |
|||
Loading…
Reference in new issue