mirror of
https://gitee.com/elegant_wings/xiongan-meeting.git
synced 2025-06-21 04:59:36 +08:00
修改了对应的bug
This commit is contained in:
parent
90e556d868
commit
c9a969ddbd
@ -1,7 +1,9 @@
|
||||
package com.ics.admin.controller;
|
||||
|
||||
import com.ics.admin.domain.Building;
|
||||
import com.ics.admin.domain.Park;
|
||||
import com.ics.admin.service.IBuildingService;
|
||||
import com.ics.admin.service.IParkService;
|
||||
import com.ics.common.core.controller.BaseController;
|
||||
import com.ics.common.core.domain.R;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -21,6 +23,9 @@ public class BuildingController extends BaseController {
|
||||
@Autowired
|
||||
private IBuildingService buildingService;
|
||||
|
||||
@Autowired
|
||||
private IParkService parkService;
|
||||
|
||||
|
||||
/**
|
||||
* 查询楼宇管理
|
||||
@ -49,6 +54,8 @@ public class BuildingController extends BaseController {
|
||||
@RequiresPermissions("admin:building:add")
|
||||
@PostMapping("save")
|
||||
public R addSave(@RequestBody Building building) {
|
||||
// Park park = parkService.getById(1L);
|
||||
building.setParkId(1L);
|
||||
return toAjax(buildingService.insertBuilding(building));
|
||||
}
|
||||
|
||||
|
@ -1,11 +1,16 @@
|
||||
package com.ics.admin.controller;
|
||||
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.ics.admin.domain.Customer;
|
||||
import com.ics.admin.domain.Park;
|
||||
import com.ics.admin.domain.Room;
|
||||
import com.ics.admin.service.ICustomerService;
|
||||
import com.ics.admin.service.IIcsCustomerStaffService;
|
||||
import com.ics.admin.service.IParkService;
|
||||
import com.ics.admin.service.IRoomService;
|
||||
import com.ics.common.constant.Constants;
|
||||
import com.ics.common.core.controller.BaseController;
|
||||
import com.ics.common.core.domain.IcsCustomerStaff;
|
||||
@ -38,6 +43,12 @@ public class CustomerController extends BaseController {
|
||||
@Autowired
|
||||
private IIcsCustomerStaffService icsCustomerStaffService;
|
||||
|
||||
@Autowired
|
||||
private IParkService parkService;
|
||||
|
||||
@Autowired
|
||||
private IRoomService roomService;
|
||||
|
||||
|
||||
/**
|
||||
* app的key值
|
||||
@ -85,7 +96,13 @@ public class CustomerController extends BaseController {
|
||||
@RequiresPermissions("admin:customer:view")
|
||||
@GetMapping("get/{id}")
|
||||
public Customer get(@PathVariable("id") Long id) {
|
||||
return customerService.selectCustomerById(id);
|
||||
|
||||
Customer customer = customerService.selectCustomerById(id);
|
||||
Room room = roomService.selectRoomById(customer.getRoomId());
|
||||
if (room != null){
|
||||
customer.setRoomName(room.getName());
|
||||
}
|
||||
return customer;
|
||||
|
||||
}
|
||||
|
||||
@ -107,8 +124,18 @@ public class CustomerController extends BaseController {
|
||||
@GetMapping("allList")
|
||||
public R allList(Customer customer) {
|
||||
List<Customer> customerList = customerService.selectCustomerList(customer);
|
||||
|
||||
|
||||
|
||||
|
||||
List<Map> customerMaps = Lists.newArrayList();
|
||||
for (Customer item : customerList) {
|
||||
|
||||
Long roomId = item.getRoomId();
|
||||
|
||||
|
||||
|
||||
|
||||
Map<String, Object> customerMap = Maps.newHashMap();
|
||||
getCustomerMap(customerMap, item);
|
||||
customerMaps.add(customerMap);
|
||||
@ -154,9 +181,19 @@ public class CustomerController extends BaseController {
|
||||
// if (User.isAdmin(getCurrentUserId())) {
|
||||
// return R.error("不允许超级管理员用户新增");
|
||||
// }
|
||||
|
||||
|
||||
customer.setParkId(1L);
|
||||
customer.setTenantId(1L);
|
||||
ValidatorUtils.validateEntity(customer);
|
||||
customer.setCreateBy(getLoginName());
|
||||
return toAjax(customerService.insertCustomer(customer));
|
||||
int i = customerService.insertCustomer(customer);
|
||||
//如果新增成功,把房间的状态改为已启用
|
||||
Room room = roomService.selectRoomById(customer.getRoomId());
|
||||
room.setStatus(Room.Status.YES);
|
||||
int i1 = roomService.updateRoom(room);
|
||||
Assert.isTrue(i1 > 0, "修改房间已租状态失败");
|
||||
return toAjax(i);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -168,6 +205,8 @@ public class CustomerController extends BaseController {
|
||||
// if (User.isAdmin(getCurrentUserId())) {
|
||||
// return R.error("不允许超级管理员用户修改");
|
||||
// }
|
||||
customer.setParkId(1L);
|
||||
customer.setTenantId(1L);
|
||||
ValidatorUtils.validateEntity(customer);
|
||||
customer.setUpdateBy(getLoginName());
|
||||
return toAjax(customerService.updateCustomer(customer));
|
||||
|
@ -1,7 +1,17 @@
|
||||
package com.ics.admin.controller;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import com.ics.admin.domain.Customer;
|
||||
import com.ics.admin.domain.Room;
|
||||
import com.ics.admin.domain.meeting.*;
|
||||
import com.ics.admin.service.ICustomerService;
|
||||
import com.ics.admin.service.IIcsCustomerStaffService;
|
||||
import com.ics.admin.service.IRoomService;
|
||||
import com.ics.admin.service.meeting.IDetailEquipmentService;
|
||||
import com.ics.admin.service.meeting.IRoomContentService;
|
||||
import com.ics.admin.service.meeting.IRoomEquipmentService;
|
||||
import com.ics.admin.service.meeting.IUserEquipmentService;
|
||||
import com.ics.common.constant.Constants;
|
||||
import com.ics.common.core.controller.BaseController;
|
||||
import com.ics.common.core.domain.IcsCustomerStaff;
|
||||
@ -13,6 +23,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
import org.wf.jwtp.annotation.Ignore;
|
||||
import org.wf.jwtp.annotation.RequiresPermissions;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@ -33,6 +44,23 @@ public class CustomerStaffController extends BaseController {
|
||||
@Autowired
|
||||
private IUserService userService;
|
||||
|
||||
@Autowired
|
||||
private ICustomerService customerService;
|
||||
|
||||
@Autowired
|
||||
private IRoomContentService roomContentService;
|
||||
@Autowired
|
||||
private IRoomService roomService;
|
||||
|
||||
@Autowired
|
||||
private IRoomEquipmentService roomEquipmentService;
|
||||
|
||||
@Autowired
|
||||
private IDetailEquipmentService detailEquipmentService;
|
||||
|
||||
@Autowired
|
||||
private IUserEquipmentService userEquipmentService;
|
||||
|
||||
/**
|
||||
* 查询企业员工
|
||||
*/
|
||||
@ -101,17 +129,10 @@ public class CustomerStaffController extends BaseController {
|
||||
@PostMapping("save")
|
||||
public R addSave(@RequestBody IcsCustomerStaff icsCustomerStaff) {
|
||||
|
||||
Long customerId = getLoginCustomerId();
|
||||
icsCustomerStaff.setIcsCustomerId(customerId);
|
||||
icsCustomerStaff.setCreateTime(new Date());
|
||||
icsCustomerStaff.setCreateBy(getLoginName());
|
||||
icsCustomerStaff.setDataType(Constants.CUSTOMER_STAFF);
|
||||
User user = userService.selectUserByMobile(icsCustomerStaff.getMobile());
|
||||
int i = icsCustomerStaffService.insertIcsCustomerStaff(icsCustomerStaff);
|
||||
if(i>0){
|
||||
user.setStaffId(icsCustomerStaff.getId());
|
||||
userService.updateUser(user);
|
||||
}
|
||||
return toAjax(i);
|
||||
}
|
||||
|
||||
@ -121,15 +142,84 @@ public class CustomerStaffController extends BaseController {
|
||||
@Ignore
|
||||
@PostMapping("update")
|
||||
public R editSave(@RequestBody IcsCustomerStaff icsCustomerStaff) {
|
||||
IcsCustomerStaff customerStaff = icsCustomerStaffService.selectIcsCustomerStaffById(icsCustomerStaff.getId());
|
||||
Assert.isTrue(null !=customerStaff , "用户不存在,请联系管理员");
|
||||
|
||||
customerStaff.setIcsCustomerId(Long.valueOf(icsCustomerStaff.getCustomerId()));
|
||||
|
||||
icsCustomerStaff.setUpdateTime(new Date());
|
||||
// icsCustomerStaff.setUpdateBy(getLoginName());
|
||||
return toAjax(icsCustomerStaffService.updateIcsCustomerStaff(icsCustomerStaff));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增企业员工
|
||||
* @param icsCustomerStaff
|
||||
* @return
|
||||
*/
|
||||
@Ignore
|
||||
@PostMapping("updateStaff")
|
||||
public R updateStaff(@RequestBody IcsCustomerStaff icsCustomerStaff) {
|
||||
IcsCustomerStaff customerStaff = icsCustomerStaffService.selectIcsCustomerStaffById(Long.valueOf(icsCustomerStaff.getMobile()));
|
||||
if (customerStaff != null) {
|
||||
customerStaff.setIcsCustomerId(Long.valueOf(icsCustomerStaff.getCustomerId()));
|
||||
ArrayList<Long> ids = new ArrayList<>();
|
||||
|
||||
|
||||
//根据企业id 查询对应的房间
|
||||
Customer customer = customerService.selectCustomerById(Long.valueOf(icsCustomerStaff.getCustomerId()));
|
||||
|
||||
if (customer !=null ){
|
||||
Room room = roomService.selectRoomById(customer.getRoomId());
|
||||
if (null != room) {
|
||||
Long id = room.getId();
|
||||
RoomEquipment roomEquipment = roomEquipmentService.selectByRoomId(id);
|
||||
if (null != roomEquipment) {
|
||||
ids.add(roomEquipment.getEquipmentId());
|
||||
}
|
||||
List<DetailEquipment> detailEquipments = detailEquipmentService.selectByRoomId(id);
|
||||
if (CollUtil.isNotEmpty(detailEquipments)) {
|
||||
for (DetailEquipment detailEquipment : detailEquipments) {
|
||||
ids.add(detailEquipment.getEquipmentId());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (CollUtil.isNotEmpty(ids)) {
|
||||
for (Long id : ids) {
|
||||
UserEquipment equipment = userEquipmentService.selectUserAndEquipment(Long.valueOf(icsCustomerStaff.getMobile()), id);
|
||||
if (null == equipment) {
|
||||
UserEquipment userEquipment = new UserEquipment();
|
||||
userEquipment.setEquipmentId(id);
|
||||
userEquipment.setUserId(Long.valueOf(icsCustomerStaff.getMobile()));
|
||||
userEquipment.setStartTime(customer.getStartDate());
|
||||
userEquipment.setEndDate(customer.getEndDate());
|
||||
userEquipmentService.insertUserEquipment(userEquipment);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
customerStaff.setUpdateTime(new Date());
|
||||
return toAjax(icsCustomerStaffService.updateIcsCustomerStaff(customerStaff));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除企业员工
|
||||
* @param icsCustomerStaff
|
||||
* @return
|
||||
*/
|
||||
@Ignore
|
||||
@PostMapping("updateStaffByCustomer")
|
||||
public R updateStaffByCustomer(@RequestBody IcsCustomerStaff icsCustomerStaff) {
|
||||
IcsCustomerStaff customerStaff = icsCustomerStaffService.selectIcsCustomerStaffById(Long.valueOf(icsCustomerStaff.getId()));
|
||||
|
||||
customerStaff.setUpdateTime(new Date());
|
||||
return toAjax(icsCustomerStaffService.updateByCustomer(customerStaff));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 删除企业员工
|
||||
*/
|
||||
|
@ -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.DetailEquipment;
|
||||
import com.ics.admin.service.meeting.IDetailEquipmentService;
|
||||
import org.wf.jwtp.annotation.RequiresPermissions;
|
||||
|
||||
/**
|
||||
* 楼层与设备关联 提供者
|
||||
*
|
||||
* @author ics
|
||||
* @date 2024-03-27
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("equipment")
|
||||
public class DetailEquipmentController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IDetailEquipmentService detailEquipmentService;
|
||||
|
||||
/**
|
||||
* 查询楼层与设备关联
|
||||
*/
|
||||
@GetMapping("get/{id}")
|
||||
public DetailEquipment get(@PathVariable("id") Long id) {
|
||||
return detailEquipmentService.selectDetailEquipmentById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询楼层与设备关联列表
|
||||
*/
|
||||
@RequiresPermissions("meeting:equipment:list")
|
||||
@GetMapping("list")
|
||||
public R list(DetailEquipment detailEquipment) {
|
||||
startPage();
|
||||
return result(detailEquipmentService.selectDetailEquipmentList(detailEquipment));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增保存楼层与设备关联
|
||||
*/
|
||||
@RequiresPermissions("meeting:equipment:add")
|
||||
@PostMapping("save")
|
||||
public R addSave(@RequestBody DetailEquipment detailEquipment) {
|
||||
return toAjax(detailEquipmentService.insertDetailEquipment(detailEquipment));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保存楼层与设备关联
|
||||
*/
|
||||
@RequiresPermissions("meeting:equipment:edit")
|
||||
@PostMapping("update")
|
||||
public R editSave(@RequestBody DetailEquipment detailEquipment) {
|
||||
return toAjax(detailEquipmentService.updateDetailEquipment(detailEquipment));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除楼层与设备关联
|
||||
*/
|
||||
@RequiresPermissions("meeting:equipment:remove")
|
||||
@PostMapping("remove")
|
||||
public R remove(String ids) {
|
||||
return toAjax(detailEquipmentService.deleteDetailEquipmentByIds(ids));
|
||||
}
|
||||
|
||||
}
|
@ -4,16 +4,12 @@ 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.domain.meeting.*;
|
||||
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.admin.service.meeting.*;
|
||||
import com.ics.common.core.domain.IcsCustomerStaff;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@ -25,8 +21,6 @@ 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.Equipment;
|
||||
import com.ics.admin.service.meeting.IEquipmentService;
|
||||
import org.wf.jwtp.annotation.Ignore;
|
||||
import org.wf.jwtp.annotation.RequiresPermissions;
|
||||
|
||||
@ -67,6 +61,9 @@ public class EquipmentController extends BaseController {
|
||||
@Autowired
|
||||
private IUserEquipmentService userEquipmentService;
|
||||
|
||||
@Autowired
|
||||
private IDetailEquipmentService detailEquipmentService;
|
||||
|
||||
/**
|
||||
* 查询设备
|
||||
*/
|
||||
@ -93,12 +90,15 @@ public class EquipmentController extends BaseController {
|
||||
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.getBuildingDetailId());
|
||||
equipment2.setRoomName(room.getName());
|
||||
BuildingDetail buildingDetail = buildingDetailService.selectBuildingDetailById(room.getBuildingDetailId());
|
||||
if (buildingDetail != null){
|
||||
equipment2.setBuildName(buildingDetail.getFloorName());
|
||||
if (roomEquipment != null){
|
||||
Room room = roomService.selectRoomById(roomEquipment.getRoomId());
|
||||
equipment2.setRoomId(room.getId());
|
||||
equipment2.setBuildId(room.getBuildingDetailId());
|
||||
equipment2.setRoomName(room.getName());
|
||||
BuildingDetail buildingDetail = buildingDetailService.selectBuildingDetailById(room.getBuildingDetailId());
|
||||
if (buildingDetail != null){
|
||||
equipment2.setBuildName(buildingDetail.getFloorName());
|
||||
}
|
||||
}
|
||||
UserEquipment userEquipment = new UserEquipment();
|
||||
userEquipment.setEquipmentId(equipment2.getId());
|
||||
@ -118,11 +118,23 @@ public class EquipmentController extends BaseController {
|
||||
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, "添加失败");
|
||||
|
||||
|
||||
if (equipment.getRoomId() != null){
|
||||
RoomEquipment roomEquipment = new RoomEquipment();
|
||||
roomEquipment.setEquipmentId(equipment.getId());
|
||||
roomEquipment.setRoomId(equipment.getRoomId());
|
||||
int i1 = roomEquipmentService.insertRoomEquipment(roomEquipment);
|
||||
Assert.isTrue(i1 > 0, "添加失败");
|
||||
}else {
|
||||
DetailEquipment detailEquipment = new DetailEquipment();
|
||||
detailEquipment.setEquipmentId(equipment.getId());
|
||||
detailEquipment.setBuildingDetailId(equipment.getBuildId());
|
||||
int i1 = detailEquipmentService.insertDetailEquipment(detailEquipment);
|
||||
Assert.isTrue(i1 > 0, "添加失败");
|
||||
}
|
||||
|
||||
|
||||
return toAjax(i);
|
||||
}
|
||||
|
||||
@ -132,10 +144,34 @@ 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);
|
||||
|
||||
if (equipment.getRoomId() != null){
|
||||
RoomEquipment roomEquipment = new RoomEquipment();
|
||||
roomEquipment.setEquipmentId(equipment.getId());
|
||||
roomEquipment.setRoomId(equipment.getRoomId());
|
||||
|
||||
RoomEquipment roomEquipment1 =roomEquipmentService.selectByEquipmentId(equipment.getId());
|
||||
if (null != roomEquipment1){
|
||||
roomEquipment1.setRoomId(equipment.getRoomId());
|
||||
int i1 = roomEquipmentService.updateRoomEquipment(roomEquipment1);
|
||||
Assert.isTrue(i1 > 0, "修改失败");
|
||||
}
|
||||
}else {
|
||||
DetailEquipment detailEquipment = new DetailEquipment();
|
||||
detailEquipment.setEquipmentId(equipment.getId());
|
||||
detailEquipment.setBuildingDetailId(equipment.getBuildId());
|
||||
DetailEquipment detailEquipment1 = detailEquipmentService.selectByEquipmentId(equipment.getId());
|
||||
if (null != detailEquipment1){
|
||||
detailEquipment1.setBuildingDetailId(equipment.getBuildId());
|
||||
int i1 = detailEquipmentService.insertDetailEquipment(detailEquipment1);
|
||||
Assert.isTrue(i1 > 0, "修改失败");
|
||||
}
|
||||
|
||||
}
|
||||
// RoomEquipment roomEquipment = new RoomEquipment();
|
||||
// roomEquipment.setEquipmentId(equipment.getId());
|
||||
// roomEquipment.setRoomId(equipment.getRoomId());
|
||||
// roomEquipmentService.updateRoomEquipment(roomEquipment);
|
||||
return toAjax(equipmentService.updateEquipment(equipment));
|
||||
}
|
||||
|
||||
@ -224,9 +260,10 @@ public class EquipmentController extends BaseController {
|
||||
@PostMapping("saveDevice")
|
||||
public R saveDevice(@RequestBody UserEquipment userEquipment) {
|
||||
|
||||
int count = userEquipmentService.deleteUserEquipmentByEquipmentId(userEquipment.getId());
|
||||
Assert.isTrue(count>0 , "删除失败");
|
||||
|
||||
if (userEquipment.getId() !=null ){
|
||||
int count = userEquipmentService.deleteUserEquipmentByEquipmentId(userEquipment.getId());
|
||||
Assert.isTrue(count>0 , "删除失败");
|
||||
}
|
||||
|
||||
for (Long id : userEquipment.getUserIds()) {
|
||||
UserEquipment userEquipment1 = new UserEquipment();
|
||||
@ -240,5 +277,13 @@ public class EquipmentController extends BaseController {
|
||||
return R.data(userEquipment);
|
||||
}
|
||||
|
||||
@Ignore
|
||||
@GetMapping("/getRoomList")
|
||||
public R list(Room room) {
|
||||
room.setDeleteFlag(0);
|
||||
room.setBuildingDetailId(room.getBuildingDetailId());
|
||||
return R.ok().put("data",roomService.selectRoomList(room));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -86,6 +86,11 @@ public class ReservationPersonController extends BaseController {
|
||||
if (null != customerStaff){
|
||||
person.setUserName(customerStaff.getUsername());
|
||||
}
|
||||
IcsCustomerStaff participant = customerStaffService.selectIcsCustomerStaffById(person.getParticipantId());
|
||||
if (null != participant){
|
||||
person.setAvatar(participant.getAvatar());
|
||||
}
|
||||
|
||||
//到访时间
|
||||
Long reservationId = person.getReservationId();
|
||||
Reservation reservation = iReservationService.selectReservationById(reservationId);
|
||||
|
@ -66,7 +66,9 @@ public class TicketController extends BaseController {
|
||||
List<CustomerTicket> customerTickets = customerTicketService.selectListByTicketId(id);
|
||||
Optional<CustomerTicket> min = customerTickets.stream()
|
||||
.min(Comparator.comparing(CustomerTicket::getNum));
|
||||
ticket.setNum(min.get().getNum());
|
||||
if (ticket.getType() == 1){
|
||||
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
|
||||
|
@ -333,6 +333,14 @@ public class Customer extends BaseEntity<Customer> {
|
||||
*/
|
||||
private String channelName;
|
||||
|
||||
|
||||
private Long buildId;
|
||||
|
||||
private Long roomId;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String roomName;
|
||||
|
||||
/**
|
||||
* 是否黑名单(0-否,1-是)
|
||||
*/
|
||||
@ -371,13 +379,13 @@ public class Customer extends BaseEntity<Customer> {
|
||||
/**
|
||||
* 成立日期
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date startDate;
|
||||
|
||||
/**
|
||||
* 登记机关
|
||||
*/
|
||||
@NotBlank(message = "登记机关不能为空")
|
||||
// @NotBlank(message = "登记机关不能为空")
|
||||
private String belongOrg;
|
||||
|
||||
/**
|
||||
@ -388,12 +396,13 @@ public class Customer extends BaseEntity<Customer> {
|
||||
/**
|
||||
* 注销日期
|
||||
*/
|
||||
private String endDate;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date endDate;
|
||||
|
||||
/**
|
||||
* 注册地址
|
||||
*/
|
||||
@NotBlank(message = "注册地址不能为空")
|
||||
// @NotBlank(message = "注册地址不能为空")
|
||||
private String address;
|
||||
|
||||
/**
|
||||
@ -401,6 +410,8 @@ public class Customer extends BaseEntity<Customer> {
|
||||
*/
|
||||
private String scope;
|
||||
|
||||
private Long parkId;
|
||||
|
||||
/**
|
||||
* 关联园区
|
||||
*/
|
||||
|
@ -0,0 +1,24 @@
|
||||
package com.ics.admin.domain.meeting;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.ics.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 楼层与设备关联对象 tb_detail_equipment
|
||||
*
|
||||
* @author ics
|
||||
* @date 2024-03-27
|
||||
*/
|
||||
@Data
|
||||
@TableName("tb_detail_equipment")
|
||||
public class DetailEquipment extends BaseEntity<DetailEquipment> {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 设备id */
|
||||
private Long equipmentId;
|
||||
|
||||
/** 房间id */
|
||||
private Long buildingDetailId;
|
||||
|
||||
}
|
@ -38,6 +38,7 @@ public class Equipment extends BaseEntity<Equipment> {
|
||||
|
||||
private String ip;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Long roomId;
|
||||
|
||||
@TableField(exist = false)
|
||||
|
@ -56,4 +56,7 @@ public class ReservationPerson extends BaseEntity<ReservationPerson> {
|
||||
@TableField(exist = false)
|
||||
private Date visitTime;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String avatar;
|
||||
|
||||
}
|
||||
|
@ -83,6 +83,8 @@ public class RoomContent extends BaseEntity<RoomContent> {
|
||||
/** 会议描述 */
|
||||
private String content;
|
||||
|
||||
private String remake;
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -6,6 +6,7 @@ import com.ics.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -29,6 +30,10 @@ public class UserEquipment extends BaseEntity<UserEquipment> {
|
||||
/** 设备id */
|
||||
private Long equipmentId;
|
||||
|
||||
private Date startTime;
|
||||
|
||||
private Date endDate;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String roomName;
|
||||
|
||||
|
@ -70,4 +70,7 @@ public interface IcsCustomerStaffMapper extends BaseMapper<IcsCustomerStaff> {
|
||||
String checkMobileUnique(@Param("mobile") String mobile);
|
||||
|
||||
IcsCustomerStaff selectUserByOpenid(String openid);
|
||||
|
||||
int updateByCustomer(IcsCustomerStaff customerStaff);
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,64 @@
|
||||
package com.ics.admin.mapper.meeting;
|
||||
|
||||
import com.ics.admin.domain.meeting.DetailEquipment;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 楼层与设备关联Mapper接口
|
||||
*
|
||||
* @author ics
|
||||
* @date 2024-03-27
|
||||
*/
|
||||
@Mapper
|
||||
public interface DetailEquipmentMapper extends BaseMapper<DetailEquipment> {
|
||||
/**
|
||||
* 查询楼层与设备关联
|
||||
*
|
||||
* @param id 楼层与设备关联ID
|
||||
* @return 楼层与设备关联
|
||||
*/
|
||||
DetailEquipment selectDetailEquipmentById(Long id);
|
||||
|
||||
/**
|
||||
* 查询楼层与设备关联列表
|
||||
*
|
||||
* @param detailEquipment 楼层与设备关联
|
||||
* @return 楼层与设备关联集合
|
||||
*/
|
||||
List<DetailEquipment> selectDetailEquipmentList(DetailEquipment detailEquipment);
|
||||
|
||||
/**
|
||||
* 新增楼层与设备关联
|
||||
*
|
||||
* @param detailEquipment 楼层与设备关联
|
||||
* @return 结果
|
||||
*/
|
||||
int insertDetailEquipment(DetailEquipment detailEquipment);
|
||||
|
||||
/**
|
||||
* 修改楼层与设备关联
|
||||
*
|
||||
* @param detailEquipment 楼层与设备关联
|
||||
* @return 结果
|
||||
*/
|
||||
int updateDetailEquipment(DetailEquipment detailEquipment);
|
||||
|
||||
/**
|
||||
* 删除楼层与设备关联
|
||||
*
|
||||
* @param id 楼层与设备关联ID
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteDetailEquipmentById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除楼层与设备关联
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteDetailEquipmentByIds(String[] ids);
|
||||
}
|
@ -79,4 +79,5 @@ public interface IIcsCustomerStaffService extends IService<IcsCustomerStaff> {
|
||||
|
||||
IcsCustomerStaff selectByPhone(String mobile);
|
||||
|
||||
int updateByCustomer(IcsCustomerStaff customerStaff);
|
||||
}
|
||||
|
@ -56,6 +56,7 @@ public class IcsCustomerStaffServiceImpl extends ServiceImpl<IcsCustomerStaffMap
|
||||
* @param icsCustomerStaff 企业员工
|
||||
* @return 结果
|
||||
*/
|
||||
|
||||
@Override
|
||||
public int insertIcsCustomerStaff(IcsCustomerStaff icsCustomerStaff) {
|
||||
return icsCustomerStaffMapper.insert(icsCustomerStaff);
|
||||
@ -150,4 +151,10 @@ public class IcsCustomerStaffServiceImpl extends ServiceImpl<IcsCustomerStaffMap
|
||||
|
||||
return icsCustomerStaffMapper.selectOne(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateByCustomer(IcsCustomerStaff customerStaff) {
|
||||
|
||||
return icsCustomerStaffMapper.updateByCustomer(customerStaff);
|
||||
}
|
||||
}
|
||||
|
@ -106,4 +106,21 @@ public class RoomEquipmentServiceImpl extends ServiceImpl<RoomEquipmentMapper, R
|
||||
wrapper.eq("room_id",roomId);
|
||||
return roomEquipmentMapper.selectOne(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RoomEquipment selectByEquipmentIdAndRoomId(RoomEquipment roomEquipment) {
|
||||
|
||||
QueryWrapper<RoomEquipment> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("room_id",roomEquipment.getRoomId());
|
||||
wrapper.eq("equipment_id",roomEquipment.getEquipmentId());
|
||||
return roomEquipmentMapper.selectOne(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RoomEquipment selectByRoomId(Long id) {
|
||||
|
||||
QueryWrapper<RoomEquipment> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("room_id",id);
|
||||
return roomEquipmentMapper.selectOne(wrapper);
|
||||
}
|
||||
}
|
||||
|
@ -89,6 +89,7 @@ public class UserEquipmentServiceImpl extends ServiceImpl<UserEquipmentMapper, U
|
||||
public List<UserEquipment> selectUserEquipmentList(UserEquipment userEquipment) {
|
||||
QueryWrapper queryWrapper = new QueryWrapper();
|
||||
queryWrapper.eq("equipment_id",userEquipment.getEquipmentId());
|
||||
queryWrapper.eq("user_id",userEquipment.getUserId());
|
||||
return userEquipmentMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
||||
@ -183,6 +184,15 @@ public class UserEquipmentServiceImpl extends ServiceImpl<UserEquipmentMapper, U
|
||||
return userEquipmentMapper.delete(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public UserEquipment selectUserAndEquipment(Long userId, Long id) {
|
||||
|
||||
QueryWrapper<UserEquipment> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("equipment_id", id);
|
||||
wrapper.eq("user_id", userId);
|
||||
return userEquipmentMapper.selectOne(wrapper);
|
||||
}
|
||||
|
||||
|
||||
public void updateDeviceDataSource(List<Equipment> equipments) {
|
||||
RequestAttributes requestAttributes = RequestContextHolder.getRequestAttributes();
|
||||
|
@ -0,0 +1,109 @@
|
||||
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.DetailEquipmentMapper;
|
||||
import com.ics.admin.domain.meeting.DetailEquipment;
|
||||
import com.ics.admin.service.meeting.IDetailEquipmentService;
|
||||
|
||||
/**
|
||||
* 楼层与设备关联Service业务层处理
|
||||
*
|
||||
* @author ics
|
||||
* @date 2024-03-27
|
||||
*/
|
||||
@Service
|
||||
public class DetailEquipmentServiceImpl extends ServiceImpl<DetailEquipmentMapper, DetailEquipment> implements IDetailEquipmentService {
|
||||
@Autowired
|
||||
private DetailEquipmentMapper detailEquipmentMapper;
|
||||
|
||||
/**
|
||||
* 查询楼层与设备关联
|
||||
*
|
||||
* @param id 楼层与设备关联ID
|
||||
* @return 楼层与设备关联
|
||||
*/
|
||||
@Override
|
||||
public DetailEquipment selectDetailEquipmentById(Long id) {
|
||||
return detailEquipmentMapper.selectById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询楼层与设备关联列表
|
||||
*
|
||||
* @param detailEquipment 楼层与设备关联
|
||||
* @return 楼层与设备关联
|
||||
*/
|
||||
@Override
|
||||
public List<DetailEquipment> selectDetailEquipmentList(DetailEquipment detailEquipment) {
|
||||
QueryWrapper queryWrapper = new QueryWrapper();
|
||||
return detailEquipmentMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增楼层与设备关联
|
||||
*
|
||||
* @param detailEquipment 楼层与设备关联
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertDetailEquipment(DetailEquipment detailEquipment) {
|
||||
return detailEquipmentMapper.insert(detailEquipment);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改楼层与设备关联
|
||||
*
|
||||
* @param detailEquipment 楼层与设备关联
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateDetailEquipment(DetailEquipment detailEquipment) {
|
||||
return detailEquipmentMapper.updateById(detailEquipment);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除楼层与设备关联对象
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDetailEquipmentByIds(String ids) {
|
||||
String[] idsArray = StrUtil.split(ids,",");
|
||||
return detailEquipmentMapper.deleteBatchIds(CollUtil.toList(idsArray));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除楼层与设备关联信息
|
||||
*
|
||||
* @param id 楼层与设备关联ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDetailEquipmentById(Long id) {
|
||||
return detailEquipmentMapper.deleteDetailEquipmentById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DetailEquipment selectByEquipmentId(Long id) {
|
||||
|
||||
QueryWrapper<DetailEquipment> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("equipment_id", id);
|
||||
DetailEquipment detailEquipment = detailEquipmentMapper.selectOne(queryWrapper);
|
||||
return detailEquipment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DetailEquipment> selectByRoomId(Long id) {
|
||||
|
||||
QueryWrapper<DetailEquipment> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("building_detail_id", id);
|
||||
return detailEquipmentMapper.selectList(queryWrapper);
|
||||
}
|
||||
}
|
@ -1,11 +1,14 @@
|
||||
package com.ics.admin.service.impl.meeting;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.date.DateUnit;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
@ -73,6 +76,7 @@ public class ReservationServiceImpl extends ServiceImpl<ReservationMapper, Reser
|
||||
QueryWrapper queryWrapper = new QueryWrapper();
|
||||
queryWrapper.like(null != reservation.getTitle(), "title", reservation.getTitle());
|
||||
queryWrapper.eq(null != reservation.getStatusValue(), "stauts", reservation.getStatusValue());
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
return reservationMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
||||
@ -165,7 +169,7 @@ public class ReservationServiceImpl extends ServiceImpl<ReservationMapper, Reser
|
||||
Ticket ticket = ticketMapper.selectTicketById(reservation.getTicketId());
|
||||
if (ticket.getDuration() ==null){
|
||||
String discount = ticket.getDiscount();
|
||||
BigDecimal paidMoney = new BigDecimal(roomContent.getMoney()).multiply(new BigDecimal(discount));
|
||||
BigDecimal paidMoney = new BigDecimal(roomContent.getMoney()).multiply(new BigDecimal(discount)).multiply(new BigDecimal(duration));
|
||||
meetingAmountVo.setPaidMoney(paidMoney);
|
||||
return meetingAmountVo;
|
||||
}
|
||||
@ -196,7 +200,7 @@ public class ReservationServiceImpl extends ServiceImpl<ReservationMapper, Reser
|
||||
Ticket ticket = ticketMapper.selectTicketById(reservation.getTicketId());
|
||||
if (ticket.getDuration() ==null){
|
||||
String discount = ticket.getDiscount();
|
||||
BigDecimal paidMoney = new BigDecimal(roomContent.getMoney()).multiply(new BigDecimal(discount));
|
||||
BigDecimal paidMoney = new BigDecimal(roomContent.getMoney()).multiply(new BigDecimal(discount)).multiply(new BigDecimal(hour));
|
||||
meetingAmountVo.setPaidMoney(paidMoney);
|
||||
return meetingAmountVo;
|
||||
}
|
||||
@ -262,6 +266,55 @@ public class ReservationServiceImpl extends ServiceImpl<ReservationMapper, Reser
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void selectTimeByMeetingRoomTime(Reservation reservation) {
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 比较一个 HH:mm:ss 是否在一个时间段内
|
||||
* 如:14:33:00 是否在 09:30:00 和 12:00:00 内
|
||||
*/
|
||||
public static boolean timeIsInRound(String str1, String start, String end) {
|
||||
SimpleDateFormat df = new SimpleDateFormat("HH:mm:ss");
|
||||
Date now = null;
|
||||
Date beginTime = null;
|
||||
Date endTime = null;
|
||||
|
||||
try {
|
||||
now = df.parse(str1);
|
||||
beginTime = df.parse(start);
|
||||
endTime = df.parse(end);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return belongCalendar(now, beginTime, endTime);
|
||||
}
|
||||
|
||||
|
||||
public static boolean belongCalendar(Date nowTime, Date beginTime, Date endTime) {
|
||||
Calendar date = Calendar.getInstance();
|
||||
date.setTime(nowTime);
|
||||
|
||||
Calendar begin = Calendar.getInstance();
|
||||
begin.setTime(beginTime);
|
||||
|
||||
Calendar end = Calendar.getInstance();
|
||||
end.setTime(endTime);
|
||||
|
||||
return date.after(begin) && date.before(end);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 判断一个时间段是否包含另一个时间段,包含:TRUE,不包含:FALSE
|
||||
*
|
||||
|
@ -47,6 +47,7 @@ public class RoomRecordServiceImpl extends ServiceImpl<RoomRecordMapper, RoomRec
|
||||
public List<RoomRecord> selectRoomRecordList(RoomRecord roomRecord) {
|
||||
QueryWrapper queryWrapper = new QueryWrapper();
|
||||
queryWrapper.eq("device_id",roomRecord.getDeviceId());
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
return roomRecordMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,65 @@
|
||||
package com.ics.admin.service.meeting;
|
||||
|
||||
import com.ics.admin.domain.meeting.DetailEquipment;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 楼层与设备关联Service接口
|
||||
*
|
||||
* @author ics
|
||||
* @date 2024-03-27
|
||||
*/
|
||||
public interface IDetailEquipmentService extends IService<DetailEquipment> {
|
||||
/**
|
||||
* 查询楼层与设备关联
|
||||
*
|
||||
* @param id 楼层与设备关联ID
|
||||
* @return 楼层与设备关联
|
||||
*/
|
||||
DetailEquipment selectDetailEquipmentById(Long id);
|
||||
|
||||
/**
|
||||
* 查询楼层与设备关联列表
|
||||
*
|
||||
* @param detailEquipment 楼层与设备关联
|
||||
* @return 楼层与设备关联集合
|
||||
*/
|
||||
List<DetailEquipment> selectDetailEquipmentList(DetailEquipment detailEquipment);
|
||||
|
||||
/**
|
||||
* 新增楼层与设备关联
|
||||
*
|
||||
* @param detailEquipment 楼层与设备关联
|
||||
* @return 结果
|
||||
*/
|
||||
int insertDetailEquipment(DetailEquipment detailEquipment);
|
||||
|
||||
/**
|
||||
* 修改楼层与设备关联
|
||||
*
|
||||
* @param detailEquipment 楼层与设备关联
|
||||
* @return 结果
|
||||
*/
|
||||
int updateDetailEquipment(DetailEquipment detailEquipment);
|
||||
|
||||
/**
|
||||
* 批量删除楼层与设备关联
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteDetailEquipmentByIds(String ids);
|
||||
|
||||
/**
|
||||
* 删除楼层与设备关联信息
|
||||
*
|
||||
* @param id 楼层与设备关联ID
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteDetailEquipmentById(Long id);
|
||||
|
||||
DetailEquipment selectByEquipmentId(Long id);
|
||||
|
||||
List<DetailEquipment> selectByRoomId(Long id);
|
||||
}
|
@ -71,4 +71,5 @@ public interface IReservationService extends IService<Reservation> {
|
||||
|
||||
Reservation selectByOrderNumber(String outTradeNo);
|
||||
|
||||
void selectTimeByMeetingRoomTime(Reservation reservation);
|
||||
}
|
||||
|
@ -62,4 +62,8 @@ public interface IRoomEquipmentService extends IService<RoomEquipment> {
|
||||
RoomEquipment selectByEquipmentId(Long id);
|
||||
|
||||
RoomEquipment selectRoomId(Long roomId);
|
||||
|
||||
RoomEquipment selectByEquipmentIdAndRoomId(RoomEquipment roomEquipment);
|
||||
|
||||
RoomEquipment selectByRoomId(Long id);
|
||||
}
|
||||
|
@ -62,4 +62,6 @@ public interface IUserEquipmentService extends IService<UserEquipment> {
|
||||
List<UserEquipment> getEquipmentByUserId(Long userId);
|
||||
|
||||
int deleteUserEquipmentByEquipmentId(Long id);
|
||||
|
||||
UserEquipment selectUserAndEquipment(Long userId, Long id);
|
||||
}
|
||||
|
@ -29,6 +29,8 @@
|
||||
<result property="regNo" column="reg_no" />
|
||||
<result property="status" column="status" />
|
||||
<result property="orgNo" column="org_no" />
|
||||
<result property="roomId" column="room_id" />
|
||||
<result property="buildId" column="build_id" />
|
||||
<result property="operName" column="oper_name" />
|
||||
<result property="econKind" column="econ_kind" />
|
||||
<result property="startDate" column="start_date" />
|
||||
@ -67,6 +69,8 @@
|
||||
ic.contacts,
|
||||
ic.phone,
|
||||
ic.email,
|
||||
ic.room_id,
|
||||
ic.build_id,
|
||||
ic.credit_no,
|
||||
ic.mail_address,
|
||||
ic.postal_code,
|
||||
@ -106,6 +110,7 @@
|
||||
<if test="phone != null and phone != ''"> AND phone LIKE CONCAT('%', #{phone}, '%')</if>
|
||||
<if test="deleteFlag != null"> and ic.delete_flag = #{deleteFlag} </if>
|
||||
</where>
|
||||
order by ic.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectCustomerById" parameterType="Long" resultMap="CustomerResult">
|
||||
|
@ -7,6 +7,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<resultMap type="com.ics.common.core.domain.IcsCustomerStaff" id="IcsCustomerStaffResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="username" column="username" />
|
||||
<result property="name" column="name" />
|
||||
<result property="photo" column="photo" />
|
||||
<result property="address" column="address" />
|
||||
<result property="email" column="email" />
|
||||
<result property="degree" column="degree" />
|
||||
<result property="urgent" column="urgent" />
|
||||
<result property="mobile" column="mobile" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
@ -31,7 +37,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectIcsCustomerStaffVo">
|
||||
SELECT id, username, mobile, create_by, create_time, update_by, update_time, delete_flag, ics_customer_id, openid, avatar, gender, status, park_id,card_no, visit_time,
|
||||
SELECT id, username, mobile, create_by, create_time, update_by,name,photo,address,email,degree,urgent, update_time, delete_flag, ics_customer_id, openid, avatar, gender, status, park_id,card_no, visit_time,
|
||||
leave_time,visit_content,to_name,to_phone,to_customer,to_customer_id,data_type
|
||||
FROM ics_customer_staff
|
||||
</sql>
|
||||
@ -42,6 +48,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="username != null and username != ''"> AND username LIKE CONCAT('%', #{username}, '%') </if>
|
||||
<if test="icsCustomerId != null and icsCustomerId != ''"> AND ics_customer_id = #{icsCustomerId} </if>
|
||||
<if test="mobile != null and mobile != ''"> AND mobile LIKE CONCAT('%', #{mobile}, '%') </if>
|
||||
<if test="name != null and name != ''"> AND name LIKE CONCAT('%', #{name}, '%') </if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
@ -55,6 +62,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null ">id,</if>
|
||||
<if test="username != null and username != ''">username,</if>
|
||||
<if test="name != null and name != ''">`name`,</if>
|
||||
<if test="photo != null and photo != ''">`photo`,</if>
|
||||
<if test="address != null and address != ''">address,</if>
|
||||
<if test="email != null and email != ''">email,</if>
|
||||
<if test="degree != null and degree != ''">`degree`,</if>
|
||||
<if test="urgent != null and urgent != ''">urgent,</if>
|
||||
<if test="mobile != null and mobile != ''">mobile,</if>
|
||||
<if test="password != null and password != ''">password,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
@ -82,6 +95,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="id != null ">#{id},</if>
|
||||
<if test="username != null and username != ''">#{username},</if>
|
||||
<if test="mobile != null and mobile != ''">#{mobile},</if>
|
||||
<if test="name != null and name != ''">#{name},</if>
|
||||
<if test="photo != null and photo != ''">#{photo},</if>
|
||||
<if test="address != null and address != ''">#{address},</if>
|
||||
<if test="email != null and email != ''">#{email},</if>
|
||||
<if test="degree != null and degree != ''">#{degree},</if>
|
||||
<if test="urgent != null and urgent != ''">#{urgent},</if>
|
||||
<if test="password != null and password != ''">#{password},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
<if test="createTime != null ">#{createTime},</if>
|
||||
@ -112,6 +131,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="username != null and username != ''">username = #{username},</if>
|
||||
<if test="mobile != null and mobile != ''">mobile = #{mobile},</if>
|
||||
<if test="password != null and password != ''">password = #{password},</if>
|
||||
<if test="name != null and name != ''">`name` = #{name},</if>
|
||||
<if test="photo != null and photo != ''">`photo` = #{photo},</if>
|
||||
<if test="address != null and address != ''">`address` = #{address},</if>
|
||||
<if test="email != null and email != ''">`email` = #{email},</if>
|
||||
<if test="degree != null and degree != ''">`degree` = #{degree},</if>
|
||||
<if test="urgent != null and urgent != ''">`urgent` = #{urgent},</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>
|
||||
@ -134,6 +159,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</trim>
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
<update id="updateByCustomer" parameterType="Long">
|
||||
UPDATE ics_customer_staff set ics_customer_id = null where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteIcsCustomerStaffById" parameterType="Long">
|
||||
DELETE FROM ics_customer_staff WHERE id = #{id}
|
||||
|
@ -0,0 +1,72 @@
|
||||
<?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.DetailEquipmentMapper">
|
||||
|
||||
<resultMap type="com.ics.admin.domain.meeting.DetailEquipment" id="DetailEquipmentResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="equipmentId" column="equipment_id" />
|
||||
<result property="buildingDetailId" column="building_detail_id" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="deleteFlag" column="delete_flag" />
|
||||
<result property="createBy" column="create_by" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectDetailEquipmentVo">
|
||||
SELECT id, equipment_id, building_detail_id, create_time, delete_flag, create_by FROM tb_detail_equipment
|
||||
</sql>
|
||||
|
||||
<select id="selectDetailEquipmentList" parameterType="DetailEquipment" resultMap="DetailEquipmentResult">
|
||||
<include refid="selectDetailEquipmentVo"/>
|
||||
<where>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectDetailEquipmentById" parameterType="Long" resultMap="DetailEquipmentResult">
|
||||
<include refid="selectDetailEquipmentVo"/>
|
||||
WHERE id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertDetailEquipment" parameterType="DetailEquipment" useGeneratedKeys="true" keyProperty="id">
|
||||
INSERT INTO tb_detail_equipment
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="equipmentId != null ">equipment_id,</if>
|
||||
<if test="buildingDetailId != null ">building_detail_id,</if>
|
||||
<if test="createTime != null ">create_time,</if>
|
||||
<if test="deleteFlag != null and deleteFlag != ''">delete_flag,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="equipmentId != null ">#{equipmentId},</if>
|
||||
<if test="buildingDetailId != null ">#{buildingDetailId},</if>
|
||||
<if test="createTime != null ">#{createTime},</if>
|
||||
<if test="deleteFlag != null and deleteFlag != ''">#{deleteFlag},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateDetailEquipment" parameterType="DetailEquipment">
|
||||
UPDATE tb_detail_equipment
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="equipmentId != null ">equipment_id = #{equipmentId},</if>
|
||||
<if test="buildingDetailId != null ">building_detail_id = #{buildingDetailId},</if>
|
||||
<if test="createTime != null ">create_time = #{createTime},</if>
|
||||
<if test="deleteFlag != null and deleteFlag != ''">delete_flag = #{deleteFlag},</if>
|
||||
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
|
||||
</trim>
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteDetailEquipmentById" parameterType="Long">
|
||||
DELETE FROM tb_detail_equipment WHERE id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteDetailEquipmentByIds" parameterType="String">
|
||||
DELETE FROM tb_detail_equipment where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
@ -10,7 +10,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="equipmentName" column="equipment_name" />
|
||||
<result property="status" column="status" />
|
||||
<result property="ip" column="ip" />
|
||||
<result property="roomId" column="room_id" />
|
||||
<result property="equipmentNum" column="equipment_num" />
|
||||
<result property="pic" column="pic" />
|
||||
<result property="deleteFlag" column="delete_flag" />
|
||||
@ -21,7 +20,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectEquipmentVo">
|
||||
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
|
||||
SELECT id, type, equipment_name, status, equipment_num,ip, pic, delete_flag, create_by, create_time, update_by, update_time FROM tb_equipment
|
||||
</sql>
|
||||
|
||||
<select id="selectEquipmentList" parameterType="Equipment" resultMap="EquipmentResult">
|
||||
@ -46,7 +45,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="createDate != null ">create_date,</if>
|
||||
<if test="equipmentNum != null and equipmentNum != ''">equipment_num,</if>
|
||||
<if test="pic != null and pic != ''">pic,</if>
|
||||
<if test="roomId != null and roomId != ''">room_id,</if>
|
||||
<if test="ip != null and ip != ''">ip,</if>
|
||||
<if test="deleteFlag != null ">delete_flag,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
@ -63,7 +61,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="equipmentNum != null and equipmentNum != ''">#{equipmentNum},</if>
|
||||
<if test="pic != null and pic != ''">#{pic},</if>
|
||||
<if test="ip != null and ip != ''">#{ip},</if>
|
||||
<if test="roomId != null and roomId != ''">#{roomId},</if>
|
||||
<if test="deleteFlag != null ">#{deleteFlag},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
<if test="createTime != null ">#{createTime},</if>
|
||||
@ -82,8 +79,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<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>
|
||||
|
||||
</trim>
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
@ -30,12 +30,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="isToll" column="is_toll" />
|
||||
<result property="isTicket" column="is_ticket" />
|
||||
<result property="content" column="content" />
|
||||
<result property="remake" column="remake" />
|
||||
</resultMap>
|
||||
|
||||
|
||||
|
||||
<sql id="selectRoomContentVo">
|
||||
SELECT id, type, meeting_name, capacity_num, expand_num, indoor_pic_url, address, start_time, end_date, duration, shape, money, is_show, head_name, head_phone, create_by, create_time, update_by, update_time, version, delete_flag, room_id, is_toll, is_ticket, content FROM tb_room_content
|
||||
SELECT id, type, meeting_name, capacity_num, expand_num,remake, indoor_pic_url, address, start_time, end_date, duration, shape, money, is_show, head_name, head_phone, create_by, create_time, update_by, update_time, version, delete_flag, room_id, is_toll, is_ticket, content FROM tb_room_content
|
||||
</sql>
|
||||
|
||||
<select id="selectRoomContentList" parameterType="RoomContent" resultMap="RoomContentResult">
|
||||
@ -101,6 +102,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="isToll != null ">is_toll,</if>
|
||||
<if test="isTicket != null ">is_ticket,</if>
|
||||
<if test="content != null and content != ''">content,</if>
|
||||
<if test="remake != null and remake != ''">remake,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="type != null and type != ''">#{type},</if>
|
||||
@ -127,6 +129,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="isToll != null ">#{isToll},</if>
|
||||
<if test="isTicket != null ">#{isTicket},</if>
|
||||
<if test="content != null and content != ''">#{content},</if>
|
||||
<if test="remake != null and remake != ''">#{remake},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
@ -157,6 +160,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="isToll != null ">is_toll = #{isToll},</if>
|
||||
<if test="isTicket != null ">is_ticket = #{isTicket},</if>
|
||||
<if test="content != null and content != ''">content = #{content},</if>
|
||||
<if test="remake != null and remake != ''">remake = #{remake},</if>
|
||||
</trim>
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
@ -9,10 +9,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="equipmentId" column="equipment_id" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="startTime" column="start_time" />
|
||||
<result property="endDate" column="end_date" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectUserEquipmentVo">
|
||||
SELECT id, user_id, equipment_id, create_time FROM tb_user_equipment
|
||||
SELECT id, user_id, equipment_id, create_time,start_time,end_date FROM tb_user_equipment
|
||||
</sql>
|
||||
|
||||
<select id="selectUserEquipmentList" parameterType="UserEquipment" resultMap="UserEquipmentResult">
|
||||
@ -33,12 +35,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="userId != null ">user_id,</if>
|
||||
<if test="equipmentId != null ">equipment_id,</if>
|
||||
<if test="createTime != null ">create_time,</if>
|
||||
<if test="startTime != null ">start_time,</if>
|
||||
<if test="endDate != null ">end_date,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null ">#{id},</if>
|
||||
<if test="userId != null ">#{userId},</if>
|
||||
<if test="equipmentId != null ">#{equipmentId},</if>
|
||||
<if test="createTime != null ">#{createTime},</if>
|
||||
<if test="startTime != null ">#{startTime},</if>
|
||||
<if test="endDate != null ">#{endDate},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
@ -48,6 +54,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="userId != null ">user_id = #{userId},</if>
|
||||
<if test="equipmentId != null ">equipment_id = #{equipmentId},</if>
|
||||
<if test="createTime != null ">create_time = #{createTime},</if>
|
||||
<if test="startTime != null ">start_time = #{startTime},</if>
|
||||
<if test="endDate != null ">end_date = #{endDate},</if>
|
||||
</trim>
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
@ -80,8 +80,8 @@ public class BaseEntity<T> implements Serializable {
|
||||
/**
|
||||
* 关联园区ID
|
||||
*/
|
||||
// @TableField(fill = FieldFill.INSERT)
|
||||
@TableField(exist = false)
|
||||
@TableField(fill = FieldFill.INSERT,exist = false)
|
||||
// @TableField(exist = false)
|
||||
private Long parkId;
|
||||
|
||||
/**
|
||||
|
@ -21,6 +21,18 @@ public class IcsCustomerStaff extends BaseEntity<IcsCustomerStaff> {
|
||||
/** 姓名 */
|
||||
private String username;
|
||||
|
||||
private String name;
|
||||
|
||||
private String photo;
|
||||
|
||||
private String address;
|
||||
|
||||
private String email;
|
||||
|
||||
private String degree;
|
||||
|
||||
private String urgent;
|
||||
|
||||
/** 电话 */
|
||||
private String mobile;
|
||||
|
||||
|
@ -17,9 +17,11 @@ import com.ics.system.service.IAccessTokenService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.wf.jwtp.annotation.RequiresPermissions;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -115,11 +117,18 @@ public class WxLoginAPIController extends BaseController {
|
||||
String phoneNumber = phoneInfo.getString("phoneNumber");
|
||||
IcsCustomerStaff icsCustomerStaff = new IcsCustomerStaff();
|
||||
icsCustomerStaff.setMobile(phoneNumber);
|
||||
List<IcsCustomerStaff> list = icsCustomerStaffService.selectIcsCustomerStaffList(icsCustomerStaff);
|
||||
if(list.size()>0){
|
||||
IcsCustomerStaff customerStaff = icsCustomerStaffService.selectByPhone(phoneNumber);
|
||||
if(customerStaff !=null){
|
||||
|
||||
if (StringUtils.isBlank(customerStaff.getOpenid())){
|
||||
customerStaff.setOpenid(openid);
|
||||
icsCustomerStaffService.updateIcsCustomerStaff(customerStaff);
|
||||
}
|
||||
|
||||
|
||||
User user = new User();
|
||||
PublishFactory.recordLoginInfo(list.get(0).getUsername(), Constants.LOGIN_SUCCESS, MessageUtils.message("user.login.success"));
|
||||
BeanUtils.copyBeanProp(user,list.get(0));
|
||||
PublishFactory.recordLoginInfo(customerStaff.getUsername(), Constants.LOGIN_SUCCESS, MessageUtils.message("user.login.success"));
|
||||
BeanUtils.copyBeanProp(user,customerStaff);
|
||||
Map<String, Object> token = tokenService.createToken(user);
|
||||
R ajax = R.ok();
|
||||
ajax.put(Constants.TOKEN, token);
|
||||
@ -160,12 +169,13 @@ public class WxLoginAPIController extends BaseController {
|
||||
return smallWxAccessToken;
|
||||
}
|
||||
|
||||
@PostMapping("/wx/getUserInfo")
|
||||
public R login(@RequestBody String mobile) {
|
||||
@RequiresPermissions("member:center:view")
|
||||
@GetMapping ("/wx/getUserInfo")
|
||||
public R login( Long userId) {
|
||||
try {
|
||||
//检查是否是否存在
|
||||
IcsCustomerStaff icsCustomerStaff = new IcsCustomerStaff();
|
||||
icsCustomerStaff.setMobile(mobile);
|
||||
icsCustomerStaff.setId(userId);
|
||||
List<IcsCustomerStaff> list = icsCustomerStaffService.selectIcsCustomerStaffList(icsCustomerStaff);
|
||||
if(list.size()>0){
|
||||
IcsCustomerStaff icsCustomerStaff1 = list.get(0);
|
||||
|
@ -1,5 +1,8 @@
|
||||
package com.ics.controller.mobile.meeting;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.date.DateUnit;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
@ -23,6 +26,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.wf.jwtp.annotation.RequiresPermissions;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@ -55,12 +59,32 @@ public class ApiEquipmentController extends BaseController {
|
||||
@PostMapping("/openDoor")
|
||||
public R openDoor(@RequestBody RoomRecord roomRecord){
|
||||
//判断用户是否有权限开门
|
||||
UserEquipment userEquipment1 = new UserEquipment();
|
||||
userEquipment1.setEquipmentId(roomRecord.getDeviceId());
|
||||
userEquipment1.setUserId(roomRecord.getUserId());
|
||||
List<UserEquipment> equipments = userEquipmentService.selectUserEquipmentList(userEquipment1);
|
||||
|
||||
if (CollUtil.isNotEmpty(equipments)){
|
||||
//循环判断当前时间是否在时间段
|
||||
for (UserEquipment userEquipment : equipments) {
|
||||
boolean in = DateUtil.isIn(DateUtil.date(), userEquipment.getStartTime(), userEquipment.getEndDate());
|
||||
if (!in){
|
||||
return R.error("不在开门时间段");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
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,"开门失败");
|
||||
|
||||
roomRecord.setType("0");
|
||||
int i = roomRecordService.insertRoomRecord(roomRecord);
|
||||
Assert.isTrue(i == 1,"开门失败");
|
||||
|
||||
|
@ -1,5 +1,7 @@
|
||||
package com.ics.controller.mobile.meeting;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
@ -28,9 +30,8 @@ import org.springframework.web.bind.annotation.*;
|
||||
import org.wf.jwtp.annotation.RequiresPermissions;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/roomContent")
|
||||
@ -73,9 +74,18 @@ public class ApiRoomContentController extends BaseController {
|
||||
@Autowired
|
||||
private RoomEquipmentMapper roomEquipmentMapper;
|
||||
|
||||
@Autowired
|
||||
private IRoomEquipmentService roomEquipmentService;
|
||||
|
||||
@Autowired
|
||||
WxPayCommon wxPayCommon;
|
||||
|
||||
@Autowired
|
||||
private IUserEquipmentService userEquipmentService;
|
||||
|
||||
@Autowired
|
||||
private IDetailEquipmentService detailEquipmentService;
|
||||
|
||||
|
||||
/**
|
||||
* 查询条件筛选
|
||||
@ -137,6 +147,8 @@ public class ApiRoomContentController extends BaseController {
|
||||
return R.ok().put("data",reservationList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询空闲的会议室
|
||||
* @param reservation
|
||||
@ -145,8 +157,45 @@ public class ApiRoomContentController extends BaseController {
|
||||
@RequiresPermissions("member:center:view")
|
||||
@PostMapping("/selectFreeMeetingRoom")
|
||||
public R selectFreeMeetingRoom(@RequestBody Reservation reservation) {
|
||||
boolean count =reservationService.selectFreeMeetingRoom(reservation);
|
||||
String msg =count?"会议室不可用":"会议室可用";
|
||||
|
||||
String msg = "";
|
||||
|
||||
boolean count = true;
|
||||
|
||||
RoomContent roomContent = roomContentMapper.selectById(reservation.getRoomContentId());
|
||||
if (null != roomContent){
|
||||
Assert.isTrue(roomContent !=null,"该会议室不存在");
|
||||
}
|
||||
|
||||
Date startTime = reservation.getStartTime();
|
||||
String startFormat = DateUtil.format(startTime, "HH:mm:ss");
|
||||
Date endDate = reservation.getEndDate();
|
||||
String endFormat = DateUtil.format(endDate, "HH:mm:ss");
|
||||
|
||||
Date startTime1 = roomContent.getStartTime();
|
||||
String startFormat1 = DateUtil.format(startTime1, "HH:mm:ss");
|
||||
Date endDate1 = roomContent.getEndDate();
|
||||
|
||||
String endFormat1 = DateUtil.format(endDate1, "HH:mm:ss");
|
||||
|
||||
|
||||
boolean b = timeIsInRound(startFormat, startFormat1, endFormat1);
|
||||
|
||||
if (!b){
|
||||
msg = !b?"请在"+startFormat1+"到"+endFormat1+"的时间段内预约会议时间":"会议室可用";
|
||||
count = true;
|
||||
return R.ok().put("count",count).put("msg",msg);
|
||||
}
|
||||
boolean b1 = timeIsInRound(endFormat, startFormat1, endFormat1);
|
||||
if (!b1){
|
||||
msg = !b1?"请在"+startFormat1+"到"+endFormat1+"的时间段内预约会议时间":"会议室可用";
|
||||
count = true;
|
||||
return R.ok().put("count",count).put("msg",msg);
|
||||
}
|
||||
|
||||
|
||||
count =reservationService.selectFreeMeetingRoom(reservation);
|
||||
msg =count?"该时间段已被预约":"会议室可用";
|
||||
return R.ok().put("count",count).put("msg",msg);
|
||||
}
|
||||
|
||||
@ -179,22 +228,119 @@ public class ApiRoomContentController extends BaseController {
|
||||
String prepayId = wxPayCommon.wxJsApiPay(wxChatBasePayDto);
|
||||
reservation.setPrepayId(prepayId);
|
||||
reservation.setStauts(Reservation.Status.TO_BE_PAID);
|
||||
boolean save = reservationService.save(reservation);
|
||||
|
||||
}
|
||||
boolean save = reservationService.save(reservation);
|
||||
if (save){
|
||||
if (null !=reservation.getTicketId()){
|
||||
Ticket ticket = ticketService.selectTicketById(reservation.getTicketId());
|
||||
if (ticket.getType() == 2){
|
||||
CustomerTicket customerTicket =new CustomerTicket();
|
||||
customerTicket.setTicketId(reservation.getTicketId());
|
||||
customerTicket.setCustomerId(reservation.getCustomerId());
|
||||
customerTicket.setStaffId(reservation.getUserId());
|
||||
customerTicketService.insertCustomerTicket(customerTicket);
|
||||
}else {
|
||||
CustomerTicket customerTicket =new CustomerTicket();
|
||||
customerTicket.setTicketId(reservation.getTicketId());
|
||||
customerTicket.setCustomerId(reservation.getCustomerId());
|
||||
customerTicket.setStaffId(reservation.getUserId());
|
||||
customerTicketService.updateCustomerTicketBYUserId(customerTicket);
|
||||
}
|
||||
}
|
||||
|
||||
ArrayList<Long> ids = new ArrayList<>();
|
||||
Reservation reservation2 = reservationService.selectReservationById(reservation.getId());
|
||||
if (null != reservation2) {
|
||||
RoomContent roomContent = roomContentService.selectRoomContentById(reservation2.getRoomContentId());
|
||||
if (null != roomContent) {
|
||||
Room room = roomService.selectRoomById(roomContent.getRoomId());
|
||||
if (null != room) {
|
||||
Long id = room.getId();
|
||||
RoomEquipment roomEquipment = roomEquipmentService.selectByRoomId(id);
|
||||
if (null != roomEquipment) {
|
||||
ids.add(roomEquipment.getEquipmentId());
|
||||
}
|
||||
List<DetailEquipment> detailEquipments = detailEquipmentService.selectByRoomId(id);
|
||||
if (CollUtil.isNotEmpty(detailEquipments)) {
|
||||
for (DetailEquipment detailEquipment : detailEquipments) {
|
||||
ids.add(detailEquipment.getEquipmentId());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (CollUtil.isNotEmpty(ids)) {
|
||||
for (Long id : ids) {
|
||||
UserEquipment equipment = userEquipmentService.selectUserAndEquipment(reservation.getUserId(), id);
|
||||
if (null == equipment) {
|
||||
UserEquipment userEquipment = new UserEquipment();
|
||||
userEquipment.setEquipmentId(id);
|
||||
userEquipment.setUserId(reservation.getUserId());
|
||||
userEquipment.setStartTime(reservation.getStartTime());
|
||||
userEquipment.setEndDate(reservation.getEndDate());
|
||||
userEquipmentService.insertUserEquipment(userEquipment);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (save){
|
||||
if (null !=reservation.getTicketId()){
|
||||
CustomerTicket customerTicket =new CustomerTicket();
|
||||
customerTicket.setTicketId(reservation.getTicketId());
|
||||
customerTicket.setCustomerId(reservation.getCustomerId());
|
||||
customerTicket.setStaffId(reservation.getUserId());
|
||||
customerTicketService.updateCustomerTicketBYUserId(customerTicket);
|
||||
}
|
||||
Long id = reservation.getId();
|
||||
return toAjax(save).put("reservationId",id);
|
||||
}else {
|
||||
boolean save = reservationService.save(reservation);
|
||||
if (save){
|
||||
if (null !=reservation.getTicketId()){
|
||||
Ticket ticket = ticketService.selectTicketById(reservation.getTicketId());
|
||||
if (ticket.getType() == 2){
|
||||
CustomerTicket customerTicket =new CustomerTicket();
|
||||
customerTicket.setTicketId(reservation.getTicketId());
|
||||
customerTicket.setCustomerId(reservation.getCustomerId());
|
||||
customerTicket.setStaffId(reservation.getUserId());
|
||||
customerTicketService.insertCustomerTicket(customerTicket);
|
||||
}else {
|
||||
CustomerTicket customerTicket =new CustomerTicket();
|
||||
customerTicket.setTicketId(reservation.getTicketId());
|
||||
customerTicket.setCustomerId(reservation.getCustomerId());
|
||||
customerTicket.setStaffId(reservation.getUserId());
|
||||
customerTicketService.updateCustomerTicketBYUserId(customerTicket);
|
||||
}
|
||||
}
|
||||
ArrayList<Long> ids = new ArrayList<>();
|
||||
Reservation reservation2 = reservationService.selectReservationById(reservation.getId());
|
||||
if (null != reservation2) {
|
||||
RoomContent roomContent = roomContentService.selectRoomContentById(reservation2.getRoomContentId());
|
||||
if (null != roomContent) {
|
||||
Room room = roomService.selectRoomById(roomContent.getRoomId());
|
||||
if (null != room) {
|
||||
Long id = room.getId();
|
||||
RoomEquipment roomEquipment = roomEquipmentService.selectByRoomId(id);
|
||||
if (null != roomEquipment) {
|
||||
ids.add(roomEquipment.getEquipmentId());
|
||||
}
|
||||
List<DetailEquipment> detailEquipments = detailEquipmentService.selectByRoomId(id);
|
||||
if (CollUtil.isNotEmpty(detailEquipments)) {
|
||||
for (DetailEquipment detailEquipment : detailEquipments) {
|
||||
ids.add(detailEquipment.getEquipmentId());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (CollUtil.isNotEmpty(ids)) {
|
||||
for (Long id : ids) {
|
||||
UserEquipment equipment = userEquipmentService.selectUserAndEquipment(reservation.getUserId(), id);
|
||||
if (null == equipment) {
|
||||
UserEquipment userEquipment = new UserEquipment();
|
||||
userEquipment.setEquipmentId(id);
|
||||
userEquipment.setUserId(reservation.getUserId());
|
||||
userEquipmentService.insertUserEquipment(userEquipment);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Long id = reservation.getId();
|
||||
return toAjax(save).put("reservationId",id);
|
||||
}
|
||||
Long id = reservation.getId();
|
||||
return toAjax(save).put("reservationId",id);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -260,8 +406,7 @@ public class ApiRoomContentController extends BaseController {
|
||||
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());
|
||||
roomContent.setArea(room.getArea());
|
||||
roomContent.setRenArea(room.getRentArea());
|
||||
@ -323,8 +468,49 @@ public class ApiRoomContentController extends BaseController {
|
||||
reservationPerson.setParticipantName(customerStaff.getUsername());
|
||||
}
|
||||
int i = reservationPersonService.insertReservationPerson(reservationPerson);
|
||||
if (i > 0){
|
||||
return R.ok("预约成功");
|
||||
if (i > 0) {
|
||||
|
||||
// 预约成功后,给对应的人员添加设备的权限
|
||||
// 查询预约信息,根据预约信息查询会议室
|
||||
// todo 重复使用
|
||||
ArrayList<Long> ids = new ArrayList<>();
|
||||
|
||||
Reservation reservation = reservationService.selectReservationById(reservationPerson.getReservationId());
|
||||
if (null != reservation) {
|
||||
RoomContent roomContent = roomContentService.selectRoomContentById(reservation.getRoomContentId());
|
||||
if (null != roomContent) {
|
||||
Room room = roomService.selectRoomById(roomContent.getRoomId());
|
||||
if (null != room) {
|
||||
Long id = room.getId();
|
||||
RoomEquipment roomEquipment = roomEquipmentService.selectByRoomId(id);
|
||||
if (null != roomEquipment) {
|
||||
ids.add(roomEquipment.getEquipmentId());
|
||||
}
|
||||
List<DetailEquipment> detailEquipments = detailEquipmentService.selectByRoomId(id);
|
||||
if (CollUtil.isNotEmpty(detailEquipments)) {
|
||||
for (DetailEquipment detailEquipment : detailEquipments) {
|
||||
ids.add(detailEquipment.getEquipmentId());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (CollUtil.isNotEmpty(ids)) {
|
||||
for (Long id : ids) {
|
||||
UserEquipment equipment = userEquipmentService.selectUserAndEquipment(reservationPerson.getReservationId(), id);
|
||||
if (null == equipment) {
|
||||
UserEquipment userEquipment = new UserEquipment();
|
||||
userEquipment.setEquipmentId(id);
|
||||
userEquipment.setUserId(reservationPerson.getParticipantId());
|
||||
userEquipment.setStartTime(reservation.getStartTime());
|
||||
userEquipment.setEndDate(reservation.getEndDate());
|
||||
userEquipmentService.insertUserEquipment(userEquipment);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return R.ok("预约成功");
|
||||
}
|
||||
}
|
||||
return R.ok("该人员未预约");
|
||||
}
|
||||
@ -354,12 +540,102 @@ public class ApiRoomContentController extends BaseController {
|
||||
reservation.setStauts(Reservation.Status.APPOINTMENT);
|
||||
reservation.setOrderTime(new Date());
|
||||
int i = reservationService.updateReservation(reservation);
|
||||
|
||||
|
||||
// todo 支付订单后,需要测试
|
||||
ArrayList<Long> ids = new ArrayList<>();
|
||||
|
||||
Reservation reservation2 = reservationService.selectReservationById(reservation.getId());
|
||||
if (null != reservation2) {
|
||||
RoomContent roomContent = roomContentService.selectRoomContentById(reservation2.getRoomContentId());
|
||||
if (null != roomContent) {
|
||||
Room room = roomService.selectRoomById(roomContent.getRoomId());
|
||||
if (null != room) {
|
||||
Long id = room.getId();
|
||||
RoomEquipment roomEquipment = roomEquipmentService.selectByRoomId(id);
|
||||
if (null != roomEquipment) {
|
||||
ids.add(roomEquipment.getEquipmentId());
|
||||
}
|
||||
List<DetailEquipment> detailEquipments = detailEquipmentService.selectByRoomId(id);
|
||||
if (CollUtil.isNotEmpty(detailEquipments)) {
|
||||
for (DetailEquipment detailEquipment : detailEquipments) {
|
||||
ids.add(detailEquipment.getEquipmentId());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (CollUtil.isNotEmpty(ids)) {
|
||||
for (Long id : ids) {
|
||||
UserEquipment equipment =userEquipmentService.selectUserAndEquipment(reservation.getUserId(), id);
|
||||
if (null == equipment){
|
||||
UserEquipment userEquipment = new UserEquipment();
|
||||
userEquipment.setEquipmentId(id);
|
||||
userEquipment.setStartTime(reservation.getStartTime());
|
||||
userEquipment.setEndDate(reservation.getEndDate());
|
||||
userEquipment.setUserId(reservation.getUserId());
|
||||
userEquipmentService.insertUserEquipment(userEquipment);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return toAjax(i);
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回
|
||||
* 预约邀请记录
|
||||
*/
|
||||
@RequiresPermissions("member:center:view")
|
||||
@GetMapping("inviteRecord")
|
||||
public R list(ReservationPerson reservationPerson) {
|
||||
List<ReservationPerson> reservationPeople = reservationPersonService.selectReservationPersonList(reservationPerson);
|
||||
for (ReservationPerson person : reservationPeople) {
|
||||
|
||||
IcsCustomerStaff participant = customerStaffService.selectIcsCustomerStaffById(person.getParticipantId());
|
||||
if (null != participant){
|
||||
person.setAvatar(participant.getAvatar());
|
||||
person.setUserName(participant.getUsername());
|
||||
}
|
||||
}
|
||||
return R.data(reservationPeople);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static boolean timeIsInRound(String str1, String start, String end) {
|
||||
SimpleDateFormat df = new SimpleDateFormat("HH:mm:ss");
|
||||
Date now = null;
|
||||
Date beginTime = null;
|
||||
Date endTime = null;
|
||||
|
||||
try {
|
||||
now = df.parse(str1);
|
||||
beginTime = df.parse(start);
|
||||
endTime = df.parse(end);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return belongCalendar(now, beginTime, endTime);
|
||||
}
|
||||
|
||||
|
||||
public static boolean belongCalendar(Date nowTime, Date beginTime, Date endTime) {
|
||||
Calendar date = Calendar.getInstance();
|
||||
date.setTime(nowTime);
|
||||
|
||||
Calendar begin = Calendar.getInstance();
|
||||
begin.setTime(beginTime);
|
||||
|
||||
Calendar end = Calendar.getInstance();
|
||||
end.setTime(endTime);
|
||||
|
||||
return date.after(begin) && date.before(end);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -4,6 +4,8 @@ import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.google.common.collect.Maps;
|
||||
|
||||
import com.ics.admin.domain.Customer;
|
||||
import com.ics.admin.service.ICustomerService;
|
||||
import com.ics.admin.service.IIcsCustomerStaffService;
|
||||
import com.ics.common.annotation.LoginStaff;
|
||||
import com.ics.common.annotation.LoginUser;
|
||||
@ -38,6 +40,9 @@ public class ProfileAPIController extends BaseController {
|
||||
private IUserService userService;
|
||||
@Autowired
|
||||
private IIcsCustomerStaffService icsCustomerStaffService;
|
||||
|
||||
@Autowired
|
||||
private ICustomerService customerService;
|
||||
@Autowired
|
||||
private IConfigService configService;
|
||||
|
||||
@ -56,6 +61,11 @@ public class ProfileAPIController extends BaseController {
|
||||
String siteUrl = jsonObject.getString("siteUrl");
|
||||
Map<String, Object> map = Maps.newHashMap();
|
||||
icsCustomerStaff = icsCustomerStaffService.selectIcsCustomerStaffById(icsCustomerStaff.getId());
|
||||
Customer customer = customerService.selectCustomerById(icsCustomerStaff.getIcsCustomerId());
|
||||
if (null != customer){
|
||||
icsCustomerStaff.setCustomerName(customer.getName());
|
||||
}
|
||||
|
||||
// if (icsCustomerStaff.getAvatar().contains(Constants.RESOURCE_PREFIX)) {
|
||||
// icsCustomerStaff.setAvatar(icsCustomerStaff.getAvatar());
|
||||
// } else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user