mirror of
https://gitee.com/elegant_wings/xiongan-meeting.git
synced 2025-06-21 04:59:36 +08:00
修改了对应的PC页面
This commit is contained in:
parent
267b06a00c
commit
314b61bf10
@ -2,11 +2,19 @@ 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.RoomEquipment;
|
||||
import com.ics.admin.domain.meeting.RoomRecord;
|
||||
import com.ics.admin.domain.meeting.UserEquipment;
|
||||
import com.ics.admin.service.IBuildingDetailService;
|
||||
import com.ics.admin.service.ICustomerService;
|
||||
import com.ics.admin.service.IIcsCustomerStaffService;
|
||||
import com.ics.admin.service.IRoomService;
|
||||
import com.ics.admin.service.meeting.IRoomEquipmentService;
|
||||
import com.ics.admin.service.meeting.IRoomRecordService;
|
||||
import com.ics.admin.service.meeting.IUserEquipmentService;
|
||||
import com.ics.common.core.domain.IcsCustomerStaff;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
@ -23,6 +31,7 @@ import org.wf.jwtp.annotation.Ignore;
|
||||
import org.wf.jwtp.annotation.RequiresPermissions;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 设备 提供者
|
||||
@ -46,6 +55,18 @@ public class EquipmentController extends BaseController {
|
||||
@Autowired
|
||||
private IRoomService roomService;
|
||||
|
||||
@Autowired
|
||||
private IRoomRecordService roomRecordService;
|
||||
|
||||
@Autowired
|
||||
private IIcsCustomerStaffService staffService;
|
||||
|
||||
@Autowired
|
||||
private ICustomerService customerService;
|
||||
|
||||
@Autowired
|
||||
private IUserEquipmentService userEquipmentService;
|
||||
|
||||
/**
|
||||
* 查询设备
|
||||
*/
|
||||
@ -96,8 +117,6 @@ public class EquipmentController extends BaseController {
|
||||
roomEquipment.setRoomId(equipment.getRoomId());
|
||||
int i1 = roomEquipmentService.insertRoomEquipment(roomEquipment);
|
||||
Assert.isTrue(i1 > 0, "添加失败");
|
||||
|
||||
|
||||
return toAjax(i);
|
||||
}
|
||||
|
||||
@ -123,4 +142,91 @@ public class EquipmentController extends BaseController {
|
||||
return toAjax(equipmentService.deleteEquipmentByIds(ids));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询设备开门记录
|
||||
*/
|
||||
@Ignore
|
||||
@GetMapping("recordByDeviceId/{id}")
|
||||
public R recordByDeviceId(@PathVariable("id") Long id) {
|
||||
RoomRecord record = new RoomRecord();
|
||||
record.setDeviceId(id);
|
||||
List<RoomRecord> roomRecords = roomRecordService.selectRoomRecordList(record);
|
||||
for (RoomRecord roomRecord : roomRecords) {
|
||||
IcsCustomerStaff customerStaff = staffService.selectIcsCustomerStaffById(roomRecord.getUserId());
|
||||
if (null != customerStaff){
|
||||
roomRecord.setUserName(customerStaff.getUsername());
|
||||
}
|
||||
if (roomRecord.getType().equals("1")){
|
||||
roomRecord.setType("扫码开门");
|
||||
}else {
|
||||
roomRecord.setType("远程开门");
|
||||
}
|
||||
}
|
||||
return R.data(roomRecords);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所有的用户
|
||||
*/
|
||||
|
||||
@Ignore
|
||||
@GetMapping("getUserList")
|
||||
public R getUserList(IcsCustomerStaff customerStaff) {
|
||||
System.out.println(customerStaff);
|
||||
|
||||
List<IcsCustomerStaff> icsCustomerStaffs = staffService.selectIcsCustomerStaffList(customerStaff);
|
||||
for (IcsCustomerStaff icsCustomerStaff : icsCustomerStaffs) {
|
||||
Customer customer = customerService.selectCustomerById(icsCustomerStaff.getIcsCustomerId());
|
||||
if (null != customer){
|
||||
icsCustomerStaff.setCustomerName(customer.getName());
|
||||
}
|
||||
}
|
||||
return R.data(icsCustomerStaffs);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所有的用户
|
||||
*/
|
||||
|
||||
@Ignore
|
||||
@GetMapping("getUserListByDeviceId/{id}")
|
||||
public R getUserListByDeviceId(@PathVariable("id") Long id) {
|
||||
|
||||
UserEquipment userEquipment = new UserEquipment();
|
||||
userEquipment.setEquipmentId(id);
|
||||
List<UserEquipment> equipments = userEquipmentService.selectUserEquipmentList(userEquipment);
|
||||
List<Long> userIds = equipments.stream().map(item -> {
|
||||
return item.getUserId();
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
List<IcsCustomerStaff> icsCustomerStaffs = staffService.selectListByUserIds(userIds);
|
||||
for (IcsCustomerStaff icsCustomerStaff : icsCustomerStaffs) {
|
||||
Customer customer = customerService.selectCustomerById(icsCustomerStaff.getIcsCustomerId());
|
||||
if (null != customer){
|
||||
icsCustomerStaff.setCustomerName(customer.getName());
|
||||
}
|
||||
}
|
||||
return R.data(icsCustomerStaffs);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增保存设备
|
||||
*/
|
||||
@Ignore
|
||||
@PostMapping("saveDevice")
|
||||
public R saveDevice(@RequestBody UserEquipment userEquipment) {
|
||||
for (Long id : userEquipment.getUserIds()) {
|
||||
UserEquipment userEquipment1 = new UserEquipment();
|
||||
userEquipment1.setEquipmentId(userEquipment.getId());
|
||||
userEquipment1.setUserId(id);
|
||||
int i = userEquipmentService.insertUserEquipment(userEquipment1);
|
||||
Assert.isTrue(i > 0, "添加失败");
|
||||
|
||||
}
|
||||
return R.data(userEquipment);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package com.ics.admin.controller.meeting;
|
||||
|
||||
import cn.hutool.core.date.DateUnit;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import com.ics.admin.domain.Customer;
|
||||
import com.ics.admin.domain.meeting.RoomContent;
|
||||
import com.ics.admin.service.ICustomerService;
|
||||
@ -58,9 +59,21 @@ public class ReservationController extends BaseController {
|
||||
Reservation reservation = reservationService.selectReservationById(id);
|
||||
Date endDate = reservation.getEndDate();
|
||||
Date startTime = reservation.getStartTime();
|
||||
reservation.setStatusName(reservation.getStauts().getName());
|
||||
long duration = DateUtil.between(startTime, endDate, DateUnit.HOUR);
|
||||
System.out.println(duration);
|
||||
reservation.setDuration(duration);
|
||||
IcsCustomerStaff customerStaff = customerStaffService.selectIcsCustomerStaffById(reservation.getUserId());
|
||||
Assert.isTrue(customerStaff != null, "用户不存在");
|
||||
reservation.setUserName(customerStaff.getUsername());
|
||||
reservation.setPhone(customerStaff.getMobile());
|
||||
RoomContent roomContent = iRoomContentService.selectRoomContentById(reservation.getRoomContentId());
|
||||
roomContent.setTypeName(roomContent.getType().getName());
|
||||
//会议室名称
|
||||
reservation.setRoomContent(roomContent);
|
||||
Customer customer = customerService.selectCustomerById(reservation.getCustomerId());
|
||||
if (null != customer){
|
||||
reservation.setCustomerName(customer.getName());
|
||||
}
|
||||
return reservation;
|
||||
}
|
||||
|
||||
@ -71,6 +84,7 @@ public class ReservationController extends BaseController {
|
||||
@GetMapping("list")
|
||||
public R list(Reservation reservation) {
|
||||
startPage();
|
||||
|
||||
List<Reservation> reservations = reservationService.selectReservationList(reservation);
|
||||
for (Reservation reservation1 : reservations) {
|
||||
RoomContent roomContent = iRoomContentService.selectRoomContentById(reservation1.getRoomContentId());
|
||||
@ -78,22 +92,29 @@ public class ReservationController extends BaseController {
|
||||
//会议室名称
|
||||
reservation1.setRoomContent(roomContent);
|
||||
reservation1.setStatusName(reservation1.getStauts().getName());
|
||||
reservation1.setStatusValue(reservation1.getStauts().getValue());
|
||||
Customer customer = customerService.selectCustomerById(reservation1.getCustomerId());
|
||||
reservation1.setCustomerName(customer.getName());
|
||||
if (null != customer){
|
||||
reservation1.setCustomerName(customer.getName());
|
||||
}
|
||||
IcsCustomerStaff customerStaff = customerStaffService.selectIcsCustomerStaffById(reservation1.getUserId());
|
||||
reservation1.setUserName(customerStaff.getUsername());
|
||||
|
||||
if (null != customerStaff){
|
||||
reservation1.setUserName(customerStaff.getUsername());
|
||||
}
|
||||
}
|
||||
return result(reservations);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增保存预约记录
|
||||
*/
|
||||
@RequiresPermissions("meeting:reservation:add")
|
||||
@PostMapping("save")
|
||||
public R addSave(@RequestBody Reservation reservation) {
|
||||
// todo 需要添加字段
|
||||
reservation.setStauts(Reservation.Status.APPOINTMENT);
|
||||
long currentUserId = this.getLoginStaffId();
|
||||
reservation.setUserId(currentUserId);
|
||||
return toAjax(reservationService.insertReservation(reservation));
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,7 @@
|
||||
package com.ics.admin.controller.meeting;
|
||||
|
||||
import com.ics.admin.service.IIcsCustomerStaffService;
|
||||
import com.ics.common.core.domain.IcsCustomerStaff;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
@ -12,8 +14,11 @@ import com.ics.common.core.domain.R;
|
||||
import com.ics.common.core.controller.BaseController;
|
||||
import com.ics.admin.domain.meeting.ReservationPerson;
|
||||
import com.ics.admin.service.meeting.IReservationPersonService;
|
||||
import org.wf.jwtp.annotation.Ignore;
|
||||
import org.wf.jwtp.annotation.RequiresPermissions;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 预约参观人员 提供者
|
||||
*
|
||||
@ -27,9 +32,13 @@ public class ReservationPersonController extends BaseController {
|
||||
@Autowired
|
||||
private IReservationPersonService reservationPersonService;
|
||||
|
||||
@Autowired
|
||||
private IIcsCustomerStaffService customerStaffService;
|
||||
|
||||
/**
|
||||
* 查询预约参观人员
|
||||
*/
|
||||
@Ignore
|
||||
@GetMapping("get/{id}")
|
||||
public ReservationPerson get(@PathVariable("id") Long id) {
|
||||
return reservationPersonService.selectReservationPersonById(id);
|
||||
@ -42,7 +51,24 @@ public class ReservationPersonController extends BaseController {
|
||||
@GetMapping("list")
|
||||
public R list(ReservationPerson reservationPerson) {
|
||||
startPage();
|
||||
return result(reservationPersonService.selectReservationPersonList(reservationPerson));
|
||||
int num = 0;
|
||||
List<ReservationPerson> reservationPeople = reservationPersonService.selectReservationPersonList(reservationPerson);
|
||||
for (ReservationPerson person : reservationPeople) {
|
||||
IcsCustomerStaff customerStaff = customerStaffService.selectIcsCustomerStaffById(person.getUserId());
|
||||
if (null != customerStaff){
|
||||
person.setUserName(customerStaff.getUsername());
|
||||
}
|
||||
if (person.getStatus().equals("0") ){
|
||||
person.setStatus("未到访");
|
||||
}else {
|
||||
person.setStatus("已到访");
|
||||
num++;
|
||||
}
|
||||
}
|
||||
R result = result(reservationPeople);
|
||||
result.put("actualNum", reservationPeople.size());
|
||||
result.put("attainNum", num);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@ -52,6 +78,8 @@ public class ReservationPersonController extends BaseController {
|
||||
@RequiresPermissions("meeting:person:add")
|
||||
@PostMapping("save")
|
||||
public R addSave(@RequestBody ReservationPerson reservationPerson) {
|
||||
//发起人 和联系电话需要 自己添加
|
||||
|
||||
return toAjax(reservationPersonService.insertReservationPerson(reservationPerson));
|
||||
}
|
||||
|
||||
|
@ -130,6 +130,7 @@ public class RoomContentController extends BaseController {
|
||||
@RequiresPermissions("meeting:roomContent:edit")
|
||||
@PostMapping("update")
|
||||
public R editSave(@RequestBody RoomContent roomContent) {
|
||||
System.out.println(roomContent.getType());;
|
||||
return toAjax(roomContentService.updateRoomContent(roomContent));
|
||||
}
|
||||
|
||||
@ -223,4 +224,12 @@ public class RoomContentController extends BaseController {
|
||||
List<Customer> customers = customerService.selectCustomerList(customer);
|
||||
return result(customers);
|
||||
}
|
||||
|
||||
@Ignore
|
||||
@GetMapping("/roomContentList")
|
||||
public R roomContentList() {
|
||||
|
||||
return R.data(roomContentService.selectRoomContentList(new RoomContent()));
|
||||
}
|
||||
|
||||
}
|
@ -1,5 +1,9 @@
|
||||
package com.ics.admin.controller.meeting;
|
||||
|
||||
import com.ics.admin.domain.BuildingDetail;
|
||||
import com.ics.admin.domain.Room;
|
||||
import com.ics.admin.service.IBuildingDetailService;
|
||||
import com.ics.admin.service.IRoomService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
@ -12,6 +16,7 @@ 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.Ignore;
|
||||
import org.wf.jwtp.annotation.RequiresPermissions;
|
||||
|
||||
/**
|
||||
@ -21,18 +26,34 @@ import org.wf.jwtp.annotation.RequiresPermissions;
|
||||
* @date 2024-03-12
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("showroom")
|
||||
@RequestMapping("/meeting/showroom")
|
||||
public class ShowroomController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IShowroomService showroomService;
|
||||
|
||||
@Autowired
|
||||
private IRoomService roomService;
|
||||
|
||||
@Autowired
|
||||
private IBuildingDetailService buildingDetailService;
|
||||
|
||||
/**
|
||||
* 查询展厅管理
|
||||
*/
|
||||
@Ignore
|
||||
@GetMapping("get/{id}")
|
||||
public Showroom get(@PathVariable("id") Long id) {
|
||||
return showroomService.selectShowroomById(id);
|
||||
Showroom showroom = showroomService.selectShowroomById(id);
|
||||
Long roomId = showroom.getRoomId();
|
||||
Room room = roomService.selectRoomById(roomId);
|
||||
showroom.setBuildId(room.getBuildingDetailId().toString());
|
||||
showroom.setArea(String.valueOf(room.getArea()));
|
||||
showroom.setRoomName(room.getName());
|
||||
BuildingDetail buildingDetail = buildingDetailService.selectBuildingDetailById(room.getBuildingDetailId());
|
||||
showroom.setBuildingName(buildingDetail.getFloorName());
|
||||
|
||||
return showroom;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1,5 +1,14 @@
|
||||
package com.ics.admin.controller.meeting;
|
||||
|
||||
import cn.hutool.core.date.DateUnit;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import com.ics.admin.domain.Customer;
|
||||
import com.ics.admin.domain.meeting.Showroom;
|
||||
import com.ics.admin.service.ICustomerService;
|
||||
import com.ics.admin.service.IIcsCustomerStaffService;
|
||||
import com.ics.admin.service.meeting.IShowroomService;
|
||||
import com.ics.common.core.domain.IcsCustomerStaff;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
@ -12,8 +21,13 @@ 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.Ignore;
|
||||
import org.wf.jwtp.annotation.RequiresPermissions;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
/**
|
||||
* 展厅预约记录 提供者
|
||||
*
|
||||
@ -21,44 +35,82 @@ import org.wf.jwtp.annotation.RequiresPermissions;
|
||||
* @date 2024-03-12
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/showroom/record")
|
||||
@RequestMapping("/meeting/showroomRecord")
|
||||
public class ShowroomRecordController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IShowroomRecordService showroomRecordService;
|
||||
|
||||
@Autowired
|
||||
private IShowroomService showroomService;
|
||||
|
||||
@Autowired
|
||||
private IIcsCustomerStaffService customerStaffService;
|
||||
|
||||
@Autowired
|
||||
private ICustomerService customerService;
|
||||
|
||||
/**
|
||||
* 查询展厅预约记录
|
||||
*/
|
||||
@Ignore
|
||||
@GetMapping("get/{id}")
|
||||
public ShowroomRecord get(@PathVariable("id") Long id) {
|
||||
return showroomRecordService.selectShowroomRecordById(id);
|
||||
ShowroomRecord showroomRecord = showroomRecordService.selectShowroomRecordById(id);
|
||||
|
||||
IcsCustomerStaff customerStaff = customerStaffService.selectIcsCustomerStaffById(showroomRecord.getUserId());
|
||||
if (null != customerStaff){
|
||||
showroomRecord.setUserName(customerStaff.getUsername());
|
||||
showroomRecord.setUserPhone(customerStaff.getMobile());
|
||||
|
||||
Customer customer = customerService.selectCustomerById(customerStaff.getIcsCustomerId());
|
||||
if (null != customer){
|
||||
showroomRecord.setCustomerName(customer.getName());
|
||||
}
|
||||
|
||||
}
|
||||
long duration = DateUtil.between(showroomRecord.getStartTime(), showroomRecord.getEndDate(), DateUnit.HOUR);
|
||||
showroomRecord.setDuration(duration);
|
||||
return showroomRecord;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询展厅预约记录列表
|
||||
*/
|
||||
@RequiresPermissions("meeting:record:list")
|
||||
@RequiresPermissions("meeting:showroomRecord:list")
|
||||
@GetMapping("list")
|
||||
public R list(ShowroomRecord showroomRecord) {
|
||||
startPage();
|
||||
return result(showroomRecordService.selectShowroomRecordList(showroomRecord));
|
||||
List<ShowroomRecord> showroomRecords = showroomRecordService.selectShowroomRecordList(showroomRecord);
|
||||
for (ShowroomRecord record : showroomRecords) {
|
||||
Showroom showroom = showroomService.selectShowroomById(record.getShowroomId());
|
||||
if (null != showroom){
|
||||
record.setShowRoomName(showroom.getMeetingName());
|
||||
}
|
||||
}
|
||||
return result(showroomRecords);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增保存展厅预约记录
|
||||
*/
|
||||
@RequiresPermissions("meeting:record:add")
|
||||
@RequiresPermissions("meeting:showroomRecord:add")
|
||||
@PostMapping("save")
|
||||
public R addSave(@RequestBody ShowroomRecord showroomRecord) {
|
||||
long currentUserId = getLoginStaffId();
|
||||
showroomRecord.setUserId(currentUserId);
|
||||
showroomRecord.setShowroomId(1L);
|
||||
showroomRecord.setCreateTime(new Date());
|
||||
showroomRecord.setStatus(0);
|
||||
showroomRecord.setReservationNumber(RandomUtil.randomNumbers(18));
|
||||
return toAjax(showroomRecordService.insertShowroomRecord(showroomRecord));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保存展厅预约记录
|
||||
*/
|
||||
@RequiresPermissions("meeting:record:edit")
|
||||
@RequiresPermissions("meeting:showroomRecord:edit")
|
||||
@PostMapping("update")
|
||||
public R editSave(@RequestBody ShowroomRecord showroomRecord) {
|
||||
return toAjax(showroomRecordService.updateShowroomRecord(showroomRecord));
|
||||
@ -67,7 +119,7 @@ public class ShowroomRecordController extends BaseController {
|
||||
/**
|
||||
* 删除展厅预约记录
|
||||
*/
|
||||
@RequiresPermissions("meeting:record:remove")
|
||||
@RequiresPermissions("meeting:showroomRecord:remove")
|
||||
@PostMapping("remove")
|
||||
public R remove(String ids) {
|
||||
return toAjax(showroomRecordService.deleteShowroomRecordByIds(ids));
|
||||
|
@ -1,6 +1,11 @@
|
||||
package com.ics.admin.controller.meeting;
|
||||
|
||||
import com.ics.admin.domain.Customer;
|
||||
import com.ics.admin.domain.meeting.RoomRecord;
|
||||
import com.ics.admin.service.ICustomerService;
|
||||
import com.ics.admin.service.IIcsCustomerStaffService;
|
||||
import com.ics.admin.service.meeting.IVisitorPersonService;
|
||||
import com.ics.common.core.domain.IcsCustomerStaff;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
@ -12,8 +17,12 @@ 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.VisitorPerson;
|
||||
import org.wf.jwtp.annotation.Ignore;
|
||||
import org.wf.jwtp.annotation.RequiresPermissions;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 访客预约表 提供者
|
||||
*
|
||||
@ -27,18 +36,40 @@ public class VisitorPersonController extends BaseController {
|
||||
@Autowired
|
||||
private IVisitorPersonService visitorPersonService;
|
||||
|
||||
@Autowired
|
||||
private IIcsCustomerStaffService staffService;
|
||||
|
||||
@Autowired
|
||||
private ICustomerService customerService;
|
||||
|
||||
/**
|
||||
* 查询预约参观人员
|
||||
*/
|
||||
@Ignore
|
||||
@GetMapping("get/{id}")
|
||||
public VisitorPerson get(@PathVariable("id") Long id) {
|
||||
return visitorPersonService.selectReservationPersonById(id);
|
||||
VisitorPerson visitorPerson = visitorPersonService.selectReservationPersonById(id);
|
||||
IcsCustomerStaff customerStaff = staffService.selectIcsCustomerStaffById(visitorPerson.getIntervieweeId());
|
||||
if (null != customerStaff){
|
||||
visitorPerson.setIntervieweeName(customerStaff.getUsername());
|
||||
}
|
||||
IcsCustomerStaff customerStaff1 = staffService.selectIcsCustomerStaffById(visitorPerson.getUserId());
|
||||
if (null != customerStaff1){
|
||||
visitorPerson.setUserName(customerStaff1.getUsername());
|
||||
visitorPerson.setUserPhone(customerStaff1.getMobile());
|
||||
|
||||
}
|
||||
Customer customer = customerService.selectCustomerById(visitorPerson.getCustomerId());
|
||||
if (null != customer){
|
||||
visitorPerson.setCustomerName(customer.getName());
|
||||
}
|
||||
return visitorPerson;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询预约参观人员列表
|
||||
*/
|
||||
@RequiresPermissions("meeting:person:list")
|
||||
@RequiresPermissions("meeting:visitorPerson:list")
|
||||
@GetMapping("list")
|
||||
public R list(VisitorPerson visitorPerson) {
|
||||
startPage();
|
||||
@ -49,7 +80,7 @@ public class VisitorPersonController extends BaseController {
|
||||
/**
|
||||
* 新增保存预约参观人员
|
||||
*/
|
||||
@RequiresPermissions("meeting:person:add")
|
||||
@RequiresPermissions("meeting:visitorPerson:add")
|
||||
@PostMapping("save")
|
||||
public R addSave(@RequestBody VisitorPerson visitorPerson) {
|
||||
return toAjax(visitorPersonService.insertReservationPerson(visitorPerson));
|
||||
@ -58,19 +89,48 @@ public class VisitorPersonController extends BaseController {
|
||||
/**
|
||||
* 修改保存预约参观人员
|
||||
*/
|
||||
@RequiresPermissions("meeting:person:edit")
|
||||
@RequiresPermissions("meeting:visitorPerson:edit")
|
||||
@PostMapping("update")
|
||||
public R editSave(@RequestBody VisitorPerson visitorPerson) {
|
||||
|
||||
if (null != visitorPerson.getStatus()){
|
||||
Integer loginCustomerId = this.getLoginCustomerId();
|
||||
if (loginCustomerId != null){
|
||||
visitorPerson.setReviewers(Long.valueOf(loginCustomerId));
|
||||
visitorPerson.setReviewersTime(new Date());
|
||||
}
|
||||
}
|
||||
|
||||
return toAjax(visitorPersonService.updateReservationPerson(visitorPerson));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除预约参观人员
|
||||
*/
|
||||
@RequiresPermissions("meeting:person:remove")
|
||||
@RequiresPermissions("meeting:visitorPerson:remove")
|
||||
@PostMapping("remove")
|
||||
public R remove(String ids) {
|
||||
return toAjax(visitorPersonService.deleteReservationPersonByIds(ids));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据预约记录查询当前人的进出记录
|
||||
*/
|
||||
@Ignore
|
||||
@GetMapping("getRecordByReservationId/{id}")
|
||||
public R getRecordByReservationId(@PathVariable("id") Long id) {
|
||||
List<RoomRecord> list =visitorPersonService.getRecordByReservationId(id);
|
||||
for (RoomRecord record : list) {
|
||||
IcsCustomerStaff customerStaff1 = staffService.selectIcsCustomerStaffById(record.getUserId());
|
||||
if (null != customerStaff1){
|
||||
record.setUserName(customerStaff1.getUsername());
|
||||
record.setUserPhone(customerStaff1.getMobile());
|
||||
|
||||
}
|
||||
}
|
||||
return R.data(list);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ package com.ics.admin.domain.meeting;
|
||||
import com.baomidou.mybatisplus.annotation.IEnum;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ics.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
@ -140,9 +141,11 @@ public class Reservation extends BaseEntity<Reservation> {
|
||||
private String photographType;
|
||||
|
||||
/** 预约-开始时间 */
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date startTime;
|
||||
|
||||
/** 预约-结束时间 */
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date endDate;
|
||||
|
||||
/** 备注 */
|
||||
|
@ -25,9 +25,13 @@ public class ReservationPerson extends BaseEntity<ReservationPerson> {
|
||||
/** 邀请人id */
|
||||
private Long userId;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String userName;
|
||||
|
||||
/** 参与人id */
|
||||
private Long participantId;
|
||||
|
||||
|
||||
/** 状态 0接受,1拒绝 */
|
||||
private String status;
|
||||
|
||||
|
@ -28,4 +28,12 @@ public class RoomRecord extends BaseEntity<RoomRecord> {
|
||||
/** 用户id */
|
||||
private Long userId;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String userName;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String userPhone;
|
||||
|
||||
private String type;
|
||||
|
||||
}
|
||||
|
@ -72,4 +72,7 @@ public class Showroom extends BaseEntity<Showroom> {
|
||||
@TableField(exist = false)
|
||||
private String buildingName;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String buildId;
|
||||
|
||||
}
|
||||
|
@ -20,6 +20,9 @@ public class ShowroomRecord extends BaseEntity<ShowroomRecord> {
|
||||
/** 会议主体id */
|
||||
private Long showroomId;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String showRoomName;
|
||||
|
||||
/** 用户id */
|
||||
private Long userId;
|
||||
|
||||
@ -29,12 +32,20 @@ public class ShowroomRecord extends BaseEntity<ShowroomRecord> {
|
||||
@TableField(exist = false)
|
||||
private String userPhone;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String customerName;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Long duration;
|
||||
|
||||
/** 主题(会议主题、展厅主题) */
|
||||
private String title;
|
||||
|
||||
/** 预约状态 */
|
||||
private Integer status;
|
||||
|
||||
|
||||
|
||||
/** 预约编号 */
|
||||
private String reservationNumber;
|
||||
|
||||
|
@ -6,6 +6,8 @@ import com.ics.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户设备关联对象 tb_user_equipment
|
||||
*
|
||||
@ -35,4 +37,7 @@ public class UserEquipment extends BaseEntity<UserEquipment> {
|
||||
@TableField(exist = false)
|
||||
private String equipmentStatus;
|
||||
|
||||
@TableField(exist = false)
|
||||
private List<Long> userIds;
|
||||
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ 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_reservation_person
|
||||
@ -17,12 +18,14 @@ import java.util.Date;
|
||||
public class VisitorPerson extends BaseEntity<VisitorPerson> {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 访客id */
|
||||
/** 被访人id */
|
||||
private Long userId;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String userName;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String userPhone;
|
||||
|
||||
|
||||
|
||||
@ -30,13 +33,16 @@ public class VisitorPerson extends BaseEntity<VisitorPerson> {
|
||||
private String mobile;
|
||||
|
||||
|
||||
/** 被访人id */
|
||||
/** 访客id */
|
||||
private Long intervieweeId;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String intervieweeName;
|
||||
|
||||
private Long customerId;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String customerName;
|
||||
private String customerName;
|
||||
|
||||
/** 姓名 */
|
||||
private String name;
|
||||
@ -76,4 +82,11 @@ public class VisitorPerson extends BaseEntity<VisitorPerson> {
|
||||
|
||||
private String rejectContent;
|
||||
|
||||
private Long reviewers;
|
||||
|
||||
private Date reviewersTime;
|
||||
|
||||
@TableField(exist = false)
|
||||
private List<Long> userIds;
|
||||
|
||||
}
|
||||
|
@ -11,4 +11,6 @@ public class UserCustomerVo {
|
||||
|
||||
private String type;
|
||||
|
||||
private Long meetingId;
|
||||
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package com.ics.admin.mapper.meeting;
|
||||
|
||||
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 java.util.List;
|
||||
@ -61,4 +62,6 @@ public interface CustomerTicketMapper extends BaseMapper<CustomerTicket> {
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteCustomerTicketByIds(String[] ids);
|
||||
|
||||
List<CustomerTicket> selectListByCustomerId(UserCustomerVo userCustomerVo);
|
||||
}
|
||||
|
@ -70,4 +70,6 @@ public interface IIcsCustomerStaffService extends IService<IcsCustomerStaff> {
|
||||
IcsCustomerStaff selectUserByOpenid(String openid);
|
||||
|
||||
List<IcsCustomerStaff> selectUserByCustomer(Long customerId);
|
||||
|
||||
List<IcsCustomerStaff> selectListByUserIds(List<Long> userIds);
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.ics.admin.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.ics.admin.mapper.IcsCustomerStaffMapper;
|
||||
import com.ics.admin.service.IIcsCustomerStaffService;
|
||||
@ -106,4 +107,12 @@ public class IcsCustomerStaffServiceImpl extends ServiceImpl<IcsCustomerStaffMap
|
||||
icsCustomerStaff.setIcsCustomerId(id);
|
||||
return icsCustomerStaffMapper.selectIcsCustomerStaffList(icsCustomerStaff);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IcsCustomerStaff> selectListByUserIds(List<Long> userIds) {
|
||||
|
||||
QueryWrapper<IcsCustomerStaff> objectQueryWrapper = new QueryWrapper<>();
|
||||
objectQueryWrapper.in(CollUtil.isNotEmpty(userIds),"id",userIds);
|
||||
return icsCustomerStaffMapper.selectList(objectQueryWrapper);
|
||||
}
|
||||
}
|
||||
|
@ -87,6 +87,7 @@ public class UserEquipmentServiceImpl extends ServiceImpl<UserEquipmentMapper, U
|
||||
@Override
|
||||
public List<UserEquipment> selectUserEquipmentList(UserEquipment userEquipment) {
|
||||
QueryWrapper queryWrapper = new QueryWrapper();
|
||||
queryWrapper.eq("equipment_id",userEquipment.getEquipmentId());
|
||||
return userEquipmentMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
||||
|
@ -1,13 +1,16 @@
|
||||
package com.ics.admin.service.impl.meeting;
|
||||
|
||||
import java.util.ArrayList;
|
||||
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 com.ics.admin.domain.meeting.RoomContent;
|
||||
import com.ics.admin.domain.meeting.Ticket;
|
||||
import com.ics.admin.domain.meeting.vo.UserCustomerVo;
|
||||
import com.ics.admin.mapper.IcsCustomerStaffMapper;
|
||||
import com.ics.admin.mapper.meeting.RoomContentMapper;
|
||||
import com.ics.admin.mapper.meeting.TicketMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -32,6 +35,9 @@ public class CustomerTicketServiceImpl extends ServiceImpl<CustomerTicketMapper,
|
||||
@Autowired
|
||||
private TicketMapper ticketMapper;
|
||||
|
||||
@Autowired
|
||||
private RoomContentMapper roomContentMapper;
|
||||
|
||||
/**
|
||||
* 查询企业优惠卷关联
|
||||
*
|
||||
@ -103,12 +109,13 @@ public class CustomerTicketServiceImpl extends ServiceImpl<CustomerTicketMapper,
|
||||
@Override
|
||||
public List<CustomerTicket> getCustomerTicket(UserCustomerVo userCustomerVo) {
|
||||
|
||||
RoomContent roomContent = roomContentMapper.selectRoomContentById(userCustomerVo.getMeetingId());
|
||||
if (roomContent.getIsTicket() == 1){
|
||||
return new ArrayList<CustomerTicket>();
|
||||
}
|
||||
|
||||
List<CustomerTicket> customerTickets = customerTicketMapper.selectListByCustomerId(userCustomerVo);
|
||||
|
||||
QueryWrapper<CustomerTicket> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("customer_id", userCustomerVo.getCustomerId());
|
||||
wrapper.eq("type", userCustomerVo.getType());
|
||||
wrapper.isNull("staff_id");
|
||||
List<CustomerTicket> customerTickets = customerTicketMapper.selectList(wrapper);
|
||||
for (CustomerTicket customerTicket : customerTickets) {
|
||||
Ticket ticket = ticketMapper.selectById(customerTicket.getTicketId());
|
||||
customerTicket.setTicketName(ticket.getTitle());
|
||||
@ -119,7 +126,6 @@ public class CustomerTicketServiceImpl extends ServiceImpl<CustomerTicketMapper,
|
||||
customerTicket.setDuration(ticket.getDuration());
|
||||
customerTicket.setType(ticket.getType());
|
||||
}
|
||||
|
||||
return customerTickets;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
@ -8,6 +9,9 @@ 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.domain.meeting.RoomRecord;
|
||||
import com.ics.admin.mapper.RoomMapper;
|
||||
import com.ics.admin.mapper.meeting.RoomRecordMapper;
|
||||
import com.ics.admin.service.meeting.IVisitorPersonService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -25,6 +29,9 @@ public class IVisitorPersonServiceImpl extends ServiceImpl<VisitorPersonMapper,
|
||||
@Autowired
|
||||
private VisitorPersonMapper visitorPersonMapper;
|
||||
|
||||
@Autowired
|
||||
private RoomRecordMapper roomRecordMapper;
|
||||
|
||||
/**
|
||||
* 查询预约参观人员
|
||||
*
|
||||
@ -67,6 +74,7 @@ public class IVisitorPersonServiceImpl extends ServiceImpl<VisitorPersonMapper,
|
||||
*/
|
||||
@Override
|
||||
public int updateReservationPerson(VisitorPerson visitorPerson) {
|
||||
System.out.println(visitorPerson);
|
||||
return visitorPersonMapper.updateById(visitorPerson);
|
||||
}
|
||||
|
||||
@ -117,4 +125,22 @@ public class IVisitorPersonServiceImpl extends ServiceImpl<VisitorPersonMapper,
|
||||
public int updateVisitorPersonStatus(VisitorPerson person) {
|
||||
return visitorPersonMapper.updateById(person);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RoomRecord> getRecordByReservationId(Long id) {
|
||||
VisitorPerson visitorPerson = visitorPersonMapper.selectReservationPersonById(id);
|
||||
//获取当前预约记录,根据开始时间和结束时间去查找对应的
|
||||
|
||||
//开始时间
|
||||
Date visitTime = visitorPerson.getVisitTime();
|
||||
//结束时间
|
||||
Date leaveTime = visitorPerson.getLeaveTime();
|
||||
|
||||
|
||||
QueryWrapper<RoomRecord> wrapper = new QueryWrapper<RoomRecord>();
|
||||
wrapper.between("create_time",visitTime,leaveTime);
|
||||
wrapper.eq("user_id",visitorPerson.getIntervieweeId());
|
||||
|
||||
return roomRecordMapper.selectList(wrapper);
|
||||
}
|
||||
}
|
||||
|
@ -71,6 +71,7 @@ public class ReservationPersonServiceImpl extends ServiceImpl<ReservationPersonM
|
||||
@Override
|
||||
public List<ReservationPerson> selectReservationPersonList(ReservationPerson reservationPerson) {
|
||||
QueryWrapper queryWrapper = new QueryWrapper();
|
||||
queryWrapper.eq(null != reservationPerson.getReservationId(),"reservation_id",reservationPerson.getReservationId());
|
||||
return reservationPersonMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
||||
|
@ -71,6 +71,8 @@ public class ReservationServiceImpl extends ServiceImpl<ReservationMapper, Reser
|
||||
@Override
|
||||
public List<Reservation> selectReservationList(Reservation reservation) {
|
||||
QueryWrapper queryWrapper = new QueryWrapper();
|
||||
queryWrapper.like(null != reservation.getTitle(), "title", reservation.getTitle());
|
||||
queryWrapper.eq(null != reservation.getStatusValue(), "stauts", reservation.getStatusValue());
|
||||
return reservationMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
||||
@ -252,6 +254,14 @@ public class ReservationServiceImpl extends ServiceImpl<ReservationMapper, Reser
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Reservation selectByOrderNumber(String outTradeNo) {
|
||||
QueryWrapper<Reservation> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("oder_number",outTradeNo);
|
||||
return reservationMapper.selectOne(queryWrapper);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断一个时间段是否包含另一个时间段,包含:TRUE,不包含:FALSE
|
||||
*
|
||||
|
@ -390,7 +390,9 @@ public class RoomContentServiceImpl extends ServiceImpl<RoomContentMapper, RoomC
|
||||
for (Reservation reservation : reservations) {
|
||||
Long userId = reservation.getUserId();
|
||||
IcsCustomerStaff customerStaff = staffService.selectIcsCustomerStaffById(userId);
|
||||
reservation.setUserName(customerStaff.getUsername());
|
||||
if (null != customerStaff){
|
||||
reservation.setUserName(customerStaff.getUsername());
|
||||
}
|
||||
}
|
||||
return reservations;
|
||||
}
|
||||
|
@ -45,6 +45,7 @@ public class RoomRecordServiceImpl extends ServiceImpl<RoomRecordMapper, RoomRec
|
||||
@Override
|
||||
public List<RoomRecord> selectRoomRecordList(RoomRecord roomRecord) {
|
||||
QueryWrapper queryWrapper = new QueryWrapper();
|
||||
queryWrapper.eq("device_id",roomRecord.getDeviceId());
|
||||
return roomRecordMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
||||
|
@ -68,4 +68,7 @@ public interface IReservationService extends IService<Reservation> {
|
||||
MeetingAmountVo calculateMeetingRoomAmount(Reservation reservation);
|
||||
|
||||
IPage<Reservation> selectReservationListByUserId(Reservation reservation, Integer pageNum, Integer pageSize);
|
||||
|
||||
Reservation selectByOrderNumber(String outTradeNo);
|
||||
|
||||
}
|
||||
|
@ -2,6 +2,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.RoomRecord;
|
||||
import com.ics.admin.domain.meeting.VisitorPerson;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import java.util.List;
|
||||
@ -66,4 +67,6 @@ public interface IVisitorPersonService extends IService<VisitorPerson> {
|
||||
IPage<VisitorPerson> selectVisitorRecordByIntervieweeId(Long intervieweeId, Integer pageNum, Integer pageSize);
|
||||
|
||||
int updateVisitorPersonStatus(VisitorPerson person);
|
||||
|
||||
List<RoomRecord> getRecordByReservationId(Long id);
|
||||
}
|
||||
|
@ -29,7 +29,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<include refid="selectCustomerTicketVo"/>
|
||||
WHERE id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="selectListByCustomerId" resultType="com.ics.admin.domain.meeting.CustomerTicket">
|
||||
select tct.id, tct.customer_id, tct.ticket_id, tct.num, tct.is_verification, tct.create_time,tct.staff_id,tct.type
|
||||
from tb_customer_ticket tct
|
||||
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>
|
||||
|
||||
<insert id="insertCustomerTicket" parameterType="CustomerTicket">
|
||||
INSERT INTO tb_customer_ticket
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
@ -64,13 +64,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
DATE_FORMAT( start_time, '%Y-%m-%d' ) =
|
||||
DATE_FORMAT( NOW(), '%Y-%m-%d' ))
|
||||
and
|
||||
((
|
||||
DATE_FORMAT( start_time, '%Y-%m-%d %H:%i:%S' ) <
|
||||
DATE_FORMAT( NOW(), '%Y-%m-%d %H:%i:%S' ))
|
||||
OR (
|
||||
DATE_FORMAT( end_date, '%Y-%m-%d %H:%i:%S' ) >
|
||||
DATE_FORMAT( NOW(), '%Y-%m-%d %H:%i:%S' )
|
||||
AND DATE_FORMAT( start_time, '%Y-%m-%d %H:%i:%S' ) >
|
||||
((DATE_FORMAT( start_time, '%Y-%m-%d %H:%i:%S' ) <
|
||||
DATE_FORMAT( NOW(), '%Y-%m-%d %H:%i:%S' )
|
||||
and
|
||||
DATE_FORMAT( end_date, '%Y-%m-%d %H:%i:%S' ) >
|
||||
DATE_FORMAT( NOW(), '%Y-%m-%d %H:%i:%S' ))
|
||||
or
|
||||
(
|
||||
DATE_FORMAT( start_time, '%Y-%m-%d %H:%i:%S' ) >
|
||||
DATE_FORMAT( NOW(), '%Y-%m-%d %H:%i:%S' )))
|
||||
and room_content_id =#{id}
|
||||
ORDER BY start_time ASC
|
||||
|
@ -45,6 +45,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="typeValue != null and typeValue != ''"> AND `type`= #{typeValue}</if>
|
||||
<if test="capacityNum != null and capacityNum != ''"> AND capacity_num =#{capacityNum}</if>
|
||||
<if test="shape != null and shape != ''"> AND shape =#{shape}</if>
|
||||
and is_show = 0
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
@ -10,12 +10,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="deviceId" column="device_id" />
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="type" column="type" />
|
||||
<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
|
||||
SELECT id, room_id, device_id, user_id, create_time,`type`, create_by, delete_flag FROM tb_room_record
|
||||
</sql>
|
||||
|
||||
<select id="selectRoomRecordList" parameterType="RoomRecord" resultMap="RoomRecordResult">
|
||||
@ -36,6 +37,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="roomId != null ">room_id,</if>
|
||||
<if test="deviceId != null ">device_id,</if>
|
||||
<if test="userId != null ">user_id,</if>
|
||||
<if test="type != null ">type,</if>
|
||||
<if test="createTime != null ">create_time,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
<if test="deleteFlag != null ">delete_flag,</if>
|
||||
@ -45,6 +47,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="roomId != null ">#{roomId},</if>
|
||||
<if test="deviceId != null ">#{deviceId},</if>
|
||||
<if test="userId != null ">#{userId},</if>
|
||||
<if test="type != null ">#{type},</if>
|
||||
<if test="createTime != null ">#{createTime},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
<if test="deleteFlag != null ">#{deleteFlag},</if>
|
||||
@ -57,6 +60,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<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="type != null ">`type` = #{type},</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>
|
||||
|
@ -16,6 +16,8 @@
|
||||
<result property="rejectContent" column="reject_content"/>
|
||||
<result property="leaveTime" column="leave_time"/>
|
||||
<result property="visitContent" column="visit_content"/>
|
||||
<result property="reviewers" column="reviewers"/>
|
||||
<result property="reviewersTime" column="reviewers_time"/>
|
||||
<result property="cardType" column="card_type"/>
|
||||
<result property="cardNo" column="card_no"/>
|
||||
<result property="status" column="status"/>
|
||||
@ -23,7 +25,7 @@
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectReservationPersonVo">
|
||||
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
|
||||
SELECT id, user_id, interviewee_id, name, phone,reject_content, join_time,reviewers,reviewers_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 +51,8 @@
|
||||
<if test="joinTime != null ">join_time,</if>
|
||||
<if test="visitTime != null ">visit_time,</if>
|
||||
<if test="customerId != null ">customer_id,</if>
|
||||
<if test="reviewers != null ">reviewers,</if>
|
||||
<if test="reviewersTime != null ">reviewers_time,</if>
|
||||
<if test="leaveTime != null ">leave_time,</if>
|
||||
<if test="rejectContent != null ">reject_content,</if>
|
||||
<if test="visitContent != null and visitContent != ''">visit_content,</if>
|
||||
@ -64,6 +68,8 @@
|
||||
<if test="name != null and name != ''">#{name},</if>
|
||||
<if test="phone != null ">#{phone},</if>
|
||||
<if test="joinTime != null ">#{joinTime},</if>
|
||||
<if test="reviewers != null ">#{reviewers},</if>
|
||||
<if test="reviewersTime != null ">#{reviewersTime},</if>
|
||||
<if test="visitTime != null ">#{visitTime},</if>
|
||||
<if test="customerId != null ">#{customerId},</if>
|
||||
<if test="rejectContent != null ">#{rejectContent},</if>
|
||||
@ -86,6 +92,8 @@
|
||||
<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="reviewersTime != null ">reviewers_time = #{reviewersTime},</if>
|
||||
<if test="reviewers != null ">reviewers = #{reviewers},</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>
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.ics.common.core.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
@ -26,6 +27,9 @@ public class IcsCustomerStaff extends BaseEntity<IcsCustomerStaff> {
|
||||
/** 企业客户id */
|
||||
private Long icsCustomerId;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String customerName;
|
||||
|
||||
/** 微信openid */
|
||||
private String openid;
|
||||
|
||||
|
@ -13,6 +13,7 @@ import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.wf.jwtp.annotation.Ignore;
|
||||
import org.wf.jwtp.annotation.Logical;
|
||||
import org.wf.jwtp.annotation.RequiresPermissions;
|
||||
|
||||
@ -61,6 +62,7 @@ public class FileController {
|
||||
/**
|
||||
* 通用上传请求
|
||||
*/
|
||||
@Ignore
|
||||
@RequiresPermissions(value = {"system:account:center","member:center:view"},logical = Logical.OR)
|
||||
@PostMapping("upload")
|
||||
public R upload(MultipartFile file, String originalFilename) {
|
||||
|
@ -158,7 +158,8 @@ public class ApiRoomContentController extends BaseController {
|
||||
@PostMapping("/saveMeetingRecord")
|
||||
public R getMeetingRoomRecord(@RequestBody Reservation reservation) {
|
||||
//根据用户获取对应的企业id,查询该企业下对应的优惠卷
|
||||
reservation.setStauts(Reservation.Status.TO_BE_PAID);
|
||||
reservation.setStauts(Reservation.Status.APPOINTMENT);
|
||||
|
||||
reservation.setOderNumber(RandomUtil.randomNumbers(18));
|
||||
boolean b = reservationService.selectFreeMeetingRoom(reservation);
|
||||
Assert.isFalse(b, "会议室不可用");
|
||||
@ -166,21 +167,20 @@ public class ApiRoomContentController extends BaseController {
|
||||
IcsCustomerStaff customerStaff = customerStaffService.selectIcsCustomerStaffById(reservation.getUserId());
|
||||
Assert.isTrue(customerStaff != null , "用户不存在");
|
||||
|
||||
|
||||
|
||||
WxChatBasePayDto wxChatBasePayDto = new WxChatBasePayDto();
|
||||
wxChatBasePayDto.setDescription("会议室支付");
|
||||
wxChatBasePayDto.setOrderId(reservation.getOderNumber());
|
||||
BigDecimal price = new BigDecimal(reservation.getOrderMoney());
|
||||
wxChatBasePayDto.setPrice(price);
|
||||
wxChatBasePayDto.setNotify(WxNotifyConstants.CASE_PAY_NOTIFY);
|
||||
wxChatBasePayDto.setOpenId(customerStaff.getOpenid());
|
||||
String prepayId = wxPayCommon.wxJsApiPay(wxChatBasePayDto);
|
||||
|
||||
System.out.println("prepayId:"+prepayId);
|
||||
|
||||
reservation.setPrepayId(prepayId);
|
||||
if (price.compareTo(BigDecimal.ZERO) == 1) {
|
||||
WxChatBasePayDto wxChatBasePayDto = new WxChatBasePayDto();
|
||||
wxChatBasePayDto.setDescription("会议室支付");
|
||||
wxChatBasePayDto.setOrderId(reservation.getOderNumber());
|
||||
wxChatBasePayDto.setPrice(price);
|
||||
wxChatBasePayDto.setNotify(WxNotifyConstants.CASE_PAY_NOTIFY);
|
||||
wxChatBasePayDto.setOpenId(customerStaff.getOpenid());
|
||||
String prepayId = wxPayCommon.wxJsApiPay(wxChatBasePayDto);
|
||||
reservation.setPrepayId(prepayId);
|
||||
reservation.setStauts(Reservation.Status.TO_BE_PAID);
|
||||
|
||||
}
|
||||
boolean save = reservationService.save(reservation);
|
||||
|
||||
|
||||
@ -318,6 +318,10 @@ public class ApiRoomContentController extends BaseController {
|
||||
|
||||
reservationPerson.setStatus("1");
|
||||
reservationPerson.setJoinTime(new Date());
|
||||
IcsCustomerStaff customerStaff = customerStaffService.selectIcsCustomerStaffById(reservationPerson.getParticipantId());
|
||||
if (null != customerStaff){
|
||||
reservationPerson.setUserName(customerStaff.getUsername());
|
||||
}
|
||||
int i = reservationPersonService.insertReservationPerson(reservationPerson);
|
||||
if (i > 0){
|
||||
return R.ok("预约成功");
|
||||
@ -345,13 +349,7 @@ public class ApiRoomContentController extends BaseController {
|
||||
Reservation.Status stauts = reservation1.getStauts();
|
||||
System.out.println(stauts);
|
||||
Assert.isFalse(reservation1.getStauts().equals(Reservation.Status.APPOINTMENT),"您已经支付成功,请勿重复支付");
|
||||
|
||||
|
||||
|
||||
// WxChatPayDto wxChatPayDto = wxPayCommon.wxPayCall(prepayId);
|
||||
|
||||
|
||||
|
||||
Assert.notNull(reservation.getId(),"当前预约信息不存在");
|
||||
reservation.setStauts(Reservation.Status.APPOINTMENT);
|
||||
reservation.setOrderTime(new Date());
|
||||
|
@ -7,6 +7,7 @@ import cn.hutool.json.JSONObject;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.ics.admin.domain.Customer;
|
||||
import com.ics.admin.domain.Policy;
|
||||
import com.ics.admin.domain.ServiceBanner;
|
||||
import com.ics.admin.domain.meeting.Reservation;
|
||||
import com.ics.admin.domain.meeting.VisitorPerson;
|
||||
@ -31,6 +32,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
import org.wf.jwtp.annotation.RequiresPermissions;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@ -70,6 +72,9 @@ public class ApiVisitorController extends BaseController {
|
||||
@Autowired
|
||||
private IServiceBannerService bannerService;
|
||||
|
||||
@Autowired
|
||||
private IPolicyService policyService;
|
||||
|
||||
/**
|
||||
* 获取所有的企业
|
||||
*/
|
||||
@ -192,6 +197,9 @@ public class ApiVisitorController extends BaseController {
|
||||
VisitorPerson visitorPerson = visitorPersonService.selectReservationPersonById(person.getId());
|
||||
Assert.isTrue(visitorPerson.getStatus() == 0, "该访客已审核");
|
||||
|
||||
person.setStatus(1);
|
||||
person.setReviewers(person.getUserId());
|
||||
person.setReviewersTime(new Date());
|
||||
int update = visitorPersonService.updateVisitorPersonStatus(person);
|
||||
return toAjax(update);
|
||||
}
|
||||
@ -264,4 +272,13 @@ public class ApiVisitorController extends BaseController {
|
||||
return R.data(bannerService.selectServiceBannerList(new ServiceBanner()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 展示政策
|
||||
*/
|
||||
@RequiresPermissions("member:center:view")
|
||||
@GetMapping("/policy")
|
||||
public R policy(){
|
||||
return R.data(policyService.selectPolicyById(11L));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,6 +1,9 @@
|
||||
package com.ics.controller.mobile.meeting;
|
||||
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import com.google.gson.Gson;
|
||||
import com.ics.admin.domain.meeting.Reservation;
|
||||
import com.ics.admin.service.meeting.IReservationService;
|
||||
import com.ics.controller.mobile.pay.wx.WxPayCallbackUtil;
|
||||
import com.ics.controller.mobile.pay.wx.WxPayCommon;
|
||||
import com.ics.controller.mobile.pay.wx.dto.WxChatBasePayDto;
|
||||
@ -13,6 +16,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@ -32,6 +36,9 @@ public class WxPayController extends BaseController {
|
||||
@Autowired
|
||||
WxPayCallbackUtil wxPayCallbackUtil;
|
||||
|
||||
@Autowired
|
||||
private IReservationService reservationService;
|
||||
|
||||
|
||||
/**
|
||||
* 下载
|
||||
@ -69,9 +76,17 @@ public class WxPayController extends BaseController {
|
||||
//支付成功
|
||||
if (trade_state.equals("SUCCESS")){
|
||||
//编写支付成功后逻辑
|
||||
|
||||
|
||||
|
||||
System.out.println("订单支付后回调");
|
||||
Gson gson = new Gson();
|
||||
System.out.println(gson.toJson(parseParam));
|
||||
Reservation reservation = reservationService.selectByOrderNumber(out_trade_no);
|
||||
Assert.isTrue(reservation != null, "订单不存在");
|
||||
if (reservation.getStauts().equals(Reservation.Status.TO_BE_PAID)){
|
||||
reservation.setStauts(Reservation.Status.APPOINTMENT);
|
||||
reservation.setOrderTime(new Date());
|
||||
int i = reservationService.updateReservation(reservation);
|
||||
Assert.isTrue(i == 1, "更新失败");
|
||||
}
|
||||
}
|
||||
//响应微信
|
||||
returnParam.put("code", "SUCCESS");
|
||||
@ -84,15 +99,19 @@ public class WxPayController extends BaseController {
|
||||
|
||||
|
||||
/**
|
||||
* 订单支付后回调
|
||||
* 商户订单号查询订单
|
||||
*/
|
||||
@PostMapping("wxMerchantOrderQuery")
|
||||
public HashMap wxMerchantOrderQuery(@RequestBody Map<String , String> paramMap) {
|
||||
HashMap<String, String> resultMap = wxPayCommon.wxMerchantOrderQuery(paramMap.get("outTradeNo"));
|
||||
|
||||
HashMap<Object, Object> map = new HashMap<>();
|
||||
// 商户订单号
|
||||
String out_trade_no = resultMap.get("out_trade_no");
|
||||
// 微信支付订单号
|
||||
String transaction_id = resultMap.get("transaction_id");
|
||||
Reservation reservation = reservationService.selectByOrderNumber(out_trade_no);
|
||||
|
||||
// 交易状态
|
||||
// * SUCCESS:支付成功
|
||||
// * REFUND:转入退款
|
||||
@ -102,8 +121,39 @@ public class WxPayController extends BaseController {
|
||||
// * USERPAYING:用户支付中(仅付款码支付会返回)
|
||||
// * PAYERROR:支付失败(仅付款码支付会返回)
|
||||
String trade_state = resultMap.get("trade_state");
|
||||
if (trade_state.equals("SUCCESS")){
|
||||
//更新数据库
|
||||
Assert.isTrue(reservation != null, "订单不存在");
|
||||
reservation.setStauts(Reservation.Status.APPOINTMENT);
|
||||
reservation.setOrderTime(new Date());
|
||||
int i = reservationService.updateReservation(reservation);
|
||||
Assert.isTrue(i == 1, "更新失败");
|
||||
map.put("code", 200);
|
||||
map.put("msg", "支付成功");
|
||||
}else if (trade_state.equals("REFUND")){
|
||||
map.put("code", 500);
|
||||
map.put("msg", "转入退款");
|
||||
}else if (trade_state.equals("NOTPAY")){
|
||||
map.put("code", 500);
|
||||
map.put("msg", "未支付");
|
||||
}else if (trade_state.equals("CLOSED")){
|
||||
map.put("code", 500);
|
||||
map.put("msg", "已关闭");
|
||||
}else if (trade_state.equals("REVOKED")){
|
||||
map.put("code", 500);
|
||||
map.put("msg", "已撤销");
|
||||
}else if (trade_state.equals("USERPAYING")){
|
||||
map.put("code", 500);
|
||||
map.put("msg", "用户支付中");
|
||||
}else if (trade_state.equals("PAYERROR")){
|
||||
map.put("code", 500);
|
||||
map.put("msg", "支付失败");
|
||||
}else {
|
||||
map.put("code", 500);
|
||||
map.put("msg", "支付失败");
|
||||
}
|
||||
|
||||
return R.data(resultMap);
|
||||
return map;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user