mirror of
https://gitee.com/elegant_wings/dbd-meeting.git
synced 2025-06-21 05:39:36 +08:00
修改了小程序的接口,新增了设备开门的功能
This commit is contained in:
parent
52d615d5a9
commit
5ea57ed52d
@ -154,4 +154,7 @@ public class Reservation extends BaseEntity<Reservation> {
|
||||
@TableField(exist = false)
|
||||
private RoomContent roomContent;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Long equipmentId;
|
||||
|
||||
}
|
||||
|
@ -98,4 +98,12 @@ public class RoomEquipmentServiceImpl extends ServiceImpl<RoomEquipmentMapper, R
|
||||
wrapper.eq("equipment_id",id);
|
||||
return roomEquipmentMapper.selectOne(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RoomEquipment selectRoomId(Long roomId) {
|
||||
|
||||
QueryWrapper<RoomEquipment> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("room_id",roomId);
|
||||
return roomEquipmentMapper.selectOne(wrapper);
|
||||
}
|
||||
}
|
||||
|
@ -49,6 +49,9 @@ public class RoomContentServiceImpl extends ServiceImpl<RoomContentMapper, RoomC
|
||||
@Autowired
|
||||
private IRoomService roomService;
|
||||
|
||||
@Autowired
|
||||
private IRoomEquipmentService roomEquipmentService;
|
||||
|
||||
@Autowired
|
||||
private IBuildingDetailService buildingDetailService;
|
||||
|
||||
@ -383,12 +386,15 @@ public class RoomContentServiceImpl extends ServiceImpl<RoomContentMapper, RoomC
|
||||
@Override
|
||||
public List<Reservation> todayMeeting(RoomContent roomContent) {
|
||||
|
||||
|
||||
//查询当前之前以后,当前时间是否包含在会议室
|
||||
List<Reservation> reservations = reservationMapper.todayMeeting(roomContent.getId());
|
||||
for (Reservation reservation : reservations) {
|
||||
Long userId = reservation.getUserId();
|
||||
IcsCustomerStaff customerStaff = staffService.selectIcsCustomerStaffById(userId);
|
||||
reservation.setUserName(customerStaff.getUsername());
|
||||
|
||||
|
||||
}
|
||||
return reservations;
|
||||
}
|
||||
|
@ -60,4 +60,6 @@ public interface IRoomEquipmentService extends IService<RoomEquipment> {
|
||||
int deleteRoomEquipmentById(Long id);
|
||||
|
||||
RoomEquipment selectByEquipmentId(Long id);
|
||||
|
||||
RoomEquipment selectRoomId(Long roomId);
|
||||
}
|
||||
|
@ -10,8 +10,8 @@ import java.util.Map;
|
||||
|
||||
public class SmallWxOkHttp {
|
||||
|
||||
static String APP_ID = "wxd9f93ef41a607dd5";
|
||||
static String SECRET = "417507767334672bc46bb6eb3bf1c29b";
|
||||
static String APP_ID = "wx5582a07c1fbbcf06";
|
||||
static String SECRET = "ad24130a8919c613efd9538f69abafd3";
|
||||
|
||||
public static JSONObject sendGet(String url , Map<String, String> map){
|
||||
OkHttpClient client = new OkHttpClient();
|
||||
|
@ -107,7 +107,7 @@ public class ApiEquipmentController extends BaseController {
|
||||
* 扫描二维码开门 用户id 和设备id
|
||||
*/
|
||||
@RequiresPermissions("member:center:view")
|
||||
@PostMapping("/scanOpenDoor")
|
||||
@GetMapping("/scanOpenDoor")
|
||||
public R scanOpenDoor( RoomRecord roomRecord){
|
||||
|
||||
// long currentUserId = getCurrentUserId();
|
||||
|
@ -68,7 +68,7 @@ public class ApiRoomController extends BaseController {
|
||||
private IParkService parkService;
|
||||
|
||||
@Autowired
|
||||
private RoomEquipmentMapper roomEquipmentMapper;
|
||||
private IRoomEquipmentService roomEquipmentService;
|
||||
|
||||
|
||||
/**
|
||||
@ -78,7 +78,13 @@ public class ApiRoomController extends BaseController {
|
||||
@PostMapping("list")
|
||||
public R list() {
|
||||
List<RoomContent> roomContents = roomContentService.selectApiRoomList(new RoomContent());
|
||||
for (RoomContent roomContent : roomContents) {
|
||||
RoomEquipment roomEquipment = roomEquipmentService.selectRoomId(roomContent.getRoomId());
|
||||
if (null != roomEquipment){
|
||||
roomContent.setEquipmentId(roomEquipment.getEquipmentId());
|
||||
}
|
||||
|
||||
}
|
||||
return R.data(roomContents);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user