小程序聊天查询
This commit is contained in:
@@ -92,27 +92,17 @@ public class WorkcaseChatContorller {
|
||||
@Operation(summary = "关闭聊天室")
|
||||
@PreAuthorize("hasAuthority('workcase:room:close')")
|
||||
@PostMapping("/room/{roomId}/close")
|
||||
public ResultDomain<Boolean> closeChatRoom(@PathVariable String roomId, @RequestParam String closedBy) {
|
||||
public ResultDomain<Boolean> closeChatRoom(@PathVariable(value = "roomId") String roomId, @RequestParam String closedBy) {
|
||||
return chatRoomService.closeChatRoom(roomId, closedBy);
|
||||
}
|
||||
|
||||
@Operation(summary = "获取聊天室详情")
|
||||
@PreAuthorize("hasAuthority('workcase:room:view')")
|
||||
@GetMapping("/room/{roomId}")
|
||||
public ResultDomain<TbChatRoomDTO> getChatRoomById(@PathVariable String roomId) {
|
||||
public ResultDomain<TbChatRoomDTO> getChatRoomById(@PathVariable(value = "roomId") String roomId) {
|
||||
return chatRoomService.getChatRoomById(roomId);
|
||||
}
|
||||
|
||||
@Operation(summary = "绑定工单到聊天室")
|
||||
@PreAuthorize("hasAuthority('workcase:room:update')")
|
||||
@PostMapping("/room/{roomId}/bind-workcase")
|
||||
public ResultDomain<TbChatRoomDTO> bindWorkcaseToRoom(@PathVariable String roomId, @RequestParam String workcaseId) {
|
||||
TbChatRoomDTO chatRoom = new TbChatRoomDTO();
|
||||
chatRoom.setRoomId(roomId);
|
||||
chatRoom.setWorkcaseId(workcaseId);
|
||||
return chatRoomService.updateChatRoom(chatRoom);
|
||||
}
|
||||
|
||||
@Operation(summary = "分页查询聊天室")
|
||||
@PreAuthorize("hasAuthority('workcase:room:view')")
|
||||
@PostMapping("/room/page")
|
||||
@@ -146,14 +136,14 @@ public class WorkcaseChatContorller {
|
||||
@Operation(summary = "移除聊天室成员")
|
||||
@PreAuthorize("hasAuthority('workcase:room:member')")
|
||||
@DeleteMapping("/room/member/{memberId}")
|
||||
public ResultDomain<Boolean> removeChatRoomMember(@PathVariable String memberId) {
|
||||
public ResultDomain<Boolean> removeChatRoomMember(@PathVariable(value = "memberId") String memberId) {
|
||||
return chatRoomService.removeChatRoomMember(memberId);
|
||||
}
|
||||
|
||||
@Operation(summary = "获取聊天室成员列表")
|
||||
@PreAuthorize("hasAuthority('workcase:room:member')")
|
||||
@GetMapping("/room/{roomId}/members")
|
||||
public ResultDomain<ChatMemberVO> getChatRoomMemberList(@PathVariable String roomId) {
|
||||
public ResultDomain<ChatMemberVO> getChatRoomMemberList(@PathVariable(value = "roomId") String roomId) {
|
||||
return chatRoomService.getChatRoomMemberList(roomId);
|
||||
}
|
||||
|
||||
@@ -191,7 +181,7 @@ public class WorkcaseChatContorller {
|
||||
@Operation(summary = "删除聊天室消息")
|
||||
@PreAuthorize("hasAuthority('workcase:room:message')")
|
||||
@DeleteMapping("/room/message/{messageId}")
|
||||
public ResultDomain<Boolean> deleteRoomMessage(@PathVariable String messageId) {
|
||||
public ResultDomain<Boolean> deleteRoomMessage(@PathVariable(value = "messageId") String messageId) {
|
||||
return chatRoomService.deleteMessage(messageId);
|
||||
}
|
||||
|
||||
@@ -223,7 +213,7 @@ public class WorkcaseChatContorller {
|
||||
|
||||
@Operation(summary = "删除客服人员")
|
||||
@DeleteMapping("/customer-service/{userId}")
|
||||
public ResultDomain<Boolean> deleteCustomerService(@PathVariable String userId) {
|
||||
public ResultDomain<Boolean> deleteCustomerService(@PathVariable(value = "userId") String userId) {
|
||||
return chatRoomService.deleteCustomerService(userId);
|
||||
}
|
||||
|
||||
@@ -241,8 +231,8 @@ public class WorkcaseChatContorller {
|
||||
}
|
||||
|
||||
@Operation(summary = "更新客服在线状态")
|
||||
@PostMapping("/customer-service/{userId}/status")
|
||||
public ResultDomain<Boolean> updateCustomerServiceStatus(@PathVariable String userId, @RequestParam String status) {
|
||||
@PostMapping("/customer-service/{userId}/status/{status}")
|
||||
public ResultDomain<Boolean> updateCustomerServiceStatus(@PathVariable(value = "userId") String userId, @PathVariable(value = "status") String status) {
|
||||
return chatRoomService.updateCustomerServiceStatus(userId, status);
|
||||
}
|
||||
|
||||
@@ -254,7 +244,7 @@ public class WorkcaseChatContorller {
|
||||
|
||||
@Operation(summary = "自动分配客服")
|
||||
@PostMapping("/room/{roomId}/assign")
|
||||
public ResultDomain<CustomerServiceVO> assignCustomerService(@PathVariable String roomId) {
|
||||
public ResultDomain<CustomerServiceVO> assignCustomerService(@PathVariable(value = "roomId") String roomId) {
|
||||
return chatRoomService.assignCustomerService(roomId);
|
||||
}
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ public class WorkcaseController {
|
||||
@Operation(summary = "删除工单")
|
||||
@PreAuthorize("hasAuthority('workcase:ticket:update')")
|
||||
@DeleteMapping("/{workcaseId}")
|
||||
public ResultDomain<TbWorkcaseDTO> deleteWorkcase(@PathVariable String workcaseId) {
|
||||
public ResultDomain<TbWorkcaseDTO> deleteWorkcase(@PathVariable(value = "workcaseId") String workcaseId) {
|
||||
TbWorkcaseDTO workcase = new TbWorkcaseDTO();
|
||||
workcase.setWorkcaseId(workcaseId);
|
||||
return workcaseService.deleteWorkcase(workcase);
|
||||
@@ -81,7 +81,7 @@ public class WorkcaseController {
|
||||
@Operation(summary = "获取工单详情")
|
||||
@PreAuthorize("hasAuthority('workcase:ticket:view')")
|
||||
@GetMapping("/{workcaseId}")
|
||||
public ResultDomain<TbWorkcaseDTO> getWorkcaseById(@PathVariable String workcaseId) {
|
||||
public ResultDomain<TbWorkcaseDTO> getWorkcaseById(@PathVariable(value = "workcaseId") String workcaseId) {
|
||||
return workcaseService.getWorkcaseById(workcaseId);
|
||||
}
|
||||
|
||||
@@ -159,7 +159,7 @@ public class WorkcaseController {
|
||||
@Operation(summary = "删除工单处理过程")
|
||||
@PreAuthorize("hasAuthority('workcase:ticket:process')")
|
||||
@DeleteMapping("/process/{processId}")
|
||||
public ResultDomain<TbWorkcaseProcessDTO> deleteWorkcaseProcess(@PathVariable String processId) {
|
||||
public ResultDomain<TbWorkcaseProcessDTO> deleteWorkcaseProcess(@PathVariable(value = "processId") String processId) {
|
||||
TbWorkcaseProcessDTO process = new TbWorkcaseProcessDTO();
|
||||
process.setProcessId(processId);
|
||||
return workcaseService.deleteWorkcaseProcess(process);
|
||||
@@ -219,7 +219,7 @@ public class WorkcaseController {
|
||||
@Operation(summary = "删除工单设备")
|
||||
@PreAuthorize("hasAuthority('workcase:ticket:device')")
|
||||
@DeleteMapping("/device/{workcaseId}/{device}")
|
||||
public ResultDomain<TbWorkcaseDeviceDTO> deleteWorkcaseDevice(@PathVariable String workcaseId, @PathVariable String device) {
|
||||
public ResultDomain<TbWorkcaseDeviceDTO> deleteWorkcaseDevice(@PathVariable(value = "workcaseId") String workcaseId, @PathVariable(value = "device") String device) {
|
||||
TbWorkcaseDeviceDTO deviceDTO = new TbWorkcaseDeviceDTO();
|
||||
deviceDTO.setWorkcaseId(workcaseId);
|
||||
deviceDTO.setDevice(device);
|
||||
|
||||
@@ -558,14 +558,7 @@ public class ChatRoomServiceImpl implements ChatRoomService {
|
||||
filter.setStatus("online");
|
||||
List<CustomerServiceVO> list = customerServiceMapper.selectCustomerServiceList(filter);
|
||||
|
||||
// 过滤工作量未满的客服
|
||||
List<CustomerServiceVO> availableList = list.stream()
|
||||
.filter(cs -> cs.getCurrentWorkload() == null ||
|
||||
cs.getMaxConcurrent() == null ||
|
||||
cs.getCurrentWorkload() < cs.getMaxConcurrent())
|
||||
.toList();
|
||||
|
||||
return ResultDomain.success("查询成功", availableList);
|
||||
return ResultDomain.success("查询成功", list);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user