mirror of
https://gitee.com/elegant_wings/xiongan-meeting.git
synced 2025-06-21 04:59:36 +08:00
新增智能设备对应需求
This commit is contained in:
parent
d0107d5b1a
commit
4363ab3c5a
@ -76,4 +76,6 @@ public interface IWisdomStaffService extends IService<WisdomStaff> {
|
||||
List<IcsCustomerStaff> selectListByReservationId(Long id);
|
||||
|
||||
Integer selectListByReservationIdAndUserId(Long reservationId, Long participantId);
|
||||
|
||||
Integer deleteWisdomStaffByReservationId(Long id);
|
||||
}
|
||||
|
@ -177,4 +177,11 @@ public class WisdomStaffServiceImpl extends ServiceImpl<WisdomStaffMapper, Wisdo
|
||||
return wisdomStaffMapper.selectCount(wrapper);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer deleteWisdomStaffByReservationId(Long id) {
|
||||
QueryWrapper<WisdomStaff> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("reservation_id",id);
|
||||
return wisdomStaffMapper.delete(wrapper);
|
||||
}
|
||||
}
|
||||
|
@ -761,6 +761,52 @@ public class ApiRoomContentController extends BaseController {
|
||||
|
||||
}
|
||||
|
||||
@RequiresPermissions("member:center:view")
|
||||
@PostMapping("updatePersonList")
|
||||
public R updatePersonList(@RequestBody Reservation reservation) {
|
||||
|
||||
List<IcsCustomerStaff> customerStaffs = wisdomStaffService.selectListByReservationId(reservation.getId());
|
||||
if(CollUtil.isNotEmpty(customerStaffs)) {
|
||||
Integer integer = wisdomStaffService.deleteWisdomStaffByReservationId(reservation.getId());
|
||||
if (integer == 0) return R.error("删除失败");
|
||||
}
|
||||
|
||||
|
||||
//新增预约人 门锁权限
|
||||
WisdomStaff wisdomStaff = new WisdomStaff();
|
||||
if (reservation.getRoomContentId() == 52L) wisdomStaff.setWisdomRoomId(3L);
|
||||
if (reservation.getRoomContentId() == 53L) wisdomStaff.setWisdomRoomId(4L);
|
||||
if (reservation.getRoomContentId() == 54L) wisdomStaff.setWisdomRoomId(6L);
|
||||
wisdomStaff.setStaffId(reservation.getUserId());
|
||||
wisdomStaff.setStartTime(reservation.getStartTime());
|
||||
wisdomStaff.setEndDate(reservation.getEndDate());
|
||||
wisdomStaff.setReservationId(reservation.getId());
|
||||
wisdomStaff.setDataType("1");
|
||||
|
||||
int i = wisdomStaffService.insertWisdomStaff(wisdomStaff);
|
||||
|
||||
List<ReservationPerson> reservationPerson = reservation.getReservationPersonList();
|
||||
|
||||
for (ReservationPerson person : reservationPerson) {
|
||||
int count = wisdomStaffService.selectListByReservationIdAndUserId(reservation.getId(),person.getUserId() );
|
||||
if (count ==0){
|
||||
//新增预约人 门锁权限
|
||||
WisdomStaff wisdomStaff1 = new WisdomStaff();
|
||||
if (reservation.getRoomContentId() == 52L) wisdomStaff1.setWisdomRoomId(3L);
|
||||
if (reservation.getRoomContentId() == 53L) wisdomStaff1.setWisdomRoomId(4L);
|
||||
if (reservation.getRoomContentId() == 54L) wisdomStaff1.setWisdomRoomId(6L);
|
||||
wisdomStaff1.setStaffId(person.getUserId());
|
||||
wisdomStaff1.setStartTime(reservation.getStartTime());
|
||||
wisdomStaff1.setEndDate(reservation.getEndDate());
|
||||
wisdomStaff1.setReservationId(reservation.getId());
|
||||
wisdomStaff1.setDataType("1");
|
||||
|
||||
int num = wisdomStaffService.insertWisdomStaff(wisdomStaff1);
|
||||
}
|
||||
}
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
public static boolean timeIsInRound(String str1, String start, String end) {
|
||||
SimpleDateFormat df = new SimpleDateFormat("HH:mm:ss");
|
||||
|
Loading…
x
Reference in New Issue
Block a user