修改了对应设备Pc逻辑

This commit is contained in:
chendaze 2024-03-26 16:18:45 +08:00
parent a4a1ee0343
commit 90e556d868
20 changed files with 168 additions and 53 deletions

View File

@ -94,10 +94,12 @@ public class EquipmentController extends BaseController {
for (Equipment equipment2 : equipment1) {
RoomEquipment roomEquipment = roomEquipmentService.selectByEquipmentId(equipment2.getId());
Room room = roomService.selectRoomById(roomEquipment.getRoomId());
equipment2.setBuildId(room.getBuildingId());
equipment2.setBuildId(room.getBuildingDetailId());
equipment2.setRoomName(room.getName());
BuildingDetail buildingDetail = buildingDetailService.selectBuildingDetailById(room.getBuildingDetailId());
equipment2.setBuildName(buildingDetail.getFloorName());
if (buildingDetail != null){
equipment2.setBuildName(buildingDetail.getFloorName());
}
UserEquipment userEquipment = new UserEquipment();
userEquipment.setEquipmentId(equipment2.getId());
List<UserEquipment> equipments = userEquipmentService.selectUserEquipmentList(userEquipment);

View File

@ -9,6 +9,9 @@ import com.ics.admin.service.ICustomerService;
import com.ics.admin.service.IIcsCustomerStaffService;
import com.ics.admin.service.meeting.IRoomContentService;
import com.ics.common.core.domain.IcsCustomerStaff;
import com.ics.system.domain.User;
import com.ics.system.mapper.DictDataMapper;
import com.ics.system.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
@ -49,6 +52,12 @@ public class ReservationController extends BaseController {
@Autowired
private IIcsCustomerStaffService customerStaffService;
@Autowired
private DictDataMapper dictDataMapper;
@Autowired
private IUserService userService;
/**
* 查询预约记录
*/
@ -68,6 +77,8 @@ public class ReservationController extends BaseController {
reservation.setPhone(customerStaff.getMobile());
RoomContent roomContent = iRoomContentService.selectRoomContentById(reservation.getRoomContentId());
// roomContent.setTypeName(roomContent.getType().getName());
String typeName = dictDataMapper.selectDictLabel("meeting_type", String.valueOf(roomContent.getType()));
roomContent.setTypeName(typeName);
//会议室名称
reservation.setRoomContent(roomContent);
Customer customer = customerService.selectCustomerById(reservation.getCustomerId());
@ -88,7 +99,9 @@ public class ReservationController extends BaseController {
List<Reservation> reservations = reservationService.selectReservationList(reservation);
for (Reservation reservation1 : reservations) {
RoomContent roomContent = iRoomContentService.selectRoomContentById(reservation1.getRoomContentId());
// roomContent.setTypeName(roomContent.getType().getName());
String typeName = dictDataMapper.selectDictLabel("meeting_type", String.valueOf(roomContent.getType()));
roomContent.setTypeName(typeName);
//会议室名称
reservation1.setRoomContent(roomContent);
reservation1.setStatusName(reservation1.getStauts().getName());
@ -111,8 +124,11 @@ public class ReservationController extends BaseController {
@RequiresPermissions("meeting:reservation:add")
@PostMapping("save")
public R addSave(@RequestBody Reservation reservation) {
// todo 需要添加字段
reservation.setStauts(Reservation.Status.APPOINTMENT);
long currentUserId1 = this.getCurrentUserId();
User user = userService.selectUserById(currentUserId1);
Assert.isTrue(user.getStaffId() !=null, "当前用户没有绑定小程序用户");
long currentUserId = this.getLoginStaffId();
reservation.setUserId(currentUserId);
return toAjax(reservationService.insertReservation(reservation));

View File

@ -1,7 +1,14 @@
package com.ics.admin.controller.meeting;
import com.ics.admin.domain.meeting.Reservation;
import com.ics.admin.domain.meeting.RoomContent;
import com.ics.admin.domain.meeting.RoomRecord;
import com.ics.admin.service.IIcsCustomerStaffService;
import com.ics.admin.service.meeting.IReservationService;
import com.ics.admin.service.meeting.IRoomContentService;
import com.ics.admin.service.meeting.IRoomRecordService;
import com.ics.common.core.domain.IcsCustomerStaff;
import com.ics.system.mapper.DictDataMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
@ -35,13 +42,34 @@ public class ReservationPersonController extends BaseController {
@Autowired
private IIcsCustomerStaffService customerStaffService;
@Autowired
private IReservationService iReservationService;
@Autowired
private IRoomContentService iRoomContentService;
@Autowired
private DictDataMapper dictDataMapper;
@Autowired
private IRoomRecordService roomRecordService;
/**
* 查询预约参观人员
*/
@Ignore
@GetMapping("get/{id}")
public ReservationPerson get(@PathVariable("id") Long id) {
return reservationPersonService.selectReservationPersonById(id);
ReservationPerson reservationPerson = reservationPersonService.selectReservationPersonById(id);
Reservation reservation = iReservationService.selectReservationById(reservationPerson.getReservationId());
if (null != reservation){
RoomContent roomContent = iRoomContentService.selectRoomContentById(reservationPerson.getReservationId());
String typeName = dictDataMapper.selectDictLabel("meeting_type", String.valueOf(roomContent.getType()));
reservationPerson.setTypeName(typeName);
}
return reservationPerson;
}
/**
@ -58,11 +86,19 @@ public class ReservationPersonController extends BaseController {
if (null != customerStaff){
person.setUserName(customerStaff.getUsername());
}
if (person.getStatus().equals("0") ){
person.setStatus("未到访");
}else {
person.setStatus("已到访");
num++;
//到访时间
Long reservationId = person.getReservationId();
Reservation reservation = iReservationService.selectReservationById(reservationId);
if (null != reservation){
//根据预约时间去查询用户开门时间
RoomRecord roomRecord = roomRecordService.selectTimeByUserId(reservation.getStartTime(),reservation.getEndDate(),person.getParticipantId());
if (null != roomRecord){
person.setStatus("已到访");
person.setVisitTime(roomRecord.getCreateTime());
num++;
}else {
person.setStatus("未到访");
}
}
}
R result = result(reservationPeople);

View File

@ -12,6 +12,7 @@ import com.ics.admin.service.meeting.IRoomContentService;
import com.ics.admin.service.meeting.IRoomItemByRoomService;
import com.ics.admin.service.meeting.IRoomServeByRoomService;
import com.ics.common.core.controller.BaseController;
import com.ics.system.mapper.DictDataMapper;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
@ -58,6 +59,9 @@ public class RoomContentController extends BaseController {
@Autowired
private ICustomerService customerService;
/**
* 查询房间主体内容
*/
@ -66,8 +70,6 @@ public class RoomContentController extends BaseController {
public RoomContent get(@PathVariable("id") Long id) {
RoomContent roomContent = roomContentService.selectRoomContentById(id);
// roomContent.setTypeName(roomContent.getType().getName());
// roomContent.setTypeValue(roomContent.getType().getValue());
Long roomId = roomContent.getRoomId();
Room room = roomService.selectRoomById(roomId);
roomContent.setBuildId(room.getBuildingId());
@ -103,6 +105,7 @@ public class RoomContentController extends BaseController {
if (room != null){
content.setBuildId(room.getBuildingDetailId());
content.setArea(room.getArea());
content.setRoomName(room.getName());
}
}

View File

@ -1,5 +1,6 @@
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.service.IBuildingDetailService;
@ -19,6 +20,8 @@ import com.ics.admin.service.meeting.IShowroomService;
import org.wf.jwtp.annotation.Ignore;
import org.wf.jwtp.annotation.RequiresPermissions;
import java.util.List;
/**
* 展厅管理 提供者
*
@ -47,7 +50,7 @@ public class ShowroomController extends BaseController {
Showroom showroom = showroomService.selectShowroomById(id);
Long roomId = showroom.getRoomId();
Room room = roomService.selectRoomById(roomId);
showroom.setBuildId(room.getBuildingDetailId().toString());
showroom.setBuildId(room.getBuildingDetailId());
showroom.setArea(String.valueOf(room.getArea()));
showroom.setRoomName(room.getName());
BuildingDetail buildingDetail = buildingDetailService.selectBuildingDetailById(room.getBuildingDetailId());
@ -63,7 +66,18 @@ public class ShowroomController extends BaseController {
@GetMapping("list")
public R list(Showroom showroom) {
startPage();
return result(showroomService.selectShowroomList(showroom));
List<Showroom> showrooms = showroomService.selectShowroomList(showroom);
for (Showroom showroom1 : showrooms) {
Long roomId = showroom1.getRoomId();
Room room = roomService.selectRoomById(roomId);
if (null != room){
showroom1.setBuildId(room.getBuildingDetailId());
showroom1.setRoomName(room.getName());
}
}
return result(showrooms);
}
@ -73,6 +87,15 @@ public class ShowroomController extends BaseController {
@RequiresPermissions("meeting:showroom:add")
@PostMapping("save")
public R addSave(@RequestBody Showroom showroom) {
List<Showroom> showrooms = showroomService.selectShowroomList(showroom);
Assert.isTrue(showrooms.size() == 0, "该展厅已存在");
showroom.setId(1L);
Room room = roomService.selectRoomById(showroom.getRoomId());
room.setStatus(Room.Status.YES);
int i1 = roomService.updateRoom(room);
Assert.isTrue(i1 > 0, "修改房间已租状态失败");
return toAjax(showroomService.insertShowroom(showroom));
}

View File

@ -102,7 +102,7 @@ public class ShowroomRecordController extends BaseController {
showroomRecord.setUserId(currentUserId);
showroomRecord.setShowroomId(1L);
showroomRecord.setCreateTime(new Date());
showroomRecord.setStatus(0);
showroomRecord.setStatus(1);
showroomRecord.setReservationNumber(RandomUtil.randomNumbers(18));
return toAjax(showroomRecordService.insertShowroomRecord(showroomRecord));
}

View File

@ -25,10 +25,7 @@ import com.ics.admin.service.meeting.ITicketService;
import org.wf.jwtp.annotation.Ignore;
import org.wf.jwtp.annotation.RequiresPermissions;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
@ -67,19 +64,25 @@ public class TicketController extends BaseController {
List<Customer> customerList = new ArrayList<>();
List<Customer> selectList = new ArrayList<>();
List<CustomerTicket> customerTickets = customerTicketService.selectListByTicketId(id);
Map<Long, Customer> customerMap = customers.stream().collect(Collectors.toMap(Customer::getId, Function.identity()));
for (CustomerTicket customerTicket : customerTickets) {
Optional<CustomerTicket> min = customerTickets.stream()
.min(Comparator.comparing(CustomerTicket::getNum));
ticket.setNum(min.get().getNum());
Map<Long, CustomerTicket> customerMap = customerTickets.stream().collect(Collectors.toMap(CustomerTicket::getCustomerId, Function.identity()));
for (Customer customer : customers) {
//根据外层遍历的学信息id get学生住宿信息Map中的Key
Customer customer = customerMap.get(customerTicket.getCustomerId());
CustomerTicket customerTicket = customerMap.get(customer.getId());
//如果能get到数据!=null 说明id一样
if (customer != null) {
if (customerTicket != null) {
selectList.add(customer);
}else {
customerList.add(customer);
}
}
ticket.setSelectCustomerList(selectList);
for (Customer customer : selectList) {
int count = customerTicketService.selectByTicketIdAndCustomer(id,customer.getId());
customer.setSumNum(count);
}
ticket.setNotSelectCustomerList(customerList);
return ticket;
@ -92,7 +95,9 @@ public class TicketController extends BaseController {
@GetMapping("list")
public R list(Ticket ticket) {
startPage();
return result(ticketService.selectTicketList(ticket));
List<Ticket> tickets = ticketService.selectTicketList(ticket);
return result(tickets);
}
@ -116,6 +121,7 @@ public class TicketController extends BaseController {
customerTicket1.setTicketId(ticket.getId());
customerTicket1.setCustomerId(ticketCustomerVo.getId());
customerTicket1.setIsVerification(0);
customerTicket1.setType(ticket.getType());
customerTicketService.insertCustomerTicket(customerTicket1);
}
}
@ -127,6 +133,7 @@ public class TicketController extends BaseController {
customerTicket1.setTicketId(ticket.getId());
customerTicket1.setCustomerId(ticketCustomerVo.getId());
customerTicket1.setIsVerification(0);
customerTicket1.setType(ticket.getType());
customerTicketService.insertCustomerTicket(customerTicket1);
}
}
@ -146,10 +153,6 @@ public class TicketController extends BaseController {
//修改企业和优惠卷数据 如果类型是 抵用卷循环添加如果是优惠卷添加一条
CustomerTicket customerTicket = customerTicketService.selectCustomerTicketById(ticket.getId());
// if (ticket.getType() == 1){
// for (int j = 0; j < ticket.get; j++) {
//
// }
if (customerTicket ==null){
if (ticket.getType() == 1) {
for (TicketCustomerVo ticketCustomerVo : ticket.getTicketCustomerVo()) {
@ -159,35 +162,21 @@ public class TicketController extends BaseController {
customerTicket1.setTicketId(ticket.getId());
customerTicket1.setCustomerId(ticketCustomerVo.getId());
customerTicket1.setIsVerification(0);
customerTicket1.setType(ticket.getType());
customerTicketService.insertCustomerTicket(customerTicket1);
}
}
// for (Long enterpriseId : ticket.getEnterpriseIds()) {
// // 循环数量
// CustomerTicket customerTicket1 = new CustomerTicket();
// customerTicket1.setTicketId(ticket.getId());
// customerTicket1.setCustomerId(enterpriseId);
// customerTicket1.setIsVerification(0);
// customerTicketService.insertCustomerTicket(customerTicket1);
// }
}else {
for (TicketCustomerVo ticketCustomerVo : ticket.getTicketCustomerVo()) {
for (int j = 0; j < ticketCustomerVo.getSumNum(); j++) {
CustomerTicket customerTicket1 = new CustomerTicket();
customerTicket1.setTicketId(ticket.getId());
customerTicket1.setCustomerId(ticketCustomerVo.getId());
customerTicket1.setIsVerification(0);
customerTicket1.setType(ticket.getType());
customerTicketService.insertCustomerTicket(customerTicket1);
}
}
// for (Long enterpriseId : ticket.getEnterpriseIds()) {
// CustomerTicket customerTicket1 = new CustomerTicket();
// customerTicket1.setTicketId(ticket.getId());
// customerTicket1.setCustomerId(enterpriseId);
// customerTicket1.setIsVerification(0);
// customerTicketService.insertCustomerTicket(customerTicket1);
// }
}
}

View File

@ -175,6 +175,12 @@ public class Customer extends BaseEntity<Customer> {
*/
private Process process;
@TableField(exist = false)
private Integer count;
@TableField(exist = false)
private Integer sumNum;
/**
* 过程管理
*/

View File

@ -50,6 +50,9 @@ public class CustomerTicket extends BaseEntity<CustomerTicket> {
@TableField(exist = false)
private Integer duration;
@TableField(exist = false)
private String discount;
private Integer type;
}

View File

@ -50,4 +50,10 @@ public class ReservationPerson extends BaseEntity<ReservationPerson> {
@TableField(exist = false)
private List<Reservation> reservation;
@TableField(exist = false)
private String typeName;
@TableField(exist = false)
private Date visitTime;
}

View File

@ -73,6 +73,6 @@ public class Showroom extends BaseEntity<Showroom> {
private String buildingName;
@TableField(exist = false)
private String buildId;
private Long buildId;
}

View File

@ -4,6 +4,7 @@ import com.ics.admin.domain.meeting.CustomerTicket;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ics.admin.domain.meeting.vo.UserCustomerVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -66,4 +67,6 @@ public interface CustomerTicketMapper extends BaseMapper<CustomerTicket> {
List<CustomerTicket> selectListByCustomerId(UserCustomerVo userCustomerVo);
List<CustomerTicket> selectListByTicketId(Long id);
int selectByTicketIdAndCustomer(@Param("id") Long id,@Param("customerId") Long customerId);
}

View File

@ -125,6 +125,7 @@ public class CustomerTicketServiceImpl extends ServiceImpl<CustomerTicketMapper,
customerTicket.setContent(ticket.getContent());
customerTicket.setDuration(ticket.getDuration());
customerTicket.setType(ticket.getType());
customerTicket.setDiscount(ticket.getDiscount());
}
return customerTickets;
}
@ -155,4 +156,9 @@ public class CustomerTicketServiceImpl extends ServiceImpl<CustomerTicketMapper,
}
@Override
public int selectByTicketIdAndCustomer(Long id, Long customerId) {
return customerTicketMapper.selectByTicketIdAndCustomer(id, customerId);
}
}

View File

@ -1,5 +1,6 @@
package com.ics.admin.service.impl.meeting;
import java.util.Date;
import java.util.List;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
@ -106,4 +107,15 @@ public class RoomRecordServiceImpl extends ServiceImpl<RoomRecordMapper, RoomRec
return roomRecordMapper.selectPage(pages,queryWrapper);
}
@Override
public RoomRecord selectTimeByUserId(Date startTime, Date endTime, Long participantId) {
QueryWrapper<RoomRecord> queryWrapper = new QueryWrapper<>();
queryWrapper.between("create_time", startTime,endTime);
queryWrapper.eq("user_id", participantId);
queryWrapper.orderByDesc("create_time");
queryWrapper.last("LIMIT 1");
return roomRecordMapper.selectOne(queryWrapper);
}
}

View File

@ -112,7 +112,7 @@ public class ShowroomRecordServiceImpl extends ServiceImpl<ShowroomRecordMapper,
showroomRecordDTO.setNowDate(DateUtil.format(dateTime,"yyyy-MM-dd"));
// 查询会议室记录
QueryWrapper<ShowroomRecord> wrapper = new QueryWrapper<>();
wrapper.eq("showroom_id",1L);
wrapper.eq("showroom_id",5L);
wrapper.gt("start_time", DateUtil.format(dateTime,"yyyy-MM-dd")+ " 00:00:00");
wrapper.lt("end_date",DateUtil.format(dateTime,"yyyy-MM-dd") + " 23:59:59");
List<ShowroomRecord> showroomRecords = showroomRecordMapper.selectList(wrapper);
@ -129,7 +129,7 @@ public class ShowroomRecordServiceImpl extends ServiceImpl<ShowroomRecordMapper,
QueryWrapper<ShowroomRecord> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("showroom_id",1L);
queryWrapper.eq("showroom_id",5L);
Date startTime = showroomRecord.getStartTime();
Date endDate = showroomRecord.getEndDate();

View File

@ -68,4 +68,6 @@ public interface ICustomerTicketService extends IService<CustomerTicket> {
List<CustomerTicket> selectCustomerTicketByTicketId(Long id);
List<CustomerTicket> selectListByTicketId(Long id);
int selectByTicketIdAndCustomer(Long id, Long id1);
}

View File

@ -3,6 +3,8 @@ 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.Date;
import java.util.List;
/**
@ -61,4 +63,7 @@ public interface IRoomRecordService extends IService<RoomRecord> {
int deleteRoomRecordById(Long id);
IPage<RoomRecord> getOpenDoorRecord(RoomRecord roomRecord, Integer pageNum, Integer pageSize);
RoomRecord selectTimeByUserId(Date startTime,Date endTime, Long participantId);
}

View File

@ -35,13 +35,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join tb_ticket tt on tct.ticket_id = tt.id
where tct.customer_id = #{customerId}
and tct.is_verification = 0
and tct.type =#{type}
and tct.staff_id is null
and tt.is_show = 0
group by tct.ticket_id
</select>
<select id="selectListByTicketId" resultMap="CustomerTicketResult">
select customer_id,count(1) from tb_customer_ticket where ticket_id = #{id} GROUP BY customer_id
select customer_id,count(1) as num from tb_customer_ticket where ticket_id = #{id} GROUP BY customer_id
</select>
<select id="selectByTicketIdAndCustomer" resultType="java.lang.Integer">
select count(1) as num from tb_customer_ticket where ticket_id = #{id} and customer_id =#{customerId} GROUP BY customer_id
</select>
<insert id="insertCustomerTicket" parameterType="CustomerTicket">

View File

@ -320,7 +320,7 @@ public class ApiRoomContentController extends BaseController {
reservationPerson.setJoinTime(new Date());
IcsCustomerStaff customerStaff = customerStaffService.selectIcsCustomerStaffById(reservationPerson.getParticipantId());
if (null != customerStaff){
reservationPerson.setUserName(customerStaff.getUsername());
reservationPerson.setParticipantName(customerStaff.getUsername());
}
int i = reservationPersonService.insertReservationPerson(reservationPerson);
if (i > 0){

View File

@ -159,7 +159,7 @@ public class ApiShowroomController extends BaseController {
showroomRecord.setReservationNumber(RandomUtil.randomNumbers(8));
boolean b = recordService.selectFreeMeetingRoom(showroomRecord);
Assert.isFalse(b, "会议室不可用");
showroomRecord.setStatus(0);
showroomRecord.setStatus(1);
showroomRecord.setCreateTime(new Date());
boolean save = recordService.save(showroomRecord);