mirror of
https://gitee.com/elegant_wings/dbd-meeting.git
synced 2025-06-21 05:39:36 +08:00
修改了上海对应bug
This commit is contained in:
parent
4363ab3c5a
commit
f798ba4c72
@ -41,7 +41,7 @@ public class WisdomDeviceServiceImpl extends ServiceImpl<WisdomDeviceMapper, Wis
|
||||
*/
|
||||
@Override
|
||||
public List<WisdomDevice> selectWisdomDeviceList(WisdomDevice wisdomDevice) {
|
||||
QueryWrapper queryWrapper = new QueryWrapper();
|
||||
QueryWrapper<WisdomDevice> queryWrapper = new QueryWrapper();
|
||||
queryWrapper.eq(wisdomDevice.getWisdomRoomId() !=null,"wisdom_room_id",wisdomDevice.getWisdomRoomId());
|
||||
queryWrapper.eq(wisdomDevice.getType() !=null,"type",wisdomDevice.getType());
|
||||
return wisdomDeviceMapper.selectList(queryWrapper);
|
||||
|
@ -23,8 +23,10 @@ import com.ics.admin.domain.meeting.vo.MeetingAmountVo;
|
||||
import com.ics.admin.mapper.meeting.RoomContentMapper;
|
||||
import com.ics.admin.mapper.meeting.TicketMapper;
|
||||
import com.ics.admin.service.IBuildingDetailService;
|
||||
import com.ics.admin.service.IIcsCustomerStaffService;
|
||||
import com.ics.admin.service.IRoomService;
|
||||
import com.ics.admin.service.meeting.IRoomContentService;
|
||||
import com.ics.common.core.domain.IcsCustomerStaff;
|
||||
import org.checkerframework.checker.units.qual.A;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -55,6 +57,8 @@ public class ReservationServiceImpl extends ServiceImpl<ReservationMapper, Reser
|
||||
@Autowired
|
||||
private IBuildingDetailService buildingDetailService;
|
||||
|
||||
@Autowired
|
||||
private IIcsCustomerStaffService customerStaffService;
|
||||
/**
|
||||
* 查询预约记录
|
||||
*
|
||||
@ -237,10 +241,16 @@ public class ReservationServiceImpl extends ServiceImpl<ReservationMapper, Reser
|
||||
@Override
|
||||
public IPage<Reservation> selectReservationListByUserId(Reservation reservation, Integer pageNum, Integer pageSize) {
|
||||
|
||||
IcsCustomerStaff staff = customerStaffService.selectIcsCustomerStaffById(reservation.getUserId());
|
||||
|
||||
|
||||
QueryWrapper<Reservation> queryWrapper = new QueryWrapper<>();
|
||||
if (!staff.getDataType().equals("7")){
|
||||
queryWrapper.eq("user_id",reservation.getUserId());
|
||||
}
|
||||
|
||||
queryWrapper.eq("park_id",reservation.getParkId());
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
queryWrapper.orderByDesc("start_time");
|
||||
IPage<Reservation> pages = new Page<>(pageNum,pageSize);
|
||||
IPage<Reservation> userIPage = reservationMapper.selectPage(pages,queryWrapper);
|
||||
for (Reservation reservation1 : userIPage.getRecords()) {
|
||||
|
@ -339,6 +339,7 @@ public class RoomContentServiceImpl extends ServiceImpl<RoomContentMapper, RoomC
|
||||
wrapper.eq("room_content_id",meetingRoomId);
|
||||
wrapper.gt("start_time", DateUtil.format(dateTime,"yyyy-MM-dd")+ " 00:00:00");
|
||||
wrapper.lt("end_date",DateUtil.format(dateTime,"yyyy-MM-dd") + " 23:59:59");
|
||||
wrapper.ne("stauts",4);
|
||||
List<Reservation> reservation = reservationMapper.selectList(wrapper);
|
||||
for (Reservation reservation1 : reservation) {
|
||||
reservation1.setStatusValue(reservation1.getStauts().getValue());
|
||||
|
@ -335,7 +335,7 @@ public class DeviceUtils {
|
||||
public static String openControlLock(String ip) {
|
||||
String url = "http://192.168.30.36:808/api/Op/OpDoor?ipaddress="+ip;
|
||||
String msg = HttpUtil.get(url);
|
||||
log.info("查询人员id:{}", msg);
|
||||
log.info("开门控制器的结果为结果:{}", msg);
|
||||
return msg;
|
||||
}
|
||||
|
||||
|
@ -33,6 +33,8 @@ public class SignUtils {
|
||||
return getMD5(sign1 + "|" + appID + "|" + key);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static void lock(String lockId){
|
||||
String appID = "8888";
|
||||
String key = "cootoo";
|
||||
@ -49,7 +51,7 @@ public class SignUtils {
|
||||
|
||||
Map<String, String > heads = new HashMap<>();
|
||||
|
||||
String body = HttpRequest.post("http://222.67.49.6:8888/cootoo/openLock")
|
||||
String body = HttpRequest.post("http://222.67.230.123:8888/cootoo/openLock")
|
||||
.headerMap(heads, false)
|
||||
.body(on.toString()).timeout(30 * 1000).execute().body();
|
||||
System.out.println(body);
|
||||
|
@ -2,6 +2,7 @@ package com.ics.common.utils.device;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
@ -303,6 +304,13 @@ public class WisDomDeviceUtils {
|
||||
return false;
|
||||
}
|
||||
|
||||
public static String openControlLock(String ip) {
|
||||
String url = "http://222.67.230.123:1234/api/Op/OpDoor?ipaddress="+ip;
|
||||
String msg = HttpUtil.get(url);
|
||||
log.info("开门控制器的结果为结果:{}", msg);
|
||||
return msg;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -32,7 +32,7 @@ public class MeetingOpenStatusTask {
|
||||
log.info("预约会议室信息111111111111:"+reservation);
|
||||
Date date = new Date();
|
||||
|
||||
Date next = DateUtil.offsetMinute(date, 15);
|
||||
Date next = DateUtil.offsetMinute(date, 10);
|
||||
String format = DateUtil.format(next, "HH:mm");
|
||||
Date startTime = reservation.getStartTime();
|
||||
String format1 = DateUtil.format(startTime, "HH:mm");
|
||||
|
@ -20,6 +20,7 @@ import com.ics.common.core.page.TableSupport;
|
||||
import com.ics.common.utils.DeviceUtils;
|
||||
import com.ics.common.utils.StringUtils;
|
||||
import com.ics.common.utils.device.SignUtils;
|
||||
import com.ics.common.utils.device.WisDomDeviceUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
@ -236,6 +237,7 @@ public class ApiEquipmentController extends BaseController {
|
||||
|
||||
|
||||
WisdomDevice wisdomDevice = new WisdomDevice();
|
||||
log.info("会议室的id为{}", roomRecord.getRoomId());
|
||||
|
||||
//大会议室 52 茶室 53 小会议室 54
|
||||
if(roomRecord.getRoomId() == 237L ){
|
||||
@ -245,8 +247,15 @@ public class ApiEquipmentController extends BaseController {
|
||||
wisdomDevice.setEquipmentNum("240");
|
||||
}else if (roomRecord.getRoomId() == 239L){
|
||||
wisdomDevice.setEquipmentNum("239");
|
||||
}else if (roomRecord.getRoomId() == 242L){
|
||||
wisdomDevice.setEquipmentNum("192.168.1.201");
|
||||
wisdomDevice.setType("开门控制器");
|
||||
}else if (roomRecord.getRoomId() == 243L){
|
||||
wisdomDevice.setEquipmentNum("192.168.1.34");
|
||||
wisdomDevice.setType("开门控制器");
|
||||
}
|
||||
|
||||
|
||||
Integer count = wisdomStaffService.selectByUserIdAndRoomId(Integer.parseInt(String.valueOf(roomRecord.getUserId())), null);
|
||||
if (count == 0) return R.error("该用户没有权限开锁");
|
||||
Integer count1 = wisdomStaffService.selectByUserIdAndRoomId(Integer.parseInt(String.valueOf(roomRecord.getUserId())), "0");
|
||||
@ -255,11 +264,19 @@ public class ApiEquipmentController extends BaseController {
|
||||
for (WisdomStaff wisdomStaff : list) {
|
||||
boolean in = DateUtil.isIn(new Date(), wisdomStaff.getStartTime(), wisdomStaff.getEndDate());
|
||||
if (!in) return R.error("该用户没有权限开锁");
|
||||
SignUtils.lock(wisdomDevice.getEquipmentNum());
|
||||
}
|
||||
if (wisdomDevice.getType() !=null && wisdomDevice.getType().equals("开门控制器")){
|
||||
WisDomDeviceUtils.openControlLock(wisdomDevice.getEquipmentNum());
|
||||
}else {
|
||||
SignUtils.lock(wisdomDevice.getEquipmentNum());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (wisdomDevice.getType() !=null && wisdomDevice.getType().equals("开门控制器")){
|
||||
WisDomDeviceUtils.openControlLock(wisdomDevice.getEquipmentNum());
|
||||
}else {
|
||||
SignUtils.lock(wisdomDevice.getEquipmentNum());
|
||||
}
|
||||
}
|
||||
return R.ok("开门成功");
|
||||
}
|
||||
|
||||
|
@ -101,7 +101,11 @@ public class WisdomApiController extends BaseController {
|
||||
if (count <= 0) return R.error("您没有权限查看该房间设备");
|
||||
WisdomDevice wisdomDevice = new WisdomDevice();
|
||||
wisdomDevice.setWisdomRoomId(id);
|
||||
if (id == 3 || id == 4) {
|
||||
wisdomDevice.setType("门锁");
|
||||
}else if (id ==18 || id == 19){
|
||||
wisdomDevice.setType("开门控制器");
|
||||
}
|
||||
List<WisdomDevice> wisdomDevices = wisdomDeviceService.selectWisdomDeviceList(wisdomDevice);
|
||||
return R.data(wisdomDevices);
|
||||
}
|
||||
@ -129,7 +133,9 @@ public class WisdomApiController extends BaseController {
|
||||
WisdomDevice wisdomDevice = wisdomDeviceService.selectWisdomDeviceById(id);
|
||||
if (wisdomDevice == null) return R.error("设备不存在");
|
||||
|
||||
|
||||
if (wisdomDevice.getType().equals("开门控制器")) {
|
||||
return R.ok();
|
||||
}
|
||||
JSONObject deviceStatus = WisDomDeviceUtils.getDeviceStatus(wisdomDevice.getEquipmentNum(), wisdomDevice.getTypeName());
|
||||
|
||||
return R.ok(deviceStatus);
|
||||
@ -176,12 +182,17 @@ public class WisdomApiController extends BaseController {
|
||||
|
||||
boolean in = DateUtil.isIn(new Date(), offset, offset1);
|
||||
if (!in) return R.error("该用户没有权限开锁");
|
||||
|
||||
SignUtils.lock(wisdomDevice.getEquipmentNum());
|
||||
}
|
||||
} else {
|
||||
// WisDomDeviceUtils.openControlLock(wisdomDevice.getEquipmentNum());
|
||||
|
||||
SignUtils.lock(wisdomDevice.getEquipmentNum());
|
||||
}
|
||||
}
|
||||
if (wisdomDevice.getType().equals("开门控制器"))
|
||||
WisDomDeviceUtils.openControlLock(wisdomDevice.getEquipmentNum());
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ -219,7 +230,6 @@ public class WisdomApiController extends BaseController {
|
||||
List<Reservation> reservations = iReservationService.selectReservationListByDay();
|
||||
|
||||
for (Reservation reservation : reservations) {
|
||||
log.info("预约会议室信息111111111111:" + reservation);
|
||||
Date date = new Date();
|
||||
|
||||
Date next = DateUtil.offsetMinute(date, 15);
|
||||
|
Loading…
x
Reference in New Issue
Block a user