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
c9a969ddbd
commit
812b3ec3a8
@ -183,15 +183,15 @@ public class CustomerStaffController extends BaseController {
|
||||
}
|
||||
if (CollUtil.isNotEmpty(ids)) {
|
||||
for (Long id : ids) {
|
||||
UserEquipment equipment = userEquipmentService.selectUserAndEquipment(Long.valueOf(icsCustomerStaff.getMobile()), id);
|
||||
if (null == equipment) {
|
||||
// UserEquipment equipment = userEquipmentService.selectUserAndEquipment(Long.valueOf(icsCustomerStaff.getMobile()), id);
|
||||
// if (null == equipment) {
|
||||
UserEquipment userEquipment = new UserEquipment();
|
||||
userEquipment.setEquipmentId(id);
|
||||
userEquipment.setUserId(Long.valueOf(icsCustomerStaff.getMobile()));
|
||||
userEquipment.setStartTime(customer.getStartDate());
|
||||
userEquipment.setEndDate(customer.getEndDate());
|
||||
userEquipmentService.insertUserEquipment(userEquipment);
|
||||
}
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,8 @@
|
||||
package com.ics.admin.controller.meeting;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.ics.admin.domain.BuildingDetail;
|
||||
import com.ics.admin.domain.Customer;
|
||||
import com.ics.admin.domain.Room;
|
||||
@ -64,6 +66,15 @@ public class EquipmentController extends BaseController {
|
||||
@Autowired
|
||||
private IDetailEquipmentService detailEquipmentService;
|
||||
|
||||
@Autowired
|
||||
private IRoomContentService roomContentService;
|
||||
|
||||
@Autowired
|
||||
private IReservationService reservationService;
|
||||
|
||||
@Autowired
|
||||
private IReservationPersonService reservationPersonService;
|
||||
|
||||
/**
|
||||
* 查询设备
|
||||
*/
|
||||
@ -90,13 +101,13 @@ public class EquipmentController extends BaseController {
|
||||
List<Equipment> equipment1 = equipmentService.selectEquipmentList(equipment);
|
||||
for (Equipment equipment2 : equipment1) {
|
||||
RoomEquipment roomEquipment = roomEquipmentService.selectByEquipmentId(equipment2.getId());
|
||||
if (roomEquipment != null){
|
||||
if (roomEquipment != null) {
|
||||
Room room = roomService.selectRoomById(roomEquipment.getRoomId());
|
||||
equipment2.setRoomId(room.getId());
|
||||
equipment2.setBuildId(room.getBuildingDetailId());
|
||||
equipment2.setRoomName(room.getName());
|
||||
BuildingDetail buildingDetail = buildingDetailService.selectBuildingDetailById(room.getBuildingDetailId());
|
||||
if (buildingDetail != null){
|
||||
if (buildingDetail != null) {
|
||||
equipment2.setBuildName(buildingDetail.getFloorName());
|
||||
}
|
||||
}
|
||||
@ -117,27 +128,37 @@ public class EquipmentController extends BaseController {
|
||||
public R addSave(@RequestBody Equipment equipment) {
|
||||
int i = equipmentService.insertEquipment(equipment);
|
||||
Assert.isTrue(i > 0, "添加失败");
|
||||
|
||||
|
||||
|
||||
if (equipment.getRoomId() != null){
|
||||
if (equipment.getRoomId() != null) {
|
||||
RoomEquipment roomEquipment = new RoomEquipment();
|
||||
roomEquipment.setEquipmentId(equipment.getId());
|
||||
roomEquipment.setRoomId(equipment.getRoomId());
|
||||
int i1 = roomEquipmentService.insertRoomEquipment(roomEquipment);
|
||||
Assert.isTrue(i1 > 0, "添加失败");
|
||||
}else {
|
||||
//给用户添加权限,先去查询 这个房间是否已经绑定企业
|
||||
Room room = roomService.selectRoomById(equipment.getRoomId());
|
||||
addPersonDeviceByCustomer(room,equipment.getId());
|
||||
addPersonDeviceByRoomContent(room,equipment.getId());
|
||||
} else {
|
||||
DetailEquipment detailEquipment = new DetailEquipment();
|
||||
detailEquipment.setEquipmentId(equipment.getId());
|
||||
detailEquipment.setBuildingDetailId(equipment.getBuildId());
|
||||
int i1 = detailEquipmentService.insertDetailEquipment(detailEquipment);
|
||||
Assert.isTrue(i1 > 0, "添加失败");
|
||||
//查询所有的房间
|
||||
List<Room> rooms = roomService.selectRoomByBuildId(equipment.getBuildId());
|
||||
for (Room room : rooms) {
|
||||
addPersonDeviceByCustomer(room,equipment.getId());
|
||||
addPersonDeviceByRoomContent(room,equipment.getId());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return toAjax(i);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 修改保存设备
|
||||
*/
|
||||
@ -145,36 +166,109 @@ public class EquipmentController extends BaseController {
|
||||
@PostMapping("update")
|
||||
public R editSave(@RequestBody Equipment equipment) {
|
||||
|
||||
if (equipment.getRoomId() != null){
|
||||
if (equipment.getRoomId() != null) {
|
||||
RoomEquipment roomEquipment = new RoomEquipment();
|
||||
roomEquipment.setEquipmentId(equipment.getId());
|
||||
roomEquipment.setRoomId(equipment.getRoomId());
|
||||
|
||||
RoomEquipment roomEquipment1 =roomEquipmentService.selectByEquipmentId(equipment.getId());
|
||||
if (null != roomEquipment1){
|
||||
|
||||
Equipment equipment1 = equipmentService.selectEquipmentById(equipment.getId());
|
||||
if (!ObjectUtil.equals(equipment1.getRoomId(),equipment.getRoomId()) ) {
|
||||
Room room = roomService.selectRoomById(equipment.getRoomId());
|
||||
addPersonDeviceByCustomer(room,equipment.getId());
|
||||
addPersonDeviceByRoomContent(room,equipment.getId());
|
||||
}
|
||||
|
||||
RoomEquipment roomEquipment1 = roomEquipmentService.selectByEquipmentId(equipment.getId());
|
||||
if (null != roomEquipment1) {
|
||||
roomEquipment1.setRoomId(equipment.getRoomId());
|
||||
int i1 = roomEquipmentService.updateRoomEquipment(roomEquipment1);
|
||||
Assert.isTrue(i1 > 0, "修改失败");
|
||||
}
|
||||
}else {
|
||||
|
||||
|
||||
|
||||
} else {
|
||||
Equipment equipment1 = equipmentService.selectEquipmentById(equipment.getId());
|
||||
if (!ObjectUtil.equals(equipment1.getBuildId(),equipment.getBuildId()) ) {
|
||||
List<Room> rooms = roomService.selectRoomByBuildId(equipment.getBuildId());
|
||||
for (Room room : rooms) {
|
||||
addPersonDeviceByCustomer(room,equipment.getId());
|
||||
addPersonDeviceByRoomContent(room,equipment.getId());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
DetailEquipment detailEquipment = new DetailEquipment();
|
||||
detailEquipment.setEquipmentId(equipment.getId());
|
||||
detailEquipment.setBuildingDetailId(equipment.getBuildId());
|
||||
DetailEquipment detailEquipment1 = detailEquipmentService.selectByEquipmentId(equipment.getId());
|
||||
if (null != detailEquipment1){
|
||||
if (null != detailEquipment1) {
|
||||
detailEquipment1.setBuildingDetailId(equipment.getBuildId());
|
||||
int i1 = detailEquipmentService.insertDetailEquipment(detailEquipment1);
|
||||
Assert.isTrue(i1 > 0, "修改失败");
|
||||
}
|
||||
|
||||
}
|
||||
// RoomEquipment roomEquipment = new RoomEquipment();
|
||||
// roomEquipment.setEquipmentId(equipment.getId());
|
||||
// roomEquipment.setRoomId(equipment.getRoomId());
|
||||
// roomEquipmentService.updateRoomEquipment(roomEquipment);
|
||||
|
||||
return toAjax(equipmentService.updateEquipment(equipment));
|
||||
}
|
||||
|
||||
|
||||
//根据企业id新增用户设备
|
||||
public void addPersonDeviceByCustomer(Room room,Long deviceId) {
|
||||
if (room != null) {
|
||||
Customer customer = customerService.selectByRoomId(room.getId());
|
||||
if (customer != null) {
|
||||
List<IcsCustomerStaff> icsCustomerStaffs = staffService.selectUserByCustomer(customer.getId());
|
||||
if (CollUtil.isNotEmpty(icsCustomerStaffs)) {
|
||||
List<Long> ids = icsCustomerStaffs.stream().map(item -> {
|
||||
return item.getId();
|
||||
}).collect(Collectors.toList());
|
||||
for (Long id : ids) {
|
||||
UserEquipment userEquipment = new UserEquipment();
|
||||
userEquipment.setEquipmentId(deviceId);
|
||||
userEquipment.setUserId(id);
|
||||
userEquipment.setStartTime(customer.getStartDate());
|
||||
userEquipment.setEndDate(customer.getEndDate());
|
||||
userEquipmentService.insertUserEquipment(userEquipment);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//根据会议室新增用户设备
|
||||
public void addPersonDeviceByRoomContent(Room room,Long deviceId){
|
||||
//先查出会议室的房间号
|
||||
RoomContent roomContent = roomContentService.selectByRoomId(room.getId());
|
||||
if (roomContent != null){
|
||||
//查询会议室的预约情况
|
||||
List<Reservation> reservations =reservationService.selectByRoomContent(roomContent);
|
||||
if (CollUtil.isNotEmpty(reservations)){
|
||||
for (Reservation reservation : reservations) {
|
||||
List<ReservationPerson> reservations1 = reservationPersonService.selectListByReservationId(reservation.getId());
|
||||
for (ReservationPerson reservationPerson : reservations1) {
|
||||
UserEquipment userEquipment = new UserEquipment();
|
||||
userEquipment.setEquipmentId(deviceId);
|
||||
userEquipment.setUserId(reservationPerson.getUserId());
|
||||
userEquipment.setStartTime(reservation.getStartTime());
|
||||
userEquipment.setEndDate(reservation.getEndDate());
|
||||
userEquipmentService.insertUserEquipment(userEquipment);
|
||||
|
||||
UserEquipment userEquipment1 = new UserEquipment();
|
||||
userEquipment1.setEquipmentId(deviceId);
|
||||
userEquipment1.setUserId(reservationPerson.getParticipantId());
|
||||
userEquipment1.setStartTime(reservation.getStartTime());
|
||||
userEquipment1.setEndDate(reservation.getEndDate());
|
||||
userEquipmentService.insertUserEquipment(userEquipment1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 删除设备
|
||||
*/
|
||||
@ -196,12 +290,12 @@ public class EquipmentController extends BaseController {
|
||||
List<RoomRecord> roomRecords = roomRecordService.selectRoomRecordList(record);
|
||||
for (RoomRecord roomRecord : roomRecords) {
|
||||
IcsCustomerStaff customerStaff = staffService.selectIcsCustomerStaffById(roomRecord.getUserId());
|
||||
if (null != customerStaff){
|
||||
if (null != customerStaff) {
|
||||
roomRecord.setUserName(customerStaff.getUsername());
|
||||
}
|
||||
if (roomRecord.getType().equals("1")){
|
||||
if (roomRecord.getType().equals("1")) {
|
||||
roomRecord.setType("扫码开门");
|
||||
}else {
|
||||
} else {
|
||||
roomRecord.setType("远程开门");
|
||||
}
|
||||
}
|
||||
@ -220,8 +314,8 @@ public class EquipmentController extends BaseController {
|
||||
List<IcsCustomerStaff> icsCustomerStaffs = staffService.selectIcsCustomerStaffList(customerStaff);
|
||||
for (IcsCustomerStaff icsCustomerStaff : icsCustomerStaffs) {
|
||||
Customer customer = customerService.selectCustomerById(icsCustomerStaff.getIcsCustomerId());
|
||||
if (null != customer){
|
||||
icsCustomerStaff.setCustomerName(customer.getName());
|
||||
if (null != customer) {
|
||||
icsCustomerStaff.setCustomerName(customer.getName());
|
||||
}
|
||||
}
|
||||
return R.data(icsCustomerStaffs);
|
||||
@ -245,7 +339,7 @@ public class EquipmentController extends BaseController {
|
||||
List<IcsCustomerStaff> icsCustomerStaffs = staffService.selectListByUserIds(userIds);
|
||||
for (IcsCustomerStaff icsCustomerStaff : icsCustomerStaffs) {
|
||||
Customer customer = customerService.selectCustomerById(icsCustomerStaff.getIcsCustomerId());
|
||||
if (null != customer){
|
||||
if (null != customer) {
|
||||
icsCustomerStaff.setCustomerName(customer.getName());
|
||||
}
|
||||
}
|
||||
@ -260,9 +354,9 @@ public class EquipmentController extends BaseController {
|
||||
@PostMapping("saveDevice")
|
||||
public R saveDevice(@RequestBody UserEquipment userEquipment) {
|
||||
|
||||
if (userEquipment.getId() !=null ){
|
||||
if (userEquipment.getId() != null) {
|
||||
int count = userEquipmentService.deleteUserEquipmentByEquipmentId(userEquipment.getId());
|
||||
Assert.isTrue(count>0 , "删除失败");
|
||||
Assert.isTrue(count > 0, "删除失败");
|
||||
}
|
||||
|
||||
for (Long id : userEquipment.getUserIds()) {
|
||||
@ -271,7 +365,7 @@ public class EquipmentController extends BaseController {
|
||||
userEquipment1.setUserId(id);
|
||||
int i = userEquipmentService.insertUserEquipment(userEquipment1);
|
||||
|
||||
Assert.isTrue(i>0 , "添加失败");
|
||||
Assert.isTrue(i > 0, "添加失败");
|
||||
|
||||
}
|
||||
return R.data(userEquipment);
|
||||
@ -282,7 +376,7 @@ public class EquipmentController extends BaseController {
|
||||
public R list(Room room) {
|
||||
room.setDeleteFlag(0);
|
||||
room.setBuildingDetailId(room.getBuildingDetailId());
|
||||
return R.ok().put("data",roomService.selectRoomList(room));
|
||||
return R.ok().put("data", roomService.selectRoomList(room));
|
||||
}
|
||||
|
||||
|
||||
|
@ -415,6 +415,7 @@ public class Customer extends BaseEntity<Customer> {
|
||||
/**
|
||||
* 关联园区
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private Park park;
|
||||
|
||||
@TableField(exist = false)
|
||||
|
@ -59,4 +59,6 @@ public interface ICustomerService extends IService<Customer> {
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteCustomerById(Long id);
|
||||
|
||||
Customer selectByRoomId(Long id);
|
||||
}
|
@ -75,4 +75,6 @@ public interface IRoomService extends IService<Room> {
|
||||
* @return
|
||||
*/
|
||||
List<Room> selectNotRentRooms(Long deptId);
|
||||
|
||||
List<Room> selectRoomByBuildId(Long buildId);
|
||||
}
|
@ -2,6 +2,7 @@ package com.ics.admin.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.ics.admin.domain.Customer;
|
||||
import com.ics.admin.mapper.CustomerMapper;
|
||||
@ -89,4 +90,13 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> i
|
||||
public int deleteCustomerById(Long id) {
|
||||
return customerMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Customer selectByRoomId(Long id) {
|
||||
|
||||
QueryWrapper<Customer> queryWrapper =new QueryWrapper<>();
|
||||
queryWrapper.eq("room_id",id);
|
||||
return customerMapper.selectOne(queryWrapper);
|
||||
|
||||
}
|
||||
}
|
@ -119,5 +119,14 @@ public class RoomServiceImpl extends ServiceImpl<RoomMapper, Room> implements IR
|
||||
return roomMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Room> selectRoomByBuildId(Long buildId) {
|
||||
QueryWrapper queryWrapper = new QueryWrapper();
|
||||
queryWrapper.eq("status", Room.Status.YES.getValue());
|
||||
queryWrapper.eq("building_detail_Id", buildId);
|
||||
return roomMapper.selectList(queryWrapper);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -1,6 +1,7 @@
|
||||
package com.ics.admin.service.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
@ -10,6 +11,7 @@ import java.util.stream.Collectors;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
@ -88,8 +90,8 @@ public class UserEquipmentServiceImpl extends ServiceImpl<UserEquipmentMapper, U
|
||||
@Override
|
||||
public List<UserEquipment> selectUserEquipmentList(UserEquipment userEquipment) {
|
||||
QueryWrapper queryWrapper = new QueryWrapper();
|
||||
queryWrapper.eq("equipment_id",userEquipment.getEquipmentId());
|
||||
queryWrapper.eq("user_id",userEquipment.getUserId());
|
||||
queryWrapper.eq(null != userEquipment.getEquipmentId(),"equipment_id",userEquipment.getEquipmentId());
|
||||
queryWrapper.eq(null != userEquipment.getUserId(),"user_id",userEquipment.getUserId());
|
||||
return userEquipmentMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
||||
@ -142,7 +144,7 @@ public class UserEquipmentServiceImpl extends ServiceImpl<UserEquipmentMapper, U
|
||||
public List<UserEquipment> getEquipmentByUserId(Long userId) {
|
||||
|
||||
|
||||
List<UserEquipment> list = baseMapper.selectList(new QueryWrapper<UserEquipment>().eq("user_id", userId));
|
||||
List<UserEquipment> list = baseMapper.selectList(new QueryWrapper<UserEquipment>().eq("user_id", userId).groupBy("equipment_id"));
|
||||
if (CollUtil.isEmpty(list)) {
|
||||
return list;
|
||||
}
|
||||
@ -193,6 +195,16 @@ public class UserEquipmentServiceImpl extends ServiceImpl<UserEquipmentMapper, U
|
||||
return userEquipmentMapper.selectOne(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int selectCountByUserIdAndDeviceId(UserEquipment userEquipment1) {
|
||||
QueryWrapper<UserEquipment> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("equipment_id", userEquipment1.getEquipmentId());
|
||||
wrapper.eq("user_id", userEquipment1.getUserId());
|
||||
wrapper.gt("end_date", DateUtil.date());
|
||||
wrapper.lt("start_time", DateUtil.date());
|
||||
return userEquipmentMapper.selectCount(wrapper);
|
||||
}
|
||||
|
||||
|
||||
public void updateDeviceDataSource(List<Equipment> equipments) {
|
||||
RequestAttributes requestAttributes = RequestContextHolder.getRequestAttributes();
|
||||
|
@ -172,10 +172,10 @@ public class ReservationPersonServiceImpl extends ServiceImpl<ReservationPersonM
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Reservation> selectListByReservationId(List<Long> collect) {
|
||||
QueryWrapper<Reservation> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.in("id",collect);
|
||||
return reservationMapper.selectList(queryWrapper);
|
||||
public List<ReservationPerson> selectListByReservationId(Long collect) {
|
||||
QueryWrapper<ReservationPerson> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("reservation_id",collect);
|
||||
return reservationPersonMapper.selectList(queryWrapper);
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -273,8 +273,13 @@ public class ReservationServiceImpl extends ServiceImpl<ReservationMapper, Reser
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public List<Reservation> selectByRoomContent(RoomContent roomContent) {
|
||||
QueryWrapper<Reservation> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("room_content_id",roomContent.getId());
|
||||
queryWrapper.gt("start_time",new Date());
|
||||
return reservationMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
|
@ -409,4 +409,12 @@ public class RoomContentServiceImpl extends ServiceImpl<RoomContentMapper, RoomC
|
||||
return reservations;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RoomContent selectByRoomId(Long id) {
|
||||
|
||||
QueryWrapper<RoomContent> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("room_id",id);
|
||||
return roomContentMapper.selectOne(queryWrapper);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -105,14 +105,14 @@ public class ShowroomRecordServiceImpl extends ServiceImpl<ShowroomRecordMapper,
|
||||
ArrayList<ShowroomRecordDTO> list = new ArrayList<>();
|
||||
|
||||
// 根据最近七天查询数据
|
||||
|
||||
showroomRecord.setShowroomId(1L);
|
||||
List<Date> dates = showroomRecordMapper.selectListByDate(showroomRecord.getShowroomId());
|
||||
for (Date dateTime : dates) {
|
||||
ShowroomRecordDTO showroomRecordDTO = new ShowroomRecordDTO();
|
||||
showroomRecordDTO.setNowDate(DateUtil.format(dateTime,"yyyy-MM-dd"));
|
||||
// 查询会议室记录
|
||||
QueryWrapper<ShowroomRecord> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("showroom_id",5L);
|
||||
wrapper.eq("showroom_id",1L);
|
||||
wrapper.gt("start_time", DateUtil.format(dateTime,"yyyy-MM-dd")+ " 00:00:00");
|
||||
wrapper.lt("end_date",DateUtil.format(dateTime,"yyyy-MM-dd") + " 23:59:59");
|
||||
List<ShowroomRecord> showroomRecords = showroomRecordMapper.selectList(wrapper);
|
||||
@ -129,7 +129,7 @@ public class ShowroomRecordServiceImpl extends ServiceImpl<ShowroomRecordMapper,
|
||||
|
||||
QueryWrapper<ShowroomRecord> queryWrapper = new QueryWrapper<>();
|
||||
|
||||
queryWrapper.eq("showroom_id",5L);
|
||||
queryWrapper.eq("showroom_id",1L);
|
||||
|
||||
Date startTime = showroomRecord.getStartTime();
|
||||
Date endDate = showroomRecord.getEndDate();
|
||||
|
@ -65,6 +65,6 @@ public interface IReservationPersonService extends IService<ReservationPerson> {
|
||||
|
||||
IPage<Reservation> selectListByParticipantId(Long userId, Integer page, Integer limit);
|
||||
|
||||
List<Reservation> selectListByReservationId(List<Long> collect);
|
||||
List<ReservationPerson> selectListByReservationId(Long reservationId);
|
||||
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ package com.ics.admin.service.meeting;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.ics.admin.domain.meeting.Reservation;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.ics.admin.domain.meeting.RoomContent;
|
||||
import com.ics.admin.domain.meeting.vo.MeetingAmountVo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
@ -72,4 +73,6 @@ public interface IReservationService extends IService<Reservation> {
|
||||
Reservation selectByOrderNumber(String outTradeNo);
|
||||
|
||||
void selectTimeByMeetingRoomTime(Reservation reservation);
|
||||
|
||||
List<Reservation> selectByRoomContent(RoomContent roomContent);
|
||||
}
|
||||
|
@ -77,4 +77,6 @@ public interface IRoomContentService extends IService<RoomContent> {
|
||||
int addItemServe(RoomItemByRoom roomItemByRoom);
|
||||
|
||||
List<Reservation> todayMeeting(RoomContent roomContent);
|
||||
|
||||
RoomContent selectByRoomId(Long id);
|
||||
}
|
||||
|
@ -64,4 +64,6 @@ public interface IUserEquipmentService extends IService<UserEquipment> {
|
||||
int deleteUserEquipmentByEquipmentId(Long id);
|
||||
|
||||
UserEquipment selectUserAndEquipment(Long userId, Long id);
|
||||
|
||||
int selectCountByUserIdAndDeviceId(UserEquipment userEquipment1);
|
||||
}
|
||||
|
41
ics-quartz/src/main/java/com/ics/quartz/task/DeviceTask.java
Normal file
41
ics-quartz/src/main/java/com/ics/quartz/task/DeviceTask.java
Normal file
@ -0,0 +1,41 @@
|
||||
package com.ics.quartz.task;
|
||||
|
||||
import cn.hutool.core.date.DateField;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.ics.admin.domain.meeting.Reservation;
|
||||
import com.ics.admin.domain.meeting.UserEquipment;
|
||||
import com.ics.admin.service.meeting.IUserEquipmentService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@Component("deviceTask")
|
||||
public class DeviceTask {
|
||||
|
||||
|
||||
@Autowired
|
||||
private IUserEquipmentService userEquipmentService;
|
||||
|
||||
// 定时删除用户与设备关联数据
|
||||
public void removeUserDevice() {
|
||||
log.info("定时删除用户与设备关联数据...");
|
||||
UserEquipment userEquipment = new UserEquipment();
|
||||
List<UserEquipment> equipments = userEquipmentService.selectUserEquipmentList(userEquipment);
|
||||
for (UserEquipment userEquipment1 : equipments) {
|
||||
Date endDate = userEquipment1.getEndDate();
|
||||
int compare = DateUtil.compare(DateUtil.date(), endDate);
|
||||
if (compare > 0) {
|
||||
userEquipmentService.deleteUserEquipmentById(userEquipment1.getId());
|
||||
log.info("删除用户与设备关联数据成功");
|
||||
log.info("定时删除用户与设备关联数据");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
package com.ics.quartz.task;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.ics.admin.domain.meeting.Reservation;
|
||||
import com.ics.admin.service.meeting.IReservationService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
@Slf4j
|
||||
@Component("meetingStatusTask")
|
||||
public class MeetingStatusTask {
|
||||
@Autowired
|
||||
private IReservationService iReservationService;
|
||||
|
||||
/**
|
||||
* 开会开始状态
|
||||
*/
|
||||
public void meetingEndStatus() {
|
||||
log.info("执行开会结束状态任务");
|
||||
Reservation reservation = new Reservation();
|
||||
|
||||
reservation.setStatusValue(2);
|
||||
List<Reservation> reservations = iReservationService.selectReservationList(reservation);
|
||||
for (Reservation reservation1 : reservations) {
|
||||
Date endDate = reservation1.getEndDate();
|
||||
int compare = DateUtil.compare(DateUtil.date(), endDate);
|
||||
if (compare > 0) {
|
||||
reservation1.setStauts(Reservation.Status.ENDED);
|
||||
iReservationService.updateReservation(reservation1);
|
||||
log.info("执行开会结束状态任务");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,65 @@
|
||||
package com.ics.quartz.task;
|
||||
|
||||
|
||||
import cn.hutool.core.date.DateField;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.ics.admin.domain.meeting.Reservation;
|
||||
import com.ics.admin.service.meeting.IReservationService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@Component("payTimeOutTask")
|
||||
public class PayTimeOutTask {
|
||||
|
||||
@Autowired
|
||||
private IReservationService iReservationService;
|
||||
|
||||
|
||||
// 支付超时处理
|
||||
public void payTimeOut() {
|
||||
log.info("执行支付超时处理任务");
|
||||
// 处理逻辑
|
||||
Reservation reservation = new Reservation();
|
||||
reservation.setStatusValue(0);
|
||||
List<Reservation> reservations = iReservationService.selectReservationList(reservation);
|
||||
for (Reservation reservation1 : reservations) {
|
||||
Date endDate = reservation1.getEndDate();
|
||||
DateUtil.offset(endDate, DateField.MINUTE, 5);
|
||||
int compare = DateUtil.compare(DateUtil.date(), endDate);
|
||||
if (compare < 0) {
|
||||
reservation1.setStauts(Reservation.Status.CANCELED);
|
||||
iReservationService.updateReservation(reservation1);
|
||||
log.info("支付超时处理任务执行成功");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 开会开始状态
|
||||
*/
|
||||
|
||||
public void meetingStartStatus() {
|
||||
log.info("执行开会开始状态任务");
|
||||
Reservation reservation = new Reservation();
|
||||
|
||||
reservation.setStatusValue(1);
|
||||
List<Reservation> reservations = iReservationService.selectReservationList(reservation);
|
||||
for (Reservation reservation1 : reservations) {
|
||||
Date startTime = reservation1.getStartTime();
|
||||
Date endDate = reservation1.getEndDate();
|
||||
boolean in = DateUtil.isIn(DateUtil.date(), startTime, endDate);
|
||||
if (in) {
|
||||
reservation1.setStauts(Reservation.Status.ONGOING);
|
||||
iReservationService.updateReservation(reservation1);
|
||||
log.info("执行开会开始状态任务");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -176,10 +176,9 @@ public class WxLoginAPIController extends BaseController {
|
||||
//检查是否是否存在
|
||||
IcsCustomerStaff icsCustomerStaff = new IcsCustomerStaff();
|
||||
icsCustomerStaff.setId(userId);
|
||||
List<IcsCustomerStaff> list = icsCustomerStaffService.selectIcsCustomerStaffList(icsCustomerStaff);
|
||||
if(list.size()>0){
|
||||
IcsCustomerStaff icsCustomerStaff1 = list.get(0);
|
||||
return R.ok().put("data",icsCustomerStaff1);
|
||||
IcsCustomerStaff customerStaff = icsCustomerStaffService.selectIcsCustomerStaffById(userId);
|
||||
if(null !=customerStaff){
|
||||
return R.ok().put("data",customerStaff);
|
||||
}else {
|
||||
return R.error("获取微信用户数据失败");
|
||||
}
|
||||
|
@ -62,21 +62,13 @@ public class ApiEquipmentController extends BaseController {
|
||||
UserEquipment userEquipment1 = new UserEquipment();
|
||||
userEquipment1.setEquipmentId(roomRecord.getDeviceId());
|
||||
userEquipment1.setUserId(roomRecord.getUserId());
|
||||
List<UserEquipment> equipments = userEquipmentService.selectUserEquipmentList(userEquipment1);
|
||||
|
||||
if (CollUtil.isNotEmpty(equipments)){
|
||||
//循环判断当前时间是否在时间段
|
||||
for (UserEquipment userEquipment : equipments) {
|
||||
boolean in = DateUtil.isIn(DateUtil.date(), userEquipment.getStartTime(), userEquipment.getEndDate());
|
||||
if (!in){
|
||||
return R.error("不在开门时间段");
|
||||
}
|
||||
}
|
||||
int count =userEquipmentService.selectCountByUserIdAndDeviceId(userEquipment1);
|
||||
|
||||
if (count == 0){
|
||||
return R.error("您没有权限开门,不在开门时间内");
|
||||
}
|
||||
|
||||
|
||||
|
||||
String ip = equipmentService.selectEquipmentById(roomRecord.getDeviceId()).getIp();
|
||||
|
||||
String openlock = DeviceUtils.openlock(ip);
|
||||
|
@ -131,7 +131,7 @@ public class ApiRoomContentController extends BaseController {
|
||||
|
||||
List<CustomerTicket> list = customerTicketService.getCustomerTicket(userCustomerVo);
|
||||
|
||||
return R.ok().put("data",list);
|
||||
return R.ok().put("data", list);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -144,13 +144,13 @@ public class ApiRoomContentController extends BaseController {
|
||||
// meetingRoomId
|
||||
List<ReservationDTO> reservationList = roomContentService.selectMeetingRoomRecord(meetingRoomId);
|
||||
|
||||
return R.ok().put("data",reservationList);
|
||||
return R.ok().put("data", reservationList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询空闲的会议室
|
||||
* 查询空闲的会议室
|
||||
*
|
||||
* @param reservation
|
||||
* @return
|
||||
*/
|
||||
@ -163,8 +163,8 @@ public class ApiRoomContentController extends BaseController {
|
||||
boolean count = true;
|
||||
|
||||
RoomContent roomContent = roomContentMapper.selectById(reservation.getRoomContentId());
|
||||
if (null != roomContent){
|
||||
Assert.isTrue(roomContent !=null,"该会议室不存在");
|
||||
if (null != roomContent) {
|
||||
Assert.isTrue(roomContent != null, "该会议室不存在");
|
||||
}
|
||||
|
||||
Date startTime = reservation.getStartTime();
|
||||
@ -181,22 +181,22 @@ public class ApiRoomContentController extends BaseController {
|
||||
|
||||
boolean b = timeIsInRound(startFormat, startFormat1, endFormat1);
|
||||
|
||||
if (!b){
|
||||
msg = !b?"请在"+startFormat1+"到"+endFormat1+"的时间段内预约会议时间":"会议室可用";
|
||||
if (!b) {
|
||||
msg = !b ? "请在" + startFormat1 + "到" + endFormat1 + "的时间段内预约会议时间" : "会议室可用";
|
||||
count = true;
|
||||
return R.ok().put("count",count).put("msg",msg);
|
||||
return R.ok().put("count", count).put("msg", msg);
|
||||
}
|
||||
boolean b1 = timeIsInRound(endFormat, startFormat1, endFormat1);
|
||||
if (!b1){
|
||||
msg = !b1?"请在"+startFormat1+"到"+endFormat1+"的时间段内预约会议时间":"会议室可用";
|
||||
if (!b1) {
|
||||
msg = !b1 ? "请在" + startFormat1 + "到" + endFormat1 + "的时间段内预约会议时间" : "会议室可用";
|
||||
count = true;
|
||||
return R.ok().put("count",count).put("msg",msg);
|
||||
return R.ok().put("count", count).put("msg", msg);
|
||||
}
|
||||
|
||||
|
||||
count =reservationService.selectFreeMeetingRoom(reservation);
|
||||
msg =count?"该时间段已被预约":"会议室可用";
|
||||
return R.ok().put("count",count).put("msg",msg);
|
||||
count = reservationService.selectFreeMeetingRoom(reservation);
|
||||
msg = count ? "该时间段已被预约" : "会议室可用";
|
||||
return R.ok().put("count", count).put("msg", msg);
|
||||
}
|
||||
|
||||
|
||||
@ -214,7 +214,7 @@ public class ApiRoomContentController extends BaseController {
|
||||
Assert.isFalse(b, "会议室不可用");
|
||||
|
||||
IcsCustomerStaff customerStaff = customerStaffService.selectIcsCustomerStaffById(reservation.getUserId());
|
||||
Assert.isTrue(customerStaff != null , "用户不存在");
|
||||
Assert.isTrue(customerStaff != null, "用户不存在");
|
||||
|
||||
BigDecimal price = new BigDecimal(reservation.getOrderMoney());
|
||||
|
||||
@ -230,17 +230,17 @@ public class ApiRoomContentController extends BaseController {
|
||||
reservation.setStauts(Reservation.Status.TO_BE_PAID);
|
||||
boolean save = reservationService.save(reservation);
|
||||
|
||||
if (save){
|
||||
if (null !=reservation.getTicketId()){
|
||||
if (save) {
|
||||
if (null != reservation.getTicketId()) {
|
||||
Ticket ticket = ticketService.selectTicketById(reservation.getTicketId());
|
||||
if (ticket.getType() == 2){
|
||||
CustomerTicket customerTicket =new CustomerTicket();
|
||||
if (ticket.getType() == 2) {
|
||||
CustomerTicket customerTicket = new CustomerTicket();
|
||||
customerTicket.setTicketId(reservation.getTicketId());
|
||||
customerTicket.setCustomerId(reservation.getCustomerId());
|
||||
customerTicket.setStaffId(reservation.getUserId());
|
||||
customerTicketService.insertCustomerTicket(customerTicket);
|
||||
}else {
|
||||
CustomerTicket customerTicket =new CustomerTicket();
|
||||
} else {
|
||||
CustomerTicket customerTicket = new CustomerTicket();
|
||||
customerTicket.setTicketId(reservation.getTicketId());
|
||||
customerTicket.setCustomerId(reservation.getCustomerId());
|
||||
customerTicket.setStaffId(reservation.getUserId());
|
||||
@ -270,35 +270,32 @@ public class ApiRoomContentController extends BaseController {
|
||||
}
|
||||
if (CollUtil.isNotEmpty(ids)) {
|
||||
for (Long id : ids) {
|
||||
UserEquipment equipment = userEquipmentService.selectUserAndEquipment(reservation.getUserId(), id);
|
||||
if (null == equipment) {
|
||||
UserEquipment userEquipment = new UserEquipment();
|
||||
userEquipment.setEquipmentId(id);
|
||||
userEquipment.setUserId(reservation.getUserId());
|
||||
userEquipment.setStartTime(reservation.getStartTime());
|
||||
userEquipment.setEndDate(reservation.getEndDate());
|
||||
userEquipmentService.insertUserEquipment(userEquipment);
|
||||
}
|
||||
UserEquipment userEquipment = new UserEquipment();
|
||||
userEquipment.setEquipmentId(id);
|
||||
userEquipment.setUserId(reservation.getUserId());
|
||||
userEquipment.setStartTime(reservation.getStartTime());
|
||||
userEquipment.setEndDate(reservation.getEndDate());
|
||||
userEquipmentService.insertUserEquipment(userEquipment);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Long id = reservation.getId();
|
||||
return toAjax(save).put("reservationId",id);
|
||||
}else {
|
||||
return toAjax(save).put("reservationId", id);
|
||||
} else {
|
||||
boolean save = reservationService.save(reservation);
|
||||
if (save){
|
||||
if (null !=reservation.getTicketId()){
|
||||
if (save) {
|
||||
if (null != reservation.getTicketId()) {
|
||||
Ticket ticket = ticketService.selectTicketById(reservation.getTicketId());
|
||||
if (ticket.getType() == 2){
|
||||
CustomerTicket customerTicket =new CustomerTicket();
|
||||
if (ticket.getType() == 2) {
|
||||
CustomerTicket customerTicket = new CustomerTicket();
|
||||
customerTicket.setTicketId(reservation.getTicketId());
|
||||
customerTicket.setCustomerId(reservation.getCustomerId());
|
||||
customerTicket.setStaffId(reservation.getUserId());
|
||||
customerTicketService.insertCustomerTicket(customerTicket);
|
||||
}else {
|
||||
CustomerTicket customerTicket =new CustomerTicket();
|
||||
} else {
|
||||
CustomerTicket customerTicket = new CustomerTicket();
|
||||
customerTicket.setTicketId(reservation.getTicketId());
|
||||
customerTicket.setCustomerId(reservation.getCustomerId());
|
||||
customerTicket.setStaffId(reservation.getUserId());
|
||||
@ -327,19 +324,21 @@ public class ApiRoomContentController extends BaseController {
|
||||
}
|
||||
if (CollUtil.isNotEmpty(ids)) {
|
||||
for (Long id : ids) {
|
||||
UserEquipment equipment = userEquipmentService.selectUserAndEquipment(reservation.getUserId(), id);
|
||||
if (null == equipment) {
|
||||
UserEquipment userEquipment = new UserEquipment();
|
||||
userEquipment.setEquipmentId(id);
|
||||
userEquipment.setUserId(reservation.getUserId());
|
||||
userEquipmentService.insertUserEquipment(userEquipment);
|
||||
}
|
||||
// UserEquipment equipment = userEquipmentService.selectUserAndEquipment(reservation.getUserId(), id);
|
||||
// if (null == equipment) {
|
||||
UserEquipment userEquipment = new UserEquipment();
|
||||
userEquipment.setEquipmentId(id);
|
||||
userEquipment.setUserId(reservation.getUserId());
|
||||
userEquipment.setStartTime(reservation.getStartTime());
|
||||
userEquipment.setEndDate(reservation.getEndDate());
|
||||
userEquipmentService.insertUserEquipment(userEquipment);
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Long id = reservation.getId();
|
||||
return toAjax(save).put("reservationId",id);
|
||||
return toAjax(save).put("reservationId", id);
|
||||
}
|
||||
}
|
||||
|
||||
@ -350,19 +349,19 @@ public class ApiRoomContentController extends BaseController {
|
||||
@GetMapping("/getMeetingRoomServiceAndEquipment/{meetingRoomId}")
|
||||
public R getMeetingRoomServiceAndEquipment(@PathVariable("meetingRoomId") Long meetingRoomId) {
|
||||
//根据用户获取对应的企业id,查询该企业下对应的优惠卷
|
||||
Map<String,Object> map = roomContentService.selectMeetingRoomServiceAndEquipment(meetingRoomId);
|
||||
return R.ok().put("data",map);
|
||||
Map<String, Object> map = roomContentService.selectMeetingRoomServiceAndEquipment(meetingRoomId);
|
||||
return R.ok().put("data", map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算会议室金额
|
||||
* 计算会议室金额
|
||||
*/
|
||||
@RequiresPermissions("member:center:view")
|
||||
@PostMapping("/calculateMeetingRoomAmount")
|
||||
public R calculateMeetingRoomAmount(@RequestBody Reservation reservation) {
|
||||
//根据用户获取对应的企业id,查询该企业下对应的优惠卷
|
||||
MeetingAmountVo amount = reservationService.calculateMeetingRoomAmount(reservation);
|
||||
return R.ok().put("amount",amount);
|
||||
return R.ok().put("amount", amount);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -370,61 +369,61 @@ public class ApiRoomContentController extends BaseController {
|
||||
*/
|
||||
@RequiresPermissions("member:center:view")
|
||||
@PostMapping("selectReservationListByUserId")
|
||||
public R selectReservationListByUserId(@RequestBody Reservation reservation){
|
||||
public R selectReservationListByUserId(@RequestBody Reservation reservation) {
|
||||
|
||||
PageDomain pageDomain = TableSupport.buildPageRequest();
|
||||
Integer pageNum = pageDomain.getPageNum();
|
||||
Integer pageSize = pageDomain.getPageSize();
|
||||
IPage<Reservation> list = reservationService.selectReservationListByUserId(reservation,pageNum,pageSize);
|
||||
IPage<Reservation> list = reservationService.selectReservationListByUserId(reservation, pageNum, pageSize);
|
||||
|
||||
return R.ok().put("page",list);
|
||||
return R.ok().put("page", list);
|
||||
}
|
||||
|
||||
// 根据id查询预约信息
|
||||
@RequiresPermissions("member:center:view")
|
||||
@GetMapping("selectReservationById/{id}")
|
||||
public R selectReservationById(@PathVariable("id") Long id){
|
||||
public R selectReservationById(@PathVariable("id") Long id) {
|
||||
Reservation reservation = reservationService.selectReservationById(id);
|
||||
if (null != reservation){
|
||||
if (null != reservation) {
|
||||
reservation.setStatusValue(reservation.getStauts().getValue());
|
||||
reservation.setStatusName(reservation.getStauts().getName());
|
||||
}
|
||||
IcsCustomerStaff icsCustomerStaff = customerStaffService.selectIcsCustomerStaffById(reservation.getUserId());
|
||||
if(null != icsCustomerStaff){
|
||||
if (null != icsCustomerStaff) {
|
||||
reservation.setUserName(icsCustomerStaff.getUsername());
|
||||
reservation.setPhone(icsCustomerStaff.getMobile());
|
||||
reservation.setAvatar(icsCustomerStaff.getAvatar());
|
||||
}
|
||||
|
||||
Ticket ticket = ticketService.selectTicketById(reservation.getTicketId());
|
||||
if(null != ticket){
|
||||
if (null != ticket) {
|
||||
reservation.setTicketName(ticket.getTitle());
|
||||
}
|
||||
|
||||
Long roomContentId = reservation.getRoomContentId();
|
||||
RoomContent roomContent = roomContentMapper.selectById(roomContentId);
|
||||
Room room = roomService.selectRoomById(roomContent.getRoomId());
|
||||
if (room != null) {
|
||||
roomContent.setRoomId(room.getId());
|
||||
RoomContent roomContent = roomContentMapper.selectById(roomContentId);
|
||||
Room room = roomService.selectRoomById(roomContent.getRoomId());
|
||||
if (room != null) {
|
||||
roomContent.setRoomId(room.getId());
|
||||
|
||||
roomContent.setRoomName(room.getName());
|
||||
roomContent.setArea(room.getArea());
|
||||
roomContent.setRenArea(room.getRentArea());
|
||||
//查询楼层号
|
||||
BuildingDetail buildingDetail = buildingDetailService.selectBuildingDetailById(room.getBuildingDetailId());
|
||||
if (buildingDetail != null) {
|
||||
roomContent.setBuildingName(buildingDetail.getFloorName() +"F");
|
||||
}
|
||||
//根据房间id查询设备
|
||||
QueryWrapper<RoomEquipment> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("room_id",room.getId());
|
||||
RoomEquipment roomEquipment = roomEquipmentMapper.selectOne(wrapper);
|
||||
if (roomEquipment != null) {
|
||||
roomContent.setEquipmentId(roomEquipment.getEquipmentId());
|
||||
}
|
||||
roomContent.setRoomName(room.getName());
|
||||
roomContent.setArea(room.getArea());
|
||||
roomContent.setRenArea(room.getRentArea());
|
||||
//查询楼层号
|
||||
BuildingDetail buildingDetail = buildingDetailService.selectBuildingDetailById(room.getBuildingDetailId());
|
||||
if (buildingDetail != null) {
|
||||
roomContent.setBuildingName(buildingDetail.getFloorName() + "F");
|
||||
}
|
||||
reservation.setRoomContent(roomContent);
|
||||
return R.ok().put("data",reservation);
|
||||
//根据房间id查询设备
|
||||
QueryWrapper<RoomEquipment> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("room_id", room.getId());
|
||||
RoomEquipment roomEquipment = roomEquipmentMapper.selectOne(wrapper);
|
||||
if (roomEquipment != null) {
|
||||
roomContent.setEquipmentId(roomEquipment.getEquipmentId());
|
||||
}
|
||||
}
|
||||
reservation.setRoomContent(roomContent);
|
||||
return R.ok().put("data", reservation);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -436,7 +435,7 @@ public class ApiRoomContentController extends BaseController {
|
||||
//根据用户获取对应的企业id,查询该企业下对应的优惠卷
|
||||
Park park = parkService.selectParkById(1L);
|
||||
|
||||
return R.ok().put("lat",park.getLat()).put("lng",park.getLng()).put("address",park.getAddress());
|
||||
return R.ok().put("lat", park.getLat()).put("lng", park.getLng()).put("address", park.getAddress());
|
||||
}
|
||||
|
||||
|
||||
@ -448,8 +447,8 @@ public class ApiRoomContentController extends BaseController {
|
||||
public R isVisitor(@RequestBody ReservationPerson reservationPerson) {
|
||||
|
||||
ReservationPerson visitor = reservationPersonService.isVisitor(reservationPerson);
|
||||
if (visitor != null){
|
||||
return R.error(500,"该人员已预约");
|
||||
if (visitor != null) {
|
||||
return R.error(500, "该人员已预约");
|
||||
}
|
||||
return R.ok("该人员未预约");
|
||||
}
|
||||
@ -464,7 +463,7 @@ public class ApiRoomContentController extends BaseController {
|
||||
reservationPerson.setStatus("1");
|
||||
reservationPerson.setJoinTime(new Date());
|
||||
IcsCustomerStaff customerStaff = customerStaffService.selectIcsCustomerStaffById(reservationPerson.getParticipantId());
|
||||
if (null != customerStaff){
|
||||
if (null != customerStaff) {
|
||||
reservationPerson.setParticipantName(customerStaff.getUsername());
|
||||
}
|
||||
int i = reservationPersonService.insertReservationPerson(reservationPerson);
|
||||
@ -496,15 +495,15 @@ public class ApiRoomContentController extends BaseController {
|
||||
}
|
||||
if (CollUtil.isNotEmpty(ids)) {
|
||||
for (Long id : ids) {
|
||||
UserEquipment equipment = userEquipmentService.selectUserAndEquipment(reservationPerson.getReservationId(), id);
|
||||
if (null == equipment) {
|
||||
UserEquipment userEquipment = new UserEquipment();
|
||||
userEquipment.setEquipmentId(id);
|
||||
userEquipment.setUserId(reservationPerson.getParticipantId());
|
||||
userEquipment.setStartTime(reservation.getStartTime());
|
||||
userEquipment.setEndDate(reservation.getEndDate());
|
||||
userEquipmentService.insertUserEquipment(userEquipment);
|
||||
}
|
||||
// UserEquipment equipment = userEquipmentService.selectUserAndEquipment(reservationPerson.getReservationId(), id);
|
||||
// if (null == equipment) {
|
||||
UserEquipment userEquipment = new UserEquipment();
|
||||
userEquipment.setEquipmentId(id);
|
||||
userEquipment.setUserId(reservationPerson.getParticipantId());
|
||||
userEquipment.setStartTime(reservation.getStartTime());
|
||||
userEquipment.setEndDate(reservation.getEndDate());
|
||||
userEquipmentService.insertUserEquipment(userEquipment);
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
@ -520,7 +519,7 @@ public class ApiRoomContentController extends BaseController {
|
||||
@PostMapping("/cancelOrder")
|
||||
public R cancelOrder(@RequestBody Reservation reservation) {
|
||||
|
||||
Assert.notNull(reservation.getId(),"当前预约信息不存在");
|
||||
Assert.notNull(reservation.getId(), "当前预约信息不存在");
|
||||
reservation.setStauts(Reservation.Status.CANCELED);
|
||||
reservation.setCancelTime(new Date());
|
||||
int i = reservationService.updateReservation(reservation);
|
||||
@ -534,9 +533,9 @@ public class ApiRoomContentController extends BaseController {
|
||||
Reservation reservation1 = reservationService.selectReservationById(reservation.getId());
|
||||
Reservation.Status stauts = reservation1.getStauts();
|
||||
System.out.println(stauts);
|
||||
Assert.isFalse(reservation1.getStauts().equals(Reservation.Status.APPOINTMENT),"您已经支付成功,请勿重复支付");
|
||||
Assert.isFalse(reservation1.getStauts().equals(Reservation.Status.APPOINTMENT), "您已经支付成功,请勿重复支付");
|
||||
// WxChatPayDto wxChatPayDto = wxPayCommon.wxPayCall(prepayId);
|
||||
Assert.notNull(reservation.getId(),"当前预约信息不存在");
|
||||
Assert.notNull(reservation.getId(), "当前预约信息不存在");
|
||||
reservation.setStauts(Reservation.Status.APPOINTMENT);
|
||||
reservation.setOrderTime(new Date());
|
||||
int i = reservationService.updateReservation(reservation);
|
||||
@ -566,15 +565,15 @@ public class ApiRoomContentController extends BaseController {
|
||||
}
|
||||
if (CollUtil.isNotEmpty(ids)) {
|
||||
for (Long id : ids) {
|
||||
UserEquipment equipment =userEquipmentService.selectUserAndEquipment(reservation.getUserId(), id);
|
||||
if (null == equipment){
|
||||
UserEquipment userEquipment = new UserEquipment();
|
||||
userEquipment.setEquipmentId(id);
|
||||
userEquipment.setStartTime(reservation.getStartTime());
|
||||
userEquipment.setEndDate(reservation.getEndDate());
|
||||
userEquipment.setUserId(reservation.getUserId());
|
||||
userEquipmentService.insertUserEquipment(userEquipment);
|
||||
}
|
||||
// UserEquipment equipment =userEquipmentService.selectUserAndEquipment(reservation.getUserId(), id);
|
||||
// if (null == equipment){
|
||||
UserEquipment userEquipment = new UserEquipment();
|
||||
userEquipment.setEquipmentId(id);
|
||||
userEquipment.setStartTime(reservation.getStartTime());
|
||||
userEquipment.setEndDate(reservation.getEndDate());
|
||||
userEquipment.setUserId(reservation.getUserId());
|
||||
userEquipmentService.insertUserEquipment(userEquipment);
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -591,7 +590,7 @@ public class ApiRoomContentController extends BaseController {
|
||||
for (ReservationPerson person : reservationPeople) {
|
||||
|
||||
IcsCustomerStaff participant = customerStaffService.selectIcsCustomerStaffById(person.getParticipantId());
|
||||
if (null != participant){
|
||||
if (null != participant) {
|
||||
person.setAvatar(participant.getAvatar());
|
||||
person.setUserName(participant.getUsername());
|
||||
}
|
||||
@ -600,11 +599,6 @@ public class ApiRoomContentController extends BaseController {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static boolean timeIsInRound(String str1, String start, String end) {
|
||||
SimpleDateFormat df = new SimpleDateFormat("HH:mm:ss");
|
||||
Date now = null;
|
||||
@ -636,11 +630,6 @@ public class ApiRoomContentController extends BaseController {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -197,7 +197,6 @@ public class ApiVisitorController extends BaseController {
|
||||
VisitorPerson visitorPerson = visitorPersonService.selectReservationPersonById(person.getId());
|
||||
Assert.isTrue(visitorPerson.getStatus() == 0, "该访客已审核");
|
||||
|
||||
person.setStatus(1);
|
||||
person.setReviewers(person.getUserId());
|
||||
person.setReviewersTime(new Date());
|
||||
int update = visitorPersonService.updateVisitorPersonStatus(person);
|
||||
|
Loading…
x
Reference in New Issue
Block a user