mirror of
https://gitee.com/elegant_wings/xiongan-meeting.git
synced 2025-06-21 03:49:36 +08:00
新增了展厅预约的功能和对应模块
This commit is contained in:
parent
9bbf62fd06
commit
1a22b6de6c
@ -1,5 +1,12 @@
|
||||
package com.ics.admin.controller.meeting;
|
||||
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import com.ics.admin.domain.BuildingDetail;
|
||||
import com.ics.admin.domain.Room;
|
||||
import com.ics.admin.domain.meeting.RoomEquipment;
|
||||
import com.ics.admin.service.IBuildingDetailService;
|
||||
import com.ics.admin.service.IRoomService;
|
||||
import com.ics.admin.service.meeting.IRoomEquipmentService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
@ -12,8 +19,11 @@ import com.ics.common.core.domain.R;
|
||||
import com.ics.common.core.controller.BaseController;
|
||||
import com.ics.admin.domain.meeting.Equipment;
|
||||
import com.ics.admin.service.meeting.IEquipmentService;
|
||||
import org.wf.jwtp.annotation.Ignore;
|
||||
import org.wf.jwtp.annotation.RequiresPermissions;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备 提供者
|
||||
*
|
||||
@ -27,12 +37,29 @@ public class EquipmentController extends BaseController {
|
||||
@Autowired
|
||||
private IEquipmentService equipmentService;
|
||||
|
||||
@Autowired
|
||||
private IRoomEquipmentService roomEquipmentService;
|
||||
|
||||
@Autowired
|
||||
private IBuildingDetailService buildingDetailService;
|
||||
|
||||
@Autowired
|
||||
private IRoomService roomService;
|
||||
|
||||
/**
|
||||
* 查询设备
|
||||
*/
|
||||
@Ignore
|
||||
@GetMapping("get/{id}")
|
||||
public Equipment get(@PathVariable("id") Long id) {
|
||||
return equipmentService.selectEquipmentById(id);
|
||||
Equipment equipment = equipmentService.selectEquipmentById(id);
|
||||
RoomEquipment roomEquipment = roomEquipmentService.selectByEquipmentId(equipment.getId());
|
||||
Room room = roomService.selectRoomById(roomEquipment.getRoomId());
|
||||
equipment.setBuildId(room.getBuildingId());
|
||||
equipment.setRoomName(room.getName());
|
||||
BuildingDetail buildingDetail = buildingDetailService.selectBuildingDetailById(room.getBuildingDetailId());
|
||||
equipment.setBuildName(buildingDetail.getFloorName());
|
||||
return equipment;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -42,7 +69,16 @@ public class EquipmentController extends BaseController {
|
||||
@GetMapping("list")
|
||||
public R list(Equipment equipment) {
|
||||
startPage();
|
||||
return result(equipmentService.selectEquipmentList(equipment));
|
||||
List<Equipment> equipment1 = equipmentService.selectEquipmentList(equipment);
|
||||
for (Equipment equipment2 : equipment1) {
|
||||
RoomEquipment roomEquipment = roomEquipmentService.selectByEquipmentId(equipment2.getId());
|
||||
Room room = roomService.selectRoomById(roomEquipment.getRoomId());
|
||||
equipment2.setBuildId(room.getBuildingId());
|
||||
equipment2.setRoomName(room.getName());
|
||||
BuildingDetail buildingDetail = buildingDetailService.selectBuildingDetailById(room.getBuildingDetailId());
|
||||
equipment2.setBuildName(buildingDetail.getFloorName());
|
||||
}
|
||||
return result(equipment1);
|
||||
}
|
||||
|
||||
|
||||
@ -52,7 +88,17 @@ public class EquipmentController extends BaseController {
|
||||
@RequiresPermissions("meeting:equipment:add")
|
||||
@PostMapping("save")
|
||||
public R addSave(@RequestBody Equipment equipment) {
|
||||
return toAjax(equipmentService.insertEquipment(equipment));
|
||||
int i = equipmentService.insertEquipment(equipment);
|
||||
Assert.isTrue(i > 0, "添加失败");
|
||||
|
||||
RoomEquipment roomEquipment = new RoomEquipment();
|
||||
roomEquipment.setEquipmentId(equipment.getId());
|
||||
roomEquipment.setRoomId(equipment.getRoomId());
|
||||
int i1 = roomEquipmentService.insertRoomEquipment(roomEquipment);
|
||||
Assert.isTrue(i1 > 0, "添加失败");
|
||||
|
||||
|
||||
return toAjax(i);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -61,6 +107,10 @@ public class EquipmentController extends BaseController {
|
||||
@RequiresPermissions("meeting:equipment:edit")
|
||||
@PostMapping("update")
|
||||
public R editSave(@RequestBody Equipment equipment) {
|
||||
RoomEquipment roomEquipment = new RoomEquipment();
|
||||
roomEquipment.setEquipmentId(equipment.getId());
|
||||
roomEquipment.setRoomId(equipment.getRoomId());
|
||||
roomEquipmentService.updateRoomEquipment(roomEquipment);
|
||||
return toAjax(equipmentService.updateEquipment(equipment));
|
||||
}
|
||||
|
||||
|
@ -2,9 +2,11 @@ package com.ics.admin.controller.meeting;
|
||||
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import com.ics.admin.domain.BuildingDetail;
|
||||
import com.ics.admin.domain.Customer;
|
||||
import com.ics.admin.domain.Room;
|
||||
import com.ics.admin.domain.meeting.*;
|
||||
import com.ics.admin.service.IBuildingDetailService;
|
||||
import com.ics.admin.service.ICustomerService;
|
||||
import com.ics.admin.service.IRoomService;
|
||||
import com.ics.admin.service.meeting.IRoomContentService;
|
||||
import com.ics.admin.service.meeting.IRoomItemByRoomService;
|
||||
@ -53,12 +55,16 @@ public class RoomContentController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IRoomService roomService;
|
||||
|
||||
@Autowired
|
||||
private ICustomerService customerService;
|
||||
/**
|
||||
* 查询房间主体内容
|
||||
*/
|
||||
@Ignore
|
||||
@GetMapping("get/{id}")
|
||||
public RoomContent get(@PathVariable("id") Long id) {
|
||||
|
||||
RoomContent roomContent = roomContentService.selectRoomContentById(id);
|
||||
roomContent.setTypeName(roomContent.getType().getName());
|
||||
roomContent.setTypeValue(roomContent.getType().getValue());
|
||||
@ -208,4 +214,13 @@ public class RoomContentController extends BaseController {
|
||||
public R selectRoomById(Room room) {
|
||||
return R.ok().put("data",roomService.selectRoomById(room.getId()));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Ignore
|
||||
@GetMapping("/customerList")
|
||||
public R list(Customer customer) {
|
||||
List<Customer> customers = customerService.selectCustomerList(customer);
|
||||
return result(customers);
|
||||
}
|
||||
}
|
@ -0,0 +1,76 @@
|
||||
package com.ics.admin.controller.meeting;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.ics.common.core.domain.R;
|
||||
import com.ics.common.core.controller.BaseController;
|
||||
import com.ics.admin.domain.meeting.RoomRecord;
|
||||
import com.ics.admin.service.meeting.IRoomRecordService;
|
||||
import org.wf.jwtp.annotation.RequiresPermissions;
|
||||
|
||||
/**
|
||||
* 用户开门记录 提供者
|
||||
*
|
||||
* @author ics
|
||||
* @date 2024-03-11
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("record")
|
||||
public class RoomRecordController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IRoomRecordService roomRecordService;
|
||||
|
||||
/**
|
||||
* 查询用户开门记录
|
||||
*/
|
||||
@GetMapping("get/{id}")
|
||||
public RoomRecord get(@PathVariable("id") Long id) {
|
||||
return roomRecordService.selectRoomRecordById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询用户开门记录列表
|
||||
*/
|
||||
@RequiresPermissions("meeting:record:list")
|
||||
@GetMapping("list")
|
||||
public R list(RoomRecord roomRecord) {
|
||||
startPage();
|
||||
return result(roomRecordService.selectRoomRecordList(roomRecord));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增保存用户开门记录
|
||||
*/
|
||||
@RequiresPermissions("meeting:record:add")
|
||||
@PostMapping("save")
|
||||
public R addSave(@RequestBody RoomRecord roomRecord) {
|
||||
return toAjax(roomRecordService.insertRoomRecord(roomRecord));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保存用户开门记录
|
||||
*/
|
||||
@RequiresPermissions("meeting:record:edit")
|
||||
@PostMapping("update")
|
||||
public R editSave(@RequestBody RoomRecord roomRecord) {
|
||||
return toAjax(roomRecordService.updateRoomRecord(roomRecord));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除用户开门记录
|
||||
*/
|
||||
@RequiresPermissions("meeting:record:remove")
|
||||
@PostMapping("remove")
|
||||
public R remove(String ids) {
|
||||
return toAjax(roomRecordService.deleteRoomRecordByIds(ids));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,76 @@
|
||||
package com.ics.admin.controller.meeting;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.ics.common.core.domain.R;
|
||||
import com.ics.common.core.controller.BaseController;
|
||||
import com.ics.admin.domain.meeting.Showroom;
|
||||
import com.ics.admin.service.meeting.IShowroomService;
|
||||
import org.wf.jwtp.annotation.RequiresPermissions;
|
||||
|
||||
/**
|
||||
* 展厅管理 提供者
|
||||
*
|
||||
* @author ics
|
||||
* @date 2024-03-12
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("showroom")
|
||||
public class ShowroomController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IShowroomService showroomService;
|
||||
|
||||
/**
|
||||
* 查询展厅管理
|
||||
*/
|
||||
@GetMapping("get/{id}")
|
||||
public Showroom get(@PathVariable("id") Long id) {
|
||||
return showroomService.selectShowroomById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询展厅管理列表
|
||||
*/
|
||||
@RequiresPermissions("meeting:showroom:list")
|
||||
@GetMapping("list")
|
||||
public R list(Showroom showroom) {
|
||||
startPage();
|
||||
return result(showroomService.selectShowroomList(showroom));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增保存展厅管理
|
||||
*/
|
||||
@RequiresPermissions("meeting:showroom:add")
|
||||
@PostMapping("save")
|
||||
public R addSave(@RequestBody Showroom showroom) {
|
||||
return toAjax(showroomService.insertShowroom(showroom));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保存展厅管理
|
||||
*/
|
||||
@RequiresPermissions("meeting:showroom:edit")
|
||||
@PostMapping("update")
|
||||
public R editSave(@RequestBody Showroom showroom) {
|
||||
return toAjax(showroomService.updateShowroom(showroom));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除展厅管理
|
||||
*/
|
||||
@RequiresPermissions("meeting:showroom:remove")
|
||||
@PostMapping("remove")
|
||||
public R remove(String ids) {
|
||||
return toAjax(showroomService.deleteShowroomByIds(ids));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,76 @@
|
||||
package com.ics.admin.controller.meeting;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.ics.common.core.domain.R;
|
||||
import com.ics.common.core.controller.BaseController;
|
||||
import com.ics.admin.domain.meeting.ShowroomRecord;
|
||||
import com.ics.admin.service.meeting.IShowroomRecordService;
|
||||
import org.wf.jwtp.annotation.RequiresPermissions;
|
||||
|
||||
/**
|
||||
* 展厅预约记录 提供者
|
||||
*
|
||||
* @author ics
|
||||
* @date 2024-03-12
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/showroom/record")
|
||||
public class ShowroomRecordController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IShowroomRecordService showroomRecordService;
|
||||
|
||||
/**
|
||||
* 查询展厅预约记录
|
||||
*/
|
||||
@GetMapping("get/{id}")
|
||||
public ShowroomRecord get(@PathVariable("id") Long id) {
|
||||
return showroomRecordService.selectShowroomRecordById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询展厅预约记录列表
|
||||
*/
|
||||
@RequiresPermissions("meeting:record:list")
|
||||
@GetMapping("list")
|
||||
public R list(ShowroomRecord showroomRecord) {
|
||||
startPage();
|
||||
return result(showroomRecordService.selectShowroomRecordList(showroomRecord));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增保存展厅预约记录
|
||||
*/
|
||||
@RequiresPermissions("meeting:record:add")
|
||||
@PostMapping("save")
|
||||
public R addSave(@RequestBody ShowroomRecord showroomRecord) {
|
||||
return toAjax(showroomRecordService.insertShowroomRecord(showroomRecord));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保存展厅预约记录
|
||||
*/
|
||||
@RequiresPermissions("meeting:record:edit")
|
||||
@PostMapping("update")
|
||||
public R editSave(@RequestBody ShowroomRecord showroomRecord) {
|
||||
return toAjax(showroomRecordService.updateShowroomRecord(showroomRecord));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除展厅预约记录
|
||||
*/
|
||||
@RequiresPermissions("meeting:record:remove")
|
||||
@PostMapping("remove")
|
||||
public R remove(String ids) {
|
||||
return toAjax(showroomRecordService.deleteShowroomRecordByIds(ids));
|
||||
}
|
||||
|
||||
}
|
@ -1,8 +1,12 @@
|
||||
package com.ics.admin.domain.meeting;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.ics.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
@ -34,6 +38,15 @@ public class Equipment extends BaseEntity<Equipment> {
|
||||
|
||||
private String ip;
|
||||
|
||||
private String roomId;
|
||||
private Long roomId;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Long buildId;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String roomName;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String buildName;
|
||||
|
||||
}
|
||||
|
@ -41,6 +41,9 @@ public class RoomContent extends BaseEntity<RoomContent> {
|
||||
/** 地址 */
|
||||
private String address;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Long equipmentId;
|
||||
|
||||
/** 开始时间 */
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date startTime;
|
||||
|
@ -0,0 +1,31 @@
|
||||
package com.ics.admin.domain.meeting;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.ics.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 用户开门记录对象 tb_room_record
|
||||
*
|
||||
* @author ics
|
||||
* @date 2024-03-11
|
||||
*/
|
||||
@Data
|
||||
@TableName("tb_room_record")
|
||||
public class RoomRecord extends BaseEntity<RoomRecord> {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 房间id */
|
||||
private Long roomId;
|
||||
|
||||
/** 设备id */
|
||||
private Long deviceId;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String deviceName;
|
||||
|
||||
/** 用户id */
|
||||
private Long userId;
|
||||
|
||||
}
|
@ -0,0 +1,75 @@
|
||||
package com.ics.admin.domain.meeting;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.ics.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 展厅管理对象 tb_showroom
|
||||
*
|
||||
* @author ics
|
||||
* @date 2024-03-12
|
||||
*/
|
||||
@Data
|
||||
@TableName("tb_showroom")
|
||||
public class Showroom extends BaseEntity<Showroom> {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 展厅编码 */
|
||||
private String showroomCode;
|
||||
|
||||
/** 展厅名称 */
|
||||
private String meetingName;
|
||||
|
||||
/** 容纳人数 */
|
||||
private Integer capacityNum;
|
||||
|
||||
/** 扩充人数 */
|
||||
private Integer expandNum;
|
||||
|
||||
/** 室内图片url */
|
||||
private String indoorPicUrl;
|
||||
|
||||
/** 地址 */
|
||||
private String address;
|
||||
|
||||
/** 开始时间 */
|
||||
private Date startTime;
|
||||
|
||||
/** 结束时间 */
|
||||
private Date endDate;
|
||||
|
||||
/** 是否展示 */
|
||||
private Integer isShow;
|
||||
|
||||
|
||||
|
||||
/** 负责人姓名 */
|
||||
private String headName;
|
||||
|
||||
/** 负责人手机号 */
|
||||
private String headPhone;
|
||||
|
||||
/** 会议描述 */
|
||||
private String content;
|
||||
|
||||
/** 房间id */
|
||||
private Long roomId;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String roomName;
|
||||
|
||||
/** 展厅面积 */
|
||||
private String area;
|
||||
|
||||
@TableField(exist = false)
|
||||
private BigDecimal renArea;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String buildingName;
|
||||
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
package com.ics.admin.domain.meeting;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.ics.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 展厅预约记录对象 tb_showroom_record
|
||||
*
|
||||
* @author ics
|
||||
* @date 2024-03-12
|
||||
*/
|
||||
@Data
|
||||
@TableName("tb_showroom_record")
|
||||
public class ShowroomRecord extends BaseEntity<ShowroomRecord> {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 会议主体id */
|
||||
private Long showroomId;
|
||||
|
||||
/** 用户id */
|
||||
private Long userId;
|
||||
|
||||
/** 主题(会议主题、展厅主题) */
|
||||
private String title;
|
||||
|
||||
/** 预约状态 */
|
||||
private Integer stauts;
|
||||
|
||||
/** 预约编号 */
|
||||
private String reservationNumber;
|
||||
|
||||
/** 订单取消时间 */
|
||||
private Date cancelTime;
|
||||
|
||||
/** 订单取消原因 */
|
||||
private String cancelResaon;
|
||||
|
||||
/** 预约-开始时间 */
|
||||
private Date startTime;
|
||||
|
||||
private Integer explainNeedType;
|
||||
private Integer meetingNeedType;
|
||||
private Integer photographType;
|
||||
|
||||
/** 预约-结束时间 */
|
||||
private Date endDate;
|
||||
|
||||
/** 备注 */
|
||||
private String remake;
|
||||
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package com.ics.admin.domain.meeting;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.ics.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 展厅预约记录对象 tb_showroom_record
|
||||
*
|
||||
* @author ics
|
||||
* @date 2024-03-12
|
||||
*/
|
||||
@Data
|
||||
@TableName("tb_showroom_record")
|
||||
public class ShowroomRecordDTO extends BaseEntity<ShowroomRecordDTO> {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String nowDate;
|
||||
|
||||
private List<ShowroomRecord> showroomRecords;
|
||||
|
||||
}
|
@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.ics.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
/**
|
||||
* 用户设备关联对象 tb_user_equipment
|
||||
@ -13,16 +14,25 @@ import lombok.Data;
|
||||
*/
|
||||
@Data
|
||||
@TableName("tb_user_equipment")
|
||||
@RequiredArgsConstructor
|
||||
public class UserEquipment extends BaseEntity<UserEquipment> {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 用户id */
|
||||
private Long userId;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Long roomId;
|
||||
|
||||
/** 设备id */
|
||||
private Long equipmentId;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String roomName;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String equipmentName;
|
||||
@TableField(exist = false)
|
||||
private String equipmentStatus;
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.ics.admin.domain.meeting;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.ics.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
@ -19,16 +20,29 @@ public class VisitorPerson extends BaseEntity<VisitorPerson> {
|
||||
/** 访客id */
|
||||
private Long userId;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String userName;
|
||||
|
||||
|
||||
|
||||
|
||||
@TableField(exist = false)
|
||||
private String mobile;
|
||||
|
||||
|
||||
/** 被访人id */
|
||||
private Long intervieweeId;
|
||||
|
||||
private Long customerId;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String customerName;
|
||||
|
||||
/** 姓名 */
|
||||
private String name;
|
||||
|
||||
/** 手机号 */
|
||||
private Integer phone;
|
||||
private String phone;
|
||||
|
||||
/** 加入时间 */
|
||||
private Date joinTime;
|
||||
@ -51,7 +65,15 @@ public class VisitorPerson extends BaseEntity<VisitorPerson> {
|
||||
/** 状态 */
|
||||
private Integer status;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String statusName;
|
||||
|
||||
|
||||
private String photo;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String url;
|
||||
|
||||
private String rejectContent;
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,79 @@
|
||||
package com.ics.admin.domain.meeting.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.ics.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 访客预约人员对象 tb_reservation_person
|
||||
*
|
||||
* @author chen
|
||||
* @date 2024-02-25
|
||||
*/
|
||||
@Data
|
||||
@TableName("tb_visitor_person")
|
||||
public class VisitorPersonVo extends BaseEntity<VisitorPersonVo> {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 访客id */
|
||||
private Long userId;
|
||||
|
||||
|
||||
@TableField(exist = false)
|
||||
private String username;
|
||||
|
||||
|
||||
@TableField(exist = false)
|
||||
private String mobile;
|
||||
|
||||
|
||||
/** 被访人id */
|
||||
private Long intervieweeId;
|
||||
|
||||
private Long customerId;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String customerName;
|
||||
|
||||
/** 姓名 */
|
||||
private String name;
|
||||
|
||||
/** 手机号 */
|
||||
private String phone;
|
||||
|
||||
/** 加入时间 */
|
||||
private Date joinTime;
|
||||
|
||||
/** 到访时间 */
|
||||
private Date visitTime;
|
||||
|
||||
/** 离开时间 */
|
||||
private Date leaveTime;
|
||||
|
||||
/** 来访是由 */
|
||||
private String visitContent;
|
||||
|
||||
/** 证件类型 */
|
||||
private String cardType;
|
||||
|
||||
/** 证件号码 */
|
||||
private String cardNo;
|
||||
|
||||
/** 状态 */
|
||||
private Integer status;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String statusName;
|
||||
|
||||
|
||||
private String photo;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String url;
|
||||
|
||||
private String rejectContent;
|
||||
|
||||
}
|
@ -0,0 +1,64 @@
|
||||
package com.ics.admin.mapper.meeting;
|
||||
|
||||
import com.ics.admin.domain.meeting.RoomRecord;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户开门记录Mapper接口
|
||||
*
|
||||
* @author ics
|
||||
* @date 2024-03-11
|
||||
*/
|
||||
@Mapper
|
||||
public interface RoomRecordMapper extends BaseMapper<RoomRecord> {
|
||||
/**
|
||||
* 查询用户开门记录
|
||||
*
|
||||
* @param id 用户开门记录ID
|
||||
* @return 用户开门记录
|
||||
*/
|
||||
RoomRecord selectRoomRecordById(Long id);
|
||||
|
||||
/**
|
||||
* 查询用户开门记录列表
|
||||
*
|
||||
* @param roomRecord 用户开门记录
|
||||
* @return 用户开门记录集合
|
||||
*/
|
||||
List<RoomRecord> selectRoomRecordList(RoomRecord roomRecord);
|
||||
|
||||
/**
|
||||
* 新增用户开门记录
|
||||
*
|
||||
* @param roomRecord 用户开门记录
|
||||
* @return 结果
|
||||
*/
|
||||
int insertRoomRecord(RoomRecord roomRecord);
|
||||
|
||||
/**
|
||||
* 修改用户开门记录
|
||||
*
|
||||
* @param roomRecord 用户开门记录
|
||||
* @return 结果
|
||||
*/
|
||||
int updateRoomRecord(RoomRecord roomRecord);
|
||||
|
||||
/**
|
||||
* 删除用户开门记录
|
||||
*
|
||||
* @param id 用户开门记录ID
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteRoomRecordById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除用户开门记录
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteRoomRecordByIds(String[] ids);
|
||||
}
|
@ -0,0 +1,64 @@
|
||||
package com.ics.admin.mapper.meeting;
|
||||
|
||||
import com.ics.admin.domain.meeting.Showroom;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 展厅管理Mapper接口
|
||||
*
|
||||
* @author ics
|
||||
* @date 2024-03-12
|
||||
*/
|
||||
@Mapper
|
||||
public interface ShowroomMapper extends BaseMapper<Showroom> {
|
||||
/**
|
||||
* 查询展厅管理
|
||||
*
|
||||
* @param id 展厅管理ID
|
||||
* @return 展厅管理
|
||||
*/
|
||||
Showroom selectShowroomById(Long id);
|
||||
|
||||
/**
|
||||
* 查询展厅管理列表
|
||||
*
|
||||
* @param showroom 展厅管理
|
||||
* @return 展厅管理集合
|
||||
*/
|
||||
List<Showroom> selectShowroomList(Showroom showroom);
|
||||
|
||||
/**
|
||||
* 新增展厅管理
|
||||
*
|
||||
* @param showroom 展厅管理
|
||||
* @return 结果
|
||||
*/
|
||||
int insertShowroom(Showroom showroom);
|
||||
|
||||
/**
|
||||
* 修改展厅管理
|
||||
*
|
||||
* @param showroom 展厅管理
|
||||
* @return 结果
|
||||
*/
|
||||
int updateShowroom(Showroom showroom);
|
||||
|
||||
/**
|
||||
* 删除展厅管理
|
||||
*
|
||||
* @param id 展厅管理ID
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteShowroomById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除展厅管理
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteShowroomByIds(String[] ids);
|
||||
}
|
@ -0,0 +1,67 @@
|
||||
package com.ics.admin.mapper.meeting;
|
||||
|
||||
import com.ics.admin.domain.meeting.ShowroomRecord;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 展厅预约记录Mapper接口
|
||||
*
|
||||
* @author ics
|
||||
* @date 2024-03-12
|
||||
*/
|
||||
@Mapper
|
||||
public interface ShowroomRecordMapper extends BaseMapper<ShowroomRecord> {
|
||||
/**
|
||||
* 查询展厅预约记录
|
||||
*
|
||||
* @param id 展厅预约记录ID
|
||||
* @return 展厅预约记录
|
||||
*/
|
||||
ShowroomRecord selectShowroomRecordById(Long id);
|
||||
|
||||
/**
|
||||
* 查询展厅预约记录列表
|
||||
*
|
||||
* @param showroomRecord 展厅预约记录
|
||||
* @return 展厅预约记录集合
|
||||
*/
|
||||
List<ShowroomRecord> selectShowroomRecordList(ShowroomRecord showroomRecord);
|
||||
|
||||
/**
|
||||
* 新增展厅预约记录
|
||||
*
|
||||
* @param showroomRecord 展厅预约记录
|
||||
* @return 结果
|
||||
*/
|
||||
int insertShowroomRecord(ShowroomRecord showroomRecord);
|
||||
|
||||
/**
|
||||
* 修改展厅预约记录
|
||||
*
|
||||
* @param showroomRecord 展厅预约记录
|
||||
* @return 结果
|
||||
*/
|
||||
int updateShowroomRecord(ShowroomRecord showroomRecord);
|
||||
|
||||
/**
|
||||
* 删除展厅预约记录
|
||||
*
|
||||
* @param id 展厅预约记录ID
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteShowroomRecordById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除展厅预约记录
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteShowroomRecordByIds(String[] ids);
|
||||
|
||||
List<Date> selectListByDate(Long showroomId);
|
||||
}
|
@ -89,4 +89,13 @@ public class RoomEquipmentServiceImpl extends ServiceImpl<RoomEquipmentMapper, R
|
||||
public int deleteRoomEquipmentById(Long id) {
|
||||
return roomEquipmentMapper.deleteRoomEquipmentById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RoomEquipment selectByEquipmentId(Long id) {
|
||||
|
||||
|
||||
QueryWrapper<RoomEquipment> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("equipment_id",id);
|
||||
return roomEquipmentMapper.selectOne(wrapper);
|
||||
}
|
||||
}
|
||||
|
@ -1,29 +1,53 @@
|
||||
package com.ics.admin.service.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.ics.admin.domain.Room;
|
||||
import com.ics.admin.domain.meeting.Equipment;
|
||||
import com.ics.admin.domain.meeting.RoomEquipment;
|
||||
import com.ics.admin.mapper.meeting.EquipmentMapper;
|
||||
import com.ics.admin.mapper.meeting.RoomEquipmentMapper;
|
||||
import com.ics.admin.service.IRoomService;
|
||||
import com.ics.admin.service.meeting.IEquipmentService;
|
||||
import com.ics.admin.service.meeting.IRoomEquipmentService;
|
||||
import com.ics.common.utils.DeviceUtils;
|
||||
import com.ics.common.utils.IpUtils;
|
||||
import com.ics.common.utils.spring.BeanContext;
|
||||
import com.ics.common.utils.spring.SpringContextHolder;
|
||||
import com.ics.common.utils.spring.SpringUtils;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ics.admin.mapper.meeting.UserEquipmentMapper;
|
||||
import com.ics.admin.domain.meeting.UserEquipment;
|
||||
import com.ics.admin.service.meeting.IUserEquipmentService;
|
||||
import org.springframework.web.context.request.RequestAttributes;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.swing.*;
|
||||
|
||||
/**
|
||||
* 用户设备关联Service业务层处理
|
||||
*
|
||||
*
|
||||
* @author chen
|
||||
* @date 2024-02-25
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class UserEquipmentServiceImpl extends ServiceImpl<UserEquipmentMapper, UserEquipment> implements IUserEquipmentService {
|
||||
@Autowired
|
||||
@ -38,9 +62,14 @@ public class UserEquipmentServiceImpl extends ServiceImpl<UserEquipmentMapper, U
|
||||
@Autowired
|
||||
private IRoomService roomService;
|
||||
|
||||
@Autowired
|
||||
private IEquipmentService equipmentService;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询用户设备关联
|
||||
*
|
||||
*
|
||||
* @param id 用户设备关联ID
|
||||
* @return 用户设备关联
|
||||
*/
|
||||
@ -51,7 +80,7 @@ public class UserEquipmentServiceImpl extends ServiceImpl<UserEquipmentMapper, U
|
||||
|
||||
/**
|
||||
* 查询用户设备关联列表
|
||||
*
|
||||
*
|
||||
* @param userEquipment 用户设备关联
|
||||
* @return 用户设备关联
|
||||
*/
|
||||
@ -63,7 +92,7 @@ public class UserEquipmentServiceImpl extends ServiceImpl<UserEquipmentMapper, U
|
||||
|
||||
/**
|
||||
* 新增用户设备关联
|
||||
*
|
||||
*
|
||||
* @param userEquipment 用户设备关联
|
||||
* @return 结果
|
||||
*/
|
||||
@ -74,7 +103,7 @@ public class UserEquipmentServiceImpl extends ServiceImpl<UserEquipmentMapper, U
|
||||
|
||||
/**
|
||||
* 修改用户设备关联
|
||||
*
|
||||
*
|
||||
* @param userEquipment 用户设备关联
|
||||
* @return 结果
|
||||
*/
|
||||
@ -85,19 +114,19 @@ public class UserEquipmentServiceImpl extends ServiceImpl<UserEquipmentMapper, U
|
||||
|
||||
/**
|
||||
* 删除用户设备关联对象
|
||||
*
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteUserEquipmentByIds(String ids) {
|
||||
String[] idsArray = StrUtil.split(ids,",");
|
||||
String[] idsArray = StrUtil.split(ids, ",");
|
||||
return userEquipmentMapper.deleteBatchIds(CollUtil.toList(idsArray));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除用户设备关联信息
|
||||
*
|
||||
*
|
||||
* @param id 用户设备关联ID
|
||||
* @return 结果
|
||||
*/
|
||||
@ -107,23 +136,96 @@ public class UserEquipmentServiceImpl extends ServiceImpl<UserEquipmentMapper, U
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<UserEquipment> getEquipmentByUserId(String userId) {
|
||||
public List<UserEquipment> getEquipmentByUserId(Long userId) {
|
||||
|
||||
|
||||
List<UserEquipment> list = baseMapper.selectList(new QueryWrapper<UserEquipment>().eq("user_id", userId));
|
||||
if(CollUtil.isEmpty(list)){
|
||||
if (CollUtil.isEmpty(list)) {
|
||||
return list;
|
||||
}
|
||||
List<Equipment> equipment = equipmentService.selectEquipmentList(new Equipment());
|
||||
|
||||
updateDeviceDataSource(equipment);
|
||||
|
||||
|
||||
ArrayList<Equipment> equipments = new ArrayList<>();
|
||||
// 查出所有用户的设备,然后根据设备id 查出所在的房间号
|
||||
for (UserEquipment userEquipment : list) {
|
||||
QueryWrapper<RoomEquipment> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("equipment_id",userEquipment.getEquipmentId());
|
||||
wrapper.eq("equipment_id", userEquipment.getEquipmentId());
|
||||
RoomEquipment roomEquipment = roomEquipmentMapper.selectOne(wrapper);
|
||||
if (null != roomEquipment){
|
||||
if (null != roomEquipment) {
|
||||
Room room = roomService.selectRoomById(roomEquipment.getRoomId());
|
||||
userEquipment.setRoomName(room.getName());
|
||||
userEquipment.setRoomId(room.getId());
|
||||
}
|
||||
Equipment equipment1 = equipmentService.selectEquipmentById(userEquipment.getEquipmentId());
|
||||
if (null != equipment1) {
|
||||
equipments.add(equipment1);
|
||||
userEquipment.setEquipmentName(equipment1.getEquipmentName());
|
||||
if (equipment1.getStatus() == 0L) {
|
||||
userEquipment.setEquipmentStatus("在线");
|
||||
} else {
|
||||
userEquipment.setEquipmentStatus("离线");
|
||||
}
|
||||
}
|
||||
}
|
||||
return list;
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void updateDeviceDataSource(List<Equipment> equipments) {
|
||||
RequestAttributes requestAttributes = RequestContextHolder.getRequestAttributes();
|
||||
|
||||
RequestContextHolder.setRequestAttributes(requestAttributes,true);
|
||||
|
||||
|
||||
// 创建线程池
|
||||
ExecutorService executorService = Executors.newFixedThreadPool(1);
|
||||
CountDownLatch countDownLatch = new CountDownLatch(equipments.size());
|
||||
// 开始任务
|
||||
for (Equipment equipment : equipments) {
|
||||
|
||||
executorService.submit(() -> {
|
||||
EquipmentMapper equipmentMapper = BeanContext.getApplicationContext().getBean(EquipmentMapper.class);
|
||||
|
||||
try {
|
||||
// Equipment equipment1 = equipmentMapper.selectEquipmentById(equipment.getId());
|
||||
// System.out.println(equipment1);
|
||||
//
|
||||
Boolean isHost = DeviceUtils.ping(equipment.getIp(), 1,3000);
|
||||
if (!isHost) {
|
||||
equipment.setStatus(2L);
|
||||
equipmentMapper.updateEquipment(equipment);
|
||||
} else {
|
||||
String active = DeviceUtils.getActive(equipment.getIp());
|
||||
JSONObject jsonObject = JSONUtil.parseObj(active);
|
||||
JSONObject data = (JSONObject) jsonObject.get("data");
|
||||
String aBoolean = (String) data.get("isActivated");
|
||||
Boolean aBoolean1 = Boolean.valueOf(aBoolean);
|
||||
if (aBoolean1) {
|
||||
equipment.setStatus(0L);
|
||||
} else {
|
||||
equipment.setStatus(2L);
|
||||
}
|
||||
equipmentMapper.updateEquipment(equipment);
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
// 处理异常
|
||||
} finally {
|
||||
countDownLatch.countDown();
|
||||
}
|
||||
});
|
||||
}
|
||||
// 等待所有线程执行完成
|
||||
try {
|
||||
countDownLatch.await();
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -4,7 +4,10 @@ import java.util.List;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.ics.admin.domain.meeting.Reservation;
|
||||
import com.ics.admin.service.meeting.IVisitorPersonService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -91,14 +94,20 @@ public class IVisitorPersonServiceImpl extends ServiceImpl<VisitorPersonMapper,
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<VisitorPerson> selectVisitorRecord(Long customerId) {
|
||||
return visitorPersonMapper.selectList(new QueryWrapper<VisitorPerson>().eq("user_id", customerId));
|
||||
public IPage<VisitorPerson> selectVisitorRecord(Long userId, Integer pageNum, Integer pageSize) {
|
||||
QueryWrapper<VisitorPerson> wrapper = new QueryWrapper<VisitorPerson>().eq("user_id", userId);
|
||||
IPage<VisitorPerson> pages = new Page<>(pageNum,pageSize);
|
||||
IPage<VisitorPerson> userIPage = visitorPersonMapper.selectPage(pages,wrapper);
|
||||
return userIPage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<VisitorPerson> selectVisitorRecordByIntervieweeId(Long intervieweeId) {
|
||||
public IPage<VisitorPerson> selectVisitorRecordByIntervieweeId(Long intervieweeId, Integer pageNum, Integer pageSize) {
|
||||
QueryWrapper<VisitorPerson> wrapper = new QueryWrapper<VisitorPerson>().eq("interviewee_id", intervieweeId);
|
||||
IPage<VisitorPerson> pages = new Page<>(pageNum,pageSize);
|
||||
IPage<VisitorPerson> userIPage = visitorPersonMapper.selectPage(pages,wrapper);
|
||||
|
||||
return visitorPersonMapper.selectList(new QueryWrapper<VisitorPerson>().eq("interviewee_id", intervieweeId));
|
||||
return userIPage;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -140,8 +140,6 @@ public class ReservationServiceImpl extends ServiceImpl<ReservationMapper, Reser
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -0,0 +1,108 @@
|
||||
package com.ics.admin.service.impl.meeting;
|
||||
|
||||
import java.util.List;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.ics.admin.domain.meeting.Reservation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ics.admin.mapper.meeting.RoomRecordMapper;
|
||||
import com.ics.admin.domain.meeting.RoomRecord;
|
||||
import com.ics.admin.service.meeting.IRoomRecordService;
|
||||
|
||||
/**
|
||||
* 用户开门记录Service业务层处理
|
||||
*
|
||||
* @author ics
|
||||
* @date 2024-03-11
|
||||
*/
|
||||
@Service
|
||||
public class RoomRecordServiceImpl extends ServiceImpl<RoomRecordMapper, RoomRecord> implements IRoomRecordService {
|
||||
@Autowired
|
||||
private RoomRecordMapper roomRecordMapper;
|
||||
|
||||
/**
|
||||
* 查询用户开门记录
|
||||
*
|
||||
* @param id 用户开门记录ID
|
||||
* @return 用户开门记录
|
||||
*/
|
||||
@Override
|
||||
public RoomRecord selectRoomRecordById(Long id) {
|
||||
return roomRecordMapper.selectById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询用户开门记录列表
|
||||
*
|
||||
* @param roomRecord 用户开门记录
|
||||
* @return 用户开门记录
|
||||
*/
|
||||
@Override
|
||||
public List<RoomRecord> selectRoomRecordList(RoomRecord roomRecord) {
|
||||
QueryWrapper queryWrapper = new QueryWrapper();
|
||||
return roomRecordMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增用户开门记录
|
||||
*
|
||||
* @param roomRecord 用户开门记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertRoomRecord(RoomRecord roomRecord) {
|
||||
return roomRecordMapper.insert(roomRecord);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户开门记录
|
||||
*
|
||||
* @param roomRecord 用户开门记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateRoomRecord(RoomRecord roomRecord) {
|
||||
return roomRecordMapper.updateById(roomRecord);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除用户开门记录对象
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteRoomRecordByIds(String ids) {
|
||||
String[] idsArray = StrUtil.split(ids,",");
|
||||
return roomRecordMapper.deleteBatchIds(CollUtil.toList(idsArray));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除用户开门记录信息
|
||||
*
|
||||
* @param id 用户开门记录ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteRoomRecordById(Long id) {
|
||||
return roomRecordMapper.deleteRoomRecordById(id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public IPage<RoomRecord> getOpenDoorRecord(RoomRecord roomRecord, Integer pageNum, Integer pageSize) {
|
||||
QueryWrapper<RoomRecord> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("user_id", roomRecord.getUserId());
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
IPage<RoomRecord> pages = new Page<>(pageNum,pageSize);
|
||||
|
||||
return roomRecordMapper.selectPage(pages,queryWrapper);
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,147 @@
|
||||
package com.ics.admin.service.impl.meeting;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
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.meeting.Reservation;
|
||||
import com.ics.admin.domain.meeting.ReservationDTO;
|
||||
import com.ics.admin.domain.meeting.ShowroomRecordDTO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ics.admin.mapper.meeting.ShowroomRecordMapper;
|
||||
import com.ics.admin.domain.meeting.ShowroomRecord;
|
||||
import com.ics.admin.service.meeting.IShowroomRecordService;
|
||||
|
||||
import static com.ics.admin.service.impl.meeting.ReservationServiceImpl.judge;
|
||||
|
||||
/**
|
||||
* 展厅预约记录Service业务层处理
|
||||
*
|
||||
* @author ics
|
||||
* @date 2024-03-12
|
||||
*/
|
||||
@Service
|
||||
public class ShowroomRecordServiceImpl extends ServiceImpl<ShowroomRecordMapper, ShowroomRecord> implements IShowroomRecordService {
|
||||
@Autowired
|
||||
private ShowroomRecordMapper showroomRecordMapper;
|
||||
|
||||
/**
|
||||
* 查询展厅预约记录
|
||||
*
|
||||
* @param id 展厅预约记录ID
|
||||
* @return 展厅预约记录
|
||||
*/
|
||||
@Override
|
||||
public ShowroomRecord selectShowroomRecordById(Long id) {
|
||||
return showroomRecordMapper.selectById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询展厅预约记录列表
|
||||
*
|
||||
* @param showroomRecord 展厅预约记录
|
||||
* @return 展厅预约记录
|
||||
*/
|
||||
@Override
|
||||
public List<ShowroomRecord> selectShowroomRecordList(ShowroomRecord showroomRecord) {
|
||||
QueryWrapper queryWrapper = new QueryWrapper();
|
||||
return showroomRecordMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增展厅预约记录
|
||||
*
|
||||
* @param showroomRecord 展厅预约记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertShowroomRecord(ShowroomRecord showroomRecord) {
|
||||
return showroomRecordMapper.insert(showroomRecord);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改展厅预约记录
|
||||
*
|
||||
* @param showroomRecord 展厅预约记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateShowroomRecord(ShowroomRecord showroomRecord) {
|
||||
return showroomRecordMapper.updateById(showroomRecord);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除展厅预约记录对象
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteShowroomRecordByIds(String ids) {
|
||||
String[] idsArray = StrUtil.split(ids,",");
|
||||
return showroomRecordMapper.deleteBatchIds(CollUtil.toList(idsArray));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除展厅预约记录信息
|
||||
*
|
||||
* @param id 展厅预约记录ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteShowroomRecordById(Long id) {
|
||||
return showroomRecordMapper.deleteShowroomRecordById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ShowroomRecordDTO> appointmentRecord(ShowroomRecord showroomRecord) {
|
||||
ArrayList<ShowroomRecordDTO> list = new ArrayList<>();
|
||||
|
||||
// 根据最近七天查询数据
|
||||
|
||||
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",showroomRecord.getShowroomId());
|
||||
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);
|
||||
|
||||
showroomRecordDTO.setShowroomRecords(showroomRecords);
|
||||
list.add(showroomRecordDTO);
|
||||
}
|
||||
return list;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean selectFreeMeetingRoom(ShowroomRecord showroomRecord) {
|
||||
|
||||
QueryWrapper<ShowroomRecord> queryWrapper = new QueryWrapper<>();
|
||||
|
||||
queryWrapper.eq("showroom_id",showroomRecord.getShowroomId());
|
||||
|
||||
Date startTime = showroomRecord.getStartTime();
|
||||
Date endDate = showroomRecord.getEndDate();
|
||||
List<ShowroomRecord> reservations = showroomRecordMapper.selectList(queryWrapper);
|
||||
if (CollUtil.isNotEmpty(reservations)){
|
||||
for (ShowroomRecord reservation1 : reservations) {
|
||||
Boolean judge = judge(reservation1.getStartTime(), reservation1.getEndDate(), startTime, endDate);
|
||||
if (judge){
|
||||
return true;
|
||||
}else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
@ -0,0 +1,92 @@
|
||||
package com.ics.admin.service.impl.meeting;
|
||||
|
||||
import java.util.List;
|
||||
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 org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ics.admin.mapper.meeting.ShowroomMapper;
|
||||
import com.ics.admin.domain.meeting.Showroom;
|
||||
import com.ics.admin.service.meeting.IShowroomService;
|
||||
|
||||
/**
|
||||
* 展厅管理Service业务层处理
|
||||
*
|
||||
* @author ics
|
||||
* @date 2024-03-12
|
||||
*/
|
||||
@Service
|
||||
public class ShowroomServiceImpl extends ServiceImpl<ShowroomMapper, Showroom> implements IShowroomService {
|
||||
@Autowired
|
||||
private ShowroomMapper showroomMapper;
|
||||
|
||||
/**
|
||||
* 查询展厅管理
|
||||
*
|
||||
* @param id 展厅管理ID
|
||||
* @return 展厅管理
|
||||
*/
|
||||
@Override
|
||||
public Showroom selectShowroomById(Long id) {
|
||||
return showroomMapper.selectById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询展厅管理列表
|
||||
*
|
||||
* @param showroom 展厅管理
|
||||
* @return 展厅管理
|
||||
*/
|
||||
@Override
|
||||
public List<Showroom> selectShowroomList(Showroom showroom) {
|
||||
QueryWrapper queryWrapper = new QueryWrapper();
|
||||
return showroomMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增展厅管理
|
||||
*
|
||||
* @param showroom 展厅管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertShowroom(Showroom showroom) {
|
||||
return showroomMapper.insert(showroom);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改展厅管理
|
||||
*
|
||||
* @param showroom 展厅管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateShowroom(Showroom showroom) {
|
||||
return showroomMapper.updateById(showroom);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除展厅管理对象
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteShowroomByIds(String ids) {
|
||||
String[] idsArray = StrUtil.split(ids,",");
|
||||
return showroomMapper.deleteBatchIds(CollUtil.toList(idsArray));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除展厅管理信息
|
||||
*
|
||||
* @param id 展厅管理ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteShowroomById(Long id) {
|
||||
return showroomMapper.deleteShowroomById(id);
|
||||
}
|
||||
}
|
@ -58,4 +58,6 @@ public interface IRoomEquipmentService extends IService<RoomEquipment> {
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteRoomEquipmentById(Long id);
|
||||
|
||||
RoomEquipment selectByEquipmentId(Long id);
|
||||
}
|
||||
|
@ -0,0 +1,64 @@
|
||||
package com.ics.admin.service.meeting;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.ics.admin.domain.meeting.RoomRecord;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户开门记录Service接口
|
||||
*
|
||||
* @author ics
|
||||
* @date 2024-03-11
|
||||
*/
|
||||
public interface IRoomRecordService extends IService<RoomRecord> {
|
||||
/**
|
||||
* 查询用户开门记录
|
||||
*
|
||||
* @param id 用户开门记录ID
|
||||
* @return 用户开门记录
|
||||
*/
|
||||
RoomRecord selectRoomRecordById(Long id);
|
||||
|
||||
/**
|
||||
* 查询用户开门记录列表
|
||||
*
|
||||
* @param roomRecord 用户开门记录
|
||||
* @return 用户开门记录集合
|
||||
*/
|
||||
List<RoomRecord> selectRoomRecordList(RoomRecord roomRecord);
|
||||
|
||||
/**
|
||||
* 新增用户开门记录
|
||||
*
|
||||
* @param roomRecord 用户开门记录
|
||||
* @return 结果
|
||||
*/
|
||||
int insertRoomRecord(RoomRecord roomRecord);
|
||||
|
||||
/**
|
||||
* 修改用户开门记录
|
||||
*
|
||||
* @param roomRecord 用户开门记录
|
||||
* @return 结果
|
||||
*/
|
||||
int updateRoomRecord(RoomRecord roomRecord);
|
||||
|
||||
/**
|
||||
* 批量删除用户开门记录
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteRoomRecordByIds(String ids);
|
||||
|
||||
/**
|
||||
* 删除用户开门记录信息
|
||||
*
|
||||
* @param id 用户开门记录ID
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteRoomRecordById(Long id);
|
||||
|
||||
IPage<RoomRecord> getOpenDoorRecord(RoomRecord roomRecord, Integer pageNum, Integer pageSize);
|
||||
}
|
@ -0,0 +1,68 @@
|
||||
package com.ics.admin.service.meeting;
|
||||
|
||||
import com.ics.admin.domain.meeting.ShowroomRecord;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.ics.admin.domain.meeting.ShowroomRecordDTO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 展厅预约记录Service接口
|
||||
*
|
||||
* @author ics
|
||||
* @date 2024-03-12
|
||||
*/
|
||||
public interface IShowroomRecordService extends IService<ShowroomRecord> {
|
||||
/**
|
||||
* 查询展厅预约记录
|
||||
*
|
||||
* @param id 展厅预约记录ID
|
||||
* @return 展厅预约记录
|
||||
*/
|
||||
ShowroomRecord selectShowroomRecordById(Long id);
|
||||
|
||||
/**
|
||||
* 查询展厅预约记录列表
|
||||
*
|
||||
* @param showroomRecord 展厅预约记录
|
||||
* @return 展厅预约记录集合
|
||||
*/
|
||||
List<ShowroomRecord> selectShowroomRecordList(ShowroomRecord showroomRecord);
|
||||
|
||||
/**
|
||||
* 新增展厅预约记录
|
||||
*
|
||||
* @param showroomRecord 展厅预约记录
|
||||
* @return 结果
|
||||
*/
|
||||
int insertShowroomRecord(ShowroomRecord showroomRecord);
|
||||
|
||||
/**
|
||||
* 修改展厅预约记录
|
||||
*
|
||||
* @param showroomRecord 展厅预约记录
|
||||
* @return 结果
|
||||
*/
|
||||
int updateShowroomRecord(ShowroomRecord showroomRecord);
|
||||
|
||||
/**
|
||||
* 批量删除展厅预约记录
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteShowroomRecordByIds(String ids);
|
||||
|
||||
/**
|
||||
* 删除展厅预约记录信息
|
||||
*
|
||||
* @param id 展厅预约记录ID
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteShowroomRecordById(Long id);
|
||||
|
||||
List<ShowroomRecordDTO> appointmentRecord(ShowroomRecord showroomRecord);
|
||||
|
||||
boolean selectFreeMeetingRoom(ShowroomRecord showroomRecord);
|
||||
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.ics.admin.service.meeting;
|
||||
|
||||
import com.ics.admin.domain.meeting.Showroom;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 展厅管理Service接口
|
||||
*
|
||||
* @author ics
|
||||
* @date 2024-03-12
|
||||
*/
|
||||
public interface IShowroomService extends IService<Showroom> {
|
||||
/**
|
||||
* 查询展厅管理
|
||||
*
|
||||
* @param id 展厅管理ID
|
||||
* @return 展厅管理
|
||||
*/
|
||||
Showroom selectShowroomById(Long id);
|
||||
|
||||
/**
|
||||
* 查询展厅管理列表
|
||||
*
|
||||
* @param showroom 展厅管理
|
||||
* @return 展厅管理集合
|
||||
*/
|
||||
List<Showroom> selectShowroomList(Showroom showroom);
|
||||
|
||||
/**
|
||||
* 新增展厅管理
|
||||
*
|
||||
* @param showroom 展厅管理
|
||||
* @return 结果
|
||||
*/
|
||||
int insertShowroom(Showroom showroom);
|
||||
|
||||
/**
|
||||
* 修改展厅管理
|
||||
*
|
||||
* @param showroom 展厅管理
|
||||
* @return 结果
|
||||
*/
|
||||
int updateShowroom(Showroom showroom);
|
||||
|
||||
/**
|
||||
* 批量删除展厅管理
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteShowroomByIds(String ids);
|
||||
|
||||
/**
|
||||
* 删除展厅管理信息
|
||||
*
|
||||
* @param id 展厅管理ID
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteShowroomById(Long id);
|
||||
}
|
@ -59,5 +59,5 @@ public interface IUserEquipmentService extends IService<UserEquipment> {
|
||||
*/
|
||||
int deleteUserEquipmentById(Long id);
|
||||
|
||||
List<UserEquipment> getEquipmentByUserId(String userId);
|
||||
List<UserEquipment> getEquipmentByUserId(Long userId);
|
||||
}
|
||||
|
@ -1,5 +1,7 @@
|
||||
package com.ics.admin.service.meeting;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.ics.admin.domain.meeting.Reservation;
|
||||
import com.ics.admin.domain.meeting.VisitorPerson;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import java.util.List;
|
||||
@ -59,9 +61,9 @@ public interface IVisitorPersonService extends IService<VisitorPerson> {
|
||||
*/
|
||||
int deleteReservationPersonById(Long id);
|
||||
|
||||
List<VisitorPerson> selectVisitorRecord(Long customerId);
|
||||
IPage<VisitorPerson> selectVisitorRecord(Long userId, Integer pageNum, Integer pageSize);
|
||||
|
||||
List<VisitorPerson> selectVisitorRecordByIntervieweeId(Long intervieweeId);
|
||||
IPage<VisitorPerson> selectVisitorRecordByIntervieweeId(Long intervieweeId, Integer pageNum, Integer pageSize);
|
||||
|
||||
int updateVisitorPersonStatus(VisitorPerson person);
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectEquipmentVo">
|
||||
SELECT id, type, equipment_name, status, create_date, equipment_num,room_id,ip, pic, delete_flag, create_by, create_time, update_by, update_time FROM tb_equipment
|
||||
SELECT id, type, equipment_name, status, equipment_num,room_id,ip, pic, delete_flag, create_by, create_time, update_by, update_time FROM tb_equipment
|
||||
</sql>
|
||||
|
||||
<select id="selectEquipmentList" parameterType="Equipment" resultMap="EquipmentResult">
|
||||
@ -78,16 +78,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="type != null ">type = #{type},</if>
|
||||
<if test="equipmentName != null and equipmentName != ''">equipment_name = #{equipmentName},</if>
|
||||
<if test="status != null ">status = #{status},</if>
|
||||
<if test="createDate != null ">create_date = #{createDate},</if>
|
||||
<if test="equipmentNum != null and equipmentNum != ''">equipment_num = #{equipmentNum},</if>
|
||||
<if test="pic != null and pic != ''">pic = #{pic},</if>
|
||||
<if test="deleteFlag != null ">delete_flag = #{deleteFlag},</if>
|
||||
<if test="ip != null ">ip = #{ip},</if>
|
||||
<if test="roomId != null ">room_id = #{roomId},</if>
|
||||
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
|
||||
<if test="createTime != null ">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null ">update_time = #{updateTime},</if>
|
||||
|
||||
</trim>
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
@ -23,7 +23,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="reservationNumber" column="reservation_number" />
|
||||
<result property="explainNeedType" column="explain_need_type" />
|
||||
<result property="meetingNeedType" column="meeting_need_type" />
|
||||
<!-- <result property="meetingId" column="meeting_id" />-->
|
||||
<result property="photographType" column="photograph_type" />
|
||||
<result property="startTime" column="start_time" />
|
||||
<result property="endDate" column="end_date" />
|
||||
@ -36,7 +35,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectReservationVo">
|
||||
SELECT id, room_content_id, user_id, ticket_id, customer_id, title, stauts,serve_id,end_date, is_after_sale, oder_number,reservation_number, order_money, cancel_time, cancel_resaon, visit_type, explain_need_type, meeting_need_type, photograph_type, start_time, end_time, delete_flag, create_by, create_time, update_by, update_time, remake FROM tb_reservation
|
||||
SELECT id, room_content_id, user_id, ticket_id,
|
||||
customer_id, title, stauts,serve_id,end_date, is_after_sale,
|
||||
oder_number,reservation_number, order_money, cancel_time, cancel_resaon, visit_type, explain_need_type, meeting_need_type, photograph_type, start_time, end_time, delete_flag, create_by, create_time, update_by, update_time, remake FROM tb_reservation
|
||||
</sql>
|
||||
|
||||
<select id="selectReservationList" parameterType="Reservation" resultMap="ReservationResult">
|
||||
@ -51,7 +52,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</select>
|
||||
<select id="selectListByDate" resultType="java.util.Date">
|
||||
select date_format(start_time, '%Y-%m-%d') from tb_reservation where start_time >= date_format(now(), '%Y-%m-%d')
|
||||
and room_content_id = #{roomContentId} group by date_format(start_time, '%Y-%m-%d');
|
||||
and room_content_id = #{roomContentId} group by date_format(start_time, '%Y-%m-%d');
|
||||
</select>
|
||||
|
||||
<insert id="insertReservation" parameterType="Reservation">
|
||||
@ -135,7 +136,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="visitType != null and visitType != ''">visit_type = #{visitType},</if>
|
||||
<if test="explainNeedType != null and explainNeedType != ''">explain_need_type = #{explainNeedType},</if>
|
||||
<if test="meetingNeedType != null and meetingNeedType != ''">meeting_need_type = #{meetingNeedType},</if>
|
||||
-- <if test="meetingId != null ">meeting_id = #{meetingId},</if>
|
||||
<if test="photographType != null and photographType != ''">photograph_type = #{photographType},</if>
|
||||
<if test="startTime != null ">start_time = #{startTime},</if>
|
||||
<if test="endDate != null ">end_date = #{endDate},</if>
|
||||
|
@ -17,7 +17,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
<select id="selectRoomEquipmentList" parameterType="RoomEquipment" resultMap="RoomEquipmentResult">
|
||||
<include refid="selectRoomEquipmentVo"/>
|
||||
<where>
|
||||
<where>
|
||||
<if test="roomId != null and roomId != ''"> AND room_id =#{roomId}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
@ -0,0 +1,78 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ics.admin.mapper.meeting.RoomRecordMapper">
|
||||
|
||||
<resultMap type="com.ics.admin.domain.meeting.RoomRecord" id="RoomRecordResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="roomId" column="room_id" />
|
||||
<result property="deviceId" column="device_id" />
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="deleteFlag" column="delete_flag" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectRoomRecordVo">
|
||||
SELECT id, room_id, device_id, user_id, create_time, create_by, delete_flag FROM tb_room_record
|
||||
</sql>
|
||||
|
||||
<select id="selectRoomRecordList" parameterType="RoomRecord" resultMap="RoomRecordResult">
|
||||
<include refid="selectRoomRecordVo"/>
|
||||
<where>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectRoomRecordById" parameterType="Long" resultMap="RoomRecordResult">
|
||||
<include refid="selectRoomRecordVo"/>
|
||||
WHERE id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertRoomRecord" parameterType="RoomRecord">
|
||||
INSERT INTO tb_room_record
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null ">id,</if>
|
||||
<if test="roomId != null ">room_id,</if>
|
||||
<if test="deviceId != null ">device_id,</if>
|
||||
<if test="userId != null ">user_id,</if>
|
||||
<if test="createTime != null ">create_time,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
<if test="deleteFlag != null ">delete_flag,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null ">#{id},</if>
|
||||
<if test="roomId != null ">#{roomId},</if>
|
||||
<if test="deviceId != null ">#{deviceId},</if>
|
||||
<if test="userId != null ">#{userId},</if>
|
||||
<if test="createTime != null ">#{createTime},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
<if test="deleteFlag != null ">#{deleteFlag},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateRoomRecord" parameterType="RoomRecord">
|
||||
UPDATE tb_room_record
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="roomId != null ">room_id = #{roomId},</if>
|
||||
<if test="deviceId != null ">device_id = #{deviceId},</if>
|
||||
<if test="userId != null ">user_id = #{userId},</if>
|
||||
<if test="createTime != null ">create_time = #{createTime},</if>
|
||||
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
|
||||
<if test="deleteFlag != null ">delete_flag = #{deleteFlag},</if>
|
||||
</trim>
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteRoomRecordById" parameterType="Long">
|
||||
DELETE FROM tb_room_record WHERE id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteRoomRecordByIds" parameterType="String">
|
||||
DELETE FROM tb_room_record where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,134 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ics.admin.mapper.meeting.ShowroomMapper">
|
||||
|
||||
<resultMap type="com.ics.admin.domain.meeting.Showroom" id="ShowroomResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="showroomCode" column="showroom_code" />
|
||||
<result property="meetingName" column="meeting_name" />
|
||||
<result property="capacityNum" column="capacity_num" />
|
||||
<result property="expandNum" column="expand_num" />
|
||||
<result property="indoorPicUrl" column="indoor_pic_url" />
|
||||
<result property="address" column="address" />
|
||||
<result property="startTime" column="start_time" />
|
||||
<result property="endDate" column="end_date" />
|
||||
<result property="isShow" column="is_show" />
|
||||
<result property="headName" column="head_name" />
|
||||
<result property="headPhone" column="head_phone" />
|
||||
<result property="content" column="content" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="version" column="version" />
|
||||
<result property="deleteFlag" column="delete_flag" />
|
||||
<result property="roomId" column="room_id" />
|
||||
<result property="area" column="area" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectShowroomVo">
|
||||
SELECT id, showroom_code, meeting_name, capacity_num, expand_num, indoor_pic_url, address, start_time, end_date, is_show, head_name, head_phone, content, create_by, create_time, update_by, update_time, version, delete_flag, room_id, area FROM tb_showroom
|
||||
</sql>
|
||||
|
||||
<select id="selectShowroomList" parameterType="Showroom" resultMap="ShowroomResult">
|
||||
<include refid="selectShowroomVo"/>
|
||||
<where>
|
||||
<if test="meetingName != null and meetingName != ''"> AND meeting_name LIKE CONCAT('%', #{meetingName}, '%')</if>
|
||||
<if test="headName != null and headName != ''"> AND head_name LIKE CONCAT('%', #{headName}, '%')</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectShowroomById" parameterType="Long" resultMap="ShowroomResult">
|
||||
<include refid="selectShowroomVo"/>
|
||||
WHERE id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertShowroom" parameterType="Showroom" useGeneratedKeys="true" keyProperty="id">
|
||||
INSERT INTO tb_showroom
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="showroomCode != null and showroomCode != ''">showroom_code,</if>
|
||||
<if test="meetingName != null and meetingName != ''">meeting_name,</if>
|
||||
<if test="capacityNum != null ">capacity_num,</if>
|
||||
<if test="expandNum != null ">expand_num,</if>
|
||||
<if test="indoorPicUrl != null and indoorPicUrl != ''">indoor_pic_url,</if>
|
||||
<if test="address != null and address != ''">address,</if>
|
||||
<if test="startTime != null ">start_time,</if>
|
||||
<if test="endDate != null ">end_date,</if>
|
||||
<if test="isShow != null ">is_show,</if>
|
||||
<if test="headName != null and headName != ''">head_name,</if>
|
||||
<if test="headPhone != null and headPhone != ''">head_phone,</if>
|
||||
<if test="content != null and content != ''">content,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
<if test="createTime != null ">create_time,</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by,</if>
|
||||
<if test="updateTime != null ">update_time,</if>
|
||||
<if test="version != null ">version,</if>
|
||||
<if test="deleteFlag != null ">delete_flag,</if>
|
||||
<if test="roomId != null ">room_id,</if>
|
||||
<if test="area != null and area != ''">area,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="showroomCode != null and showroomCode != ''">#{showroomCode},</if>
|
||||
<if test="meetingName != null and meetingName != ''">#{meetingName},</if>
|
||||
<if test="capacityNum != null ">#{capacityNum},</if>
|
||||
<if test="expandNum != null ">#{expandNum},</if>
|
||||
<if test="indoorPicUrl != null and indoorPicUrl != ''">#{indoorPicUrl},</if>
|
||||
<if test="address != null and address != ''">#{address},</if>
|
||||
<if test="startTime != null ">#{startTime},</if>
|
||||
<if test="endDate != null ">#{endDate},</if>
|
||||
<if test="isShow != null ">#{isShow},</if>
|
||||
<if test="headName != null and headName != ''">#{headName},</if>
|
||||
<if test="headPhone != null and headPhone != ''">#{headPhone},</if>
|
||||
<if test="content != null and content != ''">#{content},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
<if test="createTime != null ">#{createTime},</if>
|
||||
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
|
||||
<if test="updateTime != null ">#{updateTime},</if>
|
||||
<if test="version != null ">#{version},</if>
|
||||
<if test="deleteFlag != null ">#{deleteFlag},</if>
|
||||
<if test="roomId != null ">#{roomId},</if>
|
||||
<if test="area != null and area != ''">#{area},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateShowroom" parameterType="Showroom">
|
||||
UPDATE tb_showroom
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="showroomCode != null and showroomCode != ''">showroom_code = #{showroomCode},</if>
|
||||
<if test="meetingName != null and meetingName != ''">meeting_name = #{meetingName},</if>
|
||||
<if test="capacityNum != null ">capacity_num = #{capacityNum},</if>
|
||||
<if test="expandNum != null ">expand_num = #{expandNum},</if>
|
||||
<if test="indoorPicUrl != null and indoorPicUrl != ''">indoor_pic_url = #{indoorPicUrl},</if>
|
||||
<if test="address != null and address != ''">address = #{address},</if>
|
||||
<if test="startTime != null ">start_time = #{startTime},</if>
|
||||
<if test="endDate != null ">end_date = #{endDate},</if>
|
||||
<if test="isShow != null ">is_show = #{isShow},</if>
|
||||
<if test="headName != null and headName != ''">head_name = #{headName},</if>
|
||||
<if test="headPhone != null and headPhone != ''">head_phone = #{headPhone},</if>
|
||||
<if test="content != null and content != ''">content = #{content},</if>
|
||||
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
|
||||
<if test="createTime != null ">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null ">update_time = #{updateTime},</if>
|
||||
<if test="version != null ">version = #{version},</if>
|
||||
<if test="deleteFlag != null ">delete_flag = #{deleteFlag},</if>
|
||||
<if test="roomId != null ">room_id = #{roomId},</if>
|
||||
<if test="area != null and area != ''">area = #{area},</if>
|
||||
</trim>
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteShowroomById" parameterType="Long">
|
||||
DELETE FROM tb_showroom WHERE id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteShowroomByIds" parameterType="String">
|
||||
DELETE FROM tb_showroom where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,136 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ics.admin.mapper.meeting.ShowroomRecordMapper">
|
||||
|
||||
<resultMap type="com.ics.admin.domain.meeting.ShowroomRecord" id="ShowroomRecordResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="showroomId" column="showroom_id" />
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="title" column="title" />
|
||||
<result property="stauts" column="stauts" />
|
||||
<result property="reservationNumber" column="reservation_number" />
|
||||
<result property="cancelTime" column="cancel_time" />
|
||||
<result property="cancelResaon" column="cancel_resaon" />
|
||||
<result property="explainNeedType" column="explain_need_type" />
|
||||
<result property="meetingNeedType" column="meeting_need_type" />
|
||||
<result property="photographType" column="photograph_type" />
|
||||
<result property="persons" column="persons" />
|
||||
<result property="visitType" column="visit_type" />
|
||||
<result property="startTime" column="start_time" />
|
||||
<result property="endDate" column="end_date" />
|
||||
<result property="deleteFlag" column="delete_flag" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remake" column="remake" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectShowroomRecordVo">
|
||||
SELECT id, showroom_id, user_id, title, stauts, reservation_number,, explain_need_type, meeting_need_type, photograph_type, cancel_time, cancel_resaon, start_time, end_date, delete_flag, create_by, create_time, update_by, update_time, remake FROM tb_showroom_record
|
||||
</sql>
|
||||
|
||||
<select id="selectShowroomRecordList" parameterType="ShowroomRecord" resultMap="ShowroomRecordResult">
|
||||
<include refid="selectShowroomRecordVo"/>
|
||||
<where>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectShowroomRecordById" parameterType="Long" resultMap="ShowroomRecordResult">
|
||||
<include refid="selectShowroomRecordVo"/>
|
||||
WHERE id = #{id}
|
||||
</select>
|
||||
<select id="selectListByDate" resultType="java.util.Date">
|
||||
select date_format(start_time, '%Y-%m-%d') from tb_showroom_record where start_time >= date_format(now(), '%Y-%m-%d')
|
||||
and showroom_id = #{showroomId} group by date_format(start_time, '%Y-%m-%d');
|
||||
</select>
|
||||
|
||||
<insert id="insertShowroomRecord" parameterType="ShowroomRecord" useGeneratedKeys="true" keyProperty="id">
|
||||
INSERT INTO tb_showroom_record
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="showroomId != null ">showroom_id,</if>
|
||||
<if test="userId != null ">user_id,</if>
|
||||
<if test="title != null and title != ''">title,</if>
|
||||
<if test="stauts != null ">stauts,</if>
|
||||
<if test="reservationNumber != null and reservationNumber != ''">reservation_number,</if>
|
||||
<if test="cancelTime != null ">cancel_time,</if>
|
||||
<if test="cancelResaon != null and cancelResaon != ''">cancel_resaon,</if>
|
||||
<if test="startTime != null ">start_time,</if>
|
||||
<if test="endDate != null ">end_date,</if>
|
||||
<if test="explainNeedType != null and explainNeedType != ''">explain_need_type,</if>
|
||||
<if test="meetingNeedType != null and meetingNeedType != ''">meeting_need_type,</if>
|
||||
<if test="photographType != null and photographType != ''">photograph_type,</if>
|
||||
<if test="persons != null and persons != ''">persons,</if>
|
||||
<if test="visitType != null and visitType != ''">visit_type,</if>
|
||||
<if test="deleteFlag != null ">delete_flag,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
<if test="createTime != null ">create_time,</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by,</if>
|
||||
<if test="updateTime != null ">update_time,</if>
|
||||
<if test="remake != null and remake != ''">remake,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="showroomId != null ">#{showroomId},</if>
|
||||
<if test="userId != null ">#{userId},</if>
|
||||
<if test="title != null and title != ''">#{title},</if>
|
||||
<if test="stauts != null ">#{stauts},</if>
|
||||
<if test="reservationNumber != null and reservationNumber != ''">#{reservationNumber},</if>
|
||||
<if test="cancelTime != null ">#{cancelTime},</if>
|
||||
<if test="cancelResaon != null and cancelResaon != ''">#{cancelResaon},</if>
|
||||
<if test="startTime != null ">#{startTime},</if>
|
||||
<if test="explainNeedType != null and explainNeedType != ''">#{explainNeedType},</if>
|
||||
<if test="meetingNeedType != null and meetingNeedType != ''">#{meetingNeedType},</if>
|
||||
<if test="photographType != null and photographType != ''">#{photographType},</if>
|
||||
<if test="persons != null and persons != ''">#{persons},</if>
|
||||
<if test="visitType != null and visitType != ''">#{visitType},</if>
|
||||
<if test="endDate != null ">#{endDate},</if>
|
||||
<if test="deleteFlag != null ">#{deleteFlag},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
<if test="createTime != null ">#{createTime},</if>
|
||||
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
|
||||
<if test="updateTime != null ">#{updateTime},</if>
|
||||
<if test="remake != null and remake != ''">#{remake},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateShowroomRecord" parameterType="ShowroomRecord">
|
||||
UPDATE tb_showroom_record
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="showroomId != null ">showroom_id = #{showroomId},</if>
|
||||
<if test="userId != null ">user_id = #{userId},</if>
|
||||
<if test="title != null and title != ''">title = #{title},</if>
|
||||
<if test="stauts != null ">stauts = #{stauts},</if>
|
||||
<if test="reservationNumber != null and reservationNumber != ''">reservation_number = #{reservationNumber},</if>
|
||||
<if test="cancelTime != null ">cancel_time = #{cancelTime},</if>
|
||||
<if test="cancelResaon != null and cancelResaon != ''">cancel_resaon = #{cancelResaon},</if>
|
||||
<if test="startTime != null ">start_time = #{startTime},</if>
|
||||
<if test="explainNeedType != null and explainNeedType != ''">explain_need_type = #{explainNeedType},</if>
|
||||
<if test="meetingNeedType != null and meetingNeedType != ''">meeting_need_type = #{meetingNeedType},</if>
|
||||
<if test="photographType != null and photographType != ''">photograph_type = #{photographType},</if>
|
||||
<if test="persons != null and persons != ''">persons = #{persons},</if>
|
||||
<if test="visitType != null and visitType != ''">visit_type = #{visitType},</if>
|
||||
<if test="endDate != null ">end_date = #{endDate},</if>
|
||||
<if test="deleteFlag != null ">delete_flag = #{deleteFlag},</if>
|
||||
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
|
||||
<if test="createTime != null ">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null ">update_time = #{updateTime},</if>
|
||||
<if test="remake != null and remake != ''">remake = #{remake},</if>
|
||||
</trim>
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteShowroomRecordById" parameterType="Long">
|
||||
DELETE FROM tb_showroom_record WHERE id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteShowroomRecordByIds" parameterType="String">
|
||||
DELETE FROM tb_showroom_record where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
@ -13,6 +13,7 @@
|
||||
<result property="joinTime" column="join_time"/>
|
||||
<result property="visitTime" column="visit_time"/>
|
||||
<result property="customerId" column="customer_id"/>
|
||||
<result property="rejectContent" column="reject_content"/>
|
||||
<result property="leaveTime" column="leave_time"/>
|
||||
<result property="visitContent" column="visit_content"/>
|
||||
<result property="cardType" column="card_type"/>
|
||||
@ -22,7 +23,7 @@
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectReservationPersonVo">
|
||||
SELECT id, user_id, interviewee_id, name, phone, join_time, visit_time,photo,customer_id, leave_time, visit_content, card_type, card_no, status FROM tb_visitor_person
|
||||
SELECT id, user_id, interviewee_id, name, phone,reject_content, join_time, visit_time,photo,customer_id, leave_time, visit_content, card_type, card_no, status FROM tb_visitor_person
|
||||
</sql>
|
||||
|
||||
<select id="selectReservationPersonList" parameterType="VisitorPerson" resultMap="ReservationPersonResult">
|
||||
@ -49,6 +50,7 @@
|
||||
<if test="visitTime != null ">visit_time,</if>
|
||||
<if test="customerId != null ">customer_id,</if>
|
||||
<if test="leaveTime != null ">leave_time,</if>
|
||||
<if test="rejectContent != null ">reject_content,</if>
|
||||
<if test="visitContent != null and visitContent != ''">visit_content,</if>
|
||||
<if test="cardType != null and cardType != ''">card_type,</if>
|
||||
<if test="cardNo != null and cardNo != ''">card_no,</if>
|
||||
@ -64,6 +66,7 @@
|
||||
<if test="joinTime != null ">#{joinTime},</if>
|
||||
<if test="visitTime != null ">#{visitTime},</if>
|
||||
<if test="customerId != null ">#{customerId},</if>
|
||||
<if test="rejectContent != null ">#{rejectContent},</if>
|
||||
<if test="leaveTime != null ">#{leaveTime},</if>
|
||||
<if test="visitContent != null and visitContent != ''">#{visitContent},</if>
|
||||
<if test="cardType != null and cardType != ''">#{cardType},</if>
|
||||
@ -83,6 +86,7 @@
|
||||
<if test="joinTime != null ">join_time = #{joinTime},</if>
|
||||
<if test="visitTime != null ">visit_time = #{visitTime},</if>
|
||||
<if test="customerId != null ">customer_id = #{customerId},</if>
|
||||
<if test="rejectContent != null ">reject_content = #{rejectContent},</if>
|
||||
<if test="leaveTime != null ">leave_time = #{leaveTime},</if>
|
||||
<if test="visitContent != null and visitContent != ''">visit_content = #{visitContent},</if>
|
||||
<if test="cardType != null and cardType != ''">card_type = #{cardType},</if>
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.ics.common.utils;
|
||||
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.img.ImgUtil;
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.http.HttpUtil;
|
||||
@ -16,7 +17,12 @@ import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.util.ArrayList;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public class DeviceUtils {
|
||||
|
||||
@ -39,6 +45,14 @@ public class DeviceUtils {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public static String openlock(String ip) {
|
||||
String url = ip + "/api/viso/v2/openlock";
|
||||
|
||||
String msg = HttpUtil.post(url,"");
|
||||
log.info("门禁设备信息:{}", msg);
|
||||
return msg;
|
||||
}
|
||||
|
||||
/**
|
||||
*设置激活状态
|
||||
*
|
||||
@ -61,8 +75,8 @@ public class DeviceUtils {
|
||||
/**
|
||||
* 获取设备激活状态
|
||||
*/
|
||||
public static String getActive() {
|
||||
String url = DEVICE_IP + "/api/tmzz/v2/getActive";
|
||||
public static String getActive(String ip) {
|
||||
String url = ip + "/api/tmzz/v2/getActive";
|
||||
|
||||
String msg = HttpUtil.post(url,"");
|
||||
log.info("门禁设备信息:{}", msg);
|
||||
@ -115,12 +129,19 @@ public class DeviceUtils {
|
||||
String url = DEVICE_IP + "/api/viso/v2/addPersons";
|
||||
ArrayList<DevicePersonDto> dtos = new ArrayList<>();
|
||||
DevicePersonsDto devicePersonDto = new DevicePersonsDto();
|
||||
// DevicePersonDto dto = new DevicePersonDto();
|
||||
// dto.setPersonId("010");
|
||||
// dto.setName("张三");
|
||||
// dto.setWorkId("001");
|
||||
// dto.setGender("male");
|
||||
// dto.setAge("30");
|
||||
// DevicePersonDto personDto = new DevicePersonDto();
|
||||
// personDto.setPersonId("013");
|
||||
// personDto.setName("张三");
|
||||
// personDto.setWorkId("001");
|
||||
// personDto.setGender("male");
|
||||
// personDto.setAge("30");
|
||||
// personDto.setCertificateType("111");
|
||||
// personDto.setCertificateNumber("11111");
|
||||
// //添加人员类型
|
||||
// personDto.setPersonType("visitor");
|
||||
// //添加访客时间
|
||||
// personDto.setVisitorValidStartTime("2024-03-12T11:04:40");
|
||||
// personDto.setVisitorValidEndTime("2024-03-14T11:04:40");
|
||||
dtos.add(dto);
|
||||
devicePersonDto.setPersons(dtos);
|
||||
String json = JsonUtils.toJson(devicePersonDto);
|
||||
@ -173,16 +194,70 @@ public class DeviceUtils {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public static String queryPersons(String personId) {
|
||||
String url = DEVICE_IP + "/api/viso/v2/queryPersons";
|
||||
JSONObject param = JSONUtil.createObj();
|
||||
param.put("any", false);
|
||||
param.put("personId", personId);
|
||||
String json = JsonUtils.toJson(param);
|
||||
|
||||
String msg = HttpUtil.post(url,json);
|
||||
log.info("查询人员id:{}", msg);
|
||||
return msg;
|
||||
}
|
||||
|
||||
public static boolean ping(String ipAddress, int pingTimes, int timeOut) {
|
||||
BufferedReader in = null;
|
||||
Runtime r = Runtime.getRuntime(); // 将要执行的ping命令,此命令是windows格式的命令
|
||||
String pingCommand = "ping " + ipAddress + " -n " + pingTimes + " -w " + timeOut;
|
||||
try { // 执行命令并获取输出
|
||||
System.out.println(pingCommand);
|
||||
Process p = r.exec(pingCommand);
|
||||
if (p == null) {
|
||||
return false;
|
||||
}
|
||||
in = new BufferedReader( new InputStreamReader(p.getInputStream())); // 逐行检查输出,计算类似出现=23ms TTL=62字样的次数
|
||||
int connectedCount = 0;
|
||||
String line = null;
|
||||
while ((line = in.readLine()) != null) {
|
||||
connectedCount += getCheckResult(line);
|
||||
} // 如果出现类似=23ms TTL=62这样的字样,出现的次数=测试次数则返回真
|
||||
return connectedCount == pingTimes;
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace(); // 出现异常则返回假
|
||||
return false;
|
||||
} finally {
|
||||
try {
|
||||
in.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
// 若line含有=18ms TTL=16字样,说明已经ping通,返回1,否則返回0.
|
||||
private static int getCheckResult(String line) { // System.out.println("控制台输出的结果为:"+line);
|
||||
Pattern pattern = Pattern.compile("(\\d+ms)(\\s+)(TTL=\\d+)", Pattern.CASE_INSENSITIVE);
|
||||
Matcher matcher = pattern.matcher(line);
|
||||
while (matcher.find()) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
// String s = addPersons();
|
||||
String s = addFaces();
|
||||
String s = addPersons(new DevicePersonDto() );
|
||||
System.out.println(s);
|
||||
|
||||
// List<DateTime> dateTimes = DateUtil.rangeToList(DateUtil.beginOfDay(new Date()), DateUtil.endOfDay(offset), DateField.DAY_OF_MONTH);
|
||||
// String s = queryPersons("10000");
|
||||
//
|
||||
// System.out.println(dateTimes);
|
||||
// JSONObject jsonObject = JSONUtil.parseObj(s);
|
||||
// Integer amount = (Integer) jsonObject.get("amount");
|
||||
// System.out.println(amount);
|
||||
|
||||
// Boolean isHost = ping("192.168.0.12",1,3000);
|
||||
// System.out.println(isHost);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.ics.common.utils;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.IOException;
|
||||
import java.net.InetAddress;
|
||||
import java.net.UnknownHostException;
|
||||
|
||||
@ -43,6 +44,19 @@ public class IpUtils {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
public static Boolean ipDetection(String ipAddress, Integer timeout) {
|
||||
// 当返回值是true时,说明host是可用的,false则不可。
|
||||
boolean status = false;
|
||||
try {
|
||||
status = InetAddress.getByName(ipAddress).isReachable(timeout);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
private static boolean internalIp(byte[] addr) {
|
||||
final byte b0 = addr[0];
|
||||
final byte b1 = addr[1];
|
||||
|
@ -1,8 +1,10 @@
|
||||
package com.ics.common.utils;
|
||||
|
||||
import com.ics.common.core.text.Convert;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.web.context.request.RequestAttributes;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.RequestContextListener;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
@ -29,6 +31,11 @@ public class ServletUtils {
|
||||
return Convert.toStr(getRequest().getParameter(name), defaultValue);
|
||||
}
|
||||
|
||||
|
||||
@Bean
|
||||
public RequestContextListener requestContextListenerBean() {
|
||||
return new RequestContextListener();
|
||||
}
|
||||
/**
|
||||
* 获取Integer参数
|
||||
*/
|
||||
|
@ -0,0 +1,30 @@
|
||||
package com.ics.common.utils.spring;
|
||||
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.ApplicationContextAware;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class BeanContext implements ApplicationContextAware {
|
||||
|
||||
private static ApplicationContext applicationContext;
|
||||
|
||||
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
|
||||
BeanContext.applicationContext = applicationContext;
|
||||
}
|
||||
|
||||
public static ApplicationContext getApplicationContext(){
|
||||
return applicationContext;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public static <T> T getBean(String name) throws BeansException {
|
||||
return (T)applicationContext.getBean(name);
|
||||
}
|
||||
|
||||
public static <T> T getBean(Class<T> clz) throws BeansException {
|
||||
return (T)applicationContext.getBean(clz);
|
||||
}
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package com.ics.common.utils.spring;
|
||||
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.beans.factory.DisposableBean;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.ApplicationContextAware;
|
||||
@ -55,6 +56,16 @@ public class SpringContextHolder implements ApplicationContextAware, DisposableB
|
||||
applicationContext.publishEvent(event);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public static <T> T getBean(String name) throws BeansException {
|
||||
return (T)applicationContext.getBean(name);
|
||||
}
|
||||
|
||||
public static <T> T getBean(Class<T> clz) throws BeansException {
|
||||
return (T)applicationContext.getBean(clz);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 实现DisposableBean接口, 在Context关闭时清理静态变量.
|
||||
*/
|
||||
|
@ -23,7 +23,7 @@ public class MyParkLineHandler implements TenantLineHandler {
|
||||
"sys_job", "sys_job_log", "sys_login_info", "sys_menu", "sys_notice", "sys_oper_log", "sys_oss", "sys_role", "sys_role_dept", "sys_role_menu",
|
||||
"sys_sn", "sys_user_role", "sys_dept", "ics_customer_contract_room", "ics_park", "ics_apply_room", "ics_customer_contract_refund_room", "ics_apply_park_file",
|
||||
"ics_apply_settle_file", "ics_apply_move_in_file", "ics_activity","ics_customer_staff",
|
||||
"tb_room_content","tb_room_item","tb_room_item_by_room"};
|
||||
"tb_room_content","tb_room_item","tb_room_item_by_room,tb_equipment"};
|
||||
|
||||
/**
|
||||
* 多租户标识
|
||||
|
@ -23,7 +23,7 @@ public class MyTenantLineHandler implements TenantLineHandler {
|
||||
"sys_job", "sys_job_log", "sys_login_info", "sys_menu", "sys_notice", "sys_oper_log", "sys_oss", "sys_role_dept", "sys_role_menu",
|
||||
"sys_sn", "sys_user_role", "ics_customer_contract_room", "ics_apply_room", "ics_customer_contract_refund_room", "ics_apply_park_file",
|
||||
"ics_apply_settle_file", "ics_apply_move_in_file", "ics_activity","ics_customer_staff",
|
||||
"tb_room_content","tb_room_item","tb_room_item_by_room"};
|
||||
"tb_room_content","tb_room_item","tb_room_item_by_room,tb_equipment"};
|
||||
|
||||
/**
|
||||
* 多租户标识
|
||||
|
@ -1,11 +1,24 @@
|
||||
package com.ics.controller.mobile.meeting;
|
||||
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.ics.admin.controller.meeting.UserEquipmentController;
|
||||
import com.ics.admin.domain.meeting.Equipment;
|
||||
import com.ics.admin.domain.meeting.RoomRecord;
|
||||
import com.ics.admin.domain.meeting.UserEquipment;
|
||||
import com.ics.admin.domain.meeting.vo.DeviceData;
|
||||
import com.ics.admin.service.meeting.IEquipmentService;
|
||||
import com.ics.admin.service.meeting.IRoomRecordService;
|
||||
import com.ics.admin.service.meeting.IUserEquipmentService;
|
||||
import com.ics.common.core.controller.BaseController;
|
||||
import com.ics.common.core.domain.R;
|
||||
import com.ics.common.core.page.PageDomain;
|
||||
import com.ics.common.core.page.TableSupport;
|
||||
import com.ics.common.json.JsonUtils;
|
||||
import com.ics.common.utils.DeviceUtils;
|
||||
import com.ics.common.utils.IpUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@ -19,22 +32,68 @@ public class ApiEquipmentController extends BaseController {
|
||||
@Autowired
|
||||
private IUserEquipmentService userEquipmentService;
|
||||
|
||||
@Autowired
|
||||
private IEquipmentService equipmentService;
|
||||
|
||||
@Autowired
|
||||
private IRoomRecordService roomRecordService;
|
||||
|
||||
//根据用户id查询对应的设备, 楼层分割,房间,设备信息,
|
||||
@GetMapping("/getEquipmentByUserId/{userId}")
|
||||
public R getEquipmentByUserId(String userId){
|
||||
|
||||
return R.ok().put("data",userEquipmentService.getEquipmentByUserId(userId));
|
||||
|
||||
public R getEquipmentByUserId(@PathVariable("userId") Long userId){
|
||||
List<UserEquipment> equipments = userEquipmentService.getEquipmentByUserId(userId);
|
||||
return R.ok().put("data",equipments);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取对比记录
|
||||
* 开门
|
||||
*/
|
||||
|
||||
@PostMapping("/openDoor")
|
||||
public R openDoor(@RequestBody RoomRecord roomRecord){
|
||||
//判断用户是否有权限开门
|
||||
String ip = equipmentService.selectEquipmentById(roomRecord.getDeviceId()).getIp();
|
||||
String openlock = DeviceUtils.openlock(ip);
|
||||
JSONObject jsonObject = JSONUtil.parseObj(openlock);
|
||||
Integer code = (Integer) jsonObject.get("status");
|
||||
Assert.isTrue(code == 0,"开门失败");
|
||||
|
||||
int i = roomRecordService.insertRoomRecord(roomRecord);
|
||||
Assert.isTrue(i == 1,"开门失败");
|
||||
|
||||
return R.ok("开门成功");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 开门记录
|
||||
*/
|
||||
|
||||
@PostMapping("/getOpenDoorRecord")
|
||||
public R getOpenDoorRecord(@RequestBody RoomRecord roomRecord) {
|
||||
PageDomain pageDomain = TableSupport.buildPageRequest();
|
||||
Integer pageNum = pageDomain.getPageNum();
|
||||
Integer pageSize = pageDomain.getPageSize();
|
||||
IPage<RoomRecord> openDoorRecord = roomRecordService.getOpenDoorRecord(roomRecord, pageNum, pageSize);
|
||||
for (RoomRecord record : openDoorRecord.getRecords()) {
|
||||
Equipment equipment = equipmentService.selectEquipmentById(record.getDeviceId());
|
||||
record.setDeviceName(equipment.getEquipmentName());
|
||||
}
|
||||
return R.ok().put("data",openDoorRecord);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取对比记录 todo 没写完 是否需要人脸对比的数据
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/getEquipmentByUserIdAndEquipmentId")
|
||||
public R getEquipmentByUserIdAndEquipmentId(@RequestBody DeviceData data){
|
||||
|
||||
System.out.println(data);
|
||||
// 对比personId 和用户 id,
|
||||
// 对比equipmentId 和设备id
|
||||
|
||||
|
||||
return R.ok("调用成功");
|
||||
@ -43,4 +102,7 @@ public class ApiEquipmentController extends BaseController {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ package com.ics.controller.mobile.meeting;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.ics.admin.domain.BuildingDetail;
|
||||
import com.ics.admin.domain.IcsCustomerStaff;
|
||||
@ -12,6 +13,7 @@ import com.ics.admin.domain.meeting.*;
|
||||
import com.ics.admin.domain.meeting.vo.MeetingAmountVo;
|
||||
import com.ics.admin.domain.meeting.vo.UserCustomerVo;
|
||||
import com.ics.admin.mapper.meeting.RoomContentMapper;
|
||||
import com.ics.admin.mapper.meeting.RoomEquipmentMapper;
|
||||
import com.ics.admin.service.*;
|
||||
import com.ics.admin.service.meeting.*;
|
||||
import com.ics.common.core.controller.BaseController;
|
||||
@ -66,6 +68,9 @@ public class ApiRoomContentController extends BaseController {
|
||||
@Autowired
|
||||
private IParkService parkService;
|
||||
|
||||
@Autowired
|
||||
private RoomEquipmentMapper roomEquipmentMapper;
|
||||
|
||||
|
||||
/**
|
||||
* 查询条件筛选
|
||||
@ -198,8 +203,10 @@ public class ApiRoomContentController extends BaseController {
|
||||
@GetMapping("selectReservationById/{id}")
|
||||
public R selectReservationById(@PathVariable("id") Long id){
|
||||
Reservation reservation = reservationService.selectReservationById(id);
|
||||
reservation.setStatusValue(reservation.getStauts().getValue());
|
||||
reservation.setStatusName(reservation.getStauts().getName());
|
||||
if (null != reservation){
|
||||
reservation.setStatusValue(reservation.getStauts().getValue());
|
||||
reservation.setStatusName(reservation.getStauts().getName());
|
||||
}
|
||||
IcsCustomerStaff icsCustomerStaff = customerStaffService.selectIcsCustomerStaffById(reservation.getUserId());
|
||||
if(null != icsCustomerStaff){
|
||||
reservation.setUserName(icsCustomerStaff.getUsername());
|
||||
@ -216,6 +223,7 @@ public class ApiRoomContentController extends BaseController {
|
||||
RoomContent roomContent = roomContentMapper.selectById(roomContentId);
|
||||
Room room = roomService.selectRoomById(roomContent.getRoomId());
|
||||
if (room != null) {
|
||||
roomContent.setRoomId(room.getId());
|
||||
roomContent.setTypeValue(roomContent.getType().getValue());
|
||||
roomContent.setTypeName(roomContent.getType().getName());
|
||||
roomContent.setRoomName(room.getName());
|
||||
@ -226,6 +234,13 @@ public class ApiRoomContentController extends BaseController {
|
||||
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());
|
||||
}
|
||||
}
|
||||
reservation.setRoomContent(roomContent);
|
||||
return R.ok().put("data",reservation);
|
||||
|
@ -0,0 +1,149 @@
|
||||
package com.ics.controller.mobile.meeting;
|
||||
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import com.ics.admin.domain.BuildingDetail;
|
||||
import com.ics.admin.domain.Room;
|
||||
import com.ics.admin.domain.meeting.*;
|
||||
import com.ics.admin.service.IBuildingDetailService;
|
||||
import com.ics.admin.service.IRoomService;
|
||||
import com.ics.admin.service.meeting.IShowroomRecordService;
|
||||
import com.ics.admin.service.meeting.IShowroomService;
|
||||
import com.ics.common.core.controller.BaseController;
|
||||
import com.ics.common.core.domain.R;
|
||||
import org.checkerframework.checker.units.qual.A;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.wf.jwtp.annotation.RequiresPermissions;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 展厅管理 提供者
|
||||
*
|
||||
* @author ics
|
||||
* @date 2024-03-12
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/showroom")
|
||||
public class ApiShowroomController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IShowroomService showroomService;
|
||||
|
||||
@Autowired
|
||||
private IRoomService roomService;
|
||||
|
||||
@Autowired
|
||||
private IBuildingDetailService buildingDetailService;
|
||||
|
||||
@Autowired
|
||||
private IShowroomRecordService recordService;
|
||||
|
||||
/**
|
||||
* 查询展厅管理
|
||||
*/
|
||||
@GetMapping("get/{id}")
|
||||
public Showroom get(@PathVariable("id") Long id) {
|
||||
Showroom showroom = showroomService.selectShowroomById(id);
|
||||
if (null != showroom){
|
||||
Room room = roomService.selectRoomById(showroom.getRoomId());
|
||||
if (room != null) {
|
||||
showroom.setRoomName(room.getName());
|
||||
showroom.setArea(String.valueOf(room.getArea()));
|
||||
showroom.setRenArea(room.getRentArea());
|
||||
//查询楼层号
|
||||
BuildingDetail buildingDetail = buildingDetailService.selectBuildingDetailById(room.getBuildingDetailId());
|
||||
if (buildingDetail != null) {
|
||||
showroom.setBuildingName(buildingDetail.getFloorName() +"F");
|
||||
}
|
||||
}
|
||||
}
|
||||
return showroom;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询展厅管理列表
|
||||
*/
|
||||
@PostMapping("list")
|
||||
public R list(@RequestBody Showroom showroom) {
|
||||
List<Showroom> showrooms = showroomService.selectShowroomList(showroom);
|
||||
for (Showroom showroom1 : showrooms) {
|
||||
Room room = roomService.selectRoomById(showroom1.getRoomId());
|
||||
if (room != null) {
|
||||
showroom1.setRoomName(room.getName());
|
||||
//查询楼层号
|
||||
BuildingDetail buildingDetail = buildingDetailService.selectBuildingDetailById(room.getBuildingDetailId());
|
||||
if (buildingDetail != null) {
|
||||
showroom1.setBuildingName(buildingDetail.getFloorName() +"F");
|
||||
}
|
||||
}
|
||||
}
|
||||
return R.ok().put("data",showrooms);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增保存展厅管理
|
||||
*/
|
||||
@PostMapping("save")
|
||||
public R addSave(@RequestBody Showroom showroom) {
|
||||
return toAjax(showroomService.insertShowroom(showroom));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保存展厅管理
|
||||
*/
|
||||
@PostMapping("update")
|
||||
public R editSave(@RequestBody Showroom showroom) {
|
||||
return toAjax(showroomService.updateShowroom(showroom));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除展厅管理
|
||||
*/
|
||||
@PostMapping("remove")
|
||||
public R remove(String ids) {
|
||||
return toAjax(showroomService.deleteShowroomByIds(ids));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询展厅已经预约的记录
|
||||
*/
|
||||
|
||||
@PostMapping("/appointmentRecord")
|
||||
public R appointmentRecord(@RequestBody ShowroomRecord showroomRecord)
|
||||
{
|
||||
List<ShowroomRecordDTO> list = recordService.appointmentRecord(showroomRecord);
|
||||
return R.ok().put("data",list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询空闲的会议室
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/selectFreeShowRoom")
|
||||
public R selectFreeMeetingRoom(@RequestBody ShowroomRecord ShowroomRecord) {
|
||||
boolean count =recordService.selectFreeMeetingRoom(ShowroomRecord);
|
||||
String msg =count?"展厅不可用":"展厅可用";
|
||||
return R.ok().put("count",count).put("msg",msg);
|
||||
}
|
||||
|
||||
/**
|
||||
* 会议预约记录
|
||||
*/
|
||||
@PostMapping("/saveShowRoomRecord")
|
||||
public R saveShowRoomRecord(@RequestBody ShowroomRecord showroomRecord) {
|
||||
//根据用户获取对应的企业id,查询该企业下对应的优惠卷
|
||||
showroomRecord.setReservationNumber(RandomUtil.randomNumbers(8));
|
||||
boolean b = recordService.selectFreeMeetingRoom(showroomRecord);
|
||||
Assert.isFalse(b, "会议室不可用");
|
||||
boolean save = recordService.save(showroomRecord);
|
||||
|
||||
Long id = showroomRecord.getId();
|
||||
return toAjax(save).put("showroomRecord",id);
|
||||
}
|
||||
|
||||
}
|
@ -3,6 +3,10 @@ package com.ics.controller.mobile.meeting;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.core.lang.Validator;
|
||||
import cn.hutool.core.util.IdcardUtil;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.ics.admin.domain.BuildingDetail;
|
||||
import com.ics.admin.domain.Customer;
|
||||
@ -12,6 +16,7 @@ import com.ics.admin.domain.meeting.Reservation;
|
||||
import com.ics.admin.domain.meeting.ReservationPerson;
|
||||
import com.ics.admin.domain.meeting.RoomContent;
|
||||
import com.ics.admin.domain.meeting.VisitorPerson;
|
||||
import com.ics.admin.domain.meeting.vo.VisitorPersonVo;
|
||||
import com.ics.admin.mapper.meeting.RoomContentMapper;
|
||||
import com.ics.admin.service.IBuildingDetailService;
|
||||
import com.ics.admin.service.ICustomerService;
|
||||
@ -29,7 +34,9 @@ import com.ics.common.core.page.TableSupport;
|
||||
import com.ics.common.utils.DeviceUtils;
|
||||
import com.ics.common.utils.UrlToBase64Util;
|
||||
import org.checkerframework.checker.units.qual.A;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@ -90,67 +97,107 @@ public class ApiVisitorController extends BaseController {
|
||||
return result(customers);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* 添加访客预约
|
||||
* 被访客记录
|
||||
*/
|
||||
@PostMapping("visitorPerson")
|
||||
public R selectUserByCustomer(@RequestBody VisitorPerson person) {
|
||||
person.setStatus(0);
|
||||
boolean save = visitorPersonService.save(person);
|
||||
Assert.isTrue(save, "添加访客预约失败");
|
||||
//添加成功后,需要 往设备中添加一条数据
|
||||
DevicePersonDto devicePersonDto = new DevicePersonDto();
|
||||
ArrayList<FacesDto> facesDtos = new ArrayList<>();
|
||||
devicePersonDto.setPersonId(String.valueOf(person.getUserId()));
|
||||
devicePersonDto.setName(person.getName());
|
||||
devicePersonDto.setPhone(String.valueOf(person.getPhone()));
|
||||
devicePersonDto.setCertificateType("111");
|
||||
devicePersonDto.setCertificateNumber(person.getCardNo());
|
||||
//添加人员类型
|
||||
devicePersonDto.setPersonType("visitor");
|
||||
//添加访客时间
|
||||
devicePersonDto.setVisitorValidStartTime(DateUtil.format(person.getVisitTime(), "yyyy-MM-dd HH:mm:ss"));
|
||||
devicePersonDto.setVisitorValidEndTime(DateUtil.format(person.getLeaveTime(), "yyyy-MM-dd HH:mm:ss"));
|
||||
FacesDto facesDto = new FacesDto();
|
||||
facesDto.setFaceId(String.valueOf(person.getUserId()));
|
||||
String faceData =BASE64_PREFIX+ UrlToBase64Util.imageUrlToBase64(person.getPhoto());
|
||||
facesDto.setData(faceData);
|
||||
facesDtos.add(facesDto);
|
||||
devicePersonDto.setFaces(facesDtos);
|
||||
@PostMapping("/selectVisitorRecordByUserId")
|
||||
public R selectVisitorPerson(@RequestBody VisitorPerson visitorPerson1) {
|
||||
PageDomain pageDomain = TableSupport.buildPageRequest();
|
||||
Integer pageNum = pageDomain.getPageNum();
|
||||
Integer pageSize = pageDomain.getPageSize();
|
||||
IPage<VisitorPerson> visitorPersons = visitorPersonService.selectVisitorRecord(visitorPerson1.getUserId(), pageNum, pageSize);
|
||||
for (VisitorPerson visitorPerson : visitorPersons.getRecords()) {
|
||||
if (visitorPerson.getStatus() == 0){
|
||||
visitorPerson.setStatusName("待审核");
|
||||
}else if (visitorPerson.getStatus() == 1){
|
||||
visitorPerson.setStatusName("审核通过");
|
||||
}else if (visitorPerson.getStatus() == 2){
|
||||
visitorPerson.setStatusName("审核拒绝");
|
||||
}
|
||||
|
||||
DeviceUtils.addPersons(devicePersonDto);
|
||||
Long userId = visitorPerson.getUserId();
|
||||
IcsCustomerStaff icsCustomerStaff = customerStaffService.selectIcsCustomerStaffById(userId);
|
||||
visitorPerson.setUserName(icsCustomerStaff.getUsername());
|
||||
visitorPerson.setMobile(icsCustomerStaff.getMobile());
|
||||
Customer customer = customerService.selectCustomerById(visitorPerson.getCustomerId());
|
||||
visitorPerson.setCustomerName(customer.getName());
|
||||
}
|
||||
return R.ok().put("data", visitorPersons);
|
||||
|
||||
|
||||
|
||||
return toAjax(save);
|
||||
}
|
||||
|
||||
/**
|
||||
* 访客记录
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("selectVisitorRecord/{userId}")
|
||||
public R selectVisitorPerson(@PathVariable("userId") Long userId) {
|
||||
List<VisitorPerson> visitorPersons = visitorPersonService.selectVisitorRecord(userId);
|
||||
return result(visitorPersons);
|
||||
@PostMapping("selectVisitorRecordByIntervieweeId")
|
||||
public R selectVisitorRecordByIntervieweeId(@RequestBody VisitorPerson visitorPerson1) {
|
||||
PageDomain pageDomain = TableSupport.buildPageRequest();
|
||||
Integer pageNum = pageDomain.getPageNum();
|
||||
Integer pageSize = pageDomain.getPageSize();
|
||||
|
||||
IPage<VisitorPerson> visitorPersons = visitorPersonService.selectVisitorRecordByIntervieweeId(visitorPerson1.getIntervieweeId(), pageNum, pageSize);
|
||||
for (VisitorPerson visitorPerson : visitorPersons.getRecords()) {
|
||||
if (visitorPerson.getStatus() == 0){
|
||||
visitorPerson.setStatusName("待审核");
|
||||
}else if (visitorPerson.getStatus() == 1){
|
||||
visitorPerson.setStatusName("审核通过");
|
||||
}else if (visitorPerson.getStatus() == 2){
|
||||
visitorPerson.setStatusName("审核拒绝");
|
||||
}
|
||||
|
||||
Long userId = visitorPerson.getUserId();
|
||||
IcsCustomerStaff icsCustomerStaff = customerStaffService.selectIcsCustomerStaffById(userId);
|
||||
visitorPerson.setUserName(icsCustomerStaff.getUsername());
|
||||
visitorPerson.setMobile(icsCustomerStaff.getMobile());
|
||||
Customer customer = customerService.selectCustomerById(visitorPerson.getCustomerId());
|
||||
visitorPerson.setCustomerName(customer.getName());
|
||||
}
|
||||
return R.ok().put("data", visitorPersons);
|
||||
}
|
||||
|
||||
/**
|
||||
* 被访客 记录
|
||||
* @param intervieweeId
|
||||
* @return
|
||||
* 获取访客记录的详情
|
||||
*/
|
||||
@GetMapping("selectVisitorRecordByIntervieweeId/{intervieweeId}")
|
||||
public R selectVisitorRecordByIntervieweeId(@PathVariable("intervieweeId") Long intervieweeId) {
|
||||
List<VisitorPerson> visitorPersons = visitorPersonService.selectVisitorRecordByIntervieweeId(intervieweeId);
|
||||
return result(visitorPersons);
|
||||
@GetMapping("selectVisitorRecordById/{id}")
|
||||
public R selectVisitorRecordById(@PathVariable("id") Long id) {
|
||||
VisitorPerson visitorPerson = visitorPersonService.selectReservationPersonById(id);
|
||||
|
||||
if (visitorPerson.getStatus() == 0){
|
||||
visitorPerson.setStatusName("待审核");
|
||||
}else if (visitorPerson.getStatus() == 1){
|
||||
visitorPerson.setStatusName("审核通过");
|
||||
}else if (visitorPerson.getStatus() == 2){
|
||||
visitorPerson.setStatusName("审核拒绝");
|
||||
}
|
||||
|
||||
Long userId = visitorPerson.getUserId();
|
||||
IcsCustomerStaff icsCustomerStaff = customerStaffService.selectIcsCustomerStaffById(userId);
|
||||
visitorPerson.setUserName(icsCustomerStaff.getUsername());
|
||||
// visitorPerson.setUsername(icsCustomerStaff.getUsername());
|
||||
visitorPerson.setMobile(icsCustomerStaff.getMobile());
|
||||
Customer customer = customerService.selectCustomerById(visitorPerson.getCustomerId());
|
||||
visitorPerson.setCustomerName(customer.getName());
|
||||
|
||||
VisitorPersonVo visitorPersonVO = new VisitorPersonVo();
|
||||
BeanUtils.copyProperties(visitorPerson,visitorPersonVO );
|
||||
visitorPersonVO.setUsername(icsCustomerStaff.getUsername());
|
||||
|
||||
return R.ok().put("data", visitorPersonVO);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 被访人审核功能
|
||||
*/
|
||||
@PostMapping("updateVisitorPersonStatus")
|
||||
public R updateVisitorPersonStatus(@RequestBody VisitorPerson person) {
|
||||
VisitorPerson visitorPerson = visitorPersonService.selectReservationPersonById(person.getId());
|
||||
Assert.isTrue(visitorPerson.getStatus() == 0, "该访客已审核");
|
||||
|
||||
int update = visitorPersonService.updateVisitorPersonStatus(person);
|
||||
return toAjax(update);
|
||||
}
|
||||
@ -165,11 +212,60 @@ public class ApiVisitorController extends BaseController {
|
||||
Integer pageSize = pageDomain.getPageSize();
|
||||
|
||||
IPage<Reservation> list = reservationPersonService.selectListByParticipantId(userId,pageNum,pageSize);
|
||||
|
||||
|
||||
return R.ok().put("page",list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* 添加访客预约
|
||||
*/
|
||||
@PostMapping("visitorPerson")
|
||||
public R visitorPerson(@RequestBody VisitorPerson person) {
|
||||
person.setStatus(0);
|
||||
boolean save = visitorPersonService.save(person);
|
||||
Assert.isTrue(save, "添加访客预约失败");
|
||||
//添加成功后,需要 往设备中添加一条数据
|
||||
String s = DeviceUtils.queryPersons(String.valueOf(person.getIntervieweeId()));
|
||||
JSONObject jsonObject = JSONUtil.parseObj(s);
|
||||
Integer amount = (Integer) jsonObject.get("amount");
|
||||
if (amount > 0){
|
||||
//todo 需要修改 到底是按照访客时间。
|
||||
return toAjax(save);
|
||||
}
|
||||
// Assert.isTrue(IdcardUtil.isValidCard(person.getCardNo()), "身份证格式不正确");
|
||||
// Assert.isTrue(Validator.isPlateNumber(person.getPhone()), "手机号格式不正确");
|
||||
DevicePersonDto devicePersonDto = new DevicePersonDto();
|
||||
ArrayList<FacesDto> facesDtos = new ArrayList<>();
|
||||
devicePersonDto.setPersonId(String.valueOf(person.getIntervieweeId()));
|
||||
devicePersonDto.setName(person.getName());
|
||||
devicePersonDto.setPhone(String.valueOf(person.getPhone()));
|
||||
devicePersonDto.setCertificateType("111");
|
||||
devicePersonDto.setCertificateNumber(person.getCardNo());
|
||||
//添加人员类型
|
||||
devicePersonDto.setPersonType("visitor");
|
||||
//添加访客时间
|
||||
devicePersonDto.setVisitorValidStartTime(DateUtil.format(person.getVisitTime(), "yyyy-MM-dd'T'HH:mm:ss"));
|
||||
devicePersonDto.setVisitorValidEndTime(DateUtil.format(person.getLeaveTime(), "yyyy-MM-dd'T'HH:mm:ss"));
|
||||
FacesDto facesDto = new FacesDto();
|
||||
facesDto.setFaceId(String.valueOf(person.getUserId()));
|
||||
String faceData =BASE64_PREFIX+ UrlToBase64Util.imageUrlToBase64(person.getUrl());
|
||||
facesDto.setData(faceData);
|
||||
facesDtos.add(facesDto);
|
||||
devicePersonDto.setFaces(facesDtos);
|
||||
|
||||
DeviceUtils.addPersons(devicePersonDto);
|
||||
return toAjax(save);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 访客预约记录
|
||||
// */
|
||||
// @GetMapping("/selectVisitorRecordByIntervieweeId/{userId}")
|
||||
// public R selectVisitorRecordByIntervieweeId(@PathVariable Long userId){
|
||||
// List<VisitorPerson> list = visitorPersonService.selectVisitorRecordByIntervieweeId(userId);
|
||||
// return R.ok().put("list", list);
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user