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
433ef91d35
commit
f6bcf14e3d
@ -188,7 +188,8 @@ public class CustomerStaffController extends BaseController {
|
||||
if (customer1.getParkId() == 26){
|
||||
IcsCustomerStaff customerStaff = icsCustomerStaffService.selectUserByMobile(icsCustomerStaff.getMobile());
|
||||
if (customerStaff != null){
|
||||
int i = icsCustomerStaffService.updateIcsCustomerStaff(customerStaff);
|
||||
icsCustomerStaff.setId(customerStaff.getId());
|
||||
int i = icsCustomerStaffService.updateIcsCustomerStaff(icsCustomerStaff);
|
||||
StaffCustomer staffCustomer = new StaffCustomer();
|
||||
staffCustomer.setIcsCustomerId(icsCustomerStaff.getIcsCustomerId());
|
||||
staffCustomer.setStaffId(customerStaff.getId());
|
||||
|
@ -77,6 +77,7 @@ public class WisdomRoomController extends BaseController {
|
||||
WisdomStaff wisdomStaff = new WisdomStaff();
|
||||
for (Long s : wisdomRoom.getStaffId()) {
|
||||
wisdomStaff.setWisdomRoomId(id);
|
||||
wisdomStaff.setDataType("0");
|
||||
wisdomStaff.setStaffId(s);
|
||||
wisdomStaffService.insertWisdomStaff(wisdomStaff);
|
||||
}
|
||||
|
@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.ics.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 房间用户关联对象 tb_wisdom_staff
|
||||
*
|
||||
@ -24,4 +26,12 @@ public class WisdomStaff extends BaseEntity<WisdomStaff> {
|
||||
/** 园区ID */
|
||||
private Long parkId;
|
||||
|
||||
private Date startTime;
|
||||
|
||||
private Date endDate;
|
||||
|
||||
private String dataType;
|
||||
|
||||
private Long reservationId;
|
||||
|
||||
}
|
||||
|
@ -55,6 +55,8 @@ public class Reservation extends BaseEntity<Reservation> {
|
||||
@TableField(exist = false)
|
||||
private Integer statusValue;
|
||||
|
||||
@TableField(exist = false)
|
||||
private List<ReservationPerson> reservationPersonList;
|
||||
|
||||
@TableField(exist = false)
|
||||
private List<ReservationServe> reservationServes;
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.ics.admin.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.ics.common.core.domain.IcsCustomerStaff;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
@ -79,4 +80,6 @@ public interface IcsCustomerStaffMapper extends BaseMapper<IcsCustomerStaff> {
|
||||
|
||||
IcsCustomerStaff selectUserByMobileAndParkId(@Param("mobile") String phoneNumber, @Param("parkId") String parkId);
|
||||
|
||||
@InterceptorIgnore(tenantLine = "1")
|
||||
List<IcsCustomerStaff> selectListByCustomerId();
|
||||
}
|
||||
|
@ -67,4 +67,7 @@ public interface ReservationMapper extends BaseMapper<Reservation> {
|
||||
List<Date> selectListByDate(Long meetingRoomId);
|
||||
|
||||
List<Reservation> todayMeeting(Long id);
|
||||
|
||||
List<Reservation> selectReservationListByDay();
|
||||
|
||||
}
|
||||
|
@ -92,5 +92,8 @@ public interface IIcsCustomerStaffService extends IService<IcsCustomerStaff> {
|
||||
|
||||
List<IcsCustomerStaff> selectList();
|
||||
|
||||
List<IcsCustomerStaff> selectListByCustomerId();
|
||||
|
||||
|
||||
// IcsCustomerStaff selectUserByMobileAndParkId(String phoneNumber, String parkId);
|
||||
}
|
||||
|
@ -59,6 +59,6 @@ public interface IWisdomPanelEquipmentService extends IService<WisdomPanelEquipm
|
||||
*/
|
||||
int deleteWisdomPanelEquipmentById(Long id);
|
||||
|
||||
List<WisdomPanelEquipment> selectWisdomPanelEquipmentByPanelId(String panelId);
|
||||
List<WisdomPanelEquipment> selectWisdomPanelEquipmentByPanelId(Long panelId);
|
||||
|
||||
}
|
||||
|
@ -2,6 +2,8 @@ package com.ics.admin.service;
|
||||
|
||||
import com.ics.admin.domain.WisdomStaff;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.ics.common.core.domain.IcsCustomerStaff;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -64,4 +66,14 @@ public interface IWisdomStaffService extends IService<WisdomStaff> {
|
||||
List<Long> selectWisdomStaffListByRoomId(Long id);
|
||||
|
||||
List<Long> selectWisdomStaffByRoomId(Long id);
|
||||
|
||||
Integer selectByUserIdAndRoomId(Integer loginStaffId, String dataType);
|
||||
|
||||
List<WisdomStaff> selectListByUserIdAndRoomId(Integer loginStaffId, String s);
|
||||
|
||||
int selectOneByUserIdAndRoomId(Long userId, Long wisdomRoomId);
|
||||
|
||||
List<IcsCustomerStaff> selectListByReservationId(Long id);
|
||||
|
||||
Integer selectListByReservationIdAndUserId(Long reservationId, Long participantId);
|
||||
}
|
||||
|
@ -305,6 +305,14 @@ public class IcsCustomerStaffServiceImpl extends ServiceImpl<IcsCustomerStaffMap
|
||||
return baseMapper.selectList(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IcsCustomerStaff> selectListByCustomerId() {
|
||||
|
||||
return icsCustomerStaffMapper.selectListByCustomerId();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
//根据企业查询对应的设备
|
||||
public void queryDeviceByCustomerId(Long customerId,Long userId){
|
||||
|
@ -43,6 +43,7 @@ public class WisdomDeviceServiceImpl extends ServiceImpl<WisdomDeviceMapper, Wis
|
||||
public List<WisdomDevice> selectWisdomDeviceList(WisdomDevice wisdomDevice) {
|
||||
QueryWrapper 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);
|
||||
}
|
||||
|
||||
|
@ -91,7 +91,7 @@ public class WisdomPanelEquipmentServiceImpl extends ServiceImpl<WisdomPanelEqui
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WisdomPanelEquipment> selectWisdomPanelEquipmentByPanelId(String panelId) {
|
||||
public List<WisdomPanelEquipment> selectWisdomPanelEquipmentByPanelId(Long panelId) {
|
||||
|
||||
QueryWrapper<WisdomPanelEquipment> wrapper = new QueryWrapper<WisdomPanelEquipment>().eq("panel_id", panelId);
|
||||
return wisdomPanelEquipmentMapper.selectList(wrapper);
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.ics.admin.service.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@ -8,6 +9,8 @@ import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.ics.admin.mapper.IcsCustomerStaffMapper;
|
||||
import com.ics.common.core.domain.IcsCustomerStaff;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ics.admin.mapper.WisdomStaffMapper;
|
||||
@ -25,6 +28,9 @@ public class WisdomStaffServiceImpl extends ServiceImpl<WisdomStaffMapper, Wisdo
|
||||
@Autowired
|
||||
private WisdomStaffMapper wisdomStaffMapper;
|
||||
|
||||
@Autowired
|
||||
private IcsCustomerStaffMapper icsCustomerStaffMapper;
|
||||
|
||||
/**
|
||||
* 查询房间用户关联
|
||||
*
|
||||
@ -119,4 +125,55 @@ public class WisdomStaffServiceImpl extends ServiceImpl<WisdomStaffMapper, Wisdo
|
||||
List<Long> collect = wisdomStaffs.stream().map(WisdomStaff::getStaffId).collect(Collectors.toList());
|
||||
return collect;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer selectByUserIdAndRoomId(Integer loginStaffId,String dataType) {
|
||||
|
||||
QueryWrapper<WisdomStaff> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("staff_id",loginStaffId);
|
||||
wrapper.eq(dataType !=null,"data_type",dataType);
|
||||
return wisdomStaffMapper.selectCount(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WisdomStaff> selectListByUserIdAndRoomId(Integer loginStaffId, String dataType) {
|
||||
|
||||
QueryWrapper<WisdomStaff> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("staff_id",loginStaffId);
|
||||
wrapper.eq(dataType !=null,"data_type",dataType);
|
||||
return wisdomStaffMapper.selectList(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int selectOneByUserIdAndRoomId(Long userId, Long wisdomRoomId) {
|
||||
|
||||
QueryWrapper<WisdomStaff> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("staff_id",userId);
|
||||
wrapper.eq("wisdom_room_id",wisdomRoomId);
|
||||
return wisdomStaffMapper.selectCount(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IcsCustomerStaff> selectListByReservationId(Long id) {
|
||||
|
||||
QueryWrapper<WisdomStaff> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("reservation_id",id);
|
||||
List<WisdomStaff> wisdomStaffs = wisdomStaffMapper.selectList(wrapper);
|
||||
List<Long> longStream = wisdomStaffs.stream().map(WisdomStaff::getStaffId).collect(Collectors.toList());
|
||||
if(longStream.size() == 0){
|
||||
return new ArrayList<>();
|
||||
}
|
||||
List<IcsCustomerStaff> customerStaffs = icsCustomerStaffMapper.selectBatchIds(longStream);
|
||||
return customerStaffs;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer selectListByReservationIdAndUserId(Long reservationId, Long participantId) {
|
||||
QueryWrapper<WisdomStaff> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("reservation_id",reservationId);
|
||||
wrapper.eq("staff_id",participantId);
|
||||
return wisdomStaffMapper.selectCount(wrapper);
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -288,6 +288,12 @@ public class ReservationServiceImpl extends ServiceImpl<ReservationMapper, Reser
|
||||
return reservationMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Reservation> selectReservationListByDay() {
|
||||
|
||||
return reservationMapper.selectReservationListByDay();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 比较一个 HH:mm:ss 是否在一个时间段内
|
||||
|
@ -75,4 +75,7 @@ public interface IReservationService extends IService<Reservation> {
|
||||
void selectTimeByMeetingRoomTime(Reservation reservation);
|
||||
|
||||
List<Reservation> selectByRoomContent(RoomContent roomContent);
|
||||
|
||||
List<Reservation> selectReservationListByDay();
|
||||
|
||||
}
|
||||
|
@ -216,6 +216,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<select id="selectUserByMobileAndOpenId" resultType="com.ics.common.core.domain.IcsCustomerStaff">
|
||||
<include refid="selectIcsCustomerStaffVo"/> where mobile = #{mobile} and park_id = #{parkId}
|
||||
</select>
|
||||
<select id="selectListByCustomerId" resultType="com.ics.common.core.domain.IcsCustomerStaff">
|
||||
SELECT cs.id, cs.username, cs.mobile, cs.create_by, cs.create_time, cs.update_by,cs.name,cs.photo,cs.address,cs.email,cs.degree,cs.urgent,cs.update_time,
|
||||
cs.delete_flag, cs.ics_customer_id, cs.openid, cs.avatar, cs.gender, cs.status, cs.park_id,cs.card_no,cs.data_type
|
||||
FROM ics_customer_staff cs
|
||||
left join tb_staff_customer tsc on cs.id = tsc.staff_id
|
||||
WHERE tsc.ics_customer_id = 85
|
||||
ORDER BY CONVERT(cs.name USING GBK) ASC
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
@ -27,7 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</sql>
|
||||
|
||||
<select id="selectWisdomRoomList" parameterType="WisdomRoom" resultMap="WisdomRoomResult">
|
||||
SELECT wr.id, wr.type, wr.meeting_name, wr.start_time, wr.end_date,img, wr.create_by, wr.create_time,
|
||||
SELECT distinct wr.id, wr.type, wr.meeting_name, wr.start_time, wr.end_date,img, wr.create_by, wr.create_time,
|
||||
wr.update_by, wr.update_time, wr.version, wr.delete_flag, wr.remake, wr.tenant_id, wr.park_id FROM tb_wisdom_room wr
|
||||
left join tb_wisdom_staff ws on ws.wisdom_room_id = wr.id
|
||||
<where>
|
||||
|
@ -12,13 +12,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="startTime" column="start_time" />
|
||||
<result property="dataType" column="data_type" />
|
||||
<result property="endDate" column="end_date" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="reservationId" column="reservation_id" />
|
||||
<result property="tenantId" column="tenant_id" />
|
||||
<result property="parkId" column="park_id" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectWisdomStaffVo">
|
||||
SELECT id, wisdom_room_id, staff_id, delete_flag, create_by, create_time, update_by, update_time, tenant_id, park_id FROM tb_wisdom_staff
|
||||
SELECT id, wisdom_room_id, staff_id,data_type,reservation_id, delete_flag,start_time,end_date, create_by, create_time, update_by, update_time, tenant_id, park_id FROM tb_wisdom_staff
|
||||
</sql>
|
||||
|
||||
<select id="selectWisdomStaffList" parameterType="WisdomStaff" resultMap="WisdomStaffResult">
|
||||
@ -41,6 +45,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="deleteFlag != null ">delete_flag,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
<if test="createTime != null ">create_time,</if>
|
||||
<if test="startTime != null ">start_time,</if>
|
||||
<if test="dataType != null ">data_type,</if>
|
||||
<if test="reservationId != null ">reservation_id,</if>
|
||||
<if test="endDate != null ">end_date,</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by,</if>
|
||||
<if test="updateTime != null ">update_time,</if>
|
||||
<if test="tenantId != null ">tenant_id,</if>
|
||||
@ -53,6 +61,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="deleteFlag != null ">#{deleteFlag},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
<if test="createTime != null ">#{createTime},</if>
|
||||
<if test="dataType != null ">#{dataType},</if>
|
||||
<if test="startTime != null ">#{startTime},</if>
|
||||
<if test="reservationId != null ">#{reservationId},</if>
|
||||
<if test="endDate != null ">#{endDate},</if>
|
||||
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
|
||||
<if test="updateTime != null ">#{updateTime},</if>
|
||||
<if test="tenantId != null ">#{tenantId},</if>
|
||||
@ -68,6 +80,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="deleteFlag != null ">delete_flag = #{deleteFlag},</if>
|
||||
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
|
||||
<if test="createTime != null ">create_time = #{createTime},</if>
|
||||
<if test="startTime != null ">start_time = #{startTime},</if>
|
||||
<if test="dataType != null ">data_type = #{dataType},</if>
|
||||
<if test="reservationId != null ">reservation_id = #{reservationId},</if>
|
||||
<if test="endDate != null ">end_date = #{endDate},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null ">update_time = #{updateTime},</if>
|
||||
<if test="tenantId != null ">tenant_id = #{tenantId},</if>
|
||||
|
@ -78,6 +78,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
ORDER BY start_time ASC
|
||||
|
||||
</select>
|
||||
<select id="selectReservationListByDay" resultType="com.ics.admin.domain.meeting.Reservation">
|
||||
<include refid="selectReservationVo"/>
|
||||
WHERE
|
||||
DATE_FORMAT( start_time, '%Y-%m-%d' ) = DATE_FORMAT(now(), '%Y-%m-%d' )
|
||||
and `stauts` = 1 and `park_id` = '26'
|
||||
</select>
|
||||
|
||||
<insert id="insertReservation" parameterType="Reservation">
|
||||
INSERT INTO tb_reservation
|
||||
|
@ -69,7 +69,7 @@ public class Sample {
|
||||
json.put("time",DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss",date));
|
||||
json.put("meeting",meetingName);
|
||||
json.put("thing",thing);
|
||||
json.put("palce",place);
|
||||
json.put("place",place);
|
||||
|
||||
SendSmsRequest sendReq = new SendSmsRequest()
|
||||
.setPhoneNumbers(phone)
|
||||
|
@ -34,7 +34,7 @@ public class SignUtils {
|
||||
}
|
||||
|
||||
public static void lock(String lockId){
|
||||
String appID = "90000021";
|
||||
String appID = "8888";
|
||||
String key = "cootoo";
|
||||
Long time = System.currentTimeMillis();
|
||||
|
||||
@ -42,20 +42,21 @@ public class SignUtils {
|
||||
JSONObject on =new JSONObject();
|
||||
on.put("appID",appID);
|
||||
on.put("requestID",time);
|
||||
on.put("peopleID","20249002");
|
||||
on.put("peopleID","20249001");
|
||||
on.put("lockID",lockId);
|
||||
on.put("time",time);
|
||||
on.put("sign",sign(appID,key,time));
|
||||
|
||||
Map<String, String > heads = new HashMap<>();
|
||||
|
||||
HttpRequest.post("http://111.23.208.229:8088/cootoo/openLock")
|
||||
.headerMap(heads,false)
|
||||
.body(on.toString()).timeout(30*1000).execute().body();
|
||||
String body = HttpRequest.post("http://218.81.144.84:8888/cootoo/openLock")
|
||||
.headerMap(heads, false)
|
||||
.body(on.toString()).timeout(30 * 1000).execute().body();
|
||||
System.out.println(body);
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
lock("240");
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,60 @@
|
||||
package com.ics.quartz.task;
|
||||
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.ics.admin.domain.meeting.Reservation;
|
||||
import com.ics.admin.service.meeting.IReservationService;
|
||||
import com.ics.common.utils.device.WisDomDeviceUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@Service("meetingOpenStatusTask")
|
||||
public class MeetingOpenStatusTask {
|
||||
|
||||
@Autowired
|
||||
private IReservationService iReservationService;
|
||||
|
||||
|
||||
public void meetingOpen() {
|
||||
|
||||
|
||||
//获取当天所有预约的会议室
|
||||
List<Reservation> reservations = iReservationService.selectReservationListByDay();
|
||||
|
||||
if (CollUtil.isNotEmpty(reservations)){
|
||||
for (Reservation reservation : reservations) {
|
||||
log.info("预约会议室信息111111111111:"+reservation);
|
||||
Date date = new Date();
|
||||
|
||||
Date next = DateUtil.offsetMinute(date, 15);
|
||||
String format = DateUtil.format(next, "HH:mm");
|
||||
Date startTime = reservation.getStartTime();
|
||||
String format1 = DateUtil.format(startTime, "HH:mm");
|
||||
log.info("时间为==============="+(format.equals(format1)));
|
||||
if (format.equals(format1)) {
|
||||
log.info("结果为------------");
|
||||
//大会议室
|
||||
if (reservation.getRoomContentId() == 52L) {
|
||||
Boolean aBoolean = WisDomDeviceUtils.shortControl("312", 1);
|
||||
log.info("大会议室情景结果为:"+ aBoolean);
|
||||
} else if (reservation.getRoomContentId() == 53L) {//茶室
|
||||
Boolean aBoolean = WisDomDeviceUtils.shortControl("286", 1);
|
||||
log.info("茶室情景结果为:"+aBoolean);
|
||||
} else if (reservation.getRoomContentId() == 54L) { //小会议室
|
||||
WisDomDeviceUtils.deviceControl("244", true);
|
||||
WisDomDeviceUtils.deviceControl("245", true);
|
||||
WisDomDeviceUtils.deviceControl("246", true);
|
||||
log.info("小会议室情景结果为:");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -1,11 +1,17 @@
|
||||
package com.ics.controller.mobile.meeting;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.ics.admin.domain.WisdomDevice;
|
||||
import com.ics.admin.domain.WisdomStaff;
|
||||
import com.ics.admin.domain.meeting.*;
|
||||
import com.ics.admin.domain.meeting.vo.DeviceData;
|
||||
import com.ics.admin.service.IWisdomDeviceService;
|
||||
import com.ics.admin.service.IWisdomRoomService;
|
||||
import com.ics.admin.service.IWisdomStaffService;
|
||||
import com.ics.admin.service.meeting.*;
|
||||
import com.ics.common.core.controller.BaseController;
|
||||
import com.ics.common.core.domain.R;
|
||||
@ -13,6 +19,7 @@ import com.ics.common.core.page.PageDomain;
|
||||
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 lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
@ -20,6 +27,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
import org.wf.jwtp.annotation.Ignore;
|
||||
import org.wf.jwtp.annotation.RequiresPermissions;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@ -46,6 +54,15 @@ public class ApiEquipmentController extends BaseController {
|
||||
@Autowired
|
||||
private RedisTemplate<String, String> redisTemplate;
|
||||
|
||||
@Autowired
|
||||
private IWisdomRoomService wisdomRoomService;
|
||||
|
||||
@Autowired
|
||||
private IWisdomDeviceService wisdomDeviceService;
|
||||
|
||||
@Autowired
|
||||
private IWisdomStaffService wisdomStaffService;
|
||||
|
||||
String smallWxAccessTokenKey = "nantong-";
|
||||
|
||||
//根据用户id查询对应的设备, 楼层分割,房间,设备信息,
|
||||
@ -213,6 +230,40 @@ public class ApiEquipmentController extends BaseController {
|
||||
return R.ok("开门成功");
|
||||
}
|
||||
|
||||
@RequiresPermissions("member:center:view")
|
||||
@GetMapping("/scanChangyangOpenDoor")
|
||||
public R scanChangyangOpenDoor(RoomRecord roomRecord) {
|
||||
|
||||
|
||||
WisdomDevice wisdomDevice = new WisdomDevice();
|
||||
|
||||
//大会议室
|
||||
if(roomRecord.getRoomId() == 237L ){
|
||||
wisdomDevice.setEquipmentNum("238");
|
||||
}else if (roomRecord.getRoomId() == 238L){
|
||||
wisdomDevice.setEquipmentNum("240");
|
||||
}else if (roomRecord.getRoomId() == 239L){
|
||||
wisdomDevice.setEquipmentNum("239");
|
||||
}
|
||||
|
||||
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");
|
||||
if (count1 == 0) {
|
||||
List<WisdomStaff> list = wisdomStaffService.selectListByUserIdAndRoomId(Integer.parseInt(String.valueOf(roomRecord.getUserId())), "1");
|
||||
for (WisdomStaff wisdomStaff : list) {
|
||||
boolean in = DateUtil.isIn(new Date(), wisdomStaff.getStartTime(), wisdomStaff.getEndDate());
|
||||
if (!in) return R.error("该用户没有权限开锁");
|
||||
SignUtils.lock(wisdomDevice.getEquipmentNum());
|
||||
}
|
||||
} else {
|
||||
SignUtils.lock(wisdomDevice.getEquipmentNum());
|
||||
}
|
||||
return R.ok("开门成功");
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 扫描二维码开门 用户id 和设备id
|
||||
*/
|
||||
|
@ -6,9 +6,7 @@ import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.ics.admin.domain.BuildingDetail;
|
||||
import com.ics.admin.domain.Park;
|
||||
import com.ics.admin.domain.Room;
|
||||
import com.ics.admin.domain.*;
|
||||
import com.ics.admin.domain.meeting.*;
|
||||
import com.ics.admin.domain.meeting.vo.MeetingAmountVo;
|
||||
import com.ics.admin.domain.meeting.vo.UserCustomerVo;
|
||||
@ -89,6 +87,9 @@ public class ApiRoomContentController extends BaseController {
|
||||
@Autowired
|
||||
private IRoomServeService roomServeService;
|
||||
|
||||
@Autowired
|
||||
private IWisdomStaffService wisdomStaffService;
|
||||
|
||||
|
||||
/**
|
||||
* 查询条件筛选
|
||||
@ -221,9 +222,6 @@ public class ApiRoomContentController extends BaseController {
|
||||
boolean save = reservationService.save(reservation);
|
||||
Assert.isTrue(save, "预约失败");
|
||||
|
||||
// 预约成功后,获取门锁
|
||||
|
||||
|
||||
//新增预约服务数据
|
||||
|
||||
List<String> serveNames = new ArrayList<>();
|
||||
@ -236,7 +234,8 @@ public class ApiRoomContentController extends BaseController {
|
||||
reservationServeService.insertReservationServe(reservationServe);
|
||||
Long serveId = reservationServe.getServeId();
|
||||
RoomServe roomServe = roomServeService.selectRoomServeById(serveId);
|
||||
if (roomServe !=null && roomServe.getServeType() == 2){
|
||||
System.out.println("roomServe为:" + roomServe);
|
||||
if (roomServe != null && roomServe.getServeType() == 2) {
|
||||
String serveName = reservationServe.getServeName();
|
||||
serveNames.add(serveName);
|
||||
}
|
||||
@ -244,27 +243,55 @@ public class ApiRoomContentController extends BaseController {
|
||||
//判断预约服务
|
||||
Long roomContentId = reservation.getRoomContentId();
|
||||
RoomContent roomContent = roomContentService.selectRoomContentById(roomContentId);
|
||||
if (roomContent !=null){
|
||||
if (roomContent != null) {
|
||||
//获取手机号
|
||||
String expandNum = roomContent.getExpandNum();
|
||||
Date startTime = reservation.getStartTime();
|
||||
String name = customerStaff.getName();
|
||||
if (serveNames.size()>3) return R.error("预约服务不能超过3个");
|
||||
if (CollUtil.isNotEmpty(serveNames)){
|
||||
if (serveNames.size() == 1){
|
||||
Sample.send1(expandNum,name,startTime, roomContent.getMeetingName(),serveNames.get(0) );
|
||||
}else if (serveNames.size() == 2){
|
||||
Sample.send2(expandNum,name,startTime, roomContent.getMeetingName(),serveNames.get(0),serveNames.get(1));
|
||||
}else if (serveNames.size() == 3){
|
||||
Sample.send3(expandNum,name,startTime, roomContent.getMeetingName(),serveNames.get(0),serveNames.get(1),serveNames.get(2));
|
||||
if (serveNames.size() > 3) return R.error("预约服务不能超过3个");
|
||||
if (CollUtil.isNotEmpty(serveNames)) {
|
||||
if (serveNames.size() == 1) {
|
||||
Sample.send1(expandNum, name, startTime, roomContent.getMeetingName(), serveNames.get(0));
|
||||
} else if (serveNames.size() == 2) {
|
||||
Sample.send2(expandNum, name, startTime, roomContent.getMeetingName(), serveNames.get(0), serveNames.get(1));
|
||||
} else if (serveNames.size() == 3) {
|
||||
Sample.send3(expandNum, name, startTime, roomContent.getMeetingName(), serveNames.get(0), serveNames.get(1), serveNames.get(2));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
//新增预约人 门锁权限
|
||||
WisdomStaff wisdomStaff = new WisdomStaff();
|
||||
if (reservation.getRoomContentId() == 52L) wisdomStaff.setWisdomRoomId(3L);
|
||||
if (reservation.getRoomContentId() == 53L) wisdomStaff.setWisdomRoomId(4L);
|
||||
if (reservation.getRoomContentId() == 54L) wisdomStaff.setWisdomRoomId(6L);
|
||||
wisdomStaff.setStaffId(reservation.getUserId());
|
||||
wisdomStaff.setStartTime(reservation.getStartTime());
|
||||
wisdomStaff.setEndDate(reservation.getEndDate());
|
||||
wisdomStaff.setReservationId(reservation.getId());
|
||||
wisdomStaff.setDataType("1");
|
||||
|
||||
int i = wisdomStaffService.insertWisdomStaff(wisdomStaff);
|
||||
//新增参会人和对应门锁权限
|
||||
List<ReservationPerson> reservationPerson = reservation.getReservationPersonList();
|
||||
|
||||
for (ReservationPerson person : reservationPerson) {
|
||||
//新增预约人 门锁权限
|
||||
WisdomStaff wisdomStaff1 = new WisdomStaff();
|
||||
if (reservation.getRoomContentId() == 52L) wisdomStaff1.setWisdomRoomId(3L);
|
||||
if (reservation.getRoomContentId() == 53L) wisdomStaff1.setWisdomRoomId(4L);
|
||||
if (reservation.getRoomContentId() == 54L) wisdomStaff1.setWisdomRoomId(6L);
|
||||
wisdomStaff1.setStaffId(person.getUserId());
|
||||
wisdomStaff1.setStartTime(reservation.getStartTime());
|
||||
wisdomStaff1.setEndDate(reservation.getEndDate());
|
||||
wisdomStaff1.setReservationId(reservation.getId());
|
||||
wisdomStaff1.setDataType("1");
|
||||
|
||||
int count = wisdomStaffService.insertWisdomStaff(wisdomStaff1);
|
||||
}
|
||||
|
||||
Long id = reservation.getId();
|
||||
return toAjax(save).put("reservationId", id);
|
||||
return toAjax(save).put("reservationId", id);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -297,7 +324,7 @@ public class ApiRoomContentController extends BaseController {
|
||||
reservation.setStauts(Reservation.Status.TO_BE_PAID);
|
||||
Long userId = reservation.getUserId();
|
||||
|
||||
if (reservation.getCreateBy() ==null){
|
||||
if (reservation.getCreateBy() == null) {
|
||||
reservation.setCreateBy(customerStaff.getUsername());
|
||||
}
|
||||
// reservation.setCreateBy();
|
||||
@ -360,7 +387,7 @@ public class ApiRoomContentController extends BaseController {
|
||||
Long id = reservation.getId();
|
||||
return toAjax(save).put("reservationId", id);
|
||||
} else {
|
||||
if (reservation.getCreateBy() ==null){
|
||||
if (reservation.getCreateBy() == null) {
|
||||
reservation.setCreateBy(customerStaff.getUsername());
|
||||
}
|
||||
boolean save = reservationService.save(reservation);
|
||||
@ -473,6 +500,16 @@ public class ApiRoomContentController extends BaseController {
|
||||
reservation.setAvatar(icsCustomerStaff.getAvatar());
|
||||
}
|
||||
|
||||
List<IcsCustomerStaff> wisdomStaffs = wisdomStaffService.selectListByReservationId(id);
|
||||
List<ReservationPerson> reservationPeople = new ArrayList<>();
|
||||
for (IcsCustomerStaff wisdomStaff : wisdomStaffs) {
|
||||
ReservationPerson reservationPerson = new ReservationPerson();
|
||||
reservationPerson.setUserId(wisdomStaff.getId());
|
||||
reservationPerson.setUserName(wisdomStaff.getUsername());
|
||||
reservationPeople.add(reservationPerson);
|
||||
}
|
||||
reservation.setReservationPersonList(reservationPeople);
|
||||
|
||||
Ticket ticket = ticketService.selectTicketById(reservation.getTicketId());
|
||||
if (null != ticket) {
|
||||
reservation.setTicketName(ticket.getTitle());
|
||||
@ -495,8 +532,8 @@ public class ApiRoomContentController extends BaseController {
|
||||
}
|
||||
reservation.setRoomContent(roomContent);
|
||||
|
||||
List<ReservationServe> reservationServes = reservationServeService.selectReservationServeByReservationId(reservation.getId());
|
||||
if (CollUtil.isNotEmpty(reservationServes)){
|
||||
List<ReservationServe> reservationServes = reservationServeService.selectReservationServeByReservationId(reservation.getId());
|
||||
if (CollUtil.isNotEmpty(reservationServes)) {
|
||||
for (ReservationServe reservationServe : reservationServes) {
|
||||
reservationServe.setServeName(roomServeService.selectRoomServeById(reservationServe.getServeId()).getServeName());
|
||||
}
|
||||
@ -539,6 +576,12 @@ public class ApiRoomContentController extends BaseController {
|
||||
@PostMapping("/addVisitor")
|
||||
public R addVisitor(@RequestBody ReservationPerson reservationPerson) {
|
||||
|
||||
if (reservationPerson.getParkId() == 26L) {
|
||||
Long reservationId = reservationPerson.getReservationId();
|
||||
Integer count = wisdomStaffService.selectListByReservationIdAndUserId(reservationId, reservationPerson.getParticipantId());
|
||||
if (count <= 0) return R.error("您没有参会权限");
|
||||
}
|
||||
|
||||
reservationPerson.setStatus("1");
|
||||
reservationPerson.setJoinTime(new Date());
|
||||
IcsCustomerStaff customerStaff = customerStaffService.selectIcsCustomerStaffById(reservationPerson.getParticipantId());
|
||||
@ -600,16 +643,16 @@ public class ApiRoomContentController extends BaseController {
|
||||
|
||||
Assert.notNull(reservation.getId(), "当前预约信息不存在");
|
||||
reservation.setStauts(Reservation.Status.CANCELED);
|
||||
reservation.setCancelResaon("用户取消原因:"+reservation.getCancelResaon());
|
||||
reservation.setCancelResaon("用户取消原因:" + reservation.getCancelResaon());
|
||||
reservation.setCancelTime(new Date());
|
||||
int i = reservationService.updateReservation(reservation);
|
||||
|
||||
//取消订单,返还优惠券
|
||||
if (i > 0) {
|
||||
Long ticketId = reservation.getTicketId();
|
||||
if (ticketId !=null){
|
||||
if (ticketId != null) {
|
||||
Ticket ticket = ticketService.selectTicketById(ticketId);
|
||||
if (ticket != null){
|
||||
if (ticket != null) {
|
||||
Long customerId = reservation.getCustomerId();
|
||||
CustomerTicket customerTicket = new CustomerTicket();
|
||||
customerTicket.setTicketId(ticketId);
|
||||
@ -702,6 +745,17 @@ public class ApiRoomContentController extends BaseController {
|
||||
return R.data(reservationPeople);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取人员列表(上海长阳)
|
||||
*/
|
||||
@RequiresPermissions("member:center:view")
|
||||
@GetMapping("getChangyangPersonList")
|
||||
public R getChangyangPersonList() {
|
||||
List<IcsCustomerStaff> icsCustomerStaffs = customerStaffService.selectListByCustomerId();
|
||||
return R.data(icsCustomerStaffs);
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static boolean timeIsInRound(String str1, String start, String end) {
|
||||
SimpleDateFormat df = new SimpleDateFormat("HH:mm:ss");
|
||||
@ -730,7 +784,7 @@ public class ApiRoomContentController extends BaseController {
|
||||
Calendar end = Calendar.getInstance();
|
||||
end.setTime(endTime);
|
||||
|
||||
return date.compareTo(begin) >=0 && date.compareTo(end) <=0;
|
||||
return date.compareTo(begin) >= 0 && date.compareTo(end) <= 0;
|
||||
}
|
||||
|
||||
|
||||
|
@ -2,9 +2,12 @@ package com.ics.controller.mobile.wisdom;
|
||||
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.ics.admin.domain.*;
|
||||
import com.ics.admin.domain.meeting.Reservation;
|
||||
import com.ics.admin.service.*;
|
||||
import com.ics.admin.service.meeting.IReservationService;
|
||||
import com.ics.common.core.controller.BaseController;
|
||||
import com.ics.common.core.domain.R;
|
||||
import com.ics.common.utils.device.SignUtils;
|
||||
@ -18,6 +21,8 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
import org.wf.jwtp.annotation.Ignore;
|
||||
import org.wf.jwtp.annotation.RequiresPermissions;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@ -44,6 +49,9 @@ public class WisdomApiController extends BaseController {
|
||||
@Autowired
|
||||
private IWisdomPanelEquipmentService wisdomPanelEquipmentService;
|
||||
|
||||
@Autowired
|
||||
private IReservationService iReservationService;
|
||||
|
||||
|
||||
/**
|
||||
* 获取所有房间信息
|
||||
@ -75,11 +83,25 @@ public class WisdomApiController extends BaseController {
|
||||
|
||||
@RequiresPermissions("member:center:view")
|
||||
@RequestMapping("/getAllDeviceInfoByRoomId")
|
||||
public R getAllDeviceInfoByRoomId(Long id ) {
|
||||
WisdomDevice wisdomDevice = new WisdomDevice();
|
||||
wisdomDevice.setWisdomRoomId(id);
|
||||
List<WisdomDevice> wisdomDevices = wisdomDeviceService.selectWisdomDeviceList(wisdomDevice);
|
||||
return R.data(wisdomDevices);
|
||||
public R getAllDeviceInfoByRoomId(Long id) {
|
||||
long currentUserId = getLoginStaffId();
|
||||
|
||||
//获取用户id 判断会议预约还是管理员
|
||||
Integer integer = wisdomStaffService.selectByUserIdAndRoomId(Integer.parseInt(String.valueOf(currentUserId)), "0");
|
||||
if (integer > 0) {
|
||||
WisdomDevice wisdomDevice = new WisdomDevice();
|
||||
wisdomDevice.setWisdomRoomId(id);
|
||||
List<WisdomDevice> wisdomDevices = wisdomDeviceService.selectWisdomDeviceList(wisdomDevice);
|
||||
return R.data(wisdomDevices);
|
||||
} else {
|
||||
Integer count = wisdomStaffService.selectByUserIdAndRoomId(Integer.parseInt(String.valueOf(currentUserId)), "1");
|
||||
if (count <= 0) return R.error("您没有权限查看该房间设备");
|
||||
WisdomDevice wisdomDevice = new WisdomDevice();
|
||||
wisdomDevice.setWisdomRoomId(id);
|
||||
wisdomDevice.setType("门锁");
|
||||
List<WisdomDevice> wisdomDevices = wisdomDeviceService.selectWisdomDeviceList(wisdomDevice);
|
||||
return R.data(wisdomDevices);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -88,7 +110,10 @@ public class WisdomApiController extends BaseController {
|
||||
|
||||
@RequiresPermissions("member:center:view")
|
||||
@GetMapping("/getAllPanelInfoByRoomId")
|
||||
public R getAllPanelInfoByRoomId(Long id ) {
|
||||
public R getAllPanelInfoByRoomId(Long id) {
|
||||
long currentUserId = getLoginStaffId();
|
||||
Integer integer = wisdomStaffService.selectByUserIdAndRoomId(Integer.parseInt(String.valueOf(currentUserId)), "0");
|
||||
if (integer <= 0) return R.data(new ArrayList<>());
|
||||
WisdomPanel wisdomPanel = new WisdomPanel();
|
||||
wisdomPanel.setWisdomRoom(id);
|
||||
List<WisdomPanel> wisdomPanels = wisdomPanelService.selectWisdomPanelList(wisdomPanel);
|
||||
@ -117,17 +142,38 @@ public class WisdomApiController extends BaseController {
|
||||
public R callApiByDeviceId(@RequestBody DeviceVo deviceVo) {
|
||||
|
||||
WisdomDevice wisdomDevice = wisdomDeviceService.selectWisdomDeviceById(deviceVo.getDeviceId());
|
||||
if (wisdomDevice.getType().equals("灯条")) WisDomDeviceUtils.deviceControl(wisdomDevice.getEquipmentNum(),deviceVo.getActionArg());
|
||||
if (wisdomDevice.getType().equals("调光灯")){
|
||||
if (wisdomDevice.getType().equals("灯条"))
|
||||
WisDomDeviceUtils.deviceControl(wisdomDevice.getEquipmentNum(), deviceVo.getActionArg());
|
||||
if (wisdomDevice.getType().equals("调光灯")) {
|
||||
Boolean aBoolean = deviceVo.getBir() == null ? WisDomDeviceUtils.dimmingOpenControl(wisdomDevice.getEquipmentNum(), deviceVo.getActionArg()) : WisDomDeviceUtils.dimmingControl(wisdomDevice.getEquipmentNum(), deviceVo.getBir(), deviceVo.getColourTemperature());
|
||||
if (!aBoolean) return R.error("调光灯操作失败");
|
||||
}
|
||||
if (wisdomDevice.getType().equals("插座")) WisDomDeviceUtils.socketControl(wisdomDevice.getEquipmentNum(),deviceVo.getActionArg());
|
||||
if (wisdomDevice.getType().equals("雾化玻璃")) WisDomDeviceUtils.deviceControl(wisdomDevice.getEquipmentNum(),deviceVo.getActionArg());
|
||||
if (wisdomDevice.getType().equals("插座"))
|
||||
WisDomDeviceUtils.socketControl(wisdomDevice.getEquipmentNum(), deviceVo.getActionArg());
|
||||
if (wisdomDevice.getType().equals("雾化玻璃"))
|
||||
WisDomDeviceUtils.deviceControl(wisdomDevice.getEquipmentNum(), deviceVo.getActionArg());
|
||||
|
||||
//todo 窗帘接口
|
||||
if (wisdomDevice.getType().equals("窗帘")) WisDomDeviceUtils.openCover(wisdomDevice.getEquipmentNum(), deviceVo.getCoverType());
|
||||
if (wisdomDevice.getType().equals("门锁")) SignUtils.lock(wisdomDevice.getEquipmentNum());
|
||||
if (wisdomDevice.getType().equals("窗帘"))
|
||||
WisDomDeviceUtils.openCover(wisdomDevice.getEquipmentNum(), deviceVo.getCoverType());
|
||||
if (wisdomDevice.getType().equals("门锁")) {
|
||||
Integer loginStaffId = this.getLoginStaffId();
|
||||
//获取用户id 判断改用户是否可以开锁
|
||||
|
||||
Integer count = wisdomStaffService.selectByUserIdAndRoomId(loginStaffId, null);
|
||||
if (count == 0) return R.error("该用户没有权限开锁");
|
||||
Integer count1 = wisdomStaffService.selectByUserIdAndRoomId(loginStaffId, "0");
|
||||
if (count1 == 0) {
|
||||
List<WisdomStaff> list = wisdomStaffService.selectListByUserIdAndRoomId(loginStaffId, "1");
|
||||
for (WisdomStaff wisdomStaff : list) {
|
||||
boolean in = DateUtil.isIn(new Date(), wisdomStaff.getStartTime(), wisdomStaff.getEndDate());
|
||||
if (!in) return R.error("该用户没有权限开锁");
|
||||
SignUtils.lock(wisdomDevice.getEquipmentNum());
|
||||
}
|
||||
} else {
|
||||
SignUtils.lock(wisdomDevice.getEquipmentNum());
|
||||
}
|
||||
}
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ -138,21 +184,59 @@ public class WisdomApiController extends BaseController {
|
||||
@RequestMapping("/callApiByPanelId")
|
||||
public R callApiByPanelId(@RequestBody WisdomPanel panelVo) {
|
||||
WisdomPanel wisdomPanel = wisdomPanelService.selectWisdomPanelById(panelVo.getId());
|
||||
if(wisdomPanel !=null){
|
||||
if (wisdomPanel != null) {
|
||||
Boolean aBoolean = WisDomDeviceUtils.shortControl(wisdomPanel.getPanelId(), wisdomPanel.getButtonId());
|
||||
//设备 窗帘
|
||||
// String panelId = wisdomPanel.getPanelId();
|
||||
// List<WisdomPanelEquipment> list = wisdomPanelEquipmentService.selectWisdomPanelEquipmentByPanelId(panelId);
|
||||
// if (CollUtil.isNotEmpty(list)) {
|
||||
// //如果设备id不等于空
|
||||
// for (WisdomPanelEquipment panelEquipment : list) {
|
||||
// WisdomDevice equipment = wisdomDeviceService.getById(panelEquipment.getEquipmentId());
|
||||
// if (null != equipment) {
|
||||
// Boolean aBoolean1 = WisDomDeviceUtils.openCover(equipment.getEquipmentNum(), panelEquipment.getType());
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
List<WisdomPanelEquipment> list = wisdomPanelEquipmentService.selectWisdomPanelEquipmentByPanelId(wisdomPanel.getId());
|
||||
if (CollUtil.isNotEmpty(list)) {
|
||||
//如果设备id不等于空
|
||||
for (WisdomPanelEquipment panelEquipment : list) {
|
||||
WisdomDevice equipment = wisdomDeviceService.getById(panelEquipment.getEquipmentId());
|
||||
if (null != equipment) {
|
||||
Boolean aBoolean1 = WisDomDeviceUtils.openCover(equipment.getEquipmentNum(), panelEquipment.getType());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
@Ignore
|
||||
@RequestMapping("/meetingOpen")
|
||||
public R meetingOpen() {
|
||||
//获取当天所有预约的会议室
|
||||
List<Reservation> reservations = iReservationService.selectReservationListByDay();
|
||||
|
||||
for (Reservation reservation : reservations) {
|
||||
log.info("预约会议室信息111111111111:" + reservation);
|
||||
Date date = new Date();
|
||||
|
||||
Date next = DateUtil.offsetMinute(date, 15);
|
||||
String format = DateUtil.format(next, "HH:mm");
|
||||
Date startTime = reservation.getStartTime();
|
||||
String format1 = DateUtil.format(startTime, "HH:mm");
|
||||
log.info("时间为===============" + (format.equals(format1)));
|
||||
if (format.equals(format1)) {
|
||||
log.info("结果为------------");
|
||||
//大会议室
|
||||
if (reservation.getRoomContentId() == 52L) {
|
||||
Boolean aBoolean = WisDomDeviceUtils.shortControl("312", 1);
|
||||
log.info("大会议室情景结果为:" + aBoolean);
|
||||
} else if (reservation.getRoomContentId() == 53L) {//茶室
|
||||
Boolean aBoolean = WisDomDeviceUtils.shortControl("286", 1);
|
||||
log.info("茶室情景结果为:" + aBoolean);
|
||||
} else if (reservation.getRoomContentId() == 54L) { //小会议室
|
||||
WisDomDeviceUtils.deviceControl("244", true);
|
||||
WisDomDeviceUtils.deviceControl("245", true);
|
||||
WisDomDeviceUtils.deviceControl("246", true);
|
||||
log.info("小会议室情景结果为:");
|
||||
}
|
||||
}
|
||||
}
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -73,7 +73,7 @@ dfs:
|
||||
# domain: http://222.184.49.22:9227
|
||||
# path: D:/ruoyi/uploadPath
|
||||
domain: http://192.168.0.11:9227
|
||||
path: F:/ruoyi/uploadPath
|
||||
path: D:/博越/ruoyi/uploadPath
|
||||
|
||||
# 公众号配置(必填)
|
||||
wx:
|
||||
@ -137,7 +137,7 @@ mybatis-plus:
|
||||
weixin:
|
||||
appid: wx5582a07c1fbbcf06 # appid
|
||||
mch-serial-no: 5899B7D34B161F9E24EFFCD50E95245521CA40AB # 证书序列号
|
||||
private-key-path: F:/cert/dbd/apiclient_key.pem # 证书路径
|
||||
private-key-path: D:/博越/cert/dbd/apiclient_key.pem # 证书路径
|
||||
mch-id: 1665472343 # 商户号
|
||||
key: CHANGYANGKONGGUhenanjianandianzi # APIv3密钥
|
||||
domain: https://api.mch.weixin.qq.com # 微信服务器地址
|
||||
|
@ -27,7 +27,7 @@ spring:
|
||||
main:
|
||||
allow-bean-definition-overriding: true
|
||||
profiles:
|
||||
active: prod
|
||||
active: dev
|
||||
jackson:
|
||||
date-format: yyyy-MM-dd HH:mm:ss
|
||||
time-zone: GMT+8
|
||||
|
Loading…
x
Reference in New Issue
Block a user