|
@@ -1,15 +1,20 @@
|
|
package com.usky.meeting.controller.web;
|
|
package com.usky.meeting.controller.web;
|
|
|
|
|
|
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
import com.usky.common.core.bean.ApiResult;
|
|
import com.usky.common.core.bean.ApiResult;
|
|
import com.usky.common.core.bean.CommonPage;
|
|
import com.usky.common.core.bean.CommonPage;
|
|
|
|
+import com.usky.common.security.utils.SecurityUtils;
|
|
|
|
+import com.usky.common.log.annotation.Log;
|
|
|
|
+import com.usky.common.log.enums.BusinessType;
|
|
import com.usky.meeting.domain.MeetingRoom;
|
|
import com.usky.meeting.domain.MeetingRoom;
|
|
import com.usky.meeting.repository.MeetingDeviceRepository;
|
|
import com.usky.meeting.repository.MeetingDeviceRepository;
|
|
|
|
+import com.usky.meeting.repository.MeetingRoomRepository;
|
|
import com.usky.meeting.service.MeetingRoomService;
|
|
import com.usky.meeting.service.MeetingRoomService;
|
|
import com.usky.meeting.service.dto.DmMeetingRoomDto;
|
|
import com.usky.meeting.service.dto.DmMeetingRoomDto;
|
|
import com.usky.meeting.service.vo.MeetingRoomRequestVO;
|
|
import com.usky.meeting.service.vo.MeetingRoomRequestVO;
|
|
import com.usky.meeting.service.vo.MeetingRoomReservationVO;
|
|
import com.usky.meeting.service.vo.MeetingRoomReservationVO;
|
|
-//import com.usky.transfer.RemoteTransferService;
|
|
|
|
|
|
+import com.usky.transfer.RemoteTransferService;
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.RequiredArgsConstructor;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
@@ -32,19 +37,27 @@ import java.util.Map;
|
|
public class MeetingRoomController {
|
|
public class MeetingRoomController {
|
|
@Autowired
|
|
@Autowired
|
|
private MeetingRoomService meetingRoomService;
|
|
private MeetingRoomService meetingRoomService;
|
|
-// @Autowired
|
|
|
|
-// private RemoteTransferService remoteTransferService;
|
|
|
|
-
|
|
|
|
-// /**
|
|
|
|
-// * 下发门禁开门
|
|
|
|
-// */
|
|
|
|
-// @GetMapping("/{productCode}/{deviceId}/control")
|
|
|
|
-// public ApiResult<Map<String,Object>> control(@PathVariable("productCode") String productCode,
|
|
|
|
-// @PathVariable("deviceId") String deviceId,
|
|
|
|
-// @RequestParam(value = "requestBody") String requestBody){
|
|
|
|
-// String topic = "/"+productCode+"/"+deviceId+"/control";
|
|
|
|
-// return ApiResult.success(remoteTransferService.deviceControl(topic,requestBody));
|
|
|
|
-// }
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private RemoteTransferService remoteTransferService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private MeetingRoomRepository dmMeetingRoomRepository;
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 下发门禁开门
|
|
|
|
+ */
|
|
|
|
+ @GetMapping("/{productCode}/{deviceId}/control")
|
|
|
|
+ public ApiResult<Map<String,Object>> control(@PathVariable("productCode") String productCode,
|
|
|
|
+ @PathVariable("deviceId") String deviceId,
|
|
|
|
+ @RequestParam(value = "commandStr") String commandStr,
|
|
|
|
+ @RequestParam(value = "domain",required = false) String domain){
|
|
|
|
+ Integer tenantId;
|
|
|
|
+ if(StringUtils.isNotBlank(domain)){
|
|
|
|
+ tenantId = dmMeetingRoomRepository.getTenantIdByDomain(domain);
|
|
|
|
+ }else{
|
|
|
|
+ tenantId = SecurityUtils.getTenantId();
|
|
|
|
+ }
|
|
|
|
+ return ApiResult.success(remoteTransferService.deviceControl(productCode,deviceId,commandStr,tenantId));
|
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
/**
|
|
* 首页统计
|
|
* 首页统计
|
|
@@ -82,6 +95,7 @@ public class MeetingRoomController {
|
|
* @param meetingRoom
|
|
* @param meetingRoom
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
|
|
+ @Log(title = "新增-会议室", businessType = BusinessType.INSERT)
|
|
@PostMapping
|
|
@PostMapping
|
|
public ApiResult<Void> add(@RequestBody MeetingRoom meetingRoom){
|
|
public ApiResult<Void> add(@RequestBody MeetingRoom meetingRoom){
|
|
meetingRoomService.add(meetingRoom);
|
|
meetingRoomService.add(meetingRoom);
|
|
@@ -93,6 +107,7 @@ public class MeetingRoomController {
|
|
* @param meetingRoom
|
|
* @param meetingRoom
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
|
|
+ @Log(title = "修改-会议室", businessType = BusinessType.UPDATE)
|
|
@PutMapping
|
|
@PutMapping
|
|
public ApiResult<Void> edit(@RequestBody MeetingRoom meetingRoom){
|
|
public ApiResult<Void> edit(@RequestBody MeetingRoom meetingRoom){
|
|
meetingRoomService.edit(meetingRoom);
|
|
meetingRoomService.edit(meetingRoom);
|
|
@@ -104,6 +119,7 @@ public class MeetingRoomController {
|
|
* @param roomId
|
|
* @param roomId
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
|
|
+ @Log(title = "删除-会议室", businessType = BusinessType.DELETE)
|
|
@DeleteMapping
|
|
@DeleteMapping
|
|
public ApiResult<Void> remove(@RequestParam Long roomId){
|
|
public ApiResult<Void> remove(@RequestParam Long roomId){
|
|
meetingRoomService.remove(roomId);
|
|
meetingRoomService.remove(roomId);
|
|
@@ -118,8 +134,11 @@ public class MeetingRoomController {
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@GetMapping("attendee")
|
|
@GetMapping("attendee")
|
|
- public ApiResult<Map<String,Object>> attendee(Long meetingId, Long userId, String userName){
|
|
|
|
- return ApiResult.success(meetingRoomService.attendee(meetingId,userId,userName));
|
|
|
|
|
|
+ public ApiResult<Map<String,Object>> attendee(@RequestParam(value = "meetingId") Long meetingId,
|
|
|
|
+ @RequestParam(value = "userId") Long userId,
|
|
|
|
+ @RequestParam(value = "userName") String userName,
|
|
|
|
+ @RequestParam(value = "domain",required = false) String domain){
|
|
|
|
+ return ApiResult.success(meetingRoomService.attendee(meetingId,userId,userName,domain));
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|